[ Index ]
 

Code source de Plume CMS 1.2.2

Accédez au Source d'autres logiciels libres

Classes | Fonctions | Variables | Constantes | Tables

title

Body

[fermer]

/manager/extinc/ -> lib.form.php (source)

   1  <?php
   2  # ***** BEGIN LICENSE BLOCK *****
   3  # Version: MPL 1.1/GPL 2.0/LGPL 2.1
   4  #
   5  # The contents of this file are subject to the Mozilla Public License Version
   6  # 1.1 (the "License"); you may not use this file except in compliance with
   7  # the License. You may obtain a copy of the License at
   8  # http://www.mozilla.org/MPL/
   9  #
  10  # Software distributed under the License is distributed on an "AS IS" basis,
  11  # WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
  12  # for the specific language governing rights and limitations under the
  13  # License.
  14  #
  15  # The Original Code is DotClear Weblog.
  16  #
  17  # The Initial Developer of the Original Code is
  18  # Olivier Meunier.
  19  # Portions created by the Initial Developer are Copyright (C) 2003
  20  # the Initial Developer. All Rights Reserved.
  21  #
  22  # Contributor(s):
  23  #
  24  # Alternatively, the contents of this file may be used under the terms of
  25  # either the GNU General Public License Version 2 or later (the "GPL"), or
  26  # the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
  27  # in which case the provisions of the GPL or the LGPL are applicable instead
  28  # of those above. If you wish to allow use of your version of this file only
  29  # under the terms of either the GPL or the LGPL, and not to allow others to
  30  # use your version of this file under the terms of the MPL, indicate your
  31  # decision by deleting the provisions above and replace them with the notice
  32  # and other provisions required by the GPL or the LGPL. If you do not delete
  33  # the provisions above, a recipient may use your version of this file under
  34  # the terms of any one of the MPL, the GPL or the LGPL.
  35  #
  36  # ***** END LICENSE BLOCK *****
  37   
  38  function php_f_combobox($name,$arryData,$default='',$tabindex='',$class='',$id='', $extra='')
  39  {
  40      $res = '<select name="'.$name.'" ';
  41      
  42      if($class != '')
  43          $res .= 'class="'.$class.'" ';
  44      
  45      if($id != '')
  46          $res .= 'id="'.$id.'" ';
  47      else
  48          $res .= 'id="'.$name.'" ';
  49      $res .= ($tabindex != '') ? 'tabindex="'.$tabindex.'" ' : '';
  50      if($extra != '')
  51          $res .= $extra.' ';
  52      $res .= '>'."\n";
  53      
  54      foreach($arryData as $k => $v)
  55      {
  56          $res .= '<option value="'.$v.'"';
  57          
  58          if($v == $default)
  59              $res .= ' selected="selected"';
  60          
  61          $res .= '>'.$k.'</option>'."\n";
  62      }
  63      
  64      $res .= '</select>'."\n";
  65      
  66      return $res;
  67  }
  68  
  69  function php_f_textField($id,$size,$max,$default='',$tabindex='',$html='')
  70  {
  71      $res = '<input type="text" size="'.$size.'" name="'.$id.'" id="'.$id.'" ';
  72      
  73      $res .= ($max != '') ? 'maxlength="'.$max.'" ' : '';
  74      $res .= ($tabindex != '') ? 'tabindex="'.$tabindex.'" ' : '';
  75      $res .= ($default != '') ? 'value="'.$default.'" ' : '';
  76      $res .= $html;
  77      
  78      $res .= ' />';
  79      
  80      return $res;
  81  }
  82  
  83  function php_f_textArea($id,$cols,$rows,$default='',$tabindex='',$html='')
  84  {
  85      $res = '<textarea cols="'.$cols.'" rows="'.$rows.'" ';
  86      $res .= 'name="'.$id.'" id="'.$id.'" ';
  87      $res .= ($tabindex != '') ? 'tabindex="'.$tabindex.'" ' : '';
  88      $res .= $html.'>';
  89      $res .= $default;
  90      $res .= '</textarea>';
  91      
  92      return $res;
  93  }
  94  
  95  function php_f_button($type='submit',$value='ok',$id='',$tabindex='')
  96  {
  97      $res = '<input type="'.$type.'" value="'.$value.'" ';
  98      $res .= ($id != '') ? 'name="'.$id.'" id="'.$id.'" ' : '';
  99      $res .= ($tabindex != '') ? 'tabindex="'.$tabindex.'" ' : '';
 100      $res .= ' />';
 101      
 102      return $res;
 103  }
 104  
 105  function php_f_hidden($id,$value)
 106  {
 107      return '<input type="hidden" name="'.$id.'" id="'.$id.'" value="'.$value.'" />';
 108  }
 109  
 110  function php_f_checkbox($id, $value, $checked=false,$tabindex='',$html='')
 111  {
 112      $res = '<input type="checkbox" value="'.$value.'" ';
 113      $res .= 'name="'.$id.'" id="'.$id.'" ';
 114      $res .= ($tabindex != '') ? 'tabindex="'.$tabindex.'" ' : '';
 115      $res .= ($checked) ? 'checked="checked" ' : '';
 116      $res .= $html.' />';
 117      
 118      return $res;
 119  }
 120  
 121  
 122  ?>


Généré le : Mon Nov 26 11:57:01 2007 par Balluche grâce à PHPXref 0.7
  Clicky Web Analytics