PageRenderTime 56ms CodeModel.GetById 25ms RepoModel.GetById 0ms app.codeStats 0ms

/baser/plugins/mail/views/mail_contents/admin/form.php

https://github.com/hashing/basercms
PHP | 319 lines | 292 code | 9 blank | 18 comment | 18 complexity | 3705363cf4adb73d2d324a17b56fa276 MD5 | raw file
Possible License(s): MIT
  1. <?php
  2. /* SVN FILE: $Id$ */
  3. /**
  4. * [ADMIN] メールコンテンツ フォーム
  5. *
  6. * PHP versions 5
  7. *
  8. * baserCMS : Based Website Development Project <http://basercms.net>
  9. * Copyright 2008 - 2012, baserCMS Users Community <http://sites.google.com/site/baserusers/>
  10. *
  11. * @copyright Copyright 2008 - 2012, baserCMS Users Community
  12. * @link http://basercms.net baserCMS Project
  13. * @package baser.plugins.mail.views
  14. * @since baserCMS v 0.1.0
  15. * @version $Revision$
  16. * @modifiedby $LastChangedBy$
  17. * @lastmodified $Date$
  18. * @license http://basercms.net/license/index.html
  19. */
  20. ?>
  21. <script type="text/javascript">
  22. $(window).load(function() {
  23. $("#MailContentName").focus();
  24. });
  25. $(function(){
  26. $('input[name="data[MailContent][sender_1_]"]').click(mailContentSender1ClickHandler);
  27. $("#MailContentSender1").hide();
  28. if($('input[name="data[MailContent][sender_1_]"]:checked').val()===undefined){
  29. if($("#MailContentSender1").val()!=''){
  30. $("#MailContentSender11").attr('checked',true);
  31. }else{
  32. $("#MailContentSender10").attr('checked',true);
  33. }
  34. }
  35. $("#EditLayout").click(function(){
  36. if(confirm('メールフォーム設定を保存して、レイアウトテンプレート '+$("#MailContentLayoutTemplate").val()+' の編集画面に移動します。よろしいですか?')){
  37. $("#MailContentEditLayout").val(1);
  38. $("#MailContentEditMailForm").val('');
  39. $("#MailContentEditMail").val('');
  40. $("#MailContentEditForm").submit();
  41. }
  42. });
  43. $("#EditForm").click(function(){
  44. if(confirm('メールフォーム設定を保存して、メールフォームテンプレート '+$("#MailContentFormTemplate").val()+' の編集画面に移動します。よろしいですか?')){
  45. $("#MailContentEditLayout").val('');
  46. $("#MailContentEditMailForm").val(1);
  47. $("#MailContentEditMail").val('');
  48. $("#MailContentEditForm").submit();
  49. }
  50. });
  51. $("#EditMail").click(function(){
  52. if(confirm('メールフォーム設定を保存して、送信メールテンプレート '+$("#MailContentMailTemplate").val()+' の編集画面に移動します。よろしいですか?')){
  53. $("#MailContentEditLayout").val('');
  54. $("#MailContentEditMailForm").val('');
  55. $("#MailContentEditMail").val(1);
  56. $("#MailContentEditForm").submit();
  57. }
  58. });
  59. mailContentSender1ClickHandler();
  60. });
  61. function mailContentSender1ClickHandler(){
  62. if($('input[name="data[MailContent][sender_1_]"]:checked').val()=='1'){
  63. $("#MailContentSender1").slideDown(100);
  64. }else{
  65. $("#MailContentSender1").slideUp(100);
  66. }
  67. }
  68. </script>
  69. <?php if($this->action == 'admin_edit'): ?>
  70. <div class="em-box align-left">このメールフォームのURL
  71. <?php $bcBaser->link(
  72. $bcBaser->getUri('/' . $mailContent['MailContent']['name'] . '/index'),
  73. '/' . $mailContent['MailContent']['name'] . '/index',
  74. array('target'=>'_blank')) ?>
  75. </div>
  76. <?php endif ?>
  77. <!-- form -->
  78. <h2>基本項目</h2>
  79. <?php echo $bcForm->create('MailContent') ?>
  80. <div class="section">
  81. <table cellpadding="0" cellspacing="0" id="FormTable" class="form-table">
  82. <?php if($this->action == 'admin_edit'): ?>
  83. <tr>
  84. <th class="col-head"><?php echo $bcForm->label('MailContent.id', 'NO') ?></th>
  85. <td class="col-input">
  86. <?php echo $bcForm->value('MailContent.id') ?>
  87. <?php echo $bcForm->input('MailContent.id', array('type' => 'hidden')) ?>
  88. </td>
  89. </tr>
  90. <?php endif; ?>
  91. <tr>
  92. <th class="col-head"><?php echo $bcForm->label('MailContent.name', 'メールフォームアカウント名') ?>&nbsp;<span class="required">*</span></th>
  93. <td class="col-input">
  94. <?php echo $bcForm->input('MailContent.name', array('type' => 'text', 'size' => 40, 'maxlength' => 255)) ?>
  95. <?php echo $html->image('admin/icn_help.png', array('id' => 'helpName', 'class' => 'btn help', 'alt' => 'ヘルプ')) ?>
  96. <?php echo $bcForm->error('MailContent.name') ?>
  97. <div id="helptextName" class="helptext">
  98. <ul>
  99. <li>メールフォームのURLに利用します<br />
  100. <div class="example-box">()メールフォームアカウント名が test の場合<br />http://{baserCMS設置URL}/test/index</div></li>
  101. <li>半角英数字ハイフンアンダースコアで入力してください</li>
  102. </ul>
  103. </div>
  104. </td>
  105. </tr>
  106. <tr>
  107. <th class="col-head"><?php echo $bcForm->label('MailContent.title', 'メールフォームタイトル') ?>&nbsp;<span class="required">*</span></th>
  108. <td class="col-input">
  109. <?php echo $bcForm->input('MailContent.title', array('type' => 'text', 'size' => 40, 'maxlength' => 255)) ?>
  110. <?php echo $bcForm->error('MailContent.title') ?>
  111. </td>
  112. </tr>
  113. <tr>
  114. <th class="col-head"><?php echo $bcForm->label('MailContent.description', 'メールフォーム説明文') ?></th>
  115. <td class="col-input">
  116. <?php echo $bcForm->ckeditor('MailContent.description', null, array('width' => 'auto', 'height' => '120px', 'type' => 'simple')) ?>
  117. <?php echo $bcForm->error('MailContent.description') ?>
  118. </td>
  119. </tr>
  120. <tr>
  121. <th class="col-head"><?php echo $bcForm->label('MailContent.sender_1', '送信先メールアドレス') ?>&nbsp;<span class="required">*</span></th>
  122. <td class="col-input">
  123. <?php echo $bcForm->input('MailContent.sender_1_', array(
  124. 'type' => 'radio',
  125. 'options' => array('0' => '管理者用メールアドレスに送信する', '1' => '別のメールアドレスに送信する'),
  126. 'legend' => false,
  127. 'separator' => '<br />')) ?><br />
  128. <?php echo $bcForm->input('MailContent.sender_1', array('type' => 'text', 'size' => 40, 'maxlength' => 255)) ?>
  129. <?php echo $bcForm->error('MailContent.sender_1') ?>
  130. </td>
  131. </tr>
  132. <tr>
  133. <th class="col-head"><?php echo $bcForm->label('MailContent.sender_name', '送信先名') ?>&nbsp;<span class="required">*</span></th>
  134. <td class="col-input">
  135. <?php echo $bcForm->input('MailContent.sender_name', array('type' => 'text', 'size' => 80, 'maxlength' => 255)) ?>
  136. <?php echo $html->image('admin/icn_help.png', array('id' => 'helpSenderName', 'class' => 'btn help', 'alt' => 'ヘルプ')) ?>
  137. <?php echo $bcForm->error('MailContent.sender_name') ?>
  138. <div id="helptextSenderName" class="helptext">自動返信メールの送信者に表示します</div>
  139. </td>
  140. </tr>
  141. <tr>
  142. <th class="col-head"><?php echo $bcForm->label('MailContent.subject_user', '自動返信メール<br />件名<br />[ユーザー宛]') ?>&nbsp;<span class="required">*</span></th>
  143. <td class="col-input">
  144. <?php echo $bcForm->input('MailContent.subject_user', array('type' => 'text', 'size' => 80)) ?>
  145. <?php echo $html->image('admin/icn_help.png', array('id' => 'helpSubjectUser', 'class' => 'btn help', 'alt' => 'ヘルプ')) ?>
  146. <?php echo $bcForm->error('MailContent.subject_user') ?>
  147. <div id="helptextSubjectUser" class="helptext">ユーザー宛の自動返信メールの件名に表示します</div>
  148. </td>
  149. </tr>
  150. <tr>
  151. <th class="col-head"><?php echo $bcForm->label('MailContent.subject_admin', '自動送信メール<br />件名<br />[管理者宛]') ?>&nbsp;<span class="required">*</span></th>
  152. <td class="col-input">
  153. <?php echo $bcForm->input('MailContent.subject_admin', array('type' => 'text', 'size' => 80)) ?>
  154. <?php echo $html->image('admin/icn_help.png', array('id' => 'helpSubjectAdmin', 'class' => 'btn help', 'alt' => 'ヘルプ')) ?>
  155. <?php echo $bcForm->error('MailContent.subject_admin') ?>
  156. <div id="helptextSubjectAdmin" class="helptext">管理者宛の自動送信メールの件名に表示します</div>
  157. </td>
  158. </tr>
  159. <tr>
  160. <th class="col-head"><?php echo $bcForm->label('MailContent.redirect_url', 'リダイレクトURL') ?></th>
  161. <td class="col-input">
  162. <?php echo $bcForm->input('MailContent.redirect_url', array('type' => 'text', 'size' => 80, 'maxlength' => 255)) ?>
  163. <?php echo $html->image('admin/icn_help.png', array('id' => 'helpRedirectUrl', 'class' => 'btn help', 'alt' => 'ヘルプ')) ?>
  164. <?php echo $bcForm->error('MailContent.redirect_url') ?>
  165. <div id="helptextRedirectUrl" class="helptext">
  166. <ul>
  167. <li>メール送信後別のURLにリダイレクトする場合ここにURLを指定します</li>
  168. <li>httpからの完全なURLを指定してください</li>
  169. </ul>
  170. </div>
  171. </td>
  172. </tr>
  173. <tr>
  174. <th class="col-head"><?php echo $bcForm->label('MailContent.auth_capthca', 'イメージ認証') ?>&nbsp;<span class="required">*</span></th>
  175. <td class="col-input">
  176. <?php echo $bcForm->input('MailContent.auth_captcha', array('type' => 'radio', 'options' => $bcText->booleanDoList('利用'), 'legend' => false)) ?>
  177. <?php echo $html->image('admin/icn_help.png', array('id' => 'helpAuthCaptcha', 'class' => 'btn help', 'alt' => 'ヘルプ')) ?>
  178. <?php echo $bcForm->error('MailContent.auth_captcha') ?>
  179. <div id="helptextAuthCaptcha" class="helptext">
  180. <ul>
  181. <li>メールフォーム送信の際表示された画像の文字入力させる事で認証を行ないます</li>
  182. <li>スパムなどいたずら送信が多いが多い場合に設定すると便利です</li>
  183. </ul>
  184. </div>
  185. </td>
  186. </tr>
  187. <tr>
  188. <th class="col-head"><?php echo $bcForm->label('MailContent.ssl_on', 'SSL通信') ?>&nbsp;<span class="required">*</span></th>
  189. <td class="col-input">
  190. <?php echo $bcForm->input('MailContent.ssl_on', array('type' => 'radio', 'options' => $bcText->booleanDoList('利用'), 'legend'=>false)) ?>
  191. <?php echo $html->image('admin/icn_help.png', array('id' => 'helpSslOn', 'class' => 'btn help', 'alt' => 'ヘルプ')) ?>
  192. <?php echo $bcForm->error('MailContent.ssl_on',
  193. 'SSL通信を利用するには、'.$bcBaser->getLink('システム設定', array('controller'=>'site_configs', 'action'=>'form', 'plugin'=>null), array('target'=>'_blank')).'で、
  194. 事前にSSL通信用のWebサイトURLを指定してください', array('escape'=>false)) ?>
  195. <div id="helptextSslOn" class="helptext">
  196. 管理者ページでSSLを利用する場合は事前にSSLの申込設定が必要ですまたSSL通信で利用するURLをシステム設定で指定している必要があります
  197. </div>
  198. </td>
  199. </tr>
  200. </table>
  201. </div>
  202. <h2 class="btn-slide-form"><a href="javascript:void(0)" id="formOption">オプション</a></h2>
  203. <div class="section">
  204. <table cellpadding="0" cellspacing="0" class="form-table slide-body" id="formOptionBody">
  205. <tr>
  206. <th class="col-head"><?php echo $bcForm->label('MailContent.sender_2', 'BCC用送信先メールアドレス') ?></th>
  207. <td class="col-input">
  208. <?php echo $bcForm->input('MailContent.sender_2', array('type' => 'text', 'size' => 80, 'maxlength' => 255)) ?>
  209. <?php echo $html->image('admin/icn_help.png',array('id' => 'helpSender2', 'class' => 'btn help', 'alt' => 'ヘルプ')) ?>
  210. <?php echo $bcForm->error('MailContent.sender_2') ?>
  211. <div id="helptextSender2" class="helptext">
  212. <ul><li>BCCブラインドカーボンコピー用のメールアドレスを指定します</li>
  213. <li>複数の送信先を指定するにはカンマで区切って入力します</li></ul>
  214. </div>
  215. </td>
  216. </tr>
  217. <tr>
  218. <th class="col-head"><?php echo $bcForm->label('MailContent.widget_area', 'ウィジェットエリア') ?>&nbsp;<span class="required">*</span></th>
  219. <td class="col-input">
  220. <?php echo $bcForm->input('MailContent.widget_area', array('type' => 'select', 'options' => $bcForm->getControlsource('WidgetArea.id') , 'empty' => 'サイト基本設定に従う')) ?>
  221. <?php echo $html->image('admin/icn_help.png', array('id' => 'helpWidgetArea', 'class' => 'btn help', 'alt' => 'ヘルプ')) ?>
  222. <?php echo $bcForm->error('MailContent.widget_area') ?>
  223. <div id="helptextWidgetArea" class="helptext">
  224. メールコンテンツで利用するウィジェットエリアを指定します<br />
  225. ウィジェットエリアは<?php $bcBaser->link('ウィジェットエリア管理', array('plugin' => null, 'controller' => 'widget_areas', 'action' => 'index')) ?>より追加できます
  226. </div>
  227. </td>
  228. </tr>
  229. <tr>
  230. <th class="col-head"><?php echo $bcForm->label('MailContent.layout_template', 'レイアウトテンプレート名') ?>&nbsp;<span class="required">*</span></th>
  231. <td class="col-input">
  232. <?php echo $bcForm->input('MailContent.layout_template', array('type' => 'select', 'options' => $mail->getLayoutTemplates())) ?>
  233. <?php echo $bcForm->input('MailContent.edit_layout', array('type' => 'hidden')) ?>
  234. <?php if($this->action == 'admin_edit'): ?>
  235. <?php $bcBaser->link('≫ 編集する','javascript:void(0)', array('id' => 'EditLayout')) ?>
  236. <?php endif ?>
  237. <?php echo $html->image('admin/icn_help.png', array('id' => 'helpLayoutTemplate', 'class' => 'btn help', 'alt' => 'ヘルプ')) ?>
  238. <?php echo $bcForm->error('MailContent.layout_template') ?>
  239. <div id="helptextLayoutTemplate" class="helptext">
  240. <ul>
  241. <li>メールフォームの外枠のテンプレートを指定します</li>
  242. <li>編集するからテンプレートの内容を編集する事ができます</li>
  243. </ul>
  244. </div>
  245. </td>
  246. </tr>
  247. <tr>
  248. <th class="col-head"><?php echo $bcForm->label('MailContent.form_template', 'メールフォームテンプレート名') ?>&nbsp;<span class="required">*</span></th>
  249. <td class="col-input">
  250. <?php echo $bcForm->input('MailContent.form_template', array('type' => 'select', 'options' => $mail->getFormTemplates())) ?>
  251. <?php echo $bcForm->input('MailContent.edit_mail_form', array('type' => 'hidden')) ?>
  252. <?php if($this->action == 'admin_edit'): ?>
  253. <?php $bcBaser->link('≫ 編集する', 'javascript:void(0)', array('id' => 'EditForm')) ?>
  254. <?php endif ?>
  255. <?php echo $html->image('admin/icn_help.png', array('id' => 'helpFormTemplate', 'class' => 'btn help', 'alt' => 'ヘルプ')) ?>
  256. <?php echo $bcForm->error('MailContent.form_template') ?>
  257. <div id="helptextFormTemplate" class="helptext">
  258. <ul>
  259. <li>メールフォーム本体のテンプレートを指定します</li>
  260. <li>編集するからテンプレートの内容を編集する事ができます</li>
  261. </ul>
  262. </div>
  263. </td>
  264. </tr>
  265. <tr>
  266. <th class="col-head"><?php echo $bcForm->label('MailContent.mail_template', '送信メールテンプレート名') ?>&nbsp;<span class="required">*</span></th>
  267. <td class="col-input">
  268. <?php echo $bcForm->input('MailContent.mail_template', array('type' => 'select', 'options' => $mail->getMailTemplates())) ?>
  269. <?php echo $bcForm->input('MailContent.edit_mail', array('type' => 'hidden')) ?>
  270. <?php if($this->action == 'admin_edit'): ?>
  271. <?php $bcBaser->link('≫ 編集する', 'javascript:void(0)', array('id' => 'EditMail')) ?>
  272. <?php endif ?>
  273. <?php echo $html->image('admin/icn_help.png', array('id' => 'helpMailTemplate', 'class' => 'btn help', 'alt' => 'ヘルプ')) ?>
  274. <?php echo $bcForm->error('MailContent.mail_template') ?>
  275. <div id="helptextMailTemplate" class="helptext">
  276. <ul>
  277. <li>送信するメールのテンプレートを指定します</li>
  278. <li>編集するからテンプレートの内容を編集する事ができます</li>
  279. </ul>
  280. </div>
  281. </td>
  282. </tr>
  283. <tr>
  284. <th class="col-head"><?php echo $bcForm->label('MailContent.exclude_search', '公開設定') ?></th>
  285. <td class="col-input">
  286. <?php echo $bcForm->input('MailContent.status', array(
  287. 'type' => 'radio',
  288. 'options' => array(0 => '非公開', 1 => '公開') ,
  289. 'legend' => false,
  290. 'separator' => '&nbsp;&nbsp;')) ?><br />
  291. <?php echo $bcForm->error('MailContent.status') ?>
  292. <?php echo $bcForm->input('MailContent.exclude_search', array('type' => 'checkbox', 'label' => 'このメールフォームをサイト内検索の検索結果より除外する')) ?>
  293. </td>
  294. </tr>
  295. </table>
  296. </div>
  297. <!-- button -->
  298. <div class="submit">
  299. <?php if($this->action == 'admin_add'): ?>
  300. <?php echo $bcForm->submit('登 録', array('div' => false, 'class' => 'btn-red button')) ?>
  301. <?php else: ?>
  302. <?php echo $bcForm->submit('更 新', array('div' => false, 'class' => 'btn-orange button')) ?>
  303. <?php $bcBaser->link('削 除',
  304. array('action' => 'delete', $bcForm->value('MailContent.id')),
  305. array('class' => 'btn-gray button'),
  306. sprintf('%s を本当に削除してもいいですか?\n\n※ 現在このメールフォームに設定されているフィールドは全て削除されます。', $bcForm->value('MailContent.name')),
  307. false); ?>
  308. <?php endif ?>
  309. </div>
  310. <?php echo $bcForm->end() ?>