public function getAdminPage() { if (installerGmp::isUsed()) { return $this->getView()->getAdminPage(); } else { return frameGmp::_()->getModule('supsystic_promo')->showWelcomePage(); } }
public function getAdminPage() { if (!installerGmp::isUsed()) { frameGmp::_()->getModule('promo_ready')->showWelcomePage(); return; } $tabsData = array('gmpAllMaps' => array('title' => 'All Maps', 'content' => frameGmp::_()->getModule('gmap')->getMapsTab()), 'gmpMarkerList' => array('title' => 'Markers', 'content' => frameGmp::_()->getModule('marker')->getView()->showAllMarkers()), 'gmpMarkerGroups' => array('title' => 'Marker Groups', 'content' => $this->getMarkersGroupsTab()), 'gmpPluginSettings' => array('title' => 'Plugin Settings', 'content' => $this->getPluginSettingsTab())); $tabsData = dispatcherGmp::applyFilters('adminOptionsTabs', $tabsData); $indoWindowSize = utilsGmp::unserialize($this->getModel('options')->get('infowindow_size')); $defaultOpenTab = reqGmp::getVar('tab', 'get'); $this->assign('tabsData', $tabsData); $this->assign('indoWindowSize', $indoWindowSize); $this->assign('defaultOpenTab', $defaultOpenTab); parent::display('optionsAdminPage'); }
public function welcomePageSaveInfo() { $res = new responseGmp(); installerGmp::setUsed(); if ($this->getModel()->welcomePageSaveInfo(reqGmp::get('get'))) { $res->addMessage(__('Information was saved. Thank you!', GMP_LANG_CODE)); } else { $res->pushError($this->getModel()->getErrors()); } $originalPage = reqGmp::getVar('original_page'); $http = isset($_SERVER['HTTPS']) && !empty($_SERVER['HTTPS']) ? 'https://' : 'http://'; if (strpos($originalPage, $http . $_SERVER['HTTP_HOST']) !== 0) { $originalPage = ''; } redirectGmp($originalPage); }
public function welcomePageSaveInfo() { $res = new responseGmp(); // Start usage in any case installerGmp::setUsed(); if ($this->getModel()->welcomePageSaveInfo(reqGmp::get('get'))) { $res->addMessage(langGmp::_('Information was saved. Thank you!')); } else { $res->pushError($this->getModel()->getErrors()); } $originalPage = reqGmp::getVar('original_page'); //$returnArr = explode('|', $originalPage); //$return = $this->getModule()->decodeSlug(str_replace('return=', '', $returnArr[1])); $return = admin_url(strpos($originalPage, '?') ? $return : 'admin.php?page=' . $originalPage); // Start usage in any case redirectGmp($return); //return $res->ajaxExec(); }
importClassGmp('helperGmp'); importClassGmp('dispatcherGmp'); importClassGmp('fieldGmp'); importClassGmp('tableGmp'); importClassGmp('frameGmp'); /** * @deprecated since version 1.0.1 */ importClassGmp('langGmp'); importClassGmp('reqGmp'); importClassGmp('uriGmp'); importClassGmp('htmlGmp'); importClassGmp('responseGmp'); importClassGmp('fieldAdapterGmp'); importClassGmp('validatorGmp'); importClassGmp('errorsGmp'); importClassGmp('utilsGmp'); importClassGmp('modInstallerGmp'); importClassGmp('installerDbUpdaterGmp'); importClassGmp('dateGmp'); /** * Check plugin version - maybe we need to update database, and check global errors in request */ installerGmp::update(); errorsGmp::init(); /** * Start application */ frameGmp::_()->parseRoute(); frameGmp::_()->init(); frameGmp::_()->exec();
public static function deactivatePlugin() { global $wpdb; if (function_exists('is_multisite') && is_multisite()) { $orig_id = $wpdb->blogid; $blog_id = $wpdb->get_col("SELECT blog_id FROM {$wpdb->blogs}"); foreach ($blog_id as $id) { if (switch_to_blog($id)) { installerGmp::deactivate(); } } switch_to_blog($orig_id); return; } else { installerGmp::deactivate(); } }
public function addWelcomePageToMainMenu($option) { $firstTimeLookedToPlugin = !installerGmp::isUsed(); if ($firstTimeLookedToPlugin) { $option = $this->_getWelcomMessageMenuData($option, false); } return $option; }
public function showWelcomePage() { $firstTimeLookedToPlugin = !installerGmp::isUsed(); if ($firstTimeLookedToPlugin) { $this->getView()->showWelcomePage(); } }