• Main Page
  • Related Pages
  • 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;
00049 
00050                 $this->ilias =& $ilias;
00051                 $this->ctrl =& $ilCtrl;
00052                 $this->lng =& $lng;
00053         }
00054 
00055         function getLastClass()
00056         {
00057                 return $_SESSION['search_last_class'] ? $_SESSION['search_last_class'] : 'ilsearchgui';
00058         }
00059         function setLastClass($a_class)
00060         {
00061                 $_SESSION['search_last_class'] = $a_class;
00062         }
00063 
00064         function &executeCommand()
00065         {
00066                 global $rbacsystem;
00067 
00068                 include_once 'Services/Search/classes/class.ilSearchSettings.php';
00069 
00070                 // Check hacks
00071                 if(!$rbacsystem->checkAccess('search',ilSearchSettings::_getSearchSettingRefId()))
00072                 {
00073                         $this->ilias->raiseError($this->lng->txt("permission_denied"),$this->ilias->error_obj->MESSAGE);
00074                 }
00075                 $forward_class = $this->ctrl->getNextClass($this) ? $this->ctrl->getNextClass($this) : $this->getLastClass();
00076                 switch($forward_class)
00077                 {
00078                         case 'ilsearchresultgui':
00079                                 // Remember last class
00080                                 $this->setLastClass('ilsearchresultgui');
00081 
00082                                 include_once 'Services/Search/classes/class.ilSearchResultGUI.php';
00083 
00084                                 $this->ctrl->forwardCommand(new ilSearchResultGUI());
00085                                 break;
00086 
00087                         case 'iladvancedsearchgui':
00088                                 // Remember last class
00089                                 $this->setLastClass('iladvancedsearchgui');
00090 
00091                                 include_once 'Services/Search/classes/class.ilAdvancedSearchGUI.php';
00092                                 
00093                                 $this->ctrl->forwardCommand(new ilAdvancedSearchGUI());
00094                                 break;
00095                                 
00096                         case 'ilsearchgui':
00097                                 // Remember last class
00098                                 $this->setLastClass('ilsearchgui');
00099 
00100                         default:
00101                                 include_once 'Services/Search/classes/class.ilSearchGUI.php';
00102 
00103                                 $search_gui = new ilSearchGUI();
00104                                 $this->ctrl->forwardCommand($search_gui);
00105                                 break;
00106                 }
00107                 return true;
00108         }
00109 }
00110 ?>

Generated on Fri Dec 13 2013 10:18:31 for ILIAS Release_3_5_x_branch .rev 46805 by  doxygen 1.7.1