diff --git a/README.md b/README.md index 5ebd7a0..e564ce9 100755 --- a/README.md +++ b/README.md @@ -33,7 +33,8 @@ The message_private module requires the following modules: * Message Notify (https://drupal.org/project/message_notify) * Entity API (https://www.drupal.org/project/entity) * Entity Reference (https://www.drupal.org/project/entityreference) - * Entityreference Prepopulate (https://www.drupal.org/project/entityreference_prepopulate) + * Entityreference Prepopulate + (https://www.drupal.org/project/entityreference_prepopulate) * Ctools (https://www.drupal.org/project/ctools) * Views (https://www.drupal.org/project/views) * Token (https://www.drupal.org/project/token diff --git a/message--private_message.tpl.php b/message--private_message.tpl.php index 591dd88..d06d37d 100644 --- a/message--private_message.tpl.php +++ b/message--private_message.tpl.php @@ -5,8 +5,8 @@ * Default theme implementation for private_message message entities. * * Available variables: - * - $content: An array of comment items. Use render($content) to print them all, or - * print a subset such as render($content['field_example']). Use + * - $content: An array of comment items. Use render($content) to print them + * all, or print a subset such as render($content['field_example']). Use * hide($content['field_example']) to temporarily suppress the printing of a * given element. * - $title: The (sanitized) entity label. diff --git a/message_private.admin.inc b/message_private.admin.inc index 49f9d94..62a3171 100644 --- a/message_private.admin.inc +++ b/message_private.admin.inc @@ -29,22 +29,22 @@ function message_private_admin_settings() { // Conditional fieldset for all message limitation settings. $form['interval_limit'] = array( - '#title' => t('Message interval limits'), - '#type' => 'fieldset', - '#collapsible' => TRUE, - '#collapsed' => TRUE, - '#states' => array( - 'invisible' => array( - ':input[name="' . MESSAGE_PRIVATE_MESSAGE_LIMIT . '"]' => array('checked' => FALSE), - ), + '#title' => t('Message interval limits'), + '#type' => 'fieldset', + '#collapsible' => TRUE, + '#collapsed' => TRUE, + '#states' => array( + 'invisible' => array( + ':input[name="' . MESSAGE_PRIVATE_MESSAGE_LIMIT . '"]' => array('checked' => FALSE), ), + ), ); // Add a default fieldset. $form['interval_limit'][MESSAGE_PRIVATE_DEFAULT_INDEX] = array( '#type' => 'fieldset', '#title' => 'Default limit', - '#description' => t('Applies to all roles with blank entries below') + '#description' => t('Applies to all roles with blank entries below'), ); $form['interval_limit'][MESSAGE_PRIVATE_DEFAULT_INDEX][MESSAGE_PRIVATE_DEFAULT_LIMIT] = array( @@ -91,10 +91,10 @@ function message_private_admin_settings() { /** * Validate the admin settings form. * - * @param array $form + * @param mixed $form * The admin form array from message_private_admin_settings. - * @param array $form_state - * The current state of the admin form. + * @param mixed $form_state + * The current state of the admin form array. */ function message_private_admin_settings_validate($form, &$form_state) { @@ -124,9 +124,9 @@ function message_private_admin_settings_validate($form, &$form_state) { /** * Validate limit and interval values and show any errors on the form elements. * - * @param array $limit_element + * @param mixed $limit_element * Limit form element reference. - * @param array $interval_element + * @param mixed $interval_element * Interval form element reference. * @param string|int $limit * Limit value to validate. diff --git a/message_private.install b/message_private.install index e7e72bd..1a805aa 100644 --- a/message_private.install +++ b/message_private.install @@ -294,7 +294,7 @@ function message_private_install() { ), 'entity_type' => 'message', 'field_name' => 'field_message_user_ref', - 'label' => $t('Users'), + 'label' => $t('To Users'), 'required' => 1, 'settings' => array( 'behaviors' => array( diff --git a/message_private.module b/message_private.module index 284238a..8309cbc 100755 --- a/message_private.module +++ b/message_private.module @@ -126,7 +126,7 @@ function message_private_menu() { * * @param object $message * The message object. - * @return + * @return bool * TRUE if the user is allowed perform the operation, FALSE otherwise. */ function message_private_access_callback($message) { @@ -159,8 +159,8 @@ function message_private_menu_local_tasks_alter(&$data, $router_item, $root_path ); } - break; + case 'user/%/messages': // Add a 'Create a new message' action link above message_private view. $item = menu_get_item('admin/content/message/create/private-message'); @@ -171,6 +171,7 @@ function message_private_menu_local_tasks_alter(&$data, $router_item, $root_path ); break; + case 'message/%': $message = menu_get_object('message', 1, $router_item['href']); if (isset($message->type) && $message->type == 'private_message') { @@ -197,6 +198,7 @@ function message_private_menu_local_tasks_alter(&$data, $router_item, $root_path } } break; + } } @@ -412,7 +414,7 @@ function message_private_theme() { */ function message_private_message_view_alter(&$build) { // Use template_preprocess_message_private for private_message messages only. - if(!empty($build['#bundle']) && $build['#bundle'] == 'private_message') { + if (!empty($build['#bundle']) && $build['#bundle'] == 'private_message') { $build['#theme'] = 'message_private'; } } @@ -430,12 +432,12 @@ function template_preprocess_message_private(&$variables) { $message = $variables['elements']['#entity']; } // Create submitted variable containing user who created the message and date. - if(!empty($message) && $uid = $message->uid) { + if (!empty($message) && $uid = $message->uid) { $variables['date'] = format_date($message->timestamp); $variables['name'] = theme('username', array('account' => user_load($uid))); $variables['submitted'] = t('Submitted by !username on !datetime', array( '!username' => $variables['name'], - '!datetime' => $variables['date'] + '!datetime' => $variables['date'], )); } } @@ -448,8 +450,8 @@ function template_preprocess_message_private(&$variables) { * * @param null|array $roles * An assoc array of role names and ids. - * @return - * mixed, either a role id or null. + * @return mixed + * Either a role id or null. */ function _message_private_max_message_limit_role($roles) { $limits = array(); diff --git a/message_private_og/message_private_og.install b/message_private_og/message_private_og.install index 98ab0b9..84ca0ed 100644 --- a/message_private_og/message_private_og.install +++ b/message_private_og/message_private_og.install @@ -120,7 +120,7 @@ function message_private_og_install() { ), 'entity_type' => 'message', 'field_name' => 'field_message_group_ref', - 'label' => $t('Groups'), + 'label' => $t('To Groups'), 'required' => 0, 'settings' => array( 'user_register_form' => FALSE, diff --git a/message_private_og/message_private_og.module b/message_private_og/message_private_og.module index cd4e06f..7efcd7c 100755 --- a/message_private_og/message_private_og.module +++ b/message_private_og/message_private_og.module @@ -75,7 +75,7 @@ function message_private_og_menu_alter(&$items) { * * @param object $message * The message object. - * @return + * @return bool * TRUE if the user is allowed perform the operation, FALSE otherwise. */ function message_private_og_access_callback($message) {