First (and failing) step

This commit is contained in:
Joris Debonnet 2016-03-22 22:04:33 +01:00
parent 7bfece9666
commit 69468cd699
2 changed files with 33 additions and 0 deletions

View File

@ -10,6 +10,9 @@ SiteConfig:
LeftAndMain:
extensions:
['TranslatableCMSMainExtension']
LeftAndMain_TreeNode:
extensions:
['TranslatableCMSTreeNodeExtension']
HtmlEditorField_Toolbar:
extensions:
['TranslatableEditorToolbarExtension']

View 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\">&nbsp;</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\">&nbsp;</ins>"
. "<span class=\"text\">{$obj->TreeTitle}</span></a>";
}
}