Index: branches/5.3.x/core/admin_templates/catalog/advanced_view.tpl =================================================================== --- branches/5.3.x/core/admin_templates/catalog/advanced_view.tpl +++ branches/5.3.x/core/admin_templates/catalog/advanced_view.tpl @@ -38,7 +38,7 @@ this.switchTab(); } - var $Catalog = new Catalog('', 'advanced_view_', 'AdvancedView'); + var $Catalog = new Catalog('', 'advanced_view_', 'AdvancedView'); var a_toolbar = new ToolBar(); @@ -146,4 +146,4 @@ ); - \ No newline at end of file + Index: branches/5.3.x/core/admin_templates/catalog/item_selector/item_selector_advanced_view.tpl =================================================================== --- branches/5.3.x/core/admin_templates/catalog/item_selector/item_selector_advanced_view.tpl +++ branches/5.3.x/core/admin_templates/catalog/item_selector/item_selector_advanced_view.tpl @@ -21,7 +21,7 @@ this.switchTab(); } - var $Catalog = new Catalog('', 'is_advanced_view_', 'ItemSelectorAdvancedView'); + var $Catalog = new Catalog('', 'is_advanced_view_', 'ItemSelectorAdvancedView'); @@ -51,4 +51,4 @@ ); - \ No newline at end of file + Index: branches/5.3.x/core/admin_templates/catalog/item_selector/item_selector_catalog.tpl =================================================================== --- branches/5.3.x/core/admin_templates/catalog/item_selector/item_selector_catalog.tpl +++ branches/5.3.x/core/admin_templates/catalog/item_selector/item_selector_catalog.tpl @@ -15,7 +15,7 @@ "/> @@ -41,4 +41,4 @@ ); - \ No newline at end of file + Index: branches/5.3.x/core/admin_templates/reviews/reviews.tpl =================================================================== --- branches/5.3.x/core/admin_templates/reviews/reviews.tpl +++ branches/5.3.x/core/admin_templates/reviews/reviews.tpl @@ -41,7 +41,7 @@ } } - var $Catalog = new Catalog('', 'reviews_', 'Reviews'); + var $Catalog = new Catalog('', 'reviews_', 'Reviews'); var a_toolbar = new ToolBar(); a_toolbar.AddButton( new ToolBarButton('edit', '', edit) ); @@ -84,7 +84,7 @@ var $kf = document.getElementById($form_name); var $prev_action = $kf.action; - $kf.action = '' . replace('#PREFIX#', $Catalog.ActivePrefix); + $kf.action = '' . replace('#PREFIX#', $Catalog.ActivePrefix); std_edit_temp_item( $Catalog.ActivePrefix, 'reviews/review_direct_edit', @@ -120,4 +120,4 @@ ); - \ No newline at end of file + Index: branches/5.3.x/core/admin_templates/users/user_edit_items.tpl =================================================================== --- branches/5.3.x/core/admin_templates/users/user_edit_items.tpl +++ branches/5.3.x/core/admin_templates/users/user_edit_items.tpl @@ -42,7 +42,7 @@ } }*/ - var $Catalog = new Catalog('', 'useritems_', 'UserItemEditor'); + var $Catalog = new Catalog('', 'useritems_', 'UserItemEditor'); a_toolbar = new ToolBar(); a_toolbar.AddButton( new ToolBarButton('select', '', function() { @@ -167,4 +167,4 @@ ); - \ No newline at end of file + Index: branches/5.3.x/core/units/admin/admin_tag_processor.php =================================================================== --- branches/5.3.x/core/units/admin/admin_tag_processor.php +++ branches/5.3.x/core/units/admin/admin_tag_processor.php @@ -457,51 +457,77 @@ } /** - * 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 */ function SelectorLink($params) { - $mode = 'catalog'; - if (isset($params['mode'])) { // {catalog, advanced_view} - $mode = $params['mode']; - unset($params['mode']); + $template = $this->SelectParam($params, 't,template'); + + if ( !$template ) { + $mode = 'catalog'; + + // {catalog, advanced_view} + if ( isset($params['mode']) ) { + $mode = $params['mode']; + unset($params['mode']); + } + + $params['t'] = 'catalog/item_selector/item_selector_' . $mode; } - $params['t'] = 'catalog/item_selector/item_selector_'.$mode; - $params['m_cat_id'] = $this->Application->getBaseCategory(); + if ( !isset($params['m_cat_id']) ) { + $params['m_cat_id'] = $this->Application->getBaseCategory(); + } + + $default_params = array('pass' => 'all'); + + if ( isset($params['prefix']) && $params['prefix'] ) { + $default_params['pass'] .= ',' . $params['prefix']; + unset($params['prefix']); + } + + $pass_through = $this->Application->GetVar('pass_through', ''); + + if ( isset($params['pass_through']) && $params['pass_through'] ) { + $pass_through .= ',' . $params['pass_through']; + } - $default_params = Array('pass' => 'all,'.$params['prefix']); - unset($params['prefix']); + $pass_through = array_filter(explode(',', $pass_through)); - $pass_through = Array(); - if (isset($params['tabs_dependant'])) { // {yes, no} - $pass_through['td'] = $params['tabs_dependant']; + // {yes, no} + if ( isset($params['tabs_dependant']) ) { + $params['td'] = $params['tabs_dependant']; + $pass_through[] = 'td'; unset($params['tabs_dependant']); } - if (isset($params['selection_mode'])) { // {single, multi} - $pass_through['tm'] = $params['selection_mode']; + // {single, multi} + if ( isset($params['selection_mode']) ) { + $params['tm'] = $params['selection_mode']; + $pass_through[] = 'tm'; unset($params['selection_mode']); } - if (isset($params['tab_prefixes'])) { // {all, none, } - $pass_through['tp'] = $params['tab_prefixes']; + // {all, none, } + if ( isset($params['tab_prefixes']) ) { + $params['tp'] = $params['tab_prefixes']; + $pass_through[] = 'tp'; unset($params['tab_prefixes']); } - if ($pass_through) { - // add pass_through to selector url if any - $params['pass_through'] = implode(',', array_keys($pass_through)); - $params = array_merge($params, $pass_through); + if ( $pass_through ) { + // Add pass_through to selector url if any. + $params['pass_through'] = implode(',', array_unique($pass_through)); } // user can override default parameters (except pass_through of course) $params = array_merge($default_params, $params); - return $this->Application->ProcessParsedTag('m', 'T', $params); + return $this->Application->ProcessParsedTag('m', 'T', $params); } function TimeFrame($params) @@ -1193,4 +1219,4 @@ return $this->Application->ParseBlock($block_params); } - } \ No newline at end of file + }