From 5bc6639d9ce42aa2506150002894dc61f1ea49c0 Mon Sep 17 00:00:00 2001 From: Roland Gruber Date: Wed, 23 Mar 2011 17:53:43 +0000 Subject: [PATCH] target window for links, added htmlHorizontalLine --- lam/lib/html.inc | 45 +++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 43 insertions(+), 2 deletions(-) diff --git a/lam/lib/html.inc b/lam/lib/html.inc index 252ac0d5..633edfbb 100644 --- a/lam/lib/html.inc +++ b/lam/lib/html.inc @@ -3,7 +3,7 @@ $Id$ This code is part of LDAP Account Manager (http://www.ldap-account-manager.org/) - Copyright (C) 2010 Roland Gruber + Copyright (C) 2010 - 2011 Roland Gruber 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 @@ -1954,6 +1954,8 @@ class htmlLink extends htmlElement { private $image = null; /** title */ private $title = null; + /** target window */ + private $targetWindow = null; /** * Constructor. @@ -1988,7 +1990,11 @@ class htmlLink extends htmlElement { if ($this->title != null) { $title = ' title="' . $this->title . '"'; } - echo '' . $image . $this->text . ''; + $targetWindow = ''; + if ($this->targetWindow != null) { + $targetWindow = ' target="' . $this->targetWindow . '"'; + } + echo '' . $image . $this->text . ''; return array(); } @@ -2001,6 +2007,15 @@ class htmlLink extends htmlElement { $this->title = htmlspecialchars($title); } + /** + * Sets the target window (e.g. _blank). + * + * @param String $window target window (e.g. _blank) + */ + public function setTargetWindow($window) { + $this->targetWindow = htmlspecialchars($window); + } + } /** @@ -2045,4 +2060,30 @@ class htmlGroup extends htmlElement { } +/** + * Prints a horizontal line. + * + * @package metaHTML + */ +class htmlHorizontalLine extends htmlElement { + + /** + * Prints the HTML code for this element. + * + * @param string $module Name of account module + * @param array $input List of meta-HTML elements + * @param array $values List of values which override the defaults in $input (name => value) + * @param boolean $restricted If true then no buttons will be displayed + * @param integer $tabindex Start value of tabulator index for input fields + * @param string $scope Account type + * @return array List of input field names and their type (name => type) + */ + function generateHTML($module, $input, $values, $restricted, &$tabindex, $scope) { + $return = array(); + echo "
"; + return $return; + } + +} + ?>