Пример #1
0
if ($core->auth->user_prefs->dashboard->quickentry) {
    if ($core->auth->check('usage,contentadmin', $core->blog->id)) {
        $post_format = $core->auth->getOption('post_format');
        $post_editor = $core->auth->getOption('editor');
        if ($post_editor && !empty($post_editor[$post_format])) {
            // context is not post because of tags not available
            $admin_post_behavior = $core->callBehavior('adminPostEditor', $post_editor[$post_format], 'quickentry', array('#post_content'), $post_format);
        }
    }
}
/* DISPLAY
-------------------------------------------------------- */
dcPage::open(__('Dashboard'), dcPage::jsLoad('js/_index.js') . $admin_post_behavior . $core->callBehavior('adminDashboardHeaders'), dcPage::breadcrumb(array(__('Dashboard') . ' : ' . html::escapeHTML($core->blog->name) => ''), array('home_link' => false)));
# Dotclear updates notifications
if ($core->auth->isSuperAdmin() && is_readable(DC_DIGESTS)) {
    $updater = new dcUpdate(DC_UPDATE_URL, 'dotclear', DC_UPDATE_VERSION, DC_TPL_CACHE . '/versions');
    $new_v = $updater->check(DC_VERSION);
    $version_info = $new_v ? $updater->getInfoURL() : '';
    if ($updater->getNotify() && $new_v) {
        echo '<div class="dc-update"><h3>' . sprintf(__('Dotclear %s is available!'), $new_v) . '</h3> ' . '<p><a class="button submit" href="' . $core->adminurl->get("admin.update") . '">' . sprintf(__('Upgrade now'), $new_v) . '</a> ' . '<a class="button" href="' . $core->adminurl->get("admin.update", array('hide_msg' => 1)) . '">' . __('Remind me later') . '</a>' . ($version_info ? ' </p>' . '<p class="updt-info"><a href="' . $version_info . '">' . __('Information about this version') . '</a>' : '') . '</p>' . '</div>';
    }
}
if ($core->auth->getInfo('user_default_blog') != $core->blog->id && $core->auth->getBlogCount() > 1) {
    echo '<p><a href="' . $core->adminurl->get("admin.home", array('default_blog' => 1)) . '" class="button">' . __('Make this blog my default blog') . '</a></p>';
}
if ($core->blog->status == 0) {
    echo '<p class="static-msg">' . __('This blog is offline') . '.</p>';
} elseif ($core->blog->status == -1) {
    echo '<p class="static-msg">' . __('This blog is removed') . '.</p>';
}
if (!defined('DC_ADMIN_URL') || !DC_ADMIN_URL) {
Пример #2
0
# 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';
if (!defined('DC_BACKUP_PATH')) {
    define('DC_BACKUP_PATH', DC_ROOT);
}
dcPage::checkSuper();
if (!is_readable(DC_DIGESTS)) {
    dcPage::open(__('Dotclear update'));
    echo '<h2>Access denied</h2>';
    dcPage::close();
    exit;
}
$updater = new dcUpdate(DC_UPDATE_URL, 'dotclear', DC_UPDATE_VERSION, DC_TPL_CACHE . '/versions');
$new_v = $updater->check(DC_VERSION, !empty($_GET['nocache']));
$zip_file = $new_v ? DC_BACKUP_PATH . '/' . basename($updater->getFileURL()) : '';
$version_info = $new_v ? $updater->getInfoURL() : '';
# Hide "update me" message
if (!empty($_GET['hide_msg'])) {
    $updater->setNotify(false);
    http::redirect('index.php');
}
$p_url = 'update.php';
$step = isset($_GET['step']) ? $_GET['step'] : '';
$step = in_array($step, array('check', 'download', 'backup', 'unzip')) ? $step : '';
$default_tab = !empty($_GET['tab']) ? html::escapeHTML($_GET['tab']) : 'update';
if (!empty($_POST['backup_file'])) {
    $default_tab = 'files';
}
Пример #3
0
#
# Copyright (c) 2003-2009 Sacha 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::checkSuper();
if (!is_readable(DC_DIGESTS)) {
    dcPage::open(__('Dotclear update'));
    echo '<h2>Access denied</h2>';
    dcPage::close();
    exit;
}
$updater = new dcUpdate(DC_UPDATE_URL, 'dotclear', DC_UPDATE_VERSION, DC_TPL_CACHE . '/versions');
$new_v = $updater->check(DC_VERSION);
$zip_file = $new_v ? DC_ROOT . '/' . basename($updater->getFileURL()) : '';
# Hide "update me" message
if (!empty($_GET['hide_msg'])) {
    $updater->setNotify(false);
    http::redirect('index.php');
}
$p_url = 'update.php';
$step = isset($_GET['step']) ? $_GET['step'] : '';
$step = in_array($step, array('check', 'download', 'backup', 'unzip')) ? $step : '';
$archives = array();
foreach (files::scanDir(DC_ROOT) as $v) {
    if (preg_match('/backup-([0-9A-Za-z\\.-]+).zip/', $v)) {
        $archives[] = $v;
    }
Пример #4
0
if ($core->auth->check('usage,contentadmin', $core->blog->id)) {
    $categories_combo = array('&nbsp;' => '');
    try {
        $categories = $core->blog->getCategories(array('post_type' => 'post'));
        while ($categories->fetch()) {
            $categories_combo[] = new formSelectOption(str_repeat('&nbsp;&nbsp;', $categories->level - 1) . '&bull; ' . html::escapeHTML($categories->cat_title), $categories->cat_id);
        }
    } catch (Exception $e) {
    }
    echo '<div id="quick">' . '<h3>' . __('Quick entry') . '</h3>' . '<form id="quick-entry" action="post.php" method="post">' . '<fieldset>' . '<p class="col"><label class="required" title="' . __('Required field') . '">' . __('Title:') . form::field('post_title', 20, 255, '', 'maximal', 2) . '</label></p>' . '<p class="area"><label class="required" title="' . __('Required field') . '" ' . 'for="post_content">' . __('Content:') . '</label> ' . form::textarea('post_content', 50, 7, '', '', 2) . '</p>' . '<p><label class="classic">' . __('Category:') . ' ' . form::combo('cat_id', $categories_combo, '', '', 2) . '</label></p>' . '<p><input type="submit" value="' . __('save') . '" name="save" tabindex="3" /> ' . ($core->auth->check('publish', $core->blog->id) ? '<input type="hidden" value="' . __('save and publish') . '" name="save-publish" />' : '') . $core->formNonce() . form::hidden('post_status', -2) . form::hidden('post_format', $core->auth->getOption('post_format')) . form::hidden('post_excerpt', '') . form::hidden('post_lang', $core->auth->getInfo('user_lang')) . form::hidden('post_notes', '') . '</p>' . '</fieldset>' . '</form>' . '</div>';
}
echo '</div>';
# Dashboard columns
echo '<div id="dashboard-items">';
# Dotclear updates notifications
if ($core->auth->isSuperAdmin() && is_readable(DC_DIGESTS)) {
    $updater = new dcUpdate(DC_UPDATE_URL, 'dotclear', DC_UPDATE_VERSION, DC_TPL_CACHE . '/versions');
    $new_v = $updater->check(DC_VERSION);
    if ($updater->getNotify() && $new_v) {
        echo '<div id="upg-notify" class="static-msg"><p>' . sprintf(__('Dotclear %s is available!'), $new_v) . '</p> ' . '<ul><li><strong><a href="update.php">' . sprintf(__('Upgrade now'), $new_v) . '</a></strong>' . '</li><li><a href="update.php?hide_msg=1">' . __('Remind me later') . '</a>' . '</li></ul></div>';
    }
}
foreach ($__dashboard_items as $i) {
    echo '<div>';
    foreach ($i as $v) {
        echo $v;
    }
    echo '</div>';
}
echo '</div>';
dcPage::close();