Ejemplo n.º 1
0
<?php

# -- BEGIN LICENSE BLOCK ---------------------------------------
#
# This file is part of Dotclear 2.
#
# Copyright (c) 2003-2013 Olivier Meunier & Association Dotclear
# Licensed under the GPL version 2.0 license.
# See LICENSE file or
# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
#
# -- END LICENSE BLOCK -----------------------------------------
require dirname(__FILE__) . '/../inc/admin/prepend.php';
dcPage::check('usage,contentadmin');
if (!empty($_POST['delete_all_spam'])) {
    try {
        $core->blog->delJunkComments();
        $_SESSION['comments_del_spam'] = true;
        $core->adminurl->redirect("admin.comments");
    } catch (Exception $e) {
        $core->error->add($e->getMessage());
    }
}
# Creating filter combo boxes
# Filter form we'll put in html_block
$status_combo = array_merge(array('-' => ''), dcAdminCombos::getCommentStatusescombo());
$type_combo = array('-' => '', __('Comment') => 'co', __('Trackback') => 'tb');
$sortby_combo = array(__('Date') => 'comment_dt', __('Entry title') => 'post_title', __('Author') => 'comment_author', __('Status') => 'comment_status');
$order_combo = array(__('Descending') => 'desc', __('Ascending') => 'asc');
/* Get comments
-------------------------------------------------------- */
Ejemplo n.º 2
0
# -- BEGIN LICENSE BLOCK ----------------------------------
#
# This file is part of Dotclear 2.
#
# Copyright (c) 2003-2009 Olivier Meunier and contributors
# Licensed under the GPL version 2.0 license.
# See LICENSE file or
# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
#
# -- END LICENSE BLOCK ------------------------------------
$standalone = !isset($edit_blog_mode);
$blog_id = false;
if ($standalone) {
    require dirname(__FILE__) . '/../inc/admin/prepend.php';
    dcPage::check('admin');
    $blog_id = $core->blog->id;
    $blog_url = $core->blog->url;
    $blog_status = $core->blog->status;
    $blog_name = $core->blog->name;
    $blog_desc = $core->blog->desc;
    $blog_settings = $core->blog->settings;
    $action = 'blog_pref.php';
    $redir = 'blog_pref.php?upd=1';
} else {
    dcPage::checkSuper();
    try {
        if (empty($_REQUEST['id'])) {
            throw new Exception(__('No given blog id.'));
        }
        $rs = $core->getBlog($_REQUEST['id']);
Ejemplo n.º 3
0
<?php

# -- BEGIN LICENSE BLOCK ----------------------------------
#
# This file is part of Dotclear 2.
#
# Copyright (c) 2003-2009 Olivier Meunier and contributors
# Licensed under the GPL version 2.0 license.
# See LICENSE file or
# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
#
# -- END LICENSE BLOCK ------------------------------------
require dirname(__FILE__) . '/../inc/admin/prepend.php';
dcPage::check('categories');
# Remove a category
if (!empty($_POST['del_cat'])) {
    try {
        $c = $core->blog->getCategory((int) $_POST['del_cat']);
        if ($c->isEmpty()) {
            throw new Exception(__('This category does not exist.'));
        }
        unset($c);
        $core->blog->delCategory($_POST['del_cat']);
        http::redirect('categories.php?del=1');
    } catch (Exception $e) {
        $core->error->add($e->getMessage());
    }
}
# Reset order
if (!empty($_POST['reset'])) {
    try {
Ejemplo n.º 4
0
<?php

# -- BEGIN LICENSE BLOCK ---------------------------------------
#
# This file is part of Dotclear 2.
#
# Copyright (c) 2003-2011 Olivier Meunier & Association Dotclear
# Licensed under the GPL version 2.0 license.
# See LICENSE file or
# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
#
# -- END LICENSE BLOCK -----------------------------------------
require dirname(__FILE__) . '/../inc/admin/prepend.php';
dcPage::check('usage');
function helpPage()
{
    $ret = array('content' => '', 'title' => '');
    $args = func_get_args();
    if (empty($args)) {
        return $ret;
    }
    global $__resources;
    if (empty($__resources['help'])) {
        return $ret;
    }
    $content = '';
    $title = '';
    foreach ($args as $v) {
        if (is_object($v) && isset($v->content)) {
            $content .= $v->content;
            continue;
Ejemplo n.º 5
0
<?php

# -- BEGIN LICENSE BLOCK ----------------------------------
#
# This file is part of Dotclear 2.
#
# Copyright (c) 2003-2009 Olivier Meunier and contributors
# Licensed under the GPL version 2.0 license.
# See LICENSE file or
# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
#
# -- END LICENSE BLOCK ------------------------------------
if (!defined('DC_CONTEXT_ADMIN')) {
    return;
}
dcPage::check('pages,contentadmin');
/* Pager class
-------------------------------------------------------- */
class adminPageList extends adminGenericList
{
    public function display($page, $nb_per_page, $enclose_block = '')
    {
        if ($this->rs->isEmpty()) {
            echo '<p><strong>' . __('No page') . '</strong></p>';
        } else {
            $pager = new pager($page, $this->rs_count, $nb_per_page, 10);
            $pager->html_prev = $this->html_prev;
            $pager->html_next = $this->html_next;
            $pager->var_page = 'page';
            $html_block = '<table class="clear"><tr>' . '<th colspan="2">' . __('Title') . '</th>' . '<th>' . __('Date') . '</th>' . '<th>' . __('Author') . '</th>' . '<th>' . __('Comments') . '</th>' . '<th>' . __('Trackbacks') . '</th>' . '<th>' . __('Status') . '</th>' . '</tr>%s</table>';
            if ($enclose_block) {
Ejemplo n.º 6
0
<?php

# -- BEGIN LICENSE BLOCK ---------------------------------------
#
# This file is part of Dotclear 2.
#
# Copyright (c) 2003-2013 Olivier Meunier & Association Dotclear
# Licensed under the GPL version 2.0 license.
# See LICENSE file or
# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
#
# -- END LICENSE BLOCK -----------------------------------------
require dirname(__FILE__) . '/../inc/admin/prepend.php';
dcPage::check('media,media_admin');
$tab = empty($_REQUEST['tab']) ? '' : $_REQUEST['tab'];
$post_id = !empty($_REQUEST['post_id']) ? (int) $_REQUEST['post_id'] : null;
if ($post_id) {
    $post = $core->blog->getPosts(array('post_id' => $post_id));
    if ($post->isEmpty()) {
        $post_id = null;
    }
    $post_title = $post->post_title;
    unset($post);
}
$file = null;
$popup = (int) (!empty($_REQUEST['popup']));
$select = !empty($_REQUEST['select']) ? (int) $_REQUEST['select'] : 0;
// 0 : none, 1 : single media, >1 : multiple medias
$plugin_id = isset($_REQUEST['plugin_id']) ? html::sanitizeURL($_REQUEST['plugin_id']) : '';
$page_url_params = array('popup' => $popup, 'select' => $select, 'post_id' => $post_id);
$media_page_url_params = array('popup' => $popup, 'select' => $select, 'post_id' => $post_id);