PageRenderTime 49ms CodeModel.GetById 19ms RepoModel.GetById 1ms app.codeStats 0ms

/baser/plugins/blog/views/blog_contents/admin/form.php

https://github.com/hashing/basercms
PHP | 284 lines | 259 code | 7 blank | 18 comment | 14 complexity | 4e3847881ba121eb9204da4a7c2c1d69 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.blog.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. $("#BlogContentName").focus();
  24. });
  25. $(function(){
  26. $("#EditLayoutTemplate").click(function(){
  27. if(confirm('ブログ設定を保存して、レイアウトテンプレート '+$("#BlogContentLayout").val()+' の編集画面に移動します。よろしいですか?')){
  28. $("#BlogContentEditLayoutTemplate").val(1);
  29. $("#BlogContentEditBlogTemplate").val('');
  30. $("#BlogContentEditForm").submit();
  31. }
  32. });
  33. $("#EditBlogTemplate").click(function(){
  34. if(confirm('ブログ設定を保存して、コンテンツテンプレート '+$("#BlogContentTemplate").val()+' の編集画面に移動します。よろしいですか?')){
  35. $("#BlogContentEditLayoutTemplate").val('');
  36. $("#BlogContentEditBlogTemplate").val(1);
  37. $("#BlogContentEditForm").submit();
  38. }
  39. });
  40. });
  41. </script>
  42. <?php if($this->action == 'admin_edit'): ?>
  43. <div class="em-box align-left">
  44. <strong>このブログのURL<?php $bcBaser->link($bcBaser->getUri('/'.$blogContent['BlogContent']['name'].'/index'),'/'.$blogContent['BlogContent']['name'].'/index') ?></strong>
  45. </div>
  46. <?php endif ?>
  47. <!-- form -->
  48. <h2>基本項目</h2>
  49. <?php echo $bcForm->create('BlogContent') ?>
  50. <div class="section">
  51. <table cellpadding="0" cellspacing="0" class="form-table">
  52. <?php if($this->action == 'admin_edit'): ?>
  53. <tr>
  54. <th class="col-head"><?php echo $bcForm->label('BlogContent.id', 'NO') ?></th>
  55. <td class="col-input">
  56. <?php echo $bcForm->value('BlogContent.id') ?>
  57. <?php echo $bcForm->input('BlogContent.id', array('type' => 'hidden')) ?>
  58. </td>
  59. </tr>
  60. <?php endif; ?>
  61. <tr>
  62. <th class="col-head"><?php echo $bcForm->label('BlogContent.name', 'ブログアカウント名') ?>&nbsp;<span class="required">*</span></th>
  63. <td class="col-input">
  64. <?php echo $bcForm->input('BlogContent.name', array('type' => 'text', 'size'=>40,'maxlength'=>255)) ?>
  65. <?php echo $html->image('admin/icn_help.png', array('id' => 'helpCategoryFilter', 'class' => 'btn help', 'alt' => 'ヘルプ')) ?>
  66. <?php echo $bcForm->error('BlogContent.name') ?>
  67. <div id="helptextCategoryFilter" class="helptext">
  68. <ul>
  69. <li>ブログのURLに利用します<br />
  70. ()ブログアカウント名が test の場合http://example/test/</li>
  71. <li>半角英数字で入力してください</li>
  72. </ul>
  73. </div>
  74. </td>
  75. </tr>
  76. <tr>
  77. <th class="col-head"><?php echo $bcForm->label('BlogContent.title', 'ブログタイトル') ?>&nbsp;<span class="required">*</span></th>
  78. <td class="col-input">
  79. <?php echo $bcForm->input('BlogContent.title', array('type' => 'text', 'size' => 40, 'maxlength' => 255, 'counter' => true)) ?>
  80. <?php echo $bcForm->error('BlogContent.title') ?>
  81. </td>
  82. </tr>
  83. <tr>
  84. <th class="col-head"><?php echo $bcForm->label('BlogContent.description', 'ブログ説明文') ?></th>
  85. <td class="col-input">
  86. <?php echo $bcForm->ckeditor('BlogContent.description', null, array('width' => 'autos', 'height' => '120px', 'type' => 'simple')) ?>
  87. <?php echo $bcForm->error('BlogContent.description') ?>
  88. </td>
  89. </tr>
  90. <tr>
  91. <th class="col-head"><?php echo $bcForm->label('BlogContent.exclude_search', '公開設定') ?></th>
  92. <td class="col-input">
  93. <?php echo $bcForm->input('BlogContent.status', array(
  94. 'type' => 'radio',
  95. 'options' => array(0 => '非公開', 1 => '公開') ,
  96. 'legend' => false,
  97. 'separator' => '&nbsp;&nbsp;')) ?><br />
  98. <?php echo $bcForm->error('BlogContent.status') ?>
  99. <?php echo $bcForm->input('BlogContent.exclude_search', array('type' => 'checkbox', 'label' => 'このブログのトップページをサイト内検索の検索結果より除外する')) ?>
  100. </td>
  101. </tr>
  102. </table>
  103. </div>
  104. <h2 class="btn-slide-form"><a href="javascript:void(0)" id="formOption">オプション</a></h2>
  105. <div class="section">
  106. <table cellpadding="0" cellspacing="0" class="form-table slide-body" id="formOptionBody">
  107. <tr>
  108. <th class="col-head"><?php echo $bcForm->label('BlogContent.list_count', '一覧表示件数') ?>&nbsp;<span class="required">*</span></th>
  109. <td class="col-input">
  110. <?php echo $bcForm->input('BlogContent.list_count', array('type' => 'text', 'size' => 20, 'maxlength' => 255)) ?>&nbsp;&nbsp;
  111. <?php echo $html->image('admin/icn_help.png', array('id' => 'helpListCount', 'class' => 'btn help', 'alt' => 'ヘルプ')) ?>
  112. <?php echo $bcForm->error('BlogContent.list_count') ?>
  113. <div id="helptextListCount" class="helptext">
  114. <ul>
  115. <li>公開サイトの一覧に表示する件数を指定します</li>
  116. <li>半角数字で入力してください</li>
  117. </ul>
  118. </div>
  119. </td>
  120. </tr>
  121. <tr>
  122. <th class="col-head"><?php echo $bcForm->label('BlogContent.list_direction', '一覧に表示する順番') ?></th>
  123. <td class="col-input">
  124. <?php echo $bcForm->input('BlogContent.list_direction', array('type' => 'select', 'options' => array('DESC' => '新しい記事順', 'ASC'=>'古い記事順'))) ?>
  125. <?php echo $html->image('admin/icn_help.png', array('id' => 'helpListDirection', 'class' => 'btn help', 'alt' => 'ヘルプ')) ?>
  126. <?php echo $bcForm->error('BlogContent.list_direction') ?>
  127. <div id="helptextListDirection" class="helptext">
  128. <ul>
  129. <li>公開サイトの一覧における記事の並び方向を指定します</li>
  130. <li>新しい古いの判断は投稿日が基準となります</li>
  131. </ul>
  132. </div>
  133. </td>
  134. </tr>
  135. <tr>
  136. <th class="col-head"><?php echo $bcForm->label('BlogContent.list_count', 'RSSフィード出力件数') ?>&nbsp;<span class="required">*</span></th>
  137. <td class="col-input">
  138. <?php echo $bcForm->input('BlogContent.feed_count', array('type' => 'text', 'size' => 20, 'maxlength' => 255)) ?>&nbsp;&nbsp;
  139. <?php echo $html->image('admin/icn_help.png', array('id' => 'helpFeedCount', 'class' => 'btn help', 'alt' => 'ヘルプ')) ?>
  140. <?php echo $bcForm->error('BlogContent.feed_count') ?>
  141. <div id="helptextFeedCount" class="helptext">
  142. <ul>
  143. <li>RSSフィードに出力する件数を指定します</li>
  144. <li>半角数字で入力してください</li>
  145. <?php if($this->action == 'admin_edit'): ?>
  146. <li>RSSフィードのURLは
  147. <?php $bcBaser->link(Router::url('/'.$bcForm->value('BlogContent.name').'/index.rss', true),'/'.$bcForm->value('BlogContent.name').'/index.rss',array('target'=>'_blank')) ?>
  148. となります</li>
  149. <?php endif ?>
  150. </ul>
  151. </div>
  152. </td>
  153. </tr>
  154. <tr>
  155. <th class="col-head"><?php echo $bcForm->label('BlogContent.comment_use', 'コメント受付機能') ?>&nbsp;<span class="required">*</span></th>
  156. <td class="col-input">
  157. <?php echo $bcForm->input('BlogContent.comment_use', array(
  158. 'type' => 'radio',
  159. 'options' => $bcText->booleanDoList('利用'),
  160. 'legend' => false,
  161. 'separator' => '&nbsp;&nbsp;')) ?>
  162. <?php echo $bcForm->error('BlogContent.comment_use') ?>
  163. </td>
  164. </tr>
  165. <tr>
  166. <th class="col-head"><?php echo $bcForm->label('BlogContent.comment_approve', 'コメント承認機能') ?>&nbsp;<span class="required">*</span></th>
  167. <td class="col-input">
  168. <?php echo $bcForm->input('BlogContent.comment_approve', array(
  169. 'type' => 'radio',
  170. 'options' => $bcText->booleanDoList('利用'),
  171. 'legend' => false,
  172. 'separator' => '&nbsp;&nbsp;')) ?>
  173. <?php echo $html->image('admin/icn_help.png', array('id' => 'helpCommentApprove', 'class' => 'btn help', 'alt' => 'ヘルプ')) ?>
  174. <?php echo $bcForm->error('BlogContent.comment_approve') ?>
  175. <div id="helptextCommentApprove" class="helptext">承認機能を利用するとコメントが投稿されてもすぐに公開されず管理者側で確認する事ができます</div>
  176. </td>
  177. </tr>
  178. <tr>
  179. <th class="col-head"><?php echo $bcForm->label('MailContent.auth_capthca', 'コメントイメージ認証') ?>&nbsp;<span class="required">*</span></th>
  180. <td class="col-input">
  181. <?php echo $bcForm->input('BlogContent.auth_captcha', array(
  182. 'type' => 'radio',
  183. 'options' => $bcText->booleanDoList('利用'),
  184. 'legend' => false,
  185. 'separator' => '&nbsp;&nbsp;')) ?>
  186. <?php echo $html->image('admin/icn_help.png', array('id' => 'helpAuthCaptcha', 'class' => 'btn help', 'alt' => 'ヘルプ')) ?>
  187. <?php echo $bcForm->error('BlogContent.auth_captcha') ?>
  188. <div id="helptextAuthCaptcha" class="helptext">
  189. <ul>
  190. <li>ブログコメント送信の際表示された画像の文字入力させる事で認証を行ないます</li>
  191. <li>スパムなどいたずら送信が多いが多い場合に設定すると便利です</li>
  192. </ul>
  193. </div>
  194. </td>
  195. </tr>
  196. <tr>
  197. <th class="col-head"><?php echo $bcForm->label('BlogContent.tag_use', 'タグ機能') ?>&nbsp;<span class="required">*</span></th>
  198. <td class="col-input">
  199. <?php echo $bcForm->input('BlogContent.tag_use', array(
  200. 'type' => 'radio',
  201. 'options' => $bcText->booleanDoList('利用'),
  202. 'legend' => false,
  203. 'separator' => '&nbsp;&nbsp;')) ?>
  204. <?php echo $bcForm->error('BlogContent.tag_use') ?>
  205. </td>
  206. </tr>
  207. <tr>
  208. <th class="col-head"><?php echo $bcForm->label('BlogContent.widget_area', 'ウィジェットエリア') ?>&nbsp;<span class="required">*</span></th>
  209. <td class="col-input">
  210. <?php echo $bcForm->input('BlogContent.widget_area', array(
  211. 'type' => 'select',
  212. 'options' => $bcForm->getControlsource('WidgetArea.id'),
  213. 'empty' => 'サイト基本設定に従う')) ?>
  214. <?php echo $html->image('admin/icn_help.png', array('id' => 'helpWidgetArea', 'class' => 'btn help', 'alt' => 'ヘルプ')) ?>
  215. <?php echo $bcForm->error('BlogContent.widget_area') ?>
  216. <div id="helptextWidgetArea" class="helptext">
  217. ブログコンテンツで利用するウィジェットエリアを指定します<br />
  218. ウィジェットエリアは<?php $bcBaser->link('ウィジェットエリア管理', array('plugin' => null, 'controller' => 'widget_areas', 'action' => 'index')) ?>より追加できます
  219. </div>
  220. </td>
  221. </tr>
  222. <tr>
  223. <th class="col-head"><?php echo $bcForm->label('BlogContent.layout', 'レイアウトテンプレート名') ?>&nbsp;<span class="required">*</span></th>
  224. <td class="col-input">
  225. <?php echo $bcForm->input('BlogContent.layout', array(
  226. 'type' => 'select',
  227. 'options' => $blog->getLayoutTemplates())) ?>
  228. <?php echo $bcForm->input('BlogContent.edit_layout_template', array('type' => 'hidden')) ?>
  229. <?php if($this->action == 'admin_edit'): ?>
  230. <?php $bcBaser->link('≫ 編集する', 'javascript:void(0)', array('id' => 'EditLayoutTemplate')) ?>
  231. <?php endif ?>
  232. <?php echo $html->image('admin/icn_help.png', array('id' => 'helpLayout', 'class' => 'btn help', 'alt' => 'ヘルプ')) ?>
  233. <?php echo $bcForm->error('BlogContent.layout') ?>
  234. <div id="helptextLayout" class="helptext">
  235. <ul>
  236. <li>ブログの外枠のテンプレートを指定します</li>
  237. <li>編集するからテンプレートの内容を編集する事ができます</li>
  238. </ul>
  239. </div>
  240. </td>
  241. </tr>
  242. <tr>
  243. <th class="col-head"><?php echo $bcForm->label('BlogContent.template', 'コンテンツテンプレート名') ?>&nbsp;<span class="required">*</span></th>
  244. <td class="col-input">
  245. <?php echo $bcForm->input('BlogContent.template', array(
  246. 'type' => 'select',
  247. 'options' => $blog->getBlogTemplates())) ?>
  248. <?php echo $bcForm->input('BlogContent.edit_blog_template', array('type' => 'hidden')) ?>
  249. <?php if($this->action == 'admin_edit'): ?>
  250. <?php $bcBaser->link('≫ 編集する', 'javascript:void(0)', array('id' => 'EditBlogTemplate')) ?>
  251. <?php endif ?>
  252. <?php echo $html->image('admin/icn_help.png', array('id' => 'helpTemplate', 'class' => 'btn help', 'alt' => 'ヘルプ')) ?>
  253. <?php echo $bcForm->error('BlogContent.template') ?>
  254. <div id="helptextTemplate" class="helptext">
  255. <ul>
  256. <li>ブログの本体のテンプレートを指定します</li>
  257. <li>編集するからテンプレートの内容を編集する事ができます</li>
  258. </ul>
  259. </div>
  260. </td>
  261. </tr>
  262. </table>
  263. </div>
  264. <!-- button -->
  265. <div class="submit">
  266. <?php if($this->action == 'admin_add'): ?>
  267. <?php echo $bcForm->submit('登録', array('div' => false, 'class' => 'btn-red button')) ?>
  268. <?php else: ?>
  269. <?php echo $bcForm->submit('更新', array('div' => false, 'class' => 'btn-orange button')) ?>
  270. <?php $bcBaser->link('削除',
  271. array('action' => 'delete', $bcForm->value('BlogContent.id')),
  272. array('class' => 'btn-gray button'),
  273. sprintf('%s を本当に削除してもいいですか?', $bcForm->value('BlogContent.title')),
  274. false); ?>
  275. <?php endif ?>
  276. </div>
  277. <?php echo $bcForm->end() ?>