/**
  * Prints widget on the public side
  */
 function widget($args, $instance)
 {
     if (q2w3_inc_manager::check_visibility($this->inc_pages, $this->exc_pages, $this->hide_from_admin)) {
         echo $args['before_widget'];
         // Before the widget
         if ($this->widget_public_title) {
             echo $args['before_title'] . $this->widget_public_title . $args['after_title'];
         }
         // The title if not blanc
         echo '<div>';
         eval('?>' . q2w3_inc_manager::code_align(htmlspecialchars_decode($this->code, ENT_QUOTES), $this->code_align));
         // widget code
         echo '</div>';
         echo $args['after_widget'];
         // After the widget
     }
 }
 /**
  * Creates link to plugin settings page in the main menu. 
  * 
  */
 public static function reg_menu()
 {
     $access_level = 'activate_plugins';
     // admins and superadmins only
     add_menu_page('Code Insert', __('Code Insert', self::ID), $access_level, 'q2w3-inc-manager', array(__CLASS__, 'main_page'), WP_PLUGIN_URL . '/q2w3-inc-manager/q2w3-table/menu-icon.gif');
     self::$plugin_page = add_submenu_page('q2w3-inc-manager', self::NAME, __('Inserts', self::ID), $access_level, 'q2w3-inc-manager', array(__CLASS__, 'main_page'));
     add_submenu_page('q2w3-inc-manager', self::NAME, __('Add New', self::ID), $access_level, 'q2w3-inc-manager&amp;id=_new_', array(__CLASS__, 'main_page'));
     add_submenu_page('q2w3-inc-manager', self::NAME, __('Settings', self::ID), $access_level, 'q2w3-inc-manager-settings', array(__CLASS__, 'settings_page'));
     add_action('manage_' . self::$plugin_page . '_columns', array(__CLASS__, 'screen_options'));
     add_action('contextual_help_list', array(__CLASS__, 'help'));
     // get_current_screen()->add_help_tab()
     if (isset($_GET["page"]) && $_GET["page"] == 'q2w3-inc-manager') {
         q2w3_table_func::css_js_load();
         // css and js for settings page
         if (key_exists('id', $_GET) && $_GET['id']) {
             wp_enqueue_style('thickbox');
             wp_enqueue_script('thickbox');
         }
     }
 }
示例#3
0
<?php

if ($_SERVER['REQUEST_METHOD'] != 'POST') {
    die;
}
require_once 'q2w3_table_load.php';
require_once 'q2w3_table_func.php';
require_once q2w3_table_func::wp_load();
if (!check_admin_referer('q2w3_table_post', 'wp_nonce')) {
    wp_die('Security check failed');
}
require_once dirname(dirname(__FILE__)) . '/q2w3-inc-manager.php';
q2w3_inc_manager::load_language();
if (isset($_POST['deactivate'])) {
    q2w3_inc_manager::deactivation();
} else {
    $action = $_POST['action'];
    $object = $_POST['object'];
    eval($action . '::action(q2w3_inc_manager::ID, $object);');
    if ($_SERVER['HTTP_REFERER']) {
        header('Location: ' . $_SERVER['HTTP_REFERER']);
    }
}
示例#4
0
<?php

if (!$_SERVER['QUERY_STRING']) {
    die;
}
require_once 'q2w3_table_load.php';
require_once 'q2w3_table_func.php';
require_once q2w3_table_func::wp_load();
if (!check_admin_referer('q2w3_table_get', 'wp_nonce')) {
    wp_die('Security check failed');
}
require_once dirname(dirname(__FILE__)) . '/q2w3-inc-manager.php';
q2w3_inc_manager::load_language();
$action = $_GET['action'];
$object = $_GET['object'];
eval($action . '::action(q2w3_inc_manager::ID, $object);');
if ($_SERVER['HTTP_REFERER']) {
    header('Location: ' . $_SERVER['HTTP_REFERER']);
}