mirror of
https://github.com/silverstripe/silverstripe-reports
synced 2024-10-22 09:05:53 +00:00
ENHANCEMENT Added SiteTree::$description to provide more context for content authors selecting a new page type
This commit is contained in:
parent
94cb3075d0
commit
e2f4dd0b44
@ -24,6 +24,8 @@ class ErrorPage extends Page {
|
||||
|
||||
static $icon = array("sapphire/javascript/tree/images/page", "file");
|
||||
|
||||
static $description = 'Custom content for different error cases (e.g. "Page not found")';
|
||||
|
||||
protected static $static_filepath = ASSETS_PATH;
|
||||
|
||||
public function canAddChildren($member = null) { return false; }
|
||||
|
@ -9,6 +9,8 @@ class RedirectorPage extends Page {
|
||||
|
||||
static $icon = array("cms/images/treeicons/page-shortcut","file");
|
||||
|
||||
static $description = 'Redirects to a different internal page';
|
||||
|
||||
static $db = array(
|
||||
"RedirectionType" => "Enum('Internal,External','Internal')",
|
||||
"ExternalURL" => "Varchar(2083)" // 2083 is the maximum length of a URL in Internet Explorer.
|
||||
|
@ -143,6 +143,12 @@ class SiteTree extends DataObject implements PermissionProvider,i18nEntityProvid
|
||||
*/
|
||||
static $icon = array("sapphire/javascript/tree/images/page", "file");
|
||||
|
||||
/**
|
||||
* @var String Description of the class functionality, typically shown to a user
|
||||
* when selecting which page type to create. Translated through {@link provideI18nEntities()}.
|
||||
*/
|
||||
static $description = 'Generic content page';
|
||||
|
||||
|
||||
static $extensions = array(
|
||||
"Hierarchy",
|
||||
@ -2590,6 +2596,17 @@ class SiteTree extends DataObject implements PermissionProvider,i18nEntityProvid
|
||||
if(isset($entities['Page.SINGULARNAME'])) $entities['Page.SINGULARNAME'][3] = 'sapphire';
|
||||
if(isset($entities['Page.PLURALNAME'])) $entities['Page.PLURALNAME'][3] = 'sapphire';
|
||||
|
||||
$types = self::page_type_classes();
|
||||
foreach($types as $type) {
|
||||
$inst = singleton($type);
|
||||
$entities[$type . '.DESCRIPTION'] = array(
|
||||
$inst->stat('description'),
|
||||
PR_MEDIUM,
|
||||
'Description of the page type (shown in the "add page" dialog)'
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
return $entities;
|
||||
}
|
||||
|
||||
|
@ -9,6 +9,8 @@ class VirtualPage extends Page {
|
||||
|
||||
static $icon = array("cms/images/treeicons/page-shortcut-gold","file");
|
||||
|
||||
static $description = 'Displays the content of another page';
|
||||
|
||||
public static $virtualFields;
|
||||
|
||||
static $has_one = array(
|
||||
|
Loading…
x
Reference in New Issue
Block a user