Modified:
development/trunk/installation/CHANGELOG
development/trunk/libraries/cms/form/field/templatestyle.php
development/trunk/libraries/cms/language/multilang.php
development/trunk/libraries/cms/schema/changeset.php
development/trunk/libraries/cms/version/version.php
Log:
Merge branch 'master' of github.com:joomla/joomla-cms
Modified: development/trunk/installation/CHANGELOG
===================================================================
--- development/trunk/installation/CHANGELOG 2012-03-25 19:26:17 UTC (rev 22948)
+++ development/trunk/installation/CHANGELOG 2012-03-25 20:26:17 UTC (rev 22949)
@@ -29,6 +29,7 @@
25-Mar-2012 Christophe Demko
# [#28284] System messages included in cached pages
# [#28268] Update MooTools to 1.4.5 (Rouven Weßling)
+ # [#28286] Fix @since tags for 2.5.4. Code style in CMS libraries. (Rouven Weßling)
23-Mar-2012 Jean-Marie Simonet
$ Updating installation ini file sq-IQ
Modified: development/trunk/libraries/cms/form/field/templatestyle.php
===================================================================
--- development/trunk/libraries/cms/form/field/templatestyle.php 2012-03-25 19:26:17 UTC (rev 22948)
+++ development/trunk/libraries/cms/form/field/templatestyle.php 2012-03-25 20:26:17 UTC (rev 22949)
@@ -1,6 +1,6 @@
<?php
/**
- * @package Joomla.Platform
+ * @package Joomla.Libraries
* @subpackage Form
*
* @copyright Copyright (C) 2005 - 2012 Open Source Matters, Inc. All rights reserved.
@@ -12,21 +12,20 @@
JFormHelper::loadFieldClass('groupedlist');
/**
- * Form Field class for the Joomla Platform.
+ * Form Field class for the Joomla CMS.
* Supports a select grouped list of template styles
*
- * @package Joomla.Platform
+ * @package Joomla.Libraries
* @subpackage Form
- * @since 11.1
+ * @since 1.6
*/
class JFormFieldTemplateStyle extends JFormFieldGroupedList
{
-
/**
* The form field type.
*
* @var string
- * @since 11.1
+ * @since 1.6
*/
public $type = 'TemplateStyle';
@@ -38,7 +37,7 @@
*
* @return array The field option objects as a nested array in groups.
*
- * @since 11.1
+ * @since 1.6
*/
protected function getGroups()
{
@@ -86,6 +85,7 @@
|| $lang->load('tpl_' . $template . '.sys', $client->path, $lang->getDefault(), false, false)
|| $lang->load('tpl_' . $template . '.sys', $client->path . '/templates/' . $template, $lang->getDefault(), false, false);
$name = JText::_($style->name);
+
// Initialize the group if necessary.
if (!isset($groups[$name]))
{
Modified: development/trunk/libraries/cms/language/multilang.php
===================================================================
--- development/trunk/libraries/cms/language/multilang.php 2012-03-25 19:26:17 UTC (rev 22948)
+++ development/trunk/libraries/cms/language/multilang.php 2012-03-25 20:26:17 UTC (rev 22949)
@@ -12,10 +12,9 @@
/**
* Utitlity class for multilang
*
- * @abstract
- * @package Joomla.Libraries
- * @subpackage Language
- * @since 2.5.2
+ * @package Joomla.Libraries
+ * @subpackage Language
+ * @since 2.5.4
*/
class JLanguageMultilang
{
@@ -25,7 +24,7 @@
*
* @return boolean True if site is supporting multiple languages; false otherwise.
*
- * @since 2.5.2
+ * @since 2.5.4
*/
public static function isEnabled()
{
@@ -39,21 +38,23 @@
$app = JFactory::getApplication();
// If being called from the front-end, we can avoid the database query.
- if ($app->isSite()) {
+ if ($app->isSite())
+ {
$enabled = $app->getLanguageFilter();
return $enabled;
}
// If already tested, don't test again.
- if (!$tested) {
+ if (!$tested)
+ {
// Determine status of language filter plug-in.
$db = JFactory::getDBO();
$query = $db->getQuery(true);
$query->select('enabled');
$query->from($db->quoteName('#__extensions'));
- $query->where($db->quoteName('type') . ' = ' . $db->quote('plugin'));
- $query->where($db->quoteName('folder') . ' = ' . $db->quote('system'));
+ $query->where($db->quoteName('type') . ' = ' . $db->quote('plugin'));
+ $query->where($db->quoteName('folder') . ' = ' . $db->quote('system'));
$query->where($db->quoteName('element') . ' = ' . $db->quote('languagefilter'));
$db->setQuery($query);
Modified: development/trunk/libraries/cms/schema/changeset.php
===================================================================
--- development/trunk/libraries/cms/schema/changeset.php 2012-03-25 19:26:17 UTC (rev 22948)
+++ development/trunk/libraries/cms/schema/changeset.php 2012-03-25 20:26:17 UTC (rev 22949)
@@ -13,7 +13,6 @@
jimport('joomla.filesystem.folder');
JLoader::register('JSchemaChangeitem', JPATH_LIBRARIES . '/cms/schema/changeitem.php');
-
/**
* Contains a set of JSchemaChange objects for a particular instance of Joomla.
* Each of these objects contains a DDL query that should have been run against
@@ -48,12 +47,13 @@
protected $folder = null;
/**
- *
* Constructor: builds array of $changeItems by processing the .sql files in a folder.
* The folder for the Joomla core updates is administrator/components/com_admin/sql/updates/<database>.
*
- * @param JDatabase $db The current database object
- * @param string $folder The full path to the folder containing the update queries
+ * @param JDatabase $db The current database object
+ * @param string $folder The full path to the folder containing the update queries
+ *
+ * @since 2.5
*/
public function __construct($db, $folder = null)
{
@@ -61,25 +61,28 @@
$this->folder = $folder;
$updateFiles = $this->getUpdateFiles();
$updateQueries = $this->getUpdateQueries($updateFiles);
- foreach ($updateQueries as $obj) {
+ foreach ($updateQueries as $obj)
+ {
$this->changeItems[] = JSchemaChangeItem::getInstance($db, $obj->file, $obj->updateQuery);
}
}
/**
- *
* Returns the existing JSchemaChangeset object if it exists.
* Otherwise, it creates a new one.
*
- * @param JDatabase $db The current database object
- * @param string $folder The full path to the folder containing the update queries
+ * @param JDatabase $db The current database object
+ * @param string $folder The full path to the folder containing the update queries
*
- * @since 2.5
+ * @return JSchemaChangeSet The (possibly chached) instance of JSchemaChangeSet
+ *
+ * @since 2.5
*/
public static function getInstance($db, $folder)
{
static $instance;
- if (!is_object($instance)) {
+ if (!is_object($instance))
+ {
$instance = new JSchemaChangeSet($db, $folder);
}
return $instance;
@@ -90,15 +93,18 @@
* Note these are not database errors but rather situations where
* the current schema is not up to date.
*
- * @return array Array of errors if any.
+ * @return array Array of errors if any.
*
- * @since 2.5
+ * @since 2.5
*/
public function check()
{
$errors = array();
- foreach ($this->changeItems as $item) {
- if ($item->check() === -2) { // error found
+ foreach ($this->changeItems as $item)
+ {
+ if ($item->check() === -2)
+ {
+ // Error found
$errors[] = $item;
}
}
@@ -108,12 +114,15 @@
/**
* Runs the update query to apply the change to the database
*
- * @since 2.5
+ * @return void
+ *
+ * @since 2.5
*/
public function fix()
{
$this->check();
- foreach ($this->changeItems as $item) {
+ foreach ($this->changeItems as $item)
+ {
$item->fix();
}
}
@@ -128,8 +137,10 @@
public function getStatus()
{
$result = array('unchecked' => array(), 'ok' => array(), 'error' => array(), 'skipped' => array());
- foreach ($this->changeItems as $item) {
- switch ($item->checkStatus) {
+ foreach ($this->changeItems as $item)
+ {
+ switch ($item->checkStatus)
+ {
case 0:
$result['unchecked'][] = $item;
break;
@@ -148,7 +159,6 @@
}
/**
- *
* Gets the current database schema, based on the highest version number.
* Note that the .sql files are named based on the version and date, so
* the file name of the last file should match the database schema version
@@ -158,7 +168,8 @@
*
* @since 2.5
*/
- public function getSchema() {
+ public function getSchema()
+ {
$updateFiles = $this->getUpdateFiles();
$result = new SplFileInfo(array_pop($updateFiles));
return $result->getBasename('.sql');
@@ -171,16 +182,19 @@
*
* @since 2.5
*/
- private function getUpdateFiles() {
- // get the folder from the database name
+ private function getUpdateFiles()
+ {
+ // Get the folder from the database name
$sqlFolder = $this->db->name;
- if (substr($sqlFolder, 0, 5) == 'mysql') {
+ if (substr($sqlFolder, 0, 5) == 'mysql')
+ {
$sqlFolder = 'mysql';
}
// Default folder to core com_admin
- if (!$this->folder) {
- $this->folder = JPATH_ADMINISTRATOR.'/components/com_admin/sql/updates/';
+ if (!$this->folder)
+ {
+ $this->folder = JPATH_ADMINISTRATOR . '/components/com_admin/sql/updates/';
}
return JFolder::files($this->folder . '/' . $sqlFolder, '\.sql$', 1, true);
}
@@ -196,16 +210,21 @@
*
* @since 2.5
*/
- private function getUpdateQueries(array $sqlfiles) {
- $result = array(); // hold results as array of objects
- foreach ($sqlfiles as $file) {
+ private function getUpdateQueries(array $sqlfiles)
+ {
+ // Hold results as array of objects
+ $result = array();
+ foreach ($sqlfiles as $file)
+ {
$buffer = file_get_contents($file);
// Create an array of queries from the sql file
$queries = $this->db->splitSql($buffer);
- foreach ($queries as $query) {
- if (trim($query)) {
- $fileQueries = new stdClass();
+ foreach ($queries as $query)
+ {
+ if (trim($query))
+ {
+ $fileQueries = new stdClass;
$fileQueries->file = $file;
$fileQueries->updateQuery = $query;
$result[] = $fileQueries;
Modified: development/trunk/libraries/cms/version/version.php
===================================================================
--- development/trunk/libraries/cms/version/version.php 2012-03-25 19:26:17 UTC (rev 22948)
+++ development/trunk/libraries/cms/version/version.php 2012-03-25 20:26:17 UTC (rev 22949)
@@ -85,7 +85,7 @@
*/
public function getShortVersion()
{
- return $this->RELEASE.'.'.$this->DEV_LEVEL;
+ return $this->RELEASE . '.' . $this->DEV_LEVEL;
}
/**
@@ -97,9 +97,9 @@
*/
public function getLongVersion()
{
- return $this->PRODUCT.' '. $this->RELEASE.'.'.$this->DEV_LEVEL.' '
- . $this->DEV_STATUS.' [ '.$this->CODENAME.' ] '.$this->RELDATE.' '
- .$this->RELTIME.' '.$this->RELTZ;
+ return $this->PRODUCT . ' ' . $this->RELEASE . '.' . $this->DEV_LEVEL . ' '
+ . $this->DEV_STATUS . ' [ ' . $this->CODENAME . ' ] ' . $this->RELDATE . ' '
+ . $this->RELTIME . ' ' . $this->RELTZ;
}
/**
@@ -115,20 +115,24 @@
*/
public function getUserAgent($component = null, $mask = false, $add_version = true)
{
- if ($component === null) {
+ if ($component === null)
+ {
$component = 'Framework';
}
- if ($add_version) {
- $component .= '/'.$this->RELEASE;
+ if ($add_version)
+ {
+ $component .= '/' . $this->RELEASE;
}
// If masked pretend to look like Mozilla 5.0 but still identify ourselves.
- if ($mask) {
- return 'Mozilla/5.0 '. $this->PRODUCT .'/'. $this->RELEASE . '.'.$this->DEV_LEVEL . ($component ? ' '. $component : '');
+ if ($mask)
+ {
+ return 'Mozilla/5.0 ' . $this->PRODUCT . '/' . $this->RELEASE . '.' . $this->DEV_LEVEL . ($component ? ' ' . $component : '');
}
- else {
- return $this->PRODUCT .'/'. $this->RELEASE . '.'.$this->DEV_LEVEL . ($component ? ' '. $component : '');
+ else
+ {
+ return $this->PRODUCT . '/' . $this->RELEASE . '.' . $this->DEV_LEVEL . ($component ? ' ' . $component : '');
}
}
}
_______________________________________________
Joomla-commits mailing list
Joomla-...@joomlacode.org
http://joomlacode.org/mailman/listinfo/joomla-commits