mirror of
https://github.com/symbiote/silverstripe-gridfieldextensions.git
synced 2024-10-22 17:05:39 +02:00
Fixed name-spacing for SilverStripe v4 compatibility
Used [silverstripe-upgrader](https://github.com/silverstripe/silverstripe-upgrader) to fix name-spacing for SilverStripe v4. I then alphabetically sorted the use declarations for readability. Fixes: https://github.com/silverstripe-australia/silverstripe-gridfieldextensions/issues/166.
This commit is contained in:
parent
7674daf7f2
commit
5254b1865c
@ -1,4 +1,10 @@
|
||||
<?php
|
||||
|
||||
use SilverStripe\Forms\GridField\GridField_HTMLProvider;
|
||||
use SilverStripe\Forms\GridField\GridField_URLHandler;
|
||||
use SilverStripe\ORM\SS_List;
|
||||
use SilverStripe\View\ArrayData;
|
||||
|
||||
/**
|
||||
* A modal search dialog which uses search context to search for and add
|
||||
* existing records to a grid field.
|
||||
|
@ -1,4 +1,13 @@
|
||||
<?php
|
||||
|
||||
use SilverStripe\Control\Controller;
|
||||
use SilverStripe\Control\RequestHandler;
|
||||
use SilverStripe\Forms\FieldList;
|
||||
use SilverStripe\Forms\Form;
|
||||
use SilverStripe\Forms\FormAction;
|
||||
use SilverStripe\ORM\DataList;
|
||||
use SilverStripe\ORM\PaginatedList;
|
||||
|
||||
/**
|
||||
* Used by {@link GridFieldAddExistingSearchButton} to provide the searching
|
||||
* functionality.
|
||||
@ -59,7 +68,7 @@ class GridFieldAddExistingSearchHandler extends RequestHandler {
|
||||
public function SearchForm() {
|
||||
$form = new Form(
|
||||
$this,
|
||||
'SearchForm',
|
||||
'SilverStripe\\CMS\\Search\\SearchForm',
|
||||
$this->context->getFields(),
|
||||
new FieldList(
|
||||
FormAction::create('doSearch', _t('GridFieldExtensions.SEARCH', 'Search'))
|
||||
|
@ -1,4 +1,17 @@
|
||||
<?php
|
||||
|
||||
use SilverStripe\Core\Convert;
|
||||
use SilverStripe\Core\Object;
|
||||
use SilverStripe\Forms\Form;
|
||||
use SilverStripe\Forms\GridField\GridField;
|
||||
use SilverStripe\Forms\GridField\GridField_HTMLProvider;
|
||||
use SilverStripe\Forms\GridField\GridField_SaveHandler;
|
||||
use SilverStripe\ORM\ArrayList;
|
||||
use SilverStripe\ORM\DataObjectInterface;
|
||||
use SilverStripe\ORM\ManyManyList;
|
||||
use SilverStripe\View\ArrayData;
|
||||
use SilverStripe\View\Requirements;
|
||||
|
||||
/**
|
||||
* Builds on the {@link GridFieldEditableColumns} component to allow creating new records.
|
||||
*/
|
||||
|
@ -1,4 +1,16 @@
|
||||
<?php
|
||||
|
||||
use SilverStripe\Control\Controller;
|
||||
use SilverStripe\Control\SS_HTTPResponse_Exception;
|
||||
use SilverStripe\Core\ClassInfo;
|
||||
use SilverStripe\Core\Config\Config;
|
||||
use SilverStripe\Core\Object;
|
||||
use SilverStripe\Forms\DropdownField;
|
||||
use SilverStripe\Forms\GridField\GridField;
|
||||
use SilverStripe\Forms\GridField\GridField_HTMLProvider;
|
||||
use SilverStripe\Forms\GridField\GridField_URLHandler;
|
||||
use SilverStripe\View\ArrayData;
|
||||
|
||||
/**
|
||||
* A component which lets the user select from a list of classes to create a new record form.
|
||||
*
|
||||
@ -158,7 +170,7 @@ class GridFieldAddNewMultiClass implements GridField_HTMLProvider, GridField_URL
|
||||
public function handleAdd($grid, $request) {
|
||||
$class = $request->param('ClassName');
|
||||
$classes = $this->getClasses($grid);
|
||||
$component = $grid->getConfig()->getComponentByType('GridFieldDetailForm');
|
||||
$component = $grid->getConfig()->getComponentByType('SilverStripe\\Forms\\GridField\\GridFieldDetailForm');
|
||||
|
||||
if(!$component) {
|
||||
throw new Exception('The add new multi class component requires the detail form component.');
|
||||
|
@ -1,4 +1,8 @@
|
||||
<?php
|
||||
|
||||
use SilverStripe\Control\Controller;
|
||||
use SilverStripe\Forms\GridField\GridFieldDetailForm_ItemRequest;
|
||||
|
||||
/**
|
||||
* A custom grid field request handler that allows interacting with form fields when adding records.
|
||||
*/
|
||||
|
@ -1,4 +1,21 @@
|
||||
<?php
|
||||
|
||||
use SilverStripe\Control\Controller;
|
||||
use SilverStripe\Control\SS_HTTPResponse_Exception;
|
||||
use SilverStripe\Core\Object;
|
||||
use SilverStripe\Forms\FieldList;
|
||||
use SilverStripe\Forms\Form;
|
||||
use SilverStripe\Forms\FormField;
|
||||
use SilverStripe\Forms\GridField\GridField;
|
||||
use SilverStripe\Forms\GridField\GridFieldDataColumns;
|
||||
use SilverStripe\Forms\GridField\GridField_HTMLProvider;
|
||||
use SilverStripe\Forms\GridField\GridField_SaveHandler;
|
||||
use SilverStripe\Forms\GridField\GridField_URLHandler;
|
||||
use SilverStripe\Forms\LiteralField;
|
||||
use SilverStripe\Forms\ReadonlyField;
|
||||
use SilverStripe\ORM\DataObjectInterface;
|
||||
use SilverStripe\ORM\ManyManyList;
|
||||
|
||||
/**
|
||||
* Allows inline editing of grid field records without having to load a separate
|
||||
* edit interface.
|
||||
@ -177,7 +194,7 @@ class GridFieldEditableColumns extends GridFieldDataColumns implements
|
||||
if(isset($info['callback'])) {
|
||||
$field = call_user_func($info['callback'], $record, $col, $grid);
|
||||
} elseif(isset($info['field'])) {
|
||||
if ($info['field'] == 'LiteralField') {
|
||||
if ($info['field'] == 'SilverStripe\\Forms\\LiteralField') {
|
||||
$field = new $info['field']($col, null);
|
||||
} else {
|
||||
$field = new $info['field']($col);
|
||||
|
@ -1,4 +1,7 @@
|
||||
<?php
|
||||
|
||||
use SilverStripe\View\Requirements;
|
||||
|
||||
/**
|
||||
* Utility functions for the grid fields extension module.
|
||||
*/
|
||||
|
@ -1,4 +1,8 @@
|
||||
<?php
|
||||
|
||||
use SilverStripe\Forms\GridField\GridFieldDataColumns;
|
||||
use SilverStripe\View\ArrayData;
|
||||
|
||||
/**
|
||||
* Displays a link to an external source referenced 'external link'
|
||||
*/
|
||||
|
@ -1,4 +1,24 @@
|
||||
<?php
|
||||
|
||||
use SilverStripe\Control\Controller;
|
||||
use SilverStripe\Control\RequestHandler;
|
||||
use SilverStripe\Core\ClassInfo;
|
||||
use SilverStripe\Forms\GridField\GridField;
|
||||
use SilverStripe\Forms\GridField\GridField_ColumnProvider;
|
||||
use SilverStripe\Forms\GridField\GridField_DataManipulator;
|
||||
use SilverStripe\Forms\GridField\GridField_HTMLProvider;
|
||||
use SilverStripe\Forms\GridField\GridField_SaveHandler;
|
||||
use SilverStripe\Forms\GridField\GridField_URLHandler;
|
||||
use SilverStripe\Forms\HiddenField;
|
||||
use SilverStripe\ORM\ArrayList;
|
||||
use SilverStripe\ORM\DB;
|
||||
use SilverStripe\ORM\DataList;
|
||||
use SilverStripe\ORM\DataObjectInterface;
|
||||
use SilverStripe\ORM\ManyManyList;
|
||||
use SilverStripe\ORM\SS_List;
|
||||
use SilverStripe\ORM\SS_Map;
|
||||
use SilverStripe\View\ViewableData;
|
||||
|
||||
/**
|
||||
* Allows grid field rows to be re-ordered via drag and drop. Both normal data
|
||||
* lists and many many lists can be ordered.
|
||||
@ -319,7 +339,7 @@ class GridFieldOrderableRows extends RequestHandler implements
|
||||
* Handles requests to move an item to the previous or next page.
|
||||
*/
|
||||
public function handleMoveToPage(GridField $grid, $request) {
|
||||
if(!$paginator = $grid->getConfig()->getComponentByType('GridFieldPaginator')) {
|
||||
if(!$paginator = $grid->getConfig()->getComponentByType('SilverStripe\\Forms\\GridField\\GridFieldPaginator')) {
|
||||
$this->httpError(404, 'Paginator component not found');
|
||||
}
|
||||
|
||||
@ -461,7 +481,7 @@ class GridFieldOrderableRows extends RequestHandler implements
|
||||
$isVersioned = false;
|
||||
$class = $list->dataClass();
|
||||
if ($class == $this->getSortTable($list)) {
|
||||
$isVersioned = $class::has_extension('Versioned');
|
||||
$isVersioned = $class::has_extension('SilverStripe\\ORM\\Versioning\\Versioned');
|
||||
}
|
||||
|
||||
// Loop through each item, and update the sort values which do not
|
||||
|
@ -1,4 +1,17 @@
|
||||
<?php
|
||||
|
||||
use SilverStripe\Admin\LeftAndMain;
|
||||
use SilverStripe\Control\Controller;
|
||||
use SilverStripe\Control\RequestHandler;
|
||||
use SilverStripe\Forms\FieldList;
|
||||
use SilverStripe\Forms\Form;
|
||||
use SilverStripe\Forms\GridField\GridField;
|
||||
use SilverStripe\Forms\GridField\GridFieldComponent;
|
||||
use SilverStripe\Forms\GridField\GridFieldDetailForm_ItemRequest;
|
||||
use SilverStripe\Forms\Tab;
|
||||
use SilverStripe\Forms\TabSet;
|
||||
use SilverStripe\ORM\ArrayList;
|
||||
|
||||
/**
|
||||
* A base utility class for request handlers which present a grid field detail
|
||||
* view.
|
||||
@ -65,7 +78,7 @@ abstract class GridFieldRequestHandler extends RequestHandler {
|
||||
public function Form() {
|
||||
$form = new Form(
|
||||
$this,
|
||||
'Form',
|
||||
'SilverStripe\\Forms\\Form',
|
||||
new FieldList($root = new TabSet('Root', new Tab('Main'))),
|
||||
new FieldList()
|
||||
);
|
||||
|
@ -1,4 +1,9 @@
|
||||
<?php
|
||||
|
||||
use SilverStripe\Forms\GridField\GridField_HTMLProvider;
|
||||
use SilverStripe\ORM\ArrayList;
|
||||
use SilverStripe\View\ArrayData;
|
||||
|
||||
/**
|
||||
* A simple header which displays column titles.
|
||||
*/
|
||||
|
@ -1,4 +1,9 @@
|
||||
<?php
|
||||
|
||||
use SilverStripe\Dev\SapphireTest;
|
||||
use SilverStripe\Dev\TestOnly;
|
||||
use SilverStripe\Forms\GridField\GridField;
|
||||
|
||||
/**
|
||||
* Tests for {@link GridFieldAddNewMultiClass}.
|
||||
*/
|
||||
|
@ -1,4 +1,11 @@
|
||||
<?php
|
||||
|
||||
use SilverStripe\Dev\SapphireTest;
|
||||
use SilverStripe\Dev\TestOnly;
|
||||
use SilverStripe\Forms\GridField\GridField;
|
||||
use SilverStripe\Forms\GridField\GridFieldConfig_RelationEditor;
|
||||
use SilverStripe\ORM\DataObject;
|
||||
|
||||
/**
|
||||
* Tests for the {@link GridFieldOrderableRows} component.
|
||||
*/
|
||||
|
Loading…
Reference in New Issue
Block a user