Skip to content

Commit

Permalink
community block MDL-24830 better "wait for upload" message + fix a ja…
Browse files Browse the repository at this point in the history
…vascript issue when screenshot number = 0 (metadata page)
  • Loading branch information
mouneyrac committed Oct 26, 2010
1 parent ba14d72 commit 4a73f9b
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 18 deletions.
13 changes: 7 additions & 6 deletions course/publish/forms.php
Expand Up @@ -154,12 +154,13 @@ public function definition() {
$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;
Expand Down
12 changes: 4 additions & 8 deletions course/publish/renderer.php
Expand Up @@ -164,14 +164,10 @@ public function confirmunpublishing($publication) {
* @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;
}

Expand All @@ -184,7 +180,7 @@ public function sendingbackupinfo($backupfile) {
*/
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));
Expand Down
3 changes: 1 addition & 2 deletions lang/en/hub.php
Expand Up @@ -184,9 +184,8 @@
$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';
Expand Down
4 changes: 3 additions & 1 deletion theme/canvas/style/course.css
Expand Up @@ -120,4 +120,6 @@
}

/* Publication */
#page-course-publish-metadata .metadatatext {width: 400px;}
#page-course-publish-metadata .metadatatext {width: 400px;}
#page-course-publish-backup .courseuploadtextinfo {text-align: center;}
#page-course-publish-backup .sharecoursecontinue {text-align: center;}
4 changes: 3 additions & 1 deletion theme/standard/style/course.css
Expand Up @@ -104,4 +104,6 @@
.course_category_tree .category .course:hover {background-color:#eee;}

/* Publication */
#page-course-publish-metadata .metadatatext {width: 400px;}
#page-course-publish-metadata .metadatatext {width: 400px;}
#page-course-publish-backup .courseuploadtextinfo {text-align: center;}
#page-course-publish-backup .sharecoursecontinue {text-align: center;}

0 comments on commit 4a73f9b

Please sign in to comment.