AntonLV 9 лет назад
Родитель
Сommit
f1d08b7fa8

+ 1 - 1
inc/classes/BxDolTemplate.php

@@ -227,7 +227,7 @@ class BxDolTemplate extends BxDolFactory implements iBxDolSingleton
         $this->_sFolderCss = 'css/';
         $this->_sFolderImages = 'images/';
         $this->_sFolderIcons = 'images/icons/';
-        $this->_aTemplates = array('bx_a', 'bx_img');
+        $this->_aTemplates = array('bx_img');
 
         $this->addLocation('system', $this->_sRootPath, $this->_sRootUrl);
 

+ 0 - 1
studio/template/bx_a.html

@@ -1 +0,0 @@
-<a href="__href__" title="__title__" <bx_repeat:attrs>__key__="__value__"</bx_repeat:attrs>>__content__</a>

+ 3 - 5
studio/template/scripts/BxBaseStudioFormsDisplays.php

@@ -203,11 +203,9 @@ class BxBaseStudioFormsDisplays extends BxDolStudioFormsDisplays
         $aFields = array();
         $this->oDb->getInputs(array('type' => 'by_object_display', 'object' => $aRow['object'], 'display' => $aRow['display_name'], 'active' => 1), $aFields, false);
 
-        $mixedValue = $this->_oTemplate->parseHtmlByName('bx_a.html', array(
-            'href' => sprintf($this->sUrlViewFields, $aRow['module'], $aRow['object'], $aRow['display_name']),
-            'title' => _t('_adm_form_txt_displays_manage_fields'),
-            'bx_repeat:attrs' => array(),
-            'content' => _t('_adm_form_txt_forms_n_fields', count($aFields))
+        $sLink = sprintf($this->sUrlViewFields, $aRow['module'], $aRow['object'], $aRow['display_name']);
+        $mixedValue = $this->_oTemplate->parseLink($sLink, _t('_adm_form_txt_forms_n_fields', count($aFields)), array(
+            'title' => _t('_adm_form_txt_displays_manage_fields') 
         ));
 
         return parent::_getCellDefault ($mixedValue, $sKey, $aField, $aRow);

+ 3 - 5
studio/template/scripts/BxBaseStudioFormsField.php

@@ -232,11 +232,9 @@ class BxBaseStudioFormsField extends BxDolStudioFormsField
                             $aForm['inputs'][$sKey]['type'] = 'value';
                             foreach($aForm['inputs'][$sKey]['values'] as $aValue)
                                 if($aValue['key'] == $aForm['inputs'][$sKey]['value']) {
-                                    $aForm['inputs'][$sKey]['value'] = BxDolStudioTemplate::getInstance()->parseHtmlByName('bx_a.html', array(
-                                        'href' => BX_DOL_URL_STUDIO . 'builder_forms.php?page=pre_values&list=' . trim($aValue['key'], BX_DATA_LISTS_KEY_PREFIX . ' '),
-                                        'title' =>  _t('_adm_form_txt_field_values_manage'),
-                                        'bx_repeat:attrs' => array(),
-                                        'content' => $aValue['value']
+                                    $sLink = BX_DOL_URL_STUDIO . 'builder_forms.php?page=pre_values&list=' . trim($aValue['key'], BX_DATA_LISTS_KEY_PREFIX . ' ');
+                                    $aForm['inputs'][$sKey]['value'] = BxDolStudioTemplate::getInstance()->parseLink($sLink, $aValue['value'], array(
+                                        'title' =>  _t('_adm_form_txt_field_values_manage') 
                                     ));
                                     break;
                                 }

+ 3 - 7
studio/template/scripts/BxBaseStudioFormsFields.php

@@ -377,14 +377,10 @@ class BxBaseStudioFormsFields extends BxDolStudioFormsFields
         if(!$this->_isEditable($aRow))
             return parent::_getCellDefault('', $sKey, $aField, $aRow);
 
-        $mixedValue = $this->_oTemplate->parseHtmlByName('bx_a.html', array(
-            'href' => 'javascript:void(0)',
+        $mixedValue = $this->_oTemplate->parseLink('javascript:void(0)', BxDolStudioUtils::getVisibilityTitle($aRow['visible_for_levels']), array(
             'title' => _t('_adm_form_txt_fields_manage_visibility'),
-            'bx_repeat:attrs' => array(
-                array('key' => 'bx_grid_action_single', 'value' => 'show_to'),
-                array('key' => 'bx_grid_action_data', 'value' => $aRow['id'])
-            ),
-            'content' => BxDolStudioUtils::getVisibilityTitle($aRow['visible_for_levels'])
+        	'bx_grid_action_single' => 'show_to',
+            'bx_grid_action_data' => $aRow['id']
         ));
 
         return parent::_getCellDefault ($mixedValue, $sKey, $aField, $aRow);

+ 3 - 5
studio/template/scripts/BxBaseStudioFormsForms.php

@@ -166,11 +166,9 @@ class BxBaseStudioFormsForms extends BxDolStudioFormsForms
         $aDisplayes = array();
         $this->oDb->getDisplays(array('type' => 'by_object', 'value' => $aRow['object']), $aDisplayes, false);
 
-        $mixedValue = $this->_oTemplate->parseHtmlByName('bx_a.html', array(
-            'href' => sprintf($this->sUrlViewDisplays, $aRow['module'], $aRow['object']),
-            'title' => _t('_adm_form_txt_forms_manage_displays'),
-            'bx_repeat:attrs' => array(),
-            'content' => _t('_adm_form_txt_forms_n_displays', count($aDisplayes))
+        $sLink = sprintf($this->sUrlViewDisplays, $aRow['module'], $aRow['object']);
+        $mixedValue = $this->_oTemplate->parseLink($sLink, _t('_adm_form_txt_forms_n_displays', count($aDisplayes)), array(
+            'title' => _t('_adm_form_txt_forms_manage_displays') 
         ));
 
         return parent::_getCellDefault ($mixedValue, $sKey, $aField, $aRow);

+ 3 - 5
studio/template/scripts/BxBaseStudioFormsPreLists.php

@@ -283,11 +283,9 @@ class BxBaseStudioFormsPreLists extends BxDolStudioFormsPreLists
 
     protected function _getCellValues ($mixedValue, $sKey, $aField, $aRow)
     {
-        $mixedValue = $this->_oTemplate->parseHtmlByName('bx_a.html', array(
-            'href' => sprintf($this->sUrlViewValues, $aRow['module'], $aRow['key']),
-            'title' => _t('_adm_form_txt_pre_lists_manage_values'),
-            'bx_repeat:attrs' => array(),
-            'content' => _t('_adm_form_txt_pre_lists_n_values', $aRow['values_count'])
+        $sLink = sprintf($this->sUrlViewValues, $aRow['module'], $aRow['key']);
+        $mixedValue = $this->_oTemplate->parseLink($sLink, _t('_adm_form_txt_pre_lists_n_values', $aRow['values_count']), array(
+            'title' => _t('_adm_form_txt_pre_lists_manage_values')
         ));
 
         return parent::_getCellDefault ($mixedValue, $sKey, $aField, $aRow);

+ 3 - 5
studio/template/scripts/BxBaseStudioFormsSearchForms.php

@@ -166,11 +166,9 @@ class BxBaseStudioFormsSearchForms extends BxDolStudioFormsSearchForms
         $aFields = array();
         $this->oDb->getSearchFields(array('type' => 'by_object', 'object' => $aRow['object']), $aFields, false);
 
-        $mixedValue = $this->_oTemplate->parseHtmlByName('bx_a.html', array(
-            'href' => sprintf($this->sUrlViewFields, $aRow['module'], $aRow['object']),
-            'title' => _t('_adm_form_txt_search_forms_manage_fields'),
-            'bx_repeat:attrs' => array(),
-            'content' => _t('_adm_form_txt_search_forms_n_fields', count($aFields))
+        $sLink = sprintf($this->sUrlViewFields, $aRow['module'], $aRow['object']);
+        $mixedValue = $this->_oTemplate->parseLink($sLink, _t('_adm_form_txt_search_forms_n_fields', count($aFields)), array(
+            'title' => _t('_adm_form_txt_search_forms_manage_fields')
         ));
 
         return parent::_getCellDefault ($mixedValue, $sKey, $aField, $aRow);

+ 6 - 12
studio/template/scripts/BxBaseStudioNavigationItems.php

@@ -419,11 +419,9 @@ class BxBaseStudioNavigationItems extends BxDolStudioNavigationItems
 
             $aValue = $this->_limitMaxLength(_t($aMenu['title']), $sKey, $aField, $aRow, $this->_isDisplayPopupOnTextOverflow, false);
 
-            $mixedValue = $sPrefix . ' ' . $this->_oTemplate->parseHtmlByName('bx_a.html', array(
-                'href' => sprintf($this->sUrlViewItems, $aMenu['module'], $aMenu['set_name']),
-                'title' => _t('_adm_nav_txt_manage_items'),
-                'bx_repeat:attrs' => array(),
-                'content' => $aValue[0]
+            $sLink = sprintf($this->sUrlViewItems, $aMenu['module'], $aMenu['set_name']);
+            $mixedValue = $sPrefix . ' ' . $this->_oTemplate->parseLink($sLink, $aValue[0], array(
+                'title' => _t('_adm_nav_txt_manage_items') 
             )) . (isset($aValue[1]) ? $aValue[1] : '');
         } else if($aRow['submenu_object'] == "" && $aRow['onclick'] != "")
             $mixedValue = $this->_limitMaxLength(_t('_adm_nav_txt_items_gl_link_custom'), $sKey, $aField, $aRow, $this->_isDisplayPopupOnTextOverflow);
@@ -444,14 +442,10 @@ class BxBaseStudioNavigationItems extends BxDolStudioNavigationItems
         if(!$this->_isEditable($aRow))
             return parent::_getCellDefault('', $sKey, $aField, $aRow);
 
-        $mixedValue = $this->_oTemplate->parseHtmlByName('bx_a.html', array(
-            'href' => 'javascript:void(0)',
+        $mixedValue = $this->_oTemplate->parseLink('javascript:void(0)', BxDolStudioUtils::getVisibilityTitle($aRow['visible_for_levels']), array(
             'title' => _t('_adm_nav_txt_manage_visibility'),
-            'bx_repeat:attrs' => array(
-                array('key' => 'bx_grid_action_single', 'value' => 'show_to'),
-                array('key' => 'bx_grid_action_data', 'value' => $aRow['id'])
-            ),
-            'content' => BxDolStudioUtils::getVisibilityTitle($aRow['visible_for_levels'])
+        	'bx_grid_action_single' => 'show_to',
+        	'bx_grid_action_data' => $aRow['id']
         ));
 
         return parent::_getCellDefault ($mixedValue, $sKey, $aField, $aRow);

+ 6 - 10
studio/template/scripts/BxBaseStudioNavigationMenus.php

@@ -185,11 +185,9 @@ class BxBaseStudioNavigationMenus extends BxDolStudioNavigationMenus
     {
         $aValue = $this->_limitMaxLength(_t($aRow['title']), $sKey, $aField, $aRow, $this->_isDisplayPopupOnTextOverflow, false);
 
-        $mixedValue = $this->_oTemplate->parseHtmlByName('bx_a.html', array(
-            'href' => sprintf($this->sUrlViewItems, $aRow['module'], $aRow['set_name']),
-            'title' => _t('_adm_nav_txt_manage_items'),
-            'bx_repeat:attrs' => array(),
-            'content' => $aValue[0]
+        $sLink = sprintf($this->sUrlViewItems, $aRow['module'], $aRow['set_name']);
+        $mixedValue = $this->_oTemplate->parseLink($sLink, $aValue[0], array(
+            'title' => _t('_adm_nav_txt_manage_items')
         )) . (isset($aValue[1]) ? $aValue[1] : '');
 
         return parent::_getCellDefault($mixedValue, $sKey, $aField, $aRow);
@@ -201,11 +199,9 @@ class BxBaseStudioNavigationMenus extends BxDolStudioNavigationMenus
             $aSets = array();
             $this->oDb->getSets(array('type' => 'by_name', 'value' => $aRow['set_name']), $aSets, false);
 
-            $mixedValue = $this->_oTemplate->parseHtmlByName('bx_a.html', array(
-                'href' => sprintf($this->sUrlViewItems, $aRow['module'], $aRow['set_name']),
-                'title' => _t('_adm_nav_txt_manage_items'),
-                'bx_repeat:attrs' => array(),
-                'content' => _t('_adm_nav_txt_n_items', $aSets['items_count'])
+            $sLink = sprintf($this->sUrlViewItems, $aRow['module'], $aRow['set_name']);
+            $mixedValue = $this->_oTemplate->parseLink($sLink, _t('_adm_nav_txt_n_items', $aSets['items_count']), array(
+                'title' => _t('_adm_nav_txt_manage_items')
             ));
         }
 

+ 3 - 5
studio/template/scripts/BxBaseStudioNavigationSets.php

@@ -313,11 +313,9 @@ class BxBaseStudioNavigationSets extends BxDolStudioNavigationSets
         $aSets = array();
         $this->oDb->getSets(array('type' => 'by_name', 'value' => $aRow['set_name']), $aSets, false);
 
-        $mixedValue = $this->_oTemplate->parseHtmlByName('bx_a.html', array(
-            'href' => sprintf($this->sUrlViewItems, $aRow['module'], $aRow['set_name']),
-            'title' => _t('_adm_nav_txt_manage_items'),
-            'bx_repeat:attrs' => array(),
-            'content' => _t('_adm_nav_txt_n_items', $aSets['items_count'])
+        $sLink = sprintf($this->sUrlViewItems, $aRow['module'], $aRow['set_name']);
+        $mixedValue = $this->_oTemplate->parseLink($sLink, _t('_adm_nav_txt_n_items', $aSets['items_count']), array(
+            'title' => _t('_adm_nav_txt_manage_items')
         ));
 
         return parent::_getCellDefault ($mixedValue, $sKey, $aField, $aRow);

+ 3 - 5
studio/template/scripts/BxBaseStudioPermissionsLevels.php

@@ -273,11 +273,9 @@ class BxBaseStudioPermissionsLevels extends BxDolStudioPermissionsLevels
         $aActions = array();
         $iActions = $this->oDb->getActions(array('type' => 'by_level_id', 'value' => $aRow['ID']), $aActions);
 
-        $mixedValue = $this->_oTemplate->parseHtmlByName('bx_a.html', array(
-            'href' => BX_DOL_URL_STUDIO . 'builder_permissions.php?page=actions&level=' . $aRow['ID'],
-            'title' => _t('_adm_prm_txt_manage_actions'),
-            'bx_repeat:attrs' => array(),
-            'content' => _t('_adm_prm_txt_n_actions', $iActions)
+        $sLink = BX_DOL_URL_STUDIO . 'builder_permissions.php?page=actions&level=' . $aRow['ID'];
+        $mixedValue = $this->_oTemplate->parseLink($sLink, _t('_adm_prm_txt_n_actions', $iActions), array(
+            'title' => _t('_adm_prm_txt_manage_actions')
         ));
 
         return parent::_getCellDefault ($mixedValue, $sKey, $aField, $aRow);

+ 0 - 1
template/bx_a.html

@@ -1 +0,0 @@
-<a href="__href__" title="__title__" <bx_repeat:attrs>__key__="__value__"</bx_repeat:attrs>>__content__</a>