29
0
mirror of https://github.com/joomla/joomla-cms.git synced 2024-07-02 18:13:43 +00:00

[imp] Change deprecated $app->getCfg() to $app->get() and some CS.

Close #3817, close #3815, close #3814
This commit is contained in:
zero-24 2014-06-21 15:40:14 +02:00 committed by Thomas Hunziker
parent 2bc029683d
commit e2bcdf0a60
55 changed files with 566 additions and 471 deletions

View File

@ -27,7 +27,7 @@ defined('_JEXEC') or die;
function admin_postinstall_eaccelerator_condition()
{
$app = JFactory::getApplication();
$cacheHandler = $app->getCfg('cacheHandler', '');
$cacheHandler = $app->get('cacheHandler', '');
return (ucfirst($cacheHandler) == 'Eaccelerator');
}

View File

@ -273,7 +273,7 @@ class BannersModelTracks extends JModelList
{
$app = JFactory::getApplication();
$basename = $this->getState('basename');
$basename = str_replace('__SITE__', $app->getCfg('sitename'), $basename);
$basename = str_replace('__SITE__', $app->get('sitename'), $basename);
$categoryId = $this->getState('filter.category_id');
if (is_numeric($categoryId))
@ -502,12 +502,12 @@ class BannersModelTracks extends JModelList
$files['track']['name'] = $this->getBasename() . '.csv';
$files['track']['data'] = $this->content;
$files['track']['time'] = time();
$ziproot = $app->getCfg('tmp_path') . '/' . uniqid('banners_tracks_') . '.zip';
$ziproot = $app->get('tmp_path') . '/' . uniqid('banners_tracks_') . '.zip';
// Run the packager
jimport('joomla.filesystem.folder');
jimport('joomla.filesystem.file');
$delete = JFolder::files($app->getCfg('tmp_path') . '/', uniqid('banners_tracks_'), false, true);
$delete = JFolder::files($app->get('tmp_path') . '/', uniqid('banners_tracks_'), false, true);
if (!empty($delete))
{

View File

@ -178,7 +178,7 @@ class CategoriesModelCategory extends JModelAdmin
$result->metadata = $registry->toArray();
// Convert the created and modified dates to local user time for display in the form.
$tz = new DateTimeZone(JFactory::getApplication()->getCfg('offset'));
$tz = new DateTimeZone(JFactory::getApplication()->get('offset'));
if ((int) $result->created_time)
{

View File

@ -68,7 +68,7 @@ class CheckinModelCheckin extends JModelList
foreach ($ids as $tn)
{
// make sure we get the right tables based on prefix
if (stripos($tn, $app->getCfg('dbprefix')) !== 0)
if (stripos($tn, $app->get('dbprefix')) !== 0)
{
continue;
}
@ -122,8 +122,8 @@ class CheckinModelCheckin extends JModelList
{
if (!isset($this->items))
{
$app = JFactory::getApplication();
$db = $this->_db;
$app = JFactory::getApplication();
$db = $this->_db;
$tables = $db->getTableList();
// this array will hold table name as key and checked in item count as value
@ -132,7 +132,7 @@ class CheckinModelCheckin extends JModelList
foreach ($tables as $i => $tn)
{
// make sure we get the right tables based on prefix
if (stripos($tn, $app->getCfg('dbprefix')) !== 0)
if (stripos($tn, $app->get('dbprefix')) !== 0)
{
unset($tables[$i]);
continue;
@ -152,6 +152,7 @@ class CheckinModelCheckin extends JModelList
continue;
}
}
foreach ($tables as $tn)
{
$query = $db->getQuery(true)
@ -160,6 +161,7 @@ class CheckinModelCheckin extends JModelList
->where('checked_out > 0');
$db->setQuery($query);
if ($db->execute())
{
$results[$tn] = $db->loadResult();
@ -169,7 +171,9 @@ class CheckinModelCheckin extends JModelList
continue;
}
}
$this->total = count($results);
if ($this->getState('list.ordering') == 'table')
{
if ($this->getState('list.direction') == 'asc')
@ -192,9 +196,11 @@ class CheckinModelCheckin extends JModelList
arsort($results);
}
}
$results = array_slice($results, $this->getState('list.start'), $this->getState('list.limit') ? $this->getState('list.limit') : null);
$this->items = $results;
}
return $this->items;
}
}

View File

@ -168,14 +168,14 @@ abstract class FinderIndexer
$data->startTime = JFactory::getDate()->toSQL();
// Set the remaining default values.
$data->batchSize = (int) $data->options->get('batch_size', 50);
$data->batchSize = (int) $data->options->get('batch_size', 50);
$data->batchOffset = 0;
$data->totalItems = 0;
$data->totalItems = 0;
$data->pluginState = array();
}
// Setup the profiler if debugging is enabled.
if (JFactory::getApplication()->getCfg('debug'))
if (JFactory::getApplication()->get('debug'))
{
self::$profiler = JProfiler::getInstance('FinderIndexer');
}

View File

@ -670,7 +670,7 @@ class FinderIndexerQuery
$when2 = JString::trim(JString::strtolower($when2));
// Get the time offset.
$offset = JFactory::getApplication()->getCfg('offset');
$offset = JFactory::getApplication()->get('offset');
// Array of allowed when values.
$whens = array('before', 'after', 'exact');
@ -796,7 +796,7 @@ class FinderIndexerQuery
case 'after':
{
// Get the time offset.
$offset = JFactory::getApplication()->getCfg('offset');
$offset = JFactory::getApplication()->get('offset');
// Array of allowed when values.
$whens = array('before', 'after', 'exact');

View File

@ -7,7 +7,7 @@
* @license GNU General Public License version 2 or later; see LICENSE
*/
defined('JPATH_BASE') or die;
defined('_JEXEC') or die;
JFormHelper::loadFieldClass('list');
@ -40,7 +40,7 @@ class JFormFieldDirectories extends JFormFieldList
*/
public function getOptions()
{
$values = array();
$values = array();
$options = array();
$exclude = array(
JPATH_ADMINISTRATOR,
@ -53,8 +53,8 @@ class JFormFieldDirectories extends JFormFieldList
JPATH_SITE . '/language',
JPATH_SITE . '/modules',
JPATH_THEMES,
JFactory::getApplication()->getCfg('log_path'),
JFactory::getApplication()->getCfg('tmp_path')
JFactory::getApplication()->get('log_path'),
JFactory::getApplication()->get('tmp_path')
);
// Get the base directories.

View File

@ -54,7 +54,7 @@ class InstallerModelInstall extends JModelLegacy
$app->setUserState('com_installer.extension_message', '');
// Recall the 'Install from Directory' path.
$path = $app->getUserStateFromRequest($this->_context . '.install_directory', 'install_directory', $app->getCfg('tmp_path'));
$path = $app->getUserStateFromRequest($this->_context . '.install_directory', 'install_directory', $app->get('tmp_path'));
$this->setState('install.directory', $path);
parent::populateState();
}
@ -80,7 +80,8 @@ class InstallerModelInstall extends JModelLegacy
$package = null;
// This event allows an input pre-treatment, a custom pre-packing or custom installation (e.g. from a JSON description)
// This event allows an input pre-treatment, a custom pre-packing or custom installation
// (e.g. from a JSON description)
$results = $dispatcher->trigger('onInstallerBeforeInstallation', array($this, &$package));
if (in_array(true, $results, true))

View File

@ -19,14 +19,14 @@ defined('_JEXEC') or die;
class MessagesModelMessage extends JModelAdmin
{
/**
* message
* Message
*/
protected $item;
/**
* Method to auto-populate the model state.
*
* Note. Calling getState in this method will result in recursion.
* @note Calling getState in this method will result in recursion.
*
* @since 1.6
*/
@ -36,7 +36,7 @@ class MessagesModelMessage extends JModelAdmin
$input = JFactory::getApplication()->input;
$user = JFactory::getUser();
$user = JFactory::getUser();
$this->setState('user.id', $user->get('id'));
$messageId = (int) $input->getInt('message_id');
@ -49,7 +49,7 @@ class MessagesModelMessage extends JModelAdmin
/**
* Check that recipient user is the one trying to delete and then call parent delete method
*
* @param array &$pks An array of record primary keys.
* @param array &$pks An array of record primary keys.
*
* @return boolean True if successful, false if an error occurs.
*
@ -57,9 +57,9 @@ class MessagesModelMessage extends JModelAdmin
*/
public function delete(&$pks)
{
$pks = (array) $pks;
$pks = (array) $pks;
$table = $this->getTable();
$user = JFactory::getUser();
$user = JFactory::getUser();
// Iterate the items to delete each one.
foreach ($pks as $i => $pk)
@ -71,25 +71,30 @@ class MessagesModelMessage extends JModelAdmin
// Prune items that you can't change.
unset($pks[$i]);
JLog::add(JText::_('JLIB_APPLICATION_ERROR_DELETE_NOT_PERMITTED'), JLog::WARNING, 'jerror');
return false;
}
}
else
{
$this->setError($table->getError());
return false;
}
}
return parent::delete($pks);
}
/**
* Returns a Table object, always creating it.
*
* @param type The table type to instantiate
* @param string A prefix for the table class name. Optional.
* @param array Configuration array for model. Optional.
* @return JTable A database object
* @param type The table type to instantiate
* @param string A prefix for the table class name. Optional.
* @param array Configuration array for model. Optional.
*
* @return JTable A database object
*
* @since 1.6
*/
public function getTable($type = 'Message', $prefix = 'MessagesTable', $config = array())
@ -100,8 +105,10 @@ class MessagesModelMessage extends JModelAdmin
/**
* Method to get a single record.
*
* @param integer The id of the primary key.
* @return mixed Object on success, false on failure.
* @param integer The id of the primary key.
*
* @return mixed Object on success, false on failure.
*
* @since 1.6
*/
public function getItem($pk = null)
@ -117,8 +124,8 @@ class MessagesModelMessage extends JModelAdmin
if ($replyId = $this->getState('reply.id'))
{
// If replying to a message, preload some data.
$db = $this->getDbo();
$query = $db->getQuery(true)
$db = $this->getDbo();
$query = $db->getQuery(true)
->select($db->quoteName(array('subject', 'user_id_from')))
->from($db->quoteName('#__messages'))
->where($db->quoteName('message_id') . ' = ' . (int) $replyId);
@ -130,26 +137,30 @@ class MessagesModelMessage extends JModelAdmin
catch (RuntimeException $e)
{
$this->setError($e->getMessage());
return false;
}
$this->item->set('user_id_to', $message->user_id_from);
$re = JText::_('COM_MESSAGES_RE');
if (stripos($message->subject, $re) !== 0)
{
$this->item->set('subject', $re.$message->subject);
$this->item->set('subject', $re . $message->subject);
}
}
}
elseif ($this->item->user_id_to != JFactory::getUser()->id)
{
$this->setError(JText::_('JERROR_ALERTNOAUTHOR'));
return false;
}
else {
else
{
// Mark message read
$db = $this->getDbo();
$query = $db->getQuery(true)
$db = $this->getDbo();
$query = $db->getQuery(true)
->update($db->quoteName('#__messages'))
->set($db->quoteName('state') . ' = 1')
->where($db->quoteName('message_id') . ' = ' . $this->item->message_id);
@ -163,21 +174,25 @@ class MessagesModelMessage extends JModelAdmin
$this->item->set('from_user_name', $fromUser->name);
}
}
return $this->item;
}
/**
* Method to get the record form.
*
* @param array $data Data for the form.
* @param boolean $loadData True if the form is to load its own data (default case), false if not.
* @return JForm A JForm object on success, false on failure
* @param array $data Data for the form.
* @param boolean $loadData True if the form is to load its own data (default case), false if not.
*
* @return JForm A JForm object on success, false on failure
*
* @since 1.6
*/
public function getForm($data = array(), $loadData = true)
{
// Get the form.
$form = $this->loadForm('com_messages.message', 'message', array('control' => 'jform', 'load_data' => $loadData));
if (empty($form))
{
return false;
@ -190,6 +205,7 @@ class MessagesModelMessage extends JModelAdmin
* Method to get the data that should be injected in the form.
*
* @return mixed The data for the form.
*
* @since 1.6
*/
protected function loadFormData()
@ -219,9 +235,9 @@ class MessagesModelMessage extends JModelAdmin
*/
public function publish(&$pks, $value = 1)
{
$user = JFactory::getUser();
$user = JFactory::getUser();
$table = $this->getTable();
$pks = (array) $pks;
$pks = (array) $pks;
// Check that the recipient matches the current user
foreach ($pks as $i => $pk)
@ -235,6 +251,7 @@ class MessagesModelMessage extends JModelAdmin
// Prune items that you can't change.
unset($pks[$i]);
JLog::add(JText::_('JLIB_APPLICATION_ERROR_EDITSTATE_NOT_PERMITTED'), JLog::WARNING, 'jerror');
return false;
}
}
@ -247,7 +264,7 @@ class MessagesModelMessage extends JModelAdmin
/**
* Method to save the form data.
*
* @param array The form data.
* @param array The form data.
*
* @return boolean True on success.
*/
@ -259,6 +276,7 @@ class MessagesModelMessage extends JModelAdmin
if (!$table->bind($data))
{
$this->setError($table->getError());
return false;
}
@ -276,16 +294,19 @@ class MessagesModelMessage extends JModelAdmin
if (!$table->check())
{
$this->setError($table->getError());
return false;
}
// Load the recipient user configuration.
$model = JModelLegacy::getInstance('Config', 'MessagesModel', array('ignore_request' => true));
$model = JModelLegacy::getInstance('Config', 'MessagesModel', array('ignore_request' => true));
$model->setState('user.id', $table->user_id_to);
$config = $model->getItem();
if (empty($config))
{
$this->setError($model->getError());
return false;
}
@ -299,24 +320,27 @@ class MessagesModelMessage extends JModelAdmin
if (!$table->store())
{
$this->setError($table->getError());
return false;
}
if ($config->get('mail_on_new', true))
{
// Load the user details (already valid from table check).
$fromUser = JUser::getInstance($table->user_id_from);
$toUser = JUser::getInstance($table->user_id_to);
$debug = JFactory::getConfig()->get('debug_lang');
$fromUser = JUser::getInstance($table->user_id_from);
$toUser = JUser::getInstance($table->user_id_to);
$debug = JFactory::getConfig()->get('debug_lang');
$default_language = JComponentHelper::getParams('com_languages')->get('administrator');
$lang = JLanguage::getInstance($toUser->getParam('admin_language', $default_language), $debug);
$lang = JLanguage::getInstance($toUser->getParam('admin_language', $default_language), $debug);
$lang->load('com_messages', JPATH_ADMINISTRATOR);
$siteURL = JUri::root() . 'administrator/index.php?option=com_messages&view=message&message_id='.$table->message_id;
$sitename = JFactory::getApplication()->getCfg('sitename');
// Build the email subject and message
$sitename = JFactory::getApplication()->get('sitename');
$siteURL = JUri::root() . 'administrator/index.php?option=com_messages&view=message&message_id=' . $table->message_id;
$subject = sprintf($lang->_('COM_MESSAGES_NEW_MESSAGE_ARRIVED'), $sitename);
$msg = sprintf($lang->_('COM_MESSAGES_PLEASE_LOGIN'), $siteURL);
$subject = sprintf($lang->_('COM_MESSAGES_NEW_MESSAGE_ARRIVED'), $sitename);
$msg = sprintf($lang->_('COM_MESSAGES_PLEASE_LOGIN'), $siteURL);
// Send the email
JFactory::getMailer()->sendMail($fromUser->email, $fromUser->name, $toUser->email, $subject, $msg);
}

View File

@ -84,7 +84,7 @@ class TagsModelTag extends JModelAdmin
/**
* Auto-populate the model state.
*
* Note. Calling getState in this method will result in recursion.
* @note Calling getState in this method will result in recursion.
*
* @return void
*
@ -142,7 +142,7 @@ class TagsModelTag extends JModelAdmin
$result->urls = $registry->toArray();
// Convert the created and modified dates to local user time for display in the form.
$tz = new DateTimeZone(JFactory::getApplication()->getCfg('offset'));
$tz = new DateTimeZone(JFactory::getApplication()->get('offset'));
if ((int) $result->created_time)
{
@ -260,10 +260,10 @@ class TagsModelTag extends JModelAdmin
public function save($data)
{
$dispatcher = JEventDispatcher::getInstance();
$table = $this->getTable();
$input = JFactory::getApplication()->input;
$pk = (!empty($data['id'])) ? $data['id'] : (int) $this->getState($this->getName() . '.id');
$isNew = true;
$table = $this->getTable();
$input = JFactory::getApplication()->input;
$pk = (!empty($data['id'])) ? $data['id'] : (int) $this->getState($this->getName() . '.id');
$isNew = true;
// Include the content plugins for the on save events.
JPluginHelper::importPlugin('content');
@ -299,8 +299,8 @@ class TagsModelTag extends JModelAdmin
if ($input->get('task') == 'save2copy')
{
list($title, $alias) = $this->generateNewTitle($data['parent_id'], $data['alias'], $data['title']);
$data['title'] = $title;
$data['alias'] = $alias;
$data['title'] = $title;
$data['alias'] = $alias;
}
// Bind the data.
@ -433,6 +433,7 @@ class TagsModelTag extends JModelAdmin
{
// Alter the title & alias
$table = $this->getTable();
while ($table->load(array('alias' => $alias, 'parent_id' => $parent_id)))
{
$title = ($table->title != $title) ? $title : JString::increment($title);

View File

@ -23,13 +23,16 @@ class UsersModelMail extends JModelAdmin
*
* @param array $data An optional array of data for the form to interogate.
* @param boolean $loadData True if the form is to load its own data (default case), false if not.
*
* @return JForm A JForm object on success, false on failure
*
* @since 1.6
*/
public function getForm($data = array(), $loadData = true)
{
// Get the form.
$form = $this->loadForm('com_users.mail', 'mail', array('control' => 'jform', 'load_data' => $loadData));
if (empty($form))
{
return false;
@ -42,6 +45,7 @@ class UsersModelMail extends JModelAdmin
* Method to get the data that should be injected in the form.
*
* @return mixed The data for the form.
*
* @since 1.6
*/
protected function loadFormData()
@ -59,7 +63,9 @@ class UsersModelMail extends JModelAdmin
*
* @param object A form object.
* @param mixed The data expected for the form.
*
* @throws Exception if there is an error in the form event.
*
* @since 1.6
*/
protected function preprocessForm(JForm $form, $data, $group = 'user')
@ -75,12 +81,12 @@ class UsersModelMail extends JModelAdmin
$access = new JAccess;
$db = $this->getDbo();
$mode = array_key_exists('mode', $data) ? (int) $data['mode'] : 0;
$subject = array_key_exists('subject', $data) ? $data['subject'] : '';
$grp = array_key_exists('group', $data) ? (int) $data['group'] : 0;
$recurse = array_key_exists('recurse', $data) ? (int) $data['recurse'] : 0;
$bcc = array_key_exists('bcc', $data) ? (int) $data['bcc'] : 0;
$disabled = array_key_exists('disabled', $data) ? (int) $data['disabled'] : 0;
$mode = array_key_exists('mode', $data) ? (int) $data['mode'] : 0;
$subject = array_key_exists('subject', $data) ? $data['subject'] : '';
$grp = array_key_exists('group', $data) ? (int) $data['group'] : 0;
$recurse = array_key_exists('recurse', $data) ? (int) $data['recurse'] : 0;
$bcc = array_key_exists('bcc', $data) ? (int) $data['bcc'] : 0;
$disabled = array_key_exists('disabled', $data) ? (int) $data['disabled'] : 0;
$message_body = array_key_exists('message', $data) ? $data['message'] : '';
// automatically removes html formatting
@ -94,6 +100,7 @@ class UsersModelMail extends JModelAdmin
{
$app->setUserState('com_users.display.mail.data', $data);
$this->setError(JText::_('COM_USERS_MAIL_PLEASE_FILL_IN_THE_FORM_CORRECTLY'));
return false;
}
@ -105,17 +112,21 @@ class UsersModelMail extends JModelAdmin
->select('email')
->from('#__users')
->where('id != '.(int) $user->get('id'));
if ($grp !== 0)
{
if (empty($to))
{
$query->where('0');
} else {
}
else
{
$query->where('id IN (' . implode(',', $to) . ')');
}
}
if ($disabled == 0){
if ($disabled == 0)
{
$query->where("block = 0");
}
@ -126,6 +137,7 @@ class UsersModelMail extends JModelAdmin
if (!count($rows))
{
$app->setUserState('com_users.display.mail.data', $data);
if (in_array($user->id, $to))
{
$this->setError(JText::_('COM_USERS_MAIL_ONLY_YOU_COULD_BE_FOUND_IN_THIS_GROUP'));
@ -134,6 +146,7 @@ class UsersModelMail extends JModelAdmin
{
$this->setError(JText::_('COM_USERS_MAIL_NO_USERS_COULD_BE_FOUND_IN_THIS_GROUP'));
}
return false;
}
@ -142,7 +155,7 @@ class UsersModelMail extends JModelAdmin
$params = JComponentHelper::getParams('com_users');
// Build email message format.
$mailer->setSender(array($app->getCfg('mailfrom'), $app->getCfg('fromname')));
$mailer->setSender(array($app->get('mailfrom'), $app->get('fromname')));
$mailer->setSubject($params->get('mailSubjectPrefix') . stripslashes($subject));
$mailer->setBody($message_body . $params->get('mailBodySuffix'));
$mailer->IsHTML($mode);
@ -151,7 +164,7 @@ class UsersModelMail extends JModelAdmin
if ($bcc)
{
$mailer->addBCC($rows);
$mailer->addRecipient($app->getCfg('mailfrom'));
$mailer->addRecipient($app->get('mailfrom'));
}
else
{
@ -159,18 +172,21 @@ class UsersModelMail extends JModelAdmin
}
// Send the Mail
$rs = $mailer->Send();
$rs = $mailer->Send();
// Check for an error
if ($rs instanceof Exception)
{
$app->setUserState('com_users.display.mail.data', $data);
$this->setError($rs->getError());
return false;
} elseif (empty($rs))
}
elseif (empty($rs))
{
$app->setUserState('com_users.display.mail.data', $data);
$this->setError(JText::_('COM_USERS_MAIL_THE_MAIL_COULD_NOT_BE_SENT'));
return false;
}
else
@ -178,14 +194,15 @@ class UsersModelMail extends JModelAdmin
// Fill the data (specially for the 'mode', 'group' and 'bcc': they could not exist in the array
// when the box is not checked and in this case, the default value would be used instead of the '0'
// one)
$data['mode'] = $mode;
$data['mode'] = $mode;
$data['subject'] = $subject;
$data['group'] = $grp;
$data['group'] = $grp;
$data['recurse'] = $recurse;
$data['bcc'] = $bcc;
$data['bcc'] = $bcc;
$data['message'] = $message_body;
$app->setUserState('com_users.display.mail.data', array());
$app->enqueueMessage(JText::plural('COM_USERS_MAIL_EMAIL_SENT_TO_N_USERS', count($rows)), 'message');
return true;
}
}

View File

@ -154,7 +154,7 @@ class UsersModelUsers extends JModelList
// Try to load the data from internal storage.
if (empty($this->cache[$store]))
{
$groups = $this->getState('filter.groups');
$groups = $this->getState('filter.groups');
$groupId = $this->getState('filter.group_id');
if (isset($groups) && (empty($groups) || $groupId && !in_array($groupId, $groups)))
@ -189,7 +189,7 @@ class UsersModelUsers extends JModelList
}
// Get the counts from the database only for the users in the list.
$db = $this->getDbo();
$db = $this->getDbo();
$query = $db->getQuery(true);
// Join over the group mapping table.
@ -269,7 +269,7 @@ class UsersModelUsers extends JModelList
protected function getListQuery()
{
// Create a new query object.
$db = $this->getDbo();
$db = $this->getDbo();
$query = $db->getQuery(true);
// Select the required fields from the table.
@ -307,7 +307,7 @@ class UsersModelUsers extends JModelList
// Filter the items over the group id if set.
$groupId = $this->getState('filter.group_id');
$groups = $this->getState('filter.groups');
$groups = $this->getState('filter.groups');
if ($groupId || isset($groups))
{
@ -332,7 +332,7 @@ class UsersModelUsers extends JModelList
$token = $db->quote('%' . $db->escape($this->getState('filter.search')) . '%');
// Compile the different search clauses.
$searches = array();
$searches = array();
$searches[] = 'a.name LIKE ' . $token;
$searches[] = 'a.username LIKE ' . $token;
$searches[] = 'a.email LIKE ' . $token;
@ -348,7 +348,7 @@ class UsersModelUsers extends JModelList
if ($range)
{
// Get UTC for now.
$dNow = new JDate;
$dNow = new JDate;
$dStart = clone $dNow;
switch ($range)
@ -376,8 +376,8 @@ class UsersModelUsers extends JModelList
case 'today':
// Ranges that need to align with local 'days' need special treatment.
$app = JFactory::getApplication();
$offset = $app->getCfg('offset');
$app = JFactory::getApplication();
$offset = $app->get('offset');
// Reset the start time to be the beginning of today, local time.
$dStart = new JDate('now', $offset);
@ -423,7 +423,7 @@ class UsersModelUsers extends JModelList
*
* @param integer $user_id User identifier
*
* @return string Groups titles imploded :$
* @return string Groups titles imploded :$
*/
function _getUserDisplayedGroups($user_id)
{

View File

@ -32,8 +32,7 @@ class ContactControllerContact extends JControllerForm
$id = (int) $stub;
// Get the data from POST
$data = $this->input->post->get('jform', array(), 'array');
$data = $this->input->post->get('jform', array(), 'array');
$contact = $model->getItem($id);
$params->merge($contact->params);
@ -57,7 +56,7 @@ class ContactControllerContact extends JControllerForm
// Contact plugins
JPluginHelper::importPlugin('contact');
$dispatcher = JEventDispatcher::getInstance();
$dispatcher = JEventDispatcher::getInstance();
// Validate the posted data.
$form = $model->getForm();
@ -99,7 +98,7 @@ class ContactControllerContact extends JControllerForm
}
// Validation succeeded, continue with custom handlers
$results = $dispatcher->trigger('onValidateContact', array(&$contact, &$data));
$results = $dispatcher->trigger('onValidateContact', array(&$contact, &$data));
foreach ($results as $result)
{
@ -148,22 +147,22 @@ class ContactControllerContact extends JControllerForm
private function _sendEmail($data, $contact, $copy_email_activated)
{
$app = JFactory::getApplication();
$app = JFactory::getApplication();
if ($contact->email_to == '' && $contact->user_id != 0)
{
$contact_user = JUser::getInstance($contact->user_id);
$contact_user = JUser::getInstance($contact->user_id);
$contact->email_to = $contact_user->get('email');
}
$mailfrom = $app->getCfg('mailfrom');
$fromname = $app->getCfg('fromname');
$sitename = $app->getCfg('sitename');
$mailfrom = $app->get('mailfrom');
$fromname = $app->get('fromname');
$sitename = $app->get('sitename');
$name = $data['contact_name'];
$email = JStringPunycode::emailToPunycode($data['contact_email']);
$subject = $data['contact_subject'];
$body = $data['contact_message'];
$name = $data['contact_name'];
$email = JStringPunycode::emailToPunycode($data['contact_email']);
$subject = $data['contact_subject'];
$body = $data['contact_message'];
// Prepare email body
$prefix = JText::sprintf('COM_CONTACT_ENQUIRY_TEXT', JUri::base());
@ -182,9 +181,9 @@ class ContactControllerContact extends JControllerForm
// Check whether email copy function activated
if ($copy_email_activated == true && !empty($data['contact_email_copy']))
{
$copytext = JText::sprintf('COM_CONTACT_COPYTEXT_OF', $contact->name, $sitename);
$copytext .= "\r\n\r\n" . $body;
$copysubject = JText::sprintf('COM_CONTACT_COPYSUBJECT_OF', $subject);
$copytext = JText::sprintf('COM_CONTACT_COPYTEXT_OF', $contact->name, $sitename);
$copytext .= "\r\n\r\n" . $body;
$copysubject = JText::sprintf('COM_CONTACT_COPYSUBJECT_OF', $subject);
$mail = JFactory::getMailer();
$mail->addRecipient($email);

View File

@ -220,11 +220,11 @@ class ContactModelCategory extends JModelList
$format = $app->input->getWord('format');
if ($format == 'feed')
{
$limit = $app->getCfg('feed_limit');
$limit = $app->get('feed_limit');
}
else
{
$limit = $app->getUserStateFromRequest('global.list.limit', 'limit', $app->getCfg('list_limit'), 'uint');
$limit = $app->getUserStateFromRequest('global.list.limit', 'limit', $app->get('list_limit'), 'uint');
}
$this->setState('list.limit', $limit);

View File

@ -176,7 +176,7 @@ class ContactModelFeatured extends JModelList
$params = JComponentHelper::getParams('com_contact');
// List state information
$limit = $app->getUserStateFromRequest('global.list.limit', 'limit', $app->getCfg('list_limit'), 'uint');
$limit = $app->getUserStateFromRequest('global.list.limit', 'limit', $app->get('list_limit'), 'uint');
$this->setState('list.limit', $limit);
$limitstart = $app->input->get('limitstart', 0, 'uint');

View File

@ -37,11 +37,11 @@ class ContactViewContact extends JViewLegacy
*/
public function display($tpl = null)
{
$app = JFactory::getApplication();
$user = JFactory::getUser();
$state = $this->get('State');
$item = $this->get('Item');
$this->form = $this->get('Form');
$app = JFactory::getApplication();
$user = JFactory::getUser();
$state = $this->get('State');
$item = $this->get('Item');
$this->form = $this->get('Form');
// Get the parameters
$params = JComponentHelper::getParams('com_contact');
@ -292,15 +292,15 @@ class ContactViewContact extends JViewLegacy
if (empty($title))
{
$title = $app->getCfg('sitename');
$title = $app->get('sitename');
}
elseif ($app->getCfg('sitename_pagetitles', 0) == 1)
elseif ($app->get('sitename_pagetitles', 0) == 1)
{
$title = JText::sprintf('JPAGETITLE', $app->getCfg('sitename'), $title);
$title = JText::sprintf('JPAGETITLE', $app->get('sitename'), $title);
}
elseif ($app->getCfg('sitename_pagetitles', 0) == 2)
elseif ($app->get('sitename_pagetitles', 0) == 2)
{
$title = JText::sprintf('JPAGETITLE', $title, $app->getCfg('sitename'));
$title = JText::sprintf('JPAGETITLE', $title, $app->get('sitename'));
}
if (empty($title))

View File

@ -35,16 +35,16 @@ class ContactViewFeatured extends JViewLegacy
*/
public function display($tpl = null)
{
$app = JFactory::getApplication();
$params = $app->getParams();
$app = JFactory::getApplication();
$params = $app->getParams();
// Get some data from the models
$state = $this->get('State');
$items = $this->get('Items');
$category = $this->get('Category');
$children = $this->get('Children');
$parent = $this->get('Parent');
$pagination = $this->get('Pagination');
$state = $this->get('State');
$items = $this->get('Items');
$category = $this->get('Category');
$children = $this->get('Children');
$parent = $this->get('Parent');
$pagination = $this->get('Pagination');
// Check for errors.
if (count($errors = $this->get('Errors')))
@ -57,9 +57,10 @@ class ContactViewFeatured extends JViewLegacy
// Compute the contact slug.
for ($i = 0, $n = count($items); $i < $n; $i++)
{
$item = &$items[$i];
$item->slug = $item->alias ? ($item->id.':'.$item->alias) : $item->id;
$temp = new JRegistry;
$item = &$items[$i];
$item->slug = $item->alias ? ($item->id . ':' . $item->alias) : $item->id;
$temp = new JRegistry;
$temp->loadString($item->params);
$item->params = clone($params);
$item->params->merge($temp);
@ -98,13 +99,14 @@ class ContactViewFeatured extends JViewLegacy
*/
protected function _prepareDocument()
{
$app = JFactory::getApplication();
$menus = $app->getMenu();
$title = null;
$app = JFactory::getApplication();
$menus = $app->getMenu();
$title = null;
// Because the application sets a default page title,
// we need to get it from the menu item itself
$menu = $menus->getActive();
if ($menu)
{
$this->params->def('page_heading', $this->params->get('page_title', $menu->title));
@ -115,18 +117,20 @@ class ContactViewFeatured extends JViewLegacy
}
$title = $this->params->get('page_title', '');
if (empty($title))
{
$title = $app->getCfg('sitename');
$title = $app->get('sitename');
}
elseif ($app->getCfg('sitename_pagetitles', 0) == 1)
elseif ($app->get('sitename_pagetitles', 0) == 1)
{
$title = JText::sprintf('JPAGETITLE', $app->getCfg('sitename'), $title);
$title = JText::sprintf('JPAGETITLE', $app->get('sitename'), $title);
}
elseif ($app->getCfg('sitename_pagetitles', 0) == 2)
elseif ($app->get('sitename_pagetitles', 0) == 2)
{
$title = JText::sprintf('JPAGETITLE', $title, $app->getCfg('sitename'));
$title = JText::sprintf('JPAGETITLE', $title, $app->get('sitename'));
}
$this->document->setTitle($title);
if ($this->params->get('menu-meta_description'))

View File

@ -76,7 +76,7 @@ class ContentModelArticles extends JModelList
$app = JFactory::getApplication();
// List state information
$value = $app->input->get('limit', $app->getCfg('list_limit', 0), 'uint');
$value = $app->input->get('limit', $app->get('list_limit', 0), 'uint');
$this->setState('list.limit', $value);
$value = $app->input->get('limitstart', 0, 'uint');

View File

@ -118,9 +118,9 @@ class ContentViewArchive extends JViewLegacy
*/
protected function _prepareDocument()
{
$app = JFactory::getApplication();
$menus = $app->getMenu();
$title = null;
$app = JFactory::getApplication();
$menus = $app->getMenu();
$title = null;
// Because the application sets a default page title,
// we need to get it from the menu item itself
@ -135,18 +135,20 @@ class ContentViewArchive extends JViewLegacy
}
$title = $this->params->get('page_title', '');
if (empty($title))
{
$title = $app->getCfg('sitename');
$title = $app->get('sitename');
}
elseif ($app->getCfg('sitename_pagetitles', 0) == 1)
elseif ($app->get('sitename_pagetitles', 0) == 1)
{
$title = JText::sprintf('JPAGETITLE', $app->getCfg('sitename'), $title);
$title = JText::sprintf('JPAGETITLE', $app->get('sitename'), $title);
}
elseif ($app->getCfg('sitename_pagetitles', 0) == 2)
elseif ($app->get('sitename_pagetitles', 0) == 2)
{
$title = JText::sprintf('JPAGETITLE', $title, $app->getCfg('sitename'));
$title = JText::sprintf('JPAGETITLE', $title, $app->get('sitename'));
}
$this->document->setTitle($title);
if ($this->params->get('menu-meta_description'))

View File

@ -238,15 +238,15 @@ class ContentViewArticle extends JViewLegacy
// Check for empty title and add site name if param is set
if (empty($title))
{
$title = $app->getCfg('sitename');
$title = $app->get('sitename');
}
elseif ($app->getCfg('sitename_pagetitles', 0) == 1)
elseif ($app->get('sitename_pagetitles', 0) == 1)
{
$title = JText::sprintf('JPAGETITLE', $app->getCfg('sitename'), $title);
$title = JText::sprintf('JPAGETITLE', $app->get('sitename'), $title);
}
elseif ($app->getCfg('sitename_pagetitles', 0) == 2)
elseif ($app->get('sitename_pagetitles', 0) == 2)
{
$title = JText::sprintf('JPAGETITLE', $title, $app->getCfg('sitename'));
$title = JText::sprintf('JPAGETITLE', $title, $app->get('sitename'));
}
if (empty($title))
@ -278,7 +278,7 @@ class ContentViewArticle extends JViewLegacy
$this->document->setMetadata('robots', $this->params->get('robots'));
}
if ($app->getCfg('MetaAuthor') == '1')
if ($app->get('MetaAuthor') == '1')
{
$this->document->setMetaData('author', $this->item->author);
}

View File

@ -31,13 +31,12 @@ class ContentViewFeatured extends JViewLegacy
$app = JFactory::getApplication();
$doc = JFactory::getDocument();
$params = $app->getParams();
$feedEmail = $app->getCfg('feed_email', 'author');
$siteEmail = $app->getCfg('mailfrom');
$doc->link = JRoute::_('index.php?option=com_content&view=featured');
$feedEmail = $app->get('feed_email', 'author');
$siteEmail = $app->get('mailfrom');
$doc->link = JRoute::_('index.php?option=com_content&view=featured');
// Get some data from the model
$app->input->set('limit', $app->getCfg('feed_limit'));
$app->input->set('limit', $app->get('feed_limit'));
$categories = JCategories::getInstance('Content');
$rows = $this->get('Items');
foreach ($rows as $row)
@ -71,14 +70,18 @@ class ContentViewFeatured extends JViewLegacy
$item->date = $row->publish_up;
$item->category = array();
$item->category[] = JText::_('JFEATURED'); // All featured articles are categorized as "Featured"
for ($item_category = $categories->get($row->catid); $item_category !== null; $item_category = $item_category->getParent())
{
if ($item_category->id > 1) { // Only add non-root categories
// Only add non-root categories
if ($item_category->id > 1)
{
$item->category[] = $item_category->title;
}
}
$item->author = $author;
$item->author = $author;
if ($feedEmail == 'site')
{
$item->authorEmail = $siteEmail;

View File

@ -155,13 +155,14 @@ class ContentViewFeatured extends JViewLegacy
*/
protected function _prepareDocument()
{
$app = JFactory::getApplication();
$menus = $app->getMenu();
$title = null;
$app = JFactory::getApplication();
$menus = $app->getMenu();
$title = null;
// Because the application sets a default page title,
// we need to get it from the menu item itself
$menu = $menus->getActive();
if ($menu)
{
$this->params->def('page_heading', $this->params->get('page_title', $menu->title));
@ -172,18 +173,20 @@ class ContentViewFeatured extends JViewLegacy
}
$title = $this->params->get('page_title', '');
if (empty($title))
{
$title = $app->getCfg('sitename');
$title = $app->get('sitename');
}
elseif ($app->getCfg('sitename_pagetitles', 0) == 1)
elseif ($app->get('sitename_pagetitles', 0) == 1)
{
$title = JText::sprintf('JPAGETITLE', $app->getCfg('sitename'), $title);
$title = JText::sprintf('JPAGETITLE', $app->get('sitename'), $title);
}
elseif ($app->getCfg('sitename_pagetitles', 0) == 2)
elseif ($app->get('sitename_pagetitles', 0) == 2)
{
$title = JText::sprintf('JPAGETITLE', $title, $app->getCfg('sitename'));
$title = JText::sprintf('JPAGETITLE', $title, $app->get('sitename'));
}
$this->document->setTitle($title);
if ($this->params->get('menu-meta_description'))
@ -204,7 +207,7 @@ class ContentViewFeatured extends JViewLegacy
// Add feed links
if ($this->params->get('show_feed_link', 1))
{
$link = '&format=feed&limitstart=';
$link = '&format=feed&limitstart=';
$attribs = array('type' => 'application/rss+xml', 'title' => 'RSS 2.0');
$this->document->addHeadLink(JRoute::_($link . '&type=rss'), 'alternate', 'rel', $attribs);
$attribs = array('type' => 'application/atom+xml', 'title' => 'Atom 1.0');

View File

@ -129,14 +129,15 @@ class ContentViewForm extends JViewLegacy
$title = $this->params->def('page_title', JText::_('COM_CONTENT_FORM_EDIT_ARTICLE'));
if ($app->getCfg('sitename_pagetitles', 0) == 1)
if ($app->get('sitename_pagetitles', 0) == 1)
{
$title = JText::sprintf('JPAGETITLE', $app->getCfg('sitename'), $title);
$title = JText::sprintf('JPAGETITLE', $app->get('sitename'), $title);
}
elseif ($app->getCfg('sitename_pagetitles', 0) == 2)
elseif ($app->get('sitename_pagetitles', 0) == 2)
{
$title = JText::sprintf('JPAGETITLE', $title, $app->getCfg('sitename'));
$title = JText::sprintf('JPAGETITLE', $title, $app->get('sitename'));
}
$this->document->setTitle($title);
$pathway = $app->getPathWay();

View File

@ -1125,7 +1125,7 @@ class FinderModelSearch extends JModelList
// Load the list state.
$this->setState('list.start', $input->get('limitstart', 0, 'uint'));
$this->setState('list.limit', $input->get('limit', $app->getCfg('list_limit', 20), 'uint'));
$this->setState('list.limit', $input->get('limit', $app->get('list_limit', 20), 'uint'));
// Load the sort ordering.
$order = $params->get('sort_order', 'relevance');

View File

@ -33,7 +33,7 @@ class FinderViewSearch extends JViewLegacy
$app = JFactory::getApplication();
// Adjust the list limit to the feed limit.
$app->input->set('limit', $app->getCfg('feed_limit'));
$app->input->set('limit', $app->get('feed_limit'));
// Get view data.
$state = $this->get('State');
@ -50,15 +50,15 @@ class FinderViewSearch extends JViewLegacy
if (empty($title))
{
$title = $app->getCfg('sitename');
$title = $app->get('sitename');
}
elseif ($app->getCfg('sitename_pagetitles', 0) == 1)
elseif ($app->get('sitename_pagetitles', 0) == 1)
{
$title = JText::sprintf('JPAGETITLE', $app->getCfg('sitename'), $title);
$title = JText::sprintf('JPAGETITLE', $app->get('sitename'), $title);
}
elseif ($app->getCfg('sitename_pagetitles', 0) == 2)
elseif ($app->get('sitename_pagetitles', 0) == 2)
{
$title = JText::sprintf('JPAGETITLE', $title, $app->getCfg('sitename'));
$title = JText::sprintf('JPAGETITLE', $title, $app->get('sitename'));
}
$this->document->setTitle($title);
@ -82,11 +82,11 @@ class FinderViewSearch extends JViewLegacy
foreach ($results as $result)
{
// Convert the result to a feed entry.
$item = new JFeedItem;
$item->title = $result->title;
$item->link = JRoute::_($result->route);
$item = new JFeedItem;
$item->title = $result->title;
$item->link = JRoute::_($result->route);
$item->description = $result->description;
$item->date = (int) $result->start_date ? JHtml::date($result->start_date, 'l d F Y') : $result->indexdate;
$item->date = (int) $result->start_date ? JHtml::date($result->start_date, 'l d F Y') : $result->indexdate;
// Get the taxonomy data.
$taxonomy = $result->getTaxonomy();
@ -94,7 +94,7 @@ class FinderViewSearch extends JViewLegacy
// Add the category to the feed if available.
if (isset($taxonomy['Category']))
{
$node = array_pop($taxonomy['Category']);
$node = array_pop($taxonomy['Category']);
$item->category = $node->title;
}

View File

@ -203,15 +203,15 @@ class FinderViewSearch extends JViewLegacy
if (empty($title))
{
$title = $app->getCfg('sitename');
$title = $app->get('sitename');
}
elseif ($app->getCfg('sitename_pagetitles', 0) == 1)
elseif ($app->get('sitename_pagetitles', 0) == 1)
{
$title = JText::sprintf('JPAGETITLE', $app->getCfg('sitename'), $title);
$title = JText::sprintf('JPAGETITLE', $app->get('sitename'), $title);
}
elseif ($app->getCfg('sitename_pagetitles', 0) == 2)
elseif ($app->get('sitename_pagetitles', 0) == 2)
{
$title = JText::sprintf('JPAGETITLE', $title, $app->getCfg('sitename'));
$title = JText::sprintf('JPAGETITLE', $title, $app->get('sitename'));
}
$this->document->setTitle($title);

View File

@ -33,21 +33,22 @@ class FinderViewSearch extends JViewLegacy
$app = JFactory::getApplication();
$params = JComponentHelper::getParams('com_finder');
$doc->setShortName($params->get('opensearch_name', $app->getCfg('sitename')));
$doc->setDescription($params->get('opensearch_description', $app->getCfg('MetaDesc')));
$doc->setShortName($params->get('opensearch_name', $app->get('sitename')));
$doc->setDescription($params->get('opensearch_description', $app->get('MetaDesc')));
// Add the URL for the search
$searchUri = JUri::base() . 'index.php?option=com_finder&q={searchTerms}';
// Find the menu item for the search
$menu = $app->getMenu();
$menu = $app->getMenu();
$items = $menu->getItems('link', 'index.php?option=com_finder&view=search');
if (isset($items[0]))
{
$searchUri .= '&Itemid=' . $items[0]->id;
}
$htmlSearch = new JOpenSearchUrl;
$htmlSearch = new JOpenSearchUrl;
$htmlSearch->template = JRoute::_($searchUri);
$doc->addUrl($htmlSearch);
}

View File

@ -20,6 +20,7 @@ class MailtoController extends JControllerLegacy
* Show the form so that the user can send the link to someone
*
* @access public
*
* @since 1.5
*/
public function mailto()
@ -43,32 +44,35 @@ class MailtoController extends JControllerLegacy
$app = JFactory::getApplication();
$session = JFactory::getSession();
$timeout = $session->get('com_mailto.formtime', 0);
if ($timeout == 0 || time() - $timeout < 20)
{
JError::raiseNotice(500, JText::_('COM_MAILTO_EMAIL_NOT_SENT'));
return $this->mailto();
}
$SiteName = $app->getCfg('sitename');
$SiteName = $app->get('sitename');
$link = MailtoHelper::validateHash($this->input->get('link', '', 'post'));
// Verify that this is a local link
if (!$link || !JUri::isInternal($link))
{
//Non-local url...
// Non-local url...
JError::raiseNotice(500, JText::_('COM_MAILTO_EMAIL_NOT_SENT'));
return $this->mailto();
}
// An array of email headers we do not want to allow as input
$headers = array ( 'Content-Type:',
'MIME-Version:',
'Content-Transfer-Encoding:',
'bcc:',
'cc:');
$headers = array (
'Content-Type:',
'MIME-Version:',
'Content-Transfer-Encoding:',
'bcc:',
'cc:'
);
// An array of the input fields to scan for injected headers
$fields = array(
@ -106,17 +110,17 @@ class MailtoController extends JControllerLegacy
$subject = $this->input->post->getString('subject', $subject_default);
// Check for a valid to address
$error = false;
$error = false;
if (! $email || ! JMailHelper::isEmailAddress($email))
{
$error = JText::sprintf('COM_MAILTO_EMAIL_INVALID', $email);
$error = JText::sprintf('COM_MAILTO_EMAIL_INVALID', $email);
JError::raiseWarning(0, $error);
}
// Check for a valid from address
if (! $from || ! JMailHelper::isEmailAddress($from))
{
$error = JText::sprintf('COM_MAILTO_EMAIL_INVALID', $from);
$error = JText::sprintf('COM_MAILTO_EMAIL_INVALID', $from);
JError::raiseWarning(0, $error);
}
@ -126,14 +130,13 @@ class MailtoController extends JControllerLegacy
}
// Build the message to send
$msg = JText::_('COM_MAILTO_EMAIL_MSG');
$msg = JText::_('COM_MAILTO_EMAIL_MSG');
$link = $link;
$body = sprintf($msg, $SiteName, $sender, $from, $link);
$body = sprintf($msg, $SiteName, $sender, $from, $link);
// Clean the email data
$subject = JMailHelper::cleanSubject($subject);
$body = JMailHelper::cleanBody($body);
$body = JMailHelper::cleanBody($body);
// To send we need to use punycode.
$from = JStringPunycode::emailToPunycode($from);
@ -144,6 +147,7 @@ class MailtoController extends JControllerLegacy
if (JFactory::getMailer()->sendMail($from, $sender, $email, $subject, $body) !== true)
{
JError::raiseNotice(500, JText::_('COM_MAILTO_EMAIL_NOT_SENT'));
return $this->mailto();
}

View File

@ -179,7 +179,7 @@ class NewsfeedsModelCategory extends JModelList
$params = JComponentHelper::getParams('com_newsfeeds');
// List state information
$limit = $app->getUserStateFromRequest('global.list.limit', 'limit', $app->getCfg('list_limit'), 'uint');
$limit = $app->getUserStateFromRequest('global.list.limit', 'limit', $app->get('list_limit'), 'uint');
$this->setState('list.limit', $limit);
$limitstart = $app->input->get('limitstart', 0, 'uint');
@ -320,6 +320,7 @@ class NewsfeedsModelCategory extends JModelList
{
$this->getCategory();
}
return $this->_children;
}
@ -332,13 +333,12 @@ class NewsfeedsModelCategory extends JModelList
*/
public function hit($pk = 0)
{
$input = JFactory::getApplication()->input;
$input = JFactory::getApplication()->input;
$hitcount = $input->getInt('hitcount', 1);
if ($hitcount)
{
$pk = (!empty($pk)) ? $pk : (int) $this->getState('category.id');
$pk = (!empty($pk)) ? $pk : (int) $this->getState('category.id');
$table = JTable::getInstance('Category', 'JTable');
$table->load($pk);
$table->hit($pk);

View File

@ -19,19 +19,19 @@ defined('_JEXEC') or die;
class NewsfeedsViewNewsfeed extends JViewLegacy
{
/**
* @var object
* @var object
* @since 1.6
*/
protected $state;
/**
* @var object
* @var object
* @since 1.6
*/
protected $item;
/**
* @var boolean
* @var boolean
* @since 1.6
*/
protected $print;
@ -47,15 +47,15 @@ class NewsfeedsViewNewsfeed extends JViewLegacy
*/
public function display($tpl = null)
{
$app = JFactory::getApplication();
$user = JFactory::getUser();
$app = JFactory::getApplication();
$user = JFactory::getUser();
// Get view related request variables.
$print = $app->input->getBool('print');
// Get model data.
$state = $this->get('State');
$item = $this->get('Item');
$item = $this->get('Item');
if ($item)
{
@ -64,12 +64,13 @@ class NewsfeedsViewNewsfeed extends JViewLegacy
$categoryModel->setState('category.id', $item->catid);
$categoryModel->setState('list.ordering', 'a.name');
$categoryModel->setState('list.direction', 'asc');
// TODO: $items is not used. Remove this line?
// @TODO: $items is not used. Remove this line?
$items = $categoryModel->getItems();
}
// Check for errors.
// @TODO Maybe this could go into JComponentHelper::raiseErrors($this->get('Errors'))
// @TODO: Maybe this could go into JComponentHelper::raiseErrors($this->get('Errors'))
if (count($errors = $this->get('Errors')))
{
JError::raiseWarning(500, implode("\n", $errors));
@ -102,6 +103,7 @@ class NewsfeedsViewNewsfeed extends JViewLegacy
if ($active)
{
$currentLink = $active->link;
// If the current view is the active item and an newsfeed view for this feed, then the menu item params take priority
if (strpos($currentLink, 'view=newsfeed') && (strpos($currentLink, '&id='.(string) $item->id)))
{
@ -109,6 +111,7 @@ class NewsfeedsViewNewsfeed extends JViewLegacy
// Merge so that the menu item params take priority
$newsfeed_params->merge($temp);
$item->params = $newsfeed_params;
// Load layout from active query (in case it is an alternative menu item)
if (isset($active->query['layout']))
{
@ -121,6 +124,7 @@ class NewsfeedsViewNewsfeed extends JViewLegacy
// Merge the menu item params with the newsfeed params so that the newsfeed params take priority
$temp->merge($newsfeed_params);
$item->params = $temp;
// Check for alternative layouts (since we are not in a single-newsfeed menu item)
if ($layout = $item->params->get('newsfeed_layout'))
{
@ -133,6 +137,7 @@ class NewsfeedsViewNewsfeed extends JViewLegacy
// Merge so that newsfeed params take priority
$temp->merge($newsfeed_params);
$item->params = $temp;
// Check for alternative layouts (since we are not in a single-newsfeed menu item)
if ($layout = $item->params->get('newsfeed_layout'))
{
@ -150,7 +155,7 @@ class NewsfeedsViewNewsfeed extends JViewLegacy
}
// Get the current menu item
$params = $app->getParams();
$params = $app->getParams();
// Get the newsfeed
$newsfeed = $item;
@ -264,15 +269,15 @@ class NewsfeedsViewNewsfeed extends JViewLegacy
if (empty($title))
{
$title = $app->getCfg('sitename');
$title = $app->get('sitename');
}
elseif ($app->getCfg('sitename_pagetitles', 0) == 1)
elseif ($app->get('sitename_pagetitles', 0) == 1)
{
$title = JText::sprintf('JPAGETITLE', $app->getCfg('sitename'), $title);
$title = JText::sprintf('JPAGETITLE', $app->get('sitename'), $title);
}
elseif ($app->getCfg('sitename_pagetitles', 0) == 2)
elseif ($app->get('sitename_pagetitles', 0) == 2)
{
$title = JText::sprintf('JPAGETITLE', $title, $app->getCfg('sitename'));
$title = JText::sprintf('JPAGETITLE', $title, $app->get('sitename'));
}
if (empty($title))
{
@ -303,12 +308,12 @@ class NewsfeedsViewNewsfeed extends JViewLegacy
$this->document->setMetadata('robots', $this->params->get('robots'));
}
if ($app->getCfg('MetaTitle') == '1')
if ($app->get('MetaTitle') == '1')
{
$this->document->setMetaData('title', $this->item->name);
}
if ($app->getCfg('MetaAuthor') == '1')
if ($app->get('MetaAuthor') == '1')
{
$this->document->setMetaData('author', $this->item->author);
}

View File

@ -31,7 +31,6 @@ class SearchViewSearch extends JViewLegacy
$app = JFactory::getApplication();
$uri = JUri::getInstance();
$error = null;
$rows = null;
$results = null;
@ -64,13 +63,13 @@ class SearchViewSearch extends JViewLegacy
$title = $params->get('page_title');
if ($app->getCfg('sitename_pagetitles', 0) == 1)
if ($app->get('sitename_pagetitles', 0) == 1)
{
$title = JText::sprintf('JPAGETITLE', $app->getCfg('sitename'), $title);
$title = JText::sprintf('JPAGETITLE', $app->get('sitename'), $title);
}
elseif ($app->getCfg('sitename_pagetitles', 0) == 2)
elseif ($app->get('sitename_pagetitles', 0) == 2)
{
$title = JText::sprintf('JPAGETITLE', $title, $app->getCfg('sitename'));
$title = JText::sprintf('JPAGETITLE', $title, $app->get('sitename'));
}
$this->document->setTitle($title);

View File

@ -24,21 +24,22 @@ class SearchViewSearch extends JViewLegacy
$app = JFactory::getApplication();
$params = JComponentHelper::getParams('com_search');
$doc->setShortName($params->get('opensearch_name', $app->getCfg('sitename')));
$doc->setDescription($params->get('opensearch_description', $app->getCfg('MetaDesc')));
$doc->setShortName($params->get('opensearch_name', $app->get('sitename')));
$doc->setDescription($params->get('opensearch_description', $app->get('MetaDesc')));
// Add the URL for the search
$searchUri = JUri::base().'index.php?option=com_search&searchword={searchTerms}';
$searchUri = JUri::base() . 'index.php?option=com_search&searchword={searchTerms}';
// Find the menu item for the search
$menu = $app->getMenu();
$items = $menu->getItems('link', 'index.php?option=com_search&view=search');
$menu = $app->getMenu();
$items = $menu->getItems('link', 'index.php?option=com_search&view=search');
if (isset($items[0]))
{
$searchUri .= '&Itemid='.$items[0]->id;
$searchUri .= '&Itemid=' . $items[0]->id;
}
$htmlSearch = new JOpenSearchUrl;
$htmlSearch = new JOpenSearchUrl;
$htmlSearch->template = JRoute::_($searchUri);
$doc->addUrl($htmlSearch);
}

View File

@ -206,13 +206,13 @@ class TagsModelTag extends JModelList
if ($format == 'feed')
{
$limit = $app->getCfg('feed_limit');
$limit = $app->get('feed_limit');
}
else
{
if ($this->state->params->get('show_pagination_limit'))
{
$limit = $app->getUserStateFromRequest('global.list.limit', 'limit', $app->getCfg('list_limit'), 'uint');
$limit = $app->getUserStateFromRequest('global.list.limit', 'limit', $app->get('list_limit'), 'uint');
}
else
{
@ -318,13 +318,12 @@ class TagsModelTag extends JModelList
*/
public function hit($pk = 0)
{
$input = JFactory::getApplication()->input;
$input = JFactory::getApplication()->input;
$hitcount = $input->getInt('hitcount', 1);
if ($hitcount)
{
$pk = (!empty($pk)) ? $pk : (int) $this->getState('tag.id');
$pk = (!empty($pk)) ? $pk : (int) $this->getState('tag.id');
$table = JTable::getInstance('Tag', 'TagsTable');
$table->load($pk);
$table->hit($pk);

View File

@ -29,7 +29,7 @@ class TagsModelTags extends JModelList
/**
* Method to auto-populate the model state.
*
* Note. Calling getState in this method will result in recursion.
* @note Calling getState in this method will result in recursion.
*
* @param string $ordering An optional ordering field.
* @param string $direction An optional direction (asc|desc).
@ -151,21 +151,23 @@ class TagsModelTags extends JModelList
// List state information
$format = $app->input->getWord('format');
if ($format == 'feed')
{
$limit = $app->getCfg('feed_limit');
$limit = $app->get('feed_limit');
}
else
{
if ($this->state->params->get('show_pagination_limit'))
{
$limit = $app->getUserStateFromRequest('global.list.limit', 'limit', $app->getCfg('list_limit'), 'uint');
$limit = $app->getUserStateFromRequest('global.list.limit', 'limit', $app->get('list_limit'), 'uint');
}
else
{
$limit = $this->state->params->get('maximum', 20);
}
}
$this->setState('list.limit', $limit);
$offset = $app->input->get('limitstart', 0, 'uint');
@ -177,7 +179,7 @@ class TagsModelTags extends JModelList
$query->where($db->quoteName('a.title') . ' LIKE ' . $db->quote('%' . $this->state->get('list.filter') . '%'));
}
$query->where($db->quoteName('a.published'). ' = ' . $published);
$query->where($db->quoteName('a.published') . ' = ' . $published);
$query->order($db->quoteName($orderby) . ' ' . $orderDirection . ', a.title ASC');

View File

@ -27,14 +27,14 @@ class TagsViewTag extends JViewLegacy
*/
public function display($tpl = null)
{
$app = JFactory::getApplication();
$document = JFactory::getDocument();
$app = JFactory::getApplication();
$document = JFactory::getDocument();
$document->link = JRoute::_(TagsHelperRoute::getTagRoute($app->input->getInt('id')));
$app->input->set('limit', $app->getCfg('feed_limit'));
$siteEmail = $app->getCfg('mailfrom');
$fromName = $app->getCfg('fromname');
$feedEmail = $app->getCfg('feed_email', 'author');
$app->input->set('limit', $app->get('feed_limit'));
$siteEmail = $app->get('mailfrom');
$fromName = $app->get('fromname');
$feedEmail = $app->get('feed_email', 'author');
$document->editor = $fromName;
if ($feedEmail != "none")
{
@ -55,11 +55,11 @@ class TagsViewTag extends JViewLegacy
// Strip HTML from feed item description text
$description = $item->core_body;
$author = $item->core_created_by_alias ? $item->core_created_by_alias : $item->author;
$date = ($item->displayDate ? date('r', strtotime($item->displayDate)) : '');
$author = $item->core_created_by_alias ? $item->core_created_by_alias : $item->author;
$date = ($item->displayDate ? date('r', strtotime($item->displayDate)) : '');
// Load individual item creator class
$feeditem = new JFeedItem;
$feeditem = new JFeedItem;
$feeditem->title = $title;
$feeditem->link = $link;
$feeditem->description = $description;

View File

@ -41,16 +41,16 @@ class TagsViewTag extends JViewLegacy
*/
public function display($tpl = null)
{
$app = JFactory::getApplication();
$params = $app->getParams();
$app = JFactory::getApplication();
$params = $app->getParams();
// Get some data from the models
$state = $this->get('State');
$items = $this->get('Items');
$item = $this->get('Item');
$children = $this->get('Children');
$parent = $this->get('Parent');
$pagination = $this->get('Pagination');
$state = $this->get('State');
$items = $this->get('Items');
$item = $this->get('Item');
$children = $this->get('Children');
$parent = $this->get('Parent');
$pagination = $this->get('Pagination');
// Change to catch
/*if (count($errors = $this->get('Errors'))) {
@ -59,9 +59,9 @@ class TagsViewTag extends JViewLegacy
}*/
// Check whether access level allows access.
// TODO: SHould already be computed in $item->params->get('access-view')
$user = JFactory::getUser();
$groups = $user->getAuthorisedViewLevels();
// @TODO: Should already be computed in $item->params->get('access-view')
$user = JFactory::getUser();
$groups = $user->getAuthorisedViewLevels();
foreach ($item as $itemElement)
{
if (!in_array($itemElement->access, $groups))
@ -124,20 +124,22 @@ class TagsViewTag extends JViewLegacy
// Merge tag params. If this is single-tag view, menu params override tag params
// Otherwise, article params override menu item params
$this->params = $this->state->get('params');
$active = $app->getMenu()->getActive();
$temp = clone ($this->params);
$this->params = $this->state->get('params');
$active = $app->getMenu()->getActive();
$temp = clone ($this->params);
// Check to see which parameters should take priority
if ($active)
{
$currentLink = $active->link;
// If the current view is the active item and an tag view for one tag, then the menu item params take priority
if (strpos($currentLink, 'view=tag') && (strpos($currentLink, '&id[0]='.(string) $item[0]->id)))
{
// $item->params are the article params, $temp are the menu item params
// Merge so that the menu item params take priority
$this->params->merge($temp);
// Load layout from active query (in case it is an alternative menu item)
if (isset($active->query['layout'])) {
$this->setLayout($active->query['layout']);
@ -163,6 +165,7 @@ class TagsViewTag extends JViewLegacy
// Merge so that item params take priority
$temp->merge($item[0]->params);
$item[0]->params = $temp;
// Check for alternative layouts (since we are not in a single-tag menu item)
// Single-tag menu item layout takes priority over alt layout for an article
if ($layout = $item[0]->params->get('tag_layout'))
@ -185,9 +188,9 @@ class TagsViewTag extends JViewLegacy
*/
protected function _prepareDocument()
{
$app = JFactory::getApplication();
$menus = $app->getMenu();
$title = null;
$app = JFactory::getApplication();
$menus = $app->getMenu();
$title = null;
// Because the application sets a default page title,
// we need to get it from the menu item itself
@ -211,15 +214,15 @@ class TagsViewTag extends JViewLegacy
if (empty($title))
{
$title = $app->getCfg('sitename');
$title = $app->get('sitename');
}
elseif ($app->getCfg('sitename_pagetitles', 0) == 1)
elseif ($app->get('sitename_pagetitles', 0) == 1)
{
$title = JText::sprintf('JPAGETITLE', $app->getCfg('sitename'), $title);
$title = JText::sprintf('JPAGETITLE', $app->get('sitename'), $title);
}
elseif ($app->getCfg('sitename_pagetitles', 0) == 2)
elseif ($app->get('sitename_pagetitles', 0) == 2)
{
$title = JText::sprintf('JPAGETITLE', $title, $app->getCfg('sitename'));
$title = JText::sprintf('JPAGETITLE', $title, $app->get('sitename'));
}
$this->document->setTitle($title);
@ -249,23 +252,23 @@ class TagsViewTag extends JViewLegacy
$this->document->setMetadata('robots', $this->params->get('robots'));
}
if ($app->getCfg('MetaAuthor') == '1')
if ($app->get('MetaAuthor') == '1')
{
$this->document->setMetaData('author', $itemElement->created_user_id);
}
}
// TODO create tag feed document
// @TODO: create tag feed document
// Add alternative feed link
if ($this->params->get('show_feed_link', 1) == 1)
{
$link = '&format=feed&limitstart=';
$link = '&format=feed&limitstart=';
$attribs = array('type' => 'application/rss+xml', 'title' => 'RSS 2.0');
$this->document->addHeadLink(JRoute::_($link.'&type=rss'), 'alternate', 'rel', $attribs);
$this->document->addHeadLink(JRoute::_($link . '&type=rss'), 'alternate', 'rel', $attribs);
$attribs = array('type' => 'application/atom+xml', 'title' => 'Atom 1.0');
$this->document->addHeadLink(JRoute::_($link.'&type=atom'), 'alternate', 'rel', $attribs);
$this->document->addHeadLink(JRoute::_($link . '&type=atom'), 'alternate', 'rel', $attribs);
}
}
}

View File

@ -27,22 +27,24 @@ class TagsViewTags extends JViewLegacy
*/
public function display($tpl = null)
{
$app = JFactory::getApplication();
$document = JFactory::getDocument();
$app = JFactory::getApplication();
$document = JFactory::getDocument();
$document->link = JRoute::_('index.php?option=com_tags&view=tags');
$app->input->set('limit', $app->getCfg('feed_limit'));
$siteEmail = $app->getCfg('mailfrom');
$fromName = $app->getCfg('fromname');
$feedEmail = $app->getCfg('feed_email', 'author');
$app->input->set('limit', $app->get('feed_limit'));
$siteEmail = $app->get('mailfrom');
$fromName = $app->get('fromname');
$feedEmail = $app->get('feed_email', 'author');
$document->editor = $fromName;
if ($feedEmail != "none")
{
$document->editorEmail = $siteEmail;
}
// Get some data from the model
$items = $this->get('Items');
$items = $this->get('Items');
foreach ($items as $item)
{
// Strip HTML from feed item title
@ -51,8 +53,8 @@ class TagsViewTags extends JViewLegacy
// Strip HTML from feed item description text
$description = $item->description;
$author = $item->created_by_alias ? $item->created_by_alias : $item->author;
$date = ($item->displayDate ? date('r', strtotime($item->displayDate)) : '');
$author = $item->created_by_alias ? $item->created_by_alias : $item->author;
$date = ($item->displayDate ? date('r', strtotime($item->displayDate)) : '');
// Load individual item creator class
$feeditem = new JFeedItem;

View File

@ -33,7 +33,7 @@ class TagsViewTags extends JViewLegacy
*
* @param string $tpl The name of the template file to parse; automatically searches through the template paths.
*
* @return mixed A string if successful, otherwise a Error object.
* @return mixed A string if successful, otherwise a Error object.
*/
public function display($tpl = null)
{
@ -142,9 +142,9 @@ class TagsViewTags extends JViewLegacy
*/
protected function _prepareDocument()
{
$app = JFactory::getApplication();
$menus = $app->getMenu();
$title = null;
$app = JFactory::getApplication();
$menus = $app->getMenu();
$title = null;
// Because the application sets a default page title,
// we need to get it from the menu item itself
@ -166,6 +166,7 @@ class TagsViewTags extends JViewLegacy
// If this is not a single tag menu item, set the page title to the tag titles
$title = '';
if (!empty($this->item))
{
foreach ($this->item as $i => $itemElement)
@ -182,15 +183,15 @@ class TagsViewTags extends JViewLegacy
if (empty($title))
{
$title = $app->getCfg('sitename');
$title = $app->get('sitename');
}
elseif ($app->getCfg('sitename_pagetitles', 0) == 1)
elseif ($app->get('sitename_pagetitles', 0) == 1)
{
$title = JText::sprintf('JPAGETITLE', $app->getCfg('sitename'), $title);
$title = JText::sprintf('JPAGETITLE', $app->get('sitename'), $title);
}
elseif ($app->getCfg('sitename_pagetitles', 0) == 2)
elseif ($app->get('sitename_pagetitles', 0) == 2)
{
$title = JText::sprintf('JPAGETITLE', $title, $app->getCfg('sitename'));
$title = JText::sprintf('JPAGETITLE', $title, $app->get('sitename'));
}
$this->document->setTitle($title);
@ -220,12 +221,13 @@ class TagsViewTags extends JViewLegacy
$this->document->setMetadata('robots', $this->params->get('robots'));
}
if ($app->getCfg('MetaAuthor') == '1')
if ($app->get('MetaAuthor') == '1')
{
$this->document->setMetaData('author', $itemElement->created_user_id);
}
$mdata = $this->item->metadata->toArray();
foreach ($mdata as $k => $v)
{
if ($v)
@ -239,11 +241,11 @@ class TagsViewTags extends JViewLegacy
// Add alternative feed link
if ($this->params->get('show_feed_link', 1) == 1)
{
$link = '&format=feed&limitstart=';
$link = '&format=feed&limitstart=';
$attribs = array('type' => 'application/rss+xml', 'title' => 'RSS 2.0');
$this->document->addHeadLink(JRoute::_($link.'&type=rss'), 'alternate', 'rel', $attribs);
$this->document->addHeadLink(JRoute::_($link . '&type=rss'), 'alternate', 'rel', $attribs);
$attribs = array('type' => 'application/atom+xml', 'title' => 'Atom 1.0');
$this->document->addHeadLink(JRoute::_($link.'&type=atom'), 'alternate', 'rel', $attribs);
$this->document->addHeadLink(JRoute::_($link . '&type=atom'), 'alternate', 'rel', $attribs);
}
}

View File

@ -41,7 +41,7 @@ class UsersControllerReset extends UsersController
if ($return instanceof Exception)
{
// Get the error message to display.
if ($app->getCfg('error_reporting'))
if ($app->get('error_reporting'))
{
$message = $return->getMessage();
}
@ -108,7 +108,7 @@ class UsersControllerReset extends UsersController
if ($return instanceof Exception)
{
// Get the error message to display.
if ($app->getCfg('error_reporting'))
if ($app->get('error_reporting'))
{
$message = $return->getMessage();
}
@ -174,7 +174,7 @@ class UsersControllerReset extends UsersController
if ($return instanceof Exception)
{
// Get the error message to display.
if ($app->getCfg('error_reporting'))
if ($app->get('error_reporting'))
{
$message = $return->getMessage();
}
@ -190,6 +190,7 @@ class UsersControllerReset extends UsersController
// Go back to the complete form.
$this->setRedirect(JRoute::_($route, false), $message, 'error');
return false;
}
elseif ($return === false)
@ -203,6 +204,7 @@ class UsersControllerReset extends UsersController
// Go back to the complete form.
$message = JText::sprintf('COM_USERS_RESET_COMPLETE_FAILED', $model->getError());
$this->setRedirect(JRoute::_($route, false), $message, 'notice');
return false;
}
else
@ -211,11 +213,12 @@ class UsersControllerReset extends UsersController
// Get the route to the next page.
$itemid = UsersHelperRoute::getLoginRoute();
$itemid = $itemid !== null ? '&Itemid=' . $itemid : '';
$route = 'index.php?option=com_users&view=login' . $itemid;
$route = 'index.php?option=com_users&view=login' . $itemid;
// Proceed to the login form.
$message = JText::_('COM_USERS_RESET_COMPLETE_SUCCESS');
$this->setRedirect(JRoute::_($route, false), $message);
return true;
}
}

View File

@ -29,17 +29,16 @@ class UsersControllerUser extends UsersController
{
JSession::checkToken('post') or jexit(JText::_('JInvalid_Token'));
$app = JFactory::getApplication();
$input = $app->input;
$app = JFactory::getApplication();
$input = $app->input;
$method = $input->getMethod();
// Populate the data array:
$data = array();
$data['return'] = base64_decode($app->input->post->get('return', '', 'BASE64'));
$data['username'] = $input->$method->get('username', '', 'USERNAME');
$data['password'] = $input->$method->get('password', '', 'RAW');
$data['return'] = base64_decode($app->input->post->get('return', '', 'BASE64'));
$data['username'] = $input->$method->get('username', '', 'USERNAME');
$data['password'] = $input->$method->get('password', '', 'RAW');
$data['secretkey'] = $input->$method->get('secretkey', '', 'RAW');
// Set the return URL if empty.
@ -95,9 +94,8 @@ class UsersControllerUser extends UsersController
$app = JFactory::getApplication();
// Perform the log in.
$error = $app->logout();
$input = $app->input;
$error = $app->logout();
$input = $app->input;
$method = $input->getMethod();
// Check if the log out succeeded.
@ -133,7 +131,7 @@ class UsersControllerUser extends UsersController
$app = JFactory::getApplication();
// Get the form data.
$data = $this->input->post->get('user', array(), 'array');
$data = $this->input->post->get('user', array(), 'array');
// Get the model and validate the data.
$model = $this->getModel('Registration', 'UsersModel');
@ -208,7 +206,7 @@ class UsersControllerUser extends UsersController
if ($return instanceof Exception)
{
// Get the error message to display.
if ($app->getCfg('error_reporting'))
if ($app->get('error_reporting'))
{
$message = $return->getMessage();
}
@ -220,10 +218,11 @@ class UsersControllerUser extends UsersController
// Get the route to the next page.
$itemid = UsersHelperRoute::getRemindRoute();
$itemid = $itemid !== null ? '&Itemid=' . $itemid : '';
$route = 'index.php?option=com_users&view=remind' . $itemid;
$route = 'index.php?option=com_users&view=remind' . $itemid;
// Go back to the complete form.
$this->setRedirect(JRoute::_($route, false), $message, 'error');
return false;
}
elseif ($return === false)
@ -232,11 +231,12 @@ class UsersControllerUser extends UsersController
// Get the route to the next page.
$itemid = UsersHelperRoute::getRemindRoute();
$itemid = $itemid !== null ? '&Itemid=' . $itemid : '';
$route = 'index.php?option=com_users&view=remind' . $itemid;
$route = 'index.php?option=com_users&view=remind' . $itemid;
// Go back to the complete form.
$message = JText::sprintf('COM_USERS_REMIND_REQUEST_FAILED', $model->getError());
$this->setRedirect(JRoute::_($route, false), $message, 'notice');
return false;
}
else
@ -250,6 +250,7 @@ class UsersControllerUser extends UsersController
// Proceed to the login form.
$message = JText::_('COM_USERS_REMIND_REQUEST_SUCCESS');
$this->setRedirect(JRoute::_($route, false), $message);
return true;
}
}

View File

@ -29,7 +29,7 @@ class UsersViewLogin extends JViewLegacy
/**
* Method to display the view.
*
* @param string The template file to include
* @param string The template file to include
* @since 1.5
*/
public function display($tpl = null)
@ -91,18 +91,20 @@ class UsersViewLogin extends JViewLegacy
}
$title = $this->params->get('page_title', '');
if (empty($title))
{
$title = $app->getCfg('sitename');
$title = $app->get('sitename');
}
elseif ($app->getCfg('sitename_pagetitles', 0) == 1)
elseif ($app->get('sitename_pagetitles', 0) == 1)
{
$title = JText::sprintf('JPAGETITLE', $app->getCfg('sitename'), $title);
$title = JText::sprintf('JPAGETITLE', $app->get('sitename'), $title);
}
elseif ($app->getCfg('sitename_pagetitles', 0) == 2)
elseif ($app->get('sitename_pagetitles', 0) == 2)
{
$title = JText::sprintf('JPAGETITLE', $title, $app->getCfg('sitename'));
$title = JText::sprintf('JPAGETITLE', $title, $app->get('sitename'));
}
$this->document->setTitle($title);
if ($this->params->get('menu-meta_description'))

View File

@ -31,7 +31,7 @@ class UsersViewProfile extends JViewLegacy
*
* @param string $tpl The name of the template file to parse; automatically searches through the template paths.
*
* @return mixed A string if successful, otherwise a Error object.
* @return mixed A string if successful, otherwise a Error object.
*
* @since 1.6
*/
@ -101,10 +101,10 @@ class UsersViewProfile extends JViewLegacy
*/
protected function prepareDocument()
{
$app = JFactory::getApplication();
$menus = $app->getMenu();
$user = JFactory::getUser();
$title = null;
$app = JFactory::getApplication();
$menus = $app->getMenu();
$user = JFactory::getUser();
$title = null;
// Because the application sets a default page title,
// we need to get it from the menu item itself
@ -123,15 +123,15 @@ class UsersViewProfile extends JViewLegacy
if (empty($title))
{
$title = $app->getCfg('sitename');
$title = $app->get('sitename');
}
elseif ($app->getCfg('sitename_pagetitles', 0) == 1)
elseif ($app->get('sitename_pagetitles', 0) == 1)
{
$title = JText::sprintf('JPAGETITLE', $app->getCfg('sitename'), $title);
$title = JText::sprintf('JPAGETITLE', $app->get('sitename'), $title);
}
elseif ($app->getCfg('sitename_pagetitles', 0) == 2)
elseif ($app->get('sitename_pagetitles', 0) == 2)
{
$title = JText::sprintf('JPAGETITLE', $title, $app->getCfg('sitename'));
$title = JText::sprintf('JPAGETITLE', $title, $app->get('sitename'));
}
$this->document->setTitle($title);

View File

@ -97,15 +97,15 @@ class UsersViewRegistration extends JViewLegacy
if (empty($title))
{
$title = $app->getCfg('sitename');
$title = $app->get('sitename');
}
elseif ($app->getCfg('sitename_pagetitles', 0) == 1)
elseif ($app->get('sitename_pagetitles', 0) == 1)
{
$title = JText::sprintf('JPAGETITLE', $app->getCfg('sitename'), $title);
$title = JText::sprintf('JPAGETITLE', $app->get('sitename'), $title);
}
elseif ($app->getCfg('sitename_pagetitles', 0) == 2)
elseif ($app->get('sitename_pagetitles', 0) == 2)
{
$title = JText::sprintf('JPAGETITLE', $title, $app->getCfg('sitename'));
$title = JText::sprintf('JPAGETITLE', $title, $app->get('sitename'));
}
$this->document->setTitle($title);

View File

@ -27,20 +27,21 @@ class UsersViewRemind extends JViewLegacy
/**
* Method to display the view.
*
* @param string $tpl The template file to include
* @param string $tpl The template file to include
* @since 1.5
*/
public function display($tpl = null)
{
// Get the view data.
$this->form = $this->get('Form');
$this->state = $this->get('State');
$this->params = $this->state->params;
$this->form = $this->get('Form');
$this->state = $this->get('State');
$this->params = $this->state->params;
// Check for errors.
if (count($errors = $this->get('Errors')))
{
JError::raiseError(500, implode('<br />', $errors));
return false;
}
@ -66,9 +67,9 @@ class UsersViewRemind extends JViewLegacy
*/
protected function prepareDocument()
{
$app = JFactory::getApplication();
$menus = $app->getMenu();
$title = null;
$app = JFactory::getApplication();
$menus = $app->getMenu();
$title = null;
// Because the application sets a default page title,
// we need to get it from the menu item itself
@ -83,18 +84,20 @@ class UsersViewRemind extends JViewLegacy
}
$title = $this->params->get('page_title', '');
if (empty($title))
{
$title = $app->getCfg('sitename');
$title = $app->get('sitename');
}
elseif ($app->getCfg('sitename_pagetitles', 0) == 1)
elseif ($app->get('sitename_pagetitles', 0) == 1)
{
$title = JText::sprintf('JPAGETITLE', $app->getCfg('sitename'), $title);
$title = JText::sprintf('JPAGETITLE', $app->get('sitename'), $title);
}
elseif ($app->getCfg('sitename_pagetitles', 0) == 2)
elseif ($app->get('sitename_pagetitles', 0) == 2)
{
$title = JText::sprintf('JPAGETITLE', $title, $app->getCfg('sitename'));
$title = JText::sprintf('JPAGETITLE', $title, $app->get('sitename'));
}
$this->document->setTitle($title);
if ($this->params->get('menu-meta_description'))

View File

@ -27,7 +27,7 @@ class UsersViewReset extends JViewLegacy
/**
* Method to display the view.
*
* @param string The template file to include
* @param string The template file to include
* @since 1.5
*/
public function display($tpl = null)
@ -77,9 +77,9 @@ class UsersViewReset extends JViewLegacy
*/
protected function prepareDocument()
{
$app = JFactory::getApplication();
$menus = $app->getMenu();
$title = null;
$app = JFactory::getApplication();
$menus = $app->getMenu();
$title = null;
// Because the application sets a default page title,
// we need to get it from the menu item itself
@ -94,18 +94,20 @@ class UsersViewReset extends JViewLegacy
}
$title = $this->params->get('page_title', '');
if (empty($title))
{
$title = $app->getCfg('sitename');
$title = $app->get('sitename');
}
elseif ($app->getCfg('sitename_pagetitles', 0) == 1)
elseif ($app->get('sitename_pagetitles', 0) == 1)
{
$title = JText::sprintf('JPAGETITLE', $app->getCfg('sitename'), $title);
$title = JText::sprintf('JPAGETITLE', $app->get('sitename'), $title);
}
elseif ($app->getCfg('sitename_pagetitles', 0) == 2)
elseif ($app->get('sitename_pagetitles', 0) == 2)
{
$title = JText::sprintf('JPAGETITLE', $title, $app->getCfg('sitename'));
$title = JText::sprintf('JPAGETITLE', $title, $app->get('sitename'));
}
$this->document->setTitle($title);
if ($this->params->get('menu-meta_description'))

View File

@ -193,7 +193,7 @@ class WeblinksModelCategory extends JModelList
$params = JComponentHelper::getParams('com_weblinks');
// List state information
$limit = $app->getUserStateFromRequest('global.list.limit', 'limit', $app->getCfg('list_limit'), 'uint');
$limit = $app->getUserStateFromRequest('global.list.limit', 'limit', $app->get('list_limit'), 'uint');
$this->setState('list.limit', $limit);
$limitstart = $app->input->get('limitstart', 0, 'uint');
@ -334,6 +334,7 @@ class WeblinksModelCategory extends JModelList
{
$this->getCategory();
}
return $this->_children;
}
@ -348,13 +349,12 @@ class WeblinksModelCategory extends JModelList
*/
public function hit($pk = 0)
{
$input = JFactory::getApplication()->input;
$input = JFactory::getApplication()->input;
$hitcount = $input->getInt('hitcount', 1);
if ($hitcount)
{
$pk = (!empty($pk)) ? $pk : (int) $this->getState('category.id');
$pk = (!empty($pk)) ? $pk : (int) $this->getState('category.id');
$table = JTable::getInstance('Category', 'JTable');
$table->load($pk);
$table->hit($pk);

View File

@ -28,13 +28,13 @@ class WeblinksViewForm extends JViewLegacy
public function display($tpl = null)
{
$user = JFactory::getUser();
$user = JFactory::getUser();
// Get model data.
$this->state = $this->get('State');
$this->item = $this->get('Item');
$this->form = $this->get('Form');
$this->return_page = $this->get('ReturnPage');
$this->state = $this->get('State');
$this->item = $this->get('Item');
$this->form = $this->get('Form');
$this->return_page = $this->get('ReturnPage');
if (empty($this->item->id))
{
@ -43,7 +43,6 @@ class WeblinksViewForm extends JViewLegacy
else
{
$authorised = $user->authorise('core.edit', 'com_weblinks.category.'.$this->item->catid);
}
if ($authorised !== true)
@ -61,17 +60,18 @@ class WeblinksViewForm extends JViewLegacy
if (count($errors = $this->get('Errors')))
{
JError::raiseWarning(500, implode("\n", $errors));
return false;
}
// Create a shortcut to the parameters.
$params = &$this->state->params;
$params = &$this->state->params;
//Escape strings for HTML output
$this->pageclass_sfx = htmlspecialchars($params->get('pageclass_sfx'));
$this->params = $params;
$this->user = $user;
$this->params = $params;
$this->user = $user;
$this->_prepareDocument();
parent::display($tpl);
@ -91,12 +91,12 @@ class WeblinksViewForm extends JViewLegacy
$menu = $menus->getActive();
if (empty($this->item->id))
{
$head = JText::_('COM_WEBLINKS_FORM_SUBMIT_WEBLINK');
{
$head = JText::_('COM_WEBLINKS_FORM_SUBMIT_WEBLINK');
}
else
{
$head = JText::_('COM_WEBLINKS_FORM_EDIT_WEBLINK');
$head = JText::_('COM_WEBLINKS_FORM_EDIT_WEBLINK');
}
if ($menu)
@ -109,14 +109,16 @@ class WeblinksViewForm extends JViewLegacy
}
$title = $this->params->def('page_title', $head);
if ($app->getCfg('sitename_pagetitles', 0) == 1)
if ($app->get('sitename_pagetitles', 0) == 1)
{
$title = JText::sprintf('JPAGETITLE', $app->getCfg('sitename'), $title);
$title = JText::sprintf('JPAGETITLE', $app->get('sitename'), $title);
}
elseif ($app->getCfg('sitename_pagetitles', 0) == 2)
elseif ($app->get('sitename_pagetitles', 0) == 2)
{
$title = JText::sprintf('JPAGETITLE', $title, $app->getCfg('sitename'));
$title = JText::sprintf('JPAGETITLE', $title, $app->get('sitename'));
}
$this->document->setTitle($title);
if ($this->params->get('menu-meta_description'))

View File

@ -21,25 +21,26 @@ class WrapperViewWrapper extends JViewLegacy
*/
public function display($tpl = null)
{
$app = JFactory::getApplication();
$app = JFactory::getApplication();
$params = $app->getParams();
// because the application sets a default page title, we need to get it
// right from the menu item itself
$title = $params->get('page_title', '');
if (empty($title))
{
$title = $app->getCfg('sitename');
$title = $app->get('sitename');
}
elseif ($app->getCfg('sitename_pagetitles', 0) == 1)
elseif ($app->get('sitename_pagetitles', 0) == 1)
{
$title = JText::sprintf('JPAGETITLE', $app->getCfg('sitename'), $title);
$title = JText::sprintf('JPAGETITLE', $app->get('sitename'), $title);
}
elseif ($app->getCfg('sitename_pagetitles', 0) == 2)
elseif ($app->get('sitename_pagetitles', 0) == 2)
{
$title = JText::sprintf('JPAGETITLE', $title, $app->getCfg('sitename'));
$title = JText::sprintf('JPAGETITLE', $title, $app->get('sitename'));
}
$this->document->setTitle($title);
if ($params->get('menu-meta_description'))
@ -69,19 +70,21 @@ class WrapperViewWrapper extends JViewLegacy
}
$url = $params->def('url', '');
if ($params->def('add_scheme', 1))
{
// adds 'http://' if none is set
if (substr($url, 0, 1) == '/')
{
// relative url in component. use server http_host.
$wrapper->url = 'http://'. $_SERVER['HTTP_HOST'] . $url;
$wrapper->url = 'http://' . $_SERVER['HTTP_HOST'] . $url;
}
elseif (!strstr($url, 'http') && !strstr($url, 'https'))
{
$wrapper->url = 'http://'. $url;
$wrapper->url = 'http://' . $url;
}
else {
else
{
$wrapper->url = $url;
}
}
@ -92,9 +95,8 @@ class WrapperViewWrapper extends JViewLegacy
//Escape strings for HTML output
$this->pageclass_sfx = htmlspecialchars($params->get('pageclass_sfx'));
$this->params = &$params;
$this->wrapper = &$wrapper;
$this->params = &$params;
$this->wrapper = &$wrapper;
parent::display($tpl);
}

View File

@ -17,7 +17,7 @@ $data['options'] = !empty($data['options']) ? $data['options'] : array();
// Set some basic options
$customOptions = array(
'filtersHidden' => isset($data['options']['filtersHidden']) ? $data['options']['filtersHidden'] : empty($data['view']->activeFilters),
'defaultLimit' => isset($data['options']['defaultLimit']) ? $data['options']['defaultLimit'] : JFactory::getApplication()->getCfg('list_limit', 20),
'defaultLimit' => isset($data['options']['defaultLimit']) ? $data['options']['defaultLimit'] : JFactory::getApplication()->get('list_limit', 20),
'searchFieldSelector' => '#filter_search',
'orderFieldSelector' => '#list_fullordering'
);
@ -43,4 +43,4 @@ JHtml::_('searchtools.form', $formSelector, $data['options']);
<div class="js-stools-container-filters hidden-phone clearfix">
<?php echo JLayoutHelper::render('joomla.searchtools.default.filters', $data); ?>
</div>
</div>
</div>

View File

@ -33,7 +33,7 @@ class JHelp
public static function createURL($ref, $useComponent = false, $override = null, $component = null)
{
$local = false;
$app = JFactory::getApplication();
$app = JFactory::getApplication();
if (is_null($component))
{
@ -51,12 +51,12 @@ class JHelp
{
// Get the user help URL.
$user = JFactory::getUser();
$url = $user->getParam('helpsite');
$url = $user->getParam('helpsite');
// If user hasn't specified a help URL, then get the global one.
if ($url == '')
{
$url = $app->getCfg('helpurl');
$url = $app->get('helpurl');
}
// Component help URL overrides user and global.
@ -64,12 +64,12 @@ class JHelp
{
// Look for help URL in component parameters.
$params = JComponentHelper::getParams($component);
$url = $params->get('helpURL');
$url = $params->get('helpURL');
if ($url == '')
{
$local = true;
$url = 'components/{component}/help/{language}/{keyref}';
$url = 'components/{component}/help/{language}/{keyref}';
}
}
@ -77,7 +77,7 @@ class JHelp
if (!$url)
{
$local = true;
$url = 'help/{language}/{keyref}';
$url = 'help/{language}/{keyref}';
}
}
@ -93,12 +93,12 @@ class JHelp
/*
* Replace substitution codes in the URL.
*/
$lang = JFactory::getLanguage();
$lang = JFactory::getLanguage();
$version = new JVersion;
$jver = explode('.', $version->getShortVersion());
$jlang = explode('-', $lang->getTag());
$jver = explode('.', $version->getShortVersion());
$jlang = explode('-', $lang->getTag());
$debug = $lang->setDebug(false);
$debug = $lang->setDebug(false);
$keyref = JText::_($ref);
$lang->setDebug($debug);
@ -176,7 +176,7 @@ class JHelp
public static function createSiteList($pathToXml)
{
$list = array();
$xml = false;
$xml = false;
if (!empty($pathToXml))
{
@ -185,8 +185,9 @@ class JHelp
if (!$xml)
{
$option['text'] = 'English (GB) help.joomla.org';
$option['text'] = 'English (GB) help.joomla.org';
$option['value'] = 'http://help.joomla.org';
$list[] = $option;
}
else
@ -195,7 +196,7 @@ class JHelp
foreach ($xml->sites->site as $site)
{
$option['text'] = (string) $site;
$option['text'] = (string) $site;
$option['value'] = (string) $site->attributes()->url;
$list[] = $option;

View File

@ -44,7 +44,7 @@ class JDocumentRendererRSS extends JDocumentRenderer
$app = JFactory::getApplication();
// Gets and sets timezone offset from site configuration
$tz = new DateTimeZone($app->getCfg('offset'));
$tz = new DateTimeZone($app->get('offset'));
$now = JFactory::getDate();
$now->setTimeZone($tz);
@ -54,13 +54,13 @@ class JDocumentRendererRSS extends JDocumentRenderer
$url = $uri->toString(array('scheme', 'user', 'pass', 'host', 'port'));
$syndicationURL = JRoute::_('&format=feed&type=rss');
if ($app->getCfg('sitename_pagetitles', 0) == 1)
if ($app->get('sitename_pagetitles', 0) == 1)
{
$title = JText::sprintf('JPAGETITLE', $app->getCfg('sitename'), $data->title);
$title = JText::sprintf('JPAGETITLE', $app->get('sitename'), $data->title);
}
elseif ($app->getCfg('sitename_pagetitles', 0) == 2)
elseif ($app->get('sitename_pagetitles', 0) == 2)
{
$title = JText::sprintf('JPAGETITLE', $data->title, $app->getCfg('sitename'));
$title = JText::sprintf('JPAGETITLE', $data->title, $app->get('sitename'));
}
else
{

View File

@ -549,7 +549,7 @@ class JModelList extends JModelLegacy
// Keep B/C for components previous to jform forms for filters
{
// Pre-fill the limits
$limit = $app->getUserStateFromRequest('global.list.limit', 'limit', $app->getCfg('list_limit'), 'uint');
$limit = $app->getUserStateFromRequest('global.list.limit', 'limit', $app->get('list_limit'), 'uint');
$this->setState('list.limit', $limit);
// Check if the ordering field is in the white list, otherwise use the incoming value.
@ -656,7 +656,7 @@ class JModelList extends JModelLegacy
*/
public function getUserStateFromRequest($key, $request, $default = null, $type = 'none', $resetPage = true)
{
$app = JFactory::getApplication();
$app = JFactory::getApplication();
$input = $app->input;
$old_state = $app->getUserState($key);
$cur_state = (!is_null($old_state)) ? $old_state : $default;

View File

@ -24,7 +24,7 @@ $view = $app->input->getCmd('view', '');
$layout = $app->input->getCmd('layout', '');
$task = $app->input->getCmd('task', '');
$itemid = $app->input->getCmd('Itemid', '');
$sitename = $app->getCfg('sitename');
$sitename = $app->get('sitename');
if($task == "edit" || $layout == "form" )
{
@ -79,27 +79,27 @@ else
<link href="<?php echo $this->baseurl; ?>/templates/<?php echo $this->template; ?>/favicon.ico" rel="shortcut icon" type="image/vnd.microsoft.icon" />
<?php // Template color ?>
<?php if ($params->get('templateColor')) : ?>
<style type="text/css">
body.site
{
border-top: 3px solid <?php echo $params->get('templateColor'); ?>;
background-color: <?php echo $params->get('templateBackgroundColor'); ?>
}
a
{
color: <?php echo $params->get('templateColor'); ?>;
}
.navbar-inner, .nav-list > .active > a, .nav-list > .active > a:hover, .dropdown-menu li > a:hover, .dropdown-menu .active > a, .dropdown-menu .active > a:hover, .nav-pills > .active > a, .nav-pills > .active > a:hover
{
background: <?php echo $params->get('templateColor'); ?>;
}
.navbar-inner
{
-moz-box-shadow: 0 1px 3px rgba(0, 0, 0, .25), inset 0 -1px 0 rgba(0, 0, 0, .1), inset 0 30px 10px rgba(0, 0, 0, .2);
-webkit-box-shadow: 0 1px 3px rgba(0, 0, 0, .25), inset 0 -1px 0 rgba(0, 0, 0, .1), inset 0 30px 10px rgba(0, 0, 0, .2);
box-shadow: 0 1px 3px rgba(0, 0, 0, .25), inset 0 -1px 0 rgba(0, 0, 0, .1), inset 0 30px 10px rgba(0, 0, 0, .2);
}
</style>
<style type="text/css">
body.site
{
border-top: 3px solid <?php echo $params->get('templateColor'); ?>;
background-color: <?php echo $params->get('templateBackgroundColor'); ?>
}
a
{
color: <?php echo $params->get('templateColor'); ?>;
}
.navbar-inner, .nav-list > .active > a, .nav-list > .active > a:hover, .dropdown-menu li > a:hover, .dropdown-menu .active > a, .dropdown-menu .active > a:hover, .nav-pills > .active > a, .nav-pills > .active > a:hover
{
background: <?php echo $params->get('templateColor'); ?>;
}
.navbar-inner
{
-moz-box-shadow: 0 1px 3px rgba(0, 0, 0, .25), inset 0 -1px 0 rgba(0, 0, 0, .1), inset 0 30px 10px rgba(0, 0, 0, .2);
-webkit-box-shadow: 0 1px 3px rgba(0, 0, 0, .25), inset 0 -1px 0 rgba(0, 0, 0, .1), inset 0 30px 10px rgba(0, 0, 0, .2);
box-shadow: 0 1px 3px rgba(0, 0, 0, .25), inset 0 -1px 0 rgba(0, 0, 0, .1), inset 0 30px 10px rgba(0, 0, 0, .2);
}
</style>
<?php endif; ?>
<!--[if lt IE 9]>
<script src="<?php echo $this->baseurl; ?>/media/jui/js/html5.js"></script>

View File

@ -24,7 +24,7 @@ $view = $app->input->getCmd('view', '');
$layout = $app->input->getCmd('layout', '');
$task = $app->input->getCmd('task', '');
$itemid = $app->input->getCmd('Itemid', '');
$sitename = $app->getCfg('sitename');
$sitename = $app->get('sitename');
if($task == "edit" || $layout == "form" )
{
@ -138,7 +138,7 @@ else
<a class="brand pull-left" href="<?php echo $this->baseurl; ?>">
<?php echo $logo; ?>
<?php if ($this->params->get('sitedescription')) : ?>
<?php echo '<div class="site-description">' . htmlspecialchars($this->params->get('sitedescription')) . '</div>'; ?>
<?php echo '<div class="site-description">' . htmlspecialchars($this->params->get('sitedescription')) . '</div>'; ?>
<?php endif; ?>
</a>
<div class="header-search pull-right">
@ -147,20 +147,20 @@ else
</div>
</header>
<?php if ($this->countModules('position-1')) : ?>
<nav class="navigation" role="navigation">
<jdoc:include type="modules" name="position-1" style="none" />
</nav>
<nav class="navigation" role="navigation">
<jdoc:include type="modules" name="position-1" style="none" />
</nav>
<?php endif; ?>
<jdoc:include type="modules" name="banner" style="xhtml" />
<div class="row-fluid">
<?php if ($this->countModules('position-8')) : ?>
<!-- Begin Sidebar -->
<div id="sidebar" class="span3">
<div class="sidebar-nav">
<jdoc:include type="modules" name="position-8" style="xhtml" />
<!-- Begin Sidebar -->
<div id="sidebar" class="span3">
<div class="sidebar-nav">
<jdoc:include type="modules" name="position-8" style="xhtml" />
</div>
</div>
</div>
<!-- End Sidebar -->
<!-- End Sidebar -->
<?php endif; ?>
<main id="content" role="main" class="<?php echo $span; ?>">
<!-- Begin Content -->
@ -171,11 +171,11 @@ else
<!-- End Content -->
</main>
<?php if ($this->countModules('position-7')) : ?>
<div id="aside" class="span3">
<!-- Begin Right Sidebar -->
<jdoc:include type="modules" name="position-7" style="well" />
<!-- End Right Sidebar -->
</div>
<div id="aside" class="span3">
<!-- Begin Right Sidebar -->
<jdoc:include type="modules" name="position-7" style="well" />
<!-- End Right Sidebar -->
</div>
<?php endif; ?>
</div>
</div>

View File

@ -31,21 +31,21 @@ $twofactormethods = UsersHelper::getTwoFactorMethods();
<body>
<jdoc:include type="message" />
<div id="frame" class="outline">
<?php if ($app->getCfg('offline_image') && file_exists($app->getCfg('offline_image'))) : ?>
<img src="<?php echo $app->getCfg('offline_image'); ?>" alt="<?php echo htmlspecialchars($app->getCfg('sitename')); ?>" />
<?php if ($app->get('offline_image') && file_exists($app->get('offline_image'))) : ?>
<img src="<?php echo $app->get('offline_image'); ?>" alt="<?php echo htmlspecialchars($app->get('sitename')); ?>" />
<?php endif; ?>
<h1>
<?php echo htmlspecialchars($app->getCfg('sitename')); ?>
<?php echo htmlspecialchars($app->get('sitename')); ?>
</h1>
<?php if ($app->getCfg('display_offline_message', 1) == 1 && str_replace(' ', '', $app->getCfg('offline_message')) != '') : ?>
<?php if ($app->get('display_offline_message', 1) == 1 && str_replace(' ', '', $app->get('offline_message')) != '') : ?>
<p>
<?php echo $app->getCfg('offline_message'); ?>
<?php echo $app->get('offline_message'); ?>
</p>
<?php elseif ($app->getCfg('display_offline_message', 1) == 2 && str_replace(' ', '', JText::_('JOFFLINE_MESSAGE')) != '') : ?>
<?php elseif ($app->get('display_offline_message', 1) == 2 && str_replace(' ', '', JText::_('JOFFLINE_MESSAGE')) != '') : ?>
<p>
<?php echo JText::_('JOFFLINE_MESSAGE'); ?>
</p>
<?php endif; ?>
<?php endif; ?>
<form action="<?php echo JRoute::_('index.php', true); ?>" method="post" id="form-login">
<fieldset class="input">
<p id="form-login-username">
@ -57,16 +57,16 @@ $twofactormethods = UsersHelper::getTwoFactorMethods();
<input type="password" name="password" class="inputbox" size="18" alt="<?php echo JText::_('JGLOBAL_PASSWORD'); ?>" id="passwd" />
</p>
<?php if (count($twofactormethods) > 1) : ?>
<p id="form-login-secretkey">
<label for="secretkey"><?php echo JText::_('JGLOBAL_SECRETKEY'); ?></label>
<input type="text" name="secretkey" class="inputbox" size="18" alt="<?php echo JText::_('JGLOBAL_SECRETKEY'); ?>" id="secretkey" />
</p>
<p id="form-login-secretkey">
<label for="secretkey"><?php echo JText::_('JGLOBAL_SECRETKEY'); ?></label>
<input type="text" name="secretkey" class="inputbox" size="18" alt="<?php echo JText::_('JGLOBAL_SECRETKEY'); ?>" id="secretkey" />
</p>
<?php endif; ?>
<?php if (JPluginHelper::isEnabled('system', 'remember')) : ?>
<p id="form-login-remember">
<label for="remember"><?php echo JText::_('JGLOBAL_REMEMBER_ME'); ?></label>
<input type="checkbox" name="remember" class="inputbox" value="yes" alt="<?php echo JText::_('JGLOBAL_REMEMBER_ME'); ?>" id="remember" />
</p>
<p id="form-login-remember">
<label for="remember"><?php echo JText::_('JGLOBAL_REMEMBER_ME'); ?></label>
<input type="checkbox" name="remember" class="inputbox" value="yes" alt="<?php echo JText::_('JGLOBAL_REMEMBER_ME'); ?>" id="remember" />
</p>
<?php endif; ?>
<p id="submit-buton">
<label>&nbsp;</label>