From 4a73f9be8cd3733415b5aa4ca2508a3579508abe Mon Sep 17 00:00:00 2001 From: jerome mouneyrac Date: Tue, 26 Oct 2010 06:26:52 +0000 Subject: [PATCH] community block MDL-24830 better "wait for upload" message + fix a javascript issue when screenshot number = 0 (metadata page) --- course/publish/forms.php | 13 +++++++------ course/publish/renderer.php | 12 ++++-------- lang/en/hub.php | 3 +-- theme/canvas/style/course.css | 4 +++- theme/standard/style/course.css | 4 +++- 5 files changed, 18 insertions(+), 18 deletions(-) diff --git a/course/publish/forms.php b/course/publish/forms.php index baedfaf72e3..2d9f8996812 100644 --- a/course/publish/forms.php +++ b/course/publish/forms.php @@ -154,12 +154,13 @@ class course_publication_form extends moodleform { $defaultcreatornotesformat = $publishedcourse['creatornotesformat']; $screenshotsnumber = $publishedcourse['screenshots']; $privacy = $publishedcourse['privacy']; - - $page->requires->yui_module('moodle-block_community-imagegallery', - 'M.blocks_community.init_imagegallery', - array(array('imageids' => array($hubcourseid), - 'imagenumbers' => array($screenshotsnumber), - 'huburl' => $huburl))); + if (($screenshotsnumber > 0) and !empty($privacy)) { + $page->requires->yui_module('moodle-block_community-imagegallery', + 'M.blocks_community.init_imagegallery', + array(array('imageids' => array($hubcourseid), + 'imagenumbers' => array($screenshotsnumber), + 'huburl' => $huburl))); + } } else { $defaultfullname = $course->fullname; $defaultshortname = $course->shortname; diff --git a/course/publish/renderer.php b/course/publish/renderer.php index 98e70a3fc9f..ead613b4dcd 100644 --- a/course/publish/renderer.php +++ b/course/publish/renderer.php @@ -164,14 +164,10 @@ class core_publish_renderer extends plugin_renderer_base { * @return $html string */ public function sendingbackupinfo($backupfile) { - $html = html_writer::tag('div', get_string('sending', 'hub'), - array('class' => 'textinfo')); $sizeinfo = new stdClass(); - $sizeinfo->total = $backupfile->get_filesize() / 1000000; - $sizeinfo->modem = (int) ($backupfile->get_filesize() / 5000); - $sizeinfo->dsl = (int) $sizeinfo->total; - $html .= html_writer::tag('div', get_string('sendingsize', 'hub', $sizeinfo), - array('class' => 'textinfo')); + $sizeinfo->total = number_format($backupfile->get_filesize() / 1000000, 2); + $html = html_writer::tag('div', get_string('sendingsize', 'hub', $sizeinfo), + array('class' => 'courseuploadtextinfo')); return $html; } @@ -184,7 +180,7 @@ class core_publish_renderer extends plugin_renderer_base { */ public function sentbackupinfo($id, $huburl, $hubname) { $html = html_writer::tag('div', get_string('sent', 'hub'), - array('class' => 'textinfo')); + array('class' => 'courseuploadtextinfo')); $publishindexurl = new moodle_url('/course/publish/index.php', array('sesskey' => sesskey(), 'id' => $id, 'published' => true, 'huburl' => $huburl, 'hubname' => $hubname)); diff --git a/lang/en/hub.php b/lang/en/hub.php index 328478c1c5c..4f06416b2d4 100644 --- a/lang/en/hub.php +++ b/lang/en/hub.php @@ -184,9 +184,8 @@ $string['selecthub'] = 'Select hub'; $string['selecthubinfo'] = 'A community hub is a server that lists courses. You can only publish your courses on hubs that this Moodle site is registered with. If the hub you want is not listed below, please contact your site administrator.'; $string['selecthubforadvertise'] = 'Select hub for advertising'; $string['selecthubforsharing'] = 'Select hub for uploading'; -$string['sending'] = 'Do not refresh your browser ! The site is sending the course backup...'; $string['sendingcourse'] = 'Sending course'; -$string['sendingsize'] = 'Sending the backup ({$a->total}Mb) should take approximately between {$a->dsl}s and {$a->modem}s, depending on the site/hub connection...'; +$string['sendingsize'] = 'Please wait the course file is uploading ({$a->total}Mb)...'; $string['sendfollowinginfo'] = 'More information'; $string['sendfollowinginfo_help'] = 'The following information will be sent to contribute to overall statistics only. It will not be made public on any site listing.'; $string['sent'] = '...finished'; diff --git a/theme/canvas/style/course.css b/theme/canvas/style/course.css index 75512dd1f8b..02c7fde2d70 100644 --- a/theme/canvas/style/course.css +++ b/theme/canvas/style/course.css @@ -120,4 +120,6 @@ } /* Publication */ -#page-course-publish-metadata .metadatatext {width: 400px;} \ No newline at end of file +#page-course-publish-metadata .metadatatext {width: 400px;} +#page-course-publish-backup .courseuploadtextinfo {text-align: center;} +#page-course-publish-backup .sharecoursecontinue {text-align: center;} \ No newline at end of file diff --git a/theme/standard/style/course.css b/theme/standard/style/course.css index 7e4a36c24af..34c9e108047 100644 --- a/theme/standard/style/course.css +++ b/theme/standard/style/course.css @@ -104,4 +104,6 @@ .course_category_tree .category .course:hover {background-color:#eee;} /* Publication */ -#page-course-publish-metadata .metadatatext {width: 400px;} \ No newline at end of file +#page-course-publish-metadata .metadatatext {width: 400px;} +#page-course-publish-backup .courseuploadtextinfo {text-align: center;} +#page-course-publish-backup .sharecoursecontinue {text-align: center;} \ No newline at end of file