queryMaps=$new_query_maps; } function registerBuildEvent($pseudo_class,$build_event_name) { $this->buildEvents[$pseudo_class]=$build_event_name; } /** * Returns build event by pseudo class * name if any defined in config * * @param string $pseudo_class * @return kEvent * @access public */ function &getBuildEvent($pseudo_class) { if( !isset($this->buildEvents[$pseudo_class]) ) return false; $event = new kEvent(); $event->Name=$this->buildEvents[$pseudo_class]; $event->MasterEvent=null; return $event; } /** * Allows to process any type of event * * @param kEvent $event * @access public */ function HandleEvent(&$event) { $event_handler =& $this->Application->recallObject($event->Prefix.'_EventHandler'); $event_handler->processEvent(&$event); } function ProcessRequest() { // 1. get events from $_POST $events=$this->Application->GetVar('events'); if($events===false) $events=Array(); // 2. if nothing there, then try to find them in $_GET if($this->queryMaps && !$events) { // if we got $_GET type submit (links, not javascript) foreach($this->queryMaps as $prefix_special => $query_map) { $query_map=array_flip($query_map); if(isset($query_map['event'])) { $events[$prefix_special]=$this->Application->GetVar($prefix_special.'_event'); } } } //print_pre($events); foreach($events as $prefix_special => $event_name) { if(!$event_name) continue; $event = new kEvent(); $event->Name=$event_name; $event->Prefix_Special=$prefix_special; $prefix_special=explode('.',$prefix_special); $event->Prefix=$prefix_special[0]; $event->Special=isset($prefix_special[1])?$prefix_special[1]:''; $event->redirect=$this->Application->RecallVar('redirect_to'); $this->HandleEvent(&$event); } } function registerHook($hookto_unit, $hookto_event_name, $mode, $do_unit, $do_event_name) { } function processHooks(&$event, $mode) { } /** * Set's new event for $prefix_special * passed * * @param string $prefix_special * @param string $event_name * @access public */ function setEvent($prefix_special,$event_name) { $actions =& $this->Application->recallObject('kActions'); $actions->Set('events['.$prefix_special.']',$event_name); } } ?>