(merged from branches/roa. use "svn log -c <changeset> -g <module-svn-path>" for detailed commit message)

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/trunk@60287 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Ingo Schommer 2008-08-11 00:14:48 +00:00
parent c4651a2fda
commit 574fdb190d
2 changed files with 6 additions and 2 deletions

View File

@ -167,7 +167,9 @@ abstract class ModelAdmin extends LeftAndMain {
protected function ManagedModelsSelect() {
$models = $this->getManagedModels();
$modelMap = array();
foreach($models as $modelName) $modelMap[$modelName] = singleton($modelName)->singular_name();
foreach($models as $modelName) {
if(singleton($modelName)->canCreate(Member::currentUser())) $modelMap[$modelName] = singleton($modelName)->singular_name();
}
$form = new Form(
$this,
@ -616,7 +618,7 @@ class ModelAdmin_RecordController extends Controller {
* @return mixed
*/
function doSave($data, $form, $request) {
$this->currentRecord->update($request->postVars());
$form->saveInto($this->currentRecord);
$this->currentRecord->write();
// Behaviour switched on ajax.

View File

@ -38,6 +38,8 @@ jQuery(document).ready(function() {
function saveRecord(uri, data) {
jQuery.post(uri, data, function(result){
jQuery('#right #ModelAdminPanel').html(result);
statusMessage("Saved");
// TODO/SAM: It seems a bit of a hack to have to list all the little updaters here.
// Is livequery a solution?