conectar(); // instanciar los 0bjetos $tabla_noticia=new Tabla_Noticia($dataBase->getEnlaceHost()); $noticia=new Noticia(); $tabla_museo=new Tabla_Museo($dataBase->getEnlaceHost()); $museo=new Museo(); $noticia=new Noticia(); // comprobar que existe if ($tabla_noticia -> existe($Nnoticia)) $noticia=$tabla_noticia->obtener($Nnoticia); $plantillas = array("plantillas/museos/noticias/noticia.htm","plantillas/cabecera.htm","plantillas/menu_museo.htm","plantillas/lateral_museo.htm","plantillas/pie.htm"); $plantilla = plantillas($plantillas,"museos","noticias",$Nmuseo); $error=array('TAG_Nnoticia'=>array (1,$noticia->getNnoticia(),""), 'TAG_Ttit_es'=>array (1,$noticia->getTtit_es(),""), 'TAG_Ttit_eu'=>array (1,$noticia->getTtit_eu(),""), 'TAG_Ttit_en'=>array (1,$noticia->getTtit_en(),""), 'TAG_Ttit_fr'=>array (1,$noticia->getTtit_fr(),""), 'TAG_Ment_es'=>array (1,$noticia->getMent_es(),""), 'TAG_Ment_eu'=>array (1,$noticia->getMent_eu(),""), 'TAG_Ment_en'=>array (1,$noticia->getMent_en(),""), 'TAG_Ment_fr'=>array (1,$noticia->getMent_fr(),""), 'TAG_Mnot_es'=>array (1,$noticia->getMnot_es(),""), 'TAG_Mnot_eu'=>array (1,$noticia->getMnot_eu(),""), 'TAG_Mnot_en'=>array (1,$noticia->getMnot_en(),""), 'TAG_Mnot_fr'=>array (1,$noticia->getMnot_fr(),""), 'TAG_Tfoto'=>array (1,$noticia->getTfoto(),""), 'TAG_Tdes_es'=>array (1,$noticia->getTdes_es(),""), 'TAG_Tdes_eu'=>array (1,$noticia->getTdes_eu(),""), 'TAG_Tdes_en'=>array (1,$noticia->getTdes_en(),""), 'TAG_Tdes_fr'=>array (1,$noticia->getTdes_fr(),""), 'TAG_Nprivada'=>array (1,$txtNprivada,""), 'TAG_Nmuseo'=>array (1,$noticia->getNmuseo(),""), 'TAG_Nestado'=>array (1,$txtNestado,""), 'TAG_Nactivo'=>array (1,$txtNactivo,""), 'TAG_Nportada'=>array (1,$txtNportada,""), 'TAG_Ndestaca'=>array (1,$txtNdestaca,""), 'TAG_Norden'=>array (1,$noticia->getNorden(),""), 'TAG_Falta'=>array (1,fechaIdioma($noticia->getFalta()),""), 'TAG_Fmodific'=>array (1,$noticia->getFmodific(),""), 'TAG_Textra01'=>array (1,$noticia->getTextra01(),""), 'TAG_Textra02'=>array (1,$noticia->getTextra02(),""), 'TAG_Textra03'=>array (1,$noticia->getTextra03(),""), 'TAG_Textra04'=>array (1,$noticia->getTextra04(),""), 'TAG_Textra05'=>array (1,$noticia->getTextra05(),""), 'TAG_Textra06'=>array (1,$noticia->getTextra06(),""), 'TAG_Textra07'=>array (1,$noticia->getTextra07(),""), 'TAG_Textra08'=>array (1,$noticia->getTextra08(),""), 'TAG_Textra09'=>array (1,$noticia->getTextra09(),""), 'TAG_Textra10'=>array (1,$noticia->getTextra10(),""), 'TAG_Textra11'=>array (1,$noticia->getTextra11(),""), 'TAG_Textra12'=>array (1,$noticia->getTextra12(),""), 'TAG_Textra13'=>array (1,$noticia->getTextra13(),""), 'TAG_Textra14'=>array (1,$noticia->getTextra14(),""), 'TAG_Textra15'=>array (1,$noticia->getTextra15(),""), 'TAG_Textra16'=>array (1,$noticia->getTextra16(),""), 'TAG_Nextra17'=>array (1,$txtNextra17,""), 'TAG_Nextra18'=>array (1,$txtNextra18,""), 'TAG_Nextra19'=>array (1,$txtNextra19,""), 'TAG_Nextra20'=>array (1,$txtNextra20,""), 'TAG_Nextra21'=>array (1,$txtNextra21,""), 'TAG_Nextra22'=>array (1,$txtNextra22,""), 'TAG_Nextra23'=>array (1,$txtNextra23,""), 'TAG_Nextra24'=>array (1,$txtNextra24,""), 'TAG_Mextra25'=>array (1,str_replace("\n","
",$noticia->getMextra25()),""), 'TAG_Mextra26'=>array (1,str_replace("\n","
",$noticia->getMextra26()),""), 'TAG_Mextra27'=>array (1,str_replace("\n","
",$noticia->getMextra27()),""), 'TAG_Mextra28'=>array (1,str_replace("\n","
",$noticia->getMextra28()),""), 'TAG_Mextra29'=>array (1,str_replace("\n","
",$noticia->getMextra29()),""), 'TAG_Mextra30'=>array (1,str_replace("\n","
",$noticia->getMextra30()),""), 'TAG_Mextra31'=>array (1,str_replace("\n","
",$noticia->getMextra31()),""), 'TAG_Mextra32'=>array (1,str_replace("\n","
",$noticia->getMextra32()),"") ); while (list($key,$value)=each($error)){ $plantilla=str_replace($key."_CHECKED".$value[1],"checked=\"checked\"",$plantilla); $plantilla=str_replace($key."_VALUE",$value[1],$plantilla); if (!$value[0]) $plantilla=str_replace($key,"error",$plantilla); else $plantilla=str_replace($key,"ok",$plantilla); } // no mostrar los campos opcionales vacíos $Tfoto = strtolower($noticia->getTfoto()); if ($Tfoto == "") $plantilla = preg_replace("/([\s\S]*)/","", $plantilla); $museo=$tabla_museo->obtener($Nmuseo); $plantilla = str_replace("TAG_Nmuseo_VALUE",$Nmuseo, $plantilla); $plantilla = str_replace("TAG_Tmuse_es_VALUE",$museo->getTmuse_es(), $plantilla); $plantilla = str_replace("TAG_Tmuse_eu_VALUE",$museo->getTmuse_eu(), $plantilla); $plantilla = str_replace("TAG_Tmuse_en_VALUE",$museo->getTmuse_en(), $plantilla); $plantilla = str_replace("TAG_Tmuse_fr_VALUE",$museo->getTmuse_fr(), $plantilla); $plantilla = str_replace("TAG_DESDE",$desde, $plantilla); $plantilla = str_replace("TAG_ORDEN",$orden, $plantilla); $plantilla = str_replace("TAG_SENTIDO",$sentido, $plantilla); $plantilla = str_replace("TAG_MENSAJE","", $plantilla); $plantilla = str_replace("TAG_HTTP_REFERER_VALUE",$_SERVER["HTTP_REFERER"], $plantilla); $dataBase->desconectar(); echo($plantilla); ?>