mirror of
https://github.com/silverstripe/silverstripe-translatable
synced 2024-10-22 11:05:59 +02:00
First (and failing) step
This commit is contained in:
parent
7bfece9666
commit
69468cd699
@ -10,6 +10,9 @@ SiteConfig:
|
||||
LeftAndMain:
|
||||
extensions:
|
||||
['TranslatableCMSMainExtension']
|
||||
LeftAndMain_TreeNode:
|
||||
extensions:
|
||||
['TranslatableCMSTreeNodeExtension']
|
||||
HtmlEditorField_Toolbar:
|
||||
extensions:
|
||||
['TranslatableEditorToolbarExtension']
|
||||
|
30
code/controller/TranslatableCMSTreeNodeExtension.php
Normal file
30
code/controller/TranslatableCMSTreeNodeExtension.php
Normal file
@ -0,0 +1,30 @@
|
||||
<?php
|
||||
/**
|
||||
* @package translatable
|
||||
*/
|
||||
class TranslatableCMSTreeNodeExtension extends Extension {
|
||||
|
||||
function init() {
|
||||
die("Init TranslatableCMSTreeNodeExtension. "); // this never gets called in the current config
|
||||
}
|
||||
|
||||
/**
|
||||
* Overrides {@link LeftAndMain_TreeNode->forTemplate()} in order to show the original page name on mouseover.
|
||||
*
|
||||
* @todo Make it more flexible, because right now it's a simple copy-paste with changes
|
||||
*
|
||||
* @return String
|
||||
*/
|
||||
public function forTemplate() {
|
||||
$obj = $this->owner->obj;
|
||||
$original_pagename = ' (original page name: coming soon!)';
|
||||
|
||||
return "<li id=\"record-$obj->ID\" data-id=\"$obj->ID\" data-pagetype=\"$obj->ClassName\" class=\""
|
||||
. $this->getClasses() . "\">" . "<ins class=\"jstree-icon\"> </ins>"
|
||||
. "<a href=\"" . $this->getLink() . "\" title=\"("
|
||||
. trim(_t('LeftAndMain.PAGETYPE','Page type'), " :") // account for inconsistencies in translations
|
||||
. ": " . $obj->i18n_singular_name() . ") {$obj->Title}$original_pagename\" ><ins class=\"jstree-icon\"> </ins>"
|
||||
. "<span class=\"text\">{$obj->TreeTitle}</span></a>";
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in New Issue
Block a user