openrat-cms

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

commit 9bc335abbfee4a03f7aa3d8cf455830af687932b
parent a410143de646ed4bc6c5324305d6a8a844da1ead
Author: Jan Dankert <devnull@localhost>
Date:   Fri, 12 Apr 2013 10:58:30 +0200

Ausdruck "Dynamische Klasse" umbenannt in "Makro".

Diffstat:
action/ElementAction.class.php | 5+++--
dynamicClasses/Album.class.php | 93-------------------------------------------------------------------------------
dynamicClasses/Atom.class.php | 140-------------------------------------------------------------------------------
dynamicClasses/BlockMenu.class.php | 137-------------------------------------------------------------------------------
dynamicClasses/BreadCrumb.class.php | 104-------------------------------------------------------------------------------
dynamicClasses/CSVTable.class.php | 86-------------------------------------------------------------------------------
dynamicClasses/ClassicMenu.class.php | 119-------------------------------------------------------------------------------
dynamicClasses/CommonMenu.class.php | 101-------------------------------------------------------------------------------
dynamicClasses/DoiMenu.class.php | 131-------------------------------------------------------------------------------
dynamicClasses/GoogleMaps.class.php | 64----------------------------------------------------------------
dynamicClasses/LanguageLinksForPage.class.php | 71-----------------------------------------------------------------------
dynamicClasses/LastPage.class.php | 80-------------------------------------------------------------------------------
dynamicClasses/ListMenu.class.php | 115-------------------------------------------------------------------------------
dynamicClasses/MainMenu.class.php | 81-------------------------------------------------------------------------------
dynamicClasses/NextPage.class.php | 86-------------------------------------------------------------------------------
dynamicClasses/OpenStreetMap.class.php | 64----------------------------------------------------------------
dynamicClasses/PagesNavigation.class.php | 79-------------------------------------------------------------------------------
dynamicClasses/RSSCreate.class.php | 171-------------------------------------------------------------------------------
dynamicClasses/RSSReader.class.php | 181-------------------------------------------------------------------------------
dynamicClasses/Sitemap.class.php | 118-------------------------------------------------------------------------------
dynamicClasses/TeaserList.class.php | 114-------------------------------------------------------------------------------
dynamicClasses/Youtube.class.php | 60------------------------------------------------------------
macro/Album.class.php | 93+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
macro/Atom.class.php | 140+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
macro/BlockMenu.class.php | 137+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
macro/BreadCrumb.class.php | 104+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
macro/CSVTable.class.php | 86+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
macro/ClassicMenu.class.php | 119+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
macro/CommonMenu.class.php | 101+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
macro/DoiMenu.class.php | 131+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
macro/GoogleMaps.class.php | 64++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
macro/LanguageLinksForPage.class.php | 71+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
macro/LastPage.class.php | 80+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
macro/ListMenu.class.php | 115+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
macro/MainMenu.class.php | 81+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
macro/NextPage.class.php | 86+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
macro/OpenStreetMap.class.php | 64++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
macro/PagesNavigation.class.php | 79+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
macro/RSSCreate.class.php | 171+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
macro/RSSReader.class.php | 181+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
macro/Sitemap.class.php | 118+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
macro/TeaserList.class.php | 114+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
macro/Youtube.class.php | 60++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
model/Value.class.php | 6+++---
util/Code.class.php | 4++--
util/Macro.class.php | 180+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
util/include.inc.php | 2+-
47 files changed, 2384 insertions(+), 2203 deletions(-)

diff --git a/action/ElementAction.class.php b/action/ElementAction.class.php @@ -262,10 +262,11 @@ class ElementAction extends Action $convertToLang = true; break; + case 'macro' : case 'dynamic': - + $files = Array(); - $handle = opendir ('./dynamicClasses'); + $handle = opendir ('./macro'); while ( $file = readdir($handle) ) { $file = substr($file,0,strlen($file)-10); diff --git a/dynamicClasses/Album.class.php b/dynamicClasses/Album.class.php @@ -1,92 +0,0 @@ -<?php -// OpenRat Content Management System -// Copyright (C) 2002-2012 Jan Dankert, cms@jandankert.de -// -// This program is free software; you can redistribute it and/or -// modify it under the terms of the GNU General Public License -// as published by the Free Software Foundation; either version 2 -// of the License, or (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - - - -/** - * Erzeugt eine Bilder-Liste. - * - * Die Ordner-Id kann als Parameter "folderid" übergeben werden. - * Falls nicht, wird der aktuelle Ordner, in dem sich die Seite - * befindet, benutzt. - * - * Es wird eine Definitionsliste mit der CSS-Klasse "album" erzeugt, damit - * bequem eine Auszeichnung per CSS erfolgen kann. - * - * Beispiel: - * <dl class="album"> - * <dt><img src="bild.jpg" width=".." .. /></dt> - * <dd>Beschreibung</dd> - * </dl> - * - * @author Jan Dankert - */ -class Album extends Dynamic -{ - /** - * Bitte immer alle Parameter in dieses Array schreiben, dies ist fuer den Web-Developer hilfreich. - * @type String - */ - var $parameters = Array( - 'folderid' - ); - - /** - * Bitte immer eine Beschreibung benutzen, dies ist fuer den Web-Developer hilfreich. - * @type String - */ - var $description = 'Creates an album.'; - - var $folderid = 0; - - /** - */ - function execute() - { - if ( intval($this->folderid)!=0 ) - $folderid = $this->folderid; - else - $folderid = $this->page->parentid; - //Html::debug($folderid); - - $f = new Folder($folderid); - - $files = $f->getFiles(); - - $this->output('<dl class="album">'); - - foreach( $files as $fileid ) - { - $file = new File($fileid); - $file->load(); - - if ( $file->isImage() ) - { - $file->getImageSize(); - $img = '<img src="'.$this->pathToObject($fileid).'" alt="'.$file->name.'" width="'.$file->width.'" height="'.$file->height.'" />'; - $this->output('<dt>'.$img.'</dt><dd>'.$file->desc.'</dd>'); - } - - } - - $this->output('</dl>'); - } - -} - -?>- \ No newline at end of file diff --git a/dynamicClasses/Atom.class.php b/dynamicClasses/Atom.class.php @@ -1,139 +0,0 @@ -<?php -// --------------------------------------------------------------------------- -// $Id$ -// --------------------------------------------------------------------------- -// OpenRat Content Management System -// Copyright (C) 2002 Jan Dankert, jandankert@jandankert.de -// -// This program is free software; you can redistribute it and/or -// modify it under the terms of the GNU General Public License -// as published by the Free Software Foundation; either version 2 -// of the License, or (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -// --------------------------------------------------------------------------- - - - -/** - * Erstellen eines ATOM-Feeds - * @author Jan Dankert - */ -class Atom extends Dynamic -{ - /** - * Bitte immer alle Parameter in dieses Array schreiben, dies ist fuer den Web-Developer hilfreich. - * @type String - */ - var $parameters = Array( - 'folderid' =>'Id of the folder whose pages should go into the Atom-Feed, default: the root folder', - 'feed_url' =>'Url of the feed, default: blank', - 'feed_title' =>'Title of the feed, default: Name of folder', - 'feed_description'=>'Description of the feed, default: Description of folder' - ); - - var $folderid = 0; - - /** - * Bitte immer eine Beschreibung benutzen, dies ist fuer den Web-Developer hilfreich. - * @type String - */ - var $description = 'Creates an Atom-Feed of pages in a folder'; - var $api; - - var $feed_url = ''; - var $feed_title = ''; - var $feed_description = ''; - - // Erstellen des Hauptmenues - function execute() - { - $feed = array(); - - // Lesen des Root-Ordners - if ( intval($this->folderid) == 0 ) - $folder = new Folder( $this->getRootObjectId() ); - else - $folder = new Folder( intval($this->folderid) ); - - $folder->load(); - - if ( $this->feed_title == '' ) - $this->feed_title = $folder->name; - - if ( $this->feed_description == '' ) - $this->feed_description = $folder->desc; - - $feed['title' ] = $this->feed_title; - $feed['description'] = $this->feed_description; - $feed['url' ] = $this->feed_url; - $feed['items' ] = array(); - // Schleife ueber alle Inhalte des Root-Ordners - foreach( $folder->getObjectIds() as $id ) - { - if ( $id == $this->getObjectId() ) - continue; - $o = new Object( $id ); - $o->languageid = $this->page->languageid; - $o->load(); - if ( $o->isPage ) // Nur wenn Seite - { - $p = new Page( $id ); - $p->load(); - - $item = array(); - $item['title' ] = $p->name; - $item['description'] = $p->desc; - $item['date' ] = $p->lastchangeDate; - if ( empty($this->feed_url) ) - $item['link' ] = $this->pathToObject($id); - else - $item['link' ] = $this->feed_url; - - $feed['items'][] = $item; - } - } - - $feed = $this->atomFeed($feed); - - $this->output( $feed ); - } - - - function atomFeed($input, $stylesheet='') - { - $input["encoding"] = (empty($input["encoding"] ))?"UTF-8":$input["encoding"]; - $input["language"] = (empty($input["language"] ))?"en-us":$input["language"]; - - if ( empty($input['title' ])) $input['title' ] = ''; - if ( empty($input['description'])) $input['description'] = ''; - if ( empty($input['link' ])) $input['link' ] = ''; - $feed = '<?xml version="1.0" encoding="'.$input["encoding"].'"?>'; - $feed .= (!empty($stylesheet))?"\n".'<?xml-stylesheet type="text/xsl" href="'.$stylesheet.'"?>':""; - $feed .= <<<__RSS__ - - <feed xmlns="http://www.w3.org/2005/Atom"> - <title>{$input["title"]}</title> - -__RSS__; - foreach($input["items"] as $item) - { - if ( empty($item['title' ])) $item['title' ] = ''; - if ( empty($item['description'])) $item['description'] = ''; - $feed .= "\n<entry>\n<title>".$item["title"]."</title>"; - $feed .= "\n<summary><![CDATA[".$item["description"]."]]></summary>"; - $feed .= "\n<updated>".date('Y-m-d\TH:i:s\Z', $item["date"])."</updated>"; - $feed .= "\n<link href=\"".$item["link"]."\" />"; - $feed .= "\n</entry>\n"; - } - $feed .= "\n</feed>"; - return $feed; - } -}- \ No newline at end of file diff --git a/dynamicClasses/BlockMenu.class.php b/dynamicClasses/BlockMenu.class.php @@ -1,136 +0,0 @@ -<?php -// --------------------------------------------------------------------------- -// $Id$ -// --------------------------------------------------------------------------- -// OpenRat Content Management System -// Copyright (C) 2002 Jan Dankert, jandankert@jandankert.de -// -// This program is free software; you can redistribute it and/or -// modify it under the terms of the GNU General Public License -// as published by the Free Software Foundation; either version 2 -// of the License, or (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// 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.2 2004-12-25 21:05:14 dankert -// erbt von Klasse Dynamic -// -// Revision 1.1 2004/10/14 21:16:12 dankert -// Erzeugen eines Menues in Bloecken -// -// --------------------------------------------------------------------------- - - - -/** - * Erstellen eines Hauptmenues - * @author Jan Dankert - */ -class BlockMenu extends Dynamic -{ - /** - * Bitte immer alle Parameter in dieses Array schreiben, dies ist fuer den Web-Developer hilfreich. - * @type String - */ - var $parameters = Array( - 'arrowChar'=>'String between menu entries, default: "&middot;"' - ); - - - var $arrowChar = ' &middot; '; - - /** - * Bitte immer eine Beschreibung benutzen, dies ist fuer den Web-Developer hilfreich. - * @type String - */ - var $description = 'Creates a main menu.'; - var $version = '$Id$'; - var $api; - - // Erstellen des Hauptmenues - function execute() - { - // Erstellen des Hauptmenues - - // Lesen des Root-Ordners - $folder = new Folder( $this->getRootObjectId() ); - - // Schleife ueber alle Inhalte des Root-Ordners - foreach( $folder->getObjectIds() as $id ) - { - $o = new Object( $id ); - $o->languageid = $this->page->languageid; - $o->load(); - if ( $o->isFolder ) // Nur wenn Ordner - { - $f = new Folder( $id ); - - // Ermitteln eines Objektes mit dem Dateinamen index - $oid = $f->getObjectIdByFileName('index'); - - if ( count($f->getLinks())+count($f->getPages()) > 0 ) - { - $this->output( ' - <!-- sidebox --> - <table bgcolor="#000000" border="0" cellpadding="0" cellspacing="0" width="100%"> - <tr> - <td> - <table border="0" cellpadding="3" cellspacing="1" width="100%"> - <tr> - <td bgcolor="#cccccc"><span class="title"> '.$o->name.'</span></a> - </td> - </tr> - <tr> - <td bgcolor="#ffffff"> - '); - // Untermenue - // Schleife ber alle Objekte im aktuellen Ordner - foreach( $f->getObjectIds() as $xid ) - { - $o = new Object( $xid ); - $o->languageid = $this->page->languageid; - $o->load(); - - // Nur Seiten anzeigen - if (!$o->isPage && !$o->isLink ) continue; - - // Wenn aktuelle Seite, dann markieren, sonst Link - if ( $this->getObjectId() == $xid ) - { - // aktuelle Seite - $this->output( ' <span class="small">o</span> - <strong class="nav">'.$o->name.'</strong> - <br />' ); - } - else - { - $this->output( ' <span class="small">o</span> - <a class="nav" href="'.$this->page->path_to_object($xid).'">'.$o->name.'</a> - <br />' ); - } - //Api::output( '<br/>' ); - } - - $this->output( ' - </td> - </tr> - </table> - </td> - </tr> - </table> - <!-- end sidebox --> - <br /> - ' ); - } - } - } - } -}- \ No newline at end of file diff --git a/dynamicClasses/BreadCrumb.class.php b/dynamicClasses/BreadCrumb.class.php @@ -1,103 +0,0 @@ -<?php -// --------------------------------------------------------------------------- -// $Id$ -// --------------------------------------------------------------------------- -// OpenRat Content Management System -// Copyright (C) 2002 Jan Dankert, jandankert@jandankert.de -// -// This program is free software; you can redistribute it and/or -// modify it under the terms of the GNU General Public License -// as published by the Free Software Foundation; either version 2 -// of the License, or (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// 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.3 2007-11-30 23:25:25 dankert -// Das Men? in der Sprache der zu ver?ffentlichenden Seite erzeugen. -// -// Revision 1.2 2005/01/04 19:59:55 dankert -// Allgemeine Korrekturen, Erben von "Dynamic"-klasse -// -// Revision 1.1 2004/11/10 22:43:35 dankert -// Beispiele fuer dynamische Templateelemente -// -// --------------------------------------------------------------------------- - - - -/** - * Erstellen einer sog. Brotkruemel-Navigation - * @author Jan Dankert - */ -class BreadCrumb extends Dynamic -{ - /** - * Bitte immer alle Parameter in dieses Array schreiben, dies ist fuer den Web-Developer hilfreich. - * @type String - */ - var $parameters = Array( - 'beforeEntry'=>'Chars before an active menu entry' - ); - - /** - * Bitte immer eine Beschreibung benutzen, dies ist fuer den Web-Developer hilfreich. - * @type String - */ - var $description = 'Creates a main menu.'; - - - /** - * Zeichenkette, die vor einem aktiven Menuepunkt gezeigt wird - */ - var $beforeEntry = '&raquo;'; - - var $api; - - /** - * Erstellen einer BreadCrumb-Navigation. - */ - function execute() - { - // Erstellen eines Untermenues - - // Ermitteln der aktuellen Seite - $f = new Folder($this->page->parentid); - $parentIds = $f->parentObjectFileNames(false,true); - $lastoid = 0; - - foreach( $parentIds as $oid=>$filename ) - { - $of = new Folder($oid); - $of->languageid = $this->page->languageid; - $of->load(); - $pl = $of->getFirstPageOrLink(); - - $this->output( $this->beforeEntry ); - - if ( is_object($pl) && $pl->objectid != $this->page->objectid ) - $this->output('<a href="'.$this->pathToObject($pl->objectid).'" class="breadcrumb">'.$of->name.'</a>' ); - else - $this->output('<span class="breadcrumb">'.$of->name.'</span>' ); - - if ( is_object($pl) ) - $lastoid = $pl->objectid; - } - - if ( $lastoid != $this->page->objectid ) - { - $this->output( $this->beforeEntry ); - $this->output('<span class="breadcrumb">'.$this->page->name.'</span>' ); - } - - } -} - -?>- \ No newline at end of file diff --git a/dynamicClasses/CSVTable.class.php b/dynamicClasses/CSVTable.class.php @@ -1,85 +0,0 @@ -<?php -// OpenRat Content Management System -// Copyright (C) 2002-2012 Jan Dankert, cms@jandankert.de -// -// This program is free software; you can redistribute it and/or -// modify it under the terms of the GNU General Public License -// as published by the Free Software Foundation; either version 2 -// of the License, or (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - - - -/** - * Aus einer CSV-Datei wird eine HTML-Tabelle erstellt. - * - * @author Jan Dankert - */ -class CSVList extends Dynamic -{ - /** - * Id der Datei, welche die Werte enthält. - * @var unknown_type - */ - var $fileid = 0; - - /** - * CSS-Klasse der Tabelle. - * @var unknown_type - */ - var $css_class = 'table'; - - /** - * Trennzeichen (Default: Komma). - * @var unknown_type - */ - var $seperator = ','; - - /** - * Bitte immer eine Beschreibung benutzen, dies ist fuer den Web-Developer hilfreich. - * @type String - */ - var $description = 'Creates a HTML-table from a CSV-file'; - - - - function execute() - { - $this->output('<table class="'.$this->css_class.'">'); - - // Datei lesen - $file = new File( $this->fileid ); - $values = $file->loadValue(); - - // In einzelne Zeilen zerlegen. - $lines = explode("\n",$values); - - foreach( $lines as $line ) - { - $this->output('<tr>'); - - // In einzelne Spalten zerlegen. - $columns = explode($seperator,$line); - foreach( $columns as $column ) - { - $this->output('<td>' ); - $this->output($column); - $this->output('</td>'); - } - $this->output('</tr>'); - } - - $this->output('</table>'); - } -} - - -?>- \ No newline at end of file diff --git a/dynamicClasses/ClassicMenu.class.php b/dynamicClasses/ClassicMenu.class.php @@ -1,118 +0,0 @@ -<?php -// OpenRat Content Management System -// Copyright (C) 2002-2012 Jan Dankert, cms@jandankert.de -// -// This program is free software; you can redistribute it and/or -// modify it under the terms of the GNU General Public License -// as published by the Free Software Foundation; either version 2 -// of the License, or (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - - - -/** - * Erstellen eines Menues - * @author Jan Dankert - */ -class ClassicMenu extends Dynamic -{ - /** - * Beschreibung dieser Klasse - * @type String - */ - var $description = 'This is a dynamic Menue which contains all pages. Folders are opened when useful. Nice standard menu :-)'; - - - /** - * Zeichenkette, die vor einem aktiven Menuepunkt gezeigt wird - */ - var $beforeEntry = '<li><strong>'; - var $afterEntry = '</strong></li>'; - var $csspraefix = 'menu'; - var $onlySameTemplate = true; - - - // Erstellen des Hauptmenues - function execute() - { - $rootId = $this->getRootObjectId(); - // Erstellen eines Untermenues - - $f = new Folder( $this->page->parentid ); - $this->parentFolders = $f->parentObjectFileNames(false,true); - - $this->showFolder( $rootId,0 ); - } - - function showFolder( $oid,$level ) - { - $this->outputLn('<ul class="'.$this->csspraefix.$level.'">'); - $f = new Folder( $oid ); - - // Schleife ueber alle Objekte im aktuellen Ordner - foreach( $f->getObjects() as $o ) - { - $o->languageid = $this->page->languageid; - $o->load(); - - // Ordner anzeigen - if ($o->isFolder ) - { - $nf = new Folder($o->objectid); - $fp = $nf->getFirstPageOrLink(); - - if ( is_object($fp) ) - { - - // Wenn aktuelle Seite, dann markieren, sonst Link - if ( $this->page->objectid == $fp->objectid ) - // aktuelle Seite - $this->outputLn( '<li class="'.$this->csspraefix.$level.'"><strong class="'.$this->csspraefix.$level.'">'.$o->name.'</strong>' ); - else - // Link erzeugen - $this->outputLn( '<li class="'.$this->csspraefix.$level.'"><a class="'.$this->csspraefix.$level.'" href="'.$this->pathToObject($fp->objectid).'">'.$o->name.'</a>' ); - - if ( in_array($o->objectid,array_keys($this->parentFolders)) ) - { - $this->showFolder($o->objectid,$level+1); - } - - $this->outputLn( '</li>' ); - } - } - - if ($o->isPage) - { - $page = new Page($o->objectid); - $page->load(); - if ( $page->templateid != $this->page->templateid && $this->onlySameTemplate ) - continue; - } - - // Seiten und Verknuepfungen anzeigen - if ($o->isPage || $o->isLink ) - { - // Wenn aktuelle Seite, dann markieren, sonst Link - if ( $this->getObjectId() == $o->objectid) - // aktuelle Seite - $this->output( '<li class="'.$this->csspraefix.$level.'"><strong class="'.$this->csspraefix.$level.'">'.$o->name.'</strong></li>' ); - elseif ( $o->isLink ) - // Link mit HTML-Sonderzeichenumwandlung erzeugen - $this->output( '<li class="'.$this->csspraefix.$level.'"><a class="'.$this->csspraefix.$level.'" href="'.htmlspecialchars($this->pathToObject($o->objectid)).'">'.$o->name.'</a></li>' ); - else - // Link erzeugen - $this->output( '<li class="'.$this->csspraefix.$level.'"><a class="'.$this->csspraefix.$level.'" href="'.$this->pathToObject($o->objectid).'">'.$o->name.'</a></li>' ); - } - } - $this->output('</ul>'); - } - -}- \ No newline at end of file diff --git a/dynamicClasses/CommonMenu.class.php b/dynamicClasses/CommonMenu.class.php @@ -1,100 +0,0 @@ -<?php -// --------------------------------------------------------------------------- -// $Id$ -// --------------------------------------------------------------------------- -// OpenRat Content Management System -// Copyright (C) 2002 Jan Dankert, jandankert@jandankert.de -// -// This program is free software; you can redistribute it and/or -// modify it under the terms of the GNU General Public License -// as published by the Free Software Foundation; either version 2 -// of the License, or (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// 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.3 2004-12-19 22:35:23 dankert -// Parameter -Angabe -// -// Revision 1.2 2004/12/19 15:19:29 dankert -// Klasse erbt von "Dynamic" -// -// Revision 1.1 2004/11/10 22:43:35 dankert -// Beispiele fuer dynamische Templateelemente -// -// --------------------------------------------------------------------------- - - - -/** - * Erstellen eines Menues - * @author Jan Dankert - */ -class CommonMenu extends Dynamic -{ - /** - * Bitte immer alle Parameter in dieses Array schreiben, dies ist fuer den Web-Developer hilfreich. - * @type String - */ - var $parameters = Array( - 'beforeEntry'=>'Chars before an active menu entry', - 'afterEntry' =>'Chars after an active menu entry' - ); - - /** - * Bitte immer eine Beschreibung benutzen, dies ist fuer den Web-Developer hilfreich. - * @type String - */ - var $description = 'Creates a main menu.'; - - - /** - * Zeichenkette, die vor einem aktiven Menuepunkt gezeigt wird - */ - var $beforeEntry = '<li><strong>'; - var $afterEntry = '</strong></li>'; - - - // Erstellen des Hauptmenues - function execute() - { - // Erstellen eines Untermenues - - // Ermitteln der aktuellen Seite - $thispage = new Page( $this->getObjectId() ); - $thispage->load(); // Seite laden - - // uebergeordneter Ordner dieser Seite - $f = new Folder( $thispage->parentid ); - - // Schleife ueber alle Objekte im aktuellen Ordner - foreach( $f->getObjectIds() as $id ) - { - $o = new Object( $id ); - $o->languageid = $this->page->languageid; - $o->load(); - - // Nur Seiten anzeigen - if (!$o->isPage && !$o->isLink ) continue; - - // Wenn aktuelle Seite, dann markieren, sonst Link - if ( $this->getObjectId() == $id ) - { - // aktuelle Seite - $this->output( '<li><strong>'.$o->name.'</strong></li>' ); - } - else - { - // Link erzeugen - $this->output( '<li><a href="'.$this->page->path_to_object($id).'">'.$o->name.'</a></li>' ); - } - } - } -}- \ No newline at end of file diff --git a/dynamicClasses/DoiMenu.class.php b/dynamicClasses/DoiMenu.class.php @@ -1,130 +0,0 @@ -<?php -// --------------------------------------------------------------------------- -// $Id$ -// --------------------------------------------------------------------------- -// OpenRat Content Management System -// Copyright (C) 2002 Jan Dankert, jandankert@jandankert.de -// -// This program is free software; you can redistribute it and/or -// modify it under the terms of the GNU General Public License -// as published by the Free Software Foundation; either version 2 -// of the License, or (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// 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.1 2005-01-04 20:31:52 dankert -// Neues Menue -// -// Revision 1.1 2005/01/04 20:00:12 dankert -// Darstellung eines DHTML-Menues -// -// Revision 1.2 2004/12/28 22:57:56 dankert -// Korrektur Vererbung, "api" ausgebaut -// -// Revision 1.1 2004/10/14 21:15:29 dankert -// Erzeugen und Anzeigen einer Sitemap -// -// --------------------------------------------------------------------------- - - - -/** - * Erstellen eines DHTML-Menues (DoiMenu) - * - * Diese Klasse erzeugt Javascript-Code fuer das DoiMenu - * - * @see http://doimenu.sf.net for details - * @author Jan Dankert - */ -class DoiMenu extends Dynamic -{ - /** - * Bitte immer eine Beschreibung benutzen, dies ist fuer den Web-Developer hilfreich. - * @type String - */ - var $description = 'You *have to* include doiMenuDOM.js in the page!<br/>Put the code below in head section:<br/><tt>&lt;script type="text/javascript" src="{{your-elementname}}.js"&gt;&lt;/script&gt;</tt><br/>The file is distributed with OpenRat'; - - - /** - * Parameter mit Objekt-Id - * Die Datei mit dieser Id enthaelt Parameter fuer das Menu - */ - var $parameterFileId = 0; - - /** - * Ausrichtung des Menues. - * available value : 'horizontal','vertical'. - */ - var $direction = 'horizontal'; - - - /** - * Erstellen des DHTML-Menues - */ - function execute() - { - // Erstellen eines Untermenues - - // Ermitteln der aktuellen Seite - $thispage = new Page( $this->getObjectId() ); - $thispage->load(); // Seite laden - - $this->outputLn('<script name="javascript" type="text/javascript">'); - - $this->outputLn(" var menu = new TMainMenu('menu','".$this->direction."');"); - - $ro = new Folder($this->getRootObjectId()); - $this->showFolder( $ro ); - - if ( intval( $this->parameterFileId ) != 0 ) - { - $f = new File( intval($this->parameterFileId) ); - $this->outputLn( $f->loadValue() ); - } - - $this->outputLn( ' menu.Build()' ); - $this->outputLn( '</script'); - } - - - function showFolder( $fo ) - { - if ( $fo->objectid == intval($this->getRootObjectId()) ) - $parentMenu = 'menu'; - else - $parentMenu = 'menu'.$fo->objectid; - - foreach( $fo->getObjects() as $o ) - { - $menu = 'menu'.$o->objectid; - - if ( $o->isFolder ) - { $nf = new Folder($o->objectid); - $pl = $nf->getFirstPageOrLink(); - if ( is_object($pl) ) - { - $this->outputLn(" var $menu = new TPopMenu('".$o->name."','','a','".$this->pathToObject($pl->objectid)."','".$o->desc."');"); - $this->outputLn(" $parentMenu.Add(menu".$o->objectid.");"); - $this->showFolder( $nf ); - } - } - - if ( $o->isPage || $o->isPage ) - { - $this->outputLn(" var $menu = new TPopMenu('".$o->name."','','a','".$this->pathToObject($o->objectid)."','".$o->desc."');"); - $this->outputLn(" $parentMenu.Add(menu".$o->objectid.");"); - } - } - } - -} - -?>- \ No newline at end of file diff --git a/dynamicClasses/GoogleMaps.class.php b/dynamicClasses/GoogleMaps.class.php @@ -1,63 +0,0 @@ -<?php -// --------------------------------------------------------------------------- -// $Id$ -// --------------------------------------------------------------------------- -// OpenRat Content Management System -// Copyright (C) 2002 Jan Dankert, jandankert@jandankert.de -// -// This program is free software; you can redistribute it and/or -// modify it under the terms of the GNU General Public License -// as published by the Free Software Foundation; either version 2 -// of the License, or (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -// --------------------------------------------------------------------------- - - - -/** - * Bindet eine Google-Maps-Karte ein. - * - * @author Jan Dankert - */ -class GoogleMaps extends Dynamic -{ - /** - * Bitte immer alle Parameter in dieses Array schreiben, dies ist fuer den Web-Developer hilfreich. - * @type String - */ - var $parameters = Array( - 'lat' => 'Latitude', - 'long' => 'Longitude', - 'zoom' => 'Zoom' - ); - - /** - * Bitte immer eine Beschreibung benutzen, dies ist fuer den Web-Developer hilfreich. - * @type String - */ - var $description = 'Includes a Google Map.'; - - var $long = 10; // Default: Hamburg - var $lat = 53.55; // Default: Hamburg - var $zoom = 10; - var $width = 425; - var $height = 350; - - /** - */ - function execute() - { - $this->output('<iframe width="'.$this->width.'" height="'.$this->height.'" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="http://maps.google.de/?ie=UTF8&amp;ll='.$this->lat.','.$this->long.'&amp;z='.$this->zoom.'&amp;output=embed"></iframe>'); - } - -} - -?>- \ No newline at end of file diff --git a/dynamicClasses/LanguageLinksForPage.class.php b/dynamicClasses/LanguageLinksForPage.class.php @@ -1,70 +0,0 @@ -<?php -// --------------------------------------------------------------------------- -// $Id$ -// --------------------------------------------------------------------------- -// OpenRat Content Management System -// Copyright (C) 2012 Tobias Schöne tobias@schoenesnetz.de -// -// This program is free software; you can redistribute it and/or -// modify it under the terms of the GNU General Public License -// as published by the Free Software Foundation; either version 2 -// of the License, or (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -// --------------------------------------------------------------------------- -// $Log$ -// --------------------------------------------------------------------------- -/** - * Erstellen einer Liste von Language-Links auf die selbe Seite - * @author Tobias Schoene - */ -class LanguageLinksForPage extends Dynamic -{ - /** - * Bitte immer alle Parameter in dieses Array schreiben, dies ist fuer den Web-Developer hilfreich. - * @type String - */ - var $parameters = Array( - 'arrowChar'=>'String between entries' - ); - - - var $arrowChar = ' &middot; '; - - /** - * Bitte immer eine Beschreibung benutzen, dies ist fuer den Web-Developer hilfreich. - * @type String - */ - var $description = 'Creates language links to the page.'; - var $version = '$Id$'; - var $api; - - // Build the navigation links to other languages - function execute() - { - // current language - $languageId = $this->page->languageid; - - // Schleife ueber alle Inhalte des Root-Ordners - foreach( Language::getAll() as $lid=>$lname) - { - - $l = new Language( $lid ); - $l->load(); - $this->page->languageid = $l->languageid; - $filename = $this->page->full_filename(); - $filename = str_replace($this->page->path(),".",$filename); - $this->output( '<li><a href="'.$filename.'">'.strtolower($l->isoCode).'</a></li>' ); - - } - $this->page->languageid = $languageId; - } -} -?>- \ No newline at end of file diff --git a/dynamicClasses/LastPage.class.php b/dynamicClasses/LastPage.class.php @@ -1,79 +0,0 @@ -<?php -// --------------------------------------------------------------------------- -// $Id$ -// --------------------------------------------------------------------------- -// OpenRat Content Management System -// Copyright (C) 2002 Jan Dankert, jandankert@jandankert.de -// -// This program is free software; you can redistribute it and/or -// modify it under the terms of the GNU General Public License -// as published by the Free Software Foundation; either version 2 -// of the License, or (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// 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.2 2005-01-04 19:59:55 dankert -// Allgemeine Korrekturen, Erben von "Dynamic"-klasse -// -// Revision 1.1 2004/11/10 22:43:35 dankert -// Beispiele fuer dynamische Templateelemente -// -// --------------------------------------------------------------------------- - - - -/** - * Erstellen eines Links zur Seite davor - * @author Jan Dankert - */ -class LastPage extends Dynamic -{ - /** - * Bitte immer alle Parameter in dieses Array schreiben, dies ist fuer den Web-Developer hilfreich. - * @type String - */ - var $parameters = Array( - 'arrowChar'=>'String between menu entries, default: "&middot;"' - ); - - - var $arrowChar = ' &middot; '; - - /** - * Bitte immer eine Beschreibung benutzen, dies ist fuer den Web-Developer hilfreich. - * @type String - */ - var $description = 'Creates a main menu.'; - var $version = '$Id$'; - - - function execute() - { - $folder = new Folder( $this->page->parentid ); - - $lastObject = null; - - // Schleife ueber alle Inhalte des Ordners - foreach( $folder->getObjects() as $o ) - { - if ( $o->isPage || $o->isLink ) - { - if ( is_object($lastObject) && $o->objectid == $this->page->objectid ) - { - $this->output( '<a href="'.$this->pathToObject($lastObject->objectid).' class="next">'.$lastObject->name.'</a>' ); - break; - } - - $lastObject = $o->objectid; - } - } - } -}- \ No newline at end of file diff --git a/dynamicClasses/ListMenu.class.php b/dynamicClasses/ListMenu.class.php @@ -1,114 +0,0 @@ -<?php -// --------------------------------------------------------------------------- -// $Id$ -// --------------------------------------------------------------------------- -// OpenRat Content Management System -// Copyright (C) 2002 Jan Dankert, jandankert@jandankert.de -// -// This program is free software; you can redistribute it and/or -// modify it under the terms of the GNU General Public License -// as published by the Free Software Foundation; either version 2 -// of the License, or (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// 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.1 2005-01-28 23:06:10 dankert -// Neues Menue in Listenform (HTML-Listen), aehnlich "BlockMenu" -// -// Revision 1.2 2004/12/25 21:05:14 dankert -// erbt von Klasse Dynamic -// -// Revision 1.1 2004/10/14 21:16:12 dankert -// Erzeugen eines Menues in Bloecken -// -// --------------------------------------------------------------------------- - - - -/** - * Erstellen eines Hauptmenues - * @author Jan Dankert - */ -class ListMenu extends Dynamic -{ - /** - * Bitte immer alle Parameter in dieses Array schreiben, dies ist fuer den Web-Developer hilfreich. - * @type String - */ - var $parameters = Array( - 'arrowChar'=>'String between menu entries, default: "&middot;"' - ); - - - var $arrowChar = ' &middot; '; - - /** - * Bitte immer eine Beschreibung benutzen, dies ist fuer den Web-Developer hilfreich. - * @type String - */ - var $description = 'Creates a main menu.'; - var $version = '$Id$'; - var $api; - - // Erstellen des Hauptmenues - function execute() - { - // Erstellen des Hauptmenues - - // Lesen des Root-Ordners - $folder = new Folder( $this->getRootObjectId() ); - - // Schleife ueber alle Inhalte des Root-Ordners - foreach( $folder->getObjectIds() as $id ) - { - $o = new Object( $id ); - $o->languageid = $this->page->languageid; - $o->load(); - if ( $o->isFolder ) // Nur wenn Ordner - { - $f = new Folder( $id ); - $f->load(); - - // Ermitteln eines Objektes mit dem Dateinamen index -// $oid = $f->getObjectIdByFileName('index'); - - if ( count($f->getLinks())+count($f->getPages()) > 0 ) - { - $this->output( '<h1 class="title">'.$o->name.'</h1><ul>'); - // Untermenue - // Schleife ber alle Objekte im aktuellen Ordner - foreach( $f->getObjectIds() as $xid ) - { - $o = new Object( $xid ); - $o->languageid = $this->page->languageid; - $o->load(); - - // Nur Seiten und Verknuepfungen anzeigen - if (!$o->isPage && !$o->isLink ) continue; - - // Wenn aktuelle Seite, dann markieren, sonst Link - if ( $this->getObjectId() == $xid ) - { - // aktuelle Seite - $this->output( '<li class="menu">'.$o->name.'</li>' ); - } - else - { - $this->output( '<li class="menu"><a class="menu" href="'.$this->page->path_to_object($xid).'">'.$o->name.'</a></li>' ); - } - } - - $this->output( '</ul><br />' ); - } - } - } - } -}- \ No newline at end of file diff --git a/dynamicClasses/MainMenu.class.php b/dynamicClasses/MainMenu.class.php @@ -1,80 +0,0 @@ -<?php -// --------------------------------------------------------------------------- -// $Id$ -// --------------------------------------------------------------------------- -// OpenRat Content Management System -// Copyright (C) 2002 Jan Dankert, jandankert@jandankert.de -// -// This program is free software; you can redistribute it and/or -// modify it under the terms of the GNU General Public License -// as published by the Free Software Foundation; either version 2 -// of the License, or (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// 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.2 2004-12-19 15:19:16 dankert -// Klasse erbt von "Dynamic" -// -// Revision 1.1 2004/10/14 21:15:57 dankert -// Erzeugen eines Hauptmenues -// -// --------------------------------------------------------------------------- - - - -/** - * Erstellen eines Hauptmenues - * @author Jan Dankert - */ -class MainMenu extends Dynamic -{ - /** - * Bitte immer alle Parameter in dieses Array schreiben, dies ist fuer den Web-Developer hilfreich. - * @type String - */ - var $parameters = Array( - 'arrowChar'=>'String between menu entries, default: "&middot;"' - ); - - - var $arrowChar = ' &middot; '; - - /** - * Bitte immer eine Beschreibung benutzen, dies ist fuer den Web-Developer hilfreich. - * @type String - */ - var $description = 'Creates a main menu.'; - var $version = '$Id$'; - - // Erstellen des Hauptmenues - function execute() - { - // Lesen des Root-Ordners - $folder = new Folder( $this->getRootObjectId() ); - - // Schleife ueber alle Inhalte des Root-Ordners - foreach( $folder->getObjectIds() as $id ) - { - $o = new Object( $id ); - $o->languageid = $this->page->languageid; - $o->load(); - if ( $o->isFolder ) // Nur wenn Ordner - { - $f = new Folder( $id ); - - // Ermitteln eines Objektes mit dem Dateinamen index - $oid = $f->getObjectIdByFileName('index'); - if ( is_numeric($oid) && $oid!=0 ) - $this->output( $this->arrowChar.'<a href="'.$this->page->path_to_object($oid).'" title="'.$o->desc.'">'.$o->name.'</a>' ); - } - } - } -}- \ No newline at end of file diff --git a/dynamicClasses/NextPage.class.php b/dynamicClasses/NextPage.class.php @@ -1,85 +0,0 @@ -<?php -// --------------------------------------------------------------------------- -// $Id$ -// --------------------------------------------------------------------------- -// OpenRat Content Management System -// Copyright (C) 2002 Jan Dankert, jandankert@jandankert.de -// -// This program is free software; you can redistribute it and/or -// modify it under the terms of the GNU General Public License -// as published by the Free Software Foundation; either version 2 -// of the License, or (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// 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.2 2005-01-04 19:59:55 dankert -// Allgemeine Korrekturen, Erben von "Dynamic"-klasse -// -// Revision 1.1 2004/11/10 22:43:35 dankert -// Beispiele fuer dynamische Templateelemente -// -// --------------------------------------------------------------------------- - - - -/** - * Erstellen eines Links zur naechsten Seite - * @author Jan Dankert - */ -class NextPage extends Dynamic -{ - /** - * Bitte immer alle Parameter in dieses Array schreiben, dies ist fuer den Web-Developer hilfreich. - * @type String - */ - var $parameters = Array( - 'arrowChar'=>'String between menu entries, default: "&middot;"' - ); - - - var $arrowChar = ' &middot; '; - - /** - * Bitte immer eine Beschreibung benutzen, dies ist fuer den Web-Developer hilfreich. - * @type String - */ - var $description = 'Creates a main menu.'; - var $version = '$Id$'; - var $api; - - - function execute() - { - // Lesen des Ordners - $folder = new Folder( $this->page->parentid ); - - $was = false; - - // Schleife ueber alle Inhalte des Root-Ordners - foreach( $folder->getObjects() as $o ) - { - if ( $o->isPage || $o->isLink ) // Nur wenn Ordner - { - if ( $o->objectid == $this->page->objectid ) - { - $was = true; - continue; - } - - if ( $was ) - { - $this->output( '<a href="'.$this->pathToObject($o->objectid).' class="next">'.$o->name.'</a>' ); - break; - } - } - } - } -}- \ No newline at end of file diff --git a/dynamicClasses/OpenStreetMap.class.php b/dynamicClasses/OpenStreetMap.class.php @@ -1,63 +0,0 @@ -<?php -// --------------------------------------------------------------------------- -// $Id$ -// --------------------------------------------------------------------------- -// OpenRat Content Management System -// Copyright (C) 2002 Jan Dankert, jandankert@jandankert.de -// -// This program is free software; you can redistribute it and/or -// modify it under the terms of the GNU General Public License -// as published by the Free Software Foundation; either version 2 -// of the License, or (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -// --------------------------------------------------------------------------- - - - -/** - * Bindet die OpenStreetMap ein. - * - * @author Jan Dankert - */ -class OpenStreetMap extends Dynamic -{ - /** - * Bitte immer alle Parameter in dieses Array schreiben, dies ist fuer den Web-Developer hilfreich. - * @type String - */ - var $parameters = Array( - 'box' => 'coordinates', - 'layer' => 'mapnik', - 'width' => 'Width of iframe', - 'height' => 'Height of iframe', - ); - - /** - * Bitte immer eine Beschreibung benutzen, dies ist fuer den Web-Developer hilfreich. - * @type String - */ - var $description = 'Includes the OpenStreetMap.'; - - var $box = '9.9396,53.4821,10.184,53.643'; // default: Hamburg - var $layer = 'mapnik'; - var $width = 425; - var $height = 350; - - /** - */ - function execute() - { - $this->output('<iframe width="'.$this->width.'" height="'.$this->height.'" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="http://www.openstreetmap.org/export/embed.html?bbox='.$this->box.'&layer='.$this->layer.'" style="border: 1px solid black"></iframe>'); - } - -} - -?>- \ No newline at end of file diff --git a/dynamicClasses/PagesNavigation.class.php b/dynamicClasses/PagesNavigation.class.php @@ -1,78 +0,0 @@ -<?php -// --------------------------------------------------------------------------- -// $Id$ -// --------------------------------------------------------------------------- -// OpenRat Content Management System -// Copyright (C) 2002 Jan Dankert, jandankert@jandankert.de -// -// This program is free software; you can redistribute it and/or -// modify it under the terms of the GNU General Public License -// as published by the Free Software Foundation; either version 2 -// of the License, or (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// 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.2 2005-01-04 19:59:55 dankert -// Allgemeine Korrekturen, Erben von "Dynamic"-klasse -// -// Revision 1.1 2004/11/10 22:43:35 dankert -// Beispiele fuer dynamische Templateelemente -// -// --------------------------------------------------------------------------- - - - -/** - * Erstellen eines Hauptmenues - * @author Jan Dankert - */ -class PagesNavigation extends Dynamic -{ - /** - * Bitte immer alle Parameter in dieses Array schreiben, dies ist fuer den Web-Developer hilfreich. - * @type String - */ - var $parameters = Array( - 'arrowChar'=>'String between entries' - ); - - - var $arrowChar = ' &middot; '; - - /** - * Bitte immer eine Beschreibung benutzen, dies ist fuer den Web-Developer hilfreich. - * @type String - */ - var $description = 'Creates a page navigation.'; - var $version = '$Id$'; - var $api; - - // Erstellen des Hauptmenues - function execute() - { - // Lesen des Root-Ordners - $folder = new Folder( $this->page->parentid ); - - $nr = 0; - // Schleife ueber alle Inhalte des Root-Ordners - foreach( $folder->getObjects() as $o ) - { - $nr++; - if ( $o->isPage || $o->isLink ) - { - if ( $o->objectid != $this->page->objectid ) - $this->output( '<a href="'.$this->page->path_to_object($oid).'" title="'.$o->desc.'" class="pagenav">'.$nr.'</a>' ); - else - $this->output( '<strong>'.$nr.'</strong>' ); - } - } - } -}- \ No newline at end of file diff --git a/dynamicClasses/RSSCreate.class.php b/dynamicClasses/RSSCreate.class.php @@ -1,170 +0,0 @@ -<?php -// --------------------------------------------------------------------------- -// $Id$ -// --------------------------------------------------------------------------- -// OpenRat Content Management System -// Copyright (C) 2002 Jan Dankert, jandankert@jandankert.de -// -// This program is free software; you can redistribute it and/or -// modify it under the terms of the GNU General Public License -// as published by the Free Software Foundation; either version 2 -// of the License, or (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// 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.4 2009-03-16 23:30:02 dankert -// Unnötigen Aufruf von pathToObject entfernt. -// -// Revision 1.3 2007-11-17 02:19:29 dankert -// Erg?nzung der Version (Default: 0.91), Korrektur, Anpassung an neue API. -// -// Revision 1.2 2004/12/28 22:57:56 dankert -// Korrektur Vererbung, "api" ausgebaut -// -// Revision 1.1 2004/10/14 21:14:52 dankert -// Erzeugen eines RSS-Feeds aus einem Ordner -// -// --------------------------------------------------------------------------- - - - -/** - * Erstellen eines Hauptmenues - * @author Jan Dankert - */ -class RSSCreate extends Dynamic -{ - /** - * Bitte immer alle Parameter in dieses Array schreiben, dies ist fuer den Web-Developer hilfreich. - * @type String - */ - var $parameters = Array( - 'htmlentities' =>'Escape HTML-Tags in RSS-Feed, default: false', - 'folderid' =>'Id of the folder whose pages should go into the RSS-Feed, default: the root folder', - 'feed_url' =>'Url of the feed, default: blank', - 'feed_title' =>'Title of the feed, default: Name of folder', - 'feed_description'=>'Description of the feed, default: Description of folder' - ); - - var $htmlentities = false; - var $folderid = 0; - - /** - * Bitte immer eine Beschreibung benutzen, dies ist fuer den Web-Developer hilfreich. - * @type String - */ - var $description = 'Creates an RSS-Feed of pages in a folder'; - var $api; - - var $feed_version = '0.91'; - var $feed_url = ''; - var $feed_title = ''; - var $feed_description = ''; - - // Erstellen des Hauptmenues - function execute() - { - $feed = array(); - - // Lesen des Root-Ordners - if ( intval($this->folderid) == 0 ) - $folder = new Folder( $this->getRootObjectId() ); - else - $folder = new Folder( intval($this->folderid) ); - - $folder->load(); - - if ( $this->feed_title == '' ) - $this->feed_title = $folder->name; - - if ( $this->feed_description == '' ) - $this->feed_description = $folder->desc; - - $feed['title' ] = $this->feed_title; - $feed['description'] = $this->feed_description; - $feed['url' ] = $this->feed_url; - $feed['items' ] = array(); - - // Schleife ueber alle Inhalte des Root-Ordners - foreach( $folder->getObjectIds() as $id ) - { - if ( $id == $this->getObjectId() ) - continue; - $o = new Object( $id ); - $o->languageid = $this->page->languageid; - $o->load(); - if ( $o->isPage ) // Nur wenn Seite - { - $p = new Page( $id ); - $p->load(); - - $item = array(); - $item['title' ] = $p->name; - $item['description'] = $p->desc; - $item['pubDate' ] = $p->lastchangeDate; - if ( empty($this->feed_url) ) - $item['link' ] = $this->pathToObject($id); - else - $item['link' ] = $this->feed_url; - - $feed['items'][] = $item; - } - } - - $rss = $this->rss($feed); - - if ( $this->htmlentities ) - $rss = htmlentities( $rss ); - - $this->output( $rss ); - } - - - function rss($input, $stylesheet='') - { -// print_r($input); - // Builds the XML RSS schema using the array - $input["encoding"] = (empty($input["encoding"] ))?"UTF-8":$input["encoding"]; - $input["language"] = (empty($input["language"] ))?"en-us":$input["language"]; - - if ( empty($input['title' ])) $input['title' ] = ''; - if ( empty($input['description'])) $input['description'] = ''; - if ( empty($input['link' ])) $input['link' ] = ''; - $rss = '<?xml version="1.0" encoding="'.$input["encoding"].'"?>'; - $rss .= (!empty($stylesheet))?"\n".'<?xml-stylesheet type="text/xsl" href="'.$stylesheet.'"?>':""; - $rss .= <<<__RSS__ - - <rss version="{$this->feed_version}"> - <channel> - <title>{$input["title"]}</title> - <description>{$input["description"]}</description> - <link>{$input["link"]}</link> - <language>{$input["language"]}</language> - <generator></generator> - -__RSS__; - foreach($input["items"] as $item) - { - if ( empty($item['title' ])) $item['title' ] = ''; - if ( empty($item['description'])) $item['description'] = ''; - $data = date("r", $item["pubDate"]); - $rss .= "\n<item>\n<title>".$item["title"]."</title>"; - $rss .= "\n<description><![CDATA[".$item["description"]."]]></description>"; - if (!empty($item["pubDate"])) - $rss .= "\n<pubDate>".date("r", $item["pubDate"])."</pubDate>"; - if (!empty($item["link"])) - $rss .= "\n<link>".$item["link"]."</link>"; - $rss .= "\n</item>\n"; - } - $rss .= "\n</channel>\n</rss>"; - return $rss; - } -}- \ No newline at end of file diff --git a/dynamicClasses/RSSReader.class.php b/dynamicClasses/RSSReader.class.php @@ -1,180 +0,0 @@ -<?php -// --------------------------------------------------------------------------- -// $Id$ -// --------------------------------------------------------------------------- -// OpenRat Content Management System -// Copyright (C) 2002 Jan Dankert, jandankert@jandankert.de -// -// This program is free software; you can redistribute it and/or -// modify it under the terms of the GNU General Public License -// as published by the Free Software Foundation; either version 2 -// of the License, or (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// 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.2 2004-12-19 15:18:50 dankert -// Speichern des RSS-Feeds in Session (Performance) -// -// Revision 1.1 2004/10/14 21:15:13 dankert -// Lesen eines RSS-Feeds und erzeugen eines HTML-Abschnittes dafuer -// -// --------------------------------------------------------------------------- - - - -/** - * @author Jan Dankert - */ -class RSSReader extends Dynamic -{ - /** - * Bitte immer alle Parameter in dieses Array schreiben, dies ist fuer den Web-Developer hilfreich. - * @type String - */ - var $parameters = Array( - 'url'=>'URL from which the RSS is fetched' - ); - - /** - * Bitte immer eine Beschreibung benutzen, dies ist fuer den Web-Developer hilfreich. - * @type String - */ - var $description = 'Reads a RSS-Feed and displays its content as a html list'; - - var $url = 'http://www.heise.de/newsticker/heise.rdf'; - - - - function execute() - { - // Sessionvariable mit CRC verschluesseln, falls es mehrere RSS-Feeds im Projekt gibt - $sessVar = 'RSSReader_'.crc32($this->url); - $cache = $this->getSessionVar( $sessVar ); - - if ( !empty($cache) ) - { - // Wenn Cache vorhanden, dann diesen ausgeben - $this->output( $cache ); - } - else - { - // Wenn Cache leer, dann RSS erzeugen und in Session speichern - $this->create(); - $this->setSessionVar( $sessVar,$this->getOutput() ); - } - } - - - - // Erzeugt den Text des RSS-Feeds - function create() - { - $rss = $this->parse( implode('',file($this->url)) ); - $out = array(); - - $this->output('<ul>'); - - // Schleife ueber alle Inhalte des RSS-Feeds - foreach( $rss['items'] as $item ) - { - $this->output('<li>'); - $this->output('<a href="'.$item['link'].'">'.$item['title'].'</a><br/>'.$item['description']); - $this->output('</li>'); - } - - $this->output('</ul>'); - } - - - - function parse( $feed ) - { - // Parses the RSS feed into the array - $arr = array(); - // Determine encoding - preg_match('/<\?xml version="1\.0" encoding="(.*)"\?>/i', $feed, $sarr); - if ( !empty($sarr[1])) - $arr["encoding"] = $sarr[1]; - // Determine title - preg_match('/<title>(.*)<\/title>/i', $feed, $sarr); - if ( !empty($sarr[1])) - $arr["title"] = $sarr[1]; - // Determine title - preg_match('/<title>(.*)<\/title>/i', $feed, $sarr); - if ( !empty($sarr[1])) - $arr["title"] = $sarr[1]; - // Determine description - preg_match('/<description>(.*)<\/description>/i', $feed, $sarr); - if ( !empty($sarr[1])) - $arr["description"] = $sarr[1]; - // Determine link - preg_match('/<link>(.*)<\/link>/i', $feed, $sarr); - if ( !empty($sarr[1])) - $arr["link"] = $sarr[1]; - // Determine language - preg_match('/<language>(.*)<\/language>/i', $feed, $sarr); - if ( !empty($sarr[1])) - $arr["language"] = $sarr[1]; - // Determine generator - preg_match('/<generator>(.*)<\/generator>/i', $feed, $sarr); - if ( !empty($sarr[1])) - $arr["generator"] = $sarr[1]; - // Strip items - $parts = explode("<item>", $feed); - foreach($parts as $part) - { - $item = substr($part, 0, strpos($part, "</item>")); - if ( !empty($item) ) - $items[] = $item; - } - // Fill the channel array - $arr["items"] = array(); - foreach($items as $item) - { - $i = array(); - - // Determine title - preg_match('/<title>(.*)<\/title>/i', $item, $title); - if ( !empty($title[1])) - $i['title'] = $title[1]; - else - $i['title'] = ''; - - // Determine pubdate - preg_match('/<pubDate>(.*)<\/pubDate>/i', $item, $pubdate); - if ( !empty($pubdate[1])) - $i['pubDate'] = strtotime($pubdate[1]); - else - $i['pubDate'] = ''; - - // Determine link - preg_match('/<link>(.*)<\/link>/i', $item, $link); - if ( !empty($link[1])) - $i['link'] = $link[1]; - else - $i['link'] = ''; - - // Determine description - if(stristr($item, '<![CDATA[')) - preg_match('/<description><!\[CDATA\[(.*)\]\]><\/description>/is', $item, $description); - else - preg_match('/<description>(.*)<\/description>/is', $item, $description); - - if ( !empty($description[1])) - $i['description'] = $description[1]; - else - $i['description'] = ''; - - $arr["items"][] = $i; - } - return $arr; - } -}- \ No newline at end of file diff --git a/dynamicClasses/Sitemap.class.php b/dynamicClasses/Sitemap.class.php @@ -1,117 +0,0 @@ -<?php -// --------------------------------------------------------------------------- -// $Id$ -// --------------------------------------------------------------------------- -// OpenRat Content Management System -// Copyright (C) 2002 Jan Dankert, jandankert@jandankert.de -// -// This program is free software; you can redistribute it and/or -// modify it under the terms of the GNU General Public License -// as published by the Free Software Foundation; either version 2 -// of the License, or (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// 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.2 2004-12-28 22:57:56 dankert -// Korrektur Vererbung, "api" ausgebaut -// -// Revision 1.1 2004/10/14 21:15:29 dankert -// Erzeugen und Anzeigen einer Sitemap -// -// --------------------------------------------------------------------------- - - - -/** - * Erstellen eines Menues - * @author Jan Dankert - */ -class Sitemap extends Dynamic -{ - /** - * Bitte immer alle Parameter in dieses Array schreiben, dies ist fuer den Web-Developer hilfreich. - * @type String - */ - var $parameters = Array( - 'beforeEntry'=>'Chars before an active menu entry' - ); - - /** - * Bitte immer eine Beschreibung benutzen, dies ist fuer den Web-Developer hilfreich. - * @type String - */ - var $description = 'Creates a main menu.'; - - - /** - * Zeichenkette, die vor einem aktiven Menuepunkt gezeigt wird - */ - var $beforeEntry = '<li><strong>'; - var $afterEntry = '</strong></li>'; - - var $api; - - /** - * Erstellen einer Sitemap - */ - function execute() - { - // Erstellen eines Untermenues - - // Ermitteln der aktuellen Seite - $thispage = new Page( $this->getObjectId() ); - $thispage->load(); // Seite laden - - // uebergeordneter Ordner dieser Seite - $this->showFolder( $this->getRootObjectId() ); - } - - function showFolder( $oid ) - { - // uebergeordneter Ordner dieser Seite - $f = new Folder( $oid ); - - // Schleife ueber alle Objekte im aktuellen Ordner - foreach( $f->getObjectIds() as $id ) - { - $o = new Object( $id ); - $o->languageid = $this->page->languageid; - $o->load(); - - // Ordner - if ($o->isFolder ) - { - $this->output( '<li><strong>'.$o->name.'</strong><br/>' ); - $this->output( '<ul>' ); - $this->showFolder( $id ); // Rekursiver Aufruf dieser Methode - $this->output( '</ul></li>' ); - } - - // Seiten und Verkn?fpungen - if ($o->isPage || $o->isLink ) - { - // Wenn aktuelle Seite, dann markieren, sonst Link - if ( $this->getObjectId() == $id ) - { - // aktuelle Seite - $this->output( '<li><strong>'.$o->name.'</strong></li>' ); - } - else - { - // Link erzeugen - $this->output( '<li><a href="'.$this->pathToObject($id).'">'.$o->name.'</a></li>' ); - } - } - } - } -} - -?>- \ No newline at end of file diff --git a/dynamicClasses/TeaserList.class.php b/dynamicClasses/TeaserList.class.php @@ -1,113 +0,0 @@ -<?php -// OpenRat Content Management System -// Copyright (C) 2002-2012 Jan Dankert, cms@jandankert.de -// -// This program is free software; you can redistribute it and/or -// modify it under the terms of the GNU General Public License -// as published by the Free Software Foundation; either version 2 -// of the License, or (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - - - -/** - * Erstellen einer Teaser-Liste. - * - * @author Jan Dankert - */ -class TeaserList extends Dynamic -{ - var $folderid = 0; - var $title_html_tag = 'h2'; - var $time_html_tag = 'h6'; - var $title_css_class = 'teaser'; - var $description_css_class = 'teaser'; - var $link_css_class = 'teaser'; - var $teaserElementId = ''; - var $teaserMaxLength = 100; - var $plaintext = 'true'; - var $linktitle = 'true'; - var $linktext = 'true'; - var $timeelementid = 0; - - /** - * Bitte immer eine Beschreibung benutzen, dies ist fuer den Web-Developer hilfreich. - * @type String - */ - var $description = 'Creates a teaser list of pages in a folder'; - - // Erstellen des Hauptmenues - function execute() - { - $feed = array(); - - // Lesen des Root-Ordners - if ( intval($this->folderid) == 0 ) - $folder = new Folder( $this->getRootObjectId() ); - else - $folder = new Folder( intval($this->folderid) ); - - $folder->load(); - - // Schleife ueber alle Inhalte des Root-Ordners - foreach( $folder->getObjects() as $o ) - { - if ( $o->isPage ) // Nur wenn Ordner - { - $p = new Page( $o->objectid ); - $p->load(); - - $desc = $p->desc; - $p->generate_elements(); - - if ( !empty($this->teaserElementId) ) - { - $value = $p->values[$this->teaserElementId]; - $desc = $value->value; - if ( istrue($this->plaintext) ) - { - $desc = strip_tags($desc); - // Und nur wenn die Tags raus sind duerfen wir nun den Text kuerzen. - // (sonst drohen offene Tags) - if ( is_numeric($this->teaserMaxLength) && $this->teaserMaxLength > 0 ) - $desc = Text::maxLength($desc,$this->teaserMaxLength); - } - } - - $time = ''; - if ( !empty($this->timeelementid) ) - { - $value = $p->values[$this->timeelementid]; - $time = $value->value; - } - - $this->output('<'.$this->time_html_tag.'>'.$time.'</'.$this->time_html_tag.'>'); - - $url = $this->pathToObject($o->objectid); - - $this->output( '<'.$this->title_html_tag.' class="'.$this->title_css_class.'">'); - if ( istrue($this->linktitle) ) - $this->output( '<a href="'.$url.'">'.$p->name.'</a>' ); - else - $this->output( $p->name ); - $this->output( '</'.$this->title_html_tag.'>' ); - - $this->output( '<p class="'.$this->description_css_class.'">' ); - if ( istrue($this->linktext) ) - $this->output( '<a href="'.$this->pathToObject($o->objectid).'">'.$desc.'</a>' ); - else - $this->output( $desc ); - - $this->output( '</p>' ); - } - } - } -}- \ No newline at end of file diff --git a/dynamicClasses/Youtube.class.php b/dynamicClasses/Youtube.class.php @@ -1,59 +0,0 @@ -<?php -// --------------------------------------------------------------------------- -// $Id$ -// --------------------------------------------------------------------------- -// OpenRat Content Management System -// Copyright (C) 2002 Jan Dankert, jandankert@jandankert.de -// -// This program is free software; you can redistribute it and/or -// modify it under the terms of the GNU General Public License -// as published by the Free Software Foundation; either version 2 -// of the License, or (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -// --------------------------------------------------------------------------- - - - -/** - * Bindet ein Youtube-Video ein. - * - * @author Jan Dankert - */ -class Youtube extends Dynamic -{ - /** - * Bitte immer alle Parameter in dieses Array schreiben, dies ist fuer den Web-Developer hilfreich. - * @type String - */ - var $parameters = Array( - 'id'=>'Video-Id' - ); - - /** - * Bitte immer eine Beschreibung benutzen, dies ist fuer den Web-Developer hilfreich. - * @type String - */ - var $description = 'Includes a youtube video.'; - - var $id = "0"; - var $width = 320; - var $height = 265; - - /** - */ - function execute() - { - $this->output('<object width="'.$this->width.'" height="'.$this->height.'"><param name="movie" value="http://www.youtube.com/v/'.$this->id.'&hl=de&fs=1&rel=0"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/'.$this->id.'&hl=de&fs=1&rel=0" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="'.$this->width.'" height="'.$this->height.'"></embed></object>'); - } - -} - -?>- \ No newline at end of file diff --git a/macro/Album.class.php b/macro/Album.class.php @@ -0,0 +1,92 @@ +<?php +// OpenRat Content Management System +// Copyright (C) 2002-2012 Jan Dankert, cms@jandankert.de +// +// This program is free software; you can redistribute it and/or +// modify it under the terms of the GNU General Public License +// as published by the Free Software Foundation; either version 2 +// of the License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + + +/** + * Erzeugt eine Bilder-Liste. + * + * Die Ordner-Id kann als Parameter "folderid" übergeben werden. + * Falls nicht, wird der aktuelle Ordner, in dem sich die Seite + * befindet, benutzt. + * + * Es wird eine Definitionsliste mit der CSS-Klasse "album" erzeugt, damit + * bequem eine Auszeichnung per CSS erfolgen kann. + * + * Beispiel: + * <dl class="album"> + * <dt><img src="bild.jpg" width=".." .. /></dt> + * <dd>Beschreibung</dd> + * </dl> + * + * @author Jan Dankert + */ +class Album extends Macro +{ + /** + * Bitte immer alle Parameter in dieses Array schreiben, dies ist fuer den Web-Developer hilfreich. + * @type String + */ + var $parameters = Array( + 'folderid' + ); + + /** + * Bitte immer eine Beschreibung benutzen, dies ist fuer den Web-Developer hilfreich. + * @type String + */ + var $description = 'Creates an album.'; + + var $folderid = 0; + + /** + */ + function execute() + { + if ( intval($this->folderid)!=0 ) + $folderid = $this->folderid; + else + $folderid = $this->page->parentid; + //Html::debug($folderid); + + $f = new Folder($folderid); + + $files = $f->getFiles(); + + $this->output('<dl class="album">'); + + foreach( $files as $fileid ) + { + $file = new File($fileid); + $file->load(); + + if ( $file->isImage() ) + { + $file->getImageSize(); + $img = '<img src="'.$this->pathToObject($fileid).'" alt="'.$file->name.'" width="'.$file->width.'" height="'.$file->height.'" />'; + $this->output('<dt>'.$img.'</dt><dd>'.$file->desc.'</dd>'); + } + + } + + $this->output('</dl>'); + } + +} + +?>+ \ No newline at end of file diff --git a/macro/Atom.class.php b/macro/Atom.class.php @@ -0,0 +1,139 @@ +<?php +// --------------------------------------------------------------------------- +// $Id$ +// --------------------------------------------------------------------------- +// OpenRat Content Management System +// Copyright (C) 2002 Jan Dankert, jandankert@jandankert.de +// +// This program is free software; you can redistribute it and/or +// modify it under the terms of the GNU General Public License +// as published by the Free Software Foundation; either version 2 +// of the License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +// --------------------------------------------------------------------------- + + + +/** + * Erstellen eines ATOM-Feeds + * @author Jan Dankert + */ +class Atom extends Macro +{ + /** + * Bitte immer alle Parameter in dieses Array schreiben, dies ist fuer den Web-Developer hilfreich. + * @type String + */ + var $parameters = Array( + 'folderid' =>'Id of the folder whose pages should go into the Atom-Feed, default: the root folder', + 'feed_url' =>'Url of the feed, default: blank', + 'feed_title' =>'Title of the feed, default: Name of folder', + 'feed_description'=>'Description of the feed, default: Description of folder' + ); + + var $folderid = 0; + + /** + * Bitte immer eine Beschreibung benutzen, dies ist fuer den Web-Developer hilfreich. + * @type String + */ + var $description = 'Creates an Atom-Feed of pages in a folder'; + var $api; + + var $feed_url = ''; + var $feed_title = ''; + var $feed_description = ''; + + // Erstellen des Hauptmenues + function execute() + { + $feed = array(); + + // Lesen des Root-Ordners + if ( intval($this->folderid) == 0 ) + $folder = new Folder( $this->getRootObjectId() ); + else + $folder = new Folder( intval($this->folderid) ); + + $folder->load(); + + if ( $this->feed_title == '' ) + $this->feed_title = $folder->name; + + if ( $this->feed_description == '' ) + $this->feed_description = $folder->desc; + + $feed['title' ] = $this->feed_title; + $feed['description'] = $this->feed_description; + $feed['url' ] = $this->feed_url; + $feed['items' ] = array(); + // Schleife ueber alle Inhalte des Root-Ordners + foreach( $folder->getObjectIds() as $id ) + { + if ( $id == $this->getObjectId() ) + continue; + $o = new Object( $id ); + $o->languageid = $this->page->languageid; + $o->load(); + if ( $o->isPage ) // Nur wenn Seite + { + $p = new Page( $id ); + $p->load(); + + $item = array(); + $item['title' ] = $p->name; + $item['description'] = $p->desc; + $item['date' ] = $p->lastchangeDate; + if ( empty($this->feed_url) ) + $item['link' ] = $this->pathToObject($id); + else + $item['link' ] = $this->feed_url; + + $feed['items'][] = $item; + } + } + + $feed = $this->atomFeed($feed); + + $this->output( $feed ); + } + + + function atomFeed($input, $stylesheet='') + { + $input["encoding"] = (empty($input["encoding"] ))?"UTF-8":$input["encoding"]; + $input["language"] = (empty($input["language"] ))?"en-us":$input["language"]; + + if ( empty($input['title' ])) $input['title' ] = ''; + if ( empty($input['description'])) $input['description'] = ''; + if ( empty($input['link' ])) $input['link' ] = ''; + $feed = '<?xml version="1.0" encoding="'.$input["encoding"].'"?>'; + $feed .= (!empty($stylesheet))?"\n".'<?xml-stylesheet type="text/xsl" href="'.$stylesheet.'"?>':""; + $feed .= <<<__RSS__ + + <feed xmlns="http://www.w3.org/2005/Atom"> + <title>{$input["title"]}</title> + +__RSS__; + foreach($input["items"] as $item) + { + if ( empty($item['title' ])) $item['title' ] = ''; + if ( empty($item['description'])) $item['description'] = ''; + $feed .= "\n<entry>\n<title>".$item["title"]."</title>"; + $feed .= "\n<summary><![CDATA[".$item["description"]."]]></summary>"; + $feed .= "\n<updated>".date('Y-m-d\TH:i:s\Z', $item["date"])."</updated>"; + $feed .= "\n<link href=\"".$item["link"]."\" />"; + $feed .= "\n</entry>\n"; + } + $feed .= "\n</feed>"; + return $feed; + } +}+ \ No newline at end of file diff --git a/macro/BlockMenu.class.php b/macro/BlockMenu.class.php @@ -0,0 +1,136 @@ +<?php +// --------------------------------------------------------------------------- +// $Id$ +// --------------------------------------------------------------------------- +// OpenRat Content Management System +// Copyright (C) 2002 Jan Dankert, jandankert@jandankert.de +// +// This program is free software; you can redistribute it and/or +// modify it under the terms of the GNU General Public License +// as published by the Free Software Foundation; either version 2 +// of the License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// 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.2 2004-12-25 21:05:14 dankert +// erbt von Klasse Dynamic +// +// Revision 1.1 2004/10/14 21:16:12 dankert +// Erzeugen eines Menues in Bloecken +// +// --------------------------------------------------------------------------- + + + +/** + * Erstellen eines Hauptmenues + * @author Jan Dankert + */ +class BlockMenu extends Macro +{ + /** + * Bitte immer alle Parameter in dieses Array schreiben, dies ist fuer den Web-Developer hilfreich. + * @type String + */ + var $parameters = Array( + 'arrowChar'=>'String between menu entries, default: "&middot;"' + ); + + + var $arrowChar = ' &middot; '; + + /** + * Bitte immer eine Beschreibung benutzen, dies ist fuer den Web-Developer hilfreich. + * @type String + */ + var $description = 'Creates a main menu.'; + var $version = '$Id$'; + var $api; + + // Erstellen des Hauptmenues + function execute() + { + // Erstellen des Hauptmenues + + // Lesen des Root-Ordners + $folder = new Folder( $this->getRootObjectId() ); + + // Schleife ueber alle Inhalte des Root-Ordners + foreach( $folder->getObjectIds() as $id ) + { + $o = new Object( $id ); + $o->languageid = $this->page->languageid; + $o->load(); + if ( $o->isFolder ) // Nur wenn Ordner + { + $f = new Folder( $id ); + + // Ermitteln eines Objektes mit dem Dateinamen index + $oid = $f->getObjectIdByFileName('index'); + + if ( count($f->getLinks())+count($f->getPages()) > 0 ) + { + $this->output( ' + <!-- sidebox --> + <table bgcolor="#000000" border="0" cellpadding="0" cellspacing="0" width="100%"> + <tr> + <td> + <table border="0" cellpadding="3" cellspacing="1" width="100%"> + <tr> + <td bgcolor="#cccccc"><span class="title"> '.$o->name.'</span></a> + </td> + </tr> + <tr> + <td bgcolor="#ffffff"> + '); + // Untermenue + // Schleife ber alle Objekte im aktuellen Ordner + foreach( $f->getObjectIds() as $xid ) + { + $o = new Object( $xid ); + $o->languageid = $this->page->languageid; + $o->load(); + + // Nur Seiten anzeigen + if (!$o->isPage && !$o->isLink ) continue; + + // Wenn aktuelle Seite, dann markieren, sonst Link + if ( $this->getObjectId() == $xid ) + { + // aktuelle Seite + $this->output( ' <span class="small">o</span> + <strong class="nav">'.$o->name.'</strong> + <br />' ); + } + else + { + $this->output( ' <span class="small">o</span> + <a class="nav" href="'.$this->page->path_to_object($xid).'">'.$o->name.'</a> + <br />' ); + } + //Api::output( '<br/>' ); + } + + $this->output( ' + </td> + </tr> + </table> + </td> + </tr> + </table> + <!-- end sidebox --> + <br /> + ' ); + } + } + } + } +}+ \ No newline at end of file diff --git a/macro/BreadCrumb.class.php b/macro/BreadCrumb.class.php @@ -0,0 +1,103 @@ +<?php +// --------------------------------------------------------------------------- +// $Id$ +// --------------------------------------------------------------------------- +// OpenRat Content Management System +// Copyright (C) 2002 Jan Dankert, jandankert@jandankert.de +// +// This program is free software; you can redistribute it and/or +// modify it under the terms of the GNU General Public License +// as published by the Free Software Foundation; either version 2 +// of the License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// 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.3 2007-11-30 23:25:25 dankert +// Das Men? in der Sprache der zu ver?ffentlichenden Seite erzeugen. +// +// Revision 1.2 2005/01/04 19:59:55 dankert +// Allgemeine Korrekturen, Erben von "Dynamic"-klasse +// +// Revision 1.1 2004/11/10 22:43:35 dankert +// Beispiele fuer dynamische Templateelemente +// +// --------------------------------------------------------------------------- + + + +/** + * Erstellen einer sog. Brotkruemel-Navigation + * @author Jan Dankert + */ +class BreadCrumb extends Macro +{ + /** + * Bitte immer alle Parameter in dieses Array schreiben, dies ist fuer den Web-Developer hilfreich. + * @type String + */ + var $parameters = Array( + 'beforeEntry'=>'Chars before an active menu entry' + ); + + /** + * Bitte immer eine Beschreibung benutzen, dies ist fuer den Web-Developer hilfreich. + * @type String + */ + var $description = 'Creates a main menu.'; + + + /** + * Zeichenkette, die vor einem aktiven Menuepunkt gezeigt wird + */ + var $beforeEntry = '&raquo;'; + + var $api; + + /** + * Erstellen einer BreadCrumb-Navigation. + */ + function execute() + { + // Erstellen eines Untermenues + + // Ermitteln der aktuellen Seite + $f = new Folder($this->page->parentid); + $parentIds = $f->parentObjectFileNames(false,true); + $lastoid = 0; + + foreach( $parentIds as $oid=>$filename ) + { + $of = new Folder($oid); + $of->languageid = $this->page->languageid; + $of->load(); + $pl = $of->getFirstPageOrLink(); + + $this->output( $this->beforeEntry ); + + if ( is_object($pl) && $pl->objectid != $this->page->objectid ) + $this->output('<a href="'.$this->pathToObject($pl->objectid).'" class="breadcrumb">'.$of->name.'</a>' ); + else + $this->output('<span class="breadcrumb">'.$of->name.'</span>' ); + + if ( is_object($pl) ) + $lastoid = $pl->objectid; + } + + if ( $lastoid != $this->page->objectid ) + { + $this->output( $this->beforeEntry ); + $this->output('<span class="breadcrumb">'.$this->page->name.'</span>' ); + } + + } +} + +?>+ \ No newline at end of file diff --git a/macro/CSVTable.class.php b/macro/CSVTable.class.php @@ -0,0 +1,85 @@ +<?php +// OpenRat Content Management System +// Copyright (C) 2002-2012 Jan Dankert, cms@jandankert.de +// +// This program is free software; you can redistribute it and/or +// modify it under the terms of the GNU General Public License +// as published by the Free Software Foundation; either version 2 +// of the License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + + +/** + * Aus einer CSV-Datei wird eine HTML-Tabelle erstellt. + * + * @author Jan Dankert + */ +class CSVList extends Macro +{ + /** + * Id der Datei, welche die Werte enthält. + * @var unknown_type + */ + var $fileid = 0; + + /** + * CSS-Klasse der Tabelle. + * @var unknown_type + */ + var $css_class = 'table'; + + /** + * Trennzeichen (Default: Komma). + * @var unknown_type + */ + var $seperator = ','; + + /** + * Bitte immer eine Beschreibung benutzen, dies ist fuer den Web-Developer hilfreich. + * @type String + */ + var $description = 'Creates a HTML-table from a CSV-file'; + + + + function execute() + { + $this->output('<table class="'.$this->css_class.'">'); + + // Datei lesen + $file = new File( $this->fileid ); + $values = $file->loadValue(); + + // In einzelne Zeilen zerlegen. + $lines = explode("\n",$values); + + foreach( $lines as $line ) + { + $this->output('<tr>'); + + // In einzelne Spalten zerlegen. + $columns = explode($seperator,$line); + foreach( $columns as $column ) + { + $this->output('<td>' ); + $this->output($column); + $this->output('</td>'); + } + $this->output('</tr>'); + } + + $this->output('</table>'); + } +} + + +?>+ \ No newline at end of file diff --git a/macro/ClassicMenu.class.php b/macro/ClassicMenu.class.php @@ -0,0 +1,118 @@ +<?php +// OpenRat Content Management System +// Copyright (C) 2002-2012 Jan Dankert, cms@jandankert.de +// +// This program is free software; you can redistribute it and/or +// modify it under the terms of the GNU General Public License +// as published by the Free Software Foundation; either version 2 +// of the License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + + +/** + * Erstellen eines Menues + * @author Jan Dankert + */ +class ClassicMenu extends Macro +{ + /** + * Beschreibung dieser Klasse + * @type String + */ + var $description = 'This is a dynamic Menue which contains all pages. Folders are opened when useful. Nice standard menu :-)'; + + + /** + * Zeichenkette, die vor einem aktiven Menuepunkt gezeigt wird + */ + var $beforeEntry = '<li><strong>'; + var $afterEntry = '</strong></li>'; + var $csspraefix = 'menu'; + var $onlySameTemplate = true; + + + // Erstellen des Hauptmenues + function execute() + { + $rootId = $this->getRootObjectId(); + // Erstellen eines Untermenues + + $f = new Folder( $this->page->parentid ); + $this->parentFolders = $f->parentObjectFileNames(false,true); + + $this->showFolder( $rootId,0 ); + } + + function showFolder( $oid,$level ) + { + $this->outputLn('<ul class="'.$this->csspraefix.$level.'">'); + $f = new Folder( $oid ); + + // Schleife ueber alle Objekte im aktuellen Ordner + foreach( $f->getObjects() as $o ) + { + $o->languageid = $this->page->languageid; + $o->load(); + + // Ordner anzeigen + if ($o->isFolder ) + { + $nf = new Folder($o->objectid); + $fp = $nf->getFirstPageOrLink(); + + if ( is_object($fp) ) + { + + // Wenn aktuelle Seite, dann markieren, sonst Link + if ( $this->page->objectid == $fp->objectid ) + // aktuelle Seite + $this->outputLn( '<li class="'.$this->csspraefix.$level.'"><strong class="'.$this->csspraefix.$level.'">'.$o->name.'</strong>' ); + else + // Link erzeugen + $this->outputLn( '<li class="'.$this->csspraefix.$level.'"><a class="'.$this->csspraefix.$level.'" href="'.$this->pathToObject($fp->objectid).'">'.$o->name.'</a>' ); + + if ( in_array($o->objectid,array_keys($this->parentFolders)) ) + { + $this->showFolder($o->objectid,$level+1); + } + + $this->outputLn( '</li>' ); + } + } + + if ($o->isPage) + { + $page = new Page($o->objectid); + $page->load(); + if ( $page->templateid != $this->page->templateid && $this->onlySameTemplate ) + continue; + } + + // Seiten und Verknuepfungen anzeigen + if ($o->isPage || $o->isLink ) + { + // Wenn aktuelle Seite, dann markieren, sonst Link + if ( $this->getObjectId() == $o->objectid) + // aktuelle Seite + $this->output( '<li class="'.$this->csspraefix.$level.'"><strong class="'.$this->csspraefix.$level.'">'.$o->name.'</strong></li>' ); + elseif ( $o->isLink ) + // Link mit HTML-Sonderzeichenumwandlung erzeugen + $this->output( '<li class="'.$this->csspraefix.$level.'"><a class="'.$this->csspraefix.$level.'" href="'.htmlspecialchars($this->pathToObject($o->objectid)).'">'.$o->name.'</a></li>' ); + else + // Link erzeugen + $this->output( '<li class="'.$this->csspraefix.$level.'"><a class="'.$this->csspraefix.$level.'" href="'.$this->pathToObject($o->objectid).'">'.$o->name.'</a></li>' ); + } + } + $this->output('</ul>'); + } + +}+ \ No newline at end of file diff --git a/macro/CommonMenu.class.php b/macro/CommonMenu.class.php @@ -0,0 +1,100 @@ +<?php +// --------------------------------------------------------------------------- +// $Id$ +// --------------------------------------------------------------------------- +// OpenRat Content Management System +// Copyright (C) 2002 Jan Dankert, jandankert@jandankert.de +// +// This program is free software; you can redistribute it and/or +// modify it under the terms of the GNU General Public License +// as published by the Free Software Foundation; either version 2 +// of the License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// 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.3 2004-12-19 22:35:23 dankert +// Parameter -Angabe +// +// Revision 1.2 2004/12/19 15:19:29 dankert +// Klasse erbt von "Dynamic" +// +// Revision 1.1 2004/11/10 22:43:35 dankert +// Beispiele fuer dynamische Templateelemente +// +// --------------------------------------------------------------------------- + + + +/** + * Erstellen eines Menues + * @author Jan Dankert + */ +class CommonMenu extends Macro +{ + /** + * Bitte immer alle Parameter in dieses Array schreiben, dies ist fuer den Web-Developer hilfreich. + * @type String + */ + var $parameters = Array( + 'beforeEntry'=>'Chars before an active menu entry', + 'afterEntry' =>'Chars after an active menu entry' + ); + + /** + * Bitte immer eine Beschreibung benutzen, dies ist fuer den Web-Developer hilfreich. + * @type String + */ + var $description = 'Creates a main menu.'; + + + /** + * Zeichenkette, die vor einem aktiven Menuepunkt gezeigt wird + */ + var $beforeEntry = '<li><strong>'; + var $afterEntry = '</strong></li>'; + + + // Erstellen des Hauptmenues + function execute() + { + // Erstellen eines Untermenues + + // Ermitteln der aktuellen Seite + $thispage = new Page( $this->getObjectId() ); + $thispage->load(); // Seite laden + + // uebergeordneter Ordner dieser Seite + $f = new Folder( $thispage->parentid ); + + // Schleife ueber alle Objekte im aktuellen Ordner + foreach( $f->getObjectIds() as $id ) + { + $o = new Object( $id ); + $o->languageid = $this->page->languageid; + $o->load(); + + // Nur Seiten anzeigen + if (!$o->isPage && !$o->isLink ) continue; + + // Wenn aktuelle Seite, dann markieren, sonst Link + if ( $this->getObjectId() == $id ) + { + // aktuelle Seite + $this->output( '<li><strong>'.$o->name.'</strong></li>' ); + } + else + { + // Link erzeugen + $this->output( '<li><a href="'.$this->page->path_to_object($id).'">'.$o->name.'</a></li>' ); + } + } + } +}+ \ No newline at end of file diff --git a/macro/DoiMenu.class.php b/macro/DoiMenu.class.php @@ -0,0 +1,130 @@ +<?php +// --------------------------------------------------------------------------- +// $Id$ +// --------------------------------------------------------------------------- +// OpenRat Content Management System +// Copyright (C) 2002 Jan Dankert, jandankert@jandankert.de +// +// This program is free software; you can redistribute it and/or +// modify it under the terms of the GNU General Public License +// as published by the Free Software Foundation; either version 2 +// of the License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// 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.1 2005-01-04 20:31:52 dankert +// Neues Menue +// +// Revision 1.1 2005/01/04 20:00:12 dankert +// Darstellung eines DHTML-Menues +// +// Revision 1.2 2004/12/28 22:57:56 dankert +// Korrektur Vererbung, "api" ausgebaut +// +// Revision 1.1 2004/10/14 21:15:29 dankert +// Erzeugen und Anzeigen einer Sitemap +// +// --------------------------------------------------------------------------- + + + +/** + * Erstellen eines DHTML-Menues (DoiMenu) + * + * Diese Klasse erzeugt Javascript-Code fuer das DoiMenu + * + * @see http://doimenu.sf.net for details + * @author Jan Dankert + */ +class DoiMenu extends Macro +{ + /** + * Bitte immer eine Beschreibung benutzen, dies ist fuer den Web-Developer hilfreich. + * @type String + */ + var $description = 'You *have to* include doiMenuDOM.js in the page!<br/>Put the code below in head section:<br/><tt>&lt;script type="text/javascript" src="{{your-elementname}}.js"&gt;&lt;/script&gt;</tt><br/>The file is distributed with OpenRat'; + + + /** + * Parameter mit Objekt-Id + * Die Datei mit dieser Id enthaelt Parameter fuer das Menu + */ + var $parameterFileId = 0; + + /** + * Ausrichtung des Menues. + * available value : 'horizontal','vertical'. + */ + var $direction = 'horizontal'; + + + /** + * Erstellen des DHTML-Menues + */ + function execute() + { + // Erstellen eines Untermenues + + // Ermitteln der aktuellen Seite + $thispage = new Page( $this->getObjectId() ); + $thispage->load(); // Seite laden + + $this->outputLn('<script name="javascript" type="text/javascript">'); + + $this->outputLn(" var menu = new TMainMenu('menu','".$this->direction."');"); + + $ro = new Folder($this->getRootObjectId()); + $this->showFolder( $ro ); + + if ( intval( $this->parameterFileId ) != 0 ) + { + $f = new File( intval($this->parameterFileId) ); + $this->outputLn( $f->loadValue() ); + } + + $this->outputLn( ' menu.Build()' ); + $this->outputLn( '</script'); + } + + + function showFolder( $fo ) + { + if ( $fo->objectid == intval($this->getRootObjectId()) ) + $parentMenu = 'menu'; + else + $parentMenu = 'menu'.$fo->objectid; + + foreach( $fo->getObjects() as $o ) + { + $menu = 'menu'.$o->objectid; + + if ( $o->isFolder ) + { $nf = new Folder($o->objectid); + $pl = $nf->getFirstPageOrLink(); + if ( is_object($pl) ) + { + $this->outputLn(" var $menu = new TPopMenu('".$o->name."','','a','".$this->pathToObject($pl->objectid)."','".$o->desc."');"); + $this->outputLn(" $parentMenu.Add(menu".$o->objectid.");"); + $this->showFolder( $nf ); + } + } + + if ( $o->isPage || $o->isPage ) + { + $this->outputLn(" var $menu = new TPopMenu('".$o->name."','','a','".$this->pathToObject($o->objectid)."','".$o->desc."');"); + $this->outputLn(" $parentMenu.Add(menu".$o->objectid.");"); + } + } + } + +} + +?>+ \ No newline at end of file diff --git a/macro/GoogleMaps.class.php b/macro/GoogleMaps.class.php @@ -0,0 +1,63 @@ +<?php +// --------------------------------------------------------------------------- +// $Id$ +// --------------------------------------------------------------------------- +// OpenRat Content Management System +// Copyright (C) 2002 Jan Dankert, jandankert@jandankert.de +// +// This program is free software; you can redistribute it and/or +// modify it under the terms of the GNU General Public License +// as published by the Free Software Foundation; either version 2 +// of the License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +// --------------------------------------------------------------------------- + + + +/** + * Bindet eine Google-Maps-Karte ein. + * + * @author Jan Dankert + */ +class GoogleMaps extends Macro +{ + /** + * Bitte immer alle Parameter in dieses Array schreiben, dies ist fuer den Web-Developer hilfreich. + * @type String + */ + var $parameters = Array( + 'lat' => 'Latitude', + 'long' => 'Longitude', + 'zoom' => 'Zoom' + ); + + /** + * Bitte immer eine Beschreibung benutzen, dies ist fuer den Web-Developer hilfreich. + * @type String + */ + var $description = 'Includes a Google Map.'; + + var $long = 10; // Default: Hamburg + var $lat = 53.55; // Default: Hamburg + var $zoom = 10; + var $width = 425; + var $height = 350; + + /** + */ + function execute() + { + $this->output('<iframe width="'.$this->width.'" height="'.$this->height.'" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="http://maps.google.de/?ie=UTF8&amp;ll='.$this->lat.','.$this->long.'&amp;z='.$this->zoom.'&amp;output=embed"></iframe>'); + } + +} + +?>+ \ No newline at end of file diff --git a/macro/LanguageLinksForPage.class.php b/macro/LanguageLinksForPage.class.php @@ -0,0 +1,70 @@ +<?php +// --------------------------------------------------------------------------- +// $Id$ +// --------------------------------------------------------------------------- +// OpenRat Content Management System +// Copyright (C) 2012 Tobias Schöne tobias@schoenesnetz.de +// +// This program is free software; you can redistribute it and/or +// modify it under the terms of the GNU General Public License +// as published by the Free Software Foundation; either version 2 +// of the License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +// --------------------------------------------------------------------------- +// $Log$ +// --------------------------------------------------------------------------- +/** + * Erstellen einer Liste von Language-Links auf die selbe Seite + * @author Tobias Schoene + */ +class LanguageLinksForPage extends Macro +{ + /** + * Bitte immer alle Parameter in dieses Array schreiben, dies ist fuer den Web-Developer hilfreich. + * @type String + */ + var $parameters = Array( + 'arrowChar'=>'String between entries' + ); + + + var $arrowChar = ' &middot; '; + + /** + * Bitte immer eine Beschreibung benutzen, dies ist fuer den Web-Developer hilfreich. + * @type String + */ + var $description = 'Creates language links to the page.'; + var $version = '$Id$'; + var $api; + + // Build the navigation links to other languages + function execute() + { + // current language + $languageId = $this->page->languageid; + + // Schleife ueber alle Inhalte des Root-Ordners + foreach( Language::getAll() as $lid=>$lname) + { + + $l = new Language( $lid ); + $l->load(); + $this->page->languageid = $l->languageid; + $filename = $this->page->full_filename(); + $filename = str_replace($this->page->path(),".",$filename); + $this->output( '<li><a href="'.$filename.'">'.strtolower($l->isoCode).'</a></li>' ); + + } + $this->page->languageid = $languageId; + } +} +?>+ \ No newline at end of file diff --git a/macro/LastPage.class.php b/macro/LastPage.class.php @@ -0,0 +1,79 @@ +<?php +// --------------------------------------------------------------------------- +// $Id$ +// --------------------------------------------------------------------------- +// OpenRat Content Management System +// Copyright (C) 2002 Jan Dankert, jandankert@jandankert.de +// +// This program is free software; you can redistribute it and/or +// modify it under the terms of the GNU General Public License +// as published by the Free Software Foundation; either version 2 +// of the License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// 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.2 2005-01-04 19:59:55 dankert +// Allgemeine Korrekturen, Erben von "Dynamic"-klasse +// +// Revision 1.1 2004/11/10 22:43:35 dankert +// Beispiele fuer dynamische Templateelemente +// +// --------------------------------------------------------------------------- + + + +/** + * Erstellen eines Links zur Seite davor + * @author Jan Dankert + */ +class LastPage extends Macro +{ + /** + * Bitte immer alle Parameter in dieses Array schreiben, dies ist fuer den Web-Developer hilfreich. + * @type String + */ + var $parameters = Array( + 'arrowChar'=>'String between menu entries, default: "&middot;"' + ); + + + var $arrowChar = ' &middot; '; + + /** + * Bitte immer eine Beschreibung benutzen, dies ist fuer den Web-Developer hilfreich. + * @type String + */ + var $description = 'Creates a main menu.'; + var $version = '$Id$'; + + + function execute() + { + $folder = new Folder( $this->page->parentid ); + + $lastObject = null; + + // Schleife ueber alle Inhalte des Ordners + foreach( $folder->getObjects() as $o ) + { + if ( $o->isPage || $o->isLink ) + { + if ( is_object($lastObject) && $o->objectid == $this->page->objectid ) + { + $this->output( '<a href="'.$this->pathToObject($lastObject->objectid).' class="next">'.$lastObject->name.'</a>' ); + break; + } + + $lastObject = $o->objectid; + } + } + } +}+ \ No newline at end of file diff --git a/macro/ListMenu.class.php b/macro/ListMenu.class.php @@ -0,0 +1,114 @@ +<?php +// --------------------------------------------------------------------------- +// $Id$ +// --------------------------------------------------------------------------- +// OpenRat Content Management System +// Copyright (C) 2002 Jan Dankert, jandankert@jandankert.de +// +// This program is free software; you can redistribute it and/or +// modify it under the terms of the GNU General Public License +// as published by the Free Software Foundation; either version 2 +// of the License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// 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.1 2005-01-28 23:06:10 dankert +// Neues Menue in Listenform (HTML-Listen), aehnlich "BlockMenu" +// +// Revision 1.2 2004/12/25 21:05:14 dankert +// erbt von Klasse Dynamic +// +// Revision 1.1 2004/10/14 21:16:12 dankert +// Erzeugen eines Menues in Bloecken +// +// --------------------------------------------------------------------------- + + + +/** + * Erstellen eines Hauptmenues + * @author Jan Dankert + */ +class ListMenu extends Macro +{ + /** + * Bitte immer alle Parameter in dieses Array schreiben, dies ist fuer den Web-Developer hilfreich. + * @type String + */ + var $parameters = Array( + 'arrowChar'=>'String between menu entries, default: "&middot;"' + ); + + + var $arrowChar = ' &middot; '; + + /** + * Bitte immer eine Beschreibung benutzen, dies ist fuer den Web-Developer hilfreich. + * @type String + */ + var $description = 'Creates a main menu.'; + var $version = '$Id$'; + var $api; + + // Erstellen des Hauptmenues + function execute() + { + // Erstellen des Hauptmenues + + // Lesen des Root-Ordners + $folder = new Folder( $this->getRootObjectId() ); + + // Schleife ueber alle Inhalte des Root-Ordners + foreach( $folder->getObjectIds() as $id ) + { + $o = new Object( $id ); + $o->languageid = $this->page->languageid; + $o->load(); + if ( $o->isFolder ) // Nur wenn Ordner + { + $f = new Folder( $id ); + $f->load(); + + // Ermitteln eines Objektes mit dem Dateinamen index +// $oid = $f->getObjectIdByFileName('index'); + + if ( count($f->getLinks())+count($f->getPages()) > 0 ) + { + $this->output( '<h1 class="title">'.$o->name.'</h1><ul>'); + // Untermenue + // Schleife ber alle Objekte im aktuellen Ordner + foreach( $f->getObjectIds() as $xid ) + { + $o = new Object( $xid ); + $o->languageid = $this->page->languageid; + $o->load(); + + // Nur Seiten und Verknuepfungen anzeigen + if (!$o->isPage && !$o->isLink ) continue; + + // Wenn aktuelle Seite, dann markieren, sonst Link + if ( $this->getObjectId() == $xid ) + { + // aktuelle Seite + $this->output( '<li class="menu">'.$o->name.'</li>' ); + } + else + { + $this->output( '<li class="menu"><a class="menu" href="'.$this->page->path_to_object($xid).'">'.$o->name.'</a></li>' ); + } + } + + $this->output( '</ul><br />' ); + } + } + } + } +}+ \ No newline at end of file diff --git a/macro/MainMenu.class.php b/macro/MainMenu.class.php @@ -0,0 +1,80 @@ +<?php +// --------------------------------------------------------------------------- +// $Id$ +// --------------------------------------------------------------------------- +// OpenRat Content Management System +// Copyright (C) 2002 Jan Dankert, jandankert@jandankert.de +// +// This program is free software; you can redistribute it and/or +// modify it under the terms of the GNU General Public License +// as published by the Free Software Foundation; either version 2 +// of the License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// 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.2 2004-12-19 15:19:16 dankert +// Klasse erbt von "Dynamic" +// +// Revision 1.1 2004/10/14 21:15:57 dankert +// Erzeugen eines Hauptmenues +// +// --------------------------------------------------------------------------- + + + +/** + * Erstellen eines Hauptmenues + * @author Jan Dankert + */ +class MainMenu extends Macro +{ + /** + * Bitte immer alle Parameter in dieses Array schreiben, dies ist fuer den Web-Developer hilfreich. + * @type String + */ + var $parameters = Array( + 'arrowChar'=>'String between menu entries, default: "&middot;"' + ); + + + var $arrowChar = ' &middot; '; + + /** + * Bitte immer eine Beschreibung benutzen, dies ist fuer den Web-Developer hilfreich. + * @type String + */ + var $description = 'Creates a main menu.'; + var $version = '$Id$'; + + // Erstellen des Hauptmenues + function execute() + { + // Lesen des Root-Ordners + $folder = new Folder( $this->getRootObjectId() ); + + // Schleife ueber alle Inhalte des Root-Ordners + foreach( $folder->getObjectIds() as $id ) + { + $o = new Object( $id ); + $o->languageid = $this->page->languageid; + $o->load(); + if ( $o->isFolder ) // Nur wenn Ordner + { + $f = new Folder( $id ); + + // Ermitteln eines Objektes mit dem Dateinamen index + $oid = $f->getObjectIdByFileName('index'); + if ( is_numeric($oid) && $oid!=0 ) + $this->output( $this->arrowChar.'<a href="'.$this->page->path_to_object($oid).'" title="'.$o->desc.'">'.$o->name.'</a>' ); + } + } + } +}+ \ No newline at end of file diff --git a/macro/NextPage.class.php b/macro/NextPage.class.php @@ -0,0 +1,85 @@ +<?php +// --------------------------------------------------------------------------- +// $Id$ +// --------------------------------------------------------------------------- +// OpenRat Content Management System +// Copyright (C) 2002 Jan Dankert, jandankert@jandankert.de +// +// This program is free software; you can redistribute it and/or +// modify it under the terms of the GNU General Public License +// as published by the Free Software Foundation; either version 2 +// of the License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// 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.2 2005-01-04 19:59:55 dankert +// Allgemeine Korrekturen, Erben von "Dynamic"-klasse +// +// Revision 1.1 2004/11/10 22:43:35 dankert +// Beispiele fuer dynamische Templateelemente +// +// --------------------------------------------------------------------------- + + + +/** + * Erstellen eines Links zur naechsten Seite + * @author Jan Dankert + */ +class NextPage extends Macro +{ + /** + * Bitte immer alle Parameter in dieses Array schreiben, dies ist fuer den Web-Developer hilfreich. + * @type String + */ + var $parameters = Array( + 'arrowChar'=>'String between menu entries, default: "&middot;"' + ); + + + var $arrowChar = ' &middot; '; + + /** + * Bitte immer eine Beschreibung benutzen, dies ist fuer den Web-Developer hilfreich. + * @type String + */ + var $description = 'Creates a main menu.'; + var $version = '$Id$'; + var $api; + + + function execute() + { + // Lesen des Ordners + $folder = new Folder( $this->page->parentid ); + + $was = false; + + // Schleife ueber alle Inhalte des Root-Ordners + foreach( $folder->getObjects() as $o ) + { + if ( $o->isPage || $o->isLink ) // Nur wenn Ordner + { + if ( $o->objectid == $this->page->objectid ) + { + $was = true; + continue; + } + + if ( $was ) + { + $this->output( '<a href="'.$this->pathToObject($o->objectid).' class="next">'.$o->name.'</a>' ); + break; + } + } + } + } +}+ \ No newline at end of file diff --git a/macro/OpenStreetMap.class.php b/macro/OpenStreetMap.class.php @@ -0,0 +1,63 @@ +<?php +// --------------------------------------------------------------------------- +// $Id$ +// --------------------------------------------------------------------------- +// OpenRat Content Management System +// Copyright (C) 2002 Jan Dankert, jandankert@jandankert.de +// +// This program is free software; you can redistribute it and/or +// modify it under the terms of the GNU General Public License +// as published by the Free Software Foundation; either version 2 +// of the License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +// --------------------------------------------------------------------------- + + + +/** + * Bindet die OpenStreetMap ein. + * + * @author Jan Dankert + */ +class OpenStreetMap extends Macro +{ + /** + * Bitte immer alle Parameter in dieses Array schreiben, dies ist fuer den Web-Developer hilfreich. + * @type String + */ + var $parameters = Array( + 'box' => 'coordinates', + 'layer' => 'mapnik', + 'width' => 'Width of iframe', + 'height' => 'Height of iframe', + ); + + /** + * Bitte immer eine Beschreibung benutzen, dies ist fuer den Web-Developer hilfreich. + * @type String + */ + var $description = 'Includes the OpenStreetMap.'; + + var $box = '9.9396,53.4821,10.184,53.643'; // default: Hamburg + var $layer = 'mapnik'; + var $width = 425; + var $height = 350; + + /** + */ + function execute() + { + $this->output('<iframe width="'.$this->width.'" height="'.$this->height.'" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="http://www.openstreetmap.org/export/embed.html?bbox='.$this->box.'&layer='.$this->layer.'" style="border: 1px solid black"></iframe>'); + } + +} + +?>+ \ No newline at end of file diff --git a/macro/PagesNavigation.class.php b/macro/PagesNavigation.class.php @@ -0,0 +1,78 @@ +<?php +// --------------------------------------------------------------------------- +// $Id$ +// --------------------------------------------------------------------------- +// OpenRat Content Management System +// Copyright (C) 2002 Jan Dankert, jandankert@jandankert.de +// +// This program is free software; you can redistribute it and/or +// modify it under the terms of the GNU General Public License +// as published by the Free Software Foundation; either version 2 +// of the License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// 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.2 2005-01-04 19:59:55 dankert +// Allgemeine Korrekturen, Erben von "Dynamic"-klasse +// +// Revision 1.1 2004/11/10 22:43:35 dankert +// Beispiele fuer dynamische Templateelemente +// +// --------------------------------------------------------------------------- + + + +/** + * Erstellen eines Hauptmenues + * @author Jan Dankert + */ +class PagesNavigation extends Macro +{ + /** + * Bitte immer alle Parameter in dieses Array schreiben, dies ist fuer den Web-Developer hilfreich. + * @type String + */ + var $parameters = Array( + 'arrowChar'=>'String between entries' + ); + + + var $arrowChar = ' &middot; '; + + /** + * Bitte immer eine Beschreibung benutzen, dies ist fuer den Web-Developer hilfreich. + * @type String + */ + var $description = 'Creates a page navigation.'; + var $version = '$Id$'; + var $api; + + // Erstellen des Hauptmenues + function execute() + { + // Lesen des Root-Ordners + $folder = new Folder( $this->page->parentid ); + + $nr = 0; + // Schleife ueber alle Inhalte des Root-Ordners + foreach( $folder->getObjects() as $o ) + { + $nr++; + if ( $o->isPage || $o->isLink ) + { + if ( $o->objectid != $this->page->objectid ) + $this->output( '<a href="'.$this->page->path_to_object($oid).'" title="'.$o->desc.'" class="pagenav">'.$nr.'</a>' ); + else + $this->output( '<strong>'.$nr.'</strong>' ); + } + } + } +}+ \ No newline at end of file diff --git a/macro/RSSCreate.class.php b/macro/RSSCreate.class.php @@ -0,0 +1,170 @@ +<?php +// --------------------------------------------------------------------------- +// $Id$ +// --------------------------------------------------------------------------- +// OpenRat Content Management System +// Copyright (C) 2002 Jan Dankert, jandankert@jandankert.de +// +// This program is free software; you can redistribute it and/or +// modify it under the terms of the GNU General Public License +// as published by the Free Software Foundation; either version 2 +// of the License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// 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.4 2009-03-16 23:30:02 dankert +// Unnötigen Aufruf von pathToObject entfernt. +// +// Revision 1.3 2007-11-17 02:19:29 dankert +// Erg?nzung der Version (Default: 0.91), Korrektur, Anpassung an neue API. +// +// Revision 1.2 2004/12/28 22:57:56 dankert +// Korrektur Vererbung, "api" ausgebaut +// +// Revision 1.1 2004/10/14 21:14:52 dankert +// Erzeugen eines RSS-Feeds aus einem Ordner +// +// --------------------------------------------------------------------------- + + + +/** + * Erstellen eines Hauptmenues + * @author Jan Dankert + */ +class RSSCreate extends Macro +{ + /** + * Bitte immer alle Parameter in dieses Array schreiben, dies ist fuer den Web-Developer hilfreich. + * @type String + */ + var $parameters = Array( + 'htmlentities' =>'Escape HTML-Tags in RSS-Feed, default: false', + 'folderid' =>'Id of the folder whose pages should go into the RSS-Feed, default: the root folder', + 'feed_url' =>'Url of the feed, default: blank', + 'feed_title' =>'Title of the feed, default: Name of folder', + 'feed_description'=>'Description of the feed, default: Description of folder' + ); + + var $htmlentities = false; + var $folderid = 0; + + /** + * Bitte immer eine Beschreibung benutzen, dies ist fuer den Web-Developer hilfreich. + * @type String + */ + var $description = 'Creates an RSS-Feed of pages in a folder'; + var $api; + + var $feed_version = '0.91'; + var $feed_url = ''; + var $feed_title = ''; + var $feed_description = ''; + + // Erstellen des Hauptmenues + function execute() + { + $feed = array(); + + // Lesen des Root-Ordners + if ( intval($this->folderid) == 0 ) + $folder = new Folder( $this->getRootObjectId() ); + else + $folder = new Folder( intval($this->folderid) ); + + $folder->load(); + + if ( $this->feed_title == '' ) + $this->feed_title = $folder->name; + + if ( $this->feed_description == '' ) + $this->feed_description = $folder->desc; + + $feed['title' ] = $this->feed_title; + $feed['description'] = $this->feed_description; + $feed['url' ] = $this->feed_url; + $feed['items' ] = array(); + + // Schleife ueber alle Inhalte des Root-Ordners + foreach( $folder->getObjectIds() as $id ) + { + if ( $id == $this->getObjectId() ) + continue; + $o = new Object( $id ); + $o->languageid = $this->page->languageid; + $o->load(); + if ( $o->isPage ) // Nur wenn Seite + { + $p = new Page( $id ); + $p->load(); + + $item = array(); + $item['title' ] = $p->name; + $item['description'] = $p->desc; + $item['pubDate' ] = $p->lastchangeDate; + if ( empty($this->feed_url) ) + $item['link' ] = $this->pathToObject($id); + else + $item['link' ] = $this->feed_url; + + $feed['items'][] = $item; + } + } + + $rss = $this->rss($feed); + + if ( $this->htmlentities ) + $rss = htmlentities( $rss ); + + $this->output( $rss ); + } + + + function rss($input, $stylesheet='') + { +// print_r($input); + // Builds the XML RSS schema using the array + $input["encoding"] = (empty($input["encoding"] ))?"UTF-8":$input["encoding"]; + $input["language"] = (empty($input["language"] ))?"en-us":$input["language"]; + + if ( empty($input['title' ])) $input['title' ] = ''; + if ( empty($input['description'])) $input['description'] = ''; + if ( empty($input['link' ])) $input['link' ] = ''; + $rss = '<?xml version="1.0" encoding="'.$input["encoding"].'"?>'; + $rss .= (!empty($stylesheet))?"\n".'<?xml-stylesheet type="text/xsl" href="'.$stylesheet.'"?>':""; + $rss .= <<<__RSS__ + + <rss version="{$this->feed_version}"> + <channel> + <title>{$input["title"]}</title> + <description>{$input["description"]}</description> + <link>{$input["link"]}</link> + <language>{$input["language"]}</language> + <generator></generator> + +__RSS__; + foreach($input["items"] as $item) + { + if ( empty($item['title' ])) $item['title' ] = ''; + if ( empty($item['description'])) $item['description'] = ''; + $data = date("r", $item["pubDate"]); + $rss .= "\n<item>\n<title>".$item["title"]."</title>"; + $rss .= "\n<description><![CDATA[".$item["description"]."]]></description>"; + if (!empty($item["pubDate"])) + $rss .= "\n<pubDate>".date("r", $item["pubDate"])."</pubDate>"; + if (!empty($item["link"])) + $rss .= "\n<link>".$item["link"]."</link>"; + $rss .= "\n</item>\n"; + } + $rss .= "\n</channel>\n</rss>"; + return $rss; + } +}+ \ No newline at end of file diff --git a/macro/RSSReader.class.php b/macro/RSSReader.class.php @@ -0,0 +1,180 @@ +<?php +// --------------------------------------------------------------------------- +// $Id$ +// --------------------------------------------------------------------------- +// OpenRat Content Management System +// Copyright (C) 2002 Jan Dankert, jandankert@jandankert.de +// +// This program is free software; you can redistribute it and/or +// modify it under the terms of the GNU General Public License +// as published by the Free Software Foundation; either version 2 +// of the License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// 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.2 2004-12-19 15:18:50 dankert +// Speichern des RSS-Feeds in Session (Performance) +// +// Revision 1.1 2004/10/14 21:15:13 dankert +// Lesen eines RSS-Feeds und erzeugen eines HTML-Abschnittes dafuer +// +// --------------------------------------------------------------------------- + + + +/** + * @author Jan Dankert + */ +class RSSReader extends Macro +{ + /** + * Bitte immer alle Parameter in dieses Array schreiben, dies ist fuer den Web-Developer hilfreich. + * @type String + */ + var $parameters = Array( + 'url'=>'URL from which the RSS is fetched' + ); + + /** + * Bitte immer eine Beschreibung benutzen, dies ist fuer den Web-Developer hilfreich. + * @type String + */ + var $description = 'Reads a RSS-Feed and displays its content as a html list'; + + var $url = 'http://www.heise.de/newsticker/heise.rdf'; + + + + function execute() + { + // Sessionvariable mit CRC verschluesseln, falls es mehrere RSS-Feeds im Projekt gibt + $sessVar = 'RSSReader_'.crc32($this->url); + $cache = $this->getSessionVar( $sessVar ); + + if ( !empty($cache) ) + { + // Wenn Cache vorhanden, dann diesen ausgeben + $this->output( $cache ); + } + else + { + // Wenn Cache leer, dann RSS erzeugen und in Session speichern + $this->create(); + $this->setSessionVar( $sessVar,$this->getOutput() ); + } + } + + + + // Erzeugt den Text des RSS-Feeds + function create() + { + $rss = $this->parse( implode('',file($this->url)) ); + $out = array(); + + $this->output('<ul>'); + + // Schleife ueber alle Inhalte des RSS-Feeds + foreach( $rss['items'] as $item ) + { + $this->output('<li>'); + $this->output('<a href="'.$item['link'].'">'.$item['title'].'</a><br/>'.$item['description']); + $this->output('</li>'); + } + + $this->output('</ul>'); + } + + + + function parse( $feed ) + { + // Parses the RSS feed into the array + $arr = array(); + // Determine encoding + preg_match('/<\?xml version="1\.0" encoding="(.*)"\?>/i', $feed, $sarr); + if ( !empty($sarr[1])) + $arr["encoding"] = $sarr[1]; + // Determine title + preg_match('/<title>(.*)<\/title>/i', $feed, $sarr); + if ( !empty($sarr[1])) + $arr["title"] = $sarr[1]; + // Determine title + preg_match('/<title>(.*)<\/title>/i', $feed, $sarr); + if ( !empty($sarr[1])) + $arr["title"] = $sarr[1]; + // Determine description + preg_match('/<description>(.*)<\/description>/i', $feed, $sarr); + if ( !empty($sarr[1])) + $arr["description"] = $sarr[1]; + // Determine link + preg_match('/<link>(.*)<\/link>/i', $feed, $sarr); + if ( !empty($sarr[1])) + $arr["link"] = $sarr[1]; + // Determine language + preg_match('/<language>(.*)<\/language>/i', $feed, $sarr); + if ( !empty($sarr[1])) + $arr["language"] = $sarr[1]; + // Determine generator + preg_match('/<generator>(.*)<\/generator>/i', $feed, $sarr); + if ( !empty($sarr[1])) + $arr["generator"] = $sarr[1]; + // Strip items + $parts = explode("<item>", $feed); + foreach($parts as $part) + { + $item = substr($part, 0, strpos($part, "</item>")); + if ( !empty($item) ) + $items[] = $item; + } + // Fill the channel array + $arr["items"] = array(); + foreach($items as $item) + { + $i = array(); + + // Determine title + preg_match('/<title>(.*)<\/title>/i', $item, $title); + if ( !empty($title[1])) + $i['title'] = $title[1]; + else + $i['title'] = ''; + + // Determine pubdate + preg_match('/<pubDate>(.*)<\/pubDate>/i', $item, $pubdate); + if ( !empty($pubdate[1])) + $i['pubDate'] = strtotime($pubdate[1]); + else + $i['pubDate'] = ''; + + // Determine link + preg_match('/<link>(.*)<\/link>/i', $item, $link); + if ( !empty($link[1])) + $i['link'] = $link[1]; + else + $i['link'] = ''; + + // Determine description + if(stristr($item, '<![CDATA[')) + preg_match('/<description><!\[CDATA\[(.*)\]\]><\/description>/is', $item, $description); + else + preg_match('/<description>(.*)<\/description>/is', $item, $description); + + if ( !empty($description[1])) + $i['description'] = $description[1]; + else + $i['description'] = ''; + + $arr["items"][] = $i; + } + return $arr; + } +}+ \ No newline at end of file diff --git a/macro/Sitemap.class.php b/macro/Sitemap.class.php @@ -0,0 +1,117 @@ +<?php +// --------------------------------------------------------------------------- +// $Id$ +// --------------------------------------------------------------------------- +// OpenRat Content Management System +// Copyright (C) 2002 Jan Dankert, jandankert@jandankert.de +// +// This program is free software; you can redistribute it and/or +// modify it under the terms of the GNU General Public License +// as published by the Free Software Foundation; either version 2 +// of the License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// 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.2 2004-12-28 22:57:56 dankert +// Korrektur Vererbung, "api" ausgebaut +// +// Revision 1.1 2004/10/14 21:15:29 dankert +// Erzeugen und Anzeigen einer Sitemap +// +// --------------------------------------------------------------------------- + + + +/** + * Erstellen eines Menues + * @author Jan Dankert + */ +class Sitemap extends Macro +{ + /** + * Bitte immer alle Parameter in dieses Array schreiben, dies ist fuer den Web-Developer hilfreich. + * @type String + */ + var $parameters = Array( + 'beforeEntry'=>'Chars before an active menu entry' + ); + + /** + * Bitte immer eine Beschreibung benutzen, dies ist fuer den Web-Developer hilfreich. + * @type String + */ + var $description = 'Creates a main menu.'; + + + /** + * Zeichenkette, die vor einem aktiven Menuepunkt gezeigt wird + */ + var $beforeEntry = '<li><strong>'; + var $afterEntry = '</strong></li>'; + + var $api; + + /** + * Erstellen einer Sitemap + */ + function execute() + { + // Erstellen eines Untermenues + + // Ermitteln der aktuellen Seite + $thispage = new Page( $this->getObjectId() ); + $thispage->load(); // Seite laden + + // uebergeordneter Ordner dieser Seite + $this->showFolder( $this->getRootObjectId() ); + } + + function showFolder( $oid ) + { + // uebergeordneter Ordner dieser Seite + $f = new Folder( $oid ); + + // Schleife ueber alle Objekte im aktuellen Ordner + foreach( $f->getObjectIds() as $id ) + { + $o = new Object( $id ); + $o->languageid = $this->page->languageid; + $o->load(); + + // Ordner + if ($o->isFolder ) + { + $this->output( '<li><strong>'.$o->name.'</strong><br/>' ); + $this->output( '<ul>' ); + $this->showFolder( $id ); // Rekursiver Aufruf dieser Methode + $this->output( '</ul></li>' ); + } + + // Seiten und Verkn?fpungen + if ($o->isPage || $o->isLink ) + { + // Wenn aktuelle Seite, dann markieren, sonst Link + if ( $this->getObjectId() == $id ) + { + // aktuelle Seite + $this->output( '<li><strong>'.$o->name.'</strong></li>' ); + } + else + { + // Link erzeugen + $this->output( '<li><a href="'.$this->pathToObject($id).'">'.$o->name.'</a></li>' ); + } + } + } + } +} + +?>+ \ No newline at end of file diff --git a/macro/TeaserList.class.php b/macro/TeaserList.class.php @@ -0,0 +1,113 @@ +<?php +// OpenRat Content Management System +// Copyright (C) 2002-2012 Jan Dankert, cms@jandankert.de +// +// This program is free software; you can redistribute it and/or +// modify it under the terms of the GNU General Public License +// as published by the Free Software Foundation; either version 2 +// of the License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + + +/** + * Erstellen einer Teaser-Liste. + * + * @author Jan Dankert + */ +class TeaserList extends Macro +{ + var $folderid = 0; + var $title_html_tag = 'h2'; + var $time_html_tag = 'h6'; + var $title_css_class = 'teaser'; + var $description_css_class = 'teaser'; + var $link_css_class = 'teaser'; + var $teaserElementId = ''; + var $teaserMaxLength = 100; + var $plaintext = 'true'; + var $linktitle = 'true'; + var $linktext = 'true'; + var $timeelementid = 0; + + /** + * Bitte immer eine Beschreibung benutzen, dies ist fuer den Web-Developer hilfreich. + * @type String + */ + var $description = 'Creates a teaser list of pages in a folder'; + + // Erstellen des Hauptmenues + function execute() + { + $feed = array(); + + // Lesen des Root-Ordners + if ( intval($this->folderid) == 0 ) + $folder = new Folder( $this->getRootObjectId() ); + else + $folder = new Folder( intval($this->folderid) ); + + $folder->load(); + + // Schleife ueber alle Inhalte des Root-Ordners + foreach( $folder->getObjects() as $o ) + { + if ( $o->isPage ) // Nur wenn Ordner + { + $p = new Page( $o->objectid ); + $p->load(); + + $desc = $p->desc; + $p->generate_elements(); + + if ( !empty($this->teaserElementId) ) + { + $value = $p->values[$this->teaserElementId]; + $desc = $value->value; + if ( istrue($this->plaintext) ) + { + $desc = strip_tags($desc); + // Und nur wenn die Tags raus sind duerfen wir nun den Text kuerzen. + // (sonst drohen offene Tags) + if ( is_numeric($this->teaserMaxLength) && $this->teaserMaxLength > 0 ) + $desc = Text::maxLength($desc,$this->teaserMaxLength); + } + } + + $time = ''; + if ( !empty($this->timeelementid) ) + { + $value = $p->values[$this->timeelementid]; + $time = $value->value; + } + + $this->output('<'.$this->time_html_tag.'>'.$time.'</'.$this->time_html_tag.'>'); + + $url = $this->pathToObject($o->objectid); + + $this->output( '<'.$this->title_html_tag.' class="'.$this->title_css_class.'">'); + if ( istrue($this->linktitle) ) + $this->output( '<a href="'.$url.'">'.$p->name.'</a>' ); + else + $this->output( $p->name ); + $this->output( '</'.$this->title_html_tag.'>' ); + + $this->output( '<p class="'.$this->description_css_class.'">' ); + if ( istrue($this->linktext) ) + $this->output( '<a href="'.$this->pathToObject($o->objectid).'">'.$desc.'</a>' ); + else + $this->output( $desc ); + + $this->output( '</p>' ); + } + } + } +}+ \ No newline at end of file diff --git a/macro/Youtube.class.php b/macro/Youtube.class.php @@ -0,0 +1,59 @@ +<?php +// --------------------------------------------------------------------------- +// $Id$ +// --------------------------------------------------------------------------- +// OpenRat Content Management System +// Copyright (C) 2002 Jan Dankert, jandankert@jandankert.de +// +// This program is free software; you can redistribute it and/or +// modify it under the terms of the GNU General Public License +// as published by the Free Software Foundation; either version 2 +// of the License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +// --------------------------------------------------------------------------- + + + +/** + * Bindet ein Youtube-Video ein. + * + * @author Jan Dankert + */ +class Youtube extends Macro +{ + /** + * Bitte immer alle Parameter in dieses Array schreiben, dies ist fuer den Web-Developer hilfreich. + * @type String + */ + var $parameters = Array( + 'id'=>'Video-Id' + ); + + /** + * Bitte immer eine Beschreibung benutzen, dies ist fuer den Web-Developer hilfreich. + * @type String + */ + var $description = 'Includes a youtube video.'; + + var $id = "0"; + var $width = 320; + var $height = 265; + + /** + */ + function execute() + { + $this->output('<object width="'.$this->width.'" height="'.$this->height.'"><param name="movie" value="http://www.youtube.com/v/'.$this->id.'&hl=de&fs=1&rel=0"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/'.$this->id.'&hl=de&fs=1&rel=0" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="'.$this->width.'" height="'.$this->height.'"></embed></object>'); + } + +} + +?>+ \ No newline at end of file diff --git a/model/Value.class.php b/model/Value.class.php @@ -1192,10 +1192,10 @@ SQL $this->page->load(); $className = $this->element->subtype; - $fileName = './dynamicClasses/'.$className.'.class.php'; + $fileName = './macro/'.$className.'.class.php'; if ( is_file( $fileName ) ) { - // Fuer den Fall, dass eine Dynamic-Klasse mehrmals pro Vorlage auftritt + // Fuer den Fall, dass ein Makro mehrmals pro Vorlage auftritt if ( !class_exists($className) ) require( $fileName ); @@ -1214,7 +1214,7 @@ SQL { if ( isset( $dynEl->$param_name ) ) { - Logger::debug("Setting parameter for dynamic Class $className, ".$param_name.':'.$param_value ); + Logger::debug("Setting parameter for macro Class $className, ".$param_name.':'.$param_value ); $dynEl->$param_name = $param_value; } } diff --git a/util/Code.class.php b/util/Code.class.php @@ -21,7 +21,7 @@ * @version $Revision$ * @package openrat.services */ -class Code extends Dynamic +class Code extends Macro { var $code = ''; @@ -30,7 +30,7 @@ class Code extends Dynamic if ( substr($this->code,0,5) != '<?php' ) $this->code = "<?php\n".$this->code."\n?>"; - $tmp = FileUtils::getTempDir().'/openratDynamic'; + $tmp = FileUtils::getTempDir().'/openratMacro'; $tmp .= '.code.php.tmp'; $f = fopen( $tmp,'w' ); diff --git a/util/Macro.class.php b/util/Macro.class.php @@ -0,0 +1,179 @@ +<?php +// OpenRat Content Management System +// Copyright (C) 2002-2012 Jan Dankert, cms@jandankert.de +// +// This program is free software; you can redistribute it and/or +// modify it under the terms of the GNU General Public License +// as published by the Free Software Foundation; either version 2 +// of the License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + +/** + * Service-Klasse fuer allgemeine Interface-Methoden. Insbesondere + * in Code-Elementen kann und soll auf diese Methoden zurueckgegriffen + * werden. + * @author $Author$ + * @version $Revision$ + * @package openrat.services + */ +class Macro +{ + var $project; + var $output = ''; + var $objectid = 0; + var $page; + var $parameters = array(); + var $description = ''; + + + /** + * Ausführen des Makros. Diese Methode sollte durch die Unterklasse überschrieben werden. + */ + public function execute() + { + // overwrite this in subclasses + } + + + /** + * Holt die aktuellen Datenbankverbindung. + */ + public function db() + { + return db_connection(); + } + + + /** + * Holt die aktuelle Objekt-Id. + * @return number + */ + public function getObjectId() + { + return $this->objectid; + } + + + /** + * Holt das aktuelle Objekt. + * @return Object + */ + public function &getObject() + { + return Session::getObject(); + } + + + /** + * Setzt eine Objekt-Id. + * @param unknown_type $objectid + */ + public function setObjectId( $objectid ) + { + $this->objectid = $objectid; + } + + + /** + * Ermittelt die Id des Wurzelordners im aktuellen Projekt. + */ + public function getRootObjectId() + { + $project = Session::getProject(); + return $project->getRootObjectId(); + } + + + /** + * DO NOT USE. + */ + public function folderid() + { + global $SESS; + return $SESS['folderid']; + } + + + /** + * Löscht die bisher erzeugte Ausgabe. + */ + public function delOutput() + { + $this->output = ''; + } + + /** + * Ergänzt die Standardausgabe um den gewünschten Wert. + */ + public function output( $text ) + { + $this->output .= $text; + } + + + /** + * Ergänzt die Standardausgabe um den gewünschten Wert. Es wird ein Zeilenendezeichen ergänzt. + */ + public function outputLn( $text ) + { + $this->output .= $text."\n"; + } + + + /** + * Ermittelt die bisher erstellte Ausgabe. + * @return string + */ + public function getOutput() + { + return $this->output; + } + + + /** + * Setzt eine Sitzungsvariable. + * + * @param String $var + * @param Object $value + */ + public function setSessionVar( $var,$value ) + { + Session::set( $var,$value ); + } + + + /** + * Ermittelt eine Sitzungsvariable. + * + * @param String $var + * @return string + */ + public function getSessionVar( $var ) + { + return Session::get( $var ); + } + + + + /** + * Ermittelt den Pfad auf ein Objekt. + * @param Objekt oder Objekt-Id + */ + public function pathToObject( $obj ) + { + if ( is_object($obj) ) + return $this->page->path_to_object($obj->objectid); + else + return $this->page->path_to_object($obj); + } + +}+ \ No newline at end of file diff --git a/util/include.inc.php b/util/include.inc.php @@ -31,7 +31,7 @@ require_once( OR_SERVICECLASSES_DIR."Password.class.".PHP_EXT ); // Nur bei der Erzeugung von Seiten notwendig. //if ( !empty($REQ[REQ_PARAM_ACTION]) && in_array($REQ[REQ_PARAM_ACTION],array('pageelement','page','folder','element')) ) { - require_once( OR_SERVICECLASSES_DIR."Dynamic.class.".PHP_EXT ); + require_once( OR_SERVICECLASSES_DIR."Macro.class.".PHP_EXT ); } // Nur bei der Erzeugung von Seiten notwendig.