Ejemplo n.º 1
0
$last_letter = null;
$cols = array('', '');
$col = 0;
while ($tags->fetch()) {
    $letter = mb_strtoupper(mb_substr($tags->meta_id_lower, 0, 1));
    if ($last_letter != $letter) {
        if ($tags->index() >= round($tags->count() / 2)) {
            $col = 1;
        }
        $cols[$col] .= '<tr class="tagLetter"><td colspan="2"><span>' . $letter . '</span></td></tr>';
    }
    $cols[$col] .= '<tr class="line">' . '<td class="maximal"><a href="' . $p_url . '&amp;m=tag_posts&amp;tag=' . rawurlencode($tags->meta_id) . '">' . $tags->meta_id . '</a></td>' . '<td class="nowrap"><strong>' . $tags->count . '</strong> ' . ($tags->count == 1 ? __('entry') : __('entries')) . '</td>' . '</tr>';
    $last_letter = $letter;
}
$table = '<div class="col"><table class="tags">%s</table></div>';
if ($cols[0]) {
    echo '<div class="two-cols">';
    printf($table, $cols[0]);
    if ($cols[1]) {
        printf($table, $cols[1]);
    }
    echo '</div>';
} else {
    echo '<p>' . __('No tags on this blog.') . '</p>';
}
dcPage::helpBlock('tags');
?>

</body>
</html>
Ejemplo n.º 2
0
                    }
                }
                $res_task .= '</p>';
            }
            if (!empty($res_task)) {
                $res_group .= '<div class="fieldset">' . '<h4 id="' . $group_obj->id() . '">' . $group_obj->name() . '</h4>' . $res_task . '</div>';
            }
        }
        if (!empty($res_group)) {
            echo '<div id="' . $tab_obj->id() . '" class="multi-part" title="' . $tab_obj->name() . '">' . '<h3>' . $tab_obj->name() . '</h3>' . '<form action="' . $p_url . '" method="post">' . $res_group . '<p><input type="submit" value="' . __('Execute task') . '" /> ' . form::hidden(array('tab'), $tab_obj->id()) . $core->formNonce() . '</p>' . '<p class="form-note info">' . __('This may take a very long time.') . '</p>' . '</form>' . '</div>';
        }
    }
    // Advanced tasks (that required a tab)
    foreach ($tasks as $t) {
        if (!$t->id() || $t->group() !== null) {
            continue;
        }
        echo '<div id="' . $t->id() . '" class="multi-part" title="' . $t->name() . '">' . '<h3>' . $t->name() . '</h3>' . '<form action="' . $p_url . '" method="post">' . $t->content() . '<p><input type="submit" value="' . __('Execute task') . '" /> ' . form::hidden(array('task'), $t->id()) . form::hidden(array('tab'), $t->id()) . $core->formNonce() . '</p>' . '</form>' . '</div>';
    }
    // Settings
    echo '<div id="settings" class="multi-part" title="' . __('Alert settings') . '">' . '<h3>' . __('Alert settings') . '</h3>' . '<form action="' . $p_url . '" method="post">' . '<h4 class="pretty-title">' . __('Activation') . '</h4>' . '<p><label for="settings_plugin_message" class="classic">' . form::checkbox('settings_plugin_message', 1, $core->blog->settings->maintenance->plugin_message) . __('Display alert messages on late tasks') . '</label></p>' . '<p class="info">' . sprintf(__('You can place list of late tasks on your %s.'), '<a href="' . $core->adminurl->get('admin.user.preferences') . '#user-favorites">' . __('Dashboard') . '</a>') . '</p>' . '<h4 class="pretty-title vertical-separator">' . __('Frequency') . '</h4>' . '<p class="vertical-separator">' . form::radio(array('settings_recall_type', 'settings_recall_all'), 'all') . ' ' . '<label class="classic" for="settings_recall_all">' . '<strong>' . __('Use one recall time for all tasks') . '</strong></label></p>' . '<p class="field wide vertical-separator"><label for="settings_recall_time">' . __('Recall time for all tasks:') . '</label>' . form::combo('settings_recall_time', $combo_ts, 'seperate', 'recall-for-all') . '</p>' . '<p class="vertical-separator">' . form::radio(array('settings_recall_type', 'settings_recall_separate'), 'separate', 1) . ' ' . '<label class="classic" for="settings_recall_separate">' . '<strong>' . __('Use one recall time per task') . '</strong></label></p>';
    foreach ($tasks as $t) {
        if (!$t->id()) {
            continue;
        }
        echo '<div class="two-boxes">' . '<p class="field wide"><label for="settings_ts_' . $t->id() . '">' . $t->task() . '</label>' . form::combo('settings_ts_' . $t->id(), $combo_ts, $t->ts(), 'recall-per-task') . '</p>' . '</div>';
    }
    echo '<p class="field wide"><input type="submit" value="' . __('Save') . '" /> ' . form::hidden(array('tab'), 'settings') . form::hidden(array('save_settings'), 1) . $core->formNonce() . '</p>' . '</form>' . '</div>';
}
dcPage::helpBlock('maintenance', 'maintenancetasks');
echo '</body></html>';
Ejemplo n.º 3
0
</head>

<body>
<?php 
echo dcPage::breadcrumb(array(__('Plugins') => '', __('Pings configuration') => ''));
echo '<form action="' . $p_url . '" method="post">' . '<p><label for="pings_active" class="classic">' . form::checkbox('pings_active', 1, $core->blog->settings->pings->pings_active) . __('Activate pings extension') . '</label></p>';
$i = 0;
foreach ($pings_uris as $n => $u) {
    echo '<p><label for="pings_srv_name-' . $i . '" class="classic">' . __('Service name:') . '</label> ' . form::field(array('pings_srv_name[]', 'pings_srv_name-' . $i), 20, 128, html::escapeHTML($n)) . ' ' . '<label for="pings_srv_uri-' . $i . '" class="classic">' . __('Service URI:') . '</label> ' . form::field(array('pings_srv_uri[]', 'pings_srv_uri-' . $i), 40, 255, html::escapeHTML($u));
    if (!empty($_GET['test'])) {
        try {
            pingsAPI::doPings($u, 'Example site', 'http://example.com');
            echo ' <img src="images/check-on.png" alt="OK" />';
        } catch (Exception $e) {
            echo ' <img src="images/check-off.png" alt="' . __('Error') . '" /> ' . $e->getMessage();
        }
    }
    echo '</p>';
    $i++;
}
echo '<p><label for="pings_srv_name2" class="classic">' . __('Service name:') . '</label> ' . form::field(array('pings_srv_name[]', 'pings_srv_name2'), 20, 128) . ' ' . '<label for="pings_srv_uri2" class="classic">' . __('Service URI:') . '</label> ' . form::field(array('pings_srv_uri[]', 'pings_srv_uri2'), 40, 255) . '</p>' . '<p><input type="submit" value="' . __('Save') . '" />' . $core->formNonce() . '</p>' . '</form>';
echo '<p><a class="button" href="' . $p_url . '&amp;test=1">' . __('Test ping services') . '</a></p>';
?>

<?php 
dcPage::helpBlock('pings');
?>

</body>
</html>
Ejemplo n.º 4
0
} else {
    $sortby = 'post_dt';
    $order = 'desc';
}
# Get posts
try {
    $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());
}
/* DISPLAY
-------------------------------------------------------- */
$form_filter_title = __('Show filters and display options');
$starting_script = dcPage::jsLoad('js/_posts_list.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(__('Entries'), $starting_script, dcPage::breadcrumb(array(html::escapeHTML($core->blog->name) => '', __('Entries') => '')));
if (!empty($_GET['upd'])) {
    dcPage::success(__('Selected entries have been successfully updated.'));
} elseif (!empty($_GET['del'])) {
    dcPage::success(__('Selected entries have been successfully deleted.'));
}
if (!$core->error->flag()) {
    echo '<p class="top-add"><a class="button add" href="' . $core->adminurl->get("admin.post") . '">' . __('New entry') . '</a></p>' . '<form action="' . $core->adminurl->get("admin.posts") . '" method="get" id="filters-form">' . '<h3 class="out-of-screen-if-js">' . $form_filter_title . '</h3>' . '<div class="table">' . '<div class="cell">' . '<h4>' . __('Filters') . '</h4>' . '<p><label for="user_id" class="ib">' . __('Author:') . '</label> ' . form::combo('user_id', $users_combo, $user_id) . '</p>' . '<p><label for="cat_id" class="ib">' . __('Category:') . '</label> ' . form::combo('cat_id', $categories_combo, $cat_id) . '</p>' . '<p><label for="status" class="ib">' . __('Status:') . '</label> ' . form::combo('status', $status_combo, $status) . '</p> ' . '<p><label for="format" class="ib">' . __('Format:') . '</label> ' . form::combo('format', $format_combo, $format) . '</p>' . '<p><label for="password" class="ib">' . __('Password:'******'</label> ' . form::combo('password', $password_combo, $password) . '</p>' . '</div>' . '<div class="cell filters-sibling-cell">' . '<p><label for="selected" class="ib">' . __('Selected:') . '</label> ' . form::combo('selected', $selected_combo, $selected) . '</p>' . '<p><label for="attachment" class="ib">' . __('Attachments:') . '</label> ' . form::combo('attachment', $attachment_combo, $attachment) . '</p>' . '<p><label for="month" class="ib">' . __('Month:') . '</label> ' . form::combo('month', $dt_m_combo, $month) . '</p>' . '<p><label for="lang" class="ib">' . __('Lang:') . '</label> ' . form::combo('lang', $lang_combo, $lang) . '</p> ' . '<p><label for="comment" class="ib">' . __('Comments:') . '</label> ' . form::combo('comment', $comment_combo, $comment) . '</p>' . '<p><label for="trackback" class="ib">' . __('Trackbacks:') . '</label> ' . form::combo('trackback', $trackback_combo, $trackback) . '</p>' . '</div>' . '<div class="cell filters-options">' . '<h4>' . __('Display options') . '</h4>' . '<p><label for="sortby" class="ib">' . __('Order by:') . '</label> ' . form::combo('sortby', $sortby_combo, $sortby) . '</p>' . '<p><label for="order" class="ib">' . __('Sort:') . '</label> ' . form::combo('order', $order_combo, $order) . '</p>' . '<p><span class="label ib">' . __('Show') . '</span> <label for="nb" class="classic">' . form::field('nb', 3, 3, $nb_per_page) . ' ' . __('entries per page') . '</label></p>' . '</div>' . '</div>' . '<p><input type="submit" value="' . __('Apply filters and display options') . '" />' . '<br class="clear" /></p>' . '</form>';
    # Show posts
    $post_list->display($page, $nb_per_page, '<form action="' . $core->adminurl->get("admin.posts") . '" method="post" id="form-entries">' . '%s' . '<div class="two-cols">' . '<p class="col checkboxes-helpers"></p>' . '<p class="col right"><label for="action" class="classic">' . __('Selected entries action:') . '</label> ' . form::combo('action', $posts_actions_page->getCombo()) . '<input type="submit" value="' . __('ok') . '" /></p>' . form::hidden(array('user_id'), $user_id) . form::hidden(array('cat_id'), $cat_id) . form::hidden(array('status'), $status) . form::hidden(array('password'), $password) . form::hidden(array('selected'), $selected) . form::hidden(array('comment'), $comment) . form::hidden(array('trackback'), $trackback) . form::hidden(array('attachment'), $attachment) . form::hidden(array('month'), $month) . form::hidden(array('lang'), $lang) . form::hidden(array('sortby'), $sortby) . form::hidden(array('order'), $order) . form::hidden(array('page'), $page) . form::hidden(array('nb'), $nb_per_page) . $core->formNonce() . '</div>' . '</form>', $show_filters);
}
dcPage::helpBlock('core_posts');
dcPage::close();
Ejemplo n.º 5
0
echo '</div>';
echo '<h4 class="clear border-top pretty-title">' . __('Titles') . '</h4>';
echo '<div class="two-cols">';
echo '<div class="col">';
echo '<h5>' . __('Blog title') . '</h5>' . '<p class="field"><label for="blog_title_w">' . __('In bold:') . '</label> ' . form::checkbox('blog_title_w', 1, $ductile_user['blog_title_w']) . '</p>' . '<p class="field"><label for="blog_title_s">' . __('Font size (in em by default):') . '</label> ' . form::field('blog_title_s', 7, 7, $ductile_user['blog_title_s']) . '</p>' . '<p class="field picker"><label for="blog_title_c">' . __('Color:') . '</label> ' . form::field('blog_title_c', 7, 7, $ductile_user['blog_title_c'], 'colorpicker') . dcThemeConfig::contrastRatio($ductile_user['blog_title_c'], '#ffffff', !empty($ductile_user['blog_title_s']) ? $ductile_user['blog_title_s'] : '2em', $ductile_user['blog_title_w']) . '</p>';
echo '</div>';
echo '<div class="col">';
echo '<h5>' . __('Post title') . '</h5>' . '<p class="field"><label for="post_title_w">' . __('In bold:') . '</label> ' . form::checkbox('post_title_w', 1, $ductile_user['post_title_w']) . '</p>' . '<p class="field"><label for="post_title_s">' . __('Font size (in em by default):') . '</label> ' . form::field('post_title_s', 7, 7, $ductile_user['post_title_s']) . '</p>' . '<p class="field picker"><label for="post_title_c">' . __('Color:') . '</label> ' . form::field('post_title_c', 7, 7, $ductile_user['post_title_c'], 'colorpicker') . dcThemeConfig::contrastRatio($ductile_user['post_title_c'], '#ffffff', !empty($ductile_user['post_title_s']) ? $ductile_user['post_title_s'] : '2.5em', $ductile_user['post_title_w']) . '</p>';
echo '</div>';
echo '</div>';
echo '<h5>' . __('Titles without link') . '</h5>' . '<p class="field picker"><label for="post_simple_title_c">' . __('Color:') . '</label> ' . form::field('post_simple_title_c', 7, 7, $ductile_user['post_simple_title_c'], 'colorpicker') . dcThemeConfig::contrastRatio($ductile_user['post_simple_title_c'], '#ffffff', '1.1em', false) . '</p>';
echo '<h4 class="border-top pretty-title">' . __('Inside posts links') . '</h4>' . '<p class="field"><label for="post_link_w">' . __('In bold:') . '</label> ' . form::checkbox('post_link_w', 1, $ductile_user['post_link_w']) . '</p>' . '<p class="field picker"><label for="post_link_v_c">' . __('Normal and visited links color:') . '</label> ' . form::field('post_link_v_c', 7, 7, $ductile_user['post_link_v_c'], 'colorpicker') . dcThemeConfig::contrastRatio($ductile_user['post_link_v_c'], '#ffffff', '1em', $ductile_user['post_link_w']) . '</p>' . '<p class="field picker"><label for="post_link_f_c">' . __('Active, hover and focus links color:') . '</label> ' . form::field('post_link_f_c', 7, 7, $ductile_user['post_link_f_c'], 'colorpicker') . dcThemeConfig::contrastRatio($ductile_user['post_link_f_c'], '#ebebee', '1em', $ductile_user['post_link_w']) . '</p>';
echo '<h3 class="border-top">' . __('Mobile specific settings') . '</h3>';
echo '<div class="two-cols">';
echo '<div class="col">';
echo '<h4 class="pretty-title">' . __('Blog title') . '</h4>' . '<p class="field"><label for="blog_title_w_m">' . __('In bold:') . '</label> ' . form::checkbox('blog_title_w_m', 1, $ductile_user['blog_title_w_m']) . '</p>' . '<p class="field"><label for="blog_title_s_m">' . __('Font size (in em by default):') . '</label> ' . form::field('blog_title_s_m', 7, 7, $ductile_user['blog_title_s_m']) . '</p>' . '<p class="field picker"><label for="blog_title_c_m">' . __('Color:') . '</label> ' . form::field('blog_title_c_m', 7, 7, $ductile_user['blog_title_c_m'], 'colorpicker') . dcThemeConfig::contrastRatio($ductile_user['blog_title_c_m'], '#d7d7dc', !empty($ductile_user['blog_title_s_m']) ? $ductile_user['blog_title_s_m'] : '1.8em', $ductile_user['blog_title_w_m']) . '</p>';
echo '</div>';
echo '<div class="col">';
echo '<h4 class="pretty-title">' . __('Post title') . '</h4>' . '<p class="field"><label for="post_title_w_m">' . __('In bold:') . '</label> ' . form::checkbox('post_title_w_m', 1, $ductile_user['post_title_w_m']) . '</p>' . '<p class="field"><label for="post_title_s_m">' . __('Font size (in em by default):') . '</label> ' . form::field('post_title_s_m', 7, 7, $ductile_user['post_title_s_m']) . '</p>' . '<p class="field picker"><label for="post_title_c_m">' . __('Color:') . '</label> ' . form::field('post_title_c_m', 7, 7, $ductile_user['post_title_c_m'], 'colorpicker') . dcThemeConfig::contrastRatio($ductile_user['post_title_c_m'], '#ffffff', !empty($ductile_user['post_title_s_m']) ? $ductile_user['post_title_s_m'] : '1.5em', $ductile_user['post_title_w_m']) . '</p>';
echo '</div>';
echo '</div>';
echo '<p><input type="hidden" name="conf_tab" value="css" /></p>';
echo '<p class="clear border-top"><input type="submit" value="' . __('Save') . '" />' . $core->formNonce() . '</p>';
echo '</form>';
echo '</div>';
// Close tab
dcPage::helpBlock('ductile');
// Legacy mode
if (!$standalone_config) {
    echo '<form style="display:none">';
}
Ejemplo n.º 6
0
echo '</div>' . '</div>';
echo '<p class="clear vertical-separator"><label for="your_pwd" class="required">' . '<abbr title="' . __('Required field') . '">*</abbr> ' . __('Your password:'******'</label>' . form::password('your_pwd', 20, 255) . '</p>' . '<p class="clear"><input type="submit" name="save" accesskey="s" value="' . __('Save') . '" />' . ($user_id != '' ? '' : ' <input type="submit" name="saveplus" value="' . __('Save and create another') . '" />') . ($user_id != '' ? form::hidden('id', $user_id) : '') . $core->formNonce() . '</p>' . '</form>';
if ($user_id) {
    echo '<div class="clear fieldset">' . '<h3>' . __('Permissions') . '</h3>';
    if (!$user_super) {
        echo '<form action="' . $core->adminurl->get("admin.user.actions") . '" method="post">' . '<p><input type="submit" value="' . __('Add new permissions') . '" />' . form::hidden(array('redir'), $core->adminurl->get("admin.user", array('id' => $user_id))) . form::hidden(array('action'), 'blogs') . form::hidden(array('users[]'), $user_id) . $core->formNonce() . '</p>' . '</form>';
        $permissions = $core->getUserPermissions($user_id);
        $perm_types = $core->auth->getPermissionsTypes();
        if (count($permissions) == 0) {
            echo '<p>' . __('No permissions so far.') . '</p>';
        } else {
            foreach ($permissions as $k => $v) {
                if (count($v['p']) > 0) {
                    echo '<form action="' . $core->adminurl->get("admin.user.actions") . '" method="post" class="perm-block">' . '<p class="blog-perm">' . __('Blog:') . ' <a href="' . $core->adminurl->get("admin.blog", array('id' => html::escapeHTML($k))) . '">' . html::escapeHTML($v['name']) . '</a> (' . html::escapeHTML($k) . ')</p>';
                    echo '<ul class="ul-perm">';
                    foreach ($v['p'] as $p => $V) {
                        if (isset($perm_types[$p])) {
                            echo '<li>' . __($perm_types[$p]) . '</li>';
                        }
                    }
                    echo '</ul>' . '<p class="add-perm"><input type="submit" class="reset" value="' . __('Change permissions') . '" />' . form::hidden(array('redir'), $core->adminurl->get("admin.user", array('id' => $user_id))) . form::hidden(array('action'), 'perms') . form::hidden(array('users[]'), $user_id) . form::hidden(array('blogs[]'), $k) . $core->formNonce() . '</p>' . '</form>';
                }
            }
        }
    } else {
        echo '<p>' . sprintf(__('%s is super admin (all rights on all blogs).'), '<strong>' . $user_id . '</strong>') . '</p>';
    }
    echo '</div>';
}
dcPage::helpBlock('core_user');
dcPage::close();
Ejemplo n.º 7
0
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;
    }
}
dcPage::open(__('Search'), $starting_scripts, dcPage::breadcrumb(array(html::escapeHTML($core->blog->name) => '', __('Search') => '')));
echo '<form action="' . $core->adminurl->get("admin.search") . '" method="get" role="search">' . '<div class="fieldset"><h3>' . __('Search options') . '</h3>' . '<p><label for="q">' . __('Query:') . ' </label>' . form::field('q', 30, 255, $q) . '</p>' . '<p><label for="qtype1" class="classic">' . form::radio(array('qtype', 'qtype1'), 'p', $qtype == 'p') . ' ' . __('Search in entries') . '</label> ' . '<label for="qtype2" class="classic">' . form::radio(array('qtype', 'qtype2'), 'c', $qtype == 'c') . ' ' . __('Search in comments') . '</label></p>' . '<p><input type="submit" value="' . __('Search') . '" /></p>' . '</div>' . '</form>';
if ($q && !$core->error->flag()) {
    $redir = html::escapeHTML($_SERVER['REQUEST_URI']);
    # Show posts
    if ($qtype == 'p') {
        if ($counter->f(0) > 0) {
            printf('<h3>' . ($counter->f(0) == 1 ? __('%d entry found') : __('%d entries found')) . '</h3>', $counter->f(0));
        }
        $post_list->display($page, $nb_per_page, '<form action="' . $core->adminurl->get("admin.search") . '" method="post" id="form-entries">' . '%s' . '<div class="two-cols">' . '<p class="col checkboxes-helpers"></p>' . '<p class="col right"><label for="action1" class="classic">' . __('Selected entries action:') . '</label> ' . form::combo(array('action', 'action1'), $posts_actions_page->getCombo()) . '<input type="submit" value="' . __('ok') . '" /></p>' . $core->formNonce() . $posts_actions_page->getHiddenFields() . '</div>' . '</form>');
    } elseif ($qtype == 'c') {
        # Actions combo box
        if ($counter->f(0) > 0) {
            printf('<h3>' . ($counter->f(0) == 1 ? __('%d comment found') : __('%d comments found')) . '</h3>', $counter->f(0));
        }
        $comment_list->display($page, $nb_per_page, '<form action="' . $core->adminurl->get("admin.search") . '" method="post" id="form-comments">' . '%s' . '<div class="two-cols">' . '<p class="col checkboxes-helpers"></p>' . '<p class="col right"><label for="action2" class="classic">' . __('Selected comments action:') . '</label> ' . form::combo(array('action', 'action2'), $comments_actions_page->getCombo()) . '<input type="submit" value="' . __('ok') . '" /></p>' . $core->formNonce() . $comments_actions_page->getHiddenFields() . '</div>' . '</form>');
    }
}
dcPage::helpBlock('core_search');
dcPage::close();
Ejemplo n.º 8
0
    }
    echo '</form>';
    # Filters
    echo '<form action="' . $p_url . '" method="post" id="filters-list-form">';
    if (!empty($_GET['upd'])) {
        dcPage::success(__('Filters configuration has been successfully saved.'));
    }
    echo '<div class="table-outer">' . '<table class="dragable">' . '<caption class="as_h3">' . __('Available spam filters') . '</caption>' . '<thead><tr>' . '<th>' . __('Order') . '</th>' . '<th>' . __('Active') . '</th>' . '<th>' . __('Auto Del.') . '</th>' . '<th class="nowrap">' . __('Filter name') . '</th>' . '<th colspan="2">' . __('Description') . '</th>' . '</tr></thead>' . '<tbody id="filters-list" >';
    $i = 0;
    foreach ($filters as $fid => $f) {
        $gui_link = '&nbsp;';
        if ($f->hasGUI()) {
            $gui_link = '<a href="' . html::escapeHTML($f->guiURL()) . '">' . '<img src="images/edit-mini.png" alt="' . __('Filter configuration') . '" ' . 'title="' . __('Filter configuration') . '" /></a>';
        }
        echo '<tr class="line' . ($f->active ? '' : ' offline') . '" id="f_' . $fid . '">' . '<td class="handle">' . form::field(array('f_order[' . $fid . ']'), 2, 5, (string) $i, 'position', '', false, 'title="' . __('position') . '"') . '</td>' . '<td class="nowrap">' . form::checkbox(array('filters_active[]'), $fid, $f->active, '', '', false, 'title="' . __('Active') . '"') . '</td>' . '<td class="nowrap">' . form::checkbox(array('filters_auto_del[]'), $fid, $f->auto_delete, '', '', false, 'title="' . __('Auto Del.') . '"') . '</td>' . '<td class="nowrap" scope="row">' . $f->name . '</td>' . '<td class="maximal">' . $f->description . '</td>' . '<td class="status">' . $gui_link . '</td>' . '</tr>';
        $i++;
    }
    echo '</tbody></table></div>' . '<p>' . form::hidden('filters_order', '') . $core->formNonce() . '<input type="submit" name="filters_upd" value="' . __('Save') . '" /></p>' . '</form>';
    # Syndication
    if (DC_ADMIN_URL) {
        $ham_feed = $core->blog->url . $core->url->getURLFor('hamfeed', $code = dcAntispam::getUserCode($core));
        $spam_feed = $core->blog->url . $core->url->getURLFor('spamfeed', $code = dcAntispam::getUserCode($core));
        echo '<h3>' . __('Syndication') . '</h3>' . '<ul class="spaminfo">' . '<li class="feed"><a href="' . $spam_feed . '">' . __('Junk comments RSS feed') . '</a></li>' . '<li class="feed"><a href="' . $ham_feed . '">' . __('Published comments RSS feed') . '</a></li>' . '</ul>';
    }
    dcPage::helpBlock('antispam', 'antispam-filters');
}
?>

</body>
</html>
Ejemplo n.º 9
0
if ($cat_id) {
    while ($parents->fetch()) {
        $elements[html::escapeHTML($parents->cat_title)] = $core->adminurl->get("admin.category", array('id' => $parents->cat_id));
    }
}
$elements[$title] = '';
$category_editor = $core->auth->getOption('editor');
dcPage::open($title, dcPage::jsConfirmClose('category-form') . dcPage::jsLoad('js/_category.js') . $core->callBehavior('adminPostEditor', $category_editor['xhtml'], 'category', array('#cat_desc'), 'xhtml'), dcPage::breadcrumb($elements));
if (!empty($_GET['upd'])) {
    dcPage::success(__('Category has been successfully updated.'));
}
echo '<form action="' . $core->adminurl->get("admin.category") . '" method="post" id="category-form">' . '<h3>' . __('Category information') . '</h3>' . '<p><label class="required" for="cat_title"><abbr title="' . __('Required field') . '">*</abbr> ' . __('Name:') . '</label> ' . form::field('cat_title', 40, 255, html::escapeHTML($cat_title)) . '</p>';
if (!$cat_id) {
    $rs = $core->blog->getCategories(array('post_type' => 'post'));
    echo '<p><label for="new_cat_parent">' . __('Parent:') . ' ' . '<select id="new_cat_parent" name="new_cat_parent" >' . '<option value="0">' . __('(none)') . '</option>';
    while ($rs->fetch()) {
        echo '<option value="' . $rs->cat_id . '" ' . (!empty($_POST['new_cat_parent']) && $_POST['new_cat_parent'] == $rs->cat_id ? 'selected="selected"' : '') . '>' . str_repeat('&nbsp;&nbsp;', $rs->level - 1) . ($rs->level - 1 == 0 ? '' : '&bull; ') . html::escapeHTML($rs->cat_title) . '</option>';
    }
    echo '</select></label></p>';
    unset($rs);
}
echo '<div class="lockable">' . '<p><label for="cat_url">' . __('URL:') . '</label> ' . form::field('cat_url', 40, 255, html::escapeHTML($cat_url)) . '</p>' . '<p class="form-note warn" id="note-cat-url">' . __('Warning: If you set the URL manually, it may conflict with another category.') . '</p>' . '</div>' . '<p class="area"><label for="cat_desc">' . __('Description:') . '</label> ' . form::textarea('cat_desc', 50, 8, html::escapeHTML($cat_desc)) . '</p>' . '<p><input type="submit" accesskey="s" value="' . __('Save') . '" />' . ($cat_id ? form::hidden('id', $cat_id) : '') . $core->formNonce() . '</p>' . '</form>';
if ($cat_id) {
    echo '<h3 class="border-top">' . __('Move this category') . '</h3>' . '<div class="two-cols">' . '<div class="col">' . '<form action="' . $core->adminurl->get("admin.category") . '" method="post" class="fieldset">' . '<h4>' . __('Category parent') . '</h4>' . '<p><label for="cat_parent" class="classic">' . __('Parent:') . '</label> ' . form::combo('cat_parent', $allowed_parents, $cat_parent) . '</p>' . '<p><input type="submit" accesskey="s" value="' . __('Save') . '" />' . form::hidden(array('id'), $cat_id) . $core->formNonce() . '</p>' . '</form>' . '</div>';
    if (count($siblings) > 0) {
        echo '<div class="col">' . '<form action="' . $core->adminurl->get("admin.category") . '" method="post" class="fieldset">' . '<h4>' . __('Category sibling') . '</h4>' . '<p><label class="classic" for="cat_sibling">' . __('Move current category') . '</label> ' . form::combo('cat_move', array(__('before') => 'before', __('after') => 'after'), '', '', '', false, 'title="' . __('position: ') . '"') . ' ' . form::combo('cat_sibling', $siblings) . '</p>' . '<p><input type="submit" accesskey="s" value="' . __('Save') . '" />' . form::hidden(array('id'), $cat_id) . $core->formNonce() . '</p>' . '</form>' . '</div>';
    }
    echo '</div>';
}
dcPage::helpBlock('core_category');
dcPage::close();
Ejemplo n.º 10
0
<head>
  <title><?php 
    echo __('Pages');
    ?>
</title>
  <?php 
    echo dcPage::jsLoad('js/jquery/jquery-ui.custom.js') . dcPage::jsLoad('js/jquery/jquery.ui.touch-punch.js') . dcPage::jsLoad(dcPage::getPF('pages/list.js')) . '<script type="text/javascript">' . "\n" . '//<![CDATA[' . "\n" . dcPage::jsVar('dotclear.msg.confirm_delete_posts', __("Are you sure you want to delete selected pages?")) . "\n" . '//]]>' . "\n" . '</script>';
    ?>
</head>

<body>
<?php 
    echo dcPage::breadcrumb(array(html::escapeHTML($core->blog->name) => '', __('Pages') => '')) . dcPage::notices();
    if (!empty($_GET['upd'])) {
        dcPage::success(__('Selected pages have been successfully updated.'));
    } elseif (!empty($_GET['del'])) {
        dcPage::success(__('Selected pages have been successfully deleted.'));
    } elseif (!empty($_GET['reo'])) {
        dcPage::success(__('Selected pages have been successfully reordered.'));
    }
    echo '<p class="top-add"><a class="button add" href="' . $p_url . '&amp;act=page">' . __('New page') . '</a></p>';
    if (!$core->error->flag()) {
        # Show pages
        $post_list->display($page, $nb_per_page, '<form action="' . $core->adminurl->get('admin.plugin') . '" method="post" id="form-entries">' . '%s' . '<div class="two-cols">' . '<p class="col checkboxes-helpers"></p>' . '<p class="col right"><label for="action" class="classic">' . __('Selected pages action:') . '</label> ' . form::combo('action', $pages_actions_page->getCombo()) . '<input type="submit" value="' . __('ok') . '" />' . form::hidden(array('post_type'), 'page') . form::hidden(array('p'), 'pages') . form::hidden(array('act'), 'list') . $core->formNonce() . '</p></div>' . '<p class="clear form-note hidden-if-js">' . __('To rearrange pages order, change number at the begining of the line, then click on “Save pages order” button.') . '</p>' . '<p class="clear form-note hidden-if-no-js">' . __('To rearrange pages order, move items by drag and drop, then click on “Save pages order” button.') . '</p>' . '<p><input type="submit" value="' . __('Save pages order') . '" name="reorder" class="clear" /></p>' . '</form>');
    }
    dcPage::helpBlock('pages');
    ?>
</body>
</html>
<?php 
}
Ejemplo n.º 11
0
<?php 
echo '<div class="multi-part clear" id="add-link" title="' . __('Add a link') . '">' . '<form action="' . $core->adminurl->get('admin.plugin') . '" method="post" id="add-link-form">' . '<h3>' . __('Add a new link') . '</h3>' . '<p class="col"><label for="link_title" class="required"><abbr title="' . __('Required field') . '">*</abbr> ' . __('Title:') . '</label> ' . form::field('link_title', 30, 255, $link_title) . '</p>' . '<p class="col"><label for="link_href" class="required"><abbr title="' . __('Required field') . '">*</abbr> ' . __('URL:') . '</label> ' . form::field('link_href', 30, 255, $link_href) . '</p>' . '<p class="col"><label for="link_desc">' . __('Description:') . '</label> ' . form::field('link_desc', 30, 255, $link_desc) . '</p>' . '<p class="col"><label for="link_lang">' . __('Language:') . '</label> ' . form::field('link_lang', 5, 5, $link_lang) . '</p>' . '<p>' . form::hidden(array('p'), 'blogroll') . $core->formNonce() . '<input type="submit" name="add_link" value="' . __('Save') . '" /></p>' . '</form>' . '</div>';
echo '<div class="multi-part" id="add-cat" title="' . __('Add a category') . '">' . '<form action="' . $core->adminurl->get('admin.plugin') . '" method="post" id="add-category-form">' . '<h3>' . __('Add a new category') . '</h3>' . '<p><label for="cat_title" class=" classic required"><abbr title="' . __('Required field') . '">*</abbr> ' . __('Title:') . '</label> ' . form::field('cat_title', 30, 255, $cat_title) . ' ' . form::hidden(array('p'), 'blogroll') . $core->formNonce() . '<input type="submit" name="add_cat" value="' . __('Save') . '" /></p>' . '</form>' . '</div>';
echo '<div class="multi-part" id="import-links" title="' . __('Import links') . '">';
if (!isset($imported)) {
    echo '<form action="' . $core->adminurl->get('admin.plugin') . '" method="post" id="import-links-form" enctype="multipart/form-data">' . '<h3>' . __('Import links') . '</h3>' . '<p><label for="links_file" class=" classic required"><abbr title="' . __('Required field') . '">*</abbr> ' . __('OPML or XBEL File:') . '</label> ' . '<input type="file" id="links_file" name="links_file" /></p>' . '<p>' . form::hidden(array('p'), 'blogroll') . $core->formNonce() . '<input type="submit" name="import_links" value="' . __('Import') . '" /></p>' . '</form>';
} else {
    echo '<form action="' . $core->adminurl->get('admin.plugin') . '" method="post" id="import-links-form">' . '<h3>' . __('Import links') . '</h3>';
    if (empty($imported)) {
        echo '<p>' . __('Nothing to import') . '</p>';
    } else {
        echo '<table class="clear maximal"><tr>' . '<th colspan="2">' . __('Title') . '</th>' . '<th>' . __('Description') . '</th>' . '</tr>';
        $i = 0;
        foreach ($imported as $entry) {
            $url = html::escapeHTML($entry->link);
            $title = html::escapeHTML($entry->title);
            $desc = html::escapeHTML($entry->desc);
            echo '<tr><td>' . form::checkbox(array('entries[]'), $i, '', '', '') . '</td>' . '<td nowrap><a href="' . $url . '">' . $title . '</a>' . '<input type="hidden" name="url[' . $i . ']" value="' . $url . '" />' . '<input type="hidden" name="title[' . $i . ']" value="' . $title . '" />' . '</td>' . '<td>' . $desc . '<input type="hidden" name="desc[' . $i . ']" value="' . $desc . '" />' . '</td></tr>' . "\n";
            $i++;
        }
        echo '</table>' . '<div class="two-cols">' . '<p class="col checkboxes-helpers"></p>' . '<p class="col right">' . form::hidden(array('p'), 'blogroll') . $core->formNonce() . '<input type="submit" name="cancel_import" value="' . __('Cancel') . '" />&nbsp;' . '<input type="submit" name="import_links_do" value="' . __('Import') . '" /></p>' . '</div>';
    }
    echo '</form>';
}
echo '</div>';
dcPage::helpBlock('blogroll');
?>

</body>
</html>
Ejemplo n.º 12
0
# Show comments or trackbacks
function showComments($rs, $has_action)
{
    global $core;
    echo '<table class="comments-list"><tr>' . '<th colspan="2" class="nowrap first">' . __('Author') . '</th>' . '<th>' . __('Date') . '</th>' . '<th class="nowrap">' . __('IP address') . '</th>' . '<th>' . __('Status') . '</th>' . '<th>' . __('Edit') . '</th>' . '</tr>';
    while ($rs->fetch()) {
        $comment_url = $core->adminurl->get('admin.comment', array('id' => $rs->comment_id));
        $img = '<img alt="%1$s" title="%1$s" src="images/%2$s" />';
        switch ($rs->comment_status) {
            case 1:
                $img_status = sprintf($img, __('Published'), 'check-on.png');
                break;
            case 0:
                $img_status = sprintf($img, __('Unpublished'), 'check-off.png');
                break;
            case -1:
                $img_status = sprintf($img, __('Pending'), 'check-wrn.png');
                break;
            case -2:
                $img_status = sprintf($img, __('Junk'), 'junk.png');
                break;
        }
        echo '<tr class="line' . ($rs->comment_status != 1 ? ' offline' : '') . '"' . ' id="c' . $rs->comment_id . '">' . '<td class="nowrap">' . ($has_action ? form::checkbox(array('comments[]'), $rs->comment_id, '', '', '', 0, 'title="' . __('Select this comment') . '"') : '') . '</td>' . '<td class="maximal">' . $rs->comment_author . '</td>' . '<td class="nowrap">' . dt::dt2str(__('%Y-%m-%d %H:%M'), $rs->comment_dt) . '</td>' . '<td class="nowrap"><a href="' . $core->adminurl->get('admin.comment', array('ip' => $rs->comment_ip)) . '">' . $rs->comment_ip . '</a></td>' . '<td class="nowrap status">' . $img_status . '</td>' . '<td class="nowrap status"><a href="' . $comment_url . '">' . '<img src="images/edit-mini.png" alt="" title="' . __('Edit this comment') . '" /> ' . __('Edit') . '</a></td>' . '</tr>';
    }
    echo '</table>';
}
dcPage::helpBlock('page', 'core_wiki');
?>
</body>
</html>
Ejemplo n.º 13
0
if ($core->auth->isSuperAdmin()) {
    $modules = $list->modules->getDisabledModules();
    if (!empty($modules)) {
        echo '<h3>' . __('Deactivated plugins') . '</h3>' . '<p>' . __('Deactivated plugins are installed but not usable. You can activate them from here.') . '</p>';
        $list->setList('plugin-deactivate')->setTab('plugins')->setModules($modules)->displayModules(array('expander', 'icon', 'name', 'version', 'desc', 'distrib'), array('activate', 'delete'));
    }
}
echo '</div>';
if ($core->auth->isSuperAdmin() && $list->isWritablePath()) {
    # New modules from repo
    $search = $list->getSearch();
    $modules = $search ? $list->store->search($search) : $list->store->get();
    if (!empty($search) || !empty($modules)) {
        echo '<div class="multi-part" id="new" title="' . __('Add plugins') . '">' . '<h3>' . __('Add plugins from repository') . '</h3>';
        //		'<p>'.__('Search and install plugins directly from repository.').'</p>';
        $list->setList('plugin-new')->setTab('new')->setModules($modules)->displaySearch()->displayIndex()->displayModules(array('expander', 'name', 'score', 'version', 'desc', 'deps'), array('install'), true);
        echo '<p class="info vertical-separator">' . sprintf(__("Visit %s repository, the resources center for Dotclear."), '<a href="http://plugins.dotaddict.org/dc2/">Dotaddict</a>') . '</p>' . '</div>';
    }
    # Add a new plugin
    echo '<div class="multi-part" id="addplugin" title="' . __('Install or upgrade manually') . '">' . '<h3>' . __('Add plugins from a package') . '</h3>' . '<p>' . __('You can install plugins by uploading or downloading zip files.') . '</p>';
    $list->displayManualForm();
    echo '</div>';
}
# --BEHAVIOR-- pluginsToolsTabs
$core->callBehavior('pluginsToolsTabs', $core);
# -- Notice for super admin --
if ($core->auth->isSuperAdmin() && !$list->isWritablePath()) {
    echo '<p class="warning">' . __('Some functions are disabled, please give write access to your plugins directory to enable them.') . '</p>';
}
dcPage::helpBlock('core_plugins');
dcPage::close();
Ejemplo n.º 14
0
<?php 
foreach ($settings as $ns => $s) {
    ksort($s);
    echo sprintf($table_header, 'g_' . $ns, $ns);
    foreach ($s as $k => $v) {
        echo settingLine($k, $v, $ns, 'gs', false);
    }
    echo $table_footer;
}
?>

<p><input type="submit" value="<?php 
echo __('Save');
?>
" />
<input type="hidden" name="p" value="aboutConfig" />
<?php 
echo $core->formNonce();
?>
</p>
</form>
</div>

<?php 
dcPage::helpBlock('aboutConfig');
?>

</body>
</html>
Ejemplo n.º 15
0
-------------------------------------------------------- */
if ($post_id) {
    echo '<div class="multi-part" id="add-comment" title="' . __('Add a comment') . '">' . '<h3>' . __('Add a comment') . '</h3>' . '<form action="comment.php" method="post" id="comment-form">' . '<fieldset class="constrained">' . '<p><label class="required" title="' . __('Required field') . '">' . __('Name:') . form::field('comment_author', 30, 255, html::escapeHTML($core->auth->getInfo('user_cn'))) . '</label></p>' . '<p><label>' . __('Email:') . form::field('comment_email', 30, 255, html::escapeHTML($core->auth->getInfo('user_email'))) . '</label></p>' . '<p><label>' . __('Web site:') . form::field('comment_site', 30, 255, html::escapeHTML($core->auth->getInfo('user_url'))) . '</label></p>' . '<p class="area"><label for="comment_content" class="required" title="' . __('Required field') . '">' . __('Comment:') . '</label> ' . form::textarea('comment_content', 50, 8, html::escapeHTML('')) . '</p>' . '<p>' . form::hidden('post_id', $post_id) . $core->formNonce() . '<input type="submit" name="add" value="' . __('save') . '" /></p>' . '</fieldset>' . '</form>' . '</div>';
}
# Show comments or trackbacks
function showComments(&$rs, $has_action)
{
    echo '<table class="comments-list"><tr>' . '<th colspan="2">' . __('Author') . '</th>' . '<th>' . __('Date') . '</th>' . '<th class="nowrap">' . __('IP address') . '</th>' . '<th>' . __('Status') . '</th>' . '<th>&nbsp;</th>' . '</tr>';
    while ($rs->fetch()) {
        $comment_url = 'comment.php?id=' . $rs->comment_id;
        $img = '<img alt="%1$s" title="%1$s" src="images/%2$s" />';
        switch ($rs->comment_status) {
            case 1:
                $img_status = sprintf($img, __('published'), 'check-on.png');
                break;
            case 0:
                $img_status = sprintf($img, __('unpublished'), 'check-off.png');
                break;
            case -1:
                $img_status = sprintf($img, __('pending'), 'check-wrn.png');
                break;
            case -2:
                $img_status = sprintf($img, __('junk'), 'junk.png');
                break;
        }
        echo '<tr class="line' . ($rs->comment_status != 1 ? ' offline' : '') . '"' . ' id="c' . $rs->comment_id . '">' . '<td class="nowrap">' . ($has_action ? form::checkbox(array('comments[]'), $rs->comment_id, '', '', '', 0) : '') . '</td>' . '<td class="maximal">' . html::escapeHTML($rs->comment_author) . '</td>' . '<td class="nowrap">' . dt::dt2str(__('%Y-%m-%d %H:%M'), $rs->comment_dt) . '</td>' . '<td class="nowrap"><a href="comments.php?ip=' . $rs->comment_ip . '">' . $rs->comment_ip . '</a></td>' . '<td class="nowrap status">' . $img_status . '</td>' . '<td class="nowrap status"><a href="' . $comment_url . '">' . '<img src="images/edit-mini.png" alt="" title="' . __('Edit this comment') . '" /></a></td>' . '</tr>';
    }
    echo '</table>';
}
dcPage::helpBlock('core_post', 'core_wiki');
dcPage::close();
Ejemplo n.º 16
0
<?php 
foreach ($prefs as $ws => $s) {
    ksort($s);
    echo sprintf($table_header, 'g_' . $ws, $ws);
    foreach ($s as $k => $v) {
        echo prefLine($k, $v, $ws, 'gs', false);
    }
    echo $table_footer;
}
?>

<p><input type="submit" value="<?php 
echo __('Save');
?>
" />
<input type="hidden" name="p" value="userPref" />
<?php 
echo $core->formNonce();
?>
</p>
</form>
</div>

<?php 
dcPage::helpBlock('userPref');
?>

</body>
</html>
Ejemplo n.º 17
0
<p class="col"><?php 
echo form::hidden('links_order', '');
echo form::hidden('links_levels', '');
echo form::hidden(array('p'), 'menu');
echo $core->formNonce();
?>
<input type="submit" name="updateitems" value="<?php 
echo __('Update menu');
?>
" /></p>

<p class="col right"><input class="delete" type="submit" name="removeaction"
value="<?php 
echo __('Delete selected menu items');
?>
"
onclick="return window.confirm('<?php 
echo html::escapeJS(__('Are you sure you want to remove selected menu items?'));
?>
');" /></p>
</div>

</form>
</div>

<?php 
echo '<div class="multi-part" id="add-link" title="' . __('Add an item') . '">' . '<form action="plugin.php" method="post" id="add-link-form">' . '<div class="fieldset two-cols"><h4>' . __('New item') . '</h4>' . '<p class="field"><label class="classic required" for="link_title"><abbr title="' . __('Required field') . '">*</abbr> ' . __('Label of item menu:') . ' </label>' . form::field('link_title', 50, 255, $link_title, '', 1) . '</p>' . '<p class="field"><label class="classic required" for="link_href"><abbr title="' . __('Required field') . '">*</abbr> ' . __('URL of item menu:') . ' </label>' . form::field('link_href', 50, 255, $link_href, '', 2) . '</p>' . '<p class="field"><label class="classic" for="link_desc">' . __('Description:') . ' </label>' . form::field('link_desc', 50, 255, $link_desc, '', 3) . '</p>' . '<p class="field"><label class="classic" for="link_level">' . __('Level:') . ' </label>' . form::field('link_level', 5, 255, $link_level, '', 5) . '</p>' . '<p class="info">' . __('Note: 0 = hide menu item; 1 = level of item 1; 2 = item level 2; etc.') . '</p>' . '<p class="field"><label class="classic" for="link_lang">' . __('Language:') . ' </label>' . form::field('link_lang', 5, 5, $link_lang, '', 4) . '</p>' . '<p class="field"><label class="classic" for="link_class">' . __('Class:') . ' </label>' . form::field('link_class', 50, 32, $link_class, '', 6) . '</p>' . '</div>' . '<p>' . form::hidden(array('p'), 'menu') . $core->formNonce() . '<input type="submit" name="add_link" value="' . __('Save') . '" tabindex="7" /></p>' . '</form>' . '</div>';
dcPage::helpBlock('menu');
?>
</body>
</html>
Ejemplo n.º 18
0
<div id="file-chooser">
<h3><?php 
echo __('Templates files');
?>
</h3>
<?php 
echo $o->filesList('tpl', '<a href="' . $p_url . '&amp;tpl=%2$s" class="tpl-link">%1$s</a>');
?>

<h3><?php 
echo __('CSS files');
?>
</h3>
<?php 
echo $o->filesList('css', '<a href="' . $p_url . '&amp;css=%2$s" class="css-link">%1$s</a>');
?>

<h3><?php 
echo __('JavaScript files');
?>
</h3>
<?php 
echo $o->filesList('js', '<a href="' . $p_url . '&amp;js=%2$s" class="js-link">%1$s</a>');
?>
</div>

<?php 
dcPage::helpBlock('themeEditor');
?>
</body>
</html>
Ejemplo n.º 19
0
# Dashboard elements
echo '<div id="dashboard-main">';
# Dashboard icons
echo '<div id="icons">';
foreach ($__dashboard_icons as $i) {
    echo '<p><a href="' . $i[1] . '"><img src="' . dc_admin_icon_url($i[2]) . '" alt="" />' . '<br /><span>' . $i[0] . '</span></a></p>';
}
echo '</div>';
if ($core->auth->user_prefs->dashboard->quickentry) {
    if ($core->auth->check('usage,contentadmin', $core->blog->id)) {
        # Getting categories
        $categories_combo = dcAdminCombos::getCategoriesCombo($core->blog->getCategories(array('post_type' => 'post')));
        echo '<div id="quick">' . '<h3>' . __('Quick entry') . sprintf(' &rsaquo; %s', $core->auth->getOption('post_format')) . '</h3>' . '<form id="quick-entry" action="' . $core->adminurl->get('admin.post') . '" method="post" class="fieldset">' . '<h4>' . __('New entry') . '</h4>' . '<p class="col"><label for="post_title" class="required"><abbr title="' . __('Required field') . '">*</abbr> ' . __('Title:') . '</label>' . form::field('post_title', 20, 255, '', 'maximal') . '</p>' . '<p class="area"><label class="required" ' . 'for="post_content"><abbr title="' . __('Required field') . '">*</abbr> ' . __('Content:') . '</label> ' . form::textarea('post_content', 50, 10) . '</p>' . '<p><label for="cat_id" class="classic">' . __('Category:') . '</label> ' . form::combo('cat_id', $categories_combo) . '</p>' . ($core->auth->check('categories', $core->blog->id) ? '<div>' . '<p id="new_cat" class="q-cat">' . __('Add a new category') . '</p>' . '<p class="q-cat"><label for="new_cat_title">' . __('Title:') . '</label> ' . form::field('new_cat_title', 30, 255, '', '') . '</p>' . '<p class="q-cat"><label for="new_cat_parent">' . __('Parent:') . '</label> ' . form::combo('new_cat_parent', $categories_combo, '', '') . '</p>' . '<p class="form-note info clear">' . __('This category will be created when you will save your post.') . '</p>' . '</div>' : '') . '<p><input type="submit" value="' . __('Save') . '" name="save" /> ' . ($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>' . '</form>' . '</div>';
    }
}
foreach ($__dashboard_contents as $i) {
    if ($i->count() > 0) {
        $dashboardContents .= '';
        foreach ($i as $v) {
            $dashboardContents .= $v;
        }
        $dashboardContents .= '';
    }
}
if ($dashboardContents != '' || $dashboardItems != '') {
    echo '<div id="dashboard-boxes">' . '<div class="db-items">' . $dashboardItems . $dashboardContents . '</div>' . '</div>';
}
echo '</div>';
#end dashboard-main
dcPage::helpBlock('core_dashboard');
dcPage::close();
Ejemplo n.º 20
0
            $count++;
            echo '<td class="handle minimal">' . form::field(array('order[' . $i . ']'), 2, 3, $count, 'position', '', false, 'title="' . sprintf(__('position of %s'), html::escapeHTML(__($m['label']))) . '"') . form::hidden(array('dynorder[]', 'dynorder-' . $i), $i) . '</td>';
            echo '<td class="minimal">' . form::checkbox(array('items_selected[]', 'ims-' . $i), $i) . '</td>';
            echo '<td class="nowrap" scope="row">' . form::field(array('items_label[]', 'iml-' . $i), '', 255, html::escapeHTML(__($m['label']))) . '</td>';
            echo '<td class="nowrap">' . form::field(array('items_descr[]', 'imd-' . $i), '30', 255, html::escapeHTML(__($m['descr']))) . '</td>';
            echo '<td class="nowrap">' . form::field(array('items_url[]', 'imu-' . $i), '30', 255, html::escapeHTML($m['url'])) . '</td>';
        } else {
            echo '<td class="nowrap" scope="row">' . html::escapeHTML(__($m['label'])) . '</td>';
            echo '<td class="nowrap">' . html::escapeHTML(__($m['descr'])) . '</td>';
            echo '<td class="nowrap">' . html::escapeHTML($m['url']) . '</td>';
        }
        echo '</tr>';
    }
    echo '</tbody>' . '</table></div>';
    if (!$step) {
        echo '<div class="two-cols">';
        echo '<p class="col">' . form::hidden('im_order', '') . $core->formNonce();
        echo '<input type="submit" name="updateaction" value="' . __('Update menu') . '" />' . '</p>';
        echo '<p class="col right">' . '<input type="submit" class="delete" name="removeaction" ' . 'value="' . __('Delete selected menu items') . '" ' . 'onclick="return window.confirm(\'' . html::escapeJS(__('Are you sure you want to remove selected menu items?')) . '\');" />' . '</p>';
        echo '</div>';
        echo '</form>';
    }
} else {
    echo '<p>' . __('No menu items so far.') . '</p>';
}
dcPage::helpBlock('simpleMenu');
?>

</body>
</html>
Ejemplo n.º 21
0
    }
    echo '<h5 class="pretty-title">' . __('Top image') . '</h5>' . '<p class="field"><label for="top_image">' . __('Top image') . '</label> ' . form::combo('top_image', $top_images, $blowup_user['top_image'] ? $blowup_user['top_image'] : 'default') . '</p>' . '<p>' . __('Choose "Custom..." to upload your own image.') . '</p>' . '<p id="uploader"><label for="upfile">' . __('Add your image:') . '</label> ' . ' (' . sprintf(__('JPEG or PNG file, 800 pixels wide, maximum size %s'), files::size(DC_MAX_UPLOAD_SIZE)) . ')' . '<input type="file" name="upfile" id="upfile" size="35" />' . '</p>' . '<h5>' . __('Preview') . '</h5>' . '<div class="grid" style="width:800px;border:1px solid #ccc;">' . '<img style="display:block;" src="' . $preview_image . '" alt="" id="image-preview" />' . '</div>';
}
echo '<h4 class="border-top">' . __('Sidebar') . '</h4>' . '<p class="field"><label for="sidebar_position">' . __('Sidebar position:') . '</label> ' . form::combo('sidebar_position', array(__('right') => 'right', __('left') => 'left'), $blowup_user['sidebar_position']) . '</p>' . '<p class="field"><label for="sidebar_text_f">' . __('Sidebar text font:') . '</label> ' . form::combo('sidebar_text_f', blowupConfig::fontsList(), $blowup_user['sidebar_text_f']) . '</p>' . '<p class="field"><label for="sidebar_text_s">' . __('Sidebar text font size:') . '</label> ' . form::field('sidebar_text_s', 7, 7, $blowup_user['sidebar_text_s']) . '</p>' . '<p class="field"><label for="sidebar_text_c">' . __('Sidebar text color:') . '</label> ' . form::field('sidebar_text_c', 7, 7, $blowup_user['sidebar_text_c'], 'colorpicker') . '</p>' . '<p class="field"><label for="sidebar_title_f">' . __('Sidebar titles font:') . '</label> ' . form::combo('sidebar_title_f', blowupConfig::fontsList(), $blowup_user['sidebar_title_f']) . '</p>' . '<p class="field"><label for="sidebar_title_s">' . __('Sidebar titles font size:') . '</label> ' . form::field('sidebar_title_s', 7, 7, $blowup_user['sidebar_title_s']) . '</p>' . '<p class="field"><label for="sidebar_title_c">' . __('Sidebar titles color:') . '</label> ' . form::field('sidebar_title_c', 7, 7, $blowup_user['sidebar_title_c'], 'colorpicker') . '</p>' . '<p class="field"><label for="sidebar_title2_f">' . __('Sidebar 2nd level titles font:') . '</label> ' . form::combo('sidebar_title2_f', blowupConfig::fontsList(), $blowup_user['sidebar_title2_f']) . '</p>' . '<p class="field"><label for="sidebar_title2_s">' . __('Sidebar 2nd level titles font size:') . '</label> ' . form::field('sidebar_title2_s', 7, 7, $blowup_user['sidebar_title2_s']) . '</p>' . '<p class="field"><label for="sidebar_title2_c">' . __('Sidebar 2nd level titles color:') . '</label> ' . form::field('sidebar_title2_c', 7, 7, $blowup_user['sidebar_title2_c'], 'colorpicker') . '</p>' . '<p class="field"><label for="sidebar_line_c">' . __('Sidebar lines color:') . '</label> ' . form::field('sidebar_line_c', 7, 7, $blowup_user['sidebar_line_c'], 'colorpicker') . '</p>' . '<p class="field"><label for="sidebar_link_c">' . __('Sidebar links color:') . '</label> ' . form::field('sidebar_link_c', 7, 7, $blowup_user['sidebar_link_c'], 'colorpicker') . '</p>' . '<p class="field"><label for="sidebar_link_v_c">' . __('Sidebar visited links color:') . '</label> ' . form::field('sidebar_link_v_c', 7, 7, $blowup_user['sidebar_link_v_c'], 'colorpicker') . '</p>' . '<p class="field"><label for="sidebar_link_f_c">' . __('Sidebar focus links color:') . '</label> ' . form::field('sidebar_link_f_c', 7, 7, $blowup_user['sidebar_link_f_c'], 'colorpicker') . '</p>' . '<h4 class="border-top">' . __('Entries') . '</h4>' . '<p class="field"><label for="date_title_f">' . __('Date title font:') . '</label> ' . form::combo('date_title_f', blowupConfig::fontsList(), $blowup_user['date_title_f']) . '</p>' . '<p class="field"><label for="date_title_s">' . __('Date title font size:') . '</label> ' . form::field('date_title_s', 7, 7, $blowup_user['date_title_s']) . '</p>' . '<p class="field"><label for="date_title_c">' . __('Date title color:') . '</label> ' . form::field('date_title_c', 7, 7, $blowup_user['date_title_c'], 'colorpicker') . '</p>' . '<p class="field"><label for="post_title_f">' . __('Entry title font:') . '</label> ' . form::combo('post_title_f', blowupConfig::fontsList(), $blowup_user['post_title_f']) . '</p>' . '<p class="field"><label for="post_title_s">' . __('Entry title font size:') . '</label> ' . form::field('post_title_s', 7, 7, $blowup_user['post_title_s']) . '</p>' . '<p class="field"><label for="post_title_c">' . __('Entry title color:') . '</label> ' . form::field('post_title_c', 7, 7, $blowup_user['post_title_c'], 'colorpicker') . '</p>';
if ($can_write_images) {
    echo '<p class="field"><label for="post_comment_bg_c">' . __('Comment background color:') . '</label> ' . form::field('post_comment_bg_c', 7, 7, $blowup_user['post_comment_bg_c'], 'colorpicker') . '</p>';
}
echo '<p class="field"><label for="post_comment_c">' . __('Comment text color:') . '</label> ' . form::field('post_comment_c', 7, 7, $blowup_user['post_comment_c'], 'colorpicker') . '</p>';
if ($can_write_images) {
    echo '<p class="field"><label for="post_commentmy_bg_c">' . __('My comment background color:') . '</label> ' . form::field('post_commentmy_bg_c', 7, 7, $blowup_user['post_commentmy_bg_c'], 'colorpicker') . '</p>';
}
echo '<p class="field"><label for="post_commentmy_c">' . __('My comment text color:') . '</label> ' . form::field('post_commentmy_c', 7, 7, $blowup_user['post_commentmy_c'], 'colorpicker') . '</p>' . '<h4 class="border-top">' . __('Footer') . '</h4>' . '<p class="field"><label for="footer_f">' . __('Footer font:') . '</label> ' . form::combo('footer_f', blowupConfig::fontsList(), $blowup_user['footer_f']) . '</p>' . '<p class="field"><label for="footer_s">' . __('Footer font size:') . '</label> ' . form::field('footer_s', 7, 7, $blowup_user['footer_s']) . '</p>' . '<p class="field"><label for="footer_c">' . __('Footer color:') . '</label> ' . form::field('footer_c', 7, 7, $blowup_user['footer_c'], 'colorpicker') . '</p>' . '<p class="field"><label for="footer_l_c">' . __('Footer links color:') . '</label> ' . form::field('footer_l_c', 7, 7, $blowup_user['footer_l_c'], 'colorpicker') . '</p>' . '<p class="field"><label for="footer_bg_c">' . __('Footer background color:') . '</label> ' . form::field('footer_bg_c', 7, 7, $blowup_user['footer_bg_c'], 'colorpicker') . '</p>';
echo '<h4 class="border-top">' . __('Additional CSS') . '</h4>' . '<p><label for="extra_css">' . __('Any additional CSS styles (must be written using the CSS syntax):') . '</label> ' . form::textarea('extra_css', 72, 5, html::escapeHTML($blowup_user['extra_css']), 'maximal', '', false, 'title="' . __('Additional CSS') . '"') . '</p>' . '</div>';
// Import / Export configuration
$tmp_array = array();
$tmp_exclude = array('uploaded', 'top_height');
if ($blowup_user['top_image'] == 'custom') {
    $tmp_exclude[] = 'top_image';
}
foreach ($blowup_user as $k => $v) {
    if (!in_array($k, $tmp_exclude)) {
        $tmp_array[] = $k . ':' . '"' . $v . '"';
    }
}
echo '<div class="fieldset">' . '<h3 id="bu_export">' . __('Configuration import / export') . '</h3>' . '<div id="bu_export_content">' . '<p>' . __('You can share your configuration using the following code. To apply a configuration, paste the code, click on "Apply code" and save.') . '</p>' . '<p>' . form::textarea('export_code', 72, 5, implode('; ', $tmp_array), 'maximal', '', false, 'title="' . __('Copy this code:') . '"') . '</p>' . '</div>' . '</div>';
echo '<p class="clear"><input type="submit" value="' . __('Save') . '" />' . $core->formNonce() . '</p>' . '</form>';
dcPage::helpBlock('blowupConfig');
?>
</body>
</html>
Ejemplo n.º 22
0
                    $s_type = implode('|', $s['options']);
                    break;
                case 'text':
                case 'textarea':
                default:
                    $s_type = 'text';
                    break;
            }
            $widget_elements->content .= '<li>' . __('Setting name:') . ' <strong>' . html::escapeHTML($n) . '</strong>' . ' (' . $s_type . ')' . '</li>';
        }
        $widget_elements->content .= '</ul>';
    }
    $widget_elements->content .= '</dd>';
}
$widget_elements->content .= '</dl></div>';
dcPage::helpBlock($widget_elements);
function sidebarWidgets($id, $title, &$widgets, $pr, $default_widgets)
{
    $res = '<fieldset><legend>' . $title . '</legend><div id="' . $id . '">';
    if (!$widgets instanceof dcWidgets) {
        $widgets = $default_widgets;
    }
    if ($widgets->isEmpty()) {
        $res .= '<p class="empty-widgets">' . __('No widget.') . '</p>';
    }
    $i = 0;
    foreach ($widgets->elements() as $w) {
        $iname = 'w[' . $pr . '][' . $i . ']';
        $res .= '<div>' . form::hidden(array($iname . '[id]'), html::escapeHTML($w->id())) . '<p class="widget-name">' . form::field(array($iname . '[order]'), 2, 3, (string) $i, 'js-hide', '', 0, 'title="' . __('order') . '"') . ' ' . $w->name() . '</p>' . '<p class="removeWidget js-remove"><label class="classic">' . form::checkbox(array($iname . '[_rem]'), '1', 0) . ' ' . __('Remove widget') . '</label></p>' . '<div class="widgetSettings">' . $w->formSettings($iname) . '</div>' . '</div>';
        $i++;
    }
Ejemplo n.º 23
0
echo '</div>';
echo '<div class="col">' . '<form action="category.php" method="post">' . '<fieldset><legend>' . __('Add a new category') . '</legend>' . '<p><label>' . __('Title:') . ' ' . form::field('cat_title', 30, 255) . '</label></p>' . '<p><label>' . __('Parent:') . ' ' . '<select id="new_cat_parent" name="new_cat_parent">' . '<option value="0">' . __('Top level') . '</option>';
while ($rs->fetch()) {
    echo '<option value="' . $rs->cat_id . '">' . str_repeat('&nbsp;&nbsp;', $rs->level) . '&bull; ' . html::escapeHTML($rs->cat_title) . '</option>';
}
echo '</select></label></p>' . '<p><input type="submit" value="' . __('Save') . '" /></p>' . $core->formNonce() . '</fieldset>' . '</form>';
if (!$rs->isEmpty()) {
    $deletable = array();
    $l = $rs->level;
    $full_name = array($rs->cat_title);
    while ($rs->fetch()) {
        if ($rs->level < $l) {
            $full_name = array();
        } elseif ($rs->level == $l) {
            array_pop($full_name);
        }
        $full_name[] = html::escapeHTML($rs->cat_title);
        if ($rs->nb_post == 0) {
            $deletable[implode(' / ', $full_name)] = $rs->cat_id;
        }
        $l = $rs->level;
    }
    if (count($deletable) > 0) {
        echo '<form action="categories.php" method="post" id="delete-category">' . '<fieldset><legend>' . __('Remove a category') . '</legend>' . '<p><label>' . __('Choose a category to remove:') . ' ' . form::combo('del_cat', $deletable) . '</label></p> ' . '<p><input type="submit" value="' . __('ok') . '" /></p>' . $core->formNonce() . '</fieldset>' . '</form>';
    }
    echo '<form action="categories.php" method="post" id="reset-order">' . '<fieldset><legend>' . __('Reorder categories') . '</legend>' . '<p>' . __('This will relocate all categories on the top level') . '</p> ' . '<p><input type="submit" value="' . __('Reorder') . '" /></p>' . form::hidden(array('reset'), 1) . $core->formNonce() . '</fieldset>' . '</form>';
}
echo '</div>';
echo '</div>';
dcPage::helpBlock('core_categories');
dcPage::close();
Ejemplo n.º 24
0
    echo '<div class="multi-part" id="add-comment" title="' . __('Add a comment') . '">' . '<h3>' . __('Add a comment') . '</h3>' . '<form action="comment.php" method="post" id="comment-form">' . '<fieldset class="constrained">' . '<p><label class="required" title="' . __('Required field') . '">' . __('Name:') . form::field('comment_author', 30, 255, html::escapeHTML($core->auth->getInfo('user_cn'))) . '</label></p>' . '<p><label>' . __('Email:') . form::field('comment_email', 30, 255, html::escapeHTML($core->auth->getInfo('user_email'))) . '</label></p>' . '<p><label>' . __('Web site:') . form::field('comment_site', 30, 255, html::escapeHTML($core->auth->getInfo('user_url'))) . '</label></p>' . '<p class="area"><label for="comment_content" class="required" title="' . __('Required field') . '">' . __('Comment:') . '</label> ' . form::textarea('comment_content', 50, 8, html::escapeHTML('')) . '</p>' . '<p>' . form::hidden('post_id', $post_id) . $core->formNonce() . '<input type="submit" name="add" value="' . __('save') . '" /></p>' . '</fieldset>' . '</form>' . '</div>';
}
# Show comments or trackbacks
function showComments(&$rs, $has_action)
{
    echo '<table class="comments-list"><tr>' . '<th colspan="2">' . __('Author') . '</th>' . '<th>' . __('Date') . '</th>' . '<th class="nowrap">' . __('IP address') . '</th>' . '<th>' . __('Status') . '</th>' . '<th>&nbsp;</th>' . '</tr>';
    while ($rs->fetch()) {
        $comment_url = 'comment.php?id=' . $rs->comment_id;
        $img = '<img alt="%1$s" title="%1$s" src="images/%2$s" />';
        switch ($rs->comment_status) {
            case 1:
                $img_status = sprintf($img, __('published'), 'check-on.png');
                break;
            case 0:
                $img_status = sprintf($img, __('unpublished'), 'check-off.png');
                break;
            case -1:
                $img_status = sprintf($img, __('pending'), 'check-wrn.png');
                break;
            case -2:
                $img_status = sprintf($img, __('junk'), 'junk.png');
                break;
        }
        echo '<tr class="line' . ($rs->comment_status != 1 ? ' offline' : '') . '"' . ' id="c' . $rs->comment_id . '">' . '<td class="nowrap">' . ($has_action ? form::checkbox(array('comments[]'), $rs->comment_id, '', '', '', 0) : '') . '</td>' . '<td class="maximal">' . $rs->comment_author . '</td>' . '<td class="nowrap">' . dt::dt2str(__('%Y-%m-%d %H:%M'), $rs->comment_dt) . '</td>' . '<td class="nowrap"><a href="comments.php?ip=' . $rs->comment_ip . '">' . $rs->comment_ip . '</a></td>' . '<td class="nowrap status">' . $img_status . '</td>' . '<td class="nowrap status"><a href="' . $comment_url . '">' . '<img src="images/edit-mini.png" alt="" title="' . __('Edit this comment') . '" /></a></td>' . '</tr>';
    }
    echo '</table>';
}
dcPage::helpBlock('core_wiki');
?>
</body>
</html>
Ejemplo n.º 25
0
                throw new Exception(__("Passwords don't match"));
            }
            $cur->user_pwd = $_POST['new_pwd'];
        }
        # --BEHAVIOR-- adminBeforeUserUpdate
        $core->callBehavior('adminBeforeUserUpdate', $cur, $core->auth->userID());
        # Udate user
        $core->updUser($core->auth->userID(), $cur);
        # --BEHAVIOR-- adminAfterUserUpdate
        $core->callBehavior('adminAfterUserUpdate', $cur, $core->auth->userID());
        http::redirect('preferences.php?upd=1');
    } catch (Exception $e) {
        $core->error->add($e->getMessage());
    }
}
/* DISPLAY
-------------------------------------------------------- */
dcPage::open($page_title, dcPage::jsLoad('js/_preferences.js') . dcPage::jsConfirmClose('user-form') . $core->callBehavior('adminPreferencesHeaders'));
if (!empty($_GET['upd'])) {
    echo '<p class="message">' . __('Personal information has been successfully updated.') . '</p>';
}
echo '<h2>' . $page_title . '</h2>';
echo '<form action="preferences.php" method="post" id="user-form">' . '<fieldset><legend>' . __('User preferences') . '</legend>' . '<div class="two-cols">' . '<div class="col">' . '<p><label>' . __('Last Name:') . form::field('user_name', 20, 255, html::escapeHTML($user_name), '', 2) . '</label></p>' . '<p><label>' . __('First Name:') . form::field('user_firstname', 20, 255, html::escapeHTML($user_firstname), '', 3) . '</label></p>' . '<p><label>' . __('Display name:') . form::field('user_displayname', 20, 255, html::escapeHTML($user_displayname), '', 4) . '</label></p>' . '<p><label>' . __('Email:') . form::field('user_email', 20, 255, html::escapeHTML($user_email), '', 5) . '</label></p>' . '<p><label>' . __('URL:') . form::field('user_url', 30, 255, html::escapeHTML($user_url), '', 6) . '</label></p>' . '</div>' . '<div class="col">' . '<p><label>' . __('Preferred format:') . form::combo('user_post_format', $formaters_combo, $user_options['post_format'], '', 7) . '</label></p>' . '<p><label>' . __('Default entry status:') . form::combo('user_post_status', $status_combo, $user_post_status, '', 8) . '</label></p>' . '<p><label>' . __('Entry edit field height:') . form::field('user_edit_size', 5, 4, (int) $user_options['edit_size'], '', 9) . '</label></p>' . '<p><label>' . __('User language:') . form::combo('user_lang', $lang_combo, $user_lang, 'l10n', 10) . '</label></p>' . '<p><label>' . __('User timezone:') . form::combo('user_tz', dt::getZones(true, true), $user_tz, '', 11) . '</label></p>' . '<p><label class="classic">' . form::checkbox('user_wysiwyg', 1, $user_options['enable_wysiwyg'], '', 12) . ' ' . __('Enable WYSIWYG mode') . '</label></p>' . '</div>' . '</div>' . '<br class="clear" />' . '</fieldset>';
# --BEHAVIOR-- adminPreferencesForm
$core->callBehavior('adminPreferencesForm', $core);
if ($core->auth->allowPassChange()) {
    echo '<fieldset>' . '<legend>' . __('Change your password') . '</legend>' . '<p><label>' . __('New password:'******'new_pwd', 20, 255, '', '', 30) . '</label></p>' . '<p><label>' . __('Confirm password:'******'new_pwd_c', 20, 255, '', '', 31) . '</label></p>' . '</fieldset>' . '<fieldset>' . '<p>' . __('If you want to change your email or password you must provide your current password.') . '</p>' . '<p><label>' . __('Your password:'******'cur_pwd', 20, 255, '', '', 32) . '</label></p>' . '</fieldset>';
}
echo '<p class="clear">' . $core->formNonce() . '<input type="submit" accesskey="s" value="' . __('Save') . '" tabindex="33" /></p>' . '</form>';
dcPage::helpBlock('core_user_pref');
dcPage::close();
Ejemplo n.º 26
0
}
# Deactivated modules
$modules = $list->modules->getDisabledModules();
if (!empty($modules)) {
    echo '<div class="multi-part" id="deactivate" title="' . __('Deactivated themes') . '">' . '<h3>' . __('Deactivated themes') . '</h3>' . '<p>' . __('Deactivated themes are installed but not usable. You can activate them from here.') . '</p>';
    $list->setList('theme-deactivate')->setTab('themes')->setModules($modules)->displayModules(array('name', 'distrib'), array('activate', 'delete'));
    echo '</div>';
}
if ($core->auth->isSuperAdmin() && $list->isWritablePath()) {
    # New modules from repo
    $search = $list->getSearch();
    $modules = $search ? $list->store->search($search) : $list->store->get();
    if (!empty($search) || !empty($modules)) {
        echo '<div class="multi-part" id="new" title="' . __('Add themes') . '">' . '<h3>' . __('Add themes from repository') . '</h3>';
        //		'<p>'.__('Search and install themes directly from repository.').'</p>';
        $list->setList('theme-new')->setTab('new')->setModules($modules)->displaySearch()->displayIndex()->displayModules(array('expander', 'sshot', 'name', 'score', 'config', 'desc', 'author', 'version', 'parent', 'details', 'support'), array('install'), true);
        echo '<p class="info vertical-separator">' . sprintf(__("Visit %s repository, the resources center for Dotclear."), '<a href="http://themes.dotaddict.org/galerie-dc2/">Dotaddict</a>') . '</p>' . '</div>';
    }
    # Add a new plugin
    echo '<div class="multi-part" id="addtheme" title="' . __('Install or upgrade manually') . '">' . '<h3>' . __('Add themes from a package') . '</h3>' . '<p>' . __('You can install themes by uploading or downloading zip files.') . '</p>';
    $list->displayManualForm();
    echo '</div>';
}
# --BEHAVIOR-- themesToolsTabs
$core->callBehavior('themesToolsTabs', $core);
# -- Notice for super admin --
if ($core->auth->isSuperAdmin() && !$list->isWritablePath()) {
    echo '<p class="warning">' . __('Some functions are disabled, please give write access to your themes directory to enable them.') . '</p>';
}
dcPage::helpBlock('core_blog_theme');
dcPage::close();
Ejemplo n.º 27
0
    if (empty($blog_users)) {
        echo '<p>' . __('No users') . '</p>';
    } else {
        if ($core->auth->isSuperAdmin()) {
            $user_url_p = '<a href="user.php?id=%1$s">%1$s</a>';
        } else {
            $user_url_p = '%1$s';
        }
        foreach ($blog_users as $k => $v) {
            if (count($v['p']) > 0) {
                echo '<h4>' . sprintf($user_url_p, html::escapeHTML($k)) . ' (' . html::escapeHTML(dcUtils::getUserCN($k, $v['name'], $v['firstname'], $v['displayname'])) . ')';
                if (!$v['super'] && $core->auth->isSuperAdmin()) {
                    echo ' - <a href="permissions.php?blog_id[]=' . $blog_id . '&amp;user_id[]=' . $k . '">' . __('change permissions') . '</a>';
                }
                echo '</h4>';
                echo '<ul>';
                if ($v['super']) {
                    echo '<li>' . __('Super administrator') . '</li>';
                } else {
                    foreach ($v['p'] as $p => $V) {
                        echo '<li>' . __($perm_types[$p]) . '</li>';
                    }
                }
                echo '</ul>';
            }
        }
    }
    echo '</div>';
}
dcPage::helpBlock('core_blog_pref');
dcPage::close();
Ejemplo n.º 28
0
/* DISPLAY Main page
-------------------------------------------------------- */
dcPage::open(__('Dotclear update'), !$step ? dcPage::jsPageTabs($default_tab) . dcPage::jsLoad('js/_update.js') : '', dcPage::breadcrumb(array(__('System') => '', __('Dotclear update') => '')));
if (!$core->error->flag()) {
    if (!empty($_GET['nocache'])) {
        dcPage::success(__('Manual checking of update done successfully.'));
    }
}
if (!$step) {
    echo '<div class="multi-part" id="update" title="' . __('Dotclear update') . '">';
    if (empty($new_v)) {
        echo '<p><strong>' . __('No newer Dotclear version available.') . '</strong></p>' . '<form action="' . $p_url . '" method="get">' . '<p><input type="hidden" name="nocache" value="1" />' . '<input type="submit" value="' . __('Force checking update Dotclear') . '" /></p>' . '</form>';
    } else {
        echo '<p class="static-msg">' . sprintf(__('Dotclear %s is available.'), $new_v) . ($version_info ? ' <a href="' . $version_info . '" class="outgoing" title="' . __('Information about this version') . '">(' . __('Information about this version') . ')&nbsp;<img src="images/outgoing.png" alt=""/></a>' : '') . '</p>' . '<p>' . __('To upgrade your Dotclear installation simply click on the following button. ' . 'A backup file of your current installation will be created in your root directory.') . '</p>' . '<form action="' . $p_url . '" method="get">' . '<p><input type="hidden" name="step" value="check" />' . '<input type="submit" value="' . __('Update Dotclear') . '" /></p>' . '</form>';
    }
    echo '</div>';
    if (!empty($archives)) {
        echo '<div class="multi-part" id="files" title="' . __('Manage backup files') . '">';
        echo '<h3>' . __('Update backup files') . '</h3>' . '<p>' . __('The following files are backups of previously updates. ' . 'You can revert your previous installation or delete theses files.') . '</p>';
        echo '<form action="' . $p_url . '" method="post">';
        foreach ($archives as $v) {
            echo '<p><label class="classic">' . form::radio(array('backup_file'), html::escapeHTML($v)) . ' ' . html::escapeHTML($v) . '</label></p>';
        }
        echo '<p><strong>' . __('Please note that reverting your Dotclear version may have some ' . 'unwanted side-effects. Consider reverting only if you experience strong issues with this new version.') . '</strong> ' . sprintf(__('You should not revert to version prior to last one (%s).'), end($archives)) . '</p>' . '<p><input type="submit" class="delete" name="b_del" value="' . __('Delete selected file') . '" /> ' . '<input type="submit" name="b_revert" value="' . __('Revert to selected file') . '" />' . $core->formNonce() . '</p>' . '</form>';
        echo '</div>';
    }
} elseif ($step == 'unzip' && !$core->error->flag()) {
    echo '<p class="message">' . __("Congratulations, you're one click away from the end of the update.") . ' <strong><a href="index.php?logout=1">' . __('Finish the update.') . '</a></strong>' . '</p>';
}
dcPage::helpBlock('core_update');
dcPage::close();
Ejemplo n.º 29
0
if (!empty($_GET['upd'])) {
    dcPage::success(__('Selected comments have been successfully updated.'));
} elseif (!empty($_GET['del'])) {
    dcPage::success(__('Selected comments have been successfully deleted.'));
}
if (!$core->error->flag()) {
    if (isset($_SESSION['comments_del_spam'])) {
        dcPage::message(__('Spam comments have been successfully deleted.'));
        unset($_SESSION['comments_del_spam']);
    }
    $spam_count = $core->blog->getComments(array('comment_status' => -2), true)->f(0);
    if ($spam_count > 0) {
        echo '<form action="' . $core->adminurl->get("admin.comments") . '" method="post" class="fieldset">';
        if (!$with_spam || $status != -2) {
            if ($spam_count == 1) {
                echo '<p>' . sprintf(__('You have one spam comment.'), '<strong>' . $spam_count . '</strong>') . ' ' . '<a href="' . $core->adminurl->get("admin.comments", array('status' => -2)) . '">' . __('Show it.') . '</a></p>';
            } elseif ($spam_count > 1) {
                echo '<p>' . sprintf(__('You have %s spam comments.'), '<strong>' . $spam_count . '</strong>') . ' ' . '<a href="' . $core->adminurl->get("admin.comments", array('status' => -2)) . '">' . __('Show them.') . '</a></p>';
            }
        }
        echo '<p>' . $core->formNonce() . '<input name="delete_all_spam" class="delete" type="submit" value="' . __('Delete all spams') . '" /></p>';
        # --BEHAVIOR-- adminCommentsSpamForm
        $core->callBehavior('adminCommentsSpamForm', $core);
        echo '</form>';
    }
    echo '<form action="' . $core->adminurl->get("admin.comments") . '" method="get" id="filters-form">' . '<h3 class="hidden">' . __('Filter comments and trackbacks list') . '</h3>' . '<div class="table">' . '<div class="cell">' . '<h4>' . __('Filters') . '</h4>' . '<p><label for="type" class="ib">' . __('Type:') . '</label> ' . form::combo('type', $type_combo, $type) . '</p> ' . '<p><label for="status" class="ib">' . __('Status:') . '</label> ' . form::combo('status', $status_combo, $status) . '</p>' . '</div>' . '<div class="cell filters-sibling-cell">' . '<p><label for="author" class="ib">' . __('Author:') . '</label> ' . form::field('author', 20, 255, html::escapeHTML($author)) . '</p>' . '<p><label for="ip" class="ib">' . __('IP address:') . '</label> ' . form::field('ip', 20, 39, html::escapeHTML($ip)) . '</p>' . '</div>' . '<div class="cell filters-options">' . '<h4>' . __('Display options') . '</h4>' . '<p><label for="sortby" class="ib">' . __('Order by:') . '</label> ' . form::combo('sortby', $sortby_combo, $sortby) . '</p>' . '<p><label for="order" class="ib">' . __('Sort:') . '</label> ' . form::combo('order', $order_combo, $order) . '</p>' . '<p><span class="label ib">' . __('Show') . '</span> <label for="nb" class="classic">' . form::field('nb', 3, 3, $nb_per_page) . ' ' . __('comments per page') . '</label></p>' . '</div>' . '</div>' . '<p><input type="submit" value="' . __('Apply filters and display options') . '" />' . '<br class="clear" /></p>' . '</form>';
    # Show comments
    $comment_list->display($page, $nb_per_page, '<form action="' . $core->adminurl->get("admin.comments") . '" method="post" id="form-comments">' . '%s' . '<div class="two-cols">' . '<p class="col checkboxes-helpers"></p>' . '<p class="col right"><label for="action" class="classic">' . __('Selected comments action:') . '</label> ' . form::combo('action', $comments_actions_page->getCombo(), $default, '', '', '', 'title="' . __('Actions') . '"') . $core->formNonce() . '<input type="submit" value="' . __('ok') . '" /></p>' . form::hidden(array('type'), $type) . form::hidden(array('sortby'), $sortby) . form::hidden(array('order'), $order) . form::hidden(array('author'), html::escapeHTML(preg_replace('/%/', '%%', $author))) . form::hidden(array('status'), $status) . form::hidden(array('ip'), preg_replace('/%/', '%%', $ip)) . form::hidden(array('page'), $page) . form::hidden(array('nb'), $nb_per_page) . '</div>' . '</form>', $show_filters, $with_spam || $status == -2);
}
dcPage::helpBlock('core_comments');
dcPage::close();
Ejemplo n.º 30
0
    echo '<p>' . sprintf(__('You can install or remove a language by adding or ' . 'removing the relevant directory in your %s folder.'), '<strong>locales</strong>') . '</p>';
}
if (!empty($dc_langs) && $is_writable) {
    $dc_langs_combo = array();
    foreach ($dc_langs as $k => $v) {
        if ($v->link && isset($iso_codes[$v->title])) {
            $dc_langs_combo[html::escapeHTML('(' . $v->title . ') ' . $iso_codes[$v->title])] = html::escapeHTML($v->link);
        }
    }
    echo '<form method="post" action="' . $core->adminurl->get("admin.langs") . '" enctype="multipart/form-data" class="fieldset">' . '<h4>' . __('Available languages') . '</h4>' . '<p>' . sprintf(__('You can download and install a additional language directly from Dotclear.net. ' . 'Proposed languages are based on your version: %s.'), '<strong>' . DC_VERSION . '</strong>') . '</p>' . '<p class="field"><label for="pkg_url" class="classic">' . __('Language:') . '</label> ' . form::combo(array('pkg_url'), $dc_langs_combo) . '</p>' . '<p class="field"><label for="your_pwd1" class="classic required"><abbr title="' . __('Required field') . '">*</abbr> ' . __('Your password:'******'</label> ' . form::password(array('your_pwd', 'your_pwd1'), 20, 255) . '</p>' . '<p><input type="submit" value="' . __('Install language') . '" />' . $core->formNonce() . '</p>' . '</form>';
}
if ($is_writable) {
    # 'Upload language pack' form
    echo '<form method="post" action="' . $core->adminurl->get("admin.langs") . '" enctype="multipart/form-data" class="fieldset">' . '<h4>' . __('Upload a zip file') . '</h4>' . '<p>' . __('You can install languages by uploading zip files.') . '</p>' . '<p class="field"><label for="pkg_file" class="classic required"><abbr title="' . __('Required field') . '">*</abbr> ' . __('Language zip file:') . '</label> ' . '<input type="file" id="pkg_file" name="pkg_file" /></p>' . '<p class="field"><label for="your_pwd2" class="classic required"><abbr title="' . __('Required field') . '">*</abbr> ' . __('Your password:'******'</label> ' . form::password(array('your_pwd', 'your_pwd2'), 20, 255) . '</p>' . '<p><input type="submit" name="upload_pkg" value="' . __('Upload language') . '" />' . $core->formNonce() . '</p>' . '</form>';
}
dcPage::helpBlock('core_langs');
dcPage::close();
# Language installation function
function dc_lang_install($file)
{
    $zip = new fileUnzip($file);
    $zip->getList(false, '#(^|/)(__MACOSX|\\.svn|\\.DS_Store|\\.directory|Thumbs\\.db)(/|$)#');
    if (!preg_match('/^[a-z]{2,3}(-[a-z]{2})?$/', $zip->getRootDir())) {
        throw new Exception(__('Invalid language zip file.'));
    }
    if ($zip->isEmpty() || !$zip->hasFile($zip->getRootDir() . '/main.po')) {
        throw new Exception(__('The zip file does not appear to be a valid Dotclear language pack.'));
    }
    $target = dirname($file);
    $destination = $target . '/' . $zip->getRootDir();
    $res = 1;