- md5
- 333c61a6d0986ff49aba2acbcd06d963
- sha1
- ca800b4c8acbd9970b1e1609d0c08f88bd36fdea
- sha256
- c0ff25a81f320f8368952fec132d42a4b646962095114529c43316b94056bf1d
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
<?php
/**
* @version $Id: helper.php 10381 2008-06-01 03:35:53Z pasamio $
* @package Joomla
* @subpackage Content
* @copyright Copyright (C) 2005 - 2008 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.
*/
/**
* Content Component Helper
*
* @static
* @package Joomla
* @subpackage Content
* @since 1.5
*/
class ContentHelper
{
function saveContentPrep( &$row )
{
// Get submitted text from the request variables
$text = JRequest::getVar( 'text', '', 'post', 'string', JREQUEST_ALLOWRAW );
// Clean text for xhtml transitional compliance
$text = str_replace( '<br>', '<br />', $text );
// Search for the {readmore} tag and split the text up accordingly.
$tagPos = JString::strpos( $text, '<hr id="system-readmore" />' );
if ( $tagPos === false )
{
$row->introtext = $text;
} else
{
$row->introtext = JString::substr($text, 0, $tagPos);
$row->fulltext = JString::substr($text, $tagPos + 27 );
}
// Filter settings
jimport( 'joomla.application.component.helper' );
$config = JComponentHelper::getParams( 'com_content' );
$user = &JFactory::getUser();
$gid = $user->get( 'gid' );
$filterGroups = (array) $config->get( 'filter_groups' );
if (in_array( $gid, $filterGroups ))
{
$filterType = $config->get( 'filter_type' );
$filterTags = preg_split( '#[,\s]+#', trim( $config->get( 'filter_tags' ) ) );
$filterAttrs = preg_split( '#[,\s]+#', trim( $config->get( 'filter_attritbutes' ) ) );
switch ($filterType)
{
case 'NH':
$filter = new JFilterInput();
break;
case 'WL':
$filter = new JFilterInput( $filterTags, $filterAttrs, 0, 0 );
break;
case 'BL':
default:
$filter = new JFilterInput( $filterTags, $filterAttrs, 1, 1 );
break;
}
$row->introtext = $filter->clean( $row->introtext );
$row->fulltext = $filter->clean( $row->fulltext );
}
return true;
}
/**
* Function to reset Hit count of an article
*
*/
function resetHits($redirect, $id)
{
global $mainframe;
// Initialize variables
$db = & JFactory::getDBO();
// Instantiate and load an article table
$row = & JTable::getInstance('content');
$row->Load($id);
$row->hits = 0;
$row->store();
$row->checkin();
$msg = JText::_('Successfully Reset Hit count');
$mainframe->redirect('index.php?option=com_content§ionid='.$redirect.'&task=edit&id='.$id, $msg);
}
function filterCategory($query, $active = NULL)
{
// Initialize variables
$db = & JFactory::getDBO();
$categories[] = JHTML::_('select.option', '0', '- '.JText::_('Select Category').' -');
$db->setQuery($query);
$categories = array_merge($categories, $db->loadObjectList());
$category = JHTML::_('select.genericlist', $categories, 'catid', 'class="inputbox" size="1" onchange="document.adminForm.submit( );"', 'value', 'text', $active);
return $category;
}
}
No other release has this exact content. See every version of this file.