Skip to content
Browse files

Merge branch 'master' into template9

Conflicts:
	administrator/components/com_media/views/medialist/tmpl/thumbs_img.php
	installation/controller.php
  • Loading branch information...
2 parents 0adbb33 + 8e84ff0 commit d6258c0bd02fc511a40a8fb61f711da3c80991fc @realityking realityking committed
Showing with 362 additions and 250 deletions.
  1. +1 −1 administrator/components/com_admin/models/sysinfo.php
  2. +1 −0 administrator/components/com_admin/script.php
  3. +2 −1 administrator/components/com_admin/views/profile/view.html.php
  4. +3 −0 administrator/components/com_config/models/forms/application.xml
  5. +12 −9 administrator/components/com_media/helpers/media.php
  6. +1 −0 administrator/language/en-GB/en-GB.com_config.ini
  7. +0 −3 administrator/language/en-GB/en-GB.com_media.ini
  8. +76 −0 cli/deletefiles.php
  9. +7 −0 components/com_contact/models/category.php
  10. +26 −11 components/com_contact/views/category/view.feed.php
  11. +17 −9 components/com_content/views/category/view.feed.php
  12. +9 −2 components/com_content/views/featured/view.feed.php
  13. +12 −9 components/com_media/helpers/media.php
  14. +2 −0 components/com_weblinks/models/category.php
  15. +27 −10 components/com_weblinks/views/category/view.feed.php
  16. +1 −0 includes/application.php
  17. +6 −0 installation/CHANGELOG
  18. +6 −5 installation/controller.php
  19. +3 −2 installation/includes/application.php
  20. +0 −3 language/en-GB/en-GB.com_media.ini
  21. +48 −42 libraries/cms/schema/changeitem.php
  22. +5 −8 libraries/cms/schema/changeitemmysql.php
  23. +4 −5 libraries/cms/schema/changeitemsqlazure.php
  24. +7 −9 libraries/cms/schema/changeitemsqlsrv.php
  25. +17 −17 libraries/cms/schema/changeset.php
  26. +40 −100 modules/mod_articles_category/helper.php
  27. +1 −0 modules/mod_banners/helper.php
  28. +1 −0 modules/mod_breadcrumbs/helper.php
  29. +1 −0 modules/mod_feed/helper.php
  30. +1 −0 modules/mod_login/helper.php
  31. +1 −0 modules/mod_random_image/helper.php
  32. +1 −0 modules/mod_related_items/helper.php
  33. +1 −0 modules/mod_syndicate/helper.php
  34. +1 −0 modules/mod_whosonline/helper.php
  35. +1 −0 modules/mod_wrapper/helper.php
  36. +1 −0 plugins/content/emailcloak/emailcloak.php
  37. +1 −0 plugins/content/loadmodule/loadmodule.php
  38. +1 −0 plugins/content/pagenavigation/pagenavigation.php
  39. +1 −0 plugins/content/vote/vote.php
  40. +3 −0 plugins/system/languagecode/languagecode.php
  41. +1 −0 plugins/system/log/log.php
  42. +4 −3 plugins/system/logout/logout.php
  43. +4 −0 plugins/system/p3p/p3p.php
  44. +2 −1 plugins/system/redirect/redirect.php
  45. +1 −0 plugins/system/remember/remember.php
  46. +1 −0 plugins/system/sef/sef.php
View
2 administrator/components/com_admin/models/sysinfo.php
@@ -10,7 +10,7 @@
defined('_JEXEC') or die;
/**
- * Model for the system information
+ * Model for the display of system information.
*
* @package Joomla.Administrator
* @subpackage com_admin
View
1 administrator/components/com_admin/script.php
@@ -14,6 +14,7 @@
*
* @package Joomla.Administrator
* @subpackage com_admin
+ * @since 1.6.4
*/
class joomlaInstallerScript
{
View
3 administrator/components/com_admin/views/profile/view.html.php
@@ -10,10 +10,11 @@
defined('_JEXEC') or die;
/**
- * View for the user profile
+ * View class to allow users edit their own profile.
*
* @package Joomla.Administrator
* @subpackage com_admin
+ * @since 1.6
*/
class AdminViewProfile extends JViewLegacy
{
View
3 administrator/components/com_config/models/forms/application.xml
@@ -733,6 +733,9 @@
value="author">COM_CONFIG_FIELD_VALUE_AUTHOR_EMAIL</option>
<option
value="site">COM_CONFIG_FIELD_VALUE_SITE_EMAIL</option>
+ <option
+ value="none">COM_CONFIG_FIELD_VALUE_NO_EMAIL</option>
+
</field>
</fieldset>
View
21 administrator/components/com_media/helpers/media.php
@@ -130,17 +130,20 @@ public static function canUpload($file, &$err)
return true;
}
+ /**
+ * Method to parse a file size
+ *
+ * @param integer $size The file size in bytes
+ *
+ * @return string The converted file size
+ *
+ * @since 1.6
+ * @deprecated 4.0 Use JHtmlNumber::bytes() instead
+ */
public static function parseSize($size)
{
- if ($size < 1024) {
- return JText::sprintf('COM_MEDIA_FILESIZE_BYTES', $size);
- }
- elseif ($size < 1024 * 1024) {
- return JText::sprintf('COM_MEDIA_FILESIZE_KILOBYTES', sprintf('%01.2f', $size / 1024.0));
- }
- else {
- return JText::sprintf('COM_MEDIA_FILESIZE_MEGABYTES', sprintf('%01.2f', $size / (1024.0 * 1024)));
- }
+ JLog::add('MediaHelper::parseSize() is deprecated. Use JHtmlNumber::bytes() instead.', JLog::WARNING, 'deprecated');
+ return JHtml::_('number.bytes', $size);
}
public static function imageResize($width, $height, $target)
View
1 administrator/language/en-GB/en-GB.com_config.ini
@@ -171,6 +171,7 @@ COM_CONFIG_FIELD_VALUE_DISPLAY_OFFLINE_MESSAGE_CUSTOM="Use Custom Message"
COM_CONFIG_FIELD_VALUE_DISPLAY_OFFLINE_MESSAGE_LANGUAGE="Use Site Language Default Message"
COM_CONFIG_FIELD_VALUE_ENTIRE_SITE="Entire Site"
COM_CONFIG_FIELD_VALUE_MAXIMUM="Maximum"
+COM_CONFIG_FIELD_VALUE_NO_EMAIL="No Email"
COM_CONFIG_FIELD_VALUE_NONE="None"
COM_CONFIG_FIELD_VALUE_PHP_MAIL="PHP Mail"
COM_CONFIG_FIELD_VALUE_SENDMAIL="Sendmail"
View
3 administrator/language/en-GB/en-GB.com_media.ini
@@ -67,10 +67,7 @@ COM_MEDIA_FIELD_PATH_IMAGE_FOLDER_LABEL="Path to images folder"
COM_MEDIA_FIELD_RESTRICT_UPLOADS_DESC="Restrict uploads for lower than manager users to just images if Fileinfo or MIME Magic isn't installed."
COM_MEDIA_FIELD_RESTRICT_UPLOADS_LABEL="Restrict Uploads"
COM_MEDIA_FILES="Files"
-COM_MEDIA_FILESIZE_BYTES="%s bytes"
COM_MEDIA_FILESIZE="File size"
-COM_MEDIA_FILESIZE_KILOBYTES="%s KB"
-COM_MEDIA_FILESIZE_MEGABYTES="%s MB"
COM_MEDIA_FOLDER="Folder"
COM_MEDIA_FOLDERS="Media Folders"
COM_MEDIA_FOLDERS_PATH_LABEL="Changing the default 'path to files folder' to another folder than default 'images' may break your links.<br /> The 'path to images' folder has to be the same or to a subfolder of 'path to files'."
View
76 cli/deletefiles.php
@@ -0,0 +1,76 @@
+<?php
+/**
+ * @package Joomla.Cli
+ *
+ * @copyright Copyright (C) 2005 - 2012 Open Source Matters, Inc. All rights reserved.
+ * @license GNU General Public License version 2 or later; see LICENSE.txt
+ */
+
+// We are a valid entry point.
+const _JEXEC = 1;
+
+// Load system defines
+if (file_exists(dirname(__DIR__) . '/defines.php'))
+{
+ require_once dirname(__DIR__) . '/defines.php';
+}
+
+if (!defined('_JDEFINES'))
+{
+ define('JPATH_BASE', dirname(__DIR__));
+ require_once JPATH_BASE . '/includes/defines.php';
+}
+
+// Get the framework.
+require_once JPATH_LIBRARIES . '/import.legacy.php';
+
+// Bootstrap the CMS libraries.
+require_once JPATH_LIBRARIES . '/cms.php';
+
+// Configure error reporting to maximum for CLI output.
+error_reporting(E_ALL);
+ini_set('display_errors', 1);
+
+// Load Library language
+$lang = JFactory::getLanguage();
+
+// Try the files_joomla file in the current language (without allowing the loading of the file in the default language)
+$lang->load('files_joomla.sys', JPATH_SITE, null, false, false)
+// Fallback to the files_joomla file in the default language
+|| $lang->load('files_joomla.sys', JPATH_SITE, null, true);
+
+/**
+ * A command line cron job to attempt to remove files that should have been deleted at update.
+ *
+ * @package Joomla.CLI
+ * @since 3.0
+ */
+class DeletefilesCli extends JApplicationCli
+{
+ /**
+ * Entry point for CLI script
+ *
+ * @return void
+ *
+ * @since 3.0
+ */
+ public function doExecute()
+ {
+ // Import the dependencies
+ jimport('joomla.filesystem.file');
+ jimport('joomla.filesystem.folder');
+
+ // We need the update script
+ JLoader::register('joomlaInstallerScript', JPATH_ADMINISTRATOR . '/components/com_admin/script.php');
+
+ // Instantiate the class
+ $class = new joomlaInstallerScript;
+
+ // Run the delete method
+ $class->deleteUnexistingFiles();
+ }
+}
+
+// Instantiate the application object, passing the class name to JCli::getInstance
+// and use chaining to execute the application.
+JApplicationCli::getInstance('DeletefilesCli')->execute();
View
7 components/com_contact/models/category.php
@@ -142,6 +142,13 @@ protected function getListQuery()
$query->where('c.access IN ('.$groups.')');
}
+ // Join over the users for the author and modified_by names.
+ $query->select("CASE WHEN a.created_by_alias > ' ' THEN a.created_by_alias ELSE ua.name END AS author");
+ $query->select("ua.email AS author_email");
+
+ $query->join('LEFT', '#__users AS ua ON ua.id = a.created_by');
+ $query->join('LEFT', '#__users AS uam ON uam.id = a.modified_by');
+
// Filter by state
$state = $this->getState('filter.published');
if (is_numeric($state)) {
View
37 components/com_contact/views/category/view.feed.php
@@ -18,12 +18,8 @@
*/
class ContactViewCategory extends JViewLegacy
{
- function display()
+ function display($tpl = null)
{
- // Get some data from the models
- $category = $this->get('Category');
- $rows = $this->get('Items');
-
// Check for errors.
if (count($errors = $this->get('Errors'))) {
JError::raiseError(500, implode("\n", $errors));
@@ -34,6 +30,14 @@ function display()
$doc = JFactory::getDocument();
$params = $app->getParams();
+ $feedEmail = $app->getCfg('feed_email', 'author');
+ $siteEmail = $app->getCfg('mailfrom');
+ $fromName = $app->getCfg('fromname');
+
+ JRequest::setVar('limit', $app->getCfg('feed_limit'));
+ // Get some data from the models
+ $category = $this->get('Category');
+ $rows = $this->get('Items');
$doc->link = JRoute::_(ContactHelperRoute::getCategoryRoute($category->id));
@@ -49,17 +53,28 @@ function display()
// url link to article
$link = JRoute::_(ContactHelperRoute::getContactRoute($row->slug, $row->catid));
- $description = $row->introtext;
+ $description = $row->address;
$author = $row->created_by_alias ? $row->created_by_alias : $row->author;
@$date = ($row->created ? date('r', strtotime($row->created)) : '');
// load individual item creator class
$item = new JFeedItem;
- $item->title = $title;
- $item->link = $link;
- $item->description = $description;
- $item->date = $date;
- $item->category = $row->category;
+ $item->title = $title;
+ $item->link = $link;
+ $item->description = $description;
+ $item->date = $date;
+ $item->category = $category->title;
+ $item->author = $author;
+
+ // We don't have the author email so we have to use site in both cases.
+ if ($feedEmail == 'site')
+ {
+ $item->authorEmail = $siteEmail;
+ }
+ elseif ($feedEmail == 'author')
+ {
+ $item->authorEmail = $row->author_email;
+ }
// loads item info into rss array
$doc->addItem($item);
View
26 components/com_content/views/category/view.feed.php
@@ -18,12 +18,12 @@
*/
class ContentViewCategory extends JViewLegacy
{
- function display()
+ function display($tpl = null)
{
$app = JFactory::getApplication();
$doc = JFactory::getDocument();
$params = $app->getParams();
- $feedEmail = (@$app->getCfg('feed_email')) ? $app->getCfg('feed_email') : 'author';
+ $feedEmail = $app->getCfg('feed_email', 'author');
$siteEmail = $app->getCfg('mailfrom');
// Get some data from the model
@@ -57,13 +57,21 @@ function display()
@$date = ($row->created ? date('r', strtotime($row->created)) : '');
// Load individual item creator class
- $item = new JFeedItem;
- $item->title = $title;
- $item->link = $link;
- $item->date = $date;
- $item->category = $row->category_title;
- $item->author = $author;
- $item->authorEmail = (($feedEmail == 'site') ? $siteEmail : $row->author_email);
+ $item = new JFeedItem;
+ $item->title = $title;
+ $item->link = $link;
+ $item->date = $date;
+ $item->category = $row->category_title;
+ $item->author = $author;
+
+ if ($feedEmail == 'site')
+ {
+ $item->authorEmail = $siteEmail;
+ }
+ elseif ($feedEmail === 'author')
+ {
+ $item->authorEmail = $row->author_email;
+ }
// Add readmore link to description if introtext is shown, show_readmore is true and fulltext exists
if (!$params->get('feed_summary', 0) && $params->get('feed_show_readmore', 0) && $row->fulltext)
View
11 components/com_content/views/featured/view.feed.php
@@ -24,7 +24,7 @@ function display($tpl = null)
$app = JFactory::getApplication();
$doc = JFactory::getDocument();
$params = $app->getParams();
- $feedEmail = (@$app->getCfg('feed_email')) ? $app->getCfg('feed_email') : 'author';
+ $feedEmail = $app->getCfg('feed_email', 'author');
$siteEmail = $app->getCfg('mailfrom');
$doc->link = JRoute::_('index.php?option=com_content&view=featured');
@@ -69,7 +69,14 @@ function display($tpl = null)
}
$item->author = $author;
- $item->authorEmail = (($feedEmail == 'site') ? $siteEmail : $row->author_email);
+ if ($feedEmail == 'site')
+ {
+ $item->authorEmail = $siteEmail;
+ }
+ elseif($feedEmail === 'author')
+ {
+ $item->authorEmail = $row->author_email;
+ }
// Add readmore link to description if introtext is shown, show_readmore is true and fulltext exists
if (!$params->get('feed_summary', 0) && $params->get('feed_show_readmore', 0) && $row->fulltext)
View
21 components/com_media/helpers/media.php
@@ -69,17 +69,20 @@ function canUpload($file, &$err)
return true;
}
+ /**
+ * Method to parse a file size
+ *
+ * @param integer $size The file size in bytes
+ *
+ * @return string The converted file size
+ *
+ * @since 1.6
+ * @deprecated 4.0 Use JHtmlNumber::bytes() instead
+ */
public static function parseSize($size)
{
- if ($size < 1024) {
- return JText::sprintf('COM_MEDIA_FILESIZE_BYTES', $size);
- }
- elseif ($size < 1024 * 1024) {
- return JText::sprintf('COM_MEDIA_FILESIZE_KILOBYTES', sprintf('%01.2f', $size / 1024.0));
- }
- else {
- return JText::sprintf('COM_MEDIA_FILESIZE_MEGABYTES', sprintf('%01.2f', $size / (1024.0 * 1024)));
- }
+ JLog::add('MediaHelper::parseSize() is deprecated. Use JHtmlNumber::bytes() instead.', JLog::WARNING, 'deprecated');
+ return JHtml::_('number.bytes', $size);
}
function imageResize($width, $height, $target)
View
2 components/com_weblinks/models/category.php
@@ -124,8 +124,10 @@ protected function getListQuery()
$query->where('c.published = '.(int) $cpublished);
}
}
+
// Join over the users for the author and modified_by names.
$query->select("CASE WHEN a.created_by_alias > ' ' THEN a.created_by_alias ELSE ua.name END AS author");
+ $query->select("ua.email AS author_email");
$query->join('LEFT', '#__users AS ua ON ua.id = a.created_by');
$query->join('LEFT', '#__users AS uam ON uam.id = a.modified_by');
View
37 components/com_weblinks/views/category/view.feed.php
@@ -26,14 +26,19 @@ function display($tpl = null)
$document->link = JRoute::_(WeblinksHelperRoute::getCategoryRoute($app->input->getInt('id')));
$app->input->set('limit', $app->getCfg('feed_limit'));
+ $params = $app->getParams();
$siteEmail = $app->getCfg('mailfrom');
- $fromName = $app->getCfg('fromname');
+ $fromName = $app->getCfg('fromname');
+ $feedEmail = $app->getCfg('feed_email', 'author');
$document->editor = $fromName;
- $document->editorEmail = $siteEmail;
+ if ($feedEmail != "none")
+ {
+ $document->editorEmail = $siteEmail;
+ }
// Get some data from the model
- $items = $this->get('Items');
- $category = $this->get('Category');
+ $items = $this->get('Items');
+ $category = $this->get('Category');
foreach ($items as $item)
{
@@ -42,19 +47,31 @@ function display($tpl = null)
$title = html_entity_decode($title, ENT_COMPAT, 'UTF-8');
// url link to article
- $link = JRoute::_(WeblinksHelperRoute::getWeblinkRoute($item->slug, $item->catid));
+ $link = JRoute::_(WeblinksHelperRoute::getWeblinkRoute($item->id, $item->catid));
// strip html from feed item description text
$description = $item->description;
+ $author = $item->created_by_alias ? $item->created_by_alias : $item->author;
$date = ($item->date ? date('r', strtotime($item->date)) : '');
// load individual item creator class
$feeditem = new JFeedItem;
- $feeditem->title = $title;
- $feeditem->link = $link;
- $feeditem->description = $description;
- $feeditem->date = $date;
- $feeditem->category = 'Weblinks';
+ $feeditem->title = $title;
+ $feeditem->link = $link;
+ $feeditem->description = $description;
+ $feeditem->date = $date;
+ $feeditem->category = $category->title;
+ $feeditem->author = $author;
+
+ // We don't have the author email so we have to use site in both cases.
+ if ($feedEmail == 'site')
+ {
+ $feeditem->authorEmail = $siteEmail;
+ }
+ elseif ($feedEmail === 'author')
+ {
+ $feeditem->authorEmail = $item->author_email;
+ }
// loads item info into rss array
$document->addItem($feeditem);
View
1 includes/application.php
@@ -15,6 +15,7 @@
*
* @package Joomla.Site
* @subpackage Application
+ * @since 1.5
*/
final class JSite extends JApplication
{
View
6 installation/CHANGELOG
@@ -26,6 +26,12 @@ $ -> Language fix or change
- -> Removed
! -> Note
+11-Aug-2012 Jean-Marie Simonet
+ #+ [#25295] Email exposed through RSS and Atom feeds. Thanks Elin and Peter
+ # [#28795] mod_articles_category "read more" truncation not functioning properly. Thanks Elin.
+ ^ [#28374] Deprecate MediaHelper::parseSize() and use JHtmlNumber::bytes() to process file size in Media Manager. Thanks Michael.
+ + [#28902] Add CLI to remove files that weren't removed at update. Thanks Michael
+
10-Aug-2012 Rouven Weßling
^ Reduce use of deprecated JDatabase and JRequest methods.
^ Merge latest platform (2f2d084af274840e7103fe6ad826926be8b3eb06)
View
11 installation/controller.php
@@ -29,17 +29,17 @@ class InstallationController extends JControllerLegacy
public function display($cachable = false, $urlparams = false)
{
// Get the current URI to redirect to.
- $uri = JURI::getInstance();
- $redirect = base64_encode($uri);
+ $uri = JURI::getInstance();
+ $redirect = base64_encode($uri);
// Get the document object.
- $document = JFactory::getDocument();
+ $document = JFactory::getDocument();
// Set the default view name and format from the Request.
if (file_exists(JPATH_CONFIGURATION . '/configuration.php') && (filesize(JPATH_CONFIGURATION . '/configuration.php') > 10)
&& file_exists(JPATH_INSTALLATION . '/index.php'))
{
- $default_view = 'remove';
+ $default_view = 'remove';
}
else
{
@@ -55,7 +55,8 @@ public function display($cachable = false, $urlparams = false)
$this->input->set('view', $default_view);
}
- if ($view = $this->getView($vName, $vFormat))
+ $view = $this->getView($vName, $vFormat);
+ if ($view)
{
$model = $this->getModel('Setup', 'InstallationModel', array('dbo' => null));
$sufficient = $model->getPhpOptionsSufficient();
View
5 installation/includes/application.php
@@ -14,6 +14,7 @@
* Provide many supporting API functions
*
* @package Joomla.Installation
+ * @since 1.5
*/
class JInstallation extends JApplication
{
@@ -42,8 +43,8 @@ public function __construct(array $config = array())
public function render()
{
$document = JFactory::getDocument();
- $config = JFactory::getConfig();
- $user = JFactory::getUser();
+ $config = JFactory::getConfig();
+ $user = JFactory::getUser();
switch ($document->getType())
{
View
3 language/en-GB/en-GB.com_media.ini
@@ -58,9 +58,6 @@ COM_MEDIA_FIELD_RESTRICT_UPLOADS_DESC="Restrict uploads for lower than manager u
COM_MEDIA_FIELD_RESTRICT_UPLOADS_LABEL="Restrict Uploads"
COM_MEDIA_FILES="Files"
COM_MEDIA_FILESIZE="File size"
-COM_MEDIA_FILESIZE_BYTES="%s bytes"
-COM_MEDIA_FILESIZE_KILOBYTES="%s KB"
-COM_MEDIA_FILESIZE_MEGABYTES="%s MB"
COM_MEDIA_FOLDER="Folder"
COM_MEDIA_FOLDERS="Folders"
COM_MEDIA_IMAGE_DESCRIPTION="Image Description"
View
90 libraries/cms/schema/changeitem.php
@@ -1,8 +1,6 @@
<?php
/**
- * Abstract class for database schema change
- *
- * @package CMS.Library
+ * @package Joomla.Libraries
* @subpackage Schema
*
* @copyright Copyright (C) 2005 - 2012 Open Source Matters, Inc. All rights reserved.
@@ -25,45 +23,50 @@
* This is an abstract class. We need to extend it for each database and add a
* buildCheckQuery() method that creates the query to check that a DDL query has been run.
*
- * @package CMS.Library
+ * @package Joomla.Libraries
* @subpackage Schema
* @since 2.5
*/
abstract class JSchemaChangeitem extends JObject
{
/**
- * Update file: full path file name where query was found
- *
- * @var string
- */
+ * Update file: full path file name where query was found
+ *
+ * @var string
+ * @since 2.5
+ */
public $file = null;
/**
* Update query: query used to change the db schema (one line from the file)
*
* @var string
+ * @since 2.5
*/
public $updateQuery = null;
/**
- * Check query: query used to check the db schema
- *
- * @var string
- */
+ * Check query: query used to check the db schema
+ *
+ * @var string
+ * @since 2.5
+ */
public $checkQuery = null;
/**
- * Check query result: expected result of check query if database is up to date
- *
- * @var string
- */
+ * Check query result: expected result of check query if database is up to date
+ *
+ * @var string
+ * @since 2.5
+ */
public $checkQueryExpected = 1;
/**
- * JDatabaseDriver object
- *
- * @var JDatabaseDriver
- */
+ * JDatabaseDriver object
+ *
+ * @var JDatabaseDriver
+ * @since 2.5
+ */
public $db = null;
/**
@@ -71,36 +74,39 @@
* message to tell user what was checked / changed
* Possible values: ADD_TABLE, ADD_COLUMN, CHANGE_COLUMN_TYPE, ADD_INDEX
*
- * @var string
- *
+ * @var string
+ * @since 2.5
*/
public $queryType = null;
/**
- * Array with values for use in a JText::sprintf statment indicating what was checked
- *
- * Tells you what the message should be, based on which elements are defined, as follows:
- * For ADD_TABLE: table
- * For ADD_COLUMN: table, column
- * For CHANGE_COLUMN_TYPE: table, column, type
- * For ADD_INDEX: table, index
- *
- * @var array
- */
+ * Array with values for use in a JText::sprintf statment indicating what was checked
+ *
+ * Tells you what the message should be, based on which elements are defined, as follows:
+ * For ADD_TABLE: table
+ * For ADD_COLUMN: table, column
+ * For CHANGE_COLUMN_TYPE: table, column, type
+ * For ADD_INDEX: table, index
+ *
+ * @var array
+ * @since 2.5
+ */
public $msgElements = array();
/**
- * Checked status
- *
- * @var int 0=not checked, -1=skipped, -2=failed, 1=succeeded
- */
+ * Checked status
+ *
+ * @var integer 0=not checked, -1=skipped, -2=failed, 1=succeeded
+ * @since 2.5
+ */
public $checkStatus = 0;
/**
- * Rerun status
- *
- * @var int 0=not rerun, -1=skipped, -2=failed, 1=succeeded
- */
+ * Rerun status
+ *
+ * @var int 0=not rerun, -1=skipped, -2=failed, 1=succeeded
+ * @since 2.5
+ */
public $rerunStatus = 0;
/**
@@ -121,13 +127,13 @@ public function __construct($db, $file, $query)
}
/**
- * Returns an instance of the correct schemachangeitem for the $db
+ * Returns a reference to the JSchemaChangeitem object.
*
* @param JDatabaseDriver $db Database connector object
* @param string $file Full path name of the sql file
* @param string $query Text of the sql query (one line of the file)
*
- * @return JSchemaChangeItem for the $db driver
+ * @return JSchemaChangeitem instance based on the database driver
*
* @since 2.5
*/
View
13 libraries/cms/schema/changeitemmysql.php
@@ -1,6 +1,6 @@
<?php
/**
- * @package CMS.Library
+ * @package Joomla.Libraries
* @subpackage Schema
*
* @copyright Copyright (C) 2005 - 2012 Open Source Matters, Inc. All rights reserved.
@@ -12,7 +12,7 @@
/**
* Checks the database schema against one MySQL DDL query to see if it has been run.
*
- * @package CMS.Library
+ * @package Joomla.Libraries
* @subpackage Schema
* @since 2.5
*/
@@ -65,8 +65,7 @@ protected function buildCheckQuery()
$alterCommand = strtoupper($wordArray[3] . ' ' . $wordArray[4]);
if ($alterCommand == 'ADD COLUMN')
{
- $result = 'SHOW COLUMNS IN ' . $wordArray[2] .
- ' WHERE field = ' . $this->fixQuote($wordArray[5]);
+ $result = 'SHOW COLUMNS IN ' . $wordArray[2] . ' WHERE field = ' . $this->fixQuote($wordArray[5]);
$this->queryType = 'ADD_COLUMN';
$this->msgElements = array($this->fixQuote($wordArray[2]), $this->fixQuote($wordArray[5]));
}
@@ -108,8 +107,7 @@ protected function buildCheckQuery()
{
$type = $this->fixQuote($this->fixInteger($wordArray[5], $wordArray[6]));
}
- $result = 'SHOW COLUMNS IN ' . $wordArray[2] . ' WHERE field = '
- . $this->fixQuote($wordArray[4]) . ' AND type = ' . $type;
+ $result = 'SHOW COLUMNS IN ' . $wordArray[2] . ' WHERE field = ' . $this->fixQuote($wordArray[4]) . ' AND type = ' . $type;
$this->queryType = 'CHANGE_COLUMN_TYPE';
$this->msgElements = array($this->fixQuote($wordArray[2]), $this->fixQuote($wordArray[4]), $type);
}
@@ -117,8 +115,7 @@ protected function buildCheckQuery()
{
// Kludge to fix problem with "integer unsigned"
$type = $this->fixQuote($this->fixInteger($wordArray[6], $wordArray[7]));
- $result = 'SHOW COLUMNS IN ' . $wordArray[2] . ' WHERE field = ' .
- $this->fixQuote($wordArray[4]) . ' AND type = ' . $type;
+ $result = 'SHOW COLUMNS IN ' . $wordArray[2] . ' WHERE field = ' . $this->fixQuote($wordArray[4]) . ' AND type = ' . $type;
$this->queryType = 'CHANGE_COLUMN_TYPE';
$this->msgElements = array($this->fixQuote($wordArray[2]), $this->fixQuote($wordArray[4]), $type);
}
View
9 libraries/cms/schema/changeitemsqlazure.php
@@ -1,19 +1,18 @@
<?php
/**
- * @package CMS.Library
+ * @package Joomla.Libraries
* @subpackage Schema
*
-* @copyright Copyright (C) 2005 - 2012 Open Source Matters, Inc. All rights reserved.
+ * @copyright Copyright (C) 2005 - 2012 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE
*/
defined('_JEXEC') or die;
-JLoader::register('JDatabaseSQLSrv', __DIR__ . '/Changeitemsqlsrv.php');
/**
- * Checks the database schema against one MySQL DDL query to see if it has been run.
+ * Checks the database schema against one SQL Azure DDL query to see if it has been run.
*
- * @package CMS.Library
+ * @package Joomla.Libraries
* @subpackage Schema
* @since 2.5
*/
View
16 libraries/cms/schema/changeitemsqlsrv.php
@@ -1,18 +1,18 @@
<?php
/**
- * @package CMS.Library
+ * @package Joomla.Libraries
* @subpackage Schema
*
-* @copyright Copyright (C) 2005 - 2012 Open Source Matters, Inc. All rights reserved.
+ * @copyright Copyright (C) 2005 - 2012 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE
*/
defined('_JEXEC') or die;
/**
- * Checks the database schema against one MySQL DDL query to see if it has been run.
+ * Checks the database schema against one SQL Server DDL query to see if it has been run.
*
- * @package CMS.Library
+ * @package Joomla.Libraries
* @subpackage Schema
* @since 2.5
*/
@@ -45,7 +45,7 @@ protected function buildCheckQuery()
$this->updateQuery = str_replace("\n", '', $this->updateQuery);
// Fix up extra spaces around () and in general
- $find = array('#((\s*)\(\s*([^)\s]+)\s*)(\))#','#(\s)(\s*)#');
+ $find = array('#((\s*)\(\s*([^)\s]+)\s*)(\))#', '#(\s)(\s*)#');
$replace = array('($3)', '$1');
$updateQuery = preg_replace($find, $replace, $this->updateQuery);
$wordArray = explode(' ', $updateQuery);
@@ -65,11 +65,9 @@ protected function buildCheckQuery()
$alterCommand = strtoupper($wordArray[3] . ' ' . $wordArray[4]);
if ($alterCommand == 'ADD')
{
- $result = 'SELECT * FROM INFORMATION_SCHEMA.Columns ' . $wordArray[2] .
- ' WHERE COLUMN_NAME = ' . $this->fixQuote($wordArray[5]);
+ $result = 'SELECT * FROM INFORMATION_SCHEMA.Columns ' . $wordArray[2] . ' WHERE COLUMN_NAME = ' . $this->fixQuote($wordArray[5]);
$this->queryType = 'ADD';
$this->msgElements = array($this->fixQuote($wordArray[2]), $this->fixQuote($wordArray[5]));
-
}
elseif ($alterCommand == 'CREATE INDEX')
{
@@ -136,7 +134,7 @@ protected function buildCheckQuery()
private function fixInteger($type1, $type2)
{
$result = $type1;
- if (strtolower($type1) == "integer" && strtolower(substr($type2, 0, 8)) == 'unsigned')
+ if (strtolower($type1) == 'integer' && strtolower(substr($type2, 0, 8)) == 'unsigned')
{
$result = 'int';
}
View
34 libraries/cms/schema/changeset.php
@@ -1,6 +1,6 @@
<?php
/**
- * @package CMS.Library
+ * @package Joomla.Libraries
* @subpackage Schema
*
* @copyright Copyright (C) 2005 - 2012 Open Source Matters, Inc. All rights reserved.
@@ -18,31 +18,33 @@
* the database when this database was created or updated. This enables the
* Installation Manager to check that the current database schema is up to date.
*
- * @package CMS.Library
+ * @package Joomla.Libraries
* @subpackage Schema
* @since 2.5
*/
class JSchemaChangeset extends JObject
{
/**
- * Array of JSchemaChangeItem objects
+ * Array of JSchemaChangeitem objects
*
- * @var string
+ * @var array
+ * @since 2.5
*/
protected $changeItems = array();
/**
- * JDatabaseDriver object
- *
- * @var JDatabaseDriver
- */
+ * JDatabaseDriver object
+ *
+ * @var JDatabaseDriver
+ * @since 2.5
+ */
protected $db = null;
/**
- * Folder where SQL update files will be found
- *
- * @var string
- */
+ * Folder where SQL update files will be found
+ *
+ * @var string
+ */
protected $folder = null;
/**
@@ -67,13 +69,12 @@ public function __construct($db, $folder = null)
}
/**
- * Returns the existing JSchemaChangeset object if it exists.
- * Otherwise, it creates a new one.
+ * Returns a reference to the JSchemaChangeset object, only creating it if it doesn't already exist.
*
* @param JDatabaseDriver $db The current database object
* @param string $folder The full path to the folder containing the update queries
*
- * @return JSchemaChangeSet The (possibly chached) instance of JSchemaChangeSet
+ * @return JSchemaChangeset
*
* @since 2.5
*/
@@ -82,7 +83,7 @@ public static function getInstance($db, $folder)
static $instance;
if (!is_object($instance))
{
- $instance = new JSchemaChangeSet($db, $folder);
+ $instance = new JSchemaChangeset($db, $folder);
}
return $instance;
}
@@ -232,5 +233,4 @@ private function getUpdateQueries(array $sqlfiles)
}
return $result;
}
-
}
View
140 modules/mod_articles_category/helper.php
@@ -199,25 +199,28 @@ public static function getList(&$params)
$item->slug = $item->id.':'.$item->alias;
$item->catslug = $item->catid ? $item->catid .':'.$item->category_alias : $item->catid;
- if ($access || in_array($item->access, $authorised)) {
+ if ($access || in_array($item->access, $authorised))
+ {
// We know that user has the privilege to view the article
$item->link = JRoute::_(ContentHelperRoute::getArticleRoute($item->slug, $item->catslug));
}
else
{
- // Angie Fixed Routing
$app = JFactory::getApplication();
$menu = $app->getMenu();
$menuitems = $menu->getItems('link', 'index.php?option=com_users&view=login');
- if (isset($menuitems[0]))
- {
+ if (isset($menuitems[0]))
+ {
$Itemid = $menuitems[0]->id;
- } elseif ($app->input->getInt('Itemid') > 0) { //use Itemid from requesting page only if there is no existing menu
- $Itemid = $app->input->getInt('Itemid');
+ }
+ elseif (JRequest::getInt('Itemid') > 0)
+ {
+ // Use Itemid from requesting page only if there is no existing menu
+ $Itemid = JRequest::getInt('Itemid');
}
$item->link = JRoute::_('index.php?option=com_users&view=login&Itemid='.$Itemid);
- }
+ }
// Used for styling the active article
$item->active = $item->id == $active_article_id ? 'active' : '';
@@ -242,7 +245,6 @@ public static function getList(&$params)
$item->introtext = self::_cleanIntrotext($item->introtext);
}
$item->displayIntrotext = $show_introtext ? self::truncate($item->introtext, $introtext_limit) : '';
- // added Angie show_unauthorizid
$item->displayReadmore = $item->alternative_readmore;
}
@@ -262,110 +264,48 @@ public static function _cleanIntrotext($introtext)
}
/**
- * This is a better truncate implementation than what we
- * currently have available in the library. In particular,
- * on index.php/Banners/Banners/site-map.html JHtml's truncate
- * method would only return "Article...". This implementation
- * was taken directly from the Stack Overflow thread referenced
- * below. It was then modified to return a string rather than
- * print out the output and made to use the relevant JString
- * methods.
- *
- * @link http://stackoverflow.com/questions/1193500/php-truncate-html-ignoring-tags
- * @param mixed $html
- * @param mixed $maxLength
+ * Method to truncate introtext
+ *
+ * The goal is to get the proper length plain text string with as much of
+ * the html intact as possible with all tags properly closed.
+ *
+ * @param string $html The content of the introtext to be truncated
+ * @param integer $maxLength The maximum number of charactes to render
+ *
+ * @return string The truncated string
*/
public static function truncate($html, $maxLength = 0)
{
- $printedLength = 0;
- $position = 0;
- $tags = array();
+ $baseLength = strlen($html);
+ $diffLength = 0;
- $output = '';
+ // First get the plain text string. This is the rendered text we want to end up with.
+ $ptString = JHtml::_('string.truncate', $html, $maxLength, $noSplit = true, $allowHtml = false);
- if (empty($html)) {
- return $output;
- }
-
- while ($printedLength < $maxLength && preg_match('{</?([a-z]+)[^>]*>|&#?[a-zA-Z0-9]+;}', $html, $match, PREG_OFFSET_CAPTURE, $position))
+ for ($maxLength; $maxLength < $baseLength;)
{
- list($tag, $tagPosition) = $match[0];
-
- // Print text leading up to the tag.
- $str = JString::substr($html, $position, $tagPosition - $position);
- if ($printedLength + JString::strlen($str) > $maxLength) {
- $output .= JString::substr($str, 0, $maxLength - $printedLength);
- $printedLength = $maxLength;
- break;
- }
-
- $output .= $str;
- $lastCharacterIsOpenBracket = (JString::substr($output, -1, 1) === '<');
-
- if ($lastCharacterIsOpenBracket) {
- $output = JString::substr($output, 0, JString::strlen($output) - 1);
- }
-
- $printedLength += JString::strlen($str);
-
- if ($tag[0] == '&') {
- // Handle the entity.
- $output .= $tag;
- $printedLength++;
- }
- else {
- // Handle the tag.
- $tagName = $match[1][0];
+ // Now get the string if we allow html.
+ $htmlString = JHtml::_('string.truncate', $html, $maxLength, $noSplit = true, $allowHtml = true);
- if ($tag[1] == '/') {
- // This is a closing tag.
- $openingTag = array_pop($tags);
+ // Now get the plain text from the html string.
+ $htmlStringToPtString = JHtml::_('string.truncate', $htmlString, $maxLength, $noSplit = true, $allowHtml = false);
- $output .= $tag;
- }
- elseif ($tag[JString::strlen($tag) - 2] == '/') {
- // Self-closing tag.
- $output .= $tag;
- }
- else {
- // Opening tag.
- $output .= $tag;
- $tags[] = $tagName;
- }
+ // If the new plain text string matches the original plain text string we are done.
+ if ($ptString == $htmlStringToPtString)
+ {
+ return $htmlString;
}
+ // Get the number of html tag characters in the first $maxlength characters
+ $diffLength = strlen($ptString) - strlen($htmlStringToPtString);
- // Continue after the tag.
- if ($lastCharacterIsOpenBracket) {
- $position = ($tagPosition - 1) + JString::strlen($tag);
- }
- else {
- $position = $tagPosition + JString::strlen($tag);
+ // Set new $maxlength that adjusts for the html tags
+ $maxLength += $diffLength;
+ if ($baseLength <= $maxLength || $diffLength <= 0)
+ {
+ return $htmlString;
}
-
}
-
- // Print any remaining text.
- if ($printedLength < $maxLength && $position < JString::strlen($html)) {
- $output .= JString::substr($html, $position, $maxLength - $printedLength);
- }
-
- // Close any open tags.
- while (!empty($tags))
- {
- $output .= sprintf('</%s>', array_pop($tags));
- }
-
- $length = JString::strlen($output);
- $lastChar = JString::substr($output, ($length - 1), 1);
- $characterNumber = ord($lastChar);
-
- if ($characterNumber === 194) {
- $output = JString::substr($output, 0, JString::strlen($output) - 1);
- }
-
- $output = JString::rtrim($output);
-
- return $output.'&hellip;';
+ return $html;
}
public static function groupBy($list, $fieldName, $article_grouping_direction, $fieldNameToKeep = null)
View
1 modules/mod_banners/helper.php
@@ -12,6 +12,7 @@
/**
* @package Joomla.Site
* @subpackage mod_banners
+ * @since 1.5
*/
class modBannersHelper
{
View
1 modules/mod_breadcrumbs/helper.php
@@ -12,6 +12,7 @@
/**
* @package Joomla.Site
* @subpackage mod_breadcrumbs
+ * @since 1.5
*/
class modBreadCrumbsHelper
{
View
1 modules/mod_feed/helper.php
@@ -12,6 +12,7 @@
/**
* @package Joomla.Site
* @subpackage mod_feed
+ * @since 1.5
*/
class modFeedHelper
{
View
1 modules/mod_login/helper.php
@@ -12,6 +12,7 @@
/**
* @package Joomla.Site
* @subpackage mod_login
+ * @since 1.5
*/
class modLoginHelper
{
View
1 modules/mod_random_image/helper.php
@@ -12,6 +12,7 @@
/**
* @package Joomla.Site
* @subpackage mod_random_image
+ * @since 1.5
*/
class modRandomImageHelper
{
View
1 modules/mod_related_items/helper.php
@@ -14,6 +14,7 @@
/**
* @package Joomla.Site
* @subpackage mod_related_items
+ * @since 1.5
*/
abstract class modRelatedItemsHelper
{
View
1 modules/mod_syndicate/helper.php
@@ -12,6 +12,7 @@
/**
* @package Joomla.Site
* @subpackage mod_syndicate
+ * @since 1.5
*/
class modSyndicateHelper
{
View
1 modules/mod_whosonline/helper.php
@@ -12,6 +12,7 @@
/**
* @package Joomla.Site
* @subpackage mod_whosonline
+ * @since 1.5
*/
class modWhosonlineHelper
{
View
1 modules/mod_wrapper/helper.php
@@ -12,6 +12,7 @@
/**
* @package Joomla.Site
* @subpackage mod_wrapper
+ * @since 1.5
*/
class modWrapperHelper
{
View
1 plugins/content/emailcloak/emailcloak.php
@@ -14,6 +14,7 @@
*
* @package Joomla.Plugin
* @subpackage Content.emailcloak
+ * @since 1.5
*/
class plgContentEmailcloak extends JPlugin
{
View
1 plugins/content/loadmodule/loadmodule.php
@@ -15,6 +15,7 @@
*
* @package Joomla.Plugin
* @subpackage Content.loadmodule
+ * @since 1.5
*/
class plgContentLoadmodule extends JPlugin
{
View
1 plugins/content/pagenavigation/pagenavigation.php
@@ -14,6 +14,7 @@
*
* @package Joomla.Plugin
* @subpackage Content.pagenavigation
+ * @since 1.5
*/
class plgContentPagenavigation extends JPlugin
{
View
1 plugins/content/vote/vote.php
@@ -14,6 +14,7 @@
*
* @package Joomla.Plugin
* @subpackage Content.vote
+ * @since 1.5
*/
class plgContentVote extends JPlugin
{
View
3 plugins/system/languagecode/languagecode.php
@@ -14,11 +14,14 @@
*
* @package Joomla.Plugin
* @subpackage Content.languagecode
+ * @since 2.5
*/
class plgSystemLanguagecode extends JPlugin
{
/**
* Plugin that change the language code used in the <html /> tag
+ *
+ * @since 2.5
*/
public function onAfterRender()
{
View
1 plugins/system/log/log.php
@@ -14,6 +14,7 @@
*
* @package Joomla.Plugin
* @subpackage System.log
+ * @since 1.5
*/
class plgSystemLog extends JPlugin
{
View
7 plugins/system/logout/logout.php
@@ -14,6 +14,7 @@
*
* @package Joomla.Plugin
* @subpackage System.logout
+ * @since 1-6
*/
class plgSystemLogout extends JPlugin
{
@@ -24,7 +25,7 @@ class plgSystemLogout extends JPlugin
* @param object The object to observe -- event dispatcher.
* @param object The configuration object for the plugin.
* @return void
- * @since 1.5
+ * @since 1.6
*/
function __construct(&$subject, $config)
{
@@ -51,8 +52,8 @@ function __construct(&$subject, $config)
* @param array $user Holds the user data.
* @param array $options Array holding options (client, ...).
*
- * @return object True on success
- * @since 1.5
+ * @return boolean Always returns true
+ * @since 1.6
*/
public function onUserLogout($user, $options = array())
{
View
4 plugins/system/p3p/p3p.php
@@ -14,9 +14,13 @@
*
* @package Joomla.Plugin
* @subpackage System.p3p
+ * @since 1.6
*/
class plgSystemP3p extends JPlugin
{
+ /*
+ * @since 1.6
+ */
function onAfterInitialise()
{
// Get the header
View
3 plugins/system/redirect/redirect.php
@@ -14,6 +14,7 @@
*
* @package Joomla.Plugin
* @subpackage System.redirect
+ * @since 1.6
*/
class plgSystemRedirect extends JPlugin
{
@@ -24,7 +25,7 @@ class plgSystemRedirect extends JPlugin
* @param object The object to observe -- event dispatcher.
* @param object The configuration object for the plugin.
* @return void
- * @since 1.0
+ * @since 1.6
*/
function __construct(&$subject, $config)
{
View
1 plugins/system/remember/remember.php
@@ -14,6 +14,7 @@
*
* @package Joomla.Plugin
* @subpackage System.remember
+ * @since 1.5
*/
class plgSystemRemember extends JPlugin
{
View
1 plugins/system/sef/sef.php
@@ -13,6 +13,7 @@
*
* @package Joomla.Plugin
* @subpackage System.sef
+ * @since 1.5
*/
class plgSystemSef extends JPlugin
{

0 comments on commit d6258c0

Please sign in to comment.
Something went wrong with that request. Please try again.