Compare commits

..

117 Commits

Author SHA1 Message Date
moodler b19909d9ae Bump to 1.8.2 release 2007-07-08 14:32:41 +00:00
Martin Langhoff 9084681497 cvsimport fixups 2007-07-07 14:09:13 +12:00
stronk7 305726a6a2 Small upgrade to fix some guest->mnethostid. MDL-10375 2007-07-06 17:43:33 +00:00
stronk7 62f3bee984 Use the new, central, create_guest_record() function. MDL-10375 2007-07-06 17:39:55 +00:00
stronk7 0183e41239 Adding new, central, create_guest_record() function. MDL-10375 2007-07-06 17:37:43 +00:00
poltawski 3b5d49f20c MDL-10311 - further groups import fixes 2007-07-06 16:28:43 +00:00
poltawski bdf5dce110 MDL-10311 Group import broken - missing lang strings & slight helpfile update 2007-07-06 15:30:43 +00:00
poltawski c278e8bc8f MDL-10311 Group import broken - groups import hadn't been updated for new groups,
also missing lang strings
2007-07-06 15:26:35 +00:00
moodler ed200fd420 New CAS module from Jérôme Gutierrez MDL-10366 2007-07-06 10:18:10 +00:00
urs_hunkler 44a718e930 In HTML resources the container box collapsed, when floats are used for content. Solved by adding "clearfix" to the classes. 2007-07-06 08:38:42 +00:00
moodler 5e4098df22 Automatic installer.php lang files by installer_builder (20070706) 2007-07-06 04:53:17 +00:00
skodak 300ade82c4 MDL-10355 fixed typo; backported from HEAD 2007-07-05 20:51:13 +00:00
moodler 275b342ce2 Automatic installer.php lang files by installer_builder (20070705) 2007-07-05 05:54:28 +00:00
skodak 84d7815107 MDL-10341 fixed user search cleaning 2007-07-04 08:30:53 +00:00
urs_hunkler cd1aa3bb76 working on MDL-10322 :: tabs. I added a space before the closing </li> to close the gap between the li elements used without images. I don't know why this space is necessary. 2007-07-03 20:14:20 +00:00
bobopinna 4b70ac02cd Fixed help title 2007-07-03 12:14:52 +00:00
bobopinna 2ad92ce59b Added a missing string 2007-07-03 12:09:39 +00:00
bobopinna bdf0b64635 Added missing help files 2007-07-03 12:06:39 +00:00
bobopinna fba486beb4 file whatgrade.html was added on branch MOODLE_18_STABLE on 2007-07-03 12:06:43 +0000 2007-07-03 12:04:18 +00:00
bobopinna 40bb4f3941 file stagesize.html was added on branch MOODLE_18_STABLE on 2007-07-03 12:06:43 +0000 2007-07-03 12:04:18 +00:00
bobopinna f5084fcf1f file skipview.html was added on branch MOODLE_18_STABLE on 2007-07-03 12:06:41 +0000 2007-07-03 12:04:18 +00:00
bobopinna 75f97e398e file maxattempt.html was added on branch MOODLE_18_STABLE on 2007-07-03 12:06:40 +0000 2007-07-03 12:04:18 +00:00
bobopinna 450eb77b78 file hidebrowse.html was added on branch MOODLE_18_STABLE on 2007-07-03 12:06:39 +0000 2007-07-03 12:04:17 +00:00
bobopinna 4caf41a177 Added a missing string 2007-07-03 10:28:30 +00:00
bobopinna d9a1a6f021 Fixed a bad definited string 2007-07-03 10:27:30 +00:00
bobopinna 880ae97916 Added activation string
fixed bug MDL-9570
2007-07-03 09:43:57 +00:00
bobopinna d10fd935b9 Readded Exit link now called "Exit Activity" 2007-07-03 09:36:31 +00:00
bobopinna d205581b9e Fixed bug MDL-9236 2007-07-03 09:27:42 +00:00
bobopinna e3c424e08c Fixed bug MDL-9776 2007-07-03 09:17:39 +00:00
bobopinna fa21044e08 Fixed bug MDL-10318 on db/update.php 2007-07-03 07:55:33 +00:00
bobopinna 5b696e30cc Fixed bug MDL-10318 2007-07-03 07:54:32 +00:00
stronk7 5c03a7d201 File no longer used. It's under formslib control since
Moodle 1.8. Thanks James! MDL-10036
2007-07-02 17:10:47 +00:00
stronk7 55c59f5050 XHTML conmpliance 2007-07-02 17:02:06 +00:00
stronk7 c9c54db3d8 Using the new "choose" parameter to navigate/preview/choose
IMS-CP resource packages. MDL-10036
2007-07-02 16:56:31 +00:00
stronk7 826b485ce1 Using the new choosecoursefileorimsrepo form element. MDL-10036 2007-07-02 16:53:26 +00:00
stronk7 bbbba10d73 Registering the choosecoursefileorimsrepo form element to
show the "Browse Repository" button
for IMS-CP resources type. (MDL-10036)
2007-07-02 16:50:47 +00:00
stronk7 493ac92129 Adding the choosecoursefileorimsrepo form element to
show the "Browse Repository" button
for IMS-CP resources type. (MDL-10036)
2007-07-02 16:48:32 +00:00
moodler 084712eadc Automatic installer.php lang files by installer_builder (20070702) 2007-07-02 04:56:52 +00:00
skodak 22f3e58605 MDL-9599 Glossary terms revert back to 'Not categorized' when using categories, patch by Alexander Pavlyutin 2007-07-01 15:47:46 +00:00
skodak dc6ef09c49 MDL-10309 Broken password expiration support for LDAP user types rfc2307 and rfc2307bis, patch by Iñaki Arenaza 2007-07-01 15:41:24 +00:00
thepurpleblob 3f9156bf56 MDL-10240:
Added Bb Short Response as a Moodle Essay type question.
Found quite a lot of stuff that could do to be checked and improved
in this code, so this should be considered an intermediate step.
2007-06-29 14:31:08 +00:00
moodler 52dce7612b Automatic installer.php lang files by installer_builder (20070629) 2007-06-29 04:59:49 +00:00
mchurch 552ae418de Bug MDL-8520. Adding target= to the logs buttons. 2007-06-28 18:15:13 +00:00
mchurch 4db3f36034 Bug MDL-8520. Adding target= to the prev/next buttons. 2007-06-28 18:07:09 +00:00
thepurpleblob 9259bf1c0e MDL-10234
Encoded images in subdirectories failed to load.
Thanks to Enrique Castro for fix.
2007-06-28 15:13:52 +00:00
moodler 9407c07c61 Automatic installer.php lang files by installer_builder (20070628) 2007-06-28 05:37:12 +00:00
toyomoyo 0b6c589f21 fix for MDL-10273, users with no capability sould not see New Event button 2007-06-28 03:58:39 +00:00
skodak 9da6b30269 MDL-10276 Text cleaning trouble; backported from HEAD 2007-06-27 12:00:26 +00:00
poltawski 5046d2353b MDL-10264 - fixed typo 2007-06-26 21:16:10 +00:00
gbateson 81f99d24f7 make sure $hotpot->id is set when adding calendar events for new HotPot 2007-06-26 12:04:00 +00:00
tjhunt a80094eff3 Error getting the context in old gradebook. Merged from OU moodle. 2007-06-26 11:50:19 +00:00
moodler f4921fb310 Implemented fix for MDL-10254, thanks Valery! 2007-06-26 09:07:56 +00:00
toyomoyo 6c709360f5 applying supplied patch to MDL-9051, missing $CFG->forum_enabletimedposts 2007-06-26 08:30:49 +00:00
moodler 8969caa059 Automatic installer.php lang files by installer_builder (20070626) 2007-06-26 07:56:55 +00:00
gbateson 226c671af7 in XML source files of HP quizzes, convert relative URLs to absolute URLs in links using window.open(...) 2007-06-26 05:03:38 +00:00
gbateson ca8c7dbc52 ange relative URLs to absolute URLs in window.open(...) 2007-06-26 02:45:40 +00:00
mchurch 1239139dd3 Fixing update_group_button and update_groups_button. They were no longer calling valid URL's. 2007-06-25 20:43:36 +00:00
mchurch fc1bdd6e88 Fixing update_group_button and update_groups_button. They were no longer calling valid URL's. 2007-06-25 20:33:52 +00:00
tjhunt b207f15ca2 Clean up whitespace. 2007-06-25 17:13:17 +00:00
urs_hunkler 9dd4a457c8 changed navmenuwidth to the standard value 2007-06-25 12:19:56 +00:00
moodler ea86a3aa8d Patch for JS problem in MDL-10027 (Chris Holmes did it) 2007-06-25 09:20:55 +00:00
moodler e33fc5a3ee Automatic installer.php lang files by installer_builder (20070625) 2007-06-25 06:49:18 +00:00
tjhunt 1cbf76c5fb MDL-10237 - Improve wording on true/false edit form. 2007-06-24 11:52:52 +00:00
urs_hunkler 06d11b581a Add an option $CFG->CSSEdit or $THEME->CSSEdit to Moodle. If one of both is set to true, Moodle does not write all CSS code in one single CSS file but adds CSS @include to the theme CSS file to load all single CSS files. These single CSS files can then be interactively edited and saved with CSSEdit. It's like Firebug with direct saving your changes. 2007-06-23 12:20:19 +00:00
moodler c519c19ab8 Automatic installer.php lang files by installer_builder (20070623) 2007-06-23 06:01:45 +00:00
tjhunt 357d918295 MDL-10213 - layuout problem for question in IE in Moodle 1.7. I'm taking the opportunity to clean up the CSS in 1.8 and HEAD to match what I did in 1.7. 2007-06-22 13:45:24 +00:00
jamiesensei 173e8c5dfb making environment colours css selector refer to table class instead of body id. So that colours show up on other pages besides admin page. 2007-06-22 11:06:21 +00:00
moodler 50e7e04949 Some fixups for the SCORM update page (missing strings etc) 2007-06-22 05:45:18 +00:00
tjhunt e1e9407acb MDL-7772 - improve the SQL for showing users without attemtps. 2007-06-21 16:14:32 +00:00
bobopinna 3f7cc1f861 Fixed a bad id definition for toc sublists 2007-06-20 09:23:22 +00:00
moodler 6a51d6a786 Automatic installer.php lang files by installer_builder (20070620) 2007-06-20 09:01:24 +00:00
bobopinna 8c36f3b9a9 Fixed a problem with utf8 bug MDL-10101 2007-06-20 08:53:00 +00:00
jamiesensei 2da68b0b32 added styles to install.php for colours for environment table 2007-06-20 06:37:01 +00:00
stronk7 55005a51ce Now calendar export have some correct defaults. MDL-10175 2007-06-19 17:53:14 +00:00
skodak c92d8dd677 (MDL-10155) detect failed regexes duing multilang upgrade (it was causing data loss on some sites); backported from HEAD 2007-06-19 17:26:45 +00:00
tjhunt e1e7d03480 Notices from T/F question is you submit without answering in adaptive mode. Merged from OU Moodle. 2007-06-19 16:35:58 +00:00
tjhunt 7ee50b87b8 XHTML Strict. 2007-06-19 16:32:54 +00:00
jamiesensei 687ce1c4e0 MDL-10168 improvements to display of results from environment checks 2007-06-19 16:32:07 +00:00
jamiesensei 3db1ddedd3 elaborated phpdoc comment slightly for doc_link 2007-06-19 15:17:14 +00:00
jamiesensei fc2df8c889 refactored page_doc_link into two functions. doc_link returns a link to docs. page_doc_link returns the link for this page. 2007-06-19 15:05:17 +00:00
toyomoyo 60a66a2bef fix for MDL-10122, accessibility for course search box 2007-06-19 03:20:42 +00:00
poltawski f7d555d577 MDL-10144 - Fix weak include not changed in STABLE 2007-06-18 19:37:28 +00:00
poltawski 974762e6f5 MDL-10148 - hard coded lang strings in user/message.html 2007-06-18 19:19:51 +00:00
bobopinna ab5642fe19 Fixed a typo added during last commit ;-) 2007-06-18 11:53:21 +00:00
andreabix b1b45674dd Fixed MDL-10100 2007-06-18 11:26:50 +00:00
thepurpleblob dee89d7ecc Missing a CVS Id tag 2007-06-18 10:27:08 +00:00
moodler 32caf9d6d9 Patch from Samuli Karevaara, thanks! 2007-06-18 06:34:13 +00:00
bobopinna 91c6c3dc85 Added some missing strings 2007-06-17 05:33:46 +00:00
mudrd8mz 331ecbe5b6 Undoing last three commits - I did not realized they should go into the HEAD and not into the STABLE :-( I am sorry...
I rolled back using
cvs update -j 1.88.2.8 -j 1.88.2.5 lang.php
2007-06-17 01:38:32 +00:00
mudrd8mz 46a4dde38c "Number of missing strings" or "No missing strings" displayed in the missing mode. Fixes MDL-7029 2007-06-17 01:21:16 +00:00
mudrd8mz 9b7d5f1aa8 Started to work on GUI improvements. Menu tabs introduced. Heading to fix MDL-8012 2007-06-17 00:41:22 +00:00
mudrd8mz 706ea2faf3 To choose a file to edit, popup_form() is used now. It saves some space on the screen. 2007-06-16 22:25:09 +00:00
ethem f8128f42a9 MDL-9836
Authorize.net / SSL Config Bug prevents display of options from enrol/authorize/enrol.php
2007-06-15 17:45:28 +00:00
andreabix 234e96d185 Fixed MDL-10073 2007-06-15 13:23:06 +00:00
csantossaenz 01b1fab671 Fixed bug MDL-7516 2007-06-15 09:09:36 +00:00
moodler 61d29b99d8 Skipping these may help some sites 2007-06-15 06:08:02 +00:00
moodler 8054e9aaad Push beyond 1.8.1 now 2007-06-15 04:19:22 +00:00
tjhunt ee4848432c XHTML strict! 2007-06-14 10:58:23 +00:00
tjhunt d3d4f4936e Whitespace cleanup in workshop help files. 2007-06-14 10:58:12 +00:00
toyomoyo d799be5424 backporting changes in HEAD to fix MDL-10093, administrator or course-creator assigned at course cat level can not restore new courses 2007-06-14 08:51:55 +00:00
urs_hunkler f24e0da312 MDL-9745 - added the fix for input field alignment to 1.8 too. 2007-06-14 07:08:58 +00:00
toyomoyo a8fbb9b4cd fix for MDL-10112 bulk messaging fails silently when messaging not enabled 2007-06-14 04:40:14 +00:00
stronk7 cfc673c112 Now the tokeniser is using the new textlib->entities_to_utf8()
own function (PHP4 and PHP compatible)
2007-06-13 23:21:36 +00:00
stronk7 6dfe1cc67c Added entities_to_utf8() function to textlib, suitable to convert
any entity (numerical and html) to utf-8, providing a PHP4 and PH5
way to do the work.
Also, added the code2utf8() function to convert Unicode code numbers
to UTF-8 chars.
2007-06-13 19:39:53 +00:00
tjhunt e796e306f8 Fix lang file sorting. 2007-06-13 16:39:53 +00:00
pichetp a7adb64678 Removing question/type/datasetdependent/categorydatasetdefinitions.php MDL-10072 2007-06-13 07:51:08 +00:00
toyomoyo bfd12c4dd5 fixing a bug related to setting the granular flag in restore 2007-06-13 06:33:18 +00:00
pichetp 8eede3f475 removing temporary debug print_r 2007-06-13 03:15:58 +00:00
pichetp 9267fe2f43 solving lost of dataitems MDL-10087 2007-06-13 03:11:14 +00:00
stronk7 1c09e6fe0c First cut of the tokeniser library. Modified from drupal search.module
code (see copyrights). The library converts any text/html into an array
of tokens with their score (weight). Supports stop_words, cjk basic
tokeniser (for indexers) and different modes of handling numbers.
2007-06-12 18:15:05 +00:00
pichetp 62fc4a966f set correctly default value for tolerencetype for answers 2007-06-12 15:50:24 +00:00
tjhunt 7ba648a011 Fix typo spotted by Eclipse. 2007-06-12 13:47:14 +00:00
tjhunt 19798dc28d Improve doc comments on get_context_* funcitions. 2007-06-12 11:11:34 +00:00
moodler 08f5787e35 Undoing MDL-9041 2007-06-12 07:05:30 +00:00
dwoolhead 5b99950ef1 Move Export calendar button to bottom of the page (IE especially) 2007-06-11 15:55:48 +00:00
pichetp 21cd4715de adding equation display in calculated question text(MDL-10070) and answers text length
greater.
2007-06-11 08:05:49 +00:00
moodler 9a9446e5b4 Automatic installer.php lang files by installer_builder (20070611) 2007-06-11 06:16:18 +00:00
120 changed files with 7867 additions and 7115 deletions
+1 -13
View File
@@ -488,19 +488,7 @@
/// Check if the guest user exists. If not, create one.
if (! record_exists("user", "username", "guest")) {
$guest->auth = "manual";
$guest->username = "guest";
$guest->password = md5("guest");
$guest->firstname = addslashes(get_string("guestuser"));
$guest->lastname = " ";
$guest->email = "root@localhost";
$guest->description = addslashes(get_string("guestuserinfo"));
$guest->mnethostid = $CFG->mnet_localhost_id;
$guest->confirmed = 1;
$guest->lang = $CFG->lang;
$guest->timemodified= time();
if (! $guest->id = insert_record("user", $guest)) {
if (! $guest = create_guest_record()) {
notify("Could not create guest user record !!!");
}
}
+19 -7
View File
@@ -42,7 +42,7 @@ while(@ob_end_flush());
echo '<strong>Progress:</strong>';
$i = 0;
$skiptables = array($CFG->prefix.'config');//, $CFG->prefix.'sessions2');
$skiptables = array($CFG->prefix.'config', $CFG->prefix.'user_students', $CFG->prefix.'user_teachers');//, $CFG->prefix.'sessions2');
foreach ($tables as $table) {
if (($CFG->prefix && strpos($table, $CFG->prefix) !== 0)
@@ -63,12 +63,8 @@ foreach ($tables as $table) {
if ($rs and $rs->RecordCount() > 0) {
while (!$rs->EOF) {
$text = $rs->fields[$column];
$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 ($newtext != $text) {
$newtext = addslashes($newtext);
execute_sql("UPDATE $table SET $column='$newtext' WHERE id=".$rs->fields['id'], false);
}
$id = $rs->fields['id'];
if ($i % 600 == 0) {
echo '<br />';
}
@@ -77,6 +73,22 @@ foreach ($tables as $table) {
}
$i++;
$rs->MoveNext();
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) {
$newtext = addslashes($newtext);
execute_sql("UPDATE $table SET $column='$newtext' WHERE id=$id", false);
}
}
}
}
+1284 -1284
View File
File diff suppressed because it is too large Load Diff
+189 -189
View File
@@ -1,190 +1,190 @@
<?php
/**
* @file CAS/PGTStorage/pgt-db.php
* Basic class for PGT database storage
*/
// include phpDB library (the test was introduced in release 0.4.8 for
// the integration into Tikiwiki).
if (!class_exists('DB')) {
@include_once('DB.php');
}
/**
* @class PGTStorageDB
* The PGTStorageDB class is a class for PGT database storage. An instance of
* this class is returned by CASClient::SetPGTStorageDB().
*
* @author Pascal Aubry <pascal.aubry at univ-rennes1.fr>
*
* @ingroup internalPGTStorageDB
*/
class PGTStorageDB extends PGTStorage
{
/**
* @addtogroup internalPGTStorageDB
* @{
*/
/**
* a string representing a PEAR DB URL to connect to the database. Written by
* PGTStorageDB::PGTStorageDB(), read by getURL().
*
* @hideinitializer
* @private
*/
var $_url='';
/**
* This method returns the PEAR DB URL to use to connect to the database.
*
* @return a PEAR DB URL
*
* @private
*/
function getURL()
{
return $this->_url;
}
/**
* The handle of the connection to the database where PGT's are stored. Written by
* PGTStorageDB::init(), read by getLink().
*
* @hideinitializer
* @private
*/
var $_link = null;
/**
* This method returns the handle of the connection to the database where PGT's are
* stored.
*
* @return a handle of connection.
*
* @private
*/
function getLink()
{
return $this->_link;
}
/**
* The name of the table where PGT's are stored. Written by
* PGTStorageDB::PGTStorageDB(), read by getTable().
*
* @hideinitializer
* @private
*/
var $_table = '';
/**
* This method returns the name of the table where PGT's are stored.
*
* @return the name of a table.
*
* @private
*/
function getTable()
{
return $this->_table;
}
// ########################################################################
// DEBUGGING
// ########################################################################
/**
* This method returns an informational string giving the type of storage
* used by the object (used for debugging purposes).
*
* @return an informational string.
* @public
*/
function getStorageType()
{
return "database";
}
/**
* This method returns an informational string giving informations on the
* parameters of the storage.(used for debugging purposes).
*
* @public
*/
function getStorageInfo()
{
return 'url=`'.$this->getURL().'\', table=`'.$this->getTable().'\'';
}
// ########################################################################
// CONSTRUCTOR
// ########################################################################
/**
* The class constructor, called by CASClient::SetPGTStorageDB().
*
* @param $cas_parent the CASClient instance that creates the object.
* @param $user the user to access the data with
* @param $password the user's password
* @param $database_type the type of the database hosting the data
* @param $hostname the server hosting the database
* @param $port the port the server is listening on
* @param $database the name of the database
* @param $table the name of the table storing the data
*
* @public
*/
function PGTStorageDB($cas_parent,$user,$password,$database_type,$hostname,$port,$database,$table)
{
phpCAS::traceBegin();
// call the ancestor's constructor
$this->PGTStorage($cas_parent);
if ( empty($database_type) ) $database_type = CAS_PGT_STORAGE_DB_DEFAULT_DATABASE_TYPE;
if ( empty($hostname) ) $hostname = CAS_PGT_STORAGE_DB_DEFAULT_HOSTNAME;
if ( $port==0 ) $port = CAS_PGT_STORAGE_DB_DEFAULT_PORT;
if ( empty($database) ) $database = CAS_PGT_STORAGE_DB_DEFAULT_DATABASE;
if ( empty($table) ) $table = CAS_PGT_STORAGE_DB_DEFAULT_TABLE;
// build and store the PEAR DB URL
$this->_url = $database_type.':'.'//'.$user.':'.$password.'@'.$hostname.':'.$port.'/'.$database;
// XXX should use setURL and setTable
phpCAS::traceEnd();
}
// ########################################################################
// INITIALIZATION
// ########################################################################
/**
* This method is used to initialize the storage. Halts on error.
*
* @public
*/
function init()
{
phpCAS::traceBegin();
// if the storage has already been initialized, return immediatly
if ( $this->isInitialized() )
return;
// call the ancestor's method (mark as initialized)
parent::init();
// try to connect to the database
$this->_link = DB::connect($this->getURL());
if ( DB::isError($this->_link) ) {
phpCAS::error('could not connect to database ('.DB::errorMessage($this->_link).')');
}
var_dump($this->_link);
phpCAS::traceBEnd();
}
/** @} */
}
<?php
/**
* @file CAS/PGTStorage/pgt-db.php
* Basic class for PGT database storage
*/
// include phpDB library (the test was introduced in release 0.4.8 for
// the integration into Tikiwiki).
if (!class_exists('DB')) {
@include_once('DB.php');
}
/**
* @class PGTStorageDB
* The PGTStorageDB class is a class for PGT database storage. An instance of
* this class is returned by CASClient::SetPGTStorageDB().
*
* @author Pascal Aubry <pascal.aubry at univ-rennes1.fr>
*
* @ingroup internalPGTStorageDB
*/
class PGTStorageDB extends PGTStorage
{
/**
* @addtogroup internalPGTStorageDB
* @{
*/
/**
* a string representing a PEAR DB URL to connect to the database. Written by
* PGTStorageDB::PGTStorageDB(), read by getURL().
*
* @hideinitializer
* @private
*/
var $_url='';
/**
* This method returns the PEAR DB URL to use to connect to the database.
*
* @return a PEAR DB URL
*
* @private
*/
function getURL()
{
return $this->_url;
}
/**
* The handle of the connection to the database where PGT's are stored. Written by
* PGTStorageDB::init(), read by getLink().
*
* @hideinitializer
* @private
*/
var $_link = null;
/**
* This method returns the handle of the connection to the database where PGT's are
* stored.
*
* @return a handle of connection.
*
* @private
*/
function getLink()
{
return $this->_link;
}
/**
* The name of the table where PGT's are stored. Written by
* PGTStorageDB::PGTStorageDB(), read by getTable().
*
* @hideinitializer
* @private
*/
var $_table = '';
/**
* This method returns the name of the table where PGT's are stored.
*
* @return the name of a table.
*
* @private
*/
function getTable()
{
return $this->_table;
}
// ########################################################################
+240 -240
View File
@@ -1,240 +1,240 @@
<?php
/**
* @file CAS/PGTStorage/pgt-file.php
* Basic class for PGT file storage
*/
/**
* @class PGTStorageFile
* The PGTStorageFile class is a class for PGT file storage. An instance of
* this class is returned by CASClient::SetPGTStorageFile().
*
* @author Pascal Aubry <pascal.aubry at univ-rennes1.fr>
*
* @ingroup internalPGTStorageFile
*/
class PGTStorageFile extends PGTStorage
{
/**
* @addtogroup internalPGTStorageFile
* @{
*/
/**
* a string telling where PGT's should be stored on the filesystem. Written by
* PGTStorageFile::PGTStorageFile(), read by getPath().
*
* @private
*/
var $_path;
/**
* This method returns the name of the directory where PGT's should be stored
* on the filesystem.
*
* @return the name of a directory (with leading and trailing '/')
*
* @private
*/
function getPath()
{
return $this->_path;
}
/**
* a string telling the format to use to store PGT's (plain or xml). Written by
* PGTStorageFile::PGTStorageFile(), read by getFormat().
*
* @private
*/
var $_format;
/**
* This method returns the format to use when storing PGT's on the filesystem.
*
* @return a string corresponding to the format used (plain or xml).
*
* @private
*/
function getFormat()
{
return $this->_format;
}
// ########################################################################
// DEBUGGING
// ########################################################################
/**
* This method returns an informational string giving the type of storage
* used by the object (used for debugging purposes).
*
* @return an informational string.
* @public
*/
function getStorageType()
{
return "file";
}
/**
* This method returns an informational string giving informations on the
* parameters of the storage.(used for debugging purposes).
*
* @return an informational string.
* @public
*/
function getStorageInfo()
{
return 'path=`'.$this->getPath().'\', format=`'.$this->getFormat().'\'';
}
// ########################################################################
// CONSTRUCTOR
// ########################################################################
/**
* The class constructor, called by CASClient::SetPGTStorageFile().
*
* @param $cas_parent the CASClient instance that creates the object.
* @param $format the format used to store the PGT's (`plain' and `xml' allowed).
* @param $path the path where the PGT's should be stored
*
* @public
*/
function PGTStorageFile($cas_parent,$format,$path)
{
phpCAS::traceBegin();
// call the ancestor's constructor
$this->PGTStorage($cas_parent);
if (empty($format) ) $format = CAS_PGT_STORAGE_FILE_DEFAULT_FORMAT;
if (empty($path) ) $path = CAS_PGT_STORAGE_FILE_DEFAULT_PATH;
// check that the path is an absolute path
if ( $path[0] != '/' ) {
phpCAS::error('an absolute path is needed for PGT storage to file');
}
// store the path (with a leading and trailing '/')
$path = preg_replace('|[/]*$|','/',$path);
$path = preg_replace('|^[/]*|','/',$path);
$this->_path = $path;
// check the format and store it
switch ($format) {
case CAS_PGT_STORAGE_FILE_FORMAT_PLAIN:
case CAS_PGT_STORAGE_FILE_FORMAT_XML:
$this->_format = $format;
break;
default:
phpCAS::error('unknown PGT file storage format (`'.CAS_PGT_STORAGE_FILE_FORMAT_PLAIN.'\' and `'.CAS_PGT_STORAGE_FILE_FORMAT_XML.'\' allowed)');
}
phpCAS::traceEnd();
}
// ########################################################################
// INITIALIZATION
// ########################################################################
/**
* This method is used to initialize the storage. Halts on error.
*
* @public
*/
function init()
{
phpCAS::traceBegin();
// if the storage has already been initialized, return immediatly
if ( $this->isInitialized() )
return;
// call the ancestor's method (mark as initialized)
parent::init();
phpCAS::traceEnd();
}
// ########################################################################
// PGT I/O
// ########################################################################
/**
* This method returns the filename corresponding to a PGT Iou.
*
* @param $pgt_iou the PGT iou.
*
* @return a filename
* @private
*/
function getPGTIouFilename($pgt_iou)
{
phpCAS::traceBegin();
$filename = $this->getPath().$pgt_iou.'.'.$this->getFormat();
phpCAS::traceEnd($filename);
return $filename;
}
/**
* This method stores a PGT and its corresponding PGT Iou into a file. Echoes a
* warning on error.
*
* @param $pgt the PGT
* @param $pgt_iou the PGT iou
*
* @public
*/
function write($pgt,$pgt_iou)
{
phpCAS::traceBegin();
$fname = $this->getPGTIouFilename($pgt_iou);
if ( $f=fopen($fname,"w") ) {
if ( fputs($f,$pgt) === FALSE ) {
phpCAS::error('could not write PGT to `'.$fname.'\'');
}
fclose($f);
} else {
phpCAS::error('could not open `'.$fname.'\'');
}
phpCAS::traceEnd();
}
/**
* This method reads a PGT corresponding to a PGT Iou and deletes the
* corresponding file.
*
* @param $pgt_iou the PGT iou
*
* @return the corresponding PGT, or FALSE on error
*
* @public
*/
function read($pgt_iou)
{
phpCAS::traceBegin();
$pgt = FALSE;
$fname = $this->getPGTIouFilename($pgt_iou);
if ( !($f=fopen($fname,"r")) ) {
phpCAS::trace('could not open `'.$fname.'\'');
} else {
if ( ($pgt=fgets($f)) === FALSE ) {
phpCAS::trace('could not read PGT from `'.$fname.'\'');
}
fclose($f);
}
// delete the PGT file
@unlink($fname);
phpCAS::traceEnd($pgt);
return $pgt;
}
/** @} */
}
?>
<?php
/**
* @file CAS/PGTStorage/pgt-file.php
* Basic class for PGT file storage
*/
/**
* @class PGTStorageFile
* The PGTStorageFile class is a class for PGT file storage. An instance of
* this class is returned by CASClient::SetPGTStorageFile().
*
* @author Pascal Aubry <pascal.aubry at univ-rennes1.fr>
*
* @ingroup internalPGTStorageFile
*/
class PGTStorageFile extends PGTStorage
{
/**
* @addtogroup internalPGTStorageFile
* @{
*/
/**
* a string telling where PGT's should be stored on the filesystem. Written by
* PGTStorageFile::PGTStorageFile(), read by getPath().
*
* @private
*/
var $_path;
/**
* This method returns the name of the directory where PGT's should be stored
* on the filesystem.
*
* @return the name of a directory (with leading and trailing '/')
*
* @private
*/
function getPath()
{
return $this->_path;
}
/**
* a string telling the format to use to store PGT's (plain or xml). Written by
* PGTStorageFile::PGTStorageFile(), read by getFormat().
*
* @private
*/
var $_format;
/**
* This method returns the format to use when storing PGT's on the filesystem.
*
* @return a string corresponding to the format used (plain or xml).
*
* @private
*/
function getFormat()
{
return $this->_format;
}
// ########################################################################
// DEBUGGING
// ########################################################################
/**
* This method returns an informational string giving the type of storage
* used by the object (used for debugging purposes).
*
* @return an informational string.
* @public
*/
function getStorageType()
{
return "file";
}
/**
* This method returns an informational string giving informations on the
* parameters of the storage.(used for debugging purposes).
*
* @return an informational string.
* @public
*/
function getStorageInfo()
{
return 'path=`'.$this->getPath().'\', format=`'.$this->getFormat().'\'';
}
// ########################################################################
// CONSTRUCTOR
// ########################################################################
/**
* The class constructor, called by CASClient::SetPGTStorageFile().
*
* @param $cas_parent the CASClient instance that creates the object.
* @param $format the format used to store the PGT's (`plain' and `xml' allowed).
* @param $path the path where the PGT's should be stored
*
* @public
*/
function PGTStorageFile($cas_parent,$format,$path)
{
phpCAS::traceBegin();
// call the ancestor's constructor
$this->PGTStorage($cas_parent);
if (empty($format) ) $format = CAS_PGT_STORAGE_FILE_DEFAULT_FORMAT;
if (empty($path) ) $path = CAS_PGT_STORAGE_FILE_DEFAULT_PATH;
// check that the path is an absolute path
if ( $path[0] != '/' ) {
phpCAS::error('an absolute path is needed for PGT storage to file');
}
+188 -188
View File
@@ -1,188 +1,188 @@
<?php
/**
* @file CAS/PGTStorage/pgt-main.php
* Basic class for PGT storage
*/
/**
* @class PGTStorage
* The PGTStorage class is a generic class for PGT storage. This class should
* not be instanciated itself but inherited by specific PGT storage classes.
*
* @author Pascal Aubry <pascal.aubry at univ-rennes1.fr>
*
* @ingroup internalPGTStorage
*/
class PGTStorage
{
/**
* @addtogroup internalPGTStorage
* @{
*/
// ########################################################################
// CONSTRUCTOR
// ########################################################################
/**
* The constructor of the class, should be called only by inherited classes.
*
* @param $cas_parent the CASclient instance that creates the current object.
*
* @protected
*/
function PGTStorage($cas_parent)
{
phpCAS::traceBegin();
if ( !$cas_parent->isProxy() ) {
phpCAS::error('defining PGT storage makes no sense when not using a CAS proxy');
}
phpCAS::traceEnd();
}
// ########################################################################
// DEBUGGING
// ########################################################################
/**
* This virtual method returns an informational string giving the type of storage
* used by the object (used for debugging purposes).
*
* @public
*/
function getStorageType()
{
phpCAS::error(__CLASS__.'::'.__FUNCTION__.'() should never be called');
}
/**
* This virtual method returns an informational string giving informations on the
* parameters of the storage.(used for debugging purposes).
*
* @public
*/
function getStorageInfo()
{
phpCAS::error(__CLASS__.'::'.__FUNCTION__.'() should never be called');
}
// ########################################################################
// ERROR HANDLING
// ########################################################################
/**
* string used to store an error message. Written by PGTStorage::setErrorMessage(),
* read by PGTStorage::getErrorMessage().
*
* @hideinitializer
* @private
* @deprecated not used.
*/
var $_error_message=FALSE;
/**
* This method sets en error message, which can be read later by
* PGTStorage::getErrorMessage().
*
* @param $error_message an error message
*
* @protected
* @deprecated not used.
*/
function setErrorMessage($error_message)
{
$this->_error_message = $error_message;
}
/**
* This method returns an error message set by PGTStorage::setErrorMessage().
*
* @return an error message when set by PGTStorage::setErrorMessage(), FALSE
* otherwise.
*
* @public
* @deprecated not used.
*/
function getErrorMessage()
{
return $this->_error_message;
}
// ########################################################################
// INITIALIZATION
// ########################################################################
/**
* a boolean telling if the storage has already been initialized. Written by
* PGTStorage::init(), read by PGTStorage::isInitialized().
*
* @hideinitializer
* @private
*/
var $_initialized = FALSE;
/**
* This method tells if the storage has already been intialized.
*
* @return a boolean
*
* @protected
*/
function isInitialized()
{
return $this->_initialized;
}
/**
* This virtual method initializes the object.
*
* @protected
*/
function init()
{
$this->_initialized = TRUE;
}
// ########################################################################
// PGT I/O
// ########################################################################
/**
* This virtual method stores a PGT and its corresponding PGT Iuo.
* @note Should never be called.
*
* @param $pgt the PGT
* @param $pgt_iou the PGT iou
*
* @protected
*/
function write($pgt,$pgt_iou)
{
phpCAS::error(__CLASS__.'::'.__FUNCTION__.'() should never be called');
}
/**
* This virtual method reads a PGT corresponding to a PGT Iou and deletes
* the corresponding storage entry.
* @note Should never be called.
*
* @param $pgt_iou the PGT iou
*
* @protected
*/
function read($pgt_iou)
{
phpCAS::error(__CLASS__.'::'.__FUNCTION__.'() should never be called');
}
/** @} */
}
// include specific PGT storage classes
include_once(dirname(__FILE__).'/pgt-file.php');
include_once(dirname(__FILE__).'/pgt-db.php');
?>
<?php
/**
* @file CAS/PGTStorage/pgt-main.php
* Basic class for PGT storage
*/
/**
* @class PGTStorage
* The PGTStorage class is a generic class for PGT storage. This class should
* not be instanciated itself but inherited by specific PGT storage classes.
*
* @author Pascal Aubry <pascal.aubry at univ-rennes1.fr>
*
* @ingroup internalPGTStorage
*/
class PGTStorage
{
/**
* @addtogroup internalPGTStorage
* @{
*/
// ########################################################################
// CONSTRUCTOR
// ########################################################################
/**
* The constructor of the class, should be called only by inherited classes.
*
* @param $cas_parent the CASclient instance that creates the current object.
*
* @protected
*/
function PGTStorage($cas_parent)
{
phpCAS::traceBegin();
if ( !$cas_parent->isProxy() ) {
phpCAS::error('defining PGT storage makes no sense when not using a CAS proxy');
}
phpCAS::traceEnd();
}
// ########################################################################
// DEBUGGING
// ########################################################################
/**
* This virtual method returns an informational string giving the type of storage
* used by the object (used for debugging purposes).
*
* @public
*/
function getStorageType()
{
phpCAS::error(__CLASS__.'::'.__FUNCTION__.'() should never be called');
}
/**
* This virtual method returns an informational string giving informations on the
* parameters of the storage.(used for debugging purposes).
*
* @public
*/
function getStorageInfo()
{
phpCAS::error(__CLASS__.'::'.__FUNCTION__.'() should never be called');
}
// ########################################################################
// ERROR HANDLING
// ########################################################################
/**
* string used to store an error message. Written by PGTStorage::setErrorMessage(),
* read by PGTStorage::getErrorMessage().
*
* @hideinitializer
* @private
* @deprecated not used.
*/
var $_error_message=FALSE;
/**
* This method sets en error message, which can be read later by
* PGTStorage::getErrorMessage().
*
* @param $error_message an error message
*
* @protected
* @deprecated not used.
*/
function setErrorMessage($error_message)
+2078 -2078
View File
File diff suppressed because it is too large Load Diff
+276 -276
View File
@@ -1,277 +1,277 @@
<?php
/**
* @file domxml-php4-php5.php
* Require PHP5, uses built-in DOM extension.
* To be used in PHP4 scripts using DOMXML extension.
* Allows PHP4/DOMXML scripts to run on PHP5/DOM.
* (Requires PHP5/XSL extension for domxml_xslt functions)
*
* Typical use:
* <pre>
* {
* if (version_compare(PHP_VERSION,'5','>='))
* require_once('domxml-php4-to-php5.php');
* }
* </pre>
*
* Version 1.5.5, 2005-01-18, http://alexandre.alapetite.net/doc-alex/domxml-php4-php5/
*
* ------------------------------------------------------------------<br>
* Written by Alexandre Alapetite, http://alexandre.alapetite.net/cv/
*
* Copyright 2004, Licence: Creative Commons "Attribution-ShareAlike 2.0 France" BY-SA (FR),
* http://creativecommons.org/licenses/by-sa/2.0/fr/
* http://alexandre.alapetite.net/divers/apropos/#by-sa
* - Attribution. You must give the original author credit
* - Share Alike. If you alter, transform, or build upon this work,
* you may distribute the resulting work only under a license identical to this one
* - The French law is authoritative
* - Any of these conditions can be waived if you get permission from Alexandre Alapetite
* - Please send to Alexandre Alapetite the modifications you make,
* in order to improve this file for the benefit of everybody
*
* If you want to distribute this code, please do it as a link to:
* http://alexandre.alapetite.net/doc-alex/domxml-php4-php5/
*/
function domxml_new_doc($version) {return new php4DOMDocument('');}
function domxml_open_file($filename) {return new php4DOMDocument($filename);}
function domxml_open_mem($str)
{
$dom=new php4DOMDocument('');
$dom->myDOMNode->loadXML($str);
return $dom;
}
function xpath_eval($xpath_context,$eval_str,$contextnode=null) {return $xpath_context->query($eval_str,$contextnode);}
function xpath_new_context($dom_document) {return new php4DOMXPath($dom_document);}
class php4DOMAttr extends php4DOMNode
{
function php4DOMAttr($aDOMAttr) {$this->myDOMNode=$aDOMAttr;}
function Name() {return $this->myDOMNode->name;}
function Specified() {return $this->myDOMNode->specified;}
function Value() {return $this->myDOMNode->value;}
}
class php4DOMDocument extends php4DOMNode
{
function php4DOMDocument($filename='')
{
$this->myDOMNode=new DOMDocument();
if ($filename!='') $this->myDOMNode->load($filename);
}
function create_attribute($name,$value)
{
$myAttr=$this->myDOMNode->createAttribute($name);
$myAttr->value=$value;
return new php4DOMAttr($myAttr,$this);
}
function create_cdata_section($content) {return new php4DOMNode($this->myDOMNode->createCDATASection($content),$this);}
function create_comment($data) {return new php4DOMNode($this->myDOMNode->createComment($data),$this);}
function create_element($name) {return new php4DOMElement($this->myDOMNode->createElement($name),$this);}
function create_text_node($content) {return new php4DOMNode($this->myDOMNode->createTextNode($content),$this);}
function document_element() {return new php4DOMElement($this->myDOMNode->documentElement,$this);}
function dump_file($filename,$compressionmode=false,$format=false) {return $this->myDOMNode->save($filename);}
function dump_mem($format=false,$encoding=false) {return $this->myDOMNode->saveXML();}
function get_element_by_id($id) {return new php4DOMElement($this->myDOMNode->getElementById($id),$this);}
function get_elements_by_tagname($name)
{
$myDOMNodeList=$this->myDOMNode->getElementsByTagName($name);
$nodeSet=array();
$i=0;
if (isset($myDOMNodeList))
while ($node=$myDOMNodeList->item($i))
{
$nodeSet[]=new php4DOMElement($node,$this);
$i++;
}
return $nodeSet;
}
function html_dump_mem() {return $this->myDOMNode->saveHTML();}
function root() {return new php4DOMElement($this->myDOMNode->documentElement,$this);}
}
class php4DOMElement extends php4DOMNode
{
function get_attribute($name) {return $this->myDOMNode->getAttribute($name);}
function get_elements_by_tagname($name)
{
$myDOMNodeList=$this->myDOMNode->getElementsByTagName($name);
$nodeSet=array();
$i=0;
if (isset($myDOMNodeList))
while ($node=$myDOMNodeList->item($i))
{
$nodeSet[]=new php4DOMElement($node,$this->myOwnerDocument);
$i++;
}
return $nodeSet;
}
function has_attribute($name) {return $this->myDOMNode->hasAttribute($name);}
function remove_attribute($name) {return $this->myDOMNode->removeAttribute($name);}
function set_attribute($name,$value) {return $this->myDOMNode->setAttribute($name,$value);}
function tagname() {return $this->myDOMNode->tagName;}
}
class php4DOMNode
{
var $myDOMNode;
var $myOwnerDocument;
function php4DOMNode($aDomNode,$aOwnerDocument)
{
$this->myDOMNode=$aDomNode;
$this->myOwnerDocument=$aOwnerDocument;
}
function __get($name)
{
if ($name=='type') return $this->myDOMNode->nodeType;
elseif ($name=='tagname') return $this->myDOMNode->tagName;
elseif ($name=='content') return $this->myDOMNode->textContent;
else
{
$myErrors=debug_backtrace();
trigger_error('Undefined property: '.get_class($this).'::$'.$name.' ['.$myErrors[0]['file'].':'.$myErrors[0]['line'].']',E_USER_NOTICE);
return false;
}
}
function append_child($newnode) {return new php4DOMElement($this->myDOMNode->appendChild($newnode->myDOMNode),$this->myOwnerDocument);}
function append_sibling($newnode) {return new php4DOMElement($this->myDOMNode->parentNode->appendChild($newnode->myDOMNode),$this->myOwnerDocument);}
function attributes()
{
$myDOMNodeList=$this->myDOMNode->attributes;
$nodeSet=array();
$i=0;
if (isset($myDOMNodeList))
while ($node=$myDOMNodeList->item($i))
{
$nodeSet[]=new php4DOMAttr($node,$this->myOwnerDocument);
$i++;
}
return $nodeSet;
}
function child_nodes()
{
$myDOMNodeList=$this->myDOMNode->childNodes;
$nodeSet=array();
$i=0;
if (isset($myDOMNodeList))
while ($node=$myDOMNodeList->item($i))
{
$nodeSet[]=new php4DOMElement($node,$this->myOwnerDocument);
$i++;
}
return $nodeSet;
}
function children() {return $this->child_nodes();}
function clone_node($deep=false) {return new php4DOMElement($this->myDOMNode->cloneNode($deep),$this->myOwnerDocument);}
function first_child() {return new php4DOMElement($this->myDOMNode->firstChild,$this->myOwnerDocument);}
function get_content() {return $this->myDOMNode->textContent;}
function has_attributes() {return $this->myDOMNode->hasAttributes();}
function has_child_nodes() {return $this->myDOMNode->hasChildNodes();}
function insert_before($newnode,$refnode) {return new php4DOMElement($this->myDOMNode->insertBefore($newnode->myDOMNode,$refnode->myDOMNode),$this->myOwnerDocument);}
function is_blank_node()
{
$myDOMNodeList=$this->myDOMNode->childNodes;
$i=0;
if (isset($myDOMNodeList))
while ($node=$myDOMNodeList->item($i))
{
if (($node->nodeType==XML_ELEMENT_NODE)||
(($node->nodeType==XML_TEXT_NODE)&&!ereg('^([[:cntrl:]]|[[:space:]])*$',$node->nodeValue)))
return false;
$i++;
}
return true;
}
function last_child() {return new php4DOMElement($this->myDOMNode->lastChild,$this->myOwnerDocument);}
function new_child($name,$content)
{
$mySubNode=$this->myDOMNode->ownerDocument->createElement($name);
$mySubNode->appendChild($this->myDOMNode->ownerDocument->createTextNode($content));
$this->myDOMNode->appendChild($mySubNode);
return new php4DOMElement($mySubNode,$this->myOwnerDocument);
}
function next_sibling() {return new php4DOMElement($this->myDOMNode->nextSibling,$this->myOwnerDocument);}
function node_name() {return $this->myDOMNode->localName;}
function node_type() {return $this->myDOMNode->nodeType;}
function node_value() {return $this->myDOMNode->nodeValue;}
function owner_document() {return $this->myOwnerDocument;}
function parent_node() {return new php4DOMElement($this->myDOMNode->parentNode,$this->myOwnerDocument);}
function prefix() {return $this->myDOMNode->prefix;}
function previous_sibling() {return new php4DOMElement($this->myDOMNode->previousSibling,$this->myOwnerDocument);}
function remove_child($oldchild) {return new php4DOMElement($this->myDOMNode->removeChild($oldchild->myDOMNode),$this->myOwnerDocument);}
function replace_child($oldnode,$newnode) {return new php4DOMElement($this->myDOMNode->replaceChild($oldnode->myDOMNode,$newnode->myDOMNode),$this->myOwnerDocument);}
function set_content($text)
{
if (($this->myDOMNode->hasChildNodes())&&($this->myDOMNode->firstChild->nodeType==XML_TEXT_NODE))
$this->myDOMNode->removeChild($this->myDOMNode->firstChild);
return $this->myDOMNode->appendChild($this->myDOMNode->ownerDocument->createTextNode($text));
}
}
class php4DOMNodelist
{
var $myDOMNodelist;
var $nodeset;
function php4DOMNodelist($aDOMNodelist,$aOwnerDocument)
{
$this->myDOMNodelist=$aDOMNodelist;
$this->nodeset=array();
$i=0;
if (isset($this->myDOMNodelist))
while ($node=$this->myDOMNodelist->item($i))
{
$this->nodeset[]=new php4DOMElement($node,$aOwnerDocument);
$i++;
}
}
}
class php4DOMXPath
{
var $myDOMXPath;
var $myOwnerDocument;
function php4DOMXPath($dom_document)
{
$this->myOwnerDocument=$dom_document;
$this->myDOMXPath=new DOMXPath($dom_document->myDOMNode);
}
function query($eval_str,$contextnode)
{
if (isset($contextnode)) return new php4DOMNodelist($this->myDOMXPath->query($eval_str,$contextnode->myDOMNode),$this->myOwnerDocument);
else return new php4DOMNodelist($this->myDOMXPath->query($eval_str),$this->myOwnerDocument);
}
function xpath_register_ns($prefix,$namespaceURI) {return $this->myDOMXPath->registerNamespace($prefix,$namespaceURI);}
}
if (extension_loaded('xsl'))
{//See also: http://alexandre.alapetite.net/doc-alex/xslt-php4-php5/
function domxml_xslt_stylesheet($xslstring) {return new php4DomXsltStylesheet(DOMDocument::loadXML($xslstring));}
function domxml_xslt_stylesheet_doc($dom_document) {return new php4DomXsltStylesheet($dom_document);}
function domxml_xslt_stylesheet_file($xslfile) {return new php4DomXsltStylesheet(DOMDocument::load($xslfile));}
class php4DomXsltStylesheet
{
var $myxsltProcessor;
function php4DomXsltStylesheet($dom_document)
{
$this->myxsltProcessor=new xsltProcessor();
$this->myxsltProcessor->importStyleSheet($dom_document);
}
function process($dom_document,$xslt_parameters=array(),$param_is_xpath=false)
{
foreach ($xslt_parameters as $param=>$value)
$this->myxsltProcessor->setParameter('',$param,$value);
$myphp4DOMDocument=new php4DOMDocument();
$myphp4DOMDocument->myDOMNode=$this->myxsltProcessor->transformToDoc($dom_document->myDOMNode);
return $myphp4DOMDocument;
}
function result_dump_file($dom_document,$filename)
{
$html=$dom_document->myDOMNode->saveHTML();
file_put_contents($filename,$html);
return $html;
}
function result_dump_mem($dom_document) {return $dom_document->myDOMNode->saveHTML();}
}
}
<?php
/**
* @file domxml-php4-php5.php
* Require PHP5, uses built-in DOM extension.
* To be used in PHP4 scripts using DOMXML extension.
* Allows PHP4/DOMXML scripts to run on PHP5/DOM.
* (Requires PHP5/XSL extension for domxml_xslt functions)
*
* Typical use:
* <pre>
* {
* if (version_compare(PHP_VERSION,'5','>='))
* require_once('domxml-php4-to-php5.php');
* }
* </pre>
*
* Version 1.5.5, 2005-01-18, http://alexandre.alapetite.net/doc-alex/domxml-php4-php5/
*
* ------------------------------------------------------------------<br>
* Written by Alexandre Alapetite, http://alexandre.alapetite.net/cv/
*
* Copyright 2004, Licence: Creative Commons "Attribution-ShareAlike 2.0 France" BY-SA (FR),
* http://creativecommons.org/licenses/by-sa/2.0/fr/
* http://alexandre.alapetite.net/divers/apropos/#by-sa
* - Attribution. You must give the original author credit
* - Share Alike. If you alter, transform, or build upon this work,
* you may distribute the resulting work only under a license identical to this one
* - The French law is authoritative
* - Any of these conditions can be waived if you get permission from Alexandre Alapetite
* - Please send to Alexandre Alapetite the modifications you make,
* in order to improve this file for the benefit of everybody
*
* If you want to distribute this code, please do it as a link to:
* http://alexandre.alapetite.net/doc-alex/domxml-php4-php5/
*/
function domxml_new_doc($version) {return new php4DOMDocument('');}
function domxml_open_file($filename) {return new php4DOMDocument($filename);}
function domxml_open_mem($str)
{
$dom=new php4DOMDocument('');
$dom->myDOMNode->loadXML($str);
return $dom;
}
function xpath_eval($xpath_context,$eval_str,$contextnode=null) {return $xpath_context->query($eval_str,$contextnode);}
function xpath_new_context($dom_document) {return new php4DOMXPath($dom_document);}
class php4DOMAttr extends php4DOMNode
{
function php4DOMAttr($aDOMAttr) {$this->myDOMNode=$aDOMAttr;}
function Name() {return $this->myDOMNode->name;}
function Specified() {return $this->myDOMNode->specified;}
function Value() {return $this->myDOMNode->value;}
}
class php4DOMDocument extends php4DOMNode
{
function php4DOMDocument($filename='')
{
$this->myDOMNode=new DOMDocument();
if ($filename!='') $this->myDOMNode->load($filename);
}
function create_attribute($name,$value)
{
$myAttr=$this->myDOMNode->createAttribute($name);
$myAttr->value=$value;
return new php4DOMAttr($myAttr,$this);
}
function create_cdata_section($content) {return new php4DOMNode($this->myDOMNode->createCDATASection($content),$this);}
function create_comment($data) {return new php4DOMNode($this->myDOMNode->createComment($data),$this);}
function create_element($name) {return new php4DOMElement($this->myDOMNode->createElement($name),$this);}
function create_text_node($content) {return new php4DOMNode($this->myDOMNode->createTextNode($content),$this);}
function document_element() {return new php4DOMElement($this->myDOMNode->documentElement,$this);}
function dump_file($filename,$compressionmode=false,$format=false) {return $this->myDOMNode->save($filename);}
function dump_mem($format=false,$encoding=false) {return $this->myDOMNode->saveXML();}
function get_element_by_id($id) {return new php4DOMElement($this->myDOMNode->getElementById($id),$this);}
function get_elements_by_tagname($name)
{
$myDOMNodeList=$this->myDOMNode->getElementsByTagName($name);
$nodeSet=array();
$i=0;
if (isset($myDOMNodeList))
while ($node=$myDOMNodeList->item($i))
{
$nodeSet[]=new php4DOMElement($node,$this);
$i++;
}
return $nodeSet;
}
function html_dump_mem() {return $this->myDOMNode->saveHTML();}
function root() {return new php4DOMElement($this->myDOMNode->documentElement,$this);}
}
class php4DOMElement extends php4DOMNode
{
function get_attribute($name) {return $this->myDOMNode->getAttribute($name);}
function get_elements_by_tagname($name)
{
$myDOMNodeList=$this->myDOMNode->getElementsByTagName($name);
$nodeSet=array();
$i=0;
if (isset($myDOMNodeList))
while ($node=$myDOMNodeList->item($i))
{
$nodeSet[]=new php4DOMElement($node,$this->myOwnerDocument);
$i++;
}
return $nodeSet;
}
function has_attribute($name) {return $this->myDOMNode->hasAttribute($name);}
function remove_attribute($name) {return $this->myDOMNode->removeAttribute($name);}
function set_attribute($name,$value) {return $this->myDOMNode->setAttribute($name,$value);}
function tagname() {return $this->myDOMNode->tagName;}
}
class php4DOMNode
{
var $myDOMNode;
var $myOwnerDocument;
function php4DOMNode($aDomNode,$aOwnerDocument)
{
$this->myDOMNode=$aDomNode;
$this->myOwnerDocument=$aOwnerDocument;
}
function __get($name)
{
if ($name=='type') return $this->myDOMNode->nodeType;
elseif ($name=='tagname') return $this->myDOMNode->tagName;
elseif ($name=='content') return $this->myDOMNode->textContent;
else
{
$myErrors=debug_backtrace();
trigger_error('Undefined property: '.get_class($this).'::$'.$name.' ['.$myErrors[0]['file'].':'.$myErrors[0]['line'].']',E_USER_NOTICE);
return false;
}
}
function append_child($newnode) {return new php4DOMElement($this->myDOMNode->appendChild($newnode->myDOMNode),$this->myOwnerDocument);}
function append_sibling($newnode) {return new php4DOMElement($this->myDOMNode->parentNode->appendChild($newnode->myDOMNode),$this->myOwnerDocument);}
function attributes()
+26 -26
View File
@@ -1,27 +1,27 @@
<?php
/**
* @file languages/english.php
* @author Pascal Aubry <pascal.aubry at univ-rennes1.fr>
* @sa @link internalLang Internationalization @endlink
* @ingroup internalLang
*/
$this->_strings = array(
CAS_STR_USING_SERVER
=> 'using server',
CAS_STR_AUTHENTICATION_WANTED
=> 'CAS Authentication wanted!',
CAS_STR_LOGOUT
=> 'CAS logout wanted!',
CAS_STR_SHOULD_HAVE_BEEN_REDIRECTED
=> 'You should already have been redirected to the CAS server. Click <a href="%s">here</a> to continue.',
CAS_STR_AUTHENTICATION_FAILED
=> 'CAS Authentication failed!',
CAS_STR_YOU_WERE_NOT_AUTHENTICATED
=> '<p>You were not authenticated.</p><p>You may submit your request again by clicking <a href="%s">here</a>.</p><p>If the problem persists, you may contact <a href="mailto:%s">the administrator of this site</a>.</p>',
CAS_STR_SERVICE_UNAVAILABLE
=> 'The service `<b>%s</b>\' is not available (<b>%s</b>).'
);
<?php
/**
* @file languages/english.php
* @author Pascal Aubry <pascal.aubry at univ-rennes1.fr>
* @sa @link internalLang Internationalization @endlink
* @ingroup internalLang
*/
$this->_strings = array(
CAS_STR_USING_SERVER
=> 'using server',
CAS_STR_AUTHENTICATION_WANTED
=> 'CAS Authentication wanted!',
+27 -27
View File
@@ -1,28 +1,28 @@
<?php
/**
* @file languages/english.php
* @author Pascal Aubry <pascal.aubry at univ-rennes1.fr>
* @sa @link internalLang Internationalization @endlink
* @ingroup internalLang
*/
$this->_strings = array(
CAS_STR_USING_SERVER
=> 'utilisant le serveur',
CAS_STR_AUTHENTICATION_WANTED
=> 'Authentication CAS nécessaire&nbsp;!',
CAS_STR_LOGOUT
=> 'Déconnexion demandée&nbsp;!',
CAS_STR_SHOULD_HAVE_BEEN_REDIRECTED
=> 'Vous auriez du etre redirigé(e) vers le serveur CAS. Cliquez <a href="%s">ici</a> pour continuer.',
CAS_STR_AUTHENTICATION_FAILED
=> 'Authentification CAS infructueuse&nbsp;!',
CAS_STR_YOU_WERE_NOT_AUTHENTICATED
=> '<p>Vous n\'avez pas été authentifié(e).</p><p>Vous pouvez soumettre votre requete à nouveau en cliquant <a href="%s">ici</a>.</p><p>Si le problème persiste, vous pouvez contacter <a href="mailto:%s">l\'administrateur de ce site</a>.</p>',
CAS_STR_SERVICE_UNAVAILABLE
=> 'Le service `<b>%s</b>\' est indisponible (<b>%s</b>)'
);
<?php
/**
* @file languages/english.php
* @author Pascal Aubry <pascal.aubry at univ-rennes1.fr>
* @sa @link internalLang Internationalization @endlink
* @ingroup internalLang
*/
$this->_strings = array(
CAS_STR_USING_SERVER
=> 'utilisant le serveur',
CAS_STR_AUTHENTICATION_WANTED
=> 'Authentication CAS nécessaire&nbsp;!',
+26 -26
View File
@@ -1,27 +1,27 @@
<?php
/**
* @file languages/german.php
* @author Henrik Genssen <hg at mediafactory.de>
* @sa @link internalLang Internationalization @endlink
* @ingroup internalLang
*/
$this->_strings = array(
CAS_STR_USING_SERVER
=> 'via Server',
CAS_STR_AUTHENTICATION_WANTED
=> 'CAS Authentifizierung erforderlich!',
CAS_STR_LOGOUT
=> 'CAS Abmeldung!',
CAS_STR_SHOULD_HAVE_BEEN_REDIRECTED
=> 'eigentlich h&auml;ten Sie zum CAS Server weitergeleitet werden sollen. Dr&uuml;cken Sie <a href="%s">hier</a> um fortzufahren.',
CAS_STR_AUTHENTICATION_FAILED
=> 'CAS Anmeldung fehlgeschlagen!',
CAS_STR_YOU_WERE_NOT_AUTHENTICATED
=> '<p>Sie wurden nicht angemeldet.</p><p>Um es erneut zu versuchen klicken Sie <a href="%s">hier</a>.</p><p>Wenn das Problem bestehen bleibt, kontkatieren Sie den <a href="mailto:%s">Administrator</a> dieser Seite.</p>',
CAS_STR_SERVICE_UNAVAILABLE
=> 'Der Dienst `<b>%s</b>\' ist nicht verf&uuml;gbar (<b>%s</b>).'
);
<?php
/**
* @file languages/german.php
* @author Henrik Genssen <hg at mediafactory.de>
* @sa @link internalLang Internationalization @endlink
* @ingroup internalLang
*/
$this->_strings = array(
CAS_STR_USING_SERVER
=> 'via Server',
CAS_STR_AUTHENTICATION_WANTED
=> 'CAS Authentifizierung erforderlich!',
+26 -26
View File
@@ -1,27 +1,27 @@
<?php
/**
* @file languages/greek.php
* @author Vangelis Haniotakis <haniotak at ucnet.uoc.gr>
* @sa @link internalLang Internationalization @endlink
* @ingroup internalLang
*/
$this->_strings = array(
CAS_STR_USING_SERVER
=> '÷ñçóéìïðïéåßôáé ï åîõðçñåôçôÞò',
CAS_STR_AUTHENTICATION_WANTED
=> 'Áðáéôåßôáé ç ôáõôïðïßçóç CAS!',
CAS_STR_LOGOUT
=> 'Áðáéôåßôáé ç áðïóýíäåóç áðü CAS!',
CAS_STR_SHOULD_HAVE_BEEN_REDIRECTED
=> 'Èá Ýðñåðå íá åß÷áôå áíáêáôåõèõíèåß óôïí åîõðçñåôçôÞ CAS. ÊÜíôå êëßê <a href="%s">åäþ</a> ãéá íá óõíå÷ßóåôå.',
CAS_STR_AUTHENTICATION_FAILED
=> 'Ç ôáõôïðïßçóç CAS áðÝôõ÷å!',
CAS_STR_YOU_WERE_NOT_AUTHENTICATED
=> '<p>Äåí ôáõôïðïéçèÞêáôå.</p><p>Ìðïñåßôå íá îáíáðñïóðáèÞóåôå, êÜíïíôáò êëßê <a href="%s">åäþ</a>.</p><p>Åáí ôï ðñüâëçìá åðéìåßíåé, åëÜôå óå åðáöÞ ìå ôïí <a href="mailto:%s">äéá÷åéñéóôÞ</a>.</p>',
CAS_STR_SERVICE_UNAVAILABLE
=> 'Ç õðçñåóßá `<b>%s</b>\' äåí åßíáé äéáèÝóéìç (<b>%s</b>).'
);
<?php
/**
* @file languages/greek.php
* @author Vangelis Haniotakis <haniotak at ucnet.uoc.gr>
* @sa @link internalLang Internationalization @endlink
* @ingroup internalLang
*/
$this->_strings = array(
CAS_STR_USING_SERVER
=> '÷ñçóéìïðïéåßôáé ï åîõðçñåôçôÞò',
CAS_STR_AUTHENTICATION_WANTED
=> 'Áðáéôåßôáé ç ôáõôïðïßçóç CAS!',
+26 -26
View File
@@ -1,27 +1,27 @@
<?php
/**
* @file languages/japanese.php
* @author fnorif (fnorif@yahoo.co.jp)
*
* Now Encoding is EUC-JP and LF
**/
$this->_strings = array(
CAS_STR_USING_SERVER
=> 'using server',
CAS_STR_AUTHENTICATION_WANTED
=> 'CASによる認証を行います',
CAS_STR_LOGOUT
=> 'CASからログアウトします!',
CAS_STR_SHOULD_HAVE_BEEN_REDIRECTED
=> 'CASサーバに行く必要があります。自動的に転送されない場合は <a href="%s">こちら</a> をクリックして続行します。',
CAS_STR_AUTHENTICATION_FAILED
=> 'CASによる認証に失敗しました',
CAS_STR_YOU_WERE_NOT_AUTHENTICATED
=> '<p>認証できませんでした.</p><p>もう一度リクエストを送信する場合は<a href="%s">こちら</a>をクリック.</p><p>問題が解決しない場合は <a href="mailto:%s">このサイトの管理者</a>に問い合わせてください.</p>',
CAS_STR_SERVICE_UNAVAILABLE
=> 'サービス `<b>%s</b>\' は利用できません (<b>%s</b>).'
);
<?php
/**
* @file languages/japanese.php
* @author fnorif (fnorif@yahoo.co.jp)
*
* Now Encoding is EUC-JP and LF
**/
$this->_strings = array(
CAS_STR_USING_SERVER
=> 'using server',
CAS_STR_AUTHENTICATION_WANTED
=> 'CASによる認証を行います',
CAS_STR_LOGOUT
=> 'CASからログアウトします!',
CAS_STR_SHOULD_HAVE_BEEN_REDIRECTED
=> 'CASサーバに行く必要があります。自動的に転送されない場合は <a href="%s">こちら</a> をクリックして続行します。',
CAS_STR_AUTHENTICATION_FAILED
=> 'CASによる認証に失敗しました',
CAS_STR_YOU_WERE_NOT_AUTHENTICATED
=> '<p>認証できませんでした.</p><p>もう一度リクエストを送信する場合は<a href="%s">こちら</a>をクリック.</p><p>問題が解決しない場合は <a href="mailto:%s">このサイトの管理者</a>に問い合わせてください.</p>',
CAS_STR_SERVICE_UNAVAILABLE
=> 'サービス `<b>%s</b>\' は利用できません (<b>%s</b>).'
);
?>
+23 -23
View File
@@ -1,24 +1,24 @@
<?php
/**
* @file languages/languages.php
* Internationalization constants
* @author Pascal Aubry <pascal.aubry at univ-rennes1.fr>
* @sa @link internalLang Internationalization @endlink
* @ingroup internalLang
*/
//@{
/**
* a phpCAS string index
*/
define("CAS_STR_USING_SERVER", 1);
define("CAS_STR_AUTHENTICATION_WANTED", 2);
define("CAS_STR_LOGOUT", 3);
define("CAS_STR_SHOULD_HAVE_BEEN_REDIRECTED", 4);
define("CAS_STR_AUTHENTICATION_FAILED", 5);
define("CAS_STR_YOU_WERE_NOT_AUTHENTICATED", 6);
define("CAS_STR_SERVICE_UNAVAILABLE", 7);
//@}
<?php
/**
* @file languages/languages.php
* Internationalization constants
* @author Pascal Aubry <pascal.aubry at univ-rennes1.fr>
* @sa @link internalLang Internationalization @endlink
* @ingroup internalLang
*/
//@{
/**
+1110 -1258
View File
File diff suppressed because it is too large Load Diff
+12 -12
View File
@@ -1,12 +1,12 @@
<div class="loginbox clearfix">
<div class="loginpanel">
<div>
<a href="<?php echo $CFG->wwwroot.'/login/index.php?authCAS=CAS';?>"><?php print_string("accesCAS","auth");?></a>
</div>
<br/>
<div>
<a href="<?php echo $CFG->wwwroot.'/login/index.php?authCAS=NOCAS';?>"><?php print_string("accesNOCAS","auth");?></a>
</div>
</div>
</div>
<div class="loginbox clearfix">
<div class="loginpanel">
<div>
<a href="<?php echo $CFG->wwwroot.'/login/index.php?authCAS=CAS';?>"><?php print_string("accesCAS","auth");?></a>
</div>
+1 -1
View File
@@ -45,4 +45,4 @@ if (!is_enabled_auth('cas')) {
$casauth = get_auth_plugin('cas');
$casauth->sync_users(1000, true);
?>
?>
+432 -434
View File
@@ -1,434 +1,432 @@
<?php
global $CFG;
require_once 'languages.php';
$createoptions[0] = get_string("no");
$createoptions[1] = get_string("yes");
// set to defaults if undefined (CAS)
if (!isset ($config->hostname))
$config->hostname = '';
if (!isset ($config->port))
$config->port = '';
if (!isset ($config->casversion))
$config->casversion = '';
if (!isset ($config->baseuri))
$config->baseuri = '';
if (!isset ($config->language))
$config->language = '';
if (!isset ($config->use_cas))
$config->use_cas = '';
if (!isset ($config->proxycas))
$config->proxycas = '';
if (!isset ($config->logoutcas))
$config->logoutcas = '';
if (!isset ($config->multiauth))
$config->multiauth = '';
// set to defaults if undefined (LDAP)
if (!isset($config->host_url))
{ $config->host_url = ''; }
if (empty($config->ldapencoding))
{ $config->ldapencoding = 'utf-8'; }
if (!isset($config->contexts))
{ $config->contexts = ''; }
if (!isset($config->user_type))
{ $config->user_type = 'default'; }
if (!isset($config->user_attribute))
{ $config->user_attribute = ''; }
if (!isset($config->search_sub))
{ $config->search_sub = ''; }
if (!isset($config->opt_deref))
{ $config->opt_deref = LDAP_DEREF_NEVER; }
if (!isset($config->bind_dn))
{$config->bind_dn = ''; }
if (!isset($config->bind_pw))
{$config->bind_pw = ''; }
if (!isset($config->version))
{$config->version = '2'; }
if (!isset($config->objectclass))
{$config->objectclass = ''; }
if (!isset($config->memberattribute))
{$config->memberattribute = ''; }
if (!isset($config->memberattribute_isdn))
{$config->memberattribute_isdn = ''; }
if (!isset($config->groupecreators))
{$config->groupecreators = ''; }
if (!isset($config->attrcreators))
{$config->attrcreators = ''; }
if (!isset($config->removeuser))
{$config->removeuser = 0; }
$yesno = array( get_string('no'), get_string('yes') );
if (!function_exists('ldap_connect')) { // Is php4-ldap really there?
notify(get_string('auth_ldap_noextension','auth'));
}
?>
<table cellspacing="0" cellpadding="5" border="0" align="center">
<tr>
<td colspan="2">
<h4><?php print_string('auth_cas_server_settings', 'auth') ?> </h4>
</td>
</tr>
<tr valign="top" class="required">
<td align="right"><?php print_string('auth_cas_use_cas', 'auth') ?>:</td>
<td>
<?php
unset($options);
$options[1] = get_string('yes');
choose_from_menu ($options, 'use_cas', $config->use_cas, get_string('no'), '', '');
?>
</td>
<td><?php print_string('auth_cas_enabled', 'auth') ?></td>
</tr>
<tr valign="top" class="required">
<td align="right"><?php print_string('auth_cas_hostname_key', 'auth') ?>:</td>
<td>
<input name="hostname" type="text" size="30" value="<?php echo $config->hostname ?>" />
<?php
if (isset($err['hostname'])) {
formerr($err['hostname']);
}
?>
</td>
<td><?php print_string('auth_cas_hostname', 'auth') ?></td>
</tr>
<tr valign="top" class="required">
<td align="right"><?php print_string('auth_cas_baseuri_key', 'auth') ?>:</td>
<td>
<input name="baseuri" type="text" size="30" value="<?php echo $config->baseuri ?>" />
<?php
if (isset($err['baseuri'])) {
formerr($err['baseuri']);
}
?>
</td>
<td><?php print_string('auth_cas_baseuri', 'auth') ?></td>
</tr>
<tr valign="top" class="required">
<td align="right"><?php print_string('auth_cas_port_key', 'auth') ?>:</td>
<td>
<input name="port" type="text" size="30" value="<?php echo $config->port ?>" />
<?php
if (isset($err['port'])) {
formerr($err['port']);
}
?>
</td>
<td><?php print_string('auth_cas_port', 'auth') ?></td>
</tr>
<tr valign="top" class="required">
<td align="right"><?php print_string('auth_cas_casversion', 'auth') ?>:</td>
<td>
<input name="casversion" type="text" size="30" value="<?php echo $config->casversion ?>" />
<?php
if (isset($err['casversion'])) {
formerr($err['casversion']);
}
?>
</td>
<td><?php print_string('auth_cas_version', 'auth') ?></td>
</tr>
<tr valign="top" class="required">
<td align="right"><?php print_string('auth_cas_language_key', 'auth') ?>:</td>
<td>
<?php
choose_from_menu($CASLANGUAGES, 'language', $config->language, '');
?>
</td>
<td><?php print_string('auth_cas_language', 'auth') ?></td>
</tr>
<tr valign="top" class="required">
<td align="right"><?php print_string('auth_cas_proxycas_key', 'auth') ?>:</td>
<td>
<?php
unset($options);
$options[1] = get_string('yes');
choose_from_menu ($options, 'proxycas', $config->proxycas, get_string('no'), '', '');
?>
</td>
<td><?php print_string('auth_cas_proxycas', 'auth') ?></td>
</tr>
<tr valign="top" class="required">
<td align="right"><?php print_string('auth_cas_logoutcas_key', 'auth') ?>:</td>
<td>
<?php
unset($options);
$options[1] = get_string('yes');
choose_from_menu ($options, 'logoutcas', $config->logoutcas, get_string('no'), '', '');
?>
</td>
<td><?php print_string('auth_cas_logoutcas', 'auth') ?></td>
</tr>
<tr valign="top" class="required">
<td align="right"><?php print_string('auth_cas_multiauth_key', 'auth') ?>:</td>
<td>
<?php
unset($options);
$options[1] = get_string('yes');
choose_from_menu ($options, 'multiauth', $config->multiauth, get_string('no'), '', '');
?>
</td>
<td><?php print_string('auth_cas_multiauth', 'auth') ?></td>
</tr>
<tr>
<td colspan="2">
<h4><?php print_string('auth_ldap_server_settings', 'auth') ?> </h4>
</td>
</tr>
<tr valign="top" class="required">
<td align="right"><label for="host_url"><?php print_string('auth_ldap_host_url_key','auth') ?></label></td>
<td>
<input name="host_url" id="host_url" type="text" size="30" value="<?php echo $config->host_url?>" />
<?php if (isset($err['host_url'])) formerr($err['host_url']); ?>
</td>
<td>
<?php print_string('auth_ldap_host_url','auth') ?>
</td>
</tr>
<tr valign="top" class="required">
<td align="right"><label for="menuversion"><?php print_string('auth_ldap_version_key','auth') ?></label></td>
<td>
<?php
$versions = array();
$versions[2] = '2';
$versions[3] = '3';
choose_from_menu($versions, 'version', $config->version, '');
if (isset($err['version'])) formerr($err['version']);
?>
</td>
<td>
<?php print_string('auth_ldap_version','auth') ?>
</td>
</tr>
<tr valign="top" class="required">
<td align="right"><label for="ldapencoding"><?php print_string("auth_ldap_ldap_encoding_key", "auth") ?></label></td>
<td>
<input id="ldapencoding" name="ldapencoding" type="text" value="<?php echo $config->ldapencoding ?>" />
<?php
if (isset($err['ldapencoding'])) {
formerr($err['ldapencoding']);
}
?>
</td>
<td><?php print_string('auth_ldap_ldap_encoding', 'auth') ?></td>
</tr>
<tr>
<td colspan="2">
<h4><?php print_string('auth_ldap_bind_settings', 'auth') ?> </h4>
</td>
</tr>
<tr valign="top" class="required">
<td align="right"><label for="bind_dn"><?php print_string('auth_ldap_bind_dn_key','auth') ?></label></td>
<td>
<input name="bind_dn" id="bind_dn" type="text" size="30" value="<?php echo $config->bind_dn?>" />
<?php if (isset($err['bind_dn'])) formerr($err['bind_dn']); ?>
</td><td>
<?php print_string('auth_ldap_bind_dn','auth') ?>
</td>
</tr>
<tr valign="top" class="required">
<td align="right"><label for="bind_pw"><?php print_string('auth_ldap_bind_pw_key','auth') ?></label></td>
<td>
<input name="bind_pw" id="bind_pw" type="password" size="30" value="<?php echo $config->bind_pw?>" />
<?php if (isset($err['bind_pw'])) formerr($err['bind_pw']); ?>
</td><td>
<?php print_string('auth_ldap_bind_pw','auth') ?>
</td>
</tr>
<tr>
<td colspan="2">
<h4><?php print_string('auth_ldap_user_settings', 'auth') ?> </h4>
</td>
</tr>
<tr valign="top" class="required">
<td align="right"><label for="menuuser_type"><?php print_string('auth_ldap_user_type_key','auth') ?></label></td>
<td>
<?php choose_from_menu($this->ldap_suppported_usertypes(), 'user_type', $config->user_type, ''); ?>
<?php if (isset($err['user_type'])) formerr($err['user_type']); ?>
</td>
<td>
<?php print_string('auth_ldap_user_type', 'auth') ?>
</td>
</tr>
<tr valign="top" class="required">
<td align="right"><label for="contexts"><?php print_string('auth_ldap_contexts_key','auth') ?></label></td>
<td>
<input name="contexts" id="contexts" type="text" size="30" value="<?php echo $config->contexts?>" />
<?php if (isset($err['contexts'])) formerr($err['contexts']); ?>
</td>
<td>
<?php print_string('auth_ldap_contexts', 'auth') ?>
</td>
</tr>
<tr valign="top" class="required">
<td align="right"><label for="menusearch_sub"><?php print_string('auth_ldap_search_sub_key','auth') ?></label></td>
<td>
<?php choose_from_menu($yesno, 'search_sub', $config->search_sub, ''); ?>
</td>
<td>
<?php print_string('auth_ldap_search_sub','auth') ?>
</td>
</tr>
<tr valign="top" class="required">
<td align="right"><label for="menuopt_deref"><?php print_string('auth_ldap_opt_deref_key','auth') ?></label></td>
<td>
<?php
$opt_deref = array();
$opt_deref[LDAP_DEREF_NEVER] = get_string('no');
$opt_deref[LDAP_DEREF_ALWAYS] = get_string('yes');
choose_from_menu($opt_deref, 'opt_deref', $config->opt_deref, LDAP_DEREF_NEVER, '');
if (isset($err['opt_deref'])) formerr($err['opt_deref']);
?>
</td>
<td>
<?php print_string('auth_ldap_opt_deref','auth') ?>
</td>
</tr>
<tr valign="top" class="required">
<td align="right"><label for="user_attribute"><?php print_string('auth_ldap_user_attribute_key','auth') ?></label></td>
<td>
<input name="user_attribute" id="user_attribute" type="text" size="30" value="<?php echo $config->user_attribute?>" />
<?php if (isset($err['user_attribute'])) formerr($err['user_attribute']); ?>
</td>
<td>
<?php print_string('auth_ldap_user_attribute','auth') ?>
</td>
</tr>
<tr valign="top" class="required">
<td align="right"><label for="memberattribute"><?php print_string('auth_ldap_memberattribute_key','auth') ?></label></td>
<td>
<input name="memberattribute" id="memberattribute" type="text" size="30" value="<?php echo $config->memberattribute?>" />
<?php if (isset($err['memberattribute'])) formerr($err['memberattribute']); ?>
</td><td>
<?php print_string('auth_ldap_memberattribute','auth') ?>
</td>
</tr>
<tr valign="top" class="required">
<td align="right"><label for="memberattribute_isdn"><?php print_string('auth_ldap_memberattribute_isdn_key','auth') ?></label></td>
<td>
<input name="memberattribute_isdn" id="memberattribute_isdn" type="text" size="30" value="<?php echo $config->memberattribute_isdn?>" />
<?php if (isset($err['memberattribute_isdn'])) formerr($err['memberattribute_isdn']); ?>
</td><td>
<?php print_string('auth_ldap_memberattribute_isdn','auth') ?>
</td>
</tr>
<tr valign="top" class="required">
<td align="right"><label for="objectclass"><?php print_string('auth_ldap_objectclass_key','auth') ?></label></td>
<td>
<input name="objectclass" id="objectclass" type="text" size="30" value="<?php echo $config->objectclass?>" />
<?php if (isset($err['objectclass'])) formerr($err['objectclass']); ?>
</td>
<td>
<?php print_string('auth_ldap_objectclass','auth') ?>
</td>
</tr>
<tr>
<td colspan="2">
<h4><?php print_string('coursecreators') ?> </h4>
</td>
</tr>
<tr valign="top" class="required">
<td align="right"><label for="attrcreators_key"><?php print_string('auth_ldap_attrcreators_key','auth') ?></label></td>
<td>
<input name="attrcreators" id="attrcreators" type="text" size="30" value="<?php echo $config->attrcreators?>" />
<?php if (isset($err['attrcreators'])) formerr($err['attrcreators']); ?>
</td><td>
<?php print_string('auth_ldap_attrcreators','auth') ?>
</td>
</tr>
<tr valign="top" class="required">
<td align="right"><label for="groupecreators_key"><?php print_string('auth_ldap_groupecreators_key','auth') ?></label></td>
<td>
<input name="groupecreators" id="groupecreators" type="text" size="30" value="<?php echo $config->groupecreators?>" />
<?php if (isset($err['groupecreators'])) formerr($err['groupecreators']); ?>
</td><td>
<?php print_string('auth_ldap_groupecreators','auth') ?>
</td>
</tr>
<tr>
<td colspan="2">
<h4><?php print_string('auth_sync_script', 'auth') ?> </h4>
</td>
</tr>
<tr valign="top">
<td align="right"><label for="menuremoveuser"><?php print_string('auth_remove_user_key','auth') ?></label></td>
<td>
<?php
$deleteopt = array();
$deleteopt['0'] = get_string('auth_remove_keep','auth');
$deleteopt['1'] = get_string('auth_remove_suspend','auth');
$deleteopt['2'] = get_string('auth_remove_delete','auth');
choose_from_menu($deleteopt, 'removeuser', $config->removeuser, '');
?>
</td>
<td>
<?php print_string('auth_remove_user','auth') ?>
</td>
</tr>
</table>
<?php
$help = get_string('auth_ldapextrafields','auth');
$help .= get_string('auth_updatelocal_expl','auth');
$help .= get_string('auth_fieldlock_expl','auth');
$help .= get_string('auth_updateremote_expl','auth');
$help .= '<hr />';
$help .= get_string('auth_updateremote_ldap','auth');
print_auth_lock_options('cas', $user_fields, $help, true, true);
?>
<?php
global $CFG;
require_once 'languages.php';
$createoptions[0] = get_string("no");
$createoptions[1] = get_string("yes");
// set to defaults if undefined (CAS)
if (!isset ($config->hostname))
$config->hostname = '';
if (!isset ($config->port))
$config->port = '';
if (!isset ($config->casversion))
$config->casversion = '';
if (!isset ($config->baseuri))
$config->baseuri = '';
if (!isset ($config->language))
$config->language = '';
if (!isset ($config->use_cas))
$config->use_cas = '';
if (!isset ($config->proxycas))
$config->proxycas = '';
if (!isset ($config->logoutcas))
$config->logoutcas = '';
if (!isset ($config->multiauth))
$config->multiauth = '';
// set to defaults if undefined (LDAP)
if (!isset($config->host_url))
{ $config->host_url = ''; }
if (empty($config->ldapencoding))
{ $config->ldapencoding = 'utf-8'; }
if (!isset($config->contexts))
{ $config->contexts = ''; }
if (!isset($config->user_type))
{ $config->user_type = 'default'; }
if (!isset($config->user_attribute))
{ $config->user_attribute = ''; }
if (!isset($config->search_sub))
{ $config->search_sub = ''; }
if (!isset($config->opt_deref))
{ $config->opt_deref = LDAP_DEREF_NEVER; }
if (!isset($config->bind_dn))
{$config->bind_dn = ''; }
if (!isset($config->bind_pw))
{$config->bind_pw = ''; }
if (!isset($config->version))
{$config->version = '2'; }
if (!isset($config->objectclass))
{$config->objectclass = ''; }
if (!isset($config->memberattribute))
{$config->memberattribute = ''; }
if (!isset($config->memberattribute_isdn))
{$config->memberattribute_isdn = ''; }
if (!isset($config->groupecreators))
{$config->groupecreators = ''; }
if (!isset($config->attrcreators))
{$config->attrcreators = ''; }
if (!isset($config->removeuser))
{$config->removeuser = 0; }
$yesno = array( get_string('no'), get_string('yes') );
if (!function_exists('ldap_connect')) { // Is php4-ldap really there?
notify(get_string('auth_ldap_noextension','auth'));
}
?>
<table cellspacing="0" cellpadding="5" border="0" align="center">
<tr>
<td colspan="2">
<h4><?php print_string('auth_cas_server_settings', 'auth') ?> </h4>
</td>
</tr>
<tr valign="top" class="required">
<td align="right"><?php print_string('auth_cas_use_cas', 'auth') ?>:</td>
<td>
<?php
unset($options);
$options[1] = get_string('yes');
choose_from_menu ($options, 'use_cas', $config->use_cas, get_string('no'), '', '');
?>
</td>
<td><?php print_string('auth_cas_enabled', 'auth') ?></td>
</tr>
<tr valign="top" class="required">
<td align="right"><?php print_string('auth_cas_hostname_key', 'auth') ?>:</td>
<td>
<input name="hostname" type="text" size="30" value="<?php echo $config->hostname ?>" />
<?php
if (isset($err['hostname'])) {
formerr($err['hostname']);
}
?>
</td>
<td><?php print_string('auth_cas_hostname', 'auth') ?></td>
</tr>
<tr valign="top" class="required">
<td align="right"><?php print_string('auth_cas_baseuri_key', 'auth') ?>:</td>
<td>
<input name="baseuri" type="text" size="30" value="<?php echo $config->baseuri ?>" />
<?php
if (isset($err['baseuri'])) {
formerr($err['baseuri']);
}
?>
</td>
<td><?php print_string('auth_cas_baseuri', 'auth') ?></td>
</tr>
<tr valign="top" class="required">
<td align="right"><?php print_string('auth_cas_port_key', 'auth') ?>:</td>
<td>
<input name="port" type="text" size="30" value="<?php echo $config->port ?>" />
<?php
if (isset($err['port'])) {
formerr($err['port']);
}
?>
</td>
<td><?php print_string('auth_cas_port', 'auth') ?></td>
</tr>
<tr valign="top" class="required">
<td align="right"><?php print_string('auth_cas_casversion', 'auth') ?>:</td>
<td>
<input name="casversion" type="text" size="30" value="<?php echo $config->casversion ?>" />
<?php
if (isset($err['casversion'])) {
formerr($err['casversion']);
}
?>
</td>
<td><?php print_string('auth_cas_version', 'auth') ?></td>
</tr>
<tr valign="top" class="required">
<td align="right"><?php print_string('auth_cas_language_key', 'auth') ?>:</td>
<td>
<?php
choose_from_menu($CASLANGUAGES, 'language', $config->language, '');
?>
</td>
<td><?php print_string('auth_cas_language', 'auth') ?></td>
</tr>
<tr valign="top" class="required">
<td align="right"><?php print_string('auth_cas_proxycas_key', 'auth') ?>:</td>
<td>
<?php
unset($options);
$options[1] = get_string('yes');
choose_from_menu ($options, 'proxycas', $config->proxycas, get_string('no'), '', '');
?>
</td>
<td><?php print_string('auth_cas_proxycas', 'auth') ?></td>
</tr>
<tr valign="top" class="required">
<td align="right"><?php print_string('auth_cas_logoutcas_key', 'auth') ?>:</td>
<td>
<?php
unset($options);
$options[1] = get_string('yes');
choose_from_menu ($options, 'logoutcas', $config->logoutcas, get_string('no'), '', '');
?>
</td>
<td><?php print_string('auth_cas_logoutcas', 'auth') ?></td>
</tr>
<tr valign="top" class="required">
<td align="right"><?php print_string('auth_cas_multiauth_key', 'auth') ?>:</td>
<td>
<?php
unset($options);
$options[1] = get_string('yes');
choose_from_menu ($options, 'multiauth', $config->multiauth, get_string('no'), '', '');
?>
</td>
<td><?php print_string('auth_cas_multiauth', 'auth') ?></td>
</tr>
<tr>
<td colspan="2">
<h4><?php print_string('auth_ldap_server_settings', 'auth') ?> </h4>
</td>
</tr>
<tr valign="top" class="required">
<td align="right"><label for="host_url"><?php print_string('auth_ldap_host_url_key','auth') ?></label></td>
<td>
<input name="host_url" id="host_url" type="text" size="30" value="<?php echo $config->host_url?>" />
<?php if (isset($err['host_url'])) formerr($err['host_url']); ?>
</td>
<td>
<?php print_string('auth_ldap_host_url','auth') ?>
</td>
</tr>
<tr valign="top" class="required">
<td align="right"><label for="menuversion"><?php print_string('auth_ldap_version_key','auth') ?></label></td>
<td>
<?php
$versions = array();
$versions[2] = '2';
$versions[3] = '3';
choose_from_menu($versions, 'version', $config->version, '');
if (isset($err['version'])) formerr($err['version']);
?>
</td>
<td>
<?php print_string('auth_ldap_version','auth') ?>
</td>
</tr>
<tr valign="top" class="required">
<td align="right"><label for="ldapencoding"><?php print_string("auth_ldap_ldap_encoding_key", "auth") ?></label></td>
<td>
<input id="ldapencoding" name="ldapencoding" type="text" value="<?php echo $config->ldapencoding ?>" />
<?php
if (isset($err['ldapencoding'])) {
formerr($err['ldapencoding']);
}
?>
</td>
<td><?php print_string('auth_ldap_ldap_encoding', 'auth') ?></td>
</tr>
<tr>
<td colspan="2">
<h4><?php print_string('auth_ldap_bind_settings', 'auth') ?> </h4>
</td>
</tr>
<tr valign="top" class="required">
<td align="right"><label for="bind_dn"><?php print_string('auth_ldap_bind_dn_key','auth') ?></label></td>
<td>
<input name="bind_dn" id="bind_dn" type="text" size="30" value="<?php echo $config->bind_dn?>" />
<?php if (isset($err['bind_dn'])) formerr($err['bind_dn']); ?>
</td><td>
<?php print_string('auth_ldap_bind_dn','auth') ?>
</td>
</tr>
<tr valign="top" class="required">
<td align="right"><label for="bind_pw"><?php print_string('auth_ldap_bind_pw_key','auth') ?></label></td>
<td>
<input name="bind_pw" id="bind_pw" type="password" size="30" value="<?php echo $config->bind_pw?>" />
<?php if (isset($err['bind_pw'])) formerr($err['bind_pw']); ?>
</td><td>
<?php print_string('auth_ldap_bind_pw','auth') ?>
</td>
</tr>
<tr>
<td colspan="2">
<h4><?php print_string('auth_ldap_user_settings', 'auth') ?> </h4>
</td>
</tr>
<tr valign="top" class="required">
<td align="right"><label for="menuuser_type"><?php print_string('auth_ldap_user_type_key','auth') ?></label></td>
<td>
<?php choose_from_menu($this->ldap_suppported_usertypes(), 'user_type', $config->user_type, ''); ?>
<?php if (isset($err['user_type'])) formerr($err['user_type']); ?>
</td>
<td>
<?php print_string('auth_ldap_user_type', 'auth') ?>
</td>
</tr>
<tr valign="top" class="required">
<td align="right"><label for="contexts"><?php print_string('auth_ldap_contexts_key','auth') ?></label></td>
<td>
<input name="contexts" id="contexts" type="text" size="30" value="<?php echo $config->contexts?>" />
<?php if (isset($err['contexts'])) formerr($err['contexts']); ?>
</td>
<td>
<?php print_string('auth_ldap_contexts', 'auth') ?>
</td>
</tr>
<tr valign="top" class="required">
<td align="right"><label for="menusearch_sub"><?php print_string('auth_ldap_search_sub_key','auth') ?></label></td>
<td>
<?php choose_from_menu($yesno, 'search_sub', $config->search_sub, ''); ?>
</td>
<td>
<?php print_string('auth_ldap_search_sub','auth') ?>
</td>
</tr>
<tr valign="top" class="required">
<td align="right"><label for="menuopt_deref"><?php print_string('auth_ldap_opt_deref_key','auth') ?></label></td>
<td>
<?php
$opt_deref = array();
$opt_deref[LDAP_DEREF_NEVER] = get_string('no');
$opt_deref[LDAP_DEREF_ALWAYS] = get_string('yes');
choose_from_menu($opt_deref, 'opt_deref', $config->opt_deref, LDAP_DEREF_NEVER, '');
if (isset($err['opt_deref'])) formerr($err['opt_deref']);
?>
</td>
<td>
<?php print_string('auth_ldap_opt_deref','auth') ?>
</td>
</tr>
<tr valign="top" class="required">
<td align="right"><label for="user_attribute"><?php print_string('auth_ldap_user_attribute_key','auth') ?></label></td>
<td>
<input name="user_attribute" id="user_attribute" type="text" size="30" value="<?php echo $config->user_attribute?>" />
<?php if (isset($err['user_attribute'])) formerr($err['user_attribute']); ?>
</td>
<td>
<?php print_string('auth_ldap_user_attribute','auth') ?>
</td>
</tr>
<tr valign="top" class="required">
<td align="right"><label for="memberattribute"><?php print_string('auth_ldap_memberattribute_key','auth') ?></label></td>
<td>
<input name="memberattribute" id="memberattribute" type="text" size="30" value="<?php echo $config->memberattribute?>" />
<?php if (isset($err['memberattribute'])) formerr($err['memberattribute']); ?>
</td><td>
<?php print_string('auth_ldap_memberattribute','auth') ?>
</td>
</tr>
<tr valign="top" class="required">
<td align="right"><label for="memberattribute_isdn"><?php print_string('auth_ldap_memberattribute_isdn_key','auth') ?></label></td>
<td>
<input name="memberattribute_isdn" id="memberattribute_isdn" type="text" size="30" value="<?php echo $config->memberattribute_isdn?>" />
<?php if (isset($err['memberattribute_isdn'])) formerr($err['memberattribute_isdn']); ?>
</td><td>
<?php print_string('auth_ldap_memberattribute_isdn','auth') ?>
</td>
</tr>
<tr valign="top" class="required">
<td align="right"><label for="objectclass"><?php print_string('auth_ldap_objectclass_key','auth') ?></label></td>
<td>
<input name="objectclass" id="objectclass" type="text" size="30" value="<?php echo $config->objectclass?>" />
<?php if (isset($err['objectclass'])) formerr($err['objectclass']); ?>
</td>
<td>
<?php print_string('auth_ldap_objectclass','auth') ?>
</td>
</tr>
<tr>
<td colspan="2">
<h4><?php print_string('coursecreators') ?> </h4>
</td>
</tr>
<tr valign="top" class="required">
<td align="right"><label for="attrcreators_key"><?php print_string('auth_ldap_attrcreators_key','auth') ?></label></td>
<td>
<input name="attrcreators" id="attrcreators" type="text" size="30" value="<?php echo $config->attrcreators?>" />
<?php if (isset($err['attrcreators'])) formerr($err['attrcreators']); ?>
</td><td>
<?php print_string('auth_ldap_attrcreators','auth') ?>
</td>
</tr>
<tr valign="top" class="required">
<td align="right"><label for="groupecreators_key"><?php print_string('auth_ldap_groupecreators_key','auth') ?></label></td>
<td>
<input name="groupecreators" id="groupecreators" type="text" size="30" value="<?php echo $config->groupecreators?>" />
<?php if (isset($err['groupecreators'])) formerr($err['groupecreators']); ?>
</td><td>
<?php print_string('auth_ldap_groupecreators','auth') ?>
</td>
</tr>
<tr>
<td colspan="2">
<h4><?php print_string('auth_sync_script', 'auth') ?> </h4>
</td>
</tr>
<tr valign="top">
<td align="right"><label for="menuremoveuser"><?php print_string('auth_remove_user_key','auth') ?></label></td>
<td>
<?php
$deleteopt = array();
$deleteopt['0'] = get_string('auth_remove_keep','auth');
$deleteopt['1'] = get_string('auth_remove_suspend','auth');
$deleteopt['2'] = get_string('auth_remove_delete','auth');
choose_from_menu($deleteopt, 'removeuser', $config->removeuser, '');
?>
</td>
<td>
<?php print_string('auth_remove_user','auth') ?>
</td>
</tr>
<?php
$help = get_string('auth_ldapextrafields','auth');
$help .= get_string('auth_updatelocal_expl','auth');
$help .= get_string('auth_fieldlock_expl','auth');
$help .= get_string('auth_updateremote_expl','auth');
$help .= '<hr />';
$help .= get_string('auth_updateremote_ldap','auth');
print_auth_lock_options('cas', $user_fields, $help, true, true);
?>
</table>
+4 -2
View File
@@ -1216,7 +1216,8 @@ class auth_plugin_ldap extends auth_plugin_base {
$sec=substr($time,12,2);
$result = mktime($hr,$min,$sec,$mo,$dt,$yr);
break;
case 'posix':
case 'rfc2307':
case 'rfc2307bis':
$result = $time * DAYSECS; //The shadowExpire contains the number of DAYS between 01/01/1970 and the actual expiration date
break;
case 'ad':
@@ -1239,7 +1240,8 @@ class auth_plugin_ldap extends auth_plugin_base {
case 'edir':
$result=date('YmdHis', $time).'Z';
break;
case 'posix':
case 'rfc2307':
case 'rfc2307bis':
$result = $time ; //Already in correct format
break;
default:
+1 -1
View File
@@ -68,7 +68,7 @@ class auth_plugin_pam extends auth_plugin_base {
// call_time_pass_reference of errormessage is deprecated - throws warnings in multiauth
//if (pam_auth($username, $password, &$errormessage)) {
if (pam_auth(stripslashes($username), strislashes($password))) {
if (pam_auth(stripslashes($username), stripslashes($password))) {
return true;
}
else {
+13 -4
View File
@@ -153,6 +153,13 @@
$restore->course_id=$course_id;
}
}
// pass in the course category param
$cat_id = optional_param('restore_restorecatto', 0, PARAM_INT);
if ($cat_id) {
$restore->restore_restorecatto = $cat_id;
}
//We have the object with data, put it in the session
$SESSION->restore = $restore;
@@ -189,7 +196,7 @@
// 2-New course: Create the restore object and launch the execute.
//If the user is a teacher and not a creator
if (!has_capability('moodle/course:create', get_context_instance(CONTEXT_SYSTEM, SITEID))) {
if (!user_can_create_courses()) {
$restore->course_id = $id;
if ($restore->restoreto == 0) {
$restore->deleting = true;
@@ -199,7 +206,8 @@
}
//If the user is a creator (or admin)
if (has_capability('moodle/course:create', get_context_instance(CONTEXT_SYSTEM, SITEID))) {
//if (has_capability('moodle/course:create', get_context_instance(CONTEXT_SYSTEM, SITEID))) {
if (user_can_create_courses()) {
//Set restore->deleting as needed
if ($restore->restoreto == 0) {
$restore->deleting = true;
@@ -209,7 +217,8 @@
}
//Now, select the course if needed
if (($restore->restoreto == 0 or $restore->restoreto == 1) and ($restore->course_id == 0) and has_capability('moodle/course:create', get_context_instance(CONTEXT_SYSTEM, SITEID))) {
//if (($restore->restoreto == 0 or $restore->restoreto == 1) and ($restore->course_id == 0) and get_capability_courses('moodle/site:restore')) {
if (($restore->restoreto == 0 or $restore->restoreto == 1) and ($restore->course_id == 0)) {
if ($courses = get_courses("all","c.fullname","c.id,c.fullname,c.shortname,c.visible")) {
print_heading(get_string("choosecourse"));
print_simple_box_start("center");
@@ -232,7 +241,7 @@
//Checks everything and execute restore
} else if ((($restore->restoreto == 0 or $restore->restoreto == 1) and ($restore->course_id != 0)) or ($restore->restoreto == 2)) {
//Final access control check
if ($restore->course_id == 0 and !has_capability('moodle/course:create', get_context_instance(CONTEXT_SYSTEM, SITEID))) {
if ($restore->course_id == 0 and !user_can_create_courses()) {
error("You need to be a creator or admin to restore into new course!");
} else if ($restore->course_id != 0 and !has_capability('moodle/site:backup', get_context_instance(CONTEXT_COURSE, $restore->course_id))) {
error("You need to be an edit teacher or admin to restore into selected course!");
+41 -8
View File
@@ -92,10 +92,9 @@
}
if (!isset($restore_restoreto)) {
if (!has_capability('moodle/site:restore', get_context_instance(CONTEXT_SYSTEM, SITEID))) {
if (!user_can_create_courses()) {
$restore_restoreto = 1;
}
if (has_capability('moodle/site:restore', get_context_instance(CONTEXT_SYSTEM, SITEID))) {
} else {
$restore_restoreto = 2;
}
}
@@ -171,18 +170,52 @@ function selectItemInCheckboxByName(formId, checkName, checked ) {
echo get_string("restoreto").":</b>";
echo "</td><td colspan=\"3\">";
if (has_capability('moodle/course:create', get_context_instance(CONTEXT_SYSTEM, SITEID))) {
// permission should have been checked already
/**
* if user has manageactivities in any course, we show
* existingcoursedeleting
* existingcourseadding
* else we show
* currentcoursedeleting
* currentcourse
* if user has course:create in any category, we show
* newcourse
*/
$mycourses = get_capability_courses('moodle/site:restore');
// if the user can manage 2 or more courses,
// or if the only course the user can manage is not the current course
// we show options for existing courses
if (count($mycourses) > 1 || !in_array($id, $mycourses)) {
// if user can manage more than 1 course, or if user can restore to a single different course
$restore_restoreto_options[0] = get_string("existingcoursedeleting");
$restore_restoreto_options[1] = get_string("existingcourseadding");
$restore_restoreto_options[2] = get_string("newcourse");
} else { // fix for MDL-7773
// else if the user can write to current course
} else if (has_capability('moodle/site:restore', get_context_instance(CONTEXT_COURSE, $id))){
$restore_restoreto_options[0] = get_string("currentcoursedeleting");
$restore_restoreto_options[1] = get_string("currentcourseadding");
$restore_restoreto_options[1] = get_string("currentcourseadding");
}
// if user can create any course at all, give the option
if (user_can_create_courses()) {
$restore_restoreto_options[2] = get_string("newcourse");
}
choose_from_menu($restore_restoreto_options, "restore_restoreto", $restore_restoreto, "");
echo "</td></tr>";
if (iscreator()) { //display these fields conditionally
if (user_can_create_courses()) { //display these fields conditionally
// find the list of cates user can edit
echo "<tr valign=\"top\" >";
echo "<td align=\"right\">";
print_string('category');
echo " :</td>";
echo "<td>";
choose_from_menu(get_creatable_categories(), "restore_restorecatto", $course_header->category->id, "");
echo "</td>";
echo "</tr>";
echo "<tr valign=\"top\" >";
echo "<td align=\"right\">";
print_string("shortname");
+24 -10
View File
@@ -533,8 +533,18 @@
$course_header->course_shortname = $currentshortname;
//Now calculate the category
$category = get_record("course_categories","id",$course_header->category->id,
"name",addslashes($course_header->category->name));
// first try to get it from restore
if ($restore->restore_restorecatto) {
$category = get_record('course_categories', 'id', $restore->restore_restorecatto);
}
// else we try to get it from the xml file
//Now calculate the category
if (!$category) {
$category = get_record("course_categories","id",$course_header->category->id,
"name",addslashes($course_header->category->name));
}
//If no exists, try by name only
if (!$category) {
$category = get_record("course_categories","name",addslashes($course_header->category->name));
@@ -935,14 +945,18 @@
// Yu: This part is called repeatedly for every instance,
// so it is necessary to set the granular flag and check isset()
// when the first instance of this type of mod is processed.
if (!isset($restore->mods[$mod->type]->granular) && isset($restore->mods[$mod->type]->instances) && is_array($restore->mods[$mod->type]->instances)) {
// This defines whether we want to restore specific
// instances of the modules (granular restore), or
// whether we don't care and just want to restore
// all module instances (non-granular).
$restore->mods[$mod->type]->granular = true;
} else {
$restore->mods[$mod->type]->granular = false;
//if (!isset($restore->mods[$mod->type]->granular) && isset($restore->mods[$mod->type]->instances) && is_array($restore->mods[$mod->type]->instances)) {
if (!isset($restore->mods[$mod->type]->granular)) {
if (isset($restore->mods[$mod->type]->instances) && is_array($restore->mods[$mod->type]->instances)) {
// This defines whether we want to restore specific
// instances of the modules (granular restore), or
// whether we don't care and just want to restore
// all module instances (non-granular).
$restore->mods[$mod->type]->granular = true;
} else {
$restore->mods[$mod->type]->granular = false;
}
}
//Check if we've to restore this module (and instance)
-20
View File
@@ -633,24 +633,4 @@ function calendar_add_event_allowed($event) {
return false;
}
}
function calendar_get_allowed_types(&$allowed) {
global $USER, $CFG, $SESSION;
$allowed->user = true; // User events always allowed
$allowed->groups = false; // This may change just below
$allowed->courses = false; // This may change just below
$allowed->site = has_capability('moodle/calendar:manageentries', get_context_instance(CONTEXT_COURSE, SITEID));
if(!empty($SESSION->cal_course_referer) && $SESSION->cal_course_referer != SITEID && has_capability('moodle/calendar:manageentries', get_context_instance(CONTEXT_COURSE, $SESSION->cal_course_referer))) {
$course = get_record('course', 'id', $SESSION->cal_course_referer);
$allowed->courses = array($course->id => 1);
if($course->groupmode != NOGROUPS || !$course->groupmodeforce) {
$allowed->groups = get_groups($SESSION->cal_course_referer);
}
}
}
?>
+2 -2
View File
@@ -3,13 +3,13 @@
<form method="get" action="export_execute.php">
<?php print_string('iwanttoexport', 'calendar'); ?>:
<div class="indent">
<input type="radio" name="preset_what" id="pw_all" value="all" /><label for="pw_all"><?php print_string('eventsall', 'calendar'); ?></label><br />
<input type="radio" name="preset_what" id="pw_all" value="all" checked="checked"/><label for="pw_all"><?php print_string('eventsall', 'calendar'); ?></label><br />
<input type="radio" name="preset_what" id="pw_course" value="courses" /><label for="pw_course"><?php print_string('eventsrelatedtocourses', 'calendar'); ?></label><br />
</div>
<?php print_string('for', 'calendar'); ?>:
<div class="indent">
<?php if($allowthisweek) { ?>
<input type="radio" name="preset_time" id="pt_wknow" value="weeknow" /><label for="pt_wknow"><?php print_string('weekthis', 'calendar'); ?></label><br />
<input type="radio" name="preset_time" id="pt_wknow" value="weeknow" checked="checked"/><label for="pt_wknow"><?php print_string('weekthis', 'calendar'); ?></label><br />
<?php } ?>
<?php if($allownextweek) { ?>
<input type="radio" name="preset_time" id="pt_wknext" value="weeknext" /><label for="pt_wknext"><?php print_string('weeknext', 'calendar'); ?></label><br />
+3 -3
View File
@@ -19,8 +19,8 @@ if ($authtoken != sha1($username . $user->password)) {
die('Invalid authentication token');
}
$what = optional_param('preset_what', '', PARAM_ALPHA);
$time = optional_param('preset_time', '', PARAM_ALPHA);
$what = optional_param('preset_what', 'all', PARAM_ALPHA);
$time = optional_param('preset_time', 'weeknow', PARAM_ALPHA);
$now = usergetdate(time());
// Let's see if we have sufficient and correct data
@@ -37,7 +37,7 @@ if(!empty($what) && !empty($time)) {
$courses[SITEID] = new stdClass;
$courses[SITEID]->shortname = get_string('globalevents', 'calendar');
}
switch($time) {
case 'weeknow':
$startweekday = get_user_preferences('calendar_startwday', CALENDAR_STARTING_WEEKDAY);
+28
View File
@@ -1401,4 +1401,32 @@ function calendar_set_filters_status($packed_bitfield) {
return true;
}
function calendar_get_allowed_types(&$allowed) {
global $USER, $CFG, $SESSION;
$sitecontext = get_context_instance(CONTEXT_SYSTEM);
$allowed->user = has_capability('moodle/calendar:manageownentries', $sitecontext);
$allowed->groups = false; // This may change just below
$allowed->courses = false; // This may change just below
$allowed->site = has_capability('moodle/calendar:manageentries', get_context_instance(CONTEXT_COURSE, SITEID));
if(!empty($SESSION->cal_course_referer) && $SESSION->cal_course_referer != SITEID && has_capability('moodle/calendar:manageentries', get_context_instance(CONTEXT_COURSE, $SESSION->cal_course_referer))) {
$course = get_record('course', 'id', $SESSION->cal_course_referer);
$allowed->courses = array($course->id => 1);
if($course->groupmode != NOGROUPS || !$course->groupmodeforce) {
$allowed->groups = get_groups($SESSION->cal_course_referer);
}
}
}
/**
* see if user can add calendar entries at all
* used to print the "New Event" button
* @return bool
*/
function calendar_user_can_add_event() {
calendar_get_allowed_types($allowed);
return (bool)($allowed->user || $allowed->groups || $allowed->courses || $allowed->site);
}
?>
+3 -3
View File
@@ -227,7 +227,7 @@ function calendar_show_day($d, $m, $y, $courses, $groups, $users) {
$events = calendar_get_upcoming($courses, $groups, $users, 1, 100, $starttime);
$text = '';
if (!isguest() && !empty($USER->id)) {
if (!isguest() && !empty($USER->id) && calendar_user_can_add_event()) {
$text.= '<div class="buttons">';
$text.= '<form action="'.CALENDAR_URL.'event.php" method="get">';
$text.= '<div>';
@@ -359,7 +359,7 @@ function calendar_show_month_detailed($m, $y, $courses, $groups, $users) {
calendar_events_by_day($events, $m, $y, $eventsbyday, $durationbyday, $typesbyday);
$text = '';
if(!isguest() && !empty($USER->id)) {
if(!isguest() && !empty($USER->id) && calendar_user_can_add_event()) {
$text.= '<div class="buttons"><form action="'.CALENDAR_URL.'event.php" method="get">';
$text.= '<div>';
$text.= '<input type="hidden" name="action" value="new" />';
@@ -554,7 +554,7 @@ function calendar_show_upcoming_events($courses, $groups, $users, $futuredays, $
$text = '';
if(!isguest() && !empty($USER->id)) {
if(!isguest() && !empty($USER->id) && calendar_user_can_add_event()) {
$text.= '<div class="buttons">';
$text.= '<form action="'.CALENDAR_URL.'event.php" method="get">';
$text.= '<div>';
+1 -1
View File
@@ -206,7 +206,7 @@
// around. For now, just hide all the dates to avoid confusion.
$weekperiod = '';
} else {
$weekperiod = $weekday.' '.$endweekday;
$weekperiod = $weekday.' - '.$endweekday;
}
+19 -20
View File
@@ -4,15 +4,16 @@
require_once('../../../config.php');
require_once('../../lib.php');
require_once($CFG->dirroot . '/group/lib/basicgrouplib.php');
$mycourseid = required_param('id', PARAM_INT); // Course id
$id = required_param('id', PARAM_INT); // Course id
if (! $course = get_record('course', 'id', $mycourseid) ) {
if (! $course = get_record('course', 'id', $id) ) {
error("That's an invalid course id");
}
require_login($course->id);
$context = get_context_instance(CONTEXT_COURSE, $mycourseid);
$context = get_context_instance(CONTEXT_COURSE, $id);
if (!has_capability('moodle/course:managegroups', $context)) {
@@ -67,9 +68,9 @@
$optional = array("coursename" => 1,
"idnumber" =>1,
"description" => 1,
"password" => 1,
"enrolmentkey" => 1,
"theme" => 1,
"picture" => 1,
"picture" => 1,
"hidepicture" => 1, );
// --- get header (field names) ---
@@ -77,10 +78,12 @@
// check for valid field names
foreach ($header as $i => $h) {
$h = trim($h); $header[$i] = $h; // remove whitespace
if (!($required[$h] or $optionalDefaults[$h] or $optional[$h])) {
if ( !(isset($required[$h]) or
isset($optionalDefaults[$h]) or
isset($optional[$h])) ) {
error(get_string('invalidfieldname', 'error', $h), 'index.php?id='.$id.'&amp;sesskey='.$USER->sesskey);
}
if ($required[$h]) {
if ( isset($required[$h]) ) {
$required[$h] = 2;
}
}
@@ -111,16 +114,12 @@
// add fields to object $user
foreach ($record as $name => $value) {
// check for required values
if ($required[$name] and !$value) {
if (isset($required[$name]) and !$value) {
error(get_string('missingfield', 'error', $name). " ".
get_string('erroronline', 'error', $linenum) .". ".
get_string('processingstops', 'error'),
'uploaduser.php?sesskey='.$USER->sesskey);
}
// password needs to be encrypted
else if ($name == "password") {
$newgroup->password = md5($value);
}
else if ($name == "groupname") {
$newgroup->name = addslashes($value);
}
@@ -133,7 +132,7 @@
//if idnumber is set, we use that.
//unset invalid courseid
if ($newgroup->idnumber){
if (isset($newgroup->idnumber)){
if (!$mycourse = get_record('course', 'idnumber',$newgroup->idnumber)){
notify(get_string('unknowncourseidnumber', 'error', $newgroup->idnumber));
unset($newgroup->courseid);//unset so 0 doesnt' get written to database
@@ -143,7 +142,7 @@
//else use course short name to look up
//unset invalid coursename (if no id)
else if ($newgroup->coursename){
else if (isset($newgroup->coursename)){
if (!$mycourse = get_record('course', 'shortname',$newgroup->coursename)){
notify(get_string('unknowncourse', 'error', $newgroup->coursename));
unset($newgroup->courseid);//unset so 0 doesnt' get written to database
@@ -152,7 +151,7 @@
}
//else juse use current id
else{
$newgroup->courseid = $mycourseid;
$newgroup->courseid = $id;
}
//if courseid is set
@@ -165,20 +164,20 @@
///Users cannot upload groups in courses they cannot update.
if (!has_capability('moodle/course:managegroups', $newgrpcoursecontext)){
notify("$newgroup->name ".get_string('notaddedto').$newgroup->coursename.get_string('notinyourcapacity'));
notify( get_string('nopermissionforcreation','group',$newgroup->name) );
} else {
if (get_record("groups","name",$groupname,"courseid",$newgroup->courseid) || !($newgroup->id = insert_record("groups", $newgroup))) {
if ( $group = groups_group_name_exists($newgroup->courseid, $groupname) || !($newgroup->id = groups_create_group($newgroup->courseid, $newgroup)) ) {
//Record not added - probably because group is already registered
//In this case, output groupname from previous registration
if ($group = get_record("groups","name",$groupname)) {
notify("$newgroup->name ".get_string('groupexistforcourse', 'error', $groupname));
if ($group) {
notify("$newgroup->name :".get_string('groupexistforcourse', 'error', $groupname));
} else {
notify(get_string('groupnotaddederror', 'error', $groupname));
}
}
else {
notify(get_string('group')." $newgroup->name ".get_string('addedsuccessfully'));
notify( get_string('groupaddedsuccesfully', 'group', $newgroup->name) );
}
}
} //close courseid validity check
+9 -6
View File
@@ -1901,20 +1901,23 @@ function print_course_search($value="", $return=false, $format="plain") {
if ($format == 'plain') {
$output = '<form id="'.$id.'" action="'.$CFG->wwwroot.'/course/search.php" method="get">';
$output .= '<fieldset class="coursesearchbox invisiblefieldset">';
$output .= '<input type="text" size="30" name="search" alt="'.s($strsearchcourses).'" value="'.s($value, true).'" />';
$output .= '<input type="submit" value="'.s($strsearchcourses).'" />';
$output .= '<label for="coursesearchbox">'.$strsearchcourses.': </label>';
$output .= '<input type="text" id="coursesearchbox" size="30" name="search" alt="'.s($strsearchcourses).'" value="'.s($value, true).'" />';
$output .= '<input type="submit" value="'.get_string('go').'" />';
$output .= '</fieldset></form>';
} else if ($format == 'short') {
$output = '<form id="'.$id.'" action="'.$CFG->wwwroot.'/course/search.php" method="get">';
$output .= '<fieldset class="coursesearchbox invisiblefieldset">';
$output .= '<input type="text" size="12" name="search" alt="'.s($strsearchcourses).'" value="'.s($value, true).'" />';
$output .= '<input type="submit" value="'.s($strsearchcourses).'" />';
$output .= '<label for="coursesearchbox">'.$strsearchcourses.': </label>';
$output .= '<input type="text" id="coursesearchbox" size="12" name="search" alt="'.s($strsearchcourses).'" value="'.s($value, true).'" />';
$output .= '<input type="submit" value="'.get_string('go').'" />';
$output .= '</fieldset></form>';
} else if ($format == 'navbar') {
$output = '<form id="coursesearchnavbar" action="'.$CFG->wwwroot.'/course/search.php" method="get">';
$output .= '<fieldset class="coursesearchbox invisiblefieldset">';
$output .= '<input type="text" size="20" name="search" alt="'.s($strsearchcourses).'" value="'.s($value, true).'" />';
$output .= '<input type="submit" value="'.s($strsearchcourses).'" />';
$output .= '<label for="coursesearchbox">'.$strsearchcourses.': </label>';
$output .= '<input type="text" id="coursesearchbox" size="20" name="search" alt="'.s($strsearchcourses).'" value="'.s($value, true).'" />';
$output .= '<input type="submit" value="'.get_string('go').'" />';
$output .= '</fieldset></form>';
}
+2 -2
View File
@@ -41,7 +41,7 @@ class enrolment_plugin_authorize
prevent_double_paid($course);
httpsrequired();
if (empty($_SERVER['HTTPS']) || $_SERVER['HTTPS'] == 'off') {
if (isset($_SERVER['SERVER_PORT']) && $_SERVER['SERVER_PORT'] != 443) { // MDL-9836
if (empty($CFG->loginhttps)) {
error(get_string('httpsrequired', 'enrol_authorize'));
} else {
@@ -417,7 +417,7 @@ class enrolment_plugin_authorize
notify(get_string('adminconfighttps', 'enrol_authorize', $a));
return; // notice breaks the form and xhtml later
}
elseif (empty($_SERVER['HTTPS']) || $_SERVER['HTTPS'] == 'off') {
elseif (isset($_SERVER['SERVER_PORT']) && $_SERVER['SERVER_PORT'] != 443) { // MDL-9836
$wwwsroot = qualified_me();
$wwwsroot = str_replace('http:', 'https:', $wwwsroot);
$a = new stdClass;
+1 -1
View File
@@ -1,4 +1,4 @@
<?php
<?php // $Id$
if(!empty($_SERVER['GATEWAY_INTERFACE'])){
error_log("should not be called from apache!");
+12 -1
View File
@@ -44,6 +44,10 @@ function multilang_filter($courseid, $text) {
// [nicolasconnault] Should support inverted attributes: <span class="multilang" lang="en"> (Doesn't work curently)
// [skodak] it supports it now, though it is slower - any better idea?
if (empty($text) or is_numeric($text)) {
return $text;
}
if (empty($CFG->filter_multilang_force_old) and !empty($CFG->filter_multilang_converted)) {
// new syntax
$search = '/(<span(\s+lang="[a-zA-Z0-9_-]+"|\s+class="multilang"){2}\s*>.*?<\/span>)(\s*<span(\s+lang="[a-zA-Z0-9_-]+"|\s+class="multilang"){2}\s*>.*?<\/span>)+/is';
@@ -51,7 +55,14 @@ function multilang_filter($courseid, $text) {
// old syntax
$search = '/(<(?:lang|span) lang="[a-zA-Z0-9_-]*".*?>.*?<\/(?:lang|span)>)(\s*<(?:lang|span) lang="[a-zA-Z0-9_-]*".*?>.*?<\/(?:lang|span)>)+/is';
}
return preg_replace_callback($search, 'multilang_filter_impl', $text);
$result = preg_replace_callback($search, 'multilang_filter_impl', $text);
if (is_null($result)) {
return $text; //error during regex processing (too many nested spans?)
} else {
return $result;
}
}
function multilang_filter_impl($langblock) {
+2 -2
View File
@@ -48,7 +48,7 @@ function grade_get_category_weight($course, $category) {
function grade_get_grade_items($course) {
global $CFG;
$sql = "SELECT i.id, c.name as cname, i.modid, mm.name as modname, i.cminstance, c.hidden, cm.visible, i.sort_order
$sql = "SELECT i.id, c.name as cname, i.modid, mm.name as modname, i.cminstance, c.hidden, cm.visible, i.sort_order, cm.id as cmid
FROM {$CFG->prefix}grade_item i,
{$CFG->prefix}grade_category c,
{$CFG->prefix}course_modules cm,
@@ -675,7 +675,7 @@ function grade_get_grades() {
if ($mods) {
foreach ($mods as $mod) {
// hidden is a gradebook setting for an assignment and visible is a course_module setting
if (($mod->hidden != 1 && $mod->visible==1) or (has_capability('moodle/course:viewhiddenactivities', get_context_instance(CONTEXT_MODULE, $mod->id)) && $preferences->show_hidden==1)) {
if (($mod->hidden != 1 && $mod->visible==1) or (has_capability('moodle/course:viewhiddenactivities', get_context_instance(CONTEXT_MODULE, $mod->cmid)) && $preferences->show_hidden==1)) {
$libfile = "$CFG->dirroot/mod/$mod->modname/lib.php";
if (file_exists($libfile)) {
require_once($libfile);
+43 -31
View File
@@ -3,7 +3,7 @@
/// If config.php exists already then we are not needed.
if (file_exists('./config.php')) {
if (file_exists('./config.php')) {
header('Location: index.php');
die;
} else {
@@ -107,13 +107,13 @@ if (isset($_POST['stage'])) {
if ($nextstage < 0) {
$nextstage = WELCOME;
}
} else {
$goforward = true;
$nextstage = WELCOME;
}
//==========================================================================//
@@ -208,7 +208,7 @@ if (isset($_GET['help'])) {
/// Are we in config download mode?
if (isset($_GET['download'])) {
header("Content-Type: application/x-forcedownload\n");
header("Content-Type: application/x-forcedownload\n");
header("Content-Disposition: attachment; filename=\"config.php\"");
echo $INSTALL['config'];
exit;
@@ -225,7 +225,7 @@ if (isset($_GET['download'])) {
if ($INSTALL['stage'] == DIRECTORY) {
error_reporting(0);
/// check wwwroot
if (ini_get('allow_url_fopen') && false) { /// This was not reliable
if (($fh = @fopen($INSTALL['wwwrootform'].'/install.php', 'r')) === false) {
@@ -234,12 +234,12 @@ if ($INSTALL['stage'] == DIRECTORY) {
}
}
if ($fh) fclose($fh);
/// check dirroot
if (($fh = @fopen($INSTALL['dirrootform'].'/install.php', 'r')) === false ) {
$errormsg .= get_string('dirrooterror', 'install').'<br />';
$INSTALL['dirrootform'] = $INSTALL['dirroot'];
}
}
if ($fh) fclose($fh);
/// check dataroot
@@ -247,7 +247,7 @@ if ($INSTALL['stage'] == DIRECTORY) {
if (make_upload_directory('sessions', false) === false ) {
$errormsg .= get_string('datarooterror', 'install').'<br />';
}
if ($fh) fclose($fh);
if ($fh) fclose($fh);
if (!empty($errormsg)) $nextstage = DIRECTORY;
@@ -262,7 +262,7 @@ if ($INSTALL['stage'] == DIRECTORY) {
/// Try to connect to the database. If that fails then try to create the database
if ($INSTALL['stage'] == DATABASE) {
/// different format for postgres7 by socket
if ($INSTALL['dbtype'] == 'postgres7' and ($INSTALL['dbhost'] == 'localhost' || $INSTALL['dbhost'] == '127.0.0.1')) {
$INSTALL['dbhost'] = "user='{$INSTALL['dbuser']}' password='{$INSTALL['dbpass']}' dbname='{$INSTALL['dbname']}'";
@@ -334,11 +334,11 @@ if ($INSTALL['stage'] == DATABASE) {
if (empty($errormsg)) {
error_reporting(0); // Hide errors
error_reporting(0); // Hide errors
if (! $dbconnected = $db->Connect($INSTALL['dbhost'],$INSTALL['dbuser'],$INSTALL['dbpass'],$INSTALL['dbname'])) {
/// The following doesn't seem to work but we're working on it
/// If you come up with a solution for creating a database in MySQL
/// If you come up with a solution for creating a database in MySQL
/// feel free to put it in and let us know
if ($dbconnected = $db->Connect($INSTALL['dbhost'],$INSTALL['dbuser'],$INSTALL['dbpass'])) {
switch ($INSTALL['dbtype']) { /// Try to create a database
@@ -353,7 +353,7 @@ if ($INSTALL['stage'] == DATABASE) {
}
}
} else {
/// We have been able to connect properly, just test the database encoding now.
/// We have been able to connect properly, just test the database encoding now.
/// It must be Unicode for 1.8 installations.
$encoding = '';
switch ($INSTALL['dbtype']) {
@@ -490,7 +490,7 @@ if ($INSTALL['stage'] == DOWNLOADLANG && $INSTALL['downloadlangpack']) {
$INSTALL['showdownloadlangpack'] = false;
$INSTALL['downloadlangpackerror'] = $downloaderror;
}
}
}
@@ -539,7 +539,7 @@ if ($nextstage == SAVE) {
fwrite($fh, $str);
fclose($fh);
}
$INSTALL['config'] = $str;
}
@@ -629,7 +629,7 @@ if (isset($_GET['help'])) {
<tr>
<td class="td_main" colspan="2">
<?php
if (!empty($errormsg)) echo "<p class=\"errormsg\" align=\"center\">$errormsg</p>\n";
@@ -646,7 +646,7 @@ if ($nextstage == SAVE) {
echo "<tr>\n";
echo "<td width=\"33.3%\">&nbsp;</td>\n";
echo "<td width=\"33.3%\">&nbsp;</td>\n";
echo "<td width=\"33.3%\" align=\"right\">\n";
echo "<td width=\"33.3%\" align=\"right\">\n";
print_single_button("index.php", $options, get_string('continue'));
echo "</td>\n";
echo "</tr>\n";
@@ -654,16 +654,16 @@ if ($nextstage == SAVE) {
} else {
echo "<p class=\"errormsg\">".get_string('configfilenotwritten', 'install')."</p>";
echo "<table cellspacing=\"0\" cellpadding=\"0\" border=\"0\" width=\"100%\">\n";
echo "<tr>\n";
echo "<td width=\"33.3%\">&nbsp;</td>\n";
echo "<td width=\"33.3%\" align=\"center\">\n";
echo "<td width=\"33.3%\" align=\"center\">\n";
$installoptions = array();
$installoptions['download'] = 1;
$installoptions['download'] = 1;
print_single_button("install.php", $installoptions, get_string('download', 'install'));
echo "</td>\n";
echo "<td width=\"33.3%\" align=\"right\">\n";
echo "<td width=\"33.3%\" align=\"right\">\n";
print_single_button("index.php", $options, get_string('continue'));
echo "</td>\n";
echo "</tr>\n";
@@ -703,7 +703,7 @@ if ($nextstage == SAVE) {
<?php
<?php
//==========================================================================//
@@ -742,7 +742,7 @@ function form_table($nextstage = WELCOME, $formaction = "install.php") {
break;
case COMPATIBILITY: /// Compatibilty check
$compatsuccess = true;
/// Check that PHP is of a sufficient version
print_compatibility_row(inst_check_php_version(), get_string('phpversion', 'install'), get_string('phpversionerror', 'install'), 'phpversionhelp');
/// Check session auto start
@@ -751,7 +751,7 @@ function form_table($nextstage = WELCOME, $formaction = "install.php") {
print_compatibility_row(!ini_get_bool('magic_quotes_runtime'), get_string('magicquotesruntime', 'install'), get_string('magicquotesruntimeerror', 'install'), 'magicquotesruntimehelp');
/// Check unsupported PHP configuration
print_compatibility_row(ini_get_bool('magic_quotes_gpc') || (!ini_get_bool('register_globals')), get_string('globalsquotes', 'install'), get_string('globalsquoteserror', 'install'), 'globalsquoteshelp');
/// Check safe mode
/// Check safe mode
print_compatibility_row(!ini_get_bool('safe_mode'), get_string('safemode', 'install'), get_string('safemodeerror', 'install'), 'safemodehelp', true);
/// Check file uploads
print_compatibility_row(ini_get_bool('file_uploads'), get_string('fileuploads', 'install'), get_string('fileuploadserror', 'install'), 'fileuploadshelp', true);
@@ -794,10 +794,10 @@ function form_table($nextstage = WELCOME, $formaction = "install.php") {
<td class="td_right">
<?php choose_from_menu (array('mysql' => get_string('mysql', 'install'),
'oci8po' => get_string('oci8po', 'install'),
'postgres7' => get_string('postgres7', 'install'),
'mssql' => get_string('mssql', 'install'),
'mssql_n' => get_string('mssql_n', 'install'),
'odbc_mssql' => get_string('odbc_mssql', 'install')),
'postgres7' => get_string('postgres7', 'install'),
'mssql' => get_string('mssql', 'install'),
'mssql_n' => get_string('mssql_n', 'install'),
'odbc_mssql' => get_string('odbc_mssql', 'install')),
'dbtype', $INSTALL['dbtype'], '', 'toggledbinfo();') ?>
</td>
</tr>
@@ -889,7 +889,7 @@ function form_table($nextstage = WELCOME, $formaction = "install.php") {
print_single_button('install.php', $options, get_string('downloadlanguagebutton','install', $languages[$INSTALL['language']]), 'POST');
print_simple_box_end();
} else {
/// Show result info
/// Show result info
/// English lang packs aren't downloaded
if (substr($INSTALL['language'],0,2) == 'en') {
print_simple_box(get_string('downloadlanguagenotneeded', 'install', $languages[$INSTALL['language']]), 'center', '80%');
@@ -939,7 +939,7 @@ function form_table($nextstage = WELCOME, $formaction = "install.php") {
</td>
</tr>
</table>
<?php
if (!$needtoopenform) {
@@ -987,7 +987,7 @@ function install_helpbutton($url, $title='') {
echo "onClick=\"return window.open('$url', 'Help', 'menubar=0,location=0,scrollbars,resizable,width=500,height=400')\">";
echo "</a>\n";
}
//==========================================================================//
@@ -1086,7 +1086,7 @@ function css_styles() {
<style type="text/css">
body { background-color: #ffeece; }
p, li, td {
p, li, td {
font-family: helvetica, arial, sans-serif;
font-size: 10pt;
}
@@ -1166,6 +1166,18 @@ function css_styles() {
font-size: 10pt;
border-color: #ffc85f;
}
table.environmenttable .error {
background-color : red;
color : inherit;
}
table.environmenttable .warn {
background-color : yellow;
}
table.environmenttable .ok {
background-color : lightgreen;
}
.header {
background-color: #fee6b9;
font-size: 10pt;
+6
View File
@@ -37,6 +37,7 @@ $string['configurationcompletehead'] = 'S\'ha completat la configuració';
$string['configurationcompletesub'] = 'Moodle ha intentat desar la configuració en un fitxer en l\'arrel de la vostra instal·lació de Moodle.';
$string['continue'] = 'Continua';
$string['curlrecommended'] = 'Es recomana instal·lar la biblioteca opcional Curl a fi d\'habilitar la funcionalitat de Moodle en Xarxa.';
$string['customcheck'] = 'Altres comprovacions';
$string['database'] = 'Base de dades';
$string['databasecreationsettingshead'] = 'Ara cal configurar els paràmetres de la base de dades on s\'emmagatzemaran la majoria de dades de Moodle. L\'instal·lador crearà automàticament aquesta base de dades amb els paràmetres que especifiqueu aquí.';
$string['databasecreationsettingssub'] = '<b>Tipus:</b> fixat a \"mysql\" per l\'instal·lador<br />
@@ -118,8 +119,10 @@ $string['downloadlanguagenotneeded'] = 'Podeu continuar el procés d\'instal·la
$string['downloadlanguagesub'] = 'Ara teniu l\'opció de baixar un paquet d\'idioma i continuar el procés d\'instal·lació en aquest idioma.<br /><br />Si no podeu baixar el paquet, el procés d\'instal·lació prosseguirà en anglès. (Després que s\'hagi completat la instal·lació, tindreu l\'oportunitat de baixar i instal·lar paquets d\'idioma addicionals.)';
$string['environmenterrortodo'] = 'Abans d\'instal·lar aquesta versió de Moodle heu de resoldre tots els problemes d\'entorn (errors) que s\'han trobat.';
$string['environmenthead'] = 'S\'està comprovant el vostre entorn';
$string['environmentrecommendcustomcheck'] = 'si aquesta prova falla, això indica un problema en potència';
$string['environmentrecommendinstall'] = 'es recomana instal·lar/habilitar';
$string['environmentrecommendversion'] = 'esteu executant la versió $a->current i es recomana la $a->needed';
$string['environmentrequirecustomcheck'] = 'cal passar aquesta prova';
$string['environmentrequireinstall'] = 'es requereix instal·lar/habilitar';
$string['environmentrequireversion'] = 'esteu executant la versió $a->current i es requereix la $a->needed';
$string['environmentsub'] = 'S\'està comprovant si els diferents components del vostre sistema satisfan els requeriments';
@@ -192,11 +195,14 @@ $string['phpversionhelp'] = '<p>Moodle necessita la versió de PHP 4.1.0 o poste
<p>Us caldrà actualitzar el PHP o traslladar Moodle a un ordinador amb una versió de PHP més recent.</p>';
$string['postgres7'] = 'PostgreSQL (postgres7)';
$string['previous'] = 'Anterior';
$string['qtyperqpwillberemoved'] = 'Durant l\'actualització, el tipus de pregunta RPQ se suprimirà. No estàveu utilitzant aquest tipus de pregunta, de manera que no hauríeu d\'experimentar cap problema.';
$string['qtyperqpwillberemovedanyway'] = 'Durant l\'actualització, el tipus de pregunta RPQ se suprimirà. Teniu algunes preguntes RQP en la base de dades que deixaran de funcionar si no reinstal·leu el codi de http://moodle.org/mod/data/view.php?d=13&amp;rid=797 abans de prosseguir l\'actualització.';
$string['remotedownloadnotallowed'] = 'El vostre servidor no permet baixar components ((allow_url_fopen inhabilitat).<br /><br />Baixeu manualment el fitxer <a href=\"$a->url\">$a->url</a>, copieu en la ubicació \"$a->dest\" del vostre servidor i descomprimiu-lo allí.';
$string['report'] = 'Informe';
$string['restricted'] = 'Restringit';
$string['safemode'] = 'Mode segur';
$string['safemodeerror'] = 'Moodle pot tenir problemes amb el mode segur activat';
$string['serverchecks'] = 'Proves del servidor';
$string['sessionautostart'] = 'Autoinici de sessió';
$string['sessionautostarterror'] = 'Hauria d\'estar desactivat';
$string['skipdbencodingtest'] = 'Omet la prova de codificació de la base de dades';
+2
View File
@@ -38,6 +38,7 @@ $string['configurationcompletehead'] = 'Die Konfiguration ist abgeschlossen.';
$string['configurationcompletesub'] = 'Moodle speichert Ihre Konfigurationseinstellungen nun im Hauptverzeichnis Ihrer Moodle-Installation.';
$string['continue'] = 'Weiter';
$string['curlrecommended'] = 'Die Installation der optionalen Bibliothek Curl wird empfohlen, um die Moodle-Netzwerk-Funktionalität einzuschalten.';
$string['customcheck'] = 'Weitere Überprüfungen';
$string['database'] = 'Datenbank';
$string['databasecreationsettingshead'] = 'Sie müssen Einstellungen für die Datenbank konfigurieren, in der die meisten Moodle-Daten abgelegt werden. Der Installationsprozess erstellt die Datenbanktabellen automatisch auf der Grundlage der Einstellungen.';
$string['databasecreationsettingssub'] = '<b>Typ:</b> \"mysql\" vom Installer festgelegt<br />
@@ -200,6 +201,7 @@ $string['report'] = 'Bericht';
$string['restricted'] = 'Eingeschränkt';
$string['safemode'] = 'Safe Mode';
$string['safemodeerror'] = 'Die Nutzung von Moodle im Safe Mode kann zu Schwierigkeiten führen.';
$string['serverchecks'] = 'Server-Überprüfung';
$string['sessionautostart'] = 'Session Auto Start';
$string['sessionautostarterror'] = 'Diese Option sollte abgeschaltet sein';
$string['skipdbencodingtest'] = 'Prüfung der Datenbank-Verschlüsselung überspringen';
+2
View File
@@ -41,6 +41,7 @@ $string['configurationcompletehead'] = 'Configuration completed';
$string['configurationcompletesub'] = 'Moodle made an attempt to save your configuration in a file in the root of your Moodle installation.';
$string['continue'] = 'Continue';
$string['curlrecommended'] = 'Installing the optional Curl library is highly recommended in order to enable Moodle Networking functionality.';
$string['customcheck'] = 'Other Checks';
$string['database'] = 'Database';
$string['databasecreationsettingshead'] = 'Now you need to configure the database settings where most Moodle data
will be stored. This database will be created automatically by the installer
@@ -225,6 +226,7 @@ $string['report'] = 'Report';
$string['restricted'] = 'Restricted';
$string['safemode'] = 'Safe Mode';
$string['safemodeerror'] = 'Moodle may have trouble with safe mode on';
$string['serverchecks'] = 'Server Checks';
$string['sessionautostart'] = 'Session Auto Start';
$string['sessionautostarterror'] = 'This should be off';
$string['skipdbencodingtest'] = 'Skip DB Encoding Test';
+7
View File
@@ -40,6 +40,7 @@ $string['configurationcompletehead'] = 'Configuración completa';
$string['configurationcompletesub'] = 'Moodle ha creado su fichero de configuración';
$string['continue'] = 'Continuar';
$string['curlrecommended'] = 'Se recomienda encarecidamente instalar la librería opcional Curl a fin de posibilitar la funcionalidad de la Red Moodle.';
$string['customcheck'] = 'Otras comprobaciones';
$string['database'] = 'Base de datos';
$string['databasecreationsettingshead'] = 'Ahora necesita configurar los ajustes de la base de datos donde se almacenarán la mayoría de los datos de Moodle. El instalador creará la base de datos con los ajustes especificados más abajo.';
$string['databasecreationsettingssub'] = '<b>Tipo:</b> el valor por defecto es \"mysql\"<br />
@@ -125,8 +126,10 @@ $string['downloadlanguagenotneeded'] = 'Puede continuar el proceso de instalaci
$string['downloadlanguagesub'] = 'Ahora tiene la opción de descargar su paquete de idioma y continuar con el proceso de instalación en ese idioma.<br /><br />Si no es posible la descarga el proceso de instalación continuará en inglés (una vez que la instalación haya finalizado, podrá descargar e instalar otros idiomas).';
$string['environmenterrortodo'] = 'Debe resolver todos los problemas de entorno (errores) encontrados arriba antes de proceder a instalar esta versión de Moodle';
$string['environmenthead'] = 'Comprobando su entorno';
$string['environmentrecommendcustomcheck'] = 'Si esta comprobación falla, ello indica un problema potencial';
$string['environmentrecommendinstall'] = 'es recomendable que esté instalado/activado';
$string['environmentrecommendversion'] = 'versión $a->needed es recomendada y está ejecutando $a->current';
$string['environmentrequirecustomcheck'] = 'esta prueba debe pasar';
$string['environmentrequireinstall'] = 'es obligatorio que esté instalado/activado';
$string['environmentrequireversion'] = 'versión $a->needed es obligatoria y está ejecutando $a->current';
$string['environmentsub'] = 'Estamos comprobando que diferentes componentes de su servidor cumplen con los requerimientos del sistema';
@@ -191,6 +194,7 @@ $string['ociextensionisnotpresentinphp'] = 'PHP no ha sido adecuadamente configu
$string['odbc_mssql'] = 'SQL*Server over ODBC (odbc_mssql)';
$string['odbcextensionisnotpresentinphp'] = 'PHP no ha sido adecuadamente configurado con la extensión ODBC de modo que pueda comunicarse con SQL*Server. Por favor, compruebe el archivo php.ini o vuelva a compilar PHP.';
$string['ok'] = 'OK';
$string['opensslrecommended'] = 'Instalar la librería opcional OpenSSL es altamente recomendado -- activa la funcionalidad de red de Moodle (\'Moodle Networking\').';
$string['pass'] = 'Correcto';
$string['password'] = 'Contraseña';
$string['pgsqlextensionisnotpresentinphp'] = 'PHP no ha sido adecuadamente configurado con la extensión PGSQL de modo que pueda comunicarse con PostgreSQL. Por favor, compruebe el archivo php.ini o vuelva a compilar PHP.';
@@ -202,11 +206,14 @@ $string['phpversionhelp'] = '<p>Moodle requiere una versión de PHP 4.1.0 o supe
<p>Debe actualizar PHP o acudir a otro servidor con una versión más reciente de PHP</p>';
$string['postgres7'] = 'PostgreSQL (postgres7)';
$string['previous'] = 'Anterior';
$string['qtyperqpwillberemoved'] = 'Durante la actualización, el tipo de pregunta RQP será eliminada. En el caso de que no estuviera utilizando este tipo de pregunta, no debería tener ningún problema.';
$string['qtyperqpwillberemovedanyway'] = 'Durante la actualización, el tipo de pregunta RQP será eliminada. Usted tiene algunas preguntas RQP en su base de datos, y tales preguntas no pararán de funcionar a menos que reinstale el código desde http://moodle.org/mod/data/view.php?d=13&amp;rid=797 antes de continuar la actualización.';
$string['remotedownloadnotallowed'] = 'No está permitido descargar los componentes a su servidor (allow_url_fopen está deshabilitado).<br /><br />Debe descargar el archivo <a href=\"$a->url\">$a->url</a> manualmente, y copiarlo a \"$a->dest\"';
$string['report'] = 'Informe';
$string['restricted'] = 'Restringido';
$string['safemode'] = 'Safe Mode';
$string['safemodeerror'] = 'Moodle puede tener problemas con \'safe mode\' activado';
$string['serverchecks'] = 'Comprobaciones del Servidor';
$string['sessionautostart'] = 'Autocomienzo de sesión';
$string['sessionautostarterror'] = 'Deb e estar desactivado';
$string['skipdbencodingtest'] = 'Pasar por alto el test de decodificación de la BD';
+3 -1
View File
@@ -36,6 +36,7 @@ $string['configurationcompletehead'] = 'Configuration terminée';
$string['configurationcompletesub'] = 'Moodle a tenté d\'enregistrer votre configuration dans un fichier à la racine de votre installation de Moodle.';
$string['continue'] = 'Continuer';
$string['curlrecommended'] = 'L\'installation de la bibliothèque optionnelle Curl est vivement recommandée, afin de pouvoir utiliser la fonctionnalité Réseau Moodle.';
$string['customcheck'] = 'Autres contrôles';
$string['database'] = 'Base de données';
$string['databasecreationsettingshead'] = 'La base de données dans laquelle sont enregistrées la plupart des données utilisées par Moodle doit maintenant être configurée. Cette base de données sera créée automatiquement par l\'installeur Moodle4Windows avec les options spécifiées ci-dessous.';
$string['databasecreationsettingssub'] = '<strong>Type&nbsp;:</strong> réglé sur «&nbsp;mysql&nbsp;» par l\'installeur<br />
@@ -174,13 +175,14 @@ $string['phpversionerror'] = 'La version du programme PHP doit être au moins 4.
$string['phpversionhelp'] = '<p>Moodle nécessite au minimum la version 4.3.0 ou 5.1.0 (5.0.x a bon nombre de problèmes).</p><p>Vous utilisez actuellement la version $a.</p><p>Pour que Moodle fonctionne, vous devez mettre à jour PHP ou aller chez un hébergeur ayant une version récente de PHP.<br/>(Si vous avez une version 5.0.x, vous pouvez aussi re-passer à la version 4.4.x)</p>';
$string['postgres7'] = 'PostgreSQL (postgres7)';
$string['previous'] = 'Précédent';
$string['qtyperqpwillberemoved'] = 'Au cours de cette mise à jour, le type de question RQP sera supprimé. Vous n\'utilisiez pas ce type de question, et souffrirez donc d\'aucun problème.';
$string['qtyperqpwillberemoved'] = 'Au cours de cette mise à jour, le type de question RQP sera supprimé. Vous n\'utilisiez pas ce type de question, et ne souffrirez donc d\'aucun problème.';
$string['qtyperqpwillberemovedanyway'] = 'Au cours de cette mise à jour, le type de question RQP sera supprimé. Votre base de données comporte des questions RQP, qui ne fonctionneront plus, à moins que vous ne réinstalliez le code disponible sur http://moodle.org/mod/data/view.php?d=13&amp;rid=797 avant de continuer la mise à jour.';
$string['remotedownloadnotallowed'] = 'Le téléchargement de composants sur votre serveur n\'est pas autorisé (l\'option allow_url_fopen est désactivée).<br /><br />Vous devez télécharger manuellement le fichier <a href=\"$a->url\">$a->url</a>, le copier vers «&nbsp;$a->dest&nbsp;» dans votre serveur et le décompresser.';
$string['report'] = 'Rapport';
$string['restricted'] = 'Interdit';
$string['safemode'] = 'Safe Mode';
$string['safemodeerror'] = 'Moodle risque de rencontrer des problèmes lorsque le mode «&nbsp;safe mode&nbsp;» est activé';
$string['serverchecks'] = 'Contrôles serveur';
$string['sessionautostart'] = 'Démarrage automatique des sessions';
$string['sessionautostarterror'] = 'Ce paramètre doit être désactivé';
$string['skipdbencodingtest'] = 'Ne pas effectuer le test d\'encodage de la base de données';
+186 -2
View File
@@ -9,6 +9,11 @@
/// File generated by cvs://contrib/lang2installer/installer_builder
/// using strings defined in installer_strings (same dir)
$string['admindirerror'] = 'ספריית מנהל המערכת המצויינת שגויה';
$string['admindirname'] = 'ספריית מנהל המערכת';
$string['admindirsettinghead'] = 'הגדר את ספריית מנהל המערכת...';
$string['admindirsettingsub'] = 'שירותי אירוח אתרים מעטים משתמשים/מתנהלים כ-Url מיוחד עבורך כדי לגשת ללוח הבקרה למשל. למרבה הצער דבר זה עומד נגד המיקום התקני של עמודי מנהל המערכת של Moodle. תוכל לתקן זאת ע\"י שינוי שם ספריית ה-admin בהתקנה שלך והכנסת שם חדש זה כאן. למשל:<br /> <br /><b>moodleadmin</b><br /> <br />
דבר זה יתקן את קישורי ה-admin ב-Moodle.';
$string['bypassed'] = 'נעקף';
$string['cannotcreatelangdir'] = 'לא ניתן ליצור סיפריית שפה.';
$string['cannotcreatetempdir'] = 'לא ניתן ליצור סיפרייה זמנית.';
@@ -18,48 +23,227 @@ $string['cannotfindcomponent'] = 'הרכיב לא נמצא.';
$string['cannotsavemd5file'] = 'לא ניתן לשמור קובץ md5.';
$string['cannotsavezipfile'] = 'לא ניתן לשמור קובץ ZIP.';
$string['cannotunzipfile'] = 'לא ניתן לפתוח את קובץ ה-ZIP.';
$string['caution'] = 'אזהרה';
$string['check'] = 'בדוק';
$string['chooselanguagehead'] = 'בחר שפה';
$string['chooselanguagesub'] = 'אנא בחר שפה עבור ההתקנה בלבד. תוכל לבחור בשפה שונה לאתר ולמשתמש באחד מהמסכים הבאים.';
$string['closewindow'] = 'סגור את החלון הזה';
$string['compatibilitysettingshead'] = 'בדיקת הגדרות ה-PHP שלך...';
$string['compatibilitysettingssub'] = 'השרת שלך צריך לעבור את כל בדיקות אלו כדי להפעיל את Moodle כהלכה.';
$string['componentisuptodate'] = 'הרכיב מעודכן.';
$string['configfilenotwritten'] = 'סקריפט ההתקנה לא הצליח ליצור באופן אוטומטי את קובץ config.php המכיל את בחירת ההגדרות שלך, ייתכן שהדבר קרה בגלל שספריית ה-Moodle שלך איננה ניתנת לכתיבה. תוכל באופן ידני להעתיק את הקוד הבא לתוך קובץ config.php בספריית האם של Moodle.';
$string['configfilewritten'] = 'קובץ config.php נוצר בהצלחה';
$string['configurationcompletehead'] = 'הגדרות התצורה הושלמו';
$string['configurationcompletesub'] = 'Moodle ניסה לשמור את הגדרות התצורה שלך בקובץ בספריית ה-root של התקנת ה-Moodle.';
$string['continue'] = 'המשך';
$string['curlrecommended'] = 'התקנת ספריית Curl, האופציונלית, מומלצת ביותר בכדי לאפשר ל-Moodle את פונקציונליות התקשורת';
$string['download'] = 'הורד';
$string['database'] = 'מסד נתונים';
$string['databasecreationsettingshead'] = 'כעת נותר לך לעצב את הגדרות מסד הנתונים שלך היכן שרוב נתוני Moodle יאוחסנו. מסד נתונים זה ייווצר באופן אוטומטי ע\"י ההתקנה
עם ההגדרות המצויינות להלן.';
$string['databasecreationsettingssub'] = '<b>סוג:</b> תוקן ל\"mysql\" ע\"י קובץ ההתקנה<br />
<b>מחשב מארח:</b> תוקן ל\"localhost\" ע\"י קובץ ההתקנה<br />
<b>שם:</b> שם מסד הנתונים, למשל: Moodle <br />
<b>שם משתמש מסד הנתונים:</b> תוקן ל\"root\" ע\"י קובץ ההתקנה<br />
<b>סיסמה:</b> סיסמת מסד הנתונים שלך<br />
<b>תחילית הטבלאות:</b> תחילית רשות לכל שמות הטבלאות';
$string['databasesettingshead'] = 'כעת נותר לך לעצב את הגדרות מסד הנתונים שלך היכן שרוב נתוני Moodle יאוחסנו. מסד נתונים זה חייב כבר להיות קיים בנוסף שם משתמש וסיסמה לשם גישה אליו.';
$string['databasesettingssub'] = '<b>סוג:</b> mysql או postgres7<br />
<b>מחשב מארח:</b> לדוגמה localhost או db.isp.com<br />
<b>שם:</b> database שם מסד הנתונים למשל-moodle<br />
<b>שם משתמש:</b> שם משתמש מסד הנתונים שלך<br />
<b>סיסמה:</b> סיסמת מסד הנתונים שלך<br />
<b>תחילית הטבלאות:</b> תחילית רשות לכל שמות הטבלאות';
$string['databasesettingssub_mssql'] = '<b>Type:</b> SQL*Server (non UTF-8) <b><font color=\"red\">Experimental! (not for use in production)</font></b><br />
<b>מחשב מארח:</b> לדוגמה localhost או db.isp.com<br />
<b>שם:</b> database שם מסד הנתונים למשל-moodle<br />
<b>שם משתמש:</b> שם משתמש מסד הנתונים שלך<br />
<b>סיסמה:</b> סיסמת מסד הנתונים שלך<br />
<b>תחילית הטבלאות:</b> תחילית רשות לכל שמות הטבלאות (הכרחי)';
$string['databasesettingssub_mssql_n'] = '</b> סוג:</b> SQL*server (UTF-8 enabled(<br>
<b>מחשב מארח:</b> לדוגמה localhost או db.isp.com<br />
<b>שם:</b> database שם מסד הנתונים למשל-moodle<br />
<b>שם משתמש:</b> שם משתמש מסד הנתונים שלך<br />
<b>סיסמה:</b> סיסמת מסד הנתונים שלך<br />
<b>תחילית הטבלאות:</b> תחילית רשות לכל שמות הטבלאות (הכרחי)';
$string['databasesettingssub_mysql'] = '<b>סוג:</b> MySQL<br />
<b>מחשב מארח:</b> לדוגמה localhost או db.isp.com<br />
<b>שם:</b> database שם מסד הנתונים למשל-moodle<br />
<b>שם משתמש:</b> שם משתמש מסד הנתונים שלך<br />
<b>סיסמה:</b> סיסמת מסד הנתונים שלך<br />
<b>תחילית הטבלאות:</b> תחילית רשות לכל שמות הטבלאות (אפשרי)';
$string['databasesettingssub_oci8po'] = '<b>סוג:</b> Oracle<br />
<b>מחשב מארח:</b> לא בשימוש, חייב להיות ריק מצד שמאל<br />
<b>שם: </b> השם ניתן מחיבור ה- tnsnames.ora
<b>שם משתמש:</b> שם משתמש מסד הנתונים שלך<br />
<b>סיסמה:</b> סיסמת מסד הנתונים שלך<br />
<b>תחילית הטבלאות:</b> תחילית רשות לכל שמות הטבלאות (mandatory, 2cc. max)';
$string['databasesettingssub_odbc_mssql'] = '<b>סוג:</b> SQL*Server (over ODBC) Experimental! (not for use in production)<br />
<b>מחשב מארח:</b> השם הניתן ע\"י ה-DNS ב-ODBO control panel<br />
<b>שם משתמש:</b> שם משתמש מסד הנתונים שלך<br />
<b>סיסמה:</b> סיסמת מסד הנתונים שלך<br />
<b>תחילית הטבלאות:</b> תחילית רשות לכל שמות הטבלאות (הכרחי)';
$string['databasesettingssub_postgres7'] = '<b>סוג:</b> PostgreSQL<br />
<b>מחשב מארח:</b> לדוגמה localhost או db.isp.com<br />
<b>שם:</b> database שם מסד הנתונים למשל-moodle<br />
<b>שם משתמש:</b> שם משתמש מסד הנתונים שלך<br />
<b>סיסמה:</b> סיסמת מסד הנתונים שלך<br />
<b>תחילית הטבלאות:</b> תחילית רשות לכל שמות הטבלאות (אפשרי)';
$string['dataroot'] = 'ספריית הנתנים';
$string['datarooterror'] = 'ספריית \"נתוני Moodle\" שציינת לא נמצאה או יכלה להיווצר. אנא תקן את נתיב זה או צור את ספרייה זו באופן ידני.';
$string['dbconnectionerror'] = 'לא הצלחנו להתחבר למסד הנתונים שציינת. אנא בדוק את הגדרות מסד הנתונים שלך.';
$string['dbcreationerror'] = 'חלה שגיאה ביצירת מסד הנתונים. המערכת לא הצליחה ליצור את שם מסד הנתונים שציינת עם ההגדרות שסופקו.';
$string['dbhost'] = 'שרת מארח';
$string['dbprefix'] = 'Tables prefix';
$string['dbtype'] = 'סוג';
$string['dbwrongencoding'] = 'מסד הנתונים שציינת פועל תחת קידוד לא מומלץ ($a). יהיה זה עדיף להשתמש באחד מקידודי ה- Unicode (UTF-8) במקום. בכל אופן, תוכל לעקוף את נסיון זה ע\"י בחירה ב\"דלג על DB Encoding Test\" המצויין למטה, אך תוכל להתקל בבעיות שוב בעתיד.';
$string['dbwronghostserver'] = 'הינך חייב לעקוב אחר תפקידי ה\"מארח\" כמתואר למעלה.';
$string['dbwrongnlslang'] = 'משתנה הסביבה NLS_LANG בשרת האתר שלךחייב להשתמש בקבוצת קידוד התווים AL32UTF8. ראה תיעוד ה-PHP על איך להגדיר כהלכה את OCI8.';
$string['dbwrongprefix'] = 'אתה חייב לעקוב אחר תפקידי ה-\"Table Prefix\" כמוסבר למעלה';
$string['directorysettingshead'] = 'אנא אשר את מיקומי התקנת Moodle זה.';
$string['directorysettingssub'] = '<p> אנא וודא את מיקומי התקנת Moodle זו.</p>
<p><b>כתובת האתר:</b>
ציין את כתובת האתר המלאה אשר Moodle יופעל ממנה. אם שרת האתר שלך ניתן לגישה דרך Url-ים מרובים בחר באחד הטבעיים בו הסטודנטים ישתמשו. אל תכיל בתוך הכתובת זנב של לוכסן.</p>
<br>
<br>
<p><b>ספריית Moodle </b>
ציין את הנתיב הספרייה המלא עבור התקנה זו. שים לב כי כי האותיות הקטנות או גדולות נכונות.
<br>
<br>
<p><b>ספריית הנתונים:</b>
תצטרך למצוא מיקום עבור שמירת קבצים שהועלו לאתר Moodle שלך. ספרייה זו חייבת להיות בעלת הרשאת כתיבה וקריאה ע\"י שרת האתר ...';
$string['dirroot'] = 'ספריית ה-Moodle';
$string['dirrooterror'] = 'הגדרת ספריית ה-Moodle כנראה איננה נכונה - איננו מוצאים את התקנת Moodle כאן. הערך כאן אותחל.';
$string['download'] = 'הורדה';
$string['downloadedfilecheckfailed'] = 'נכשלה בדיקת הקובץ המורד.';
$string['downloadlanguagebutton'] = 'הורד את ה-&quot;$a&quot; חבילת שפה';
$string['downloadlanguagehead'] = 'הורד חבילת שפה';
$string['downloadlanguagenotneeded'] = 'אתה יכול להמשיך את תהליך ההתקנה ע\"י שימוש ב-\"$a\" שפת ברירת המחדל';
$string['downloadlanguagesub'] = 'כעת יש באפשרותך להוריד חבילת שפה ולהמשיך את תהליך ההתקנה עם שפה זו.
<br/><br/>
אם אינך מצליח להוריד את חבילת השפה, תהליך ההתקנה ימשיך בשפה האנגלית (כאשר תהליך ההתקנה הסתיים, תיהיה לך את האפשרות להוריד ולהתקין אילו חבילות שפה נוספות שתחפוץ).';
$string['environmenterrortodo'] = 'אתה חייב לפתור את כל הבעיות (השגיאות) הסביבתיות הנמצאות למעלה לפני המשך הליך התקנת גירסה זו של Moodle.';
$string['environmenthead'] = 'בודק את הסביבה שלך...';
$string['environmentrecommendinstall'] = 'מומלץ להתקין/לאפשר זאת';
$string['environmentrecommendversion'] = 'גירסה $a->needed נדרשת והיא מומלצת ואתה מריץ גירסה $a->current נוכחית';
$string['environmentrequireinstall'] = 'נדרש להתקין/לאפשר זאת';
$string['environmentrequireversion'] = 'גירסת $a->needed נדרשת ואתה מריץ $a->current';
$string['environmentsub'] = 'אנו בודקים את רכיבים השונים';
$string['environmentxmlerror'] = 'שגיאה בקריאת נתוני סביבה $a->error_cod';
$string['error'] = 'טעות';
$string['gdversion'] = 'גירסת GD';
$string['fail'] = 'כישלון';
$string['fileuploads'] = 'העלאת קבצים';
$string['fileuploadserror'] = 'חייב לאפשר זאת';
$string['gdversion'] = 'גרסת GD';
$string['gdversionerror'] = 'ספריית GD אמורה לפעול וליצור תמונות';
$string['gdversionhelp'] = '<p> כנראה שלשרת שלך אין GD מותקן.</p>
GD היא ספרייה אשר נדרשת ע\"י PHP לאפשר ל-Moodle להפעיל תמונות או צורות (כמו צלמיות פרופיל המשתמש) וליצור תמונות חדשות (כמו גרפים של יומני המעקב). Moodle עדיין יעבוד ללא GD - כך שמאפיינים אלו לא יהיו זמינות לך.</p>
<p> בכדי להוסיף את GD ל-PHP תחת unix, בצע קומפילציה ל-PHP ע\"י שימוש בפרמטר ה --with.
</p>
<p> תחת Windows תוכל בפשטות לערוך את קובץ ה-php.ini ולהסיר את הערה תחץ הפרמטר של php_gd2.dll. </p>';
$string['globalsquotes'] = 'טיפול לא בטוח של משתנים גלובלים';
$string['globalsquoteserror'] = 'תקן את הגדרות ה-PHP שלך: נטרל את register_globals ו/או אפשר את magic_quotes_gpc';
$string['help'] = 'עזרה';
$string['iconvrecommended'] = 'התקנת ספריית ICONV האופציונלית מומלצת ביותר על-מנת לשפר את ביצועי האתר, במיוחד אם האתר נתמך בשפות לא-לטיניות.';
$string['info'] = 'מידע';
$string['installation'] = 'התקנה';
$string['invalidmd5'] = 'md5 לא חוקי';
$string['langdownloaderror'] = 'לצערינו השפה \"$a\" לא הותקנה. תהליך ההתקנה ימשיך באנגלית.';
$string['langdownloadok'] = 'השפה \"$a\" הותקנה בהצלחה. תהליך ההתקנה ימשיך בשפה זו.';
$string['language'] = 'חבילת שפה';
$string['magicquotesruntime'] = 'Magic Quotes Run Time';
$string['magicquotesruntimeerror'] = 'חייב לנטרל זאת';
$string['mbstringrecommended'] = 'מתקין את ספריית MBSTRING האופציונלית מומלצת ביותר על-מנת לשפר את ביצועי האתר, במיוחד אם האתר נתמך בשפות לא-לטיניות.';
$string['memorylimit'] = 'גבול הזיכרון';
$string['memorylimiterror'] = 'משתנה גבול הזיכרון (memory limit) של ה-PHP הוגדר לרמה נמוכה... תוכל להגדיר זאת יותר מאוחר';
$string['memorylimithelp'] = '<p>
גבול הזיכרון של ה-PHP לשרת שלך כרגע מכוון ל-$a
</p>
<p>
דבר זה עלול לגרום בעיות זיכרון בהמשך, במיוחד אם יש לך מודולים רבים פעילים אוו הרבה משתמשים. </p>
<p> אנו ממליצים שתעצב את הגדרת ה-PHP עם ערך גבוה להגבלת הזיכרון, כמו 40M.
ישנן דרכים רבות לכך:
<ol>
<il>
אם תוכל להדר את PHP שוב עם <i> -- enable-memory-limit </i>
דבר זה יאפשר ל-Moodle להגדיר את גבול הזיכרון לבד. </i>
<i> אם יש לך גישה לקובץ ה-php.ini, תוכל לשנות את משתנה ה- <b> memory_limit </b>
שנה שם את הערך למשל ל-40M. אם אין לך גישה לקובץ זה תוכל לבקש ממנהל המערכת שלך שיעשה זאת עבורך.
</i>
<i> בכמה שרתי PHP תוכל ליצור קובץ .htaccess בספריית ה-Moodle שלך בצירוף שורה זו:
<p><blockquote>php_value memory_limit 40M</blockquote></p>
<p> בכל אופן, בכמה שרתים דבר זה ימנע <b>מכל </b> הדפים לעבוד ( אם תראה שגיאות כאשר תיכנס לדפים) תדע כי הינך צריך להסיר את הקובץ .htaccess.
</p>
</il>
</ol>
</p>';
$string['missingrequiredfield'] = 'חסר שדה נדרש כלשהו';
$string['moodledocslink'] = 'Moodle Docs עבור עמוד זה';
$string['mssql'] = 'SQL*Server (mssql)';
$string['mssql_n'] = 'SQL*Server with UTF-8 support (mssql_n)';
$string['mssqlextensionisnotpresentinphp'] = 'PHP לא הוגדר כהלכה עם הרחבת MSSQL בכדי שהוא יוכל לתקשר עם SQL*SERVER. אנא בדוק את קובץ הגדרות הPHP שלך- php.ini או הדר את ה-PHP שלך.';
$string['mysql'] = 'MySQL (mysql)';
$string['mysql416bypassed'] = 'בכל אופן, אם האתר שלך משתמש ב שפות iso-8859-1 (latin)בלבד, אתה יכול להמשיך להתשמש בגרסת MySQL 4.1.12 המותקנת (או גירסה גבוהה יותר).';
$string['mysql416required'] = 'היא הגירסה המינימלית הנדרשת ל Moodle 1.6 על-מנת להבטיח המרת כל הנתונים לתבנית UTF-8 בעתיד.';
$string['mysqlextensionisnotpresentinphp'] = 'PHP לא הוגדר כהלכה עם הרחבת MySQL בכדי שהוא יוכל לתקשר עם MySQL. אנא בדוק את קובץ הגדרות הPHP שלך- php.ini או הדר את ה-PHP שלך.';
$string['name'] = 'שם';
$string['next'] = 'הלאה';
$string['oci8po'] = 'Oracle (oci8po)';
$string['ociextensionisnotpresentinphp'] = 'PHP לא הוגדר כהלכה עם הרחבת OCI8 בכדי שהוא יוכל לתקשר עם Oracle. אנא בדוק את קובץ הגדרות הPHP שלך- php.ini או הדר את ה-PHP שלך.';
$string['odbc_mssql'] = 'SQL*Server over ODBC (odbc_mssql)';
$string['odbcextensionisnotpresentinphp'] = 'PHP לא הוגדר כהלכה עם הרחבת ODBC בכדי שהוא יוכל לתקשר עם SQL*Server. אנא בדוק את קובץ הגדרות הPHP שלך- php.ini או הדר את ה-PHP שלך.';
$string['ok'] = 'כן';
$string['opensslrecommended'] = 'התקנת ספרייה אופציונלית OpenSSL ממולצת מאוד -- מאפשרת את פנקציונליות Moodle Networking.';
$string['parentlanguage'] = 'מתרגמים: אם לשפה שלכם יש שפה-הורה, שרצוי שמוודל ישתמש בה כדי למלא מחרוזות חסרות, ציינו כאן את הקוד של השפה הנל. אם תשאירו את החלל כאן ריק, אזי מוודל ישתמש בשפה האנגלית. לדוגמא: nl';
$string['pass'] = 'עבר';
$string['password'] = 'סיסמה';
$string['pgsqlextensionisnotpresentinphp'] = 'PHP לא הוגדר כהלכה עם הרחבת PGSQL בכדי שהוא יוכל לתקשר עם PostgreSQL. אנא בדוק את קובץ הגדרות הPHP שלך- php.ini או הדר את ה-PHP שלך.';
$string['php50restricted'] = 'קיים ל-PHP 5.0.x מספר בעיות ידועות, אנא שדרג ל-5.1 או הורד בדרגה לגירסה 4.3 או 4.4';
$string['phpversion'] = 'גירסת PHP';
$string['phpversionerror'] = 'גירסת PHP חייבת להיות לפחות 4.3.0 או 5.1.0 (בגירסאות 5.0.x קיימות מספר בעיות ידועות)';
$string['phpversionhelp'] = '<p>גירסת PHP חייבת להיות לפחות 4.3.0 או 5.1.0 (בגירסאות 5.0.x קיימות מספר בעיות ידועות) </p>
<p> במערכת שלך פועלת כרגע גירסת $a </p>
<p> אתה חייב לשדרג את גירסת ה-PHP שלך או לעבור למחשב מארח עם עם גירסת PHP חדשה! <br/>
(במקרים של גרסת 5.0.x תוכל גם לרדת בגרסה ל- 4.4.x)
</p>';
$string['postgres7'] = 'PostgreSQL (postgres7';
$string['previous'] = 'קודם';
$string['remotedownloadnotallowed'] = 'לא מורשה הורדה של רכיבים לשרת שלך (פונקצייתallow_url_fopen מנוטרלת).<br /><br />עליך להוריד את קובץ ה<a href=\"$a->url\">$a->url</a> באופן ידני, להעתיק אותו לתוך \"$a->dest\" בשרת שלך, ולפתוח אותו שם.';
$string['report'] = 'דוח';
$string['restricted'] = 'מוגבל';
$string['safemode'] = 'מצב בטוח (Safe Mode)';
$string['safemodeerror'] = 'ל-Moodle קיימת בעיה עם איפשור מצב הבטוח (safe mode)';
$string['sessionautostart'] = 'פתיחת מושב אוטומטית';
$string['sessionautostarterror'] = 'חייב לכבות זאת';
$string['skipdbencodingtest'] = 'דלג על DB Encoding Test';
$string['status'] = 'מצב';
$string['thischarset'] = 'UTF-8';
$string['thislanguage'] = 'עברית';
$string['unicoderecommended'] = 'אחסנת המידע שלך בקידוד-Unicode מומלץ. התקנות חדשות יופיעו במסדי הנתונים אשר להם קבוצת התווים כברירת מחדל המתאימה ל-Unicode. אם אתה משדרג, תציג את ה-UTF-8 migration process (ראה בדף מנהל המערכת).';
$string['unicoderequired'] = 'מומלץ לאחסן את כל המידע שלך בפורמט - Uniucode. התקנות חדשות חייבות להופיע במסדי הנתונים אשר להם קבוצת התווים כברירת מחדל המתאימה ל-Unicode. אם אתה משדרג, תציג את ה-UTF-8 migration process (ראה בדף מנהל המערכת).';
$string['user'] = 'משתמש';
$string['welcomep10'] = '$a->installername ($a->installerversion)';
$string['welcomep20'] = 'הינך רואה את עמוד זה מפני שהתקנת והפעלת בהלכה את <strong> $a-packname $a->packversion
</strong>
חבילה במחשבך. ברכותינו!';
$string['welcomep30'] = 'גירסת <strong>$a->installername</strong> כוללת את היישומים ליצור סביבה אשר בה <strong> Moodle </strong>
יפעל דהיינו:';
$string['welcomep40'] = 'החבילה כוללת בנוסף
<strong>Moodle $a->moodlerelease ($a->moodleversion)</strong>.';
$string['welcomep50'] = 'השימוש בכל היישומים בחבילה זו מפוקח ע\"י הרשיונות המתאימים להם. החבילה
<strong>$a->installername</strong>
השלמה היא
<a href=\"http://www.opensource.org/docs/definition_plain.html\"> קוד פתוח
</a>
והיא מבוזרת תחת רשיון
<a>
href=\"http://www.gnu.org/copyleft/gpl.html\">GPL</a>';
$string['welcomep60'] = 'העמודים הבאים יובילו אותך בצורה פשוטה דרך כמה צעדים לעיצוב הגדרות <strong>Moodle</strong> במחשבך.
תוכל לאשר את הגדרות ברירת המחדל או, באפשרותך, לשנותם לפי צרכיך.';
$string['welcomep70'] = 'הקש על לחצן ה\"המשך\" למטה כדי להמשיך עם הגדרת ה-<strong>Moodle</strong>';
$string['wrongdestpath'] = 'נתיב יעד שגוי.';
$string['wrongsourcebase'] = 'מקור בסיס URL שגוי';
$string['wrongzipfilename'] = 'שם קובץ ZIP שגוי.';
$string['wwwroot'] = 'כתובת האתר';
$string['wwwrooterror'] = 'כתובת האתר כנראה איננה תקנית - התקנת Moodle זו כנראה איננה שם. הערך כאן אותחל.';
?>
+3
View File
@@ -31,6 +31,7 @@ $string['configfilewritten'] = 'config.php skráin hefur verið mynduð';
$string['configurationcompletehead'] = 'Stillingu lokið';
$string['configurationcompletesub'] = 'Moodle gerði tilraun til þess að vista uppsetningarskránna í rót Moodle skráarsafnins.';
$string['continue'] = 'Áfram';
$string['curlrecommended'] = 'Mælt er með innsetningu á Curl forritasafninu í því skyni að gera mögulega nettengingar Moodle vefja.';
$string['database'] = 'Gagnagrunnur';
$string['databasecreationsettingssub'] = 'Nú er komið að því að setja upp gagnagrunninn þar sem flest gögn sem tilheyra Moodle eru hýst. Uppsetningarforritið skilgreinir gagnagrunninn með neðangreindum stillingum.
<b>Tegund:</b> sjálfgefið gildi uppsetningarforrits er \"mysql\"<br />
@@ -96,12 +97,14 @@ $string['mbstringrecommended'] = 'Mælt er með uppsetningu á MBSTRING safninu
$string['missingrequiredfield'] = 'Einhverjir reitir eru enn óútfylltir';
$string['moodledocslink'] = 'Hjálp fyrir þessa síðu';
$string['mssql'] = 'SQL *vefþjónn (mssql)';
$string['mssql_n'] = 'SQL *Vefþjónn sem styður við UTF-8 (mysql_n)';
$string['mysql'] = 'MySQL (mysql)';
$string['mysql416bypassed'] = 'Ef vefurinn notast hinsvegar EINUNGIS við iso-8859-1 (latin) stafasettið er óhætt að notast áfram við MySQL 4.1.12 eða yngri útgáfur.';
$string['mysql416required'] = 'Moodle gerir lágmarkskröfu um MySQL 4.1.16 gagnagrunninn til þess að trygga að mögulegt sé að yfirfæra öll gögn yfir í UTF-8.';
$string['name'] = 'Nafn';
$string['next'] = 'Áfram';
$string['oci8po'] = 'Oracle (oci8po)';
$string['odbc_mssql'] = 'SQL*Server gegnum ODBC (odbc_mssql)';
$string['ok'] = 'OK';
$string['parentlanguage'] = 'en';
$string['pass'] = 'Staðið';
+2
View File
@@ -37,6 +37,7 @@ $string['configurationcompletehead'] = '設定が完了しました。';
$string['configurationcompletesub'] = 'Moodleは、Moodleインストレーションルートへの設定内容の保存を試みました。';
$string['continue'] = '続ける';
$string['curlrecommended'] = 'Moodleネットワーキング機能を有効にするため、Curlライブラリのインストールを強くお勧めします。';
$string['customcheck'] = 'その他のチェック';
$string['database'] = 'データベース';
$string['databasecreationsettingshead'] = 'ほとんどのMoodleデータが保存されるデータベース設定を行ってください。このデータベースはインストーラーにより、下記の設定が指定された形で自動的に作成されます。';
$string['databasecreationsettingssub'] = '<b>タイプ:</b> インストーラーにより「mysql」に修正されました。<br />
@@ -203,6 +204,7 @@ $string['report'] = 'レポート';
$string['restricted'] = '使用禁止';
$string['safemode'] = 'セーフモード';
$string['safemodeerror'] = 'セーフモードが有効の場合、Moodleに問題が発生する場合があります。';
$string['serverchecks'] = 'サーバチェック';
$string['sessionautostart'] = 'セッション自動スタート';
$string['sessionautostarterror'] = 'これは無効にしてください。';
$string['skipdbencodingtest'] = 'DBエンコーディングテストをスキップ';
+6
View File
@@ -36,6 +36,7 @@ $string['configurationcompletehead'] = 'Configuratie klaar';
$string['configurationcompletesub'] = 'Moodle probeerde je configuratie te bewaren in een bestand in de root van je installatie.';
$string['continue'] = 'Ga door';
$string['curlrecommended'] = 'Het installeren van de optionele Curl bibliotheek wordt ten zeerste aangeraden om de netwerkmogelijkheden van Moodle in te schakelen';
$string['customcheck'] = 'Andere controles';
$string['database'] = 'Databank';
$string['databasecreationsettingshead'] = 'Nu moet je de databankinstellingen configureren. In deze databank zullen de meeste gegevens van Moodle opgeslagen worden. De databank zal automatisch gemaakt worden door het installatiescript met volgende instellingen.';
$string['databasecreationsettingssub'] = '<b>Type:</b> \"mysql\" gekozen door het installatiescript<br />
@@ -120,8 +121,10 @@ $string['downloadlanguagenotneeded'] = 'Je kunt het installatieproces verder lat
$string['downloadlanguagesub'] = 'Je kun nu een taalpakket downloaden en de installatie in die taal verder zetten.<br /><br />Als je dit taalpakket niet kunt downloaden, dan zal de installatie in het Engels verder gaan. (Als de installatie is afgewerkt, krijg je terug de mogelijkheid om nieuwe taalpakketten te downloaden en te installeren)';
$string['environmenterrortodo'] = 'Je moet all de problemen over de installatie-omgeving die hierboven gevonden zijn, oplossen. Ga pas dan verder met het installeren van deze Moodleversie.';
$string['environmenthead'] = 'Omgeving controleren ...';
$string['environmentrecommendcustomcheck'] = 'Als deze test faalt, dan wijst dat op een mogelijk probleem';
$string['environmentrecommendinstall'] = 'wordt aangeraden om te installeren of in te schakelen';
$string['environmentrecommendversion'] = 'je kunt betere versie $a->needed gebruiken en je gebruikt nu versie $a->current';
$string['environmentrequirecustomcheck'] = 'Deze test moet OK zijn';
$string['environmentrequireinstall'] = 'moet geïnstalleerd/ingeschakeld zijn';
$string['environmentrequireversion'] = 'versie $a->needed is vereist en je gebruikt nu versie $a->current';
$string['environmentsub'] = 'We controleren nu of de versies van verschillende componenten van je server voldoen aan de systeemvereisten van Moodle';
@@ -189,11 +192,14 @@ $string['phpversionhelp'] = '<p>Moodle heeft minstens PHP-versie 4.1.0 nodig.</p
<p>Je moet PHP upgraden of verhuizen naar een host met een nieuwere versie van PHP!</p>';
$string['postgres7'] = 'PostgreSQL (postgres 7)';
$string['previous'] = 'Vorige';
$string['qtyperqpwillberemoved'] = 'Tijdens de upgrade zal het RQP vraagtype verwijderd worden. Je gebruikte deze vraag niet, dus je zult hier geen problemen mee krijgen.';
$string['qtyperqpwillberemovedanyway'] = 'Tijdens de upgrade zal het RQP vraagtype verwijderd worden. Er zijn vragen van dit type in je database. Die zullen stoppen met werken, tenzij je de code herinstalleert van http://moodle.org/mod/data/view.php?d=13&amp;rid=797 voor je verder gaat met de upgrade.';
$string['remotedownloadnotallowed'] = 'Het downloaden van componenten naar je server is niet toegelaten (allow_url_fopen is uitgeschakeld)<br /><br />Je moet het <a href=\"$a->url\">$a->url</a>bestand manueel downloaden en het kopiëren naar \"$a->dest\" op je server en het daar unzippen.';
$string['report'] = 'Rapport';
$string['restricted'] = 'Beperkt';
$string['safemode'] = 'Safe Mode';
$string['safemodeerror'] = 'Moodle kan bestanden niet juist behandelen met safe mode ingeschakeld';
$string['serverchecks'] = 'Servercontroles';
$string['sessionautostart'] = 'Session Auto Start';
$string['sessionautostarterror'] = 'Dit moet uitgeschakeld zijn';
$string['skipdbencodingtest'] = 'Negeer DB-encodingtest';
+12 -4
View File
@@ -27,6 +27,7 @@ $string['configfilewritten'] = 'สร้าง config.php เรียบร้
$string['configurationcompletehead'] = 'ตั้งค่าตัวแปรเสร็จสิ้นแล้ว';
$string['configurationcompletesub'] = 'Moodle ทำการบันทึกไฟล์การตั้งค่าลงในโฟลเดอร์ moodle หลังจากทำการติดตั้ง';
$string['continue'] = 'ขั้นต่อไป';
$string['curlrecommended'] = 'แนะนำให้ติดตั้ง Curl library เพื่อให้การทำงาน Moodle ในระบบเน็ทเวิร์กดีขึ้น';
$string['database'] = 'ฐานข้อมูล';
$string['databasecreationsettingshead'] = 'คุณจำเป็นต้องตั้งค่าฐานข้อมูลที่ใช้ในการเก็บข้อมูลของ moodle ฐานข้อมูลดังกล่าวจะต้องมีการสร้างไว้แล้วล่วงหน้า';
$string['databasecreationsettingssub'] = '<b>ประเภท:</b> ตั้งค่าไว้ที่ mysql <br />
@@ -82,8 +83,10 @@ $string['downloadlanguagenotneeded'] = 'คุณสามารถดำเน
$string['downloadlanguagesub'] = 'คุณมีตัวเลือกในการดาวน์โหลดไฟล์ภาษาและดำเนินการติดตั้งด้วยภาษาดังกล่าว <br /><br /> ถ้าหากคุณไม่สามารถดาวน์โหลดภาษาได้การติดตั้งจะดำเนินการต่อด้วยภาษาอังกฤษ (หลังจากที่ติดตั้งสำเร็จแล้วท่านสามารถดาวน์โหลดภาษาได้ในภายหลัง)';
$string['environmenterrortodo'] = 'ท่านต้องแก้ไขปัญหาของระบบทั้งหมดที่ตรวจพบข้างต้นก่อนที่จะทำการติดตั้ง Moodle เวอร์ชันนี้';
$string['environmenthead'] = 'ตรวจสอบความพร้อมของระบบ';
$string['environmentrecommendcustomcheck'] = 'ในกรณีที่การทดสอบล้มเหลว ต่อไปนี้คือปัญหาที่อาจประสบอยู่';
$string['environmentrecommendinstall'] = 'แนะนำสำหรับการติดตั้ง/เปิดใช้งาน';
$string['environmentrecommendversion'] = 'ระบบต้องการเวอร์ชัน $a->needed ขณะนี้ท่านกำลังใช้งานเวอร์ชัน $a->current';
$string['environmentrequirecustomcheck'] = 'การทดสอบนี้จะต้องผ่านความต้องการดังนี้';
$string['environmentrequireinstall'] = 'ต้องการเพื่อทำการติดตั้ง/เปิดใช้งาน';
$string['environmentrequireversion'] = 'ต้องการเวอร์ชัน $a->needed ขณะนี้ท่านกำลังใช้งานเวอร์ชัน $a->current';
$string['environmentsub'] = 'กำลังทำการตรวจสอบคอมโพเนนท์ต่าง ๆ ของระบบว่าตรงตามความต้องการของ Moodle หรือไม่';
@@ -112,7 +115,7 @@ $string['langdownloadok'] = 'ภาษา\"$a\" ได้รับการต
$string['language'] = 'ภาษาที่ใช้ในเว็บ';
$string['magicquotesruntime'] = 'Magic Quotes Run Time';
$string['magicquotesruntimeerror'] = 'ควรจะปิด (off)';
$string['mbstringrecommended'] = 'แนะนำให้ติดตั้งไลบราลี MBSTRING เพื่อช่วยให้เว็บไซต์ทำงานได้ดีขึ้นสำหรับเว็บที่ไม่ใช้งานภาษาละติน';
$string['mbstringrecommended'] = 'แนะนำให้ติดตั้ง MBSTRING library เพื่อช่วยให้เว็บไซต์ทำงานได้ดีขึ้นสำหรับเว็บที่ไม่ใช้งานภาษาละติน';
$string['memorylimit'] = 'ความจำสูงสุด (Memory Limit)';
$string['memorylimiterror'] = 'ความจำสูงสุดที่คุณตั้งไว้ค่อนข้างต่ำ อาจมีปัญหาในภายหลังค่ะ';
$string['memorylimithelp'] = '<p>ค่าความจำสูงสุดของเซิร์ฟเวอร์ของคุณตั้งไว้ที่ $a</p>
@@ -134,16 +137,17 @@ $string['memorylimithelp'] = '<p>ค่าความจำสูงสุด
<p>อย่างไรก็ตามในบางเซิร์ฟเวอร์คุณไม่สามารถใช้ วิธีนี้ได้ โดยจะมีการแสดง error ขึ้นมาคุณจำเป็นต้องลบไฟล์ดังกล่าวนี้ทิ้ง
</ol>';
$string['moodledocslink'] = 'เอกสารช่วยเหลือสำหรับหน้านี้';
$string['mysql416bypassed'] = 'ถ้าหากเว็บไซต์ของท่านใช้งานภาษาละติเท่านั้น iso-8859-1 (latin) ท่านสามารถที่จะทำการติดตั้งและใช้งาน MySQL 4.1.12 หรือสูงกว่าได้เลย';
$string['mysql416required'] = 'สำหรับ moodle 1.6 นี้เพื่อให้ฐานข้อมูลทั้งหมดเปลี่ยนเป็น Unicode จำเป็นต้องมีการใช้งาน MySQL 4.1.16 ขึ้นไป';
$string['mysql416bypassed'] = 'ถ้าหากเว็บไซต์ของท่านใช้งานภาษาละติเท่านั้น iso-8859-1 (latin) ท่านสามารถที่จะทำการติดตั้งและใช้งาน MySQL 4.1.12 หรือสูงกว่าได้เลย';
$string['mysql416required'] = 'สำหรับ Moodle 1.6 นี้เพื่อให้ฐานข้อมูลทั้งหมดเปลี่ยนเป็น Unicode จำเป็นต้องมีการใช้งาน MySQL 4.1.16 ขึ้นไป';
$string['mysqlextensionisnotpresentinphp'] = 'การตั้งค่า PHP ให้ใช้กับ MySQL ไม่ถูกต้องกรุณาตรวจสอบใน php.ini อีกครั้งหรือรีคอมไฟล์ php';
$string['name'] = 'ชื่อ';
$string['next'] = 'ต่อไป';
$string['ok'] = 'เรียบร้อย';
$string['opensslrecommended'] = 'แนะนำให้ทำการติดตั้ง OpenSSL library เพื่อให้ Moodle ทำงานในระบบเน็ตเวิร์กได้ดีขึ้น';
$string['parentlanguage'] = 'en';
$string['pass'] = 'สำเร็จ';
$string['password'] = 'รหัสผ่าน';
$string['php50restricted'] = 'PHP 5.0.x มีปัญหาในการใช้งาน กรุณาอัพเกรเป็นเวอร์ชัน 5.1.x หรือเปลี่ยนไปใช้งานเวอร์ชัน 4.3.x หรือ 4.4.x';
$string['php50restricted'] = 'PHP 5.0.x มีปัญหาในการใช้งาน กรุณาอัพเกรเป็นเวอร์ชัน 5.1.x หรือเปลี่ยนไปใช้งานเวอร์ชัน 4.3.x หรือ 4.4.x';
$string['phpversion'] = 'PHP เวอร์ชัน';
$string['phpversionerror'] = 'เวอร์ชันของ PHP ควรเป็นอย่างน้อย 4.1.0';
$string['phpversionhelp'] = '<p>Moodle จำเป็นต้องใช้ PHP เวอร์ชัน 4.1.0 เป็นอย่างน้อย</p>
@@ -152,6 +156,8 @@ $string['phpversionhelp'] = '<p>Moodle จำเป็นต้องใช้ P
<p>คุณต้องอัพเกรด PHP หรือย้ายโฮสต์ใหม่ที่มี PHP เวอร์ชันใหม่กว่า</p>';
$string['previous'] = 'หน้าก่อน';
$string['qtyperqpwillberemoved'] = 'ระหว่างการอัพเกรด ประเภทคำถาม RQP จะถูกลบไปท่านไม่ได้ใช้งานคำถามประเภทนี้จึงไม่น่าจะประสบปัญหาจากการอัพเกรด';
$string['qtyperqpwillberemovedanyway'] = 'ท่านใช้คำถามแบบ RQP ในระหว่างการอัพเกรดระบบจะลบคำถามประเภทนี้ทิ้งไป ทำให้ไม่สามารถใช้งานได้ ให้ทำการติดตั้งโค้ดเข้าไปใหม่จาก http://moodle.org/mod/data/view.php?d=13&amp;rid=797 ก่อนที่จะทำการอัพเกรด';
$string['report'] = 'รายงาน';
$string['restricted'] = 'ห้าม';
$string['safemode'] = 'Safe Mode';
@@ -162,6 +168,8 @@ $string['skipdbencodingtest'] = 'ข้ามการทดสอบการ
$string['status'] = 'สถานะ';
$string['thischarset'] = 'UTF-8';
$string['thislanguage'] = 'Thai';
$string['unicoderecommended'] = 'ระบบแนะนำให้จัดเก็บข้อมูลด้วย unicode (UTF-8 ) ในการติดตั้งใหม่ควรตั้งค่าชุดอักขระของฐานข้อมูลเป็น unicode ในกรณีที่ทำการอัพเกรดควรทำการเปลี่ยนชุดอักขระเดิมให้เป็น UTF-8 (ดูรายละเอียดใน ผู้ดูแลระบบ)';
$string['unicoderequired'] = 'ระบบนี้จำเป็นที่ต้องเก็บข้อมูลไว้ในรูปแบบ unicode (UTF-8 ) ในการติดตั้งใหม่ควรตั้งค่าชุดอักขระของฐานข้อมูลเป็น unicode ในกรณีที่ทำการอัพเกรดควรทำการเปลี่ยนชุดอักขระเดิมให้เป็น UTF-8 (ดูรายละเอียดใน ผู้ดูแลระบบ)';
$string['user'] = 'สมาชิก';
$string['welcomep10'] = '$a->installername ($a->installerversion)';
$string['welcomep20'] = 'ท่านได้ทำการติดตั้ง<strong>$a->packname $a->packversion</strong> สำเร็จแล้ว';
+4 -2
View File
@@ -1,4 +1,4 @@
<?PHP // $Id$
<?PHP // $Id$
// admin.php - created with Moodle 1.7 beta + (2006101003)
@@ -189,7 +189,7 @@ $string['configstatsmaxruntime'] = 'Stats processing can be quite intensive, so
$string['configstatsruntimestart'] = 'What time should the cronjob that does the stats processing <b>start</b>?';
$string['configstatsuserthreshold'] = 'If you enter a non-zero, non numeric value here, for ranking courses, courses with less than this number of enrolled users (all roles) will be ignored';
$string['configteacherassignteachers'] = 'Should ordinary teachers be allowed to assign other teachers within courses they teach? If \'No\', then only course creators and admins can assign teachers.';
$string['configthemelist'] = 'Leave this blank to allow any valid theme to be used. If you want to shorten the theme menu, you can specify a comma-separated list of names here (Don\'t use spaces!).
$string['configthemelist'] = 'Leave this blank to allow any valid theme to be used. If you want to shorten the theme menu, you can specify a comma-separated list of names here (Don\'t use spaces!).
For example: standard,orangewhite.';
$string['configtimezone'] = 'You can set the default timezone here. This is the only the DEFAULT timezone for displaying dates - each user can override this by setting their own in their profile. \"Server time\" here will make Moodle default to the server\'s operating system setting, but \"Server time\" in the user profile will make the user default to this timezone setting. Cronjobs that depend on a time of day to run will use this timezone.';
$string['configunzip'] = 'Indicate the location of your unzip program (Unix only, optional). If specified, this will be used to unpack zip archives on the server. If you leave this blank, then Moodle will use internal routines.';
@@ -212,6 +212,7 @@ $string['cronerrorpassword'] = 'Sorry, you have not provided a valid password to
$string['cronremotepassword'] = 'Cron password for remote access';
$string['cronwarning'] = 'The <a href=\"cron.php\">cron.php maintenance script</a> has not been run for at least 24 hours.';
$string['curlrecommended'] = 'Installing the optional Curl library is highly recommended in order to enable Moodle Networking functionality.';
$string['customcheck'] = 'Other Checks';
$string['datarootsecuritywarning'] = 'Your site configuration might not be secure. Please make sure that your dataroot directory ($a) is not directly accessible via web.';
$string['dbmigrate'] = 'Moodle Database Migration';
$string['dbmigrateconnecerror'] = 'Could not connect to the database specified.';
@@ -493,6 +494,7 @@ $string['searchinsettings'] = 'Search in settings';
$string['secureforms'] = 'Use additional form security';
$string['security'] = 'Security';
$string['server'] = 'Server';
$string['serverchecks'] = 'Server Checks';
$string['sessioncookie'] = 'Cookie prefix';
$string['sessioncookiepath'] = 'Cookie path';
$string['sessionhandling'] = 'Session Handling';
+13 -14
View File
@@ -1,7 +1,15 @@
<?php // $Id$
// auth.php - created with Moodle 1.5 UNSTABLE DEVELOPMENT (2005010100)
$string['auth_cas_proxycas_key'] = "Proxy mode";
$string['auth_cas_logoutcas_key'] = "Logout CAS";
$string['auth_cas_multiauth_key'] = "Multi-authentication";
$string['auth_cas_proxycas'] = "Turn this to 'yes'' if you use CASin proxy-mode";
$string['auth_cas_logoutcas'] = "Turn this to 'yes'' if tou want to logout from CAS when you deconnect from Moodle";
$string['auth_cas_multiauth'] = "Turn this to 'yes'' if you want to have multi-authentication (CAS + other authentication)";
$string['accesCAS'] = "CAS users";
$string['accesNOCAS'] = "other users";
$string['CASform'] = "Authentication choice";
$string['alternatelogin'] = 'If you enter a URL here, it will be used as the login page for this site. The page should contain a form which has the action property set to <strong>\'$a\'</strong> and return fields <strong>username</strong> and <strong>password</strong>.<br />Be careful not to enter an incorrect URL as you may lock yourself out of this site.<br />Leave this setting blank to use the default login page.';
$string['alternateloginurl'] = 'Alternate Login URL';
@@ -30,15 +38,6 @@ $string['auth_nologindescription'] = 'Auxiliary plugin that prevents user to log
$string['auth_nologintitle'] = 'No login';
// CAS plugin
$string['auth_cas_proxycas_key'] = "Proxy mode";
$string['auth_cas_logoutcas_key'] = "Logout CAS";
$string['auth_cas_multiauth_key'] = "Multi-authentication";
$string['auth_cas_proxycas'] = "Turn this to 'yes'' if you use CASin proxy-mode";
$string['auth_cas_logoutcas'] = "Turn this to 'yes'' if tou want to logout from CAS when you deconnect from Moodle";
$string['auth_cas_multiauth'] = "Turn this to 'yes'' if you want to have multi-authentication (CAS + other authentication)";
$string['accesCAS'] = "CAS users";
$string['accesNOCAS'] = "other users";
$string['CASform'] = "Authentication choice";
$string['auth_cas_logincas'] = 'Secure connection access';
$string['auth_cas_invalidcaslogin'] = 'Sorry, your login has failed - you could not be authorised';
$string['auth_cas_server_settings'] = 'CAS server configuration';
@@ -253,7 +252,7 @@ $string['auth_nonedescription'] = 'Users can sign in and create valid accounts i
$string['auth_nonetitle'] = 'No authentication';
// PAM plugin
$string['auth_pamdescription'] = 'This method uses PAM to access the native usernames on this server. You have to install <a href=\"http://www.math.ohio-state.edu/~ccunning/pam_auth/\">PHP4 PAM Authentication</a> in order to use this module.';
$string['auth_pamdescription'] = 'This method uses PAM to access the native usernames on this server. You have to install <a href=\"http://www.math.ohio-state.edu/~ccunning/pam_auth/\" target=\"_blank\">PHP4 PAM Authentication</a> in order to use this module.';
$string['auth_pamtitle'] = 'PAM (Pluggable Authentication Modules)';
$string['auth_passwordisexpired'] = 'Your password is expired. Do you want change your password now?';
@@ -275,7 +274,7 @@ $string['auth_pop3host_key'] = 'Host';
// RADIUS plugin
$string['auth_radiustitle'] = 'RADIUS server';
$string['auth_radiusdescription'] = 'This method uses a <a href=\"http://en.wikipedia.org/wiki/RADIUS\">RADIUS</a> server to check whether a given username and password is valid.';
$string['auth_radiusdescription'] = 'This method uses a <a href=\"http://en.wikipedia.org/wiki/RADIUS\" target=\"_blank\">RADIUS</a> server to check whether a given username and password is valid.';
$string['auth_radiushost'] = 'Address of the RADIUS server';
$string['auth_radiusnasport'] = 'Port to use to connect';
$string['auth_radiussecret'] = 'Shared secret';
@@ -285,7 +284,7 @@ $string['auth_radiushost_key'] = 'Host';
$string['auth_radiussecret_key'] = 'Secret';
// Shibboleth plugin
$string['auth_shibbolethdescription'] = 'Using this method users are created and authenticated using <a href=\"http://shibboleth.internet2.edu/\">Shibboleth</a>.<br/>Be sure to read the <a href=\"../auth/shibboleth/README.txt\">README</a> for Shibboleth on how to set up your Moodle with Shibboleth';
$string['auth_shibbolethdescription'] = 'Using this method users are created and authenticated using <a href=\"http://shibboleth.internet2.edu/\" target=\"_blank\">Shibboleth</a>.<br/>Be sure to read the <a href=\"../auth/shibboleth/README.txt\" target=\"_blank\">README</a> for Shibboleth on how to set up your Moodle with Shibboleth';
$string['auth_shibbolethtitle'] = 'Shibboleth';
$string['auth_shibboleth_login'] = 'Shibboleth Login';
$string['auth_shibboleth_manual_login'] = 'Manual Login';
@@ -294,7 +293,7 @@ $string['auth_shib_only_description'] = 'Check this option if a Shibboleth authe
$string['auth_shib_username_description'] = 'Name of the webserver Shibboleth environment variable that shall be used as Moodle username';
$string['auth_shib_instructions'] = 'Use the <a href=\"$a\">Shibboleth login</a> to get access via Shibboleth, if your institution supports it.<br />Otherwise, use the normal login form shown here.';
$string['auth_shib_convert_data'] = 'Data modification API';
$string['auth_shib_convert_data_description'] = 'You can use this API to further modify the data provided by Shibboleth. Read the <a href=\"../auth/shibboleth/README.txt\">README</a> for further instructions.';
$string['auth_shib_convert_data_description'] = 'You can use this API to further modify the data provided by Shibboleth. Read the <a href=\"../auth/shibboleth/README.txt\" target=\"_blank\">README</a> for further instructions.';
$string['auth_shib_instructions_help'] = 'Here you should provide custom instructions for your users to explain Shibboleth. It will be shown on the login page in the instructions section. The instructions must include a link to \"<b>$a</b>\" that users click when they want to log in.';
$string['auth_shib_convert_data_warning'] = 'The file does not exist or is not readable by the webserver process!';
$string['auth_shib_changepasswordurl'] = 'Password-change URL';
+3
View File
@@ -30,6 +30,8 @@ $string['fieldrequired'] = '\"$a\" is a required field';
$string['filenotfound'] = 'Sorry, the requested file could not be found';
$string['forumblockingtoomanyposts'] = 'You have exceeded the posting threshold set for this forum.';
$string['groupalready'] = 'User already belongs to group $a';
$string['groupexistforcourse'] = 'Group \"$a\" already exists for this course';
$string['groupnotaddederror'] = 'Group \"$a\" not added';
$string['groupunknown'] = 'Group $a not associated to specified course';
$string['guestnoeditprofile'] = 'The guest user cannot edit their profile';
$string['guestnoeditprofileother'] = 'The guest user profile cannot be edited';
@@ -70,6 +72,7 @@ $string['sessionipnomatch'] = 'Sorry, but your IP number seems to have changed f
$string['statscatchupmode'] = 'Statistics is currently in catchup mode. So far $a->daysdone day(s) have been processed and $a->dayspending are pending. Check back soon!';
$string['unicodeupgradeerror'] = 'Sorry, but your database is not already in Unicode, and this version of Moodle is not able to migrate your database to Unicode. Please upgrade to Moodle 1.7.x first and perform the Unicode migration from the Admin page. After that is done you should be able to migrate to Moodle $a';
$string['unknowncourse'] = 'Unknown course named \"$a\"';
$string['unknowncourseidnumber'] = 'Unknown Course ID \"$a\"';
$string['unknownuseraction'] = 'Sorry, I do not understand this user action.';
$string['usernotaddederror'] = 'User \"$a\" not added - unknown error';
$string['usernotaddedregistered'] = 'User \"$a\" not added - already registered';
+3 -2
View File
@@ -17,8 +17,9 @@ $string['requiredelement'] = 'Required field';
$string['general'] = 'General';
$string['optional'] = 'Optional';
$string['revealpassword'] = 'Reveal';
$string['modstandardels']='Common Module Settings';
$string['modstandardels']='Common module settings';
$string['miscellaneoussettings']='Miscellaneous Settings';
$string['othersettings']='Other settings';
$string['addfields']='Add $a fields to form';
$string['day']='Day';
$string['month']='Month';
@@ -26,7 +27,7 @@ $string['year']='Year';
$string['hour']='Hour';
$string['minute']='Minute';
$string['advancedelement']='Advanced Element';
$string['advancedelement']='Advanced element';
$string['hideadvanced']='Hide Advanced';
$string['showadvanced']='Show Advanced';
+27 -28
View File
@@ -1,8 +1,6 @@
<?PHP // $Id$
<?PHP // $Id$
// forum.php - created with Moodle 1.7 beta + (2006101003)
$string['addanewdiscussion'] = 'Add a new discussion topic';
$string['addanewquestion'] = 'Add a new question';
$string['addanewtopic'] = 'Add a new topic';
@@ -18,14 +16,15 @@ $string['allunsubscribe'] = 'Unsubscribe from all forums';
$string['anyfile'] = 'Any file';
$string['attachment'] = 'Attachment';
$string['blockafter'] = 'Post threshold for blocking';
$string['blockperioddisabled'] = 'Don\'t block';
$string['blockperiod'] = 'Time period for blocking';
$string['blockperioddisabled'] = 'Don\'t block';
$string['bynameondate'] = 'by $a->name - $a->date';
$string['cannotviewpostyet'] = 'You cannot read other students questions in this discussion yet because you haven\'t posted';
$string['cannotadddiscussion'] = 'Adding discussions to this forum requires group membership.';
$string['configcleanreadtime'] = 'The hour of the day to clean old posts from the \'read\' table.';
$string['configdisplaymode'] = 'The default display mode for discussions if one isn\'t set.';
$string['configenablerssfeeds'] = 'This switch will enable the possibility of RSS feeds for all forums. You will still need to turn feeds on manually in the settings for each forum.';
$string['configenabletimedposts'] = 'Set to \'yes\' if you want to allow setting of display periods when posting a new forum discussion (Experimental as not yet fully tested)';
$string['configlongpost'] = 'Any post over this length (in characters not including HTML) is considered long. Posts displayed on the site front page, social format course pages, or user profiles are shortened to a natural break somewhere between the forum_shortpost and forum_longpost values.';
$string['configmanydiscussions'] = 'Maximum number of discussions shown in a forum per page';
$string['configmaxbytes'] = 'Default maximum size for all forum attachments on the site (subject to course limits and other local settings)';
@@ -38,10 +37,10 @@ $string['couldnotadd'] = 'Could not add your post due to an unknown error';
$string['couldnotdeleteratings'] = 'Sorry, that cannot be deleted as people have already rated it';
$string['couldnotdeletereplies'] = 'Sorry, that cannot be deleted as people have already responded to it';
$string['couldnotupdate'] = 'Could not update your post due to an unknown error';
$string['deleteddiscussion'] = 'The discussion topic has been deleted';
$string['delete'] = 'Delete';
$string['deletedposts'] = 'Those posts have been deleted';
$string['deleteddiscussion'] = 'The discussion topic has been deleted';
$string['deletedpost'] = 'The post has been deleted';
$string['deletedposts'] = 'Those posts have been deleted';
$string['deletesure'] = 'Are you sure you want to delete this post?';
$string['deletesureplural'] = 'Are you sure you want to delete this post and all replies? ($a posts)';
$string['digestmailheader'] = 'This is your daily digest of new posts from the $a->sitename forums. To change your forum email preferences, go to $a->userprefs.';
@@ -51,8 +50,8 @@ $string['digestsentusers'] = 'Email digests successfully sent to $a users.';
$string['disallowsubscribe'] = 'Subscriptions not allowed';
$string['disallowsubscribeteacher'] = 'Subscriptions not allowed (except for teachers)';
$string['discussion'] = 'Discussion';
$string['discussionmovedpost'] = 'This discussion has been moved to <a href=\"$a->discusshref\">here</a> in the forum <a href=\"$a->forumhref\">$a->forumname</a>';
$string['discussionmoved'] = 'This discussion has been moved to \'$a\'.';
$string['discussionmovedpost'] = 'This discussion has been moved to <a href=\"$a->discusshref\">here</a> in the forum <a href=\"$a->forumhref\">$a->forumname</a>';
$string['discussionname'] = 'Discussion name';
$string['discussions'] = 'Discussions';
$string['discussionsstartedby'] = 'Discussions started by $a';
@@ -62,18 +61,19 @@ $string['displayend'] = 'Display end';
$string['displayperiod'] = 'Display Period';
$string['displaystart'] = 'Display start';
$string['eachuserforum'] = 'Each person posts one discussion';
$string['editedby'] = 'Edited by $a->name - original submission $a->date';
$string['edit'] = 'Edit';
$string['editedby'] = 'Edited by $a->name - original submission $a->date';
$string['editing'] = 'Editing';
$string['emptymessage'] = 'Something was wrong with your post. Perhaps you left it blank, or the attachment was too big. Your changes have NOT been saved.';
$string['everyonecanchoose'] = 'Everyone can choose to be subscribed';
$string['everyonecannowchoose'] = 'Everyone can now choose to be subscribed';
$string['everyoneissubscribed'] = 'Everyone is subscribed to this forum';
$string['everyoneisnowsubscribed'] = 'Everyone is now subscribed to this forum';
$string['everyoneissubscribed'] = 'Everyone is subscribed to this forum';
$string['existingsubscribers'] = 'Existing subscribers';
$string['forcessubscribe'] = 'This forum forces everyone to be subscribed';
$string['forcesubscribe'] = 'Force everyone to be subscribed';
$string['forcesubscribeq'] = 'Force everyone to be subscribed?';
$string['forum'] = 'Forum';
$string['forum:addnews'] = 'Add news';
$string['forumauthorhidden'] = 'Author (hidden)';
$string['forumblockingalmosttoomanyposts'] = 'You are approaching the posting threshold. You have posted $a->numposts times in the last $a->blockperiod and the limit is $a->blockafter posts.';
@@ -82,7 +82,6 @@ $string['forum:createattachment'] = 'Create attachments';
$string['forum:deleteanypost'] = 'Delete any posts (anytime)';
$string['forum:deleteownpost'] = 'Delete own posts (within deadline)';
$string['forum:editanypost'] = 'Edit any post';
$string['forum'] = 'Forum';
$string['forum:initialsubscriptions'] = 'Initial subscription';
$string['forumintro'] = 'Forum introduction';
$string['forum:managesubscriptions'] = 'Manage subscriptions';
@@ -106,8 +105,8 @@ $string['forum:viewhiddentimedposts'] = 'View hidden timed posts';
$string['forum:viewqandawithoutposting'] = 'Always see Q and A posts';
$string['forum:viewrating'] = 'View ratings';
$string['forum:viewsubscribers'] = 'View subscribers';
$string['generalforums'] = 'General forums';
$string['generalforum'] = 'Standard forum for general use';
$string['generalforums'] = 'General forums';
$string['inforum'] = 'in $a';
$string['intronews'] = 'General news and announcements';
$string['introsocial'] = 'An open forum for chatting about anything you want to';
@@ -117,10 +116,10 @@ $string['learningforums'] = 'Learning forums';
$string['mailnow'] = 'Mail now';
$string['markalldread'] = 'Mark all posts in this discussion read.';
$string['markallread'] = 'Mark all posts in this forum read.';
$string['markreadbutton'] = 'Mark<br />read';
$string['markread'] = 'Mark read';
$string['markunreadbutton'] = 'Mark<br />unread';
$string['markreadbutton'] = 'Mark<br />read';
$string['markunread'] = 'Mark unread';
$string['markunreadbutton'] = 'Mark<br />unread';
$string['maxattachmentsize'] = 'Maximum attachment size';
$string['maxtimehaspassed'] = 'Sorry, but the maximum time for editing this post ($a) has passed!';
$string['message'] = 'Message';
@@ -138,15 +137,15 @@ $string['namenews'] = 'News forum';
$string['namesocial'] = 'Social forum';
$string['nameteacher'] = 'Teacher forum'; //depreciated after 1.7
$string['newforumposts'] = 'New forum posts';
$string['nodiscussionsstartedby'] = 'No discussions started by this user';
$string['nodiscussions'] = 'There are no discussion topics yet in this forum';
$string['nodiscussionsstartedby'] = 'No discussions started by this user';
$string['noguestpost'] = 'Sorry, guests are not allowed to post.';
$string['noguestsubscribe'] = 'Sorry, guests are not allowed to subscribe to receive forum postings by email.';
$string['noguesttracking'] = 'Sorry, guests are not allowed to set tracking options.';
$string['nomorepostscontaining'] = 'No more posts containing \'$a\' were found';
$string['nonews'] = 'No news has been posted yet';
$string['nopostscontaining'] = 'No posts containing \'$a\' were found';
$string['noposts'] = 'No posts';
$string['nopostscontaining'] = 'No posts containing \'$a\' were found';
$string['noquestions'] = 'There are no questions yet in this forum';
$string['nosubscribers'] = 'There are no subscribers yet for this forum';
$string['nothingnew'] = 'Nothing new for $a';
@@ -167,8 +166,8 @@ $string['openmode1'] = 'No discussions, but replies are allowed';
$string['openmode2'] = 'Discussions and replies are allowed';
$string['overviewnumpostssince'] = 'posts since last login';
$string['overviewnumunread'] = 'total unread';
$string['parentofthispost'] = 'Parent of this post';
$string['parent'] = 'Show parent';
$string['parentofthispost'] = 'Parent of this post';
$string['postadded'] = '<p>Your post was successfully added.</p> <p>You have $a to edit it if you want to make any changes.</p>';
$string['postincontext'] = 'See this post in context';
$string['postmailinfo'] = 'This is a copy of a message posted on the $a website.
@@ -190,27 +189,28 @@ $string['prune'] = 'Split';
$string['qandaforum'] = 'Q and A forum';
$string['qandanotify'] = 'This is a Question and Answer forum. In order to see other responses to these Questions, you must first post your Answer';
$string['rate'] = 'Rate';
$string['rating'] = 'Rating';
$string['ratingeveryone'] = 'Everyone can rate posts';
$string['ratingno'] = 'No ratings';
$string['ratingonlyteachers'] = 'Only $a can rate posts';
$string['ratingpublic'] = '$a can see everyone\'s ratings';
$string['ratingpublicnot'] = '$a can only see their own ratings';
$string['rating'] = 'Rating';
$string['ratings'] = 'Ratings';
$string['ratingssaved'] = 'Ratings saved';
$string['ratingsuse'] = 'Use ratings';
$string['ratingtime'] = 'Restrict ratings to posts with dates in this range:';
$string['re'] = 'Re:';
$string['readtherest'] = 'Read the rest of this topic';
$string['replies'] = 'Replies';
$string['repliesmany'] = '$a replies so far';
$string['repliesone'] = '$a reply so far';
$string['replies'] = 'Replies';
$string['replyforum'] = 'Reply to forum';
$string['reply'] = 'Reply';
$string['re'] = 'Re:';
$string['replyforum'] = 'Reply to forum';
$string['resetforums'] = 'Remove all posts from these types of forums';
$string['resetsubscriptions'] = 'Remove forum subscriptions';
$string['rsssubscriberssdiscussions'] = 'Display the RSS feed for \'$a\' discussions';
$string['rsssubscriberssposts'] = 'Display the RSS feed for \'$a\' posts';
$string['search'] = 'Search';
$string['searchdatefrom'] = 'Posts must be newer than this';
$string['searchdateto'] = 'Posts must be older than this';
$string['searchforumintro'] = 'Please enter search terms into one or more of the following fields:';
@@ -220,10 +220,9 @@ $string['searchnotwords'] = 'These words should NOT be included';
$string['searcholderposts'] = 'Search older posts...';
$string['searchphrase'] = 'This exact phrase must appear in the post';
$string['searchresults'] = 'Search results';
$string['search'] = 'Search';
$string['searchsubject'] = 'These words should be in the subject';
$string['searchuserid'] = 'The Moodle ID of the author';
$string['searchuser'] = 'This name should match the author';
$string['searchuserid'] = 'The Moodle ID of the author';
$string['searchwhichforums'] = 'Choose which forums to search';
$string['searchwords'] = 'These words can appear anywhere in the post';
$string['seeallposts'] = 'See all posts made by this user';
@@ -232,6 +231,7 @@ $string['showsubscribers'] = 'Show/edit current subscribers';
$string['singleforum'] = 'A single simple discussion';
$string['startedby'] = 'Started by';
$string['subject'] = 'Subject';
$string['subscribe'] = 'Subscribe to this forum';
$string['subscribeall'] = 'Subscribe everyone to this forum';
$string['subscribed'] = 'Subscribed';
$string['subscribenone'] = 'Unsubscribe everyone from this forum';
@@ -239,24 +239,23 @@ $string['subscribers'] = 'Subscribers';
$string['subscribersto'] = 'Subscribers to \'$a\'';
$string['subscribestart'] = 'Send me email copies of posts to this forum';
$string['subscribestop'] = 'I don\'t want email copies of posts to this forum';
$string['subscribe'] = 'Subscribe to this forum';
$string['subscriptions'] = 'Subscriptions';
$string['subscription'] = 'Subscription';
$string['subscriptions'] = 'Subscriptions';
$string['thisforumisthrottled'] = 'This forum has a limit to the number of forum postings you can make in a given time period - this is currently set at $a->blockafter posting(s) in $a->blockperiod';
$string['timestartenderror'] = 'Display end date cannot be earlier than the start date';
$string['trackforum'] = 'Track unread posts';
$string['tracking'] = 'Track';
$string['trackingoff'] = 'Off';
$string['trackingon'] = 'On';
$string['trackingoptional'] = 'Optional';
$string['tracking'] = 'Track';
$string['trackingtype'] = 'Read tracking for this forum?';
$string['unread'] = 'Unread';
$string['unreadposts'] = 'Unread posts';
$string['unreadpostsnumber'] = '$a unread posts';
$string['unreadpostsone'] = '1 unread post';
$string['unreadposts'] = 'Unread posts';
$string['unread'] = 'Unread';
$string['unsubscribe'] = 'Unsubscribe from this forum';
$string['unsubscribed'] = 'Unsubscribed';
$string['unsubscribeshort'] = 'Unsubscribe';
$string['unsubscribe'] = 'Unsubscribe from this forum';
$string['warnafter'] = 'Post threshold for warning';
$string['yesforever'] = 'Yes, forever';
$string['yesinitially'] = 'Yes, initially';
+3
View File
@@ -114,4 +114,7 @@ $string['groupsnone'] = 'No groups';
$string['groupsseparate'] = 'Separate groups';
$string['groupsvisible'] = 'Visible groups';
$string['groupaddedsuccesfully'] = 'Group $a added succesfully';
$string['nopermissionforcreation'] = 'Can\'t create group \"$a\" as you dont have the required permissions';
?>
+1 -1
View File
@@ -1,4 +1,4 @@
<h1>Enrolment period</b></h1>
<h1>Enrolment period</h1>
<p>This setting specifies the number of days a student can be
enrolled in this course (starting from the moment they enroll).</p>
+7
View File
@@ -0,0 +1,7 @@
<h1>Hide Preview button</h1>
<p>If this option is set to Yes, the Preview button in the view page of a SCORM/AICC Package activity will be hidden.</p>
<p>The student can choose to preview (browse mode) the activity or attempt it in the normal mode.</p>
<p>When a Learning Object is completed in preview (browse) mode, it's marked with <img src="<?php echo $CFG->wwwroot.'/mod/scorm/pix/browsed.gif' ?>" alt="<?php print_string('browsed','scorm') ?>" title="<?php print_string('browsed','scorm') ?>" /> browsed icon.</p>
+3
View File
@@ -0,0 +1,3 @@
<h1>Number of attempts</h1>
<p>This define the number of attempts permitted to users.<br />It works only with SCORM1.2 and AICC packages. SCORM2004 has its own max attempts definition</p>
+11
View File
@@ -0,0 +1,11 @@
<h1>Student skip content structure page</h1>
<p>If you add a package with only one Learning Object in it, you can choose to auto-skip the content structure page when users click on SCORM activity in the course page.</p>
<p>You can choose:
<ul>
<li><strong>Never</strong> skip the content structure page</li>
<li><strong>First access</strong> skip the content structure page only the first time</li>
<li><strong>Always</strong> skip the content structure page</li>
</ul>
</p>
+3
View File
@@ -0,0 +1,3 @@
<h1>Size</h1>
<p>These two settings define the Learning Objects frame/window height and width.</p>
+3
View File
@@ -0,0 +1,3 @@
<h1>Attempts Grading</h1>
<p>When you permit multiple attempts to users, you can choose how to use the result of attempts in gradebook.</p>
+1 -1
View File
@@ -14,7 +14,7 @@
<p><strong>Default fieldnames:</strong> these are optional - if they are not included then the values are taken from the current language and current course</p>
<p><code class="example1">idnumber, coursename, lang</code> </p>
<p><strong>Optional fieldnames: </strong>all of these are completely optional. </p>
<p> <code class="example1">description, picture, hidepicture</code></p>
<p> <code class="example1">description, enrolmentkey, picture, hidepicture</code></p>
</blockquote>
</li>
<li>Commas within the data should be encoded as &amp;#44 - the script will automatically decode these back to commas. </li>
@@ -2,7 +2,7 @@
<p>The table on this screen shows your final grade and how it was calculated.
The final grade is made up from three possible components.</p>
<ol>
<li>The teacher's grade for your submitted work.</li>
<li>The average of the peer grades for your submitted work. </li>
-1
View File
@@ -9,4 +9,3 @@
<p>This value can be changed at any time and the effect on the grades seen by
the students (and the teacher) is immediate.</p>
+2 -4
View File
@@ -4,10 +4,8 @@
in the set of pieces each student is asked to grade. This will mean that if, say, the
number of peer assessors is 5, then each student will be asked to grade 6
pieces of work, one of them being their own work.</p>
<p>If the number of peer assessors is set to zero and the include self option
is turned on then the assignment becomes a self-graded assignment. This
may or may not include the teacher's grading depending on whether that
option is set or not.
</p>
option is set or not.</p>
+1 -2
View File
@@ -4,5 +4,4 @@
of entries can set to zero, a number between 1 and 20, 50 or 100. If set to
zero then the League Table is <b>not</b> displayed. If it is set to a number between
1 and 20, 50 or 100 then that number of submissions are shown, for example, setting
the number to 10 shows the top ten submissions. </p>
the number to 10 shows the top ten submissions.</p>
+2 -4
View File
@@ -6,10 +6,8 @@
categories (sets) of criteria in a rubric. Typically an assignment will have
something between 5 to 15 assessment items, the
actual number depending on the size and complexity of the assignment. </p>
<p>All assessments have a General Comments field. For a &quot;No
Grading&quot; assignment the value given here determines the
number of additional comment areas. It can be specified as zero and results
in the assessment having only a single General Comments area.
</p>
in the assessment having only a single General Comments area.</p>
+2 -3
View File
@@ -11,7 +11,6 @@
assessment. However, if a student resubmits a number of pieces of work in quick succession then
they are all equally likely to be assessed. The assignment does NOT give priority to the newest
submission.</p>
<p>The student's final grade is based on their overall &quot;grading grade&quot;
and the submission with the highest grade.
</p>
and the submission with the highest grade.</p>
@@ -4,6 +4,6 @@
in the set of pieces each student is asked to assess. This will mean that if, say, the
number of student pieces of work each student has to assess is set at 5, then
each student will be asked to assess 6 pieces of work, one of them being their own work.</p>
<p>If the number of student pieces of work is set to zero and the self assessment option
is turned on then the assignment becomes a self-graded assignment. </p>
@@ -10,9 +10,8 @@
comments are made available to the student. These may provide valuable
guidance to the student in the preparation of their own piece of work for
the assignment. </p>
<p>These assessments do not have to be graded. Leaving a student's
<p>These assessments do not have to be graded. Leaving a student's
assessment of the examples ungraded when NOT stop that student from
submitting their own work. It is recommended, however, that all least a
sample of the assessments are graded for the reasons mentioned above.</p>
+2 -2
View File
@@ -4,8 +4,8 @@
$string['correctanswer'] = 'Correct answer';
$string['editingtruefalse'] = 'Editing a True/False question';
$string['false'] = 'False';
$string['feedbackfalse'] = 'Feedback (False)';
$string['feedbacktrue'] = 'Feedback (True)';
$string['feedbackfalse'] = 'Feedback for the reponse \'False\'.';
$string['feedbacktrue'] = 'Feedback for the reponse \'True\'.';
$string['true'] = 'True';
$string['truefalse'] = 'True/False';
+14 -3
View File
@@ -2,16 +2,19 @@
// scorm.php - created with Moodle 1.7 beta + (2006101003)
$string['activation'] = 'Activation';
$string['advanced'] = 'Parameters';
$string['asset'] = 'Asset';
$string['assetlaunched'] = 'Asset - Viewed';
$string['attempt'] = 'attempt';
$string['attempts'] = 'attempts';
$string['attempt1'] = '1 attempt';
$string['attempts'] = 'Attempts';
$string['attemptsx'] = '$a attempts';
$string['attr_error'] = 'Bad value for attribute ($a->attr) in tag $a->tag.';
$string['autocontinue'] = 'Auto-Continue';
$string['averageattempt'] = 'Average attempts';
$string['badmanifest'] = 'Some manifest errors: see errors log';
$string['badpackage'] = 'There are some problems with the given package. Check it and try again.';
$string['badpackage'] = 'The specified package/manifest is not valid. Check it and try again.';
$string['browse'] = 'Preview';
$string['browsed'] = 'Browsed';
$string['browsemode'] = 'Preview Mode';
@@ -21,6 +24,7 @@ $string['completed'] = 'Completed';
$string['confirmloosetracks'] = 'WARNING: The package seems to be changed or modified. If the package structure is changed, some users tracks may be lost during update process.';
$string['contents'] = 'Contents';
$string['coursepacket'] = 'Course package';
$string['package'] = 'Package file';
$string['coursestruct'] = 'Course structure';
$string['datadir'] = 'Filesystem Error: Can\'t create course data directory';
$string['details'] = 'Track details';
@@ -29,10 +33,12 @@ $string['display'] = 'Display package';
$string['domxml'] = 'DOMXML external library';
$string['element'] = 'Element';
$string['entercourse'] = 'Enter course';
$string['enter'] = 'Enter';
$string['errorlogs'] = 'Errors log';
$string['everyday']= 'Every day';
$string['everytime']= 'Every time it\'s used';
$string['exit'] = 'Exit from course';
$string['exit'] = 'Exit course';
$string['exitactivity'] = 'Exit activity';
$string['expcoll'] = 'Expand/Collide';
$string['external']= 'Update external packages timing';
$string['failed'] = 'Failed';
@@ -71,6 +77,7 @@ $string['menubar'] = 'Show the menu bar';
$string['min'] = 'Min score';
$string['missing_attribute'] = 'Missing attribute $a->attr in tag $a->tag';
$string['missing_tag'] = 'Missing tag $a->tag';
$string['missingparam'] = 'A required is missing or wrong';
$string['mode'] = 'Mode';
$string['modulename'] = 'SCORM/AICC';
$string['modulenameplural'] = 'SCORMs/AICCs';
@@ -143,5 +150,9 @@ $string['viewallreports'] = 'View reports for $a attempts';
$string['whatgrade'] = 'Attempts grading';
$string['width'] = 'Width';
$string['window'] = 'Window';
$string['unziperror'] = 'An error occurs during package unzip';
$string['othersettings'] = 'Additional settings';
$string['updatefreq'] = 'Auto-update frequency';
$string['options'] = 'Options';
?>
+9 -5
View File
@@ -1792,8 +1792,10 @@ function validate_context($contextlevel, $instanceid) {
/**
* Get the context instance as an object. This function will create the
* context instance if it does not exist yet.
* @param $level
* @param $instance
* @param integer $level The context level, for example CONTEXT_COURSE, or CONTEXT_MODULE.
* @param integer $instance The instance id. For $level = CONTEXT_COURSE, this would be $course->id,
* for $level = CONTEXT_MODULE, this would be $cm->id. And so on.
* @return object The context object.
*/
function get_context_instance($contextlevel=NULL, $instance=0) {
@@ -1854,8 +1856,9 @@ function get_context_instance($contextlevel=NULL, $instance=0) {
/**
* Get a context instance as an object, from a given id.
* @param $id
* Get a context instance as an object, from a given context id.
* @param $id a context id.
* @return object The context object.
*/
function get_context_instance_by_id($id) {
@@ -3867,7 +3870,8 @@ function insert_context_rel($context, $deletechild=true, $deleteparent=true) {
// first check validity
// MDL-9057
if (!validate_context($context->contextlevel, $context->instanceid)) {
debugging('Error: Invalid context creation request for level "'.s($contextlevel).'", instance "'.s($instanceid).'".');
debugging('Error: Invalid context creation request for level "' .
s($context->contextlevel) . '", instance "' . s($context->instanceid) . '".');
return NULL;
}
+56
View File
@@ -1761,5 +1761,61 @@ function xmldb_debug($message, $object) {
error_log($message);
}
/**
* Get the lists of courses the current user has $cap capability in
* I am not sure if this is needed, it loops through all courses so
* could cause performance problems.
* If it's not used, we can use a faster function to detect
* capability in restorelib.php
* @param string $cap
* @return array
*/
function get_capability_courses($cap) {
global $USER;
$mycourses = array();
if ($courses = get_records('course')) {
foreach ($courses as $course) {
if (has_capability($cap, get_context_instance(CONTEXT_COURSE, $course->id))) {
$mycourses[] = $course->id;
}
}
}
return $mycourses;
}
/**
* true or false function to see if user can create any courses at all
* @return bool
*/
function user_can_create_courses() {
global $USER;
// if user has course creation capability at any site or course cat, then return true;
if (has_capability('moodle/course:create', get_context_instance(CONTEXT_SYSTEM, SITEID))) {
return true;
} else {
return (bool) count(get_creatable_categories());
}
}
/**
* get the list of categories the current user can create courses in
* @return array
*/
function get_creatable_categories() {
$creatablecats = array();
if ($cats = get_records('course_categories')) {
foreach ($cats as $cat) {
if (has_capability('moodle/course:create', get_context_instance(CONTEXT_COURSECAT, $cat->id))) {
$creatablecats[$cat->id] = $cat->name;
}
}
}
return $creatablecats;
}
// vim:autoindent:expandtab:shiftwidth=4:tabstop=4:tw=140:
?>
+5
View File
@@ -692,6 +692,11 @@ function xmldb_main_upgrade($oldversion=0) {
}
}
if ($result && $oldversion < 2007021511) {
// Small update of guest user to be 100% sure it has the correct mnethostid (MDL-10375)
set_field('user', 'mnethostid', $CFG->mnet_localhost_id, 'username', 'guest');
}
return $result;
}
+76 -44
View File
@@ -55,8 +55,9 @@
* The function looks for the best version to compare and
* everything. This is the only function that should be called
* ever from the rest of Moodle.
* @param string version version to check.
* @param string version version to check.
* @param array results array of results checked.
* @param boolean true/false, whether to print the table or just return results array
* @return boolean true/false, depending of results
*/
function check_moodle_environment($version, &$environment_results, $print_table=true) {
@@ -111,7 +112,7 @@ function check_moodle_environment($version, &$environment_results, $print_table=
return ($result && $status);
}
/**
/**
* This function will print one beautiful table with all the environmental
* configuration and how it suits Moodle needs.
* @param boolean final result of the check (true/false)
@@ -131,16 +132,28 @@ function print_moodle_environment($result, $environment_results) {
$strrestricted = get_string('restricted');
$strenvironmenterrortodo = get_string('environmenterrortodo', 'admin');
/// Here we'll store all the feedback found
$feedbacktext = '';
/// Table header
$table->head = array ($strname, $strinfo, $strreport, $strstatus);
$table->align = array ('center', 'center', 'left', 'center');
$table->wrap = array ('nowrap', '', '', 'nowrap');
$table->size = array ('10', 10, '100%', '10');
$table->width = '90%';
$table->class = 'environmenttable generaltable';
/// Table headers
$servertable = new stdClass;//table for server checks
$servertable->head = array ($strname, $strinfo, $strreport, $strstatus);
$servertable->align = array ('center', 'center', 'left', 'center');
$servertable->wrap = array ('nowrap', '', '', 'nowrap');
$servertable->size = array ('10', 10, '100%', '10');
$servertable->width = '90%';
$servertable->class = 'environmenttable generaltable';
$serverdata = array('ok'=>array(), 'warn'=>array(), 'error'=>array());
$othertable = new stdClass;//table for custom checks
$othertable->head = array ($strinfo, $strreport, $strstatus);
$othertable->align = array ('center', 'left', 'center');
$othertable->wrap = array ('', '', 'nowrap');
$othertable->size = array (10, '100%', '10');
$othertable->width = '90%';
$othertable->class = 'environmenttable generaltable';
$otherdata = array('ok'=>array(), 'warn'=>array(), 'error'=>array());
/// Iterate over each environment_result
$continue = true;
@@ -195,48 +208,67 @@ function print_moodle_environment($result, $environment_results) {
$status = $strcheck;
$warningline = true;
} else { //Handle error result (error)
$status = $strcheck;
$status = $strcheck;
$errorline = true;
}
}
}
}
/// Build the text
$report = get_string($stringtouse, 'admin', $rec);
$linkparts = array();
$linkparts[] = 'admin/environment';
$linkparts[] = $type;
if (!empty($info)){
$linkparts[] = $info;
}
$report = doc_link(join($linkparts, '/'), get_string($stringtouse, 'admin', $rec));
/// Format error or warning line
if ($errorline || $warningline) {
$styletoapply = $errorline? 'error':'warn';
$type = '<span class="'.$styletoapply.'">'.$type.'</span>';
$info = '<span class="'.$styletoapply.'">'.$info.'</span>';
$report = '<span class="'.$styletoapply.'">'.$report.'</span>';
$status = '<span class="'.$styletoapply.'">'.$status.'</span>';
$messagetype = $errorline? 'error':'warn';
} else {
$messagetype = 'ok';
}
/// Add the row to the table
$table->data[] = array ($type, $info, $report, $status);
///Process the feedback if necessary
$status = '<span class="'.$messagetype.'">'.$status.'</span>';
/// Here we'll store all the feedback found
$feedbacktext = '';
///Process the feedback if necessary
if ($feedbackstr = $environment_result->getFeedbackStr()) {
$feedbacktext .= '<li class="environmenttable">'.get_string($feedbackstr, 'admin').'</li>';
$feedbacktext .= '<p class="'.$messagetype.'">'.get_string($feedbackstr, 'admin').'</p>';
}
///Process the bypass if necessary
if ($bypassstr = $environment_result->getBypassStr()) {
$feedbacktext .= '<li class="environmenttable">'.get_string($bypassstr, 'admin').'</li>';
$feedbacktext .= '<p class="warn">'.get_string($bypassstr, 'admin').'</p>';
}
///Process the restrict if necessary
if ($restrictstr = $environment_result->getRestrictStr()) {
$feedbacktext .= '<li class="environmenttable">'.get_string($restrictstr, 'admin').'</li>';
$feedbacktext .= '<p class="error">'.get_string($restrictstr, 'admin').'</p>';
}
if ($feedbacktext) {
$report = $report .$feedbacktext;
}
/// Add the row to the table
if ($environment_result->getPart() == 'custom_check'){
$otherdata[$messagetype][] = array ($info, $report, $status);
} else {
$serverdata[$messagetype][] = array ($type, $info, $report, $status);
}
}
}
//put errors first in
$servertable->data = array_merge($serverdata['error'], $serverdata['warn'], $serverdata['ok']);
$othertable->data = array_merge($otherdata['error'], $otherdata['warn'], $otherdata['ok']);
/// Print table
print_table($table);
/// And feedback accumulated text
if ($feedbacktext) {
print_simple_box('<ul>'.$feedbacktext.'</ul>', 'center', '90%', '', '', 'environmentbox generalbox');
print_heading(get_string('serverchecks', 'admin'));
print_table($servertable);
if (count($othertable->data)){
print_heading(get_string('customcheck', 'admin'));
print_table($othertable);
}
/// Finally, if any error has happened, print the summary box
if (!$result) {
print_simple_box($strenvironmenterrortodo, 'center', '', '', '', 'environmentbox errorbox');
@@ -267,7 +299,7 @@ function normalize_version($version) {
* @return mixed the xmlized structure or false on error
*/
function load_environment_xml() {
global $CFG;
static $data; //Only load and xmlize once by request
@@ -279,7 +311,7 @@ function load_environment_xml() {
/// First of all, take a look inside $CFG->dataroot/environment/environment.xml
$file = $CFG->dataroot.'/environment/environment.xml';
$internalfile = $CFG->dirroot.'/'.$CFG->admin.'/environment.xml';
if (!is_file($file) || !is_readable($file) || filemtime($file) < filemtime($internalfile) ||
if (!is_file($file) || !is_readable($file) || filemtime($file) < filemtime($internalfile) ||
!$contents = file_get_contents($file)) {
/// Fallback to fixed $CFG->admin/environment.xml
if (!is_file($internalfile) || !is_readable($internalfile) || !$contents = file_get_contents($internalfile)) {
@@ -353,12 +385,12 @@ function get_latest_version_available ($version) {
}
/**
/**
* This function will return the xmlized data belonging to one Moodle version
* @return mixed the xmlized structure or false on error
*/
function get_environment_for_version($version) {
/// Normalize the version requested
$version = normalize_version($version);
@@ -379,12 +411,12 @@ function get_environment_for_version($version) {
/// We now we have it. Extract from full contents.
$fl_arr = array_flip($versions);
return $contents['COMPATIBILITY_MATRIX']['#']['MOODLE'][$fl_arr[$version]];
}
/**
/**
* This function will check for everything (DB, PHP and PHP extensions for now)
* returning an array of environment_result objects.
* @param string $version xml version we are going to use to test this server
@@ -525,7 +557,7 @@ function environment_check_php($version) {
} else {
$result->setStatus(false);
}
$result->setLevel($level);
$result->setLevel($level);
$result->setCurrentVersion($current_version);
$result->setNeededVersion($needed_version);
/// Process messages, modifying the $result if needed.
@@ -677,7 +709,7 @@ function environment_check_database($version) {
} else {
$result->setStatus(false);
}
$result->setLevel($level);
$result->setLevel($level);
$result->setCurrentVersion($current_version);
$result->setNeededVersion($needed_version);
$result->setInfo($current_vendor);
@@ -796,7 +828,7 @@ function process_environment_messages($xml, &$result) {
//--- Helper Class to return results to caller ---//
/**
/**
* This class is used to return the results of the environment
* main functions (environment_check_xxxx)
*/
@@ -879,7 +911,7 @@ class environment_results {
function setInfo($info) {
$this->info=$info;
}
/**
* Set the feedback string
* @param string the feedback string
@@ -929,7 +961,7 @@ class environment_results {
}
/**
* Get the current version
* Get the current version
* @return string current version
*/
function getCurrentVersion() {
@@ -1009,7 +1041,7 @@ function bypass_mysql416_reqs ($result) {
/// checker. All those functions will receive the result object and will
/// return it modified as needed (status and bypass string)
/**
/**
* This function will restrict PHP reqs if:
* - We are using PHP 5.0.x, informing about the buggy version
*
+155
View File
@@ -0,0 +1,155 @@
<?php //$Id$
global $CFG;
require_once "$CFG->libdir/form/group.php";
/**
* Class for an element used to choose a file from the course files folder or
* from the local repository used by the IMS CP resource type.
*
*/
class MoodleQuickForm_choosecoursefileorimsrepo extends MoodleQuickForm_group
{
/**
* Options for element :
*
* $url must be relative to home page eg /mod/survey/stuff.php
* courseid => int course id if null then uses $COURSE global
* width => int Height to assign to popup window
* title => string Text to be displayed as popup page title
* options => string List of additional options for popup window
*/
var $_options = array('courseid'=>null,
'height'=>500, 'width'=>750, 'options'=>'none');
/**
* These complement separators, they are appended to the resultant HTML
* @access private
* @var array
*/
var $_wrap = array('', '');
/**
* Class constructor
*
* @access public
* @param string Element's name
* @param mixed Label(s) for an element
* @param array Options to control the element's display
* @param mixed Either a typical HTML attribute string or an associative array
*/
function MoodleQuickForm_choosecoursefileorimsrepo($elementName = null, $elementLabel = null, $options = array(), $attributes = null)
{
$this->HTML_QuickForm_element($elementName, $elementLabel, $attributes);
$this->_appendName = true;
$this->_type = 'choosecoursefileorimsrepo';
// set the options, do not bother setting bogus ones
if (is_array($options)) {
foreach ($options as $name => $value) {
if (isset($this->_options[$name])) {
if (is_array($value) && is_array($this->_options[$name])) {
$this->_options[$name] = @array_merge($this->_options[$name], $value);
} else {
$this->_options[$name] = $value;
}
}
}
}
}
// }}}
// {{{ _createElements()
function _createElements() {
global $CFG, $COURSE;
$this->_elements = array();
$this->_elements[0] =& MoodleQuickForm::createElement('text', 'value', '', array('size'=>'48'));
$this->_elements[1] =& MoodleQuickForm::createElement('button', 'popup', get_string('chooseafile', 'resource') .' ...');
$button =& $this->_elements[1];
if ($this->_options['courseid']!==null){
$courseid=$this->_options['courseid'];
} else {
$courseid=$COURSE->id;
}
// first find out the text field id - this is a bit hacky, is there a better way?
$choose = 'id_'.str_replace(array('[', ']'), array('_', ''), $this->getElementName(0));
$url="/files/index.php?id=$courseid&choose=".$choose;
if ($this->_options['options'] == 'none') {
$options = 'menubar=0,location=0,scrollbars,resizable,width='. $this->_options['width'] .',height='. $this->_options['height'];
}else{
$options = $this->_options['options'];
}
$fullscreen = 0;
$buttonattributes = array('title'=>get_string("chooseafile", "resource"),
'onclick'=>"return openpopup('$url', '".$button->getName()."', '$options', $fullscreen);");
$button->updateAttributes($buttonattributes);
/// With repository active, show the button to browse it
if ($CFG->repositoryactivate) {
$this->_elements[2] =& MoodleQuickForm::createElement('button', 'imsrepo', get_string('browserepository', 'resource'));
$imsbutton =& $this->_elements[2];
$url = "/mod/resource/type/ims/finder.php?directory=&choose=".$choose;
$buttonattributes = array('title'=>get_string("browserepository", "resource"),
'onclick'=>"return openpopup('$url', '".$button->getName()."', '$options', $fullscreen);");
$imsbutton->updateAttributes($buttonattributes);
}
}
/**
* Output a timestamp. Give it the name of the group.
*
* @param array $submitValues
* @param bool $assoc
* @return array
*/
function exportValue(&$submitValues, $assoc = false)
{
$value = null;
$valuearray = $this->_elements[0]->exportValue($submitValues[$this->getName()], true);
$value[$this->getName()]=$valuearray['value'];
return $value;
}
// }}}
/**
* Called by HTML_QuickForm whenever form event is made on this element
*
* @param string $event Name of event
* @param mixed $arg event arguments
* @param object $caller calling object
* @since 1.0
* @access public
* @return void
*/
function onQuickFormEvent($event, $arg, &$caller)
{
switch ($event) {
case 'updateValue':
// constant values override both default and submitted ones
// default values are overriden by submitted
$value = $this->_findValue($caller->_constantValues);
if (null === $value) {
$value = $this->_findValue($caller->_submitValues);
if (null === $value) {
$value = $this->_findValue($caller->_defaultValues);
}
}
if (!is_array($value)) {
$value = array('value' => $value);
}
if (null !== $value) {
$this->setValue($value);
}
return true;
break;
}
return parent::onQuickFormEvent($event, $arg, $caller);
} // end func onQuickFormEvent
}
?>
+1
View File
@@ -1608,6 +1608,7 @@ MoodleQuickForm::registerElementType('modgrade', "$CFG->libdir/form/modgrade.php
MoodleQuickForm::registerElementType('cancel', "$CFG->libdir/form/cancel.php", 'MoodleQuickForm_cancel');
MoodleQuickForm::registerElementType('button', "$CFG->libdir/form/button.php", 'MoodleQuickForm_button');
MoodleQuickForm::registerElementType('choosecoursefile', "$CFG->libdir/form/choosecoursefile.php", 'MoodleQuickForm_choosecoursefile');
MoodleQuickForm::registerElementType('choosecoursefileorimsrepo', "$CFG->libdir/form/choosecoursefileorimsrepo.php", 'MoodleQuickForm_choosecoursefileorimsrepo');
MoodleQuickForm::registerElementType('header', "$CFG->libdir/form/header.php", 'MoodleQuickForm_header');
MoodleQuickForm::registerElementType('submit', "$CFG->libdir/form/submit.php", 'MoodleQuickForm_submit');
MoodleQuickForm::registerElementType('questioncategory', "$CFG->libdir/form/questioncategory.php", 'MoodleQuickForm_questioncategory');
+29 -1
View File
@@ -1678,7 +1678,7 @@ function require_login($courseorid=0, $autologinguest=true, $cm=null) {
}
}
} else {
error(get_strin('nopasswordchangeforced', 'auth'));
error(get_string('nopasswordchangeforced', 'auth'));
}
}
@@ -2456,6 +2456,34 @@ function get_user_fieldnames() {
return $fieldarray;
}
/**
* Creates the default "guest" user. Used both from
* admin/index.php and login/index.php
* @return mixed user object created or boolean false if the creation has failed
*/
function create_guest_record() {
global $CFG;
$guest->auth = 'manual';
$guest->username = 'guest';
$guest->password = hash_internal_user_password('guest');
$guest->firstname = addslashes(get_string('guestuser'));
$guest->lastname = ' ';
$guest->email = 'root@localhost';
$guest->description = addslashes(get_string('guestuserinfo'));
$guest->mnethostid = $CFG->mnet_localhost_id;
$guest->confirmed = 1;
$guest->lang = $CFG->lang;
$guest->timemodified= time();
if (! $guest->id = insert_record("user", $guest)) {
return false;
}
return $guest;
}
/**
* Creates a bare-bones user record
*
-60
View File
@@ -1,60 +0,0 @@
<?php // $Id$
///////////////////////////////////////////////////////////////////////////
// //
// NOTICE OF COPYRIGHT //
// //
// Moodle - Modular Object-Oriented Dynamic Learning Environment //
// http://moodle.org //
// //
// Copyright (C) 1999-2004 Martin Dougiamas http://dougiamas.com //
// //
// This program 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 2 of the License, or //
// (at your option) any later version. //
// //
// This program 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: //
// //
// http://www.gnu.org/copyleft/gpl.html //
// //
///////////////////////////////////////////////////////////////////////////
require_once(dirname(__FILE__) . '/../../config.php');
global $CFG;
require_once($CFG->libdir . '/simpletestlib.php');
require_once($CFG->libdir . '/moodlelib.php');
/**
* This test is meant(!?) to run extensive tests on as much of moodle's
* xhtml output as possible, using a test database as a stable test bed,
* and sending the output of each page to the w3c validating service
* (or some other service that can return a better report), and checking
* whether that report is valid or not.
*
* A global function for validating xhtml output is badly needed.
*
* One possible solution is to extend this WebTestCase class by adding a
* AssertValidXhtml($output) method. The output is obtained by any
* WebTestCase using $this->_browser->getContent().
*
* Setting up validation scripts would then be very simple.
*/
class xhtml_test extends WebTestCase {
function setUp() {
global $CFG;
$this->get($CFG->wwwroot);
$this->click('Course 4');
}
function testLogin() {
$this->assertTitle('Nick\'s tests & Things: Login to the site');
}
}
?>
+62 -2
View File
@@ -25,8 +25,8 @@
///////////////////////////////////////////////////////////////////////////
/// Required files
require_once('typo3/class.t3lib_cs.php');
require_once('typo3/class.t3lib_div.php');
require_once($CFG->libdir.'/typo3/class.t3lib_cs.php');
require_once($CFG->libdir.'/typo3/class.t3lib_div.php');
/// If ICONV is available, lets Typo3 library use it for convert
if (extension_loaded('iconv')) {
@@ -299,6 +299,43 @@ class textlib {
return $encoded;
}
/**
* Converts all the numeric entities &#nnnn; or &#xnnn; to UTF-8
* Original from laurynas dot butkus at gmail at:
* http://php.net/manual/en/function.html-entity-decode.php#75153
* with some custom mods to provide more functionality
*
* @param string $str input string
* @param boolean $htmlent convert also html entities (defaults to true)
*
* NOTE: we could have used typo3 entities_to_utf8() here
* but the direct alternative used runs 400% quicker
* and uses 0.5Mb less memory, so, let's use it
* (tested agains 10^6 conversions)
*/
function entities_to_utf8($str, $htmlent=true) {
static $trans_tbl; /// Going to use static translit table
/// Replace numeric entities
$result = preg_replace('~&#x([0-9a-f]+);~ei', 'textlib::code2utf8(hexdec("\\1"))', $str);
$result = preg_replace('~&#([0-9]+);~e', 'textlib::code2utf8(\\1)', $result);
/// Replace literal entities (if desired)
if ($htmlent) {
/// Generate/create $trans_tbl
if (!isset($trans_tbl)) {
$trans_tbl = array();
foreach (get_html_translation_table(HTML_ENTITIES) as $val=>$key) {
$trans_tbl[$key] = utf8_encode($val);
}
}
$result = strtr($result, $trans_tbl);
}
/// Return utf8-ised string
return $result;
}
/**
* Converts all Unicode chars > 127 to numeric entities &#nnnn; or &#xnnn;.
*
@@ -332,5 +369,28 @@ class textlib {
}
return $str;
}
/**
* Returns the utf8 string corresponding to the unicode value
* (from php.net, courtesy - romans@void.lv)
*
* @param int $num one unicode value
* @return string the UTF-8 char corresponding to the unicode value
*/
function code2utf8($num) {
if ($num < 128) {
return chr($num);
}
if ($num < 2048) {
return chr(($num >> 6) + 192) . chr(($num & 63) + 128);
}
if ($num < 65536) {
return chr(($num >> 12) + 224) . chr((($num >> 6) & 63) + 128) . chr(($num & 63) + 128);
}
if ($num < 2097152) {
return chr(($num >> 18) + 240) . chr((($num >> 12) & 63) + 128) . chr((($num >> 6) & 63) + 128) . chr(($num & 63) + 128);
}
return '';
}
}
?>
+405
View File
@@ -0,0 +1,405 @@
<?php // $Id$
///////////////////////////////////////////////////////////////////////////
// //
// NOTICE OF COPYRIGHT //
// //
// Original code: //
// //
// Drupal - The copyright of both the Drupal software and the //
// "Druplicon" logo belongs to all the original authors, //
// though both are licensed under the GPL. //
// http://drupal.org //
// //
// Modifications: //
// //
// Moodle - Modular Object-Oriented Dynamic Learning Environment //
// http://moodle.com //
// //
// Copyright (C) 2001-3001 Martin Dougiamas http://dougiamas.com //
// (C) 2001-3001 Eloy Lafuente (stronk7) http://contiento.com //
// (C) 2001-3001 Antonio Vicent http://ludens.es //
// //
// This program 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 2 of the License, or //
// (at your option) any later version. //
// //
// This program 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: //
// //
// http://www.gnu.org/copyleft/gpl.html //
// //
///////////////////////////////////////////////////////////////////////////
/// Based on Drupal's search.module version 1.224
/// http://cvs.drupal.org/viewcvs/drupal/drupal/modules/search/search.module?view=markup
/// Usage: $tokens = tokenise_text($text)
/// Returns an array of tokens (key) with their score (value)
/// (see function definition for more info)
/// Some constants
define ('MINIMUM_WORD_SIZE', 3); /// Minimum word size to index and search
define ('MAXIMUM_WORD_SIZE', 50); /// Maximum word size to index and search
define ('START_DELIM', "\xce\xa9\xc3\x91\xc3\x91"); // Use these (omega) and (ntilde) utf-8 combinations
define ('CENTER_DELIM', "\xc3\x91\xce\xa9\xc3\x91"); // as safe delimiters (not puncuation nor usual) while
define ('END_DELIM', "\xc3\x91\xc3\x91\xce\xa9"); // processing numbers ($join_numbers = false)
/**
* Matches Unicode character classes to exclude from the search index.
*
* See: http://www.unicode.org/Public/UNIDATA/UCD.html#General_Category_Values
*
* The index only contains the following character classes:
* Lu Letter, Uppercase
* Ll Letter, Lowercase
* Lt Letter, Titlecase
* Lo Letter, Other
* Nd Number, Decimal Digit
* No Number, Other
*/
define('PREG_CLASS_SEARCH_EXCLUDE',
'\x{0}-\x{2f}\x{3a}-\x{40}\x{5b}-\x{60}\x{7b}-\x{bf}\x{d7}\x{f7}\x{2b0}-'.
'\x{385}\x{387}\x{3f6}\x{482}-\x{489}\x{559}-\x{55f}\x{589}-\x{5c7}\x{5f3}-'.
'\x{61f}\x{640}\x{64b}-\x{65e}\x{66a}-\x{66d}\x{670}\x{6d4}\x{6d6}-\x{6ed}'.
'\x{6fd}\x{6fe}\x{700}-\x{70f}\x{711}\x{730}-\x{74a}\x{7a6}-\x{7b0}\x{901}-'.
'\x{903}\x{93c}\x{93e}-\x{94d}\x{951}-\x{954}\x{962}-\x{965}\x{970}\x{981}-'.
'\x{983}\x{9bc}\x{9be}-\x{9cd}\x{9d7}\x{9e2}\x{9e3}\x{9f2}-\x{a03}\x{a3c}-'.
'\x{a4d}\x{a70}\x{a71}\x{a81}-\x{a83}\x{abc}\x{abe}-\x{acd}\x{ae2}\x{ae3}'.
'\x{af1}-\x{b03}\x{b3c}\x{b3e}-\x{b57}\x{b70}\x{b82}\x{bbe}-\x{bd7}\x{bf0}-'.
'\x{c03}\x{c3e}-\x{c56}\x{c82}\x{c83}\x{cbc}\x{cbe}-\x{cd6}\x{d02}\x{d03}'.
'\x{d3e}-\x{d57}\x{d82}\x{d83}\x{dca}-\x{df4}\x{e31}\x{e34}-\x{e3f}\x{e46}-'.
'\x{e4f}\x{e5a}\x{e5b}\x{eb1}\x{eb4}-\x{ebc}\x{ec6}-\x{ecd}\x{f01}-\x{f1f}'.
'\x{f2a}-\x{f3f}\x{f71}-\x{f87}\x{f90}-\x{fd1}\x{102c}-\x{1039}\x{104a}-'.
'\x{104f}\x{1056}-\x{1059}\x{10fb}\x{10fc}\x{135f}-\x{137c}\x{1390}-\x{1399}'.
'\x{166d}\x{166e}\x{1680}\x{169b}\x{169c}\x{16eb}-\x{16f0}\x{1712}-\x{1714}'.
'\x{1732}-\x{1736}\x{1752}\x{1753}\x{1772}\x{1773}\x{17b4}-\x{17db}\x{17dd}'.
'\x{17f0}-\x{180e}\x{1843}\x{18a9}\x{1920}-\x{1945}\x{19b0}-\x{19c0}\x{19c8}'.
'\x{19c9}\x{19de}-\x{19ff}\x{1a17}-\x{1a1f}\x{1d2c}-\x{1d61}\x{1d78}\x{1d9b}-'.
'\x{1dc3}\x{1fbd}\x{1fbf}-\x{1fc1}\x{1fcd}-\x{1fcf}\x{1fdd}-\x{1fdf}\x{1fed}-'.
'\x{1fef}\x{1ffd}-\x{2070}\x{2074}-\x{207e}\x{2080}-\x{2101}\x{2103}-\x{2106}'.
'\x{2108}\x{2109}\x{2114}\x{2116}-\x{2118}\x{211e}-\x{2123}\x{2125}\x{2127}'.
'\x{2129}\x{212e}\x{2132}\x{213a}\x{213b}\x{2140}-\x{2144}\x{214a}-\x{2b13}'.
'\x{2ce5}-\x{2cff}\x{2d6f}\x{2e00}-\x{3005}\x{3007}-\x{303b}\x{303d}-\x{303f}'.
'\x{3099}-\x{309e}\x{30a0}\x{30fb}-\x{30fe}\x{3190}-\x{319f}\x{31c0}-\x{31cf}'.
'\x{3200}-\x{33ff}\x{4dc0}-\x{4dff}\x{a015}\x{a490}-\x{a716}\x{a802}\x{a806}'.
'\x{a80b}\x{a823}-\x{a82b}\x{d800}-\x{f8ff}\x{fb1e}\x{fb29}\x{fd3e}\x{fd3f}'.
'\x{fdfc}-\x{fe6b}\x{feff}-\x{ff0f}\x{ff1a}-\x{ff20}\x{ff3b}-\x{ff40}\x{ff5b}-'.
'\x{ff65}\x{ff70}\x{ff9e}\x{ff9f}\x{ffe0}-\x{fffd}');
/**
* Matches all 'N' Unicode character classes (numbers)
*/
define('PREG_CLASS_NUMBERS',
'\x{30}-\x{39}\x{b2}\x{b3}\x{b9}\x{bc}-\x{be}\x{660}-\x{669}\x{6f0}-\x{6f9}'.
'\x{966}-\x{96f}\x{9e6}-\x{9ef}\x{9f4}-\x{9f9}\x{a66}-\x{a6f}\x{ae6}-\x{aef}'.
'\x{b66}-\x{b6f}\x{be7}-\x{bf2}\x{c66}-\x{c6f}\x{ce6}-\x{cef}\x{d66}-\x{d6f}'.
'\x{e50}-\x{e59}\x{ed0}-\x{ed9}\x{f20}-\x{f33}\x{1040}-\x{1049}\x{1369}-'.
'\x{137c}\x{16ee}-\x{16f0}\x{17e0}-\x{17e9}\x{17f0}-\x{17f9}\x{1810}-\x{1819}'.
'\x{1946}-\x{194f}\x{2070}\x{2074}-\x{2079}\x{2080}-\x{2089}\x{2153}-\x{2183}'.
'\x{2460}-\x{249b}\x{24ea}-\x{24ff}\x{2776}-\x{2793}\x{3007}\x{3021}-\x{3029}'.
'\x{3038}-\x{303a}\x{3192}-\x{3195}\x{3220}-\x{3229}\x{3251}-\x{325f}\x{3280}-'.
'\x{3289}\x{32b1}-\x{32bf}\x{ff10}-\x{ff19}');
/**
* Matches all 'P' Unicode character classes (punctuation)
*/
define('PREG_CLASS_PUNCTUATION',
'\x{21}-\x{23}\x{25}-\x{2a}\x{2c}-\x{2f}\x{3a}\x{3b}\x{3f}\x{40}\x{5b}-\x{5d}'.
'\x{5f}\x{7b}\x{7d}\x{a1}\x{ab}\x{b7}\x{bb}\x{bf}\x{37e}\x{387}\x{55a}-\x{55f}'.
'\x{589}\x{58a}\x{5be}\x{5c0}\x{5c3}\x{5f3}\x{5f4}\x{60c}\x{60d}\x{61b}\x{61f}'.
'\x{66a}-\x{66d}\x{6d4}\x{700}-\x{70d}\x{964}\x{965}\x{970}\x{df4}\x{e4f}'.
'\x{e5a}\x{e5b}\x{f04}-\x{f12}\x{f3a}-\x{f3d}\x{f85}\x{104a}-\x{104f}\x{10fb}'.
'\x{1361}-\x{1368}\x{166d}\x{166e}\x{169b}\x{169c}\x{16eb}-\x{16ed}\x{1735}'.
'\x{1736}\x{17d4}-\x{17d6}\x{17d8}-\x{17da}\x{1800}-\x{180a}\x{1944}\x{1945}'.
'\x{2010}-\x{2027}\x{2030}-\x{2043}\x{2045}-\x{2051}\x{2053}\x{2054}\x{2057}'.
'\x{207d}\x{207e}\x{208d}\x{208e}\x{2329}\x{232a}\x{23b4}-\x{23b6}\x{2768}-'.
'\x{2775}\x{27e6}-\x{27eb}\x{2983}-\x{2998}\x{29d8}-\x{29db}\x{29fc}\x{29fd}'.
'\x{3001}-\x{3003}\x{3008}-\x{3011}\x{3014}-\x{301f}\x{3030}\x{303d}\x{30a0}'.
'\x{30fb}\x{fd3e}\x{fd3f}\x{fe30}-\x{fe52}\x{fe54}-\x{fe61}\x{fe63}\x{fe68}'.
'\x{fe6a}\x{fe6b}\x{ff01}-\x{ff03}\x{ff05}-\x{ff0a}\x{ff0c}-\x{ff0f}\x{ff1a}'.
'\x{ff1b}\x{ff1f}\x{ff20}\x{ff3b}-\x{ff3d}\x{ff3f}\x{ff5b}\x{ff5d}\x{ff5f}-'.
'\x{ff65}');
/**
* Matches all CJK characters that are candidates for auto-splitting
* (Chinese, Japanese, Korean).
* Contains kana and BMP ideographs.
*/
define('PREG_CLASS_CJK', '\x{3041}-\x{30ff}\x{31f0}-\x{31ff}\x{3400}-\x{4db5}'.
'\x{4e00}-\x{9fbb}\x{f900}-\x{fad9}');
/**
* This function process the text passed at input, extracting all the tokens
* and scoring each one based in their number of ocurrences and relation with
* some well-known html tags
*
* @param string $text the text to be tokenised.
* @param array $stop_words array of utf-8 words than can be ignored in
* the text being processed. There are some cool lists of
* stop words at http://snowball.tartarus.org/
* @param boolean $overlap_cjk option to split CJK text into some overlapping
* tokens is order to allow them to be searched. Useful to build
* indexes and search systems.
* @param boolean $join_numbers option to join in one unique token sequences of numbers
* separated by puntuaction chars. Useful to build indexes and
* search systems.
* @return array one sorted array of tokens, with tokens being the keys and scores in the values.
*/
function tokenise_text($text, $stop_words = array(), $overlap_cjk = false, $join_numbers = false) {
$textlib = textlib_get_instance();
// Multipliers for scores of words inside certain HTML tags.
// Note: 'a' must be included for link ranking to work.
$tags = array('h1' => 25,
'h2' => 18,
'h3' => 15,
'h4' => 12,
'h5' => 9,
'h6' => 6,
'u' => 3,
'b' => 3,
'i' => 3,
'strong' => 3,
'em' => 3,
'a' => 10);
// Strip off all ignored tags to speed up processing, but insert space before/after
// them to keep word boundaries.
$text = str_replace(array('<', '>'), array(' <', '> '), $text);
$text = strip_tags($text, '<'. implode('><', array_keys($tags)) .'>');
// Split HTML tags from plain text.
$split = preg_split('/\s*<([^>]+?)>\s*/', $text, -1, PREG_SPLIT_DELIM_CAPTURE);
// Note: PHP ensures the array consists of alternating delimiters and literals
// and begins and ends with a literal (inserting $null as required).
$tag = FALSE; // Odd/even counter. Tag or no tag.
$score = 1; // Starting score per word
$accum = ' '; // Accumulator for cleaned up data
$tagstack = array(); // Stack with open tags
$tagwords = 0; // Counter for consecutive words
$focus = 1; // Focus state
$results = array(0 => array()); // Accumulator for words for index
foreach ($split as $value) {
if ($tag) {
// Increase or decrease score per word based on tag
list($tagname) = explode(' ', $value, 2);
$tagname = $textlib->strtolower($tagname);
// Closing or opening tag?
if ($tagname[0] == '/') {
$tagname = substr($tagname, 1);
// If we encounter unexpected tags, reset score to avoid incorrect boosting.
if (!count($tagstack) || $tagstack[0] != $tagname) {
$tagstack = array();
$score = 1;
}
else {
// Remove from tag stack and decrement score
$score = max(1, $score - $tags[array_shift($tagstack)]);
}
}
else {
if (isset($tagstack[0]) && $tagstack[0] == $tagname) {
// None of the tags we look for make sense when nested identically.
// If they are, it's probably broken HTML.
$tagstack = array();
$score = 1;
}
else {
// Add to open tag stack and increment score
array_unshift($tagstack, $tagname);
$score += $tags[$tagname];
}
}
// A tag change occurred, reset counter.
$tagwords = 0;
}
else {
// Note: use of PREG_SPLIT_DELIM_CAPTURE above will introduce empty values
if ($value != '') {
$words = tokenise_split($value, $stop_words, $overlap_cjk, $join_numbers);
foreach ($words as $word) {
// Add word to accumulator
$accum .= $word .' ';
$num = is_numeric($word);
// Check word length
if ($num || $textlib->strlen($word) >= MINIMUM_WORD_SIZE) {
// Normalize numbers
if ($num && $join_numbers) {
$word = (int)ltrim($word, '-0');
}
if (!isset($results[0][$word])) {
$results[0][$word] = 0;
}
$results[0][$word] += $score * $focus;
// Focus is a decaying value in terms of the amount of unique words up to this point.
// From 100 words and more, it decays, to e.g. 0.5 at 500 words and 0.3 at 1000 words.
$focus = min(1, .01 + 3.5 / (2 + count($results[0]) * .015));
}
$tagwords++;
// Too many words inside a single tag probably mean a tag was accidentally left open.
if (count($tagstack) && $tagwords >= 15) {
$tagstack = array();
$score = 1;
}
}
}
}
$tag = !$tag;
}
$res = array();
if (isset($results[0]) && count($results[0]) > 0) {
$res = $results[0];
arsort($res, SORT_NUMERIC);
}
return $res;
}
///
/// Some helper functions (should be considered private)
///
/**
* Splits a string into tokens
*/
function tokenise_split($text, $stop_words, $overlap_cjk, $join_numbers) {
static $last = NULL;
static $lastsplit = NULL;
if ($last == $text) {
return $lastsplit;
}
// Process words
$text = tokenise_simplify($text, $overlap_cjk, $join_numbers);
$words = explode(' ', $text);
// Limit word length to 50
array_walk($words, 'tokenise_truncate_word');
// We have stop words, apply them
if (is_array($stop_words) && !empty($stop_words)) {
// Normalise them
$simp_stop_words = explode(' ', tokenise_simplify(implode(' ', $stop_words), $overlap_cjk, $join_numbers));
// Extract from the list
$words = array_diff($words, $simp_stop_words);
}
// Save last keyword result
$last = $text;
$lastsplit = $words;
return $words;
}
/**
* Simplifies a string according to indexing rules.
*/
function tokenise_simplify($text, $overlap_cjk, $join_numbers) {
$textlib = textlib_get_instance();
// Decode entities to UTF-8
$text = $textlib->entities_to_utf8($text, true);
// Lowercase
$text = $textlib->strtolower($text);
// Simple CJK handling
if ($overlap_cjk) {
$text = preg_replace_callback('/['. PREG_CLASS_CJK .']+/u', 'tokenise_expand_cjk', $text);
}
// To improve searching for numerical data such as dates, IP addresses
// or version numbers, we consider a group of numerical characters
// separated only by punctuation characters to be one piece.
// This also means that searching for e.g. '20/03/1984' also returns
// results with '20-03-1984' in them.
// Readable regexp: ([number]+)[punctuation]+(?=[number])
if ($join_numbers) {
$text = preg_replace('/(['. PREG_CLASS_NUMBERS .']+)['. PREG_CLASS_PUNCTUATION .']+(?=['. PREG_CLASS_NUMBERS .'])/u', '\1', $text);
} else {
// Keep all the detected numbers+punctuation in a safe place in order to restore them later
preg_match_all('/['. PREG_CLASS_NUMBERS .']+['. PREG_CLASS_PUNCTUATION . PREG_CLASS_NUMBERS .']+/u', $text, $foundseqs);
$storedseqs = array();
foreach (array_unique($foundseqs[0]) as $ntkey => $value) {
$prefix = (string)(count($storedseqs) + 1);
$storedseqs[START_DELIM.$prefix.CENTER_DELIM.$ntkey.END_DELIM] = $value;
}
if (!empty($storedseqs)) {
$text = str_replace($storedseqs, array_keys($storedseqs), $text);
}
}
// The dot, underscore and dash are simply removed. This allows meaningful
// search behaviour with acronyms and URLs.
$text = preg_replace('/[._-]+/', '', $text);
// With the exception of the rules above, we consider all punctuation,
// marks, spacers, etc, to be a word boundary.
$text = preg_replace('/['. PREG_CLASS_SEARCH_EXCLUDE .']+/u', ' ', $text);
// Restore, if not joining numbers, recover the original strings
if (!$join_numbers) {
if (!empty($storedseqs)) {
$text = str_replace(array_keys($storedseqs), $storedseqs, $text);
}
}
return $text;
}
/**
* Basic CJK tokeniser. Simply splits a string into consecutive, overlapping
* sequences of characters (MINIMUM_WORD_SIZE long).
*/
function tokenise_expand_cjk($matches) {
$textlib = textlib_get_instance();
$str = $matches[0];
$l = $textlib->strlen($str);
// Passthrough short words
if ($l <= MINIMUM_WORD_SIZE) {
return ' '. $str .' ';
}
$tokens = ' ';
// FIFO queue of characters
$chars = array();
// Begin loop
for ($i = 0; $i < $l; ++$i) {
// Grab next character
$current = $textlib->substr($str, 0, 1);
$str = substr($str, strlen($current));
$chars[] = $current;
if ($i >= MINIMUM_WORD_SIZE - 1) {
$tokens .= implode('', $chars) .' ';
array_shift($chars);
}
}
return $tokens;
}
/**
* Helper function for array_walk in search_index_split.
* Truncates one string (token) to MAXIMUM_WORD_SIZE
*/
function tokenise_truncate_word(&$text) {
$textlib = textlib_get_instance();
$text = $textlib->substr($text, 0, MAXIMUM_WORD_SIZE);
}
?>
+92 -61
View File
@@ -739,7 +739,7 @@ function choose_from_menu_nested($options,$name,$selected='',$nothing='choose',$
}
if (!empty($options)) {
foreach ($options as $section => $values) {
$output .= ' <optgroup label="'. s(format_string($section)) .'">'."\n";
foreach ($values as $value => $label) {
$output .= ' <option value="'. format_string($value) .'"';
@@ -1386,7 +1386,7 @@ function format_string ($string, $striplinks=true, $courseid=NULL ) {
if ($strcache === false or count($strcache) > 2000 ) { // this number might need some tuning to limit memory usage in cron
$strcache = array();
}
//init course id
if (empty($courseid)) {
$courseid = $COURSE->id;
@@ -1406,7 +1406,7 @@ function format_string ($string, $striplinks=true, $courseid=NULL ) {
if (!empty($CFG->filterall)) {
$string = filter_string($string, $courseid);
}
// If the site requires it, strip ALL tags from this string
if (!empty($CFG->formatstringstriptags)) {
$string = strip_tags($string);
@@ -1418,7 +1418,7 @@ function format_string ($string, $striplinks=true, $courseid=NULL ) {
//Store to cache
$strcache[$md5] = $string;
return $string;
}
@@ -1527,7 +1527,7 @@ function filter_string($string, $courseid=NULL) {
}
if (empty($courseid)) {
$courseid = $COURSE->id;
$courseid = $COURSE->id;
}
require_once($CFG->libdir.'/filterlib.php');
@@ -1682,6 +1682,9 @@ function clean_text($text, $format=FORMAT_MOODLE) {
/// Clean up embedded scripts and , using kses
$text = cleanAttributes($text);
/// Again remove tags that are not allowed
$text = strip_tags($text, $ALLOWED_TAGS);
/// Remove script events
$text = eregi_replace("([^a-z])language([[:space:]]*)=", "\\1Xlanguage=", $text);
$text = eregi_replace("([^a-z])on([a-z]+)([[:space:]]*)=", "\\1Xon\\2=", $text);
@@ -2049,7 +2052,7 @@ function get_html_lang($dir = false) {
//Accessibility: added the 'lang' attribute to $direction, used in theme <html> tag.
$language = str_replace('_', '-', str_replace('_utf8', '', current_language()));
@header('Content-Language: '.$language);
return ($direction.' lang="'.$language.'" xml:lang="'.$language.'"');
return ($direction.' lang="'.$language.'" xml:lang="'.$language.'"');
}
@@ -2078,9 +2081,9 @@ function print_header ($title='', $heading='', $navigation='', $focus='',
$usexml=false, $bodytags='', $return=false) {
global $USER, $CFG, $THEME, $SESSION, $ME, $SITE, $COURSE;
$heading = format_string($heading); // Fix for MDL-8582
/// This makes sure that the header is never repeated twice on a page
if (defined('HEADER_PRINTED')) {
debugging('print_header() was called more than once - this should not happen. Please check the code for this page closely. Note: error() and redirect() are now safe to call after print_header().');
@@ -2096,7 +2099,7 @@ function print_header ($title='', $heading='', $navigation='', $focus='',
}
$meta = $stylesheetshtml.$meta;
/// Add the meta page from the themes if any were requested
$metapage = '';
@@ -2251,7 +2254,7 @@ function print_header ($title='', $heading='', $navigation='', $focus='',
$pageclass .= ' course-'.$COURSE->id;
if (($pageid != 'site-index') && ($pageid != 'course-view') &&
if (($pageid != 'site-index') && ($pageid != 'course-view') &&
(strstr($pageid, 'admin') === FALSE)) {
$pageclass .= ' nocoursepage';
}
@@ -2638,10 +2641,22 @@ function style_sheet_setup($lastmodified=0, $lifetime=300, $themename='', $force
echo replace_cssconstants($css);
} else {
/// Actually output all the files in order.
foreach ($files as $file) {
echo '/***** '.$file[1].' start *****/'."\n\n";
@include_once($file[0].'/'.$file[1]);
echo '/***** '.$file[1].' end *****/'."\n\n";
if (empty($CFG->CSSEdit) && empty($THEME->CSSEdit)) {
foreach ($files as $file) {
echo '/***** '.$file[1].' start *****/'."\n\n";
@include_once($file[0].'/'.$file[1]);
echo '/***** '.$file[1].' end *****/'."\n\n";
}
} else {
foreach ($files as $file) {
echo '/* @group '.$file[1].' */'."\n\n";
if (strstr($file[1], '.css') !== FALSE) {
echo '@import url("'.$CFG->themewww.'/'.$file[1].'");'."\n\n";
} else {
@include_once($file[0].'/'.$file[1]);
}
echo '/* @end */'."\n\n";
}
}
}
}
@@ -2695,7 +2710,7 @@ function theme_setup($theme = '', $params=NULL) {
} else {
$extra='?file=';
}
$CFG->pixpath = $CFG->wwwroot. '/pix/smartpix.php'.$extra.'/'.$theme;
$CFG->modpixpath = $CFG->wwwroot .'/pix/smartpix.php'.$extra.'/'.$theme.'/mod';
} else if (empty($THEME->custompix)) { // Could be set in the above file
@@ -2950,7 +2965,7 @@ function print_navigation ($navigation, $separator=0, $return=false) {
if (strpos($a, '</a>') === false) {
$navigation[] = array('title' => $a, 'url' => '');
} else {
if (preg_match('/<a.*href="([^"]*)">(.*)<\/a>/', $a, $matches)) {
if (preg_match('/<a.*href="([^"]*)">(.*)<\/a>/', $a, $matches)) {
$navigation[] = array('title' => $matches[2], 'url' => $matches[1]);
}
}
@@ -2982,7 +2997,7 @@ function print_navigation ($navigation, $separator=0, $return=false) {
$output .= '<li class="first">'."$separator\n<a ".$CFG->frametarget.' onclick="this.target=\''.$CFG->framename.'\'" href="'
.$url.'">'."$title</a>\n</li>\n";
}
}
}
$output .= "</ul>\n";
}
@@ -3087,7 +3102,7 @@ function print_continue($link, $return=false) {
if ($link == '') {
if (!empty($_SERVER['HTTP_REFERER'])) {
$link = $_SERVER['HTTP_REFERER'];
$link = str_replace('&', '&amp;', $link); // make it valid XHTML
$link = str_replace('&', '&amp;', $link); // make it valid XHTML
} else {
$link = $CFG->wwwroot .'/';
}
@@ -3183,7 +3198,7 @@ function print_single_button($link, $options, $label='OK', $method='get', $targe
$link = str_replace('"', '&quot;', $link); //basic XSS protection
$output .= '<div class="singlebutton">';
// taking target out, will need to add later target="'.$target.'"
$output .= '<form action="'. $link .'" method="'. $method .'">';
$output .= '<form action="'. $link .'" method="'. $method .'">';
$output .= '<div>';
if ($options) {
foreach ($options as $name => $value) {
@@ -3649,7 +3664,7 @@ function print_table($table, $return=false) {
if (!isset($align[$key])) {
$align[$key] = '';
}
$output .= '<th class="header c'.$key.'" scope="col">'. $heading .'</th>';
// commenting the following code out as <th style does not validate MDL-7861
//$output .= '<th sytle="vertical-align:top;'. $align[$key].$size[$key] .';white-space:nowrap;" class="header c'.$key.'" scope="col">'. $heading .'</th>';
@@ -3868,15 +3883,15 @@ function print_textarea($usehtmleditor, $rows, $cols, $width, $height, $name, $v
if ($usehtmleditor) {
if (!empty($courseid) and has_capability('moodle/course:managefiles', get_context_instance(CONTEXT_COURSE, $courseid))) {
$httpsrequired = empty($HTTPSPAGEREQUIRED) ? '' : '&httpsrequired=1';
$httpsrequired = empty($HTTPSPAGEREQUIRED) ? '' : '&httpsrequired=1';
// needed for course file area browsing in image insert plugin
$str .= ($scriptcount < 1) ? '<script type="text/javascript" src="'.
$CFG->httpswwwroot .'/lib/editor/htmlarea/htmlarea.php?id='.$courseid.$httpsrequired.'"></script>'."\n" : '';
} else {
$httpsrequired = empty($HTTPSPAGEREQUIRED) ? '' : '?httpsrequired=1';
$httpsrequired = empty($HTTPSPAGEREQUIRED) ? '' : '?httpsrequired=1';
$str .= ($scriptcount < 1) ? '<script type="text/javascript" src="'.
$CFG->httpswwwroot .'/lib/editor/htmlarea/htmlarea.php'.$httpsrequired.'"></script>'."\n" : '';
}
$str .= ($scriptcount < 1) ? '<script type="text/javascript" src="'.
$CFG->httpswwwroot .'/lib/editor/htmlarea/lang/en.php"></script>'."\n" : '';
@@ -3902,11 +3917,11 @@ function print_textarea($usehtmleditor, $rows, $cols, $width, $height, $name, $v
}
$str .= '</textarea>'."\n";
if ($usehtmleditor) {
if ($usehtmleditor) {
// Show shortcuts button if HTML editor is in use, but only if JavaScript is enabled (MDL-9556)
$str .= '<script type="text/javascript">document.write(\''.
$str .= '<script type="text/javascript">document.write(\''.
str_replace('\'','\\\'',editorshortcutshelpbutton()).'\'); </script>';
}
}
if ($return) {
return $str;
@@ -4015,13 +4030,13 @@ function update_course_icon($courseid) {
$coursecontext = get_context_instance(CONTEXT_COURSE, $courseid);
$capcheck = false;
$capcheck = false;
if (has_capability('moodle/course:manageactivities', $coursecontext) ||
has_capability('moodle/site:manageblocks', $coursecontext)) {
$capcheck = true;
$capcheck = true;
} else {
// loop through all child context, see if user has moodle/course:manageactivities or moodle/site:manageblocks
// loop through all child context, see if user has moodle/course:manageactivities or moodle/site:manageblocks
if ($children = get_child_contexts($coursecontext)) {
foreach ($children as $child) {
$childcontext = get_record('context', 'id', $child);
@@ -4029,12 +4044,12 @@ function update_course_icon($courseid) {
has_capability('moodle/site:manageblocks', $childcontext)) {
$capcheck = true;
break;
}
}
}
}
}
}
if ($capcheck) {
if (!empty($USER->editing)) {
$string = get_string('turneditingoff');
@@ -4248,10 +4263,11 @@ function update_group_button($courseid, $groupid) {
if (has_capability('moodle/course:managegroups', get_context_instance(CONTEXT_GROUP, $groupid))) {
$string = get_string('editgroupprofile');
return "<form $CFG->frametarget method=\"get\" action=\"$CFG->wwwroot/course/group.php\">".
return "<form $CFG->frametarget method=\"get\" action=\"$CFG->wwwroot/group/edit.php\">".
'<div>'.
'<input type="hidden" name="id" value="'. $courseid .'" />'.
'<input type="hidden" name="group" value="'. $groupid .'" />'.
'<input type="hidden" name="courseid" value="'. $courseid .'" />'.
'<input type="hidden" name="id" value="'. $groupid .'" />'.
'<input type="hidden" name="grouping" value="-1" />'.
'<input type="hidden" name="edit" value="on" />'.
'<input type="submit" value="'. $string .'" /></div></form>';
}
@@ -4278,7 +4294,7 @@ function update_groups_button($courseid) {
$edit = 'on';
}
return "<form $CFG->frametarget method=\"get\" action=\"$CFG->wwwroot/course/groups.php\">".
return "<form $CFG->frametarget method=\"get\" action=\"$CFG->wwwroot/group/index.php\">".
'<div>'.
"<input type=\"hidden\" name=\"id\" value=\"$courseid\" />".
"<input type=\"hidden\" name=\"edit\" value=\"$edit\" />".
@@ -4453,7 +4469,8 @@ function navmenu($course, $cm=NULL, $targetwindow='self') {
if ($selectmod and has_capability('moodle/site:viewreports', $context)) {
$logstext = get_string('alllogs');
$logslink = '<li>'."\n".'<a title="'.$logstext.'" '.$CFG->frametarget.' href="'.
$logslink = '<li>'."\n".'<a title="'.$logstext.'" '.'onclick="this.target=\''.$CFG->framename.'\';"'.
' href="'.
$CFG->wwwroot.'/course/report/log/index.php?chooselog=1&amp;user=0&amp;date=0&amp;id='.
$course->id.'&amp;modid='.$selectmod->cm.'">'.
'<img class="icon log" src="'.$CFG->pixpath.'/i/log.gif" alt="'.$logstext.'" /></a>'."\n".'</li>';
@@ -4461,14 +4478,16 @@ function navmenu($course, $cm=NULL, $targetwindow='self') {
}
if ($backmod) {
$backtext= get_string('activityprev', 'access');
$backmod = '<li>'."\n".'<form action="'.$CFG->wwwroot.'/mod/'.$backmod->mod.'/view.php" '.$CFG->frametarget.'>'."\n".'<div>'."\n".
$backmod = '<li>'."\n".'<form action="'.$CFG->wwwroot.'/mod/'.$backmod->mod.'/view.php" '.
'onclick="this.target=\''.$CFG->framename.'\';">'."\n".'<div>'."\n".
'<input type="hidden" name="id" value="'.$backmod->cm.'" />'."\n".
'<button type="submit" title="'.$backtext.'">'.link_arrow_left($backtext, $url='', $accesshide=true)."\n".
'</button>'."\n".'</div>'."\n".'</form>'."\n".'</li>'."\n";
}
if ($nextmod) {
$nexttext= get_string('activitynext', 'access');
$nextmod = '<li>'."\n".'<form action="'.$CFG->wwwroot.'/mod/'.$nextmod->mod.'/view.php" '.$CFG->frametarget.'>'."\n".'<div>'."\n".
$nextmod = '<li>'."\n".'<form action="'.$CFG->wwwroot.'/mod/'.$nextmod->mod.'/view.php" '.
'onclick="this.target=\''.$CFG->framename.'\';">'."\n".'<div>'."\n".
'<input type="hidden" name="id" value="'.$nextmod->cm.'" />'."\n".
'<button type="submit" title="'.$nexttext.'">'.link_arrow_right($nexttext, $url='', $accesshide=true)."\n".
'</button>'."\n".'</div>'."\n".'</form>'."\n".'</li>'."\n";
@@ -4958,7 +4977,7 @@ function helpbutton ($page, $title='', $module='moodle', $image=true, $linktext=
$linkobject .= $imagetext;
} else {
$linkobject .= '<img class="iconhelp" alt="'.s(strip_tags($tooltip)).'" src="'.
$CFG->pixpath .'/help.gif" />';
$CFG->pixpath .'/help.gif" />';
}
} else {
$linkobject .= $tooltip;
@@ -5019,7 +5038,7 @@ function editorshortcutshelpbutton() {
global $CFG;
$imagetext = '<img src="' . $CFG->httpswwwroot . '/lib/editor/htmlarea/images/kbhelp.gif" alt="'.
get_string('editorshortcutkeys').'" class="iconkbhelp" />';
get_string('editorshortcutkeys').'" class="iconkbhelp" />';
return helpbutton('editorshortcuts', get_string('editorshortcutkeys'), 'moodle', true, false, '', true, $imagetext);
}
@@ -5171,7 +5190,7 @@ function redirect($url, $message='', $delay=-1, $adminroot = '') {
<?php
// fix for MDL-8517, admin pages redirections causes bad xhtml
if ($adminroot) {
admin_externalpage_print_footer($adminroot);
admin_externalpage_print_footer($adminroot);
} else {
print_footer('none');
}
@@ -5519,7 +5538,7 @@ function print_side_block_end($attributes = array()) {
/**
* Prints out code needed for spellchecking.
* Original idea by Ludo (Marc Alier).
*
*
* Opening CDATA and <script> are output by weblib::use_html_editor()
* @uses $CFG
* @param boolean $usehtmleditor Normally set by $CFG->htmleditor, can be overriden here
@@ -5548,7 +5567,7 @@ function print_speller_code ($usehtmleditor=false, $return=false) {
$str .= "\tspeller.openChecker();\n";
$str .= '}'."\n";
}
if ($return) {
return $str;
}
@@ -5672,7 +5691,7 @@ function print_tabs($tabrows, $selected=NULL, $inactive=NULL, $activated=NULL, $
}
/// Print out the current tree of tabs (this function is recursive)
$output = convert_tree_to_html($tree);
$output = "\n\n".'<div class="tabtree">'.$output.'</div><div class="clearer"> </div>'."\n\n";
@@ -5713,9 +5732,9 @@ function convert_tree_to_html($tree, $row=0) {
}
if ($tab->inactive || $tab->active || ($tab->selected && !$tab->linkedwhenselected)) {
if ($tab->selected) {
if ($tab->selected) {
$liclass .= (empty($liclass)) ? 'here selected' : ' here selected';
} else if ($tab->active) {
} else if ($tab->active) {
$liclass .= (empty($liclass)) ? 'here active' : ' here active';
}
}
@@ -5728,13 +5747,13 @@ function convert_tree_to_html($tree, $row=0) {
$str .= '<a href="'.$tab->link.'" title="'.$tab->title.'"><span>'.$tab->text.'</span></a>';
}
if (!empty($tab->subtree)) {
if (!empty($tab->subtree)) {
$str .= convert_tree_to_html($tab->subtree, $row+1);
} else if ($tab->selected) {
$str .= '<div class="tabrow'.($row+1).' empty">&nbsp;</div>'."\n";
}
$str .= '</li>'."\n";
$str .= ' </li>'."\n";
}
$str .= '</ul>'."\n";
@@ -5771,7 +5790,6 @@ function convert_tabrows_to_tree($tabrows, $selected, $inactive, $activated) {
return $subtree;
}
/**
* Returns a string containing a link to the user documentation for the current
* page. Also contains an icon by default. Shown to teachers and admin only.
@@ -5782,25 +5800,39 @@ function convert_tabrows_to_tree($tabrows, $selected, $inactive, $activated) {
function page_doc_link($text='', $iconpath='') {
global $ME, $CFG;
if (empty($CFG->docroot) || !has_capability('moodle/site:doclinks')) {
return '';
}
if (empty($CFG->pagepath)) {
$CFG->pagepath = $ME;
}
$target = '';
if (!empty($CFG->doctonewwindow)) {
$target = ' target="_blank"';
}
$path = str_replace($CFG->httpswwwroot.'/','', $CFG->pagepath); // Because the page could be HTTPSPAGEREQUIRED
$path = str_replace('.php', '', $path);
if (empty($path)) { // Not for home page
return '';
}
return doc_link($path, $text, $iconpath);
}
/**
* Returns a string containing a link to the user documentation.
* Also contains an icon by default. Shown to teachers and admin only.
*
* @param string $path The page link after doc root and language, no
* leading slash.
* @param string $text The text to be displayed for the link
* @param string $iconpath The path to the icon to be displayed
*/
function doc_link($path='', $text='', $iconpath='') {
global $CFG;
if (empty($CFG->docroot) || !has_capability('moodle/site:doclinks')) {
return '';
}
$target = '';
if (!empty($CFG->doctonewwindow)) {
$target = ' target="_blank"';
}
$lang = str_replace('_utf8', '', current_language());
@@ -5815,7 +5847,6 @@ function page_doc_link($text='', $iconpath='') {
return $str;
}
/**
* Returns true if the current site debugging settings are equal or above specified level.
* If passed a parameter it will emit a debugging notice similar to trigger_error(). The
+1 -12
View File
@@ -25,18 +25,7 @@
/// Check if the guest user exists. If not, create one.
if (! record_exists('user', 'username', 'guest')) {
$guest->auth = 'manual';
$guest->username = 'guest';
$guest->password = hash_internal_user_password('guest');
$guest->firstname = addslashes(get_string('guestuser'));
$guest->lastname = ' ';
$guest->email = 'root@localhost';
$guest->description = addslashes(get_string('guestuserinfo'));
$guest->confirmed = 1;
$guest->lang = $CFG->lang;
$guest->timemodified= time();
if (! $guest->id = insert_record('user', $guest)) {
if (! $guest = create_guest_record()) {
notify('Could not create guest user record !!!');
}
}
+17
View File
@@ -170,6 +170,23 @@
</td>
</tr>
<tr valign="top">
<td align="right">forum_enabletimedposts:</td>
<td>
<?php
unset($options);
$options[0] = get_string("no");
$options[1] = get_string("yes");
choose_from_menu ($options, "forum_enabletimedposts", $CFG->forum_enabletimedposts, "", "", "");
?>
</td>
<td>
<?php
print_string("configenabletimedposts","forum");
?>
</td>
</tr>
<tr>
<td colspan="3" align="center">
<input type="submit" value="<?php print_string("savechanges") ?>" /></td>
+1 -1
View File
@@ -35,7 +35,7 @@ class mod_glossary_entry_form extends moodleform {
$categories = array(0 => get_string('notcategorised', 'glossary'));
}
$categoriesEl = $mform->addElement('select', 'categories', get_string('categories', 'glossary'), $categories);
$categoriesEl =& $mform->addElement('select', 'categories', get_string('categories', 'glossary'), $categories);
$categoriesEl->setMultiple(true);
$categoriesEl->setSize(5);
+12
View File
@@ -197,6 +197,7 @@ define("HOTPOT_MAX_EVENT_LENGTH", "432000"); // 5 days maximum
function hotpot_add_instance(&$hotpot) {
if (hotpot_set_form_values($hotpot)) {
if ($result = insert_record('hotpot', $hotpot)) {
$hotpot->id = $result;
hotpot_update_events($hotpot);
}
} else {
@@ -1529,7 +1530,18 @@ class hotpot_xml_quiz extends hotpot_xml_tree {
$replace = "hotpot_convert_navbutton_url('".$this->get_baseurl()."','".$this->reference."','\\1','".$this->course."')";
$this->source = preg_replace($search, $replace, $this->source);
// relative URLs in <a ... onclick="window.open('...')...">...</a>
$search = '|'.'(?<='.'onclick="'."window.open\\('".')'."([^']*)".'(?='."'\\);return false;".'")'.'|ise';
$replace = "hotpot_convert_url('".$this->get_baseurl()."','".$this->reference."','\\1')";
$this->source = preg_replace($search, $replace, $this->source);
} else {
// relative URLs in <a ... onclick="window.open('...')...">...</a>
$search = '|'.'(?<='.'onclick=&quot;'."window.open\\(&apos;".')'."(.*?)".'(?='."&apos;\\);return false;".'&quot;)'.'|ise';
$replace = "hotpot_convert_url('".$this->get_baseurl()."','".$this->reference."','\\1')";
$this->source = preg_replace($search, $replace, $this->source);
if ($this->parse_xml) {
$this->filetype = 'xml';
+1 -1
View File
@@ -47,7 +47,7 @@
$journal->intro = trim($journal->intro);
if (!empty($journal->intro)) {
print_box( format_text($journal->intro, $journal->introformat), 5, 'generalbox', 'intro');
print_box( format_text($journal->intro, $journal->introformat), 'generalbox', 'intro');
}
echo '<br />';
+7 -4
View File
@@ -311,18 +311,21 @@ class quiz_report extends quiz_default_report {
$from = 'FROM '.$CFG->prefix.'user u JOIN '.$CFG->prefix.'role_assignments ra ON ra.userid = u.id '.
groups_members_join_sql().
'LEFT JOIN '.$CFG->prefix.'quiz_attempts qa ON u.id = qa.userid AND qa.quiz = '.$quiz->id;
$where = ' WHERE ra.contextid ' .$contextlists . ' AND '.groups_members_where_sql($currentgroup).' AND qa.preview = 0';
$where = ' WHERE ra.contextid ' .$contextlists . ' AND '.groups_members_where_sql($currentgroup);
if ($noattempts == 1) {
// noattempts = 1 means only no attempts, so make the left join ask for only records where the right is null (no attempts)
$where .= ' AND qa.userid IS NULL'; // show ONLY no attempts;
} // no else, the left join is not filtered, which means we get both back.
} else {
// We are including attempts, so exclude previews.
$where .= ' AND qa.preview = 0';
}
} else if (empty($currentgroup)) {
// We don't care about group, and we to do something funky with attempts
// So do a left join on attempts
$from = 'FROM '.$CFG->prefix.'user u JOIN '.$CFG->prefix.'role_assignments ra ON ra.userid = u.id LEFT JOIN '.$CFG->prefix.'quiz_attempts qa ON u.id = qa.userid AND qa.quiz = '.$quiz->id;
$where = " WHERE ra.contextid $contextlists AND qa.preview = 0";
$where = " WHERE ra.contextid $contextlists";
if (empty($noattempts)) {
$where .= ' AND qa.userid IS NOT NULL'; // show ONLY students with attempts;
$where .= ' AND qa.userid IS NOT NULL AND qa.preview = 0'; // show ONLY students with attempts;
} else if ($noattempts == 1) {
// noattempts = 1 means only no attempts, so make the left join ask for only records where the right is null (no attempts)
$where .= ' AND qa.userid IS NULL'; // show ONLY students without attempts;
+2 -4
View File
@@ -3,7 +3,7 @@
require('../../../../config.php');
require('../../lib.php');
$choose = required_param('choose');
$choose = required_param('choose', PARAM_FILE);
require_login();
@@ -15,8 +15,6 @@
print_simple_box(get_string('localfileinfo', 'resource'), 'center');
$chooseparts = explode('.', $choose);
?>
<script type="text/javascript">
//<![CDATA[
@@ -28,7 +26,7 @@
} else {
window.close();
}
opener.document.forms['<?php echo $chooseparts[0]."'].".$chooseparts[1] ?>.value = '<?php p(RESOURCE_LOCALPATH) ?>'+path;
opener.document.getElementById('<?php echo $choose ?>').value = '<?php p(RESOURCE_LOCALPATH) ?>'+path;
window.close();
}
//]]>
+3 -3
View File
@@ -80,7 +80,7 @@ function display() {
print_header();
print_simple_box(format_text($resource->alltext, FORMAT_HTML, $formatoptions, $course->id),
"center", "", "", "20");
"center clearfix", "", "", "20");
print_footer($course);
} else { /// Make a page and a pop-up window
@@ -95,7 +95,7 @@ function display() {
echo '</script>';
if (trim(strip_tags($resource->summary))) {
print_simple_box(format_text($resource->summary, FORMAT_MOODLE, $formatoptions, $course->id), "center");
print_simple_box(format_text($resource->summary, FORMAT_MOODLE, $formatoptions, $course->id), "center clearfix");
}
$link = "<a href=\"$CFG->wwwroot/mod/resource/view.php?inpopup=true&amp;id={$cm->id}\" onclick=\"this.target='resource{$resource->id}'; return openpopup('/mod/resource/view.php?inpopup=true&amp;id={$cm->id}', 'resource{$resource->id}','{$resource->popup}');\">".format_string($resource->name,true)."</a>";
@@ -114,7 +114,7 @@ function display() {
"", "", true, update_module_button($cm->id, $course->id, $this->strresource),
navmenu($course, $cm));
print_simple_box(format_text($resource->alltext, FORMAT_HTML, $formatoptions, $course->id), "center", "", "", "20");
print_simple_box(format_text($resource->alltext, FORMAT_HTML, $formatoptions, $course->id), "center clearfix", "", "", "20");
$strlastmodified = get_string("lastmodified");
echo "<div class=\"modified\">$strlastmodified: ".userdate($resource->timemodified)."</div>";
+22 -12
View File
@@ -10,6 +10,7 @@
/// Directory to browse, inside repository. Starts on ''.
$directory = optional_param ('directory', '', PARAM_PATH);
$choose = optional_param('choose', 'id_reference_value', PARAM_FILE);
/// Get the language strings needed
$strdeployall = get_string('deployall','resource');
@@ -59,26 +60,35 @@
/// Prints the toolbar.
echo '<div id="ims_toolbar" style="padding:10px;">';
ims_print_crumbtrail($directory);
ims_print_crumbtrail($directory, $choose);
/// If admin, add extra buttons - redeploy & help.
if (has_capability('moodle/site:config', get_context_instance(CONTEXT_SYSTEM, SITEID))) {
echo " | (<a href=\"repository_deploy.php?file=$directory&all=force\">$strdeployall</a>) ";
echo " | (<a href=\"repository_deploy.php?file=$directory&amp;all=force\">$strdeployall</a>) ";
helpbutton("deploy", get_string("deployall", "resource"), "resource", true);
}
echo '</div>';
/// Prints the file list from list generated above.
echo '<div id="ims_filelist"><ul style="list-style:none;padding:10px;margin:0px;">';
echo '<div id="ims_filelist">';
?>
<script type="text/javascript">
//<![CDATA[
function set_value(txt) {
opener.document.getElementById('<?php echo $choose ?>').value = txt;
window.close();
}
//]]>
</script>
<?php
echo '<ul style="list-style:none;padding:10px;margin:0px;">';
if ($items != array()) {
foreach ($items as $item) {
if ($item->type == 'deployed') {
echo "<li><img src=\"images/ims.gif\" alt=\"IMS CP Package\" /> $item->name (<a href=\"javascript:
opener.document.forms['form'].reference.value = '#$item->path';
opener.document.forms['form'].name.value = '$item->name';
window.close();
\">$strchoose</a>) (<a href=\"preview.php?directory=$item->path\">$strpreview</a>)</li>\n";
echo "<li><img src=\"images/ims.gif\" alt=\"IMS CP Package\" /> $item->name" .
"(<a onclick=\"return set_value('#$item->path')\" href=\"#\">$strchoose</a>) " .
"(<a href=\"preview.php?directory=$item->path&amp;choose=$choose\">$strpreview</a>)</li>\n";
}
else if ($item->type == 'not deployed') {
/// Only displays non-deployed IMS CP's if admin user.
@@ -87,7 +97,7 @@
}
}
else if ($item->type == 'directory') {
echo "<li><img src=\"images/dir.gif\" alt=\"IMS CP Package\" /> <a href=\"?directory=$item->path\">$item->name</a></li>\n";
echo "<li><img src=\"images/dir.gif\" alt=\"IMS CP Package\" /> <a href=\"?directory=$item->path&amp;choose=$choose\">$item->name</a></li>\n";
}
}
}
@@ -101,7 +111,7 @@
exit;
/// Generates the crumbtrial from $directory. Just splits up on '/'.
function ims_print_crumbtrail($directory) {
function ims_print_crumbtrail($directory, $choose='') {
$strrepository = get_string('repository','resource');
$arr = explode('/', $directory);
@@ -111,13 +121,13 @@
return;
}
else {
$output = "<a href=\"?directory=\">$strrepository</a> &#187; ";
$output = "<a href=\"?directory=&amp;choose=$choose\">$strrepository</a> &#187; ";
}
$itemdir = '';
foreach ($arr as $item) {
if ($item == '') continue;
$itemdir .= '/'.$item;
$output .= "<a href=\"?directory=$itemdir\">$item</a> &#187; ";
$output .= "<a href=\"?directory=$itemdir&amp;choose=$choose\">$item</a> &#187; ";
}
$output .= $last;
echo $output;
-264
View File
@@ -1,264 +0,0 @@
<?php // $Id$
///////////////////////////////////////////////////////////////////////////
// //
// NOTICE OF COPYRIGHT //
// //
// Moodle - Modular Object-Oriented Dynamic Learning Environment //
// http://moodle.com //
// //
// Copyright (C) 2001-3001 Martin Dougiamas http://dougiamas.com //
// (C) 2001-3001 Eloy Lafuente (stronk7) http://contiento.com //
// //
// This program 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 2 of the License, or //
// (at your option) any later version. //
// //
// This program 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: //
// //
// http://www.gnu.org/copyleft/gpl.html //
// //
///////////////////////////////////////////////////////////////////////////
?>
<tr valign="top">
<td align="right" style="white-space:nowrap;">
<script type="text/javascript">
//<![CDATA[
function showhide (id, set) {
divobj = document.getElementById(id);
butobj = document.getElementById(id+'button');
prefobj = document.getElementById(id+'pref');
if (set == true) {
if (prefobj.value == '1') {
divobj.style.display = 'block';
butobj.value = '<?php print_string("hidesettings") ?>';
} else {
divobj.style.display = 'none';
butobj.value = '<?php print_string("showsettings") ?>...';
}
} else {
if (prefobj.value == '1') {
divobj.style.display = 'none';
butobj.value = '<?php print_string("showsettings") ?>...';
prefobj.value = '0';
} else {
divobj.style.display = 'block';
butobj.value = '<?php print_string("hidesettings") ?>';
prefobj.value = '1';
}
}
}
function optiondeselector () {
document.getElementById('menuparam_tableofcontents').disabled = false;
document.getElementById('menuparam_skipsubmenus').disabled = false;
document.getElementById('menuparam_navigationupbutton').disabled = false;
if (document.getElementById('menuparam_navigationmenu').value == 1) {
document.getElementById('menuparam_tableofcontents').value = 0;
document.getElementById('menuparam_skipsubmenus').value = 1;
document.getElementById('menuparam_navigationupbutton').value = 0;
document.getElementById('menuparam_tableofcontents').disabled = true;
document.getElementById('menuparam_skipsubmenus').disabled = true;
document.getElementById('menuparam_navigationupbutton').disabled = true;
}
if (document.getElementById('menuparam_navigationbuttons').value == 0) {
document.getElementById('menuparam_navigationupbutton').value = 0;
document.getElementById('menuparam_navigationupbutton').disabled = true;
}
}
//]]>
</script>
<b><?php echo $strfilename ?>:</b>
</td>
<td>
<?php
$strbrowserepository = get_string('browserepository', 'resource');
echo "<input type=\"text\" name=\"reference\" size=\"90\" value=\"$form->reference\" alt=\"reference\" /><br />";
button_to_popup_window ("/files/index.php?id=$form->course&amp;choose=form.reference", "coursefiles", $strchooseafile, 500, 750, $strchooseafile);
if ($CFG->repositoryactivate) button_to_popup_window ("/mod/resource/type/ims/finder.php?directory=", "", $strbrowserepository, 500, 750, "Browse repository");
?>
</td>
</tr>
<tr><td colspan="2"><hr /></td></tr>
<tr>
<td align="right"><b><?php print_string("display", "resource") ?>:</b></td>
<td>
<input type="button" value="hide settings" id="windowsettingsbutton" onclick="javascript: return showhide('windowsettings');" />
<input type="hidden" name="windowsettingspref" id="windowsettingspref"
value="<?php echo get_user_preferences('resource_windowsettingspref', $CFG->resource_windowsettings); ?>" />
<?php helpbutton("window", get_string("display", "resource"), "resource", true) ?>
</td>
</tr>
<tr><td colspan="2">
<div id="windowsettings">
<table class="boxaligncenter">
<tr valign="top">
<td colspan="2">
<script type="text/javascript">
//<![CDATA[
var popupitems = [<?php echo $popupoptions; ?>];
var allitems = [<?php echo $alloptions; ?>];
//]]>
</script>
<input type="radio" name="windowpopup" value="0" alt="<?php print_string('pagewindow', 'resource') ?>" <?php echo ($windowtype != "popup") ? "checked=\"checked\"" : "" ?>
onclick="lockoptions('form', 'windowpopup[1]', popupitems);" />
<b title="<?php print_string("pagedisplay", "resource") ?>"><?php print_string("pagewindow", "resource") ?></b>
<blockquote>
<div>
<input type="hidden" name="framepage" value="1" />
</div>
</blockquote>
</td>
</tr>
<tr valign="top">
<td colspan="2">
<input name="windowpopup" type="radio" value="1" alt="<?php p($strnewwindow)?>" <?php echo ($windowtype == "popup") ? "checked=\"checked\"" : "" ?>
onclick="lockoptions('form', 'windowpopup[1]', popupitems);" />
<b title="<?php p($strnewwindowopen) ?>"><?php p($strnewwindow) ?></b>
<blockquote>
<fieldset class="invisiblefieldset">
<?php
foreach ($window as $name => $value) {
if ($name == "height" or $name == "width") {
continue;
}
echo "<input name=\"h$name\" type=\"hidden\" value=\"0\" />";
echo "<input name=\"$name\" type=\"checkbox\" value=\"1\" ".$window->$name." alt=\"$name\" />";
$stringname = "str$name";
echo $$stringname."<br />";
}
?>
<input name="hwidth" type="hidden" value="0" />
<input name="width" type="text" size="4" value="<?php p($window->width) ?>" alt="<?php p($strwidth) ?>" />
<?php p($strwidth) ?><br />
<input name="hheight" type="hidden" value="0" />
<input name="height" type="text" size="4" value="<?php p($window->height) ?>" alt="<?php p($strheight) ?>" />
<?php p($strheight) ?><br />
<?php
if ($windowtype == "page") {
echo "<script type=\"text/javascript\">\n//<![CDATA[\n";
echo "lockoptions('form','windowpopup[1]', popupitems);";
echo "\n//]]>\n</script>";
}
?>
</fieldset>
</blockquote>
</td>
</tr>
</table>
</div>
</td></tr>
<tr>
<td align="right"><b><?php print_string("parameters", "resource") ?>:</b></td>
<td>
<input type="button" value="hide settings" id="parametersettingsbutton" onclick="javascript: return showhide('parametersettings');" />
<input type="hidden" name="parametersettingspref" id="parametersettingspref"
value="<?php echo get_user_preferences('resource_parametersettingspref', $CFG->resource_parametersettings); ?>" />
<?php helpbutton("imsparameters", get_string("parameters", "resource"), "resource", true) ?>
</td>
</tr>
<tr><td colspan="2">
<div id="parametersettings">
<table class="boxaligncenter">
<?php
$yesno = array();
$yesno[0] = get_string('no');
$yesno[1] = get_string('yes');
echo "<tr>\n";
echo "<td valign=\"top\" align=\"right\">\n";
echo get_string('navigationmenu','resource').': ';
echo "</td>\n";
echo "<td valign=\"top\">\n";
choose_from_menu($yesno, "param_navigationmenu", $form->param_navigationmenu, "", "optiondeselector();");
echo "</td>\n";
echo "</tr>\n";
echo "<tr>\n";
echo "<td valign=\"top\" align=\"right\">\n";
echo get_string('tableofcontents','resource').': ';
echo "</td>\n";
echo "<td valign=\"top\">\n";
choose_from_menu($yesno, "param_tableofcontents", $form->param_tableofcontents, "");
echo "</td>\n";
echo "</tr>\n";
echo "<tr>\n";
echo "<td valign=\"top\" align=\"right\">\n";
echo get_string('navigationbuttons','resource').': ';
echo "</td>\n";
echo "<td valign=\"top\">\n";
choose_from_menu($yesno, "param_navigationbuttons", $form->param_navigationbuttons, "", "optiondeselector();");
echo "</td>\n";
echo "</tr>\n";
echo "<tr>\n";
echo "<td valign=\"top\" align=\"right\">\n";
echo get_string('skipsubmenus','resource').': ';
echo "</td>\n";
echo "<td valign=\"top\">\n";
choose_from_menu($yesno, "param_skipsubmenus", $form->param_skipsubmenus, "");
echo "</td>\n";
echo "</tr>\n";
echo "<tr>\n";
echo "<td valign=\"top\" align=\"right\">\n";
echo get_string('navigationup','resource').': ';
echo "</td>\n";
echo "<td valign=\"top\">\n";
choose_from_menu($yesno, "param_navigationupbutton", $form->param_navigationupbutton, "");
echo "</td>\n";
echo "</tr>\n";
?>
</table>
</div>
<script type="text/javascript">
//<![CDATA[
optiondeselector();
showhide('parametersettings', true);
showhide('windowsettings', true);
//]]>
</script>
</td></tr>
<?php print_visible_setting($form); ?>
+18 -9
View File
@@ -9,6 +9,7 @@
require_once('repository_config.php');
$directory = required_param ('directory', PARAM_PATH);
$choose = optional_param ('choose', 'id_reference_value', PARAM_FILE);
$page = optional_param ('page', 0, PARAM_INT);
/// Calculate the path of the IMS CP to be displayed
@@ -57,7 +58,9 @@
/// content - this produces everything else
/// adds side navigation bar if needed. must also adjust width of iframe to accomodate
echo "<div id=\"ims-menudiv\">"; preview_buttons($directory, $items['title']); echo preview_ims_generate_toc($items, $directory, 0, $page); echo "</div>";
echo "<div id=\"ims-menudiv\">";
preview_buttons($directory, $items['title'], $choose);
echo preview_ims_generate_toc($items, $directory, 0, $page); echo "</div>";
$fullurl = "$CFG->repositorywebroot/$directory/".$items[$page]->href;
/// prints iframe filled with $fullurl ;width:".$iframewidth." missing also height=\"420px\"
@@ -138,7 +141,7 @@
return $contents;
}
function preview_buttons($directory, $name) {
function preview_buttons($directory, $name, $choose='') {
$strchoose = get_string('choose','resource');
$strback = get_string('back','resource');
@@ -146,13 +149,19 @@
$arr = explode('/', $directory);
array_pop($arr);
$directory = implode('/', $arr);
echo "<div id=\"ims_preview_buttons\" style=\"padding:10px;\">
(<a href='finder.php?directory=$directory'>$strback</a>)
(<a href=\"javascript:
opener.document.forms['form'].reference.value = '#$path';
opener.document.forms['form'].name.value = '$name';
window.close();
\">$strchoose</a>)</div>";
?>
<script type="text/javascript">
//<![CDATA[
function set_value(txt) {
opener.document.getElementById('<?php echo $choose ?>').value = txt;
window.close();
}
//]]>
</script>
<?php
echo "<div id=\"ims_preview_buttons\" style=\"padding:10px;\">".
"(<a href=\"finder.php?directory=$directory&amp;choose=$choose\">$strback</a>) ".
"(<a onclick=\"return set_value('#$path')\" href=\"#\">$strchoose</a>)</div>";
}
?>
+2 -1
View File
@@ -39,6 +39,7 @@
require_once($CFG->libdir.'/filelib.php');
require_once($CFG->dirroot.'/mod/resource/type/ims/repository_config.php');
/**
* Extend the base resource class for ims resources
*/
@@ -632,7 +633,7 @@ class resource_ims extends resource_base {
function setup_elements(&$mform) {
global $CFG, $RESOURCE_WINDOW_OPTIONS;
$mform->addElement('choosecoursefile', 'reference', get_string('location'));
$mform->addElement('choosecoursefileorimsrepo', 'reference', get_string('location'));
$mform->addRule('name', null, 'required', null, 'client');
$mform->addElement('header', 'displaysettings', get_string('display', 'resource'));
+9 -8
View File
@@ -17,8 +17,9 @@
function SCORMapi1_2() {
// Standard Data Type Definition
CMIString256 = '^.{0,255}$';
//CMIString4096 = '^[.|\\n|\\r]{0,4095}$';
CMIString4096 = '^.{0,4096}$';
//CMIString256 = '^[\.|\\n|\\r]{0,255}$';
//CMIString4096 = '^[\.|\\n|\\r]{0,4095}$';
CMITime = '^([0-2]{1}[0-9]{1}):([0-5]{1}[0-9]{1}):([0-5]{1}[0-9]{1})(\.[0-9]{1,2})?$';
CMITimespan = '^([0-9]{2,4}):([0-9]{2}):([0-9]{2})(\.[0-9]{1,2})?$';
CMIInteger = '^\\d+$';
@@ -132,8 +133,8 @@ function SCORMapi1_2() {
$objectives = '';
foreach($userdata as $element => $value){
if (substr($element,0,14) == 'cmi.objectives') {
preg_match('/.(\d+)./',$element,$matches);
$element = preg_replace('/.(\d+)./',"_\$1.",$element);
preg_match('/\.(\d+)\./',$element,$matches);
$element = preg_replace('/\.(\d+)\./',".\$1.",$element);
if ($matches[1] == $count) {
$count++;
$end = strpos($element,$matches[1])+strlen($matches[1]);
@@ -334,7 +335,7 @@ function SCORMapi1_2() {
ranges = range.split('#');
value = value*1.0;
if ((value >= ranges[0]) && (value <= ranges[1])) {
eval(element+'="'+value+'";');
eval(element+'=value;');
errorCode = "0";
<?php
if (debugging('',DEBUG_DEVELOPER)) {
@@ -347,9 +348,9 @@ function SCORMapi1_2() {
}
} else {
if (element == 'cmi.comments') {
eval(element+'+="'+value+'";');
eval(element+'=value;');
} else {
eval(element+'="'+value+'";');
eval(element+'=value;');
}
errorCode = "0";
<?php
@@ -479,7 +480,7 @@ function SCORMapi1_2() {
function TotalTime() {
total_time = AddTime(cmi.core.total_time, cmi.core.session_time);
return '&'+underscore('cmi.core.total_time')+'='+escape(total_time);
return '&'+underscore('cmi.core.total_time')+'='+encodeURIComponent(total_time);
}
function CollectData(data,parent) {
@@ -494,7 +495,7 @@ function SCORMapi1_2() {
if (elementmodel != "cmi.core.session_time") {
if ((typeof eval('datamodel["'+elementmodel+'"]')) != "undefined") {
if (eval('datamodel["'+elementmodel+'"].mod') != 'r') {
elementstring = '&'+underscore(element)+'='+escape(data[property]);
elementstring = '&'+underscore(element)+'='+encodeURIComponent(data[property]);
if ((typeof eval('datamodel["'+elementmodel+'"].defaultvalue')) != "undefined") {
if (eval('datamodel["'+elementmodel+'"].defaultvalue') != data[property]) {
datastring += elementstring;
+6 -6
View File
@@ -165,7 +165,7 @@ function scorm_get_toc($user,$scorm,$liststyle,$currentorg='',$scoid='',$mode='n
$scormpixdir = $CFG->modpixpath.'/scorm/pix';
$result = new stdClass();
$result->toc = "<ul id='0' class='$liststyle'>\n";
$result->toc = "<ul id='s0' class='$liststyle'>\n";
$tocmenus = array();
$result->prerequisites = true;
$incomplete = false;
@@ -238,7 +238,7 @@ function scorm_get_toc($user,$scorm,$liststyle,$currentorg='',$scoid='',$mode='n
if (isset($_COOKIE['hide:SCORMitem'.$sco->id])) {
$style = ' style="display: none;"';
}
$result->toc .= "\t\t<li><ul id='$sublist' class='$liststyle'$style>\n";
$result->toc .= "\t\t<li><ul id='s$sublist' class='$liststyle'$style>\n";
$level++;
} else {
$result->toc .= $closelist;
@@ -263,7 +263,7 @@ function scorm_get_toc($user,$scorm,$liststyle,$currentorg='',$scoid='',$mode='n
if (isset($_COOKIE['hide:SCORMitem'.$nextsco->id])) {
$icon = 'plus';
}
$result->toc .= '<a href="javascript:expandCollide(img'.$sublist.','.$sublist.','.$nextsco->id.');"><img id="img'.$sublist.'" src="'.$scormpixdir.'/'.$icon.'.gif" alt="'.$strexpand.'" title="'.$strexpand.'"/></a>';
$result->toc .= '<a href="javascript:expandCollide(\'img'.$sublist.'\',s'.$sublist.','.$nextsco->id.');"><img id="img'.$sublist.'" src="'.$scormpixdir.'/'.$icon.'.gif" alt="'.$strexpand.'" title="'.$strexpand.'"/></a>';
} else if ($isvisible) {
$result->toc .= '<img src="'.$scormpixdir.'/spacer.gif" />';
}
@@ -372,13 +372,13 @@ function scorm_get_toc($user,$scorm,$liststyle,$currentorg='',$scoid='',$mode='n
var w3c=document.getElementById?true:false
var beg=nn?"document.ids.":w3c?"document.getElementById(":"document.all.";
var mid=w3c?").style":".style";
which = which.substring(0,(which.length));
if (eval(beg+list+mid+".display") != "none") {
which.src = "'.$scormpixdir.'/plus.gif";
document.getElementById(which).src = "'.$scormpixdir.'/plus.gif";
eval(beg+list+mid+".display=\'none\';");
new cookie("hide:SCORMitem" + item, 1, 356, "/").set();
} else {
which.src = "'.$scormpixdir.'/minus.gif";
document.getElementById(which).src = "'.$scormpixdir.'/minus.gif";
eval(beg+list+mid+".display=\'block\';");
new cookie("hide:SCORMitem" + item, 1, -1, "/").set();
}
+3 -3
View File
@@ -11,7 +11,7 @@ function scorm_get_toc($user,$scorm,$liststyle,$currentorg='',$scoid='',$mode='n
$scormpixdir = $CFG->modpixpath.'/scorm/pix';
$result = new stdClass();
$result->toc = "<ul id='0' class='$liststyle'>\n";
$result->toc = "<ul id='s0' class='$liststyle'>\n";
$tocmenus = array();
$result->prerequisites = true;
$incomplete = false;
@@ -87,7 +87,7 @@ function scorm_get_toc($user,$scorm,$liststyle,$currentorg='',$scoid='',$mode='n
if (isset($_COOKIE['hide:SCORMitem'.$sco->id])) {
$style = ' style="display: none;"';
}
$result->toc .= "\t\t<li><ul id='$sublist' class='$liststyle'$style>\n";
$result->toc .= "\t\t<li><ul id='s$sublist' class='$liststyle'$style>\n";
$level++;
} else {
$result->toc .= $closelist;
@@ -114,7 +114,7 @@ function scorm_get_toc($user,$scorm,$liststyle,$currentorg='',$scoid='',$mode='n
if (isset($_COOKIE['hide:SCORMitem'.$nextsco->id])) {
$icon = 'plus';
}
$result->toc .= '<a href="javascript:expandCollide(img'.$sublist.','.$sublist.','.$nextsco->id.');">'.
$result->toc .= '<a href="javascript:expandCollide(img'.$sublist.',s'.$sublist.','.$nextsco->id.');">'.
'<img id="img'.$sublist.'" src="'.$scormpixdir.'/'.$icon.'.gif" alt="'.$strexpand.'" title="'.$strexpand.'"/></a>';
} else if ($isvisible) {
$result->toc .= '<img src="'.$scormpixdir.'/spacer.gif" />';
+28 -16
View File
@@ -55,16 +55,20 @@ function xmldb_scorm_upgrade($oldversion=0) {
'previous' => '0');
/// Retrieve old datas
if ($olddatas = get_records('scorm_scoes')) {
foreach ($olddatas as $olddata) {
$newdata = new stdClass();
$newdata->scoid = $olddata->id;
foreach ($fields as $field => $value) {
if ($olddata->$field != $value) {
$newdata->name = addslashes($field);
$newdata->value = addslashes($olddata->$field);
$id = insert_record('scorm_scoes_data', $newdata);
$result = $result && ($id != 0);
if ($scorms = get_records('scorm')) {
foreach ($scorms as $scorm) {
if ($olddatas = get_records('scorm_scoes','scorm', $scorm->id)) {
foreach ($olddatas as $olddata) {
$newdata = new stdClass();
$newdata->scoid = $olddata->id;
foreach ($fields as $field => $value) {
if ($olddata->$field != $value) {
$newdata->name = addslashes($field);
$newdata->value = addslashes($olddata->$field);
$id = insert_record('scorm_scoes_data', $newdata);
$result = $result && ($id != 0);
}
}
}
}
}
@@ -251,12 +255,20 @@ function xmldb_scorm_upgrade($oldversion=0) {
}
if ($result && $oldversion < 2007031300) {
if ($tracks = get_records('scorm_scoes_track')) {
foreach ($tracks as $track) {
$element = preg_replace('/\.N(\d+)\./',".\$1.",$track->element);
if ($track->element != $element) {
$track->element = $element;
update_record('scorm_scoes_track',$track);
if ($scorms = get_records('scorm')) {
foreach ($scorms as $scorm) {
if ($scoes = get_records('scorm_scoes','scorm',$scorm->id)) {
foreach ($scoes as $sco) {
if ($tracks = get_records('scorm_scoes_track','scoid',$sco->id)) {
foreach ($tracks as $track) {
$element = preg_replace('/\.N(\d+)\./',".\$1.",$track->element);
if ($track->element != $element) {
$track->element = $element;
update_record('scorm_scoes_track',$track);
}
}
}
}
}
}
}
+16 -19
View File
@@ -27,17 +27,15 @@ class mod_scorm_mod_form extends moodleform_mod {
$mform->addElement('choosecoursefile', 'reference', get_string('package','scorm'));
$mform->setType('reference', PARAM_RAW); // We need to find a better PARAM
$mform->addRule('reference', get_string('required'), 'required', null, 'client');
$mform->setHelpButton('reference',array('package', get_string('package', 'scorm')), 'scorm');
$mform->setHelpButton('reference',array('package', get_string('package', 'scorm'), 'scorm'));
//-------------------------------------------------------------------------------
// Other Settings
$mform->addElement('header', 'advanced', get_string('othersettings'));
$mform->addElement('header', 'advanced', get_string('othersettings', 'form'));
// Grading
$mform->addElement('static', 'grade', get_string('grades'));
// Grade Method
$mform->addElement('select', 'grademethod', get_string('grademethod', 'scorm'), $SCORM_GRADE_METHOD);
$mform->setHelpButton('grademethod', array('grademethod',get_string('grademethod', 'scorm')), 'scorm');
$mform->setHelpButton('grademethod', array('grademethod',get_string('grademethod', 'scorm'),'scorm'));
$mform->setDefault('grademethod', 0);
// Maximum Grade
@@ -50,30 +48,29 @@ class mod_scorm_mod_form extends moodleform_mod {
// Attempts
$mform->addElement('static', '', '' ,'<hr />');
$mform->addElement('static', 'attempts', get_string('attempts','scorm'));
// Max Attempts
$attempts = array(0 => get_string('nolimit','scorm'));
for ($i=1; $i<=$CFG->scorm_maxattempts; $i++) {
if ($i == 1) {
$attempts[$i] = $i . ' ' . get_string('attempt','scorm');
$attempts[$i] = get_string('attempt1','scorm');
} else {
$attempts[$i] = $i . ' ' . get_string('attempts','scorm');
$attempts[$i] = get_string('attemptsx','scorm', $i);
}
}
$mform->addElement('select', 'maxattempt', get_string('maximumattempts', 'scorm'), $attempts);
$mform->setHelpButton('maxattempt', array('maxattempt',get_string('maximumattempts', 'scorm')), 'scorm');
$mform->setHelpButton('maxattempt', array('maxattempt',get_string('maximumattempts', 'scorm'), 'scorm'));
$mform->setDefault('maxattempt', 1);
// What Grade
$mform->addElement('select', 'whatgrade', get_string('whatgrade', 'scorm'), $SCORM_WHAT_GRADE);
$mform->disabledIf('whatgrade', 'maxattempt','eq',1);
$mform->setHelpButton('whatgrade', array('whatgrade',get_string('whatgrade', 'scorm')), 'scorm');
$mform->setHelpButton('whatgrade', array('whatgrade',get_string('whatgrade', 'scorm'), 'scorm'));
$mform->setDefault('whatgrade', 0);
$mform->setAdvanced('whatgrade');
// Activation period
/*$mform->addElement('static', '', '' ,'<hr />');
/* $mform->addElement('static', '', '' ,'<hr />');
$mform->addElement('static', 'activation', get_string('activation','scorm'));
$datestartgrp = array();
$datestartgrp[] = &$mform->createElement('date_time_selector', 'startdate');
@@ -89,12 +86,12 @@ class mod_scorm_mod_form extends moodleform_mod {
$mform->addGroup($dateendgrp, 'dateendgrp', get_string('to'), ' ', false);
$mform->setDefault('enddate', 0);
$mform->setDefault('enddisabled', 1);
$mform->disabledIf('dateendgrp', 'enddisabled', 'checked'); */
$mform->disabledIf('dateendgrp', 'enddisabled', 'checked');
*/
// Stage Size
$mform->addElement('static', '', '' ,'<hr />');
$mform->addElement('static', 'stagesize', get_string('stagesize','scorm'));
$mform->setHelpButton('stagesize', array('stagesize',get_string('stagesize', 'scorm')), 'scorm');
$mform->setHelpButton('stagesize', array('stagesize',get_string('stagesize', 'scorm'), 'scorm'));
// Width
$mform->addElement('text', 'width', get_string('width','scorm'),'maxlength="5" size="5"');
$mform->setDefault('width', $CFG->scorm_framewidth);
@@ -122,7 +119,7 @@ class mod_scorm_mod_form extends moodleform_mod {
$winoptgrp[] = &$mform->createElement('checkbox', 'menubar', '', get_string('menubar', 'scorm'));
$winoptgrp[] = &$mform->createElement('checkbox', 'toolbar', '', get_string('toolbar', 'scorm'));
$winoptgrp[] = &$mform->createElement('checkbox', 'status', '', get_string('status', 'scorm'));
$mform->addGroup($winoptgrp, 'winoptgrp', get_string('options'), '<br />', false);
$mform->addGroup($winoptgrp, 'winoptgrp', get_string('options','scorm'), '<br />', false);
$mform->setDefault('resizable', 1);
$mform->setDefault('scrollbars', 1);
$mform->setDefault('directories', 0);
@@ -139,13 +136,13 @@ class mod_scorm_mod_form extends moodleform_mod {
$options[1]=get_string('firstaccess','scorm');
$options[2]=get_string('always');
$mform->addElement('select', 'skipview', get_string('skipview', 'scorm'), $options);
$mform->setHelpButton('skipview', array('skipview',get_string('skipview', 'scorm')), 'scorm');
$mform->setHelpButton('skipview', array('skipview',get_string('skipview', 'scorm'), 'scorm'));
$mform->setDefault('skipview', 1);
$mform->setAdvanced('skipview');
// Hide Browse
$mform->addElement('selectyesno', 'hidebrowse', get_string('hidebrowse', 'scorm'));
$mform->setHelpButton('hidebrowse', array('hidebrowse',get_string('hidebrowse', 'scorm')), 'scorm');
$mform->setHelpButton('hidebrowse', array('hidebrowse',get_string('hidebrowse', 'scorm'), 'scorm'));
$mform->setDefault('hidebrowse', 0);
$mform->setAdvanced('hidebrowse');
@@ -165,13 +162,13 @@ class mod_scorm_mod_form extends moodleform_mod {
// Autocontinue
$mform->addElement('selectyesno', 'auto', get_string('autocontinue', 'scorm'));
$mform->setHelpButton('auto', array('autocontinue',get_string('autocontinue', 'scorm')), 'scorm');
$mform->setHelpButton('auto', array('autocontinue',get_string('autocontinue', 'scorm'), 'scorm'));
$mform->setDefault('auto', 0);
$mform->setAdvanced('auto');
// Update packages timing
$options = array();
$options[0]=get_string('never','scorm');
$options[0]=get_string('never');
$options[1]=get_string('onchanges','scorm');
$options[2]=get_string('everyday','scorm');
$options[3]=get_string('everytime','scorm');
+8 -16
View File
@@ -14,15 +14,6 @@
$mode = optional_param('mode', 'normal', PARAM_ALPHA); // navigation mode
$currentorg = optional_param('currentorg', '', PARAM_RAW); // selected organization
$newattempt = optional_param('newattempt', 'off', PARAM_ALPHA); // the user request to start a new attempt
$scoid=$_GET['scoid'];
//$scoid=$_POST['scoid'];
//echo 'SCOID'.$scoid;
if ($sco1 = get_record("scorm_scoes", "id", $scoid,"parent",'/')) {
$scoid++;
}
if (!empty($id)) {
if (! $cm = get_coursemodule_from_id('scorm', $id)) {
@@ -53,6 +44,7 @@
$strscorms = get_string('modulenameplural', 'scorm');
$strscorm = get_string('modulename', 'scorm');
$strpopup = get_string('popup','scorm');
$strexit = get_string('exitactivity','scorm');
if ($course->id != SITEID) {
$navigation = "<a $CFG->frametarget href=\"../../course/view.php?id=$course->id\">$course->shortname</a> ->";
@@ -134,15 +126,17 @@
$bodyscript = 'onunload="main.close();"';
}
$exitlink = '<a href="'.$CFG->wwwroot.'/course/view.php?id='.$scorm->course.'" title="'.$strexit.'">'.$strexit.'</a> ';
print_header($pagetitle, $course->fullname,
"$navigation <a $CFG->frametarget href=\"view.php?id=$cm->id\">".format_string($scorm->name,true)."</a>",
'', '', true, update_module_button($cm->id, $course->id, $strscorm), '', false, $bodyscript);
if ($sco->scormtype == 'sco') {
'', '', true, $exitlink.update_module_button($cm->id, $course->id, $strscorm), '', false, $bodyscript);
//if ($sco->scormtype == 'sco') {
?>
<script type="text/javascript" src="request.js"></script>
<script type="text/javascript" src="api.php?id=<?php echo $cm->id.$scoidstr.$modestr.$attemptstr ?>"></script>
<?php
}
//}
if (($sco->previd != 0) && ((!isset($sco->previous)) || ($sco->previous == 0))) {
$scostr = '&scoid='.$sco->previd;
echo ' <script type="text/javascript">'."\n//<![CDATA[\n".'var prev="'.$CFG->wwwroot.'/mod/scorm/player.php?id='.$cm->id.$orgstr.$modepop.$scostr."\";\n//]]>\n</script>\n";
@@ -289,7 +283,5 @@
</div> <!-- SCORM object -->
</div> <!-- SCORM box -->
</div> <!-- SCORM content -->
</div> <!-- Content -->
</div> <!-- Page -->
</body>
</html>
<div class="clearer">&nbsp;</div>
<?php print_footer(); ?>
+10 -11
View File
@@ -24,27 +24,26 @@
}
#mod-scorm-player #scormpage {
position: relative;
width: 100%;
}
#mod-scorm-player #tocbox {
position: absolute;
float: left;
width: 17%;
left: 0px;
top: 0px;
width: 19%;
}
#mod-scorm-player #tochead {
text-align: center;
font-weight: bold;
}
#mod-scorm-player #scormbox {
position: absolute;
right: 0px;
top: 0px;
}
#mod-scorm-player .toc {
float: right;
width: 80%;
margin-left: 20%;
right: 0px;
top: 0px;
}
#mod-scorm-player .no-toc {
width: 100%;
@@ -53,17 +52,17 @@
/* border: 1px solid black; */
}
#mod-scorm-player #scormtop {
position: relative;
width: 100%;
height: 30px;
height: auto;
}
#mod-scorm-player #scormbrowse {
position: absolute;
#mod-scorm-player #scormmode {
float: left;
width: 50%;
left: 5px;
top: 0px;
}
#mod-scorm-player #scormnav {
position: absolute;
float: right;
right: 5px;
top: 0px;
}
+1 -1
View File
@@ -10,7 +10,7 @@
// catch up now, so until 27th October please only increment in very tiny steps
// in HEAD, until we get past that date..
$module->version = 2007031300; // The (date) version of this module
$module->version = 2007070300; // The (date) version of this module
$module->requires = 2007020200; // The version of Moodle that is required
$module->cron = 300; // How often should cron check this module (seconds)?

Some files were not shown because too many files have changed in this diff Show More