From b8c08192d14f738967dd2a4dc826ad9d65e55afd Mon Sep 17 00:00:00 2001 From: Daniel Thee Roperto Date: Mon, 12 Sep 2016 18:22:50 +1000 Subject: [PATCH] Issue #28 - Added hints for the edit outage form. --- classes/forms/outage/edit.php | 5 +++++ lang/en/auth_outage.php | 7 ++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/classes/forms/outage/edit.php b/classes/forms/outage/edit.php index 9ac36e1..6ad9628 100644 --- a/classes/forms/outage/edit.php +++ b/classes/forms/outage/edit.php @@ -46,10 +46,13 @@ class edit extends \moodleform { $mform->setType('id', PARAM_INT); $mform->addElement('duration', 'warningduration', get_string('warningduration', 'auth_outage')); + $mform->addHelpButton('warningduration', 'warningduration', 'auth_outage'); $mform->addElement('date_time_selector', 'starttime', get_string('starttime', 'auth_outage')); + $mform->addHelpButton('starttime', 'starttime', 'auth_outage'); $mform->addElement('duration', 'outageduration', get_string('outageduration', 'auth_outage')); + $mform->addHelpButton('outageduration', 'outageduration', 'auth_outage'); $mform->addElement( 'text', @@ -58,8 +61,10 @@ class edit extends \moodleform { 'maxlength="' . self::TITLE_MAX_CHARS . '" size="60"' ); $mform->setType('title', PARAM_TEXT); + $mform->addHelpButton('title', 'title', 'auth_outage'); $mform->addElement('editor', 'description', get_string('description', 'auth_outage')); + $mform->addHelpButton('description', 'description', 'auth_outage'); $mform->addElement('static', 'usagehints', '', get_string('textplaceholdershint', 'auth_outage')); diff --git a/lang/en/auth_outage.php b/lang/en/auth_outage.php index 0a25870..403adce 100644 --- a/lang/en/auth_outage.php +++ b/lang/en/auth_outage.php @@ -38,6 +38,7 @@ $string['defaultwarningdescription'] = 'Description'; $string['defaultwarningdescriptiondescription'] = 'Default warning message for outages. Use {{start}} and {{stop}} placeholders as required.'; $string['defaultwarningdescriptionvalue'] = 'There is an scheduled maintenance from {{start}} to {{stop}} and our system will not be available during that time.'; $string['description'] = 'Public Description'; +$string['description_help'] = 'A full description of the outage, publicly visible by all users.'; $string['menudefaults'] = 'Default Settings'; $string['menumanage'] = 'Manage'; $string['messageoutageongoing'] = 'Our system will be under maintenance until {$a->stop}.'; @@ -49,18 +50,22 @@ $string['outagedelete'] = 'Delete Outage'; $string['outagedeletewarning'] = 'You are about to permanently delete the outage below. This cannot be undone.'; $string['outageduration'] = 'Outage Duration'; $string['outagedurationerrorinvalid'] = 'Outage duration must be positive.'; +$string['outageduration_help'] = 'How long the outage lasts after it starts.'; $string['outageslistfuture'] = 'Planned outages'; $string['outageslistpast'] = 'Outage history'; $string['pluginname'] = 'Outage manager'; $string['readmore'] = 'Read More'; $string['starttime'] = 'Start date and time'; +$string['starttime_help'] = 'At which date and time the outage starts, preventing general access to the system.'; $string['tableheaderstarttime'] = 'Starts on'; $string['tableheaderstopsafter'] = 'Stops after'; $string['tableheaderwarnbefore'] = 'Warns before'; $string['tableheadertitle'] = 'Title'; -$string['textplaceholdershint'] = 'You can use {{start}} and {{stop}} as placeholders on the title/description for the actual start/stop time.'; +$string['textplaceholdershint'] = 'You can use {{start}}, {{stop}} and {{duration}} as placeholders on the title and description.'; $string['titleerrorinvalid'] = 'Title cannot be left blank.'; $string['titleerrortoolong'] = 'Title cannot have more than {$a} characters.'; $string['title'] = 'Title'; +$string['title_help'] = 'A short title to for this outage. It will be displayed on the warning bar and on the calendar.'; $string['warningdurationerrorinvalid'] = 'Warning duration must be positive.'; $string['warningduration'] = 'Warning duration'; +$string['warningduration_help'] = 'How long before the start of the outage should the warning be displayed.';