Permalink
Browse files

code cleanup according to drupal coding guidelines.

  • Loading branch information...
1 parent 81b67e7 commit decee79ec32905a46fd49a6a2a9799f03bbd769e @dawitti dawitti committed Mar 13, 2012
Showing with 23 additions and 18 deletions.
  1. +3 −3 noticeme.admin.inc
  2. +4 −0 noticeme.install
  3. +10 −9 noticeme.module
  4. +6 −6 noticeme.theme.inc
View
@@ -14,7 +14,7 @@ function noticeme_admin_settings($form, &$form_state) {
'og_type' => variable_get('noticeme_og_type', ''),
'schema_type' => variable_get('noticeme_schema_type', ''),
'description' => variable_get('noticeme_description', ''),
- 'image' => variable_get('noticeme_image',''),
+ 'image' => variable_get('noticeme_image', ''),
);
$form['metadata'] = array(
@@ -106,8 +106,8 @@ function noticeme_admin_settings_validate(&$form, &$form_state) {
// For some reason the method form_state_values_clean() in include/form.inc
// throws an error while trying to clean the image upload and remove buttons.
// So we unset them here to prevent that error.
- foreach($form_state['buttons'] AS $index => $btn) {
- if($btn['#name'] == 'image_upload_button' || $btn['#name'] == 'image_remove_button') {
+ foreach ($form_state['buttons'] AS $index => $btn) {
+ if ($btn['#name'] == 'image_upload_button' || $btn['#name'] == 'image_remove_button') {
unset($form_state['buttons'][$index]);
}
}
View
@@ -1,4 +1,8 @@
<?php
+/**
+ * @file
+ * Schema and (un)install hooks.
+ */
/**
* Implements hook_field_schema().
View
@@ -6,9 +6,9 @@
* to the html header.
*/
-$path = DRUPAL_ROOT.'/'.drupal_get_path('module','noticeme');
-require_once($path.'/noticeme.field.inc');
-require_once($path.'/noticeme.forms.inc');
+$path = DRUPAL_ROOT . '/' . drupal_get_path('module', 'noticeme');
+require_once($path . '/noticeme.field.inc');
+require_once($path . '/noticeme.forms.inc');
/**
* Implements hook_init().
@@ -98,7 +98,7 @@ function noticeme_block_info() {
* Implements hook_block_view().
*/
function noticeme_block_view($delta = '') {
- switch($delta) {
+ switch ($delta) {
case 'noticeme_global':
return array(
'subject' => NULL,
@@ -112,7 +112,7 @@ function noticeme_block_view($delta = '') {
* Implements hook_block_configure().
*/
function noticeme_block_configure($delta = '') {
- switch($delta) {
+ switch ($delta) {
case 'noticeme_global':
$values = array(
'facebook_display' => variable_get('noticeme_global_block_fb_display', 'standard'),
@@ -135,7 +135,7 @@ function noticeme_block_configure($delta = '') {
* Implements hook_block_save().
*/
function noticeme_block_save($delta = '', $edit = array()) {
- switch($delta) {
+ switch ($delta) {
case 'noticeme_global':
$values = array(
variable_set('noticeme_global_block_fb_display', $edit['facebook_display']),
@@ -149,6 +149,7 @@ function noticeme_block_save($delta = '', $edit = array()) {
variable_set('noticeme_global_block_twitter_display', $edit['twitter_display']),
variable_set('noticeme_global_block_twitter_display_count', $edit['twitter_display_count']),
);
+ break;
default:
}
}
@@ -262,16 +263,16 @@ function noticeme_site_metadata() {
$metadata['schema_type'] = variable_get('noticeme_schema_type', FALSE);
$metadata['image'] = variable_get('noticeme_image', FALSE);
- if(strlen($metadata['image']) < 1) {
+ if (strlen($metadata['image']) < 1) {
// Default to a logo image if there is one.
$logo_url = theme_get_setting('logo_path');
- if(strlen($logo_url) > 0) {
+ if (strlen($logo_url) > 0) {
$metadata['image'] = file_create_url($logo_url);
}
}
else {
$image = file_load($metadata['image']);
- if($image) {
+ if ($image) {
$metadata['image'] = file_create_url($image->uri);
}
}
View
@@ -9,19 +9,19 @@
*/
function theme_global_share_buttons_block($variables) {
$element = array();
- if($variables['facebook_like']) {
+ if ($variables['facebook_like']) {
$element['facebook_like'] = array(
- '#markup' => theme('facebook_like',$variables['facebook_like']),
+ '#markup' => theme('facebook_like', $variables['facebook_like']),
);
}
- if($variables['google_plus_one']) {
+ if ($variables['google_plus_one']) {
$element['google_plus_one'] = array(
- '#markup' => theme('google_plus',$variables['google_plus_one']),
+ '#markup' => theme('google_plus', $variables['google_plus_one']),
);
}
- if($variables['twitter_tweet']) {
+ if ($variables['twitter_tweet']) {
$element['twitter_tweet'] = array(
- '#markup' => theme('twitter_tweet',$variables['twitter_tweet']),
+ '#markup' => theme('twitter_tweet', $variables['twitter_tweet']),
);
}
return render($element);

0 comments on commit decee79

Please sign in to comment.