ENHANCEMENT Using new "tools" panel architecture to render CMS templates, which e.g. allows CMSPageEditController to reload the form without the tree in the side-by-side display variation, and hence avoids slowing down the loading and saving process

This commit is contained in:
Ingo Schommer 2012-02-14 21:52:55 +01:00
parent f88d4006f8
commit 38cf7e5c4d
12 changed files with 61 additions and 55 deletions

View File

@ -507,7 +507,7 @@ class CMSMain extends LeftAndMain implements CurrentPageIdentifier, PermissionPr
$form->addExtraClass('cms-edit-form'); $form->addExtraClass('cms-edit-form');
$form->setTemplate($this->getTemplatesWithSuffix('_EditForm')); $form->setTemplate($this->getTemplatesWithSuffix('_EditForm'));
// TODO Can't merge $FormAttributes in template at the moment // TODO Can't merge $FormAttributes in template at the moment
$form->addExtraClass('cms-content center ss-tabset ' . $this->BaseCSSClasses()); $form->addExtraClass('center ss-tabset ' . $this->BaseCSSClasses());
if($form->Fields()->hasTabset()) $form->Fields()->findOrMakeTab('Root')->setTemplate('CMSTabSet'); if($form->Fields()->hasTabset()) $form->Fields()->findOrMakeTab('Root')->setTemplate('CMSTabSet');
if(!$record->canEdit() || $record->IsDeletedFromStage) { if(!$record->canEdit() || $record->IsDeletedFromStage) {

View File

@ -8,13 +8,4 @@ class CMSPageEditController extends CMSMain {
static $url_segment = 'page/edit'; static $url_segment = 'page/edit';
static $url_rule = '/$Action/$ID/$OtherID'; static $url_rule = '/$Action/$ID/$OtherID';
static $url_priority = 41; static $url_priority = 41;
public function getEditForm($id = null, $fields = null) {
$left = new SSViewer('CMSPageController_EditForm_Left');
$form = parent::getEditForm($id, $fields);
$form->Left = $left->process($this);
return $form;
}
} }

View File

@ -1,9 +0,0 @@
<div class="cms-panel-content center">
<div class="cms-tree" data-url-tree="$Link(getsubtree)">
$SiteTreeAsUL
</div>
</div>
<div class="cms-panel-content-collapsed">
<h3 class="cms-panel-header">$SiteConfig.Title</h3>
</div>

View File

@ -0,0 +1,17 @@
<div class="cms-content-tools west cms-panel cms-panel-layout" data-expandOnClick="true" data-layout="{type: 'border'}">
<div class="cms-content-header cms-panel-header north">
<h2><% _t('CMSPageEditController.Title','Pages') %></h2>
</div>
<div class="cms-panel-content center">
<div class="cms-tree" data-url-tree="$Link(getsubtree)">
$SiteTreeAsUL
</div>
</div>
<div class="cms-panel-content-collapsed">
<h3 class="cms-panel-header">$SiteConfig.Title</h3>
</div>
</div>

View File

@ -0,0 +1,9 @@
<div class="cms-content-tools west cms-panel cms-panel-layout collapsed" id="cms-content-tools" data-expandOnClick="true" data-layout="{type: 'border'}">
<div class="cms-panel-content center">
<h3 class="cms-panel-header"><% _t('FILTER', 'Filter') %></h3>
TODO
</div>
<div class="cms-panel-content-collapsed">
<h3 class="cms-panel-header"><% _t('FILTER', 'Filter') %></h3>
</div>
</div>

View File

@ -1,15 +0,0 @@
<div class="cms-content center $BaseCSSClasses" data-layout="{type: 'border'}">
<div class="cms-content-tools west cms-panel cms-panel-layout" data-expandOnClick="true" data-layout="{type: 'border'}">
<div class="cms-content-header north">
<div>
<h2><% _t('CMSPageHistoryController.History','History') %></h2>
</div>
</div>
<div class="cms-panel-content cms-helper-hide-actions center">
$VersionsForm
</div>
</div>
$EditForm
</div>

View File

@ -0,0 +1,11 @@
<div class="cms-content-tools west cms-panel cms-panel-layout" data-expandOnClick="true" data-layout="{type: 'border'}">
<div class="cms-content-header north">
<div>
<h2><% _t('CMSPageHistoryController.History','History') %></h2>
</div>
</div>
<div class="cms-panel-content cms-helper-hide-actions center">
$VersionsForm
</div>
</div>

View File

@ -0,0 +1 @@
<% include CMSPageEditController_Tools %>

View File

@ -22,15 +22,7 @@
</div> </div>
</div> </div>
<div class="cms-content-tools west cms-panel cms-panel-layout collapsed" id="cms-content-tools" data-expandOnClick="true" data-layout="{type: 'border'}"> $Tools
<div class="cms-panel-content center">
<h3 class="cms-panel-header"><% _t('FILTER', 'Filter') %></h3>
$SearchForm
</div>
<div class="cms-panel-content-collapsed">
<h3 class="cms-panel-header"><% _t('FILTER', 'Filter') %></h3>
</div>
</div>
<div class="cms-content-fields center ui-widget-content"> <div class="cms-content-fields center ui-widget-content">

View File

@ -0,0 +1,9 @@
<div class="cms-content-tools west cms-panel cms-panel-layout collapsed" id="cms-content-tools" data-expandOnClick="true" data-layout="{type: 'border'}">
<div class="cms-panel-content center">
<h3 class="cms-panel-header"><% _t('FILTER', 'Filter') %></h3>
$SearchForm
</div>
<div class="cms-panel-content-collapsed">
<h3 class="cms-panel-header"><% _t('FILTER', 'Filter') %></h3>
</div>
</div>

View File

@ -4,18 +4,7 @@
<h2><% _t('REPORTS','Reports') %></h2> <h2><% _t('REPORTS','Reports') %></h2>
</div> </div>
$Tools
<div class="cms-content-tools west">
<ul class="ui-widget-content">
<% control Reports %>
<li id="record-$ID">
<a href="admin/reports/show/$ID" title="$TreeDescription">$TreeTitle</a>
</li>
<% end_control %>
</ul>
</div>
<div class="cms-content-fields center ui-widget-content"> <div class="cms-content-fields center ui-widget-content">
$EditForm $EditForm

View File

@ -0,0 +1,11 @@
<div class="cms-content-tools west">
<ul class="ui-widget-content">
<% control Reports %>
<li id="record-$ID">
<a href="admin/reports/show/$ID" title="$TreeDescription">$TreeTitle</a>
</li>
<% end_control %>
</ul>
</div>