OSDN Git Service

FIX: AdminActions::parse_categories()により不要な問い合わせが行われていたのを修正
[nucleus-jp/nucleus-next.git] / nucleus / libs / AdminActions.php
index db3f323..f942d46 100644 (file)
@@ -1518,45 +1518,16 @@ class AdminActions extends BaseActions
        {
                global $manager;
                
-               $item = FALSE;
-               $itemid =  intRequestVar('itemid');
-               $item   = &$manager->getItem($itemid, 1, 1);
-               
-               $blog = FALSE;
-               if ( !$item )
+               if ( !array_key_exists('catid', Admin::$contents) || empty(Admin::$contents['catid']) )
                {
-                       $blogid =  intRequestVar('blogid');
+                       $catid = Admin::$blog->getDefaultCategory();
                }
                else
                {
-                       $blogid =  $item['blogid'];
-               }
-               $blog   = &$manager->getBlog($blogid);
-               
-               if ( $item && $blog->convertBreaks() && requestVar('action') == 'itemedit' )
-               {
-                       $item['body'] = removeBreaks($item['body']);
-                       $item['more'] = removeBreaks($item['more']);
+                       $catid = Admin::$contents['catid'];
                }
                
-               $contents = array();
-               if ( requestVar('action') == 'itemedit' )
-               {
-                       $contents = $item;
-               }
-               
-               if ( !array_key_exists('catid', $contents) || empty($contents['catid']) )
-               {
-                       // on add item
-                       $catid = $blog->getDefaultCategory();
-               }
-               else
-               {
-                       // on edit item
-                       $catid = $contents['catid'];
-               }
-               
-               $this->selectBlog('catid', 'category', $catid, $startidx, 1, $blog->getID());
+               $this->selectBlog('catid', 'category', $catid, $startidx, 1, Admin::$blog->getID());
                
                return;
        }
@@ -1602,7 +1573,7 @@ class AdminActions extends BaseActions
                {
                        echo Entity::hsc($row['cname']);
                }
-       
+               
                return;
        }