-<?php //$Id$
+<?php
require_once $CFG->libdir.'/formslib.php';
-<?php //$Id$
+<?php
require_once $CFG->libdir.'/formslib.php';
-<?php //$Id$
+<?php
require('../../config.php');
require_once('lib.php');
-<?php //$Id$
+<?php
require('../../config.php');
require_once('lib.php');
* @author Christophe Herreman
* @since 05/01/2005
* @version $id$
- *
+ *
* Special contributions by Allessandro Crugnola and Ted Milker
*/
}
/**
- * Return string from start of haystack to first occurance of needle, or whole
+ * Return string from start of haystack to first occurance of needle, or whole
* haystack, if needle does not occur
*
* @access public
{
return false;
}
-
+
$source = file_get_contents($sourcePath);
$tokens = (array)token_get_all($source);
-
+
$waitingForOpenParenthesis = false;
$waitingForFunction = false;
$waitingForClassName = false;
{
$lastComment = '';
$openBraces--;
-
+
if($openBraces == 0)
{
break;
$classMethods[] = array("name" => $lastFunction,
"comment" => $lastFunctionComment,
"args" => $argBuffer);
-
+
$bufferingArgs = false;
$argBuffer = "";
$lastFunction = "";
$lastFunctionComment = "";
}
}
-
+
}
} else {
// token array
list($id, $text) = $token;
-
+
if($bufferingArgs)
{
- $argBuffer .= $text;
+ $argBuffer .= $text;
}
- switch ($id)
+ switch ($id)
{
-
+
case T_COMMENT:
case T_ML_COMMENT: // we've defined this
case T_DOC_COMMENT: // and this
$waitingForOpenParenthesis = true;
$lastFunction = $text;
$lastFunctionComment = $lastComment;
- $lastComment = "";
+ $lastComment = "";
}
if($waitingForClassName)
{
}
}
}
-
+
foreach ($classMethods as $key => $value) {
$methodSignature = $value['args'];
$methodName = $value['name'];
$methodComment = $value['comment'];
-
+
$description = MethodTable::getMethodDescription($methodComment) . " " . MethodTable::getMethodCommentAttribute($methodComment, "desc");
$description = trim($description);
$access = MethodTable::getMethodCommentAttributeFirstWord($methodComment, "access");
$pagesize = MethodTable::getMethodCommentAttributeFirstWord($methodComment, "pagesize");
$params = MethodTable::getMethodCommentArguments($methodComment);
-
+
//description, arguments, access, [roles, [instance, [returns, [pagesize]]]]
$methodTable[$methodName] = array();
//$methodTable[$methodName]["signature"] = $methodSignature; //debug purposes
if($returns != "") $methodTable[$methodName]["returns"] = $returns;
if($pagesize != "") $methodTable[$methodName]["pagesize"] = $pagesize;
}
-
+
return $methodTable;
-
+
}
-
+
/**
- *
- */
+ *
+ */
function getMethodCommentServices($comment)
{
$pieces = explode('@service', $comment);
}
return $args;
}
-
-
+
+
/**
- *
+ *
*/
function getMethodCommentArguments($comment)
{
return $args;
}
-
+
/**
* Returns the description from the comment.
* The description is(are) the first line(s) in the comment.
$comment = MethodTable::cleanComment(strrstr($comment, "@"));
return trim($comment);
}
-
-
+
+
/**
* Returns the value of a comment attribute.
*
}
return "";
}
-
+
/**
* Returns the value of a comment attribute.
*
}
return "";
}
-
+
/**
* Returns the value of a comment attribute.
*
}
return $result;
}
-
+
function getMethodCommentAttributeFirstWord($comment, $attribute){
$pieces = strstrafter($comment, '@' . $attribute);
if($pieces !== FALSE)
}
return "";
}
-
+
/**
* Returns an array with the arguments of a method.
*
//clean the arguments before returning them
$result = MethodTable::cleanArguments(explode(",", $methodSignature), $commentParams);
}
-
+
return $result;
}
-
+
/**
* Cleans the function or method's return value.
*
function cleanReturnValue($value){
$result = array();
$value = trim($value);
-
+
list($result['type'], $result['description']) = explode(' ', $value, 2);
$result['type'] = MethodTable::standardizeType($result['type']);
if('str' == $type || 'string' == $type) return 'string';
if('int' == $type || 'integer' == $type) return 'int';
if('bool' == $type || 'boolean' == $type) return 'boolean';
-
+
// Note that object is not a valid XMLRPC type
if('object' == $type || 'class' == $type) return 'object';
if('float' == $type || 'dbl' == $type || 'double' == $type || 'flt' == $type) return 'double';
- // Note that null is not a valid XMLRPC type. The null type can have
+ // Note that null is not a valid XMLRPC type. The null type can have
// only one value - null.
if('null' == $type) return 'null';
if('array' == $type || 'arr' == $type) return 'array';
if('assoc' == $type || 'struct' == $type) return 'struct';
- // Note that this is not a valid XMLRPC type. As references cannot be
+ // Note that this is not a valid XMLRPC type. As references cannot be
// serialized or exported, there is no way this could be XML-RPCed.
if('reference' == $type || 'ref' == $type) return 'reference';
return 'string';
}
-
+
/**
* Cleans the arguments array.
* This method removes all whitespaces and the leading "$" sign from each argument
$result = array();
if(!is_array($args)) return array();
-
+
foreach($args as $index => $arg){
$arg = strrstr(str_replace(array('$','&$'), array('','&'), $arg), '=');
if(!isset($commentParams[$index]))
{
$start = trim($arg);
$end = trim(str_replace('$', '', $commentParams[$index]));
-
- // Suppress Notice of 'Undefined offset' with @
+
+ // Suppress Notice of 'Undefined offset' with @
@list($word0, $word1, $tail) = preg_split("/[\s]+/", $end, 3);
$word0 = strtolower($word0);
$word1 = strtolower($word1);
-
+
$wordBase0 = preg_replace('/^[&$]+/','',$word0);
$wordBase1 = preg_replace('/^[&$]+/','',$word1);
$startBase = strtolower(preg_replace('/^[&$]+/','',$start));
$type = 'double';
} elseif($type == 'null') {
// Note that this is not a valid XMLRPC type
- // The null type can have only one value - null. Why would
+ // The null type can have only one value - null. Why would
// that be an argument to a function? Just in case:
$type = 'null';
} elseif($type == 'mixed') {
return $result;
}
-
-
+
+
/**
* Cleans the comment string by removing all comment start and end characters.
*
foreach($methodTable as $methodName=>$methodProps){
$result .= "\n\t\"" . $methodName . "\" => array(";
-
+
foreach($methodProps as $key=>$value){
$result .= "\n\t\t\"" . $key . "\" => ";
$result .= ",";
}
-
+
$result = substr($result, 0, -1);
$result .= "\n\t),";
}
-
+
$result = substr($result, 0, -1);
$result = "\$this->methodTable = array(" . $result;
$result .= "\n);";
-
+
return $result;
}
}
-?>
-<?php // $Id$
+<?php
// Allows the admin to control user logins from remote moodles.
echo $OUTPUT->box_end();
echo $OUTPUT->footer();
-
-?>
require_login();
$context = get_context_instance(CONTEXT_SYSTEM);
-
+
require_capability('moodle/site:config', $context, $USER->id, true, "nopermissions");
$site = get_site();
$mnet_peer->delete();
redirect('peers.php', get_string('hostdeleted', 'mnet'), 5);
}
-?>
-<?PHP // $Id$
+<?PHP
// enrol_config.php - allows admin to edit all enrollment variables
// Yes, enrol is correct English spelling.
echo $OUTPUT->footer();
-
-?>
-<?PHP // $Id$
+<?PHP
// enrol_config.php - allows admin to edit all enrollment variables
// Yes, enrol is correct English spelling.
echo '</table></div>';
echo $OUTPUT->footer();
-
-?>
-<?PHP // $Id$
+<?PHP
// enrol_config.php - allows admin to edit all enrollment variables
// Yes, enrol is correct English spelling.
. '</div>';
echo $OUTPUT->footer();
-
-?>
-<?PHP // $Id$
+<?PHP
// Allows the admin to configure mnet stuff
exit;
} else {
// We're deleting
-
-
+
+
if (!isset($SESSION->mnet_confirm_delete_key)) {
// fail - you're being attacked?
}
<?php
echo $OUTPUT->footer();
-?>
}
?>
<td valign="top">
- <?php
+ <?php
if (empty($mnet_peer->public_key)) {
print_string('nopubkey', 'mnet');
}
?>
<tr>
<td align="right" valign="top"><?php print_string('certdetails', 'mnet'); ?>:</td>
- <td valign="top"><pre style="margin: 0px; border: 0px;"><?php
+ <td valign="top"><pre style="margin: 0px; border: 0px;"><?php
foreach($credentials['subject'] as $key => $credential) {
if (is_scalar($credential)) {
echo str_pad($key, 16, " ", STR_PAD_LEFT).': '.$credential."\n";
$host2service = new stdClass();
$host2service->hostid = $_POST['hostid'];
$host2service->serviceid = $key;
-
+
$host2service->publish = $publish;
$host2service->subscribe = $subscribe;
}
include('./mnet_services.html');
-?>
}
$adminroot = admin_get_root();
require('./mnet_themes.html');
-?>
-<?PHP // $Id$
+<?PHP
// Allows the admin to configure other Moodle hosts info
} else {
$mnet_peer = new mnet_peer();
-
+
if (!empty($form->id)) {
$form->id = clean_param($form->id, PARAM_INT);
$mnet_peer->set_id($form->id);
$form->name = clean_param($form->name, PARAM_NOTAGS);
$mnet_peer->set_name($form->name);
}
-
+
if (isset($form->deleted) && ($form->deleted == '0' || $form->deleted == '1')) {
$mnet_peer->deleted = $form->deleted;
}
-
+
if (isset($form->public_key)) {
$form->public_key = clean_param($form->public_key, PARAM_PEM);
if (empty($form->public_key)) {
include('./mnet_review_allhosts.html');
}
} else {
- $hosts = $DB->get_records_sql(' SELECT
- h.id,
- h.wwwroot,
- h.ip_address,
- h.name,
- h.public_key,
- h.public_key_expires,
- h.transport,
- h.portno,
- h.last_connect_time,
- h.last_log_id,
- h.applicationid,
- a.name as app_name,
- a.display_name as app_display_name,
+ $hosts = $DB->get_records_sql(' SELECT
+ h.id,
+ h.wwwroot,
+ h.ip_address,
+ h.name,
+ h.public_key,
+ h.public_key_expires,
+ h.transport,
+ h.portno,
+ h.last_connect_time,
+ h.last_log_id,
+ h.applicationid,
+ a.name as app_name,
+ a.display_name as app_display_name,
a.xmlrpc_server_url
- FROM
- {mnet_host} h,
- {mnet_application} a
- WHERE
- h.id <> ? AND
- h.deleted = 0 AND
+ FROM
+ {mnet_host} h,
+ {mnet_application} a
+ WHERE
+ h.id <> ? AND
+ h.deleted = 0 AND
h.applicationid=a.id',
array($CFG->mnet_localhost_id));;
$applications = $DB->get_records('mnet_application');
include('./peers.html');
}
-?>
+
admin_externalpage_print_header();
print_error('requiresopenssl', 'mnet', '', NULL, true);
}
-
+
$site = get_site();
$trusted_hosts = '';//array();
}
include('./trustedhosts.html');
-?>
-<?php // $Id$
+<?php
///////////////////////////////////////////////////////////////////////////
// //
echo '</div></form>';
echo $OUTPUT->footer();
-?>
}
echo $OUTPUT->footer();
-?>
+
echo '</div>';
echo $OUTPUT->footer();
-?>
}
echo $OUTPUT->close_window_button();
echo $OUTPUT->footer();
-?>
-<?php // $Id$
+<?php
///////////////////////////////////////////////////////////////////////////
// //
return $potentialuserselector;
}
-?>
-<?php // $Id$
+<?php
///////////////////////////////////////////////////////////////////////////
// //
global $OUTPUT;
return '<img src="' . $OUTPUT->old_icon_url('spacer') . '" class="iconsmall" alt="" /> ';
}
-?>
-<?php // $Id$
+<?php
///////////////////////////////////////////////////////////////////////////
// //
print_tabs($tabs, $currenttab);
-?>
-<?php // $Id$
+<?php
///////////////////////////////////////////////////////////////////////////
// //
print_tabs($tabs, $currenttab, $inactive, $activetwo);
-
-?>
-<?php // $Id$
+<?php
///////////////////////////////////////////////////////////////////////////
// //
echo '</ul>';
}
}
-?>
-<?php // $Id$
+<?php
// This file defines settingpages and externalpages under the "appearance" category
$ADMIN->add('appearance', new admin_externalpage('managetags', get_string('managetags', 'tag'), "$CFG->wwwroot/tag/manage.php"));
} // end of speedup
-?>
-<?php // $Id$
+<?php
// This file defines settingpages and externalpages under the "courses" category
$ADMIN->add('courses', $temp);
} // end of speedup
-
-?>
-<?php // $Id$
+<?php
// * Miscellaneous settings
} // end of speedup
-
-?>
-<?php // $Id$
+<?php
// This file defines everything related to frontpage
$temp->add(new admin_setting_special_frontpagedesc());
$temp->add(new admin_setting_courselist_frontpage(false)); // non-loggedin version of the setting (that's what the parameter is for :) )
$temp->add(new admin_setting_courselist_frontpage(true)); // loggedin version of the setting
-
+
$options = array();
$options[] = get_string('unlimited');
for ($i=1; $i<100; $i++) {
$options[$i] = $i;
}
$temp->add(new admin_setting_configselect('maxcategorydepth', get_string('configsitemaxcategorydepth','admin'), get_string('configsitemaxcategorydepthhelp','admin'), 0, $options));
-
+
$temp->add(new admin_setting_sitesetcheckbox('numsections', get_string('sitesection'), get_string('sitesectionhelp','admin'), 1));
$temp->add(new admin_setting_sitesetselect('newsitems', get_string('newsitemsnumber'), '', 3,
array('0' => '0',
$ADMIN->add('frontpage', new admin_externalpage('sitefiles', get_string('sitefiles'), $CFG->wwwroot . '/files/index.php?id=' . SITEID, 'moodle/course:managefiles', false, $frontpagecontext));
}
}
-?>
-<?php // $Id$
+<?php
// This file defines settingpages and externalpages under the "grades" section
-<?php // $Id$
+<?php
// This file defines settingpages and externalpages under the "appearance" category
$ADMIN->add('language', new admin_externalpage('multilangupgrade', get_string('multilangupgrade', 'admin'), $CFG->wwwroot.'/'.$CFG->admin.'/multilangupgrade.php', 'moodle/site:config', !empty($CFG->filter_multilang_converted)));
} // end of speedup
-
-?>
-<?php // $Id$
+<?php
if ($hassiteconfig) { // speedup for non-admins, add all caps used on this page
$ADMIN->add('location', new admin_externalpage('timezoneimport', get_string('updatetimezones', 'admin'), "$CFG->wwwroot/$CFG->admin/timezoneimport.php"));
} // end of speedup
-
-?>
-<?php // $Id$
+<?php
// This file defines settingpages and externalpages under the "mnet" category
'moodle/site:config'));
} // end of speedup
-
-?>
-<?php //$Id$
+<?php
/*
* Please note that is file is always loaded last - it means that you can inject entries into other categories too.
-<?php // $Id$
+<?php
if ($hassiteconfig) { // speedup for non-admins, add all caps used on this page
$ADMIN->add('security', $temp);
} // end of speedup
-
-
-<?php // $Id$
+<?php
// This file defines settingpages and externalpages under the "server" category
}
} // end of speedup
-
-?>
-<?php // $Id$
+<?php
if ($hassiteconfig) { // speedup for non-admins, add all caps used on this page
$optionalsubsystems->add(new admin_setting_configselect('mnet_dispatcher_mode', get_string('net', 'mnet'), get_string('configmnet', 'mnet'), 'off', $options));
// Conditional activities: completion and availability
- $optionalsubsystems->add(new admin_setting_configcheckbox('enablecompletion',
- get_string('enablecompletion','completion'),
+ $optionalsubsystems->add(new admin_setting_configcheckbox('enablecompletion',
+ get_string('enablecompletion','completion'),
get_string('configenablecompletion','completion'), 0));
- $optionalsubsystems->add(new admin_setting_pickroles('progresstrackedroles',
+ $optionalsubsystems->add(new admin_setting_pickroles('progresstrackedroles',
get_string('progresstrackedroles','completion'),
get_string('configprogresstrackedroles', 'completion'),
array('moodle/legacy:student')));
-<?php // $Id$
+<?php
// This is the first file read by the lib/adminlib.php script
// We use it to create the categories in correct order,
$ADMIN->add('root', new admin_externalpage('adminnotifications', get_string('notifications'), "$CFG->wwwroot/$CFG->admin/index.php"));
// Show the annoying registration button if registration hasn't been done or is 6 months old (15552000 seconds) MDL-17429
-if (empty($CFG->registered) || ($CFG->registered < (time() - 15552000))) {
+if (empty($CFG->registered) || ($CFG->registered < (time() - 15552000))) {
$ADMIN->add('root', new admin_externalpage('adminregistration', get_string('registration','admin'), "$CFG->wwwroot/$CFG->admin/register.php"));
}
// hidden search script
$ADMIN->add('root', new admin_externalpage('search', get_string('searchresults'), "$CFG->wwwroot/$CFG->admin/search.php", 'moodle/site:config', true));
-
-?>
-<?php // $Id$
+<?php
// This file defines settingpages and externalpages in the "unsupported" hidden category, use wisely!
$ADMIN->add('unsupported', new admin_externalpage('replace', 'Search and replace', $CFG->wwwroot.'/'.$CFG->admin.'/replace.php', 'moodle/site:config', true));
} // end of speedup
-
-?>
-<?php // $Id$
+<?php
// This file defines settingpages and externalpages under the "users" category
$temp->add(new admin_setting_configtext('allowemailaddresses', get_string('allowemailaddresses', 'admin'), get_string('configallowemailaddresses', 'admin'), '', PARAM_NOTAGS));
$temp->add(new admin_setting_configtext('denyemailaddresses', get_string('denyemailaddresses', 'admin'), get_string('configdenyemailaddresses', 'admin'), '', PARAM_NOTAGS));
$temp->add(new admin_setting_configcheckbox('verifychangedemail', get_string('verifychangedemail', 'admin'), get_string('configverifychangedemail', 'admin'), 1));
-
+
$temp->add(new admin_setting_configtext('recaptchapublickey', get_string('recaptchapublickey', 'admin'), get_string('configrecaptchapublickey', 'admin'), '', PARAM_NOTAGS));
$temp->add(new admin_setting_configtext('recaptchaprivatekey', get_string('recaptchaprivatekey', 'admin'), get_string('configrecaptchaprivatekey', 'admin'), '', PARAM_NOTAGS));
$ADMIN->add('authsettings', $temp);
$defaultguestid = reset($guestroles);
$defaultguestid = $defaultguestid->id;
}
-
+
// we must not use assignable roles here:
// 1/ unsetting roles as assignable for admin might bork the settings!
// 2/ default user role should not be assignable anyway
$ADMIN->add('roles', new admin_externalpage('checkpermissions', get_string('checkglobalpermissions', 'role'), "$CFG->wwwroot/$CFG->admin/roles/check.php?contextid=".$systemcontext->id, array('moodle/role:assign', 'moodle/role:safeoverride', 'moodle/role:override', 'moodle/role:manage')));
} // end of speedup
-
-?>