Пример #1
0
 function configure(Model_CommunityTool $instance)
 {
     $tpl = DevblocksPlatform::getTemplateService();
     $tpl_path = dirname(dirname(dirname(__FILE__))) . '/templates/';
     // F&R
     $fnr_topics = DAO_FnrTopic::getWhere();
     $tpl->assign('fnr_topics', $fnr_topics);
     $sFnrTopics = DAO_CommunityToolProperty::get($instance->code, self::PARAM_FNR_TOPICS, '');
     $fnr_topics = !empty($sFnrTopics) ? unserialize($sFnrTopics) : array();
     $tpl->assign('enabled_topics', $fnr_topics);
     $tpl->display("file:{$tpl_path}portal/sc/config/resources.tpl");
 }
Пример #2
0
 function configure()
 {
     $tpl = DevblocksPlatform::getTemplateService();
     $tpl_path = dirname(dirname(dirname(__FILE__))) . '/templates/';
     //		$require_login = DAO_CommunityToolProperty::get(UmPortalHelper::getCode(),self::PARAM_REQUIRE_LOGIN, 0);
     //		$tpl->assign('kb_require_login', $require_login);
     // F&R
     $fnr_topics = DAO_FnrTopic::getWhere();
     $tpl->assign('fnr_topics', $fnr_topics);
     $sFnrTopics = DAO_CommunityToolProperty::get(UmPortalHelper::getCode(), self::PARAM_FNR_TOPICS, '');
     $fnr_topics = !empty($sFnrTopics) ? unserialize($sFnrTopics) : array();
     $tpl->assign('enabled_topics', $fnr_topics);
     $tpl->display("file:{$tpl_path}portal/sc/config/resources.tpl");
 }
Пример #3
0
 /**
  * @param $instance Model_CommunityTool 
  */
 public function configure(Model_CommunityTool $instance)
 {
     $tpl = DevblocksPlatform::getTemplateService();
     $tpl_path = dirname(dirname(__FILE__)) . '/templates/';
     $tpl->assign('config_path', $tpl_path);
     $settings = CerberusSettings::getInstance();
     $default_from = $settings->get(CerberusSettings::DEFAULT_REPLY_FROM);
     $tpl->assign('default_from', $default_from);
     $sDispatch = DAO_CommunityToolProperty::get($this->getPortal(), self::PARAM_DISPATCH, '');
     $dispatch = !empty($sDispatch) ? unserialize($sDispatch) : array();
     $tpl->assign('dispatch', $dispatch);
     $sHomeRss = DAO_CommunityToolProperty::get($this->getPortal(), self::PARAM_HOME_RSS, '');
     $home_rss = !empty($sHomeRss) ? unserialize($sHomeRss) : array();
     $tpl->assign('home_rss', $home_rss);
     $base_url = DAO_CommunityToolProperty::get($this->getPortal(), self::PARAM_BASE_URL, '');
     $tpl->assign('base_url', $base_url);
     $logo_url = DAO_CommunityToolProperty::get($this->getPortal(), self::PARAM_LOGO_URL, '');
     $tpl->assign('logo_url', $logo_url);
     $page_title = DAO_CommunityToolProperty::get($this->getPortal(), self::PARAM_PAGE_TITLE, 'Support Center');
     $tpl->assign('page_title', $page_title);
     $footer_html = DAO_CommunityToolProperty::get($this->getPortal(), self::PARAM_FOOTER_HTML, '');
     $tpl->assign('footer_html', $footer_html);
     $theme = DAO_CommunityToolProperty::get($this->getPortal(), self::PARAM_THEME, self::DEFAULT_THEME);
     if (!is_dir($tpl_path . 'portal/sc/themes/' . $theme)) {
         $theme = self::DEFAULT_THEME;
     }
     $tpl->assign('theme', $theme);
     $captcha_enabled = DAO_CommunityToolProperty::get($this->getPortal(), self::PARAM_CAPTCHA_ENABLED, 1);
     $tpl->assign('captcha_enabled', $captcha_enabled);
     $allow_logins = DAO_CommunityToolProperty::get($this->getPortal(), self::PARAM_ALLOW_LOGINS, 0);
     $tpl->assign('allow_logins', $allow_logins);
     $allow_subjects = DAO_CommunityToolProperty::get($this->getPortal(), self::PARAM_ALLOW_SUBJECTS, 0);
     $tpl->assign('allow_subjects', $allow_subjects);
     // Knowledgebase
     $tree_map = DAO_KbCategory::getTreeMap();
     $tpl->assign('tree_map', $tree_map);
     $levels = DAO_KbCategory::getTree(0);
     $tpl->assign('levels', $levels);
     $categories = DAO_KbCategory::getWhere();
     $tpl->assign('categories', $categories);
     $sKbRoots = DAO_CommunityToolProperty::get($this->getPortal(), self::PARAM_KB_ROOTS, '');
     $kb_roots = !empty($sKbRoots) ? unserialize($sKbRoots) : array();
     $tpl->assign('kb_roots', $kb_roots);
     //		$kb_topics = DAO_KbTopic::getWhere();
     //		$tpl->assign('kb_topics', $kb_topics);
     //
     //		$sKbTopics = DAO_CommunityToolProperty::get($this->getPortal(),self::PARAM_KB_TOPICS, '');
     //        $kb_topics_enabled = !empty($sKbTopics) ? unserialize($sKbTopics) : array();
     //        $tpl->assign('kb_topics_enabled', $kb_topics_enabled);
     // F&R
     $fnr_topics = DAO_FnrTopic::getWhere();
     $tpl->assign('topics', $fnr_topics);
     $sFnrSources = DAO_CommunityToolProperty::get($this->getPortal(), self::PARAM_FNR_SOURCES, '');
     $fnr_sources = !empty($sFnrSources) ? unserialize($sFnrSources) : array();
     $tpl->assign('fnr_sources', $fnr_sources);
     // Themes
     $themes = array();
     if (false !== ($dir = opendir($tpl_path . 'portal/sc/themes'))) {
         while ($file = readdir($dir)) {
             if (is_dir($tpl_path . 'portal/sc/themes/' . $file) && substr($file, 0, 1) != '.') {
                 $themes[] = $file;
             }
         }
         @closedir($dir);
     }
     $tpl->assign('themes', $themes);
     $groups = DAO_Group::getAll();
     $tpl->assign('groups', $groups);
     // Contact: Fields
     $ticket_fields = DAO_CustomField::getBySource('cerberusweb.fields.source.ticket');
     $tpl->assign('ticket_fields', $ticket_fields);
     $tpl->display("file:{$tpl_path}portal/sc/config/index.tpl");
 }
Пример #4
0
 private function _getTopicsListAction($path)
 {
     $topics = DAO_FnrTopic::getWhere();
     $xml_out = new SimpleXMLElement("<topics></topics>");
     foreach ($topics as $topic_id => $topic) {
         /* @var $topic Model_FnrTopic */
         $eTopic = $xml_out->addChild('topic');
         $eTopic->addChild('id', $topic->id);
         $eTopic->addChild('name', $topic->name);
         $eResources = $eTopic->addChild('resources');
         $resources = $topic->getResources();
         foreach ($resources as $resource) {
             /* @var $resource Model_FnrExternalResource */
             $eResource = $eResources->addChild('resource');
             $eResource->addChild('id', $resource->id);
             $eResource->addChild('name', $resource->name);
             $eResource->addChild('topic_id', $resource->topic_id);
             //				$eResource->addChild('url', $resource->url);
         }
     }
     $this->_render($xml_out->asXML());
 }
Пример #5
0
 function showTabFnrAction()
 {
     $tpl = DevblocksPlatform::getTemplateService();
     $tpl->cache_lifetime = "0";
     $tpl->assign('path', $this->_TPL_PATH);
     $topics = DAO_FnrTopic::getWhere();
     $tpl->assign('topics', $topics);
     $tpl->display('file:' . $this->_TPL_PATH . 'configuration/tabs/fnr/index.tpl');
 }
Пример #6
0
 public static function searchResources($resources, $query)
 {
     $feeds = array();
     $topics = DAO_FnrTopic::getWhere();
     if (is_array($resources)) {
         foreach ($resources as $resource) {
             /* @var $resource Model_FnrExternalResource */
             try {
                 $url = str_replace("#find#", rawurlencode($query), $resource->url);
                 $feed = Zend_Feed::import($url);
                 if ($feed->count()) {
                     $feeds[] = array('name' => $resource->name, 'topic_name' => @$topics[$resource->topic_id]->name, 'feed' => $feed);
                 }
             } catch (Exception $e) {
             }
         }
     }
     return $feeds;
 }