Skip to content

Commit

Permalink
Reordered .install file and updated README.txt
Browse files Browse the repository at this point in the history
  • Loading branch information
mccrodp committed Jun 7, 2015
1 parent 341f528 commit 660713c
Show file tree
Hide file tree
Showing 2 changed files with 105 additions and 104 deletions.
10 changes: 6 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,10 @@ and view private messages.
"View user profiles" for users needing to send messages to other users. This is
due to issue: 'Restricted access results with user entityreference' - #2153463.
This patch may also help if committed in future: #2247937
"Administer message types" permission shows the user all private messages on the
admin/content/message view by default. To hide private messages from this view,
you must override view provided by Message module:
admin/structure/views/view/message/edit

When enabled, the module will provide a new message type "Private Message" and a
Message Private View.
Expand Down Expand Up @@ -118,13 +122,11 @@ CAPTCHA method: https://www.drupal.org/project/recaptcha

DEVELOPMENT AND TEST
--------------------
* Update Subject field to use a texfield instead of textarea.
* Hiding private messages from admin/content/message using settings page flag.
* Hiding "To Groups" field when message_private_og field is disabled.
* Threads will be created: https://www.drupal.org/node/2367729#comment-9480579.
An admin setting can be used to enable or disable threads to turn on/off
replies on all private messages (Reply, Reply All). Perhaps a css file will
need to be added for indentation / presentation.
need to be added for indentation / presentation. Integrate with MessageJS,
nodeJS or socket.io.
* Flag module on user entity to block/unblock users from messaging them
* Flag module on message entity to show/hide messages from users own display
* Allow Operations links to display correctly on views, i.e. - show 'View' for
Expand Down
199 changes: 99 additions & 100 deletions message_private.install
Original file line number Diff line number Diff line change
Expand Up @@ -352,6 +352,105 @@ function message_private_uninstall() {
}
}

/**
* Get base text field definition.
*
* @param $field_name
* @return mixed
*/
function _message_private_get_subject_field_base($field_name) {
// Field base: 'field_message_subject_temp'.
$field_base = array(
'active' => 1,
'cardinality' => 1,
'deleted' => 0,
'entity_types' => array(),
'field_name' => $field_name,
'foreign keys' => array(
'format' => array(
'columns' => array(
'format' => 'format',
),
'table' => 'filter_format',
),
),
'indexes' => array(
'format' => array(
0 => 'format',
),
),
'locked' => 0,
'module' => 'text',
'settings' => array(
'max_length' => 255,
),
'translatable' => 0,
'type' => 'text',
);

return $field_base;
}

/**
* Get instance text field definition.
*
* @param $field_name
* @return mixed
*/
function _message_private_get_subject_field_instance($field_name) {
// Ensure translations don't break during installation.
$t = get_t();

// Field instance: 'message-private_message-field_message_subject_temp'.
$field_instance = array(
'bundle' => 'private_message',
'default_value' => NULL,
'deleted' => 0,
'description' => '',
'display' => array(
'default' => array(
'label' => 'inline',
'module' => 'text',
'settings' => array(),
'type' => 'text_default',
'weight' => 1,
),
'message_notify_email_body' => array(
'label' => 'above',
'settings' => array(),
'type' => 'hidden',
'weight' => 3,
),
'message_notify_email_subject' => array(
'label' => 'hidden',
'module' => 'text',
'settings' => array(),
'type' => 'text_default',
'weight' => 1,
),
),
'entity_type' => 'message',
'field_name' => $field_name,
'label' => $t('Subject'),
'required' => 0,
'settings' => array(
'text_processing' => 0,
'user_register_form' => FALSE,
),
'widget' => array(
'active' => 1,
'module' => 'text',
'settings' => array(
'size' => 150,
),
'type' => 'text_textfield',
'weight' => 0,
),
);

return $field_instance;
}

/**
* Implements hook_update_N().
*
Expand Down Expand Up @@ -554,103 +653,3 @@ function message_private_update_7101() {

return $t('Success - changed Subject to textfield. Temp Subject field removed.');
}


/**
* Get base text field definition.
*
* @param $field_name
* @return mixed
*/
function _message_private_get_subject_field_base($field_name) {
// Field base: 'field_message_subject_temp'.
$field_base = array(
'active' => 1,
'cardinality' => 1,
'deleted' => 0,
'entity_types' => array(),
'field_name' => $field_name,
'foreign keys' => array(
'format' => array(
'columns' => array(
'format' => 'format',
),
'table' => 'filter_format',
),
),
'indexes' => array(
'format' => array(
0 => 'format',
),
),
'locked' => 0,
'module' => 'text',
'settings' => array(
'max_length' => 255,
),
'translatable' => 0,
'type' => 'text',
);

return $field_base;
}

/**
* Get instance text field definition.
*
* @param $field_name
* @return mixed
*/
function _message_private_get_subject_field_instance($field_name) {
// Ensure translations don't break during installation.
$t = get_t();

// Field instance: 'message-private_message-field_message_subject_temp'.
$field_instance = array(
'bundle' => 'private_message',
'default_value' => NULL,
'deleted' => 0,
'description' => '',
'display' => array(
'default' => array(
'label' => 'inline',
'module' => 'text',
'settings' => array(),
'type' => 'text_default',
'weight' => 1,
),
'message_notify_email_body' => array(
'label' => 'above',
'settings' => array(),
'type' => 'hidden',
'weight' => 3,
),
'message_notify_email_subject' => array(
'label' => 'hidden',
'module' => 'text',
'settings' => array(),
'type' => 'text_default',
'weight' => 1,
),
),
'entity_type' => 'message',
'field_name' => $field_name,
'label' => $t('Subject'),
'required' => 0,
'settings' => array(
'text_processing' => 0,
'user_register_form' => FALSE,
),
'widget' => array(
'active' => 1,
'module' => 'text',
'settings' => array(
'size' => 150,
),
'type' => 'text_textfield',
'weight' => 0,
),
);

return $field_instance;
}

0 comments on commit 660713c

Please sign in to comment.