29
0
mirror of https://github.com/joomla/joomla-cms.git synced 2024-06-27 07:33:41 +00:00

[#24210] Revert to 1.5 behaviour for plugin language loading

git-svn-id: http://joomlacode.org/svn/joomla/development/trunk@20240 6f6e1ebd-4c2b-0410-823f-f34bde69bce9
This commit is contained in:
Mark Dexter 2011-01-10 05:46:24 +00:00
parent afc69e85b5
commit a1c8a4cb76
20 changed files with 201 additions and 30 deletions

View File

@ -61,8 +61,6 @@ final class JSite extends JApplication
// if a language was specified it has priority
// otherwise use user or default language settings
jimport('joomla.plugin.helper');
JPluginHelper::importPlugin('system');
if (empty($options['language'])) {
$lang = JRequest::getString('language', null);

View File

@ -32,6 +32,7 @@ $ -> Language fix or change
# Sample data fixes (Elin Waring)
# [#24251] Article Category List Menu Item Missing Order By Parameters
# Sample data fixes: remove xx-XX language and add Joomla! library to joomla.sql
# [#24210] Revert to 1.5 behaviour for plugin language loading
10-Jan-2011 Andrew Eddie
# Fix typo in Joomla system plugin.

View File

@ -281,7 +281,6 @@ class JEditor extends JObservable
if (class_exists($className)) {
$plugin = new $className($this, (array)$plugin);
$plugin->loadLanguage();
}
// Try to authenticate

View File

@ -78,24 +78,9 @@ abstract class JPlugin extends JEvent
$this->_type = $config['type'];
}
// Set the automatic language loading
if (!isset($config['language']) || $config['language'])
{
$events = array_diff(get_class_methods($this), get_class_methods('JPlugin'));
foreach($events as $event)
{
$method = array('event' => $event, 'handler' => array($this, 'onFireEvent'));
$subject->attach($method);
}
}
parent::__construct($subject);
}
public function onFireEvent()
{
$this->loadLanguage(null, JPATH_ADMINISTRATOR);
}
/**
* Loads the plugin language file
*

View File

@ -71,9 +71,14 @@ class plgAuthenticationLdap extends JPlugin
{
// Bind using Connect Username/password
// Force anon bind to mitigate misconfiguration like [#7119]
if (strlen($this->params->get('username'))) $bindtest = $ldap->bind();
else $bindtest = $ldap->anonymous_bind();
if (strlen($this->params->get('username')))
{
$bindtest = $ldap->bind();
}
else
{
$bindtest = $ldap->anonymous_bind();
}
if ($bindtest)
{

View File

@ -27,6 +27,20 @@ defined('_JEXEC') or die;
*/
class plgContentPagebreak extends JPlugin
{
/**
* Constructor
*
* @access protected
* @param object $subject The object to observe
* @param array $config An array that holds the plugin configuration
* @since 1.5
*/
public function __construct(& $subject, $config)
{
parent::__construct($subject, $config);
$this->loadLanguage();
}
/**
* @param string The context of the content being passed to the plugin.
* @param object The article object. Note $article->text is also available

View File

@ -18,6 +18,20 @@ jimport('joomla.plugin.plugin');
*/
class plgContentVote extends JPlugin
{
/**
* Constructor
*
* @access protected
* @param object $subject The object to observe
* @param array $config An array that holds the plugin configuration
* @since 1.5
*/
public function __construct(& $subject, $config)
{
parent::__construct($subject, $config);
$this->loadLanguage();
}
/**
* @since 1.6
*/

View File

@ -19,6 +19,21 @@ jimport('joomla.plugin.plugin');
*/
class plgButtonArticle extends JPlugin
{
/**
* Constructor
*
* @access protected
* @param object $subject The object to observe
* @param array $config An array that holds the plugin configuration
* @since 1.5
*/
public function __construct(& $subject, $config)
{
parent::__construct($subject, $config);
$this->loadLanguage();
}
/**
* Display the button
*

View File

@ -19,6 +19,20 @@ jimport('joomla.plugin.plugin');
*/
class plgButtonImage extends JPlugin
{
/**
* Constructor
*
* @access protected
* @param object $subject The object to observe
* @param array $config An array that holds the plugin configuration
* @since 1.5
*/
public function __construct(& $subject, $config)
{
parent::__construct($subject, $config);
$this->loadLanguage();
}
/**
* Display the button
*

View File

@ -19,12 +19,26 @@ jimport('joomla.plugin.plugin');
*/
class plgButtonPagebreak extends JPlugin
{
/**
* Constructor
*
* @access protected
* @param object $subject The object to observe
* @param array $config An array that holds the plugin configuration
* @since 1.5
*/
public function __construct(& $subject, $config)
{
parent::__construct($subject, $config);
$this->loadLanguage();
}
/**
* Display the button
*
* @return array A two element array of (imageName, textToInsert)
*/
function onDisplay($name)
public function onDisplay($name)
{
$app = JFactory::getApplication();

View File

@ -19,11 +19,25 @@ jimport('joomla.plugin.plugin');
*/
class plgButtonReadmore extends JPlugin
{
/**
* Constructor
*
* @access protected
* @param object $subject The object to observe
* @param array $config An array that holds the plugin configuration
* @since 1.5
*/
public function __construct(& $subject, $config)
{
parent::__construct($subject, $config);
$this->loadLanguage();
}
/**
* readmore button
* @return array A two element array of (imageName, textToInsert)
*/
function onDisplay($name)
public function onDisplay($name)
{
$app = JFactory::getApplication();

View File

@ -26,6 +26,21 @@ class plgEditorTinymce extends JPlugin
*/
protected $_basePath = 'media/editors/tinymce/jscripts/tiny_mce';
/**
* Constructor
*
* @access protected
* @param object $subject The object to observe
* @param array $config An array that holds the plugin configuration
* @since 1.5
*/
public function __construct(& $subject, $config)
{
parent::__construct($subject, $config);
$this->loadLanguage();
}
/**
* Initialises the Editor.
*

View File

@ -33,6 +33,20 @@ class plgExtensionJoomla extends JPlugin
*/
private $installer = null;
/**
* Constructor
*
* @access protected
* @param object $subject The object to observe
* @param array $config An array that holds the plugin configuration
* @since 1.5
*/
public function __construct(& $subject, $config)
{
parent::__construct($subject, $config);
$this->loadLanguage();
}
/**
* Adds an update site to the table if it doesn't exist.
*

View File

@ -22,6 +22,20 @@ require_once JPATH_SITE.'/components/com_content/helpers/route.php';
*/
class plgSearchCategories extends JPlugin
{
/**
* Constructor
*
* @access protected
* @param object $subject The object to observe
* @param array $config An array that holds the plugin configuration
* @since 1.5
*/
public function __construct(& $subject, $config)
{
parent::__construct($subject, $config);
$this->loadLanguage();
}
/**
* @return array An array of search areas
*/

View File

@ -20,6 +20,20 @@ jimport('joomla.plugin.plugin');
*/
class plgSearchContacts extends JPlugin
{
/**
* Constructor
*
* @access protected
* @param object $subject The object to observe
* @param array $config An array that holds the plugin configuration
* @since 1.5
*/
public function __construct(& $subject, $config)
{
parent::__construct($subject, $config);
$this->loadLanguage();
}
/**
* @return array An array of search areas
*/

View File

@ -20,6 +20,20 @@ jimport('joomla.plugin.plugin');
*/
class plgSearchNewsfeeds extends JPlugin
{
/**
* Constructor
*
* @access protected
* @param object $subject The object to observe
* @param array $config An array that holds the plugin configuration
* @since 1.5
*/
public function __construct(& $subject, $config)
{
parent::__construct($subject, $config);
$this->loadLanguage();
}
/**
* @return array An array of search areas
*/

View File

@ -22,6 +22,20 @@ require_once JPATH_SITE.'/components/com_weblinks/helpers/route.php';
*/
class plgSearchWeblinks extends JPlugin
{
/**
* Constructor
*
* @access protected
* @param object $subject The object to observe
* @param array $config An array that holds the plugin configuration
* @since 1.5
*/
public function __construct(& $subject, $config)
{
parent::__construct($subject, $config);
$this->loadLanguage();
}
/**
* @return array An array of search areas
*/

View File

@ -25,7 +25,7 @@ class plgSystemDebug extends JPlugin
* @access protected
* @param object $subject The object to observe
* @param array $config An array that holds the plugin configuration
* @since 1.0
* @since 1.5
*/
function __construct(&$subject, $config)
{
@ -50,6 +50,9 @@ class plgSystemDebug extends JPlugin
if (!JDEBUG) {
return;
}
// Load the language
$this->loadLanguage();
// Capture output
$contents = ob_get_contents();

View File

@ -27,7 +27,7 @@ class plgSystemLogout extends JPlugin
* @param object The object to observe -- event dispatcher.
* @param object The configuration object for the plugin.
* @return void
* @since 1.0
* @since 1.5
*/
function __construct(&$subject, $config)
{
@ -78,11 +78,7 @@ class plgSystemLogout extends JPlugin
// Make sure the error is a 403 and we are in the frontend.
if ($error->getCode() == 403 and $app->isSite()) {
// Redirect to the home page
$lang = JFactory::getLanguage();
$lang->load('plg_system_logout', JPATH_ADMINISTRATOR, null, false, false)
|| $lang->load('plg_system_logout', JPath::clean(JPATH_PLUGINS . "/system/logout"), null, false, false)
|| $lang->load('plg_system_logout', JPATH_ADMINISTRATOR, $lang->getDefault(), false, false)
|| $lang->load('plg_system_logout', JPath::clean(JPATH_PLUGINS . "/system/logout"), $lang->getDefault(), false, false);
$this->loadLanguage();
$app->redirect('index.php', JText::_('PLG_SYSTEM_LOGOUT_REDIRECT'), null, true, false);
}
else {

View File

@ -22,6 +22,20 @@ jimport('joomla.plugins.plugin');
*/
class plgUserContactCreator extends JPlugin
{
/**
* Constructor
*
* @access protected
* @param object $subject The object to observe
* @param array $config An array that holds the plugin configuration
* @since 1.5
*/
public function __construct(& $subject, $config)
{
parent::__construct($subject, $config);
$this->loadLanguage();
}
function onUserAfterSave($user, $isnew, $success, $msg)
{
if(!$success) {