OSDN Git Service

Selectpubicヘルパー名を変更
authorCake <cake_67@users.sourceforge.jp>
Fri, 22 Jan 2010 04:17:41 +0000 (13:17 +0900)
committerCake <cake_67@users.sourceforge.jp>
Fri, 22 Jan 2010 04:17:41 +0000 (13:17 +0900)
12 files changed:
app/controllers/app_controller.php
app/views/characters/add.ctp
app/views/characters/admin_index.ctp
app/views/characters/admin_view.ctp
app/views/characters/edit.ctp
app/views/characters/index.ctp
app/views/characters/view.ctp
app/views/helpers/select.php [moved from app/views/helpers/selectpublic.php with 94% similarity]
app/views/systems/admin_add.ctp
app/views/systems/admin_edit.ctp
app/views/systems/admin_index.ctp
app/views/systems/admin_view.ctp

index 9a101ee..24c3173 100644 (file)
@@ -38,7 +38,7 @@ class AppController extends Controller
                'Html',
                'Form',
                'Javascript',
-               'Selectpublic',
+               'Select',
                'Token'
        );
 
index c143cd1..40183c1 100644 (file)
@@ -25,7 +25,7 @@
                        'label' => __('Status', true)
                )
        );
-       echo $selectpublic->create_publicflag_select($public_flags, 'public_flag', array(
+       echo $select->create_publicflag_select($public_flags, 'public_flag', array(
                        'label' => __('Public Flag', true)
                )
        );
index 6308f0e..ca1c421 100644 (file)
@@ -47,7 +47,7 @@ foreach ($characters as $character):
                        <?php echo $character['Character']['status']; ?>
                </td>
                <td>
-                       <?php echo $selectpublic->get_i18n_public_flag($character['Character']['public_flag'], $public_flags) ?>
+                       <?php echo $select->get_i18n_public_flag($character['Character']['public_flag'], $public_flags) ?>
                </td>
                <td>
                        <?php echo $html->link($character['User']['name'], array('controller' => 'users', 'action' => 'view', $character['User']['id']), array(), false, false); ?>
index ce2b5c3..8fa8bed 100644 (file)
@@ -16,7 +16,7 @@
                </dd>
                <dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Public Flag'); ?></dt>
                <dd<?php if ($i++ % 2 == 0) echo $class;?>>
-                       <?php echo $selectpublic->get_i18n_public_flag($character['Character']['public_flag'], $public_flags) ?>
+                       <?php echo $select->get_i18n_public_flag($character['Character']['public_flag'], $public_flags) ?>
                </dd>
                <dt<?php if ($i % 2 == 0) echo $class;?>><?php __('User'); ?></dt>
                <dd<?php if ($i++ % 2 == 0) echo $class;?>>
index a3e8231..291af22 100644 (file)
@@ -24,7 +24,7 @@
                        'label' => __('Status', true)
                )
        );
-       echo $selectpublic->create_publicflag_select($public_flags, 'public_flag', array(
+       echo $select->create_publicflag_select($public_flags, 'public_flag', array(
                        'label' => __('Public Flag', true)
                )
        );
index b184f13..8c50ae0 100644 (file)
@@ -29,7 +29,7 @@ foreach ($characters as $character):
                <td>
                        <?php echo $html->link('<img src="'.$character['Character']['image_filename'].'" alt="'.$character['Character']['name'].'">', array('action' => 'view', $character['Character']['id']), array(), false, false); ?><br>
                        <?php echo $html->link($character['Character']['name'], array('action' => 'view', $character['Character']['id'])); ?>
-                       <?php echo $selectpublic->get_i18n_public_flag($character['Character']['public_flag'], $public_flags) ?>
+                       <?php echo $select->get_i18n_public_flag($character['Character']['public_flag'], $public_flags) ?>
                </td>
                <td>
                        <?php echo $character['Character']['sort_order']; ?>
index aa4842b..a6e1579 100644 (file)
@@ -18,7 +18,7 @@
                </dd>
                <dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Public Flag'); ?></dt>
                <dd<?php if ($i++ % 2 == 0) echo $class;?>>
-                       <?php echo $selectpublic->get_i18n_public_flag($character['Character']['public_flag'], $public_flags) ?>
+                       <?php echo $select->get_i18n_public_flag($character['Character']['public_flag'], $public_flags) ?>
                        &nbsp;
                </dd>
                <dt<?php if ($i % 2 == 0) echo $class;?>><?php __('User'); ?></dt>
 </div>
 <div class="actions">
        <ul>
+               <?php if ($editable): ?>
                <li><?php echo $html->link(__('Edit Character', true), array('action' => 'edit', $character['Character']['id'])); ?> </li>
                <li><?php echo $html->link(__('Delete Character', true), array('action' => 'delete', $character['Character']['id']), null, sprintf(__('Are you sure you want to delete # %s?', true), $character['Character']['id'])); ?> </li>
+               <?php endif; ?>
                <li><?php echo $html->link(__('List Characters', true), array('action' => 'index')); ?> </li>
                <li><?php echo $html->link(__('New Character', true), array('action' => 'add')); ?> </li>
                <li><?php echo $html->link(__('List Systems', true), array('controller' => 'systems', 'action' => 'index')); ?> </li>
similarity index 94%
rename from app/views/helpers/selectpublic.php
rename to app/views/helpers/select.php
index ac47392..499894f 100644 (file)
@@ -1,12 +1,15 @@
 <?php
-class SelectpublicHelper extends Helper {
+/* 
+ * プルダウン表示用Helper
+ * i18n対応
+ */
+class SelectHelper extends Helper {
        var $helpers = array('Form');
 
        var $default_public_flags = array('public_flag', 'private');
 
        /**
         * public_flagの設定をview表示形式に変換
-        * i18n対応
         *
         * @param string $public_flag, array $public_flags
         * @return String
index cea355a..65ac8d4 100644 (file)
@@ -37,7 +37,7 @@
                                'selected' => true
                        )
                );
-               echo $selectpublic->create_publicflag_select($public_flags, 'public_flag', array(
+               echo $select->create_publicflag_select($public_flags, 'public_flag', array(
                                'label' => __('Public Flag', true),
                                'selected' => 'public',
                        )
index cb0d058..a993671 100644 (file)
@@ -37,7 +37,7 @@
                                'selected' => true
                        )
                );
-               echo $selectpublic->create_publicflag_select($public_flags, 'public_flag', array(
+               echo $select->create_publicflag_select($public_flags, 'public_flag', array(
                                'label' => __('Public Flag', true)
                        )
                );
index a5578a2..042da1c 100644 (file)
@@ -48,7 +48,7 @@ foreach ($systems as $system):
                        <?php endif; ?>
                </td>
                <td>
-                       <?php echo $selectpublic->get_i18n_public_flag($system['System']['public_flag'], $public_flags) ?>
+                       <?php echo $select->get_i18n_public_flag($system['System']['public_flag'], $public_flags) ?>
                </td>
                <td>
                        <?php echo $system['System']['detail']; ?>
index ee6cc29..3a3837c 100644 (file)
@@ -37,7 +37,7 @@
                </dd>
                <dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Public'); ?></dt>
                <dd<?php if ($i++ % 2 == 0) echo $class;?>>
-                       <?php echo $selectpublic->get_i18n_public_flag($system['System']['public_flag'], $public_flags) ?>
+                       <?php echo $select->get_i18n_public_flag($system['System']['public_flag'], $public_flags) ?>
                </dd>
                <dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Detail'); ?></dt>
                <dd<?php if ($i++ % 2 == 0) echo $class;?>>