├── atrium ├── atrium.block.inc ├── atrium.context.inc ├── atrium.features.filter.inc ├── atrium.features.inc ├── atrium.features.taxonomy.inc ├── atrium.features.user_permission.inc ├── atrium.features.user_role.inc ├── atrium.inc ├── atrium.info ├── atrium.install ├── atrium.module ├── atrium.strongarm.inc ├── atrium.views_default.inc ├── includes │ └── atrium_update_kit.inc ├── tests │ └── atrium.test └── theme │ └── atrium-welcome.tpl.php ├── atrium_activity ├── atrium_activity.context.inc ├── atrium_activity.features.inc ├── atrium_activity.info ├── atrium_activity.module ├── atrium_activity.views.inc ├── atrium_activity.views_default.inc └── includes │ ├── atrium_activity_handler_field_activity.inc │ ├── atrium_activity_handler_field_activity_path.inc │ ├── atrium_activity_handler_field_activity_timestamp.inc │ ├── atrium_activity_handler_field_activity_upload.inc │ ├── atrium_activity_handler_field_activity_user.inc │ └── atrium_activity_handler_filter_update_types.inc ├── atrium_blog ├── atrium_blog.context.inc ├── atrium_blog.features.content.inc ├── atrium_blog.features.inc ├── atrium_blog.features.user.inc ├── atrium_blog.features.user_permission.inc ├── atrium_blog.info ├── atrium_blog.install ├── atrium_blog.module ├── atrium_blog.strongarm.inc └── atrium_blog.views_default.inc ├── atrium_book ├── atrium_book.block.inc ├── atrium_book.context.inc ├── atrium_book.features.inc ├── atrium_book.features.user_permission.inc ├── atrium_book.info ├── atrium_book.install ├── atrium_book.js ├── atrium_book.module ├── atrium_book.pages.inc ├── atrium_book.strongarm.inc ├── atrium_book.views.inc ├── atrium_book.views_default.inc └── includes │ └── atrium_book_handler_filter_book_types.inc ├── atrium_calendar ├── atrium_calendar.context.inc ├── atrium_calendar.css ├── atrium_calendar.features.content.inc ├── atrium_calendar.features.inc ├── atrium_calendar.features.user_permission.inc ├── atrium_calendar.feeds_importer_default.inc ├── atrium_calendar.info ├── atrium_calendar.install ├── atrium_calendar.js ├── atrium_calendar.module ├── atrium_calendar.strongarm.inc ├── atrium_calendar.views_default.inc └── images │ └── checked.gif ├── atrium_casetracker ├── atrium_casetracker.context.inc ├── atrium_casetracker.css ├── atrium_casetracker.features.content.inc ├── atrium_casetracker.features.inc ├── atrium_casetracker.features.user_permission.inc ├── atrium_casetracker.info ├── atrium_casetracker.install ├── atrium_casetracker.module ├── atrium_casetracker.strongarm.inc ├── atrium_casetracker.views.inc ├── atrium_casetracker.views_default.inc ├── includes │ ├── atrium_casetracker_handler_field_priority_name.inc │ └── atrium_casetracker_handler_filter_status_closed.inc └── tests │ └── atrium_casetracker.test ├── atrium_groups ├── atrium_groups.context.inc ├── atrium_groups.features.inc ├── atrium_groups.features.user_permission.inc ├── atrium_groups.info ├── atrium_groups.install ├── atrium_groups.module ├── atrium_groups.spaces.inc ├── atrium_groups.strongarm.inc └── atrium_groups.views_default.inc ├── atrium_members ├── atrium_members.context.inc ├── atrium_members.features.inc ├── atrium_members.features.user_permission.inc ├── atrium_members.inc ├── atrium_members.info ├── atrium_members.install ├── atrium_members.js ├── atrium_members.module ├── atrium_members.spaces.inc ├── atrium_members.strongarm.inc ├── atrium_members.test └── atrium_members.views_default.inc ├── atrium_profile ├── atrium_profile.features.content.inc ├── atrium_profile.features.inc ├── atrium_profile.features.user_permission.inc ├── atrium_profile.info ├── atrium_profile.install ├── atrium_profile.module ├── atrium_profile.profile_migration.inc ├── atrium_profile.strongarm.inc └── atrium_profile.views_default.inc ├── atrium_reader ├── README.txt ├── atrium_reader.context.inc ├── atrium_reader.css ├── atrium_reader.data_default.inc ├── atrium_reader.features.content.inc ├── atrium_reader.features.inc ├── atrium_reader.features.menu_links.inc ├── atrium_reader.features.user_permission.inc ├── atrium_reader.feeds_importer_default.inc ├── atrium_reader.info ├── atrium_reader.install ├── atrium_reader.module ├── atrium_reader.strongarm.inc ├── atrium_reader.views_default.inc ├── images │ ├── icon.png │ └── icon.svg └── views │ ├── atrium_reader_handler_field_description.inc │ ├── atrium_reader_handler_field_title.inc │ └── atrium_reader_plugin_access.inc ├── atrium_shoutbox ├── atrium_shoutbox.context.inc ├── atrium_shoutbox.features.inc ├── atrium_shoutbox.features.user_permission.inc ├── atrium_shoutbox.info ├── atrium_shoutbox.install ├── atrium_shoutbox.js ├── atrium_shoutbox.module ├── atrium_shoutbox.strongarm.inc └── atrium_shoutbox.views_default.inc ├── atrium_test ├── atrium_test.d6.inc ├── atrium_test.info ├── atrium_test.module ├── atrium_web_test_case.php └── tests │ ├── atrium_basic.test │ └── atrium_translate.test └── atrium_translate ├── atrium_translate.inc ├── atrium_translate.info ├── atrium_translate.install └── atrium_translate.module /atrium/atrium.features.filter.inc: -------------------------------------------------------------------------------- 1 | 'Messaging plain text', 12 | 'roles' => array(), 13 | 'filters' => array( 14 | '0' => array( 15 | 'module' => 'filter', 16 | 'delta' => '1', 17 | 'weight' => '-10', 18 | ), 19 | '1' => array( 20 | 'module' => 'messaging', 21 | 'delta' => '1', 22 | 'weight' => '-9', 23 | ), 24 | ), 25 | ); 26 | 27 | // Exported format: Full HTML 28 | $formats['Full HTML'] = array( 29 | 'name' => 'Full HTML', 30 | 'roles' => array( 31 | '0' => 'administrator', 32 | '1' => 'manager', 33 | ), 34 | 'filters' => array( 35 | '0' => array( 36 | 'module' => 'codefilter', 37 | 'delta' => '0', 38 | 'weight' => '0', 39 | ), 40 | '1' => array( 41 | 'module' => 'filter', 42 | 'delta' => '2', 43 | 'weight' => '0', 44 | ), 45 | '2' => array( 46 | 'module' => 'filter', 47 | 'delta' => '1', 48 | 'weight' => '1', 49 | ), 50 | '3' => array( 51 | 'module' => 'filter', 52 | 'delta' => '3', 53 | 'weight' => '10', 54 | ), 55 | ), 56 | ); 57 | 58 | // Exported format: Markdown 59 | $formats['Markdown'] = array( 60 | 'name' => 'Markdown', 61 | 'roles' => array( 62 | '0' => 'administrator', 63 | '1' => 'anonymous user', 64 | '2' => 'authenticated user', 65 | '3' => 'manager', 66 | ), 67 | 'filters' => array( 68 | '0' => array( 69 | 'module' => 'markdown', 70 | 'delta' => '0', 71 | 'weight' => '-10', 72 | ), 73 | '1' => array( 74 | 'module' => 'filter', 75 | 'delta' => '2', 76 | 'weight' => '-9', 77 | ), 78 | '2' => array( 79 | 'module' => 'filter', 80 | 'delta' => '0', 81 | 'weight' => '-8', 82 | ), 83 | '3' => array( 84 | 'module' => 'codefilter', 85 | 'delta' => '0', 86 | 'weight' => '-7', 87 | ), 88 | '4' => array( 89 | 'module' => 'filter', 90 | 'delta' => '3', 91 | 'weight' => '-6', 92 | ), 93 | ), 94 | ); 95 | 96 | return $formats; 97 | } 98 | -------------------------------------------------------------------------------- /atrium/atrium.features.inc: -------------------------------------------------------------------------------- 1 | 3); 10 | } 11 | elseif ($module == "strongarm" && $api == "strongarm") { 12 | return array("version" => 1); 13 | } 14 | } 15 | 16 | /** 17 | * Implementation of hook_imagecache_default_presets(). 18 | */ 19 | function atrium_imagecache_default_presets() { 20 | $items = array( 21 | 'fileview' => array( 22 | 'presetname' => 'fileview', 23 | 'actions' => array( 24 | '0' => array( 25 | 'weight' => '0', 26 | 'module' => 'imagecache', 27 | 'action' => 'imagecache_deprecated_scale', 28 | 'data' => array( 29 | 'fit' => 'inside', 30 | 'width' => '60', 31 | 'height' => '40', 32 | ), 33 | ), 34 | ), 35 | ), 36 | 'user-m' => array( 37 | 'presetname' => 'user-m', 38 | 'actions' => array( 39 | '0' => array( 40 | 'weight' => '0', 41 | 'module' => 'imagecache', 42 | 'action' => 'imagecache_scale_and_crop', 43 | 'data' => array( 44 | 'width' => '60', 45 | 'height' => '60', 46 | ), 47 | ), 48 | ), 49 | ), 50 | 'user-s' => array( 51 | 'presetname' => 'user-s', 52 | 'actions' => array( 53 | '0' => array( 54 | 'weight' => '0', 55 | 'module' => 'imagecache', 56 | 'action' => 'imagecache_scale_and_crop', 57 | 'data' => array( 58 | 'width' => '30', 59 | 'height' => '30', 60 | ), 61 | ), 62 | ), 63 | ), 64 | ); 65 | return $items; 66 | } 67 | 68 | /** 69 | * Implementation of hook_views_api(). 70 | */ 71 | function atrium_views_api() { 72 | return array( 73 | 'api' => '2', 74 | ); 75 | } 76 | -------------------------------------------------------------------------------- /atrium/atrium.features.taxonomy.inc: -------------------------------------------------------------------------------- 1 | array( 9 | 'name' => 'Keywords', 10 | 'description' => NULL, 11 | 'help' => 'Enter tags related to your post.', 12 | 'relations' => '0', 13 | 'hierarchy' => '0', 14 | 'multiple' => '0', 15 | 'required' => '0', 16 | 'tags' => '1', 17 | 'module' => 'features_keywords', 18 | 'weight' => '0', 19 | 'nodes' => array( 20 | 'blog' => 'blog', 21 | 'book' => 'book', 22 | 'casetracker_basic_case' => 'casetracker_basic_case', 23 | 'casetracker_basic_project' => 'casetracker_basic_project', 24 | 'event' => 'event', 25 | ), 26 | ), 27 | ); 28 | } 29 | -------------------------------------------------------------------------------- /atrium/atrium.features.user_role.inc: -------------------------------------------------------------------------------- 1 | 'administrator', 12 | ); 13 | 14 | // Exported role: anonymous user 15 | $roles['anonymous user'] = array( 16 | 'name' => 'anonymous user', 17 | ); 18 | 19 | // Exported role: authenticated user 20 | $roles['authenticated user'] = array( 21 | 'name' => 'authenticated user', 22 | ); 23 | 24 | // Exported role: manager 25 | $roles['manager'] = array( 26 | 'name' => 'manager', 27 | ); 28 | 29 | return $roles; 30 | } 31 | -------------------------------------------------------------------------------- /atrium/tests/atrium.test: -------------------------------------------------------------------------------- 1 | 'Atrium', 11 | 'description' => 'Tests for core Atrium functionality.', 12 | 'group' => 'Atrium', 13 | ); 14 | } 15 | 16 | /** 17 | * Implementation of setUp(). 18 | */ 19 | function setUp() { 20 | parent::setUp(); 21 | $this->atriumBasic(); 22 | } 23 | 24 | /** 25 | * Test comment toggling. 26 | */ 27 | function testCommentToggle() { 28 | $this->drupalLogin($this->atriumUsers['user']); 29 | $node = $this->atriumCreateGroupContent($this->atriumGroups['public'], 'blog'); 30 | 31 | // Test that the comment form exists and the node owner can toggle 32 | // form commenting on and off. 33 | $this->drupalGet("{$this->atriumGroups['public']->path}/node/{$node->nid}"); 34 | $this->assertField('comment', t('Comment form found.')); 35 | $this->assertField('edit-comment-toggle', t('Comment toggler form found.')); 36 | 37 | // Admin should have access as well. 38 | $this->drupalLogin($this->atriumUsers['administrator']); 39 | $this->drupalGet("{$this->atriumGroups['public']->path}/node/{$node->nid}"); 40 | $this->assertField('edit-comment-toggle', t('Comment toggler form found.')); 41 | 42 | // Manager (and other users) do not have access. 43 | $this->drupalLogin($this->atriumUsers['manager']); 44 | $this->drupalGet("{$this->atriumGroups['public']->path}/node/{$node->nid}"); 45 | $this->assertNoField('edit-comment-toggle', t('Comment toggler form not found.')); 46 | 47 | // Turn off commenting. 48 | $this->drupalLogin($this->atriumUsers['user']); 49 | $this->drupalPost("{$this->atriumGroups['public']->path}/node/{$node->nid}", array(), t('Close comment thread')); 50 | 51 | // Test that comments are actually off. 52 | $this->drupalGet("{$this->atriumGroups['public']->path}/node/{$node->nid}"); 53 | $this->assertNoField('comment', t('Comment form not found.')); 54 | $this->assertField('edit-comment-toggle', t('Comment toggler form found.')); 55 | $this->drupalPost("{$this->atriumGroups['public']->path}/node/{$node->nid}", array(), t('Reopen comment thread')); 56 | 57 | // Admin should be able to turn them back on. 58 | $this->drupalLogin($this->atriumUsers['administrator']); 59 | $this->drupalGet("{$this->atriumGroups['public']->path}/node/{$node->nid}"); 60 | $this->assertField('edit-comment-toggle', t('Comment toggler form found.')); 61 | 62 | // Manager should not. 63 | $this->drupalLogin($this->atriumUsers['manager']); 64 | $this->drupalGet("{$this->atriumGroups['public']->path}/node/{$node->nid}"); 65 | $this->assertNoField('edit-comment-toggle', t('Comment toggler form not found.')); 66 | 67 | // Create a non-comment enabled content type. Make sure toggler form 68 | // does not appear. 69 | $this->drupalLogin($this->atriumUsers['user']); 70 | $book = $this->atriumCreateGroupContent($this->atriumGroups['public'], 'book'); 71 | $this->drupalGet("{$this->atriumGroups['public']->path}/node/{$book->nid}"); 72 | $this->assertNoField('edit-comment-toggle', t('Comment toggler form not found.')); 73 | } 74 | 75 | /** 76 | * Ensure that 403 pages display a login form for anonymous users. 77 | */ 78 | function test403() { 79 | $this->drupalLogout(); 80 | $this->drupalGet("node/{$this->atriumGroups['private']->nid}"); 81 | $this->assertText(t('Username')); 82 | $this->assertText(t('Password')); 83 | 84 | $user = $this->atriumCreateUser('authenticated user'); 85 | $this->drupalLogin($user); 86 | $this->drupalGet("node/{$this->atriumGroups['private']->nid}"); 87 | $this->assertResponse(403, t('Access denied')); 88 | } 89 | 90 | /** 91 | * Test archiving. 92 | */ 93 | function testArchive() { 94 | $this->drupalLogin($this->atriumCreateUser('administrator')); 95 | $group = $this->atriumCreateGroup(); 96 | $post = $this->atriumCreateGroupContent($group, 'blog'); 97 | 98 | // Archive the group. 99 | $this->drupalPost("node/{$group->nid}/archive", array(), t('Archive')); 100 | 101 | // Check that there is a message on both group & blog nodes. 102 | $this->drupalGet("node/{$group->nid}"); 103 | $message = t('This !type is archived. You may not add or alter any of its content.', array('!type' => node_get_types('name', $group->type))); 104 | $this->assertRaw($message); 105 | $this->drupalGet("node/{$post->nid}"); 106 | $message = t('This !type is archived. You may not add or alter any of its content.', array('!type' => node_get_types('name', $group->type))); 107 | $this->assertRaw($message); 108 | 109 | // Check that blog node editing is disabled. 110 | $this->drupalGet("node/{$post->nid}/edit"); 111 | $this->assertResponse(403, t('Access denied')); 112 | 113 | // Reactivate it. 114 | $this->drupalPost("node/{$group->nid}/reactivate", array(), t('Reactivate')); 115 | $message = t('The @type @title has been reactivated.', array('@type' => node_get_types('name', $group->type), '@title' => $group->title)); 116 | $this->assertRaw($message); 117 | 118 | // Check that blog node editing works. 119 | $this->drupalGet("node/{$post->nid}/edit"); 120 | $this->assertResponse(200, t('Accessible')); 121 | } 122 | } 123 | -------------------------------------------------------------------------------- /atrium/theme/atrium-welcome.tpl.php: -------------------------------------------------------------------------------- 1 |
2 | 3 | 4 | 5 | 14 | 15 | 16 | 17 |
18 | 19 |
20 | 21 |
-------------------------------------------------------------------------------- /atrium_activity/atrium_activity.context.inc: -------------------------------------------------------------------------------- 1 | disabled = FALSE; /* Edit this to true to make a default context disabled initially */ 11 | $context->api_version = 3; 12 | $context->name = 'activity_profile'; 13 | $context->description = ''; 14 | $context->tag = 'Profile'; 15 | $context->conditions = array( 16 | 'user_page' => array( 17 | 'values' => array( 18 | 'view' => 'view', 19 | ), 20 | 'options' => array( 21 | 'mode' => 'all', 22 | ), 23 | ), 24 | ); 25 | $context->reactions = array( 26 | 'block' => array( 27 | 'blocks' => array( 28 | 'views-activity_listing-block_3' => array( 29 | 'module' => 'views', 30 | 'delta' => 'activity_listing-block_3', 31 | 'region' => 'content', 32 | 'weight' => 0, 33 | ), 34 | ), 35 | ), 36 | ); 37 | $context->condition_mode = 0; 38 | 39 | // Translatables 40 | // Included for use with string extractors like potx. 41 | t('Profile'); 42 | $export['activity_profile'] = $context; 43 | 44 | return $export; 45 | } 46 | -------------------------------------------------------------------------------- /atrium_activity/atrium_activity.features.inc: -------------------------------------------------------------------------------- 1 | 3); 10 | } 11 | } 12 | 13 | /** 14 | * Implementation of hook_views_api(). 15 | */ 16 | function atrium_activity_views_api() { 17 | return array( 18 | 'api' => '2', 19 | ); 20 | } 21 | -------------------------------------------------------------------------------- /atrium_activity/atrium_activity.info: -------------------------------------------------------------------------------- 1 | name = "Atrium Activity" 2 | description = "Activity streams for showing new posts, updates and comments." 3 | core = "6.x" 4 | package = "Features" 5 | dependencies[] = "comment" 6 | dependencies[] = "context" 7 | features[context][] = "activity_profile" 8 | features[ctools][] = "context:context:3" 9 | features[views][] = "activity_listing" 10 | features[views_api][] = "api:2" 11 | kitf = "1.0-draft" 12 | 13 | ; Autodetected dependencies that are omitted: og_views, spaces 14 | -------------------------------------------------------------------------------- /atrium_activity/atrium_activity.module: -------------------------------------------------------------------------------- 1 | 'fieldset', 12 | '#title' => t('Atrium'), 13 | '#tree' => FALSE, 14 | '#collapsible' => FALSE, 15 | '#collapsed' => FALSE, 16 | ); 17 | $form['atrium']['atrium_activity_update_type'] = array( 18 | '#type' => 'checkbox', 19 | '#title' => t('Show in recent activity views'), 20 | '#description' => t('Show this content type in activity streams, update lists, etc.'), 21 | '#default_value' => variable_get('atrium_activity_update_type_'. $form['#node_type']->type, TRUE), 22 | ); 23 | } 24 | } 25 | 26 | /** 27 | * Abstracts the node types provided in update streams/feed views. 28 | */ 29 | function atrium_activity_update_types($reset = FALSE) { 30 | static $types; 31 | if (!isset($types) || $reset) { 32 | $types = array(); 33 | foreach (array_keys(node_get_types()) as $type) { 34 | if (variable_get('atrium_activity_update_type_'. $type, TRUE)) { 35 | $types[] = $type; 36 | } 37 | } 38 | } 39 | return $types; 40 | } 41 | 42 | /** 43 | * Implementation of hook_context_default_contexts_alter(). 44 | */ 45 | function atrium_activity_context_default_contexts_alter(&$contexts) { 46 | // Conditionally add the "Recent Activity" block to the spaces_dashboard-custom-1 context. 47 | if (module_exists('atrium') && !empty($contexts['spaces_dashboard-custom-1'])) { 48 | $contexts['spaces_dashboard-custom-1']->reactions['block']['blocks']['views-activity_listing-block_1'] = array( 49 | 'module' => 'views', 50 | 'delta' => 'activity_listing-block_1', 51 | 'region' => 'content', 52 | 'weight' => 1, 53 | ); 54 | } 55 | } -------------------------------------------------------------------------------- /atrium_activity/includes/atrium_activity_handler_field_activity.inc: -------------------------------------------------------------------------------- 1 | 30); 10 | return $options; 11 | } 12 | 13 | /** 14 | * Add the time_horizon element. 15 | */ 16 | function options_form(&$form, &$form_state) { 17 | parent::options_form($form, $form_state); 18 | $form['time_horizon'] = array( 19 | '#type' => 'select', 20 | '#title' => t('Time horizon'), 21 | '#description' => t('Show activity that goes back to the selected period. Choosing a shorter period will result in a more optimized view.'), 22 | '#options' => array( 23 | 7 => t('@num days', array('@num' => 7)), 24 | 14 => t('@num days', array('@num' => 14)), 25 | 30 => t('@num days', array('@num' => 30)), 26 | 90 => t('@num days', array('@num' => 90)), 27 | ), 28 | '#default_value' => $this->options['time_horizon'], 29 | ); 30 | } 31 | 32 | /** 33 | * Constructor. Add additional fields. 34 | */ 35 | function construct() { 36 | parent::construct(); 37 | $this->additional_fields['nid'] = array('table' => 'node', 'field' => 'nid'); 38 | $this->additional_fields['node_title'] = array('table' => 'node', 'field' => 'title'); 39 | $this->additional_fields['node_uid'] = array('table' => 'node_revisions', 'field' => 'uid'); 40 | $this->additional_fields['comment_uid'] = array('table' => 'comments', 'field' => 'uid'); 41 | $this->additional_fields['node_changed'] = array('table' => 'node', 'field' => 'changed'); 42 | $this->additional_fields['node_created'] = array('table' => 'node', 'field' => 'created'); 43 | } 44 | 45 | /** 46 | * Query. This relies on the hijacking of the Views execution process in 47 | * atrium_views_query_alter(). 48 | */ 49 | function query() { 50 | parent::query(); 51 | if (!isset($this->view->atrium_activity)) { 52 | $this->view->atrium_activity = TRUE; 53 | $node = $this->query->ensure_table('node'); 54 | $comments = $this->query->ensure_table('comments'); 55 | $horizon = $this->options['time_horizon'] * 24 * 60 * 60; 56 | $this->query->add_orderby(NULL, "***ATRIUM_ACTIVITY_TIMESTAMP***", 'DESC', 'atrium_activity_sort'); 57 | $this->query->add_where(NULL, "***ATRIUM_ACTIVITY_TIMESTAMP*** > (***CURRENT_TIME*** - $horizon)"); 58 | } 59 | } 60 | 61 | /** 62 | * Don't allow advanced render of this field. 63 | */ 64 | function allow_advanced_render() { return FALSE; } 65 | 66 | /** 67 | * Render this field as a link to group space. 68 | */ 69 | function render($value) { 70 | // Has comments 71 | if (!empty($value->{$this->field_alias})) { 72 | $account = $this->user_load($value->{$this->aliases['comment_uid']}); 73 | $tokens = array( 74 | '!user' => theme('username', $account), 75 | '!title' => l($value->{$this->aliases['node_title']}, "node/{$value->{$this->aliases['nid']}}", array('fragment' => "comment-{$value->{$this->field_alias}}")), 76 | ); 77 | return t('!user commented on !title', $tokens); 78 | } 79 | // No comments 80 | $account = $this->user_load($value->{$this->aliases['node_uid']}); 81 | $tokens = array( 82 | '!user' => theme('username', $account), 83 | '!title' => l($value->{$this->aliases['node_title']}, "node/{$value->{$this->aliases['nid']}}"), 84 | ); 85 | if ($value->{$this->aliases['node_changed']} > $value->{$this->aliases['node_created']}) { 86 | return t('!user updated !title', $tokens); 87 | } 88 | return t('!user posted !title', $tokens); 89 | } 90 | 91 | /** 92 | * Static cached user load. 93 | */ 94 | protected function user_load($uid, $reset = FALSE) { 95 | static $cache = array(); 96 | if (!isset($cache[$uid]) || $reset) { 97 | $cache[$uid] = user_load($uid); 98 | } 99 | return $cache[$uid]; 100 | } 101 | } 102 | -------------------------------------------------------------------------------- /atrium_activity/includes/atrium_activity_handler_field_activity_path.inc: -------------------------------------------------------------------------------- 1 | FALSE); 8 | return $options; 9 | } 10 | 11 | /** 12 | * Add the time_horizon element. 13 | */ 14 | function options_form(&$form, $form_state) { 15 | parent::options_form($form, $form_state); 16 | unset($form['time_horizon']); 17 | $form['absolute'] = array( 18 | '#type' => 'checkbox', 19 | '#title' => t('Use absolute link (begins with "http://")'), 20 | '#default_value' => $this->options['absolute'], 21 | '#description' => t('If you want to use this as in "output this field as link" in "link path", you must enable this option.'), 22 | ); 23 | } 24 | 25 | /** 26 | * Render this field as a link to group space. 27 | */ 28 | function render($value) { 29 | // Has comments 30 | if (!empty($value->{$this->field_alias})) { 31 | return url("node/{$value->{$this->aliases['nid']}}", array( 32 | 'absolute' => $this->options['absolute'], 33 | 'fragment' => "comment-{$value->{$this->field_alias}}" 34 | )); 35 | } 36 | // No comments 37 | return url("node/{$value->{$this->aliases['nid']}}", array( 38 | 'absolute' => $this->options['absolute'], 39 | )); 40 | } 41 | } -------------------------------------------------------------------------------- /atrium_activity/includes/atrium_activity_handler_field_activity_timestamp.inc: -------------------------------------------------------------------------------- 1 | field_alias = 'atrium_activity_sort'; 43 | if (class_exists('reldate_handler_field_date')) { 44 | return reldate_handler_field_date::render($values); 45 | } 46 | elseif (class_exists('views_handler_field_date')) { 47 | return views_handler_field_date::render($values); 48 | } 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /atrium_activity/includes/atrium_activity_handler_field_activity_upload.inc: -------------------------------------------------------------------------------- 1 | additional_fields['filemime'] = array('table' => 'files', 'field' => 'filemime'); 10 | $this->additional_fields['filename'] = array('table' => 'files', 'field' => 'filename'); 11 | $this->additional_fields['filepath'] = array('table' => 'files', 'field' => 'filepath'); 12 | } 13 | 14 | /** 15 | * Query. This relies on the hijacking of the Views execution process in 16 | * atrium_views_query_alter(). 17 | */ 18 | function query() { 19 | $this->query->ensure_table('comments'); 20 | 21 | $join = new views_join(); 22 | $join->construct('upload', 'node', 'vid', 'vid', array(), 'INNER'); 23 | $this->query->ensure_table('upload'); 24 | 25 | $join = new views_join(); 26 | $join->construct('files', 'upload', 'fid', 'fid', array(), 'INNER'); 27 | $this->query->ensure_table('files', NULL, $join); 28 | 29 | // We run the parent query method last, as the tables need to be added 30 | // before the additional fields can be. 31 | parent::query(); 32 | } 33 | 34 | /** 35 | * Render this field as a link to group space. 36 | */ 37 | function render($value) { 38 | $filename = truncate_utf8($value->{$this->aliases['filename']}, 25, FALSE, TRUE); 39 | // Has comments 40 | if (!empty($value->{$this->field_alias})) { 41 | $account = $this->user_load($value->{$this->aliases['comment_uid']}); 42 | $tokens = array( 43 | '!user' => theme('username', $account), 44 | '!title' => l($filename, "node/{$value->{$this->aliases['nid']}}", array('fragment' => "comment-{$value->{$this->field_alias}}")), 45 | ); 46 | } 47 | // No comments 48 | else { 49 | $account = $this->user_load($value->{$this->aliases['node_uid']}); 50 | $tokens = array( 51 | '!user' => theme('username', $account), 52 | '!title' => l($filename, "node/{$value->{$this->aliases['nid']}}"), 53 | ); 54 | } 55 | $download = l(t('Download'), file_create_url($value->{$this->aliases['filepath']}), array('attributes' => array('class' => 'atrium-activity-download'))); 56 | return $download .' '. t('!user uploaded !title', $tokens); 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /atrium_activity/includes/atrium_activity_handler_field_activity_user.inc: -------------------------------------------------------------------------------- 1 | options['overwrite_anonymous']) || !empty($this->options['link_to_user'])) { 11 | $this->additional_fields['uid'] = 'uid'; 12 | } 13 | } 14 | 15 | function option_definition() { 16 | $options = parent::option_definition(); 17 | $options['overwrite_anonymous'] = array('default' => FALSE); 18 | $options['anonymous_text'] = array('default' => '', 'translatable' => TRUE); 19 | $options['link_to_user'] = array('default' => TRUE); 20 | return $options; 21 | } 22 | 23 | /** 24 | * Add the time_horizon element. 25 | */ 26 | function options_form(&$form, $form_state) { 27 | parent::options_form($form, $form_state); 28 | unset($form['time_horizon']); 29 | 30 | $form['overwrite_anonymous'] = array( 31 | '#title' => t('Overwrite the value to display for anonymous users'), 32 | '#type' => 'checkbox', 33 | '#default_value' => !empty($this->options['overwrite_anonymous']), 34 | '#description' => t('If selected, you will see a field to enter the text to use for anonymous users.'), 35 | ); 36 | $form['anonymous_text'] = array( 37 | '#title' => t('Text to display for anonymous users'), 38 | '#type' => 'textfield', 39 | '#default_value' => $this->options['anonymous_text'], 40 | '#process' => array('views_process_dependency'), 41 | '#dependency' => array( 42 | 'edit-options-overwrite-anonymous' => array(1), 43 | ), 44 | ); 45 | $form['link_to_user'] = array( 46 | '#title' => t('Link this field to its user'), 47 | '#description' => t('This will override any other link you have set.'), 48 | '#type' => 'checkbox', 49 | '#default_value' => $this->options['link_to_user'], 50 | ); 51 | } 52 | 53 | /** 54 | * Render this field as a link to activity user 55 | */ 56 | function render($value) { 57 | // Has comments 58 | if (!empty($value->{$this->field_alias})) { 59 | $account = user_load($value->{$this->aliases['comment_uid']}); 60 | if (!empty($this->options['link_to_user'])) { 61 | return theme('username', $account); 62 | } 63 | else { 64 | return check_plain($account->name); 65 | } 66 | } 67 | // No comments 68 | $account = user_load($value->{$this->aliases['node_uid']}); 69 | if (!empty($this->options['link_to_user'])) { 70 | return theme('username', $account); 71 | } 72 | else { 73 | return check_plain($account->name); 74 | } 75 | } 76 | } -------------------------------------------------------------------------------- /atrium_activity/includes/atrium_activity_handler_filter_update_types.inc: -------------------------------------------------------------------------------- 1 | ensure_my_table(); 12 | $placeholder = "'%s'"; 13 | $replace = array_fill(0, sizeof($types), $placeholder); 14 | $in = ' (' . implode(", ", $replace) . ')'; 15 | 16 | // We use array_values() because the checkboxes keep keys and that can cause 17 | // array addition problems. 18 | $this->query->add_where($this->options['group'], "$this->table_alias.$this->real_field IN {$in}", array_values($types)); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /atrium_blog/atrium_blog.context.inc: -------------------------------------------------------------------------------- 1 | disabled = FALSE; /* Edit this to true to make a default context disabled initially */ 11 | $context->api_version = 3; 12 | $context->name = 'blog_listing'; 13 | $context->description = ''; 14 | $context->tag = 'Blog'; 15 | $context->conditions = array( 16 | 'node' => array( 17 | 'values' => array( 18 | 'blog' => 'blog', 19 | ), 20 | 'options' => array( 21 | 'node_form' => 1, 22 | ), 23 | ), 24 | 'views' => array( 25 | 'values' => array( 26 | 'blog_listing' => 'blog_listing', 27 | ), 28 | ), 29 | ); 30 | $context->reactions = array( 31 | 'block' => array( 32 | 'blocks' => array( 33 | 'views-blog_comments-block_1' => array( 34 | 'module' => 'views', 35 | 'delta' => 'blog_comments-block_1', 36 | 'region' => 'right', 37 | 'weight' => 0, 38 | ), 39 | ), 40 | ), 41 | 'menu' => 'blog', 42 | ); 43 | $context->condition_mode = 0; 44 | 45 | // Translatables 46 | // Included for use with string extractors like potx. 47 | t('Blog'); 48 | $export['blog_listing'] = $context; 49 | 50 | return $export; 51 | } 52 | -------------------------------------------------------------------------------- /atrium_blog/atrium_blog.features.content.inc: -------------------------------------------------------------------------------- 1 | 'field_referenced_book_page', 12 | 'type_name' => 'blog', 13 | 'display_settings' => array( 14 | 'weight' => 0, 15 | 'parent' => '', 16 | 'label' => array( 17 | 'format' => 'inline', 18 | ), 19 | 'teaser' => array( 20 | 'format' => 'default', 21 | 'exclude' => 0, 22 | ), 23 | 'full' => array( 24 | 'format' => 'default', 25 | 'exclude' => 0, 26 | ), 27 | ), 28 | 'widget_active' => '1', 29 | 'type' => 'nodereference', 30 | 'required' => '0', 31 | 'multiple' => '0', 32 | 'module' => 'nodereference', 33 | 'active' => '1', 34 | 'referenceable_types' => array( 35 | 'book' => 'book', 36 | 'event' => 'event', 37 | 'imageset' => 'imageset', 38 | 'admin_message' => 0, 39 | 'blog' => 0, 40 | 'casetracker_basic_case' => 0, 41 | 'feedapi_node' => 0, 42 | 'group' => 0, 43 | 'page' => 0, 44 | 'profile' => 0, 45 | 'casetracker_basic_project' => 0, 46 | 'shoutbox' => 0, 47 | 'feed_ical_item' => 0, 48 | 'feed_ical' => 0, 49 | ), 50 | 'advanced_view' => '--', 51 | 'advanced_view_args' => '', 52 | 'widget' => array( 53 | 'autocomplete_match' => 'contains', 54 | 'size' => NULL, 55 | 'default_value' => array( 56 | '0' => array( 57 | 'nid' => NULL, 58 | '_error_element' => 'default_value_widget][field_referenced_book_page][0][nid][nid', 59 | ), 60 | ), 61 | 'default_value_php' => NULL, 62 | 'label' => 'Referenced Page', 63 | 'weight' => 0, 64 | 'description' => 'Type in the title of another post to add a reference.', 65 | 'type' => 'nodereference_autocomplete', 66 | 'module' => 'nodereference', 67 | ), 68 | ); 69 | 70 | // Translatables 71 | // Included for use with string extractors like potx. 72 | t('Referenced Page'); 73 | 74 | return $fields; 75 | } 76 | -------------------------------------------------------------------------------- /atrium_blog/atrium_blog.features.inc: -------------------------------------------------------------------------------- 1 | 3); 10 | } 11 | elseif ($module == "strongarm" && $api == "strongarm") { 12 | return array("version" => 1); 13 | } 14 | } 15 | 16 | /** 17 | * Implementation of hook_node_info(). 18 | */ 19 | function atrium_blog_node_info() { 20 | $items = array( 21 | 'blog' => array( 22 | 'name' => t('Blog entry'), 23 | 'module' => 'features', 24 | 'description' => t('A blog is a regularly updated journal or diary made up of individual posts shown in reversed chronological order. Each member of the site may create and maintain a blog.'), 25 | 'has_title' => '1', 26 | 'title_label' => t('Title'), 27 | 'has_body' => '1', 28 | 'body_label' => t('Body'), 29 | 'min_word_count' => '0', 30 | 'help' => '', 31 | ), 32 | ); 33 | return $items; 34 | } 35 | 36 | /** 37 | * Implementation of hook_views_api(). 38 | */ 39 | function atrium_blog_views_api() { 40 | return array( 41 | 'api' => '2', 42 | ); 43 | } 44 | -------------------------------------------------------------------------------- /atrium_blog/atrium_blog.features.user.inc: -------------------------------------------------------------------------------- 1 | 'create blog content', 12 | 'roles' => array( 13 | '0' => 'admin', 14 | '1' => 'authenticated user', 15 | '2' => 'manager', 16 | ), 17 | ); 18 | 19 | // Exported permission: delete own blog content 20 | $permissions['delete own blog content'] = array( 21 | 'name' => 'delete own blog content', 22 | 'roles' => array( 23 | '0' => 'admin', 24 | '1' => 'authenticated user', 25 | '2' => 'manager', 26 | ), 27 | ); 28 | 29 | // Exported permission: edit own blog content 30 | $permissions['edit own blog content'] = array( 31 | 'name' => 'edit own blog content', 32 | 'roles' => array( 33 | '0' => 'admin', 34 | '1' => 'authenticated user', 35 | '2' => 'manager', 36 | ), 37 | ); 38 | 39 | return $permissions; 40 | } 41 | -------------------------------------------------------------------------------- /atrium_blog/atrium_blog.features.user_permission.inc: -------------------------------------------------------------------------------- 1 | 'create blog content', 12 | 'roles' => array( 13 | '0' => 'administrator', 14 | '1' => 'authenticated user', 15 | '2' => 'manager', 16 | ), 17 | ); 18 | 19 | // Exported permission: delete own blog content 20 | $permissions['delete own blog content'] = array( 21 | 'name' => 'delete own blog content', 22 | 'roles' => array( 23 | '0' => 'administrator', 24 | '1' => 'authenticated user', 25 | '2' => 'manager', 26 | ), 27 | ); 28 | 29 | // Exported permission: edit own blog content 30 | $permissions['edit own blog content'] = array( 31 | 'name' => 'edit own blog content', 32 | 'roles' => array( 33 | '0' => 'administrator', 34 | '1' => 'authenticated user', 35 | '2' => 'manager', 36 | ), 37 | ); 38 | 39 | return $permissions; 40 | } 41 | -------------------------------------------------------------------------------- /atrium_blog/atrium_blog.info: -------------------------------------------------------------------------------- 1 | name = "Atrium Blog" 2 | description = "The blog lets you have a conversation on a topic with your team." 3 | core = "6.x" 4 | package = "Features" 5 | dependencies[] = "comment" 6 | dependencies[] = "context" 7 | dependencies[] = "features" 8 | dependencies[] = "nodereference" 9 | dependencies[] = "spaces" 10 | dependencies[] = "strongarm" 11 | dependencies[] = "views" 12 | features[content][] = "blog-field_referenced_book_page" 13 | features[context][] = "blog_listing" 14 | features[ctools][] = "context:context:3" 15 | features[ctools][] = "strongarm:strongarm:1" 16 | features[node][] = "blog" 17 | features[user_permission][] = "create blog content" 18 | features[user_permission][] = "delete own blog content" 19 | features[user_permission][] = "edit own blog content" 20 | features[variable][] = "atrium_activity_update_type_blog" 21 | features[variable][] = "comment_blog" 22 | features[variable][] = "comment_controls_blog" 23 | features[variable][] = "comment_default_mode_blog" 24 | features[variable][] = "comment_default_order_blog" 25 | features[variable][] = "comment_default_per_page_blog" 26 | features[variable][] = "comment_form_location_blog" 27 | features[variable][] = "comment_preview_blog" 28 | features[variable][] = "comment_subject_field_blog" 29 | features[variable][] = "comment_upload_blog" 30 | features[variable][] = "content_extra_weights_blog" 31 | features[variable][] = "node_options_blog" 32 | features[variable][] = "nodeformscols_field_placements_blog_default" 33 | features[variable][] = "notifications_content_type_blog" 34 | features[variable][] = "og_content_type_usage_blog" 35 | features[variable][] = "show_diff_inline_blog" 36 | features[variable][] = "show_preview_changes_blog" 37 | features[variable][] = "upload_blog" 38 | features[views][] = "blog_comments" 39 | features[views][] = "blog_listing" 40 | features[views_api][] = "api:2" 41 | kitf = "1.0-draft" 42 | spaces[types][] = "og" 43 | -------------------------------------------------------------------------------- /atrium_blog/atrium_blog.install: -------------------------------------------------------------------------------- 1 | array( 9 | 'atrium_blog' => array( 10 | 'blog_listing' => array( 11 | 'block_1' => array( 12 | 'module' => 'views', 13 | 'delta' => 'block_1', 14 | ), 15 | 'block_2' => array( 16 | 'module' => 'views', 17 | 'delta' => 'block_2', 18 | ), 19 | ), 20 | ), 21 | 'atrium_blog_comments' => array( 22 | 'blog_comments' => array( 23 | 'block_1' => array( 24 | 'module' => 'views', 25 | 'delta' => 'block_1', 26 | ), 27 | ), 28 | ), 29 | ), 30 | 'contexts' => array( 31 | 'spaces-feature-blog' => 'blog_listing', 32 | ), 33 | ); 34 | 35 | module_load_include('inc', 'atrium', 'includes/atrium_update_kit'); 36 | atrium_kit_comply_presets($components); 37 | atrium_kit_comply_overrides($components); 38 | atrium_kit_comply_contexts($components); 39 | 40 | return array(array('success' => true, 'query' => 'Atrium Blog updated for Kit compliance.')); 41 | } -------------------------------------------------------------------------------- /atrium_blog/atrium_blog.module: -------------------------------------------------------------------------------- 1 | '. t('Blog') .''; 12 | $help .= '

'. t("The blog lets your team communicate by posting updates and discussing issues. It is a great place for sharing progress, discussing challenges, and exploring ideas.") .'

'; 13 | $help .= '

'. t("To start a conversation navigate to the blog and click the \"Add blog post\" button. You will need to enter a title and some body content to your post. Then click \"Save\".") .'

'; 14 | return $help; 15 | } 16 | 17 | // Contextual help content. 18 | if (context_isset('context', 'blog_listing')) { 19 | if ($path == 'node/add/blog') { 20 | $help = ''; 21 | $help .= '

'. t('Blog') .'

'; 22 | $help .= '

'. t("Post an entry to the blog of this group. The post will be shared will all team members on the blog, and they will be able to reply to it. You can optionally notify other group members by checking their name in the notifications field.") .'

'; 23 | return $help; 24 | } 25 | else { 26 | $help = '

'. t('Blog') .'

'; 27 | $help .= '

'. t("The blog lets your team communicate by posting updates and discussing issues. It is a great place for sharing progress, discussing challenges, and exploring ideas.") .'

'; 28 | return $help; 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /atrium_book/atrium_book.block.inc: -------------------------------------------------------------------------------- 1 | book['bid'])) { 9 | // Only show the block if the user has view access for the top-level node. 10 | $title = db_result(db_query(db_rewrite_sql('SELECT n.title FROM {node} n WHERE n.nid = %d'), $node->book['bid'])); 11 | if ($title) { 12 | // Dynamic block 13 | if (module_exists('admin') && variable_get('atrium_book_mode', 'ajax') === 'ajax') { 14 | $data = array_shift(menu_tree_all_data($node->book['menu_name'])); 15 | if ($data['below']) { 16 | drupal_add_css(drupal_get_path('module', 'admin') .'/includes/admin.menu.css'); 17 | drupal_add_js(drupal_get_path('module', 'admin') .'/includes/jquery.drilldown.js'); 18 | drupal_add_js(drupal_get_path('module', 'atrium_book') .'/atrium_book.js'); 19 | drupal_add_js(array('atriumBookPath' => url($_GET['q'])), 'setting'); 20 | $title = l($data['link']['title'], "node/{$node->book['bid']}", array('attributes' => array('class' => 'depth-0'))); 21 | return array( 22 | 'subject' => "{$title}", 23 | 'content' => menu_tree_output(array($data)), 24 | ); 25 | } 26 | } 27 | // Boring old block 28 | else { 29 | $data = array_shift(menu_tree_page_data($node->book['menu_name'])); 30 | if ($data['below']) { 31 | $title = l($data['link']['title'], "node/{$node->book['bid']}", array('attributes' => array('class' => 'depth-0'))); 32 | return array( 33 | 'subject' => $title, 34 | 'content' => menu_tree_output($data['below']), 35 | ); 36 | } 37 | } 38 | } 39 | } 40 | } 41 | 42 | /** 43 | * Feature-aware book block. Show all books that belong to the current feature. 44 | */ 45 | function _atrium_book_block_book_all() { 46 | if (module_exists('spaces')) { 47 | $space = spaces_get_space(); 48 | } 49 | // Retrieve node type arguments from active context if necessary. 50 | $type = NULL; 51 | foreach (context_get('context') as $context) { 52 | if (!empty($context->conditions['bookroot']['values'])) { 53 | $type = current($context->conditions['bookroot']['values']); 54 | break; 55 | } 56 | } 57 | 58 | // Dynamic block. 59 | if (module_exists('admin') && variable_get('atrium_book_mode', 'ajax') === 'ajax') { 60 | drupal_add_css(drupal_get_path('module', 'admin') .'/includes/admin.menu.css'); 61 | drupal_add_js(drupal_get_path('module', 'admin') .'/includes/jquery.drilldown.js'); 62 | drupal_add_js(drupal_get_path('module', 'atrium_book') .'/atrium_book.js'); 63 | drupal_add_js(array('atriumBookPath' => url($_GET['q'])), 'setting'); 64 | 65 | // Build a distinct cache ID per space & node type. 66 | if ($space) { 67 | $cid = $type ? "atrium_book:{$space->type}:{$space->id}:$type" : "atrium_book:{$space->type}:{$space->id}"; 68 | } 69 | else { 70 | $cid = $type ? "atrium_book:$type" : "atrium_book"; 71 | } 72 | if ($cache = cache_get($cid)) { 73 | $block = array( 74 | 'subject' => "". t('Notebook') ."", 75 | 'content' => $cache->data, 76 | ); 77 | } 78 | else if ($view = views_get_view('book_current')) { 79 | // Since the tree is *complete* and will be cached, we clear out 80 | // $_GET['q'] for the duration of the build to prevent stray active 81 | // classes from being added to links in the tree. 82 | $q = $_GET['q']; 83 | $_GET['q'] = ''; 84 | 85 | // Generate book tree per book node in current space. 86 | $data = array(); 87 | $view->execute_display('default', array($type)); 88 | if (is_array($view->result) && count($view->result)) { 89 | foreach($view->result as $row) { 90 | $data = array_merge($data, menu_tree_all_data(book_menu_name($row->nid))); 91 | } 92 | $data = array(array('link' => array('title' => t('Notebook'), 'href' => 'notebook'), 'below' => $data)); 93 | if ($output = menu_tree_output($data)) { 94 | cache_set($cid, $output); 95 | $block = array( 96 | 'subject' => "". t('Notebook') ."", 97 | 'content' => $output, 98 | ); 99 | } 100 | } 101 | 102 | // Put path back. 103 | $_GET['q'] = $q; 104 | } 105 | } 106 | // Boring old block. 107 | else if ($view = views_get_view('book_current')) { 108 | $data = array(); 109 | $view->execute_display('default', array($type)); 110 | if (is_array($view->result) && count($view->result)) { 111 | foreach($view->result as $row) { 112 | $data = array_merge($data, menu_tree_page_data(book_menu_name($row->nid))); 113 | } 114 | } 115 | if ($output = menu_tree_output($data)) { 116 | $title = l(t('Notebook'), 'notebook', array('attributes' => array('class' => 'depth-0'))); 117 | $block = array( 118 | 'subject' => $title, 119 | 'content' => $output, 120 | ); 121 | } 122 | } 123 | return isset($block) ? $block : NULL; 124 | } -------------------------------------------------------------------------------- /atrium_book/atrium_book.context.inc: -------------------------------------------------------------------------------- 1 | disabled = FALSE; /* Edit this to true to make a default context disabled initially */ 11 | $context->api_version = 3; 12 | $context->name = 'book_casetracker'; 13 | $context->description = ''; 14 | $context->tag = 'Casetracker'; 15 | $context->conditions = array( 16 | 'bookroot' => array( 17 | 'values' => array( 18 | 'casetracker_basic_project' => 'casetracker_basic_project', 19 | ), 20 | 'options' => array( 21 | 'node_form' => 1, 22 | ), 23 | ), 24 | ); 25 | $context->reactions = array( 26 | 'block' => array( 27 | 'blocks' => array( 28 | 'diff-inline' => array( 29 | 'module' => 'diff', 30 | 'delta' => 'inline', 31 | 'region' => 'right', 32 | 'weight' => 0, 33 | ), 34 | 'atrium_book-book' => array( 35 | 'module' => 'atrium_book', 36 | 'delta' => 'book', 37 | 'region' => 'right', 38 | 'weight' => 1, 39 | ), 40 | ), 41 | ), 42 | 'menu' => 'casetracker', 43 | ); 44 | $context->condition_mode = 0; 45 | 46 | // Translatables 47 | // Included for use with string extractors like potx. 48 | t('Casetracker'); 49 | $export['book_casetracker'] = $context; 50 | 51 | $context = new stdClass; 52 | $context->disabled = FALSE; /* Edit this to true to make a default context disabled initially */ 53 | $context->api_version = 3; 54 | $context->name = 'book_listing'; 55 | $context->description = ''; 56 | $context->tag = 'Book'; 57 | $context->conditions = array( 58 | 'bookroot' => array( 59 | 'values' => array( 60 | 'book' => 'book', 61 | ), 62 | 'options' => array( 63 | 'node_form' => 1, 64 | ), 65 | ), 66 | 'views' => array( 67 | 'values' => array( 68 | 'book_listing' => 'book_listing', 69 | ), 70 | ), 71 | ); 72 | $context->reactions = array( 73 | 'block' => array( 74 | 'blocks' => array( 75 | 'diff-inline' => array( 76 | 'module' => 'diff', 77 | 'delta' => 'inline', 78 | 'region' => 'right', 79 | 'weight' => 0, 80 | ), 81 | 'atrium_book-book_all' => array( 82 | 'module' => 'atrium_book', 83 | 'delta' => 'book_all', 84 | 'region' => 'right', 85 | 'weight' => 1, 86 | ), 87 | ), 88 | ), 89 | 'menu' => 'notebook', 90 | ); 91 | $context->condition_mode = 0; 92 | 93 | // Translatables 94 | // Included for use with string extractors like potx. 95 | t('Book'); 96 | $export['book_listing'] = $context; 97 | 98 | return $export; 99 | } 100 | -------------------------------------------------------------------------------- /atrium_book/atrium_book.features.inc: -------------------------------------------------------------------------------- 1 | 3); 10 | } 11 | elseif ($module == "strongarm" && $api == "strongarm") { 12 | return array("version" => 1); 13 | } 14 | } 15 | 16 | /** 17 | * Implementation of hook_node_info(). 18 | */ 19 | function atrium_book_node_info() { 20 | $items = array( 21 | 'book' => array( 22 | 'name' => t('Book page'), 23 | 'module' => 'features', 24 | 'description' => t('A book page is a page of content, organized into a collection of related entries collectively known as a book. A book page automatically displays links to adjacent pages, providing a simple navigation system for organizing and reviewing structured content.'), 25 | 'has_title' => '1', 26 | 'title_label' => t('Title'), 27 | 'has_body' => '1', 28 | 'body_label' => t('Body'), 29 | 'min_word_count' => '0', 30 | 'help' => '', 31 | ), 32 | ); 33 | return $items; 34 | } 35 | 36 | /** 37 | * Implementation of hook_views_api(). 38 | */ 39 | function atrium_book_views_api() { 40 | return array( 41 | 'api' => '2', 42 | ); 43 | } 44 | -------------------------------------------------------------------------------- /atrium_book/atrium_book.features.user_permission.inc: -------------------------------------------------------------------------------- 1 | 'add content to books', 12 | 'roles' => array( 13 | '0' => 'administrator', 14 | '1' => 'authenticated user', 15 | '2' => 'manager', 16 | ), 17 | ); 18 | 19 | // Exported permission: administer book outlines 20 | $permissions['administer book outlines'] = array( 21 | 'name' => 'administer book outlines', 22 | 'roles' => array( 23 | '0' => 'administrator', 24 | ), 25 | ); 26 | 27 | // Exported permission: create book content 28 | $permissions['create book content'] = array( 29 | 'name' => 'create book content', 30 | 'roles' => array( 31 | '0' => 'administrator', 32 | '1' => 'authenticated user', 33 | '2' => 'manager', 34 | ), 35 | ); 36 | 37 | // Exported permission: create new books 38 | $permissions['create new books'] = array( 39 | 'name' => 'create new books', 40 | 'roles' => array( 41 | '0' => 'administrator', 42 | '1' => 'authenticated user', 43 | '2' => 'manager', 44 | ), 45 | ); 46 | 47 | // Exported permission: delete any book content 48 | $permissions['delete any book content'] = array( 49 | 'name' => 'delete any book content', 50 | 'roles' => array( 51 | '0' => 'administrator', 52 | '1' => 'manager', 53 | ), 54 | ); 55 | 56 | // Exported permission: delete own book content 57 | $permissions['delete own book content'] = array( 58 | 'name' => 'delete own book content', 59 | 'roles' => array( 60 | '0' => 'administrator', 61 | '1' => 'authenticated user', 62 | '2' => 'manager', 63 | ), 64 | ); 65 | 66 | // Exported permission: edit any book content 67 | $permissions['edit any book content'] = array( 68 | 'name' => 'edit any book content', 69 | 'roles' => array( 70 | '0' => 'administrator', 71 | '1' => 'authenticated user', 72 | '2' => 'manager', 73 | ), 74 | ); 75 | 76 | return $permissions; 77 | } 78 | -------------------------------------------------------------------------------- /atrium_book/atrium_book.info: -------------------------------------------------------------------------------- 1 | name = "Atrium Notebook" 2 | description = "The notebook feature lets you store and share information and attachments." 3 | core = "6.x" 4 | package = "Features" 5 | dependencies[] = "atrium_activity" 6 | dependencies[] = "book" 7 | dependencies[] = "comment" 8 | dependencies[] = "context" 9 | dependencies[] = "diff" 10 | dependencies[] = "features" 11 | dependencies[] = "spaces" 12 | dependencies[] = "strongarm" 13 | dependencies[] = "views" 14 | features[context][] = "book_casetracker" 15 | features[context][] = "book_listing" 16 | features[ctools][] = "context:context:3" 17 | features[ctools][] = "strongarm:strongarm:1" 18 | features[node][] = "book" 19 | features[user_permission][] = "add content to books" 20 | features[user_permission][] = "administer book outlines" 21 | features[user_permission][] = "create book content" 22 | features[user_permission][] = "create new books" 23 | features[user_permission][] = "delete any book content" 24 | features[user_permission][] = "delete own book content" 25 | features[user_permission][] = "edit any book content" 26 | features[variable][] = "atrium_activity_update_type_book" 27 | features[variable][] = "atrium_archivable_book" 28 | features[variable][] = "book_allowed_types" 29 | features[variable][] = "comment_anonymous_book" 30 | features[variable][] = "comment_book" 31 | features[variable][] = "comment_controls_book" 32 | features[variable][] = "comment_default_mode_book" 33 | features[variable][] = "comment_default_order_book" 34 | features[variable][] = "comment_default_per_page_book" 35 | features[variable][] = "comment_form_location_book" 36 | features[variable][] = "comment_preview_book" 37 | features[variable][] = "comment_subject_field_book" 38 | features[variable][] = "node_options_book" 39 | features[variable][] = "nodeformscols_field_placements_book_default" 40 | features[variable][] = "notifications_content_type_book" 41 | features[variable][] = "og_content_type_usage_book" 42 | features[variable][] = "show_diff_inline_book" 43 | features[variable][] = "show_preview_changes_book" 44 | features[variable][] = "upload_book" 45 | features[views][] = "book_current" 46 | features[views][] = "book_listing" 47 | features[views_api][] = "api:2" 48 | kitf = "1.0-draft" 49 | spaces[types][] = "og" 50 | -------------------------------------------------------------------------------- /atrium_book/atrium_book.install: -------------------------------------------------------------------------------- 1 | array( 9 | 'atrium_book' => array( 10 | 'book_listing' => array( 11 | // No blocks. 12 | ), 13 | ), 14 | ), 15 | 'blocks' => array( 16 | 'atrium' => array( 17 | 'atrium_book' => array( 18 | 'book' => array( 19 | 'module' => 'atrium_book', 20 | 'delta' => 'book', 21 | ), 22 | 'book_all' => array( 23 | 'module' => 'atrium_book', 24 | 'delta' => 'book_all', 25 | ), 26 | ), 27 | ), 28 | ), 29 | 'contexts' => array( 30 | 'spaces-feature-book' => 'book_listing', 31 | ), 32 | ); 33 | 34 | module_load_include('inc', 'atrium', 'includes/atrium_update_kit'); 35 | atrium_kit_comply_presets($components); 36 | atrium_kit_comply_overrides($components); 37 | atrium_kit_comply_contexts($components); 38 | 39 | atrium_kit_comply_presets($components, 'blocks'); 40 | atrium_kit_comply_overrides($components, 'blocks'); 41 | atrium_kit_comply_contexts($components, 'blocks'); 42 | 43 | return array(array('success' => true, 'query' => 'Atrium Notebook updated for Kit compliance.')); 44 | } -------------------------------------------------------------------------------- /atrium_book/atrium_book.js: -------------------------------------------------------------------------------- 1 | Drupal.behaviors.atrium = function(context) { 2 | // Add drill-down functionality to atrium book blocks. 3 | if (jQuery().drilldown) { 4 | $('div.page-region div.block-atrium_book:has(ul.menu):not(.atrium_book-processed)') 5 | .addClass('atrium_book-processed') 6 | .each(function() { 7 | $(this).addClass('drilldown'); 8 | var menu = $(this); 9 | var trail = '#' + $(this).attr('id') + ' span.trail'; 10 | $('ul.menu:first', this).parent().drilldown('init', {'activePath': Drupal.settings.atriumBookPath, 'trail': trail}); 11 | }); 12 | } 13 | } -------------------------------------------------------------------------------- /atrium_book/atrium_book.pages.inc: -------------------------------------------------------------------------------- 1 | nid}"); 13 | return node_view($node, FALSE, TRUE, TRUE); 14 | } 15 | return views_embed_view('book_listing', 'page_1'); 16 | } 17 | 18 | /** 19 | * Settings form for book feature. 20 | */ 21 | function atrium_book_settings() { 22 | $form = array(); 23 | $form['atrium_book_mode'] = array( 24 | '#title' => t('Navigation mode'), 25 | '#type' => 'select', 26 | '#description' => t('Choose the navigation style for the book menu.'), 27 | '#options' => array( 28 | 'tree' => t('Tree menu'), 29 | 'ajax' => t('AJAX with breadcrumb') 30 | ), 31 | '#default_value' => variable_get('atrium_book_mode', 'ajax'), 32 | ); 33 | $form['atrium_book'] = array( 34 | '#title' => t('Overview page'), 35 | '#type' => 'select', 36 | '#description' => t('Choose the page to display when a user first views this feature.'), 37 | '#options' => array(0 => t('Recent updates'), t('Pages') => array()), 38 | '#default_value' => variable_get('atrium_book', 0), 39 | ); 40 | 41 | // Collect books in this space into an array 42 | if ($view = views_get_view('book_current')) { 43 | $view->set_display(); 44 | $view->set_items_per_page(0); 45 | $view->execute(); 46 | if (is_array($view->result) && count($view->result)) { 47 | foreach($view->result as $row) { 48 | $form['atrium_book']['#options'][t('Pages')][$row->nid] = $row->node_title; 49 | } 50 | } 51 | } 52 | 53 | return system_settings_form($form); 54 | } 55 | -------------------------------------------------------------------------------- /atrium_book/atrium_book.views.inc: -------------------------------------------------------------------------------- 1 | array( 9 | 'path' => drupal_get_path('module', 'atrium_book') .'/includes', 10 | ), 11 | 'handlers' => array( 12 | 'atrium_book_handler_filter_book_types' => array( 13 | 'parent' => 'views_handler_filter', 14 | ), 15 | ), 16 | ); 17 | } 18 | 19 | /** 20 | * Implementation of hook_views_data_alter(). 21 | */ 22 | function atrium_book_views_data_alter(&$cache) { 23 | // Book enabled type filter 24 | $cache['node']['book_type'] = array( 25 | 'real field' => 'type', 26 | 'title' => t('Book-enabled types'), 27 | 'help' => t('Affects only book-enabled content types.'), 28 | 'filter' => array( 29 | 'handler' => 'atrium_book_handler_filter_book_types', 30 | ), 31 | ); 32 | } -------------------------------------------------------------------------------- /atrium_book/includes/atrium_book_handler_filter_book_types.inc: -------------------------------------------------------------------------------- 1 | ensure_my_table(); 15 | $placeholder = "'%s'"; 16 | $replace = array_fill(0, sizeof($types), $placeholder); 17 | $in = ' (' . implode(", ", $replace) . ')'; 18 | 19 | // We use array_values() because the checkboxes keep keys and that can cause 20 | // array addition problems. 21 | $this->query->add_where($this->options['group'], "$this->table_alias.$this->real_field IN {$in}", array_values($types)); 22 | } 23 | } -------------------------------------------------------------------------------- /atrium_calendar/atrium_calendar.context.inc: -------------------------------------------------------------------------------- 1 | disabled = FALSE; /* Edit this to true to make a default context disabled initially */ 11 | $context->api_version = 3; 12 | $context->name = 'calendar_calendar'; 13 | $context->description = ''; 14 | $context->tag = 'Calendar'; 15 | $context->conditions = array( 16 | 'node' => array( 17 | 'values' => array( 18 | 'event' => 'event', 19 | 'feed_ical' => 'feed_ical', 20 | 'feed_ical_item' => 'feed_ical_item', 21 | ), 22 | 'options' => array( 23 | 'node_form' => '1', 24 | ), 25 | ), 26 | 'views' => array( 27 | 'values' => array( 28 | 'calendar_feed_items' => 'calendar_feed_items', 29 | 'calendar_feeds' => 'calendar_feeds', 30 | 'calendar_listing' => 'calendar_listing', 31 | 'calendar_upcoming' => 'calendar_upcoming', 32 | ), 33 | ), 34 | ); 35 | $context->reactions = array( 36 | 'block' => array( 37 | 'blocks' => array( 38 | 'atrium_calendar-filters' => array( 39 | 'module' => 'atrium_calendar', 40 | 'delta' => 'filters', 41 | 'region' => 'right', 42 | 'weight' => 0, 43 | ), 44 | 'views-calendar_upcoming-block_1' => array( 45 | 'module' => 'views', 46 | 'delta' => 'calendar_upcoming-block_1', 47 | 'region' => 'right', 48 | 'weight' => 1, 49 | ), 50 | ), 51 | ), 52 | 'menu' => 'calendar', 53 | ); 54 | $context->condition_mode = 0; 55 | 56 | // Translatables 57 | // Included for use with string extractors like potx. 58 | t('Calendar'); 59 | $export['calendar_calendar'] = $context; 60 | 61 | $context = new stdClass; 62 | $context->disabled = FALSE; /* Edit this to true to make a default context disabled initially */ 63 | $context->api_version = 3; 64 | $context->name = 'calendar_event'; 65 | $context->description = ''; 66 | $context->tag = 'Calendar'; 67 | $context->conditions = array( 68 | 'node' => array( 69 | 'values' => array( 70 | 'event' => 'event', 71 | ), 72 | 'options' => array( 73 | 'node_form' => 0, 74 | ), 75 | ), 76 | ); 77 | $context->reactions = array( 78 | 'block' => array( 79 | 'blocks' => array( 80 | 'atrium_calendar-mini' => array( 81 | 'module' => 'atrium_calendar', 82 | 'delta' => 'mini', 83 | 'region' => 'right', 84 | 'weight' => 0, 85 | ), 86 | ), 87 | ), 88 | ); 89 | $context->condition_mode = 0; 90 | 91 | // Translatables 92 | // Included for use with string extractors like potx. 93 | t('Calendar'); 94 | $export['calendar_event'] = $context; 95 | 96 | return $export; 97 | } 98 | -------------------------------------------------------------------------------- /atrium_calendar/atrium_calendar.css: -------------------------------------------------------------------------------- 1 | /* $Id */ 2 | 3 | .atrium_calendar_event_type div{ 4 | float:left; 5 | line-height:15px; 6 | margin:0 5px 5px 0; 7 | -moz-border-radius: 5px; 8 | -webkit-border-radius: 5px; 9 | border-radius: 5px 5px; 10 | 11 | } 12 | .atrium_calendar_event_type span { 13 | background:transparent url(images/checked.gif) no-repeat scroll 2px 0%; 14 | color:#ffffff; 15 | cursor:pointer; 16 | float:left; 17 | line-height:15px; 18 | padding: 5px 5px 5px 20px; 19 | white-space:nowrap; 20 | } 21 | 22 | 23 | .atrium_calendar_event_type span.deactive { 24 | background:transparent url(images/checked.gif) no-repeat scroll 2px 100%; 25 | color:#666666; 26 | } 27 | -------------------------------------------------------------------------------- /atrium_calendar/atrium_calendar.features.content.inc: -------------------------------------------------------------------------------- 1 | 'field_date', 12 | 'type_name' => 'event', 13 | 'display_settings' => array( 14 | 'weight' => '-3', 15 | 'parent' => '', 16 | 'label' => array( 17 | 'format' => 'inline', 18 | ), 19 | 'teaser' => array( 20 | 'format' => 'long', 21 | 'exclude' => 0, 22 | ), 23 | 'full' => array( 24 | 'format' => 'long', 25 | 'exclude' => 0, 26 | ), 27 | ), 28 | 'widget_active' => '1', 29 | 'type' => 'date', 30 | 'required' => '1', 31 | 'multiple' => '0', 32 | 'module' => 'date', 33 | 'active' => '1', 34 | 'granularity' => array( 35 | 'year' => 'year', 36 | 'month' => 'month', 37 | 'day' => 'day', 38 | 'hour' => 'hour', 39 | 'minute' => 'minute', 40 | ), 41 | 'timezone_db' => '', 42 | 'tz_handling' => 'none', 43 | 'todate' => 'optional', 44 | 'repeat' => 0, 45 | 'repeat_collapsed' => '', 46 | 'default_format' => 'long', 47 | 'widget' => array( 48 | 'default_value' => 'blank', 49 | 'default_value_code' => '', 50 | 'default_value2' => 'same', 51 | 'default_value_code2' => '', 52 | 'input_format' => 'm/d/Y - g:ia', 53 | 'input_format_custom' => '', 54 | 'increment' => '1', 55 | 'text_parts' => array(), 56 | 'year_range' => '-3:+3', 57 | 'label_position' => 'above', 58 | 'default_value_custom' => '', 59 | 'default_value_custom2' => '', 60 | 'label' => 'Date', 61 | 'weight' => '-3', 62 | 'description' => '', 63 | 'type' => 'date_popup', 64 | 'module' => 'date', 65 | ), 66 | ); 67 | 68 | // Exported field: field_date 69 | $fields['feed_ical_item-field_date'] = array( 70 | 'field_name' => 'field_date', 71 | 'type_name' => 'feed_ical_item', 72 | 'display_settings' => array( 73 | 'weight' => '-3', 74 | 'parent' => '', 75 | 'label' => array( 76 | 'format' => 'inline', 77 | ), 78 | 'teaser' => array( 79 | 'format' => 'default', 80 | 'exclude' => 0, 81 | ), 82 | 'full' => array( 83 | 'format' => 'default', 84 | 'exclude' => 0, 85 | ), 86 | ), 87 | 'widget_active' => '1', 88 | 'type' => 'date', 89 | 'required' => '1', 90 | 'multiple' => '0', 91 | 'module' => 'date', 92 | 'active' => '1', 93 | 'granularity' => array( 94 | 'year' => 'year', 95 | 'month' => 'month', 96 | 'day' => 'day', 97 | 'hour' => 'hour', 98 | 'minute' => 'minute', 99 | ), 100 | 'timezone_db' => '', 101 | 'tz_handling' => 'none', 102 | 'todate' => 'optional', 103 | 'repeat' => 0, 104 | 'repeat_collapsed' => '', 105 | 'default_format' => 'long', 106 | 'widget' => array( 107 | 'default_value' => 'now', 108 | 'default_value_code' => '', 109 | 'default_value2' => 'same', 110 | 'default_value_code2' => '', 111 | 'input_format' => 'Y-m-d H:i:s', 112 | 'input_format_custom' => '', 113 | 'increment' => 1, 114 | 'text_parts' => array(), 115 | 'year_range' => '-3:+3', 116 | 'label_position' => 'above', 117 | 'default_value_custom' => '', 118 | 'default_value_custom2' => '', 119 | 'label' => 'Date', 120 | 'weight' => '-3', 121 | 'description' => '', 122 | 'type' => 'date_text', 123 | 'module' => 'date', 124 | ), 125 | ); 126 | 127 | // Translatables 128 | // Included for use with string extractors like potx. 129 | t('Date'); 130 | 131 | return $fields; 132 | } 133 | -------------------------------------------------------------------------------- /atrium_calendar/atrium_calendar.features.inc: -------------------------------------------------------------------------------- 1 | 3); 10 | } 11 | elseif ($module == "feeds" && $api == "feeds_importer_default") { 12 | return array("version" => 1); 13 | } 14 | elseif ($module == "strongarm" && $api == "strongarm") { 15 | return array("version" => 1); 16 | } 17 | } 18 | 19 | /** 20 | * Implementation of hook_node_info(). 21 | */ 22 | function atrium_calendar_node_info() { 23 | $items = array( 24 | 'event' => array( 25 | 'name' => t('Event'), 26 | 'module' => 'features', 27 | 'description' => t('A calendar event with start and optional end times.'), 28 | 'has_title' => '1', 29 | 'title_label' => t('Title'), 30 | 'has_body' => '1', 31 | 'body_label' => t('Body'), 32 | 'min_word_count' => '0', 33 | 'help' => '', 34 | ), 35 | 'feed_ical' => array( 36 | 'name' => t('iCal Feed'), 37 | 'module' => 'features', 38 | 'description' => t('A feed used to aggregate events from external iCal calendars.'), 39 | 'has_title' => '1', 40 | 'title_label' => t('Title'), 41 | 'has_body' => '0', 42 | 'body_label' => '', 43 | 'min_word_count' => '0', 44 | 'help' => '', 45 | ), 46 | 'feed_ical_item' => array( 47 | 'name' => t('iCal Event'), 48 | 'module' => 'features', 49 | 'description' => t('An event aggregated from an external iCal feed.'), 50 | 'has_title' => '1', 51 | 'title_label' => t('Title'), 52 | 'has_body' => '1', 53 | 'body_label' => t('Body'), 54 | 'min_word_count' => '0', 55 | 'help' => '', 56 | ), 57 | ); 58 | return $items; 59 | } 60 | 61 | /** 62 | * Implementation of hook_views_api(). 63 | */ 64 | function atrium_calendar_views_api() { 65 | return array( 66 | 'api' => '2', 67 | ); 68 | } 69 | -------------------------------------------------------------------------------- /atrium_calendar/atrium_calendar.features.user_permission.inc: -------------------------------------------------------------------------------- 1 | 'create event content', 12 | 'roles' => array( 13 | '0' => 'administrator', 14 | '1' => 'authenticated user', 15 | '2' => 'manager', 16 | ), 17 | ); 18 | 19 | // Exported permission: create feed_ical content 20 | $permissions['create feed_ical content'] = array( 21 | 'name' => 'create feed_ical content', 22 | 'roles' => array( 23 | '0' => 'administrator', 24 | '1' => 'manager', 25 | ), 26 | ); 27 | 28 | // Exported permission: create feed_ical_item content 29 | $permissions['create feed_ical_item content'] = array( 30 | 'name' => 'create feed_ical_item content', 31 | 'roles' => array(), 32 | ); 33 | 34 | // Exported permission: delete any feed_ical content 35 | $permissions['delete any feed_ical content'] = array( 36 | 'name' => 'delete any feed_ical content', 37 | 'roles' => array( 38 | '0' => 'administrator', 39 | '1' => 'manager', 40 | ), 41 | ); 42 | 43 | // Exported permission: delete any feed_ical_item content 44 | $permissions['delete any feed_ical_item content'] = array( 45 | 'name' => 'delete any feed_ical_item content', 46 | 'roles' => array( 47 | '0' => 'administrator', 48 | '1' => 'manager', 49 | ), 50 | ); 51 | 52 | // Exported permission: delete own event content 53 | $permissions['delete own event content'] = array( 54 | 'name' => 'delete own event content', 55 | 'roles' => array( 56 | '0' => 'administrator', 57 | '1' => 'authenticated user', 58 | '2' => 'manager', 59 | ), 60 | ); 61 | 62 | // Exported permission: edit any feed_ical content 63 | $permissions['edit any feed_ical content'] = array( 64 | 'name' => 'edit any feed_ical content', 65 | 'roles' => array( 66 | '0' => 'administrator', 67 | '1' => 'manager', 68 | ), 69 | ); 70 | 71 | // Exported permission: edit any feed_ical_item content 72 | $permissions['edit any feed_ical_item content'] = array( 73 | 'name' => 'edit any feed_ical_item content', 74 | 'roles' => array( 75 | '0' => 'administrator', 76 | '1' => 'manager', 77 | ), 78 | ); 79 | 80 | // Exported permission: edit own event content 81 | $permissions['edit own event content'] = array( 82 | 'name' => 'edit own event content', 83 | 'roles' => array( 84 | '0' => 'administrator', 85 | '1' => 'authenticated user', 86 | '2' => 'manager', 87 | ), 88 | ); 89 | 90 | return $permissions; 91 | } 92 | -------------------------------------------------------------------------------- /atrium_calendar/atrium_calendar.feeds_importer_default.inc: -------------------------------------------------------------------------------- 1 | disabled = FALSE; /* Edit this to true to make a default feeds_importer disabled initially */ 11 | $feeds_importer->api_version = 1; 12 | $feeds_importer->id = 'atrium_calendar_ical_feed'; 13 | $feeds_importer->config = array( 14 | 'name' => 'iCal feed', 15 | 'description' => 'Importer for iCal feeds.', 16 | 'fetcher' => array( 17 | 'plugin_key' => 'FeedsHTTPFetcher', 18 | 'config' => array( 19 | 'auto_detect_feeds' => FALSE, 20 | ), 21 | ), 22 | 'parser' => array( 23 | 'plugin_key' => 'ParserIcalFeedsParser', 24 | 'config' => array(), 25 | ), 26 | 'processor' => array( 27 | 'plugin_key' => 'FeedsNodeProcessor', 28 | 'config' => array( 29 | 'content_type' => 'feed_ical_item', 30 | 'update_existing' => 1, 31 | 'expire' => '-1', 32 | 'mappings' => array( 33 | 0 => array( 34 | 'source' => 'ical_date', 35 | 'target' => 'field_date:start', 36 | 'unique' => FALSE, 37 | ), 38 | 1 => array( 39 | 'source' => 'ical_date', 40 | 'target' => 'field_date:end', 41 | 'unique' => FALSE, 42 | ), 43 | 2 => array( 44 | 'source' => 'title', 45 | 'target' => 'title', 46 | 'unique' => FALSE, 47 | ), 48 | 3 => array( 49 | 'source' => 'description', 50 | 'target' => 'body', 51 | 'unique' => FALSE, 52 | ), 53 | 4 => array( 54 | 'source' => 'timestamp', 55 | 'target' => 'created', 56 | 'unique' => FALSE, 57 | ), 58 | ), 59 | ), 60 | ), 61 | 'content_type' => 'feed_ical', 62 | 'update' => 0, 63 | 'import_period' => '1800', 64 | 'expire_period' => 3600, 65 | 'import_on_create' => 1, 66 | ); 67 | $export['atrium_calendar_ical_feed'] = $feeds_importer; 68 | 69 | return $export; 70 | } 71 | -------------------------------------------------------------------------------- /atrium_calendar/atrium_calendar.info: -------------------------------------------------------------------------------- 1 | name = "Atrium Calendar" 2 | description = "The calendar lets you share events and meetings with your team." 3 | core = "6.x" 4 | package = "Features" 5 | dependencies[] = "context" 6 | dependencies[] = "date" 7 | dependencies[] = "date_popup" 8 | dependencies[] = "features" 9 | dependencies[] = "feeds" 10 | dependencies[] = "jquery_ui" 11 | dependencies[] = "litecal" 12 | dependencies[] = "parser_ical" 13 | dependencies[] = "spaces" 14 | dependencies[] = "strongarm" 15 | dependencies[] = "taxonomy" 16 | dependencies[] = "views" 17 | features[content][] = "event-field_date" 18 | features[content][] = "feed_ical_item-field_date" 19 | features[context][] = "calendar_calendar" 20 | features[context][] = "calendar_event" 21 | features[ctools][] = "context:context:3" 22 | features[ctools][] = "feeds:feeds_importer_default:1" 23 | features[ctools][] = "strongarm:strongarm:1" 24 | features[feeds_importer][] = "atrium_calendar_ical_feed" 25 | features[node][] = "event" 26 | features[node][] = "feed_ical" 27 | features[node][] = "feed_ical_item" 28 | features[user_permission][] = "create event content" 29 | features[user_permission][] = "create feed_ical content" 30 | features[user_permission][] = "create feed_ical_item content" 31 | features[user_permission][] = "delete any feed_ical content" 32 | features[user_permission][] = "delete any feed_ical_item content" 33 | features[user_permission][] = "delete own event content" 34 | features[user_permission][] = "edit any feed_ical content" 35 | features[user_permission][] = "edit any feed_ical_item content" 36 | features[user_permission][] = "edit own event content" 37 | features[variable][] = "atrium_activity_update_type_event" 38 | features[variable][] = "atrium_activity_update_type_feed_ical" 39 | features[variable][] = "atrium_activity_update_type_feed_ical_item" 40 | features[variable][] = "comment_anonymous_event" 41 | features[variable][] = "comment_controls_event" 42 | features[variable][] = "comment_default_mode_event" 43 | features[variable][] = "comment_default_order_event" 44 | features[variable][] = "comment_default_per_page_event" 45 | features[variable][] = "comment_event" 46 | features[variable][] = "comment_feed_ical" 47 | features[variable][] = "comment_feed_ical_item" 48 | features[variable][] = "comment_form_location_event" 49 | features[variable][] = "comment_preview_event" 50 | features[variable][] = "comment_subject_field_event" 51 | features[variable][] = "content_extra_weights_event" 52 | features[variable][] = "node_options_event" 53 | features[variable][] = "node_options_feed_ical" 54 | features[variable][] = "node_options_feed_ical_item" 55 | features[variable][] = "nodeformscols_field_placements_event_default" 56 | features[variable][] = "nodeformscols_field_placements_feed_ical_default" 57 | features[variable][] = "nodeformscols_field_placements_feed_ical_item_default" 58 | features[variable][] = "notifications_content_type_event" 59 | features[variable][] = "notifications_content_type_feed_ical" 60 | features[variable][] = "notifications_content_type_feed_ical_item" 61 | features[variable][] = "og_content_type_usage_event" 62 | features[variable][] = "og_content_type_usage_feed_ical" 63 | features[variable][] = "og_content_type_usage_feed_ical_item" 64 | features[variable][] = "show_diff_inline_event" 65 | features[variable][] = "show_diff_inline_feed_ical" 66 | features[variable][] = "show_diff_inline_feed_ical_item" 67 | features[variable][] = "show_preview_changes_event" 68 | features[variable][] = "show_preview_changes_feed_ical" 69 | features[variable][] = "show_preview_changes_feed_ical_item" 70 | features[variable][] = "upload_event" 71 | features[variable][] = "upload_feed_ical" 72 | features[variable][] = "upload_feed_ical_item" 73 | features[views][] = "calendar_feed_items" 74 | features[views][] = "calendar_feeds" 75 | features[views][] = "calendar_listing" 76 | features[views][] = "calendar_upcoming" 77 | features[views_api][] = "api:2" 78 | kitf = "1.0-draft" 79 | spaces[types][] = "og" 80 | -------------------------------------------------------------------------------- /atrium_calendar/atrium_calendar.js: -------------------------------------------------------------------------------- 1 | if (Drupal.jsEnabled) { 2 | $(document).ready(function() { 3 | $("div.atrium_calendar_event_type div.tid-options").toggle(); 4 | $("#edit-tid").toggle(); 5 | if ( $('#edit-tid').size() > 0 ) { 6 | atrium_calendar_event_type_init(); 7 | } 8 | }); 9 | } 10 | 11 | function atrium_calendar_event_type_init () { 12 | // Add "selected" class to selected terms 13 | var active = $('#edit-tid').val(); 14 | if (active){ 15 | for(var i=0; idisabled = FALSE; /* Edit this to true to make a default context disabled initially */ 11 | $context->api_version = 3; 12 | $context->name = 'casetracker_listing'; 13 | $context->description = ''; 14 | $context->tag = 'Casetracker'; 15 | $context->conditions = array( 16 | 'node' => array( 17 | 'values' => array( 18 | 'casetracker_basic_case' => 'casetracker_basic_case', 19 | 'casetracker_basic_project' => 'casetracker_basic_project', 20 | ), 21 | 'options' => array( 22 | 'node_form' => 1, 23 | ), 24 | ), 25 | 'views' => array( 26 | 'values' => array( 27 | 'casetracker_cases' => 'casetracker_cases', 28 | 'casetracker_projects' => 'casetracker_projects', 29 | ), 30 | ), 31 | ); 32 | $context->reactions = array( 33 | 'block' => array( 34 | 'blocks' => array( 35 | 'atrium_casetracker-filters' => array( 36 | 'module' => 'atrium_casetracker', 37 | 'delta' => 'filters', 38 | 'region' => 'right', 39 | 'weight' => 2, 40 | ), 41 | 'views-casetracker_cases-block_2' => array( 42 | 'module' => 'views', 43 | 'delta' => 'casetracker_cases-block_2', 44 | 'region' => 'right', 45 | 'weight' => 3, 46 | ), 47 | 'views-casetracker_projects-block_1' => array( 48 | 'module' => 'views', 49 | 'delta' => 'casetracker_projects-block_1', 50 | 'region' => 'page_tools', 51 | 'weight' => 0, 52 | ), 53 | ), 54 | ), 55 | 'menu' => 'casetracker', 56 | ); 57 | $context->condition_mode = 0; 58 | 59 | // Translatables 60 | // Included for use with string extractors like potx. 61 | t('Casetracker'); 62 | $export['casetracker_listing'] = $context; 63 | 64 | $context = new stdClass; 65 | $context->disabled = FALSE; /* Edit this to true to make a default context disabled initially */ 66 | $context->api_version = 3; 67 | $context->name = 'casetracker_project'; 68 | $context->description = ''; 69 | $context->tag = 'Casetracker'; 70 | $context->conditions = array( 71 | 'node' => array( 72 | 'values' => array( 73 | 'casetracker_basic_project' => 'casetracker_basic_project', 74 | ), 75 | 'options' => array( 76 | 'node_form' => 0, 77 | ), 78 | ), 79 | ); 80 | $context->reactions = array( 81 | 'block' => array( 82 | 'blocks' => array( 83 | 'views-casetracker_cases-block_1' => array( 84 | 'module' => 'views', 85 | 'delta' => 'casetracker_cases-block_1', 86 | 'region' => 'content', 87 | 'weight' => 0, 88 | ), 89 | ), 90 | ), 91 | ); 92 | $context->condition_mode = 0; 93 | 94 | // Translatables 95 | // Included for use with string extractors like potx. 96 | t('Casetracker'); 97 | $export['casetracker_project'] = $context; 98 | 99 | return $export; 100 | } 101 | -------------------------------------------------------------------------------- /atrium_casetracker/atrium_casetracker.css: -------------------------------------------------------------------------------- 1 | div.atrium-case-summary { 2 | padding:10px 0px; 3 | } 4 | 5 | div.atrium-case-summary div.primary { 6 | float:left; 7 | width:35%; 8 | } 9 | 10 | div.atrium-case-summary div.primary div.status { 11 | font-size:18px; 12 | font-weight:bold; 13 | } 14 | 15 | div.atrium-case-summary label { 16 | font-size:11px; 17 | float:left; 18 | width:100px; 19 | } -------------------------------------------------------------------------------- /atrium_casetracker/atrium_casetracker.features.content.inc: -------------------------------------------------------------------------------- 1 | 'field_due_date', 12 | 'type_name' => 'casetracker_basic_case', 13 | 'display_settings' => array( 14 | 'weight' => '-3', 15 | 'parent' => '', 16 | 'label' => array( 17 | 'format' => 'above', 18 | ), 19 | 'teaser' => array( 20 | 'format' => 'default', 21 | 'exclude' => 1, 22 | ), 23 | 'full' => array( 24 | 'format' => 'default', 25 | 'exclude' => 1, 26 | ), 27 | '5' => array( 28 | 'format' => 'default', 29 | 'exclude' => 0, 30 | ), 31 | '4' => array( 32 | 'format' => 'default', 33 | 'exclude' => 0, 34 | ), 35 | '2' => array( 36 | 'format' => 'default', 37 | 'exclude' => 0, 38 | ), 39 | '3' => array( 40 | 'format' => 'default', 41 | 'exclude' => 0, 42 | ), 43 | 'token' => array( 44 | 'format' => 'default', 45 | 'exclude' => 0, 46 | ), 47 | ), 48 | 'widget_active' => '1', 49 | 'type' => 'date', 50 | 'required' => '0', 51 | 'multiple' => '0', 52 | 'module' => 'date', 53 | 'active' => '1', 54 | 'granularity' => array( 55 | 'year' => 'year', 56 | 'month' => 'month', 57 | 'day' => 'day', 58 | ), 59 | 'timezone_db' => '', 60 | 'tz_handling' => 'none', 61 | 'todate' => '', 62 | 'repeat' => 0, 63 | 'repeat_collapsed' => '', 64 | 'default_format' => 'medium', 65 | 'widget' => array( 66 | 'default_value' => 'strtotime', 67 | 'default_value_code' => '+5 days', 68 | 'default_value2' => 'blank', 69 | 'default_value_code2' => '', 70 | 'input_format' => 'm/d/Y', 71 | 'input_format_custom' => '', 72 | 'increment' => '5', 73 | 'text_parts' => array(), 74 | 'year_range' => '-3:+3', 75 | 'label_position' => 'above', 76 | 'label' => 'Due Date', 77 | 'weight' => '-3', 78 | 'description' => 'The due date for this case.', 79 | 'type' => 'date_popup', 80 | 'module' => 'date', 81 | ), 82 | ); 83 | 84 | // Translatables 85 | // Included for use with string extractors like potx. 86 | t('Due Date'); 87 | 88 | return $fields; 89 | } 90 | -------------------------------------------------------------------------------- /atrium_casetracker/atrium_casetracker.features.inc: -------------------------------------------------------------------------------- 1 | 3); 10 | } 11 | elseif ($module == "strongarm" && $api == "strongarm") { 12 | return array("version" => 1); 13 | } 14 | } 15 | 16 | /** 17 | * Implementation of hook_node_info(). 18 | */ 19 | function atrium_casetracker_node_info() { 20 | $items = array( 21 | 'casetracker_basic_case' => array( 22 | 'name' => t('Case'), 23 | 'module' => 'features', 24 | 'description' => '', 25 | 'has_title' => '1', 26 | 'title_label' => t('Title'), 27 | 'has_body' => '1', 28 | 'body_label' => t('Body'), 29 | 'min_word_count' => '0', 30 | 'help' => t('Open a new case assigned to a particular project.'), 31 | ), 32 | 'casetracker_basic_project' => array( 33 | 'name' => t('Project'), 34 | 'module' => 'features', 35 | 'description' => '', 36 | 'has_title' => '1', 37 | 'title_label' => t('Title'), 38 | 'has_body' => '1', 39 | 'body_label' => t('Body'), 40 | 'min_word_count' => '0', 41 | 'help' => t('Create a project for use with Case Tracker.'), 42 | ), 43 | ); 44 | return $items; 45 | } 46 | 47 | /** 48 | * Implementation of hook_views_api(). 49 | */ 50 | function atrium_casetracker_views_api() { 51 | return array( 52 | 'api' => '2', 53 | ); 54 | } 55 | -------------------------------------------------------------------------------- /atrium_casetracker/atrium_casetracker.features.user_permission.inc: -------------------------------------------------------------------------------- 1 | 'assign cases', 12 | 'roles' => array( 13 | '0' => 'administrator', 14 | '1' => 'authenticated user', 15 | '2' => 'manager', 16 | ), 17 | ); 18 | 19 | // Exported permission: create casetracker_basic_case content 20 | $permissions['create casetracker_basic_case content'] = array( 21 | 'name' => 'create casetracker_basic_case content', 22 | 'roles' => array( 23 | '0' => 'administrator', 24 | '1' => 'authenticated user', 25 | '2' => 'manager', 26 | ), 27 | ); 28 | 29 | // Exported permission: create casetracker_basic_project content 30 | $permissions['create casetracker_basic_project content'] = array( 31 | 'name' => 'create casetracker_basic_project content', 32 | 'roles' => array( 33 | '0' => 'administrator', 34 | '1' => 'manager', 35 | ), 36 | ); 37 | 38 | // Exported permission: edit own casetracker_basic_case content 39 | $permissions['edit own casetracker_basic_case content'] = array( 40 | 'name' => 'edit own casetracker_basic_case content', 41 | 'roles' => array( 42 | '0' => 'administrator', 43 | '1' => 'authenticated user', 44 | '2' => 'manager', 45 | ), 46 | ); 47 | 48 | // Exported permission: edit own casetracker_basic_project content 49 | $permissions['edit own casetracker_basic_project content'] = array( 50 | 'name' => 'edit own casetracker_basic_project content', 51 | 'roles' => array( 52 | '0' => 'administrator', 53 | '1' => 'manager', 54 | ), 55 | ); 56 | 57 | return $permissions; 58 | } 59 | -------------------------------------------------------------------------------- /atrium_casetracker/atrium_casetracker.info: -------------------------------------------------------------------------------- 1 | name = "Atrium Case Tracker" 2 | description = "The casetracker lets you assign tasks to yourself and others and track the progress on a project. " 3 | core = "6.x" 4 | package = "Features" 5 | dependencies[] = "casetracker" 6 | dependencies[] = "comment" 7 | dependencies[] = "context" 8 | dependencies[] = "date" 9 | dependencies[] = "features" 10 | dependencies[] = "search" 11 | dependencies[] = "spaces" 12 | dependencies[] = "strongarm" 13 | features[content][] = "casetracker_basic_case-field_due_date" 14 | features[context][] = "casetracker_listing" 15 | features[context][] = "casetracker_project" 16 | features[ctools][] = "context:context:3" 17 | features[ctools][] = "strongarm:strongarm:1" 18 | features[node][] = "casetracker_basic_case" 19 | features[node][] = "casetracker_basic_project" 20 | features[user_permission][] = "assign cases" 21 | features[user_permission][] = "create casetracker_basic_case content" 22 | features[user_permission][] = "create casetracker_basic_project content" 23 | features[user_permission][] = "edit own casetracker_basic_case content" 24 | features[user_permission][] = "edit own casetracker_basic_project content" 25 | features[variable][] = "atrium_activity_update_type_casetracker_basic_case" 26 | features[variable][] = "atrium_activity_update_type_casetracker_basic_project" 27 | features[variable][] = "atrium_archivable_casetracker_basic_project" 28 | features[variable][] = "casetracker_default_assign_to" 29 | features[variable][] = "casetracker_view_assignee_options" 30 | features[variable][] = "casetracker_view_project_options" 31 | features[variable][] = "comment_casetracker_basic_case" 32 | features[variable][] = "comment_casetracker_basic_project" 33 | features[variable][] = "comment_controls_casetracker_basic_case" 34 | features[variable][] = "comment_default_mode_casetracker_basic_case" 35 | features[variable][] = "comment_default_order_casetracker_basic_case" 36 | features[variable][] = "comment_default_per_page_casetracker_basic_case" 37 | features[variable][] = "comment_form_location_casetracker_basic_case" 38 | features[variable][] = "comment_preview_casetracker_basic_case" 39 | features[variable][] = "comment_subject_field_casetracker_basic_case" 40 | features[variable][] = "comment_upload_casetracker_basic_case" 41 | features[variable][] = "content_extra_weights_casetracker_basic_case" 42 | features[variable][] = "node_options_casetracker_basic_case" 43 | features[variable][] = "node_options_casetracker_basic_project" 44 | features[variable][] = "nodeformscols_field_placements_casetracker_basic_case_default" 45 | features[variable][] = "nodeformscols_field_placements_casetracker_basic_project_default" 46 | features[variable][] = "notifications_content_type_casetracker_basic_case" 47 | features[variable][] = "notifications_content_type_casetracker_basic_project" 48 | features[variable][] = "og_content_type_usage_casetracker_basic_case" 49 | features[variable][] = "og_content_type_usage_casetracker_basic_project" 50 | features[variable][] = "show_diff_inline_casetracker_basic_case" 51 | features[variable][] = "show_diff_inline_casetracker_basic_project" 52 | features[variable][] = "show_preview_changes_casetracker_basic_case" 53 | features[variable][] = "show_preview_changes_casetracker_basic_project" 54 | features[variable][] = "upload_casetracker_basic_case" 55 | features[variable][] = "upload_casetracker_basic_project" 56 | features[views][] = "casetracker_cases" 57 | features[views][] = "casetracker_override_assignee_options" 58 | features[views][] = "casetracker_override_project_options" 59 | features[views][] = "casetracker_projects" 60 | features[views_api][] = "api:2" 61 | spaces[types][] = "og" 62 | -------------------------------------------------------------------------------- /atrium_casetracker/atrium_casetracker.install: -------------------------------------------------------------------------------- 1 | array( 31 | '1-Sprint: Critical', '2-Sprint', '3-Release: Critical', '4-Release', '5-Project', 32 | ), 33 | 'status' => array( 34 | 'Open', 'Closed', 'Resolved-Staging', 'Resolved-Production', 'Deferred', 'Duplicate', 35 | ), 36 | 'type' => array( 37 | 'Bug', 'Feature Request', 'General Task', 38 | ), 39 | ); 40 | foreach ($realms as $realm => $states) { 41 | foreach ($states as $statename) { 42 | $data = array( 43 | 'name' => $statename, 44 | 'realm' => $realm, 45 | 'weight' => 0, 46 | ); 47 | casetracker_case_state_save($data); 48 | } 49 | } 50 | $csid = db_result(db_query("SELECT csid FROM {casetracker_case_states} WHERE case_state_name = '%s'", 'Open')); 51 | variable_set('casetracker_default_case_status', $csid); 52 | 53 | $csid = db_result(db_query("SELECT csid FROM {casetracker_case_states} WHERE case_state_name = '%s'", '3-Release: Critical')); 54 | variable_set('casetracker_default_case_priority', $csid); 55 | 56 | $csid = db_result(db_query("SELECT csid FROM {casetracker_case_states} WHERE case_state_name = '%s'", 'General Task')); 57 | variable_set('casetracker_default_case_type', $csid); 58 | } 59 | } 60 | 61 | /** 62 | * Update 6002, fix what casetracker_basic hath wrought. 63 | */ 64 | function atrium_casetracker_update_6002() { 65 | $ret = array(); 66 | $ret[] = update_sql("UPDATE {node_type} SET module = 'features' WHERE type = 'casetracker_basic_project'"); 67 | $ret[] = update_sql("UPDATE {node_type} SET module = 'features' WHERE type = 'casetracker_basic_case'"); 68 | 69 | module_disable(array('casetracker_basic')); 70 | $ret[] = array('success' => TRUE, 'query' => 'Module "casetracker_basic" was disabled'); 71 | return $ret; 72 | } 73 | 74 | /** 75 | * Weight Atrium Case Tracker higher than Case Tracker. 76 | */ 77 | function atrium_casetracker_update_6003() { 78 | $ret = array(); 79 | $ret[] = update_sql("UPDATE {system} SET weight = 1 WHERE name = 'atrium_casetracker' AND type = 'module'"); 80 | return $ret; 81 | } 82 | 83 | /** 84 | * Update for Kit compliance 85 | */ 86 | function atrium_casetracker_update_6004() { 87 | 88 | $components = array( 89 | 'views' => array( 90 | 'atrium_casetracker' => array( 91 | 'casetracker_cases' => array( 92 | 'block_1' => array( 93 | 'module' => 'views', 94 | 'delta' => 'block_1', 95 | ), 96 | 'block_2' => array( 97 | 'module' => 'views', 98 | 'delta' => 'block_2', 99 | ), 100 | 'block_3' => array( 101 | 'module' => 'views', 102 | 'delta' => 'block_3', 103 | ), 104 | ), 105 | ), 106 | 'atrium_casetracker_projects' => array( 107 | 'casetracker_projects' => array( 108 | 'block_1' => array( 109 | 'module' => 'views', 110 | 'delta' => 'block_1', 111 | ), 112 | ), 113 | ), 114 | 'atrium_ct_assignee_options' => array( 115 | 'casetracker_override_assignee_options' => array( 116 | ), 117 | ), 118 | 'atrium_ct_project_options' => array( 119 | 'casetracker_override_project_options' => array( 120 | ), 121 | ), 122 | ), 123 | 'contexts' => array( 124 | 'atrium-casetracker-book' => 'book_casetracker', 125 | 'atrium-casetracker-project' => 'casetracker_project', 126 | 'spaces-feature-casetracker' => 'casetracker_listing', 127 | ), 128 | ); 129 | 130 | module_load_include('inc', 'atrium', 'includes/atrium_update_kit'); 131 | atrium_kit_comply_presets($components); 132 | atrium_kit_comply_overrides($components); 133 | atrium_kit_comply_contexts($components); 134 | 135 | return array(array('success' => true, 'query' => 'Atrium Casetracker updated for Kit compliance.')); 136 | } 137 | -------------------------------------------------------------------------------- /atrium_casetracker/atrium_casetracker.views.inc: -------------------------------------------------------------------------------- 1 | array( 9 | 'path' => drupal_get_path('module', 'atrium_casetracker') .'/includes', 10 | ), 11 | 'handlers' => array( 12 | 'atrium_casetracker_handler_field_priority_name' => array( 13 | 'parent' => 'views_handler_field', 14 | ), 15 | 'atrium_casetracker_handler_filter_status_closed' => array( 16 | 'parent' => 'views_handler_filter_boolean_operator', 17 | ), 18 | ), 19 | ); 20 | } 21 | 22 | /** 23 | * Implementation of hook_views_data_alter(). 24 | * Replaces default field formatters with special-sauce field formatters. 25 | */ 26 | function atrium_casetracker_views_data_alter(&$data) { 27 | if (isset($data['casetracker_case'])) { 28 | $data['casetracker_case']['case_status_closed'] = array( 29 | 'title' => t('Show closed cases'), 30 | 'filter' => array( 31 | 'field' => 'case_status_id', 32 | 'handler' => 'atrium_casetracker_handler_filter_status_closed', 33 | 'help' => t('Filter out closed cases.'), 34 | ), 35 | ); 36 | } 37 | if (isset($data['casetracker_case']['case_priority_id']['field']['handler'])) { 38 | $data['casetracker_case']['case_priority_id']['field']['handler'] = 'atrium_casetracker_handler_field_priority_name'; 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /atrium_casetracker/includes/atrium_casetracker_handler_field_priority_name.inc: -------------------------------------------------------------------------------- 1 | casetracker_case_case_priority_id); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /atrium_casetracker/includes/atrium_casetracker_handler_filter_status_closed.inc: -------------------------------------------------------------------------------- 1 | value_value = t('Show closed cases'); 6 | if (isset($this->definition['label'])) { 7 | $this->value_value = $this->definition['label']; 8 | } 9 | } 10 | 11 | function admin_summary() { 12 | if (!empty($this->value)) { 13 | return t('Yes'); 14 | } 15 | return t('No'); 16 | } 17 | 18 | function operator_form(&$form, &$form_state) { } 19 | 20 | function value_form(&$form, &$form_state) { 21 | $form['value'] = array( 22 | '#type' => 'checkbox', 23 | '#title' => $this->value_value, 24 | '#default_value' => $this->value, 25 | ); 26 | if (!empty($this->options['exposed'])) { 27 | $form['value']['#title'] = $this->options['expose']['label']; 28 | $identifier = $this->options['expose']['identifier']; 29 | if (!isset($form_state['input'][$identifier])) { 30 | $form_state['input'][$identifier] = $this->value; 31 | } 32 | } 33 | } 34 | 35 | function query() { 36 | if (empty($this->value)) { 37 | $this->ensure_my_table(); 38 | 39 | if ($inactive_states = atrium_casetracker_get_inactive_states()) { 40 | $placeholders = db_placeholders($inactive_states); 41 | $this->query->add_where($this->options['group'], "{$this->table_alias}.{$this->real_field} NOT IN($placeholders)", $inactive_states); 42 | } 43 | } 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /atrium_casetracker/tests/atrium_casetracker.test: -------------------------------------------------------------------------------- 1 | 'Atrium Case Tracker', 11 | 'description' => 'Tests for Atrium Case Tracker.', 12 | 'group' => 'Atrium', 13 | ); 14 | } 15 | 16 | /** 17 | * Implementation of setUp(). 18 | */ 19 | function setUp() { 20 | parent::setUp(); 21 | $this->atriumBasic(); 22 | foreach ($this->atriumGroups as $group) { 23 | $this->atriumEnableFeature('atrium_casetracker', 'og', $group->nid); 24 | } 25 | // Use manager role since managers can create projects. 26 | $this->atriumUsers['private_user'] = $this->atriumCreateUser('manager', array($this->atriumGroups['private'])); 27 | $this->atriumUsers['public_user'] = $this->atriumCreateUser('manager', array($this->atriumGroups['public'])); 28 | } 29 | 30 | /** 31 | * Test that cases can only be assigned to users in the current group. 32 | */ 33 | function testAssigneeVisibility() { 34 | $private = $this->atriumUsers['private_user']; 35 | $public = $this->atriumUsers['public_user']; 36 | 37 | // Test that user A cannot see user B 38 | $this->drupalLogin($private); 39 | $this->atriumCreateGroupContent($this->atriumGroups['private'], 'casetracker_basic_project'); 40 | $this->drupalGet("{$this->atriumGroups['private']->path}/node/add/casetracker-basic-case"); 41 | $this->assertText(t('Case information')); 42 | $this->assertText($private->name); 43 | $this->assertNoText($public->name); 44 | 45 | // Test that user B cannot see user A 46 | $this->drupalLogin($public); 47 | $this->atriumCreateGroupContent($this->atriumGroups['public'], 'casetracker_basic_project'); 48 | $this->drupalGet("{$this->atriumGroups['public']->path}/node/add/casetracker-basic-case"); 49 | $this->assertText(t('Case information')); 50 | $this->assertText($public->name); 51 | $this->assertNoText($private->name); 52 | } 53 | 54 | /** 55 | * Test that projects 56 | * - become root books upon creation 57 | * - have inline diff enabled 58 | */ 59 | function testProjectNode() { 60 | $this->drupalLogin($this->atriumUsers['private_user']); 61 | //@TODO The value of this variable is still stored in the database at this point, despite the 62 | // features_revert called during the parent::setUp(); 63 | variable_del('book_allowed_types'); 64 | $node = $this->atriumCreateGroupContent($this->atriumGroups['private'], 'casetracker_basic_project'); 65 | $this->drupalGet("node/{$node->nid}"); 66 | 67 | // Is root book. 68 | $this->assertText(t('Add child page')); 69 | 70 | // Save a revision and test for inline diff. 71 | $edit = array( 72 | 'title' => $this->randomName(32), 73 | 'body' => $this->randomName(32), 74 | ); 75 | $this->drupalPost("node/{$node->nid}/edit", $edit, t('Save')); 76 | $this->drupalGet("node/{$node->nid}"); 77 | $this->assertText(t('Highlight changes')); 78 | } 79 | } 80 | -------------------------------------------------------------------------------- /atrium_groups/atrium_groups.context.inc: -------------------------------------------------------------------------------- 1 | disabled = FALSE; /* Edit this to true to make a default context disabled initially */ 11 | $context->api_version = 3; 12 | $context->name = 'groups_listing'; 13 | $context->description = ''; 14 | $context->tag = 'Groups'; 15 | $context->conditions = array( 16 | 'views' => array( 17 | 'values' => array( 18 | 'groups_listing' => 'groups_listing', 19 | ), 20 | ), 21 | ); 22 | $context->reactions = array( 23 | 'menu' => 'og', 24 | ); 25 | $context->condition_mode = 0; 26 | 27 | // Translatables 28 | // Included for use with string extractors like potx. 29 | t('Groups'); 30 | $export['groups_listing'] = $context; 31 | 32 | $context = new stdClass; 33 | $context->disabled = FALSE; /* Edit this to true to make a default context disabled initially */ 34 | $context->api_version = 3; 35 | $context->name = 'profile_groups'; 36 | $context->description = ''; 37 | $context->tag = 'Profile'; 38 | $context->conditions = array( 39 | 'user_page' => array( 40 | 'values' => array( 41 | 'view' => 'view', 42 | ), 43 | 'options' => array( 44 | 'mode' => 'all', 45 | ), 46 | ), 47 | ); 48 | $context->reactions = array( 49 | 'block' => array( 50 | 'blocks' => array( 51 | 'views-groups_listing-block_1' => array( 52 | 'module' => 'views', 53 | 'delta' => 'groups_listing-block_1', 54 | 'region' => 'right', 55 | 'weight' => 0, 56 | ), 57 | ), 58 | ), 59 | ); 60 | $context->condition_mode = 0; 61 | 62 | // Translatables 63 | // Included for use with string extractors like potx. 64 | t('Profile'); 65 | $export['profile_groups'] = $context; 66 | 67 | return $export; 68 | } 69 | -------------------------------------------------------------------------------- /atrium_groups/atrium_groups.features.inc: -------------------------------------------------------------------------------- 1 | 3); 10 | } 11 | elseif ($module == "spaces" && $api == "spaces") { 12 | return array("version" => 3); 13 | } 14 | elseif ($module == "strongarm" && $api == "strongarm") { 15 | return array("version" => 1); 16 | } 17 | } 18 | 19 | /** 20 | * Implementation of hook_node_info(). 21 | */ 22 | function atrium_groups_node_info() { 23 | $items = array( 24 | 'group' => array( 25 | 'name' => t('Group'), 26 | 'module' => 'features', 27 | 'description' => t('A group space for members to coordinate, collaborate and share ideas.'), 28 | 'has_title' => '1', 29 | 'title_label' => t('Title'), 30 | 'has_body' => '0', 31 | 'body_label' => t('Body'), 32 | 'min_word_count' => '0', 33 | 'help' => '', 34 | ), 35 | ); 36 | return $items; 37 | } 38 | 39 | /** 40 | * Implementation of hook_views_api(). 41 | */ 42 | function atrium_groups_views_api() { 43 | return array( 44 | 'api' => '2', 45 | ); 46 | } 47 | -------------------------------------------------------------------------------- /atrium_groups/atrium_groups.features.user_permission.inc: -------------------------------------------------------------------------------- 1 | 'create group content', 12 | 'roles' => array( 13 | '0' => 'administrator', 14 | '1' => 'manager', 15 | ), 16 | ); 17 | 18 | // Exported permission: delete own group content 19 | $permissions['delete own group content'] = array( 20 | 'name' => 'delete own group content', 21 | 'roles' => array( 22 | '0' => 'administrator', 23 | '1' => 'manager', 24 | ), 25 | ); 26 | 27 | // Exported permission: edit own group content 28 | $permissions['edit own group content'] = array( 29 | 'name' => 'edit own group content', 30 | 'roles' => array( 31 | '0' => 'administrator', 32 | '1' => 'manager', 33 | ), 34 | ); 35 | 36 | return $permissions; 37 | } 38 | -------------------------------------------------------------------------------- /atrium_groups/atrium_groups.info: -------------------------------------------------------------------------------- 1 | name = "Atrium Groups" 2 | description = "Customizable group spaces and directory for finding groups." 3 | core = "6.x" 4 | package = "Atrium" 5 | dependencies[] = "context" 6 | dependencies[] = "og_views" 7 | dependencies[] = "spaces" 8 | dependencies[] = "spaces_og" 9 | dependencies[] = "strongarm" 10 | features[context][] = "groups_listing" 11 | features[context][] = "profile_groups" 12 | features[ctools][] = "context:context:3" 13 | features[ctools][] = "spaces:spaces:3" 14 | features[ctools][] = "strongarm:strongarm:1" 15 | features[node][] = "group" 16 | features[spaces_presets][] = "atrium_groups_private" 17 | features[spaces_presets][] = "atrium_groups_public" 18 | features[user_permission][] = "create group content" 19 | features[user_permission][] = "delete own group content" 20 | features[user_permission][] = "edit own group content" 21 | features[variable][] = "atrium_activity_update_type_group" 22 | features[variable][] = "atrium_archivable_group" 23 | features[variable][] = "comment_group" 24 | features[variable][] = "node_options_group" 25 | features[variable][] = "nodeformscols_field_placements_group_default" 26 | features[variable][] = "notifications_content_type_group" 27 | features[variable][] = "og_audience_checkboxes" 28 | features[variable][] = "og_audience_required" 29 | features[variable][] = "og_content_type_usage_group" 30 | features[variable][] = "og_member_pics" 31 | features[variable][] = "og_notification" 32 | features[variable][] = "og_private_groups" 33 | features[variable][] = "og_visibility" 34 | features[variable][] = "og_visibility_directory" 35 | features[variable][] = "og_visibility_registration" 36 | features[variable][] = "show_diff_inline_group" 37 | features[variable][] = "show_preview_changes_group" 38 | features[variable][] = "spaces_preset_og" 39 | features[variable][] = "upload_group" 40 | features[views][] = "groups_listing" 41 | features[views_api][] = "api:2" 42 | kitf = "1.0-draft" 43 | spaces[types][] = "site" 44 | -------------------------------------------------------------------------------- /atrium_groups/atrium_groups.install: -------------------------------------------------------------------------------- 1 | array( 9 | 'atrium_groups' => array( 10 | 'groups_listing' => array( 11 | 'block_2' => array( 12 | 'module' => 'views', 13 | 'delta' => 'block_2', 14 | ), 15 | ), 16 | ), 17 | ), 18 | 'contexts' => array( 19 | 'spaces-feature-groups' => 'groups_listing', 20 | ), 21 | 'spaces_presets' => array( 22 | 'atrium_og_private' => 'atrium_groups_private', 23 | 'atrium_og_public' => 'atrium_groups_public', 24 | ), 25 | ); 26 | 27 | module_load_include('inc', 'atrium', 'includes/atrium_update_kit'); 28 | atrium_kit_comply_presets($components); 29 | atrium_kit_comply_contexts($components); 30 | atrium_kit_comply_overrides($components); 31 | atrium_kit_comply_spaces_presets($components); 32 | 33 | return array(array('success' => true, 'query' => 'Atrium Groups updated for Kit compliance.')); 34 | } -------------------------------------------------------------------------------- /atrium_groups/atrium_groups.module: -------------------------------------------------------------------------------- 1 | title(), ''); 62 | } 63 | } 64 | 65 | /** 66 | * Implementation of hook_context_page_reaction(). 67 | * Good occasion to set the breadcrumb. 68 | */ 69 | function atrium_groups_context_page_reaction() { 70 | if (!spaces_get_space() && context_get('context', 'groups_listing')) { 71 | $breadcrumb = array( 72 | l(t('Home'), '', array('purl' => array('disabled' => TRUE))), 73 | l(t('Groups'), 'og', array('purl' => array('disabled' => TRUE))), 74 | ); 75 | drupal_set_breadcrumb($breadcrumb); 76 | } 77 | } 78 | 79 | /** 80 | * Implementation of hook_context_links_alter(). 81 | */ 82 | function atrium_groups_context_links_alter(&$links) { 83 | if (context_get('context', 'groups_listing')) { 84 | $item = menu_get_item('node/add/group'); 85 | if ($item['access']) { 86 | $links['atrium_groups'] = array('title' => t('Add @type', array('@type' => $item['title'])), 'href' => $item['href']); 87 | } 88 | } 89 | } 90 | 91 | /** 92 | * Implementation of hook_views_pre_view(). 93 | * Add group management fields to members listing view. 94 | */ 95 | function atrium_groups_views_pre_build(&$view) { 96 | if ($view->name == 'members_listing') { 97 | $fields = $view->display_handler->get_option('fields'); 98 | $fields['is_admin'] = array( 99 | 'label' => '', 100 | 'alter' => array( 101 | 'alter_text' => 1, 102 | 'text' => '
[is_admin]
', 103 | ), 104 | 'id' => 'is_admin', 105 | 'table' => 'og_uid', 106 | 'field' => 'is_admin', 107 | 'relationship' => 'none', 108 | ); 109 | $fields['managelink'] = array( 110 | 'label' => '', 111 | 'alter' => array( 112 | 'alter_text' => 1, 113 | 'text' => '
[managelink]
', 114 | ), 115 | 'id' => 'managelink', 116 | 'table' => 'og_uid', 117 | 'field' => 'managelink', 118 | 'relationship' => 'none', 119 | ); 120 | // Add in link to make/revoke as group admin. 121 | $fields['managelinkadmin'] = array( 122 | 'label' => '', 123 | 'alter' => array( 124 | 'alter_text' => 1, 125 | 'text' => '[managelinkadmin]', 126 | ), 127 | 'hide_empty' => 1, 128 | 'id' => 'managelinkadmin', 129 | 'table' => 'og_uid', 130 | 'field' => 'managelinkadmin', 131 | 'relationship' => 'none', 132 | ); 133 | 134 | $fields = $view->display_handler->set_option('fields', $fields); 135 | } 136 | } 137 | 138 | /** 139 | * Implementation of hook_context_default_contexts_alter(). 140 | */ 141 | function atrium_groups_context_default_contexts_alter(&$contexts) { 142 | // Conditionally add the "My Groups" block to the spaces_dashboard-custom-1 context. 143 | if (module_exists('atrium') && !empty($contexts['spaces_dashboard-custom-1'])) { 144 | $contexts['spaces_dashboard-custom-1']->reactions['block']['blocks']['views-groups_listing-block_2'] = array( 145 | 'module' => 'views', 146 | 'delta' => 'groups_listing-block_2', 147 | 'region' => 'right', 148 | 'weight' => 0, 149 | ); 150 | } 151 | } 152 | 153 | -------------------------------------------------------------------------------- /atrium_members/atrium_members.context.inc: -------------------------------------------------------------------------------- 1 | disabled = FALSE; /* Edit this to true to make a default context disabled initially */ 11 | $context->api_version = 3; 12 | $context->name = 'members_directory'; 13 | $context->description = ''; 14 | $context->tag = 'Members'; 15 | $context->conditions = array( 16 | 'views' => array( 17 | 'values' => array( 18 | 'members_listing' => 'members_listing', 19 | ), 20 | ), 21 | ); 22 | $context->reactions = array( 23 | 'block' => array( 24 | 'blocks' => array( 25 | 'atrium_members-addform' => array( 26 | 'module' => 'atrium_members', 27 | 'delta' => 'addform', 28 | 'region' => 'right', 29 | 'weight' => 0, 30 | ), 31 | ), 32 | ), 33 | ); 34 | $context->condition_mode = 0; 35 | 36 | // Translatables 37 | // Included for use with string extractors like potx. 38 | t('Members'); 39 | $export['members_directory'] = $context; 40 | 41 | $context = new stdClass; 42 | $context->disabled = FALSE; /* Edit this to true to make a default context disabled initially */ 43 | $context->api_version = 3; 44 | $context->name = 'members_section'; 45 | $context->description = ''; 46 | $context->tag = 'Members'; 47 | $context->conditions = array( 48 | 'path' => array( 49 | 'values' => array( 50 | 'members/add' => 'members/add', 51 | 'members/add/*' => 'members/add/*', 52 | ), 53 | ), 54 | 'views' => array( 55 | 'values' => array( 56 | 'members_listing' => 'members_listing', 57 | ), 58 | ), 59 | ); 60 | $context->reactions = array( 61 | 'menu' => 'members', 62 | ); 63 | $context->condition_mode = 0; 64 | 65 | // Translatables 66 | // Included for use with string extractors like potx. 67 | t('Members'); 68 | $export['members_section'] = $context; 69 | 70 | return $export; 71 | } 72 | -------------------------------------------------------------------------------- /atrium_members/atrium_members.features.inc: -------------------------------------------------------------------------------- 1 | 3); 10 | } 11 | elseif ($module == "spaces" && $api == "spaces") { 12 | return array("version" => 3); 13 | } 14 | elseif ($module == "strongarm" && $api == "strongarm") { 15 | return array("version" => 1); 16 | } 17 | } 18 | 19 | /** 20 | * Implementation of hook_views_api(). 21 | */ 22 | function atrium_members_views_api() { 23 | return array( 24 | 'api' => '2', 25 | ); 26 | } 27 | -------------------------------------------------------------------------------- /atrium_members/atrium_members.features.user_permission.inc: -------------------------------------------------------------------------------- 1 | 'block users', 12 | 'roles' => array( 13 | '0' => 'administrator', 14 | '1' => 'manager', 15 | ), 16 | ); 17 | 18 | // Exported permission: create users 19 | $permissions['create users'] = array( 20 | 'name' => 'create users', 21 | 'roles' => array( 22 | '0' => 'administrator', 23 | '1' => 'manager', 24 | ), 25 | ); 26 | 27 | return $permissions; 28 | } 29 | -------------------------------------------------------------------------------- /atrium_members/atrium_members.inc: -------------------------------------------------------------------------------- 1 | name] = check_plain($user->name); 16 | } 17 | } 18 | drupal_json($matches); 19 | } 20 | 21 | /** 22 | * Form for adding existing members to a group. 23 | */ 24 | function atrium_members_addform($form_state, $group) { 25 | $form = array('#theme' => 'atrium_members_addform'); 26 | $form['messages'] = array('#type' => 'markup'); 27 | 28 | // Provide the page View for AJAX reload action. 29 | if ($display = views_get_page_view()) { 30 | if ($display->get_option('use_ajax')) { 31 | $form['view'] = array( 32 | '#type' => 'hidden', 33 | '#value' => "{$display->view->name}:{$display->view->current_display}", 34 | '#attributes' => array('class' => 'atrium-members-addform-view'), 35 | ); 36 | } 37 | } 38 | 39 | $form['group'] = array( 40 | '#type' => 'value', 41 | '#value' => $group, 42 | ); 43 | $form['username'] = array( 44 | '#type' => 'textfield', 45 | '#title' => t('Username'), 46 | '#default_value' => '', 47 | '#autocomplete_path' => 'members/add/autocomplete', 48 | '#description' => '', 49 | ); 50 | $form['add'] = array( 51 | '#type' => 'submit', 52 | '#value' => t('Add to group'), 53 | '#submit' => array('atrium_members_addform_submit'), 54 | '#ahah' => array( 55 | 'path' => 'members/add/ajax', 56 | 'wrapper' => 'atrium-members-addform-messages', 57 | 'method' => 'replace', 58 | 'effect' => 'none', 59 | ), 60 | ); 61 | return $form; 62 | } 63 | 64 | /** 65 | * Theme function for atrium_members_addform(). 66 | */ 67 | function theme_atrium_members_addform($form) { 68 | drupal_add_js(drupal_get_path('module', 'atrium_members') .'/atrium_members.js'); 69 | $output = "
"; 70 | $output .= drupal_render($form['messages']); 71 | $output .= "
"; 72 | $output .= drupal_render($form); 73 | return "
{$output}
"; 74 | } 75 | 76 | /** 77 | * Submit handler for member addform. 78 | */ 79 | function atrium_members_addform_submit(&$form, &$form_state) { 80 | if ($uid = db_result(db_query("SELECT uid FROM {users} WHERE name = '%s'", $form_state['values']['username']))) { 81 | if ($account = user_load($uid)) { 82 | og_save_subscription($form_state['values']['group']->nid, $account->uid, array('is_active' => 1)); 83 | drupal_set_message(t('Subscribed user %name to %group.', array('%name' => $account->name, '%group' => $form_state['values']['group']->title))); 84 | } 85 | } 86 | } 87 | 88 | /** 89 | * AJAX/AHAH callback for user addform submission. 90 | */ 91 | function atrium_members_addform_ajax() { 92 | if ($form = form_get_cache($_POST['form_build_id'], $form_state)) { 93 | // Build submitted values. 94 | $form_state = array('values' => $_POST); 95 | foreach (element_children($form) as $key) { 96 | if ($form[$key]['#type'] === 'value' && isset($form[$key]['#value'])) { 97 | $form_state['values'][$key] = $form[$key]['#value']; 98 | } 99 | } 100 | // Submit the form & retrieve messages. 101 | atrium_members_addform_submit($form, $form_state); 102 | $output = theme('status_messages'); 103 | $output = "
{$output}
"; 104 | drupal_json(array('status' => TRUE, 'data' => $output)); 105 | exit(); 106 | } 107 | drupal_json(array('status' => FALSE, 'data' => '')); 108 | exit(); 109 | } 110 | 111 | /** 112 | * Page callback for og users. 113 | */ 114 | function atrium_members_og_users() { 115 | menu_set_active_item('members'); 116 | return menu_execute_active_handler(); 117 | } 118 | 119 | /** 120 | * Form callback that generates only the portion of the user profile form that is requested. 121 | */ 122 | function atrium_members_user_profile_tab($form_state, $account, $tab) { 123 | module_load_include('inc', 'user', 'user.pages'); 124 | $form = user_profile_form($form_state, $account); 125 | $form['#submit'] = array('user_profile_form_submit'); 126 | foreach (element_children($form) as $k) { 127 | if ($k == $tab || $form[$k]['#type'] == 'submit') { 128 | $form[$k]['#access'] = TRUE; 129 | } 130 | else { 131 | $form[$k]['#access'] = FALSE; 132 | } 133 | } 134 | if (isset($form['delete'])) { 135 | $form['delete']['#access'] = FALSE; 136 | } 137 | return $form; 138 | } 139 | -------------------------------------------------------------------------------- /atrium_members/atrium_members.info: -------------------------------------------------------------------------------- 1 | name = "Atrium Members" 2 | description = "Member directory and tools for adding and managing users." 3 | core = "6.x" 4 | package = "Atrium" 5 | dependencies[] = "context" 6 | dependencies[] = "features" 7 | dependencies[] = "imagecache" 8 | dependencies[] = "spaces" 9 | dependencies[] = "strongarm" 10 | dependencies[] = "ucreate" 11 | dependencies[] = "views" 12 | features[context][] = "members_directory" 13 | features[context][] = "members_section" 14 | features[ctools][] = "context:context:3" 15 | features[ctools][] = "spaces:spaces:3" 16 | features[ctools][] = "strongarm:strongarm:1" 17 | features[spaces_presets][] = "atrium_members_simple" 18 | features[user_permission][] = "block users" 19 | features[user_permission][] = "create users" 20 | features[variable][] = "spaces_preset_user" 21 | features[views][] = "members_listing" 22 | features[views_api][] = "api:2" 23 | kitf = "1.0-draft" 24 | spaces[types][] = "site" 25 | spaces[types][] = "og" 26 | -------------------------------------------------------------------------------- /atrium_members/atrium_members.install: -------------------------------------------------------------------------------- 1 | array( 9 | 'atrium_members' => array( 10 | 'members_listing' => array(), 11 | ), 12 | ), 13 | 'contexts' => array( 14 | 'spaces-feature-members' => 'members_section', 15 | 'atrium-members-directory' => 'members_directory', 16 | ), 17 | 'spaces_presets' => array( 18 | 'atrium_user_simple' => 'atrium_members_simple', 19 | ), 20 | ); 21 | 22 | module_load_include('inc', 'atrium', 'includes/atrium_update_kit'); 23 | atrium_kit_comply_overrides($components); 24 | atrium_kit_comply_presets($components); 25 | atrium_kit_comply_spaces_presets($components); 26 | atrium_kit_comply_contexts($components); 27 | 28 | return array(array('success' => true, 'query' => 'Atrium Members updated for Kit compliance.')); 29 | } -------------------------------------------------------------------------------- /atrium_members/atrium_members.js: -------------------------------------------------------------------------------- 1 | Drupal.behaviors.atrium_members = function(context) { 2 | /** 3 | * Retrieve the active page view if present and initialize AJAX parameters 4 | * for refreshing the view via AJAX when necessary. This is fired when 5 | * Drupal.attachBehaviors is called after a successful AJAX response from 6 | * atrium_members. 7 | */ 8 | if ($('.atrium-members-ajax', context).size() > 0) { 9 | var form = $('.atrium-members-addform'); 10 | if (form) { 11 | // Views AJAX prep. For the origin of much of this code, see 12 | // ajax_view.js in Views. 13 | if ($('input.atrium-members-addform-view', form).size() > 0) { 14 | // Retrieve current page view's settings and DOM element. 15 | var settings = {}; 16 | var view = ''; 17 | var identifier = $('input.atrium-members-addform-view', form).val().split(':'); 18 | for (var i in Drupal.settings.views.ajaxViews) { 19 | if ( 20 | Drupal.settings.views.ajaxViews[i].view_name == identifier[0] && 21 | Drupal.settings.views.ajaxViews[i].view_display_id == identifier[1] 22 | ) { 23 | settings = Drupal.settings.views.ajaxViews[i]; 24 | view = $('.view-dom-id-' + settings.view_dom_id); 25 | break; 26 | } 27 | } 28 | 29 | // If there are multiple views this might've ended up showing up multiple times. 30 | var ajax_path = Drupal.settings.views.ajax_path; 31 | if (ajax_path.constructor.toString().indexOf("Array") != -1) { 32 | ajax_path = ajax_path[0]; 33 | } 34 | 35 | // Prepare viewData params. 36 | var viewData = settings; 37 | viewData.js = 1; 38 | 39 | // AJAX request. 40 | $.ajax({ 41 | url: ajax_path, 42 | type: 'GET', 43 | data: viewData, 44 | success: function(response) { 45 | // Call all callbacks. 46 | if (response.__callbacks) { 47 | $.each(response.__callbacks, function(i, callback) { eval(callback)(view, response); }); 48 | } 49 | }, 50 | error: function(xhr) { Drupal.Views.Ajax.handleErrors(xhr, ajax_path); }, 51 | dataType: 'json' 52 | }); 53 | } 54 | } 55 | } 56 | 57 | /** 58 | * Attach to Atrium members addforms and do the following: 59 | * - Event handler when hitting "enter" in the username field. 60 | * - Event handler when clicking the "Add" button. 61 | */ 62 | $('.atrium-members-addform:not(.atrium-members-processed)') 63 | .addClass('atrium-members-processed') 64 | .each(function() { 65 | var form = $(this); 66 | 67 | // Detect enter key, submit. 68 | $('input.form-text', this).keypress(function(event) { 69 | if (event.keyCode == 13) { 70 | var selected = $('.selected', $(this).siblings('#autocomplete:has(.selected)')); 71 | if (selected.size() > 0) { 72 | $(this).val(selected.get(0).autocompleteValue); 73 | } 74 | $('input.form-submit', form).mousedown(); 75 | return false; 76 | } 77 | }); 78 | 79 | // Clear out textfield value on submit. 80 | $('input.form-submit', this).ajaxComplete(function(e, xhr, settings) { 81 | if(settings.url.indexOf('members/add/ajax') > -1){ 82 | $('input.form-text', form).val(''); 83 | } 84 | }); 85 | }); 86 | }; 87 | -------------------------------------------------------------------------------- /atrium_members/atrium_members.spaces.inc: -------------------------------------------------------------------------------- 1 | disabled = FALSE; /* Edit this to true to make a default spaces_presets disabled initially */ 11 | $spaces_presets->api_version = 3; 12 | $spaces_presets->name = 'atrium_members_simple'; 13 | $spaces_presets->title = 'Simple profile'; 14 | $spaces_presets->description = 'A simple profile with a blog, calendar and dashboard.'; 15 | $spaces_presets->space_type = 'user'; 16 | $spaces_presets->value = array( 17 | 'variable' => array( 18 | 'spaces_features' => array( 19 | 'spaces_dashboard' => '1', 20 | ), 21 | 'spaces_dashboard_custom' => array( 22 | 'custom-1' => 'Dashboard', 23 | ), 24 | 'spaces_setting_home' => 'profile', 25 | 'spaces_dashboard_blocks' => array( 26 | 'atrium-welcome_admin' => 1, 27 | 'atrium-welcome_member' => 1, 28 | 'atrium_calendar-mini' => 1, 29 | 'views-calendar_upcoming-block_1' => 1, 30 | 'views-casetracker_projects-block_1' => 1, 31 | 'views-blog_listing-block_2' => 1, 32 | 'views-blog_comments-block_1' => 1, 33 | 'views-casetracker_cases-block_3' => 1, 34 | 'views-casetracker_cases-block_4' => 1, 35 | 'views-groups_listing-block_1' => 1, 36 | 'views-activity_listing-block_1' => 1, 37 | 'views-activity_listing-block_2' => 1, 38 | ), 39 | ), 40 | 'context' => array( 41 | 'spaces_dashboard-custom-1:reaction:block' => array( 42 | 'blocks' => array( 43 | 'views-activity_listing-block_1' => array( 44 | 'module' => 'views', 45 | 'delta' => 'activity_listing-block_1', 46 | 'region' => 'content', 47 | 'weight' => 0, 48 | ), 49 | 'views-blog_comments-block_1' => array( 50 | 'module' => 'views', 51 | 'delta' => 'blog_comments-block_1', 52 | 'region' => 'right', 53 | 'weight' => 0, 54 | ), 55 | ), 56 | ), 57 | 'spaces_dashboard-custom-2:reaction:block' => array( 58 | 'blocks' => array(), 59 | ), 60 | 'spaces_dashboard-custom-3:reaction:block' => array( 61 | 'blocks' => array(), 62 | ), 63 | 'spaces_dashboard-custom-4:reaction:block' => array( 64 | 'blocks' => array(), 65 | ), 66 | 'spaces_dashboard-custom-5:reaction:block' => array( 67 | 'blocks' => array(), 68 | ), 69 | ), 70 | ); 71 | 72 | // Translatables 73 | // Included for use with string extractors like potx. 74 | t('A simple profile with a blog, calendar and dashboard.'); 75 | t('Simple profile'); 76 | $export['atrium_members_simple'] = $spaces_presets; 77 | 78 | return $export; 79 | } 80 | -------------------------------------------------------------------------------- /atrium_members/atrium_members.strongarm.inc: -------------------------------------------------------------------------------- 1 | disabled = FALSE; /* Edit this to true to make a default strongarm disabled initially */ 11 | $strongarm->api_version = 1; 12 | $strongarm->name = 'spaces_preset_user'; 13 | $strongarm->value = 'atrium_members_simple'; 14 | $export['spaces_preset_user'] = $strongarm; 15 | 16 | return $export; 17 | } 18 | -------------------------------------------------------------------------------- /atrium_members/atrium_members.test: -------------------------------------------------------------------------------- 1 | 'Atrium Members', 12 | 'description' => 'Tests for Atrium Members.', 13 | 'group' => 'Atrium', 14 | ); 15 | } 16 | 17 | /** 18 | * Implementation of setUp(). 19 | */ 20 | function setUp() { 21 | parent::setUp(); 22 | $this->atriumBasic(); 23 | } 24 | 25 | /** 26 | * Test member visibility. 27 | * 28 | * This test actually mainly tests code in spaces_og, but due to the fact 29 | * that Drupal core provides no instances of {users} table queries going 30 | * through db_rewrite_sql() the tests are here. 31 | */ 32 | function testMemberVisibility() { 33 | // When site is in ATRIUM_MEMBERS_ALL mode, users should be able to see all 34 | // other users. Put the site in ATRIUM_MEMBERS_ALL mode and test that all 35 | // accounts can see all other accounts. 36 | $this->drupalLogin($this->atriumUsers['administrator']); 37 | $this->drupalPost('features', array('atrium_members' => ATRIUM_MEMBERS_ALL), 'Save configuration'); 38 | 39 | foreach ($this->atriumUsers as $account) { 40 | $this->drupalLogin($account); 41 | $this->drupalGet('members'); 42 | foreach ($this->atriumUsers as $account2) { 43 | $this->assertText($account2->name); 44 | } 45 | } 46 | 47 | // When site is in ATRIUM_MEMBERS_GROUP mode, administrators and managers should 48 | // see all users while normal users can only see those in their groups. 49 | $this->drupalLogin($this->atriumUsers['administrator']); 50 | $this->drupalPost('features', array('atrium_members' => ATRIUM_MEMBERS_GROUP), 'Save configuration'); 51 | 52 | foreach (array('administrator', 'manager', 'user') as $role) { 53 | $this->drupalLogin($this->atriumUsers[$role]); 54 | $this->drupalGet('members'); 55 | foreach ($this->atriumUsers as $account2) { 56 | $this->assertText($account2->name); 57 | } 58 | } 59 | 60 | // Create a new group and users within that group. They should be able to 61 | // see each other and 'administrator' (the group administrator) but not other 62 | // non-member users. 63 | $this->drupalLogin($this->atriumUsers['administrator']); 64 | $private = $this->atriumCreateGroup('atrium_groups_private'); 65 | 66 | $this->atriumUsers['group_user1'] = $this->atriumCreateUser('user', array($private)); 67 | $this->atriumUsers['group_user2'] = $this->atriumCreateUser('user', array($private)); 68 | 69 | $this->drupalLogin($this->atriumUsers['group_user1']); 70 | $this->drupalGet('members'); 71 | $this->assertText($this->atriumUsers['group_user1']->name); 72 | $this->assertText($this->atriumUsers['group_user2']->name); 73 | $this->assertText($this->atriumUsers['administrator']->name); 74 | $this->assertNoText($this->atriumUsers['user']->name); 75 | $this->assertNoText($this->atriumUsers['manager']->name); 76 | } 77 | } 78 | -------------------------------------------------------------------------------- /atrium_profile/atrium_profile.features.inc: -------------------------------------------------------------------------------- 1 | 3); 10 | } 11 | elseif ($module == "strongarm" && $api == "strongarm") { 12 | return array("version" => 1); 13 | } 14 | } 15 | 16 | /** 17 | * Implementation of hook_node_info(). 18 | */ 19 | function atrium_profile_node_info() { 20 | $items = array( 21 | 'profile' => array( 22 | 'name' => t('Profile'), 23 | 'module' => 'features', 24 | 'description' => t('A basic profile that members can use to share information about themselves.'), 25 | 'has_title' => '1', 26 | 'title_label' => t('Name'), 27 | 'has_body' => '0', 28 | 'body_label' => '', 29 | 'min_word_count' => '0', 30 | 'help' => '', 31 | ), 32 | ); 33 | return $items; 34 | } 35 | 36 | /** 37 | * Implementation of hook_views_api(). 38 | */ 39 | function atrium_profile_views_api() { 40 | return array( 41 | 'api' => '2', 42 | ); 43 | } 44 | -------------------------------------------------------------------------------- /atrium_profile/atrium_profile.features.user_permission.inc: -------------------------------------------------------------------------------- 1 | 'create profile content', 12 | 'roles' => array( 13 | '0' => 'administrator', 14 | '1' => 'authenticated user', 15 | '2' => 'manager', 16 | ), 17 | ); 18 | 19 | // Exported permission: delete own profile content 20 | $permissions['delete own profile content'] = array( 21 | 'name' => 'delete own profile content', 22 | 'roles' => array( 23 | '0' => 'administrator', 24 | '1' => 'authenticated user', 25 | '2' => 'manager', 26 | ), 27 | ); 28 | 29 | // Exported permission: edit own profile content 30 | $permissions['edit own profile content'] = array( 31 | 'name' => 'edit own profile content', 32 | 'roles' => array( 33 | '0' => 'administrator', 34 | '1' => 'authenticated user', 35 | '2' => 'manager', 36 | ), 37 | ); 38 | 39 | return $permissions; 40 | } 41 | -------------------------------------------------------------------------------- /atrium_profile/atrium_profile.info: -------------------------------------------------------------------------------- 1 | name = "Atrium Profile" 2 | description = "A profile lets you share personal information about yourself with your team." 3 | core = "6.x" 4 | package = "Atrium" 5 | dependencies[] = "content_profile" 6 | dependencies[] = "context" 7 | dependencies[] = "features" 8 | dependencies[] = "strongarm" 9 | dependencies[] = "text" 10 | dependencies[] = "views" 11 | features[content][] = "profile-field_profile_address" 12 | features[content][] = "profile-field_profile_organization" 13 | features[content][] = "profile-field_profile_telephone" 14 | features[content][] = "profile-field_profile_url" 15 | features[ctools][] = "context:context:3" 16 | features[ctools][] = "strongarm:strongarm:1" 17 | features[node][] = "profile" 18 | features[user_permission][] = "create profile content" 19 | features[user_permission][] = "delete own profile content" 20 | features[user_permission][] = "edit own profile content" 21 | features[variable][] = "atrium_activity_update_type_profile" 22 | features[variable][] = "comment_profile" 23 | features[variable][] = "content_profile_profile" 24 | features[variable][] = "content_profile_use_profile" 25 | features[variable][] = "node_options_profile" 26 | features[variable][] = "nodeformscols_field_placements_profile_default" 27 | features[variable][] = "notifications_content_type_profile" 28 | features[variable][] = "show_diff_inline_profile" 29 | features[variable][] = "show_preview_changes_profile" 30 | features[variable][] = "upload_profile" 31 | features[views][] = "profile_display" 32 | features[views_api][] = "api:2" 33 | kitf = "1.0-draft" 34 | -------------------------------------------------------------------------------- /atrium_profile/atrium_profile.install: -------------------------------------------------------------------------------- 1 | array( 9 | 'atrium_profile' => array( 10 | 'profile_listing' => array(), // No blocks 11 | ), 12 | 'atrium_profile_blocks' => array( 13 | 'activity_listing' => array( 14 | 'block_1' => array( 15 | 'module' => 'views', 16 | 'delta' => 'block_3', 17 | ), 18 | ), 19 | 'groups_listing' => array( 20 | 'block_2' => array( 21 | 'module' => 'views', 22 | 'delta' => 'block_1', 23 | ), 24 | ) 25 | ), 26 | ), 27 | ); 28 | 29 | module_load_include('inc', 'atrium', 'includes/atrium_update_kit'); 30 | atrium_kit_comply_presets($components); 31 | atrium_kit_comply_overrides($components); 32 | 33 | return array(array('success' => true, 'query' => 'Atrium Profile updated for Kit compliance.')); 34 | } -------------------------------------------------------------------------------- /atrium_profile/atrium_profile.module: -------------------------------------------------------------------------------- 1 | name == 'profile_display') { 30 | // Forcefully set the user page context condition. 31 | // @TODO: Try to refactor this as to not require this hack. 32 | if ($view->current_display === 'page_1' && isset($view->args[0]) && $account = user_load($view->args[0])) { 33 | $edit = array(); 34 | context_user('view', $edit, $account); 35 | } 36 | // Remove email display if site is in public mode. 37 | if (variable_get('user_register', 0)) { 38 | $fields = $view->display_handler->get_option('fields'); 39 | if (isset($fields['mail'])) { 40 | unset($fields['mail']); 41 | $view->display_handler->set_option('fields', $fields); 42 | } 43 | } 44 | } 45 | } 46 | 47 | /** 48 | * Implementation of hook_context_links_alter(). 49 | */ 50 | function atrium_profile_context_links_alter(&$links) { 51 | global $user; 52 | if (module_exists('spaces') && ($space = spaces_get_space()) 53 | && $space->type == 'user' && $space->id == $user->uid && node_access('create', 'profile')) { 54 | $prepend = array( 55 | 'profile' => array( 56 | 'title' => t('Edit my profile'), 57 | 'href' => "user/{$space->id}/edit/profile", 58 | 'custom' => TRUE, 59 | ), 60 | ); 61 | $links = $prepend + $links; 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /atrium_profile/atrium_profile.profile_migration.inc: -------------------------------------------------------------------------------- 1 | uid; 11 | $account = user_load(array('uid' => $uid)); 12 | 13 | if ($account) { 14 | // Gather existing profile field content 15 | $pfields = array(); 16 | profile_load_profile($account); 17 | foreach ($account as $k => $v) { 18 | if (strpos($k, 'profile_') === 0) { 19 | $pfields[$k] = $v; 20 | } 21 | } 22 | 23 | // Gather available cck profile fields 24 | $info = _content_type_info(); 25 | $cckfields = $info['content types']['profile']['fields']; 26 | 27 | // Try to get an existing profile node. If none, create a new node. 28 | $node = node_load(array('type' => 'profile', 'uid' => $uid)); 29 | if (!$node) { 30 | $node = new StdClass(); 31 | $node->status = 1; 32 | $node->type = 'profile'; 33 | $node->uid = $uid; 34 | } 35 | 36 | // Set profile title 37 | if (!empty($pfields['profile_givenname']) || !empty($pfields['profile_familyname'])) { 38 | $node->title = trim($pfields['profile_givenname']) ." ". trim($pfields['profile_familyname']); 39 | } 40 | else { 41 | $node->title = $account->name; 42 | } 43 | 44 | // Set profile address 45 | if (!empty($pfields['profile_street']) && !empty($cckfields['field_profile_address'])) { 46 | $address = array(); 47 | $address[] = $pfields['profile_street']; 48 | $line2 = array($pfields['profile_city'], $pfields['profile_province'], $pfields['profile_postal']); 49 | foreach ($line2 as $k => $v) { 50 | if (empty($v)) { 51 | unset($line2[$k]); 52 | } 53 | } 54 | if (!empty($line2)) { 55 | $address[] = implode(', ', $line2); 56 | } 57 | if (!empty($pfields['profile_country'])) { 58 | $address[] = $pfields['profile_country']; 59 | } 60 | $node->field_profile_address = array( 61 | array('value' => implode("\n", $address)), 62 | ); 63 | } 64 | 65 | // Straight mapping for the rest 66 | foreach ($pfields as $k => $v) { 67 | if (!empty($cckfields["field_{$k}"])) { 68 | $fieldname = "field_{$k}"; 69 | $node->{$fieldname} = array( 70 | array('value' => $v), 71 | ); 72 | } 73 | } 74 | 75 | node_save($node); 76 | drupal_set_message(t("Migrated profile for user !username", array('!username' => $account->name))); 77 | } 78 | } 79 | module_disable(array('profile')); 80 | drupal_uninstall_module('profile'); 81 | } 82 | -------------------------------------------------------------------------------- /atrium_profile/atrium_profile.strongarm.inc: -------------------------------------------------------------------------------- 1 | disabled = FALSE; /* Edit this to true to make a default strongarm disabled initially */ 11 | $strongarm->api_version = 1; 12 | $strongarm->name = 'atrium_activity_update_type_profile'; 13 | $strongarm->value = FALSE; 14 | $export['atrium_activity_update_type_profile'] = $strongarm; 15 | 16 | $strongarm = new stdClass; 17 | $strongarm->disabled = FALSE; /* Edit this to true to make a default strongarm disabled initially */ 18 | $strongarm->api_version = 1; 19 | $strongarm->name = 'comment_profile'; 20 | $strongarm->value = 0; 21 | $export['comment_profile'] = $strongarm; 22 | 23 | $strongarm = new stdClass; 24 | $strongarm->disabled = FALSE; /* Edit this to true to make a default strongarm disabled initially */ 25 | $strongarm->api_version = 1; 26 | $strongarm->name = 'content_profile_profile'; 27 | $strongarm->value = array(); 28 | $export['content_profile_profile'] = $strongarm; 29 | 30 | $strongarm = new stdClass; 31 | $strongarm->disabled = FALSE; /* Edit this to true to make a default strongarm disabled initially */ 32 | $strongarm->api_version = 1; 33 | $strongarm->name = 'content_profile_use_profile'; 34 | $strongarm->value = 1; 35 | $export['content_profile_use_profile'] = $strongarm; 36 | 37 | $strongarm = new stdClass; 38 | $strongarm->disabled = FALSE; /* Edit this to true to make a default strongarm disabled initially */ 39 | $strongarm->api_version = 1; 40 | $strongarm->name = 'nodeformscols_field_placements_profile_default'; 41 | $strongarm->value = array( 42 | 'title' => array( 43 | 'region' => 'main', 44 | 'weight' => '-5', 45 | 'has_required' => TRUE, 46 | 'title' => 'Name', 47 | ), 48 | 'menu' => array( 49 | 'region' => 'right', 50 | 'weight' => '1', 51 | 'has_required' => FALSE, 52 | 'title' => 'Menu settings', 53 | 'collapsed' => 1, 54 | 'hidden' => 1, 55 | ), 56 | 'revision_information' => array( 57 | 'region' => 'right', 58 | 'weight' => '3', 59 | 'has_required' => FALSE, 60 | 'title' => 'Revision information', 61 | 'collapsed' => 1, 62 | 'hidden' => 1, 63 | ), 64 | 'comment_settings' => array( 65 | 'region' => 'right', 66 | 'weight' => '5', 67 | 'has_required' => FALSE, 68 | 'title' => 'Comment settings', 69 | 'collapsed' => 1, 70 | 'hidden' => 1, 71 | ), 72 | 'options' => array( 73 | 'region' => 'right', 74 | 'weight' => '4', 75 | 'has_required' => FALSE, 76 | 'title' => 'Publishing options', 77 | 'collapsed' => 1, 78 | 'hidden' => 1, 79 | ), 80 | 'author' => array( 81 | 'region' => 'right', 82 | 'weight' => '2', 83 | 'has_required' => FALSE, 84 | 'title' => 'Authoring information', 85 | 'collapsed' => 1, 86 | 'hidden' => 1, 87 | ), 88 | 'buttons' => array( 89 | 'region' => 'main', 90 | 'weight' => '100', 91 | 'has_required' => FALSE, 92 | 'title' => NULL, 93 | 'hidden' => 0, 94 | ), 95 | 'book' => array( 96 | 'region' => 'right', 97 | 'weight' => '0', 98 | 'has_required' => FALSE, 99 | 'title' => 'Book outline', 100 | 'collapsed' => 1, 101 | 'hidden' => 1, 102 | ), 103 | 'field_profile_organization' => array( 104 | 'region' => 'main', 105 | 'weight' => '0', 106 | 'has_required' => FALSE, 107 | 'title' => 'Organization', 108 | 'hidden' => 0, 109 | ), 110 | 'field_profile_telephone' => array( 111 | 'region' => 'main', 112 | 'weight' => '0', 113 | 'has_required' => FALSE, 114 | 'title' => 'Telephone', 115 | 'hidden' => 0, 116 | ), 117 | 'field_profile_url' => array( 118 | 'region' => 'main', 119 | 'weight' => '9', 120 | 'has_required' => FALSE, 121 | 'title' => 'URL', 122 | 'hidden' => 0, 123 | ), 124 | 'field_profile_address' => array( 125 | 'region' => 'main', 126 | 'weight' => '10', 127 | 'has_required' => FALSE, 128 | 'title' => 'Address', 129 | 'hidden' => 0, 130 | ), 131 | ); 132 | $export['nodeformscols_field_placements_profile_default'] = $strongarm; 133 | 134 | $strongarm = new stdClass; 135 | $strongarm->disabled = FALSE; /* Edit this to true to make a default strongarm disabled initially */ 136 | $strongarm->api_version = 1; 137 | $strongarm->name = 'node_options_profile'; 138 | $strongarm->value = array( 139 | 0 => 'status', 140 | ); 141 | $export['node_options_profile'] = $strongarm; 142 | 143 | $strongarm = new stdClass; 144 | $strongarm->disabled = FALSE; /* Edit this to true to make a default strongarm disabled initially */ 145 | $strongarm->api_version = 1; 146 | $strongarm->name = 'notifications_content_type_profile'; 147 | $strongarm->value = array(); 148 | $export['notifications_content_type_profile'] = $strongarm; 149 | 150 | $strongarm = new stdClass; 151 | $strongarm->disabled = FALSE; /* Edit this to true to make a default strongarm disabled initially */ 152 | $strongarm->api_version = 1; 153 | $strongarm->name = 'show_diff_inline_profile'; 154 | $strongarm->value = FALSE; 155 | $export['show_diff_inline_profile'] = $strongarm; 156 | 157 | $strongarm = new stdClass; 158 | $strongarm->disabled = FALSE; /* Edit this to true to make a default strongarm disabled initially */ 159 | $strongarm->api_version = 1; 160 | $strongarm->name = 'show_preview_changes_profile'; 161 | $strongarm->value = FALSE; 162 | $export['show_preview_changes_profile'] = $strongarm; 163 | 164 | $strongarm = new stdClass; 165 | $strongarm->disabled = FALSE; /* Edit this to true to make a default strongarm disabled initially */ 166 | $strongarm->api_version = 1; 167 | $strongarm->name = 'upload_profile'; 168 | $strongarm->value = FALSE; 169 | $export['upload_profile'] = $strongarm; 170 | 171 | return $export; 172 | } 173 | -------------------------------------------------------------------------------- /atrium_reader/README.txt: -------------------------------------------------------------------------------- 1 | Atrium Reader 2 | ------------- 3 | 4 | Atrium Reader is a simple RSS/Atom feed reader for Open Atrium. Atrium Reader 5 | requires Open Atrium 1.0-beta4 or greater. -------------------------------------------------------------------------------- /atrium_reader/atrium_reader.context.inc: -------------------------------------------------------------------------------- 1 | disabled = FALSE; /* Edit this to true to make a default context disabled initially */ 11 | $context->api_version = 3; 12 | $context->name = 'atrium_reader'; 13 | $context->description = 'Featurewide context for Atrium Reader.'; 14 | $context->tag = 'atrium_reader'; 15 | $context->conditions = array( 16 | 'node' => array( 17 | 'values' => array( 18 | 'feed_reader' => 'feed_reader', 19 | ), 20 | 'options' => array( 21 | 'node_form' => '1', 22 | ), 23 | ), 24 | 'path' => array( 25 | 'values' => array( 26 | 'reader' => 'reader', 27 | 'reader/*' => 'reader/*', 28 | ), 29 | ), 30 | 'views' => array( 31 | 'values' => array( 32 | 'feed_reader_listing' => 'feed_reader_listing', 33 | ), 34 | ), 35 | ); 36 | $context->reactions = array( 37 | 'menu' => 'reader', 38 | ); 39 | $context->condition_mode = 0; 40 | 41 | // Translatables 42 | // Included for use with string extractors like potx. 43 | t('Featurewide context for Atrium Reader.'); 44 | t('atrium_reader'); 45 | $export['atrium_reader'] = $context; 46 | 47 | $context = new stdClass; 48 | $context->disabled = FALSE; /* Edit this to true to make a default context disabled initially */ 49 | $context->api_version = 3; 50 | $context->name = 'atrium_reader_listing'; 51 | $context->description = 'Single feed item listing page within the reader.'; 52 | $context->tag = 'atrium_reader'; 53 | $context->conditions = array( 54 | 'node' => array( 55 | 'values' => array( 56 | 'feed_reader' => 'feed_reader', 57 | ), 58 | 'options' => array( 59 | 'node_form' => '0', 60 | ), 61 | ), 62 | 'views' => array( 63 | 'values' => array( 64 | 'feed_reader_listing:page_1' => 'feed_reader_listing:page_1', 65 | 'feed_reader_listing:page_2' => 'feed_reader_listing:page_2', 66 | 'feed_reader_listing:page_3' => 'feed_reader_listing:page_3', 67 | ), 68 | ), 69 | ); 70 | $context->reactions = array( 71 | 'block' => array( 72 | 'blocks' => array( 73 | 'views-feed_reader_feeds-block_1' => array( 74 | 'module' => 'views', 75 | 'delta' => 'feed_reader_feeds-block_1', 76 | 'region' => 'right', 77 | 'weight' => 0, 78 | ), 79 | ), 80 | ), 81 | ); 82 | $context->condition_mode = 0; 83 | 84 | // Translatables 85 | // Included for use with string extractors like potx. 86 | t('Single feed item listing page within the reader.'); 87 | t('atrium_reader'); 88 | $export['atrium_reader_listing'] = $context; 89 | 90 | return $export; 91 | } 92 | -------------------------------------------------------------------------------- /atrium_reader/atrium_reader.css: -------------------------------------------------------------------------------- 1 | /** 2 | * Menu icon ========================================================== 3 | */ 4 | #features-menu li a.icon-reader span.icon { background:url(images/icon.png) no-repeat; } 5 | 6 | /* 'body' is here simply to make this more specific than the theme rule which comes after it. */ 7 | body span.feature-atrium_reader { background:url(images/icon.png) 0px -40px no-repeat; } 8 | 9 | /** 10 | * News tab =========================================================== 11 | */ 12 | div.view-atrium-reader-blocks .item-list .related-title, 13 | div.view-atrium-reader-blocks .item-list .author, 14 | div.view-atrium-reader .item-list .author, 15 | div.view-atrium-reader .item-list .related-title { 16 | font-size:11px; 17 | font-weight:bold; 18 | } 19 | 20 | div.view-atrium-reader .item-list li { 21 | padding-top:10px; 22 | padding-bottom:9px; 23 | } 24 | 25 | div.view-atrium-reader .item-list .description { font-size:13px; } 26 | 27 | body.page-reader .view-display-id-page_3 .description, /* Twitter page */ 28 | div.view-atrium-reader .item-list .title { 29 | font-size:16px; 30 | line-height:20px; 31 | } 32 | 33 | /** 34 | * Images tab ========================================================= 35 | */ 36 | div.view-atrium-reader table.views-view-grid td { border:1px solid #fff; } 37 | 38 | div.view-atrium-reader table.views-view-grid div.title { 39 | font-size:11px; 40 | font-weight:normal; 41 | } 42 | 43 | div.view-atrium-reader table.views-view-grid .description { 44 | height:100px; 45 | overflow:hidden; 46 | } 47 | 48 | div.view-atrium-reader table.views-view-grid img { 49 | display:block; 50 | margin:0px auto; 51 | width:100px; 52 | height:auto; 53 | } 54 | 55 | div.view-atrium-reader-blocks table.views.view-grid td { padding:0px 5px; } 56 | 57 | div.view-atrium-reader-blocks div.grid-item .description { 58 | height:40px; 59 | overflow:hidden; 60 | } 61 | 62 | div.view-atrium-reader-blocks img { 63 | display:block; 64 | margin:0px auto; 65 | width:50px; 66 | height:auto; 67 | } 68 | -------------------------------------------------------------------------------- /atrium_reader/atrium_reader.data_default.inc: -------------------------------------------------------------------------------- 1 | disabled = FALSE; /* Edit this to true to make a default data_table disabled initially */ 11 | $data_table->api_version = 1; 12 | $data_table->title = 'Reader feed'; 13 | $data_table->name = 'feeds_data_feed_reader'; 14 | $data_table->table_schema = array( 15 | 'fields' => array( 16 | 'feed_nid' => array( 17 | 'type' => 'int', 18 | 'size' => 'normal', 19 | 'unsigned' => TRUE, 20 | 'not null' => TRUE, 21 | ), 22 | 'id' => array( 23 | 'type' => 'serial', 24 | 'size' => 'normal', 25 | 'unsigned' => TRUE, 26 | 'not null' => TRUE, 27 | ), 28 | 'timestamp' => array( 29 | 'type' => 'int', 30 | 'unsigned' => TRUE, 31 | 'not null' => FALSE, 32 | ), 33 | 'title' => array( 34 | 'type' => 'varchar', 35 | 'size' => 'normal', 36 | 'length' => '255', 37 | 'not null' => FALSE, 38 | ), 39 | 'description' => array( 40 | 'type' => 'text', 41 | 'size' => 'normal', 42 | 'not null' => FALSE, 43 | ), 44 | 'options_original_url' => array( 45 | 'type' => 'text', 46 | 'size' => 'normal', 47 | 'not null' => FALSE, 48 | ), 49 | 'options_raw_guid' => array( 50 | 'type' => 'text', 51 | 'size' => 'normal', 52 | 'not null' => FALSE, 53 | ), 54 | 'author' => array( 55 | 'type' => 'text', 56 | 'size' => 'normal', 57 | ), 58 | ), 59 | 'name' => 'feeds_data_feed_reader', 60 | 'indexes' => array( 61 | 'feed_nid' => array( 62 | 0 => 'feed_nid', 63 | ), 64 | 'id' => array( 65 | 0 => 'id', 66 | ), 67 | 'timestamp' => array( 68 | 0 => 'timestamp', 69 | ), 70 | 'options_original_url' => array( 71 | 0 => array( 72 | 0 => 'options_original_url', 73 | 1 => 255, 74 | ), 75 | ), 76 | 'options_raw_guid' => array( 77 | 0 => array( 78 | 0 => 'options_raw_guid', 79 | 1 => 255, 80 | ), 81 | ), 82 | ), 83 | 'primary key' => array( 84 | 0 => 'id', 85 | ), 86 | ); 87 | $data_table->meta = array( 88 | 'join' => array( 89 | 'node' => array( 90 | 'left_field' => 'nid', 91 | 'field' => 'feed_nid', 92 | 'inner_join' => TRUE, 93 | ), 94 | ), 95 | 'fields' => array( 96 | 'feed_nid' => array( 97 | 'label' => '', 98 | 'search' => 0, 99 | 'views_field_handler' => 'views_handler_field_numeric', 100 | 'views_filter_handler' => 'views_handler_filter_numeric', 101 | 'views_argument_handler' => 'views_handler_argument_numeric', 102 | 'views_sort_handler' => 'views_handler_sort', 103 | ), 104 | 'id' => array( 105 | 'label' => '', 106 | 'search' => 0, 107 | 'views_field_handler' => 'views_handler_field_numeric', 108 | 'views_filter_handler' => 'views_handler_filter_numeric', 109 | 'views_argument_handler' => 'views_handler_argument_numeric', 110 | 'views_sort_handler' => 'views_handler_sort', 111 | ), 112 | 'timestamp' => array( 113 | 'label' => '', 114 | 'views_field_handler' => 'views_handler_field_date', 115 | 'views_filter_handler' => 'views_handler_filter_date', 116 | 'views_argument_handler' => 'views_handler_argument_date', 117 | 'views_sort_handler' => 'views_handler_sort_date', 118 | ), 119 | 'title' => array( 120 | 'label' => '', 121 | 'search' => 1, 122 | 'views_field_handler' => 'atrium_reader_handler_field_title', 123 | 'views_filter_handler' => 'views_handler_filter_string', 124 | 'views_argument_handler' => 'views_handler_argument', 125 | 'views_sort_handler' => 'views_handler_sort', 126 | ), 127 | 'description' => array( 128 | 'label' => '', 129 | 'search' => 1, 130 | 'views_field_handler' => 'atrium_reader_handler_field_description', 131 | 'views_filter_handler' => 'views_handler_filter_string', 132 | 'views_argument_handler' => 'views_handler_argument', 133 | 'views_sort_handler' => 'views_handler_sort', 134 | ), 135 | 'options_original_url' => array( 136 | 'label' => '', 137 | 'search' => 0, 138 | 'views_field_handler' => 'views_handler_field', 139 | 'views_filter_handler' => 'views_handler_filter_string', 140 | 'views_argument_handler' => 'views_handler_argument', 141 | 'views_sort_handler' => 'views_handler_sort', 142 | ), 143 | 'options_raw_guid' => array( 144 | 'label' => '', 145 | 'search' => 0, 146 | 'views_field_handler' => 'views_handler_field', 147 | 'views_filter_handler' => 'views_handler_filter_string', 148 | 'views_argument_handler' => 'views_handler_argument', 149 | 'views_sort_handler' => 'views_handler_sort', 150 | ), 151 | 'author' => array( 152 | 'label' => '', 153 | 'views_field_handler' => 'views_handler_field', 154 | 'views_filter_handler' => 'views_handler_filter_string', 155 | 'views_argument_handler' => 'views_handler_argument', 156 | 'views_sort_handler' => 'views_handler_sort', 157 | ), 158 | ), 159 | ); 160 | $export['feeds_data_feed_reader'] = $data_table; 161 | 162 | return $export; 163 | } 164 | -------------------------------------------------------------------------------- /atrium_reader/atrium_reader.features.content.inc: -------------------------------------------------------------------------------- 1 | 'field_reader_feedtype', 12 | 'type_name' => 'feed_reader', 13 | 'display_settings' => array( 14 | 'weight' => '-4', 15 | 'parent' => '', 16 | 'label' => array( 17 | 'format' => 'inline', 18 | ), 19 | 'teaser' => array( 20 | 'format' => 'default', 21 | 'exclude' => 0, 22 | ), 23 | 'full' => array( 24 | 'format' => 'default', 25 | 'exclude' => 0, 26 | ), 27 | '4' => array( 28 | 'format' => 'default', 29 | 'exclude' => 0, 30 | ), 31 | '2' => array( 32 | 'format' => 'default', 33 | 'exclude' => 0, 34 | ), 35 | '3' => array( 36 | 'format' => 'default', 37 | 'exclude' => 0, 38 | ), 39 | 'token' => array( 40 | 'format' => 'default', 41 | 'exclude' => 0, 42 | ), 43 | ), 44 | 'widget_active' => '1', 45 | 'type' => 'text', 46 | 'required' => '1', 47 | 'multiple' => '0', 48 | 'module' => 'text', 49 | 'active' => '1', 50 | 'text_processing' => '0', 51 | 'max_length' => '', 52 | 'allowed_values' => '', 53 | 'allowed_values_php' => 'if (function_exists(\'atrium_reader_get_types\')) { return atrium_reader_get_types(); }', 54 | 'widget' => array( 55 | 'default_value' => array( 56 | '0' => array( 57 | 'value' => '', 58 | ), 59 | ), 60 | 'default_value_php' => NULL, 61 | 'label' => 'Type', 62 | 'weight' => '-4', 63 | 'description' => '', 64 | 'type' => 'optionwidgets_select', 65 | 'module' => 'optionwidgets', 66 | ), 67 | ); 68 | 69 | // Translatables 70 | // Included for use with string extractors like potx. 71 | t('Type'); 72 | 73 | return $fields; 74 | } 75 | -------------------------------------------------------------------------------- /atrium_reader/atrium_reader.features.inc: -------------------------------------------------------------------------------- 1 | 3); 10 | } 11 | elseif ($module == "data" && $api == "data_default") { 12 | return array("version" => 1); 13 | } 14 | elseif ($module == "feeds" && $api == "feeds_importer_default") { 15 | return array("version" => 1); 16 | } 17 | elseif ($module == "strongarm" && $api == "strongarm") { 18 | return array("version" => 1); 19 | } 20 | } 21 | 22 | /** 23 | * Implementation of hook_node_info(). 24 | */ 25 | function atrium_reader_node_info() { 26 | $items = array( 27 | 'feed_reader' => array( 28 | 'name' => t('Reader feed'), 29 | 'module' => 'features', 30 | 'description' => '', 31 | 'has_title' => '1', 32 | 'title_label' => t('Title'), 33 | 'has_body' => '0', 34 | 'body_label' => '', 35 | 'min_word_count' => '0', 36 | 'help' => '', 37 | ), 38 | ); 39 | return $items; 40 | } 41 | 42 | /** 43 | * Implementation of hook_views_api(). 44 | */ 45 | function atrium_reader_views_api() { 46 | return array( 47 | 'api' => '2', 48 | ); 49 | } 50 | -------------------------------------------------------------------------------- /atrium_reader/atrium_reader.features.menu_links.inc: -------------------------------------------------------------------------------- 1 | 'features', 12 | 'link_path' => 'reader', 13 | 'router_path' => 'reader', 14 | 'link_title' => 'Feed Reader', 15 | 'options' => array(), 16 | 'module' => 'system', 17 | 'hidden' => '0', 18 | 'external' => '0', 19 | 'has_children' => '0', 20 | 'expanded' => '0', 21 | 'weight' => '0', 22 | ); 23 | // Translatables 24 | // Included for use with string extractors like potx. 25 | t('Feed Reader'); 26 | 27 | 28 | return $menu_links; 29 | } 30 | -------------------------------------------------------------------------------- /atrium_reader/atrium_reader.features.user_permission.inc: -------------------------------------------------------------------------------- 1 | 'create feed_reader content', 12 | 'roles' => array( 13 | '0' => 'authenticated user', 14 | '1' => 'manager', 15 | ), 16 | ); 17 | 18 | // Exported permission: delete own feed_reader content 19 | $permissions['delete own feed_reader content'] = array( 20 | 'name' => 'delete own feed_reader content', 21 | 'roles' => array( 22 | '0' => 'authenticated user', 23 | '1' => 'manager', 24 | ), 25 | ); 26 | 27 | // Exported permission: edit own feed_reader content 28 | $permissions['edit own feed_reader content'] = array( 29 | 'name' => 'edit own feed_reader content', 30 | 'roles' => array( 31 | '0' => 'authenticated user', 32 | '1' => 'manager', 33 | ), 34 | ); 35 | 36 | return $permissions; 37 | } 38 | -------------------------------------------------------------------------------- /atrium_reader/atrium_reader.feeds_importer_default.inc: -------------------------------------------------------------------------------- 1 | disabled = FALSE; /* Edit this to true to make a default feeds_importer disabled initially */ 11 | $feeds_importer->api_version = 1; 12 | $feeds_importer->id = 'feed_reader'; 13 | $feeds_importer->config = array( 14 | 'name' => 'Reader feed', 15 | 'description' => 'Feed configuration for reader feeds.', 16 | 'fetcher' => array( 17 | 'plugin_key' => 'FeedsHTTPFetcher', 18 | 'config' => array( 19 | 'auto_detect_feeds' => FALSE, 20 | ), 21 | ), 22 | 'parser' => array( 23 | 'plugin_key' => 'FeedsSyndicationParser', 24 | 'config' => array(), 25 | ), 26 | 'processor' => array( 27 | 'plugin_key' => 'FeedsDataProcessor', 28 | 'config' => array( 29 | 'update_existing' => 1, 30 | 'expire' => '7257600', 31 | 'mappings' => array( 32 | 0 => array( 33 | 'source' => 'title', 34 | 'target' => 'title', 35 | 'unique' => 0, 36 | ), 37 | 1 => array( 38 | 'source' => 'description', 39 | 'target' => 'description', 40 | 'unique' => 0, 41 | ), 42 | 2 => array( 43 | 'source' => 'author_name', 44 | 'target' => 'author', 45 | 'unique' => 0, 46 | ), 47 | 3 => array( 48 | 'source' => 'guid', 49 | 'target' => 'options_raw_guid', 50 | 'unique' => 1, 51 | ), 52 | 4 => array( 53 | 'source' => 'url', 54 | 'target' => 'options_original_url', 55 | 'unique' => 1, 56 | ), 57 | 5 => array( 58 | 'source' => 'timestamp', 59 | 'target' => 'timestamp', 60 | 'unique' => 0, 61 | ), 62 | ), 63 | ), 64 | ), 65 | 'content_type' => 'feed_reader', 66 | 'update' => 0, 67 | 'import_period' => '1800', 68 | 'expire_period' => 3600, 69 | 'import_on_create' => 1, 70 | ); 71 | $export['feed_reader'] = $feeds_importer; 72 | 73 | return $export; 74 | } 75 | -------------------------------------------------------------------------------- /atrium_reader/atrium_reader.info: -------------------------------------------------------------------------------- 1 | name = "Atrium Reader" 2 | description = "The reader lets your share news, image and twitter feeds with your team." 3 | core = "6.x" 4 | package = "Features" 5 | project = "atrium_reader" 6 | dependencies[] = "context" 7 | dependencies[] = "data" 8 | dependencies[] = "feeds" 9 | dependencies[] = "menu" 10 | dependencies[] = "optionwidgets" 11 | dependencies[] = "spaces" 12 | dependencies[] = "strongarm" 13 | dependencies[] = "text" 14 | dependencies[] = "views" 15 | features[content][] = "feed_reader-field_reader_feedtype" 16 | features[context][] = "atrium_reader" 17 | features[context][] = "atrium_reader_listing" 18 | features[ctools][] = "context:context:3" 19 | features[ctools][] = "data:data_default:1" 20 | features[ctools][] = "feeds:feeds_importer_default:1" 21 | features[ctools][] = "strongarm:strongarm:1" 22 | features[data_tables][] = "feeds_data_feed_reader" 23 | features[feeds_importer][] = "feed_reader" 24 | features[menu_links][] = "features:reader" 25 | features[node][] = "feed_reader" 26 | features[user_permission][] = "create feed_reader content" 27 | features[user_permission][] = "delete own feed_reader content" 28 | features[user_permission][] = "edit own feed_reader content" 29 | features[variable][] = "comment_feed_reader" 30 | features[variable][] = "node_options_feed_reader" 31 | features[variable][] = "og_content_type_usage_feed_reader" 32 | features[views][] = "feed_reader_blocks" 33 | features[views][] = "feed_reader_feeds" 34 | features[views][] = "feed_reader_listing" 35 | features[views_api][] = "api:2" 36 | spaces[types][] = "og" 37 | -------------------------------------------------------------------------------- /atrium_reader/atrium_reader.install: -------------------------------------------------------------------------------- 1 | $table) { 26 | $schema[$name] = $table->table_schema; 27 | } 28 | return $schema; 29 | } 30 | -------------------------------------------------------------------------------- /atrium_reader/atrium_reader.module: -------------------------------------------------------------------------------- 1 | TRUE)); 14 | $rss_link = l(t('RSS'), 'http://en.wikipedia.org/wiki/RSS', array('absolute' => TRUE)); 15 | $help = ''; 16 | $help .= '

'. t('Reader') .'

'; 17 | $help .= '

'. t('Tips for adding and editing feeds:') .'

'; 18 | $help .= '
    '; 19 | $help .= '
  • '. t('Add the title of your feed. You can leave it blank to use the default title provided by the feed itself.') .'
  • '; 20 | $help .= '
  • '. t('Enter the URL of the !atom or !rss feed you would like to subscribe to.', array('!atom' => $atom_link, '!rss' => $rss_link)) .'
  • '; 21 | $help .= '
'; 22 | return $help; 23 | 24 | case 'help#atrium_reader': 25 | default: 26 | $help = ''; 27 | $help .= '

'. t('Reader') .'

'; 28 | $help .= '

'. t('The Reader gives you a way to subscribe to news in your groups and share stories with your team members. You can add news, image and twitter feeds to each group.') .'

'; 29 | return $help; 30 | } 31 | } 32 | } 33 | 34 | /** 35 | * Implementation of hook_init(). 36 | */ 37 | function atrium_reader_init() { 38 | drupal_add_css(drupal_get_path('module', 'atrium_reader') .'/atrium_reader.css'); 39 | } 40 | 41 | /** 42 | * Returns valid feed type options for reader feeds. 43 | */ 44 | function atrium_reader_get_types() { 45 | $options = array(); 46 | if ($view = views_get_view('feed_reader_listing')) { 47 | $view->build(); 48 | foreach ($view->display as $display_id => $display) { 49 | if ($display_id != 'default' && !preg_match('/^block_/', $display_id)) { 50 | $options[$display->display_title] = $display->handler->get_option('title'); 51 | } 52 | } 53 | } 54 | return $options; 55 | } 56 | 57 | /** 58 | * Implementation of hook_nodeapi(). 59 | */ 60 | function atrium_reader_nodeapi(&$node, $op, $a3 = NULL, $a4 = NULL) { 61 | if ($op == 'view' && $node->type == 'feed_reader' && menu_get_object() === $node) { 62 | $type = !empty($node->field_reader_feedtype[0]['value']) ? $node->field_reader_feedtype[0]['value'] : 'news'; 63 | drupal_goto("reader/{$type}/{$node->nid}"); 64 | } 65 | } 66 | 67 | /** 68 | * Implementation of hook_data_views_handlers_alter(). 69 | */ 70 | function atrium_reader_data_views_handlers_alter(&$handlers) { 71 | $handlers['field']['atrium_reader_handler_field_description'] = 'atrium_reader_handler_field_description'; 72 | $handlers['field']['atrium_reader_handler_field_title'] = 'atrium_reader_handler_field_title'; 73 | } 74 | 75 | /** 76 | * Implementation of hook_views_plugins(). 77 | */ 78 | function atrium_reader_views_plugins() { 79 | return array( 80 | 'module' => 'atrium_reader', 81 | 'access' => array( 82 | 'atrium_reader' => array( 83 | 'title' => t('Reader feed'), 84 | 'help' => t('Access will be granted based on mystery magic feed logic.'), 85 | 'handler' => 'atrium_reader_plugin_access', 86 | 'path' => drupal_get_path('module', 'atrium_reader') .'/views', 87 | 'uses options' => TRUE, 88 | ), 89 | ), 90 | ); 91 | } 92 | 93 | /** 94 | * Implementation of hook_views_handlers(). 95 | */ 96 | function atrium_reader_views_handlers() { 97 | return array( 98 | 'info' => array('path' => drupal_get_path('module', 'atrium_reader') .'/views'), 99 | 'handlers' => array( 100 | 'atrium_reader_handler_field_description' => array( 101 | 'parent' => 'views_handler_field', 102 | ), 103 | 'atrium_reader_handler_field_title' => array( 104 | 'parent' => 'views_handler_field', 105 | ), 106 | ), 107 | ); 108 | } 109 | 110 | 111 | /** 112 | * Implementation of hook_enable(). 113 | */ 114 | function atrium_reader_enable() { 115 | //clear the cache to display in Feeds as available plugin. 116 | cache_clear_all('plugins:feeds:plugins', 'cache'); 117 | } 118 | -------------------------------------------------------------------------------- /atrium_reader/atrium_reader.strongarm.inc: -------------------------------------------------------------------------------- 1 | disabled = FALSE; /* Edit this to true to make a default strongarm disabled initially */ 11 | $strongarm->api_version = 1; 12 | $strongarm->name = 'comment_feed_reader'; 13 | $strongarm->value = '0'; 14 | $export['comment_feed_reader'] = $strongarm; 15 | 16 | $strongarm = new stdClass; 17 | $strongarm->disabled = FALSE; /* Edit this to true to make a default strongarm disabled initially */ 18 | $strongarm->api_version = 1; 19 | $strongarm->name = 'node_options_feed_reader'; 20 | $strongarm->value = array( 21 | 0 => 'status', 22 | ); 23 | $export['node_options_feed_reader'] = $strongarm; 24 | 25 | $strongarm = new stdClass; 26 | $strongarm->disabled = FALSE; /* Edit this to true to make a default strongarm disabled initially */ 27 | $strongarm->api_version = 1; 28 | $strongarm->name = 'og_content_type_usage_feed_reader'; 29 | $strongarm->value = 'group_post_standard'; 30 | $export['og_content_type_usage_feed_reader'] = $strongarm; 31 | 32 | return $export; 33 | } 34 | -------------------------------------------------------------------------------- /atrium_reader/images/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phase2/atrium_features/43c74d49146da4225076fe03e63d6cc3f0979311/atrium_reader/images/icon.png -------------------------------------------------------------------------------- /atrium_reader/views/atrium_reader_handler_field_description.inc: -------------------------------------------------------------------------------- 1 | 0); 11 | $options['filter_html'] = array('default' => 0); 12 | $options['allowed_tags'] = array('default' => ''); 13 | return $options; 14 | } 15 | 16 | /** 17 | * Provide options for linking the feed item title. 18 | */ 19 | function options_form(&$form, &$form_state) { 20 | parent::options_form($form, $form_state); 21 | $form['truncate'] = array( 22 | '#title' => t('Truncate text'), 23 | '#type' => 'textfield', 24 | '#description' => t('Enter the number of characters to truncate to below (includes HTML). Leave empty or 0 to show full text.'), 25 | '#default_value' => !empty($this->options['truncate']) ? $this->options['truncate'] : 0, 26 | ); 27 | $form['filter_html'] = array( 28 | '#title' => t('Filter content'), 29 | '#type' => 'select', 30 | '#options' => array( 31 | 0 => t('Don\'t filter content'), 32 | 'filter_html' => t('Allow some HTML tags'), 33 | 'strip_html' => t('Strip all HTML tags'), 34 | 'images' => t('Display images only'), 35 | 'twitter' => t('Twitter'), 36 | ), 37 | '#description' => t('Check this box if you would like to selectively filter HTML tags (dangerous tags will be stripped regardless of this setting).'), 38 | '#default_value' => !empty($this->options['filter_html']) ? $this->options['filter_html'] : 0, 39 | ); 40 | $form['allowed_tags'] = array( 41 | '#type' => 'textfield', 42 | '#desciprion' => t('Enter the tags you would like to allow. Leave blank to strip all tags. Example: a b p div ul.'), 43 | '#default_value' => !empty($this->options['allowed_tags']) ? $this->options['allowed_tags'] : '', 44 | '#process' => array('views_process_dependency'), 45 | '#dependency' => array( 46 | 'edit-options-filter-html' => array('filter_html'), 47 | ), 48 | ); 49 | } 50 | 51 | /** 52 | * Render the feed item field. 53 | */ 54 | function render($values) { 55 | // Note: FeedAPI has already filtered this on its way into the DB. See the feedapi_allowed_html_tags variable. 56 | // @TODO: make the filter format here more flexible -- some displays may want to strip out images, for example. 57 | $output = filter_xss_admin($values->{$this->field_alias}); 58 | 59 | if (!empty($this->options['truncate'])) { 60 | $output = truncate_utf8($output, $this->options['truncate'], TRUE, TRUE); 61 | } 62 | 63 | switch ($this->options['filter_html']) { 64 | case 'strip_html': 65 | return strip_tags($output); 66 | case 'filter_html': 67 | $tags = explode(' ', $this->options['allowed_tags']); 68 | $output = filter_xss($output, $tags); 69 | return _filter_htmlcorrector($output); 70 | case 'images': 71 | // Properly entify angles. 72 | $output = preg_replace('!<([^a-zA-Z/])!', '<\1', $output); 73 | 74 | // Grab the image tags 75 | $matches = array(); 76 | $output = preg_match('/]+?>/', $output, $matches); 77 | if (!empty($matches)) { 78 | return implode("", $matches); 79 | } 80 | return ''; 81 | case 'twitter': 82 | // Format twitter #, @ tags 83 | $output = strip_tags($output); 84 | $output = $this->twitter_link_filter($output); 85 | $output = $this->twitter_link_filter($output, '#', 'http://search.twitter.com/search?q=%23'); 86 | 87 | // Link urls 88 | $output = module_invoke('filter', 'filter', 'process', 2, -1, $output); 89 | 90 | $destination = 'http://www.twitter.com/'; 91 | $matches = array('/([a-zA-Z0-9_]{0,15})(: )/'); 92 | $replacements = array('${1}${2}'); 93 | return preg_replace($matches, $replacements, $output, 1); 94 | default: 95 | return _filter_htmlcorrector($output); 96 | } 97 | } 98 | 99 | /** 100 | * Taken from the twitter module by walkah. 101 | * This helper function converts Twitter-style @usernames and #hashtags into 102 | * actual links. 103 | */ 104 | function twitter_link_filter($text, $prefix = '@', $destination = 'http://twitter.com/') { 105 | $matches = array( 106 | '/\>' . $prefix . '([a-zA-Z0-9_]{0,15})/i', 107 | '/^' . $prefix . '([a-zA-Z0-9_]{0,15})/i', 108 | '/(\s+)' . $prefix . '([a-zA-Z0-9_]{0,15})/i', 109 | ); 110 | $replacements = array( 111 | '>' . $prefix . '${1}', 112 | '' . $prefix . '${1}', 113 | '${1}' . $prefix . '${2}', 114 | ); 115 | return preg_replace($matches, $replacements, $text); 116 | } 117 | } 118 | -------------------------------------------------------------------------------- /atrium_reader/views/atrium_reader_handler_field_title.inc: -------------------------------------------------------------------------------- 1 | {$this->field_alias}; 10 | return filter_xss($value); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /atrium_reader/views/atrium_reader_plugin_access.inc: -------------------------------------------------------------------------------- 1 | options['feedtype']); 10 | } 11 | 12 | function get_access_callback() { 13 | return array('atrium_reader_access', array($this->options['feedtype'])); 14 | } 15 | 16 | function summary_title() { 17 | return $this->options['feedtype']; 18 | } 19 | 20 | function option_defaults(&$options) { 21 | $options['type'] = 'atrium_reader'; // Wtf is this necessary? See views plugin stack : ( 22 | $options['feedtype'] = 'news'; 23 | } 24 | 25 | function options_form(&$form, &$form_state) { 26 | $types = atrium_reader_get_types(); 27 | $form['feedtype'] = array( 28 | '#type' => 'select', 29 | '#options' => $types, 30 | '#title' => t('Type'), 31 | '#default_value' => $this->options['feedtype'], 32 | '#description' => t('Access will be granted if the Reader feature is active and there exist items of the selected type.'), 33 | ); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /atrium_shoutbox/atrium_shoutbox.context.inc: -------------------------------------------------------------------------------- 1 | disabled = FALSE; /* Edit this to true to make a default context disabled initially */ 11 | $context->api_version = 3; 12 | $context->name = 'shoutbox_og'; 13 | $context->description = ''; 14 | $context->tag = 'Shoutbox'; 15 | $context->conditions = array( 16 | 'views' => array( 17 | 'values' => array( 18 | 'shoutbox_shouts:page_1' => 'shoutbox_shouts:page_1', 19 | ), 20 | ), 21 | ); 22 | $context->reactions = array( 23 | 'block' => array( 24 | 'blocks' => array( 25 | 'views--exp-shoutbox_shouts-page_1' => array( 26 | 'module' => 'views', 27 | 'delta' => '-exp-shoutbox_shouts-page_1', 28 | 'region' => 'right', 29 | 'weight' => 0, 30 | ), 31 | 'views-shoutbox_users-block_1' => array( 32 | 'module' => 'views', 33 | 'delta' => 'shoutbox_users-block_1', 34 | 'region' => 'right', 35 | 'weight' => 1, 36 | ), 37 | ), 38 | ), 39 | ); 40 | $context->condition_mode = 0; 41 | 42 | // Translatables 43 | // Included for use with string extractors like potx. 44 | t('Shoutbox'); 45 | $export['shoutbox_og'] = $context; 46 | 47 | $context = new stdClass; 48 | $context->disabled = FALSE; /* Edit this to true to make a default context disabled initially */ 49 | $context->api_version = 3; 50 | $context->name = 'shoutbox_sitewide'; 51 | $context->description = ''; 52 | $context->tag = 'Shoutbox'; 53 | $context->conditions = array( 54 | 'sitewide' => array( 55 | 'values' => array( 56 | 1 => 1, 57 | ), 58 | ), 59 | ); 60 | $context->reactions = array( 61 | 'block' => array( 62 | 'blocks' => array( 63 | 'atrium_shoutbox-shoutbox' => array( 64 | 'module' => 'atrium_shoutbox', 65 | 'delta' => 'shoutbox', 66 | 'region' => 'palette', 67 | 'weight' => 0, 68 | ), 69 | ), 70 | ), 71 | ); 72 | $context->condition_mode = 0; 73 | 74 | // Translatables 75 | // Included for use with string extractors like potx. 76 | t('Shoutbox'); 77 | $export['shoutbox_sitewide'] = $context; 78 | 79 | return $export; 80 | } 81 | -------------------------------------------------------------------------------- /atrium_shoutbox/atrium_shoutbox.features.inc: -------------------------------------------------------------------------------- 1 | 3); 10 | } 11 | elseif ($module == "strongarm" && $api == "strongarm") { 12 | return array("version" => 1); 13 | } 14 | } 15 | 16 | /** 17 | * Implementation of hook_node_info(). 18 | */ 19 | function atrium_shoutbox_node_info() { 20 | $items = array( 21 | 'shoutbox' => array( 22 | 'name' => t('Shoutbox'), 23 | 'module' => 'features', 24 | 'description' => t('A shoutbox for informal message blasts.'), 25 | 'has_title' => '1', 26 | 'title_label' => t('Name'), 27 | 'has_body' => '1', 28 | 'body_label' => t('Description'), 29 | 'min_word_count' => '0', 30 | 'help' => '', 31 | ), 32 | ); 33 | return $items; 34 | } 35 | 36 | /** 37 | * Implementation of hook_views_api(). 38 | */ 39 | function atrium_shoutbox_views_api() { 40 | return array( 41 | 'api' => '2', 42 | ); 43 | } 44 | -------------------------------------------------------------------------------- /atrium_shoutbox/atrium_shoutbox.features.user_permission.inc: -------------------------------------------------------------------------------- 1 | 'create shoutbox content', 12 | 'roles' => array( 13 | '0' => 'administrator', 14 | '1' => 'authenticated user', 15 | '2' => 'manager', 16 | ), 17 | ); 18 | 19 | // Exported permission: delete own shoutbox content 20 | $permissions['delete own shoutbox content'] = array( 21 | 'name' => 'delete own shoutbox content', 22 | 'roles' => array( 23 | '0' => 'administrator', 24 | '1' => 'authenticated user', 25 | '2' => 'manager', 26 | ), 27 | ); 28 | 29 | // Exported permission: edit own shoutbox content 30 | $permissions['edit own shoutbox content'] = array( 31 | 'name' => 'edit own shoutbox content', 32 | 'roles' => array( 33 | '0' => 'administrator', 34 | '1' => 'authenticated user', 35 | '2' => 'manager', 36 | ), 37 | ); 38 | 39 | return $permissions; 40 | } 41 | -------------------------------------------------------------------------------- /atrium_shoutbox/atrium_shoutbox.info: -------------------------------------------------------------------------------- 1 | name = "Atrium Shoutbox" 2 | description = "The shoutbox provides a team microblog." 3 | core = "6.x" 4 | package = "Features" 5 | dependencies[] = "comment" 6 | dependencies[] = "context" 7 | dependencies[] = "features" 8 | dependencies[] = "spaces" 9 | dependencies[] = "strongarm" 10 | dependencies[] = "views" 11 | features[context][] = "shoutbox_og" 12 | features[context][] = "shoutbox_sitewide" 13 | features[ctools][] = "context:context:3" 14 | features[ctools][] = "strongarm:strongarm:1" 15 | features[node][] = "shoutbox" 16 | features[user_permission][] = "create shoutbox content" 17 | features[user_permission][] = "delete own shoutbox content" 18 | features[user_permission][] = "edit own shoutbox content" 19 | features[variable][] = "atrium_activity_update_type_shoutbox" 20 | features[variable][] = "comment_shoutbox" 21 | features[variable][] = "node_options_shoutbox" 22 | features[variable][] = "notifications_content_type_shoutbox" 23 | features[variable][] = "og_content_type_usage_shoutbox" 24 | features[variable][] = "show_diff_inline_shoutbox" 25 | features[variable][] = "show_preview_changes_shoutbox" 26 | features[variable][] = "upload_shoutbox" 27 | features[views][] = "shoutbox_shoutboxes" 28 | features[views][] = "shoutbox_shouts" 29 | features[views][] = "shoutbox_users" 30 | features[views_api][] = "api:2" 31 | kitf = "1.0-draft" 32 | spaces[types][] = "og" 33 | -------------------------------------------------------------------------------- /atrium_shoutbox/atrium_shoutbox.install: -------------------------------------------------------------------------------- 1 | array( 9 | 'atrium_shoutbox' => array( 10 | 'shoutbox_shoutboxes' => array(), 11 | ), 12 | 'atrium_shoutbox_shouts' => array( 13 | 'shoutbox_shouts' => array(), 14 | ), 15 | 'atrium_shoutbox_users' => array( 16 | 'shoutbox_users' => array( 17 | 'block_1' => array( 18 | 'module' => 'views', 19 | 'delta' => 'block_1', 20 | ), 21 | ), 22 | ), 23 | 'atrium_shoutbox_shouts:page_1' => array( 24 | 'shoutbox_shouts:page_1' => array(), 25 | ), 26 | ), 27 | 'contexts' => array( 28 | 'atrium-shoutbox' => 'shoutbox_sitewide', 29 | 'atrium-shoutbox-og' => 'shoutbox_og', 30 | ), 31 | ); 32 | 33 | module_load_include('inc', 'atrium', 'includes/atrium_update_kit'); 34 | atrium_kit_comply_presets($components); 35 | atrium_kit_comply_overrides($components); 36 | atrium_kit_comply_contexts($components); 37 | 38 | return array(array('success' => true, 'query' => 'Atrium Shoutbox updated for Kit compliance.')); 39 | } -------------------------------------------------------------------------------- /atrium_shoutbox/atrium_shoutbox.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Drupal behaviors implementation for Atrium Shoutbox. 3 | */ 4 | Drupal.behaviors.atrium_shoutbox = function(context) { 5 | /** 6 | * Mark shoutboxes as "submitting" while AHAH is processing. After submission 7 | * clear the shoutbox (attachBehaviors is called by ahah.js). 8 | */ 9 | $('form.shoutform.submitted textarea').removeClass('submitted').val(''); 10 | $('form.shoutform:not(.atrium-shoutbox-processed)') 11 | .addClass('atrium-shoutbox-processed') 12 | .each(function() { 13 | var form = $(this); 14 | $('input.form-submit', this).mousedown(function() { 15 | form.addClass('submitted'); 16 | }); 17 | }); 18 | 19 | /** 20 | * Adds a handler to the Atrium Shoutbox launcher link that sets a cookie 21 | * with the current pageload's server timestamp when clicked. The cookie 22 | * is used server-side for the non-critical task of determining how many 23 | * shouts have not been viewed by the current user. 24 | */ 25 | if (jQuery.cookie && Drupal.settings.atrium_shoutbox.timestamp) { 26 | $('#atrium-shoutbox-launcher:not(.atrium-shoutbox-processed)') 27 | .addClass('atrium-shoutbox-processed') 28 | .each(function() { 29 | if ($(this).is('.active')) { 30 | $.cookie('AtriumShoutbox', Drupal.settings.atrium_shoutbox.timestamp, {expires: 14, path: '/'}); 31 | } 32 | else { 33 | $(this).click(function() { 34 | if ($('span.count', this).size() > 0) { 35 | $('span.count', this).hide(); 36 | } 37 | $.cookie('AtriumShoutbox', Drupal.settings.atrium_shoutbox.timestamp, {expires: 14, path: '/'}); 38 | }); 39 | } 40 | }); 41 | } 42 | }; 43 | -------------------------------------------------------------------------------- /atrium_shoutbox/atrium_shoutbox.strongarm.inc: -------------------------------------------------------------------------------- 1 | disabled = FALSE; /* Edit this to true to make a default strongarm disabled initially */ 11 | $strongarm->api_version = 1; 12 | $strongarm->name = 'atrium_activity_update_type_shoutbox'; 13 | $strongarm->value = 0; 14 | $export['atrium_activity_update_type_shoutbox'] = $strongarm; 15 | 16 | $strongarm = new stdClass; 17 | $strongarm->disabled = FALSE; /* Edit this to true to make a default strongarm disabled initially */ 18 | $strongarm->api_version = 1; 19 | $strongarm->name = 'comment_shoutbox'; 20 | $strongarm->value = '0'; 21 | $export['comment_shoutbox'] = $strongarm; 22 | 23 | $strongarm = new stdClass; 24 | $strongarm->disabled = FALSE; /* Edit this to true to make a default strongarm disabled initially */ 25 | $strongarm->api_version = 1; 26 | $strongarm->name = 'node_options_shoutbox'; 27 | $strongarm->value = array( 28 | 0 => 'status', 29 | ); 30 | $export['node_options_shoutbox'] = $strongarm; 31 | 32 | $strongarm = new stdClass; 33 | $strongarm->disabled = FALSE; /* Edit this to true to make a default strongarm disabled initially */ 34 | $strongarm->api_version = 1; 35 | $strongarm->name = 'notifications_content_type_shoutbox'; 36 | $strongarm->value = array(); 37 | $export['notifications_content_type_shoutbox'] = $strongarm; 38 | 39 | $strongarm = new stdClass; 40 | $strongarm->disabled = FALSE; /* Edit this to true to make a default strongarm disabled initially */ 41 | $strongarm->api_version = 1; 42 | $strongarm->name = 'og_content_type_usage_shoutbox'; 43 | $strongarm->value = 'group_post_standard'; 44 | $export['og_content_type_usage_shoutbox'] = $strongarm; 45 | 46 | $strongarm = new stdClass; 47 | $strongarm->disabled = FALSE; /* Edit this to true to make a default strongarm disabled initially */ 48 | $strongarm->api_version = 1; 49 | $strongarm->name = 'show_diff_inline_shoutbox'; 50 | $strongarm->value = 0; 51 | $export['show_diff_inline_shoutbox'] = $strongarm; 52 | 53 | $strongarm = new stdClass; 54 | $strongarm->disabled = FALSE; /* Edit this to true to make a default strongarm disabled initially */ 55 | $strongarm->api_version = 1; 56 | $strongarm->name = 'show_preview_changes_shoutbox'; 57 | $strongarm->value = 0; 58 | $export['show_preview_changes_shoutbox'] = $strongarm; 59 | 60 | $strongarm = new stdClass; 61 | $strongarm->disabled = FALSE; /* Edit this to true to make a default strongarm disabled initially */ 62 | $strongarm->api_version = 1; 63 | $strongarm->name = 'upload_shoutbox'; 64 | $strongarm->value = '0'; 65 | $export['upload_shoutbox'] = $strongarm; 66 | 67 | return $export; 68 | } 69 | -------------------------------------------------------------------------------- /atrium_test/atrium_test.info: -------------------------------------------------------------------------------- 1 | ; $Id: simpletest.info,v 1.4.2.2.2.4 2009/04/23 05:39:51 boombatower Exp $ 2 | name = "Atrium test" 3 | description = "Provides a framework for unit and functional testing for Atrium." 4 | package = Development 5 | version = VERSION 6 | core = "6.x" 7 | dependencies[] = simpletest 8 | 9 | -------------------------------------------------------------------------------- /atrium_test/atrium_test.module: -------------------------------------------------------------------------------- 1 | 'Atrium basics', 19 | 'description' => 'Install Atrium and do the initial set up.', 20 | 'group' => 'Atrium', 21 | ); 22 | } 23 | 24 | /** 25 | * Implementation of setUp(). 26 | */ 27 | function setUp() { 28 | parent::setUp(); 29 | } 30 | 31 | function testWelcomePage() { 32 | // Create and login admin user 33 | $admin_user = $this->atriumCreateUser('administrator'); 34 | $this->drupalLogin($admin_user); 35 | 36 | // Check initial texts 37 | $this->drupalGet(''); 38 | 39 | // @TODO: For whatever reason, refreshVariables() is not workign correctly 40 | // for the installed site. We test against the default, unset site 41 | // frontpage variable for now. 42 | // $this->assertText(t('Welcome to !sitename', array('!sitename' => variable_get('site_name', 'Drupal')))); 43 | // @TODO welcome block is not showing up. 44 | $this->assertText(t('Welcome to !sitename', array('!sitename' => 'Drupal'))); 45 | $this->assertText(t('!type', array('!type' => node_get_types('name', 'group')))); 46 | 47 | // Check some initial paths. More than checking the page is properly built 48 | // we just do some page loading to check for errors. 49 | $this->drupalGet('og'); 50 | $this->assertText(t('Please add your first !type to get started.', array('!type' => node_get_types('name', 'group')))); 51 | 52 | $this->drupalGet('og/my'); 53 | $this->assertText(t('No groups found.')); 54 | 55 | $this->drupalGet('og/archived'); 56 | $this->assertText(t('No archived groups found.')); 57 | 58 | $this->drupalGet('members'); 59 | $this->assertNoUniqueText($admin_user->name); // In menu and directory 60 | 61 | $this->drupalGet('members/all'); 62 | $this->assertText($admin_user->name); // Display user name 63 | 64 | $this->drupalGet('members/blocked'); 65 | $this->assertText(t('Anonymous')); // Anonymous user is blocked 66 | 67 | // Check the user space and account pages 68 | $this->drupalGet('user/' . $admin_user->uid . '/dashboard'); 69 | $this->assertText(t('No recent activity found')); 70 | 71 | $this->drupalGet('user/' . $admin_user->uid); 72 | $this->assertText(t($admin_user->name)); 73 | 74 | $path = 'user/' . $admin_user->uid; 75 | foreach (array('edit', 'edit/profile', 'edit/picture', 'dashboard', 'notifications', 'openid', 'features') as $page) { 76 | $this->drupalGet("$path/$page"); 77 | } 78 | 79 | // Create public and private group using the form 80 | foreach (array('atrium_groups_private', 'atrium_groups_public') as $preset) { 81 | $group = $this->atriumCreateGroup($preset); 82 | $this->drupalGet($group->path); 83 | $this->assertText($group->title); 84 | foreach (array('dashboard') as $page) { 85 | $this->drupalGet("$group->path/$page"); 86 | $this->assertText(t('No recent activity found.')); 87 | } 88 | 89 | $content = array(); 90 | 91 | // Check blog 92 | $this->drupalGet("$group->path/blog"); 93 | $this->assertText(t('Please add your first !type to get started.', array('!type' => node_get_types('name', 'blog')))); 94 | $blog = $this->atriumCreateGroupContent($group, 'blog'); 95 | $content[] = $blog; 96 | $this->drupalGet("$group->path/blog"); 97 | $this->assertText($blog->title); 98 | 99 | // Check notebook 100 | $this->drupalGet("$group->path/notebook"); 101 | $this->assertText(t('No recent updates found.')); 102 | $this->drupalGet("$group->path/notebook/archived"); 103 | $this->assertText(t('No archived books found.')); 104 | $book = $this->atriumCreateGroupContent($group, 'book'); 105 | $content[] = $book; 106 | $this->drupalGet("$group->path/notebook"); 107 | $this->assertText($book->title); 108 | 109 | // These should show up in dashboard 110 | $this->drupalGet("$group->path/dashboard"); 111 | foreach ($content as $node) { 112 | $this->assertText($node->title); 113 | } 114 | } 115 | } 116 | } 117 | -------------------------------------------------------------------------------- /atrium_test/tests/atrium_translate.test: -------------------------------------------------------------------------------- 1 | 'Atrium translate', 19 | 'description' => 'Install Atrium in a different language.', 20 | 'group' => 'Atrium', 21 | ); 22 | } 23 | 24 | /** 25 | * Implementation of setUp(). 26 | */ 27 | function setUp() { 28 | // Change install locale, will download translation on the fly 29 | $this->install_locale = 'es'; 30 | // Set time limit, 180 (default) may not be enough for language install 31 | $this->timeLimit = 360; 32 | parent::setUp(); 33 | } 34 | 35 | function testWelcomePage() { 36 | // Check the language has been added 37 | $this->assertEqual(count(language_list()), 2, 'Two languages have been added.'); 38 | $this->assertEqual(language_default('language'), 'es', 'Spanish is the default language.'); 39 | // Check translations have been added properly 40 | $count = db_result(db_query("SELECT COUNT(*) FROM {locales_target} WHERE language = '%s'", $this->install_locale)); 41 | $this->assertTrue($count, "Translations have been loaded: $count strings."); 42 | // Create and login administrator user 43 | $admin_user = $this->atriumCreateUser('administrator'); 44 | $this->drupalLogin($admin_user); 45 | // Check initial texts 46 | 47 | // @TODO: Determine whether the t() here should actually work if the 48 | // install of the test host is not localized. 49 | // $this->assertText(t('Welcome to !sitename', array('!sitename' => variable_get('site_name', 'Drupal')))); 50 | // $this->assertText(t('Add !type.', array('!type' => node_get_types('name', 'group')))); 51 | 52 | // Check random string translations 53 | $this->assertText('Bienvenido'); 54 | $this->assertText('Añadir Grupo'); 55 | } 56 | } 57 | 58 | -------------------------------------------------------------------------------- /atrium_translate/atrium_translate.inc: -------------------------------------------------------------------------------- 1 | 'drupal', 26 | 'title' => 'Drupal core', 27 | 'info' => array( 28 | 'version' => VERSION, 29 | 'translate status url' => ATRIUM_L10N_SERVER, 30 | ), 31 | ); 32 | $projects['atrium_contrib'] = array( 33 | 'name' => 'atrium_contrib', 34 | 'title' => 'Atrium contrib', 35 | 'info' => array( 36 | 'version' => ATRIUM_L10N_VERSION, 37 | 'translate status url' => ATRIUM_L10N_SERVER, 38 | ), 39 | ); 40 | $projects['atrium_custom'] = array( 41 | 'name' => 'atrium_custom', 42 | 'title' => 'Atrium custom', 43 | 'info' => array( 44 | 'version' => ATRIUM_L10N_VERSION, 45 | 'translate status url' => ATRIUM_L10N_SERVER, 46 | ), 47 | ); 48 | $projects['atrium_features'] = array( 49 | 'name' => 'atrium_features', 50 | 'title' => 'Atrium features', 51 | 'info' => array( 52 | 'version' => ATRIUM_L10N_VERSION, 53 | 'translate status url' => ATRIUM_L10N_SERVER, 54 | ), 55 | ); 56 | return $projects; 57 | } -------------------------------------------------------------------------------- /atrium_translate/atrium_translate.info: -------------------------------------------------------------------------------- 1 | ; $Id$ 2 | name = Atrium translation 3 | description = Provides automatic downloads and updates for Atrium translations 4 | dependencies[] = l10n_update 5 | core = 6.x 6 | package = Multilanguage -------------------------------------------------------------------------------- /atrium_translate/atrium_translate.install: -------------------------------------------------------------------------------- 1 | $t('Translation is available'), 26 | ); 27 | $file_path = _atrium_translate_default_file($locale); 28 | $variables = array( 29 | '%filepath' => $file_path, 30 | '%server' => ATRIUM_L10N_SERVER, 31 | '%language' => $locale, 32 | ); 33 | if (is_readable($file_path)) { 34 | $requirements['translation']['description'] = $t('A translation file has been found: %filepath', $variables); 35 | $requirements['translation']['severity'] = REQUIREMENT_OK; 36 | return $requirements; 37 | } 38 | else { 39 | // Check server connectivity and available downloads 40 | if ($error = _atrium_translate_ping_server(ATRIUM_L10N_SERVER)) { 41 | $description[] = $t('We cannot connect with the translation server at %server.', $variables); 42 | $description[] = $error; 43 | $status = REQUIREMENT_ERROR; 44 | } 45 | elseif ($url = _atrium_translate_download_url($locale)) { 46 | $description[] = $t('The chosen language(%language) is available for downloading at the translation server. It will be downloaded automatically from %server.', $variables); 47 | $status = REQUIREMENT_OK; 48 | } 49 | else { 50 | $description[] = $t('The chosen language(%language) is not supported by the translation server %server.', $variables); 51 | $status = REQUIREMENT_ERROR; 52 | } 53 | 54 | $description[] = $t('Alternatively you can download a translation file and drop it into %filepath.', $variables); 55 | $requirements['translation']['description'] = implode('
', $description); 56 | $requirements['translation']['severity'] = $status; 57 | return $requirements; 58 | } 59 | 60 | } 61 | } 62 | 63 | /** 64 | * Implementation of hook_install() 65 | * 66 | * We do the initial language import on install 67 | */ 68 | function atrium_translate_install() { 69 | // Set some variables for l10n_update to work with Atrium server 70 | variable_set('l10n_update_server', ATRIUM_L10N_SERVER); 71 | // Just in case they want to enable later the l10n_client module 72 | variable_set('l10n_client_server', ATRIUM_L10N_SERVER); 73 | } 74 | 75 | /** 76 | * Create batch for importing this language 77 | * @param $locale 78 | * @return unknown_type 79 | */ 80 | function atrium_translate_create_batch($locale, $phase = 'runtime') { 81 | _atrium_translate_include($phase); 82 | 83 | // First check for the default local file. If not there go for the remote one. 84 | if (is_readable($filename = _atrium_translate_default_file($locale))) { 85 | $file = new Stdclass(); 86 | $file->filename = $filename; 87 | $batch = _locale_batch_build(array($file)); 88 | return $batch; 89 | } 90 | elseif ($projects = _atrium_translate_default_projects()) { 91 | return l10n_update_batch_multiple($projects, array($locale)); 92 | } 93 | } 94 | 95 | /** 96 | * Get download URL 97 | */ 98 | function _atrium_translate_download_url($locale) { 99 | if ($release = _atrium_translate_default_release($locale)) { 100 | return $release['download_link']; 101 | } 102 | } 103 | 104 | /** 105 | * Get default release for downloading and check download link 106 | */ 107 | function _atrium_translate_default_release($locale) { 108 | $release = l10n_update_project_get_release('atrium', $locale, ATRIUM_L10N_VERSION, ATRIUM_L10N_SERVER); 109 | if ($release && !empty($release['download_link'])) { 110 | return $release; 111 | } 112 | } 113 | 114 | /** 115 | * Path for the default Atrium file 116 | */ 117 | function _atrium_translate_default_file($locale) { 118 | return ATRIUM_L10N_DIRECTORY . "/$locale.po"; 119 | } 120 | 121 | /** 122 | * Get current locale 123 | */ 124 | function _atrium_translate_locale($phase = 'runtime') { 125 | global $install_locale; 126 | global $language; 127 | 128 | if ($phase == 'install' && isset($install_locale)) { 129 | return $install_locale; 130 | } 131 | elseif(!empty($language)) { 132 | return $language->language; 133 | } 134 | } 135 | 136 | /** 137 | * Ping the translation server. Installer safe version. 138 | * 139 | * @return string 140 | * Error message if something went wrong 141 | */ 142 | function _atrium_translate_ping_server($url) { 143 | _atrium_translate_include('install'); 144 | $t = get_t(); 145 | $response = l10n_update_http_request($url); 146 | if (!empty($response->error)) { 147 | // 0 -> php_network_getaddresses: getaddrinfo failed: Name or service not known 148 | return $t('Error @number: %message', array('@number' => $response->code, '%message' => $response->error)); 149 | } 150 | } 151 | 152 | /** 153 | * Include l10n_update library 154 | * 155 | * Helper function that resolves module file name before installing the modules 156 | */ 157 | function _atrium_translate_include($phase = 'runtime') { 158 | static $done; 159 | 160 | if (isset($done)) { 161 | return; 162 | } 163 | elseif ($phase == 'runtime') { 164 | $filename = drupal_get_path('module', 'l10n_update') . '/l10n_update.inc'; 165 | } 166 | elseif ($files = drupal_system_listing('l10n_update.inc$', 'modules')) { 167 | $file = current($files); 168 | $filename = $file->filename; 169 | } 170 | if (!empty($filename)) { 171 | require_once $filename; 172 | $done = TRUE; 173 | } 174 | } -------------------------------------------------------------------------------- /atrium_translate/atrium_translate.module: -------------------------------------------------------------------------------- 1 |