Example #1
0
 /**
  * Получить список избранного по списку айдишников
  *
  * @param  array  $aTargetId	Список ID владельцев
  * @param  string $sTargetType	Тип владельца
  * @param  int $sUserId	ID пользователя
  * @return array
  */
 public function GetFavouritesByArray($aTargetId, $sTargetType, $sUserId)
 {
     if (!$aTargetId) {
         return array();
     }
     if (Config::Get('sys.cache.solid')) {
         return $this->GetFavouritesByArraySolid($aTargetId, $sTargetType, $sUserId);
     }
     if (!is_array($aTargetId)) {
         $aTargetId = array($aTargetId);
     }
     $aTargetId = array_unique($aTargetId);
     $aFavourite = array();
     $aIdNotNeedQuery = array();
     /**
      * Делаем мульти-запрос к кешу
      */
     $aCacheKeys = func_build_cache_keys($aTargetId, "favourite_{$sTargetType}_", '_' . $sUserId);
     if (false !== ($data = $this->Cache_Get($aCacheKeys))) {
         /**
          * проверяем что досталось из кеша
          */
         foreach ($aCacheKeys as $sValue => $sKey) {
             if (array_key_exists($sKey, $data)) {
                 if ($data[$sKey]) {
                     $aFavourite[$data[$sKey]->getTargetId()] = $data[$sKey];
                 } else {
                     $aIdNotNeedQuery[] = $sValue;
                 }
             }
         }
     }
     /**
      * Смотрим чего не было в кеше и делаем запрос в БД
      */
     $aIdNeedQuery = array_diff($aTargetId, array_keys($aFavourite));
     $aIdNeedQuery = array_diff($aIdNeedQuery, $aIdNotNeedQuery);
     $aIdNeedStore = $aIdNeedQuery;
     if ($data = $this->oMapper->GetFavouritesByArray($aIdNeedQuery, $sTargetType, $sUserId)) {
         foreach ($data as $oFavourite) {
             /**
              * Добавляем к результату и сохраняем в кеш
              */
             $aFavourite[$oFavourite->getTargetId()] = $oFavourite;
             $this->Cache_Set($oFavourite, "favourite_{$oFavourite->getTargetType()}_{$oFavourite->getTargetId()}_{$sUserId}", array(), 60 * 60 * 24 * 7);
             $aIdNeedStore = array_diff($aIdNeedStore, array($oFavourite->getTargetId()));
         }
     }
     /**
      * Сохраняем в кеш запросы не вернувшие результата
      */
     foreach ($aIdNeedStore as $sId) {
         $this->Cache_Set(null, "favourite_{$sTargetType}_{$sId}_{$sUserId}", array(), 60 * 60 * 24 * 7);
     }
     /**
      * Сортируем результат согласно входящему массиву
      */
     $aFavourite = func_array_sort_by_keys($aFavourite, $aTargetId);
     return $aFavourite;
 }
 /**
  * Запуск обработки
  */
 public function Exec()
 {
     /**
      * Получаем список тегов
      */
     $aTags = $this->oEngine->Topic_GetOpenTopicTags(Config::Get('block.tags.tags_count'));
     /**
      * Расчитываем логарифмическое облако тегов
      */
     if ($aTags) {
         $this->Tools_MakeCloud($aTags);
         /**
          * Устанавливаем шаблон вывода
          */
         $this->Viewer_Assign("aTags", $aTags);
     }
     /**
      * Теги пользователя
      */
     if ($oUserCurrent = $this->User_getUserCurrent()) {
         $aTags = $this->oEngine->Topic_GetOpenTopicTags(Config::Get('block.tags.personal_tags_count'), $oUserCurrent->getId());
         /**
          * Расчитываем логарифмическое облако тегов
          */
         if ($aTags) {
             $this->Tools_MakeCloud($aTags);
             /**
              * Устанавливаем шаблон вывода
              */
             $this->Viewer_Assign("aTagsUser", $aTags);
         }
     }
 }
Example #3
0
 public function isBad()
 {
     if ($this->getRating() <= Config::Get('module.comment.bad')) {
         return true;
     }
     return false;
 }
 /**
  * Обрабатываем процесс залогинивания
  *
  */
 protected function EventLogin()
 {
     /**
      * Если нажали кнопку "Войти"
      */
     if (isPost('submit_login') and is_string(getRequest('login')) and is_string(getRequest('password'))) {
         /**
          * Проверяем есть ли такой юзер по логину
          */
         if (func_check(getRequest('login'), 'mail') and $oUser = $this->User_GetUserByMail(getRequest('login')) or $oUser = $this->User_GetUserByLogin(getRequest('login'))) {
             /**
              * Сверяем хеши паролей и проверяем активен ли юзер
              */
             if ($oUser->getPassword() == func_encrypt(getRequest('password')) and $oUser->getActivate()) {
                 $bRemember = getRequest('remember', false) ? true : false;
                 /**
                  * Авторизуем
                  */
                 $this->User_Authorization($oUser, $bRemember);
                 /**
                  * Перенаправляем на страницу с которой произошла авторизация
                  */
                 if (isset($_SERVER['HTTP_REFERER'])) {
                     $sBackUrl = $_SERVER['HTTP_REFERER'];
                     if (strpos($sBackUrl, Router::GetPath('login')) === false) {
                         Router::Location($sBackUrl);
                     }
                 }
                 Router::Location(Config::Get('path.root.web') . '/');
             }
         }
         $this->Viewer_Assign('bLoginError', true);
     }
     $this->Viewer_AddHtmlTitle($this->Lang_Get('login'));
 }
Example #5
0
 public function set($key, $value)
 {
     $this->check();
     if (memcache_set($this->connection, $key, $value, 0, Config::Get('cache_time')) === false) {
         throw new CacheException("Couldn't store data in cache");
     }
 }
 public function savepro()
 {
     if ($this->post->firstname == '' || $this->post->lastname == '') {
         $this->set('message', 'The first or lastname cannot be blank!');
         $this->render('core_error.tpl');
         return;
     }
     $params = array('firstname' => $this->post->firstname, 'lastname' => $this->post->lastname, 'email' => $this->post->email, 'hub' => $this->post->hub, 'retired' => $this->post->retired, 'totalflights' => $this->post->totalflights, 'totalpay' => floatval($this->post->totalpay), 'transferhours' => $this->post->transferhours);
     PilotData::updateProfile($this->post->pilotid, $params);
     PilotData::SaveFields($this->post->pilotid, $_POST);
     /* Don't calculate a pilot's rank if this is set */
     if (Config::Get('RANKS_AUTOCALCULATE') == false) {
         PilotData::changePilotRank($this->post->pilotid, $this->post->rank);
     } else {
         RanksData::calculateUpdatePilotRank($this->post->pilotid);
     }
     StatsData::UpdateTotalHours();
     $this->set('message', 'Profile updated successfully');
     $this->render('core_success.tpl');
     $this->set('pilots', PilotData::getAllPilots());
     $this->render('/pm/pilot_manager.php');
     if ($this->post->resend_email == 'true') {
         $this->post->id = $this->post->pilotid;
         $this->resendemail(false);
     }
     $pilot = PilotData::getPilotData($this->post->pilotid);
     LogData::addLog(Auth::$userinfo->pilotid, 'Updated profile for ' . PilotData::getPilotCode($pilot->code, $pilot->pilotid) . ' ' . $pilot->firstname . ' ' . $pilot->lastname);
     return;
     break;
 }
Example #7
0
 public function before($controller, $metadata, &$data)
 {
     if (!$controller->request->input->exists('app_id')) {
         throw new BadRequestException("Missing app id.");
     }
     $conf = Config::Get('apps');
     $app = $conf->{$controller->request->input->app_id};
     if (!$app->signed) {
         return;
     }
     if (!$controller->request->input->exists('app_id', 'signature', 'time')) {
         throw new BadRequestException("Missing signature.");
     }
     $signature = str_replace(' ', '+', $controller->request->input->signature);
     $vals = array();
     foreach ($controller->request->input as $key => $val) {
         if (!in_array($key, array('signature', 'time'))) {
             $vals[$key] = $val;
         }
     }
     $sig = sign($vals, $app->key, $controller->request->input->time);
     if ($sig['signature'] != $signature) {
         throw new BadRequestException("Invalid signature.");
     }
 }
Example #8
0
 public function __construct($config = null)
 {
     $config = $config ? $config : Config::Get('mandao');
     $this->account = $config['account'];
     $this->passwd = $config['passwd'];
     $this->perfix = $config['perfix'];
 }
 public function Exec()
 {
     $aBanners = $this->GetParam('aBanners');
     $this->PluginBanneroid_ModuleBanner_AddBannerStats(array('banner_id' => $aBanners[0]->getId(), 'event' => 'SHOW'));
     $this->Viewer_Assign("oBanner", $aBanners[0]);
     $this->Viewer_Assign('sBannersPath', Config::Get("plugin.banneroid.images_dir"));
 }
 /**
  * Делает запись в лог
  *
  * @param  string $sMsg	Сообщение для записи в лог
  */
 public function Log($sMsg)
 {
     if ($this->bLogEnable and Config::Get('sys.logs.cron')) {
         $sMsg = $this->sProcessName . ': ' . $sMsg;
         $this->Logger_Notice($sMsg, array(), 'cron');
     }
 }
Example #11
0
 public static function GetMailer($address = '')
 {
     $emailConfig = Config::Get('email');
     $currentConfig = $emailConfig[$address] ? $emailConfig[$address] : $emailConfig['default'];
     $address = $currentConfig['address'];
     if (!$currentConfig) {
         return false;
     }
     if (!self::$phpMailers[$address]) {
         $mailer = new PHPMailer();
         $mailer->isSMTP();
         $mailer->Host = $currentConfig['stmp_host'];
         $mailer->Username = $currentConfig['user'];
         $mailer->Password = $currentConfig['pwd'];
         $mailer->SMTPAuth = true;
         $mailer->Port = $currentConfig['port'];
         $mailer->CharSet = "utf-8";
         $mailer->setFrom($currentConfig['address']);
         $mailer->isHTML();
     } else {
         $mailer = self::$phpMailers[$address];
     }
     $mailer->clearAllRecipients();
     self::$phpMailers[$address] = $mailer;
     return $mailer;
 }
Example #12
0
 public function InitAction($aVars)
 {
     $oLang = $this->Lang_Dictionary();
     $this->Viewer_Assign('oLang', $oLang);
     $oUser = $this->GetUser();
     if ($oUser && $oUser->IsAdministrator() && Config::Get('plugin.' . $this->sPlugin . '.' . 'icon_menu')) {
         $sScript = Plugin::GetTemplateWebPath($this->sPlugin) . 'js/' . 'icon_menu.js';
         $this->Viewer_AppendScript($sScript);
     }
     if (Router::GetAction() == 'admin' || Router::GetAction() == 'error') {
         return;
     }
     if (!$oUser) {
         if (Router::GetAction() == 'registration') {
             $aIp = admGetAllUserIp();
             foreach ($aIp as $sIp) {
                 if ($this->PluginAceadminpanel_Admin_IsBanIp($sIp)) {
                     $this->Message_AddErrorSingle($this->Lang_Get('adm_banned2_text'), $this->Lang_Get('adm_denied_title'));
                     return $this->UserBanned(null);
                 }
             }
         }
         return;
     }
     if (defined('ADMIN_SITE_CLOSED') && ADMIN_SITE_CLOSED && !$oUser->IsAdministrator()) {
         $this->SiteClosed();
     }
     if ($oUser->IsBannedByLogin() || $oUser->IsBannedByIp() && !$oUser->IsAdministrator()) {
         return $this->UserBanned($oUser);
     }
 }
Example #13
0
 public function resetdistances()
 {
     echo '<h3>Updating and Calculating Distances</h3>';
     # Update all of the schedules
     echo '<p><strong>Updating schedules...</strong></p>';
     //$allschedules = SchedulesData::GetSchedulesNoDistance();
     $allschedules = SchedulesData::findSchedules(array());
     if (!$allschedules) {
         echo 'No schedules to update';
         $allschedules = array();
     }
     # Check 'em
     foreach ($allschedules as $sched) {
         $distance = SchedulesData::distanceBetweenPoints($sched->deplat, $sched->deplng, $sched->arrlat, $sched->arrlng);
         $distance = sprintf("%.6f", $distance);
         echo "{$sched->code}{$sched->flightnum} - {$sched->depname} to {$sched->arrname} " . "is {$distance} " . Config::Get('UNIT') . '<br />';
         SchedulesData::updateScheduleFields($sched->id, array('distance' => $distance));
     }
     # Update all of the PIREPS
     echo '<p><strong>Updating PIREPs...</strong></p>';
     $allpireps = PIREPData::findPIREPS(array());
     if (!$allpireps) {
         echo 'No PIREPs need updating!';
         $allpireps = array();
     }
     foreach ($allpireps as $pirep) {
         # Find the schedule, and the distance supplied by the schedule:
         $distance = SchedulesData::distanceBetweenPoints($pirep->deplat, $pirep->deplng, $pirep->arrlat, $pirep->arrlng);
         $distance = sprintf("%.2f", $distance);
         echo "PIREP Number {$pirep->pirepid} ({$pirep->code}{$pirep->flightnum}) " . "{$pirep->depname} to {$pirep->arrname} is {$distance} " . Config::Get('UNIT') . '<br />';
         PIREPData::editPIREPFields($pirep->pirepid, array('distance' => $distance));
     }
     echo '<p>Completed!</p><br />';
     LogData::addLog(Auth::$userinfo->pilotid, 'Reset distances');
 }
 public function LoadModules()
 {
     Std::Out();
     Std::Out('[Info] [Modules] Loading');
     Std::Out('[Info] [Modules] Available languages: ' . implode(', ', $this->GetAvailableLanguages(false)));
     $Modules = Config::Get('Modules');
     if (is_array($Modules)) {
         $Loaded = array();
         $Keys = array_keys($Modules);
         foreach ($Keys as $Key) {
             foreach ($Modules[$Key] as $Module) {
                 if (is_string($Module)) {
                     $Module = array($Module, $Module);
                 }
                 if (is_array($Module) && !empty($Module[0]) && !empty($Module[1])) {
                     $Name = strtolower($Module[0]);
                     $Loaded[$Key][$Name] = $this->LoadModule($Key, $Name, $Module[1]);
                 } else {
                     Std::Out('[Warning] [Modules] Config must be Key::Name or Key::[Name, AliasOf]');
                     Std::Out("{$Key}::", false);
                     Std::Out(var_export($Module, true));
                 }
             }
         }
         Std::Out('[Info] [Modules] Ready!');
         // ($N loaded modules)
         return $Loaded;
     }
     Std::Out('[Warning] [Modules] Config file is not an array');
     return false;
 }
Example #15
0
 /**
  * Активация плагина.
  */
 public function Activate()
 {
     $aSqlConf = array(array('field' => 'topic_fixed', 'table' => Config::Get('db.table.topic'), 'file' => dirname(__FILE__) . '/sql/topic.sql'));
     $this->exportSqlIfNeed($aSqlConf);
     $this->Cache_Clean();
     return true;
 }
Example #16
0
 public function __construct()
 {
     $this->From = Config::Get('email_address');
     $this->FromName = Config::Get('email_name');
     switch (Config::Get('mailer')) {
         case self::MAIL:
             $this->IsMail();
             break;
         case self::SENDMAIL:
             $this->IsSendmail();
             $this->Sendmail = Config::Get('sendmail_path');
             break;
         case self::SMTP:
             $this->IsSMTP();
             $this->Host = Config::Get('smtp_hostname');
             $this->Port = Config::Get('smtp_port');
             $this->SMTPSecure = Config::Get('flag_smtp_ssl') ? 'ssl' : '';
             $this->Username = Config::Get('smtp_username');
             $this->Password = Config::Get('smtp_password');
             if (!String::IsEmpty($this->Username)) {
                 $this->SMTPAuth = true;
             }
             break;
     }
     $this->greeting = file_get_contents(TEMPLATES_DIR . '/email-global-greeting.tpl');
     $this->signature = file_get_contents(TEMPLATES_DIR . '/email-global-signature.tpl');
 }
 /**
  * @return bool
  */
 public function Init()
 {
     if (Config::Get('plugin.beautypo.enable_formatter')) {
         Config::Set('head.rules.beautypo', array('path' => '___path.root.web___/', 'js' => array('include' => array(Plugin::GetTemplateWebPath(__CLASS__) . 'js/markitup-settings.js?'))));
     }
     return true;
 }
Example #18
0
 /**
  * Получить информацию о блоге
  *
  * @return bool
  */
 public function EventAjaxBlogInfo()
 {
     $this->Viewer_SetResponseAjax('json');
     $sBlogName = getRequest('param');
     if (!is_string($sBlogName) or !func_check($sBlogName, 'login', 3, 50)) {
         $this->Message_AddError('Error in blog`s name');
         return false;
     }
     if (!($oBlog = $this->Blog_GetBlogByUrl($sBlogName))) {
         return false;
     }
     // get blog users with all roles
     $aBlogAdministratorsResult = $this->Blog_GetBlogUsersByBlogId($oBlog->getId(), ModuleBlog::BLOG_USER_ROLE_ADMINISTRATOR);
     $aBlogAdministrators = $aBlogAdministratorsResult['collection'];
     $aBlogModeratorsResult = $this->Blog_GetBlogUsersByBlogId($oBlog->getId(), ModuleBlog::BLOG_USER_ROLE_MODERATOR);
     $aBlogModerators = $aBlogModeratorsResult['collection'];
     $aBlogUsersResult = $this->Blog_GetBlogUsersByBlogId($oBlog->getId(), ModuleBlog::BLOG_USER_ROLE_USER, 1, Config::Get('plugin.popupinfo.Blog_User_On_Page'));
     $aBlogUsers = $aBlogUsersResult['collection'];
     $oViewer = $this->Viewer_GetLocalViewer();
     $oViewer->Assign('oBlog', $oBlog);
     $oViewer->Assign('aBlogAdministrators', $aBlogAdministrators);
     $oViewer->Assign('aBlogModerators', $aBlogModerators);
     $oViewer->Assign('aBlogUsers', $aBlogUsers);
     $oViewer->Assign('iCountBlogAdministrators', $aBlogAdministratorsResult['count'] + 1);
     $oViewer->Assign('iCountBlogModerators', $aBlogModeratorsResult['count']);
     $oViewer->Assign('iCountBlogUsers', $aBlogUsersResult['count']);
     $oViewer->Assign('oUserCurrent', $this->oUserCurrent);
     $this->Viewer_AssignAjax('sText', $oViewer->Fetch(Plugin::GetTemplatePath(__CLASS__) . '/getbloginfo.tpl'));
 }
 /**
  * @param string $sDestination
  *
  * @return bool
  */
 public function CheckDestination($sDestination)
 {
     if (Config::Get('compress.css.force')) {
         return false;
     }
     return parent::CheckDestination($sDestination);
 }
 /**
  * Отправляет пользователю сообщение о добавлении его в друзья
  *
  * @param ModuleUser_EntityUser $oUserTo
  * @param ModuleUser_EntityUser $oUserFrom
  * @param string $sText
  */
 public function SendUserMarkImageNew(ModuleUser_EntityUser $oUserTo, ModuleUser_EntityUser $oUserFrom, $sText)
 {
     /**
      * Если в конфигураторе указан отложенный метод отправки,
      * то добавляем задание в массив. В противном случае,
      * сразу отсылаем на email
      */
     if (Config::Get('module.notify.delayed')) {
         $oNotifyTask = Engine::GetEntity('Notify_Task', array('user_mail' => $oUserTo->getMail(), 'user_login' => $oUserTo->getLogin(), 'notify_text' => $sText, 'notify_subject' => $this->Lang_Get('plugin.lsgallery.lsgallery_marked_subject'), 'date_created' => date("Y-m-d H:i:s"), 'notify_task_status' => self::NOTIFY_TASK_STATUS_NULL));
         if (Config::Get('module.notify.insert_single')) {
             $this->aTask[] = $oNotifyTask;
         } else {
             $this->oMapper->AddTask($oNotifyTask);
         }
     } else {
         /**
          * Отправляем мыло
          */
         $this->Mail_SetAdress($oUserTo->getMail(), $oUserTo->getLogin());
         $this->Mail_SetSubject($this->Lang_Get('plugin.lsgallery.lsgallery_marked_subject'));
         $this->Mail_SetBody($sText);
         $this->Mail_setHTML();
         $this->Mail_Send();
     }
 }
 protected function EventShowBlogs()
 {
     /**
      * Передан ли номер страницы
      */
     $iPage = preg_match("/^\\d+\$/i", $this->GetEventMatch(2)) ? $this->GetEventMatch(2) : 1;
     /**
      * Получаем список блогов
      */
     $aResult = $this->Blog_GetBlogsRating($iPage, Config::Get('module.blog.per_page'));
     $aBlogs = $aResult['collection'];
     /**
      * Формируем постраничность
      */
     $aPaging = $this->Viewer_MakePaging($aResult['count'], $iPage, Config::Get('module.blog.per_page'), 4, Router::GetPath('blogs'));
     /**
      * Загружаем переменные в шаблон
      */
     $this->Viewer_Assign('aPaging', $aPaging);
     $this->Viewer_Assign("aBlogs", $aBlogs);
     $this->Viewer_AddHtmlTitle($this->Lang_Get('blog_menu_all_list'));
     /**
      * Устанавливаем шаблон вывода
      */
     $this->SetTemplateAction('index');
 }
Example #22
0
	/**
	 * Fetches a named database from the connection pool.
	 *
	 * @param string $name Name of the database to fetch from the connection pool.
	 * @return Database The named database.
	 */
	public static function GetManager($name)
	{
		if (isset(self::$_managers[$name]))
			return self::$_managers[$name];
		else
		{
			$conf=Config::Get('cloud');

			if (isset($conf->dsn->items[$name]))
			{
				$dsn=$conf->dsn->items[$name]->storage;
				$matches=array();
				if (preg_match_all('#([a-z0-9]*)://([^@]*)@(.*)#',$dsn,$matches))
				{
					$driver=$matches[1][0];
					$auth=$matches[2][0];
					$secret=$matches[3][0];
					
					uses('system.cloud.driver.storage.'.$driver);
					
					$class=$driver."Driver";
					$storage=new $class($auth,$secret);
					
					self::$_managers[$name]=$storage;
					return $storage;
				}
			}

			throw new Exception("Cannot find storage named '$name' in Config.");
		}
	}
Example #23
0
 /**
  * Делает запись в лог
  *
  * @param  string $sMsg
  * @return
  */
 public function Log($sMsg)
 {
     if (Config::Get('sys.logs.cron')) {
         $sMsg = $this->sProcessName . ': ' . $sMsg;
         $this->oEngine->Logger_Notice($sMsg);
     }
 }
Example #24
0
 public function __construct($Debug = false)
 {
     $this->Debug = (bool) $Debug;
     Std::Out();
     Std::Out('[Info] [WhatsBot] Loading... Debug = ' . var_export($this->Debug, true));
     Config::Load();
     LoadLibs();
     $Config = Config::Get('WhatsBot');
     if (!empty($Config['WhatsApp']['Username']) && !empty($Config['WhatsApp']['Nickname']) && !empty($Config['WhatsApp']['Password'])) {
         $this->Password = $Config['WhatsApp']['Password'];
         # WhatsApp
         Std::Out();
         Std::Out("[Info] [WhatsBot] I'm {$Config['WhatsApp']['Nickname']} ({$Config['WhatsApp']['Username']})");
         $this->WhatsProt = new WhatsProt($Config['WhatsApp']['Username'], $Config['WhatsApp']['Nickname'], $this->Debug);
         $this->WhatsApp = new WhatsApp($this->WhatsProt);
         # WhatsBot
         $this->ModuleManager = new ModuleManager($this, $this->WhatsApp);
         $this->ThreadManager = new ThreadManager($this, $this->WhatsProt, $this->ModuleManager);
         $this->Parser = new WhatsBotParser($this->WhatsApp, $this->ModuleManager);
         # Load
         $this->ModuleManager->LoadModules();
         $this->ThreadManager->LoadThreads();
         # Binding
         $this->WhatsApp->EventManager()->LoadListeners($this, $this->WhatsApp, $this->Parser, $this->ModuleManager, $this->ThreadManager, array('Connection', 'WhatsBot'));
     } else {
         throw new Exception('You have to setup the config file config/WhatsBot.json');
     }
 }
Example #25
0
	/**
	 * Загружает конфиг Jevix'а
	 *
	 * @param string $sType Тип конфига
	 * @param bool $bClear
	 */
	public function LoadJevixConfig($sType='default',$bClear=true) {
		if ($bClear) {
			$this->oJevix->tagsRules=array();
		}
		$aConfig=Config::Get('jevix.'.$sType);
		if (is_array($aConfig)) {
			foreach ($aConfig as $sMethod => $aExec) {
				foreach ($aExec as $aParams) {
					if (in_array(strtolower($sMethod),array_map("strtolower",array('cfgSetTagCallbackFull','cfgSetTagCallback')))) {
						if (isset($aParams[1][0]) and $aParams[1][0]=='_this_') {
							$aParams[1][0]=$this;
						}
					}
					call_user_func_array(array($this->oJevix,$sMethod), $aParams);
				}
			}
			/**
			 * Хардкодим некоторые параметры
			 */
			unset($this->oJevix->entities1['&']); // разрешаем в параметрах символ &
			if (Config::Get('view.noindex') and isset($this->oJevix->tagsRules['a'])) {
				$this->oJevix->cfgSetTagParamDefault('a','rel','nofollow',true);
			}
		}
	}
Example #26
0
 public function InitTpl()
 {
     if (getRequest('settpl') && func_check(getRequest('settpl'), 'id') && ($oTplActiveCss = $this->PluginAceadminpanel_Templates_GetTplById(getRequest('settpl')))) {
         $this->Viewer_Assign('oTplSetCss', $oTplActiveCss);
         $this->Viewer_Assign('oTplSetAddress', Config::Get('path.static.skin') . '/css/tpls/' . $oTplActiveCss->getTplName() . '.css');
     }
 }
 public function Init()
 {
     $this->Viewer_AppendScript('https://maps.googleapis.com/maps/api/js?v=3.exp&libraries=places&key=' . Config::Get('plugin.gmappost.google_api_key'));
     $this->Viewer_AppendScript(Plugin::GetTemplateWebPath(__CLASS__) . 'js/markerclusterer_compiled.js');
     $this->Viewer_AppendScript(Plugin::GetTemplateWebPath(__CLASS__) . 'js/gmappost.js');
     $this->Viewer_AppendStyle(Plugin::GetTemplateWebPath(__CLASS__) . 'css/styles.css');
 }
Example #28
0
 public function set($key, $value)
 {
     // we store it with the cache_time default expiration so objects will atleast get cleaned eventually.
     if (@apc_store($key, array('time' => time(), 'data' => serialize($value)), Config::Get('cache_time')) == false) {
         throw new CacheException("Couldn't store data in cache");
     }
 }
Example #29
0
 public function preExcute()
 {
     $runtime = Config::Get('runtime', 'runtime');
     $systemConfig = Config::Get('system');
     $this->params['runtime'] = $runtime;
     $this->params['title'] = $systemConfig['title'];
 }
Example #30
0
 /**
  * Выводим комментарии
  *
  */
 protected function EventComments()
 {
     /**
      * Передан ли номер страницы
      */
     $iPage = $this->GetEventMatch(2) ? $this->GetEventMatch(2) : 1;
     /**
      * Исключаем из выборки идентификаторы закрытых блогов (target_parent_id)
      */
     $aCloseBlogs = $this->oUserCurrent ? $this->Blog_GetInaccessibleBlogsByUser($this->oUserCurrent) : $this->Blog_GetInaccessibleBlogsByUser();
     /**
      * Получаем список комментов
      */
     $aResult = $this->Comment_GetCommentsAll('topic', $iPage, Config::Get('module.comment.per_page'), array(), $aCloseBlogs);
     $aComments = $aResult['collection'];
     /**
      * Формируем постраничность
      */
     $aPaging = $this->Viewer_MakePaging($aResult['count'], $iPage, Config::Get('module.comment.per_page'), 4, Router::GetPath('comments'));
     /**
      * Загружаем переменные в шаблон
      */
     $this->Viewer_Assign('aPaging', $aPaging);
     $this->Viewer_Assign("aComments", $aComments);
     $this->Viewer_AddHtmlTitle($this->Lang_Get('comments_all'));
     $this->Viewer_SetHtmlRssAlternate(Router::GetPath('rss') . 'allcomments/', $this->Lang_Get('comments_all'));
     /**
      * Устанавливаем шаблон вывода
      */
     $this->SetTemplateAction('index');
 }