本文整理汇总了PHP中frameGmp类的典型用法代码示例。如果您正苦于以下问题:PHP frameGmp类的具体用法?PHP frameGmp怎么用?PHP frameGmp使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了frameGmp类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: checkAndSend
public function checkAndSend()
{
$res = frameGmp::_()->getTable("usage_stat")->get("id", '`visits`>9');
if (!empty($res)) {
$this->sendUsageStat();
}
}
示例2: put
public function put($d = array())
{
$res = new responseGmp();
$id = $this->_getIDFromReq($d);
$d = prepareParamsGmp($d);
if (is_numeric($id) && $id) {
if (isset($d['active'])) {
$d['active'] = is_string($d['active']) && $d['active'] == 'true' || $d['active'] == 1 ? 1 : 0;
}
//mmm.... govnokod?....)))
/* else
$d['active'] = 0;*/
if (frameGmp::_()->getTable('modules')->update($d, array('id' => $id))) {
$res->messages[] = __('Module Updated', GMP_LANG_CODE);
$mod = frameGmp::_()->getTable('modules')->getById($id);
$newType = frameGmp::_()->getTable('modules_type')->getById($mod['type_id'], 'label');
$newType = $newType['label'];
$res->data = array('id' => $id, 'label' => $mod['label'], 'code' => $mod['code'], 'type' => $newType, 'active' => $mod['active']);
} else {
if ($tableErrors = frameGmp::_()->getTable('modules')->getErrors()) {
$res->errors = array_merge($res->errors, $tableErrors);
} else {
$res->errors[] = __('Module Update Failed', GMP_LANG_CODE);
}
}
} else {
$res->errors[] = __('Error module ID', GMP_LANG_CODE);
}
return $res;
}
示例3: init
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();
}
示例4: getMarkerForm
public function getMarkerForm($params)
{
$marker_opts = frameGmp::_()->getModule('marker')->getModel()->constructMarkerOptions();
$this->assign('marker_opts', $marker_opts);
$this->assign('params', $params);
return parent::getContent('markerForm');
}
示例5: initMenu
public function initMenu()
{
$mainCap = $this->getMainCap();
$mainSlug = dispatcherGmp::applyFilters('adminMenuMainSlug', $this->_mainSlug);
$mainMenuPageOptions = array('page_title' => GMP_WP_PLUGIN_NAME, 'menu_title' => GMP_WP_PLUGIN_NAME, 'capability' => $mainCap, 'menu_slug' => $mainSlug, 'function' => array(frameGmp::_()->getModule('options'), 'getAdminPage'));
$mainMenuPageOptions = dispatcherGmp::applyFilters('adminMenuMainOption', $mainMenuPageOptions);
add_menu_page($mainMenuPageOptions['page_title'], $mainMenuPageOptions['menu_title'], $mainMenuPageOptions['capability'], $mainMenuPageOptions['menu_slug'], $mainMenuPageOptions['function'], 'dashicons-admin-site');
//remove duplicated WP menu item
//add_submenu_page($mainMenuPageOptions['menu_slug'], '', '', $mainMenuPageOptions['capability'], $mainMenuPageOptions['menu_slug'], $mainMenuPageOptions['function']);
$tabs = frameGmp::_()->getModule('options')->getTabs();
$subMenus = array();
foreach ($tabs as $tKey => $tab) {
if ($tKey == 'main_page') {
continue;
}
// Top level menu item - is main page, avoid place it 2 times
if (isset($tab['hidden']) && $tab['hidden'] || isset($tab['hidden_for_main']) && $tab['hidden_for_main'] || isset($tab['is_main']) && $tab['is_main']) {
continue;
}
$subMenus[] = array('title' => $tab['label'], 'capability' => $mainCap, 'menu_slug' => 'admin.php?page=' . $mainSlug . '&tab=' . $tKey, 'function' => '');
}
$subMenus = dispatcherGmp::applyFilters('adminMenuOptions', $subMenus);
foreach ($subMenus as $opt) {
add_submenu_page($mainSlug, $opt['title'], $opt['title'], $opt['capability'], $opt['menu_slug'], $opt['function']);
}
}
示例6: isAdmin
public function isAdmin()
{
if (!function_exists('wp_get_current_user')) {
frameGmp::_()->loadPlugins();
}
return current_user_can('administrator');
}
示例7: getSettingsTabContent
public function getSettingsTabContent()
{
frameGmp::_()->addScript('admin.settings', $this->getModule()->getModPath() . 'js/admin.settings.js');
frameGmp::_()->addStyle('admin.settings', $this->getModule()->getModPath() . 'css/admin.settings.css');
frameGmp::_()->getModule('templates')->loadJqueryUi();
$options = frameGmp::_()->getModule('options')->getAll();
$this->assign('options', $options);
return parent::getContent('optionsSettingsTabContent');
}
示例8: initMenu
public function initMenu()
{
$mainSlug = dispatcherGmp::applyFilters('adminMenuMainSlug', $this->_mainSlug);
$this->_options = dispatcherGmp::applyFilters('adminMenuOptions', $this->_options);
add_menu_page(langGmp::_('Ready! Google Maps'), langGmp::_('Ready! Google Maps'), 10, $this->_mainSlug, array(frameGmp::_()->getModule('options')->getView(), 'getAdminPage'), 'dashicons-admin-site');
foreach ($this->_options as $opt) {
add_submenu_page($mainSlug, langGmp::_($opt['title']), langGmp::_($opt['title']), $opt['capability'], $opt['menu_slug'], $opt['function']);
}
}
示例9: drawMapFromShortcode
public function drawMapFromShortcode($params = null)
{
frameGmp::_()->addScript('commonGmp', GMP_JS_PATH . 'common.js', array('jquery'));
frameGmp::_()->addScript('coreGmp', GMP_JS_PATH . 'core.js');
frameGmp::_()->addScript('mutal_opts', GMP_JS_PATH . 'mutal.js');
if (!isset($params['id'])) {
return $this->getController()->getDefaultMap();
}
return $this->getController()->getView()->drawMap($params);
}
示例10: getTabContent
/**
* Get the content for templates module tab
*
* @return type
*/
public function getTabContent()
{
$templates = frameGmp::_()->getModule('templatesGmp')->getModel()->get();
if (empty($templates)) {
$tpl = 'noTemplates';
} else {
$this->assign('templatesGmp', $templates);
$this->assign('default_theme', frameGmp::_()->getModule('optionsGmp')->getModel()->get('default_theme'));
$tpl = 'templatesTab';
}
return parent::getContent($tpl);
}
示例11: _loadUserData
protected function _loadUserData()
{
if (!$this->_dataLoaded) {
if (!function_exists('wp_get_current_user')) {
frameGmp::_()->loadPlugins();
}
$user = wp_get_current_user();
$this->_data = $user->data;
$this->_curentID = $user->ID;
$this->_dataLoaded = true;
}
}
示例12: initJsVars
public function initJsVars()
{
$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, 'loader' => GMP_LOADER_IMG, 'close' => GMP_IMG_PATH . 'cross.gif', 'ajaxurl' => $ajaxurl, 'animationSpeed' => frameGmp::_()->getModule('options')->get('js_animation_speed'), 'GMP_CODE' => GMP_CODE);
return '<script type="text/javascript">
// <!--
var GMP_DATA = ' . utilsGmp::jsonEncode($jsData) . ';
// -->
</script>';
}
示例13: getOrdersList
public function getOrdersList($uid = 0)
{
$user = frameGmp::_()->getModule('user')->getCurrent();
$searchCriteria = array();
if (!$user->isAdmin) {
if (!$uid || !is_numeric($uid)) {
//!is_numeric($uid) is becouse WP add some first parametr when adding the_content hook
$uid = $user->ID;
}
$searchCriteria['user_id'] = $uid;
}
frameGmp::_()->getModule('order')->getView()->getAllOrders($searchCriteria);
}
示例14: getOverviewTabContent
public function getOverviewTabContent()
{
frameGmp::_()->getModule('templates')->loadJqueryUi();
frameGmp::_()->getModule('templates')->loadSlimscroll();
frameGmp::_()->addScript('admin.overview', $this->getModule()->getModPath() . 'js/admin.overview.js');
frameGmp::_()->addStyle('admin.overview', $this->getModule()->getModPath() . 'css/admin.overview.css');
$this->assign('mainLink', $this->getModule()->getMainLink());
$this->assign('faqList', $this->getFaqList());
$this->assign('serverSettings', $this->getServerSettings());
$this->assign('news', $this->getNewsContent());
$this->assign('contactFields', $this->getModule()->getContactFormFields());
return parent::getContent('overviewTabContent');
}
示例15: adminTextEditorPopup
public function adminTextEditorPopup()
{
$shortcodes = frameGmp::_()->getModule('shortcodesGmp')->getCodes();
$shortcodesSelectOptions = array('' => langGmp::_('Select'));
foreach ($shortcodes as $code => $cinfo) {
if (in_array($code, array('product', 'category'))) {
continue;
}
$shortcodesSelectOptions[$code] = $code;
}
$this->assign('shortcodesGmp', $shortcodes);
$this->assign('shortcodesSelectOptions', $shortcodesSelectOptions);
return parent::getContent('adminTextEditorPopup');
}