Browse files

Refactored instances of global $mainframe.

git-svn-id: http://joomlacode.org/svn/joomla/development/trunk@12490 6f6e1ebd-4c2b-0410-823f-f34bde69bce9
  • Loading branch information...
1 parent 72dc97e commit 46f482f9cc5c897f44b61cbe1ed2e7891e1325f7 @eddieajau eddieajau committed Jul 6, 2009
Showing with 416 additions and 451 deletions.
  1. +3 −2 administrator/components/com_banners/admin.banners.php
  2. +9 −12 administrator/components/com_banners/controllers/banner.php
  3. +6 −6 administrator/components/com_banners/controllers/client.php
  4. +3 −2 administrator/components/com_config/config.php
  5. +1 −1 administrator/components/com_config/controllers/application.php
  6. +1 −1 administrator/components/com_config/controllers/component.php
  7. +34 −40 administrator/components/com_contact/admin.contact.php
  8. +2 −3 administrator/components/com_content/elements/article.php
  9. +2 −3 administrator/components/com_installer/controller.php
  10. +2 −1 administrator/components/com_installer/installer.php
  11. +0 −2 administrator/components/com_installer/models/components.php
  12. +0 −2 administrator/components/com_installer/models/discover.php
  13. +5 −5 administrator/components/com_installer/models/extension.php
  14. +2 −3 administrator/components/com_installer/models/install.php
  15. +5 −8 administrator/components/com_installer/models/languages.php
  16. +3 −3 administrator/components/com_installer/models/libraries.php
  17. +2 −5 administrator/components/com_installer/models/manage.php
  18. +3 −5 administrator/components/com_installer/models/modules.php
  19. +3 −3 administrator/components/com_installer/models/packages.php
  20. +3 −5 administrator/components/com_installer/models/plugins.php
  21. +3 −5 administrator/components/com_installer/models/templates.php
  22. +4 −5 administrator/components/com_installer/models/update.php
  23. +0 −3 administrator/components/com_installer/models/warnings.php
  24. +7 −8 administrator/components/com_languages/admin.languages.php
  25. +17 −17 administrator/components/com_massmail/admin.massmail.php
  26. +2 −3 administrator/components/com_media/controller.php
  27. +15 −16 administrator/components/com_media/controllers/file.php
  28. +6 −8 administrator/components/com_media/controllers/folder.php
  29. +2 −1 administrator/components/com_media/media.php
  30. +0 −2 administrator/components/com_media/models/manager.php
  31. +0 −2 administrator/components/com_media/views/images/view.html.php
  32. +0 −2 administrator/components/com_media/views/imageslist/view.html.php
  33. +2 −3 administrator/components/com_media/views/media/view.html.php
  34. +2 −3 administrator/components/com_media/views/medialist/view.html.php
  35. +3 −3 administrator/components/com_messages/tables/message.php
  36. +2 −3 administrator/includes/toolbar.php
  37. +7 −7 administrator/index.php
  38. +2 −1 administrator/templates/bluestork/cpanel.php
  39. +2 −1 administrator/templates/bluestork/index.php
  40. +2 −1 administrator/templates/khepri/cpanel.php
  41. +2 −1 administrator/templates/khepri/index.php
  42. +0 −2 components/com_banners/models/banner.php
  43. +9 −12 components/com_contact/controller.php
  44. +4 −4 components/com_contact/views/category/view.feed.php
  45. +8 −9 components/com_contact/views/category/view.html.php
  46. +4 −5 components/com_contact/views/contact/view.html.php
  47. +3 −3 components/com_content/views/archive/view.html.php
  48. +3 −3 components/com_content/views/category/view.feed.php
  49. +4 −4 components/com_content/views/frontpage/view.feed.php
  50. +4 −5 components/com_mailto/controller.php
  51. +0 −2 components/com_media/controller.php
  52. +2 −1 components/com_media/media.php
  53. +2 −2 components/com_newsfeeds/models/category.php
  54. +3 −3 components/com_newsfeeds/views/category/view.html.php
  55. +4 −4 components/com_newsfeeds/views/newsfeed/view.html.php
  56. +2 −5 components/com_search/models/search.php
  57. +4 −5 components/com_search/views/search/view.html.php
  58. +4 −5 components/com_weblinks/views/category/view.feed.php
  59. +5 −6 components/com_weblinks/views/submit/view.html.php
  60. +2 −2 components/com_wrapper/views/wrapper/view.php
  61. +2 −3 components/com_wrapper/wrapper.php
  62. +7 −7 index.php
  63. +3 −3 installation/index.php
  64. +7 −7 installation/models/filesystem.php
  65. +2 −2 libraries/joomla/application/component/controller.php
  66. +8 −9 libraries/joomla/application/component/view.php
  67. +52 −28 libraries/joomla/application/helper.php
  68. +2 −2 libraries/joomla/cache/handler/page.php
  69. +3 −4 libraries/joomla/cache/handler/view.php
  70. +0 −1 libraries/joomla/document/html/html.php
  71. +3 −3 libraries/joomla/environment/request.php
  72. +2 −2 libraries/joomla/error/error.php
  73. +0 −2 libraries/joomla/form/fields/componentlayouts.php
  74. +0 −2 libraries/joomla/form/fields/modulelayouts.php
  75. +0 −2 libraries/joomla/html/parameter/element/componentlayouts.php
  76. +4 −4 libraries/joomla/language/help.php
  77. +0 −3 libraries/joomla/plugin/helper.php
  78. +22 −21 libraries/joomla/updater/update.php
  79. +6 −5 plugins/authentication/openid.php
  80. +6 −8 plugins/content/example.php
  81. +2 −2 plugins/editors-xtd/image.php
  82. +2 −2 plugins/editors-xtd/pagebreak.php
  83. +2 −2 plugins/editors-xtd/readmore.php
  84. +3 −4 plugins/editors/tinymce.php
  85. +3 −2 plugins/search/categories.php
  86. +3 −2 plugins/search/contacts.php
  87. +3 −4 plugins/search/content.php
  88. +3 −2 plugins/search/newsfeeds.php
  89. +3 −2 plugins/search/weblinks.php
  90. +8 −7 plugins/system/cache.php
  91. +0 −1 plugins/system/debug.php
  92. +1 −1 plugins/system/debug/debug.php
  93. +3 −3 plugins/system/remember.php
  94. +4 −4 plugins/user/example.php
  95. +2 −1 templates/beez/html/com_content/article/default.php
  96. +2 −1 templates/beez/html/com_content/category/blog_item.php
  97. +2 −1 templates/beez/html/com_content/frontpage/default_item.php
  98. +2 −1 templates/beez/html/com_content/section/blog_item.php
  99. +3 −2 templates/system/offline.php
View
5 administrator/components/com_banners/admin.banners.php
@@ -11,9 +11,10 @@
defined('_JEXEC') or die;
// Make sure the user is authorized to view this page
-$user = & JFactory::getUser();
+$user = & JFactory::getUser();
+$app = &JFactory::getApplication();
if (!$user->authorize('com_banners.manage')) {
- $mainframe->redirect('index.php', JText::_('ALERTNOTAUTH'));
+ $app->redirect('index.php', JText::_('ALERTNOTAUTH'));
}
// Set the table directory
View
21 administrator/components/com_banners/controllers/banner.php
@@ -36,19 +36,18 @@ function __construct($config = array())
*/
function display()
{
- global $mainframe;
-
- $db = &JFactory::getDbo();
+ $app = &JFactory::getApplication();
+ $db = &JFactory::getDbo();
$context = 'com_banners.banner.list.';
- $filter_order = $mainframe->getUserStateFromRequest($context.'filter_order', 'filter_order', 'cc.title', 'cmd');
- $filter_order_Dir = $mainframe->getUserStateFromRequest($context.'filter_order_Dir', 'filter_order_Dir', '', 'word');
- $filter_catid = $mainframe->getUserStateFromRequest($context.'filter_catid', 'filter_catid', '', 'int');
- $filter_state = $mainframe->getUserStateFromRequest($context.'filter_state', 'filter_state', '', 'word');
- $search = $mainframe->getUserStateFromRequest($context.'search', 'search', '', 'string');
+ $filter_order = $app->getUserStateFromRequest($context.'filter_order', 'filter_order', 'cc.title', 'cmd');
+ $filter_order_Dir = $app->getUserStateFromRequest($context.'filter_order_Dir', 'filter_order_Dir', '', 'word');
+ $filter_catid = $app->getUserStateFromRequest($context.'filter_catid', 'filter_catid', '', 'int');
+ $filter_state = $app->getUserStateFromRequest($context.'filter_state', 'filter_state', '', 'word');
+ $search = $app->getUserStateFromRequest($context.'search', 'search', '', 'string');
- $limit = $mainframe->getUserStateFromRequest('global.list.limit', 'limit', $mainframe->getCfg('list_limit'), 'int');
- $limitstart = $mainframe->getUserStateFromRequest($context.'limitstart', 'limitstart', 0, 'int');
+ $limit = $app->getUserStateFromRequest('global.list.limit', 'limit', $app->getCfg('list_limit'), 'int');
+ $limitstart = $app->getUserStateFromRequest($context.'limitstart', 'limitstart', 0, 'int');
$where = array();
@@ -179,8 +178,6 @@ function edit()
*/
function save()
{
- global $mainframe;
-
// Check for request forgeries
JRequest::checkToken() or jexit('Invalid Token');
View
12 administrator/components/com_banners/controllers/client.php
@@ -31,18 +31,18 @@ function __construct($config = array())
function display()
{
- global $mainframe;
+ $app = &JFactory::getApplication();
$db = &JFactory::getDbo();
$user = &JFactory::getUser();
$context = 'com_banners.bannerclient.list.';
- $filter_order = $mainframe->getUserStateFromRequest($context.'filter_order', 'filter_order', 'a.name', 'cmd');
- $filter_order_Dir = $mainframe->getUserStateFromRequest($context.'filter_order_Dir', 'filter_order_Dir', '', 'word');
- $search = $mainframe->getUserStateFromRequest($context.'search', 'search', '', 'string');
+ $filter_order = $app->getUserStateFromRequest($context.'filter_order', 'filter_order', 'a.name', 'cmd');
+ $filter_order_Dir = $app->getUserStateFromRequest($context.'filter_order_Dir', 'filter_order_Dir', '', 'word');
+ $search = $app->getUserStateFromRequest($context.'search', 'search', '', 'string');
$search = JString::strtolower($search);
- $limit = $mainframe->getUserStateFromRequest('global.list.limit', 'limit', $mainframe->getCfg('list_limit'), 'int');
- $limitstart = $mainframe->getUserStateFromRequest($context.'limitstart', 'limitstart', 0, 'int');
+ $limit = $app->getUserStateFromRequest('global.list.limit', 'limit', $app->getCfg('list_limit'), 'int');
+ $limitstart = $app->getUserStateFromRequest($context.'limitstart', 'limitstart', 0, 'int');
$where = array();
View
5 administrator/components/com_config/config.php
@@ -11,9 +11,10 @@
defined('_JEXEC') or die;
// Make sure the user is authorized to view this page
-$user = & JFactory::getUser();
+$user = & JFactory::getUser();
+$app = &JFactory::getApplication();
if (!$user->authorize('core.config.manage')) {
- $mainframe->redirect('index.php', JText::_('ALERTNOTAUTH'));
+ $app->redirect('index.php', JText::_('ALERTNOTAUTH'));
}
// Tell the browser not to cache this page.
View
2 administrator/components/com_config/controllers/application.php
@@ -43,7 +43,7 @@ public function save()
// Check if the user is authorized to do this.
if (!JFactory::getUser()->authorize('core.config.manage')) {
- $mainframe->redirect('index.php', JText::_('ALERTNOTAUTH'));
+ JFactory::getApplication()->redirect('index.php', JText::_('ALERTNOTAUTH'));
}
// Set FTP credentials, if given.
View
2 administrator/components/com_config/controllers/component.php
@@ -40,7 +40,7 @@ function save()
// Check if the user is authorized to do this.
// TODO: This permission need to change based on the extension.
if (!JFactory::getUser()->authorize('core.config.manage')) {
- $mainframe->redirect('index.php', JText::_('ALERTNOTAUTH'));
+ JFactory::getApplication()->redirect('index.php', JText::_('ALERTNOTAUTH'));
}
// Set FTP credentials, if given.
View
74 administrator/components/com_contact/admin.contact.php
@@ -13,9 +13,10 @@
/*
* Make sure the user is authorized to view this page
*/
-$user = & JFactory::getUser();
+$user = & JFactory::getUser();
+$app = &JFactory::getApplication();
if (!$user->authorize('com_contact.manage')) {
- $mainframe->redirect('index.php', JText::_('ALERTNOTAUTH'));
+ $app->redirect('index.php', JText::_('ALERTNOTAUTH'));
}
require_once(JApplicationHelper::getPath('admin_html'));
@@ -94,18 +95,18 @@
*/
function showContacts($option)
{
- global $mainframe;
-
- $db = &JFactory::getDbo();
- $filter_order = $mainframe->getUserStateFromRequest($option.'filter_order', 'filter_order', 'cd.ordering', 'cmd');
- $filter_order_Dir = $mainframe->getUserStateFromRequest($option.'filter_order_Dir', 'filter_order_Dir', '', 'word');
- $filter_state = $mainframe->getUserStateFromRequest($option.'filter_state', 'filter_state', '', 'word');
- $filter_catid = $mainframe->getUserStateFromRequest($option.'filter_catid', 'filter_catid', 0, 'int');
- $search = $mainframe->getUserStateFromRequest($option.'search', 'search', '', 'string');
+ $app = &JFactory::getApplication();
+ $db = &JFactory::getDbo();
+
+ $filter_order = $app->getUserStateFromRequest($option.'filter_order', 'filter_order', 'cd.ordering', 'cmd');
+ $filter_order_Dir = $app->getUserStateFromRequest($option.'filter_order_Dir', 'filter_order_Dir', '', 'word');
+ $filter_state = $app->getUserStateFromRequest($option.'filter_state', 'filter_state', '', 'word');
+ $filter_catid = $app->getUserStateFromRequest($option.'filter_catid', 'filter_catid', 0, 'int');
+ $search = $app->getUserStateFromRequest($option.'search', 'search', '', 'string');
$search = JString::strtolower($search);
- $limit = $mainframe->getUserStateFromRequest('global.list.limit', 'limit', $mainframe->getCfg('list_limit'), 'int');
- $limitstart = $mainframe->getUserStateFromRequest($option.'.limitstart', 'limitstart', 0, 'int');
+ $limit = $app->getUserStateFromRequest('global.list.limit', 'limit', $app->getCfg('list_limit'), 'int');
+ $limitstart = $app->getUserStateFromRequest($option.'.limitstart', 'limitstart', 0, 'int');
$where = array();
@@ -240,12 +241,11 @@ function editContact($edit)
*/
function saveContact($task)
{
- global $mainframe;
-
// Check for request forgeries
JRequest::checkToken() or jexit('Invalid Token');
// Initialize variables
+ $app = &JFactory::getApplication();
$db = &JFactory::getDbo();
$row = &JTable::getInstance('contact', 'Table');
$post = JRequest::get('post');
@@ -314,7 +314,7 @@ function saveContact($task)
break;
}
- $mainframe->redirect($link, $msg);
+ $app->redirect($link, $msg);
}
/**
@@ -324,13 +324,12 @@ function saveContact($task)
*/
function removeContacts(&$cid)
{
- global $mainframe;
-
// Check for request forgeries
JRequest::checkToken() or jexit('Invalid Token');
// Initialize variables
- $db = &JFactory::getDbo();
+ $app = &JFactory::getApplication();
+ $db = &JFactory::getDbo();
JArrayHelper::toInteger($cid);
if (count($cid)) {
@@ -344,7 +343,7 @@ function removeContacts(&$cid)
}
}
- $mainframe->redirect("index.php?option=com_contact");
+ $app->redirect("index.php?option=com_contact");
}
/**
@@ -355,12 +354,11 @@ function removeContacts(&$cid)
*/
function changeContact($cid=null, $state=0)
{
- global $mainframe;
-
// Check for request forgeries
JRequest::checkToken() or jexit('Invalid Token');
// Initialize variables
+ $app = &JFactory::getApplication();
$db = &JFactory::getDbo();
$user = &JFactory::getUser();
JArrayHelper::toInteger($cid);
@@ -387,7 +385,7 @@ function changeContact($cid=null, $state=0)
$row->checkin(intval($cid[0]));
}
- $mainframe->redirect('index.php?option=com_contact');
+ $app->redirect('index.php?option=com_contact');
}
/** JJC
@@ -396,38 +394,36 @@ function changeContact($cid=null, $state=0)
*/
function orderContacts($uid, $inc)
{
- global $mainframe;
-
// Check for request forgeries
JRequest::checkToken() or jexit('Invalid Token');
// Initialize variables
+ $app = &JFactory::getApplication();
$db = &JFactory::getDbo();
$row = &JTable::getInstance('contact', 'Table');
$row->load($uid);
$row->move($inc, 'catid = '. (int) $row->catid .' AND published != 0');
- $mainframe->redirect('index.php?option=com_contact');
+ $app->redirect('index.php?option=com_contact');
}
/** PT
* Cancels editing and checks in the record
*/
function cancelContact()
{
- global $mainframe;
-
// Check for request forgeries
JRequest::checkToken() or jexit('Invalid Token');
// Initialize variables
- $db = &JFactory::getDbo();
- $row = &JTable::getInstance('contact', 'Table');
+ $app = &JFactory::getApplication();
+ $db = &JFactory::getDbo();
+ $row = &JTable::getInstance('contact', 'Table');
$row->bind(JRequest::get('post'));
$row->checkin();
- $mainframe->redirect('index.php?option=com_contact');
+ $app->redirect('index.php?option=com_contact');
}
/**
@@ -436,13 +432,12 @@ function cancelContact()
*/
function changeAccess($id, $access)
{
- global $mainframe;
-
// Check for request forgeries
JRequest::checkToken() or jexit('Invalid Token');
// Initialize variables
- $db = &JFactory::getDbo();
+ $app = &JFactory::getApplication();
+ $db = &JFactory::getDbo();
$row = &JTable::getInstance('contact', 'Table');
$row->load($id);
@@ -455,20 +450,19 @@ function changeAccess($id, $access)
return $row->getError();
}
- $mainframe->redirect('index.php?option=com_contact');
+ $app->redirect('index.php?option=com_contact');
}
function saveOrder(&$cid)
{
- global $mainframe;
-
// Check for request forgeries
JRequest::checkToken() or jexit('Invalid Token');
// Initialize variables
- $db = &JFactory::getDbo();
- $total = count($cid);
- $order = JRequest::getVar('order', array(0), 'post', 'array');
+ $app = &JFactory::getApplication();
+ $db = &JFactory::getDbo();
+ $total = count($cid);
+ $order = JRequest::getVar('order', array(0), 'post', 'array');
JArrayHelper::toInteger($order, array(0));
$row = &JTable::getInstance('contact', 'Table');
@@ -495,5 +489,5 @@ function saveOrder(&$cid)
}
$msg = 'New ordering saved';
- $mainframe->redirect('index.php?option=com_contact', $msg);
+ $app->redirect('index.php?option=com_contact', $msg);
}
View
5 administrator/components/com_content/elements/article.php
@@ -21,11 +21,10 @@ class JElementArticle extends JElement
function fetchElement($name, $value, &$node, $control_name)
{
- global $mainframe;
-
+ $app = &JFactory::getApplication();
$db = &JFactory::getDbo();
$doc = &JFactory::getDocument();
- $template = $mainframe->getTemplate();
+ $template = $app->getTemplate();
$fieldName = $control_name.'['.$name.']';
$article = &JTable::getInstance('content');
if ($value) {
View
5 administrator/components/com_installer/controller.php
@@ -29,10 +29,9 @@ class InstallerController extends JController
*/
function installform()
{
- global $mainframe;
-
+ $app = &JFactory::getApplication();
$model = &$this->getModel('Install');
- $model->setState('install.directory', $mainframe->getCfg('config.tmp_path'));
+ $model->setState('install.directory', $app->getCfg('config.tmp_path'));
$view = &$this->getView('Install');
View
3 administrator/components/com_installer/installer.php
@@ -14,8 +14,9 @@
* Make sure the user is authorized to view this page
*/
$user = & JFactory::getUser();
+$app = &JFactory::getApplication();
if (!$user->authorize('core.installer.manage')) {
- $mainframe->redirect('index.php', JText::_('ALERTNOTAUTH'));
+ $app->redirect('index.php', JText::_('ALERTNOTAUTH'));
}
$ext = JRequest::getWord('type');
View
2 administrator/components/com_installer/models/components.php
@@ -98,8 +98,6 @@ function disable($eid=array())
function _loadItems()
{
- global $mainframe, $option;
-
jimport('joomla.filesystem.folder');
/* Get a database connector */
View
2 administrator/components/com_installer/models/discover.php
@@ -35,8 +35,6 @@ class InstallerModelDiscover extends InstallerModel
function _loadItems()
{
- global $mainframe, $option;
-
jimport('joomla.filesystem.folder');
/* Get a database connector */
View
10 administrator/components/com_installer/models/extension.php
@@ -32,14 +32,14 @@ class InstallerModel extends JModel
*/
function __construct()
{
- global $mainframe;
+ $app = &JFactory::getApplication();
// Call the parent constructor
parent::__construct();
// Set state variables from the request
- $this->setState('pagination.limit', $mainframe->getUserStateFromRequest('global.list.limit', 'limit', $mainframe->getCfg('list_limit'), 'int'));
- $this->setState('pagination.offset',$mainframe->getUserStateFromRequest('com_installer.limitstart.'.$this->_type, 'limitstart', 0, 'int'));
+ $this->setState('pagination.limit', $app->getUserStateFromRequest('global.list.limit', 'limit', $app->getCfg('list_limit'), 'int'));
+ $this->setState('pagination.offset',$app->getUserStateFromRequest('com_installer.limitstart.'.$this->_type, 'limitstart', 0, 'int'));
$this->setState('pagination.total', 0);
}
@@ -77,9 +77,9 @@ function &getPagination()
*/
function remove($eid=array())
{
- global $mainframe;
// Initialize variables
+ $app = &JFactory::getApplication();
$failed = array ();
/*
@@ -119,7 +119,7 @@ function remove($eid=array())
$result = true;
}
- $mainframe->enqueueMessage($msg);
+ $app->enqueueMessage($msg);
$this->setState('action', 'remove');
$this->setState('name', $installer->get('name'));
$this->setState('message', $installer->message);
View
5 administrator/components/com_installer/models/install.php
@@ -39,8 +39,6 @@ function __construct()
function install()
{
- global $mainframe;
-
$this->setState('action', 'install');
switch(JRequest::getWord('installtype'))
@@ -87,7 +85,8 @@ function install()
}
// Set some model state values
- $mainframe->enqueueMessage($msg);
+ $app = &JFactory::getApplication();
+ $app->enqueueMessage($msg);
$this->setState('name', $installer->get('name'));
$this->setState('result', $result);
$this->setState('message', $installer->message);
View
13 administrator/components/com_installer/models/languages.php
@@ -33,20 +33,18 @@ class InstallerModelLanguages extends InstallerModel
*/
function __construct()
{
- global $mainframe;
+ $app = &JFactory::getApplication();
// Call the parent constructor
parent::__construct();
// Set state variables from the request
- $this->setState('filter.string', $mainframe->getUserStateFromRequest("com_installer.languages.string", 'filter', '', 'string'));
- $this->setState('filter.client', $mainframe->getUserStateFromRequest("com_installer.languages.client", 'client', -1, 'int'));
+ $this->setState('filter.string', $app->getUserStateFromRequest("com_installer.languages.string", 'filter', '', 'string'));
+ $this->setState('filter.client', $app->getUserStateFromRequest("com_installer.languages.client", 'client', -1, 'int'));
}
function _loadItems()
{
- global $mainframe, $option;
-
$db = &JFactory::getDbo();
if ($this->_state->get('filter.client') < 0) {
@@ -161,8 +159,6 @@ function _loadItems()
*/
function remove($eid=array())
{
- global $mainframe;
-
// TODO: Check why this does this or if its still necessary!
// Hopefully its just another redundant path we can remove
$lang = &JFactory::getLanguage();
@@ -223,7 +219,8 @@ function remove($eid=array())
$result = true;
}
- $mainframe->enqueueMessage($msg);
+ $app = &JFactory::getApplication();
+ $app->enqueueMessage($msg);
$this->setState('action', 'remove');
$this->setState('message', $installer->message);
// re-construct the list of all language
View
6 administrator/components/com_installer/models/libraries.php
@@ -36,14 +36,14 @@ class InstallerModelLibraries extends InstallerModel
*/
function __construct()
{
- global $mainframe;
+ $app = &JFactory::getApplication();
// Call the parent constructor
parent::__construct();
// Set state variables from the request
- $this->setState('filter.string', $mainframe->getUserStateFromRequest("com_installer.libraries.string", 'filter', '', 'string'));
- $this->setState('filter.client', $mainframe->getUserStateFromRequest("com_installer.libraries.client", 'client', -1, 'int'));
+ $this->setState('filter.string', $app->getUserStateFromRequest("com_installer.libraries.string", 'filter', '', 'string'));
+ $this->setState('filter.client', $app->getUserStateFromRequest("com_installer.libraries.client", 'client', -1, 'int'));
}
/**
View
7 administrator/components/com_installer/models/manage.php
@@ -101,8 +101,6 @@ function disable($eid=array())
function _loadItems()
{
- global $mainframe, $option;
-
jimport('joomla.filesystem.folder');
/* Get a database connector */
@@ -157,8 +155,6 @@ function _loadItems()
*/
function remove($eid=array())
{
- global $mainframe;
-
// Initialize variables
$failed = array ();
@@ -206,7 +202,8 @@ function remove($eid=array())
$result = true;
}
- $mainframe->enqueueMessage($msg);
+ $app = &JFactory::getApplication();
+ $app->enqueueMessage($msg);
$this->setState('action', 'remove');
$this->setState('name', $installer->get('name'));
$this->setState('message', $installer->message);
View
8 administrator/components/com_installer/models/modules.php
@@ -32,20 +32,18 @@ class InstallerModelModules extends InstallerModel
*/
function __construct()
{
- global $mainframe;
+ $app = &JFactory::getApplication();
// Call the parent constructor
parent::__construct();
// Set state variables from the request
- $this->setState('filter.string', $mainframe->getUserStateFromRequest('com_installer.modules.string', 'filter', '', 'string'));
- $this->setState('filter.client', $mainframe->getUserStateFromRequest('com_installer.modules.client', 'client', -1, 'int'));
+ $this->setState('filter.string', $app->getUserStateFromRequest('com_installer.modules.string', 'filter', '', 'string'));
+ $this->setState('filter.client', $app->getUserStateFromRequest('com_installer.modules.client', 'client', -1, 'int'));
}
function _loadItems()
{
- global $mainframe, $option;
-
$db = &JFactory::getDbo();
$and = null;
View
6 administrator/components/com_installer/models/packages.php
@@ -34,14 +34,14 @@ class InstallerModelPackages extends InstallerModel
*/
function __construct()
{
- global $mainframe;
+ $app = &JFactory::getApplication();
// Call the parent constructor
parent::__construct();
// Set state variables from the request
- $this->setState('filter.string', $mainframe->getUserStateFromRequest("com_installer.packages.string", 'filter', '', 'string'));
- $this->setState('filter.client', $mainframe->getUserStateFromRequest("com_installer.packages.client", 'client', -1, 'int'));
+ $this->setState('filter.string', $app->getUserStateFromRequest("com_installer.packages.string", 'filter', '', 'string'));
+ $this->setState('filter.client', $app->getUserStateFromRequest("com_installer.packages.client", 'client', -1, 'int'));
}
/**
View
8 administrator/components/com_installer/models/plugins.php
@@ -32,14 +32,14 @@ class InstallerModelPlugins extends InstallerModel
*/
function __construct()
{
- global $mainframe;
+ $app = &JFactory::getApplication();
// Call the parent constructor
parent::__construct();
// Set state variables from the request
- $this->setState('filter.group', $mainframe->getUserStateFromRequest("com_installer.plugins.group", 'group', '', 'cmd'));
- $this->setState('filter.string', $mainframe->getUserStateFromRequest("com_installer.plugins.string", 'filter', '', 'string'));
+ $this->setState('filter.group', $app->getUserStateFromRequest("com_installer.plugins.group", 'group', '', 'cmd'));
+ $this->setState('filter.string', $app->getUserStateFromRequest("com_installer.plugins.string", 'filter', '', 'string'));
}
function &getGroups()
@@ -63,8 +63,6 @@ function &getGroups()
function _loadItems()
{
- global $mainframe, $option;
-
// Get a database connector
$db = & JFactory::getDbo();
View
8 administrator/components/com_installer/models/templates.php
@@ -33,20 +33,18 @@ class InstallerModelTemplates extends InstallerModel
*/
function __construct()
{
- global $mainframe;
+ $app = &JFactory::getApplication();
// Call the parent constructor
parent::__construct();
// Set state variables from the request
- $this->setState('filter.string', $mainframe->getUserStateFromRequest("com_installer.templates.string", 'filter', '', 'string'));
- $this->setState('filter.client', $mainframe->getUserStateFromRequest("com_installer.templates.client", 'client', -1, 'int'));
+ $this->setState('filter.string', $app->getUserStateFromRequest("com_installer.templates.string", 'filter', '', 'string'));
+ $this->setState('filter.client', $app->getUserStateFromRequest("com_installer.templates.client", 'client', -1, 'int'));
}
function _loadItems()
{
- global $mainframe, $option;
-
$db = &JFactory::getDbo();
if ($this->_state->get('filter.client') < 0) {
View
9 administrator/components/com_installer/models/update.php
@@ -37,8 +37,6 @@ class InstallerModelUpdate extends InstallerModel
function _loadItems()
{
- global $mainframe, $option;
-
jimport('joomla.filesystem.folder');
/* Get a database connector */
@@ -72,7 +70,8 @@ function _loadItems()
}
}
- function findUpdates($eid=0) {
+ function findUpdates($eid=0)
+ {
$updater =& JUpdater::getInstance();
$results = $updater->findUpdates($eid);
return true;
@@ -105,8 +104,8 @@ function update($uids) {
}
$result = $res & $result;
// Set some model state values
- global $mainframe;
- $mainframe->enqueueMessage($msg);
+ $app = &JFactory::getApplication();
+ $app->enqueueMessage($msg);
$this->setState('name', $update->get('name'));
$this->setState('message', $update->message);
View
3 administrator/components/com_installer/models/warnings.php
@@ -33,11 +33,8 @@ class InstallerModelWarnings extends InstallerModel
*/
function __construct()
{
- global $mainframe;
-
// Call the parent constructor
parent::__construct();
-
}
/**
View
15 administrator/components/com_languages/admin.languages.php
@@ -14,8 +14,9 @@
* Make sure the user is authorized to view this page
*/
$user = & JFactory::getUser();
+$app = &JFactory::getApplication();
if (!$user->authorize('core.languages.manage')) {
- $mainframe->redirect('index.php', JText::_('ALERTNOTAUTH'));
+ $app->redirect('index.php', JText::_('ALERTNOTAUTH'));
}
require_once(JApplicationHelper::getPath('admin_html'));
@@ -49,15 +50,14 @@
*/
function viewLanguages()
{
- global $mainframe, $option;
-
// Initialize some variables
+ $app = &JFactory::getApplication();
$db = &JFactory::getDbo();
$client = &JApplicationHelper::getClientInfo(JRequest::getVar('client', '0', '', 'int'));
$rows = array ();
- $limit = $mainframe->getUserStateFromRequest('global.list.limit', 'limit', $mainframe->getCfg('list_limit'), 'int');
- $limitstart = $mainframe->getUserStateFromRequest($option.'.limitstart', 'limitstart', 0, 'int');
+ $limit = $app->getUserStateFromRequest('global.list.limit', 'limit', $app->getCfg('list_limit'), 'int');
+ $limitstart = $app->getUserStateFromRequest($option.'.limitstart', 'limitstart', 0, 'int');
$rowid = 0;
@@ -117,12 +117,11 @@ function viewLanguages()
*/
function publishLanguage($language)
{
- global $mainframe;
-
// Check for request forgeries
JRequest::checkToken() or jexit('Invalid Token');
// Initialize some variables
+ $app = &JFactory::getApplication();
$client = &JApplicationHelper::getClientInfo(JRequest::getVar('client', '0', '', 'int'));
$params = JComponentHelper::getParams('com_languages');
@@ -145,5 +144,5 @@ function publishLanguage($language)
return false;
}
- $mainframe->redirect('index.php?option=com_languages&client='.$client->id);
+ $app->redirect('index.php?option=com_languages&client='.$client->id);
}
View
34 administrator/components/com_massmail/admin.massmail.php
@@ -14,8 +14,9 @@
* Make sure the user is authorized to view this page
*/
$user = & JFactory::getUser();
+$app = &JFactory::getApplication();
if (!$user->authorize('core.massmail.manage')) {
- $mainframe->redirect('index.php', JText::_('ALERTNOTAUTH'));
+ $app->redirect('index.php', JText::_('ALERTNOTAUTH'));
}
require_once(JApplicationHelper::getPath('admin_html'));
@@ -27,7 +28,7 @@
break;
case 'cancel':
- $mainframe->redirect('index.php');
+ $app->redirect('index.php');
break;
default:
@@ -43,20 +44,19 @@ function messageForm($option)
function sendMail()
{
- global $mainframe;
-
// Check for request forgeries
JRequest::checkToken() or jexit('Invalid Token');
- $db = &JFactory::getDbo();
- $user = &JFactory::getUser();
- $acl = &JFactory::getACL();
+ $app = &JFactory::getApplication();
+ $db = &JFactory::getDbo();
+ $user = &JFactory::getUser();
+ $acl = &JFactory::getACL();
- $mode = JRequest::getVar('mm_mode', 0, 'post', 'int');
- $subject = JRequest::getVar('mm_subject', '', 'post', 'string');
- $gou = JRequest::getVar('mm_group', '0', 'post', 'int');
- $recurse = JRequest::getVar('mm_recurse', 'NO_RECURSE', 'post', 'word');
- $bcc = JRequest::getVar('mm_bcc', 0, 'post', 'int');
+ $mode = JRequest::getVar('mm_mode', 0, 'post', 'int');
+ $subject = JRequest::getVar('mm_subject', '', 'post', 'string');
+ $gou = JRequest::getVar('mm_group', '0', 'post', 'int');
+ $recurse = JRequest::getVar('mm_recurse', 'NO_RECURSE', 'post', 'word');
+ $bcc = JRequest::getVar('mm_bcc', 0, 'post', 'int');
// pulls message inoformation either in text or html format
if ($mode) {
@@ -68,7 +68,7 @@ function sendMail()
// Check for a message body and subject
if (!$message_body || !$subject) {
- $mainframe->redirect('index.php?option=com_massmail', JText::_('Please fill in the form correctly'));
+ $app->redirect('index.php?option=com_massmail', JText::_('Please fill in the form correctly'));
}
// get users in the group out of the acl
@@ -98,14 +98,14 @@ function sendMail()
// Check to see if there are any users in this group before we continue
if (! count($rows)) {
$msg = JText::_('No users could be found in this group.');
- $mainframe->redirect('index.php?option=com_massmail', $msg);
+ $app->redirect('index.php?option=com_massmail', $msg);
}
$mailer = &JFactory::getMailer();
$params = &JComponentHelper::getParams('com_massmail');
// Build e-mail message format
- $mailer->setSender(array($mainframe->getCfg('mailfrom'), $mainframe->getCfg('fromname')));
+ $mailer->setSender(array($app->getCfg('mailfrom'), $app->getCfg('fromname')));
$mailer->setSubject($params->get('mailSubjectPrefix') . stripslashes($subject));
$mailer->setBody($message_body . $params->get('mailBodySuffix'));
$mailer->IsHTML($mode);
@@ -116,7 +116,7 @@ function sendMail()
foreach ($rows as $row) {
$mailer->addBCC($row->email);
}
- $mailer->addRecipient($mainframe->getCfg('mailfrom'));
+ $mailer->addRecipient($app->getCfg('mailfrom'));
}else {
foreach ($rows as $row) {
$mailer->addRecipient($row->email);
@@ -134,6 +134,6 @@ function sendMail()
}
// Redirect with the message
- $mainframe->redirect('index.php?option=com_massmail', $msg);
+ $app->redirect('index.php?option=com_massmail', $msg);
}
View
5 administrator/components/com_media/controller.php
@@ -26,8 +26,6 @@ class MediaController extends JController
*/
function display()
{
- global $mainframe;
-
$vName = JRequest::getCmd('view', 'media');
switch ($vName)
{
@@ -44,8 +42,9 @@ function display()
break;
case 'mediaList':
+ $app = &JFactory::getApplication();
$mName = 'list';
- $vLayout = $mainframe->getUserStateFromRequest('media.list.layout', 'layout', 'thumbs', 'word');
+ $vLayout = $app->getUserStateFromRequest('media.list.layout', 'layout', 'thumbs', 'word');
break;
View
31 administrator/components/com_media/controllers/file.php
@@ -30,16 +30,16 @@ class MediaControllerFile extends MediaController
*/
function upload()
{
- global $mainframe;
// Check for request forgeries
JRequest::checkToken('request') or jexit('Invalid Token');
- $file = JRequest::getVar('Filedata', '', 'files', 'array');
- $folder = JRequest::getVar('folder', '', '', 'path');
- $format = JRequest::getVar('format', 'html', '', 'cmd');
- $return = JRequest::getVar('return-url', null, 'post', 'base64');
- $err = null;
+ $app = &JFactory::getApplication();
+ $file = JRequest::getVar('Filedata', '', 'files', 'array');
+ $folder = JRequest::getVar('folder', '', '', 'path');
+ $format = JRequest::getVar('format', 'html', '', 'cmd');
+ $return = JRequest::getVar('return-url', null, 'post', 'base64');
+ $err = null;
// Set FTP credentials, if given
jimport('joomla.client.helper');
@@ -63,7 +63,7 @@ function upload()
JError::raiseNotice(100, JText::_($err));
// REDIRECT
if ($return) {
- $mainframe->redirect(base64_decode($return).'&folder='.$folder);
+ $app->redirect(base64_decode($return).'&folder='.$folder);
}
return;
}
@@ -80,7 +80,7 @@ function upload()
JError::raiseNotice(100, JText::_('Error. File already exists'));
// REDIRECT
if ($return) {
- $mainframe->redirect(base64_decode($return).'&folder='.$folder);
+ $app->redirect(base64_decode($return).'&folder='.$folder);
}
return;
}
@@ -97,7 +97,7 @@ function upload()
JError::raiseWarning(100, JText::_('Error. Unable to upload file'));
// REDIRECT
if ($return) {
- $mainframe->redirect(base64_decode($return).'&folder='.$folder);
+ $app->redirect(base64_decode($return).'&folder='.$folder);
}
return;
}
@@ -108,16 +108,16 @@ function upload()
$log->addEntry(array('comment' => $folder));
jexit('Upload complete');
} else {
- $mainframe->enqueueMessage(JText::_('Upload complete'));
+ $app->enqueueMessage(JText::_('Upload complete'));
// REDIRECT
if ($return) {
- $mainframe->redirect(base64_decode($return).'&folder='.$folder);
+ $app->redirect(base64_decode($return).'&folder='.$folder);
}
return;
}
}
} else {
- $mainframe->redirect('index.php', 'Invalid Request', 'error');
+ $app->redirect('index.php', 'Invalid Request', 'error');
}
}
@@ -129,15 +129,14 @@ function upload()
*/
function delete()
{
- global $mainframe;
-
JRequest::checkToken('request') or jexit('Invalid Token');
// Set FTP credentials, if given
jimport('joomla.client.helper');
JClientHelper::setCredentialsFromRequest('ftp');
// Get some data from the request
+ $app = &JFactory::getApplication();
$tmpl = JRequest::getCmd('tmpl');
$paths = JRequest::getVar('rm', array(), '', 'array');
$folder = JRequest::getVar('folder', '', '', 'path');
@@ -175,9 +174,9 @@ function delete()
}
if ($tmpl == 'component') {
// We are inside the iframe
- $mainframe->redirect('index.php?option=com_media&view=mediaList&folder='.$folder.'&tmpl=component');
+ $app->redirect('index.php?option=com_media&view=mediaList&folder='.$folder.'&tmpl=component');
} else {
- $mainframe->redirect('index.php?option=com_media&folder='.$folder);
+ $app->redirect('index.php?option=com_media&folder='.$folder);
}
}
}
View
14 administrator/components/com_media/controllers/folder.php
@@ -31,15 +31,14 @@ class MediaControllerFolder extends MediaController
*/
function delete()
{
- global $mainframe;
-
JRequest::checkToken('request') or jexit('Invalid Token');
// Set FTP credentials, if given
jimport('joomla.client.helper');
JClientHelper::setCredentialsFromRequest('ftp');
// Get some data from the request
+ $app = &JFactory::getApplication();
$tmpl = JRequest::getCmd('tmpl');
$paths = JRequest::getVar('rm', array(), '', 'array');
$folder = JRequest::getVar('folder', '', '', 'path');
@@ -77,9 +76,9 @@ function delete()
}
if ($tmpl == 'component') {
// We are inside the iframe
- $mainframe->redirect('index.php?option=com_media&view=mediaList&folder='.$folder.'&tmpl=component');
+ $app->redirect('index.php?option=com_media&view=mediaList&folder='.$folder.'&tmpl=component');
} else {
- $mainframe->redirect('index.php?option=com_media&folder='.$folder);
+ $app->redirect('index.php?option=com_media&folder='.$folder);
}
}
@@ -91,23 +90,22 @@ function delete()
*/
function create()
{
- global $mainframe;
-
// Check for request forgeries
JRequest::checkToken() or jexit('Invalid Token');
// Set FTP credentials, if given
jimport('joomla.client.helper');
JClientHelper::setCredentialsFromRequest('ftp');
+ $app = &JFactory::getApplication();
$folder = JRequest::getCmd('foldername', '');
$folderCheck = JRequest::getVar('foldername', null, '', 'string', JREQUEST_ALLOWRAW);
$parent = JRequest::getVar('folderbase', '', '', 'path');
JRequest::setVar('folder', $parent);
if (($folderCheck !== null) && ($folder !== $folderCheck)) {
- $mainframe->redirect('index.php?option=com_media&folder='.$parent, JText::_('WARNDIRNAME'));
+ $app->redirect('index.php?option=com_media&folder='.$parent, JText::_('WARNDIRNAME'));
}
if (strlen($folder) > 0) {
@@ -121,6 +119,6 @@ function create()
}
JRequest::setVar('folder', ($parent) ? $parent.'/'.$folder : $folder);
}
- $mainframe->redirect('index.php?option=com_media&folder='.$parent);
+ $app->redirect('index.php?option=com_media&folder='.$parent);
}
}
View
3 administrator/components/com_media/media.php
@@ -12,8 +12,9 @@
// Make sure the user is authorized to view this page
$user = & JFactory::getUser();
+$app = &JFactory::getApplication();
if (!$user->authorize('core.media.manage')) {
- $mainframe->redirect('index.php', JText::_('ALERTNOTAUTH'));
+ $app->redirect('index.php', JText::_('ALERTNOTAUTH'));
}
$params = &JComponentHelper::getParams('com_media');
View
2 administrator/components/com_media/models/manager.php
@@ -46,8 +46,6 @@ function getState($property = null)
*/
function getFolderList($base = null)
{
- global $mainframe;
-
// Get some paths from the request
if (empty($base)) {
$base = COM_MEDIA_BASE;
View
2 administrator/components/com_media/views/images/view.html.php
@@ -24,8 +24,6 @@ class MediaViewImages extends JView
{
function display($tpl = null)
{
- global $mainframe;
-
$config = &JComponentHelper::getParams('com_media');
$app = JFactory::getApplication();
View
2 administrator/components/com_media/views/imageslist/view.html.php
@@ -24,8 +24,6 @@ class MediaViewImagesList extends JView
{
function display($tpl = null)
{
- global $mainframe;
-
// Do not allow cache
JResponse::allowCache(false);
View
5 administrator/components/com_media/views/media/view.html.php
@@ -24,11 +24,10 @@ class MediaViewMedia extends JView
{
function display($tpl = null)
{
- global $mainframe;
-
+ $app = &JFactory::getApplication();
$config = &JComponentHelper::getParams('com_media');
- $style = $mainframe->getUserStateFromRequest('media.list.layout', 'layout', 'thumbs', 'word');
+ $style = $app->getUserStateFromRequest('media.list.layout', 'layout', 'thumbs', 'word');
$listStyle = "
<ul id=\"submenu\">
View
5 administrator/components/com_media/views/medialist/view.html.php
@@ -24,12 +24,11 @@ class MediaViewMediaList extends JView
{
function display($tpl = null)
{
- global $mainframe;
-
// Do not allow cache
JResponse::allowCache(false);
- $style = $mainframe->getUserStateFromRequest('media.list.layout', 'layout', 'thumbs', 'word');
+ $app = &JFactory::getApplication();
+ $style = $app->getUserStateFromRequest('media.list.layout', 'layout', 'thumbs', 'word');
JHtml::_('behavior.framework', true);
View
6 administrator/components/com_messages/tables/message.php
@@ -114,8 +114,8 @@ function check() {
*/
function send($fromId = null, $toId = null, $subject = null, $message = null, $mailfrom = null, $fromname = null)
{
- global $mainframe;
- $db = &JFactory::getDbo();
+ $app = &JFactory::getApplication();
+ $db = &JFactory::getDbo();
if (is_object($this))
{
@@ -155,7 +155,7 @@ function send($fromId = null, $toId = null, $subject = null, $message = null, $m
$fromname = $fromObject->name;
$mailfrom = $fromObject->email;
$siteURL = JURI::base();
- $sitename = $mainframe->getCfg('sitename');
+ $sitename = $app->getCfg('sitename');
$query = 'SELECT email' .
' FROM #__users' .
View
5 administrator/includes/toolbar.php
@@ -30,16 +30,15 @@ class JToolBarHelper
*/
function title($title, $icon = 'generic.png')
{
- global $mainframe;
-
//strip the extension
$icon = preg_replace('#\.[^.]*$#', '', $icon);
$html = "<div class=\"header icon-48-$icon\">\n";
$html .= "$title\n";
$html .= "</div>\n";
- $mainframe->set('JComponentTitle', $html);
+ $app = &JFactory::getApplication();
+ $app->set('JComponentTitle', $html);
}
/**
View
14 administrator/index.php
@@ -23,13 +23,13 @@
/*
* Instantiate the application.
*/
-$mainframe = &JFactory::getApplication('administrator');
+$app = &JFactory::getApplication('administrator');
/*
* Initialise the application.
*/
-$mainframe->initialise(array(
- 'language' => $mainframe->getUserState('application.lang', 'lang')
+$app->initialise(array(
+ 'language' => $app->getUserState('application.lang', 'lang')
));
// Mark afterIntialise in the profiler.
@@ -38,7 +38,7 @@
/*
* Route the application.
*/
-$mainframe->route();
+$app->route();
// Mark afterRoute in the profiler.
JDEBUG ? $_PROFILER->mark('afterRoute') : null;
@@ -47,20 +47,20 @@
* Dispatch the application.
*/
$option = JAdministratorHelper::findOption();
-$mainframe->dispatch($option);
+$app->dispatch($option);
// Mark afterDispatch in the profiler.
JDEBUG ? $_PROFILER->mark('afterDispatch') : null;
/*
* Render the application.
*/
-$mainframe->render();
+$app->render();
// Mark afterRender in the profiler.
JDEBUG ? $_PROFILER->mark('afterRender') : null;
/*
* Return the response.
*/
-echo JResponse::toString($mainframe->getCfg('gzip'));
+echo JResponse::toString($app->getCfg('gzip'));
View
3 administrator/templates/bluestork/cpanel.php
@@ -9,6 +9,7 @@
// no direct access
defined('_JEXEC') or die;
+$app = &JFactory::getApplication();
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php echo $this->language; ?>" lang="<?php echo $this->language; ?>" dir="<?php echo $this->direction; ?>" id="minwidth" >
@@ -62,7 +63,7 @@
<div>
<div>
<span class="logo"><img src="templates/<?php echo $this->template ?>/images/logo.png" alt="Joomla!" /></span>
- <span class="title"><?php echo $this->params->get('showSiteName') ? $mainframe->getCfg('sitename') : JText::_('Administration'); ?></span>
+ <span class="title"><?php echo $this->params->get('showSiteName') ? $app->getCfg('sitename') : JText::_('Administration'); ?></span>
</div>
</div>
</div>
View
3 administrator/templates/bluestork/index.php
@@ -9,6 +9,7 @@
// no direct access
defined('_JEXEC') or die;
+$app = &JFactory::getApplication();
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php echo $this->language; ?>" lang="<?php echo $this->language; ?>" dir="<?php echo $this->direction; ?>" id="minwidth" >
@@ -62,7 +63,7 @@
<div>
<div>
<span class="logo"><img src="templates/<?php echo $this->template ?>/images/logo.png" alt="Joomla!" /></span>
- <span class="title"><?php echo $this->params->get('showSiteName') ? $mainframe->getCfg('sitename') : JText::_('Administration'); ?></span>
+ <span class="title"><?php echo $this->params->get('showSiteName') ? $app->getCfg('sitename') : JText::_('Administration'); ?></span>
</div>
</div>
</div>
View
3 administrator/templates/khepri/cpanel.php
@@ -6,6 +6,7 @@
// no direct access
defined('_JEXEC') or die;
+$app = &JFactory::getApplication();
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php echo $this->language; ?>" lang="<?php echo $this->language; ?>" dir="<?php echo $this->direction; ?>" id="minwidth" >
@@ -48,7 +49,7 @@
<div>
<div>
<span class="version"><?php echo JText::_('Version') ?> <?php echo JVERSION; ?></span>
- <span class="title"><?php echo $this->params->get('showSiteName') ? $mainframe->getCfg('sitename') : JText::_('Administration'); ?></span>
+ <span class="title"><?php echo $this->params->get('showSiteName') ? $app->getCfg('sitename') : JText::_('Administration'); ?></span>
</div>
</div>
</div>
View
3 administrator/templates/khepri/index.php
@@ -6,6 +6,7 @@
// no direct access
defined('_JEXEC') or die;
+$app = &JFactory::getApplication();
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php echo $this->language; ?>" lang="<?php echo $this->language; ?>" dir="<?php echo $this->direction; ?>" id="minwidth" >
@@ -49,7 +50,7 @@
<div>
<div>
<span class="version"><?php echo JText::_('Version') ?> <?php echo JVERSION; ?></span>
- <span class="title"><?php echo $this->params->get('showSiteName') ? $mainframe->getCfg('sitename') : JText::_('Administration'); ?></span>
+ <span class="title"><?php echo $this->params->get('showSiteName') ? $app->getCfg('sitename') : JText::_('Administration'); ?></span>
</div>
</div>
</div>
View
2 components/com_banners/models/banner.php
@@ -171,8 +171,6 @@ function click($id = 0)
*/
function getUrl($id = 0)
{
- global $mainframe;
-
$db = &$this->getDbo();
// redirect to banner url
View
21 components/com_contact/controller.php
@@ -75,14 +75,13 @@ function display()
*/
function submit()
{
- global $mainframe;
-
// Check for request forgeries
JRequest::checkToken() or jexit('Invalid Token');
// Initialize some variables
+ $app = &JFactory::getApplication();
$db = & JFactory::getDbo();
- $SiteName = $mainframe->getCfg('sitename');
+ $SiteName = $app->getCfg('sitename');
$default = JText::sprintf('MAILENQUIRY', $SiteName);
$contactId = JRequest::getInt('id', 0, 'post');
@@ -141,11 +140,11 @@ function submit()
// Passed Validation: Process the contact plugins to integrate with other applications
$results = $dispatcher->trigger('onSubmitContact', array(&$contact, &$post));
- $pparams = &$mainframe->getParams('com_contact');
+ $pparams = &$app->getParams('com_contact');
if (!$pparams->get('custom_reply'))
{
- $MailFrom = $mainframe->getCfg('mailfrom');
- $FromName = $mainframe->getCfg('fromname');
+ $MailFrom = $app->getCfg('mailfrom');
+ $FromName = $app->getCfg('fromname');
// Prepare email body
$prefix = JText::sprintf('ENQUIRY_TEXT', JURI::base());
@@ -198,13 +197,12 @@ function submit()
*/
function vcard()
{
- global $mainframe;
-
// Initialize some variables
+ $app = &JFactory::getApplication();
$db = &JFactory::getDbo();
$user = &JFactory::getUser();
- $SiteName = $mainframe->getCfg('sitename');
+ $SiteName = $app->getCfg('sitename');
$contactId = JRequest::getVar('contact_id', 0, '', 'int');
// Get a Contact table object and load the selected contact details
JTable::addIncludePath(JPATH_ADMINISTRATOR.DS.'components'.DS.'com_contact'.DS.'tables');
@@ -300,13 +298,12 @@ function vcard()
*/
function _validateInputs($contact, $email, $subject, $body)
{
- global $mainframe;
-
+ $app = &JFactory::getApplication();
$session = &JFactory::getSession();
// Get params and component configurations
$params = new JParameter($contact->params);
- $pparams = &$mainframe->getParams('com_contact');
+ $pparams = &$app->getParams('com_contact');
// check for session cookie
$sessionCheck = $pparams->get('validate_session', 1);
View
8 components/com_contact/views/category/view.feed.php
@@ -20,18 +20,18 @@ class ContactViewCategory extends JView
{
function display()
{
- global $mainframe;
+ $app = &JFactory::getApplication();
$db = &JFactory::getDbo();
$document = &JFactory::getDocument();
$document->link = JRoute::_('index.php?option=com_contact&view=category&catid='.JRequest::getVar('catid',null, '', 'int'));
- $siteEmail = $mainframe->getCfg('mailfrom');
- $fromName = $mainframe->getCfg('fromname');
+ $siteEmail = $app->getCfg('mailfrom');
+ $fromName = $app->getCfg('fromname');
$document->editor = $fromName;
$document->editorEmail = $siteEmail;
- $limit = JRequest::getVar('limit', $mainframe->getCfg('feed_limit'), '', 'int');
+ $limit = JRequest::getVar('limit', $app->getCfg('feed_limit'), '', 'int');
$limitstart = JRequest::getVar('limitstart', 0, '', 'int');
$catid = JRequest::getVar('catid', 0, '', 'int');
View
17 components/com_contact/views/category/view.html.php
@@ -20,25 +20,24 @@ class ContactViewCategory extends JView
{
function display($tpl = null)
{
- global $mainframe, $option;
+ $app = &JFactory::getApplication();
+ $user = &JFactory::getUser();
+ $uri = &JFactory::getURI();
+ $model = &$this->getModel();
+ $document = &JFactory::getDocument();
- $user = &JFactory::getUser();
- $uri = &JFactory::getURI();
- $model = &$this->getModel();
- $document = &JFactory::getDocument();
-
- $pparams = &$mainframe->getParams('com_contact');
+ $pparams = &$app->getParams('com_contact');