FundacionLQDVI_WebCongresos/www/administrator/components/com_sql2excel/tables/sqlexcelsection.php

57 lines
1.3 KiB
PHP

<?php
/*
* @component SQL 2 Excel Component
* @copyright Copyright (C) Joomla-R-Us, joomla-r-us.com
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU/GPLv3
*/
// no direct access
defined('_JEXEC') or die('Restricted access');
// Include library dependencies
jimport('joomla.filter.input');
class TableSqlexcelsection extends JTable
{
// #__sql2excel_sections
var $id = null;
var $title = null;
var $alias = null;
var $description = null;
var $published = null;
var $checked_out = null;
var $checked_out_time = null;
var $ordering = null;
var $access = null;
var $count = null;
function __construct(& $db) {
parent::__construct('#__sql2excel_sections', 'id', $db);
}
function check()
{
// Make sure the section has a title specified
if (trim( $this->title ) == '') {
$this->setError( JText::_( 'The section must have a title') );
return false;
}
// Make sure we do have an alias
if(empty($this->alias)) {
$this->alias = $this->title;
}
// Make alias URL safe
$this->alias = JFilterOutput::stringURLSafe($this->alias);
$this->alias = str_replace('-','',$this->alias);
if($this->alias == '') {
$datenow =& JFactory::getDate();
$this->alias = $datenow->toFormat("%Y-%m-%d-%H-%M-%S");
}
return true;
}
}
?>