예제 #1
0
 public function InitAction()
 {
     /**
      * Подключаем JS
      */
     $this->Viewer_AppendScript(Plugin::GetTemplatePath(__CLASS__) . 'js/template.js');
 }
예제 #2
0
 /**
  * Возвращает html для вставки в блок сообществ
  */
 protected function ajaxGetBlogs()
 {
     $this->Viewer_SetResponseAjax('json');
     $sCatName = getRequest('blog_cat', '');
     $sCatName = $sCatName == 'ALL' ? '' : $sCatName;
     if ($sCatName) {
         if (!($sCatName = $this->PluginCommunitycats_ModuleCategory_GetFullCategoryName($sCatName))) {
             return '';
         }
     }
     //Исходим из того, что у нас двухуровненвые каталоги
     $aCatName = explode(':', $sCatName);
     array_pop($aCatName);
     $sTemplateName = 'actions/' . strtolower(implode('_', $aCatName)) . 'blogs.tpl';
     //загоняем данные в фильтр
     if ($sCatName) {
         $aFilter = array('beginLike' => array('blog_cat' => $sCatName));
     } else {
         $aFilter = array();
     }
     $aFilter['in'] = array('blog_type' => array('open', 'close'));
     $aOrder = array('blog_count_user' => 'desc');
     $aLimit = array('iPage' => 1, 'iElementsPerPage' => Config::Get('plugin.communitycats.blockBlogCount'));
     $aBlogsCat = $this->PluginCommunitycats_ModuleCategory_GetBlogsByFilter($aFilter, $aOrder, $aLimit, false);
     $oViewerLocal = $this->Viewer_GetLocalViewer();
     $oViewerLocal->Assign('aBlogsCatatalog', $aBlogsCat);
     $this->Viewer_AssignAjax('sToggleText', $oViewerLocal->Fetch(Plugin::GetTemplatePath(__CLASS__) . $sTemplateName));
 }
 public function Init()
 {
     $this->oUserCurrent = $this->User_GetUserCurrent();
     $this->Viewer_AddMenu('receptiondesk', Plugin::GetTemplatePath(__CLASS__) . 'menu.receptiondesk.tpl');
     $this->Viewer_Assign('sReceptiondeskTemplatePath', Plugin::GetTemplatePath(__CLASS__));
     $this->Viewer_AddHtmlTitle($this->Lang_Get('plugin.receptiondesk.receptiondesk_receptiondesk'));
 }
예제 #4
0
 /**
  * Add ignore button to user profile
  * 
  * @param array $aData
  *
  * @return string
  */
 public function ProfileView($aData)
 {
     /* @var $oUserProfile ModuleUser_EntityUser */
     $oUserProfile = $aData['oUserProfile'];
     /* @var $oUserCurrent ModuleUser_EntityUser */
     $oUserCurrent = $this->User_GetUserCurrent();
     if ($oUserCurrent) {
         $aForbidIgnore = $this->User_GetForbidIgnoredUsers();
         if (in_array($oUserProfile->getId(), $aForbidIgnore)) {
             $this->Viewer_Assign('bForbidIgnore', true);
         } else {
             if ($oUserCurrent->getId() != $oUserProfile->getId()) {
                 $bIgnoredTopics = $this->User_IsUserIgnoredByUser($oUserCurrent->getId(), $oUserProfile->getId(), PluginIgnore_ModuleUser::TYPE_IGNORE_TOPICS);
                 $bIgnoredComments = $this->User_IsUserIgnoredByUser($oUserCurrent->getId(), $oUserProfile->getId(), PluginIgnore_ModuleUser::TYPE_IGNORE_COMMENTS);
                 $this->Viewer_Assign('bIgnoredTopics', $bIgnoredTopics);
                 $this->Viewer_Assign('bIgnoredComments', $bIgnoredComments);
             }
         }
         $aUserBlacklist = $this->Talk_GetBlacklistByUserId($oUserCurrent->getId());
         if (isset($aUserBlacklist[$oUserProfile->getId()])) {
             $bIgnoredTalks = 1;
         } else {
             $bIgnoredTalks = 0;
         }
         $this->Viewer_Assign('bIgnoredTalks', $bIgnoredTalks);
         return $this->Viewer_Fetch(Plugin::GetTemplatePath(__CLASS__) . 'profile_ignore.tpl');
     }
 }
예제 #5
0
 public function BodyBegin()
 {
     if (Config::Get('plugin.popupinfo.Only_Registered_Users_Can_See_Info_Tips') and !$this->User_IsAuthorization()) {
         return false;
     }
     return $this->Viewer_Fetch(Plugin::GetTemplatePath(__CLASS__) . 'body_begin.tpl');
 }
예제 #6
0
 /**
  * Выводим HTML
  *
  */
 public function InsertSendtofriendTpl()
 {
     if ($this->User_IsAuthorization()) {
         return $this->Viewer_Fetch(Plugin::GetTemplatePath(__CLASS__) . 'sendtofriend.tpl');
     }
     return '';
 }
예제 #7
0
 protected function sendCastNotifyToUser($sTarget, $oTarget, $oParentTarget, $oUser)
 {
     if (!$this->oMapper->castExist($sTarget, $oTarget->getId(), $oUser->getId())) {
         $this->oUserCurrent = $this->User_GetUserCurrent();
         $oViewerLocal = $this->Viewer_GetLocalViewer();
         $oViewerLocal->Assign('oUser', $this->oUserCurrent);
         $oViewerLocal->Assign('oTarget', $oTarget);
         $oViewerLocal->Assign('oParentTarget', $oParentTarget);
         $oViewerLocal->Assign('oUserMarked', $oUser);
         $aAssigin = array('oUser' => $this->oUserCurrent, 'oTarget' => $oTarget, 'oParentTarget' => $oParentTarget, 'oUserMarked' => $oUser);
         $sTemplateName = 'notify.' . $sTarget . '.tpl';
         $sLangDir = Plugin::GetTemplatePath('castuser') . 'notify/' . $this->Lang_GetLang();
         if (is_dir($sLangDir)) {
             $sPath = $sLangDir . '/' . $sTemplateName;
         } else {
             $sPath = Plugin::GetTemplatePath('castuser') . 'notify/' . $this->Lang_GetLangDefault() . '/' . $sTemplateName;
         }
         $sText = $oViewerLocal->Fetch($sPath);
         $aTitles = $this->Lang_Get('plugin.castuser.notify_title');
         $sTitle = $aTitles[$sTarget];
         $oTalk = $this->Talk_SendTalk($sTitle, $sText, $this->oUserCurrent, array($oUser), false, false);
         $this->Notify_Send($oUser, $sTemplateName, $sTitle, $aAssigin, 'castuser');
         $this->Talk_DeleteTalkUserByArray($oTalk->getId(), $this->oUserCurrent->getId());
         $this->oMapper->saveExist($sTarget, $oTarget->getId(), $oUser->getId());
     }
 }
 public function StreamEventAddTestimonial($aParams = array())
 {
     if (isset($aParams['oStreamEvent'])) {
         $this->Viewer_Assign('oStreamEvent', $aParams['oStreamEvent']);
         return $this->Viewer_Fetch(Plugin::GetTemplatePath(__CLASS__) . 'event.add_testimonial.tpl');
     }
 }
 public function InjectProfileLink()
 {
     $sTemplatePath = Plugin::GetTemplatePath(__CLASS__) . 'inject_profile_link.tpl';
     if (E::ModuleViewer()->TemplateExists($sTemplatePath)) {
         return E::ModuleViewer()->Fetch($sTemplatePath);
     }
 }
예제 #10
0
 /**
  * Инициализация плагина
  */
 public function Init()
 {
     $this->Viewer_Assign("sTemplatePathEstheme", Plugin::GetTemplatePath(__CLASS__));
     E::ModuleViewer()->AppendStyle(Plugin::GetTemplateDir(__CLASS__) . "assets/css/style.min.css");
     E::ModuleViewer()->AppendScript(Plugin::GetTemplateDir(__CLASS__) . "assets/js/develop/jquery.color.js");
     E::ModuleViewer()->AppendScript(Plugin::GetTemplateDir(__CLASS__) . "assets/js/develop/colorPicker.js");
     E::ModuleViewer()->AppendScript(Plugin::GetTemplateDir(__CLASS__) . "assets/js/develop/esTheme.js");
 }
예제 #11
0
 public function Init()
 {
     if (getRequest('set-theme', false, 'get') == 'on') {
         //                        setcookie('theme',1,time()+60*60*24*30,Config::Get('sys.cookie.path'),Config::Get('sys.cookie.host'),false);
         $this->Viewer_AppendStyle(Plugin::GetTemplatePath(__CLASS__) . "css/dark.css");
         // Добавление своего CSS
     }
 }
예제 #12
0
 public function InjectDoMany()
 {
     $oUserCurrent = $this->User_GetUserCurrent();
     if ($oUserCurrent) {
         $this->Viewer_Assign('sTWPTalkbell', rtrim(Plugin::GetTemplateWebPath('talkbell'), '/'));
         return $this->Viewer_Fetch(Plugin::GetTemplatePath('talkbell') . 'window_message.tpl');
     }
 }
 /**
  * Инициализация плагина
  *
  * @return void
  */
 public function Init()
 {
     $this->Viewer_Assign("sTemplateWebPathLsgallery", Plugin::GetTemplateWebPath(__CLASS__));
     $this->Viewer_Assign("sTemplatePathLsgallery", Plugin::GetTemplatePath(__CLASS__));
     $this->Viewer_AppendStyle(Plugin::GetTemplateWebPath('lsgallery') . 'css/gallery-style.css');
     $this->Viewer_AppendScript(Plugin::GetTemplateWebPath('lsgallery') . 'lib/jQuery/plugins/jquery.tools.min.js');
     $this->Viewer_AppendScript(Plugin::GetTemplateWebPath('lsgallery') . 'js/common.js');
 }
 public function Init()
 {
     $this->Viewer_AppendStyle(Plugin::GetTemplatePath(__CLASS__) . "css/style.css");
     // Добавление своего CSS
     $this->Viewer_AppendScript(Plugin::GetTemplatePath(__CLASS__) . "js/script.js");
     // Добавление своего JS
     //$this->Viewer_AddMenu('blog',Plugin::GetTemplatePath(__CLASS__).'menu.blog.tpl'); // например, задаем свой вид меню
 }
예제 #15
0
 /**
  * Выводим HTML
  *
  */
 public function InsertBlogosphereTpl()
 {
     $aConfig = PluginBlogosphere::getTimePeriod();
     for ($iCurTime = $aConfig['timeStart']; $iCurTime < $aConfig['timeEnd']; $iCurTime += Config::Get('plugin.blogosphere.interval')) {
         $aConfig['aTimeStamp'][] = $iCurTime;
     }
     $this->Viewer_Assign('aBlogosphere', $aConfig);
     return $this->Viewer_Fetch(Plugin::GetTemplatePath(__CLASS__) . 'Blogosphere.tpl');
 }
예제 #16
0
 public function Init()
 {
     Emojione::$ascii = Config::Get('plugin.emoji.use_ascii');
     if (!Config::Get('plugin.emoji.use_cdn')) {
         Emojione::$imagePathPNG = Plugin::GetTemplateWebPath(__CLASS__) . 'images/';
     }
     $this->Viewer_AppendStyle(Plugin::GetTemplatePath(__CLASS__) . "css/style.css");
     $this->Viewer_AppendScript(Plugin::GetTemplatePath(__CLASS__) . "js/emo.js");
 }
/**
 * Плагин для смарти
 * Подключает обработчик блоков шаблона
 *
 * @param array $aParams
 * @param Smarty $oSmarty
 * @return string
 */
function smarty_insert_block($aParams, &$oSmarty)
{
    if (!isset($aParams['block'])) {
        trigger_error('Not found param "block"', E_USER_WARNING);
        return;
    }
    /**
     * Устанавливаем шаблон
     */
    $sBlock = ucfirst(basename($aParams['block']));
    /**
     * Проверяем наличие шаблона. Определяем значения параметров работы в зависимости от того,
     * принадлежит ли блок одному из плагинов, или является пользовательским классом движка
     */
    if (isset($aParams['params']) and isset($aParams['params']['plugin'])) {
        $sBlockTemplate = Plugin::GetTemplatePath($aParams['params']['plugin']) . '/blocks/block.' . $aParams['block'] . '.tpl';
        $sBlock = 'Plugin' . ucfirst($aParams['params']['plugin']) . '_Block' . $sBlock;
    } else {
        $sBlockTemplate = 'blocks/block.' . $aParams['block'] . '.tpl';
        $sBlock = 'Block' . $sBlock;
    }
    $sBlock = Engine::getInstance()->Plugin_GetDelegate('block', $sBlock);
    /**
     * параметры
     */
    $aParamsBlock = array();
    if (isset($aParams['params'])) {
        $aParamsBlock = $aParams['params'];
    }
    /**
     * Подключаем необходимый обработчик
     */
    $oBlock = new $sBlock($aParamsBlock);
    $oBlock->SetTemplate($sBlockTemplate);
    /**
     * Запускаем обработчик
     */
    $mResult = $oBlock->Exec();
    if (is_string($mResult)) {
        /**
         * Если метод возвращает строку - выводим ее вместо рендеринга шаблона
         */
        return $mResult;
    } else {
        /**
         * Получаем шаблон, возможно его переопределили в обработчике блока
         */
        $sBlockTemplate = Engine::getInstance()->Plugin_GetDelegate('template', $oBlock->GetTemplate());
        if (!Engine::getInstance()->Viewer_TemplateExists($sBlockTemplate)) {
            return "<b>Not found template for block: <i>{$sBlockTemplate} ({$sBlock})</i></b>";
        }
    }
    /**
     * Возвращаем результат в виде обработанного шаблона блока
     */
    return Engine::getInstance()->Viewer_Fetch($sBlockTemplate);
}
예제 #18
0
 public function Init()
 {
     if (getRequest('set-theme', false, 'get')) {
         setcookie('theme', 1, time() + 60 * 60 * 24 * 30, Config::Get('sys.cookie.path'), Config::Get('sys.cookie.host'), false);
         $this->Viewer_AppendStyle(Plugin::GetTemplatePath(__CLASS__) . "css/dark.css");
         // Добавление своего CSS
     }
     //      $this->Viewer_AppendScript(Plugin::GetTemplatePath(__CLASS__)."js/script.js"); // Добавление своего JS
     //$this->Viewer_AddMenu('blog',Plugin::GetTemplatePath(__CLASS__).'menu.blog.tpl'); // например, задаем свой вид меню
 }
예제 #19
0
 public function ViewerInitStart($aParams)
 {
     //		Config::Set('view.skin','developer');
     if (in_array('SiteStyle', array_keys($_COOKIE))) {
         if ($_COOKIE['SiteStyle'] == 'Dark') {
             $this->Viewer_AppendStyle(Plugin::GetTemplatePath(__CLASS__) . "css/dark.css");
             // Добавление своего CSS
         }
     }
 }
 public function AddRssLink()
 {
     if (Config::Get('general.close') and Config::Get('plugin.getlasttopics.enable_rss')) {
         $aHtmlRssAlternate = null;
         $aHtmlRssAlternate['url'] = htmlspecialchars(Router::GetPath('rss'));
         $aHtmlRssAlternate['title'] = htmlspecialchars(Config::Get('view.name'));
         $this->Viewer_Assign('aHtmlRssAlternate', $aHtmlRssAlternate);
         return $this->Viewer_Fetch(Plugin::GetTemplatePath(__CLASS__) . 'rsslink.tpl');
     }
 }
 /**
  * Получаем список похожих топиков, передаем их в Viewer и добавляем нужный блок в сайдбар
  *
  * @param array $aVars
  */
 function topicShowed($aVars)
 {
     if (isset($aVars['oTopic'])) {
         $this->Viewer_AddBlock('right', 'similarTopics', array('plugin' => 'similar', 'oTopic' => $aVars['oTopic']), Config::Get('plugin.similar.topics_block_priority'));
     } elseif (isset($aVars['topic'])) {
         $this->Viewer_Assign('aSimilarTopics', $this->PluginSimilar_Similar_getSimilarTopicsForTopic($aVars['topic']));
         return $this->Viewer_Fetch(Plugin::GetTemplatePath(__CLASS__) . 'similarTopics.tpl');
     } else {
         return;
     }
 }
예제 #22
0
 public function WhoisActivityItem($aParams)
 {
     if ($this->PluginMobiletpl_Main_IsMobileTemplate()) {
         /**
          * Получаем последний топик пользователя
          */
         $oUser = $aParams['oUserProfile'];
         $oTopic = $this->PluginMobiletpl_Main_GetTopicLastbyUserId($oUser->getId());
         $this->Viewer_Assign('oTopicUserProfileLast', $oTopic);
         return $this->Viewer_Fetch(Plugin::GetTemplatePath(__CLASS__) . 'inject.profile.whois.activity-item.tpl');
     }
 }
예제 #23
0
 /**
  * Инициализация плагина
  */
 public function Init()
 {
     $this->Viewer_Assign('sGeoPostPluginPath', Plugin::GetTemplatePath(__CLASS__));
     $this->Viewer_AppendScript('http://cdn.leafletjs.com/leaflet-0.7.3/leaflet.js');
     $this->Viewer_AppendScript(Plugin::GetTemplateWebPath(__CLASS__) . 'js/leaflet.markercluster.js');
     $this->Viewer_AppendScript(Plugin::GetTemplateWebPath(__CLASS__) . 'js/geopost.js');
     $this->Viewer_AppendStyle('http://cdn.leafletjs.com/leaflet-0.7.3/leaflet.css');
     $this->Viewer_AppendStyle(Plugin::GetTemplateWebPath(__CLASS__) . 'css/geopost.css');
     $this->Viewer_AppendStyle(Plugin::GetTemplateWebPath(__CLASS__) . 'css/cluster.css');
     $this->Viewer_AppendScript(Plugin::GetTemplateWebPath(__CLASS__) . 'js/Leaflet.fullscreen.min.js');
     $this->Viewer_AppendStyle(Plugin::GetTemplateWebPath(__CLASS__) . 'css/leaflet.fullscreen.css');
 }
 public function BlogInfo($aVars)
 {
     $this->Viewer_Assign('aReq', array('sType' => 'topics', 'q' => ''));
     $this->Viewer_Assign('iSearchInOneBlogSelected', $aVars['oBlog']->getId());
     //
     // --- Blogs selectors ---
     //
     // Check up user and get accessible blogs for this user
     $aBlogsData = $this->PluginSimplesearch_Simplesearch_GetOpenClosePersonalBlogsByUser($this->User_GetUserCurrent(), array('open', 'close'));
     // set list of blogs for template
     $this->Viewer_Assign('aOpenCloseBlogsForCurrentUserObj', $this->Blog_GetBlogsAdditionalData($aBlogsData['openclose'], array()));
     return $this->Viewer_Fetch(Plugin::GetTemplatePath(__CLASS__) . 'search_form_wrapper.tpl');
 }
예제 #25
0
 /**
  * Добавляем чекбокс для публикации в группу
  */
 public function AddCheckBox($aA)
 {
     if (LS::Adm()) {
         if ($iTopicId = Router::GetParam(0)) {
             $oTopic = $this->Topic_GetTopicById($iTopicId);
             if ($oTopic) {
                 $this->Viewer_Assign('sVkPostId', $oTopic->getExtraValue('vk_post_id'));
             }
         }
         return $this->Viewer_Fetch(Plugin::GetTemplatePath(__CLASS__) . 'field.checkbox.tpl');
     }
     return null;
 }
 public function Exec()
 {
     $aResult = $this->PluginLsgallery_Image_GetImagesBest(1, Config::Get('plugin.lsgallery.image_row'));
     if ($aResult['count']) {
         $aImages = $aResult['collection'];
         $oViewer = $this->Viewer_GetLocalViewer();
         $oViewer->Assign('aImages', $aImages);
         $oViewer->Assign('sType', 'best');
         $oViewer->Assign('oUserCurrent', $this->oUserCurrent);
         $sTextResult = $oViewer->Fetch(Plugin::GetTemplatePath('lsgallery') . "block.stream_photo.tpl");
         $this->Viewer_Assign('sBestImages', $sTextResult);
     }
 }
예제 #27
0
 public function GetTemplateFilePath($sPluginClass, $sFileName)
 {
     $sPP = Plugin::GetTemplatePath($sPluginClass);
     $fName = $sPP . $sFileName;
     if (file_exists($fName)) {
         return $fName;
     }
     $aa = explode("/", $sPP);
     array_pop($aa);
     array_pop($aa);
     $aa[] = 'default';
     $aa[] = '';
     return join("/", $aa) . $sFileName;
 }
예제 #28
0
 public function TemplateFormAddTopicBegin()
 {
     $iTopicId = getRequest('topic_id');
     $oTopic = $this->Topic_GetTopicById($iTopicId);
     if ($oTopic) {
         $lat = $oTopic->getgLat();
         $long = $oTopic->getgLng();
     } else {
         $lat = 0;
         $long = 0;
     }
     $this->Viewer_Assign('geopost_lat', $lat);
     $this->Viewer_Assign('geopost_lng', $long);
     return $this->Viewer_Fetch(Plugin::GetTemplatePath('gmappost') . 'actions/ActionTopic/form_edit_topic.tpl');
 }
 public function EventPages()
 {
     if (!$this->PluginAceadminpanel_Plugin_PluginActivated('Page')) {
         return parent::EventNotFound();
     }
     $this->sMenuSubItemSelect = 'list';
     if ($sAdminAction = $this->_getRequestCheck('action')) {
         $this->EventPagesAction($sAdminAction);
     }
     // * Обработка создания новой страницы
     if ($this->_getRequestCheck('submit_page_save')) {
         if (!getRequest('page_id')) {
             $this->EventPagesAddSubmit();
         }
     }
     if ($this->GetParam(0) == 'new') {
         // создание новой страницы
         $this->sMenuSubItemSelect = 'new';
         $this->Viewer_Assign('include_tpl', Plugin::GetTemplatePath($this->sPlugin) . '/actions/ActionAdmin/pages_edit.tpl');
     } elseif ($this->GetParam(0) == 'edit') {
         // вывод формы для редактирования
         $this->EventPagesEdit();
         $this->Viewer_Assign('include_tpl', Plugin::GetTemplatePath($this->sPlugin) . '/actions/ActionAdmin/pages_edit.tpl');
     } elseif ($this->GetParam(0) == 'delete') {
         // отработка команды удаления
         $this->EventPagesDelSubmit();
         ACE::HeaderLocation(Router::GetPath('admin') . 'pages/');
         return;
     } elseif ($this->GetParam(0) == 'sort') {
         // отработка команды сортировки
         $this->EventPagesSort();
         ACE::HeaderLocation(Router::GetPath('admin') . 'pages/');
         return;
     } elseif ($this->GetParam(0) == 'options') {
         // вывод опций
         $this->sMenuSubItemSelect = 'options';
         $this->EventPagesOptions();
         $this->Viewer_Assign('include_tpl', Plugin::GetTemplatePath($this->sPlugin) . '/actions/ActionAdmin/pages_options.tpl');
     }
     // * Получаем и загружаем список всех страниц
     $aPages = $this->PluginPage_Page_GetPages();
     if (sizeof($aPages) == 0 and $this->PluginPage_Page_GetCountPage()) {
         $this->PluginPage_Page_SetPagesPidToNull();
         $aPages = $this->PluginPage_Page_GetPages();
     }
     $this->Viewer_Assign('aPages', $aPages);
 }
 public function Init()
 {
     $this->Viewer_AppendStyle(Plugin::GetTemplatePath(__CLASS__) . "css/style.css");
     // Добавление своего CSS
     /**
      * Добавляем в ленту новые типы событий
      */
     $this->Stream_AddEventType('add_testimonial', array('related' => 'Testimonials', 'unique' => true));
     /**
      * Добавляем в ленту текстовки новых типов событий
      */
     $this->Lang_AddMessage('stream_event_type_add_testimonial', $this->Lang_Get('plugin.testimonials.block_add_testimonial'));
     /**
      * Загружаем в шаблон
      */
     $this->Viewer_Assign('aLang', $this->Lang_GetLangMsg());
 }