blog->getPosts($params);
$counter = $core->blog->getPosts($params,true);
$post_list = new adminPostList($core,$posts,$counter->f(0));
} catch (Exception $e) {
$core->error->add($e->getMessage());
}
}
# Get comments
elseif ($qtype == 'c')
{
$starting_scripts .= dcPage::jsLoad('js/_comments.js');
$params['search'] = $q;
$params['limit'] = array((($page-1)*$nb_per_page),$nb_per_page);
$params['no_content'] = true;
$params['order'] = 'comment_dt DESC';
try {
$comments = $core->blog->getComments($params);
$counter = $core->blog->getComments($params,true);
$comment_list = new adminCommentList($core,$comments,$counter->f(0));
} catch (Exception $e) {
$core->error->add($e->getMessage());
}
}
}
dcPage::open(__('Search'),$starting_scripts);
echo
'
'.html::escapeHTML($core->blog->name).' › '.__('Search').'
'.
'';
if ($q && !$core->error->flag())
{
$redir = html::escapeHTML($_SERVER['REQUEST_URI']);
# Show posts
if ($qtype == 'p')
{
# Actions combo box
$combo_action = array();
if ($core->auth->check('publish,contentadmin',$core->blog->id))
{
$combo_action[__('publish')] = 'publish';
$combo_action[__('unpublish')] = 'unpublish';
$combo_action[__('schedule')] = 'schedule';
$combo_action[__('mark as pending')] = 'pending';
}
$combo_action[__('change category')] = 'category';
if ($core->auth->check('admin',$core->blog->id)) {
$combo_action[__('change author')] = 'author';
}
if ($core->auth->check('delete,contentadmin',$core->blog->id))
{
$combo_action[__('delete')] = 'delete';
}
# --BEHAVIOR-- adminPostsActionsCombo
$core->callBehavior('adminPostsActionsCombo',array(&$combo_action));
if ($counter->f(0) > 0) {
printf(''.
($counter->f(0) == 1 ? __('%d entry found') : __('%d entries found')).
'
',$counter->f(0));
}
$post_list->display($page,$nb_per_page,
''
);
}
# Show posts
elseif ($qtype == 'c')
{
# Actions combo box
$combo_action = array();
if ($core->auth->check('publish,contentadmin',$core->blog->id))
{
$combo_action[__('publish')] = 'publish';
$combo_action[__('unpublish')] = 'unpublish';
$combo_action[__('mark as pending')] = 'pending';
$combo_action[__('mark as junk')] = 'junk';
}
if ($core->auth->check('delete,contentadmin',$core->blog->id))
{
$combo_action[__('delete')] = 'delete';
}
if ($counter->f(0) > 0) {
printf(''.
($counter->f(0) == 1 ? __('%d comment found') : __('%d comments found')).
'
',$counter->f(0));
}
$comment_list->display($page,$nb_per_page,
''
);
}
}
dcPage::close();
?>