openrat-cms

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs

commit 0420a4af1d1ad495b5c780b6972dae775b7613b7
parent 606ec6859f010dd8d2f11bc791c41d3b94ddcd40
Author: dankert <devnull@localhost>
Date:   Thu, 21 May 2009 00:41:08 +0200

Anzeige von anderen Sprachen im Editor.

Diffstat:
actionClasses/PageelementAction.class.php | 21+++++++++++++++++++++
language/de.ini.php | 2++
themes/default/include/html/text.inc.php | 2+-
themes/default/templates/pageelement/edit.tpl.src.php | 49++++++++++++++++++++++++++++++++++++++++++++-----
4 files changed, 68 insertions(+), 6 deletions(-)

diff --git a/actionClasses/PageelementAction.class.php b/actionClasses/PageelementAction.class.php @@ -578,9 +578,30 @@ class PageelementAction extends Action $this->setTemplateVar('old_pageaction',$this->getSessionVar('pageaction')); else $this->setTemplateVar('old_pageaction','show' ); + if ( $this->element->wiki ) { + $project = Session::getProject(); + $languages = $project->getLanguages(); + + if ( count($languages) > 1 ) + $this->setTemplateVar('languages',$languages); + + if ( $this->hasRequestVar('otherlanguageid') ) + { + $lid = $this->getRequestVar('otherlanguageid'); + $otherValue = new Value(); + $otherValue->languageid = $lid; + $otherValue->pageid = $this->value->pageid; + $otherValue->element = $this->value->element; + $otherValue->publish = $this->value->publish; + $otherValue->load(); + $this->setTemplateVar('languagetext' ,wordwrap($otherValue->text,100) ); + $this->setTemplateVar('languagename' ,$languages[$lid] ); + $this->setTemplateVar('otherlanguageid',$lid ); + } + if ( !isset($this->templateVars['text'])) // Möglicherweise ist die Ausgabevariable bereits gesetzt, wenn man bereits // einen Text eingegeben hat (Vorschaufunktion). diff --git a/language/de.ini.php b/language/de.ini.php @@ -1025,3 +1025,4 @@ MENU_TITLE_FILE_RIGHTS="Datei-Berechtigungen" INHERIT_RIGHTS = "Berechtigungen in allen untergeordneten Objekten zurücksetzen und die vererbbaren Berechtigungen dieses Ordners dort anwenden." CONTENT = "Inhalt" EDITOR = "Editor" +EDITOR_SHOW_LANGUAGE = "Sprache anzeigen"+ \ No newline at end of file diff --git a/themes/default/include/html/text.inc.php b/themes/default/include/html/text.inc.php @@ -93,7 +93,7 @@ if ( $pos !== false ) $tmp_text = substr($tmp_text,0,max($pos,0)).'<span class="accesskey">'.substr($tmp_text,$pos,1).'</span>'.substr($tmp_text,$pos+1); #END-IF - + $tmp_text = nl2br($tmp_text); echo $tmp_text; unset($tmp_text); diff --git a/themes/default/templates/pageelement/edit.tpl.src.php b/themes/default/templates/pageelement/edit.tpl.src.php @@ -112,6 +112,12 @@ page text var:preview escape:false newline newline + + if present:languagetext + fieldset title:var:languagename + text var:languagetext + newline + newline editor type:wiki name:text @@ -205,6 +211,35 @@ page focus field:text if true:mode:edit + if value:var:type equals:longtext + if value:var:editor equals:wiki + + if present:languages + row + cell colspan:2 + fieldset title:message:editor_show_language + row + cell colspan:2 + list list:languages key:languageid value:languagename + radio name:otherlanguageid value:var:languageid + label for:otherlanguageid_{languageid} + text var:languagename + newline + row + cell colspan:2 + fieldset title:message:PAGE_PREVIEW + row + cell colspan:2 + checkbox name:preview + label for:preview + text key:PAGE_PREVIEW +# row +# cell colspan:2 +# radio name:save +# label for:save +# text key:SAVE + + if true:mode:edit if present:release if present:publish row @@ -224,12 +259,16 @@ page checkbox name:publish label for:publish text text:PAGE_PUBLISH_AFTER_SAVE + row cell colspan:2 class:act - if true:mode:edit - if value:var:type equals:longtext - if value:var:editor equals:wiki - button type:submit value:preview text:PAGE_PREVIEW - text raw:___ + + # Preview jetzt über Checkbox. + #if true:mode:edit + # if value:var:type equals:longtext + # if value:var:editor equals:wiki + # button type:submit value:preview text:PAGE_PREVIEW + # text raw:___ + button type:ok