Upload
nuvole
View
9.730
Download
1
Embed Size (px)
DESCRIPTION
Citation preview
Antonio De [email protected]
Andrea [email protected]
Beyond the IntranetA new way to look at Open Atrium
Open Atrium is an intranet in a box that has group spaces to allow different teams to have their own conversations. It comes with six features - a blog, a wiki, a calendar, a to do list, a shoutbox, and a dashboard to manage it all.
“Development Seed
Part intranet, part do-it-yourself projectwith a kick of open source hotness
Part intranet, part do-it-yourself projectwith a kick of open source hotnessfor all tastes: the easygoing and the picky
Possibilities
Open Atrium out of the box.
Open Atrium as a public website.
Open Atrium as a fully customized private group.
Open Atrium as a social network.
Open Atrium as a file manager.
Open Atrium as you like it.
Technologies
Features
A feature is a collection of Drupal entities (views, contexts, fields, etc...) which taken
together satisfy a certain use-case.
http://drupal.org/project/features
Spaces
A way to make one Drupal site act like several sites.
http://drupal.org/project/spaces
Persistent URL
A helper for other modules interested in using elements of the page request to sustain
information between pages.
http://drupal.org/project/purl
PURL
Organic Groups
Enable users to create and manage their own groups.
http://drupal.org/project/og
OG
Recipes
How toAdd custom user profile fields
core = "6.x"dependencies[] = "features"dependencies[] = "text"description = "Custom profile feature."features[content][] = "profile-field_profile_city"features[content][] = "profile-field_profile_country"name = "Custom Profile"package = "Features"project = "custom_profile"version = "6.x-1.0"
custom_profile.info
How toOverride Atrium's core configuration
core = "6.x"dependencies[] = "book"dependencies[] = "codefilter"...
description = "Atrium sitewide settings and configuration."...features[variable][] = "upload_uploadsize_default"features[variable][] = "upload_usersize_default"features[variable][] = "user_picture_default"...name = "Atrium"package = "Atrium"
atrium.info
<?php/*** Implementation of hook_strongarm_alter()*/function custom_profile_strongarm_alter(&$items) { if (isset($items['user_picture_default'])) { $items['user_picture_default']->value = 'sites/.../user.png'; }}?>
hook_strongarm_alter()
Feature's component alter hooks
Hooks to modify components defined by other features. These come in the formhook_COMPONENT_alter where COMPONENT is the default_hook declared by any ofcomponents within features.
CTools also has a variety of hook_FOO_alters.
“
features.api.php
How toAlter contexts at run-time
/*** Implementation of hook_context_load_alter().*/function spaces_context_load_alter(&$context) { $space = spaces_get_space(); if ($space) { foreach (array_keys(context_reactions()) as $plugin) { $override = $space->controllers
->context ->get("{$context->name}:reaction:{$plugin}");
if (!is_null($override)) { $context->reactions[$plugin] = $override; } } }}
How toRemove the Welcome video block
<?php/*** Implementation of hook_spaces_presets_alter()*/function custom_group_spaces_presets_alter(&$items) { // Store a reference to our target block section. $blocks = &$items['atrium_groups_private']->value['context']['spaces_dashboard-custom-1:reaction:block']['blocks']; // Remove "Welcome" block. unset($blocks['atrium-welcome_member']); // Add "Latest discussions" block. $blocks['views-blog_listing-block_1'] = array( 'module' => 'views', 'delta' => 'blog_listing-block_2', 'region' => 'content', 'weight' => 1, );}?>
hook_spaces_presets_alter()
$ drush featuresName Feature Status State Atrium atrium Enabled Overridden Atrium Blog atrium_blog Enabled Atrium Notebook atrium_book Enabled Atrium Calendar atrium_calendar Enabled Atrium Case Tracker atrium_casetracker Enabled Atrium Groups atrium_groups Enabled Overridden Atrium Members atrium_members Enabled Atrium Profile atrium_profile Enabled
...but Upgrade-safe
Overridden...
How toCreate custom group types
core = "6.x"dependencies[] = "atrium_news"dependencies[] = "atrium_pages"dependencies[] = "context"dependencies[] = "menu"dependencies[] = "spaces"features[context][] = "layout_portal"features[ctools][] = "context:context:3"features[ctools][] = "spaces:spaces:3"features[menu_custom][] = "menu-portal"features[menu_links][] = "menu-portal:calendar"features[menu_links][] = "menu-portal:dashboard"features[spaces_presets][] = "atrium_portal"name = "atrium_portal"package = "Features"
atrium_portal.info
Custom feature set
/*** Implementation of hook_spaces_presets().*/function atrium_portal_spaces_presets() {
...'spaces_features' => array( 'atrium_blog' => '0', 'atrium_book' => '0', 'atrium_calendar' => '1', 'atrium_casetracker' => '0', 'atrium_members' => '0', 'atrium_news' => '1', 'atrium_pages' => '1', 'atrium_shoutbox' => '0', 'spaces_dashboard' => '1',),...
atrium_portal.spaces.inc
Custom dashboard context
/*** Implementation of hook_spaces_presets().*/function atrium_portal_spaces_presets() {
...
'context' => array( 'spaces_dashboard-custom-1:reaction:block' => array( 'blocks' => array( 'views-atrium_news-block_3' => array( 'module' => 'views', 'delta' => 'atrium_news-block_3', 'region' => 'content', 'weight' => 0, ), 'views-calendar_listing-block_1' => array( 'module' => 'views', 'delta' => 'calendar_listing-block_1', 'region' => 'right', 'weight' => 0, ), ), ),
atrium_portal.spaces.inc
http://nuvole.org
Thank You.