Commit graph

1740 commits

Author SHA1 Message Date
defacer
8a47e075b3 Changing the way that applicable formats for each block are defined:
The format for each page is now the same as the id attribute of the
BODY tag, which in turn is a simple function of the script's relative path:

The format for e.g. a quiz view page is "mod-quiz-view". The format for the
site index is "site-index". Exception: the format for courses is not just
"course-view", but "course-view-weeks" etc.

Obviously the applicable_formats() override for each block should now take
this into account. The matching rules now are:

* You can specify the full format, e.g. "mod-quiz-view" => true
  will allow the block to be added in quizzes
* Prefixes match the full page format, e.g. "mod" matches ALL activities
* You can use "*" as a wildcard, e.g. "mod-*-view" matches just the view.php
  page of all activities
* These rules interoperate, thus "mod-*" is the same as "mod"
* "all" remains as a catch-all situation
2005-02-08 02:59:44 +00:00
mjollnir_
bb64b51aa3 First cut of email to module (or core) processing.
This patch contains:

* email_to_user will set the envelope sender to a special bounce processing address (based on $CFG settings)
* email_to_user will accept (and set) a reply-to header, to be generated by the module calling the function.

* new functions:

	* generate_email_processing_address - ALWAYS use this to generate the reply-to header. reply-to header will look like this:

	(LIMIT: 64 chars total)
	prefix - EXACTLY four chars
	encodeded, packed, moduleid (0 for core) (2 chars)
	up to 42 chars for the modules to put anything they want it (can contain userid (or, eg for forum, postids to reply to), or anything really. 42 chars is ABSOLUTE LIMIT)
	16 char hash (half an md5) of the first part of the address, together with a site "secret"

	* moodle_process_email - any non-module email processing goes here (currently used for processing bounces)

* bounce handling:

	* config settings for bounce threshold and ratio (and whether to handle bounces at all)
	* if too many bounces occur against any given user, user_not_fully_set_up will force an email address change
	* associated functions (over_bounce_threshold, set_send_count, set_bounce_count)

* handling emails to noreply address (see below)

* new script - admin/process_email.php

	This script needs to be called from your mail program for anything starting with the 4 char prefix described above (and optionally, the noreply address)
	It will bounce emails to the noreplyaddress, with a friendly "this is not a real email address" message

	It will break down and unencode the email address into moduleid and validate the half md5 hash, and call $modname_process_email (if it exists). Arguments to these functions are: $modargs (any part of the email address that isn't the prefix, modid or the hash) and the contents of the email (read from STDIN).

* associated string changes/additions

* changes in config-dist.php to give clues as to how to set this up.

MODULE WRITERS!

take a look at new functions moodle_process_email and generate_email_processing_address  in moodlelib.php for ideas about how to

	* encode and unencode the arguments your module needs to do the processing
	* how to deal with multiple "actions" for any given module.

Martin Langhoff <martin@catalyst.net.nz> will be writing up some PROPER documentation, containing amongst other things config settings for different mail servers (this was developed against Postfix).  Feel free to email me with any feedback on the code or design, penny@catalyst.net.nz.  Or post on the developer fourm.
2005-02-08 02:57:14 +00:00
defacer
86a956a42a Fixing this to not show notices if a block doesn't have an id attribute. 2005-02-08 00:53:55 +00:00
defacer
d49a3fc5a8 Removing the inline style, migrating to styles_layout.css 2005-02-08 00:22:37 +00:00
defacer
e1f76e76a9 Give an id attribute to the "Add Blocks" block so that the new hide/show
provisions in weblib don't print notices.
2005-02-08 00:00:21 +00:00
defacer
3524435159 The W3C valid way to write script tags is <script type="text/javascript">. 2005-02-07 23:56:54 +00:00
moodler
da17a899d7 Added class and id to print_table, and id to print_simple_box 2005-02-07 11:08:37 +00:00
mjollnir_
ffed6bf316 Better fix for 2479. This time I'm 99.999999% positive it's fixed ;) 2005-02-07 09:32:24 +00:00
mjollnir_
835c8061b6 Removing db ids (found their way in from copying sql - bad) from last patch 2005-02-07 09:27:03 +00:00
mjollnir_
178ccd11c0 Fixing bug 2479. Can't figure out a way to do it with a left join at this stage but the query doesn't look too bad. Anyone who thinks they can figure out a more elegant way for it is welcome\! 2005-02-07 09:22:07 +00:00
moodler
106137d877 Fixed PARAM_ALPHA 2005-02-07 02:13:18 +00:00
gustav_delius
2ce17a0d5a The html editor was inserting a paragraph with just a space in it which clearly created problems for fields that the user wanted to leave empty.
There was also a problem when switching to text mode and back again: the status bar showed Path: Path:. I have taken out the second one.
2005-02-06 21:04:10 +00:00
skodak
3abd61254c this file should be gone long ago, removing now 2005-02-06 19:46:09 +00:00
skodak
b463ce3cae fixed pclzip import 2005-02-06 19:40:01 +00:00
skodak
54318b0462 typo in comment 2005-02-06 19:23:32 +00:00
urs_hunkler
c24a1ccd08 I added all code to handle the cookies and the sideblock content, the icon and the patches for hiding/showing the content of the sideblocks.
How it works:
_ within the "sideblockheading" a DIV with class="hide-show" holds a link calling the JS containerDisplaySwitching(). To the user it's represented by the icon "switch.gif" (a plus in a square) at the right end side of the header.
_ all content of the sideblock is surounded by a new <div class="blockcontent" id="'.$attributes['id']."_cont\">"
_ a call of the JS containerDisplaySwitching() changes the state of the appropriate DIV with the content to "display:none/inline" and writes this state into a cookie.
_ at the end of every block I added a call to the JS "containerDisplaySet()". This reads the block's state and hides the content or leaves it visible with every page load.
_ in the stylesheet I added the positioning of the icon:
.sideblockheading .hide-show {
    float:right;
}
.sideblockheading a img.hide-show-image {
    padding-top:0.25em;
}
2005-02-05 21:37:53 +00:00
fiedorow
9ca3b4f313 Bypass enrolment if guest shortcut for courses that allow guests. 2005-02-05 16:40:38 +00:00
mjollnir_
ee1bef900a Fixing bug 2480 - meta course enrolment 2005-02-05 05:15:16 +00:00
defacer
756e182362 Enforcing the "email type" (text/HTML) user setting at core library level.
With well-written client code this should not be needed, but after getting
burned once I think it's a good idea to make it "smart".
2005-02-05 01:36:55 +00:00
defacer
246c206420 Fix for bug 2492: Notices thrown by pagelib.php.
It was an oversight on my part. Thanks Gustav!
2005-02-04 20:27:54 +00:00
skodak
01accf3efa PARAM_ALPHA now converts to lowercase; merged from MOODLE_14_STABLE 2005-02-03 22:53:49 +00:00
skodak
60ecca3a09 incorrect use of preg_quote(), add '/' to list of quoted chars - see man page; merged from MOODLE_14_STABLE 2005-02-03 19:37:11 +00:00
skodak
f24148ef0f new parameter cleaning PARAM_BOOL and PARAM_ALPHANUM, merged from MOODLE_14_STABLE 2005-02-03 18:14:45 +00:00
defacer
c1d8705fd2 Change the semantics of blocks_print_adminblock() to make life easier to
developers who use pages. Conversely simplified the code a bit in courses.
2005-02-02 02:41:56 +00:00
defacer
7c6c051326 Utilizing page_id_and_class(), make a factory function page_create_instance()
that does not need the page type as an argument (autodetects from the URL).
2005-02-02 02:32:40 +00:00
defacer
68d5f00ae8 Isolating this in a function because it's quite useful
to access from elsewhere, too.
2005-02-02 02:25:50 +00:00
defacer
1319096389 Adding a useful mathematical shortcut. 2005-02-02 02:22:56 +00:00
mjollnir_
e5cf5750cf Modification for datalib (modify_database) to ignore lines that start with -- as well as # (postgres) 2005-02-01 20:45:46 +00:00
moodler
18b9d66439 Moved theme changing to after SESSION exists 2005-02-01 08:00:58 +00:00
defacer
c6a2a401ed Making the "Add block..." menu list alphabetically sorted ;-) 2005-02-01 07:59:09 +00:00
defacer
8bd3fad303 I need those constants a bit more easily accessible. 2005-02-01 07:39:21 +00:00
defacer
7221d319be Fixing all the details in the block instance configuration screen.
That wasn't so hard!
2005-02-01 07:34:17 +00:00
defacer
cadc69c64c Added a new class page_quiz, modelling the behavior of a quiz view page.
Not everything is quite right now, a few details (e.g. correct breadcrumbs)
have been ignored but most of the functionality is there.

Blocks in quizzes, here we come!
2005-02-01 07:12:39 +00:00
defacer
3edc57e189 Even more automation: now blocks_execute_url_action() checks if the user
has sufficient rights to execute the action automatically. It's therefore
safe to call without ANY checks being done first.
2005-02-01 06:55:02 +00:00
defacer
da71112bed Refining the way that blocks work: now you don't have to know anything
about what editing the blocks adds to your URL. blocklib will take care
of that internally.
2005-02-01 06:24:28 +00:00
mjollnir_
bf60471bc8 Fix for metacourses. Courses with course->metacourse shouldn't be offered in the courses to add dropdown 2005-02-01 04:51:28 +00:00
mjollnir_
8a4e77ae1b Another fix for metacourses (lost auto_increment). This will preserve data. 2005-02-01 04:47:04 +00:00
martinlanghoff
4c3911f934 Merged from MOODLE_14_HEAD - Better behaviour of fix_course_sortorder() -- related to bug #2334 -- includes version bump to clear out recalcitrant sortorders 2005-02-01 01:47:45 +00:00
martinlanghoff
94afadb360 Merged from MOODLE_14_HEAD - Better behaviour of fix_course_sortorder() -- related to bug #2334 2005-02-01 01:37:14 +00:00
mjollnir_
d20f58e7e8 Fixing column_type for postgres (WHERE 0 is not valid so using LIMIT 0 instead) 2005-02-01 00:28:02 +00:00
defacer
7c81cc29b9 Added a new function, column_type(), based on ADOdb's MetaType().
Attempting to make ALTER TABLE for Postgres really smart... this is
the solution to bug 2460 if it works correctly.
2005-01-31 23:24:43 +00:00
julmis
713126cd43 Remove last space from attribute list in cleanAttributes2 function. 2005-01-31 20:09:17 +00:00
stronk7
6bdd02e40b Avoid some probles when returning to the original user after using the loginas feature.
(sesskey not set)
2005-01-31 18:10:50 +00:00
moodler
792a590da7 New libraries to support lexer-based searching. From Tony Hursh - thanks! 2005-01-31 07:39:03 +00:00
moodler
cdf3925518 Messaging can now be completely disabled using $CFG->messaging 2005-01-31 07:11:42 +00:00
moodler
d74d4f2053 Some changes in the way theme setup is achieved, there is now a function
for it called theme_setup
2005-01-31 05:59:13 +00:00
defacer
7542a4e574 Dropping the use of MOODLE_PAGE_COURSE <gasp>!
The new constant is PAGE_COURSE_VIEW, and it's more streamlined with the
new CSS-related ids for 1.5. There are great possibilities for the future
here, so we 're getting ready.

On the other hand, this has to be the ugliest hack I 've ever inflicted
on any program (look at pagelib.php). Thankfully it will only stay for just
a little while.
2005-01-31 02:18:15 +00:00
defacer
fddbcf9c68 Fixing my buggy implementation of isteacherinanycourse().
This fixes bugs 2455, 2456 and maybe some others Eagle Eyes didn't have
the time to find. ;-)
2005-01-31 00:48:23 +00:00
moodler
1e92ee743b A SESSION->theme can be set (only with sesskey) 2005-01-30 19:28:27 +00:00
moodler
c3f5569273 Added support for parent themes
Added support for user, course, session themes
2005-01-30 18:23:06 +00:00