Пример #1
0
 /**
  * 
  * @param type $value
  * @return type
  */
 public function validate_thumb_column($value)
 {
     $prop = B5F_MTT_Utils::validate_css_number($value['proportion']);
     if (!$prop) {
         $value['proportion'] = '';
     } else {
         $value['proportion'] = $prop;
     }
     // cleaned value
     $width = B5F_MTT_Utils::validate_css_px_percent($value['width']);
     if (!$width) {
         $value['width'] = '';
     } else {
         $value['width'] = $width;
     }
     // cleaned value
     return $value;
 }
Пример #2
0
/**
 * POST LISTING options
 *
 * @package    ManyTipsTogether
 * @subpackage B5F_MTT_Admin
 */
$options_panel->OpenTab('post_listing');
$options_panel->Title(__('Post, Page and Custom Post Types listing', 'mtt'));
/*******************************************************************************
 * GENERAL
 ******************************************************************************/
$options_panel->addCheckbox('postpageslist_persistent_list_view', array('name' => __('Posts: persistent Post listing view', 'mtt'), 'desc' => sprintf(__('If you change the viewing mode (list or excerpt view), it doesn\'t stick. Follow this %s. Tip via: %s.%s', 'mtt'), B5F_MTT_Utils::make_tip_credit('track ticket', 'http://core.trac.wordpress.org/ticket/20335'), B5F_MTT_Utils::make_tip_credit('WordPress Answers', 'http://wordpress.stackexchange.com/q/34956/12615'), "<div class='img-help'><img src='{$plugin_url}images/postlisting-persistent.jpg' /></div>"), 'std' => false));
$options_panel->addCheckbox('postpageslist_enable_category_count', array('name' => __('Posts: enable Category count', 'mtt'), 'desc' => sprintf(__('Inspired by: %s.%s', 'mtt'), B5F_MTT_Utils::make_tip_credit('Stack Overflow', 'http://stackoverflow.com/a/15845723/1287812'), "<div class='img-help'><img src='{$plugin_url}images/postlisting-category-count.jpg' /></div>"), 'std' => false));
$options_panel->addCheckbox('postpageslist_template_filter_enable', array('name' => __('Pages: enable filtering by Template', 'mtt'), 'desc' => sprintf(__('Tip via: %s.%s', 'mtt'), B5F_MTT_Utils::make_tip_credit('WordPress Answers', 'http://wordpress.stackexchange.com/a/12492/12615'), "<div class='img-help'><img src='{$plugin_url}images/postlisting-page-template.jpg' /></div>"), 'std' => false));
$options_panel->addCheckbox('postpageslist_duplicate_del_revisions', array('name' => __('All types: enable Duplicate Post and Delete Revisions', 'mtt'), 'desc' => sprintf(__('Based on: %s.%s', 'mtt'), B5F_MTT_Utils::make_tip_credit('GD Press Tools', 'http://wordpress.org/extend/plugins/gd-press-tools/'), "<div class='img-help'><img src='{$plugin_url}images/postlisting-duplicate-revision.jpg' /></div>"), 'std' => false));
$options_panel->addCheckbox('postpageslist_move_views_row', array('name' => __('Re-position the row action (see description)', 'mtt'), 'desc' => "<div class='img-help'><img src='{$plugin_url}images/postlisting-reposition-action.jpg' /></div>", 'std' => false));
/*******************************************************************************
 * CUSTOM COLUMNS
 ******************************************************************************/
$options_panel->addParagraph(sprintf('<hr /><h4>%s</h4>', __('CUSTOM COLUMNS', 'mtt')));
$options_panel->addCheckbox('postpageslist_enable_id_column', array('name' => __('All types: add ID column', 'mtt'), 'desc' => '', 'std' => false));
$options_panel->addText('postpageslist_title_column_width', array('name' => __('All types: width of the Title column', 'mtt'), 'desc' => __('Sometimes the Title column gets shrinked by other columns, you may change this here. Use px, em or %, i.e. 200px, 50%', 'mtt'), 'std' => '', 'validate_func' => 'validate_css_num_value'));
$Thumbnail_column_fields[] = $options_panel->addText('proportion', array('name' => __('Proportion of the thumbnails', 'mtt'), 'desc' => __('Used for width and height. The scale is proportional, this value is used for the bigger side.', 'mtt'), 'std' => ''), true);
$Thumbnail_column_fields[] = $options_panel->addText('width', array('name' => __('Width of the column', 'mtt'), 'desc' => __('Depending on the proportion you may need this. Use px, em or %, i.e. 200px, 50%', 'mtt'), 'std' => ''), true);
$Thumbnail_column_fields[] = $options_panel->addCheckbox('count', array('name' => __('Show total number of attachments', 'mtt'), 'desc' => sprintf(__('If greater than 1.%s', 'mtt'), "<div class='img-help'><img src='{$plugin_url}images/postlisting-attach-column.jpg' /></div>"), 'std' => false), true);
$options_panel->addCondition('postpageslist_enable_thumb_column', array('name' => __('All types: add Thumbnail column', 'mtt'), 'desc' => __('Shows the featured image or, if not set, the first attached.', 'mtt'), 'fields' => $Thumbnail_column_fields, 'std' => false, 'validate_func' => 'validate_postlisting'));
/*******************************************************************************
 * CONTENT COLORS
 ******************************************************************************/
$options_panel->addParagraph(sprintf('<hr /><h4>%s</h4>', __('CUSTOM COLORS FOR DIFFENT TYPES OF CONTENT', 'mtt')));
Пример #3
0
 /**
  * Register custom ID column
  * @param type $columns
  * @return type
  * 
  * @author toscho
  */
 public function t5_add_col($columns)
 {
     $in = array("tax_id" => "ID");
     $columns = B5F_MTT_Utils::array_push_after($columns, $in, 0);
     return $columns;
 }
Пример #4
0
    /**
     * Build Html and die() with response 503
     * 
     */
    public function do_maintenance()
    {
        $level = empty($this->params['maintenance_mode_enable']['level']) ? null : $this->params['maintenance_mode_enable']['level'];
        $ucan = B5F_MTT_Utils::maintenance_user_level($level);
        if (!current_user_can($ucan)) {
            // BROWSER TITLE
            $title = !empty($this->params['maintenance_mode_enable']['title']) ? $this->params['maintenance_mode_enable']['title'] : get_bloginfo('name') . __(' | Maintenance Mode', 'mtt');
            // IMAGES
            $theUrl = B5F_MTT_Init::get_instance()->plugin_url;
            $custom_stripes = $theUrl . 'images/pattern.png';
            $custom_bg = $theUrl . 'images/kub-locked.png';
            // LINE 0
            $siteName = !empty($this->params['maintenance_mode_enable']['line0']) ? $this->params['maintenance_mode_enable']['line0'] : __('Site in maintenance', 'mtt');
            // LINE 1
            $line1Text = !empty($this->params['maintenance_mode_enable']['line1']) ? $this->params['maintenance_mode_enable']['line1'] : '<b>' . get_bloginfo('name') . '</b><br> ' . get_bloginfo('description');
            // LINE 2
            $line2Text = !empty($this->params['maintenance_mode_enable']['line2']) ? $this->params['maintenance_mode_enable']['line2'] : str_replace('http://', '', get_bloginfo('url'));
            // HTML BACKGROUND
            $stripes = !empty($this->params['maintenance_mode_enable']['html_img']['src']) ? $this->params['maintenance_mode_enable']['html_img']['src'] : '';
            if ($stripes != '') {
                $stripes = 'html{background:url(' . $stripes . ') repeat}';
            } else {
                $stripes = 'html{background:url(' . $custom_stripes . ') repeat}';
            }
            // BOX ("body") BACKGROUND
            $box_bg = !empty($this->params['maintenance_mode_enable']['body_img']['src']) ? $this->params['maintenance_mode_enable']['body_img']['src'] : '';
            $box_shadow = '-webkit-border-radius: 23px; border-radius: 23px; -moz-box-shadow: 5px 5px 8px #DCDCDC; -webkit-box-shadow: 5px 5px 8px #DCDCDC; box-shadow: 5px 5px 8px #DCDCDC;';
            if ('' != $box_bg) {
                $box_bg = 'background:url(' . $box_bg . ') no-repeat;';
            } else {
                $box_bg = 'background: rgba(51, 102, 153, 0.75) url(' . $custom_bg . ') no-repeat 30px 30px;';
            }
            // CUSTOM CSS
            if (!empty($this->params['maintenance_mode_enable']['extra_css'])) {
                $extraCss = '.class-name {}' != $this->params['maintenance_mode_enable']['extra_css'] ? $this->params['maintenance_mode_enable']['extra_css'] : '';
            } else {
                $extraCss = '';
            }
            // CSS of this file
            $msg = <<<CSS
<style type="text/css">
\t*{padding:0;margin:0}
\t{$stripes}
\tbody{
\t\tborder:0;
\t\twidth:900px;
\t\tmax-width:900px;
\t\theight:560px;
\t\t{$box_bg} ;
\t\tfont-family:'Myriad Pro',Arial,Helvetica,sans-serif;
\t\tmargin: 0 auto;
\t\t{$box_shadow};
\t}
\t#header{height:397px;margin-bottom:-200px}
\t#wrapper{width:467px;margin:80px auto}
\th1{padding-top:180px;color:#fff;font-size:2em;font-weight:bold;text-align:center;white-space:nowrap;text-shadow: 0.1em 0.1em 0.2em black;border-bottom:0px}
\th2{color:#fff;font-size:12px;letter-spacing: 0.1em;font-weight:bold;text-align:center;text-shadow: 0.1em 0.1em 1.2em black;margin-top:.5em}
\t#when,.textwidget{color:#000; font-size:1.2em;text-align:center;margin-top:1.5em;}
        a { color: #fff; }
        a:hover { color: #000; }
\t{$extraCss}
</style>
CSS;
            // html of this file
            $msg .= <<<HTML
<div id="wrapper">
<div id="header" class="blank">
<h1>{$siteName}</h1>
</div>
<div id="when">
{$line1Text}
<h2><a href="http://{$line2Text}">{$line2Text}</a></h2> 
</div>

</div>
HTML;
            wp_die($msg, $title, array('response' => 503));
        }
    }
 /**
  * Add blogname column header
  * 
  * @param type $columns
  * @return type
  */
 public function add_blogname_column($columns)
 {
     $in = array("blog_name" => "Name");
     $columns = B5F_MTT_Utils::array_push_after($columns, $in, 2);
     return $columns;
 }
Пример #6
0
<?php

/**
 * MEDIA options
 *
 * @package    ManyTipsTogether
 * @subpackage B5F_MTT_Admin
 */
$options_panel->OpenTab('media');
$options_panel->Title(__('Media', 'mtt'));
$options_panel->addParagraph(sprintf('<hr /><h4>%s</h4>%s', __('MEDIA LIBRARY', 'mtt'), "<div class='img-help desc-field'><a href='{$plugin_url}images/media-all.jpg' target='_blank'><img src='{$plugin_url}images/media-all.jpg' style='max-width:100%' /></a></div>"));
$options_panel->addCheckbox('media_image_bigger_thumbs', array('name' => __('Bigger thumbnails in the default column', 'mtt'), 'desc' => '', 'std' => false));
$options_panel->addCheckbox('media_image_id_column_enable', array('name' => __('Add ID column', 'mtt'), 'desc' => '', 'std' => false));
$options_panel->addCheckbox('media_image_size_column_enable', array('name' => __('Add image size column', 'mtt'), 'desc' => sprintf(__('Tip via: %s', 'mtt'), B5F_MTT_Utils::make_tip_credit('WordPress Answers', 'http://wordpress.stackexchange.com/q/30894/12615')), 'std' => false));
$options_panel->addCheckbox('media_image_thubms_list_column_enable', array('name' => __('Add a column that lists all thumbnails of the image, with direct link to it.', 'mtt'), 'desc' => sprintf(__('Tip via: %s', 'mtt'), B5F_MTT_Utils::make_tip_credit('WordPress Answers', 'http://wordpress.stackexchange.com/q/7757/12615')), 'std' => false));
$options_panel->addCheckbox('media_download_link', array('name' => __('Download link in row actions', 'mtt'), 'desc' => sprintf(__('Adds a download link to all items (Edit|Delete|View|Download). Tip via: %s. The difference here is that there is no external script for downloading, it has to be done with a mouse right click and selecting "Save as".', 'mtt'), B5F_MTT_Utils::make_tip_credit('WordPress Answers', 'http://wordpress.stackexchange.com/q/30159/12615')), 'std' => false));
$options_panel->addCheckbox('media_better_attachment', array('name' => __('Enables the re-attachment', 'mtt'), 'desc' => sprintf(__('Change the parent of the media file to another post/page<br />Unfortunately, this disables the capability to sort the column... Tip via: %s', 'mtt'), B5F_MTT_Utils::make_tip_credit('WPEngineer', 'http://wpengineer.com/2165/small-extension-for-the-media-library/')), 'std' => false));
$options_panel->addCheckbox('media_camera_exif', array('name' => __('Add Camera Exif info as meta data', 'mtt'), 'desc' => sprintf(__('The camera info will be stored as Custom Fields for image attachments. This will also enable Custom Fields when editing the attachemnt and a column with the information in the Media Library. Tip via: %s.', 'mtt'), B5F_MTT_Utils::make_tip_credit('WordPress Answers', 'http://wordpress.stackexchange.com/q/91177/12615')), 'std' => false));
$options_panel->addCheckboxList('media_remove_metaboxes', array('discussion' => __('Discussion', 'mtt'), 'comments' => __('Comments', 'mtt'), 'slug' => __('Slug', 'mtt'), 'author' => __('Author', 'mtt')), array('name' => __('Remove Meta Boxes', 'mtt'), 'desc' => '', 'class' => 'no-toggle', 'std' => false));
$options_panel->addParagraph(sprintf('<hr /><h4>%s</h4>', __('IMAGES UPLOAD', 'mtt')));
// MEDIA LIBRARY 3.5
global $wp_version;
if (version_compare($wp_version, '3.5', '>=')) {
    $options_panel->addCheckbox('media_uploaded_to_this_post', array('name' => __('Make "Uploaded to this post" the default view', 'mtt'), 'desc' => sprintf(__('Tip via: %s', 'mtt'), B5F_MTT_Utils::make_tip_credit('WordPress Answers', 'http://wordpress.stackexchange.com/a/76213/12615')), 'std' => false));
}
$options_panel->addCheckbox('media_include_extras_sizes', array('name' => __('Include all custom sizes', 'mtt'), 'desc' => sprintf(__('Lists all custom sizes in the Insert Media selector.<br />By default, it only displays <code>Thumbnail | Medium | Large | Full Size</code>. Tip via: %s', 'mtt'), B5F_MTT_Utils::make_tip_credit('kucrut.org', 'http://kucrut.org/insert-image-with-custom-size-into-post/')), 'std' => false));
$options_panel->addCheckbox('media_sanitize_filename', array('name' => __('Sanitize filename', 'mtt'), 'desc' => sprintf(__('Removes symbols, spaces, latin and other languages characters from uploaded files and gives them "permalink" structure (clean characters, only lowercase and dahes)<br />Code by: %s', 'mtt'), B5F_MTT_Utils::make_tip_credit('toscho', 'https://github.com/toscho/Germanix-WordPress-Plugin')), 'std' => false));
$options_panel->addCheckbox('media_jpg_sharpen', array('name' => __('Sharpen resized images (only jpg)', 'mtt'), 'desc' => sprintf(__('Check an <a href="http://i.stack.imgur.com/hkLaX.png" target="_blank">example</a>. . . Tip via: %s', 'mtt'), B5F_MTT_Utils::make_tip_credit('WordPress Answers', 'http://wordpress.stackexchange.com/q/1567/12615')), 'std' => false));
$options_panel->addText('media_jpg_quality', array('name' => __('Quality of resized Jpegs', 'mtt'), 'desc' => __('From 1 to 100. WordPress default is 90.'), 'std' => '', 'validate_func' => 'validate_jpg_quality'));
$options_panel->CloseTab();
Пример #7
0
<?php

/**
 * WIDGETS options
 *
 * @package    ManyTipsTogether
 * @subpackage B5F_MTT_Admin
 */
$options_panel->OpenTab('widgets');
$options_panel->Title(__('Widgets', 'mtt'));
$options_panel->addText('widget_rss_update_timer', array('name' => __('RSS Widget: update timer (in minutes)', 'mtt'), 'desc' => sprintf(__('Default is 12 hours, leave blank for not activating<br />Tip via: %s', 'mtt'), B5F_MTT_Utils::make_tip_credit('WordPress Answers', 'http://wordpress.stackexchange.com/q/1567/12615')), 'std' => '', 'validate_func' => 'validate_rss_time'));
$options_panel->addCheckbox('widget_meta_slim', array('name' => __('New Meta widget', 'mtt'), 'desc' => __('Based on the original, removes WordPress links and adds a custom link'), 'std' => false));
$options_panel->addCheckbox('widget_hide_description', array('name' => __('Hide widgets descriptions', 'mtt'), 'desc' => '', 'std' => false));
$options_panel->addCheckbox('widget_close_first_sidebar', array('name' => __('Make first sidebar closed as default', 'mtt'), 'desc' => '', 'std' => false));
$options_panel->addCheckbox('widget_break_title_long_lines', array('name' => __('Force new lines in widgets titles.', 'mtt'), 'desc' => sprintf(__('Tip via: %s', 'mtt'), B5F_MTT_Utils::make_tip_credit('WordPress Answers', 'http://wordpress.stackexchange.com/a/98598/12615')), 'std' => false));
$options_panel->addParagraph(sprintf('<hr /><h4>%s</h4>', __('REMOVE WIDGETS', 'mtt')));
$widgets_defaults = array('pages' => __('Pages', 'mtt'), 'calendar' => __('Calendar', 'mtt'), 'archives' => __('Archives', 'mtt'), 'links' => __('Links', 'mtt'), 'meta' => __('Meta', 'mtt'), 'search' => __('Search', 'mtt'), 'text' => __('Text', 'mtt'), 'categories' => __('Categories', 'mtt'), 'recent_posts' => __('Recent Posts', 'mtt'), 'recent_comments' => __('Recent Comments', 'mtt'), 'rss' => __('RSS', 'mtt'), 'tag_cloud' => __('Tag Cloud', 'mtt'), 'nav_menu' => __('Custom Menu', 'mtt'));
$non_defaults = isset($this->params['widgets_non_default']) ? $this->params['widgets_non_default'] : array();
$widgets_array = array_merge($widgets_defaults, $non_defaults);
$options_panel->addCheckboxList('widget_remove', $widgets_array, array('name' => '', 'desc' => '', 'class' => 'no-toggle', 'std' => false));
$options_panel->addCheckbox('widget_remove_role', array('name' => __('Remove widgets only for non-administrators', 'mtt'), 'desc' => __('You have to grant edit_theme_options capabilities to your editors for this to work.', 'mtt'), 'std' => false));
$options_panel->CloseTab();
Пример #8
0
<?php

/**
 * MULTISITE options
 *
 * @package    ManyTipsTogether
 * @subpackage B5F_MTT_Admin
 */
$options_panel->OpenTab('multisite');
$options_panel->Title(__('Multisite', 'mtt'));
$options_panel->addParagraph(sprintf('%s<br /><strong>%s</strong>', __('This section only appears in the main site and for super-admins.', 'mtt'), __('All settings applied in the Plugins section are also applied in the network screen.', 'mtt')));
$options_panel->addParagraph(sprintf('<hr /><h4>%s</h4>', __('SITE COLUMNS', 'mtt')));
$options_panel->addCheckbox('multisite_site_id_column', array('name' => __('Site ID', 'mtt'), 'desc' => '', 'std' => false));
$options_panel->addCheckbox('multisite_blogname_column', array('name' => __('Site Name', 'mtt'), 'desc' => '', 'std' => false));
$options_panel->addCheckbox('multisite_themes_column', array('name' => __('Show theme used by site.', 'mtt'), 'desc' => __('Also shows parent/child.', 'mtt'), 'std' => false));
$options_panel->addCheckbox('multisite_blog_size_column', array('name' => __('Show the space used by each site.', 'mtt'), 'desc' => '', 'std' => false));
$options_panel->addParagraph(sprintf('<hr /><h4>%s</h4>', __('UTILS', 'mtt')));
$quick_edit[] = $options_panel->addCheckboxList('remove', array('backend' => __('Dashboard', 'mtt'), 'visit' => __('Visit', 'mtt'), 'edit' => __('Edit', 'mtt'), 'spam' => __('Spam', 'mtt'), 'delete' => __('Delete', 'mtt'), 'activate' => __('Activate', 'mtt'), 'deactivate' => __('Deactivate', 'mtt'), 'archive' => __('Archive', 'mtt'), 'unarchive' => __('Unarchive', 'mtt')), array('name' => __('Also remove these actions:', 'mtt'), 'desc' => __('This feature also blocks attempts to access the URL directly', 'mtt'), 'class' => 'no-toggle', 'std' => false), true);
$options_panel->addCondition('multisite_extra_quick_edit', array('name' => __('Add Users/Themes/Settings to each site quick links', 'mtt'), 'desc' => __('Fast access to the site details edit tabs.', 'mtt'), 'fields' => $quick_edit, 'std' => false));
$options_panel->addCheckbox('multisite_user_role_column', array('name' => __('Modify Users column to display the role of each user in each site.', 'mtt'), 'desc' => '', 'std' => false));
$options_panel->addCheckbox('multisite_redirect_new_site', array('name' => __('Redirect to site details after new site creation.', 'mtt'), 'desc' => __('The default behavior is to stay in the same screen', 'mtt'), 'std' => false));
$options_panel->addCheckbox('multisite_sort_sites_names', array('name' => __('Sort sites by name and domain.', 'mtt'), 'desc' => sprintf(__('Sorted by name in the Admin Bar, and by domain in Sites of User. This is a hook into get_blogs_of_user, and I\'m not sure if it has adverse effects elsewhere. Feedback is welcome, use the WPSE post. Tip via: %s', 'mtt'), B5F_MTT_Utils::make_tip_credit('WordPress Answers', 'http://wordpress.stackexchange.com/a/77812/12615')), 'std' => false));
$options_panel->addParagraph(sprintf('<hr /><h4>%s</h4>', __('DASHBOARD WIDGETS', 'mtt')));
$options_panel->addCheckbox('multisite_active_plugins_widget', array('name' => __('Enable Active Plugins widget', 'mtt'), 'desc' => __('Lists all network activated plugins, and all sites with their plugins.', 'mtt'), 'std' => false));
$options_panel->addCheckboxList('multisite_dashboard_remove', array('right_now' => __('Right now', 'mtt'), 'plugins' => __('Plugins', 'mtt'), 'primary' => __('WordPress Blog', 'mtt'), 'secondary' => __('Other WordPress News', 'mtt')), array('name' => __('Remove dashboard widgets', 'mtt'), 'desc' => sprintf(__('WordPress Blog and Other WP News titles and feed addresses can be configured. Tip via: %s', 'mtt'), B5F_MTT_Utils::make_tip_credit('Helen on WordPress', 'http://helen.wordpress.com/2011/08/01/customizing-the-special-multisite-dashboards/')), 'class' => 'no-toggle', 'std' => false));
$options_panel->CloseTab();
Пример #9
0
 /**
  * First Run <-> Updating Plugin <-> Regular Use 
  * 
  * @see plugin_setup()
  */
 public function setup_options()
 {
     $mtt = get_option(self::$opt_name);
     # FIRST INSTALL
     if (!$mtt) {
         $this->options = array_merge(B5F_MTT_Utils::$default_options, array('mtt_version' => B5F_MTT_Init::$version));
         update_option(self::$opt_name, $this->options);
     } elseif (version_compare($mtt['mtt_version'], '2.0', '<')) {
         $this->options = array_merge(B5F_MTT_Utils::update_plugin_options($mtt), array('mtt_version' => B5F_MTT_Init::$version));
         update_option(self::$opt_name, $this->options);
     } elseif (version_compare($mtt['mtt_version'], '2.3', '<')) {
         $this->options = array_merge(B5F_MTT_Utils::update_plugin_2_3($mtt), array('mtt_version' => B5F_MTT_Init::$version));
         update_option(self::$opt_name, $this->options);
     } else {
         $this->options['mtt_version'] = B5F_MTT_Init::$version;
         $this->options = $mtt;
     }
 }
Пример #10
0
<?php

/**
 * DASHBOARD options
 *
 * @package    ManyTipsTogether
 * @subpackage B5F_MTT_Admin
 */
$options_panel->OpenTab('dashboard');
$options_panel->Title(__('Dashboard', 'mtt'));
$options_panel->addParagraph(sprintf('<hr /><h4>%s</h4>', __('REMOVE DASHBOARD WIDGETS', 'mtt')));
$options_panel->addCheckboxList('dashboard_remove', array('quick_press' => __('QuickPress', 'mtt'), 'incoming_links' => __('Incoming Links', 'mtt'), 'right_now' => __('Right now', 'mtt'), 'plugins' => __('Plugins', 'mtt'), 'recent_drafts' => __('Recent Drafts', 'mtt'), 'recent_comments' => __('Recent Comments', 'mtt'), 'primary' => __('WordPress Blog', 'mtt'), 'secondary' => __('Other WordPress News', 'mtt'), 'welcome' => __('Welcome Panel', 'mtt')), array('name' => __('Remove default items', 'mtt'), 'desc' => __('<code>WordPress Blog</code> and <code>Other WP News</code> titles and feed addresses can be configured in the widget itself.', 'mtt'), 'class' => 'no-toggle', 'std' => false));
$options_panel->addParagraph(sprintf('<hr /><h4>%s</h4>', __('CUSTOMIZE RIGHT NOW WIDGET', 'mtt')));
$options_panel->addCheckbox('dashboard_add_cpt_enable', array('name' => __('Add Custom Post Types to Right Now Widget', 'mtt'), 'desc' => sprintf(__('Tip via: %s', 'mtt'), B5F_MTT_Utils::make_tip_credit('WordPress Answers', 'http://wordpress.stackexchange.com/q/1567/12615')), 'std' => false));
$options_panel->addCheckbox('dashboard_remove_footer_rightnow', array('name' => __('Hide the footer of Right Now widget', 'mtt'), 'desc' => '', 'std' => false));
$options_panel->addParagraph(sprintf('<hr /><h4>%s</h4>', __('ADD CUSTOM WIDGETS', 'mtt')));
$repeater_fields[] = $options_panel->addText('title', array('name' => __('Title', 'mtt')), true);
$repeater_fields[] = $options_panel->addTextarea('content', array('name' => __('Content ', 'mtt')), true);
$repeater_fields[] = $options_panel->addRoles('roles', array('type' => 'checkbox_list'), array('name' => __('Show to roles', 'apc'), 'class' => 'no-fancy', 'desc' => __('Leave empty to show to all.', 'mtt')), true);
$repeater_fields[] = $options_panel->addCheckbox('enabled', array('name' => __('Enable this widget', 'mtt')), true);
$options_panel->addRepeaterBlock('dashboard_add_widgets', array('sortable' => true, 'inline' => false, 'name' => __('Custom widgets', 'mtt'), 'fields' => $repeater_fields, 'desc' => __('Add as many as you want.', 'mtt')));
$options_panel->addParagraph(sprintf('<hr /><h4>%s</h4>', __('EXTRA WIDGETS', 'mtt')));
$options_panel->addCheckboxList('dashboard_folder_size', array('root' => __('Root', 'mtt'), 'wpcontent' => __('WP Content', 'mtt')), array('name' => __('Calculate Folders Size', 'mtt'), 'desc' => __('The root calculation is usefull when WP is installed at the root of the server.', 'mtt'), 'class' => 'no-toggle', 'std' => false));
$options_panel->CloseTab();
Пример #11
0
<?php

/**
 * Admin Bar options
 *
 * @package    ManyTipsTogether
 * @subpackage B5F_MTT_Admin
 */
$options_panel->OpenTab('admin_bar');
$options_panel->Title(__('Admin Bar', 'mtt'));
$options_panel->addParagraph(sprintf('<p class="menu-refresh-notice">%s<br />%s</p>', __("The options to hide/show/modify menu items", 'mtt'), __("need a second refresh of the plugin's page.", 'mtt')));
$options_panel->addCheckbox('adminbar_completely_disable', array('name' => __('Completely remove the Admin Bar', 'mtt'), 'desc' => sprintf(__('Remove from back and front end. Creates a "Visit Site" link in the Dashboard menu item. Tip via: %s', 'mtt'), B5F_MTT_Utils::make_tip_credit('WordPress Answers', 'http://wordpress.stackexchange.com/a/77648/12615')), 'std' => false));
$options_panel->addCheckbox('adminbar_disable', array('name' => __('Disable Admin Bar for all users in Frontend', 'mtt'), 'desc' => '', 'std' => false));
$yoast = array();
if (defined('WPSEO_URL')) {
    $yoast = array('seo_by_yoast' => __('SEO by Yoast', 'mtt'));
}
$adminbar_remove_defaults = array('wp_logo' => __('WP logo', 'mtt'), 'site_name' => __('Site name', 'mtt'), 'updates' => __('Updates', 'mtt'), 'comments' => __('Comments', 'mtt'), 'new_content' => __('New content', 'mtt'), 'theme_options' => __('Theme options', 'mtt'), 'my_account' => __('My account', 'mtt'));
$adminbar_remove_array = array_merge($adminbar_remove_defaults, $yoast);
$options_panel->addCheckboxList('adminbar_remove', $adminbar_remove_array, array('name' => __('Remove default items', 'mtt'), 'desc' => '', 'class' => 'no-toggle', 'std' => false));
$Howdy_change[] = $options_panel->addText('howdy', array('name' => __('Replace with', 'mtt'), 'desc' => __('Leave empty for complete removal', 'mtt'), 'std' => ''), true);
$options_panel->addCondition('adminbar_howdy_enable', array('name' => __('Remove or change "Howdy"', 'mtt'), 'desc' => '', 'fields' => $Howdy_change, 'std' => false, 'validate_func' => 'validate_adminbar'));
$Adminbar_sitename_fields[] = $options_panel->addText('title', array('name' => __('Title', 'mtt'), 'desc' => '', 'std' => ''), true);
$Adminbar_sitename_fields[] = $options_panel->addImage('icon', array('name' => __('Icon (between 16x16 and 22x22 pixels)', 'mtt'), 'std' => '', 'desc' => '', 'preview_height' => 'auto', 'preview_width' => '140px'), true);
$Adminbar_sitename_fields[] = $options_panel->addText('url', array('name' => __('URL', 'mtt'), 'desc' => '', 'std' => ''), true);
$options_panel->addCondition('adminbar_sitename_enable', array('name' => __('Add Site Name with Icon', 'mtt'), 'desc' => __('Add a custom link with title and icon', 'mtt'), 'fields' => $Adminbar_sitename_fields, 'validate_func' => 'validate_adminbar', 'std' => false));
$Adminbar_custom_menu_fields[] = $options_panel->addText('bar_0_title', array('name' => __('Menu name', 'mtt'), 'desc' => __('*Required', 'mtt'), 'std' => ''), true);
$Adminbar_custom_menu_fields[] = $options_panel->addText('bar_0_url', array('name' => __('Menu link', 'mtt'), 'desc' => __('If empty, makes a null link', 'mtt'), 'std' => ''), true);
$options_panel->addCondition('adminbar_custom_enable', array('name' => __('Enable Custom Menu', 'mtt'), 'desc' => '', 'fields' => $Adminbar_custom_menu_fields, 'validate_func' => 'validate_adminbar', 'std' => false));
$repeater_menus[] = $options_panel->addText('title', array('name' => __('Title', 'mtt')), true);
$repeater_menus[] = $options_panel->addText('url', array('name' => __('URL ', 'mtt')), true);
Пример #12
0
    public function mtt_meta_box()
    {
        $logo = B5F_MTT_Init::get_instance()->plugin_url . 'images/mtt-logo.png';
        $mtt_tb_title = B5F_MTT_Init::$version . ' ' . B5F_MTT_Admin::$mtt_tb_title;
        $version = B5F_MTT_Init::$version;
        $multisite = is_multisite() ? is_super_admin() : true;
        ?>

		<script>

		</script>
		<div class="mtt-box">
			<div class="inner">
				<div id="icon-options-mtt" class="icon32">
					<a href="http://www.rodbuaiz.com">
						<img src="<?php 
        echo $logo;
        ?>
" alt="rodbuaiz.com" title="rodbuaiz.com"/>
					</a>
				</div>
				<h2>Admin Tweaks<br/>
					<em style="font-size:.5em;"><?php 
        _e('version', 'mtt');
        ?>
 
						<?php 
        if ($multisite) {
            ?>
							<a id="open-tb" class="thickbox" title="<?php 
            echo "Admin Tweaks " . __('version', 'mtt') . $version;
            ?>
" href="javascript:void(0);">
						<?php 
        }
        ?>
						<?php 
        echo $version;
        ?>
						<?php 
        if ($multisite) {
            ?>
							</a>
						<?php 
        }
        ?>
					</em>

				</h2>
				<div id="mtt-other-info">
				<ul class="left hl" style="margin: -12px 0 6px 0;text-align: right;">
					<li id="bsf-link"><?php 
        _e("by", 'mtt');
        ?>
 brasofilo</li>
				</ul>
				<?php 
        B5F_MTT_Utils::print_repository_info();
        ?>
				<hr style="opacity:.3"/>

				<br style="clear:both"/>
				</div>

				<label for="mtt_verbose_plugin_helper" class="no-class">
					<input name="mtt_verbose_plugin_helper" id="mtt_verbose_plugin_helper" type="checkbox" class="no-toggle"> <?php 
        _e('Hide the plugin help texts', 'mtt');
        ?>
				</label>

				<p class="desc-field">
					<span style="color:#C5C5C5">
						<?php 
        _e('(some settings need a second refresh for being visible)', 'mtt');
        ?>
					</span>
				</p>
				<br style="clear:both"/>

				<div class="submit update-button mtt-update">
					<button class="button-primary" id="mtt-submit" title="<?php 
        _e('Update settings', 'mtt');
        ?>
"/><?php 
        _e('Update settings', 'mtt');
        ?>
</button>
				</div>

				<br style="clear:both"/>


			</div>


			<?php 
        //			if( check_admin_referer( 'admin-page-class.php', 'BF_Admin_Page_Class_nonce' ) )
        if (isset($_POST['BF_Admin_Page_Class_nonce']) && wp_verify_nonce($_POST['BF_Admin_Page_Class_nonce'], 'admin-page-class.php')) {
            if (isset($_POST['mtt_reset_plugin']) && in_array('do_it', $_POST['mtt_reset_plugin'])) {
                delete_option(B5F_MTT_Init::$opt_name);
            }
            if (isset($_POST['action']) && $_POST['action'] == 'save') {
                echo '<div id="alert_bar" class="footer">';
                echo '<script type="text/javascript">jQuery(document).ready(function ($) {close_update_msg();});</script>';
                echo '<p><strong>' . __('Settings updated.', 'mtt') . '</strong></p></div>';
            }
        }
        /*
        			  if ( $msg_revisions == 'yes' )
        			  {
        			  echo '<script type="text/javascript">jQuery(document).ready( function($) {	$("#alert_bar").slideDown(); window.setTimeout(function(){$("#alert_bar").slideUp()},7500);});</script>';
        			  ?>
        			  <p><strong><?php _e( 'Revisions deleted from database.', 'mtt' ); ?></strong></p><?php
        			  }
        
        			  if ( $msg_reset == 'yes' )
        			  {
        			  echo '<script type="text/javascript">jQuery(document).ready( function($) {	$("#alert_bar").slideDown(); window.setTimeout(function(){$("#alert_bar").slideUp()},7500);});</script>';
        			  ?>
        			  <p><strong><?php _e( 'Settings reset.', 'mtt' ); ?></strong></p><?php
        			  }
        			  ?>
        			  </div> */
        ?>
			<div class="footer">

				<ul class="right hl">
					<li><a href="http://wordpress.org/support/view/plugin-reviews/many-tips-together"
						   target="_blank"><?php 
        _e("Rate MTT in wordpress.org", 'mtt');
        ?>
</a></li>
					<li><a href="https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=JNJXKWBYM9JP6&lc=ES&item_name=Admin%20Tweaks%20%3a%20Rodolfo%20Buaiz&currency_code=EUR&bn=PP%2dDonationsBF%3abtn_donate_SM%2egif%3aNonHosted"
						   target="_blank"><?php 
        _e("Invite me a beer :o)]", 'mtt');
        ?>
</a></li>
				</ul>
			</div>
		</div>
		<?php 
    }
Пример #13
0
<?php

/**
 * USERS and PROFILE options
 *
 * @package    ManyTipsTogether
 * @subpackage B5F_MTT_Admin
 */
$options_panel->OpenTab('user_profile');
$options_panel->Title(__('User profile', 'mtt'));
$options_panel->addCheckbox('profile_h3_titles', array('name' => __('Remove All Titles', 'mtt'), 'desc' => __('Removes the titles: "Personal Options", "Name", "Contact Info" and "About Yourself"', 'mtt'), 'std' => false));
$options_panel->addCheckbox('profile_descriptions', array('name' => __('Remove All Descriptions', 'mtt'), 'desc' => '', 'std' => false));
$options_panel->addCheckbox('profile_slim', array('name' => __('Remove Visual Editor, Admin Color Scheme and Keyboard Shortcuts', 'mtt'), 'desc' => __('My guess is that or you want them all, or you don\'t want them at all :)', 'mtt'), 'std' => false));
$options_panel->addCheckbox('profile_hidden', array('name' => __('Completely hide the Personal Options block', 'mtt'), 'desc' => '', 'std' => false));
$options_panel->addCheckbox('profile_display_name', array('name' => __('Remove Display Name', 'mtt'), 'desc' => '', 'std' => false));
$options_panel->addCheckbox('profile_nickname', array('name' => __('Remove Nickname', 'mtt'), 'desc' => '', 'std' => false));
$options_panel->addCheckbox('profile_website', array('name' => __('Remove Website', 'mtt'), 'desc' => '', 'std' => false));
$options_panel->addCheckbox('profile_social', array('name' => __('Change <strong>Aim</strong>-<strong>Yim</strong>-<strong>Jabber</strong> for <strong>Twitter</strong>-<strong>Facebook</strong>-<strong>LinkedIn</strong>', 'mtt'), 'desc' => __('You have to choose between this one or the next one.', 'mtt'), 'std' => false));
$options_panel->addCheckbox('profile_none', array('name' => __('Remove Aim/Yim/Jabber', 'mtt'), 'desc' => __('You have to choose between this one or the previous one.', 'mtt'), 'std' => false));
$options_panel->addCheckbox('profile_bio', array('name' => __('Hide the About Yourself title and Biographical Info box', 'mtt'), 'desc' => '', 'std' => false));
$options_panel->addCode('profile_css', array('name' => __('Custom CSS', 'mtt'), 'desc' => sprintf(__('Add your custom css to further stylize the Profile page.<br />Test <code>#wpwrap{}</code> with %s', 'mtt'), B5F_MTT_Utils::make_tip_credit(__('some gradients', 'mtt'), 'http://www.colorzilla.com/gradient-editor/')), 'std' => '.class-name {}', 'theme' => 'dark', 'syntax' => 'css'));
$options_panel->CloseTab();
Пример #14
0
$options_panel->addCheckbox('wpdisable_nourl', array('name' => __('Hide blog URL from WordPress "phone home"', 'mtt'), 'desc' => sprintf(__('Filter out the blog URL from the data that is sent to wordpress.org - Check this %s to learn more.', 'mtt'), B5F_MTT_Utils::make_tip_credit(__('article', 'mtt'), 'http://lynnepope.net/wordpress-privacy')), 'std' => false));
$options_panel->addCheckbox('wpdisable_selfping', array('name' => __('Disable Self Ping', 'mtt'), 'desc' => __('Prevents WordPress from sending pings/trackbacks to your own site.', 'mtt'), 'std' => false));
$options_panel->addCheckbox('wpdisable_redirect_disallow', array('name' => __('Redirect unauthorized attempts.', 'mtt'), 'desc' => sprintf(__('If the user tries to access an admin page directly via URL, e.g.: /wp-admin/plugins.php, instead of showing "you do not have persmissions", the browser is redirected to the frontend. Tip via: %s', 'mtt'), B5F_MTT_Utils::make_tip_credit('WordPress Answers', 'http://wordpress.stackexchange.com/q/57206/12615')), 'std' => false));
/***********************************
 *          TAXONOMY COLUMNS
 ***********************************/
$options_panel->addParagraph(sprintf('<hr /><h4>%s</h4>', __('TAXONOMIES', 'mtt')));
$options_panel->addCheckbox('wptaxonomy_columns', array('name' => __('Enable ID column', 'mtt'), 'desc' => sprintf(__('Show column ID in taxonomies screens. Tip via: %s', 'mtt'), B5F_MTT_Utils::make_tip_credit('WordPress Answers', 'http://wordpress.stackexchange.com/q/77532/12615')), 'std' => false));
/***********************************
 *          RSS
 ***********************************/
$options_panel->addParagraph(sprintf('<hr /><h4>%s</h4>', __('RSS', 'mtt')));
$Enable_rss_delay[] = $options_panel->addText('time', array('name' => __('Number of delay', 'mtt'), 'desc' => '', 'std' => ''), true);
$Enable_rss_delay[] = $options_panel->addSelect('period', array('MINUTE' => __('MINUTE', 'mtt'), 'HOUR' => __('HOUR', 'mtt'), 'DAY' => __('DAY', 'mtt'), 'WEEK' => __('WEEK', 'mtt'), 'MONTH' => __('MONTH', 'mtt'), 'YEAR' => __('YEAR', 'mtt')), array('name' => __('Period of delay', 'mtt'), 'desc' => '', 'class' => 'no-fancy', 'std' => array('MINUTE')), true);
$options_panel->addCondition('wprss_delay_publish_enable', array('name' => __('Delay RSS feed update', 'mtt'), 'desc' => sprintf(__('This can give you time to make corrections after publishing a post, delaying the update in your RSS feed. Or you can make your content web exclusive for a larger period. Tip via: %s', 'mtt'), B5F_MTT_Utils::make_tip_credit('WordPress Answers', 'http://wordpress.stackexchange.com/a/1896/12615')), 'fields' => $Enable_rss_delay, 'std' => false, 'validate_func' => 'validate_general_tab'));
/***********************************
 *          ASSORTED
 ***********************************/
//$options_panel->addParagraph( sprintf( '<hr /><h4>%s</h4>', __( 'ASSORTED', 'mtt' ) ) );
/***********************************
 *          AUTOCOWERKS
 ***********************************/
$options_panel->addParagraph(sprintf('<hr /><h4>%s</h4>', __('AUTOCOWERKS', 'mtt')));
$options_panel->addCheckbox('wpdisable_smartquotes', array('name' => __('Disable SmartQuotes', 'mtt'), 'desc' => __('Prevent the conversion of straight quotes into directional quotes.', 'mtt'), 'std' => false));
$options_panel->addCheckbox('wpdisable_capitalp', array('name' => __('Disable Capital P', 'mtt'), 'desc' => __('Prevents WordPress of auto-correcting mispellings of its name. Check this <a href="http://justintadlock.com/archives/2010/07/08/lowercase-p-dangit">article</a>', 'mtt'), 'std' => false));
$options_panel->addCheckbox('wpdisable_autop', array('name' => __('Disable Auto P', 'mtt'), 'desc' => __('Prevents WordPress from inserting automatic &lt;p&gt; tags in your code.', 'mtt'), 'std' => false));
$options_panel->addCheckbox('wpdisable_wptitle', array('name' => __('Remove WordPress from admin page titles', 'mtt'), 'desc' => sprintf(__('The browser title has "- WordPress" appended to it. This will remove it. Tip via: %s', 'mtt'), B5F_MTT_Utils::make_tip_credit('WordPress Answers', 'http://wordpress.stackexchange.com/a/17034/12615')), 'std' => false));
/**
 * END
 */
$options_panel->CloseTab();
Пример #15
0
 public function add_widgets()
 {
     $i = 0;
     foreach ($this->params['dashboard_add_widgets'] as $dash_widg) {
         $ucan = empty($dash_widg['roles']) ? true : B5F_MTT_Utils::current_user_has_role_array($dash_widg['roles']);
         if ($ucan && !empty($dash_widg['enabled'])) {
             $title = $dash_widg['title'] == '' ? '&nbsp;&nbsp;' : stripslashes($dash_widg['title']);
             wp_add_dashboard_widget("mtt_widget_{$i}", $title, array($this, 'add_dashboard_content'));
         }
         $i++;
     }
 }
Пример #16
0
<?php

/**
 * PLUGINS options
 *
 * @package    ManyTipsTogether
 * @subpackage B5F_MTT_Admin
 */
$options_panel->OpenTab('plugins');
$options_panel->Title(__('Plugins', 'mtt'));
$options_panel->addCheckbox('plugins_block_update_notice', array('name' => __('Block plugins upgrade check', 'mtt'), 'desc' => __('Not recommended, use by your own.', 'mtt'), 'std' => false));
$options_panel->addCheckbox('plugins_block_update_inactive_plugins', array('name' => __('Block inactive plugins upgrade check', 'mtt'), 'desc' => __("You'd probably be better deleting them alltogether. Doesn't work in Multisite.", 'mtt'), 'std' => false));
$options_panel->addCheckbox('plugins_remove_plugin_edit', array('name' => __('Remove plugins quick edit links (activate/deactivate, edit, settings)', 'mtt'), 'desc' => __('You will have to work only with batch actions, but you can achieve the smallest plugin listing,', 'mtt'), 'std' => false));
$options_panel->addCheckbox('plugins_remove_description', array('name' => __('Remove descriptions but leave Version and Author information.', 'mtt'), 'desc' => '', 'std' => false));
$options_panel->addCheckbox('plugins_remove_plugin_notice', array('name' => __('Remove extra plugins notices (normally in yellow)', 'mtt'), 'desc' => '', 'std' => false));
$options_panel->addCheckbox('plugins_add_last_updated', array('name' => __('Adds information about last update of the plugins', 'mtt'), 'desc' => sprintf(__('Incorporation of the plugin: %s. After enabling this, the first load of the plugins page may take a while for the information be retrieved. After the first load, the information is cached for 24 hours.', 'mtt'), B5F_MTT_Utils::make_tip_credit('Plugin Last Updated', 'http://wordpress.org/extend/plugins/plugin-last-updated/')), 'std' => false));
$options_panel->addColor('plugins_inactive_bg_color', array('name' => __('Inactive Plugins background color', 'mtt'), 'desc' => ''));
$My_plugins_color[] = $options_panel->addText('names', array('name' => __("Enter a list of keywords separated by comma, no spaces. Normally, you'll use the plugin authors.", 'mtt'), 'std' => ''), true);
$My_plugins_color[] = $options_panel->addColor('color', array('name' => __('Your Plugins background color ;o)', 'mtt'), 'desc' => ''), true);
$My_plugins_color[] = $options_panel->addCheckbox('display_count', array('name' => __('Display count', 'mtt'), 'desc' => '', 'std' => false), true);
$options_panel->addCondition('plugins_my_plugins_bg_color', array('name' => __('Colorize specific plugins.', 'mtt'), 'desc' => __('Use to display some plugins (yours!) with other color.', 'mtt'), 'fields' => $My_plugins_color, 'std' => false, 'validate_func' => 'validate_colorize_plugins'));
$options_panel->CloseTab();
Пример #17
0
 /**
  * Sort menu: first post types, then links, media and comments
  * 
  * Since 2.1
  * @global type $menu
  */
 public function sort_cpts()
 {
     global $menu;
     $separator = B5F_MTT_Utils::recursive_array_search('separator2', $menu);
     $mod_menu = array();
     $links = B5F_MTT_Utils::recursive_array_search('link-manager.php', $menu);
     if ($links) {
         $mod_menu['links'] = $menu[$links];
         unset($menu[$links]);
     }
     $upload = B5F_MTT_Utils::recursive_array_search('upload.php', $menu);
     if ($upload) {
         $mod_menu['upload'] = $menu[$upload];
         unset($menu[$upload]);
     }
     $comments = B5F_MTT_Utils::recursive_array_search('edit-comments.php', $menu);
     if ($comments) {
         $mod_menu['comments'] = $menu[$comments];
         unset($menu[$comments]);
     }
     $position_menu = (int) $separator - count($mod_menu);
     foreach ($mod_menu as $m) {
         $menu[$position_menu] = $m;
         $position_menu++;
     }
 }
Пример #18
0
 * POST EDITING options
 *
 * @package    ManyTipsTogether
 * @subpackage B5F_MTT_Admin
 */
$options_panel->OpenTab('post_editing');
$options_panel->Title(__('Post and Page Editing', 'mtt'));
$options_panel->addCheckbox('postpages_enable_page_excerpts', array('name' => __('Pages: enable Excerpt', 'mtt'), 'desc' => sprintf(__('Tip via: %s', 'mtt'), B5F_MTT_Utils::make_tip_credit('Smashing Magazine', 'http://wp.smashingmagazine.com/2011/05/10/new-wordpress-power-tips-for-template-developers-and-consultants/')), 'std' => false));
$options_panel->addText('postpages_post_revision', array('name' => __('Posts-Pages: number of revisions to maintain', 'mtt'), 'desc' => __('-1 (unlimited) | 0 (none) | 1 or more (custom)', 'mtt'), 'validate_func' => 'validate_postediting', 'std' => ''));
$options_panel->addText('postpages_post_autosave', array('name' => __('Posts-Pages: auto-save interval <em>in minutes</em>', 'mtt'), 'desc' => '', 'validate_func' => 'validate_postediting', 'std' => ''));
$options_panel->addParagraph(sprintf('<hr /><h4>%s</h4>', __('POST CATEGORIES', 'mtt')));
$options_panel->addCheckbox('postpages_enable_category_count', array('name' => __('Enable count', 'mtt'), 'desc' => sprintf(__('Tip via: %s.%s. Also using CCT option bellow', 'mtt'), B5F_MTT_Utils::make_tip_credit('Stack Overflow', 'http://stackoverflow.com/a/15845723/1287812'), "<div class='img-help'><img src='{$plugin_url}images/postediting-category-count.jpg' /></div>"), 'std' => false));
$options_panel->addCheckbox('postpages_enable_category_fixed', array('name' => __('Category Checklist Tree', 'mtt'), 'desc' => sprintf(__("This is the code from scribu's plugin: %s", 'mtt'), B5F_MTT_Utils::make_tip_credit('Category Checklist Tree', 'http://wordpress.org/plugins/category-checklist-tree/')), 'std' => false));
$options_panel->addCheckbox('postpages_enable_category_noparent', array('name' => __('Disable selection of parent categories', 'mtt'), 'desc' => sprintf(__("Use the previous to use this one. Tip via: %s", 'mtt'), B5F_MTT_Utils::make_tip_credit('WordPress Answers', 'http://wordpress.stackexchange.com/a/58525/12615')), 'std' => false));
$options_panel->addParagraph(sprintf('<hr /><h4>%s</h4>%s', __('PUBLISH META BOX', 'mtt'), "<div class='img-help desc-field'><img src='{$plugin_url}images/postediting-publish-metabox.jpg' /></div>"));
$options_panel->addCheckbox('postpages_move_author_metabox', array('name' => __('Posts-Pages: move the Author metabox into the Publish metabox', 'mtt'), 'desc' => sprintf(__('Tip via: %s', 'mtt'), B5F_MTT_Utils::make_tip_credit('WordPress Answers', 'http://wordpress.stackexchange.com/q/1567/12615')), 'std' => false));
$options_panel->addCheckbox('postpages_move_comments_metabox', array('name' => __('Posts-Pages: move the Discussion metabox into the Publish metabox', 'mtt'), 'desc' => '', 'std' => false));
//$options_panel->addParagraph(
//    sprintf(
//        '<hr /><h4>%s</h4><p class="desc-field">%s %s</p>',
//        __( 'HIDE FROM PUBLISH METABOX', 'mtt' ),
//        __('Example with Comments and Author moved inside.', 'mtt' ),
//		"<div class='img-help'><img src='{$plugin_url}images/postediting-publish-metabox.jpg' /></div>"
//    )
//);
$options_panel->addCheckboxList('postpages_hide_from_publish', array('status' => __('Status'), 'visibility' => __('Visibility'), 'published' => __('Published On')), array('name' => __('Hide elements'), 'desc' => __('Affects ALL post types. Select items to hide:', 'mtt'), 'class' => 'no-toggle', 'std' => false));
$options_panel->addParagraph(sprintf("<hr /><h4>%s</h4><p class='desc-field'><i>%s</i></p>", __('REMOVE METABOXES : POSTS and PAGES<br />', 'mtt'), __("Although Adminimize can handle this filtering by roles, it only hides the meta box and it doen't removes it from the Screen Options", 'mtt')));
$options_panel->addSelect('postpages_disable_mbox_author', array('none' => 'none', 'post' => 'post', 'page' => 'page', 'post_and_page' => 'post and page'), array('name' => __('AUTHOR', 'mtt'), 'desc' => '', 'class' => 'no-fancy', 'std' => null));
$options_panel->addSelect('postpages_disable_mbox_comment_status', array('none' => 'none', 'post' => 'post', 'page' => 'page', 'post_and_page' => 'post and page'), array('name' => __('DISCUSSION', 'mtt'), 'desc' => '', 'class' => 'no-fancy', 'std' => null));
$options_panel->addSelect('postpages_disable_mbox_comment', array('none' => 'none', 'post' => 'post', 'page' => 'page', 'post_and_page' => 'post and page'), array('name' => __('COMMENTS', 'mtt'), 'desc' => '', 'class' => 'no-fancy', 'std' => null));
$options_panel->addSelect('postpages_disable_mbox_custom_fields', array('none' => 'none', 'post' => 'post', 'page' => 'page', 'post_and_page' => 'post and page'), array('name' => __('CUSTOM FIELDS', 'mtt'), 'desc' => '', 'class' => 'no-fancy', 'std' => null));
 /**
  * Add ID colum to wp-admin/upload.php
  * 
  * @param type $cols
  * @return type
  */
 public function id_column_define($cols)
 {
     $in = array("id" => "ID");
     $cols = B5F_MTT_Utils::array_push_after($cols, $in, 0);
     return $cols;
 }
Пример #20
0
    $bubbles[] = $options_panel->addCheckboxList('cpt', $cpt_list, array('name' => __('Select types:', 'mtt'), 'desc' => '', 'class' => 'no-toggle', 'std' => false), true);
    $bubbles[] = $options_panel->addSelect('status', $cps_list, array('name' => __('Select status:', 'mtt'), 'desc' => '', 'std' => false), true);
    $options_panel->addCondition('admin_menus_bubbles', array('name' => __('Enable', 'mtt'), 'desc' => sprintf(__('Tip via: %s.%s', 'mtt'), B5F_MTT_Utils::make_tip_credit('WordPress Answers', 'http://wordpress.stackexchange.com/a/95058/12615'), "<div class='img-help'><img src='{$plugin_url}images/adminmenus-bubbles.jpg' /></div>"), 'fields' => $bubbles, 'std' => false));
}
if (function_exists('get_fields')) {
    $options_panel->addParagraph(sprintf('<hr /><h4 class="h3-mtt">%s</h4>', __('ADVANCED CUSTOM FIELDS', 'mtt')));
    $users_arr = B5F_MTT_Utils::get_users_array();
    // ACF CPT PAGE
    if ($users_arr) {
        $ACF_hide_from_users[] = $options_panel->addSelect('for_user', $users_arr, array('name' => __('Select authorized user.', 'mtt'), 'desc' => '', 'std' => array('none')), true);
        $options_panel->addCondition('plugins_acf_show_only', array('name' => __('Advanced Custom Fields: show ACF menu only for one user.', 'mtt'), 'desc' => '', 'fields' => $ACF_hide_from_users, 'std' => false));
    }
    // ACF OPTIONS ADDON PAGE
    if (class_exists('acf_options_page_plugin')) {
        if ($users_arr) {
            $ACF_hide_options_from_users[] = $options_panel->addSelect('for_user', $users_arr, array('name' => __('If you want to show only for one user, select bellow.', 'mtt'), 'desc' => __('If none is selected, the Options are only hidden from non-administrators.', 'mtt'), 'std' => array('none')), true);
            $options_panel->addCondition('plugins_acf_hide_options', array('name' => __('Advanced Custom Fields: hide "Options" from non-administrators', 'mtt'), 'desc' => '', 'fields' => $ACF_hide_options_from_users, 'std' => false));
        }
    }
}
$options_panel->addParagraph(sprintf('<hr /><h4 class="h3-mtt">%s</h4><p>%s</p>', __('RENAME POSTS', 'mtt'), __('to whatever you want (i.e. news, articles)', 'mtt')));
$Post_rename_fields[] = $options_panel->addText('name', array('name' => __('Name', 'mtt'), 'std' => ''), true);
$Post_rename_fields[] = $options_panel->addText('singular_name', array('name' => __('Singular Name', 'mtt'), 'std' => ''), true);
$Post_rename_fields[] = $options_panel->addText('add_new', array('name' => __('Add New', 'mtt'), 'std' => ''), true);
$Post_rename_fields[] = $options_panel->addText('edit_item', array('name' => __('Edit Posts', 'mtt'), 'std' => ''), true);
$Post_rename_fields[] = $options_panel->addText('view_item', array('name' => __('View Posts', 'mtt'), 'std' => ''), true);
$Post_rename_fields[] = $options_panel->addText('search_items', array('name' => __('Search Posts', 'mtt'), 'std' => ''), true);
$Post_rename_fields[] = $options_panel->addText('not_found', array('name' => __('No Posts found', 'mtt'), 'std' => ''), true);
$Post_rename_fields[] = $options_panel->addText('not_found_in_trash', array('name' => __('No Posts found in trash', 'mtt'), 'std' => ''), true);
$options_panel->addCondition('posts_rename_enable', array('name' => __('Enable renaming the word "Posts"', 'mtt'), 'desc' => sprintf(__('Maybe you prefer it to be called News or Articles and don\'t want to create a Custom Post Type for that.<br />Tip via: %s', 'mtt'), B5F_MTT_Utils::make_tip_credit('WordPress Answers', 'http://wordpress.stackexchange.com/a/9224/12615')), 'fields' => $Post_rename_fields, 'std' => false, 'validate_func' => 'validate_post_renaming'));
$options_panel->CloseTab();
Пример #21
0
 /**
  * Help Tab Callback
  */
 public function help_tab_callback_two()
 {
     echo '<p><pre>';
     $getty = B5F_MTT_Utils::print_repository_info(false);
     unset($getty['changelog'], $getty['sections'], $getty['stats']);
     print_r($getty);
     echo '</pre></p>';
 }
Пример #22
0
 public function admin_notices()
 {
     global $current_screen;
     if (!empty($this->params['admin_notice_header_settings_enable']['enabled']) && 'options-general' == $current_screen->parent_base) {
         print '<div  class="updated">' . $this->params['admin_notice_header_settings_enable']['text'] . '</div>';
     }
     // enable general notice
     if (!empty($this->params['admin_notice_header_allpages_enable']['enabled'])) {
         $ucan = empty($this->params['admin_notice_header_allpages_enable']['level']) ? true : B5F_MTT_Utils::current_user_has_role_array($this->params['admin_notice_header_allpages_enable']['level']);
         if ($ucan) {
             echo '<div  class="updated">' . $this->params['admin_notice_header_allpages_enable']['text'] . '</div>';
         }
     }
 }
Пример #23
0
 /**
  * Add custom menu to Admin Bar
  * 
  * @global type $wp_admin_bar
  * @return type
  */
 public function custom_menu()
 {
     global $wp_admin_bar;
     // ERROR, NO PARENT
     if ($this->params['adminbar_custom_enable']['bar_0_title'] == '') {
         return;
     }
     // PARENT
     $href0 = $this->params['adminbar_custom_enable']['bar_0_url'] != '' ? $this->params['adminbar_custom_enable']['bar_0_url'] : '#';
     $wp_admin_bar->add_menu(array('id' => 'MTT', 'title' => $this->params['adminbar_custom_enable']['bar_0_title'], 'href' => $href0));
     // NO SUBMENUS
     if (empty($this->params['adminbar_custom_submenus'])) {
         return;
     }
     $i = 0;
     foreach ($this->params['adminbar_custom_submenus'] as $submenu) {
         $ucan = empty($submenu['roles']) ? true : B5F_MTT_Utils::current_user_has_role_array($submenu['roles']);
         if ($ucan) {
             $href = $submenu['url'] != '' ? $submenu['url'] : '#';
             $wp_admin_bar->add_menu(array('parent' => 'MTT', 'id' => 'MTT' . $i, 'title' => $submenu['title'], 'href' => $href));
             $i++;
         }
     }
     return;
     // CHILDREN
     for ($i = 1; $i <= 5; $i++) {
         if ($this->params['adminbar_custom_enable']["bar_{$i}_title"] != '') {
             $href = $this->params['adminbar_custom_enable']["bar_{$i}_url"] != '' ? $this->params['adminbar_custom_enable']["bar_{$i}_url"] : '#';
             $wp_admin_bar->add_menu(array('parent' => 'MTT', 'id' => 'MTT' . $i, 'title' => $this->params['adminbar_custom_enable']["bar_{$i}_title"], 'href' => $href));
         }
     }
 }
Пример #24
0
<?php

/**
 * SHORTCODES options
 *
 * @package    ManyTipsTogether
 * @subpackage B5F_MTT_Admin
 */
$options_panel->OpenTab('shortcodes');
$options_panel->Title(__('Shortcodes', 'mtt'));
$options_panel->addCheckbox('shortcodes_everywhere', array('name' => __('Enable shortcodes everywhere', 'mtt'), 'desc' => sprintf(__('In the text widget, excerpts, content and category/tag/taxonomy descriptions. Code by: %s', 'mtt'), B5F_MTT_Utils::make_tip_credit('Thomas Scholz', 'https://github.com/toscho/WordPress-Shortcodes/')), 'std' => false));
$tubedesc = '<div class="desc">' . __('Usage:', 'mtt') . ' <code>[poptube id="VIDEO-ID" title="TITLE-OVER-THUMBNAIL" color="#CCCF27" button="WATCH NOW"]</code>
            <div style="text-align:center;width:170px;margin:0 0 15px">
            <h2 style="color:#CCCF27;text-shadow:none;padding:0;margin-bottom:0;">' . __('TITLE-OVER', 'mtt') . '</h2>
            <a href="http://www.youtube.com/watch_popup?v=s-c_urzTWYQ" target="_blank">
            <img src="http://i3.ytimg.com/vi/s-c_urzTWYQ/default.jpg" alt="youtube thumbnail" style="margin-bottom:-19px"/>
            </a><br />
            <a class="button-secondary" href="http://www.youtube.com/watch_popup?v=s-c_urzTWYQ" target="_blank">' . __('WATCH NOW', 'mtt') . '</a></div>' . __('The "color" attribute is for the title.<br />
            This is the default backend style, for adpating it in your theme 
            use the class "mtt-poptube" for the elements', 'mtt') . ' <em>&lt;h2&gt;</em>, <em>&lt;img&gt;</em> ' . __('and', 'mtt') . ' <em>&lt;a&gt;</em></div>';
$options_panel->addCheckbox('shortcodes_tube', array('name' => __('Enable YouTube shortcode', 'mtt'), 'desc' => $tubedesc, 'std' => false));
$options_panel->addCheckbox('shortcodes_gdocs', array('name' => __('Enable Google Docs Preview Document shortcode', 'mtt'), 'desc' => __('Use Google Docs for preview PDF, Word, Excel docuemtns online. <a href="http://docs.google.com/viewer?url=partners.adobe.com/public/developer/en/xml/AdobeXMLFormsSamples.pdf" target="_blank">Example</a>.<br />Usage: <code>[gdocs url="http://www.domain.com/document.pdf" class="my-doc-class"]View Document[/gdocs]</code>', 'mtt'), 'std' => false));
$options_panel->CloseTab();