Skip to content

Commit

Permalink
help strings MDL-21695 changed _hlp to _help and fixed help.php to fo…
Browse files Browse the repository at this point in the history
…rmat those strings properly
  • Loading branch information
moodler committed Apr 23, 2010
1 parent 0f4ab67 commit 5435c9d
Show file tree
Hide file tree
Showing 9 changed files with 49 additions and 30 deletions.
2 changes: 1 addition & 1 deletion admin/roles/define.php
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@
} else if ($action == 'edit') {
$title = get_string('editingrolex', 'role', $rolenames[$roleid]->localname);
}
echo $OUTPUT->heading_with_help($title, 'roles');
echo $OUTPUT->heading_with_help($title, 'roles', 'role');

/// Work out some button labels.
if ($action == 'add' || $action == 'duplicate') {
Expand Down
4 changes: 2 additions & 2 deletions course/modedit.php
Original file line number Diff line number Diff line change
Expand Up @@ -587,7 +587,7 @@
require($CFG->dirroot.'/'.$CFG->admin.'/roles/tabs.php');
}

if (get_string_manager()->string_exists('modulename_hlp', $module->name)) {
if (get_string_manager()->string_exists('modulename_help', $module->name)) {
echo $OUTPUT->heading_with_help($pageheading, 'modulename', $module->name, 'icon');
} else {
echo $OUTPUT->heading_with_help($pageheading, '', '', 'icon');
Expand All @@ -596,4 +596,4 @@
$mform->display();

echo $OUTPUT->footer();
}
}
27 changes: 21 additions & 6 deletions help.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,21 +28,36 @@

$sm = get_string_manager();

//TODO: this is a minimalistic help page, needs a lot more love

$PAGE->set_url('/help.php');
$PAGE->set_pagelayout('popup'); // not really a popup because this page gets dispalyed directly only when JS disabled
$PAGE->set_pagelayout('popup');
$PAGE->set_context(get_context_instance(CONTEXT_SYSTEM));

if ($ajax) {
@header('Content-Type: text/plain; charset=utf-8');
} else {
echo $OUTPUT->header();
}

if ($sm->string_exists($identifier.'_hlp', $component)) {
echo get_string($identifier.'_hlp', $component);
if ($sm->string_exists($identifier.'_help', $component)) {
$options = new object;
$options->trusted = false;
$options->noclean = false;
$options->smiley = false;
$options->filter = false;
$options->para = true;
$options->newlines = false;

// Should be simple wiki only MDL-21695
echo format_text(get_string($identifier.'_help', $component), FORMAT_MOODLE, $options);

if ($sm->string_exists($identifier.'_link', $component)) { // Link to further info in Moodle docs
$link = get_string($identifier.'_link', $component);
$linktext = get_string('morehelp');
echo '<div class="helpdoclink">'.$OUTPUT->doc_link($link, $linktext).'</div>';
}

} else {
echo "<p><strong>TODO</strong>: fix help for [{$identifier}_hlp, $component]</p>";
echo "<p><strong>TODO</strong>: fix help for [{$identifier}_help, $component]</p>";
}

if (!$ajax) {
Expand Down
7 changes: 4 additions & 3 deletions lang/en/moodle.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
$string['active'] = 'Active';
$string['activeusers'] = 'Active users';
$string['activities'] = 'Activities';
$string['activities_hlp'] = 'Moodle contains a wide range of activity modules that can be used to build up any type of course.';
$string['activities_help'] = 'Moodle contains a wide range of activity modules that can be used to build up any type of course.';
$string['activity'] = 'Activity';
$string['activityclipboard'] = 'Moving this activity: <b>{$a}</b>';
$string['activityiscurrentlyhidden'] = 'Sorry, this activity is currently hidden';
Expand Down Expand Up @@ -736,7 +736,7 @@
$string['fulllistofcourses'] = 'All courses';
$string['fullname'] = 'Full name';
$string['fullnamecourse'] = 'Course full name';
$string['fullnamecourse_hlp'] = 'The full name of the course is displayed at the top of the screen and in the course listings.';
$string['fullnamecourse_help'] = 'The full name of the course is displayed at the top of the screen and in the course listings.';
$string['fullnamedisplay'] = '{$a->firstname} {$a->lastname}';
$string['fullnameuser'] = 'User full name';
$string['fullprofile'] = 'Full profile';
Expand Down Expand Up @@ -1076,6 +1076,7 @@
$string['moodledocslink'] = 'Moodle Docs for this page';
$string['moodleversion'] = 'Moodle Version';
$string['more'] = 'more';
$string['morehelp'] = 'More help';
$string['moreinformation'] = 'More information about this error';
$string['moreprofileinfoneeded'] = 'Please tell us more about yourself';
$string['mostrecently'] = 'most recently';
Expand Down Expand Up @@ -1398,7 +1399,7 @@
$string['resortcoursesbyname'] = 'Re-sort courses by name';
$string['resource'] = 'Resource';
$string['resources'] = 'Resources';
$string['resources_hlp'] = 'Resources are reading materials.';
$string['resources_help'] = 'Resources are reading materials.';
$string['restore'] = 'Restore';
$string['restorecancelled'] = 'Restore cancelled';
$string['restorecannotassignroles'] = 'Restore needs to assign roles and you do not have permission to do so';
Expand Down
2 changes: 2 additions & 0 deletions lang/en/role.php
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,8 @@
$string['roleprohibitheader'] = 'Prohibit role';
$string['roleprohibitinfo'] = 'Select a role to be added to the list of prohibited roles in context {$a->context}, capability {$a->cap}:';
$string['roles'] = 'Roles';
$string['roles_help'] = 'A role is a collection of permissions defined for the whole system that you can assign to specific users in specific contexts.';
$string['roles_link'] = 'roles';
$string['role:safeoverride'] = 'Override safe permissions for others';
$string['roleselect'] = 'Select role';
$string['role:switchroles'] = 'Switch to other roles';
Expand Down
2 changes: 1 addition & 1 deletion lib/formslib.php
Original file line number Diff line number Diff line change
Expand Up @@ -1364,7 +1364,7 @@ function setHelpButton($elementname, $buttonargs, $suppresscheck=false, $functio
*
* There has to be two strings defined:
* 1/ get_string($identifier, $component) - the title of the help page
* 2/ get_string($identifier.'_hlp', $component) - the actual help page text
* 2/ get_string($identifier.'_help', $component) - the actual help page text
*
* @param string $elementname name of the element to add the item to
* @param string $identifier
Expand Down
11 changes: 6 additions & 5 deletions lib/outputcomponents.php
Original file line number Diff line number Diff line change
Expand Up @@ -200,8 +200,8 @@ public function __construct($helpidentifier, $title, $component = 'moodle') {
*/
class help_icon implements renderable {
/**
* @var string $identifier lang pack identifier (without the "_hlp" suffix),
* both get_string($identifier, $component) and get_string($identifier.'_hlp', $component)
* @var string $identifier lang pack identifier (without the "_help" suffix),
* both get_string($identifier, $component) and get_string($identifier.'_help', $component)
* must exist.
*/
public $identifier;
Expand All @@ -217,7 +217,8 @@ class help_icon implements renderable {
/**
* Constructor
* @param string $identifier string for help page title,
* string with _hlp suffix is used for the actual help text.
* string with _help suffix is used for the actual help text.
* string with _link suffix is used to create a link to further info (if it exists)
* @param string $component
*/
public function __construct($identifier, $component) {
Expand All @@ -233,8 +234,8 @@ public function diag_strings() {
if (!$sm->string_exists($this->identifier, $this->component)) {
debugging("Help title string does not exist: [$this->identifier, $this->component]");
}
if (!$sm->string_exists($this->identifier.'_hlp', $this->component)) {
debugging("Help title string does not exist: [{$this->identifier}_hlp, $this->component]");
if (!$sm->string_exists($this->identifier.'_help', $this->component)) {
debugging("Help title string does not exist: [{$this->identifier}_help, $this->component]");
}
}
}
Expand Down
22 changes: 11 additions & 11 deletions mod/feedback/lang/en/feedback.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
$string['anonymous_user'] = 'Anonymous user';
$string['append_new_items'] = 'Append new items';
$string['autonumbering'] = 'automated numbers';
$string['autonumbering_hlp'] = 'enables or disables automated numbers for each question';
$string['autonumbering_help'] = 'enables or disables automated numbers for each question';
$string['average'] = 'Average';
$string['bold'] = 'Bold';
$string['cancel_moving'] = 'Cancel moving';
Expand Down Expand Up @@ -72,7 +72,7 @@
$string['edit_items'] = 'Edit questions';
$string['email_notification'] = 'Send e-mail notifications';
$string['emailnotification'] = 'emailnotifications';
$string['emailnotification_hlp'] = 'On the submission of a Feedback response, Administrators will receive email notification';
$string['emailnotification_help'] = 'On the submission of a Feedback response, Administrators will receive email notification';
$string['emailteachermail'] = '{$a->username} has completed feedback activity : \'{$a->feedback}\'
You can view it here:
Expand Down Expand Up @@ -126,14 +126,14 @@
$string['mapcourseinfo'] = 'This is a sitewide feedback that is available to all courses using the feedback block. You can however limit the courses to which it will appear by mapping them. Search the course and map it to this feedback.';
$string['mapcoursenone'] = 'No courses mapped. Feedback available to all courses';
$string['mapcourse'] = 'Map feedback to courses';
$string['mapcourse_hlp'] = 'By default Feedback forms created on your Moodle main page are available site wide
$string['mapcourse_help'] = 'By default Feedback forms created on your Moodle main page are available site wide
and will appear in all courses using the Feedback block. You can also force the Feedback
to appear by making it a Sticky Block.<br />
You can however limit the courses in which a Feedback form will appear by Mapping it
to specific courses.
';
$string['mapcourses'] = 'Map feedback to courses';
$string['mapcourses_hlp'] = 'Once you have selected the relevant Course(s) and/or Programme(s) from your Search,
$string['mapcourses_help'] = 'Once you have selected the relevant Course(s) and/or Programme(s) from your Search,
you can associate them with this Feedback using Map Course(s). You can Ctrl select
multiple Courses or Shift select a series of Courses.<br />
You can disassociated a Course or Programme from a Feedback at any time.';
Expand All @@ -153,7 +153,7 @@
$string['multichoice_values'] = 'Multiple choice values';
$string['multiple_submit'] = 'Multiple submit';
$string['multiplesubmit'] = 'Multiple submit';
$string['multiplesubmit_hlp'] = 'For Anonymous polls Multiple Submit will allow unlimited answers for every user. Where a User\'s name is collected, Multiple Submit will allow them allow to resubmit their Feedback answers.';
$string['multiplesubmit_help'] = 'For Anonymous polls Multiple Submit will allow unlimited answers for every user. Where a User\'s name is collected, Multiple Submit will allow them allow to resubmit their Feedback answers.';
$string['name'] = 'Name';
$string['name_required'] = 'Name required';
$string['next_page'] = 'Next page';
Expand Down Expand Up @@ -183,7 +183,7 @@
$string['picture_values'] = 'Choose one or more<br />picture files from the list:';
$string['position'] = 'Position';
$string['preview'] = 'Preview';
$string['preview_hlp'] = 'In the preview you can change the position order of questions.';
$string['preview_help'] = 'In the preview you can change the position order of questions.';
$string['previous_page'] = 'Previous page';
$string['public'] = 'Public';
$string['question'] = 'Question';
Expand All @@ -208,7 +208,7 @@
$string['saving_failed_because_missing_or_false_values'] = 'Saving failed because missing or false values';
$string['search_course'] = 'Search course';
$string['searchcourses'] = 'Search courses';
$string['searchcourses_hlp'] = 'Search for the Code or Name of the Course(s) that you wish to associate with this Feedback.';
$string['searchcourses_help'] = 'Search for the Code or Name of the Course(s) that you wish to associate with this Feedback.';
$string['selected_dump'] = 'Selected indexes of $SESSION variable are dumped below:';
$string['separator_decimal'] = '.';
$string['separator_thousand'] = ',';
Expand All @@ -234,17 +234,17 @@
$string['textfield_size'] = 'Textfield width';
$string['this_feedback_is_already_submitted'] = 'You\'ve already completed this activity.';
$string['timeclose'] = 'time to close';
$string['timeclose_hlp'] = 'You can specify times when the feedback is accessible for people to answer the questions.<br />
$string['timeclose_help'] = 'You can specify times when the feedback is accessible for people to answer the questions.<br />
At a time after this time here defined, the feedback will be unavailable.<br />
If the checkbox is not selected so there is no limit defined.';
$string['timeopen'] = 'time to open';
$string['timeopen_hlp'] = 'You can specify times when the feedback is accessible for people to answer the questions.<br />
$string['timeopen_help'] = 'You can specify times when the feedback is accessible for people to answer the questions.<br />
At a time before this time here defined, the feedback will be unavailable.<br />
If the checkbox is not selected so there is no limit defined.';
$string['typemissing'] = 'missing value "type"';
$string['update_item'] = 'Save changes to question';
$string['url_for_continue'] = 'URL for continue-button';
$string['url_for_continue_hlp'] = 'By default after a feedback is submitted the target of the
$string['url_for_continue_help'] = 'By default after a feedback is submitted the target of the
continue button is the course page.<br />
You can define here another target url for this continue-button.';
$string['url_for_continue_button'] = 'URL for continue-button';
Expand All @@ -253,5 +253,5 @@
$string['using_templates'] = 'Use a template';
$string['vertical'] = 'vertical';
$string['viewcompleted'] = 'completed feedbacks';
$string['viewcompleted_hlp'] = 'You may view completed Feedback forms, searchable by Course and/or by Question.
$string['viewcompleted_help'] = 'You may view completed Feedback forms, searchable by Course and/or by Question.
Feedback responses may be exported to Excel.';
2 changes: 1 addition & 1 deletion mod/page/lang/en/page.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
$string['legacyfilesactive'] = 'Active';
$string['legacyfilesdone'] = 'Finished';
$string['modulename'] = 'Page';
$string['modulename_hlp'] = 'Page module allows teachers to edit a page directly in a course.';
$string['modulename_help'] = 'Page module allows teachers to edit a page directly in a course.';
$string['modulenameplural'] = 'Pages';
$string['optionsheader'] = 'Options';
$string['pageadministration'] = 'Page administration';
Expand Down

0 comments on commit 5435c9d

Please sign in to comment.