Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-6914 formslib.php improvement
  3. MDL-7778

Add Cancel button hooks to standard moodleform

    XMLWordPrintable

    Details

    • Type: Sub-task
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.8
    • Fix Version/s: 1.8
    • Component/s: Forms Library
    • Labels:
      None
    • Affected Branches:
      MOODLE_18_STABLE
    • Fixed Branches:
      MOODLE_18_STABLE

      Description

      The cancel button is not easy to create correctly. We should help developers to write forms with cancel buttons without ugly hacks that rely on JS and can not be used without it.

      Solution:
      1/ add cancel button element type
      2/ add cancelled() method to moodleform class

      expected use:

      $mform = new someform();

      if ($mform->cancelled()) {
      redirect($somewhere);
      } else if ($data = $mform->data_submitted()) {
      ...
      }

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              skodak Petr Skoda
              Reporter:
              skodak Petr Skoda
              Tester:
              Nobody
              Participants:
              Component watchers:
              Jake Dallimore, Jun Pataleta
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Fix Release Date:
                31/Mar/07