* * @copyright 2004 Stud.IP-Project * @access public * @package evaluation * @modulegroup evaluation_modules * */ // +--------------------------------------------------------------------------+ // This file is part of Stud.IP // Copyright (C) 2001-2004 Stud.IP // +--------------------------------------------------------------------------+ // 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 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. // +--------------------------------------------------------------------------+ class HTMLempty { # Define all required variables ============================================= # /** * Holds the name of the element. * * @access private * @var string $_name */ var $_name = ""; /** * Holds the attributes of the element. * * @access private * @var array $_attribute */ var $_attribute = []; /** * Holds additional attributes (strings generated from studip functions) * * @access private * @var array $_string */ var $_string = ""; # ============================================================ end: variables # # Define constructor and destructor ========================================= # public function __construct($name) { if (preg_match('/^[a-zA-Z.:][\w\-_\.:]*$/i', $name)) { $this->_name = $name; } else { trigger_error("Unerlaubter Name für ein HTML-Element : '" . $name . "'", E_USER_ERROR); } } /** * */ public function addAttr($name, $wert = null) { if (isset ($wert)) { $name = (string)$name; if (preg_match('/^[a-zA-Z.:][\w\-_\.:]*$/i', $name)) { $this->_attribute[$name] = $wert; } else { trigger_error("Unerlaubter Name für ein HTML-Attribut : '" . $name . "'", E_USER_ERROR); } } else { if (is_scalar($name)) { // Dies braucht man, falls man Attribute hinzufügen // will, die keinen Wert haben, wie man es bei //