mirror of
https://github.com/colymba/GridFieldBulkEditingTools.git
synced 2024-10-22 11:05:57 +02:00
added finish button
This commit is contained in:
parent
7972cef1f1
commit
8089c14447
@ -180,7 +180,24 @@ class GridFieldBulkImageUpload_Request extends RequestHandler {
|
|||||||
*/
|
*/
|
||||||
public function uploadForm($id = null, $fields = null)
|
public function uploadForm($id = null, $fields = null)
|
||||||
{
|
{
|
||||||
$actions = new FieldList();
|
$crumbs = $this->Breadcrumbs();
|
||||||
|
if($crumbs && $crumbs->count()>=2)
|
||||||
|
{
|
||||||
|
$one_level_up = $crumbs->offsetGet($crumbs->count()-2);
|
||||||
|
$one_level_up = $one_level_up->Link;
|
||||||
|
}
|
||||||
|
|
||||||
|
$actions = new FieldList();
|
||||||
|
|
||||||
|
$actions->push(
|
||||||
|
FormAction::create('Finish', 'Finish')
|
||||||
|
->setAttribute('id', 'bulkImageUploadFinishBtn')
|
||||||
|
->addExtraClass('cms-panel-link')
|
||||||
|
->setAttribute('data-icon', 'accept')
|
||||||
|
->setAttribute('href', $one_level_up)
|
||||||
|
->setUseButtonTag(true)
|
||||||
|
->setAttribute('src', '')//changes type to image so isn't hooked by default actions handlers
|
||||||
|
);
|
||||||
|
|
||||||
$actions->push(
|
$actions->push(
|
||||||
FormAction::create('SaveAll', 'Save All')
|
FormAction::create('SaveAll', 'Save All')
|
||||||
@ -254,12 +271,9 @@ class GridFieldBulkImageUpload_Request extends RequestHandler {
|
|||||||
$actions
|
$actions
|
||||||
);
|
);
|
||||||
|
|
||||||
|
if($one_level_up)
|
||||||
$crumbs = $this->Breadcrumbs();
|
|
||||||
if($crumbs && $crumbs->count()>=2)
|
|
||||||
{
|
{
|
||||||
$one_level_up = $crumbs->offsetGet($crumbs->count()-2);
|
$form->Backlink = $one_level_up;
|
||||||
$form->Backlink = $one_level_up->Link;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return $form;
|
return $form;
|
||||||
|
@ -41,7 +41,7 @@
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
$('div.ss-upload .ss-uploadfield-item-editform form').entwine({
|
$('#Form_uploadForm, div.ss-upload .ss-uploadfield-item-editform form').entwine({
|
||||||
onsubmit: function(e) {
|
onsubmit: function(e) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -55,6 +55,28 @@
|
|||||||
},
|
},
|
||||||
onunmatch: function(){}
|
onunmatch: function(){}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
$('#bulkImageUploadFinishBtn').entwine({
|
||||||
|
onmatch: function(){},
|
||||||
|
onunmatch: function(){},
|
||||||
|
onclick: function(e){
|
||||||
|
var formsWithUpadtes = $('form.bulkImageUploadUpdateForm.hasUpdate').length,
|
||||||
|
confirmed = true;
|
||||||
|
|
||||||
|
if ( formsWithUpadtes > 0 )
|
||||||
|
{
|
||||||
|
confirmed = confirm(
|
||||||
|
"You have unsaved changes. Continuing will loose all unsaved data.\n\n" +
|
||||||
|
"Do your really want to continue?"
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (confirmed)
|
||||||
|
{
|
||||||
|
$('.cms-container').loadPanel(this.attr('href'), null, {});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
// end SS overhides
|
// end SS overhides
|
||||||
// start add-on behaviours
|
// start add-on behaviours
|
||||||
@ -203,7 +225,6 @@
|
|||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
//
|
//
|
||||||
|
|
||||||
});
|
});
|
||||||
|
@ -1,3 +1,3 @@
|
|||||||
<a id="bulkImageUploadGFButton" href="$Link" class="action action-detail ss-ui-action-constructive ss-ui-button ui-button ui-widget ui-state-default ui-corner-all new new-link" data-icon="drive-upload">
|
<a id="bulkImageUploadGFButton" href="$Link" class="cms-panel-link ss-ui-action-constructive ss-ui-button" data-icon="drive-upload">
|
||||||
$Label
|
$Label
|
||||||
</a>
|
</a>
|
Loading…
Reference in New Issue
Block a user