Merge branch 'MDL-25874' of git://git.luns.net.uk/moodle
authorSam Hemelryk <sam@moodle.com>
Mon, 7 Feb 2011 06:01:00 +0000 (14:01 +0800)
committerSam Hemelryk <sam@moodle.com>
Mon, 7 Feb 2011 06:01:00 +0000 (14:01 +0800)
650 files changed:
admin/dbtransfer/lib.php
admin/modules.php
admin/multilangupgrade.php
admin/qtypes.php
admin/settings/development.php
admin/settings/plugins.php
admin/settings/subsystems.php
admin/settings/users.php
admin/uploaduser.php
admin/user/lib.php
admin/user/user_bulk_confirm.php
admin/user/user_bulk_delete.php
admin/user/user_bulk_forcepasswordchange.php
admin/user/user_bulk_message.php
admin/xmldb/index.php
auth/shibboleth/logout.php
backup/lib.php
backup/restorelib.php
blocks/activity_modules/block_activity_modules.php
blocks/course_overview/block_course_overview.php
blocks/course_summary/block_course_summary.php
blocks/html/block_html.php
blocks/myprofile/block_myprofile.php
blocks/myprofile/edit_form.php
blocks/myprofile/lang/en/block_myprofile.php
blocks/myprofile/version.php
blocks/online_users/block_online_users.php
blocks/site_main_menu/block_site_main_menu.php
blocks/social_activities/block_social_activities.php
blog/lib.php
blog/locallib.php
brokenfile.php [new file with mode: 0644]
calendar/export_execute.php
calendar/lib.php
config-dist.php
course/lib.php
course/report/completion/index.php
course/report/completion/mod.php
course/report/outline/index.php
course/report/participation/index.php
course/report/progress/index.php
course/resources.php
course/togglecompletion.php
course/user.php
enrol/authorize/localfuncs.php
enrol/category/locallib.php
enrol/database/lib.php
enrol/imsenterprise/db/install.php [new file with mode: 0644]
enrol/imsenterprise/db/upgrade.php [new file with mode: 0644]
enrol/imsenterprise/version.php
enrol/self/lib.php
filter/activitynames/lang/en/filter_activitynames.php
filter/algebra/algebradebug.php
filter/algebra/lang/en/filter_algebra.php
filter/censor/lang/en/filter_censor.php
filter/emailprotect/lang/en/filter_emailprotect.php
filter/mediaplugin/filter.php
filter/mediaplugin/lang/en/filter_mediaplugin.php
filter/tex/lang/en/filter_tex.php
filter/tex/texdebug.php
grade/import/csv/index.php [changed mode: 0755->0644]
grade/import/grade_import_form.php [changed mode: 0755->0644]
grade/import/lib.php [changed mode: 0755->0644]
grade/report/grader/lib.php
grade/report/lib.php [changed mode: 0755->0644]
grade/report/user/index.php
grade/report/user/lib.php
grade/report/user/settings.php
grade/report/user/styles.css
group/assign.php
group/members.php
group/overview.php
install/lang/ca/admin.php
install/lang/da/error.php
install/lang/da/install.php
install/lang/he/install.php
install/lang/lv/install.php
install/lang/nn/langconfig.php
install/lang/pl/admin.php
install/lang/pl/install.php
install/lang/pt/error.php
install/lang/pt_br/install.php
install/lang/sl/admin.php
install/lang/ta_lk/install.php
lang/en/admin.php
lang/en/completion.php
lang/en/grades.php [changed mode: 0755->0644]
lib/accesslib.php
lib/ajax/getnavbranch.php
lib/completion/completion_criteria_activity.php
lib/completion/completion_criteria_course.php
lib/completion/completion_criteria_date.php
lib/completion/completion_criteria_duration.php
lib/completion/completion_criteria_grade.php
lib/completion/cron.php
lib/completionlib.php
lib/datalib.php
lib/db/access.php
lib/db/install.xml [changed mode: 0755->0644]
lib/db/upgrade.php
lib/db/upgradelib.php
lib/dml/moodle_database.php
lib/dml/mysqli_native_moodle_database.php
lib/dml/oci_native_moodle_database.php
lib/dml/pdo_moodle_database.php
lib/dml/pgsql_native_moodle_database.php
lib/editor/tinymce/lib.php
lib/environmentlib.php
lib/eventslib.php
lib/filelib.php
lib/filestorage/file_storage.php
lib/grade/grade_category.php
lib/grade/grade_grade.php
lib/grade/grade_item.php
lib/grade/grade_outcome.php
lib/grade/grade_scale.php
lib/gradelib.php
lib/grouplib.php
lib/javascript-static.js
lib/modinfolib.php [new file with mode: 0644]
lib/moodlelib.php
lib/navigationlib.php
lib/outputcomponents.php
lib/outputrenderers.php
lib/questionlib.php
lib/sessionlib.php
lib/setup.php
lib/setuplib.php
lib/simpletest/testcomponentlib.php [new file with mode: 0644]
lib/simpletest/testfilelib.php
lib/simpletest/testoutputcomponents.php
lib/simpletestlib.php
lib/spikephpcoverage/readme_moodle.txt
lib/spikephpcoverage/src/phpcoverage.remote.bottom.inc.php
lib/spikephpcoverage/src/phpcoverage.remote.top.inc.php
lib/upgradelib.php
lib/weblib.php
lib/yui/2.8.1/build/animation/animation-debug.js [deleted file]
lib/yui/2.8.1/build/animation/animation-min.js [deleted file]
lib/yui/2.8.1/build/animation/animation.js [deleted file]
lib/yui/2.8.1/build/assets/skins/sam/ajax-loader.gif [deleted file]
lib/yui/2.8.1/build/assets/skins/sam/asc.gif [deleted file]
lib/yui/2.8.1/build/assets/skins/sam/autocomplete.css [deleted file]
lib/yui/2.8.1/build/assets/skins/sam/back-h.png [deleted file]
lib/yui/2.8.1/build/assets/skins/sam/back-v.png [deleted file]
lib/yui/2.8.1/build/assets/skins/sam/bar-h.png [deleted file]
lib/yui/2.8.1/build/assets/skins/sam/bar-v.png [deleted file]
lib/yui/2.8.1/build/assets/skins/sam/bg-h.gif [deleted file]
lib/yui/2.8.1/build/assets/skins/sam/bg-v.gif [deleted file]
lib/yui/2.8.1/build/assets/skins/sam/blankimage.png [deleted file]
lib/yui/2.8.1/build/assets/skins/sam/button.css [deleted file]
lib/yui/2.8.1/build/assets/skins/sam/calendar.css [deleted file]
lib/yui/2.8.1/build/assets/skins/sam/carousel.css [deleted file]
lib/yui/2.8.1/build/assets/skins/sam/check0.gif [deleted file]
lib/yui/2.8.1/build/assets/skins/sam/check1.gif [deleted file]
lib/yui/2.8.1/build/assets/skins/sam/check2.gif [deleted file]
lib/yui/2.8.1/build/assets/skins/sam/colorpicker.css [deleted file]
lib/yui/2.8.1/build/assets/skins/sam/container.css [deleted file]
lib/yui/2.8.1/build/assets/skins/sam/datatable.css [deleted file]
lib/yui/2.8.1/build/assets/skins/sam/desc.gif [deleted file]
lib/yui/2.8.1/build/assets/skins/sam/dt-arrow-dn.png [deleted file]
lib/yui/2.8.1/build/assets/skins/sam/dt-arrow-up.png [deleted file]
lib/yui/2.8.1/build/assets/skins/sam/editor-knob.gif [deleted file]
lib/yui/2.8.1/build/assets/skins/sam/editor-sprite-active.gif [deleted file]
lib/yui/2.8.1/build/assets/skins/sam/editor-sprite.gif [deleted file]
lib/yui/2.8.1/build/assets/skins/sam/editor.css [deleted file]
lib/yui/2.8.1/build/assets/skins/sam/header_background.png [deleted file]
lib/yui/2.8.1/build/assets/skins/sam/hue_bg.png [deleted file]
lib/yui/2.8.1/build/assets/skins/sam/imagecropper.css [deleted file]
lib/yui/2.8.1/build/assets/skins/sam/layout.css [deleted file]
lib/yui/2.8.1/build/assets/skins/sam/layout_sprite.png [deleted file]
lib/yui/2.8.1/build/assets/skins/sam/loading.gif [deleted file]
lib/yui/2.8.1/build/assets/skins/sam/logger.css [deleted file]
lib/yui/2.8.1/build/assets/skins/sam/menu-button-arrow-disabled.png [deleted file]
lib/yui/2.8.1/build/assets/skins/sam/menu-button-arrow.png [deleted file]
lib/yui/2.8.1/build/assets/skins/sam/menu.css [deleted file]
lib/yui/2.8.1/build/assets/skins/sam/menubaritem_submenuindicator.png [deleted file]
lib/yui/2.8.1/build/assets/skins/sam/menubaritem_submenuindicator_disabled.png [deleted file]
lib/yui/2.8.1/build/assets/skins/sam/menuitem_checkbox.png [deleted file]
lib/yui/2.8.1/build/assets/skins/sam/menuitem_checkbox_disabled.png [deleted file]
lib/yui/2.8.1/build/assets/skins/sam/menuitem_submenuindicator.png [deleted file]
lib/yui/2.8.1/build/assets/skins/sam/menuitem_submenuindicator_disabled.png [deleted file]
lib/yui/2.8.1/build/assets/skins/sam/paginator.css [deleted file]
lib/yui/2.8.1/build/assets/skins/sam/picker_mask.png [deleted file]
lib/yui/2.8.1/build/assets/skins/sam/profilerviewer.css [deleted file]
lib/yui/2.8.1/build/assets/skins/sam/progressbar.css [deleted file]
lib/yui/2.8.1/build/assets/skins/sam/resize.css [deleted file]
lib/yui/2.8.1/build/assets/skins/sam/simpleeditor.css [deleted file]
lib/yui/2.8.1/build/assets/skins/sam/skin.css [deleted file]
lib/yui/2.8.1/build/assets/skins/sam/slider.css [deleted file]
lib/yui/2.8.1/build/assets/skins/sam/split-button-arrow-active.png [deleted file]
lib/yui/2.8.1/build/assets/skins/sam/split-button-arrow-disabled.png [deleted file]
lib/yui/2.8.1/build/assets/skins/sam/split-button-arrow-focus.png [deleted file]
lib/yui/2.8.1/build/assets/skins/sam/split-button-arrow-hover.png [deleted file]
lib/yui/2.8.1/build/assets/skins/sam/split-button-arrow.png [deleted file]
lib/yui/2.8.1/build/assets/skins/sam/sprite.png [deleted file]
lib/yui/2.8.1/build/assets/skins/sam/sprite.psd [deleted file]
lib/yui/2.8.1/build/assets/skins/sam/tabview.css [deleted file]
lib/yui/2.8.1/build/assets/skins/sam/treeview-loading.gif [deleted file]
lib/yui/2.8.1/build/assets/skins/sam/treeview-sprite.gif [deleted file]
lib/yui/2.8.1/build/assets/skins/sam/treeview.css [deleted file]
lib/yui/2.8.1/build/assets/skins/sam/wait.gif [deleted file]
lib/yui/2.8.1/build/assets/skins/sam/yuitest.css [deleted file]
lib/yui/2.8.1/build/autocomplete/assets/autocomplete-core.css [deleted file]
lib/yui/2.8.1/build/autocomplete/assets/skins/sam/autocomplete-skin.css [deleted file]
lib/yui/2.8.1/build/autocomplete/assets/skins/sam/autocomplete.css [deleted file]
lib/yui/2.8.1/build/autocomplete/autocomplete-debug.js [deleted file]
lib/yui/2.8.1/build/autocomplete/autocomplete-min.js [deleted file]
lib/yui/2.8.1/build/autocomplete/autocomplete.js [deleted file]
lib/yui/2.8.1/build/base/base-min.css [deleted file]
lib/yui/2.8.1/build/base/base.css [deleted file]
lib/yui/2.8.1/build/button/assets/button-core.css [deleted file]
lib/yui/2.8.1/build/button/assets/skins/sam/button-skin.css [deleted file]
lib/yui/2.8.1/build/button/assets/skins/sam/button.css [deleted file]
lib/yui/2.8.1/build/button/assets/skins/sam/menu-button-arrow-disabled.png [deleted file]
lib/yui/2.8.1/build/button/assets/skins/sam/menu-button-arrow.png [deleted file]
lib/yui/2.8.1/build/button/assets/skins/sam/split-button-arrow-active.png [deleted file]
lib/yui/2.8.1/build/button/assets/skins/sam/split-button-arrow-disabled.png [deleted file]
lib/yui/2.8.1/build/button/assets/skins/sam/split-button-arrow-focus.png [deleted file]
lib/yui/2.8.1/build/button/assets/skins/sam/split-button-arrow-hover.png [deleted file]
lib/yui/2.8.1/build/button/assets/skins/sam/split-button-arrow.png [deleted file]
lib/yui/2.8.1/build/button/button-debug.js [deleted file]
lib/yui/2.8.1/build/button/button-min.js [deleted file]
lib/yui/2.8.1/build/button/button.js [deleted file]
lib/yui/2.8.1/build/calendar/assets/calendar-core.css [deleted file]
lib/yui/2.8.1/build/calendar/assets/calendar.css [deleted file]
lib/yui/2.8.1/build/calendar/assets/calgrad.png [deleted file]
lib/yui/2.8.1/build/calendar/assets/callt.gif [deleted file]
lib/yui/2.8.1/build/calendar/assets/calrt.gif [deleted file]
lib/yui/2.8.1/build/calendar/assets/calx.gif [deleted file]
lib/yui/2.8.1/build/calendar/assets/skins/sam/calendar-skin.css [deleted file]
lib/yui/2.8.1/build/calendar/assets/skins/sam/calendar.css [deleted file]
lib/yui/2.8.1/build/calendar/calendar-debug.js [deleted file]
lib/yui/2.8.1/build/calendar/calendar-min.js [deleted file]
lib/yui/2.8.1/build/calendar/calendar.js [deleted file]
lib/yui/2.8.1/build/carousel/assets/ajax-loader.gif [deleted file]
lib/yui/2.8.1/build/carousel/assets/carousel-core.css [deleted file]
lib/yui/2.8.1/build/carousel/assets/skins/sam/ajax-loader.gif [deleted file]
lib/yui/2.8.1/build/carousel/assets/skins/sam/carousel-skin.css [deleted file]
lib/yui/2.8.1/build/carousel/assets/skins/sam/carousel.css [deleted file]
lib/yui/2.8.1/build/carousel/carousel-debug.js [deleted file]
lib/yui/2.8.1/build/carousel/carousel-min.js [deleted file]
lib/yui/2.8.1/build/carousel/carousel.js [deleted file]
lib/yui/2.8.1/build/charts/assets/charts.swf [deleted file]
lib/yui/2.8.1/build/charts/charts-debug.js [deleted file]
lib/yui/2.8.1/build/charts/charts-min.js [deleted file]
lib/yui/2.8.1/build/charts/charts.js [deleted file]
lib/yui/2.8.1/build/colorpicker/assets/colorpicker-core.css [deleted file]
lib/yui/2.8.1/build/colorpicker/assets/hue_thumb.png [deleted file]
lib/yui/2.8.1/build/colorpicker/assets/picker_mask.png [deleted file]
lib/yui/2.8.1/build/colorpicker/assets/picker_thumb.png [deleted file]
lib/yui/2.8.1/build/colorpicker/assets/skins/sam/colorpicker-skin.css [deleted file]
lib/yui/2.8.1/build/colorpicker/assets/skins/sam/colorpicker.css [deleted file]
lib/yui/2.8.1/build/colorpicker/assets/skins/sam/hue_bg.png [deleted file]
lib/yui/2.8.1/build/colorpicker/assets/skins/sam/picker_mask.png [deleted file]
lib/yui/2.8.1/build/colorpicker/colorpicker-debug.js [deleted file]
lib/yui/2.8.1/build/colorpicker/colorpicker-min.js [deleted file]
lib/yui/2.8.1/build/colorpicker/colorpicker.js [deleted file]
lib/yui/2.8.1/build/connection/connection-debug.js [deleted file]
lib/yui/2.8.1/build/connection/connection-min.js [deleted file]
lib/yui/2.8.1/build/connection/connection.js [deleted file]
lib/yui/2.8.1/build/connection/connection.swf [deleted file]
lib/yui/2.8.1/build/connection/connection_core-debug.js [deleted file]
lib/yui/2.8.1/build/connection/connection_core-min.js [deleted file]
lib/yui/2.8.1/build/connection/connection_core.js [deleted file]
lib/yui/2.8.1/build/container/assets/alrt16_1.gif [deleted file]
lib/yui/2.8.1/build/container/assets/blck16_1.gif [deleted file]
lib/yui/2.8.1/build/container/assets/close12_1.gif [deleted file]
lib/yui/2.8.1/build/container/assets/container-core.css [deleted file]
lib/yui/2.8.1/build/container/assets/container.css [deleted file]
lib/yui/2.8.1/build/container/assets/hlp16_1.gif [deleted file]
lib/yui/2.8.1/build/container/assets/info16_1.gif [deleted file]
lib/yui/2.8.1/build/container/assets/skins/sam/container-skin.css [deleted file]
lib/yui/2.8.1/build/container/assets/skins/sam/container.css [deleted file]
lib/yui/2.8.1/build/container/assets/tip16_1.gif [deleted file]
lib/yui/2.8.1/build/container/assets/warn16_1.gif [deleted file]
lib/yui/2.8.1/build/container/container-debug.js [deleted file]
lib/yui/2.8.1/build/container/container-min.js [deleted file]
lib/yui/2.8.1/build/container/container.js [deleted file]
lib/yui/2.8.1/build/container/container_core-debug.js [deleted file]
lib/yui/2.8.1/build/container/container_core-min.js [deleted file]
lib/yui/2.8.1/build/container/container_core.js [deleted file]
lib/yui/2.8.1/build/cookie/cookie-debug.js [deleted file]
lib/yui/2.8.1/build/cookie/cookie-min.js [deleted file]
lib/yui/2.8.1/build/cookie/cookie.js [deleted file]
lib/yui/2.8.1/build/datasource/datasource-debug.js [deleted file]
lib/yui/2.8.1/build/datasource/datasource-min.js [deleted file]
lib/yui/2.8.1/build/datasource/datasource.js [deleted file]
lib/yui/2.8.1/build/datatable/assets/datatable-core.css [deleted file]
lib/yui/2.8.1/build/datatable/assets/datatable.css [deleted file]
lib/yui/2.8.1/build/datatable/assets/skins/sam/datatable-skin.css [deleted file]
lib/yui/2.8.1/build/datatable/assets/skins/sam/datatable.css [deleted file]
lib/yui/2.8.1/build/datatable/assets/skins/sam/dt-arrow-dn.png [deleted file]
lib/yui/2.8.1/build/datatable/assets/skins/sam/dt-arrow-up.png [deleted file]
lib/yui/2.8.1/build/datatable/datatable-debug.js [deleted file]
lib/yui/2.8.1/build/datatable/datatable-min.js [deleted file]
lib/yui/2.8.1/build/datatable/datatable.js [deleted file]
lib/yui/2.8.1/build/datemath/datemath-debug.js [deleted file]
lib/yui/2.8.1/build/datemath/datemath-min.js [deleted file]
lib/yui/2.8.1/build/datemath/datemath.js [deleted file]
lib/yui/2.8.1/build/dom/dom-debug.js [deleted file]
lib/yui/2.8.1/build/dom/dom-min.js [deleted file]
lib/yui/2.8.1/build/dom/dom.js [deleted file]
lib/yui/2.8.1/build/dragdrop/dragdrop-debug.js [deleted file]
lib/yui/2.8.1/build/dragdrop/dragdrop-min.js [deleted file]
lib/yui/2.8.1/build/dragdrop/dragdrop.js [deleted file]
lib/yui/2.8.1/build/editor/assets/editor-core.css [deleted file]
lib/yui/2.8.1/build/editor/assets/simpleeditor-core.css [deleted file]
lib/yui/2.8.1/build/editor/assets/skins/sam/blankimage.png [deleted file]
lib/yui/2.8.1/build/editor/assets/skins/sam/editor-knob.gif [deleted file]
lib/yui/2.8.1/build/editor/assets/skins/sam/editor-skin.css [deleted file]
lib/yui/2.8.1/build/editor/assets/skins/sam/editor-sprite-active.gif [deleted file]
lib/yui/2.8.1/build/editor/assets/skins/sam/editor-sprite.gif [deleted file]
lib/yui/2.8.1/build/editor/assets/skins/sam/editor.css [deleted file]
lib/yui/2.8.1/build/editor/assets/skins/sam/simpleeditor-skin.css [deleted file]
lib/yui/2.8.1/build/editor/assets/skins/sam/simpleeditor.css [deleted file]
lib/yui/2.8.1/build/editor/editor-debug.js [deleted file]
lib/yui/2.8.1/build/editor/editor-min.js [deleted file]
lib/yui/2.8.1/build/editor/editor.js [deleted file]
lib/yui/2.8.1/build/editor/simpleeditor-debug.js [deleted file]
lib/yui/2.8.1/build/editor/simpleeditor-min.js [deleted file]
lib/yui/2.8.1/build/editor/simpleeditor.js [deleted file]
lib/yui/2.8.1/build/element-delegate/element-delegate-debug.js [deleted file]
lib/yui/2.8.1/build/element-delegate/element-delegate-min.js [deleted file]
lib/yui/2.8.1/build/element-delegate/element-delegate.js [deleted file]
lib/yui/2.8.1/build/element/element-debug.js [deleted file]
lib/yui/2.8.1/build/element/element-min.js [deleted file]
lib/yui/2.8.1/build/element/element.js [deleted file]
lib/yui/2.8.1/build/event-delegate/event-delegate-debug.js [deleted file]
lib/yui/2.8.1/build/event-delegate/event-delegate-min.js [deleted file]
lib/yui/2.8.1/build/event-delegate/event-delegate.js [deleted file]
lib/yui/2.8.1/build/event-mouseenter/event-mouseenter-debug.js [deleted file]
lib/yui/2.8.1/build/event-mouseenter/event-mouseenter-min.js [deleted file]
lib/yui/2.8.1/build/event-mouseenter/event-mouseenter.js [deleted file]
lib/yui/2.8.1/build/event-simulate/event-simulate-debug.js [deleted file]
lib/yui/2.8.1/build/event-simulate/event-simulate-min.js [deleted file]
lib/yui/2.8.1/build/event-simulate/event-simulate.js [deleted file]
lib/yui/2.8.1/build/event/event-debug.js [deleted file]
lib/yui/2.8.1/build/event/event-min.js [deleted file]
lib/yui/2.8.1/build/event/event.js [deleted file]
lib/yui/2.8.1/build/fonts/fonts-min.css [deleted file]
lib/yui/2.8.1/build/fonts/fonts.css [deleted file]
lib/yui/2.8.1/build/get/get-debug.js [deleted file]
lib/yui/2.8.1/build/get/get-min.js [deleted file]
lib/yui/2.8.1/build/get/get.js [deleted file]
lib/yui/2.8.1/build/grids/grids-min.css [deleted file]
lib/yui/2.8.1/build/grids/grids.css [deleted file]
lib/yui/2.8.1/build/history/assets/blank.html [deleted file]
lib/yui/2.8.1/build/history/history-debug.js [deleted file]
lib/yui/2.8.1/build/history/history-min.js [deleted file]
lib/yui/2.8.1/build/history/history.js [deleted file]
lib/yui/2.8.1/build/imagecropper/assets/imagecropper-core.css [deleted file]
lib/yui/2.8.1/build/imagecropper/assets/skins/sam/imagecropper-skin.css [deleted file]
lib/yui/2.8.1/build/imagecropper/assets/skins/sam/imagecropper.css [deleted file]
lib/yui/2.8.1/build/imagecropper/imagecropper-debug.js [deleted file]
lib/yui/2.8.1/build/imagecropper/imagecropper-min.js [deleted file]
lib/yui/2.8.1/build/imagecropper/imagecropper.js [deleted file]
lib/yui/2.8.1/build/imageloader/imageloader-debug.js [deleted file]
lib/yui/2.8.1/build/imageloader/imageloader-min.js [deleted file]
lib/yui/2.8.1/build/imageloader/imageloader.js [deleted file]
lib/yui/2.8.1/build/json/json-debug.js [deleted file]
lib/yui/2.8.1/build/json/json-min.js [deleted file]
lib/yui/2.8.1/build/json/json.js [deleted file]
lib/yui/2.8.1/build/layout/assets/layout-core.css [deleted file]
lib/yui/2.8.1/build/layout/assets/skins/sam/layout-skin.css [deleted file]
lib/yui/2.8.1/build/layout/assets/skins/sam/layout.css [deleted file]
lib/yui/2.8.1/build/layout/assets/skins/sam/layout_sprite.png [deleted file]
lib/yui/2.8.1/build/layout/layout-debug.js [deleted file]
lib/yui/2.8.1/build/layout/layout-min.js [deleted file]
lib/yui/2.8.1/build/layout/layout.js [deleted file]
lib/yui/2.8.1/build/logger/assets/logger-core.css [deleted file]
lib/yui/2.8.1/build/logger/assets/logger.css [deleted file]
lib/yui/2.8.1/build/logger/assets/skins/sam/logger-skin.css [deleted file]
lib/yui/2.8.1/build/logger/assets/skins/sam/logger.css [deleted file]
lib/yui/2.8.1/build/logger/logger-debug.js [deleted file]
lib/yui/2.8.1/build/logger/logger-min.js [deleted file]
lib/yui/2.8.1/build/logger/logger.js [deleted file]
lib/yui/2.8.1/build/menu/assets/menu-core.css [deleted file]
lib/yui/2.8.1/build/menu/assets/menu.css [deleted file]
lib/yui/2.8.1/build/menu/assets/menu_down_arrow.png [deleted file]
lib/yui/2.8.1/build/menu/assets/menu_down_arrow_disabled.png [deleted file]
lib/yui/2.8.1/build/menu/assets/menu_up_arrow.png [deleted file]
lib/yui/2.8.1/build/menu/assets/menu_up_arrow_disabled.png [deleted file]
lib/yui/2.8.1/build/menu/assets/menubaritem_submenuindicator.png [deleted file]
lib/yui/2.8.1/build/menu/assets/menubaritem_submenuindicator_disabled.png [deleted file]
lib/yui/2.8.1/build/menu/assets/menubaritem_submenuindicator_selected.png [deleted file]
lib/yui/2.8.1/build/menu/assets/menuitem_checkbox.png [deleted file]
lib/yui/2.8.1/build/menu/assets/menuitem_checkbox_disabled.png [deleted file]
lib/yui/2.8.1/build/menu/assets/menuitem_checkbox_selected.png [deleted file]
lib/yui/2.8.1/build/menu/assets/menuitem_submenuindicator.png [deleted file]
lib/yui/2.8.1/build/menu/assets/menuitem_submenuindicator_disabled.png [deleted file]
lib/yui/2.8.1/build/menu/assets/menuitem_submenuindicator_selected.png [deleted file]
lib/yui/2.8.1/build/menu/assets/skins/sam/menu-skin.css [deleted file]
lib/yui/2.8.1/build/menu/assets/skins/sam/menu.css [deleted file]
lib/yui/2.8.1/build/menu/assets/skins/sam/menubaritem_submenuindicator.png [deleted file]
lib/yui/2.8.1/build/menu/assets/skins/sam/menubaritem_submenuindicator_disabled.png [deleted file]
lib/yui/2.8.1/build/menu/assets/skins/sam/menuitem_checkbox.png [deleted file]
lib/yui/2.8.1/build/menu/assets/skins/sam/menuitem_checkbox_disabled.png [deleted file]
lib/yui/2.8.1/build/menu/assets/skins/sam/menuitem_submenuindicator.png [deleted file]
lib/yui/2.8.1/build/menu/assets/skins/sam/menuitem_submenuindicator_disabled.png [deleted file]
lib/yui/2.8.1/build/menu/menu-debug.js [deleted file]
lib/yui/2.8.1/build/menu/menu-min.js [deleted file]
lib/yui/2.8.1/build/menu/menu.js [deleted file]
lib/yui/2.8.1/build/paginator/assets/paginator-core.css [deleted file]
lib/yui/2.8.1/build/paginator/assets/skins/sam/paginator-skin.css [deleted file]
lib/yui/2.8.1/build/paginator/assets/skins/sam/paginator.css [deleted file]
lib/yui/2.8.1/build/paginator/paginator-debug.js [deleted file]
lib/yui/2.8.1/build/paginator/paginator-min.js [deleted file]
lib/yui/2.8.1/build/paginator/paginator.js [deleted file]
lib/yui/2.8.1/build/profiler/profiler-debug.js [deleted file]
lib/yui/2.8.1/build/profiler/profiler-min.js [deleted file]
lib/yui/2.8.1/build/profiler/profiler.js [deleted file]
lib/yui/2.8.1/build/profilerviewer/assets/profilerviewer-core.css [deleted file]
lib/yui/2.8.1/build/profilerviewer/assets/skins/sam/asc.gif [deleted file]
lib/yui/2.8.1/build/profilerviewer/assets/skins/sam/desc.gif [deleted file]
lib/yui/2.8.1/build/profilerviewer/assets/skins/sam/header_background.png [deleted file]
lib/yui/2.8.1/build/profilerviewer/assets/skins/sam/profilerviewer-skin.css [deleted file]
lib/yui/2.8.1/build/profilerviewer/assets/skins/sam/profilerviewer.css [deleted file]
lib/yui/2.8.1/build/profilerviewer/assets/skins/sam/wait.gif [deleted file]
lib/yui/2.8.1/build/profilerviewer/profilerviewer-debug.js [deleted file]
lib/yui/2.8.1/build/profilerviewer/profilerviewer-min.js [deleted file]
lib/yui/2.8.1/build/profilerviewer/profilerviewer.js [deleted file]
lib/yui/2.8.1/build/progressbar/assets/progressbar-core.css [deleted file]
lib/yui/2.8.1/build/progressbar/assets/skins/sam/back-h.png [deleted file]
lib/yui/2.8.1/build/progressbar/assets/skins/sam/back-v.png [deleted file]
lib/yui/2.8.1/build/progressbar/assets/skins/sam/bar-h.png [deleted file]
lib/yui/2.8.1/build/progressbar/assets/skins/sam/bar-v.png [deleted file]
lib/yui/2.8.1/build/progressbar/assets/skins/sam/progressbar-skin.css [deleted file]
lib/yui/2.8.1/build/progressbar/assets/skins/sam/progressbar.css [deleted file]
lib/yui/2.8.1/build/progressbar/progressbar-debug.js [deleted file]
lib/yui/2.8.1/build/progressbar/progressbar-min.js [deleted file]
lib/yui/2.8.1/build/progressbar/progressbar.js [deleted file]
lib/yui/2.8.1/build/reset-fonts-grids/reset-fonts-grids.css [deleted file]
lib/yui/2.8.1/build/reset-fonts/reset-fonts.css [deleted file]
lib/yui/2.8.1/build/reset/reset-min.css [deleted file]
lib/yui/2.8.1/build/reset/reset.css [deleted file]
lib/yui/2.8.1/build/resize/assets/resize-core.css [deleted file]
lib/yui/2.8.1/build/resize/assets/skins/sam/layout_sprite.png [deleted file]
lib/yui/2.8.1/build/resize/assets/skins/sam/resize-skin.css [deleted file]
lib/yui/2.8.1/build/resize/assets/skins/sam/resize.css [deleted file]
lib/yui/2.8.1/build/resize/resize-debug.js [deleted file]
lib/yui/2.8.1/build/resize/resize-min.js [deleted file]
lib/yui/2.8.1/build/resize/resize.js [deleted file]
lib/yui/2.8.1/build/selector/selector-debug.js [deleted file]
lib/yui/2.8.1/build/selector/selector-min.js [deleted file]
lib/yui/2.8.1/build/selector/selector.js [deleted file]
lib/yui/2.8.1/build/slider/assets/bg-fader.gif [deleted file]
lib/yui/2.8.1/build/slider/assets/bg-h.gif [deleted file]
lib/yui/2.8.1/build/slider/assets/bg-v-e.gif [deleted file]
lib/yui/2.8.1/build/slider/assets/bg-v.gif [deleted file]
lib/yui/2.8.1/build/slider/assets/left-thumb.png [deleted file]
lib/yui/2.8.1/build/slider/assets/right-thumb.png [deleted file]
lib/yui/2.8.1/build/slider/assets/skins/sam/bg-h.gif [deleted file]
lib/yui/2.8.1/build/slider/assets/skins/sam/bg-v.gif [deleted file]
lib/yui/2.8.1/build/slider/assets/skins/sam/slider-skin.css [deleted file]
lib/yui/2.8.1/build/slider/assets/skins/sam/slider.css [deleted file]
lib/yui/2.8.1/build/slider/assets/slider-core.css [deleted file]
lib/yui/2.8.1/build/slider/assets/slider-skin.css [deleted file]
lib/yui/2.8.1/build/slider/assets/thumb-bar.gif [deleted file]
lib/yui/2.8.1/build/slider/assets/thumb-e.gif [deleted file]
lib/yui/2.8.1/build/slider/assets/thumb-fader.gif [deleted file]
lib/yui/2.8.1/build/slider/assets/thumb-n.gif [deleted file]
lib/yui/2.8.1/build/slider/assets/thumb-s.gif [deleted file]
lib/yui/2.8.1/build/slider/assets/thumb-w.gif [deleted file]
lib/yui/2.8.1/build/slider/slider-debug.js [deleted file]
lib/yui/2.8.1/build/slider/slider-min.js [deleted file]
lib/yui/2.8.1/build/slider/slider.js [deleted file]
lib/yui/2.8.1/build/storage/storage-debug.js [deleted file]
lib/yui/2.8.1/build/storage/storage-min.js [deleted file]
lib/yui/2.8.1/build/storage/storage.js [deleted file]
lib/yui/2.8.1/build/stylesheet/stylesheet-debug.js [deleted file]
lib/yui/2.8.1/build/stylesheet/stylesheet-min.js [deleted file]
lib/yui/2.8.1/build/stylesheet/stylesheet.js [deleted file]
lib/yui/2.8.1/build/swf/swf-debug.js [deleted file]
lib/yui/2.8.1/build/swf/swf-min.js [deleted file]
lib/yui/2.8.1/build/swf/swf.js [deleted file]
lib/yui/2.8.1/build/swfdetect/swfdetect-debug.js [deleted file]
lib/yui/2.8.1/build/swfdetect/swfdetect-min.js [deleted file]
lib/yui/2.8.1/build/swfdetect/swfdetect.js [deleted file]
lib/yui/2.8.1/build/swfstore/swf.js [deleted file]
lib/yui/2.8.1/build/swfstore/swfstore-debug.js [deleted file]
lib/yui/2.8.1/build/swfstore/swfstore-min.js [deleted file]
lib/yui/2.8.1/build/swfstore/swfstore.js [deleted file]
lib/yui/2.8.1/build/swfstore/swfstore.swf [deleted file]
lib/yui/2.8.1/build/tabview/assets/border_tabs.css [deleted file]
lib/yui/2.8.1/build/tabview/assets/loading.gif [deleted file]
lib/yui/2.8.1/build/tabview/assets/skin-sam.css [deleted file]
lib/yui/2.8.1/build/tabview/assets/skins/sam/tabview-skin.css [deleted file]
lib/yui/2.8.1/build/tabview/assets/skins/sam/tabview.css [deleted file]
lib/yui/2.8.1/build/tabview/assets/tabview-core.css [deleted file]
lib/yui/2.8.1/build/tabview/assets/tabview.css [deleted file]
lib/yui/2.8.1/build/tabview/tabview-debug.js [deleted file]
lib/yui/2.8.1/build/tabview/tabview-min.js [deleted file]
lib/yui/2.8.1/build/tabview/tabview.js [deleted file]
lib/yui/2.8.1/build/treeview/assets/skins/sam/check0.gif [deleted file]
lib/yui/2.8.1/build/treeview/assets/skins/sam/check1.gif [deleted file]
lib/yui/2.8.1/build/treeview/assets/skins/sam/check2.gif [deleted file]
lib/yui/2.8.1/build/treeview/assets/skins/sam/loading.gif [deleted file]
lib/yui/2.8.1/build/treeview/assets/skins/sam/treeview-loading.gif [deleted file]
lib/yui/2.8.1/build/treeview/assets/skins/sam/treeview-skin.css [deleted file]
lib/yui/2.8.1/build/treeview/assets/skins/sam/treeview-sprite.gif [deleted file]
lib/yui/2.8.1/build/treeview/assets/skins/sam/treeview.css [deleted file]
lib/yui/2.8.1/build/treeview/assets/treeview-core.css [deleted file]
lib/yui/2.8.1/build/treeview/treeview-debug.js [deleted file]
lib/yui/2.8.1/build/treeview/treeview-min.js [deleted file]
lib/yui/2.8.1/build/treeview/treeview.js [deleted file]
lib/yui/2.8.1/build/uploader/assets/uploader.swf [deleted file]
lib/yui/2.8.1/build/uploader/uploader-debug.js [deleted file]
lib/yui/2.8.1/build/uploader/uploader-min.js [deleted file]
lib/yui/2.8.1/build/uploader/uploader.js [deleted file]
lib/yui/2.8.1/build/utilities/utilities.js [deleted file]
lib/yui/2.8.1/build/yahoo-dom-event/yahoo-dom-event.js [deleted file]
lib/yui/2.8.1/build/yahoo/yahoo-debug.js [deleted file]
lib/yui/2.8.1/build/yahoo/yahoo-min.js [deleted file]
lib/yui/2.8.1/build/yahoo/yahoo.js [deleted file]
lib/yui/2.8.1/build/yuiloader-dom-event/yuiloader-dom-event.js [deleted file]
lib/yui/2.8.1/build/yuiloader/yuiloader-debug.js [deleted file]
lib/yui/2.8.1/build/yuiloader/yuiloader-min.js [deleted file]
lib/yui/2.8.1/build/yuiloader/yuiloader.js [deleted file]
lib/yui/2.8.1/build/yuitest/assets/skins/sam/yuitest-skin.css [deleted file]
lib/yui/2.8.1/build/yuitest/assets/skins/sam/yuitest.css [deleted file]
lib/yui/2.8.1/build/yuitest/assets/testlogger.css [deleted file]
lib/yui/2.8.1/build/yuitest/assets/yuitest-core.css [deleted file]
lib/yui/2.8.1/build/yuitest/yuitest-debug.js [deleted file]
lib/yui/2.8.1/build/yuitest/yuitest-min.js [deleted file]
lib/yui/2.8.1/build/yuitest/yuitest.js [deleted file]
lib/yui/2.8.1/build/yuitest/yuitest_core-debug.js [deleted file]
lib/yui/2.8.1/build/yuitest/yuitest_core-min.js [deleted file]
lib/yui/2.8.1/build/yuitest/yuitest_core.js [deleted file]
message/lib.php
message/output/email/message_output_email.php
message/output/jabber/message_output_jabber.php
message/search.html
message/search_advanced.html
mnet/publickey.php
mnet/service/enrol/course.php
mnet/service/enrol/index.php
mnet/service/enrol/lang/en/mnetservice_enrol.php
mnet/service/enrol/locallib.php
mod/assignment/db/upgrade.php
mod/assignment/lib.php
mod/assignment/type/online/assignment.class.php
mod/chat/chatd.php
mod/data/css.php
mod/data/db/upgrade.php
mod/data/js.php
mod/data/lib.php
mod/data/templates.php
mod/feedback/item/info/lib.php
mod/feedback/item/label/lib.php
mod/feedback/item/multichoice/lib.php
mod/feedback/item/multichoicerated/lib.php
mod/feedback/item/textarea/lib.php
mod/feedback/item/textfield/lib.php
mod/folder/db/upgradelib.php
mod/forum/db/upgrade.php
mod/forum/lib.php
mod/glossary/db/upgrade.php
mod/glossary/import.php
mod/glossary/lib.php
mod/glossary/showentry_ajax.php
mod/imscp/db/upgradelib.php
mod/label/lib.php
mod/lesson/importppt.php
mod/lesson/lib.php
mod/lesson/locallib.php
mod/page/db/upgradelib.php
mod/quiz/attemptlib.php
mod/quiz/comment.php
mod/quiz/db/upgrade.php
mod/quiz/index.php
mod/quiz/lib.php
mod/quiz/locallib.php
mod/quiz/module.js
mod/quiz/report/overview/lang/en/quiz_overview.php
mod/quiz/report/reportlib.php
mod/quiz/report/responses/lang/en/quiz_responses.php
mod/quiz/report/statistics/lang/en/quiz_statistics.php
mod/quiz/reviewquestion.php
mod/quiz/version.php
mod/quiz/view.php
mod/resource/db/upgrade.php
mod/resource/db/upgradelib.php
mod/scorm/datamodels/aicclib.php
mod/scorm/datamodels/scorm_12lib.php
mod/scorm/datamodels/scorm_13lib.php
mod/scorm/db/install.xml
mod/scorm/db/upgrade.php
mod/scorm/lang/en/scorm.php
mod/scorm/lib.php
mod/scorm/locallib.php
mod/scorm/player.php
mod/scorm/prereqs.php
mod/scorm/report.php
mod/scorm/settings.php
mod/scorm/styles.css
mod/scorm/version.php [changed mode: 0755->0644]
mod/scorm/view.php
mod/survey/lib.php
mod/url/db/upgradelib.php
mod/wiki/db/migration/lib.php
mod/wiki/db/upgrade.php
mod/wiki/db/upgradelib.php
mod/wiki/diff/difflib.php
mod/wiki/locallib.php
mod/wiki/parser/markups/nwiki.php
mod/workshop/allocation/random/lang/en/workshopallocation_random.php
mod/workshop/allocation/random/lib.php
mod/workshop/allocation/random/settings_form.php
mod/workshop/allocation/random/styles.css [new file with mode: 0644]
mod/workshop/locallib.php
question/format/blackboard_six/format.php
question/format/gift/format.php
question/format/gift/simpletest/testgiftformat.php
question/format/multianswer/lang/en/qformat_multianswer.php
question/type/calculated/lang/en/qtype_calculated.php
question/type/calculatedmulti/lang/en/qtype_calculatedmulti.php
question/type/calculatedsimple/edit_calculatedsimple_form.php
question/type/calculatedsimple/lang/en/qtype_calculatedsimple.php
question/type/multianswer/edit_multianswer_form.php
question/type/multianswer/lang/en/qtype_multianswer.php
question/type/multianswer/questiontype.php
question/type/multichoice/lang/en/qtype_multichoice.php
question/type/questiontype.php
repository/repository_ajax.php
tag/coursetags_more.php
tag/edit.php
tag/lib.php
tag/tag_autocomplete.php
theme/arialist/style/core.css
theme/base/style/course.css
theme/binarius/style/core.css
theme/javascript.php
theme/magazine/style/core.css
theme/nonzero/style/pagelayout.css
theme/overlay/style/core.css
theme/overlay/style/pagelayout.css
theme/splash/lang/en/theme_splash.php
theme/splash/style/blue.css
theme/splash/style/green.css
theme/styles.php
theme/styles_debug.php
user/index.php
user/profile/lib.php
user/selector/lib.php
user/selector/search.php
user/view.php
version.php
webservice/rest/locallib.php
webservice/soap/locallib.php

index 6d1b819..de868b3 100644 (file)
@@ -26,7 +26,7 @@ function dbtransfer_export_xml_database($description, $mdb) {
 
     session_get_instance()->write_close(); // release session
 
-    header('Content-Type: application/xhtml+xml');
+    header('Content-Type: application/xhtml+xml; charset=utf-8');
     header('Content-Disposition: attachment; filename=database.xml');
     header('Expires: 0');
     header('Cache-Control: must-revalidate,post-check=0,pre-check=0');
index 3ecb952..71e22bd 100644 (file)
             $settings = "";
         }
 
-        $count = $DB->count_records_select($module->name, "course<>0");
+        try {
+            $count = $DB->count_records_select($module->name, "course<>0");
+        } catch (dml_exception $e) {
+            $count = -1;
+        }
         if ($count>0) {
             $countlink = "<a href=\"{$CFG->wwwroot}/course/search.php?modulelist=$module->name" .
                 "&amp;sesskey=".sesskey()."\" title=\"$strshowmodulecourse\">$count</a>";
-        }
-        else {
+        } else if ($count < 0) {
+            $countlink = get_string('error');
+        } else {
             $countlink = "$count";
         }
 
index d25c709..77c2219 100644 (file)
@@ -56,35 +56,34 @@ foreach ($tables as $table) {
             if (in_array($data->type, array('text','mediumtext','longtext','varchar'))) {  // Text stuff only
                 // first find candidate records
                 $sql = "SELECT id, $column FROM $fulltable WHERE $column LIKE '%</lang>%' OR $column LIKE '%<span lang=%'";
-                if ($rs = $DB->get_recordset_sql($sql)) {
-                    foreach ($rs as $data) {
-                        $text = $data->$column;
-                        $id   = $data->id;
-                        if ($i % 600 == 0) {
-                            echo '<br />';
-                        }
-                        if ($i % 10 == 0) {
-                            echo '.';
-                        }
-                        $i++;
-
-                        if (empty($text) or is_numeric($text)) {
-                            continue; // nothing to do
-                        }
-
-                        $search = '/(<(?:lang|span) lang="[a-zA-Z0-9_-]*".*?>.+?<\/(?:lang|span)>)(\s*<(?:lang|span) lang="[a-zA-Z0-9_-]*".*?>.+?<\/(?:lang|span)>)+/is';
-                        $newtext = preg_replace_callback($search, 'multilangupgrade_impl', $text);
-
-                        if (is_null($newtext)) {
-                            continue; // regex error
-                        }
-
-                        if ($newtext != $text) {
-                            $DB->execute("UPDATE $fulltable SET $column=? WHERE id=?", array($newtext, $id));
-                        }
+                $rs = $DB->get_recordset_sql($sql);
+                foreach ($rs as $data) {
+                    $text = $data->$column;
+                    $id   = $data->id;
+                    if ($i % 600 == 0) {
+                        echo '<br />';
+                    }
+                    if ($i % 10 == 0) {
+                        echo '.';
+                    }
+                    $i++;
+
+                    if (empty($text) or is_numeric($text)) {
+                        continue; // nothing to do
+                    }
+
+                    $search = '/(<(?:lang|span) lang="[a-zA-Z0-9_-]*".*?>.+?<\/(?:lang|span)>)(\s*<(?:lang|span) lang="[a-zA-Z0-9_-]*".*?>.+?<\/(?:lang|span)>)+/is';
+                    $newtext = preg_replace_callback($search, 'multilangupgrade_impl', $text);
+
+                    if (is_null($newtext)) {
+                        continue; // regex error
+                    }
+
+                    if ($newtext != $text) {
+                        $DB->execute("UPDATE $fulltable SET $column=? WHERE id=?", array($newtext, $id));
                     }
-                    $rs->close();
                 }
+                $rs->close();
             }
         }
     }
index 5536540..33a70d8 100644 (file)
         }
 
         // Settings link, if available.
-        if (file_exists($qtype->plugin_dir() . '/settings.php')) {
+        $settings = admin_get_root()->locate('qtypesetting' . $qtypename);
+        if ($settings instanceof admin_externalpage) {
+            $row[] = '<a href="' . $settings->url .
+                    '">' . get_string('settings') . '</a>';
+        } else if ($settings instanceof admin_settingpage) {
             $row[] = '<a href="' . admin_url('settings.php?section=qtypesetting' . $qtypename) .
                     '">' . get_string('settings') . '</a>';
         } else {
index 29d72ff..7de0346 100644 (file)
@@ -20,8 +20,8 @@ if ($hassiteconfig) { // speedup for non-admins, add all caps used on this page
     $ADMIN->add('experimental', $temp);
 
     // DB transfer related pages
-    $ADMIN->add('experimental', new admin_externalpage('dbtransfer', get_string('dbtransfer', 'dbtransfer'), $CFG->wwwroot.'/'.$CFG->admin.'/dbtransfer/index.php', 'moodle/site:config'));
-    $ADMIN->add('experimental', new admin_externalpage('dbexport', get_string('dbexport', 'dbtransfer'), $CFG->wwwroot.'/'.$CFG->admin.'/dbtransfer/dbexport.php', 'moodle/site:config'));
+    $ADMIN->add('experimental', new admin_externalpage('dbtransfer', get_string('dbtransfer', 'dbtransfer'), $CFG->wwwroot.'/'.$CFG->admin.'/dbtransfer/index.php', 'moodle/site:config', true));
+    $ADMIN->add('experimental', new admin_externalpage('dbexport', get_string('dbexport', 'dbtransfer'), $CFG->wwwroot.'/'.$CFG->admin.'/dbtransfer/dbexport.php', 'moodle/site:config', true));
 
     // "debugging" settingpage
     $temp = new admin_settingpage('debugging', get_string('debugging', 'admin'));
index d107eca..825673c 100644 (file)
@@ -372,13 +372,12 @@ if ($hassiteconfig || has_capability('moodle/question:config', $systemcontext))
     // Question type settings.
     $ADMIN->add('modules', new admin_category('qtypesettings', get_string('questiontypes', 'admin')));
     $ADMIN->add('qtypesettings', new admin_page_manageqtypes());
-    require_once($CFG->libdir . '/questionlib.php');
-    global $QTYPES;
-    foreach ($QTYPES as $qtype) {
-        $settingsfile = $qtype->plugin_dir() . '/settings.php';
+    $qtypes = get_plugin_list('qtype');
+    foreach ($qtypes as $qtype => $path) {
+        $settingsfile = $path . '/settings.php';
         if (file_exists($settingsfile)) {
-            $settings = new admin_settingpage('qtypesetting' . $qtype->name(),
-                    $qtype->local_name(), 'moodle/question:config');
+            $settings = new admin_settingpage('qtypesetting' . $qtype,
+                    get_string('pluginname', 'qtype_' . $qtype), 'moodle/question:config');
             include($settingsfile);
             if ($settings) {
                 $ADMIN->add('qtypesettings', $settings);
index ceccfe5..c7735e6 100644 (file)
@@ -37,10 +37,6 @@ if ($hassiteconfig) { // speedup for non-admins, add all caps used on this page
     $optionalsubsystems->add(new admin_setting_configcheckbox('enablecompletion',
         get_string('enablecompletion','completion'),
         get_string('configenablecompletion','completion'), 0));
-    $optionalsubsystems->add(new admin_setting_pickroles('progresstrackedroles',
-        get_string('progresstrackedroles','completion'),
-        get_string('configprogresstrackedroles', 'completion'),
-        array('student')));
     $optionalsubsystems->add(new admin_setting_configcheckbox('enableavailability',
         get_string('enableavailability','condition'),
         get_string('configenableavailability','condition'), 0));
index 01ef71c..1e94aa5 100644 (file)
@@ -107,7 +107,7 @@ if ($hassiteconfig
 
         if (!during_initial_install()) {
             $temp->add(new admin_setting_configselect('creatornewroleid', get_string('creatornewroleid', 'admin'),
-                          get_string('configcreatornewroleid', 'admin'), $defaultteacherid, $creatornewroles));
+                          get_string('creatornewroleid_help', 'admin'), $defaultteacherid, $creatornewroles));
         }
 
         $temp->add(new admin_setting_configcheckbox('autologinguests', get_string('autologinguests', 'admin'), get_string('configautologinguests', 'admin'), 0));
index 6da2efb..605a53d 100755 (executable)
@@ -668,10 +668,16 @@ if ($formdata = $mform->is_cancelled()) {
             $courseid      = $ccache[$shortname]->id;
             $coursecontext = get_context_instance(CONTEXT_COURSE, $courseid);
             if (!isset($manualcache[$courseid])) {
-                if ($instances = enrol_get_instances($courseid, false)) {
-                    $manualcache[$courseid] = reset($instances);
-                } else {
-                    $manualcache[$courseid] = false;
+                $manualcache[$courseid] = false;
+                if ($manual) {
+                    if ($instances = enrol_get_instances($courseid, false)) {
+                        foreach ($instances as $instance) {
+                            if ($instance->enrol === 'manual') {
+                                $manualcache[$courseid] = $instance;
+                                break;
+                            }
+                        }
+                    }
                 }
             }
 
index 3f21653..25775cb 100644 (file)
@@ -11,14 +11,13 @@ function add_selection_all($ufiltering) {
 
     list($sqlwhere, $params) = $ufiltering->get_sql_filter("id<>:exguest AND deleted <> 1", array('exguest'=>$CFG->siteguest));
 
-    if ($rs = $DB->get_recordset_select('user', $sqlwhere, $params, 'fullname', 'id,'.$DB->sql_fullname().' AS fullname')) {
-        foreach ($rs as $user) {
-            if (!isset($SESSION->bulk_users[$user->id])) {
-                $SESSION->bulk_users[$user->id] = $user->id;
-            }
+    $rs = $DB->get_recordset_select('user', $sqlwhere, $params, 'fullname', 'id,'.$DB->sql_fullname().' AS fullname');
+    foreach ($rs as $user) {
+        if (!isset($SESSION->bulk_users[$user->id])) {
+            $SESSION->bulk_users[$user->id] = $user->id;
         }
-        $rs->close();
     }
+    $rs->close();
 }
 
 function get_selection_data($ufiltering) {
index 7f10341..c7ba604 100755 (executable)
@@ -24,19 +24,18 @@ echo $OUTPUT->header();
 
 if ($confirm and confirm_sesskey()) {
     list($in, $params) = $DB->get_in_or_equal($SESSION->bulk_users);
-    if ($rs = $DB->get_recordset_select('user', "id $in", $params, '', 'id, username, secret, confirmed, auth, firstname, lastname')) {
-        foreach ($rs as $user) {
-            if ($user->confirmed) {
-                continue;
-            }
-            $auth = get_auth_plugin($user->auth);
-            $result = $auth->user_confirm($user->username, $user->secret);
-            if ($result != AUTH_CONFIRM_OK && $result != AUTH_CONFIRM_ALREADY) {
-                echo $OUTPUT->notification(get_string('usernotconfirmed', '', fullname($user, true)));
-            }
+    $rs = $DB->get_recordset_select('user', "id $in", $params, '', 'id, username, secret, confirmed, auth, firstname, lastname');
+    foreach ($rs as $user) {
+        if ($user->confirmed) {
+            continue;
+        }
+        $auth = get_auth_plugin($user->auth);
+        $result = $auth->user_confirm($user->username, $user->secret);
+        if ($result != AUTH_CONFIRM_OK && $result != AUTH_CONFIRM_ALREADY) {
+            echo $OUTPUT->notification(get_string('usernotconfirmed', '', fullname($user, true)));
         }
-        $rs->close();
     }
+    $rs->close();
     redirect($return, get_string('changessaved'));
 
 } else {
index 26e11f0..a8b6705 100755 (executable)
@@ -25,16 +25,15 @@ echo $OUTPUT->header();
 if ($confirm and confirm_sesskey()) {
 
     list($in, $params) = $DB->get_in_or_equal($SESSION->bulk_users);
-    if ($rs = $DB->get_recordset_select('user', "id $in", $params)) {
-        foreach ($rs as $user) {
-            if (!is_siteadmin($user) and $USER->id != $user->id and delete_user($user)) {
-                unset($SESSION->bulk_users[$user->id]);
-            } else {
-                echo $OUTPUT->notification(get_string('deletednot', '', fullname($user, true)));
-            }
+    $rs = $DB->get_recordset_select('user', "id $in", $params);
+    foreach ($rs as $user) {
+        if (!is_siteadmin($user) and $USER->id != $user->id and delete_user($user)) {
+            unset($SESSION->bulk_users[$user->id]);
+        } else {
+            echo $OUTPUT->notification(get_string('deletednot', '', fullname($user, true)));
         }
-        $rs->close();
     }
+    $rs->close();
     session_gc(); // remove stale sessions
     redirect($return, get_string('changessaved'));
 
index 6988c74..d67c942 100644 (file)
@@ -38,17 +38,16 @@ if ($confirm and confirm_sesskey()) {
     $parts = array_chunk($SESSION->bulk_users, 300);
     foreach ($parts as $users) {
         list($in, $params) = $DB->get_in_or_equal($users);
-        if ($rs = $DB->get_recordset_select('user', "id $in", $params)) {
-            foreach ($rs as $user) {
-                if (!empty($changeable[$user->auth])) {
-                    set_user_preference('auth_forcepasswordchange', 1, $user->id);
-                    unset($SESSION->bulk_users[$user->id]);
-                } else {
-                    echo $OUTPUT->notification(get_string('forcepasswordchangenot', '', fullname($user, true)));
-                }
+        $rs = $DB->get_recordset_select('user', "id $in", $params);
+        foreach ($rs as $user) {
+            if (!empty($changeable[$user->auth])) {
+                set_user_preference('auth_forcepasswordchange', 1, $user->id);
+                unset($SESSION->bulk_users[$user->id]);
+            } else {
+                echo $OUTPUT->notification(get_string('forcepasswordchangenot', '', fullname($user, true)));
             }
-            $rs->close();
         }
+        $rs->close();
     }
     echo $OUTPUT->notification(get_string('changessaved'), 'notifysuccess');
     echo $OUTPUT->continue_button($return);
index 52127fd..ceb5bcd 100755 (executable)
@@ -25,15 +25,14 @@ if (empty($CFG->messaging)) {
 
 if ($confirm and !empty($msg) and confirm_sesskey()) {
     list($in, $params) = $DB->get_in_or_equal($SESSION->bulk_users);
-    if ($rs = $DB->get_recordset_select('user', "id $in", $params)) {
-        foreach ($rs as $user) {
-            //TODO we should probably support all text formats here or only FORMAT_MOODLE
-            //For now bulk messaging is still using the html editor and its supplying html
-            //so we have to use html format for it to be displayed correctly
-            message_post_message($USER, $user, $msg, FORMAT_HTML, 'direct');
-        }
-        $rs->close();
+    $rs = $DB->get_recordset_select('user', "id $in", $params);
+    foreach ($rs as $user) {
+        //TODO we should probably support all text formats here or only FORMAT_MOODLE
+        //For now bulk messaging is still using the html editor and its supplying html
+        //so we have to use html format for it to be displayed correctly
+        message_post_message($USER, $user, $msg, FORMAT_HTML, 'direct');
     }
+    $rs->close();
     redirect($return);
 }
 
index 4b80b28..70c3f6d 100644 (file)
                         echo $OUTPUT->footer();
                         break;
                     case ACTION_GENERATE_XML:
-                        header('Content-type: application/xhtml+xml');
+                        header('Content-type: application/xhtml+xml; charset=utf-8');
                         echo $xmldb_action->getOutput();
                         break;
                 }
index b451720..c5c5410 100644 (file)
@@ -12,7 +12,7 @@ require_once($CFG->dirroot."/auth/shibboleth/auth.php");
 // Find out whether host supports https
 $protocol = 'http://';
 if ( isset($_SERVER['HTTPS']) && !empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on'){
-       $protocol = 'https://';
+    $protocol = 'https://';
 }
 
 // Front channel logout
@@ -197,11 +197,12 @@ function LogoutNotification($SessionID){
 /*****************************************************************************/
 
 // Same function as in adodb, but cannot be used for file session for some reason...
-function unserializesession( $serialized_string ){
-    $variables = array( );
-    $a = preg_split( "/(\w+)\|/", $serialized_string, -1, PREG_SPLIT_NO_EMPTY | PREG_SPLIT_DELIM_CAPTURE );
-    for( $i = 0; $i < count( $a ); $i = $i+2 ) {
-            $variables[$a[$i]] = unserialize( $a[$i+1] );
+function unserializesession($serialized_string) {
+    $variables = array();
+    $a = preg_split("/(\w+)\|/", $serialized_string, -1, PREG_SPLIT_NO_EMPTY | PREG_SPLIT_DELIM_CAPTURE);
+    $counta = count($a);
+    for ($i = 0; $i < $counta; $i = $i+2) {
+            $variables[$a[$i]] = unserialize($a[$i+1]);
     }
-    return( $variables );
+    return $variables;
 }
index 865430b..3a4e5da 100644 (file)
         }
 
         // Loop through all directory entries, and construct two temporary arrays containing files and sub directories
-        while(false !== ($entry = readdir($handle))) {
+        while (false !== ($entry = readdir($handle))) {
             if (is_dir($dir. $slash .$entry) && $entry != ".." && $entry != "." && $entry != $excludeddir) {
                 $dir_subdirs[] = $dir. $slash .$entry;
             }
         }
 
         // Delete all files in the curent directory return false and halt if a file cannot be removed
-        for($i=0; $i<count($dir_files); $i++) {
+        $countdirfiles = count($dir_files);
+        for ($i=0; $i<$countdirfiles; $i++) {
             chmod($dir_files[$i], $CFG->directorypermissions);
             if (((unlink($dir_files[$i]))) == FALSE) {
                 return false;
         }
 
         // Empty sub directories and then remove the directory
-        for($i=0; $i<count($dir_subdirs); $i++) {
+        $countdirsubdirs = count($dir_subdirs);
+        for($i=0; $i<$countdirsubdirs; $i++) {
             chmod($dir_subdirs[$i], $CFG->directorypermissions);
             if (delete_dir_contents($dir_subdirs[$i]) == FALSE) {
                 return false;
index d9ad84b..654a87f 100644 (file)
                                                 $tagsarr = $info['BLOG']['#']['BLOG_TAGS']['0']['#']['BLOG_TAG'];
                                                 //Iterate over tags
                                                 $tags = array();
-                                                for($i = 0; $i < sizeof($tagsarr); $i++) {
+                                                $sizetagsarr = sizeof($tagsarr);
+                                                for ($i = 0; $i < $sizetagsarr; $i++) {
                                                     $tag_info = $tagsarr[$i];
                                                     ///traverse_xmlize($tag_info);                        //Debug
                                                     ///print_object ($GLOBALS['traverse_array']);         //Debug
index adff582..c44ceb4 100644 (file)
@@ -27,7 +27,8 @@ class block_activity_modules extends block_list {
         $archetypes = array();
 
         foreach($modinfo->cms as $cm) {
-            if (!$cm->uservisible or $cm->modname === 'label') {
+            // Exclude activities which are not visible or have no link (=label)
+            if (!$cm->uservisible or !$cm->has_view()) {
                 continue;
             }
             if (array_key_exists($cm->modname, $modfullnames)) {
index 1de41bc..df79e3b 100644 (file)
@@ -64,7 +64,7 @@ class block_course_overview extends block_base {
             $courses_limit = $courses_limit + 1;
         }
 
-        $courses = enrol_get_my_courses('id, shortname', 'visible DESC,sortorder ASC', $courses_limit);
+        $courses = enrol_get_my_courses('id, shortname, modinfo', 'visible DESC,sortorder ASC', $courses_limit);
         $site = get_site();
         $course = $site; //just in case we need the old global $course hack
 
index 7905822..35ed7b5 100644 (file)
@@ -14,6 +14,8 @@ class block_course_summary extends block_base {
     function get_content() {
         global $CFG, $OUTPUT;
 
+        require_once($CFG->libdir . '/filelib.php');
+
         if($this->content !== NULL) {
             return $this->content;
         }
index de484a5..cab89ac 100755 (executable)
@@ -42,6 +42,10 @@ class block_html extends block_base {
     }
 
     function get_content() {
+        global $CFG;
+
+        require_once($CFG->libdir . '/filelib.php');
+
         if ($this->content !== NULL) {
             return $this->content;
         }
index fe03b67..73daf36 100644 (file)
@@ -1,5 +1,4 @@
 <?php
-
 // This file is part of Moodle - http://moodle.org/
 //
 // Moodle is free software: you can redistribute it and/or modify
 // along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
 
 /**
- * Displays the user's profile information.
+ * Block displaying information about current logged-in user.
+ *
+ * This block can be used as anti cheating measure, you
+ * can easily check the logged-in user matches the person
+ * operating the computer.
  *
- * @package    blocks
+ * @package    block
+ * @subpackage myprofile
  * @copyright  2010 Remote-Learner.net
  * @author     Olav Jordan <olav.jordan@remote-learner.ca>
  * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
  */
 
+defined('MOODLE_INTERNAL') || die();
+
 /**
- * Displays the user's profile information.
+ * Displays the current user's profile information.
  *
  * @copyright  2010 Remote-Learner.net
  * @author     Olav Jordan <olav.jordan@remote-learner.ca>
@@ -51,8 +57,8 @@ class block_myprofile extends block_base {
             return $this->content;
         }
 
-        if (!isloggedin()){
-            return '';      // Never useful unless you are logged in
+        if (!isloggedin() or isguestuser()) {
+            return '';      // Never useful unless you are logged in as real users
         }
 
         $this->content = new stdClass;
@@ -60,169 +66,114 @@ class block_myprofile extends block_base {
         $this->content->footer = '';
 
         $course = $this->page->course;
-        if ($PAGE->context->contextlevel == CONTEXT_USER) {
-            $user = $DB->get_record('user', array('id' => $PAGE->context->instanceid));
-        } else {
-            $user = $USER;
-        }
-
-        if ($course->id == SITEID) {
-            $coursecontext = get_context_instance(CONTEXT_SYSTEM);
-        } else {
-            $coursecontext = get_context_instance(CONTEXT_COURSE, $course->id);   // Course context
-            // Make sure they can view the course
-            if (!is_viewing($coursecontext)) {
-                return '';
-            }
-        }
-
-
-        // TODO: clean up the following even more
 
         if (!isset($this->config->display_picture) || $this->config->display_picture == 1) {
             $this->content->text .= '<div class="myprofileitem picture">';
-            $this->content->text .= $OUTPUT->user_picture($user, array('courseid'=>$course->id, 'size'=>'100', 'class'=>'profilepicture'));  // The new class makes CSS easier
+            $this->content->text .= $OUTPUT->user_picture($USER, array('courseid'=>$course->id, 'size'=>'100', 'class'=>'profilepicture'));  // The new class makes CSS easier
             $this->content->text .= '</div>';
         }
 
-        $this->content->text .= '<div class="myprofileitem fullname">'.fullname($user).'</div>';
+        $this->content->text .= '<div class="myprofileitem fullname">'.fullname($USER).'</div>';
 
         if(!isset($this->config->display_country) || $this->config->display_country == 1) {
             $countries = get_string_manager()->get_list_of_countries();
-            if (isset($countries[$user->country])) {
+            if (isset($countries[$USER->country])) {
                 $this->content->text .= '<div class="myprofileitem country">';
-                $this->content->text .= get_string('country') . ': ' . $countries[$user->country];
+                $this->content->text .= get_string('country') . ': ' . $countries[$USER->country];
                 $this->content->text .= '</div>';
             }
         }
 
         if(!isset($this->config->display_city) || $this->config->display_city == 1) {
             $this->content->text .= '<div class="myprofileitem city">';
-            $this->content->text .= get_string('city') . ': ' . $user->city;
+            $this->content->text .= get_string('city') . ': ' . format_string($USER->city);
             $this->content->text .= '</div>';
         }
 
         if(!isset($this->config->display_email) || $this->config->display_email == 1) {
             $this->content->text .= '<div class="myprofileitem email">';
-            $this->content->text .= obfuscate_mailto($user->email, '');
+            $this->content->text .= obfuscate_mailto($USER->email, '');
             $this->content->text .= '</div>';
         }
 
-        if(!empty($this->config->display_icq) && !empty($user->icq)) {
+        if(!empty($this->config->display_icq) && !empty($USER->icq)) {
             $this->content->text .= '<div class="myprofileitem icq">';
-            $this->content->text .= 'ICQ: ' . $user->icq;
+            $this->content->text .= 'ICQ: ' . s($USER->icq);
             $this->content->text .= '</div>';
         }
 
-        if(!empty($this->config->display_skype) && !empty($user->skype)) {
+        if(!empty($this->config->display_skype) && !empty($USER->skype)) {
             $this->content->text .= '<div class="myprofileitem skype">';
-            $this->content->text .= 'Skype: ' . $user->skype;
+            $this->content->text .= 'Skype: ' . s($USER->skype);
             $this->content->text .= '</div>';
         }
 
-        if(!empty($this->config->display_yahoo) && !empty($user->yahoo)) {
+        if(!empty($this->config->display_yahoo) && !empty($USER->yahoo)) {
             $this->content->text .= '<div class="myprofileitem yahoo">';
-            $this->content->text .= 'Yahoo: ' . $user->yahoo;
+            $this->content->text .= 'Yahoo: ' . s($USER->yahoo);
             $this->content->text .= '</div>';
         }
 
-        if(!empty($this->config->display_aim) && !empty($user->aim)) {
+        if(!empty($this->config->display_aim) && !empty($USER->aim)) {
             $this->content->text .= '<div class="myprofileitem aim">';
-            $this->content->text .= 'AIM: ' . $user->aim;
+            $this->content->text .= 'AIM: ' . s($USER->aim);
             $this->content->text .= '</div>';
         }
 
-        if(!empty($this->config->display_msn) && !empty($user->msn)) {
+        if(!empty($this->config->display_msn) && !empty($USER->msn)) {
             $this->content->text .= '<div class="myprofileitem msn">';
-            $this->content->text .= 'MSN: ' . $user->msn;
+            $this->content->text .= 'MSN: ' . s($USER->msn);
             $this->content->text .= '</div>';
         }
 
-        if(!empty($this->config->display_phone1) && !empty($user->phone1)) {
+        if(!empty($this->config->display_phone1) && !empty($USER->phone1)) {
             $this->content->text .= '<div class="myprofileitem phone1">';
-            $this->content->text .= get_string('phone').': ' . $user->phone1;
+            $this->content->text .= get_string('phone').': ' . s($USER->phone1);
             $this->content->text .= '</div>';
         }
 
-        if(!empty($this->config->display_phone2) && !empty($user->phone2)) {
+        if(!empty($this->config->display_phone2) && !empty($USER->phone2)) {
             $this->content->text .= '<div class="myprofileitem phone2">';
-            $this->content->text .= get_string('phone').': ' . $user->phone2;
+            $this->content->text .= get_string('phone').': ' . s($USER->phone2);
             $this->content->text .= '</div>';
         }
 
-        if(!empty($this->config->display_institution) && !empty($user->institution)) {
+        if(!empty($this->config->display_institution) && !empty($USER->institution)) {
             $this->content->text .= '<div class="myprofileitem institution">';
-            $this->content->text .= $user->institution;
+            $this->content->text .= format_string($USER->institution);
             $this->content->text .= '</div>';
         }
 
-        if(!empty($this->config->display_address) && !empty($user->address)) {
+        if(!empty($this->config->display_address) && !empty($USER->address)) {
             $this->content->text .= '<div class="myprofileitem address">';
-            $this->content->text .= $user->address;
+            $this->content->text .= format_string($USER->address);
             $this->content->text .= '</div>';
         }
 
-        if(!empty($this->config->display_firstaccess) && !empty($user->firstaccess)) {
+        if(!empty($this->config->display_firstaccess) && !empty($USER->firstaccess)) {
             $this->content->text .= '<div class="myprofileitem firstaccess">';
-            $this->content->text .= get_string('firstaccess').': ' . userdate($user->firstaccess);
+            $this->content->text .= get_string('firstaccess').': ' . userdate($USER->firstaccess);
             $this->content->text .= '</div>';
         }
 
-        if(!empty($this->config->display_lastaccess) && !empty($user->lastaccess)) {
+        if(!empty($this->config->display_lastaccess) && !empty($USER->lastaccess)) {
             $this->content->text .= '<div class="myprofileitem lastaccess">';
-            $this->content->text .= get_string('lastaccess').': ' . userdate($user->lastaccess);
+            $this->content->text .= get_string('lastaccess').': ' . userdate($USER->lastaccess);
             $this->content->text .= '</div>';
         }
 
-        if(!empty($this->config->display_currentlogin) && !empty($user->currentlogin)) {
+        if(!empty($this->config->display_currentlogin) && !empty($USER->currentlogin)) {
             $this->content->text .= '<div class="myprofileitem currentlogin">';
-            $this->content->text .= get_string('login').': ' . userdate($user->currentlogin);
+            $this->content->text .= get_string('login').': ' . userdate($USER->currentlogin);
             $this->content->text .= '</div>';
         }
 
-        if(!empty($this->config->display_lastip) && !empty($user->lastip)) {
+        if(!empty($this->config->display_lastip) && !empty($USER->lastip)) {
             $this->content->text .= '<div class="myprofileitem lastip">';
-            $this->content->text .= 'IP: ' . $user->lastip;
-            $this->content->text .= '</div>';
-        }
-
-        $editscript = NULL;
-        if (isguestuser($user)) {
-            // guest account can not be edited
-
-        } else if (is_mnet_remote_user($user)) {
-            // cannot edit remote users
-
-        } else if (isguestuser() or !isloggedin()) {
-            // guests and not logged in can not edit own profile
-
-        } else if ($USER->id == $user->id) {
-            $systemcontext = get_context_instance(CONTEXT_SYSTEM);
-            if (has_capability('moodle/user:update', $systemcontext)) {
-                $editscript = '/user/editadvanced.php';
-            } else if (has_capability('moodle/user:editownprofile', $systemcontext)) {
-                $editscript = '/user/edit.php';
-            }
-
-        } else {
-            $systemcontext = get_context_instance(CONTEXT_SYSTEM);
-            $personalcontext = get_context_instance(CONTEXT_USER, $user->id);
-            if (has_capability('moodle/user:update', $systemcontext) and !is_primary_admin($user->id)){
-                $editscript = '/user/editadvanced.php';
-            } else if (has_capability('moodle/user:editprofile', $personalcontext) and !is_primary_admin($user->id)){
-                //teachers, parents, etc.
-                $editscript = '/user/edit.php';
-            }
-        }
-
-
-        if ($editscript) {
-            $this->content->text .= '<div class="myprofileitem edit">';
-            $this->content->text .= '<a href="'.$CFG->wwwroot.$editscript.'?id='.$user->id.'&amp;course='.$course->id.'">'.get_string('editmyprofile').'</a>';
+            $this->content->text .= 'IP: ' . $USER->lastip;
             $this->content->text .= '</div>';
         }
 
-
         return $this->content;
     }
 
@@ -304,4 +255,3 @@ class block_myprofile extends block_base {
     }
 
 }
-?>
index 4605853..4500c0e 100644 (file)
@@ -1,5 +1,4 @@
 <?php
-
 // This file is part of Moodle - http://moodle.org/
 //
 // Moodle is free software: you can redistribute it and/or modify
 // You should have received a copy of the GNU General Public License
 // along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
 
+defined('MOODLE_INTERNAL') || die();
+
 /**
  * Form for editing profile block settings
  *
- * @package    blocks
+ * @package    block
+ * @subpackage myprofile
  * @copyright  2010 Remote-Learner.net
  * @author     Olav Jordan <olav.jordan@remote-learner.ca>
  * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
index 09c256d..74dea91 100644 (file)
@@ -1,6 +1,31 @@
 <?php
-$string['pluginname'] = 'Personal profile';
-$string['myprofile_settings'] = 'Personal profile settings';
+// This file is part of Moodle - http://moodle.org/
+//
+// Moodle is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// Moodle is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
+
+/**
+ * Strings for component 'block_myprofile', language 'en', branch 'MOODLE_20_STABLE'
+ *
+ * @package    block
+ * @subpackage myprofile
+ * @copyright  2010 Remote-Learner.net
+ * @author     Olav Jordan <olav.jordan@remote-learner.ca>
+ * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
+ */
+
+$string['pluginname'] = 'Logged in user';
+$string['myprofile_settings'] = 'Visible user information';
 $string['contentsettings'] = 'Display settings for content region';
 $string['display_picture'] = 'Display picture';
 $string['display_country'] = 'Display country';
@@ -20,4 +45,3 @@ $string['display_firstaccess'] = 'Display first access';
 $string['display_lastaccess'] = 'Display last access';
 $string['display_currentlogin'] = 'Display current login';
 $string['display_lastip'] = 'Display last IP';
-?>
index fa4218c..b845d6e 100644 (file)
@@ -1,5 +1,4 @@
 <?php
-
 // This file is part of Moodle - http://moodle.org/
 //
 // Moodle is free software: you can redistribute it and/or modify
 // You should have received a copy of the GNU General Public License
 // along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
 
+/**
+ * Current user info block.
+ *
+ * @package    block
+ * @subpackage myprofile
+ * @copyright  2010 Remote-Learner.net
+ * @author     Olav Jordan <olav.jordan@remote-learner.ca>
+ * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
+ */
+
+defined('MOODLE_INTERNAL') || die();
+
 $plugin->version = 2009123100;
index 70ddd2b..4fb8972 100644 (file)
@@ -43,8 +43,6 @@ class block_online_users extends block_base {
 
         $groupmembers = "";
         $groupselect  = "";
-        $rafrom       = "";
-        $rawhere      = "";
         $params = array();
 
         //Add this to the SQL to show only group users
@@ -78,22 +76,22 @@ class block_online_users extends block_base {
             $params = array_merge($params, $eparams);
 
             $sql = "SELECT $userfields, MAX(ul.timeaccess) AS lastaccess
-                      FROM {user_lastaccess} ul, {user} u $groupmembers $rafrom
+                      FROM {user_lastaccess} ul $groupmembers, {user} u
                       JOIN ($esqljoin) euj ON euj.id = u.id
                      WHERE ul.timeaccess > $timefrom
                            AND u.id = ul.userid
                            AND ul.courseid = :courseid
-                           $groupselect $rawhere
+                           $groupselect
                   GROUP BY $userfields
                   ORDER BY lastaccess DESC";
 
            $csql = "SELECT u.id
-                      FROM {user_lastaccess} ul, {user} u $groupmembers $rafrom
+                      FROM {user_lastaccess} ul $groupmembers, {user} u
                       JOIN ($esqljoin) euj ON euj.id = u.id
                      WHERE ul.timeaccess > $timefrom
                            AND u.id = ul.userid
                            AND ul.courseid = :courseid
-                           $groupselect $rawhere
+                           $groupselect
                   GROUP BY u.id";
 
             $params['courseid'] = $this->page->course->id;
index 3e139ac..d3434f8 100644 (file)
@@ -40,21 +40,19 @@ class block_site_main_menu extends block_list {
                     if (!$cm->uservisible) {
                         continue;
                     }
-                    if ($cm->modname == 'label') {
-                        $this->content->items[] = format_text($cm->extra, FORMAT_HTML, $options);
+
+                    list($content, $instancename) =
+                            get_print_section_cm_text($cm, $course);
+
+                    if (!($url = $cm->get_url())) {
+                        $this->content->items[] = $content;
                         $this->content->icons[] = '';
                     } else {
                         $linkcss = $cm->visible ? '' : ' class="dimmed" ';
-                        $instancename = format_string($cm->name, true, $course->id);
                         //Accessibility: incidental image - should be empty Alt text
-                        if (!empty($cm->icon)) {
-                            $icon = $OUTPUT->pix_url($cm->icon);
-                        } else {
-                            $icon = $OUTPUT->pix_url('icon', $cm->modname);
-                        }
-                        $icon = '<img src="'.$icon.'" class="icon" alt="" />&nbsp;';
+                        $icon = '<img src="' . $cm->get_icon_url() . '" class="icon" alt="" />&nbsp;';
                         $this->content->items[] = '<a title="'.$cm->modplural.'" '.$linkcss.' '.$cm->extra.
-                            ' href="'.$CFG->wwwroot.'/mod/'.$cm->modname.'/view.php?id='.$cm->id.'">'.$icon.$instancename.'</a>';
+                                ' href="' . $url . '">' . $icon . $instancename . '</a>';
                     }
                 }
             }
@@ -114,28 +112,18 @@ class block_site_main_menu extends block_list {
                             '<img style="height:16px; width:80px; border:0px" src="'.$OUTPUT->pix_url('movehere') . '" alt="'.$strmovehere.'" /></a>';
                         $this->content->icons[] = '';
                     }
-                    $instancename = $modinfo->cms[$modnumber]->name;
-                    $instancename = format_string($instancename, true, $course->id);
+                    list($content, $instancename) =
+                            get_print_section_cm_text($modinfo->cms[$modnumber], $course);
                     $linkcss = $mod->visible ? '' : ' class="dimmed" ';
-                    if (!empty($modinfo->cms[$modnumber]->extra)) {
-                        $extra = $modinfo->cms[$modnumber]->extra;
-                    } else {
-                        $extra = '';
-                    }
-                    if (!empty($modinfo->cms[$modnumber]->icon)) {
-                        $icon = $OUTPUT->pix_url($modinfo->cms[$modnumber]->icon);
-                    } else {
-                        $icon = $OUTPUT->pix_url('icon', $mod->modname);
-                    }
 
-                    if ($mod->modname == 'label') {
-                        $this->content->items[] = format_text($extra, FORMAT_HTML,$options).$editbuttons;
+                    if (!($url = $mod->get_url())) {
+                        $this->content->items[] = $content . $editbuttons;
                         $this->content->icons[] = '';
                     } else {
                         //Accessibility: incidental image - should be empty Alt text
-                        $icon = '<img src="'.$icon.'" class="icon" alt="" />&nbsp;';
-                        $this->content->items[] = '<a title="'.$mod->modfullname.'" '.$linkcss.' '.$extra.
-                            ' href="'.$CFG->wwwroot.'/mod/'.$mod->modname.'/view.php?id='.$mod->id.'">'.$icon.$instancename.'</a>'.$editbuttons;
+                        $icon = '<img src="' . $mod->get_icon_url() . '" class="icon" alt="" />&nbsp;';
+                        $this->content->items[] = '<a title="' . $mod->modfullname . '" ' . $linkcss . ' ' . $mod->extra .
+                            ' href="' . $url . '">' . $icon . $instancename . '</a>' . $editbuttons;
                     }
                 }
             }
index bcf7d7b..886e888 100644 (file)
@@ -42,21 +42,19 @@ class block_social_activities extends block_list {
                     if (!$cm->uservisible) {
                         continue;
                     }
-                    if ($cm->modname == 'label') {
-                        $this->content->items[] = format_text($cm->extra, FORMAT_HTML, $options);
+
+                    list($content, $instancename) =
+                            get_print_section_cm_text($cm, $course);
+
+                    if (!($url = $cm->get_url())) {
+                        $this->content->items[] = $content;
                         $this->content->icons[] = '';
                     } else {
                         $linkcss = $cm->visible ? '' : ' class="dimmed" ';
-                        $instancename = format_string($cm->name, true, $course->id);
                         //Accessibility: incidental image - should be empty Alt text
-                        if (!empty($cm->icon)) {
-                            $icon = $OUTPUT->pix_url($cm->icon);
-                        } else {
-                            $icon = $OUTPUT->pix_url('icon', $cm->modname);
-                        }
-                        $icon = '<img src="'.$icon.'" class="icon" alt="" />&nbsp;';
+                        $icon = '<img src="' . $cm->get_icon_url() . '" class="icon" alt="" />&nbsp;';
                         $this->content->items[] = '<a title="'.$cm->modplural.'" '.$linkcss.' '.$cm->extra.
-                            ' href="'.$CFG->wwwroot.'/mod/'.$cm->modname.'/view.php?id='.$cm->id.'">'.$icon.$instancename.'</a>';
+                                ' href="' . $url . '">' . $icon . $instancename . '</a>';
                     }
                 }
             }
@@ -123,28 +121,19 @@ class block_social_activities extends block_list {
                             '<img style="height:16px; width:80px; border:0px" src="'.$OUTPUT->pix_url('movehere') . '" alt="'.$strmovehere.'" /></a>';
                         $this->content->icons[] = '';
                     }
-                    $instancename = $modinfo->cms[$modnumber]->name;
-                    $instancename = format_string($instancename, true, $course->id);
+                    list($content, $instancename) =
+                                get_print_section_cm_text($modinfo->cms[$modnumber], $course);
+
                     $linkcss = $mod->visible ? '' : ' class="dimmed" ';
-                    if (!empty($modinfo->cms[$modnumber]->extra)) {
-                        $extra = $modinfo->cms[$modnumber]->extra;
-                    } else {
-                        $extra = '';
-                    }
-                    if (!empty($modinfo->cms[$modnumber]->icon)) {
-                        $icon = $OUTPUT->pix_url($modinfo->cms[$modnumber]->icon);
-                    } else {
-                        $icon = $OUTPUT->pix_url('icon', $mod->modname);
-                    }
 
-                    if ($mod->modname == 'label') {
-                        $this->content->items[] = format_text($extra, FORMAT_HTML, $options).$editbuttons;
+                    if (!($url = $mod->get_url())) {
+                        $this->content->items[] = $content . $editbuttons;
                         $this->content->icons[] = '';
                     } else {
                         //Accessibility: incidental image - should be empty Alt text
-                        $icon = '<img src="'.$icon.'" class="icon" alt="" />&nbsp;';
-                        $this->content->items[] = '<a title="'.$mod->modfullname.'" '.$linkcss.' '.$extra.
-                            ' href="'.$CFG->wwwroot.'/mod/'.$mod->modname.'/view.php?id='.$mod->id.'">'.$icon.$instancename.'</a>'.$editbuttons;
+                        $icon = '<img src="' . $mod->get_icon_url() . '" class="icon" alt="" />&nbsp;';
+                        $this->content->items[] = '<a title="' . $mod->modfullname . '" ' . $linkcss . ' ' . $mod->extra .
+                            ' href="' . $url . '">' . $icon . $instancename . '</a>' . $editbuttons;
                     }
                 }
             }
index 7f7a780..781f4a0 100644 (file)
@@ -548,11 +548,11 @@ function blog_get_options_for_course(stdClass $course, stdClass $user=null) {
  * Get the blog options relating to the given module for the given user
  *
  * @staticvar array $moduleoptions Cache
- * @param stdClass $module The module to get options for
+ * @param stdClass|cm_info $module The module to get options for
  * @param stdClass $user The user to get options for null == currentuser
  * @return array
  */
-function blog_get_options_for_module(stdClass $module, stdClass $user=null) {
+function blog_get_options_for_module($module, $user=null) {
     global $CFG, $USER;
     // Cache
     static $moduleoptions = array();
index e28cee9..52ff8c3 100644 (file)
@@ -26,6 +26,8 @@
 
 defined('MOODLE_INTERNAL') || die();
 
+require_once($CFG->libdir . '/filelib.php');
+
 /**
  * Blog_entry class. Represents an entry in a user's blog. Contains all methods for managing this entry.
  * This class does not contain any HTML-generating code. See blog_listing sub-classes for such code.
diff --git a/brokenfile.php b/brokenfile.php
new file mode 100644 (file)
index 0000000..3153ade
--- /dev/null
@@ -0,0 +1,31 @@
+<?php
+// This file is part of Moodle - http://moodle.org/
+//
+// Moodle is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// Moodle is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
+
+/**
+ * This is an empty file which is used in order to prevent
+ * error logs in the serverlog.
+ *
+ * Sometimes developer forgets to postprocess files when saving
+ * submitted form data or forget to replace the file placeholders
+ * with the current area information.
+ *
+ * @package    core
+ * @subpackage file
+ * @copyright  2011 Petr Skoda (http://skodak.org)
+ * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
+ */
+
+@header('HTTP/1.0 404 not found');
index e4d62bd..3fe48f1 100644 (file)
@@ -165,6 +165,6 @@ header('Pragma: no-cache');
 header('Accept-Ranges: none'); // Comment out if PDFs do not work...
 header('Content-disposition: attachment; filename='.$filename);
 header('Content-length: '.strlen($serialized));
-header('Content-type: text/calendar');
+header('Content-type: text/calendar; charset=utf-8');
 
 echo $serialized;
index 3b6693f..4917100 100644 (file)
@@ -1874,7 +1874,10 @@ class calendar_event {
      * @return string
      */
     protected function get_description() {
-       global $USER;
+        global $USER, $CFG;
+
+        require_once($CFG->libdir . '/filelib.php');
+
         if ($this->_description === null) {
             // Check if we have already resolved the context for this event
             if ($this->editorcontext === null) {
index 66f6bad..79e0d9d 100644 (file)
@@ -50,9 +50,12 @@ $CFG->dboptions = array(
                                 //  used? set to 'false' for the most stable
                                 //  setting, 'true' can improve performance
                                 //  sometimes
-    'dbsocket'  => false,       // should connection via UNIX socket be
-                                //  used? if you set it to 'true' here,
-                                //  set dbhost to 'localhost'
+    'dbsocket'  => false,       // should connection via UNIX socket be used?
+                                //  if you set it to 'true' or custom path
+                                //  here set dbhost to 'localhost',
+                                //  (please note mysql is always using socket
+                                //  if dbhost is 'localhost' - if you need
+                                //  local port connection use '127.0.0.1')
     'dbport'    => '',          // the TCP port number to use when connecting
                                 //  to the server. keep empty string for the
                                 //  default port
@@ -376,7 +379,8 @@ $CFG->admin = 'admin';
 // Prevent core_string_manager on-disk cache
 // $CFG->langstringcache = false; // NOT FOR PRODUCTION SERVERS!
 //
-// When working with production data on test servers, no emails should ever be send to real users
+// When working with production data on test servers, no emails or other messages
+// should ever be send to real users
 // $CFG->noemailever = true;    // NOT FOR PRODUCTION SERVERS!
 //
 // Divert all outgoing emails to this address to test and debug emailing features
index 10d7178..492275d 100644 (file)
@@ -48,10 +48,6 @@ define('FIRSTUSEDEXCELROW', 3);
 define('MOD_CLASS_ACTIVITY', 0);
 define('MOD_CLASS_RESOURCE', 1);
 
-if (!defined('MAX_MODINFO_CACHE_SIZE')) {
-    define('MAX_MODINFO_CACHE_SIZE', 10);
-}
-
 function make_log_url($module, $url) {
     switch ($module) {
         case 'course':
@@ -351,7 +347,7 @@ function print_log($course, $user=0, $date=0, $order="l.time ASC", $page=0, $per
     $table->head = array(
         get_string('time'),
         get_string('ip_address'),
-        get_string('fullnamecourse'),
+        get_string('fullname'),
         get_string('action'),
         get_string('info')
     );
@@ -959,6 +955,9 @@ function print_recent_activity($course) {
             }
             $info = explode(' ', $log->info);
 
+            // note: in most cases I replaced hardcoding of label with use of
+            // $cm->has_view() but it was not possible to do this here because
+            // we don't necessarily have the $cm for it
             if ($info[0] == 'label') {     // Labels are ignored in recent activity
                 continue;
             }
@@ -1112,9 +1111,6 @@ function get_array_of_activities($courseid) {
 
                    if (function_exists($functionname)) {
                        if ($info = $functionname($rawmods[$seq])) {
-                           if (!empty($info->extra)) {
-                               $mod[$seq]->extra = $info->extra;
-                           }
                            if (!empty($info->icon)) {
                                $mod[$seq]->icon = $info->icon;
                            }
@@ -1124,11 +1120,45 @@ function get_array_of_activities($courseid) {
                            if (!empty($info->name)) {
                                $mod[$seq]->name = $info->name;
                            }
+                           if ($info instanceof cached_cm_info) {
+                               // When using cached_cm_info you can include three new fields
+                               // that aren't available for legacy code
+                               if (!empty($info->content)) {
+                                   $mod[$seq]->content = $info->content;
+                               }
+                               if (!empty($info->extraclasses)) {
+                                   $mod[$seq]->extraclasses = $info->extraclasses;
+                               }
+                               if (!empty($info->onclick)) {
+                                   $mod[$seq]->onclick = $info->onclick;
+                               }
+                               if (!empty($info->customdata)) {
+                                   $mod[$seq]->customdata = $info->customdata;
+                               }
+                           } else {
+                               // When using a stdclass, the (horrible) deprecated ->extra field
+                               // is available for BC
+                               if (!empty($info->extra)) {
+                                   $mod[$seq]->extra = $info->extra;
+                               }
+                           }
                        }
                    }
                    if (!isset($mod[$seq]->name)) {
                        $mod[$seq]->name = $DB->get_field($rawmods[$seq]->modname, "name", array("id"=>$rawmods[$seq]->instance));
                    }
+
+                   // Minimise the database size by unsetting default options when they are
+                   // 'empty'. This list corresponds to code in the cm_info constructor.
+                   foreach(array('idnumber', 'groupmode', 'groupingid', 'groupmembersonly',
+                           'indent', 'completion', 'extra', 'extraclasses', 'onclick', 'content',
+                           'icon', 'iconcomponent', 'customdata', 'availablefrom', 'availableuntil',
+                           'conditionscompletion', 'conditionsgrade') as $property) {
+                       if (property_exists($mod[$seq], $property) &&
+                               empty($mod[$seq]->{$property})) {
+                           unset($mod[$seq]->{$property});
+                       }
+                   }
                }
             }
         }
@@ -1250,6 +1280,44 @@ function set_section_visible($courseid, $sectionnumber, $visibility) {
     }
 }
 
+/**
+ * Obtains shared data that is used in print_section when displaying a
+ * course-module entry.
+ *
+ * Calls format_text or format_string as appropriate, and obtains the correct icon.
+ *
+ * This data is also used in other areas of the code.
+ * @param cm_info $cm Course-module data (must come from get_fast_modinfo)
+ * @param object $course Moodle course object
+ * @return array An array with the following values in this order:
+ *   $content (optional extra content for after link),
+ *   $instancename (text of link)
+ */
+function get_print_section_cm_text(cm_info $cm, $course) {
+    global $OUTPUT;
+
+    // Get course context
+    $coursecontext = get_context_instance(CONTEXT_COURSE, $course->id);
+
+    // Get content from modinfo if specified. Content displays either
+    // in addition to the standard link (below), or replaces it if
+    // the link is turned off by setting ->url to null.
+    if (($content = $cm->get_content()) !== '') {
+        $labelformatoptions = new stdClass();
+        $labelformatoptions->noclean = true;
+        $labelformatoptions->overflowdiv = true;
+        $labelformatoptions->context = $coursecontext;
+        $content = format_text($content, FORMAT_HTML, $labelformatoptions);
+    } else {
+        $content = '';
+    }
+
+    $stringoptions = new stdClass;
+    $stringoptions->context = $coursecontext;
+    $instancename = format_string($cm->name, true,  $stringoptions);
+    return array($content, $instancename);
+}
+
 /**
  * Prints a section full of activity modules
  */
@@ -1265,8 +1333,8 @@ function print_section($course, $section, $mods, $modnamesused, $absolute=false,
     static $strmovehere;
     static $strmovefull;
     static $strunreadpostsone;
-    static $usetracking;
     static $groupings;
+    static $modulenames;
 
     if (!isset($initialised)) {
         $groupbuttons     = ($course->groupmode or (!$course->groupmodeforce));
@@ -1277,18 +1345,12 @@ function print_section($course, $section, $mods, $modnamesused, $absolute=false,
             $strmovehere  = get_string("movehere");
             $strmovefull  = strip_tags(get_string("movefull", "", "'$USER->activitycopyname'"));
         }
-        include_once($CFG->dirroot.'/mod/forum/lib.php');
-        if ($usetracking = forum_tp_can_track_forums()) {
-            $strunreadpostsone = get_string('unreadpostsone', 'forum');
-        }
+        $modulenames      = array();
         $initialised = true;
     }
 
-    $labelformatoptions = new stdClass();
-    $labelformatoptions->noclean = true;
-    $labelformatoptions->overflowdiv = true;
+    $tl = textlib_get_instance();
 
-/// Casting $course->modinfo to string prevents one notice when the field is null
     $modinfo = get_fast_modinfo($course);
     $completioninfo = new completion_info($course);
 
@@ -1304,6 +1366,9 @@ function print_section($course, $section, $mods, $modnamesused, $absolute=false,
                 continue;
             }
 
+            /**
+             * @var cm_info
+             */
             $mod = $mods[$modnumber];
 
             if ($ismoving and $mod->id == $USER->activitycopy) {
@@ -1341,6 +1406,11 @@ function print_section($course, $section, $mods, $modnamesused, $absolute=false,
                 }
             }
 
+            if (!isset($modulenames[$mod->modname])) {
+                $modulenames[$mod->modname] = get_string('modulename', $mod->modname);
+            }
+            $modulename = $modulenames[$mod->modname];
+
             // In some cases the activity is visible to user, but it is
             // dimmed. This is done if viewhiddenactivities is true and if:
             // 1. the activity is not visible, or
@@ -1366,6 +1436,10 @@ function print_section($course, $section, $mods, $modnamesused, $absolute=false,
             $liclasses[] = 'activity';
             $liclasses[] = $mod->modname;
             $liclasses[] = 'modtype_'.$mod->modname;
+            $extraclasses = $mod->get_extra_classes();
+            if ($extraclasses) {
+                $liclasses = array_merge($liclasses, explode(' ', $extraclasses));
+            }
             echo html_writer::start_tag('li', array('class'=>join(' ', $liclasses), 'id'=>'module-'.$modnumber));
             if ($ismoving) {
                 echo '<a title="'.$strmovefull.'"'.
@@ -1384,105 +1458,122 @@ function print_section($course, $section, $mods, $modnamesused, $absolute=false,
             }
             echo html_writer::start_tag('div', array('class'=>join(' ', $classes)));
 
-            $extra = '';
-            if (!empty($modinfo->cms[$modnumber]->extra)) {
-                $extra = $modinfo->cms[$modnumber]->extra;
+            // Get data about this course-module
+            list($content, $instancename) =
+                    get_print_section_cm_text($modinfo->cms[$modnumber], $course);
+
+            //Accessibility: for files get description via icon, this is very ugly hack!
+            $altname = '';
+            $altname = $mod->modfullname;
+            if (!empty($customicon)) {
+                $archetype = plugin_supports('mod', $mod->modname, FEATURE_MOD_ARCHETYPE, MOD_ARCHETYPE_OTHER);
+                if ($archetype == MOD_ARCHETYPE_RESOURCE) {
+                    $mimetype = mimeinfo_from_icon('type', $customicon);
+                    $altname = get_mimetype_description($mimetype);
+                }
+            }
+            // Avoid unnecessary duplication: if e.g. a forum name already
+            // includes the word forum (or Forum, etc) then it is unhelpful
+            // to include that in the accessible description that is added.
+            if (false !== strpos($tl->strtolower($instancename),
+                    $tl->strtolower($altname))) {
+                $altname = '';
+            }
+            // File type after name, for alphabetic lists (screen reader).
+            if ($altname) {
+                $altname = get_accesshide(' '.$altname);
             }
 
-            if ($mod->modname == "label") {
-                if ($accessiblebutdim || !$mod->uservisible) {
-                    echo '<div class="dimmed_text"><span class="accesshide">'.
-                        get_string('hiddenfromstudents').'</span>';
+            // We may be displaying this just in order to show information
+            // about visibility, without the actual link
+            $contentpart = '';
+            if ($mod->uservisible) {
+                // Nope - in this case the link is fully working for user
+                $linkclasses = '';
+                $textclasses = '';
+                if ($accessiblebutdim) {
+                    $linkclasses .= ' dimmed';
+                    $textclasses .= ' dimmed_text';
+                    $accesstext = '<span class="accesshide">'.
+                        get_string('hiddenfromstudents').': </span>';
                 } else {
-                    echo '<div>';
+                    $accesstext = '';
                 }
-                echo format_text($extra, FORMAT_HTML, $labelformatoptions);
-                echo "</div>";
-                if (!empty($mod->groupingid) && has_capability('moodle/course:managegroups', get_context_instance(CONTEXT_COURSE, $course->id))) {
-                    if (!isset($groupings)) {
-                        $groupings = groups_get_all_groupings($course->id);
-                    }
-                    echo " <span class=\"groupinglabel\">(".format_string($groupings[$mod->groupingid]->name).')</span>';
+                if ($linkclasses) {
+                    $linkcss = 'class="' . trim($linkclasses) . '" ';
+                } else {
+                    $linkcss = '';
+                }
+                if ($textclasses) {
+                    $textcss = 'class="' . trim($textclasses) . '" ';
+                } else {
+                    $textcss = '';
                 }
 
-            } else { // Normal activity
-                $instancename = format_string($modinfo->cms[$modnumber]->name, true,  $course->id);
+                // Get on-click attribute value if specified
+                $onclick = $mod->get_on_click();
+                if ($onclick) {
+                    $onclick = ' onclick="' . $onclick . '"';
+                }
 
-                $customicon = $modinfo->cms[$modnumber]->icon;
-                if (!empty($customicon)) {
-                    if (substr($customicon, 0, 4) === 'mod/') {
-                        list($modname, $iconname) = explode('/', substr($customicon, 4), 2);
-                        $icon = $OUTPUT->pix_url($iconname, $modname);
-                    } else {
-                        $icon = $OUTPUT->pix_url($customicon);
+                if ($url = $mod->get_url()) {
+                    // Display link itself
+                    echo '<a ' . $linkcss . $mod->extra . $onclick .
+                            ' href="' . $url . '"><img src="' . $mod->get_icon_url() .
+                            '" class="activityicon" alt="' .
+                            $modulename . '" /> ' .
+                            $accesstext . '<span class="instancename">' .
+                            $instancename . $altname . '</span></a>';
+
+                    // If specified, display extra content after link
+                    if ($content) {
+                        $contentpart = '<div class="contentafterlink' .
+                                trim($textclasses) . '">' . $content . '</div>';
                     }
                 } else {
-                    $icon = $OUTPUT->pix_url('icon', $mod->modname);
+                    // No link, so display only content
+                    $contentpart = '<div ' . $textcss . $mod->extra . '>' .
+                            $accesstext . $content . '</div>';
                 }
 
-                //Accessibility: for files get description via icon, this is very ugly hack!
-                $altname = '';
-                $altname = $mod->modfullname;
-                if (!empty($customicon)) {
-                    $archetype = plugin_supports('mod', $mod->modname, FEATURE_MOD_ARCHETYPE, MOD_ARCHETYPE_OTHER);
-                    if ($archetype == MOD_ARCHETYPE_RESOURCE) {
-                        $mimetype = mimeinfo_from_icon('type', $customicon);
-                        $altname = get_mimetype_description($mimetype);
+                if (!empty($mod->groupingid) && has_capability('moodle/course:managegroups', get_context_instance(CONTEXT_COURSE, $course->id))) {
+                    if (!isset($groupings)) {
+                        $groupings = groups_get_all_groupings($course->id);
                     }
+                    echo " <span class=\"groupinglabel\">(".format_string($groupings[$mod->groupingid]->name).')</span>';
                 }
-                // Avoid unnecessary duplication.
-                if (false !== stripos($instancename, $altname)) {
-                    $altname = '';
-                }
-                // File type after name, for alphabetic lists (screen reader).
-                if ($altname) {
-                    $altname = get_accesshide(' '.$altname);
+            } else {
+                $textclasses = $extraclasses;
+                $textclasses .= ' dimmed_text';
+                if ($textclasses) {
+                    $textcss = 'class="' . trim($textclasses) . '" ';
+                } else {
+                    $textcss = '';
                 }
+                $accesstext = '<span class="accesshide">' .
+                        get_string('notavailableyet', 'condition') .
+                        ': </span>';
 
-                // We may be displaying this just in order to show information
-                // about visibility, without the actual link
-                if ($mod->uservisible) {
-                    // Display normal module link
-                    if (!$accessiblebutdim) {
-                        $linkcss = '';
-                        $accesstext  ='';
-                    } else {
-                        $linkcss = ' class="dimmed" ';
-                        $accesstext = '<span class="accesshide">'.
-                            get_string('hiddenfromstudents').': </span>';
-                    }
-
-                    echo '<a '.$linkcss.' '.$extra.
-                         ' href="'.$CFG->wwwroot.'/mod/'.$mod->modname.'/view.php?id='.$mod->id.'">'.
-                         '<img src="'.$icon.'" class="activityicon" alt="'.get_string('modulename',$mod->modname).'" /> '.
-                         $accesstext.'<span class="instancename">'.$instancename.$altname.'</span></a>';
-
-                    if (!empty($mod->groupingid) && has_capability('moodle/course:managegroups', get_context_instance(CONTEXT_COURSE, $course->id))) {
-                        if (!isset($groupings)) {
-                            $groupings = groups_get_all_groupings($course->id);
-                        }
-                        echo " <span class=\"groupinglabel\">(".format_string($groupings[$mod->groupingid]->name).')</span>';
-                    }
-                } else {
+                if ($url = $mod->get_url()) {
                     // Display greyed-out text of link
-                    echo '<span class="dimmed_text" '.$extra.' ><span class="accesshide">'.
-                        get_string('notavailableyet','condition').': </span>'.
-                        '<img src="'.$icon.'" class="activityicon" alt="'.get_string('modulename', $mod->modname).'" /> <span>'.
-                        $instancename.$altname.'</span></span>';
-                }
-            }
-            if ($usetracking && $mod->modname == 'forum') {
-                if ($unread = forum_tp_count_forum_unread_posts($mod, $course)) {
-                    echo '<span class="unread"> <a href="'.$CFG->wwwroot.'/mod/forum/view.php?id='.$mod->id.'">';
-                    if ($unread == 1) {
-                        echo $strunreadpostsone;
-                    } else {
-                        print_string('unreadpostsnumber', 'forum', $unread);
-                    }
-                    echo '</a></span>';
+                    echo '<div ' . $textcss . $mod->extra .
+                            ' >' . '<img src="' . $mod->get_icon_url() .
+                            '" class="activityicon" alt="' .
+                            $modulename .
+                            '" /> <span>'. $instancename . $altname .
+                            '</span></div>';
+
+                    // Do not display content after link when it is greyed out like this.
+                } else {
+                    // No link, so display only content (also greyed)
+                    $contentpart = '<div ' . $textcss . $mod->extra . '>' .
+                            $accesstext . $content . '</div>';
                 }
             }
 
+            // Module can put text after the link (e.g. forum unread)
+            echo $mod->get_after_link();
+
             if ($isediting) {
                 if ($groupbuttons and plugin_supports('mod', $mod->modname, FEATURE_GROUPS, 0)) {
                     if (! $mod->groupmodelink = $groupbuttonslink) {
@@ -1494,6 +1585,7 @@ function print_section($course, $section, $mods, $modnamesused, $absolute=false,
                 }
                 echo '&nbsp;&nbsp;';
                 echo make_editing_buttons($mod, $absolute, true, $mod->indent, $section->section);
+                echo $mod->get_after_edit_icons();
             }
 
             // Completion
@@ -1566,6 +1658,9 @@ function print_section($course, $section, $mods, $modnamesused, $absolute=false,
                 }
             }
 
+            // Display the content (if any) at this part of the html
+            echo $contentpart;
+
             // Show availability information (for someone who isn't allowed to
             // see the activity itself, or for staff)
             if (!$mod->uservisible) {
@@ -1757,17 +1852,16 @@ function rebuild_course_cache($courseid=0, $clearonly=false) {
         @set_time_limit(0);  // this could take a while!   MDL-10954
     }
 
-    if ($rs = $DB->get_recordset("course", $select,'','id,fullname')) {
-        foreach ($rs as $course) {
-            $modinfo = serialize(get_array_of_activities($course->id));
-            $DB->set_field("course", "modinfo", $modinfo, array("id"=>$course->id));
-            // update cached global COURSE too ;-)
-            if ($course->id == $COURSE->id) {
-                $COURSE->modinfo = $modinfo;
-            }
+    $rs = $DB->get_recordset("course", $select,'','id,fullname');
+    foreach ($rs as $course) {
+        $modinfo = serialize(get_array_of_activities($course->id));
+        $DB->set_field("course", "modinfo", $modinfo, array("id"=>$course->id));
+        // update cached global COURSE too ;-)
+        if ($course->id == $COURSE->id) {
+            $COURSE->modinfo = $modinfo;
         }
-        $rs->close();
     }
+    $rs->close();
     // reset the fast modinfo cache
     $reset = 'reset';
     get_fast_modinfo($reset);
index 4a630b2..9f3df05 100644 (file)
@@ -632,7 +632,7 @@ foreach ($progress as $user) {
                 $describe = get_string('completion-alt-auto-'.$completiontype,'completion');
 
                 print '<td class="completion-progresscell">'.
-                    '<a href="'.$CFG->wwwroot.'/course/togglecompletion.php?user='.$user->id.'&course='.$course->id.'&rolec='.$allow_marking_criteria.'">'.
+                    '<a href="'.$CFG->wwwroot.'/course/togglecompletion.php?user='.$user->id.'&amp;course='.$course->id.'&amp;rolec='.$allow_marking_criteria.'&amp;sesskey='.sesskey().'">'.
                     '<img src="'.$OUTPUT->pix_url('i/completion-manual-'.($is_complete ? 'y' : 'n')).
                     '" alt="'.$describe.'" class="icon" title="Mark as complete" /></a></td>'; //TODO: localize
             } else {
index 38a1cfa..44cca9a 100644 (file)
@@ -10,7 +10,7 @@
         $completion = new completion_info($course);
         if ($completion->is_enabled() && $completion->has_criteria()) {
             echo '<p>';
-            echo '<a href="'.$CFG->wwwroot.'/course/report/completion/index.php?coursetest='.$course->id.'">'.get_string('coursecompletion').'</a>';
+            echo '<a href="'.$CFG->wwwroot.'/course/report/completion/index.php?course='.$course->id.'">'.get_string('coursecompletion').'</a>';
             echo '</p>';
         }
     }
index 5c151df..ad4ef64 100644 (file)
@@ -74,7 +74,7 @@
     foreach ($modinfo->sections as $sectionnum=>$section) {
         foreach ($section as $cmid) {
             $cm = $modinfo->cms[$cmid];
-            if ($cm->modname == 'label') {
+            if (!$cm->has_view()) {
                 continue;
             }
             if (!$cm->uservisible) {
index bb460b8..2ad66bb 100644 (file)
@@ -63,7 +63,7 @@
 
     $modinfo = get_fast_modinfo($course);
 
-    $modules = $DB->get_records_select('modules', "visible = 1 AND name <> 'label'", null, 'name ASC');
+    $modules = $DB->get_records_select('modules', "visible = 1", null, 'name ASC');
 
     $instanceoptions = array();
     foreach ($modules as $module) {
         }
         $instances = array();
         foreach ($modinfo->instances[$module->name] as $cm) {
+            // Skip modules such as label which do not actually have links;
+            // this means there's nothing to participate in
+            if (!$cm->has_view()) {
+                continue;
+            }
             $instances[$cm->id] = format_string($cm->name);
         }
+        if (count($instances) == 0) {
+            continue;
+        }
         $instanceoptions[] = array(get_string('modulenameplural', $module->name)=>$instances);
     }
 
index c68c571..d246139 100644 (file)
@@ -72,9 +72,6 @@ if($group===0 && $course->groupmode==SEPARATEGROUPS) {
 $reportsurl=$CFG->wwwroot.'/course/report.php?id='.$course->id;
 $completion=new completion_info($course);
 $activities=$completion->get_activities();
-if(count($activities)==0) {
-    print_error('err_noactivities','completion',$reportsurl);
-}
 
 // Generate where clause
 $where = array();
@@ -96,16 +93,6 @@ $total = $completion->get_num_tracked_users(implode(' AND ', $where), $where_par
 // Total user count
 $grandtotal = $completion->get_num_tracked_users('', array(), $group);
 
-// If no users in this course what-so-ever
-if (!$grandtotal) {
-    echo $OUTPUT->box_start('errorbox errorboxcontent boxaligncenter boxwidthnormal');
-    echo '<p class="nousers">'.get_string('err_nousers','completion').'</p>';
-    echo '<p><a href="'.$CFG->wwwroot.'/course/report.php?id='.$course->id.'">'.get_string('continue').'</a></p>';
-    echo $OUTPUT->box_end();
-    echo $OUTPUT->footer();
-    exit;
-}
-
 // Get user data
 $progress = array();
 
@@ -120,7 +107,7 @@ if ($total) {
     );
 }
 
-if($csv) {
+if($csv && $grandtotal && count($activities)>0) { // Only show CSV if there are some users/actvs
     header('Content-Disposition: attachment; filename=progress.'.
         preg_replace('/[^a-z0-9-]/','_',strtolower($course->shortname)).'.csv');
     // Unicode byte-order mark for Excel
@@ -155,6 +142,19 @@ if($csv) {
     groups_print_course_menu($course,$CFG->wwwroot.'/course/report/progress/?course='.$course->id);
 }
 
+if(count($activities)==0) {
+    echo $OUTPUT->container(get_string('err_noactivities', 'completion'), 'errorbox errorboxcontent');
+    echo $OUTPUT->footer();
+    exit;
+}
+
+// If no users in this course what-so-ever
+if (!$grandtotal) {
+    echo $OUTPUT->container(get_string('err_nousers', 'completion'), 'errorbox errorboxcontent');
+    echo $OUTPUT->footer();
+    exit;
+}
+
 // Build link for paging
 $link = $CFG->wwwroot.'/course/report/progress/?course='.$course->id;
 if (strlen($sort)) {
index 57abd08..abf50b2 100644 (file)
@@ -77,6 +77,10 @@ foreach ($modinfo->cms as $cm) {
     if (!array_key_exists($cm->modname, $modules)) {
         continue;
     }
+    if (!$cm->has_view()) {
+        // Exclude label and similar
+        continue;
+    }
     $cms[$cm->id] = $cm;
     $resources[$cm->modname][] = $cm->instance;
 }
index 9f5e82c..d720144 100644 (file)
@@ -38,9 +38,10 @@ if (!$cmid && !$courseid) {
 // Process self completion
 if ($courseid) {
     $PAGE->set_url(new moodle_url('/course/togglecompletion.php', array('course'=>$courseid)));
-    
+
     // Check user is logged in
     $course = $DB->get_record('course', array('id' => $courseid), '*', MUST_EXIST);
+    $context = get_context_instance(CONTEXT_COURSE, $course->id);
     require_login($course);
 
     $completion = new completion_info($course);
@@ -50,14 +51,19 @@ if ($courseid) {
     $rolec = optional_param('rolec', 0, PARAM_INT);
 
     if ($user && $rolec) {
+        require_sesskey();
+
+        completion_criteria::factory((object) array('id'=>$rolec, 'criteriatype'=>COMPLETION_CRITERIA_TYPE_ROLE)); //TODO: this is dumb, because it does not fetch the data?!?!
+        $criteria = completion_criteria_role::fetch(array('id'=>$rolec));
 
-        $criteria = completion_criteria::factory((object) array('id'=>$rolec, 'criteriatype'=>COMPLETION_CRITERIA_TYPE_ROLE));
-        $criteria_completions = $completion->get_completions($user, COMPLETION_CRITERIA_TYPE_ROLE);
+        if ($criteria and user_has_role_assignment($USER->id, $criteria->role, $context->id)) {
+            $criteria_completions = $completion->get_completions($user, COMPLETION_CRITERIA_TYPE_ROLE);
 
-        foreach ($criteria_completions as $criteria_completion) {
-            if ($criteria_completion->criteriaid == $rolec) {
-                $criteria->complete($criteria_completion);
-                break;
+            foreach ($criteria_completions as $criteria_completion) {
+                if ($criteria_completion->criteriaid == $rolec) {
+                    $criteria->complete($criteria_completion);
+                    break;
+                }
             }
         }
 
@@ -71,7 +77,7 @@ if ($courseid) {
     } else {
 
         // Confirm with user
-        if ($confirm) {
+        if ($confirm and confirm_sesskey()) {
             $completion = $completion->get_completion($USER->id, COMPLETION_CRITERIA_TYPE_SELF);
 
             if (!$completion) {
@@ -94,7 +100,7 @@ if ($courseid) {
         $PAGE->set_heading($course->fullname);
         $PAGE->navbar->add($strconfirm);
         echo $OUTPUT->header();
-        $buttoncontinue = new single_button(new moodle_url('/course/togglecompletion.php', array('course'=>$courseid, 'confirm'=>1)), get_string('yes'), 'post');
+        $buttoncontinue = new single_button(new moodle_url('/course/togglecompletion.php', array('course'=>$courseid, 'confirm'=>1, 'sesskey'=>sesskey())), get_string('yes'), 'post');
         $buttoncancel   = new single_button(new moodle_url('/course/view.php', array('id'=>$courseid)), get_string('no'), 'get');
         echo $OUTPUT->confirm($strconfirm, $buttoncontinue, $buttoncancel);
         echo $OUTPUT->footer();
index 15acd53..b5ab6cd 100644 (file)
@@ -369,11 +369,17 @@ switch ($mode) {
             INNER JOIN
                 {role_assignments} ra
              ON ra.contextid = con.id
+            INNER JOIN
+                {enrol} e
+             ON c.id = e.courseid
+            INNER JOIN
+                {user_enrolments} ue
+             ON e.id = ue.enrolid AND ra.userid = ue.userid
             AND ra.userid = {$user->id}
         ";
 
         // Get roles that are tracked by course completion
-        if ($roles = $CFG->progresstrackedroles) {
+        if ($roles = $CFG->gradebookroles) {
             $sql .= '
                 AND ra.roleid IN ('.$roles.')
             ';
@@ -394,7 +400,8 @@ switch ($mode) {
         }
 
         // Check if result is empty
-        if (!$rs = $DB->get_recordset_sql($sql)) {
+        $rs = $DB->get_recordset_sql($sql);
+        if (!$rs->valid()) {
 
             if ($course->id != 1) {
                 $error = get_string('nocompletions', 'coursereport_completion');
@@ -403,6 +410,7 @@ switch ($mode) {
             }
 
             echo $OUTPUT->notification($error);
+            $rs->close(); // not going to loop (but break), close rs
             break;
         }
 
@@ -431,8 +439,7 @@ switch ($mode) {
                 $courses['unstarted'][] = $c_info;
             }
         }
-
-        $rs->close();
+        $rs->close(); // after loop, close rs
 
         // Loop through course status groups
         foreach ($courses as $type => $infos) {
index a1f946f..a05c20e 100644 (file)
@@ -194,7 +194,9 @@ function send_welcome_messages($orderdata) {
              WHERE e.id IN(" . implode(',', $orderdata) . ")
           ORDER BY e.userid";
 
-    if (!$rs = $DB->get_recordset_sql($sql)) {
+    $rs = $DB->get_recordset_sql($sql);
+    if (!$rs->valid()) {
+        $rs->close(); // Not going to iterate (but exit), close rs
         return;
     }
 
@@ -247,7 +249,7 @@ function send_welcome_messages($orderdata) {
         }
         while ($ei);
 
-        $rs->close();
+        $rs->close(); // end of iteration, close rs
     }
 }
 
index 6924eaa..060e733 100644 (file)
@@ -254,6 +254,7 @@ function enrol_category_sync_full() {
                 $plugin->delete_instance($instance);
             }
         }
+        return;
     }
 
     list($roleids, $params) = $DB->get_in_or_equal(array_keys($roles), SQL_PARAMS_NAMED, 'r000');
index a40c807..818b05e 100644 (file)
@@ -74,7 +74,7 @@ class enrol_database_plugin extends enrol_plugin {
 
         $localrolefield   = $this->get_config('localrolefield');
         $localuserfield   = $this->get_config('localuserfield');
-        $localcoursefiled = $this->get_config('localcoursefield');
+        $localcoursefield = $this->get_config('localcoursefield');
 
         $unenrolaction    = $this->get_config('unenrolaction');
         $defaultrole      = $this->get_config('defaultrole');
@@ -117,7 +117,7 @@ class enrol_database_plugin extends enrol_plugin {
                         // missing course info
                         continue;
                     }
-                    if (!$course = $DB->get_record('course', array($localcoursefiled=>$fields[$coursefield]), 'id,visible')) {
+                    if (!$course = $DB->get_record('course', array($localcoursefield=>$fields[$coursefield]), 'id,visible')) {
                         continue;
                     }
                     if (!$course->visible and $ignorehidden) {
@@ -265,7 +265,7 @@ class enrol_database_plugin extends enrol_plugin {
 
         $localrolefield   = $this->get_config('localrolefield');
         $localuserfield   = $this->get_config('localuserfield');
-        $localcoursefiled = $this->get_config('localcoursefield');
+        $localcoursefield = $this->get_config('localcoursefield');
 
         $unenrolaction    = $this->get_config('unenrolaction');
         $defaultrole      = $this->get_config('defaultrole');
@@ -308,7 +308,7 @@ class enrol_database_plugin extends enrol_plugin {
 
         // first find all existing courses with enrol instance
         $existing = array();
-        $sql = "SELECT c.id, c.visible, c.$localcoursefiled AS mapping, e.id AS enrolid
+        $sql = "SELECT c.id, c.visible, c.$localcoursefield AS mapping, e.id AS enrolid
                   FROM {course} c
                   JOIN {enrol} e ON (e.courseid = c.id AND e.enrol = 'database')";
         $rs = $DB->get_recordset_sql($sql); // watch out for idnumber duplicates
@@ -321,11 +321,17 @@ class enrol_database_plugin extends enrol_plugin {
         $rs->close();
 
         // add necessary enrol instances that are not present yet
-        $sql = "SELECT c.id, c.visible, c.$localcoursefiled AS mapping
+        $params = array();
+        $localnotempty = "";
+        if ($localcoursefield !== 'id') {
+            $localnotempty =  "AND c.$localcoursefield <> :lcfe";
+            $params['lcfe'] = $DB->sql_empty();
+        }
+        $sql = "SELECT c.id, c.visible, c.$localcoursefield AS mapping
                   FROM {course} c
              LEFT JOIN {enrol} e ON (e.courseid = c.id AND e.enrol = 'database')
-                 WHERE e.id IS NULL AND c.$localcoursefiled <> ?";
-        $rs = $DB->get_recordset_sql($sql, array($DB->sql_empty()));
+                 WHERE e.id IS NULL $localnotempty";
+        $rs = $DB->get_recordset_sql($sql, $params);
         foreach ($rs as $course) {
             if (empty($course->mapping)) {
                 continue;
@@ -430,8 +436,8 @@ class enrol_database_plugin extends enrol_plugin {
             unset($user_mapping);
 
             // enrol all users and sync roles
-            foreach ($requested_roles as $userid=>$roles) {
-                foreach ($roles as $roleid) {
+            foreach ($requested_roles as $userid=>$userroles) {
+                foreach ($userroles as $roleid) {
                     if (empty($current_roles[$userid])) {
                         $this->enrol_user($instance, $userid, $roleid);
                         $current_roles[$userid][$roleid] = $roleid;
@@ -441,7 +447,7 @@ class enrol_database_plugin extends enrol_plugin {
 
                 // unassign removed roles
                 foreach($current_roles[$userid] as $cr) {
-                    if (empty($roles[$cr])) {
+                    if (empty($userroles[$cr])) {
                         role_unassign($cr, $userid, $context->id, 'enrol_database', $instance->id);
                         unset($current_roles[$userid][$cr]);
                     }
diff --git a/enrol/imsenterprise/db/install.php b/enrol/imsenterprise/db/install.php
new file mode 100644 (file)
index 0000000..0180d16
--- /dev/null
@@ -0,0 +1,78 @@
+<?php
+// This file is part of Moodle - http://moodle.org/
+//
+// Moodle is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// Moodle is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
+
+/**
+ * imsenterprise enrolment plugin installation.
+ *
+ * @package    enrol
+ * @subpackage imsenterprise
+ * @copyright  2011 Petr Skoda {@link http://skodak.org}
+ * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
+ */
+
+defined('MOODLE_INTERNAL') || die();
+
+function xmldb_enrol_imsenterprise_install() {
+    global $CFG, $DB;
+
+    // NOTE: this file is executed during upgrade from 1.9.x!
+
+
+    // this plugin does not use the new file api - lets undo the migration
+    $fs = get_file_storage();
+
+    if ($DB->record_exists('course', array('id'=>1))) { //course 1 is hardcoded here intentionally!
+        if ($context = get_context_instance(CONTEXT_COURSE, 1)) {
+            if ($file = $fs->get_file($context->id, 'course', 'legacy', 0, '/', 'imsenterprise-enrol.xml')) {
+                if (!file_exists("$CFG->dataroot/1/imsenterprise-enrol.xml")) {
+                    check_dir_exists($CFG->dataroot.'/');
+                    $file->copy_content_to("$CFG->dataroot/1/imsenterprise-enrol.xml");
+                }
+                $file->delete();
+            }
+        }
+    }
+
+    if (!empty($CFG->enrol_imsfilelocation)) {
+        if (strpos($CFG->enrol_imsfilelocation, "$CFG->dataroot/") === 0) {
+            $location = str_replace("$CFG->dataroot/", '', $CFG->enrol_imsfilelocation);
+            $location = str_replace('\\', '/', $location);
+            $parts = explode('/', $location);
+            $courseid = array_shift($parts);
+            if (is_number($courseid) and $DB->record_exists('course', array('id'=>$courseid))) {
+                if ($context = get_context_instance(CONTEXT_COURSE, $courseid)) {
+                    $file = array_pop($parts);
+                    if ($parts) {
+                        $dir = '/'.implode('/', $parts).'/';
+                    } else {
+                        $dir = '/';
+                    }
+                    if ($file = $fs->get_file($context->id, 'course', 'legacy', 0, $dir, $file)) {
+                        if (!file_exists($CFG->enrol_imsfilelocation)) {
+                            check_dir_exists($CFG->dataroot.'/'.$courseid.$dir);
+                            $file->copy_content_to($CFG->enrol_imsfilelocation);
+                        }
+                        $file->delete();
+                    }
+                }
+            }
+        }
+    }
+
+
+    // TODO: migrate old config settings
+
+}
diff --git a/enrol/imsenterprise/db/upgrade.php b/enrol/imsenterprise/db/upgrade.php
new file mode 100644 (file)
index 0000000..a7d9841
--- /dev/null
@@ -0,0 +1,87 @@
+<?php
+// This file is part of Moodle - http://moodle.org/
+//
+// Moodle is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// Moodle is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
+
+/**
+ * This file keeps track of upgrades to the imsenterprise enrolment plugin
+ *
+ * @package    enrol
+ * @subpackage imsenterprise
+ * @copyright  2011 Petr Skoda {@link http://skodak.org
+ * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
+ */
+
+defined('MOODLE_INTERNAL') || die();
+
+function xmldb_enrol_imsenterprise_upgrade($oldversion) {
+    global $CFG, $DB, $OUTPUT;
+
+    $dbman = $DB->get_manager();
+
+
+    //NOTE: this file is not executed during upgrade from 1.9.x!
+
+
+    if ($oldversion < 2011013000) {
+        // this plugin does not use the new file api - lets undo the migration
+
+        $fs = get_file_storage();
+
+        if ($DB->record_exists('course', array('id'=>1))) { //course 1 is hardcoded here intentionally!
+            if ($context = get_context_instance(CONTEXT_COURSE, 1)) {
+                if ($file = $fs->get_file($context->id, 'course', 'legacy', 0, '/', 'imsenterprise-enrol.xml')) {
+                    if (!file_exists("$CFG->dataroot/1/imsenterprise-enrol.xml")) {
+                        check_dir_exists($CFG->dataroot.'/');
+                        $file->copy_content_to("$CFG->dataroot/1/imsenterprise-enrol.xml");
+                    }
+                    $file->delete();
+                }
+            }
+        }
+
+        if (!empty($CFG->enrol_imsfilelocation)) {
+            if (strpos($CFG->enrol_imsfilelocation, "$CFG->dataroot/") === 0) {
+                $location = str_replace("$CFG->dataroot/", '', $CFG->enrol_imsfilelocation);
+                $location = str_replace('\\', '/', $location);
+                $parts = explode('/', $location);
+                $courseid = array_shift($parts);
+                if (is_number($courseid) and $DB->record_exists('course', array('id'=>$courseid))) {
+                    if ($context = get_context_instance(CONTEXT_COURSE, $courseid)) {
+                        $file = array_pop($parts);
+                        if ($parts) {
+                            $dir = '/'.implode('/', $parts).'/';
+                        } else {
+                            $dir = '/';
+                        }
+                        if ($file = $fs->get_file($context->id, 'course', 'legacy', 0, $dir, $file)) {
+                            if (!file_exists($CFG->enrol_imsfilelocation)) {
+                                check_dir_exists($CFG->dataroot.'/'.$courseid.$dir);
+                                $file->copy_content_to($CFG->enrol_imsfilelocation);
+                            }
+                            $file->delete();
+                        }
+                    }
+                }
+            }
+        }
+
+        upgrade_plugin_savepoint(true, 2011013000, 'enrol', 'imsenterprise');
+    }
+
+
+    return true;
+}
+
+
index e0be8af..a955872 100644 (file)
@@ -26,5 +26,5 @@
 
 defined('MOODLE_INTERNAL') || die();
 
-$plugin->version = 2010071200;
+$plugin->version = 2011013000;
 $plugin->cron = 60;
index c977fcf..99f4779 100644 (file)
@@ -179,12 +179,12 @@ class enrol_self_plugin extends enrol_plugin {
             return null;
         }
 
-        if ($instance->enrolstartdate != 0 and $instance->enrolstartdate < time()) {
+        if ($instance->enrolstartdate != 0 and $instance->enrolstartdate > time()) {
             //TODO: inform that we can not enrol yet
             return null;
         }
 
-        if ($instance->enrolenddate != 0 and $instance->enrolenddate > time()) {
+        if ($instance->enrolenddate != 0 and $instance->enrolenddate < time()) {
             //TODO: inform that enrolment is not possible any more
             return null;
         }
index 345d6e5..6ffcaf9 100644 (file)
@@ -23,4 +23,4 @@
  * @license   http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
  */
 
-$string['filtername'] = 'Activity Names Auto-linking';
+$string['filtername'] = 'Activity names auto-linking';
index 05853b4..67b715c 100644 (file)
@@ -183,7 +183,7 @@ function refineTeX($texexp) {
 }
 
 function outputText($texexp) {
-  header("Content-type: text/html");
+  header("Content-type: text/html; charset=utf-8");
   echo "<html><body><pre>\n";
   if ($texexp) {
     $texexp = str_replace('<','&lt;',$texexp);
index 711539e..5435f7f 100644 (file)
@@ -23,4 +23,4 @@
  * @license   http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
  */
 
-$string['filtername'] = 'Algebra Notation';
+$string['filtername'] = 'Algebra notation';
index 36c86db..5669366 100644 (file)
@@ -23,5 +23,5 @@
  * @license   http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
  */
 
-$string['badwords'] = 'shit,fucked,fucker,fuck,dickhead, dick,cockhead,cock,cunt,asshole,arsehole,prick,bitch, jism,whore,slut,wanker, wank,bastard,dildo,masturbate, orgasm,penis,nigger, pussy,vagina';
-$string['filtername'] = 'Word Censorship';
+$string['badwords'] = 'shit,fucked,fucker,fuck,dickhead,dick,cockhead,cock,cunt,asshole,arsehole,prick,bitch,jism,whore,slut,wanker,wank,bastard,dildo,masturbate,orgasm,penis,nigger,pussy,vagina';
+$string['filtername'] = 'Word censorship';
index 26a3fec..7c86187 100644 (file)
@@ -23,4 +23,4 @@
  * @license   http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
  */
 
-$string['filtername'] = 'Email Protection';
+$string['filtername'] = 'Email protection';
index 59d8151..6a9ec85 100644 (file)
@@ -125,6 +125,9 @@ class filter_mediaplugin extends moodle_text_filter {
 
             $search = '/<a[^>]*href="([^<]*)youtube.com\/v\/([^"]*)"[^>]*>(.*?)<\/a>/is';
             $newtext = preg_replace_callback($search, 'filter_mediaplugin_youtube_callback', $newtext);
+
+            $search = '/<a(\s+[^>]+?)?\s+href="((([^"]+)youtube\.com)\/view_play_list\?p=([^"]*))"[^>]*>(.*?)<\/a>/is';
+            $newtext = preg_replace_callback($search, 'filter_mediaplugin_youtube_playlist_callback', $newtext);
         }
 
         if (!empty($CFG->filter_mediaplugin_enable_img)) {
@@ -349,6 +352,25 @@ function filter_mediaplugin_youtube_callback($link, $autostart=false) {
            '</object>';
 }
 
+/**
+ * Change Youtube playlist into embedded Youtube playlist videos
+ */
+function filter_mediaplugin_youtube_playlist_callback($link, $autostart=false) {
+
+    $site = s($link[4]);
+    $param = s($link[5]);
+    $info = s($link[6]);
+
+    return '<object title="'.$info.'"
+                    class="mediaplugin mediaplugin_youtube" type="application/x-shockwave-flash"
+                    data="'.$site.'youtube.com/p/'.$param.'&amp;fs=1&amp;rel=0" width="400" height="320">'.
+           '<param name="movie" value="'.$site.'youtube.com/p/'.$param.'&amp;fs=1&amp;rel=0" />'.
+           '<param name="FlashVars" value="playerMode=embedded" />'.
+           '<param name="wmode" value="transparent" />'.
+           '<param name="allowFullScreen" value="true" />'.
+           '</object>';
+}
+
 /**
  * Change links to images into embedded images
  */
index fadff70..7ec6bae 100644 (file)
@@ -23,7 +23,7 @@
  * @license   http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
  */
 
-$string['filtername'] = 'Multimedia Plugins';
+$string['filtername'] = 'Multimedia plugins';
 $string['flashanimation'] = 'Flash animation';
 $string['flashvideo'] = 'Flash video';
 $string['mp3audio'] = 'MP3 audio';
index 434bab3..f7166ed 100644 (file)
@@ -23,4 +23,4 @@
  * @license   http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
  */
 
-$string['filtername'] = 'TeX Notation';
+$string['filtername'] = 'TeX notation';
index 4862224..a53f2ee 100644 (file)
@@ -96,7 +96,7 @@
 
 
     function outputText($texexp) {
-        header("Content-type: text/html");
+        header("Content-type: text/html; charset=utf-8");
         echo "<html><body><pre>\n";
         if ($texexp) {
             $texexp = str_replace('<', '&lt;', $texexp);
old mode 100755 (executable)
new mode 100644 (file)
index 4cd70b3..8681a83
@@ -79,8 +79,13 @@ if ($id) {
                 continue;
             }
 
-            // this was idnumber
-            $gradeitems[$grade_item->id] = $grade_item->get_name();
+            $displaystring = null;
+            if (!empty($grade_item->itemmodule)) {
+                $displaystring = get_string('modulename', $grade_item->itemmodule).': '.$grade_item->get_name();
+            } else {
+                $displaystring = $grade_item->get_name();
+            }
+            $gradeitems[$grade_item->id] = $displaystring;
         }
     }
 }
@@ -88,7 +93,9 @@ if ($id) {
 if ($importcode = optional_param('importcode', '', PARAM_FILE)) {
     $filename = $CFG->dataroot.'/temp/gradeimport/cvs/'.$USER->id.'/'.$importcode;
     $fp = fopen($filename, "r");
-    $header = explode($csv_delimiter, fgets($fp,GRADE_CSV_LINE_LENGTH), PARAM_RAW);
+    $headers = fgets($fp, GRADE_CSV_LINE_LENGTH);
+    $header = explode($csv_delimiter, $headers);
+    fclose($fp);
 }
 
 $mform2 = new grade_import_mapping_form(null, array('gradeitems'=>$gradeitems, 'header'=>$header));
@@ -122,7 +129,7 @@ if ($formdata = $mform->get_data()) {
     $fp = fopen($filename, "r");
 
     // --- get header (field names) ---
-    $header = explode($csv_delimiter, fgets($fp,GRADE_CSV_LINE_LENGTH));
+    $header = explode($csv_delimiter, fgets($fp, GRADE_CSV_LINE_LENGTH));
 
     // print some preview
     $numlines = 0; // 0 preview lines displayed
@@ -136,10 +143,10 @@ if ($formdata = $mform->get_data()) {
     }
     echo '</tr>';
     while (!feof ($fp) && $numlines <= $formdata->previewrows) {
-        $lines = explode($csv_delimiter, fgets($fp,GRADE_CSV_LINE_LENGTH));
+        $lines = explode($csv_delimiter, fgets($fp, GRADE_CSV_LINE_LENGTH));
         echo '<tr>';
         foreach ($lines as $line) {
-