git-svn-id: https://192.168.0.254/svn/Proyectos.FundacionLQDVI_WebCongresos/trunk@2 94ccb1af-fd9d-d947-8d90-7f70ea60afc8
125 lines
3.1 KiB
PHP
125 lines
3.1 KiB
PHP
<?php
|
|
/**
|
|
* @version $Id: section.php 14401 2010-01-26 14:10:00Z louis $
|
|
* @package Joomla.Framework
|
|
* @subpackage Table
|
|
* @copyright Copyright (C) 2005 - 2010 Open Source Matters. All rights reserved.
|
|
* @license GNU/GPL, see LICENSE.php
|
|
* Joomla! is free software. This version may have been modified pursuant
|
|
* to the GNU General Public License, and as distributed it includes or
|
|
* is derivative of works licensed under the GNU General Public License or
|
|
* other free or open source software licenses.
|
|
* See COPYRIGHT.php for copyright notices and details.
|
|
*/
|
|
|
|
// Check to ensure this file is within the rest of the framework
|
|
defined('JPATH_BASE') or die();
|
|
|
|
/**
|
|
* Section table
|
|
*
|
|
* @package Joomla.Framework
|
|
* @subpackage Table
|
|
* @since 1.0
|
|
*/
|
|
class JTableSection extends JTable
|
|
{
|
|
/** @var int Primary key */
|
|
var $id = null;
|
|
/** @var string The menu title for the section (a short name)*/
|
|
var $title = null;
|
|
/** @var string The full name for the section*/
|
|
var $name = null;
|
|
/** @var string The alias for the section*/
|
|
var $alias = null;
|
|
/** @var string */
|
|
var $image = null;
|
|
/** @var string */
|
|
var $scope = null;
|
|
/** @var int */
|
|
var $image_position = null;
|
|
/** @var string */
|
|
var $description = null;
|
|
/** @var boolean */
|
|
var $published = null;
|
|
/** @var boolean */
|
|
var $checked_out = 0;
|
|
/** @var time */
|
|
var $checked_out_time = 0;
|
|
/** @var int */
|
|
var $ordering = null;
|
|
/** @var int */
|
|
var $access = null;
|
|
/** @var string */
|
|
var $params = null;
|
|
|
|
/**
|
|
* @param database A database connector object
|
|
*/
|
|
function __construct( &$db ) {
|
|
parent::__construct( '#__sections', 'id', $db );
|
|
}
|
|
|
|
/** Overloaded check function
|
|
*
|
|
* @access public
|
|
* @return boolean
|
|
* @see JTable::check
|
|
* @since 1.5
|
|
*/
|
|
function check()
|
|
{
|
|
// check for valid name
|
|
if (trim( $this->title ) == '') {
|
|
$this->setError( JText::_( 'SECTION MUST HAVE A TITLE') );
|
|
return false;
|
|
}
|
|
|
|
// check for existing name
|
|
/*$query = "SELECT id"
|
|
. ' FROM #__sections "
|
|
. ' WHERE title = '. $this->_db->Quote($this->title)
|
|
. ' AND scope = ' . $this->_db->Quote($this->scope)
|
|
;
|
|
$this->_db->setQuery( $query );
|
|
|
|
$xid = intval( $this->_db->loadResult() );
|
|
if ($xid && $xid != intval( $this->id )) {
|
|
$this->_error = JText::sprintf( 'WARNNAMETRYAGAIN', JText::_( 'Section') );
|
|
return false;
|
|
}*/
|
|
|
|
if(empty($this->alias)) {
|
|
$this->alias = $this->title;
|
|
}
|
|
$this->alias = JFilterOutput::stringURLSafe($this->alias);
|
|
if(trim(str_replace('-','',$this->alias)) == '') {
|
|
$datenow =& JFactory::getDate();
|
|
$this->alias = $datenow->toFormat("%Y-%m-%d-%H-%M-%S");
|
|
}
|
|
|
|
return true;
|
|
}
|
|
|
|
/**
|
|
* Overloaded bind function
|
|
*
|
|
* @access public
|
|
* @param array $hash named array
|
|
* @return null|string null is operation was satisfactory, otherwise returns an error
|
|
* @see JTable:bind
|
|
* @since 1.5
|
|
*/
|
|
function bind($array, $ignore = '')
|
|
{
|
|
if (isset( $array['params'] ) && is_array($array['params']))
|
|
{
|
|
$registry = new JRegistry();
|
|
$registry->loadArray($array['params']);
|
|
$array['params'] = $registry->toString();
|
|
}
|
|
|
|
return parent::bind($array, $ignore);
|
|
}
|
|
}
|