if (is_object($overlay)) { $overlay->remember('insert', $_REQUEST, 'article:' . $_REQUEST['id']); } // increment the post counter of the surfer Users::increment_posts(Surfer::get_id()); // do whatever is necessary on page publication if (isset($_REQUEST['publish_date']) && $_REQUEST['publish_date'] > NULL_DATE) { Articles::finalize_publication($anchor, $_REQUEST, $overlay, isset($_REQUEST['silent']) && $_REQUEST['silent'] == 'Y', isset($_REQUEST['notify_followers']) && $_REQUEST['notify_followers'] == 'Y'); // else do whatever is necessary on page submission } else { Articles::finalize_submission($anchor, $_REQUEST, $overlay); } // get the new item $article = Anchors::get('article:' . $_REQUEST['id'], TRUE); // list persons that have been notified $context['text'] .= Mailer::build_recipients('article:' . $_REQUEST['id']); // list endpoints that have been notified $context['text'] .= Servers::build_endpoints(i18n::s('Servers that have been notified')); // follow-up commands $follow_up = i18n::s('What do you want to do now?'); $menu = array(); $menu = array_merge($menu, array($article->get_url() => i18n::s('View the page'))); if (Surfer::may_upload()) { $menu = array_merge($menu, array('files/edit.php?anchor=' . urlencode('article:' . $_REQUEST['id']) => i18n::s('Add a file'))); } if ((!isset($_REQUEST['publish_date']) || $_REQUEST['publish_date'] <= NULL_DATE) && Surfer::is_empowered()) { $menu = array_merge($menu, array(Articles::get_url($_REQUEST['id'], 'publish') => i18n::s('Publish the page'))); } if (is_object($anchor) && Surfer::is_empowered()) { $menu = array_merge($menu, array('articles/edit.php?anchor=' . urlencode($anchor->get_reference()) => i18n::s('Add another page'))); }
$anchor->touch('section:create', $_REQUEST['id'], isset($_REQUEST['silent']) && $_REQUEST['silent'] == 'Y'); } // send to followers of this user if (isset($_REQUEST['notify_followers']) && $_REQUEST['notify_followers'] == 'Y' && Surfer::get_id() && $_REQUEST['active'] != 'N') { $mail['message'] = Mailer::build_notification($mail['notification'], 2); Users::alert_watchers('user:'******'section:' . $_REQUEST['id'], TRUE); // reward the poster for new posts $context['page_title'] = i18n::s('Thank you for your contribution'); $context['text'] .= '<p>' . i18n::s('Please review the new page carefully and fix possible errors rapidly.') . '</p>'; // list persons that have been notified $context['text'] .= Mailer::build_recipients('section:' . $_REQUEST['id']); // follow-up commands $follow_up = i18n::s('What do you want to do now?'); $menu = array(); $menu = array_merge($menu, array($section->get_url() => i18n::s('View the section'))); if (Surfer::may_upload()) { $menu = array_merge($menu, array('images/edit.php?anchor=' . urlencode('section:' . $_REQUEST['id']) => i18n::s('Add an image'))); } if (preg_match('/\\bwith_files\\b/i', $section->item['options']) && Surfer::may_upload()) { $menu = array_merge($menu, array('files/edit.php?anchor=' . urlencode('section:' . $_REQUEST['id']) => i18n::s('Add a file'))); } if (preg_match('/\\bwith_links\\b/i', $section->item['options'])) { $menu = array_merge($menu, array('links/edit.php?anchor=' . urlencode('section:' . $_REQUEST['id']) => i18n::s('Add a link'))); } if (is_object($anchor)) { $menu = array_merge($menu, array('sections/edit.php?anchor=' . urlencode($anchor->get_reference()) => i18n::s('Add another section')));
Activities::post('file:' . $_REQUEST['id'], 'upload'); // touch the related anchor $anchor->touch($action, $_REQUEST['id'], isset($_REQUEST['silent']) && $_REQUEST['silent'] == 'Y'); // clear cache Files::clear($_REQUEST); // process several files } else { // touch the related anchor $anchor->touch('file:create', NULL, isset($_REQUEST['silent']) && $_REQUEST['silent'] == 'Y'); } if ($render_overlaid) { echo 'post done'; die; } // list persons that have been notified $context['text'] .= Mailer::build_recipients($anchor->get_reference()); // follow-up commands $follow_up = i18n::s('What do you want to do now?'); // follow-up commands -- do not use #_attachments, because of thread layout, etc. $menu = array(); if (is_object($anchor)) { $menu = array_merge($menu, array($anchor->get_url('files') => i18n::s('Back to main page'))); } if (is_object($anchor) && Surfer::may_upload()) { $menu = array_merge($menu, array('files/edit.php?anchor=' . $anchor->get_reference() => i18n::s('Upload another file'))); } $follow_up .= Skin::build_list($menu, 'menu_bar'); $context['text'] .= Skin::build_block($follow_up, 'bottom'); // forward to the updated page } else { // touch the related anchor
} // update the database if ($error = Articles::stamp($item['id'], $_REQUEST['publish_date'], isset($_REQUEST['expiry_date']) ? $_REQUEST['expiry_date'] : NULL_DATE)) { Logger::error($error); } else { // reflect in memory what has been saved in database $item['publish_date'] = $_REQUEST['publish_date']; // send to watchers of this page, and to watchers upwards $watching_context = new Article(); $watching_context->load_by_content($item, $anchor); // do whatever is necessary on page publication Articles::finalize_publication($watching_context, $item, $overlay, isset($_REQUEST['silent']) && $_REQUEST['silent'] == 'Y', isset($_REQUEST['notify_followers']) && $_REQUEST['notify_followers'] == 'Y'); // splash messages $context['text'] .= '<p>' . i18n::s('The page has been successfully published.') . "</p>\n"; // list persons that have been notified $context['text'] .= Mailer::build_recipients('article:' . $item['id']); // clear the cache Articles::clear($item); // follow-up commands $follow_up = i18n::s('Where do you want to go now?'); $menu = array(); $menu = array_merge($menu, array(Articles::get_permalink($item) => i18n::s('Back to main page'))); if (Surfer::is_associate()) { $menu = array_merge($menu, array('articles/review.php' => i18n::s('Review queue'))); } $follow_up .= Skin::build_list($menu, 'menu_bar'); $context['text'] .= Skin::build_block($follow_up, 'bottom'); } // display the form on GET } else { $with_form = TRUE;