mirror of
https://github.com/silverstripe/silverstripe-cms
synced 2024-10-22 08:05:56 +02:00
Apply SilverStripe\Admin namespace
This commit is contained in:
parent
095ae30a3e
commit
2352127fe0
@ -1,5 +1,7 @@
|
||||
<?php
|
||||
|
||||
use SilverStripe\Admin\CMSMenu;
|
||||
|
||||
/**
|
||||
* - CMS_DIR: Path relative to webroot, e.g. "cms"
|
||||
* - CMS_PATH: Absolute filepath, e.g. "/var/www/my-webroot/cms"
|
||||
|
@ -7,7 +7,8 @@ use SilverStripe\ORM\SS_List;
|
||||
use SilverStripe\ORM\ArrayList;
|
||||
use SilverStripe\ORM\Versioning\Versioned;
|
||||
use SilverStripe\Security\Permission;
|
||||
use CMSBatchAction;
|
||||
use SilverStripe\Admin\CMSBatchAction;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
|
@ -9,7 +9,6 @@ use SilverStripe\ORM\DataObject;
|
||||
use SilverStripe\ORM\SS_List;
|
||||
use SilverStripe\Security\Security;
|
||||
use SilverStripe\Security\PermissionProvider;
|
||||
use LeftAndMain;
|
||||
use Session;
|
||||
use Requirements;
|
||||
use CMSBatchActionHandler;
|
||||
@ -51,6 +50,10 @@ use Injector;
|
||||
use Director;
|
||||
use ArrayData;
|
||||
use CMSBatchAction;
|
||||
use SilverStripe\Admin\CMSBatchActionHandler;
|
||||
use SilverStripe\Admin\LeftAndMain;
|
||||
use SilverStripe\Admin\CMSBatchAction;
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -3,6 +3,7 @@
|
||||
namespace SilverStripe\CMS\Controllers;
|
||||
|
||||
use ResetFormAction;
|
||||
use SilverStripe\Admin\CMSPreviewable;
|
||||
use SilverStripe\ORM\FieldType\DBHTMLText;
|
||||
use SilverStripe\ORM\SS_List;
|
||||
use SilverStripe\ORM\Versioning\Versioned;
|
||||
@ -16,7 +17,10 @@ use SilverStripe\Security\Security;
|
||||
use SilverStripe\Security\SecurityToken;
|
||||
use SilverStripe\Security\Permission;
|
||||
use SilverStripe\Security\PermissionProvider;
|
||||
use LeftAndMain;
|
||||
use SilverStripe\Admin\CMSBatchActionHandler;
|
||||
use SilverStripe\Admin\AdminRootController;
|
||||
use SilverStripe\Admin\AddToCampaignHandler;
|
||||
use SilverStripe\Admin\LeftAndMain;
|
||||
|
||||
|
||||
use SS_HTTPRequest;
|
||||
@ -485,14 +489,14 @@ class CMSMain extends LeftAndMain implements CurrentPageIdentifier, PermissionPr
|
||||
$json = '';
|
||||
$classes = SiteTree::page_type_classes();
|
||||
|
||||
$cacheCanCreate = array();
|
||||
foreach($classes as $class) $cacheCanCreate[$class] = singleton($class)->canCreate();
|
||||
$cacheCanCreate = array();
|
||||
foreach($classes as $class) $cacheCanCreate[$class] = singleton($class)->canCreate();
|
||||
|
||||
// Generate basic cache key. Too complex to encompass all variations
|
||||
$cache = SS_Cache::factory('CMSMain_SiteTreeHints');
|
||||
$cacheKey = md5(implode('_', array(Member::currentUserID(), implode(',', $cacheCanCreate), implode(',', $classes))));
|
||||
if($this->getRequest()->getVar('flush')) $cache->clean(Zend_Cache::CLEANING_MODE_ALL);
|
||||
$json = $cache->load($cacheKey);
|
||||
// Generate basic cache key. Too complex to encompass all variations
|
||||
$cache = SS_Cache::factory('CMSMain_SiteTreeHints');
|
||||
$cacheKey = md5(implode('_', array(Member::currentUserID(), implode(',', $cacheCanCreate), implode(',', $classes))));
|
||||
if($this->getRequest()->getVar('flush')) $cache->clean(Zend_Cache::CLEANING_MODE_ALL);
|
||||
$json = $cache->load($cacheKey);
|
||||
if(!$json) {
|
||||
$def['Root'] = array();
|
||||
$def['Root']['disallowedChildren'] = array();
|
||||
@ -734,7 +738,7 @@ class CMSMain extends LeftAndMain implements CurrentPageIdentifier, PermissionPr
|
||||
$form->setValidationExemptActions(array('restore', 'revert', 'deletefromlive', 'delete', 'unpublish', 'rollback', 'doRollback'));
|
||||
|
||||
// Announce the capability so the frontend can decide whether to allow preview or not.
|
||||
if(in_array('CMSPreviewable', class_implements($record))) {
|
||||
if ($record instanceof CMSPreviewable) {
|
||||
$form->addExtraClass('cms-previewable');
|
||||
}
|
||||
|
||||
|
@ -7,9 +7,10 @@ use SilverStripe\ORM\DataList;
|
||||
use SilverStripe\ORM\SS_List;
|
||||
use SilverStripe\ORM\Versioning\Versioned;
|
||||
use Object;
|
||||
use LeftAndMain_SearchFilter;
|
||||
use ClassInfo;
|
||||
use DateField;
|
||||
use SilverStripe\Admin\LeftAndMain_SearchFilter;
|
||||
|
||||
|
||||
/**
|
||||
* Base class for filtering the subtree for certain node statuses.
|
||||
|
@ -9,10 +9,11 @@ use SilverStripe\ORM\Versioning\Versioned;
|
||||
use SilverStripe\ORM\FieldType\DBField;
|
||||
use SilverStripe\Security\Member;
|
||||
use ViewableData;
|
||||
use CMSPreviewable;
|
||||
use ClassInfo;
|
||||
use LeftAndMain;
|
||||
use Controller;
|
||||
use SilverStripe\Admin\CMSPreviewable;
|
||||
use SilverStripe\Admin\LeftAndMain;
|
||||
|
||||
|
||||
use SiteTreeFutureState;
|
||||
use SilverStripe\CMS\Model\RedirectorPage;
|
||||
@ -222,7 +223,7 @@ abstract class SilverStripeNavigatorItem extends ViewableData {
|
||||
(!$currentDraft || ($currentDraft && $this->record->Version != $currentDraft->Version))
|
||||
&& (!$currentLive || ($currentLive && $this->record->Version != $currentLive->Version))
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
return $this->record->_cached_isArchived;
|
||||
}
|
||||
|
@ -19,7 +19,6 @@ use SilverStripe\Security\Permission;
|
||||
use SilverStripe\Security\Group;
|
||||
use SilverStripe\Security\PermissionProvider;
|
||||
use i18nEntityProvider;
|
||||
use CMSPreviewable;
|
||||
use Director;
|
||||
use SilverStripe\CMS\Controllers\RootURLController;
|
||||
use ClassInfo;
|
||||
@ -52,9 +51,11 @@ use TreeDropdownField;
|
||||
use FieldGroup;
|
||||
use CheckboxField;
|
||||
use ListboxField;
|
||||
use AddToCampaignHandler_FormAction;
|
||||
use FormAction;
|
||||
use i18n;
|
||||
use SilverStripe\Admin\AddToCampaignHandler_FormAction;
|
||||
use SilverStripe\Admin\CMSPreviewable;
|
||||
|
||||
|
||||
/**
|
||||
* Basic data-object representing all pages within the site tree. All page types that live within the hierarchy should
|
||||
@ -352,13 +353,13 @@ class SiteTree extends DataObject implements PermissionProvider,i18nEntityProvid
|
||||
foreach($alternatives as $alternative) {
|
||||
if($alternative) {
|
||||
$sitetree = $alternative;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(!$sitetree) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Check if we have any more URL parts to parse.
|
||||
@ -437,8 +438,8 @@ class SiteTree extends DataObject implements PermissionProvider,i18nEntityProvid
|
||||
/**
|
||||
* Replace a "[sitetree_link id=n]" shortcode with a link to the page with the corresponding ID.
|
||||
*
|
||||
* @param array $arguments
|
||||
* @param string $content
|
||||
* @param array $arguments
|
||||
* @param string $content
|
||||
* @param ShortcodeParser $parser
|
||||
* @return string
|
||||
*/
|
||||
@ -609,7 +610,7 @@ class SiteTree extends DataObject implements PermissionProvider,i18nEntityProvid
|
||||
$currentPage = Director::get_current_page();
|
||||
if ($currentPage instanceof ContentController) {
|
||||
$currentPage = $currentPage->data();
|
||||
}
|
||||
}
|
||||
if($currentPage instanceof SiteTree) {
|
||||
return $currentPage === $this || $currentPage->ID === $this->ID;
|
||||
}
|
||||
@ -1467,7 +1468,6 @@ class SiteTree extends DataObject implements PermissionProvider,i18nEntityProvid
|
||||
}
|
||||
|
||||
if(Permission::check('CMS_ACCESS_CMSMain')
|
||||
&& in_array('CMSPreviewable', class_implements($this))
|
||||
&& !$this instanceof ErrorPage
|
||||
&& $this->ID > 0
|
||||
) {
|
||||
@ -1552,7 +1552,7 @@ class SiteTree extends DataObject implements PermissionProvider,i18nEntityProvid
|
||||
DB::alteration_message('Contact Us page created', 'created');
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected function onBeforeWrite() {
|
||||
parent::onBeforeWrite();
|
||||
@ -1877,10 +1877,10 @@ class SiteTree extends DataObject implements PermissionProvider,i18nEntityProvid
|
||||
if($parentPage && $parentPage->exists()) {
|
||||
$link = Convert::raw2att($parentPage->CMSEditLink());
|
||||
$title = Convert::raw2xml($parentPage->Title);
|
||||
} else {
|
||||
} else {
|
||||
$link = CMSPageEditController::singleton()->Link('show');
|
||||
$title = _t('SiteTree.TOPLEVEL', 'Site Content (Top Level)');
|
||||
}
|
||||
}
|
||||
$parentPageLinks[] = "<a class=\"cmsEditlink\" href=\"{$link}\">{$title}</a>";
|
||||
}
|
||||
|
||||
|
@ -6,6 +6,8 @@ use SilverStripe\ORM\Versioning\Versioned;
|
||||
use SilverStripe\ORM\HiddenClass;
|
||||
use SilverStripe\CMS\Controllers\CMSMain;
|
||||
use SilverStripe\CMS\Model\SiteTree;
|
||||
use SilverStripe\Admin\CMSBatchActionHandler;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user