diff --git a/bulkManager/code/GridFieldBulkActionDeleteHandler.php b/bulkManager/code/GridFieldBulkActionDeleteHandler.php index bcc0e0d..fb29e4e 100644 --- a/bulkManager/code/GridFieldBulkActionDeleteHandler.php +++ b/bulkManager/code/GridFieldBulkActionDeleteHandler.php @@ -1,8 +1,10 @@ '$Action' 'bulkedit/update' => 'update', 'bulkedit' => 'edit' ); diff --git a/bulkManager/code/GridFieldBulkActionHandler.php b/bulkManager/code/GridFieldBulkActionHandler.php index 5b0c030..2ca13bb 100644 --- a/bulkManager/code/GridFieldBulkActionHandler.php +++ b/bulkManager/code/GridFieldBulkActionHandler.php @@ -1,8 +1,12 @@ ID) @@ -267,19 +297,38 @@ class GridFieldBulkManager implements GridField_HTMLProvider, GridField_ColumnPr return $cb->Field(); } + /** + * Set the column's HTML attributes + * + * @param GridField $gridField Current GridField instance + * @param DataObject $record Record intance for this row + * @param string $columnName Column's name for which we need attributes + * @return array List of HTML attributes + */ function getColumnAttributes($gridField, $record, $columnName) { return array('class' => 'col-bulkSelect'); } + /** + * Set the column's meta data + * + * @param GridField $gridField Current GridField instance + * @param string $columnName Column's name for which we need meta data + * @return array List of meta data + */ function getColumnMetadata($gridField, $columnName) { if($columnName == 'BulkSelect') { return array('title' => 'Select'); } } - - /* // GridField_ColumnProvider */ + + + + /* ********************************************************************** + * GridField_HTMLProvider + * */ /** * @@ -334,9 +383,16 @@ class GridFieldBulkManager implements GridField_HTMLProvider, GridField_ColumnPr 'header' => $templateData->renderWith('BulkManagerButtons') ); } + + + + /* ********************************************************************** + * GridField_URLHandler + * */ /** - * + * Returns an action => handler list + * * @param GridField $gridField * @return array */ diff --git a/bulkManager/javascript/GridFieldBulkManager.js b/bulkManager/javascript/GridFieldBulkManager.js index 5a5543f..5ba147b 100644 --- a/bulkManager/javascript/GridFieldBulkManager.js +++ b/bulkManager/javascript/GridFieldBulkManager.js @@ -1,10 +1,5 @@ (function($) { - $.entwine('ss', function($) { - - // start SS namespace overrides - - // end SS namespace overrides - + $.entwine('ss', function($) { $.entwine('colymba', function($) { @@ -41,7 +36,10 @@ onunmatch: function(){} }); - + + /** + * Bulkselect table cell behaviours + */ $('td.col-bulkSelect').entwine({ onmatch: function(){ }, @@ -62,7 +60,11 @@ else $(cb).prop('checked', false); } }); + + /** + * Individual select checkbox behaviour + */ $('td.col-bulkSelect input').entwine({ onmatch: function(){ }, @@ -73,6 +75,10 @@ } }); + + /** + * Bulkselect checkbox behaviours + */ $('input.bulkSelectAll').entwine({ onmatch: function(){ }, @@ -95,7 +101,11 @@ .get(); } }); + + /** + * Bulk action dropdown behaviours + */ $('select.bulkActionName').entwine({ onmatch: function(){ }, @@ -131,6 +141,10 @@ } }); + + /** + * bulk action button behaviours + */ $('.doBulkActionButton').entwine({ onmatch: function(){ }, diff --git a/bulkUpload/code/GridFieldBulkUpload.php b/bulkUpload/code/GridFieldBulkUpload.php index db35214..07f8bfe 100644 --- a/bulkUpload/code/GridFieldBulkUpload.php +++ b/bulkUpload/code/GridFieldBulkUpload.php @@ -4,9 +4,10 @@ * * @author colymba * @package GridFieldBulkEditingTools + * @subpackage BulkUpload */ -class GridFieldBulkUpload implements GridField_HTMLProvider, GridField_URLHandler { - +class GridFieldBulkUpload implements GridField_HTMLProvider, GridField_URLHandler +{ /** * component configuration * @@ -33,6 +34,12 @@ class GridFieldBulkUpload implements GridField_HTMLProvider, GridField_URLHandle if ( $fileRelationName != null ) $this->setConfig ( 'fileRelationName', $fileRelationName ); } + + + /* ********************************************************************** + * Components settings and custom methodes + * */ + /** * Set a component configuration parameter * @@ -73,7 +80,6 @@ class GridFieldBulkUpload implements GridField_HTMLProvider, GridField_URLHandle else return $this->config; } - /* ******************************************************************************** */ /** * Get the first has_one Image/File relation from the GridField managed DataObject @@ -99,6 +105,7 @@ class GridFieldBulkUpload implements GridField_HTMLProvider, GridField_URLHandle return $imageField; } + /** * Returns the name of the Image/File field name from the managed record * Either as set in the component config or the default one @@ -132,9 +139,7 @@ class GridFieldBulkUpload implements GridField_HTMLProvider, GridField_URLHandle return 'File'; } } - - - /* ******************************************************************************** */ + /** * Returned a configured UploadField instance @@ -181,7 +186,12 @@ class GridFieldBulkUpload implements GridField_HTMLProvider, GridField_URLHandle return $uploadField; } - + + + /* ********************************************************************** + * GridField_HTMLProvider + * */ + /** * HTML to be embedded into the GridField * @@ -251,6 +261,11 @@ class GridFieldBulkUpload implements GridField_HTMLProvider, GridField_URLHandle ); } + + + /* ********************************************************************** + * GridField_URLHandler + * */ /** * Component URL handlers diff --git a/bulkUpload/code/GridFieldBulkUpload_Request.php b/bulkUpload/code/GridFieldBulkUpload_Request.php index cfae8af..fc3d2cd 100644 --- a/bulkUpload/code/GridFieldBulkUpload_Request.php +++ b/bulkUpload/code/GridFieldBulkUpload_Request.php @@ -1,6 +1,6 @@ gridField = $gridField; $this->component = $component; $this->controller = $controller; @@ -93,7 +95,6 @@ class GridFieldBulkUpload_Request extends RequestHandler { $record->write(); // passes the current gridfield-instance to a call-back method on the new object - //$record->extend("onBulkImageUpload", $this->gridField); $record->extend("onBulkFileUpload", $this->gridField); //get uploadField and process upload