, Suchi & Berg GmbH * @access public * @modulegroup extern * @module ExternEditGeneric * @package studip_extern */ // +---------------------------------------------------------------------------+ // This file is part of Stud.IP // ExternEditGeneric.class.php // // Copyright (C) 2003 Peter Thienel , // Suchi & Berg GmbH // +---------------------------------------------------------------------------+ // 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 ExternEditGeneric extends ExternEdit { function __construct (&$config, $form_values = "", $faulty_values = "", $edit_element = "") { parent::__construct($config, $form_values, $faulty_values, $edit_element); } /** * Prints out a form with a pull-down field for different font-faces. * * @param string attribute The name of the attribute (Syntax: [tag-name]_[attribute_name]) * @param string title The title of this form. * @param string info The info text. */ function editFaceGeneric ($attribute, $title, $info) { $faces = [ "" => _("keine Auswahl"), "Arial,Helvetica,sans-serif" => _("serifenlose Schrift"), "Times,Times New Roman,serif" => _("Serifenschrift"), "Courier,Courier New,monospace" => _("diktengleiche Schrift") ]; $form_name = $this->element_name . "_" . $attribute; $value = $this->getValue($attribute); $invalidClass = $this->faulty_values[$form_name][0] ? "class=\"invalid\" " : ""; $out = ""; return $out; } /** * Prints out a form with a text field. * * @param string attribute The name of the attribute (Syntax: [tag-name]_[attribute_name]) * @param mixed title The title(s) of the textfield(s). * @param string info The info text. * @param int size The size (length) of this textfield. * @param int maxlength The maximal length of the text. */ function editTextfieldGeneric ($attribute, $title, $info, $size, $maxlength) { $form_name = $this->element_name . "_" . $attribute; $value = $this->getValue($attribute); if (is_array($title)) { $out = ""; for($i = 0; $i < count($title); $i++) { $invalidClass = $this->faulty_values[$form_name][$i] ? "class=\"invalid\" " : ""; $out .= ""; } return $out; } $invalidClass = $this->faulty_values[$form_name][0] ? "class=\"invalid\" " : ""; $out .= ""; return $out; } /** * Prints out a Form with a textarea. * * @param string attribute The name of the attribute (Syntax: [tag-name]_[attribute_name]) * @param string title The title of this textarea. * @param string info The info text. * @param int rows The number of rows of this textarea. * @param int cols The number of columns of this textarea. */ function editTextareaGeneric ($attribute, $title, $info, $rows, $cols) { $form_name = $this->element_name . "_" . $attribute; $value = $this->getValue($attribute); $invalidClass = $this->faulty_values[$form_name][0] ? "class=\"invalid\" " : ""; $out = ""; return $out; } /** * Prints out a Form with checkboxes. * * @param string attribute The name of the attribute (Syntax: [tag-name]_[attribute_name]) * @param string title The title of this form with checkboxes. * @param string info The info text. * @param array check_values The values of the checkboxes. * @param array check_names The names of the checkboxes. */ function editCheckboxGeneric ($attribute, $title, $info, $check_values, $check_names) { $form_name = $this->element_name . "_" . $attribute; $value = $this->getValue($attribute); $size = 0; if(is_array($check_values)) { $size = count($check_values); } $out = ""; if ($size > 1) { // $form_name .= "[]"; if (is_array($title)) { for ($i = 0; $i < $size; $i++) { $invalidClass = $this->faulty_values[$form_name][$i] ? "class=\"invalid\" " : ""; $out .= "