/[drupal]/contributions/modules/iedestroyer/iedestroyer.module
ViewVC logotype

Diff of /contributions/modules/iedestroyer/iedestroyer.module

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph | View Patch Patch

revision 1.6.2.17.2.3, Tue Jun 17 14:48:30 2008 UTC revision 1.6.2.17.2.4, Tue Jun 17 14:57:39 2008 UTC
# Line 11  define('IEDESTROYER_PERSISTENCE_FORCE', Line 11  define('IEDESTROYER_PERSISTENCE_FORCE',
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) {
# Line 31  function iedestroyer_help($section) { Line 29  function iedestroyer_help($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');
# Line 111  function iedestroyer_browser_load() { Line 107  function iedestroyer_browser_load() {
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'),
# Line 240  function iedestroyer_admin() { Line 236  function iedestroyer_admin() {
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')) {
# Line 270  function iedestroyer_view_block() { Line 266  function iedestroyer_view_block() {
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)) {
# Line 312  function iedestroyer_view($severity) { Line 312  function iedestroyer_view($severity) {
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    }    }
# Line 325  function _iedestroyer_should_display_pag Line 325  function _iedestroyer_should_display_pag
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);
# Line 353  function _iedestroyer_should_display_pag Line 353  function _iedestroyer_should_display_pag
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) {

Legend:
Removed from v.1.6.2.17.2.3  
changed lines
  Added in v.1.6.2.17.2.4

  ViewVC Help
Powered by ViewVC 1.1.2