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
use SilverStripe\Security\Member;
use SilverStripe\CMS\Model\SiteTree;
Member::add_extension('FrameworkTestRole');
Member::add_extension('FileUploadRole');

View File

@ -10,14 +10,14 @@ class FrameworkTestRole extends DataExtension
{
private static $has_one = array(
'FavouritePage' => 'SiteTree',
'FavouritePage' => 'SilverStripe\\CMS\\Model\\SiteTree',
);
public function updateCMSFields(FieldList $fields)
{
$fields->addFieldToTab(
'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(
"HasOneCompany" => "SilverStripe\\FrameworkTest\\Model\\Company",
"HasOnePage" => "SiteTree",
"HasOnePageWithSearch" => "SiteTree",
"HasOnePage" => "SilverStripe\\CMS\\Model\\SiteTree",
"HasOnePageWithSearch" => "SilverStripe\\CMS\\Model\\SiteTree",
);
private static $has_many = array(
"HasManyCompanies" => "SilverStripe\\FrameworkTest\\Model\\Company",
"HasManyPages" => "SiteTree",
"HasManyPages" => "SilverStripe\\CMS\\Model\\SiteTree",
);
private static $many_many = array(
"ManyManyCompanies" => "SilverStripe\\FrameworkTest\\Model\\Company",
"ManyManyPages" => "SiteTree",
"ManyManyPages" => "SilverStripe\\CMS\\Model\\SiteTree",
);
private static $defaults = array(
@ -38,10 +38,10 @@ class RelationFieldsTestPage extends TestPage
$allFields += $checkboxFields;
$treeFields = array(
TreeDropdownField::create('HasOnePageID', 'HasOnePage', 'SiteTree'),
TreeDropdownField::create('HasOnePageWithSearchID', 'HasOnePageWithSearch', 'SiteTree')->setShowSearch(true),
TreeMultiselectField::create('HasManyPages', 'HasManyPages', 'SiteTree'),
TreeMultiselectField::create('ManyManyPages', 'ManyManyPages (with search)', 'SiteTree')->setShowSearch(true)
TreeDropdownField::create('HasOnePageID', 'HasOnePage', 'SilverStripe\\CMS\\Model\\SiteTree'),
TreeDropdownField::create('HasOnePageWithSearchID', 'HasOnePageWithSearch', 'SilverStripe\\CMS\\Model\\SiteTree')->setShowSearch(true),
TreeMultiselectField::create('HasManyPages', 'HasManyPages', 'SilverStripe\\CMS\\Model\\SiteTree'),
TreeMultiselectField::create('ManyManyPages', 'ManyManyPages (with search)', 'SilverStripe\\CMS\\Model\\SiteTree')->setShowSearch(true)
);
$fields->addFieldsToTab('Root.Tree', $treeFields);
$allFields += $treeFields;

View File

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