diff options
| author | David Siegfried <david.siegfried@uni-vechta.de> | 2024-05-15 13:57:30 +0000 |
|---|---|---|
| committer | Jan-Hendrik Willms <tleilax+studip@gmail.com> | 2024-05-15 13:57:30 +0000 |
| commit | 0f1d1b14280562f5ff6a64d103979204d8d2a22d (patch) | |
| tree | 4c1e48c3497c52bb18087f27f961ae46d31c2e7c /lib/evaluation/classes/HTMLempty.class.php | |
| parent | 152ef0e0f92afde613b65842aaffbd0da95d5bbd (diff) | |
remove old evaluation, fixes #3787
Closes #3787
Merge request studip/studip!2661
Diffstat (limited to 'lib/evaluation/classes/HTMLempty.class.php')
| -rw-r--r-- | lib/evaluation/classes/HTMLempty.class.php | 184 |
1 files changed, 0 insertions, 184 deletions
diff --git a/lib/evaluation/classes/HTMLempty.class.php b/lib/evaluation/classes/HTMLempty.class.php deleted file mode 100644 index 574816f..0000000 --- a/lib/evaluation/classes/HTMLempty.class.php +++ /dev/null @@ -1,184 +0,0 @@ -<?php -# Lifter002: TODO -# Lifter007: TODO -# Lifter003: TODO -# Lifter010: TODO -/** - * HTML-class for the Stud.IP-project. - * Based on scripts from "http://tut.php-q.net/". - * - * @author Alexander Willner <mail@AlexanderWillner.de> - * - * @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 - // <option selected> kennt - if (preg_match('/^[a-zA-Z\.:][\w\-_\.:]*$/i', $name)) { - $this->_attribute[$name] = $name; - // Da wir gültiges HTML bzw XML schreiben - // muss jedes Attribut auch einen Wert haben - // selected wird dann zu selected="selected" - } else { - trigger_error("Unerlaubter Name für ein HTML-Attribut : '" . $name . "'", E_USER_ERROR); - } - } elseif (is_array($name)) { - // Jedes Arrayelement durchgehen - foreach ($name as $key => $wert) { - if (is_int($key)) { - // Arrayelement wurde mit $foo[] hinzugefügt - // also ohne Schlüssel. Ich nehme dann an - // das es sich um ein Attribut wie - // 'selected' oder 'readonly' handelt - if (preg_match('/^[a-zA-Z\.:][\w\-_\.:]*$/i', $wert)) { - $this->_attribute[$wert] = $wert; - } else { - trigger_error("Unerlaubter Name für ein HTML-Attribut : '" . - $wert . "'", E_USER_ERROR); - } - } else { - $key = (string)$key; - if (preg_match('/^[a-zA-Z\.:][\w\-_\.:]*$/i', $key)) { - $this->_attribute[$key] = $wert; - } else { - trigger_error("Unerlaubter Name für ein HTML-Attribut : '" . - $key . "'", E_USER_ERROR); - } - } - } - } else { - trigger_error("Erster Parameter muss ein Scalar oder ein Array sein", - E_USER_ERROR); - } - } - } - - /** - * to support Stud.IP legacy functions like makeButton... - */ - public function addString($string) - { - if (is_array($string)) { - $string = implode(' ', $string); - } - $this->_string .= " " . $string; - } - - /** - * - */ - public function getName() - { - return $this->_name; - } - - /** - * - */ - public function getAttr() - { - return $this->_attribute; - } - - /** - * - */ - public function printContent($indent = 0) - { - echo $this->createContent($indent); - } - - /** - * - */ - public function createContent($indent = 0) - { - $str = str_repeat(' ', $indent); - $str .= "<" . $this->getName(); - $attrib = $this->getAttr(); - foreach ($attrib as $name => $value) { - $str .= ' ' . $name . '="' . htmlReady($value) . '"'; - } - $str .= $this->_string; - $str .= ">\n"; - - return ($str); - } -} |
