function getLanguagesInfo($bIdAsKey = false, $bActiveOnly = false)
 {
     $aLanguages = array();
     $this->oDb->getLanguagesBy(array('type' => 'all'), $aLanguages, false);
     if (!is_array($aLanguages) || empty($aLanguages)) {
         return $aLanguages;
     }
     $oTemplate = BxDolStudioTemplate::getInstance();
     foreach ($aLanguages as $iKey => $aLanguage) {
         $aLanguages[$iKey]['icon'] = genFlag($aLanguage['name'], $oTemplate);
     }
     return $aLanguages;
 }
Example #2
0
 function getBlockCode_UpcomingPhoto()
 {
     $aEvent = $this->oDb->getUpcomingEvent(getParam('bx_events_main_upcoming_event_from_featured_only') ? true : false);
     if (!$aEvent) {
         return MsgBox(_t('_Empty'));
     }
     $aAuthor = getProfileInfo($aEvent['ResponsibleID']);
     $a = array('ID' => $aEvent['ResponsibleID'], 'Avatar' => $aEvent['PrimPhoto']);
     $aImage = BxDolService::call('photos', 'get_image', array($a, 'file'), 'Search');
     bx_events_import('Voting');
     $oRating = new BxEventsVoting('bx_events', (int) $aEvent['ID']);
     $aVars = array('image_url' => !$aImage['no_image'] && $aImage['file'] ? $aImage['file'] : $this->oTemplate->getIconUrl('no-photo-110.png'), 'image_title' => !$aImage['no_image'] && $aImage['title'] ? $aImage['title'] : '', 'event_url' => BX_DOL_URL_ROOT . $this->oConfig->getBaseUri() . 'view/' . $aEvent['EntryUri'], 'event_title' => $aEvent['Title'], 'event_start' => getLocaleDate($aEvent['EventStart']), 'event_start_in' => defineTimeInterval($aEvent['EventStart']), 'author_title' => _t('_From'), 'author_username' => $aAuthor['NickName'], 'author_url' => getProfileLink($aAuthor['ID']), 'rating' => $oRating->isEnabled() ? $oRating->getJustVotingElement(true, $aEvent['ID']) : '', 'participants' => $aEvent['FansCount'], 'country_city' => '<a href="' . $this->oConfig->getBaseUri() . 'browse/country/' . strtolower($aEvent['Country']) . '">' . _t($GLOBALS['aPreValues']['Country'][$aEvent['Country']]['LKey']) . '</a>' . (trim($aEvent['City']) ? ', ' . $aEvent['City'] : ''), 'place' => $aEvent['Place'], 'flag_image' => genFlag($aEvent['Country']));
     return $this->oTemplate->parseHtmlByName('main_event', $aVars);
 }
 protected function loadData()
 {
     $sLanguage = BxDolLanguages::getInstance()->getCurrentLangName();
     $this->setSelected('', $sLanguage);
     $aPage = explode('?', $_SERVER['HTTP_REFERER']);
     $aPageParams = array();
     if (!empty($aPage[1])) {
         parse_str($aPage[1], $aPageParams);
     }
     $aLanguages = BxDolLanguagesQuery::getInstance()->getLanguages(false, true);
     $aItems = array();
     foreach ($aLanguages as $sName => $sLang) {
         $aPageParams['lang'] = $sName;
         $aItems[] = array('id' => $sName, 'name' => $sName, 'class' => '', 'title' => genFlag($sName) . ' ' . $sLang, 'target' => '_self', 'icon' => '', 'link' => bx_html_attribute(bx_append_url_params($aPage[0], $aPageParams)), 'onclick' => '');
     }
     $this->_aObject['menu_items'] = $aItems;
 }
Example #4
0
 public function getMenuItems()
 {
     $aItems = parent::getMenuItems();
     foreach ($aItems as $iKey => $aItem) {
         switch ($aItem['name']) {
             case 'switch_language':
                 $aItems[$iKey]['title'] = _t('_sys_menu_item_title_switch_language_mask', $aItems[$iKey]['title'], genFlag());
                 break;
             case 'switch_template':
                 $aTemplates = get_templates_array(true, true);
                 $sTemplate = $aTemplates[$this->_oTemplate->getCode()];
                 $aItems[$iKey]['title'] = _t('_sys_menu_item_title_switch_template_mask', $aItems[$iKey]['title'], $sTemplate);
                 break;
         }
     }
     return $aItems;
 }
Example #5
0
 function _formatLocation(&$aDataEntry, $isCountryLink = false, $isFlag = false)
 {
     $sFlag = $isFlag ? ' ' . genFlag($aDataEntry['country']) : '';
     $sCountry = _t($GLOBALS['aPreValues']['Country'][$aDataEntry['country']]['LKey']);
     if ($isCountryLink) {
         $sCountry = '<a href="' . $this->_oConfig->getBaseUri() . 'browse/country/' . strtolower($country['Country']) . '">' . $sCountry . '</a>';
     }
     return (trim($aDataEntry['city']) ? $aDataEntry['city'] . ', ' : '') . $sCountry . $sFlag;
 }
Example #6
0
 function blockInfo(&$aEvent)
 {
     $aAuthor = getProfileInfo($aEvent['ResponsibleID']);
     $aVars = array('author_thumb' => get_member_thumbnail($aAuthor['ID'], 'none'), 'date' => getLocaleDate($aEvent['Date'], BX_DOL_LOCALE_DATE_SHORT), 'date_ago' => defineTimeInterval($aEvent['Date']), 'cats' => $this->parseCategories($aEvent['Categories']), 'tags' => $this->parseTags($aEvent['Tags']), 'country_city' => '<a href="' . BX_DOL_URL_ROOT . $this->_oConfig->getBaseUri() . 'browse/country/' . strtolower($aEvent['Country']) . '">' . _t($GLOBALS['aPreValues']['Country'][$aEvent['Country']]['LKey']) . '</a>' . (trim($aEvent['City']) ? ', ' . $aEvent['City'] : ''), 'flag_image' => genFlag($aEvent['Country']), 'fields' => $this->blockFields($aEvent), 'author_username' => $aAuthor ? $aAuthor['NickName'] : _t('_bx_events_admin'), 'author_url' => $aAuthor ? getProfileLink($aAuthor['ID']) : 'javascript:void(0)');
     return $this->parseHtmlByName('block_info', $aVars);
 }