Skip to content

Commit

Permalink
MDL-53626 tool_lp: Change mentions of 'context' to 'category'
Browse files Browse the repository at this point in the history
  • Loading branch information
Frederic Massart committed Apr 18, 2016
1 parent 4e89144 commit 2f63310
Show file tree
Hide file tree
Showing 7 changed files with 22 additions and 11 deletions.
Expand Up @@ -52,10 +52,12 @@ protected static function define_class() {
*/
protected function get_other_values(renderer_base $output) {
$filters = array('competencyframeworkid' => $this->persistent->get_id());
$context = $this->persistent->get_context();
return array(
'canmanage' => has_capability('tool/lp:competencymanage', $this->persistent->get_context()),
'canmanage' => has_capability('tool/lp:competencymanage', $context),
'competenciescount' => api::count_competencies($filters),
'contextname' => $this->persistent->get_context()->get_context_name()
'contextname' => $context->get_context_name(),
'contextnamenoprefix' => $context->get_context_name(false)
);
}

Expand All @@ -74,6 +76,9 @@ protected static function define_other_properties() {
),
'contextname' => array(
'type' => PARAM_TEXT
),
'contextnamenoprefix' => array(
'type' => PARAM_TEXT
)
);
}
Expand Down
7 changes: 6 additions & 1 deletion admin/tool/lp/classes/external/template_exporter.php
Expand Up @@ -42,13 +42,15 @@ protected static function define_class() {
}

protected function get_other_values(renderer_base $output) {
$context = $this->persistent->get_context();
return array(
'duedateformatted' => userdate($this->persistent->get_duedate()),
'cohortscount' => template_cohort::count_records(array('templateid' => $this->persistent->get_id())),
'planscount' => plan::count_records(array('templateid' => $this->persistent->get_id())),
'canmanage' => $this->persistent->can_manage(),
'canread' => $this->persistent->can_read(),
'contextname' => $this->persistent->get_context()->get_context_name()
'contextname' => $context->get_context_name(),
'contextnamenoprefix' => $context->get_context_name(false)
);
}

Expand All @@ -71,6 +73,9 @@ protected static function define_other_properties() {
),
'contextname' => array(
'type' => PARAM_TEXT,
),
'contextnamenoprefix' => array(
'type' => PARAM_TEXT,
)
);
}
Expand Down
4 changes: 2 additions & 2 deletions admin/tool/lp/classes/form/competency_framework.php
Expand Up @@ -91,8 +91,8 @@ public function definition() {
$mform->setDefault('visible', true);
$mform->addHelpButton('visible', 'visible', 'tool_lp');

$mform->addElement('static', 'context', get_string('context', 'core_role'));
$mform->setDefault('context', $context->get_context_name());
$mform->addElement('static', 'context', get_string('category', 'tool_lp'));
$mform->setDefault('context', $context->get_context_name(false));

$mform->addElement('header', 'taxonomyhdr', get_string('taxonomies', 'tool_lp'));
$taxonomies = \tool_lp\competency_framework::get_taxonomies_list();
Expand Down
4 changes: 2 additions & 2 deletions admin/tool/lp/classes/form/template.php
Expand Up @@ -68,8 +68,8 @@ public function definition() {
$mform->setDefault('visible', true);
$mform->addHelpButton('visible', 'visible', 'tool_lp');

$mform->addElement('static', 'context', get_string('context', 'core_role'));
$mform->setDefault('context', $context->get_context_name());
$mform->addElement('static', 'context', get_string('category', 'tool_lp'));
$mform->setDefault('context', $context->get_context_name(false));
// Disable short forms.
$mform->setDisableShortforms();

Expand Down
1 change: 1 addition & 0 deletions admin/tool/lp/lang/en/tool_lp.php
Expand Up @@ -45,6 +45,7 @@
$string['cannotaddrules'] = 'This competency cannot be configured.';
$string['cannotcreateuserplanswhentemplateduedateispassed'] = 'New user plans can not be created: this template\'s due date has, or is about to, expire.';
$string['cannotcreateuserplanswhentemplatehidden'] = 'New user plans can not be created while this template is hidden.';
$string['category'] = 'Category';
$string['chooserating'] = 'Choose a rating...';
$string['cohortssyncedtotemplate'] = 'Cohorts synced to this template';
$string['competencies'] = 'Competencies';
Expand Down
Expand Up @@ -44,7 +44,7 @@
<tr>
<th scope="col">{{#str}}competencyframeworkname, tool_lp{{/str}}</th>
<th scope="col">{{#str}}competencies, tool_lp{{/str}}</th>
<th scope="col">{{#str}}context, core_role{{/str}}</th>
<th scope="col">{{#str}}category, tool_lp{{/str}}</th>
<th scope="col">{{#str}}actions, tool_lp{{/str}}</th>
</tr>
</thead>
Expand All @@ -53,7 +53,7 @@
<tr class="drag-samenode" data-frameworkid="{{id}}">
<td><span class="drag-handlecontainer"></span><span><a href="{{pluginbaseurl}}/competencies.php?competencyframeworkid={{id}}&amp;pagecontextid={{pagecontextid}}">{{shortname}} ({{idnumber}})</a></span> {{^visible}}{{#str}}hiddenhint, tool_lp{{/str}}{{/visible}}</td>
<td>{{competenciescount}}</td>
<td>{{contextname}}</td>
<td>{{contextnamenoprefix}}</td>
<td>
{{#canmanage}}
<ul title="{{#str}}edit{{/str}}" class="competencyframeworkactions">
Expand Down
4 changes: 2 additions & 2 deletions admin/tool/lp/templates/manage_templates_page.mustache
Expand Up @@ -42,7 +42,7 @@
<thead>
<tr>
<th scope="col">{{#str}}templatename, tool_lp{{/str}}</th>
<th scope="col">{{#str}}context, core_role{{/str}}</th>
<th scope="col">{{#str}}category, tool_lp{{/str}}</th>
<th scope="col">{{#str}}cohorts, core_cohort{{/str}}</th>
<th scope="col">{{#str}}userplans, tool_lp{{/str}}</th>
{{#canmanage}}
Expand All @@ -54,7 +54,7 @@
{{#templates}}
<tr class="drag-samenode" data-templateid="{{id}}">
<td><a href="{{pluginbaseurl}}/templatecompetencies.php?templateid={{id}}&amp;pagecontextid={{pagecontextid}}">{{shortname}}</a></span> {{^visible}}{{#str}}hiddenhint, tool_lp{{/str}}{{/visible}}</td>
<td>{{contextname}}</td>
<td>{{contextnamenoprefix}}</td>
<td><a class="template-cohorts" href="{{pluginbaseurl}}/template_cohorts.php?id={{id}}&amp;pagecontextid={{pagecontextid}}">{{cohortscount}}</a></td>
<td><a class="template-userplans" href="{{pluginbaseurl}}/template_plans.php?id={{id}}&amp;pagecontextid={{pagecontextid}}">{{planscount}}</a></td>
<td>
Expand Down

0 comments on commit 2f63310

Please sign in to comment.