137 Commits

Author SHA1 Message Date
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
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
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
d863419245 course/index: move orphan fixups to an optimised fix_coursecategory_orphans()
Move the fixups for orphan courses to the newly minted
fix_coursecategory_orphans() -- and optimise it to take only 1 dbquery for
the common case.

If we do find lots of orphans, we issue 2 updates per orphan.

This cuts down dbqueries drastically - we used to have 2x the number of
courses in the site.
2007-09-12 02:56:36 +00:00
nicolasconnault
ba7472ccdf MDL-10910 Corrected two errors committed while fixing MDL-10870 2007-08-23 15:08:14 +00:00
toyomoyo
1dc08b85b1 MDL-4384, fixed undefined function call, hide the add sub category form in non-editing mode 2007-08-20 01:59:50 +00:00
nicolasconnault
0be6f67819 MDL-10870 All files updated to new build_navigation() method. Most are untested, because they are not easily accessible within a moodle site. 2007-08-17 19:09:11 +00:00
toyomoyo
ca5d523bef MDL-4384, description for course categories 2007-08-15 08:28:40 +00:00
toyomoyo
c345bb584a MDL-10679, improvement to context_rel table and load_user_capability 2007-08-02 08:28:29 +00:00
toyomoyo
e513826187 MDL-9983, adding triggers for certain events, no handler implemented 2007-07-09 06:43:33 +00:00
skodak
40935142f7 MDL-9647 simplify dealing with headers/footers in admin sections; some more cleanup
fixed continue button in error() on admin page when link present
2007-04-30 17:28:29 +00:00
skodak
1ae083e424 MDL-9647 simplify dealing with headers/footers in admin sections 2007-04-30 17:08:34 +00:00
toyomoyo
fb31c40a9c fix for MDL-9398, users need site:config to create course categories 2007-04-18 04:54:47 +00:00
skodak
571880d220 MDL-9172 "Turn editing off" button disappear from category page; merged from MOODLE_18_STABLE 2007-04-02 13:46:01 +00:00
stronk7
d9bb8caa28 Adding a missing parameter to the "add new course" button. MDL-9129
Merged from MOODLE_18_STABLE
2007-03-30 15:36:52 +00:00
toyomoyo
de0d92e378 fix for MDL-9010, course request button should not appear when it is disabled 2007-03-26 05:50:55 +00:00
nicolasconnault
45b26feebb MDL-2974 - Corrected notification of correctly entered new category with multilang display 2007-03-07 01:25:43 +00:00
moodler
6ba65fa08d Merged Nicolas' changes from MDL-8582 into HEAD. 2007-02-28 06:25:22 +00:00
toyomoyo
e2cd3ed012 merged nick's fix for MDL-8582, ampersand in course name/shortname causes xtheml strict problems 2007-02-23 06:03:09 +00:00
toyomoyo
35d0244a37 taking out deprecated width in print_courses and print_course 2007-02-14 04:56:26 +00:00
moodler
2cae9a4f11 Added a 'courseboxes' div around the course boxes on the course listing to help some CSS 2007-02-14 04:22:24 +00:00
moodler
378ef1fe98 Cleaned up HTML, quotes and styles for the neglected category editing screen MDL-8145 2007-02-05 07:27:07 +00:00
moodler
44b843b6d6 More XHTML strict stuff 2007-01-10 08:35:45 +00:00
skodak
0d905d9f34 MDL-7861 new class .icon and .iconsmall 2007-01-08 09:14:05 +00:00
skodak
b7dc225654 MDL-8062 1.3 Remove name attribute from <form> and fix focus everywhere - more changes ahead 2007-01-04 21:32:36 +00:00
vyshane
d4a18e3460 Added missing footer for delete confirmation view. MDL-7861. 2006-12-20 01:15:15 +00:00
toyomoyo
f78aa86032 MDL-7861, strict xhtml for course/index page 2006-12-19 05:57:55 +00:00
toyomoyo
54926e7818 various accessbility fixes 2006-12-13 03:03:43 +00:00
skodak
344044b28e MDL-7434 all images that convey information should have alt text to convey that information - part 1 2006-11-24 20:16:37 +00:00
skodak
6124048972 major whitespace cleanup - fixed tabs 2006-09-20 20:31:09 +00:00
skodak
09575480bb fixed several warnings in get_course() 2006-09-17 18:07:35 +00:00
toyomoyo
ae9e4c064e replacing iscreator() calls with capabilty 2006-09-12 08:56:10 +00:00
skodak
a13d2157f4 fixed wrong placement of comma 2006-09-08 15:53:24 +00:00
toyomoyo
51792df056 adding capabilities 2006-09-08 08:46:26 +00:00
skodak
6e4dc10f54 deglobalization of $ADMIN; merged admin/adminlib.php into lib/adminlib.php; fixed includes and some other minor fixes 2006-09-02 13:14:57 +00:00
vinkmar
7ff99cb64f admin page cleanup (google soc 2006)... updated to use new pagelib 2006-08-18 07:27:05 +00:00
moodler
0468976c9a SWEEPING CLEANUP
The API was changed slightly so that has_capability now takes the
whole $context object (we almost always have it anyway)

The $kill thing was removed.   If you want to assert a capability
then use:

    require_capability('capname', $context);

with optional variables to modify the error message

Misc bugs here and there also removed and code tidied
2006-08-14 05:55:40 +00:00
moodler
bbbf2d4015 ROLES AND PERMISSIONS - FIRST CHECK-IN
=======================================

WARNING:  DEV IS CURRENTLY VERY UNSTABLE.

This is a mega-checkin of the new Roles system.   A lot of changes have
been made in core and modules.

Currently there are a lot of rough edges and known problems.  We are
working hard on these .. .the reason for getting this into HEAD at this
stage is enable us to move faster (our branch was diverging from HEAD
too much).

Please keep an eye on http://docs.moodle.org/en/Roles for current status
and information for developers on how to use the new Roles system.
2006-08-08 05:13:06 +00:00
skodak
d1a66080d5 Bug #6168 - missing link for course request - fixed; merged from MOODLE_16_STABLE 2006-07-31 09:18:52 +00:00
nfreear
b65f13b510 Fix, bug 5614 - added ALT text for link icons (x 5), based on TITLE. Merged from stable branch. 2006-06-02 13:18:49 +00:00
skodak
82f0028119 do not show pending courses button for nonadmins bug #5564; merged from MOODLE_16_STABLE 2006-05-20 18:08:25 +00:00
skodak
a8ff614fb8 general cleanup of xxx_parameter() functions; fixed broken requesting of courses 2006-04-12 16:41:10 +00:00
skodak
9d6a11f8ff general cleanup of xxx_parameter() functions + fixed logic of edit button - now interconnected with category.php 2006-04-11 20:39:30 +00:00
patrickslee
765d3c7dde Show category list rather than the whole list of courses if there is only one category and with more than 200 courses in it
Otherwise we will have a HUGE list of courses flooding our browser.

Backported from MOODLE_15_STABLE
2006-02-08 04:21:22 +00:00
stronk7
b3bcee2457 First field must be unique in every select. Bug 4619.
(http://moodle.org/bugs/bug.php?op=show&bugid=4619)

Merged from MOODLE_15_STABLE
2006-01-20 15:09:54 +00:00
mjollnir_
0705ff843b Course request feature. Allows normal users to 'request' courses they would like created,
and admins can approve or reject pending courses.

Also, contains the ability to restrict activity modules on a per course basic. Strict config options:
  enable restricting modules at ALL (for all courses, no courses, requested courses), what to do by default for newly created courses
  as well as what modules to enable for above category by default.

This feature was created for the aim of building a community side to moodle - for institutes that have strict courses and enrolments, allowing normal users to request interest courses is a good feature,
but some modules may be redundant (assignment, lesson, quiz etc)

  Please test!
2005-08-16 06:15:49 +00:00
thepurpleblob
7168423c82 Replaced require_variable(), optional_variable() with approproate
required_param(), optional_param() etc.
2005-06-14 09:21:09 +00:00
moodler
d22f8a5331 Small visual improvement 2005-03-22 18:17:45 +00:00
moodler
810393c804 Removed THEME from many course files 2005-01-25 14:03:43 +00:00