Merge pull request #20 from open-sausages/pulls/cms-namespace

Fix CMS Namespace changes
This commit is contained in:
Daniel Hensby 2016-08-17 15:41:52 +01:00 committed by GitHub
commit 5905cc1328
4 changed files with 15 additions and 11 deletions

View File

@ -1,6 +1,8 @@
<?php <?php
use SilverStripe\Security\Member; use SilverStripe\Security\Member;
use SilverStripe\CMS\Model\SiteTree;
Member::add_extension('FrameworkTestRole'); Member::add_extension('FrameworkTestRole');
Member::add_extension('FileUploadRole'); Member::add_extension('FileUploadRole');

View File

@ -10,14 +10,14 @@ class FrameworkTestRole extends DataExtension
{ {
private static $has_one = array( private static $has_one = array(
'FavouritePage' => 'SiteTree', 'FavouritePage' => 'SilverStripe\\CMS\\Model\\SiteTree',
); );
public function updateCMSFields(FieldList $fields) public function updateCMSFields(FieldList $fields)
{ {
$fields->addFieldToTab( $fields->addFieldToTab(
'Root.Main', 'Root.Main',
new TreeDropdownField("FavouritePageID", "Favourite page", "SiteTree") new TreeDropdownField("FavouritePageID", "Favourite page", "SilverStripe\\CMS\\Model\\SiteTree")
); );
} }

View File

@ -9,16 +9,16 @@ class RelationFieldsTestPage extends TestPage
private static $has_one = array( private static $has_one = array(
"HasOneCompany" => "SilverStripe\\FrameworkTest\\Model\\Company", "HasOneCompany" => "SilverStripe\\FrameworkTest\\Model\\Company",
"HasOnePage" => "SiteTree", "HasOnePage" => "SilverStripe\\CMS\\Model\\SiteTree",
"HasOnePageWithSearch" => "SiteTree", "HasOnePageWithSearch" => "SilverStripe\\CMS\\Model\\SiteTree",
); );
private static $has_many = array( private static $has_many = array(
"HasManyCompanies" => "SilverStripe\\FrameworkTest\\Model\\Company", "HasManyCompanies" => "SilverStripe\\FrameworkTest\\Model\\Company",
"HasManyPages" => "SiteTree", "HasManyPages" => "SilverStripe\\CMS\\Model\\SiteTree",
); );
private static $many_many = array( private static $many_many = array(
"ManyManyCompanies" => "SilverStripe\\FrameworkTest\\Model\\Company", "ManyManyCompanies" => "SilverStripe\\FrameworkTest\\Model\\Company",
"ManyManyPages" => "SiteTree", "ManyManyPages" => "SilverStripe\\CMS\\Model\\SiteTree",
); );
private static $defaults = array( private static $defaults = array(
@ -38,10 +38,10 @@ class RelationFieldsTestPage extends TestPage
$allFields += $checkboxFields; $allFields += $checkboxFields;
$treeFields = array( $treeFields = array(
TreeDropdownField::create('HasOnePageID', 'HasOnePage', 'SiteTree'), TreeDropdownField::create('HasOnePageID', 'HasOnePage', 'SilverStripe\\CMS\\Model\\SiteTree'),
TreeDropdownField::create('HasOnePageWithSearchID', 'HasOnePageWithSearch', 'SiteTree')->setShowSearch(true), TreeDropdownField::create('HasOnePageWithSearchID', 'HasOnePageWithSearch', 'SilverStripe\\CMS\\Model\\SiteTree')->setShowSearch(true),
TreeMultiselectField::create('HasManyPages', 'HasManyPages', 'SiteTree'), TreeMultiselectField::create('HasManyPages', 'HasManyPages', 'SilverStripe\\CMS\\Model\\SiteTree'),
TreeMultiselectField::create('ManyManyPages', 'ManyManyPages (with search)', 'SiteTree')->setShowSearch(true) TreeMultiselectField::create('ManyManyPages', 'ManyManyPages (with search)', 'SilverStripe\\CMS\\Model\\SiteTree')->setShowSearch(true)
); );
$fields->addFieldsToTab('Root.Tree', $treeFields); $fields->addFieldsToTab('Root.Tree', $treeFields);
$allFields += $treeFields; $allFields += $treeFields;

View File

@ -4,7 +4,7 @@ namespace SilverStripe\FrameworkTest\Model;
use Page; use Page;
use SiteTree;
use Page_Controller; use Page_Controller;
use FieldList; use FieldList;
use FormAction; use FormAction;
@ -12,6 +12,8 @@ use Form;
use TextField; use TextField;
use Email; use Email;
use SilverStripe\ORM\DataObject; use SilverStripe\ORM\DataObject;
use SilverStripe\CMS\Model\SiteTree;