• Main Page
  • Related Pages
  • Modules
  • Namespaces
  • Data Structures
  • Files
  • File List
  • Globals

Services/Search/classes/class.ilSearchController.php

Go to the documentation of this file.
00001 <?php
00002 /*
00003         +-----------------------------------------------------------------------------+
00004         | ILIAS open source                                                           |
00005         +-----------------------------------------------------------------------------+
00006         | Copyright (c) 1998-2001 ILIAS open source, University of Cologne            |
00007         |                                                                             |
00008         | This program is free software; you can redistribute it and/or               |
00009         | modify it under the terms of the GNU General Public License                 |
00010         | as published by the Free Software Foundation; either version 2              |
00011         | of the License, or (at your option) any later version.                      |
00012         |                                                                             |
00013         | This program is distributed in the hope that it will be useful,             |
00014         | but WITHOUT ANY WARRANTY; without even the implied warranty of              |
00015         | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the               |
00016         | GNU General Public License for more details.                                |
00017         |                                                                             |
00018         | You should have received a copy of the GNU General Public License           |
00019         | along with this program; if not, write to the Free Software                 |
00020         | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.| 
00021         +-----------------------------------------------------------------------------+
00022 */
00023 
00036 class ilSearchController
00037 {
00038         var $ctrl = null;
00039         var $ilias = null;
00040         var $lng = null;
00041 
00046         function ilSearchController()
00047         {
00048                 global $ilCtrl,$ilias,$lng,$tpl;
00049 
00050                 $this->ilias = $ilias;
00051                 $this->ctrl = $ilCtrl;
00052                 $this->lng = $lng;
00053                 $this->tpl = $tpl;
00054         }
00055 
00056         function getLastClass()
00057         {
00058                 return $_SESSION['search_last_class'] ? $_SESSION['search_last_class'] : 'ilsearchgui';
00059         }
00060         function setLastClass($a_class)
00061         {
00062                 $_SESSION['search_last_class'] = $a_class;
00063         }
00064 
00065         function &executeCommand()
00066         {
00067                 global $rbacsystem,$ilUser;
00068                 
00069                 // Check for incomplete profile
00070                 if($ilUser->getProfileIncomplete())
00071                 {
00072                         ilUtil::redirect('ilias.php?baseClass=ilPersonalDesktopGUI');
00073                 }
00074                 
00075 
00076                 include_once 'Services/Search/classes/class.ilSearchSettings.php';
00077 
00078                 // Check hacks
00079                 if(!$rbacsystem->checkAccess('search',ilSearchSettings::_getSearchSettingRefId()))
00080                 {
00081                         $this->ilias->raiseError($this->lng->txt("permission_denied"),$this->ilias->error_obj->MESSAGE);
00082                 }
00083                 $forward_class = $this->ctrl->getNextClass($this) ? $this->ctrl->getNextClass($this) : $this->getLastClass();
00084                 
00085                 switch($forward_class)
00086                 {
00087                         case 'ilsearchresultgui':
00088                                 // Remember last class
00089                                 $this->setLastClass('ilsearchresultgui');
00090 
00091                                 include_once 'Services/Search/classes/class.ilSearchResultGUI.php';
00092 
00093                                 $this->ctrl->forwardCommand(new ilSearchResultGUI());
00094                                 break;
00095 
00096                         case 'iladvancedsearchgui':
00097                                 // Remember last class
00098                                 $this->setLastClass('iladvancedsearchgui');
00099 
00100                                 include_once 'Services/Search/classes/class.ilAdvancedSearchGUI.php';
00101                                 
00102                                 $this->ctrl->forwardCommand(new ilAdvancedSearchGUI());
00103                                 break;
00104                                 
00105                         case 'ilsearchgui':
00106                                 // Remember last class
00107                                 $this->setLastClass('ilsearchgui');
00108 
00109                         default:
00110                                 include_once 'Services/Search/classes/class.ilSearchGUI.php';
00111 
00112                                 $search_gui = new ilSearchGUI();
00113                                 $this->ctrl->forwardCommand($search_gui);
00114                                 break;
00115                 }
00116                 $this->tpl->show();
00117                 
00118                 return true;
00119         }
00120 }
00121 ?>

Generated on Fri Dec 13 2013 17:57:01 for ILIAS Release_3_9_x_branch .rev 46835 by  doxygen 1.7.1