Esempio n. 1
0
 function __construct(&$aModule)
 {
     parent::__construct($aModule);
     $GLOBALS['aModule'] = $aModule;
     $this->_iProfileId = getLoggedId();
     $this->_sProto = bx_proto();
 }
Esempio n. 2
0
 function BxGSearchModule(&$aModule)
 {
     parent::BxDolModule($aModule);
     $GLOBALS['aModule'] = $aModule;
     $this->_iProfileId = getLoggedId();
     $GLOBALS['oBxGSearchModule'] =& $this;
     $this->_sProto = bx_proto();
 }
Esempio n. 3
0
 function BxWmapModule(&$aModule)
 {
     parent::BxDolModule($aModule);
     $this->_iProfileId = getLoggedId();
     $this->_aParts = $this->_oDb->getParts();
     $this->_oDb->_aParts =& $this->_aParts;
     $this->_sProto = bx_proto();
 }
Esempio n. 4
0
 function getBlockCode_SearchResults()
 {
     $sProto = bx_proto();
     $this->_oTemplate->addJs($sProto . '://www.google.com/jsapi');
     $a = parse_url($GLOBALS['site']['url']);
     $aVars = array('is_image_search' => 'on' == getParam('bx_gsearch_separate_images') ? 1 : 0, 'is_tabbed_search' => 'on' == getParam('bx_gsearch_separate_tabbed') ? 1 : 0, 'domain' => $a['host'], 'keyword' => str_replace('"', '\\"', stripslashes($_GET['keyword'])), 'suffix' => 'adv', 'separate_search_form' => 1);
     return array($this->_oTemplate->parseHtmlByName('search', $aVars));
 }
Esempio n. 5
0
 function __construct(&$aModule)
 {
     parent::__construct($aModule);
     $this->_iProfileId = getLoggedId();
     $this->_aParts = $this->_oDb->getParts();
     $this->_oDb->_aParts =& $this->_aParts;
     $this->_sProto = bx_proto();
 }
 public function __construct($aObject, $oTemplate)
 {
     parent::__construct($aObject);
     if ($oTemplate) {
         $this->_oTemplate = $oTemplate;
     } else {
         $this->_oTemplate = $GLOBALS['oSysTemplate'];
     }
     $this->_sKeyPublic = getParam('sys_recaptcha_key_public');
     $this->_sKeyPrivate = getParam('sys_recaptcha_key_private');
     $this->_sProto = bx_proto();
 }
Esempio n. 7
0
 function getCodeCharts()
 {
     $aObjects = $GLOBALS['MySQL']->getAll("SELECT * FROM `sys_objects_charts` WHERE `active` = 1 ORDER BY `order` ASC");
     foreach ($aObjects as $k => $a) {
         $aObjects[$k]['title'] = _t($a['title']);
     }
     $sContent = $GLOBALS['oAdmTemplate']->parseHtmlByName('dashboard_charts.html', array('proto' => bx_proto(), 'admin_url' => BX_DOL_URL_ADMIN, 'from' => date('Y-m-d', time() - 30 * 24 * 60 * 60), 'to' => date('Y-m-d', time()), 'bx_repeat:objects' => $aObjects));
     // add datepicker
     bx_import('BxTemplFormView');
     $oForm = new BxTemplFormView(array());
     $oForm->addCssJs(true);
     return DesignBoxAdmin(_t('_adm_box_cpt_charts'), $sContent, '', '', 11);
 }
Esempio n. 8
0
 /**
  * Constructor
  */
 function __construct(&$aModule)
 {
     parent::__construct($aModule);
     // only image files can added/removed here, changing list of video files requires source code modification
     // image files support square resizing, just specify 'square' => true
     $this->aFilesConfig = array('poster' => array('postfix' => IMAGE_EXTENSION, 'image' => true), 'browse' => array('postfix' => THUMB_FILE_NAME . IMAGE_EXTENSION, 'image' => true, 'w' => 240, 'h' => 240, 'square' => true), 'browse2x' => array('postfix' => THUMB_FILE_NAME . '_2x' . IMAGE_EXTENSION, 'image' => true, 'w' => 480, 'h' => 480, 'square' => true), 'main' => array('postfix' => FLV_EXTENSION), 'mpg' => array('postfix' => '.mpg'), 'file' => array('postfix' => MOBILE_EXTENSION), 'm4v' => array('postfix' => M4V_EXTENSION));
     $this->aGlParams = array('mode_top_index' => 'bx_videos_mode_index', 'category_auto_approve' => 'category_auto_activation_bx_videos');
     $sProto = bx_proto();
     if (!defined("YOUTUBE_VIDEO_PLAYER")) {
         define("YOUTUBE_VIDEO_PLAYER", '<iframe width="100%" height="360" src="' . $sProto . '://www.youtube-nocookie.com/embed/#video#?rel=0&amp;showinfo=0#autoplay#" frameborder="0" allowfullscreen></iframe>');
     }
     if (!defined("YOUTUBE_VIDEO_EMBED")) {
         define("YOUTUBE_VIDEO_EMBED", '<iframe width="480" height="360" src="' . $sProto . '://www.youtube-nocookie.com/embed/#video#?rel=0&amp;showinfo=0" frameborder="0" allowfullscreen></iframe>');
     }
     $this->initConfig();
 }
Esempio n. 9
0
 function _geocode($sAddress, $sCountryCode = '')
 {
     $sStatus = false;
     $sAddress = rawurlencode($sAddress);
     $sUrl = bx_proto() . "://maps.googleapis.com/maps/api/geocode/json";
     $s = bx_file_get_contents($sUrl, array('address' => $sAddress, 'sensor' => 'false'));
     $oData = json_decode($s);
     if (null == $oData) {
         return false;
     }
     if ('OK' != $oData->status) {
         return false;
     }
     foreach ($oData->results as $oResult) {
         $sShortNameCountry = '';
         foreach ($oResult->address_components as $oAddressComponent) {
             if (in_array('country', $oAddressComponent->types)) {
                 $sShortNameCountry = $oAddressComponent->short_name;
             }
         }
         if (!$sCountryCode || $sShortNameCountry && $sCountryCode == $sShortNameCountry) {
             $oLocation = $oResult->geometry->location;
             return array($oLocation->lat, $oLocation->lng, $sShortNameCountry);
         }
     }
     return false;
 }