Changeset View
Changeset View
Standalone View
Standalone View
branches/5.3.x/core/units/admin/admin_tag_processor.php
Show First 20 Lines • Show All 451 Lines • ▼ Show 20 Line(s) | |||||
$block_params['icon_module'] = $icon_module; | $block_params['icon_module'] = $icon_module; | ||||
$block_params['icon'] = $icon; | $block_params['icon'] = $icon; | ||||
$block_params['title'] = $config->getSetting($params['title_property']); | $block_params['title'] = $config->getSetting($params['title_property']); | ||||
return $this->Application->ParseBlock($block_params); | return $this->Application->ParseBlock($block_params); | ||||
} | } | ||||
/** | /** | ||||
* Allows to construct link for opening any type of catalog item selector | * Allows to construct link for opening any type of catalog item selector. | ||||
* | |||||
* @param array $params Tag params. | |||||
* | * | ||||
* @param Array $params | |||||
* @return string | * @return string | ||||
*/ | */ | ||||
function SelectorLink($params) | function SelectorLink($params) | ||||
{ | { | ||||
$template = $this->SelectParam($params, 't,template'); | |||||
if ( !$template ) { | |||||
$mode = 'catalog'; | $mode = 'catalog'; | ||||
if (isset($params['mode'])) { // {catalog, advanced_view} | |||||
// {catalog, advanced_view} | |||||
if ( isset($params['mode']) ) { | |||||
$mode = $params['mode']; | $mode = $params['mode']; | ||||
unset($params['mode']); | unset($params['mode']); | ||||
} | } | ||||
$params['t'] = 'catalog/item_selector/item_selector_'.$mode; | $params['t'] = 'catalog/item_selector/item_selector_' . $mode; | ||||
} | |||||
if ( !isset($params['m_cat_id']) ) { | |||||
$params['m_cat_id'] = $this->Application->getBaseCategory(); | $params['m_cat_id'] = $this->Application->getBaseCategory(); | ||||
} | |||||
$default_params = Array('pass' => 'all,'.$params['prefix']); | $default_params = array('pass' => 'all'); | ||||
if ( isset($params['prefix']) && $params['prefix'] ) { | |||||
$default_params['pass'] .= ',' . $params['prefix']; | |||||
unset($params['prefix']); | unset($params['prefix']); | ||||
} | |||||
$pass_through = Array(); | $pass_through = $this->Application->GetVar('pass_through', ''); | ||||
if (isset($params['tabs_dependant'])) { // {yes, no} | |||||
$pass_through['td'] = $params['tabs_dependant']; | if ( isset($params['pass_through']) && $params['pass_through'] ) { | ||||
$pass_through .= ',' . $params['pass_through']; | |||||
} | |||||
$pass_through = array_filter(explode(',', $pass_through)); | |||||
// {yes, no} | |||||
if ( isset($params['tabs_dependant']) ) { | |||||
$params['td'] = $params['tabs_dependant']; | |||||
$pass_through[] = 'td'; | |||||
unset($params['tabs_dependant']); | unset($params['tabs_dependant']); | ||||
} | } | ||||
if (isset($params['selection_mode'])) { // {single, multi} | // {single, multi} | ||||
$pass_through['tm'] = $params['selection_mode']; | if ( isset($params['selection_mode']) ) { | ||||
$params['tm'] = $params['selection_mode']; | |||||
$pass_through[] = 'tm'; | |||||
unset($params['selection_mode']); | unset($params['selection_mode']); | ||||
} | } | ||||
if (isset($params['tab_prefixes'])) { // {all, none, <comma separated prefix list>} | // {all, none, <comma separated prefix list>} | ||||
$pass_through['tp'] = $params['tab_prefixes']; | if ( isset($params['tab_prefixes']) ) { | ||||
$params['tp'] = $params['tab_prefixes']; | |||||
$pass_through[] = 'tp'; | |||||
unset($params['tab_prefixes']); | unset($params['tab_prefixes']); | ||||
} | } | ||||
if ($pass_through) { | if ( $pass_through ) { | ||||
// add pass_through to selector url if any | // Add pass_through to selector url if any. | ||||
$params['pass_through'] = implode(',', array_keys($pass_through)); | $params['pass_through'] = implode(',', array_unique($pass_through)); | ||||
$params = array_merge($params, $pass_through); | |||||
} | } | ||||
// user can override default parameters (except pass_through of course) | // user can override default parameters (except pass_through of course) | ||||
$params = array_merge($default_params, $params); | $params = array_merge($default_params, $params); | ||||
return $this->Application->ProcessParsedTag('m', 'T', $params); | return $this->Application->ProcessParsedTag('m', 'T', $params); | ||||
} | } | ||||
function TimeFrame($params) | function TimeFrame($params) | ||||
{ | { | ||||
$w = date('w'); | $w = date('w'); | ||||
$m = date('m'); | $m = date('m'); | ||||
$y = date('Y'); | $y = date('Y'); | ||||
▲ Show 20 Lines • Show All 675 Lines • ▼ Show 20 Line(s) | |||||
$block_params = $this->prepareTagParams($params); | $block_params = $this->prepareTagParams($params); | ||||
$block_params['name'] = $params['render_as']; | $block_params['name'] = $params['render_as']; | ||||
$block_params['resource_extension'] = $extension; | $block_params['resource_extension'] = $extension; | ||||
$block_params['resource_file'] = $name . '/' . $filename; | $block_params['resource_file'] = $name . '/' . $filename; | ||||
return $this->Application->ParseBlock($block_params); | return $this->Application->ParseBlock($block_params); | ||||
} | } | ||||
} | } | ||||
No newline at end of file |