openrat-cms

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

commit 32650321f5435f5e456f9b396e73fbd5d246a9ba
parent 81075b5b280b6330c138d0a192c6bb9d65d5294d
Author: dankert <devnull@localhost>
Date:   Sat,  3 Mar 2007 01:16:37 +0100

Generisches Bearbeiten von Elememtinhalten. Korrektur Datumausw?hler, Einbau HTML-Editor-Aufruf.

Diffstat:
actionClasses/PageAction.class.php | 4++--
actionClasses/PageelementAction.class.php | 366+++++++++++++++++++++++++++++++++++++++++++++----------------------------------
actionClasses/PageelementAction.ini.php | 148++++++++++++-------------------------------------------------------------------
serviceClasses/ProjectTree.class.php | 2+-
themes/default/templates/page/el.tpl.src.php | 8++++----
themes/default/templates/pageelement/advanced.tpl.src.php | 246+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
themes/default/templates/pageelement/archive.tpl.src.php | 30+++++++++++++++---------------
themes/default/templates/pageelement/edit.tpl.src.php | 68++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
themes/default/templates/pageelement/editdate.tpl.src.php | 31-------------------------------
themes/default/templates/pageelement/editlongtext.tpl.src.php | 118-------------------------------------------------------------------------------
themes/default/templates/pageelement/edittext.tpl.src.php | 31-------------------------------
themes/default/templates/pageelement/export.tpl.src.php | 13+++++++++++++
themes/default/templates/pageelement/exportlongtext.tpl.src.php | 13-------------
themes/default/templates/pageelement/import.tpl.src.php | 17+++++++++++++++++
themes/default/templates/pageelement/importlongtext.tpl.src.php | 17-----------------
15 files changed, 598 insertions(+), 514 deletions(-)

diff --git a/actionClasses/PageAction.class.php b/actionClasses/PageAction.class.php @@ -418,8 +418,8 @@ class PageAction extends ObjectAction $list[$id]['date' ] = date( lang('DATE_FORMAT'),$value->lastchangeTimeStamp); $list[$id]['archive_count'] = $value->getCountVersions(); - $list[$id]['archive_url' ] = Html::url( 'pageelement','archive','0',array('elementid'=>$id) ); - $list[$id]['url' ] = Html::url( 'pageelement','edit'.$value->element->type,'0',array('elementid'=>$id) ); + $list[$id]['archive_url' ] = Html::url( 'pageelement','archive',$this->page->id,array('elementid'=>$id) ); + $list[$id]['url' ] = Html::url( 'pageelement','edit' ,$this->page->id,array('elementid'=>$id) ); // Maximal 50 Stellen des Inhaltes anzeigen $list[$id]['value'] = Text::maxLaenge( 50,$value->value ); diff --git a/actionClasses/PageelementAction.class.php b/actionClasses/PageelementAction.class.php @@ -19,77 +19,6 @@ // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // --------------------------------------------------------------------------- -// $Log$ -// Revision 1.23 2006-12-09 16:58:35 dankert -// Notd?rftiges Aktivieren von Methode "useValue()". Hier ist noch Nacharbeit notwendig! -// -// Revision 1.22 2006/08/29 19:40:43 dankert -// Vorbereitungen f?r Im- und Export von/nach ODF. -// -// Revision 1.21 2006/08/08 20:10:23 dankert -// Neue Funktionen f?r Im- und Export -// -// Revision 1.20 2006/07/17 18:13:25 dankert -// Neue Funktion "show()" -// -// Revision 1.19 2006/01/29 17:18:59 dankert -// Steuerung der Aktionsklasse ?ber .ini-Datei, dazu umbenennen einzelner Methoden -// -// Revision 1.18 2005/01/27 00:02:47 dankert -// Immer Objektid an das Template liefern -// -// Revision 1.17 2005/01/23 00:09:25 dankert -// Sortieren Link-Liste -// -// Revision 1.16 2005/01/14 23:47:42 dankert -// Bei Longtext-Elementen auch Laden der Objektliste -// -// Revision 1.15 2004/12/29 20:18:50 dankert -// Freigabe (release-Funktion) korrigiert -// -// Revision 1.14 2004/12/28 22:59:41 dankert -// Schalter fuer HTML und WIKI -// -// Revision 1.13 2004/12/26 20:21:04 dankert -// *** empty log message *** -// -// Revision 1.12 2004/12/26 01:08:55 dankert -// Korrektur Sprachausgabe -// -// Revision 1.11 2004/12/26 01:06:31 dankert -// Perfomanceverbesserung Seite/Elemente -// -// Revision 1.10 2004/12/19 15:15:37 dankert -// Konstruktor erweitert -// -// Revision 1.9 2004/10/14 21:08:32 dankert -// Vergleichen von Versionen -// -// Revision 1.8 2004/10/13 21:19:50 dankert -// Lesen der Selectitem-Liste ueber Element-Objekt -// -// Revision 1.7 2004/07/07 20:43:48 dankert -// Neuer Elementtyp: select -// -// Revision 1.6 2004/05/30 21:55:21 dankert -// Korrektur Kasten "Freigabe" -// -// Revision 1.5 2004/05/02 14:49:37 dankert -// Einf?gen package-name (@package) -// -// Revision 1.4 2004/05/02 12:00:26 dankert -// Funktion release() zum freigeben von Inhalten -// -// Revision 1.3 2004/05/02 11:40:00 dankert -// Freigabestatus der Seiteninhalte verarbeiten -// -// Revision 1.2 2004/04/30 20:52:11 dankert -// Schalter $release setzen -// -// Revision 1.1 2004/04/24 15:14:52 dankert -// Initiale Version -// -// --------------------------------------------------------------------------- /** @@ -139,7 +68,7 @@ class PageelementAction extends Action $this->page = Session::getObject(); } - if ( $this->hasRequestVar('elementid') != '' ) + if ( $this->hasRequestVar('elementid') ) { $this->element = new Element( $this->getRequestVar('elementid') ); Session::setElement( $this->element ); @@ -154,7 +83,6 @@ class PageelementAction extends Action function show() { - $this->initedit(); $this->value->generate(); $this->setTemplateVar('value',$this->value->value); } @@ -165,7 +93,7 @@ class PageelementAction extends Action * * Es wird ein Formular erzeugt, mit dem der Benutzer den Inhalt bearbeiten kann. */ - function initedit() + function advanced() { $language = Session::getProjectLanguage(); $this->value->languageid = $language->languageid; @@ -182,14 +110,46 @@ class PageelementAction extends Action $this->setTemplateVar('name' ,$this->value->element->name ); $this->setTemplateVar('desc' ,$this->value->element->desc ); $this->setTemplateVar('elementid',$this->value->element->elementid); + $this->setTemplateVar('type' ,$this->value->element->type ); + + $funktionName = 'advanced'.$this->value->element->type; + $this->$funktionName(); } - function editdate() + /** + * Ein Element der Seite bearbeiten + * + * Es wird ein Formular erzeugt, mit dem der Benutzer den Inhalt bearbeiten kann. + */ + function edit() { - $this->initedit(); + $language = Session::getProjectLanguage(); + $this->value->languageid = $language->languageid; + $this->value->objectid = $this->page->objectid; + $this->value->pageid = $this->page->pageid; + $this->value->element = &$this->element; + $this->value->element->load(); + $this->value->publish = false; + + if ( intval($this->value->valueid)!=0 ) + $this->value->loadWithId(); + else $this->value->load(); + + $this->setTemplateVar('name' ,$this->value->element->name ); + $this->setTemplateVar('desc' ,$this->value->element->desc ); + $this->setTemplateVar('elementid',$this->value->element->elementid); + $this->setTemplateVar('type' ,$this->value->element->type ); + $funktionName = 'edit'.$this->value->element->type; + $this->$funktionName(); + } + + + + function editdate() + { $date = $this->value->date; // Wenn Datum nicht vorhanden, dann aktuelles Datum verwenden @@ -199,10 +159,6 @@ class PageelementAction extends Action $this->setTemplateVar('ansidate',date( 'Y-m-d H:i:s',$date ) ); $this->setTemplateVar('date' ,$date); - - - - if ( $this->getSessionVar('pageaction') != '' ) $this->setTemplateVar('old_pageaction',$this->getSessionVar('pageaction')); else $this->setTemplateVar('old_pageaction','show' ); @@ -221,17 +177,16 @@ class PageelementAction extends Action - function editdatecalendar() + function advanceddate() { - $this->initedit(); - - $date = $this->value->date; + global $conf; + $date = $this->value->date; // Wenn Datum nicht vorhanden, dann aktuelles Datum verwenden if ( $date == 0 ) $date = time(); - if ( $this->getRequestVar('year') != '' ) + if ( $this->hasRequestVar('year') ) { $date = mktime( $this->getRequestVar('hour'), $this->getRequestVar('minute'), @@ -240,27 +195,135 @@ class PageelementAction extends Action $this->getRequestVar('day'), $this->getRequestVar('year') ); } - $this->setTemplateVar('year' ,date('Y',$date) ); - $this->setTemplateVar('month' ,date('n',$date) ); - $this->setTemplateVar('day' ,date('j',$date) ); - $this->setTemplateVar('hour' ,date('G',$date) ); - $this->setTemplateVar('minute',date('i',$date) ); - $this->setTemplateVar('second',date('s',$date) ); - - $this->setTemplateVar('days' ,date('t',$date) ); - - $this->setTemplateVar('title' ,lang('DATE_MONTH'.date('n',$date)).' '.date('Y',$date) ); + $year = date('Y',$date); + $month = date('n',$date); + $day = date('j',$date); + $hour = date('G',$date); + $minute = date('i',$date); + $second = date('s',$date); + $this->setTemplateVar('year' ,$year ); + $this->setTemplateVar('month' ,$month ); + $this->setTemplateVar('day' ,$day ); + $this->setTemplateVar('hour' ,$hour ); + $this->setTemplateVar('minute',$minute ); + $this->setTemplateVar('second',$second ); + + $this->setTemplateVar('monthname',lang('DATE_MONTH'.date('n',$date)) ); + $this->setTemplateVar('yearname' ,date('Y',$date) ); + + + // Zwischenberechnungen + $heuteTag = intval(date('j')); + $monatLetzterTag = intval(date('t',$date)); + $monatErsterDatum = $date-(($day-1)*86400); + $wocheNr = date( 'W',$monatErsterDatum ); + $wochentagErster = date( 'w',$monatErsterDatum ); + + + $weekdayOffset = intval($conf['editor']['calendar']['weekday_offset']); - // Wochentag des 1. des Monats ermitteln - $wday1 = date( 'w',$date ); - $wday1 -= date('j',$date)-1; - while( $wday1 < 0 ) $wday1+=7; - $this->setTemplateVar('first_weekday',$wday1); + // Alle Wochentage + $weekdays = array(); + for ( $i=0; $i<=6; $i++ ) + { + $wday = ($i+$weekdayOffset)%7; + $weekdays[$wday] = lang('DATE_WEEKDAY'.$wday); + } + + $this->setTemplateVar('weekdays',$weekdays); + + + $monat = array(); + $d = 0; + $begin = false; + do + { + $woche = array(); // Neue Woche + + for ( $i=0; $i<=6; $i++ ) // Alle Wochentage der Woche + { + $wday = ($i+$weekdayOffset)%7; + $tag = array(); // Neuer Tag + + if (!$begin && $wday == $wochentagErster) + $begin = true; + + if ( $begin && $d < $monatLetzterTag ) + { + $d++; + $tag['nr'] = $d; + $tag['today'] = ($year==date('Y') && $month==date('n') && $d==$heuteTag); + if ($d != $day) + $tag['url'] = Html::url( 'pageelement','advanced','', + array('elementid'=>$this->element->elementid, + 'year' =>$year , + 'month' =>$month , + 'day' =>$d , + 'hour' =>$hour , + 'minute'=>$minute, + 'second'=>$second ) ); + else + $tag['url'] = ''; + } + else + { + $tag['nr' ]=''; + $tag['today' ]=false; + $tag['url' ]=''; + } + $woche[] = $tag; + + } + $monat[$wocheNr] = $woche; + $wocheNr++; + } + while( $d < $monatLetzterTag-1 ); +// Html::debug($monat); + $this->setTemplateVar('weeklist',$monat); $this->setTemplateVar('actdate' ,date( lang('DATE_FORMAT'),$date ) ); - $this->setTemplateVar('todayurl','?year='.date('Y').'&month='.date('m').'&day='.date('d').'&hour='.date('H').'&minute='.date('i').'&second='.date('s') ); - $this->setTemplateVar('ansidate',date( 'Y-m-d H:i:s',$date ) ); - $this->setTemplateVar('date' ,$date); + $this->setTemplateVar('todayurl',Html::url( 'pageelement','advanced','', + array('elementid'=>$this->element->elementid, + 'year' =>date('Y'), + 'month' =>date('n'), + 'day' =>date('j'), + 'hour' =>date('G'), + 'minute'=>date('i'), + 'second'=>date('s') ) ) ); + $this->setTemplateVar('lastyearurl',Html::url( 'pageelement','advanced','', + array('elementid'=>$this->element->elementid, + 'year' =>$year-1, + 'month' =>$month , + 'day' =>$day , + 'hour' =>$hour , + 'minute'=>$minute, + 'second'=>$second ) ) ); + $this->setTemplateVar('nextyearurl',Html::url( 'pageelement','advanced','', + array('elementid'=>$this->element->elementid, + 'year' =>$year+1 , + 'month' =>$month , + 'day' =>$day , + 'hour' =>$hour , + 'minute'=>$minute, + 'second'=>$second ) ) ); + $this->setTemplateVar('lastmonthurl',Html::url( 'pageelement','advanced','', + array('elementid'=>$this->element->elementid, + 'year' =>$year , + 'month' =>$month-1, + 'day' =>$day , + 'hour' =>$hour , + 'minute'=>$minute, + 'second'=>$second ) ) ); + $this->setTemplateVar('nextmonthurl',Html::url( 'pageelement','advanced','', + array('elementid'=>$this->element->elementid, + 'year' =>$year , + 'month' =>$month+1, + 'day' =>$day , + 'hour' =>$hour , + 'minute'=>$minute, + 'second'=>$second ) ) ); + +// $this->setTemplateVar('date' ,$date); @@ -277,36 +340,14 @@ class PageelementAction extends Action $this->setTemplateVar( 'objectid',$this->value->page->objectid ); - $this->forward('pageelement_edit_'.$this->value->element->type); - } - - - - function editdateform() - { - $this->initedit(); - - $date = $this->value->date; - // Wenn Datum nicht vorhanden, dann aktuelles Datum verwenden - if ( $date == 0 ) - $date = intval(time()/60)*60; - - $this->setTemplateVar('date' ,$date); - - $this->setTemplateVar('year' ,date('Y',$date) ); - $this->setTemplateVar('month' ,date('n',$date) ); - $this->setTemplateVar('day' ,date('j',$date) ); - $this->setTemplateVar('hour' ,date('G',$date) ); - $this->setTemplateVar('minute',date('i',$date) ); - $this->setTemplateVar('second',date('s',$date) ); $all_years = array(); $all_months = array(); $all_days = array(); $all_hours = array(); $all_minutes = array(); - for( $i=1850; $i<=2100;$i++ ) $all_years [$i] = $i; + for( $i=$year-100; $i<=$year+100;$i++ ) $all_years [$i] = $i; for( $i=1; $i<=12; $i++ ) $all_months [$i] = lang('DATE_MONTH'.$i); for( $i=1; $i<=31; $i++ ) $all_days [$i] = str_pad($i,2,'0',STR_PAD_LEFT); for( $i=0; $i<=23; $i++ ) $all_hours [$i] = str_pad($i,2,'0',STR_PAD_LEFT); @@ -318,23 +359,6 @@ class PageelementAction extends Action $this->setTemplateVar('all_hours' ,$all_hours ); $this->setTemplateVar('all_minutes',$all_minutes); $this->setTemplateVar('all_seconds',$all_minutes); - - - - if ( $this->getSessionVar('pageaction') != '' ) - $this->setTemplateVar('old_pageaction',$this->getSessionVar('pageaction')); - else $this->setTemplateVar('old_pageaction','show' ); - - $this->value->page = new Page( $this->page->objectid ); - $this->value->page->languageid = $this->value->languageid; - $this->value->page->load(); - - $this->setTemplateVar( 'release',$this->value->page->hasRight(ACL_RELEASE) ); - $this->setTemplateVar( 'publish',$this->value->page->hasRight(ACL_PUBLISH) ); - - $this->setTemplateVar( 'objectid',$this->value->page->objectid ); - - $this->forward('pageelement_edit_'.$this->value->element->type); } @@ -517,8 +541,6 @@ class PageelementAction extends Action function editlink() { - $this->initedit(); - $objects = array(); foreach( Folder::getAllObjectIds() as $id ) @@ -562,8 +584,6 @@ class PageelementAction extends Action function editselect() { - $this->initedit(); - $this->setTemplateVar( 'items',$this->value->element->getSelectItems() ); $this->setTemplateVar( 'text' ,$this->value->text ); @@ -588,7 +608,6 @@ class PageelementAction extends Action function editlist() { - $this->initedit(); // Auswahl ueber alle Elementtypen $objects = array(); foreach( Folder::getAllFolders() as $id ) @@ -626,8 +645,6 @@ class PageelementAction extends Action function editnumber() { - $this->initedit(); - $this->setTemplateVar('number',$this->value->number / pow(10,$this->value->element->decimals) ); if ( $this->getSessionVar('pageaction') != '' ) @@ -648,6 +665,13 @@ class PageelementAction extends Action + function advancedlongtext() + { + $this->editlongtext(); + } + + + /** * Ein Element der Seite bearbeiten * @@ -655,8 +679,6 @@ class PageelementAction extends Action */ function editlongtext() { - $this->initedit(); - // Ermitteln aller verlinkbaren Objekte (fuer Editor) $objects = array(); @@ -705,8 +727,6 @@ class PageelementAction extends Action */ function edittext() { - $this->initedit(); - $this->setTemplateVar( 'text',$this->value->text ); if ( $this->getSessionVar('pageaction') != '' ) @@ -1052,6 +1072,22 @@ class PageelementAction extends Action /** + * Ein Element der Seite speichern. + */ + function save() + { + $this->element->load(); + $type = $this->element->type; + if ( empty($type)) + die('Error: No element type available.'); + $funktionName = 'save'.$type; + Logger::debug('save: '.$this->element->type); + $this->$funktionName(); + } + + + + /** * Element speichern * * Der Inhalt eines Elementes wird abgespeichert @@ -1434,13 +1470,33 @@ class PageelementAction extends Action function createOdfDocument() { - $this->initedit(); $transformer = new Transformer(); $transformer->text = $this->value->text; $transformer->type = 'odf'; $transformer->transform(); return $transformer->text; } + + + function checkMenu( $name ) + { + $type = $this->value->element->type; + + switch( $name ) + { + case 'show': + case 'edit': + case 'archive': + return true; + + case 'advanced': + return in_array($type,array('date','longtext','number')); + + default: + return false; + } + } + } ?> \ No newline at end of file diff --git a/actionClasses/PageelementAction.ini.php b/actionClasses/PageelementAction.ini.php @@ -2,144 +2,38 @@ [default] goto=show -[edittext] -target=savetext -menu=text - [usevalue] -menu=text - -[editlink] -target=savelink -menu=link - -[editselect] -target=saveselect -menu=select - -[editnumber] -target=savenumber -menu=number - -[editlist] -target=savelist -menu=list - -[editlongtext] -target=savelongtext -menu=longtext - -[importlongtext] -target=doimportlongtext -menu=longtext +menu=edit -[exportlongtext] -target=doexportlongtext -menu=longtext +[doimport] -[doimportlongtext] +[doexport] -[doexportlongtext] +[import] +menu=edit -[editdate] -target=savedate -menu=date - -[editdateform] -target=savedate -menu=date +[export] +menu=edit [diff] - -[diffdate] -alias=diff -menu=date - -[difftext] -alias=diff -menu=text - -[difflongtext] -alias=diff -menu=longtext - -[difflink] -alias=diff -menu=link - -[editdatecalendar] -target=savedate -menu=date +menu=edit [archive] -menu=text +menu=edit -[savedate] -goto=show +[show] +menu=edit -[archivedate] -menu=date -goto=archive -target=diffdate +[edit] +menu=edit +target=save -[savetext] -goto=showtext +[advanced] +menu=edit +target=save -[savelongtext] -goto=showlongtext - -[savelink] -goto=showlink - -[showlink] -alias=show -menu=link - -[shownumber] -alias=show -menu=number - -[showdate] -alias=show -menu=date - -[showlongtext] -alias=show -menu=longtext - -[archivelink] -menu=link -alias=archive - -[archivelongtext] -menu=longtext -alias=archive -target=difflongtext - -[archivedate] -menu=date -alias=archive -target=diffdate - -[archivenumber] -menu=number -alias=archive -target=diffnumber - -[savelist] -goto=showlist - -[saveselect] -goto=showselect - -[savenumber] -goto=shownumber +[save] +goto=show [menu] -longtext=showlongtext,editlongtext,importlongtext,exportlongtext,archivelongtext -text=showtext,edittext,archivetext -link=showlink,editlink,archivelink -list=showlist,editlist,archivelist -select=showselect,editselect,archiveselect -number=shownumber,editnumber,archivenumber -date=showdate,editdate,editdatecalendar,editdateform,archivedate- \ No newline at end of file +edit=show,edit,advanced,import,export,archive+ \ No newline at end of file diff --git a/serviceClasses/ProjectTree.class.php b/serviceClasses/ProjectTree.class.php @@ -62,7 +62,7 @@ class ProjectTree extends AbstractTree 'pageelement', $id, array('elementid'=>$elementid, - REQ_PARAM_TARGETSUBACTION=>'edit'.$element->type)); + REQ_PARAM_TARGETSUBACTION=>'edit')); $treeElement->icon = 'el_'.$element->type; $treeElement->description = lang('EL_'.$element->type); diff --git a/themes/default/templates/page/el.tpl.src.php b/themes/default/templates/page/el.tpl.src.php @@ -16,17 +16,17 @@ page list list:el extract:true row cell class:fx - link url:url title:desc - image elementtype:type align:left + link url:var:url title:desc + image elementtype:var:type align:left text var:name cell class:fx text var:value text raw:_ cell class:fx - link url:archive_url + link url:var:archive_url text text:GLOBAL_ARCHIVE text raw:_( - text var:archive_count + text text:var:archive_count text raw:) row cell class:help colspan:3 diff --git a/themes/default/templates/pageelement/advanced.tpl.src.php b/themes/default/templates/pageelement/advanced.tpl.src.php @@ -0,0 +1,245 @@ +page + form + +RAW +<?php + function editBar() + { + global $image_dir,$objects; + ?> +<tr> + <td colspan="2" class="f1"> + <table> + <tr> + <noscript><input type="text" name="addtext" size="10" /></noscript> + <td><noscript><?php echo Html::Checkbox('strong') ?></noscript><a href="javascript:strong();" title="<?php echo lang('PAGE_EDITOR_ADD_STRONG') ?>"><img src="<?php echo $image_dir ?>/editor/bold.png" border"0" /></a></td> + <td><noscript><?php echo Html::Checkbox('emphatic') ?></noscript><a href="javascript:emphatic();" title="<?php echo lang('PAGE_EDITOR_ADD_EMPHATIC') ?>"><img src="<?php echo $image_dir ?>/editor/italic.png" border"0" /></a></td> + <td>&nbsp;&nbsp;&nbsp;&nbsp;</td> + <td><noscript><?php echo Html::Checkbox('table') ?></noscript><a href="javascript:table();" title="<?php echo lang('PAGE_EDITOR_ADD_TABLE') ?>"><img src="<?php echo $image_dir ?>/editor/table.png" border"0" /></a></td> + <td>&nbsp;&nbsp;&nbsp;&nbsp;</td> + <td><noscript><?php echo Html::Checkbox('list') ?></noscript><a href="javascript:list();" title="<?php echo lang('PAGE_EDITOR_ADD_LIST') ?>"><img src="<?php echo $image_dir ?>/editor/list.png" border"0" /></a></td> + <td><noscript><?php echo Html::Checkbox('numlist') ?></noscript><a href="javascript:numlist();" title="<?php echo lang('PAGE_EDITOR_ADD_NUMLIST') ?>"><img src="<?php echo $image_dir ?>/editor/numlist.png" border"0" /></a></td> + <td>&nbsp;&nbsp;&nbsp;&nbsp;</td> + <td><noscript><?php echo Html::Checkbox('image') ?></noscript><a href="javascript:image();" title="<?php echo lang('PAGE_EDITOR_ADD_IMAGE') ?>"><img src="<?php echo $image_dir ?>/editor/image.png" border"0" /></a></td> + <td><noscript><?php echo Html::Checkbox('link') ?></noscript><a href="javascript:link();" title="<?php echo lang('PAGE_EDITOR_ADD_LINK') ?>"><img src="<?php echo $image_dir ?>/editor/link.png" border"0" /></a></td> + <td><?php echo Html::selectBox('objectid',$objects) ?><noscript>&nbsp;&nbsp;&nbsp;<input type="submit" class="submit" name="addmarkup" value="<?php echo lang('GLOBAL_ADD') ?>"/></noscript></td> + </tr> + </table> + </td> +</tr> + +<?php } ?> + +<script name="Javascript" type="text/javascript" src="<?php echo $tpl_dir ?>../js/editor.js"></script> +<script name="JavaScript" type="text/javascript"> +<!-- + +function strong() +{ + insert('text','*','*'); +} + + +function emphatic() +{ + insert('text','_','_'); +} + + +function link() +{ + insert('text','"','"->"'+document.forms[0].objectid.value+'"'); +} + + +function image() +{ + insert('text','','{"'+document.forms[0].objectid.value+'"}'); +} + + +function list() +{ + insert('text',"\n\n- ","\n- \n- \n"); +} + + +function numlist() +{ + insert('text',"\n\n# ","\n# \n# \n"); +} + + +function table() +{ + insert('text',"\n|","| |\n| | |\n"); +} + + +//--> +--> +</script> +END + + window name:element + row + cell colspan:2 class:help + text var:desc + + + + if value:var:type equals:date + table width:85% + row + cell colspan:7 class:help + link url:var:lastmonthurl + image file:left align:middle + text raw:_ + text text:var:monthname + text raw:_ + link url:var:nextmonthurl + image file:right align:middle + text raw:_____ + link url:var:lastyearurl + image file:left align:middle + text raw:_ + text text:var:yearname + text raw:_ + link url:var:nextyearurl + image file:right align:middle + row + cell + text text:message:global_nr + list list:weekdays value:weekday + cell + text text:var:weekday +RAW +<?php #Html::debug($weeklist) ?> +END + list list:weeklist key:weeknr value:week + row + cell width:12% + text text:var:weeknr + list list:week extract:true + cell width:12% + if empty:url + text raw:__ + text text:var:nr + text raw:__ + if not:true empty:url + link url:var:url + text raw:__ + text text:var:nr + text raw:__ + if true:var:today + text raw:* + + + row + cell class:fx colspan:2 + text text:message:date + cell class:fx colspan:5 + selectbox name:year list:all_years + text raw:_-_ + selectbox name:month list:all_months + text raw:_-_ + selectbox name:day list:all_days + + row + cell class:fx colspan:2 + text text:message:date_time + cell class:fx colspan:5 + selectbox name:hour list:all_hours + text raw:_-_ + selectbox name:minute list:all_minutes + text raw:_-_ + selectbox name:second list:all_seconds + + + + + + + if value:var:type equals:text + row + cell colspan:2 class:fx + input size:50 maxlength:255 class:text name:text + focus field:text + + if value:var:type equals:longtext + + if true:var:html +RAW +<?php +include('./editor/fckeditor.php'); + +$editor = new FCKeditor('text') ; +$editor->BasePath = './editor/'; +$editor->Value = $text; +$editor->Height = '290'; +$editor->Config['CustomConfigurationsPath'] = '../openrat-fckconfig.js'; +$editor->Create(); +?> +END + + if true:var:wiki + if present:preview_text + row + cell colspan:2 class:fx + text var:preview_text + +RAW +<?php editBar() ?> +END + + row + cell colspan:2 class:fx + inputarea class:longtext name:text rows:25 cols:70 + focus field:text + + if value:var:type equals:link + row + cell colspan:2 class:fx + selectbox list:objects name:linkobjectid + focus field:linkobjectid + + if value:var:type equals:list + row + cell colspan:2 class:fx + selectbox list:objects name:linkobjectid + focus field:linkobjectid + + if value:var:type equals:number + row + cell colspan:2 class:fx + hidden name:decimals default:decimals + input size:15 maxlength:20 name:number + focus field:number + + if value:var:type equals:select + row + cell colspan:2 class:fx + selectbox list:items name:text + focus field:text + + + + if present:release + row + cell colspan:2 class:fx + checkbox name:release + text raw:_ + text text:GLOBAL_RELEASE + + if present:publish + row + cell colspan:2 class:fx + checkbox name:publish + text raw:_ + text text:PAGE_PUBLISH_AFTER_SAVE + + row + cell colspan:2 class:act + button type:ok + + focus field:text+ \ No newline at end of file diff --git a/themes/default/templates/pageelement/archive.tpl.src.php b/themes/default/templates/pageelement/archive.tpl.src.php @@ -25,29 +25,29 @@ page list list:el extract:true row cell class:fx - text var:lfd_nr + text text:var:lfd_nr cell class:fx - radio name:compareid value:lfd_nr + radio name:compareid value:var:lfd_nr cell class:fx - radio name:withid value:lfd_nr + radio name:withid value:var:lfd_nr cell class:fx text var:date cell class:fx - text var:user + text text:user cell class:fx - text var:value + text text:var:value cell class:fx - if true:public - text text:GLOBAL_PUBLIC - if present:releaseUrl - link url:releaseUrl - text text:GLOBAL_RELEASE + if true:var:public + text text:message:GLOBAL_PUBLIC + else + link url:var:releaseUrl + text text:message:GLOBAL_RELEASE cell class:fx - if true:active - text text:GLOBAL_ACTIVE - if present:useUrl - link url:useUrl - text text:GLOBAL_USE + if true:var:active + text text:message:GLOBAL_ACTIVE + else + link url:var:useUrl + text text:message:GLOBAL_USE row cell colspan:8 class:act diff --git a/themes/default/templates/pageelement/edit.tpl.src.php b/themes/default/templates/pageelement/edit.tpl.src.php @@ -0,0 +1,68 @@ +page + form method:post + input type:hidden name:elementid + window name:element + row + cell colspan:2 class:help + text var:desc + + if value:var:type equals:date + row + cell colspan:2 class:fx + input size:25 maxlength:25 class:ansidate name:ansidate + focus field:ansidate + + if value:var:type equals:text + row + cell colspan:2 class:fx + input size:50 maxlength:255 class:text name:text + focus field:text + + if value:var:type equals:longtext + row + cell colspan:2 class:fx + inputarea class:longtext name:text rows:25 cols:70 + focus field:text + + if value:var:type equals:link + row + cell colspan:2 class:fx + selectbox list:objects name:linkobjectid + focus field:linkobjectid + + if value:var:type equals:list + row + cell colspan:2 class:fx + selectbox list:objects name:linkobjectid + focus field:linkobjectid + + if value:var:type equals:number + row + cell colspan:2 class:fx + hidden name:decimals default:decimals + input size:15 maxlength:20 name:number + focus field:number + + if value:var:type equals:select + row + cell colspan:2 class:fx + selectbox list:items name:text + focus field:text + + if present:release + row + cell colspan:2 class:fx + checkbox name:release + text raw:_ + text text:GLOBAL_RELEASE + + if present:publish + row + cell colspan:2 class:fx + checkbox name:publish + text raw:_ + text text:PAGE_PUBLISH_AFTER_SAVE + + row + cell colspan:2 class:act + button type:ok diff --git a/themes/default/templates/pageelement/editdate.tpl.src.php b/themes/default/templates/pageelement/editdate.tpl.src.php @@ -1,31 +0,0 @@ -page - form - window name:element - row - cell colspan:2 class:help - text var:desc - - row - cell colspan:2 class:fx - input size:25 maxlength:25 class:ansidate name:ansidate - - if present:release - row - cell colspan:2 class:fx - checkbox name:release - text raw:_ - text text:GLOBAL_RELEASE - - if present:publish - row - cell colspan:2 class:fx - checkbox name:publish - text raw:_ - text text:PAGE_PUBLISH_AFTER_SAVE - - row - cell colspan:2 class:act - button type:ok - - focus field:text - diff --git a/themes/default/templates/pageelement/editlongtext.tpl.src.php b/themes/default/templates/pageelement/editlongtext.tpl.src.php @@ -1,117 +0,0 @@ -page - form - -RAW -<?php - function editBar() - { - global $image_dir,$objects; - ?> -<tr> - <td colspan="2" class="f1"> - <table> - <tr> - <noscript><input type="text" name="addtext" size="10" /></noscript> - <td><noscript><?php echo Html::Checkbox('strong') ?></noscript><a href="javascript:strong();" title="<?php echo lang('PAGE_EDITOR_ADD_STRONG') ?>"><img src="<?php echo $image_dir ?>/editor/bold.png" border"0" /></a></td> - <td><noscript><?php echo Html::Checkbox('emphatic') ?></noscript><a href="javascript:emphatic();" title="<?php echo lang('PAGE_EDITOR_ADD_EMPHATIC') ?>"><img src="<?php echo $image_dir ?>/editor/italic.png" border"0" /></a></td> - <td>&nbsp;&nbsp;&nbsp;&nbsp;</td> - <td><noscript><?php echo Html::Checkbox('table') ?></noscript><a href="javascript:table();" title="<?php echo lang('PAGE_EDITOR_ADD_TABLE') ?>"><img src="<?php echo $image_dir ?>/editor/table.png" border"0" /></a></td> - <td>&nbsp;&nbsp;&nbsp;&nbsp;</td> - <td><noscript><?php echo Html::Checkbox('list') ?></noscript><a href="javascript:list();" title="<?php echo lang('PAGE_EDITOR_ADD_LIST') ?>"><img src="<?php echo $image_dir ?>/editor/list.png" border"0" /></a></td> - <td><noscript><?php echo Html::Checkbox('numlist') ?></noscript><a href="javascript:numlist();" title="<?php echo lang('PAGE_EDITOR_ADD_NUMLIST') ?>"><img src="<?php echo $image_dir ?>/editor/numlist.png" border"0" /></a></td> - <td>&nbsp;&nbsp;&nbsp;&nbsp;</td> - <td><noscript><?php echo Html::Checkbox('image') ?></noscript><a href="javascript:image();" title="<?php echo lang('PAGE_EDITOR_ADD_IMAGE') ?>"><img src="<?php echo $image_dir ?>/editor/image.png" border"0" /></a></td> - <td><noscript><?php echo Html::Checkbox('link') ?></noscript><a href="javascript:link();" title="<?php echo lang('PAGE_EDITOR_ADD_LINK') ?>"><img src="<?php echo $image_dir ?>/editor/link.png" border"0" /></a></td> - <td><?php echo Html::selectBox('objectid',$objects) ?><noscript>&nbsp;&nbsp;&nbsp;<input type="submit" class="submit" name="addmarkup" value="<?php echo lang('GLOBAL_ADD') ?>"/></noscript></td> - </tr> - </table> - </td> -</tr> - -<?php } ?> - -<script name="Javascript" type="text/javascript" src="<?php echo $tpl_dir ?>../js/editor.js"></script> -<script name="JavaScript" type="text/javascript"> -<!-- - -function strong() -{ - insert('text','*','*'); -} - - -function emphatic() -{ - insert('text','_','_'); -} - - -function link() -{ - insert('text','"','"->"'+document.forms[0].objectid.value+'"'); -} - - -function image() -{ - insert('text','','{"'+document.forms[0].objectid.value+'"}'); -} - - -function list() -{ - insert('text',"\n\n- ","\n- \n- \n"); -} - - -function numlist() -{ - insert('text',"\n\n# ","\n# \n# \n"); -} - - -function table() -{ - insert('text',"\n|","| |\n| | |\n"); -} - - -//--> ---> -</script> -END - - window name:element - row - cell colspan:2 class:help - text var:desc - - if present:preview_text - row - cell colspan:2 class:fx - text var:preview_text -RAW -<?php editBar() ?> -END - - row - cell colspan:2 class:fx - inputarea class:longtext name:text rows:25 cols:70 - -RAW -<tr> - <td class="f2"><?php if ( $release ) echo Html::checkBox('release',true).' '.lang('GLOBAL_RELEASE') ?></td> - <td class="f2"><?php echo Html::checkBox('html',$html,false) ?> <span title="<?php echo lang('EL_PROP_HTML_DESC') ?>"><?php echo lang('EL_PROP_HTML') ?></span></td> -</tr> - -<tr> - <td class="f2"><?php if ( $publish ) echo Html::checkBox('publish',false).' '.lang('PAGE_PUBLISH_AFTER_SAVE') ?>&nbsp;</td> - <td class="f2" rowspan="2"><?php echo Html::checkBox('wiki',$wiki,false) ?> <span title="<?php echo lang('EL_PROP_WIKI_DESC') ?>"><?php echo lang('EL_PROP_WIKI') ?></span><?php if ($wiki) echo '<br/>'.lang('PAGE_LONGTEXT_WIKI_DESC') ?></td> -</tr> -END - - row - cell colspan:2 class:act - button type:ok - - focus field:text- \ No newline at end of file diff --git a/themes/default/templates/pageelement/edittext.tpl.src.php b/themes/default/templates/pageelement/edittext.tpl.src.php @@ -1,30 +0,0 @@ -page - form - window name:element - row - cell colspan:2 class:help - text var:desc - - row - cell colspan:2 class:fx - input size:50 maxlength:255 class:ansidate name:text - - if present:release - row - cell colspan:2 class:fx - checkbox name:release - text raw:_ - text text:GLOBAL_RELEASE - - if present:publish - row - cell colspan:2 class:fx - checkbox name:publish - text raw:_ - text text:PAGE_PUBLISH_AFTER_SAVE - - row - cell colspan:2 class:act - button type:ok - - focus field:text- \ No newline at end of file diff --git a/themes/default/templates/pageelement/export.tpl.src.php b/themes/default/templates/pageelement/export.tpl.src.php @@ -0,0 +1,12 @@ +page + form + window name:export columnclasses:a + row + cell + selectbox list:types name:type + + row + cell + button type:ok + + focus field:text+ \ No newline at end of file diff --git a/themes/default/templates/pageelement/exportlongtext.tpl.src.php b/themes/default/templates/pageelement/exportlongtext.tpl.src.php @@ -1,12 +0,0 @@ -page - form - window name:export columnclasses:a - row - cell - selectbox list:types name:type - - row - cell - button type:ok - - focus field:text- \ No newline at end of file diff --git a/themes/default/templates/pageelement/import.tpl.src.php b/themes/default/templates/pageelement/import.tpl.src.php @@ -0,0 +1,16 @@ +page + form + window name:import columnclasses:a + row + cell + selectbox list:types name:type + + row + cell + upload name:file + + row + cell + button type:ok + + focus field:text+ \ No newline at end of file diff --git a/themes/default/templates/pageelement/importlongtext.tpl.src.php b/themes/default/templates/pageelement/importlongtext.tpl.src.php @@ -1,16 +0,0 @@ -page - form - window name:import columnclasses:a - row - cell - selectbox list:types name:type - - row - cell - upload name:file - - row - cell - button type:ok - - focus field:text- \ No newline at end of file