Skip to content

Commit

Permalink
Code style cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Babker committed Apr 8, 2013
1 parent b0d9b0d commit 83cfff0
Show file tree
Hide file tree
Showing 13 changed files with 27 additions and 30 deletions.
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -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-' $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>'; . $icon.'"></i></a>';
} }
else else
{ {
$html = '<a class="btn btn-micro hasTooltip disabled' . ($value == 1 ? ' active' : '') . '" title="'.JText::_($state[2]).'"><i class="icon-' $html = '<a class="btn btn-micro hasTooltip disabled' . ($value == 1 ? ' active' : '') . '" title="'.JText::_($state[2]).'"><i class="icon-'
. $icon.'"></i></a>'; . $icon.'"></i></a>';
Expand Down
1 change: 0 additions & 1 deletion administrator/components/com_users/helpers/users.php
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -151,7 +151,6 @@ public static function getGroups()
->order('a.lft ASC'); ->order('a.lft ASC');
$db->setQuery($query); $db->setQuery($query);



try try
{ {
$options = $db->loadObjectList(); $options = $db->loadObjectList();
Expand Down
2 changes: 1 addition & 1 deletion components/com_contact/models/category.php
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ protected function getListQuery()
$case_when1 .= ' ELSE '; $case_when1 .= ' ELSE ';
$case_when1 .= $c_id . ' END as catslug'; $case_when1 .= $c_id . ' END as catslug';
$query->select($this->getState('list.select', 'a.*') . ',' . $case_when . ',' . $case_when1) $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(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 '); // . ' 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') ->from($db->quoteName('#__contact_details') . ' AS a')
Expand Down
6 changes: 2 additions & 4 deletions components/com_contact/router.php
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
/** /**
* Build the route for the com_contact component * 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. * @return array The URL arguments to use to assemble the subsequent URL.
*/ */
Expand Down Expand Up @@ -47,7 +47,6 @@ function ContactBuildRoute(&$query)
} }
unset($query['view']); unset($query['view']);
} }
;


// are we dealing with a contact that is attached to a menu item? // 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'])) if (isset($view) && ($mView == $view) and (isset($query['id'])) and ($mId == (int) $query['id']))
Expand Down Expand Up @@ -128,15 +127,14 @@ function ContactBuildRoute(&$query)
} }
} }
} }
;


return $segments; return $segments;
} }


/** /**
* Parse the segments of a URL. * 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. * @return array The URL attributes to be used by the application.
*/ */
Expand Down
4 changes: 2 additions & 2 deletions components/com_tags/models/tag.php
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -221,15 +221,15 @@ protected function populateState($ordering = 'c.core_title', $direction = 'ASC')


$itemid = $pkString . ':' . $app->input->get('Itemid', 0, 'int'); $itemid = $pkString . ':' . $app->input->get('Itemid', 0, 'int');
$orderCol = $app->getUserStateFromRequest('com_tags.tag.list.' . $itemid . '.filter_order', 'filter_order', '', 'string'); $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)) if (!in_array($orderCol, $this->filter_fields))
{ {
$orderCol = 'c.core_title'; $orderCol = 'c.core_title';
} }
$this->setState('list.ordering', $orderCol); $this->setState('list.ordering', $orderCol);


$listOrder = $app->getUserStateFromRequest('com_tags.tag.list.' . $itemid . '.filter_order_direction', 'filter_order_Dir', '', 'string'); $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', ''))) if (!in_array(strtoupper($listOrder), array('ASC', 'DESC', '')))
{ {
$listOrder = 'ASC'; $listOrder = 'ASC';
Expand Down
8 changes: 4 additions & 4 deletions installation/model/database.php
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -710,10 +710,10 @@ public function backupDatabase($db, $prefix)
/** /**
* Method to create a new database. * Method to create a new database.
* *
* @param JDatabaseDriver $db JDatabase object. * @param JDatabaseDriver $db JDatabase object.
* @param JObject $options JObject coming from "initialise" function to pass user * @param JObject $options JObject coming from "initialise" function to pass user
* and database name to database driver. * and database name to database driver.
* @param boolean $utf True if the database supports the UTF-8 character set. * @param boolean $utf True if the database supports the UTF-8 character set.
* *
* @return boolean True on success. * @return boolean True on success.
* *
Expand Down
7 changes: 3 additions & 4 deletions libraries/cms/helper/tags.php
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -57,8 +57,6 @@ public function tagItem($id, $prefix, $isNew, $item, $tags = array(), $fieldMap
} }
} }




// We will use the tags table to store them // We will use the tags table to store them
JTable::addIncludePath(JPATH_ADMINISTRATOR . '/components/com_tags/tables'); JTable::addIncludePath(JPATH_ADMINISTRATOR . '/components/com_tags/tables');
$tagTable = JTable::getInstance('Tag', 'TagsTable'); $tagTable = JTable::getInstance('Tag', 'TagsTable');
Expand Down Expand Up @@ -287,6 +285,7 @@ public function tagItems($tag, $ids, $contexts, $replace)
{ {
// Method is not ready for use // Method is not ready for use
return; return;

// Check whether the tag is present already. // Check whether the tag is present already.
$db = JFactory::getDbo(); $db = JFactory::getDbo();
$query = $db->getQuery(true) $query = $db->getQuery(true)
Expand Down Expand Up @@ -457,8 +456,8 @@ public function getItemTags($contentType, $id, $getTagData = true)
* @since 3.1 * @since 3.1
*/ */
public function getTagItemsQuery($tagId, $typesr = null, $includeChildren = false, $orderByOption = 'title', $orderDir = 'ASC', 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. // Create a new query object.
$db = JFactory::getDbo(); $db = JFactory::getDbo();
$query = $db->getQuery(true); $query = $db->getQuery(true);
Expand Down
1 change: 1 addition & 0 deletions libraries/cms/installer/adapter/template.php
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -580,6 +580,7 @@ public function discover_install()
if ($this->parent->extension->store()) if ($this->parent->extension->store())
{ {
$db = $this->parent->getDbo(); $db = $this->parent->getDbo();

// Insert record in #__template_styles // Insert record in #__template_styles
$lang = JFactory::getLanguage(); $lang = JFactory::getLanguage();
$debug = $lang->setDebug(false); $debug = $lang->setDebug(false);
Expand Down
6 changes: 2 additions & 4 deletions libraries/cms/table/corecontent.php
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -188,10 +188,8 @@ public function store($updateNulls = false)
} }
// Verify that the alias is unique // Verify that the alias is unique
$table = JTable::getInstance('Corecontent', 'JTable'); $table = JTable::getInstance('Corecontent', 'JTable');
if ( if ($table->load(array('core_alias' => $this->core_alias, 'core_catid' => $this->core_catid))
$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))
&& ($table->core_content_id != $this->core_content_id || $this->core_content_id == 0)
)
{ {
$this->setError(JText::_('JLIB_DATABASE_ERROR_ARTICLE_UNIQUE_ALIAS')); $this->setError(JText::_('JLIB_DATABASE_ERROR_ARTICLE_UNIQUE_ALIAS'));
return false; return false;
Expand Down
2 changes: 1 addition & 1 deletion libraries/joomla/database/driver.php
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -1466,7 +1466,7 @@ protected function quoteNameStr($strArr)
* This function replaces a string identifier <var>$prefix</var> with the string held is the * This function replaces a string identifier <var>$prefix</var> with the string held is the
* <var>tablePrefix</var> class variable. * <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. * @param string $prefix The common table prefix.
* *
* @return string The processed SQL statement. * @return string The processed SQL statement.
Expand Down
2 changes: 1 addition & 1 deletion libraries/joomla/date/date.php
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -416,7 +416,7 @@ public function toISO8601($local = false)
* Gets the date as an SQL datetime string. * 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 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. * @return string The date string in SQL datetime format.
* *
Expand Down
2 changes: 1 addition & 1 deletion libraries/joomla/filter/input.php
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ public function clean($source, $type = 'string')
case 'USERNAME': case 'USERNAME':
$result = (string) preg_replace('/[\x00-\x1F\x7F<>"\'%&]/', '', $source); $result = (string) preg_replace('/[\x00-\x1F\x7F<>"\'%&]/', '', $source);
break; break;

case 'RAW': case 'RAW':
$result = $source; $result = $source;
break; break;
Expand Down
14 changes: 8 additions & 6 deletions modules/mod_tags_popular/helper.php
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -27,12 +27,14 @@ public static function getList($params)
$maximum = $params->get('maximum', 5); $maximum = $params->get('maximum', 5);


$query = $db->getQuery(true) $query = $db->getQuery(true)
->select(array( ->select(
'MAX(' . $db->quoteName('tag_id') . ') AS tag_id', array(
' COUNT(*) AS count', 'MAX(t.title) AS title', 'MAX(' . $db->quoteName('tag_id') . ') AS tag_id',
'MAX(' .$db->quoteName('t.access') . ') AS access', ' COUNT(*) AS count', 'MAX(t.title) AS title',
'MAX(' .$db->quoteName('t.alias') . ') AS alias' 'MAX(' .$db->quoteName('t.access') . ') AS access',
)) 'MAX(' .$db->quoteName('t.alias') . ') AS alias'
)
)
->group($db->quoteName(array('tag_id', 'title', 'access', 'alias'))) ->group($db->quoteName(array('tag_id', 'title', 'access', 'alias')))
->from($db->quoteName('#__contentitem_tag_map')) ->from($db->quoteName('#__contentitem_tag_map'))
->where($db->quoteName('t.access') . ' IN (' . $groups . ')'); ->where($db->quoteName('t.access') . ' IN (' . $groups . ')');
Expand Down

0 comments on commit 83cfff0

Please sign in to comment.