diff --git a/oss/joomla/trunk/plugins/authentication/example.php b/oss/joomla/trunk/plugins/authentication/example.php
index ec334646..d7f3c591 100644
--- a/oss/joomla/trunk/plugins/authentication/example.php
+++ b/oss/joomla/trunk/plugins/authentication/example.php
@@ -1,85 +1,85 @@
-status = JAUTHENTICATE_STATUS_SUCCESS;
- $response->error_message = '';
- // You may also define other variables:
- /*
- $yourUser = YourClass::getUser( $credentials );
- $response->email = $yourUser->email;
- $response->fullname = $yourUser->name;
- */
- return true;
- }
- else
- {
- $response->status = JAUTHENTICATE_STATUS_FAILURE;
- $response->error_message = 'Could not authenticate';
- return false;
- }
- }
-}
+status = JAUTHENTICATE_STATUS_SUCCESS;
+ $response->error_message = '';
+ // You may also define other variables:
+ /*
+ $yourUser = YourClass::getUser( $credentials );
+ $response->email = $yourUser->email;
+ $response->fullname = $yourUser->name;
+ */
+ return true;
+ }
+ else
+ {
+ $response->status = JAUTHENTICATE_STATUS_FAILURE;
+ $response->error_message = 'Could not authenticate';
+ return false;
+ }
+ }
+}
diff --git a/oss/joomla/trunk/plugins/authentication/example.xml b/oss/joomla/trunk/plugins/authentication/example.xml
index ba9669e7..2e69e809 100644
--- a/oss/joomla/trunk/plugins/authentication/example.xml
+++ b/oss/joomla/trunk/plugins/authentication/example.xml
@@ -3,7 +3,7 @@
Authentication - Example
Joomla! Project
November 2005
- Copyright (C) 2005 - 2008 Open Source Matters. All rights reserved.
+ Copyright (C) 2005 - 2010 Open Source Matters. All rights reserved.
http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL
admin@joomla.org
www.joomla.org
diff --git a/oss/joomla/trunk/plugins/authentication/gmail.php b/oss/joomla/trunk/plugins/authentication/gmail.php
index e8fc122f..943ca4d3 100644
--- a/oss/joomla/trunk/plugins/authentication/gmail.php
+++ b/oss/joomla/trunk/plugins/authentication/gmail.php
@@ -1,106 +1,106 @@
-status = JAUTHENTICATE_STATUS_SUCCESS;
- $response->error_message = '';
- $response->email = $credentials['username'];
- $response->fullname = $credentials['username'];
- }
- else
- {
- $response->status = JAUTHENTICATE_STATUS_FAILURE;
- $response->error_message = 'Failed to authenticate: ' . $message;
- }
- }
-}
+status = JAUTHENTICATE_STATUS_SUCCESS;
+ $response->error_message = '';
+ $response->email = $credentials['username'];
+ $response->fullname = $credentials['username'];
+ }
+ else
+ {
+ $response->status = JAUTHENTICATE_STATUS_FAILURE;
+ $response->error_message = 'Failed to authenticate: ' . $message;
+ }
+ }
+}
diff --git a/oss/joomla/trunk/plugins/authentication/gmail.xml b/oss/joomla/trunk/plugins/authentication/gmail.xml
index c4e6d828..c4bc681b 100644
--- a/oss/joomla/trunk/plugins/authentication/gmail.xml
+++ b/oss/joomla/trunk/plugins/authentication/gmail.xml
@@ -3,7 +3,7 @@
Authentication - GMail
Joomla! Project
February 2006
- Copyright (C) 2005 - 2008 Open Source Matters. All rights reserved.
+ Copyright (C) 2005 - 2010 Open Source Matters. All rights reserved.
http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL
admin@joomla.org
www.joomla.org
diff --git a/oss/joomla/trunk/plugins/authentication/joomla.php b/oss/joomla/trunk/plugins/authentication/joomla.php
index 43075dcb..1f78a447 100644
--- a/oss/joomla/trunk/plugins/authentication/joomla.php
+++ b/oss/joomla/trunk/plugins/authentication/joomla.php
@@ -1,105 +1,105 @@
-status = JAUTHENTICATE_STATUS_FAILURE;
- $response->error_message = 'Empty password not allowed';
- return false;
- }
-
- // Initialize variables
- $conditions = '';
-
- // Get a database object
- $db =& JFactory::getDBO();
-
- $query = 'SELECT `id`, `password`, `gid`'
- . ' FROM `#__users`'
- . ' WHERE username=' . $db->Quote( $credentials['username'] )
- ;
- $db->setQuery( $query );
- $result = $db->loadObject();
-
-
- if($result)
- {
- $parts = explode( ':', $result->password );
- $crypt = $parts[0];
- $salt = @$parts[1];
- $testcrypt = JUserHelper::getCryptedPassword($credentials['password'], $salt);
-
- if ($crypt == $testcrypt) {
- $user = JUser::getInstance($result->id); // Bring this in line with the rest of the system
- $response->email = $user->email;
- $response->fullname = $user->name;
- $response->status = JAUTHENTICATE_STATUS_SUCCESS;
- $response->error_message = '';
- } else {
- $response->status = JAUTHENTICATE_STATUS_FAILURE;
- $response->error_message = 'Invalid password';
- }
- }
- else
- {
- $response->status = JAUTHENTICATE_STATUS_FAILURE;
- $response->error_message = 'User does not exist';
- }
- }
-}
+status = JAUTHENTICATE_STATUS_FAILURE;
+ $response->error_message = 'Empty password not allowed';
+ return false;
+ }
+
+ // Initialize variables
+ $conditions = '';
+
+ // Get a database object
+ $db =& JFactory::getDBO();
+
+ $query = 'SELECT `id`, `password`, `gid`'
+ . ' FROM `#__users`'
+ . ' WHERE username=' . $db->Quote( $credentials['username'] )
+ ;
+ $db->setQuery( $query );
+ $result = $db->loadObject();
+
+
+ if($result)
+ {
+ $parts = explode( ':', $result->password );
+ $crypt = $parts[0];
+ $salt = @$parts[1];
+ $testcrypt = JUserHelper::getCryptedPassword($credentials['password'], $salt);
+
+ if ($crypt == $testcrypt) {
+ $user = JUser::getInstance($result->id); // Bring this in line with the rest of the system
+ $response->email = $user->email;
+ $response->fullname = $user->name;
+ $response->status = JAUTHENTICATE_STATUS_SUCCESS;
+ $response->error_message = '';
+ } else {
+ $response->status = JAUTHENTICATE_STATUS_FAILURE;
+ $response->error_message = 'Invalid password';
+ }
+ }
+ else
+ {
+ $response->status = JAUTHENTICATE_STATUS_FAILURE;
+ $response->error_message = 'User does not exist';
+ }
+ }
+}
diff --git a/oss/joomla/trunk/plugins/authentication/joomla.xml b/oss/joomla/trunk/plugins/authentication/joomla.xml
index 49e574b3..26c9cd03 100644
--- a/oss/joomla/trunk/plugins/authentication/joomla.xml
+++ b/oss/joomla/trunk/plugins/authentication/joomla.xml
@@ -3,7 +3,7 @@
Authentication - Joomla
Joomla! Project
November 2005
- Copyright (C) 2005 - 2008 Open Source Matters. All rights reserved.
+ Copyright (C) 2005 - 2010 Open Source Matters. All rights reserved.
http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL
admin@joomla.org
www.joomla.org
diff --git a/oss/joomla/trunk/plugins/authentication/ldap.php b/oss/joomla/trunk/plugins/authentication/ldap.php
index 480ed3eb..8c0a732e 100644
--- a/oss/joomla/trunk/plugins/authentication/ldap.php
+++ b/oss/joomla/trunk/plugins/authentication/ldap.php
@@ -1,162 +1,162 @@
-type = 'LDAP';
- // LDAP does not like Blank passwords (tries to Anon Bind which is bad)
- if (empty($credentials['password']))
- {
- $response->status = JAUTHENTICATE_STATUS_FAILURE;
- $response->error_message = 'LDAP can not have blank password';
- return false;
- }
-
- // load plugin params info
- $ldap_email = $this->params->get('ldap_email');
- $ldap_fullname = $this->params->get('ldap_fullname');
- $ldap_uid = $this->params->get('ldap_uid');
- $auth_method = $this->params->get('auth_method');
-
- jimport('joomla.client.ldap');
- $ldap = new JLDAP($this->params);
-
- if (!$ldap->connect())
- {
- $response->status = JAUTHENTICATE_STATUS_FAILURE;
- $response->error_message = 'Unable to connect to LDAP server';
- return;
- }
-
- switch($auth_method)
- {
- case 'search':
- {
- // 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($bindtest)
- {
- // Search for users DN
- $binddata = $ldap->simple_search(str_replace("[search]", $credentials['username'], $this->params->get('search_string')));
- if(isset($binddata[0]) && isset($binddata[0]['dn'])) {
- // Verify Users Credentials
- $success = $ldap->bind($binddata[0]['dn'],$credentials['password'],1);
- // Get users details
- $userdetails = $binddata;
- } else {
- $response->status = JAUTHENTICATE_STATUS_FAILURE;
- $response->error_message = 'Unable to find user';
- }
- }
- else
- {
- $response->status = JAUTHENTICATE_STATUS_FAILURE;
- $response->error_message = 'Unable to bind to LDAP';
- }
- } break;
-
- case 'bind':
- {
- // We just accept the result here
- $success = $ldap->bind($credentials['username'],$credentials['password']);
- if($success) {
- $userdetails = $ldap->simple_search(str_replace("[search]", $credentials['username'], $this->params->get('search_string')));
- } else {
- $response->status = JAUTHENTICATE_STATUS_FAILURE;
- $response->error_message = 'Failed binding to LDAP server';
- }
- } break;
- }
-
- if(!$success)
- {
- $response->status = JAUTHENTICATE_STATUS_FAILURE;
- if(!strlen($response->error_message)) $response->error_message = 'Incorrect username/password';
- }
- else
- {
- // Grab some details from LDAP and return them
- if (isset($userdetails[0][$ldap_uid][0])) {
- $response->username = $userdetails[0][$ldap_uid][0];
- }
-
- if (isset($userdetails[0][$ldap_email][0])) {
- $response->email = $userdetails[0][$ldap_email][0];
- }
-
- if(isset($userdetails[0][$ldap_fullname][0])) {
- $response->fullname = $userdetails[0][$ldap_fullname][0];
- } else {
- $response->fullname = $credentials['username'];
- }
-
- // Were good - So say so.
- $response->status = JAUTHENTICATE_STATUS_SUCCESS;
- $response->error_message = '';
- }
-
- $ldap->close();
- }
-}
+type = 'LDAP';
+ // LDAP does not like Blank passwords (tries to Anon Bind which is bad)
+ if (empty($credentials['password']))
+ {
+ $response->status = JAUTHENTICATE_STATUS_FAILURE;
+ $response->error_message = 'LDAP can not have blank password';
+ return false;
+ }
+
+ // load plugin params info
+ $ldap_email = $this->params->get('ldap_email');
+ $ldap_fullname = $this->params->get('ldap_fullname');
+ $ldap_uid = $this->params->get('ldap_uid');
+ $auth_method = $this->params->get('auth_method');
+
+ jimport('joomla.client.ldap');
+ $ldap = new JLDAP($this->params);
+
+ if (!$ldap->connect())
+ {
+ $response->status = JAUTHENTICATE_STATUS_FAILURE;
+ $response->error_message = 'Unable to connect to LDAP server';
+ return;
+ }
+
+ switch($auth_method)
+ {
+ case 'search':
+ {
+ // 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($bindtest)
+ {
+ // Search for users DN
+ $binddata = $ldap->simple_search(str_replace("[search]", $credentials['username'], $this->params->get('search_string')));
+ if(isset($binddata[0]) && isset($binddata[0]['dn'])) {
+ // Verify Users Credentials
+ $success = $ldap->bind($binddata[0]['dn'],$credentials['password'],1);
+ // Get users details
+ $userdetails = $binddata;
+ } else {
+ $response->status = JAUTHENTICATE_STATUS_FAILURE;
+ $response->error_message = 'Unable to find user';
+ }
+ }
+ else
+ {
+ $response->status = JAUTHENTICATE_STATUS_FAILURE;
+ $response->error_message = 'Unable to bind to LDAP';
+ }
+ } break;
+
+ case 'bind':
+ {
+ // We just accept the result here
+ $success = $ldap->bind($credentials['username'],$credentials['password']);
+ if($success) {
+ $userdetails = $ldap->simple_search(str_replace("[search]", $credentials['username'], $this->params->get('search_string')));
+ } else {
+ $response->status = JAUTHENTICATE_STATUS_FAILURE;
+ $response->error_message = 'Failed binding to LDAP server';
+ }
+ } break;
+ }
+
+ if(!$success)
+ {
+ $response->status = JAUTHENTICATE_STATUS_FAILURE;
+ if(!strlen($response->error_message)) $response->error_message = 'Incorrect username/password';
+ }
+ else
+ {
+ // Grab some details from LDAP and return them
+ if (isset($userdetails[0][$ldap_uid][0])) {
+ $response->username = $userdetails[0][$ldap_uid][0];
+ }
+
+ if (isset($userdetails[0][$ldap_email][0])) {
+ $response->email = $userdetails[0][$ldap_email][0];
+ }
+
+ if(isset($userdetails[0][$ldap_fullname][0])) {
+ $response->fullname = $userdetails[0][$ldap_fullname][0];
+ } else {
+ $response->fullname = $credentials['username'];
+ }
+
+ // Were good - So say so.
+ $response->status = JAUTHENTICATE_STATUS_SUCCESS;
+ $response->error_message = '';
+ }
+
+ $ldap->close();
+ }
+}
diff --git a/oss/joomla/trunk/plugins/authentication/ldap.xml b/oss/joomla/trunk/plugins/authentication/ldap.xml
index 8568d811..92c0b1d8 100644
--- a/oss/joomla/trunk/plugins/authentication/ldap.xml
+++ b/oss/joomla/trunk/plugins/authentication/ldap.xml
@@ -3,7 +3,7 @@
Authentication - LDAP
Joomla! Project
November 2005
- Copyright (C) 2005 - 2008 Open Source Matters. All rights reserved.
+ Copyright (C) 2005 - 2010 Open Source Matters. All rights reserved.
http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL
admin@joomla.org
www.joomla.org
diff --git a/oss/joomla/trunk/plugins/authentication/openid.php b/oss/joomla/trunk/plugins/authentication/openid.php
index aaeb7e36..fa42d17d 100644
--- a/oss/joomla/trunk/plugins/authentication/openid.php
+++ b/oss/joomla/trunk/plugins/authentication/openid.php
@@ -1,274 +1,274 @@
-type = JAUTHENTICATE_STATUS_FAILURE;
- $response->error_message = "Could not create the FileStore directory '$store_path'. " . " Please check the effective permissions.";
- return false;
- }
-
- // Create store object
- $store = new Auth_OpenID_FileStore($store_path);
-
- // Create a consumer object
- $consumer = new Auth_OpenID_Consumer($store);
-
- if (!isset ($_SESSION['_openid_consumer_last_token'])) {
- // Begin the OpenID authentication process.
- if (!$auth_request = $consumer->begin($credentials['username'])) {
- $response->type = JAUTHENTICATE_STATUS_FAILURE;
- $response->error_message = 'Authentication error : could not connect to the openid server';
- return false;
- }
-
- $sreg_request = Auth_OpenID_SRegRequest::build(
- array ('email'),
- array ('fullname','language','timezone')
- );
-
- if ($sreg_request) {
- $auth_request->addExtension($sreg_request);
- }
- $policy_uris = array();
- if ($this->params->get( 'phishing-resistant', 0)) {
- $policy_uris[] = 'http://schemas.openid.net/pape/policies/2007/06/phishing-resistant';
- }
-
- if ($this->params->get( 'multi-factor', 0)) {
- $policy_uris[] = 'http://schemas.openid.net/pape/policies/2007/06/multi-factor';
- }
-
- if ($this->params->get( 'multi-factor-physical', 0)) {
- $policy_uris[] = 'http://schemas.openid.net/pape/policies/2007/06/multi-factor-physical';
- }
-
- $pape_request = new Auth_OpenID_PAPE_Request($policy_uris);
- if ($pape_request) {
- $auth_request->addExtension($pape_request);
- }
-
- //Create the entry url
- $entry_url = isset ($options['entry_url']) ? $options['entry_url'] : JURI :: base();
- $entry_url = JURI :: getInstance($entry_url);
-
- unset ($options['entry_url']); //We don't need this anymore
-
- //Create the url query information
- $options['return'] = isset($options['return']) ? base64_encode($options['return']) : base64_encode(JURI::base());
- $options[JUtility::getToken()] = 1;
-
- $process_url = sprintf($entry_url->toString()."?option=com_user&task=login&username=%s", $credentials['username']);
- $process_url .= '&'.JURI::buildQuery($options);
-
- $session->set('return_url', $process_url );
-
- $trust_url = $entry_url->toString(array (
- 'path',
- 'host',
- 'port',
- 'scheme'
- ));
- $session->set('trust_url', $trust_url);
- // For OpenID 1, send a redirect. For OpenID 2, use a Javascript
- // form to send a POST request to the server.
- if ($auth_request->shouldSendRedirect()) {
- $redirect_url = $auth_request->redirectURL($trust_url, $process_url);
-
- // If the redirect URL can't be built, display an error
- // message.
- if (Auth_OpenID :: isFailure($redirect_url)) {
- displayError("Could not redirect to server: " . $redirect_url->message);
- } else {
- // Send redirect.
- $mainframe->redirect($redirect_url);
- return false;
- }
- } else {
- // Generate form markup and render it.
- $form_id = 'openid_message';
- $form_html = $auth_request->htmlMarkup($trust_url, $process_url, false, array (
- 'id' => $form_id
- ));
- // Display an error if the form markup couldn't be generated;
- // otherwise, render the HTML.
- if (Auth_OpenID :: isFailure($form_html)) {
- //displayError("Could not redirect to server: " . $form_html->message);
- } else {
- JResponse :: setBody($form_html);
- echo JResponse :: toString($mainframe->getCfg('gzip'));
- $mainframe->close();
- return false;
- }
- }
- }
- $result = $consumer->complete($session->get('return_url'));
- switch ($result->status) {
- case Auth_OpenID_SUCCESS :
- {
- $sreg_resp = Auth_OpenID_SRegResponse::fromSuccessResponse($result);
-
- $sreg = $sreg_resp->contents();
- $usermode = $this->params->get('usermode', 2);
-/* in the following code, we deal with the transition from the old openid version to the new openid version
- In the old version, the username was always taken straight from the login form. In the new version, we get a
- username back from the openid provider. This is necessary for a number of reasons. First, providers such as
- yahoo.com allow you to enter only the provider name in the username field (i.e. yahoo.com or flickr.com). Taking
- this as the username would obviously cause problems because everybody who had an id from yahoo.com would have username
- yahoo.com. Second, it is necessary because with the old way, we rely on the user entering the id the same every time.
- This is bad because if the user enters the http:// one time and not the second time, they end up as two different users.
- There are two possible settings here - the first setting, is to always use the new way, which is to get the username from
- the provider after authentication. The second setting is to check if the username exists that we got from the provider. If it
- doesn't, then we check if the entered username exists. If it does, then we update the database with the username from the provider
- and continue happily along with the new username.
- We had talked about a third option, which would be to always used the old way, but that seems insecure in the case of somebody using
- a yahoo.com ID.
-*/
- if ($usermode && $usermode == 1) {
- $response->username = $result->getDisplayIdentifier();
- } else {
- // first, check if the provider provided username exists in the database
- $db = &JFactory::getDBO();
- $query = 'SELECT username FROM #__users'.
- ' WHERE username='.$db->Quote($result->getDisplayIdentifier()).
- ' AND password=\'\'';
- $db->setQuery($query);
- $dbresult = $db->loadObject();
- if ($dbresult) {
- // if so, we set our username value to the provided value
- $response->username = $result->getDisplayIdentifier();
- } else {
- // if it doesn't, we check if the username from the from exists in the database
- $query = 'SELECT username FROM #__users'.
- ' WHERE username='.$db->Quote( $credentials['username'] ).
- ' AND password=\'\'';
- $db->setQuery($query);
- $dbresult = $db->loadObject();
- if ($dbresult) {
- // if it does, we update the database
- $query = 'UPDATE #__users SET username='.$db->Quote($result->getDisplayIdentifier()).
- ' WHERE username='.$db->Quote($credentials['username']);
- $db->setQuery($query);
- $db->query();
- if (!$db->query()) {
- $response->status = JAUTHENTICATE_STATUS_FAILURE;
- $response->error_message = $db->getErrorMsg();
- //break out of the switch if we hit an error with our query
- break;
- }
- }
- $response->username = $result->getDisplayIdentifier();
- // we return the username provided by the openid provider
- }
- }
- $response->status = JAUTHENTICATE_STATUS_SUCCESS;
- $response->error_message = '';
- if (!isset($sreg['email'])) {
- $response->email = str_replace( array('http://', 'https://'), '', $response->username );
- $response->email = str_replace( '/', '-', $response->email );
- $response->email .= '@openid.';
- } else {
- $response->email = $sreg['email'];
- }
- $response->fullname = isset ($sreg['fullname']) ? $sreg['fullname'] : $response->username;
- $response->language = isset ($sreg['language']) ? $sreg['language'] : '';
- $response->timezone = isset ($sreg['timezone']) ? $sreg['timezone'] : '';
- }
- break;
-
- case Auth_OpenID_CANCEL :
- {
- $response->status = JAUTHENTICATE_STATUS_CANCEL;
- $response->error_message = 'Authentication cancelled';
- }
- break;
-
- case Auth_OpenID_FAILURE :
- {
- $response->status = JAUTHENTICATE_STATUS_FAILURE;
- $response->error_message = 'Authentication failed';
- }
- break;
- }
- }
-
- // function
-}
+type = JAUTHENTICATE_STATUS_FAILURE;
+ $response->error_message = "Could not create the FileStore directory '$store_path'. " . " Please check the effective permissions.";
+ return false;
+ }
+
+ // Create store object
+ $store = new Auth_OpenID_FileStore($store_path);
+
+ // Create a consumer object
+ $consumer = new Auth_OpenID_Consumer($store);
+
+ if (!isset ($_SESSION['_openid_consumer_last_token'])) {
+ // Begin the OpenID authentication process.
+ if (!$auth_request = $consumer->begin($credentials['username'])) {
+ $response->type = JAUTHENTICATE_STATUS_FAILURE;
+ $response->error_message = 'Authentication error : could not connect to the openid server';
+ return false;
+ }
+
+ $sreg_request = Auth_OpenID_SRegRequest::build(
+ array ('email'),
+ array ('fullname','language','timezone')
+ );
+
+ if ($sreg_request) {
+ $auth_request->addExtension($sreg_request);
+ }
+ $policy_uris = array();
+ if ($this->params->get( 'phishing-resistant', 0)) {
+ $policy_uris[] = 'http://schemas.openid.net/pape/policies/2007/06/phishing-resistant';
+ }
+
+ if ($this->params->get( 'multi-factor', 0)) {
+ $policy_uris[] = 'http://schemas.openid.net/pape/policies/2007/06/multi-factor';
+ }
+
+ if ($this->params->get( 'multi-factor-physical', 0)) {
+ $policy_uris[] = 'http://schemas.openid.net/pape/policies/2007/06/multi-factor-physical';
+ }
+
+ $pape_request = new Auth_OpenID_PAPE_Request($policy_uris);
+ if ($pape_request) {
+ $auth_request->addExtension($pape_request);
+ }
+
+ //Create the entry url
+ $entry_url = isset ($options['entry_url']) ? $options['entry_url'] : JURI :: base();
+ $entry_url = JURI :: getInstance($entry_url);
+
+ unset ($options['entry_url']); //We don't need this anymore
+
+ //Create the url query information
+ $options['return'] = isset($options['return']) ? base64_encode($options['return']) : base64_encode(JURI::base());
+ $options[JUtility::getToken()] = 1;
+
+ $process_url = sprintf($entry_url->toString()."?option=com_user&task=login&username=%s", $credentials['username']);
+ $process_url .= '&'.JURI::buildQuery($options);
+
+ $session->set('return_url', $process_url );
+
+ $trust_url = $entry_url->toString(array (
+ 'path',
+ 'host',
+ 'port',
+ 'scheme'
+ ));
+ $session->set('trust_url', $trust_url);
+ // For OpenID 1, send a redirect. For OpenID 2, use a Javascript
+ // form to send a POST request to the server.
+ if ($auth_request->shouldSendRedirect()) {
+ $redirect_url = $auth_request->redirectURL($trust_url, $process_url);
+
+ // If the redirect URL can't be built, display an error
+ // message.
+ if (Auth_OpenID :: isFailure($redirect_url)) {
+ displayError("Could not redirect to server: " . $redirect_url->message);
+ } else {
+ // Send redirect.
+ $mainframe->redirect($redirect_url);
+ return false;
+ }
+ } else {
+ // Generate form markup and render it.
+ $form_id = 'openid_message';
+ $form_html = $auth_request->htmlMarkup($trust_url, $process_url, false, array (
+ 'id' => $form_id
+ ));
+ // Display an error if the form markup couldn't be generated;
+ // otherwise, render the HTML.
+ if (Auth_OpenID :: isFailure($form_html)) {
+ //displayError("Could not redirect to server: " . $form_html->message);
+ } else {
+ JResponse :: setBody($form_html);
+ echo JResponse :: toString($mainframe->getCfg('gzip'));
+ $mainframe->close();
+ return false;
+ }
+ }
+ }
+ $result = $consumer->complete($session->get('return_url'));
+ switch ($result->status) {
+ case Auth_OpenID_SUCCESS :
+ {
+ $sreg_resp = Auth_OpenID_SRegResponse::fromSuccessResponse($result);
+
+ $sreg = $sreg_resp->contents();
+ $usermode = $this->params->get('usermode', 2);
+/* in the following code, we deal with the transition from the old openid version to the new openid version
+ In the old version, the username was always taken straight from the login form. In the new version, we get a
+ username back from the openid provider. This is necessary for a number of reasons. First, providers such as
+ yahoo.com allow you to enter only the provider name in the username field (i.e. yahoo.com or flickr.com). Taking
+ this as the username would obviously cause problems because everybody who had an id from yahoo.com would have username
+ yahoo.com. Second, it is necessary because with the old way, we rely on the user entering the id the same every time.
+ This is bad because if the user enters the http:// one time and not the second time, they end up as two different users.
+ There are two possible settings here - the first setting, is to always use the new way, which is to get the username from
+ the provider after authentication. The second setting is to check if the username exists that we got from the provider. If it
+ doesn't, then we check if the entered username exists. If it does, then we update the database with the username from the provider
+ and continue happily along with the new username.
+ We had talked about a third option, which would be to always used the old way, but that seems insecure in the case of somebody using
+ a yahoo.com ID.
+*/
+ if ($usermode && $usermode == 1) {
+ $response->username = $result->getDisplayIdentifier();
+ } else {
+ // first, check if the provider provided username exists in the database
+ $db = &JFactory::getDBO();
+ $query = 'SELECT username FROM #__users'.
+ ' WHERE username='.$db->Quote($result->getDisplayIdentifier()).
+ ' AND password=\'\'';
+ $db->setQuery($query);
+ $dbresult = $db->loadObject();
+ if ($dbresult) {
+ // if so, we set our username value to the provided value
+ $response->username = $result->getDisplayIdentifier();
+ } else {
+ // if it doesn't, we check if the username from the from exists in the database
+ $query = 'SELECT username FROM #__users'.
+ ' WHERE username='.$db->Quote( $credentials['username'] ).
+ ' AND password=\'\'';
+ $db->setQuery($query);
+ $dbresult = $db->loadObject();
+ if ($dbresult) {
+ // if it does, we update the database
+ $query = 'UPDATE #__users SET username='.$db->Quote($result->getDisplayIdentifier()).
+ ' WHERE username='.$db->Quote($credentials['username']);
+ $db->setQuery($query);
+ $db->query();
+ if (!$db->query()) {
+ $response->status = JAUTHENTICATE_STATUS_FAILURE;
+ $response->error_message = $db->getErrorMsg();
+ //break out of the switch if we hit an error with our query
+ break;
+ }
+ }
+ $response->username = $result->getDisplayIdentifier();
+ // we return the username provided by the openid provider
+ }
+ }
+ $response->status = JAUTHENTICATE_STATUS_SUCCESS;
+ $response->error_message = '';
+ if (!isset($sreg['email'])) {
+ $response->email = str_replace( array('http://', 'https://'), '', $response->username );
+ $response->email = str_replace( '/', '-', $response->email );
+ $response->email .= '@openid.';
+ } else {
+ $response->email = $sreg['email'];
+ }
+ $response->fullname = isset ($sreg['fullname']) ? $sreg['fullname'] : $response->username;
+ $response->language = isset ($sreg['language']) ? $sreg['language'] : '';
+ $response->timezone = isset ($sreg['timezone']) ? $sreg['timezone'] : '';
+ }
+ break;
+
+ case Auth_OpenID_CANCEL :
+ {
+ $response->status = JAUTHENTICATE_STATUS_CANCEL;
+ $response->error_message = 'Authentication cancelled';
+ }
+ break;
+
+ case Auth_OpenID_FAILURE :
+ {
+ $response->status = JAUTHENTICATE_STATUS_FAILURE;
+ $response->error_message = 'Authentication failed';
+ }
+ break;
+ }
+ }
+
+ // function
+}
diff --git a/oss/joomla/trunk/plugins/authentication/openid.xml b/oss/joomla/trunk/plugins/authentication/openid.xml
index 3494f812..6bbd7ed4 100644
--- a/oss/joomla/trunk/plugins/authentication/openid.xml
+++ b/oss/joomla/trunk/plugins/authentication/openid.xml
@@ -3,7 +3,7 @@
Authentication - OpenID
Joomla! Project
February 2006
- Copyright (C) 2005 - 2008 Open Source Matters. All rights reserved.
+ Copyright (C) 2005 - 2010 Open Source Matters. All rights reserved.
http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL
admin@joomla.org
www.joomla.org
@@ -12,22 +12,22 @@
openid.php
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
-
-
-
+
+
+
-
-
-
-
-
+
+
+
+
+
diff --git a/oss/joomla/trunk/plugins/content/emailcloak.php b/oss/joomla/trunk/plugins/content/emailcloak.php
index 19fa3722..1e6582be 100644
--- a/oss/joomla/trunk/plugins/content/emailcloak.php
+++ b/oss/joomla/trunk/plugins/content/emailcloak.php
@@ -1,166 +1,226 @@
-registerEvent('onPrepareContent', 'plgContentEmailCloak');
-
-/**
- * Plugin that cloaks all emails in content from spambots via Javascript.
- *
- * @param object|string An object with a "text" property or the string to be
- * cloaked.
- * @param array Additional parameters. See {@see plgEmailCloak()}.
- * @param int Optional page number. Unused. Defaults to zero.
- * @return boolean True on success.
- */
-function plgContentEmailCloak(&$row, &$params, $page=0)
-{
- if (is_object($row)) {
- return plgEmailCloak($row->text, $params);
- }
- return plgEmailCloak($row, $params);
-}
-
-/**
- * Genarate a search pattern based on link and text.
- *
- * @param string The target of an e-mail link.
- * @param string The text enclosed by the link.
- * @return string A regular expression that matches a link containing the
- * parameters.
- */
-function plgContentEmailCloak_searchPattern ($link, $text) {
- // anyText
- $pattern = '~(?:' . $text . '~i';
-
- return $pattern;
-}
-
-/**
- * Cloak all emails in text from spambots via Javascript.
- *
- * @param string The string to be cloaked.
- * @param array Additional parameters. Parameter "mode" (integer, default 1)
- * replaces addresses with "mailto:" links if nonzero.
- * @return boolean True on success.
- */
-function plgEmailCloak(&$text, &$params)
-{
-
- /*
- * Check for presence of {emailcloak=off} which is explicits disables this
- * bot for the item.
- */
- if (JString::strpos($text, '{emailcloak=off}') !== false) {
- $text = JString::str_ireplace('{emailcloak=off}', '', $text);
- return true;
- }
-
- // Simple performance check to determine whether bot should process further.
- if (JString::strpos($text, '@') === false) {
- return true;
- }
-
- $plugin = & JPluginHelper::getPlugin('content', 'emailcloak');
-
- // Load plugin params info
- $pluginParams = new JParameter($plugin->params);
- $mode = $pluginParams->def('mode', 1);
-
- // any@email.address.com
- $searchEmail = '([\w\.\-]+\@(?:[a-z0-9\.\-]+\.)+(?:[a-z0-9\-]{2,4}))';
- // any@email.address.com?subject=anyText
- $searchEmailLink = $searchEmail . '([?&][\x20-\x7f][^"<>]+)';
- // anyText
- $searchText = '([\x20-\x7f][^<>]+)';
-
- /*
- * Search for derivatives of link code email@amail.com
- */
- $pattern = plgContentEmailCloak_searchPattern($searchEmail, $searchEmail);
- while (preg_match($pattern, $text, $regs, PREG_OFFSET_CAPTURE)) {
- $mail = $regs[1][0];
- $mailText = $regs[2][0];
-
- // Check to see if mail text is different from mail addy
- $replacement = JHTML::_('email.cloak', $mail, $mode, $mailText);
-
- // Replace the found address with the js cloaked email
- $text = substr_replace($text, $replacement, $regs[0][1], strlen($regs[0][0]));
- }
-
- /*
- * Search for derivatives of link code
- * anytext
- */
- $pattern = plgContentEmailCloak_searchPattern($searchEmail, $searchText);
- while (preg_match($pattern, $text, $regs, PREG_OFFSET_CAPTURE)) {
- $mail = $regs[1][0];
- $mailText = $regs[2][0];
-
- $replacement = JHTML::_('email.cloak', $mail, $mode, $mailText, 0);
-
- // Replace the found address with the js cloaked email
- $text = substr_replace($text, $replacement, $regs[0][1], strlen($regs[0][0]));
- }
-
- /*
- * Search for derivatives of link code email@amail.com
- */
- $pattern = plgContentEmailCloak_searchPattern($searchEmailLink, $searchEmail);
- while (preg_match($pattern, $text, $regs, PREG_OFFSET_CAPTURE)) {
- $mail = $regs[1][0] . $regs[2][0];
- $mailText = $regs[3][0];
- // Needed for handling of Body parameter
- $mail = str_replace( '&', '&', $mail );
-
- // Check to see if mail text is different from mail addy
- $replacement = JHTML::_('email.cloak', $mail, $mode, $mailText);
-
- // Replace the found address with the js cloaked email
- $text = substr_replace($text, $replacement, $regs[0][1], strlen($regs[0][0]));
- }
-
- /*
- * Search for derivatives of link code anytext
- */
- $pattern = plgContentEmailCloak_searchPattern($searchEmailLink, $searchText);
- while (preg_match($pattern, $text, $regs, PREG_OFFSET_CAPTURE)) {
- $mail = $regs[1][0] . $regs[2][0];
- $mailText = $regs[3][0];
- // Needed for handling of Body parameter
- $mail = str_replace('&', '&', $mail);
-
- $replacement = JHTML::_('email.cloak', $mail, $mode, $mailText, 0);
-
- // Replace the found address with the js cloaked email
- $text = substr_replace($text, $replacement, $regs[0][1], strlen($regs[0][0]));
- }
-
- // Search for plain text email@amail.com
- $pattern = '~' . $searchEmail . '([^a-z0-9]|$)~i';
- while (preg_match($pattern, $text, $regs, PREG_OFFSET_CAPTURE)) {
- $mail = $regs[1][0];
- $replacement = JHTML::_('email.cloak', $mail, $mode);
-
- // Replace the found address with the js cloaked email
- $text = substr_replace($text, $replacement, $regs[1][1], strlen($mail));
- }
- return true;
-}
+registerEvent('onPrepareContent', 'plgContentEmailCloak');
+
+/**
+ * Plugin that cloaks all emails in content from spambots via Javascript.
+ *
+ * @param object|string An object with a "text" property or the string to be
+ * cloaked.
+ * @param array Additional parameters. See {@see plgEmailCloak()}.
+ * @param int Optional page number. Unused. Defaults to zero.
+ * @return boolean True on success.
+ */
+function plgContentEmailCloak(&$row, &$params, $page=0)
+{
+ if (is_object($row)) {
+ return plgEmailCloak($row->text, $params);
+ }
+ return plgEmailCloak($row, $params);
+}
+
+/**
+ * Genarate a search pattern based on link and text.
+ *
+ * @param string The target of an e-mail link.
+ * @param string The text enclosed by the link.
+ * @return string A regular expression that matches a link containing the
+ * parameters.
+ */
+function plgContentEmailCloak_searchPattern ($link, $text) {
+ // anyText
+ $pattern = '~(?:' . $text . '~i';
+
+ return $pattern;
+}
+
+/**
+ * Cloak all emails in text from spambots via Javascript.
+ *
+ * @param string The string to be cloaked.
+ * @param array Additional parameters. Parameter "mode" (integer, default 1)
+ * replaces addresses with "mailto:" links if nonzero.
+ * @return boolean True on success.
+ */
+function plgEmailCloak(&$text, &$params)
+{
+
+ /*
+ * Check for presence of {emailcloak=off} which is explicits disables this
+ * bot for the item.
+ */
+ if (JString::strpos($text, '{emailcloak=off}') !== false) {
+ $text = JString::str_ireplace('{emailcloak=off}', '', $text);
+ return true;
+ }
+
+ // Simple performance check to determine whether bot should process further.
+ if (JString::strpos($text, '@') === false) {
+ return true;
+ }
+
+ $plugin = & JPluginHelper::getPlugin('content', 'emailcloak');
+
+ // Load plugin params info
+ $pluginParams = new JParameter($plugin->params);
+ $mode = $pluginParams->def('mode', 1);
+
+ // split the string into parts to exclude strcipt tags from being handled
+ $text = explode( '', $str );
+ foreach ( $str_split as $j => $str_split_part ) {
+ if ( ( $j % 2 ) == 1 ) {
+ plgEmailCloakString( $str_split[$i], $mode );
+ }
+ }
+ $text[$i] = implode( '', $str_split );
+ }
+ }
+ $text = implode( '";
- return $txt;
- }
-
- /**
- * No WYSIWYG Editor - copy editor content to form field
- *
- * @param string The name of the editor
- */
- function onSave( $editor ) {
- return;
- }
-
- /**
- * No WYSIWYG Editor - get the editor content
- *
- * @param string The name of the editor
- */
- function onGetContent( $editor ) {
- return "document.getElementById( '$editor' ).value;\n";
- }
-
- /**
- * No WYSIWYG Editor - set the editor content
- *
- * @param string The name of the editor
- */
- function onSetContent( $editor, $html ) {
- return "document.getElementById( '$editor' ).value = $html;\n";
- }
-
- /**
- * No WYSIWYG Editor - display the editor
- *
- * @param string The name of the editor area
- * @param string The content of the field
- * @param string The name of the form field
- * @param string The width of the editor area
- * @param string The height of the editor area
- * @param int The number of columns for the editor area
- * @param int The number of rows for the editor area
- */
- function onDisplay( $name, $content, $width, $height, $col, $row, $buttons = true )
- {
- // Only add "px" to width and height if they are not given as a percentage
- if (is_numeric( $width )) {
- $width .= 'px';
- }
- if (is_numeric( $height )) {
- $height .= 'px';
- }
-
- $buttons = $this->_displayButtons($name, $buttons);
- $editor = "" . $buttons;
-
- return $editor;
- }
-
- function onGetInsertMethod($name)
- {
- $doc = & JFactory::getDocument();
-
- $js= "\tfunction jInsertEditorText( text, editor ) {
- insertAtCursor( document.getElementById(editor), text );
- }";
- $doc->addScriptDeclaration($js);
-
- return true;
- }
-
- function _displayButtons($name, $buttons)
- {
- // Load modal popup behavior
- JHTML::_('behavior.modal', 'a.modal-button');
-
- $args['name'] = $name;
- $args['event'] = 'onGetInsertMethod';
-
- $return = '';
- $results[] = $this->update($args);
- foreach ($results as $result) {
- if (is_string($result) && trim($result)) {
- $return .= $result;
- }
- }
-
- if(!empty($buttons))
- {
- $results = $this->_subject->getButtons($name, $buttons);
-
- /*
- * This will allow plugins to attach buttons or change the behavior on the fly using AJAX
- */
- $return .= "\n
\n";
- }
-
- return $return;
- }
+
+ function insertAtCursor(myField, myValue) {
+ if (document.selection) {
+ // IE support
+ myField.focus();
+ sel = document.selection.createRange();
+ sel.text = myValue;
+ } else if (myField.selectionStart || myField.selectionStart == '0') {
+ // MOZILLA/NETSCAPE support
+ var startPos = myField.selectionStart;
+ var endPos = myField.selectionEnd;
+ myField.value = myField.value.substring(0, startPos)
+ + myValue
+ + myField.value.substring(endPos, myField.value.length);
+ } else {
+ myField.value += myValue;
+ }
+ }
+ ";
+ return $txt;
+ }
+
+ /**
+ * No WYSIWYG Editor - copy editor content to form field
+ *
+ * @param string The name of the editor
+ */
+ function onSave( $editor ) {
+ return;
+ }
+
+ /**
+ * No WYSIWYG Editor - get the editor content
+ *
+ * @param string The name of the editor
+ */
+ function onGetContent( $editor ) {
+ return "document.getElementById( '$editor' ).value;\n";
+ }
+
+ /**
+ * No WYSIWYG Editor - set the editor content
+ *
+ * @param string The name of the editor
+ */
+ function onSetContent( $editor, $html ) {
+ return "document.getElementById( '$editor' ).value = $html;\n";
+ }
+
+ /**
+ * No WYSIWYG Editor - display the editor
+ *
+ * @param string The name of the editor area
+ * @param string The content of the field
+ * @param string The name of the form field
+ * @param string The width of the editor area
+ * @param string The height of the editor area
+ * @param int The number of columns for the editor area
+ * @param int The number of rows for the editor area
+ */
+ function onDisplay( $name, $content, $width, $height, $col, $row, $buttons = true )
+ {
+ // Only add "px" to width and height if they are not given as a percentage
+ if (is_numeric( $width )) {
+ $width .= 'px';
+ }
+ if (is_numeric( $height )) {
+ $height .= 'px';
+ }
+
+ $buttons = $this->_displayButtons($name, $buttons);
+ $editor = "" . $buttons;
+
+ return $editor;
+ }
+
+ function onGetInsertMethod($name)
+ {
+ $doc = & JFactory::getDocument();
+
+ $js= "\tfunction jInsertEditorText( text, editor ) {
+ insertAtCursor( document.getElementById(editor), text );
+ }";
+ $doc->addScriptDeclaration($js);
+
+ return true;
+ }
+
+ function _displayButtons($name, $buttons)
+ {
+ // Load modal popup behavior
+ JHTML::_('behavior.modal', 'a.modal-button');
+
+ $args['name'] = $name;
+ $args['event'] = 'onGetInsertMethod';
+
+ $return = '';
+ $results[] = $this->update($args);
+ foreach ($results as $result) {
+ if (is_string($result) && trim($result)) {
+ $return .= $result;
+ }
+ }
+
+ if(!empty($buttons))
+ {
+ $results = $this->_subject->getButtons($name, $buttons);
+
+ /*
+ * This will allow plugins to attach buttons or change the behavior on the fly using AJAX
+ */
+ $return .= "\n\n";
+ }
+
+ return $return;
+ }
}
\ No newline at end of file
diff --git a/oss/joomla/trunk/plugins/editors/none.xml b/oss/joomla/trunk/plugins/editors/none.xml
index 0f05f9d0..b2778974 100644
--- a/oss/joomla/trunk/plugins/editors/none.xml
+++ b/oss/joomla/trunk/plugins/editors/none.xml
@@ -6,8 +6,8 @@
N/A
- http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL
- LGPL
+ Copyright (C) 2005 - 2010 Open Source Matters. All rights reserved.
+ http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL
This loads a basic text entry field
none.php
diff --git a/oss/joomla/trunk/plugins/editors/tinymce.php b/oss/joomla/trunk/plugins/editors/tinymce.php
index 340dd41b..6a11196d 100644
--- a/oss/joomla/trunk/plugins/editors/tinymce.php
+++ b/oss/joomla/trunk/plugins/editors/tinymce.php
@@ -1,652 +1,717 @@
-params->get('mode','advanced');
- $theme = array('simple' => 'simple','advanced' => 'advanced','extended' => 'advanced');
- $skin = $this->params->get( 'skin', '0' );
- switch ($skin)
- {
- case '3':
- $skin = "skin : \"o2k7\", skin_variant : \"black\",";
- break;
- case '2':
- $skin = "skin : \"o2k7\", skin_variant : \"silver\",";
- break;
- case '1':
- $skin = "skin : \"o2k7\",";
- break;
- case '0':
- default:
- $skin = "skin : \"default\",";
- }
- $compressed = $this->params->def( 'compressed', 0 );
-
- $cleanup_startup = $this->params->def( 'cleanup_startup', 0 );
- $cleanup_save = $this->params->def( 'cleanup_save', 2 );
- $entity_encoding = $this->params->def( 'entity_encoding', 'raw' );
- if ( $cleanup_startup ) {
- $cleanup_startup = 'true';
- } else {
- $cleanup_startup = 'false';
- }
- switch ( $cleanup_save ) {
- case '0': /* Never clean up on save */
- $cleanup = 'false';
- break;
- case '1': /* Clean up front end edits only */
- if ($mainframe->isadmin())
- $cleanup = 'false';
- else
- $cleanup = 'true';
- break;
- default: /* Always clean up on save */
- $cleanup = 'true';
- break;
- }
-
- $langMode = $this->params->def( 'lang_mode', 0 );
- $langPrefix = $this->params->def( 'lang_code', 'en' );
- if ($langMode) {
- $langPrefix = substr( $language->getTag(), 0, strpos( $language->getTag(), '-' ) );
- }
- if ($language->isRTL()) {
- $text_direction = 'rtl';
- } else {
- $text_direction = 'ltr';
- }
-
- $content_css = $this->params->def( 'content_css', 1 );
- $content_css_custom = $this->params->def( 'content_css_custom', '' );
- // loading of css file for `styles` dropdown
- if ( $content_css_custom ) {
- $content_css = 'content_css : "'. $content_css_custom .'", ';
- }
- else {
- /*
- * Lets get the default template for the site application
- */
- $db =& JFactory::getDBO();
- $query = 'SELECT template'
- . ' FROM #__templates_menu'
- . ' WHERE client_id = 0'
- . ' AND menuid = 0'
- ;
- $db->setQuery( $query );
- $template = $db->loadResult();
-
- if($content_css)
- {
- $file_path = JPATH_SITE .'/templates/'. $template .'/css/';
- // Try for site css
- $file_name = "template";
-
- if ($language->isRTL()) {
- $file_name .= "_rtl.css";
- } else {
- $file_name .= ".css";
- }
-
- if ( file_exists( $file_path .DS. $file_name ) ) {
- $content_css = 'content_css : "' . JURI::root() .'templates/'. $template . '/css/'.$file_name.', ' . JURI::root() .'templates/system/css/editor.css"';
- } else {
- $content_css = 'content_css : "' . JURI::root() .'templates/system/css/editor.css"';
- }
- } else {
- $content_css = '';
- }
- }
-
- $relative_urls = $this->params->def( 'relative_urls', '1' );
- if ( $relative_urls ) { // relative
- $relative_urls = "true";
- } else { // absolute
- $relative_urls = "false";
- }
-
- $newlines = $this->params->def( 'newlines', 0 );
- if ( $newlines ) { // br
- $forcenewline = "force_br_newlines : \"true\", force_p_newlines : \"false\", forced_root_block : '',";
- } else { // p
- $forcenewline = "force_br_newlines : \"false\", force_p_newlines : \"true\", forced_root_block : 'p',";
- }
- $invalid_elements = $this->params->def( 'invalid_elements', 'script,applet,iframe' );
- $extended_elements = $this->params->def( 'extended_elements', '' );
-
-
- // theme_advanced_* settings
- $toolbar = $this->params->def( 'toolbar', 'top' );
- $toolbar_align = $this->params->def( 'toolbar_align', 'left' );
- $html_height = $this->params->def( 'html_height', '550' );
- $html_width = $this->params->def( 'html_width', '750' );
- $element_path = '';
- if ($this->params->get('element_path', 1)) {
- $element_path = "theme_advanced_statusbar_location : \"bottom\", theme_advanced_path : true";
- } else {
- $element_path = "theme_advanced_statusbar_location : \"none\", theme_advanced_path : false";
- }
-
- $buttons1_add_before = $buttons1_add = array();
- $buttons2_add_before = $buttons2_add = array();
- $buttons3_add_before = $buttons3_add = array();
- $buttons4 = array();
- $plugins = array();
- if( $extended_elements != "" ) $elements = explode( ',', $extended_elements );
-
- //Initial values for buttons
- array_push($buttons2_add_before,'cut','copy','paste');
- array_push($buttons2_add,'|');
-
- // Plugins
-
- // fonts
- $fonts = $this->params->def( 'fonts', 1 );
- if ( $fonts ) {
- $buttons1_add[] = 'fontselect,fontsizeselect';
- }
-
- // paste
- $paste = $this->params->def( 'paste', 1 );
- if ( $paste ) {
- $plugins[] = 'paste';
- $buttons2_add_before[] = 'pastetext,pasteword,selectall';
- }
-
- // search & replace
- $searchreplace = $this->params->def( 'searchreplace', 1 );
- if ( $searchreplace ) {
- $plugins[] = 'searchreplace';
- $buttons2_add_before[] = '|,search,replace,|';
- }
-
- // insert date and/or time plugin
- $insertdate = $this->params->def( 'insertdate', 1 );
- $format_date = $this->params->def( 'format_date', '%Y-%m-%d' );
- $inserttime = $this->params->def( 'inserttime', 1 );
- $format_time = $this->params->def( 'format_time', '%H:%M:%S' );
- if ( $insertdate or $inserttime ) {
- $plugins[] = 'insertdatetime';
- if ( $insertdate ) {
- $buttons2_add[] = 'insertdate';
- }
- if ( $inserttime ) {
- $buttons2_add[] = 'inserttime';
- }
- }
-
- // colors
- $colors = $this->params->def( 'colors', 1 );
- if ( $colors ) {
- $buttons2_add[] = 'forecolor,backcolor';
- }
-
- // table
- $table = $this->params->def( 'table', 1 );
- if ( $table ) {
- $plugins[] = 'table';
- $buttons3_add_before[] = 'tablecontrols';
- }
-
- // emotions
- $smilies = $this->params->def( 'smilies', 1 );
- if ( $smilies ) {
- $plugins[] = 'emotions';
- $buttons3_add[] = 'emotions';
- }
-
- //media plugin
- $media = $this->params->def( 'media', 1 );
- if ( $media ) {
- $plugins[] = 'media';
- $buttons3_add[] = 'media';
- }
-
- // horizontal line
- $hr = $this->params->def( 'hr', 1 );
- if ( $hr ) {
- $plugins[] = 'advhr';
- $elements[] = 'hr[id|title|alt|class|width|size|noshade]';
- $buttons3_add[] = 'advhr';
- } else {
- $elements[] = 'hr[id|class|title|alt]';
- }
-
- // rtl/ltr buttons
- $directionality = $this->params->def( 'directionality', 1 );
- if ( $directionality ) {
- $plugins[] = 'directionality';
- $buttons3_add[] = 'ltr,rtl';
- }
-
- // fullscreen
- $fullscreen = $this->params->def( 'fullscreen', 1 );
- if ( $fullscreen ) {
- $plugins[] = 'fullscreen';
- $buttons3_add[] = 'fullscreen';
- }
-
- // layer
- $layer = $this->params->def( 'layer', 1 );
- if ( $layer ) {
- $plugins[] = 'layer';
- $buttons4[] = 'insertlayer';
- $buttons4[] = 'moveforward';
- $buttons4[] = 'movebackward';
- $buttons4[] = 'absolute';
- }
-
- // style
- $style = $this->params->def( 'style', 1 );
- if ( $style ) {
- $plugins[] = 'style';
- $buttons4[] = 'styleprops';
- }
-
- // XHTMLxtras
- $xhtmlxtras = $this->params->def( 'xhtmlxtras', 1 );
- if ( $xhtmlxtras ) {
- $plugins[] = 'xhtmlxtras';
- $buttons4[] = 'cite,abbr,acronym,ins,del,attribs';
- }
-
- // visualchars
- $visualchars = $this->params->def( 'visualchars', 1 );
- if ( $template ) {
- $plugins[] = 'visualchars';
- $buttons4[] = 'visualchars';
- }
-
- // visualchars
- $nonbreaking = $this->params->def( 'nonbreaking', 1 );
- if ( $template ) {
- $plugins[] = 'nonbreaking';
- $buttons4[] = 'nonbreaking';
- }
-
- // template
- $template = $this->params->def( 'template', 1 );
- if ( $template ) {
- $plugins[] = 'template';
- $buttons4[] = 'template';
- }
-
- // advimage
- $advimage = $this->params->def( 'advimage', 1 );
- if ( $advimage ) {
- $plugins[] = 'advimage';
- $elements[] = 'img[class|src|border=0|alt|title|hspace|vspace|width|height|align|onmouseover|onmouseout|name]';
- }
-
- // advlink
- $advlink = $this->params->def( 'advlink', 1 );
- if ( $advlink ) {
- $plugins[] = 'advlink';
- $elements[] = 'a[class|name|href|target|title|onclick|rel]';
- }
-
- // autosave
- $autosave = $this->params->def( 'autosave', 1 );
- if ( $autosave ) {
- $plugins[] = 'autosave';
- }
-
- // context menu
- $contextmenu = $this->params->def( 'contextmenu', 1 );
- if ( $contextmenu ) {
- $plugins[] = 'contextmenu';
- }
-
- // inline popups
- $inlinepopups = $this->params->def( 'inlinepopups', 1 );
- if ( $inlinepopups ) {
- $plugins[] = 'inlinepopups';
- $dialog_type = "dialog_type : \"modal\",";
- } else {
- $dialog_type = "";
- }
-
- // Safari compatibility
- $safari = $this->params->def( 'safari', 0 );
- if ( $safari ) {
- $plugins[] = 'safari';
- }
-
- $custom_plugin = $this->params->def( 'custom_plugin', '' );
- if ($custom_plugin != "") {
- $plugins[] = $custom_plugin;
- }
-
- $custom_button = $this->params->def( 'custom_button', '' );
- if ($custom_button != "") {
- $buttons4[] = $custom_button;
- }
-
- // Prepare config variables
- $buttons1_add_before = implode( ',', $buttons1_add_before );
- $buttons2_add_before = implode( ',', $buttons2_add_before );
- $buttons3_add_before = implode( ',', $buttons3_add_before );
- $buttons1_add = implode( ',', $buttons1_add );
- $buttons2_add = implode( ',', $buttons2_add );
- $buttons3_add = implode( ',', $buttons3_add );
- $buttons4 = implode( ',', $buttons4 );
- $plugins = implode( ',', $plugins );
- $elements = implode( ',', $elements );
-
- switch($mode) {
- case 'simple': /* Simple mode*/
- if ($compressed) {
- $load = "\t\n";
- $load .= "\t";
- } else {
- $load = "\t\n";
- }
- $return = $load .
- "\t";
- break;
-
- case 'advanced': /* Advanced mode*/
- if ($compressed) {
- $load = "\t\n";
- $load .= "\t";
- } else {
- $load = "\t\n";
- }
- $return = $load .
- "\t";
- break;
-
- case 'extended': /* Extended mode*/
- if ($compressed) {
- $load = "\t\n";
- $load .= "\t";
- } else {
- $load = "\t\n";
- }
- $return = $load .
- "\t";
- break;
- }
-
- return $return;
- }
-
- /**
- * TinyMCE WYSIWYG Editor - get the editor content
- *
- * @param string The name of the editor
- */
- function onGetContent( $editor ) {
- return "tinyMCE.activeEditor.getContent();";
- }
-
- /**
- * TinyMCE WYSIWYG Editor - set the editor content
- *
- * @param string The name of the editor
- */
- function onSetContent( $editor, $html ) {
- return "tinyMCE.activeEditor.setContent(".$html.");";
- }
-
- /**
- * TinyMCE WYSIWYG Editor - copy editor content to form field
- *
- * @param string The name of the editor
- */
- function onSave( $editor ) {
- return "tinyMCE.triggerSave();";
- }
-
- /**
- * TinyMCE WYSIWYG Editor - display the editor
- *
- * @param string The name of the editor area
- * @param string The content of the field
- * @param string The width of the editor area
- * @param string The height of the editor area
- * @param int The number of columns for the editor area
- * @param int The number of rows for the editor area
- * @param mixed Can be boolean or array.
- */
- function onDisplay( $name, $content, $width, $height, $col, $row, $buttons = true)
- {
- // Only add "px" to width and height if they are not given as a percentage
- if (is_numeric( $width )) {
- $width .= 'px';
- }
- if (is_numeric( $height )) {
- $height .= 'px';
- }
-
- $editor = "\n" .
- $this->_displayButtons($name, $buttons) .
- $this->_toogleButton($name);
-
- return $editor;
- }
-
- function onGetInsertMethod($name)
- {
- $doc = & JFactory::getDocument();
-
- $js= "function jInsertEditorText( text, editor ) {
- tinyMCE.execInstanceCommand(editor, 'mceInsertContent',false,text);
- }";
- $doc->addScriptDeclaration($js);
-
- return true;
- }
-
- function _displayButtons($name, $buttons)
- {
- // Load modal popup behavior
- JHTML::_('behavior.modal', 'a.modal-button');
-
- $args['name'] = $name;
- $args['event'] = 'onGetInsertMethod';
-
- $return = '';
- $results[] = $this->update($args);
- foreach ($results as $result) {
- if (is_string($result) && trim($result)) {
- $return .= $result;
- }
- }
-
- if(!empty($buttons))
- {
- $results = $this->_subject->getButtons($name, $buttons);
-
- /*
- * This will allow plugins to attach buttons or change the behavior on the fly using AJAX
- */
- $return .= "\n\n";
- }
-
- return $return;
- }
-
- function _toogleButton($name)
- {
- $return = '';
- $return .= "\n\n";
- $return .= "
";
- $return .= "
\n";
- return $return;
- }
-}
+params->get('mode','advanced');
+ $theme = array('simple' => 'simple','advanced' => 'advanced','extended' => 'advanced');
+ $skin = $this->params->get( 'skin', '0' );
+ switch ($skin)
+ {
+ case '3':
+ $skin = "skin : \"o2k7\", skin_variant : \"black\",";
+ break;
+ case '2':
+ $skin = "skin : \"o2k7\", skin_variant : \"silver\",";
+ break;
+ case '1':
+ $skin = "skin : \"o2k7\",";
+ break;
+ case '0':
+ default:
+ $skin = "skin : \"default\",";
+ }
+ $compressed = $this->params->def('compressed', 0);
+ $cleanup_startup = $this->params->def('cleanup_startup', 0);
+ $cleanup_save = $this->params->def('cleanup_save', 2);
+ $entity_encoding = $this->params->def('entity_encoding', 'raw');
+
+ if ($cleanup_startup) {
+ $cleanup_startup = 'true';
+ } else {
+ $cleanup_startup = 'false';
+ }
+ switch ($cleanup_save) {
+ case '0': /* Never clean up on save */
+ $cleanup = 'false';
+ break;
+ case '1': /* Clean up front end edits only */
+ if ($mainframe->isadmin())
+ $cleanup = 'false';
+ else
+ $cleanup = 'true';
+ break;
+ default: /* Always clean up on save */
+ $cleanup = 'true';
+ break;
+ }
+
+ $langMode = $this->params->def('lang_mode', 0);
+ $langPrefix = $this->params->def('lang_code', 'en');
+ if ($langMode) {
+ $langPrefix = substr($language->getTag(), 0, strpos( $language->getTag(), '-' ));
+ }
+ if ($language->isRTL()) {
+ $text_direction = 'rtl';
+ } else {
+ $text_direction = 'ltr';
+ }
+
+ $use_content_css = $this->params->def('content_css', 1);
+ $content_css_custom = $this->params->def('content_css_custom', '');
+
+ /*
+ * Lets get the default template for the site application
+ */
+ $db =& JFactory::getDBO();
+ $query = 'SELECT template'
+ . ' FROM #__templates_menu'
+ . ' WHERE client_id = 0'
+ . ' AND menuid = 0'
+ ;
+ $db->setQuery( $query );
+ $template = $db->loadResult();
+
+ $content_css = '';
+
+ $templates_path = JPATH_SITE.DS.'templates';
+ // loading of css file for 'styles' dropdown
+ if ( $content_css_custom )
+ {
+ // If URL, just pass it to $content_css
+ if (strpos( $content_css_custom, 'http' ) !==false) {
+ $content_css = 'content_css : "'. $content_css_custom .'",';
+ // If it is not a URL, assume it is a file name in the current template folder
+ } else {
+ $content_css = 'content_css : "'. JURI::root() .'templates/'. $template . '/css/'. $content_css_custom .'",';
+
+ // Issue warning notice if the file is not found (but pass name to $content_css anyway to avoid TinyMCE error
+ if (!file_exists($templates_path.DS.$template.DS.'css'.DS.$content_css_custom)) {
+ $msg = sprintf (JText::_('CUSTOMCSSFILENOTPRESENT'), $content_css_custom);
+ JError::raiseNotice('SOME_ERROR_CODE', $msg);
+ }
+ }
+ }
+ else
+ {
+ // process when use_content_css is Yes and no custom file given
+ if($use_content_css) {
+
+ // first check templates folder for default template
+ // if no editor.css file in templates folder, check system template folder
+ if (!file_exists($templates_path.DS.$template.DS.'css'.DS.'editor.css')) {
+ $template = 'system';
+
+ // if no editor.css file in system folder, show alert
+ if (!file_exists($templates_path.DS.'system'.DS.'css'.DS.'editor.css'))
+ {
+ JError::raiseNotice('SOME_ERROR_CODE', JText::_('TEMPLATECSSFILENOTPRESENT'));
+ } else {
+ $content_css = 'content_css : "' . JURI::root() .'templates/system/css/editor.css",';
+ }
+ } else {
+ $content_css = 'content_css : "' . JURI::root() .'templates/'. $template . '/css/editor.css",';
+ }
+ }
+ }
+
+ $relative_urls = $this->params->def('relative_urls', '1');
+ if ( $relative_urls ) { // relative
+ $relative_urls = "true";
+ } else { // absolute
+ $relative_urls = "false";
+ }
+
+ $newlines = $this->params->def('newlines', 0);
+ if ($newlines) { // br
+ $forcenewline = "force_br_newlines : true, force_p_newlines : false, forced_root_block : '',";
+ } else { // p
+ $forcenewline = "force_br_newlines : false, force_p_newlines : true, forced_root_block : 'p',";
+ }
+ $invalid_elements = $this->params->def('invalid_elements', 'script,applet,iframe');
+ $extended_elements = $this->params->def('extended_elements', '');
+
+ // theme_advanced_* settings
+ $toolbar = $this->params->def('toolbar', 'top');
+ $toolbar_align = $this->params->def('toolbar_align', 'left');
+ $html_height = $this->params->def('html_height', '550');
+ $html_width = $this->params->def('html_width', '750');
+ $element_path = '';
+ if ($this->params->get('element_path', 1)) {
+ $element_path = 'theme_advanced_statusbar_location : "bottom", theme_advanced_path : true';
+ } else {
+ $element_path = 'theme_advanced_statusbar_location : "none", theme_advanced_path : false';
+ }
+
+ $buttons1_add_before = $buttons1_add = array();
+ $buttons2_add_before = $buttons2_add = array();
+ $buttons3_add_before = $buttons3_add = array();
+ $buttons4 = array();
+ $plugins = array();
+ if($extended_elements != "") $elements = explode(',', $extended_elements);
+
+ //Initial values for buttons
+ array_push($buttons4,'cut','copy','paste');
+ //array_push($buttons4,'|');
+
+ // Plugins
+
+ // fonts
+ $fonts = $this->params->def( 'fonts', 1 );
+ if ($fonts) {
+ $buttons1_add[] = 'fontselect,fontsizeselect';
+ }
+
+ // paste
+ $paste = $this->params->def('paste', 1);
+ if ($paste) {
+ $plugins[] = 'paste';
+ $buttons4[] = 'pastetext';
+ $buttons4[] = 'pasteword';
+ $buttons4[] = 'selectall,|';
+ }
+
+ // search & replace
+ $searchreplace = $this->params->def('searchreplace', 1);
+ if ($searchreplace) {
+ $plugins[] = 'searchreplace';
+ $buttons2_add_before[] = 'search,replace,|';
+ }
+
+ // insert date and/or time plugin
+ $insertdate = $this->params->def('insertdate', 1);
+ $format_date = $this->params->def('format_date', '%Y-%m-%d');
+ $inserttime = $this->params->def('inserttime', 1);
+ $format_time = $this->params->def('format_time', '%H:%M:%S');
+ if ($insertdate or $inserttime) {
+ $plugins[] = 'insertdatetime';
+ if ($insertdate) {
+ $buttons2_add[] = 'insertdate';
+ }
+ if ($inserttime) {
+ $buttons2_add[] = 'inserttime';
+ }
+ }
+
+ // colors
+ $colors = $this->params->def('colors', 1);
+ if ($colors) {
+ $buttons2_add[] = 'forecolor,backcolor';
+ }
+
+ // table
+ $table = $this->params->def('table', 1);
+ if ($table) {
+ $plugins[] = 'table';
+ $buttons3_add_before[] = 'tablecontrols';
+ }
+
+ // emotions
+ $smilies = $this->params->def('smilies', 1);
+ if ($smilies) {
+ $plugins[] = 'emotions';
+ $buttons3_add[] = 'emotions';
+ }
+
+ //media plugin
+ $media = $this->params->def('media', 1);
+ if ($media) {
+ $plugins[] = 'media';
+ $buttons3_add[] = 'media';
+ }
+
+ // horizontal line
+ $hr = $this->params->def('hr', 1);
+ if ($hr) {
+ $plugins[] = 'advhr';
+ $elements[] = 'hr[id|title|alt|class|width|size|noshade|style]';
+ $buttons3_add[] = 'advhr';
+ } else {
+ $elements[] = 'hr[id|class|title|alt]';
+ }
+
+ // rtl/ltr buttons
+ $directionality = $this->params->def('directionality', 1);
+ if ($directionality) {
+ $plugins[] = 'directionality';
+ $buttons3_add[] = 'ltr,rtl';
+ }
+
+ // fullscreen
+ $fullscreen = $this->params->def('fullscreen', 1);
+ if ($fullscreen) {
+ $plugins[] = 'fullscreen';
+ $buttons2_add[] = 'fullscreen';
+ }
+
+ // layer
+ $layer = $this->params->def('layer', 1);
+ if ($layer) {
+ $plugins[] = 'layer';
+ $buttons4[] = 'insertlayer';
+ $buttons4[] = 'moveforward';
+ $buttons4[] = 'movebackward';
+ $buttons4[] = 'absolute';
+ }
+
+ // style
+ $style = $this->params->def('style', 1);
+ if ($style) {
+ $plugins[] = 'style';
+ $buttons4[] = 'styleprops';
+ }
+
+ // XHTMLxtras
+ $xhtmlxtras = $this->params->def('xhtmlxtras', 1);
+ if ($xhtmlxtras) {
+ $plugins[] = 'xhtmlxtras';
+ $buttons4[] = 'cite,abbr,acronym,ins,del,attribs';
+ }
+
+ // visualchars
+ $visualchars = $this->params->def('visualchars', 1);
+ if ($visualchars) {
+ $plugins[] = 'visualchars';
+ $buttons4[] = 'visualchars';
+ }
+
+ // non-breaking
+ $nonbreaking = $this->params->def('nonbreaking', 1);
+ if ($nonbreaking) {
+ $plugins[] = 'nonbreaking';
+ $buttons4[] = 'nonbreaking';
+ }
+
+ // blockquote
+ $blockquote = $this->params->def( 'blockquote', 1 );
+ if ( $blockquote ) {
+ $plugins[] = 'blockquote';
+ $buttons4[] = 'blockquote';
+ }
+
+ // template
+ $template = $this->params->def('template', 1);
+ if ($template) {
+ $plugins[] = 'template';
+ $buttons4[] = 'template';
+ }
+
+ // advimage
+ $advimage = $this->params->def('advimage', 1);
+ if ($advimage) {
+ $plugins[] = 'advimage';
+ $elements[] = 'img[class|src|border=0|alt|title|hspace|vspace|width|height|align|onmouseover|onmouseout|name|style]';
+ }
+
+ // advlink
+ $advlink = $this->params->def('advlink', 1);
+ if ($advlink) {
+ $plugins[] = 'advlink';
+ $elements[] = 'a[id|class|name|href|target|title|onclick|rel|style]';
+ }
+
+ // autosave
+ $autosave = $this->params->def('autosave', 1);
+ if ($autosave) {
+ $plugins[] = 'autosave';
+ }
+
+ // context menu
+ $contextmenu = $this->params->def('contextmenu', 1);
+ if ($contextmenu) {
+ $plugins[] = 'contextmenu';
+ }
+
+ // inline popups
+ $inlinepopups = $this->params->def('inlinepopups', 1);
+ if ($inlinepopups) {
+ $plugins[] = 'inlinepopups';
+ $dialog_type = "dialog_type : \"modal\",";
+ } else {
+ $dialog_type = "";
+ }
+
+ // Safari compatibility
+ $safari = $this->params->def('safari', 0);
+ if ($safari) {
+ $plugins[] = 'safari';
+ }
+
+ $custom_plugin = $this->params->def('custom_plugin', '');
+ if ($custom_plugin != "") {
+ $plugins[] = $custom_plugin;
+ }
+
+ $custom_button = $this->params->def('custom_button', '');
+ if ($custom_button != "") {
+ $buttons4[] = $custom_button;
+ }
+
+ // Prepare config variables
+ $buttons1_add_before = implode(',', $buttons1_add_before);
+ $buttons2_add_before = implode(',', $buttons2_add_before);
+ $buttons3_add_before = implode(',', $buttons3_add_before);
+ $buttons1_add = implode(',', $buttons1_add);
+ $buttons2_add = implode(',', $buttons2_add);
+ $buttons3_add = implode(',', $buttons3_add);
+ $buttons4 = implode(',', $buttons4);
+ $plugins = implode(',', $plugins);
+ $elements = implode(',', $elements);
+
+ switch($mode) {
+ case 'simple': /* Simple mode*/
+ if ($compressed) {
+ $load = "\t\n";
+ $load .= "\t";
+ } else {
+ $load = "\t\n";
+ }
+ $return = $load .
+ "\t";
+ break;
+
+ case 'advanced': /* Advanced mode*/
+ if ($compressed) {
+ $load = "\t\n";
+ $load .= "\t";
+ } else {
+ $load = "\t\n";
+ }
+ $return = $load .
+ "\t";
+ break;
+
+ case 'extended': /* Extended mode*/
+ if ($compressed) {
+ $load = "\t\n";
+ $load .= "\t";
+ } else {
+ $load = "\t\n";
+ }
+ $return = $load .
+ "\t";
+ break;
+ }
+
+ return $return;
+ }
+
+ /**
+ * TinyMCE WYSIWYG Editor - get the editor content
+ *
+ * @param string The name of the editor
+ */
+ function onGetContent( $editor ) {
+ return 'tinyMCE.get(\''.$editor.'\').getContent();';
+ }
+
+ /**
+ * TinyMCE WYSIWYG Editor - set the editor content
+ *
+ * @param string The name of the editor
+ */
+ function onSetContent($editor, $html) {
+ return 'tinyMCE.get(\''.$editor.'\').setContent('.$html.');';
+ }
+
+ /**
+ * TinyMCE WYSIWYG Editor - copy editor content to form field
+ *
+ * @param string The name of the editor
+ */
+ function onSave($editor) {
+ return 'if (tinyMCE.get("'.$editor.'").isHidden()) {tinyMCE.get("'.$editor.'").show()}; tinyMCE.get("'.$editor.'").save();';
+ }
+
+ /**
+ * TinyMCE WYSIWYG Editor - display the editor
+ *
+ * @param string The name of the editor area
+ * @param string The content of the field
+ * @param string The width of the editor area
+ * @param string The height of the editor area
+ * @param int The number of columns for the editor area
+ * @param int The number of rows for the editor area
+ * @param mixed Can be boolean or array.
+ */
+ function onDisplay($name, $content, $width, $height, $col, $row, $buttons = true)
+ {
+ // Only add "px" to width and height if they are not given as a percentage
+ if (is_numeric( $width )) {
+ $width .= 'px';
+ }
+ if (is_numeric( $height )) {
+ $height .= 'px';
+ }
+
+ $editor = "\n" .
+ $this->_displayButtons($name, $buttons) .
+ $this->_toogleButton($name);
+
+ return $editor;
+ }
+
+ function onGetInsertMethod($name)
+ {
+ $doc =& JFactory::getDocument();
+
+ $js= "
+ function isBrowserIE() {
+ return navigator.appName==\"Microsoft Internet Explorer\";
+ }
+
+ function jInsertEditorText( text, editor ) {
+ if (isBrowserIE()) {
+ if (window.parent.tinyMCE) {
+ window.parent.tinyMCE.selectedInstance.selection.moveToBookmark(window.parent.global_ie_bookmark);
+ }
+ }
+ tinyMCE.execInstanceCommand(editor, 'mceInsertContent',false,text);
+ }
+
+ var global_ie_bookmark = false;
+
+ function IeCursorFix() {
+ if (isBrowserIE()) {
+ tinyMCE.execCommand('mceInsertContent', false, '');
+ global_ie_bookmark = tinyMCE.activeEditor.selection.getBookmark(false);
+ }
+ return true;
+ }";
+
+ $doc->addScriptDeclaration($js);
+
+ return true;
+ }
+
+ function _displayButtons($name, $buttons)
+ {
+ // Load modal popup behavior
+ JHTML::_('behavior.modal', 'a.modal-button');
+
+ $args['name'] = $name;
+ $args['event'] = 'onGetInsertMethod';
+
+ $return = '';
+ $results[] = $this->update($args);
+ foreach ($results as $result) {
+ if (is_string($result) && trim($result)) {
+ $return .= $result;
+ }
+ }
+
+ if(!empty($buttons))
+ {
+ $results = $this->_subject->getButtons($name, $buttons);
+
+ /*
+ * This will allow plugins to attach buttons or change the behavior on the fly using AJAX
+ */
+ $return .= "\n\n";
+ }
+
+ return $return;
+ }
+
+ function _toogleButton($name)
+ {
+ $return = '';
+ $return .= "\n\n";
+ $return .= "
";
+ $return .= "
\n";
+ return $return;
+ }
+}
diff --git a/oss/joomla/trunk/plugins/editors/tinymce.xml b/oss/joomla/trunk/plugins/editors/tinymce.xml
index c2c6c474..53afb467 100644
--- a/oss/joomla/trunk/plugins/editors/tinymce.xml
+++ b/oss/joomla/trunk/plugins/editors/tinymce.xml
@@ -1,198 +1,202 @@
-
-
- Editor - TinyMCE 3
- 3.2.4.1
- 2005-2009
- Moxiecode Systems AB
- N/A
- tinymce.moxiecode.com/
- Moxiecode Systems AB
- LGPL
- DESCTINYMCE
-
- tinymce3.php
- tinymce3
-
-
- en-GB.plg_editors_tinymce3.ini
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+ Editor - TinyMCE 3
+ 3.2.6
+ 2005-2009
+ Moxiecode Systems AB
+ N/A
+ tinymce.moxiecode.com/
+ Moxiecode Systems AB
+ LGPL
+ DESCTINYMCE
+
+ tinymce.php
+ tinymce
+
+
+ en-GB.plg_editors_tinymce.ini
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/oss/joomla/trunk/plugins/editors/tinymce/jscripts/tiny_mce/plugins/_template/langs/en.js b/oss/joomla/trunk/plugins/editors/tinymce/jscripts/tiny_mce/plugins/_template/langs/en.js
index 2c340769..1d010058 100644
--- a/oss/joomla/trunk/plugins/editors/tinymce/jscripts/tiny_mce/plugins/_template/langs/en.js
+++ b/oss/joomla/trunk/plugins/editors/tinymce/jscripts/tiny_mce/plugins/_template/langs/en.js
@@ -1,8 +1 @@
-// UK lang variables
-
-/* Remember to namespace the language parameters lang__ */
-
-tinyMCE.addToLang('',{
-template_title : 'This is just a template popup',
-template_desc : 'This is just a template button'
-});
+// UK lang variables/* Remember to namespace the language parameters lang__ *//r//Older tiny2 lang file. Can be deleted
diff --git a/oss/joomla/trunk/plugins/editors/tinymce/jscripts/tiny_mce/plugins/advhr/langs/en.js b/oss/joomla/trunk/plugins/editors/tinymce/jscripts/tiny_mce/plugins/advhr/langs/en.js
index 5a01d0eb..49bb0b93 100644
--- a/oss/joomla/trunk/plugins/editors/tinymce/jscripts/tiny_mce/plugins/advhr/langs/en.js
+++ b/oss/joomla/trunk/plugins/editors/tinymce/jscripts/tiny_mce/plugins/advhr/langs/en.js
@@ -1,8 +1 @@
-// UK lang variables
-
-tinyMCE.addToLang('',{
-insert_advhr_desc : 'Horizontal rule',
-insert_advhr_width : 'Width',
-insert_advhr_size : 'Height',
-insert_advhr_noshade : 'No shadow'
-});
+// UK lang variables
diff --git a/oss/joomla/trunk/plugins/editors/tinymce/jscripts/tiny_mce/plugins/advimage/langs/en.js b/oss/joomla/trunk/plugins/editors/tinymce/jscripts/tiny_mce/plugins/advimage/langs/en.js
index ffd7e30c..49bb0b93 100644
--- a/oss/joomla/trunk/plugins/editors/tinymce/jscripts/tiny_mce/plugins/advimage/langs/en.js
+++ b/oss/joomla/trunk/plugins/editors/tinymce/jscripts/tiny_mce/plugins/advimage/langs/en.js
@@ -1,27 +1 @@
-// UK lang variables
-
-tinyMCE.addToLang('advimage',{
-tab_general : 'General',
-tab_appearance : 'Appearance',
-tab_advanced : 'Advanced',
-general : 'General',
-title : 'Title',
-preview : 'Preview',
-constrain_proportions : 'Constrain proportions',
-langdir : 'Language direction',
-langcode : 'Language code',
-long_desc : 'Long description link',
-style : 'Style',
-classes : 'Classes',
-ltr : 'Left to right',
-rtl : 'Right to left',
-id : 'Id',
-image_map : 'Image map',
-swap_image : 'Swap image',
-alt_image : 'Alternative image',
-mouseover : 'for mouse over',
-mouseout : 'for mouse out',
-misc : 'Miscellaneous',
-example_img : 'Appearance preview image',
-missing_alt : 'Are you sure you want to continue without including an Image Description? Without it the image may not be accessible to some users with disabilities, or to those using a text browser, or browsing the Web with images turned off.'
-});
+// UK lang variables
diff --git a/oss/joomla/trunk/plugins/editors/tinymce/jscripts/tiny_mce/plugins/advlink/langs/en.js b/oss/joomla/trunk/plugins/editors/tinymce/jscripts/tiny_mce/plugins/advlink/langs/en.js
index 1d50e4e8..49bb0b93 100644
--- a/oss/joomla/trunk/plugins/editors/tinymce/jscripts/tiny_mce/plugins/advlink/langs/en.js
+++ b/oss/joomla/trunk/plugins/editors/tinymce/jscripts/tiny_mce/plugins/advlink/langs/en.js
@@ -1,46 +1 @@
-// UK lang variables
-
-tinyMCE.addToLang('advlink',{
-general_tab : 'General',
-popup_tab : 'Popup',
-events_tab : 'Events',
-advanced_tab : 'Advanced',
-general_props : 'General properties',
-popup_props : 'Popup properties',
-event_props : 'Events',
-advanced_props : 'Advanced properties',
-popup_opts : 'Options',
-anchor_names : 'Anchors',
-target_same : 'Open in this window / frame',
-target_parent : 'Open in parent window / frame',
-target_top : 'Open in top frame (replaces all frames)',
-target_blank : 'Open in new window',
-popup : 'Javascript popup',
-popup_url : 'Popup URL',
-popup_name : 'Window name',
-popup_return : 'Insert \'return false\'',
-popup_scrollbars : 'Show scrollbars',
-popup_statusbar : 'Show status bar',
-popup_toolbar : 'Show toolbars',
-popup_menubar : 'Show menu bar',
-popup_location : 'Show location bar',
-popup_resizable : 'Make window resizable',
-popup_dependent : 'Dependent (Mozilla/Firefox only)',
-popup_size : 'Size',
-popup_position : 'Position (X/Y)',
-id : 'Id',
-style: 'Style',
-classes : 'Classes',
-target_name : 'Target name',
-langdir : 'Language direction',
-target_langcode : 'Target language',
-langcode : 'Language code',
-encoding : 'Target character encoding',
-mime : 'Target MIME type',
-rel : 'Relationship page to target',
-rev : 'Relationship target to page',
-tabindex : 'Tabindex',
-accesskey : 'Accesskey',
-ltr : 'Left to right',
-rtl : 'Right to left'
-});
\ No newline at end of file
+// UK lang variables
diff --git a/oss/joomla/trunk/plugins/editors/tinymce/jscripts/tiny_mce/plugins/autosave/langs/en.js b/oss/joomla/trunk/plugins/editors/tinymce/jscripts/tiny_mce/plugins/autosave/langs/en.js
index 01951332..d56c7268 100644
--- a/oss/joomla/trunk/plugins/editors/tinymce/jscripts/tiny_mce/plugins/autosave/langs/en.js
+++ b/oss/joomla/trunk/plugins/editors/tinymce/jscripts/tiny_mce/plugins/autosave/langs/en.js
@@ -1,5 +1 @@
-// EN lang variables
-
-tinyMCE.addToLang('',{
-autosave_unload_msg : 'The changes you made will be lost if you navigate away from this page.'
-});
+// EN lang variables
diff --git a/oss/joomla/trunk/plugins/editors/tinymce/jscripts/tiny_mce/plugins/devkit/langs/en.js b/oss/joomla/trunk/plugins/editors/tinymce/jscripts/tiny_mce/plugins/devkit/langs/en.js
index 44356cf0..49bb0b93 100644
--- a/oss/joomla/trunk/plugins/editors/tinymce/jscripts/tiny_mce/plugins/devkit/langs/en.js
+++ b/oss/joomla/trunk/plugins/editors/tinymce/jscripts/tiny_mce/plugins/devkit/langs/en.js
@@ -1,23 +1 @@
-// UK lang variables
-
-tinyMCE.addToLang('devkit',{
-title : 'TinyMCE Development Kit',
-info_tab : 'Info',
-settings_tab : 'Settings',
-log_tab : 'Log',
-content_tab : 'Content',
-command_states_tab : 'Commands',
-undo_redo_tab : 'Undo/Redo',
-misc_tab : 'Misc',
-filter : 'Filter:',
-clear_log : 'Clear log',
-refresh : 'Refresh',
-info_help : 'Press Refresh to view info.',
-settings_help : 'Press Refresh to display the settings array for each TinyMCE_Control instance.',
-content_help : 'Press Refresh to display the raw and cleaned HTML content for each TinyMCE_Control instance.',
-command_states_help : 'Press Refresh to display the current command states from inst.queryCommandState. This list will also mark unsupported commands.',
-undo_redo_help : 'Press Refresh to display the global and instance undo/redo levels.',
-misc_help : 'Here are various tools for debugging and development purposes.',
-debug_events : 'Debug events',
-undo_diff : 'Diff undo levels'
-});
+// UK lang variables
diff --git a/oss/joomla/trunk/plugins/editors/tinymce/jscripts/tiny_mce/plugins/directionality/langs/en.js b/oss/joomla/trunk/plugins/editors/tinymce/jscripts/tiny_mce/plugins/directionality/langs/en.js
index a1db2978..49bb0b93 100644
--- a/oss/joomla/trunk/plugins/editors/tinymce/jscripts/tiny_mce/plugins/directionality/langs/en.js
+++ b/oss/joomla/trunk/plugins/editors/tinymce/jscripts/tiny_mce/plugins/directionality/langs/en.js
@@ -1,6 +1 @@
-// UK lang variables
-
-tinyMCE.addToLang('',{
-directionality_ltr_desc : 'Direction left to right',
-directionality_rtl_desc : 'Direction right to left'
-});
+// UK lang variables
diff --git a/oss/joomla/trunk/plugins/editors/tinymce/jscripts/tiny_mce/plugins/emotions/langs/en.js b/oss/joomla/trunk/plugins/editors/tinymce/jscripts/tiny_mce/plugins/emotions/langs/en.js
index 3cdd6751..49bb0b93 100644
--- a/oss/joomla/trunk/plugins/editors/tinymce/jscripts/tiny_mce/plugins/emotions/langs/en.js
+++ b/oss/joomla/trunk/plugins/editors/tinymce/jscripts/tiny_mce/plugins/emotions/langs/en.js
@@ -1,22 +1 @@
-// UK lang variables
-
-tinyMCE.addToLang('emotions',{
-title : 'Insert emotion',
-desc : 'Emotions',
-cool : 'Cool',
-cry : 'Cry',
-embarassed : 'Embarassed',
-foot_in_mouth : 'Foot in mouth',
-frown : 'Frown',
-innocent : 'Innocent',
-kiss : 'Kiss',
-laughing : 'Laughing',
-money_mouth : 'Money mouth',
-sealed : 'Sealed',
-smile : 'Smile',
-surprised : 'Surprised',
-tongue_out : 'Tongue out',
-undecided : 'Undecided',
-wink : 'Wink',
-yell : 'Yell'
-});
+// UK lang variables
diff --git a/oss/joomla/trunk/plugins/editors/tinymce/jscripts/tiny_mce/plugins/flash/langs/en.js b/oss/joomla/trunk/plugins/editors/tinymce/jscripts/tiny_mce/plugins/flash/langs/en.js
index 67272bc9..49bb0b93 100644
--- a/oss/joomla/trunk/plugins/editors/tinymce/jscripts/tiny_mce/plugins/flash/langs/en.js
+++ b/oss/joomla/trunk/plugins/editors/tinymce/jscripts/tiny_mce/plugins/flash/langs/en.js
@@ -1,11 +1 @@
-// UK lang variables
-
-tinyMCE.addToLang('flash',{
-title : 'Insert / edit Flash Movie',
-desc : 'Insert / edit Flash Movie',
-file : 'Flash-File (.swf)',
-size : 'Size',
-list : 'Flash files',
-props : 'Flash properties',
-general : 'General'
-});
+// UK lang variables
diff --git a/oss/joomla/trunk/plugins/editors/tinymce/jscripts/tiny_mce/plugins/fullpage/js/fullpage.js b/oss/joomla/trunk/plugins/editors/tinymce/jscripts/tiny_mce/plugins/fullpage/js/fullpage.js
index 89059ef6..dd3a29cf 100644
--- a/oss/joomla/trunk/plugins/editors/tinymce/jscripts/tiny_mce/plugins/fullpage/js/fullpage.js
+++ b/oss/joomla/trunk/plugins/editors/tinymce/jscripts/tiny_mce/plugins/fullpage/js/fullpage.js
@@ -123,7 +123,7 @@ function init() {
// Parse xml and doctype
xmlVer = getReItem(/<\?\s*?xml.*?version\s*?=\s*?"(.*?)".*?\?>/gi, h, 1);
xmlEnc = getReItem(/<\?\s*?xml.*?encoding\s*?=\s*?"(.*?)".*?\?>/gi, h, 1);
- docType = getReItem(/<\!DOCTYPE.*?>/gi, h, 0);
+ docType = getReItem(/<\!DOCTYPE.*?>/gi, h.replace(/\n/g, ''), 0).replace(/ +/g, ' ');
f.langcode.value = getReItem(/lang="(.*?)"/gi, h, 1);
// Parse title
diff --git a/oss/joomla/trunk/plugins/editors/tinymce/jscripts/tiny_mce/plugins/fullpage/langs/en.js b/oss/joomla/trunk/plugins/editors/tinymce/jscripts/tiny_mce/plugins/fullpage/langs/en.js
index 1864d3d5..49bb0b93 100644
--- a/oss/joomla/trunk/plugins/editors/tinymce/jscripts/tiny_mce/plugins/fullpage/langs/en.js
+++ b/oss/joomla/trunk/plugins/editors/tinymce/jscripts/tiny_mce/plugins/fullpage/langs/en.js
@@ -1,92 +1 @@
-// UK lang variables
-
-tinyMCE.addToLang('fullpage',{
- title : 'Document properties',
- desc : 'Document properties',
- meta_tab : 'General',
- appearance_tab : 'Appearance',
- advanced_tab : 'Advanced',
- meta_props : 'Meta information',
- langprops : 'Language and encoding',
- meta_title : 'Title',
- meta_keywords : 'Keywords',
- meta_description : 'Description',
- meta_robots : 'Robots',
- doctypes : 'Doctype',
- langcode : 'Language code',
- langdir : 'Language direction',
- ltr : 'Left to right',
- rtl : 'Right to left',
- xml_pi : 'XML declaration',
- encoding : 'Character encoding',
- appearance_bgprops : 'Background properties',
- appearance_marginprops : 'Body margins',
- appearance_linkprops : 'Link colors',
- appearance_textprops : 'Text properties',
- bgcolor : 'Background color',
- bgimage : 'Background image',
- left_margin : 'Left margin',
- right_margin : 'Right margin',
- top_margin : 'Top margin',
- bottom_margin : 'Bottom margin',
- text_color : 'Text color',
- font_size : 'Font size',
- font_face : 'Font face',
- link_color : 'Link color',
- hover_color : 'Hover color',
- visited_color : 'Visited color',
- active_color : 'Active color',
- textcolor : 'Color',
- fontsize : 'Font size',
- fontface : 'Font family',
- meta_index_follow : 'Index and follow the links',
- meta_index_nofollow : 'Index and don\'t follow the links',
- meta_noindex_follow : 'Do not index but follow the links',
- meta_noindex_nofollow : 'Do not index and don\'t follow the links',
- appearance_style : 'Stylesheet and style properties',
- stylesheet : 'Stylesheet',
- style : 'Style',
- author : 'Author',
- copyright : 'Copyright',
- add : 'Add new element',
- remove : 'Remove selected element',
- moveup : 'Move selected element up',
- movedown : 'Move selected element down',
- head_elements : 'Head elements',
- info : 'Information',
- info_text : '',
- add_title : 'Title element',
- add_meta : 'Meta element',
- add_script : 'Script element',
- add_style : 'Style element',
- add_link : 'Link element',
- add_base : 'Base element',
- add_comment : 'Comment node',
- title_element : 'Title element',
- script_element : 'Script element',
- style_element : 'Style element',
- base_element : 'Base element',
- link_element : 'Link element',
- meta_element : 'Meta element',
- comment_element : 'Comment',
- src : 'Src',
- language : 'Language',
- href : 'Href',
- target : 'Target',
- rel : 'Rel',
- type : 'Type',
- charset : 'Charset',
- defer : 'Defer',
- media : 'Media',
- properties : 'Properties',
- name : 'Name',
- value : 'Value',
- content : 'Content',
- rel : 'Rel',
- rev : 'Rev',
- hreflang : 'Href lang',
- general_props : 'General',
- advanced_props : 'Advanced',
- delta_width : 0,
- delta_height : 0
-});
+// UK lang variables
diff --git a/oss/joomla/trunk/plugins/editors/tinymce/jscripts/tiny_mce/plugins/fullscreen/langs/en.js b/oss/joomla/trunk/plugins/editors/tinymce/jscripts/tiny_mce/plugins/fullscreen/langs/en.js
index c5ad4ca9..49bb0b93 100644
--- a/oss/joomla/trunk/plugins/editors/tinymce/jscripts/tiny_mce/plugins/fullscreen/langs/en.js
+++ b/oss/joomla/trunk/plugins/editors/tinymce/jscripts/tiny_mce/plugins/fullscreen/langs/en.js
@@ -1,5 +1 @@
-// UK lang variables
-
-tinyMCE.addToLang('',{
-fullscreen_desc : 'Toggle fullscreen mode'
-});
+// UK lang variables
diff --git a/oss/joomla/trunk/plugins/editors/tinymce/jscripts/tiny_mce/plugins/iespell/langs/en.js b/oss/joomla/trunk/plugins/editors/tinymce/jscripts/tiny_mce/plugins/iespell/langs/en.js
index c3688e94..49bb0b93 100644
--- a/oss/joomla/trunk/plugins/editors/tinymce/jscripts/tiny_mce/plugins/iespell/langs/en.js
+++ b/oss/joomla/trunk/plugins/editors/tinymce/jscripts/tiny_mce/plugins/iespell/langs/en.js
@@ -1,7 +1 @@
-// UK lang variables
-
-tinyMCE.addToLang('',{
-iespell_desc : 'Run spell checking',
-iespell_download : "ieSpell not detected. Click OK to go to download page."
-});
-
+// UK lang variables
diff --git a/oss/joomla/trunk/plugins/editors/tinymce/jscripts/tiny_mce/plugins/inlinepopups/editor_plugin.js b/oss/joomla/trunk/plugins/editors/tinymce/jscripts/tiny_mce/plugins/inlinepopups/editor_plugin.js
index 4affad45..07ea477b 100644
--- a/oss/joomla/trunk/plugins/editors/tinymce/jscripts/tiny_mce/plugins/inlinepopups/editor_plugin.js
+++ b/oss/joomla/trunk/plugins/editors/tinymce/jscripts/tiny_mce/plugins/inlinepopups/editor_plugin.js
@@ -1 +1 @@
-(function(){var d=tinymce.DOM,b=tinymce.dom.Element,a=tinymce.dom.Event,e=tinymce.each,c=tinymce.is;tinymce.create("tinymce.plugins.InlinePopups",{init:function(f,g){f.onBeforeRenderUI.add(function(){f.windowManager=new tinymce.InlineWindowManager(f);d.loadCSS(g+"/skins/"+(f.settings.inlinepopups_skin||"clearlooks2")+"/window.css")})},getInfo:function(){return{longname:"InlinePopups",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/inlinepopups",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.create("tinymce.InlineWindowManager:tinymce.WindowManager",{InlineWindowManager:function(f){var g=this;g.parent(f);g.zIndex=300000;g.count=0;g.windows={}},open:function(r,j){var y=this,i,k="",q=y.editor,g=0,s=0,h,m,n,o,l,v,x;r=r||{};j=j||{};if(!r.inline){return y.parent(r,j)}if(!r.type){y.bookmark=q.selection.getBookmark("simple")}i=d.uniqueId();h=d.getViewPort();r.width=parseInt(r.width||320);r.height=parseInt(r.height||240)+(tinymce.isIE?8:0);r.min_width=parseInt(r.min_width||150);r.min_height=parseInt(r.min_height||100);r.max_width=parseInt(r.max_width||2000);r.max_height=parseInt(r.max_height||2000);r.left=r.left||Math.round(Math.max(h.x,h.x+(h.w/2)-(r.width/2)));r.top=r.top||Math.round(Math.max(h.y,h.y+(h.h/2)-(r.height/2)));r.movable=r.resizable=true;j.mce_width=r.width;j.mce_height=r.height;j.mce_inline=true;j.mce_window_id=i;j.mce_auto_focus=r.auto_focus;y.features=r;y.params=j;y.onOpen.dispatch(y,r,j);if(r.type){k+=" mceModal";if(r.type){k+=" mce"+r.type.substring(0,1).toUpperCase()+r.type.substring(1)}r.resizable=false}if(r.statusbar){k+=" mceStatusbar"}if(r.resizable){k+=" mceResizable"}if(r.minimizable){k+=" mceMinimizable"}if(r.maximizable){k+=" mceMaximizable"}if(r.movable){k+=" mceMovable"}y._addAll(d.doc.body,["div",{id:i,"class":q.settings.inlinepopups_skin||"clearlooks2",style:"width:100px;height:100px"},["div",{id:i+"_wrapper","class":"mceWrapper"+k},["div",{id:i+"_top","class":"mceTop"},["div",{"class":"mceLeft"}],["div",{"class":"mceCenter"}],["div",{"class":"mceRight"}],["span",{id:i+"_title"},r.title||""]],["div",{id:i+"_middle","class":"mceMiddle"},["div",{id:i+"_left","class":"mceLeft"}],["span",{id:i+"_content"}],["div",{id:i+"_right","class":"mceRight"}]],["div",{id:i+"_bottom","class":"mceBottom"},["div",{"class":"mceLeft"}],["div",{"class":"mceCenter"}],["div",{"class":"mceRight"}],["span",{id:i+"_status"},"Content"]],["a",{"class":"mceMove",tabindex:"-1",href:"javascript:;"}],["a",{"class":"mceMin",tabindex:"-1",href:"javascript:;",onmousedown:"return false;"}],["a",{"class":"mceMax",tabindex:"-1",href:"javascript:;",onmousedown:"return false;"}],["a",{"class":"mceMed",tabindex:"-1",href:"javascript:;",onmousedown:"return false;"}],["a",{"class":"mceClose",tabindex:"-1",href:"javascript:;",onmousedown:"return false;"}],["a",{id:i+"_resize_n","class":"mceResize mceResizeN",tabindex:"-1",href:"javascript:;"}],["a",{id:i+"_resize_s","class":"mceResize mceResizeS",tabindex:"-1",href:"javascript:;"}],["a",{id:i+"_resize_w","class":"mceResize mceResizeW",tabindex:"-1",href:"javascript:;"}],["a",{id:i+"_resize_e","class":"mceResize mceResizeE",tabindex:"-1",href:"javascript:;"}],["a",{id:i+"_resize_nw","class":"mceResize mceResizeNW",tabindex:"-1",href:"javascript:;"}],["a",{id:i+"_resize_ne","class":"mceResize mceResizeNE",tabindex:"-1",href:"javascript:;"}],["a",{id:i+"_resize_sw","class":"mceResize mceResizeSW",tabindex:"-1",href:"javascript:;"}],["a",{id:i+"_resize_se","class":"mceResize mceResizeSE",tabindex:"-1",href:"javascript:;"}]]]);d.setStyles(i,{top:-10000,left:-10000});if(tinymce.isGecko){d.setStyle(i,"overflow","auto")}if(!r.type){g+=d.get(i+"_left").clientWidth;g+=d.get(i+"_right").clientWidth;s+=d.get(i+"_top").clientHeight;s+=d.get(i+"_bottom").clientHeight}d.setStyles(i,{top:r.top,left:r.left,width:r.width+g,height:r.height+s});x=r.url||r.file;if(x){if(tinymce.relaxedDomain){x+=(x.indexOf("?")==-1?"?":"&")+"mce_rdomain="+tinymce.relaxedDomain}x=tinymce._addVer(x)}if(!r.type){d.add(i+"_content","iframe",{id:i+"_ifr",src:'javascript:""',frameBorder:0,style:"border:0;width:10px;height:10px"});d.setStyles(i+"_ifr",{width:r.width,height:r.height});d.setAttrib(i+"_ifr","src",x)}else{d.add(i+"_wrapper","a",{id:i+"_ok","class":"mceButton mceOk",href:"javascript:;",onmousedown:"return false;"},"Ok");if(r.type=="confirm"){d.add(i+"_wrapper","a",{"class":"mceButton mceCancel",href:"javascript:;",onmousedown:"return false;"},"Cancel")}d.add(i+"_middle","div",{"class":"mceIcon"});d.setHTML(i+"_content",r.content.replace("\n","
"))}n=a.add(i,"mousedown",function(t){var u=t.target,f,p;f=y.windows[i];y.focus(i);if(u.nodeName=="A"||u.nodeName=="a"){if(u.className=="mceMax"){f.oldPos=f.element.getXY();f.oldSize=f.element.getSize();p=d.getViewPort();p.w-=2;p.h-=2;f.element.moveTo(p.x,p.y);f.element.resizeTo(p.w,p.h);d.setStyles(i+"_ifr",{width:p.w-f.deltaWidth,height:p.h-f.deltaHeight});d.addClass(i+"_wrapper","mceMaximized")}else{if(u.className=="mceMed"){f.element.moveTo(f.oldPos.x,f.oldPos.y);f.element.resizeTo(f.oldSize.w,f.oldSize.h);f.iframeElement.resizeTo(f.oldSize.w-f.deltaWidth,f.oldSize.h-f.deltaHeight);d.removeClass(i+"_wrapper","mceMaximized")}else{if(u.className=="mceMove"){return y._startDrag(i,t,u.className)}else{if(d.hasClass(u,"mceResize")){return y._startDrag(i,t,u.className.substring(13))}}}}}});o=a.add(i,"click",function(f){var p=f.target;y.focus(i);if(p.nodeName=="A"||p.nodeName=="a"){switch(p.className){case"mceClose":y.close(null,i);return a.cancel(f);case"mceButton mceOk":case"mceButton mceCancel":r.button_func(p.className=="mceButton mceOk");return a.cancel(f)}}});v=y.windows[i]={id:i,mousedown_func:n,click_func:o,element:new b(i,{blocker:1,container:q.getContainer()}),iframeElement:new b(i+"_ifr"),features:r,deltaWidth:g,deltaHeight:s};v.iframeElement.on("focus",function(){y.focus(i)});if(y.count==0&&y.editor.getParam("dialog_type","modal")=="modal"){d.add(d.doc.body,"div",{id:"mceModalBlocker","class":(y.editor.settings.inlinepopups_skin||"clearlooks2")+"_modalBlocker",style:{zIndex:y.zIndex-1}});d.show("mceModalBlocker")}else{d.setStyle("mceModalBlocker","z-index",y.zIndex-1)}if(tinymce.isIE6||/Firefox\/2\./.test(navigator.userAgent)||(tinymce.isIE&&!d.boxModel)){d.setStyles("mceModalBlocker",{position:"absolute",left:h.x,top:h.y,width:h.w-2,height:h.h-2})}y.focus(i);y._fixIELayout(i,1);if(d.get(i+"_ok")){d.get(i+"_ok").focus()}y.count++;return v},focus:function(h){var g=this,f;if(f=g.windows[h]){f.zIndex=this.zIndex++;f.element.setStyle("zIndex",f.zIndex);f.element.update();h=h+"_wrapper";d.removeClass(g.lastId,"mceFocus");d.addClass(h,"mceFocus");g.lastId=h}},_addAll:function(k,h){var g,l,f=this,j=tinymce.DOM;if(c(h,"string")){k.appendChild(j.doc.createTextNode(h))}else{if(h.length){k=k.appendChild(j.create(h[0],h[1]));for(g=2;gf){i=m;f=m.zIndex}});if(i){h.focus(i.id)}}},setTitle:function(f,g){var h;f=this._findId(f);if(h=d.get(f+"_title")){h.innerHTML=d.encode(g)}},alert:function(g,f,j){var i=this,h;h=i.open({title:i,type:"alert",button_func:function(k){if(f){f.call(k||i,k)}i.close(null,h.id)},content:d.encode(i.editor.getLang(g,g)),inline:1,width:400,height:130})},confirm:function(g,f,j){var i=this,h;h=i.open({title:i,type:"confirm",button_func:function(k){if(f){f.call(k||i,k)}i.close(null,h.id)},content:d.encode(i.editor.getLang(g,g)),inline:1,width:400,height:130})},_findId:function(f){var g=this;if(typeof(f)=="string"){return f}e(g.windows,function(h){var i=d.get(h.id+"_ifr");if(i&&f==i.contentWindow){f=h.id;return false}});return f},_fixIELayout:function(i,h){var f,g;if(!tinymce.isIE6){return}e(["n","s","w","e","nw","ne","sw","se"],function(j){var k=d.get(i+"_resize_"+j);d.setStyles(k,{width:h?k.clientWidth:"",height:h?k.clientHeight:"",cursor:d.getStyle(k,"cursor",1)});d.setStyle(i+"_bottom","bottom","-1px");k=0});if(f=this.windows[i]){f.element.hide();f.element.show();e(d.select("div,a",i),function(k,j){if(k.currentStyle.backgroundImage!="none"){g=new Image();g.src=k.currentStyle.backgroundImage.replace(/url\(\"(.+)\"\)/,"$1")}});d.get(i).style.filter=""}}});tinymce.PluginManager.add("inlinepopups",tinymce.plugins.InlinePopups)})();
\ No newline at end of file
+(function(){var d=tinymce.DOM,b=tinymce.dom.Element,a=tinymce.dom.Event,e=tinymce.each,c=tinymce.is;tinymce.create("tinymce.plugins.InlinePopups",{init:function(f,g){f.onBeforeRenderUI.add(function(){f.windowManager=new tinymce.InlineWindowManager(f);d.loadCSS(g+"/skins/"+(f.settings.inlinepopups_skin||"clearlooks2")+"/window.css")})},getInfo:function(){return{longname:"InlinePopups",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/inlinepopups",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.create("tinymce.InlineWindowManager:tinymce.WindowManager",{InlineWindowManager:function(f){var g=this;g.parent(f);g.zIndex=300000;g.count=0;g.windows={}},open:function(r,j){var y=this,i,k="",q=y.editor,g=0,s=0,h,m,n,o,l,v,x;r=r||{};j=j||{};if(!r.inline){return y.parent(r,j)}if(!r.type){y.bookmark=q.selection.getBookmark(1)}i=d.uniqueId();h=d.getViewPort();r.width=parseInt(r.width||320);r.height=parseInt(r.height||240)+(tinymce.isIE?8:0);r.min_width=parseInt(r.min_width||150);r.min_height=parseInt(r.min_height||100);r.max_width=parseInt(r.max_width||2000);r.max_height=parseInt(r.max_height||2000);r.left=r.left||Math.round(Math.max(h.x,h.x+(h.w/2)-(r.width/2)));r.top=r.top||Math.round(Math.max(h.y,h.y+(h.h/2)-(r.height/2)));r.movable=r.resizable=true;j.mce_width=r.width;j.mce_height=r.height;j.mce_inline=true;j.mce_window_id=i;j.mce_auto_focus=r.auto_focus;y.features=r;y.params=j;y.onOpen.dispatch(y,r,j);if(r.type){k+=" mceModal";if(r.type){k+=" mce"+r.type.substring(0,1).toUpperCase()+r.type.substring(1)}r.resizable=false}if(r.statusbar){k+=" mceStatusbar"}if(r.resizable){k+=" mceResizable"}if(r.minimizable){k+=" mceMinimizable"}if(r.maximizable){k+=" mceMaximizable"}if(r.movable){k+=" mceMovable"}y._addAll(d.doc.body,["div",{id:i,"class":q.settings.inlinepopups_skin||"clearlooks2",style:"width:100px;height:100px"},["div",{id:i+"_wrapper","class":"mceWrapper"+k},["div",{id:i+"_top","class":"mceTop"},["div",{"class":"mceLeft"}],["div",{"class":"mceCenter"}],["div",{"class":"mceRight"}],["span",{id:i+"_title"},r.title||""]],["div",{id:i+"_middle","class":"mceMiddle"},["div",{id:i+"_left","class":"mceLeft"}],["span",{id:i+"_content"}],["div",{id:i+"_right","class":"mceRight"}]],["div",{id:i+"_bottom","class":"mceBottom"},["div",{"class":"mceLeft"}],["div",{"class":"mceCenter"}],["div",{"class":"mceRight"}],["span",{id:i+"_status"},"Content"]],["a",{"class":"mceMove",tabindex:"-1",href:"javascript:;"}],["a",{"class":"mceMin",tabindex:"-1",href:"javascript:;",onmousedown:"return false;"}],["a",{"class":"mceMax",tabindex:"-1",href:"javascript:;",onmousedown:"return false;"}],["a",{"class":"mceMed",tabindex:"-1",href:"javascript:;",onmousedown:"return false;"}],["a",{"class":"mceClose",tabindex:"-1",href:"javascript:;",onmousedown:"return false;"}],["a",{id:i+"_resize_n","class":"mceResize mceResizeN",tabindex:"-1",href:"javascript:;"}],["a",{id:i+"_resize_s","class":"mceResize mceResizeS",tabindex:"-1",href:"javascript:;"}],["a",{id:i+"_resize_w","class":"mceResize mceResizeW",tabindex:"-1",href:"javascript:;"}],["a",{id:i+"_resize_e","class":"mceResize mceResizeE",tabindex:"-1",href:"javascript:;"}],["a",{id:i+"_resize_nw","class":"mceResize mceResizeNW",tabindex:"-1",href:"javascript:;"}],["a",{id:i+"_resize_ne","class":"mceResize mceResizeNE",tabindex:"-1",href:"javascript:;"}],["a",{id:i+"_resize_sw","class":"mceResize mceResizeSW",tabindex:"-1",href:"javascript:;"}],["a",{id:i+"_resize_se","class":"mceResize mceResizeSE",tabindex:"-1",href:"javascript:;"}]]]);d.setStyles(i,{top:-10000,left:-10000});if(tinymce.isGecko){d.setStyle(i,"overflow","auto")}if(!r.type){g+=d.get(i+"_left").clientWidth;g+=d.get(i+"_right").clientWidth;s+=d.get(i+"_top").clientHeight;s+=d.get(i+"_bottom").clientHeight}d.setStyles(i,{top:r.top,left:r.left,width:r.width+g,height:r.height+s});x=r.url||r.file;if(x){if(tinymce.relaxedDomain){x+=(x.indexOf("?")==-1?"?":"&")+"mce_rdomain="+tinymce.relaxedDomain}x=tinymce._addVer(x)}if(!r.type){d.add(i+"_content","iframe",{id:i+"_ifr",src:'javascript:""',frameBorder:0,style:"border:0;width:10px;height:10px"});d.setStyles(i+"_ifr",{width:r.width,height:r.height});d.setAttrib(i+"_ifr","src",x)}else{d.add(i+"_wrapper","a",{id:i+"_ok","class":"mceButton mceOk",href:"javascript:;",onmousedown:"return false;"},"Ok");if(r.type=="confirm"){d.add(i+"_wrapper","a",{"class":"mceButton mceCancel",href:"javascript:;",onmousedown:"return false;"},"Cancel")}d.add(i+"_middle","div",{"class":"mceIcon"});d.setHTML(i+"_content",r.content.replace("\n","
"))}n=a.add(i,"mousedown",function(t){var u=t.target,f,p;f=y.windows[i];y.focus(i);if(u.nodeName=="A"||u.nodeName=="a"){if(u.className=="mceMax"){f.oldPos=f.element.getXY();f.oldSize=f.element.getSize();p=d.getViewPort();p.w-=2;p.h-=2;f.element.moveTo(p.x,p.y);f.element.resizeTo(p.w,p.h);d.setStyles(i+"_ifr",{width:p.w-f.deltaWidth,height:p.h-f.deltaHeight});d.addClass(i+"_wrapper","mceMaximized")}else{if(u.className=="mceMed"){f.element.moveTo(f.oldPos.x,f.oldPos.y);f.element.resizeTo(f.oldSize.w,f.oldSize.h);f.iframeElement.resizeTo(f.oldSize.w-f.deltaWidth,f.oldSize.h-f.deltaHeight);d.removeClass(i+"_wrapper","mceMaximized")}else{if(u.className=="mceMove"){return y._startDrag(i,t,u.className)}else{if(d.hasClass(u,"mceResize")){return y._startDrag(i,t,u.className.substring(13))}}}}}});o=a.add(i,"click",function(f){var p=f.target;y.focus(i);if(p.nodeName=="A"||p.nodeName=="a"){switch(p.className){case"mceClose":y.close(null,i);return a.cancel(f);case"mceButton mceOk":case"mceButton mceCancel":r.button_func(p.className=="mceButton mceOk");return a.cancel(f)}}});v=y.windows[i]={id:i,mousedown_func:n,click_func:o,element:new b(i,{blocker:1,container:q.getContainer()}),iframeElement:new b(i+"_ifr"),features:r,deltaWidth:g,deltaHeight:s};v.iframeElement.on("focus",function(){y.focus(i)});if(y.count==0&&y.editor.getParam("dialog_type","modal")=="modal"){d.add(d.doc.body,"div",{id:"mceModalBlocker","class":(y.editor.settings.inlinepopups_skin||"clearlooks2")+"_modalBlocker",style:{zIndex:y.zIndex-1}});d.show("mceModalBlocker")}else{d.setStyle("mceModalBlocker","z-index",y.zIndex-1)}if(tinymce.isIE6||/Firefox\/2\./.test(navigator.userAgent)||(tinymce.isIE&&!d.boxModel)){d.setStyles("mceModalBlocker",{position:"absolute",left:h.x,top:h.y,width:h.w-2,height:h.h-2})}y.focus(i);y._fixIELayout(i,1);if(d.get(i+"_ok")){d.get(i+"_ok").focus()}y.count++;return v},focus:function(h){var g=this,f;if(f=g.windows[h]){f.zIndex=this.zIndex++;f.element.setStyle("zIndex",f.zIndex);f.element.update();h=h+"_wrapper";d.removeClass(g.lastId,"mceFocus");d.addClass(h,"mceFocus");g.lastId=h}},_addAll:function(k,h){var g,l,f=this,j=tinymce.DOM;if(c(h,"string")){k.appendChild(j.doc.createTextNode(h))}else{if(h.length){k=k.appendChild(j.create(h[0],h[1]));for(g=2;gf){i=m;f=m.zIndex}});if(i){h.focus(i.id)}}},setTitle:function(f,g){var h;f=this._findId(f);if(h=d.get(f+"_title")){h.innerHTML=d.encode(g)}},alert:function(g,f,j){var i=this,h;h=i.open({title:i,type:"alert",button_func:function(k){if(f){f.call(k||i,k)}i.close(null,h.id)},content:d.encode(i.editor.getLang(g,g)),inline:1,width:400,height:130})},confirm:function(g,f,j){var i=this,h;h=i.open({title:i,type:"confirm",button_func:function(k){if(f){f.call(k||i,k)}i.close(null,h.id)},content:d.encode(i.editor.getLang(g,g)),inline:1,width:400,height:130})},_findId:function(f){var g=this;if(typeof(f)=="string"){return f}e(g.windows,function(h){var i=d.get(h.id+"_ifr");if(i&&f==i.contentWindow){f=h.id;return false}});return f},_fixIELayout:function(i,h){var f,g;if(!tinymce.isIE6){return}e(["n","s","w","e","nw","ne","sw","se"],function(j){var k=d.get(i+"_resize_"+j);d.setStyles(k,{width:h?k.clientWidth:"",height:h?k.clientHeight:"",cursor:d.getStyle(k,"cursor",1)});d.setStyle(i+"_bottom","bottom","-1px");k=0});if(f=this.windows[i]){f.element.hide();f.element.show();e(d.select("div,a",i),function(k,j){if(k.currentStyle.backgroundImage!="none"){g=new Image();g.src=k.currentStyle.backgroundImage.replace(/url\(\"(.+)\"\)/,"$1")}});d.get(i).style.filter=""}}});tinymce.PluginManager.add("inlinepopups",tinymce.plugins.InlinePopups)})();
\ No newline at end of file
diff --git a/oss/joomla/trunk/plugins/editors/tinymce/jscripts/tiny_mce/plugins/inlinepopups/editor_plugin_src.js b/oss/joomla/trunk/plugins/editors/tinymce/jscripts/tiny_mce/plugins/inlinepopups/editor_plugin_src.js
index a002bc51..fffca5ab 100644
--- a/oss/joomla/trunk/plugins/editors/tinymce/jscripts/tiny_mce/plugins/inlinepopups/editor_plugin_src.js
+++ b/oss/joomla/trunk/plugins/editors/tinymce/jscripts/tiny_mce/plugins/inlinepopups/editor_plugin_src.js
@@ -1,5 +1,5 @@
/**
- * $Id: editor_plugin_src.js 999 2009-02-10 17:42:58Z spocke $
+ * $Id: editor_plugin_src.js 1150 2009-06-01 11:50:46Z spocke $
*
* @author Moxiecode
* @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved.
@@ -50,7 +50,7 @@
// Only store selection if the type is a normal window
if (!f.type)
- t.bookmark = ed.selection.getBookmark('simple');
+ t.bookmark = ed.selection.getBookmark(1);
id = DOM.uniqueId();
vp = DOM.getViewPort();
diff --git a/oss/joomla/trunk/plugins/editors/tinymce/jscripts/tiny_mce/plugins/insertdatetime/langs/en.js b/oss/joomla/trunk/plugins/editors/tinymce/jscripts/tiny_mce/plugins/insertdatetime/langs/en.js
index c3ec02bf..49bb0b93 100644
--- a/oss/joomla/trunk/plugins/editors/tinymce/jscripts/tiny_mce/plugins/insertdatetime/langs/en.js
+++ b/oss/joomla/trunk/plugins/editors/tinymce/jscripts/tiny_mce/plugins/insertdatetime/langs/en.js
@@ -1,12 +1 @@
-// UK lang variables
-
-tinyMCE.addToLang('',{
-insertdate_def_fmt : '%Y-%m-%d',
-inserttime_def_fmt : '%H:%M:%S',
-insertdate_desc : 'Insert date',
-inserttime_desc : 'Insert time',
-inserttime_months_long : new Array("January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"),
-inserttime_months_short : new Array("Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"),
-inserttime_day_long : new Array("Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"),
-inserttime_day_short : new Array("Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun")
-});
+// UK lang variables
diff --git a/oss/joomla/trunk/plugins/editors/tinymce/jscripts/tiny_mce/plugins/layer/langs/en.js b/oss/joomla/trunk/plugins/editors/tinymce/jscripts/tiny_mce/plugins/layer/langs/en.js
index cdd8c22b..49bb0b93 100644
--- a/oss/joomla/trunk/plugins/editors/tinymce/jscripts/tiny_mce/plugins/layer/langs/en.js
+++ b/oss/joomla/trunk/plugins/editors/tinymce/jscripts/tiny_mce/plugins/layer/langs/en.js
@@ -1,9 +1 @@
-// UK lang variables
-
-tinyMCE.addToLang('layer',{
-insertlayer_desc : 'Insert new layer',
-forward_desc : 'Move forward',
-backward_desc : 'Move backward',
-absolute_desc : 'Toggle absolute positioning',
-content : 'New layer...'
-});
+// UK lang variables
diff --git a/oss/joomla/trunk/plugins/editors/tinymce/jscripts/tiny_mce/plugins/media/langs/en.js b/oss/joomla/trunk/plugins/editors/tinymce/jscripts/tiny_mce/plugins/media/langs/en.js
index ced19672..49bb0b93 100644
--- a/oss/joomla/trunk/plugins/editors/tinymce/jscripts/tiny_mce/plugins/media/langs/en.js
+++ b/oss/joomla/trunk/plugins/editors/tinymce/jscripts/tiny_mce/plugins/media/langs/en.js
@@ -1,94 +1 @@
-// UK lang variables
-
-tinyMCE.addToLang('media',{
-title : 'Insert / edit embedded media',
-desc : 'Insert / edit embedded media',
-general : 'General',
-advanced : 'Advanced',
-file : 'File/URL',
-list : 'List',
-size : 'Dimensions',
-preview : 'Preview',
-constrain_proportions : 'Constrain proportions',
-type : 'Type',
-id : 'Id',
-name : 'Name',
-class_name : 'Class',
-vspace : 'V-Space',
-hspace : 'H-Space',
-play : 'Auto play',
-loop : 'Loop',
-menu : 'Show menu',
-quality : 'Quality',
-scale : 'Scale',
-align : 'Align',
-salign : 'SAlign',
-wmode : 'WMode',
-bgcolor : 'Background',
-base : 'Base',
-flashvars : 'Flashvars',
-liveconnect : 'SWLiveConnect',
-autohref : 'AutoHREF',
-cache : 'Cache',
-hidden : 'Hidden',
-controller : 'Controller',
-kioskmode : 'Kiosk mode',
-playeveryframe : 'Play every frame',
-targetcache : 'Target cache',
-correction : 'No correction',
-enablejavascript : 'Enable JavaScript',
-starttime : 'Start time',
-endtime : 'End time',
-href : 'Href',
-qtsrcchokespeed : 'Choke speed',
-target : 'Target',
-volume : 'Volume',
-autostart : 'Auto start',
-enabled : 'Enabled',
-fullscreen : 'Fullscreen',
-invokeurls : 'Invoke URLs',
-mute : 'Mute',
-stretchtofit : 'Stretch to fit',
-windowlessvideo : 'Windowless video',
-balance : 'Balance',
-baseurl : 'Base URL',
-captioningid : 'Captioning id',
-currentmarker : 'Current marker',
-currentposition : 'Current position',
-defaultframe : 'Default frame',
-playcount : 'Play count',
-rate : 'Rate',
-uimode : 'UI Mode',
-flash_options : 'Flash options',
-qt_options : 'Quicktime options',
-wmp_options : 'Windows media player options',
-rmp_options : 'Real media player options',
-shockwave_options : 'Shockwave options',
-autogotourl : 'Auto goto URL',
-center : 'Center',
-imagestatus : 'Image status',
-maintainaspect : 'Maintain aspect',
-nojava : 'No java',
-prefetch : 'Prefetch',
-shuffle : 'Shuffle',
-console : 'Console',
-numloop : 'Num loops',
-controls : 'Controls',
-scriptcallbacks : 'Script callbacks',
-swstretchstyle : 'Stretch style',
-swstretchhalign : 'Stretch H-Align',
-swstretchvalign : 'Stretch V-Align',
-sound : 'Sound',
-progress : 'Progress',
-qtsrc : 'QT Src',
-qt_stream_warn : 'Streamed rtsp resources should be added to the QT Src field under the advanced tab.\nYou should also add a non streamed version to the Src field..',
-align_top : 'Top',
-align_right : 'Right',
-align_bottom : 'Bottom',
-align_left : 'Left',
-align_center : 'Center',
-align_top_left : 'Top left',
-align_top_right : 'Top right',
-align_bottom_left : 'Bottom left',
-align_bottom_right : 'Bottom right'
-});
\ No newline at end of file
+// UK lang variables
diff --git a/oss/joomla/trunk/plugins/editors/tinymce/jscripts/tiny_mce/plugins/nonbreaking/langs/en.js b/oss/joomla/trunk/plugins/editors/tinymce/jscripts/tiny_mce/plugins/nonbreaking/langs/en.js
index fd49a646..49bb0b93 100644
--- a/oss/joomla/trunk/plugins/editors/tinymce/jscripts/tiny_mce/plugins/nonbreaking/langs/en.js
+++ b/oss/joomla/trunk/plugins/editors/tinymce/jscripts/tiny_mce/plugins/nonbreaking/langs/en.js
@@ -1,5 +1 @@
-// UK lang variables
-
-tinyMCE.addToLang('nonbreaking',{
-desc : 'Insert non-breaking space character'
-});
+// UK lang variables
diff --git a/oss/joomla/trunk/plugins/editors/tinymce/jscripts/tiny_mce/plugins/paste/editor_plugin.js b/oss/joomla/trunk/plugins/editors/tinymce/jscripts/tiny_mce/plugins/paste/editor_plugin.js
index e0e51b5b..473bb854 100644
--- a/oss/joomla/trunk/plugins/editors/tinymce/jscripts/tiny_mce/plugins/paste/editor_plugin.js
+++ b/oss/joomla/trunk/plugins/editors/tinymce/jscripts/tiny_mce/plugins/paste/editor_plugin.js
@@ -1 +1 @@
-(function(){var a=tinymce.each;tinymce.create("tinymce.plugins.PastePlugin",{init:function(c,d){var e=this,b;e.editor=c;e.url=d;e.onPreProcess=new tinymce.util.Dispatcher(e);e.onPostProcess=new tinymce.util.Dispatcher(e);e.onPreProcess.add(e._preProcess);e.onPostProcess.add(e._postProcess);e.onPreProcess.add(function(h,i){c.execCallback("paste_preprocess",h,i)});e.onPostProcess.add(function(h,i){c.execCallback("paste_postprocess",h,i)});function g(i){var k=c.dom,j={content:i};e.onPreProcess.dispatch(e,j);j.node=k.create("div",0,j.content);e.onPostProcess.dispatch(e,j);j.content=c.serializer.serialize(j.node,{getInner:1});if(/<(p|h[1-6]|ul|ol)/.test(j.content)){e._insertBlockContent(c,k,j.content)}else{e._insert(j.content)}}c.addCommand("mceInsertClipboardContent",function(i,h){g(h)});function f(l){var p,k,i,j=c.selection,o=c.dom,h=c.getBody(),m;if(o.get("_mcePaste")){return}p=o.add(h,"div",{id:"_mcePaste"}," ");if(h!=c.getDoc().body){m=o.getPos(c.selection.getStart(),h).y}else{m=h.scrollTop}o.setStyles(p,{position:"absolute",left:-10000,top:m,width:1,height:1,overflow:"hidden"});if(tinymce.isIE){i=o.doc.body.createTextRange();i.moveToElementText(p);i.execCommand("Paste");o.remove(p);g(p.innerHTML);return tinymce.dom.Event.cancel(l)}else{k=c.selection.getRng();p=p.firstChild;i=c.getDoc().createRange();i.setStart(p,0);i.setEnd(p,1);j.setRng(i);window.setTimeout(function(){var r=o.get("_mcePaste"),q;r.id="_mceRemoved";o.remove(r);r=o.get("_mcePaste")||r;q=(o.select("> span.Apple-style-span div",r)[0]||o.select("> span.Apple-style-span",r)[0]||r).innerHTML;o.remove(r);if(k){j.setRng(k)}g(q)},0)}}if(c.getParam("paste_auto_cleanup_on_paste",true)){if(tinymce.isOpera||/Firefox\/2/.test(navigator.userAgent)){c.onKeyDown.add(function(h,i){if(((tinymce.isMac?i.metaKey:i.ctrlKey)&&i.keyCode==86)||(i.shiftKey&&i.keyCode==45)){f(i)}})}else{c.onPaste.addToTop(function(h,i){return f(i)})}}if(c.getParam("paste_block_drop")){c.onInit.add(function(){c.dom.bind(c.getBody(),["dragend","dragover","draggesture","dragdrop","drop","drag"],function(h){h.preventDefault();h.stopPropagation();return false})})}e._legacySupport()},getInfo:function(){return{longname:"Paste text/word",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/paste",version:tinymce.majorVersion+"."+tinymce.minorVersion}},_preProcess:function(d,g){var b=this.editor,c=g.content,f,e;function f(h){a(h,function(i){if(i.constructor==RegExp){c=c.replace(i,"")}else{c=c.replace(i[0],i[1])}})}f([/^\s*( )+/g,/( |
]*>)+\s*$/g]);if(/(class=\"?Mso|style=\"[^\"]*\bmso\-|w:WordDocument)/.test(c)){g.wordContent=true;if(b.getParam("paste_convert_middot_lists",true)){f([[//gi,"$&__MCE_ITEM__"],[/(]+:\s*symbol[^>]+>)/gi,"$1__MCE_ITEM__"],[/(]+mso-list:[^>]+>)/gi,"$1__MCE_ITEM__"]])}f([//gi,/<\/?(img|font|meta|link|style|div|v:\w+)[^>]*>/gi,/<\\?\?xml[^>]*>/gi,/<\/?o:[^>]*>/gi,/ (id|name|language|type|on\w+|v:\w+)=\"([^\"]*)\"/gi,/ (id|name|language|type|on\w+|v:\w+)=(\w+)/gi,[/<(\/?)s>/gi,"<$1strike>"],/
- getTag(), 0, strpos( $language->getTag(), '-' ) );
-
- if ($language->isRTL()) {
- $direction = 'rtl';
- } else {
- $direction = 'ltr';
- }
-
- /*
- * Lets get the default template for the site application
- */
- $query = 'SELECT template'
- . ' FROM #__templates_menu'
- . ' WHERE client_id = 0'
- . ' AND menuid = 0'
- ;
- $db->setQuery( $query );
- $template = $db->loadResult();
-
- $file_path = JPATH_SITE .'/templates/'. $template .'/css/';
- if ( !file_exists( $file_path .DS. 'editor.css' ) ) {
- $template = 'system';
- }
-
- $css = JURI::root() .'/templates/'. $template . '/css/editor.css';
-
- $html = '';
- ob_start();
- ?>
-
-
-
-
-
- _displayButtons($name, $buttons);
-
- return $html;
- }
-
- function onGetInsertMethod($name)
- {
- $doc = & JFactory::getDocument();
-
- $js= "function jInsertEditorText( text ) {
- var editor = document.getElementById('xstandard');
- editor.InsertXML(text);
- }";
- $doc->addScriptDeclaration($js);
-
- return true;
- }
-
- function _getTemplateCss()
- {
- $db =& JFactory::getDBO();
-
- /*
- * Lets get the default template for the site application
- */
- $query = 'SELECT template'
- . ' FROM #__templates_menu'
- . ' WHERE client_id = 0'
- . ' AND menuid = 0'
- ;
- $db->setQuery( $query );
- $template = $db->loadResult();
-
- $content_css = JURI::root() .'/templates/'. $template .'/css/';
-
- $file_path = JPATH_SITE .'/templates/'. $template .'/css/';
- if ( file_exists( $file_path .DS. 'editor.css' ) ) {
- $content_css = $content_css . 'editor.css' .'", ';
- } else {
- $content_css = $content_css . 'template_css.css", ';
- }
-
- return $content_css;
- }
-
- function _displayButtons($name, $buttons)
- {
- // Load modal popup behavior
- JHTML::_('behavior.modal', 'a.modal-button');
-
- $args['name'] = $name;
- $args['event'] = 'onGetInsertMethod';
-
- $return = '';
- $results[] = $this->update($args);
- foreach ($results as $result) {
- if (is_string($result) && trim($result)) {
- $return .= $result;
- }
- }
-
- if(!empty($buttons))
- {
- $results = $this->_subject->getButtons($name, $buttons);
-
- /*
- * This will allow plugins to attach buttons or change the behavior on the fly using AJAX
- */
- $return .= "\n\n";
- }
-
- return $return;
- }
+
+
+ getTag(), 0, strpos( $language->getTag(), '-' ) );
+
+ if ($language->isRTL()) {
+ $direction = 'rtl';
+ } else {
+ $direction = 'ltr';
+ }
+
+ /*
+ * Lets get the default template for the site application
+ */
+ $query = 'SELECT template'
+ . ' FROM #__templates_menu'
+ . ' WHERE client_id = 0'
+ . ' AND menuid = 0'
+ ;
+ $db->setQuery( $query );
+ $template = $db->loadResult();
+
+ $file_path = JPATH_SITE .'/templates/'. $template .'/css/';
+ if ( !file_exists( $file_path .DS. 'editor.css' ) ) {
+ $template = 'system';
+ }
+
+ $css = JURI::root() .'/templates/'. $template . '/css/editor.css';
+
+ $html = '';
+ ob_start();
+ ?>
+
+
+
+
+
+ _displayButtons($name, $buttons);
+
+ return $html;
+ }
+
+ function onGetInsertMethod($name)
+ {
+ $doc = & JFactory::getDocument();
+
+ $js= "function jInsertEditorText( text ) {
+ var editor = document.getElementById('xstandard');
+ editor.InsertXML(text);
+ }";
+ $doc->addScriptDeclaration($js);
+
+ return true;
+ }
+
+ function _getTemplateCss()
+ {
+ $db =& JFactory::getDBO();
+
+ /*
+ * Lets get the default template for the site application
+ */
+ $query = 'SELECT template'
+ . ' FROM #__templates_menu'
+ . ' WHERE client_id = 0'
+ . ' AND menuid = 0'
+ ;
+ $db->setQuery( $query );
+ $template = $db->loadResult();
+
+ $content_css = JURI::root() .'/templates/'. $template .'/css/';
+
+ $file_path = JPATH_SITE .'/templates/'. $template .'/css/';
+ if ( file_exists( $file_path .DS. 'editor.css' ) ) {
+ $content_css = $content_css . 'editor.css' .'", ';
+ } else {
+ $content_css = $content_css . 'template_css.css", ';
+ }
+
+ return $content_css;
+ }
+
+ function _displayButtons($name, $buttons)
+ {
+ // Load modal popup behavior
+ JHTML::_('behavior.modal', 'a.modal-button');
+
+ $args['name'] = $name;
+ $args['event'] = 'onGetInsertMethod';
+
+ $return = '';
+ $results[] = $this->update($args);
+ foreach ($results as $result) {
+ if (is_string($result) && trim($result)) {
+ $return .= $result;
+ }
+ }
+
+ if(!empty($buttons))
+ {
+ $results = $this->_subject->getButtons($name, $buttons);
+
+ /*
+ * This will allow plugins to attach buttons or change the behavior on the fly using AJAX
+ */
+ $return .= "\n\n";
+ }
+
+ return $return;
+ }
}
\ No newline at end of file
diff --git a/oss/joomla/trunk/plugins/editors/xstandard.xml b/oss/joomla/trunk/plugins/editors/xstandard.xml
index b3f72652..4771bb24 100644
--- a/oss/joomla/trunk/plugins/editors/xstandard.xml
+++ b/oss/joomla/trunk/plugins/editors/xstandard.xml
@@ -6,7 +6,7 @@
Joomla! Project
admin@joomla.org
www.joomla.org
- Copyright (C) 2005 - 2008 Open Source Matters. All rights reserved.
+ Copyright (C) 2005 - 2010 Open Source Matters. All rights reserved.
http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL
DESCXSTANDARD
diff --git a/oss/joomla/trunk/plugins/editors/xstandard/xstandard.js b/oss/joomla/trunk/plugins/editors/xstandard/xstandard.js
index e90789ee..3a61967d 100644
--- a/oss/joomla/trunk/plugins/editors/xstandard/xstandard.js
+++ b/oss/joomla/trunk/plugins/editors/xstandard/xstandard.js
@@ -1,49 +1,49 @@
-/**
- * @version $Id: xstandard.js 10714 2008-08-21 10:10:14Z eddieajau $
- * @package Joomla
- * @copyright Copyright (C) 2005 - 2008 Open Source Matters. All rights reserved.
- * @license GNU/GPL, see LICENSE.php
- * Joomla! is free software. This version may have been modified pursuant
- * to the GNU General Public License, and as distributed it includes or
- * is derivative of works licensed under the GNU General Public License or
- * other free or open source software licenses.
- * See COPYRIGHT.php for copyright notices and details.
- */
-
-/**
- * JXStandard javascript behavior
- *
- * @package Joomla
- * @since 1.5
- * @version 1.0
- */
-var JXStandard = new Class({
-
- instances : null,
-
- initialize: function()
- {
- this.instances = $ES('object[type=application/x-xstandard]');
-
- var self = this;
- document.adminForm.onsubmit = function() {
- self.save();
- }
- },
-
- save: function()
- {
- this.instances.each(function(instance)
- {
- instance.EscapeUnicode = false;
- var contents = instance.value;
- $(instance.className).value = contents;
- });
- }
-})
-
-document.xstandard = null
-window.addEvent('domready', function(){
- var xstandard = new JXStandard();
- document.xstandard = xstandard;
+/**
+ * @version $Id: xstandard.js 14401 2010-01-26 14:10:00Z louis $
+ * @package Joomla
+ * @copyright Copyright (C) 2005 - 2010 Open Source Matters. All rights reserved.
+ * @license GNU/GPL, see LICENSE.php
+ * Joomla! is free software. This version may have been modified pursuant
+ * to the GNU General Public License, and as distributed it includes or
+ * is derivative of works licensed under the GNU General Public License or
+ * other free or open source software licenses.
+ * See COPYRIGHT.php for copyright notices and details.
+ */
+
+/**
+ * JXStandard javascript behavior
+ *
+ * @package Joomla
+ * @since 1.5
+ * @version 1.0
+ */
+var JXStandard = new Class({
+
+ instances : null,
+
+ initialize: function()
+ {
+ this.instances = $ES('object[type=application/x-xstandard]');
+
+ var self = this;
+ document.adminForm.onsubmit = function() {
+ self.save();
+ }
+ },
+
+ save: function()
+ {
+ this.instances.each(function(instance)
+ {
+ instance.EscapeUnicode = false;
+ var contents = instance.value;
+ $(instance.className).value = contents;
+ });
+ }
+})
+
+document.xstandard = null
+window.addEvent('domready', function(){
+ var xstandard = new JXStandard();
+ document.xstandard = xstandard;
});
\ No newline at end of file
diff --git a/oss/joomla/trunk/plugins/search/categories.php b/oss/joomla/trunk/plugins/search/categories.php
index 79b535e6..da722a9b 100644
--- a/oss/joomla/trunk/plugins/search/categories.php
+++ b/oss/joomla/trunk/plugins/search/categories.php
@@ -1,116 +1,116 @@
-registerEvent( 'onSearch', 'plgSearchCategories' );
-$mainframe->registerEvent( 'onSearchAreas', 'plgSearchCategoryAreas' );
-
-JPlugin::loadLanguage( 'plg_search_categories' );
-
-/**
- * @return array An array of search areas
- */
-function &plgSearchCategoryAreas()
-{
- static $areas = array(
- 'categories' => 'Categories'
- );
- return $areas;
-}
-
-/**
- * Categories Search method
- *
- * The sql must return the following fields that are
- * used in a common display routine: href, title, section, created, text,
- * browsernav
- * @param string Target search string
- * @param string mathcing option, exact|any|all
- * @param string ordering option, newest|oldest|popular|alpha|category
- * @param mixed An array if restricted to areas, null if search all
- */
-function plgSearchCategories( $text, $phrase='', $ordering='', $areas=null )
-{
- $db =& JFactory::getDBO();
- $user =& JFactory::getUser();
- $searchText = $text;
-
- require_once(JPATH_SITE.DS.'components'.DS.'com_content'.DS.'helpers'.DS.'route.php');
-
- if (is_array( $areas )) {
- if (!array_intersect( $areas, array_keys( plgSearchCategoryAreas() ) )) {
- return array();
- }
- }
-
- // load plugin params info
- $plugin =& JPluginHelper::getPlugin('search', 'categories');
- $pluginParams = new JParameter( $plugin->params );
-
- $limit = $pluginParams->def( 'search_limit', 50 );
-
- $text = trim( $text );
- if ( $text == '' ) {
- return array();
- }
-
- switch ( $ordering ) {
- case 'alpha':
- $order = 'a.name ASC';
- break;
-
- case 'category':
- case 'popular':
- case 'newest':
- case 'oldest':
- default:
- $order = 'a.name DESC';
- }
-
- $text = $db->Quote( '%'.$db->getEscaped( $text, true ).'%', false );
- $query = 'SELECT a.title, a.description AS text, "" AS created, a.name,'
- . ' "2" AS browsernav,'
- . ' s.id AS secid, a.id AS catid,'
- . ' CASE WHEN CHAR_LENGTH(a.alias) THEN CONCAT_WS(":", a.id, a.alias) ELSE a.id END as slug'
- . ' FROM #__categories AS a'
- . ' INNER JOIN #__sections AS s ON s.id = a.section'
- . ' WHERE ( a.name LIKE '.$text
- . ' OR a.title LIKE '.$text
- . ' OR a.description LIKE '.$text.' )'
- . ' AND a.published = 1'
- . ' AND s.published = 1'
- . ' AND a.access <= '.(int) $user->get('aid')
- . ' AND s.access <= '.(int) $user->get('aid')
- . ' GROUP BY a.id'
- . ' ORDER BY '. $order
- ;
- $db->setQuery( $query, 0, $limit );
- $rows = $db->loadObjectList();
-
- $count = count( $rows );
- for ( $i = 0; $i < $count; $i++ ) {
- $rows[$i]->href = ContentHelperRoute::getCategoryRoute($rows[$i]->slug, $rows[$i]->secid);
- $rows[$i]->section = JText::_( 'Category' );
- }
-
- $return = array();
- foreach($rows AS $key => $category) {
- if(searchHelper::checkNoHTML($category, $searchText, array('name', 'title', 'text'))) {
- $return[] = $category;
- }
- }
-
- return $return;
-}
+registerEvent( 'onSearch', 'plgSearchCategories' );
+$mainframe->registerEvent( 'onSearchAreas', 'plgSearchCategoryAreas' );
+
+JPlugin::loadLanguage( 'plg_search_categories' );
+
+/**
+ * @return array An array of search areas
+ */
+function &plgSearchCategoryAreas()
+{
+ static $areas = array(
+ 'categories' => 'Categories'
+ );
+ return $areas;
+}
+
+/**
+ * Categories Search method
+ *
+ * The sql must return the following fields that are
+ * used in a common display routine: href, title, section, created, text,
+ * browsernav
+ * @param string Target search string
+ * @param string mathcing option, exact|any|all
+ * @param string ordering option, newest|oldest|popular|alpha|category
+ * @param mixed An array if restricted to areas, null if search all
+ */
+function plgSearchCategories( $text, $phrase='', $ordering='', $areas=null )
+{
+ $db =& JFactory::getDBO();
+ $user =& JFactory::getUser();
+ $searchText = $text;
+
+ require_once(JPATH_SITE.DS.'components'.DS.'com_content'.DS.'helpers'.DS.'route.php');
+
+ if (is_array( $areas )) {
+ if (!array_intersect( $areas, array_keys( plgSearchCategoryAreas() ) )) {
+ return array();
+ }
+ }
+
+ // load plugin params info
+ $plugin =& JPluginHelper::getPlugin('search', 'categories');
+ $pluginParams = new JParameter( $plugin->params );
+
+ $limit = $pluginParams->def( 'search_limit', 50 );
+
+ $text = trim( $text );
+ if ( $text == '' ) {
+ return array();
+ }
+
+ switch ( $ordering ) {
+ case 'alpha':
+ $order = 'a.name ASC';
+ break;
+
+ case 'category':
+ case 'popular':
+ case 'newest':
+ case 'oldest':
+ default:
+ $order = 'a.name DESC';
+ }
+
+ $text = $db->Quote( '%'.$db->getEscaped( $text, true ).'%', false );
+ $query = 'SELECT a.title, a.description AS text, "" AS created, a.name,'
+ . ' "2" AS browsernav,'
+ . ' s.id AS secid, a.id AS catid,'
+ . ' CASE WHEN CHAR_LENGTH(a.alias) THEN CONCAT_WS(":", a.id, a.alias) ELSE a.id END as slug'
+ . ' FROM #__categories AS a'
+ . ' INNER JOIN #__sections AS s ON s.id = a.section'
+ . ' WHERE ( a.name LIKE '.$text
+ . ' OR a.title LIKE '.$text
+ . ' OR a.description LIKE '.$text.' )'
+ . ' AND a.published = 1'
+ . ' AND s.published = 1'
+ . ' AND a.access <= '.(int) $user->get('aid')
+ . ' AND s.access <= '.(int) $user->get('aid')
+ . ' GROUP BY a.id'
+ . ' ORDER BY '. $order
+ ;
+ $db->setQuery( $query, 0, $limit );
+ $rows = $db->loadObjectList();
+
+ $count = count( $rows );
+ for ( $i = 0; $i < $count; $i++ ) {
+ $rows[$i]->href = ContentHelperRoute::getCategoryRoute($rows[$i]->slug, $rows[$i]->secid);
+ $rows[$i]->section = JText::_( 'Category' );
+ }
+
+ $return = array();
+ foreach($rows AS $key => $category) {
+ if(searchHelper::checkNoHTML($category, $searchText, array('name', 'title', 'text'))) {
+ $return[] = $category;
+ }
+ }
+
+ return $return;
+}
diff --git a/oss/joomla/trunk/plugins/search/categories.xml b/oss/joomla/trunk/plugins/search/categories.xml
index 2d0f44dc..f9affb86 100644
--- a/oss/joomla/trunk/plugins/search/categories.xml
+++ b/oss/joomla/trunk/plugins/search/categories.xml
@@ -3,7 +3,7 @@
Search - Categories
Joomla! Project
November 2005
- Copyright (C) 2005 - 2008 Open Source Matters. All rights reserved.
+ Copyright (C) 2005 - 2010 Open Source Matters. All rights reserved.
http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL
admin@joomla.org
www.joomla.org
diff --git a/oss/joomla/trunk/plugins/search/contacts.php b/oss/joomla/trunk/plugins/search/contacts.php
index 9beb5623..198fbb9d 100644
--- a/oss/joomla/trunk/plugins/search/contacts.php
+++ b/oss/joomla/trunk/plugins/search/contacts.php
@@ -1,116 +1,116 @@
-registerEvent( 'onSearch', 'plgSearchContacts' );
-$mainframe->registerEvent( 'onSearchAreas', 'plgSearchContactAreas' );
-
-JPlugin::loadLanguage( 'plg_search_contacts' );
-
-/**
- * @return array An array of search areas
- */
-function &plgSearchContactAreas()
-{
- static $areas = array(
- 'contacts' => 'Contacts'
- );
- return $areas;
-}
-
-/**
-* Contacts Search method
-*
-* The sql must return the following fields that are used in a common display
-* routine: href, title, section, created, text, browsernav
-* @param string Target search string
-* @param string mathcing option, exact|any|all
-* @param string ordering option, newest|oldest|popular|alpha|category
-*/
-function plgSearchContacts( $text, $phrase='', $ordering='', $areas=null )
-{
- $db =& JFactory::getDBO();
- $user =& JFactory::getUser();
-
- if (is_array( $areas )) {
- if (!array_intersect( $areas, array_keys( plgSearchContactAreas() ) )) {
- return array();
- }
- }
-
- // load plugin params info
- $plugin =& JPluginHelper::getPlugin('search', 'contacts');
- $pluginParams = new JParameter( $plugin->params );
-
- $limit = $pluginParams->def( 'search_limit', 50 );
-
- $text = trim( $text );
- if ($text == '') {
- return array();
- }
-
- $section = JText::_( 'Contact' );
-
- switch ( $ordering ) {
- case 'alpha':
- $order = 'a.name ASC';
- break;
-
- case 'category':
- $order = 'b.title ASC, a.name ASC';
- break;
-
- case 'popular':
- case 'newest':
- case 'oldest':
- default:
- $order = 'a.name DESC';
- }
-
- $text = $db->Quote( '%'.$db->getEscaped( $text, true ).'%', false );
- $query = 'SELECT a.name AS title, "" AS created,'
- . ' CASE WHEN CHAR_LENGTH(a.alias) THEN CONCAT_WS(\':\', a.id, a.alias) ELSE a.id END as slug, '
- . ' CASE WHEN CHAR_LENGTH(b.alias) THEN CONCAT_WS(\':\', b.id, b.alias) ELSE b.id END AS catslug, '
- . ' CONCAT_WS( ", ", a.name, a.con_position, a.misc ) AS text,'
- . ' CONCAT_WS( " / ", '.$db->Quote($section).', b.title ) AS section,'
- . ' "2" AS browsernav'
- . ' FROM #__contact_details AS a'
- . ' INNER JOIN #__categories AS b ON b.id = a.catid'
- . ' WHERE ( a.name LIKE '.$text
- . ' OR a.misc LIKE '.$text
- . ' OR a.con_position LIKE '.$text
- . ' OR a.address LIKE '.$text
- . ' OR a.suburb LIKE '.$text
- . ' OR a.state LIKE '.$text
- . ' OR a.country LIKE '.$text
- . ' OR a.postcode LIKE '.$text
- . ' OR a.telephone LIKE '.$text
- . ' OR a.fax LIKE '.$text.' )'
- . ' AND a.published = 1'
- . ' AND b.published = 1'
- . ' AND a.access <= '.(int) $user->get( 'aid' )
- . ' AND b.access <= '.(int) $user->get( 'aid' )
- . ' GROUP BY a.id'
- . ' ORDER BY '. $order
- ;
- $db->setQuery( $query, 0, $limit );
- $rows = $db->loadObjectList();
-
- foreach($rows as $key => $row) {
- $rows[$key]->href = 'index.php?option=com_contact&view=contact&id='.$row->slug.'&catid='.$row->catslug;
- }
-
- return $rows;
-}
+registerEvent( 'onSearch', 'plgSearchContacts' );
+$mainframe->registerEvent( 'onSearchAreas', 'plgSearchContactAreas' );
+
+JPlugin::loadLanguage( 'plg_search_contacts' );
+
+/**
+ * @return array An array of search areas
+ */
+function &plgSearchContactAreas()
+{
+ static $areas = array(
+ 'contacts' => 'Contacts'
+ );
+ return $areas;
+}
+
+/**
+* Contacts Search method
+*
+* The sql must return the following fields that are used in a common display
+* routine: href, title, section, created, text, browsernav
+* @param string Target search string
+* @param string mathcing option, exact|any|all
+* @param string ordering option, newest|oldest|popular|alpha|category
+*/
+function plgSearchContacts( $text, $phrase='', $ordering='', $areas=null )
+{
+ $db =& JFactory::getDBO();
+ $user =& JFactory::getUser();
+
+ if (is_array( $areas )) {
+ if (!array_intersect( $areas, array_keys( plgSearchContactAreas() ) )) {
+ return array();
+ }
+ }
+
+ // load plugin params info
+ $plugin =& JPluginHelper::getPlugin('search', 'contacts');
+ $pluginParams = new JParameter( $plugin->params );
+
+ $limit = $pluginParams->def( 'search_limit', 50 );
+
+ $text = trim( $text );
+ if ($text == '') {
+ return array();
+ }
+
+ $section = JText::_( 'Contact' );
+
+ switch ( $ordering ) {
+ case 'alpha':
+ $order = 'a.name ASC';
+ break;
+
+ case 'category':
+ $order = 'b.title ASC, a.name ASC';
+ break;
+
+ case 'popular':
+ case 'newest':
+ case 'oldest':
+ default:
+ $order = 'a.name DESC';
+ }
+
+ $text = $db->Quote( '%'.$db->getEscaped( $text, true ).'%', false );
+ $query = 'SELECT a.name AS title, "" AS created,'
+ . ' CASE WHEN CHAR_LENGTH(a.alias) THEN CONCAT_WS(\':\', a.id, a.alias) ELSE a.id END as slug, '
+ . ' CASE WHEN CHAR_LENGTH(b.alias) THEN CONCAT_WS(\':\', b.id, b.alias) ELSE b.id END AS catslug, '
+ . ' CONCAT_WS( ", ", a.name, a.con_position, a.misc ) AS text,'
+ . ' CONCAT_WS( " / ", '.$db->Quote($section).', b.title ) AS section,'
+ . ' "2" AS browsernav'
+ . ' FROM #__contact_details AS a'
+ . ' INNER JOIN #__categories AS b ON b.id = a.catid'
+ . ' WHERE ( a.name LIKE '.$text
+ . ' OR a.misc LIKE '.$text
+ . ' OR a.con_position LIKE '.$text
+ . ' OR a.address LIKE '.$text
+ . ' OR a.suburb LIKE '.$text
+ . ' OR a.state LIKE '.$text
+ . ' OR a.country LIKE '.$text
+ . ' OR a.postcode LIKE '.$text
+ . ' OR a.telephone LIKE '.$text
+ . ' OR a.fax LIKE '.$text.' )'
+ . ' AND a.published = 1'
+ . ' AND b.published = 1'
+ . ' AND a.access <= '.(int) $user->get( 'aid' )
+ . ' AND b.access <= '.(int) $user->get( 'aid' )
+ . ' GROUP BY a.id'
+ . ' ORDER BY '. $order
+ ;
+ $db->setQuery( $query, 0, $limit );
+ $rows = $db->loadObjectList();
+
+ foreach($rows as $key => $row) {
+ $rows[$key]->href = 'index.php?option=com_contact&view=contact&id='.$row->slug.'&catid='.$row->catslug;
+ }
+
+ return $rows;
+}
diff --git a/oss/joomla/trunk/plugins/search/contacts.xml b/oss/joomla/trunk/plugins/search/contacts.xml
index ab5c2023..1c0738db 100644
--- a/oss/joomla/trunk/plugins/search/contacts.xml
+++ b/oss/joomla/trunk/plugins/search/contacts.xml
@@ -3,7 +3,7 @@
Search - Contacts
Joomla! Project
November 2005
- Copyright (C) 2005 - 2008 Open Source Matters. All rights reserved.
+ Copyright (C) 2005 - 2010 Open Source Matters. All rights reserved.
http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL
admin@joomla.org
www.joomla.org
diff --git a/oss/joomla/trunk/plugins/search/content.php b/oss/joomla/trunk/plugins/search/content.php
index d2721cab..f3bf268d 100644
--- a/oss/joomla/trunk/plugins/search/content.php
+++ b/oss/joomla/trunk/plugins/search/content.php
@@ -1,264 +1,264 @@
-registerEvent( 'onSearch', 'plgSearchContent' );
-$mainframe->registerEvent( 'onSearchAreas', 'plgSearchContentAreas' );
-
-JPlugin::loadLanguage( 'plg_search_content' );
-
-/**
- * @return array An array of search areas
- */
-function &plgSearchContentAreas()
-{
- static $areas = array(
- 'content' => 'Articles'
- );
- return $areas;
-}
-
-/**
- * Content Search method
- * The sql must return the following fields that are used in a common display
- * routine: href, title, section, created, text, browsernav
- * @param string Target search string
- * @param string mathcing option, exact|any|all
- * @param string ordering option, newest|oldest|popular|alpha|category
- * @param mixed An array if the search it to be restricted to areas, null if search all
- */
-function plgSearchContent( $text, $phrase='', $ordering='', $areas=null )
-{
- global $mainframe;
-
- $db =& JFactory::getDBO();
- $user =& JFactory::getUser();
-
- require_once(JPATH_SITE.DS.'components'.DS.'com_content'.DS.'helpers'.DS.'route.php');
- require_once(JPATH_SITE.DS.'administrator'.DS.'components'.DS.'com_search'.DS.'helpers'.DS.'search.php');
-
- $searchText = $text;
- if (is_array( $areas )) {
- if (!array_intersect( $areas, array_keys( plgSearchContentAreas() ) )) {
- return array();
- }
- }
-
- // load plugin params info
- $plugin =& JPluginHelper::getPlugin('search', 'content');
- $pluginParams = new JParameter( $plugin->params );
-
- $sContent = $pluginParams->get( 'search_content', 1 );
- $sUncategorised = $pluginParams->get( 'search_uncategorised', 1 );
- $sArchived = $pluginParams->get( 'search_archived', 1 );
- $limit = $pluginParams->def( 'search_limit', 50 );
-
- $nullDate = $db->getNullDate();
- $date =& JFactory::getDate();
- $now = $date->toMySQL();
-
- $text = trim( $text );
- if ($text == '') {
- return array();
- }
-
- $wheres = array();
- switch ($phrase) {
- case 'exact':
- $text = $db->Quote( '%'.$db->getEscaped( $text, true ).'%', false );
- $wheres2 = array();
- $wheres2[] = 'a.title LIKE '.$text;
- $wheres2[] = 'a.introtext LIKE '.$text;
- $wheres2[] = 'a.fulltext LIKE '.$text;
- $wheres2[] = 'a.metakey LIKE '.$text;
- $wheres2[] = 'a.metadesc LIKE '.$text;
- $where = '(' . implode( ') OR (', $wheres2 ) . ')';
- break;
-
- case 'all':
- case 'any':
- default:
- $words = explode( ' ', $text );
- $wheres = array();
- foreach ($words as $word) {
- $word = $db->Quote( '%'.$db->getEscaped( $word, true ).'%', false );
- $wheres2 = array();
- $wheres2[] = 'a.title LIKE '.$word;
- $wheres2[] = 'a.introtext LIKE '.$word;
- $wheres2[] = 'a.fulltext LIKE '.$word;
- $wheres2[] = 'a.metakey LIKE '.$word;
- $wheres2[] = 'a.metadesc LIKE '.$word;
- $wheres[] = implode( ' OR ', $wheres2 );
- }
- $where = '(' . implode( ($phrase == 'all' ? ') AND (' : ') OR ('), $wheres ) . ')';
- break;
- }
-
- $morder = '';
- switch ($ordering) {
- case 'oldest':
- $order = 'a.created ASC';
- break;
-
- case 'popular':
- $order = 'a.hits DESC';
- break;
-
- case 'alpha':
- $order = 'a.title ASC';
- break;
-
- case 'category':
- $order = 'b.title ASC, a.title ASC';
- $morder = 'a.title ASC';
- break;
-
- case 'newest':
- default:
- $order = 'a.created DESC';
- break;
- }
-
- $rows = array();
-
- // search articles
- if ( $sContent && $limit > 0 )
- {
- $query = 'SELECT a.title AS title, a.metadesc, a.metakey,'
- . ' a.created AS created,'
- . ' CONCAT(a.introtext, a.fulltext) AS text,'
- . ' CONCAT_WS( "/", u.title, b.title ) AS section,'
- . ' CASE WHEN CHAR_LENGTH(a.alias) THEN CONCAT_WS(":", a.id, a.alias) ELSE a.id END as slug,'
- . ' CASE WHEN CHAR_LENGTH(b.alias) THEN CONCAT_WS(":", b.id, b.alias) ELSE b.id END as catslug,'
- . ' u.id AS sectionid,'
- . ' "2" AS browsernav'
- . ' FROM #__content AS a'
- . ' INNER JOIN #__categories AS b ON b.id=a.catid'
- . ' INNER JOIN #__sections AS u ON u.id = a.sectionid'
- . ' WHERE ( '.$where.' )'
- . ' AND a.state = 1'
- . ' AND u.published = 1'
- . ' AND b.published = 1'
- . ' AND a.access <= '.(int) $user->get( 'aid' )
- . ' AND b.access <= '.(int) $user->get( 'aid' )
- . ' AND u.access <= '.(int) $user->get( 'aid' )
- . ' AND ( a.publish_up = '.$db->Quote($nullDate).' OR a.publish_up <= '.$db->Quote($now).' )'
- . ' AND ( a.publish_down = '.$db->Quote($nullDate).' OR a.publish_down >= '.$db->Quote($now).' )'
- . ' GROUP BY a.id'
- . ' ORDER BY '. $order
- ;
- $db->setQuery( $query, 0, $limit );
- $list = $db->loadObjectList();
- $limit -= count($list);
-
- if(isset($list))
- {
- foreach($list as $key => $item)
- {
- $list[$key]->href = ContentHelperRoute::getArticleRoute($item->slug, $item->catslug, $item->sectionid);
- }
- }
- $rows[] = $list;
- }
-
- // search uncategorised content
- if ( $sUncategorised && $limit > 0 )
- {
- $query = 'SELECT id, a.title AS title, a.created AS created, a.metadesc, a.metakey, '
- . ' CONCAT(a.introtext, a.fulltext) AS text,'
- . ' "2" as browsernav, "'. $db->Quote(JText::_('Uncategorised Content')) .'" AS section'
- . ' FROM #__content AS a'
- . ' WHERE ('.$where.')'
- . ' AND a.state = 1'
- . ' AND a.access <= '.(int) $user->get( 'aid' )
- . ' AND a.sectionid = 0'
- . ' AND a.catid = 0'
- . ' AND ( a.publish_up = '.$db->Quote($nullDate).' OR a.publish_up <= '.$db->Quote($now).' )'
- . ' AND ( a.publish_down = '.$db->Quote($nullDate).' OR a.publish_down >= '.$db->Quote($now).' )'
- . ' ORDER BY '. ($morder ? $morder : $order)
- ;
- $db->setQuery( $query, 0, $limit );
- $list2 = $db->loadObjectList();
- $limit -= count($list2);
-
- if(isset($list2))
- {
- foreach($list2 as $key => $item)
- {
- $list2[$key]->href = ContentHelperRoute::getArticleRoute($item->id);
- }
- }
-
- $rows[] = $list2;
- }
-
- // search archived content
- if ( $sArchived && $limit > 0 )
- {
- $searchArchived = JText::_( 'Archived' );
-
- $query = 'SELECT a.title AS title, a.metadesc, a.metakey,'
- . ' a.created AS created,'
- . ' CONCAT(a.introtext, a.fulltext) AS text,'
- . ' CASE WHEN CHAR_LENGTH(a.alias) THEN CONCAT_WS(":", a.id, a.alias) ELSE a.id END as slug,'
- . ' CASE WHEN CHAR_LENGTH(b.alias) THEN CONCAT_WS(":", b.id, b.alias) ELSE b.id END as catslug,'
- . ' u.id AS sectionid,'
- . ' CONCAT_WS( "/", u.title, b.title ) AS section,'
- . ' "2" AS browsernav'
- . ' FROM #__content AS a'
- . ' INNER JOIN #__categories AS b ON b.id=a.catid AND b.access <= ' .$user->get( 'gid' )
- . ' INNER JOIN #__sections AS u ON u.id = a.sectionid'
- . ' WHERE ( '.$where.' )'
- . ' AND a.state = -1'
- . ' AND u.published = 1'
- . ' AND b.published = 1'
- . ' AND a.access <= '.(int) $user->get( 'aid' )
- . ' AND b.access <= '.(int) $user->get( 'aid' )
- . ' AND u.access <= '.(int) $user->get( 'aid' )
- . ' AND ( a.publish_up = '.$db->Quote($nullDate).' OR a.publish_up <= '.$db->Quote($now).' )'
- . ' AND ( a.publish_down = '.$db->Quote($nullDate).' OR a.publish_down >= '.$db->Quote($now).' )'
- . ' ORDER BY '. $order
- ;
- $db->setQuery( $query, 0, $limit );
- $list3 = $db->loadObjectList();
-
- if(isset($list3))
- {
- foreach($list3 as $key => $item)
- {
- $list3[$key]->href = ContentHelperRoute::getArticleRoute($item->slug, $item->catslug, $item->sectionid);
- }
- }
-
- $rows[] = $list3;
- }
-
- $results = array();
- if(count($rows))
- {
- foreach($rows as $row)
- {
- $new_row = array();
- foreach($row AS $key => $article) {
- if(searchHelper::checkNoHTML($article, $searchText, array('text', 'title', 'metadesc', 'metakey'))) {
- $new_row[] = $article;
- }
- }
- $results = array_merge($results, (array) $new_row);
- }
- }
-
- return $results;
-}
+registerEvent( 'onSearch', 'plgSearchContent' );
+$mainframe->registerEvent( 'onSearchAreas', 'plgSearchContentAreas' );
+
+JPlugin::loadLanguage( 'plg_search_content' );
+
+/**
+ * @return array An array of search areas
+ */
+function &plgSearchContentAreas()
+{
+ static $areas = array(
+ 'content' => 'Articles'
+ );
+ return $areas;
+}
+
+/**
+ * Content Search method
+ * The sql must return the following fields that are used in a common display
+ * routine: href, title, section, created, text, browsernav
+ * @param string Target search string
+ * @param string mathcing option, exact|any|all
+ * @param string ordering option, newest|oldest|popular|alpha|category
+ * @param mixed An array if the search it to be restricted to areas, null if search all
+ */
+function plgSearchContent( $text, $phrase='', $ordering='', $areas=null )
+{
+ global $mainframe;
+
+ $db =& JFactory::getDBO();
+ $user =& JFactory::getUser();
+
+ require_once(JPATH_SITE.DS.'components'.DS.'com_content'.DS.'helpers'.DS.'route.php');
+ require_once(JPATH_SITE.DS.'administrator'.DS.'components'.DS.'com_search'.DS.'helpers'.DS.'search.php');
+
+ $searchText = $text;
+ if (is_array( $areas )) {
+ if (!array_intersect( $areas, array_keys( plgSearchContentAreas() ) )) {
+ return array();
+ }
+ }
+
+ // load plugin params info
+ $plugin =& JPluginHelper::getPlugin('search', 'content');
+ $pluginParams = new JParameter( $plugin->params );
+
+ $sContent = $pluginParams->get( 'search_content', 1 );
+ $sUncategorised = $pluginParams->get( 'search_uncategorised', 1 );
+ $sArchived = $pluginParams->get( 'search_archived', 1 );
+ $limit = $pluginParams->def( 'search_limit', 50 );
+
+ $nullDate = $db->getNullDate();
+ $date =& JFactory::getDate();
+ $now = $date->toMySQL();
+
+ $text = trim( $text );
+ if ($text == '') {
+ return array();
+ }
+
+ $wheres = array();
+ switch ($phrase) {
+ case 'exact':
+ $text = $db->Quote( '%'.$db->getEscaped( $text, true ).'%', false );
+ $wheres2 = array();
+ $wheres2[] = 'a.title LIKE '.$text;
+ $wheres2[] = 'a.introtext LIKE '.$text;
+ $wheres2[] = 'a.fulltext LIKE '.$text;
+ $wheres2[] = 'a.metakey LIKE '.$text;
+ $wheres2[] = 'a.metadesc LIKE '.$text;
+ $where = '(' . implode( ') OR (', $wheres2 ) . ')';
+ break;
+
+ case 'all':
+ case 'any':
+ default:
+ $words = explode( ' ', $text );
+ $wheres = array();
+ foreach ($words as $word) {
+ $word = $db->Quote( '%'.$db->getEscaped( $word, true ).'%', false );
+ $wheres2 = array();
+ $wheres2[] = 'a.title LIKE '.$word;
+ $wheres2[] = 'a.introtext LIKE '.$word;
+ $wheres2[] = 'a.fulltext LIKE '.$word;
+ $wheres2[] = 'a.metakey LIKE '.$word;
+ $wheres2[] = 'a.metadesc LIKE '.$word;
+ $wheres[] = implode( ' OR ', $wheres2 );
+ }
+ $where = '(' . implode( ($phrase == 'all' ? ') AND (' : ') OR ('), $wheres ) . ')';
+ break;
+ }
+
+ $morder = '';
+ switch ($ordering) {
+ case 'oldest':
+ $order = 'a.created ASC';
+ break;
+
+ case 'popular':
+ $order = 'a.hits DESC';
+ break;
+
+ case 'alpha':
+ $order = 'a.title ASC';
+ break;
+
+ case 'category':
+ $order = 'b.title ASC, a.title ASC';
+ $morder = 'a.title ASC';
+ break;
+
+ case 'newest':
+ default:
+ $order = 'a.created DESC';
+ break;
+ }
+
+ $rows = array();
+
+ // search articles
+ if ( $sContent && $limit > 0 )
+ {
+ $query = 'SELECT a.title AS title, a.metadesc, a.metakey,'
+ . ' a.created AS created,'
+ . ' CONCAT(a.introtext, a.fulltext) AS text,'
+ . ' CONCAT_WS( "/", u.title, b.title ) AS section,'
+ . ' CASE WHEN CHAR_LENGTH(a.alias) THEN CONCAT_WS(":", a.id, a.alias) ELSE a.id END as slug,'
+ . ' CASE WHEN CHAR_LENGTH(b.alias) THEN CONCAT_WS(":", b.id, b.alias) ELSE b.id END as catslug,'
+ . ' u.id AS sectionid,'
+ . ' "2" AS browsernav'
+ . ' FROM #__content AS a'
+ . ' INNER JOIN #__categories AS b ON b.id=a.catid'
+ . ' INNER JOIN #__sections AS u ON u.id = a.sectionid'
+ . ' WHERE ( '.$where.' )'
+ . ' AND a.state = 1'
+ . ' AND u.published = 1'
+ . ' AND b.published = 1'
+ . ' AND a.access <= '.(int) $user->get( 'aid' )
+ . ' AND b.access <= '.(int) $user->get( 'aid' )
+ . ' AND u.access <= '.(int) $user->get( 'aid' )
+ . ' AND ( a.publish_up = '.$db->Quote($nullDate).' OR a.publish_up <= '.$db->Quote($now).' )'
+ . ' AND ( a.publish_down = '.$db->Quote($nullDate).' OR a.publish_down >= '.$db->Quote($now).' )'
+ . ' GROUP BY a.id'
+ . ' ORDER BY '. $order
+ ;
+ $db->setQuery( $query, 0, $limit );
+ $list = $db->loadObjectList();
+ $limit -= count($list);
+
+ if(isset($list))
+ {
+ foreach($list as $key => $item)
+ {
+ $list[$key]->href = ContentHelperRoute::getArticleRoute($item->slug, $item->catslug, $item->sectionid);
+ }
+ }
+ $rows[] = $list;
+ }
+
+ // search uncategorised content
+ if ( $sUncategorised && $limit > 0 )
+ {
+ $query = 'SELECT id, a.title AS title, a.created AS created, a.metadesc, a.metakey, '
+ . ' CONCAT(a.introtext, a.fulltext) AS text,'
+ . ' "2" as browsernav, "'. $db->getEscaped(JText::_('Uncategorised Content')) .'" AS section'
+ . ' FROM #__content AS a'
+ . ' WHERE ('.$where.')'
+ . ' AND a.state = 1'
+ . ' AND a.access <= '.(int) $user->get( 'aid' )
+ . ' AND a.sectionid = 0'
+ . ' AND a.catid = 0'
+ . ' AND ( a.publish_up = '.$db->Quote($nullDate).' OR a.publish_up <= '.$db->Quote($now).' )'
+ . ' AND ( a.publish_down = '.$db->Quote($nullDate).' OR a.publish_down >= '.$db->Quote($now).' )'
+ . ' ORDER BY '. ($morder ? $morder : $order)
+ ;
+ $db->setQuery( $query, 0, $limit );
+ $list2 = $db->loadObjectList();
+ $limit -= count($list2);
+
+ if(isset($list2))
+ {
+ foreach($list2 as $key => $item)
+ {
+ $list2[$key]->href = ContentHelperRoute::getArticleRoute($item->id);
+ }
+ }
+
+ $rows[] = $list2;
+ }
+
+ // search archived content
+ if ( $sArchived && $limit > 0 )
+ {
+ $searchArchived = JText::_( 'Archived' );
+
+ $query = 'SELECT a.title AS title, a.metadesc, a.metakey,'
+ . ' a.created AS created,'
+ . ' CONCAT(a.introtext, a.fulltext) AS text,'
+ . ' CASE WHEN CHAR_LENGTH(a.alias) THEN CONCAT_WS(":", a.id, a.alias) ELSE a.id END as slug,'
+ . ' CASE WHEN CHAR_LENGTH(b.alias) THEN CONCAT_WS(":", b.id, b.alias) ELSE b.id END as catslug,'
+ . ' u.id AS sectionid,'
+ . ' CONCAT_WS( "/", u.title, b.title ) AS section,'
+ . ' "2" AS browsernav'
+ . ' FROM #__content AS a'
+ . ' INNER JOIN #__categories AS b ON b.id=a.catid AND b.access <= ' .$user->get( 'gid' )
+ . ' INNER JOIN #__sections AS u ON u.id = a.sectionid'
+ . ' WHERE ( '.$where.' )'
+ . ' AND a.state = -1'
+ . ' AND u.published = 1'
+ . ' AND b.published = 1'
+ . ' AND a.access <= '.(int) $user->get( 'aid' )
+ . ' AND b.access <= '.(int) $user->get( 'aid' )
+ . ' AND u.access <= '.(int) $user->get( 'aid' )
+ . ' AND ( a.publish_up = '.$db->Quote($nullDate).' OR a.publish_up <= '.$db->Quote($now).' )'
+ . ' AND ( a.publish_down = '.$db->Quote($nullDate).' OR a.publish_down >= '.$db->Quote($now).' )'
+ . ' ORDER BY '. $order
+ ;
+ $db->setQuery( $query, 0, $limit );
+ $list3 = $db->loadObjectList();
+
+ if(isset($list3))
+ {
+ foreach($list3 as $key => $item)
+ {
+ $list3[$key]->href = ContentHelperRoute::getArticleRoute($item->slug, $item->catslug, $item->sectionid);
+ }
+ }
+
+ $rows[] = $list3;
+ }
+
+ $results = array();
+ if(count($rows))
+ {
+ foreach($rows as $row)
+ {
+ $new_row = array();
+ foreach($row AS $key => $article) {
+ if(searchHelper::checkNoHTML($article, $searchText, array('text', 'title', 'metadesc', 'metakey'))) {
+ $new_row[] = $article;
+ }
+ }
+ $results = array_merge($results, (array) $new_row);
+ }
+ }
+
+ return $results;
+}
diff --git a/oss/joomla/trunk/plugins/search/content.xml b/oss/joomla/trunk/plugins/search/content.xml
index a5e2df08..059ca092 100644
--- a/oss/joomla/trunk/plugins/search/content.xml
+++ b/oss/joomla/trunk/plugins/search/content.xml
@@ -3,7 +3,7 @@
Search - Content
Joomla! Project
November 2005
- Copyright (C) 2005 - 2008 Open Source Matters. All rights reserved.
+ Copyright (C) 2005 - 2010 Open Source Matters. All rights reserved.
http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL
admin@joomla.org
www.joomla.org
diff --git a/oss/joomla/trunk/plugins/search/newsfeeds.php b/oss/joomla/trunk/plugins/search/newsfeeds.php
index 57a9ffb5..d1029ff8 100644
--- a/oss/joomla/trunk/plugins/search/newsfeeds.php
+++ b/oss/joomla/trunk/plugins/search/newsfeeds.php
@@ -1,131 +1,131 @@
-registerEvent( 'onSearch', 'plgSearchNewsfeedslinks' );
-$mainframe->registerEvent( 'onSearchAreas', 'plgSearchNewsfeedAreas' );
-
-JPlugin::loadLanguage( 'plg_search_newsfeeds' );
-
-/**
- * @return array An array of search areas
- */
-function &plgSearchNewsfeedAreas()
-{
- static $areas = array(
- 'newsfeeds' => 'Newsfeeds'
- );
- return $areas;
-}
-
-/**
-* Contacts Search method
-*
-* The sql must return the following fields that are used in a common display
-* routine: href, title, section, created, text, browsernav
-* @param string Target search string
-* @param string mathcing option, exact|any|all
-* @param string ordering option, newest|oldest|popular|alpha|category
- * @param mixed An array if the search it to be restricted to areas, null if search all
-*/
-function plgSearchNewsfeedslinks( $text, $phrase='', $ordering='', $areas=null )
-{
- $db =& JFactory::getDBO();
- $user =& JFactory::getUser();
-
- if (is_array( $areas )) {
- if (!array_intersect( $areas, array_keys( plgSearchNewsfeedAreas() ) )) {
- return array();
- }
- }
-
- // load plugin params info
- $plugin =& JPluginHelper::getPlugin('search', 'newsfeeds');
- $pluginParams = new JParameter( $plugin->params );
-
- $limit = $pluginParams->def( 'search_limit', 50 );
-
- $text = trim( $text );
- if ($text == '') {
- return array();
- }
-
- $wheres = array();
- switch ($phrase) {
- case 'exact':
- $text = $db->Quote( '%'.$db->getEscaped( $text, true ).'%', false );
- $wheres2 = array();
- $wheres2[] = 'a.name LIKE '.$text;
- $wheres2[] = 'a.link LIKE '.$text;
- $where = '(' . implode( ') OR (', $wheres2 ) . ')';
- break;
-
- case 'all':
- case 'any':
- default:
- $words = explode( ' ', $text );
- $wheres = array();
- foreach ($words as $word)
- {
- $word = $db->Quote( '%'.$db->getEscaped( $word, true ).'%', false );
- $wheres2 = array();
- $wheres2[] = 'a.name LIKE '.$word;
- $wheres2[] = 'a.link LIKE '.$word;
- $wheres[] = implode( ' OR ', $wheres2 );
- }
- $where = '(' . implode( ($phrase == 'all' ? ') AND (' : ') OR ('), $wheres ) . ')';
- break;
- }
-
- switch ( $ordering ) {
- case 'alpha':
- $order = 'a.name ASC';
- break;
-
- case 'category':
- $order = 'b.title ASC, a.name ASC';
- break;
-
- case 'oldest':
- case 'popular':
- case 'newest':
- default:
- $order = 'a.name ASC';
- }
-
- $searchNewsfeeds = JText::_( 'Newsfeeds' );
-
- $query = 'SELECT a.name AS title, "" AS created, a.link AS text,'
- . ' CASE WHEN CHAR_LENGTH(a.alias) THEN CONCAT_WS(\':\', a.id, a.alias) ELSE a.id END as slug, '
- . ' CASE WHEN CHAR_LENGTH(b.alias) THEN CONCAT_WS(\':\', b.id, b.alias) ELSE b.id END as catslug, '
- . ' CONCAT_WS( " / ", '. $db->Quote($searchNewsfeeds) .', b.title )AS section,'
- . ' "1" AS browsernav'
- . ' FROM #__newsfeeds AS a'
- . ' INNER JOIN #__categories AS b ON b.id = a.catid'
- . ' WHERE ( '. $where .' )'
- . ' AND a.published = 1'
- . ' AND b.published = 1'
- . ' AND b.access <= '. (int) $user->get( 'aid' )
- . ' ORDER BY '. $order
- ;
- $db->setQuery( $query, 0, $limit );
- $rows = $db->loadObjectList();
-
- foreach($rows as $key => $row) {
- $rows[$key]->href = 'index.php?option=com_newsfeeds&view=newsfeed&catid='.$row->catslug.'&id='.$row->slug;
- }
-
- return $rows;
-}
+registerEvent( 'onSearch', 'plgSearchNewsfeedslinks' );
+$mainframe->registerEvent( 'onSearchAreas', 'plgSearchNewsfeedAreas' );
+
+JPlugin::loadLanguage( 'plg_search_newsfeeds' );
+
+/**
+ * @return array An array of search areas
+ */
+function &plgSearchNewsfeedAreas()
+{
+ static $areas = array(
+ 'newsfeeds' => 'Newsfeeds'
+ );
+ return $areas;
+}
+
+/**
+* Contacts Search method
+*
+* The sql must return the following fields that are used in a common display
+* routine: href, title, section, created, text, browsernav
+* @param string Target search string
+* @param string mathcing option, exact|any|all
+* @param string ordering option, newest|oldest|popular|alpha|category
+ * @param mixed An array if the search it to be restricted to areas, null if search all
+*/
+function plgSearchNewsfeedslinks( $text, $phrase='', $ordering='', $areas=null )
+{
+ $db =& JFactory::getDBO();
+ $user =& JFactory::getUser();
+
+ if (is_array( $areas )) {
+ if (!array_intersect( $areas, array_keys( plgSearchNewsfeedAreas() ) )) {
+ return array();
+ }
+ }
+
+ // load plugin params info
+ $plugin =& JPluginHelper::getPlugin('search', 'newsfeeds');
+ $pluginParams = new JParameter( $plugin->params );
+
+ $limit = $pluginParams->def( 'search_limit', 50 );
+
+ $text = trim( $text );
+ if ($text == '') {
+ return array();
+ }
+
+ $wheres = array();
+ switch ($phrase) {
+ case 'exact':
+ $text = $db->Quote( '%'.$db->getEscaped( $text, true ).'%', false );
+ $wheres2 = array();
+ $wheres2[] = 'a.name LIKE '.$text;
+ $wheres2[] = 'a.link LIKE '.$text;
+ $where = '(' . implode( ') OR (', $wheres2 ) . ')';
+ break;
+
+ case 'all':
+ case 'any':
+ default:
+ $words = explode( ' ', $text );
+ $wheres = array();
+ foreach ($words as $word)
+ {
+ $word = $db->Quote( '%'.$db->getEscaped( $word, true ).'%', false );
+ $wheres2 = array();
+ $wheres2[] = 'a.name LIKE '.$word;
+ $wheres2[] = 'a.link LIKE '.$word;
+ $wheres[] = implode( ' OR ', $wheres2 );
+ }
+ $where = '(' . implode( ($phrase == 'all' ? ') AND (' : ') OR ('), $wheres ) . ')';
+ break;
+ }
+
+ switch ( $ordering ) {
+ case 'alpha':
+ $order = 'a.name ASC';
+ break;
+
+ case 'category':
+ $order = 'b.title ASC, a.name ASC';
+ break;
+
+ case 'oldest':
+ case 'popular':
+ case 'newest':
+ default:
+ $order = 'a.name ASC';
+ }
+
+ $searchNewsfeeds = JText::_( 'Newsfeeds' );
+
+ $query = 'SELECT a.name AS title, "" AS created, a.link AS text,'
+ . ' CASE WHEN CHAR_LENGTH(a.alias) THEN CONCAT_WS(\':\', a.id, a.alias) ELSE a.id END as slug, '
+ . ' CASE WHEN CHAR_LENGTH(b.alias) THEN CONCAT_WS(\':\', b.id, b.alias) ELSE b.id END as catslug, '
+ . ' CONCAT_WS( " / ", '. $db->Quote($searchNewsfeeds) .', b.title )AS section,'
+ . ' "1" AS browsernav'
+ . ' FROM #__newsfeeds AS a'
+ . ' INNER JOIN #__categories AS b ON b.id = a.catid'
+ . ' WHERE ( '. $where .' )'
+ . ' AND a.published = 1'
+ . ' AND b.published = 1'
+ . ' AND b.access <= '. (int) $user->get( 'aid' )
+ . ' ORDER BY '. $order
+ ;
+ $db->setQuery( $query, 0, $limit );
+ $rows = $db->loadObjectList();
+
+ foreach($rows as $key => $row) {
+ $rows[$key]->href = 'index.php?option=com_newsfeeds&view=newsfeed&catid='.$row->catslug.'&id='.$row->slug;
+ }
+
+ return $rows;
+}
diff --git a/oss/joomla/trunk/plugins/search/newsfeeds.xml b/oss/joomla/trunk/plugins/search/newsfeeds.xml
index 2b55e3f4..d2cb58f5 100644
--- a/oss/joomla/trunk/plugins/search/newsfeeds.xml
+++ b/oss/joomla/trunk/plugins/search/newsfeeds.xml
@@ -3,7 +3,7 @@
Search - Newsfeeds
Joomla! Project
November 2005
- Copyright (C) 2005 - 2008 Open Source Matters. All rights reserved.
+ Copyright (C) 2005 - 2010 Open Source Matters. All rights reserved.
http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL
admin@joomla.org
www.joomla.org
diff --git a/oss/joomla/trunk/plugins/search/sections.php b/oss/joomla/trunk/plugins/search/sections.php
index dd0fac0d..eefc6681 100644
--- a/oss/joomla/trunk/plugins/search/sections.php
+++ b/oss/joomla/trunk/plugins/search/sections.php
@@ -1,112 +1,112 @@
-registerEvent( 'onSearch', 'plgSearchSections' );
-$mainframe->registerEvent( 'onSearchAreas', 'plgSearchSectionAreas' );
-
-JPlugin::loadLanguage( 'plg_search_sections' );
-
-/**
- * @return array An array of search areas
- */
-function &plgSearchSectionAreas() {
- static $areas = array(
- 'sections' => 'Sections'
- );
- return $areas;
-}
-
-/**
-* Sections Search method
-*
-* The sql must return the following fields that are used in a common display
-* routine: href, title, section, created, text, browsernav
-* @param string Target search string
-* @param string mathcing option, exact|any|all
-* @param string ordering option, newest|oldest|popular|alpha|category
- * @param mixed An array if restricted to areas, null if search all
-*/
-function plgSearchSections( $text, $phrase='', $ordering='', $areas=null )
-{
- $db =& JFactory::getDBO();
- $user =& JFactory::getUser();
-
- $searchText = $text;
-
- require_once(JPATH_SITE.DS.'components'.DS.'com_content'.DS.'helpers'.DS.'route.php');
-
- if (is_array( $areas )) {
- if (!array_intersect( $areas, array_keys( plgSearchSectionAreas() ) )) {
- return array();
- }
- }
-
- // load plugin params info
- $plugin =& JPluginHelper::getPlugin('search', 'sections');
- $pluginParams = new JParameter( $plugin->params );
-
- $limit = $pluginParams->def( 'search_limit', 50 );
-
- $text = trim( $text );
- if ($text == '') {
- return array();
- }
-
- switch ( $ordering ) {
- case 'alpha':
- $order = 'a.name ASC';
- break;
-
- case 'category':
- case 'popular':
- case 'newest':
- case 'oldest':
- default:
- $order = 'a.name DESC';
- }
-
- $text = $db->Quote( '%'.$db->getEscaped( $text, true ).'%', false );
- $query = 'SELECT a.title AS title, a.description AS text, a.name, '
- . ' "" AS created,'
- . ' "2" AS browsernav,'
- . ' a.id AS secid'
- . ' FROM #__sections AS a'
- . ' WHERE ( a.name LIKE '.$text
- . ' OR a.title LIKE '.$text
- . ' OR a.description LIKE '.$text.' )'
- . ' AND a.published = 1'
- . ' AND a.access <= '.(int) $user->get( 'aid' )
- . ' GROUP BY a.id'
- . ' ORDER BY '. $order
- ;
- $db->setQuery( $query, 0, $limit );
- $rows = $db->loadObjectList();
-
- $count = count( $rows );
- for ( $i = 0; $i < $count; $i++ )
- {
- $rows[$i]->href = ContentHelperRoute::getSectionRoute($rows[$i]->secid);
- $rows[$i]->section = JText::_( 'Section' );
- }
-
- $return = array();
- foreach($rows AS $key => $section) {
- if(searchHelper::checkNoHTML($section, $searchText, array('name', 'title', 'text'))) {
- $return[] = $section;
- }
- }
- return $return;
-}
+registerEvent( 'onSearch', 'plgSearchSections' );
+$mainframe->registerEvent( 'onSearchAreas', 'plgSearchSectionAreas' );
+
+JPlugin::loadLanguage( 'plg_search_sections' );
+
+/**
+ * @return array An array of search areas
+ */
+function &plgSearchSectionAreas() {
+ static $areas = array(
+ 'sections' => 'Sections'
+ );
+ return $areas;
+}
+
+/**
+* Sections Search method
+*
+* The sql must return the following fields that are used in a common display
+* routine: href, title, section, created, text, browsernav
+* @param string Target search string
+* @param string mathcing option, exact|any|all
+* @param string ordering option, newest|oldest|popular|alpha|category
+ * @param mixed An array if restricted to areas, null if search all
+*/
+function plgSearchSections( $text, $phrase='', $ordering='', $areas=null )
+{
+ $db =& JFactory::getDBO();
+ $user =& JFactory::getUser();
+
+ $searchText = $text;
+
+ require_once(JPATH_SITE.DS.'components'.DS.'com_content'.DS.'helpers'.DS.'route.php');
+
+ if (is_array( $areas )) {
+ if (!array_intersect( $areas, array_keys( plgSearchSectionAreas() ) )) {
+ return array();
+ }
+ }
+
+ // load plugin params info
+ $plugin =& JPluginHelper::getPlugin('search', 'sections');
+ $pluginParams = new JParameter( $plugin->params );
+
+ $limit = $pluginParams->def( 'search_limit', 50 );
+
+ $text = trim( $text );
+ if ($text == '') {
+ return array();
+ }
+
+ switch ( $ordering ) {
+ case 'alpha':
+ $order = 'a.name ASC';
+ break;
+
+ case 'category':
+ case 'popular':
+ case 'newest':
+ case 'oldest':
+ default:
+ $order = 'a.name DESC';
+ }
+
+ $text = $db->Quote( '%'.$db->getEscaped( $text, true ).'%', false );
+ $query = 'SELECT a.title AS title, a.description AS text, a.name, '
+ . ' "" AS created,'
+ . ' "2" AS browsernav,'
+ . ' a.id AS secid'
+ . ' FROM #__sections AS a'
+ . ' WHERE ( a.name LIKE '.$text
+ . ' OR a.title LIKE '.$text
+ . ' OR a.description LIKE '.$text.' )'
+ . ' AND a.published = 1'
+ . ' AND a.access <= '.(int) $user->get( 'aid' )
+ . ' GROUP BY a.id'
+ . ' ORDER BY '. $order
+ ;
+ $db->setQuery( $query, 0, $limit );
+ $rows = $db->loadObjectList();
+
+ $count = count( $rows );
+ for ( $i = 0; $i < $count; $i++ )
+ {
+ $rows[$i]->href = ContentHelperRoute::getSectionRoute($rows[$i]->secid);
+ $rows[$i]->section = JText::_( 'Section' );
+ }
+
+ $return = array();
+ foreach($rows AS $key => $section) {
+ if(searchHelper::checkNoHTML($section, $searchText, array('name', 'title', 'text'))) {
+ $return[] = $section;
+ }
+ }
+ return $return;
+}
diff --git a/oss/joomla/trunk/plugins/search/sections.xml b/oss/joomla/trunk/plugins/search/sections.xml
index e0fe90f7..3b35b228 100644
--- a/oss/joomla/trunk/plugins/search/sections.xml
+++ b/oss/joomla/trunk/plugins/search/sections.xml
@@ -3,7 +3,7 @@
Search - Sections
Joomla! Project
November 2005
- Copyright (C) 2005 - 2008 Open Source Matters. All rights reserved.
+ Copyright (C) 2005 - 2010 Open Source Matters. All rights reserved.
http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL
admin@joomla.org
www.joomla.org
diff --git a/oss/joomla/trunk/plugins/search/weblinks.php b/oss/joomla/trunk/plugins/search/weblinks.php
index 57aae739..d662a0ae 100644
--- a/oss/joomla/trunk/plugins/search/weblinks.php
+++ b/oss/joomla/trunk/plugins/search/weblinks.php
@@ -1,150 +1,150 @@
-registerEvent( 'onSearch', 'plgSearchWeblinks' );
-$mainframe->registerEvent( 'onSearchAreas', 'plgSearchWeblinksAreas' );
-
-JPlugin::loadLanguage( 'plg_search_weblinks' );
-
-/**
- * @return array An array of search areas
- */
-function &plgSearchWeblinksAreas() {
- static $areas = array(
- 'weblinks' => 'Weblinks'
- );
- return $areas;
-}
-
-/**
-* Weblink Search method
-*
-* The sql must return the following fields that are used in a common display
-* routine: href, title, section, created, text, browsernav
-* @param string Target search string
-* @param string mathcing option, exact|any|all
-* @param string ordering option, newest|oldest|popular|alpha|category
- * @param mixed An array if the search it to be restricted to areas, null if search all
- */
-function plgSearchWeblinks( $text, $phrase='', $ordering='', $areas=null )
-{
- $db =& JFactory::getDBO();
- $user =& JFactory::getUser();
-
- $searchText = $text;
-
- require_once(JPATH_SITE.DS.'components'.DS.'com_weblinks'.DS.'helpers'.DS.'route.php');
-
- if (is_array( $areas )) {
- if (!array_intersect( $areas, array_keys( plgSearchWeblinksAreas() ) )) {
- return array();
- }
- }
-
- // load plugin params info
- $plugin =& JPluginHelper::getPlugin('search', 'weblinks');
- $pluginParams = new JParameter( $plugin->params );
-
- $limit = $pluginParams->def( 'search_limit', 50 );
-
- $text = trim( $text );
- if ($text == '') {
- return array();
- }
- $section = JText::_( 'Web Links' );
-
- $wheres = array();
- switch ($phrase)
- {
- case 'exact':
- $text = $db->Quote( '%'.$db->getEscaped( $text, true ).'%', false );
- $wheres2 = array();
- $wheres2[] = 'a.url LIKE '.$text;
- $wheres2[] = 'a.description LIKE '.$text;
- $wheres2[] = 'a.title LIKE '.$text;
- $where = '(' . implode( ') OR (', $wheres2 ) . ')';
- break;
-
- case 'all':
- case 'any':
- default:
- $words = explode( ' ', $text );
- $wheres = array();
- foreach ($words as $word)
- {
- $word = $db->Quote( '%'.$db->getEscaped( $word, true ).'%', false );
- $wheres2 = array();
- $wheres2[] = 'a.url LIKE '.$word;
- $wheres2[] = 'a.description LIKE '.$word;
- $wheres2[] = 'a.title LIKE '.$word;
- $wheres[] = implode( ' OR ', $wheres2 );
- }
- $where = '(' . implode( ($phrase == 'all' ? ') AND (' : ') OR ('), $wheres ) . ')';
- break;
- }
-
- switch ( $ordering )
- {
- case 'oldest':
- $order = 'a.date ASC';
- break;
-
- case 'popular':
- $order = 'a.hits DESC';
- break;
-
- case 'alpha':
- $order = 'a.title ASC';
- break;
-
- case 'category':
- $order = 'b.title ASC, a.title ASC';
- break;
-
- case 'newest':
- default:
- $order = 'a.date DESC';
- }
-
- $query = 'SELECT a.title AS title, a.description AS text, a.date AS created, a.url, '
- . ' CASE WHEN CHAR_LENGTH(a.alias) THEN CONCAT_WS(\':\', a.id, a.alias) ELSE a.id END as slug, '
- . ' CASE WHEN CHAR_LENGTH(b.alias) THEN CONCAT_WS(\':\', b.id, b.alias) ELSE b.id END as catslug, '
- . ' CONCAT_WS( " / ", '.$db->Quote($section).', b.title ) AS section,'
- . ' "1" AS browsernav'
- . ' FROM #__weblinks AS a'
- . ' INNER JOIN #__categories AS b ON b.id = a.catid'
- . ' WHERE ('. $where .')'
- . ' AND a.published = 1'
- . ' AND b.published = 1'
- . ' AND b.access <= '.(int) $user->get( 'aid' )
- . ' ORDER BY '. $order
- ;
- $db->setQuery( $query, 0, $limit );
- $rows = $db->loadObjectList();
-
- foreach($rows as $key => $row) {
- $rows[$key]->href = WeblinksHelperRoute::getWeblinkRoute($row->slug, $row->catslug);
- }
-
- $return = array();
- foreach($rows AS $key => $weblink) {
- if(searchHelper::checkNoHTML($weblink, $searchText, array('url', 'text', 'title'))) {
- $return[] = $weblink;
- }
- }
-
- return $return;
-}
+registerEvent( 'onSearch', 'plgSearchWeblinks' );
+$mainframe->registerEvent( 'onSearchAreas', 'plgSearchWeblinksAreas' );
+
+JPlugin::loadLanguage( 'plg_search_weblinks' );
+
+/**
+ * @return array An array of search areas
+ */
+function &plgSearchWeblinksAreas() {
+ static $areas = array(
+ 'weblinks' => 'Weblinks'
+ );
+ return $areas;
+}
+
+/**
+* Weblink Search method
+*
+* The sql must return the following fields that are used in a common display
+* routine: href, title, section, created, text, browsernav
+* @param string Target search string
+* @param string mathcing option, exact|any|all
+* @param string ordering option, newest|oldest|popular|alpha|category
+ * @param mixed An array if the search it to be restricted to areas, null if search all
+ */
+function plgSearchWeblinks( $text, $phrase='', $ordering='', $areas=null )
+{
+ $db =& JFactory::getDBO();
+ $user =& JFactory::getUser();
+
+ $searchText = $text;
+
+ require_once(JPATH_SITE.DS.'components'.DS.'com_weblinks'.DS.'helpers'.DS.'route.php');
+
+ if (is_array( $areas )) {
+ if (!array_intersect( $areas, array_keys( plgSearchWeblinksAreas() ) )) {
+ return array();
+ }
+ }
+
+ // load plugin params info
+ $plugin =& JPluginHelper::getPlugin('search', 'weblinks');
+ $pluginParams = new JParameter( $plugin->params );
+
+ $limit = $pluginParams->def( 'search_limit', 50 );
+
+ $text = trim( $text );
+ if ($text == '') {
+ return array();
+ }
+ $section = JText::_( 'Web Links' );
+
+ $wheres = array();
+ switch ($phrase)
+ {
+ case 'exact':
+ $text = $db->Quote( '%'.$db->getEscaped( $text, true ).'%', false );
+ $wheres2 = array();
+ $wheres2[] = 'a.url LIKE '.$text;
+ $wheres2[] = 'a.description LIKE '.$text;
+ $wheres2[] = 'a.title LIKE '.$text;
+ $where = '(' . implode( ') OR (', $wheres2 ) . ')';
+ break;
+
+ case 'all':
+ case 'any':
+ default:
+ $words = explode( ' ', $text );
+ $wheres = array();
+ foreach ($words as $word)
+ {
+ $word = $db->Quote( '%'.$db->getEscaped( $word, true ).'%', false );
+ $wheres2 = array();
+ $wheres2[] = 'a.url LIKE '.$word;
+ $wheres2[] = 'a.description LIKE '.$word;
+ $wheres2[] = 'a.title LIKE '.$word;
+ $wheres[] = implode( ' OR ', $wheres2 );
+ }
+ $where = '(' . implode( ($phrase == 'all' ? ') AND (' : ') OR ('), $wheres ) . ')';
+ break;
+ }
+
+ switch ( $ordering )
+ {
+ case 'oldest':
+ $order = 'a.date ASC';
+ break;
+
+ case 'popular':
+ $order = 'a.hits DESC';
+ break;
+
+ case 'alpha':
+ $order = 'a.title ASC';
+ break;
+
+ case 'category':
+ $order = 'b.title ASC, a.title ASC';
+ break;
+
+ case 'newest':
+ default:
+ $order = 'a.date DESC';
+ }
+
+ $query = 'SELECT a.title AS title, a.description AS text, a.date AS created, a.url, '
+ . ' CASE WHEN CHAR_LENGTH(a.alias) THEN CONCAT_WS(\':\', a.id, a.alias) ELSE a.id END as slug, '
+ . ' CASE WHEN CHAR_LENGTH(b.alias) THEN CONCAT_WS(\':\', b.id, b.alias) ELSE b.id END as catslug, '
+ . ' CONCAT_WS( " / ", '.$db->Quote($section).', b.title ) AS section,'
+ . ' "1" AS browsernav'
+ . ' FROM #__weblinks AS a'
+ . ' INNER JOIN #__categories AS b ON b.id = a.catid'
+ . ' WHERE ('. $where .')'
+ . ' AND a.published = 1'
+ . ' AND b.published = 1'
+ . ' AND b.access <= '.(int) $user->get( 'aid' )
+ . ' ORDER BY '. $order
+ ;
+ $db->setQuery( $query, 0, $limit );
+ $rows = $db->loadObjectList();
+
+ foreach($rows as $key => $row) {
+ $rows[$key]->href = WeblinksHelperRoute::getWeblinkRoute($row->slug, $row->catslug);
+ }
+
+ $return = array();
+ foreach($rows AS $key => $weblink) {
+ if(searchHelper::checkNoHTML($weblink, $searchText, array('url', 'text', 'title'))) {
+ $return[] = $weblink;
+ }
+ }
+
+ return $return;
+}
diff --git a/oss/joomla/trunk/plugins/search/weblinks.xml b/oss/joomla/trunk/plugins/search/weblinks.xml
index 1678cb11..240fbb62 100644
--- a/oss/joomla/trunk/plugins/search/weblinks.xml
+++ b/oss/joomla/trunk/plugins/search/weblinks.xml
@@ -3,7 +3,7 @@
Search - Weblinks
Joomla! Project
November 2005
- Copyright (C) 2005 - 2008 Open Source Matters. All rights reserved.
+ Copyright (C) 2005 - 2010 Open Source Matters. All rights reserved.
http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL
admin@joomla.org
www.joomla.org
diff --git a/oss/joomla/trunk/plugins/system/backlink.php b/oss/joomla/trunk/plugins/system/backlink.php
index cceec708..b9a32e78 100644
--- a/oss/joomla/trunk/plugins/system/backlink.php
+++ b/oss/joomla/trunk/plugins/system/backlink.php
@@ -1,529 +1,529 @@
-_db = JFactory::getDBO();
- parent :: __construct($subject, $config);
- }
-
- function onAfterInitialise()
- {
- global $mainframe;
- if ($mainframe->isAdmin()) {
- return; // Dont run in admin
- }
-
- $sef = $this->params->get('sef', 1);
- $url = $this->params->get('url', 1);
-
- $legacysef = $this->params->get('legacysef', 1);
- if (!$sef && !$url && !$legacysef)
- return; // None of the options enabled, bail!
-
- // Grab the system as early as possible, we're going to terminate it potentially
- // Case 1: Query string match (shouldn't need this but its here anyway)
- if ($url && isset ($_SERVER['QUERY_STRING']) && strlen($_SERVER['QUERY_STRING']) && strpos($_SERVER['QUERY_STRING'], '&')) {
- $query_string = $_SERVER['QUERY_STRING'];
- $this->_lookup($query_string);
- }
-
- // Case 2: SEF or similar match
- if ($sef && isset ($_SERVER['SCRIPT_NAME']) && isset ($_SERVER['REQUEST_URI'])) {
- $part = str_replace('index.php', '', $_SERVER['SCRIPT_NAME']);
- if($part != '/') {
- $search = str_replace($part, '', $_SERVER['REQUEST_URI']);
- } else {
- $search = ltrim($_SERVER['REQUEST_URI'],'/');
- }
- $this->_lookup($search);
- }
- // Case 3: Old school core sef; used to backlink
- // Enable only if:
- // 1: SEF is enabled
- // 2: Legacy SEF Plugin Param is set
- // 3: And there is no backlink
- if ($mainframe->getCfg('sef')
- && $legacysef
- && !strstr($_SERVER['REQUEST_URI'],'nobacklink')
- && !strlen($_SERVER['QUERY_STRING'])) {
- $this->_legacysef();
- }
-
- }
-
- function _lookup($searchstring)
- {
- // return blank strings and just index.php on its own...
- if (!strlen($searchstring) || $searchstring == trim('index.php',' ?')) {
- return;
- }
-
- $sef = $this->params->get('sef', 1);
- $url = $this->params->get('url', 1);
-
- if (!$sef && !$url) {
- return; // Neither option enabled, bail!
- }
-
- $query = 'SELECT * FROM #__migration_backlinks WHERE ';
- $where = Array ();
- $search = $this->_db->Quote( $this->_db->getEscaped( $searchstring, true ).'%', false );
-
- if ($url) {
- $where[] = 'url LIKE ' . $search;
- }
- if ($sef) {
- $where[] = 'sefurl LIKE ' . $search;
- }
-
- $query .= implode(' OR ', $where);
- $this->_db->setQuery($query);
- $results = $this->_db->loadAssocList();
-
- if (count($results)) {
- // Get the first one...
- $this->_redirect($results[0]['itemid'], $results[0]['name'], $results[0]['newurl']);
- }
- }
-
- function _redirect($Itemid, $name, $url = null)
- {
- global $mainframe;
- if (!strlen($url))
- {
- $menu = & JSite :: getMenu();
- $item = $menu->getItem($Itemid);
- //$url = $item->link;
-
- switch ($item->type)
- {
- case 'url' :
- if ((strpos($item->link, 'index.php?') !== false) && (strpos($item->link, 'Itemid=') === false)) {
- $url = $item->link . '&Itemid=' . $item->id;
- } else {
- $url = $item->link;
- }
- break;
-
- default :
- $url = 'index.php?Itemid=' . $item->id;
- //$url = $item->link . '&Itemid='.$item->id;
- break;
- }
- $url = JRoute :: _($url);
- //$url = JURI :: base() . $url; // was $surl with third option of below being url and second being surl
- $name = $item->name;
- }
- // Check we're not redirecting to ourselves
- if(!stristr($url,$_SERVER['REQUEST_URI']) && !stristr($url,$_SERVER['SCRIPT_NAME'].'/'.$_SERVER['QUERY_STRING'])) {
- return;
- }
-
- $name = $name ? $name : "Unknown";
-
- header('Location: ' . str_replace('&','&',$url), true, '301'); // redirect and kill of and &
- jexit(JText :: sprintf('"%s" has moved to %s. Click the link if your browser does not redirect you automatically.', $name, $url, $url));
- }
-
- function _legacysef()
- {
- $mosConfig_absolute_path = JPATH_SITE;
- $mosConfig_live_site = JURI :: base();
- $url_array = explode('/', $_SERVER['REQUEST_URI']);
-
- if (in_array('content', $url_array))
- {
- /**
- * Content
- * http://www.domain.com/$option/$task/$sectionid/$id/$Itemid/$limit/$limitstart
- */
-
- $uri = explode('content/', $_SERVER['REQUEST_URI']);
- $option = 'com_content';
- $_GET['option'] = $option;
- $_REQUEST['option'] = $option;
- $pos = array_search('content', $url_array);
-
- // language hook for content
- $lang = '';
- foreach ($url_array as $key => $value)
- {
- if (!strcasecmp(substr($value, 0, 5), 'lang,'))
- {
- $temp = explode(',', $value);
- if (isset ($temp[0]) && $temp[0] != '' && isset ($temp[1]) && $temp[1] != '')
- {
- $_GET['lang'] = $temp[1];
- $_REQUEST['lang'] = $temp[1];
- $lang = $temp[1];
- }
- unset ($url_array[$key]);
- }
- }
-
- if (isset ($url_array[$pos +8]) && $url_array[$pos +8] != '' && in_array('category', $url_array) && (strpos($url_array[$pos +5], 'order,') !== false) && (strpos($url_array[$pos +6], 'filter,') !== false))
- {
- // $option/$task/$sectionid/$id/$Itemid/$order/$filter/$limit/$limitstart
- $task = $url_array[$pos +1];
- $sectionid = $url_array[$pos +2];
- $id = $url_array[$pos +3];
- $Itemid = $url_array[$pos +4];
- $order = str_replace('order,', '', $url_array[$pos +5]);
- $filter = str_replace('filter,', '', $url_array[$pos +6]);
- $limit = $url_array[$pos +7];
- $limitstart = $url_array[$pos +8];
-
- // pass data onto global variables
- $_GET['task'] = $task;
- $_REQUEST['task'] = $task;
- $_GET['sectionid'] = $sectionid;
- $_REQUEST['sectionid'] = $sectionid;
- $_GET['id'] = $id;
- $_REQUEST['id'] = $id;
- $_GET['Itemid'] = $Itemid;
- $_REQUEST['Itemid'] = $Itemid;
- $_GET['order'] = $order;
- $_REQUEST['order'] = $order;
- $_GET['filter'] = $filter;
- $_REQUEST['filter'] = $filter;
- $_GET['limit'] = $limit;
- $_REQUEST['limit'] = $limit;
- $_GET['limitstart'] = $limitstart;
- $_REQUEST['limitstart'] = $limitstart;
-
- $QUERY_STRING = "option=com_content&task=$task§ionid=$sectionid&id=$id&Itemid=$Itemid&order=$order&filter=$filter&limit=$limit&limitstart=$limitstart";
- }
- else if (isset ($url_array[$pos +7]) && $url_array[$pos +7] != '' && $url_array[$pos +5] > 1000 && (in_array('archivecategory', $url_array) || in_array('archivesection', $url_array)))
- {
- // $option/$task/$id/$limit/$limitstart/year/month/module
- $task = $url_array[$pos +1];
- $id = $url_array[$pos +2];
- $limit = $url_array[$pos +3];
- $limitstart = $url_array[$pos +4];
- $year = $url_array[$pos +5];
- $month = $url_array[$pos +6];
- $module = $url_array[$pos +7];
-
- // pass data onto global variables
- $_GET['task'] = $task;
- $_REQUEST['task'] = $task;
- $_GET['id'] = $id;
- $_REQUEST['id'] = $id;
- $_GET['limit'] = $limit;
- $_REQUEST['limit'] = $limit;
- $_GET['limitstart'] = $limitstart;
- $_REQUEST['limitstart'] = $limitstart;
- $_GET['year'] = $year;
- $_REQUEST['year'] = $year;
- $_GET['month'] = $month;
- $_REQUEST['month'] = $month;
- $_GET['module'] = $module;
- $_REQUEST['module'] = $module;
-
- $QUERY_STRING = "option=com_content&task=$task&id=$id&limit=$limit&limitstart=$limitstart&year=$year&month=$month&module=$module";
- }
- else if (isset ($url_array[$pos +7]) && $url_array[$pos +7] != '' && $url_array[$pos +6] > 1000 && (in_array('archivecategory', $url_array) || in_array('archivesection', $url_array)))
- {
- // $option/$task/$id/$Itemid/$limit/$limitstart/year/month
- $task = $url_array[$pos +1];
- $id = $url_array[$pos +2];
- $Itemid = $url_array[$pos +3];
- $limit = $url_array[$pos +4];
- $limitstart = $url_array[$pos +5];
- $year = $url_array[$pos +6];
- $month = $url_array[$pos +7];
-
- // pass data onto global variables
- $_GET['task'] = $task;
- $_REQUEST['task'] = $task;
- $_GET['id'] = $id;
- $_REQUEST['id'] = $id;
- $_GET['Itemid'] = $Itemid;
- $_REQUEST['Itemid'] = $Itemid;
- $_GET['limit'] = $limit;
- $_REQUEST['limit'] = $limit;
- $_GET['limitstart'] = $limitstart;
- $_REQUEST['limitstart'] = $limitstart;
- $_GET['year'] = $year;
- $_REQUEST['year'] = $year;
- $_GET['month'] = $month;
- $_REQUEST['month'] = $month;
-
- $QUERY_STRING = "option=com_content&task=$task&id=$id&Itemid=$Itemid&limit=$limit&limitstart=$limitstart&year=$year&month=$month";
- }
- else if (isset ($url_array[$pos +7]) && $url_array[$pos +7] != '' && in_array('category', $url_array) && (strpos($url_array[$pos +5], 'order,') !== false))
- {
- // $option/$task/$sectionid/$id/$Itemid/$order/$limit/$limitstart
- $task = $url_array[$pos +1];
- $sectionid = $url_array[$pos +2];
- $id = $url_array[$pos +3];
- $Itemid = $url_array[$pos +4];
- $order = str_replace('order,', '', $url_array[$pos +5]);
- $limit = $url_array[$pos +6];
- $limitstart = $url_array[$pos +7];
-
- // pass data onto global variables
- $_GET['task'] = $task;
- $_REQUEST['task'] = $task;
- $_GET['sectionid'] = $sectionid;
- $_REQUEST['sectionid'] = $sectionid;
- $_GET['id'] = $id;
- $_REQUEST['id'] = $id;
- $_GET['Itemid'] = $Itemid;
- $_REQUEST['Itemid'] = $Itemid;
- $_GET['order'] = $order;
- $_REQUEST['order'] = $order;
- $_GET['limit'] = $limit;
- $_REQUEST['limit'] = $limit;
- $_GET['limitstart'] = $limitstart;
- $_REQUEST['limitstart'] = $limitstart;
-
- $QUERY_STRING = "option=com_content&task=$task§ionid=$sectionid&id=$id&Itemid=$Itemid&order=$order&limit=$limit&limitstart=$limitstart";
- }
- else if (isset ($url_array[$pos +6]) && $url_array[$pos +6] != '')
- {
- // $option/$task/$sectionid/$id/$Itemid/$limit/$limitstart
- $task = $url_array[$pos +1];
- $sectionid = $url_array[$pos +2];
- $id = $url_array[$pos +3];
- $Itemid = $url_array[$pos +4];
- $limit = $url_array[$pos +5];
- $limitstart = $url_array[$pos +6];
-
- // pass data onto global variables
- $_GET['task'] = $task;
- $_REQUEST['task'] = $task;
- $_GET['sectionid'] = $sectionid;
- $_REQUEST['sectionid'] = $sectionid;
- $_GET['id'] = $id;
- $_REQUEST['id'] = $id;
- $_GET['Itemid'] = $Itemid;
- $_REQUEST['Itemid'] = $Itemid;
- $_GET['limit'] = $limit;
- $_REQUEST['limit'] = $limit;
- $_GET['limitstart'] = $limitstart;
- $_REQUEST['limitstart'] = $limitstart;
-
- $QUERY_STRING = "option=com_content&task=$task§ionid=$sectionid&id=$id&Itemid=$Itemid&limit=$limit&limitstart=$limitstart";
- }
- else if (isset ($url_array[$pos +5]) && $url_array[$pos +5] != '')
- {
- // $option/$task/$id/$Itemid/$limit/$limitstart
- $task = $url_array[$pos +1];
- $id = $url_array[$pos +2];
- $Itemid = $url_array[$pos +3];
- $limit = $url_array[$pos +4];
- $limitstart = $url_array[$pos +5];
-
- // pass data onto global variables
- $_GET['task'] = $task;
- $_REQUEST['task'] = $task;
- $_GET['id'] = $id;
- $_REQUEST['id'] = $id;
- $_GET['Itemid'] = $Itemid;
- $_REQUEST['Itemid'] = $Itemid;
- $_GET['limit'] = $limit;
- $_REQUEST['limit'] = $limit;
- $_GET['limitstart'] = $limitstart;
- $_REQUEST['limitstart'] = $limitstart;
-
- $QUERY_STRING = "option=com_content&task=$task&id=$id&Itemid=$Itemid&limit=$limit&limitstart=$limitstart";
- }
- else if (isset ($url_array[$pos +4]) && $url_array[$pos +4] != '' && (in_array('archivecategory', $url_array) || in_array('archivesection', $url_array)))
- {
- // $option/$task/$year/$month/$module
- $task = $url_array[$pos +1];
- $year = $url_array[$pos +2];
- $month = $url_array[$pos +3];
- $module = $url_array[$pos +4];
-
- // pass data onto global variables
- $_GET['task'] = $task;
- $_REQUEST['task'] = $task;
- $_GET['year'] = $year;
- $_REQUEST['year'] = $year;
- $_GET['month'] = $month;
- $_REQUEST['month'] = $month;
- $_GET['module'] = $module;
- $_REQUEST['module'] = $module;
-
- $QUERY_STRING = "option=com_content&task=$task&year=$year&month=$month&module=$module";
- }
- else if (!(isset ($url_array[$pos +5]) && $url_array[$pos +5] != '') && isset ($url_array[$pos +4]) && $url_array[$pos +4] != '')
- {
- // $option/$task/$sectionid/$id/$Itemid
- $task = $url_array[$pos +1];
- $sectionid = $url_array[$pos +2];
- $id = $url_array[$pos +3];
- $Itemid = $url_array[$pos +4];
-
- // pass data onto global variables
- $_GET['task'] = $task;
- $_REQUEST['task'] = $task;
- $_GET['sectionid'] = $sectionid;
- $_REQUEST['sectionid'] = $sectionid;
- $_GET['id'] = $id;
- $_REQUEST['id'] = $id;
- $_GET['Itemid'] = $Itemid;
- $_REQUEST['Itemid'] = $Itemid;
-
- $QUERY_STRING = "option=com_content&task=$task§ionid=$sectionid&id=$id&Itemid=$Itemid";
- }
- else if (!(isset ($url_array[$pos +4]) && $url_array[$pos +4] != '') && (isset ($url_array[$pos +3]) && $url_array[$pos +3] != ''))
- {
- // $option/$task/$id/$Itemid
- $task = $url_array[$pos +1];
- $id = $url_array[$pos +2];
- $Itemid = $url_array[$pos +3];
-
- // pass data onto global variables
- $_GET['task'] = $task;
- $_REQUEST['task'] = $task;
- $_GET['id'] = $id;
- $_REQUEST['id'] = $id;
- $_GET['Itemid'] = $Itemid;
- $_REQUEST['Itemid'] = $Itemid;
-
- $QUERY_STRING = "option=com_content&task=$task&id=$id&Itemid=$Itemid";
- }
- else if (!(isset ($url_array[$pos +3]) && $url_array[$pos +3] != '') && (isset ($url_array[$pos +2]) && $url_array[$pos +2] != ''))
- {
- // $option/$task/$id
- $task = $url_array[$pos +1];
- $id = $url_array[$pos +2];
-
- // pass data onto global variables
- $_GET['task'] = $task;
- $_REQUEST['task'] = $task;
- $_GET['id'] = $id;
- $_REQUEST['id'] = $id;
-
- $QUERY_STRING = "option=com_content&task=$task&id=$id";
- }
- else if (!(isset ($url_array[$pos +2]) && $url_array[$pos +2] != '') && (isset ($url_array[$pos +1]) && $url_array[$pos +1] != ''))
- {
- // $option/$task
- $task = $url_array[$pos +1];
-
- $_GET['task'] = $task;
- $_REQUEST['task'] = $task;
-
- $QUERY_STRING = 'option=com_content&task=' . $task;
- }
-
- if ($lang != '') {
- $QUERY_STRING .= '&lang=' . $lang;
- }
-
- $_SERVER['QUERY_STRING'] = $QUERY_STRING;
- $REQUEST_URI = $uri[0] . 'index.php?' . $QUERY_STRING;
- $_SERVER['REQUEST_URI'] = $REQUEST_URI;
-
- }
- else if (in_array('component', $url_array))
- {
- $name = 'component';
- /*
- Components
- http://www.domain.com/component/$name,$value
- */
- $uri = explode('component/', $_SERVER['REQUEST_URI']);
- $uri_array = explode('/', $uri[1]);
- $QUERY_STRING = '';
-
- // needed for check if component exists
- $path = $mosConfig_absolute_path . '/components';
- $dirlist = array ();
- if (is_dir($path))
- {
- $base = opendir($path);
- while (false !== ($dir = readdir($base)))
- {
- if ($dir !== '.' && $dir !== '..' && is_dir($path . '/' . $dir) && strtolower($dir) !== 'cvs' && strtolower($dir) !== '.svn') {
- $dirlist[] = $dir;
- }
- }
- closedir($base);
- }
-
- foreach ($uri_array as $value)
- {
- $temp = explode(',', $value);
- if (isset ($temp[0]) && $temp[0] != '' && isset ($temp[1]) && $temp[1] != '')
- {
- $_GET[$temp[0]] = $temp[1];
- $_REQUEST[$temp[0]] = $temp[1];
-
- // check to ensure component actually exists
- if ($temp[0] == 'option')
- {
- $check = '';
- if (count($dirlist)) {
- foreach ($dirlist as $dir) {
- if ($temp[1] == $dir) {
- $check = 1;
- break;
- }
- }
- }
- // redirect to 404 page if no component found to match url
- if (!$check)
- {
- header('HTTP/1.0 404 Not Found');
- require_once ($mosConfig_absolute_path . '/templates/404.php');
- exit (404);
- }
- }
-
- if ($QUERY_STRING == '') {
- $QUERY_STRING .= "$temp[0]=$temp[1]";
- } else {
- $QUERY_STRING .= "&$temp[0]=$temp[1]";
- }
- }
- }
-
- $_SERVER['QUERY_STRING'] = $QUERY_STRING;
- $REQUEST_URI = $uri[0] . 'index.php?' . $QUERY_STRING;
- $_SERVER['REQUEST_URI'] = $REQUEST_URI;
-
- }
- // let this go through and the rest of the system should handle it properly
- }
-
+_db = JFactory::getDBO();
+ parent :: __construct($subject, $config);
+ }
+
+ function onAfterInitialise()
+ {
+ global $mainframe;
+ if ($mainframe->isAdmin()) {
+ return; // Dont run in admin
+ }
+
+ $sef = $this->params->get('sef', 1);
+ $url = $this->params->get('url', 1);
+
+ $legacysef = $this->params->get('legacysef', 1);
+ if (!$sef && !$url && !$legacysef)
+ return; // None of the options enabled, bail!
+
+ // Grab the system as early as possible, we're going to terminate it potentially
+ // Case 1: Query string match (shouldn't need this but its here anyway)
+ if ($url && isset ($_SERVER['QUERY_STRING']) && strlen($_SERVER['QUERY_STRING']) && strpos($_SERVER['QUERY_STRING'], '&')) {
+ $query_string = $_SERVER['QUERY_STRING'];
+ $this->_lookup($query_string);
+ }
+
+ // Case 2: SEF or similar match
+ if ($sef && isset ($_SERVER['SCRIPT_NAME']) && isset ($_SERVER['REQUEST_URI'])) {
+ $part = str_replace('index.php', '', $_SERVER['SCRIPT_NAME']);
+ if($part != '/') {
+ $search = str_replace($part, '', $_SERVER['REQUEST_URI']);
+ } else {
+ $search = ltrim($_SERVER['REQUEST_URI'],'/');
+ }
+ $this->_lookup($search);
+ }
+ // Case 3: Old school core sef; used to backlink
+ // Enable only if:
+ // 1: SEF is enabled
+ // 2: Legacy SEF Plugin Param is set
+ // 3: And there is no backlink
+ if ($mainframe->getCfg('sef')
+ && $legacysef
+ && !strstr($_SERVER['REQUEST_URI'],'nobacklink')
+ && !strlen($_SERVER['QUERY_STRING'])) {
+ $this->_legacysef();
+ }
+
+ }
+
+ function _lookup($searchstring)
+ {
+ // return blank strings and just index.php on its own...
+ if (!strlen($searchstring) || $searchstring == trim('index.php',' ?')) {
+ return;
+ }
+
+ $sef = $this->params->get('sef', 1);
+ $url = $this->params->get('url', 1);
+
+ if (!$sef && !$url) {
+ return; // Neither option enabled, bail!
+ }
+
+ $query = 'SELECT * FROM #__migration_backlinks WHERE ';
+ $where = Array ();
+ $search = $this->_db->Quote( $this->_db->getEscaped( $searchstring, true ).'%', false );
+
+ if ($url) {
+ $where[] = 'url LIKE ' . $search;
+ }
+ if ($sef) {
+ $where[] = 'sefurl LIKE ' . $search;
+ }
+
+ $query .= implode(' OR ', $where);
+ $this->_db->setQuery($query);
+ $results = $this->_db->loadAssocList();
+
+ if (count($results)) {
+ // Get the first one...
+ $this->_redirect($results[0]['itemid'], $results[0]['name'], $results[0]['newurl']);
+ }
+ }
+
+ function _redirect($Itemid, $name, $url = null)
+ {
+ global $mainframe;
+ if (!strlen($url))
+ {
+ $menu = & JSite :: getMenu();
+ $item = $menu->getItem($Itemid);
+ //$url = $item->link;
+
+ switch ($item->type)
+ {
+ case 'url' :
+ if ((strpos($item->link, 'index.php?') !== false) && (strpos($item->link, 'Itemid=') === false)) {
+ $url = $item->link . '&Itemid=' . $item->id;
+ } else {
+ $url = $item->link;
+ }
+ break;
+
+ default :
+ $url = 'index.php?Itemid=' . $item->id;
+ //$url = $item->link . '&Itemid='.$item->id;
+ break;
+ }
+ $url = JRoute :: _($url);
+ //$url = JURI :: base() . $url; // was $surl with third option of below being url and second being surl
+ $name = $item->name;
+ }
+ // Check we're not redirecting to ourselves
+ if(!stristr($url,$_SERVER['REQUEST_URI']) && !stristr($url,$_SERVER['SCRIPT_NAME'].'/'.$_SERVER['QUERY_STRING'])) {
+ return;
+ }
+
+ $name = $name ? $name : "Unknown";
+
+ header('Location: ' . str_replace('&','&',$url), true, '301'); // redirect and kill of and &
+ jexit(JText :: sprintf('"%s" has moved to %s. Click the link if your browser does not redirect you automatically.', $name, $url, $url));
+ }
+
+ function _legacysef()
+ {
+ $mosConfig_absolute_path = JPATH_SITE;
+ $mosConfig_live_site = JURI :: base();
+ $url_array = explode('/', $_SERVER['REQUEST_URI']);
+
+ if (in_array('content', $url_array))
+ {
+ /**
+ * Content
+ * http://www.domain.com/$option/$task/$sectionid/$id/$Itemid/$limit/$limitstart
+ */
+
+ $uri = explode('content/', $_SERVER['REQUEST_URI']);
+ $option = 'com_content';
+ $_GET['option'] = $option;
+ $_REQUEST['option'] = $option;
+ $pos = array_search('content', $url_array);
+
+ // language hook for content
+ $lang = '';
+ foreach ($url_array as $key => $value)
+ {
+ if (!strcasecmp(substr($value, 0, 5), 'lang,'))
+ {
+ $temp = explode(',', $value);
+ if (isset ($temp[0]) && $temp[0] != '' && isset ($temp[1]) && $temp[1] != '')
+ {
+ $_GET['lang'] = $temp[1];
+ $_REQUEST['lang'] = $temp[1];
+ $lang = $temp[1];
+ }
+ unset ($url_array[$key]);
+ }
+ }
+
+ if (isset ($url_array[$pos +8]) && $url_array[$pos +8] != '' && in_array('category', $url_array) && (strpos($url_array[$pos +5], 'order,') !== false) && (strpos($url_array[$pos +6], 'filter,') !== false))
+ {
+ // $option/$task/$sectionid/$id/$Itemid/$order/$filter/$limit/$limitstart
+ $task = $url_array[$pos +1];
+ $sectionid = $url_array[$pos +2];
+ $id = $url_array[$pos +3];
+ $Itemid = $url_array[$pos +4];
+ $order = str_replace('order,', '', $url_array[$pos +5]);
+ $filter = str_replace('filter,', '', $url_array[$pos +6]);
+ $limit = $url_array[$pos +7];
+ $limitstart = $url_array[$pos +8];
+
+ // pass data onto global variables
+ $_GET['task'] = $task;
+ $_REQUEST['task'] = $task;
+ $_GET['sectionid'] = $sectionid;
+ $_REQUEST['sectionid'] = $sectionid;
+ $_GET['id'] = $id;
+ $_REQUEST['id'] = $id;
+ $_GET['Itemid'] = $Itemid;
+ $_REQUEST['Itemid'] = $Itemid;
+ $_GET['order'] = $order;
+ $_REQUEST['order'] = $order;
+ $_GET['filter'] = $filter;
+ $_REQUEST['filter'] = $filter;
+ $_GET['limit'] = $limit;
+ $_REQUEST['limit'] = $limit;
+ $_GET['limitstart'] = $limitstart;
+ $_REQUEST['limitstart'] = $limitstart;
+
+ $QUERY_STRING = "option=com_content&task=$task§ionid=$sectionid&id=$id&Itemid=$Itemid&order=$order&filter=$filter&limit=$limit&limitstart=$limitstart";
+ }
+ else if (isset ($url_array[$pos +7]) && $url_array[$pos +7] != '' && $url_array[$pos +5] > 1000 && (in_array('archivecategory', $url_array) || in_array('archivesection', $url_array)))
+ {
+ // $option/$task/$id/$limit/$limitstart/year/month/module
+ $task = $url_array[$pos +1];
+ $id = $url_array[$pos +2];
+ $limit = $url_array[$pos +3];
+ $limitstart = $url_array[$pos +4];
+ $year = $url_array[$pos +5];
+ $month = $url_array[$pos +6];
+ $module = $url_array[$pos +7];
+
+ // pass data onto global variables
+ $_GET['task'] = $task;
+ $_REQUEST['task'] = $task;
+ $_GET['id'] = $id;
+ $_REQUEST['id'] = $id;
+ $_GET['limit'] = $limit;
+ $_REQUEST['limit'] = $limit;
+ $_GET['limitstart'] = $limitstart;
+ $_REQUEST['limitstart'] = $limitstart;
+ $_GET['year'] = $year;
+ $_REQUEST['year'] = $year;
+ $_GET['month'] = $month;
+ $_REQUEST['month'] = $month;
+ $_GET['module'] = $module;
+ $_REQUEST['module'] = $module;
+
+ $QUERY_STRING = "option=com_content&task=$task&id=$id&limit=$limit&limitstart=$limitstart&year=$year&month=$month&module=$module";
+ }
+ else if (isset ($url_array[$pos +7]) && $url_array[$pos +7] != '' && $url_array[$pos +6] > 1000 && (in_array('archivecategory', $url_array) || in_array('archivesection', $url_array)))
+ {
+ // $option/$task/$id/$Itemid/$limit/$limitstart/year/month
+ $task = $url_array[$pos +1];
+ $id = $url_array[$pos +2];
+ $Itemid = $url_array[$pos +3];
+ $limit = $url_array[$pos +4];
+ $limitstart = $url_array[$pos +5];
+ $year = $url_array[$pos +6];
+ $month = $url_array[$pos +7];
+
+ // pass data onto global variables
+ $_GET['task'] = $task;
+ $_REQUEST['task'] = $task;
+ $_GET['id'] = $id;
+ $_REQUEST['id'] = $id;
+ $_GET['Itemid'] = $Itemid;
+ $_REQUEST['Itemid'] = $Itemid;
+ $_GET['limit'] = $limit;
+ $_REQUEST['limit'] = $limit;
+ $_GET['limitstart'] = $limitstart;
+ $_REQUEST['limitstart'] = $limitstart;
+ $_GET['year'] = $year;
+ $_REQUEST['year'] = $year;
+ $_GET['month'] = $month;
+ $_REQUEST['month'] = $month;
+
+ $QUERY_STRING = "option=com_content&task=$task&id=$id&Itemid=$Itemid&limit=$limit&limitstart=$limitstart&year=$year&month=$month";
+ }
+ else if (isset ($url_array[$pos +7]) && $url_array[$pos +7] != '' && in_array('category', $url_array) && (strpos($url_array[$pos +5], 'order,') !== false))
+ {
+ // $option/$task/$sectionid/$id/$Itemid/$order/$limit/$limitstart
+ $task = $url_array[$pos +1];
+ $sectionid = $url_array[$pos +2];
+ $id = $url_array[$pos +3];
+ $Itemid = $url_array[$pos +4];
+ $order = str_replace('order,', '', $url_array[$pos +5]);
+ $limit = $url_array[$pos +6];
+ $limitstart = $url_array[$pos +7];
+
+ // pass data onto global variables
+ $_GET['task'] = $task;
+ $_REQUEST['task'] = $task;
+ $_GET['sectionid'] = $sectionid;
+ $_REQUEST['sectionid'] = $sectionid;
+ $_GET['id'] = $id;
+ $_REQUEST['id'] = $id;
+ $_GET['Itemid'] = $Itemid;
+ $_REQUEST['Itemid'] = $Itemid;
+ $_GET['order'] = $order;
+ $_REQUEST['order'] = $order;
+ $_GET['limit'] = $limit;
+ $_REQUEST['limit'] = $limit;
+ $_GET['limitstart'] = $limitstart;
+ $_REQUEST['limitstart'] = $limitstart;
+
+ $QUERY_STRING = "option=com_content&task=$task§ionid=$sectionid&id=$id&Itemid=$Itemid&order=$order&limit=$limit&limitstart=$limitstart";
+ }
+ else if (isset ($url_array[$pos +6]) && $url_array[$pos +6] != '')
+ {
+ // $option/$task/$sectionid/$id/$Itemid/$limit/$limitstart
+ $task = $url_array[$pos +1];
+ $sectionid = $url_array[$pos +2];
+ $id = $url_array[$pos +3];
+ $Itemid = $url_array[$pos +4];
+ $limit = $url_array[$pos +5];
+ $limitstart = $url_array[$pos +6];
+
+ // pass data onto global variables
+ $_GET['task'] = $task;
+ $_REQUEST['task'] = $task;
+ $_GET['sectionid'] = $sectionid;
+ $_REQUEST['sectionid'] = $sectionid;
+ $_GET['id'] = $id;
+ $_REQUEST['id'] = $id;
+ $_GET['Itemid'] = $Itemid;
+ $_REQUEST['Itemid'] = $Itemid;
+ $_GET['limit'] = $limit;
+ $_REQUEST['limit'] = $limit;
+ $_GET['limitstart'] = $limitstart;
+ $_REQUEST['limitstart'] = $limitstart;
+
+ $QUERY_STRING = "option=com_content&task=$task§ionid=$sectionid&id=$id&Itemid=$Itemid&limit=$limit&limitstart=$limitstart";
+ }
+ else if (isset ($url_array[$pos +5]) && $url_array[$pos +5] != '')
+ {
+ // $option/$task/$id/$Itemid/$limit/$limitstart
+ $task = $url_array[$pos +1];
+ $id = $url_array[$pos +2];
+ $Itemid = $url_array[$pos +3];
+ $limit = $url_array[$pos +4];
+ $limitstart = $url_array[$pos +5];
+
+ // pass data onto global variables
+ $_GET['task'] = $task;
+ $_REQUEST['task'] = $task;
+ $_GET['id'] = $id;
+ $_REQUEST['id'] = $id;
+ $_GET['Itemid'] = $Itemid;
+ $_REQUEST['Itemid'] = $Itemid;
+ $_GET['limit'] = $limit;
+ $_REQUEST['limit'] = $limit;
+ $_GET['limitstart'] = $limitstart;
+ $_REQUEST['limitstart'] = $limitstart;
+
+ $QUERY_STRING = "option=com_content&task=$task&id=$id&Itemid=$Itemid&limit=$limit&limitstart=$limitstart";
+ }
+ else if (isset ($url_array[$pos +4]) && $url_array[$pos +4] != '' && (in_array('archivecategory', $url_array) || in_array('archivesection', $url_array)))
+ {
+ // $option/$task/$year/$month/$module
+ $task = $url_array[$pos +1];
+ $year = $url_array[$pos +2];
+ $month = $url_array[$pos +3];
+ $module = $url_array[$pos +4];
+
+ // pass data onto global variables
+ $_GET['task'] = $task;
+ $_REQUEST['task'] = $task;
+ $_GET['year'] = $year;
+ $_REQUEST['year'] = $year;
+ $_GET['month'] = $month;
+ $_REQUEST['month'] = $month;
+ $_GET['module'] = $module;
+ $_REQUEST['module'] = $module;
+
+ $QUERY_STRING = "option=com_content&task=$task&year=$year&month=$month&module=$module";
+ }
+ else if (!(isset ($url_array[$pos +5]) && $url_array[$pos +5] != '') && isset ($url_array[$pos +4]) && $url_array[$pos +4] != '')
+ {
+ // $option/$task/$sectionid/$id/$Itemid
+ $task = $url_array[$pos +1];
+ $sectionid = $url_array[$pos +2];
+ $id = $url_array[$pos +3];
+ $Itemid = $url_array[$pos +4];
+
+ // pass data onto global variables
+ $_GET['task'] = $task;
+ $_REQUEST['task'] = $task;
+ $_GET['sectionid'] = $sectionid;
+ $_REQUEST['sectionid'] = $sectionid;
+ $_GET['id'] = $id;
+ $_REQUEST['id'] = $id;
+ $_GET['Itemid'] = $Itemid;
+ $_REQUEST['Itemid'] = $Itemid;
+
+ $QUERY_STRING = "option=com_content&task=$task§ionid=$sectionid&id=$id&Itemid=$Itemid";
+ }
+ else if (!(isset ($url_array[$pos +4]) && $url_array[$pos +4] != '') && (isset ($url_array[$pos +3]) && $url_array[$pos +3] != ''))
+ {
+ // $option/$task/$id/$Itemid
+ $task = $url_array[$pos +1];
+ $id = $url_array[$pos +2];
+ $Itemid = $url_array[$pos +3];
+
+ // pass data onto global variables
+ $_GET['task'] = $task;
+ $_REQUEST['task'] = $task;
+ $_GET['id'] = $id;
+ $_REQUEST['id'] = $id;
+ $_GET['Itemid'] = $Itemid;
+ $_REQUEST['Itemid'] = $Itemid;
+
+ $QUERY_STRING = "option=com_content&task=$task&id=$id&Itemid=$Itemid";
+ }
+ else if (!(isset ($url_array[$pos +3]) && $url_array[$pos +3] != '') && (isset ($url_array[$pos +2]) && $url_array[$pos +2] != ''))
+ {
+ // $option/$task/$id
+ $task = $url_array[$pos +1];
+ $id = $url_array[$pos +2];
+
+ // pass data onto global variables
+ $_GET['task'] = $task;
+ $_REQUEST['task'] = $task;
+ $_GET['id'] = $id;
+ $_REQUEST['id'] = $id;
+
+ $QUERY_STRING = "option=com_content&task=$task&id=$id";
+ }
+ else if (!(isset ($url_array[$pos +2]) && $url_array[$pos +2] != '') && (isset ($url_array[$pos +1]) && $url_array[$pos +1] != ''))
+ {
+ // $option/$task
+ $task = $url_array[$pos +1];
+
+ $_GET['task'] = $task;
+ $_REQUEST['task'] = $task;
+
+ $QUERY_STRING = 'option=com_content&task=' . $task;
+ }
+
+ if ($lang != '') {
+ $QUERY_STRING .= '&lang=' . $lang;
+ }
+
+ $_SERVER['QUERY_STRING'] = $QUERY_STRING;
+ $REQUEST_URI = $uri[0] . 'index.php?' . $QUERY_STRING;
+ $_SERVER['REQUEST_URI'] = $REQUEST_URI;
+
+ }
+ else if (in_array('component', $url_array))
+ {
+ $name = 'component';
+ /*
+ Components
+ http://www.domain.com/component/$name,$value
+ */
+ $uri = explode('component/', $_SERVER['REQUEST_URI']);
+ $uri_array = explode('/', $uri[1]);
+ $QUERY_STRING = '';
+
+ // needed for check if component exists
+ $path = $mosConfig_absolute_path . '/components';
+ $dirlist = array ();
+ if (is_dir($path))
+ {
+ $base = opendir($path);
+ while (false !== ($dir = readdir($base)))
+ {
+ if ($dir !== '.' && $dir !== '..' && is_dir($path . '/' . $dir) && strtolower($dir) !== 'cvs' && strtolower($dir) !== '.svn') {
+ $dirlist[] = $dir;
+ }
+ }
+ closedir($base);
+ }
+
+ foreach ($uri_array as $value)
+ {
+ $temp = explode(',', $value);
+ if (isset ($temp[0]) && $temp[0] != '' && isset ($temp[1]) && $temp[1] != '')
+ {
+ $_GET[$temp[0]] = $temp[1];
+ $_REQUEST[$temp[0]] = $temp[1];
+
+ // check to ensure component actually exists
+ if ($temp[0] == 'option')
+ {
+ $check = '';
+ if (count($dirlist)) {
+ foreach ($dirlist as $dir) {
+ if ($temp[1] == $dir) {
+ $check = 1;
+ break;
+ }
+ }
+ }
+ // redirect to 404 page if no component found to match url
+ if (!$check)
+ {
+ header('HTTP/1.0 404 Not Found');
+ require_once ($mosConfig_absolute_path . '/templates/404.php');
+ exit (404);
+ }
+ }
+
+ if ($QUERY_STRING == '') {
+ $QUERY_STRING .= "$temp[0]=$temp[1]";
+ } else {
+ $QUERY_STRING .= "&$temp[0]=$temp[1]";
+ }
+ }
+ }
+
+ $_SERVER['QUERY_STRING'] = $QUERY_STRING;
+ $REQUEST_URI = $uri[0] . 'index.php?' . $QUERY_STRING;
+ $_SERVER['REQUEST_URI'] = $REQUEST_URI;
+
+ }
+ // let this go through and the rest of the system should handle it properly
+ }
+
}
\ No newline at end of file
diff --git a/oss/joomla/trunk/plugins/system/backlink.xml b/oss/joomla/trunk/plugins/system/backlink.xml
index 5c0902db..a08e7052 100644
--- a/oss/joomla/trunk/plugins/system/backlink.xml
+++ b/oss/joomla/trunk/plugins/system/backlink.xml
@@ -1,29 +1,29 @@
-
-
- System - Backlinks
- Joomla! Project
- September 2007
- Copyright (C) 2005 - 2008 Open Source Matters. All rights reserved.
- http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL
- admin@joomla.org
- www.joomla.org
- 1.5
- Provides backlink support
-
- backlink.php
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+ System - Backlinks
+ Joomla! Project
+ September 2007
+ Copyright (C) 2005 - 2010 Open Source Matters. All rights reserved.
+ http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL
+ admin@joomla.org
+ www.joomla.org
+ 1.5
+ Provides backlink support
+
+ backlink.php
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/oss/joomla/trunk/plugins/system/cache.php b/oss/joomla/trunk/plugins/system/cache.php
index d74dc9d3..d26313b0 100644
--- a/oss/joomla/trunk/plugins/system/cache.php
+++ b/oss/joomla/trunk/plugins/system/cache.php
@@ -1,117 +1,117 @@
- JPATH_BASE.DS.'cache',
- 'defaultgroup' => 'page',
- 'lifetime' => $this->params->get('cachetime', 15) * 60,
- 'browsercache' => $this->params->get('browsercache', false),
- 'caching' => false,
- 'language' => $config->getValue('config.language', 'en-GB')
- );
-
- jimport('joomla.cache.cache');
- $this->_cache =& JCache::getInstance( 'page', $options );
- }
-
- /**
- * Converting the site URL to fit to the HTTP request
- *
- */
- function onAfterInitialise()
- {
- global $mainframe, $_PROFILER;
- $user = &JFactory::getUser();
-
- if($mainframe->isAdmin() || JDEBUG) {
- return;
- }
-
- if (!$user->get('aid') && $_SERVER['REQUEST_METHOD'] == 'GET') {
- $this->_cache->setCaching(true);
- }
-
- $data = $this->_cache->get();
-
- if($data !== false)
- {
- // the following code searches for a token in the cached page and replaces it with the
- // proper token.
- $token = JUtility::getToken();
- $search = '##';
- $replacement = '';
- $data = preg_replace( $search, $replacement, $data );
-
- JResponse::setBody($data);
-
- echo JResponse::toString($mainframe->getCfg('gzip'));
-
- if(JDEBUG)
- {
- $_PROFILER->mark('afterCache');
- echo implode( '', $_PROFILER->getBuffer());
- }
-
- $mainframe->close();
- }
- }
-
- function onAfterRender()
- {
- global $mainframe;
-
- if($mainframe->isAdmin() || JDEBUG) {
- return;
- }
-
- $user =& JFactory::getUser();
- if(!$user->get('aid')) {
- //We need to check again here, because auto-login plugins have not been fired before the first aid check
- $this->_cache->store();
- }
- }
-}
+ JPATH_BASE.DS.'cache',
+ 'defaultgroup' => 'page',
+ 'lifetime' => $this->params->get('cachetime', 15) * 60,
+ 'browsercache' => $this->params->get('browsercache', false),
+ 'caching' => false,
+ 'language' => $config->getValue('config.language', 'en-GB')
+ );
+
+ jimport('joomla.cache.cache');
+ $this->_cache =& JCache::getInstance( 'page', $options );
+ }
+
+ /**
+ * Converting the site URL to fit to the HTTP request
+ *
+ */
+ function onAfterInitialise()
+ {
+ global $mainframe, $_PROFILER;
+ $user = &JFactory::getUser();
+
+ if($mainframe->isAdmin() || JDEBUG) {
+ return;
+ }
+
+ if (!$user->get('aid') && $_SERVER['REQUEST_METHOD'] == 'GET') {
+ $this->_cache->setCaching(true);
+ }
+
+ $data = $this->_cache->get();
+
+ if($data !== false)
+ {
+ // the following code searches for a token in the cached page and replaces it with the
+ // proper token.
+ $token = JUtility::getToken();
+ $search = '##';
+ $replacement = '';
+ $data = preg_replace( $search, $replacement, $data );
+
+ JResponse::setBody($data);
+
+ echo JResponse::toString($mainframe->getCfg('gzip'));
+
+ if(JDEBUG)
+ {
+ $_PROFILER->mark('afterCache');
+ echo implode( '', $_PROFILER->getBuffer());
+ }
+
+ $mainframe->close();
+ }
+ }
+
+ function onAfterRender()
+ {
+ global $mainframe;
+
+ if($mainframe->isAdmin() || JDEBUG) {
+ return;
+ }
+
+ $user =& JFactory::getUser();
+ if(!$user->get('aid')) {
+ //We need to check again here, because auto-login plugins have not been fired before the first aid check
+ $this->_cache->store();
+ }
+ }
+}
diff --git a/oss/joomla/trunk/plugins/system/cache.xml b/oss/joomla/trunk/plugins/system/cache.xml
index d99732fd..bd272e0b 100644
--- a/oss/joomla/trunk/plugins/system/cache.xml
+++ b/oss/joomla/trunk/plugins/system/cache.xml
@@ -3,7 +3,7 @@
System - Cache
Joomla! Project
February 2007
- Copyright (C) 2005 - 2008 Open Source Matters. All rights reserved.
+ Copyright (C) 2005 - 2010 Open Source Matters. All rights reserved.
http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL
admin@joomla.org
www.joomla.org
diff --git a/oss/joomla/trunk/plugins/system/debug.php b/oss/joomla/trunk/plugins/system/debug.php
index 9723e0da..3ca50380 100644
--- a/oss/joomla/trunk/plugins/system/debug.php
+++ b/oss/joomla/trunk/plugins/system/debug.php
@@ -1,207 +1,207 @@
-loadLanguage( );
- }
-
- /**
- * Converting the site URL to fit to the HTTP request
- *
- */
- function onAfterRender()
- {
- global $_PROFILER, $mainframe, $database;
-
- // Do not render if debugging is not enabled
- if(!JDEBUG) { return; }
-
- $document =& JFactory::getDocument();
- $doctype = $document->getType();
-
- // Only render for HTML output
- if ( $doctype !== 'html' ) { return; }
-
- $profiler =& $_PROFILER;
-
- ob_start();
- echo '';
- if ($this->params->get('profile', 1)) {
- echo '
'.JText::_( 'Profile Information' ).'
';
- foreach ( $profiler->getBuffer() as $mark ) {
- echo '
'.$mark.'
';
- }
- }
-
- if ($this->params->get('memory', 1)) {
- echo '
'.JText::_( 'Memory Usage' ).'
';
- echo $profiler->getMemory();
- }
-
- if ($this->params->get('queries', 1))
- {
- jimport('geshi.geshi');
-
- $geshi = new GeSHi( '', 'sql' );
- $geshi->set_header_type(GESHI_HEADER_DIV);
- //$geshi->enable_line_numbers( GESHI_FANCY_LINE_NONE );
-
- $newlineKeywords = '/
'
- .'(FROM|LEFT|INNER|OUTER|WHERE|SET|VALUES|ORDER|GROUP|HAVING|LIMIT|ON|AND)'
- .'<\\/span>/i'
- ;
-
- $db =& JFactory::getDBO();
-
- echo ''.JText::sprintf( 'Queries logged', $db->getTicker() ).'
';
-
- if ($log = $db->getLog())
- {
- echo '';
- foreach ($log as $k=>$sql)
- {
- $geshi->set_source($sql);
- $text = $geshi->parse_code();
- $text = preg_replace($newlineKeywords, '
\\0', $text);
- echo '- '.$text.'
';
- }
- echo '
';
- }
-
- if(isset($database))
- {
- echo ''.JText::sprintf( 'Legacy Queries logged', $database->getTicker() ).'
';
- echo '';
-
- foreach ($database->getLog() as $k=>$sql)
- {
- $geshi->set_source($sql);
- $text = $geshi->parse_code();
- $text = preg_replace($newlineKeywords, '
\\0', $text);
- echo '- '.$text.'
';
- }
-
- echo '
';
- }
- }
-
- $lang = &JFactory::getLanguage();
- if ($this->params->get('language_files', 1))
- {
- echo ''.JText::_( 'Language Files Loaded' ).'
';
- echo '';
- $extensions = $lang->getPaths();
- foreach ( $extensions as $extension => $files)
- {
- foreach ( $files as $file => $status )
- {
- echo "- $file $status
";
- }
- }
- echo '
';
- }
-
- $langStrings = $this->params->get('language_strings', -1);
- if ($langStrings < 0 OR $langStrings == 1) {
- echo ''.JText::_( 'Untranslated Strings Diagnostic' ).'
';
- echo '';
- $orphans = $lang->getOrphans();
- if (count( $orphans ))
- {
- ksort( $orphans, SORT_STRING );
- foreach ($orphans as $key => $occurance) {
- foreach ( $occurance as $i => $info) {
- $class = @$info['class'];
- $func = @$info['function'];
- $file = @$info['file'];
- $line = @$info['line'];
- echo strtoupper( $key )."\t$class::$func()\t[$file:$line]\n";
- }
- }
- }
- else {
- echo JText::_( 'None' );
- }
- echo '';
- }
- if ($langStrings < 0 OR $langStrings == 2) {
- echo ''.JText::_( 'Untranslated Strings Designer' ).'
';
- echo '';
- $orphans = $lang->getOrphans();
- if (count( $orphans ))
- {
- ksort( $orphans, SORT_STRING );
- $guesses = array();
- foreach ($orphans as $key => $occurance) {
- if (is_array( $occurance ) AND isset( $occurance[0] )) {
- $info = &$occurance[0];
- $file = @$info['file'];
- if (!isset( $guesses[$file] )) {
- $guesses[$file] = array();
- }
-
- $guess = str_replace( '_', ' ', $info['string'] );
- if ($strip = $this->params->get('language_prefix')) {
- $guess = trim( preg_replace( chr(1).'^'.$strip.chr(1), '', $guess ) );
- }
- $guesses[$file][] = trim( strtoupper( $key ) ).'='.$guess;
- }
- }
- foreach ($guesses as $file => $keys) {
- echo "\n\n# ".($file ? $file : JText::_( 'Unknown file' ))."\n\n";
- echo implode( "\n", $keys );
- }
- }
- else {
- echo JText::_( 'None' );
- }
- echo '';
- }
- echo ' ';
-
- $debug = ob_get_clean();
-
- $body = JResponse::getBody();
- $body = str_replace('