Merge branch 'stylingfixes' of https://github.com/ajshort/silverstripe-cms into ajshort-stylingfixes

This commit is contained in:
Ingo Schommer 2012-06-13 13:24:12 +02:00
commit eccfc1a664
6 changed files with 9 additions and 23 deletions

View File

@ -57,7 +57,7 @@ class CMSMain extends LeftAndMain implements CurrentPageIdentifier, PermissionPr
parent::init(); parent::init();
Requirements::css(CMS_DIR . '/css/screen.css'); Requirements::css(CMS_DIR . '/css/screen.css');
Requirements::customCSS($this->generateTreeStylingCSS()); Requirements::customCSS($this->generatePageIconsCss());
Requirements::combine_files( Requirements::combine_files(
'cmsmain.js', 'cmsmain.js',
@ -405,7 +405,7 @@ class CMSMain extends LeftAndMain implements CurrentPageIdentifier, PermissionPr
* *
* @return String CSS * @return String CSS
*/ */
function generateTreeStylingCSS() { public function generatePageIconsCss() {
$css = ''; $css = '';
$classes = ClassInfo::subclassesFor('SiteTree'); $classes = ClassInfo::subclassesFor('SiteTree');
@ -427,20 +427,14 @@ class CMSMain extends LeftAndMain implements CurrentPageIdentifier, PermissionPr
$baseFilename = $iconPathInfo['dirname'] . '/' . $iconPathInfo['filename']; $baseFilename = $iconPathInfo['dirname'] . '/' . $iconPathInfo['filename'];
$fileExtension = $iconPathInfo['extension']; $fileExtension = $iconPathInfo['extension'];
$selector = ".page-icon.class-$class, li.class-$class > a .jstree-pageicon";
if(Director::fileExists($iconFile)) { if(Director::fileExists($iconFile)) {
$css .= sprintf( $css .= "$selector { background: transparent url('$iconFile') 0 0 no-repeat; }\n";
"li.class-%s > a .jstree-pageicon { background: transparent url('%s') 0 0 no-repeat; }\n",
$class, $iconFile
);
} else { } else {
// Support for more sophisticated rules, e.g. sprited icons // Support for more sophisticated rules, e.g. sprited icons
$css .= sprintf( $css .= "$selector { $iconFile }\n";
"li.class-%s > a .jstree-pageicon { %s }\n",
$class, $iconFile
);
} }
} }
return $css; return $css;

View File

@ -20,7 +20,7 @@ class CMSPageAddController extends CMSPageEditController {
$pageTypes = array(); $pageTypes = array();
foreach($this->PageTypes() as $type) { foreach($this->PageTypes() as $type) {
$html = sprintf('<span class="icon class-%s"></span><strong class="title">%s</strong><span class="description">%s</span>', $html = sprintf('<span class="page-icon class-%s"></span><strong class="title">%s</strong><span class="description">%s</span>',
$type->getField('ClassName'), $type->getField('ClassName'),
$type->getField('AddAction'), $type->getField('AddAction'),
$type->getField('Description') $type->getField('Description')

View File

@ -6,9 +6,7 @@
* @subpackage content * @subpackage content
*/ */
class RedirectorPage extends Page { class RedirectorPage extends Page {
static $icon = "cms/images/treeicons/page-shortcut-file.gif";
static $description = 'Redirects to a different internal page'; static $description = 'Redirects to a different internal page';
static $db = array( static $db = array(

View File

@ -6,9 +6,7 @@
* @package cms * @package cms
*/ */
class VirtualPage extends Page { class VirtualPage extends Page {
static $icon = "cms/images/treeicons/page-shortcut-gold-file.gif";
static $description = 'Displays the content of another page'; static $description = 'Displays the content of another page';
public static $virtualFields; public static $virtualFields;

View File

@ -14,7 +14,6 @@
#cms-content-treeview .cms-tree-expand-trigger { display: none; } #cms-content-treeview .cms-tree-expand-trigger { display: none; }
.cms-content-tools #cms-content-treeview .cms-content-toolbar { border-bottom: none; box-shadow: none; margin-bottom: 8px; } .cms-content-tools #cms-content-treeview .cms-content-toolbar { border-bottom: none; box-shadow: none; margin-bottom: 8px; }
.cms-content-tools #cms-content-treeview .cms-content-toolbar .cms-page-add-button { margin-top: 8px; }
.cms-content-tools #cms-content-treeview .cms-tree-view-modes, .cms-content-tools #cms-content-treeview .cms-content-batchactions { display: none; } .cms-content-tools #cms-content-treeview .cms-tree-view-modes, .cms-content-tools #cms-content-treeview .cms-content-batchactions { display: none; }
.cms-content-tools #cms-content-treeview .cms-tree-expand-trigger { display: inline-block; margin: 0 0 2px 0; position: absolute; top: 8px; right: 4px; } .cms-content-tools #cms-content-treeview .cms-tree-expand-trigger { display: inline-block; margin: 0 0 2px 0; position: absolute; top: 8px; right: 4px; }
.cms-content-tools #cms-content-treeview .cms-tree-expand-trigger span.ui-button-text { padding-right: 8px; } .cms-content-tools #cms-content-treeview .cms-tree-expand-trigger span.ui-button-text { padding-right: 8px; }

View File

@ -60,9 +60,6 @@
border-bottom:none; border-bottom:none;
box-shadow:none; box-shadow:none;
margin-bottom:8px; margin-bottom:8px;
.cms-page-add-button {
margin-top:8px;
}
} }
.cms-tree-view-modes, .cms-tree-view-modes,
.cms-content-batchactions { .cms-content-batchactions {