HomeHelpTrac

Changeset 15942 for trunk/inc


Ignore:
Timestamp:
02/02/12 22:47:26 (4 months ago)
Author:
Alexander Trofimov
Message:

Frontend

Location:
trunk/inc
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/inc/classes/BxDolAcl.php

    r15934 r15942  
    111111            return false; 
    112112        if (!(int)$iProfileId) 
    113             $iProfileId = 1; // TODO: get current profile id 
     113            $iProfileId = 1; // TODO: remove this code as soon as it will be some profiles available 
    114114        $aACL = $this->getMemberMembershipInfo($iProfileId); 
    115115        return ($iPermissions & pow(2, $aACL['id'] - 1)); 
  • trunk/inc/classes/BxDolPage.php

    r15921 r15942  
    8585 *      - html: HTML string. 
    8686 *      - lang: language key. 
    87  *      - image: image id in the storage. 
     87 *      - image: image id in the storage and alignment (left, center, right) for example: 36#center 
    8888 *      - rss: URL to RSS with number of displayed items, for example: http://www.example.com/rss#4 
    8989 *      - menu: menu object name. 
  • trunk/inc/classes/BxDolTemplate.php

    r15934 r15942  
    305305            'common.css', 
    306306            'default.css', 
     307            'general.css', 
    307308        )); 
    308309 
     
    695696        return $this->_getAbsoluteLocation('path', $this->_sFolderCss, $sName, $sCheckIn); 
    696697    } 
     698 
     699    /** 
     700     * Get menu. 
     701     * @param $s menu object name 
     702     * @return html or empty string 
     703     */ 
     704    function getMenu ($s) { 
     705        bx_import('BxDolMenu'); 
     706        $oMenu = BxDolMenu::getObjectInstance($s); 
     707        return $oMenu ? $oMenu->getCode () : ''; 
     708    } 
     709 
    697710    /** 
    698711     * Get content of HTML file. 
     
    837850                    $sRet = bx_process_output($this->aPage['header_text']); 
    838851                break; 
     852            case 'popup_loading': 
     853                bx_import('BxTemplFunctions'); 
     854                $sRet = '<div id="bx-popup-loading" style="display:none;">' . BxTemplFunctions::getInstance()->transBox('<div class="bx-def-padding bx-def-color-bg-block bx-popup-ajax-content"></div>') . '</div>'; 
     855                break; 
    839856            case 'main_div_width': 
    840857                if(!empty($this->aPage['width'])) 
     
    842859                break; 
    843860            case 'main_logo': 
    844                 $sRet = getMainLogo(); 
    845                 break; 
    846             case 'top_menu': 
    847                 bx_import('BxTemplMenu'); 
    848                 $oMenuSite = BxTemplMenu::getObjectInstance('sys_site'); 
    849                 $sRet = $oMenuSite ? $oMenuSite->getCode () : ''; 
    850                 break; 
    851             case 'top_submenu': 
    852                 bx_import('BxTemplMenu'); 
    853                 $sRet = '';//BxTemplMenu::getInstance() -> getSubMenu(); 
     861                bx_import('BxTemplFunctions'); 
     862                $sRet = BxTemplFunctions::getInstance()->getMainLogo(); 
    854863                break; 
    855864            case 'top_menu_breadcrumb': 
    856865                bx_import('BxTemplMenu'); 
    857866                $sRet = '';//BxTemplMenu::getInstance() -> getBreadcrumb(); 
    858                 break; 
    859             case 'extra_top_menu': 
    860                 $iProfileId = getLoggedId(); 
    861  
    862                 if ($iProfileId && getParam('ext_nav_menu_enabled')) { 
    863                     //bx_import('BxTemplMemberMenu'); 
    864                     //$oMemberMenu = new BxTemplMemberMenu(); 
    865                     $sRet = ''; //$oMemberMenu -> genMemberMenu($iProfileId); // TODO: member menu 
    866                 } 
    867                 break; 
    868             case 'bottom_links': 
    869                 bx_import('BxTemplMenu'); 
    870                 $oMenuFooter = BxTemplMenu::getObjectInstance('sys_footer'); 
    871                 $sRet = $oMenuFooter ? $oMenuFooter->getCode () : 'TODO: footer menu'; 
    872867                break; 
    873868            case 'switch_skin_block': 
     
    13811376            "'<bx_text_js:([^\s]+) \/>'se", 
    13821377            "'<bx_text_attribute:([^\s]+) \/>'se", 
     1378            "'<bx_menu:([^\s]+) \/>'se", 
    13831379            "'<bx_url_root />'", 
    13841380            "'<bx_url_studio />'" 
     
    13941390            "bx_js_string(_t('\\1'))", 
    13951391            "bx_html_attribute(_t('\\1'))", 
     1392            "\$this->getMenu('\\1')", 
    13961393            BX_DOL_URL_ROOT, 
    13971394            BX_DOL_URL_STUDIO 
     
    18051802 
    18061803        return ' 
    1807         <div class="bx-def-padding-sec bx-def-border bx-def-color-bg-block bx-std-bx-footer"> 
     1804        <div class="bx-def-padding-sec bx-def-border bx-def-color-bg-block bx-std-bx-footer bx-def-round-corners"> 
    18081805            <div style="text-align:center;"> 
    18091806                ' . _t('_powered_by') . ' <a href="http://www.boonex.com/products/dolphin/' . $sAffID . '" title="Free Community Software">Dolphin</a> 
  • trunk/inc/design.inc.php

    r15922 r15942  
    151151    bx_import('BxTemplFunctions'); 
    152152    return BxTemplFunctions::getInstance()->popupBox($sName, $sTitle, $sContent, $aActions, $isHiddenByDefault); 
    153 } 
    154  
    155 function getMainLogo() { 
    156     bx_import('BxDolConfig'); 
    157     $sRprMain = BxDolConfig::getInstance()->get('path_dynamic', 'rpr_images_main'); 
    158  
    159     $sFileName = getParam('sys_main_logo'); 
    160     if(!file_exists($sRprMain . $sFileName)) 
    161         return ''; 
    162  
    163     return '<a href="' . BX_DOL_URL_ROOT . '"><img src="' . $sRprMain . $sFileName . '" class="mainLogo" alt="logo" /></a>'; 
    164153} 
    165154 
  • trunk/inc/js/functions.js

    r15934 r15942  
    135135 
    136136 
     137function bx_loading_content (elem, b, isReplace) { 
     138    var block = $(elem); 
     139    if (1 == b || true == b) { 
     140        if ('undefined' != typeof(isReplace) && isReplace) 
     141            block.html('<div class="bx-loading-ajax" style="position:static;"><div class="bx-loading-ajax-rotating"></div></div>'); 
     142        else 
     143            block.append('<div class="bx-loading-ajax"><div class="bx-loading-ajax-rotating"></div></div>'); 
     144    } else { 
     145        block.find(".bx-loading-ajax").remove(); 
     146    } 
     147} 
     148 
    137149function bx_loading (elem, b) { 
    138150 
     
    144156    if (1 == b || true == b) { 
    145157 
    146         var e = $('<div class="bx-loading-ajax"><div class="bx-loading-ajax-rotating"></div></div>'); 
    147         block.append(e); 
     158        bx_loading_content(block, b); 
     159 
    148160        e = block.find(".bx-loading-ajax"); 
    149161        e.css('left', parseInt(block.width()/2.0 - e.width()/2.0)); 
     
    176188            block.css('min-height', block.data('css-save-min-height')); 
    177189 
    178         block.find(".bx-loading-ajax").remove(); 
     190        bx_loading_content(block, b); 
    179191 
    180192    } 
     
    202214} 
    203215 
     216/** 
     217 * Show pointer popup with menu. 
     218 * @param e - element to show popup at 
     219 * @param o - menu object name 
     220 */ 
     221function bx_menu_popup (o, e) { 
     222    $(e).dolPopupAjax({ 
     223        url: 'menu.php?o=' + o 
     224    }); 
     225} 
     226 
    204227function validateLoginForm(eForm) { 
    205228    if (! eForm) 
  • trunk/inc/js/jquery.dolPopup.js

    r15932 r15942  
    161161    }; 
    162162 
     163 
     164    $.fn.dolPopupAjax = function(options) {  
     165 
     166        if ('undefined' == typeof(options) || 'object' != typeof(options) || 'undefined' == typeof(options.url)) 
     167            return; 
     168 
     169        var bx_menu_on = function (e, b) { 
     170            var li = $(e).parents('li:first');    
     171            if (b) { 
     172                var ul = $(e).parents('ul:first');    
     173                ul.find('li').removeClass('bx-menu-tab-active'); 
     174                li.addClass('bx-menu-tab-active'); 
     175            } else { 
     176                li.removeClass('bx-menu-tab-active'); 
     177            } 
     178        } 
     179 
     180        var bx_menu_is_on = function (e) {     
     181            var li = $(e).parents('li:first');    
     182            return li.hasClass('bx-menu-tab-active'); 
     183        } 
     184 
     185        return this.each(function() { 
     186            var e = $(this); 
     187 
     188            var id = ('undefined' == typeof(options.id) ? parseInt(2147483647 * Math.random()) : options.id); 
     189 
     190            if ($("#bx-popup-ajax-" + id + ":visible").length) { 
     191                 
     192                $("#bx-popup-ajax-" + id).dolPopupHide(); 
     193 
     194            } else if ($("#bx-popup-ajax-" + id).length) { 
     195 
     196                bx_menu_on(e, true); 
     197                $("#bx-popup-ajax-" + id).dolPopup({ 
     198                    pointer: {el:$(e)}, 
     199                    onHide: function () { 
     200                        bx_menu_on(e, false); 
     201                    } 
     202                }); 
     203 
     204            } else {         
     205 
     206                bx_menu_on(e, true); 
     207                bx_loading_content($('#bx-popup-loading .bx-popup-ajax-content'), true, true); 
     208                $('#bx-popup-loading').dolPopup({ 
     209                    pointer: {el:e}, 
     210                    closeOnOuterClick: false 
     211                }); 
     212                $('<div id="bx-popup-ajax-' + id + '" style="display:none;"><div>').appendTo($('body')).load(sUrlRoot + options.url, 
     213                    function() { 
     214                        if (!bx_menu_is_on(e)) 
     215                            return; 
     216                        $('#bx-popup-loading').dolPopupHide({ 
     217                            onHide: function () { 
     218                                $('#bx-popup-ajax-' + id).dolPopup({ 
     219                                    pointer: {el:e}, 
     220                                    onHide: function () { 
     221                                        bx_menu_on(e, false); 
     222                                    } 
     223                                }); 
     224                            } 
     225                        }); 
     226                    } 
     227                );     
     228 
     229            } 
     230 
     231        }); 
     232    }; 
     233 
    163234    $.fn._dolPopupSetPosition = function(o) { 
    164235        return this.each(function() { 
Note: See TracChangeset for help on using the changeset viewer.