Esempio n. 1
0
 public function __construct()
 {
     $this->_table = '@__subscribers';
     $this->_id = 'id';
     $this->_alias = 'toe_subscr';
     $this->_addField('user_id', 'text', 'int', '', langGmp::_('User Id'), 11, '', '', langGmp::_('User Id'))->_addField('email', 'text', 'varchar', '', langGmp::_('User E-mail'), 255, '', '', langGmp::_('Subscriber E-mail'))->_addField('name', 'text', 'varchar', 0, langGmp::_('User Name'), 255, '', '', langGmp::_('User Name If User Is Registered'))->_addField('created', 'text', 'datetime', '', langGmp::_('Subscription Date'), '', '', '', langGmp::_('Date Of Subscription'))->_addField('active', 'checkbox', 'tinyint', '', langGmp::_('Active Subscription'), 4, '', '', langGmp::_('If Is Not Checked user will not get any newsletters'))->_addField('token', 'hidden', 'varchar', '', langGmp::_('Token'), 255, '', '', '')->_addField('ip', 'hidden', 'varchar', '', langGmp::_('IP address'), 64, '', '', '');
 }
Esempio n. 2
0
 public function showProAdminPromoButtons()
 {
     $modPath = $this->getModule()->getModPath();
     $listAvailableDirectionsViews = array(6 => array('label' => 'Slider mini'), 4 => array('label' => 'First Table'), 1 => array('label' => 'Second Table'));
     foreach ($listAvailableDirectionsViews as $id => $v) {
         $listAvailableDirectionsViews[$id]['prev_img'] = $modPath . 'img/prev_marker_list/' . $id . '.jpg';
     }
     $listAvailableCustomControls = array('simple' => array('label' => langGmp::_('Simple')), 'pro_search' => array('label' => langGmp::_('PRO Search')), 'ultra' => array('label' => langGmp::_('Ultra')));
     foreach ($listAvailableCustomControls as $c => $data) {
         $listAvailableCustomControls[$c]['code'] = $c;
         $listAvailableCustomControls[$c]['prev_img'] = $modPath . 'img/prev_cust_map_controls/' . $c . '.jpg';
     }
     $fetchStyles = array('Bentley' => array(), 'Icy Blue' => array(), 'Snazzy Maps' => array(), 'Subtle' => array(), 'Apple Maps' => array(), 'Neutral Blue' => array(), 'Shift Worker' => array(), 'Subtle Grayscale' => array(), 'Pale Dawn' => array(), 'Blue water' => array(), 'Midnight Commander' => array(), 'Retro' => array());
     $stylesList = array();
     foreach ($fetchStyles as $label => $sData) {
         $code = str_replace(' ', '-', $label);
         $stylesList[$code] = $sData;
         $stylesList[$code]['code'] = $code;
         $stylesList[$code]['label'] = $label;
         $stylesList[$code]['prev_img'] = $modPath . 'img/prev_styles/' . $code . '.jpg';
     }
     $this->assign('listAvailableDirectionsViews', $listAvailableDirectionsViews);
     $this->assign('listAvailableCustomControls', $listAvailableCustomControls);
     $this->assign('stylesList', $stylesList);
     $this->assign('proLink', $this->_gmapProdLink);
     $this->assign('modPath', $modPath);
     parent::display('proAdminPromoButtons');
 }
Esempio n. 3
0
 public function __construct()
 {
     $this->_table = '@__files';
     $this->_id = 'id';
     $this->_alias = 'toe_f';
     $this->_addField('pid', 'hidden', 'int', '', langGmp::_('Product ID'))->_addField('name', 'text', 'varchar', '255', langGmp::_('File name'))->_addField('path', 'hidden', 'text', '', langGmp::_('Real Path To File'))->_addField('mime_type', 'text', 'varchar', '32', langGmp::_('Mime Type'))->_addField('size', 'text', 'int', 0, langGmp::_('File Size'))->_addField('active', 'checkbox', 'tinyint', 0, langGmp::_('Active Download'))->_addField('date', 'text', 'datetime', '', langGmp::_('Upload Date'))->_addField('download_limit', 'text', 'int', '', langGmp::_('Download Limit'))->_addField('period_limit', 'text', 'int', '', langGmp::_('Period Limit'))->_addField('description', 'textarea', 'text', 0, langGmp::_('Descritpion'))->_addField('type_id', 'text', 'int', '', langGmp::_('Type ID'));
 }
Esempio n. 4
0
 public function __construct()
 {
     $this->_table = '@__email_templates';
     $this->_id = 'id';
     $this->_alias = 'toe_etpl';
     $this->_addField('label', 'text', 'varchar', '', langGmp::_('Label'), 128, '', '', langGmp::_('Template label'))->_addField('subject', 'textarea', 'varchar', '', langGmp::_('Subject'), 255, '', '', langGmp::_('E-mail Subject'))->_addField('body', 'textarea', 'text', '', langGmp::_('Body'), '', '', '', langGmp::_('E-mail Body'))->_addField('variables', 'block', 'text', '', langGmp::_('Variables'), '', '', '', langGmp::_('Template variables. They can be used in the body and subject'))->_addField('active', 'checkbox', 'tinyint', 0, langGmp::_('Active'), '', '', '', langGmp::_('If checked the notifications will be sent to receiver'))->_addField('name', 'hidden', 'varchar', '', '', 128)->_addField('moduleGmp', 'hidden', 'varchar', '', '', 128);
 }
Esempio n. 5
0
 public function sendUsageStat()
 {
     $res = new responseGmp();
     $this->getModel()->sendUsageStat();
     $res->addMessage(langGmp::_('Information was saved. Thank you for your support!'));
     return $res->ajaxExec();
 }
Esempio n. 6
0
 public function __construct()
 {
     $this->_table = '@__markers';
     $this->_id = 'id';
     $this->_alias = 'toe_mr';
     $this->_addField('id', 'int', 'int', '11', langGmp::_('Map ID'))->_addField('title', 'varchar', 'varchar', '255', langGmp::_('File name'))->_addField('description', 'text', 'text', '', langGmp::_('Description Of Map'))->_addField('coord_x', 'varchar', 'varchar', '50', langGmp::_('X coordinate if marker(lng)'))->_addField('coord_y', 'varchar', 'varchar', '50', langGmp::_('Y coordinate of marker(lat)'))->_addField('icon', 'varchar', 'varchar', '255', langGmp::_('Path of icon file'))->_addField('map_id', 'int', 'int', '11', langGmp::_('Map Id'))->_addField('address', 'text', 'text', '', langGmp::_('Marker Address'))->_addField('marker_group_id', 'int', 'int', '11', langGmp::_("Id of Marker's group"))->_addField('adnimation', 'int', 'int', '0', langGmp::_('Animation'))->_addField('params', 'text', 'text', '', langGmp::_('Params'))->_addField('create_date', 'datetime', 'datetime', '', langGmp::_('Creation date'));
 }
Esempio n. 7
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();
 }
Esempio n. 8
0
 public function __construct()
 {
     $this->_table = '@__maps';
     $this->_id = 'id';
     $this->_alias = 'toe_m';
     $this->_addField('id', 'int', 'int', '11', langGmp::_('Map ID'))->_addField('title', 'varchar', 'varchar', '255', langGmp::_('File name'))->_addField('description', 'text', 'text', '', langGmp::_('Description Of Map'))->_addField('html_options', 'text', 'text', '', langGmp::_('Html Parametrs'))->_addField('create_date', 'datetime', 'datetime', '', langGmp::_('Create Date'))->_addField('params', 'text', 'text', '', langGmp::_('Additional Params'));
 }
Esempio n. 9
0
 public function __construct()
 {
     $this->_table = '@__marker_groups';
     $this->_id = 'id';
     $this->_alias = 'gmp_mrgr';
     $this->_addField('id', 'int', 'int', '11', langGmp::_('Map ID'))->_addField('title', 'varchar', 'varchar', '255', langGmp::_('File name'))->_addField('description', 'text', 'text', '', langGmp::_('Description Of Map'));
 }
Esempio n. 10
0
 public function __construct()
 {
     $this->_table = '@__usage_stat';
     $this->_id = 'id';
     $this->_alias = 'gmp_icons';
     $this->_addField('id', 'int', 'int', '11', langGmp::_('Usage id'))->_addField('code', 'varchar', 'varchar', '200', langGmp::_('Code'))->_addField('visits', 'int', 'int', '11', langGmp::_('Visits Count'));
 }
Esempio n. 11
0
 public function __construct()
 {
     $this->_table = '@__icons';
     $this->_id = 'id';
     $this->_alias = 'gmp_icons';
     $this->_addField('id', 'int', 'int', '11', langGmp::_('Icon ID'))->_addField('title', 'varchar', 'varchar', '100', langGmp::_('Icon Title'))->_addField('description', 'description', 'text', '', langGmp::_('Icon Description'))->_addField('path', 'varchar', 'varchar', '255', langGmp::_('File Path'));
 }
Esempio n. 12
0
 public function __construct()
 {
     $this->_table = '@__options_categories';
     $this->_id = 'id';
     $this->_alias = 'toe_opt_cats';
     $this->_addField('id', 'hidden', 'int', 0, langGmp::_('ID'))->_addField('label', 'text', 'varchar', 0, langGmp::_('Method'), 128);
 }
Esempio n. 13
0
 public function __construct()
 {
     $this->_table = '@__htmltype';
     $this->_id = 'id';
     $this->_alias = 'toe_htmlt';
     $this->_addField('id', 'hidden', 'int', 0, langGmp::_('ID'))->_addField('label', 'text', 'varchar', 0, langGmp::_('Method'), 32)->_addField('description', 'text', 'varchar', 0, langGmp::_('Description'), 255);
 }
Esempio n. 14
0
 public function __construct()
 {
     $this->_table = '@__access';
     $this->_id = 'id';
     /*Let's associate it with posts*/
     $this->_alias = 'toe_acc';
     $this->_addField('id', 'text', 'int', 0, langGmp::_('ID'))->_addField('access', 'text', 'varchar', '', langGmp::_('Access'), 64)->_addField('type_access', 'text', 'tinyint', '', langGmp::_('Type_access'), 1);
 }
Esempio n. 15
0
 public function __construct()
 {
     $this->_table = '@__options';
     $this->_id = 'id';
     /*Let's associate it with posts*/
     $this->_alias = 'toe_opt';
     $this->_addField('id', 'text', 'int', 0, langGmp::_('ID'))->_addField('code', 'text', 'varchar', '', langGmp::_('Code'), 64)->_addField('value', 'text', 'varchar', '', langGmp::_('Value'), 134217728)->_addField('label', 'text', 'varchar', '', langGmp::_('Label'), 255)->_addField('params', 'text', 'text', '', langGmp::_('Params'))->_addField('description', 'text', 'text', '', langGmp::_('Description'))->_addField('htmltype_id', 'selectbox', 'text', '', langGmp::_('Type'))->_addField('cat_id', 'hidden', 'int', '', langGmp::_('Category ID'))->_addField('sort_order', 'hidden', 'int', '', langGmp::_('Sort Order'))->_addField('value_type', 'hidden', 'varchar', '', langGmp::_('Value Type'));
 }
Esempio n. 16
0
 public function __construct()
 {
     $this->_table = '@__modules';
     $this->_id = 'id';
     /*Let's associate it with posts*/
     $this->_alias = 'toe_m';
     $this->_addField('label', 'text', 'varchar', 0, langGmp::_('Label'), 128)->_addField('type_id', 'selectbox', 'smallint', 0, langGmp::_('Type'))->_addField('active', 'checkbox', 'tinyint', 0, langGmp::_('Active'))->_addField('params', 'textarea', 'text', 0, langGmp::_('Params'))->_addField('has_tab', 'checkbox', 'tinyint', 0, langGmp::_('Has Tab'))->_addField('description', 'textarea', 'text', 0, langGmp::_('Description'), 128)->_addField('code', 'hidden', 'varchar', '', langGmp::_('Code'), 64)->_addField('ex_plug_dir', 'hidden', 'varchar', '', langGmp::_('External plugin directory'), 255);
 }
Esempio n. 17
0
 public function __construct()
 {
     $this->_table = '@__log';
     $this->_id = 'id';
     /*Let's associate it with posts*/
     $this->_alias = 'toe_log';
     $this->_addField('id', 'text', 'int', 0, langGmp::_('ID'), 11)->_addField('type', 'text', 'varchar', '', langGmp::_('Type'), 64)->_addField('data', 'text', 'text', '', langGmp::_('Data'))->_addField('date_created', 'text', 'int', '', langGmp::_('Date created'))->_addField('uid', 'text', 'int', 0, langGmp::_('User ID'))->_addField('oid', 'text', 'int', 0, langGmp::_('Order ID'));
 }
Esempio n. 18
0
 public function __construct()
 {
     $this->_table = '@__modules_type';
     $this->_id = 'id';
     /*Let's associate it with posts*/
     $this->_alias = 'toe_m_t';
     $this->_addField($this->_id, 'text', 'int', '', langGmp::_('ID'))->_addField('label', 'text', 'varchar', '', langGmp::_('Label'), 128);
 }
Esempio n. 19
0
 /**
  * Returns the available tabs
  * 
  * @return array of tab 
  */
 public function getTabs()
 {
     $tabs = array();
     $tab = new tabGmp(langGmp::_('General'), $this->getCode());
     $tab->setView('optionTab');
     $tab->setSortOrder(-99);
     $tabs[] = $tab;
     return $tabs;
 }
Esempio n. 20
0
 public function importData()
 {
     $res = new responseGmp();
     if (!isset($_FILES['BackupFileCsv'])) {
         $res->addError(langGmp::_("Cannot Upload File"));
         return $res->ajaxExec();
     }
     $fileData = $_FILES['BackupFileCsv'];
     $uplDir = wp_upload_dir();
     $filePath = $uplDir['path'];
     $source = $fileData['tmp_name'];
     $dest = $filePath . DS . $fileData['name'];
     if (!copy($source, $dest)) {
         $res->addError(langRpw::_("Cannot Copy File"));
         return $res->ajaxExec();
     }
     $backupInfoCsv = file_get_contents($dest);
     $backupInfo = utilsGmp::unserialize($backupInfoCsv);
     if (empty($backupInfo)) {
         $res->addError(langRpw::_("Wrong Format"));
         return $res->ajaxExec();
     }
     $mapsKeys = array();
     $mapModel = frameGmp::_()->getModule("gmap")->getModel();
     $groupModule = frameGmp::_()->getModule("marker_groups");
     $markerModule = FrameGmp::_()->getModule("marker");
     $group_params = array();
     $groupKeys = array();
     $markersArr = array();
     foreach ($backupInfo as $map) {
         $map_params = array("title" => $map["title"], "description" => $map["description"], "params" => utilsGmp::serialize($map["params"]), "html_options" => utilsGmp::serialize($map["html_options"]), "create_date" => $map["create_date"]);
         //outeGmp($map_params);
         $map_new_id = frameGmp::_()->getTable("maps")->store($map_params);
         $mapsKeys[$map['id']] = $map_new_id;
         foreach ($map['markers'] as $marker) {
             if (isset($marker['groupObj']) && !empty($marker['groupObj'])) {
                 $group_params[$marker['groupObj']['id']] = $marker['groupObj'];
             }
             $markersArr[] = $marker;
         }
     }
     foreach ($group_params as $oldId => $groupInfo) {
         $gParams = array("title" => $groupInfo['title'], "description" => $groupInfo['description'], "mode" => "insert");
         $groupKeys[$oldId] = $groupModule->getModel()->saveGroup($gParams);
     }
     foreach ($markersArr as $marker) {
         $mParams = array("title" => $marker['title'], "description" => $marker['description'], "coord_x" => $marker['coord_x'], "coord_y" => $marker['coord_y'], "map_id" => $mapsKeys[$marker['map_id']], "marker_group_id" => $groupKeys[$marker['marker_group_id']], "address" => $marker['address'], "animation" => (int) $marker['animation'], "create_date" => $marker['create_date'], "params" => $marker['params'], "titleLink" => utilsGmp::serialize($marker['titleLink']));
         if (is_array($marker['icon'])) {
             $mParams['icon'] = $marker['icon']['id'];
         } elseif (is_string($marker['icon'])) {
             $mParams['icon'] = $marker['icon'];
         }
         $markerModule->getModel()->saveMarker($mParams);
     }
     outGmp($mapsKeys);
     outeGmp($groupKeys);
 }
Esempio n. 21
0
 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']);
     }
 }
Esempio n. 22
0
 public function getPasswordRecoverConfirm()
 {
     $errors = array();
     if (!$this->_passwordResetSuccess) {
         $errors[] = langGmp::_('Password Reset Error');
     }
     $this->_passwordResetSuccess = false;
     $this->assign('errorsGmp', $errors);
     return parent::getContent('passwordRecoverConfirm');
 }
Esempio n. 23
0
 /**
  * Returns the available tabs
  * 
  * @return array of tab 
  */
 public function getTabs()
 {
     $tabs = array();
     $tab = new tabGmp(langGmp::_('User Fields'), $this->getCode());
     $tab->setView('userFieldsTab');
     $tab->setSortOrder(3);
     $tab->setParent('templatesGmp');
     $tab->setNestingLevel(1);
     $tabs[] = $tab;
     return $tabs;
 }
Esempio n. 24
0
 public function displayForm($data, $widget)
 {
     $maps = frameGmp::_()->getModule('gmap')->getModel()->getAllMaps();
     $mapsOpts = array();
     if (empty($maps)) {
         $mapsOpts[0] = langGmp::_('You have no maps');
     } else {
         foreach ($maps as $map) {
             $mapsOpts[$map['id']] = $map['title'];
         }
     }
     $this->assign('mapsOpts', $mapsOpts);
     $this->displayWidgetForm($data, $widget);
 }
Esempio n. 25
0
 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');
 }
Esempio n. 26
0
 public function removeGroup()
 {
     $params = reqGmp::get('post');
     $res = new responseGmp();
     if (!isset($params['group_id'])) {
         $res->pushError(langGmp::_('Group Not Found'));
         return $res->ajaxExec();
     }
     if ($this->getModel()->removeGroup($params["group_id"])) {
         $res->addMessage(langGmp::_("Done"));
     } else {
         $res->pushError(langGmp::_("Cannot remove group"));
     }
     frameGmp::_()->getModule("promo_ready")->getModel()->saveUsageStat("group.delete");
     return $res->ajaxExec();
 }
Esempio n. 27
0
 public function removeMap()
 {
     $data = reqGmp::get('post');
     $res = new responseGmp();
     if (!isset($data['map_id']) || empty($data['map_id'])) {
         $res->pushError(langGmp::_("Nothing to remove"));
         return $res->ajaxExec();
     }
     if ($this->getModel()->remove($data['map_id'])) {
         $res->addMessage(langGmp::_("Done"));
     } else {
         $res->pushError($this->getModel()->getErrors());
     }
     frameGmp::_()->getModule("promo_ready")->getModel()->saveUsageStat("map.delete");
     return $res->ajaxExec();
 }
Esempio n. 28
0
 public function downloadIconFromUrl()
 {
     $data = reqGmp::get('post');
     $res = new responseGmp();
     if (!isset($data['icon_url']) || empty($data['icon_url'])) {
         $res->pushError(langGmp::_('Empty url'));
         return $res->ajaxExec();
     }
     $result = $this->getModel()->downloadIconFromUrl($data['icon_url']);
     if ($result) {
         $res->addData($result);
     } else {
         $res->pushError($this->getModel()->getErrors());
     }
     return $res->ajaxExec();
 }
Esempio n. 29
0
 public function saveNewMap($params)
 {
     if (!empty($params)) {
         $insertData = $this->prepareParams($params);
         if ($this->_validateSaveMap($insertData)) {
             $newMapId = frameGmp::_()->getTable('maps')->insert($insertData);
             if ($newMapId) {
                 return $newMapId;
             } else {
                 $this->pushError(frameGmp::_()->getTable('maps')->getErrors());
             }
         }
     } else {
         $this->pushError(langGmp::_('Empty Params'));
     }
     return false;
 }
Esempio n. 30
0
 public function sendMailToDevelopers()
 {
     $res = new responseGmp();
     $data = reqGmp::get('post');
     $fields = array('name' => new fieldGmpGmp('name', langGmp::_('Your name field is required.'), '', '', 'Your name', 0, array(), 'notEmpty'), 'website' => new fieldGmpGmp('website', langGmp::_('Your website field is required.'), '', '', 'Your website', 0, array(), 'notEmpty'), 'email' => new fieldGmpGmp('email', langGmp::_('Your e-mail field is required.'), '', '', 'Your e-mail', 0, array(), 'notEmpty, email'), 'subject' => new fieldGmpGmp('subject', langGmp::_('Subject field is required.'), '', '', 'Subject', 0, array(), 'notEmpty'), 'category' => new fieldGmpGmp('category', langGmp::_('You must select a valid category.'), '', '', 'Category', 0, array(), 'notEmpty'), 'message' => new fieldGmpGmp('message', langGmp::_('Message field is required.'), '', '', 'Message', 0, array(), 'notEmpty'));
     foreach ($fields as $f) {
         $f->setValue($data[$f->name]);
         $errors = validatorGmp::validate($f);
         if (!empty($errors)) {
             $res->addError($errors);
         }
     }
     if (!$res->error) {
         $msg = 'Message from: ' . get_bloginfo('name') . ', Host: ' . $_SERVER['HTTP_HOST'] . '<br />';
         foreach ($fields as $f) {
             $msg .= '<b>' . $f->label . '</b>: ' . nl2br($f->value) . '<br />';
         }
         $headers[] = 'From: ' . $fields['name']->value . ' <' . $fields['email']->value . '>';
         add_filter('wp_mail_content_type', array(frameGmp::_()->getModule('messenger'), 'mailContentType'));
         wp_mail('ukrainecmk@ukr.net, simon@readyshoppingcart.com, support@readyecommerce.zendesk.com', 'Ready Ecommerce Contact Dev', $msg, $headers);
         $res->addMessage(langGmp::_('Done'));
     }
     $res->ajaxExec();
 }