Remove forked commons modules

This change break the site, but prepares the commons profile
refactoring, where the profile will be fetched as a drupal
project and patches can be applied in a more visible way.

Change-Id: I6daa321c97511fa0e432edd86981bb5b8e819568
This commit is contained in:
Marton Kiss 2016-10-12 17:15:33 +02:00
parent 2aad953dd8
commit 8effe73e31
408 changed files with 0 additions and 39968 deletions

View File

@ -1,14 +0,0 @@
<?php
/**
* @file
* commons_activity_page.features.inc
*/
/**
* Implements hook_ctools_plugin_api().
*/
function commons_activity_page_ctools_plugin_api($module = NULL, $api = NULL) {
if ($module == "page_manager" && $api == "pages_default") {
return array("version" => "1");
}
}

View File

@ -1,20 +0,0 @@
name = Commons Activity Page
description = Provides a landing page which lists site activity.
package = Commons - Landing pages
core = 7.x
dependencies[] = commons_activity_streams
dependencies[] = commons_featured
dependencies[] = ctools
dependencies[] = page_manager
features[ctools][] = page_manager:pages_default:1
features[features_api][] = api:2
features[page_manager_pages][] = commons_activity_streams_activity
; Information added by Drupal.org packaging script on 2015-03-18
version = "7.x-3.23"
core = "7.x"
project = "commons"
datestamp = "1426714630"

View File

@ -1,7 +0,0 @@
<?php
/**
* @file
* Code for the Commons Activity Page feature.
*/
include_once 'commons_activity_page.features.inc';

View File

@ -1,130 +0,0 @@
<?php
/**
* @file
* commons_activity_page.pages_default.inc
*/
/**
* Implements hook_default_page_manager_pages().
*/
function commons_activity_page_default_page_manager_pages() {
$page = new stdClass();
$page->disabled = FALSE; /* Edit this to true to make a default page disabled initially */
$page->api_version = 1;
$page->name = 'commons_activity_streams_activity';
$page->task = 'page';
$page->admin_title = 'Activity';
$page->admin_description = '';
$page->path = 'activity';
$page->access = array(
'type' => 'none',
'settings' => NULL,
);
$page->menu = array();
$page->arguments = array();
$page->conf = array(
'admin_paths' => FALSE,
);
$page->default_handlers = array();
$handler = new stdClass();
$handler->disabled = FALSE; /* Edit this to true to make a default handler disabled initially */
$handler->api_version = 1;
$handler->name = 'page_commons_activity_streams_activity_panel_context';
$handler->task = 'page';
$handler->subtask = 'commons_activity_streams_activity';
$handler->handler = 'panel_context';
$handler->weight = 0;
$handler->conf = array(
'title' => 'Activity',
'no_blocks' => 0,
'pipeline' => 'ipe',
'body_classes_to_remove' => '',
'body_classes_to_add' => '',
'css_id' => '',
'css' => '',
'contexts' => array(),
'relationships' => array(),
);
$display = new panels_display();
$display->layout = 'two_66_33';
$display->layout_settings = array();
$display->panel_settings = array(
'style_settings' => array(
'default' => NULL,
'two_66_33_top' => NULL,
'two_66_33_first' => NULL,
'two_66_33_second' => NULL,
'two_66_33_bottom' => NULL,
),
);
$display->cache = array();
$display->title = 'Recent site activity';
$display->uuid = '5421dc96-4e35-5794-5539-fc6123374548';
$display->content = array();
$display->panels = array();
$pane = new stdClass();
$pane->pid = 'new-6251a6df-20d2-5034-f9d8-a66cd04f16e9';
$pane->panel = 'two_66_33_first';
$pane->type = 'views_panes';
$pane->subtype = 'commons_activity_streams_activity-panel_pane_3';
$pane->shown = TRUE;
$pane->access = array();
$pane->configuration = array();
$pane->cache = array();
$pane->style = array(
'settings' => NULL,
);
$pane->css = array();
$pane->extras = array();
$pane->position = 0;
$pane->locks = array();
$pane->uuid = '6251a6df-20d2-5034-f9d8-a66cd04f16e9';
$display->content['new-6251a6df-20d2-5034-f9d8-a66cd04f16e9'] = $pane;
$display->panels['two_66_33_first'][0] = 'new-6251a6df-20d2-5034-f9d8-a66cd04f16e9';
$pane = new stdClass();
$pane->pid = 'new-6668ecda-9f18-0744-71cb-afcb5fb5114d';
$pane->panel = 'two_66_33_second';
$pane->type = 'views_panes';
$pane->subtype = 'commons_featured-panel_pane_1';
$pane->shown = TRUE;
$pane->access = array();
$pane->configuration = array();
$pane->cache = array();
$pane->style = array(
'settings' => NULL,
);
$pane->css = array();
$pane->extras = array();
$pane->position = 0;
$pane->locks = array();
$pane->uuid = '6668ecda-9f18-0744-71cb-afcb5fb5114d';
$display->content['new-6668ecda-9f18-0744-71cb-afcb5fb5114d'] = $pane;
$display->panels['two_66_33_second'][0] = 'new-6668ecda-9f18-0744-71cb-afcb5fb5114d';
$pane = new stdClass();
$pane->pid = 'new-e5d75ae1-dae7-bb04-0977-6e6c5a230f3d';
$pane->panel = 'two_66_33_second';
$pane->type = 'views_panes';
$pane->subtype = 'commons_groups_contributors-panel_pane_1';
$pane->shown = TRUE;
$pane->access = array();
$pane->configuration = array();
$pane->cache = array();
$pane->style = array(
'settings' => NULL,
);
$pane->css = array();
$pane->extras = array();
$pane->position = 1;
$pane->locks = array();
$pane->uuid = 'e5d75ae1-dae7-bb04-0977-6e6c5a230f3d';
$display->content['new-e5d75ae1-dae7-bb04-0977-6e6c5a230f3d'] = $pane;
$display->panels['two_66_33_second'][1] = 'new-e5d75ae1-dae7-bb04-0977-6e6c5a230f3d';
$display->hide_title = PANELS_TITLE_FIXED;
$display->title_pane = 'new-6251a6df-20d2-5034-f9d8-a66cd04f16e9';
$handler->conf['display'] = $display;
$page->default_handlers[$handler->name] = $handler;
$pages['commons_activity_streams_activity'] = $page;
return $pages;
}

View File

@ -1,210 +0,0 @@
<?php
/**
* @file
* commons_activity_streams.features.field_instance.inc
*/
/**
* Implements hook_field_default_field_instances().
*/
function commons_activity_streams_field_default_field_instances() {
$field_instances = array();
// Exported field_instance: 'message-commons_activity_streams_comment_created-field_target_comments'
$field_instances['message-commons_activity_streams_comment_created-field_target_comments'] = array(
'bundle' => 'commons_activity_streams_comment_created',
'default_value' => NULL,
'deleted' => 0,
'description' => '',
'display' => array(
'default' => array(
'label' => 'hidden',
'settings' => array(),
'type' => 'hidden',
'weight' => 0,
),
'message_notify_email_body' => array(
'label' => 'above',
'settings' => array(),
'type' => 'hidden',
'weight' => 0,
),
'message_notify_email_subject' => array(
'label' => 'above',
'settings' => array(),
'type' => 'hidden',
'weight' => 0,
),
),
'entity_type' => 'message',
'field_name' => 'field_target_comments',
'label' => 'Target comment',
'required' => 0,
'settings' => array(
'user_register_form' => FALSE,
),
'widget' => array(
'active' => 1,
'module' => 'entityreference',
'settings' => array(
'match_operator' => 'CONTAINS',
'path' => '',
'size' => 60,
),
'type' => 'entityreference_autocomplete',
'weight' => 1,
),
);
// Exported field_instance: 'message-commons_activity_streams_comment_created-field_target_nodes'
$field_instances['message-commons_activity_streams_comment_created-field_target_nodes'] = array(
'bundle' => 'commons_activity_streams_comment_created',
'default_value' => NULL,
'deleted' => 0,
'description' => '',
'display' => array(
'default' => array(
'label' => 'hidden',
'settings' => array(),
'type' => 'hidden',
'weight' => 1,
),
'message_notify_email_body' => array(
'label' => 'above',
'settings' => array(),
'type' => 'hidden',
'weight' => 0,
),
'message_notify_email_subject' => array(
'label' => 'above',
'settings' => array(),
'type' => 'hidden',
'weight' => 0,
),
),
'entity_type' => 'message',
'field_name' => 'field_target_nodes',
'label' => 'Target nodes',
'required' => 0,
'settings' => array(
'user_register_form' => FALSE,
),
'widget' => array(
'active' => 1,
'module' => 'entityreference',
'settings' => array(
'match_operator' => 'CONTAINS',
'path' => '',
'size' => 60,
),
'type' => 'entityreference_autocomplete',
'weight' => 3,
),
);
// Exported field_instance: 'message-commons_activity_streams_node_created-field_target_nodes'
$field_instances['message-commons_activity_streams_node_created-field_target_nodes'] = array(
'bundle' => 'commons_activity_streams_node_created',
'default_value' => NULL,
'deleted' => 0,
'description' => '',
'display' => array(
'default' => array(
'label' => 'hidden',
'settings' => array(),
'type' => 'hidden',
'weight' => 2,
),
'message_notify_email_body' => array(
'label' => 'above',
'settings' => array(),
'type' => 'hidden',
'weight' => 0,
),
'message_notify_email_subject' => array(
'label' => 'above',
'settings' => array(),
'type' => 'hidden',
'weight' => 0,
),
),
'entity_type' => 'message',
'field_name' => 'field_target_nodes',
'label' => 'Target nodes',
'required' => 0,
'settings' => array(
'user_register_form' => FALSE,
),
'widget' => array(
'active' => 1,
'module' => 'entityreference',
'settings' => array(
'match_operator' => 'CONTAINS',
'path' => '',
'size' => 60,
),
'type' => 'entityreference_autocomplete',
'weight' => 3,
),
);
// Exported field_instance: 'message-commons_activity_streams_user_profile_updated-field_target_users'
$field_instances['message-commons_activity_streams_user_profile_updated-field_target_users'] = array(
'bundle' => 'commons_activity_streams_user_profile_updated',
'default_value' => NULL,
'default_value_function' => '',
'deleted' => 0,
'description' => '',
'display' => array(
'default' => array(
'label' => 'above',
'settings' => array(),
'type' => 'hidden',
'weight' => 2,
),
'message_notify_email_body' => array(
'label' => 'above',
'settings' => array(),
'type' => 'hidden',
'weight' => 0,
),
'message_notify_email_subject' => array(
'label' => 'above',
'settings' => array(),
'type' => 'hidden',
'weight' => 0,
),
),
'entity_type' => 'message',
'field_name' => 'field_target_users',
'label' => 'Target users',
'required' => 0,
'settings' => array(
'behaviors' => array(
'prepopulate' => array(
'status' => 0,
),
),
'user_register_form' => FALSE,
),
'widget' => array(
'active' => 1,
'module' => 'entityreference',
'settings' => array(
'match_operator' => 'CONTAINS',
'path' => '',
'size' => 60,
),
'type' => 'entityreference_autocomplete',
'weight' => 42,
),
);
// Translatables
// Included for use with string extractors like potx.
t('Target comment');
t('Target nodes');
t('Target users');
return $field_instances;
}

View File

@ -1,108 +0,0 @@
<?php
/**
* @file
* commons_activity_streams.features.inc
*/
/**
* Implements hook_ctools_plugin_api().
*/
function commons_activity_streams_ctools_plugin_api($module = NULL, $api = NULL) {
if ($module == "strongarm" && $api == "strongarm") {
return array("version" => "1");
}
}
/**
* Implements hook_views_api().
*/
function commons_activity_streams_views_api($module = NULL, $api = NULL) {
return array("api" => "3.0");
}
/**
* Implements hook_default_message_type().
*/
function commons_activity_streams_default_message_type() {
$items = array();
$items['commons_activity_streams_comment_created'] = entity_import('message_type', '{
"name" : "commons_activity_streams_comment_created",
"description" : "commons_activity_streams_comment_created",
"argument_keys" : [],
"argument" : [],
"category" : "message_type",
"data" : {
"token options" : { "clear" : 1 },
"purge" : { "override" : 0, "enabled" : 0, "quota" : "", "days" : "" }
},
"language" : "",
"arguments" : null,
"message_text" : { "und" : [
{ "value" : "[message:user:picture:35x35]", "format" : "filtered_html" },
{
"value" : "\\u003Ca href=\\u0022[message:user:url:absolute]\\u0022\\u003E[message:user:name]\\u003C\\/a\\u003E commented on \\u003Ca href=\\u0022[message:field-target-nodes:0:url]\\u0022\\u003E[message:field-target-nodes:0:title_field]\\u003C\\/a\\u003E",
"format" : "full_html",
"safe_value" : "\\u003Ca href=\\u0022[message:user:url:absolute]\\u0022\\u003E[message:user:name]\\u003C\\/a\\u003E commented on \\u003Ca href=\\u0022[message:field-target-nodes:0:url]\\u0022\\u003E[message:field-target-nodes:0:title_field]\\u003C\\/a\\u003E"
},
{
"value" : "[commons-groups:in-groups-text]",
"format" : "full_html",
"safe_value" : "[commons-groups:in-groups-text]"
}
]
},
"rdf_mapping" : []
}');
$items['commons_activity_streams_node_created'] = entity_import('message_type', '{
"name" : "commons_activity_streams_node_created",
"description" : "commons_activity_streams_node_created",
"argument_keys" : [],
"argument" : [],
"category" : "message_type",
"data" : {
"token options" : { "clear" : 1 },
"purge" : { "override" : 0, "enabled" : 0, "quota" : "", "days" : "" }
},
"language" : "",
"arguments" : null,
"message_text" : { "und" : [
{ "value" : "[message:user:picture:35x35]", "format" : "filtered_html" },
{
"value" : "\\u003Ca href=\\u0022[message:user:url:absolute]\\u0022\\u003E[message:user:name]\\u003C\\/a\\u003E created \\u003Ca href=\\u0022[message:field-target-nodes:0:url]\\u0022\\u003E[message:field-target-nodes:0:title_field]\\u003C\\/a\\u003E",
"format" : "full_html",
"safe_value" : "\\u003Ca href=\\u0022[message:user:url:absolute]\\u0022\\u003E[message:user:name]\\u003C\\/a\\u003E created \\u003Ca href=\\u0022[message:field-target-nodes:0:url]\\u0022\\u003E[message:field-target-nodes:0:title_field]\\u003C\\/a\\u003E"
},
{
"value" : "[commons-groups:in-groups-text]",
"format" : "full_html",
"safe_value" : "[commons-groups:in-groups-text]"
}
]
},
"rdf_mapping" : []
}');
$items['commons_activity_streams_user_profile_updated'] = entity_import('message_type', '{
"name" : "commons_activity_streams_user_profile_updated",
"description" : "commons_activity_streams_user_profile_updated",
"argument_keys" : [],
"argument" : [],
"category" : "message_type",
"data" : {
"token options" : { "clear" : 1 },
"purge" : { "override" : 0, "enabled" : 0, "quota" : "", "days" : "" }
},
"language" : "",
"arguments" : null,
"message_text" : { "und" : [
{ "value" : "[message:user:picture:35x35]", "format" : "filtered_html" },
{
"value" : "\\u003Ca href=\\u0022[message:user:url:absolute]\\u0022\\u003E[message:user:name]\\u003C\\/a\\u003E has an updated profile",
"format" : "full_html",
"safe_value" : "\\u003Ca href=\\u0022[message:user:url:absolute]\\u0022\\u003E[message:user:name]\\u003C\\/a\\u003E has an updated profile"
}
]
},
"rdf_mapping" : []
}');
return $items;
}

View File

@ -1,50 +0,0 @@
name = Commons Activity Streams
description = Displays a listing of site-wide and user-specific site activity.
package = Commons - Building blocks
core = 7.x
dependencies[] = commons_follow
dependencies[] = ctools
dependencies[] = entity
dependencies[] = entityreference
dependencies[] = features
dependencies[] = message
dependencies[] = strongarm
dependencies[] = timeago
dependencies[] = token
dependencies[] = views
dependencies[] = views_content
dependencies[] = views_load_more
features[ctools][] = strongarm:strongarm:1
features[ctools][] = views:views_default:3.0
features[features_api][] = api:2
features[field_instance][] = message-commons_activity_streams_comment_created-field_target_comments
features[field_instance][] = message-commons_activity_streams_comment_created-field_target_nodes
features[field_instance][] = message-commons_activity_streams_node_created-field_target_nodes
features[field_instance][] = message-commons_activity_streams_user_profile_updated-field_target_users
features[message_type][] = commons_activity_streams_comment_created
features[message_type][] = commons_activity_streams_node_created
features[message_type][] = commons_activity_streams_user_profile_updated
features[variable][] = field_bundle_settings_message__commons_activity_streams_comment_created
features[variable][] = field_bundle_settings_message__commons_activity_streams_node_created
features[variable][] = field_bundle_settings_message__commons_activity_streams_user_profile_updated
features[variable][] = timeago_comment
features[variable][] = timeago_node
features[views_view][] = commons_activity_streams_activity
features[views_view][] = commons_activity_streams_user_activity
features_exclude[field][message-commons_activity_streams_comment_created-field_target_comments] = message-commons_activity_streams_comment_created-field_target_comments
features_exclude[field][message-commons_activity_streams_comment_created-field_target_nodes] = message-commons_activity_streams_comment_created-field_target_nodes
features_exclude[field][message-commons_activity_streams_node_created-field_target_nodes] = message-commons_activity_streams_node_created-field_target_nodes
features_exclude[field][message-commons_activity_streams_user_profile_updated-field_target_users] = message-commons_activity_streams_user_profile_updated-field_target_users
features_exclude[field_base][field_target_nodes] = field_target_nodes
features_exclude[field_base][field_target_comments] = field_target_comments
features_exclude[views_view][commons_bw_all] = commons_bw_all
; Information added by Drupal.org packaging script on 2015-03-18
version = "7.x-3.23"
core = "7.x"
project = "commons"
datestamp = "1426714630"

View File

@ -1,76 +0,0 @@
<?php
/**
* Update the "User follows user" message type.
*/
function commons_activity_streams_update_3101() {
features_revert(array('commons_activity_streams' => array('message_type', 'field_instance')));
return array();
}
/**
* Set activity stream user pictures to 35x35 image style.
*/
function commons_activity_streams_update_3102() {
$revert = array(
'commons_activity_streams' => array('message_type'),
);
features_revert($revert);
return array();
}
/**
* Reset field instances to hide the target users field from the updated profile message.
*/
function commons_activity_streams_update_3103() {
$revert = array(
'commons_activity_streams' => array('field_instance'),
);
features_revert($revert);
return array();
}
/**
* Enable timeago for nodes and comments.
*/
function commons_activity_streams_update_3104() {
$revert = array(
'commons_activity_streams' => array('variable'),
);
features_revert($revert);
return array();
}
/**
* Remove duplicative node access filters from Commons Activity Streams views.
*/
function commons_activity_streams_update_3105() {
$revert = array(
'commons_activity_streams' => array('views_view'),
'commons_activity_streams_groups' => array('views_view'),
);
features_revert($revert);
return array();
}
/**
* Add empty text to Commons Activity Streams views.
*/
function commons_activity_streams_update_3106() {
$revert = array(
'commons_activity_streams' => array('views_view'),
);
features_revert($revert);
return array();
}
/**
* Accommodate changes to message definitions.
*/
function commons_activity_streams_update_3107() {
$revert = array(
'commons_activity_streams' => array('message_type'),
);
features_revert($revert);
return array();
}

View File

@ -1,316 +0,0 @@
<?php
include_once 'commons_activity_streams.features.inc';
/**
* Implements hook_form_alter().
*/
function commons_activity_streams_form_alter(&$form, &$form_state, $form_id) {
// Customize the text on the filter for Activity landing page.
if ($form_id == 'views_exposed_form' && $form['#id'] == 'views-exposed-form-commons-activity-streams-activity-panel-pane-3') {
$form['following']['#options'][0] = t("activity I'm not following");
$form['following']['#options'][1] = t("activity I'm following");
}
if ($form_id == 'edit_profile_user_profile_form') {
// Store default values in form state storage for change detection.
static $profile_form_state;
if (!isset($profile_form_state)) {
// Use a copy of $form and $form_state for prepare and process.
$profile_form = array_merge(array(), $form);
$profile_form_state = array_merge(array(), $form_state);
drupal_prepare_form('edit_profile_user_profile_form', $profile_form, $profile_form_state);
drupal_process_form('edit_profile_user_profile_form', $profile_form, $profile_form_state);
$form_state['storage']['values'] = $profile_form_state['values'];
}
$form['#submit'][] = 'commons_activity_streams_user_profile_submit';
}
}
/**
* Implements hook_node_insert().
*/
function commons_activity_streams_node_insert($node) {
// Create a message when a user creates a new node.
$account = user_load($node->uid);
// Allow other modules to change the message type used for this event.
$hook = 'node_insert';
$message_type = 'commons_activity_streams_node_created';
drupal_alter('commons_activity_streams_message_selection', $message_type, $hook, $node);
$message = message_create($message_type, array('uid' => $account->uid, 'timestamp' => $node->created));
// Save reference to the node in the node reference field, and the
$wrapper = entity_metadata_wrapper('message', $message);
// We use a multiple value field in case we wish to use the same
// field for grouping messages in the future
// (eg http://drupal.org/node/1757060).
$wrapper->field_target_nodes[] = $node;
$wrapper->save();
}
/**
* Implements hook_comment_insert().
*/
function commons_activity_streams_comment_insert($comment) {
$account = user_load($comment->uid);
$node = node_load($comment->nid);
// Allow other modules to change the message type used for this event.
$hook = 'comment_insert';
$message_type = 'commons_activity_streams_comment_created';
drupal_alter('commons_activity_streams_message_selection', $message_type, $hook, $node);
$message = message_create($message_type, array('uid' => $account->uid, 'timestamp' => $comment->created));
// Save reference to the node in the node reference field, and the
// "publish" state (i.e. if the node is published or unpublished).
$wrapper = entity_metadata_wrapper('message', $message);
$wrapper->field_target_nodes[] = $node;
$wrapper->field_target_comments[] = $comment;
// The message should be published only if the node and the comment are
// both published.
// @todo: Deal with message publishing/unpublishing.
/*
$published = $node->status && $comment->status;
$wrapper->field_published->set($published);
*/
$wrapper->save();
}
/**
* Implements hook_comment_delete().
*/
function commons_activity_streams_comment_delete($comment) {
// Delete the activity stream message created when this comment
// was posted.
if ($mids = commons_activity_streams_existing_messages($comment->uid, array($comment->cid), 'field_target_comments', 'commons_activity_streams_comment_created')) {
message_delete_multiple($mids);
}
}
/**
* Implements hook_message_access_alter().
*/
function commons_activity_streams_message_access_alter(&$access, $context) {
// We're only interested in the 'view' operation.
if ($context['op'] != 'view') {
return;
}
$message = $context['entity'];
// Verify view access to nodes referenced in the message.
if (isset($message->field_target_nodes)) {
foreach ($message->field_target_nodes[LANGUAGE_NONE] as $key => $value) {
$node = node_load($value['target_id']);
if (!node_access('view', $node, $context['account'])) {
// If the user cannot view any nodes in the message,
// deny access to the entire message;
$access = FALSE;
return;
}
}
}
// Verify view access to comments referenced in the message.
if (isset($message->field_target_comments)) {
foreach ($message->field_target_comments[LANGUAGE_NONE] as $key => $value) {
$comment = comment_load($value['target_id']);
if (!entity_access('view', 'comment', $comment, $context['account'])) {
// If the user cannot view any comments in the message,
// deny access to the entire message;
$access = FALSE;
return;
}
}
}
}
/**
* Find existing messages that match certain parameters.
*/
function commons_activity_streams_existing_messages($acting_uid, $target_ids, $target_field, $message_type) {
$query = new EntityFieldQuery();
$query->entityCondition('entity_type', 'message', '=')
->propertyCondition('uid', $acting_uid)
->propertyCondition('type', $message_type, '=')
->fieldCondition($target_field, 'target_id', $target_ids, 'IN')
->execute();
if (!empty($query->ordered_results)) {
$mids = array();
foreach($query->ordered_results as $result) {
$mids[] = $result->entity_id;
}
return $mids;
}
return FALSE;
}
/**
* Create an activity stream message when a user updates her profile.
*/
function commons_activity_streams_user_profile_submit($form, &$form_state) {
global $user;
// Fields to ignore in $form_state['values'] when detecting changes.
$remove_keys = array(
'uid',
'name',
'pass',
'current_pass_required_values',
'current_pass',
'status',
'roles',
'notify',
'signature',
'picture_delete',
'message_subscribe_email',
'og_user_node',
'cancel',
'metatags',
'timezone',
'signature_format',
'form_token',
'form_id',
'form_build_id',
'picture_upload',
'submit'
);
$profile_values = array_diff_key($form_state['values'], array_flip($remove_keys));
ksort($profile_values);
$profile_data = serialize($profile_values);
$stored_profile_values = array_diff_key($form_state['storage']['values'], array_flip($remove_keys));
ksort($stored_profile_values);
$stored_profile_data = serialize($stored_profile_values);
// Do not generate a message if
// - the user did not submit their own form
// - no changes were detected
// - a profile update message created within the last 15 minutes
$time_ago = time() - 900;
$query = new EntityFieldQuery();
$query->entityCondition('entity_type', 'message')
->propertyCondition('uid', $form_state['user']->uid)
->propertyCondition('type', 'commons_activity_streams_user_profile_updated')
->propertyCondition('timestamp', $time_ago, '>')
->count();
$count = $query->execute();
if ($user->uid != $form_state['user']->uid ||
$profile_data == $stored_profile_data ||
$count > 0) {
return;
}
$account = $form_state['user'];
// Allow other modules to change the message type used for this event.
$hook = 'user_profile_update';
$message_type = 'commons_activity_streams_user_profile_updated';
drupal_alter('commons_activity_streams_message_selection', $message_type, $hook, $account);
$message = message_create($message_type, array('uid' => $account->uid, 'timestamp' => REQUEST_TIME));
// Save reference to the node in the node reference field, and the
$wrapper = entity_metadata_wrapper('message', $message);
$wrapper->field_target_users[] = $account;
$wrapper->save();
}
/**
* Implements hook_token_info().
*/
function commons_activity_streams_token_info() {
$tokens = array();
$styles = image_styles();
// Create a token to retrieve the user picture formatted using any of the
// currently defined image styles.
foreach ($styles as $style_name => $style) {
$tokens['picture:' . $style_name] = array(
'name' => t('Picture: @st image style', array('@st' => $style_name)),
'description' => t('Picture: @st image style', array('@st' => $style_name)),
);
}
return array(
'tokens' => array(
'user' => $tokens,
),
);
}
/**
* Implements hook_tokens().
*/
function commons_activity_streams_tokens($type, $tokens, array $data = array(), array $options = array()) {
$replacements = array();
if ($type == 'user' && isset($data['user'])) {
$account = $data['user'];
// Generate suitable alternative text using the user's username.
$username = format_username($account);
$alt = t("@name's picture", array('@name' => $username));
foreach ($tokens as $token => $original) {
if (strpos($token, 'picture:') !== FALSE) {
list( , $style) = explode(':', $token);
// Prefer unique account pictures but fall back to the default user
// picture if necessary.
$path = $account->picture ? $account->picture->uri : variable_get('user_picture_default', '/profiles/commons/images/avatars/user-avatar.png');
$image_variables = array(
'path' => image_style_url($style, $path),
'alt' => $alt,
'title' => $alt,
'class' => array('image-style-none'),
);
$image = theme('image', $image_variables);
$user_path = user_uri($account);
$link_options = array(
'attributes' => array(
'title' => t('View user profile.'),
),
'html' => TRUE,
);
$replacements[$original] = "<div class='user-picture'>" . l($image, $user_path['path'], $link_options) . "</div>";
}
}
}
return $replacements;
}
/**
* Implements hook_views_post_execute().
*
* Emulate message_access because we don't want the row to appear at all if the
* user does not have access to the node or comment. Node access is included in
* the view query itself.
*
* Without this function, the user would see a missing rendered entity, but the
* timestamp would still show.
*/
function commons_activity_streams_views_post_execute(&$view) {
if ($view->name == 'commons_activity_streams_activity' && isset($view->result)) {
foreach ($view->result AS $key => $msg) {
if (isset($msg->mid)) {
// We preempt the message_access on render by doing it now. Doesn't make
// Two calls because we remove the result if access is false.
$message = message_load($msg->mid);
if (isset($message->field_target_comments)) {
foreach ($message->field_target_comments[LANGUAGE_NONE] as $key => $value) {
$comment = comment_load($value['target_id']);
if (!entity_access('view', 'comment', $comment)) {
// If the user cannot view any nodes or comments in the message,
// deny access to the entire message;
unset($view->result[$key]);
}
}
}
}
}
}
}

View File

@ -1,130 +0,0 @@
<?php
/**
* @file
* commons_activity_streams.strongarm.inc
*/
/**
* Implements hook_strongarm().
*/
function commons_activity_streams_strongarm() {
$export = array();
$strongarm = new stdClass();
$strongarm->disabled = FALSE; /* Edit this to true to make a default strongarm disabled initially */
$strongarm->api_version = 1;
$strongarm->name = 'field_bundle_settings_message__commons_activity_streams_comment_created';
$strongarm->value = array(
'view_modes' => array(),
'extra_fields' => array(
'form' => array(),
'display' => array(
'message__message_text__0' => array(
'message_notify_email_subject' => array(
'visible' => TRUE,
'weight' => 0,
),
'message_notify_email_body' => array(
'visible' => FALSE,
'weight' => 0,
),
),
'message__message_text__1' => array(
'message_notify_email_subject' => array(
'visible' => FALSE,
'weight' => 0,
),
'message_notify_email_body' => array(
'visible' => TRUE,
'weight' => 0,
),
),
),
),
);
$export['field_bundle_settings_message__commons_activity_streams_comment_created'] = $strongarm;
$strongarm = new stdClass();
$strongarm->disabled = FALSE; /* Edit this to true to make a default strongarm disabled initially */
$strongarm->api_version = 1;
$strongarm->name = 'field_bundle_settings_message__commons_activity_streams_node_created';
$strongarm->value = array(
'view_modes' => array(),
'extra_fields' => array(
'form' => array(),
'display' => array(
'message__message_text__0' => array(
'message_notify_email_subject' => array(
'visible' => TRUE,
'weight' => 0,
),
'message_notify_email_body' => array(
'visible' => FALSE,
'weight' => 0,
),
),
'message__message_text__1' => array(
'message_notify_email_subject' => array(
'visible' => FALSE,
'weight' => 0,
),
'message_notify_email_body' => array(
'visible' => TRUE,
'weight' => 0,
),
),
),
),
);
$export['field_bundle_settings_message__commons_activity_streams_node_created'] = $strongarm;
$strongarm = new stdClass();
$strongarm->disabled = FALSE; /* Edit this to true to make a default strongarm disabled initially */
$strongarm->api_version = 1;
$strongarm->name = 'field_bundle_settings_message__commons_activity_streams_user_profile_updated';
$strongarm->value = array(
'view_modes' => array(),
'extra_fields' => array(
'form' => array(),
'display' => array(
'message__message_text__0' => array(
'message_notify_email_subject' => array(
'visible' => TRUE,
'weight' => 0,
),
'message_notify_email_body' => array(
'visible' => FALSE,
'weight' => 0,
),
),
'message__message_text__1' => array(
'message_notify_email_subject' => array(
'visible' => FALSE,
'weight' => 0,
),
'message_notify_email_body' => array(
'visible' => TRUE,
'weight' => 0,
),
),
),
),
);
$export['field_bundle_settings_message__commons_activity_streams_user_profile_updated'] = $strongarm;
$strongarm = new stdClass();
$strongarm->disabled = FALSE; /* Edit this to true to make a default strongarm disabled initially */
$strongarm->api_version = 1;
$strongarm->name = 'timeago_comment';
$strongarm->value = 1;
$export['timeago_comment'] = $strongarm;
$strongarm = new stdClass();
$strongarm->disabled = FALSE; /* Edit this to true to make a default strongarm disabled initially */
$strongarm->api_version = 1;
$strongarm->name = 'timeago_node';
$strongarm->value = 1;
$export['timeago_node'] = $strongarm;
return $export;
}

View File

@ -1,320 +0,0 @@
<?php
/**
* @file
* commons_activity_streams.views_default.inc
*/
/**
* Implements hook_views_default_views().
*/
function commons_activity_streams_views_default_views() {
$export = array();
$view = new view();
$view->name = 'commons_activity_streams_activity';
$view->description = '';
$view->tag = 'default';
$view->base_table = 'message';
$view->human_name = 'Commons Activity Streams - Activity (Site-wide)';
$view->core = 7;
$view->api_version = '3.0';
$view->disabled = FALSE; /* Edit this to true to make a default view disabled initially */
/* Display: Master */
$handler = $view->new_display('default', 'Master', 'default');
$handler->display->display_options['title'] = 'Recent site activity';
$handler->display->display_options['use_ajax'] = TRUE;
$handler->display->display_options['use_more_always'] = FALSE;
$handler->display->display_options['link_display'] = 'custom_url';
$handler->display->display_options['access']['type'] = 'none';
$handler->display->display_options['cache']['type'] = 'none';
$handler->display->display_options['query']['type'] = 'views_query';
$handler->display->display_options['exposed_form']['type'] = 'basic';
$handler->display->display_options['pager']['type'] = 'full';
$handler->display->display_options['pager']['options']['items_per_page'] = '20';
$handler->display->display_options['pager']['options']['offset'] = '0';
$handler->display->display_options['pager']['options']['id'] = '0';
$handler->display->display_options['pager']['options']['quantity'] = '9';
$handler->display->display_options['style_plugin'] = 'default';
$handler->display->display_options['row_plugin'] = 'fields';
/* No results behavior: Global: Text area */
$handler->display->display_options['empty']['area']['id'] = 'area';
$handler->display->display_options['empty']['area']['table'] = 'views';
$handler->display->display_options['empty']['area']['field'] = 'area';
$handler->display->display_options['empty']['area']['empty'] = TRUE;
$handler->display->display_options['empty']['area']['content'] = 'Nobody has performed any activity on the site recently.';
$handler->display->display_options['empty']['area']['format'] = 'filtered_html';
/* Relationship: Entity Reference: Referenced Entity */
$handler->display->display_options['relationships']['field_target_nodes_target_id']['id'] = 'field_target_nodes_target_id';
$handler->display->display_options['relationships']['field_target_nodes_target_id']['table'] = 'field_data_field_target_nodes';
$handler->display->display_options['relationships']['field_target_nodes_target_id']['field'] = 'field_target_nodes_target_id';
/* Field: Message: Rendered Message */
$handler->display->display_options['fields']['rendered_entity']['id'] = 'rendered_entity';
$handler->display->display_options['fields']['rendered_entity']['table'] = 'views_entity_message';
$handler->display->display_options['fields']['rendered_entity']['field'] = 'rendered_entity';
$handler->display->display_options['fields']['rendered_entity']['label'] = '';
$handler->display->display_options['fields']['rendered_entity']['element_label_colon'] = FALSE;
$handler->display->display_options['fields']['rendered_entity']['link_to_entity'] = 1;
$handler->display->display_options['fields']['rendered_entity']['display'] = 'view';
$handler->display->display_options['fields']['rendered_entity']['view_mode'] = 'full';
/* Field: Message: Timestamp */
$handler->display->display_options['fields']['timestamp']['id'] = 'timestamp';
$handler->display->display_options['fields']['timestamp']['table'] = 'message';
$handler->display->display_options['fields']['timestamp']['field'] = 'timestamp';
$handler->display->display_options['fields']['timestamp']['label'] = '';
$handler->display->display_options['fields']['timestamp']['element_label_colon'] = FALSE;
$handler->display->display_options['fields']['timestamp']['date_format'] = 'time_ago_dynamic';
/* Sort criterion: Message: Timestamp */
$handler->display->display_options['sorts']['timestamp']['id'] = 'timestamp';
$handler->display->display_options['sorts']['timestamp']['table'] = 'message';
$handler->display->display_options['sorts']['timestamp']['field'] = 'timestamp';
$handler->display->display_options['sorts']['timestamp']['order'] = 'DESC';
/* Contextual filter: Message: Message ID */
$handler->display->display_options['arguments']['mid']['id'] = 'mid';
$handler->display->display_options['arguments']['mid']['table'] = 'message';
$handler->display->display_options['arguments']['mid']['field'] = 'mid';
$handler->display->display_options['arguments']['mid']['default_action'] = 'default';
$handler->display->display_options['arguments']['mid']['default_argument_type'] = 'commons_follow_message';
$handler->display->display_options['arguments']['mid']['summary']['number_of_records'] = '0';
$handler->display->display_options['arguments']['mid']['summary']['format'] = 'default_summary';
$handler->display->display_options['arguments']['mid']['summary_options']['items_per_page'] = '25';
$handler->display->display_options['arguments']['mid']['break_phrase'] = TRUE;
/* Filter criterion: Content: Published or admin */
$handler->display->display_options['filters']['status_extra']['id'] = 'status_extra';
$handler->display->display_options['filters']['status_extra']['table'] = 'node';
$handler->display->display_options['filters']['status_extra']['field'] = 'status_extra';
$handler->display->display_options['filters']['status_extra']['relationship'] = 'field_target_nodes_target_id';
/* Filter criterion: Message: User Follow */
$handler->display->display_options['filters']['cf_user_follow_message']['id'] = 'cf_user_follow_message';
$handler->display->display_options['filters']['cf_user_follow_message']['table'] = 'message';
$handler->display->display_options['filters']['cf_user_follow_message']['field'] = 'cf_user_follow_message';
$handler->display->display_options['filters']['cf_user_follow_message']['value'] = '0';
$handler->display->display_options['filters']['cf_user_follow_message']['exposed'] = TRUE;
$handler->display->display_options['filters']['cf_user_follow_message']['expose']['operator_id'] = '';
$handler->display->display_options['filters']['cf_user_follow_message']['expose']['label'] = 'Show';
$handler->display->display_options['filters']['cf_user_follow_message']['expose']['operator'] = 'cf_user_follow_message_op';
$handler->display->display_options['filters']['cf_user_follow_message']['expose']['identifier'] = 'following';
$handler->display->display_options['filters']['cf_user_follow_message']['expose']['required'] = TRUE;
$handler->display->display_options['filters']['cf_user_follow_message']['expose']['remember'] = TRUE;
$handler->display->display_options['filters']['cf_user_follow_message']['expose']['remember_roles'] = array(
2 => '2',
1 => 0,
);
/* Filter criterion: Message: Message category */
$handler->display->display_options['filters']['type_category']['id'] = 'type_category';
$handler->display->display_options['filters']['type_category']['table'] = 'message';
$handler->display->display_options['filters']['type_category']['field'] = 'type_category';
$handler->display->display_options['filters']['type_category']['value'] = array(
'message_type' => 'message_type',
);
/* Display: Activity (Sidebar) */
$handler = $view->new_display('panel_pane', 'Activity (Sidebar)', 'panel_pane_1');
$handler->display->display_options['defaults']['hide_admin_links'] = FALSE;
$handler->display->display_options['defaults']['use_more'] = FALSE;
$handler->display->display_options['use_more'] = TRUE;
$handler->display->display_options['defaults']['use_more_always'] = FALSE;
$handler->display->display_options['defaults']['use_more_always'] = FALSE;
$handler->display->display_options['use_more_always'] = FALSE;
$handler->display->display_options['defaults']['use_more_text'] = FALSE;
$handler->display->display_options['link_url'] = 'activity';
$handler->display->display_options['defaults']['pager'] = FALSE;
$handler->display->display_options['pager']['type'] = 'some';
$handler->display->display_options['pager']['options']['items_per_page'] = '5';
$handler->display->display_options['pager']['options']['offset'] = '0';
$handler->display->display_options['defaults']['relationships'] = FALSE;
/* Relationship: Entity Reference: Referenced Entity */
$handler->display->display_options['relationships']['field_target_nodes_target_id']['id'] = 'field_target_nodes_target_id';
$handler->display->display_options['relationships']['field_target_nodes_target_id']['table'] = 'field_data_field_target_nodes';
$handler->display->display_options['relationships']['field_target_nodes_target_id']['field'] = 'field_target_nodes_target_id';
$handler->display->display_options['defaults']['arguments'] = FALSE;
$handler->display->display_options['defaults']['filter_groups'] = FALSE;
$handler->display->display_options['defaults']['filters'] = FALSE;
/* Filter criterion: Message: Message category */
$handler->display->display_options['filters']['type_category']['id'] = 'type_category';
$handler->display->display_options['filters']['type_category']['table'] = 'message';
$handler->display->display_options['filters']['type_category']['field'] = 'type_category';
$handler->display->display_options['filters']['type_category']['value'] = array(
'message_type' => 'message_type',
);
/* Filter criterion: Content: Published or admin */
$handler->display->display_options['filters']['status_extra']['id'] = 'status_extra';
$handler->display->display_options['filters']['status_extra']['table'] = 'node';
$handler->display->display_options['filters']['status_extra']['field'] = 'status_extra';
$handler->display->display_options['filters']['status_extra']['relationship'] = 'field_target_nodes_target_id';
/* Display: Activity - Full view */
$handler = $view->new_display('panel_pane', 'Activity - Full view', 'panel_pane_3');
$handler->display->display_options['defaults']['title'] = FALSE;
$handler->display->display_options['defaults']['hide_admin_links'] = FALSE;
$handler->display->display_options['pane_category']['name'] = 'Commons';
$handler->display->display_options['pane_category']['weight'] = '0';
$handler->display->display_options['inherit_panels_path'] = '1';
$translatables['commons_activity_streams_activity'] = array(
t('Master'),
t('Recent site activity'),
t('more'),
t('Apply'),
t('Reset'),
t('Sort by'),
t('Asc'),
t('Desc'),
t('Items per page'),
t('- All -'),
t('Offset'),
t('« first'),
t(' previous'),
t('next '),
t('last »'),
t('Nobody has performed any activity on the site recently.'),
t('Content entity referenced from field_target_nodes'),
t('All'),
t('Show'),
t('Activity (Sidebar)'),
t('Commons'),
t('Activity - Full view'),
);
$export['commons_activity_streams_activity'] = $view;
$view = new view();
$view->name = 'commons_activity_streams_user_activity';
$view->description = '';
$view->tag = 'commons';
$view->base_table = 'message';
$view->human_name = 'Commons Activity Streams (User-specific activity)';
$view->core = 7;
$view->api_version = '3.0';
$view->disabled = FALSE; /* Edit this to true to make a default view disabled initially */
/* Display: Master */
$handler = $view->new_display('default', 'Master', 'default');
$handler->display->display_options['title'] = 'Recent site activity';
$handler->display->display_options['use_ajax'] = TRUE;
$handler->display->display_options['use_more_always'] = FALSE;
$handler->display->display_options['link_display'] = 'custom_url';
$handler->display->display_options['access']['type'] = 'none';
$handler->display->display_options['cache']['type'] = 'none';
$handler->display->display_options['query']['type'] = 'views_query';
$handler->display->display_options['exposed_form']['type'] = 'basic';
$handler->display->display_options['pager']['type'] = 'full';
$handler->display->display_options['pager']['options']['items_per_page'] = '20';
$handler->display->display_options['pager']['options']['offset'] = '0';
$handler->display->display_options['pager']['options']['id'] = '0';
$handler->display->display_options['pager']['options']['quantity'] = '9';
$handler->display->display_options['style_plugin'] = 'default';
$handler->display->display_options['row_plugin'] = 'fields';
/* No results behavior: Global: Text area */
$handler->display->display_options['empty']['area']['id'] = 'area';
$handler->display->display_options['empty']['area']['table'] = 'views';
$handler->display->display_options['empty']['area']['field'] = 'area';
$handler->display->display_options['empty']['area']['empty'] = TRUE;
$handler->display->display_options['empty']['area']['content'] = 'This person hasn\'t performed any activities on the site yet.';
$handler->display->display_options['empty']['area']['format'] = 'filtered_html';
/* Relationship: Entity Reference: Referenced Entity */
$handler->display->display_options['relationships']['field_target_nodes_target_id']['id'] = 'field_target_nodes_target_id';
$handler->display->display_options['relationships']['field_target_nodes_target_id']['table'] = 'field_data_field_target_nodes';
$handler->display->display_options['relationships']['field_target_nodes_target_id']['field'] = 'field_target_nodes_target_id';
/* Field: Message: Rendered Message */
$handler->display->display_options['fields']['rendered_entity']['id'] = 'rendered_entity';
$handler->display->display_options['fields']['rendered_entity']['table'] = 'views_entity_message';
$handler->display->display_options['fields']['rendered_entity']['field'] = 'rendered_entity';
$handler->display->display_options['fields']['rendered_entity']['label'] = '';
$handler->display->display_options['fields']['rendered_entity']['element_label_colon'] = FALSE;
$handler->display->display_options['fields']['rendered_entity']['link_to_entity'] = 1;
$handler->display->display_options['fields']['rendered_entity']['display'] = 'view';
$handler->display->display_options['fields']['rendered_entity']['view_mode'] = 'full';
/* Field: Message: Timestamp */
$handler->display->display_options['fields']['timestamp']['id'] = 'timestamp';
$handler->display->display_options['fields']['timestamp']['table'] = 'message';
$handler->display->display_options['fields']['timestamp']['field'] = 'timestamp';
$handler->display->display_options['fields']['timestamp']['label'] = '';
$handler->display->display_options['fields']['timestamp']['element_label_colon'] = FALSE;
$handler->display->display_options['fields']['timestamp']['date_format'] = 'time_ago_dynamic';
/* Sort criterion: Message: Timestamp */
$handler->display->display_options['sorts']['timestamp']['id'] = 'timestamp';
$handler->display->display_options['sorts']['timestamp']['table'] = 'message';
$handler->display->display_options['sorts']['timestamp']['field'] = 'timestamp';
$handler->display->display_options['sorts']['timestamp']['order'] = 'DESC';
/* Contextual filter: Message: User uid */
$handler->display->display_options['arguments']['user']['id'] = 'user';
$handler->display->display_options['arguments']['user']['table'] = 'message';
$handler->display->display_options['arguments']['user']['field'] = 'user';
$handler->display->display_options['arguments']['user']['default_action'] = 'not found';
$handler->display->display_options['arguments']['user']['default_argument_type'] = 'fixed';
$handler->display->display_options['arguments']['user']['summary']['number_of_records'] = '0';
$handler->display->display_options['arguments']['user']['summary']['format'] = 'default_summary';
$handler->display->display_options['arguments']['user']['summary_options']['items_per_page'] = '25';
/* Filter criterion: Content: Published or admin */
$handler->display->display_options['filters']['status_extra']['id'] = 'status_extra';
$handler->display->display_options['filters']['status_extra']['table'] = 'node';
$handler->display->display_options['filters']['status_extra']['field'] = 'status_extra';
$handler->display->display_options['filters']['status_extra']['relationship'] = 'field_target_nodes_target_id';
/* Filter criterion: Message: Message category */
$handler->display->display_options['filters']['type_category']['id'] = 'type_category';
$handler->display->display_options['filters']['type_category']['table'] = 'message';
$handler->display->display_options['filters']['type_category']['field'] = 'type_category';
$handler->display->display_options['filters']['type_category']['value'] = array(
'message_type' => 'message_type',
);
/* Display: Activity (Sidebar) */
$handler = $view->new_display('panel_pane', 'Activity (Sidebar)', 'panel_pane_1');
$handler->display->display_options['defaults']['hide_admin_links'] = FALSE;
$handler->display->display_options['defaults']['use_more'] = FALSE;
$handler->display->display_options['use_more'] = TRUE;
$handler->display->display_options['defaults']['use_more_always'] = FALSE;
$handler->display->display_options['defaults']['use_more_always'] = FALSE;
$handler->display->display_options['use_more_always'] = FALSE;
$handler->display->display_options['defaults']['use_more_text'] = FALSE;
$handler->display->display_options['defaults']['pager'] = FALSE;
$handler->display->display_options['pager']['type'] = 'load_more';
$handler->display->display_options['pager']['options']['items_per_page'] = '5';
$handler->display->display_options['pager']['options']['offset'] = '0';
$handler->display->display_options['pager']['options']['id'] = '0';
$handler->display->display_options['pager']['options']['quantity'] = '9';
$handler->display->display_options['pane_category']['name'] = 'Commons';
$handler->display->display_options['pane_category']['weight'] = '0';
$handler->display->display_options['argument_input'] = array(
'user' => array(
'type' => 'context',
'context' => 'entity:user.uid',
'context_optional' => 0,
'panel' => '0',
'fixed' => '',
'label' => 'Message: User uid',
),
);
/* Display: Activity - Full view */
$handler = $view->new_display('panel_pane', 'Activity - Full view', 'panel_pane_3');
$handler->display->display_options['defaults']['title'] = FALSE;
$handler->display->display_options['defaults']['hide_admin_links'] = FALSE;
$handler->display->display_options['pane_category']['name'] = 'Commons';
$handler->display->display_options['pane_category']['weight'] = '0';
$translatables['commons_activity_streams_user_activity'] = array(
t('Master'),
t('Recent site activity'),
t('more'),
t('Apply'),
t('Reset'),
t('Sort by'),
t('Asc'),
t('Desc'),
t('Items per page'),
t('- All -'),
t('Offset'),
t('« first'),
t(' previous'),
t('next '),
t('last »'),
t('This person hasn\'t performed any activities on the site yet.'),
t('Content entity referenced from field_target_nodes'),
t('All'),
t('Activity (Sidebar)'),
t('Commons'),
t('Activity - Full view'),
);
$export['commons_activity_streams_user_activity'] = $view;
return $export;
}

View File

@ -1,12 +0,0 @@
<?php
/**
* @file
* commons_activity_streams_groups.features.inc
*/
/**
* Implements hook_views_api().
*/
function commons_activity_streams_groups_views_api($module = NULL, $api = NULL) {
return array("api" => "3.0");
}

View File

@ -1,20 +0,0 @@
name = Commons Activity Streams Groups
description = Integrates site activity with Organic Groups.
package = Commons - Building blocks
core = 7.x
dependencies[] = commons_activity_streams
dependencies[] = entity
dependencies[] = views
dependencies[] = views_content
features[ctools][] = views:views_default:3.0
features[features_api][] = api:2
features[views_view][] = activity_group
; Information added by Drupal.org packaging script on 2015-03-18
version = "7.x-3.23"
core = "7.x"
project = "commons"
datestamp = "1426714630"

View File

@ -1,12 +0,0 @@
<?php
/**
* Add empty text to Commons Activity Streams Groups views.
*/
function commons_activity_streams_groups_update_3101() {
$revert = array(
'commons_activity_streams_groups' => array('views_view'),
);
features_revert($revert);
return array();
}

View File

@ -1,7 +0,0 @@
<?php
/**
* @file
* Code for the Commons Activity Streams Groups feature.
*/
include_once 'commons_activity_streams_groups.features.inc';

View File

@ -1,149 +0,0 @@
<?php
/**
* @file
* commons_activity_streams_groups.views_default.inc
*/
/**
* Implements hook_views_default_views().
*/
function commons_activity_streams_groups_views_default_views() {
$export = array();
$view = new view();
$view->name = 'activity_group';
$view->description = '';
$view->tag = 'Commons';
$view->base_table = 'message';
$view->human_name = 'Commons Activity Streams - Group activity';
$view->core = 7;
$view->api_version = '3.0';
$view->disabled = FALSE; /* Edit this to true to make a default view disabled initially */
/* Display: Master */
$handler = $view->new_display('default', 'Master', 'default');
$handler->display->display_options['title'] = 'Recent activity in this group';
$handler->display->display_options['use_more_always'] = FALSE;
$handler->display->display_options['access']['type'] = 'none';
$handler->display->display_options['cache']['type'] = 'none';
$handler->display->display_options['query']['type'] = 'views_query';
$handler->display->display_options['exposed_form']['type'] = 'basic';
$handler->display->display_options['pager']['type'] = 'some';
$handler->display->display_options['pager']['options']['items_per_page'] = '4';
$handler->display->display_options['pager']['options']['offset'] = '0';
$handler->display->display_options['style_plugin'] = 'default';
$handler->display->display_options['row_plugin'] = 'fields';
/* No results behavior: Global: Text area */
$handler->display->display_options['empty']['area']['id'] = 'area';
$handler->display->display_options['empty']['area']['table'] = 'views';
$handler->display->display_options['empty']['area']['field'] = 'area';
$handler->display->display_options['empty']['area']['empty'] = TRUE;
$handler->display->display_options['empty']['area']['content'] = 'Nobody has performed any activity in this group recently.';
$handler->display->display_options['empty']['area']['format'] = 'filtered_html';
/* Relationship: Entity Reference: Referenced Entity */
$handler->display->display_options['relationships']['field_target_nodes_target_id']['id'] = 'field_target_nodes_target_id';
$handler->display->display_options['relationships']['field_target_nodes_target_id']['table'] = 'field_data_field_target_nodes';
$handler->display->display_options['relationships']['field_target_nodes_target_id']['field'] = 'field_target_nodes_target_id';
$handler->display->display_options['relationships']['field_target_nodes_target_id']['required'] = TRUE;
/* Relationship: OG membership: OG membership from Node */
$handler->display->display_options['relationships']['og_membership_rel']['id'] = 'og_membership_rel';
$handler->display->display_options['relationships']['og_membership_rel']['table'] = 'node';
$handler->display->display_options['relationships']['og_membership_rel']['field'] = 'og_membership_rel';
$handler->display->display_options['relationships']['og_membership_rel']['relationship'] = 'field_target_nodes_target_id';
$handler->display->display_options['relationships']['og_membership_rel']['required'] = TRUE;
/* Field: Message: Rendered Message */
$handler->display->display_options['fields']['rendered_entity']['id'] = 'rendered_entity';
$handler->display->display_options['fields']['rendered_entity']['table'] = 'views_entity_message';
$handler->display->display_options['fields']['rendered_entity']['field'] = 'rendered_entity';
$handler->display->display_options['fields']['rendered_entity']['label'] = '';
$handler->display->display_options['fields']['rendered_entity']['element_label_colon'] = FALSE;
$handler->display->display_options['fields']['rendered_entity']['link_to_entity'] = 0;
$handler->display->display_options['fields']['rendered_entity']['display'] = 'view';
$handler->display->display_options['fields']['rendered_entity']['view_mode'] = 'full';
/* Field: Message: Timestamp */
$handler->display->display_options['fields']['timestamp']['id'] = 'timestamp';
$handler->display->display_options['fields']['timestamp']['table'] = 'message';
$handler->display->display_options['fields']['timestamp']['field'] = 'timestamp';
$handler->display->display_options['fields']['timestamp']['label'] = '';
$handler->display->display_options['fields']['timestamp']['element_label_colon'] = FALSE;
$handler->display->display_options['fields']['timestamp']['date_format'] = 'time_ago_dynamic';
/* Sort criterion: Message: Timestamp */
$handler->display->display_options['sorts']['timestamp']['id'] = 'timestamp';
$handler->display->display_options['sorts']['timestamp']['table'] = 'message';
$handler->display->display_options['sorts']['timestamp']['field'] = 'timestamp';
$handler->display->display_options['sorts']['timestamp']['order'] = 'DESC';
/* Contextual filter: OG membership: Group ID */
$handler->display->display_options['arguments']['gid']['id'] = 'gid';
$handler->display->display_options['arguments']['gid']['table'] = 'og_membership';
$handler->display->display_options['arguments']['gid']['field'] = 'gid';
$handler->display->display_options['arguments']['gid']['relationship'] = 'og_membership_rel';
$handler->display->display_options['arguments']['gid']['default_action'] = 'not found';
$handler->display->display_options['arguments']['gid']['default_argument_type'] = 'fixed';
$handler->display->display_options['arguments']['gid']['summary']['number_of_records'] = '0';
$handler->display->display_options['arguments']['gid']['summary']['format'] = 'default_summary';
$handler->display->display_options['arguments']['gid']['summary_options']['items_per_page'] = '25';
/* Filter criterion: Content: Published or admin */
$handler->display->display_options['filters']['status_extra']['id'] = 'status_extra';
$handler->display->display_options['filters']['status_extra']['table'] = 'node';
$handler->display->display_options['filters']['status_extra']['field'] = 'status_extra';
$handler->display->display_options['filters']['status_extra']['relationship'] = 'field_target_nodes_target_id';
/* Filter criterion: Message: Message category */
$handler->display->display_options['filters']['type_category']['id'] = 'type_category';
$handler->display->display_options['filters']['type_category']['table'] = 'message';
$handler->display->display_options['filters']['type_category']['field'] = 'type_category';
$handler->display->display_options['filters']['type_category']['value'] = array(
'message_type' => 'message_type',
);
/* Filter criterion: OG membership: Group_type */
$handler->display->display_options['filters']['group_type']['id'] = 'group_type';
$handler->display->display_options['filters']['group_type']['table'] = 'og_membership';
$handler->display->display_options['filters']['group_type']['field'] = 'group_type';
$handler->display->display_options['filters']['group_type']['relationship'] = 'og_membership_rel';
$handler->display->display_options['filters']['group_type']['value'] = array(
'node' => 'node',
);
/* Display: Content pane */
$handler = $view->new_display('panel_pane', 'Content pane', 'panel_pane_1');
$handler->display->display_options['defaults']['hide_admin_links'] = FALSE;
$handler->display->display_options['pane_category']['name'] = 'Commons';
$handler->display->display_options['pane_category']['weight'] = '0';
$handler->display->display_options['allow']['use_pager'] = 0;
$handler->display->display_options['allow']['items_per_page'] = 'items_per_page';
$handler->display->display_options['allow']['offset'] = 0;
$handler->display->display_options['allow']['link_to_view'] = 0;
$handler->display->display_options['allow']['more_link'] = 0;
$handler->display->display_options['allow']['path_override'] = 0;
$handler->display->display_options['allow']['title_override'] = 0;
$handler->display->display_options['allow']['exposed_form'] = 0;
$handler->display->display_options['allow']['fields_override'] = 0;
$handler->display->display_options['argument_input'] = array(
'gid' => array(
'type' => 'user',
'context' => 'entity:comment.author',
'context_optional' => 0,
'panel' => '0',
'fixed' => '',
'label' => 'OG membership: Group ID',
),
);
$translatables['activity_group'] = array(
t('Master'),
t('Recent activity in this group'),
t('more'),
t('Apply'),
t('Reset'),
t('Sort by'),
t('Asc'),
t('Desc'),
t('Nobody has performed any activity in this group recently.'),
t('Content entity referenced from field_target_nodes'),
t('OG membership from node'),
t('All'),
t('Content pane'),
t('Commons'),
);
$export['activity_group'] = $view;
return $export;
}

View File

@ -1,35 +0,0 @@
<?php
/**
* @file
* commons_body.features.field_base.inc
*/
/**
* Implements hook_field_default_field_bases().
*/
function commons_body_field_default_field_bases() {
$field_bases = array();
// Exported field_base: 'body'
$field_bases['body'] = array(
'active' => 1,
'cardinality' => 1,
'deleted' => 0,
'entity_types' => array(
0 => 'node',
),
'field_name' => 'body',
'indexes' => array(
'format' => array(
0 => 'format',
),
),
'locked' => 0,
'module' => 'text',
'settings' => array(),
'translatable' => 0,
'type' => 'text_with_summary',
);
return $field_bases;
}

View File

@ -1,18 +0,0 @@
name = Commons Body Field
description = Provides a simple body field for re-use by various Commons content types.
package = Commons - Building blocks
core = 7.x
dependencies[] = features
dependencies[] = field_sql_storage
dependencies[] = text
features[features_api][] = api:2
features[field_base][] = body
; Information added by Drupal.org packaging script on 2015-03-18
version = "7.x-3.23"
core = "7.x"
project = "commons"
datestamp = "1426714630"

View File

@ -1,5 +0,0 @@
<?php
/**
* @file
* Drupal needs this blank file.
*/

View File

@ -1,4 +0,0 @@
/plugins/quicktabs_styles/commons_origins/.sass-cache/
/plugins/quicktabs_styles/commons_origins_tabs/.sass-cache/
/plugins/quicktabs_styles/commons_pills/.sass-cache/
/plugins/quicktabs_styles/commons_tabs/.sass-cache/

View File

@ -1,35 +0,0 @@
<?php
/**
* @file
* commons_bw.features.field_base.inc
*/
/**
* Implements hook_field_default_field_bases().
*/
function commons_bw_field_default_field_bases() {
$field_bases = array();
// Exported field_base: 'title_field'
$field_bases['title_field'] = array(
'active' => 1,
'cardinality' => 1,
'deleted' => 0,
'entity_types' => array(),
'field_name' => 'title_field',
'indexes' => array(
'format' => array(
0 => 'format',
),
),
'locked' => 0,
'module' => 'text',
'settings' => array(
'max_length' => 255,
),
'translatable' => 1,
'type' => 'text',
);
return $field_bases;
}

View File

@ -1,73 +0,0 @@
<?php
/**
* @file
* commons_bw.features.field_instance.inc
*/
/**
* Implements hook_field_default_field_instances().
*/
function commons_bw_field_default_field_instances() {
$field_instances = array();
foreach (node_type_get_types() as $node_type) {
if (commons_bw_node_auto_title_instance($node_type->type)) {
commons_bw_field_definition($field_instances, $node_type->type);
}
}
// Translatables
// Included for use with string extractors like potx.
t('Title');
return $field_instances;
}
/**
* Creates field instance definitions for all node types.
*/
function commons_bw_field_definition(&$field_instances, $bundle) {
// Exported field_instance: 'node-[Bundle]-title_field'
$field_instances["node-$bundle-title_field"] = array(
'bundle' => $bundle,
'default_value' => NULL,
'deleted' => '0',
'description' => '',
'display' => array(
'default' => array(
'label' => 'above',
'settings' => array(),
'type' => 'hidden',
'weight' => -50,
),
'teaser' => array(
'label' => 'above',
'settings' => array(),
'type' => 'hidden',
'weight' => -50,
),
),
'display_in_partial_form' => !empty($display_in_partial_form[$bundle]),
'entity_type' => 'node',
'field_name' => 'title_field',
'label' => 'Title',
'required' => 1,
'settings' => array(
'hide_label' => array(
'entity' => 0,
'page' => 0,
),
'text_processing' => '0',
'user_register_form' => FALSE,
),
'widget' => array(
'active' => 1,
'module' => 'text',
'settings' => array(
'size' => '60',
),
'type' => 'text_textfield',
'weight' => -50,
),
);
}

View File

@ -1,24 +0,0 @@
<?php
/**
* @file
* commons_bw.features.inc
*/
/**
* Implements hook_ctools_plugin_directory().
*/
function commons_bw_ctools_plugin_directory($module, $plugin) {
if ($module == 'ctools' && $plugin == 'content_types') {
return 'plugins/' . $plugin;
}
}
/**
* Implements hook_views_api().
*/
function commons_bw_views_api() {
return array(
'api' => 3,
'path' => drupal_get_path('module', 'commons_bw') . '/includes/views',
);
}

View File

@ -1,23 +0,0 @@
name = Commons Browsing Widget
description = Provides a single content area with multiple panels for adding and browsing content by content type.
package = Commons - Building blocks
core = 7.x
dependencies[] = commons_groups
dependencies[] = features
dependencies[] = og
dependencies[] = quicktabs
dependencies[] = quicktabs_tabstyles
dependencies[] = title
features[features_api][] = api:2
features[field_base][] = title_field
files[] = includes/views/handlers/commons_bw_handler_node_partial_form.inc
; Information added by Drupal.org packaging script on 2015-03-18
version = "7.x-3.23"
core = "7.x"
project = "commons"
datestamp = "1426714630"

View File

@ -1,45 +0,0 @@
<?php
/**
* Add the Title field to all browsing widget-enabled content types.
* per http://drupal.org/node/1969088.
*/
function commons_bw_update_7301() {
module_enable(array('title'));
$revert = array(
'commons_bw' => array(
'field_base', 'field_instance',
),
);
features_revert($revert);
return array();
}
/**
* Make sure existing nodes titles are migrated to the title field.
* per http://drupal.org/node/1969088.
*/
function commons_bw_update_7302() {
foreach (node_type_get_types() as $node_type) {
// Set the title as "Replaced by title_field".
if (!title_field_replacement_enabled('node', $node_type->type, 'title')) {
title_field_replacement_toggle('node', $node_type->type, 'title');
}
// Migrate the titles to the title field.
title_field_replacement_batch_set('node', $node_type->type, 'title');
}
drupal_flush_all_caches();
}
/**
* Standardize browsing widget field weights.
*/
function commons_bw_update_7303() {
$revert = array(
'commons_bw' => array('field_instance'),
);
features_revert($revert);
return array();
}

View File

@ -1,505 +0,0 @@
<?php
/**
* @file
* Code for the Commons Browsing Widget feature.
*/
include_once 'commons_bw.features.inc';
/**
* Implements hook_hook_info().
*/
function commons_bw_hook_info() {
$hooks = array(
'commons_bw_group_widget',
'commons_bw_create_all_widget',
);
return array_fill_keys($hooks, array('group' => 'commons'));
}
/**
* Implements hook_system_info_alter().
*/
function commons_bw_system_info_alter(&$info, $file, $type) {
// Commons BW dynamically adds the title_field field to content types that
// request it.
// We must add a corresponding line for each field instance to commons_bw.info
// so that Features is aware of the instance and can successfully revert the
// field_instance component back to its default state.
if ($file->name == 'commons_bw') {
foreach (node_type_get_types() as $node_type_object) {
$node_type = $node_type_object->type;
if (commons_bw_node_auto_title_instance($node_type)) {
$info['features']['field_instance'][] = "node-$node_type-title_field";
}
}
}
// Dynamically adding a field to a content type results in features
// automatically detecting Commons BW as a dependency.
// We manually exclude the dependency in order to prevent the content type
// modules from appearing overridden and to allow them to be used
// independently of Commons BW.
$node_types = &drupal_static(__FUNCTION__);
if (!isset($node_types)) {
foreach (module_implements('node_info') as $module) {
$node_types[$module] = call_user_func($module . '_node_info');
}
}
if (isset($node_types[$file->name])) {
foreach ($node_types[$file->name] as $node_type => $node_info) {
if (commons_bw_node_auto_title_instance($node_type)) {
$info['features_exclude']['dependencies']['commons_bw'] = 'commons_bw';
}
}
}
}
/**
* Implements hook_modules_enabled().
*/
function commons_bw_modules_enabled($modules) {
// Ensure that dynamically added title_field fields are in the default state
// when modules that provide content types are enabled.
foreach ($modules as $module) {
if (module_hook($module, 'node_info')) {
features_revert(array('commons_bw' => array('field_instance')));
}
}
}
/**
* Implements hook_forms().
*
* The bundle is added to the partial node form ID, to prevent duplicate IDs on
* the same page, but all of the partial forms are built with the same function.
*/
function commons_bw_forms($form_id, $args) {
$forms = array();
if (strpos($form_id, 'commons_bw_partial_node_form__') === 0) {
$forms[$form_id] = array(
'callback' => 'commons_bw_partial_node_form',
);
}
return $forms;
}
/**
* Implements hook_form_FORM_ID_alter().
*/
function commons_bw_form_views_exposed_form_alter(&$form, &$form_state, $form_id) {
// Implements tweaks to exposed filters and sorts per the Commons designs.
if (strpos($form['#id'],'views-exposed-form-commons-bw') === 0) {
// Remove the sort order (eg, descending vs ascending).
$form['sort_order']['#access'] = FALSE;
$form['sort_by']['#title'] = t('Sorted by');
}
}
/**
* Implements hook_form_FORM_ID_alter().
*
* Add a setting to group content fields, to determine whether they will be
* displayed on the mini node form of the browsing widget.
*/
function commons_bw_form_field_ui_field_edit_form_alter(&$form, &$form_state, $form_id) {
if (!og_is_group_content_type($form['instance']['entity_type']['#value'], $form['instance']['bundle']['#value'])) {
return;
}
// See if we're building for the first time, or getting pre-saved values.
$field_name = $form['#field']['field_name'];
if(!empty($form_state['field'][$field_name][LANGUAGE_NONE]['instance']['display_in_partial_form'])) {
$display_default = $form_state['field'][$field_name][LANGUAGE_NONE]['instance']['display_in_partial_form'];
}
else if (isset($form_state['build_info']['args'][0]['display_in_partial_form'])) {
$display_default = $form_state['build_info']['args'][0]['display_in_partial_form'];
}
else {
$display_default = FALSE;
}
$form['instance']['display_in_partial_form'] = array(
'#type' => 'checkbox',
'#title' => t('Display in the browsing widget mini-form'),
'#default_value' => $display_default,
);
}
/**
* Partial node form for the browsing widget.
*/
function commons_bw_partial_node_form($form, &$form_state, $bundle, $group_id = NULL) {
global $user;
global $language;
if (!$group_id) {
// Reset the og_field_widget_form cache because otherwise it ignores
// multiple tries to render the same group audience widget (We have the
// same group audience widget on the All and Posts tabs, when displaying
// this form without group context).
drupal_static_reset('og_field_widget_form');
}
if ($group_id) {
$form_state['group_id'] = $group_id;
}
$instances = field_info_instances('node', $bundle);
// Remove all fields except those marked as "display_in_partial_form".
foreach($instances as $field_name => $instance) {
if (empty($instance['display_in_partial_form'])) {
unset($instances[$field_name]);
}
}
// Make sure there's a field left to display.
if (empty($instances)) {
return $form;
}
// Create a dummy node for field_attach_form().
$node = new stdClass();
$node->type = $bundle;
node_object_prepare($node);
if (module_exists('locale')) {
if (locale_multilingual_node_type($node->type)) {
$node->language = $language->language;
}
else {
$default = language_default();
$node->language = $default->language;
}
}
else {
$node->language = LANGUAGE_NONE;
}
field_attach_form('node', $node, $form, $form_state, entity_language('node', $node));
foreach(element_children($form) as $field_name) {
if (empty($instances[$field_name])) {
$form[$field_name]['#access'] = FALSE;
}
}
if (!empty($form['#metatags'])) {
unset($form['#metatags']);
}
// When not in a group context, enable the group audience widget.
$form[OG_AUDIENCE_FIELD]['#weight'] = 100;
$form[OG_AUDIENCE_FIELD]['#access'] = !$group_id;
// Add a default form title.
$form['title'] = array(
'#markup' => t('Create content'),
'#weight' => -100,
);
// Display the user's picture.
$wrapper = entity_metadata_wrapper('user', $user);
$path = empty($user->picture) ? variable_get('user_picture_default') : $wrapper->value()->picture->uri;
$form['user_picture'] = array(
'#theme' => 'image_style',
'#style_name' => '50x50_avatar',
'#path' => $path,
'#prefix' => '<div class="user-picture">',
'#suffix' => '</div>',
'#weight' => -20,
);
$form['actions'] = array(
'#type' => 'actions',
'#weight' => 200,
);
$form['actions']['submit'] = array(
'#type' => 'submit',
'#value' => t('Save'),
);
// Attach the browsing widget JS and give it a higher weight than
// quicktabs.js.
$form['#attached']['js'][] = array(
'data' => drupal_get_path('module', 'commons_bw') . '/js/partial_node_form.js',
'type' => 'file',
'weight' => 100,
);
// Add in some descriptive classes for css down the line.
$form['#attributes']['class'][] = 'node';
$form['#attributes']['class'][] = 'commons-bw-partial-node-form';
$form['#attributes']['class'][] = 'commons-bw-partial-node-form-' . $bundle;
// Add a link to the full node form.
$form['full_form'] = array(
'#theme' => 'link',
'#text' => t('Go to full form'),
'#path' => 'node/add/' . str_replace('_', '-', $bundle),
'#options' => array(
'attributes' => array('class' => array('full-form')),
'html' => FALSE,
),
'#weight' => 100,
);
if ($group_id) {
$form['full_form']['#options']['query'] = array(OG_AUDIENCE_FIELD => $group_id);
}
// Add the commons_bw after build first, in case other pre-renders needs need
// to address fields by there CSS ID.
array_unshift($form['#pre_render'], 'commons_bw_partial_node_form_after_build');
$form['#validate'][] = 'commons_bw_partial_node_form_validate';
return $form;
}
/**
* After-build call-back. See commons_bw_partial_node_form().
*/
function commons_bw_partial_node_form_after_build($form) {
$bundle = $form['#bundle'];
// Add the node's bundle to the IDs of inputs, to avoid having duplicate IDs.
$id_suffix = '-' . str_replace('_', '-', $bundle);
foreach(element_children($form) as $field_name) {
if (!empty($form[$field_name]['#language'])) {
$language = $form[$field_name]['#language'];
if (!empty($form[$field_name][$language][0]['value']['#id'])) {
$form[$field_name][$language][0]['value']['#id'] .= $id_suffix;
}
if (!empty($form[$field_name][$language][0]['default']['#id'])) {
$form[$field_name][$language][0]['default']['#id'] .= $id_suffix;
}
}
}
// Set the form action to the form's tab.
$tabs = commons_bw_get_tab_definitions();
// Search for the tab displaying the current bundle.
foreach ($tabs as $tab_id => $settings) {
if ($settings['bundle'] == $bundle) {
break;
}
}
$form['#action'] = url(current_path(), array('query' => array('qt-commons_bw' => $tab_id)));
return $form;
}
/**
* Validation handler; Attach the node validation to the partial node form.
*/
function commons_bw_partial_node_form_validate($form, $form_state) {
$node = $form['#entity'];
field_attach_validate('node', $node);
node_validate($node, $form, $form_state);
if ((!module_exists('commons_trusted_contacts') || (module_exists('commons_trusted_contacts') && !module_exists('og_access'))) && empty($form_state['group_id']) && empty($form_state['values'][OG_AUDIENCE_FIELD][LANGUAGE_NONE][0])) {
form_set_error(OG_AUDIENCE_FIELD, t('Please enter one or more groups where this content will be posted.'));
return FALSE;
}
}
/**
* Submit handler; Create a node from the partial node form.
*/
function commons_bw_partial_node_form_submit($form, $form_state) {
$node = $form['#entity'];
node_submit($node);
// Mark the node as created with the partial form
$node->partial_node_form = TRUE;
field_attach_submit('node', $node, $form, $form_state);
$wrapper = entity_metadata_wrapper('node', $node);
// If the node has a body and doesn't has a title, create a title from the
// body.
if ((empty($wrapper->title_field) || !$wrapper->title_field->value()) && empty($node->title)) {
if (!empty($wrapper->body) && $wrapper->body->value()) {
$title = htmlspecialchars_decode($wrapper->body->value->value());
// Strip tags and whitespaces.
$title = preg_replace('/[\t\n\r\0\x0B]/', '', strip_tags($title));
// Shorten the title.
$node->title = truncate_utf8($title, 30, TRUE, TRUE);
}
}
// Set the group audience.
if (!empty($form_state['group_id'])) {
$wrapper->{OG_AUDIENCE_FIELD}->set(array($form_state['group_id']));
}
$node->form_state = $form_state;
$wrapper->save();
// Notify about the node creation.
$arguments = array('@type' => node_type_get_name($node), '%title' => $node->title);
drupal_set_message(t('@type %title has been created.', $arguments));
}
/**
* Get a list of modules that add content to a particular type of widget.
*
* The only currently supported widget type is 'group', but this
* could be extended to support other entities.
*
* @param $widget_type
* An optional type of widget to restrict results to, defaults to 'group'.
*
* @return array
* An array of return values of the hook implementations.
*/
function commons_bw_get_tab_definitions($widget_type = 'group') {
$hook_name = 'commons_bw_' . $widget_type . '_widget';
$tabs = module_invoke_all($hook_name);
drupal_alter($hook_name, $tabs);
return $tabs;
}
/**
* Helper function to determine whether Commons_BW should define a title field
* instance on behalf of a content type.
*
* @param $node_type
* The type of the node to check auto title settings for.
*
* @return boolean
* The value of the auto title setting if available, TRUE otherwise.
*/
function commons_bw_node_auto_title_instance($node_type) {
$commons_groups_entity_types = commons_groups_get_group_content_entity_types();
return isset($commons_groups_entity_types['node'][$node_type]['auto_title_instance']) ? $commons_groups_entity_types['node'][$node_type]['auto_title_instance'] : TRUE;
}
/**
* Provides a styled content creation dropdown widget for the 'all' tab of the
* group homepage browsing widget.
*
* @param $group
* The group node associated with the group homepage.
*
* @return string
* The content creation dropdown widget HTML.
*/
function commons_bw_create_all_widget($group) {
$links = array();
// Collect definitions from implementing modules.
$items = module_invoke_all('commons_bw_create_all_widget', $group);
uasort($items, 'element_sort');
foreach ($items as $module => $item) {
$links[] = $item['link'] . ' ' . $item['text'];
// Populate the default content creation link.
if (isset($item['default']) && $item['default']) {
$default = $item;
}
}
$output = '';
if (!empty($default)) {
$output .= $default['link'] . '<a class="commons-bw-create-choose"><span></span></a>';
}
$output .= '<div class="commons-bw-create-choose-bg"></div><div class="commons-bw-create-choose-holder">' . theme('item_list', array('items' => $links, 'type' => 'ul', 'attributes' => array('class' => 'commons-bw-create-all-widget-types'))) . '</div>';
return $output;
}
/**
* Generate a renderable group widget.
*
* @param $group
* An optional group node to be used as a tab and views argument.
*
* @return array
* An array in the format expected by drupal_render().
*/
function commons_bw_generate_group_widget($group = NULL) {
// Prepare an array of default quicktabs settings.
$settings = array(
'style' => 'Commons Pills',
'ajax' => FALSE,
'html' => TRUE,
);
// Load the browsing widget tab definitions.
$tabs = commons_bw_get_tab_definitions('group');
foreach ($tabs as $machine_name => $tab_settings) {
// Populate the group argument.
$tabs[$machine_name]['args'] = $group ? $group->nid : 0;
// Add the result count to the title for 'view' tabs.
if ($tab_settings['type'] == 'view') {
// Get the view specified by the tab settings.
$view = views_get_view($tab_settings['vid']);
// If the tab specified a view display use it, otherwise the view will be
// rendered using the default display.
if (isset($tab_settings['display'])) {
$view->set_display($tab_settings['display']);
}
// If the tab references a group, set it as a tab argument.
if ($group) {
$view->set_arguments(array($group->nid));
}
$view->display_handler->options['filters']['flagged']['value'] = 'All';
$view->get_total_rows = TRUE;
$view->execute();
// Append the result count to the tab title.
$tabs[$machine_name]['title'] = $tabs[$machine_name]['title'] . ' <span class="commons-bw-result-count">'. $view->total_rows . '</span>';
}
// Use the current tab as the quicktabs default if the tab settings specify.
if (!empty($tabs[$machine_name]['default'])) {
$settings['default_tab'] = $machine_name;
}
}
return quicktabs_build_quicktabs('commons_bw', $settings, $tabs);
}
/**
* Implements hook_quicktabs_tabstyles().
*/
function commons_bw_quicktabs_tabstyles() {
$path = drupal_get_path('module', 'commons_bw');
return array(
$path . '/plugins/quicktabs_styles/commons_pills/commons_pills.css' => t('Commons Pills'),
$path . '/plugins/quicktabs_styles/commons_tabs/commons_tabs.css' => t('Commons Tabs'),
);
}

View File

@ -1,18 +0,0 @@
<?php
/**
* Implements hook_views_data()
*/
function commons_bw_views_data() {
$data = array();
$data['views']['commons_bw_node_partial_form'] = array(
'title' => t('Node partial form'),
'help' => t('Display a minified node creation form.'),
'area' => array(
'handler' => 'commons_bw_handler_node_partial_form',
),
);
return $data;
}

View File

@ -1,52 +0,0 @@
<?php
/**
* Minified node creation form.
*/
class commons_bw_handler_node_partial_form extends views_handler_area {
function option_definition() {
$options = parent::option_definition();
$options['bundle'] = array('default' => NULL);
return $options;
}
function options_form(&$form, &$form_state) {
$bundles = og_get_all_group_content_bundle();
$form['bundle'] = array(
'#type' => 'select',
'#title' => t('Node type'),
'#options' => !empty($bundles['node']) ? $bundles['node'] : array(),
'#default_value' => $this->options['bundle'],
'#required' => TRUE,
);
}
function render($empty = FALSE) {
$cache = &drupal_static(__METHOD__, array());
$bundle = $this->options['bundle'];
$group_id = !empty($this->view->args[0]) ? $this->view->args[0] : NULL;
// Verify content creation access.
$permission = "create $bundle content";
if ($group_id && !og_user_access('node', $group_id, $permission)) {
return;
}
elseif (!user_access($permission)) {
return;
}
// Avoid rendering a form for the same bundle twice; Instead, mark that it
// should be moved to this position from previously rendered form.
// See partial_node_form.js.
if (!empty($cache[$bundle])) {
return '<div class="partial-node-form-placeholder" data-bundle="' . $bundle . '"></div>';
}
$cache[$bundle] = TRUE;
$form = drupal_get_form("commons_bw_partial_node_form__$bundle", $bundle, $group_id);
return render($form);
}
}

View File

@ -1,82 +0,0 @@
(function ($) {
/**
* Handles presentation of multiple partial forms of the same node bundle; When
* showing a tab, check if it has a form's placeholder and if so, move the form
* to the current tab and move the placeholder to the former form's tab.
*/
Drupal.behaviors.commonsBwPartialNodeForm = {
attach: function (context, settings) {
$('.quicktabs-tabs a', context).click(function(){
var $activeTab = $('#quicktabs-container-commons_bw .quicktabs-tabpage:not(.quicktabs-hide)', context);
// Check for a form placeholder.
var $placeholder = $activeTab.find('.partial-node-form-placeholder');
if (!$placeholder.length) {
return;
}
var $form = $('.commons-bw-partial-node-form-' + $placeholder.data('bundle'), context);
var $originalParent = $form.parent();
// Replace the placeholder and the form.
$form.appendTo($placeholder.parent());
$placeholder.appendTo($originalParent);
});
}
}
/**
* Expand a form when it is focused.
*/
Drupal.behaviors.commonsBwExpandableForm = {
attach: function (context, settings) {
$('.commons-bw-partial-node-form', context).once('commonsBwExpandableForm', function () {
// Assemble the variables.
var form = $(this),
toggleText = Drupal.t('Collapse the form'),
toggle = $('<a/>').attr({
'class': 'expandable-form-toggle element-hidden',
'href': '#',
'title': toggleText
}).append(toggleText),
triggerField = form.find('.trigger-field'),
fullFormLink = form.find('a.full-form'),
hideables = form.find('.hideable-field'),
errors = form.find('.error');
// Determine if the form has any errors.
if (!errors.length) {
// Forms with errors are shown expanded, so only add the toggle link to
// the top of forms which are error free.
form.prepend(toggle).addClass('expandable-form compact-form');
// Hide the hidden fields on load.
hideables.addClass('element-invisible');
}
else {
// The full form link is only shown on collapsed forms so it is hidden
// for consistency.
fullFormLink.addClass('element-hidden');
}
// Make all hidden fields visible when the trigger field comes into
// focus.
triggerField.find('textarea, input').focus(function () {
form.addClass('expanded-form').removeClass('compact-form');
toggle.removeClass('element-hidden');
hideables.removeClass('element-invisible');
fullFormLink.addClass('element-hidden');
});
// Hide all the hidden fields when the trigger link is clicked.
toggle.click(function () {
form.addClass('compact-form').removeClass('expanded-form');
toggle.addClass('element-hidden');
hideables.addClass('element-invisible');
fullFormLink.removeClass('element-hidden');
return false;
});
});
}
}
})(jQuery);

View File

@ -1,42 +0,0 @@
<?php
/**
* Plugins are described by creating a $plugin array which will be used
* by the system that includes this file.
*/
$plugin = array(
'title' => t('Commons Group Browsing widget'),
'description' => t('Commons Group Browsing widget.'),
'category' => t('Commons'),
'single' => TRUE,
'content type' => 'commons_bw_group',
'all contexts' => TRUE,
);
/**
* Output function for the '[content_type]' content type.
*/
function commons_bw_commons_bw_group_content_type_render($subtype, $conf, $panel_args, $context) {
$context = array_shift($context);
$node = !empty($context->data) ? $context->data : NULL;
$block = new stdClass();
$block->title = '';
$widget = commons_bw_generate_group_widget($node);
$block->content = drupal_render($widget['content']);
return $block;
}
/**
* Returns an edit form for the custom type.
*/
function commons_bw_commons_bw_group_content_type_edit_form($form, $form_state) {
return $form;
}
/**
* Returns an edit form for the custom type.
*/
function commons_bw_commons_bw_group_content_type_edit_form_submit($form, $form_state) {
return $form;
}

View File

@ -1,147 +0,0 @@
.quicktabs-style-commons-pills ul.quicktabs-tabs {
margin: 0 0 30px 0;
padding: 0;
}
.block-content .quicktabs-style-commons-pills ul.quicktabs-tabs {
padding: 0;
}
.quicktabs-style-commons-pills ul.quicktabs-tabs li {
display: inline-block;
padding: 0;
margin: 0 12px 0 0;
}
.quicktabs-style-commons-pills ul.quicktabs-tabs li a {
background-color: #f1f1f1;
-moz-border-radius: 3px;
-webkit-border-radius: 3px;
border-radius: 3px;
padding: 3px 10px 3px 6px;
display: block;
color: #a5a3a3;
}
.quicktabs-style-commons-pills ul.quicktabs-tabs li a:hover {
text-decoration: none;
}
.quicktabs-style-commons-pills ul.quicktabs-tabs li a span {
color: #3f3d3d;
font-size: .7em;
}
.quicktabs-style-commons-pills ul.quicktabs-tabs li.active a {
background-color: #00568c;
color: #fff;
position: relative;
}
.quicktabs-style-commons-pills ul.quicktabs-tabs li.active a:after {
content: '';
width: 0px;
height: 0px;
display: block;
border-style: solid;
border-width: 5px 7.5px 0 7.5px;
border-color: #00568c transparent transparent transparent;
position: absolute;
top: 100%;
left: 50%;
margin-left: -7.5px;
}
.quicktabs-style-commons-pills ul.quicktabs-tabs li.active a span {
color: #fff;
}
#quicktabs-tab-commons_bw-commons_all:before {
content: '';
background: url('images/icons-saf2440b105.png') 0 -31px no-repeat;
width: 11px;
height: 11px;
display: inline-block;
margin-right: 3px;
position: relative;
top: 1px;
}
ul.quicktabs-style-commons-pills li.active #quicktabs-tab-commons_bw-commons_all:before {
background-position: 0 0;
}
#quicktabs-tab-commons_bw-commons_posts:before {
content: '';
background: url('images/icons-saf2440b105.png') 0 -285px no-repeat;
width: 11px;
height: 11px;
display: inline-block;
margin-right: 3px;
position: relative;
top: 1px;
}
ul.quicktabs-style-commons-pills li.active #quicktabs-tab-commons_bw-commons_posts:before {
background-position: 0 -254px;
}
#quicktabs-tab-commons_bw-commons_documents:before {
content: '';
background: url('images/icons-saf2440b105.png') 0 -94px no-repeat;
width: 9px;
height: 12px;
display: inline-block;
margin-right: 3px;
position: relative;
top: 1px;
}
ul.quicktabs-style-commons-pills li.active #quicktabs-tab-commons_bw-commons_documents:before {
background-position: 0 -62px;
}
#quicktabs-tab-commons_bw-commons_q_a:before {
content: '';
background: url('images/icons-saf2440b105.png') 0 -349px no-repeat;
width: 13px;
height: 13px;
display: inline-block;
margin-right: 3px;
position: relative;
top: 1px;
}
ul.quicktabs-style-commons-pills li.active #quicktabs-tab-commons_bw-commons_q_a:before {
background-position: 0 -316px;
}
#quicktabs-tab-commons_bw-commons_ideas:before {
content: '';
background: url('images/icons-saf2440b105.png') 0 -159px no-repeat;
width: 8px;
height: 13px;
display: inline-block;
margin-right: 3px;
position: relative;
top: 1px;
}
ul.quicktabs-style-commons-pills li.active #quicktabs-tab-commons_bw-commons_ideas:before {
background-position: 0 -126px;
}
#quicktabs-tab-commons_bw-commons_wikis:before {
content: '';
background: url('images/icons-saf2440b105.png') 0 -415px no-repeat;
width: 13px;
height: 13px;
display: inline-block;
margin-right: 3px;
position: relative;
top: 1px;
}
ul.quicktabs-style-commons-pills li.active #quicktabs-tab-commons_bw-commons_wikis:before {
background-position: 0 -382px;
}
#quicktabs-tab-commons_bw-commons_polls:before {
content: '';
background: url('images/icons-saf2440b105.png') 0 -223px no-repeat;
width: 11px;
height: 11px;
display: inline-block;
margin-right: 3px;
position: relative;
top: 1px;
}
ul.quicktabs-style-commons-pills li.active #quicktabs-tab-commons_bw-commons_polls:before {
background-position: 0 -192px;
}

View File

@ -1,155 +0,0 @@
@import 'compass';
$icons: sprite-map('icons/*.png', $spacing: 20px);
@mixin sprite_url_height_width($sprite_name, $image_name) {
background: sprite($sprite_name, $image_name) no-repeat;
width: image-width(sprite-file($sprite_name, $image_name));
height: image-height(sprite-file($sprite_name, $image_name));
display: inline-block;
margin-right: 3px;
position: relative;
top: 1px;
}
@mixin sprite_url_position($sprite_name, $image_name) {
background-position: sprite-position($sprite_name, $image_name);
}
$link_color: #a5a3a3;
.quicktabs-style-commons-pills {
ul.quicktabs-tabs {
margin: 0 0 30px 0;
padding: 0;
.block-content & {
padding: 0;
}
li {
display: inline-block;
padding: 0;
margin: 0 12px 0 0;
a {
background-color: #f1f1f1;
@include border-radius(3px);
padding: 3px 10px 3px 6px;
display: block;
color: $link_color;
&:hover {
text-decoration: none;
}
span {
color: darken($link_color, 40%);
font-size: .7em;
}
}
&.active a {
background-color: #00568c;
color: #fff;
position: relative;
&:after {
content: '';
width: 0px;
height: 0px;
display: block;
border-style: solid;
border-width: 5px 7.5px 0 7.5px;
border-color: #00568c transparent transparent transparent;
position: absolute;
top: 100%;
left: 50%;
margin-left: -7.5px;
}
span {
color: #fff;
}
}
}
}
}
#quicktabs-tab-commons_bw-commons_all {
&:before {
content: '';
@include sprite_url_height_width($icons, all);
ul.quicktabs-style-commons-pills li.active & {
@include sprite_url_position($icons, all-active);
}
}
}
#quicktabs-tab-commons_bw-commons_posts {
&:before {
content: '';
@include sprite_url_height_width($icons, posts);
ul.quicktabs-style-commons-pills li.active & {
@include sprite_url_position($icons, posts-active);
}
}
}
#quicktabs-tab-commons_bw-commons_documents {
&:before {
content: '';
@include sprite_url_height_width($icons, docs);
ul.quicktabs-style-commons-pills li.active & {
@include sprite_url_position($icons, docs-active);
}
}
}
#quicktabs-tab-commons_bw-commons_q_a {
&:before {
content: '';
@include sprite_url_height_width($icons, qa);
ul.quicktabs-style-commons-pills li.active & {
@include sprite_url_position($icons, qa-active);
}
}
}
#quicktabs-tab-commons_bw-commons_ideas {
&:before {
content: '';
@include sprite_url_height_width($icons, ideas);
ul.quicktabs-style-commons-pills li.active & {
@include sprite_url_position($icons, ideas-active);
}
}
}
#quicktabs-tab-commons_bw-commons_wikis {
&:before {
content: '';
@include sprite_url_height_width($icons, wikis);
ul.quicktabs-style-commons-pills li.active & {
@include sprite_url_position($icons, wikis-active);
}
}
}
#quicktabs-tab-commons_bw-commons_polls {
&:before {
content: '';
@include sprite_url_height_width($icons, polls);
ul.quicktabs-style-commons-pills li.active & {
@include sprite_url_position($icons, polls-active);
}
}
}

View File

@ -1,27 +0,0 @@
# Require any additional compass plugins here.
# Set this to the root of your project when deployed:
http_path = "/"
css_dir = "/"
sass_dir = "/"
images_dir = "images"
# output_style = :expanded or :nested or :compact or :compressed
output_style = :expanded
environment = :production
relative_assets = true
# To enable relative paths to assets via compass helper functions. Uncomment:
# relative_assets = true
# To disable debugging comments that display the original location of your selectors. Uncomment:
# line_comments = false
color_output = false
# If you prefer the indented syntax, you might want to regenerate this
# project again passing --syntax sass, or you can uncomment this:
# preferred_syntax = :sass
# and then run:
# sass-convert -R --from scss --to sass sass scss && rm -rf sass && mv scss sass

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 206 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 240 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 115 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 121 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 217 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 233 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 154 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 213 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 239 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 321 B

View File

@ -1,89 +0,0 @@
.quicktabs-style-commons-tabs ul.quicktabs-tabs {
margin: 0;
padding: 0;
position: relative;
top: 1px;
}
.block-content .quicktabs-style-commons-tabs ul.quicktabs-tabs {
padding: 0;
}
.quicktabs-style-commons-tabs ul.quicktabs-tabs li {
display: inline-block;
padding: 0;
margin: 0 5px 0 0;
}
.quicktabs-style-commons-tabs ul.quicktabs-tabs li a {
background-color: #dddddd;
border: 1px solid #dddddd;
-webkit-border-radius: 3px 3px 0 0;
-moz-border-radius: 3px 3px 0 0;
-ms-border-radius: 3px 3px 0 0;
-o-border-radius: 3px 3px 0 0;
border-radius: 3px 3px 0 0;
padding: 10px;
display: block;
font-size: 1.1em;
color: #2683b8;
}
.quicktabs-style-commons-tabs ul.quicktabs-tabs li a:hover {
text-decoration: none;
}
.quicktabs-style-commons-tabs ul.quicktabs-tabs li a span {
background: #dddddd;
font-size: 1.1em;
line-height: 1.1em;
color: #4d4d4d;
font-style: italic;
display: inline-block;
padding: 2px 6px;
border: 1px solid #c4c4c4;
-webkit-border-radius: 3px;
-moz-border-radius: 3px;
-ms-border-radius: 3px;
-o-border-radius: 3px;
border-radius: 3px;
margin-left: 2px;
}
.quicktabs-style-commons-tabs ul.quicktabs-tabs li.active a {
background-color: #f1f1f1;
color: #333333;
border-bottom-color: #f1f1f1;
}
.quicktabs-style-commons-tabs .quicktabs-tabpage {
border: 1px solid #dddddd;
background-color: #f1f1f1;
-webkit-border-radius: 0 3px 3px 3px;
-moz-border-radius: 0 3px 3px 3px;
-ms-border-radius: 0 3px 3px 3px;
-o-border-radius: 0 3px 3px 3px;
border-radius: 0 3px 3px 3px;
padding: 10px;
}
.quicktabs-style-commons-tabs table {
margin-top: 0;
border: none;
}
.quicktabs-style-commons-tabs td {
padding: 10px 7px;
}
.quicktabs-style-commons-tabs tbody tr {
border-top: none;
}
.quicktabs-style-commons-tabs tr {
background: none;
}
.quicktabs-style-commons-tabs tr.odd {
background: none;
}
.quicktabs-style-commons-tabs tr.even {
background: #ececec;
}
.quicktabs-style-commons-tabs tr.even, .quicktabs-style-commons-tabs tr.odd {
border-bottom: 1px dashed #dddddd;
}
.quicktabs-style-commons-tabs tr.even.views-row-last, .quicktabs-style-commons-tabs tr.odd.views-row-last {
border-bottom: none;
}
.quicktabs-style-commons-tabs tr.even td.active, .quicktabs-style-commons-tabs tr.odd td.active {
background: none;
}

View File

@ -1,108 +0,0 @@
@import 'compass';
$link_color: #2683B8;
$gray: #f1f1f1;
$gray_darker: #ececec;
$gray_darkest: #dddddd;
$black: #333333;
.quicktabs-style-commons-tabs {
ul.quicktabs-tabs {
margin: 0;
padding: 0;
position: relative;
top: 1px;
.block-content & {
padding: 0;
}
li {
display: inline-block;
padding: 0;
margin: 0 5px 0 0;
a {
background-color: $gray_darkest;
border: 1px solid $gray_darkest;
@include border-radius(3px 3px 0 0);
padding: 10px;
display: block;
font-size: 1.1em;
color: $link_color;
&:hover {
text-decoration: none;
}
span {
background: $gray_darkest;
font-size: 1.1em;
line-height: 1.1em;
color: lighten($black, 10%);
font-style: italic;
display: inline-block;
padding: 2px 6px;
border: 1px solid darken($gray_darkest, 10%);
@include border-radius(3px);
margin-left: 2px;
}
}
&.active a {
background-color: $gray;
color: $black;
border-bottom-color: $gray;
span {
// color: #fff;
}
}
}
}
.quicktabs-tabpage {
border: 1px solid $gray_darkest;
background-color: $gray;
@include border-radius(0 3px 3px 3px);
padding: 10px
}
table {
margin-top: 0;
border: none;
}
td {
padding: 10px 7px;
}
tbody tr {
border-top: none;
}
tr {
background: none;
&.odd {
background: none;
}
&.even {
background: $gray_darker;
}
&.even, &.odd {
border-bottom: 1px dashed $gray_darkest;
&.views-row-last {
border-bottom: none;
}
& td.active {
background: none;
}
}
}
}

View File

@ -1,26 +0,0 @@
# Require any additional compass plugins here.
# Set this to the root of your project when deployed:
http_path = "/"
css_dir = "/"
sass_dir = "/"
# output_style = :expanded or :nested or :compact or :compressed
output_style = :expanded
environment = :production
relative_assets = true
# To enable relative paths to assets via compass helper functions. Uncomment:
# relative_assets = true
# To disable debugging comments that display the original location of your selectors. Uncomment:
# line_comments = false
color_output = false
# If you prefer the indented syntax, you might want to regenerate this
# project again passing --syntax sass, or you can uncomment this:
# preferred_syntax = :sass
# and then run:
# sass-convert -R --from scss --to sass sass scss && rm -rf sass && mv scss sass

View File

@ -1,104 +0,0 @@
<?php
/**
* @file
* commons_content_moderation.features.inc
*/
/**
* Implements hook_ctools_plugin_api().
*/
function commons_content_moderation_ctools_plugin_api($module = NULL, $api = NULL) {
if ($module == "strongarm" && $api == "strongarm") {
return array("version" => "1");
}
}
/**
* Implements hook_views_api().
*/
function commons_content_moderation_views_api($module = NULL, $api = NULL) {
return array("api" => "3.0");
}
/**
* Implements hook_flag_default_flags().
*/
function commons_content_moderation_flag_default_flags() {
$flags = array();
// Exported flag: "Comment inappropriate".
$flags['inappropriate_comment'] = array(
'entity_type' => 'comment',
'title' => 'Comment inappropriate',
'global' => 0,
'types' => array(
0 => 'comment_node_answer',
1 => 'comment_node_event',
2 => 'comment_node_group',
3 => 'comment_node_page',
4 => 'comment_node_post',
5 => 'comment_node_question',
6 => 'comment_node_wiki',
),
'flag_short' => 'Report as inappropriate',
'flag_long' => 'Report this comment as inappropriate.',
'flag_message' => '',
'unflag_short' => 'Cancel report as inappropriate',
'unflag_long' => 'Cancel reporting as inappropriate.',
'unflag_message' => '',
'unflag_denied_text' => '',
'link_type' => 'confirm',
'show_in_links' => array(
'diff_standard' => TRUE,
'full' => TRUE,
'token' => TRUE,
),
'weight' => 0,
'show_on_form' => 0,
'access_author' => 'comment_others',
'flag_confirmation' => 'Are you sure you want to report this comment as inappropriate?',
'unflag_confirmation' => 'Are you sure you want to cancel reporting this comment as inappropriate?',
'module' => 'commons_content_moderation',
'locked' => array(
0 => 'name',
),
'api_version' => 3,
);
// Exported flag: "Node inappropriate".
$flags['inappropriate_node'] = array(
'entity_type' => 'node',
'title' => 'Node inappropriate',
'global' => 0,
'types' => array(
0 => 'event',
1 => 'group',
2 => 'page',
3 => 'post',
4 => 'wiki',
),
'flag_short' => 'Report as inappropriate',
'flag_long' => 'Report this content as inappropriate.',
'flag_message' => '',
'unflag_short' => 'Cancel report as inappropriate',
'unflag_long' => 'Report this content as appropriate',
'unflag_message' => '',
'unflag_denied_text' => '',
'link_type' => 'confirm',
'show_in_links' => array(
'full' => TRUE,
),
'weight' => 0,
'show_on_form' => 0,
'access_author' => '',
'show_contextual_link' => FALSE,
'i18n' => 0,
'flag_confirmation' => 'Are you sure you want to report this content as inappropriate?',
'unflag_confirmation' => 'Are you sure you want cancel reporting this content as inappropriate?',
'module' => 'commons_content_moderation',
'locked' => array(
0 => 'name',
),
'api_version' => 3,
);
return $flags;
}

View File

@ -1,68 +0,0 @@
<?php
/**
* @file
* commons_content_moderation.features.user_permission.inc
*/
/**
* Implements hook_user_default_permissions().
*/
function commons_content_moderation_user_default_permissions() {
$permissions = array();
// Exported permission: 'flag abuse_user'.
$permissions['flag abuse_user'] = array(
'name' => 'flag abuse_user',
'roles' => array(
'authenticated user' => 'authenticated user',
),
'module' => 'flag',
);
// Exported permission: 'flag inappropriate_comment'.
$permissions['flag inappropriate_comment'] = array(
'name' => 'flag inappropriate_comment',
'roles' => array(
'authenticated user' => 'authenticated user',
),
'module' => 'flag',
);
// Exported permission: 'flag inappropriate_node'.
$permissions['flag inappropriate_node'] = array(
'name' => 'flag inappropriate_node',
'roles' => array(
'authenticated user' => 'authenticated user',
),
'module' => 'flag',
);
// Exported permission: 'unflag abuse_user'.
$permissions['unflag abuse_user'] = array(
'name' => 'unflag abuse_user',
'roles' => array(
'authenticated user' => 'authenticated user',
),
'module' => 'flag',
);
// Exported permission: 'unflag inappropriate_comment'.
$permissions['unflag inappropriate_comment'] = array(
'name' => 'unflag inappropriate_comment',
'roles' => array(
'authenticated user' => 'authenticated user',
),
'module' => 'flag',
);
// Exported permission: 'unflag inappropriate_node'.
$permissions['unflag inappropriate_node'] = array(
'name' => 'unflag inappropriate_node',
'roles' => array(
'authenticated user' => 'authenticated user',
),
'module' => 'flag',
);
return $permissions;
}

View File

@ -1,20 +0,0 @@
<?php
/**
* @file
* commons_content_moderation.features.user_role.inc
*/
/**
* Implements hook_user_default_roles().
*/
function commons_content_moderation_user_default_roles() {
$roles = array();
// Exported role: content moderator.
$roles['content moderator'] = array(
'name' => 'content moderator',
'weight' => 2,
);
return $roles;
}

View File

@ -1,36 +0,0 @@
name = Commons Content Moderation
description = Provides a content moderator role which allows privileged users to moderate content and users.
package = Commons - Building blocks
core = 7.x
dependencies[] = comment
dependencies[] = ctools
dependencies[] = flag
dependencies[] = flag_abuse
dependencies[] = strongarm
dependencies[] = views
features[ctools][] = strongarm:strongarm:1
features[ctools][] = views:views_default:3.0
features[features_api][] = api:2
features[flag][] = inappropriate_comment
features[flag][] = inappropriate_node
features[user_permission][] = flag abuse_user
features[user_permission][] = flag inappropriate_comment
features[user_permission][] = flag inappropriate_node
features[user_permission][] = unflag abuse_user
features[user_permission][] = unflag inappropriate_comment
features[user_permission][] = unflag inappropriate_node
features[user_role][] = content moderator
features[variable][] = flag_abuse_flags
features[views_view][] = commons_content_moderation_reported_comments
features[views_view][] = commons_content_moderation_reported_nodes
features_exclude[dependencies][features] = features
; Information added by Drupal.org packaging script on 2015-03-18
version = "7.x-3.23"
core = "7.x"
project = "commons"
datestamp = "1426714630"

View File

@ -1,50 +0,0 @@
<?php
/**
* Change content moderation views permission.
*/
function commons_content_moderation_update_7001() {
$revert = array(
'commons_content_moderation' => array('views_view'),
);
features_revert($revert);
return array();
}
/**
* Clear views cache to have content moderation view use new permission.
*/
function commons_content_moderation_update_7002() {
cache_clear_all('*', 'cache_views', TRUE);
}
/**
* Replace the title attribute with the title field in view displays.
*/
function commons_content_moderation_update_7003() {
$revert = array(
'commons_content_moderation' => array('views_view'),
);
features_revert($revert);
return array();
}
/**
* Delete any copies of the Flag Abuse default flags stored in the database in
* order to allow alterations to take effect.
*/
function commons_content_moderation_update_7004() {
// The Flag module automatically copies module-provided default flags into the
// database for performance reasons.
// Delete the Flag Abuse default flags from the database in order to have the
// default flag alterations take effect.
foreach (array('abuse_user', 'abuse_comment', 'abuse_node', 'abuse_whitelist_comment', 'abuse_whitelist_node', 'abuse_whitelist_user') as $abuse_flag) {
$flag = flag_get_flag($abuse_flag);
if($flag) {
$flag->delete();
}
}
return array();
}

View File

@ -1,152 +0,0 @@
<?php
/**
* @file
* Code for the Commons Content Moderation feature.
*/
include_once 'commons_content_moderation.features.inc';
/**
* Implements hook_action_info().
*/
function commons_content_moderation_action_info() {
return array(
'commons_content_moderation_delete_node_block_user' => array(
'type' => 'node',
'label' => t("Delete content and block author's account."),
'configurable' => FALSE,
'behavior' => array(''),
'triggers' => array(''),
),
'commons_content_moderation_delete_comment_block_user' => array(
'type' => 'comment',
'label' => t("Delete comment and block author's account."),
'configurable' => FALSE,
'behavior' => array(''),
'triggers' => array(''),
),
);
}
/**
* Delete content and block the content author.
*
* @param $node
* A node object.
* @param $context
* (optional) Array of additional information about what triggered the action.
* Not used for this action.
*
* @ingroup actions
*/
function commons_content_moderation_delete_node_block_user($node, $context = array()) {
// Don't block anonymous users or user 1.
if ($node->uid > 1) {
$author = user_load($node->uid);
// Block the user if they aren't already.
if ($author->status) {
$author = user_save($author, array('status' => 0));
watchdog('commons_content_moderation', 'Blocked user %name.', array('%name' => format_username($author)));
}
}
// Report the content to Mollom when possible.
if (module_exists('mollom') && _mollom_flag_access('node', $node)) {
mollom_data_report('node', $node->nid, 'spam');
}
// Delete the node.
node_delete($node->nid);
watchdog('commons_content_moderation', 'Deleted @type %title.', array('@type' => node_type_get_name($node), '%title' => $node->title));
}
/**
* Delete comment and block the comment author.
*
* @param $comment
* A comment object.
* @param $context
* (optional) Array of additional information about what triggered the action.
* Not used for this action.
*
* @ingroup actions
*/
function commons_content_moderation_delete_comment_block_user($comment, $context = array()) {
// Don't block anonymous users or user 1.
if ($comment->uid > 1) {
$author = user_load($comment->uid);
// Block the user if they aren't already.
if ($author->status) {
$author = user_save($author, array('status' => 0));
watchdog('commons_content_moderation', 'Blocked user %name.', array('%name' => format_username($author)));
}
}
// Report the content to Mollom when possible.
if (module_exists('mollom') && _mollom_flag_access('comment', $comment)) {
mollom_data_report('comment', $comment->cid, 'spam');
}
// Delete the comment.
comment_delete($comment->cid);
watchdog('commons_content_moderation', 'Deleted comment %title.', array('%title' => $comment->title));
}
/**
* Implements hook_flag_default_flags_alter().
*/
function commons_content_moderation_flag_default_flags_alter(&$flags) {
// Disable default node and comment abuse flags in favor of Commons-specific
// flags included with Commons Content Moderation.
foreach (array('abuse_user', 'abuse_comment', 'abuse_node', 'abuse_whitelist_comment', 'abuse_whitelist_node', 'abuse_whitelist_user') as $flag_name) {
if (!empty($flags[$flag_name])) {
$flags[$flag_name]['status'] = FALSE;
}
}
}
/**
* Implements hook_views_default_views_alter().
*/
function commons_content_moderation_views_default_views_alter(&$views) {
// Disable default node and comment abuse views in favor of Commons-specific
// views included with Commons Content Moderation.
foreach (array('all_flag_abuse_node', 'all_flag_abuse_comment') as $view_name) {
if (!empty($views[$view_name])) {
$views[$view_name]->disabled = TRUE;
}
}
}
/**
* Implements hook_views_pre_build().
*/
function commons_content_moderation_views_pre_build(&$view) {
// Disable bulk content moderation operations if the user does not have
// appropriate access.
if ($view->name == 'commons_content_moderation_reported_nodes' && !module_exists('actions_permissions') && (!user_access('administer nodes') || !user_access('administer users'))) {
unset($view->field['views_bulk_operations']);
unset($view->display_handler->handlers['field']['views_bulk_operations']);
}
}
/**
* Implements hook_views_bulk_operations_form_alter().
*/
function commons_content_moderation_views_bulk_operations_form_alter(&$form, $form_state, $vbo) {
// Only proceed if the 'delete_node_block_user' operation is available.
if (!isset($vbo->options['vbo_operations']['action::commons_content_moderation_delete_node_block_user'])) {
return;
}
// Notify the user that the deleted content will be reported to Mollom.
if ($form_state['step'] == 'views_form_views_form' && $vbo->options['vbo_operations']['action::commons_content_moderation_delete_node_block_user']['selected'] == 1) {
if (module_exists('mollom') && _mollom_access('report to mollom')) {
$form['mollom_text'] = array(
'#markup' => '<p>' . t('Deleted content will be reported to Mollom.') . '</p>',
);
}
}
}

View File

@ -1,30 +0,0 @@
<?php
/**
* @file
* commons_content_moderation.strongarm.inc
*/
/**
* Implements hook_strongarm().
*/
function commons_content_moderation_strongarm() {
$export = array();
$strongarm = new stdClass();
$strongarm->disabled = FALSE; /* Edit this to true to make a default strongarm disabled initially */
$strongarm->api_version = 1;
$strongarm->name = 'flag_abuse_flags';
$strongarm->value = array(
'inappropriate_node' => 'inappropriate_node',
'inappropriate_comment' => 'inappropriate_comment',
'commons_follow_user' => 0,
'commons_follow_term' => 0,
'commons_follow_group' => 0,
'commons_follow_node' => 0,
'bookmarks' => 0,
'abuse_user' => 0,
);
$export['flag_abuse_flags'] = $strongarm;
return $export;
}

View File

@ -1,634 +0,0 @@
<?php
/**
* @file
* commons_content_moderation.views_default.inc
*/
/**
* Implements hook_views_default_views().
*/
function commons_content_moderation_views_default_views() {
$export = array();
$view = new view();
$view->name = 'commons_content_moderation_reported_comments';
$view->description = 'View for flag: Comment Abuse ';
$view->tag = 'flag.abuse';
$view->base_table = 'comment';
$view->human_name = 'Commons reported comments';
$view->core = 0;
$view->api_version = '3.0';
$view->disabled = FALSE; /* Edit this to true to make a default view disabled initially */
/* Display: Defaults */
$handler = $view->new_display('default', 'Defaults', 'default');
$handler->display->display_options['title'] = 'Comments';
$handler->display->display_options['use_more_always'] = FALSE;
$handler->display->display_options['access']['type'] = 'perm';
$handler->display->display_options['access']['perm'] = 'administer nodes';
$handler->display->display_options['cache']['type'] = 'none';
$handler->display->display_options['query']['type'] = 'views_query';
$handler->display->display_options['exposed_form']['type'] = 'basic';
$handler->display->display_options['pager']['type'] = 'full';
$handler->display->display_options['pager']['options']['items_per_page'] = 25;
$handler->display->display_options['style_plugin'] = 'table';
$handler->display->display_options['style_options']['columns'] = array(
'subject' => 'subject',
'title' => 'title',
'count' => 'count',
'last_updated' => 'last_updated',
'name_2' => 'name_2',
'entity_id' => 'entity_id',
);
$handler->display->display_options['style_options']['default'] = '-1';
$handler->display->display_options['style_options']['info'] = array(
'subject' => array(
'sortable' => 1,
'default_sort_order' => 'asc',
'align' => '',
'separator' => '',
'empty_column' => 0,
),
'title' => array(
'sortable' => 1,
'default_sort_order' => 'asc',
'align' => '',
'separator' => '',
'empty_column' => 0,
),
'count' => array(
'sortable' => 1,
'default_sort_order' => 'asc',
'align' => '',
'separator' => '',
'empty_column' => 0,
),
'last_updated' => array(
'sortable' => 1,
'default_sort_order' => 'asc',
'align' => '',
'separator' => '',
'empty_column' => 0,
),
'name_2' => array(
'sortable' => 1,
'default_sort_order' => 'asc',
'align' => '',
'separator' => '',
'empty_column' => 0,
),
'entity_id' => array(
'sortable' => 0,
'default_sort_order' => 'asc',
'align' => '',
'separator' => '',
'empty_column' => 0,
),
);
/* No results behavior: Global: Text area */
$handler->display->display_options['empty']['text']['id'] = 'text';
$handler->display->display_options['empty']['text']['table'] = 'views';
$handler->display->display_options['empty']['text']['field'] = 'area';
$handler->display->display_options['empty']['text']['content'] = 'No comments have been reported...';
$handler->display->display_options['empty']['text']['format'] = 'plain_text';
/* Relationship: Flags: inappropriate_comment */
$handler->display->display_options['relationships']['flag_content_rel']['id'] = 'flag_content_rel';
$handler->display->display_options['relationships']['flag_content_rel']['table'] = 'comment';
$handler->display->display_options['relationships']['flag_content_rel']['field'] = 'flag_content_rel';
$handler->display->display_options['relationships']['flag_content_rel']['flag'] = 'inappropriate_comment';
$handler->display->display_options['relationships']['flag_content_rel']['user_scope'] = 'any';
/* Relationship: Comment: Content */
$handler->display->display_options['relationships']['nid']['id'] = 'nid';
$handler->display->display_options['relationships']['nid']['table'] = 'comment';
$handler->display->display_options['relationships']['nid']['field'] = 'nid';
$handler->display->display_options['relationships']['nid']['required'] = TRUE;
/* Relationship: Flags: inappropriate_comment counter */
$handler->display->display_options['relationships']['flag_count_rel']['id'] = 'flag_count_rel';
$handler->display->display_options['relationships']['flag_count_rel']['table'] = 'comment';
$handler->display->display_options['relationships']['flag_count_rel']['field'] = 'flag_count_rel';
$handler->display->display_options['relationships']['flag_count_rel']['flag'] = 'inappropriate_comment';
/* Field: Bulk operations: Comment */
$handler->display->display_options['fields']['views_bulk_operations']['id'] = 'views_bulk_operations';
$handler->display->display_options['fields']['views_bulk_operations']['table'] = 'comment';
$handler->display->display_options['fields']['views_bulk_operations']['field'] = 'views_bulk_operations';
$handler->display->display_options['fields']['views_bulk_operations']['vbo_settings']['display_type'] = '1';
$handler->display->display_options['fields']['views_bulk_operations']['vbo_settings']['enable_select_all_pages'] = 1;
$handler->display->display_options['fields']['views_bulk_operations']['vbo_settings']['force_single'] = 0;
$handler->display->display_options['fields']['views_bulk_operations']['vbo_settings']['entity_load_capacity'] = '10';
$handler->display->display_options['fields']['views_bulk_operations']['vbo_operations'] = array(
'action::commons_content_moderation_delete_comment_block_user' => array(
'selected' => 1,
'skip_confirmation' => 0,
'override_label' => 0,
'label' => '',
'postpone_processing' => 0,
),
'action::views_bulk_operations_delete_item' => array(
'selected' => 0,
'skip_confirmation' => 0,
'override_label' => 0,
'label' => '',
'postpone_processing' => 0,
),
'action::system_message_action' => array(
'selected' => 0,
'skip_confirmation' => 0,
'override_label' => 0,
'label' => '',
'postpone_processing' => 0,
),
'action::views_bulk_operations_script_action' => array(
'selected' => 0,
'skip_confirmation' => 0,
'override_label' => 0,
'label' => '',
'postpone_processing' => 0,
),
'action::flag_comment_action' => array(
'selected' => 0,
'skip_confirmation' => 0,
'override_label' => 0,
'label' => '',
'postpone_processing' => 0,
),
'action::views_bulk_operations_modify_action' => array(
'selected' => 0,
'skip_confirmation' => 0,
'override_label' => 0,
'label' => '',
'settings' => array(
'show_all_tokens' => 1,
'display_values' => array(
'_all_' => '_all_',
),
),
'postpone_processing' => 0,
),
'action::views_bulk_operations_argument_selector_action' => array(
'selected' => 0,
'skip_confirmation' => 0,
'override_label' => 0,
'label' => '',
'settings' => array(
'url' => '',
),
),
'action::comment_publish_action' => array(
'selected' => 0,
'skip_confirmation' => 0,
'override_label' => 0,
'label' => '',
'postpone_processing' => 0,
),
'action::system_goto_action' => array(
'selected' => 0,
'skip_confirmation' => 0,
'override_label' => 0,
'label' => '',
'postpone_processing' => 0,
),
'action::comment_save_action' => array(
'selected' => 0,
'skip_confirmation' => 0,
'override_label' => 0,
'label' => '',
'postpone_processing' => 0,
),
'action::system_send_email_action' => array(
'selected' => 0,
'skip_confirmation' => 0,
'override_label' => 0,
'label' => '',
'postpone_processing' => 0,
),
'action::panelizer_set_status_action' => array(
'selected' => 0,
'skip_confirmation' => 0,
'override_label' => 0,
'label' => '',
'postpone_processing' => 0,
),
'action::comment_unpublish_action' => array(
'selected' => 0,
'skip_confirmation' => 0,
'override_label' => 0,
'label' => '',
'postpone_processing' => 0,
),
'action::comment_unpublish_by_keyword_action' => array(
'selected' => 0,
'skip_confirmation' => 0,
'override_label' => 0,
'label' => '',
'postpone_processing' => 0,
),
);
/* Field: Comment: Title */
$handler->display->display_options['fields']['subject']['id'] = 'subject';
$handler->display->display_options['fields']['subject']['table'] = 'comment';
$handler->display->display_options['fields']['subject']['field'] = 'subject';
/* Field: Content: Title */
$handler->display->display_options['fields']['title_field']['id'] = 'title_field';
$handler->display->display_options['fields']['title_field']['table'] = 'field_data_title_field';
$handler->display->display_options['fields']['title_field']['field'] = 'title_field';
$handler->display->display_options['fields']['title_field']['relationship'] = 'nid';
$handler->display->display_options['fields']['title_field']['label'] = 'Comment on';
$handler->display->display_options['fields']['title_field']['link_to_entity'] = 1;
/* Field: Comment: Author */
$handler->display->display_options['fields']['name_2']['id'] = 'name_2';
$handler->display->display_options['fields']['name_2']['table'] = 'comment';
$handler->display->display_options['fields']['name_2']['field'] = 'name';
$handler->display->display_options['fields']['name_2']['label'] = 'Comment Author';
/* Field: Comment: Comment */
$handler->display->display_options['fields']['entity_id']['id'] = 'entity_id';
$handler->display->display_options['fields']['entity_id']['table'] = 'field_data_comment_body';
$handler->display->display_options['fields']['entity_id']['field'] = 'comment_body';
/* Sort criterion: Flags: Flagged time */
$handler->display->display_options['sorts']['timestamp']['id'] = 'timestamp';
$handler->display->display_options['sorts']['timestamp']['table'] = 'flagging';
$handler->display->display_options['sorts']['timestamp']['field'] = 'timestamp';
$handler->display->display_options['sorts']['timestamp']['relationship'] = 'flag_content_rel';
/* Filter criterion: Comment: Approved */
$handler->display->display_options['filters']['status']['id'] = 'status';
$handler->display->display_options['filters']['status']['table'] = 'comment';
$handler->display->display_options['filters']['status']['field'] = 'status';
$handler->display->display_options['filters']['status']['value'] = '1';
/* Display: Page: Reported comments */
$handler = $view->new_display('page', 'Page: Reported comments', 'page_abuse_comment');
$handler->display->display_options['defaults']['hide_admin_links'] = FALSE;
$handler->display->display_options['path'] = 'admin/content/comment/reported';
$handler->display->display_options['menu']['type'] = 'tab';
$handler->display->display_options['menu']['title'] = 'Reported comments';
$handler->display->display_options['menu']['weight'] = '0';
$handler->display->display_options['menu']['context'] = 0;
$handler->display->display_options['tab_options']['type'] = 'tab';
$handler->display->display_options['tab_options']['title'] = 'Reported comments';
$handler->display->display_options['tab_options']['weight'] = '10';
$translatables['commons_content_moderation_reported_comments'] = array(
t('Defaults'),
t('Comments'),
t('more'),
t('Apply'),
t('Reset'),
t('Sort by'),
t('Asc'),
t('Desc'),
t('Items per page'),
t('- All -'),
t('Offset'),
t('« first'),
t(' previous'),
t('next '),
t('last »'),
t('No comments have been reported...'),
t('flag'),
t('Content'),
t('counter'),
t('Comment'),
t('Title'),
t('Comment on'),
t('Comment Author'),
t('Page: Reported comments'),
);
$export['commons_content_moderation_reported_comments'] = $view;
$view = new view();
$view->name = 'commons_content_moderation_reported_nodes';
$view->description = 'View for flag: Node Abuse';
$view->tag = 'flag.abuse';
$view->base_table = 'node';
$view->human_name = 'Commons reported nodes';
$view->core = 0;
$view->api_version = '3.0';
$view->disabled = FALSE; /* Edit this to true to make a default view disabled initially */
/* Display: Defaults */
$handler = $view->new_display('default', 'Defaults', 'default');
$handler->display->display_options['title'] = 'Reported content';
$handler->display->display_options['use_more_always'] = FALSE;
$handler->display->display_options['access']['type'] = 'perm';
$handler->display->display_options['access']['perm'] = 'administer nodes';
$handler->display->display_options['cache']['type'] = 'none';
$handler->display->display_options['query']['type'] = 'views_query';
$handler->display->display_options['query']['options']['distinct'] = TRUE;
$handler->display->display_options['exposed_form']['type'] = 'basic';
$handler->display->display_options['pager']['type'] = 'none';
$handler->display->display_options['style_plugin'] = 'table';
$handler->display->display_options['style_options']['columns'] = array(
'views_bulk_operations' => 'views_bulk_operations',
'type' => 'type',
'title' => 'title',
'count' => 'count',
'last_updated' => 'last_updated',
'name' => 'name',
'body' => 'body',
);
$handler->display->display_options['style_options']['default'] = 'last_updated';
$handler->display->display_options['style_options']['info'] = array(
'views_bulk_operations' => array(
'align' => '',
'separator' => '',
'empty_column' => 0,
),
'type' => array(
'sortable' => 1,
'default_sort_order' => 'asc',
'align' => '',
'separator' => '',
'empty_column' => 0,
),
'title' => array(
'sortable' => 1,
'default_sort_order' => 'asc',
'align' => '',
'separator' => '',
'empty_column' => 0,
),
'count' => array(
'sortable' => 1,
'default_sort_order' => 'asc',
'align' => '',
'separator' => '',
'empty_column' => 0,
),
'last_updated' => array(
'sortable' => 1,
'default_sort_order' => 'asc',
'align' => '',
'separator' => '',
'empty_column' => 0,
),
'name' => array(
'sortable' => 1,
'default_sort_order' => 'asc',
'align' => '',
'separator' => '',
'empty_column' => 0,
),
'body' => array(
'sortable' => 1,
'default_sort_order' => 'asc',
'align' => '',
'separator' => '',
'empty_column' => 0,
),
);
/* No results behavior: Global: Text area */
$handler->display->display_options['empty']['text']['id'] = 'area';
$handler->display->display_options['empty']['text']['table'] = 'views';
$handler->display->display_options['empty']['text']['field'] = 'area';
$handler->display->display_options['empty']['text']['content'] = 'No content has been reported.';
$handler->display->display_options['empty']['text']['format'] = '1';
/* Relationship: Flags: inappropriate_node */
$handler->display->display_options['relationships']['flag_content_rel']['id'] = 'flag_content_rel';
$handler->display->display_options['relationships']['flag_content_rel']['table'] = 'node';
$handler->display->display_options['relationships']['flag_content_rel']['field'] = 'flag_content_rel';
$handler->display->display_options['relationships']['flag_content_rel']['label'] = 'abuse_node';
$handler->display->display_options['relationships']['flag_content_rel']['flag'] = 'inappropriate_node';
$handler->display->display_options['relationships']['flag_content_rel']['user_scope'] = 'any';
/* Relationship: Content: Author */
$handler->display->display_options['relationships']['uid']['id'] = 'uid';
$handler->display->display_options['relationships']['uid']['table'] = 'node';
$handler->display->display_options['relationships']['uid']['field'] = 'uid';
$handler->display->display_options['relationships']['uid']['required'] = TRUE;
/* Relationship: Flags: inappropriate_node counter */
$handler->display->display_options['relationships']['flag_count_rel']['id'] = 'flag_count_rel';
$handler->display->display_options['relationships']['flag_count_rel']['table'] = 'node';
$handler->display->display_options['relationships']['flag_count_rel']['field'] = 'flag_count_rel';
$handler->display->display_options['relationships']['flag_count_rel']['flag'] = 'inappropriate_node';
/* Field: Bulk operations: Content */
$handler->display->display_options['fields']['views_bulk_operations']['id'] = 'views_bulk_operations';
$handler->display->display_options['fields']['views_bulk_operations']['table'] = 'node';
$handler->display->display_options['fields']['views_bulk_operations']['field'] = 'views_bulk_operations';
$handler->display->display_options['fields']['views_bulk_operations']['vbo_settings']['display_type'] = '1';
$handler->display->display_options['fields']['views_bulk_operations']['vbo_settings']['enable_select_all_pages'] = 1;
$handler->display->display_options['fields']['views_bulk_operations']['vbo_settings']['force_single'] = 0;
$handler->display->display_options['fields']['views_bulk_operations']['vbo_settings']['entity_load_capacity'] = '10';
$handler->display->display_options['fields']['views_bulk_operations']['vbo_operations'] = array(
'action::node_assign_owner_action' => array(
'selected' => 0,
'skip_confirmation' => 0,
'override_label' => 0,
'label' => '',
'postpone_processing' => 0,
),
'action::commons_content_moderation_delete_node_block_user' => array(
'selected' => 1,
'skip_confirmation' => 0,
'override_label' => 0,
'label' => '',
'postpone_processing' => 0,
),
'action::views_bulk_operations_delete_item' => array(
'selected' => 0,
'skip_confirmation' => 0,
'override_label' => 0,
'label' => '',
'postpone_processing' => 0,
),
'action::system_message_action' => array(
'selected' => 0,
'skip_confirmation' => 0,
'override_label' => 0,
'label' => '',
'postpone_processing' => 0,
),
'action::views_bulk_operations_script_action' => array(
'selected' => 0,
'skip_confirmation' => 0,
'override_label' => 0,
'label' => '',
'postpone_processing' => 0,
),
'action::flag_node_action' => array(
'selected' => 0,
'skip_confirmation' => 0,
'override_label' => 0,
'label' => '',
'postpone_processing' => 0,
),
'action::node_make_sticky_action' => array(
'selected' => 0,
'skip_confirmation' => 0,
'override_label' => 0,
'label' => '',
'postpone_processing' => 0,
),
'action::node_make_unsticky_action' => array(
'selected' => 0,
'skip_confirmation' => 0,
'override_label' => 0,
'label' => '',
'postpone_processing' => 0,
),
'action::views_bulk_operations_modify_action' => array(
'selected' => 0,
'skip_confirmation' => 0,
'override_label' => 0,
'label' => '',
'settings' => array(
'show_all_tokens' => 1,
'display_values' => array(
'_all_' => '_all_',
),
),
'postpone_processing' => 0,
),
'action::views_bulk_operations_argument_selector_action' => array(
'selected' => 0,
'skip_confirmation' => 0,
'override_label' => 0,
'label' => '',
'settings' => array(
'url' => '',
),
),
'action::node_promote_action' => array(
'selected' => 0,
'skip_confirmation' => 0,
'override_label' => 0,
'label' => '',
'postpone_processing' => 0,
),
'action::node_publish_action' => array(
'selected' => 0,
'skip_confirmation' => 0,
'override_label' => 0,
'label' => '',
'postpone_processing' => 0,
),
'action::system_goto_action' => array(
'selected' => 0,
'skip_confirmation' => 0,
'override_label' => 0,
'label' => '',
'postpone_processing' => 0,
),
'action::node_unpromote_action' => array(
'selected' => 0,
'skip_confirmation' => 0,
'override_label' => 0,
'label' => '',
'postpone_processing' => 0,
),
'action::node_save_action' => array(
'selected' => 0,
'skip_confirmation' => 0,
'override_label' => 0,
'label' => '',
'postpone_processing' => 0,
),
'action::system_send_email_action' => array(
'selected' => 0,
'skip_confirmation' => 0,
'override_label' => 0,
'label' => '',
'postpone_processing' => 0,
),
'action::panelizer_set_status_action' => array(
'selected' => 0,
'skip_confirmation' => 0,
'override_label' => 0,
'label' => '',
'postpone_processing' => 0,
),
'action::node_unpublish_action' => array(
'selected' => 1,
'skip_confirmation' => 0,
'override_label' => 0,
'label' => '',
'postpone_processing' => 0,
),
'action::node_unpublish_by_keyword_action' => array(
'selected' => 0,
'skip_confirmation' => 0,
'override_label' => 0,
'label' => '',
'postpone_processing' => 0,
),
);
/* Field: Content: Type */
$handler->display->display_options['fields']['type']['id'] = 'type';
$handler->display->display_options['fields']['type']['table'] = 'node';
$handler->display->display_options['fields']['type']['field'] = 'type';
$handler->display->display_options['fields']['type']['exclude'] = TRUE;
/* Field: Content: Title */
$handler->display->display_options['fields']['title_field']['id'] = 'title_field';
$handler->display->display_options['fields']['title_field']['table'] = 'field_data_title_field';
$handler->display->display_options['fields']['title_field']['field'] = 'title_field';
$handler->display->display_options['fields']['title_field']['link_to_entity'] = 1;
/* Field: Flags: Flag counter */
$handler->display->display_options['fields']['count']['id'] = 'count';
$handler->display->display_options['fields']['count']['table'] = 'flag_counts';
$handler->display->display_options['fields']['count']['field'] = 'count';
$handler->display->display_options['fields']['count']['relationship'] = 'flag_count_rel';
$handler->display->display_options['fields']['count']['label'] = '# of Reports';
/* Field: Flags: Time last flagged */
$handler->display->display_options['fields']['last_updated']['id'] = 'last_updated';
$handler->display->display_options['fields']['last_updated']['table'] = 'flag_counts';
$handler->display->display_options['fields']['last_updated']['field'] = 'last_updated';
$handler->display->display_options['fields']['last_updated']['relationship'] = 'flag_count_rel';
$handler->display->display_options['fields']['last_updated']['label'] = 'Last reported';
$handler->display->display_options['fields']['last_updated']['date_format'] = 'time ago';
/* Field: User: Name */
$handler->display->display_options['fields']['name']['id'] = 'name';
$handler->display->display_options['fields']['name']['table'] = 'users';
$handler->display->display_options['fields']['name']['field'] = 'name';
$handler->display->display_options['fields']['name']['relationship'] = 'uid';
$handler->display->display_options['fields']['name']['label'] = 'Author';
/* Field: Content: Body */
$handler->display->display_options['fields']['body']['id'] = 'body';
$handler->display->display_options['fields']['body']['table'] = 'field_data_body';
$handler->display->display_options['fields']['body']['field'] = 'body';
$handler->display->display_options['fields']['body']['type'] = 'text_summary_or_trimmed';
$handler->display->display_options['fields']['body']['settings'] = array(
'trim_length' => '600',
);
/* Filter criterion: Content: Published */
$handler->display->display_options['filters']['status']['id'] = 'status';
$handler->display->display_options['filters']['status']['table'] = 'node';
$handler->display->display_options['filters']['status']['field'] = 'status';
$handler->display->display_options['filters']['status']['value'] = 1;
$handler->display->display_options['filters']['status']['group'] = '0';
$handler->display->display_options['filters']['status']['expose']['operator'] = FALSE;
/* Display: Page */
$handler = $view->new_display('page', 'Page', 'page_1');
$handler->display->display_options['defaults']['hide_admin_links'] = FALSE;
$handler->display->display_options['path'] = 'admin/content/reported';
$handler->display->display_options['menu']['type'] = 'tab';
$handler->display->display_options['menu']['title'] = 'Reported content';
$handler->display->display_options['menu']['weight'] = '0';
$handler->display->display_options['menu']['name'] = 'management';
$handler->display->display_options['menu']['context'] = 0;
$handler->display->display_options['tab_options']['title'] = 'Reported content';
$handler->display->display_options['tab_options']['weight'] = '';
$translatables['commons_content_moderation_reported_nodes'] = array(
t('Defaults'),
t('Reported content'),
t('more'),
t('Apply'),
t('Reset'),
t('Sort by'),
t('Asc'),
t('Desc'),
t('No content has been reported.'),
t('abuse_node'),
t('author'),
t('counter'),
t('Content'),
t('Type'),
t('Title'),
t('# of Reports'),
t('.'),
t(','),
t('Last reported'),
t('Author'),
t('Body'),
t('Page'),
);
$export['commons_content_moderation_reported_nodes'] = $view;
return $export;
}

View File

@ -1,54 +0,0 @@
<?php
/**
* @file
* Commons module integration for the Commons Documents module.
*/
/**
* Implements hook_commons_entity_integration().
*/
function commons_documents_commons_entity_integration() {
return array(
'node' => array(
'document' => array(
'is_group_content' => TRUE,
'exclude_rate' => TRUE,
'exclude_rate_comments' => TRUE,
),
),
);
}
/**
* Implements hook_commons_bw_group_widget().
*/
function commons_documents_commons_bw_group_widget() {
return array(
'commons_documents' => array(
'title' => t('Docs'),
'type' => 'view',
'vid' => 'commons_bw_documents',
'display' => 'default',
'weight' => 6,
'bundle' => 'document',
),
);
}
/**
* Implements hook_commons_bw_create_all_widget().
*/
function commons_documents_commons_bw_create_all_widget($group) {
if (og_user_access('node', $group->nid, 'create document content')) {
$link = l(t('Create a document'),'node/add/document',
array('attributes' => array('class' => 'commons-documents-create'), 'query' => array('og_group_ref' => $group->nid))
);
return array(
'commons_documents' => array(
'link' => $link,
'text' => t('Share a document'),
'#weight' => 6,
),
);
}
}

View File

@ -1,37 +0,0 @@
<?php
/**
* @file
* commons_documents.features.field_base.inc
*/
/**
* Implements hook_field_default_field_bases().
*/
function commons_documents_field_default_field_bases() {
$field_bases = array();
// Exported field_base: 'field_document_file'
$field_bases['field_document_file'] = array(
'active' => 1,
'cardinality' => -1,
'deleted' => 0,
'entity_types' => array(),
'field_name' => 'field_document_file',
'indexes' => array(
'fid' => array(
0 => 'fid',
),
),
'locked' => 0,
'module' => 'file',
'settings' => array(
'display_default' => 1,
'display_field' => 0,
'uri_scheme' => 'public',
),
'translatable' => 0,
'type' => 'file',
);
return $field_bases;
}

View File

@ -1,107 +0,0 @@
<?php
/**
* @file
* commons_documents.features.field_instance.inc
*/
/**
* Implements hook_field_default_field_instances().
*/
function commons_documents_field_default_field_instances() {
$field_instances = array();
// Exported field_instance: 'node-document-body'
$field_instances['node-document-body'] = array(
'bundle' => 'document',
'default_value' => NULL,
'deleted' => 0,
'description' => '',
'display' => array(
'default' => array(
'label' => 'hidden',
'module' => 'text',
'settings' => array(),
'type' => 'text_default',
'weight' => -49,
),
'teaser' => array(
'label' => 'hidden',
'module' => 'text',
'settings' => array(
'trim_length' => 600,
),
'type' => 'text_summary_or_trimmed',
'weight' => -49,
),
),
'display_in_partial_form' => 1,
'entity_type' => 'node',
'field_name' => 'body',
'label' => 'Body',
'required' => FALSE,
'settings' => array(
'display_summary' => FALSE,
'text_processing' => 1,
'user_register_form' => FALSE,
),
'widget' => array(
'module' => 'text',
'settings' => array(
'rows' => 20,
'summary_rows' => 5,
),
'type' => 'text_textarea_with_summary',
'weight' => -49,
),
);
// Exported field_instance: 'node-document-field_document_file'
$field_instances['node-document-field_document_file'] = array(
'bundle' => 'document',
'deleted' => 0,
'description' => '',
'display' => array(
'default' => array(
'label' => 'above',
'module' => 'file',
'settings' => array(),
'type' => 'file_default',
'weight' => -48,
),
'teaser' => array(
'label' => 'above',
'settings' => array(),
'type' => 'hidden',
'weight' => -48,
),
),
'display_in_partial_form' => 1,
'entity_type' => 'node',
'field_name' => 'field_document_file',
'label' => 'File',
'required' => 1,
'settings' => array(
'description_field' => 1,
'file_directory' => '',
'file_extensions' => 'txt doc docx xls xlsx ppt pptx odt odp ods pdf',
'max_filesize' => '',
'user_register_form' => FALSE,
),
'widget' => array(
'active' => 1,
'module' => 'file',
'settings' => array(
'progress_indicator' => 'throbber',
),
'type' => 'file_generic',
'weight' => -48,
),
);
// Translatables
// Included for use with string extractors like potx.
t('Body');
t('File');
return $field_instances;
}

View File

@ -1,38 +0,0 @@
<?php
/**
* @file
* commons_documents.features.inc
*/
/**
* Implements hook_ctools_plugin_api().
*/
function commons_documents_ctools_plugin_api($module = NULL, $api = NULL) {
if ($module == "strongarm" && $api == "strongarm") {
return array("version" => "1");
}
}
/**
* Implements hook_views_api().
*/
function commons_documents_views_api($module = NULL, $api = NULL) {
return array("api" => "3.0");
}
/**
* Implements hook_node_info().
*/
function commons_documents_node_info() {
$items = array(
'document' => array(
'name' => t('Document'),
'base' => 'node_content',
'description' => t('Upload and display files or attachments to share with others.'),
'has_title' => '1',
'title_label' => t('Title'),
'help' => '',
),
);
return $items;
}

View File

@ -1,52 +0,0 @@
<?php
/**
* @file
* commons_documents.features.og_features_permission.inc
*/
/**
* Implements hook_og_features_default_permissions().
*/
function commons_documents_og_features_default_permissions() {
$permissions = array();
// Exported og permission: 'node:group:create document content'
$permissions['node:group:create document content'] = array(
'roles' => array(
'administrator member' => 'administrator member',
'member' => 'member',
),
);
// Exported og permission: 'node:group:delete any document content'
$permissions['node:group:delete any document content'] = array(
'roles' => array(
'administrator member' => 'administrator member',
),
);
// Exported og permission: 'node:group:delete own document content'
$permissions['node:group:delete own document content'] = array(
'roles' => array(
'administrator member' => 'administrator member',
'member' => 'member',
),
);
// Exported og permission: 'node:group:update any document content'
$permissions['node:group:update any document content'] = array(
'roles' => array(
'administrator member' => 'administrator member',
),
);
// Exported og permission: 'node:group:update own document content'
$permissions['node:group:update own document content'] = array(
'roles' => array(
'administrator member' => 'administrator member',
'member' => 'member',
),
);
return $permissions;
}

View File

@ -1,62 +0,0 @@
<?php
/**
* @file
* commons_documents.features.user_permission.inc
*/
/**
* Implements hook_user_default_permissions().
*/
function commons_documents_user_default_permissions() {
$permissions = array();
// Exported permission: 'create document content'.
$permissions['create document content'] = array(
'name' => 'create document content',
'roles' => array(
'administrator' => 'administrator',
'authenticated user' => 'authenticated user',
),
'module' => 'node',
);
// Exported permission: 'delete any document content'.
$permissions['delete any document content'] = array(
'name' => 'delete any document content',
'roles' => array(
'administrator' => 'administrator',
),
'module' => 'node',
);
// Exported permission: 'delete own document content'.
$permissions['delete own document content'] = array(
'name' => 'delete own document content',
'roles' => array(
'administrator' => 'administrator',
'authenticated user' => 'authenticated user',
),
'module' => 'node',
);
// Exported permission: 'edit any document content'.
$permissions['edit any document content'] = array(
'name' => 'edit any document content',
'roles' => array(
'administrator' => 'administrator',
),
'module' => 'node',
);
// Exported permission: 'edit own document content'.
$permissions['edit own document content'] = array(
'name' => 'edit own document content',
'roles' => array(
'administrator' => 'administrator',
'authenticated user' => 'authenticated user',
),
'module' => 'node',
);
return $permissions;
}

View File

@ -1,61 +0,0 @@
name = Commons Documents
description = Provides a Document content type for sharing files.
package = Commons - Content types
core = 7.x
dependencies[] = commons_body
dependencies[] = commons_topics
dependencies[] = ctools
dependencies[] = entity
dependencies[] = entityreference
dependencies[] = features
dependencies[] = file
dependencies[] = node
dependencies[] = og
dependencies[] = og_ui
dependencies[] = strongarm
dependencies[] = taxonomy
dependencies[] = text
dependencies[] = views
dependencies[] = views_litepager
features[ctools][] = strongarm:strongarm:1
features[ctools][] = views:views_default:3.0
features[features_api][] = api:2
features[field_base][] = field_document_file
features[field_instance][] = node-document-body
features[field_instance][] = node-document-field_document_file
features[node][] = document
features[og_features_permission][] = node:group:create document content
features[og_features_permission][] = node:group:delete any document content
features[og_features_permission][] = node:group:delete own document content
features[og_features_permission][] = node:group:update any document content
features[og_features_permission][] = node:group:update own document content
features[user_permission][] = create document content
features[user_permission][] = delete any document content
features[user_permission][] = delete own document content
features[user_permission][] = edit any document content
features[user_permission][] = edit own document content
features[variable][] = comment_anonymous_document
features[variable][] = comment_default_mode_document
features[variable][] = comment_default_per_page_document
features[variable][] = comment_document
features[variable][] = comment_form_location_document
features[variable][] = comment_preview_document
features[variable][] = comment_subject_field_document
features[variable][] = field_bundle_settings_node__document
features[variable][] = menu_options_document
features[variable][] = menu_parent_document
features[variable][] = node_options_document
features[variable][] = node_preview_document
features[variable][] = node_submitted_document
features[views_view][] = commons_bw_documents
features_exclude[dependencies][commons_trusted_contacts] = commons_trusted_contacts
; Information added by Drupal.org packaging script on 2015-03-18
version = "7.x-3.23"
core = "7.x"
project = "commons"
datestamp = "1426714630"

View File

@ -1,144 +0,0 @@
<?php
/**
* Set default polls roles upon enable
*/
function commons_documents_enable() {
$revert = array(
'commons_documents' => array('og_features_permission'),
);
features_revert($revert);
$groups = og_get_all_group();
foreach ($groups AS $gid) {
commons_groups_features_permission_rebuild('commons_documents', $gid);
}
}
/**
* Disable summary on Document nodes.
*/
function commons_documents_update_7000() {
$revert = array(
'commons_documents' => array('field_instance'),
);
features_revert($revert);
return array();
}
/**
* Disable default frontpage promotion of Document nodes.
*/
function commons_documents_update_7001() {
$revert = array(
'commons_documents' => array('variable'),
);
features_revert($revert);
return array();
}
/**
* Remove unused view displays.
*/
function commons_documents_update_7002() {
$revert = array(
'commons_documents' => array('views_view'),
);
features_revert($revert);
return array();
}
/**
* Standardize Browsing Widget views.
*/
function commons_documents_update_7003() {
$revert = array(
'commons_documents' => array('views_view'),
);
features_revert($revert);
return array();
}
/**
* Display sticky content at top of lists.
*/
function commons_documents_update_7004() {
$revert = array(
'commons_documents' => array('views_view'),
);
features_revert($revert);
return array();
}
/**
* Add .txt to the list of allowed file extensions.
*/
function commons_documents_update_7005() {
$revert = array(
'commons_documents' => array('field_instance'),
);
features_revert($revert);
return array();
}
/**
* Add links to node teasers in the browsing widget.
*/
function commons_documents_update_7006() {
$revert = array(
'commons_documents' => array('views_view'),
);
features_revert($revert);
return array();
}
/**
* Improve the browsing widget empty text.
*/
function commons_documents_update_7007() {
$revert = array(
'commons_documents' => array('views_view'),
);
features_revert($revert);
return array();
}
/**
* Replace the title attribute with the title field in view displays.
*/
function commons_documents_update_7008() {
$revert = array(
'commons_documents' => array('views_view'),
);
features_revert($revert);
return array();
}
/**
* Reset document og permissions automatically, they were not set before now.
*/
function commons_documents_update_7009() {
$revert = array(
'commons_documents' => array('og_features_permission'),
);
features_revert($revert);
$groups = og_get_all_group();
foreach ($groups AS $gid) {
commons_groups_features_permission_rebuild('commons_documents', $gid);
}
return array();
}
/**
* Standardize browsing widget field weights.
*/
function commons_documents_update_7010() {
$revert = array(
'commons_documents' => array('field_instance'),
);
features_revert($revert);
return array();
}

View File

@ -1,72 +0,0 @@
<?php
/**
* @file
* Code for the Commons Documents feature.
*/
include_once 'commons_documents.features.inc';
/**
* Implements hook_form_BASE_FORM_ID_alter().
*/
function commons_documents_form_node_form_alter(&$form, &$form_state, $form_id) {
$node = $form['#node'];
list(, , $bundle) = entity_extract_ids('node', $node);
if ($bundle == 'document' && empty($node->nid)) {
drupal_set_title(t('Create a document'));
}
}
/**
* Implements hook_form_FROM_ID_alter().
*/
function commons_documents_form_commons_bw_partial_node_form_alter(&$form, &$form_state) {
if (empty($form['#entity']) || $form['#entity']->type != 'document') {
return;
}
$form['title']['#markup'] = t('Create a document');
$language = $form['body']['#language'];
$form['body'][$language][0]['#title_display'] = 'invisible';
$form['body'][$language][0]['#required'] = TRUE;
$form['body'][$language][0]['#placeholder'] = t('Describe the document');
$form['body'][$language][0]['#resizable'] = FALSE;
// Set fields as hideable so the forms can be compacted.
$form['body']['#attributes']['class'][] = 'trigger-field';
foreach (array('field_image', 'og_group_ref', 'field_document_file', 'actions') as $field) {
if (isset($form[$field])) {
$form[$field]['#attributes']['class'][] = 'hideable-field';
}
}
$form['#pre_render'][] = 'commons_documents_form_commons_bw_partial_node_form_after_build';
}
/**
* After-build call-back.
* See commons_documents_form_commons_bw_partial_node_form_alter().
*/
function commons_documents_form_commons_bw_partial_node_form_after_build($form) {
$language = $form['body']['#language'];
$form['body'][$language][0]['#pre_render'] = array();
$form['body'][$language][0]['format']['#access'] = FALSE;
$form['body'][$language][0]['value']['#rows'] = 3;
return $form;
}
/**
* Implements hook_views_pre_render().
*/
function commons_documents_views_pre_render(&$view) {
// Improve the browsing widget empty text when displayed outside of a group.
// TODO: Enable og_context and check group context instead of looking for an
// empty first argument.
if (empty($view->args[0]) && $view->name == 'commons_bw_documents') {
$view->display_handler->handlers['empty']['area']->options['content'] = t('No documents have been created.');
}
}

View File

@ -1,119 +0,0 @@
<?php
/**
* @file
* commons_documents.strongarm.inc
*/
/**
* Implements hook_strongarm().
*/
function commons_documents_strongarm() {
$export = array();
$strongarm = new stdClass();
$strongarm->disabled = FALSE; /* Edit this to true to make a default strongarm disabled initially */
$strongarm->api_version = 1;
$strongarm->name = 'comment_anonymous_document';
$strongarm->value = 0;
$export['comment_anonymous_document'] = $strongarm;
$strongarm = new stdClass();
$strongarm->disabled = FALSE; /* Edit this to true to make a default strongarm disabled initially */
$strongarm->api_version = 1;
$strongarm->name = 'comment_default_mode_document';
$strongarm->value = 1;
$export['comment_default_mode_document'] = $strongarm;
$strongarm = new stdClass();
$strongarm->disabled = FALSE; /* Edit this to true to make a default strongarm disabled initially */
$strongarm->api_version = 1;
$strongarm->name = 'comment_default_per_page_document';
$strongarm->value = '50';
$export['comment_default_per_page_document'] = $strongarm;
$strongarm = new stdClass();
$strongarm->disabled = FALSE; /* Edit this to true to make a default strongarm disabled initially */
$strongarm->api_version = 1;
$strongarm->name = 'comment_document';
$strongarm->value = '2';
$export['comment_document'] = $strongarm;
$strongarm = new stdClass();
$strongarm->disabled = FALSE; /* Edit this to true to make a default strongarm disabled initially */
$strongarm->api_version = 1;
$strongarm->name = 'comment_form_location_document';
$strongarm->value = 1;
$export['comment_form_location_document'] = $strongarm;
$strongarm = new stdClass();
$strongarm->disabled = FALSE; /* Edit this to true to make a default strongarm disabled initially */
$strongarm->api_version = 1;
$strongarm->name = 'comment_preview_document';
$strongarm->value = '1';
$export['comment_preview_document'] = $strongarm;
$strongarm = new stdClass();
$strongarm->disabled = FALSE; /* Edit this to true to make a default strongarm disabled initially */
$strongarm->api_version = 1;
$strongarm->name = 'comment_subject_field_document';
$strongarm->value = 1;
$export['comment_subject_field_document'] = $strongarm;
$strongarm = new stdClass();
$strongarm->disabled = FALSE; /* Edit this to true to make a default strongarm disabled initially */
$strongarm->api_version = 1;
$strongarm->name = 'field_bundle_settings_node__document';
$strongarm->value = array(
'view_modes' => array(),
'extra_fields' => array(
'form' => array(
'title' => array(
'weight' => '0',
),
),
'display' => array(),
),
);
$export['field_bundle_settings_node__document'] = $strongarm;
$strongarm = new stdClass();
$strongarm->disabled = FALSE; /* Edit this to true to make a default strongarm disabled initially */
$strongarm->api_version = 1;
$strongarm->name = 'menu_options_document';
$strongarm->value = array(
0 => 'main-menu',
);
$export['menu_options_document'] = $strongarm;
$strongarm = new stdClass();
$strongarm->disabled = FALSE; /* Edit this to true to make a default strongarm disabled initially */
$strongarm->api_version = 1;
$strongarm->name = 'menu_parent_document';
$strongarm->value = 'main-menu:0';
$export['menu_parent_document'] = $strongarm;
$strongarm = new stdClass();
$strongarm->disabled = FALSE; /* Edit this to true to make a default strongarm disabled initially */
$strongarm->api_version = 1;
$strongarm->name = 'node_options_document';
$strongarm->value = array(
0 => 'status',
);
$export['node_options_document'] = $strongarm;
$strongarm = new stdClass();
$strongarm->disabled = FALSE; /* Edit this to true to make a default strongarm disabled initially */
$strongarm->api_version = 1;
$strongarm->name = 'node_preview_document';
$strongarm->value = '1';
$export['node_preview_document'] = $strongarm;
$strongarm = new stdClass();
$strongarm->disabled = FALSE; /* Edit this to true to make a default strongarm disabled initially */
$strongarm->api_version = 1;
$strongarm->name = 'node_submitted_document';
$strongarm->value = 1;
$export['node_submitted_document'] = $strongarm;
return $export;
}

View File

@ -1,145 +0,0 @@
<?php
/**
* @file
* commons_documents.views_default.inc
*/
/**
* Implements hook_views_default_views().
*/
function commons_documents_views_default_views() {
$export = array();
$view = new view();
$view->name = 'commons_bw_documents';
$view->description = 'Commons Documents listing for the group browsing widget.';
$view->tag = 'Commons Documents, Commons Browsing Widget';
$view->base_table = 'node';
$view->human_name = 'Commons Browsing Widget - Documents';
$view->core = 7;
$view->api_version = '3.0';
$view->disabled = FALSE; /* Edit this to true to make a default view disabled initially */
/* Display: Master */
$handler = $view->new_display('default', 'Master', 'default');
$handler->display->display_options['use_ajax'] = TRUE;
$handler->display->display_options['use_more_always'] = FALSE;
$handler->display->display_options['access']['type'] = 'perm';
$handler->display->display_options['cache']['type'] = 'none';
$handler->display->display_options['query']['type'] = 'views_query';
$handler->display->display_options['query']['options']['query_comment'] = FALSE;
$handler->display->display_options['exposed_form']['type'] = 'basic';
$handler->display->display_options['pager']['type'] = 'lite';
$handler->display->display_options['pager']['options']['items_per_page'] = '10';
$handler->display->display_options['pager']['options']['offset'] = '0';
$handler->display->display_options['pager']['options']['id'] = '5';
$handler->display->display_options['pager']['options']['quantity'] = '9';
$handler->display->display_options['style_plugin'] = 'default';
$handler->display->display_options['row_plugin'] = 'node';
/* Header: Global: Node partial form */
$handler->display->display_options['header']['commons_bw_node_partial_form']['id'] = 'commons_bw_node_partial_form';
$handler->display->display_options['header']['commons_bw_node_partial_form']['table'] = 'views';
$handler->display->display_options['header']['commons_bw_node_partial_form']['field'] = 'commons_bw_node_partial_form';
$handler->display->display_options['header']['commons_bw_node_partial_form']['bundle'] = 'document';
/* No results behavior: Global: Text area */
$handler->display->display_options['empty']['area']['id'] = 'area';
$handler->display->display_options['empty']['area']['table'] = 'views';
$handler->display->display_options['empty']['area']['field'] = 'area';
$handler->display->display_options['empty']['area']['empty'] = TRUE;
$handler->display->display_options['empty']['area']['content'] = 'No documents have been added to this group.';
$handler->display->display_options['empty']['area']['format'] = 'filtered_html';
/* Relationship: OG membership: OG membership from Node */
$handler->display->display_options['relationships']['og_membership_rel']['id'] = 'og_membership_rel';
$handler->display->display_options['relationships']['og_membership_rel']['table'] = 'node';
$handler->display->display_options['relationships']['og_membership_rel']['field'] = 'og_membership_rel';
$handler->display->display_options['relationships']['og_membership_rel']['required'] = TRUE;
/* Field: Content: Title */
$handler->display->display_options['fields']['title_field']['id'] = 'title_field';
$handler->display->display_options['fields']['title_field']['table'] = 'field_data_title_field';
$handler->display->display_options['fields']['title_field']['field'] = 'title_field';
$handler->display->display_options['fields']['title_field']['label'] = '';
$handler->display->display_options['fields']['title_field']['link_to_entity'] = 1;
/* Sort criterion: Content: Sticky */
$handler->display->display_options['sorts']['sticky']['id'] = 'sticky';
$handler->display->display_options['sorts']['sticky']['table'] = 'node';
$handler->display->display_options['sorts']['sticky']['field'] = 'sticky';
$handler->display->display_options['sorts']['sticky']['order'] = 'DESC';
/* Sort criterion: Content: Post date */
$handler->display->display_options['sorts']['created']['id'] = 'created';
$handler->display->display_options['sorts']['created']['table'] = 'node';
$handler->display->display_options['sorts']['created']['field'] = 'created';
$handler->display->display_options['sorts']['created']['order'] = 'DESC';
$handler->display->display_options['sorts']['created']['exposed'] = TRUE;
$handler->display->display_options['sorts']['created']['expose']['label'] = 'Post date';
/* Contextual filter: OG membership: Group ID */
$handler->display->display_options['arguments']['gid']['id'] = 'gid';
$handler->display->display_options['arguments']['gid']['table'] = 'og_membership';
$handler->display->display_options['arguments']['gid']['field'] = 'gid';
$handler->display->display_options['arguments']['gid']['relationship'] = 'og_membership_rel';
$handler->display->display_options['arguments']['gid']['default_argument_type'] = 'fixed';
$handler->display->display_options['arguments']['gid']['summary']['number_of_records'] = '0';
$handler->display->display_options['arguments']['gid']['summary']['format'] = 'default_summary';
$handler->display->display_options['arguments']['gid']['summary_options']['items_per_page'] = '25';
/* Filter criterion: Content: Published */
$handler->display->display_options['filters']['status']['id'] = 'status';
$handler->display->display_options['filters']['status']['table'] = 'node';
$handler->display->display_options['filters']['status']['field'] = 'status';
$handler->display->display_options['filters']['status']['value'] = 1;
$handler->display->display_options['filters']['status']['group'] = 1;
$handler->display->display_options['filters']['status']['expose']['operator'] = FALSE;
/* Filter criterion: Content: Type */
$handler->display->display_options['filters']['type']['id'] = 'type';
$handler->display->display_options['filters']['type']['table'] = 'node';
$handler->display->display_options['filters']['type']['field'] = 'type';
$handler->display->display_options['filters']['type']['value'] = array(
'document' => 'document',
);
$handler->display->display_options['filters']['type']['group'] = 1;
/* Filter criterion: OG membership: Group_type */
$handler->display->display_options['filters']['group_type']['id'] = 'group_type';
$handler->display->display_options['filters']['group_type']['table'] = 'og_membership';
$handler->display->display_options['filters']['group_type']['field'] = 'group_type';
$handler->display->display_options['filters']['group_type']['relationship'] = 'og_membership_rel';
$handler->display->display_options['filters']['group_type']['value'] = array(
'node' => 'node',
);
$handler->display->display_options['filters']['group_type']['group'] = 1;
$translatables['commons_bw_documents'] = array(
t('Master'),
t('more'),
t('Apply'),
t('Reset'),
t('Sort by'),
t('Asc'),
t('Desc'),
t('Items per page'),
t('- All -'),
t('Offset'),
t('« first'),
t(' previous'),
t('next '),
t('last »'),
t('No documents have been added to this group.'),
t('OG membership from node'),
t('following'),
t('Post date'),
t('most active'),
t('All'),
t('Following'),
);
$export['commons_bw_documents'] = $view;
return $export;
}
/**
* Implements hook_views_default_views_alter().
*
* Display documents on the browsing widget main view.
*/
function commons_documents_views_default_views_alter(&$views) {
if (!empty($views['commons_bw_all'])) {
$views['commons_bw_all']->display['default']->display_options['filters']['type']['value']['document'] = 'document';
}
}

View File

@ -1 +0,0 @@
See the 7.x-1.x branch.

View File

@ -1,40 +0,0 @@
<?php
/**
* @file
* Commons module integration for the Commons Events module.
*/
/**
* Implements hook_commons_entity_integration().
*/
function commons_events_commons_entity_integration() {
return array(
'node' => array(
'event' => array(
'is_group_content' => TRUE,
),
),
);
}
/**
* Implements hook_commons_bw_create_all_widget().
*/
function commons_events_commons_bw_create_all_widget($group) {
if (og_user_access('node', $group->nid, 'create event content')) {
$link = l(t('List an event'), 'node/add/event',
array(
'attributes' => array('class' => 'commons-events-create'),
'query' => array('og_group_ref' => $group->nid),
)
);
return array(
'commons_events' => array(
'link' => $link,
'text' => t('Create in-person or online meetups'),
'#weight' => 6,
),
);
}
}

View File

@ -1,204 +0,0 @@
<?php
/**
* @file
* commons_events.features.field_base.inc
*/
/**
* Implements hook_field_default_field_bases().
*/
function commons_events_field_default_field_bases() {
$field_bases = array();
// Exported field_base: 'field_date'
$field_bases['field_date'] = array(
'active' => 1,
'cardinality' => 1,
'deleted' => 0,
'entity_types' => array(),
'field_name' => 'field_date',
'indexes' => array(),
'locked' => 0,
'module' => 'date',
'settings' => array(
'cache_count' => 4,
'cache_enabled' => 0,
'granularity' => array(
'day' => 'day',
'hour' => 'hour',
'minute' => 'minute',
'month' => 'month',
'second' => 0,
'year' => 'year',
),
'timezone_db' => 'UTC',
'todate' => 'required',
'tz_handling' => 'site',
),
'translatable' => 0,
'type' => 'datetime',
);
// Exported field_base: 'field_location'
$field_bases['field_location'] = array(
'active' => 1,
'cardinality' => 1,
'deleted' => 0,
'entity_types' => array(),
'field_name' => 'field_location',
'indexes' => array(
'value' => array(
0 => 'value',
),
),
'locked' => 0,
'module' => 'list',
'settings' => array(
'allowed_values' => array(
'physical' => 'Physical Address',
'online' => 'Online',
'online_physical' => 'Online and Physical Address',
),
'allowed_values_function' => '',
),
'translatable' => 0,
'type' => 'list_text',
);
// Exported field_base: 'field_logo'
$field_bases['field_logo'] = array(
'active' => 1,
'cardinality' => 1,
'deleted' => 0,
'entity_types' => array(),
'field_name' => 'field_logo',
'indexes' => array(
'fid' => array(
0 => 'fid',
),
),
'locked' => 0,
'module' => 'image',
'settings' => array(
'default_image' => 0,
'uri_scheme' => 'public',
),
'translatable' => 0,
'type' => 'image',
);
// Exported field_base: 'field_number_of_attendees'
$field_bases['field_number_of_attendees'] = array(
'active' => 1,
'cardinality' => 1,
'deleted' => 0,
'entity_types' => array(),
'field_name' => 'field_number_of_attendees',
'indexes' => array(),
'locked' => 0,
'module' => 'number',
'settings' => array(),
'translatable' => 0,
'type' => 'number_integer',
);
// Exported field_base: 'field_offsite_url'
$field_bases['field_offsite_url'] = array(
'active' => 1,
'cardinality' => 1,
'deleted' => 0,
'entity_types' => array(),
'field_name' => 'field_offsite_url',
'indexes' => array(
'format' => array(
0 => 'format',
),
),
'locked' => 0,
'module' => 'text',
'settings' => array(
'max_length' => 255,
),
'translatable' => 0,
'type' => 'text',
);
// Exported field_base: 'field_organizers'
$field_bases['field_organizers'] = array(
'active' => 1,
'cardinality' => -1,
'deleted' => 0,
'entity_types' => array(),
'field_name' => 'field_organizers',
'indexes' => array(
'target_id' => array(
0 => 'target_id',
),
),
'locked' => 0,
'module' => 'entityreference',
'settings' => array(
'handler' => 'base',
'handler_settings' => array(
'behaviors' => array(
'views-select-list' => array(
'status' => 0,
),
),
'sort' => array(
'type' => 'none',
),
'target_bundles' => array(),
),
'target_type' => 'user',
),
'translatable' => 0,
'type' => 'entityreference',
);
// Exported field_base: 'field_registration'
$field_bases['field_registration'] = array(
'active' => 1,
'cardinality' => 1,
'deleted' => 0,
'entity_types' => array(),
'field_name' => 'field_registration',
'indexes' => array(
'registration_type' => array(
0 => 'registration_type',
),
),
'locked' => 0,
'module' => 'registration',
'settings' => array(),
'translatable' => 0,
'type' => 'registration',
);
// Exported field_base: 'field_registration_type'
$field_bases['field_registration_type'] = array(
'active' => 1,
'cardinality' => 1,
'deleted' => 0,
'entity_types' => array(),
'field_name' => 'field_registration_type',
'indexes' => array(
'value' => array(
0 => 'value',
),
),
'locked' => 0,
'module' => 'list',
'settings' => array(
'allowed_values' => array(
'onsite' => 'On this site',
'external' => 'On another site',
),
'allowed_values_function' => '',
),
'translatable' => 0,
'type' => 'list_text',
);
return $field_bases;
}

View File

@ -1,736 +0,0 @@
<?php
/**
* @file
* commons_events.features.field_instance.inc
*/
/**
* Implements hook_field_default_field_instances().
*/
function commons_events_field_default_field_instances() {
$field_instances = array();
// Because the 'site_default_country' variable gets set, but is empty when no
// default country is set, we'll need to do some checks to see if its empty
// and display a default country on our own.
// See https://drupal.org/node/2068957#comment-7773019 for more info.
$default_country = variable_get('site_default_country', 'US');
// Exported field_instance: 'node-event-body'
$field_instances['node-event-body'] = array(
'bundle' => 'event',
'default_value' => NULL,
'deleted' => 0,
'description' => '',
'display' => array(
'default' => array(
'label' => 'hidden',
'module' => 'text',
'settings' => array(),
'type' => 'text_default',
'weight' => -49,
),
'teaser' => array(
'label' => 'hidden',
'module' => 'text',
'settings' => array(
'trim_length' => 600,
),
'type' => 'text_summary_or_trimmed',
'weight' => -49,
),
),
'entity_type' => 'node',
'field_name' => 'body',
'label' => 'Description',
'required' => 1,
'settings' => array(
'display_summary' => FALSE,
'text_processing' => 1,
'user_register_form' => FALSE,
),
'widget' => array(
'active' => 1,
'module' => 'text',
'settings' => array(
'rows' => 20,
'summary_rows' => 5,
),
'type' => 'text_textarea_with_summary',
'weight' => -49,
),
);
// Exported field_instance: 'node-event-field_address'
$field_instances['node-event-field_address'] = array(
'bundle' => 'event',
'default_value' => array(
0 => array(
'element_key' => 'node|event|field_address|und|0',
'thoroughfare' => '',
'premise' => '',
'locality' => '',
'administrative_area' => '',
'postal_code' => '',
'country' => !empty($default_country) ? $default_country : 'US',
),
),
'deleted' => 0,
'description' => '',
'display' => array(
'default' => array(
'label' => 'hidden',
'module' => 'addressfield_tokens',
'settings' => array(
'components' => array(
'administrative_area' => 'administrative_area',
'locality' => 'locality',
'postal_code' => 'postal_code',
'thoroughfare' => 'thoroughfare',
),
'separator' => ', ',
),
'type' => 'addressfield_components',
'weight' => 2,
),
'teaser' => array(
'label' => 'hidden',
'module' => 'addressfield_tokens',
'settings' => array(
'components' => array(
'administrative_area' => 'administrative_area',
'locality' => 'locality',
'postal_code' => 'postal_code',
'thoroughfare' => 'thoroughfare',
),
'separator' => ', ',
),
'type' => 'addressfield_components',
'weight' => 2,
),
),
'entity_type' => 'node',
'field_name' => 'field_address',
'label' => 'Address',
'required' => 0,
'settings' => array(
'user_register_form' => FALSE,
),
'widget' => array(
'active' => 1,
'module' => 'addressfield',
'settings' => array(
'available_countries' => array(),
'format_handlers' => array(
'address' => 'address',
'address-hide-country' => 0,
'organisation' => 0,
'name-full' => 0,
'name-oneline' => 0,
),
),
'type' => 'addressfield_standard',
'weight' => 8,
),
);
// Exported field_instance: 'node-event-field_date'
$field_instances['node-event-field_date'] = array(
'bundle' => 'event',
'deleted' => 0,
'description' => '',
'display' => array(
'default' => array(
'label' => 'hidden',
'module' => 'date',
'settings' => array(
'format_type' => 'event_datetime',
'fromto' => 'both',
'multiple_from' => '',
'multiple_number' => '',
'multiple_to' => '',
),
'type' => 'date_default',
'weight' => 1,
),
'teaser' => array(
'label' => 'hidden',
'module' => 'date',
'settings' => array(
'format_type' => 'event_datetime',
'fromto' => 'both',
'multiple_from' => '',
'multiple_number' => '',
'multiple_to' => '',
),
'type' => 'date_default',
'weight' => 1,
),
),
'entity_type' => 'node',
'field_name' => 'field_date',
'label' => 'Date',
'required' => 1,
'settings' => array(
'default_value' => 'now',
'default_value2' => 'same',
'default_value_code' => '',
'default_value_code2' => '',
'user_register_form' => FALSE,
),
'widget' => array(
'active' => 1,
'module' => 'date',
'settings' => array(
'increment' => 15,
'input_format' => 'm/d/Y - H:i:s',
'input_format_custom' => 'd M Y - h:i:s a',
'label_position' => 'above',
'text_parts' => array(),
'year_range' => '-3:+3',
),
'type' => 'date_popup',
'weight' => 5,
),
);
// Exported field_instance: 'node-event-field_location'
$field_instances['node-event-field_location'] = array(
'bundle' => 'event',
'default_value' => array(
0 => array(
'value' => 'online_physical',
),
),
'deleted' => 0,
'description' => '',
'display' => array(
'default' => array(
'label' => 'above',
'settings' => array(),
'type' => 'hidden',
'weight' => 9,
),
'teaser' => array(
'label' => 'above',
'settings' => array(),
'type' => 'hidden',
'weight' => 0,
),
),
'entity_type' => 'node',
'field_name' => 'field_location',
'label' => 'Location',
'required' => 0,
'settings' => array(
'user_register_form' => FALSE,
),
'widget' => array(
'active' => 1,
'module' => 'options',
'settings' => array(),
'type' => 'options_select',
'weight' => 7,
),
);
// Exported field_instance: 'node-event-field_logo'
$field_instances['node-event-field_logo'] = array(
'bundle' => 'event',
'deleted' => 0,
'description' => '',
'display' => array(
'default' => array(
'label' => 'hidden',
'module' => 'image',
'settings' => array(
'image_link' => '',
'image_style' => '50x50',
),
'type' => 'image',
'weight' => 0,
),
'teaser' => array(
'label' => 'hidden',
'module' => 'image',
'settings' => array(
'image_link' => '',
'image_style' => '50x50',
),
'type' => 'image',
'weight' => 0,
),
),
'entity_type' => 'node',
'field_name' => 'field_logo',
'label' => 'Event logo',
'required' => 0,
'settings' => array(
'alt_field' => 0,
'default_image' => 0,
'file_directory' => '',
'file_extensions' => 'png gif jpg jpeg',
'max_filesize' => '2 MB',
'max_resolution' => '',
'min_resolution' => '',
'title_field' => 0,
'user_register_form' => FALSE,
),
'widget' => array(
'active' => 1,
'module' => 'image',
'settings' => array(
'preview_image_style' => '50x50',
'progress_indicator' => 'throbber',
),
'type' => 'image_image',
'weight' => 9,
),
);
// Exported field_instance: 'node-event-field_number_of_attendees'
$field_instances['node-event-field_number_of_attendees'] = array(
'bundle' => 'event',
'default_value' => array(
0 => array(
'value' => 0,
),
),
'deleted' => 0,
'description' => 'Enter 0 for unlimited',
'display' => array(
'default' => array(
'label' => 'above',
'settings' => array(),
'type' => 'hidden',
'weight' => 8,
),
'teaser' => array(
'label' => 'above',
'settings' => array(),
'type' => 'hidden',
'weight' => 0,
),
),
'entity_type' => 'node',
'field_name' => 'field_number_of_attendees',
'label' => 'Maximum number of attendees',
'required' => 1,
'settings' => array(
'max' => '',
'min' => 0,
'prefix' => '',
'suffix' => '',
'user_register_form' => FALSE,
),
'widget' => array(
'active' => 0,
'module' => 'number',
'settings' => array(),
'type' => 'number',
'weight' => 12,
),
);
// Exported field_instance: 'node-event-field_offsite_url'
$field_instances['node-event-field_offsite_url'] = array(
'bundle' => 'event',
'default_value' => NULL,
'deleted' => 0,
'description' => '',
'display' => array(
'default' => array(
'label' => 'hidden',
'module' => 'text',
'settings' => array(),
'type' => 'text_default',
'weight' => 4,
),
'teaser' => array(
'label' => 'above',
'settings' => array(),
'type' => 'hidden',
'weight' => 0,
),
),
'entity_type' => 'node',
'field_name' => 'field_offsite_url',
'label' => 'URL',
'required' => 0,
'settings' => array(
'text_processing' => 0,
'user_register_form' => FALSE,
),
'widget' => array(
'active' => 1,
'module' => 'text',
'settings' => array(
'size' => 60,
),
'type' => 'text_textfield',
'weight' => 3,
),
);
// Exported field_instance: 'node-event-field_organizers'
$field_instances['node-event-field_organizers'] = array(
'bundle' => 'event',
'default_value' => NULL,
'default_value_function' => '',
'deleted' => 0,
'description' => '',
'display' => array(
'default' => array(
'label' => 'above',
'module' => 'entityreference',
'settings' => array(
'link' => FALSE,
),
'type' => 'hidden',
'weight' => 12,
),
'teaser' => array(
'label' => 'above',
'settings' => array(),
'type' => 'hidden',
'weight' => 0,
),
),
'entity_type' => 'node',
'field_name' => 'field_organizers',
'label' => 'Organizers',
'required' => 1,
'settings' => array(
'behaviors' => array(
'prepopulate' => array(
'status' => 0,
),
),
'user_register_form' => FALSE,
),
'widget' => array(
'active' => 1,
'module' => 'entityreference',
'settings' => array(
'match_operator' => 'CONTAINS',
'path' => '',
'size' => 60,
),
'type' => 'entityreference_autocomplete_tags',
'weight' => 2,
),
);
// Exported field_instance: 'node-event-field_registration'
$field_instances['node-event-field_registration'] = array(
'bundle' => 'event',
'default_value' => array(
0 => array(
'registration_type' => 'event',
),
),
'deleted' => 0,
'description' => '',
'display' => array(
'default' => array(
'label' => 'above',
'settings' => array(),
'type' => 'hidden',
'weight' => 10,
),
'teaser' => array(
'label' => 'above',
'settings' => array(),
'type' => 'hidden',
'weight' => 0,
),
),
'entity_type' => 'node',
'field_name' => 'field_registration',
'label' => 'Registration bundle',
'required' => 0,
'settings' => array(
'default_registration_settings' => array(
'capacity' => 0,
'reminder' => array(
'reminder_settings' => array(
'reminder_date' => '',
'reminder_template' => '',
),
'send_reminder' => 0,
),
'scheduling' => array(
'close' => '',
'open' => '',
),
'settings' => array(
'from_address' => 'admin@example.com',
'multiple_registrations' => 0,
),
'status' => 1,
),
'user_register_form' => FALSE,
),
'widget' => array(
'active' => 0,
'module' => 'registration',
'settings' => array(),
'type' => 'registration_select',
'weight' => 10,
),
);
// Exported field_instance: 'node-event-field_registration_type'
$field_instances['node-event-field_registration_type'] = array(
'bundle' => 'event',
'default_value' => NULL,
'deleted' => 0,
'description' => '',
'display' => array(
'default' => array(
'label' => 'above',
'settings' => array(),
'type' => 'hidden',
'weight' => 11,
),
'teaser' => array(
'label' => 'above',
'settings' => array(),
'type' => 'hidden',
'weight' => 0,
),
),
'entity_type' => 'node',
'field_name' => 'field_registration_type',
'label' => 'Registration type',
'required' => 0,
'settings' => array(
'user_register_form' => FALSE,
),
'widget' => array(
'active' => 1,
'module' => 'options',
'settings' => array(),
'type' => 'options_select',
'weight' => 11,
),
);
// Exported field_instance: 'message-commons_events_event_node_created-field_message_rendered_body'
$field_instances['message-commons_events_event_node_created-field_message_rendered_body'] = array(
'bundle' => 'commons_events_event_node_created',
'default_value' => NULL,
'deleted' => 0,
'description' => '',
'display' => array(
'default' => array(
'label' => 'above',
'module' => 'text',
'settings' => array(),
'type' => 'text_default',
'weight' => 2,
),
'message_notify_email_body' => array(
'label' => 'above',
'settings' => array(),
'type' => 'hidden',
'weight' => 4,
),
'message_notify_email_subject' => array(
'label' => 'above',
'settings' => array(),
'type' => 'hidden',
'weight' => 4,
),
),
'entity_type' => 'message',
'field_name' => 'field_message_rendered_body',
'label' => 'Body',
'required' => 0,
'settings' => array(
'text_processing' => 0,
'user_register_form' => FALSE,
),
'widget' => array(
'active' => 1,
'module' => 'text',
'settings' => array(
'rows' => 5,
),
'type' => 'text_textarea',
'weight' => 6,
),
);
// Exported field_instance: 'message-commons_events_event_node_created-field_message_rendered_subject'
$field_instances['message-commons_events_event_node_created-field_message_rendered_subject'] = array(
'bundle' => 'commons_events_event_node_created',
'default_value' => NULL,
'deleted' => 0,
'description' => '',
'display' => array(
'default' => array(
'label' => 'above',
'module' => 'text',
'settings' => array(),
'type' => 'text_default',
'weight' => 3,
),
'message_notify_email_body' => array(
'label' => 'above',
'settings' => array(),
'type' => 'hidden',
'weight' => 3,
),
'message_notify_email_subject' => array(
'label' => 'above',
'settings' => array(),
'type' => 'hidden',
'weight' => 3,
),
),
'entity_type' => 'message',
'field_name' => 'field_message_rendered_subject',
'label' => 'Subject',
'required' => FALSE,
'settings' => array(
'text_processing' => 0,
'user_register_form' => FALSE,
),
'widget' => array(
'module' => 'text',
'settings' => array(
'size' => 60,
),
'type' => 'text_textfield',
'weight' => 8,
),
);
// Exported field_instance: 'message-commons_events_event_node_created-field_target_comments'
$field_instances['message-commons_events_event_node_created-field_target_comments'] = array(
'bundle' => 'commons_events_event_node_created',
'default_value' => NULL,
'default_value_function' => '',
'deleted' => 0,
'description' => '',
'display' => array(
'default' => array(
'label' => 'above',
'module' => 'entityreference',
'settings' => array(
'link' => FALSE,
),
'type' => 'entityreference_label',
'weight' => 1,
),
'message_notify_email_body' => array(
'label' => 'above',
'settings' => array(),
'type' => 'hidden',
'weight' => 5,
),
'message_notify_email_subject' => array(
'label' => 'above',
'settings' => array(),
'type' => 'hidden',
'weight' => 5,
),
),
'entity_type' => 'message',
'field_name' => 'field_target_comments',
'label' => 'Target comment',
'required' => 1,
'settings' => array(
'behaviors' => array(
'prepopulate' => array(
'status' => 0,
),
),
'user_register_form' => FALSE,
),
'widget' => array(
'active' => 1,
'module' => 'entityreference',
'settings' => array(
'match_operator' => 'CONTAINS',
'path' => '',
'size' => 60,
),
'type' => 'entityreference_autocomplete',
'weight' => 4,
),
);
// Exported field_instance: 'message-commons_events_event_node_created-field_target_nodes'
$field_instances['message-commons_events_event_node_created-field_target_nodes'] = array(
'bundle' => 'commons_events_event_node_created',
'default_value' => NULL,
'default_value_function' => '',
'deleted' => 0,
'description' => '',
'display' => array(
'default' => array(
'label' => 'above',
'module' => 'entityreference',
'settings' => array(
'link' => FALSE,
),
'type' => 'entityreference_label',
'weight' => 0,
),
'message_notify_email_body' => array(
'label' => 'above',
'settings' => array(),
'type' => 'hidden',
'weight' => 6,
),
'message_notify_email_subject' => array(
'label' => 'above',
'settings' => array(),
'type' => 'hidden',
'weight' => 6,
),
),
'entity_type' => 'message',
'field_name' => 'field_target_nodes',
'label' => 'Target nodes',
'required' => 0,
'settings' => array(
'behaviors' => array(
'prepopulate' => array(
'status' => 0,
),
),
'user_register_form' => FALSE,
),
'widget' => array(
'active' => 1,
'module' => 'entityreference',
'settings' => array(
'match_operator' => 'CONTAINS',
'path' => '',
'size' => 60,
),
'type' => 'entityreference_autocomplete',
'weight' => 2,
),
);
// Translatables
// Included for use with string extractors like potx.
t('Address');
t('Date');
t('Description');
t('Enter 0 for unlimited');
t('Event logo');
t('Location');
t('Maximum number of attendees');
t('Organizers');
t('Registration bundle');
t('Registration type');
t('URL');
return $field_instances;
}

View File

@ -1,175 +0,0 @@
<?php
/**
* @file
* commons_events.features.inc
*/
/**
* Implements hook_ctools_plugin_api().
*/
function commons_events_ctools_plugin_api($module = NULL, $api = NULL) {
if ($module == "strongarm" && $api == "strongarm") {
return array("version" => "1");
}
}
/**
* Implements hook_views_api().
*/
function commons_events_views_api($module = NULL, $api = NULL) {
return array("api" => "3.0");
}
/**
* Implements hook_node_info().
*/
function commons_events_node_info() {
$items = array(
'event' => array(
'name' => t('Event'),
'base' => 'node_content',
'description' => t('Post information about planned activities or meetings.'),
'has_title' => '1',
'title_label' => t('Event title'),
'help' => '',
),
);
return $items;
}
/**
* Implements hook_default_registration_type().
*/
function commons_events_default_registration_type() {
$items = array();
$items['event'] = entity_import('registration_type', '{
"name" : "event",
"label" : "Event",
"locked" : "0",
"weight" : "0",
"data" : null,
"rdf_mapping" : []
}');
return $items;
}
/**
* Implements hook_rdf_default_mappings().
*/
function commons_events_rdf_default_mappings() {
$schemaorg = array();
// Exported RDF mapping: event
$schemaorg['node']['event'] = array(
'rdftype' => array(
0 => 'schema:Event',
1 => 'sioc:Item',
2 => 'foaf:Document',
),
'title' => array(
'predicates' => array(
0 => 'schema:name',
),
),
'created' => array(
'predicates' => array(
0 => 'dc:date',
1 => 'dc:created',
),
'datatype' => 'xsd:dateTime',
'callback' => 'date_iso8601',
),
'changed' => array(
'predicates' => array(
0 => 'dc:modified',
),
'datatype' => 'xsd:dateTime',
'callback' => 'date_iso8601',
),
'body' => array(
'predicates' => array(
0 => 'content:encoded',
),
),
'uid' => array(
'predicates' => array(
0 => 'sioc:has_creator',
),
'type' => 'rel',
),
'name' => array(
'predicates' => array(
0 => 'schema:name',
),
),
'comment_count' => array(
'predicates' => array(
0 => 'sioc:num_replies',
),
'datatype' => 'xsd:integer',
),
'last_activity' => array(
'predicates' => array(
0 => 'sioc:last_activity_date',
),
'datatype' => 'xsd:dateTime',
'callback' => 'date_iso8601',
),
'field_date' => array(
'predicates' => array(
0 => 'schema:startDate',
),
),
'url' => array(
'predicates' => array(
0 => 'schema:url',
),
'type' => 'rel',
),
'field_location' => array(
'predicates' => array(),
),
'field_address' => array(
'predicates' => array(
0 => 'schema:location',
),
),
);
return $schemaorg;
}
/**
* Implements hook_default_message_type().
*/
function commons_events_default_message_type() {
$items = array();
$items['commons_events_event_node_created'] = entity_import('message_type', '{
"name" : "commons_events_event_node_created",
"description" : "The notification sent when a user creates an event",
"argument_keys" : [],
"argument" : [],
"category" : "commons_notify",
"data" : {
"token options" : { "clear" : 1 },
"purge" : { "override" : 0, "enabled" : 0, "quota" : "", "days" : "" }
},
"language" : "",
"arguments" : null,
"message_text" : { "und" : [
{
"value" : "New Event on [site:name]: [message:field-target-nodes:0:title_field]",
"format" : "plain_text",
"safe_value" : "\u003Cp\u003ENew Event on [site:name]: [message:field-target-nodes:0:title_field]\u003C\/p\u003E\n"
},
{
"value" : "Hi [message:user:name],\r\n\r\n[message:field-target-nodes:0:author] created the event \u201c[message:field-target-nodes:0:title_field]\u201d on [site:name] [commons-groups:in-groups-text] on [message:field-target-nodes:0:created]:\r\n\r\nWhat: [message:field-target-nodes:0:title_field]\r\nWhen: [message:field-target-nodes:0:field_date]\r\nWhere (If applicable): [message:field-target-nodes:0:field_address]\r\n\r\n[message:field-target-nodes:0:body]\r\n\r\n\r\nPermalink: [message:field-target-nodes:0:url]\r\nAdd a comment at [message:field-target-nodes:0:url]#comment-form\r\n\r\nChange email notifications at [site:url]user\/[message:user:uid]\/notification-settings",
"format" : "plain_text",
"safe_value" : "\u003Cp\u003EHi [message:user:name],\u003C\/p\u003E\n\u003Cp\u003E[message:field-target-nodes:0:author] created the event \u201c[message:field-target-nodes:0:title_field]\u201d on [site:name] [commons-groups:in-groups-text] on [message:field-target-nodes:0:created]:\u003C\/p\u003E\n\u003Cp\u003EWhat: [message:field-target-nodes:0:title_field]\u003Cbr \/\u003E\nWhen: [message:field-target-nodes:0:field_date]\u003Cbr \/\u003E\nWhere (If applicable): [message:field-target-nodes:0:field_address]\u003C\/p\u003E\n\u003Cp\u003E[message:field-target-nodes:0:body]\u003C\/p\u003E\n\u003Cp\u003EPermalink: [message:field-target-nodes:0:url]\u003Cbr \/\u003E\nAdd a comment at [message:field-target-nodes:0:url]#comment-form\u003C\/p\u003E\n\u003Cp\u003EChange email notifications at [site:url]user\/[message:user:uid]\/notification-settings\u003C\/p\u003E\n"
}
]
},
"rdf_mapping" : []
}');
return $items;
}

View File

@ -1,52 +0,0 @@
<?php
/**
* @file
* commons_events.features.og_features_permission.inc
*/
/**
* Implements hook_og_features_default_permissions().
*/
function commons_events_og_features_default_permissions() {
$permissions = array();
// Exported og permission: 'node:group:create event content'
$permissions['node:group:create event content'] = array(
'roles' => array(
'administrator member' => 'administrator member',
'member' => 'member',
),
);
// Exported og permission: 'node:group:delete any event content'
$permissions['node:group:delete any event content'] = array(
'roles' => array(
'administrator member' => 'administrator member',
),
);
// Exported og permission: 'node:group:delete own event content'
$permissions['node:group:delete own event content'] = array(
'roles' => array(
'administrator member' => 'administrator member',
'member' => 'member',
),
);
// Exported og permission: 'node:group:update any event content'
$permissions['node:group:update any event content'] = array(
'roles' => array(
'administrator member' => 'administrator member',
),
);
// Exported og permission: 'node:group:update own event content'
$permissions['node:group:update own event content'] = array(
'roles' => array(
'administrator member' => 'administrator member',
'member' => 'member',
),
);
return $permissions;
}

View File

@ -1,94 +0,0 @@
<?php
/**
* @file
* commons_events.features.user_permission.inc
*/
/**
* Implements hook_user_default_permissions().
*/
function commons_events_user_default_permissions() {
$permissions = array();
// Exported permission: 'create event content'.
$permissions['create event content'] = array(
'name' => 'create event content',
'roles' => array(
'administrator' => 'administrator',
'authenticated user' => 'authenticated user',
),
'module' => 'node',
);
// Exported permission: 'create event registration'.
$permissions['create event registration'] = array(
'name' => 'create event registration',
'roles' => array(
'administrator' => 'administrator',
'authenticated user' => 'authenticated user',
),
'module' => 'registration',
);
// Exported permission: 'delete own event content'.
$permissions['delete own event content'] = array(
'name' => 'delete own event content',
'roles' => array(
'administrator' => 'administrator',
'authenticated user' => 'authenticated user',
),
'module' => 'node',
);
// Exported permission: 'delete own event registration'.
$permissions['delete own event registration'] = array(
'name' => 'delete own event registration',
'roles' => array(
'administrator' => 'administrator',
'authenticated user' => 'authenticated user',
),
'module' => 'registration',
);
// Exported permission: 'edit own event content'.
$permissions['edit own event content'] = array(
'name' => 'edit own event content',
'roles' => array(
'administrator' => 'administrator',
'authenticated user' => 'authenticated user',
),
'module' => 'node',
);
// Exported permission: 'update own event registration'.
$permissions['update own event registration'] = array(
'name' => 'update own event registration',
'roles' => array(
'administrator' => 'administrator',
'authenticated user' => 'authenticated user',
),
'module' => 'registration',
);
// Exported permission: 'view event registration'.
$permissions['view event registration'] = array(
'name' => 'view event registration',
'roles' => array(
'administrator' => 'administrator',
'authenticated user' => 'authenticated user',
),
'module' => 'registration',
);
// Exported permission: 'view own event registration'.
$permissions['view own event registration'] = array(
'name' => 'view own event registration',
'roles' => array(
'administrator' => 'administrator',
'authenticated user' => 'authenticated user',
),
'module' => 'registration',
);
return $permissions;
}

View File

@ -1,114 +0,0 @@
name = Commons Events
description = Provides an Event content type for hosting events.
package = Commons - Content types
core = 7.x
dependencies[] = addressfield
dependencies[] = addressfield_tokens
dependencies[] = block
dependencies[] = commons_body
dependencies[] = commons_location
; @todo Move message- field instances into another module in order to allow
; Commons Events to function independently of Commons Notify.
dependencies[] = commons_notify
dependencies[] = commons_topics
dependencies[] = ctools
dependencies[] = date
dependencies[] = date_api
dependencies[] = date_popup
dependencies[] = date_views
dependencies[] = entity
dependencies[] = entityreference
dependencies[] = features
dependencies[] = field_sql_storage
dependencies[] = image
dependencies[] = list
dependencies[] = message
dependencies[] = node
dependencies[] = number
dependencies[] = og
dependencies[] = options
dependencies[] = page_manager
dependencies[] = radioactivity
dependencies[] = registration
dependencies[] = registration_views
dependencies[] = strongarm
dependencies[] = taxonomy
dependencies[] = text
dependencies[] = views
dependencies[] = views_content
dependencies[] = views_load_more
features[ctools][] = strongarm:strongarm:1
features[ctools][] = views:views_default:3.0
features[features_api][] = api:2
features[field_base][] = field_date
features[field_base][] = field_location
features[field_base][] = field_logo
features[field_base][] = field_number_of_attendees
features[field_base][] = field_offsite_url
features[field_base][] = field_organizers
features[field_base][] = field_registration
features[field_base][] = field_registration_type
features[field_instance][] = node-event-body
features[field_instance][] = node-event-field_address
features[field_instance][] = node-event-field_date
features[field_instance][] = node-event-field_location
features[field_instance][] = node-event-field_logo
features[field_instance][] = node-event-field_number_of_attendees
features[field_instance][] = node-event-field_offsite_url
features[field_instance][] = node-event-field_organizers
features[field_instance][] = node-event-field_registration
features[field_instance][] = node-event-field_registration_type
features[field_instance][] = message-commons_events_event_node_created-field_message_rendered_body
features[field_instance][] = message-commons_events_event_node_created-field_message_rendered_subject
features[field_instance][] = message-commons_events_event_node_created-field_target_comments
features[field_instance][] = message-commons_events_event_node_created-field_target_nodes
features[message_type][] = commons_events_event_node_created
features[node][] = event
features[og_features_permission][] = node:group:create event content
features[og_features_permission][] = node:group:delete any event content
features[og_features_permission][] = node:group:delete own event content
features[og_features_permission][] = node:group:update any event content
features[og_features_permission][] = node:group:update own event content
features[registration_type][] = event
features[user_permission][] = create event content
features[user_permission][] = create event registration
features[user_permission][] = delete own event content
features[user_permission][] = delete own event registration
features[user_permission][] = edit own event content
features[user_permission][] = update own event registration
features[user_permission][] = view event registration
features[user_permission][] = view own event registration
features[variable][] = comment_anonymous_event
features[variable][] = comment_default_mode_event
features[variable][] = comment_default_per_page_event
features[variable][] = comment_event
features[variable][] = comment_form_location_event
features[variable][] = comment_preview_event
features[variable][] = comment_subject_field_event
features[variable][] = field_bundle_settings_message__commons_events_event_node_created
features[variable][] = field_bundle_settings_node__event
features[variable][] = menu_options_event
features[variable][] = menu_parent_event
features[variable][] = node_options_event
features[variable][] = node_preview_event
features[variable][] = node_submitted_event
features[views_view][] = commons_events_event_attendee_list
features[views_view][] = commons_events_organizers
features[views_view][] = commons_events_upcoming
features[views_view][] = commons_events_user_upcoming_events
; Manually remove the Commons Follow module as a dependency until
; https://www.drupal.org/node/766264 is fixed. Commons Follow dynamically adds a
; views pane for events the user follows which causes Commons Events to appear
; overridden.
features_exclude[dependencies][commons_follow] = commons_follow
features_exclude[dependencies][commons_trusted_contacts] = commons_trusted_contacts
; Information added by Drupal.org packaging script on 2015-03-18
version = "7.x-3.23"
core = "7.x"
project = "commons"
datestamp = "1426714630"

View File

@ -1,308 +0,0 @@
<?php
/**
* Set default events roles upon enable
*/
function commons_events_enable() {
$revert = array(
'commons_events' => array('og_features_permission'),
);
features_revert($revert);
$groups = og_get_all_group();
foreach ($groups AS $gid) {
commons_groups_features_permission_rebuild('commons_events', $gid);
}
}
/**
* Implements hook_install().
* Creates a default datetime format for events.
*/
function commons_events_install() {
db_insert('date_formats')
->fields(array(
'format' => 'M d Y, g:ia T',
'type' => 'event_datetime',
'locked' => 1,
))
->execute();
db_insert('date_format_type')
->fields(array(
'type' => 'event_datetime',
'title' => 'Event Datetime',
'locked' => 0,
))
->execute();
variable_set('date_format_event_datetime', 'M d Y, g:ia T');
}
/**
* Disable summary on Event nodes.
*/
function commons_events_update_7000() {
$revert = array(
'commons_events' => array('field_instance'),
);
features_revert($revert);
return array();
}
/**
* Switch attendee view and event logo to use 50x50 image style.
*/
function commons_events_update_7001() {
$revert = array(
'commons_events' => array('views', 'node'),
);
features_revert($revert);
return array();
}
/**
* Add the Organizers entity reference field to Events and update existing nodes
* with the event's creator as the default value.
*/
function commons_events_update_7002() {
// Revert node and views to use default implementations. This resets field
// weights to configuration due to new Organizers field.
$revert = array(
'commons_events' => array('node'),
);
features_revert($revert);
if (field_info_field('field_organizers') == NULL) {
// Create the field so we can update the default values for existing events.
module_load_include('inc', 'commons_events', 'commons_events.features.field_base');
$fields = commons_events_field_default_field_bases();
field_create_field($fields['field_organizers']);
}
if (field_info_instance('node', 'field_organizers', 'event') == NULL) {
// Create the instance on Events.
module_load_include('inc', 'commons_events', 'commons_events.features.field_instance');
$instances = commons_events_field_default_field_instances();
field_create_instance($instances['node-event-field_organizers']);
}
// Now update all existing Events to have the creator as the default organizer.
$events = new EntityFieldQuery();
$events->entityCondition('entity_type', 'node')
->entityCondition('bundle', 'event');
$events = $events->execute();
$events = entity_load('node', array_keys($events['node']));
foreach($events as $nid => $event) {
if (!property_exists($event, 'field_organizers') || empty($event->field_organizers)) {
$event->field_organizers = array(
$event->language => array(
0 => array(
'target_id' => $event->uid
)
),
);
node_save($event);
}
}
return array();
}
/**
* Change event teaser display to show logo, date, and address.
*/
function commons_events_update_7003() {
$revert = array(
'commons_events' => array('field_instance'),
);
features_revert($revert);
return array();
}
/**
* Create the event_datetime date format.
*/
function commons_events_update_7004() {
db_insert('date_formats')
->fields(array(
'format' => 'M d Y - g:ia T',
'type' => 'event_datetime',
'locked' => 1,
))
->execute();
db_insert('date_format_type')
->fields(array(
'type' => 'event_datetime',
'title' => 'Event Datetime',
'locked' => 0,
))
->execute();
variable_set('date_format_event_datetime', 'M d Y - g:ia T');
// Revert commons_events to make sure its referencing the event_datetime module.
$revert = array(
'commons_events' => array('field_instance'),
'commons_events' => array('views_view'),
);
features_revert($revert);
return array();
}
/**
* Set event nodes to use site default country set during install as default.
*/
function commons_events_update_7005() {
$revert = array(
'commons_events' => array('field_instance'),
);
features_revert($revert);
return array();
}
/**
* Upcoming events view pane exposed sort should redirect to the view pane and
* not the feed.
*/
function commons_events_update_7006() {
$revert = array(
'commons_events' => array('views_view'),
);
features_revert($revert);
return array();
}
/**
* Change event displays to abbreviate state names.
*/
function commons_events_update_7007() {
$revert = array(
'commons_events' => array('field_instance'),
);
features_revert($revert);
return array();
}
/*
* Alter the event display formatter, it should be a ',' and not '-'
*/
/**
* Create the event_datetime date format.
*/
function commons_events_update_7008() {
db_update('date_formats')
->fields(array(
'format' => 'M d Y, g:ia T',
'type' => 'event_datetime',
'locked' => 1,
))
->condition('format', 'M d Y - g:ia T', '=')
->condition('type', 'event_datetime', '=')
->execute();
variable_set('date_format_event_datetime', 'M d Y, g:ia T');
// Revert commons_events to make sure its referencing the event_datetime module.
$revert = array(
'commons_events' => array('field_instance'),
'commons_events' => array('views_view'),
);
features_revert($revert);
return array();
}
/**
* Need to force update so that Drupal sees the new hook_forms implementation.
*/
function commons_events_update_7009() {
cache_clear_all('module_implements', 'cache_bootstrap');
return array();
}
/**
* Display current events in addition to upcoming events.
*/
function commons_events_update_7010() {
$revert = array(
'commons_events' => array('views_view'),
);
features_revert($revert);
return array();
}
/**
* Add empty text to Commons Events views.
*/
function commons_events_update_7011() {
$revert = array(
'commons_events' => array('views_view'),
);
features_revert($revert);
return array();
}
/**
* Add an event specific message_type feature.
*/
function commons_events_update_7012() {
$revert = array(
'commons_events' => array('message_type', 'field_instance'),
);
features_revert($revert);
return array();
}
/**
* Sort and filter the upcoming user events view by start date.
*/
function commons_events_update_7013() {
$revert = array(
'commons_events' => array('views_view'),
);
features_revert($revert);
return array();
}
/**
* Replace the title attribute with the title field in view displays.
*/
function commons_events_update_7014() {
$revert = array(
'commons_events' => array('views_view'),
);
features_revert($revert);
return array();
}
/**
* Ensure that the target comments field instance used for custom event messages
* is detected and fix Commons Events appearing overridden.
*/
function commons_events_update_7015() {
$revert = array(
'commons_events' => array('field_instance'),
);
features_revert($revert);
return array();
}
/**
* Move event menu item handling from menu links to page manager pages.
*/
function commons_events_update_7016() {
$revert = array(
'commons_events' => array('page_manager_pages'),
);
features_revert($revert);
return array();
}
/**
* Standardize browsing widget field weights.
*/
function commons_events_update_7017() {
$revert = array(
'commons_events' => array('field_instance'),
);
features_revert($revert);
return array();
}

View File

@ -1,684 +0,0 @@
<?php
/**
* @file
* Drupal Commons Events feature.
*/
include_once 'commons_events.features.inc';
/**
* Implements hook_forms().
*/
function commons_events_forms($form_id, $args) {
// The attend and cancel event forms need to have a dynamic form ID to allow
// for multiple forms to be shown on the same page and have them work.
foreach (array('commons_events_attend_event_form', 'commons_events_cancel_event_form') as $form) {
if (substr($form_id, 0, strlen($form)) == $form) {
return array(
$form_id => array(
'callback' => $form,
),
);
}
}
}
/**
* Implements hook_menu().
*/
function commons_events_menu() {
$items['node/%node/attendees'] = array(
'title' => 'Attendees',
'page callback' => 'commons_events_event_attendees_page',
'page arguments' => array(1),
'access callback' => 'commons_events_attendee_access',
'access arguments' => array(1),
'type' => MENU_LOCAL_TASK,
);
return $items;
}
/**
* Implements hook_menu_alter().
*/
function commons_events_menu_alter(&$items) {
// Hide the "Register" tab since we expose an "Attend" button.
$items['node/%/register']['access callback'] = FALSE;
}
/**
* Access callback for showing the Attendees tab.
*/
function commons_events_attendee_access($event_node) {
if ($event_node->type == 'event' && user_access('view event registration')) {
return TRUE;
}
return FALSE;
}
/**
* Page callback for full event attendee listing.
*/
function commons_events_event_attendees_page($event_node) {
return theme('commons_events_event_attendees',
array(
'event_nid' => $event_node->nid,
'display' => 'full',
));
}
/**
* Implements hook_theme().
*/
function commons_events_theme($existing, $type, $theme, $path) {
return array(
'commons_events_attending_event' => array(
'variables' => array(
'event' => NULL,
'attendee_count' => NULL,
),
'file' => '/includes/commons_events.theme.inc',
),
'commons_events_event_attendees' => array(
'variables' => array(
'display' => NULL,
'event_nid' => NULL,
),
'file' => '/includes/commons_events.theme.inc',
),
'commons_events_date_display_range_advanced' => array(
'variables' => array(
'date1' => NULL,
'date2' => NULL,
'timezone' => NULL,
'dates' => NULL,
// HTML attributes that will be applied to both the start and end dates
// (unless overridden).
'attributes' => array(),
// HTML attributes that will be applied to the start date only.
'attributes_start' => array(),
// HTML attributes that will be applied to the end date only.
'attributes_end' => array(),
'rdf_mapping' => NULL,
'add_rdf' => NULL,
),
),
'commons_events_date_display_range_simple' => array(
'variables' => array(
'date1' => NULL,
'date2' => NULL,
'timezone' => NULL,
'dates' => NULL,
// HTML attributes that will be applied to both the start and end dates
// (unless overridden).
'attributes' => array(),
// HTML attributes that will be applied to the start date only.
'attributes_start' => array(),
// HTML attributes that will be applied to the end date only.
'attributes_end' => array(),
'rdf_mapping' => NULL,
'add_rdf' => NULL,
),
),
);
}
/**
* Implements hook_theme_registry_alter().
* Gives us the ability to insert our pretty date formatter for the dates we choose below.
*/
function commons_events_theme_registry_alter(&$theme_registry) {
$theme_registry['date_display_range']['theme path'] = drupal_get_path('module', 'commons_events');
$theme_registry['date_display_range']['function'] = 'theme_commons_events_date_display_range_advanced';
$theme_registry['date_display_single']['theme path'] = drupal_get_path('module', 'commons_events');
$theme_registry['date_display_single']['function'] = 'theme_commons_events_date_display_single';
}
/**
* Implements hook_element_info_alter().
*/
function commons_events_element_info_alter(&$type) {
// Extend date_combo processing to alter the label text on the fields.
if (isset($type['date_combo'])) {
$type['date_combo']['#process'][] = 'commons_events_date_combo_element_process';
}
// Extend date_popup processing to remove the redundant descriptions on
// fields.
if (isset($type['date_popup'])) {
$type['date_popup']['#process'][] = 'commons_events_date_popup_element_process';
}
}
/**
* Process date_combo field output.
*
* This is an extension of the Date module's own processing.
*
* @see date_combo_element_process()
* @see commons_events_element_info_alter()
*/
function commons_events_date_combo_element_process($element, &$form_state, $form) {
$field = field_widget_field($element, $form_state);
// Change the labels for from and to dates to something more meaningful.
if (!empty($field['settings']['todate'])) {
$element['value']['#title'] = t('Start date');
$element['value2']['#title'] = t('End date');
}
return $element;
}
/**
* Process date_popup field output.
*
* This is an extension of the Date module's own processing.
*
* @see date_popup_element_process()
* @see commons_events_element_info_alter()
*/
function commons_events_date_popup_element_process($element, &$form_state, $form) {
// If a date_popup field is part of a larger range widget, simplify the
// output.
if (!empty($element['#field']['settings']['todate'])) {
foreach (array('date', 'time') as $type) {
if (!empty($element[$type])) {
// The description and title are unnecessary.
unset($element[$type]['#description']);
$element[$type]['#title'] = '';
}
}
}
return $element;
}
/**
* Implements hook_entity_view_alter().
*/
function commons_events_entity_view_alter(&$build, $type) {
if ($type == 'node' && isset($build['#node'])) {
$node = $build['#node'];
list(, , $bundle) = entity_extract_ids('node', $node);
if ($bundle == 'event') {
$build['attending'] = array(
0 => theme('commons_events_attending_event', array(
'event' => $node,
'attendee_count' => commons_events_get_raw_attendee_count($node),
)),
'#weight' => -10,
);
// Don't show the address if the event location is only online.
$items = field_get_items('node', $node, 'field_location');
if (is_array($items)) {
foreach ($items as $item) {
if ($item['value'] == 'online') {
$build['field_address']['#access'] = FALSE;
}
}
}
}
}
}
/**
* Implements hook_form_BASE_FORM_ID_alter().
*/
function commons_events_form_node_form_alter(&$form, &$form_state, $form_id) {
$node = $form_state['node'];
list(, , $bundle) = entity_extract_ids('node', $node);
if ($bundle == 'event' && empty($node->nid)) {
drupal_set_title(t('Create an event'));
}
if ($bundle == 'event') {
// Attach custom CSS and JS to the form.
$form['#attached']['css'][] = drupal_get_path('module', 'commons_events') . '/css/commons_events.css';
$form['#attached']['js'][] = drupal_get_path('module', 'commons_events') . '/js/commons_events.js';
// Remove the '-None-' option from all the dropdowns.
unset($form['field_location'][$form['field_location']['#language']]['#options']['_none']);
unset($form['field_registration_type'][$form['field_registration_type']['#language']]['#options']['_none']);
// Remove the registration type description.
unset($form['field_registration'][$form['field_registration']['#language']]['0']['registration_type']['#description']);
// Default the event organizer to the user who is creating the node.
if (empty($form['field_organizers'][$form['field_organizers']['#language']]['#default_value'])) {
global $user;
$form['field_organizers'][$form['field_organizers']['#language']]['#default_value'] = format_username($user) . " (" . $user->uid . ")";
}
// Hide the Registration type field.
$form['field_registration']['#disabled'] = commons_events_event_type_disabled($node);
// Make the number of attendees field optional.
$form['field_number_of_attendees'][$form['field_number_of_attendees']['#language']]['0']['value']['#required'] = FALSE;
// Address field should be hidden if the event is online only.
$form['field_address']['#states'] = array(
'invisible' => array(
':input[name^="field_location"]' => array('value' => 'online'),
),
);
// Assume that registration is open by default.
$node_registration_status = 1;
// Use saved registration settings for existing events.
if (isset($node->nid)) {
$settings = registration_entity_settings('node', $node->nid);
$node_registration_status = $settings['status'];
}
// Add a status field to allow users to open and close registration.
$form['field_status'] = array(
'#type' => 'select',
'#title' => t('Status'),
'#options' => array(
1 => t('Open to new attendees'),
0 => t('Closed'),
),
'#default_value' => $node_registration_status,
'#states' => array(
'visible' => array(
':input[name^="field_registration_type"]' => array('value' => 'onsite'),
),
),
'#weight' => 10,
);
// Status and attendee limit are shown if registration is onsite.
$form['field_registration']['#states'] = $form['field_status']['#states'];
$form['field_number_of_attendees']['#states'] = $form['field_status']['#states'];
$form['field_number_of_attendees']['#states']['visible'][':input[name="field_status"]'] = array(
'value' => 1,
);
$form['field_number_of_attendees']['#weight'] = 11;
// Create a custom fieldset to hold the registration settings and add it to
// the additional settings group so it will be displayed as a vertical tab.
$form['event_registration_settings'] = array(
'#type' => 'fieldset',
'#collapsible' => TRUE,
'#collapsed' => FALSE,
'#title' => t('Registration settings'),
'#group' => 'additional_settings',
'#weight' => -10,
);
// Copy all of the registration settings into the custom fieldset.
$form['event_registration_settings']['field_organizers'] = $form['field_organizers'];
$form['event_registration_settings']['field_registration_type'] = $form['field_registration_type'];
$form['event_registration_settings']['field_status'] = $form['field_status'];
$form['event_registration_settings']['field_number_of_attendees'] = $form['field_number_of_attendees'];
$form['event_registration_settings']['field_registration'] = $form['field_registration'];
// Unset all of the original registration settings.
hide($form['field_organizers']);
hide($form['field_registration_type']);
hide($form['field_status']);
hide($form['field_number_of_attendees']);
hide($form['field_registration']);
// Add additional submission and validation handlers.
$form['#validate'][] = 'commons_events_node_form_validate';
$form['#submit'][] = 'commons_events_node_form_submit';
}
}
/**
* Custom node form validation handler.
*/
function commons_events_node_form_validate($form, &$form_state) {
$language = (isset($form_state['language']) ? $form_state['language'] : LANGUAGE_NONE);
switch ($form_state['values']['field_registration_type'][$language]['0']['value']) {
case 'onsite':
// Max attendees must be entered if the registration is open and onsite.
if ((int) $form_state['values']['field_status'] == 1 && (!is_numeric($form_state['values']['field_number_of_attendees'][$language]['0']['value']))) {
form_set_error('field_number_of_attendees', t('Maximum number of attendees must be set for registrations to be accepted.'));
}
break;
}
}
/**
* Custom node form submit handler.
*/
function commons_events_node_form_submit($form, $form_state) {
$node = $form_state['node'];
$language = (isset($form_state['language']) ? $form_state['language'] : LANGUAGE_NONE);
if (isset($node->nid)) {
$settings = registration_entity_settings('node', $node->nid);
$settings['status'] = (int) $form_state['values']['field_status'];
if ($form_state['values']['field_registration_type'][$language]['0']['value'] == 'external') {
$settings['status'] = 0;
}
if (!empty($form_state['values']['field_number_of_attendees'][$language]['0']['value']) && is_numeric($form_state['values']['field_number_of_attendees'][$language]['0']['value'])) {
$settings['capacity'] = (int) $form_state['values']['field_number_of_attendees'][$language]['0']['value'];
}
$settings['settings'] = serialize($settings['settings']);
registration_update_entity_settings('node', $node->nid, $settings);
// Automatically register the node creator for the event.
$registration_type = registration_get_entity_registration_type('node', $node);
$values = array(
'entity_type' => 'node',
'entity_id' => $node->nid,
'type' => $registration_type,
);
$registration = entity_create('registration', $values);
if (!isset($node->uid)) {
global $user;
$uid = $user->uid;
}
else {
$uid = $node->uid;
}
if ($settings['status'] == 1 && !registration_is_registered($registration, NULL, $uid)) {
$registration->user_uid = $uid;
$registration->author_uid = $uid;
$registration->state = NULL;
$registration->count = 1;
registration_save($registration);
}
}
}
/**
* Implements hook_tokens().
*/
function commons_events_tokens($type, $tokens, array $data = array(), array $options = array()) {
$replacements = array();
if ($type == 'node' && !empty($data['node'])) {
$event = $data['node'];
foreach ($tokens as $name => $original) {
if ($name == 'attend-form') {
$replacements[$original] = theme('commons_events_attending_event', array(
'event' => $event,
'attendee_count' => commons_events_get_raw_attendee_count($event),
));
}
}
}
return $replacements;
}
/**
* Implements hook_token_info_alter().
*/
function commons_events_token_info_alter(&$tokens) {
$tokens['tokens']['node']['attend-form'] = array(
'name' => t('Attending event form'),
'description' => t('Displays the appropriate form for attending or cancelling event attendance'),
);
}
/**
* Generates the 'more' link for upcoming events in a specific group.
*/
function commons_events_upcoming_more_link($group_id) {
if (module_exists('commons_events_solr')) {
$options = array(
'query' => array(
'f[1]' => 'sm_og_group_ref:node:' . $group_id,
),
);
return l(t('more'), 'events', $options);
}
$options = array(
'query' => array(
'gid' => $group_id,
),
);
return l(t('more'), 'events', $options);
}
/**
* Implements hook_views_post_execute().
*/
function commons_events_views_post_execute(&$view) {
if ($view->name == 'commons_events_upcoming' && $view->current_display == 'panel_pane_1') {
$view->attachment_after = '<div class="more-link">' . commons_events_upcoming_more_link($view->args[0]) . '</div>';
}
if ($view->name == 'commons_events_upcoming' && $view->current_display == 'panel_pane_2') {
$view->attachment_before = '<div class="commons-event-count">' . format_plural(count($view->result), '1 event', '@count events') . '</div>';
}
}
/**
* Implements hook_block_info().
*/
function commons_events_block_info() {
$blocks['commons_events_create_event_link'] = array(
'info' => t('"Create an event" call to action'),
'cache' => DRUPAL_CACHE_GLOBAL,
);
$blocks['commons_events_anonymous_login'] = array(
'info' => t('"Login to create an event" call to action'),
'cache' => DRUPAL_CACHE_GLOBAL,
);
return $blocks;
}
/**
* Implements hook_block_view().
*/
function commons_events_block_view($delta = '') {
$block = array();
switch ($delta) {
case 'commons_events_create_event_link':
if (node_access('create', 'event')) {
$block['subject'] = NULL;
$block['content'] = array(
'#type' => 'link',
'#title' => t('List an event'),
'#href' => 'node/add/event',
'#options' => array(
'query' => array(
'destination' => 'events',
),
),
);
}
break;
case 'commons_events_anonymous_login':
if (user_is_anonymous()) {
$block['subject'] = NULL;
$block['content'] = t('You must !login in order to list events.', array('!login' => l(t('log in'), 'user')));
}
break;
}
return $block;
}
/**
* Returns specific HTML for a date element formatted with the event formatter M j Y - g:ia.
*
* We the do some awesome stuff with regular expressions to take all the
* different formats available to us and format it pretty.
*/
function theme_commons_events_date_display_range_simple($variables) {
// Use the regular date formatter if we are any other date format than below.
$date1 = $variables['dates']['value']['formatted_date'];
$date2 = $variables['dates']['value2']['formatted_date'];
$time1 = $variables['dates']['value']['formatted_time'];
$time2 = $variables['dates']['value2']['formatted_time'];
$timezone = $variables['timezone'];
$attributes_start = $variables['attributes_start'];
$attributes_end = $variables['attributes_end'];
if ($date1 == $date2) {
// Wrap the result with the attributes.
return t('!start-time - !end-time', array(
'!start-time' => '<span class="date-display-start"' . drupal_attributes($attributes_start) . '>' . $time1 . '</span>',
'!end-time' => '<span class="date-display-end"' . drupal_attributes($attributes_end) . '>' . $time2 . $timezone . '</span>',
));
}
// Wrap the result with the attributes.
return t('!start-date to !end-date, !start-time - !end-time', array(
'!start-date' => '<span class="date-display-start"' . drupal_attributes($attributes_start) . '>' . $date1 . '</span>',
'!end-date' => '<span class="date-display-end"' . drupal_attributes($attributes_end) . '>' . $date2 . '</span>',
'!start-time' => '<span class="date-display-start"' . drupal_attributes($attributes_start) . '>' . $time1 . '</span>',
'!end-time' => '<span class="date-display-end"' . drupal_attributes($attributes_end) . '>' . $time2 . $timezone . '</span>',
));
}
function theme_commons_events_date_display_single($variables) {
return $variables['date'];
}
/**
* Returns specific HTML for a date element formatted with the event formatter.
*
* We parse the date segments and return it at the bottom, or use the simple
* formatter (above) if parts of the date are too complicated.
*/
function theme_commons_events_date_display_range_advanced($variables) {
$timezone = $variables['timezone'];
$attributes_start = $variables['attributes_start'];
$attributes_end = $variables['attributes_end'];
// Time is always formatted the same.
$time1 = $variables['dates']['value']['formatted_time'];
$time2 = $variables['dates']['value2']['formatted_time'];
// See date.theme line 168 -- regarding formatting time for same date events.
if ($variables['dates']['value']['formatted_date'] === $variables['dates']['value2']['formatted_date']) {
return theme('commons_events_date_display_range_simple', $variables);
}
// If the difference is over a year, use the simple formatter.
if ($variables['dates']['value']['db']['object']->difference($variables['dates']['value2']['db']['object'], 'years') > 0) {
return theme('commons_events_date_display_range_simple', $variables);
}
else {
if ($variables['dates']['value']['db']['object']->difference($variables['dates']['value2']['db']['object'], 'months') > 0) {
$variables['dates']['value']['db']['object']->limitGranularity(array('day', 'month'));
$variables['dates']['value2']['db']['object']->limitGranularity(array('day', 'month', 'year'));
$date1 = $variables['dates']['value']['db']['object']->format($variables['dates']['format'], FALSE);
$date2 = $variables['dates']['value2']['db']['object']->format($variables['dates']['format'], FALSE);
}
else {
if ($variables['dates']['value']['db']['object']->difference($variables['dates']['value2']['db']['object'], 'days') > 0) {
// If the Day is before the month (Europe, etc) then switch the granularity.
if (strpos($variables['dates']['format'], 'M') != 0 || strpos($variables['dates']['format'], 'm') != 0 ||
strpos($variables['dates']['format'], 'F') != 0 || strpos($variables['dates']['format'], 'n') != 0
) {
$variables['dates']['value']['db']['object']->limitGranularity(array('day'));
$variables['dates']['value2']['db']['object']->limitGranularity(array('day', 'month', 'year'));
}
else {
$variables['dates']['value']['db']['object']->limitGranularity(array('month', 'day'));
$variables['dates']['value2']['db']['object']->limitGranularity(array('day', 'year'));
}
$date1 = $variables['dates']['value']['db']['object']->format($variables['dates']['format'], FALSE);
$date2 = $variables['dates']['value2']['db']['object']->format($variables['dates']['format'], FALSE);
// If we are match 'D' or 'l', then we have a 'day' in there (eg Monday),
// we want the whole date because it looks funky otherwise.
if (strpbrk($variables['dates']['format'], 'Dl')) {
return theme('commons_events_date_display_range_simple', $variables);
}
}
else {
return theme('commons_events_date_display_range_simple', $variables);
}
}
}
// Wrap the result with the attributes.
return t('!start-date to !end-date, !start-time - !end-time', array(
'!start-date' => '<span class="date-display-start"' . drupal_attributes($attributes_start) . '>' . $date1 . '</span>',
'!end-date' => '<span class="date-display-end"' . drupal_attributes($attributes_end) . '>' . $date2 . '</span>',
'!start-time' => '<span class="date-display-start"' . drupal_attributes($attributes_start) . '>' . $time1 . '</span>',
'!end-time' => '<span class="date-display-end"' . drupal_attributes($attributes_end) . '>' . $time2 . $timezone . '</span>',
));
}
/**
* Implements hook_commons_notify_message_selection_alter().
*/
function commons_events_commons_notify_message_selection_alter(&$message_type, $hook, $node) {
// Provide a special message type that describes the event details
// when a new event node is created.
if ($hook == 'node_insert' && $node->type == 'event') {
$message_type = 'commons_events_event_node_created';
}
}
/**
* Check whether to allow switching the event's registration type.
* If there are registrations for the event, disallow changing the type. This
* keeps registrations for an event consistent.
*/
function commons_events_event_type_disabled($node) {
if (!isset($node->nid) || empty($node->nid)) {
return FALSE;
}
$registrations = db_select('registration', 'r')
->fields('r')
->condition('entity_type', 'node')
->condition('entity_id', $node->nid)
->countQuery()
->execute()
->fetchCol();
if ($registrations[0] > 0) {
return TRUE;
}
return FALSE;
}
/**
* Helper function go get the raw number of attendees.
*/
function commons_events_get_raw_attendee_count($node) {
$attendee_count = 0;
$query = db_select('registration', 'r')
->fields('r', array('count'))
->condition('entity_id', $node->nid)
->condition('entity_type', 'node')
->execute();
// Add up all of the attendees going to the event.
foreach ($query as $record) {
$attendee_count += $record->count;
}
return $attendee_count;
}

View File

@ -1,181 +0,0 @@
<?php
/**
* @file
* commons_events.strongarm.inc
*/
/**
* Implements hook_strongarm().
*/
function commons_events_strongarm() {
$export = array();
$strongarm = new stdClass();
$strongarm->disabled = FALSE; /* Edit this to true to make a default strongarm disabled initially */
$strongarm->api_version = 1;
$strongarm->name = 'comment_anonymous_event';
$strongarm->value = 0;
$export['comment_anonymous_event'] = $strongarm;
$strongarm = new stdClass();
$strongarm->disabled = FALSE; /* Edit this to true to make a default strongarm disabled initially */
$strongarm->api_version = 1;
$strongarm->name = 'comment_default_mode_event';
$strongarm->value = 1;
$export['comment_default_mode_event'] = $strongarm;
$strongarm = new stdClass();
$strongarm->disabled = FALSE; /* Edit this to true to make a default strongarm disabled initially */
$strongarm->api_version = 1;
$strongarm->name = 'comment_default_per_page_event';
$strongarm->value = '50';
$export['comment_default_per_page_event'] = $strongarm;
$strongarm = new stdClass();
$strongarm->disabled = FALSE; /* Edit this to true to make a default strongarm disabled initially */
$strongarm->api_version = 1;
$strongarm->name = 'comment_event';
$strongarm->value = '2';
$export['comment_event'] = $strongarm;
$strongarm = new stdClass();
$strongarm->disabled = FALSE; /* Edit this to true to make a default strongarm disabled initially */
$strongarm->api_version = 1;
$strongarm->name = 'comment_form_location_event';
$strongarm->value = 1;
$export['comment_form_location_event'] = $strongarm;
$strongarm = new stdClass();
$strongarm->disabled = FALSE; /* Edit this to true to make a default strongarm disabled initially */
$strongarm->api_version = 1;
$strongarm->name = 'comment_preview_event';
$strongarm->value = '1';
$export['comment_preview_event'] = $strongarm;
$strongarm = new stdClass();
$strongarm->disabled = FALSE; /* Edit this to true to make a default strongarm disabled initially */
$strongarm->api_version = 1;
$strongarm->name = 'comment_subject_field_event';
$strongarm->value = 1;
$export['comment_subject_field_event'] = $strongarm;
$strongarm = new stdClass();
$strongarm->disabled = FALSE; /* Edit this to true to make a default strongarm disabled initially */
$strongarm->api_version = 1;
$strongarm->name = 'field_bundle_settings_message__commons_events_event_node_created';
$strongarm->value = array(
'view_modes' => array(),
'extra_fields' => array(
'form' => array(),
'display' => array(
'message__message_text__0' => array(
'message_notify_email_subject' => array(
'visible' => TRUE,
'weight' => 0,
),
'message_notify_email_body' => array(
'visible' => FALSE,
'weight' => 0,
),
),
'message__message_text__1' => array(
'message_notify_email_subject' => array(
'visible' => FALSE,
'weight' => 0,
),
'message_notify_email_body' => array(
'visible' => TRUE,
'weight' => 0,
),
),
),
),
);
$export['field_bundle_settings_message__commons_events_event_node_created'] = $strongarm;
$strongarm = new stdClass();
$strongarm->disabled = FALSE; /* Edit this to true to make a default strongarm disabled initially */
$strongarm->api_version = 1;
$strongarm->name = 'field_bundle_settings_node__event';
$strongarm->value = array(
'view_modes' => array(
'teaser' => array(
'custom_settings' => TRUE,
),
'full' => array(
'custom_settings' => FALSE,
),
'rss' => array(
'custom_settings' => FALSE,
),
'search_index' => array(
'custom_settings' => FALSE,
),
'search_result' => array(
'custom_settings' => FALSE,
),
'token' => array(
'custom_settings' => FALSE,
),
),
'extra_fields' => array(
'form' => array(
'title' => array(
'weight' => '0',
),
'metatags' => array(
'weight' => '15',
),
'path' => array(
'weight' => '14',
),
'redirect' => array(
'weight' => '13',
),
),
'display' => array(),
),
);
$export['field_bundle_settings_node__event'] = $strongarm;
$strongarm = new stdClass();
$strongarm->disabled = FALSE; /* Edit this to true to make a default strongarm disabled initially */
$strongarm->api_version = 1;
$strongarm->name = 'menu_options_event';
$strongarm->value = array(
0 => 'main-menu',
);
$export['menu_options_event'] = $strongarm;
$strongarm = new stdClass();
$strongarm->disabled = FALSE; /* Edit this to true to make a default strongarm disabled initially */
$strongarm->api_version = 1;
$strongarm->name = 'menu_parent_event';
$strongarm->value = 'main-menu:0';
$export['menu_parent_event'] = $strongarm;
$strongarm = new stdClass();
$strongarm->disabled = FALSE; /* Edit this to true to make a default strongarm disabled initially */
$strongarm->api_version = 1;
$strongarm->name = 'node_options_event';
$strongarm->value = array(
0 => 'status',
);
$export['node_options_event'] = $strongarm;
$strongarm = new stdClass();
$strongarm->disabled = FALSE; /* Edit this to true to make a default strongarm disabled initially */
$strongarm->api_version = 1;
$strongarm->name = 'node_preview_event';
$strongarm->value = '1';
$export['node_preview_event'] = $strongarm;
$strongarm = new stdClass();
$strongarm->disabled = FALSE; /* Edit this to true to make a default strongarm disabled initially */
$strongarm->api_version = 1;
$strongarm->name = 'node_submitted_event';
$strongarm->value = 1;
$export['node_submitted_event'] = $strongarm;
return $export;
}

View File

@ -1,734 +0,0 @@
<?php
/**
* @file
* commons_events.views_default.inc
*/
/**
* Implements hook_views_default_views().
*/
function commons_events_views_default_views() {
$export = array();
$view = new view();
$view->name = 'commons_events_event_attendee_list';
$view->description = 'List attendees for a given event.';
$view->tag = 'commons_events';
$view->base_table = 'registration';
$view->human_name = 'Commons Events - Event Attendee List';
$view->core = 7;
$view->api_version = '3.0';
$view->disabled = FALSE; /* Edit this to true to make a default view disabled initially */
/* Display: Master */
$handler = $view->new_display('default', 'Master', 'default');
$handler->display->display_options['title'] = 'Attendees';
$handler->display->display_options['use_more_always'] = FALSE;
$handler->display->display_options['access']['type'] = 'none';
$handler->display->display_options['cache']['type'] = 'none';
$handler->display->display_options['query']['type'] = 'views_query';
$handler->display->display_options['exposed_form']['type'] = 'basic';
$handler->display->display_options['pager']['type'] = 'full';
$handler->display->display_options['pager']['options']['items_per_page'] = '20';
$handler->display->display_options['pager']['options']['offset'] = '0';
$handler->display->display_options['pager']['options']['id'] = '0';
$handler->display->display_options['pager']['options']['quantity'] = '4';
$handler->display->display_options['style_plugin'] = 'grid';
$handler->display->display_options['row_plugin'] = 'fields';
/* Relationship: Registration: Registration to Node */
$handler->display->display_options['relationships']['registration_related_node']['id'] = 'registration_related_node';
$handler->display->display_options['relationships']['registration_related_node']['table'] = 'registration';
$handler->display->display_options['relationships']['registration_related_node']['field'] = 'registration_related_node';
/* Relationship: Registration: User */
$handler->display->display_options['relationships']['user_uid']['id'] = 'user_uid';
$handler->display->display_options['relationships']['user_uid']['table'] = 'registration';
$handler->display->display_options['relationships']['user_uid']['field'] = 'user_uid';
$handler->display->display_options['relationships']['user_uid']['required'] = TRUE;
/* Field: User: Picture */
$handler->display->display_options['fields']['picture']['id'] = 'picture';
$handler->display->display_options['fields']['picture']['table'] = 'users';
$handler->display->display_options['fields']['picture']['field'] = 'picture';
$handler->display->display_options['fields']['picture']['relationship'] = 'user_uid';
$handler->display->display_options['fields']['picture']['label'] = '';
$handler->display->display_options['fields']['picture']['element_label_colon'] = FALSE;
$handler->display->display_options['fields']['picture']['image_style'] = '50x50';
/* Field: User: Name */
$handler->display->display_options['fields']['name']['id'] = 'name';
$handler->display->display_options['fields']['name']['table'] = 'users';
$handler->display->display_options['fields']['name']['field'] = 'name';
$handler->display->display_options['fields']['name']['relationship'] = 'user_uid';
$handler->display->display_options['fields']['name']['label'] = '';
$handler->display->display_options['fields']['name']['element_label_colon'] = FALSE;
/* Contextual filter: Content: Nid */
$handler->display->display_options['arguments']['nid']['id'] = 'nid';
$handler->display->display_options['arguments']['nid']['table'] = 'node';
$handler->display->display_options['arguments']['nid']['field'] = 'nid';
$handler->display->display_options['arguments']['nid']['relationship'] = 'registration_related_node';
$handler->display->display_options['arguments']['nid']['default_action'] = 'empty';
$handler->display->display_options['arguments']['nid']['default_argument_type'] = 'fixed';
$handler->display->display_options['arguments']['nid']['summary']['number_of_records'] = '0';
$handler->display->display_options['arguments']['nid']['summary']['format'] = 'default_summary';
$handler->display->display_options['arguments']['nid']['summary_options']['items_per_page'] = '25';
/* Display: Full Attendee List Block */
$handler = $view->new_display('block', 'Full Attendee List Block', 'commons_events_full_attendee_list');
$handler->display->display_options['defaults']['hide_admin_links'] = FALSE;
$handler->display->display_options['defaults']['pager'] = FALSE;
$handler->display->display_options['pager']['type'] = 'none';
$handler->display->display_options['pager']['options']['offset'] = '0';
/* Display: Content pane */
$handler = $view->new_display('panel_pane', 'Content pane', 'panel_pane_1');
$handler->display->display_options['defaults']['hide_admin_links'] = FALSE;
$handler->display->display_options['allow']['use_pager'] = 'use_pager';
$handler->display->display_options['allow']['items_per_page'] = 'items_per_page';
$handler->display->display_options['allow']['offset'] = 'offset';
$handler->display->display_options['allow']['link_to_view'] = 0;
$handler->display->display_options['allow']['more_link'] = 0;
$handler->display->display_options['allow']['path_override'] = 0;
$handler->display->display_options['allow']['title_override'] = 0;
$handler->display->display_options['allow']['exposed_form'] = 0;
$handler->display->display_options['allow']['fields_override'] = 0;
$handler->display->display_options['argument_input'] = array(
'null' => array(
'type' => 'fixed',
'context' => 'entity:comment.author',
'context_optional' => 0,
'panel' => '0',
'fixed' => 'node',
'label' => 'Global: Null',
),
'nid' => array(
'type' => 'context',
'context' => 'entity:node.nid',
'context_optional' => 0,
'panel' => '0',
'fixed' => '',
'label' => 'Content: Nid',
),
);
$translatables['commons_events_event_attendee_list'] = array(
t('Master'),
t('Attendees'),
t('more'),
t('Apply'),
t('Reset'),
t('Sort by'),
t('Asc'),
t('Desc'),
t('Items per page'),
t('- All -'),
t('Offset'),
t('« first'),
t(' previous'),
t('next '),
t('last »'),
t('node from Registration'),
t('User'),
t('All'),
t('Full Attendee List Block'),
t('Content pane'),
t('View panes'),
);
$export['commons_events_event_attendee_list'] = $view;
$view = new view();
$view->name = 'commons_events_organizers';
$view->description = 'Event organizer panel pane.';
$view->tag = 'commons_events';
$view->base_table = 'node';
$view->human_name = 'Commons Events - Organizers';
$view->core = 7;
$view->api_version = '3.0';
$view->disabled = FALSE; /* Edit this to true to make a default view disabled initially */
/* Display: Master */
$handler = $view->new_display('default', 'Master', 'default');
$handler->display->display_options['title'] = 'Organizers';
$handler->display->display_options['use_more_always'] = FALSE;
$handler->display->display_options['access']['type'] = 'perm';
$handler->display->display_options['cache']['type'] = 'none';
$handler->display->display_options['query']['type'] = 'views_query';
$handler->display->display_options['exposed_form']['type'] = 'basic';
$handler->display->display_options['pager']['type'] = 'none';
$handler->display->display_options['pager']['options']['offset'] = '0';
$handler->display->display_options['style_plugin'] = 'grid';
$handler->display->display_options['row_plugin'] = 'fields';
/* Relationship: Entity Reference: Referenced Entity */
$handler->display->display_options['relationships']['field_organizers_target_id']['id'] = 'field_organizers_target_id';
$handler->display->display_options['relationships']['field_organizers_target_id']['table'] = 'field_data_field_organizers';
$handler->display->display_options['relationships']['field_organizers_target_id']['field'] = 'field_organizers_target_id';
$handler->display->display_options['relationships']['field_organizers_target_id']['required'] = TRUE;
/* Field: User: Picture */
$handler->display->display_options['fields']['picture']['id'] = 'picture';
$handler->display->display_options['fields']['picture']['table'] = 'users';
$handler->display->display_options['fields']['picture']['field'] = 'picture';
$handler->display->display_options['fields']['picture']['relationship'] = 'field_organizers_target_id';
$handler->display->display_options['fields']['picture']['label'] = '';
$handler->display->display_options['fields']['picture']['element_label_colon'] = FALSE;
$handler->display->display_options['fields']['picture']['image_style'] = '50x50';
/* Contextual filter: Content: Nid */
$handler->display->display_options['arguments']['nid']['id'] = 'nid';
$handler->display->display_options['arguments']['nid']['table'] = 'node';
$handler->display->display_options['arguments']['nid']['field'] = 'nid';
$handler->display->display_options['arguments']['nid']['default_action'] = 'not found';
$handler->display->display_options['arguments']['nid']['default_argument_type'] = 'fixed';
$handler->display->display_options['arguments']['nid']['summary']['number_of_records'] = '0';
$handler->display->display_options['arguments']['nid']['summary']['format'] = 'default_summary';
$handler->display->display_options['arguments']['nid']['summary_options']['items_per_page'] = '25';
/* Display: Content pane */
$handler = $view->new_display('panel_pane', 'Content pane', 'panel_pane_1');
$handler->display->display_options['argument_input'] = array(
'nid' => array(
'type' => 'context',
'context' => 'entity:node.nid',
'context_optional' => 0,
'panel' => '0',
'fixed' => '',
'label' => 'Content: Nid',
),
);
$translatables['commons_events_organizers'] = array(
t('Master'),
t('Organizers'),
t('more'),
t('Apply'),
t('Reset'),
t('Sort by'),
t('Asc'),
t('Desc'),
t('User entity referenced from field_organizers'),
t('All'),
t('Content pane'),
t('View panes'),
);
$export['commons_events_organizers'] = $view;
$view = new view();
$view->name = 'commons_events_upcoming';
$view->description = 'Display upcoming events site-wide, or per-group.';
$view->tag = 'commons_events';
$view->base_table = 'node';
$view->human_name = 'Commons Events - Upcoming Events';
$view->core = 7;
$view->api_version = '3.0';
$view->disabled = FALSE; /* Edit this to true to make a default view disabled initially */
/* Display: Master */
$handler = $view->new_display('default', 'Master', 'default');
$handler->display->display_options['title'] = 'Events';
$handler->display->display_options['use_more_always'] = FALSE;
$handler->display->display_options['access']['type'] = 'perm';
$handler->display->display_options['cache']['type'] = 'none';
$handler->display->display_options['query']['type'] = 'views_query';
$handler->display->display_options['exposed_form']['type'] = 'basic';
$handler->display->display_options['pager']['type'] = 'load_more';
$handler->display->display_options['pager']['options']['items_per_page'] = '5';
$handler->display->display_options['pager']['options']['offset'] = '0';
$handler->display->display_options['pager']['options']['id'] = '0';
$handler->display->display_options['pager']['options']['quantity'] = '9';
$handler->display->display_options['style_plugin'] = 'default';
$handler->display->display_options['row_plugin'] = 'fields';
/* Field: Content: Title */
$handler->display->display_options['fields']['title_field']['id'] = 'title_field';
$handler->display->display_options['fields']['title_field']['table'] = 'field_data_title_field';
$handler->display->display_options['fields']['title_field']['field'] = 'title_field';
$handler->display->display_options['fields']['title_field']['label'] = '';
$handler->display->display_options['fields']['title_field']['link_to_entity'] = 1;
/* Field: Content: Date */
$handler->display->display_options['fields']['field_date']['id'] = 'field_date';
$handler->display->display_options['fields']['field_date']['table'] = 'field_data_field_date';
$handler->display->display_options['fields']['field_date']['field'] = 'field_date';
$handler->display->display_options['fields']['field_date']['label'] = '';
$handler->display->display_options['fields']['field_date']['element_label_colon'] = FALSE;
$handler->display->display_options['fields']['field_date']['settings'] = array(
'format_type' => 'event_datetime',
'fromto' => 'both',
'multiple_number' => '',
'multiple_from' => '',
'multiple_to' => '',
);
/* Field: Registration Settings: Spaces used */
$handler->display->display_options['fields']['capacity_used']['id'] = 'capacity_used';
$handler->display->display_options['fields']['capacity_used']['table'] = 'node';
$handler->display->display_options['fields']['capacity_used']['field'] = 'capacity_used';
$handler->display->display_options['fields']['capacity_used']['label'] = '';
$handler->display->display_options['fields']['capacity_used']['element_label_colon'] = FALSE;
$handler->display->display_options['fields']['capacity_used']['separator'] = '';
$handler->display->display_options['fields']['capacity_used']['suffix'] = ' attendees';
/* Field: Content: Comment count */
$handler->display->display_options['fields']['comment_count']['id'] = 'comment_count';
$handler->display->display_options['fields']['comment_count']['table'] = 'node_comment_statistics';
$handler->display->display_options['fields']['comment_count']['field'] = 'comment_count';
$handler->display->display_options['fields']['comment_count']['label'] = '';
$handler->display->display_options['fields']['comment_count']['alter']['alter_text'] = TRUE;
$handler->display->display_options['fields']['comment_count']['alter']['text'] = '[comment_count] comments';
$handler->display->display_options['fields']['comment_count']['element_label_colon'] = FALSE;
/* Sort criterion: Content: Date - start date (field_date) */
$handler->display->display_options['sorts']['field_date_value']['id'] = 'field_date_value';
$handler->display->display_options['sorts']['field_date_value']['table'] = 'field_data_field_date';
$handler->display->display_options['sorts']['field_date_value']['field'] = 'field_date_value';
/* Filter criterion: Content: Published */
$handler->display->display_options['filters']['status']['id'] = 'status';
$handler->display->display_options['filters']['status']['table'] = 'node';
$handler->display->display_options['filters']['status']['field'] = 'status';
$handler->display->display_options['filters']['status']['value'] = 1;
$handler->display->display_options['filters']['status']['group'] = 1;
$handler->display->display_options['filters']['status']['expose']['operator'] = FALSE;
/* Filter criterion: Content: Type */
$handler->display->display_options['filters']['type']['id'] = 'type';
$handler->display->display_options['filters']['type']['table'] = 'node';
$handler->display->display_options['filters']['type']['field'] = 'type';
$handler->display->display_options['filters']['type']['value'] = array(
'event' => 'event',
);
/* Filter criterion: Content: Date - start date (field_date) */
$handler->display->display_options['filters']['field_date_value']['id'] = 'field_date_value';
$handler->display->display_options['filters']['field_date_value']['table'] = 'field_data_field_date';
$handler->display->display_options['filters']['field_date_value']['field'] = 'field_date_value';
$handler->display->display_options['filters']['field_date_value']['operator'] = '>=';
$handler->display->display_options['filters']['field_date_value']['form_type'] = 'date_text';
$handler->display->display_options['filters']['field_date_value']['default_date'] = 'now';
/* Display: Feed */
$handler = $view->new_display('feed', 'Feed', 'feed');
$handler->display->display_options['defaults']['hide_admin_links'] = FALSE;
$handler->display->display_options['pager']['type'] = 'some';
$handler->display->display_options['pager']['options']['items_per_page'] = '50';
$handler->display->display_options['pager']['options']['offset'] = '0';
$handler->display->display_options['style_plugin'] = 'rss';
$handler->display->display_options['row_plugin'] = 'node_rss';
$handler->display->display_options['path'] = 'events-upcoming.xml';
$handler->display->display_options['displays'] = array(
'default' => 'default',
'page' => 'page',
);
/* Display: Global Block */
$handler = $view->new_display('block', 'Global Block', 'commons_events_upcoming_global_block');
$handler->display->display_options['defaults']['title'] = FALSE;
$handler->display->display_options['title'] = 'Upcoming events';
$handler->display->display_options['defaults']['hide_admin_links'] = FALSE;
$handler->display->display_options['defaults']['pager'] = FALSE;
$handler->display->display_options['pager']['type'] = 'some';
$handler->display->display_options['pager']['options']['items_per_page'] = '5';
$handler->display->display_options['defaults']['style_plugin'] = FALSE;
$handler->display->display_options['style_plugin'] = 'default';
$handler->display->display_options['defaults']['style_options'] = FALSE;
$handler->display->display_options['defaults']['row_plugin'] = FALSE;
$handler->display->display_options['row_plugin'] = 'fields';
$handler->display->display_options['defaults']['row_options'] = FALSE;
/* Display: Group pane */
$handler = $view->new_display('panel_pane', 'Group pane', 'panel_pane_1');
$handler->display->display_options['defaults']['title'] = FALSE;
$handler->display->display_options['title'] = 'Upcoming events';
$handler->display->display_options['defaults']['hide_admin_links'] = FALSE;
$handler->display->display_options['defaults']['pager'] = FALSE;
$handler->display->display_options['pager']['type'] = 'load_more';
$handler->display->display_options['pager']['options']['items_per_page'] = '3';
$handler->display->display_options['pager']['options']['offset'] = '0';
$handler->display->display_options['pager']['options']['id'] = '0';
$handler->display->display_options['pager']['options']['quantity'] = '9';
$handler->display->display_options['defaults']['style_plugin'] = FALSE;
$handler->display->display_options['style_plugin'] = 'default';
$handler->display->display_options['defaults']['style_options'] = FALSE;
$handler->display->display_options['defaults']['row_plugin'] = FALSE;
$handler->display->display_options['row_plugin'] = 'fields';
$handler->display->display_options['row_options']['inline'] = array(
'capacity_used' => 'capacity_used',
'comment_count' => 'comment_count',
);
$handler->display->display_options['defaults']['row_options'] = FALSE;
$handler->display->display_options['defaults']['relationships'] = FALSE;
/* Relationship: OG membership: OG membership from Node */
$handler->display->display_options['relationships']['og_membership_rel']['id'] = 'og_membership_rel';
$handler->display->display_options['relationships']['og_membership_rel']['table'] = 'node';
$handler->display->display_options['relationships']['og_membership_rel']['field'] = 'og_membership_rel';
$handler->display->display_options['relationships']['og_membership_rel']['required'] = TRUE;
$handler->display->display_options['defaults']['fields'] = FALSE;
/* Field: Content: Title */
$handler->display->display_options['fields']['title_field']['id'] = 'title_field';
$handler->display->display_options['fields']['title_field']['table'] = 'field_data_title_field';
$handler->display->display_options['fields']['title_field']['field'] = 'title_field';
$handler->display->display_options['fields']['title_field']['label'] = '';
$handler->display->display_options['fields']['title_field']['link_to_entity'] = 1;
/* Field: Content: Date */
$handler->display->display_options['fields']['field_date']['id'] = 'field_date';
$handler->display->display_options['fields']['field_date']['table'] = 'field_data_field_date';
$handler->display->display_options['fields']['field_date']['field'] = 'field_date';
$handler->display->display_options['fields']['field_date']['label'] = '';
$handler->display->display_options['fields']['field_date']['element_label_colon'] = FALSE;
$handler->display->display_options['fields']['field_date']['settings'] = array(
'format_type' => 'event_datetime',
'fromto' => 'both',
'multiple_number' => '',
'multiple_from' => '',
'multiple_to' => '',
);
/* Field: Registration Settings: Spaces used */
$handler->display->display_options['fields']['capacity_used']['id'] = 'capacity_used';
$handler->display->display_options['fields']['capacity_used']['table'] = 'node';
$handler->display->display_options['fields']['capacity_used']['field'] = 'capacity_used';
$handler->display->display_options['fields']['capacity_used']['label'] = '';
$handler->display->display_options['fields']['capacity_used']['element_label_colon'] = FALSE;
$handler->display->display_options['fields']['capacity_used']['separator'] = '';
$handler->display->display_options['fields']['capacity_used']['suffix'] = ' attendees,';
/* Field: Content: Comment count */
$handler->display->display_options['fields']['comment_count']['id'] = 'comment_count';
$handler->display->display_options['fields']['comment_count']['table'] = 'node_comment_statistics';
$handler->display->display_options['fields']['comment_count']['field'] = 'comment_count';
$handler->display->display_options['fields']['comment_count']['label'] = '';
$handler->display->display_options['fields']['comment_count']['alter']['alter_text'] = TRUE;
$handler->display->display_options['fields']['comment_count']['alter']['text'] = '[comment_count] comments';
$handler->display->display_options['fields']['comment_count']['element_label_colon'] = FALSE;
$handler->display->display_options['defaults']['arguments'] = FALSE;
/* Contextual filter: OG membership: Group ID */
$handler->display->display_options['arguments']['gid']['id'] = 'gid';
$handler->display->display_options['arguments']['gid']['table'] = 'og_membership';
$handler->display->display_options['arguments']['gid']['field'] = 'gid';
$handler->display->display_options['arguments']['gid']['relationship'] = 'og_membership_rel';
$handler->display->display_options['arguments']['gid']['default_action'] = 'empty';
$handler->display->display_options['arguments']['gid']['default_argument_type'] = 'fixed';
$handler->display->display_options['arguments']['gid']['summary']['number_of_records'] = '0';
$handler->display->display_options['arguments']['gid']['summary']['format'] = 'default_summary';
$handler->display->display_options['arguments']['gid']['summary_options']['items_per_page'] = '25';
$handler->display->display_options['pane_category']['name'] = 'Commons';
$handler->display->display_options['pane_category']['weight'] = '0';
$handler->display->display_options['argument_input'] = array(
'gid' => array(
'type' => 'context',
'context' => 'entity:node.nid',
'context_optional' => 0,
'panel' => '0',
'fixed' => '',
'label' => 'OG membership: Group ID',
),
);
/* Display: Landing Page pane */
$handler = $view->new_display('panel_pane', 'Landing Page pane', 'panel_pane_2');
$handler->display->display_options['defaults']['title'] = FALSE;
$handler->display->display_options['defaults']['hide_admin_links'] = FALSE;
$handler->display->display_options['defaults']['exposed_form'] = FALSE;
$handler->display->display_options['exposed_form']['type'] = 'basic';
$handler->display->display_options['exposed_form']['options']['expose_sort_order'] = FALSE;
$handler->display->display_options['exposed_form']['options']['autosubmit'] = TRUE;
$handler->display->display_options['defaults']['style_plugin'] = FALSE;
$handler->display->display_options['style_plugin'] = 'default';
$handler->display->display_options['defaults']['style_options'] = FALSE;
$handler->display->display_options['defaults']['row_plugin'] = FALSE;
$handler->display->display_options['row_plugin'] = 'node';
$handler->display->display_options['defaults']['row_options'] = FALSE;
$handler->display->display_options['defaults']['header'] = FALSE;
$handler->display->display_options['defaults']['empty'] = FALSE;
/* No results behavior: Global: Text area */
$handler->display->display_options['empty']['area']['id'] = 'area';
$handler->display->display_options['empty']['area']['table'] = 'views';
$handler->display->display_options['empty']['area']['field'] = 'area';
$handler->display->display_options['empty']['area']['empty'] = TRUE;
$handler->display->display_options['empty']['area']['content'] = 'No events have been created yet.';
$handler->display->display_options['empty']['area']['format'] = 'filtered_html';
$handler->display->display_options['defaults']['sorts'] = FALSE;
/* Sort criterion: Content: Promoted to front page */
$handler->display->display_options['sorts']['promote']['id'] = 'promote';
$handler->display->display_options['sorts']['promote']['table'] = 'node';
$handler->display->display_options['sorts']['promote']['field'] = 'promote';
$handler->display->display_options['sorts']['promote']['exposed'] = TRUE;
$handler->display->display_options['sorts']['promote']['expose']['label'] = 'Featured';
/* Sort criterion: Content: Date - start date (field_date) */
$handler->display->display_options['sorts']['field_date_value']['id'] = 'field_date_value';
$handler->display->display_options['sorts']['field_date_value']['table'] = 'field_data_field_date';
$handler->display->display_options['sorts']['field_date_value']['field'] = 'field_date_value';
$handler->display->display_options['sorts']['field_date_value']['exposed'] = TRUE;
$handler->display->display_options['sorts']['field_date_value']['expose']['label'] = 'Date';
$handler->display->display_options['inherit_panels_path'] = '1';
$translatables['commons_events_upcoming'] = array(
t('Master'),
t('Events'),
t('more'),
t('Apply'),
t('Reset'),
t('Sort by'),
t('Asc'),
t('Desc'),
t('Items per page'),
t('- All -'),
t('Offset'),
t('« first'),
t(' previous'),
t('next '),
t('last »'),
t('.'),
t(' attendees'),
t('[comment_count] comments'),
t(','),
t('Feed'),
t('Global Block'),
t('Upcoming events'),
t('Group pane'),
t('OG membership from node'),
t(' attendees,'),
t('All'),
t('Commons'),
t('Landing Page pane'),
t('No events have been created yet.'),
t('Featured'),
t('Date'),
t('View panes'),
);
$export['commons_events_upcoming'] = $view;
$view = new view();
$view->name = 'commons_events_user_upcoming_events';
$view->description = '';
$view->tag = 'default';
$view->base_table = 'node';
$view->human_name = 'Commons Events - User Upcoming Events';
$view->core = 7;
$view->api_version = '3.0';
$view->disabled = FALSE; /* Edit this to true to make a default view disabled initially */
/* Display: Master */
$handler = $view->new_display('default', 'Master', 'default');
$handler->display->display_options['use_more_always'] = FALSE;
$handler->display->display_options['access']['type'] = 'role';
$handler->display->display_options['access']['role'] = array(
2 => '2',
);
$handler->display->display_options['cache']['type'] = 'none';
$handler->display->display_options['query']['type'] = 'views_query';
$handler->display->display_options['exposed_form']['type'] = 'basic';
$handler->display->display_options['pager']['type'] = 'some';
$handler->display->display_options['pager']['options']['items_per_page'] = '2';
$handler->display->display_options['pager']['options']['offset'] = '0';
$handler->display->display_options['style_plugin'] = 'default';
$handler->display->display_options['row_plugin'] = 'node';
/* No results behavior: Global: Text area */
$handler->display->display_options['empty']['area']['id'] = 'area';
$handler->display->display_options['empty']['area']['table'] = 'views';
$handler->display->display_options['empty']['area']['field'] = 'area';
$handler->display->display_options['empty']['area']['empty'] = TRUE;
$handler->display->display_options['empty']['area']['content'] = 'You are not attending any upcoming events.';
$handler->display->display_options['empty']['area']['format'] = 'filtered_html';
/* Relationship: Registration: Node to Registration */
$handler->display->display_options['relationships']['registration_rel']['id'] = 'registration_rel';
$handler->display->display_options['relationships']['registration_rel']['table'] = 'node';
$handler->display->display_options['relationships']['registration_rel']['field'] = 'registration_rel';
$handler->display->display_options['relationships']['registration_rel']['required'] = TRUE;
/* Relationship: Registration: User */
$handler->display->display_options['relationships']['user_uid']['id'] = 'user_uid';
$handler->display->display_options['relationships']['user_uid']['table'] = 'registration';
$handler->display->display_options['relationships']['user_uid']['field'] = 'user_uid';
$handler->display->display_options['relationships']['user_uid']['relationship'] = 'registration_rel';
$handler->display->display_options['relationships']['user_uid']['required'] = TRUE;
/* Field: Content: Title */
$handler->display->display_options['fields']['title_field']['id'] = 'title_field';
$handler->display->display_options['fields']['title_field']['table'] = 'field_data_title_field';
$handler->display->display_options['fields']['title_field']['field'] = 'title_field';
$handler->display->display_options['fields']['title_field']['label'] = '';
$handler->display->display_options['fields']['title_field']['link_to_entity'] = 1;
/* Sort criterion: Content: Date - start date (field_date) */
$handler->display->display_options['sorts']['created']['id'] = 'created';
$handler->display->display_options['sorts']['field_date_value']['id'] = 'field_date_value';
$handler->display->display_options['sorts']['created']['table'] = 'node';
$handler->display->display_options['sorts']['field_date_value']['table'] = 'field_data_field_date';
$handler->display->display_options['sorts']['created']['field'] = 'created';
$handler->display->display_options['sorts']['field_date_value']['field'] = 'field_date_value';
/* Contextual filter: Registration: User */
$handler->display->display_options['arguments']['user_uid']['id'] = 'user_uid';
$handler->display->display_options['arguments']['user_uid']['table'] = 'registration';
$handler->display->display_options['arguments']['user_uid']['field'] = 'user_uid';
$handler->display->display_options['arguments']['user_uid']['relationship'] = 'registration_rel';
$handler->display->display_options['arguments']['user_uid']['default_action'] = 'empty';
$handler->display->display_options['arguments']['user_uid']['default_argument_type'] = 'fixed';
$handler->display->display_options['arguments']['user_uid']['summary']['number_of_records'] = '0';
$handler->display->display_options['arguments']['user_uid']['summary']['format'] = 'default_summary';
$handler->display->display_options['arguments']['user_uid']['summary_options']['items_per_page'] = '25';
/* Filter criterion: Content: Published */
$handler->display->display_options['filters']['status']['id'] = 'status';
$handler->display->display_options['filters']['status']['table'] = 'node';
$handler->display->display_options['filters']['status']['field'] = 'status';
$handler->display->display_options['filters']['status']['value'] = 1;
$handler->display->display_options['filters']['status']['group'] = 1;
$handler->display->display_options['filters']['status']['expose']['operator'] = FALSE;
/* Filter criterion: Content: Type */
$handler->display->display_options['filters']['type']['id'] = 'type';
$handler->display->display_options['filters']['type']['table'] = 'node';
$handler->display->display_options['filters']['type']['field'] = 'type';
$handler->display->display_options['filters']['type']['value'] = array(
'event' => 'event',
);
/* Filter criterion: Content: Date - start date (field_date) */
$handler->display->display_options['filters']['field_date_value']['id'] = 'field_date_value';
$handler->display->display_options['filters']['field_date_value']['table'] = 'field_data_field_date';
$handler->display->display_options['filters']['field_date_value']['field'] = 'field_date_value';
$handler->display->display_options['filters']['field_date_value']['operator'] = '>=';
$handler->display->display_options['filters']['field_date_value']['form_type'] = 'date_text';
$handler->display->display_options['filters']['field_date_value']['default_date'] = 'now';
/* Display: Block */
$handler = $view->new_display('block', 'Block', 'block');
$handler->display->display_options['defaults']['hide_admin_links'] = FALSE;
/* Display: You're attending - pane */
$handler = $view->new_display('panel_pane', 'You\'re attending - pane', 'panel_pane_1');
$handler->display->display_options['defaults']['title'] = FALSE;
$handler->display->display_options['title'] = 'You\'re attending';
$handler->display->display_options['defaults']['hide_admin_links'] = FALSE;
$handler->display->display_options['defaults']['style_plugin'] = FALSE;
$handler->display->display_options['style_plugin'] = 'default';
$handler->display->display_options['defaults']['style_options'] = FALSE;
$handler->display->display_options['defaults']['row_plugin'] = FALSE;
$handler->display->display_options['row_plugin'] = 'fields';
$handler->display->display_options['row_options']['inline'] = array(
'capacity_used' => 'capacity_used',
'comment_count' => 'comment_count',
);
$handler->display->display_options['defaults']['row_options'] = FALSE;
$handler->display->display_options['defaults']['empty'] = FALSE;
$handler->display->display_options['defaults']['fields'] = FALSE;
/* Field: Content: Title */
$handler->display->display_options['fields']['title_field']['id'] = 'title_field';
$handler->display->display_options['fields']['title_field']['table'] = 'field_data_title_field';
$handler->display->display_options['fields']['title_field']['field'] = 'title_field';
$handler->display->display_options['fields']['title_field']['label'] = '';
$handler->display->display_options['fields']['title_field']['link_to_entity'] = 1;
/* Field: Content: Address */
$handler->display->display_options['fields']['field_address']['id'] = 'field_address';
$handler->display->display_options['fields']['field_address']['table'] = 'field_data_field_address';
$handler->display->display_options['fields']['field_address']['field'] = 'field_address';
$handler->display->display_options['fields']['field_address']['label'] = '';
$handler->display->display_options['fields']['field_address']['element_label_colon'] = FALSE;
$handler->display->display_options['fields']['field_address']['click_sort_column'] = 'country';
$handler->display->display_options['fields']['field_address']['settings'] = array(
'use_widget_handlers' => 1,
'format_handlers' => array(
'address' => 'address',
),
);
/* Field: Registration Settings: Spaces used */
$handler->display->display_options['fields']['capacity_used']['id'] = 'capacity_used';
$handler->display->display_options['fields']['capacity_used']['table'] = 'node';
$handler->display->display_options['fields']['capacity_used']['field'] = 'capacity_used';
$handler->display->display_options['fields']['capacity_used']['label'] = '';
$handler->display->display_options['fields']['capacity_used']['alter']['alter_text'] = TRUE;
$handler->display->display_options['fields']['capacity_used']['alter']['text'] = '<strong>[capacity_used]</strong> attendees,';
$handler->display->display_options['fields']['capacity_used']['element_label_colon'] = FALSE;
$handler->display->display_options['fields']['capacity_used']['separator'] = '';
/* Field: Content: Comment count */
$handler->display->display_options['fields']['comment_count']['id'] = 'comment_count';
$handler->display->display_options['fields']['comment_count']['table'] = 'node_comment_statistics';
$handler->display->display_options['fields']['comment_count']['field'] = 'comment_count';
$handler->display->display_options['fields']['comment_count']['label'] = '';
$handler->display->display_options['fields']['comment_count']['alter']['alter_text'] = TRUE;
$handler->display->display_options['fields']['comment_count']['alter']['text'] = '<strong>[comment_count]</strong> comments';
$handler->display->display_options['fields']['comment_count']['element_label_colon'] = FALSE;
$handler->display->display_options['fields']['comment_count']['separator'] = '';
$handler->display->display_options['defaults']['arguments'] = FALSE;
/* Contextual filter: Registration: User */
$handler->display->display_options['arguments']['user_uid']['id'] = 'user_uid';
$handler->display->display_options['arguments']['user_uid']['table'] = 'registration';
$handler->display->display_options['arguments']['user_uid']['field'] = 'user_uid';
$handler->display->display_options['arguments']['user_uid']['relationship'] = 'registration_rel';
$handler->display->display_options['arguments']['user_uid']['default_action'] = 'default';
$handler->display->display_options['arguments']['user_uid']['default_argument_type'] = 'current_user';
$handler->display->display_options['arguments']['user_uid']['summary']['number_of_records'] = '0';
$handler->display->display_options['arguments']['user_uid']['summary']['format'] = 'default_summary';
$handler->display->display_options['arguments']['user_uid']['summary_options']['items_per_page'] = '25';
/* Display: You created - pane */
$handler = $view->new_display('panel_pane', 'You created - pane', 'panel_pane_2');
$handler->display->display_options['defaults']['title'] = FALSE;
$handler->display->display_options['title'] = 'You created';
$handler->display->display_options['defaults']['hide_admin_links'] = FALSE;
$handler->display->display_options['defaults']['style_plugin'] = FALSE;
$handler->display->display_options['style_plugin'] = 'default';
$handler->display->display_options['defaults']['style_options'] = FALSE;
$handler->display->display_options['defaults']['row_plugin'] = FALSE;
$handler->display->display_options['row_plugin'] = 'fields';
$handler->display->display_options['row_options']['inline'] = array(
'capacity_used' => 'capacity_used',
'comment_count' => 'comment_count',
);
$handler->display->display_options['defaults']['row_options'] = FALSE;
$handler->display->display_options['defaults']['empty'] = FALSE;
$handler->display->display_options['defaults']['relationships'] = FALSE;
$handler->display->display_options['defaults']['fields'] = FALSE;
/* Field: Content: Title */
$handler->display->display_options['fields']['title_field']['id'] = 'title_field';
$handler->display->display_options['fields']['title_field']['table'] = 'field_data_title_field';
$handler->display->display_options['fields']['title_field']['field'] = 'title_field';
$handler->display->display_options['fields']['title_field']['label'] = '';
$handler->display->display_options['fields']['title_field']['link_to_entity'] = 1;
/* Field: Content: Address */
$handler->display->display_options['fields']['field_address']['id'] = 'field_address';
$handler->display->display_options['fields']['field_address']['table'] = 'field_data_field_address';
$handler->display->display_options['fields']['field_address']['field'] = 'field_address';
$handler->display->display_options['fields']['field_address']['label'] = '';
$handler->display->display_options['fields']['field_address']['element_label_colon'] = FALSE;
$handler->display->display_options['fields']['field_address']['click_sort_column'] = 'country';
$handler->display->display_options['fields']['field_address']['settings'] = array(
'use_widget_handlers' => 1,
'format_handlers' => array(
'address' => 'address',
),
);
/* Field: Registration Settings: Spaces used */
$handler->display->display_options['fields']['capacity_used']['id'] = 'capacity_used';
$handler->display->display_options['fields']['capacity_used']['table'] = 'node';
$handler->display->display_options['fields']['capacity_used']['field'] = 'capacity_used';
$handler->display->display_options['fields']['capacity_used']['label'] = '';
$handler->display->display_options['fields']['capacity_used']['alter']['alter_text'] = TRUE;
$handler->display->display_options['fields']['capacity_used']['alter']['text'] = '<strong>[capacity_used]</strong> attendees,';
$handler->display->display_options['fields']['capacity_used']['element_label_colon'] = FALSE;
$handler->display->display_options['fields']['capacity_used']['separator'] = '';
/* Field: Content: Comment count */
$handler->display->display_options['fields']['comment_count']['id'] = 'comment_count';
$handler->display->display_options['fields']['comment_count']['table'] = 'node_comment_statistics';
$handler->display->display_options['fields']['comment_count']['field'] = 'comment_count';
$handler->display->display_options['fields']['comment_count']['label'] = '';
$handler->display->display_options['fields']['comment_count']['alter']['alter_text'] = TRUE;
$handler->display->display_options['fields']['comment_count']['alter']['text'] = '<strong>[comment_count]</strong> comments';
$handler->display->display_options['fields']['comment_count']['element_label_colon'] = FALSE;
$handler->display->display_options['fields']['comment_count']['separator'] = '';
$handler->display->display_options['defaults']['arguments'] = FALSE;
/* Contextual filter: Content: Author uid */
$handler->display->display_options['arguments']['uid']['id'] = 'uid';
$handler->display->display_options['arguments']['uid']['table'] = 'node';
$handler->display->display_options['arguments']['uid']['field'] = 'uid';
$handler->display->display_options['arguments']['uid']['default_action'] = 'default';
$handler->display->display_options['arguments']['uid']['default_argument_type'] = 'current_user';
$handler->display->display_options['arguments']['uid']['summary']['number_of_records'] = '0';
$handler->display->display_options['arguments']['uid']['summary']['format'] = 'default_summary';
$handler->display->display_options['arguments']['uid']['summary_options']['items_per_page'] = '25';
$translatables['commons_events_user_upcoming_events'] = array(
t('Master'),
t('more'),
t('Apply'),
t('Reset'),
t('Sort by'),
t('Asc'),
t('Desc'),
t('You are not attending any upcoming events.'),
t('node being the Registration'),
t('User'),
t('All'),
t('Block'),
t('You\'re attending - pane'),
t('You\'re attending'),
t('<strong>[capacity_used]</strong> attendees,'),
t('.'),
t('<strong>[comment_count]</strong> comments'),
t('View panes'),
t('You created - pane'),
t('You created'),
t('You follow - pane'),
t('You follow'),
t('flag'),
);
$export['commons_events_user_upcoming_events'] = $view;
return $export;
}

View File

@ -1,42 +0,0 @@
#edit-events-sidebar legend .summary {
width: 25em;
overflow: hidden;
line-height: 1em;
height: 1em;
}
#edit-events-sidebar .fieldset-legend .fieldset-title {
display: block;
}
#legend-registration-type:after {
content: ', ';
}
.view-commons-events-event-attendee-list {
background-color: #fff;
}
/**
* Fix fieldset margins for date and address field since they have weird
* spacing issues.
*/
#edit-field-date .fieldset-description {
display: none;
}
#edit-field-date .date-padding {
padding: 0px;
}
#edit-field-date .fieldset-wrapper .form-item:first-child,
#edit-field-date .form-item .form-item,
#edit-field-address .fieldset-wrapper .form-item:first-child,
#edit-field-address .form-item {
margin-top: 0em;
}
form.commons-events-form-float {
float: right;
}
.commons-events-button {
margin-left: 5px;
}

View File

@ -1,162 +0,0 @@
<?php
/**
* @file
* Commons Events form declarations.
*/
/**
* Form builder for Attend call to action on events, as long as registration
* is available onsite.
*/
function commons_events_attend_event_form($form, &$form_state, $event_node, $registration = NULL, $attendee_count = 0) {
$form_state['event_node'] = $event_node;
if (!registration_status('node', $event_node->nid, TRUE)) {
return array();
}
if (!isset($registration)) {
$registration_type = registration_get_entity_registration_type('node', $event_node);
$registration = entity_get_controller('registration')->create(array(
'entity_type' => 'node',
'entity_id' => $event_node->nid,
'type' => $registration_type,
));
}
$form_state['registration'] = $registration;
$form['submit'] = array(
'#type' => 'submit',
'#value' => t('Attend'),
);
$form['count'] = array(
'#type' => 'textfield',
'#default_value' => '0',
'#description' => t('+ Guests'),
'#size' => 2,
'#maxlength' => 2,
'#required' => false,
);
$form['attending'] = array(
'#theme_wrappers' => array('container'),
'#attributes' => array(
'class' => array('commons-event-status'),
),
'#markup' => format_plural($attendee_count, '<span class="commons-event-count">1</span> attendee', '<span class="commons-event-count">@count</span> attendees'),
);
$form['#attached']['css'] = array(
drupal_get_path('module', 'commons_events') . '/css/commons_events.css',
);
$form['#attributes'] = array('class' => array('commons-events-form-float'));
return $form;
}
/**
* Validation handler for attending an event.
* Checks to make sure that space is available for attending, and that it
* didn't fill up after the page load.
*/
function commons_events_attend_event_form_validate($form, &$form_state) {
global $user;
if ($form_state['values']['count'] == '') {
$form_state['values']['count'] = 0;
}
if (!is_numeric($form_state['values']['count'])) {
form_set_error('count', t('Guest count must be a number.'));
return FALSE;
}
// Include the registrant in the count.
$form_state['values']['count']++;
if (!registration_has_room('node', $form_state['event_node']->nid, $form_state['values']['count'])) {
form_set_error('count', t('Insufficient spaces remaining.'));
}
if (!registration_status('node', $form_state['event_node']->nid, TRUE)
|| !registration_has_room('node', $form_state['event_node']->nid)) {
form_set_error('submit', t('The event you are registering for is unavailable.'));
return FALSE;
}
elseif (registration_is_registered($form_state['registration'], NULL, $user->uid)) {
form_set_error('submit', t('You are already registered for this event.'));
return FALSE;
}
return TRUE;
}
/**
* Submission handler for attending an event.
*/
function commons_events_attend_event_form_submit($form, $form_state) {
global $user;
$registration = $form_state['registration'];
$registration->user_uid = $user->uid;
$registration->author_uid = $user->uid;
$registration->state = NULL;
$registration->count = $form_state['values']['count'];
if (registration_save($registration)) {
drupal_set_message(t('Your registration was saved.'));
// Have the user automatically follow the event if Commons Follow (Node) is
// enabled.
if (module_exists('commons_follow_node')) {
commons_follow_node_follow_node($registration->entity_id, 'event', $user->uid);
}
}
else {
drupal_set_message(t('There was an error saving your registration.'));
}
}
/**
* Form to cancel a registration for an event.
*/
function commons_events_cancel_event_form($form, &$form_state, $event, $registrations) {
$form_state['event'] = $event;
$form['#attributes'] = array('class' => array('commons-events-form-float'));
$form['#attached']['css'] = array(
drupal_get_path('module', 'commons_events') . '/css/commons_events.css',
);
$form['registration'] = array(
'#type' => 'value',
'#value' => $registrations,
);
$form['submit'] = array(
'#type' => 'submit',
'#value' => t('Cancel'),
);
$form['submit']['#attributes']['class'][] = 'commons-events-button';
$attendee_count = 0;
foreach ($registrations as $registration) {
$attendee_count += registration_event_count('node', $event->nid, $registration->registration_id);
}
// Remove registrant from count.
$attendee_count--;
if ($attendee_count > 1) {
// Single attending message.
$markup = t('You are attending with @guests', array('@guests' => format_plural($attendee_count, '1 guest', '@count guests')));
}
else {
$markup = t('You are attending.');
}
$form['attending'] = array(
'#theme_wrappers' => array('container'),
'#attributes' => array(
'class' => array('commons-event-status'),
),
'#markup' => $markup,
);
return $form;
}
/**
* Event cancel attendance form submit handler.
*/
function commons_events_cancel_event_form_submit($form, $form_state) {
$event = $form_state['event'];
if (isset($form_state['values']['registration'])) {
registration_delete_multiple(array_keys($form_state['values']['registration']));
drupal_set_message(t('Your registration has been cancelled.'));
}
}

View File

@ -1,66 +0,0 @@
<?php
/**
* @file
* Commons Events theme functions.
*/
/**
* Theme callback to display that a user is attending an event.
*/
function theme_commons_events_attending_event($variables = array()) {
global $user;
$event = $variables['event'];
if (!$event->nid) {
return '';
}
$attendee_count = isset($variables['attendee_count']) ? $variables['attendee_count'] : 0;
$registration_type = registration_get_entity_registration_type('node', $event);
$registration = entity_get_controller('registration')->create(array(
'entity_type' => 'node',
'entity_id' => $event->nid,
'type' => $registration_type,
'author_uid' => $user->uid,
));
if (!function_exists('commons_events_attend_event_form')
|| !function_exists('commons_events_cancel_event_form')) {
module_load_include('inc', 'commons_events', 'includes/commons_events.forms');
}
if (!registration_is_registered($registration, NULL, $user->uid)
&& registration_access('create', $registration, $user, $registration->type)
&& registration_status('node', $event->nid, TRUE)) {
return drupal_get_form('commons_events_attend_event_form_' . $event->nid, $event, $registration, $attendee_count);
}
elseif (registration_is_registered($registration, NULL, $user->uid) &&
registration_access('delete', $registration, $user, $registration->type)) {
$query = new EntityFieldQuery();
$query->entityCondition('entity_type', 'registration')
->propertyCondition('user_uid', $user->uid)
->propertyCondition('entity_id', $event->nid)
->propertyCondition('entity_type', 'node');
$result = $query->execute();
return drupal_get_form('commons_events_cancel_event_form_' . $event->nid, $event, $result['registration']);
}
return "";
}
/**
* Theme the event attendees list.
*/
function theme_commons_events_event_attendees($variables = array()) {
$title = '<p class="commons-events-attendees-title">' . t('Attendees') . '</p>';
$event_nid = $variables['event_nid'];
if (!isset($variables['display'])
|| $variables['display'] != 'full') {
return $title . views_embed_view('commons_events_event_attendee_list', 'default', $event_nid)
. '<p class="commons-events-all-attendees"><a href="/node/' . $event_nid . '/attendees">'
. t('See all attendees') . '</a></p>';
}
return $title . views_embed_view(
'commons_events_event_attendee_list',
'commons_events_full_attendee_list',
$event_nid);
}

View File

@ -1,18 +0,0 @@
(function ($) {
Drupal.behaviors.commons_events_update_registration_settings_legend = {
attach: function (context, settings) {
$(':input[name^="field_registration_type"]').change(function() {
$("[id^='edit-event-registration-settings'] .summary").text($(':input[name^="field_registration_type"] :selected').text());
if ($(':input[name^="field_registration_type"]').val() == 'external') {
$(':input[name^="field_status"]').val('0').change();
}
});
$(':input[name^="field_status"]').change(function() {
var cur = $(':input[name^="field_registration_type"] :selected').text();
$("[id^='edit-event-registration-settings'] .summary").text(cur + ', ' + $(':input[name="field_status"] :selected').text());
});
$(':input[name^="field_registration_type"]').change();
$(':input[name^="field_status"]').change();
}
};
})(jQuery);

View File

@ -1,20 +0,0 @@
<?php
/**
* @file
* commons_events_pages.features.inc
*/
/**
* Implements hook_ctools_plugin_api().
*/
function commons_events_pages_ctools_plugin_api($module = NULL, $api = NULL) {
if ($module == "panelizer" && $api == "panelizer") {
return array("version" => "1");
}
if ($module == "strongarm" && $api == "strongarm") {
return array("version" => "1");
}
if ($module == "page_manager" && $api == "pages_default") {
return array("version" => "1");
}
}

View File

@ -1,23 +0,0 @@
name = Commons Events Pages
description = Enhances the appearance of event nodes by listing the event organizers/attendees and allows them to be customized.
core = 7.x
package = Commons - Landing pages
dependencies[] = commons_events
dependencies[] = panelizer
dependencies[] = strongarm
features[ctools][] = panelizer:panelizer:1
features[ctools][] = strongarm:strongarm:1
features[ctools][] = page_manager:pages_default:1
features[features_api][] = api:2
features[page_manager_pages][] = views_events_landing_page
features[panelizer_defaults][] = node:event:default
features[variable][] = panelizer_defaults_node_event
; Information added by Drupal.org packaging script on 2015-03-18
version = "7.x-3.23"
core = "7.x"
project = "commons"
datestamp = "1426714630"

View File

@ -1,9 +0,0 @@
<?php
/**
* Add page title.
*/
function commons_events_pages_update_7301() {
features_revert(array('commons_events_pages' => array('page_manager_pages')));
return array();
}

View File

@ -1,7 +0,0 @@
<?php
/**
* @file
* Commons Events Pages module.
*/
include_once 'commons_events_pages.features.inc';

View File

@ -1,204 +0,0 @@
<?php
/**
* @file
* commons_events.pages_default.inc
*/
/**
* Implements hook_default_page_manager_pages().
*/
function commons_events_default_page_manager_pages() {
$page = new stdClass();
$page->disabled = FALSE; /* Edit this to true to make a default page disabled initially */
$page->api_version = 1;
$page->name = 'views_events_landing_page';
$page->task = 'page';
$page->admin_title = 'Views Events Landing Page';
$page->admin_description = '';
$page->path = 'events';
$page->access = array(
'type' => 'none',
'settings' => NULL,
);
$page->menu = array(
'type' => 'normal',
'title' => 'Events',
'weight' => '2',
'name' => 'main-menu',
'parent' => array(
'type' => 'none',
'title' => '',
'weight' => 0,
'name' => 'navigation',
),
);
$page->arguments = array();
$page->conf = array(
'admin_paths' => FALSE,
);
$page->default_handlers = array();
$handler = new stdClass();
$handler->disabled = FALSE; /* Edit this to true to make a default handler disabled initially */
$handler->api_version = 1;
$handler->name = 'page_views_events_landing_page_panel_context';
$handler->task = 'page';
$handler->subtask = 'views_events_landing_page';
$handler->handler = 'panel_context';
$handler->weight = 0;
$handler->conf = array(
'title' => 'Panel',
'no_blocks' => 0,
'pipeline' => 'ipe',
'body_classes_to_remove' => '',
'body_classes_to_add' => '',
'css_id' => '',
'css' => '',
'contexts' => array(),
'relationships' => array(),
);
$display = new panels_display();
$display->layout = 'two_66_33';
$display->layout_settings = array();
$display->panel_settings = array(
'style_settings' => array(
'default' => NULL,
'two_66_33_top' => NULL,
'two_66_33_first' => NULL,
'two_66_33_second' => NULL,
'two_66_33_bottom' => NULL,
),
);
$display->cache = array();
$display->title = 'Events';
$display->uuid = 'f084cd6c-0d66-7ca4-c971-3c5cf182d2ec';
$display->content = array();
$display->panels = array();
$pane = new stdClass();
$pane->pid = 'new-e72884a7-369b-1954-2d1f-d69207c4d6ff';
$pane->panel = 'two_66_33_first';
$pane->type = 'views_panes';
$pane->subtype = 'commons_events_upcoming-panel_pane_2';
$pane->shown = TRUE;
$pane->access = array();
$pane->configuration = array();
$pane->cache = array();
$pane->style = array(
'settings' => NULL,
);
$pane->css = array();
$pane->extras = array();
$pane->position = 0;
$pane->locks = array();
$pane->uuid = 'e72884a7-369b-1954-2d1f-d69207c4d6ff';
$display->content['new-e72884a7-369b-1954-2d1f-d69207c4d6ff'] = $pane;
$display->panels['two_66_33_first'][0] = 'new-e72884a7-369b-1954-2d1f-d69207c4d6ff';
$pane = new stdClass();
$pane->pid = 'new-b91ad246-669c-2e14-fd32-5728153b0ed8';
$pane->panel = 'two_66_33_second';
$pane->type = 'block';
$pane->subtype = 'commons_events-commons_events_create_event_link';
$pane->shown = TRUE;
$pane->access = array();
$pane->configuration = array(
'override_title' => 0,
'override_title_text' => '',
);
$pane->cache = array();
$pane->style = array(
'settings' => NULL,
);
$pane->css = array();
$pane->extras = array();
$pane->position = 0;
$pane->locks = array();
$pane->uuid = 'b91ad246-669c-2e14-fd32-5728153b0ed8';
$display->content['new-b91ad246-669c-2e14-fd32-5728153b0ed8'] = $pane;
$display->panels['two_66_33_second'][0] = 'new-b91ad246-669c-2e14-fd32-5728153b0ed8';
$pane = new stdClass();
$pane->pid = 'new-d776b637-24a9-7e74-712c-8bc27d399c3e';
$pane->panel = 'two_66_33_second';
$pane->type = 'block';
$pane->subtype = 'commons_events-commons_events_anonymous_login';
$pane->shown = TRUE;
$pane->access = array();
$pane->configuration = array(
'override_title' => 0,
'override_title_text' => '',
);
$pane->cache = array();
$pane->style = array(
'settings' => NULL,
);
$pane->css = array();
$pane->extras = array();
$pane->position = 1;
$pane->locks = array();
$pane->uuid = 'd776b637-24a9-7e74-712c-8bc27d399c3e';
$display->content['new-d776b637-24a9-7e74-712c-8bc27d399c3e'] = $pane;
$display->panels['two_66_33_second'][1] = 'new-d776b637-24a9-7e74-712c-8bc27d399c3e';
$pane = new stdClass();
$pane->pid = 'new-9118fc7d-3da5-cf54-5152-5d66043812b2';
$pane->panel = 'two_66_33_second';
$pane->type = 'views_panes';
$pane->subtype = 'commons_events_user_upcoming_events-panel_pane_1';
$pane->shown = TRUE;
$pane->access = array();
$pane->configuration = array();
$pane->cache = array();
$pane->style = array(
'settings' => NULL,
);
$pane->css = array();
$pane->extras = array();
$pane->position = 2;
$pane->locks = array();
$pane->uuid = '9118fc7d-3da5-cf54-5152-5d66043812b2';
$display->content['new-9118fc7d-3da5-cf54-5152-5d66043812b2'] = $pane;
$display->panels['two_66_33_second'][2] = 'new-9118fc7d-3da5-cf54-5152-5d66043812b2';
$pane = new stdClass();
$pane->pid = 'new-ef7caf29-a6a8-e654-5997-6b969eba407a';
$pane->panel = 'two_66_33_second';
$pane->type = 'views_panes';
$pane->subtype = 'commons_events_user_upcoming_events-panel_pane_2';
$pane->shown = TRUE;
$pane->access = array();
$pane->configuration = array();
$pane->cache = array();
$pane->style = array(
'settings' => NULL,
);
$pane->css = array();
$pane->extras = array();
$pane->position = 3;
$pane->locks = array();
$pane->uuid = 'ef7caf29-a6a8-e654-5997-6b969eba407a';
$display->content['new-ef7caf29-a6a8-e654-5997-6b969eba407a'] = $pane;
$display->panels['two_66_33_second'][3] = 'new-ef7caf29-a6a8-e654-5997-6b969eba407a';
$pane = new stdClass();
$pane->pid = 'new-80f087dc-fe84-7354-e19b-23e398080db9';
$pane->panel = 'two_66_33_second';
$pane->type = 'views_panes';
$pane->subtype = 'commons_events_user_upcoming_events-panel_pane_3';
$pane->shown = TRUE;
$pane->access = array();
$pane->configuration = array();
$pane->cache = array();
$pane->style = array(
'settings' => NULL,
);
$pane->css = array();
$pane->extras = array();
$pane->position = 4;
$pane->locks = array();
$pane->uuid = '80f087dc-fe84-7354-e19b-23e398080db9';
$display->content['new-80f087dc-fe84-7354-e19b-23e398080db9'] = $pane;
$display->panels['two_66_33_second'][4] = 'new-80f087dc-fe84-7354-e19b-23e398080db9';
$display->hide_title = PANELS_TITLE_FIXED;
$display->title_pane = 'new-9118fc7d-3da5-cf54-5152-5d66043812b2';
$handler->conf['display'] = $display;
$page->default_handlers[$handler->name] = $handler;
$pages['views_events_landing_page'] = $page;
return $pages;
}

View File

@ -1,134 +0,0 @@
<?php
/**
* @file
* commons_events_pages.panelizer.inc
*/
/**
* Implements hook_panelizer_defaults().
*/
function commons_events_pages_panelizer_defaults() {
$export = array();
$panelizer = new stdClass();
$panelizer->disabled = FALSE; /* Edit this to true to make a default panelizer disabled initially */
$panelizer->api_version = 1;
$panelizer->name = 'node:event:default';
$panelizer->title = 'Default';
$panelizer->panelizer_type = 'node';
$panelizer->panelizer_key = 'event';
$panelizer->no_blocks = FALSE;
$panelizer->css_id = '';
$panelizer->css = '';
$panelizer->pipeline = 'ipe';
$panelizer->contexts = array();
$panelizer->relationships = array();
$panelizer->access = array();
$panelizer->view_mode = 'page_manager';
$panelizer->css_class = '';
$panelizer->title_element = 'H2';
$panelizer->link_to_entity = TRUE;
$panelizer->extra = array();
$display = new panels_display();
$display->layout = 'two_66_33';
$display->layout_settings = array();
$display->panel_settings = array(
'style_settings' => array(
'default' => NULL,
'two_66_33_top' => NULL,
'two_66_33_first' => NULL,
'two_66_33_second' => NULL,
'two_66_33_bottom' => NULL,
),
);
$display->cache = array();
$display->title = '%node:title';
$display->uuid = '0d63be4d-5605-1644-fd5c-3872c8b1d8b6';
$display->content = array();
$display->panels = array();
$pane = new stdClass();
$pane->pid = 'new-f259289a-8ef0-6aa4-2592-c59928474958';
$pane->panel = 'two_66_33_first';
$pane->type = 'node_content';
$pane->subtype = 'node_content';
$pane->shown = TRUE;
$pane->access = array();
$pane->configuration = array(
'links' => 1,
'no_extras' => 0,
'override_title' => 0,
'override_title_text' => '',
'identifier' => '',
'link' => 0,
'leave_node_title' => 1,
'build_mode' => 'full',
'context' => 'panelizer',
);
$pane->cache = array();
$pane->style = array(
'settings' => NULL,
);
$pane->css = array();
$pane->extras = array();
$pane->position = 0;
$pane->locks = array();
$pane->uuid = 'f259289a-8ef0-6aa4-2592-c59928474958';
$display->content['new-f259289a-8ef0-6aa4-2592-c59928474958'] = $pane;
$display->panels['two_66_33_first'][0] = 'new-f259289a-8ef0-6aa4-2592-c59928474958';
$pane = new stdClass();
$pane->pid = 'new-a2912068-e5e2-c804-b1ba-3260dc059c9b';
$pane->panel = 'two_66_33_second';
$pane->type = 'views_panes';
$pane->subtype = 'commons_events_organizers-panel_pane_1';
$pane->shown = TRUE;
$pane->access = array();
$pane->configuration = array(
'context' => array(
0 => 'panelizer',
),
);
$pane->cache = array();
$pane->style = array(
'settings' => NULL,
);
$pane->css = array();
$pane->extras = array();
$pane->position = 0;
$pane->locks = array();
$pane->uuid = 'a2912068-e5e2-c804-b1ba-3260dc059c9b';
$display->content['new-a2912068-e5e2-c804-b1ba-3260dc059c9b'] = $pane;
$display->panels['two_66_33_second'][0] = 'new-a2912068-e5e2-c804-b1ba-3260dc059c9b';
$pane = new stdClass();
$pane->pid = 'new-aef85835-68a5-2494-b107-136f1cb92749';
$pane->panel = 'two_66_33_second';
$pane->type = 'views_panes';
$pane->subtype = 'commons_events_event_attendee_list-panel_pane_1';
$pane->shown = TRUE;
$pane->access = array();
$pane->configuration = array(
'use_pager' => 1,
'pager_id' => '0',
'items_per_page' => '20',
'offset' => '0',
'context' => array(
0 => 'panelizer',
),
);
$pane->cache = array();
$pane->style = array(
'settings' => NULL,
);
$pane->css = array();
$pane->extras = array();
$pane->position = 1;
$pane->locks = array();
$pane->uuid = 'aef85835-68a5-2494-b107-136f1cb92749';
$display->content['new-aef85835-68a5-2494-b107-136f1cb92749'] = $pane;
$display->panels['two_66_33_second'][1] = 'new-aef85835-68a5-2494-b107-136f1cb92749';
$display->hide_title = PANELS_TITLE_NONE;
$display->title_pane = '0';
$panelizer->display = $display;
$export['node:event:default'] = $panelizer;
return $export;
}

View File

@ -1,40 +0,0 @@
<?php
/**
* @file
* commons_events_pages.strongarm.inc
*/
/**
* Implements hook_strongarm().
*/
function commons_events_pages_strongarm() {
$export = array();
$strongarm = new stdClass();
$strongarm->disabled = FALSE; /* Edit this to true to make a default strongarm disabled initially */
$strongarm->api_version = 1;
$strongarm->name = 'panelizer_defaults_node_event';
$strongarm->value = array(
'status' => 1,
'view modes' => array(
'page_manager' => array(
'status' => 1,
'default' => 1,
'choice' => 0,
),
'default' => array(
'status' => 0,
'default' => 0,
'choice' => 0,
),
'teaser' => array(
'status' => 0,
'default' => 0,
'choice' => 0,
),
),
);
$export['panelizer_defaults_node_event'] = $strongarm;
return $export;
}

View File

@ -1,37 +0,0 @@
<?php
/**
* @file
* commons_events_solr.apachesolr_search_defaults.inc
*/
/**
* Implements hook_apachesolr_search_default_searchers().
*/
function commons_events_solr_apachesolr_search_default_searchers() {
$export = array();
$searcher = new stdClass();
$searcher->disabled = FALSE; /* Edit this to true to make a default searcher disabled initially */
$searcher->api_version = 3;
$searcher->page_id = 'solr_events';
$searcher->label = 'Solr Events';
$searcher->description = '';
$searcher->search_path = 'events';
$searcher->page_title = 'Events';
$searcher->env_id = apachesolr_default_environment();
$searcher->settings = array(
'fq' => array(
0 => 'bundle:event',
),
'apachesolr_search_custom_enable' => 1,
'apachesolr_search_search_type' => 'custom',
'apachesolr_search_search_box' => 0,
'apachesolr_search_per_page' => '10',
'apachesolr_search_browse' => 'results',
'apachesolr_search_spellcheck' => 0,
'apachesolr_search_allow_user_input' => 0,
);
$export['solr_events'] = $searcher;
return $export;
}

View File

@ -1,26 +0,0 @@
<?php
/**
* @file
* commons_events_solr.features.inc
*/
/**
* Implements hook_ctools_plugin_api().
*/
function commons_events_solr_ctools_plugin_api($module = NULL, $api = NULL) {
if ($module == "apachesolr_search" && $api == "apachesolr_search_defaults") {
return array("version" => "3");
}
if ($module == "facetapi" && $api == "facetapi_defaults") {
return array("version" => "1");
}
if ($module == "page_manager" && $api == "pages_default") {
return array("version" => "1");
}
if ($module == "pm_existing_pages" && $api == "pm_existing_pages") {
return array("version" => "1");
}
if ($module == "strongarm" && $api == "strongarm") {
return array("version" => "1");
}
}

View File

@ -1,30 +0,0 @@
name = Commons Search SOLR Event
description = Adds support for searching events to the Commons Search SOLR module.
package = Commons - Search
core = 7.x
dependencies[] = apachesolr_search
dependencies[] = commons_events
dependencies[] = ctools
dependencies[] = facetapi
dependencies[] = page_manager
dependencies[] = pm_existing_pages
dependencies[] = strongarm
features[apachesolr_search_page][] = solr_events
features[ctools][] = apachesolr_search:apachesolr_search_defaults:3
features[ctools][] = facetapi:facetapi_defaults:1
features[ctools][] = page_manager:pages_default:1
features[ctools][] = pm_existing_pages:pm_existing_pages:1
features[ctools][] = strongarm:strongarm:1
features[features_api][] = api:2
features[page_manager_existing_pages][] = solr_events_search
features[page_manager_handlers][] = pm_existing_pages_solr_events_search_panel_context
features[variable][] = pm_existing_pages_disabled_solr_events_search
; Information added by Drupal.org packaging script on 2015-03-18
version = "7.x-3.23"
core = "7.x"
project = "commons"
datestamp = "1426714630"

View File

@ -1,43 +0,0 @@
<?php
/**
* @file
* Commons Events Solr install script.
*/
/**
* Implements hook_install().
*/
function commons_events_solr_install() {
// Set module weight to be below rich_snippets, so we can disable snippeting
// on the Solr events landing page.
db_update('system')
->fields(array('weight' => 5))
->condition('name', 'commons_events_solr')
->execute();
}
/**
* Implements hook_enable().
*/
function commons_events_solr_enable() {
module_load_include('inc', 'page_manager', 'plugins/tasks/page');
$page = page_manager_page_load('views_events_landing_page');
ctools_include('export');
ctools_export_set_object_status($page, TRUE);
// Revert base Events feature so that the Events menu link is recreated.
features_revert(array('commons_events' => array('menu_links')));
menu_cache_clear_all();
}
/**
* Implements hook_disable().
*/
function commons_events_solr_disable() {
module_load_include('inc', 'page_manager', 'plugins/tasks/page');
$page = page_manager_page_load('views_events_landing_page');
ctools_include('export');
ctools_export_set_object_status($page, FALSE);
// Revert base Events feature so that the Events menu link is recreated.
features_revert(array('commons_events' => array('menu_links')));
menu_cache_clear_all();
}

View File

@ -1,288 +0,0 @@
<?php
/**
* @file
* Code for the Commons Events - Solr feature.
*/
include_once 'commons_events_solr.features.inc';
/**
* Get the search adapter and Solr environment for dynamic faceting.
*/
function commons_events_solr_search_environment() {
return "apachesolr@" . apachesolr_default_environment();
}
/**
* Dynamically create facets rather than let Features do it, so we can have
* facets based on the current default Solr environment.
*/
function commons_events_solr_create_facets($env_id = NULL) {
$facets = commons_events_solr_facet_definitions();
// Add each facet to the database with a merge so we don't have duplicates.
if (empty($env_id)) {
$env_id = commons_events_solr_search_environment();
}
foreach($facets as $facet) {
$facet['settings'] = serialize($facet['settings']);
$facet['name'] = $env_id . $facet['name'];
$facet['searcher'] = $env_id;
$merge = db_merge('facetapi')
->key(array('name' => $facet['name']))
->fields($facet)
->execute();
}
}
/**
* Base facet definitions.
*/
function commons_events_solr_facet_definitions() {
$facets = array();
$facets[] = array(
'name' => '::dm_field_date',
'searcher' => commons_events_solr_search_environment(),
'realm' => '',
'facet' => 'dm_field_date',
'enabled' => 1,
'settings' => array(
'operator' => 'and',
'hard_limit' => '50',
'dependencies' => array(
'roles' => array(),
),
'facet_mincount' => 1,
'facet_missing' => 0,
'flatten' => 0,
'query_type' => 'date_range',
),
);
$facets[] = array(
'name' => ':block:dm_field_date',
'searcher' => commons_events_solr_search_environment(),
'realm' => 'block',
'facet' => 'dm_field_date',
'enabled' => 1,
'settings' => array(
'weight' => 0,
'widget' => 'date_range',
'filters' => array(),
'active_sorts' => array(
'active' => 'active',
'indexed' => 'indexed',
'count' => 0,
'display' => 0,
),
'sort_weight' => array(
'active' => -50,
'indexed' => -49,
'count' => 0,
'display' => 0,
),
'sort_order' => array(
'active' => 3,
'indexed' => 4,
'count' => 4,
'display' => 4,
),
'empty_behavior' => 'none',
'soft_limit' => 20,
'nofollow' => 1,
'show_expanded' => 0,
'empty_text' => array(
'value' => '',
'format' => 'filtered_html',
),
),
);
$facets[] = array(
'name' => ':block:sm_field_location',
'searcher' => commons_events_solr_search_environment(),
'realm' => 'block',
'facet' => 'sm_field_location',
'enabled' => 1,
'settings' => array(
'weight' => 0,
'widget' => 'facetapi_links',
'filters' => array(),
'active_sorts' => array(
'active' => 'active',
'count' => 'count',
'display' => 'display',
),
'sort_weight' => array(
'active' => -50,
'count' => -49,
'display' => -48,
),
'sort_order' => array(
'active' => 3,
'count' => 3,
'display' => 4,
),
'empty_behavior' => 'none',
'soft_limit' => 20,
'nofollow' => 1,
'show_expanded' => 0,
),
);
$facets[] = array(
'name' => ':block:im_field_topics',
'searcher' => commons_events_solr_search_environment(),
'realm' => 'block',
'facet' => 'im_field_topics',
'enabled' => 1,
'settings' => array(
'weight' => 0,
'widget' => 'facetapi_links',
'filters' => array(),
'active_sorts' => array(
'active' => 'active',
'count' => 'count',
'display' => 'display',
'indexed' => 0,
),
'sort_weight' => array(
'active' => -50,
'count' => -49,
'display' => -48,
'indexed' => 0,
),
'sort_order' => array(
'active' => 3,
'count' => 3,
'display' => 4,
'indexed' => 4,
),
'empty_behavior' => 'text',
'soft_limit' => 20,
'nofollow' => 1,
'show_expanded' => 0,
'empty_text' => array(
'value' => 'None available',
'format' => 'filtered_html',
),
),
);
$facets[] = array(
'name' => '::im_field_topics',
'searcher' => commons_events_solr_search_environment(),
'realm' => '',
'facet' => 'im_field_topics',
'enabled' => 0,
'settings' => array(
'operator' => 'and',
'hard_limit' => 50,
'dependencies' => array(
'roles' => array(),
),
'facet_mintcount' => 1,
'facet_missing' => 0,
'flatten' => 0,
'query_type' => 'term',
),
);
$facets[] = array(
'name' => ':block:sm_og_group_ref',
'searcher' => commons_search_solr_search_environment(),
'realm' => 'block',
'facet' => 'sm_og_group_ref',
'enabled' => 1,
'settings' => array(
'weight' => 0,
'widget' => 'facetapi_links',
'filters' => array(),
'active_sorts' => array(
'active' => 'active',
'count' => 'count',
'display' => 'display',
),
'sort_weight' => array(
'active' => -50,
'count' => -49,
'display' => -48,
),
'sort_order' => array(
'active' => 3,
'count' => 3,
'display' => 4,
),
'empty_behavior' => 'none',
'soft_limit' => 20,
'nofollow' => 1,
'show_expanded' => 0,
),
);
return $facets;
}
/**
* Get the panels subtype for the facet block.
*/
function commons_events_solr_panel_facet_subtype($facet_name) {
$facet_name = commons_events_solr_search_environment() . ':block:' . $facet_name;
return 'facetapi-' . facetapi_hash_delta($facet_name);
}
/**
* Implements hook_theme_registry_alter().
*/
function commons_events_solr_theme_registry_alter(&$registry) {
$registry['apachesolr_search_noresults']['function'] = 'commons_events_solr_apachesolr_search_noresults';
}
/**
* Implements hook_preprocess_hook().
*/
function commons_events_solr_process_search_results(&$variables) {
if ($variables['search_page']['page_id'] == 'solr_events') {
$variables['title'] = format_plural(count($variables['results']), '1 event', '@count events');
}
}
/**
* Implements hook_form_alter().
*/
function commons_events_solr_form_apachesolr_environment_edit_form_alter(&$form, &$form_state) {
$form['actions']['save']['#submit'][] = 'commons_events_solr_environment_form_submit';
}
/**
* Friendlier empty text when there are no events.
*/
function commons_events_solr_apachesolr_search_noresults() {
$destination = drupal_get_destination();
if ($destination['destination'] != 'events') {
// Have to call the actual function since we overrode it to use the current
// function instead.
return theme_apachesolr_search_noresults();
}
$options = array('!create' => 'create one');
if (node_access('create', 'event')) {
$options['!create'] = l('create one', 'node/add/event');
}
return t('There are no events. Be the first to !create!', $options);
}
/**
* When the environment changes, create facets for that environment.
*/
function commons_events_solr_environment_form_submit($form, $form_state) {
if ($form_state['values']['make_default'] == 1) {
commons_events_solr_create_facets('apachesolr@' . $form_state['build_info']['args']['0']['env_id']);
// Need to clear caches so we can rebuild block definitions.
cache_clear_all('*', 'cache_block', TRUE);
cache_clear_all('*', 'cache_apachesolr', TRUE);
}
}
/**
* Implements hook_node_presave to display a message warning the user that results won't occur immediately
*/
function commons_events_solr_node_presave($node) {
if ($node->type == 'event') {
drupal_set_message(t('Your event may take a few minutes to appear on the listing page.'));
}
}

View File

@ -1,271 +0,0 @@
<?php
/**
* @file
* commons_events_solr.pages_default.inc
*/
/**
* Implements hook_default_page_manager_handlers().
*/
function commons_events_solr_default_page_manager_handlers() {
$export = array();
$handler = new stdClass();
$handler->disabled = FALSE; /* Edit this to true to make a default handler disabled initially */
$handler->api_version = 1;
$handler->name = 'pm_existing_pages_solr_events_search_panel_context';
$handler->task = 'pm_existing_pages';
$handler->subtask = 'solr_events_search';
$handler->handler = 'panel_context';
$handler->weight = 0;
$handler->conf = array(
'title' => 'Event Search',
'no_blocks' => 0,
'pipeline' => 'standard',
'body_classes_to_remove' => '',
'body_classes_to_add' => '',
'css_id' => '',
'css' => '',
'contexts' => array(),
'relationships' => array(),
);
$display = new panels_display();
$display->layout = 'three_25_50_25';
$display->layout_settings = array();
$display->panel_settings = array(
'style_settings' => array(
'default' => NULL,
'three_25_50_25_top' => NULL,
'three_25_50_25_first' => NULL,
'three_25_50_25_second' => NULL,
'three_25_50_25_third' => NULL,
'three_25_50_25_bottom' => NULL,
),
);
$display->cache = array();
$display->title = '';
$display->uuid = 'bf4f354a-dc68-cab4-a139-49e172b1c4ed';
$display->content = array();
$display->panels = array();
$pane = new stdClass();
$pane->pid = 'new-2edbeade-1d05-fbd4-f526-68239a54433f';
$pane->panel = 'three_25_50_25_first';
$pane->type = 'block';
$pane->subtype = commons_events_solr_panel_facet_subtype('sm_field_location');
$pane->shown = TRUE;
$pane->access = array();
$pane->configuration = array(
'override_title' => 1,
'override_title_text' => 'Attendance',
);
$pane->cache = array();
$pane->style = array(
'settings' => NULL,
);
$pane->css = array();
$pane->extras = array();
$pane->position = 0;
$pane->locks = array();
$pane->uuid = '2edbeade-1d05-fbd4-f526-68239a54433f';
$display->content['new-2edbeade-1d05-fbd4-f526-68239a54433f'] = $pane;
$display->panels['three_25_50_25_first'][0] = 'new-2edbeade-1d05-fbd4-f526-68239a54433f';
$pane = new stdClass();
$pane->pid = 'new-06093184-ccdb-9a84-1da8-e9f2dff0d882';
$pane->panel = 'three_25_50_25_first';
$pane->type = 'block';
$pane->subtype = commons_events_solr_panel_facet_subtype('dm_field_date');
$pane->shown = TRUE;
$pane->access = array();
$pane->configuration = array(
'override_title' => 1,
'override_title_text' => 'Date',
);
$pane->cache = array();
$pane->style = array(
'settings' => NULL,
);
$pane->css = array();
$pane->extras = array();
$pane->position = 1;
$pane->locks = array();
$pane->uuid = '06093184-ccdb-9a84-1da8-e9f2dff0d882';
$display->content['new-06093184-ccdb-9a84-1da8-e9f2dff0d882'] = $pane;
$display->panels['three_25_50_25_first'][1] = 'new-06093184-ccdb-9a84-1da8-e9f2dff0d882';
$pane = new stdClass();
$pane->pid = 'new-c84b8b32-c6d5-9ce4-bdec-f2735c5045b8';
$pane->panel = 'three_25_50_25_first';
$pane->type = 'block';
$pane->subtype = commons_events_solr_panel_facet_subtype('im_field_topics');
$pane->shown = TRUE;
$pane->access = array();
$pane->configuration = array(
'override_title' => 1,
'override_title_text' => 'Topic',
);
$pane->cache = array();
$pane->style = array(
'settings' => NULL,
);
$pane->css = array();
$pane->extras = array();
$pane->position = 2;
$pane->locks = array();
$pane->uuid = 'c84b8b32-c6d5-9ce4-bdec-f2735c5045b8';
$display->content['new-c84b8b32-c6d5-9ce4-bdec-f2735c5045b8'] = $pane;
$display->panels['three_25_50_25_first'][2] = 'new-c84b8b32-c6d5-9ce4-bdec-f2735c5045b8';
$pane = new stdClass();
$pane->pid = 'new-c46f0562-0218-76c4-b969-3abdc98f24fa';
$pane->panel = 'three_25_50_25_first';
$pane->type = 'block';
$pane->subtype = commons_events_solr_panel_facet_subtype('sm_og_group_ref');
$pane->shown = TRUE;
$pane->access = array();
$pane->configuration = array(
'override_title' => 1,
'override_title_text' => 'Group',
);
$pane->cache = array();
$pane->style = array(
'settings' => NULL,
);
$pane->css = array();
$pane->extras = array();
$pane->position = 3;
$pane->locks = array();
$pane->uuid = 'c46f0562-0218-76c4-b969-3abdc98f24fa';
$display->content['new-c46f0562-0218-76c4-b969-3abdc98f24fa'] = $pane;
$display->panels['three_25_50_25_first'][3] = 'new-c46f0562-0218-76c4-b969-3abdc98f24fa';
$pane = new stdClass();
$pane->pid = 'new-ba67e9d1-00ed-07b4-49df-bff421094214';
$pane->panel = 'three_25_50_25_second';
$pane->type = 'pm_existing_pages';
$pane->subtype = 'pm_existing_pages';
$pane->shown = TRUE;
$pane->access = array();
$pane->configuration = array(
0 => 'task_id',
1 => 'pane_title_from_menu',
'task_id' => 'solr_events_search',
'pane_title_from_menu' => 0,
'override_title' => 1,
'override_title_text' => '',
);
$pane->cache = array();
$pane->style = array(
'settings' => NULL,
);
$pane->css = array();
$pane->extras = array();
$pane->position = 0;
$pane->locks = array();
$pane->uuid = 'ba67e9d1-00ed-07b4-49df-bff421094214';
$display->content['new-ba67e9d1-00ed-07b4-49df-bff421094214'] = $pane;
$display->panels['three_25_50_25_second'][0] = 'new-ba67e9d1-00ed-07b4-49df-bff421094214';
$pane = new stdClass();
$pane->pid = 'new-f5cb9927-def5-8f94-098b-ca9d83eaf9fa';
$pane->panel = 'three_25_50_25_third';
$pane->type = 'block';
$pane->subtype = 'commons_events-commons_events_create_event_link';
$pane->shown = TRUE;
$pane->access = array();
$pane->configuration = array(
'override_title' => 0,
'override_title_text' => '',
);
$pane->cache = array();
$pane->style = array(
'settings' => NULL,
);
$pane->css = array();
$pane->extras = array();
$pane->position = 0;
$pane->locks = array();
$pane->uuid = 'f5cb9927-def5-8f94-098b-ca9d83eaf9fa';
$display->content['new-f5cb9927-def5-8f94-098b-ca9d83eaf9fa'] = $pane;
$display->panels['three_25_50_25_third'][0] = 'new-f5cb9927-def5-8f94-098b-ca9d83eaf9fa';
$pane = new stdClass();
$pane->pid = 'new-a9b484b9-8f95-46e4-d930-64dc3d093f3d';
$pane->panel = 'three_25_50_25_third';
$pane->type = 'block';
$pane->subtype = 'commons_events-commons_events_anonymous_login';
$pane->shown = TRUE;
$pane->access = array();
$pane->configuration = array(
'override_title' => 0,
'override_title_text' => '',
);
$pane->cache = array();
$pane->style = array(
'settings' => NULL,
);
$pane->css = array();
$pane->extras = array();
$pane->position = 1;
$pane->locks = array();
$pane->uuid = 'a9b484b9-8f95-46e4-d930-64dc3d093f3d';
$display->content['new-a9b484b9-8f95-46e4-d930-64dc3d093f3d'] = $pane;
$display->panels['three_25_50_25_third'][1] = 'new-a9b484b9-8f95-46e4-d930-64dc3d093f3d';
$pane = new stdClass();
$pane->pid = 'new-ae313741-a577-f194-9dd7-868986d44baf';
$pane->panel = 'three_25_50_25_third';
$pane->type = 'views_panes';
$pane->subtype = 'commons_events_user_upcoming_events-panel_pane_1';
$pane->shown = TRUE;
$pane->access = array();
$pane->configuration = array();
$pane->cache = array();
$pane->style = array(
'settings' => NULL,
);
$pane->css = array();
$pane->extras = array();
$pane->position = 2;
$pane->locks = array();
$pane->uuid = 'ae313741-a577-f194-9dd7-868986d44baf';
$display->content['new-ae313741-a577-f194-9dd7-868986d44baf'] = $pane;
$display->panels['three_25_50_25_third'][2] = 'new-ae313741-a577-f194-9dd7-868986d44baf';
$pane = new stdClass();
$pane->pid = 'new-6c32c82b-82f2-97f4-55b1-bc38ddc2e4b6';
$pane->panel = 'three_25_50_25_third';
$pane->type = 'views_panes';
$pane->subtype = 'commons_events_user_upcoming_events-panel_pane_2';
$pane->shown = TRUE;
$pane->access = array();
$pane->configuration = array();
$pane->cache = array();
$pane->style = array(
'settings' => NULL,
);
$pane->css = array();
$pane->extras = array();
$pane->position = 3;
$pane->locks = array();
$pane->uuid = '6c32c82b-82f2-97f4-55b1-bc38ddc2e4b6';
$display->content['new-6c32c82b-82f2-97f4-55b1-bc38ddc2e4b6'] = $pane;
$display->panels['three_25_50_25_third'][3] = 'new-6c32c82b-82f2-97f4-55b1-bc38ddc2e4b6';
$pane = new stdClass();
$pane->pid = 'new-0e2c9d7d-abfe-e314-9dba-e9c8dae6fc74';
$pane->panel = 'three_25_50_25_third';
$pane->type = 'views_panes';
$pane->subtype = 'commons_events_user_upcoming_events-panel_pane_3';
$pane->shown = TRUE;
$pane->access = array();
$pane->configuration = array();
$pane->cache = array();
$pane->style = array(
'settings' => NULL,
);
$pane->css = array();
$pane->extras = array();
$pane->position = 4;
$pane->locks = array();
$pane->uuid = '0e2c9d7d-abfe-e314-9dba-e9c8dae6fc74';
$display->content['new-0e2c9d7d-abfe-e314-9dba-e9c8dae6fc74'] = $pane;
$display->panels['three_25_50_25_third'][4] = 'new-0e2c9d7d-abfe-e314-9dba-e9c8dae6fc74';
$display->hide_title = PANELS_TITLE_NONE;
$display->title_pane = 'new-ba67e9d1-00ed-07b4-49df-bff421094214';
$handler->conf['display'] = $display;
$export['pm_existing_pages_solr_events_search_panel_context'] = $handler;
return $export;
}

View File

@ -1,22 +0,0 @@
<?php
/**
* @file
* commons_events_solr.pm_existing_pages.inc
*/
/**
* Implements hook_pm_existing_pages_info().
*/
function commons_events_solr_pm_existing_pages_info() {
$export = array();
$pm_existing_page = new stdClass();
$pm_existing_page->api_version = 1;
$pm_existing_page->name = 'solr_events_search';
$pm_existing_page->label = 'Solr Events Search';
$pm_existing_page->context = '';
$pm_existing_page->paths = 'events';
$export['solr_events_search'] = $pm_existing_page;
return $export;
}

Some files were not shown because too many files have changed in this diff Show More