function view() { $wiz = new MergeJournoWizard(); if ($wiz->is_complete()) { $params = $wiz->get_cleaned_data(); $actions = merge_journos($params['from_ref'], $params['into_ref']); template_completed(array('wiz' => $wiz, 'actions' => $actions)); return; } else { if ($wiz->step == 1) { // preview } else { } } $vars = array('wiz' => $wiz); template($vars); }
function view() { $wiz = new SplitJournoWizard(); if ($wiz->is_complete()) { // perform the split... $params = $wiz->get_cleaned_data(); $split_pubs = $params['split_pubs']; $from_ref = $params['from_ref']; $to_ref = $params['to_ref']; if (!$to_ref) { // make sure source journo has a numeric postfix, and create a new dest journo $baseref = RefBase($from_ref); $num = RefNum($from_ref); if (is_null($num)) { $new_from_ref = NextFreeRef($baseref, 1); $num = RefNum($new_from_ref); } $to_ref = NextFreeRef($baseref, $num + 1); } else { // source journo retains their existing ref $new_from_ref = $from_ref; } $actions = do_split($from_ref, $new_from_ref, $split_pubs, $to_ref); template_completed(array('wiz' => $wiz, 'actions' => $actions)); } else { $art_summary = null; if ($wiz->step == 2) { // preview/confirmation $params = $wiz->get_cleaned_data(); $art_summary = preview_articles($params); } template_step(array('wiz' => $wiz, 'art_summary' => $art_summary)); } }