mirror of
https://github.com/silverstripe/silverstripe-cms
synced 2024-10-22 08:05:56 +02:00
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:
parent
e6815f2156
commit
690cebdccd
@ -412,7 +412,7 @@ HTML;
|
|||||||
$result = $tmpItem;
|
$result = $tmpItem;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(strpos('->', $field) !== false) {
|
if(strpos($field, '->') !== false) {
|
||||||
list ($field, $caster) = explode("->", $field);
|
list ($field, $caster) = explode("->", $field);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -83,7 +83,7 @@ class SecurityAdmin extends LeftAndMain implements PermissionProvider {
|
|||||||
$fieldVal = $_REQUEST[$fieldName];
|
$fieldVal = $_REQUEST[$fieldName];
|
||||||
$result = '';
|
$result = '';
|
||||||
|
|
||||||
$matches = DataObject::get("Member","$fieldName LIKE '" . addslashes($fieldVal) . "%'");
|
$matches = DataObject::get($this->stat('subitem_class'),"$fieldName LIKE '" . addslashes($fieldVal) . "%'");
|
||||||
if($matches) {
|
if($matches) {
|
||||||
$result .= "<ul>";
|
$result .= "<ul>";
|
||||||
foreach($matches as $match) {
|
foreach($matches as $match) {
|
||||||
|
@ -246,5 +246,8 @@ form#Form_EditForm #Form_ExportForm fieldset {
|
|||||||
|
|
||||||
/* Hides from IE-mac \*/
|
/* Hides from IE-mac \*/
|
||||||
* html .clear {height: 1%;}
|
* html .clear {height: 1%;}
|
||||||
.clear {display: block;}
|
.clear {
|
||||||
|
display: block;
|
||||||
|
clear: both;
|
||||||
|
}
|
||||||
/* End hide from IE-mac */
|
/* End hide from IE-mac */
|
@ -326,7 +326,7 @@
|
|||||||
* Autocomplete
|
* Autocomplete
|
||||||
*/
|
*/
|
||||||
.autocomplete {
|
.autocomplete {
|
||||||
background: #eee;
|
background: white;
|
||||||
}
|
}
|
||||||
.autocomplete ul {
|
.autocomplete ul {
|
||||||
border: 1px solid #aaa;
|
border: 1px solid #aaa;
|
||||||
@ -492,3 +492,16 @@ div.originallang_holder.field.CompositeField.nolabel {
|
|||||||
cursor: pointer;
|
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;
|
||||||
|
}
|
@ -48,7 +48,7 @@ function fixRightWidth() {
|
|||||||
var rightWidth = bodyWidth - leftWidth - sepWidth -18;
|
var rightWidth = bodyWidth - leftWidth - sepWidth -18;
|
||||||
|
|
||||||
// Extra pane in right for insert image/flash/link things
|
// Extra pane in right for insert image/flash/link things
|
||||||
if($('contentPanel').style.display != "none") {
|
if($('contentPanel') && $('contentPanel').style.display != "none") {
|
||||||
rightWidth -= 210;
|
rightWidth -= 210;
|
||||||
$('contentPanel').style.left = leftWidth + sepWidth + rightWidth + sepWidth + 23 + 'px';
|
$('contentPanel').style.left = leftWidth + sepWidth + rightWidth + sepWidth + 23 + 'px';
|
||||||
}
|
}
|
||||||
|
@ -163,6 +163,9 @@ CMSForm.prototype = {
|
|||||||
if(this.validate && !this.validate()) {
|
if(this.validate && !this.validate()) {
|
||||||
// TODO Automatically switch to the tab/position of the first error
|
// TODO Automatically switch to the tab/position of the first error
|
||||||
statusMessage("Validation failed.", "bad");
|
statusMessage("Validation failed.", "bad");
|
||||||
|
|
||||||
|
if($('Form_EditForm_action_save') && $('Form_EditForm_action_save').stopLoading) $('Form_EditForm_action_save').stopLoading();
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -171,6 +174,7 @@ CMSForm.prototype = {
|
|||||||
__form.resetElements();
|
__form.resetElements();
|
||||||
if(__callAfter) __callAfter();
|
if(__callAfter) __callAfter();
|
||||||
if(__form.notify) __form.notify('PageSaved', __form.elements.ID.value);
|
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;
|
_AJAX_LOADING = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -191,6 +195,7 @@ CMSForm.prototype = {
|
|||||||
onSuccess : success,
|
onSuccess : success,
|
||||||
onFailure : function(response) {
|
onFailure : function(response) {
|
||||||
errorMessage('Error saving content', response);
|
errorMessage('Error saving content', response);
|
||||||
|
if($('Form_EditForm_action_save') && $('Form_EditForm_action_save').stopLoading) $('Form_EditForm_action_save').stopLoading();
|
||||||
_AJAX_LOADING = false;
|
_AJAX_LOADING = false;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -308,11 +313,17 @@ CMSRightForm.prototype = {
|
|||||||
CMSForm.applyTo('#Form_SubForm', 'rightbottom');
|
CMSForm.applyTo('#Form_SubForm', 'rightbottom');
|
||||||
CMSRightForm.applyTo('#Form_EditForm', 'right');
|
CMSRightForm.applyTo('#Form_EditForm', 'right');
|
||||||
|
|
||||||
|
|
||||||
function action_save_right() {
|
function action_save_right() {
|
||||||
_AJAX_LOADING = true;
|
_AJAX_LOADING = true;
|
||||||
$('Form_EditForm_action_save').value = ss.i18n._t('CMSMAIN.SAVING');
|
$('Form_EditForm_action_save').value = ss.i18n._t('CMSMAIN.SAVING');
|
||||||
$('Form_EditForm_action_save').className = 'action loading';
|
$('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);
|
$('Form_EditForm').save(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -213,7 +213,8 @@ SidePanel.prototype = {
|
|||||||
var srcName = this.id.replace('_holder','');
|
var srcName = this.id.replace('_holder','');
|
||||||
var id = $('Form_EditForm').elements.ID;
|
var id = $('Form_EditForm').elements.ID;
|
||||||
if(id) id = id.value; else 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() {
|
afterPanelLoaded : function() {
|
||||||
|
@ -135,9 +135,9 @@ TinyMCEImageEnhancement.prototype = {
|
|||||||
if(navigator.appVersion.indexOf("Mac") != -1 || navigator.appVersion.indexOf("X11") != -1 || navigator.appVersion.indexOf("Linux") != -1) {
|
if(navigator.appVersion.indexOf("Mac") != -1 || navigator.appVersion.indexOf("X11") != -1 || navigator.appVersion.indexOf("Linux") != -1) {
|
||||||
pv = getFlashPlayerVersion();
|
pv = getFlashPlayerVersion();
|
||||||
if(pv.major < 9 || (pv.major == 9 && pv.minor == 0 && pv.rev < 64)) {
|
if(pv.major < 9 || (pv.major == 9 && pv.minor == 0 && pv.rev < 64)) {
|
||||||
$('AddFolderGroup').style.display = 'none';
|
if($('AddFolderGroup')) $('AddFolderGroup').style.display = 'none';
|
||||||
$('PipeSeparator').style.display = 'none';
|
if($('PipeSeparator')) $('PipeSeparator').style.display = 'none';
|
||||||
$('UploadGroup').style.display = 'none';
|
if($('UploadGroup')) $('UploadGroup').style.display = 'none';
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -155,6 +155,9 @@ class RestfulServerTest extends SapphireTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public function testUnsupportedMediaType() {
|
public function testUnsupportedMediaType() {
|
||||||
|
$_SERVER['PHP_AUTH_USER'] = 'user@test.com';
|
||||||
|
$_SERVER['PHP_AUTH_PW'] = 'user';
|
||||||
|
|
||||||
$url = "/api/v1/RestfulServerTest_Comment/1";
|
$url = "/api/v1/RestfulServerTest_Comment/1";
|
||||||
$data = "Comment||\/||updated"; // weird format
|
$data = "Comment||\/||updated"; // weird format
|
||||||
$headers = array('Content-Type' => 'text/weirdformat');
|
$headers = array('Content-Type' => 'text/weirdformat');
|
||||||
|
Loading…
Reference in New Issue
Block a user