OSDN Git Service

SystemCopyright表示追加
authorCake <cake_67@users.sourceforge.jp>
Fri, 23 Apr 2010 07:27:49 +0000 (16:27 +0900)
committerCake <cake_67@users.sourceforge.jp>
Fri, 23 Apr 2010 07:27:49 +0000 (16:27 +0900)
app/config/sql/install/create_table.sql
app/controllers/app_controller.php
app/controllers/characters_controller.php
app/locale/jpn/LC_MESSAGES/default.po
app/models/character.php
app/models/system.php
app/views/layouts/default.ctp
app/views/systems/admin_add.ctp
app/views/systems/admin_edit.ctp
app/views/systems/admin_view.ctp
app/webroot/css/character-sheet.css

index f749d86..37deeb6 100644 (file)
@@ -132,6 +132,7 @@ CREATE TABLE `systems` (
   `name` VARCHAR(255) NOT NULL,
   `sort_order` INTEGER UNSIGNED NOT NULL DEFAULT '0',
   `url` TEXT NOT NULL,
+  `copyright` TEXT NOT NULL,
   `set_npc` TINYINT(1) UNSIGNED NOT NULL DEFAULT '0',
   `public_flag` ENUM('public','private') NOT NULL DEFAULT 'public',
   `detail` TEXT NOT NULL,
index 5106e03..e26b729 100644 (file)
@@ -288,10 +288,13 @@ class AppController extends Controller
 
 
        /* システム情報取得 */
-       function _restore_html_system($data, $nl2br = false) {
+       function _restore_html_system($data) {
                if (isset($data['System']['name'])  && !empty($data['System']['name'])) {
                        $data['System']['name'] = $this->{$this->modelClass}->restore_html($data['System']['name'], false, false, false);
                }
+               if (isset($data['System']['copyright'])  && !empty($data['System']['copyright'])) {
+                       $data['System']['copyright'] = $this->{$this->modelClass}->restore_html($data['System']['copyright']);
+               }
                if (isset($data['System']['url'])  && !empty($data['System']['url'])) {
                        $data['System']['url'] = $this->{$this->modelClass}->restore_html($data['System']['url'], false, false, false);
                }
index 8d84959..7f7f033 100644 (file)
@@ -492,6 +492,7 @@ class CharactersController extends AppController {
                                $this->Session->setFlash(__('Invalid System.', true));
                                $this->redirect(array('controller' => 'systems', 'action' => 'index'));
                        }
+                       $this_system = $this->_restore_html_system($this_system);
 
                        $this->set('this_system', $this_system);
                } else {
index 62ed56d..b01e265 100644 (file)
@@ -1830,6 +1830,16 @@ msgstr "システム追加"
 
 #: /views/systems/admin_add.ctp:44
 #: /views/systems/admin_edit.ctp:51
+msgid "Copy Right"
+msgstr "著作権表示"
+
+#: /views/systems/admin_add.ctp:44
+#: /views/systems/admin_edit.ctp:51
+msgid "HTML tag OK."
+msgstr "HTMLタグ使用可"
+
+#: /views/systems/admin_add.ctp:44
+#: /views/systems/admin_edit.ctp:51
 msgid "Use NPC"
 msgstr "NPC設定を使う"
 
index 33fe047..b39fb0f 100644 (file)
@@ -70,7 +70,8 @@ class Character extends AppModel {
                        'fields' => array(
                                'System.id', 
                                'System.name', 
-                               'System.public_flag'
+                               'System.public_flag',
+                               'System.copyright',
                        ),
                ),
                'User' => array(
index d5c0ecd..fd48018 100644 (file)
@@ -4,8 +4,8 @@ class System extends AppModel {
        var $name = 'System';
 
        var $fields = array(
-               'add' => array('name', 'sort_order', 'url', 'set_npc', 'public_flag', 'detail'),
-               'edit' => array('name', 'sort_order', 'url', 'set_npc', 'public_flag', 'detail'),
+               'add' => array('name', 'sort_order', 'url', 'copyright', 'set_npc', 'public_flag', 'detail'),
+               'edit' => array('name', 'sort_order', 'url', 'copyright', 'set_npc', 'public_flag', 'detail'),
                'image' => array(
                        'user_id',
                        'model',
@@ -23,6 +23,11 @@ class System extends AppModel {
                                'html' => true,
                                'all' => true,
                        ),
+                       'copyright' => array(
+                               'html' => false,
+                               'images' => true,
+                               'sctipts' => true,
+                       ),
                        'detail' => array(
                                'html' => true,
                                'images' => true,
index 7e1836e..7aa867d 100644 (file)
@@ -141,6 +141,22 @@ switch ($this->params["controller"]) {
 <?php endif; ?>
 
 <div id="footer">
+
+<?php
+if (isset($character['System']['copyright'])) {
+       $copyright = $character['System']['copyright']; 
+} elseif (isset($system['System']['copyright'])) {
+       $copyright = $system['System']['copyright']; 
+} elseif (isset($this_system['System']['copyright'])) {
+       $copyright = nl2br($this_system['System']['copyright']); 
+} else {
+       $copyright = null;
+}
+?>
+<?php if (!empty($copyright)): ?>
+<?php echo $html->div('systemCopyright', $copyright); ?>
+<?php endif; ?>
+
 <?php 
        echo $this->renderElement('version', 
                array(
index f266459..95f482f 100644 (file)
                'type' => 'text',
                'label' => 'URL',
        ));
+       echo $form->input('copyright', array(
+               'label' => __('Copy Right', true),
+               'after' => $html->tag('div',
+                       __('HTML tag OK.', true),
+                       array('class' => 'attention')
+               )
+       ));
        echo $select->create_publicflag_select($public_flags, 'public_flag', array(
                'label' => __('Public Flag', true),
                'selected' => 'public',
index c691730..11f894f 100644 (file)
                'type' => 'text',
                'label' => 'URL',
        ));
+       echo $form->input('copyright', array(
+               'label' => __('Copy Right', true),
+               'after' => $html->tag('div',
+                       __('HTML tag OK.', true),
+                       array('class' => 'attention')
+               )
+       ));
        echo $select->create_publicflag_select($public_flags, 'public_flag', array(
                'label' => __('Public Flag', true),
                'after' => $html->tag(
index c501b56..4893f04 100644 (file)
                )
        );
 
-       $footer = '<ul>'.
+       $footer = $html->tag(
+               'blockquote', 
+               $system['System']['copyright'],
+               array(
+                       'class' => 'systemCopyright', 
+               )
+       );
+       $footer .= '<ul>'.
                '<li>'.$html->link(__('Edit System', true), array('action' => 'edit', $system['System']['id'])).'</li>'.
                '<li>'.$html->link(__('Delete System', true), array('action' => 'delete', $system['System']['id'])).'</li>'.
                '</ul>';
@@ -131,9 +138,6 @@ $characterSheet['id'],
                        );
                }
        }
-       $footer = '<div class="actions"><ul>'.
-               
-               '</ul></div>';
 
        echo $this->renderElement('box', array(
                'header' =>$header,
index a264d93..35cc362 100644 (file)
@@ -239,3 +239,10 @@ dl#ArchiveList dd {
 dl#ArchiveList dd.title {
        margin-left: 12em;
 }
+
+/* システム著作権表示 */
+.systemCopyright {
+       font-size: 90%;
+       padding-left: 15px;
+       margin-bottom: 10px;
+}