예제 #1
3
 /**
  * Overloaded check function
  *
  * @return	boolean
  * @see		JTable::check
  * @since	1.5
  */
 function check()
 {
     // Require helper
     require_once JPATH_COMPONENT_ADMINISTRATOR . DS . 'helpers' . DS . 'je_content.php';
     jimport('joomla.filter.output');
     // Set title
     $this->title = htmlspecialchars_decode($this->title, ENT_QUOTES);
     // Set alias
     $this->alias = JE_ContentHelper::convertAlias($this->title);
     $this->alias = JApplication::stringURLSafe($this->alias);
     // Check the publish down date is not earlier than publish up.
     if (intval($this->publish_down) > 0 && $this->publish_down < $this->publish_up) {
         // Swap the dates.
         $temp = $this->publish_up;
         $this->publish_up = $this->publish_down;
         $this->publish_down = $temp;
     }
     // Set ordering
     if ($this->state < 0) {
         // Set ordering to 0 if state is archived or trashed
         $this->ordering = 0;
     } else {
         if (empty($this->ordering)) {
             // Set ordering to last if ordering was 0
             $this->ordering = self::getNextOrder('`catid`=' . $this->_db->Quote($this->catid) . ' AND state>=0');
         }
     }
     return true;
 }