public function gui($url) { $bls = $this->getServers(); if (isset($_POST['bls'])) { try { $this->core->blog->settings->addNamespace('antispam'); $this->core->blog->settings->antispam->put('antispam_dnsbls', $_POST['bls'], 'string', 'Antispam DNSBL servers', true, false); dcPage::addSuccessNotice(__('The list of DNSBL servers has been succesfully updated.')); http::redirect($url); } catch (Exception $e) { $core->error->add($e->getMessage()); } } /* DISPLAY ---------------------------------------------- */ $res = dcPage::notices(); $res .= '<form action="' . html::escapeURL($url) . '" method="post" class="fieldset">' . '<h3>' . __('IP Lookup servers') . '</h3>' . '<p><label for="bls">' . __('Add here a coma separated list of servers.') . '</label>' . form::textarea('bls', 40, 3, html::escapeHTML($bls), 'maximal') . '</p>' . '<p><input type="submit" value="' . __('Save') . '" />' . $this->core->formNonce() . '</p>' . '</form>'; return $res; }
public function gui($url) { global $default_tab; $core =& $this->core; # Set current type and tab $ip_type = 'black'; if (!empty($_REQUEST['ip_type']) && $_REQUEST['ip_type'] == 'white') { $ip_type = 'white'; } $default_tab = 'tab_' . $ip_type; # Add IP to list if (!empty($_POST['addip'])) { try { $global = !empty($_POST['globalip']) && $core->auth->isSuperAdmin(); $this->addIP($ip_type, $_POST['addip'], $global); dcPage::addSuccessNotice(__('IP address has been successfully added.')); http::redirect($url . '&ip_type=' . $ip_type); } catch (Exception $e) { $core->error->add($e->getMessage()); } } # Remove IP from list if (!empty($_POST['delip']) && is_array($_POST['delip'])) { try { $this->removeRule($_POST['delip']); dcPage::addSuccessNotice(__('IP addresses have been successfully removed.')); http::redirect($url . '&ip_type=' . $ip_type); } catch (Exception $e) { $core->error->add($e->getMessage()); } } /* DISPLAY ---------------------------------------------- */ $res = dcPage::notices(); $res .= $this->displayForms($url, 'black', __('Blacklist')) . $this->displayForms($url, 'white', __('Whitelist')); return $res; }
if (empty($tasks)) { echo dcPage::breadcrumb(array(__('Plugins') => '', __('Maintenance') => '')) . '<p class="warn">' . __('You have not sufficient permissions to view this page.') . '</p>' . '</body></html>'; return null; } if ($task && ($res = $task->step()) !== null) { // Page title echo dcPage::breadcrumb(array(__('Plugins') => '', '<a href="' . $p_url . '">' . __('Maintenance') . '</a>' => '', html::escapeHTML($task->name()) => '')) . dcPage::notices(); // content if (substr($res, 0, 1) != '<') { $res = sprintf('<p class="step-msg">%s</p>', $res); } // Intermediate task (task required several steps) echo '<div class="step-box" id="' . $task->id() . '">' . '<p class="step-back">' . '<a class="back" href="' . $p_url . '&tab=' . $task->tab() . '#' . $task->tab() . '">' . __('Back') . '</a>' . '</p>' . '<h3>' . html::escapeHTML($task->name()) . '</h3>' . '<form action="' . $p_url . '" method="post">' . $res . '<p class="step-submit">' . '<input type="submit" value="' . $task->task() . '" /> ' . form::hidden(array('task'), $task->id()) . form::hidden(array('code'), (int) $code) . $core->formNonce() . '</p>' . '</form>' . '</div>'; } else { // Page title echo dcPage::breadcrumb(array(__('Plugins') => '', __('Maintenance') => '')) . dcPage::notices(); // Simple task (with only a button to start it) foreach ($maintenance->getTabs() as $tab_obj) { $res_group = ''; foreach ($maintenance->getGroups() as $group_obj) { $res_task = ''; foreach ($tasks as $t) { if (!$t->id() || $t->group() != $group_obj->id() || $t->tab() != $tab_obj->id()) { continue; } $res_task .= '<p>' . form::radio(array('task', $t->id()), $t->id()) . ' ' . '<label class="classic" for="' . $t->id() . '">' . html::escapeHTML($t->task()) . '</label>'; // Expired task alert message $ts = $t->expired(); if ($core->blog->settings->maintenance->plugin_message && $ts !== false) { if ($ts === null) { $res_task .= '<br /> <span class="warn">' . __('This task has never been executed.') . ' ' . __('You should execute it now.') . '</span>';
?> <script type="text/javascript"> //<![CDATA[ <?php echo dcPage::jsVar('dotclear.blowup_public_url', blowupConfig::imagesURL()); echo dcPage::jsVar('dotclear.msg.predefined_styles', __('Predefined styles')); echo dcPage::jsVar('dotclear.msg.apply_code', __('Apply code')); echo dcPage::jsVar('dotclear.msg.predefined_style_title', __('Choose a predefined style')); ?> //]]> </script> </head> <body> <?php echo dcPage::breadcrumb(array(html::escapeHTML($core->blog->name) => '', __('Blog appearance') => $core->adminurl->get('admin.blog.theme'), __('Blowup configuration') => '')) . dcPage::notices(); echo '<p><a class="back" href="' . $core->adminurl->get('admin.blog.theme') . '">' . __('Back to Blog appearance') . '</a></p>'; if (!$can_write_images) { dcPage::message(__('For the following reasons, images cannot be created. You won\'t be able to change some background properties.') . $notices, false, true); } echo '<form id="theme_config" action="' . $p_url . '" method="post" enctype="multipart/form-data">'; echo '<div class="fieldset"><h3>' . __('Customization') . '</h3>' . '<h4>' . __('General') . '</h4>'; if ($can_write_images) { echo '<p class="field"><label for="body_bg_c">' . __('Background color:') . '</label> ' . form::field('body_bg_c', 7, 7, $blowup_user['body_bg_c'], 'colorpicker') . '</p>' . '<p class="field"><label for="body_bg_g">' . __('Background color fill:') . '</label> ' . form::combo('body_bg_g', $gradient_types, $blowup_user['body_bg_g']) . '</p>'; } echo '<p class="field"><label for="body_txt_f">' . __('Main text font:') . '</label> ' . form::combo('body_txt_f', blowupConfig::fontsList(), $blowup_user['body_txt_f']) . '</p>' . '<p class="field"><label for="body_txt_s">' . __('Main text font size:') . '</label> ' . form::field('body_txt_s', 7, 7, $blowup_user['body_txt_s']) . '</p>' . '<p class="field"><label for="body_txt_c">' . __('Main text color:') . '</label> ' . form::field('body_txt_c', 7, 7, $blowup_user['body_txt_c'], 'colorpicker') . '</p>' . '<p class="field"><label for="body_line_height">' . __('Text line height:') . '</label> ' . form::field('body_line_height', 7, 7, $blowup_user['body_line_height']) . '</p>' . '<h4 class="border-top">' . __('Links') . '</h4>' . '<p class="field"><label for="body_link_c">' . __('Links color:') . '</label> ' . form::field('body_link_c', 7, 7, $blowup_user['body_link_c'], 'colorpicker') . '</p>' . '<p class="field"><label for="body_link_v_c">' . __('Visited links color:') . '</label> ' . form::field('body_link_v_c', 7, 7, $blowup_user['body_link_v_c'], 'colorpicker') . '</p>' . '<p class="field"><label for="body_link_f_c">' . __('Focus links color:') . '</label> ' . form::field('body_link_f_c', 7, 7, $blowup_user['body_link_f_c'], 'colorpicker') . '</p>' . '<h4 class="border-top">' . __('Page top') . '</h4>'; if ($can_write_images) { echo '<p class="field"><label for="prelude_c">' . __('Prelude color:') . '</label> ' . form::field('prelude_c', 7, 7, $blowup_user['prelude_c'], 'colorpicker') . '</p>'; } echo '<p class="field"><label for="blog_title_hide">' . __('Hide main title') . '</label> ' . form::checkbox('blog_title_hide', 1, $blowup_user['blog_title_hide']) . '</p>' . '<p class="field"><label for="blog_title_f">' . __('Main title font:') . '</label> ' . form::combo('blog_title_f', blowupConfig::fontsList(), $blowup_user['blog_title_f']) . '</p>' . '<p class="field"><label for="blog_title_s">' . __('Main title font size:') . '</label> ' . form::field('blog_title_s', 7, 7, $blowup_user['blog_title_s']) . '</p>' . '<p class="field"><label for="blog_title_c">' . __('Main title color:') . '</label> ' . form::field('blog_title_c', 7, 7, $blowup_user['blog_title_c'], 'colorpicker') . '</p>' . '<p class="field"><label for="blog_title_a">' . __('Main title alignment:') . '</label> ' . form::combo('blog_title_a', array(__('center') => 'center', __('left') => 'left', __('right') => 'right'), $blowup_user['blog_title_a']) . '</p>' . '<p class="field"><label for="blog_title_p">' . __('Main title position (x:y)') . '</label> ' . form::field('blog_title_p', 7, 7, $blowup_user['blog_title_p']) . '</p>'; if ($can_write_images) {
case 2: if ($items[$item_type][1]) { $step_label = __('Step #2'); break; } case 3: if ($items[$item_type][1]) { $step_label = __('Step #3'); } else { $step_label = __('Step #2'); } break; } echo dcPage::breadcrumb(array(html::escapeHTML($core->blog->name) => '', $page_title => $p_url, __('Add item') => '', $step_label => ''), array('hl_pos' => -2)) . dcPage::notices(); } else { echo dcPage::breadcrumb(array(html::escapeHTML($core->blog->name) => '', $page_title => '')) . dcPage::notices(); } if ($step) { // Formulaire d'ajout d'un item switch ($step) { case 1: // Selection du type d'item echo '<form id="additem" action="' . $p_url . '&add=2" method="post">'; echo '<fieldset><legend>' . __('Select type') . '</legend>'; echo '<p class="field"><label for="item_type" class="classic">' . __('Type of item menu:') . '</label>' . form::combo('item_type', $items_combo, '') . '</p>'; echo '<p>' . $core->formNonce() . '<input type="submit" name="appendaction" value="' . __('Continue...') . '" />' . '</p>'; echo '</fieldset>'; echo '</form>'; break; case 2: if ($items[$item_type][1]) {
$('.multi-part.active select.navigation option:first').attr('selected',true); }); $("#gp_nav").change(function() { window.location = $("#gp_nav option:selected").val(); }); $("#lp_nav").change(function() { window.location = $("#lp_nav option:selected").val(); }); }); //]]> </script> </head> <body> <?php echo dcPage::breadcrumb(array(__('System') => '', html::escapeHTML($core->auth->userID()) => '', __('user:preferences') => '')) . dcPage::notices(); ?> <div id="local" class="multi-part" title="<?php echo __('User preferences'); ?> "> <h3 class="out-of-screen-if-js"><?php echo __('User preferences'); ?> </h3> <?php $table_header = '<div class="table-outer"><table class="prefs" id="%s"><caption class="as_h3">%s</caption>' . '<thead>' . '<tr>' . "\n" . ' <th class="nowrap">' . __('Setting ID') . '</th>' . "\n" . ' <th>' . __('Value') . '</th>' . "\n" . ' <th>' . __('Type') . '</th>' . "\n" . ' <th class="maximalx">' . __('Description') . '</th>' . "\n" . '</tr>' . "\n" . '</thead>' . "\n" . '<tbody>'; $table_footer = '</tbody></table></div>'; $prefs = array();
echo dcPage::jsLoad('js/jquery/jquery-ui.custom.js') . dcPage::jsLoad('js/jquery/jquery.ui.touch-punch.js') . dcPage::jsLoad(dcPage::getPF('antispam/antispam.js')); } echo dcPage::cssLoad(dcPage::getPF('antispam/style.css')); ?> </head> <body> <?php if ($filter_gui !== false) { echo dcPage::breadcrumb(array(__('Plugins') => '', $page_name => $p_url, sprintf(__('%s filter configuration'), $filter->name) => '')) . dcPage::notices(); echo '<p><a href="' . $p_url . '" class="back">' . __('Back to filters list') . '</a></p>'; echo $filter_gui; if ($filter->help) { dcPage::helpBlock($filter->help); } } else { echo dcPage::breadcrumb(array(__('Plugins') => '', $page_name => '')) . dcPage::notices(); # Information $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">';
public function gui($url) { $blog =& $this->core->blog; $blog->settings->addNamespace('akismet'); $ak_key = $blog->settings->akismet->ak_key; $ak_verified = null; if (isset($_POST['ak_key'])) { try { $ak_key = $_POST['ak_key']; $blog->settings->akismet->put('ak_key', $ak_key, 'string'); dcPage::addSuccessNotice(__('Filter configuration have been successfully saved.')); http::redirect($url); } catch (Exception $e) { $this->core->error->add($e->getMessage()); } } if ($blog->settings->akismet->ak_key) { try { $ak = new akismet($blog->url, $blog->settings->akismet->ak_key); $ak_verified = $ak->verify(); } catch (Exception $e) { $this->core->error->add($e->getMessage()); } } $res = dcPage::notices(); $res .= '<form action="' . html::escapeURL($url) . '" method="post" class="fieldset">' . '<p><label for="ak_key" class="classic">' . __('Akismet API key:') . '</label> ' . form::field('ak_key', 12, 128, $ak_key); if ($ak_verified !== null) { if ($ak_verified) { $res .= ' <img src="images/check-on.png" alt="" /> ' . __('API key verified'); } else { $res .= ' <img src="images/check-off.png" alt="" /> ' . __('API key not verified'); } } $res .= '</p>'; $res .= '<p><a href="http://akismet.com/">' . __('Get your own API key') . '</a></p>' . '<p><input type="submit" value="' . __('Save') . '" />' . $this->core->formNonce() . '</p>' . '</form>'; return $res; }
} /* DISPLAY Main page -------------------------------------------------------- */ $starting_scripts = '<script type="text/javascript">' . "\n" . "//<![CDATA[" . "\n" . dcPage::jsVar('dotclear.msg.confirm_delete_media', __('Are you sure to delete this media?')) . "\n" . "//]]>" . "</script>" . dcPage::jsLoad('js/_media_item.js'); if ($popup && !empty($plugin_id)) { $starting_scripts .= $core->callBehavior('adminPopupMedia', $plugin_id); } $temp_params = $media_page_url_params; $temp_params['d'] = '%s'; $bc_template = $core->adminurl->get('admin.media', $temp_params, '&', true); $temp_params['d'] = ''; $home_url = $core->adminurl->get('admin.media', $temp_params); call_user_func($open_f, __('Media manager'), $starting_scripts . dcPage::jsDatePicker() . ($popup ? dcPage::jsPageTabs($tab) : ''), dcPage::breadcrumb(array(html::escapeHTML($core->blog->name) => '', __('Media manager') => $home_url, $core->media->breadCrumb($bc_template) . '<span class="page-title">' . $file->basename . '</span>' => ''), array('home_link' => !$popup, 'hl' => false))); 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)
echo dcPage::jsConfirmClose('links-form', 'add-link-form', 'add-category-form'); ?> <?php $core->auth->user_prefs->addWorkspace('accessibility'); if (!$core->auth->user_prefs->accessibility->nodragdrop) { echo dcPage::jsLoad('js/jquery/jquery-ui.custom.js') . dcPage::jsLoad('js/jquery/jquery.ui.touch-punch.js') . dcPage::jsLoad(dcPage::getPF('blogroll/blogroll.js')); } ?> <?php echo dcPage::jsPageTabs($default_tab); ?> </head> <body> <?php echo dcPage::breadcrumb(array(html::escapeHTML($core->blog->name) => '', __('Blogroll') => '')) . dcPage::notices(); ?> <div class="multi-part" id="main-list" title="<?php echo __('Blogroll'); ?> "> <?php if (!$rs->isEmpty()) { ?> <form action="<?php echo $core->adminurl->get('admin.plugin'); ?> " method="post" id="links-form">
public function gui($url) { $core =& $this->core; # Create list if (!empty($_POST['createlist'])) { try { $this->defaultWordsList(); dcPage::addSuccessNotice(__('Words have been successfully added.')); http::redirect($url); } catch (Exception $e) { $core->error->add($e->getMessage()); } } # Adding a word if (!empty($_POST['swa'])) { $globalsw = !empty($_POST['globalsw']) && $core->auth->isSuperAdmin(); try { $this->addRule($_POST['swa'], $globalsw); dcPage::addSuccessNotice(__('Word has been successfully added.')); http::redirect($url); } catch (Exception $e) { $core->error->add($e->getMessage()); } } # Removing spamwords if (!empty($_POST['swd']) && is_array($_POST['swd'])) { try { $this->removeRule($_POST['swd']); dcPage::addSuccessNotice(__('Words have been successfully removed.')); http::redirect($url); } catch (Exception $e) { $core->error->add($e->getMessage()); } } /* DISPLAY ---------------------------------------------- */ $res = dcPage::notices(); $res .= '<form action="' . html::escapeURL($url) . '" method="post" class="fieldset">' . '<p><label class="classic" for="swa">' . __('Add a word ') . '</label> ' . form::field('swa', 20, 128); if ($core->auth->isSuperAdmin()) { $res .= '<label class="classic" for="globalsw">' . form::checkbox('globalsw', 1) . __('Global word (used for all blogs)') . '</label> '; } $res .= $core->formNonce() . '</p>' . '<p><input type="submit" value="' . __('Add') . '"/></p>' . '</form>'; $rs = $this->getRules(); if ($rs->isEmpty()) { $res .= '<p><strong>' . __('No word in list.') . '</strong></p>'; } else { $res .= '<form action="' . html::escapeURL($url) . '" method="post" class="fieldset">' . '<h3>' . __('List of bad words') . '</h3>' . '<div class="antispam">'; $res_global = ''; $res_local = ''; while ($rs->fetch()) { $disabled_word = false; $p_style = ''; if (!$rs->blog_id) { $disabled_word = !$core->auth->isSuperAdmin(); $p_style .= ' global'; } $item = '<p class="' . $p_style . '"><label class="classic" for="word-' . $rs->rule_id . '">' . form::checkbox(array('swd[]', 'word-' . $rs->rule_id), $rs->rule_id, false, '', '', $disabled_word) . ' ' . html::escapeHTML($rs->rule_content) . '</label></p>'; if ($rs->blog_id) { // local list if ($res_local == '') { $res_local = '<h4>' . __('Local words (used only for this blog)') . '</h4>'; } $res_local .= $item; } else { // global list if ($res_global == '') { $res_global = '<h4>' . __('Global words (used for all blogs)') . '</h4>'; } $res_global .= $item; } } $res .= '<div class="local">' . $res_local . '</div>'; $res .= '<div class="global">' . $res_global . '</div>'; $res .= '</div>' . '<p>' . form::hidden(array('spamwords'), 1) . $core->formNonce() . '<input class="submit delete" type="submit" value="' . __('Delete selected words') . '"/></p>' . '</form>'; } if ($core->auth->isSuperAdmin()) { $res .= '<form action="' . html::escapeURL($url) . '" method="post">' . '<p><input type="submit" value="' . __('Create default wordlist') . '" />' . form::hidden(array('spamwords'), 1) . form::hidden(array('createlist'), 1) . $core->formNonce() . '</p>' . '</form>'; } return $res; }
$("#gs_submit").hide(); $("#ls_submit").hide(); $("#gs_nav").change(function() { window.location = $("#gs_nav option:selected").val(); }) $("#ls_nav").change(function() { window.location = $("#ls_nav option:selected").val(); }) }); //]]> </script> </head> <body> <?php echo dcPage::breadcrumb(array(__('System') => '', html::escapeHTML($core->blog->name) => '', __('about:config') => '')) . dcPage::notices(); ?> <div id="local" class="multi-part" title="<?php echo sprintf(__('Settings for %s'), html::escapeHTML($core->blog->name)); ?> "> <h3 class="out-of-screen-if-js"><?php echo sprintf(__('Settings for %s'), html::escapeHTML($core->blog->name)); ?> </h3> <?php $table_header = '<div class="table-outer"><table class="settings" id="%s"><caption class="as_h3">%s</caption>' . '<thead>' . '<tr>' . "\n" . ' <th class="nowrap">' . __('Setting ID') . '</th>' . "\n" . ' <th>' . __('Value') . '</th>' . "\n" . ' <th>' . __('Type') . '</th>' . "\n" . ' <th class="maximalx">' . __('Description') . '</th>' . "\n" . '</tr>' . "\n" . '</thead>' . "\n" . '<tbody>'; $table_footer = '</tbody></table></div>'; $settings = array();
'; $(function() { $('#tag_delete').submit(function() { return window.confirm(dotclear.msg.confirm_tag_delete); }); }); //]]> </script> <?php echo dcPage::jsConfirmClose('tag_rename'); ?> </head> <body> <?php echo dcPage::breadcrumb(array(html::escapeHTML($core->blog->name) => '', __('Tags') => $p_url . '&m=tags', __('Tag') . ' “' . html::escapeHTML($tag) . '”' => '')) . dcPage::notices(); ?> <?php echo '<p><a class="back" href="' . $p_url . '&m=tags">' . __('Back to tags list') . '</a></p>'; if (!$core->error->flag()) { if (!$posts->isEmpty()) { echo '<div class="tag-actions vertical-separator">' . '<h3>' . html::escapeHTML($tag) . '</h3>' . '<form action="' . $this_url . '" method="post" id="tag_rename">' . '<p><label for="new_tag_id" class="classic">' . __('Rename') . '</label> ' . form::field('new_tag_id', 20, 255, html::escapeHTML($tag)) . '<input type="submit" value="' . __('OK') . '" />' . $core->formNonce() . '</p></form>'; # Remove tag if (!$posts->isEmpty() && $core->auth->check('contentadmin', $core->blog->id)) { echo '<form id="tag_delete" action="' . $this_url . '" method="post">' . '<p><input type="submit" class="delete" name="delete" value="' . __('Delete this tag') . '" />' . $core->formNonce() . '</p></form>'; } echo '</div>'; } # Show posts echo '<h4 class="vertical-separator pretty-title">' . sprintf(__('List of entries with the tag “%s”'), html::escapeHTML($tag)) . '</h4>';