Changeset 15941
- Timestamp:
- 02/02/12 03:57:40 (4 months ago)
- Location:
- trunk
- Files:
-
- 4 added
- 8 edited
-
modules/boonex/english/install/data/langs/en.xml (modified) (3 diffs)
-
studio/classes/BxDolStudioBuilderPageQuery.php (modified) (2 diffs)
-
studio/js/builder_page.js (modified) (4 diffs)
-
studio/templates/base/bp_add_block_form.html (modified) (1 diff)
-
studio/templates/base/bp_block_panel_top.html (modified) (1 diff)
-
studio/templates/base/bp_blocks.html (modified) (1 diff)
-
studio/templates/base/bp_blocks_list.html (added)
-
studio/templates/base/bp_edit_page.html (added)
-
studio/templates/base/bp_edit_page_form.html (added)
-
studio/templates/base/bp_layouts.html (added)
-
studio/templates/base/css/builder_page.css (modified) (3 diffs)
-
studio/templates/base/scripts/BxBaseStudioBuilderPage.php (modified) (14 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/modules/boonex/english/install/data/langs/en.xml
r15939 r15941 2471 2471 <string name="_adm_bp_txt_page_meta_robots"><![CDATA[Meta Robots]]></string> 2472 2472 <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 2473 2478 <string name="_adm_bp_btn_page_create"><![CDATA[Create]]></string> 2474 2479 <string name="_adm_bp_btn_page_cancel"><![CDATA[Cancel]]></string> … … 2486 2491 <string name="_adm_bp_scs_page_delete"><![CDATA[The page was successfully deleted.]]></string> 2487 2492 <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> 2488 2506 2489 2507 <string name="_adm_bp_btn_block_add"><![CDATA[Add to Page]]></string> … … 2492 2510 <string name="_adm_bp_scs_blocks_added"><![CDATA[The blocks were successfully added.]]></string> 2493 2511 <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 2507 2513 2508 2514 -
trunk/studio/classes/BxDolStudioBuilderPageQuery.php
r15939 r15941 72 72 } 73 73 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 74 80 function deletePages($aParams) { 75 81 $sWhereClause = ""; … … 201 207 } 202 208 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 203 214 function updateBlock($iId, $aFields) { 204 215 $sSql = "UPDATE `sys_pages_blocks` SET `" . implode("`=?, `", array_keys($aFields)) . "`=? WHERE `id`=?"; -
trunk/studio/js/builder_page.js
r15939 r15941 25 25 $(document).ready(function() { 26 26 $($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, 29 29 placeholder: $this.aSortingConf.placeholder, 30 connectWith: $this.aSortingConf.parent, 30 31 start: function(oEvent, oUi) { 31 oUi.item.addClass('adm-bp- cell-dragging');32 oUi.item.addClass('adm-bp-block-dragging').width(300); 32 33 }, 33 34 stop: function(oEvent, oUi) { 34 oUi.item.removeClass('adm-bp- cell-dragging');35 oUi.item.removeClass('adm-bp-block-dragging'); 35 36 $this.reorder(oUi.item); 36 37 } … … 39 40 } 40 41 42 /** 43 * Main page methods. 44 */ 41 45 BxDolStudioBuilderPage.prototype.onChangePage = function(oSelect) { 42 46 var sPage = $(oSelect).val(); … … 77 81 }; 78 82 83 /** 84 * "Add Block" popup methods. 85 */ 79 86 BxDolStudioBuilderPage.prototype.onChangeModule = function(sName, oLink) { 80 87 var $this = this; … … 124 131 }; 125 132 133 134 /** 135 * "Settings" popup methods. 136 */ 137 BxDolStudioBuilderPage.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 148 BxDolStudioBuilderPage.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 154 BxDolStudioBuilderPage.prototype.onSaveSettings = function() { 155 window.location.href = this.sActionsUrl + '?type=' + this.sType + '&page=' + this.sPage; 156 }; 157 158 /** 159 * General methods. 160 */ 126 161 BxDolStudioBuilderPage.prototype.performAction = function(sAction) { 127 162 var $this = this; -
trunk/studio/templates/base/bp_add_block_form.html
r15940 r15941 12 12 <div class="adm-bp-cbf-controls bx-def-padding-toprightleft"> 13 13 <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> 15 15 <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> 16 16 <div class="bx-std-cb"></div> -
trunk/studio/templates/base/bp_block_panel_top.html
r15936 r15941 4 4 <bx_if:show_actions> 5 5 <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> 7 7 <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> 8 8 <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> 7 10 </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 />" /> 13 19 </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> 18 21 </div> 19 </ bx_repeat:blocks>20 </ div>22 </div> 23 </bx_repeat:blocks> -
trunk/studio/templates/base/css/builder_page.css
r15940 r15941 27 27 box-shadow: 0 0 1px rgba(51, 51, 51, 0.7); 28 28 background-color: #f2f2f2; 29 overflow: hidden; 29 30 } 30 31 div.adm-bp-block-empty { 31 32 height: 42px; 32 33 } 34 div.adm-bp-block-dragging {} 33 35 div.adm-bpb-content { 34 36 position: relative; … … 55 57 right: 5px; 56 58 } 57 /*--- Settings and Add Block popups style ---*/ 59 div.adm-bpb-drag-handle { 60 position: absolute; 61 top: 12px; 62 left: 5px; 63 cursor: move; 64 } 65 div.adm-bp-cell div.adm-bpb-icon { 66 left: 30px; 67 } 68 div.adm-bp-cell div.adm-bpb-info { 69 padding-left: 65px; 70 } 71 72 /*--- Create Page popups style ---*/ 58 73 div.adm-bp-create-form {} 59 74 div.adm-bp-create-form-cnt {} 60 75 61 76 /*--- Add Block popups style ---*/ 62 77 div#adm-bp-create-block-popup div.bx-def-popup-width { 63 78 width: 620px; … … 100 115 color: #b5b5b5; 101 116 } 117 118 /*--- Page Settings popups style ---*/ 119 div#adm-bp-edit-popup div.bx-def-popup-width { 120 width: 560px; 121 } 122 div#adm-bp-edit-popup div.bx-db-content { 123 padding-left: 0px; 124 padding-right: 0px; 125 } 126 127 div.adm-bp-edit-form {} 128 div.adm-bp-edit-form-cnt {} 129 130 div.adm-bp-edit-form fieldset.bx-form-section { 131 padding-bottom: 0px; 132 } 133 div.adm-bp-edit-form div.bx-std-pmen-item-cnt { 134 padding-left: 20px; 135 } 136 div.adm-bp-epf-left { 137 float: left; 138 width: 179px; 139 height: 300px; 140 border-right: 1px solid #cccccc; 141 overflow-y: auto; 142 } 143 div.adm-bp-epf-right { 144 float: left; 145 width: 380px; 146 height: 300px; 147 overflow-y: auto; 148 } 149 div.adm-bp-epf-right-cnt {} 150 div.adm-bp-epf-controls { 151 border-top: 1px solid #cccccc; 152 } 153 div#adm-bp-settings-group-layout { 154 margin: 0px -10px; 155 } 156 div.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 } 165 div.adm-bp-layout-active { 166 border-color: #9999cc; 167 } 168 div.adm-bp-layout-cnt { 169 padding: 1px; 170 } -
trunk/studio/templates/base/scripts/BxBaseStudioBuilderPage.php
r15939 r15941 11 11 12 12 bx_import('BxDolStudioBuilderPage'); 13 bx_import('BxTemplStudioFormView'); 13 14 14 15 class BxBaseStudioBuilderPage extends BxDolStudioBuilderPage { 15 16 private $sActionPageCreate = 'page_create'; 16 17 private $sActionPageDelete = 'page_delete'; 17 private $sActionPage Settings = 'page_settings';18 private $sActionPageEdit = 'page_edit'; 18 19 private $sActionBlockCreate = 'block_create'; 19 20 20 21 protected $aHtmlIds = array( 21 22 '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', 23 26 'create_block_popup_id' => 'adm-bp-create-block-popup', 24 27 'edit_block_popup_id' => 'adm-bp-edit-block-popup', … … 26 29 'block_list_id' => 'adm-bpl-', 27 30 'block_lists_id' => 'adm-bp-block-lists', 31 'layout_id' => 'adm-bpl-', 28 32 ); 29 33 … … 130 134 'condition' => false, 131 135 'content' => array() 132 ) 136 ), 137 'bx_if:show_drag_handle' => array( 138 'condition' => true, 139 'content' => array() 140 ) 133 141 ); 134 142 … … 160 168 $oTemplate = BxDolStudioTemplate::getInstance(); 161 169 162 bx_import('BxTemplStudioFormView');163 170 $oForm = new BxTemplStudioFormView(array()); 164 171 … … 186 193 'url_view' => BX_DOL_URL_ROOT . $this->aPageRebuild['url'], 187 194 'action_page_delete' => $this->sActionPageDelete, 188 'action_page_ settings' => $this->sActionPageSettings,195 'action_page_edit' => $this->sActionPageEdit, 189 196 'action_block_create' => $this->sActionBlockCreate, 190 197 ); … … 205 212 } 206 213 207 p ublicfunction actionPageCreate() {214 protected function actionPageCreate() { 208 215 $oTemplate = BxDolStudioTemplate::getInstance(); 209 216 … … 343 350 $aForm['inputs']['layout_id']['values'][] = array('key' => $aLayout['id'], 'value' => _t($aLayout['title'])); 344 351 345 bx_import('BxTemplStudioFormView');346 352 $oForm = new BxTemplStudioFormView($aForm); 347 353 $oForm->initChecker(); … … 405 411 } 406 412 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 } 409 524 410 525 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 ))); 412 530 413 531 return array('popup' => $sContent); … … 433 551 'form_attrs' => array( 434 552 '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, 436 554 'method' => 'post' 437 555 ), … … 446 564 ), 447 565 'inputs' => array ( 448 'page' => array(449 'type' => 'hidden',450 'name' => 'page',451 'value' => $this->sPage,452 'db' => array (453 'pass' => 'Xss',454 ),455 ),456 566 'blocks' => array( 457 567 'type' => 'custom', … … 519 629 520 630 $aForm['inputs']['blocks']['content'] = $oTemplate->parseHtmlByName('bp_add_block_form.html', $aTmplParams); 521 522 bx_import('BxTemplStudioFormView'); 631 523 632 $oForm = new BxTemplStudioFormView($aForm); 524 633 $oForm->initChecker(); 525 634 526 $sContent = "";527 635 if($oForm->isSubmittedAndValid()) { 528 636 $aBlocks = $oForm->getCleanValue('blocks'); … … 542 650 } 543 651 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 544 840 protected function getBlockList($sModule) { 545 841 if(empty($sModule)) … … 549 845 $oTemplate = BxDolStudioTemplate::getInstance(); 550 846 551 bx_import('BxTemplStudioFormView');552 847 $oForm = new BxTemplStudioFormView(array()); 553 848 … … 582 877 'content' => $oForm->genRow($aInputCheckbox) 583 878 ) 879 ), 880 'bx_if:show_drag_handle' => array( 881 'condition' => false, 882 'content' => array() 584 883 ) 585 884 ); 586 885 } 587 886 588 return $oTemplate->parseHtmlByName('bp_blocks .html', $aTmplParams);887 return $oTemplate->parseHtmlByName('bp_blocks_list.html', $aTmplParams); 589 888 } 590 889 }
Note: See TracChangeset
for help on using the changeset viewer.