summaryrefslogtreecommitdiff
path: root/modules/taxonomy
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2009-05-24 17:39:35 +0000
committerDries Buytaert <dries@buytaert.net>2009-05-24 17:39:35 +0000
commita24a6c2bba2d15ab835e0b0fce9354bb6fb16c5b (patch)
tree9194465a044c0fdad447eba2906f0472a4dff515 /modules/taxonomy
parenta5f42fd007bf3646261b431c52cde53657e21564 (diff)
downloadbrdo-a24a6c2bba2d15ab835e0b0fce9354bb6fb16c5b.tar.gz
brdo-a24a6c2bba2d15ab835e0b0fce9354bb6fb16c5b.tar.bz2
- Patch #471070 by stella: millions of code style fixes.
Diffstat (limited to 'modules/taxonomy')
-rw-r--r--modules/taxonomy/taxonomy.admin.inc2
-rw-r--r--modules/taxonomy/taxonomy.module24
-rw-r--r--modules/taxonomy/taxonomy.pages.inc4
-rw-r--r--modules/taxonomy/taxonomy.test20
4 files changed, 25 insertions, 25 deletions
diff --git a/modules/taxonomy/taxonomy.admin.inc b/modules/taxonomy/taxonomy.admin.inc
index b71db8301..319d80173 100644
--- a/modules/taxonomy/taxonomy.admin.inc
+++ b/modules/taxonomy/taxonomy.admin.inc
@@ -64,7 +64,7 @@ function taxonomy_overview_vocabularies_submit($form, &$form_state) {
*/
function theme_taxonomy_overview_vocabularies($form) {
$rows = array();
-
+
foreach (element_children($form) as $key) {
if (isset($form[$key]['name'])) {
$vocabulary = &$form[$key];
diff --git a/modules/taxonomy/taxonomy.module b/modules/taxonomy/taxonomy.module
index 4c1ab559a..d1854f849 100644
--- a/modules/taxonomy/taxonomy.module
+++ b/modules/taxonomy/taxonomy.module
@@ -85,7 +85,7 @@ function taxonomy_node_view($node) {
}
}
}
-
+
$node->content['links']['terms'] = array(
'#type' => 'node_links',
'#value' => $links,
@@ -361,7 +361,7 @@ function taxonomy_term_save($term) {
$status = drupal_write_record('taxonomy_term_data', $term);
module_invoke_all('taxonomy_term_update', $term);
}
-
+
db_delete('taxonomy_term_relation')
->condition(db_or()
->condition('tid1', $term->tid)
@@ -409,10 +409,10 @@ function taxonomy_term_save($term) {
}
}
else {
- $query->values(array(
- 'tid' => $term->tid,
- 'parent' => $parent
- ));
+ $query->values(array(
+ 'tid' => $term->tid,
+ 'parent' => $parent
+ ));
}
$query->execute();
@@ -492,7 +492,7 @@ function taxonomy_term_delete($tid) {
cache_clear_all();
taxonomy_terms_static_reset();
-
+
return SAVED_DELETED;
}
@@ -826,7 +826,7 @@ function taxonomy_node_save($node, $terms) {
if (is_array($terms) && !empty($terms)) {
$query = db_insert('taxonomy_term_node')
->fields(array('nid', 'vid', 'tid'));
-
+
foreach ($terms as $term) {
if (is_array($term)) {
foreach ($term as $tid) {
@@ -1406,7 +1406,7 @@ function taxonomy_term_load($tid) {
* A term object. Results are statically cached.
*/
function taxonomy_get_term_data($tid) {
- $terms = &drupal_static(__FUNCTION__, array());
+ $terms = &drupal_static(__FUNCTION__, array());
if (!isset($terms[$tid])) {
$terms[$tid] = db_query('SELECT * FROM {taxonomy_term_data} WHERE tid = :tid', array(':tid' => $tid))->fetch();
@@ -1494,7 +1494,7 @@ function theme_taxonomy_term_select($element) {
* Whether the nodes are to be used with a pager (the case on most Drupal
* pages) or not (in an XML feed, for example).
* @param $order
- * The order clause for the query that retrieve the nodes.
+ * The order clause for the query that retrieve the nodes.
* It is important to specifc the table alias (n).
*
* Example:
@@ -1532,7 +1532,7 @@ function taxonomy_select_nodes($tids = array(), $operator = 'or', $depth = 0, $p
$query->condition($alias . '.tid', $tids, 'IN');
}
}
-
+
if ($pager) {
$count_query = clone $query;
$count_query->addExpression('COUNT(DISTINCT n.nid)');
@@ -1540,7 +1540,7 @@ function taxonomy_select_nodes($tids = array(), $operator = 'or', $depth = 0, $p
$query = $query
->extend('PagerDefault')
->limit(variable_get('default_nodes_main', 10));
- $query->setCountQuery($count_query);
+ $query->setCountQuery($count_query);
}
else {
$query->range(0, variable_get('feed_default_items', 10));
diff --git a/modules/taxonomy/taxonomy.pages.inc b/modules/taxonomy/taxonomy.pages.inc
index 2454c5195..1e77f40ab 100644
--- a/modules/taxonomy/taxonomy.pages.inc
+++ b/modules/taxonomy/taxonomy.pages.inc
@@ -134,11 +134,11 @@ function taxonomy_autocomplete($vid, $string = '') {
$tags = $query
->fields('t', array('tid', 'name'))
->condition('t.vid', $vid)
- ->where("LOWER(t.name) LIKE LOWER(:last_string)", array(':last_string' => '%'. $last_string .'%'))
+ ->where("LOWER(t.name) LIKE LOWER(:last_string)", array(':last_string' => '%' . $last_string . '%'))
->range(0, 10)
->execute()
->fetchAllKeyed();
-
+
$prefix = count($array) ? implode(', ', $array) . ', ' : '';
foreach ($tags as $tid => $name) {
diff --git a/modules/taxonomy/taxonomy.test b/modules/taxonomy/taxonomy.test
index 636c7a030..a1ce27127 100644
--- a/modules/taxonomy/taxonomy.test
+++ b/modules/taxonomy/taxonomy.test
@@ -104,7 +104,7 @@ class TaxonomyVocabularyFunctionalTest extends TaxonomyWebTestCase {
foreach ($vocabularies as $key => $vocabulary) {
$vocabulary->weight = -$vocabulary->weight;
$vocabularies[$key]->weight = $vocabulary->weight;
- $edit[$key .'[weight]'] = $vocabulary->weight;
+ $edit[$key . '[weight]'] = $vocabulary->weight;
}
// Saving the new weights via the interface.
$this->drupalPost('admin/content/taxonomy/', $edit, t('Save'));
@@ -157,7 +157,7 @@ class TaxonomyVocabularyFunctionalTest extends TaxonomyWebTestCase {
// Delete the vocabulary.
$edit = array();
- $this->drupalPost('admin/content/taxonomy/' .$vid, $edit, t('Delete'));
+ $this->drupalPost('admin/content/taxonomy/' . $vid, $edit, t('Delete'));
$this->assertRaw(t('Are you sure you want to delete the vocabulary %name?', array('%name' => $vocabulary->name)), t('[confirm deletion] Asks for confirmation.'));
$this->assertText(t('Deleting a vocabulary will delete all the terms in it. This action cannot be undone.'), t('[confirm deletion] Inform that all terms will be deleted.'));
@@ -175,13 +175,13 @@ class TaxonomyVocabularyFunctionalTest extends TaxonomyWebTestCase {
*/
class TaxonomyVocabularyUnitTest extends TaxonomyWebTestCase {
-public static function getInfo() {
- return array(
- 'name' => t('Taxonomy vocabularies'),
- 'description' => t('Test loading, saving and deleting vocabularies.'),
- 'group' => t('Taxonomy'),
- );
- }
+ public static function getInfo() {
+ return array(
+ 'name' => t('Taxonomy vocabularies'),
+ 'description' => t('Test loading, saving and deleting vocabularies.'),
+ 'group' => t('Taxonomy'),
+ );
+ }
function setUp() {
parent::setUp('taxonomy');
@@ -501,7 +501,7 @@ class TaxonomyTermTestCase extends TaxonomyWebTestCase {
$edit['title'] = $this->randomName();
// Insert the terms in a comma separated list. Vocabulary 1 is a
// free-tagging field created by the default profile.
- $edit['taxonomy[tags][' . $this->vocabulary->vid .']'] = implode(', ', $terms);
+ $edit['taxonomy[tags][' . $this->vocabulary->vid . ']'] = implode(', ', $terms);
$edit['body'] = $this->randomName();
$this->drupalPost('node/add/article', $edit, t('Save'));
$this->assertRaw(t('@type %title has been created.', array('@type' => t('Article'), '%title' => $edit['title'])), t('The node was created successfully'));