Permalink
Browse files

Code style cleanup

  • Loading branch information...
1 parent b0d9b0d commit 83cfff0e5ed2ec0195dbe0cada78063a86c96d48 @mbabker mbabker committed Apr 8, 2013
@@ -108,7 +108,7 @@ public static function featured($value = 0, $i, $canChange = true)
$html = '<a href="#" onclick="return listItemTask(\'cb'.$i.'\',\''.$state[1].'\')" class="btn btn-micro hasTooltip' . ($value == 1 ? ' active' : '') . '" title="'.JText::_($state[3]).'"><i class="icon-'
. $icon.'"></i></a>';
}
- else
+ else
{
$html = '<a class="btn btn-micro hasTooltip disabled' . ($value == 1 ? ' active' : '') . '" title="'.JText::_($state[2]).'"><i class="icon-'
. $icon.'"></i></a>';
@@ -151,7 +151,6 @@ public static function getGroups()
->order('a.lft ASC');
$db->setQuery($query);
-
try
{
$options = $db->loadObjectList();
@@ -134,7 +134,7 @@ protected function getListQuery()
$case_when1 .= ' ELSE ';
$case_when1 .= $c_id . ' END as catslug';
$query->select($this->getState('list.select', 'a.*') . ',' . $case_when . ',' . $case_when1)
- // TODO: we actually should be doing it but it's wrong this way
+ // TODO: we actually should be doing it but it's wrong this way
// . ' CASE WHEN CHAR_LENGTH(a.alias) THEN CONCAT_WS(\':\', a.id, a.alias) ELSE a.id END as slug, '
// . ' CASE WHEN CHAR_LENGTH(c.alias) THEN CONCAT_WS(\':\', c.id, c.alias) ELSE c.id END AS catslug ');
->from($db->quoteName('#__contact_details') . ' AS a')
@@ -12,7 +12,7 @@
/**
* Build the route for the com_contact component
*
- * @return array An array of URL arguments
+ * @param array &$query An array of URL arguments
*
* @return array The URL arguments to use to assemble the subsequent URL.
*/
@@ -47,7 +47,6 @@ function ContactBuildRoute(&$query)
}
unset($query['view']);
}
- ;
// are we dealing with a contact that is attached to a menu item?
if (isset($view) && ($mView == $view) and (isset($query['id'])) and ($mId == (int) $query['id']))
@@ -128,15 +127,14 @@ function ContactBuildRoute(&$query)
}
}
}
- ;
return $segments;
}
/**
* Parse the segments of a URL.
*
- * @return array The segments of the URL to parse.
+ * @param array $segments The segments of the URL to parse.
*
* @return array The URL attributes to be used by the application.
*/
@@ -221,15 +221,15 @@ protected function populateState($ordering = 'c.core_title', $direction = 'ASC')
$itemid = $pkString . ':' . $app->input->get('Itemid', 0, 'int');
$orderCol = $app->getUserStateFromRequest('com_tags.tag.list.' . $itemid . '.filter_order', 'filter_order', '', 'string');
- $orderCol = !$orderCol ? $this->state->params->get('tag_list_orderby','c.core_title') : $orderCol;
+ $orderCol = !$orderCol ? $this->state->params->get('tag_list_orderby', 'c.core_title') : $orderCol;
if (!in_array($orderCol, $this->filter_fields))
{
$orderCol = 'c.core_title';
}
$this->setState('list.ordering', $orderCol);
$listOrder = $app->getUserStateFromRequest('com_tags.tag.list.' . $itemid . '.filter_order_direction', 'filter_order_Dir', '', 'string');
- $listOrder = !$listOrder ? $this->state->params->get('tag_list_orderby_direction','ASC') : $listOrder;
+ $listOrder = !$listOrder ? $this->state->params->get('tag_list_orderby_direction', 'ASC') : $listOrder;
if (!in_array(strtoupper($listOrder), array('ASC', 'DESC', '')))
{
$listOrder = 'ASC';
@@ -710,10 +710,10 @@ public function backupDatabase($db, $prefix)
/**
* Method to create a new database.
*
- * @param JDatabaseDriver $db JDatabase object.
- * @param JObject $options JObject coming from "initialise" function to pass user
- * and database name to database driver.
- * @param boolean $utf True if the database supports the UTF-8 character set.
+ * @param JDatabaseDriver $db JDatabase object.
+ * @param JObject $options JObject coming from "initialise" function to pass user
+ * and database name to database driver.
+ * @param boolean $utf True if the database supports the UTF-8 character set.
*
* @return boolean True on success.
*
@@ -57,8 +57,6 @@ public function tagItem($id, $prefix, $isNew, $item, $tags = array(), $fieldMap
}
}
-
-
// We will use the tags table to store them
JTable::addIncludePath(JPATH_ADMINISTRATOR . '/components/com_tags/tables');
$tagTable = JTable::getInstance('Tag', 'TagsTable');
@@ -287,6 +285,7 @@ public function tagItems($tag, $ids, $contexts, $replace)
{
// Method is not ready for use
return;
+
// Check whether the tag is present already.
$db = JFactory::getDbo();
$query = $db->getQuery(true)
@@ -457,8 +456,8 @@ public function getItemTags($contentType, $id, $getTagData = true)
* @since 3.1
*/
public function getTagItemsQuery($tagId, $typesr = null, $includeChildren = false, $orderByOption = 'title', $orderDir = 'ASC',
- $anyOrAll = true, $languageFilter = 'all', $stateFilter = '0,1'
- ) {
+ $anyOrAll = true, $languageFilter = 'all', $stateFilter = '0,1')
+ {
// Create a new query object.
$db = JFactory::getDbo();
$query = $db->getQuery(true);
@@ -580,6 +580,7 @@ public function discover_install()
if ($this->parent->extension->store())
{
$db = $this->parent->getDbo();
+
// Insert record in #__template_styles
$lang = JFactory::getLanguage();
$debug = $lang->setDebug(false);
@@ -188,10 +188,8 @@ public function store($updateNulls = false)
}
// Verify that the alias is unique
$table = JTable::getInstance('Corecontent', 'JTable');
- if (
- $table->load(array('core_alias' => $this->core_alias, 'core_catid' => $this->core_catid))
- && ($table->core_content_id != $this->core_content_id || $this->core_content_id == 0)
- )
+ if ($table->load(array('core_alias' => $this->core_alias, 'core_catid' => $this->core_catid))
+ && ($table->core_content_id != $this->core_content_id || $this->core_content_id == 0))
{
$this->setError(JText::_('JLIB_DATABASE_ERROR_ARTICLE_UNIQUE_ALIAS'));
return false;
@@ -1466,7 +1466,7 @@ protected function quoteNameStr($strArr)
* This function replaces a string identifier <var>$prefix</var> with the string held is the
* <var>tablePrefix</var> class variable.
*
- * @param string $query The SQL statement to prepare.
+ * @param string $query The SQL statement to prepare.
* @param string $prefix The common table prefix.
*
* @return string The processed SQL statement.
@@ -416,7 +416,7 @@ public function toISO8601($local = false)
* Gets the date as an SQL datetime string.
*
* @param boolean $local True to return the date string in the local time zone, false to return it in GMT.
- * @param JDatabaseDriver $db The database driver or null to use JFactory::getDbo()
+ * @param JDatabaseDriver $db The database driver or null to use JFactory::getDbo()
*
* @return string The date string in SQL datetime format.
*
@@ -227,7 +227,7 @@ public function clean($source, $type = 'string')
case 'USERNAME':
$result = (string) preg_replace('/[\x00-\x1F\x7F<>"\'%&]/', '', $source);
break;
-
+
case 'RAW':
$result = $source;
break;
@@ -27,12 +27,14 @@ public static function getList($params)
$maximum = $params->get('maximum', 5);
$query = $db->getQuery(true)
- ->select(array(
- 'MAX(' . $db->quoteName('tag_id') . ') AS tag_id',
- ' COUNT(*) AS count', 'MAX(t.title) AS title',
- 'MAX(' .$db->quoteName('t.access') . ') AS access',
- 'MAX(' .$db->quoteName('t.alias') . ') AS alias'
- ))
+ ->select(
+ array(
+ 'MAX(' . $db->quoteName('tag_id') . ') AS tag_id',
+ ' COUNT(*) AS count', 'MAX(t.title) AS title',
+ 'MAX(' .$db->quoteName('t.access') . ') AS access',
+ 'MAX(' .$db->quoteName('t.alias') . ') AS alias'
+ )
+ )
->group($db->quoteName(array('tag_id', 'title', 'access', 'alias')))
->from($db->quoteName('#__contentitem_tag_map'))
->where($db->quoteName('t.access') . ' IN (' . $groups . ')');

0 comments on commit 83cfff0

Please sign in to comment.