HomeHelpTrac

Changeset 15970 for trunk


Ignore:
Timestamp:
02/09/12 22:08:36 (4 months ago)
Author:
Anton Lesnikov
Message:

Navigation Builder updates.

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/modules/boonex/english/install/data/langs/en.xml

    r15969 r15970  
    22032203    <string name="_adm_nav_txt_items_title"><![CDATA[Title]]></string> 
    22042204    <string name="_adm_nav_txt_items_link"><![CDATA[URL]]></string> 
     2205    <string name="_adm_nav_txt_items_link_menu"><![CDATA[Menu: {0}]]></string> 
     2206    <string name="_adm_nav_txt_items_link_custom"><![CDATA[Custom Action]]></string> 
    22052207    <string name="_adm_nav_txt_items_module"><![CDATA[Module]]></string> 
    22062208    <string name="_adm_nav_txt_items_visible"><![CDATA[Visibile For]]></string> 
  • trunk/studio/classes/BxDolStudioNavigationQuery.php

    r15962 r15970  
    2727                $aMethod['name'] = 'getRow'; 
    2828                $sWhereClause = $this->prepare(" AND `tm`.`id`=? ", $aParams['value']); 
     29                break; 
     30            case 'by_object': 
     31                $aMethod['name'] = 'getRow'; 
     32                $sWhereClause = $this->prepare(" AND `tm`.`object`=? ", $aParams['value']); 
    2933                break; 
    3034            case 'by_set_name': 
  • trunk/studio/templates/base/scripts/BxBaseStudioNavigationItems.php

    r15969 r15970  
    190190 
    191191            $sTitleValue = $oForm->getCleanValue('title'); 
    192             $sName = $this->getSystemName($sTitleValue); 
     192            $sLink = $oForm->getCleanValue('link'); 
     193 
     194            $aMatches = array(); 
     195            $sName = preg_match("/.*page\.php\?o=([a-zA-Z0-9_-]+)$/", $sLink, $aMatches) > 0 ? $aMatches[1] : $this->getSystemName($sTitleValue); 
     196 
    193197            $sTitleKey = '_adm_nav_txt_menu_' . $sName; 
    194198            BxDolForm::setSubmittedValue('title', $sTitleKey, $aForm['form_attrs']['method']); 
     
    632636    } 
    633637 
    634     protected function _getCellIcon ($mixedValue, $sKey, $aField, $aRow) {         
    635         if(is_numeric($mixedValue)) { 
     638    protected function _getCellIcon ($mixedValue, $sKey, $aField, $aRow) { 
     639        $sFileUrl = "";         
     640        if(is_numeric($mixedValue) && (int)$mixedValue != 0) { 
    636641            bx_import('BxDolStorage'); 
    637             $oStorage = BxDolStorage::getObjectInstance(BX_DOL_STORAGE_OBJ_IMAGES); 
    638  
    639             if(($sFileUrl = $oStorage->getFileUrlById((int)$mixedValue)) !== false) 
    640                 $mixedValue = $this->_oTemplate->parseHtmlByName('bx_img.html', array( 
    641                     'bx_if:class' => array( 
    642                         'condition' => true, 
    643                         'content' => array( 
    644                             'content' => 'bx-nav-item-icon' 
    645                         ) 
    646                     ), 
    647                     'src' => $sFileUrl, 
    648                     'alt' => '' 
    649                 )); 
    650         } 
     642            if(($sResult = BxDolStorage::getObjectInstance(BX_DOL_STORAGE_OBJ_IMAGES)->getFileUrlById((int)$mixedValue)) !== false) 
     643                $sFileUrl = $sResult; 
     644        } 
     645 
     646        if($sFileUrl == "") 
     647            $sFileUrl = $this->_oTemplate->getIconUrl($mixedValue); 
     648 
     649        if($sFileUrl != "") 
     650            $mixedValue = $this->_oTemplate->parseHtmlByName('bx_img.html', array( 
     651                'bx_if:class' => array( 
     652                    'condition' => true, 
     653                    'content' => array( 
     654                        'content' => 'bx-nav-item-icon' 
     655                    ) 
     656                ), 
     657                'src' => $sFileUrl, 
     658                'alt' => '' 
     659            )); 
    651660 
    652661        return parent::_getCellDefault($mixedValue, $sKey, $aField, $aRow); 
     
    655664    protected function _getCellTitle ($mixedValue, $sKey, $aField, $aRow) {         
    656665        $mixedValue = $this->_limitMaxLength(_t($aRow['title']), $sKey, $aField, $aRow, $this->_isDisplayPopupOnTextOverflow); 
     666        return parent::_getCellDefault($mixedValue, $sKey, $aField, $aRow); 
     667    } 
     668 
     669    protected function _getCellLink ($mixedValue, $sKey, $aField, $aRow) { 
     670        if($aRow['submenu_object'] != "") { 
     671            $aMenu = array(); 
     672            $this->oDb->getMenus(array('type' => 'by_object', 'value' => $aRow['submenu_object']), $aMenu, false); 
     673            $mixedValue = _t('_adm_nav_txt_items_link_menu', _t($aMenu['title'])); 
     674        } 
     675        else if($aRow['submenu_object'] == "" && $aRow['onclick'] != "") 
     676            $mixedValue = _t('_adm_nav_txt_items_link_custom'); 
     677 
     678        $mixedValue = $this->_limitMaxLength($mixedValue, $sKey, $aField, $aRow, $this->_isDisplayPopupOnTextOverflow); 
    657679        return parent::_getCellDefault($mixedValue, $sKey, $aField, $aRow); 
    658680    } 
Note: See TracChangeset for help on using the changeset viewer.