noalyss Version-9
iaction.class.php
Go to the documentation of this file.
1<?php
2/*
3 * This file is part of NOALYSS.
4 *
5 * NOALYSS is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
9 *
10 * NOALYSS is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with NOALYSS; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18*/
19
20// Copyright Author Dany De Bontridder danydb@aevalys.eu
21
22/*!\file
23 * \brief Html Input show just a ref to an action
24 * create a button with a link, if you want to use a javascript
25 * value must be empty
26 */
28{
29 /*!\brief show the html input of the widget*/
30 public function input($p_name="",$p_value="")
31 {
32 $this->name=($p_name=="")?$this->name:$p_name;
33 $this->value=($p_value=="")?$this->value:$p_value;
34 $this->id=($this->id=="")?$this->name:$this->id;
35 if ( $this->readOnly==true) return $this->display();
36 $this->javascript= (!isset ($this->javascript))?"":$this->javascript;
37 if ( $this->value !="")
38 $r=sprintf('<span id="%s" class="action"> <A class="action" HREF="%s" %s>%s</A></span>',
39 $this->id,
40 $this->value,
41 $this->javascript,
42 $this->label);
43 else
44 $r=sprintf('<span id="%s" class="action"> <A class="action" href="javascript: %s">%s</A></span>',
45 $this->id,
46 $this->javascript,
47 $this->label);
48
49 return $r;
50
51 }
52 /*!\brief print in html the readonly value of the widget*/
53 public function display()
54 {
55 return;
56 }
57 static public function test_me()
58 {
59 }
60}
catch(Exception $exc) if(! $g_user->can_write_action($ag_id)) $r
$ret label
$ret javascript
$from_poste name
class widget This class is used to create all the HTML INPUT TYPE and some specials which works with ...
input($p_name="", $p_value="")
show the html input of the widget
display()
print in html the readonly value of the widget
$icard readOnly