File modules/cms/macros/macro/Link.class.php

Last commit: Sun Dec 5 20:33:24 2021 +0100	dankert	Cleanup: Removed unusable properties from class 'Value' and 'BaseObject'.
1 <?php 2 namespace cms\macros\macro; 3 // --------------------------------------------------------------------------- 4 // $Id$ 5 // --------------------------------------------------------------------------- 6 // OpenRat Content Management System 7 // Copyright (C) 2002 Jan Dankert, jandankert@jandankert.de 8 // 9 // This program is free software; you can redistribute it and/or 10 // modify it under the terms of the GNU General Public License 11 // as published by the Free Software Foundation; either version 2 12 // of the License, or (at your option) any later version. 13 // 14 // This program is distributed in the hope that it will be useful, 15 // but WITHOUT ANY WARRANTY; without even the implied warranty of 16 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 // GNU General Public License for more details. 18 // 19 // You should have received a copy of the GNU General Public License 20 // along with this program; if not, write to the Free Software 21 // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 22 // --------------------------------------------------------------------------- 23 // $Log$ 24 // Revision 1.2 2005-01-04 19:59:55 dankert 25 // Allgemeine Korrekturen, Erben von "Dynamic"-klasse 26 // 27 // Revision 1.1 2004/11/10 22:43:35 dankert 28 // Beispiele fuer dynamische Templateelemente 29 // 30 // --------------------------------------------------------------------------- 31 use cms\model\BaseObject; 32 use util\Macro; 33 34 35 /** 36 * Erstellen eines Links. 37 * 38 * @author Jan Dankert 39 */ 40 class NextPage extends Macro 41 { 42 public $targetid = 0; 43 public $classes = ''; 44 public $name = ''; 45 public $title = ''; 46 47 function execute() 48 { 49 // Lesen des Ordners 50 $o = new BaseObject( $this->targetid ); 51 $o->load(); 52 53 if ( empty($this->name ) ) $this->name = $o->getNameForLanguage( $this->pageContext->languageId )->name; 54 if ( empty($this->title) ) $this->title = $o->getNameForLanguage( $this->pageContext->languageId )->description; 55 56 $this->output( '<a href="'.$this->pathToObject($this->targetid).' title="'.$this->title.'" class="'.$this->classes.'">'.$this->name.'</a>' ); 57 } 58 }
Download modules/cms/macros/macro/Link.class.php
History Sun, 5 Dec 2021 20:33:24 +0100 dankert Cleanup: Removed unusable properties from class 'Value' and 'BaseObject'. Sun, 23 Feb 2020 04:49:34 +0100 Jan Dankert Refactoring with Namespaces for the cms modules, part 2. Sun, 23 Feb 2020 04:01:30 +0100 Jan Dankert Refactoring with Namespaces for the cms modules, part 1: moving.