XOOPS 2.5.6  Final
 All Classes Namespaces Files Functions Variables Pages
formbuttontray.php
Go to the documentation of this file.
1 <?php
14 defined('XOOPS_ROOT_PATH') or die('Restricted access');
15 
31  var $_value;
32 
39  var $_type;
40 
49  function XoopsFormButtonTray( $name, $value = '', $type = '', $onclick = '', $showDelete = false ) {
50  $this->setName( $name );
51  $this->setValue( $value );
52  $this->_type = ( !empty( $type ) ) ? $type : 'submit';
53  $this->_showDelete = $showDelete;
54  if ( $onclick ) {
55  $this->setExtra( $onclick );
56  } else {
57  $this->setExtra( '' );
58  }
59  }
60 
66  function getValue() {
67  return $this->_value;
68  }
69 
76  function setValue( $value ) {
77  $this->_value = $value;
78  }
79 
85  function getType() {
86  return $this->_type;
87  }
88 
94  function render() {
95  // onclick="this.form.elements.op.value=\'delfile\';
96  $ret = '';
97  if ( $this->_showDelete ) {
98  $ret .= '<input type="submit" class="formbutton" name="delete" id="delete" value="' . _DELETE . '" onclick="this.form.elements.op.value=\'delete\'">&nbsp;';
99  }
100  $ret .= '<input type="button" value="' . _CANCEL . '" onClick="history.go(-1);return true;" />&nbsp;<input type="reset" class="formbutton" name="reset" id="reset" value="' . _RESET . '" />&nbsp;<input type="' . $this->getType() . '" class="formbutton" name="' . $this->getName() . '" id="' . $this->getName() . '" value="' . $this->getValue() . '"' . $this->getExtra() . ' />';
101  return $ret;
102  }
103 }
104 
105 ?>