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->loadDataFrom($record);
$form->disableDefaultAction();
@ -589,7 +588,7 @@ JS;
*/
public function revert($urlParams, $form) {
$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
// (this action should just be available when page has been "deleted from draft")

View File

@ -65,25 +65,27 @@ class ThumbnailStripField extends FormField {
foreach($images as $image) {
$thumbnail = $image->getFormattedImage('StripThumbnail');
// 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
$width = $image->Width;
$height = $image->Height;
if($width > 600) {
$height *= (600 / $width);
$width = 600;
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
// set width & height properties on the <img> tag inserted into the CMS. Resampling is done after save
$width = $image->Width;
$height = $image->Height;
if($width > 600) {
$height *= (600 / $width);
$width = 600;
}
if($height > 600) {
$width *= (600 / $height);
$height = 600;
}
$result .=
'<li>' .
'<a href="' . $image->Filename . '?r=' . rand(1,100000) . '" title="' . $image->Title . '">' .
'<img class="destwidth=' . round($width) . ',destheight=' . round($height) . '" src="'. $thumbnail->URL . '?r=' . rand(1,100000) . '" alt="' . $image->Title . '" />' .
'</a>' .
'</li>';
}
if($height > 600) {
$width *= (600 / $height);
$height = 600;
}
$result .=
'<li>' .
'<a href="' . $image->Filename . '?r=' . rand(1,100000) . '" title="' . $image->Title . '">' .
'<img class="destwidth=' . round($width) . ',destheight=' . round($height) . '" src="'. $thumbnail->URL . '?r=' . rand(1,100000) . '" alt="' . $image->Title . '" />' .
'</a>' .
'</li>';
}
$result .= '</ul>';
} else {

View File

@ -102,6 +102,10 @@ input.loading {
background: #fff url(../images/network-save.gif) no-repeat center left;
}
input.hidden {
display: none;
}
/* Overrides - TODO Find a better place to put them */
form#Form_EditForm fieldset {
height: 100%;
@ -342,10 +346,24 @@ body.stillLoading select {
width: 100%;
margin: 0 0 5px 0;
padding-left: 5px;
position: relative;
}
#SearchBox #SiteTreeSearchTerm {
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 {
float: left;
width: 100%;

View File

@ -594,9 +594,12 @@ ChangeTracker.prototype = {
var elements = Form.getElements(this);
var i, element;
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(!this.changeDetection_fieldsToIgnore[element.name] && element.isChanged()) {
//if( window.location.href.match( /^https?:\/\/dev/ ) )
// 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.prototype = {
onsubmit: function() {
$('SiteTreeSearchButton').className = 'loading';
$('SiteTreeSearchButton').className = 'hidden';
$('searchIndicator').className = 'loading';
Ajax.SubmitForm(this, null, {
onSuccess : function(response) {
$('SiteTreeIsFiltered').value = 1;
$('SiteTreeSearchButton').className = '';
$('searchIndicator').className = '';
$('sitetree_ul').innerHTML = response.responseText;
Behaviour.apply($('sitetree_ul'));
statusMessage('Filtered tree','good');

View File

@ -26,7 +26,7 @@ if((typeof tinyMCE != 'undefined')) {
theme_advanced_toolbar_location : "top",
theme_advanced_toolbar_align : "left",
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",
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",

View File

@ -30,6 +30,7 @@
<div id="SearchBox">
<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') %>" />
</div>