From dec1351465aee26117f60d7c37bac963da533e29 Mon Sep 17 00:00:00 2001 From: Martin Dougiamas Date: Wed, 19 May 2010 07:41:25 +0000 Subject: [PATCH] MDL-19315 Tidying up the publish page to remove the layout table --- course/publish/renderer.php | 45 ++++++++++--------------------------- lang/en/hub.php | 14 ++++++------ 2 files changed, 19 insertions(+), 40 deletions(-) diff --git a/course/publish/renderer.php b/course/publish/renderer.php index 03809f31891..0a77eccaa54 100644 --- a/course/publish/renderer.php +++ b/course/publish/renderer.php @@ -35,44 +35,23 @@ class core_publish_renderer extends plugin_renderer_base { public function publicationselector($courseid) { global $OUTPUT; - $table = new html_table(); - $table->head = array(get_string('advertise', 'hub'), get_string('share', 'hub')); - $table->size = array('50%', '50%'); - - //Advertise information cell - $advertisecell = get_string('advertisepublicationdetail', 'hub'); - $advertisecell .= html_writer::empty_tag('br').html_writer::empty_tag('br'); - $advertisecell = html_writer::tag('div', $advertisecell, array('class' => 'justifytext')); - - //Share information cell - $sharecell = get_string('sharepublicationdetail', 'hub'); - $sharecell .= html_writer::empty_tag('br').html_writer::empty_tag('br'); - $sharecell = html_writer::tag('div', $sharecell, array('class' => 'justifytext')); - - //add information cells - $cells = array($advertisecell, $sharecell); - $row = new html_table_row($cells); - $table->data[] = $row; + $text = ''; $advertiseurl = new moodle_url("/course/publish/hubselector.php", array('sesskey' => sesskey(), 'id' => $courseid, 'advertise' => true)); - $advertisebutton = new single_button($advertiseurl, get_string('selecthubforadvertise', 'hub')); - $advertisebutton->class = 'centeredbutton'; - $advertisecell = $OUTPUT->render($advertisebutton); + $advertisebutton = new single_button($advertiseurl, get_string('advertise', 'hub')); + $text .= $OUTPUT->render($advertisebutton); + $text .= html_writer::tag('div', get_string('advertisepublication_help', 'hub'), array('class' => 'publishhelp')); - $shareurl = new moodle_url("/course/publish/hubselector.php", + $text .= html_writer::empty_tag('br'); /// TODO Delete + + $uploadurl = new moodle_url("/course/publish/hubselector.php", array('sesskey' => sesskey(), 'id' => $courseid, 'share' => true)); - $sharebutton = new single_button($shareurl, get_string('selecthubforsharing', 'hub')); - $sharebutton->class = 'centeredbutton'; - $sharecell = $OUTPUT->render($sharebutton); - - //add button cells - $cells = array($advertisecell, $sharecell); - $row = new html_table_row($cells); - $table->data[] = $row; - - return html_writer::table($table); + $uploadbutton = new single_button($uploadurl, get_string('share', 'hub')); + $text .= $OUTPUT->render($uploadbutton); + $text .= html_writer::tag('div', get_string('sharepublication_help', 'hub'), array('class' => 'publishhelp')); + return $text; } /** @@ -151,4 +130,4 @@ class core_publish_renderer extends plugin_renderer_base { return $OUTPUT->confirm(get_string('unpublishconfirmation', 'hub', $publication), $formcontinue, $formcancel); } -} \ No newline at end of file +} diff --git a/lang/en/hub.php b/lang/en/hub.php index 3b10754ffe0..6f270e57c04 100644 --- a/lang/en/hub.php +++ b/lang/en/hub.php @@ -29,9 +29,9 @@ $string['advertise'] = 'Advertise this course for people to join'; $string['advertised'] = 'Advertised'; $string['advertiseon'] = 'Advertise this course on {$a}'; $string['readvertiseon'] = 'Update advertising information on {$a}'; -$string['advertiseonhub'] = 'Advertise this course on the hub'; +$string['advertiseonhub'] = 'Advertise this course on a hub'; $string['advertiseonmoodleorg'] = 'Advertise this course on moodle.org'; -$string['advertisepublicationdetail'] = 'Publishing your course makes it available to the world.'; +$string['advertisepublication_help'] = 'Advertising your course on a community hub server allows people to find this course and come here to enrol.'; $string['all'] = 'All'; $string['allowglobalsearch'] = 'Publish this hub and allow global search of all courses'; $string['allowpublicsearch'] = 'Publish this hub so people can join it'; @@ -160,11 +160,11 @@ $string['selecthubforsharing'] = 'Select hub for uploading'; $string['sendfollowinginfo'] = 'Send the following information:'; $string['settings'] = 'Settings'; $string['settingsupdated'] = 'Settings have been updated.'; -$string['share'] = 'Upload your course'; -$string['shareon'] = 'Upload your course to {$a}'; -$string['shareonhub'] = 'Upload your course to a hub'; -$string['shareonmoodleorg'] = 'Upload your course to Moodle.org'; -$string['sharepublicationdetail'] = 'You can upload on a community hub.'; +$string['share'] = 'Share this course for people to download'; +$string['shareon'] = 'Upload this course to {$a}'; +$string['shareonhub'] = 'Upload this course to a hub'; +$string['shareonmoodleorg'] = 'Upload this course to Moodle.org'; +$string['sharepublication_help'] = 'Uploading this course to a community hub server will enable people to download it and install it on their own Moodle sites.'; $string['siteadmin'] = 'Administrator'; $string['sitecreated'] = 'Site created'; $string['sitedesc'] = 'Description';