From c1aadd2a21c867e02682777ea6c7fd7ae88f6148 Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Wed, 22 Apr 2009 15:53:00 +0000 Subject: [PATCH] - Patch #440920 by brianV: whitespace and coding style clean-up. --- modules/path/path.admin.inc | 6 +++--- modules/path/path.module | 6 +++--- modules/path/path.test | 5 +++++ 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/modules/path/path.admin.inc b/modules/path/path.admin.inc index 369df528b39..20999cc92c6 100644 --- a/modules/path/path.admin.inc +++ b/modules/path/path.admin.inc @@ -15,14 +15,14 @@ function path_admin_overview($keys = NULL) { // Add the filter form above the overview table. $output = drupal_get_form('path_admin_filter_form', $keys); // Enable language column if locale is enabled or if we have any alias with language - $count = db_result(db_query("SELECT COUNT(*) FROM {url_alias} WHERE language != ''")); + $count = db_result(db_query("SELECT COUNT(*) FROM {url_alias} WHERE language <> ''")); $multilanguage = (module_exists('locale') || $count); if ($keys) { // Replace wildcards with PDO wildcards. $keys = preg_replace('!\*+!', '%', $keys); $sql = "SELECT * FROM {url_alias} WHERE dst LIKE :keys"; - $args = array(':keys' => '%'. $keys .'%'); + $args = array(':keys' => '%' . $keys . '%'); } else { $sql = 'SELECT * FROM {url_alias}'; @@ -144,7 +144,7 @@ function path_admin_form_validate($form, &$form_state) { // Language is only set if locale module is enabled, otherwise save for all languages. $language = isset($form_state['values']['language']) ? $form_state['values']['language'] : ''; - if (db_result(db_query("SELECT COUNT(dst) FROM {url_alias} WHERE pid != %d AND dst = '%s' AND language = '%s'", $pid, $dst, $language))) { + if (db_result(db_query("SELECT COUNT(dst) FROM {url_alias} WHERE pid <> %d AND dst = '%s' AND language = '%s'", $pid, $dst, $language))) { form_set_error('dst', t('The alias %alias is already in use in this language.', array('%alias' => $dst))); } $item = menu_get_item($src); diff --git a/modules/path/path.module b/modules/path/path.module index 9c813f80996..d7751d42dd5 100644 --- a/modules/path/path.module +++ b/modules/path/path.module @@ -18,8 +18,8 @@ function path_help($path, $arg) { $output .= '
  • ' . t('%alias for the path %path', array('%alias' => 'store', '%path' => 'image/tid/16')) . '
  • '; $output .= '
  • ' . t('%alias for the path %path', array('%alias' => 'store/products/whirlygigs', '%path' => 'taxonomy/term/7+19+20+21')) . '
  • '; $output .= '
  • ' . t('%alias for the path %path', array('%alias' => 'contact', '%path' => 'node/3')) . '
  • '; - $output .= '

    ' . t('The path module enables appropriately permissioned users to specify an optional alias in all node input and editing forms, and provides an interface to view and edit all URL aliases. The two permissions related to URL aliasing are administer url aliases and create url aliases. ') . '

    '; - $output .= '

    ' . t('This module also provides user-defined mass URL aliasing capabilities, which is useful if you wish to uniformly use URLs different from the default. For example, you may want to have your URLs presented in a different language. Access to the Drupal source code on the web server is required to set up mass URL aliasing. ') . '

    '; + $output .= '

    ' . t('The path module enables appropriately permissioned users to specify an optional alias in all node input and editing forms, and provides an interface to view and edit all URL aliases. The two permissions related to URL aliasing are administer url aliases and create url aliases.') . '

    '; + $output .= '

    ' . t('This module also provides user-defined mass URL aliasing capabilities, which is useful if you wish to uniformly use URLs different from the default. For example, you may want to have your URLs presented in a different language. Access to the Drupal source code on the web server is required to set up mass URL aliasing.') . '

    '; $output .= '

    ' . t('For more information, see the online handbook entry for Path module.', array('@path' => 'http://drupal.org/handbook/modules/path/')) . '

    '; return $output; case 'admin/build/path': @@ -125,7 +125,7 @@ function path_node_validate($node, $form) { if (isset($node->path)) { $language = isset($node->language) ? $node->language : ''; $node->path = trim($node->path); - if (db_result(db_query("SELECT COUNT(dst) FROM {url_alias} WHERE dst = '%s' AND src != '%s' AND language = '%s'", $node->path, "node/$node->nid", $language))) { + if (db_result(db_query("SELECT COUNT(dst) FROM {url_alias} WHERE dst = '%s' AND src <> '%s' AND language = '%s'", $node->path, "node/$node->nid", $language))) { form_set_error('path', t('The path is already in use.')); } } diff --git a/modules/path/path.test b/modules/path/path.test index 13b46313e06..d781316d134 100644 --- a/modules/path/path.test +++ b/modules/path/path.test @@ -1,6 +1,11 @@