Commit afc88c1c authored by Robert Lyon's avatar Robert Lyon Committed by Gerrit Code Review
Browse files

Merge "Bug 1692760: Mention application on External apps for "Enabled""

parents 5017cb08 17b6d856
......@@ -30,6 +30,8 @@ $string['managespecific'] = 'Manage "%s"';
$string['connectspecific'] = 'Connect "%s"';
$string['editing'] = 'Editing';
$string['settingsspecific'] = 'Settings for "%s"';
$string['enabledspecific'] = '"%s" is enabled';
$string['disabledspecific'] = '"%s" is disabled';
$string['move'] = 'Move';
$string['save'] = 'Save';
$string['submit'] = 'Submit';
......
......@@ -4755,30 +4755,32 @@ function can_use_skins($userid = null, $managesiteskin=false, $issiteview=false)
*
* @param string $type Type of icon image to show
* @param string $id Optional id to add to the image
* @param string $title Optional title string to add to the image
*
* @return string An <img> tag of the icon we want
*/
function display_icon($type, $id = false) {
function display_icon($type, $id = false, $title = "") {
global $THEME;
switch ($type) {
case 'on':
case 'yes':
case 'success':
case 'true':
case 'enabled':
$image = 'icon icon-lg icon-check text-success';
case 'enabledspecific':
$image = 'icon icon-lg icon-check text-success ';
break;
case 'off':
case 'no':
case 'fail':
case 'false':
case 'disabled':
$image = 'icon icon-lg icon-times text-danger';
case 'disabledspecific':
$image = 'icon icon-lg icon-times text-danger ';
break;
}
$html = '<span class="' . $image . 'displayicon" title="' . get_string($type) . '"';
$title = empty($title) ? get_string($type) : hsc($title);
$html = '<span class="' . $image . 'displayicon" title="' . $title . '"';
if ($id) {
$html .= ' id="' . $id . '"';
}
......
......@@ -414,7 +414,11 @@ function webservice_server_list_form($sopts, $iopts) {
'key' => $consumer->consumer_key,
);
$form['elements']['id' . $consumer->id . '_enabled'] = array(
'value' => (($consumer->enabled == 1) ? display_icon('enabled') : display_icon('disabled')),
'value' => (
($consumer->enabled == 1) ?
display_icon('enabledspecific', false, get_string('enabledspecific', 'mahara', $consumer->application_title)) :
display_icon('disabledspecific', false, get_string('disabledspecific', 'mahara', $consumer->application_title))
),
'type' => 'html',
'class' => 'text-center',
'key' => $consumer->consumer_key,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment