Merged from branches/nzct-trunk. Use 'svn log -c <changeset> -g' for full commit message. Merge includes stability fixes and minor refactor of TableListField and ComplexTableField.

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/trunk@63807 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Hayden Smith 2008-10-08 02:00:39 +00:00
parent e6815f2156
commit 690cebdccd
10 changed files with 43 additions and 12 deletions

View File

@ -412,7 +412,7 @@ HTML;
$result = $tmpItem;
}
if(strpos('->', $field) !== false) {
if(strpos($field, '->') !== false) {
list ($field, $caster) = explode("->", $field);
}

View File

@ -83,7 +83,7 @@ class SecurityAdmin extends LeftAndMain implements PermissionProvider {
$fieldVal = $_REQUEST[$fieldName];
$result = '';
$matches = DataObject::get("Member","$fieldName LIKE '" . addslashes($fieldVal) . "%'");
$matches = DataObject::get($this->stat('subitem_class'),"$fieldName LIKE '" . addslashes($fieldVal) . "%'");
if($matches) {
$result .= "<ul>";
foreach($matches as $match) {

View File

@ -246,5 +246,8 @@ form#Form_EditForm #Form_ExportForm fieldset {
/* Hides from IE-mac \*/
* html .clear {height: 1%;}
.clear {display: block;}
.clear {
display: block;
clear: both;
}
/* End hide from IE-mac */

View File

@ -326,7 +326,7 @@
* Autocomplete
*/
.autocomplete {
background: #eee;
background: white;
}
.autocomplete ul {
border: 1px solid #aaa;
@ -492,3 +492,16 @@ div.originallang_holder.field.CompositeField.nolabel {
cursor: pointer;
}
.right form .field.confirmedpassword.nolabel .middleColumn {
background-color: #fff;
padding: 0px;
}
.right form .field.confirmedpassword.nolabel .middleColumn .middleColumn {
background-color: #e9e9e9;
padding: 3px;
}
.autocompleteoptions {
background-color: white;
}

View File

@ -48,7 +48,7 @@ function fixRightWidth() {
var rightWidth = bodyWidth - leftWidth - sepWidth -18;
// Extra pane in right for insert image/flash/link things
if($('contentPanel').style.display != "none") {
if($('contentPanel') && $('contentPanel').style.display != "none") {
rightWidth -= 210;
$('contentPanel').style.left = leftWidth + sepWidth + rightWidth + sepWidth + 23 + 'px';
}

View File

@ -163,6 +163,9 @@ CMSForm.prototype = {
if(this.validate && !this.validate()) {
// TODO Automatically switch to the tab/position of the first error
statusMessage("Validation failed.", "bad");
if($('Form_EditForm_action_save') && $('Form_EditForm_action_save').stopLoading) $('Form_EditForm_action_save').stopLoading();
return false;
}
@ -171,6 +174,7 @@ CMSForm.prototype = {
__form.resetElements();
if(__callAfter) __callAfter();
if(__form.notify) __form.notify('PageSaved', __form.elements.ID.value);
if($('Form_EditForm_action_save') && $('Form_EditForm_action_save').stopLoading) $('Form_EditForm_action_save').stopLoading();
_AJAX_LOADING = false;
}
@ -191,6 +195,7 @@ CMSForm.prototype = {
onSuccess : success,
onFailure : function(response) {
errorMessage('Error saving content', response);
if($('Form_EditForm_action_save') && $('Form_EditForm_action_save').stopLoading) $('Form_EditForm_action_save').stopLoading();
_AJAX_LOADING = false;
}
});
@ -308,11 +313,17 @@ CMSRightForm.prototype = {
CMSForm.applyTo('#Form_SubForm', 'rightbottom');
CMSRightForm.applyTo('#Form_EditForm', 'right');
function action_save_right() {
_AJAX_LOADING = true;
$('Form_EditForm_action_save').value = ss.i18n._t('CMSMAIN.SAVING');
$('Form_EditForm_action_save').className = 'action loading';
$('Form_EditForm_action_save').stopLoading = function() {
if($('Form_EditForm_action_save') && $('Form_EditForm_action_save').className.indexOf('loading') != -1) {
$('Form_EditForm_action_save').value = 'Save';
Element.removeClassName($('Form_EditForm_action_save'), 'loading');
}
}
$('Form_EditForm').save(false);
}

View File

@ -213,7 +213,8 @@ SidePanel.prototype = {
var srcName = this.id.replace('_holder','');
var id = $('Form_EditForm').elements.ID;
if(id) id = id.value; else id = "";
return 'admin/' + srcName + '/' + id + '?ajax=1';
// This assumes that admin/cms/ refers to CMSMain
return 'admin/cms/' + srcName + '/' + id + '?ajax=1';
},
afterPanelLoaded : function() {

View File

@ -135,9 +135,9 @@ TinyMCEImageEnhancement.prototype = {
if(navigator.appVersion.indexOf("Mac") != -1 || navigator.appVersion.indexOf("X11") != -1 || navigator.appVersion.indexOf("Linux") != -1) {
pv = getFlashPlayerVersion();
if(pv.major < 9 || (pv.major == 9 && pv.minor == 0 && pv.rev < 64)) {
$('AddFolderGroup').style.display = 'none';
$('PipeSeparator').style.display = 'none';
$('UploadGroup').style.display = 'none';
if($('AddFolderGroup')) $('AddFolderGroup').style.display = 'none';
if($('PipeSeparator')) $('PipeSeparator').style.display = 'none';
if($('UploadGroup')) $('UploadGroup').style.display = 'none';
return;
}
}

View File

@ -155,6 +155,9 @@ class RestfulServerTest extends SapphireTest {
}
public function testUnsupportedMediaType() {
$_SERVER['PHP_AUTH_USER'] = 'user@test.com';
$_SERVER['PHP_AUTH_PW'] = 'user';
$url = "/api/v1/RestfulServerTest_Comment/1";
$data = "Comment||\/||updated"; // weird format
$headers = array('Content-Type' => 'text/weirdformat');