Source for file messages.php
Documentation is available at messages.php
* @package Joomla.Administrator
* @subpackage com_postinstall
* @copyright Copyright (C) 2005 - 2013 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
* Model class to manage postinstall messages
* @package Joomla.Administrator
* @subpackage com_postinstall
* Builds the SELECT query
* @param boolean $overrideLimits Are we requested to override the set limits?
public function buildQuery($overrideLimits =
false)
// Add a forced extension filtering to the list
$eid =
$this->input->getInt('eid', 700);
$query->where($db->qn('extension_id') .
' = ' .
$db->q($eid));
// Force filter only enabled messages
$published =
$this->input->getInt('published', 1);
$query->where($db->qn('enabled') .
' = ' .
$db->q($published));
* Returns the name of an extension, as registered in the #__extensions table
* @param integer $eid The extension ID
* @return string The extension name
// Load the extension's information from the database
$query =
$db->getQuery(true)
->select(array('name', 'element', 'client_id'))
->from($db->qn('#__extensions'))
->where($db->qn('extension_id') .
' = ' .
$db->q((int)
$eid));
$db->setQuery($query, 0, 1);
$extension =
$db->loadObject();
if ($extension->client_id ==
0)
$lang->load($extension->element, $basePath);
// Return the localised name
return JText::_($extension->name);
* Resets all messages for an extension
* @param integer $eid The extension ID whose messages we'll reset
* @return mixed False if we fail, a db cursor otherwise
$query =
$db->getQuery(true)
->update($db->qn('#__postinstall_messages'))
->set($db->qn('enabled') .
' = ' .
$db->q(1))
->where($db->qn('extension_id') .
' = ' .
$db->q($eid));
* List post-processing. This is used to run the programmatic display
* conditions against each list item and decide if we have to show it or
* Do note that this a core method of the RAD Layer which operates directly
* on the list it's being fed. A little touch of modern magic.
* @param array $resultArray A list of items to process
$language_extensions =
array();
foreach ($resultArray as $key =>
$item)
// Filter out messages based on dynamically loaded programmatic conditions
if (!empty($item->condition_file) &&
!empty($item->condition_method))
// Load the necessary language files
if (!empty($item->language_extension))
$hash =
$item->language_client_id .
'-' .
$item->language_extension;
if (!in_array($hash, $language_extensions))
$language_extensions[] =
$hash;
foreach ($unset_keys as $key)
unset
($resultArray[$key]);
Documentation generated on Tue, 19 Nov 2013 15:08:08 +0100 by phpDocumentor 1.4.3