| 11 |
|
|
| 12 |
/** |
/** |
| 13 |
* Implementation of hook_help(). |
* Implementation of hook_help(). |
|
* |
|
|
* @return string |
|
| 14 |
*/ |
*/ |
| 15 |
function iedestroyer_help($section) { |
function iedestroyer_help($section) { |
| 16 |
switch ($section) { |
switch ($section) { |
| 29 |
|
|
| 30 |
/** |
/** |
| 31 |
* Implementation of hook_perm() |
* Implementation of hook_perm() |
|
* |
|
|
* @return array Array containing the permissions this module provides |
|
| 32 |
*/ |
*/ |
| 33 |
function iedestroyer_perm() { |
function iedestroyer_perm() { |
| 34 |
return array('administer iedestroyer', 'view iedestroyer'); |
return array('administer iedestroyer', 'view iedestroyer'); |
| 107 |
'template' => 'iedestroyer_page',
'arguments' => array(
'iedestroyer' => '',
'title' => '',
'css' => '',
),
);
return $functions;
} |
'template' => 'iedestroyer_page',
'arguments' => array(
'iedestroyer' => '',
'title' => '',
'css' => '',
),
);
return $functions;
} |
| 108 |
|
|
| 109 |
/** |
/** |
| 110 |
* Admin configuration page |
* Admin configuration page |
| 111 |
*/ |
* |
| 112 |
|
* @return array A Drupal form |
| 113 |
|
*/ |
| 114 |
function iedestroyer_admin() { |
function iedestroyer_admin() { |
|
$form = array(); |
|
|
|
|
| 115 |
$form['iedestroyer_severity'] = array( |
$form['iedestroyer_severity'] = array( |
| 116 |
'#type' => 'radios', |
'#type' => 'radios', |
| 117 |
'#title' => t('Severity'), |
'#title' => t('Severity'), |
| 236 |
/** |
/** |
| 237 |
* Returns list of languages supported on this site |
* Returns list of languages supported on this site |
| 238 |
* |
* |
| 239 |
* @return array |
* @return array All enabled languages, structured like the result of locale_language_list(). |
| 240 |
*/ |
*/ |
| 241 |
function iedestroyer_supported_languages() { |
function iedestroyer_supported_languages() { |
| 242 |
if (module_exists('locale')) { |
if (module_exists('locale')) { |
| 266 |
} |
} |
| 267 |
|
|
| 268 |
/** |
/** |
| 269 |
* Render IE Destroyer |
* View IE Destroyer |
| 270 |
|
* |
| 271 |
|
* @param $severity constant IEDESTROYER_SEVERITY_BAR or IEDESTROYER_SEVERITY_BLOCK |
| 272 |
|
* |
| 273 |
|
* @return string |
| 274 |
*/ |
*/ |
| 275 |
function iedestroyer_view($severity) { |
function iedestroyer_view($severity) { |
| 276 |
if (_iedestroyer_should_display_page() == TRUE && $severity == variable_get('iedestroyer_severity', IEDESTROYER_SEVERITY_DISABLED)) { |
if (_iedestroyer_should_display_page() == TRUE && $severity == variable_get('iedestroyer_severity', IEDESTROYER_SEVERITY_DISABLED)) { |
| 312 |
* @return boolean TRUE or FALSE, depending on whether the banner should be displayed or not |
* @return boolean TRUE or FALSE, depending on whether the banner should be displayed or not |
| 313 |
*/ |
*/ |
| 314 |
function _iedestroyer_should_display_page() { |
function _iedestroyer_should_display_page() { |
| 315 |
// Should a IEDestroyer be displayed at all? |
// Should IE Destroyer be displayed at all? |
| 316 |
if (variable_get('iedestroyer_severity', IEDESTROYER_SEVERITY_DISABLED) == IEDESTROYER_SEVERITY_DISABLED) { |
if (variable_get('iedestroyer_severity', IEDESTROYER_SEVERITY_DISABLED) == IEDESTROYER_SEVERITY_DISABLED) { |
| 317 |
$page_match = FALSE; |
$page_match = FALSE; |
| 318 |
} |
} |
| 325 |
$page_match = FALSE; |
$page_match = FALSE; |
| 326 |
} |
} |
| 327 |
|
|
| 328 |
// This is IE, so we're going to check if the IEDestroyer should be displayed at this specific page |
// Check if IE Destroyer should be displayed at this specific page |
| 329 |
else { |
else { |
| 330 |
$page_match = FALSE; |
$page_match = FALSE; |
| 331 |
$visibility = (int) variable_get('iedestroyer_visibility', IEDESTROYER_VISIBILITY); |
$visibility = (int) variable_get('iedestroyer_visibility', IEDESTROYER_VISIBILITY); |
| 353 |
/** |
/** |
| 354 |
* The default message to present to the user |
* The default message to present to the user |
| 355 |
* |
* |
| 356 |
|
* @param $type constant IEDESTROYER_SEVERITY_BAR or IEDESTROYER_SEVERITY_BLOCK, depending |
| 357 |
|
* on whether to return the message for the IE Destroyer bar or the block |
| 358 |
|
* |
| 359 |
* @return string |
* @return string |
| 360 |
*/ |
*/ |
| 361 |
function _iedestroyer_default_message($type) { |
function _iedestroyer_default_message($type) { |