{
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;
}
{
echo Entity::hsc($row['cname']);
}
-
+
return;
}