mcantelon/drupal-sopa-blackout — Issue #1: Doesn't work well with Drupal 7
Author: hantonr
Created: 2012-01-16 00:52:35+00:00
State: open

I don't know much about coding modules yet, but I made some modifications that seem to have worked. First of course I changed the .info file so it would be accepted as a 7.x module. Then I changed the .module to:

$path_to_static
));
exit();
}
}

/**
* Implementation of hook_help().
*/
function sopa_help($section = '') {

$output= '';

switch ($section) {

case "admin/modules#description":
$output = t("Block out your site on January 18, 2012.");
break;

case "admin/help":
$output = t("Block out your site on January 18, 2012.");
break;
}

return $output;
}

function sopa_return_template_html($module, $template, $variables = array()) {
// Create local copies of variables passed to template
if (is_array($variables)) {
reset($variables);
while (list($key, $value) = each($variables)) {
$$key = $value;
}
}

// Use output buffering to capture included template output
ob_start();
if ($module) {
include(drupal_get_path('module', $module) .'/template/'. $template);
}

$output = ob_get_contents();
ob_end_clean();

return $output;
}

Still imperfect. Thoughts?