Skip to content

Commit

Permalink
MDL-21137 MNet: UI to choose peer theme replaced with simple selector
Browse files Browse the repository at this point in the history
There is no need to have whole featured theme selector with previews
etc here. Following the same form element as they have in Mahara, the
theme can now be selected for a given peer at 'Review host details' tab.
I have also noticed that force_theme and theme columns are redundant at
the moment. Keeping them both for future improvements, though.
  • Loading branch information
mudrd8mz committed Jul 12, 2010
1 parent d55b0e6 commit 7c70229
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 202 deletions.
122 changes: 0 additions & 122 deletions admin/mnet/mnet_themes.html

This file was deleted.

77 changes: 0 additions & 77 deletions admin/mnet/mnet_themes.php

This file was deleted.

7 changes: 7 additions & 0 deletions admin/mnet/peer_forms.php
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,13 @@ function definition() {

$mform->addElement('text', 'wwwroot', get_string('hostname', 'mnet'));
$mform->setType('wwwroot', PARAM_URL);

$themes = array('' => get_string('forceno'));
foreach (array_keys(get_plugin_list('theme')) as $themename) {
$themes[$themename] = get_string('pluginname', 'theme_'.$themename);
}
$mform->addElement('select', 'theme', get_string('forcetheme'), $themes);

$mform->addElement('textarea', 'public_key', get_string('publickey', 'mnet'), array('rows' => 17, 'cols' => 100, 'class' => 'smalltext'));
$mform->setType('public_key', PARAM_PEM);

Expand Down
8 changes: 8 additions & 0 deletions admin/mnet/peers.php
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,14 @@
$mnet_peer->set_name($formdata->name);
}

if (empty($formdata->theme)) {
$mnet_peer->force_theme = 0;
$mnet_peer->theme = null;
} else {
$mnet_peer->force_theme = 1;
$mnet_peer->theme = $formdata->theme;
}

$mnet_peer->updateparams->deleted = $formdata->deleted;
$oldkey = $mnet_peer->public_key;
$mnet_peer->public_key = $formdata->public_key;
Expand Down
2 changes: 0 additions & 2 deletions admin/mnet/tabs.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@
$strmnetservices = get_string('mnetservices', 'mnet');
$strmnetlog = get_string('mnetlog', 'mnet');
$strmnetedithost = get_string('reviewhostdetails', 'mnet');
$strmnetthemes = get_string('mnetthemes', 'mnet');

$logurl = $CFG->wwwroot.
'/course/report/log/index.php?chooselog=1&showusers=1&showcourses=1&host_course='.$mnet_peer->id.
Expand All @@ -46,7 +45,6 @@
if (isset($mnet_peer->id) && $mnet_peer->id > 0) {
$tabs[] = new tabobject('mnetdetails', 'peers.php?step=update&hostid='.$mnet_peer->id, $strmnetedithost, $strmnetedithost, false);
$tabs[] = new tabobject('mnetservices', 'services.php?hostid='.$mnet_peer->id, $strmnetservices, $strmnetservices, false);
$tabs[] = new tabobject('mnetthemes', 'mnet_themes.php?step=list&hostid='.$mnet_peer->id, $strmnetthemes, $strmnetthemes, false);
if ($mnet_peer->application->name == 'moodle' && $mnet_peer->id != $CFG->mnet_all_hosts_id) {
$tabs[] = new tabobject('mnetlog', $logurl, $strmnetlog, $strmnetlog, false);
}
Expand Down
1 change: 0 additions & 1 deletion lang/en/mnet.php
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,6 @@
$string['mnetservices'] = 'Services';
$string['mnet_session_prohibited'] = 'Users from your home server are not currently permitted to roam to {$a}.';
$string['mnetsettings'] = 'Moodle network settings';
$string['mnetthemes'] = 'Themes';
$string['moodle_home_help'] = 'The path to the homepage of Moodle on the remote host, e.g. /moodle/.';
$string['moodleloc'] = 'Moodle location';
$string['name'] = 'Name';
Expand Down

0 comments on commit 7c70229

Please sign in to comment.