CoreFiles by mySites.guru
compare.php56 lines, 1,435 bytes, from Joomla_3.2.0-Stable-Full_Package.zip
Raw History Compare with 3.1.6
md5
f6ac0e952d24348f9a4a4bd526a5d997
sha1
a008796b8614d866c8878b0b3866dca9faa760ed
sha256
eeef05011ef51fb58ebda285b19eae02b85e6dcaa36b0af414eccf433a6a1833
<?php
/**
 * @package     Joomla.Administrator
 * @subpackage  com_contenthistory
 *
 * @copyright   Copyright (C) 2005 - 2013 Open Source Matters, Inc. All rights reserved.
 * @license     GNU General Public License version 2 or later; see LICENSE.txt
 */

defined('_JEXEC') or die;

JLoader::register('ContenthistoryHelper', JPATH_ADMINISTRATOR . '/components/com_contenthistory/helpers/contenthistory.php');

/**
 * Methods supporting a list of contenthistory records.
 *
 * @package     Joomla.Administrator
 * @subpackage  com_contenthistory
 * @since       3.2
 */
class ContenthistoryModelCompare extends JModelItem
{
	/**
	 * Method to get a version history row.
	 *
	 * @return  mixed    On success, array of populated tables. False on failure.
	 *
	 * @since   3.2
	 */
	public function getItems()
	{
		$table1 = JTable::getInstance('Contenthistory');
		$table2 = JTable::getInstance('Contenthistory');
		$id1 = JFactory::getApplication()->input->getInt('id1');
		$id2 = JFactory::getApplication()->input->getInt('id2');
		$result = array();

		if ($table1->load($id1) && $table2->load($id2))
		{
			foreach (array($table1, $table2) as $table)
			{
				$object = new stdClass;
				$object->data = ContenthistoryHelper::prepareData($table);
				$object->version_note = $table->version_note;
				$object->save_date = $table->save_date;
				$result[] = $object;
			}

			return $result;
		}
		else
		{
			return false;
		}
	}
}

The same content is in 2 releases, Joomla 3.2.0 to 3.2.1. See them all, or every version of this file.