📄 category.php
字号:
<?php
/**
* @version $Id: category.php 8031 2007-07-17 23:14:23Z jinx $
* @package Joomla.Framework
* @subpackage Table
* @copyright Copyright (C) 2005 - 2007 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();
/**
* Category table
*
* @package Joomla.Framework
* @subpackage Table
* @since 1.0
*/
class JTableCategory extends JTable
{
/** @var int Primary key */
var $id = null;
/** @var int */
var $parent_id = null;
/** @var string The menu title for the category (a short name)*/
var $title = null;
/** @var string The full name for the category*/
var $name = null;
/** @var string The the alias for the category*/
var $alias = null;
/** @var string */
var $image = null;
/** @var string */
var $section = 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( '#__categories', '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->_error = JText::sprintf( 'must contain a title', JText::_( 'Category') );
return false;
}
// check for existing name
/*$query = 'SELECT id'
. ' FROM #__categories '
. ' WHERE title = '.$this->_db->Quote($this->title)
. ' AND section = '.$this->_db->Quote($this->section)
;
$this->_db->setQuery( $query );
$xid = intval( $this->_db->loadResult() );
if ($xid && $xid != intval( $this->id )) {
$this->_error = JText::sprintf( 'WARNNAMETRYAGAIN', JText::_( 'Category') );
return false;
}*/
jimport('joomla.filter.output');
$alias = JFilterOutput::stringURLSafe($this->title);
if(empty($this->alias) || $this->alias === $alias ) {
$this->alias = $alias;
}
return true;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -