示例#1
0
 private static function viewImagenadmin($mensaje = "", $tipo = "", $email = null)
 {
     $bd = new DataBase();
     $sesion = new Session();
     $sesion->administrador($sesion->getUser());
     $gestor = new ManageUser($bd);
     if ($email != null) {
         $user = $gestor->get($email);
     } else {
         $email = Request::get("email");
         $user = $gestor->get(Request::get("email"));
     }
     $plantilla = new Plantilla('plantillas/index/Theme/index.html');
     $plantilla->insertPlantilla('plantillas/index/imagen/_view.html', "main");
     if (Request::req("borrar")) {
         $mensaje = "Imagen borrada";
         $tipo = "success";
     }
     $plantilla->alerts($mensaje, $tipo);
     $gestorImg = new ManageImagen($bd);
     $images = $gestorImg->getImagenes($user);
     if (count($images) == 0) {
         $plantilla->insertTag("imagenes", "No hay imagenes");
     } else {
         $plantilla->insertImagenes($images, $email);
     }
     $plantilla->getBotones();
     $plantilla->insertUserTagsAdmin($user, $sesion->getUser());
     $plantilla->mostrar();
 }