Skip to content

Commit 0852a4f

Browse files
committed
added context for 'add sheetnode' button, permission
1 parent 12fa22b commit 0852a4f

File tree

3 files changed

+72
-1
lines changed

3 files changed

+72
-1
lines changed

oa_sheetnode.context.inc

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
<?php
2+
3+
/**
4+
* Implementation of hook_context_default_contexts().
5+
*/
6+
function oa_sheetnode_context_default_contexts() {
7+
$export = array();
8+
$context = new stdClass;
9+
$context->disabled = FALSE; /* Edit this to true to make a default context disabled initially */
10+
$context->api_version = 3;
11+
$context->name = 'sheetnode_on_book_listing';
12+
$context->description = 'Adding the "Add Sheetnode" button to the Notebook';
13+
$context->tag = 'Book, Sheetnode';
14+
$context->conditions = array(
15+
'bookroot' => array(
16+
'values' => array(
17+
'book' => 'book',
18+
),
19+
'options' => array(
20+
'node_form' => '1',
21+
),
22+
),
23+
'node' => array(
24+
'values' => array(
25+
'sheetnode' => 'sheetnode',
26+
),
27+
'options' => array(
28+
'node_form' => '1',
29+
),
30+
),
31+
'views' => array(
32+
'values' => array(
33+
'book_listing' => 'book_listing',
34+
),
35+
),
36+
);
37+
$context->reactions = array(
38+
'block' => array(
39+
'blocks' => array(
40+
'diff-inline' => array(
41+
'module' => 'diff',
42+
'delta' => 'inline',
43+
'region' => 'right',
44+
'weight' => 0,
45+
),
46+
'atrium_book-book_all' => array(
47+
'module' => 'atrium_book',
48+
'delta' => 'book_all',
49+
'region' => 'right',
50+
'weight' => 1,
51+
),
52+
),
53+
),
54+
'menu' => 'notebook',
55+
);
56+
$context->condition_mode = 0;
57+
58+
// Translatables
59+
// Included for use with string extractors like potx.
60+
t('Adding the "Add Sheetnode" button to the Notebook');
61+
t('Book, Sheetnode');
62+
63+
$export['sheetnode_on_book_listing'] = $context;
64+
return $export;
65+
}

oa_sheetnode.features.inc

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,10 @@
55
*/
66
function oa_sheetnode_ctools_plugin_api() {
77
list($module, $api) = func_get_args();
8-
if ($module == "strongarm" && $api == "strongarm") {
8+
if ($module == "context" && $api == "context") {
9+
return array("version" => 3);
10+
}
11+
elseif ($module == "strongarm" && $api == "strongarm") {
912
return array("version" => 1);
1013
}
1114
}

oa_sheetnode.info

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
core = "6.x"
22
dependencies[] = "atrium"
3+
dependencies[] = "atrium_book"
34
dependencies[] = "features"
45
dependencies[] = "sheetnode"
56
dependencies[] = "strongarm"
67
description = "Sheetnode integration for Open Atrium"
8+
features[context][] = "sheetnode_on_book_listing"
9+
features[ctools][] = "context:context:3"
710
features[ctools][] = "strongarm:strongarm:1"
811
features[user_permission][] = "create sheet template"
912
features[user_permission][] = "create sheetnode"

0 commit comments

Comments
 (0)