/** * {@inheritdoc} */ public function onInit() { parent::onInit(); $dispathcer = $this->getEnvironment()->getDispatcher(); $dispathcer->on('after_ui_loaded', array($this, 'afterUiLoaded')); $dispathcer->on('after_modules_loaded', array($this, 'afterModulesLoaded')); }
/** * {@inheritdoc} */ public function onInit() { parent::onInit(); $path = dirname(dirname(dirname(dirname(__FILE__)))); $url = plugins_url(basename($path)); $config = $this->getEnvironment()->getConfig(); $config->add('plugin_url', $url); $config->add('plugin_path', $path); add_filter('gg_hooks_prefix', array($this, 'addHooksPrefix'), 10, 1); }
/** * {@inheritdoc} */ public function onInit() { parent::onInit(); $config = $this->getEnvironment()->getConfig(); add_action('admin_enqueue_scripts', array($this, 'enqueueMedia')); add_action($config->get('hooks_prefix') . 'after_ui_loaded', array($this, 'loadAssets')); add_action('delete_attachment', array(new SupsysticSlider_Photos_Model_Photos($config->isEnvironment(Rsc_Environment::ENV_DEVELOPMENT)), 'deleteByAttachmentId')); add_action('grid_gallery_delete_folder', array(new SupsysticSlider_Photos_Model_Photos($config->isEnvironment(Rsc_Environment::ENV_DEVELOPMENT)), 'deleteByFolderId')); // Sets the JPEG quality. add_filter('jpeg_quality', array($this, 'getJpegQuality')); $dispatcher = $this->getEnvironment()->getDispatcher(); $dispatcher->on('ui_menu_items', array($this, 'registerMenuItem'), 2, 0); }
/** * {@inheritdoc} */ public function onInit() { parent::onInit(); $this->assets = new SupsysticSlider_Ui_AssetsCollection(); $this->preload(); $config = $this->getEnvironment()->getConfig(); add_action($config->get('hooks_prefix') . 'after_modules_loaded', array($this->assets, 'load')); add_action('admin_enqueue_scripts', array($this, 'menuAntiDuplicate')); add_action('admin_enqueue_scripts', array($this, 'colorpicker')); // Allows to sort menu items. $dispatcher = $this->getEnvironment()->getDispatcher(); $dispatcher->dispatch('ui_menu_items'); $this->getEnvironment()->getMenu()->register(); }
/** * {@inheritdoc} */ public function onInit() { parent::onInit(); $isDebugRequest = false; if ($this->getRequest()->query->has('debug')) { $isDebugRequest = $this->getRequest()->query->get('debug'); } /* We add additional menu item in the development environment */ if ($this->getEnvironment()->isDev() || (bool) $isDebugRequest) { $menu = $this->getEnvironment()->getMenu(); $submenu = $menu->createSubmenuItem(); $submenu->setCapability('manage_options')->setMenuSlug('supsystic-slider-developer')->setMenuTitle('Developer Mode')->setPageTitle('Developer Mode')->setModuleName('developer'); $menu->addSubmenuItem('developer', $submenu)->register(); if (version_compare(phpversion(), '5.3.0', '>=') && 'cli-server' === php_sapi_name()) { @class_alias('SupsysticSlider_Developer_Console', 'Debug'); } } }
/** * {@inheritdoc} */ public function onInit() { parent::onInit(); $isDebugRequest = false; if ($this->getRequest()->query->has('debug')) { $isDebugRequest = $this->getRequest()->query->get('debug'); } /* We add additional menu item in the development environment */ if ($this->getEnvironment()->isDev() || (bool) $isDebugRequest) { $menu = $this->getMenu(); $plugin_menu = $this->getConfig()->get('plugin_menu'); $capability = $plugin_menu['capability']; $submenu = $menu->createSubmenuItem(); $submenu->setCapability($capability)->setMenuSlug('grid-gallery-developer')->setMenuTitle('Developer Mode')->setPageTitle('Developer Mode')->setModuleName('developer'); $menu->addSubmenuItem('developer', $submenu)->register(); if (version_compare(phpversion(), '5.3.0', '>=') && 'cli-server' === php_sapi_name()) { @class_alias('GridGallery_Developer_Console', 'C'); } } }
/** * {@inheritdoc} */ public function onInit() { parent::onInit(); $config = $this->getEnvironment()->getConfig(); add_action('admin_enqueue_scripts', array($this, 'enqueueMedia')); add_action($config->get('hooks_prefix') . 'after_ui_loaded', array($this, 'loadAssets')); add_action('delete_attachment', array(new GridGallery_Photos_Model_Photos($config->isEnvironment(Rsc_Environment::ENV_DEVELOPMENT)), 'deleteByAttachmentId')); add_action('grid_gallery_delete_folder', array(new GridGallery_Photos_Model_Photos($config->isEnvironment(Rsc_Environment::ENV_DEVELOPMENT)), 'deleteByFolderId')); add_filter('wp_prepare_attachment_for_js', array($this, 'prepareAttachmentLinks')); // Sets the JPEG quality. add_filter('jpeg_quality', array($this, 'getJpegQuality')); //Uncomment this to enable images menu item /*$menu = $this->getEnvironment()->getMenu(); $submenu = $menu->createSubmenuItem(); $submenu->setCapability('manage_options') ->setMenuSlug('supsystic-gallery&module=photos&action=index') ->setMenuTitle('Images') ->setPageTitle('Images') ->setModuleName('photos'); $menu->addSubmenuItem('photos', $submenu)->register();*/ }
/** * {@inheritdoc} */ public function onInit() { parent::onInit(); add_action('wp_ajax_grid-gallery', array($this, 'handle')); }
public function onInstall() { parent::onInstall(); $registry = $this->getRegistry(); $registry->set('send_stats', 1); }
/** * {@inheritdoc} */ public function onInit() { parent::onInit(); $this->asset = new GridGallery_Ui_Assets($this); $this->preload(); }
/** * {@inheritdoc} */ public function onInit() { parent::onInit(); add_action($this->getSendHook(), array($this, 'send')); }
/** * {@inheritdoc} */ public function onInit() { parent::onInit(); add_action('wp_ajax_supsystic-slider', array($this, 'handle')); }
/** * {@inheritdoc} */ public function onInit() { parent::onInit(); add_action('gg_after_ui_loaded', array($this, 'load')); }