setManager($manager); } /** * Sets reference to url manager * * @param kUrlManager $manager * @return void * @access public */ public function setManager(&$manager) { $this->manager =& $manager; } /** * Returns sorted array of passed prefixes (to build url from) * * @param string $pass * @return Array * @access protected */ protected function getPassInfo($pass = 'all') { if ( !$pass ) { $pass = 'all'; } $pass = trim( preg_replace( '/(?<=,|\\A)all(?=,|\\z)/', trim($this->Application->GetVar('passed'), ','), trim($pass, ',') ), ','); if ( !$pass ) { return Array (); } $pass_info = array_unique(explode(',', $pass)); // array( prefix[.special], prefix[.special] ... // we need to keep that sorting despite the sorting below, because this sorts prefixes with same priority by name sort($pass_info, SORT_STRING); // to be prefix1,prefix1.special1,prefix1.special2,prefix3.specialX foreach ($pass_info as $prefix) { list ($prefix_only,) = explode('.', $prefix, 2); if ( isset($this->Application->routers[$prefix_only]) ) { $sorted[$prefix] = (int)$this->Application->routers[$prefix_only]['priority']; } else { $sorted[$prefix] = 0; } } asort($sorted, SORT_NUMERIC); $pass_info = array_keys($sorted); // ensure that "m" prefix is at the beginning $main_index = array_search('m', $pass_info); if ( $main_index !== false ) { unset($pass_info[$main_index]); array_unshift($pass_info, 'm'); } return $pass_info; } /** * Builds url * * @param string $t * @param Array $params * @param string $pass * @param bool $pass_events * @param bool $env_var * @return string * @access public */ abstract public function build($t, $params, $pass='all', $pass_events = false, $env_var = true); /** * Parses given string into a set of variables * * @abstract * @param string $string * @param string $pass_name * @return Array * @access public */ abstract public function parse($string, $pass_name = 'passed'); /** * Builds env part that corresponds prefix passed * * @param string $prefix_special item's prefix & [special] * @param Array $params url params * @param bool $pass_events * @return string * @access protected */ abstract protected function BuildModuleEnv($prefix_special, &$params, $pass_events = false); }