Beispiel #1
0
    if (isset($_GET['report'])) {
        $link = carl_make_link(array('report' => ''));
        $cache = new ReasonObjectCache($_GET['report']);
        $report =& $cache->fetch();
        if (isset($report['report'])) {
            echo '<h2>Full Report</h2>';
            echo $report['report'];
        } else {
            echo '<p>Nothing to Report</p>';
        }
        $link = carl_make_link(array('report' => ''));
        echo '<p><a href="' . $link . '">Do another Wordpress Import</a></p>';
    } else {
        // Initialize the controller and set a few options.
        $controller = new FormController();
        $controller->set_session_class('Session_PHP');
        $controller->set_session_name('REASON_SESSION');
        $controller->set_data_context('wordpress_import');
        $controller->show_back_button = false;
        $controller->clear_form_data_on_finish = true;
        $controller->allow_arbitrary_start = false;
        $controller->reason_user_id = $reason_user_id;
        // Set up the progression of forms.
        $forms = array('SetupForm' => array('start_step' => true, 'next_steps' => array('ConfirmForm' => array('label' => 'Continue')), 'step_decision' => array('type' => 'user')), 'ConfirmForm' => array('final_step' => 'true', 'final_button_text' => 'Confirm'));
        $controller->add_forms($forms);
        $controller->init();
        $controller->run();
    }
    echo '</body>';
    echo '</html>';
}
Beispiel #2
0
reason_include_once('classes/session_php.php');
include_once DISCO_INC . 'controller.php';
if (!carl_is_php5()) {
    echo '<p>Sorry this requires php 5 for now</p>';
    die;
}
// Require that whomever is using the form have access.
reason_require_authentication('', 'session');
// Include all of the forms.
reason_include_once('scripts/developer_tools/page_type_wizard/SelectForm.php');
reason_include_once('scripts/developer_tools/page_type_wizard/EditForm.php');
reason_include_once('scripts/developer_tools/page_type_wizard/FormatForm.php');
//Initialize the controller and set a few options.
$controller = new FormController();
$controller->set_session_class('Session_PHP');
$controller->set_session_name('REASON_SESSION');
$controller->set_data_context('page_type_wizard');
$controller->show_back_button = true;
$controller->clear_form_data_on_finish = false;
$controller->allow_arbitrary_start = false;
// Set up the progression of forms.
$forms = array('SelectForm' => array('start_step' => true, 'next_steps' => array('EditForm' => array('label' => 'Select this page type')), 'step_decision' => array('type' => 'user')), 'EditForm' => array('next_steps' => array('FormatForm' => array('label' => 'Next')), 'step_decision' => array('type' => 'user')), 'FormatForm' => array('final_step' => array('label' => 'export')));
// Add, init, and run the forms.
$controller->add_forms($forms);
$controller->init();
//$controller->set_request( $_REQUEST );
$controller->run();
?>
</body>
</html>
 function run()
 {
     $nametag = $this->admin_page->user_id;
     $face = $this->admin_page->authenticated_user_id;
     if (empty($_REQUEST['site_id'])) {
         echo "Please select a site to get started.";
         return;
     }
     if (!empty($_REQUEST['newsletterIsFinished'])) {
         echo "<h1>Newsletter sent!</h1>";
         echo "<h2>Process complete.<h2>";
         echo '<p><a href="' . $this->admin_page->make_link(array('newsletterIsFinished' => '')) . '">Send another newsletter</a></p>' . "\n";
         return;
     }
     $controller = new FormController();
     $controller->set_session_class('Session_PHP');
     $controller->set_session_name('REASON_SESSION');
     $controller->set_data_context('newsletter_maker_' . $this->admin_page->site_id);
     $controller->show_back_button = true;
     $controller->clear_form_data_on_finish = true;
     $controller->allow_arbitrary_start = false;
     $controller->authenticated_user_id = $face;
     $controller->user_id = $face;
     if ($nametag != $face) {
         if (reason_user_has_privs($face, 'pose_as_other_user')) {
             $controller->user_id = $nametag;
         }
     }
     // Set up the progression of forms.
     $forms = array('SelectIncludes' => array('start_step' => true, 'next_steps' => array('SelectItems' => array('label' => 'Continue')), 'step_decision' => array('type' => 'user')), 'SelectItems' => array('next_steps' => array('SelectTemplate' => array('label' => 'Continue')), 'step_decision' => array('type' => 'user')), 'SelectTemplate' => array('next_steps' => array('EditNewsletter' => array('label' => 'Continue')), 'step_decision' => array('type' => 'user')), 'EditNewsletter' => array('next_steps' => array('ComposeEmail' => array('label' => 'Continue')), 'step_decision' => array('type' => 'user')), 'ComposeEmail' => array('final_step' => true));
     // Add, init, and run the forms.
     $controller->add_forms($forms);
     $controller->init();
     $controller->preserve_query_string = true;
     $controller->run();
 }