- Timestamp:
- 02/01/12 00:05:23 (4 months ago)
- Location:
- trunk
- Files:
-
- 7 edited
-
modules/boonex/english/install/data/langs/en.xml (modified) (1 diff)
-
studio/classes/BxDolStudioBuilderPageQuery.php (modified) (2 diffs)
-
studio/classes/BxDolStudioPage.php (modified) (1 diff)
-
studio/js/builder_page.js (modified) (3 diffs)
-
studio/templates/base/bp_add_block.html (modified) (1 diff)
-
studio/templates/base/css/builder_page.css (modified) (1 diff)
-
studio/templates/base/scripts/BxBaseStudioBuilderPage.php (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/modules/boonex/english/install/data/langs/en.xml
r15936 r15939 2490 2490 <string name="_adm_bp_btn_block_cancel"><![CDATA[Cancel]]></string> 2491 2491 <string name="_adm_bp_txt_blocks_selected"><![CDATA[blocks selected]]></string> 2492 <string name=" "><![CDATA[]]></string>2493 <string name=" "><![CDATA[]]></string>2492 <string name="_adm_bp_scs_blocks_added"><![CDATA[The blocks were successfully added.]]></string> 2493 <string name="_adm_bp_err_blocks_added"><![CDATA[Cannot add blocks.]]></string> 2494 2494 <string name=""><![CDATA[]]></string> 2495 2495 <string name=""><![CDATA[]]></string> -
trunk/studio/classes/BxDolStudioBuilderPageQuery.php
r15936 r15939 172 172 } 173 173 174 function copyBlocksByIds($sObject, $iCellId, $aIds) { 175 $iOrder = $this->getBlockOrderMax($sObject) + 1; 176 177 $sSql = "INSERT INTO `sys_pages_blocks` 178 SELECT NULL AS `id`, ? AS `object`, ? AS `cell_id`, ? AS `module`, `title`, `designbox_id`, `visible_for_levels`, `type`, `content`, `deletable`, `copyable`, ? AS `order` 179 FROM `sys_pages_blocks` 180 WHERE `id` IN ('" . implode("','", array_fill(0, count($aIds), '?')) . "')"; 181 $sSql = call_user_func_array(array($this, 'prepare'), array_merge(array($sSql), array($sObject, $iCellId, BX_DOL_STUDIO_MODULE_CUSTOM, $iOrder + 1), $aIds)); 182 return (int)$this->query($sSql) > 0; 183 } 184 174 185 function deleteBlocks($aParams) { 175 186 $sWhereClause = ""; … … 195 206 return (int)$this->query($sSql) > 0; 196 207 } 208 209 function getBlockOrderMax($sObject, $iCellId = 1) { 210 $sSql = $this->prepare("SELECT MAX(`order`) FROM `sys_pages_blocks` WHERE `object`=? AND `cell_id`=? LIMIT 1", $sObject, $iCellId); 211 return (int)$this->getOne($sSql); 212 } 197 213 } 198 214 /** @} */ -
trunk/studio/classes/BxDolStudioPage.php
r15936 r15939 107 107 return stdGetClassName($sValue); 108 108 } 109 110 protected function getModuleTitle($sName) { 111 return stdGetModuleTitle($sName); 112 } 113 114 protected function getModules($bShowCustom = true, $bShowSystem = true) { 115 return stdGetModules($bShowCustom, $bShowSystem); 116 } 109 117 } 110 118 /** @} */ -
trunk/studio/js/builder_page.js
r15936 r15939 44 44 }; 45 45 46 BxDolStudioBuilderPage.prototype.onCreatePage = function(sPage) { 47 window.location.href = this.sActionsUrl + '?type=' + this.sType + '&page=' + sPage; 48 }; 49 46 50 BxDolStudioBuilderPage.prototype.reorder = function(oDraggable) { 47 51 var $this = this; … … 71 75 72 76 return true; 73 };74 75 BxDolStudioBuilderPage.prototype.onSelectBlock = function(oCheckbox) {76 var iCounter = parseInt($('#adm-bp-cbf-counter').html());77 iCounter += $(oCheckbox).attr('checked') == 'checked' ? 1 : -1;78 79 $('#adm-bp-cbf-counter').html(iCounter);80 77 }; 81 78 … … 116 113 }; 117 114 115 BxDolStudioBuilderPage.prototype.onSelectBlock = function(oCheckbox) { 116 var iCounter = parseInt($('#adm-bp-cbf-counter').html()); 117 iCounter += $(oCheckbox).attr('checked') == 'checked' ? 1 : -1; 118 119 $('#adm-bp-cbf-counter').html(iCounter); 120 }; 121 122 BxDolStudioBuilderPage.prototype.onCreateBlock = function(oData) { 123 window.location.href = this.sActionsUrl + '?type=' + this.sType + '&page=' + this.sPage; 124 }; 125 118 126 BxDolStudioBuilderPage.prototype.performAction = function(sAction) { 119 127 var $this = this; -
trunk/studio/templates/base/bp_add_block.html
r15936 r15939 1 1 <div class="adm-bp-create-block-form bx-def-color-bg-block"> 2 2 <div class="adm-bp-create-block-form-cnt"> 3 <div class="adm-bp-cbf-left">4 <div class="adm-bp-cbf-left-cnt">5 <bx_include_auto:menu_side.html />6 </div>7 </div>8 <div class="adm-bp-cbf-right bx-def-margin-left">9 <div id="__html_block_lists_id__" class="adm-bp-cbf-right-cnt">__blocks__</div>10 </div>11 <div class="bx-std-cb"></div>12 <div class="adm-bp-cbf-controls bx-def-padding-toprightleft">13 <button class="bx-btn bx-btn-primary"><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>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 <div class="bx-std-cb"></div>17 </ div>3 __form__ 4 <script type="text/javascript"> 5 $(document).ready(function () { 6 $("#__form_id__").ajaxForm({ 7 dataType: "json", 8 beforeSubmit: function(formData, jqForm, options) { 9 bx_loading($("#__form_id__"), true); 10 }, 11 success: function(oData) { 12 $(".bx-popup-applied:visible").dolPopupHide(); 13 oBxDolStudioPage.processJson(oData); 14 } 15 }); 16 }); 17 </script> 18 18 </div> 19 20 19 </div> -
trunk/studio/templates/base/css/builder_page.css
r15936 r15939 67 67 div.adm-bp-create-block-form-cnt {} 68 68 69 div.adm-bp-create-block-form fieldset.bx-form-section { 70 padding-bottom: 0px; 71 } 72 69 73 div.adm-bp-cbf-left { 70 74 float: left; -
trunk/studio/templates/base/scripts/BxBaseStudioBuilderPage.php
r15936 r15939 122 122 foreach($aBlocks as $aBlock) 123 123 $aTmplVarsCell['bx_repeat:blocks'][] = array( 124 ' id' =>$aBlock['id'],124 'html_id' => $this->aHtmlIds['block_id'] . $aBlock['id'], 125 125 'onclick' => $sJsObject . ".showEditBlockPopup(" . $aBlock['id'] . ")", 126 126 'title' => _t($aBlock['title']), … … 211 211 'form_attrs' => array( 212 212 'id' => 'adm-bp-page-create', 213 'action' => BX_DOL_URL_STUDIO . 'builder_page.php?bp_action=' . $this->sActionPageCreate ,213 'action' => BX_DOL_URL_STUDIO . 'builder_page.php?bp_action=' . $this->sActionPageCreate . '&type=' . $this->sType . '&page=' . $this->sPage, 214 214 'method' => 'post' 215 215 ), … … 360 360 361 361 return array( 362 //'msg' => _t('_adm_bp_scs_page_create'), 363 'eval' => 'window.parent.location.href = "' . BX_DOL_URL_STUDIO . 'builder_page.php?type=' . $this->sType . '&page=' . $sObject . '";' 362 'eval' => $this->getPageJsObject() . '.onCreatePage(\'' . $sObject . '\')' 364 363 ); 365 364 } … … 421 420 422 421 return array( 423 'id' => $this->aHtmlIds['block_list_id'] . $sModule,424 422 'content' => $this->getBlockList($sModule) 425 423 ); … … 432 430 $sSelected = BX_DOL_STUDIO_BP_TYPE_DEFAULT; 433 431 432 $aForm = array( 433 'form_attrs' => array( 434 'id' => 'adm-bp-block-create', 435 'action' => BX_DOL_URL_STUDIO . 'builder_page.php?bp_action=' . $this->sActionBlockCreate, 436 'method' => 'post' 437 ), 438 'params' => array ( 439 'db' => array( 440 'table' => 'sys_pages_blocks', 441 'key' => 'id', 442 'uri' => '', 443 'uri_title' => '', 444 'submit_name' => 'do_submit' 445 ), 446 ), 447 'inputs' => array ( 448 'page' => array( 449 'type' => 'hidden', 450 'name' => 'page', 451 'value' => $this->sPage, 452 'db' => array ( 453 'pass' => 'Xss', 454 ), 455 ), 456 'blocks' => array( 457 'type' => 'custom', 458 'name' => 'blocks', 459 'content' => '', 460 'db' => array ( 461 'pass' => 'Int', 462 ), 463 ), 464 ) 465 ); 466 434 467 //--- get modules in menu 435 468 $aModules = array( 436 469 array( 437 'id' => 0, 438 'type' => BX_DOL_STUDIO_MIT_ITEM, 439 'name' => BX_DOL_STUDIO_BP_TYPE_DEFAULT, 440 'uri' => BX_DOL_STUDIO_BP_TYPE_DEFAULT, 441 'title' => '_adm_bp_cpt_type_system', 470 'name' => BX_DOL_STUDIO_MODULE_SYSTEM, 442 471 'icon' => 'mi-system.png', 443 'active' => $sSelected == BX_DOL_STUDIO_BP_TYPE_DEFAULT ? 1 : 0, 472 'active' => $sSelected == BX_DOL_STUDIO_MODULE_SYSTEM ? 1 : 0, 473 ), 474 array( 475 'name' => BX_DOL_STUDIO_MODULE_CUSTOM, 476 'icon' => 'mi-system.png', 477 'active' => $sSelected == BX_DOL_STUDIO_MODULE_CUSTOM ? 1 : 0, 444 478 ), 445 479 ); … … 475 509 ) 476 510 ), 477 'caption' => _t($aModule['title'])511 'caption' => $this->getModuleTitle($aModule['name']) 478 512 ) 479 513 ), … … 484 518 $aTmplParams['blocks'] = $this->getBlockList($sSelected); 485 519 486 $sContent = $oTemplate->parseHtmlByName('bp_add_block.html', $aTmplParams); 520 $aForm['inputs']['blocks']['content'] = $oTemplate->parseHtmlByName('bp_add_block_form.html', $aTmplParams); 521 522 bx_import('BxTemplStudioFormView'); 523 $oForm = new BxTemplStudioFormView($aForm); 524 $oForm->initChecker(); 525 526 $sContent = ""; 527 if($oForm->isSubmittedAndValid()) { 528 $aBlocks = $oForm->getCleanValue('blocks'); 529 if($this->oDb->copyBlocksByIds($this->sPage, 1, $aBlocks)) 530 return array('msg' => _t('_adm_bp_scs_blocks_added'), 'eval' => $sJsObject . '.onCreateBlock(oData)'); 531 else 532 return array('msg' => _t('_adm_bp_err_blocks_added')); 533 } 487 534 488 535 bx_import('BxTemplStudioFunctions'); 489 $sContent = BxTemplStudioFunctions::getInstance()->popupBox($this->aHtmlIds['create_block_popup_id'], _t('_adm_bp_txt_new_block_popup'), $sContent); 536 $sContent = BxTemplStudioFunctions::getInstance()->popupBox($this->aHtmlIds['create_block_popup_id'], _t('_adm_bp_txt_new_block_popup'), $oTemplate->parseHtmlByName('bp_add_block.html', array( 537 'form_id' => $aForm['form_attrs']['id'], 538 'form' => $oForm->getCode() 539 ))); 490 540 491 541 return array('popup' => $sContent);
Note: See TracChangeset
for help on using the changeset viewer.