'ezcGrcActionSitelist', 'sitedetails' => 'ezcGrcActionSitedetails', 'sitenew' => 'ezcGrcActionSitenew', 'searchdetails' => 'ezcGrcActionSearchdetails', 'searchnew' => 'ezcGrcActionSearchnew', 'resultdetails' => 'ezcGrcActionResultdetails', ); private $action; public function __construct() { $action = "sitelist"; if ( ezcInputForm::hasGetData() ) { $definition = array( 'action' => new ezcInputFormDefinitionElement( ezcInputFormDefinitionElement::REQUIRED, 'string' ), ); $form = new ezcInputForm( INPUT_GET, $definition ); $action = ( $form->hasValidData( 'action' ) ) ? $form->action : $action; } if ( !isset( $this->actions[$action] ) ) { throw new Exception( "Invalid action <".htmlentities($action).">." ); } $actionClass = $this->actions[$action]; $this->action = new $actionClass; $eztConfig = ezcTemplateConfiguration::getInstance(); $eztConfig->templatePath = dirname( __FILE__ ) . "/templates"; $eztConfig->compilePath = dirname( __FILE__ ) . "/templatesc"; } public function run() { $this->action->run(); $template = new ezcTemplate(); $template->send->action = $this->action; echo $template->process( $this->action->template . ".ezt" ); } public static function getSession() { if ( self::$session === null ) { self::$session = new ezcPersistentSession( ezcDbInstance::get(), new ezcPersistentCodeManager( dirname( __FILE__ ) . "/persistent" ) ); } return self::$session; } public static function getConfig() { if ( self::$config === null ) { self::$config = ezcConfigurationManager::getInstance(); self::$config->init( 'ezcConfigurationIniReader', dirname( __FILE__ ) . "/config" ); } return self::$config; } public static function performAllSearches() { foreach ( ezcGrcSearch::getAllSearches() as $search ) { try { $res = $search->performSearch( 20 ); self::getSession()->save( $res ); } catch (Exception $e) {} } } } ?>