XOOPS RMCommon Utilities  2.1.8.91RC
 All Classes Namespaces Files Functions Variables
RMForm Class Reference

Public Member Functions

 __construct ($title, $name, $action, $method='post', $addtoken=true)
 
 addElement (&$element, $required=false, $css_type='')
 
 addValidateField ($name, $type='', $required=0, $text='')
 
 clear ($field= '')
 
 cssfile ()
 
 display ($js=true)
 
element ($name)
 
 elements ()
 
 evenClass ($value)
 
 footClass ($value)
 
 getAction ()
 
 getExtra ()
 
 getName ()
 
 getTinyCSS ()
 
 getTitle ()
 
 headClass ($value)
 
 method ()
 
 oddClass ($value)
 
 render ($form_tag=true)
 
 renderForTemplate ()
 
 setAction ($action)
 
 setExtra ($extra)
 
 setMethod ($method)
 
 setName ($name)
 
 setRowExtras ($extra, $id)
 
 setTinyTags ($tags)
 
 setTitle ($value)
 
 styles ($style, $id)
 
 tableClass ($value)
 
 thClass ($value)
 
 tinyCSS ($url)
 
 tinyTags ()
 

Protected Attributes

 $_action = ''
 
 $_extra = ''
 
 $_method = ''
 
 $_name = ''
 
 $_title = ''
 

Private Member Functions

 getType ($type)
 

Private Attributes

 $_addtoken = true
 
 $_alertColor = '#FF0000'
 
 $_evenClass = 'even'
 
 $_evenStyle =''
 
 $_fields = array()
 
 $_footClass = 'foot'
 
 $_footStyle =''
 
 $_headClass = 'head'
 
 $_headStyle =''
 
 $_oddClass = 'odd'
 
 $_oddSpanStyle
 
 $_oddStyle =''
 
 $_okColor = '#000'
 
 $_othervalidates = ''
 
 $_tableClass = 'outer'
 
 $_thClass = ''
 
 $_thStyle =''
 
 $_tinycss = ''
 
 $_tinytheme = 'advanced'
 
 $editores = ''
 
 $row_extras = array()
 
 $tiny_valid_tags = 'a[name|href|target|title|onclick],code[class,id],img[class|src|border=0|alt|title|hspace|vspace|width|height|align|onmouseover|onmouseout|name|longdesc|style],hr[class|width|size|noshade],font[face|size|color|style],span[class|align|style]'
 

Detailed Description

Esta clase controla la generación de formularios automáticamente.
Esta clase es un sustituto par ala clase XoopsForm

Definition at line 78 of file form.class.php.

Constructor & Destructor Documentation

RMForm::__construct (   $title,
  $name,
  $action,
  $method = 'post',
  $addtoken = true 
)
Parameters
string$titleTitulo que se desplegar en la tabla del formulario
string$nameNombre del formulario
string$actionPost o Get (Default post)
bool$addtokenCrea el cdigo de seguridad de la sesin con el formulario (default true)

Definition at line 118 of file form.class.php.

References $action, $xoopsSecurity, addElement(), RMTemplate\get(), and RMCURL.

Here is the call graph for this function:

Member Function Documentation

RMForm::addElement ( $element,
  $required = false,
  $css_type = '' 
)

Agregamos nuevos elementos Estos elementos son instanacias de algun elemento de formulario

Parameters
RMFormElement$element
bool$requiredtrue = Elemento requerido
string$css_typeContent Type: email,url, etc.

Definition at line 242 of file form.class.php.

References $ret.

Referenced by __construct().

Here is the caller graph for this function:

RMForm::addValidateField (   $name,
  $type = '',
  $required = 0,
  $text = '' 
)

Agrega una cadena para comprobar un campo

Definition at line 355 of file form.class.php.

RMForm::clear (   $field = '')

Limpiamos el array de elementos creados con la funcin addElement()

Returns
void

Definition at line 223 of file form.class.php.

References $field.

RMForm::cssfile ( )

Return the path for default style sheet

Definition at line 216 of file form.class.php.

RMForm::display (   $js = true)

Escribe directamente el conetnido HTML con la funcin echo

Definition at line 479 of file form.class.php.

References RMTemplate\get_template().

Here is the call graph for this function:

& RMForm::element (   $name)

Definition at line 270 of file form.class.php.

RMForm::elements ( )

Definition at line 266 of file form.class.php.

References $_fields.

RMForm::evenClass (   $value)

Extablece la clase 'CSS' para celdas impares

Parameters
string$value

Definition at line 304 of file form.class.php.

RMForm::footClass (   $value)

Estilo 'CSS' para el pie del formulario

Parameters
string$value

Definition at line 318 of file form.class.php.

RMForm::getAction ( )

Recupera el destion del formulario

Returns
string URL del documento

Definition at line 209 of file form.class.php.

References $_action.

RMForm::getExtra ( )

Devuelve el contenido extra del tag FORM

Returns
string

Definition at line 168 of file form.class.php.

References $_extra.

RMForm::getName ( )

Recupera el nombre del formulario

Returns
string

Definition at line 195 of file form.class.php.

References $_name.

RMForm::getTinyCSS ( )

Definition at line 369 of file form.class.php.

References $tiny, and TinyEditor\getInstance().

Here is the call graph for this function:

RMForm::getTitle ( )

Obtiene el ttulo del formulario

Returns
string "titulo del formulario"

Definition at line 151 of file form.class.php.

References $_title.

RMForm::getType (   $type)
private

Funcin para devolver el tipo correcto de campo para la validacin del Formulario Esta funcin acepta como parmetro uno de los siguientes valores: Email, Num, Range y Select. Un rango debe proporcionarse con el formato RangeX,Y

Parameters
string$type

Definition at line 463 of file form.class.php.

References $type, and elseif().

Here is the call graph for this function:

RMForm::headClass (   $value)

Establece la clase 'CSS' para usar para las celdas marcadas como 'pseudo-encabezados'

Parameters
string$valueNombre de la clase

Definition at line 297 of file form.class.php.

RMForm::method ( )

Definition at line 181 of file form.class.php.

References $_method.

RMForm::oddClass (   $value)

Extablece la clase 'CSS' para celdas pares

Parameters
string$value

Definition at line 311 of file form.class.php.

RMForm::render (   $form_tag = true)

Generamos el cdigo HTML del formulario. Esta funcin automticamente llama a la funcin render() de los elementos del formulario (EXMFormElement) para generar a su vez su propia salida HTML

Returns
string Todo el cdigo HTML del formulario

Generamos el cdigo JavaScript para comprobación del formulario

Definition at line 391 of file form.class.php.

References RMTemplate\get_template().

Here is the call graph for this function:

RMForm::renderForTemplate ( )

Crea el formulario y lo asigna a una matriz para un mayor control sobre la presentación de los campos

Parameters
stringNombre de la variable smarty
stringPlantilla que se utilizará
boolIncluir javascript

Definition at line 408 of file form.class.php.

References $_title, $field, $GLOBALS, $rtn, and __().

Here is the call graph for this function:

RMForm::setAction (   $action)

Establece el script donde se procesar el formulario

Parameters
string$actionUrl del documento destino

Definition at line 202 of file form.class.php.

References $action.

RMForm::setExtra (   $extra)

Establece la informacin adicional del formulario. Mediante esta funcin se puede pasar informacin de estilos tipos enctype u otra informacin adicional que se desee incluir dentro del tag <form ..>

Parameters
string$extra

Definition at line 161 of file form.class.php.

RMForm::setMethod (   $method)

Establece el mtodo de envo del formulario el cual puede ser 'POST' o 'GET'

Parameters
string$method(post o get)

Definition at line 176 of file form.class.php.

RMForm::setName (   $name)

Establece el nombre del formulario

Parameters
string$name

Definition at line 188 of file form.class.php.

RMForm::setRowExtras (   $extra,
  $id 
)

Establece información extra para las diferentes filas de la tabla generada por la clase. Estas deben llamarse por medio de su id. Mucho cuidado con la utilización de este método pues no se hace nignuna comprobación especial de los parámetros pasados.

Parameters
stringDatos extra
stringId de la fila. Debe iniciar con row_

Definition at line 381 of file form.class.php.

References $id.

RMForm::setTinyTags (   $tags)

Establece las etiquetas HTML válidas para Tiny

Parameters
string$tags

Definition at line 488 of file form.class.php.

References $tiny, and TinyEditor\getInstance().

Here is the call graph for this function:

RMForm::setTitle (   $value)

Establece o modifica el ttulo del formulario

Parameters
string$value

Definition at line 144 of file form.class.php.

RMForm::styles (   $style,
  $id 
)

Establece los estilos de los diferentes elementos de la tabla

Parameters
stringEstilo CSS del elemento
stringId del elemento (odd, even, head, th, foot, oddspan)

Definition at line 327 of file form.class.php.

References $id.

RMForm::tableClass (   $value)

Las siguientes funciones dan formato a la tabla creada por esta clase Establece la clase CSS de ta tabla

Parameters
string$value

Definition at line 283 of file form.class.php.

RMForm::thClass (   $value)

Establece la clase 'CSS' de las celdas de encabezado

Parameters
$string$value Nombre de la clase

Definition at line 290 of file form.class.php.

RMForm::tinyCSS (   $url)

Set de funciones útiles únicamente con el editor TinyMCE

Definition at line 365 of file form.class.php.

References $tiny, $url, and TinyEditor\getInstance().

Here is the call graph for this function:

RMForm::tinyTags ( )

Definition at line 492 of file form.class.php.

References $tiny, and TinyEditor\getInstance().

Here is the call graph for this function:

Member Data Documentation

RMForm::$_action = ''
protected

Definition at line 82 of file form.class.php.

Referenced by getAction().

RMForm::$_addtoken = true
private

Definition at line 93 of file form.class.php.

RMForm::$_alertColor = '#FF0000'
private

Definition at line 102 of file form.class.php.

RMForm::$_evenClass = 'even'
private

Definition at line 90 of file form.class.php.

RMForm::$_evenStyle =''
private

Definition at line 96 of file form.class.php.

RMForm::$_extra = ''
protected

Definition at line 83 of file form.class.php.

Referenced by getExtra().

RMForm::$_fields = array()
private

Definition at line 80 of file form.class.php.

Referenced by elements().

RMForm::$_footClass = 'foot'
private

Definition at line 92 of file form.class.php.

RMForm::$_footStyle =''
private

Definition at line 99 of file form.class.php.

RMForm::$_headClass = 'head'
private

Definition at line 89 of file form.class.php.

RMForm::$_headStyle =''
private

Definition at line 97 of file form.class.php.

RMForm::$_method = ''
protected

Definition at line 84 of file form.class.php.

Referenced by method().

RMForm::$_name = ''
protected

Definition at line 81 of file form.class.php.

Referenced by getName().

RMForm::$_oddClass = 'odd'
private

Definition at line 91 of file form.class.php.

RMForm::$_oddSpanStyle
private

Definition at line 95 of file form.class.php.

RMForm::$_oddStyle =''
private

Definition at line 94 of file form.class.php.

RMForm::$_okColor = '#000'
private

Definition at line 103 of file form.class.php.

RMForm::$_othervalidates = ''
private

Definition at line 101 of file form.class.php.

RMForm::$_tableClass = 'outer'
private

Definition at line 87 of file form.class.php.

RMForm::$_thClass = ''
private

Definition at line 88 of file form.class.php.

RMForm::$_thStyle =''
private

Definition at line 98 of file form.class.php.

RMForm::$_tinycss = ''
private

Definition at line 107 of file form.class.php.

RMForm::$_tinytheme = 'advanced'
private

Definition at line 106 of file form.class.php.

RMForm::$_title = ''
protected

Definition at line 85 of file form.class.php.

Referenced by getTitle(), and renderForTemplate().

RMForm::$editores = ''
private

Definition at line 105 of file form.class.php.

RMForm::$row_extras = array()
private

Definition at line 110 of file form.class.php.

RMForm::$tiny_valid_tags = 'a[name|href|target|title|onclick],code[class,id],img[class|src|border=0|alt|title|hspace|vspace|width|height|align|onmouseover|onmouseout|name|longdesc|style],hr[class|width|size|noshade],font[face|size|color|style],span[class|align|style]'
private

Definition at line 108 of file form.class.php.


The documentation for this class was generated from the following file: