openrat-cms

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

commit bacfbf09fa1f2477896efb1b74995c09bd535790
parent f715ac4aa3c9ecb476f3881054c80e2a8177967c
Author: Jan Dankert <devnull@localhost>
Date:   Thu, 25 Oct 2012 23:29:43 +0200

Seite bearbeiten: Anzeige der Seiteninhalte in einer Liste. Vorschau im iframe mit korrekten Links.

Diffstat:
action/PageAction.class.php | 13+++++++------
model/Page.class.php | 2+-
model/Value.class.php | 2+-
themes/default/templates/page/edit.tpl.src.xml | 53+++++++++++++++++++++++++++++++++++++++++++++++++++++
themes/default/templates/page/el.tpl.src.xml | 62--------------------------------------------------------------
5 files changed, 62 insertions(+), 70 deletions(-)

diff --git a/action/PageAction.class.php b/action/PageAction.class.php @@ -140,7 +140,7 @@ class PageAction extends ObjectAction * * Der Inhalt eines Elementes wird abgespeichert */ - function elPost() + function editPost() { $value = new Value(); $language = Session::getProjectLanguage(); @@ -482,7 +482,7 @@ class PageAction extends ObjectAction /** * Alle Elemente der Seite anzeigen */ - function elView() + function editView() { $this->page->public = true; $this->page->simple = true; @@ -498,7 +498,7 @@ class PageAction extends ObjectAction { $list[$id] = array(); $list[$id]['name'] = $value->element->name; - $list[$id]['url' ] = Html::url( 'pageelement','edit' ,$this->page->id,array('elementid'=>$id,'mode'=>'edit') ); + $list[$id]['pageelementid' ] = $this->page->objectid.'_'.$id; $list[$id]['desc'] = $value->element->desc; $list[$id]['type'] = $value->element->type; @@ -506,11 +506,12 @@ class PageAction extends ObjectAction if ( $list[$id]['archive_count'] > 0 ) $list[$id]['archive_url'] = Html::url( 'pageelement','archive',$this->page->id,array('elementid'=>$id) ); - // Maximal 50 Stellen des Inhaltes anzeigen - $list[$id]['value'] = Text::maxLaenge( 50,$value->value ); + // Inhalt anzeigen + $list[$id]['value'] = $value->value; } } + $this->setTemplateVar('preview_url',Html::url('page','view',$this->page->objectid,array('target'=>'none') ) ); $this->setTemplateVar('el',$list); } @@ -655,7 +656,7 @@ class PageAction extends ObjectAction * * Bei editierbaren Feldern wird ein Editor-Ikon vorangestellt. */ - function editView() + public function viewView() { // Editier-Icons anzeigen $this->page->icons = true; diff --git a/model/Page.class.php b/model/Page.class.php @@ -735,7 +735,7 @@ class Page extends Object } if ( $this->icons ) - $src = str_replace( '{{->'.$id.'}}','<a href="javascript:openNewAction(\''.$value->element->name.'\',\'pageelement\',\''.$this->objectid.'_'.$value->element->elementid.'\');" title="'.$value->element->desc.'"><img src="'.OR_THEMES_EXT_DIR.$conf['interface']['theme'].'/images/icon_el_'.$value->element->type.IMG_ICON_EXT.'" border="0" align="left"></a>',$src ); + $src = str_replace( '{{->'.$id.'}}','<a href="javascript:parent.openNewAction(\''.$value->element->name.'\',\'pageelement\',\''.$this->objectid.'_'.$value->element->elementid.'\');" title="'.$value->element->desc.'"><img src="'.OR_THEMES_EXT_DIR.$conf['interface']['theme'].'/images/icon_el_'.$value->element->type.IMG_ICON_EXT.'" border="0" align="left"></a>',$src ); else $src = str_replace( '{{->'.$id.'}}','',$src ); } diff --git a/model/Value.class.php b/model/Value.class.php @@ -1397,7 +1397,7 @@ SQL if ( $this->page->icons && $this->element->withIcon ) - $inhalt = '<a href="javascript:openNewAction(\''.$this->element->name.'\',\'pageelement\',\''.$this->page->objectid.'_'.$this->element->elementid.'\');" title="'.$this->element->desc.'"><img src="'.OR_THEMES_EXT_DIR.$conf['interface']['theme'].'/images/icon_el_'.$this->element->type.IMG_ICON_EXT.'" border="0" align="left"></a>'.$inhalt; + $inhalt = '<a href="javascript:parent.openNewAction(\''.$this->element->name.'\',\'pageelement\',\''.$this->page->objectid.'_'.$this->element->elementid.'\');" title="'.$this->element->desc.'"><img src="'.OR_THEMES_EXT_DIR.$conf['interface']['theme'].'/images/icon_el_'.$this->element->type.IMG_ICON_EXT.'" border="0" align="left"></a>'.$inhalt; $this->value = $inhalt; diff --git a/themes/default/templates/page/edit.tpl.src.xml b/themes/default/templates/page/edit.tpl.src.xml @@ -0,0 +1,52 @@ +<output xmlns="http://www.openrat.de/template" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://www.openrat.de/template ../template.xsd"> + <table> + <if not="" empty="el"> + <row class="headline"> + <column class="help"> + <text text="PAGE_ELEMENT_NAME"></text> + </column> + <column class="help"> + <text text="PAGE_ELEMENT_VALUE"></text> + </column> + </row> + </if> + <if empty="el"> + <row> + <column> + <text text="GLOBAL_NOT_FOUND"></text> + </column> + </row> + </if> + <list list="el" extract="true"> + <row class="data"> + <column class="clickable"> + <link type="open" title="var:desc" name="var:name" action="pageelement" id="var:pageelementid"> + <image elementtype="var:type" align="left"></image> + <text var="name"></text> + </link> + </column> + <column> + <text var="value" maxlength="50"></text> + <text raw="_"></text> + </column> + </row> + </list> + <!-- + <row> <column class="help" colspan="3"> <text + text="PAGE_ELEMENTS_DESC"></text> </column> </row> + --> + </table> + + <!-- + <link action="page" subaction="form" + title="message:menu_page_form_desc" class="action"> <text + key="menu_page_form"></text> </link> + --> + + <group title="message:menu_page_show"> + <part> + <insert url="var:preview_url" name="preview"></insert> + </part> + </group> +</output>+ \ No newline at end of file diff --git a/themes/default/templates/page/el.tpl.src.xml b/themes/default/templates/page/el.tpl.src.xml @@ -1,61 +0,0 @@ -<output xmlns="http://www.openrat.de/template" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation="http://www.openrat.de/template ../template.xsd"> - <table> - <if not="" empty="el"> - <row class="headline"> - <column class="help"> - <text text="PAGE_ELEMENT_NAME"></text> - </column> - <column class="help"> - <text text="PAGE_ELEMENT_VALUE"></text> - </column> - <column class="help"> - <text text="GLOBAL_ARCHIVE"></text> - </column> - </row> - </if> - <if empty="el"> - <row> - <column> - <text text="GLOBAL_NOT_FOUND"></text> - </column> - </row> - </if> - <list list="el" extract="true"> - <row class="data"> - <column> - <link url="var:url" title="var:desc"> - <image elementtype="var:type" align="left"></image> - <text var="name"></text> - </link> - </column> - <column> - <text var="value"></text> - <text raw="_"></text> - </column> - <column> - <if present="archive_url"> - <link url="var:archive_url" title="message:GLOBAL_ARCHIVE_DESC"> - <text text="GLOBAL_ARCHIVE"></text> - </link> - <text raw="_(_"></text> - <text var="archive_count"></text> - <text raw="_)"></text> - </if> - <else><text text="GLOBAL_NO_ARCHIVE" type="emphatic" - title="message:GLOBAL_NO_ARCHIVE_DESC"></text></else> - <set var="archive_url"></set> - </column> - </row> - </list> - <row> - <column class="help" colspan="3"> - <text text="PAGE_ELEMENTS_DESC"></text> - </column> - </row> - </table> - <link action="page" subaction="form" title="message:menu_page_form_desc" - class="action"> - <text key="menu_page_form"></text> - </link> -</output>- \ No newline at end of file