} $template_list = array("publish"); Statamic_View::set_templates(array_reverse($template_list)); $admin_app->render(null, array('route' => 'publish', 'app' => $admin_app) + $data); return; } } else { // @TODO: Replace this garbage print "no form data"; } } else { // @TODO: Replace this garbage too print "no form data"; } $status = array_get($form_data['yaml'], 'status', 'live'); $status_prefix = Slug::getStatusPrefix($status); // if we got here, have no errors // save to original file if not new if (isset($form_data['new'])) { if ($form_data['type'] == 'date') { $date_or_datetime = Config::getEntryTimestamps() ? $datestamp . "-" . $timestamp : $datestamp; $file = $content_root . "/" . $path . "/" . $status_prefix . $date_or_datetime . "-" . $slug . "." . $content_type; } elseif ($form_data['type'] == 'number') { $slug = $numeric . "." . $slug; $file = $content_root . "/" . $path . "/" . $status_prefix . $slug . "." . $content_type; } elseif ($form_data['type'] == 'none') { if (!preg_match(Pattern::NUMERIC, $slug, $matches)) { $numeric = Statamic::get_next_numeric_folder($path); $slug = $numeric . "-" . $slug; } $file = $content_root . "/" . $path . "/" . $status_prefix . $slug . "/page." . $content_type;