Beispiel #1
0
 * elements of information.
 *
 * Add the option 'edit_as_thread' to activate this script in some article.
 *
 * @author Bernard Paques
 * @reference
 * @license http://www.gnu.org/copyleft/lesser.txt GNU Lesser General Public License
 */
// loaded from articles/view.php
defined('YACS') or exit('Script must be included');
// process uploaded data
if (isset($_SERVER['REQUEST_METHOD']) && $_SERVER['REQUEST_METHOD'] == 'POST') {
    // update an existing page
    if (isset($_REQUEST['id'])) {
        // remember the previous version
        if ($item['id'] && Versions::are_different($item, $_REQUEST)) {
            Versions::save($item, 'article:' . $item['id']);
        }
        // stop on error
        if (!Articles::put_attributes($_REQUEST) || is_object($overlay) && !$overlay->remember('update', $_REQUEST, 'article:' . $_REQUEST['id'])) {
            $item = $_REQUEST;
            $with_form = TRUE;
            // else display the updated page
        } else {
            // do whatever is necessary on page update
            Articles::finalize_update($anchor, $_REQUEST, $overlay, isset($_REQUEST['silent']) && $_REQUEST['silent'] == 'Y', isset($_REQUEST['notify_watchers']) && $_REQUEST['notify_watchers'] == 'Y', isset($_REQUEST['notify_followers']) && $_REQUEST['notify_followers'] == 'Y');
            // cascade changes on access rights
            if ($_REQUEST['active'] != $item['active']) {
                Anchors::cascade('article:' . $item['id'], $_REQUEST['active']);
            }
            // the page has been modified