if ($message) { echo $message; } $template_help_html = $Template->find_help(); if ($template_help_html) { echo $HTML->heading2('Help'); echo '<div id="template-help">' . $template_help_html . '</div>'; } echo $HTML->heading2('Blog details'); echo $Form->form_start(); echo $Form->text_field('blogTitle', 'Title', isset($details['blogTitle']) ? $details['blogTitle'] : ''); $opts = array(); if (PerchUtil::count($category_sets)) { foreach ($category_sets as $Set) { $opts[] = array('value' => $Set->setSlug(), 'label' => $Set->setTitle()); } } echo $Form->select_field('setSlug', 'Category set', $opts, isset($details['setSlug']) ? $details['setSlug'] : ''); $opts = array(); $Util = new PerchBlog_Util($API); $templates = $Util->find_templates(); if (PerchUtil::count($templates)) { foreach ($templates as $template) { $opts[] = array('value' => $template, 'label' => PerchUtil::filename($template, true)); } } echo $Form->select_field('postTemplate', 'Default master template', $opts, isset($details['postTemplate']) ? $details['postTemplate'] : 'post.html'); echo $Form->fields_from_template($Template, $details, $Blogs->static_fields); echo $Form->submit_field('btnSubmit', 'Save', $API->app_path() . '/blogs/'); echo $Form->form_end(); echo $HTML->main_panel_end();
<?php $HTML = $API->get('HTML'); if (!$CurrentUser->has_priv('perch_blog.import')) { PerchUtil::redirect($API->app_path()); } $BlogUtil = new PerchBlog_Util($API); $files = $BlogUtil->find_importable_files(); $Form = $API->get('Form'); $Form->require_field('file', 'Required'); if ($Form->submitted()) { $postvars = array('file', 'format', 'type', 'section'); $data = $Form->receive($postvars); switch ($data['type']) { case 'wordpress': PerchUtil::redirect($API->app_path() . '/import/wordpress?' . http_build_query($data)); break; case 'posterous': PerchUtil::redirect($API->app_path() . '/import/posterous?' . http_build_query($data)); break; } }