Changeset 15945
- Timestamp:
- 02/03/12 05:33:02 (4 months ago)
- Location:
- trunk
- Files:
-
- 11 edited
-
install/sql/v70.sql (modified) (1 diff)
-
modules/boonex/english/install/data/langs/en.xml (modified) (5 diffs)
-
studio/classes/BxDolStudioBuilderPageQuery.php (modified) (4 diffs)
-
studio/js/builder_page.js (modified) (1 diff)
-
studio/templates/base/block_panel_top.html (modified) (1 diff)
-
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_edit_page_form.html (modified) (1 diff)
-
studio/templates/base/css/builder_page.css (modified) (4 diffs)
-
studio/templates/base/css/general.css (modified) (1 diff)
-
studio/templates/base/scripts/BxBaseStudioBuilderPage.php (modified) (16 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/install/sql/v70.sql
r15942 r15945 3069 3069 3070 3070 3071 INSERT INTO `sys_pages_blocks` (`object`, `cell_id`, `module`, `title`, `designbox_id`, `visible_for_levels`, `type`, `content`, `deletable`, `copyable`, `order`) VALUES 3072 ('', 0, 'skeletons', '_sys_block_type_raw', 11, 2147483647, 'raw', '', 0, 1, 0), 3073 ('', 0, 'skeletons', '_sys_block_type_html', 11, 2147483647, 'html', '', 0, 1, 0), 3074 ('', 0, 'skeletons', '_sys_block_type_rss', 11, 2147483647, 'rss', '', 0, 1, 0), 3075 ('', 0, 'skeletons', '_sys_block_type_image', 11, 2147483647, 'image', '', 0, 1, 0), 3076 ('', 0, 'skeletons', '_sys_block_type_lang', 11, 2147483647, 'lang', '', 0, 1, 0), 3077 ('', 0, 'skeletons', '_sys_block_type_menu', 11, 2147483647, 'menu', '', 0, 1, 0); 3078 3079 3071 3080 -- -------------------------------------------------------- 3072 3081 -
trunk/modules/boonex/english/install/data/langs/en.xml
r15942 r15945 2443 2443 <string name="_adm_wgt_cpt_builder_pages"><![CDATA[Pages]]></string> 2444 2444 <string name="_adm_bp_cpt_type_system"><![CDATA[System]]></string> 2445 <string name="_adm_bp_cpt_type_custom"><![CDATA[Custom]]></string> 2445 2446 <string name="_adm_bp_cpt_type_modules"><![CDATA[Modules]]></string> 2446 2447 <string name="_adm_bp_txt_select_page"><![CDATA[Select Page...]]></string> … … 2465 2466 <string name="_adm_bp_err_page_layout"><![CDATA[Please, select a page layout.]]></string> 2466 2467 <string name="_adm_bp_txt_page_layout_empty"><![CDATA[Select Layout...]]></string> 2468 <string name="_adm_bp_txt_page_visible_for_levels"><![CDATA[User Levels]]></string> 2469 <string name="_adm_bp_dsc_page_visible_for_levels"><![CDATA[Select user levels that can see this page]]></string> 2470 <string name="_adm_bp_err_page_visible_for_levels"><![CDATA[Visibility setting are determined by custom code or not applicable here.]]></string> 2467 2471 <string name="_adm_bp_txt_page_meta_description"><![CDATA[Meta Description]]></string> 2468 2472 <string name="_adm_bp_dsc_page_meta_description"><![CDATA[It's needed to make the page searchable.]]></string> … … 2473 2477 <string name="_adm_bp_txt_page_cache_server"><![CDATA[Server Size]]></string> 2474 2478 <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 2478 2479 <string name="_adm_bp_btn_page_create"><![CDATA[Create]]></string> 2479 2480 <string name="_adm_bp_btn_page_cancel"><![CDATA[Cancel]]></string> … … 2487 2488 <string name="_sys_layout_top_area_3_columns"><![CDATA[Top area with 3 columns]]></string> 2488 2489 <string name="_sys_layout_top_area_2_columns"><![CDATA[Top area with 2 columns]]></string> 2490 <string name="_sys_block_types_skeletons"><![CDATA[Skeletons]]></string> 2491 <string name="_sys_block_type_raw"><![CDATA[raw]]></string> 2492 <string name="_sys_block_type_html"><![CDATA[html]]></string> 2493 <string name="_sys_block_type_rss"><![CDATA[rss]]></string> 2494 <string name="_sys_block_type_image"><![CDATA[image]]></string> 2495 <string name="_sys_block_type_lang"><![CDATA[lang]]></string> 2496 <string name="_sys_block_type_menu"><![CDATA[menu]]></string> 2489 2497 <string name="_adm_bp_scs_page_create"><![CDATA[The page was successfully created.]]></string> 2490 2498 <string name="_adm_bp_err_page_create"><![CDATA[Cannot create the page.]]></string> … … 2492 2500 <string name="_adm_bp_err_page_delete"><![CDATA[Cannot delete the page.]]></string> 2493 2501 <string name="_adm_bp_mi_page_options"><![CDATA[Options]]></string> 2502 <string name="_adm_bp_mi_page_layout"><![CDATA[Layout]]></string> 2503 <string name="_adm_bp_mi_page_visibility"><![CDATA[Visibility]]></string> 2494 2504 <string name="_adm_bp_mi_page_cache"><![CDATA[Cache]]></string> 2495 <string name="_adm_bp_mi_page_layout"><![CDATA[Layout]]></string>2496 2505 <string name="_adm_bp_mi_page_seo"><![CDATA[SEO]]></string> 2497 2506 <string name="_adm_bp_btn_page_apply"><![CDATA[Apply]]></string> 2498 2507 <string name="_adm_bp_btn_page_cancel"><![CDATA[Cancel]]></string> 2499 2500 <string name=""><![CDATA[]]></string>2501 <string name=""><![CDATA[]]></string>2502 2508 <string name=""><![CDATA[]]></string> 2503 2509 <string name=""><![CDATA[]]></string> -
trunk/studio/classes/BxDolStudioBuilderPageQuery.php
r15941 r15945 142 142 $sWhereClause = $this->prepare("AND `tpb`.`id`=? ", $aParams['value']); 143 143 break; 144 case 'by_ids': 145 $sWhereClause = "AND `tpb`.`id` IN ('" . implode("','", array_fill(0, count($aParams['value']), '?')) . "')"; 146 $sWhereClause = call_user_func_array(array($this, 'prepare'), array_merge(array($sWhereClause), $aParams['value'])); 147 break; 144 148 case 'by_object': 145 149 $sWhereClause = $this->prepare("AND `tpb`.`object`=?", $aParams['value']); … … 148 152 $sWhereClause = $this->prepare("AND `tpb`.`object`=? AND `tpb`.`cell_id`=?", $aParams['object'], $aParams['cell']); 149 153 break; 150 case 'by_module': 151 $sWhereClause = $this->prepare("AND `tpb`.`module`=?", $aParams['value']); 154 case 'by_module_to_copy': 155 $sWhereClause = $this->prepare("AND `tpb`.`module`=? AND `tpb`.`copyable`=1", $aParams['value']); 156 157 if($aParams['value'] == BX_DOL_STUDIO_BP_SKELETONS) 158 $sWhereClause .= " AND `tpb`.`object`=''"; 152 159 break; 153 160 case 'all': … … 178 185 } 179 186 180 function copyBlocksByIds($sObject, $iCellId, $aIds) { 181 $iOrder = $this->getBlockOrderMax($sObject) + 1; 182 183 $sSql = "INSERT INTO `sys_pages_blocks` 184 SELECT NULL AS `id`, ? AS `object`, ? AS `cell_id`, ? AS `module`, `title`, `designbox_id`, `visible_for_levels`, `type`, `content`, `deletable`, `copyable`, ? AS `order` 185 FROM `sys_pages_blocks` 186 WHERE `id` IN ('" . implode("','", array_fill(0, count($aIds), '?')) . "')"; 187 $sSql = call_user_func_array(array($this, 'prepare'), array_merge(array($sSql), array($sObject, $iCellId, BX_DOL_STUDIO_MODULE_CUSTOM, $iOrder + 1), $aIds)); 187 function insertBlock($aFields) { 188 $aFields['order'] = $this->getBlockOrderMax($aFields['object']) + 1; 189 190 $sSql = "INSERT INTO `sys_pages_blocks` SET `" . implode("`=?, `", array_keys($aFields)) . "`=?"; 191 $sSql = call_user_func_array(array($this, 'prepare'), array_merge(array($sSql), array_values($aFields))); 188 192 return (int)$this->query($sSql) > 0; 193 } 194 195 function updateBlock($iId, $aFields) { 196 $sSql = "UPDATE `sys_pages_blocks` SET `" . implode("`=?, `", array_keys($aFields)) . "`=? WHERE `id`=?"; 197 $sSql = call_user_func_array(array($this, 'prepare'), array_merge(array($sSql), array_values($aFields), array($iId))); 198 return $this->query($sSql); 189 199 } 190 200 … … 212 222 } 213 223 214 function updateBlock($iId, $aFields) {215 $sSql = "UPDATE `sys_pages_blocks` SET `" . implode("`=?, `", array_keys($aFields)) . "`=? WHERE `id`=?";216 $sSql = call_user_func_array(array($this, 'prepare'), array_merge(array($sSql), array_values($aFields), array($iId)));217 return (int)$this->query($sSql) > 0;218 }219 220 224 function getBlockOrderMax($sObject, $iCellId = 1) { 221 225 $sSql = $this->prepare("SELECT MAX(`order`) FROM `sys_pages_blocks` WHERE `object`=? AND `cell_id`=? LIMIT 1", $sObject, $iCellId); -
trunk/studio/js/builder_page.js
r15941 r15945 48 48 }; 49 49 50 BxDolStudioBuilderPage.prototype.onCreatePage = function(s Page) {51 window.location.href = this.sActionsUrl + '?type=' + this.sType + '&page=' + sPage;50 BxDolStudioBuilderPage.prototype.onCreatePage = function(sType, sPage) { 51 window.location.href = this.sActionsUrl + '?type=' + sType + '&page=' + sPage; 52 52 }; 53 53 -
trunk/studio/templates/base/block_panel_top.html
r15521 r15945 1 <div class="bx-std-block-panel-top ">__content__</div>1 <div class="bx-std-block-panel-top bx-def-padding-bottom">__content__</div> -
trunk/studio/templates/base/bp_add_block_form.html
r15941 r15945 1 1 <div class="adm-bp-cbf-left"> 2 <div class="adm-bp-cbf-left-cnt ">2 <div class="adm-bp-cbf-left-cnt bx-def-padding-sec-top"> 3 3 <bx_include_auto:menu_side.html /> 4 4 </div> 5 5 </div> 6 6 <div class="adm-bp-cbf-right"> 7 <div class="adm-bp-cbf-right-cnt bx-def-padding -leftright">7 <div class="adm-bp-cbf-right-cnt bx-def-padding"> 8 8 <div id="__html_block_lists_id__" class="adm-bp-cbf-right-cnt">__blocks__</div> 9 9 </div> -
trunk/studio/templates/base/bp_block_panel_top.html
r15941 r15945 3 3 <button class="bx-btn bx-def-margin-sec-left" onclick="javascript:__js_object__.performAction('__action_page_create__');"><bx_text:_adm_bp_btn_create_new /></button> 4 4 <bx_if:show_actions> 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>5 <button class="bx-btn bx-def-margin-sec-left" onclick="javascript:window.open('__url_view__','_blank');"><bx_text:_adm_bp_btn_view_page /></button> 6 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> -
trunk/studio/templates/base/bp_edit_page_form.html
r15941 r15945 1 1 <div class="adm-bp-epf-left"> 2 <div class="adm-bp-epf-left-cnt ">2 <div class="adm-bp-epf-left-cnt bx-def-padding-sec-top"> 3 3 <bx_include_auto:menu_side.html /> 4 4 </div> 5 5 </div> 6 6 <div class="adm-bp-epf-right"> 7 <div id="__html_settings_groups_id__" class="adm-bp-epf-right-cnt bx-def-padding -leftright">7 <div id="__html_settings_groups_id__" class="adm-bp-epf-right-cnt bx-def-padding"> 8 8 <bx_repeat:settings_groups> 9 9 <div id="__html_settings_group_id__" class="adm-bp-settings" style="<bx_if:hidden>display: none;</bx_if:hidden>">__content__</div> -
trunk/studio/templates/base/css/builder_page.css
r15941 r15945 12 12 border: 1px solid #b7b7b7; 13 13 background-color: #f8f8f8; 14 box-shadow: 0 0 5px rgba(51, 51, 51, 0.7);14 box-shadow: inset 0 0 2px rgba(51, 51, 51, 0.7); 15 15 } 16 16 div.adm-bp-cell-cnt { … … 31 31 div.adm-bp-block-empty { 32 32 height: 42px; 33 border-style: dashed; 34 box-shadow: none; 33 35 } 34 36 div.adm-bp-block-dragging {} … … 96 98 width: 179px; 97 99 height: 300px; 100 border-top: 1px solid #cccccc; 98 101 border-right: 1px solid #cccccc; 99 102 overflow-y: auto; 100 103 } 104 div.adm-bp-cbf-left-cnt {} 101 105 div.adm-bp-cbf-right { 102 106 float: left; 103 107 width: 440px; 104 108 height: 300px; 109 border-top: 1px solid #cccccc; 105 110 overflow-y: auto; 106 111 } … … 137 142 float: left; 138 143 width: 179px; 139 height: 300px; 144 height: 310px; 145 border-top: 1px solid #cccccc; 140 146 border-right: 1px solid #cccccc; 141 147 overflow-y: auto; 142 148 } 149 div.adm-bp-epf-left-cnt {} 143 150 div.adm-bp-epf-right { 144 151 float: left; 145 152 width: 380px; 146 height: 300px; 153 height: 310px; 154 border-top: 1px solid #cccccc; 147 155 overflow-y: auto; 148 156 } -
trunk/studio/templates/base/css/general.css
r15844 r15945 183 183 line-height: 25px; 184 184 } 185 div.bx-std-block-panel-top { 186 margin: 0px 0px 10px 0px; 187 } 185 div.bx-std-block-panel-top {} 188 186 div.bx-std-block-content {} 189 187 div.bx-std-block-panel-bottom { -
trunk/studio/templates/base/scripts/BxBaseStudioBuilderPage.php
r15941 r15945 12 12 bx_import('BxDolStudioBuilderPage'); 13 13 bx_import('BxTemplStudioFormView'); 14 15 define('BX_DOL_STUDIO_BP_SKELETONS', 'skeletons'); 14 16 15 17 class BxBaseStudioBuilderPage extends BxDolStudioBuilderPage { … … 64 66 array( 65 67 'type' => BX_DOL_STUDIO_MIT_ITEM, 66 'name' => BX_DOL_STUDIO_BP_TYPE_DEFAULT, 67 'uri' => BX_DOL_STUDIO_BP_TYPE_DEFAULT, 68 'title' => '_adm_bp_cpt_type_system', 68 'name' => BX_DOL_STUDIO_MODULE_SYSTEM, 69 'uri' => BX_DOL_STUDIO_MODULE_SYSTEM, 70 'title' => '_adm_bp_cpt_type_' . BX_DOL_STUDIO_MODULE_SYSTEM, 71 'icon' => 'mi-system.png' 72 ), 73 array( 74 'type' => BX_DOL_STUDIO_MIT_ITEM, 75 'name' => BX_DOL_STUDIO_MODULE_CUSTOM, 76 'uri' => BX_DOL_STUDIO_MODULE_CUSTOM, 77 'title' => '_adm_bp_cpt_type_' . BX_DOL_STUDIO_MODULE_CUSTOM, 69 78 'icon' => 'mi-system.png' 70 79 ), … … 215 224 $oTemplate = BxDolStudioTemplate::getInstance(); 216 225 226 $sModule = BX_DOL_STUDIO_MODULE_CUSTOM; 227 217 228 $aForm = array( 218 229 'form_attrs' => array( … … 234 245 'type' => 'hidden', 235 246 'name' => 'module', 236 'value' => $ this->sType,247 'value' => $sModule, 237 248 'db' => array ( 238 249 'pass' => 'Xss', … … 262 273 'error' => _t('_adm_bp_err_page_title'), 263 274 ), 264 ),265 'url' => array(266 'type' => 'text',267 'name' => 'url',268 'caption' => _t('_adm_bp_txt_page_url'),269 'info' => _t('_adm_bp_dsc_page_url'),270 'value' => '',271 'required' => '0',272 'db' => array (273 'pass' => 'Xss',274 )275 275 ), 276 276 'layout_id' => array( … … 360 360 $oForm->setSubmittedValue('title', $sTitleKey, $aForm['form_attrs']['method']); 361 361 362 $iId = (int)$oForm->insert(array('object' => $sObject ));362 $iId = (int)$oForm->insert(array('object' => $sObject, 'url' => 'page.php?o=' . $sObject)); 363 363 if($iId != 0) { 364 364 bx_import('BxDolStudioLanguagesUtils'); … … 366 366 367 367 return array( 368 'eval' => $this->getPageJsObject() . '.onCreatePage(\'' . $s Object . '\')'368 'eval' => $this->getPageJsObject() . '.onCreatePage(\'' . $sModule . '\', \'' . $sObject . '\')' 369 369 ); 370 370 } … … 441 441 $aSettings = array( 442 442 array('name' => 'options', 'title' => '_adm_bp_mi_page_options', 'active' => 1), 443 array('name' => 'layout', 'title' => '_adm_bp_mi_page_layout', 'active' => 0), 444 array('name' => 'visibility', 'title' => '_adm_bp_mi_page_visibility', 'active' => 0), 443 445 array('name' => 'cache', 'title' => '_adm_bp_mi_page_cache', 'active' => 0), 444 array('name' => 'layout', 'title' => '_adm_bp_mi_page_layout', 'active' => 0),445 446 array('name' => 'seo', 'title' => '_adm_bp_mi_page_seo', 'active' => 0) 446 447 ); … … 510 511 } 511 512 513 if(isset($aFields['visible_for_levels']) && is_array($aFields['visible_for_levels'])) { 514 $iHideFrom = 0; 515 foreach($aFields['visible_for_levels'] as $iLevelId) 516 $iHideFrom += pow(2, (int)$iLevelId - 1); 517 $aFields['visible_for_levels'] = $iHideFrom; 518 } 519 512 520 if($this->oDb->updatePage($this->aPageRebuild['id'], $aFields) !== false) { 513 521 bx_import('BxDolStudioLanguagesUtils'); … … 586 594 'icon' => 'mi-system.png', 587 595 'active' => $sSelected == BX_DOL_STUDIO_MODULE_CUSTOM ? 1 : 0, 596 ), 597 array( 598 'name' => BX_DOL_STUDIO_BP_SKELETONS, 599 'caption' => '_sys_block_types_skeletons', 600 'icon' => 'mi-system.png', 601 'active' => $sSelected == BX_DOL_STUDIO_BP_SKELETONS ? 1 : 0, 588 602 ), 589 603 ); … … 619 633 ) 620 634 ), 621 'caption' => $this->getModuleTitle($aModule['name'])635 'caption' => isset($aModule['caption']) ? _t($aModule['caption']) : $this->getModuleTitle($aModule['name']) 622 636 ) 623 637 ), … … 634 648 635 649 if($oForm->isSubmittedAndValid()) { 636 $aBlocks = $oForm->getCleanValue('blocks'); 637 if($this->oDb->copyBlocksByIds($this->sPage, 1, $aBlocks)) 650 $aIds = $oForm->getCleanValue('blocks'); 651 652 $aBlocks = array(); 653 $this->oDb->getBlocks(array('type' => 'by_ids', 'value' => $aIds), $aBlocks, false); 654 655 bx_import('BxDolStudioLanguagesUtils'); 656 $oLanguage = BxDolStudioLanguagesUtils::getInstance(); 657 658 $bResult = true; 659 foreach($aBlocks as $aBlock) { 660 $sTitleKey = $this->getSystemName($aBlock['title'] . '_' . mktime()); 661 $sTitleValue = _t($aBlock['title']); 662 663 unset($aBlock['id']); 664 $aBlock['object'] = $this->sPage; 665 $aBlock['cell_id'] = 1; 666 $aBlock['title'] = $sTitleKey; 667 $aBlock['deletable'] = 1; 668 669 if(!$this->oDb->insertBlock($aBlock)) { 670 $bResult = false; 671 break; 672 } 673 674 $oLanguage->addLanguageString($sTitleKey, $sTitleValue); 675 } 676 677 if($bResult) 638 678 return array('msg' => _t('_adm_bp_scs_blocks_added'), 'eval' => $sJsObject . '.onCreateBlock(oData)'); 639 679 else … … 685 725 'value' => $this->aPageRebuild['url'], 686 726 'required' => '0', 687 'db' => array ( 688 'pass' => 'Xss', 689 ) 690 ), 691 ) 692 ); 727 'attrs' => array( 728 'disabled' => 'disabled' 729 ), 730 ), 731 ) 732 ); 733 734 $oForm = new BxTemplStudioFormView($aForm); 735 return $oForm->getCode(); 736 } 737 738 protected function getSettingsLayout() { 739 $sJsObject = $this->getPageJsObject(); 740 $oTemplate = BxDolStudioTemplate::getInstance(); 741 742 $aLayouts = array(); 743 $this->oDb->getLayouts(array('type' => 'all'), $aLayouts, false); 744 745 $aTmplParams = array( 746 'bx_repeat:layouts' => array(), 747 'form' => '' 748 ); 749 750 foreach($aLayouts as $aLayout) 751 $aTmplParams['bx_repeat:layouts'][] = array( 752 'id' => $aLayout['id'], 753 'html_id' => $this->aHtmlIds['layout_id'] . $aLayout['id'], 754 'js_object' => $sJsObject, 755 'bx_if:active' => array( 756 'condition' => (int)$this->aPageRebuild['layout_id'] == (int)$aLayout['id'], 757 'content' => array() 758 ), 759 'icon' => $oTemplate->getImageUrl($aLayout['icon']), 760 'title' => _t($aLayout['title']), 761 ); 762 763 $aForm = array( 764 'form_attrs' => array( 765 'id' => 'adm-bp-settings-seo', 766 ), 767 'params' => array ( 768 'remove_form' => '1', 769 'csrf' => array( 770 'disable' => true 771 ) 772 ), 773 'inputs' => array ( 774 'layout_id' => array( 775 'type' => 'hidden', 776 'name' => 'layout_id', 777 'value' => $this->aPageRebuild['layout_id'], 778 ) 779 ) 780 ); 781 782 $oForm = new BxTemplStudioFormView($aForm); 783 $aTmplParams['form'] = $oForm->getCode(); 784 785 return $oTemplate->parseHtmlByName('bp_layouts.html', $aTmplParams); 786 } 787 788 protected function getSettingsVisibility() { 789 if((int)$this->aPageRebuild['visible_for_levels_editable'] == 0) 790 $aInput = array( 791 'type' => 'custom', 792 'name' => 'visible_for_levels', 793 'content' => MsgBox(_t('_adm_bp_err_page_visible_for_levels')) 794 ); 795 else 796 $aInput = array( 797 'type' => 'checkbox_set', 798 'name' => 'visible_for_levels', 799 'caption' => _t('_adm_bp_txt_page_visible_for_levels'), 800 'info' => _t('_adm_bp_dsc_page_visible_for_levels'), 801 'value' => '', 802 'values' => array(), 803 'db' => array ( 804 'pass' => 'Int', 805 ) 806 ); 807 808 $aForm = array( 809 'form_attrs' => array( 810 'id' => 'adm-bp-settings-visibility', 811 ), 812 'params' => array ( 813 'remove_form' => '1', 814 'csrf' => array( 815 'disable' => true 816 ) 817 ), 818 'inputs' => array ( 819 'visible_for_levels' => $aInput 820 ) 821 ); 822 823 bx_import('BxDolAcl'); 824 $aLevels = BxDolAcl::getInstance()->getMemberships(); 825 foreach($aLevels as $iKey => $sValue) { 826 if(((int)$this->aPageRebuild['visible_for_levels'] & pow(2, (int)$iKey - 1)) != 0) 827 $aForm['inputs']['visible_for_levels']['value'][] = $iKey; 828 829 $aForm['inputs']['visible_for_levels']['values'][$iKey] = _t($sValue); 830 } 693 831 694 832 $oForm = new BxTemplStudioFormView($aForm); … … 715 853 'value' => $this->aPageRebuild['cache_server'], 716 854 'required' => '', 855 'attrs' => array( 856 'disabled' => (int)$this->aPageRebuild['cache_editable'] == 0 ? 'disabled' : '' 857 ), 717 858 'db' => array ( 718 859 'pass' => 'Int', 719 860 ) 720 861 ), 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 862 ) 734 863 ); … … 736 865 $oForm = new BxTemplStudioFormView($aForm); 737 866 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' => true773 )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 867 } 789 868 … … 857 936 858 937 $aBlocks = array(); 859 $this->oDb->getBlocks(array('type' => 'by_module ', 'value' => $sModule), $aBlocks, false);938 $this->oDb->getBlocks(array('type' => 'by_module_to_copy', 'value' => $sModule), $aBlocks, false); 860 939 861 940 $aTmplParams = array(
Note: See TracChangeset
for help on using the changeset viewer.