| [3ec149c] | 1 | <? | 
|---|
 | 2 | // ************************************************************************************************************************************************* | 
|---|
 | 3 | // Aplicación WEB: ogAdmWebCon | 
|---|
 | 4 | // Autor: José Manuel Alonso (E.T.S.I.I.) Universidad de Sevilla | 
|---|
 | 5 | // Fecha Creación: Año 2009-2010 | 
|---|
 | 6 | // Fecha Última modificación: Agosto-2010 | 
|---|
 | 7 | // Nombre del fichero: imagenes.php | 
|---|
 | 8 | // Descripción :  | 
|---|
 | 9 | //              Administra imágenes de un determinado Centro | 
|---|
 | 10 | // ************************************************************************************************************************************************* | 
|---|
 | 11 | include_once("../includes/ctrlacc.php"); | 
|---|
 | 12 | include_once("../clases/AdoPhp.php"); | 
|---|
 | 13 | include_once("../clases/XmlPhp.php"); | 
|---|
 | 14 | include_once("../clases/ArbolVistaXML.php"); | 
|---|
 | 15 | include_once("../clases/MenuContextual.php"); | 
|---|
 | 16 | include_once("../includes/constantes.php"); | 
|---|
 | 17 | include_once("../includes/CreaComando.php"); | 
|---|
 | 18 | include_once("../idiomas/php/".$idioma."/imagenes_".$idioma.".php"); | 
|---|
 | 19 | //________________________________________________________________________________________________________ | 
|---|
 | 20 | $cmd=CreaComando($cadenaconexion); | 
|---|
 | 21 | if (!$cmd) | 
|---|
 | 22 |         Header('Location: '.$pagerror.'?herror=2');  // Error de conexión con servidor B.D. | 
|---|
 | 23 | else | 
|---|
 | 24 |         $arbolXML=CreaArbol($cmd,$idcentro); // Crea el arbol XML con todos las acciones registradas en el Centro | 
|---|
 | 25 | // Creación del árbol | 
|---|
 | 26 | $baseurlimg="../images/signos"; // Url de las imágenes de signo | 
|---|
 | 27 | $clasedefault="texto_arbol"; // Hoja de estilo (Clase por defecto) del árbol | 
|---|
 | 28 | $arbol=new ArbolVistaXML($arbolXML,0,$baseurlimg,$clasedefault,1,0,5); | 
|---|
 | 29 | //________________________________________________________________________________________________________ | 
|---|
 | 30 | ?> | 
|---|
 | 31 | <HTML> | 
|---|
 | 32 | <TITLE>Administración web de aulas</TITLE> | 
|---|
 | 33 | <HEAD> | 
|---|
 | 34 |         <meta http-equiv="Content-Type" content="text/html;charset=UTF-8"> | 
|---|
 | 35 |         <LINK rel="stylesheet" type="text/css" href="../estilos.css"> | 
|---|
 | 36 |         <SCRIPT language="javascript" src="../clases/jscripts/ArbolVistaXML.js"></SCRIPT> | 
|---|
 | 37 |         <SCRIPT language="javascript" src="../clases/jscripts/MenuContextual.js"></SCRIPT> | 
|---|
 | 38 |         <SCRIPT language="javascript" src="../jscripts/imagenes.js"></SCRIPT> | 
|---|
 | 39 |         <SCRIPT language="javascript" src="../jscripts/opciones.js"></SCRIPT> | 
|---|
 | 40 |         <SCRIPT language="javascript" src="../jscripts/constantes.js"></SCRIPT> | 
|---|
 | 41 |         <SCRIPT language="javascript" src="../jscripts/comunes.js"></SCRIPT>     | 
|---|
 | 42 |         <SCRIPT language="javascript" src="../clases/jscripts/HttpLib.js"></SCRIPT> | 
|---|
 | 43 |         <? echo '<SCRIPT language="javascript" src="../idiomas/javascripts/'.$idioma.'/comunes_'.$idioma.'.js"></SCRIPT>'?> | 
|---|
 | 44 |         <? echo '<SCRIPT language="javascript" src="../idiomas/javascripts/'.$idioma.'/imagenes_'.$idioma.'.js"></SCRIPT>'?> | 
|---|
 | 45 | </HEAD> | 
|---|
 | 46 | <BODY OnContextMenu="return false"> | 
|---|
 | 47 | <? | 
|---|
 | 48 | //________________________________________________________________________________________________________ | 
|---|
 | 49 | echo $arbol->CreaArbolVistaXML();       // Crea árbol (HTML) a partir del XML | 
|---|
 | 50 | $flotante=new MenuContextual();                 // Crea objeto MenuContextual | 
|---|
 | 51 |  | 
|---|
 | 52 | // Crea contextual de las imágenes | 
|---|
 | 53 |  $XMLcontextual=CreacontextualXMLImagenes(); | 
|---|
 | 54 |  echo $flotante->CreaMenuContextual($XMLcontextual); | 
|---|
 | 55 |  $XMLcontextual=ContextualXMLGruposImagenes(); // Grupos de imágenes | 
|---|
 | 56 |  echo $flotante->CreaMenuContextual($XMLcontextual); | 
|---|
 | 57 |  $XMLcontextual=CreacontextualXMLImagen(); // Imágenes | 
|---|
 | 58 |  echo $flotante->CreaMenuContextual($XMLcontextual); | 
|---|
 | 59 | ?> | 
|---|
 | 60 | </BODY> | 
|---|
 | 61 | </HTML> | 
|---|
 | 62 | <? | 
|---|
 | 63 | // ************************************************************************************************************************************************* | 
|---|
 | 64 | //      Devuelve una cadena con formato XML con toda la información de las imáges registradas en un Centro concreto | 
|---|
 | 65 | //      Parametros:  | 
|---|
 | 66 | //              - cmd:Una comando ya operativo ( con conexión abierta)   | 
|---|
 | 67 | //              - idcentro: El identificador del centro | 
|---|
 | 68 | //________________________________________________________________________________________________________ | 
|---|
 | 69 | function CreaArbol($cmd,$idcentro){ | 
|---|
 | 70 |         global $TbMsg; | 
|---|
 | 71 |         global $LITAMBITO_IMAGENES; | 
|---|
 | 72 |         $cadenaXML='<RAIZ'; | 
|---|
 | 73 |         // Atributos | 
|---|
 | 74 |         $cadenaXML.=' imagenodo="../images/iconos/imagenes.gif"'; | 
|---|
 | 75 |         $cadenaXML.=' nodoid=Raiz'.$LITAMBITO_IMAGENES; | 
|---|
 | 76 |         $cadenaXML.=' infonodo="'.$TbMsg[9].'"'; | 
|---|
 | 77 |         $cadenaXML.=' clickcontextualnodo="menu_contextual(this,' ."'flo_Raiz".$LITAMBITO_IMAGENES."'".')"'; | 
|---|
 | 78 |         $cadenaXML.='>'; | 
|---|
 | 79 |         $cadenaXML.=SubarbolXML_grupos_imagenes($cmd,$idcentro,0); | 
|---|
 | 80 |         $cadenaXML.='</RAIZ>'; | 
|---|
 | 81 |         return($cadenaXML); | 
|---|
 | 82 | } | 
|---|
 | 83 | //________________________________________________________________________________________________________ | 
|---|
 | 84 | function SubarbolXML_grupos_imagenes($cmd,$idcentro,$grupoid){ | 
|---|
 | 85 |         global $LITAMBITO_GRUPOSIMAGENES; | 
|---|
 | 86 |         global $AMBITO_GRUPOSIMAGENES; | 
|---|
 | 87 |         $cadenaXML=""; | 
|---|
 | 88 |         $rs=new Recordset;  | 
|---|
 | 89 |         $cmd->texto="SELECT idgrupo,nombregrupo,grupoid FROM grupos WHERE grupoid=".$grupoid." AND idcentro=".$idcentro." AND tipo=".$AMBITO_GRUPOSIMAGENES." ORDER BY nombregrupo"; | 
|---|
 | 90 |         $rs->Comando=&$cmd;  | 
|---|
 | 91 |         if (!$rs->Abrir()) return($cadenaXML); // Error al abrir recordset | 
|---|
 | 92 |         $rs->Primero();  | 
|---|
 | 93 |         while (!$rs->EOF){ | 
|---|
 | 94 |                 $cadenaXML.='<GRUPOSIMAGENES'; | 
|---|
 | 95 |                 // Atributos | 
|---|
 | 96 |                 $cadenaXML.=' clickcontextualnodo="menu_contextual(this,'. " 'flo_".$LITAMBITO_GRUPOSIMAGENES."'" .');"'; | 
|---|
 | 97 |                 $cadenaXML.=' imagenodo="../images/iconos/carpeta.gif"'; | 
|---|
 | 98 |                 $cadenaXML.=' infonodo="'.$rs->campos["nombregrupo"].'"'; | 
|---|
 | 99 |                 $cadenaXML.=' nodoid='.$LITAMBITO_GRUPOSIMAGENES.'-'.$rs->campos["idgrupo"]; | 
|---|
 | 100 |                 $cadenaXML.='>'; | 
|---|
 | 101 |                 $cadenaXML.=SubarbolXML_grupos_imagenes($cmd,$idcentro,$rs->campos["idgrupo"]); | 
|---|
 | 102 |                 $cadenaXML.='</GRUPOSIMAGENES>'; | 
|---|
 | 103 |                 $rs->Siguiente(); | 
|---|
 | 104 |         } | 
|---|
 | 105 |         $rs->Cerrar(); | 
|---|
 | 106 |         $cadenaXML.=SubarbolXML_Imagenes($cmd,$idcentro,$grupoid); | 
|---|
 | 107 |         return($cadenaXML); | 
|---|
 | 108 | } | 
|---|
 | 109 | //________________________________________________________________________________________________________ | 
|---|
 | 110 | function SubarbolXML_Imagenes($cmd,$idcentro,$grupoid){ | 
|---|
 | 111 |         global $LITAMBITO_IMAGENES; | 
|---|
 | 112 |         $cadenaXML=""; | 
|---|
 | 113 |         $rs=new Recordset;  | 
|---|
 | 114 |         $cmd->texto="SELECT idimagen,descripcion  FROM imagenes WHERE idcentro=".$idcentro." AND grupoid=".$grupoid." ORDER BY descripcion"; | 
|---|
 | 115 |         $rs->Comando=&$cmd;  | 
|---|
 | 116 |         if (!$rs->Abrir()) return($cadenaXML); // Error al abrir recordset | 
|---|
 | 117 |         $rs->Primero();  | 
|---|
 | 118 |         while (!$rs->EOF){ | 
|---|
 | 119 |                 $cadenaXML.='<IMAGEN'; | 
|---|
 | 120 |                 // Atributos | 
|---|
 | 121 |                 $cadenaXML.=' imagenodo="../images/iconos/imagen.gif"'; | 
|---|
 | 122 |                 $cadenaXML.=' infonodo="'.$rs->campos["descripcion"].'"'; | 
|---|
 | 123 |                 $cadenaXML.=' nodoid='.$LITAMBITO_IMAGENES.'-'.$rs->campos["idimagen"]; | 
|---|
 | 124 |                 $cadenaXML.=' clickcontextualnodo="menu_contextual(this,' ."'flo_".$LITAMBITO_IMAGENES."'" .')"'; | 
|---|
 | 125 |                 $cadenaXML.='>'; | 
|---|
 | 126 |                 $cadenaXML.='</IMAGEN>'; | 
|---|
 | 127 |                 $rs->Siguiente(); | 
|---|
 | 128 |         } | 
|---|
 | 129 |         $rs->Cerrar(); | 
|---|
 | 130 |         return($cadenaXML); | 
|---|
 | 131 | } | 
|---|
 | 132 | //________________________________________________________________________________________________________ | 
|---|
 | 133 | // | 
|---|
 | 134 | //      Menús Contextuales | 
|---|
 | 135 | //________________________________________________________________________________________________________ | 
|---|
 | 136 | function CreacontextualXMLImagenes(){ | 
|---|
 | 137 |         global $AMBITO_IMAGENES; | 
|---|
 | 138 |         global $AMBITO_GRUPOSIMAGENES; | 
|---|
 | 139 |         global $LITAMBITO_GRUPOSIMAGENES; | 
|---|
 | 140 |         global $LITAMBITO_IMAGENES; | 
|---|
 | 141 |         global $TbMsg; | 
|---|
 | 142 |  | 
|---|
 | 143 |         $layerXML='<MENUCONTEXTUAL'; | 
|---|
 | 144 |         $layerXML.=' idctx="flo_Raiz'.$LITAMBITO_IMAGENES.'"'; | 
|---|
 | 145 |         $layerXML.=' maxanchu=170'; | 
|---|
 | 146 |         $layerXML.=' swimg=1'; | 
|---|
 | 147 |         $layerXML.=' clase="menu_contextual"'; | 
|---|
 | 148 |         $layerXML.='>'; | 
|---|
 | 149 |  | 
|---|
 | 150 |         $layerXML.='<ITEM'; | 
|---|
 | 151 |         $layerXML.=' alpulsar="insertar_grupos('.$AMBITO_GRUPOSIMAGENES.',' ."'".$LITAMBITO_GRUPOSIMAGENES."'".')"'; | 
|---|
 | 152 |         $layerXML.=' imgitem="../images/iconos/carpeta.gif"'; | 
|---|
 | 153 |         $layerXML.=' textoitem='.$TbMsg[0]; | 
|---|
 | 154 |         $layerXML.='></ITEM>'; | 
|---|
 | 155 |  | 
|---|
 | 156 |         $wLeft=140; | 
|---|
 | 157 |         $wTop=115; | 
|---|
 | 158 |         $wWidth=550; | 
|---|
 | 159 |         $wHeight=300; | 
|---|
 | 160 |         $wpages="../propiedades/propiedades_imagenes.php"; | 
|---|
 | 161 |         $wParam=$wLeft .",".$wTop.",".$wWidth.",".$wHeight.",'". $wpages."'"; | 
|---|
 | 162 |  | 
|---|
 | 163 |         $layerXML.='<ITEM'; | 
|---|
 | 164 |         $layerXML.=' alpulsar="insertar('.$wParam.')"'; | 
|---|
 | 165 |         $layerXML.=' imgitem="../images/iconos/imagen.gif"'; | 
|---|
 | 166 |         $layerXML.=' textoitem='.$TbMsg[1]; | 
|---|
 | 167 |         $layerXML.='></ITEM>'; | 
|---|
 | 168 |  | 
|---|
 | 169 |         $layerXML.='<SEPARADOR>'; | 
|---|
 | 170 |         $layerXML.='</SEPARADOR>'; | 
|---|
 | 171 |  | 
|---|
 | 172 |         $wParam="../gestores/gestor_imagenes.php"; | 
|---|
 | 173 |  | 
|---|
 | 174 |         $layerXML.='<ITEM'; | 
|---|
 | 175 |         $layerXML.=' alpulsar="colocar('."'".$wParam."'".','.$AMBITO_IMAGENES.')"'; | 
|---|
 | 176 |         $layerXML.=' imgitem="../images/iconos/colocar.gif"'; | 
|---|
 | 177 |         $layerXML.=' textoitem='.$TbMsg[2]; | 
|---|
 | 178 |         $layerXML.='></ITEM>'; | 
|---|
 | 179 |  | 
|---|
 | 180 |         $layerXML.='</MENUCONTEXTUAL>'; | 
|---|
 | 181 |         return($layerXML); | 
|---|
 | 182 | } | 
|---|
 | 183 | //__________________________________________________________________________________________ | 
|---|
 | 184 | function ContextualXMLGruposImagenes(){ | 
|---|
 | 185 |         global $AMBITO_IMAGENES; | 
|---|
 | 186 |         global $AMBITO_GRUPOSIMAGENES; | 
|---|
 | 187 |         global $LITAMBITO_GRUPOSIMAGENES; | 
|---|
 | 188 |         global $TbMsg; | 
|---|
 | 189 |          | 
|---|
 | 190 |         $layerXML='<MENUCONTEXTUAL'; | 
|---|
 | 191 |         $layerXML.=' idctx="flo_'.$LITAMBITO_GRUPOSIMAGENES.'"'; | 
|---|
 | 192 |         $layerXML.=' maxanchu=175'; | 
|---|
 | 193 |         $layerXML.=' swimg=1'; | 
|---|
 | 194 |         $layerXML.=' clase="menu_contextual"'; | 
|---|
 | 195 |         $layerXML.='>'; | 
|---|
 | 196 |  | 
|---|
 | 197 |         $layerXML.='<ITEM'; | 
|---|
 | 198 |         $layerXML.=' alpulsar="insertar_grupos('.$AMBITO_GRUPOSIMAGENES.',' ."'".$LITAMBITO_GRUPOSIMAGENES."'". ')"'; | 
|---|
 | 199 |         $layerXML.=' imgitem="../images/iconos/carpeta.gif"'; | 
|---|
 | 200 |         $layerXML.=' textoitem='.$TbMsg[0]; | 
|---|
 | 201 |         $layerXML.='></ITEM>'; | 
|---|
 | 202 |          | 
|---|
 | 203 |         $wLeft=140; | 
|---|
 | 204 |         $wTop=115; | 
|---|
 | 205 |         $wWidth=550; | 
|---|
 | 206 |         $wHeight=290; | 
|---|
 | 207 |         $wpages="../propiedades/propiedades_imagenes.php"; | 
|---|
 | 208 |         $wParam=$wLeft .",".$wTop.",".$wWidth.",".$wHeight.",'". $wpages."'"; | 
|---|
 | 209 |  | 
|---|
 | 210 |         $layerXML.='<ITEM'; | 
|---|
 | 211 |         $layerXML.=' alpulsar="insertar('.$wParam.')"'; | 
|---|
 | 212 |         $layerXML.=' imgitem="../images/iconos/imagen.gif"'; | 
|---|
 | 213 |         $layerXML.=' textoitem='.$TbMsg[1]; | 
|---|
 | 214 |         $layerXML.='></ITEM>'; | 
|---|
 | 215 |  | 
|---|
 | 216 |         $layerXML.='<SEPARADOR>'; | 
|---|
 | 217 |         $layerXML.='</SEPARADOR>'; | 
|---|
 | 218 |  | 
|---|
 | 219 |         $wParam="../gestores/gestor_imagenes.php"; | 
|---|
 | 220 |  | 
|---|
 | 221 |         $layerXML.='<ITEM'; | 
|---|
 | 222 |         $layerXML.=' alpulsar="colocar('."'".$wParam."'".','.$AMBITO_IMAGENES.')"'; | 
|---|
 | 223 |         $layerXML.=' imgitem="../images/iconos/colocar.gif"'; | 
|---|
 | 224 |         $layerXML.=' textoitem='.$TbMsg[2]; | 
|---|
 | 225 |         $layerXML.='></ITEM>'; | 
|---|
 | 226 |  | 
|---|
 | 227 |         $layerXML.='<SEPARADOR>'; | 
|---|
 | 228 |         $layerXML.='</SEPARADOR>';  | 
|---|
 | 229 |  | 
|---|
 | 230 |         $layerXML.='<ITEM'; | 
|---|
 | 231 |         $layerXML.=' alpulsar="modificar_grupos()"'; | 
|---|
 | 232 |         $layerXML.=' imgitem="../images/iconos/modificar.gif"'; | 
|---|
 | 233 |         $layerXML.=' textoitem='.$TbMsg[7]; | 
|---|
 | 234 |         $layerXML.='></ITEM>'; | 
|---|
 | 235 |  | 
|---|
 | 236 |         $layerXML.='<ITEM'; | 
|---|
 | 237 |         $layerXML.=' alpulsar="eliminar_grupos()"'; | 
|---|
 | 238 |         $layerXML.=' imgitem="../images/iconos/eliminar.gif"'; | 
|---|
 | 239 |         $layerXML.=' textoitem='.$TbMsg[4]; | 
|---|
 | 240 |         $layerXML.='></ITEM>'; | 
|---|
 | 241 |  | 
|---|
 | 242 |         $layerXML.='</MENUCONTEXTUAL>'; | 
|---|
 | 243 |         return($layerXML); | 
|---|
 | 244 | } | 
|---|
 | 245 | //--------------------------------------------------------------------------------------------------------------------------- | 
|---|
 | 246 | function CreacontextualXMLImagen(){ | 
|---|
 | 247 |         global $AMBITO_IMAGENES; | 
|---|
 | 248 |         global $LITAMBITO_IMAGENES; | 
|---|
 | 249 |         global $TbMsg; | 
|---|
 | 250 |  | 
|---|
 | 251 |         $layerXML='<MENUCONTEXTUAL'; | 
|---|
 | 252 |         $layerXML.=' idctx="flo_'.$LITAMBITO_IMAGENES.'"'; | 
|---|
 | 253 |         $layerXML.=' maxanchu=150'; | 
|---|
 | 254 |         $layerXML.=' swimg=1'; | 
|---|
 | 255 |         $layerXML.='>'; | 
|---|
 | 256 |  | 
|---|
 | 257 | /* | 
|---|
 | 258 |         $layerXML.='<ITEM'; | 
|---|
 | 259 |         $layerXML.=' alpulsar="insertar_imagenincremental()"'; | 
|---|
 | 260 |         $layerXML.=' imgitem="../images/iconos/incremental.gif"'; | 
|---|
 | 261 |         $layerXML.=' textoitem='.$TbMsg[10]; | 
|---|
 | 262 |         $layerXML.='></ITEM>'; | 
|---|
 | 263 | */ | 
|---|
 | 264 |         $layerXML.='<ITEM'; | 
|---|
 | 265 |         $layerXML.=' alpulsar="muestra_informacion()"'; | 
|---|
 | 266 |         $layerXML.=' textoitem='.$TbMsg[5]; | 
|---|
 | 267 |         $layerXML.=' imgitem="../images/iconos/informacion.gif"'; | 
|---|
 | 268 |         $layerXML.='></ITEM>'; | 
|---|
 | 269 |  | 
|---|
 | 270 |         $layerXML.='<SEPARADOR>'; | 
|---|
 | 271 |         $layerXML.='</SEPARADOR>'; | 
|---|
 | 272 |  | 
|---|
 | 273 |         $layerXML.='<ITEM'; | 
|---|
 | 274 |         $layerXML.=' alpulsar="mover('.$AMBITO_IMAGENES.')"'; | 
|---|
 | 275 |         $layerXML.=' imgitem="../images/iconos/mover.gif"'; | 
|---|
 | 276 |         $layerXML.=' textoitem='.$TbMsg[6]; | 
|---|
 | 277 |         $layerXML.='></ITEM>'; | 
|---|
 | 278 |  | 
|---|
 | 279 |         $layerXML.='<SEPARADOR>'; | 
|---|
 | 280 |         $layerXML.='</SEPARADOR>'; | 
|---|
 | 281 |  | 
|---|
 | 282 |         $wLeft=140; | 
|---|
 | 283 |         $wTop=115; | 
|---|
 | 284 |         $wWidth=550; | 
|---|
 | 285 |         $wHeight=290; | 
|---|
 | 286 |         $wpages="../propiedades/propiedades_imagenes.php"; | 
|---|
 | 287 |         $wParam=$wLeft .",".$wTop.",".$wWidth.",".$wHeight.",'". $wpages."'"; | 
|---|
 | 288 |  | 
|---|
 | 289 |         $layerXML.='<ITEM'; | 
|---|
 | 290 |         $layerXML.=' alpulsar="modificar('.$wParam.')"';         | 
|---|
 | 291 |         $layerXML.=' textoitem='.$TbMsg[7]; | 
|---|
 | 292 |         $layerXML.=' imgitem="../images/iconos/propiedades.gif"'; | 
|---|
 | 293 |         $layerXML.='></ITEM>'; | 
|---|
 | 294 |  | 
|---|
 | 295 |         $layerXML.='<ITEM'; | 
|---|
 | 296 |         $layerXML.=' alpulsar="eliminar('.$wParam.')"'; | 
|---|
 | 297 |         $layerXML.=' imgitem="../images/iconos/eliminar.gif"'; | 
|---|
 | 298 |         $layerXML.=' textoitem='.$TbMsg[8]; | 
|---|
 | 299 |         $layerXML.='></ITEM>'; | 
|---|
 | 300 |  | 
|---|
 | 301 |         $layerXML.='</MENUCONTEXTUAL>'; | 
|---|
 | 302 |         return($layerXML); | 
|---|
 | 303 | } | 
|---|
 | 304 | ?> | 
|---|