Skip to content

Commit

Permalink
Initial commit of D7 context respect port
Browse files Browse the repository at this point in the history
  • Loading branch information
ngmaloney committed Mar 21, 2011
0 parents commit f3a2065
Show file tree
Hide file tree
Showing 5 changed files with 704 additions and 0 deletions.
5 changes: 5 additions & 0 deletions README.txt
@@ -0,0 +1,5 @@
To install, first install like normal:

http://drupal.org/getting-started/install-contrib/modules

Once enabled this will automatically make all of your blocks respect their page and role visibility settings from the blocks page.
8 changes: 8 additions & 0 deletions context_respect.info
@@ -0,0 +1,8 @@
name = Context Respect
description = "Respect normal block visibility."
package = "Context"
core = "7.x"
dependencies[] = ctools
dependencies[] = context
core = "7.x"
project = "context_reaction"
8 changes: 8 additions & 0 deletions context_respect.install
@@ -0,0 +1,8 @@
<?php

/*
* hook_enable
*/
function context_reaction_enable() {
context_invalidate_cache();
}
34 changes: 34 additions & 0 deletions context_respect.module
@@ -0,0 +1,34 @@
<?php
/*
* hook_ctools_plugin_api
*/
function context_respect_ctools_plugin_api($module, $api) {
if ($module == 'context' && $api == 'plugins') {
return array('version' => 3);
}
}

/*
* hook_context_plugins
*/
function context_respect_context_plugins() {
$plugins['context_respect_reaction_block'] = array(
'handler' => array(
'path' => drupal_get_path('module', 'context_respect') . '/plugins',
'file' => 'context_respect_reaction_block.inc',
'class' => 'context_respect_reaction_block',
'parent' => 'context_reaction',
),
);

return $plugins;
}

/*
* hook_context_registry_alter
*/
function context_respect_context_registry_alter(&$registry) {
if (!empty($registry['reactions']['block'])) {
$registry['reactions']['block']['plugin'] = 'context_respect_reaction_block';
}
}

0 comments on commit f3a2065

Please sign in to comment.