1757 Commits

Author SHA1 Message Date
nicolasconnault
39536381d5 MDL-11543 Printing nice list of categories for parent category drop-down 2007-10-10 06:21:37 +00:00
nicolasconnault
2c23af9d87 MDL-11543 format_string(parent category name) 2007-10-10 06:04:14 +00:00
nicolasconnault
9c536df7c4 MDL-11543 Refactored editcategory and form 2007-10-10 06:01:54 +00:00
nicolasconnault
150f64e661 MDL-11608 Removed stripslashes_safe($rename) and changed PARAM_RAW to PARAM_TEXT for rename param 2007-10-10 04:59:35 +00:00
nicolasconnault
cd405db239 MDL-11543 Replacing "Site" with "Top" in the list of available parent categories 2007-10-10 04:53:32 +00:00
moodler
09deab0661 Miscellaneous fixes for MDL-11543
- added button to edit current category
 - removed old mini-forms to do the same
 - tidied up various things and CSS as well
2007-10-10 04:05:46 +00:00
iarenaza
0baafc173a Fix MDL-11632: Multiple files with emtpy lines outside PHP open/close tags
There are multiple issues with Moodle files containing empty or blank lines
(lines consisting of white spaces or tabs only) and/or white space before or
after the PHP open and close tags, notably with config.php and theme files.
2007-10-09 21:43:28 +00:00
nicolasconnault
1f682581a7 MDL-11543 Temporary solution originally proposed by Martin 2007-10-09 17:22:10 +00:00
nicolasconnault
62ecaed9df MDL-11608 The $rename param was obtained with PARAM_NOTAG, I changed that to PARAM_RAW. I also changed the rename field's value to htmlspecialchars($category->name) 2007-10-09 14:08:05 +00:00
nicolasconnault
86830be66e MDL-11543 Temporary solution originally proposed by Martin 2007-10-09 12:53:24 +00:00
skodak
128f098418 MDL-11640
* improved handling of dirty contexts in general - caching, switching in cron, marking, loading, etc.
* role_assing() and role_unassign() now marks dirty contexts because we use has_capability() in this function - we can not do it later outside to speedup bulk operations
* fixed some inline docs
* fixed notice from rs closing
* removed cached $CONTEXT from has_capability() - $context is now required parameter; this was hiding serious bugs when context did not exist or ppl passed false as parameter
* removed some ===, we can not use these on function parameters - we must support ints, strings, '', nulls, etc. - this could be a source of really dangerous bugs in future
* some other improvements and fixes - documented inline
2007-10-09 12:49:54 +00:00
nicolasconnault
5a81060351 MDL-11500 Catching empty $coursemod when viewhiddensection is false, + corrected type $coursemode => $coursemod 2007-10-05 05:40:56 +00:00
nicolasconnault
05a334392c MDL-11525 When courseid is not present in the log entry, showing "Site" instead of $log->info 2007-10-05 04:24:42 +00:00
nicolasconnault
ece966f06e MDL-11482 Resolved the sum icon issue (added a new x-bar icon) and resolved a dependency problem in moodlelib 2007-10-03 12:22:25 +00:00
skodak
1f41940f20 MDL-11523 fixed - moving categories and courses around breaks paths and depths in context table + some notice fixes 2007-10-02 22:34:12 +00:00
nfreear
806ebc150c Fixes MDL-11161, Activity type text ... beginning of activity links in Screen Reader...moved to end (also MDL- 7436) 2007-10-02 09:36:47 +00:00
stronk7
6bb919860b Passing $course to require_login() provides correct and
automatic navlinks to the course. MDL-11452
2007-09-27 23:37:42 +00:00
skodak
95aa0af862 MDL-11472 fixed harcoded mdl_ prefix in sql queries 2007-09-27 08:41:19 +00:00
nfreear
d2bd42498c Follow-up for MDL-1149 Accessibility: Current week/topic is NOT indicated non-visually. Reorder. 2007-09-26 12:53:04 +00:00
nfreear
6285f8a882 Fix MDL-7436 Accessibility "Indicate type of resource in the name of the resource" 2007-09-25 15:15:07 +00:00
nfreear
f4a01ab61f MDL-1149 Accessibility: Current week/topic is NOT indicated non-visually, only in styling. 2007-09-25 12:05:36 +00:00
nfreear
e9b9c1d810 MDL-1149 Accessibility: Current week is NOT indicated non-visually, only in styling. 2007-09-25 12:00:51 +00:00
mattc-catalyst
acf000b077 MDL-11419 - groups: interface enhancements + new features:
* Display the grouping a course module belongs to on the course page - for course managers only.
    * When adding users to groups, display the groups a user already belongs to.
    * Added an overview report that shows groupings, groups and members for a course.
    * Added a dialogue to automatically create groups and assign members based on either the number of desired groups or the number of desired users per group.
2007-09-24 21:55:15 +00:00
nfreear
e0b033d5f8 Partial fix of reopened MDL-7436 Accessibility: "Indicate type of resource in the name of the resource" 2007-09-24 17:26:40 +00:00
skodak
651f7cf277 MDL-10833 course theme in live logs fixed 2007-09-24 15:39:29 +00:00
skodak
f2fdc8ebe7 MDL-11071 Added disabledif logic to groupings/groups common dialogue 2007-09-24 15:07:00 +00:00
skodak
024ef5288a MDL-11414 fixed handling of log urls (problem reported by Andreas Nolden) 2007-09-23 13:13:13 +00:00
nicolasconnault
2f6c662f41 MDL-11379 and MDL-11380 fixed 2007-09-21 07:52:52 +00:00
martinlanghoff
853a093ec5 course/index: remove call to rebuild_context_rel()
Very last caller to rebuild_context_rel() and any XX_context_rel()
function. move_category() already takes care of calling
context_moved(), which does the required context.path maintenance.

Addresses MDL-11219
2007-09-19 07:53:17 +00:00
martinlanghoff
6b4d8c4d58 course/lib: print_course() fix bug when $course->managers was not set
Fix a thinko in a variable assignment that prevented us from grabbing
the correct roles as managers. Addresses Yu's report at
MDL-11182 admin shows up as teacher.
2007-09-19 07:52:27 +00:00
martinlanghoff
5b9e50caf0 course/lib: print_my_moodle() - ask get_my_courses() for the summary
get_my_courses() now defaults to a much leaner dataset, but accepts an
array of "additional" fields we want. So ask nicely for the summary,
so that we can print_course() later with it.
2007-09-19 07:51:50 +00:00
martinlanghoff
6c54240a61 course/lib: print_courses() drop $hidesitecourse parameter
The $hidesitecourse and related code seem to be dead code. An audit of
the callers did not turn up any interesting/valid use of it.
2007-09-19 07:50:41 +00:00
martinlanghoff
49cd4d7934 Revert "course/lib: print_courses() - no need to worry about sitecourse"
This reverts commit d7816749a4ceda352a2fac6e82d7f02f435473ed.
2007-09-19 07:50:28 +00:00
martinlanghoff
1d28d87b35 accesslib - Ensure newly-created categories have a context
New categories need a context immediately, and for top-level
categories, they also need to taint the "root" context to trigger
a reload of $USER->access.

This fixes problems with creation of initial courses(MDL-11178),
duplicate misc categories, etc.
2007-09-19 07:50:05 +00:00
martinlanghoff
55c47e48a9 course/lib: print_courses() - no need to worry about sitecourse
get_courses_wmanagers() excludes the sitecourse, so we no longer
check for it. And check explicitly for an empty course array.
2007-09-19 07:49:23 +00:00
martinlanghoff
c9e42aaa99 course/index: Bring back Petr's MDL-9647 simplify dealing with headers/footers in admin sections
I had mistakenly reverted some of Petr's changes.

Fixes MDL-11179 19PERF: Notice on /course/index.php as admin
2007-09-19 07:48:56 +00:00
martinlanghoff
dfbf98cdb3 course/index: minor context-related fixes
- The code uses the system context a lot. Declare
   $sysctx at the top and use it.

 - If the category has a context property, use it
   (saves 1 DB query per category displayed)

The DB costs of this page in editing mode are

 - ~100 DB queries for fix_course_sortorder()

 - ~50 DB queries for the categories listing

If we rewrite both to lose the recursion, we could resolve the
page in perhaps 5 DBq.
2007-09-19 07:27:31 +00:00
martinlanghoff
4dde1463ee course/lib: print_courses() and print_course() rework
print_course() can now recognise a $course object that already has a
$course->context obj and a $course->managers array, which means that
there will be no DB access triggered by print_course().

(Backwards compat is retained so it still works the old way for
callers that get a single course printed anyway (during enrolment
for example.)

And print_courses() now uses get_courses_wmanagers(), and passes the
returned $course objects to print_course().

With this patch, a homepage listing 9 courses (with varying numbers of
teachers) sheds 63 DB queries (88 to 25). A course listing page with
3 courses sheds 9 (33 to 24).

On a single server overall time spent serving the homepage is reduced just
a little bit (262ms to 238ms) -- on a clustered environment, less DB queries
mean much lower latency and DB costs.
2007-09-19 07:26:54 +00:00
martinlanghoff
431cad0d62 course/lib: print_course() bugfix when $rusers is empty 2007-09-19 07:26:27 +00:00
martinlanghoff
57770b87d0 Interactive enrolment/unenrolments: make sure we unset mycourses 2007-09-19 07:17:23 +00:00
martinlanghoff
0e801c6c9d course/unenrol: check $USER->access[rsw] for role switches 2007-09-19 07:15:38 +00:00
martinlanghoff
88903eeab9 course/index: Move categories around using move_category()
Use the newfangled move_category() when moving categories
around, to ensure we Do The Right Thing in the backend,
decoupled from UI stuff.
2007-09-19 07:14:34 +00:00
martinlanghoff
19f601d178 course/lib: move_courses() calls content_moved(), intro move_category()
move_courses() now calls content_moved() which will take care of any
accesslib-required changes. And introducing move_category() which
also calls content_moved() when needed.
2007-09-19 07:14:23 +00:00
martinlanghoff
a372aab507 course: Changing a course cat from course/edit calls context_moved()
Changes to course cat from the main course settings form now calls
context_moved(), and accesslib data is properly maintained.
2007-09-19 07:13:57 +00:00
martinlanghoff
c633af7a5a course/edit: mark the course contextpath as dirty to force a reload
Combined with the path creation in create_context() we can now create
a course, enter and edit it immediately. Amazing.

Like - 21st century technology.
2007-09-19 07:13:20 +00:00
martinlanghoff
3d3def3a4e course/unenrol codepaths mark the context dirty - bugfix
Oops. one if() branch was missing the mark_context_dirty(). Fixed.
2007-09-19 07:12:43 +00:00
martinlanghoff
a9d4ea7849 All interactive enrol/unenrol codepaths mark the context dirty
Manually enrolling and unenrolling self, and other users should
transparently set the context dirty. So walk all callers to
role_assign() and role_unassign() and mark the context dirty
where appropriate.

OTOH, most automated-backend enrol/unenrol mechanisms should not.
The backend lookups that happen when you login are well covered
by the login/enrolment process, and don't need to be marked dirty.
2007-09-19 07:11:42 +00:00
martinlanghoff
690c946c15 get_role_users() callers rework to use the new $gethidden 2007-09-19 07:09:50 +00:00
martinlanghoff
3bf13d05f5 course/lib:print_course() smarter calling of get_role_users()
And saves a few dbqueries too...
2007-09-19 07:09:24 +00:00
martinlanghoff
026579bbc3 course/search.php: smarter about contexts, bugfix in pagination
Save a ton of queries about contexts, and a bugfix in how we are
calling the pagination for get_courses_search().
2007-09-19 07:08:50 +00:00