当前位置: 首页>>代码示例>>PHP>>正文


PHP SearchHelper::getSavedSearches方法代码示例

本文整理汇总了PHP中SearchHelper::getSavedSearches方法的典型用法代码示例。如果您正苦于以下问题:PHP SearchHelper::getSavedSearches方法的具体用法?PHP SearchHelper::getSavedSearches怎么用?PHP SearchHelper::getSavedSearches使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在SearchHelper的用法示例。


在下文中一共展示了SearchHelper::getSavedSearches方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: render

 function render()
 {
     $oTemplating =& KTTemplating::getSingleton();
     $oTemplate = $oTemplating->loadTemplate("ktcore/search2/search_portlet");
     $iFolderId = KTUtil::arrayGet($_REQUEST, 'fFolderId', 1);
     $iDocumentId = KTUtil::arrayGet($_REQUEST, 'fDocumentId');
     if (!$iFolderId && !$iDocumentId) {
         return null;
     }
     $savedSearches = SearchHelper::getSavedSearches($_SESSION['userID']);
     $aTemplateData = array('context' => $this, 'folder_id' => $iFolderId, 'document_id' => $iDocumentId, 'savedSearches' => $savedSearches);
     return $oTemplate->render($aTemplateData);
 }
开发者ID:5haman,项目名称:knowledgetree,代码行数:13,代码来源:Search2Portlet.php

示例2: render

 function render()
 {
     global $default;
     $oConfig = KTConfig::getSingleton();
     if (empty($this->contents)) {
         $this->contents = "";
     }
     if (is_string($this->contents) && trim($this->contents) === "") {
         $this->addError(_kt("This page did not produce any content"));
         $this->contents = "";
     }
     if (!is_string($this->contents)) {
         $this->contents = $this->contents->render();
     }
     // if we have no portlets, make the ui a tad nicer.
     if (empty($this->portlets)) {
         $this->show_portlets = false;
     }
     if (empty($this->title)) {
         if (!empty($this->breadcrumbDetails)) {
             $this->title = $this->breadcrumbDetails;
         } else {
             if (!empty($this->breadcrumbs)) {
                 $this->title = array_slice($this->breadcrumbs, -1);
                 $this->title = $this->title[0]['label'];
             } else {
                 if (!empty($this->breadcrumbSection)) {
                     $this->title = $this->breadcrumbSection['label'];
                 } else {
                     $this->title = $this->componentLabel;
                 }
             }
         }
     }
     $this->userMenu = array();
     $sBaseUrl = KTUtil::kt_url();
     if (!(PEAR::isError($this->user) || is_null($this->user) || $this->user->isAnonymous())) {
         if ($oConfig->get("user_prefs/restrictPreferences", false) && !Permission::userIsSystemAdministrator($this->user->getId())) {
             $this->userMenu['logout'] = array('label' => _kt('Logout'), 'url' => $sBaseUrl . '/presentation/logout.php');
         } else {
             if ($default->enableESignatures) {
                 $sUrl = KTPluginUtil::getPluginPath('electronic.signatures.plugin', true);
                 $heading = _kt('You are attempting to modify Preferences');
                 $this->userMenu['preferences']['url'] = '#';
                 $this->userMenu['preferences']['onclick'] = "javascript: showSignatureForm('{$sUrl}', '{$heading}', 'dms.administration.accessing_preferences', 'system', '{$sBaseUrl}/preferences.php', 'redirect');";
             } else {
                 $this->userMenu['preferences']['url'] = $sBaseUrl . '/preferences.php';
             }
             //	        $this->userMenu['preferences'] = array('label' => _kt('Preferences'), 'url' => $sBaseUrl.'/preferences.php');
             $this->userMenu['preferences']['label'] = _kt('Preferences');
             $this->userMenu['aboutkt'] = array('label' => _kt('About'), 'url' => $sBaseUrl . '/about.php');
             $this->userMenu['logout'] = array('label' => _kt('Logout'), 'url' => $sBaseUrl . '/presentation/logout.php');
         }
     } else {
         $this->userMenu['login'] = array('label' => _kt('Login'), 'url' => $sBaseUrl . '/login.php');
     }
     // FIXME we need a more complete solution to navigation restriction
     if (!is_null($this->menu['administration']) && !is_null($this->user)) {
         if (!Permission::userIsSystemAdministrator($this->user->getId())) {
             unset($this->menu['administration']);
         }
     }
     $sContentType = 'Content-type: ' . $this->contentType;
     if (!empty($this->charset)) {
         $sContentType .= '; charset=' . $this->charset;
     }
     header($sContentType);
     $savedSearches = SearchHelper::getSavedSearches($_SESSION['userID']);
     $oTemplating =& KTTemplating::getSingleton();
     $oTemplate = $oTemplating->loadTemplate($this->template);
     $aTemplateData = array("page" => $this, "systemversion" => $default->systemVersion, "versionname" => $default->versionName, 'smallVersion' => substr($default->versionName, -17), 'savedSearches' => $savedSearches);
     if ($oConfig->get("ui/automaticRefresh", false)) {
         $aTemplateData['refreshTimeout'] = (int) $oConfig->get("session/sessionTimeout") + 3;
     }
     // unlike the rest of KT, we use echo here.
     echo $oTemplate->render($aTemplateData);
 }
开发者ID:jpbauer,项目名称:knowledgetree,代码行数:77,代码来源:kt3template.inc.php

示例3: getSavedSearches

 public static function getSavedSearches($userID)
 {
     $rs = SearchHelper::getSavedSearches($userID);
     if (PEAR::isError($rs)) {
         AjaxSearchHelper::createResponse(AjaxSearchHelper::STATUS_INTERNAL);
     }
     AjaxSearchHelper::createResponse(AjaxSearchHelper::STATUS_SUCCESS, null, 'searches', $rs);
 }
开发者ID:sfsergey,项目名称:knowledgetree,代码行数:8,代码来源:ajax.inc.php

示例4: get_list

 /**
  * This method gets a list of saved searches
  *
  * @author KnowledgeTree Tean
  * @access public
  * @return array|object $list SUCESS - The list of saved searches | FAILURE - an error object
  */
 public function get_list()
 {
     $user = $this->ktapi->get_user();
     if (is_null($user) || PEAR::isError($user)) {
         $list = new PEAR_Error(KTAPI_ERROR_USER_INVALID);
         return $list;
     }
     $userID = $user->getId();
     $list = SearchHelper::getSavedSearches($userID);
     if (PEAR::isError($list)) {
         $list = new PEAR_Error('Invalid saved search result');
         return $list;
     }
     return $list;
 }
开发者ID:5haman,项目名称:knowledgetree,代码行数:22,代码来源:ktapi.inc.php


注:本文中的SearchHelper::getSavedSearches方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。