Пример #1
0
 /**
  * Initializes the Admin controller
  *
  * @since 1.0
  *
  * @return boolean True if the admin controller is established, false otherwise
  **/
 public function admin()
 {
     if (!defined('WP_ADMIN')) {
         return false;
     }
     if ($this->handler()) {
         $this->Controller->admin();
         return true;
     }
     return false;
 }
Пример #2
0
 public function __construct()
 {
     parent::__construct();
     ShoppCatalog();
     Shopping::restore('search', $this->search);
     Shopping::restore('browsing', $this->browsing);
     Shopping::restore('referrer', $this->referrer);
     Shopping::restore('viewed', $this->viewed);
     // Setup WP_Query overrides
     add_action('parse_query', array($this, 'query'));
     add_filter('posts_request', array($this, 'noquery'), 10, 2);
     add_filter('posts_request', array($this, 'onfront'), 10, 2);
     add_filter('posts_results', array($this, 'found'), 10, 2);
     add_filter('the_posts', array($this, 'posts'), 10, 2);
     add_action('wp', array($this, 'loaded'));
     add_action('wp', array($this, 'security'));
     add_action('wp', array($this, 'trackurl'));
     add_action('wp', array($this, 'viewed'));
     add_action('wp', array($this, 'cart'));
     add_action('wp', array($this, 'dashboard'));
     add_action('wp', array($this, 'shortcodes'));
     add_action('wp', array($this, 'behaviors'));
     add_filter('wp_get_nav_menu_items', array($this, 'menulinks'), 10, 2);
     add_filter('wp_list_pages', array($this, 'securelinks'));
     // Wrap Shopp content in #shopp div  to enable CSS and Javascript
     add_filter('shopp_order_lookup', array('Storefront', 'wrapper'));
     add_filter('shopp_order_confirmation', array('Storefront', 'wrapper'));
     add_filter('shopp_errors_page', array('Storefront', 'wrapper'));
     add_filter('shopp_catalog_template', array('Storefront', 'wrapper'));
     add_filter('shopp_cart_template', array('Storefront', 'wrapper'));
     add_filter('shopp_checkout_page', array('Storefront', 'wrapper'));
     add_filter('shopp_account_template', array('Storefront', 'wrapper'));
     add_filter('shopp_category_template', array('Storefront', 'wrapper'));
     add_filter('shopp_order_receipt', array('Storefront', 'wrapper'));
     add_filter('shopp_account_manager', array('Storefront', 'wrapper'));
     add_filter('shopp_account_vieworder', array('Storefront', 'wrapper'));
     add_filter('the_content', array($this, 'autowrap'), 99);
     add_action('wp_enqueue_scripts', 'shopp_dependencies');
     add_action('shopp_storefront_init', array($this, 'account'));
     add_filter('wp_nav_menu_objects', array($this, 'menus'));
     // Maintenance mode overrides
     add_filter('search_template', array($this, 'maintenance'));
     add_filter('taxonomy_template', array($this, 'maintenance'));
     add_filter('page_template', array($this, 'maintenance'));
     add_filter('single_template', array($this, 'maintenance'));
     // Template rendering
     add_action('do_feed_rss2', array($this, 'feed'), 1);
     add_filter('search_template', array($this, 'pages'));
     add_filter('page_template', array($this, 'pages'));
     add_filter('archive_template', array($this, 'pages'));
     add_filter('taxonomy_template', array($this, 'collections'));
     add_filter('single_template', array($this, 'single'));
 }
Пример #3
0
 /**
  * Admin constructor
  *
  * @author Jonathan Davis
  * @since 1.1
  *
  * @return void
  **/
 public function __construct()
 {
     parent::__construct();
     $this->legacyupdate();
     // Dashboard widget support
     add_action('wp_dashboard_setup', array('ShoppAdminDashboard', 'init'));
     add_action('admin_init', array($this, 'updates'));
     add_action('admin_init', array($this, 'tinymce'));
     add_action('switch_theme', array($this, 'themepath'));
     add_filter('favorite_actions', array($this, 'favorites'));
     add_action('load-update.php', array($this, 'styles'));
     add_action('admin_menu', array($this, 'taxonomies'), 100);
     // WordPress theme menus
     add_action('load-nav-menus.php', array($this, 'navmenus'));
     add_action('wp_update_nav_menu_item', array($this, 'navmenu_items'));
     add_action('wp_setup_nav_menu_item', array($this, 'navmenu_setup'));
     add_filter('wp_dropdown_pages', array($this, 'storefront_pages'));
     add_filter('pre_update_option_page_on_front', array($this, 'frontpage'));
     $this->pages();
     global $wp_version;
     if (!(defined('MP6') && MP6) && version_compare($wp_version, '3.8', '<')) {
         $menucss = 'backmenu.css';
     } else {
         $menucss = 'menu.css';
     }
     wp_enqueue_style('shopp.menu', SHOPP_ADMIN_URI . '/styles/' . $menucss, array(), ShoppVersion::cache(), 'screen');
     // Set the currently requested page and menu
     if (isset($_GET['page']) && false !== strpos($_GET['page'], basename(SHOPP_PATH))) {
         $page = $_GET['page'];
     } else {
         return;
     }
     if (isset($this->pages[$page])) {
         $this->Page = $this->pages[$page];
     }
     if (isset($this->menus[$page])) {
         $this->menu = $this->menus[$page];
     }
 }