OSDN Git Service

アイテムのバッチ処理の修正
authorshizuki <shizuki@kinezumi.net>
Mon, 7 May 2012 12:31:22 +0000 (21:31 +0900)
committershizuki <shizuki@kinezumi.net>
Mon, 7 May 2012 12:31:22 +0000 (21:31 +0900)
テンプレートが適用されていなかったので修正
Admin::moveOneItem()がprivateだったのでpublicに変更

nucleus/libs/ADMIN.php
nucleus/libs/AdminActions.php
nucleus/libs/ENCAPSULATE.php
nucleus/libs/showlist.php

index 38a4339..1cd4ebc 100644 (file)
@@ -1198,7 +1198,7 @@ class Admin
         * @param       integer $destCatid      ID for category to which the item will be moved\r
         * @return      void\r
         */\r
-       static private function moveOneItem($itemid, $destCatid)\r
+       static public function moveOneItem($itemid, $destCatid)\r
        {\r
                global $member;\r
                \r
index 366ca40..5cca7da 100644 (file)
@@ -1645,7 +1645,7 @@ class AdminActions extends BaseActions
         * @param       void
         * @return      void
         */
-       public function parse_blogcatlist()
+       public function parse_blogcatlist($templateName = '')
        {
                global $manager;
                $blogid = intRequestVar('blogid');
@@ -1656,7 +1656,7 @@ class AdminActions extends BaseActions
                $template['tabindex'] = 200;
                
                $batch = new Batch('category');
-               $batch->showlist($query, 'table', $template);
+               $batch->showlist($query, 'table', $template, $templateName);
                return;
        }
        
@@ -1883,7 +1883,7 @@ class AdminActions extends BaseActions
                $template['tabindex'] = 10;
 
                $batch = new Batch('team');
-               $batch->showlist($query, 'table', $template, _LISTS_NOMORE, $templateName);
+               $batch->showList($query, 'table', $template, $templateName, _LISTS_NOMORE);
                return;
        }
        
@@ -2778,7 +2778,7 @@ class AdminActions extends BaseActions
                $template['tabindex'] = 10;
                
                $batch = new Batch('member');
-               $batch->showlist($query, 'table', $template, _LISTS_NOMORE, $templateName);
+               $batch->showList($query, 'table', $template, $templateName, _LISTS_NOMORE);
                return;
        }
        
@@ -3821,7 +3821,7 @@ class AdminActions extends BaseActions
         * @param       void
         * @return      void
         */
-       public function parse_itemnavlist()
+       public function parse_itemnavlist($templateName)
        {
                global $CONF, $manager, $member;
                
@@ -3899,9 +3899,9 @@ class AdminActions extends BaseActions
                        . " LIMIT {$start},{$amount}";
                
                $template['content'] = 'itemlist';
-               
+
                $navList = new Navlist($this->skintype, $start, $amount, 0, 1000, $blogid, $search, 0);
-               $navList->showBatchList('item', $query, 'table', $template);
+               $navList->showBatchList('item', $query, 'table', $template, '', $templateName);
                return;
        }
        
@@ -5610,7 +5610,7 @@ class AdminActions extends BaseActions
         * @param               $templateName
         * @param               $showlist
         */
-       private function input_yesno($name,
+       public function input_yesno($name,
                                                                $checkedval,
                                                                $tabindex        = 0,
                                                                $value1    = 1,
index a3a5638..93a465b 100644 (file)
@@ -38,9 +38,10 @@ class Encapsulate
                {\r
                        $templateName = '';\r
                }\r
+               $params[4] = $errorMessage;\r
                // start output buffering\r
                ob_start();\r
-\r
+               \r
                $nbOfRows = call_user_func_array($call, $params);\r
 \r
                // get list contents and stop buffering\r
@@ -79,13 +80,13 @@ class NavList extends Encapsulate
                $this->itemid    = $itemid;\r
        }\r
 \r
-       function showBatchList($batchtype, $query, $type, $template, $errorMessage = _LISTS_NOMORE)\r
+       function showBatchList($batchtype, $query, $type, $template, $errorMessage = _LISTS_NOMORE, $templateName = '')\r
        {\r
                $batch = new Batch($batchtype);\r
 \r
                $this->doEncapsulate(\r
                                array(&$batch, 'showlist'),\r
-                               array(&$query, $type, $template),\r
+                               array(&$query, $type, $template, $templateName),\r
                                $errorMessage\r
                );\r
 \r
@@ -274,7 +275,8 @@ class Batch extends Encapsulate
                <?php   }\r
 \r
        // shortcut :)\r
-       function showList($query, $type, $template, $errorMessage = _LISTS_NOMORE, $templateName = '') {\r
+       function showList($query, $type, $template, $templateName = '', $errorMessage = _LISTS_NOMORE)\r
+       {\r
                return $this->doEncapsulate(    'showlist',\r
                                                                        array($query, $type, $template, $templateName),\r
                                                                        $errorMessage\r
index 7e949ea..8a89ead 100644 (file)
@@ -985,7 +985,7 @@ function listplug_table_itemlist($vars, $type, $templateName = '')
                                          . "<%itemdatelabel%> <%itemdateval%><br />\n"\r
                                          . "<%itemtimelabel%> <%itemtimeval%>\n"\r
                                          . "</td>\n"\r
-                                         . "<td><input type=\"checkbox\" id=\"batch<%batchid%>\" name=\"batch<%batchid%>\" value=\"<%itemid%>\" />\n"\r
+                                         . "<td><input type=\"checkbox\" id=\"batch<%batchid%>\" name=\"batch[<%batchid%>]\" value=\"<%itemid%>\" />\n"\r
                                          . "<label for=\"batch<%batchid%>\"><b><%itemtitle%></b></label><br />\n"\r
                                          . "<%itembody%>\n"\r
                                          . "</td><td>"\r