/** Displays the page. */ public function display() { $this->wp->wpEnqueueScript('common'); $this->wp->wpEnqueueScript('wp-lists'); $this->wp->wpEnqueueScript('postbox'); Styles::add('wp-jquery-ui'); $this->wp->addMetaBox('jigoshop_dashboard_right_now', __('<span>Shop</span> Content', 'jigoshop'), array($this, 'rightNow'), 'jigoshop', 'side', 'core'); $this->wp->addMetaBox('jigoshop_dashboard_recent_orders', __('<span>Recent</span> Orders', 'jigoshop'), array($this, 'recentOrders'), 'jigoshop', 'side', 'core'); if ($this->options->get('products.manage_stock')) { $this->wp->addMetaBox('jigoshop_dashboard_stock_report', __('<span>Stock</span> Report', 'jigoshop'), array($this, 'stockReport'), 'jigoshop', 'side', 'core'); } $this->wp->addMetaBox('jigoshop_dashboard_monthly_report', __('<span>Monthly</span> Report', 'jigoshop'), array($this, 'monthlyReport'), 'jigoshop', 'normal', 'core'); $this->wp->addMetaBox('jigoshop_dashboard_recent_reviews', __('<span>Recent</span> Reviews', 'jigoshop'), array($this, 'recentReviews'), 'jigoshop', 'normal', 'core'); $this->wp->addMetaBox('jigoshop_dashboard_latest_news', __('<span>Latest</span> News', 'jigoshop'), array($this, 'latestNews'), 'jigoshop', 'normal', 'core'); $this->wp->addMetaBox('jigoshop_dashboard_useful_links', __('<span>Useful</span> Links', 'jigoshop'), array($this, 'usefulLinks'), 'jigoshop', 'normal', 'core'); $submenu = $this->wp->getSubmenu(); Render::output('admin/dashboard', array('submenu' => $submenu)); }
public function __construct(Wordpress $wp, Options $options, Messages $messages, Template $template, $widgets = array()) { $this->wp = $wp; $this->options = $options; $this->messages = $messages; $this->template = $template; $this->widgets = $widgets; // Register main Jigoshop scripts $wp->wpEnqueueScript('jquery'); Styles::register('jigoshop.shop', \JigoshopInit::getUrl() . '/assets/css/shop.css'); Styles::register('prettyphoto', \JigoshopInit::getUrl() . '/assets/css/prettyPhoto.css'); Styles::register('tokenfield', \JigoshopInit::getUrl() . '/assets/css/vendors/tokenfield.css'); Scripts::register('jigoshop.helpers', \JigoshopInit::getUrl() . '/assets/js/helpers.js', array('jquery')); Scripts::register('jigoshop.helpers.ajax_search', \JigoshopInit::getUrl() . '/assets/js/helpers/ajax_search.js', array('jigoshop.helpers')); Scripts::register('jigoshop.helpers.payment', \JigoshopInit::getUrl() . '/assets/js/helpers/payment.js', array('jigoshop.helpers', 'jquery-blockui')); Scripts::register('jigoshop.api', \JigoshopInit::getUrl() . '/assets/js/api.js', array('jigoshop.helpers')); Scripts::register('jigoshop.media', \JigoshopInit::getUrl() . '/assets/js/media.js', array('jquery')); Scripts::register('jigoshop.shop', \JigoshopInit::getUrl() . '/assets/js/shop.js', array('jquery', 'jigoshop.helpers')); Scripts::register('jquery-blockui', '//cdnjs.cloudflare.com/ajax/libs/jquery.blockUI/2.66.0-2013.10.09/jquery.blockUI.min.js', array('jquery')); Scripts::register('prettyphoto', \JigoshopInit::getUrl() . '/assets/js/jquery.prettyPhoto.js'); Scripts::register('tokenfield', \JigoshopInit::getUrl() . '/assets/js/vendors/tokenfield.js', array('jquery')); Scripts::localize('jigoshop.helpers', 'jigoshop_helpers', array('assets' => \JigoshopInit::getUrl() . '/assets', 'ajaxUrl' => admin_url('admin-ajax.php'))); }