? mod/forum/export ? mod/forum/styles.php Index: mod/forum/lib.php =================================================================== RCS file: /cvsroot/moodle/moodle/mod/forum/lib.php,v retrieving revision 1.609.2.70 diff -c -r1.609.2.70 lib.php *** mod/forum/lib.php 16 Oct 2008 20:45:28 -0000 1.609.2.70 --- mod/forum/lib.php 17 Oct 2008 18:52:46 -0000 *************** *** 3684,3689 **** --- 3684,3710 ---- } /** + * This function returns an array of attachments from the file directory + * @param $post Full post object + * @return array + **/ + function forum_get_attachments($post) { + + $returnarray = array(); + + if ($basedir = forum_file_area($post)) { + if ($files = get_directory_list($basedir)) { + foreach ($files as $file) { + if (is_file("$basedir/$file")) { + $returnarray[] = $file; + } + } + } + } + return $returnarray; + } + + /** * if return=html, then return a html string. * if return=text, then return a text-only string. * otherwise, print HTML for non-images, and return image HTML Index: mod/forum/view.php =================================================================== RCS file: /cvsroot/moodle/moodle/mod/forum/view.php,v retrieving revision 1.106.2.15 diff -c -r1.106.2.15 view.php *** mod/forum/view.php 19 Apr 2008 10:47:42 -0000 1.106.2.15 --- mod/forum/view.php 17 Oct 2008 18:52:46 -0000 *************** *** 186,191 **** --- 186,210 ---- // print_box_end(); // subscription echo ''; + $anydiscussions = get_records('forum_discussions', 'forum', $forum->id, '', 'id', 0, 1); + if ($anydiscussions) { + if ($forum->type != 'single') { + $actionoptions = array( + 'downloadlabel' => get_string('downloadlabel', 'forum'), + 'txt' => get_string('csv', 'forum'), + 'ods' => get_string('ods', 'forum'), + 'xls' => get_string('xls', 'forum'), + 'enddllabel' => '--', + 'printlabel' => get_string('printlabel', 'forum'), + 'print' => get_string('print', 'forum'), + 'endprintlabel' => '--' + ); + echo "
"; + popup_form("export/export.php?f=$forum->id&action=", $actionoptions, 'forumactions', '', get_string('chooseaction', 'forum')); + echo "
"; + } + } + // print_box_end(); // forumcontrol // print_box(' ', 'clearer'); Index: lang/en_utf8/forum.php =================================================================== RCS file: /cvsroot/moodle/moodle/lang/en_utf8/forum.php,v retrieving revision 1.21.4.10 diff -c -r1.21.4.10 forum.php *** lang/en_utf8/forum.php 7 Jul 2008 21:51:40 -0000 1.21.4.10 --- lang/en_utf8/forum.php 17 Oct 2008 18:52:46 -0000 *************** *** 29,34 **** --- 29,35 ---- $string['cannotviewpostyet'] = 'You cannot read other students questions in this discussion yet because you haven\'t posted'; $string['cannotadddiscussion'] = 'Adding discussions to this forum requires group membership.'; $string['cannotadddiscussionall'] = 'You do not have permission to add a new discussion topic for all participants.'; + $string['chooseaction'] = 'Export/Print . . .'; $string['cleanreadtime'] = 'Mark old posts as read hour'; $string['configcleanreadtime'] = 'The hour of the day to clean old posts from the \'read\' table.'; $string['configdisplaymode'] = 'The default display mode for discussions if one isn\'t set.'; *************** *** 47,52 **** --- 48,54 ---- $string['couldnotdeleteratings'] = 'Sorry, that cannot be deleted as people have already rated it'; $string['couldnotdeletereplies'] = 'Sorry, that cannot be deleted as people have already responded to it'; $string['couldnotupdate'] = 'Could not update your post due to an unknown error'; + $string['csv'] = 'Plain text file'; $string['delete'] = 'Delete'; $string['deleteddiscussion'] = 'The discussion topic has been deleted'; $string['deletedpost'] = 'The post has been deleted'; *************** *** 71,76 **** --- 73,79 ---- $string['displaymode'] = 'Display mode'; $string['displayperiod'] = 'Display Period'; $string['displaystart'] = 'Display start'; + $string['downloadlabel'] = '--Export to'; $string['eachuserforum'] = 'Each person posts one discussion'; $string['edit'] = 'Edit'; $string['editedby'] = 'Edited by $a->name - original submission $a->date'; *************** *** 174,179 **** --- 177,183 ---- $string['nowsubscribed'] = '$a->name will receive copies of \'$a->forum\' by email.'; $string['nowtracking'] = '$a->name is now tracking \'$a->forum\'.'; $string['numposts'] = '$a posts'; + $string['ods'] = 'OpenDocument spreadsheet'; $string['olderdiscussions'] = 'Older discussions'; $string['oldertopics'] = 'Older topics'; $string['oldpostdays'] = 'Read after days'; *************** *** 187,192 **** --- 191,198 ---- $string['postadded'] = '

Your post was successfully added.

You have $a to edit it if you want to make any changes.

'; $string['postaddedsuccess'] = 'Your post was successfully added.'; $string['postaddedtimeleft'] = 'You have $a to edit it if you want to make any changes.'; + $string['postedby'] = 'Post Author'; + $string['postedon'] = 'Date Posted'; $string['postincontext'] = 'See this post in context'; $string['postmailinfo'] = 'This is a copy of a message posted on the $a website. *************** *** 199,204 **** --- 205,213 ---- $string['posttoforum'] = 'Post to forum'; $string['postupdated'] = 'Your post was updated'; $string['potentialsubscribers'] = 'Potential subscribers'; + $string['printforum'] = 'Print forum'; + $string['print'] = 'Print'; + $string['printlabel'] = '--Print'; $string['processingdigest'] = 'Processing email digest for user $a'; $string['processingpost'] = 'Processing post $a'; $string['prunedpost'] = 'A new discussion has been created from that post'; *************** *** 285,290 **** --- 294,300 ---- $string['unsubscribeshort'] = 'Unsubscribe'; $string['usermarksread'] = 'Manual message read marking'; $string['warnafter'] = 'Post threshold for warning'; + $string['xls'] = 'Excel spreadsheet'; $string['yesforever'] = 'Yes, forever'; $string['yesinitially'] = 'Yes, initially'; $string['youratedthis'] = 'You rated this';