private static function signView() { $plantilla = new Template(); $vista = $plantilla->getContents("../_plantilla1/_index.html"); $signin = $plantilla->getContents("../_plantilla1/_signin.html"); $nav = $plantilla->getContents("../_plantilla1/_nav.html"); $datos = array("nav" => $nav, "work" => "", "edit" => "", "titulo" => "", "nombre" => "", "descripcion" => "", "login" => "", "formulario" => $signin, "mensajes" => "", "profile" => "", "upload" => "", "gallery" => "", "artistas" => "", "contact" => ""); echo $plantilla->insertTemplate($vista, $datos); }
$f['contents'] = $template->getTemplatesInFolder($f['folder_id']); $f['content_count'] = $template->getCountTemplatesInFolder($f['folder_id']); } unset($f); $letterFolders = $template->getFolders('letters'); foreach ($letterFolders as &$f) { $f['contents'] = $template->getTemplatesInFolder($f['folder_id']); $f['content_count'] = $template->getCountTemplatesInFolder($f['folder_id']); } unset($f); $emailTemplates = $template->getTemplates('email', 0); $letterTemplates = $template->getTemplates('letter', 0); $l10n->addResource(__DIR__ . '/l10n/templates.json'); $viewFile = 'views/templates.php'; } elseif ($_GET['page'] === "create") { $template->insertTemplate($_POST); $loggers['audit']->info("Template created"); header('location:templates.php'); exit; } elseif ($_GET['page'] === "fetch") { $content = $template->getTemplate($_GET['templateid']); $content[0]['content'] = htmlspecialchars_decode($content[0]['content']); header('Content-Type: application/json; charset=utf-8'); echo json_encode($content); exit; } elseif ($_GET['page'] === "update-folder") { $content = $template->updateFolder($_POST['template_id'], $_POST['folder_id']); $loggers['audit']->info("Template {$_POST['template_id']} moved to folder {$_POST['folder_id']}"); } elseif ($_GET['page'] === "delete") { $template->hideTemplate($_GET['id']); $loggers['audit']->info("Template {$_GET['id']} deleted");
private static function editView($gestor) { $plantilla_editar = new Template(); $sesion = new Session(); $artista = self::getArtist($sesion); $formulario = $plantilla_editar->getContents("../" . $artista->getStyle() . "/_form.html"); $vista = $plantilla_editar->getContents("../" . $artista->getStyle() . "/_index.html"); $trabajo = $plantilla_editar->getContents("../" . $artista->getStyle() . "/_work.html"); $edit = $plantilla_editar->getContents("../" . $artista->getStyle() . "/_edit.html"); $nav = $plantilla_editar->getContents("../" . $artista->getStyle() . "/_nav.html"); $textarea = $plantilla_editar->getContents("../" . $artista->getStyle() . "/_textarea.html"); $textarea = $plantilla_editar->replace("value3", $artista->getPerfil(), $textarea); $datos_form_textarea = array("label3" => "Enter profile description:", "campo3" => "perfil", "value3" => $artista->getPerfil()); foreach ($datos_form_textarea as $key => $value) { $textarea = $plantilla_editar->replace($key, $value, $textarea); } $datos_form = array("action" => "?action=edit&do=Set", "method" => "POST", "type1" => "text", "type2" => "text", "type3" => "textarea", "label1" => "Enter title", "label2" => "Enter description", "label3" => "Enter profile", "campo1" => "titulo", "campo2" => "descripcion", "campo_3" => "", "value1" => $artista->getTitulo(), "value2" => $artista->getDescripcion(), "textarea" => $textarea); foreach ($datos_form as $key => $value) { $formulario = $plantilla_editar->replace($key, $value, $formulario); } $datos = array("nav" => $nav, "work" => $trabajo, "edit" => $edit, "titulo" => "EDIT PROFILE ARTIST", "nombre" => "", "descripcion" => $sesion->getUser()->getAlias(), "login" => "", "formulario" => $formulario, "mensajes" => "", "profile" => "", "upload" => "", "gallery" => "", "artistas" => "", "contact" => ""); echo $plantilla_editar->insertTemplate($vista, $datos); }