ENHANCEMENT: UI Improvements

Replaced the old page icons, and moved where the blog specific fields
appear in the CMS to above the content area
This commit is contained in:
Naomi Guyer 2012-08-17 14:08:43 +12:00
parent 8f0a81e1f5
commit 448d34757e
9 changed files with 15 additions and 8 deletions

2
.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
images/.DS_Store

View File

@ -15,7 +15,7 @@ class BlogEntry extends Page {
static $can_be_root = false;
static $icon = "blog/images/blogpage";
static $icon = "blog/images/blogpage-file.png";
static $has_one = array();

View File

@ -12,7 +12,7 @@
* BlogHolders have a form on them for easy posting, and an owner that can post to them, BlogTrees don't
*/
class BlogHolder extends BlogTree implements PermissionProvider {
static $icon = "blog/images/blogholder";
static $icon = "blog/images/blogholder-file.png";
static $db = array(
'TrackBacksEnabled' => 'Boolean',
@ -34,9 +34,9 @@ class BlogHolder extends BlogTree implements PermissionProvider {
$fields = parent::getCMSFields();
SiteTree::enableCMSFieldsExtensions();
$fields->addFieldToTab('Root.Main', new CheckboxField('TrackBacksEnabled', 'Enable TrackBacks'));
$fields->addFieldToTab('Root.Main', new DropdownField('OwnerID', 'Blog owner', array_merge(array('' => "(None)"), $blogOwners->map('ID', 'Name')->toArray())));
$fields->addFieldToTab('Root.Main', new CheckboxField('AllowCustomAuthors', 'Allow non-admins to have a custom author field'));
$fields->addFieldToTab('Root.Main', new CheckboxField('TrackBacksEnabled', 'Enable TrackBacks'), "Content");
$fields->addFieldToTab('Root.Main', new DropdownField('OwnerID', 'Blog owner', array_merge(array('' => "(None)"), $blogOwners->map('ID', 'Name')->toArray())), "Content");
$fields->addFieldToTab('Root.Main', new CheckboxField('AllowCustomAuthors', 'Allow non-admins to have a custom author field'), "Content");
$this->extend('updateCMSFields', $fields);

View File

@ -5,10 +5,13 @@
*/
/**
* Blog tree allows a tree of Blog Holders. Viewing branch nodes shows all blog entries from all blog holder children
* Blog tree is a way to group Blogs. It allows a tree of "Blog Holders".
* Viewing branch nodes shows all blog entries from all blog holder children
*/
class BlogTree extends Page {
static $icon = "blog/images/blogtree-file.png";
// Default number of blog entries to show
static $default_entries_limit = 10;
@ -31,6 +34,8 @@ class BlogTree extends Page {
'BlogTree', 'BlogHolder'
);
/*
* Finds the BlogTree object most related to the current page.
* - If this page is a BlogTree, use that
@ -96,7 +101,7 @@ class BlogTree extends Page {
function getCMSFields() {
$fields = parent::getCMSFields();
$fields->addFieldToTab("Root.Main", new TextField("Name", "Name of blog"));
$fields->addFieldToTab("Root.Main", new TextField("Name", "Name of blog"), "Content");
$fields->addFieldToTab('Root.Main', new DropdownField('LandingPageFreshness', 'When you first open the blog, how many entries should I show', array(
"" => "All entries",
"1" => "Last month's entries",
@ -112,7 +117,7 @@ class BlogTree extends Page {
"11" => "Last 11 months' entries",
"12" => "Last year's entries",
"INHERIT" => "Take value from parent Blog Tree"
)));
)), "Content");
if(class_exists('WidgetArea')) {
$fields->addFieldToTab("Root.Widgets", new CheckboxField("InheritSideBar", 'Inherit Sidebar From Parent'));
$fields->addFieldToTab("Root.Widgets", new WidgetAreaEditor("SideBar"));

Binary file not shown.

Before

Width:  |  Height:  |  Size: 297 B

BIN
images/blogholder-file.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 189 B

BIN
images/blogpage-file.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

BIN
images/blogtree-file.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB