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


PHP Results::launch方法代码示例

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


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

示例1: launch

 function launch()
 {
     global $module;
     global $action;
     global $interface;
     //Get the search source and determine what to show.
     $searchSource = isset($_REQUEST['searchSource']) ? $_REQUEST['searchSource'] : 'local';
     //Check the search source
     if (preg_match('/library\\d+/', $searchSource)) {
         require_once ROOT_DIR . '/Drivers/marmot_inc/LibrarySearchSource.php';
         $trimmedId = str_replace('library', '', $searchSource);
         $searchSource = new LibrarySearchSource();
         $searchSource->id = $trimmedId;
         if ($searchSource->find(true)) {
             if ($searchSource->searchWhat == 'catalog') {
                 require_once ROOT_DIR . '/services/Search/Results.php';
                 $module = 'Search';
                 $interface->assign('module', $module);
                 $action = 'Results';
                 $interface->assign('action', $action);
                 $results = new Search_Results();
                 $results->launch();
             } elseif ($searchSource->searchWhat == 'genealogy') {
                 require_once ROOT_DIR . '/services/Genealogy/Results.php';
                 $module = 'Search';
                 $interface->assign('module', $module);
                 $action = 'Results';
                 $interface->assign('action', $action);
                 $results = new Results();
                 $results->launch();
             } elseif ($searchSource->searchWhat == 'tags') {
                 require_once ROOT_DIR . '/services/Search/Results.php';
                 $module = 'Search';
                 $interface->assign('module', $module);
                 $action = 'Results';
                 $interface->assign('action', $action);
                 $_REQUEST['basicType'] = 'tag';
                 $results = new Search_Results();
                 $results->launch();
             } elseif ($searchSource->searchWhat == 'title_browse' || $searchSource->searchWhat == 'author_browse' || $searchSource->searchWhat == 'subject_browse') {
                 require_once ROOT_DIR . '/services/AlphaBrowse/Results.php';
                 $module = 'AlphaBrowse';
                 $interface->assign('module', $module);
                 $action = 'Results';
                 $interface->assign('action', $action);
                 $results = new AlphaBrowse_Results();
                 $results->launch();
             } else {
                 $searchSources = new SearchSources();
                 $type = isset($_REQUEST['basicType']) ? $_REQUEST['basicType'] : $_REQUEST['type'];
                 $lookfor = isset($_REQUEST['lookfor']) ? $_REQUEST['lookfor'] : '';
                 $link = $searchSources->getExternalLink($searchSource, $type, $lookfor);
                 header('Location: ' . $link);
                 die;
             }
         }
     } else {
         $searchSources = new SearchSources();
         $searches = $searchSources->getSearchSources();
         if (!isset($searches[$searchSource]) && $searchSource == 'marmot') {
             $searchSource = 'local';
         }
         $searchInfo = $searches[$searchSource];
         if (isset($searchInfo['external']) && $searchInfo['external'] == true) {
             //Reset to a local search source so the external search isn't remembered
             $_SESSION['searchSource'] = 'local';
             //Need to redirect to the appropriate search location with the new value for look for
             $type = isset($_REQUEST['basicType']) ? $_REQUEST['basicType'] : $_REQUEST['type'];
             $lookfor = isset($_REQUEST['lookfor']) ? $_REQUEST['lookfor'] : '';
             $filters = isset($_REQUEST['filter']) ? $_REQUEST['filter'] : null;
             $link = $searchSources->getExternalLink($searchSource, $type, $lookfor);
             header('Location: ' . $link);
             die;
         } else {
             if ($searchSource == 'genealogy') {
                 require_once ROOT_DIR . '/services/Genealogy/Results.php';
                 $module = 'Search';
                 $interface->assign('module', $module);
                 $action = 'Results';
                 $interface->assign('action', $action);
                 $results = new Results();
                 $results->launch();
             } else {
                 $type = isset($_REQUEST['basicType']) ? $_REQUEST['basicType'] : (isset($_REQUEST['type']) ? $_REQUEST['type'] : 'Keyword');
                 if (strpos($type, 'browse') === 0) {
                     require_once ROOT_DIR . '/services/AlphaBrowse/Results.php';
                     $module = 'AlphaBrowse';
                     $interface->assign('module', $module);
                     $action = 'Results';
                     $interface->assign('action', $action);
                     $results = new AlphaBrowse_Results();
                     $results->launch();
                 } else {
                     require_once ROOT_DIR . '/services/Search/Results.php';
                     $module = 'Search';
                     $interface->assign('module', $module);
                     $action = 'Results';
                     $interface->assign('action', $action);
                     if ($searchSource == 'econtent') {
                         if (!isset($_REQUEST['shard'])) {
//.........这里部分代码省略.........
开发者ID:bryandease,项目名称:VuFind-Plus,代码行数:101,代码来源:Search.php


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