Commit 2c09e163 authored by profix898's avatar profix898

- task: Make coder module happy and fix several coding style issues

parent dafc0eb8
......@@ -177,8 +177,8 @@ function _gallery_init($full = FALSE, $vars = NULL, $report_error = TRUE) {
// Session handling
$g2_session =& $GLOBALS['gallery']->getSession();
$g2_session->doNotUseTempId();
$g2_session->doNotUseTempId();
$ready['half'] = $params['fullInit'] ? ($ready['full'] = TRUE) : TRUE;
return TRUE;
......@@ -455,11 +455,11 @@ function gallery_db_query($query, $data = NULL) {
}
// Perform query
list ($ret, $search) = $GLOBALS['gallery']->search($query, $data);
if ($ret) {
if ($ret) {
return FALSE;
}
$results = array();
while ($result = $search->nextResult()) {
}
$results = array();
while ($result = $search->nextResult()) {
$results += $result;
}
......@@ -585,7 +585,7 @@ function gallery_context(&$params, $setcontext = FALSE) {
if (isset($params)) {
// Return requested context parameters
$params = is_array($params) ? $params : array($params);
foreach($params as $param) {
foreach ($params as $param) {
if (!isset($context_cache[$param])) {
return FALSE;
}
......
......@@ -246,7 +246,8 @@ function _gallery_block_split_imageblock($html) {
if (!strncmp($value, $imageblock_class, strlen($imageblock_class))) {
// Found the opening <div> for the image block (G2.3). We want to remove this.
$found_image_block_class = TRUE;
} else {
}
else {
$image_html .= $value;
}
if (!strcmp($value, '<div class="one-image">')) {
......
......@@ -110,7 +110,7 @@ function _gallery_block_admin_block($delta) {
* Function _gallery_block_admin_description().
*/
function _gallery_block_admin_description($element) {
switch($element) {
switch ($element) {
case 'imageblock_cache':
return t('Configure cache settings for this block. Unless random images are used you can safely keep this to
\'Cache per user and page\'. If you dont have per-user permissions configured in your gallery you
......
......@@ -204,7 +204,8 @@ function _gallery_g2image_settings_validate($form, &$form_state) {
$mode = t('TinyMCE');
if (module_exists('tinymce')) {
$path = drupal_get_path('module', 'tinymce');
} else if (module_exists('wysiwyg')) {
}
else if (module_exists('wysiwyg')) {
$path = drupal_get_path('module', 'wysiwyg');
}
$path .= '/tinymce/jscripts/tiny_mce/plugins/g2image';
......@@ -317,7 +318,8 @@ function _gallery_g2image_path($path = NULL) {
if (!file_exists($path .'/config.php') && !file_check_directory($path)) {
$path = NULL;
}
} else if (module_exists('wysiwyg')) {
}
else if (module_exists('wysiwyg')) {
// WYSIWYG folder for G2Image plugin
$path = drupal_get_path('module', 'wysiwyg');
$path .= '/tinymce/jscripts/tiny_mce/plugins/g2image';
......
......@@ -494,7 +494,7 @@ function _gallery_user_import($g2_users, &$messages) {
continue;
}
}
else if ($new_user && db_result(db_query("SELECT COUNT(uid) FROM {users} WHERE uid != 0 AND LOWER(mail) = LOWER('%s')", $values['mail'])) > 0) {
else if ($new_user && db_result(db_query("SELECT COUNT(uid) FROM {users} WHERE uid <> 0 AND LOWER(mail) = LOWER('%s')", $values['mail'])) > 0) {
$error = TRUE;
if ($resolve_conflict[GALLERY_IMPORT_CONFLICT_DUPLICATE]) {
_gallery_user_resolve_mail($values['mail'], $values['name'], $messages);
......@@ -586,7 +586,7 @@ function _gallery_user_resolve_mail(&$mail, $username, &$messages) {
$i = 0;
do {
$newmail = $user . (($i > 0) ? ('_'. $i) : '') .'@'. $_SERVER['HTTP_HOST'];
$error = (db_result(db_query("SELECT COUNT(uid) FROM {users} WHERE uid != 0 AND LOWER(mail) = LOWER('%s')", $newmail)) > 0);
$error = (db_result(db_query("SELECT COUNT(uid) FROM {users} WHERE uid <> 0 AND LOWER(mail) = LOWER('%s')", $newmail)) > 0);
} while ($error && $i++ < 10);
// Do we have a new mail address?
if (!$error) {
......
......@@ -24,7 +24,7 @@ function _gallery_user_users() {
array('data' => t('Sync Status')),
t('Operations')
);
$query = 'SELECT u.uid, u.name, u.status FROM {users} u WHERE uid != 0';
$query = 'SELECT u.uid, u.name, u.status FROM {users} u WHERE uid <> 0';
$status = array(t('blocked'), t('active'));
$destination = drupal_get_destination();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment