function page_footer() { parent::page_footer(); ?> <script type="text/javascript"> jQuery(function($) { $(document).delegate('.tip-icon', 'click', function(ev) { var $row = $(this).closest('tr'); var $show = $row.next('.tip-show'); if ( $show.length ) { $show.remove(); } else { $show = $('<tr class="tip-show">').html( $('<td colspan="3">').html( $row.find('.tip-content').html() ) ); $row.after( $show ); } }); }); </script> <?php }
function __construct($page_slug, $args = array(), $file = false, $options = null) { ob_start(); $this->page_title(); $page_title = ob_get_clean(); $defaults = array('menu_title' => __('Add-ons', APP_TD), 'page_title' => $page_title, 'page_slug' => $page_slug, 'parent' => 'app-dashboard', 'action_link' => false, 'admin_action_priority' => 99); $this->args = wp_parse_args($args['menu'], $defaults); parent::__construct($file, $options); }
/** * @since 1.0.0 * @param string|bool $file * @param scbOptions $options * @param array $overrides * @param Prompt_Admin_Options_Tab[] $tabs * @param Prompt_Admin_Conditional_Notice[] $notices * @param Prompt_Api_Client $api_client */ public function __construct($file = false, $options = null, $overrides = null, $tabs = null, $notices = null, $api_client = null) { parent::__construct($file, $options); $this->_overridden_options = $overrides; $this->key = $options->get('prompt_key'); $this->maybe_auto_load(); $this->tabs = $tabs; $this->notices = $notices; $this->api_client = $api_client; }
function __construct($file, $options) { $this->textdomain = 'smart-archives-reloaded'; // Load translations $plugin_dir = basename(dirname($file)); load_plugin_textdomain($this->textdomain, "wp-content/plugins/{$plugin_dir}/lang", "{$plugin_dir}/lang"); $this->args = array('page_title' => __('Smart Archives Settings', $this->textdomain), 'menu_title' => __('Smart Archives', $this->textdomain), 'page_slug' => 'smart-archives'); add_action('transition_post_status', array($this, 'update_cache'), 10, 2); add_action('deleted_post', array($this, 'update_cache'), 10, 0); parent::__construct($file, $options); }
function _sar_init() { load_plugin_textdomain('smart-archives-reloaded', '', dirname(plugin_basename(__FILE__)) . '/lang'); require_once dirname(__FILE__) . '/core.php'; require_once dirname(__FILE__) . '/generator.php'; $options = new scbOptions('smart-archives', __FILE__, array('format' => 'both', 'list_format' => '%post_link%', 'date_format' => get_option('date_format'), 'anchors' => false, 'month_format' => 'short', 'posts_per_month' => -1, 'include_cat' => array(), 'exclude_cat' => array())); SAR_Core::init($options); if (is_admin()) { require_once dirname(__FILE__) . '/admin/admin.php'; scbAdminPage::register('SAR_Settings', __FILE__, $options); } }
function _ac_init() { $textdomain = 'admin-customization'; load_plugin_textdomain($textdomain, false, dirname(plugin_basename(__FILE__)) . '/lang'); $dir = dirname(__FILE__); $options = new scbOptions('admin-customization', __FILE__, array('favicon' => false, 'login_logo' => false, 'admin_logo' => false, 'admin_footer_left' => false, 'admin_footer_right' => false, 'admin_logo_font_size' => 16, 'widgets' => array(), 'disabled_widgets' => '', 'general_settings' => '', 'style_settings' => array())); require_once $dir . '/core.php'; // initialize the core AC_Core::init($options); // add admin page if (is_admin()) { require_once $dir . '/admin/admin.php'; scbAdminPage::register('AC_Settings', __FILE__, $options); } }
public function __construct($post_type = 'post', $fields, $args = '') { $args = wp_parse_args($args, array('taxonomies' => array(), 'custom_fields' => array(), 'tax_meta' => array(), 'geodata' => false)); $this->post_type = $post_type; $this->fields = $fields; $this->taxonomies = $args['taxonomies']; $this->tax_meta = $args['tax_meta']; $this->geodata = $args['geodata']; $this->custom_fields = array(); foreach ($args['custom_fields'] as $csv_key => $data) { if (!is_array($data)) { $data = array('internal_key' => $data); } $this->custom_fields[$csv_key] = wp_parse_args($data, array('internal_key' => $csv_key, 'default' => '')); } parent::__construct(); }
function page_footer() { parent::page_footer(); ?> <style type="text/css"> h2 .nav-tab { margin: -4px -2px -1px 0; } table.form-table th { position: relative; padding-right: 24px; } table.form-table td fieldset label { display: block; } </style> <?php }
function _fee_init() { load_plugin_textdomain('front-end-editor', '', basename(dirname(__FILE__)) . '/lang'); $dir = dirname(__FILE__) . '/php'; require_once $dir . '/template-tags.php'; require_once $dir . '/core.php'; foreach (array('base', 'post', 'widget', 'other') as $name) { require_once "{$dir}/fields/{$name}.php"; } $options = new scbOptions('front-end-editor', __FILE__, array('disabled' => array('bloginfo'), 'rich' => true, 'group_post' => false, 'taxonomy_ui' => 'termselect')); FEE_Core::init($options); FEE_Field_Option::init(__FILE__); FEE_Field_Image::init(__FILE__); if (is_admin()) { require_once dirname(__FILE__) . '/admin/admin.php'; scbAdminPage::register('FEE_Admin', __FILE__, $options); } add_action('front_end_editor_fields', 'fee_register_defaults', 0); }
function _useronline_init() { load_plugin_textdomain('wp-useronline', '', dirname(plugin_basename(__FILE__)) . '/lang'); require_once dirname(__FILE__) . '/core.php'; require_once dirname(__FILE__) . '/template-tags.php'; require_once dirname(__FILE__) . '/deprecated.php'; require_once dirname(__FILE__) . '/widget.php'; new scbTable('useronline', __FILE__, "\n\t\ttimestamp timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,\n\t\tuser_type varchar( 20 ) NOT NULL default 'guest',\n\t\tuser_id bigint( 20 ) NOT NULL default 0,\n\t\tuser_name varchar( 250 ) NOT NULL default '',\n\t\tuser_ip varchar( 39 ) NOT NULL default '',\n\t\tuser_agent text NOT NULL,\n\t\tpage_title text NOT NULL,\n\t\tpage_url varchar( 255 ) NOT NULL default '',\n\t\treferral varchar( 255 ) NOT NULL default '',\n\t\tUNIQUE KEY useronline_id ( timestamp, user_type, user_ip )\n\t", 'delete_first'); $most = new scbOptions('useronline_most', __FILE__, array('count' => 1, 'date' => current_time('timestamp'))); $options = new scbOptions('useronline', __FILE__, array('timeout' => 300, 'url' => trailingslashit(get_bloginfo('url')) . 'useronline', 'names' => false, 'naming' => array('user' => __('1 User', 'wp-useronline'), 'users' => __('%COUNT% Users', 'wp-useronline'), 'member' => __('1 Member', 'wp-useronline'), 'members' => __('%COUNT% Members', 'wp-useronline'), 'guest' => __('1 Guest', 'wp-useronline'), 'guests' => __('%COUNT% Guests', 'wp-useronline'), 'bot' => __('1 Bot', 'wp-useronline'), 'bots' => __('%COUNT% Bots', 'wp-useronline')), 'templates' => array('useronline' => '<a href="%PAGE_URL%"><strong>%USERS%</strong> ' . __('Online', 'wp-useronline') . '</a>', 'browsingsite' => array('separators' => array('members' => __(',', 'wp-useronline') . ' ', 'guests' => __(',', 'wp-useronline') . ' ', 'bots' => __(',', 'wp-useronline') . ' '), 'text' => _x('Users', 'Template Element', 'wp-useronline') . ': <strong>%MEMBER_NAMES%%GUESTS_SEPARATOR%%GUESTS%%BOTS_SEPARATOR%%BOTS%</strong>'), 'browsingpage' => array('separators' => array('members' => __(',', 'wp-useronline') . ' ', 'guests' => __(',', 'wp-useronline') . ' ', 'bots' => __(',', 'wp-useronline') . ' '), 'text' => '<strong>%USERS%</strong> ' . __('Browsing This Page.', 'wp-useronline') . '<br />' . _x('Users', 'Template Element', 'wp-useronline') . ': <strong>%MEMBER_NAMES%%GUESTS_SEPARATOR%%GUESTS%%BOTS_SEPARATOR%%BOTS%</strong>')))); UserOnline_Core::init($options, $most); scbWidget::init('UserOnline_Widget', __FILE__, 'useronline'); if (is_admin()) { require_once dirname(__FILE__) . '/admin.php'; scbAdminPage::register('UserOnline_Admin_Integration', __FILE__); scbAdminPage::register('UserOnline_Options', __FILE__, UserOnline_Core::$options); } if (function_exists('stats_page')) { require_once dirname(__FILE__) . '/wp-stats.php'; } # scbUtil::do_uninstall( __FILE__ ); # scbUtil::do_activation( __FILE__ ); }
function __construct($args) { $this->args = wp_parse_args($args, array('page_slug' => 'app-dashboard', 'toplevel' => 'menu', 'position' => 3, 'screen_icon' => 'themes')); $this->boxes = array(array('news', $this->box_icon('framework/images/newspaper.png') . __('Latest News', APP_TD), 'normal'), array('twitter', $this->box_icon('framework/images/twitter-bird.png') . __('Latest Tweets', APP_TD), 'side'), array('forum', $this->box_icon('framework/images/comments.png') . __('Support Forum', APP_TD), 'side')); scbAdminPage::__construct(false); }
/** * Displays page footer. * * @return void */ protected function page_footer() { parent::page_footer(); $this->_boxes_js_init(); }
function __construct($args) { $this->args = wp_parse_args($args, array('submenu_title' => __('Dashboard', APP_TD), 'page_slug' => 'app-dashboard', 'toplevel' => 'menu', 'position' => 3, 'screen_icon' => 'themes')); $this->boxes = array(array('news', $this->box_icon('newspaper.png') . __('Latest News', APP_TD), 'normal'), array('tutorials', $this->box_icon('book-open.png') . __('Tutorials', APP_TD), 'side'), array('marketplace', $this->box_icon('store.png') . __('From the Marketplace', APP_TD), 'side')); scbAdminPage::__construct(); }
/** * footer page */ function page_footer() { parent::page_footer(); // Reset all forms ?> <script type="text/javascript"> (function() { var forms = document.getElementsByTagName('form'); for (var i = 0; i < forms.length; i++) { forms[i].reset(); } }()); </script> <?php }
/** * Generate a submit action based on the options key. * @param string $content * @param array $button_args * @return string */ public function form_wrap($content, $button_args = array()) { $content .= html('input', array('name' => 'tab', 'type' => 'hidden', 'value' => $this->slug())); $content .= html('input', array('name' => 'action', 'type' => 'hidden', 'value' => 'save_prompt_tab_options')); $button_args = array_merge(array('action' => $this->action() . '_submit'), $button_args); return parent::form_wrap($content, $button_args); }
/** * Constructor * * @param array $args { * Optional. An array of arguments. * * @type string $page_title Dashboard title. Default 'AppThemes Dashboard' * @type string $menu_title Menu title. Default 'AppThemes' * @type string $submenu_title Submenu title. Default 'Dashboard' * @type string $page_slug Page slug. Default 'app-dashboard' * @type string $toplevel Menu level. Default 'menu'. Accepts 'menu', 'submenu'. * @type int $position Position in menu. Default 3. * @type string $screen_icon Screen icon (obsolete). Default 'themes'. * @type int $columns Number of columns of widgets. Default 2. Accepts 1, 2, 3, 4. * @type array $boxes { * An array of additional metaboxes with array of parameters. * Default 'stats', 'news', 'tutorials', 'marketplace', 'support_forum'. * * @type string $title Title of the meta box. * @type callback $callback Optional. Function that fills the box with the desired content. * The function should echo its output. * Default array( $this, '_intermediate_callback' ) * Accepts function name or array(object, method). * @type string $context Optional. The context within the screen where the boxes * should display. Default 'normal'. * Accepts 'normal', 'side', 'column3', 'column4'. * @type string $priority Optional. The priority within the context where the boxes * should show ('high', 'low'). Default 'default'. * @type array $callback_args Optional. Data that should be set as the $args property * of the box array (which is the second parameter passed * to your callback). Default array(). * } * } */ function __construct($args = array()) { $this->_setup_args($args); $this->_setup_boxes(); scbAdminPage::__construct(); }