source: admin/WebConsole/includes/HTMLCTEMULSELECT.php @ 137ceb4

918-git-images-111dconfigfileconfigure-oglivegit-imageslgromero-new-oglivemainmaint-cronmount-efivarfsmultivmmultivm-ogboot-installerogClonningEngineogboot-installer-jenkinsoglive-ipv6test-python-scriptsticket-301ticket-50ticket-50-oldticket-577ticket-585ticket-611ticket-612ticket-693ticket-700ubu24tplunification2use-local-agent-oglivevarios-instalacion
Last change on this file since 137ceb4 was 9f1274e, checked in by ramon <ramongomez@…>, 7 years ago

#804: Sustituir funciones para compatibilidad con PHP 7 (split por explode y ereg... por preg_...).

git-svn-id: https://opengnsys.es/svn/branches/version1.1@5619 a21b9725-9963-47de-94b9-378ad31fedc9

  • Property mode set to 100644
File size: 1.7 KB
RevLine 
[043e67d]1<?php
[3ec149c]2// *************************************************************************************************************************************************
3// Aplicación WEB: ogAdmWebCon.
4// Autor: José Manuel Alonso (E.T.S.I.I.) Universidad de Sevilla
5// Fecha Creación: 2009-2010
6// Fecha Última modificación: Agosto-2010
7// Nombre del fichero: HTMLCTEMULSELECT.php
8// Descripción :
9//              Crea la etiqueta html <SELECT> multiselección, de valores constantes
10//      Parametros:
11//              - parametros: Una cadena con la forma valor=literal separada por un caracter INTRO
12//              - nombreid: Nombre del desplegable (atributo HTML name)
13//              - tbvalor: Array con los valores de las opciones que aparecerán seleccionadas
14//              - clase: Clase que define su estilo
15//              - eventochg: Nombre de la función que se ejecutará en respuesta al evento onchange( por defecto: ninguna)
16//              - ancho: Anchura del desplegable
17//              - alto: Altura del desplegable
18// *************************************************************************************************************************************************
19function HTMLCTEMULSELECT($parametros,$nombreid,$tbvalor,$clase,$eventochg,$ancho,$alto){
20        if (!empty($eventochg)) $eventochg='onchange="'.$eventochg.'(this);"';
21        if (empty($clase))      $clase='formulariodatos';
22        $x=0;
[9f1274e]23        $opciones=explode(chr(13),$parametros);
[3ec149c]24        $SelectHtml= '<SELECT '.$eventochg.' class="'.$clase.'" name="'.$nombreid.'" multiple size='.$alto.' style="WIDTH: '.$ancho.'">';
25        for($i=0;$i<sizeof($opciones);$i++){
[9f1274e]26                $item=explode("=",$opciones[$i]);
[3ec149c]27                $SelectHtml.= '<OPTION value="'.$item[0].'"';
28                if (isset($tbvalor[$x])){
29                        if($tbvalor[$x]==$item[0]) {
30                                $SelectHtml.=" selected ";
31                                $x++;
32                        }
33                }
34                $SelectHtml.= '>'.$item[1].'</OPTION>';
35        }
36        return($SelectHtml);
[9f1274e]37}
Note: See TracBrowser for help on using the repository browser.