CoreFiles by mySites.guru
newsfeed.php53 lines, 1,403 bytes, from Joomla_2.5.21-Stable-Full_Package.zip
Raw History Compare with 2.5.20
md5
cbfaa7bc78a40a80352f070df646c67c
sha1
e7afa179477adba5774d6c26a9d4357b2e5c25f4
sha256
c8afdd3f15e65d9321ec0ea5ae1a2f676f75e2c0a6be208f33a808ef6172b639
<?php
/**
 * @package		Joomla.Administrator
 * @copyright	Copyright (C) 2005 - 2014 Open Source Matters, Inc. All rights reserved.
 * @license		GNU General Public License version 2 or later; see LICENSE.txt
 */

// No direct access
defined('_JEXEC') or die;

/**
 * Renders a newsfeed selection element
 *
 * @package		Joomla.Administrator
 * @subpackage	com_newsfeeds
 * @deprecated	JParameter is deprecated and will be removed in a future version. Use JForm instead.
 * @since		1.5
 */

class JElementNewsfeed extends JElement
{
	/**
	 * Element name
	 *
	 * @var		string
	 */
	protected	$_name = 'Newsfeed';

	public function fetchElement($name, $value, &$node, $control_name)
	{
		$db = JFactory::getDbo();

		$query = 'SELECT a.id, c.title, a.name'
		. ' FROM #__newsfeeds AS a'
		. ' INNER JOIN #__categories AS c ON a.catid = c.id'
		. ' WHERE a.published = 1'
		. ' AND c.published = 1'
		. ' ORDER BY a.catid, a.name'
		;
		$db->setQuery($query);
		$options = $db->loadObjectList();

		$n = count($options);
		for ($i = 0; $i < $n; $i++)
		{
			$options[$i]->text = $options[$i]->title . '-' . $options[$i]->name;
		}

		array_unshift($options, JHtml::_('select.option', '0', '- '.JText::_('COM_NEWSFEEDS_SELECT_FEED').' -', 'id', 'text'));

		return JHtml::_('select.genericlist',  $options, ''.$control_name.'['.$name.']', 'class="inputbox"', 'id', 'text', $value, $control_name.$name);
	}
}

The same content is in 11 releases, Joomla 2.5.18 to 2.5.28. See them all, or every version of this file.