Exemplo n.º 1
0
 public function init()
 {
     parent::init();
     $this->getController()->getView('adminmenu')->init();
     $plugName = plugin_basename(GMP_DIR . GMP_MAIN_FILE);
     add_filter('plugin_action_links_' . $plugName, array($this, 'addSettingsLinkForPlug'));
 }
Exemplo n.º 2
0
 public function init()
 {
     if (frameGmp::isAdminPlugPage()) {
         $this->_styles = array('styleGmp' => array('path' => GMP_CSS_PATH . 'style.css'), 'adminStylesGmp' => array('path' => GMP_CSS_PATH . 'adminStyles.css'), 'farbtastic' => array(), 'wp-jquery-ui-dialog' => array(), 'jquery-dialog' => array('path' => GMP_CSS_PATH . 'jquery-dialog.css'));
     }
     $defaultPlugTheme = frameGmp::_()->getModule('options')->get('default_theme');
     $ajaxurl = admin_url('admin-ajax.php');
     if (frameGmp::_()->getModule('options')->get('ssl_on_ajax')) {
         $ajaxurl = uriGmp::makeHttps($ajaxurl);
     }
     $jsData = array('siteUrl' => GMP_SITE_URL, 'imgPath' => GMP_IMG_PATH, 'cssPath' => GMP_CSS_PATH, 'loader' => GMP_LOADER_IMG, 'close' => GMP_IMG_PATH . 'cross.gif', 'ajaxurl' => $ajaxurl, 'animationSpeed' => frameGmp::_()->getModule('options')->get('js_animation_speed'), 'siteLang' => langGmp::getData(), 'options' => frameGmp::_()->getModule('options')->getAllowedPublicOptions(), 'GMP_CODE' => GMP_CODE, 'ball_loader' => GMP_IMG_PATH . 'ajax-loader-ball.gif', 'ok_icon' => GMP_IMG_PATH . 'ok-icon.png', 'isHttps' => uriGmp::isHttps());
     if (frameGmp::isAdminPlugPage()) {
         frameGmp::_()->addScript('commonGmp', GMP_JS_PATH . 'common.js');
         frameGmp::_()->addScript('coreGmp', GMP_JS_PATH . 'core.js');
         $jsData = dispatcherGmp::applyFilters('jsInitVariables', $jsData);
         frameGmp::_()->addJSVar('coreGmp', 'GMP_DATA', $jsData);
         frameGmp::_()->addScript('datatable', GMP_JS_PATH . 'jquery.dataTables.min.js');
         frameGmp::_()->addScript('farbtastic', get_bloginfo('wpurl') . '/wp-admin/js/farbtastic.js', array('jquery'));
         frameGmp::_()->addScript('jquery-ui-tabs', '', array('jquery'), false, true);
         frameGmp::_()->addScript('jquery-ui-autocomplete', '', array('jquery'), false, true);
         frameGmp::_()->getModule('marker')->connectAssets();
         frameGmp::_()->addScript('jquery-ui-dialog', '', array('jquery'));
         frameGmp::_()->addScript('adminOptionsGmp', GMP_JS_PATH . 'admin.options.js');
     }
     if (is_admin()) {
         frameGmp::_()->addScript('ajaxupload', GMP_JS_PATH . 'ajaxupload.js');
         frameGmp::_()->addScript('postbox', get_bloginfo('wpurl') . '/wp-admin/js/postbox.js');
         add_action('wp_enqueue_scripts', array($this, 'addThickbox'));
         $jsData['allCheckRegPlugs'] = modInstallerGmp::getCheckRegPlugs();
     } else {
     }
     foreach ($this->_styles as $s => $sInfo) {
         if (isset($sInfo['for'])) {
             if ($sInfo['for'] == 'frontend' && is_admin() || $sInfo['for'] == 'admin' && !is_admin()) {
                 continue;
             }
         }
         $canBeSubstituted = true;
         if (isset($sInfo['substituteFor'])) {
             switch ($sInfo['substituteFor']) {
                 case 'frontend':
                     $canBeSubstituted = !is_admin();
                     break;
                 case 'admin':
                     $canBeSubstituted = is_admin();
                     break;
             }
         }
         if ($canBeSubstituted && file_exists(GMP_TEMPLATES_DIR . $defaultPlugTheme . DS . $s . '.css')) {
             frameGmp::_()->addStyle($s, GMP_TEMPLATES_PATH . $defaultPlugTheme . '/' . $s . '.css');
         } elseif ($canBeSubstituted && file_exists(utilsGmp::getCurrentWPThemeDir() . 'gmp' . DS . $s . '.css')) {
             frameGmp::_()->addStyle($s, utilsGmp::getCurrentWPThemePath() . '/toe/' . $s . '.css');
         } elseif (!empty($sInfo['path'])) {
             frameGmp::_()->addStyle($s, $sInfo['path']);
         } else {
             frameGmp::_()->addStyle($s);
         }
     }
     parent::init();
 }
Exemplo n.º 3
0
 public function init()
 {
     parent::init();
     add_action('admin_menu', array($this, 'initMenu'), 9);
     $plugName = plugin_basename(GMP_DIR . GMP_MAIN_FILE);
     add_filter('plugin_action_links_' . $plugName, array($this, 'addSettingsLinkForPlug'));
 }
Exemplo n.º 4
0
 public function init()
 {
     parent::init();
     $this->getModel()->checkDefIcons();
     /*if(frameGmp::_()->isAdminPlugPage()){
     			$gmpExistsIcons = $this->getModel()->getIcons();
     			frameGmp::_()->addJSVar('iconOpts', 'gmpExistsIcons', $gmpExistsIcons);
     			frameGmp::_()->addScript('iconOpts', $this->getModPath() .'js/iconOpts.js');			
     		}*/
 }
Exemplo n.º 5
0
 public function init()
 {
     parent::init();
     add_action('admin_footer', array($this, 'displayAdminFooter'), 9);
     if (is_admin()) {
         $this->checkStatisticStatus();
     }
     $this->weLoveYou();
     dispatcherGmp::addFilter('mainAdminTabs', array($this, 'addAdminTab'));
     dispatcherGmp::addAction('beforeSaveOpts', array($this, 'checkSaveOpts'));
     dispatcherGmp::addAction('addMapBottomControls', array($this, 'checkWeLoveYou'), 99);
     add_action('admin_notices', array($this, 'checkAdminPromoNotices'));
 }
Exemplo n.º 6
0
 public function init()
 {
     if (is_admin()) {
         if ($isAdminPlugOptsPage = frameGmp::_()->isAdminPlugOptsPage()) {
             $this->loadCoreJs();
             $this->loadAdminCoreJs();
             $this->loadCoreCss();
             $this->loadJqueryUi();
             //$this->loadChosenSelects();
             frameGmp::_()->addScript('adminOptionsGmp', GMP_JS_PATH . 'admin.options.js', array(), false, true);
             add_action('admin_enqueue_scripts', array($this, 'loadMediaScripts'));
         }
         // Some common styles - that need to be on all admin pages - be careful with them
         frameGmp::_()->addStyle('supsystic-for-all-admin-' . GMP_CODE, GMP_CSS_PATH . 'supsystic-for-all-admin.css');
     }
     parent::init();
 }
Exemplo n.º 7
0
 public function init()
 {
     parent::init();
     dispatcherGmp::addFilter('templatesListToAdminTab', array($this, 'addPromoTemplates'));
     dispatcherGmp::addFilter('adminOptModulesList', array($this, 'addPromoPayments'));
     add_action('admin_footer', array($this, 'displayAdminFooter'), 9);
     dispatcherGmp::addFilter('adminMenuOptions', array($this, 'addWelcomePageToMenus'), 99);
     dispatcherGmp::addFilter('adminMenuMainOption', array($this, 'addWelcomePageToMainMenu'), 99);
     dispatcherGmp::addFilter('adminMenuMainSlug', array($this, 'modifyMainAdminSlug'), 99);
     dispatcherGmp::addAction(implode('', array('ad', 'd', 'M', 'ap', 'B', 'ot', 't', 'o', 'mC', 'o', 'n', 'tr', 'o', 'ls')), array($this, 'weLoveYou'));
     dispatcherGmp::addAction('editMapFormProButtons', array($this, 'showProAdminPromoButtons'));
     dispatcherGmp::addAction('editMapFormEnd', array($this, 'showProAdminFormEndPromo'));
     dispatcherGmp::addAction('underMapAdminFormData', array($this, 'printUnderMapAdminFormData'));
     /*
      * Check and send statistic
      */
     $this->checkStatisticStatus();
 }
Exemplo n.º 8
0
 public function init()
 {
     parent::init();
     add_action('widgets_init', array($this, 'registerWidget'));
 }
Exemplo n.º 9
0
 public function install()
 {
     parent::install();
     frameGmp::_()->getTable('marker_groups')->insert(array('title' => 'Default', 'description' => 'Default'));
 }