<?php
/**
* Applies this section to the parent Article.
*
* @version $Id: S_commit_to_article.php,v 1.4 2004/11/12 03:28:19 adarkling Exp $
*
* @author Eloi George <eloi@NOSPAM.bygeorgeware.com>
* @module Article Manager
* @param none
* @return none
*/

/* You can't save an empty section */
if(empty($this->title) && empty($this->text) && empty($this->image['name']))
{
	$_SESSION['SES_ART_master']->error['SECT_title'][] 
	    = $_SESSION['translate']->it('You tried to save an empty section');
	return false;
}
/* If the save request carries the current transaction id... */
if(isset($_POST['transact_id']) && $_POST['transact_id']==$this->transact_id) 
  /* select a new id and continue */
  $this->transact_id = rand(1,999);
else
  /* otherwise, don't save anything */
  return;

/* If this is a new section, add it to the article */
if(!in_array($this->id, $_SESSION['SES_ART_article']->order))
  $_SESSION['SES_ART_article']->add_section();
else
	/* otherwise, just update the article's data */
  $_SESSION['SES_ART_article']->update_section($this->id);

?>