private static function readView()
 {
     $plantilla = new Template();
     $bd = new BaseDatos();
     $gestor = new ManageArtist($bd);
     $gestorUsuario = new ManageUser($bd);
     $gestorimagenes = new ManageGallery($bd);
     //Carga de plantillas
     $vista = $plantilla->getContents("../_plantilla1/_index.html");
     $nav = $plantilla->getContents("../_plantilla1/_nav.html");
     $login = $plantilla->getContents("../_plantilla1/_login.html");
     $gallery = $plantilla->getContents("../_plantilla1/_gallery.html");
     $artistas_plantilla = $plantilla->getContents("../_plantilla1/_artistas.html");
     $lista_artistas = $plantilla->getContents("../_plantilla1/_lista-artistas.html");
     //Todos los Artistas ------------------------------
     $usuarios = $gestorUsuario->getList();
     $imagenes = $gestorimagenes->getList();
     $elementos = "";
     $elementos_a = "";
     foreach ($usuarios as $key => $artista) {
         if ($artista->getActivo() == 1 || $artista->getPersonal() == 1 || $artista->getAdministrador() == 1) {
             $elemento_i = $plantilla->replace("nombre_artista", $artista->getAlias(), $lista_artistas);
             $elemento_i = $plantilla->replace("mail_artista", $artista->getEmail(), $elemento_i);
             $elementos_a .= $elemento_i;
         }
     }
     if (Request::req("email") == "") {
         $elementos = self::loadImage($plantilla, $gallery, $imagenes, $elementos);
     } else {
         $email = Request::req("email");
         $email_artista = $gestorUsuario->get($email)->getEmail();
         $art_album = $gestor->get($email_artista)->getGaleria();
         $galeria_personalizada = $gestorimagenes->getList();
         foreach ($galeria_personalizada as $key => $imagen) {
             if ($imagen->getId() == $art_album) {
                 $elemento = $plantilla->replace("src", $imagen->getImagen(), $gallery);
                 $elemento = $plantilla->replace("piefoto", $imagen->getDescripcion(), $elemento);
                 $elemento = $plantilla->replace("id_imagen", $imagen->getId_imagen(), $elemento);
                 $elemento = $plantilla->replace("album", $imagen->getId(), $elemento);
                 $elementos .= $elemento;
             }
         }
     }
     $artistas_plantilla = $plantilla->replace("lista_artistas", $elementos_a, $artistas_plantilla);
     $datos = array("nav" => $nav, "work" => "", "edit" => "", "titulo" => "Galeria de Arte", "formulario" => "", "mensajes" => "", "descripcion" => 'Arte por todas partes', "login" => $login, "profile" => "", "upload" => "", "artistas" => $artistas_plantilla, "gallery" => "{$elementos}", "contact" => "");
     echo $plantilla->insertTemplate($vista, $datos);
 }
 private static function readView(ManageArtist $gestor)
 {
     $plantilla = new Template();
     $bd = new BaseDatos();
     $sesion = new Session();
     $usuario = $sesion->getUser();
     $artista = self::getArtist($sesion);
     $gestorgalerias = new ManageGallery($bd);
     $plantilladeget = Request::req("plantilla");
     if ($plantilladeget == "") {
         $plantilladeget = "";
     } else {
         $artista->setStyle($plantilladeget);
         $manageartista = new ManageArtist($bd);
         $manageartista->set($artista);
     }
     $vista = $plantilla->getContents("../" . $artista->getStyle() . "/_index.html");
     $nav = $plantilla->getContents("../" . $artista->getStyle() . "/_nav.html");
     $profile = $plantilla->getContents("../" . $artista->getStyle() . "/_profile.html");
     $upload = $plantilla->getContents("../" . $artista->getStyle() . "/_upload.html");
     $gallery = $plantilla->getContents("../" . $artista->getStyle() . "/_gallery_user.html");
     $trabajo = $plantilla->getContents("../" . $artista->getStyle() . "/_work.html");
     $edit = $plantilla->getContents("../" . $artista->getStyle() . "/_edit.html");
     $contact = $plantilla->getContents("../" . $artista->getStyle() . "/_contact.html");
     //VARIABLES DEL ARTISTA
     $email = $usuario->getEmail();
     $alias = $usuario->getAlias();
     $artista = self::getArtist($sesion);
     $input = '<label>Gallery: <input type="text" class="form-control" name="id" value="' . $artista->getGaleria() . '" placeholder="Galeria: ' . $artista->getGaleria() . '"></label>';
     $upload = $plantilla->replace("select_galeria", $input, $upload);
     //CREACION DE GALERIA SEGUN EL ALBUM
     //ALBUM
     //GALERIA
     $galerias = $gestorgalerias->getList();
     $elementos = "";
     foreach ($galerias as $key => $imagen) {
         if ($imagen->getId() === $artista->getGaleria()) {
             $elemento = $plantilla->replace("src", $imagen->getImagen(), $gallery);
             $elemento = $plantilla->replace("piefoto", $imagen->getDescripcion(), $elemento);
             $elemento = $plantilla->replace("id_imagen", $imagen->getId_imagen(), $elemento);
             $elemento = $plantilla->replace("album", $imagen->getId(), $elemento);
             $elementos .= $elemento;
         }
     }
     //RELLENO PAGINA
     $info = "<br>Artista: " . $alias . "<br> Galeria: " . $artista->getTitulo();
     $profile = $plantilla->replace("perfil", $artista->getPerfil(), $profile);
     $men = "";
     if (Request::req("op") == "") {
         $men = "";
     } else {
         if (Request::req("r") >= 0) {
             $men = "Operacion: " . Request::req("op") . " Resultado: Exito";
         }
     }
     $datos = array("nav" => $nav, "work" => $trabajo, "edit" => $edit, "titulo" => $info, "nombre" => $alias, "descripcion" => $artista->getDescripcion(), "login" => "", "formulario" => "", "artistas" => "", "mensajes" => "{$men}", "profile" => $profile, "upload" => $upload, "gallery" => $elementos, "contact" => "");
     echo $plantilla->insertTemplate($vista, $datos);
 }