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: repositorios.php |
---|
8 | // Descripción : |
---|
9 | // Administra los repositorios 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."/repositorios_".$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 los datos del 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/repositorios.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.'/repositorios_'.$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 repositorios |
---|
53 | $XMLcontextual=CreacontextualXMLRepositorios(); |
---|
54 | echo $flotante->CreaMenuContextual($XMLcontextual); |
---|
55 | $XMLcontextual=CreacontextualXMLGruposRepositorios(); // Grupos de repositorios |
---|
56 | echo $flotante->CreaMenuContextual($XMLcontextual); |
---|
57 | $XMLcontextual=CreacontextualXMLRepositorio(); // Repositorio |
---|
58 | echo $flotante->CreaMenuContextual($XMLcontextual); |
---|
59 | ?> |
---|
60 | </BODY OnContextMenu="return false"> |
---|
61 | </HTML> |
---|
62 | <? |
---|
63 | // ************************************************************************************************************************************************* |
---|
64 | // Devuelve una cadena con formato XML de toda la información de los repositorios de 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 | { |
---|
71 | global $TbMsg; |
---|
72 | global $LITAMBITO_REPOSITORIOS; |
---|
73 | $cadenaXML='<REPOSITORIOS'; |
---|
74 | // Atributos |
---|
75 | $cadenaXML.=' imagenodo="../images/iconos/repositorio.gif"'; |
---|
76 | $cadenaXML.=' clickcontextualnodo="menu_contextual(this,' ."'flo_Raiz".$LITAMBITO_REPOSITORIOS."'" .')"'; |
---|
77 | $cadenaXML.=' nodoid=Raiz'.$LITAMBITO_REPOSITORIOS; |
---|
78 | $cadenaXML.=' infonodo='.$TbMsg[12]; |
---|
79 | $cadenaXML.='>'; |
---|
80 | $cadenaXML.=SubarbolXML_grupos_repositorios($cmd,$idcentro,0); |
---|
81 | $cadenaXML.='</REPOSITORIOS>'; |
---|
82 | return($cadenaXML); |
---|
83 | } |
---|
84 | // --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
---|
85 | function SubarbolXML_grupos_repositorios($cmd,$idcentro,$grupoid){ |
---|
86 | global $LITAMBITO_GRUPOSREPOSITORIOS; |
---|
87 | global $AMBITO_GRUPOSREPOSITORIOS; |
---|
88 | global $LITAMBITO_REPOSITORIOS; |
---|
89 | $cadenaXML=""; |
---|
90 | $rs=new Recordset; |
---|
91 | $cmd->texto="SELECT idgrupo,nombregrupo,grupoid FROM grupos WHERE grupoid=".$grupoid." AND idcentro=".$idcentro." AND tipo=".$AMBITO_GRUPOSREPOSITORIOS." ORDER BY nombregrupo"; |
---|
92 | $rs->Comando=&$cmd; |
---|
93 | if (!$rs->Abrir()) return($cadenaXML); // Error al abrir recordset |
---|
94 | $rs->Primero(); |
---|
95 | while (!$rs->EOF){ |
---|
96 | $cadenaXML.='<GRUPOSREPOSITORIOS '; |
---|
97 | // Atributos |
---|
98 | $cadenaXML.=' imagenodo="../images/iconos/carpeta.gif"'; |
---|
99 | $cadenaXML.=' clickcontextualnodo="menu_contextual(this,'. " 'flo_".$LITAMBITO_GRUPOSREPOSITORIOS."'" .');"'; |
---|
100 | $cadenaXML.=' infonodo="'.$rs->campos["nombregrupo"].'"'; |
---|
101 | $cadenaXML.=' nodoid='.$LITAMBITO_GRUPOSREPOSITORIOS.'-'.$rs->campos["idgrupo"]; |
---|
102 | $cadenaXML.='>'; |
---|
103 | $cadenaXML.=SubarbolXML_grupos_repositorios($cmd,$idcentro,$rs->campos["idgrupo"]); |
---|
104 | $cadenaXML.='</GRUPOSREPOSITORIOS>'; |
---|
105 | $rs->Siguiente(); |
---|
106 | } |
---|
107 | $rs->Cerrar(); |
---|
108 | $cmd->texto="SELECT idrepositorio,nombrerepositorio FROM repositorios WHERE grupoid=".$grupoid." AND idcentro=".$idcentro." order by idrepositorio desc" ; |
---|
109 | $rs->Comando=&$cmd; |
---|
110 | if (!$rs->Abrir()) return($cadenaXML); // Error al abrir recordset |
---|
111 | $rs->Primero(); |
---|
112 | while (!$rs->EOF){ |
---|
113 | $cadenaXML.='<REPOSITORIO'; |
---|
114 | // Atributos |
---|
115 | $cadenaXML.=' clickcontextualnodo="menu_contextual(this,' ."'flo_".$LITAMBITO_REPOSITORIOS."'" .')"'; |
---|
116 | $cadenaXML.=' imagenodo="../images/iconos/repositorio.gif" '; |
---|
117 | $cadenaXML.=' infonodo="'.$rs->campos["nombrerepositorio"].'"'; |
---|
118 | $cadenaXML.=' nodoid='.$LITAMBITO_REPOSITORIOS.'-'.$rs->campos["idrepositorio"]; |
---|
119 | $cadenaXML.='>'; |
---|
120 | $cadenaXML.='</REPOSITORIO>'; |
---|
121 | $rs->Siguiente(); |
---|
122 | } |
---|
123 | $rs->Cerrar(); |
---|
124 | return($cadenaXML); |
---|
125 | } |
---|
126 | //________________________________________________________________________________________________________ |
---|
127 | // |
---|
128 | // Menús Contextuales |
---|
129 | //________________________________________________________________________________________________________ |
---|
130 | function CreacontextualXMLRepositorios(){ |
---|
131 | global $AMBITO_REPOSITORIOS; |
---|
132 | global $AMBITO_GRUPOSREPOSITORIOS; |
---|
133 | global $LITAMBITO_GRUPOSREPOSITORIOS; |
---|
134 | global $LITAMBITO_REPOSITORIOS; |
---|
135 | global $TbMsg; |
---|
136 | |
---|
137 | $layerXML='<MENUCONTEXTUAL'; |
---|
138 | $layerXML.=' idctx="flo_Raiz'.$LITAMBITO_REPOSITORIOS.'"'; |
---|
139 | $layerXML.=' maxanchu=185'; |
---|
140 | $layerXML.=' swimg=1'; |
---|
141 | $layerXML.=' clase="menu_contextual"'; |
---|
142 | $layerXML.='>'; |
---|
143 | |
---|
144 | $layerXML.='<ITEM'; |
---|
145 | $layerXML.=' alpulsar="insertar_grupos('.$AMBITO_GRUPOSREPOSITORIOS.',' . "'".$LITAMBITO_GRUPOSREPOSITORIOS."'" . ')"'; |
---|
146 | $layerXML.=' imgitem="../images/iconos/carpeta.gif"'; |
---|
147 | $layerXML.=' textoitem='.$TbMsg[0]; |
---|
148 | $layerXML.='></ITEM>'; |
---|
149 | |
---|
150 | $wLeft=140; |
---|
151 | $wTop=115; |
---|
152 | $wWidth=550; |
---|
153 | $wHeight=280; |
---|
154 | $wpages="../propiedades/propiedades_repositorios.php"; |
---|
155 | $wParam=$wLeft .",".$wTop.",".$wWidth.",".$wHeight.",'". $wpages."'"; |
---|
156 | |
---|
157 | $layerXML.='<ITEM'; |
---|
158 | $layerXML.=' alpulsar="insertar('.$wParam.')"'; |
---|
159 | $layerXML.=' imgitem="../images/iconos/aula.gif"'; |
---|
160 | $layerXML.=' textoitem='.$TbMsg[1]; |
---|
161 | $layerXML.='></ITEM>'; |
---|
162 | |
---|
163 | $layerXML.='<SEPARADOR>'; |
---|
164 | $layerXML.='</SEPARADOR>'; |
---|
165 | |
---|
166 | $wParam="../gestores/gestor_repositorios.php"; |
---|
167 | |
---|
168 | $layerXML.='<ITEM'; |
---|
169 | $layerXML.=' alpulsar="colocar('."'".$wParam."'".','.$AMBITO_REPOSITORIOS.')"'; |
---|
170 | $layerXML.=' imgitem="../images/iconos/colocar.gif"'; |
---|
171 | $layerXML.=' textoitem='.$TbMsg[2]; |
---|
172 | $layerXML.='></ITEM>'; |
---|
173 | |
---|
174 | $layerXML.='</MENUCONTEXTUAL>'; |
---|
175 | return($layerXML); |
---|
176 | } |
---|
177 | //________________________________________________________________________________________________________ |
---|
178 | function CreacontextualXMLGruposRepositorios(){ |
---|
179 | global $AMBITO_REPOSITORIOS; |
---|
180 | global $AMBITO_GRUPOSREPOSITORIOS; |
---|
181 | global $LITAMBITO_GRUPOSREPOSITORIOS; |
---|
182 | global $TbMsg; |
---|
183 | |
---|
184 | $layerXML='<MENUCONTEXTUAL'; |
---|
185 | $layerXML.=' idctx="flo_'.$LITAMBITO_GRUPOSREPOSITORIOS.'"'; |
---|
186 | $layerXML.=' maxanchu=185'; |
---|
187 | $layerXML.=' swimg=1'; |
---|
188 | $layerXML.=' clase="menu_contextual"'; |
---|
189 | $layerXML.='>'; |
---|
190 | |
---|
191 | $layerXML.='<ITEM'; |
---|
192 | $layerXML.=' alpulsar="insertar_grupos('.$AMBITO_GRUPOSREPOSITORIOS.',' ."'".$LITAMBITO_GRUPOSREPOSITORIOS."'". ')"'; |
---|
193 | $layerXML.=' imgitem="../images/iconos/carpeta.gif"'; |
---|
194 | $layerXML.=' textoitem='.$TbMsg[0]; |
---|
195 | $layerXML.='></ITEM>'; |
---|
196 | |
---|
197 | $wLeft=140; |
---|
198 | $wTop=115; |
---|
199 | $wWidth=550; |
---|
200 | $wHeight=280; |
---|
201 | $wpages="../propiedades/propiedades_repositorios.php"; |
---|
202 | $wParam=$wLeft .",".$wTop.",".$wWidth.",".$wHeight.",'". $wpages."'"; |
---|
203 | |
---|
204 | $layerXML.='<ITEM'; |
---|
205 | $layerXML.=' alpulsar="insertar('.$wParam.')"'; |
---|
206 | $layerXML.=' imgitem="../images/iconos/aula.gif"'; |
---|
207 | $layerXML.=' textoitem='.$TbMsg[1]; |
---|
208 | $layerXML.='></ITEM>'; |
---|
209 | |
---|
210 | $layerXML.='<SEPARADOR>'; |
---|
211 | $layerXML.='</SEPARADOR>'; |
---|
212 | |
---|
213 | $wParam="../gestores/gestor_repositorios.php"; |
---|
214 | |
---|
215 | $layerXML.='<ITEM'; |
---|
216 | $layerXML.=' alpulsar="colocar('."'".$wParam."'".','.$AMBITO_REPOSITORIOS.')"'; |
---|
217 | $layerXML.=' imgitem="../images/iconos/colocar.gif"'; |
---|
218 | $layerXML.=' textoitem='.$TbMsg[2]; |
---|
219 | $layerXML.='></ITEM>'; |
---|
220 | |
---|
221 | $layerXML.='<SEPARADOR>'; |
---|
222 | $layerXML.='</SEPARADOR>'; |
---|
223 | |
---|
224 | $layerXML.='<ITEM'; |
---|
225 | $layerXML.=' alpulsar="modificar_grupos()"'; |
---|
226 | $layerXML.=' imgitem="../images/iconos/modificar.gif"'; |
---|
227 | $layerXML.=' textoitem='.$TbMsg[7]; |
---|
228 | $layerXML.='></ITEM>'; |
---|
229 | |
---|
230 | $layerXML.='<ITEM'; |
---|
231 | $layerXML.=' alpulsar="eliminar_grupos()"'; |
---|
232 | $layerXML.=' imgitem="../images/iconos/eliminar.gif"'; |
---|
233 | $layerXML.=' textoitem='.$TbMsg[4]; |
---|
234 | $layerXML.='></ITEM>'; |
---|
235 | |
---|
236 | $layerXML.='</MENUCONTEXTUAL>'; |
---|
237 | return($layerXML); |
---|
238 | } |
---|
239 | //________________________________________________________________________________________________________ |
---|
240 | function CreacontextualXMLRepositorio(){ |
---|
241 | global $AMBITO_REPOSITORIOS; |
---|
242 | global $LITAMBITO_REPOSITORIOS; |
---|
243 | global $TbMsg; |
---|
244 | |
---|
245 | $layerXML='<MENUCONTEXTUAL'; |
---|
246 | $layerXML.=' idctx="flo_'.$LITAMBITO_REPOSITORIOS.'"'; |
---|
247 | $layerXML.=' maxanchu=160'; |
---|
248 | $layerXML.=' swimg=1'; |
---|
249 | $layerXML.=' clase="menu_contextual"'; |
---|
250 | $layerXML.='>'; |
---|
251 | |
---|
252 | $layerXML.='<ITEM'; |
---|
253 | $layerXML.=' alpulsar="muestra_inforRepositorios()"'; |
---|
254 | $layerXML.=' textoitem='.$TbMsg[5]; |
---|
255 | $layerXML.=' imgitem="../images/iconos/informacion.gif"'; |
---|
256 | $layerXML.='></ITEM>'; |
---|
257 | |
---|
258 | $layerXML.='<SEPARADOR>'; |
---|
259 | $layerXML.='</SEPARADOR>'; |
---|
260 | |
---|
261 | $layerXML.='<ITEM'; |
---|
262 | $layerXML.=' alpulsar="mover('.$AMBITO_REPOSITORIOS.')"'; |
---|
263 | $layerXML.=' imgitem="../images/iconos/mover.gif"'; |
---|
264 | $layerXML.=' textoitem='.$TbMsg[6]; |
---|
265 | $layerXML.='></ITEM>'; |
---|
266 | |
---|
267 | $layerXML.='<SEPARADOR>'; |
---|
268 | $layerXML.='</SEPARADOR>'; |
---|
269 | |
---|
270 | $wLeft=140; |
---|
271 | $wTop=115; |
---|
272 | $wWidth=550; |
---|
273 | $wHeight=280; |
---|
274 | $wpages="../propiedades/propiedades_repositorios.php"; |
---|
275 | $wParam=$wLeft .",".$wTop.",".$wWidth.",".$wHeight.",'". $wpages."'"; |
---|
276 | |
---|
277 | $layerXML.='<ITEM'; |
---|
278 | $layerXML.=' alpulsar="modificar('.$wParam.')"'; |
---|
279 | $layerXML.=' textoitem='.$TbMsg[7]; |
---|
280 | $layerXML.=' imgitem="../images/iconos/propiedades.gif"'; |
---|
281 | $layerXML.='></ITEM>'; |
---|
282 | |
---|
283 | $layerXML.='<ITEM'; |
---|
284 | $layerXML.=' alpulsar="eliminar('.$wParam.')"'; |
---|
285 | $layerXML.=' imgitem="../images/iconos/eliminar.gif"'; |
---|
286 | $layerXML.=' textoitem='.$TbMsg[8]; |
---|
287 | $layerXML.='></ITEM>'; |
---|
288 | |
---|
289 | $layerXML.='</MENUCONTEXTUAL>'; |
---|
290 | return($layerXML); |
---|
291 | } |
---|
292 | ?> |
---|