Merged from branches/2.3

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/trunk@71279 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Sean Harvey 2009-02-03 03:56:56 +00:00
parent 75f962b6e9
commit 31f530cb0f
7 changed files with 48 additions and 23 deletions

View File

@ -426,7 +426,6 @@ JS;
} }
} }
} }
$form = new Form($this, "EditForm", $fields, $actions); $form = new Form($this, "EditForm", $fields, $actions);
$form->loadDataFrom($record); $form->loadDataFrom($record);
$form->disableDefaultAction(); $form->disableDefaultAction();
@ -589,7 +588,7 @@ JS;
*/ */
public function revert($urlParams, $form) { public function revert($urlParams, $form) {
$id = (int)$_REQUEST['ID']; $id = (int)$_REQUEST['ID'];
$record = Versioned::get_one_by_stage('SiteTree', 'Live', "\"SiteTree_Live\".\"ID\" = {$id}"); $record = Versioned::get_one_by_stage('SiteTree', 'Live', "`SiteTree_Live`.`ID` = {$id}");
// a user can restore a page without publication rights, as it just adds a new draft state // a user can restore a page without publication rights, as it just adds a new draft state
// (this action should just be available when page has been "deleted from draft") // (this action should just be available when page has been "deleted from draft")

View File

@ -65,6 +65,7 @@ class ThumbnailStripField extends FormField {
foreach($images as $image) { foreach($images as $image) {
$thumbnail = $image->getFormattedImage('StripThumbnail'); $thumbnail = $image->getFormattedImage('StripThumbnail');
if ($thumbnail instanceof Image_Cached) { //Hack here...
// Constrain the output image to a 600x600 square. This is passed to the destwidth/destheight in the class, which are then used to // Constrain the output image to a 600x600 square. This is passed to the destwidth/destheight in the class, which are then used to
// set width & height properties on the <img> tag inserted into the CMS. Resampling is done after save // set width & height properties on the <img> tag inserted into the CMS. Resampling is done after save
$width = $image->Width; $width = $image->Width;
@ -85,6 +86,7 @@ class ThumbnailStripField extends FormField {
'</a>' . '</a>' .
'</li>'; '</li>';
} }
}
$result .= '</ul>'; $result .= '</ul>';
} else { } else {
if($folder) { if($folder) {

View File

@ -102,6 +102,10 @@ input.loading {
background: #fff url(../images/network-save.gif) no-repeat center left; background: #fff url(../images/network-save.gif) no-repeat center left;
} }
input.hidden {
display: none;
}
/* Overrides - TODO Find a better place to put them */ /* Overrides - TODO Find a better place to put them */
form#Form_EditForm fieldset { form#Form_EditForm fieldset {
height: 100%; height: 100%;
@ -342,10 +346,24 @@ body.stillLoading select {
width: 100%; width: 100%;
margin: 0 0 5px 0; margin: 0 0 5px 0;
padding-left: 5px; padding-left: 5px;
position: relative;
} }
#SearchBox #SiteTreeSearchTerm { #SearchBox #SiteTreeSearchTerm {
padding: 1px 0 2px 0; padding: 1px 0 2px 0;
} }
#searchIndicator {
display: none;
width: 16px;
height: 16px;
background: #EFEFEF url(../images/network-save.gif) no-repeat;
position: absolute;
left: 145px;
top: 2px;
}
#searchIndicator.loading {
display: block;
}
.SearchCriteriaContainer { .SearchCriteriaContainer {
float: left; float: left;
width: 100%; width: 100%;

View File

@ -594,9 +594,12 @@ ChangeTracker.prototype = {
var elements = Form.getElements(this); var elements = Form.getElements(this);
var i, element; var i, element;
for(i=0;element=elements[i];i++) { for(i=0;element=elements[i];i++) {
// NOTE: TinyMCE coupling
// Ignore mce-generated elements
if(element.className.substr(0,3) == 'mce') continue;
if(!element.isChanged) element.isChanged = this.field_changed; if(!element.isChanged) element.isChanged = this.field_changed;
if(!this.changeDetection_fieldsToIgnore[element.name] && element.isChanged()) { if(!this.changeDetection_fieldsToIgnore[element.name] && element.isChanged()) {
//if( window.location.href.match( /^https?:\/\/dev/ ) ) //if( window.location.href.match( /^https?:\/\/dev/ ) )
// Debug.log('Changed:'+ element.id + '(' + this.originalSerialized +')->('+Form.Element.serialize(element)+')' ); // Debug.log('Changed:'+ element.id + '(' + this.originalSerialized +')->('+Form.Element.serialize(element)+')' );

View File

@ -479,11 +479,13 @@ SiteTreeFilterForm = Class.create();
SiteTreeFilterForm.applyTo('form#search_options'); SiteTreeFilterForm.applyTo('form#search_options');
SiteTreeFilterForm.prototype = { SiteTreeFilterForm.prototype = {
onsubmit: function() { onsubmit: function() {
$('SiteTreeSearchButton').className = 'loading'; $('SiteTreeSearchButton').className = 'hidden';
$('searchIndicator').className = 'loading';
Ajax.SubmitForm(this, null, { Ajax.SubmitForm(this, null, {
onSuccess : function(response) { onSuccess : function(response) {
$('SiteTreeIsFiltered').value = 1; $('SiteTreeIsFiltered').value = 1;
$('SiteTreeSearchButton').className = ''; $('SiteTreeSearchButton').className = '';
$('searchIndicator').className = '';
$('sitetree_ul').innerHTML = response.responseText; $('sitetree_ul').innerHTML = response.responseText;
Behaviour.apply($('sitetree_ul')); Behaviour.apply($('sitetree_ul'));
statusMessage('Filtered tree','good'); statusMessage('Filtered tree','good');

View File

@ -26,7 +26,7 @@ if((typeof tinyMCE != 'undefined')) {
theme_advanced_toolbar_location : "top", theme_advanced_toolbar_location : "top",
theme_advanced_toolbar_align : "left", theme_advanced_toolbar_align : "left",
theme_advanced_toolbar_parent : "right", theme_advanced_toolbar_parent : "right",
plugins : "blockquote,contextmenu,table,emotions,paste,../../tinymce_ssbuttons,../../tinymce_advcode,spellchecker", plugins : "media,blockquote,contextmenu,table,emotions,paste,../../tinymce_ssbuttons,../../tinymce_advcode,spellchecker",
blockquote_clear_tag : "p", blockquote_clear_tag : "p",
table_inline_editing : true, table_inline_editing : true,
theme_advanced_buttons1 : "bold,italic,underline,strikethrough,separator,justifyleft,justifycenter,justifyright,justifyfull,styleselect,formatselect,separator,bullist,numlist,outdent,indent,blockquote,hr,charmap", theme_advanced_buttons1 : "bold,italic,underline,strikethrough,separator,justifyleft,justifycenter,justifyright,justifyfull,styleselect,formatselect,separator,bullist,numlist,outdent,indent,blockquote,hr,charmap",

View File

@ -30,6 +30,7 @@
<div id="SearchBox"> <div id="SearchBox">
<input type="text" id="SiteTreeSearchTerm" name="SiteTreeSearchTerm" /> <input type="text" id="SiteTreeSearchTerm" name="SiteTreeSearchTerm" />
<div id="searchIndicator">&nbsp;</div>
<input type="submit" id="SiteTreeSearchButton" class="action" value="<% _t('SEARCH') %>" title="<% _t('SEARCHTITLE','Search through URL, Title, Menu Title, &amp; Content') %>" /> <input type="submit" id="SiteTreeSearchButton" class="action" value="<% _t('SEARCH') %>" title="<% _t('SEARCHTITLE','Search through URL, Title, Menu Title, &amp; Content') %>" />
</div> </div>