mirror of
https://github.com/colymba/GridFieldBulkEditingTools.git
synced 2024-10-22 09:05:57 +00:00
* Basic SS4 compat: Implemented namespacing, updated some Image manipulations, readmes, composer configuration * Add bootstrap form styles to the bulk manager * API Rename classes to be less confusing with the namespaces
40 lines
840 B
PHP
40 lines
840 B
PHP
<?php
|
|
|
|
namespace Colymba\BulkUpload;
|
|
|
|
use SilverStripe\Control\Controller;
|
|
use SilverStripe\Forms\UploadField;
|
|
|
|
/**
|
|
* Custom UploadField used to override Link()
|
|
* and redirect UploadField action properly through the GridField.
|
|
*
|
|
* @author colymba
|
|
*/
|
|
class BulkUploadField extends UploadField
|
|
{
|
|
/**
|
|
* @var GridField
|
|
*/
|
|
protected $gridfield;
|
|
|
|
/**
|
|
* @param GridField $gridfield
|
|
* @param string $parent
|
|
* @param string $folderName
|
|
*/
|
|
public function __construct($gridfield, $parent, $folderName = null)
|
|
{
|
|
$this->gridfield = $gridfield;
|
|
parent::__construct($parent, $folderName);
|
|
}
|
|
|
|
/**
|
|
* {@inheritDoc}
|
|
*/
|
|
public function Link($action = null)
|
|
{
|
|
return Controller::join_links($this->gridfield->Link(), 'bulkupload/', $action);
|
|
}
|
|
}
|