Ejemplo n.º 1
0
 public function gui()
 {
     if ($this->status) {
         dcPage::success(__('Content successfully imported.'));
     }
     echo '<form action="' . $this->getURL(true) . '" method="post">' . '<p>' . sprintf(__('Add a feed content to the current blog: <strong>%s</strong>.'), html::escapeHTML($this->core->blog->name)) . '</p>' . '<p><label for="feed_url">' . __('Feed URL:') . '</label>' . form::field('feed_url', 50, 300, html::escapeHTML($this->feed_url)) . '</p>' . '<p>' . $this->core->formNonce() . form::hidden(array('do'), 1) . '<input type="submit" value="' . __('Import') . '" /></p>' . '</form>';
 }
Ejemplo n.º 2
0
    //$link_auto = $_POST['link_auto'];
    try {
        $menu->updateLink($id, $link_title, $link_href, $link_level, $link_auto, $link_desc, $link_lang, $link_class);
        http::redirect($p_url . '&edit=1&id=' . $id . '&upd=1');
    } catch (Exception $e) {
        $core->error->add($e->getMessage());
    }
}
?>
<html>
<head>
<title><?php 
echo $page_title;
?>
</title>
</head>

<body>
<?php 
echo dcPage::breadcrumb(array(html::escapeHTML($core->blog->name) => '', $page_title => $p_url, __('Changing the item') => ''));
if (isset($rs)) {
    if (!empty($_GET['upd'])) {
        dcPage::success(__('Items has been successfully updated'));
    }
    echo '<p><a class="back" href="' . $p_url . '">' . __('Return to menu') . '</a></p>';
    echo '<form action="plugin.php" method="post">' . '<div class="fieldset two-cols"><h4>' . __('Changing the 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, html::escapeHTML($link_title)) . '</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, html::escapeHTML($link_href)) . '</p>' . '<p class="field"><label class="classic" for="link_desc">' . __('Description:') . ' </label>' . form::field('link_desc', 50, 255, html::escapeHTML($link_desc)) . '</p>' . '<p class="field"><label class="classic" for="link_level">' . __('Level:') . ' </label>' . form::field('link_level', 5, 255, html::escapeHTML($link_level)) . '</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, html::escapeHTML($link_lang)) . '</p>' . '<p class="field"><label class="classic" for="link_class">' . __('Class:') . ' </label>' . form::field('link_class', 50, 32, html::escapeHTML($link_class)) . '</p>' . '</div>' . '<p>' . form::hidden('p', 'menu') . form::hidden('edit', 1) . form::hidden('id', $id) . $core->formNonce() . '<input type="submit" name="edit_link" class="submit" value="' . __('Save') . '"/></p>' . '</form>';
}
dcPage::helpBlock('menu');
?>
</body>
</html>
Ejemplo n.º 3
0
        } elseif ($e->getCode() == dcUpdate::ERR_FILES_UNWRITALBE) {
            $msg = __('The following files of your Dotclear installation cannot be written. ' . 'Please fix this or try to <a href="http://dotclear.org/download">update manually</a>.');
        }
        if (isset($e->bad_files)) {
            $msg .= '<ul><li><strong>' . implode('</strong></li><li><strong>', $e->bad_files) . '</strong></li></ul>';
        }
        $core->error->add($msg);
        $core->callBehavior('adminDCUpdateException', $e);
    }
}
/* 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) {
Ejemplo n.º 4
0
    } catch (Exception $e) {
        $core->error->add($e->getMessage());
    }
}
$title = $cat_id ? html::escapeHTML($cat_title) : __('New category');
$elements = array(html::escapeHTML($core->blog->name) => '', __('Categories') => $core->adminurl->get("admin.categories"));
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) {
Ejemplo n.º 5
0
 $spam_count = dcAntispam::countSpam($core);
 $published_count = dcAntispam::countPublishedComments($core);
 $moderationTTL = $core->blog->settings->antispam->antispam_moderation_ttl;
 echo '<form action="' . $p_url . '" method="post" class="fieldset">' . '<h3>' . __('Information') . '</h3>';
 echo '<ul class="spaminfo">' . '<li class="spamcount"><a href="' . $core->adminurl->get('admin.comments', array('status' => '-2')) . '">' . __('Junk comments:') . '</a> ' . '<strong>' . $spam_count . '</strong></li>' . '<li class="hamcount"><a href="' . $core->adminurl->get('admin.comments', array('status' => '1')) . '">' . __('Published comments:') . '</a> ' . $published_count . '</li>' . '</ul>';
 if ($spam_count > 0) {
     echo '<p>' . $core->formNonce() . form::hidden('ts', time()) . '<input name="delete_all" class="delete" type="submit" value="' . __('Delete all spams') . '" /></p>';
 }
 if ($moderationTTL != null && $moderationTTL >= 0) {
     echo '<p>' . sprintf(__('All spam comments older than %s day(s) will be automatically deleted.'), $moderationTTL) . ' ' . sprintf(__('You can modify this duration in the %s'), '<a href="' . $core->adminurl->get('admin.blog.pref') . '#antispam_moderation_ttl"> ' . __('Blog settings') . '</a>') . '.</p>';
 }
 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));
Ejemplo n.º 6
0
}
dcPage::open($page_title . ' - ' . __('Entries'), dcPage::jsDatePicker() . dcPage::jsModal() . dcPage::jsMetaEditor() . $admin_post_behavior . dcPage::jsLoad('js/_post.js') . dcPage::jsConfirmClose('entry-form', 'comment-form') . $core->callBehavior('adminPostHeaders') . dcPage::jsPageTabs($default_tab) . $next_headlink . "\n" . $prev_headlink, dcPage::breadcrumb(array(html::escapeHTML($core->blog->name) => '', __('Entries') => $core->adminurl->get("admin.posts"), $post_id ? $page_title_edit : $page_title => '')), array('x-frame-allow' => $core->blog->url));
if (!empty($_GET['upd'])) {
    dcPage::success(__('Entry has been successfully updated.'));
} elseif (!empty($_GET['crea'])) {
    dcPage::success(__('Entry has been successfully created.'));
} elseif (!empty($_GET['attached'])) {
    dcPage::success(__('File has been successfully attached.'));
} elseif (!empty($_GET['rmattach'])) {
    dcPage::success(__('Attachment has been successfully removed.'));
}
if (!empty($_GET['creaco'])) {
    dcPage::success(__('Comment has been successfully created.'));
}
if (!empty($_GET['tbsent'])) {
    dcPage::success(__('All pings sent.'));
}
# XHTML conversion
if (!empty($_GET['xconv'])) {
    $post_excerpt = $post_excerpt_xhtml;
    $post_content = $post_content_xhtml;
    $post_format = 'xhtml';
    dcPage::message(__('Don\'t forget to validate your XHTML conversion by saving your post.'));
}
if ($post_id && $post->post_status == 1) {
    echo '<p><a class="onblog_link outgoing" href="' . $post->getURL() . '" title="' . html::escapeHTML($post_title) . '">' . __('Go to this entry on the site') . ' <img src="images/outgoing-blue.png" alt="" /></a></p>';
}
if ($post_id) {
    echo '<p class="nav_prevnext">';
    if ($prev_link) {
        echo $prev_link;
Ejemplo n.º 7
0
}
// POST ACTIONS
if (!empty($_POST)) {
    try {
        $core->blog->settings->addNamespace('themes');
        # About
        if (!empty($_POST['qrazytimes2_about'])) {
            $my_about = $_POST['qrazytimes2_about'];
        } elseif (empty($_POST['qrazytimes2_about'])) {
            $my_about = $default_about;
        }
        $core->blog->settings->themes->put('qrazytimes2_about', $my_about, 'boolean', 'Display About', true);
        if (isset($_POST['about'])) {
            @($fp = fopen($html_fileabout, 'wb'));
            fwrite($fp, $_POST['about']);
            fclose($fp);
        }
        // Blog refresh
        $core->blog->triggerBlog();
        // Template cache reset
        $core->emptyTemplatesCache();
        dcPage::success(__('Theme configuration has been successfully updated.'), true, true);
    } catch (Exception $e) {
        $core->error->add($e->getMessage());
    }
}
$html_contentabout = is_file($html_fileabout) ? file_get_contents($html_fileabout) : '';
// DISPLAY
# About
echo '<div class="fieldset"><h4>' . __('About') . '</h4>' . '<p>' . form::checkbox('qrazytimes2_about', 1, $my_about) . '<label class="classic" for="qrazytimes2_about">' . __('Display About') . '</label>' . '</p>';
echo '<p class="area"><label for="about">' . __('Code:') . ' ' . form::textarea('about', 60, 10, html::escapeHTML($html_contentabout)) . '</label></p>' . '</div>';
Ejemplo n.º 8
0
            } else {
                $core->adminurl->redirect("admin.user", array('id' => $new_id));
            }
        }
    } catch (Exception $e) {
        $core->error->add($e->getMessage());
    }
}
/* DISPLAY
-------------------------------------------------------- */
dcPage::open($page_title, dcPage::jsConfirmClose('user-form') . dcPage::jsLoad('js/jquery/jquery.pwstrength.js') . '<script type="text/javascript">' . "\n" . "//<![CDATA[\n" . "\$(function() {\n" . "\t\$('#new_pwd').pwstrength({texts: ['" . sprintf(__('Password strength: %s'), __('very weak')) . "', '" . sprintf(__('Password strength: %s'), __('weak')) . "', '" . sprintf(__('Password strength: %s'), __('mediocre')) . "', '" . sprintf(__('Password strength: %s'), __('strong')) . "', '" . sprintf(__('Password strength: %s'), __('very strong')) . "']});\n" . "});\n" . "\n//]]>\n" . "</script>\n" . $core->callBehavior('adminUserHeaders'), dcPage::breadcrumb(array(__('System') => '', __('Users') => $core->adminurl->get("admin.users"), $page_title => '')));
if (!empty($_GET['upd'])) {
    dcPage::success(__('User has been successfully updated.'));
}
if (!empty($_GET['add'])) {
    dcPage::success(__('User has been successfully created.'));
}
echo '<form action="' . $core->adminurl->get("admin.user") . '" method="post" id="user-form">' . '<div class="two-cols">' . '<div class="col">' . '<h3>' . __('User profile') . '</h3>' . '<p><label for="user_id" class="required"><abbr title="' . __('Required field') . '">*</abbr> ' . __('User ID:') . '</label> ' . form::field('user_id', 20, 255, html::escapeHTML($user_id)) . '</p>' . '<p class="form-note">' . __('At least 2 characters using letters, numbers or symbols.') . '</p>';
if ($user_id == $core->auth->userID()) {
    echo '<p class="warning">' . __('Warning:') . ' ' . __('If you change your username, you will have to log in again.') . '</p>';
}
echo '<div class="pw-table">' . '<p class="pw-cell">' . '<label for="new_pwd" ' . ($user_id != '' ? '' : 'class="required"') . '>' . ($user_id != '' ? '' : '<abbr title="' . __('Required field') . '">*</abbr> ') . ($user_id != '' ? __('New password:'******'Password:'******'</label>' . form::password('new_pwd', 20, 255, '', '', '', false, ' data-indicator="pwindicator" ') . '</p>' . '<div id="pwindicator">' . '    <div class="bar"></div>' . '    <p class="label no-margin"></p>' . '</div>' . '</div>' . '<p class="form-note">' . __('Password must contain at least 6 characters.') . '</p>' . '<p><label for="new_pwd_c" ' . ($user_id != '' ? '' : 'class="required"') . '>' . ($user_id != '' ? '' : '<abbr title="' . __('Required field') . '">*</abbr> ') . __('Confirm password:'******'</label> ' . form::password('new_pwd_c', 20, 255) . '</p>';
if ($core->auth->allowPassChange()) {
    echo '<p><label for="user_change_pwd" class="classic">' . form::checkbox('user_change_pwd', '1', $user_change_pwd) . ' ' . __('Password change required to connect') . '</label></p>';
}
$super_disabled = $user_super && $user_id == $core->auth->userID();
echo '<p><label for="user_super" class="classic">' . form::checkbox('user_super', '1', $user_super, '', '', $super_disabled) . ' ' . __('Super administrator') . '</label></p>' . '<p><label for="user_name">' . __('Last Name:') . '</label> ' . form::field('user_name', 20, 255, html::escapeHTML($user_name)) . '</p>' . '<p><label for="user_firstname">' . __('First Name:') . '</label> ' . form::field('user_firstname', 20, 255, html::escapeHTML($user_firstname)) . '</p>' . '<p><label for="user_displayname">' . __('Display name:') . '</label> ' . form::field('user_displayname', 20, 255, html::escapeHTML($user_displayname)) . '</p>' . '<p><label for="user_email">' . __('Email:') . '</label> ' . form::field('user_email', 20, 255, html::escapeHTML($user_email)) . '</p>' . '<p class="form-note">' . __('Mandatory for password recovering procedure.') . '</p>' . '<p><label for="user_url">' . __('URL:') . '</label> ' . form::field('user_url', 30, 255, html::escapeHTML($user_url)) . '</p>' . '</div>' . '<div class="col">' . '<h3>' . __('Options') . '</h3>' . '<h4>' . __('Interface') . '</h4>' . '<p><label for="user_lang">' . __('Language:') . '</label> ' . form::combo('user_lang', $lang_combo, $user_lang, 'l10n') . '</p>' . '<p><label for="user_tz">' . __('Timezone:') . '</label> ' . form::combo('user_tz', dt::getZones(true, true), $user_tz) . '</p>' . '<h4>' . __('Edition') . '</h4>' . '<p><label for="user_post_format">' . __('Preferred format:') . '</label> ' . form::combo('user_post_format', $formaters_combo, $user_options['post_format']) . '</p>' . '<p><label for="user_post_status">' . __('Default entry status:') . '</label> ' . form::combo('user_post_status', $status_combo, $user_post_status) . '</p>' . '<p><label for="user_edit_size">' . __('Entry edit field height:') . '</label> ' . form::field('user_edit_size', 5, 4, (int) $user_options['edit_size']) . '</p>';
# --BEHAVIOR-- adminUserForm
$core->callBehavior('adminUserForm', isset($rs) ? $rs : null);
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>';
Ejemplo n.º 9
0
            $core->error->add($e->getMessage());
        }
    }
    if (!$can_edit) {
        $core->error->add(__("You can't edit this comment."));
    }
}
/* DISPLAY
-------------------------------------------------------- */
if ($comment_id) {
    $breadcrumb = dcPage::breadcrumb(array(html::escapeHTML($core->blog->name) => '', html::escapeHTML($post_title) => $core->getPostAdminURL($post_type, $post_id) . '&amp;co=1#c' . $comment_id, __('Edit comment') => ''));
} else {
    $breadcrumb = dcPage::breadcrumb(array(html::escapeHTML($core->blog->name) => '', html::escapeHTML($post_title) => $core->getPostAdminURL($post_type, $post_id), __('Edit comment') => ''));
}
dcPage::open(__('Edit comment'), dcPage::jsConfirmClose('comment-form') . dcPage::jsLoad('js/_comment.js') . $core->callBehavior('adminPostEditor', $comment_editor['xhtml'], 'comment', array('#comment_content'), 'xhtml') . $core->callBehavior('adminCommentHeaders'), $breadcrumb);
if ($comment_id) {
    if (!empty($_GET['upd'])) {
        dcPage::success(__('Comment has been successfully updated.'));
    }
    $comment_mailto = '';
    if ($comment_email) {
        $comment_mailto = '<a href="mailto:' . html::escapeHTML($comment_email) . '?subject=' . rawurlencode(sprintf(__('Your comment on my blog %s'), $core->blog->name)) . '&amp;body=' . rawurlencode(sprintf(__("Hi!\n\nYou wrote a comment on:\n%s\n\n\n"), $rs->getPostURL())) . '">' . __('Send an e-mail') . '</a>';
    }
    echo '<form action="' . $core->adminurl->get("admin.comment") . '" method="post" id="comment-form">' . '<div class="fieldset">' . '<h3>' . __('Information collected') . '</h3>' . '<p>' . __('IP address:') . ' ' . '<a href="' . $core->adminurl->get("admin.comments", array('ip' => $comment_ip)) . '">' . $comment_ip . '</a></p>' . '<p>' . __('Date:') . ' ' . dt::dt2str(__('%Y-%m-%d %H:%M'), $comment_dt) . '</p>' . '</div>' . '<h3>' . __('Comment submitted') . '</h3>' . '<p><label for="comment_author" class="required"><abbr title="' . __('Required field') . '">*</abbr>' . __('Author:') . '</label>' . form::field('comment_author', 30, 255, html::escapeHTML($comment_author)) . '</p>' . '<p><label for="comment_email">' . __('Email:') . '</label>' . form::field('comment_email', 30, 255, html::escapeHTML($comment_email)) . '<span>' . $comment_mailto . '</span>' . '</p>' . '<p><label for="comment_site">' . __('Web site:') . '</label>' . form::field('comment_site', 30, 255, html::escapeHTML($comment_site)) . '</p>' . '<p><label for="comment_status">' . __('Status:') . '</label>' . form::combo('comment_status', $status_combo, $comment_status, '', '', !$can_publish) . '</p>' . $core->callBehavior('adminAfterCommentDesc', $rs) . '<p class="area"><label for="comment_content">' . __('Comment:') . '</label> ' . form::textarea('comment_content', 50, 10, html::escapeHTML($comment_content)) . '</p>' . '<p>' . form::hidden('id', $comment_id) . $core->formNonce() . '<input type="submit" accesskey="s" name="update" value="' . __('Save') . '" /> ';
    if ($can_delete) {
        echo '<input type="submit" class="delete" name="delete" value="' . __('Delete') . '" />';
    }
    echo '</p>' . '</form>';
}
dcPage::helpBlock('core_comments');
dcPage::close();
Ejemplo n.º 10
0
        default:
            $img_status = '';
    }
    $edit_entry_title = '&ldquo;' . html::escapeHTML($post_title) . '&rdquo;' . ' ' . $img_status;
} else {
    $edit_entry_title = $page_title;
}
echo dcPage::breadcrumb(array(html::escapeHTML($core->blog->name) => '', __('Pages') => $p_url, $edit_entry_title => ''));
if (!empty($_GET['upd'])) {
    dcPage::success(__('Page has been successfully updated.'));
} elseif (!empty($_GET['crea'])) {
    dcPage::success(__('Page has been successfully created.'));
} elseif (!empty($_GET['attached'])) {
    dcPage::success(__('File has been successfully attached.'));
} elseif (!empty($_GET['rmattach'])) {
    dcPage::success(__('Attachment has been successfully removed.'));
}
# XHTML conversion
if (!empty($_GET['xconv'])) {
    $post_excerpt = $post_excerpt_xhtml;
    $post_content = $post_content_xhtml;
    $post_format = 'xhtml';
    dcPage::message(__('Don\'t forget to validate your XHTML conversion by saving your post.'));
}
if ($post_id && $post->post_status == 1) {
    echo '<p><a class="onblog_link outgoing" href="' . $post->getURL() . '" title="' . html::escapeHTML($post_title) . '">' . __('Go to this page on the site') . ' <img src="images/outgoing-blue.png" alt="" /></a></p>';
}
echo '';
if ($post_id) {
    echo '<p class="nav_prevnext">';
    if ($prev_link) {
Ejemplo n.º 11
0
        } else {
            dcPage::addSuccessNotice(__('Language has been successfully installed.'));
        }
        $core->adminurl->redirect("admin.langs");
    } catch (Exception $e) {
        $core->error->add($e->getMessage());
    }
}
/* DISPLAY Main page
-------------------------------------------------------- */
dcPage::open(__('Languages management'), dcPage::jsLoad('js/_langs.js'), dcPage::breadcrumb(array(__('System') => '', __('Languages management') => '')));
if (!empty($_GET['removed'])) {
    dcPage::success(__('Language has been successfully deleted.'));
}
if (!empty($_GET['added'])) {
    dcPage::success($_GET['added'] == 2 ? __('Language has been successfully upgraded') : __('Language has been successfully installed.'));
}
echo '<p>' . __('Here you can install, upgrade or remove languages for your Dotclear ' . 'installation.') . '</p>' . '<p>' . sprintf(__('You can change your user language in your <a href="%1$s">preferences</a> or ' . 'change your blog\'s main language in your <a href="%2$s">blog settings</a>.'), $core->adminurl->get("admin.user.preferences"), $core->adminurl->get("admin.blog.pref")) . '</p>';
echo '<h3>' . __('Installed languages') . '</h3>';
$locales_content = scandir(DC_L10N_ROOT);
$tmp = array();
foreach ($locales_content as $v) {
    $c = $v == '.' || $v == '..' || $v == 'en' || !is_dir(DC_L10N_ROOT . '/' . $v) || !isset($iso_codes[$v]);
    if (!$c) {
        $tmp[$v] = DC_L10N_ROOT . '/' . $v;
    }
}
$locales_content = $tmp;
if (empty($locales_content)) {
    echo '<p><strong>' . __('No additional language is installed.') . '</strong></p>';
} else {
Ejemplo n.º 12
0
    dcPage::success(__('Directory has been successfully created.'));
}
if (!empty($_GET['upok'])) {
    dcPage::success(__('Files have been successfully uploaded.'));
}
if (!empty($_GET['rmfok'])) {
    dcPage::success(__('File has been successfully removed.'));
}
if (!empty($_GET['rmdok'])) {
    dcPage::success(__('Directory has been successfully removed.'));
}
if (!empty($_GET['rebuildok'])) {
    dcPage::success(__('Directory has been successfully rebuilt.'));
}
if (!empty($_GET['unzipok'])) {
    dcPage::success(__('Zip file has been successfully extracted.'));
}
if (!$dir) {
    call_user_func($close_f);
    exit;
}
if ($select) {
    // Select mode (popup or not)
    echo '<div class="' . ($popup ? 'form-note ' : '') . 'info"><p>';
    if ($select == 1) {
        echo sprintf(__('Select a file by clicking on %s'), '<img src="images/plus.png" alt="' . __('Select this file') . '" />');
    } else {
        echo sprintf(__('Select files and click on <strong>%s</strong> button'), __('Choose selected medias'));
    }
    if ($core_media_writable) {
        echo ' ' . __('or') . ' ' . sprintf('<a href="#fileupload">%s</a>', __('upload a new file'));
Ejemplo n.º 13
0
    } catch (Exception $e) {
        $core->error->add($e->getMessage());
    }
}
if ($standalone) {
    $breadcrumb = dcPage::breadcrumb(array(html::escapeHTML($blog_name) => '', __('Blog settings') => ''));
} else {
    $breadcrumb = dcPage::breadcrumb(array(__('System') => '', __('Blogs') => $core->adminurl->get("admin.blogs"), __('Blog settings') . ' : ' . html::escapeHTML($blog_name) => ''));
}
dcPage::open(__('Blog settings'), '<script type="text/javascript">' . "\n" . "//<![CDATA[" . "\n" . dcPage::jsVar('dotclear.msg.warning_path_info', __('Warning: except for special configurations, it is generally advised to have a trailing "/" in your blog URL in PATH_INFO mode.')) . "\n" . dcPage::jsVar('dotclear.msg.warning_query_string', __('Warning: except for special configurations, it is generally advised to have a trailing "?" in your blog URL in QUERY_STRING mode.')) . "\n" . "//]]>" . "</script>" . dcPage::jsConfirmClose('blog-form') . $core->callBehavior('adminPostEditor') . dcPage::jsLoad('js/_blog_pref.js') . $core->callBehavior('adminBlogPreferencesHeaders') . dcPage::jsPageTabs(), $breadcrumb);
if ($blog_id) {
    if (!empty($_GET['add'])) {
        dcPage::success(__('Blog has been successfully created.'));
    }
    if (!empty($_GET['upd'])) {
        dcPage::success(__('Blog has been successfully updated.'));
    }
    echo '<div class="multi-part" id="params" title="' . __('Parameters') . '">' . '<h3 class="out-of-screen-if-js">' . __('Parameters') . '</h3>' . '<form action="' . $action . '" method="post" id="blog-form">';
    echo '<div class="fieldset"><h4>' . __('Blog details') . '</h4>' . $core->formNonce();
    if ($core->auth->isSuperAdmin()) {
        echo '<p><label for="blog_id" class="required"><abbr title="' . __('Required field') . '">*</abbr> ' . __('Blog ID:') . '</label>' . form::field('blog_id', 30, 32, html::escapeHTML($blog_id)) . '</p>' . '<p class="form-note">' . __('At least 2 characters using letters, numbers or symbols.') . '</p> ' . '<p class="form-note warn">' . __('Please note that changing your blog ID may require changes in your public index.php file.') . '</p>';
    } else {
        /*
        Only super admins can change the blog ID and URL, but we need to pass
        their values to the POST request via hidden html input values  so as
        to allow admins to update other settings.
        Otherwise dcCore::getBlogCursor() throws an exception.
        */
        echo form::field('blog_id', 30, 32, html::escapeHTML($blog_id), '', '', false, 'hidden="hidden"');
        echo form::field('blog_url', 50, 255, html::escapeHTML($blog_url), '', '', false, 'hidden="hidden"');
    }
Ejemplo n.º 14
0
if (!$core->auth->user_prefs->accessibility->nodragdrop && $core->auth->check('categories', $core->blog->id) && $rs->count() > 1) {
    $starting_script .= dcPage::jsLoad('js/jquery/jquery-ui.custom.js');
    $starting_script .= dcPage::jsLoad('js/jquery/jquery.ui.touch-punch.js');
    $starting_script .= dcPage::jsLoad('js/jquery/jquery.mjs.nestedSortable.js');
}
$starting_script .= dcPage::jsConfirmClose('form-categories');
$starting_script .= dcPage::jsLoad('js/_categories.js');
dcPage::open(__('Categories'), $starting_script, dcPage::breadcrumb(array(html::escapeHTML($core->blog->name) => '', __('Categories') => '')));
if (!empty($_GET['del'])) {
    dcPage::success(__('The category has been successfully removed.'));
}
if (!empty($_GET['reord'])) {
    dcPage::success(__('Categories have been successfully reordered.'));
}
if (!empty($_GET['move'])) {
    dcPage::success(__('Entries have been successfully moved to the category you choose.'));
}
$categories_combo = dcAdminCombos::getCategoriesCombo($rs);
echo '<p class="top-add"><a class="button add" href="' . $core->adminurl->get("admin.category") . '">' . __('New category') . '</a></p>';
echo '<div class="col">';
if ($rs->isEmpty()) {
    echo '<p>' . __('No category so far.') . '</p>';
} else {
    echo '<form action="' . $core->adminurl->get("admin.categories") . '" method="post" id="form-categories">' . '<div id="categories">';
    $ref_level = $level = $rs->level - 1;
    while ($rs->fetch()) {
        $attr = 'id="cat_' . $rs->cat_id . '" class="cat-line clearfix"';
        if ($rs->level > $level) {
            echo str_repeat('<ul><li ' . $attr . '>', $rs->level - $level);
        } elseif ($rs->level < $level) {
            echo str_repeat('</li></ul>', -($rs->level - $level));
Ejemplo n.º 15
0
 public function gui()
 {
     if ($this->status == 'single') {
         dcPage::success(__('Single blog successfully imported.'));
         return;
     }
     if ($this->status == 'full') {
         dcPage::success(__('Content successfully imported.'));
         return;
     }
     $public_files = array_merge(array('-' => ''), $this->getPublicFiles());
     $has_files = (bool) (count($public_files) - 1);
     echo '<script type="text/javascript">' . "\n" . "//<![CDATA[\n" . dcPage::jsVar('dotclear.msg.confirm_full_import', __('Are you sure you want to import a full backup file?')) . "\$(function() {" . "\$('#up_single_file').change(function() { " . "if (this.value != '') { \$('#public_single_file').val(''); } " . "}); " . "\$('#public_single_file').change(function() { " . "if (this.value != '') { \$('#up_single_file').val(''); } " . "}); " . "\$('#up_full_file').change(function() { " . "if (this.value != '') { \$('#public_full_file').val(''); } " . "}); " . "\$('#public_full_file').change(function() { " . "if (this.value != '') { \$('#up_full_file').val(''); } " . "}); " . "\$('#formfull').submit(function() { " . "return window.confirm(dotclear.msg.confirm_full_import); " . "}); " . "});\n" . "//]]>\n" . "</script>\n";
     echo '<form action="' . $this->getURL(true) . '" method="post" enctype="multipart/form-data" class="fieldset">' . '<h3>' . __('Single blog') . '</h3>' . '<p>' . sprintf(__('This will import a single blog backup as new content in the current blog: <strong>%s</strong>.'), html::escapeHTML($this->core->blog->name)) . '</p>' . '<p><label for="up_single_file">' . __('Upload a backup file') . ' (' . sprintf(__('maximum size %s'), files::size(DC_MAX_UPLOAD_SIZE)) . ')' . ' </label>' . ' <input type="file" id="up_single_file" name="up_single_file" size="20" />' . '</p>';
     if ($has_files) {
         echo '<p><label for="public_single_file" class="">' . __('or pick up a local file in your public directory') . ' </label> ' . form::combo('public_single_file', $public_files) . '</p>';
     }
     echo '<p>' . $this->core->formNonce() . form::hidden(array('do'), 1) . form::hidden(array('MAX_FILE_SIZE'), DC_MAX_UPLOAD_SIZE) . '<input type="submit" value="' . __('Import') . '" /></p>' . '</form>';
     if ($this->core->auth->isSuperAdmin()) {
         echo '<form action="' . $this->getURL(true) . '" method="post" enctype="multipart/form-data" id="formfull" class="fieldset">' . '<h3>' . __('Multiple blogs') . '</h3>' . '<p class="warning">' . __('This will reset all the content of your database, except users.') . '</p>' . '<p><label for="up_full_file">' . __('Upload a backup file') . ' ' . ' (' . sprintf(__('maximum size %s'), files::size(DC_MAX_UPLOAD_SIZE)) . ')' . ' </label>' . '<input type="file" id="up_full_file" name="up_full_file" size="20" />' . '</p>';
         if ($has_files) {
             echo '<p><label for="public_full_file">' . __('or pick up a local file in your public directory') . ' </label>' . form::combo('public_full_file', $public_files) . '</p>';
         }
         echo '<p><label for="your_pwd" class="required"><abbr title="' . __('Required field') . '">*</abbr> ' . __('Your password:'******'</label>' . form::password('your_pwd', 20, 255) . '</p>' . '<p>' . $this->core->formNonce() . form::hidden(array('do'), 1) . form::hidden(array('MAX_FILE_SIZE'), DC_MAX_UPLOAD_SIZE) . '<input type="submit" value="' . __('Import') . '" /></p>' . '</form>';
     }
 }
Ejemplo n.º 16
0
  <?php 
echo dcPage::jsPageTabs($default_tab);
?>
</head>

<body>
<?php 
echo dcPage::breadcrumb(array(html::escapeHTML($core->blog->name) => '', '<span class="page-title">' . $page_title . '</span>' => ''));
if (!empty($_GET['newconfig'])) {
    dcPage::success(__('Items has been successfully updated'));
}
if (!empty($_GET['removed'])) {
    dcPage::success(__('Items have been successfully removed.'));
}
if (!empty($_GET['addlink'])) {
    dcPage::success(__('Menu item has been successfully created.'));
}
?>

<div class="multi-part" title="<?php 
echo __('Menu');
?>
" id="menu">
<form action="plugin.php" method="post" id="links-form">
<table class="maximal dragable">
<thead>
<tr>
  <th><?php 
echo __('Order');
?>
</th>
Ejemplo n.º 17
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.º 18
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.º 19
0
if ($popup) {
    // Display notices
    echo dcPage::notices();
}
if ($file === null) {
    call_user_func($close_f);
    exit;
}
if (!empty($_GET['fupd']) || !empty($_GET['fupl'])) {
    dcPage::success(__('File has been successfully updated.'));
}
if (!empty($_GET['thumbupd'])) {
    dcPage::success(__('Thumbnails have been successfully updated.'));
}
if (!empty($_GET['blogprefupd'])) {
    dcPage::success(__('Default media insertion settings have been successfully updated.'));
}
# Get major file type (first part of mime type)
$file_type = explode('/', $file->type);
# Selection mode
if ($select) {
    // Let user choose thumbnail size if image
    $media_desc = $file->media_title;
    echo '<div id="media-select" class="multi-part" title="' . __('Select media item') . '">' . '<h3>' . __('Select media item') . '</h3>' . '<form id="media-select-form" action="" method="get">';
    $media_img_default_size = $core->blog->settings->system->media_img_default_size;
    if ($media_img_default_size == '') {
        $media_img_default_size = 'm';
    }
    $media_img_default_alignment = $core->blog->settings->system->media_img_default_alignment;
    if ($media_img_default_alignment == '') {
        $media_img_default_alignment = 'none';
Ejemplo n.º 20
0
    $counter = $core->blog->getComments($params, true);
    $comment_list = new adminCommentList($core, $comments, $counter->f(0));
} catch (Exception $e) {
    $core->error->add($e->getMessage());
}
/* DISPLAY
-------------------------------------------------------- */
$form_filter_title = __('Show filters and display options');
$starting_script = dcPage::jsLoad('js/_comments.js');
$starting_script .= dcPage::jsLoad('js/filter-controls.js');
$starting_script .= '<script type="text/javascript">' . "\n" . "//<![CDATA[" . "\n" . dcPage::jsVar('dotclear.msg.show_filters', $show_filters ? 'true' : 'false') . "\n" . dcPage::jsVar('dotclear.msg.filter_posts_list', $form_filter_title) . "\n" . dcPage::jsVar('dotclear.msg.cancel_the_filter', __('Cancel filters and display options')) . "\n" . "//]]>" . "</script>";
dcPage::open(__('Comments and trackbacks'), $starting_script, dcPage::breadcrumb(array(html::escapeHTML($core->blog->name) => '', __('Comments and trackbacks') => '')));
if (!empty($_GET['upd'])) {
    dcPage::success(__('Selected comments have been successfully updated.'));
} elseif (!empty($_GET['del'])) {
    dcPage::success(__('Selected comments have been successfully deleted.'));
}
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>';
            }
Ejemplo n.º 21
0
        // Sort blog list using lexical order if necessary
        $rsStatic->extend('rsExtUser');
        $rsStatic = $rsStatic->toExtStatic();
        $rsStatic->lexicalSort($sortby == 'UPPER(blog_name)' ? 'blog_name' : 'blog_id', $order);
    }
} catch (Exception $e) {
    $core->error->add($e->getMessage());
}
/* DISPLAY
-------------------------------------------------------- */
$form_filter_title = __('Show filters and display options');
$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(__('List of blogs'), $starting_script, dcPage::breadcrumb(array(__('System') => '', __('List of blogs') => '')));
if (!empty($_GET['del'])) {
    dcPage::success(__('Blog has been successfully deleted.'));
}
if (!$core->error->flag()) {
    if ($core->auth->isSuperAdmin()) {
        echo '<p class="top-add"><a class="button add" href="' . $core->adminurl->get("admin.blog") . '">' . __('Create a new blog') . '</a></p>';
    }
    echo '<form action="' . $core->adminurl->get("admin.blogs") . '" method="get" id="filters-form">' . '<h3 class="hidden">' . __('Filter blogs list') . '</h3>' . '<div class="table">' . '<div class="cell">' . '<h4>' . __('Filters') . '</h4>' . '<p><label for="q" class="ib">' . __('Search:') . '</label> ' . form::field('q', 20, 255, html::escapeHTML($q)) . '</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, html::escapeHTML($sortby)) . '</p>' . '<p><label for="order" class="ib">' . __('Sort:') . '</label> ' . form::combo('order', $order_combo, html::escapeHTML($order)) . '</p>' . '<p><span class="label ib">' . __('Show') . '</span> <label for="nb" class="classic">' . form::field('nb', 3, 3, $nb_per_page) . ' ' . __('blogs per page') . '</label></p>' . '</div>' . '</div>' . '<p><input type="submit" value="' . __('Apply filters and display options') . '" />' . '<br class="clear" /></p>' . '</form>';
    # Show blogs
    if ($nb_blog == 0) {
        if ($show_filters) {
            echo '<p><strong>' . __('No blog matches the filter') . '</strong></p>';
        } else {
            echo '<p><strong>' . __('No blog') . '</strong></p>';
        }
    } else {
        $pager = new dcPager($page, $nb_blog, $nb_per_page, 10);