HomeHelpTrac

Changeset 15941


Ignore:
Timestamp:
02/02/12 03:57:40 (4 months ago)
Author:
Anton Lesnikov
Message:

Studio -> Page Builder -> Page Settings.

Location:
trunk
Files:
4 added
8 edited

Legend:

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

    r15939 r15941  
    24712471    <string name="_adm_bp_txt_page_meta_robots"><![CDATA[Meta Robots]]></string> 
    24722472    <string name="_adm_bp_dsc_page_meta_robots"><![CDATA[It's needed to make the page searchable.]]></string> 
     2473    <string name="_adm_bp_txt_page_cache_server"><![CDATA[Server Size]]></string> 
     2474    <string name="_adm_bp_dsc_page_cache_server"><![CDATA[Enter available size]]></string> 
     2475    <string name="_adm_bp_txt_page_cache_editable"><![CDATA[is editable]]></string> 
     2476    <string name=""><![CDATA[]]></string> 
     2477     
    24732478    <string name="_adm_bp_btn_page_create"><![CDATA[Create]]></string> 
    24742479    <string name="_adm_bp_btn_page_cancel"><![CDATA[Cancel]]></string> 
     
    24862491    <string name="_adm_bp_scs_page_delete"><![CDATA[The page was successfully deleted.]]></string> 
    24872492    <string name="_adm_bp_err_page_delete"><![CDATA[Cannot delete the page.]]></string> 
     2493    <string name="_adm_bp_mi_page_options"><![CDATA[Options]]></string> 
     2494    <string name="_adm_bp_mi_page_cache"><![CDATA[Cache]]></string> 
     2495    <string name="_adm_bp_mi_page_layout"><![CDATA[Layout]]></string> 
     2496    <string name="_adm_bp_mi_page_seo"><![CDATA[SEO]]></string> 
     2497    <string name="_adm_bp_btn_page_apply"><![CDATA[Apply]]></string> 
     2498    <string name="_adm_bp_btn_page_cancel"><![CDATA[Cancel]]></string> 
     2499     
     2500    <string name=""><![CDATA[]]></string> 
     2501    <string name=""><![CDATA[]]></string> 
     2502    <string name=""><![CDATA[]]></string> 
     2503    <string name=""><![CDATA[]]></string> 
     2504    <string name=""><![CDATA[]]></string> 
     2505    <string name=""><![CDATA[]]></string> 
    24882506     
    24892507    <string name="_adm_bp_btn_block_add"><![CDATA[Add to Page]]></string> 
     
    24922510    <string name="_adm_bp_scs_blocks_added"><![CDATA[The blocks were successfully added.]]></string>     
    24932511    <string name="_adm_bp_err_blocks_added"><![CDATA[Cannot add blocks.]]></string> 
    2494     <string name=""><![CDATA[]]></string> 
    2495     <string name=""><![CDATA[]]></string> 
    2496     <string name=""><![CDATA[]]></string> 
    2497     <string name=""><![CDATA[]]></string> 
    2498     <string name=""><![CDATA[]]></string> 
    2499     <string name=""><![CDATA[]]></string> 
    2500     <string name=""><![CDATA[]]></string> 
    2501     <string name=""><![CDATA[]]></string> 
    2502     <string name=""><![CDATA[]]></string> 
    2503     <string name=""><![CDATA[]]></string> 
    2504     <string name=""><![CDATA[]]></string> 
    2505     <string name=""><![CDATA[]]></string> 
    2506     <string name=""><![CDATA[]]></string> 
     2512     
    25072513     
    25082514     
  • trunk/studio/classes/BxDolStudioBuilderPageQuery.php

    r15939 r15941  
    7272    } 
    7373 
     74    function updatePage($iId, $aFields) { 
     75        $sSql = "UPDATE `sys_objects_page` SET `" . implode("`=?, `", array_keys($aFields)) . "`=?  WHERE `id`=?"; 
     76        $sSql = call_user_func_array(array($this, 'prepare'), array_merge(array($sSql), array_values($aFields), array($iId))); 
     77        return $this->query($sSql); 
     78    } 
     79 
    7480    function deletePages($aParams) { 
    7581        $sWhereClause = ""; 
     
    201207    } 
    202208 
     209    function resetBlocksByPage($sObject) { 
     210        $sSql = $this->prepare("UPDATE `sys_pages_blocks` SET `cell_id`='1' WHERE `object`=?", $sObject); 
     211        return $this->query($sSql); 
     212    } 
     213 
    203214    function updateBlock($iId, $aFields) { 
    204215        $sSql = "UPDATE `sys_pages_blocks` SET `" . implode("`=?, `", array_keys($aFields)) . "`=?  WHERE `id`=?"; 
  • trunk/studio/js/builder_page.js

    r15939 r15941  
    2525    $(document).ready(function() { 
    2626        $($this.aSortingConf.parent).sortable({ 
    27             items: $this.aSortingConf.item, 
    28             connectWith: $this.aSortingConf.parent,  
     27            handle: $($this.aSortingConf.item + ' .adm-bpb-drag-handle'), 
     28            items: $this.aSortingConf.item,  
    2929            placeholder: $this.aSortingConf.placeholder, 
     30            connectWith: $this.aSortingConf.parent, 
    3031            start: function(oEvent, oUi) { 
    31                 oUi.item.addClass('adm-bp-cell-dragging'); 
     32                oUi.item.addClass('adm-bp-block-dragging').width(300); 
    3233            }, 
    3334            stop: function(oEvent, oUi) { 
    34                 oUi.item.removeClass('adm-bp-cell-dragging'); 
     35                oUi.item.removeClass('adm-bp-block-dragging'); 
    3536                $this.reorder(oUi.item); 
    3637            } 
     
    3940} 
    4041 
     42/** 
     43 * Main page methods. 
     44 */ 
    4145BxDolStudioBuilderPage.prototype.onChangePage = function(oSelect) { 
    4246    var sPage = $(oSelect).val(); 
     
    7781}; 
    7882 
     83/** 
     84 * "Add Block" popup methods.  
     85 */ 
    7986BxDolStudioBuilderPage.prototype.onChangeModule = function(sName, oLink) { 
    8087    var $this = this; 
     
    124131}; 
    125132 
     133 
     134/** 
     135 * "Settings" popup methods. 
     136 */ 
     137BxDolStudioBuilderPage.prototype.onChangeSettingGroup = function(sName, oLink) { 
     138    var $this = this; 
     139 
     140    var sClass = 'bx-std-pmi-active'; 
     141    $(oLink).parents('.bx-std-pmen-item:first').addClass(sClass).siblings('.bx-std-pmen-item').removeClass(sClass); 
     142 
     143    $('#' + this.oHtmlIds['settings_groups_id'] + ' > div:visible').bx_anim('hide', this.sAnimationEffect, 0, function() { 
     144        $('#' + $this.oHtmlIds['settings_group_id'] + sName).show(); 
     145    }); 
     146}; 
     147 
     148BxDolStudioBuilderPage.prototype.onChangeLayout = function(iId, oLink) { 
     149    $('#' + this.oHtmlIds['settings_group_id'] + 'layout > .adm-bp-layout-active').removeClass('adm-bp-layout-active'); 
     150    $('#' + this.oHtmlIds['layout_id'] + iId).addClass('adm-bp-layout-active'); 
     151    $("[name = 'layout_id']").val(iId); 
     152}; 
     153 
     154BxDolStudioBuilderPage.prototype.onSaveSettings = function() { 
     155    window.location.href = this.sActionsUrl + '?type=' + this.sType + '&page=' + this.sPage; 
     156}; 
     157 
     158/** 
     159 * General methods. 
     160 */ 
    126161BxDolStudioBuilderPage.prototype.performAction = function(sAction) { 
    127162    var $this = this; 
  • trunk/studio/templates/base/bp_add_block_form.html

    r15940 r15941  
    1212<div class="adm-bp-cbf-controls bx-def-padding-toprightleft"> 
    1313    <button class="bx-btn bx-btn-primary" name="do_submit" value="<bx_text:_adm_bp_btn_block_add />" type="submit"><bx_text:_adm_bp_btn_block_add /></button> 
    14     <button class="bx-btn bx-def-margin-sec-left" onclick="$('.bx-popup-applied:visible').dolPopupHide()"><bx_text:_adm_bp_btn_block_cancel /></button> 
     14    <button class="bx-btn bx-def-margin-sec-left" name="do_cancel" value="<bx_text:_adm_bp_btn_block_cancel />" type="button" onclick="$('.bx-popup-applied:visible').dolPopupHide()"><bx_text:_adm_bp_btn_block_cancel /></button> 
    1515    <div class="adm-bp-cbf-counter bx-def-font-h3"><span id="adm-bp-cbf-counter">0</span> <bx_text:_adm_bp_txt_blocks_selected /></div> 
    1616    <div class="bx-std-cb"></div> 
  • trunk/studio/templates/base/bp_block_panel_top.html

    r15936 r15941  
    44    <bx_if:show_actions> 
    55        <button class="bx-btn bx-def-margin-sec-left" onclick="javascript:window.open('__url_view__','_self');"><bx_text:_adm_bp_btn_view_page /></button> 
    6         <button class="bx-btn bx-def-margin-sec-left" onclick="javascript:__js_object__.performAction('__action_page_settings__')"><bx_text:_adm_bp_btn_settings /></button> 
     6        <button class="bx-btn bx-def-margin-sec-left" onclick="javascript:__js_object__.performAction('__action_page_edit__')"><bx_text:_adm_bp_btn_settings /></button> 
    77        <button class="bx-btn bx-def-margin-sec-left" onclick="javascript:__js_object__.performAction('__action_block_create__')"><bx_text:_adm_bp_btn_add_block /></button> 
    88        <button class="bx-btn bx-def-margin-sec-left" onclick="javascript:__js_object__.performAction('__action_page_delete__');"><bx_text:_adm_bp_btn_delete /></button> 
  • trunk/studio/templates/base/bp_blocks.html

    r15936 r15941  
    1 <div id="__html_block_list_id__" class="adm-bp-blocks"> 
    2     <bx_repeat:blocks> 
    3         <div id="__html_id__" class="adm-bp-block"> 
    4             <div class="adm-bpb-content"> 
    5                 <div class="adm-bpb-icon"> 
    6                     <img src="__icon__" /> 
     1<bx_repeat:blocks> 
     2    <div id="__html_id__" class="adm-bp-block"> 
     3        <div class="adm-bpb-content"> 
     4            <div class="adm-bpb-icon"> 
     5                <img src="__icon__" /> 
     6            </div> 
     7            <div class="adm-bpb-info"> 
     8                <div class="adm-bpb-title"> 
     9                    <a href="javascript:void(0)" onclick="javascript:__onclick__">__title__</a> 
    710                </div> 
    8                 <div class="adm-bpb-info"> 
    9                     <div class="adm-bpb-title"> 
    10                         <a href="javascript:void(0)" onclick="javascript:__onclick__">__title__</a> 
    11                     </div> 
    12                     <div class="adm-bpb-module">__module__</div> 
     11                <div class="adm-bpb-module">__module__</div> 
     12            </div> 
     13            <bx_if:show_checkbox> 
     14                <div class="adm-bpb-checkbox">__content__</div> 
     15            </bx_if:show_checkbox> 
     16            <bx_if:show_drag_handle> 
     17                <div class="adm-bpb-drag-handle"> 
     18                    <img src="<bx_icon_url:grid-drag-handle.png />" /> 
    1319                </div> 
    14                 <bx_if:show_checkbox> 
    15                     <div class="adm-bpb-checkbox">__content__</div> 
    16                 </bx_if:show_checkbox> 
    17             </div> 
     20            </bx_if:show_drag_handle> 
    1821        </div> 
    19     </bx_repeat:blocks> 
    20 </div> 
     22    </div> 
     23</bx_repeat:blocks> 
  • trunk/studio/templates/base/css/builder_page.css

    r15940 r15941  
    2727    box-shadow: 0 0 1px rgba(51, 51, 51, 0.7); 
    2828    background-color: #f2f2f2; 
     29    overflow: hidden; 
    2930} 
    3031div.adm-bp-block-empty { 
    3132    height: 42px; 
    3233} 
     34div.adm-bp-block-dragging {} 
    3335div.adm-bpb-content { 
    3436    position: relative; 
     
    5557    right: 5px; 
    5658} 
    57 /*--- Settings and Add Block popups style ---*/ 
     59div.adm-bpb-drag-handle { 
     60    position: absolute; 
     61    top: 12px; 
     62    left: 5px; 
     63    cursor: move; 
     64} 
     65div.adm-bp-cell div.adm-bpb-icon { 
     66    left: 30px; 
     67} 
     68div.adm-bp-cell div.adm-bpb-info { 
     69    padding-left: 65px;  
     70} 
     71 
     72/*--- Create Page popups style ---*/ 
    5873div.adm-bp-create-form {} 
    5974div.adm-bp-create-form-cnt {} 
    6075 
    61  
     76/*--- Add Block popups style ---*/ 
    6277div#adm-bp-create-block-popup div.bx-def-popup-width { 
    6378    width: 620px; 
     
    100115    color: #b5b5b5; 
    101116} 
     117 
     118/*--- Page Settings popups style ---*/ 
     119div#adm-bp-edit-popup div.bx-def-popup-width { 
     120    width: 560px; 
     121} 
     122div#adm-bp-edit-popup div.bx-db-content { 
     123    padding-left: 0px; 
     124    padding-right: 0px;  
     125} 
     126 
     127div.adm-bp-edit-form {} 
     128div.adm-bp-edit-form-cnt {} 
     129 
     130div.adm-bp-edit-form fieldset.bx-form-section { 
     131    padding-bottom: 0px; 
     132} 
     133div.adm-bp-edit-form div.bx-std-pmen-item-cnt { 
     134    padding-left: 20px; 
     135} 
     136div.adm-bp-epf-left { 
     137    float: left; 
     138    width: 179px; 
     139    height: 300px; 
     140    border-right: 1px solid #cccccc; 
     141    overflow-y: auto;  
     142} 
     143div.adm-bp-epf-right { 
     144    float: left; 
     145    width: 380px; 
     146    height: 300px; 
     147    overflow-y: auto; 
     148} 
     149div.adm-bp-epf-right-cnt {} 
     150div.adm-bp-epf-controls { 
     151    border-top: 1px solid #cccccc; 
     152} 
     153div#adm-bp-settings-group-layout { 
     154    margin: 0px -10px; 
     155} 
     156div.adm-bp-layout { 
     157    position: relative; 
     158    float: left; 
     159    width: 66px; 
     160    height: 66px; 
     161    margin-left: 10px; 
     162    margin-right: 10px;  
     163    border: 2px solid transparent; 
     164} 
     165div.adm-bp-layout-active { 
     166    border-color: #9999cc; 
     167} 
     168div.adm-bp-layout-cnt { 
     169    padding: 1px; 
     170} 
  • trunk/studio/templates/base/scripts/BxBaseStudioBuilderPage.php

    r15939 r15941  
    1111 
    1212bx_import('BxDolStudioBuilderPage'); 
     13bx_import('BxTemplStudioFormView'); 
    1314 
    1415class BxBaseStudioBuilderPage extends BxDolStudioBuilderPage { 
    1516    private $sActionPageCreate = 'page_create'; 
    1617    private $sActionPageDelete = 'page_delete'; 
    17     private $sActionPageSettings = 'page_settings'; 
     18    private $sActionPageEdit = 'page_edit'; 
    1819    private $sActionBlockCreate = 'block_create'; 
    1920 
    2021    protected $aHtmlIds = array( 
    2122        'create_popup_id' => 'adm-bp-create-popup', 
    22         'settings_popup_id' => 'adm-bp-settings-popup', 
     23        'edit_popup_id' => 'adm-bp-edit-popup', 
     24        'settings_group_id' => 'adm-bp-settings-group-', 
     25        'settings_groups_id' => 'adm-bp-settings-groups', 
    2326        'create_block_popup_id' => 'adm-bp-create-block-popup', 
    2427        'edit_block_popup_id' => 'adm-bp-edit-block-popup', 
     
    2629        'block_list_id' => 'adm-bpl-', 
    2730        'block_lists_id' => 'adm-bp-block-lists', 
     31        'layout_id' => 'adm-bpl-', 
    2832    ); 
    2933 
     
    130134                            'condition' => false, 
    131135                            'content' => array() 
    132                         ) 
     136                        ), 
     137                        'bx_if:show_drag_handle' => array( 
     138                            'condition' => true, 
     139                            'content' => array() 
     140                        ) 
    133141                    ); 
    134142 
     
    160168        $oTemplate = BxDolStudioTemplate::getInstance(); 
    161169 
    162         bx_import('BxTemplStudioFormView'); 
    163170        $oForm = new BxTemplStudioFormView(array()); 
    164171 
     
    186193                'url_view' => BX_DOL_URL_ROOT . $this->aPageRebuild['url'],  
    187194                'action_page_delete' => $this->sActionPageDelete, 
    188                 'action_page_settings' => $this->sActionPageSettings, 
     195                'action_page_edit' => $this->sActionPageEdit, 
    189196                'action_block_create' => $this->sActionBlockCreate, 
    190197            ); 
     
    205212    } 
    206213 
    207     public function actionPageCreate() { 
     214    protected function actionPageCreate() { 
    208215        $oTemplate = BxDolStudioTemplate::getInstance(); 
    209216 
     
    343350            $aForm['inputs']['layout_id']['values'][] = array('key' => $aLayout['id'], 'value' => _t($aLayout['title'])); 
    344351 
    345         bx_import('BxTemplStudioFormView'); 
    346352        $oForm = new BxTemplStudioFormView($aForm); 
    347353        $oForm->initChecker(); 
     
    405411    } 
    406412 
    407     protected function actionPageSettings() { 
    408         $sContent = "Change Settings"; 
     413    protected function actionPageEdit() { 
     414        $sJsObject = $this->getPageJsObject(); 
     415        $oTemplate = BxDolStudioTemplate::getInstance(); 
     416 
     417        $aForm = array( 
     418            'form_attrs' => array( 
     419                'id' => 'adm-bp-page-edit', 
     420                'action' => BX_DOL_URL_STUDIO . 'builder_page.php?bp_action=' . $this->sActionPageEdit . '&type=' . $this->sType . '&page=' . $this->sPage, 
     421                'method' => 'post' 
     422            ), 
     423            'params' => array ( 
     424                'db' => array( 
     425                    'table' => 'sys_objects_page', 
     426                    'key' => 'object', 
     427                    'uri' => '', 
     428                    'uri_title' => '', 
     429                    'submit_name' => 'do_submit' 
     430                ), 
     431            ), 
     432            'inputs' => array ( 
     433                'settings' => array( 
     434                    'type' => 'custom', 
     435                    'name' => 'settings', 
     436                    'content' => '', 
     437                ), 
     438            ) 
     439        ); 
     440 
     441        $aSettings = array( 
     442            array('name' => 'options', 'title' => '_adm_bp_mi_page_options', 'active' => 1), 
     443            array('name' => 'cache', 'title' => '_adm_bp_mi_page_cache', 'active' => 0), 
     444            array('name' => 'layout', 'title' => '_adm_bp_mi_page_layout', 'active' => 0), 
     445            array('name' => 'seo', 'title' => '_adm_bp_mi_page_seo', 'active' => 0) 
     446        ); 
     447 
     448        $aTmplParams = array( 
     449            'bx_repeat:menus' => array(), 
     450            'html_settings_groups_id' => $this->aHtmlIds['settings_groups_id'], 
     451            'bx_repeat:settings_groups' => array() 
     452        ); 
     453        foreach($aSettings as $aSetting) { 
     454            //--- get menu items 
     455            $aTmplParams['bx_repeat:menus'][] = array( 
     456                'bx_if:caption' => array( 
     457                    'condition' => false, 
     458                    'content' => array() 
     459                ), 
     460                'bx_if:item' => array( 
     461                    'condition' => true, 
     462                    'content' => array( 
     463                        'name' => $aSetting['name'], 
     464                        'bx_if:active' => array( 
     465                            'condition' => isset($aSetting['active']) && (int)$aSetting['active'] == 1, 
     466                            'content' => array() 
     467                        ), 
     468                        'icon' => '', 
     469                        'url' => 'javascript:void(0)', 
     470                        'bx_if:show_onclick' => array( 
     471                            'condition' => true, 
     472                            'content' => array( 
     473                                'onclick' => 'javascript:' . $sJsObject . '.onChangeSettingGroup(\'' . $aSetting['name'] . '\', this);', 
     474                            ) 
     475                        ), 
     476                        'caption' => _t($aSetting['title']) 
     477                    ) 
     478                ), 
     479            ); 
     480 
     481            //--- get settings 
     482            $aTmplParams['bx_repeat:settings_groups'][] = array( 
     483                'html_settings_group_id' => $this->aHtmlIds['settings_group_id'] .  $aSetting['name'], 
     484                'bx_if:hidden' => array( 
     485                    'condition' => $aSetting['active'] != 1, 
     486                    'content' => array() 
     487                ), 
     488                'content' => $this->{'getSettings' . $this->getClassName($aSetting['name'])}()  
     489            ); 
     490        } 
     491 
     492        $aForm['inputs']['settings']['content'] = $oTemplate->parseHtmlByName('bp_edit_page_form.html', $aTmplParams); 
     493 
     494        $oForm = new BxTemplStudioFormView($aForm); 
     495        $oForm->initChecker(); 
     496 
     497        $sContent = ""; 
     498        if($oForm->isSubmittedAndValid()) { 
     499            $aKeys = array_keys($this->aPageRebuild); 
     500 
     501            $aFields = array(); 
     502            foreach($aKeys as $sKey) 
     503                if(($sValue = bx_get($sKey)) !== false) 
     504                    $aFields[$sKey] = bx_process_input($sValue); 
     505 
     506            $sTitleValue = ''; 
     507            if(isset($aFields['title'])) { 
     508                $sTitleValue = $aFields['title']; 
     509                $aFields['title'] = $this->aPageRebuild['title']; 
     510            } 
     511 
     512            if($this->oDb->updatePage($this->aPageRebuild['id'], $aFields) !== false) { 
     513                bx_import('BxDolStudioLanguagesUtils'); 
     514                BxDolStudioLanguagesUtils::getInstance()->updateLanguageString($this->aPageRebuild['title'], $sTitleValue); 
     515 
     516                if(isset($aFields['layout_id']) && $aFields['layout_id'] != $this->aPageRebuild['layout_id'] && $this->oDb->resetBlocksByPage($this->sPage) !== false) 
     517                    return array('eval' => $sJsObject . '.onSaveSettings()'); 
     518 
     519                return array(); 
     520            } 
     521            else 
     522                return array('msg' => _t('_adm_bp_err_save')); 
     523        } 
    409524 
    410525        bx_import('BxTemplStudioFunctions'); 
    411         $sContent = BxTemplStudioFunctions::getInstance()->popupBox($this->aHtmlIds['settings_popup_id'], _t('_adm_bp_txt_settings_popup'), $sContent); 
     526        $sContent = BxTemplStudioFunctions::getInstance()->popupBox($this->aHtmlIds['edit_popup_id'], _t('_adm_bp_txt_settings_popup'), $oTemplate->parseHtmlByName('bp_edit_page.html', array( 
     527            'form_id' => $aForm['form_attrs']['id'], 
     528            'form' => $oForm->getCode() 
     529        ))); 
    412530 
    413531        return array('popup' => $sContent); 
     
    433551            'form_attrs' => array( 
    434552                'id' => 'adm-bp-block-create', 
    435                 'action' => BX_DOL_URL_STUDIO . 'builder_page.php?bp_action=' . $this->sActionBlockCreate, 
     553                'action' => BX_DOL_URL_STUDIO . 'builder_page.php?bp_action=' . $this->sActionBlockCreate . '&type=' . $this->sType . '&page=' . $this->sPage, 
    436554                'method' => 'post' 
    437555            ), 
     
    446564            ), 
    447565            'inputs' => array ( 
    448                 'page' => array( 
    449                     'type' => 'hidden', 
    450                     'name' => 'page', 
    451                     'value' => $this->sPage, 
    452                     'db' => array ( 
    453                         'pass' => 'Xss', 
    454                     ), 
    455                 ), 
    456566                'blocks' => array( 
    457567                    'type' => 'custom', 
     
    519629 
    520630        $aForm['inputs']['blocks']['content'] = $oTemplate->parseHtmlByName('bp_add_block_form.html', $aTmplParams); 
    521          
    522         bx_import('BxTemplStudioFormView'); 
     631 
    523632        $oForm = new BxTemplStudioFormView($aForm); 
    524633        $oForm->initChecker(); 
    525634 
    526         $sContent = ""; 
    527635        if($oForm->isSubmittedAndValid()) { 
    528636            $aBlocks = $oForm->getCleanValue('blocks'); 
     
    542650    } 
    543651 
     652    protected function getSettingsOptions() { 
     653        $aForm = array( 
     654            'form_attrs' => array( 
     655                'id' => 'adm-bp-settings-seo', 
     656            ), 
     657            'params' => array ( 
     658                'remove_form' => '1', 
     659                'csrf' => array( 
     660                    'disable' => true 
     661                ) 
     662            ), 
     663            'inputs' => array ( 
     664                'title' => array( 
     665                    'type' => 'text', 
     666                    'name' => 'title', 
     667                    'caption' => _t('_adm_bp_txt_page_title'), 
     668                    'info' => _t('_adm_bp_dsc_page_title'), 
     669                    'value' => _t($this->aPageRebuild['title']), 
     670                    'required' => '1', 
     671                    'db' => array ( 
     672                        'pass' => 'Xss', 
     673                    ), 
     674                    'checker' => array ( 
     675                        'func' => 'length', 
     676                        'params' => array(3,100), 
     677                        'error' => _t('_adm_bp_err_page_title'), 
     678                    ), 
     679                ), 
     680                'url' => array( 
     681                    'type' => 'text', 
     682                    'name' => 'url', 
     683                    'caption' => _t('_adm_bp_txt_page_url'), 
     684                    'info' => _t('_adm_bp_dsc_page_url'), 
     685                    'value' => $this->aPageRebuild['url'], 
     686                    'required' => '0', 
     687                    'db' => array ( 
     688                        'pass' => 'Xss', 
     689                    ) 
     690                ), 
     691            ) 
     692        ); 
     693 
     694        $oForm = new BxTemplStudioFormView($aForm); 
     695        return $oForm->getCode(); 
     696    } 
     697 
     698    protected function getSettingsCache() { 
     699        $aForm = array( 
     700            'form_attrs' => array( 
     701                'id' => 'adm-bp-settings-cache', 
     702            ), 
     703            'params' => array ( 
     704                'remove_form' => '1', 
     705                'csrf' => array( 
     706                    'disable' => true 
     707                ) 
     708            ), 
     709            'inputs' => array ( 
     710                'cache_server' => array( 
     711                    'type' => 'text', 
     712                    'name' => 'cache_server', 
     713                    'caption' => _t('_adm_bp_txt_page_cache_server'), 
     714                    'info' => _t('_adm_bp_dsc_page_cache_server'), 
     715                    'value' => $this->aPageRebuild['cache_server'], 
     716                    'required' => '', 
     717                    'db' => array ( 
     718                        'pass' => 'Int', 
     719                    ) 
     720                ), 
     721                'cache_editable' => array( 
     722                    'type' => 'checkbox', 
     723                    'name' => 'cache_editable', 
     724                    'caption' => _t('_adm_bp_txt_page_cache_editable'), 
     725                    'info' => '', 
     726                    'value' => '1', 
     727                    'checked' => $this->aPageRebuild['cache_editable'] == 1, 
     728                    'required' => '', 
     729                    'db' => array ( 
     730                        'pass' => 'Int', 
     731                    ) 
     732                ), 
     733            ) 
     734        ); 
     735 
     736        $oForm = new BxTemplStudioFormView($aForm); 
     737        return $oForm->getCode(); 
     738    } 
     739 
     740    protected function getSettingsLayout() { 
     741        $sJsObject = $this->getPageJsObject(); 
     742        $oTemplate = BxDolStudioTemplate::getInstance(); 
     743 
     744        $aLayouts = array(); 
     745        $this->oDb->getLayouts(array('type' => 'all'), $aLayouts, false); 
     746 
     747        $aTmplParams = array( 
     748            'bx_repeat:layouts' => array(), 
     749            'form' => '' 
     750        ); 
     751 
     752        foreach($aLayouts as $aLayout) 
     753            $aTmplParams['bx_repeat:layouts'][] = array( 
     754                'id' => $aLayout['id'], 
     755                'html_id' => $this->aHtmlIds['layout_id'] . $aLayout['id'], 
     756                'js_object' => $sJsObject, 
     757                'bx_if:active' => array( 
     758                    'condition' => (int)$this->aPageRebuild['layout_id'] == (int)$aLayout['id'], 
     759                    'content' => array() 
     760                ), 
     761                'icon' => $oTemplate->getImageUrl($aLayout['icon']), 
     762                'title' => _t($aLayout['title']), 
     763            ); 
     764 
     765        $aForm = array( 
     766            'form_attrs' => array( 
     767                'id' => 'adm-bp-settings-seo', 
     768            ), 
     769            'params' => array ( 
     770                'remove_form' => '1', 
     771                'csrf' => array( 
     772                    'disable' => true 
     773                ) 
     774            ), 
     775            'inputs' => array ( 
     776                'layout_id' => array( 
     777                    'type' => 'hidden', 
     778                    'name' => 'layout_id', 
     779                    'value' => $this->aPageRebuild['layout_id'], 
     780                ) 
     781            ) 
     782        ); 
     783 
     784        $oForm = new BxTemplStudioFormView($aForm); 
     785        $aTmplParams['form'] = $oForm->getCode(); 
     786 
     787        return $oTemplate->parseHtmlByName('bp_layouts.html', $aTmplParams); 
     788    } 
     789 
     790    protected function getSettingsSeo() { 
     791        $aForm = array( 
     792            'form_attrs' => array( 
     793                'id' => 'adm-bp-settings-seo', 
     794            ), 
     795            'params' => array ( 
     796                'remove_form' => '1', 
     797                'csrf' => array( 
     798                    'disable' => true 
     799                ) 
     800            ), 
     801            'inputs' => array ( 
     802                'meta_description' => array( 
     803                    'type' => 'textarea', 
     804                    'name' => 'meta_description', 
     805                    'caption' => _t('_adm_bp_txt_page_meta_description'), 
     806                    'info' => _t('_adm_bp_dsc_page_meta_description'), 
     807                    'value' => $this->aPageRebuild['meta_description'], 
     808                    'db' => array ( 
     809                        'pass' => 'Xss', 
     810                    ), 
     811                ), 
     812                'meta_keywords' => array( 
     813                    'type' => 'textarea', 
     814                    'name' => 'meta_keywords', 
     815                    'caption' => _t('_adm_bp_txt_page_meta_keywords'), 
     816                    'info' => _t('_adm_bp_dsc_page_meta_keywords'), 
     817                    'value' => $this->aPageRebuild['meta_keywords'], 
     818                    'db' => array ( 
     819                        'pass' => 'Xss', 
     820                    ), 
     821                ), 
     822                'meta_robots' => array( 
     823                    'type' => 'text', 
     824                    'name' => 'meta_robots', 
     825                    'caption' => _t('_adm_bp_txt_page_meta_robots'), 
     826                    'info' => _t('_adm_bp_dsc_page_meta_robots'), 
     827                    'value' => $this->aPageRebuild['meta_robots'], 
     828                    'required' => '0', 
     829                    'db' => array ( 
     830                        'pass' => 'Xss', 
     831                    ) 
     832                ) 
     833            ) 
     834        ); 
     835 
     836        $oForm = new BxTemplStudioFormView($aForm); 
     837        return $oForm->getCode(); 
     838    } 
     839 
    544840    protected function getBlockList($sModule) { 
    545841        if(empty($sModule)) 
     
    549845        $oTemplate = BxDolStudioTemplate::getInstance(); 
    550846 
    551         bx_import('BxTemplStudioFormView'); 
    552847        $oForm = new BxTemplStudioFormView(array()); 
    553848 
     
    582877                        'content' => $oForm->genRow($aInputCheckbox) 
    583878                    ) 
     879                ), 
     880                'bx_if:show_drag_handle' => array( 
     881                    'condition' => false, 
     882                    'content' => array() 
    584883                ) 
    585884            ); 
    586885        } 
    587886 
    588         return $oTemplate->parseHtmlByName('bp_blocks.html', $aTmplParams); 
     887        return $oTemplate->parseHtmlByName('bp_blocks_list.html', $aTmplParams); 
    589888    } 
    590889} 
Note: See TracChangeset for help on using the changeset viewer.