本文整理汇总了PHP中dcPage::open方法的典型用法代码示例。如果您正苦于以下问题:PHP dcPage::open方法的具体用法?PHP dcPage::open怎么用?PHP dcPage::open使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类dcPage
的用法示例。
在下文中一共展示了dcPage::open方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: beginPage
public function beginPage($breadcrumb = '', $head = '')
{
if ($this->in_plugin) {
echo '<html><head><title>' . __('Entries') . '</title>' . dcPage::jsLoad('js/_posts_actions.js') . $head . '</script></head><body>' . $breadcrumb;
} else {
dcPage::open(__('Entries'), dcPage::jsLoad('js/_posts_actions.js') . $head, $breadcrumb);
}
echo '<p><a class="back" href="' . $this->getRedirection(true) . '">' . __('Back to entries list') . '</a></p>';
}
示例2: __
$core->error->add($e->getMessage());
}
if (!$core->error->flag()) {
dcPage::addSuccessNotice(__('User has been successfully updated.'));
http::redirect($redir);
}
}
}
/* DISPLAY
-------------------------------------------------------- */
if (!empty($users) && empty($blogs) && $action == 'blogs') {
$breadcrumb = dcPage::breadcrumb(array(__('System') => '', __('Users') => $core->adminurl->get("admin.users"), __('Permissions') => ''));
} else {
$breadcrumb = dcPage::breadcrumb(array(__('System') => '', __('Users') => $core->adminurl->get("admin.users"), __('Actions') => ''));
}
dcPage::open(__('Users'), dcPage::jsLoad('js/_users_actions.js') . $core->callBehavior('adminUsersActionsHeaders'), $breadcrumb);
if (!isset($action)) {
dcPage::close();
exit;
}
$hidden_fields = '';
foreach ($users as $u) {
$hidden_fields .= form::hidden(array('users[]'), $u);
}
if (isset($_POST['redir']) && strpos($_POST['redir'], '://') === false) {
$hidden_fields .= form::hidden(array('redir'), html::escapeURL($_POST['redir']));
} else {
$hidden_fields .= form::hidden(array('q'), html::escapeHTML($_POST['q'])) . form::hidden(array('sortby'), $_POST['sortby']) . form::hidden(array('order'), $_POST['order']) . form::hidden(array('page'), $_POST['page']) . form::hidden(array('nb'), $_POST['nb']);
}
echo '<p><a class="back" href="' . html::escapeURL($redir) . '">' . __('Back to user profile') . '</a></p>';
# --BEHAVIOR-- adminUsersActionsContent
示例3: dc_lang_install
}
try {
$ret_code = dc_lang_install($dest);
} catch (Exception $e) {
@unlink($dest);
throw $e;
}
@unlink($dest);
http::redirect('langs.php?added=' . $ret_code);
} catch (Exception $e) {
$core->error->add($e->getMessage());
}
}
/* DISPLAY Main page
-------------------------------------------------------- */
dcPage::open(__('Languages management'), dcPage::jsLoad('js/_langs.js'));
echo '<h2>' . __('Languages management') . '</h2>';
if (!empty($_GET['removed'])) {
echo '<p class="message">' . __('Language has been successfully deleted.') . '</p>';
}
if (!empty($_GET['added'])) {
echo '<p class="message">' . ($_GET['added'] == 2 ? __('Language has been successfully upgraded') : __('Language has been successfully installed.')) . '</p>';
}
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>.'), 'preferences.php', 'blog_pref.php') . '</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;
示例4: foreach
$post_title = html::escapeHTML(trim(html::clean($post_title)));
foreach (explode("\n", $tb_urls) as $tb_url) {
try {
$TB->ping($tb_url, $id, $post_title, $tb_excerpt, $post_url);
} catch (Exception $e) {
$core->error->add($e->getMessage());
}
}
if (!$core->error->flag()) {
http::redirect('trackbacks.php?id=' . $id . '&sent=1');
}
}
$page_title = __('Ping blogs');
/* DISPLAY
-------------------------------------------------------- */
dcPage::open($page_title, dcPage::jsLoad('js/_trackbacks.js'));
# Exit if we cannot view page
if (!$can_view_page) {
dcPage::close();
exit;
}
if (!empty($_GET['sent'])) {
echo '<p class="message">' . __('All pings sent.') . '</p>';
}
echo '<h2>' . html::escapeHTML($core->blog->name) . ' › ' . $page_title . '</h2>';
echo '<p><a href="' . $core->getPostAdminURL($post->post_type, $id) . '">« ' . sprintf(__('Back to "%s"'), html::escapeHTML($post->post_title)) . '</a></p>';
echo '<h3 id="entry-preview-title">' . html::escapeHTML($post->post_title) . '</h3>' . '<div class="frame-shrink" id="entry-preview">' . ($post->post_excerpt_xhtml ? $post->post_excerpt_xhtml . '<hr />' : '') . $post->post_content_xhtml . '</div>';
if (!empty($_GET['auto'])) {
flush();
$tb_urls = implode("\n", $TB->discover($post->post_excerpt_xhtml . ' ' . $post->post_content_xhtml));
} else {
示例5: Exception
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:') . form::password('new_pwd', 20, 255, '', '', 30) . '</label></p>' . '<p><label>' . __('Confirm password:') . form::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:') . form::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();
示例6: adminPostList
} 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();
示例7: array
# --BEHAVIOR-- adminAfterUserCreate
$core->callBehavior('adminAfterUserCreate', $cur, $new_id);
dcPage::addSuccessNotice(__('User has been successfully created.'));
if (!empty($_POST['saveplus'])) {
$core->adminurl->redirect("admin.user");
} 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();
示例8: __
if ($e->getCode() == dcUpdate::ERR_FILES_CHANGED) {
$msg = __('The following files of your Dotclear installation ' . 'have been modified so we won\'t try to update your installation. ' . 'Please try to <a href="http://dotclear.org/download">update manually</a>.');
} elseif ($e->getCode() == dcUpdate::ERR_FILES_UNREADABLE) {
$msg = sprintf(__('The following files of your Dotclear installation are not readable. ' . 'Please fix this or try to make a backup file named %s manually.'), '<strong>backup-' . DC_VERSION . '.zip</strong>');
} 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);
}
}
/* DISPLAY Main page
-------------------------------------------------------- */
dcPage::open(__('Dotclear update'));
if (!$core->error->flag()) {
echo '<h2>' . __('Dotclear update') . '</h2>';
}
if (!$step) {
if (empty($new_v)) {
echo '<p><strong>' . __('No newer Dotclear version available.') . '</strong></p>';
} else {
echo '<p class="static-msg">' . sprintf(__('Dotclear %s is available.'), $new_v) . '</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>';
}
if (!empty($archives)) {
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>';
}
示例9: Exception
throw new Exception(sprintf(__('User "%s" already exists.'), html::escapeHTML($cur->user_id)));
}
# --BEHAVIOR-- adminBeforeUserCreate
$core->callBehavior('adminBeforeUserCreate', $cur);
$new_id = $core->addUser($cur);
# --BEHAVIOR-- adminAfterUserCreate
$core->callBehavior('adminAfterUserCreate', $cur, $new_id);
http::redirect('user.php?id=' . $new_id . '&add=1');
}
} catch (Exception $e) {
$core->error->add($e->getMessage());
}
}
/* DISPLAY
-------------------------------------------------------- */
dcPage::open($page_title, dcPage::jsConfirmClose('user-form') . $core->callBehavior('adminUserHeaders'));
if (!empty($_GET['upd'])) {
echo '<p class="message">' . __('User has been successfully updated.') . '</p>';
}
if (!empty($_GET['add'])) {
echo '<p class="message">' . __('User has been successfully created.') . '</p>';
}
echo '<h2><a href="users.php">' . __('Users') . '</a> › ' . $page_title . '</h2>';
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 '<form action="user.php" method="post"id="user-form">' . '<fieldset><legend>' . __('User information') . '</legend>' . '<div class="two-cols">' . '<div class="col">' . '<p><label class="required" title="' . __('Required field') . '">' . __('Username:') . ' ' . form::field('user_id', 20, 255, html::escapeHTML($user_id), '', 2) . '</label></p>' . '<p class="form-note">' . __('At least 2 characters using letters, numbers or symbols.') . '</p>' . '<p><label>' . ($user_id != '' ? __('New password:') : __('Password:')) . ' ' . form::password('new_pwd', 20, 255, '', '', 3) . '</label></p>' . '<p><label>' . __('Confirm password:') . ' ' . form::password('new_pwd_c', 20, 255, '', '', 4) . '</label></p>' . '<p><label>' . __('Last Name:') . ' ' . form::field('user_name', 20, 255, html::escapeHTML($user_name), '', 5) . '</label></p>' . '<p><label>' . __('First Name:') . ' ' . form::field('user_firstname', 20, 255, html::escapeHTML($user_firstname), '', 6) . '</label></p>' . '<p><label>' . __('Display name:') . ' ' . form::field('user_displayname', 20, 255, html::escapeHTML($user_displayname), '', 7) . '</label></p>' . '<p><label>' . __('Email:') . ' ' . form::field('user_email', 20, 255, html::escapeHTML($user_email), '', 8) . '</label></p>' . '</div>' . '<div class="col">' . '<p><label>' . __('URL:') . ' ' . form::field('user_url', 30, 255, html::escapeHTML($user_url), '', 8) . '</label></p>' . '<p><label>' . __('Preferred format:') . ' ' . form::combo('user_post_format', $formaters_combo, $user_options['post_format'], '', 9) . '</label></p>' . '<p><label>' . __('Default entry status:') . ' ' . form::combo('user_post_status', $status_combo, $user_post_status, '', 10) . '</label></p>' . '<p><label>' . __('Entry edit field height:') . ' ' . form::field('user_edit_size', 5, 4, (int) $user_options['edit_size'], '', 11) . '</label></p>' . '<p><label>' . __('User language:') . ' ' . form::combo('user_lang', $lang_combo, $user_lang, 'l10n', 12) . '</label></p>' . '<p><label>' . __('User timezone:') . ' ' . form::combo('user_tz', dt::getZones(true, true), $user_tz, '', 13) . '</label></p>' . '<p><label class="classic">' . form::checkbox('user_super', '1', $user_super, '', 14) . ' ' . __('Super administrator') . '</label></p>' . '</div>' . '</div>' . '</fieldset>';
# --BEHAVIOR-- adminUserForm
$core->callBehavior('adminUserForm', isset($rs) ? $rs : null);
echo '<fieldset>' . '<p><label>' . __('Your password:') . form::password('your_pwd', 20, 255, '', '', 15) . '</label></p>' . '</fieldset>' . '<p class="clear"><input type="submit" accesskey="s" value="' . __('Save') . '" tabindex="16" />' . ($user_id != '' ? form::hidden('id', $user_id) : '') . $core->formNonce() . '</p>' . '</form>';
if ($user_id) {
示例10: catch
$core->adminurl->redirect("admin.categories");
}
} 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(' ', $rs->level - 1) . ($rs->level - 1 == 0 ? '' : '• ') . 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) {
示例11: unset
}
unset($client);
}
$ret_code = $core->plugins->installPackage($dest, $core->plugins);
http::redirect('plugins.php?added=' . $ret_code);
} catch (Exception $e) {
$core->error->add($e->getMessage());
$default_tab = 'addplugin';
}
}
}
# Plugin install
$plugins_install = $core->plugins->installModules();
/* DISPLAY Main page
-------------------------------------------------------- */
dcPage::open(__('Plugins management'), dcPage::jsLoad('js/_plugins.js') . dcPage::jsPageTabs($default_tab));
echo '<h2>' . __('Plugins management') . '</h2>';
if (!empty($_GET['removed'])) {
echo '<p class="message">' . __('Plugin has been successfully deleted.') . '</p>';
}
if (!empty($_GET['added'])) {
echo '<p class="message">' . ($_GET['added'] == 2 ? __('Plugin has been successfully upgraded') : __('Plugin has been successfully installed.')) . '</p>';
}
# Plugins install messages
if (!empty($plugins_install['success'])) {
echo '<div class="static-msg">' . __('Following plugins have been installed:') . '<ul>';
foreach ($plugins_install['success'] as $k => $v) {
echo '<li>' . $k . '</li>';
}
echo '</ul></div>';
}
示例12: catch
$latest_news .= '<dt>' . $dt . '</dt>' . '<dd>' . dt::dt2str('%d %B %Y', $item->pubdate, 'Europe/Paris') . '</dd>';
}
$i++;
if ($i > 7) {
break;
}
}
$latest_news .= '</dl>';
$__dashboard_items[1][] = $latest_news;
}
} catch (Exception $e) {
}
$core->callBehavior('adminDashboardItems', $core, $__dashboard_items);
/* DISPLAY
-------------------------------------------------------- */
dcPage::open(__('Dashboard'), dcPage::jsToolBar() . dcPage::jsLoad('js/_index.js') . $core->callBehavior('adminDashboardHeaders'));
echo '<h2>' . html::escapeHTML($core->blog->name) . ' › ' . __('Dashboard');
if ($core->auth->getInfo('user_default_blog') != $core->blog->id && $core->auth->blog_count > 1) {
echo ' - <a href="index.php?default_blog=1" class="button">' . __('Make this blog my default blog') . '</a>';
}
echo '</h2>';
if ($core->blog->status == 0) {
echo '<p class="static-msg">' . __('This blog is offline') . '</p>';
} elseif ($core->blog->status == -1) {
echo '<p class="static-msg">' . __('This blog is removed') . '</p>';
}
if (!DC_ADMIN_URL) {
echo '<p class="static-msg">' . __('DC_ADMIN_URL is not defined, you should edit your configuration file.') . '</p>';
}
# Plugins install messages
if (!empty($plugins_install['success'])) {
示例13: adminUserList
$rsStatic = $rs->toStatic();
if ($sortby != 'nb_post') {
// Sort user list using lexical order if necessary
$rsStatic->extend('rsExtUser');
$rsStatic = $rsStatic->toExtStatic();
$rsStatic->lexicalSort($sortby, $order);
}
$user_list = new adminUserList($core, $rsStatic, $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/_users.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(__('Users'), $starting_script, dcPage::breadcrumb(array(__('System') => '', __('Users') => '')));
if (!$core->error->flag()) {
if (!empty($_GET['del'])) {
dcPage::message(__('User has been successfully removed.'));
}
if (!empty($_GET['upd'])) {
dcPage::message(__('The permissions have been successfully updated.'));
}
echo '<p class="top-add"><strong><a class="button add" href="' . $core->adminurl->get("admin.user") . '">' . __('New user') . '</a></strong></p>' . '<form action="' . $core->adminurl->get("admin.users") . '" 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="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, $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) . ' ' . __('users per page') . '</label></p> ' . '</div>' . '</div>' . '<p><input type="submit" value="' . __('Apply filters and display options') . '" />' . '<br class="clear" /></p>' . '</form>';
# Show users
$user_list->display($page, $nb_per_page, '<form action="' . $core->adminurl->get("admin.user.actions") . '" method="post" id="form-users">' . '%s' . '<div class="two-cols">' . '<p class="col checkboxes-helpers"></p>' . '<p class="col right"><label for="action" class="classic">' . __('Selected users action:') . ' ' . form::combo('action', $combo_action) . '</label> ' . '<input type="submit" value="' . __('ok') . '" />' . form::hidden(array('q'), html::escapeHTML($q)) . form::hidden(array('sortby'), $sortby) . form::hidden(array('order'), $order) . form::hidden(array('page'), $page) . form::hidden(array('nb'), $nb_per_page) . $core->formNonce() . '</p>' . '</div>' . '</form>', $show_filters);
}
dcPage::helpBlock('core_users');
dcPage::close();
示例14: dcMedia
} else {
http::redirect($core->getPostAdminURL($rs->post_type, $post_id, false));
}
}
$core->media = new dcMedia($core);
$f = $core->media->getPostMedia($post_id, $media_id);
if (empty($f)) {
$post_id = $media_id = null;
throw new Exception(__('This attachment does not exist'));
}
$f = $f[0];
} catch (Exception $e) {
$core->error->add($e->getMessage());
}
# Remove a media from en
if ($post_id && $media_id || $core->error->flag()) {
if (!empty($_POST['remove'])) {
$core->media->removePostMedia($post_id, $media_id);
dcPage::addSuccessNotice(__('Attachment has been successfully removed.'));
http::redirect($core->getPostAdminURL($rs->post_type, $post_id, false));
} elseif (isset($_POST['post_id'])) {
http::redirect($core->getPostAdminURL($rs->post_type, $post_id, false));
}
if (!empty($_GET['remove'])) {
dcPage::open(__('Remove attachment'));
echo '<h2>' . __('Attachment') . ' › <span class="page-title">' . __('confirm removal') . '</span></h2>';
echo '<form action="' . $core->adminurl->get("admin.post.media") . '" method="post">' . '<p>' . __('Are you sure you want to remove this attachment?') . '</p>' . '<p><input type="submit" class="reset" value="' . __('Cancel') . '" /> ' . ' <input type="submit" class="delete" name="remove" value="' . __('Yes') . '" />' . form::hidden('post_id', $post_id) . form::hidden('media_id', $media_id) . $core->formNonce() . '</p>' . '</form>';
dcPage::close();
exit;
}
}
示例15: helpPage
}
} else {
$content .= $fc;
}
}
if (trim($content) == '') {
return $ret;
}
$ret['content'] = $content;
if ($title != '') {
$ret['title'] = $title;
}
return $ret;
}
$help_page = !empty($_GET['page']) ? html::escapeHTML($_GET['page']) : 'index';
$content_array = helpPage($help_page);
if ($content_array['content'] == '' || $help_page == 'index') {
$content_array = helpPage('index');
}
if ($content_array['title'] != '') {
$breadcrumb = dcPage::breadcrumb(array(__('Global help') => $core->adminurl->get("admin.help"), $content_array['title'] => ''));
} else {
$breadcrumb = dcPage::breadcrumb(array(__('Global help') => ''));
}
/* DISPLAY
-------------------------------------------------------- */
dcPage::open(__('Global help'), dcPage::jsPageTabs('first-step'), $breadcrumb);
echo $content_array['content'];
// Prevents global help link display
$GLOBALS['__resources']['ctxhelp'] = true;
dcPage::close();