a,reseller=>r. * * @param string $directory Directory to execute the controller from * @return mixed */ public function directory($directory = NULL) { // If $directory is NULL, we are a getter and see if we need to expand the directory if ($directory === NULL AND $this->_directory) $this->_directory = URL::dir($this->_directory); return parent::directory($directory); } /** * Get our Module_Method object for this request */ public function mmo() { static $result = FALSE; if (is_null($result) OR $result) return $result; $result = NULL; list($c,$x) = substr_count($this->_controller,'_') ? explode('_',$this->_controller,2) : array($this->_controller,''); $mo = ORM::factory('Module',array('name'=>$c)); if ($mo->loaded() AND $mo->status) { $method = strtolower($this->_directory ? sprintf('%s:%s',$this->_directory.($x ? '_'.$x : ''),$this->_action) : $this->_action); // Get the method number $mmo = $mo->module_method ->where_open() ->where('name','=',$method) ->or_where('name','=',str_replace(':','_',$method)) // @todo This is temporary until all our method names have a colon delimiter ->where_close() ->find(); if ($mmo->loaded()) $result = $mmo; } return $result; } } ?>