示例#1
0
文件: kb.php 项目: Hildy/cerb5
 function configure(Model_CommunityTool $instance)
 {
     $tpl = DevblocksPlatform::getTemplateService();
     $tpl_path = dirname(dirname(dirname(__FILE__))) . '/templates/';
     // 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($instance->code, self::PARAM_KB_ROOTS, '');
     $kb_roots = !empty($sKbRoots) ? unserialize($sKbRoots) : array();
     $tpl->assign('kb_roots', $kb_roots);
     $tpl->display("file:{$tpl_path}portal/sc/config/kb.tpl");
 }
示例#2
0
文件: UmScApp.php 项目: joegeck/cerb4
 /**
  * @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");
 }
示例#3
0
文件: App.php 项目: rmiddle/cerb4
 function showArticlesBulkPanelAction()
 {
     @($id_csv = DevblocksPlatform::importGPC($_REQUEST['ids']));
     @($view_id = DevblocksPlatform::importGPC($_REQUEST['view_id']));
     $tpl = DevblocksPlatform::getTemplateService();
     $path = dirname(dirname(__FILE__)) . '/templates/';
     $tpl->assign('path', $path);
     $tpl->assign('view_id', $view_id);
     if (!empty($id_csv)) {
         $ids = DevblocksPlatform::parseCsvString($id_csv);
         $tpl->assign('ids', implode(',', $ids));
     }
     // Categories
     $categories = DAO_KbCategory::getWhere();
     $tpl->assign('categories', $categories);
     $levels = DAO_KbCategory::getTree(0);
     //$root_id
     $tpl->assign('levels', $levels);
     // Custom Fields
     //		$custom_fields = DAO_CustomField::getBySource(ChCustomFieldSource_FeedbackEntry::ID);
     //		$tpl->assign('custom_fields', $custom_fields);
     $tpl->cache_lifetime = "0";
     $tpl->display('file:' . $path . 'ajax/articles_bulk_panel.tpl');
 }
示例#4
0
文件: classes.php 项目: joegeck/cerb4
 /**
  * @param $instance Model_CommunityTool 
  */
 public function configure(Model_CommunityTool $instance)
 {
     $tpl = DevblocksPlatform::getTemplateService();
     $tpl_path = dirname(__FILE__) . '/templates/';
     $tpl->assign('config_path', $tpl_path);
     $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, 'Knowledgebase');
     $tpl->assign('page_title', $page_title);
     $captcha_enabled = DAO_CommunityToolProperty::get($this->getPortal(), self::PARAM_CAPTCHA_ENABLED, 1);
     $tpl->assign('captcha_enabled', $captcha_enabled);
     // Roots
     $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);
     $tpl->display("file:{$tpl_path}portal/kb/config/index.tpl");
 }
示例#5
0
文件: kb.php 项目: jsjohnst/cerb4
 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);
     // 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(UmPortalHelper::getCode(), self::PARAM_KB_ROOTS, '');
     $kb_roots = !empty($sKbRoots) ? unserialize($sKbRoots) : array();
     $tpl->assign('kb_roots', $kb_roots);
     $tpl->display("file:{$tpl_path}portal/sc/config/kb.tpl");
 }
示例#6
0
文件: App.php 项目: jsjohnst/cerb4
 function showKbCategoryEditPanelAction()
 {
     $active_worker = CerberusApplication::getActiveWorker();
     if (!$active_worker->hasPriv('core.kb.categories.modify')) {
         return;
     }
     @($id = DevblocksPlatform::importGPC($_REQUEST['id']));
     @($root_id = DevblocksPlatform::importGPC($_REQUEST['root_id']));
     @($return = DevblocksPlatform::importGPC($_REQUEST['return']));
     $tpl = DevblocksPlatform::getTemplateService();
     $tpl->cache_lifetime = "0";
     $tpl->assign('path', $this->_TPL_PATH);
     $tpl->assign('root_id', $root_id);
     $tpl->assign('return', $return);
     if (!empty($id)) {
         $category = DAO_KbCategory::get($id);
         $tpl->assign('category', $category);
     }
     /*
      * [TODO] Remove the current category + descendents from the categories, 
      * so the worker can't create a closed subtree (e.g. category's parent is its child)
      */
     $categories = DAO_KbCategory::getWhere();
     $tpl->assign('categories', $categories);
     $levels = DAO_KbCategory::getTree(0);
     //$root_id
     $tpl->assign('levels', $levels);
     $tpl->display('file:' . $this->_TPL_PATH . 'ajax/subcategory_edit_panel.tpl');
 }