/// from the command line.
define('FULLME', 'cron');
-
+
+
+/// Do not set moodle cookie because we do not need it here, it is better to emulate session
+ $nomoodlecookie = true;
+
/// The current directory in PHP version 4.3.0 and above isn't necessarily the
/// directory of the script when run from the command line. The require_once()
/// would fail, so we'll have to chdir()
require_once(dirname(__FILE__) . '/../config.php');
require_once($CFG->libdir.'/adminlib.php');
+/// extra safety
+ @session_write_close();
+
+/// check if execution allowed
if (isset($_SERVER['REMOTE_ADDR'])) { // if the script is accessed via the web.
if (!empty($CFG->cronclionly)) {
// This script can only be run via the cli.
}
}
- if (!$alreadyadmin = has_capability('moodle/site:config', get_context_instance(CONTEXT_SYSTEM, SITEID))) {
- unset($_SESSION['USER']);
- unset($USER);
- unset($_SESSION['SESSION']);
- unset($SESSION);
- $USER = get_admin(); /// Temporarily, to provide environment for this script
- // we need to override the admin timezone to the moodle timezone!
- $USER->timezone = $CFG->timezone;
- }
- //unset test cookie, user must login again anyway
- setcookie('MoodleSessionTest'.$CFG->sessioncookie, '', time() - 3600, '/');
+/// emulate normal session
+ $SESSION = new object();
+ $USER = get_admin(); /// Temporarily, to provide environment for this script
-/// switch to site language and locale
- if (!empty($CFG->courselang)) {
- unset ($CFG->courselang);
- }
- if (!empty($SESSION->lang)) {
- unset ($SESSION->lang);
- }
+/// ignore admins timezone, language and locale - use site deafult instead!
+ $USER->timezone = $CFG->timezone;
$USER->lang = '';
- moodle_setlocale();
+ $USER->theme = '';
+ course_setup(SITEID);
/// send mime type and encoding
if (check_browser_version('MSIE')) {
@header('Content-Type: text/plain; charset=utf-8');
}
+/// no more headers and buffers
+ while(@ob_end_flush());
+
/// Start output log
$timenow = time();
return false;
}
+/** Deprecated function - returns the code of the current charset - originally depended on the selected language pack.
+ *
+ * @param $ignorecache not used anymore
+ * @return string always returns 'UTF-8'
+ */
+function current_charset($ignorecache = false) {
+ return 'UTF-8';
+}
+
+
/////////////////////////////////////////////////////////////
/// Old functions not used anymore - candidates for removal
/////////////////////////////////////////////////////////////
}
/**
- * Setup all global $CFG course variables, set locale and also
+ * Setup all global $CFG course variables, set locale and also themes
+ * This function can be used on pages that do not require login instead of require_login()
+ *
* @param mixed $courseorid id of the course or course object
*/
function course_setup($courseorid=0) {
- global $COURSE, $HTTPSPAGEREQUIRED, $CFG;
+ global $COURSE, $CFG, $SITE, $USER;
/// Redefine global $COURSE if needed
if (empty($courseorid)) {
$COURSE = clone($courseorid);
} else {
global $course; // used here only to prevent repeated fetching from DB - may be removed later
- if ($course->id == $courseorid) {
+ if (!empty($course->id) and $course->id == SITEID) {
+ $COURSE = clone($SITE);
+ } else if (!empty($course->id) and $course->id == $courseorid) {
$COURSE = clone($course);
} else {
if (!$COURSE = get_record('course', 'id', $courseorid)) {
}
}
-/// set locale - we should use $COURSE->lang directly in the future
-/// $CFG->courselang is now used in cron and chat to override current language and locale
- if ($COURSE->id == SITEID or empty($COURSE->lang)) {
- unset($CFG->courselang);
- } else {
- $CFG->courselang = $COURSE->lang;
- }
+/// set locale and themes
moodle_setlocale();
-
-/// setup themes - $COURSE->theme should be used instead of $CFG->coursetheme soon
- if ($COURSE->id == SITEID or empty($CFG->allowcoursethemes) or empty($COURSE->theme)) {
- unset($CFG->coursetheme);
- } else {
- $CFG->coursetheme = $COURSE->theme;
- }
theme_setup();
-/// We have to change some URLs in styles if we are in a $HTTPSPAGEREQUIRED page
-/// in case theme changed after call to httpsrequired();
- if (!empty($HTTPSPAGEREQUIRED)) {
- $CFG->themewww = str_replace('http:', 'https:', $CFG->themewww);
- $CFG->pixpath = str_replace('http:', 'https:', $CFG->pixpath);
- $CFG->modpixpath = str_replace('http:', 'https:', $CFG->modpixpath);
- foreach ($CFG->stylesheets as $key => $stylesheet) {
- $CFG->stylesheets[$key] = str_replace('http:', 'https:', $stylesheet);
- }
- }
}
/**
* @return string
*/
function current_language() {
- global $CFG, $USER, $SESSION;
+ global $CFG, $USER, $SESSION, $COURSE;
- if (!empty($CFG->courselang)) { // Course language can override all other settings for this page
- $return = $CFG->courselang;
+ if (!empty($OURSE->lang)) { // Course language can override all other settings for this page
+ $return = $OURSE->lang;
} else if (!empty($SESSION->lang)) { // Session language can override other settings
$return = $SESSION->lang;
- } else if (!empty($USER->lang)) { // User language can override site language
+ } else if (!empty($USER->lang)) {
$return = $USER->lang;
} else {
return $return;
}
-/* Obsoleted function - returns the code of the current charset - originally depended on the selected language pack.
- *
- * @param $ignorecache not used anymore
- * @return string always returns 'UTF-8'
- */
-function current_charset($ignorecache = false) {
- return 'UTF-8';
-}
-
/**
* Prints out a translated string.
*
$CFG->httpswwwroot = str_replace('http:', 'https:', $CFG->wwwroot);
$CFG->httpsthemewww = str_replace('http:', 'https:', $CFG->themewww);
- // change theme paths to pictures
- $CFG->themewww = str_replace('http:', 'https:', $CFG->themewww);
- $CFG->pixpath = str_replace('http:', 'https:', $CFG->pixpath);
- $CFG->modpixpath = str_replace('http:', 'https:', $CFG->modpixpath);
- foreach ($CFG->stylesheets as $key => $stylesheet) {
- $CFG->stylesheets[$key] = str_replace('http:', 'https:', $stylesheet);
- }
+ // change theme URLs to https
+ theme_setup();
+
} else {
$CFG->httpswwwroot = $CFG->wwwroot;
$CFG->httpsthemewww = $CFG->themewww;
function report_session_error() {
global $CFG, $FULLME;
- theme_setup(); // Sets up theme global variables
if (empty($CFG->lang)) {
$CFG->lang = "en";
}
+ // Set up default theme and locale
+ theme_setup();
moodle_setlocale();
+
//clear session cookies
setcookie('MoodleSession'.$CFG->sessioncookie, '', time() - 3600, $CFG->sessioncookiepath);
setcookie('MoodleSessionTest'.$CFG->sessioncookie, '', time() - 3600, $CFG->sessioncookiepath);
* @return string
*/
function current_theme() {
- global $CFG, $USER, $SESSION;
+ global $CFG, $USER, $SESSION, $COURSE;
if (!empty($CFG->pagetheme)) { // Page theme is for special page-only themes set by code
return $CFG->pagetheme;
- } else if (!empty($CFG->coursetheme) and !empty($CFG->allowcoursethemes)) { // Course themes override others
- return $CFG->coursetheme;
+ } else if (!empty($CFG->allowcoursethemes) and !empty($COURSE->theme)) { // Course themes override others
+ return $COURSE->theme;
} else if (!empty($SESSION->theme)) { // Session theme can override other settings
return $SESSION->theme;
- } else if (!empty($USER->theme) and !empty($CFG->allowuserthemes)) { // User theme can override site theme
+ } else if (!empty($CFG->allowuserthemes) and !empty($USER->theme)) { // User theme can override site theme
return $USER->theme;
} else {
function theme_setup($theme = '', $params=NULL) {
/// Sets up global variables related to themes
- global $CFG, $THEME, $SESSION, $USER;
+ global $CFG, $THEME, $SESSION, $USER, $HTTPSPAGEREQUIRED;
if (empty($theme)) {
$theme = current_theme();
}
$CFG->stylesheets[] = $CFG->themewww.'/'.$theme.'/styles.php'.$paramstring;
+/// We have to change some URLs in styles if we are in a $HTTPSPAGEREQUIRED page
+ if (!empty($HTTPSPAGEREQUIRED)) {
+ $CFG->themewww = str_replace('http:', 'https:', $CFG->themewww);
+ $CFG->pixpath = str_replace('http:', 'https:', $CFG->pixpath);
+ $CFG->modpixpath = str_replace('http:', 'https:', $CFG->modpixpath);
+ foreach ($CFG->stylesheets as $key => $stylesheet) {
+ $CFG->stylesheets[$key] = str_replace('http:', 'https:', $stylesheet);
+ }
+ }
+
}
static $str;
$info = &$this->sets_info[$sessionid];
- chat_force_language($info['lang']);
+ course_setup($info['course'], $info['user']);
$timenow = time();
$this->sets_info[$sessionid] = array(
'lastinfocommit' => 0,
'lastmessageindex' => 0,
+ 'course' => $course,
'courseid' => $course->id,
'chatuser' => $chatuser,
'chatid' => $chat->id,
{
// Simply give them the message
- chat_force_language($info['lang']);
+ course_setup($info['course'], $info['user']);
$output = chat_format_message_manually($message, $info['courseid'], $sender, $info['user']);
$this->trace('Delivering message "'.$output->text.'" to '.$this->conn_sets[$sessionid][CHAT_CONNECTION_CHANNEL]);
error('Not logged in!');
}
- //Get the course theme
- $COURSE = get_record('course','id',$chatuser->course);
-
//Get the user theme
- $USER = get_record('user','id',$chatuser->userid);
-
- //Adjust the prefered theme (main, course, user)
- theme_setup();
+ $USER = get_record('user', 'id', $chatuser->userid);
- chat_force_language($chatuser->lang);
+ //Setup course, lang and theme
+ course_setup($chatuser->course);
ob_start();
?>
if(waitFlag) return false;
waitFlag = true;
var input_chat_message = document.getElementById('input_chat_message');
- getElementById('sendForm').chat_message.value = input_chat_message.value;
+ document.getElementById('sendForm').chat_message.value = input_chat_message.value;
input_chat_message.value = '';
input_chat_message.className = 'wait';
- getElementById('sendForm').submit();
+ document.getElementById('sendForm').submit();
enableForm();
return false;
}
error('Not logged in!');
}
- //Get the course theme
- $course = get_record('course','id',$chatuser->course,'','','','','id,theme');
- //Set the course theme if necessary
- if (!empty($course->theme)) {
- if (!empty($CFG->allowcoursethemes)) {
- $CFG->coursetheme = $course->theme;
- }
+ //Get the minimal course
+ if (!$course = get_record('course','id',$chatuser->course,'','','','','id,theme,lang')) {
+ error('incorrect course id');
}
//Get the user theme and enough info to be used in chat_format_message() which passes it along to
- // chat_format_message_manually() -- and only id and timezone are used.
- if (!$USER = get_record('user','id',$chatuser->userid,'','','','','id, theme, username, timezone')) {
+ if (!$USER = get_record('user','id',$chatuser->userid,'','','','','id, lang, theme, username, timezone')) {
error('User does not exist!');
}
$USER->description = '';
- //Adjust the prefered theme (main, course, user)
- theme_setup();
-
- chat_force_language($chatuser->lang);
+ //Setup course, lang and theme
+ course_setup($course);
// force deleting of timed out users if there is a silence in room or just entering
if ((time() - $chat_lasttime) > $CFG->chat_old_ping) {
error('Not logged in!');
}
- //Get the course theme
- $course = get_record('course','id',$chatuser->course,'','','','','id,theme');
- //Set the course theme if necessary
- if (!empty($course->theme)) {
- if (!empty($CFG->allowcoursethemes)) {
- $CFG->coursetheme = $course->theme;
- }
+ //Get the minimal course
+ if (!$course = get_record('course','id',$chatuser->course,'','','','','id,theme,lang')) {
+ error('incorrect course id');
}
+
//Get the user theme and enough info to be used in chat_format_message() which passes it along to
// chat_format_message_manually() -- and only id and timezone are used.
- if (!$USER = get_record('user','id',$chatuser->userid,'','','','','id, theme, username, timezone')) {
+ if (!$USER = get_record('user','id',$chatuser->userid,'','','','','id, lang, theme, username, timezone')) {
error('User does not exist!');
}
$USER->description = '';
- //Adjust the prefered theme (main, course, user)
- theme_setup();
-
- chat_force_language($chatuser->lang);
+ //Setup course, lang and theme
+ course_setup($course);
// force deleting of timed out users if there is a silence in room or just entering
if ((time() - $chat_lasttime) > $CFG->chat_old_ping) {
error('Not logged in!');
}
- //Get the course theme
- $course = get_record('course','id',$chatuser->course,'','','','','id,theme');
- //Set the course theme if necessary
- if (!empty($course->theme)) {
- if (!empty($CFG->allowcoursethemes)) {
- $CFG->coursetheme = $course->theme;
- }
+ //Get the minimal course
+ if (!$course = get_record('course','id',$chatuser->course,'','','','','id,theme,lang')) {
+ error('incorrect course id');
}
- //Get the user theme
- $USER = get_record('user','id',$chatuser->userid,'','','','','id, theme');
- //Adjust the prefered theme (main, course, user)
- theme_setup();
+ //Get the user theme and enough info to be used in chat_format_message() which passes it along to
+ if (!$USER = get_record('user','id',$chatuser->userid,'','','','','id, lang, theme, username, timezone')) {
+ error('User does not exist!');
+ }
+ $USER->description = '';
- chat_force_language($chatuser->lang);
+ //Setup course, lang and theme
+ course_setup($course);
$courseid = $chatuser->course;
error('Not logged in!');
}
- chat_force_language($chatuser->lang);
+ //Get the user theme
+ $USER = get_record('user', 'id', $chatuser->userid);
+
+ //Setup course, lang and theme
+ course_setup($chatuser->course);
ob_start();
?>
return true;
}
-function chat_force_language($lang) {
-/// This function prepares moodle to operate in given language
-/// usable when $nomoodlecookie = true;
-/// BEWARE: there must be no $course, $USER or $SESSION
- global $CFG;
-
- if(!empty($CFG->courselang)) {
- unset($CFG->courselang);
- }
- $CFG->lang = $lang;
- moodle_setlocale();
-}
//////////////////////////////////////////////////////////////////////
/// Functions that require some SQL
$strforums = get_string('forums', 'forum');
}
- if (!empty($USER->id)) { // Remember real USER account if necessary
- $realuser = $USER;
- }
+ $realuser = clone($USER);
/// Posts older than 2 days will not be mailed. This is to avoid the problem where
/// cron has not been running for a long time, and then suddenly people are flooded
);
- if (!empty($course->lang)) {
- $CFG->courselang = $course->lang;
- } else {
- unset($CFG->courselang);
- }
-
// Get coursemodule record (and cache these)
if (!empty($cachecm[$forum->id])) {
/// Override the language and timezone of the "current" user, so that
/// mail is customised for the receiver.
- $USER->lang = $userto->lang;
- $USER->timezone = $userto->timezone;
+ $USER = $userto;
+ course_setup($course);
$postsubject = "$course->shortname: ".format_string($post->subject,true);
$posttext = forum_make_mail_text($course, $forum, $discussion, $post, $userfrom, $userto);
}
}
- unset($CFG->courselang);
-
- if (!empty($realuser)) { // Restore real USER timezone if necessary
- $sitetimezone = $realuser->timezone;
- $USER->lang = $realuser->lang;
- } else {
- $sitetimezone = $CFG->timezone;
- $USER->lang = $CFG->lang;
- }
+ $sitetimezone = $CFG->timezone;
/// Now see if there are any digest mails waiting to be sent, and if we should send them
/// Override the language and timezone of the "current" user, so that
/// mail is customised for the receiver.
- $USER->lang = $userto->lang;
- $USER->timezone = $userto->timezone;
+ $USER = $userto;
+ course_setup(SITEID);
$postsubject = get_string('digestmailsubject', 'forum', $site->shortname);
continue;
}
+ //override language
+ course_setup($course);
+
$canunsubscribe = ! forum_is_forcesubscribed($forum->id);
$canreply = forum_user_can_post($forum, $userto);
mtrace(get_string('digestsentusers', 'forum', $usermailcount));
}
- if (!empty($realuser)) { // Restore real USER if necessary
- $USER = $realuser;
- }
+ $USER = $realuser;
+ course_setup(SITEID); // reset cron user language, theme and timezone settings
if (!empty($CFG->forum_lastreadclean)) {
$timenow = time();
$results = get_course_users($course->id); // Otherwise get everyone in the course
} else {
$results = get_records_sql("SELECT u.id, u.username, u.firstname, u.lastname, u.maildisplay, u.mailformat, u.maildigest, u.emailstop,
- u.email, u.city, u.country, u.lastaccess, u.lastlogin, u.picture, u.timezone, u.lang, u.trackforums
+ u.email, u.city, u.country, u.lastaccess, u.lastlogin, u.picture, u.timezone, u.theme, u.lang, u.trackforums
FROM {$CFG->prefix}user u,
{$CFG->prefix}forum_subscriptions s $grouptables
WHERE s.forum = '$forum->id'
/*
ErfurtWiki - an embedable, fast and user-friendly wiki engine
- ¯¯¯¯¯¯¯¯¯¯
+ ����������
This is Public Domain (no license, no warranty); but feel free
to redistribute it under GPL or anything else you like.
http://erfurtwiki.sourceforge.net/
- Mario Salzer <mario*erphesfurt·de> and many others(tm)
+ Mario Salzer <mario*erphesfurt�de> and many others(tm)
Use it from inside yoursite.php like that:
define("EWIKI_UP_UPLOAD", "upload");
#- other stuff
define("EWIKI_DEFAULT_LANG", "en");
- define("EWIKI_CHARSET", current_charset());
+ define("EWIKI_CHARSET", "UTF-8");
#- user permissions
define("EWIKI_PROTECTED_MODE", 0); # disable funcs + require auth
define("EWIKI_PROTECTED_MODE_HIDING", 0); # hides disallowed actions
else {
#### END MOODLE CHANGES
- define("EWIKI_CHARS_L", "a-z_µ¤$\337-\377");
+ define("EWIKI_CHARS_L", "a-z_��$\337-\377");
define("EWIKI_CHARS_U", "A-Z0-9\300-\336");
#### BEGIN MOODLE CHANGES
#<off># "###" => array("<big><b>", "</b></big>"),
"**" => array("<b>", "</b>"),
"##" => array("<big>", "</big>"),
- "µµ" => array("<small>", "</small>"),
+ "��" => array("<small>", "</small>"),
),
"wm_start_end" => array(
),
));
#
$ewiki_t["es"] = @array_merge(@$ewiki_t["es"], array(
- "EDITTHISPAGE" => "EditarEstaPágina",
+ "EDITTHISPAGE" => "EditarEstaP�gina",
"BACKLINKS" => "EnlacesInversos",
- "PAGESLINKINGTO" => "Páginas enlazando \$title",
- "PAGEHISTORY" => "InfoPágina",
- "INFOABOUTPAGE" => "Información sobre la página",
- "LIKEPAGES" => "Páginas como esta",
- "NEWESTPAGES" => "Páginas más nuevas",
- "LASTCHANGED" => "última modificación %d/%m/%Y a las %H:%M",
- "DOESNOTEXIST" => "Esta página aún no existe, por favor eliga EditarEstaPágina si desea crearla.",
- "DISABLEDPAGE" => "Esta página no está disponible en este momento.",
- "ERRVERSIONSAVE" => "Disculpe, mientras editaba esta página alguién más
- salvó una versión modificada. Por favor regrese a
+ "PAGESLINKINGTO" => "P�ginas enlazando \$title",
+ "PAGEHISTORY" => "InfoP�gina",
+ "INFOABOUTPAGE" => "Informaci�n sobre la p�gina",
+ "LIKEPAGES" => "P�ginas como esta",
+ "NEWESTPAGES" => "P�ginas m�s nuevas",
+ "LASTCHANGED" => "�ltima modificaci�n %d/%m/%Y a las %H:%M",
+ "DOESNOTEXIST" => "Esta p�gina a�n no existe, por favor eliga EditarEstaP�gina si desea crearla.",
+ "DISABLEDPAGE" => "Esta p�gina no est� disponible en este momento.",
+ "ERRVERSIONSAVE" => "Disculpe, mientras editaba esta p�gina algui�n m�s
+ salv� una versi�n modificada. Por favor regrese a
a la pantalla anterior y copie sus cambios a su computador
- para insertalos nuevamente después de que cargue
- la pantalla de edición.",
- "ERRORSAVING" => "Ocurrió un error mientras se salvavan sus cambios. Por favor intente de nuevo.",
- "THANKSFORCONTRIBUTION" => "Gracias por su contribución!",
- "CANNOTCHANGEPAGE" => "Esta página no puede ser modificada.",
- "OLDVERCOMEBACK" => "Hacer que esta versión antigua regrese a remplazar la actual",
+ para insertalos nuevamente despu�s de que cargue
+ la pantalla de edici�n.",
+ "ERRORSAVING" => "Ocurri� un error mientras se salvavan sus cambios. Por favor intente de nuevo.",
+ "THANKSFORCONTRIBUTION" => "Gracias por su contribuci�n!",
+ "CANNOTCHANGEPAGE" => "Esta p�gina no puede ser modificada.",
+ "OLDVERCOMEBACK" => "Hacer que esta versi�n antigua regrese a remplazar la actual",
"PREVIEW" => "Previsualizar",
"SAVE" => "Salvar",
- "CANCEL_EDIT" => "CancelarEdición",
- "UPLOAD_PICTURE_BUTTON" => "subir gráfica >>>",
+ "CANCEL_EDIT" => "CancelarEdici�n",
+ "UPLOAD_PICTURE_BUTTON" => "subir gr�fica >>>",
"EDIT_FORM_1" => "<a href=\"".EWIKI_SCRIPT."BuenEstilo\">BuenEstilo</a> es
escribir lo que viene a su mente. No se preocupe mucho
- por la apariencia. También puede agregar <a href=\"".EWIKI_SCRIPT."ReglasDeMarcadoWiki\">ReglasDeMarcadoWiki</a>
- más adelante si piensa que es necesario.<br />",
+ por la apariencia. Tambi�n puede agregar <a href=\"".EWIKI_SCRIPT."ReglasDeMarcadoWiki\">ReglasDeMarcadoWiki</a>
+ m�s adelante si piensa que es necesario.<br />",
"EDIT_FORM_2" => "<br />Por favor no escriba cosas, que puedan
enfadar a otras personas. Y por favor tenga en mente que
- usted no es del todo anónimo en Internet
- (encuentre más sobre
+ usted no es del todo an�nimo en Internet
+ (encuentre m�s sobre
'<a href=\"http://google.com/search?q=my+computers+IP+address\">IP address</a>' de su computador con Google).",
- "BIN_IMGTOOLARGE" => "¡La gráfica es demasiado grande!",
- "BIN_NOIMG" => "¡No es un archivo con una gráfica (formato de archivo inaceptable)!",
- "FORBIDDEN" => "No está autorizado para acceder a esta página.",
+ "BIN_IMGTOOLARGE" => "�La gr�fica es demasiado grande!",
+ "BIN_NOIMG" => "�No es un archivo con una gr�fica (formato de archivo inaceptable)!",
+ "FORBIDDEN" => "No est� autorizado para acceder a esta p�gina.",
));
#
$ewiki_t["de"] = @array_merge(@$ewiki_t["de"], array(
- "EDITTHISPAGE" => "DieseSeiteÄndern",
- "APPENDTOPAGE" => "Ergänze",
- "BACKLINKS" => "ZurückLinks",
+ "EDITTHISPAGE" => "DieseSeite�ndern",
+ "APPENDTOPAGE" => "Erg�nze",
+ "BACKLINKS" => "Zur�ckLinks",
"PAGESLINKINGTO" => "Verweise zur Seite \$title",
"PAGEHISTORY" => "SeitenInfo",
- "INFOABOUTPAGE" => "Informationen über Seite",
- "LIKEPAGES" => "Ähnliche Seiten",
+ "INFOABOUTPAGE" => "Informationen �ber Seite",
+ "LIKEPAGES" => "�hnliche Seiten",
"NEWESTPAGES" => "Neueste Seiten",
- "LASTCHANGED" => "zuletzt geändert am %d.%m.%Y um %H:%M",
+ "LASTCHANGED" => "zuletzt ge�ndert am %d.%m.%Y um %H:%M",
"DISABLEDPAGE" => "Diese Seite kann momentan nicht angezeigt werden.",
- "ERRVERSIONSAVE" => "Entschuldige, aber während Du an der Seite
- gearbeitet hast, hat bereits jemand anders eine geänderte
+ "ERRVERSIONSAVE" => "Entschuldige, aber w�hrend Du an der Seite
+ gearbeitet hast, hat bereits jemand anders eine ge�nderte
Fassung gespeichert. Damit nichts verloren geht, browse bitte
- zurück und speichere Deine Änderungen in der Zwischenablage
+ zur�ck und speichere Deine �nderungen in der Zwischenablage
(Bearbeiten->Kopieren) um sie dann wieder an der richtigen
- Stelle einzufügen, nachdem du die EditBoxSeite nocheinmal
+ Stelle einzuf�gen, nachdem du die EditBoxSeite nocheinmal
geladen hast.<br />
- Vielen Dank für Deine Mühe.",
+ Vielen Dank f�r Deine M�he.",
"ERRORSAVING" => "Beim Abspeichern ist ein Fehler aufgetreten. Bitte versuche es erneut.",
- "THANKSFORCONTRIBUTION" => "Vielen Dank für Deinen Beitrag!",
- "CANNOTCHANGEPAGE" => "Diese Seite kann nicht geändert werden.",
+ "THANKSFORCONTRIBUTION" => "Vielen Dank f�r Deinen Beitrag!",
+ "CANNOTCHANGEPAGE" => "Diese Seite kann nicht ge�ndert werden.",
"OLDVERCOMEBACK" => "Diese alte Version der Seite wieder zur Aktuellen machen",
"PREVIEW" => "Vorschau",
"SAVE" => "Speichern",
- "CANCEL_EDIT" => "ÄnderungenVerwerfen",
+ "CANCEL_EDIT" => "�nderungenVerwerfen",
"UPLOAD_PICTURE_BUTTON" => "Bild hochladen >>>",
"EDIT_FORM_1" => "<a href=\"".EWIKI_SCRIPT."GuterStil\">GuterStil</a> ist es,
ganz einfach das zu schreiben, was einem gerade in den
Sinn kommt. Du solltest dich jetzt noch nicht so sehr
- darum kümmern, wie die Seite aussieht. Du kannst später
- immernoch zurückkommen und den Text mit <a href=\"".EWIKI_SCRIPT."FormatierungsRegeln\">WikiTextFormatierungsRegeln</a>
+ darum k�mmern, wie die Seite aussieht. Du kannst sp�ter
+ immernoch zur�ckkommen und den Text mit <a href=\"".EWIKI_SCRIPT."FormatierungsRegeln\">WikiTextFormatierungsRegeln</a>
aufputschen.<br />",
"EDIT_FORM_2" => "<br />Bitte schreib keine Dinge, die andere Leute
- verärgern könnten. Und bedenke auch, daß es schnell auf
- dich zurückfallen kann wenn du verschiedene andere Dinge sagst (mehr Informationen zur
+ ver�rgern k�nnten. Und bedenke auch, da� es schnell auf
+ dich zur�ckfallen kann wenn du verschiedene andere Dinge sagst (mehr Informationen zur
'<a href=\"http://google.de/search?q=computer+IP+adresse\">IP Adresse</a>'
deines Computers findest du bei Google).",
));
#-- encloses whole page output with a descriptive <div>
function ewiki_page_css_container(&$o, &$id, &$data, &$action) {
$o = "<div class=\"wiki $action "
- . strtr($id, ' ./ --_!"§$%&()=?²³{[]}`+#*;:,<>| @µöäüÖÄÜߤ^°«»\'\\',
+ . strtr($id, ' ./ --_!"�$%&()=?��{[]}`+#*;:,<>| @�������ߤ^���\'\\',
'- -----------------------------------------------')
. "\">\n"
. $o . "\n</div>\n";
function ewiki_format_comment(&$str, &$in, &$iii, &$s, $btype) {
- $str = "<!-- " . str_replace("--", "¯¯", $str) . " -->";
+ $str = "<!-- " . str_replace("--", "��", $str) . " -->";
}
<?php
-if (isset($THEME->chameleonenabled) && $THEME->chameleonenabled) {
+if (!empty($THEME->chameleonenabled)) {
$chameleon_isadmin = has_capability('moodle/site:config', get_context_instance(CONTEXT_SYSTEM, SITEID));
$chameleon_isteacher = false;
- if (isset($course->id)) {
- $chameleon_courseparam = '?id=' . $course->id;
- if (!$chameleon_isadmin) {
- $chameleon_isteacher = (has_capability('moodle/course:update', get_context_instance(CONTEXT_COURSE, $course->id)) && isset($CFG->coursetheme));
- }
- } else {
+ if ($COURSE->id == SITEID) {
$chameleon_courseparam = '';
+ } else {
+ $chameleon_courseparam = '?id=' . $COURSE->id;
+ $chameleon_isteacher = !empty($COURSE->theme) and has_capability('moodle/course:update', get_context_instance(CONTEXT_COURSE, $COURSE->id));
}
- if ($chameleon_isadmin || ($chameleon_isteacher && !empty($CFG->allowcoursethemes) && !empty($THEME->chameleonteachereditenabled))) {
+ if ($chameleon_isadmin or ($chameleon_isteacher and !empty($CFG->allowcoursethemes) and !empty($THEME->chameleonteachereditenabled))) {
// either we're an admin or we're a teacher and this is being used as the course theme
// if we're on a page using a course theme edit that, otherwise edit the main chameleon theme
// $chameleon_theme = (isset($CFG->coursetheme)) ? $CFG->coursetheme : $CFG->theme;
- $chameleon_theme = (isset($CFG->coursetheme)) ? $CFG->coursetheme : current_theme();
+ $chameleon_theme = current_theme();
?>
<style type="text/css"> @import '<?php echo "$CFG->themewww/$chameleon_theme" ?>/ui/chameleon_ui.css'; </style>
die('CHAMELEON_ERROR Editing this theme has been disabled');
}
+$id = optional_param('id', SITEID, PARAM_INT);
+if (!$course = get_record('course', 'id', $id)) {
+ error('Incorrect course id');
+}
+
+course_setup($course); // we should not require login here
-$chameleon_id = isset($_GET['id']) ? (int) $_GET['id'] : 0;
-if ($chameleon_id != 0 && !empty($CFG->allowcoursethemes) && !empty($THEME->chameleonteachereditenabled)) {
- if (!has_capability('moodle/course:update', get_context_instance(CONTEXT_COURSE, $chameleon_id))) {
+if ($id != SITEID and !empty($CFG->allowcoursethemes) and !empty($course->theme) and !empty($THEME->chameleonteachereditenabled)) {
+ if (!has_capability('moodle/course:update', get_context_instance(CONTEXT_COURSE, $id))) {
die('CHAMELEON_ERROR Either you are not logged in or you are not allowed to edit this theme');
}
} else if (!has_capability('moodle/site:config', get_context_instance(CONTEXT_SYSTEM, SITEID))) {
if (!empty($CFG->sitemailcharset)) {
$choices['0'] = get_string('site').' ('.$CFG->sitemailcharset.')';
} else {
- $choices['0'] = get_string('site').' ('.current_charset().')';
+ $choices['0'] = get_string('site').' (UTF-8)';
}
$choices = array_merge($choices, $charsets);
$mform->addElement('select', 'preference_mailcharset', get_string('emailcharset'), $choices);