Changeset View
Changeset View
Standalone View
Standalone View
branches/5.2.x/core/kernel/managers/plain_url_processor.php
Show First 20 Lines • Show All 108 Lines • ▼ Show 20 Line(s) | |||||
$mixed_part = Array(); | $mixed_part = Array(); | ||||
foreach ($escaped_part as $escaped_val) { | foreach ($escaped_part as $escaped_val) { | ||||
$mixed_part[] = str_replace('_&+$$+&_', '-', $escaped_val); | $mixed_part[] = str_replace('_&+$$+&_', '-', $escaped_val); | ||||
} | } | ||||
$vars = Array (); | $vars = Array (); | ||||
$prefix_special = array_shift($mixed_part); // l.pick, l | $prefix_special = array_shift($mixed_part); // l.pick, l | ||||
/** @var kHTTPQuery $http_query */ | |||||
$http_query = $this->Application->recallObject('HTTPQuery'); | $http_query = $this->Application->recallObject('HTTPQuery'); | ||||
/* @var $http_query kHTTPQuery */ | |||||
$query_map = $http_query->discoverUnit($prefix_special); // from $_GET['env'] | $query_map = $http_query->discoverUnit($prefix_special); // from $_GET['env'] | ||||
// if config is not defined for prefix in QueryString, then don't process it | // if config is not defined for prefix in QueryString, then don't process it | ||||
if ($query_map) { | if ($query_map) { | ||||
foreach ($query_map as $index => $var_name) { | foreach ($query_map as $index => $var_name) { | ||||
// l_id, l_page, l_bla-bla-bla | // l_id, l_page, l_bla-bla-bla | ||||
$val = $mixed_part[$index - 1]; | $val = $mixed_part[$index - 1]; | ||||
▲ Show 20 Lines • Show All 91 Lines • ▼ Show 20 Line(s) | |||||
* @param Array $params url params | * @param Array $params url params | ||||
* @param bool $pass_events | * @param bool $pass_events | ||||
* @return string | * @return string | ||||
* @access public | * @access public | ||||
*/ | */ | ||||
public function BuildModuleEnv($prefix_special, &$params, $pass_events = false) | public function BuildModuleEnv($prefix_special, &$params, $pass_events = false) | ||||
{ | { | ||||
list($prefix) = explode('.', $prefix_special); | list($prefix) = explode('.', $prefix_special); | ||||
/** @var Array $query_vars */ | |||||
$query_vars = $this->Application->getUnitOption($prefix, 'QueryString', Array ()); | $query_vars = $this->Application->getUnitOption($prefix, 'QueryString', Array ()); | ||||
/* @var $query_vars Array */ | |||||
//if pass events is off and event is not implicitly passed | //if pass events is off and event is not implicitly passed | ||||
if ( !$pass_events && !isset($params[$prefix_special . '_event']) ) { | if ( !$pass_events && !isset($params[$prefix_special . '_event']) ) { | ||||
$params[$prefix_special . '_event'] = ''; // remove event from url if requested | $params[$prefix_special . '_event'] = ''; // remove event from url if requested | ||||
//otherwise it will use value from get_var | //otherwise it will use value from get_var | ||||
} | } | ||||
if ( !$query_vars ) { | if ( !$query_vars ) { | ||||
Show All 19 Lines | |||||
$ret = implode('-', $escaped); | $ret = implode('-', $escaped); | ||||
if ( $this->Application->getUnitOption($prefix, 'PortalStyleEnv') == true ) { | if ( $this->Application->getUnitOption($prefix, 'PortalStyleEnv') == true ) { | ||||
$ret = preg_replace('/^([a-zA-Z]+)-([0-9]+)-(.*)/', '\\1\\2-\\3', $ret); | $ret = preg_replace('/^([a-zA-Z]+)-([0-9]+)-(.*)/', '\\1\\2-\\3', $ret); | ||||
} | } | ||||
return $ret; | return $ret; | ||||
} | } | ||||
} | } | ||||
No newline at end of file | No newline at end of file |