ENHANCEMENT Added SiteTree::$description to provide more context for content authors selecting a new page type

This commit is contained in:
Ingo Schommer 2011-04-24 11:03:51 +12:00
parent 94cb3075d0
commit e2f4dd0b44
4 changed files with 23 additions and 0 deletions

View File

@ -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; }

View File

@ -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.

View File

@ -142,6 +142,12 @@ class SiteTree extends DataObject implements PermissionProvider,i18nEntityProvid
* @var string|array
*/
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(
@ -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;
}

View File

@ -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(