Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-44173

fake notifications with hardcoded classes that don't call the notification API

    XMLWordPrintable

Details

    • MOODLE_26_STABLE

    Description

      Instead of calling notification() (optionally passing it's default value of 'notifyproblem'), a few parts of the codebase just hardcode the output by creating a div with the class notifyproblem.

      There's also several uses of notifyproblem on span tags, possibly they should also be redone with the API.

      Usage of notifyproblem on table cells (primarily to get red text it seems) is also a problem, but probably a seperate one.

      Examples are:

      admin/blocks.php
      126: $strblockname = '<span class="notifyproblem">'.$strblockname.' ('.get_string('missingfromdisk').')</span>';

      admin/modules.php
      93: $strmodulename = '<span class="notifyproblem">'.$module->name.' ('.get_string('missingfromdisk').')</span>';

      admin/reports.php
      94: $name = '<span class="notifyproblem">'.$name.' ('.get_string('missingfromdisk').')</span>';

      admin/tools.php
      94: $name = '<span class="notifyproblem">'.$name.' ('.get_string('missingfromdisk').')</span>';

      auth/shibboleth/config.html
      37: echo '<br/><span class="notifyproblem">';
      75: echo '<br/><span class="notifyproblem">';

      backup/util/ui/renderer.php
      225: $html .= $this->output->heading(get_string('errorinvalidformat', 'backup'), 2, 'notifyproblem');
      226: $html .= html_writer::tag('div', get_string('errorinvalidformatinfo', 'backup'), array('class' => 'notifyproblem'));
      413: $output .= $this->output->notification($warning, 'notifywarning notifyproblem');
      564: $cell->attributes['class'] = 'notifyproblem';
      572: $cell->attributes['class'] = 'notifyproblem';
      640: $cell->attributes['class'] = 'notifyproblem';
      689: $cell->attributes['class'] = 'notifyproblem';
      698: $cell->attributes['class'] = 'notifyproblem';

      badges/backpack.js
      8: var errorhtml = '<div id="addtobackpack-error" class="box boxaligncenter notifyproblem">' + errortext + '</div>';

      badges/index.php
      147:echo $OUTPUT->box('', 'notifyproblem hide', 'check_connection');
      156: echo $OUTPUT->box(get_string('error:notifycoursedate', 'badges'), 'generalbox notifyproblem');

      badges/newbadge.php
      111:echo $OUTPUT->box('', 'notifyproblem hide', 'check_connection');

      badges/renderer.php
      346: $cell->attributes = array('class' => 'notifyproblem warning');
      444: $cell->attributes = array('class' => 'notifyproblem warning');

      badges/view.php
      96: echo $OUTPUT->box(get_string('error:notifycoursedate', 'badges'), 'generalbox notifyproblem');

      course/reset.php
      81: $line[] = ($item['error']===false) ? get_string('ok') : '<div class="notifyproblem">'.$item['error'].'</div>';

      group/autogroup.php
      163: $line[] = '<span class="notifyproblem">'.get_string('groupnameexists', 'group', $group['name']).'</span>';

      lib/adminlib.php
      5150: $displayname = '<span class="notifyproblem">'.$name.'</span>';

      lib/setuplib.php
      1767: * @param string $classes usually notifyproblem or notifysuccess
      1770: public static function early_notification($message, $classes = 'notifyproblem') {

      lib/uploadlib.php
      495: return '<p class="notifyproblem">'. $this->notify .'</p>';

      user/filters/courserole.php
      149: return '<span class="notifyproblem">'.get_string('courserolelabelerror', 'filters', $a).'</span>';

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              bawjaws David Scotson
              Adrian Greeve, Jake Dallimore, Mathew May, Mihail Geshoski, Sujith Haridasan, Yuliya Bozhko, Amaia Anabitarte, Carlos Escobedo, Ferran Recio, Ilya Tregubov, Laurent David, Raquel Ortega, Sara Arjona (@sarjona), Andrew Lyons, Huong Nguyen, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze, Stevani Andolo, Amy Groshek, David Scotson, Amaia Anabitarte, Carlos Escobedo, Ferran Recio, Ilya Tregubov, Laurent David, Raquel Ortega, Sara Arjona (@sarjona)
              Votes:
              1 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated: