summaryrefslogtreecommitdiff
path: root/modules/path
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2009-04-22 15:53:00 +0000
committerDries Buytaert <dries@buytaert.net>2009-04-22 15:53:00 +0000
commitc1aadd2a21c867e02682777ea6c7fd7ae88f6148 (patch)
treedfbcc200c3f005f29e15745cf34d7031d46e8496 /modules/path
parent097f49379858d62546e2ddcb9d89f7c592e51caf (diff)
downloadbrdo-c1aadd2a21c867e02682777ea6c7fd7ae88f6148.tar.gz
brdo-c1aadd2a21c867e02682777ea6c7fd7ae88f6148.tar.bz2
- Patch #440920 by brianV: whitespace and coding style clean-up.
Diffstat (limited to 'modules/path')
-rw-r--r--modules/path/path.admin.inc6
-rw-r--r--modules/path/path.module6
-rw-r--r--modules/path/path.test5
3 files changed, 11 insertions, 6 deletions
diff --git a/modules/path/path.admin.inc b/modules/path/path.admin.inc
index 369df528b..20999cc92 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 9c813f809..d7751d42d 100644
--- a/modules/path/path.module
+++ b/modules/path/path.module
@@ -18,8 +18,8 @@ function path_help($path, $arg) {
$output .= '<li>' . t('%alias for the path %path', array('%alias' => 'store', '%path' => 'image/tid/16')) . '</li>';
$output .= '<li>' . t('%alias for the path %path', array('%alias' => 'store/products/whirlygigs', '%path' => 'taxonomy/term/7+19+20+21')) . '</li>';
$output .= '<li>' . t('%alias for the path %path', array('%alias' => 'contact', '%path' => 'node/3')) . '</li></ul>';
- $output .= '<p>' . 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 <em>administer url aliases</em> and <em>create url aliases</em>. ') . '</p>';
- $output .= '<p>' . 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. ') . '</p>';
+ $output .= '<p>' . 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 <em>administer url aliases</em> and <em>create url aliases</em>.') . ' </p>';
+ $output .= '<p>' . 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.') . ' </p>';
$output .= '<p>' . t('For more information, see the online handbook entry for <a href="@path">Path module</a>.', array('@path' => 'http://drupal.org/handbook/modules/path/')) . '</p>';
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 13b46313e..d781316d1 100644
--- a/modules/path/path.test
+++ b/modules/path/path.test
@@ -1,6 +1,11 @@
<?php
// $Id$
+/**
+ * @file
+ * Tests for the path module
+ */
+
class PathTestCase extends DrupalWebTestCase {
public static function getInfo() {
return array(