| Joomla! | PHP Cross Reference | Web Portals |
1 <?php 2 /** 3 * @package Joomla.Administrator 4 * @subpackage com_finder 5 * 6 * @copyright Copyright (C) 2005 - 2012 Open Source Matters, Inc. All rights reserved. 7 * @license GNU General Public License version 2 or later; see LICENSE 8 */ 9 10 defined('_JEXEC') or die; 11 12 /** 13 * Index controller class for Finder. 14 * 15 * @package Joomla.Administrator 16 * @subpackage com_finder 17 * @since 2.5 18 */ 19 class FinderControllerIndex extends JControllerAdmin 20 { 21 /** 22 * Method to get a model object, loading it if required. 23 * 24 * @param string $name The model name. Optional. 25 * @param string $prefix The class prefix. Optional. 26 * @param array $config Configuration array for model. Optional. 27 * 28 * @return object The model. 29 * 30 * @since 2.5 31 */ 32 public function getModel($name = 'Index', $prefix = 'FinderModel', $config = array('ignore_request' => true)) 33 { 34 $model = parent::getModel($name, $prefix, $config); 35 return $model; 36 } 37 38 /** 39 * Method to purge all indexed links from the database. 40 * 41 * @return boolean True on success. 42 * 43 * @since 2.5 44 */ 45 public function purge() 46 { 47 JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN')); 48 49 // Remove the script time limit. 50 @set_time_limit(0); 51 52 $model = $this->getModel('Index', 'FinderModel'); 53 54 // Attempt to purge the index. 55 $return = $model->purge(); 56 57 if (!$return) 58 { 59 $message = JText::_('COM_FINDER_INDEX_PURGE_FAILED', $model->getError()); 60 $this->setRedirect('index.php?option=com_finder&view=index', $message); 61 return false; 62 } 63 else 64 { 65 $message = JText::_('COM_FINDER_INDEX_PURGE_SUCCESS'); 66 $this->setRedirect('index.php?option=com_finder&view=index', $message); 67 return true; 68 } 69 } 70 }
title
Description
Body
title
Description
Body
title
Description
Body
title
Body
title