Permalink
Browse files

Merge branch 'master' into template9

Conflicts:
	administrator/components/com_media/views/medialist/tmpl/thumbs_img.php
	installation/controller.php
  • Loading branch information...
realityking committed Aug 12, 2012
2 parents 0adbb33 + 8e84ff0 commit d6258c0bd02fc511a40a8fb61f711da3c80991fc
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
@@ -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
@@ -14,6 +14,7 @@
*
* @package Joomla.Administrator
* @subpackage com_admin
+ * @since 1.6.4
*/
class joomlaInstallerScript
{
@@ -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
{
@@ -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>
@@ -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)
@@ -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"
@@ -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
@@ -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();
@@ -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)) {
@@ -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);
@@ -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)
@@ -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)
@@ -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)
@@ -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');
Oops, something went wrong.

0 comments on commit d6258c0

Please sign in to comment.