Example #1
0
# Actions combo box
$combo_action = array();
$default = '';
if ($core->auth->check('delete,contentadmin', $core->blog->id) && $status == -2) {
    $default = 'delete';
}
$comments_actions_page = new dcCommentsActionsPage($core, $core->adminurl->get("admin.comments"));
if ($comments_actions_page->process()) {
    return;
}
/* Get comments
-------------------------------------------------------- */
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());
}
/* DISPLAY
-------------------------------------------------------- */
$form_filter_title = __('Show filters and display options');
$starting_script = dcPage::jsLoad('js/_comments.js');
$starting_script .= dcPage::jsLoad('js/filter-controls.js');
$starting_script .= '<script type="text/javascript">' . "\n" . "//<![CDATA[" . "\n" . dcPage::jsVar('dotclear.msg.show_filters', $show_filters ? 'true' : 'false') . "\n" . dcPage::jsVar('dotclear.msg.filter_posts_list', $form_filter_title) . "\n" . dcPage::jsVar('dotclear.msg.cancel_the_filter', __('Cancel filters and display options')) . "\n" . "//]]>" . "</script>";
dcPage::open(__('Comments and trackbacks'), $starting_script, dcPage::breadcrumb(array(html::escapeHTML($core->blog->name) => '', __('Comments and trackbacks') => '')));
if (!empty($_GET['upd'])) {
    dcPage::success(__('Selected comments have been successfully updated.'));
} elseif (!empty($_GET['del'])) {
    dcPage::success(__('Selected comments have been successfully deleted.'));
}
Example #2
0
            $posts = $core->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());
        }
    } 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 '<h2>' . html::escapeHTML($core->blog->name) . ' &rsaquo; ' . __('Search') . '</h2>' . '<form action="search.php" method="get">' . '<fieldset><legend>' . __('Search options') . '</legend>' . '<p><label class="classic">' . __('Query:') . ' ' . form::field('q', 30, 255, html::escapeHTML($q)) . '</label> ' . '<label class="classic">' . form::radio(array('qtype'), 'p', $qtype == 'p') . ' ' . __('search entries') . '</label> ' . '<label class="classic">' . form::radio(array('qtype'), 'c', $qtype == 'c') . ' ' . __('search comments') . '</label> ' . ' <input type="submit" value="' . __('ok') . '" /></p>' . '</fieldset>' . '</form>';
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';
Example #3
0
            $posts = $core->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());
        }
    } 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());
        }
    }
}
if ($qtype == 'p') {
    $posts_actions_page = new dcPostsActionsPage($core, $core->adminurl->get("admin.search"), array('q' => $q, 'qtype' => $qtype));
    if ($posts_actions_page->process()) {
        return;
    }
} else {
    $comments_actions_page = new dcCommentsActionsPage($core, $core->adminurl->get("admin.search"), array('q' => $q, 'qtype' => $qtype));
    if ($comments_actions_page->process()) {
        return;
    }
Example #4
0
$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';
}
/* Get comments
-------------------------------------------------------- */
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());
}
/* DISPLAY
-------------------------------------------------------- */
$starting_script = dcPage::jsLoad('js/_comments.js');
if (!$show_filters) {
    $starting_script .= dcPage::jsLoad('js/filter-controls.js');
}
# --BEHAVIOR-- adminCommentsHeaders
$starting_script .= $core->callBehavior('adminCommentsHeaders');
dcPage::open(__('Comments'), $starting_script);
echo '<h2>' . html::escapeHTML($core->blog->name) . ' &rsaquo; ' . __('Comments') . '</h2>';
if (!$core->error->flag()) {
    # Filters