OSDN Git Service

SelectTable設定表示
authorCake <cake_67@users.sourceforge.jp>
Tue, 26 Jan 2010 06:54:36 +0000 (15:54 +0900)
committerCake <cake_67@users.sourceforge.jp>
Tue, 26 Jan 2010 06:54:36 +0000 (15:54 +0900)
app/views/helpers/profiledisp.php
app/views/systems/admin_view.ctp

index 73dcd94..cd6cb65 100644 (file)
@@ -5,6 +5,7 @@
  */
 class ProfiledispHelper extends Helper {
        var $helpers = array(
+               'Html',
                'Form',
        );
 
@@ -108,6 +109,31 @@ class ProfiledispHelper extends Helper {
                echo $this->Form->input('profile_type', $option);
        }
 
+       /* profile_tablesの設定からテーブルヘッダを出力 */
+       function disp_th4profile_tables($profile_tables, $is_thead = true, $tr_options = array(), $th_options = array())
+       {
+               if (empty($profile_tables)) {
+                       return null;
+               }
+
+               $values = array();
+               foreach ($profile_tables as $k => $v) {
+                       $values[] = $v['title'];
+               }
+
+               $table_header = $this->Html->tableHeaders(
+                       $values,
+                       $tr_options,
+                       $th_options
+               );
+
+               if ($is_thead) {
+                       $table_header = '<thead>'.$table_header.'</thead>';
+               }
+
+               echo $table_header;
+       }
+
        /* Profile種類を判断 */
        function set_profile_type4view($profile)
        {
index eecaab3..778de51 100644 (file)
@@ -165,7 +165,9 @@ foreach ($system['Profile'] as $profile):
                $profiledisp->disp_select4profile_selects($profile['ProfileSelect']);
                echo '<span class="edit_link">'.$html->link(__('Edit Select Items', true), array('controller' => 'profile_selects', 'action' => 'admin_listview', $profile['id'])).'</span>';
        } elseif ($profiledisp->profile_type['is_table']) {
-//             $profiledisp->disp_th4profile_table($profile['ProfileTable']);
+               echo '<table cellpadding="0" cellspacing="0">';
+               $profiledisp->disp_th4profile_tables($profile['ProfileTable']);
+               echo '</table>';
                echo '<div class="edit_link">'.$html->link(__('Edit Table', true), array('controller' => 'profile_tables', 'action' => 'admin_listview', $profile['id'])).'</div>';
        }
 ?>