mirror of
https://github.com/silverstripe/silverstripe-reports
synced 2024-10-22 11:05:53 +02:00
BUGFIX: Consistently style custom defined page icons.
* Renamed generateTreeStylingCSS() to generatePageIconsCSS(). * Removed legacy icon definitions.
This commit is contained in:
parent
3e00370f9c
commit
a6cee248e0
@ -57,7 +57,7 @@ class CMSMain extends LeftAndMain implements CurrentPageIdentifier, PermissionPr
|
||||
parent::init();
|
||||
|
||||
Requirements::css(CMS_DIR . '/css/screen.css');
|
||||
Requirements::customCSS($this->generateTreeStylingCSS());
|
||||
Requirements::customCSS($this->generatePageIconsCss());
|
||||
|
||||
Requirements::combine_files(
|
||||
'cmsmain.js',
|
||||
@ -405,7 +405,7 @@ class CMSMain extends LeftAndMain implements CurrentPageIdentifier, PermissionPr
|
||||
*
|
||||
* @return String CSS
|
||||
*/
|
||||
function generateTreeStylingCSS() {
|
||||
public function generatePageIconsCss() {
|
||||
$css = '';
|
||||
|
||||
$classes = ClassInfo::subclassesFor('SiteTree');
|
||||
@ -427,20 +427,14 @@ class CMSMain extends LeftAndMain implements CurrentPageIdentifier, PermissionPr
|
||||
$baseFilename = $iconPathInfo['dirname'] . '/' . $iconPathInfo['filename'];
|
||||
$fileExtension = $iconPathInfo['extension'];
|
||||
|
||||
$selector = ".page-icon.class-$class, li.class-$class > a .jstree-pageicon";
|
||||
|
||||
if(Director::fileExists($iconFile)) {
|
||||
$css .= sprintf(
|
||||
"li.class-%s > a .jstree-pageicon { background: transparent url('%s') 0 0 no-repeat; }\n",
|
||||
$class, $iconFile
|
||||
);
|
||||
$css .= "$selector { background: transparent url('$iconFile') 0 0 no-repeat; }\n";
|
||||
} else {
|
||||
// Support for more sophisticated rules, e.g. sprited icons
|
||||
$css .= sprintf(
|
||||
"li.class-%s > a .jstree-pageicon { %s }\n",
|
||||
$class, $iconFile
|
||||
);
|
||||
$css .= "$selector { $iconFile }\n";
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
return $css;
|
||||
|
@ -20,7 +20,7 @@ class CMSPageAddController extends CMSPageEditController {
|
||||
|
||||
$pageTypes = array();
|
||||
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('AddAction'),
|
||||
$type->getField('Description')
|
||||
|
@ -7,8 +7,6 @@
|
||||
*/
|
||||
class RedirectorPage extends Page {
|
||||
|
||||
static $icon = "cms/images/treeicons/page-shortcut-file.gif";
|
||||
|
||||
static $description = 'Redirects to a different internal page';
|
||||
|
||||
static $db = array(
|
||||
|
@ -7,8 +7,6 @@
|
||||
*/
|
||||
class VirtualPage extends Page {
|
||||
|
||||
static $icon = "cms/images/treeicons/page-shortcut-gold-file.gif";
|
||||
|
||||
static $description = 'Displays the content of another page';
|
||||
|
||||
public static $virtualFields;
|
||||
|
Loading…
Reference in New Issue
Block a user