API Upgrade CMS to use new Config API

This commit is contained in:
Damian Mooyman 2017-02-16 17:51:54 +13:00 committed by Sam Minnée
parent a7efeb06d3
commit 4885736b0e
5 changed files with 8 additions and 8 deletions

View File

@ -1,7 +1,6 @@
---
Name: modelascontrollerroutes
Before: '*'
After: '#rootroutes'
After: '*'
---
SilverStripe\Control\Director:
rules:
@ -11,7 +10,6 @@ SilverStripe\Control\Director:
'$URLSegment//$Action/$ID/$OtherID': 'SilverStripe\CMS\Controllers\ModelAsController'
---
Name: legacycmsroutes
After: '#adminroutes'
---
SilverStripe\Control\Director:
rules:

View File

@ -952,7 +952,7 @@ class CMSMain extends LeftAndMain implements CurrentPageIdentifier, PermissionPr
$gridFieldConfig = GridFieldConfig::create()->addComponents(
new GridFieldSortableHeader(),
new GridFieldDataColumns(),
new GridFieldPaginator(self::config()->page_length)
new GridFieldPaginator($this->config()->get('page_length'))
);
if ($parentID) {
$linkSpec = $this->Link();

View File

@ -8,7 +8,6 @@ use SilverStripe\CMS\Model\SiteTree;
use SilverStripe\Control\Controller;
use SilverStripe\Control\HTTPRequest;
use SilverStripe\Control\HTTPResponse;
use SilverStripe\Core\Convert;
use SilverStripe\Forms\Form;
use SilverStripe\ORM\FieldType\DBHTMLText;

View File

@ -1573,7 +1573,7 @@ class SiteTree extends DataObject implements PermissionProvider, i18nEntityProvi
));
}
$charset = ContentNegotiator::config()->get('encoding');
$charset = ContentNegotiator::config()->uninherited('encoding');
$tags[] = FormField::create_tag('meta', array(
'http-equiv' => 'Content-Type',
'content' => 'text/html; charset=' . $charset,

View File

@ -102,7 +102,10 @@ class VirtualPage extends Page
*/
public function getNonVirtualisedFields()
{
return array_merge($this->config()->non_virtual_fields, $this->config()->initially_copied_fields);
return array_merge(
VirtualPage::config()->non_virtual_fields,
VirtualPage::config()->initially_copied_fields
);
}
public function setCopyContentFromID($val)
@ -417,7 +420,7 @@ class VirtualPage extends Page
* Pass unrecognized method calls on to the original data object
*
* @param string $method
* @param string $args
* @param array $args
* @return mixed
*/
public function __call($method, $args)