Merge branch 'master' of https://github.com/moodle/moodle
This commit is contained in:
@@ -425,7 +425,8 @@ if (isset($maturity)) {
|
||||
exit(1);
|
||||
}
|
||||
} else {
|
||||
cli_error(get_string('maturitycorewarning', 'admin'));
|
||||
cli_problem(get_string('maturitycorewarning', 'admin', $maturitylevel));
|
||||
cli_error(get_string('maturityallowunstable', 'admin'));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -677,7 +678,9 @@ if (!$envstatus) {
|
||||
|
||||
// Test plugin dependencies.
|
||||
require_once($CFG->libdir . '/pluginlib.php');
|
||||
if (!plugin_manager::instance()->all_plugins_ok($version)) {
|
||||
$failed = array();
|
||||
if (!plugin_manager::instance()->all_plugins_ok($version, $failed)) {
|
||||
cli_problem(get_string('pluginscheckfailed', 'admin', array('pluginslist' => implode(', ', array_unique($failed)))));
|
||||
cli_error(get_string('pluginschecktodo', 'admin'));
|
||||
}
|
||||
|
||||
|
||||
@@ -161,7 +161,9 @@ if (!$envstatus) {
|
||||
|
||||
// Test plugin dependencies.
|
||||
require_once($CFG->libdir . '/pluginlib.php');
|
||||
if (!plugin_manager::instance()->all_plugins_ok($version)) {
|
||||
$failed = array();
|
||||
if (!plugin_manager::instance()->all_plugins_ok($version, $failed)) {
|
||||
cli_problem(get_string('pluginscheckfailed', 'admin', array('pluginslist' => implode(', ', array_unique($failed)))));
|
||||
cli_error(get_string('pluginschecktodo', 'admin'));
|
||||
}
|
||||
|
||||
|
||||
@@ -34,8 +34,8 @@ if ($DB->get_dbfamily() !== 'mysql') {
|
||||
}
|
||||
|
||||
// now get cli options
|
||||
list($options, $unrecognized) = cli_get_params(array('help'=>false, 'list'=>false, 'engine'=>false),
|
||||
array('h'=>'help', 'l'=>'list'));
|
||||
list($options, $unrecognized) = cli_get_params(array('help'=>false, 'list'=>false, 'engine'=>false, 'available'=>false),
|
||||
array('h'=>'help', 'l'=>'list', 'a'=>'available'));
|
||||
|
||||
if ($unrecognized) {
|
||||
$unrecognized = implode("\n ", $unrecognized);
|
||||
@@ -52,6 +52,7 @@ and does not support transactions.
|
||||
Options:
|
||||
--engine=ENGINE Convert MySQL tables to different engine
|
||||
-l, --list Show table information
|
||||
-a, --available Show list of available engines
|
||||
-h, --help Print out this help
|
||||
|
||||
Example:
|
||||
@@ -59,7 +60,11 @@ Example:
|
||||
";
|
||||
|
||||
if (!empty($options['engine'])) {
|
||||
$engines = mysql_get_engines();
|
||||
$engine = clean_param($options['engine'], PARAM_ALPHA);
|
||||
if (!isset($engines[strtoupper($engine)])) {
|
||||
cli_error("Error: engine '$engine' is not available on this server!");
|
||||
}
|
||||
|
||||
echo "Converting tables to '$engine' for $CFG->wwwroot:\n";
|
||||
$prefix = $DB->get_prefix();
|
||||
@@ -68,9 +73,11 @@ if (!empty($options['engine'])) {
|
||||
$rs = $DB->get_recordset_sql($sql);
|
||||
$converted = 0;
|
||||
$skipped = 0;
|
||||
$errors = 0;
|
||||
foreach ($rs as $table) {
|
||||
if ($table->engine === $engine) {
|
||||
echo str_pad($table->name, 40). " - NO CONVERSION NEEDED\n";
|
||||
if (strtoupper($table->engine) === strtoupper($engine)) {
|
||||
$newengine = mysql_get_table_engine($table->name);
|
||||
echo str_pad($table->name, 40). " - NO CONVERSION NEEDED ($newengine)\n";
|
||||
$skipped++;
|
||||
continue;
|
||||
}
|
||||
@@ -78,16 +85,22 @@ if (!empty($options['engine'])) {
|
||||
|
||||
try {
|
||||
$DB->change_database_structure("ALTER TABLE {$table->name} ENGINE = $engine");
|
||||
$newengine = mysql_get_table_engine($table->name);
|
||||
if (strtoupper($newengine) !== strtoupper($engine)) {
|
||||
echo "ERROR ($newengine)\n";
|
||||
$errors++;
|
||||
continue;
|
||||
}
|
||||
echo "DONE ($newengine)\n";
|
||||
$converted++;
|
||||
} catch (moodle_exception $e) {
|
||||
echo $e->getMessage()."\n";
|
||||
$skipped++;
|
||||
$errors++;
|
||||
continue;
|
||||
}
|
||||
echo "DONE\n";
|
||||
$converted++;
|
||||
}
|
||||
$rs->close();
|
||||
echo "Converted: $converted, skipped: $skipped\n";
|
||||
echo "Converted: $converted, skipped: $skipped, errors: $errors\n";
|
||||
exit(0); // success
|
||||
|
||||
} else if (!empty($options['list'])) {
|
||||
@@ -115,7 +128,53 @@ if (!empty($options['engine'])) {
|
||||
}
|
||||
exit(0); // success
|
||||
|
||||
} else if (!empty($options['available'])) {
|
||||
echo "List of available MySQL engines for $CFG->wwwroot:\n";
|
||||
$engines = mysql_get_engines();
|
||||
foreach ($engines as $engine) {
|
||||
echo " $engine\n";
|
||||
}
|
||||
die;
|
||||
|
||||
} else {
|
||||
echo $help;
|
||||
die;
|
||||
}
|
||||
|
||||
|
||||
|
||||
// ========== Some functions ==============
|
||||
|
||||
function mysql_get_engines() {
|
||||
global $DB;
|
||||
|
||||
$sql = "SHOW Engines";
|
||||
$rs = $DB->get_recordset_sql($sql);
|
||||
$engines = array();
|
||||
foreach ($rs as $engine) {
|
||||
if (strtoupper($engine->support) !== 'YES' and strtoupper($engine->support) !== 'DEFAULT') {
|
||||
continue;
|
||||
}
|
||||
$engines[strtoupper($engine->engine)] = $engine->engine;
|
||||
if (strtoupper($engine->support) === 'DEFAULT') {
|
||||
$engines[strtoupper($engine->engine)] .= ' (default)';
|
||||
}
|
||||
}
|
||||
$rs->close();
|
||||
|
||||
return $engines;
|
||||
}
|
||||
|
||||
function mysql_get_table_engine($tablename) {
|
||||
global $DB;
|
||||
|
||||
$engine = null;
|
||||
$sql = "SHOW TABLE STATUS WHERE Name = '$tablename'"; // no special chars expected here
|
||||
$rs = $DB->get_recordset_sql($sql);
|
||||
if ($rs->valid()) {
|
||||
$record = $rs->current();
|
||||
$engine = $record->engine;
|
||||
}
|
||||
$rs->close();
|
||||
return $engine;
|
||||
}
|
||||
|
||||
@@ -109,7 +109,9 @@ if (!$envstatus) {
|
||||
}
|
||||
|
||||
// Test plugin dependencies.
|
||||
if (!plugin_manager::instance()->all_plugins_ok($version)) {
|
||||
$failed = array();
|
||||
if (!plugin_manager::instance()->all_plugins_ok($version, $failed)) {
|
||||
cli_problem(get_string('pluginscheckfailed', 'admin', array('pluginslist' => implode(', ', array_unique($failed)))));
|
||||
cli_error(get_string('pluginschecktodo', 'admin'));
|
||||
}
|
||||
|
||||
@@ -132,7 +134,8 @@ if (isset($maturity)) {
|
||||
echo get_string('morehelp') . ': ' . get_docs_url('admin/versions') . PHP_EOL;
|
||||
cli_separator();
|
||||
} else {
|
||||
cli_error(get_string('maturitycorewarning', 'admin', $maturitylevel));
|
||||
cli_problem(get_string('maturitycorewarning', 'admin', $maturitylevel));
|
||||
cli_error(get_string('maturityallowunstable', 'admin'));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -152,6 +152,20 @@ if (!core_tables_exist()) {
|
||||
die();
|
||||
}
|
||||
|
||||
// check plugin dependencies
|
||||
$failed = array();
|
||||
if (!plugin_manager::instance()->all_plugins_ok($version, $failed)) {
|
||||
$PAGE->navbar->add(get_string('pluginscheck', 'admin'));
|
||||
$PAGE->set_title($strinstallation);
|
||||
$PAGE->set_heading($strinstallation . ' - Moodle ' . $CFG->target_release);
|
||||
|
||||
$output = $PAGE->get_renderer('core', 'admin');
|
||||
$url = new moodle_url('/admin/index.php', array('agreelicense' => 1, 'confirmrelease' => 1, 'lang' => $CFG->lang));
|
||||
echo $output->unsatisfied_dependencies_page($version, $failed, $url);
|
||||
die();
|
||||
}
|
||||
unset($failed);
|
||||
|
||||
//TODO: add a page with list of non-standard plugins here
|
||||
|
||||
$strdatabasesetup = get_string('databasesetup');
|
||||
@@ -238,6 +252,15 @@ if ($version > $CFG->version) { // upgrade
|
||||
|
||||
$reloadurl = new moodle_url('/admin/index.php', array('confirmupgrade' => 1, 'confirmrelease' => 1));
|
||||
|
||||
// check plugin dependencies first
|
||||
$failed = array();
|
||||
if (!plugin_manager::instance()->all_plugins_ok($version, $failed)) {
|
||||
$output = $PAGE->get_renderer('core', 'admin');
|
||||
echo $output->unsatisfied_dependencies_page($version, $failed, $reloadurl);
|
||||
die();
|
||||
}
|
||||
unset($failed);
|
||||
|
||||
if ($fetchupdates) {
|
||||
// no sesskey support guaranteed here
|
||||
if (empty($CFG->disableupdatenotifications)) {
|
||||
@@ -290,6 +313,16 @@ if (moodle_needs_upgrading()) {
|
||||
}
|
||||
|
||||
$output = $PAGE->get_renderer('core', 'admin');
|
||||
|
||||
// check plugin dependencies first
|
||||
$failed = array();
|
||||
if (!plugin_manager::instance()->all_plugins_ok($version, $failed)) {
|
||||
echo $output->unsatisfied_dependencies_page($version, $failed, $PAGE->url);
|
||||
die();
|
||||
}
|
||||
unset($failed);
|
||||
|
||||
// dependencies check passed, let's rock!
|
||||
echo $output->upgrade_plugin_check_page(plugin_manager::instance(), available_update_checker::instance(),
|
||||
$version, $showallplugins,
|
||||
new moodle_url($PAGE->url),
|
||||
|
||||
@@ -0,0 +1,38 @@
|
||||
<?php
|
||||
|
||||
// This file is part of Moodle - http://moodle.org/
|
||||
//
|
||||
// Moodle 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 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// Moodle 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.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
/**
|
||||
* An oauth2 redirection endpoint which can be used for an application:
|
||||
* http://tools.ietf.org/html/draft-ietf-oauth-v2-26#section-3.1.2
|
||||
*
|
||||
* This is used because some oauth servers will not allow a redirect urls
|
||||
* with get params (like repository callback) and that needs to be called
|
||||
* using the state param.
|
||||
*
|
||||
* @package core
|
||||
* @copyright 2012 Dan Poltawski
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
|
||||
require_once(dirname(dirname(__FILE__)).'/config.php');
|
||||
|
||||
// The authorization code generated by the authorization server.
|
||||
$code = required_param('code', PARAM_RAW);
|
||||
// The state parameter we've given (used in moodle as a redirect url).
|
||||
$state = required_param('state', PARAM_URL);
|
||||
|
||||
redirect(new moodle_url($state, array('code' => $code)));
|
||||
+56
-23
@@ -107,6 +107,29 @@ class core_admin_renderer extends plugin_renderer_base {
|
||||
return $output;
|
||||
}
|
||||
|
||||
/**
|
||||
* Displays the list of plugins with unsatisfied dependencies
|
||||
*
|
||||
* @param double|string|int $version Moodle on-disk version
|
||||
* @param array $failed list of plugins with unsatisfied dependecies
|
||||
* @param moodle_url $reloadurl URL of the page to recheck the dependencies
|
||||
* @return string HTML
|
||||
*/
|
||||
public function unsatisfied_dependencies_page($version, array $failed, moodle_url $reloadurl) {
|
||||
$output = '';
|
||||
|
||||
$output .= $this->header();
|
||||
$output .= $this->heading(get_string('pluginscheck', 'admin'));
|
||||
$output .= $this->warning(get_string('pluginscheckfailed', 'admin', array('pluginslist' => implode(', ', array_unique($failed)))));
|
||||
$output .= $this->plugins_check_table(plugin_manager::instance(), $version, array('xdep' => true));
|
||||
$output .= $this->warning(get_string('pluginschecktodo', 'admin'));
|
||||
$output .= $this->continue_button($reloadurl);
|
||||
|
||||
$output .= $this->footer();
|
||||
|
||||
return $output;
|
||||
}
|
||||
|
||||
/**
|
||||
* Display the 'You are about to upgrade Moodle' page. The first page
|
||||
* during upgrade.
|
||||
@@ -197,19 +220,15 @@ class core_admin_renderer extends plugin_renderer_base {
|
||||
$output .= $this->box_end();
|
||||
$output .= $this->upgrade_reload($reloadurl);
|
||||
|
||||
if ($pluginman->all_plugins_ok($version)) {
|
||||
if ($pluginman->some_plugins_updatable()) {
|
||||
$output .= $this->container_start('upgradepluginsinfo');
|
||||
$output .= $this->help_icon('upgradepluginsinfo', 'core_admin', get_string('upgradepluginsfirst', 'core_admin'));
|
||||
$output .= $this->container_end();
|
||||
}
|
||||
$button = new single_button($continueurl, get_string('upgradestart', 'admin'), 'get');
|
||||
$button->class = 'continuebutton';
|
||||
$output .= $this->render($button);
|
||||
} else {
|
||||
$output .= $this->box(get_string('pluginschecktodo', 'admin'), 'environmentbox errorbox');
|
||||
if ($pluginman->some_plugins_updatable()) {
|
||||
$output .= $this->container_start('upgradepluginsinfo');
|
||||
$output .= $this->help_icon('upgradepluginsinfo', 'core_admin', get_string('upgradepluginsfirst', 'core_admin'));
|
||||
$output .= $this->container_end();
|
||||
}
|
||||
|
||||
$button = new single_button($continueurl, get_string('upgradestart', 'admin'), 'get');
|
||||
$button->class = 'continuebutton';
|
||||
$output .= $this->render($button);
|
||||
$output .= $this->footer();
|
||||
|
||||
return $output;
|
||||
@@ -563,13 +582,14 @@ class core_admin_renderer extends plugin_renderer_base {
|
||||
* This default implementation renders all plugins into one big table. The rendering
|
||||
* options support:
|
||||
* (bool)full = false: whether to display up-to-date plugins, too
|
||||
* (bool)xdep = false: display the plugins with unsatisified dependecies only
|
||||
*
|
||||
* @param plugin_manager $pluginman provides information about the plugins.
|
||||
* @param int $version the version of the Moodle code from version.php.
|
||||
* @param array $options rendering options
|
||||
* @return string HTML code
|
||||
*/
|
||||
public function plugins_check_table(plugin_manager $pluginman, $version, array $options = null) {
|
||||
public function plugins_check_table(plugin_manager $pluginman, $version, array $options = array()) {
|
||||
global $CFG;
|
||||
|
||||
$plugininfo = $pluginman->get_plugins();
|
||||
@@ -578,11 +598,8 @@ class core_admin_renderer extends plugin_renderer_base {
|
||||
return '';
|
||||
}
|
||||
|
||||
if (empty($options)) {
|
||||
$options = array(
|
||||
'full' => false,
|
||||
);
|
||||
}
|
||||
$options['full'] = isset($options['full']) ? (bool)$options['full'] : false;
|
||||
$options['xdep'] = isset($options['xdep']) ? (bool)$options['xdep'] : false;
|
||||
|
||||
$table = new html_table();
|
||||
$table->id = 'plugins-check';
|
||||
@@ -666,16 +683,28 @@ class core_admin_renderer extends plugin_renderer_base {
|
||||
|
||||
$statusisboring = in_array($statuscode, array(
|
||||
plugin_manager::PLUGIN_STATUS_NODB, plugin_manager::PLUGIN_STATUS_UPTODATE));
|
||||
$dependenciesok = $pluginman->are_dependencies_satisfied(
|
||||
$plugin->get_other_required_plugins());
|
||||
if ($isstandard and $statusisboring and $dependenciesok and empty($availableupdates)) {
|
||||
|
||||
$coredependency = $plugin->is_core_dependency_satisfied($version);
|
||||
$otherpluginsdependencies = $pluginman->are_dependencies_satisfied($plugin->get_other_required_plugins());
|
||||
$dependenciesok = $coredependency && $otherpluginsdependencies;
|
||||
|
||||
if ($options['xdep']) {
|
||||
// we want to see only plugins with failed dependencies
|
||||
if ($dependenciesok) {
|
||||
continue;
|
||||
}
|
||||
|
||||
} else if ($isstandard and $statusisboring and $dependenciesok and empty($availableupdates)) {
|
||||
// no change is going to happen to the plugin - display it only
|
||||
// if the user wants to see the full list
|
||||
if (empty($options['full'])) {
|
||||
continue;
|
||||
}
|
||||
} else {
|
||||
$numofhighlighted[$type]++;
|
||||
}
|
||||
|
||||
// ok, the plugin should be displayed
|
||||
$numofhighlighted[$type]++;
|
||||
|
||||
$row->cells = array($displayname, $rootdir, $source,
|
||||
$versiondb, $versiondisk, $requires, $status);
|
||||
$plugintyperows[] = $row;
|
||||
@@ -691,7 +720,11 @@ class core_admin_renderer extends plugin_renderer_base {
|
||||
|
||||
$sumofhighlighted = array_sum($numofhighlighted);
|
||||
|
||||
if ($sumofhighlighted == 0) {
|
||||
if ($options['xdep']) {
|
||||
// we do not want to display no heading and links in this mode
|
||||
$out = '';
|
||||
|
||||
} else if ($sumofhighlighted == 0) {
|
||||
$out = $this->output->container_start('nonehighlighted', 'plugins-check-info');
|
||||
$out .= $this->output->heading(get_string('nonehighlighted', 'core_plugin'));
|
||||
if (empty($options['full'])) {
|
||||
|
||||
+57
-10
@@ -1,12 +1,27 @@
|
||||
<?php
|
||||
// This file is part of Moodle - http://moodle.org/
|
||||
//
|
||||
// Moodle 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 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// Moodle 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.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
require_once(dirname(dirname(__FILE__)) . '/config.php');
|
||||
require_once($CFG->dirroot . '/repository/lib.php');
|
||||
require_once($CFG->libdir . '/adminlib.php');
|
||||
|
||||
$repository = optional_param('repos', '', PARAM_FORMAT);
|
||||
$action = optional_param('action', '', PARAM_ALPHA);
|
||||
$sure = optional_param('sure', '', PARAM_ALPHA);
|
||||
$repository = optional_param('repos', '', PARAM_ALPHANUMEXT);
|
||||
$action = optional_param('action', '', PARAM_ACTION);
|
||||
$sure = optional_param('sure', '', PARAM_ALPHA);
|
||||
$downloadcontents = optional_param('downloadcontents', false, PARAM_BOOL);
|
||||
|
||||
$display = true; // fall through to normal display
|
||||
|
||||
@@ -42,6 +57,10 @@ $configstr = get_string('manage', 'repository');
|
||||
|
||||
$return = true;
|
||||
|
||||
if (!empty($action)) {
|
||||
require_sesskey();
|
||||
}
|
||||
|
||||
/**
|
||||
* Helper function that generates a moodle_url object
|
||||
* relevant to the repository
|
||||
@@ -152,10 +171,10 @@ if (($action == 'edit') || ($action == 'new')) {
|
||||
|
||||
// Display instances list and creation form
|
||||
if ($action == 'edit') {
|
||||
$instanceoptionnames = repository::static_function($repository, 'get_instance_option_names');
|
||||
if (!empty($instanceoptionnames)) {
|
||||
repository::display_instances_list(get_context_instance(CONTEXT_SYSTEM), $repository);
|
||||
}
|
||||
$instanceoptionnames = repository::static_function($repository, 'get_instance_option_names');
|
||||
if (!empty($instanceoptionnames)) {
|
||||
repository::display_instances_list(context_system::instance(), $repository);
|
||||
}
|
||||
}
|
||||
}
|
||||
} else if ($action == 'show') {
|
||||
@@ -185,7 +204,8 @@ if (($action == 'edit') || ($action == 'new')) {
|
||||
if (!confirm_sesskey()) {
|
||||
print_error('confirmsesskeybad', '', $baseurl);
|
||||
}
|
||||
if ($repositorytype->delete()) {
|
||||
|
||||
if ($repositorytype->delete($downloadcontents)) {
|
||||
redirect($baseurl);
|
||||
} else {
|
||||
print_error('instancenotdeleted', 'repository', $baseurl);
|
||||
@@ -193,7 +213,34 @@ if (($action == 'edit') || ($action == 'new')) {
|
||||
exit;
|
||||
} else {
|
||||
echo $OUTPUT->header();
|
||||
echo $OUTPUT->confirm(get_string('confirmremove', 'repository', $repositorytype->get_readablename()), $sesskeyurl . '&action=delete&repos=' . $repository . '&sure=yes', $baseurl);
|
||||
|
||||
$message = get_string('confirmremove', 'repository', $repositorytype->get_readablename());
|
||||
|
||||
$output = $OUTPUT->box_start('generalbox', 'notice');
|
||||
$output .= html_writer::tag('p', $message);
|
||||
|
||||
$removeurl = new moodle_url($sesskeyurl);
|
||||
$removeurl->params(array(
|
||||
'action' =>'delete',
|
||||
'repos' => $repository,
|
||||
'sure' => 'yes',
|
||||
));
|
||||
|
||||
$removeanddownloadurl = new moodle_url($sesskeyurl);
|
||||
$removeanddownloadurl->params(array(
|
||||
'action' =>'delete',
|
||||
'repos'=> $repository,
|
||||
'sure' => 'yes',
|
||||
'downloadcontents' => 1,
|
||||
));
|
||||
|
||||
$output .= $OUTPUT->single_button($removeurl, get_string('continueuninstall', 'repository'));
|
||||
$output .= $OUTPUT->single_button($removeanddownloadurl, get_string('continueuninstallanddownload', 'repository'));
|
||||
$output .= $OUTPUT->single_button($baseurl, get_string('cancel'));
|
||||
$output .= $OUTPUT->box_end();
|
||||
|
||||
echo $output;
|
||||
|
||||
$return = false;
|
||||
}
|
||||
} else if ($action == 'moveup') {
|
||||
@@ -255,7 +302,7 @@ if (($action == 'edit') || ($action == 'new')) {
|
||||
// Calculate number of instances in order to display them for the Moodle administrator
|
||||
if (!empty($instanceoptionnames)) {
|
||||
$params = array();
|
||||
$params['context'] = array(get_system_context());
|
||||
$params['context'] = array(context_system::instance());
|
||||
$params['onlyvisible'] = false;
|
||||
$params['type'] = $typename;
|
||||
$admininstancenumber = count(repository::static_function($typename, 'get_instances', $params));
|
||||
|
||||
@@ -1,18 +1,35 @@
|
||||
<?php
|
||||
// This file is part of Moodle - http://moodle.org/
|
||||
//
|
||||
// Moodle 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 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// Moodle 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.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
require_once(dirname(dirname(__FILE__)) . '/config.php');
|
||||
require_once($CFG->dirroot . '/repository/lib.php');
|
||||
require_once($CFG->libdir . '/adminlib.php');
|
||||
|
||||
require_sesskey();
|
||||
|
||||
// id of repository
|
||||
$edit = optional_param('edit', 0, PARAM_INT);
|
||||
$new = optional_param('new', '', PARAM_FORMAT);
|
||||
$new = optional_param('new', '', PARAM_PLUGIN);
|
||||
$hide = optional_param('hide', 0, PARAM_INT);
|
||||
$delete = optional_param('delete', 0, PARAM_INT);
|
||||
$sure = optional_param('sure', '', PARAM_ALPHA);
|
||||
$type = optional_param('type', '', PARAM_PLUGIN);
|
||||
$downloadcontents = optional_param('downloadcontents', false, PARAM_BOOL);
|
||||
|
||||
$context = get_context_instance(CONTEXT_SYSTEM);
|
||||
$context = context_system::instance();
|
||||
|
||||
$pagename = 'repositorycontroller';
|
||||
|
||||
@@ -24,16 +41,20 @@ if ($edit){
|
||||
$pagename = 'repositoryinstancenew';
|
||||
}
|
||||
|
||||
admin_externalpage_setup($pagename);
|
||||
require_capability('moodle/site:config', get_context_instance(CONTEXT_SYSTEM));
|
||||
admin_externalpage_setup($pagename, '', null, new moodle_url('/admin/repositoryinstances.php'));
|
||||
require_capability('moodle/site:config', $context);
|
||||
|
||||
$baseurl = new moodle_url("/$CFG->admin/repositoryinstance.php", array('sesskey'=>sesskey()));
|
||||
|
||||
$parenturl = new moodle_url("/$CFG->admin/repository.php", array(
|
||||
'sesskey'=>sesskey(),
|
||||
'action'=>'edit',
|
||||
));
|
||||
|
||||
$sesskeyurl = "$CFG->wwwroot/$CFG->admin/repositoryinstance.php?sesskey=" . sesskey();
|
||||
$baseurl = "$CFG->wwwroot/$CFG->admin/repository.php?session=". sesskey() .'&action=edit&repos=';
|
||||
if ($new) {
|
||||
$baseurl .= $new;
|
||||
}
|
||||
else {
|
||||
$baseurl .= $type;
|
||||
$parenturl->param('repos', $new);
|
||||
} else {
|
||||
$parenturl->param('repos', $type);
|
||||
}
|
||||
|
||||
$return = true;
|
||||
@@ -48,7 +69,7 @@ if (!empty($edit) || !empty($new)) {
|
||||
$typeid = $instance->options['typeid'];
|
||||
} else {
|
||||
$plugin = $new;
|
||||
$typeid = $new;
|
||||
$typeid = null;
|
||||
$instance = null;
|
||||
}
|
||||
|
||||
@@ -57,12 +78,9 @@ if (!empty($edit) || !empty($new)) {
|
||||
// end setup, begin output
|
||||
|
||||
if ($mform->is_cancelled()){
|
||||
redirect($baseurl);
|
||||
redirect($parenturl);
|
||||
exit;
|
||||
} else if ($fromform = $mform->get_data()){
|
||||
if (!confirm_sesskey()) {
|
||||
print_error('confirmsesskeybad', '', $baseurl);
|
||||
}
|
||||
if ($edit) {
|
||||
$settings = array();
|
||||
$settings['name'] = $fromform->name;
|
||||
@@ -77,13 +95,13 @@ if (!empty($edit) || !empty($new)) {
|
||||
}
|
||||
$success = $instance->set_option($settings);
|
||||
} else {
|
||||
$success = repository::static_function($plugin, 'create', $plugin, 0, get_system_context(), $fromform);
|
||||
$success = repository::static_function($plugin, 'create', $plugin, 0, $context, $fromform);
|
||||
$data = data_submitted();
|
||||
}
|
||||
if ($success) {
|
||||
redirect($baseurl);
|
||||
redirect($parenturl);
|
||||
} else {
|
||||
print_error('instancenotsaved', 'repository', $baseurl);
|
||||
print_error('instancenotsaved', 'repository', $parenturl);
|
||||
}
|
||||
exit;
|
||||
} else {
|
||||
@@ -95,9 +113,6 @@ if (!empty($edit) || !empty($new)) {
|
||||
$return = false;
|
||||
}
|
||||
} else if (!empty($hide)) {
|
||||
if (!confirm_sesskey()) {
|
||||
print_error('confirmsesskeybad', '', $baseurl);
|
||||
}
|
||||
$instance = repository::get_type_by_typename($hide);
|
||||
$instance->hide();
|
||||
$return = true;
|
||||
@@ -108,25 +123,38 @@ if (!empty($edit) || !empty($new)) {
|
||||
throw new repository_exception('readonlyinstance', 'repository');
|
||||
}
|
||||
if ($sure) {
|
||||
if (!confirm_sesskey()) {
|
||||
print_error('confirmsesskeybad', '', $baseurl);
|
||||
}
|
||||
if ($instance->delete()) {
|
||||
if ($instance->delete($downloadcontents)) {
|
||||
$deletedstr = get_string('instancedeleted', 'repository');
|
||||
redirect($baseurl, $deletedstr, 3);
|
||||
redirect($parenturl, $deletedstr, 3);
|
||||
} else {
|
||||
print_error('instancenotdeleted', 'repository', $baseurl);
|
||||
print_error('instancenotdeleted', 'repository', $parenturl);
|
||||
}
|
||||
exit;
|
||||
}
|
||||
|
||||
echo $OUTPUT->header();
|
||||
echo $OUTPUT->confirm(get_string('confirmdelete', 'repository', $instance->name), "$sesskeyurl&type=$type'&delete=$delete'&sure=yes", "$CFG->wwwroot/$CFG->admin/repositoryinstance.php?session=". sesskey());
|
||||
echo $OUTPUT->box_start('generalbox', 'notice');
|
||||
$continueurl = new moodle_url($baseurl, array(
|
||||
'type' => $type,
|
||||
'delete' => $delete,
|
||||
'sure' => 'yes',
|
||||
));
|
||||
$continueanddownloadurl = new moodle_url($continueurl, array(
|
||||
'downloadcontents' => 1
|
||||
));
|
||||
$message = get_string('confirmdelete', 'repository', $instance->name);
|
||||
echo html_writer::tag('p', $message);
|
||||
|
||||
echo $OUTPUT->single_button($continueurl, get_string('continueuninstall', 'repository'));
|
||||
echo $OUTPUT->single_button($continueanddownloadurl, get_string('continueuninstallanddownload', 'repository'));
|
||||
echo $OUTPUT->single_button($parenturl, get_string('cancel'));
|
||||
|
||||
echo $OUTPUT->box_end();
|
||||
|
||||
$return = false;
|
||||
}
|
||||
|
||||
if (!empty($return)) {
|
||||
|
||||
redirect($baseurl);
|
||||
redirect($parenturl);
|
||||
}
|
||||
echo $OUTPUT->footer();
|
||||
|
||||
@@ -13,6 +13,8 @@ if ($hassiteconfig) { // speedup for non-admins, add all caps used on this page
|
||||
$temp->add(new admin_setting_configcheckbox('enablesafebrowserintegration', new lang_string('enablesafebrowserintegration', 'admin'), new lang_string('configenablesafebrowserintegration', 'admin'), 0));
|
||||
$temp->add(new admin_setting_configcheckbox('enablegroupmembersonly', new lang_string('enablegroupmembersonly', 'admin'), new lang_string('configenablegroupmembersonly', 'admin'), 0));
|
||||
|
||||
$temp->add(new admin_setting_configcheckbox('dndallowtextandlinks', new lang_string('dndallowtextandlinks', 'admin'), new lang_string('configdndallowtextandlinks', 'admin'), 0));
|
||||
|
||||
$ADMIN->add('experimental', $temp);
|
||||
|
||||
// "debugging" settingpage
|
||||
|
||||
@@ -330,12 +330,12 @@ if ($hassiteconfig) {
|
||||
$typeoptionnames = repository::static_function($repositorytype->get_typename(), 'get_type_option_names');
|
||||
$instanceoptionnames = repository::static_function($repositorytype->get_typename(), 'get_instance_option_names');
|
||||
if (!empty($typeoptionnames) || !empty($instanceoptionnames)) {
|
||||
$ADMIN->add('repositorysettings',
|
||||
new admin_externalpage('repositorysettings'.$repositorytype->get_typename(),
|
||||
$repositorytype->get_readablename(),
|
||||
$url . '?action=edit&repos=' . $repositorytype->get_typename()),
|
||||
'moodle/site:config');
|
||||
}
|
||||
|
||||
$params = array('action'=>'edit', 'sesskey'=>sesskey(), 'repos'=>$repositorytype->get_typename());
|
||||
$settingsurl = new moodle_url("/$CFG->admin/repository.php", $params);
|
||||
$repositoryexternalpage = new admin_externalpage('repositorysettings'.$repositorytype->get_typename(), $repositorytype->get_readablename(), $settingsurl);
|
||||
$ADMIN->add('repositorysettings', $repositoryexternalpage);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -370,7 +370,7 @@ if ($hassiteconfig) {
|
||||
// to set the page layout on all admin pages.
|
||||
// $wsdoclink = $OUTPUT->doc_link('How_to_get_a_security_key');
|
||||
$url = new moodle_url(get_docs_url('How_to_get_a_security_key'));
|
||||
$wsdoclink = html_writer::tag('a', new lang_string('supplyinfo'),array('href'=>$url));
|
||||
$wsdoclink = html_writer::tag('a', new lang_string('supplyinfo', 'webservice'), array('href'=>$url));
|
||||
$temp->add(new admin_setting_configcheckbox('enablewsdocumentation', new lang_string('enablewsdocumentation',
|
||||
'admin'), new lang_string('configenablewsdocumentation', 'admin', $wsdoclink), false));
|
||||
$ADMIN->add('webservicesettings', $temp);
|
||||
|
||||
+3
-1
@@ -9,6 +9,9 @@
|
||||
$zone = clean_param($zone, PARAM_PATH);
|
||||
}
|
||||
|
||||
$PAGE->set_url('/admin/timezone.php');
|
||||
$PAGE->set_context(context_system::instance());
|
||||
|
||||
require_login();
|
||||
|
||||
require_capability('moodle/site:config', get_context_instance(CONTEXT_SYSTEM));
|
||||
@@ -18,7 +21,6 @@
|
||||
$strusers = get_string("users");
|
||||
$strall = get_string("all");
|
||||
|
||||
$PAGE->set_url('/admin/timezone.php');
|
||||
$PAGE->set_title($strtimezone);
|
||||
$PAGE->set_heading($strtimezone);
|
||||
$PAGE->navbar->add($strtimezone);
|
||||
|
||||
@@ -22,16 +22,20 @@
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
|
||||
define('NO_OUTPUT_BUFFERING', true);
|
||||
|
||||
require_once(dirname(__FILE__) . '/../../../config.php');
|
||||
require_once(dirname(__FILE__) . '/locallib.php');
|
||||
require_once(dirname(__FILE__) . '/upgradableassignmentstable.php');
|
||||
require_once(dirname(__FILE__) . '/upgradableassignmentsbatchform.php');
|
||||
require_once($CFG->libdir . '/adminlib.php');
|
||||
require_once($CFG->dirroot . '/admin/tool/assignmentupgrade/locallib.php');
|
||||
require_once($CFG->dirroot . '/admin/tool/assignmentupgrade/upgradableassignmentstable.php');
|
||||
require_once($CFG->dirroot . '/admin/tool/assignmentupgrade/upgradableassignmentsbatchform.php');
|
||||
|
||||
require_sesskey();
|
||||
|
||||
// admin_externalpage_setup calls require_login and checks moodle/site:config
|
||||
admin_externalpage_setup('assignmentupgrade', '', array(), tool_assignmentupgrade_url('batchupgrade'));
|
||||
|
||||
$PAGE->set_pagelayout('maintenance');
|
||||
$PAGE->navbar->add(get_string('batchupgrade', 'tool_assignmentupgrade'));
|
||||
|
||||
$renderer = $PAGE->get_renderer('tool_assignmentupgrade');
|
||||
@@ -41,7 +45,26 @@ if (!$confirm) {
|
||||
print_error('invalidrequest');
|
||||
die();
|
||||
}
|
||||
$result = tool_assignmentupgrade_upgrade_multiple_assignments(optional_param('upgradeall', 0, PARAM_BOOL),
|
||||
explode(',', optional_param('selected', '', PARAM_TEXT)));
|
||||
raise_memory_limit(MEMORY_EXTRA);
|
||||
session_get_instance()->write_close(); // release session
|
||||
|
||||
echo $renderer->convert_multiple_assignments_result($result);
|
||||
echo $renderer->header();
|
||||
echo $renderer->heading(get_string('batchupgrade', 'tool_assignmentupgrade'));
|
||||
|
||||
$current = 0;
|
||||
if (optional_param('upgradeall', false, PARAM_BOOL)) {
|
||||
$assignmentids = tool_assignmentupgrade_load_all_upgradable_assignmentids();
|
||||
} else {
|
||||
$assignmentids = explode(',', optional_param('selected', '', PARAM_TEXT));
|
||||
}
|
||||
$total = count($assignmentids);
|
||||
|
||||
foreach ($assignmentids as $assignmentid) {
|
||||
list($summary, $success, $log) = tool_assignmentupgrade_upgrade_assignment($assignmentid);
|
||||
$current += 1;
|
||||
echo $renderer->heading(get_string('upgradeprogress', 'tool_assignmentupgrade', array('current'=>$current, 'total'=>$total)), 3);
|
||||
echo $renderer->convert_assignment_result($summary, $success, $log);
|
||||
}
|
||||
|
||||
echo $renderer->continue_button(tool_assignmentupgrade_url('listnotupgraded'));
|
||||
echo $renderer->footer();
|
||||
|
||||
@@ -34,8 +34,8 @@
|
||||
*/
|
||||
|
||||
require_once(dirname(__FILE__) . '/../../../config.php');
|
||||
require_once(dirname(__FILE__) . '/locallib.php');
|
||||
require_once($CFG->libdir . '/adminlib.php');
|
||||
require_once($CFG->dirroot . '/admin/tool/assignmentupgrade/locallib.php');
|
||||
|
||||
// admin_externalpage_setup calls require_login and checks moodle/site:config
|
||||
admin_externalpage_setup('assignmentupgrade');
|
||||
@@ -47,4 +47,4 @@ $actions = array();
|
||||
$header = get_string('pluginname', 'tool_assignmentupgrade');
|
||||
$actions[] = tool_assignmentupgrade_action::make('listnotupgraded');
|
||||
|
||||
echo $renderer->index_page($header, $actions);
|
||||
echo $renderer->index_page($header, $actions);
|
||||
|
||||
@@ -26,6 +26,7 @@ $string['areyousure'] = 'Are you sure?';
|
||||
$string['areyousuremessage'] = 'Are you sure you want to upgrade the assignment "{$a->name}"?';
|
||||
$string['assignmentid'] = 'Assignment ID';
|
||||
$string['assignmentnotfound'] = 'Assignment could not be found (id={$a})';
|
||||
$string['assignmentsperpage'] = 'Assignments per page';
|
||||
$string['assignmenttype'] = 'Assignment type';
|
||||
$string['backtoindex'] = 'Back to index';
|
||||
$string['batchoperations'] = 'Batch operations';
|
||||
@@ -43,6 +44,7 @@ $string['pluginname'] = 'Assignment upgrade helper';
|
||||
$string['select'] = 'Select';
|
||||
$string['submissions'] = 'Submissions';
|
||||
$string['supported'] = 'Upgrade';
|
||||
$string['updatetable'] = 'Update table';
|
||||
$string['unknown'] = 'Unknown';
|
||||
$string['upgradeassignmentsummary'] = 'Upgrade assignment: {$a->name} (Course: {$a->shortname})';
|
||||
$string['upgradeassignmentsuccess'] = 'Result: Upgrade successful';
|
||||
@@ -52,5 +54,6 @@ $string['upgradeselected'] = 'Upgrade selected assignments';
|
||||
$string['upgradeselectedcount'] = 'Upgrade {$a} selected assignments?';
|
||||
$string['upgradeall'] = 'Upgrade all assignments';
|
||||
$string['upgradeallconfirm'] = 'Upgrade all assignments?';
|
||||
$string['upgradeprogress'] = 'Upgrade assignment {$a->current} of {$a->total}';
|
||||
$string['upgradesingle'] = 'Upgrade single assignment';
|
||||
$string['viewcourse'] = 'View the course with the converted assignment';
|
||||
|
||||
@@ -23,10 +23,11 @@
|
||||
*/
|
||||
|
||||
require_once(dirname(__FILE__) . '/../../../config.php');
|
||||
require_once(dirname(__FILE__) . '/locallib.php');
|
||||
require_once(dirname(__FILE__) . '/upgradableassignmentstable.php');
|
||||
require_once(dirname(__FILE__) . '/upgradableassignmentsbatchform.php');
|
||||
require_once($CFG->libdir . '/adminlib.php');
|
||||
require_once($CFG->dirroot . '/admin/tool/assignmentupgrade/locallib.php');
|
||||
require_once($CFG->dirroot . '/admin/tool/assignmentupgrade/upgradableassignmentstable.php');
|
||||
require_once($CFG->dirroot . '/admin/tool/assignmentupgrade/upgradableassignmentsbatchform.php');
|
||||
require_once($CFG->dirroot . '/admin/tool/assignmentupgrade/paginationform.php');
|
||||
|
||||
// admin_externalpage_setup calls require_login and checks moodle/site:config
|
||||
admin_externalpage_setup('assignmentupgrade', '', array(), tool_assignmentupgrade_url('listnotupgraded'));
|
||||
@@ -34,16 +35,26 @@ $PAGE->navbar->add(get_string('listnotupgraded', 'tool_assignmentupgrade'));
|
||||
|
||||
$renderer = $PAGE->get_renderer('tool_assignmentupgrade');
|
||||
|
||||
$perpage = get_user_preferences('tool_assignmentupgrade_perpage', 5);
|
||||
$perpage = optional_param('perpage', 0, PARAM_INT);
|
||||
if (!$perpage) {
|
||||
$perpage = get_user_preferences('tool_assignmentupgrade_perpage', 100);
|
||||
} else {
|
||||
set_user_preference('tool_assignmentupgrade_perpage', $perpage);
|
||||
}
|
||||
$assignments = new tool_assignmentupgrade_assignments_table($perpage);
|
||||
|
||||
$batchform = new tool_assignmentupgrade_batchoperations_form();
|
||||
$data = $batchform->get_data();
|
||||
|
||||
if ($data && $data->selectedassignments != '' || $data && isset($data->upgradeall)) {
|
||||
require_sesskey();
|
||||
echo $renderer->confirm_batch_operation_page($data);
|
||||
} else {
|
||||
echo $renderer->assignment_list_page($assignments, $batchform);
|
||||
$paginationform = new tool_assignmentupgrade_pagination_form();
|
||||
$pagedata = new stdClass();
|
||||
$pagedata->perpage = $perpage;
|
||||
$paginationform->set_data($pagedata);
|
||||
echo $renderer->assignment_list_page($assignments, $batchform, $paginationform);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -170,54 +170,33 @@ function tool_assignmentupgrade_load_all_upgradable_assignmentids() {
|
||||
|
||||
|
||||
/**
|
||||
* Convert a list of assignments from the old format to the new one.
|
||||
* @param bool $upgradeall - Upgrade all possible assignments
|
||||
* @param array $assignmentids An array of assignment ids to upgrade
|
||||
* @return array of $entry['assignmentsummary' => (result from tool_assignmentupgrade_get_assignment)
|
||||
* $entry['success'] => boolean
|
||||
* $entry['log'] => string - upgrade log
|
||||
* Upgrade a single assignment. This is used by both upgrade single and upgrade batch
|
||||
*
|
||||
* @param int $assignmentid - The assignment id to upgrade
|
||||
* @return array(string, boolean, string) -
|
||||
* The array contains
|
||||
* - the assignment summary (returned by tool_assignmentupgrade_get_assignment)
|
||||
* - success
|
||||
* - the upgrade log
|
||||
*/
|
||||
function tool_assignmentupgrade_upgrade_multiple_assignments($upgradeall, $assignmentids) {
|
||||
function tool_assignmentupgrade_upgrade_assignment($assignmentid) {
|
||||
global $CFG;
|
||||
require_once($CFG->dirroot . '/mod/assign/locallib.php');
|
||||
require_once($CFG->dirroot . '/mod/assign/upgradelib.php');
|
||||
$upgrades = array();
|
||||
|
||||
if ($upgradeall) {
|
||||
$assignmentids = tool_assignmentupgrade_load_all_upgradable_assignmentids();
|
||||
}
|
||||
|
||||
$assignment_upgrader = new assign_upgrade_manager();
|
||||
foreach ($assignmentids as $assignmentid) {
|
||||
$info = tool_assignmentupgrade_get_assignment($assignmentid);
|
||||
if ($info) {
|
||||
$log = '';
|
||||
$success = $assignment_upgrader->upgrade_assignment($assignmentid, $log);
|
||||
} else {
|
||||
$success = false;
|
||||
$log = get_string('assignmentnotfound', 'tool_assignmentupgrade', $assignmentid);
|
||||
$info = new stdClass();
|
||||
$info->name = get_string('unknown', 'tool_assignmentupgrade');
|
||||
$info->shortname = get_string('unknown', 'tool_assignmentupgrade');
|
||||
}
|
||||
|
||||
$upgrades[] = array('assignmentsummary'=>$info, 'success'=>$success, 'log'=>$log);
|
||||
$info = tool_assignmentupgrade_get_assignment($assignmentid);
|
||||
if ($info) {
|
||||
$log = '';
|
||||
$success = $assignment_upgrader->upgrade_assignment($assignmentid, $log);
|
||||
} else {
|
||||
$success = false;
|
||||
$log = get_string('assignmentnotfound', 'tool_assignmentupgrade', $assignmentid);
|
||||
$info = new stdClass();
|
||||
$info->name = get_string('unknown', 'tool_assignmentupgrade');
|
||||
$info->shortname = get_string('unknown', 'tool_assignmentupgrade');
|
||||
}
|
||||
return $upgrades;
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert a single assignment from the old format to the new one.
|
||||
* @param stdClass $assignmentinfo An object containing information about this class
|
||||
* @param string $log This gets appended to with the details of the conversion process
|
||||
* @return boolean This is the overall result (true/false)
|
||||
*/
|
||||
function tool_assignmentupgrade_upgrade_assignment($assignmentinfo, &$log) {
|
||||
global $CFG;
|
||||
require_once($CFG->dirroot . '/mod/assign/locallib.php');
|
||||
require_once($CFG->dirroot . '/mod/assign/upgradelib.php');
|
||||
$assignment_upgrader = new assign_upgrade_manager();
|
||||
return $assignment_upgrader->upgrade_assignment($assignmentinfo->id, $log);
|
||||
return array($info, $success, $log);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -61,6 +61,11 @@ M.tool_assignmentupgrade = {
|
||||
}
|
||||
});
|
||||
|
||||
var perpage = Y.one('#id_perpage');
|
||||
perpage.on('change', function(e) {
|
||||
window.onbeforeunload = null;
|
||||
Y.one('.tool_assignmentupgrade_paginationform form').submit();
|
||||
});
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,59 @@
|
||||
<?php
|
||||
// This file is part of Moodle - http://moodle.org/
|
||||
//
|
||||
// Moodle 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 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// Moodle 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.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
/**
|
||||
* This file contains the forms to create and edit an instance of this module
|
||||
*
|
||||
* @package tool_assignmentupgrade
|
||||
* @copyright 2012 NetSpot {@link http://www.netspot.com.au}
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
|
||||
defined('MOODLE_INTERNAL') || die('Direct access to this script is forbidden.');
|
||||
|
||||
|
||||
/** Include formslib.php */
|
||||
require_once ($CFG->libdir.'/formslib.php');
|
||||
|
||||
/**
|
||||
* Assignment upgrade table display options
|
||||
*
|
||||
* @package tool_assignmentupgrade
|
||||
* @copyright 2012 NetSpot {@link http://www.netspot.com.au}
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
class tool_assignmentupgrade_pagination_form extends moodleform {
|
||||
/**
|
||||
* Define this form - called from the parent constructor
|
||||
*/
|
||||
function definition() {
|
||||
$mform = $this->_form;
|
||||
$instance = $this->_customdata;
|
||||
|
||||
$mform->addElement('header', 'general', get_string('assignmentsperpage', 'tool_assignmentupgrade'));
|
||||
// visible elements
|
||||
$options = array(10=>'10', 20=>'20', 50=>'50', 100=>'100');
|
||||
$mform->addElement('select', 'perpage', get_string('assignmentsperpage', 'assign'), $options);
|
||||
|
||||
// hidden params
|
||||
$mform->addElement('hidden', 'action', 'saveoptions');
|
||||
$mform->setType('action', PARAM_ALPHA);
|
||||
|
||||
// buttons
|
||||
$this->add_action_buttons(false, get_string('updatetable', 'tool_assignmentupgrade'));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -112,9 +112,10 @@ class tool_assignmentupgrade_renderer extends plugin_renderer_base {
|
||||
* Render the list of assignments that still need to be upgraded page.
|
||||
* @param tool_assignmentupgrade_assignments_table $assignments of data about assignments.
|
||||
* @param tool_assignmentupgrade_batchoperations_form $batchform Submitted form with list of assignments to upgrade
|
||||
* @param tool_assignmentupgrade_pagination_form $paginationform Form which contains the preferences for paginating the table
|
||||
* @return string html to output.
|
||||
*/
|
||||
public function assignment_list_page(tool_assignmentupgrade_assignments_table $assignments, tool_assignmentupgrade_batchoperations_form $batchform) {
|
||||
public function assignment_list_page(tool_assignmentupgrade_assignments_table $assignments, tool_assignmentupgrade_batchoperations_form $batchform, tool_assignmentupgrade_pagination_form $paginationform) {
|
||||
$output = '';
|
||||
$output .= $this->header();
|
||||
$this->page->requires->js_init_call('M.tool_assignmentupgrade.init_upgrade_table', array());
|
||||
@@ -126,6 +127,10 @@ class tool_assignmentupgrade_renderer extends plugin_renderer_base {
|
||||
|
||||
$output .= $this->container_start('tool_assignmentupgrade_upgradetable');
|
||||
|
||||
$output .= $this->container_start('tool_assignmentupgrade_paginationform');
|
||||
$output .= $this->moodleform($paginationform);
|
||||
$output .= $this->container_end();
|
||||
|
||||
$output .= $this->flexible_table($assignments, $assignments->get_rows_per_page(), true);
|
||||
$output .= $this->container_end();
|
||||
|
||||
@@ -140,43 +145,6 @@ class tool_assignmentupgrade_renderer extends plugin_renderer_base {
|
||||
return $output;
|
||||
}
|
||||
|
||||
/**
|
||||
* Render the result of an assignment conversion
|
||||
* @param array $assignments - An array of arrays with keys $entry['assignmentsummary', 'success', 'log']
|
||||
* See convert_assignment_result for more description of these keys.
|
||||
* @return string html to output.
|
||||
*/
|
||||
public function convert_multiple_assignments_result($assignments) {
|
||||
$output = '';
|
||||
$output .= $this->header();
|
||||
$output .= $this->heading(get_string('batchupgrade', 'tool_assignmentupgrade'));
|
||||
|
||||
foreach ($assignments as $assignment) {
|
||||
$assignmentsummary = $assignment['assignmentsummary'];
|
||||
$success = $assignment['success'];
|
||||
$log = $assignment['log'];
|
||||
|
||||
$output .= $this->heading(get_string('upgradeassignmentsummary', 'tool_assignmentupgrade', $assignmentsummary), 5);
|
||||
if ($success) {
|
||||
$output .= $this->container(get_string('upgradeassignmentsuccess', 'tool_assignmentupgrade'));
|
||||
|
||||
} else {
|
||||
$output .= $this->container(get_string('upgradeassignmentfailed', 'tool_assignmentupgrade', $assignment));
|
||||
}
|
||||
if (isset($assignmentsummary->courseid)) {
|
||||
$output .= html_writer::link(new moodle_url('/course/view.php', array('id'=>$assignmentsummary->courseid)) ,get_string('viewcourse', 'tool_assignmentupgrade'));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
$output .= $this->continue_button(tool_assignmentupgrade_url('listnotupgraded'));
|
||||
|
||||
|
||||
$output .= $this->footer();
|
||||
return $output;
|
||||
}
|
||||
|
||||
/**
|
||||
* Render the result of an assignment conversion
|
||||
* @param stdClass $assignmentsummary data about the assignment to upgrade.
|
||||
@@ -186,19 +154,17 @@ class tool_assignmentupgrade_renderer extends plugin_renderer_base {
|
||||
*/
|
||||
public function convert_assignment_result($assignmentsummary, $success, $log) {
|
||||
$output = '';
|
||||
$output .= $this->header();
|
||||
$output .= $this->heading(get_string('conversioncomplete', 'tool_assignmentupgrade'));
|
||||
|
||||
$output .= $this->container_start('tool_assignmentupgrade_result');
|
||||
$output .= $this->container(get_string('upgradeassignmentsummary', 'tool_assignmentupgrade', $assignmentsummary));
|
||||
if (!$success) {
|
||||
$output .= get_string('conversionfailed', 'tool_assignmentupgrade', $log);
|
||||
$output .= $this->container(get_string('conversionfailed', 'tool_assignmentupgrade', $log));
|
||||
} else {
|
||||
$output .= html_writer::link(new moodle_url('/course/view.php', array('id'=>$assignmentsummary->courseid)) ,get_string('viewcourse', 'tool_assignmentupgrade'));
|
||||
$output .= $this->container(get_string('upgradeassignmentsuccess', 'tool_assignmentupgrade'));
|
||||
$output .= $this->container(html_writer::link(new moodle_url('/course/view.php', array('id'=>$assignmentsummary->courseid)) ,get_string('viewcourse', 'tool_assignmentupgrade')));
|
||||
}
|
||||
$output .= $this->container_end();
|
||||
|
||||
$output .= $this->continue_button(tool_assignmentupgrade_url('listnotupgraded'));
|
||||
|
||||
|
||||
$output .= $this->footer();
|
||||
return $output;
|
||||
}
|
||||
|
||||
|
||||
@@ -8,4 +8,4 @@
|
||||
#page-admin-tool-assignmentupgrade-listnotupgraded .tool_assignmentupgrade_upgradetable tr.selectedrow td { background-color: #ffeecc; }
|
||||
#page-admin-tool-assignmentupgrade-listnotupgraded .tool_assignmentupgrade_upgradetable tr.unselectedrow td { background-color: white; }
|
||||
|
||||
|
||||
#page-admin-tool-assignmentupgrade-listnotupgraded .tool_assignmentupgrade_paginationform .hidden { display: none; }
|
||||
|
||||
@@ -70,12 +70,11 @@ class tool_assignmentupgrade_assignments_table extends table_sql implements rend
|
||||
$from = '{assignment} a JOIN {course} c ON a.course = c.id ' .
|
||||
' LEFT JOIN {assignment_submissions} s ON a.id = s.assignment';
|
||||
|
||||
|
||||
$where = '1 = 1';
|
||||
$where .= ' GROUP BY a.id, a.name, a.assignmenttype, c.shortname, c.id ';
|
||||
|
||||
$this->set_sql($fields, $from, $where, array());
|
||||
$this->set_count_sql('SELECT COUNT(*) FROM ' . $from, array());
|
||||
$this->set_count_sql('SELECT COUNT(*) FROM {assignment} a JOIN {course} c ON a.course = c.id', array());
|
||||
|
||||
$columns = array();
|
||||
$headers = array();
|
||||
|
||||
@@ -23,8 +23,8 @@
|
||||
*/
|
||||
|
||||
require_once(dirname(__FILE__) . '/../../../config.php');
|
||||
require_once(dirname(__FILE__) . '/locallib.php');
|
||||
require_once($CFG->libdir . '/adminlib.php');
|
||||
require_once($CFG->dirroot . '/admin/tool/assignmentupgrade/locallib.php');
|
||||
|
||||
require_sesskey();
|
||||
|
||||
@@ -36,13 +36,11 @@ admin_externalpage_setup('assignmentupgrade', '', array(), tool_assignmentupgrad
|
||||
$PAGE->navbar->add(get_string('upgradesingle', 'tool_assignmentupgrade'));
|
||||
$renderer = $PAGE->get_renderer('tool_assignmentupgrade');
|
||||
|
||||
$assignmentinfo = tool_assignmentupgrade_get_assignment($assignmentid);
|
||||
if (!$assignmentinfo) {
|
||||
print_error('invalidrequest');
|
||||
die();
|
||||
}
|
||||
|
||||
$log = '';
|
||||
$result = tool_assignmentupgrade_upgrade_assignment($assignmentinfo, $log);
|
||||
list($summary, $success, $log) = tool_assignmentupgrade_upgrade_assignment($assignmentid);
|
||||
|
||||
echo $renderer->convert_assignment_result($assignmentinfo, $result, $log);
|
||||
echo $renderer->header();
|
||||
echo $renderer->heading(get_string('conversioncomplete', 'tool_assignmentupgrade'));
|
||||
echo $renderer->convert_assignment_result($summary, $success, $log);
|
||||
echo $renderer->continue_button(tool_assignmentupgrade_url('listnotupgraded'));
|
||||
echo $renderer->footer();
|
||||
|
||||
@@ -23,8 +23,8 @@
|
||||
*/
|
||||
|
||||
require_once(dirname(__FILE__) . '/../../../config.php');
|
||||
require_once(dirname(__FILE__) . '/locallib.php');
|
||||
require_once($CFG->libdir . '/adminlib.php');
|
||||
require_once($CFG->dirroot . '/admin/tool/assignmentupgrade/locallib.php');
|
||||
|
||||
require_sesskey();
|
||||
|
||||
|
||||
@@ -121,7 +121,7 @@ function bloglevelupgrade_entries($blogentries, $forum, $cm, $groupid=-1) {
|
||||
$discussion->groupid = $groupid;
|
||||
$message = '';
|
||||
|
||||
$discussionid = forum_add_discussion($discussion, null, $message);
|
||||
$discussionid = forum_add_discussion($discussion, null, $message, $blogentry->userid);
|
||||
|
||||
// Copy file attachment records
|
||||
$fs = get_file_storage();
|
||||
|
||||
@@ -60,9 +60,8 @@ if (!isset($args[0]) || !in_array($args[0], $alloweddirs)) {
|
||||
print_error('invalidarguments');
|
||||
}
|
||||
|
||||
// only serve some controlled extensions
|
||||
$allowedextensions = array('text/html', 'text/css', 'image/gif', 'application/x-javascript');
|
||||
if (!in_array(mimeinfo('type', $filepath), $allowedextensions)) {
|
||||
// only serve some controlled extensions/mimetypes
|
||||
if (!file_extension_in_typegroup($filepath, array('web_file', 'web_image'), true)) {
|
||||
print_error('invalidarguments');
|
||||
}
|
||||
|
||||
|
||||
@@ -30,6 +30,7 @@
|
||||
|
||||
/// If we can find the Shibboleth attribute, save it in session and return to main login page
|
||||
if (!empty($_SERVER[$pluginconfig->user_attribute])) { // Shibboleth auto-login
|
||||
$frm = new stdClass();
|
||||
$frm->username = strtolower($_SERVER[$pluginconfig->user_attribute]);
|
||||
$frm->password = substr(base64_encode($_SERVER[$pluginconfig->user_attribute]),0,8);
|
||||
// The random password consists of the first 8 letters of the base 64 encoded user ID
|
||||
|
||||
@@ -27,7 +27,7 @@ class backup_files_edit_form extends moodleform {
|
||||
function definition() {
|
||||
$mform =& $this->_form;
|
||||
$contextid = $this->_customdata['contextid'];
|
||||
$options = array('subdirs'=>0, 'maxfiles'=>-1, 'accepted_types'=>'*', 'return_types'=>FILE_INTERNAL);
|
||||
$options = array('subdirs'=>0, 'maxfiles'=>-1, 'accepted_types'=>'*', 'return_types'=>FILE_INTERNAL | FILE_REFERENCE);
|
||||
$mform->addElement('filemanager', 'files_filemanager', get_string('files'), null, $options);
|
||||
$mform->addElement('hidden', 'contextid', $this->_customdata['contextid']);
|
||||
$mform->addElement('hidden', 'currentcontext', $this->_customdata['currentcontext']);
|
||||
|
||||
@@ -1404,7 +1404,7 @@ class backup_final_files_structure_step extends backup_structure_step {
|
||||
'contenthash', 'contextid', 'component', 'filearea', 'itemid',
|
||||
'filepath', 'filename', 'userid', 'filesize',
|
||||
'mimetype', 'status', 'timecreated', 'timemodified',
|
||||
'source', 'author', 'license', 'sortorder'));
|
||||
'source', 'author', 'license', 'sortorder', 'reference', 'repositoryid'));
|
||||
|
||||
// Build the tree
|
||||
|
||||
@@ -1412,9 +1412,12 @@ class backup_final_files_structure_step extends backup_structure_step {
|
||||
|
||||
// Define sources
|
||||
|
||||
$file->set_source_sql("SELECT f.*
|
||||
$file->set_source_sql("SELECT f.*, r.repositoryid, r.reference
|
||||
FROM {files} f
|
||||
JOIN {backup_ids_temp} bi ON f.id = bi.itemid
|
||||
LEFT JOIN {files_reference} r
|
||||
ON r.id = f.referencefileid
|
||||
JOIN {backup_ids_temp} bi
|
||||
ON f.id = bi.itemid
|
||||
WHERE bi.backupid = ?
|
||||
AND bi.itemname = 'filefinal'", array(backup::VAR_BACKUPID));
|
||||
|
||||
@@ -1442,6 +1445,8 @@ class backup_main_structure_step extends backup_structure_step {
|
||||
$info['backup_date'] = time();
|
||||
$info['backup_uniqueid']= $this->get_backupid();
|
||||
$info['mnet_remoteusers']=backup_controller_dbops::backup_includes_mnet_remote_users($this->get_backupid());
|
||||
$info['include_file_references_to_external_content'] =
|
||||
backup_controller_dbops::backup_includes_file_references($this->get_backupid());
|
||||
$info['original_wwwroot']=$CFG->wwwroot;
|
||||
$info['original_site_identifier_hash'] = md5(get_site_identifier());
|
||||
$info['original_course_id'] = $this->get_courseid();
|
||||
@@ -1461,7 +1466,7 @@ class backup_main_structure_step extends backup_structure_step {
|
||||
|
||||
$information = new backup_nested_element('information', null, array(
|
||||
'name', 'moodle_version', 'moodle_release', 'backup_version',
|
||||
'backup_release', 'backup_date', 'mnet_remoteusers', 'original_wwwroot',
|
||||
'backup_release', 'backup_date', 'mnet_remoteusers', 'include_file_references_to_external_content', 'original_wwwroot',
|
||||
'original_site_identifier_hash', 'original_course_id',
|
||||
'original_course_fullname', 'original_course_shortname', 'original_course_startdate',
|
||||
'original_course_contextid', 'original_system_contextid'));
|
||||
@@ -1584,8 +1589,12 @@ class backup_store_backup_file extends backup_execution_step {
|
||||
// Calculate the zip fullpath (in OS temp area it's always backup.mbz)
|
||||
$zipfile = $basepath . '/backup.mbz';
|
||||
|
||||
$has_file_references = backup_controller_dbops::backup_includes_file_references($this->get_backupid());
|
||||
// Perform storage and return it (TODO: shouldn't be array but proper result object)
|
||||
return array('backup_destination' => backup_helper::store_backup_file($this->get_backupid(), $zipfile));
|
||||
return array(
|
||||
'backup_destination' => backup_helper::store_backup_file($this->get_backupid(), $zipfile),
|
||||
'include_file_references_to_external_content' => $has_file_references
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -27,6 +27,13 @@
|
||||
|
||||
defined('MOODLE_INTERNAL') || die();
|
||||
|
||||
// Cache for storing link encoders, so that we don't need to call
|
||||
// register_link_encoders each time backup_xml_transformer is constructed
|
||||
// TODO MDL-25290 replace global with MUC code.
|
||||
global $LINKS_ENCODERS_CACHE;
|
||||
|
||||
$LINKS_ENCODERS_CACHE = array();
|
||||
|
||||
/**
|
||||
* Class implementing the @xml_contenttrasnformed logic to be applied in moodle2 backups
|
||||
*
|
||||
@@ -131,7 +138,19 @@ class backup_xml_transformer extends xml_contenttransformer {
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Register all available content link encoders
|
||||
*
|
||||
* @return array encoder
|
||||
* @todo MDL-25290 replace LINKS_ENCODERS_CACHE global with MUC code
|
||||
*/
|
||||
private function register_link_encoders() {
|
||||
global $LINKS_ENCODERS_CACHE;
|
||||
// If encoder is linked, then return cached encoder.
|
||||
if (!empty($LINKS_ENCODERS_CACHE)) {
|
||||
return $LINKS_ENCODERS_CACHE;
|
||||
}
|
||||
|
||||
$encoders = array();
|
||||
|
||||
// Add the course encoder
|
||||
@@ -160,6 +179,7 @@ class backup_xml_transformer extends xml_contenttransformer {
|
||||
// Add local encodes
|
||||
// TODO: Any interest? 1.9 never had that.
|
||||
|
||||
$LINKS_ENCODERS_CACHE = $encoders;
|
||||
return $encoders;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -135,6 +135,7 @@ class restore_final_task extends restore_task {
|
||||
$rules[] = new restore_log_rule('course', 'report outline', 'report/outline/index.php?id={course}', '{course}');
|
||||
$rules[] = new restore_log_rule('course', 'report participation', 'report/participation/index.php?id={course}', '{course}');
|
||||
$rules[] = new restore_log_rule('course', 'report stats', 'report/stats/index.php?id={course}', '{course}');
|
||||
$rules[] = new restore_log_rule('course', 'view section', 'view.php?id={course}§ion={course_sectionnumber}', '{course_section}');
|
||||
|
||||
// module 'user' rules
|
||||
$rules[] = new restore_log_rule('user', 'view', 'view.php?id={user}&course={course}', '{user}');
|
||||
|
||||
@@ -586,11 +586,23 @@ class restore_load_included_files extends restore_structure_step {
|
||||
return array($file);
|
||||
}
|
||||
|
||||
// Processing functions go here
|
||||
/**
|
||||
* Processing functions go here
|
||||
*
|
||||
* @param array $data one file record including repositoryid and reference
|
||||
*/
|
||||
public function process_file($data) {
|
||||
|
||||
$data = (object)$data; // handy
|
||||
|
||||
$isreference = !empty($data->repositoryid);
|
||||
$issamesite = $this->task->is_samesite();
|
||||
|
||||
// If it's not samesite, we skip file refernces
|
||||
if (!$issamesite && $isreference) {
|
||||
return;
|
||||
}
|
||||
|
||||
// load it if needed:
|
||||
// - it it is one of the annotated inforef files (course/section/activity/block)
|
||||
// - it is one "user", "group", "grouping", "grade", "question" or "qtype_xxxx" component file (that aren't sent to inforef ever)
|
||||
@@ -601,6 +613,7 @@ class restore_load_included_files extends restore_structure_step {
|
||||
$data->component == 'grouping' || $data->component == 'grade' ||
|
||||
$data->component == 'question' || substr($data->component, 0, 5) == 'qtype');
|
||||
if ($isfileref || $iscomponent) {
|
||||
// Process files
|
||||
restore_dbops::set_backup_files_record($this->get_restoreid(), $data);
|
||||
}
|
||||
}
|
||||
@@ -1034,6 +1047,7 @@ class restore_section_structure_step extends restore_structure_step {
|
||||
global $CFG, $DB;
|
||||
$data = (object)$data;
|
||||
$oldid = $data->id; // We'll need this later
|
||||
$oldsection = $data->number;
|
||||
|
||||
$restorefiles = false;
|
||||
|
||||
@@ -1086,10 +1100,12 @@ class restore_section_structure_step extends restore_structure_step {
|
||||
|
||||
$DB->update_record('course_sections', $section);
|
||||
$newitemid = $secrec->id;
|
||||
$oldsection = $secrec->section;
|
||||
}
|
||||
|
||||
// Annotate the section mapping, with restorefiles option if needed
|
||||
$this->set_mapping('course_section', $oldid, $newitemid, $restorefiles);
|
||||
$this->set_mapping('course_sectionnumber', $oldsection, $section->section, $restorefiles);
|
||||
|
||||
// set the new course_section id in the task
|
||||
$this->task->set_sectionid($newitemid);
|
||||
@@ -2528,7 +2544,7 @@ class restore_module_structure_step extends restore_structure_step {
|
||||
|
||||
$data = (object)$data;
|
||||
$oldid = $data->id;
|
||||
|
||||
$oldsection = $data->sectionnumber;
|
||||
$this->task->set_old_moduleversion($data->version);
|
||||
|
||||
$data->course = $this->task->get_courseid();
|
||||
@@ -2555,6 +2571,7 @@ class restore_module_structure_step extends restore_structure_step {
|
||||
'course' => $this->get_courseid(),
|
||||
'section' => 1);
|
||||
$data->section = $DB->insert_record('course_sections', $sectionrec); // section 1
|
||||
$this->set_mapping('course_sectionnumber', $oldsection, $sectionrec->section, $restorefiles);
|
||||
}
|
||||
$data->groupingid= $this->get_mappingid('grouping', $data->groupingid); // grouping
|
||||
if (!$CFG->enablegroupmembersonly) { // observe groupsmemberonly
|
||||
|
||||
@@ -409,6 +409,27 @@ abstract class backup_controller_dbops extends backup_dbops {
|
||||
return (int)(bool)$count;
|
||||
}
|
||||
|
||||
/**
|
||||
* Given the backupid, detect if the backup contains references to external contents
|
||||
*
|
||||
* @copyright 2012 Dongsheng Cai {@link http://dongsheng.org}
|
||||
* @return int
|
||||
*/
|
||||
public static function backup_includes_file_references($backupid) {
|
||||
global $CFG, $DB;
|
||||
|
||||
$sql = "SELECT count(r.repositoryid)
|
||||
FROM {files} f
|
||||
LEFT JOIN {files_reference} r
|
||||
ON r.id = f.referencefileid
|
||||
JOIN {backup_ids_temp} bi
|
||||
ON f.id = bi.itemid
|
||||
WHERE bi.backupid = ?
|
||||
AND bi.itemname = 'filefinal'";
|
||||
$count = $DB->count_records_sql($sql, array($backupid));
|
||||
return (int)(bool)$count;
|
||||
}
|
||||
|
||||
/**
|
||||
* Given the courseid, return some course related information we want to transport
|
||||
*
|
||||
|
||||
@@ -28,6 +28,38 @@
|
||||
* TODO: Finish phpdocs
|
||||
*/
|
||||
abstract class restore_dbops {
|
||||
/**
|
||||
* Keep cache of backup records.
|
||||
* @var array
|
||||
* @todo MDL-25290 static should be replaced with MUC code.
|
||||
*/
|
||||
private static $backupidscache = array();
|
||||
/**
|
||||
* Keep track of backup ids which are cached.
|
||||
* @var array
|
||||
* @todo MDL-25290 static should be replaced with MUC code.
|
||||
*/
|
||||
private static $backupidsexist = array();
|
||||
/**
|
||||
* Count is expensive, so manually keeping track of
|
||||
* backupidscache, to avoid memory issues.
|
||||
* @var int
|
||||
* @todo MDL-25290 static should be replaced with MUC code.
|
||||
*/
|
||||
private static $backupidscachesize = 2048;
|
||||
/**
|
||||
* Count is expensive, so manually keeping track of
|
||||
* backupidsexist, to avoid memory issues.
|
||||
* @var int
|
||||
* @todo MDL-25290 static should be replaced with MUC code.
|
||||
*/
|
||||
private static $backupidsexistsize = 10240;
|
||||
/**
|
||||
* Slice backupids cache to add more data.
|
||||
* @var int
|
||||
* @todo MDL-25290 static should be replaced with MUC code.
|
||||
*/
|
||||
private static $backupidsslice = 512;
|
||||
|
||||
/**
|
||||
* Return one array containing all the tasks that have been included
|
||||
@@ -151,6 +183,135 @@ abstract class restore_dbops {
|
||||
return $problems;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return cached backup id's
|
||||
*
|
||||
* @param int $restoreid id of backup
|
||||
* @param string $itemname name of the item
|
||||
* @param int $itemid id of item
|
||||
* @return array backup id's
|
||||
* @todo MDL-25290 replace static backupids* with MUC code
|
||||
*/
|
||||
protected static function get_backup_ids_cached($restoreid, $itemname, $itemid) {
|
||||
global $DB;
|
||||
|
||||
$key = "$itemid $itemname $restoreid";
|
||||
|
||||
// If record exists in cache then return.
|
||||
if (isset(self::$backupidsexist[$key]) && isset(self::$backupidscache[$key])) {
|
||||
// Return a copy of cached data, to avoid any alterations in cached data.
|
||||
return clone self::$backupidscache[$key];
|
||||
}
|
||||
|
||||
// Clean cache, if it's full.
|
||||
if (self::$backupidscachesize <= 0) {
|
||||
// Remove some records, to keep memory in limit.
|
||||
self::$backupidscache = array_slice(self::$backupidscache, self::$backupidsslice, null, true);
|
||||
self::$backupidscachesize = self::$backupidscachesize + self::$backupidsslice;
|
||||
}
|
||||
if (self::$backupidsexistsize <= 0) {
|
||||
self::$backupidsexist = array_slice(self::$backupidsexist, self::$backupidsslice, null, true);
|
||||
self::$backupidsexistsize = self::$backupidsexistsize + self::$backupidsslice;
|
||||
}
|
||||
|
||||
// Retrive record from database.
|
||||
$record = array(
|
||||
'backupid' => $restoreid,
|
||||
'itemname' => $itemname,
|
||||
'itemid' => $itemid
|
||||
);
|
||||
if ($dbrec = $DB->get_record('backup_ids_temp', $record)) {
|
||||
self::$backupidsexist[$key] = $dbrec->id;
|
||||
self::$backupidscache[$key] = $dbrec;
|
||||
self::$backupidscachesize--;
|
||||
self::$backupidsexistsize--;
|
||||
return $dbrec;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Cache backup ids'
|
||||
*
|
||||
* @param int $restoreid id of backup
|
||||
* @param string $itemname name of the item
|
||||
* @param int $itemid id of item
|
||||
* @param array $extrarecord extra record which needs to be updated
|
||||
* @return void
|
||||
* @todo MDL-25290 replace static BACKUP_IDS_* with MUC code
|
||||
*/
|
||||
protected static function set_backup_ids_cached($restoreid, $itemname, $itemid, $extrarecord) {
|
||||
global $DB;
|
||||
|
||||
$key = "$itemid $itemname $restoreid";
|
||||
|
||||
$record = array(
|
||||
'backupid' => $restoreid,
|
||||
'itemname' => $itemname,
|
||||
'itemid' => $itemid,
|
||||
);
|
||||
|
||||
// If record is not cached then add one.
|
||||
if (!isset(self::$backupidsexist[$key])) {
|
||||
// If we have this record in db, then just update this.
|
||||
if ($existingrecord = $DB->get_record('backup_ids_temp', $record)) {
|
||||
self::$backupidsexist[$key] = $existingrecord->id;
|
||||
self::$backupidsexistsize--;
|
||||
self::update_backup_cached_record($record, $extrarecord, $key, $existingrecord);
|
||||
} else {
|
||||
// Add new record to cache and db.
|
||||
$recorddefault = array (
|
||||
'newitemid' => 0,
|
||||
'parentitemid' => null,
|
||||
'info' => null);
|
||||
$record = array_merge($record, $recorddefault, $extrarecord);
|
||||
$record['id'] = $DB->insert_record('backup_ids_temp', $record);
|
||||
self::$backupidsexist[$key] = $record['id'];
|
||||
self::$backupidsexistsize--;
|
||||
if (self::$backupidscachesize > 0) {
|
||||
// Cache new records if we haven't got many yet.
|
||||
self::$backupidscache[$key] = (object) $record;
|
||||
self::$backupidscachesize--;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
self::update_backup_cached_record($record, $extrarecord, $key);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Updates existing backup record
|
||||
*
|
||||
* @param array $record record which needs to be updated
|
||||
* @param array $extrarecord extra record which needs to be updated
|
||||
* @param string $key unique key which is used to identify cached record
|
||||
* @param stdClass $existingrecord (optional) existing record
|
||||
*/
|
||||
protected static function update_backup_cached_record($record, $extrarecord, $key, $existingrecord = null) {
|
||||
global $DB;
|
||||
// Update only if extrarecord is not empty.
|
||||
if (!empty($extrarecord)) {
|
||||
$extrarecord['id'] = self::$backupidsexist[$key];
|
||||
$DB->update_record('backup_ids_temp', $extrarecord);
|
||||
// Update existing cache or add new record to cache.
|
||||
if (isset(self::$backupidscache[$key])) {
|
||||
$record = array_merge((array)self::$backupidscache[$key], $extrarecord);
|
||||
self::$backupidscache[$key] = (object) $record;
|
||||
} else if (self::$backupidscachesize > 0) {
|
||||
if ($existingrecord) {
|
||||
self::$backupidscache[$key] = $existingrecord;
|
||||
} else {
|
||||
// Retrive record from database and cache updated records.
|
||||
self::$backupidscache[$key] = $DB->get_record('backup_ids_temp', $record);
|
||||
}
|
||||
$record = array_merge((array)self::$backupidscache[$key], $extrarecord);
|
||||
self::$backupidscache[$key] = (object) $record;
|
||||
self::$backupidscachesize--;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Given one role, as loaded from XML, perform the best possible matching against the assignable
|
||||
* roles, using different fallback alternatives (shortname, archetype, editingteacher => teacher, defaultcourseroleid)
|
||||
@@ -685,6 +846,9 @@ abstract class restore_dbops {
|
||||
$rs = $DB->get_recordset_sql($sql, $params);
|
||||
foreach ($rs as $rec) {
|
||||
$file = (object)unserialize(base64_decode($rec->info));
|
||||
|
||||
$isreference = !empty($file->repositoryid);
|
||||
|
||||
// ignore root dirs (they are created automatically)
|
||||
if ($file->filepath == '/' && $file->filename == '.') {
|
||||
continue;
|
||||
@@ -697,10 +861,12 @@ abstract class restore_dbops {
|
||||
$fs->create_directory($newcontextid, $component, $filearea, $rec->newitemid, $file->filepath, $file->userid);
|
||||
continue;
|
||||
}
|
||||
|
||||
// arrived here, file found
|
||||
// Find file in backup pool
|
||||
$backuppath = $basepath . backup_file_manager::get_backup_content_file_location($file->contenthash);
|
||||
if (!file_exists($backuppath)) {
|
||||
|
||||
if (!file_exists($backuppath) && !$isreference) {
|
||||
throw new restore_dbops_exception('file_not_found_in_pool', $file);
|
||||
}
|
||||
if (!$fs->file_exists($newcontextid, $component, $filearea, $rec->newitemid, $file->filepath, $file->filename)) {
|
||||
@@ -717,7 +883,11 @@ abstract class restore_dbops {
|
||||
'author' => $file->author,
|
||||
'license' => $file->license,
|
||||
'sortorder' => $file->sortorder);
|
||||
$fs->create_file_from_pathname($file_record, $backuppath);
|
||||
if ($isreference) {
|
||||
$fs->create_file_from_reference($file_record, $file->repositoryid, $file->reference);
|
||||
} else {
|
||||
$fs->create_file_from_pathname($file_record, $backuppath);
|
||||
}
|
||||
}
|
||||
}
|
||||
$rs->close();
|
||||
@@ -1204,21 +1374,13 @@ abstract class restore_dbops {
|
||||
public static function set_backup_files_record($restoreid, $filerec) {
|
||||
global $DB;
|
||||
|
||||
// Store external files info in `info` field
|
||||
$filerec->info = base64_encode(serialize($filerec)); // Serialize the whole rec in info
|
||||
$filerec->backupid = $restoreid;
|
||||
$DB->insert_record('backup_files_temp', $filerec);
|
||||
}
|
||||
|
||||
|
||||
public static function set_backup_ids_record($restoreid, $itemname, $itemid, $newitemid = 0, $parentitemid = null, $info = null) {
|
||||
global $DB;
|
||||
|
||||
// Build the basic (mandatory) record info
|
||||
$record = array(
|
||||
'backupid' => $restoreid,
|
||||
'itemname' => $itemname,
|
||||
'itemid' => $itemid
|
||||
);
|
||||
// Build conditionally the extra record info
|
||||
$extrarecord = array();
|
||||
if ($newitemid != 0) {
|
||||
@@ -1231,34 +1393,16 @@ abstract class restore_dbops {
|
||||
$extrarecord['info'] = base64_encode(serialize($info));
|
||||
}
|
||||
|
||||
// TODO: Analyze if some static (and limited) cache by the 3 params could save us a bunch of get_record() calls
|
||||
// Note: Sure it will! And also will improve getter
|
||||
if (!$dbrec = $DB->get_record('backup_ids_temp', $record)) { // Need to insert the complete record
|
||||
$DB->insert_record('backup_ids_temp', array_merge($record, $extrarecord));
|
||||
|
||||
} else { // Need to update the extra record info if there is something to
|
||||
if (!empty($extrarecord)) {
|
||||
$extrarecord['id'] = $dbrec->id;
|
||||
$DB->update_record('backup_ids_temp', $extrarecord);
|
||||
}
|
||||
}
|
||||
self::set_backup_ids_cached($restoreid, $itemname, $itemid, $extrarecord);
|
||||
}
|
||||
|
||||
public static function get_backup_ids_record($restoreid, $itemname, $itemid) {
|
||||
global $DB;
|
||||
$dbrec = self::get_backup_ids_cached($restoreid, $itemname, $itemid);
|
||||
|
||||
// Build the basic (mandatory) record info to look for
|
||||
$record = array(
|
||||
'backupid' => $restoreid,
|
||||
'itemname' => $itemname,
|
||||
'itemid' => $itemid
|
||||
);
|
||||
// TODO: Analyze if some static (and limited) cache by the 3 params could save us a bunch of get_record() calls
|
||||
if ($dbrec = $DB->get_record('backup_ids_temp', $record)) {
|
||||
if ($dbrec->info != null) {
|
||||
$dbrec->info = unserialize(base64_decode($dbrec->info));
|
||||
}
|
||||
if ($dbrec && isset($dbrec->info) && is_string($dbrec->info)) {
|
||||
$dbrec->info = unserialize(base64_decode($dbrec->info));
|
||||
}
|
||||
|
||||
return $dbrec;
|
||||
}
|
||||
|
||||
|
||||
@@ -315,6 +315,7 @@ abstract class backup_cron_automated_helper {
|
||||
*/
|
||||
public static function launch_automated_backup($course, $starttime, $userid) {
|
||||
|
||||
$outcome = true;
|
||||
$config = get_config('backup');
|
||||
$bc = new backup_controller(backup::TYPE_1COURSE, $course->id, backup::FORMAT_MOODLE, backup::INTERACTIVE_NO, backup::MODE_AUTOMATED, $userid);
|
||||
|
||||
@@ -347,7 +348,7 @@ abstract class backup_cron_automated_helper {
|
||||
|
||||
$bc->set_status(backup::STATUS_AWAITING);
|
||||
|
||||
$outcome = $bc->execute_plan();
|
||||
$bc->execute_plan();
|
||||
$results = $bc->get_results();
|
||||
$file = $results['backup_destination'];
|
||||
$dir = $config->backup_auto_destination;
|
||||
@@ -363,16 +364,17 @@ abstract class backup_cron_automated_helper {
|
||||
}
|
||||
}
|
||||
|
||||
$outcome = true;
|
||||
} catch (backup_exception $e) {
|
||||
$bc->log('backup_auto_failed_on_course', backup::LOG_WARNING, $course->shortname);
|
||||
} catch (moodle_exception $e) {
|
||||
$bc->log('backup_auto_failed_on_course', backup::LOG_ERROR, $course->shortname); // Log error header.
|
||||
$bc->log('Exception: ' . $e->errorcode, backup::LOG_ERROR, $e->a, 1); // Log original exception problem.
|
||||
$bc->log('Debug: ' . $e->debuginfo, backup::LOG_DEBUG, null, 1); // Log original debug information.
|
||||
$outcome = false;
|
||||
}
|
||||
|
||||
$bc->destroy();
|
||||
unset($bc);
|
||||
|
||||
return true;
|
||||
return $outcome;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -73,6 +73,10 @@ class backup_file_manager {
|
||||
|
||||
$fs = get_file_storage();
|
||||
$file = $fs->get_file_instance($filerecorid);
|
||||
// If the file is external file, skip copying.
|
||||
if ($file->is_external_file()) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Calculate source and target paths (use same subdirs strategy for both)
|
||||
$targetfilepath = self::get_backup_storage_base_dir($backupid) . '/' .
|
||||
|
||||
@@ -145,6 +145,12 @@ abstract class backup_general_helper extends backup_helper {
|
||||
$info->original_course_startdate= $infoarr['original_course_startdate'];
|
||||
$info->original_course_contextid= $infoarr['original_course_contextid'];
|
||||
$info->original_system_contextid= $infoarr['original_system_contextid'];
|
||||
// Moodle backup file don't have this option before 2.3
|
||||
if (!empty($infoarr['include_file_references_to_external_content'])) {
|
||||
$info->include_file_references_to_external_content = 1;
|
||||
} else {
|
||||
$info->include_file_references_to_external_content = 0;
|
||||
}
|
||||
$info->type = $infoarr['details']['detail'][0]['type'];
|
||||
$info->format = $infoarr['details']['detail'][0]['format'];
|
||||
$info->mode = $infoarr['details']['detail'][0]['mode'];
|
||||
|
||||
@@ -55,12 +55,6 @@ abstract class convert_helper {
|
||||
|
||||
$converters = array();
|
||||
|
||||
// Only apply for backup converters if the (experimental) setting enables it.
|
||||
// This will be out once we get proper support of backup converters. MDL-29956
|
||||
if (!$restore && empty($CFG->enablebackupconverters)) {
|
||||
return $converters;
|
||||
}
|
||||
|
||||
$plugins = get_list_of_plugins('backup/converter');
|
||||
foreach ($plugins as $name) {
|
||||
$filename = $restore ? 'lib.php' : 'backuplib.php';
|
||||
|
||||
@@ -61,7 +61,12 @@ abstract class base_plan implements checksumable, executable {
|
||||
// Append task settings to plan array, if not present, for comodity
|
||||
foreach ($task->get_settings() as $key => $setting) {
|
||||
if (!in_array($setting, $this->settings)) {
|
||||
$this->settings[] = $setting;
|
||||
$name = $setting->get_name();
|
||||
if (!isset($this->settings[$name])) {
|
||||
$this->settings[$name] = $setting;
|
||||
} else {
|
||||
throw new base_plan_exception('multiple_settings_by_name_found', $name);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -84,23 +89,16 @@ abstract class base_plan implements checksumable, executable {
|
||||
|
||||
/**
|
||||
* return one setting by name, useful to request root/course settings
|
||||
* that are, by definition, unique by name. Throws exception if multiple
|
||||
* are found
|
||||
* that are, by definition, unique by name.
|
||||
*
|
||||
* TODO: Change this to string indexed array for quicker lookup. Not critical
|
||||
* @param string $name name of the setting
|
||||
* @throws base_plan_exception if setting name is not found.
|
||||
*/
|
||||
public function get_setting($name) {
|
||||
$result = null;
|
||||
foreach ($this->settings as $key => $setting) {
|
||||
if ($setting->get_name() == $name) {
|
||||
if ($result != null) {
|
||||
throw new base_plan_exception('multiple_settings_by_name_found', $name);
|
||||
} else {
|
||||
$result = $setting;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!$result) {
|
||||
if (isset($this->settings[$name])) {
|
||||
$result = $this->settings[$name];
|
||||
} else {
|
||||
throw new base_plan_exception('setting_by_name_not_found', $name);
|
||||
}
|
||||
return $result;
|
||||
|
||||
@@ -124,6 +124,8 @@ class backup_ui_stage_initial extends backup_ui_stage {
|
||||
// Store as a variable so we can iterate by reference
|
||||
$tasks = $this->ui->get_tasks();
|
||||
// Iterate all tasks by reference
|
||||
$add_settings = array();
|
||||
$dependencies = array();
|
||||
foreach ($tasks as &$task) {
|
||||
// For the initial stage we are only interested in the root settings
|
||||
if ($task instanceof backup_root_task) {
|
||||
@@ -134,17 +136,23 @@ class backup_ui_stage_initial extends backup_ui_stage {
|
||||
if ($setting->get_name() == 'filename') {
|
||||
continue;
|
||||
}
|
||||
$form->add_setting($setting, $task);
|
||||
$add_settings[] = array($setting, $task);
|
||||
}
|
||||
// Then add all dependencies
|
||||
foreach ($settings as &$setting) {
|
||||
if ($setting->get_name() == 'filename') {
|
||||
continue;
|
||||
}
|
||||
$form->add_dependencies($setting);
|
||||
$dependencies[] = $setting;
|
||||
}
|
||||
}
|
||||
}
|
||||
// Add all settings at once.
|
||||
$form->add_settings($add_settings);
|
||||
// Add dependencies.
|
||||
foreach ($dependencies as $depsetting) {
|
||||
$form->add_dependencies($depsetting);
|
||||
}
|
||||
$this->stageform = $form;
|
||||
}
|
||||
// Return the form
|
||||
@@ -226,6 +234,8 @@ class backup_ui_stage_schema extends backup_ui_stage {
|
||||
$tasks = $this->ui->get_tasks();
|
||||
$content = '';
|
||||
$courseheading = false;
|
||||
$add_settings = array();
|
||||
$dependencies = array();
|
||||
foreach ($tasks as $task) {
|
||||
if (!($task instanceof backup_root_task)) {
|
||||
if (!$courseheading) {
|
||||
@@ -235,11 +245,11 @@ class backup_ui_stage_schema extends backup_ui_stage {
|
||||
}
|
||||
// First add each setting
|
||||
foreach ($task->get_settings() as $setting) {
|
||||
$form->add_setting($setting, $task);
|
||||
$add_settings[] = array($setting, $task);
|
||||
}
|
||||
// The add all the dependencies
|
||||
foreach ($task->get_settings() as $setting) {
|
||||
$form->add_dependencies($setting);
|
||||
$dependencies[] = $setting;
|
||||
}
|
||||
} else if ($this->ui->enforce_changed_dependencies()) {
|
||||
// Only show these settings if dependencies changed them.
|
||||
@@ -254,6 +264,10 @@ class backup_ui_stage_schema extends backup_ui_stage {
|
||||
}
|
||||
}
|
||||
}
|
||||
$form->add_settings($add_settings);
|
||||
foreach ($dependencies as $depsetting) {
|
||||
$form->add_dependencies($depsetting);
|
||||
}
|
||||
$this->stageform = $form;
|
||||
}
|
||||
return $this->stageform;
|
||||
@@ -470,6 +484,9 @@ class backup_ui_stage_complete extends backup_ui_stage_final {
|
||||
|
||||
$output = '';
|
||||
$output .= $renderer->box_start();
|
||||
if (!empty($this->results['include_file_references_to_external_content'])) {
|
||||
$output .= $renderer->notification(get_string('filereferencesincluded', 'backup'), 'notifyproblem');
|
||||
}
|
||||
$output .= $renderer->notification(get_string('executionsuccess', 'backup'), 'notifysuccess');
|
||||
$output .= $renderer->continue_button($restorerul);
|
||||
$output .= $renderer->box_end();
|
||||
|
||||
@@ -136,24 +136,38 @@ abstract class base_moodleform extends moodleform {
|
||||
* @return bool
|
||||
*/
|
||||
function add_setting(backup_setting $setting, base_task $task=null) {
|
||||
return $this->add_settings(array(array($setting, $task)));
|
||||
}
|
||||
/**
|
||||
* Adds multiple backup_settings as elements to the form
|
||||
* @param array $settingstasks Consists of array($setting, $task) elements
|
||||
* @return bool
|
||||
*/
|
||||
public function add_settings(array $settingstasks) {
|
||||
global $OUTPUT;
|
||||
|
||||
// If the setting cant be changed or isn't visible then add it as a fixed setting.
|
||||
if (!$setting->get_ui()->is_changeable() || $setting->get_visibility() != backup_setting::VISIBLE) {
|
||||
return $this->add_fixed_setting($setting, $task);
|
||||
}
|
||||
$defaults = array();
|
||||
foreach ($settingstasks as $st) {
|
||||
list($setting, $task) = $st;
|
||||
// If the setting cant be changed or isn't visible then add it as a fixed setting.
|
||||
if (!$setting->get_ui()->is_changeable() || $setting->get_visibility() != backup_setting::VISIBLE) {
|
||||
$this->add_fixed_setting($setting, $task);
|
||||
continue;
|
||||
}
|
||||
|
||||
// First add the formatting for this setting
|
||||
$this->add_html_formatting($setting);
|
||||
// First add the formatting for this setting
|
||||
$this->add_html_formatting($setting);
|
||||
|
||||
// The call the add method with the get_element_properties array
|
||||
call_user_func_array(array($this->_form, 'addElement'), $setting->get_ui()->get_element_properties($task, $OUTPUT));
|
||||
$this->_form->setDefault($setting->get_ui_name(), $setting->get_value());
|
||||
if ($setting->has_help()) {
|
||||
list($identifier, $component) = $setting->get_help();
|
||||
$this->_form->addHelpButton($setting->get_ui_name(), $identifier, $component);
|
||||
// Then call the add method with the get_element_properties array
|
||||
call_user_func_array(array($this->_form, 'addElement'), $setting->get_ui()->get_element_properties($task, $OUTPUT));
|
||||
$defaults[$setting->get_ui_name()] = $setting->get_value();
|
||||
if ($setting->has_help()) {
|
||||
list($identifier, $component) = $setting->get_help();
|
||||
$this->_form->addHelpButton($setting->get_ui_name(), $identifier, $component);
|
||||
}
|
||||
$this->_form->addElement('html', html_writer::end_tag('div'));
|
||||
}
|
||||
$this->_form->addElement('html', html_writer::end_tag('div'));
|
||||
$this->_form->setDefaults($defaults);
|
||||
return true;
|
||||
}
|
||||
/**
|
||||
@@ -317,4 +331,4 @@ abstract class base_moodleform extends moodleform {
|
||||
$this->definition_after_data();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -92,6 +92,16 @@ class core_backup_renderer extends plugin_renderer_base {
|
||||
$html .= $this->backup_detail_pair(get_string('originalwwwroot', 'backup'),
|
||||
html_writer::tag('span', $details->original_wwwroot, array('class'=>'originalwwwroot')).
|
||||
html_writer::tag('span', '['.$details->original_site_identifier_hash.']', array('class'=>'sitehash sub-detail')));
|
||||
if (!empty($details->include_file_references_to_external_content)) {
|
||||
$message = '';
|
||||
if (backup_general_helper::backup_is_samesite($details)) {
|
||||
$message = $yestick . ' ' . get_string('filereferencessamesite', 'backup');
|
||||
} else {
|
||||
$message = $notick . ' ' . get_string('filereferencesnotsamesite', 'backup');
|
||||
}
|
||||
$html .= $this->backup_detail_pair(get_string('includefilereferences', 'backup'), $message);
|
||||
}
|
||||
|
||||
$html .= html_writer::end_tag('div');
|
||||
|
||||
$html .= html_writer::start_tag('div', array('class'=>'backup-section settings-section'));
|
||||
|
||||
@@ -1,5 +1,8 @@
|
||||
<?php
|
||||
|
||||
defined('MOODLE_INTERNAL') || die();
|
||||
require_once($CFG->libdir . '/filelib.php');
|
||||
|
||||
class block_activity_modules extends block_list {
|
||||
function init() {
|
||||
$this->title = get_string('pluginname', 'block_activity_modules');
|
||||
@@ -50,7 +53,7 @@ class block_activity_modules extends block_list {
|
||||
|
||||
foreach ($modfullnames as $modname => $modfullname) {
|
||||
if ($modname === 'resources') {
|
||||
$icon = '<img src="'.$OUTPUT->pix_url('f/html') . '" class="icon" alt="" /> ';
|
||||
$icon = $OUTPUT->pix_icon(file_extension_icon('.htm'), '', 'moodle', array('class' => 'icon')). ' ';
|
||||
$this->content->items[] = '<a href="'.$CFG->wwwroot.'/course/resources.php?id='.$course->id.'">'.$icon.$modfullname.'</a>';
|
||||
} else {
|
||||
$icon = '<img src="'.$OUTPUT->pix_url('icon', $modname) . '" class="icon" alt="" /> ';
|
||||
|
||||
@@ -62,7 +62,7 @@ class block_private_files extends block_base {
|
||||
$renderer = $this->page->get_renderer('block_private_files');
|
||||
$this->content->text = $renderer->private_files_tree();
|
||||
if (has_capability('moodle/user:manageownfiles', $this->context)) {
|
||||
$this->content->text .= $OUTPUT->single_button(new moodle_url('/user/filesedit.php', array('returnurl'=>$PAGE->url->out())), get_string('myfilesmanage'), 'get');
|
||||
$this->content->text .= $OUTPUT->single_button(new moodle_url('/user/files.php', array('returnurl'=>$PAGE->url->out())), get_string('myfilesmanage'), 'get');
|
||||
}
|
||||
$this->content->footer = '';
|
||||
|
||||
|
||||
@@ -45,7 +45,7 @@ $PAGE->set_pagelayout('mydashboard');
|
||||
$PAGE->set_pagetype('user-private-files');
|
||||
|
||||
$data = new stdClass();
|
||||
$options = array('subdirs'=>1, 'maxbytes'=>$CFG->userquota, 'maxfiles'=>-1, 'accepted_types'=>'*', 'return_types'=>FILE_INTERNAL);
|
||||
$options = array('subdirs'=>1, 'maxbytes'=>$CFG->userquota, 'maxfiles'=>-1, 'accepted_types'=>'*');
|
||||
file_prepare_standard_filemanager($data, 'files', $options, $context, 'user', 'private', 0);
|
||||
|
||||
$mform = new block_private_files_form(null, array('data'=>$data, 'options'=>$options));
|
||||
|
||||
@@ -65,14 +65,13 @@ class block_private_files_renderer extends plugin_renderer_base {
|
||||
}
|
||||
$result = '<ul>';
|
||||
foreach ($dir['subdirs'] as $subdir) {
|
||||
$image = $this->output->pix_icon("f/folder", $subdir['dirname'], 'moodle', array('class'=>'icon'));
|
||||
$image = $this->output->pix_icon(file_folder_icon(), $subdir['dirname'], 'moodle', array('class'=>'icon'));
|
||||
$result .= '<li yuiConfig=\''.json_encode($yuiconfig).'\'><div>'.$image.' '.s($subdir['dirname']).'</div> '.$this->htmllize_tree($tree, $subdir).'</li>';
|
||||
}
|
||||
foreach ($dir['files'] as $file) {
|
||||
$url = file_encode_url("$CFG->wwwroot/pluginfile.php", '/'.$tree->context->id.'/user/private'.$file->get_filepath().$file->get_filename(), true);
|
||||
$filename = $file->get_filename();
|
||||
$icon = mimeinfo("icon", $filename);
|
||||
$image = $this->output->pix_icon("f/$icon", $filename, 'moodle', array('class'=>'icon'));
|
||||
$image = $this->output->pix_icon(file_file_icon($file), $filename, 'moodle', array('class'=>'icon'));
|
||||
$result .= '<li yuiConfig=\''.json_encode($yuiconfig).'\'><div>'.html_writer::link($url, $image.' '.$filename).'</div></li>';
|
||||
}
|
||||
$result .= '</ul>';
|
||||
|
||||
@@ -192,6 +192,8 @@ if (!empty($userid)) {
|
||||
if (!blog_user_can_view_user_entry($userid)) {
|
||||
print_error('cannotviewcourseblog', 'blog');
|
||||
}
|
||||
|
||||
$PAGE->navigation->extend_for_user($user);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+2
-5
@@ -513,10 +513,7 @@ class blog_entry {
|
||||
$ffurl = file_encode_url($CFG->wwwroot.'/pluginfile.php', '/'.SYSCONTEXTID.'/blog/attachment/'.$this->id.'/'.$filename);
|
||||
$mimetype = $file->get_mimetype();
|
||||
|
||||
$icon = mimeinfo_from_type("icon", $mimetype);
|
||||
$type = mimeinfo_from_type("type", $mimetype);
|
||||
|
||||
$image = $OUTPUT->pix_icon("f/$icon", $filename, 'moodle', array('class'=>'icon'));
|
||||
$image = $OUTPUT->pix_icon(file_file_icon($file), $filename, 'moodle', array('class'=>'icon'));
|
||||
|
||||
if ($return == "html") {
|
||||
$output .= html_writer::link($ffurl, $image);
|
||||
@@ -526,7 +523,7 @@ class blog_entry {
|
||||
$output .= "$strattachment $filename:\n$ffurl\n";
|
||||
|
||||
} else {
|
||||
if (in_array($type, array('image/gif', 'image/jpeg', 'image/png'))) { // Image attachments don't get printed as links
|
||||
if (file_mimetype_in_typegroup($file->get_mimetype(), 'web_image')) { // Image attachments don't get printed as links
|
||||
$imagereturn .= '<br /><img src="'.$ffurl.'" alt="" />';
|
||||
} else {
|
||||
$imagereturn .= html_writer::link($ffurl, $image);
|
||||
|
||||
+32
-20
@@ -242,7 +242,6 @@ function calendar_get_mini($courses, $groups, $users, $cal_month = false, $cal_y
|
||||
$days_title = calendar_get_days();
|
||||
|
||||
$summary = get_string('calendarheading', 'calendar', userdate(make_timestamp($y, $m), get_string('strftimemonthyear')));
|
||||
$summary = get_string('tabledata', 'access', $summary);
|
||||
$content .= '<table class="minicalendar calendartable" summary="'.$summary.'">'; // Begin table
|
||||
$content .= '<tr class="weekdays">'; // Header row: day names
|
||||
|
||||
@@ -1352,6 +1351,10 @@ function calendar_set_filters(array $courseeventsfrom, $ignorefilters = false) {
|
||||
$user = false;
|
||||
$group = false;
|
||||
|
||||
// capabilities that allow seeing group events from all groups
|
||||
// TODO: rewrite so that moodle/calendar:manageentries is not necessary here
|
||||
$allgroupscaps = array('moodle/site:accessallgroups', 'moodle/calendar:manageentries');
|
||||
|
||||
$isloggedin = isloggedin();
|
||||
|
||||
if ($ignorefilters || calendar_show_event_type(CALENDAR_EVENT_COURSE)) {
|
||||
@@ -1377,26 +1380,35 @@ function calendar_set_filters(array $courseeventsfrom, $ignorefilters = false) {
|
||||
|
||||
if (!empty($courseeventsfrom) && (calendar_show_event_type(CALENDAR_EVENT_GROUP) || $ignorefilters)) {
|
||||
|
||||
if (!empty($CFG->calendar_adminseesall) && has_capability('moodle/calendar:manageentries', get_system_context())) {
|
||||
$group = true;
|
||||
} else if ($isloggedin) {
|
||||
$groupids = array();
|
||||
|
||||
// We already have the courses to examine in $courses
|
||||
// For each course...
|
||||
foreach ($courseeventsfrom as $courseid => $course) {
|
||||
// If the user is an editing teacher in there,
|
||||
if (!empty($USER->groupmember[$course->id])) {
|
||||
// We've already cached the users groups for this course so we can just use that
|
||||
$groupids = array_merge($groupids, $USER->groupmember[$course->id]);
|
||||
} else if (($course->groupmode != NOGROUPS || !$course->groupmodeforce) && has_capability('moodle/calendar:manageentries', get_context_instance(CONTEXT_COURSE, $course->id))) {
|
||||
// If this course has groups, show events from all of them
|
||||
$coursegroups = groups_get_user_groups($course->id, $USER->id);
|
||||
$groupids = array_merge($groupids, $coursegroups['0']);
|
||||
}
|
||||
if (count($courseeventsfrom)==1) {
|
||||
$course = reset($courseeventsfrom);
|
||||
if (has_any_capability($allgroupscaps, get_context_instance(CONTEXT_COURSE, $course->id))) {
|
||||
$coursegroups = groups_get_all_groups($course->id, 0, 0, 'g.id');
|
||||
$group = array_keys($coursegroups);
|
||||
}
|
||||
if (!empty($groupids)) {
|
||||
$group = $groupids;
|
||||
}
|
||||
if ($group === false) {
|
||||
if (!empty($CFG->calendar_adminseesall) && has_any_capability($allgroupscaps, get_system_context())) {
|
||||
$group = true;
|
||||
} else if ($isloggedin) {
|
||||
$groupids = array();
|
||||
|
||||
// We already have the courses to examine in $courses
|
||||
// For each course...
|
||||
foreach ($courseeventsfrom as $courseid => $course) {
|
||||
// If the user is an editing teacher in there,
|
||||
if (!empty($USER->groupmember[$course->id])) {
|
||||
// We've already cached the users groups for this course so we can just use that
|
||||
$groupids = array_merge($groupids, $USER->groupmember[$course->id]);
|
||||
} else if ($course->groupmode != NOGROUPS || !$course->groupmodeforce) {
|
||||
// If this course has groups, show events from all of those related to the current user
|
||||
$coursegroups = groups_get_user_groups($course->id, $USER->id);
|
||||
$groupids = array_merge($groupids, $coursegroups['0']);
|
||||
}
|
||||
}
|
||||
if (!empty($groupids)) {
|
||||
$group = $groupids;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -385,6 +385,9 @@ bodyContent: '<div class="comment-delete-confirm"><a href="#" id="confirmdelete-
|
||||
},
|
||||
toggle_textarea: function(focus) {
|
||||
var t = Y.one('#dlg-content-'+this.client_id);
|
||||
if (!t) {
|
||||
return false;
|
||||
}
|
||||
if (focus) {
|
||||
if (t.get('value') == M.str.moodle.addcomment) {
|
||||
t.set('value', '');
|
||||
|
||||
@@ -53,5 +53,7 @@ if ($course->numsections >= 0) {
|
||||
$DB->update_record('course', $course);
|
||||
}
|
||||
|
||||
$url = course_get_url($course);
|
||||
$url->set_anchor('changenumsections');
|
||||
// Redirect to where we were..
|
||||
redirect(course_get_url($course));
|
||||
redirect($url);
|
||||
|
||||
+19
-17
@@ -103,44 +103,43 @@ if ($form->is_cancelled()){
|
||||
|
||||
// Handle aggregation methods
|
||||
// Overall aggregation
|
||||
$aggregation = new completion_aggregation();
|
||||
$aggregation->course = $data->id;
|
||||
$aggregation->criteriatype = null;
|
||||
$aggdata = array(
|
||||
'course' => $data->id,
|
||||
'criteriatype' => null
|
||||
);
|
||||
$aggregation = new completion_aggregation($aggdata);
|
||||
$aggregation->setMethod($data->overall_aggregation);
|
||||
$aggregation->insert();
|
||||
$aggregation->save();
|
||||
|
||||
// Activity aggregation
|
||||
if (empty($data->activity_aggregation)) {
|
||||
$data->activity_aggregation = 0;
|
||||
}
|
||||
|
||||
$aggregation = new completion_aggregation();
|
||||
$aggregation->course = $data->id;
|
||||
$aggregation->criteriatype = COMPLETION_CRITERIA_TYPE_ACTIVITY;
|
||||
$aggdata['criteriatype'] = COMPLETION_CRITERIA_TYPE_ACTIVITY;
|
||||
$aggregation = new completion_aggregation($aggdata);
|
||||
$aggregation->setMethod($data->activity_aggregation);
|
||||
$aggregation->insert();
|
||||
$aggregation->save();
|
||||
|
||||
// Course aggregation
|
||||
if (empty($data->course_aggregation)) {
|
||||
$data->course_aggregation = 0;
|
||||
}
|
||||
|
||||
$aggregation = new completion_aggregation();
|
||||
$aggregation->course = $data->id;
|
||||
$aggregation->criteriatype = COMPLETION_CRITERIA_TYPE_COURSE;
|
||||
$aggdata['criteriatype'] = COMPLETION_CRITERIA_TYPE_COURSE;
|
||||
$aggregation = new completion_aggregation($aggdata);
|
||||
$aggregation->setMethod($data->course_aggregation);
|
||||
$aggregation->insert();
|
||||
$aggregation->save();
|
||||
|
||||
// Role aggregation
|
||||
if (empty($data->role_aggregation)) {
|
||||
$data->role_aggregation = 0;
|
||||
}
|
||||
|
||||
$aggregation = new completion_aggregation();
|
||||
$aggregation->course = $data->id;
|
||||
$aggregation->criteriatype = COMPLETION_CRITERIA_TYPE_ROLE;
|
||||
$aggdata['criteriatype'] = COMPLETION_CRITERIA_TYPE_ROLE;
|
||||
$aggregation = new completion_aggregation($aggdata);
|
||||
$aggregation->setMethod($data->role_aggregation);
|
||||
$aggregation->insert();
|
||||
$aggregation->save();
|
||||
|
||||
// Update course total passing grade
|
||||
if (!empty($data->criteria_grade)) {
|
||||
@@ -152,7 +151,10 @@ if ($form->is_cancelled()){
|
||||
}
|
||||
}
|
||||
|
||||
redirect($CFG->wwwroot."/course/view.php?id=$course->id", get_string('changessaved'));
|
||||
add_to_log($course->id, 'course', 'completion updated', 'completion.php?id='.$course->id);
|
||||
|
||||
$url = new moodle_url('/course/view.php', array('id' => $course->id));
|
||||
redirect($url);
|
||||
}
|
||||
|
||||
|
||||
|
||||
+66
-22
@@ -92,14 +92,12 @@ M.course_dndupload = {
|
||||
this.init_events(el);
|
||||
}, this);
|
||||
|
||||
var div = this.add_status_div();
|
||||
div.setContent(M.util.get_string('dndworking', 'moodle'));
|
||||
this.add_status_div();
|
||||
},
|
||||
|
||||
/**
|
||||
* Add a div element to tell the user that drag and drop upload
|
||||
* is available (or to explain why it is not available)
|
||||
* @return the DOM element to add messages to
|
||||
*/
|
||||
add_status_div: function() {
|
||||
var div = document.createElement('div');
|
||||
@@ -108,7 +106,34 @@ M.course_dndupload = {
|
||||
if (coursecontents) {
|
||||
coursecontents.insertBefore(div, coursecontents.firstChild);
|
||||
}
|
||||
return this.Y.one(div);
|
||||
div = this.Y.one(div);
|
||||
|
||||
var handlefile = (this.handlers.filehandlers.length > 0);
|
||||
var handletext = false;
|
||||
var handlelink = false;
|
||||
var i;
|
||||
for (i=0; i<this.handlers.types.length; i++) {
|
||||
switch (this.handlers.types[i].identifier) {
|
||||
case 'text':
|
||||
case 'text/html':
|
||||
handletext = true;
|
||||
break;
|
||||
case 'url':
|
||||
handlelink = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
$msgident = 'dndworking';
|
||||
if (handlefile) {
|
||||
$msgident += 'file';
|
||||
}
|
||||
if (handletext) {
|
||||
$msgident += 'text';
|
||||
}
|
||||
if (handlelink) {
|
||||
$msgident += 'link';
|
||||
}
|
||||
div.setContent(M.util.get_string($msgident, 'moodle'));
|
||||
},
|
||||
|
||||
/**
|
||||
@@ -176,14 +201,7 @@ M.course_dndupload = {
|
||||
*/
|
||||
types_includes: function(e, type) {
|
||||
var i;
|
||||
if (e._event.dataTransfer === null) {
|
||||
// TODO MDL-33054: If we get here then something has gone wrong.
|
||||
return false;
|
||||
}
|
||||
var types = e._event.dataTransfer.types;
|
||||
if (types == null) {
|
||||
return false;
|
||||
}
|
||||
for (i=0; i<types.length; i++) {
|
||||
if (types[i] == type) {
|
||||
return true;
|
||||
@@ -204,19 +222,33 @@ M.course_dndupload = {
|
||||
* }
|
||||
*/
|
||||
drag_type: function(e) {
|
||||
if (this.types_includes(e, 'Files')) {
|
||||
if (this.handlers.filehandlers.length == 0) {
|
||||
return false; // No available file handlers - ignore this drag.
|
||||
}
|
||||
return {
|
||||
realtype: 'Files',
|
||||
addmessage: M.util.get_string('addfilehere', 'moodle'),
|
||||
namemessage: null, // Should not be asked for anyway
|
||||
type: 'Files'
|
||||
};
|
||||
// Check there is some data attached.
|
||||
if (e._event.dataTransfer === null) {
|
||||
return false;
|
||||
}
|
||||
if (e._event.dataTransfer.types === null) {
|
||||
return false;
|
||||
}
|
||||
if (e._event.dataTransfer.types.length == 0) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Check each of the registered types
|
||||
// Check for files first.
|
||||
if (this.types_includes(e, 'Files')) {
|
||||
if (e.type != 'drop' || e._event.dataTransfer.files.length != 0) {
|
||||
if (this.handlers.filehandlers.length == 0) {
|
||||
return false; // No available file handlers - ignore this drag.
|
||||
}
|
||||
return {
|
||||
realtype: 'Files',
|
||||
addmessage: M.util.get_string('addfilehere', 'moodle'),
|
||||
namemessage: null, // Should not be asked for anyway
|
||||
type: 'Files'
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
// Check each of the registered types.
|
||||
var types = this.handlers.types;
|
||||
for (var i=0; i<types.length; i++) {
|
||||
// Check each of the different identifiers for this type
|
||||
@@ -401,6 +433,7 @@ M.course_dndupload = {
|
||||
resel.div.appendChild(resel.a);
|
||||
|
||||
resel.icon.src = M.util.image_url('i/ajaxloader');
|
||||
resel.icon.className = 'activityicon';
|
||||
resel.a.appendChild(resel.icon);
|
||||
|
||||
resel.a.appendChild(document.createTextNode(' '));
|
||||
@@ -672,6 +705,11 @@ M.course_dndupload = {
|
||||
if (result.onclick) {
|
||||
resel.a.onclick = result.onclick;
|
||||
}
|
||||
if (self.Y.UA.gecko > 0) {
|
||||
// Fix a Firefox bug which makes sites with a '~' in their wwwroot
|
||||
// log the user out when clicking on the link (before refreshing the page).
|
||||
resel.div.innerHTML = unescape(resel.div.innerHTML);
|
||||
}
|
||||
self.add_editing(result.elementid);
|
||||
} else {
|
||||
// Error - remove the dummy element
|
||||
@@ -813,6 +851,7 @@ M.course_dndupload = {
|
||||
* @param contents the actual data that was dropped
|
||||
* @param section the DOM element representing the selected course section
|
||||
* @param sectionnumber the number of the selected course section
|
||||
* @param module the module chosen to handle this upload
|
||||
*/
|
||||
upload_item: function(name, type, contents, section, sectionnumber, module) {
|
||||
|
||||
@@ -846,6 +885,11 @@ M.course_dndupload = {
|
||||
if (result.onclick) {
|
||||
resel.a.onclick = result.onclick;
|
||||
}
|
||||
if (self.Y.UA.gecko > 0) {
|
||||
// Fix a Firefox bug which makes sites with a '~' in their wwwroot
|
||||
// log the user out when clicking on the link (before refreshing the page).
|
||||
resel.div.innerHTML = unescape(resel.div.innerHTML);
|
||||
}
|
||||
self.add_editing(result.elementid, sectionnumber);
|
||||
} else {
|
||||
// Error - remove the dummy element
|
||||
|
||||
+29
-13
@@ -52,7 +52,13 @@ function dndupload_add_to_course($course, $modnames) {
|
||||
'fullpath' => new moodle_url('/course/dndupload.js'),
|
||||
'strings' => array(
|
||||
array('addfilehere', 'moodle'),
|
||||
array('dndworking', 'moodle'),
|
||||
array('dndworkingfiletextlink', 'moodle'),
|
||||
array('dndworkingfilelink', 'moodle'),
|
||||
array('dndworkingfiletext', 'moodle'),
|
||||
array('dndworkingfile', 'moodle'),
|
||||
array('dndworkingtextlink', 'moodle'),
|
||||
array('dndworkingtext', 'moodle'),
|
||||
array('dndworkinglink', 'moodle'),
|
||||
array('filetoolarge', 'moodle'),
|
||||
array('actionchoice', 'moodle'),
|
||||
array('servererror', 'moodle'),
|
||||
@@ -103,7 +109,7 @@ class dndupload_handler {
|
||||
// Add some default types to handle.
|
||||
// Note: 'Files' type is hard-coded into the Javascript as this needs to be ...
|
||||
// ... treated a little differently.
|
||||
$this->add_type('url', array('url', 'text/uri-list'), get_string('addlinkhere', 'moodle'),
|
||||
$this->add_type('url', array('url', 'text/uri-list', 'text/x-moz-url'), get_string('addlinkhere', 'moodle'),
|
||||
get_string('nameforlink', 'moodle'), 10);
|
||||
$this->add_type('text/html', array('text/html'), get_string('addpagehere', 'moodle'),
|
||||
get_string('nameforpage', 'moodle'), 20);
|
||||
@@ -298,17 +304,21 @@ class dndupload_handler {
|
||||
* @return object Data to pass on to Javascript code
|
||||
*/
|
||||
public function get_js_data() {
|
||||
global $CFG;
|
||||
|
||||
$ret = new stdClass;
|
||||
|
||||
// Sort the types by priority.
|
||||
uasort($this->types, array($this, 'type_compare'));
|
||||
|
||||
$ret->types = array();
|
||||
foreach ($this->types as $type) {
|
||||
if (empty($type->handlers)) {
|
||||
continue; // Skip any types without registered handlers.
|
||||
if (!empty($CFG->dndallowtextandlinks)) {
|
||||
foreach ($this->types as $type) {
|
||||
if (empty($type->handlers)) {
|
||||
continue; // Skip any types without registered handlers.
|
||||
}
|
||||
$ret->types[] = $type;
|
||||
}
|
||||
$ret->types[] = $type;
|
||||
}
|
||||
|
||||
$ret->filehandlers = $this->filehandlers;
|
||||
@@ -430,6 +440,10 @@ class dndupload_ajax_processor {
|
||||
if ($content != null) {
|
||||
throw new moodle_exception('fileuploadwithcontent', 'moodle');
|
||||
}
|
||||
} else {
|
||||
if (empty($content)) {
|
||||
throw new moodle_exception('dnduploadwithoutcontent', 'moodle');
|
||||
}
|
||||
}
|
||||
|
||||
require_sesskey();
|
||||
@@ -543,7 +557,13 @@ class dndupload_ajax_processor {
|
||||
}
|
||||
// The following are used inside some few core functions, so may as well set them here.
|
||||
$this->cm->coursemodule = $this->cm->id;
|
||||
$this->cm->groupmodelink = (!$this->course->groupmodeforce);
|
||||
$groupbuttons = ($this->course->groupmode or (!$this->course->groupmodeforce));
|
||||
if ($groupbuttons and plugin_supports('mod', $this->module->name, FEATURE_GROUPS, 0)) {
|
||||
$this->cm->groupmodelink = (!$this->course->groupmodeforce);
|
||||
} else {
|
||||
$this->cm->groupmodelink = false;
|
||||
$this->cm->groupmode = false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -605,6 +625,8 @@ class dndupload_ajax_processor {
|
||||
throw new moodle_exception('errorcreatingactivity', 'moodle', '', $this->module->name);
|
||||
}
|
||||
$mod = $info->cms[$this->cm->id];
|
||||
$mod->groupmodelink = $this->cm->groupmodelink;
|
||||
$mod->groupmode = $this->cm->groupmode;
|
||||
|
||||
// Trigger mod_created event with information about this module.
|
||||
$eventdata = new stdClass();
|
||||
@@ -622,12 +644,6 @@ class dndupload_ajax_processor {
|
||||
"view.php?id=$mod->id",
|
||||
"$instanceid", $mod->id);
|
||||
|
||||
if ($this->cm->groupmodelink && plugin_supports('mod', $mod->modname, FEATURE_GROUPS, 0)) {
|
||||
$mod->groupmodelink = $this->cm->groupmodelink;
|
||||
} else {
|
||||
$mod->groupmodelink = false;
|
||||
}
|
||||
|
||||
$this->send_response($mod);
|
||||
}
|
||||
|
||||
|
||||
@@ -302,8 +302,7 @@ class core_course_external extends external_api {
|
||||
$exceptionparam = new stdClass();
|
||||
$exceptionparam->message = $e->getMessage();
|
||||
$exceptionparam->courseid = $course->id;
|
||||
throw new moodle_exception(
|
||||
get_string('errorcoursecontextnotvalid', 'webservice', $exceptionparam));
|
||||
throw new moodle_exception('errorcoursecontextnotvalid', 'webservice', '', $exceptionparam);
|
||||
}
|
||||
require_capability('moodle/course:view', $context);
|
||||
|
||||
@@ -519,23 +518,20 @@ class core_course_external extends external_api {
|
||||
$exceptionparam = new stdClass();
|
||||
$exceptionparam->message = $e->getMessage();
|
||||
$exceptionparam->catid = $course['categoryid'];
|
||||
throw new moodle_exception(
|
||||
get_string('errorcatcontextnotvalid', 'webservice', $exceptionparam));
|
||||
throw new moodle_exception('errorcatcontextnotvalid', 'webservice', '', $exceptionparam);
|
||||
}
|
||||
require_capability('moodle/course:create', $context);
|
||||
|
||||
// Make sure lang is valid
|
||||
if (key_exists('lang', $course) and empty($availablelangs[$course['lang']])) {
|
||||
throw new moodle_exception(
|
||||
get_string('errorinvalidparam', 'webservice', 'lang'));
|
||||
throw new moodle_exception('errorinvalidparam', 'webservice', '', 'lang');
|
||||
}
|
||||
|
||||
// Make sure theme is valid
|
||||
if (key_exists('forcetheme', $course)) {
|
||||
if (!empty($CFG->allowcoursethemes)) {
|
||||
if (empty($availablethemes[$course['forcetheme']])) {
|
||||
throw new moodle_exception(
|
||||
get_string('errorinvalidparam', 'webservice', 'forcetheme'));
|
||||
throw new moodle_exception('errorinvalidparam', 'webservice', '', 'forcetheme');
|
||||
} else {
|
||||
$course['theme'] = $course['forcetheme'];
|
||||
}
|
||||
|
||||
+68
-22
@@ -56,6 +56,21 @@ abstract class format_section_renderer_base extends plugin_renderer_base {
|
||||
*/
|
||||
abstract protected function page_title();
|
||||
|
||||
/**
|
||||
* Generate the section title
|
||||
*
|
||||
* @param stdClass $section The course_section entry from DB
|
||||
* @param stdClass $course The course entry from DB
|
||||
* @return string HTML to output.
|
||||
*/
|
||||
public function section_title($section, $course) {
|
||||
$title = get_section_name($course, $section);
|
||||
if ($section->section != 0 && $course->coursedisplay == COURSE_DISPLAY_MULTIPAGE) {
|
||||
$title = html_writer::link(course_get_url($course, $section->section), $title);
|
||||
}
|
||||
return $title;
|
||||
}
|
||||
|
||||
/**
|
||||
* Generate the content to displayed on the right part of a section
|
||||
* before course modules are included
|
||||
@@ -92,7 +107,7 @@ abstract class format_section_renderer_base extends plugin_renderer_base {
|
||||
|
||||
if ($section->section != 0) {
|
||||
// Only in the non-general sections.
|
||||
if ($course->marker == $section->section) {
|
||||
if ($this->is_section_current($section, $course)) {
|
||||
$o = get_accesshide(get_string('currentsection', 'format_'.$course->format));
|
||||
}
|
||||
}
|
||||
@@ -106,7 +121,7 @@ abstract class format_section_renderer_base extends plugin_renderer_base {
|
||||
*
|
||||
* @param stdClass $section The course_section entry from DB
|
||||
* @param stdClass $course The course entry from DB
|
||||
* @param bool $onsectionpage true if being printed on a section page
|
||||
* @param bool $onsectionpage true if being printed on a single-section page
|
||||
* @return string HTML to output.
|
||||
*/
|
||||
protected function section_header($section, $course, $onsectionpage) {
|
||||
@@ -115,16 +130,14 @@ abstract class format_section_renderer_base extends plugin_renderer_base {
|
||||
$o = '';
|
||||
$currenttext = '';
|
||||
$sectionstyle = '';
|
||||
$linktitle = false;
|
||||
|
||||
if ($section->section != 0) {
|
||||
// Only in the non-general sections.
|
||||
if (!$section->visible) {
|
||||
$sectionstyle = ' hidden';
|
||||
} else if ($course->marker == $section->section) {
|
||||
} else if ($this->is_section_current($section, $course)) {
|
||||
$sectionstyle = ' current';
|
||||
}
|
||||
$linktitle = ($course->coursedisplay == COURSE_DISPLAY_MULTIPAGE);
|
||||
}
|
||||
|
||||
$o.= html_writer::start_tag('li', array('id' => 'section-'.$section->section,
|
||||
@@ -138,11 +151,7 @@ abstract class format_section_renderer_base extends plugin_renderer_base {
|
||||
$o.= html_writer::start_tag('div', array('class' => 'content'));
|
||||
|
||||
if (!$onsectionpage) {
|
||||
$title = get_section_name($course, $section);
|
||||
if ($linktitle) {
|
||||
$title = html_writer::link(course_get_url($course, $section->section), $title);
|
||||
}
|
||||
$o.= $this->output->heading($title, 3, 'sectionname');
|
||||
$o.= $this->output->heading($this->section_title($section, $course), 3, 'sectionname');
|
||||
}
|
||||
|
||||
$o.= html_writer::start_tag('div', array('class' => 'summary'));
|
||||
@@ -261,10 +270,15 @@ abstract class format_section_renderer_base extends plugin_renderer_base {
|
||||
* @return string HTML to output.
|
||||
*/
|
||||
protected function section_summary($section, $course) {
|
||||
// If section is hidden then display grey section link
|
||||
$classattr = 'section-summary clearfix';
|
||||
If (!$section->visible) {
|
||||
$classattr .= ' dimmed_text';
|
||||
}
|
||||
|
||||
$o = '';
|
||||
$o.= html_writer::start_tag('li', array('id' => 'section-'.$section->section,
|
||||
'class' => 'section-summary clearfix'));
|
||||
'class' => $classattr));
|
||||
|
||||
$title = get_section_name($course, $section);
|
||||
$o.= html_writer::start_tag('a', array('href' => course_get_url($course, $section->section)));
|
||||
@@ -351,9 +365,13 @@ abstract class format_section_renderer_base extends plugin_renderer_base {
|
||||
$back = $sectionno - 1;
|
||||
while ($back > 0 and empty($links['previous'])) {
|
||||
if ($canviewhidden || $sections[$back]->visible) {
|
||||
$params = array();
|
||||
if (!$sections[$back]->visible) {
|
||||
$params = array('class' => 'dimmed_text');
|
||||
}
|
||||
$previouslink = html_writer::tag('span', $this->output->larrow(), array('class' => 'larrow'));
|
||||
$previouslink .= get_section_name($course, $sections[$back]);
|
||||
$links['previous'] = html_writer::link(course_get_url($course, $back), $previouslink);
|
||||
$links['previous'] = html_writer::link(course_get_url($course, $back), $previouslink, $params);
|
||||
}
|
||||
$back--;
|
||||
}
|
||||
@@ -361,9 +379,13 @@ abstract class format_section_renderer_base extends plugin_renderer_base {
|
||||
$forward = $sectionno + 1;
|
||||
while ($forward <= $course->numsections and empty($links['next'])) {
|
||||
if ($canviewhidden || $sections[$forward]->visible) {
|
||||
$params = array();
|
||||
if (!$sections[$forward]->visible) {
|
||||
$params = array('class' => 'dimmed_text');
|
||||
}
|
||||
$nextlink = get_section_name($course, $sections[$forward]);
|
||||
$nextlink .= html_writer::tag('span', $this->output->rarrow(), array('class' => 'rarrow'));
|
||||
$links['next'] = html_writer::link(course_get_url($course, $forward), $nextlink);
|
||||
$links['next'] = html_writer::link(course_get_url($course, $forward), $nextlink, $params);
|
||||
}
|
||||
$forward++;
|
||||
}
|
||||
@@ -444,7 +466,6 @@ abstract class format_section_renderer_base extends plugin_renderer_base {
|
||||
echo $this->start_section_list();
|
||||
echo $this->section_hidden($displaysection);
|
||||
echo $this->end_section_list();
|
||||
echo $sectionnavlinks;
|
||||
}
|
||||
// Can't view this section.
|
||||
return;
|
||||
@@ -463,20 +484,24 @@ abstract class format_section_renderer_base extends plugin_renderer_base {
|
||||
echo $this->end_section_list();
|
||||
}
|
||||
|
||||
// Start single-section div
|
||||
echo html_writer::start_tag('div', array('class' => 'single-section'));
|
||||
|
||||
// Title with section navigation links.
|
||||
$sectionnavlinks = $this->get_nav_links($course, $sections, $displaysection);
|
||||
$sectiontitle = '';
|
||||
$sectiontitle .= html_writer::start_tag('div', array('class' => 'section-navigation headingblock header'));
|
||||
$sectiontitle .= html_writer::start_tag('div', array('class' => 'section-navigation header headingblock'));
|
||||
$sectiontitle .= html_writer::tag('span', $sectionnavlinks['previous'], array('class' => 'mdl-left'));
|
||||
$sectiontitle .= html_writer::tag('span', $sectionnavlinks['next'], array('class' => 'mdl-right'));
|
||||
$sectiontitle .= html_writer::tag('div', get_section_name($course, $sections[$displaysection]), array('class' => 'mdl-align'));
|
||||
// Title attributes
|
||||
$titleattr = 'mdl-align title';
|
||||
if (!$sections[$displaysection]->visible) {
|
||||
$titleattr .= ' dimmed_text';
|
||||
}
|
||||
$sectiontitle .= html_writer::tag('div', get_section_name($course, $sections[$displaysection]), array('class' => $titleattr));
|
||||
$sectiontitle .= html_writer::end_tag('div');
|
||||
echo $sectiontitle;
|
||||
|
||||
// Show completion help icon.
|
||||
$completioninfo = new completion_info($course);
|
||||
echo $completioninfo->display_help_icon();
|
||||
|
||||
// Copy activity clipboard..
|
||||
echo $this->course_activity_clipboard($course, $displaysection);
|
||||
|
||||
@@ -486,7 +511,11 @@ abstract class format_section_renderer_base extends plugin_renderer_base {
|
||||
// The requested section page.
|
||||
$thissection = $sections[$displaysection];
|
||||
echo $this->section_header($thissection, $course, true);
|
||||
print_section($course, $thissection, $mods, $modnamesused, true);
|
||||
// Show completion help icon.
|
||||
$completioninfo = new completion_info($course);
|
||||
echo $completioninfo->display_help_icon();
|
||||
|
||||
print_section($course, $thissection, $mods, $modnamesused, true, '100%', false, true);
|
||||
if ($PAGE->user_is_editing()) {
|
||||
print_section_add_menus($course, $displaysection, $modnames);
|
||||
}
|
||||
@@ -502,6 +531,9 @@ abstract class format_section_renderer_base extends plugin_renderer_base {
|
||||
$sectionbottomnav .= html_writer::tag('div', $courselink, array('class' => 'mdl-align'));
|
||||
$sectionbottomnav .= html_writer::end_tag('div');
|
||||
echo $sectionbottomnav;
|
||||
|
||||
// close single-section div.
|
||||
echo html_writer::end_tag('div');
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -552,6 +584,8 @@ abstract class format_section_renderer_base extends plugin_renderer_base {
|
||||
// a section_info object - we will need at least the uservisible
|
||||
// field in it.
|
||||
$thissection->uservisible = true;
|
||||
$thissection->availableinfo = null;
|
||||
$thissection->showavailability = 0;
|
||||
}
|
||||
// Show the section if the user is permitted to access it, OR if it's not available
|
||||
// but showavailability is turned on
|
||||
@@ -599,7 +633,7 @@ abstract class format_section_renderer_base extends plugin_renderer_base {
|
||||
|
||||
echo $this->end_section_list();
|
||||
|
||||
echo html_writer::start_tag('div', array('class' => 'mdl-right'));
|
||||
echo html_writer::start_tag('div', array('id' => 'changenumsections', 'class' => 'mdl-right'));
|
||||
|
||||
// Increase number of sections.
|
||||
$straddsection = get_string('increasesections', 'moodle');
|
||||
@@ -644,4 +678,16 @@ abstract class format_section_renderer_base extends plugin_renderer_base {
|
||||
$options->overflowdiv = true;
|
||||
return format_text($summarytext, $section->summaryformat, $options);
|
||||
}
|
||||
|
||||
/**
|
||||
* Is the section passed in the current section? (Note this isn't strictly
|
||||
* a renderering method, but neater here).
|
||||
*
|
||||
* @param stdClass $course The course entry from DB
|
||||
* @param stdClass $section The course_section entry from the DB
|
||||
* @return bool true if the section is current
|
||||
*/
|
||||
protected function is_section_current($section, $course) {
|
||||
return ($course->marker == $section->section);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,17 +1,28 @@
|
||||
// Javascript functions for course format
|
||||
// Javascript functions for Topics course format
|
||||
|
||||
M.course = M.course || {};
|
||||
|
||||
M.course.format = M.course.format || {};
|
||||
|
||||
/**
|
||||
* Get section list for this format
|
||||
* Get sections config for this format
|
||||
*
|
||||
* @param {YUI} Y YUI3 instance
|
||||
* @return {string} section list selector
|
||||
* The section structure is:
|
||||
* <ul class="topics">
|
||||
* <li class="section">...</li>
|
||||
* <li class="section">...</li>
|
||||
* ...
|
||||
* </ul>
|
||||
*
|
||||
* @return {object} section list configuration
|
||||
*/
|
||||
M.course.format.get_section_selector = function(Y) {
|
||||
return 'li.section';
|
||||
M.course.format.get_config = function() {
|
||||
return {
|
||||
container_node : 'ul',
|
||||
container_class : 'topics',
|
||||
section_node : 'li',
|
||||
section_class : 'section'
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -25,13 +36,32 @@ M.course.format.get_section_selector = function(Y) {
|
||||
M.course.format.swap_sections = function(Y, node1, node2) {
|
||||
var CSS = {
|
||||
COURSECONTENT : 'course-content',
|
||||
LEFT : 'left',
|
||||
SECTIONADDMENUS : 'section_add_menus'
|
||||
};
|
||||
|
||||
var sectionlist = Y.Node.all('.'+CSS.COURSECONTENT+' '+M.course.format.get_section_selector(Y));
|
||||
// Swap left block
|
||||
sectionlist.item(node1).one('.'+CSS.LEFT).swap(sectionlist.item(node2).one('.'+CSS.LEFT));
|
||||
// Swap menus
|
||||
sectionlist.item(node1).one('.'+CSS.SECTIONADDMENUS).swap(sectionlist.item(node2).one('.'+CSS.SECTIONADDMENUS));
|
||||
}
|
||||
|
||||
/**
|
||||
* Process sections after ajax response
|
||||
*
|
||||
* @param {YUI} Y YUI3 instance
|
||||
* @param {array} response ajax response
|
||||
* @param {string} sectionfrom first affected section
|
||||
* @param {string} sectionto last affected section
|
||||
* @return void
|
||||
*/
|
||||
M.course.format.process_sections = function(Y, sectionlist, response, sectionfrom, sectionto) {
|
||||
var CSS = {
|
||||
SECTIONNAME : 'sectionname'
|
||||
};
|
||||
|
||||
if (response.action == 'move') {
|
||||
// update titles in all affected sections
|
||||
for (var i = sectionfrom; i <= sectionto; i++) {
|
||||
sectionlist.item(i).one('.'+CSS.SECTIONNAME).setContent(response.sectiontitles[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -80,3 +80,24 @@ function callback_topics_ajax_support() {
|
||||
$ajaxsupport->testedbrowsers = array('MSIE' => 6.0, 'Gecko' => 20061111, 'Safari' => 531, 'Chrome' => 6.0);
|
||||
return $ajaxsupport;
|
||||
}
|
||||
|
||||
/**
|
||||
* Callback function to do some action after section move
|
||||
*
|
||||
* @param stdClass $course The course entry from DB
|
||||
* @return array This will be passed in ajax respose.
|
||||
*/
|
||||
function callback_topics_ajax_section_move($course) {
|
||||
global $COURSE, $PAGE;
|
||||
|
||||
$titles = array();
|
||||
rebuild_course_cache($course->id);
|
||||
$modinfo = get_fast_modinfo($COURSE);
|
||||
$renderer = $PAGE->get_renderer('format_topics');
|
||||
if ($renderer && ($sections = $modinfo->get_section_info_all())) {
|
||||
foreach ($sections as $number => $section) {
|
||||
$titles[$number] = $renderer->section_title($section, $course);
|
||||
}
|
||||
}
|
||||
return array('sectiontitles' => $titles, 'action' => 'move');
|
||||
}
|
||||
|
||||
@@ -102,23 +102,4 @@ class format_topics_renderer extends format_section_renderer_base {
|
||||
|
||||
return array_merge($controls, parent::section_edit_controls($course, $section, $onsectionpage));
|
||||
}
|
||||
|
||||
/**
|
||||
* Generate the content to displayed on the left part of a section
|
||||
*
|
||||
* before course modules are included
|
||||
* @param stdClass $section The course_section entry from DB
|
||||
* @param stdClass $course The course entry from DB
|
||||
* @param bool $onsectionpage true if being printed on a section page
|
||||
* @return string HTML to output.
|
||||
*/
|
||||
protected function section_left_content($section, $course, $onsectionpage) {
|
||||
$o = parent::section_left_content($section, $course, $onsectionpage);
|
||||
|
||||
if ($section->section > 0) {
|
||||
$o.= $section->section;
|
||||
}
|
||||
|
||||
return $o;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,17 +1,28 @@
|
||||
// Javascript functions for course format
|
||||
// Javascript functions for Weeks course format
|
||||
|
||||
M.course = M.course || {};
|
||||
|
||||
M.course.format = M.course.format || {};
|
||||
|
||||
/**
|
||||
* Get section list for this format
|
||||
* Get sections config for this format
|
||||
*
|
||||
* @param {YUI} Y YUI3 instance
|
||||
* @return {string} section list selector
|
||||
* The section structure is:
|
||||
* <ul class="weeks">
|
||||
* <li class="section">...</li>
|
||||
* <li class="section">...</li>
|
||||
* ...
|
||||
* </ul>
|
||||
*
|
||||
* @return {object} section list configuration
|
||||
*/
|
||||
M.course.format.get_section_selector = function(Y) {
|
||||
return 'li.section';
|
||||
M.course.format.get_config = function() {
|
||||
return {
|
||||
container_node : 'ul',
|
||||
container_class : 'weeks',
|
||||
section_node : 'li',
|
||||
section_class : 'section'
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -25,16 +36,32 @@ M.course.format.get_section_selector = function(Y) {
|
||||
M.course.format.swap_sections = function(Y, node1, node2) {
|
||||
var CSS = {
|
||||
COURSECONTENT : 'course-content',
|
||||
LEFT : 'left',
|
||||
SECTIONADDMENUS : 'section_add_menus',
|
||||
WEEKDATES: 'weekdates'
|
||||
};
|
||||
|
||||
var sectionlist = Y.Node.all('.'+CSS.COURSECONTENT+' '+M.course.format.get_section_selector(Y));
|
||||
// Swap left block
|
||||
sectionlist.item(node1).one('.'+CSS.LEFT).swap(sectionlist.item(node2).one('.'+CSS.LEFT));
|
||||
// Swap menus
|
||||
sectionlist.item(node1).one('.'+CSS.SECTIONADDMENUS).swap(sectionlist.item(node2).one('.'+CSS.SECTIONADDMENUS));
|
||||
// Swap week dates
|
||||
sectionlist.item(node1).one('.'+CSS.WEEKDATES).swap(sectionlist.item(node2).one('.'+CSS.WEEKDATES));
|
||||
}
|
||||
|
||||
/**
|
||||
* Process sections after ajax response
|
||||
*
|
||||
* @param {YUI} Y YUI3 instance
|
||||
* @param {array} response ajax response
|
||||
* @param {string} sectionfrom first affected section
|
||||
* @param {string} sectionto last affected section
|
||||
* @return void
|
||||
*/
|
||||
M.course.format.process_sections = function(Y, sectionlist, response, sectionfrom, sectionto) {
|
||||
var CSS = {
|
||||
SECTIONNAME : 'sectionname'
|
||||
};
|
||||
|
||||
if (response.action == 'move') {
|
||||
// update titles in all affected sections
|
||||
for (var i = sectionfrom; i <= sectionto; i++) {
|
||||
sectionlist.item(i).one('.'+CSS.SECTIONNAME).setContent(response.sectiontitles[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+52
-16
@@ -67,25 +67,20 @@ function callback_weeks_definition() {
|
||||
function callback_weeks_get_section_name($course, $section) {
|
||||
// We can't add a node without text
|
||||
if (!empty($section->name)) {
|
||||
// Return the name the user set
|
||||
return format_string($section->name, true, array('context' => get_context_instance(CONTEXT_COURSE, $course->id)));
|
||||
// Return the name the user set.
|
||||
return format_string($section->name, true, array('context' => context_course::instance($course->id)));
|
||||
} else if ($section->section == 0) {
|
||||
// Return the section0name
|
||||
// Return the general section.
|
||||
return get_string('section0name', 'format_weeks');
|
||||
} else {
|
||||
// Got to work out the date of the week so that we can show it
|
||||
$sections = get_all_sections($course->id);
|
||||
$weekdate = $course->startdate+7200;
|
||||
foreach ($sections as $sec) {
|
||||
if ($sec->id == $section->id) {
|
||||
break;
|
||||
} else if ($sec->section != 0) {
|
||||
$weekdate += 604800;
|
||||
}
|
||||
}
|
||||
$strftimedateshort = ' '.get_string('strftimedateshort');
|
||||
$weekday = userdate($weekdate, $strftimedateshort);
|
||||
$endweekday = userdate($weekdate+518400, $strftimedateshort);
|
||||
$dates = format_weeks_get_section_dates($section, $course);
|
||||
|
||||
// We subtract 24 hours for display purposes.
|
||||
$dates->end = ($dates->end - 86400);
|
||||
|
||||
$dateformat = ' '.get_string('strftimedateshort');
|
||||
$weekday = userdate($dates->start, $dateformat);
|
||||
$endweekday = userdate($dates->end, $dateformat);
|
||||
return $weekday.' - '.$endweekday;
|
||||
}
|
||||
}
|
||||
@@ -102,3 +97,44 @@ function callback_weeks_ajax_support() {
|
||||
$ajaxsupport->testedbrowsers = array('MSIE' => 6.0, 'Gecko' => 20061111, 'Safari' => 531, 'Chrome' => 6.0);
|
||||
return $ajaxsupport;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the start and end date of the passed section
|
||||
*
|
||||
* @param stdClass $section The course_section entry from the DB
|
||||
* @param stdClass $course The course entry from DB
|
||||
* @return stdClass property start for startdate, property end for enddate
|
||||
*/
|
||||
function format_weeks_get_section_dates($section, $course) {
|
||||
$oneweekseconds = 604800;
|
||||
// Hack alert. We add 2 hours to avoid possible DST problems. (e.g. we go into daylight
|
||||
// savings and the date changes.
|
||||
$startdate = $course->startdate + 7200;
|
||||
|
||||
$dates = new stdClass();
|
||||
$dates->start = $startdate + ($oneweekseconds * ($section->section - 1));
|
||||
$dates->end = $dates->start + $oneweekseconds;
|
||||
|
||||
return $dates;
|
||||
}
|
||||
|
||||
/**
|
||||
* Callback function to do some action after section move
|
||||
*
|
||||
* @param stdClass $course The course entry from DB
|
||||
* @return array This will be passed in ajax respose.
|
||||
*/
|
||||
function callback_weeks_ajax_section_move($course) {
|
||||
global $COURSE, $PAGE;
|
||||
|
||||
$titles = array();
|
||||
rebuild_course_cache($course->id);
|
||||
$modinfo = get_fast_modinfo($COURSE);
|
||||
$renderer = $PAGE->get_renderer('format_weeks');
|
||||
if ($renderer && ($sections = $modinfo->get_section_info_all())) {
|
||||
foreach ($sections as $number => $section) {
|
||||
$titles[$number] = $renderer->section_title($section, $course);
|
||||
}
|
||||
}
|
||||
return array('sectiontitles' => $titles, 'action' => 'move');
|
||||
}
|
||||
|
||||
@@ -26,6 +26,7 @@
|
||||
|
||||
defined('MOODLE_INTERNAL') || die();
|
||||
require_once($CFG->dirroot.'/course/format/renderer.php');
|
||||
require_once($CFG->dirroot.'/course/format/weeks/lib.php');
|
||||
|
||||
|
||||
/**
|
||||
@@ -58,4 +59,22 @@ class format_weeks_renderer extends format_section_renderer_base {
|
||||
protected function page_title() {
|
||||
return get_string('weeklyoutline');
|
||||
}
|
||||
|
||||
/**
|
||||
* Is the section passed in the current section?
|
||||
*
|
||||
* @param stdClass $section The course_section entry from the DB
|
||||
* @param stdClass $course The course entry from DB
|
||||
* @return bool true if the section is current
|
||||
*/
|
||||
protected function is_section_current($section, $course) {
|
||||
if ($section->section < 1) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$timenow = time();
|
||||
$dates = format_weeks_get_section_dates($section, $course);
|
||||
|
||||
return (($timenow >= $dates->start) && ($timenow < $dates->end));
|
||||
}
|
||||
}
|
||||
|
||||
+3
-8
@@ -1518,13 +1518,6 @@ function print_section($course, $section, $mods, $modnamesused, $absolute=false,
|
||||
//Accessibility: for files get description via icon, this is very ugly hack!
|
||||
$altname = '';
|
||||
$altname = $mod->modfullname;
|
||||
if (!empty($customicon)) {
|
||||
$archetype = plugin_supports('mod', $mod->modname, FEATURE_MOD_ARCHETYPE, MOD_ARCHETYPE_OTHER);
|
||||
if ($archetype == MOD_ARCHETYPE_RESOURCE) {
|
||||
$mimetype = mimeinfo_from_icon('type', $customicon);
|
||||
$altname = get_mimetype_description($mimetype);
|
||||
}
|
||||
}
|
||||
// Avoid unnecessary duplication: if e.g. a forum name already
|
||||
// includes the word forum (or Forum, etc) then it is unhelpful
|
||||
// to include that in the accessible description that is added.
|
||||
@@ -1735,7 +1728,7 @@ function print_section($course, $section, $mods, $modnamesused, $absolute=false,
|
||||
// see the activity itself, or for staff)
|
||||
if (!$mod->uservisible) {
|
||||
echo '<div class="availabilityinfo">'.$mod->availableinfo.'</div>';
|
||||
} else if ($canviewhidden && !empty($CFG->enableavailability)) {
|
||||
} else if ($canviewhidden && !empty($CFG->enableavailability) && $mod->visible) {
|
||||
$ci = new condition_info($mod);
|
||||
$fullinfo = $ci->get_full_information();
|
||||
if($fullinfo) {
|
||||
@@ -3002,6 +2995,8 @@ function move_section($course, $section, $move) {
|
||||
}
|
||||
$n++;
|
||||
}
|
||||
// After moving section, rebuild course cache.
|
||||
rebuild_course_cache($course->id, true);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
+10
-7
@@ -221,7 +221,9 @@ if (!empty($activities)) {
|
||||
echo $OUTPUT->spacer(array('height'=>30, 'br'=>true)); // should be done with CSS instead
|
||||
}
|
||||
echo $OUTPUT->box_start();
|
||||
echo "<h2>$activity->name</h2>";
|
||||
if (!empty($activity->name)) {
|
||||
echo html_writer::tag('h2', $activity->name);
|
||||
}
|
||||
$inbox = true;
|
||||
|
||||
} else if ($activity->type == 'activity') {
|
||||
@@ -230,16 +232,17 @@ if (!empty($activities)) {
|
||||
$cm = $modinfo->cms[$activity->cmid];
|
||||
|
||||
if ($cm->visible) {
|
||||
$linkformat = '';
|
||||
$class = '';
|
||||
} else {
|
||||
$linkformat = 'class="dimmed"';
|
||||
$class = 'dimmed';
|
||||
}
|
||||
$name = format_string($cm->name);
|
||||
$modfullname = $modnames[$cm->modname];
|
||||
|
||||
$image = "<img src=\"" . $OUTPUT->pix_url('icon', $cm->modname) . "\" class=\"icon\" alt=\"$modfullname\" />";
|
||||
echo "<h3>$image $modfullname".
|
||||
" <a href=\"$CFG->wwwroot/mod/$cm->modname/view.php?id=$cm->id\" $linkformat>$name</a></h3>";
|
||||
$image = $OUTPUT->pix_icon('icon', $modfullname, $cm->modname, array('class' => 'icon smallicon'));
|
||||
$link = html_writer::link(new moodle_url("/mod/$cm->modname/view.php",
|
||||
array("id" => $cm->id)), $name, array('class' => $class));
|
||||
echo html_writer::tag('h3', "$image $modfullname $link");
|
||||
}
|
||||
|
||||
} else {
|
||||
@@ -269,7 +272,7 @@ if (!empty($activities)) {
|
||||
|
||||
} else {
|
||||
|
||||
echo '<h3><center>' . get_string('norecentactivity') . '</center></h3>';
|
||||
echo html_writer::tag('h3', get_string('norecentactivity'), array('class' => 'mdl-align'));
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -89,6 +89,15 @@ switch($requestmethod) {
|
||||
|
||||
case 'move':
|
||||
move_section_to($course, $id, $value);
|
||||
// See if format wants to do something about it
|
||||
$libfile = $CFG->dirroot.'/course/format/'.$course->format.'/lib.php';
|
||||
$functionname = 'callback_'.$course->format.'_ajax_section_move';
|
||||
if (!function_exists($functionname) && file_exists($libfile)) {
|
||||
require_once $libfile;
|
||||
}
|
||||
if (function_exists($functionname)) {
|
||||
echo json_encode($functionname($course));
|
||||
}
|
||||
break;
|
||||
}
|
||||
rebuild_course_cache($course->id);
|
||||
|
||||
+12
-2
@@ -88,8 +88,18 @@
|
||||
|
||||
require_once($CFG->dirroot.'/calendar/lib.php'); /// This is after login because it needs $USER
|
||||
|
||||
//TODO: danp do we need different urls?
|
||||
add_to_log($course->id, 'course', 'view', "view.php?id=$course->id", "$course->id");
|
||||
$logparam = 'id='. $course->id;
|
||||
$loglabel = 'view';
|
||||
$infoid = $course->id;
|
||||
if(!empty($section)) {
|
||||
$logparam .= '§ion='. $section;
|
||||
$loglabel = 'view section';
|
||||
$sectionparams = array('course' => $course->id, 'section' => $section);
|
||||
if ($coursesections = $DB->get_record('course_sections', $sectionparams, 'id', MUST_EXIST)) {
|
||||
$infoid = $coursesections->id;
|
||||
}
|
||||
}
|
||||
add_to_log($course->id, 'course', $loglabel, "view.php?". $logparam, $infoid);
|
||||
|
||||
$course->format = clean_param($course->format, PARAM_ALPHA);
|
||||
if (!file_exists($CFG->dirroot.'/course/format/'.$course->format.'/format.php')) {
|
||||
|
||||
Vendored
+165
@@ -52,6 +52,171 @@ YUI.add('moodle-course-coursebase', function(Y) {
|
||||
// Ensure that M.course exists and that coursebase is initialised correctly
|
||||
M.course = M.course || {};
|
||||
M.course.coursebase = M.course.coursebase || new COURSEBASE();
|
||||
|
||||
// Abstract functions that needs to be defined per format (course/format/somename/format.js)
|
||||
M.course.format = M.course.format || {}
|
||||
|
||||
/**
|
||||
* Swap section (should be defined in format.js if requred)
|
||||
*
|
||||
* @param {YUI} Y YUI3 instance
|
||||
* @param {string} node1 node to swap to
|
||||
* @param {string} node2 node to swap with
|
||||
* @return {NodeList} section list
|
||||
*/
|
||||
M.course.format.swap_sections = M.course.format.swap_sections || function(Y, node1, node2) {
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Process sections after ajax response (should be defined in format.js)
|
||||
* If some response is expected, we pass it over to format, as it knows better
|
||||
* hot to process it.
|
||||
*
|
||||
* @param {YUI} Y YUI3 instance
|
||||
* @param {NodeList} list of sections
|
||||
* @param {array} response ajax response
|
||||
* @param {string} sectionfrom first affected section
|
||||
* @param {string} sectionto last affected section
|
||||
* @return void
|
||||
*/
|
||||
M.course.format.process_sections = M.course.format.process_sections || function(Y, sectionlist, response, sectionfrom, sectionto) {
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get sections config for this format, for examples see function definition
|
||||
* in the formats.
|
||||
*
|
||||
* @return {object} section list configuration
|
||||
*/
|
||||
M.course.format.get_config = M.course.format.get_config || function() {
|
||||
return {
|
||||
container_node : null, // compulsory
|
||||
container_class : null, // compulsory
|
||||
section_wrapper_node : null, // optional
|
||||
section_wrapper_class : null, // optional
|
||||
section_node : null, // compulsory
|
||||
section_class : null // compulsory
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get section list for this format (usually items inside container_node.container_class selector)
|
||||
*
|
||||
* @param {YUI} Y YUI3 instance
|
||||
* @return {string} section selector
|
||||
*/
|
||||
M.course.format.get_section_selector = M.course.format.get_section_selector || function(Y) {
|
||||
var config = M.course.format.get_config();
|
||||
if (config.section_node && config.section_class) {
|
||||
return config.section_node + '.' + config.section_class;
|
||||
}
|
||||
console.log('section_node and section_class are not defined in M.course.format.get_config');
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get section wraper for this format (only used in case when each
|
||||
* container_node.container_class node is wrapped in some other element).
|
||||
*
|
||||
* @param {YUI} Y YUI3 instance
|
||||
* @return {string} section wrapper selector or M.course.format.get_section_selector
|
||||
* if section_wrapper_node and section_wrapper_class are not defined in the format config.
|
||||
*/
|
||||
M.course.format.get_section_wrapper = M.course.format.get_section_wrapper || function(Y) {
|
||||
var config = M.course.format.get_config();
|
||||
if (config.section_wrapper_node && config.section_wrapper_class) {
|
||||
return config.section_wrapper_node + '.' + config.section_wrapper_class;
|
||||
}
|
||||
return M.course.format.get_section_selector(Y);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the tag of container node
|
||||
*
|
||||
* @return {string} tag of container node.
|
||||
*/
|
||||
M.course.format.get_containernode = M.course.format.get_containernode || function() {
|
||||
var config = M.course.format.get_config();
|
||||
if (config.container_node) {
|
||||
return config.container_node;
|
||||
} else {
|
||||
console.log('container_node is not defined in M.course.format.get_config');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the class of container node
|
||||
*
|
||||
* @return {string} class of the container node.
|
||||
*/
|
||||
M.course.format.get_containerclass = M.course.format.get_containerclass || function() {
|
||||
var config = M.course.format.get_config();
|
||||
if (config.container_class) {
|
||||
return config.container_class;
|
||||
} else {
|
||||
console.log('container_class is not defined in M.course.format.get_config');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the tag of draggable node (section wrapper if exists, otherwise section)
|
||||
*
|
||||
* @return {string} tag of the draggable node.
|
||||
*/
|
||||
M.course.format.get_sectionwrappernode = M.course.format.get_sectionwrappernode || function() {
|
||||
var config = M.course.format.get_config();
|
||||
if (config.section_wrapper_node) {
|
||||
return config.section_wrapper_node;
|
||||
} else {
|
||||
return config.section_node;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the class of draggable node (section wrapper if exists, otherwise section)
|
||||
*
|
||||
* @return {string} class of the draggable node.
|
||||
*/
|
||||
M.course.format.get_sectionwrapperclass = M.course.format.get_sectionwrapperclass || function() {
|
||||
var config = M.course.format.get_config();
|
||||
if (config.section_wrapper_class) {
|
||||
return config.section_wrapper_class;
|
||||
} else {
|
||||
return config.section_class;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the tag of section node
|
||||
*
|
||||
* @return {string} tag of section node.
|
||||
*/
|
||||
M.course.format.get_sectionnode = M.course.format.get_sectionnode || function() {
|
||||
var config = M.course.format.get_config();
|
||||
if (config.section_node) {
|
||||
return config.section_node;
|
||||
} else {
|
||||
console.log('section_node is not defined in M.course.format.get_config');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the class of section node
|
||||
*
|
||||
* @return {string} class of the section node.
|
||||
*/
|
||||
M.course.format.get_sectionclass = M.course.format.get_sectionclass || function() {
|
||||
var config = M.course.format.get_config();
|
||||
if (config.section_class) {
|
||||
return config.section_class;
|
||||
} else {
|
||||
console.log('section_class is not defined in M.course.format.get_config');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
},
|
||||
'@VERSION@', {
|
||||
requires : ['base', 'node']
|
||||
|
||||
Vendored
+50
-28
@@ -17,9 +17,7 @@ YUI.add('moodle-course-dragdrop', function(Y) {
|
||||
SECTION : 'section',
|
||||
SECTIONADDMENUS : 'section_add_menus',
|
||||
SECTIONHANDLE : 'section-handle',
|
||||
SUMMARY : 'summary',
|
||||
TOPICS : 'topics',
|
||||
WEEKDATES: 'weekdates'
|
||||
SUMMARY : 'summary'
|
||||
};
|
||||
|
||||
var DRAGSECTION = function() {
|
||||
@@ -31,16 +29,17 @@ YUI.add('moodle-course-dragdrop', function(Y) {
|
||||
initializer : function(params) {
|
||||
// Set group for parent class
|
||||
this.groups = ['section'];
|
||||
this.samenodeclass = CSS.SECTION;
|
||||
this.parentnodeclass = CSS.TOPICS;
|
||||
this.samenodeclass = M.course.format.get_sectionwrapperclass();
|
||||
this.parentnodeclass = M.course.format.get_containerclass();
|
||||
|
||||
// Check if we are in single section mode
|
||||
if (Y.Node.one('.'+CSS.JUMPMENU)) {
|
||||
return false;
|
||||
}
|
||||
// Initialise sections dragging
|
||||
if (M.course.format && M.course.format.get_section_selector && typeof(M.course.format.get_section_selector) == 'function') {
|
||||
this.sectionlistselector = '.'+CSS.COURSECONTENT+' '+M.course.format.get_section_selector(Y);
|
||||
this.sectionlistselector = M.course.format.get_section_wrapper(Y);
|
||||
if (this.sectionlistselector) {
|
||||
this.sectionlistselector = '.'+CSS.COURSECONTENT+' '+this.sectionlistselector;
|
||||
this.setup_for_section(this.sectionlistselector);
|
||||
}
|
||||
},
|
||||
@@ -109,17 +108,24 @@ YUI.add('moodle-course-dragdrop', function(Y) {
|
||||
// Get our drag object
|
||||
var drag = e.target;
|
||||
// Creat a dummy structure of the outer elemnents for clean styles application
|
||||
var ul = Y.Node.create('<ul></ul>');
|
||||
ul.addClass(CSS.TOPICS);
|
||||
var li = Y.Node.create('<li></li>');
|
||||
li.addClass(CSS.SECTION);
|
||||
li.setStyle('margin', 0);
|
||||
li.setContent(drag.get('node').get('innerHTML'));
|
||||
ul.appendChild(li);
|
||||
drag.get('dragNode').setContent(ul);
|
||||
var containernode = Y.Node.create('<'+M.course.format.get_containernode()+'></'+M.course.format.get_containernode()+'>');
|
||||
containernode.addClass(M.course.format.get_containerclass());
|
||||
var sectionnode = Y.Node.create('<'+ M.course.format.get_sectionwrappernode()+'></'+ M.course.format.get_sectionwrappernode()+'>');
|
||||
sectionnode.addClass( M.course.format.get_sectionwrapperclass());
|
||||
sectionnode.setStyle('margin', 0);
|
||||
sectionnode.setContent(drag.get('node').get('innerHTML'));
|
||||
containernode.appendChild(sectionnode);
|
||||
drag.get('dragNode').setContent(containernode);
|
||||
drag.get('dragNode').addClass(CSS.COURSECONTENT);
|
||||
},
|
||||
|
||||
drag_dropmiss : function(e) {
|
||||
// Missed the target, but we assume the user intended to drop it
|
||||
// on the last last ghost node location, e.drag and e.drop should be
|
||||
// prepared by global_drag_dropmiss parent so simulate drop_hit(e).
|
||||
this.drop_hit(e);
|
||||
},
|
||||
|
||||
drop_hit : function(e) {
|
||||
var drag = e.drag;
|
||||
// Get a reference to our drag node
|
||||
@@ -173,9 +179,16 @@ YUI.add('moodle-course-dragdrop', function(Y) {
|
||||
lightbox.show();
|
||||
},
|
||||
success: function(tid, response) {
|
||||
window.setTimeout(function(e) {
|
||||
lightbox.hide();
|
||||
}, 250);
|
||||
// Update section titles, we can't simply swap them as
|
||||
// they might have custom title
|
||||
try {
|
||||
var responsetext = Y.JSON.parse(response.responseText);
|
||||
if (responsetext.error) {
|
||||
new M.core.ajaxException(responsetext);
|
||||
}
|
||||
M.course.format.process_sections(Y, sectionlist, responsetext, loopstart, loopend);
|
||||
} catch (e) {}
|
||||
|
||||
// Classic bubble sort algorithm is applied to the section
|
||||
// nodes between original drag node location and the new one.
|
||||
do {
|
||||
@@ -186,16 +199,19 @@ YUI.add('moodle-course-dragdrop', function(Y) {
|
||||
var sectionid = sectionlist.item(i-1).get('id');
|
||||
sectionlist.item(i-1).set('id', sectionlist.item(i).get('id'));
|
||||
sectionlist.item(i).set('id', sectionid);
|
||||
// See what format needs to be swapped
|
||||
if (M.course.format && M.course.format.swap_sections && typeof(M.course.format.swap_sections) == 'function') {
|
||||
M.course.format.swap_sections(Y, i-1, i);
|
||||
}
|
||||
// See what format needs to swap
|
||||
M.course.format.swap_sections(Y, i-1, i);
|
||||
// Update flag
|
||||
swapped = true;
|
||||
}
|
||||
}
|
||||
loopend = loopend - 1;
|
||||
} while (swapped);
|
||||
|
||||
// Finally, hide the lightbox
|
||||
window.setTimeout(function(e) {
|
||||
lightbox.hide();
|
||||
}, 250);
|
||||
},
|
||||
failure: function(tid, response) {
|
||||
this.ajax_failure(response);
|
||||
@@ -232,8 +248,9 @@ YUI.add('moodle-course-dragdrop', function(Y) {
|
||||
this.parentnodeclass = CSS.SECTION;
|
||||
|
||||
// Go through all sections
|
||||
if (M.course.format && M.course.format.get_section_selector && typeof(M.course.format.get_section_selector) == 'function') {
|
||||
var sectionlistselector = '.'+CSS.COURSECONTENT+' '+M.course.format.get_section_selector(Y);
|
||||
var sectionlistselector = M.course.format.get_section_selector(Y);
|
||||
if (sectionlistselector) {
|
||||
sectionlistselector = '.'+CSS.COURSECONTENT+' '+sectionlistselector;
|
||||
this.setup_for_section(sectionlistselector);
|
||||
M.course.coursebase.register_module(this);
|
||||
M.course.dragres = this;
|
||||
@@ -263,7 +280,7 @@ YUI.add('moodle-course-dragdrop', function(Y) {
|
||||
padding: '20 0 20 0'
|
||||
});
|
||||
// Go through each li element and make them draggable
|
||||
this.setup_for_resource('li#'+sectionnode.get('id')+' li.'+CSS.ACTIVITY);
|
||||
this.setup_for_resource('#'+sectionnode.get('id')+' li.'+CSS.ACTIVITY);
|
||||
}, this);
|
||||
},
|
||||
/**
|
||||
@@ -311,14 +328,19 @@ YUI.add('moodle-course-dragdrop', function(Y) {
|
||||
drag.get('dragNode').all('img.iconsmall').setStyle('vertical-align', 'baseline');
|
||||
},
|
||||
|
||||
drag_dropmiss : function(e) {
|
||||
// Missed the target, but we assume the user intended to drop it
|
||||
// on the last last ghost node location, e.drag and e.drop should be
|
||||
// prepared by global_drag_dropmiss parent so simulate drop_hit(e).
|
||||
this.drop_hit(e);
|
||||
},
|
||||
|
||||
drop_hit : function(e) {
|
||||
var drag = e.drag;
|
||||
// Get a reference to our drag node
|
||||
var dragnode = drag.get('node');
|
||||
var dropnode = e.drop.get('node');
|
||||
|
||||
var sectionselector = M.course.format.get_section_selector(Y);
|
||||
|
||||
// Add spinner if it not there
|
||||
var spinner = M.util.add_spinner(Y, dragnode.one(CSS.COMMANDSPAN));
|
||||
|
||||
@@ -336,7 +358,7 @@ YUI.add('moodle-course-dragdrop', function(Y) {
|
||||
params['class'] = 'resource';
|
||||
params.field = 'move';
|
||||
params.id = Number(this.get_resource_id(dragnode));
|
||||
params.sectionId = this.get_section_id(dropnode.ancestor(sectionselector));
|
||||
params.sectionId = this.get_section_id(dropnode.ancestor(M.course.format.get_section_wrapper(Y), true));
|
||||
|
||||
if (dragnode.next()) {
|
||||
params.beforeId = Number(this.get_resource_id(dragnode.next()));
|
||||
|
||||
Vendored
+11
-11
@@ -28,7 +28,7 @@ YUI.add('moodle-course-toolboxes', function(Y) {
|
||||
MOVELEFTCLASS : 'editing_moveleft',
|
||||
MOVERIGHT : 'a.editing_moveright',
|
||||
PAGECONTENT : 'div#page-content',
|
||||
RIGHTDIV : 'div.right',
|
||||
RIGHTSIDE : '.right',
|
||||
SECTIONHIDDENCLASS : 'hidden',
|
||||
SECTIONIDPREFIX : 'section-',
|
||||
SECTIONLI : 'li.section',
|
||||
@@ -384,7 +384,7 @@ YUI.add('moodle-course-toolboxes', function(Y) {
|
||||
e.preventDefault();
|
||||
|
||||
// Return early if the current section is hidden
|
||||
var section = e.target.ancestor(CSS.SECTIONLI);
|
||||
var section = e.target.ancestor(M.course.format.get_section_selector(Y));
|
||||
if (section && section.hasClass(CSS.SECTIONHIDDENCLASS)) {
|
||||
return;
|
||||
}
|
||||
@@ -649,17 +649,17 @@ YUI.add('moodle-course-toolboxes', function(Y) {
|
||||
},
|
||||
_setup_for_section : function(toolboxtarget) {
|
||||
// Section Highlighting
|
||||
this.replace_button(toolboxtarget, CSS.RIGHTDIV + ' ' + CSS.HIGHLIGHT, this.toggle_highlight);
|
||||
this.replace_button(toolboxtarget, CSS.RIGHTSIDE + ' ' + CSS.HIGHLIGHT, this.toggle_highlight);
|
||||
|
||||
// Section Visibility
|
||||
this.replace_button(toolboxtarget, CSS.RIGHTDIV + ' ' + CSS.SHOWHIDE, this.toggle_hide_section);
|
||||
this.replace_button(toolboxtarget, CSS.RIGHTSIDE + ' ' + CSS.SHOWHIDE, this.toggle_hide_section);
|
||||
},
|
||||
toggle_hide_section : function(e) {
|
||||
// Prevent the default button action
|
||||
e.preventDefault();
|
||||
|
||||
// Get the section we're working on
|
||||
var section = e.target.ancestor(CSS.SECTIONLI);
|
||||
var section = e.target.ancestor(M.course.format.get_section_selector(Y));
|
||||
var button = e.target.ancestor('a', true);
|
||||
var hideicon = button.one('img');
|
||||
|
||||
@@ -691,7 +691,7 @@ YUI.add('moodle-course-toolboxes', function(Y) {
|
||||
var data = {
|
||||
'class' : 'section',
|
||||
'field' : 'visible',
|
||||
'id' : this.get_section_id(section),
|
||||
'id' : this.get_section_id(section.ancestor(M.course.format.get_section_wrapper(Y), true)),
|
||||
'value' : value
|
||||
};
|
||||
|
||||
@@ -725,7 +725,7 @@ YUI.add('moodle-course-toolboxes', function(Y) {
|
||||
e.preventDefault();
|
||||
|
||||
// Get the section we're working on
|
||||
var section = e.target.ancestor(CSS.SECTIONLI);
|
||||
var section = e.target.ancestor(M.course.format.get_section_selector(Y));
|
||||
var button = e.target.ancestor('a', true);
|
||||
var buttonicon = button.one('img');
|
||||
|
||||
@@ -736,22 +736,22 @@ YUI.add('moodle-course-toolboxes', function(Y) {
|
||||
// Set the current highlighted item text
|
||||
var old_string = M.util.get_string('markthistopic', 'moodle');
|
||||
Y.one(CSS.PAGECONTENT)
|
||||
.all(CSS.SECTIONLI + '.current ' + CSS.HIGHLIGHT)
|
||||
.all(M.course.format.get_section_selector(Y) + '.current ' + CSS.HIGHLIGHT)
|
||||
.set('title', old_string);
|
||||
Y.one(CSS.PAGECONTENT)
|
||||
.all(CSS.SECTIONLI + '.current ' + CSS.HIGHLIGHT + ' img')
|
||||
.all(M.course.format.get_section_selector(Y) + '.current ' + CSS.HIGHLIGHT + ' img')
|
||||
.set('title', old_string)
|
||||
.set('alt', old_string)
|
||||
.set('src', M.util.image_url('i/marker'));
|
||||
|
||||
// Remove the highlighting from all sections
|
||||
var allsections = Y.one(CSS.PAGECONTENT).all(CSS.SECTIONLI)
|
||||
var allsections = Y.one(CSS.PAGECONTENT).all(M.course.format.get_section_selector(Y))
|
||||
.removeClass('current');
|
||||
|
||||
// Then add it if required to the selected section
|
||||
if (!togglestatus) {
|
||||
section.addClass('current');
|
||||
value = this.get_section_id(section);
|
||||
value = this.get_section_id(section.ancestor(M.course.format.get_section_wrapper(Y), true));
|
||||
var new_string = M.util.get_string('markedthistopic', 'moodle');
|
||||
button
|
||||
.set('title', new_string);
|
||||
|
||||
+2
-1
@@ -36,6 +36,7 @@ if (isguestuser()) {
|
||||
}
|
||||
|
||||
$relativepath = get_file_argument();
|
||||
$preview = optional_param('preview', null, PARAM_ALPHANUM);
|
||||
|
||||
// relative path must start with '/'
|
||||
if (!$relativepath) {
|
||||
@@ -84,4 +85,4 @@ if (!$file = $fs->get_file_by_hash(sha1($fullpath)) or $file->get_filename() ==
|
||||
// finally send the file
|
||||
// ========================================
|
||||
session_get_instance()->write_close(); // unlock session during fileserving
|
||||
send_stored_file($file, 0, false, true); // force download - security first!
|
||||
send_stored_file($file, 0, false, true, array('preview' => $preview)); // force download - security first!
|
||||
|
||||
@@ -207,7 +207,7 @@ class core_enrol_external extends external_api {
|
||||
$exceptionparam = new stdClass();
|
||||
$exceptionparam->message = $e->getMessage();
|
||||
$exceptionparam->courseid = $params['courseid'];
|
||||
throw new moodle_exception(get_string('errorcoursecontextnotvalid' , 'webservice', $exceptionparam));
|
||||
throw new moodle_exception('errorcoursecontextnotvalid' , 'webservice', '', $exceptionparam);
|
||||
}
|
||||
|
||||
if ($courseid == SITEID) {
|
||||
@@ -543,7 +543,7 @@ class moodle_enrol_external extends external_api {
|
||||
$exceptionparam = new stdClass();
|
||||
$exceptionparam->message = $e->getMessage();
|
||||
$exceptionparam->courseid = $params['courseid'];
|
||||
throw new moodle_exception(get_string('errorcoursecontextnotvalid' , 'webservice', $exceptionparam));
|
||||
throw new moodle_exception('errorcoursecontextnotvalid' , 'webservice', '', $exceptionparam);
|
||||
}
|
||||
|
||||
if ($courseid == SITEID) {
|
||||
|
||||
@@ -145,6 +145,7 @@ class enrol_mnet_mnetservice_enrol {
|
||||
// users {@link http://tracker.moodle.org/browse/MDL-21327}
|
||||
$user = mnet_strip_user((object)$userdata, mnet_fields_to_import($client));
|
||||
$user->mnethostid = $client->id;
|
||||
$user->auth = 'mnet';
|
||||
try {
|
||||
$user->id = $DB->insert_record('user', $user);
|
||||
} catch (Exception $e) {
|
||||
|
||||
@@ -21,7 +21,7 @@ class coursefiles_edit_form extends moodleform {
|
||||
function definition() {
|
||||
$mform =& $this->_form;
|
||||
$contextid = $this->_customdata['contextid'];
|
||||
$options = array('subdirs'=>1, 'maxfiles'=>-1, 'accepted_types'=>'*', 'return_types'=>FILE_INTERNAL);
|
||||
$options = array('subdirs'=>1, 'maxfiles'=>-1, 'accepted_types'=>'*');
|
||||
$mform->addElement('filemanager', 'files_filemanager', '', null, $options);
|
||||
$mform->addElement('hidden', 'contextid', $this->_customdata['contextid']);
|
||||
$this->set_data($this->_customdata['data']);
|
||||
|
||||
@@ -70,10 +70,10 @@ switch ($action) {
|
||||
if ($child->is_directory()) {
|
||||
$fileitem['isdir'] = true;
|
||||
$fileitem['url'] = $url->out(false);
|
||||
$fileitem['icon'] = $OUTPUT->pix_icon('f/folder', get_string('icon'));
|
||||
$fileitem['icon'] = $OUTPUT->pix_icon(file_folder_icon(), get_string('icon'));
|
||||
} else {
|
||||
$fileitem['url'] = $child->get_url();
|
||||
$fileitem['icon'] = $OUTPUT->pix_icon('f/'.mimeinfo('icon', $child->get_visible_name()), get_string('icon'));
|
||||
$fileitem['icon'] = $OUTPUT->pix_icon(file_file_icon($child), get_string('icon'));
|
||||
}
|
||||
$tree[] = $fileitem;
|
||||
}
|
||||
|
||||
+834
-17
@@ -56,25 +56,31 @@ class core_files_renderer extends plugin_renderer_base {
|
||||
|
||||
$html .= $this->output->box_start();
|
||||
$table = new html_table();
|
||||
$table->head = array(get_string('filename', 'backup'), get_string('size'), get_string('modified'));
|
||||
$table->align = array('left', 'right', 'right');
|
||||
$table->head = array(get_string('name'), get_string('lastmodified'), get_string('size', 'repository'), get_string('type', 'repository'));
|
||||
$table->align = array('left', 'left', 'left', 'left');
|
||||
$table->width = '100%';
|
||||
$table->data = array();
|
||||
|
||||
foreach ($tree->tree as $file) {
|
||||
if (!empty($file['isdir'])) {
|
||||
$table->data[] = array(
|
||||
html_writer::link($file['url'], $this->output->pix_icon('f/folder', 'icon') . ' ' . $file['filename']),
|
||||
'',
|
||||
$file['filedate'],
|
||||
);
|
||||
} else {
|
||||
$table->data[] = array(
|
||||
html_writer::link($file['url'], $this->output->pix_icon('f/'.mimeinfo('icon', $file['filename']), get_string('icon')) . ' ' . $file['filename']),
|
||||
$file['filesize'],
|
||||
$file['filedate'],
|
||||
);
|
||||
$filedate = $filesize = $filetype = '';
|
||||
if ($file['filedate']) {
|
||||
$filedate = userdate($file['filedate'], get_string('strftimedatetimeshort', 'langconfig'));
|
||||
}
|
||||
if (empty($file['isdir'])) {
|
||||
if ($file['filesize']) {
|
||||
$filesize = display_size($file['filesize']);
|
||||
}
|
||||
$fileicon = file_file_icon($file, 24);
|
||||
$filetype = get_mimetype_description($file);
|
||||
} else {
|
||||
$fileicon = file_folder_icon(24);
|
||||
}
|
||||
$table->data[] = array(
|
||||
html_writer::link($file['url'], $this->output->pix_icon($fileicon, get_string('icon')) . ' ' . $file['filename']),
|
||||
$filedate,
|
||||
$filesize,
|
||||
$filetype
|
||||
);
|
||||
}
|
||||
|
||||
$html .= html_writer::table($table);
|
||||
@@ -82,8 +88,818 @@ class core_files_renderer extends plugin_renderer_base {
|
||||
$html .= $this->output->box_end();
|
||||
return $html;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Prints the file manager and initializes all necessary libraries
|
||||
*
|
||||
* <pre>
|
||||
* $fm = new form_filemanager($options);
|
||||
* $output = get_renderer('core', 'files');
|
||||
* echo $output->render($fm);
|
||||
* </pre>
|
||||
*
|
||||
* @param form_filemanager $fm File manager to render
|
||||
* @return string HTML fragment
|
||||
*/
|
||||
public function render_form_filemanager($fm) {
|
||||
static $filemanagertemplateloaded;
|
||||
$html = $this->fm_print_generallayout($fm);
|
||||
$module = array(
|
||||
'name'=>'form_filemanager',
|
||||
'fullpath'=>'/lib/form/filemanager.js',
|
||||
'requires' => array('core_filepicker', 'base', 'io-base', 'node', 'json', 'core_dndupload', 'panel', 'resize-plugin', 'dd-plugin'),
|
||||
'strings' => array(
|
||||
array('error', 'moodle'), array('info', 'moodle'), array('confirmdeletefile', 'repository'),
|
||||
array('draftareanofiles', 'repository'), array('entername', 'repository'), array('enternewname', 'repository'),
|
||||
array('invalidjson', 'repository'), array('popupblockeddownload', 'repository'),
|
||||
array('unknownoriginal', 'repository'), array('confirmdeletefolder', 'repository'),
|
||||
array('confirmdeletefilewithhref', 'repository'), array('confirmrenamefolder', 'repository'),
|
||||
array('confirmrenamefile', 'repository')
|
||||
)
|
||||
);
|
||||
if (empty($filemanagertemplateloaded)) {
|
||||
$filemanagertemplateloaded = true;
|
||||
$this->page->requires->js_init_call('M.form_filemanager.set_templates',
|
||||
array($this->filemanager_js_templates()), true, $module);
|
||||
}
|
||||
$this->page->requires->js_init_call('M.form_filemanager.init', array($fm->options), true, $module);
|
||||
|
||||
// non javascript file manager
|
||||
$html .= '<noscript>';
|
||||
$html .= "<div><object type='text/html' data='".$fm->get_nonjsurl()."' height='160' width='600' style='border:1px solid #000'></object></div>";
|
||||
$html .= '</noscript>';
|
||||
|
||||
|
||||
return $html;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns html for displaying one file manager
|
||||
*
|
||||
* The main element in HTML must have id="filemanager-{$client_id}" and
|
||||
* class="filemanager fm-loading";
|
||||
* After all necessary code on the page (both html and javascript) is loaded,
|
||||
* the class fm-loading will be removed and added class fm-loaded;
|
||||
* The main element (class=filemanager) will be assigned the following classes:
|
||||
* 'fm-maxfiles' - when filemanager has maximum allowed number of files;
|
||||
* 'fm-nofiles' - when filemanager has no files at all (although there might be folders);
|
||||
* 'fm-noitems' - when current view (folder) has no items - neither files nor folders;
|
||||
* 'fm-updating' - when current view is being updated (usually means that loading icon is to be displayed);
|
||||
* 'fm-nomkdir' - when 'Make folder' action is unavailable (empty($fm->options->subdirs) == true)
|
||||
*
|
||||
* Element with class 'filemanager-container' will be holding evens for dnd upload (dragover, etc.).
|
||||
* It will have class:
|
||||
* 'dndupload-ready' - when a file is being dragged over the browser
|
||||
* 'dndupload-over' - when file is being dragged over this filepicker (additional to 'dndupload-ready')
|
||||
* 'dndupload-uploading' - during the upload process (note that after dnd upload process is
|
||||
* over, the file manager will refresh the files list and therefore will have for a while class
|
||||
* fm-updating. Both waiting processes should look similar so the images don't jump for user)
|
||||
*
|
||||
* If browser supports Drag-and-drop, the body element will have class 'dndsupported',
|
||||
* otherwise - 'dndnotsupported';
|
||||
*
|
||||
* Element with class 'fp-content' will be populated with files list;
|
||||
* Element with class 'fp-btn-add' will hold onclick event for adding a file (opening filepicker);
|
||||
* Element with class 'fp-btn-mkdir' will hold onclick event for adding new folder;
|
||||
* Element with class 'fp-btn-download' will hold onclick event for download action;
|
||||
*
|
||||
* Element with class 'fp-path-folder' is a template for one folder in path toolbar.
|
||||
* It will hold mouse click event and will be assigned classes first/last/even/odd respectfully.
|
||||
* Parent element will receive class 'empty' when there are no folders to be displayed;
|
||||
* The content of subelement with class 'fp-path-folder-name' will be substituted with folder name;
|
||||
*
|
||||
* Element with class 'fp-viewbar' will have the class 'enabled' or 'disabled' when view mode
|
||||
* can be changed or not;
|
||||
* Inside element with class 'fp-viewbar' there are expected elements with classes
|
||||
* 'fp-vb-icons', 'fp-vb-tree' and 'fp-vb-details'. They will handle onclick events to switch
|
||||
* between the view modes, the last clicked element will have the class 'checked';
|
||||
*
|
||||
* @param form_filemanager $fm
|
||||
* @return string
|
||||
*/
|
||||
private function fm_print_generallayout($fm) {
|
||||
global $OUTPUT;
|
||||
$options = $fm->options;
|
||||
$client_id = $options->client_id;
|
||||
$straddfile = get_string('addfile', 'repository');
|
||||
$strmakedir = get_string('makeafolder', 'moodle');
|
||||
$strdownload = get_string('downloadfolder', 'repository');
|
||||
$strloading = get_string('loading', 'repository');
|
||||
$strdroptoupload = get_string('droptoupload', 'moodle');
|
||||
$icon_progress = $OUTPUT->pix_icon('i/loading_small', $strloading).'';
|
||||
$restrictions = $this->fm_print_restrictions($fm);
|
||||
$strdndenabled = get_string('dndenabled_insentence', 'moodle').$OUTPUT->help_icon('dndenabled');
|
||||
$strdndenabledinbox = get_string('dndenabled_inbox', 'moodle');
|
||||
$loading = get_string('loading', 'repository');
|
||||
|
||||
$html = '
|
||||
<div id="filemanager-'.$client_id.'" class="filemanager fm-loading">
|
||||
<div class="fp-restrictions">
|
||||
'.$restrictions.'
|
||||
<span class="dndupload-message"> - '.$strdndenabled.' </span>
|
||||
</div>
|
||||
<div class="fp-navbar">
|
||||
<div class="filemanager-toolbar">
|
||||
<div class="fp-toolbar">
|
||||
<div class="{!}fp-btn-add"><a href="#"><img src="'.$this->pix_url('a/add_file').'" /> '.$straddfile.'</a></div>
|
||||
<div class="{!}fp-btn-mkdir"><a href="#"><img src="'.$this->pix_url('a/create_folder').'" /> '.$strmakedir.'</a></div>
|
||||
<div class="{!}fp-btn-download"><a href="#"><img src="'.$this->pix_url('a/download_all').'" /> '.$strdownload.'</a></div>
|
||||
</div>
|
||||
<div class="{!}fp-viewbar">
|
||||
<a class="{!}fp-vb-icons" href="#"></a>
|
||||
<a class="{!}fp-vb-details" href="#"></a>
|
||||
<a class="{!}fp-vb-tree" href="#"></a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="fp-pathbar">
|
||||
<span class="{!}fp-path-folder"><a class="{!}fp-path-folder-name" href="#"></a></span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="filemanager-loading mdl-align">'.$icon_progress.'</div>
|
||||
<div class="filemanager-container" >
|
||||
<div class="fm-content-wrapper">
|
||||
<div class="fp-content"></div>
|
||||
<div class="fm-empty-container <!--mdl-align-->">
|
||||
<span class="dndupload-message">'.$strdndenabledinbox.'<br/><span class="dndupload-arrow"></span></span>
|
||||
</div>
|
||||
<div class="dndupload-target">'.$strdroptoupload.'<br/><span class="dndupload-arrow"></span></div>
|
||||
<div class="dndupload-uploadinprogress">'.$icon_progress.'</div>
|
||||
</div>
|
||||
<div class="filemanager-updating">'.$icon_progress.'</div>
|
||||
</div>
|
||||
</div>';
|
||||
return preg_replace('/\{\!\}/', '', $html);
|
||||
}
|
||||
|
||||
/**
|
||||
* FileManager JS template for displaying one file in 'icon view' mode.
|
||||
*
|
||||
* Except for elements described in fp_js_template_iconfilename, this template may also
|
||||
* contain element with class 'fp-contextmenu'. If context menu is available for this
|
||||
* file, the top element will receive the additional class 'fp-hascontextmenu' and
|
||||
* the element with class 'fp-contextmenu' will hold onclick event for displaying
|
||||
* the context menu.
|
||||
*
|
||||
* @see fp_js_template_iconfilename()
|
||||
* @return string
|
||||
*/
|
||||
private function fm_js_template_iconfilename() {
|
||||
$rv = '
|
||||
<div class="fp-file">
|
||||
<a href="#">
|
||||
<div style="position:relative;">
|
||||
<div class="{!}fp-thumbnail"></div>
|
||||
<div class="fp-reficons1"></div>
|
||||
<div class="fp-reficons2"></div>
|
||||
</div>
|
||||
<div class="fp-filename-field">
|
||||
<div class="{!}fp-filename"></div>
|
||||
</div>
|
||||
</a>
|
||||
<a class="{!}fp-contextmenu" href="#">'.$this->pix_icon('i/menu', '▶').'</a>
|
||||
</div>';
|
||||
return preg_replace('/\{\!\}/', '', $rv);
|
||||
}
|
||||
|
||||
/**
|
||||
* FileManager JS template for displaying file name in 'table view' and 'tree view' modes.
|
||||
*
|
||||
* Except for elements described in fp_js_template_listfilename, this template may also
|
||||
* contain element with class 'fp-contextmenu'. If context menu is available for this
|
||||
* file, the top element will receive the additional class 'fp-hascontextmenu' and
|
||||
* the element with class 'fp-contextmenu' will hold onclick event for displaying
|
||||
* the context menu.
|
||||
*
|
||||
* @todo MDL-32736 remove onclick="return false;"
|
||||
* @see fp_js_template_listfilename()
|
||||
* @return string
|
||||
*/
|
||||
private function fm_js_template_listfilename() {
|
||||
$rv = '
|
||||
<span class="fp-filename-icon">
|
||||
<a href="#">
|
||||
<span class="{!}fp-icon"></span>
|
||||
<span class="{!}fp-filename"></span>
|
||||
</a>
|
||||
<a class="{!}fp-contextmenu" href="#" onclick="return false;">'.$this->pix_icon('i/menu', '▶').'</a>
|
||||
</span>';
|
||||
return preg_replace('/\{\!\}/', '', $rv);
|
||||
}
|
||||
|
||||
/**
|
||||
* FileManager JS template for displaying 'Make new folder' dialog.
|
||||
*
|
||||
* Must be wrapped in an element, CSS for this element must define width and height of the window;
|
||||
*
|
||||
* Must have one input element with type="text" (for users to enter the new folder name);
|
||||
*
|
||||
* content of element with class 'fp-dlg-curpath' will be replaced with current path where
|
||||
* new folder is about to be created;
|
||||
* elements with classes 'fp-dlg-butcreate' and 'fp-dlg-butcancel' will hold onclick events;
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
private function fm_js_template_mkdir() {
|
||||
$rv = '
|
||||
<div class="fp-mkdir-dlg">
|
||||
<p>New folder name:</p>
|
||||
<input type="text"><br/>
|
||||
<a class="{!}fp-dlg-butcreate fp-panel-button" href="#">'.get_string('create').'</a>
|
||||
<a class="{!}fp-dlg-butcancel fp-panel-button" href="#">'.get_string('cancel').'</a>
|
||||
</div>';
|
||||
return preg_replace('/\{\!\}/', '', $rv);
|
||||
}
|
||||
|
||||
/**
|
||||
* FileManager JS template for error/info message displayed as a separate popup window.
|
||||
*
|
||||
* @see fp_js_template_message()
|
||||
* @return string
|
||||
*/
|
||||
private function fm_js_template_message() {
|
||||
return $this->fp_js_template_message();
|
||||
}
|
||||
|
||||
/**
|
||||
* FileManager JS template for window with file information/actions.
|
||||
*
|
||||
* All content must be enclosed in one element, CSS for this class must define width and
|
||||
* height of the window;
|
||||
*
|
||||
* Thumbnail image will be added as content to the element with class 'fp-thumbnail';
|
||||
*
|
||||
* Inside the window the elements with the following classnames must be present:
|
||||
* 'fp-saveas', 'fp-author', 'fp-license', 'fp-path'. Inside each of them must be
|
||||
* one input element (or select in case of fp-license and fp-path). They may also have labels.
|
||||
* The elements will be assign with class 'uneditable' and input/select element will become
|
||||
* disabled if they are not applicable for the particular file;
|
||||
*
|
||||
* There may be present elements with classes 'fp-original', 'fp-datemodified', 'fp-datecreated',
|
||||
* 'fp-size', 'fp-dimensions', 'fp-reflist'. They will receive additional class 'fp-unknown' if
|
||||
* information is unavailable. If there is information available, the content of embedded
|
||||
* element with class 'fp-value' will be substituted with the value;
|
||||
*
|
||||
* The value of Original ('fp-original') is loaded in separate request. When it is applicable
|
||||
* but not yet loaded the 'fp-original' element receives additional class 'fp-loading';
|
||||
*
|
||||
* The value of 'Aliases/Shortcuts' ('fp-reflist') is also loaded in separate request. When it
|
||||
* is applicable but not yet loaded the 'fp-original' element receives additional class
|
||||
* 'fp-loading'. The string explaining that XX references exist will replace content of element
|
||||
* 'fp-refcount'. Inside '.fp-reflist .fp-value' each reference will be enclosed in <li>;
|
||||
*
|
||||
* Elements with classes 'fp-file-update', 'fp-file-download', 'fp-file-delete', 'fp-file-zip',
|
||||
* 'fp-file-unzip', 'fp-file-setmain' and 'fp-file-cancel' will hold corresponding onclick
|
||||
* events (there may be several elements with class 'fp-file-cancel');
|
||||
*
|
||||
* When confirm button is pressed and file is being selected, the top element receives
|
||||
* additional class 'loading'. It is removed when response from server is received.
|
||||
*
|
||||
* When any of the input fields is changed, the top element receives class 'fp-changed';
|
||||
* When current file can be set as main - top element receives class 'fp-cansetmain';
|
||||
* When current file is folder/zip/file - top element receives respectfully class
|
||||
* 'fp-folder'/'fp-zip'/'fp-file';
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
private function fm_js_template_fileselectlayout() {
|
||||
$strloading = get_string('loading', 'repository');
|
||||
$icon_progress = $this->pix_icon('i/loading_small', $strloading).'';
|
||||
$rv = '
|
||||
<div class="filemanager fp-select">
|
||||
<div class="fp-select-loading">
|
||||
<img src="'.$this->pix_url('i/loading').'" />
|
||||
<p>'.get_string('loading', 'repository').'</p>
|
||||
</div>
|
||||
<form>
|
||||
<div><a class="{!}fp-file-download fp-panel-button" href="#">'.get_string('download').'</a>
|
||||
<a class="{!}fp-file-delete fp-panel-button" href="#">'.get_string('delete').'</a>
|
||||
<a class="{!}fp-file-setmain fp-panel-button" href="#">'.get_string('setmainfile', 'repository').'</a>
|
||||
<a class="{!}fp-file-zip fp-panel-button" href="#">'.get_string('zip', 'editor').'</a>
|
||||
<a class="{!}fp-file-unzip fp-panel-button" href="#">'.get_string('unzip').'</a>
|
||||
</div>
|
||||
<div class="fp-hr"></div>
|
||||
<table>
|
||||
<tr class="{!}fp-saveas"><td class="mdl-right"><label>'.get_string('name', 'moodle').'</label>:</td>
|
||||
<td class="mdl-left"><input type="text"/></td></tr>
|
||||
<tr class="{!}fp-author"><td class="mdl-right"><label>'.get_string('author', 'repository').'</label>:</td>
|
||||
<td class="mdl-left"><input type="text" /></td></tr>
|
||||
<tr class="{!}fp-license"><td class="mdl-right"><label>'.get_string('chooselicense', 'repository').'</label>:</td>
|
||||
<td class="mdl-left"><select></select></td></tr>
|
||||
<tr class="{!}fp-path"><td class="mdl-right"><label>'.get_string('path', 'moodle').'</label>:</td>
|
||||
<td class="mdl-left"><select></select></td></tr>
|
||||
<tr class="{!}fp-original"><td class="mdl-right"><label>'.get_string('original', 'repository').'</label>:</td>
|
||||
<td class="mdl-left"><span class="fp-originloading">'.$icon_progress.' '.$strloading.'</span><span class="fp-value"/></td></tr>
|
||||
<tr class="{!}fp-reflist"><td class="mdl-right"><label>'.get_string('referenceslist', 'repository').'</label>:</td>
|
||||
<td class="mdl-left"><p class="{!}fp-refcount"/><span class="fp-reflistloading">'.$icon_progress.' '.$strloading.'</span><ul class="fp-value"/></td></tr>
|
||||
</table>
|
||||
</form>
|
||||
<p class="{!}fp-thumbnail"></p>
|
||||
<form>
|
||||
<p class="fp-select-update">
|
||||
<a class="{!}fp-file-update" href="#"><span>'.get_string('update', 'moodle').'</span></a>
|
||||
<a class="{!}fp-file-cancel" href="#"><span>'.get_string('cancel').'</span></a>
|
||||
</p>
|
||||
</form>
|
||||
<div class="fp-fileinfo">
|
||||
<div class="{!}fp-datemodified">'.get_string('lastmodified', 'moodle').': <span class="fp-value"/></div>
|
||||
<div class="{!}fp-datecreated">'.get_string('datecreated', 'repository').': <span class="fp-value"/></div>
|
||||
<div class="{!}fp-size">'.get_string('size', 'repository').': <span class="fp-value"/></div>
|
||||
<div class="{!}fp-dimensions">'.get_string('dimensions', 'repository').': <span class="fp-value"/></div>
|
||||
</div>
|
||||
</div>';
|
||||
return preg_replace('/\{\!\}/', '', $rv);
|
||||
}
|
||||
|
||||
/**
|
||||
* FileManager JS template for popup confirm dialogue window.
|
||||
*
|
||||
* Must have one top element, CSS for this element must define width and height of the window;
|
||||
*
|
||||
* content of element with class 'fp-dlg-text' will be replaced with dialog text;
|
||||
* elements with classes 'fp-dlg-butconfirm' and 'fp-dlg-butcancel' will
|
||||
* hold onclick events;
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
private function fm_js_template_confirmdialog() {
|
||||
$rv = '
|
||||
<div class="filemanager fp-dlg">
|
||||
<div class="{!}fp-dlg-text"></div>
|
||||
<a class="{!}fp-dlg-butconfirm fp-panel-button" href="#">'.get_string('ok').'</a>
|
||||
<a class="{!}fp-dlg-butcancel fp-panel-button" href="#">'.get_string('cancel').'</a>
|
||||
</div>';
|
||||
return preg_replace('/\{\!\}/', '', $rv);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns all FileManager JavaScript templates as an array.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function filemanager_js_templates() {
|
||||
$class_methods = get_class_methods($this);
|
||||
$templates = array();
|
||||
foreach ($class_methods as $method_name) {
|
||||
if (preg_match('/^fm_js_template_(.*)$/', $method_name, $matches))
|
||||
$templates[$matches[1]] = $this->$method_name();
|
||||
}
|
||||
return $templates;
|
||||
}
|
||||
|
||||
/**
|
||||
* Displays restrictions for the file manager
|
||||
*
|
||||
* @param form_filemanager $fm
|
||||
* @return string
|
||||
*/
|
||||
private function fm_print_restrictions($fm) {
|
||||
$maxbytes = display_size($fm->options->maxbytes);
|
||||
if (empty($options->maxfiles) || $options->maxfiles == -1) {
|
||||
$maxsize = get_string('maxfilesize', 'moodle', $maxbytes);
|
||||
//$string['maxfilesize'] = 'Maximum size for new files: {$a}';
|
||||
} else {
|
||||
$strparam = (object)array('size' => $maxbytes, 'attachments' => $options->maxfiles);
|
||||
$maxsize = get_string('maxsizeandattachments', 'moodle', $strparam);
|
||||
//$string['maxsizeandattachments'] = 'Maximum size for new files: {$a->size}, maximum attachments: {$a->attachments}';
|
||||
}
|
||||
// TODO MDL-32020 also should say about 'File types accepted'
|
||||
return '<span>'. $maxsize. '</span>';
|
||||
}
|
||||
|
||||
/**
|
||||
* Template for FilePicker with general layout (not QuickUpload).
|
||||
*
|
||||
* Must have one top element containing everything else (recommended <div class="file-picker">),
|
||||
* CSS for this element must define width and height of the filepicker window. Or CSS must
|
||||
* define min-width, max-width, min-height and max-height and in this case the filepicker
|
||||
* window will be resizeable;
|
||||
*
|
||||
* Element with class 'fp-viewbar' will have the class 'enabled' or 'disabled' when view mode
|
||||
* can be changed or not;
|
||||
* Inside element with class 'fp-viewbar' there are expected elements with classes
|
||||
* 'fp-vb-icons', 'fp-vb-tree' and 'fp-vb-details'. They will handle onclick events to switch
|
||||
* between the view modes, the last clicked element will have the class 'checked';
|
||||
*
|
||||
* Element with class 'fp-repo' is a template for displaying one repository. Other repositories
|
||||
* will be attached as siblings (classes first/last/even/odd will be added respectfully).
|
||||
* The currently selected repostory will have class 'active'. Contents of element with class
|
||||
* 'fp-repo-name' will be replaced with repository name, source of image with class
|
||||
* 'fp-repo-icon' will be replaced with repository icon;
|
||||
*
|
||||
* Element with class 'fp-content' is obligatory and will hold the current contents;
|
||||
*
|
||||
* Element with class 'fp-paging' will contain page navigation (will be deprecated soon);
|
||||
*
|
||||
* Element with class 'fp-path-folder' is a template for one folder in path toolbar.
|
||||
* It will hold mouse click event and will be assigned classes first/last/even/odd respectfully.
|
||||
* Parent element will receive class 'empty' when there are no folders to be displayed;
|
||||
* The content of subelement with class 'fp-path-folder-name' will be substituted with folder name;
|
||||
*
|
||||
* Element with class 'fp-toolbar' will have class 'empty' if all 'Back', 'Search', 'Refresh',
|
||||
* 'Logout', 'Manage' and 'Help' are unavailable for this repo;
|
||||
*
|
||||
* Inside fp-toolbar there are expected elements with classes fp-tb-back, fp-tb-search,
|
||||
* fp-tb-refresh, fp-tb-logout, fp-tb-manage and fp-tb-help. Each of them will have
|
||||
* class 'enabled' or 'disabled' if particular repository has this functionality.
|
||||
* Element with class 'fp-tb-search' must contain empty form inside, it's contents will
|
||||
* be substituted with the search form returned by repository (in the most cases it
|
||||
* is generated with template core_repository_renderer::repository_default_searchform);
|
||||
* Other elements must have either <a> or <button> element inside, it will hold onclick
|
||||
* event for corresponding action; labels for fp-tb-back and fp-tb-logout may be
|
||||
* replaced with those specified by repository;
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
private function fp_js_template_generallayout() {
|
||||
$rv = '
|
||||
<div class="file-picker fp-generallayout">
|
||||
<div class="fp-repo-area">
|
||||
<ul class="fp-list">
|
||||
<li class="{!}fp-repo"><a href="#"><img class="{!}fp-repo-icon" width="16" height="16" /> <span class="{!}fp-repo-name" /span></a></li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="fp-repo-items">
|
||||
<div class="fp-navbar">
|
||||
<div>
|
||||
<div class="{!}fp-toolbar">
|
||||
<div class="{!}fp-tb-back"><a href="#">'.get_string('back', 'repository').'</a></div>
|
||||
<div class="{!}fp-tb-search fp-search"><form/></div>
|
||||
<div class="{!}fp-tb-refresh"><a href="#"><img src="'.$this->pix_url('a/refresh').'" /></a></div>
|
||||
<div class="{!}fp-tb-logout"><img src="'.$this->pix_url('a/logout').'" /><a href="#"></a></div>
|
||||
<div class="{!}fp-tb-manage"><a href="#"><img src="'.$this->pix_url('a/setting').'" /> '.get_string('manageurl', 'repository').'</a></div>
|
||||
<div class="{!}fp-tb-help"><a href="#"><img src="'.$this->pix_url('a/help').'" /> '.get_string('help').'</a></div>
|
||||
</div>
|
||||
<div class="{!}fp-viewbar">
|
||||
<a class="{!}fp-vb-icons" href="#"></a>
|
||||
<a class="{!}fp-vb-details" href="#"></a>
|
||||
<a class="{!}fp-vb-tree" href="#"></a>
|
||||
</div>
|
||||
<div class="fp-clear-right"></div>
|
||||
</div>
|
||||
<div class="fp-pathbar">
|
||||
<span class="{!}fp-path-folder"><a class="{!}fp-path-folder-name" href="#"></a></span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="{!}fp-content"></div>
|
||||
</div>
|
||||
</div>';
|
||||
return preg_replace('/\{\!\}/', '', $rv);
|
||||
}
|
||||
|
||||
/**
|
||||
* FilePicker JS template for displaying one file in 'icon view' mode.
|
||||
*
|
||||
* the element with class 'fp-thumbnail' will be resized to the repository thumbnail size
|
||||
* (both width and height, unless min-width and/or min-height is set in CSS) and the content of
|
||||
* an element will be replaced with an appropriate img;
|
||||
*
|
||||
* the width of element with class 'fp-filename' will be set to the repository thumbnail width
|
||||
* (unless min-width is set in css) and the content of an element will be replaced with filename
|
||||
* supplied by repository;
|
||||
*
|
||||
* top element(s) will have class fp-folder if the element is a folder;
|
||||
*
|
||||
* List of files will have parent <div> element with class 'fp-iconview'
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
private function fp_js_template_iconfilename() {
|
||||
$rv = '
|
||||
<a class="fp-file" href="#" >
|
||||
<div class="{!}fp-thumbnail"></div>
|
||||
<div class="fp-filename-field">
|
||||
<p class="{!}fp-filename"></p>
|
||||
</div>
|
||||
</a>';
|
||||
return preg_replace('/\{\!\}/', '', $rv);
|
||||
}
|
||||
|
||||
/**
|
||||
* FilePicker JS template for displaying file name in 'table view' and 'tree view' modes.
|
||||
*
|
||||
* content of the element with class 'fp-icon' will be replaced with an appropriate img;
|
||||
*
|
||||
* content of element with class 'fp-filename' will be replaced with filename supplied by
|
||||
* repository;
|
||||
*
|
||||
* top element(s) will have class fp-folder if the element is a folder;
|
||||
*
|
||||
* Note that tree view and table view are the YUI widgets and therefore there are no
|
||||
* other templates. The widgets will be wrapped in <div> with class fp-treeview or
|
||||
* fp-tableview (respectfully).
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
private function fp_js_template_listfilename() {
|
||||
$rv = '
|
||||
<span class="fp-filename-icon">
|
||||
<a href="#">
|
||||
<span class="{!}fp-icon"></span>
|
||||
<span class="{!}fp-filename"></span>
|
||||
</a>
|
||||
</span>';
|
||||
return preg_replace('/\{\!\}/', '', $rv);
|
||||
}
|
||||
|
||||
/**
|
||||
* FilePicker JS template for displaying link/loading progress for fetching of the next page
|
||||
*
|
||||
* This text is added to .fp-content AFTER .fp-iconview/.fp-treeview/.fp-tableview
|
||||
*
|
||||
* Must have one parent element with class 'fp-nextpage'. It will be assigned additional
|
||||
* class 'loading' during loading of the next page (it is recommended that in this case the link
|
||||
* becomes unavailable). Also must contain one element <a> or <button> that will hold
|
||||
* onclick event for displaying of the next page. The event will be triggered automatically
|
||||
* when user scrolls to this link.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
private function fp_js_template_nextpage() {
|
||||
$rv = '
|
||||
<div class="{!}fp-nextpage">
|
||||
<div class="fp-nextpage-link"><a href="#">'.get_string('more').'</a></div>
|
||||
<div class="fp-nextpage-loading">
|
||||
<img src="'.$this->pix_url('i/loading').'" />
|
||||
<p>'.get_string('loading', 'repository').'</p>
|
||||
</div>
|
||||
</div>';
|
||||
return preg_replace('/\{\!\}/', '', $rv);
|
||||
}
|
||||
|
||||
/**
|
||||
* FilePicker JS template for window appearing to select a file.
|
||||
*
|
||||
* All content must be enclosed in one element, CSS for this class must define width and
|
||||
* height of the window;
|
||||
*
|
||||
* Thumbnail image will be added as content to the element with class 'fp-thumbnail';
|
||||
*
|
||||
* Inside the window the elements with the following classnames must be present:
|
||||
* 'fp-saveas', 'fp-linktype-2', 'fp-linktype-1', 'fp-linktype-4', 'fp-setauthor',
|
||||
* 'fp-setlicense'. Inside each of them must have one input element (or select in case of
|
||||
* fp-setlicense). They may also have labels.
|
||||
* The elements will be assign with class 'uneditable' and input/select element will become
|
||||
* disabled if they are not applicable for the particular file;
|
||||
*
|
||||
* There may be present elements with classes 'fp-datemodified', 'fp-datecreated', 'fp-size',
|
||||
* 'fp-license', 'fp-author', 'fp-dimensions'. They will receive additional class 'fp-unknown'
|
||||
* if information is unavailable. If there is information available, the content of embedded
|
||||
* element with class 'fp-value' will be substituted with the value;
|
||||
*
|
||||
* Elements with classes 'fp-select-confirm' and 'fp-select-cancel' will hold corresponding
|
||||
* onclick events;
|
||||
*
|
||||
* When confirm button is pressed and file is being selected, the top element receives
|
||||
* additional class 'loading'. It is removed when response from server is received.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
private function fp_js_template_selectlayout() {
|
||||
$rv = '
|
||||
<div class="file-picker fp-select">
|
||||
<div class="fp-select-loading">
|
||||
<img src="'.$this->pix_url('i/loading').'" />
|
||||
<p>'.get_string('loading', 'repository').'</p>
|
||||
</div>
|
||||
<form>
|
||||
<div>
|
||||
<a class="{!}fp-select-confirm fp-panel-button" href="#">'.get_string('getfile', 'repository').'</a>
|
||||
<a class="{!}fp-select-cancel fp-panel-button" href="#">'.get_string('cancel').'</a>
|
||||
</div>
|
||||
<div class="fp-hr"></div>
|
||||
<table>
|
||||
<tr class="{!}fp-linktype-2">
|
||||
<td></td>
|
||||
<td class="mdl-left"><input type="radio"/><label> '.get_string('makefileinternal', 'repository').'</label></td></tr>
|
||||
<tr class="{!}fp-linktype-1">
|
||||
<td></td>
|
||||
<td class="mdl-left"><input type="radio"/><label> '.get_string('makefilelink', 'repository').'</label></td></tr>
|
||||
<tr class="{!}fp-linktype-4">
|
||||
<td></td>
|
||||
<td class="mdl-left"><input type="radio"/><label> '.get_string('makefilereference', 'repository').'</label></td></tr>
|
||||
<tr class="{!}fp-saveas">
|
||||
<td class="mdl-right"><label>'.get_string('saveas', 'repository').'</label>:</td>
|
||||
<td class="mdl-left"><input type="text"/></td></tr>
|
||||
<tr class="{!}fp-setauthor">
|
||||
<td class="mdl-right"><label>'.get_string('author', 'repository').'</label>:</td>
|
||||
<td class="mdl-left"><input type="text" /></td></tr>
|
||||
<tr class="{!}fp-setlicense">
|
||||
<td class="mdl-right"><label>'.get_string('chooselicense', 'repository').'</label>:</td>
|
||||
<td class="mdl-left"><select></select></td></tr>
|
||||
</table>
|
||||
</form>
|
||||
<p class="{!}fp-thumbnail"></p>
|
||||
<div class="fp-fileinfo">
|
||||
<div class="{!}fp-datemodified">'.get_string('lastmodified', 'moodle').': <span class="fp-value"/></div>
|
||||
<div class="{!}fp-datecreated">'.get_string('datecreated', 'repository').': <span class="fp-value"/></div>
|
||||
<div class="{!}fp-size">'.get_string('size', 'repository').': <span class="fp-value"/></div>
|
||||
<div class="{!}fp-license">'.get_string('license', 'moodle').': <span class="fp-value"/></div>
|
||||
<div class="{!}fp-author">'.get_string('author', 'repository').': <span class="fp-value"/></div>
|
||||
<div class="{!}fp-dimensions">'.get_string('dimensions', 'repository').': <span class="fp-value"/></div>
|
||||
</div>
|
||||
</div>';
|
||||
return preg_replace('/\{\!\}/', '', $rv);
|
||||
}
|
||||
|
||||
/**
|
||||
* FilePicker JS template for 'Upload file' repository
|
||||
*
|
||||
* Content to display when user chooses 'Upload file' repository (will be nested inside
|
||||
* element with class 'fp-content').
|
||||
*
|
||||
* Must contain form (enctype="multipart/form-data" method="POST")
|
||||
*
|
||||
* The elements with the following classnames must be present:
|
||||
* 'fp-file', 'fp-saveas', 'fp-setauthor', 'fp-setlicense'. Inside each of them must have
|
||||
* one input element (or select in case of fp-setlicense). They may also have labels.
|
||||
*
|
||||
* Element with class 'fp-upload-btn' will hold onclick event for uploading the file;
|
||||
*
|
||||
* Please note that some fields may be hidden using CSS if this is part of quickupload form
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
private function fp_js_template_uploadform() {
|
||||
$rv = '
|
||||
<div class="fp-upload-form mdl-align">
|
||||
<div class="fp-content-center">
|
||||
<form enctype="multipart/form-data" method="POST">
|
||||
<table >
|
||||
<tr class="{!}fp-file">
|
||||
<td class="mdl-right"><label>'.get_string('attachment', 'repository').'</label>:</td>
|
||||
<td class="mdl-left"><input type="file"/></td></tr>
|
||||
<tr class="{!}fp-saveas">
|
||||
<td class="mdl-right"><label>'.get_string('saveas', 'repository').'</label>:</td>
|
||||
<td class="mdl-left"><input type="text"/></td></tr>
|
||||
<tr class="{!}fp-setauthor">
|
||||
<td class="mdl-right"><label>'.get_string('author', 'repository').'</label>:</td>
|
||||
<td class="mdl-left"><input type="text"/></td></tr>
|
||||
<tr class="{!}fp-setlicense">
|
||||
<td class="mdl-right"><label>'.get_string('chooselicense', 'repository').'</label>:</td>
|
||||
<td class="mdl-left"><select/></td></tr>
|
||||
</table>
|
||||
</form>
|
||||
<div><button class="{!}fp-upload-btn">'.get_string('upload', 'repository').'</button></div>
|
||||
</div>
|
||||
</div> ';
|
||||
return preg_replace('/\{\!\}/', '', $rv);
|
||||
}
|
||||
|
||||
/**
|
||||
* FilePicker JS template to display during loading process (inside element with class 'fp-content').
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
private function fp_js_template_loading() {
|
||||
return '
|
||||
<div class="fp-content-loading">
|
||||
<div class="fp-content-center">
|
||||
<img src="'.$this->pix_url('i/loading').'" />
|
||||
<p>'.get_string('loading', 'repository').'</p>
|
||||
</div>
|
||||
</div>';
|
||||
}
|
||||
|
||||
/**
|
||||
* FilePicker JS template for error (inside element with class 'fp-content').
|
||||
*
|
||||
* must have element with class 'fp-error', its content will be replaced with error text
|
||||
* and the error code will be assigned as additional class to this element
|
||||
* used errors: invalidjson, nofilesavailable, norepositoriesavailable
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
private function fp_js_template_error() {
|
||||
$rv = '
|
||||
<div class="fp-content-error" ><div class="{!}fp-error" /></div>';
|
||||
return preg_replace('/\{\!\}/', '', $rv);
|
||||
}
|
||||
|
||||
/**
|
||||
* FilePicker JS template for error/info message displayed as a separate popup window.
|
||||
*
|
||||
* Must be wrapped in one element, CSS for this element must define
|
||||
* width and height of the window. It will be assigned with an additional class 'fp-msg-error'
|
||||
* or 'fp-msg-info' depending on message type;
|
||||
*
|
||||
* content of element with class 'fp-msg-text' will be replaced with error/info text;
|
||||
*
|
||||
* element with class 'fp-msg-butok' will hold onclick event
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
private function fp_js_template_message() {
|
||||
$rv = '
|
||||
<div class="file-picker fp-msg">
|
||||
<p class="{!}fp-msg-text"></p>
|
||||
<a class="{!}fp-msg-butok fp-panel-button" href="#">'.get_string('ok').'</a>
|
||||
</div>';
|
||||
return preg_replace('/\{\!\}/', '', $rv);
|
||||
}
|
||||
|
||||
/**
|
||||
* FilePicker JS template for popup dialogue window asking for action when file with the same name already exists.
|
||||
*
|
||||
* Must have one top element, CSS for this element must define width and height of the window;
|
||||
*
|
||||
* content of element with class 'fp-dlg-text' will be replaced with dialog text;
|
||||
* elements with classes 'fp-dlg-butoverwrite', 'fp-dlg-butrename' and 'fp-dlg-butcancel' will
|
||||
* hold onclick events;
|
||||
*
|
||||
* content of element with class 'fp-dlg-butrename' will be substituted with appropriate string
|
||||
* (Note that it may have long text)
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
private function fp_js_template_processexistingfile() {
|
||||
$rv = '
|
||||
<div class="file-picker fp-dlg">
|
||||
<p class="{!}fp-dlg-text"></p>
|
||||
<a class="{!}fp-dlg-butoverwrite fp-panel-button" href="#">'.get_string('overwrite', 'repository').'</a>
|
||||
<a class="{!}fp-dlg-butcancel fp-panel-button" href="#">'.get_string('cancel').'</a>
|
||||
<a class="{!}fp-dlg-butrename fp-panel-button" href="#"/>
|
||||
</div>';
|
||||
return preg_replace('/\{\!\}/', '', $rv);
|
||||
}
|
||||
|
||||
/**
|
||||
* FilePicker JS template for repository login form including templates for each element type
|
||||
*
|
||||
* Must contain one <form> element with templates for different input types inside:
|
||||
* Elements with classes 'fp-login-popup', 'fp-login-textarea', 'fp-login-select' and
|
||||
* 'fp-login-input' are templates for displaying respective login form elements. Inside
|
||||
* there must be exactly one element with type <button>, <textarea>, <select> or <input>
|
||||
* (i.e. fp-login-popup should have <button>, fp-login-textarea should have <textarea>, etc.);
|
||||
* They may also contain the <label> element and it's content will be substituted with
|
||||
* label;
|
||||
*
|
||||
* You can also define elements with classes 'fp-login-checkbox', 'fp-login-text'
|
||||
* but if they are not found, 'fp-login-input' will be used;
|
||||
*
|
||||
* Element with class 'fp-login-radiogroup' will be used for group of radio inputs. Inside
|
||||
* it should hava a template for one radio input (with class 'fp-login-radio');
|
||||
*
|
||||
* Element with class 'fp-login-submit' will hold on click mouse event (form submission). It
|
||||
* will be removed if at least one popup element is present;
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
private function fp_js_template_loginform() {
|
||||
$rv = '
|
||||
<div class="fp-login-form">
|
||||
<div class="fp-content-center">
|
||||
<form>
|
||||
<table >
|
||||
<tr class="{!}fp-login-popup">
|
||||
<td colspan="2">
|
||||
<label>'.get_string('popup', 'repository').'</label>
|
||||
<p class="fp-popup"><button class="{!}fp-login-popup-but">'.get_string('login', 'repository').'</button></p></td></tr>
|
||||
<tr class="{!}fp-login-textarea">
|
||||
<td colspan="2"><p><textarea></textarea></p></td></tr>
|
||||
<tr class="{!}fp-login-select">
|
||||
<td align="right"><label></label></td>
|
||||
<td align="left"><select></select></td></tr>
|
||||
<tr class="{!}fp-login-input">
|
||||
<td class="label"><label /></td>
|
||||
<td class="input"><input/></td></tr>
|
||||
<tr class="{!}fp-login-radiogroup">
|
||||
<td align="right" width="30%" valign="top"><label /></td>
|
||||
<td align="left" valign="top"><p class="{!}fp-login-radio"><input /> <label /></p></td></tr>
|
||||
</table>
|
||||
<p><button class="{!}fp-login-submit">'.get_string('submit', 'repository').'</button></p>
|
||||
</form>
|
||||
</div>
|
||||
</div>';
|
||||
return preg_replace('/\{\!\}/', '', $rv);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns all FilePicker JavaScript templates as an array.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function filepicker_js_templates() {
|
||||
$class_methods = get_class_methods($this);
|
||||
$templates = array();
|
||||
foreach ($class_methods as $method_name) {
|
||||
if (preg_match('/^fp_js_template_(.*)$/', $method_name, $matches))
|
||||
$templates[$matches[1]] = $this->$method_name();
|
||||
}
|
||||
return $templates;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns HTML for default repository searchform to be passed to Filepicker
|
||||
*
|
||||
* This will be used as contents for search form defined in generallayout template
|
||||
* (form with id {TOOLSEARCHID}).
|
||||
* Default contents is one text input field with name="s"
|
||||
*/
|
||||
public function repository_default_searchform() {
|
||||
$str = '<input class="search-entry" name="s" value="Search" />';
|
||||
return $str;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Data structure representing a general moodle file tree viewer
|
||||
@@ -148,8 +964,9 @@ class files_tree_viewer implements renderable {
|
||||
$fileitem = array(
|
||||
'params' => $params,
|
||||
'filename' => $child->get_visible_name(),
|
||||
'filedate' => $filedate ? userdate($filedate) : '',
|
||||
'filesize' => $filesize ? display_size($filesize) : ''
|
||||
'mimetype' => $child->get_mimetype(),
|
||||
'filedate' => $filedate ? $filedate : '',
|
||||
'filesize' => $filesize ? $filesize : ''
|
||||
);
|
||||
$url = new moodle_url('/files/index.php', $params);
|
||||
if ($child->is_directory()) {
|
||||
|
||||
+2
-1
@@ -70,7 +70,8 @@ YUI.add('moodle-filter_glossary-autolinker', function(Y) {
|
||||
this.overlay.hide(); //hide progress indicator
|
||||
|
||||
for (key in data.entries) {
|
||||
new M.core.alert({title:data.entries[key].concept, message:data.entries[key].definition, lightbox:false});
|
||||
definition = data.entries[key].definition + data.entries[key].attachments
|
||||
new M.core.alert({title:data.entries[key].concept, message:definition, lightbox:false});
|
||||
}
|
||||
|
||||
return true;
|
||||
|
||||
+62
-21
@@ -32,16 +32,56 @@ require_once $CFG->libdir.'/gradelib.php';
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
class graded_users_iterator {
|
||||
public $course;
|
||||
public $grade_items;
|
||||
public $groupid;
|
||||
public $users_rs;
|
||||
public $grades_rs;
|
||||
public $gradestack;
|
||||
public $sortfield1;
|
||||
public $sortorder1;
|
||||
public $sortfield2;
|
||||
public $sortorder2;
|
||||
|
||||
/**
|
||||
* The couse whose users we are interested in
|
||||
*/
|
||||
protected $course;
|
||||
|
||||
/**
|
||||
* An array of grade items or null if only user data was requested
|
||||
*/
|
||||
protected $grade_items;
|
||||
|
||||
/**
|
||||
* The group ID we are interested in. 0 means all groups.
|
||||
*/
|
||||
protected $groupid;
|
||||
|
||||
/**
|
||||
* A recordset of graded users
|
||||
*/
|
||||
protected $users_rs;
|
||||
|
||||
/**
|
||||
* A recordset of user grades (grade_grade instances)
|
||||
*/
|
||||
protected $grades_rs;
|
||||
|
||||
/**
|
||||
* Array used when moving to next user while iterating through the grades recordset
|
||||
*/
|
||||
protected $gradestack;
|
||||
|
||||
/**
|
||||
* The first field of the users table by which the array of users will be sorted
|
||||
*/
|
||||
protected $sortfield1;
|
||||
|
||||
/**
|
||||
* Should sortfield1 be ASC or DESC
|
||||
*/
|
||||
protected $sortorder1;
|
||||
|
||||
/**
|
||||
* The second field of the users table by which the array of users will be sorted
|
||||
*/
|
||||
protected $sortfield2;
|
||||
|
||||
/**
|
||||
* Should sortfield2 be ASC or DESC
|
||||
*/
|
||||
protected $sortorder2;
|
||||
|
||||
/**
|
||||
* Should users whose enrolment has been suspended be ignored?
|
||||
@@ -59,7 +99,7 @@ class graded_users_iterator {
|
||||
* @param string $sortfield2 The second field of the users table by which the array of users will be sorted
|
||||
* @param string $sortorder2 The order in which the second sorting field will be sorted (ASC or DESC)
|
||||
*/
|
||||
public function graded_users_iterator($course, $grade_items=null, $groupid=0,
|
||||
public function __construct($course, $grade_items=null, $groupid=0,
|
||||
$sortfield1='lastname', $sortorder1='ASC',
|
||||
$sortfield2='firstname', $sortorder2='ASC') {
|
||||
$this->course = $course;
|
||||
@@ -75,6 +115,7 @@ class graded_users_iterator {
|
||||
|
||||
/**
|
||||
* Initialise the iterator
|
||||
*
|
||||
* @return boolean success
|
||||
*/
|
||||
public function init() {
|
||||
@@ -177,7 +218,7 @@ class graded_users_iterator {
|
||||
* Returns information about the next user
|
||||
* @return mixed array of user info, all grades and feedback or null when no more users found
|
||||
*/
|
||||
function next_user() {
|
||||
public function next_user() {
|
||||
if (!$this->users_rs) {
|
||||
return false; // no users present
|
||||
}
|
||||
@@ -244,10 +285,9 @@ class graded_users_iterator {
|
||||
}
|
||||
|
||||
/**
|
||||
* Close the iterator, do not forget to call this function.
|
||||
* @return void
|
||||
* Close the iterator, do not forget to call this function
|
||||
*/
|
||||
function close() {
|
||||
public function close() {
|
||||
if ($this->users_rs) {
|
||||
$this->users_rs->close();
|
||||
$this->users_rs = null;
|
||||
@@ -273,23 +313,23 @@ class graded_users_iterator {
|
||||
|
||||
|
||||
/**
|
||||
* _push
|
||||
* Add a grade_grade instance to the grade stack
|
||||
*
|
||||
* @param grade_grade $grade Grade object
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
function _push($grade) {
|
||||
private function _push($grade) {
|
||||
array_push($this->gradestack, $grade);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* _pop
|
||||
* Remove a grade_grade instance from the grade stack
|
||||
*
|
||||
* @return object current grade object
|
||||
* @return grade_grade current grade object
|
||||
*/
|
||||
function _pop() {
|
||||
private function _pop() {
|
||||
global $DB;
|
||||
if (empty($this->gradestack)) {
|
||||
if (empty($this->grades_rs) || !$this->grades_rs->valid()) {
|
||||
@@ -1049,6 +1089,7 @@ class grade_structure {
|
||||
*/
|
||||
public function get_element_icon(&$element, $spacerifnone=false) {
|
||||
global $CFG, $OUTPUT;
|
||||
require_once $CFG->libdir.'/filelib.php';
|
||||
|
||||
switch ($element['type']) {
|
||||
case 'item':
|
||||
@@ -1114,7 +1155,7 @@ class grade_structure {
|
||||
|
||||
case 'category':
|
||||
$strcat = get_string('category', 'grades');
|
||||
return '<img src="'.$OUTPUT->pix_url('f/folder') . '" class="icon itemicon" ' .
|
||||
return '<img src="'.$OUTPUT->pix_url(file_folder_icon()) . '" class="icon itemicon" ' .
|
||||
'title="'.s($strcat).'" alt="'.s($strcat).'" />';
|
||||
}
|
||||
|
||||
|
||||
+7
-14
@@ -95,8 +95,7 @@ class core_group_external extends external_api {
|
||||
$exceptionparam = new stdClass();
|
||||
$exceptionparam->message = $e->getMessage();
|
||||
$exceptionparam->courseid = $group->courseid;
|
||||
throw new moodle_exception(
|
||||
get_string('errorcoursecontextnotvalid' , 'webservice', $exceptionparam));
|
||||
throw new moodle_exception('errorcoursecontextnotvalid' , 'webservice', '', $exceptionparam);
|
||||
}
|
||||
require_capability('moodle/course:managegroups', $context);
|
||||
|
||||
@@ -168,8 +167,7 @@ class core_group_external extends external_api {
|
||||
$exceptionparam = new stdClass();
|
||||
$exceptionparam->message = $e->getMessage();
|
||||
$exceptionparam->courseid = $group->courseid;
|
||||
throw new moodle_exception(
|
||||
get_string('errorcoursecontextnotvalid' , 'webservice', $exceptionparam));
|
||||
throw new moodle_exception('errorcoursecontextnotvalid' , 'webservice', '', $exceptionparam);
|
||||
}
|
||||
require_capability('moodle/course:managegroups', $context);
|
||||
|
||||
@@ -231,8 +229,7 @@ class core_group_external extends external_api {
|
||||
$exceptionparam = new stdClass();
|
||||
$exceptionparam->message = $e->getMessage();
|
||||
$exceptionparam->courseid = $params['courseid'];
|
||||
throw new moodle_exception(
|
||||
get_string('errorcoursecontextnotvalid' , 'webservice', $exceptionparam));
|
||||
throw new moodle_exception('errorcoursecontextnotvalid' , 'webservice', '', $exceptionparam);
|
||||
}
|
||||
require_capability('moodle/course:managegroups', $context);
|
||||
|
||||
@@ -310,8 +307,7 @@ class core_group_external extends external_api {
|
||||
$exceptionparam = new stdClass();
|
||||
$exceptionparam->message = $e->getMessage();
|
||||
$exceptionparam->courseid = $group->courseid;
|
||||
throw new moodle_exception(
|
||||
get_string('errorcoursecontextnotvalid' , 'webservice', $exceptionparam));
|
||||
throw new moodle_exception('errorcoursecontextnotvalid' , 'webservice', '', $exceptionparam);
|
||||
}
|
||||
require_capability('moodle/course:managegroups', $context);
|
||||
|
||||
@@ -369,8 +365,7 @@ class core_group_external extends external_api {
|
||||
$exceptionparam = new stdClass();
|
||||
$exceptionparam->message = $e->getMessage();
|
||||
$exceptionparam->courseid = $group->courseid;
|
||||
throw new moodle_exception(
|
||||
get_string('errorcoursecontextnotvalid' , 'webservice', $exceptionparam));
|
||||
throw new moodle_exception('errorcoursecontextnotvalid' , 'webservice', '', $exceptionparam);
|
||||
}
|
||||
require_capability('moodle/course:managegroups', $context);
|
||||
|
||||
@@ -450,8 +445,7 @@ class core_group_external extends external_api {
|
||||
$exceptionparam = new stdClass();
|
||||
$exceptionparam->message = $e->getMessage();
|
||||
$exceptionparam->courseid = $group->courseid;
|
||||
throw new moodle_exception(
|
||||
get_string('errorcoursecontextnotvalid' , 'webservice', $exceptionparam));
|
||||
throw new moodle_exception('errorcoursecontextnotvalid' , 'webservice', '', $exceptionparam);
|
||||
}
|
||||
require_capability('moodle/course:managegroups', $context);
|
||||
|
||||
@@ -529,8 +523,7 @@ class core_group_external extends external_api {
|
||||
$exceptionparam = new stdClass();
|
||||
$exceptionparam->message = $e->getMessage();
|
||||
$exceptionparam->courseid = $group->courseid;
|
||||
throw new moodle_exception(
|
||||
get_string('errorcoursecontextnotvalid' , 'webservice', $exceptionparam));
|
||||
throw new moodle_exception('errorcoursecontextnotvalid' , 'webservice', '', $exceptionparam);
|
||||
}
|
||||
require_capability('moodle/course:managegroups', $context);
|
||||
|
||||
|
||||
@@ -36,7 +36,7 @@ $string['cliincorrectvalueerror'] = 'خطأ، القيمة "{$a->value}" غير
|
||||
$string['cliincorrectvalueretry'] = 'قيمة غير صحيحة، حاول مرة أخرى';
|
||||
$string['clitypevalue'] = 'أدخل القيمة';
|
||||
$string['clitypevaluedefault'] = 'ادخل القيم أو اضغط انتر (Enter) لإستخدام القيم الأفتراضية ({$a})';
|
||||
$string['cliunknowoption'] = 'خيارات غير معروفة
|
||||
$string['cliunknowoption'] = 'خيارات غير معروفة
|
||||
{$a}
|
||||
الرجاء استخدام خيار المساعدة';
|
||||
$string['cliyesnoprompt'] = 'ادخل (Y) تعني نعم أو (N) تعني لأ';
|
||||
|
||||
@@ -44,10 +44,10 @@ $string['memorylimithelp'] = '<p>La llende de memoria del PHP del so servidor ta
|
||||
|
||||
<p>Esto va facer que Moodle tenga problemes de memoria más tarde, especialmente si tien munchos módulos y/o munchos usuarios.</p>
|
||||
|
||||
<p>Recomendamos que configure PHP con una llende más grande si ye posible, como por exemplu 40M.
|
||||
<p>Recomendamos que configure PHP con una llende más grande si ye posible, como por exemplu 40M.
|
||||
Esisten varies formes nes que pue intentar facer esta modificación:</p>
|
||||
<ol>
|
||||
<li>Si pue, recompile PHP con <i>--enable-memory-limit</i>.
|
||||
<li>Si pue, recompile PHP con <i>--enable-memory-limit</i>.
|
||||
Esto va permitir que\'l propiu Moodle modifique la llende de memoria.</li>
|
||||
<li>Si tien accesu al so ficheru php.ini pue modificar el valor de <b>memory_limit</b> a daqué paecío a 40M. Si nun tien accesu a esi ficheru igual pue pidir al alministrador del sistema que lo faiga.</li>
|
||||
<li>En dellos servidores PHP pue crear un ficheru .htaccess nel direutoriu Moodle cola ringlera que vien darréu:
|
||||
|
||||
@@ -36,7 +36,7 @@ $string['cliincorrectvalueerror'] = 'Səhv, "{$a->option}" üçün səhv "{$a->v
|
||||
$string['cliincorrectvalueretry'] = 'Səhv, "{$a->option}" üçün səhv "{$a->value}" qiyməti';
|
||||
$string['clitypevalue'] = 'Qiyməti daxil edin';
|
||||
$string['clitypevaluedefault'] = 'Qiyməti daxil edin, ({$a}) qiymətindən avtomatik olaraq istifadə etmək üçün Enter düyməsini basın';
|
||||
$string['cliunknowoption'] = 'Təyin olunmayan parametrlər:
|
||||
$string['cliunknowoption'] = 'Təyin olunmayan parametrlər:
|
||||
{$a}
|
||||
Zəhmət olmasa help parametrindən istifadə edin';
|
||||
$string['cliyesnoprompt'] = 'y (bəli) və n (xeyr) düyməsini basın';
|
||||
|
||||
@@ -70,23 +70,23 @@ $string['pathsroparentdataroot'] = '({$a->parent}) valideyn kataloquna yazmaq m
|
||||
$string['pathssubadmindir'] = 'Veb-hostinqlərin sayı az olduqda yol/admin idarəetmə panelinə və ya digər bir yerə keçmək üçün xüsusi URL-dir. Təəssüf ki, bu Moodlun idarəetmə səhifələrinin standart mövqeyi ilə ziddiyyət təşkil edir. Bunu Moodle kataloqunda admin qovluğunun adını dəyişməklə və burada yeni adı göstərməklə aradan qaldırmaq olar. Məsələn, <em>moodleadmin</em>. Bu zaman Moodlun idarəetmə panelinə bütün keçidlər avtomatik olaraq dəyişir.';
|
||||
$string['pathssubdataroot'] = 'Moodlun yüklənmiş faylları harada saxlayacağını mütləq göstərmək lazımdır Veb-server istifadəçisinin (usually \'nobody\' or \'apache\') bu kataloqda oxuma və YAZMA üçün icazəsi olmalıdır, lakin bu zaman İnternetdən birbaşa müraciət mümkün ola bilməz. Əgər bu kataloq mövcud deyilsə, quraşdırma proqramı onu yaratmağa cəhd edir. ';
|
||||
$string['pathssubdirroot'] = 'Moodlun quraşdırılması kataloquna tam yol';
|
||||
$string['pathssubwwwroot'] = 'Moodla keçidin mümkün olduğu tam veb-ünvan.
|
||||
Moodla keçid üçün bir neçə ünvandan istifadə etmək mümkün deyil. Əgər sizin saytın bir neçə açıq ünvanı varsa, siz həmişə bu ünvanlardan göstərilən ünvana keçidi təmin etməlisiniz.
|
||||
əgəgr sizin sayta həm İnternetdən və həm də lokal şəbəkədən keçid mümkündürsə, burada ümumi ünvanı göstərin və DNS-i elə sazlayın ki, lokal istifadəçilər də bu ünvandan istifadə edə bilsin.
|
||||
Əgər göstərilən ünvan düzgün deyilsə, quraşdırmanı digər qiymətlə yenidən başlamaq üçün brauzerin ünvan sətirində URL-i dəyişin. ';
|
||||
$string['pathssubwwwroot'] = 'Moodla keçidin mümkün olduğu tam veb-ünvan.
|
||||
Moodla keçid üçün bir neçə ünvandan istifadə etmək mümkün deyil. Əgər sizin saytın bir neçə açıq ünvanı varsa, siz həmişə bu ünvanlardan göstərilən ünvana keçidi təmin etməlisiniz.
|
||||
əgəgr sizin sayta həm İnternetdən və həm də lokal şəbəkədən keçid mümkündürsə, burada ümumi ünvanı göstərin və DNS-i elə sazlayın ki, lokal istifadəçilər də bu ünvandan istifadə edə bilsin.
|
||||
Əgər göstərilən ünvan düzgün deyilsə, quraşdırmanı digər qiymətlə yenidən başlamaq üçün brauzerin ünvan sətirində URL-i dəyişin.';
|
||||
$string['pathsunsecuredataroot'] = 'Verilənlər kataloqunun mövqeyi təhlükəsizlik tələblərinə cavab vermir.';
|
||||
$string['pathswrongadmindir'] = 'Admin kataloqu mövcud deyil';
|
||||
$string['phpextension'] = '{$a} PHP geniçlənməsi';
|
||||
$string['phpversion'] = 'PHP versiyası';
|
||||
$string['phpversionhelp'] = '<p>Moodle üçün PHP-nin 4.3.0 və ondan yuxarı və ya 5.1.0 və ondan yuxarı versiyaları(5.0.versiyasının bəzi problemləri məlumdur) lazımdır.</p>
|
||||
<p>İndi Siz, {$a} versiyasından istifadə edirsiniz</p>
|
||||
<p>Siz PHP-ni yeniləməlisiniz və ya PHP-nin daha yeni versiyası olan xostinqə keçməlisiniz!<br />
|
||||
$string['phpversionhelp'] = '<p>Moodle üçün PHP-nin 4.3.0 və ondan yuxarı və ya 5.1.0 və ondan yuxarı versiyaları(5.0.versiyasının bəzi problemləri məlumdur) lazımdır.</p>
|
||||
<p>İndi Siz, {$a} versiyasından istifadə edirsiniz</p>
|
||||
<p>Siz PHP-ni yeniləməlisiniz və ya PHP-nin daha yeni versiyası olan xostinqə keçməlisiniz!<br />
|
||||
(5.0.x verisyası olarsa 4.4.x versiyasına qayıda bilərsiniz)</p>';
|
||||
$string['welcomep10'] = '{$a->installername} ({$a->installerversion})';
|
||||
$string['welcomep20'] = 'Siz bu səhifəni ona görə görürsünüz ki, <strong>{$a->packname} {$a->packversion}</strong> proqram paketini öz kompyüterinizdə müvəffəqiyyətlə qurmusunuz. Təbrik edirik!';
|
||||
$string['welcomep30'] = '<strong>{$a->installername}</strong> proqram paketinin bu versiyasında <strong>Moodle</strong>un işləyəcəyi mühiti yaratmaq üçün aşağıdakı proqramlar var:';
|
||||
$string['welcomep40'] = 'Paketə həmçinin <strong>Moodle {$a->moodlerelease} ({$a->moodleversion})</strong> daxildir.';
|
||||
$string['welcomep50'] = 'Bu paketə daxil olan əlavələrdən istifadə edilmə ardıcıllığı, müvafiq lisenziyalarla müəyyən edilir. <strong>{$a->installername}</strong> tam proqram paketi
|
||||
$string['welcomep50'] = 'Bu paketə daxil olan əlavələrdən istifadə edilmə ardıcıllığı, müvafiq lisenziyalarla müəyyən edilir. <strong>{$a->installername}</strong> tam proqram paketi
|
||||
<a href="http://www.opensource.org/docs/definition_plain.html">mənbəni açır</a> və <a href="http://www.gnu.org/copyleft/gpl.html">GPL</a> lisenziyasının şərtlərinə uyğun olaraq yayılır.';
|
||||
$string['welcomep60'] = 'Növbəti səhifələrdə Siz, bir neçə sadə addımla öz kompyüterinizdə <strong>Moodle</strong>-un parametrlərini sazlaya və quraşdıra bilərsiniz. Siz sazlama parametrlərini susmaya görə qəbul edə və ya öz tələblərinizdən asılı olaraq dəyişə bilərsiniz.';
|
||||
$string['welcomep70'] = '<strong>Moodle</strong> quraşdırma prosesini davam etmək üçün "Növbəti" düyməsini sıxın.';
|
||||
|
||||
@@ -36,7 +36,7 @@ $string['cliincorrectvalueerror'] = 'Error, valor incorrecte "{$a->value}" per a
|
||||
$string['cliincorrectvalueretry'] = 'Valor incorrecte, si us plau, torneu-ho a provar.';
|
||||
$string['clitypevalue'] = 'Valor de tipus';
|
||||
$string['clitypevaluedefault'] = 'valor de tipus, premeu Intro per fer servir un valor per defecte ({$a})';
|
||||
$string['cliunknowoption'] = 'Opcions invàlides:
|
||||
$string['cliunknowoption'] = 'Opcions invàlides:
|
||||
{$a}
|
||||
L\'opció --help us orientarà.';
|
||||
$string['cliyesnoprompt'] = 'Escriu y (significa Sí) o n (significa No)';
|
||||
|
||||
@@ -64,8 +64,8 @@ $string['welcomep10'] = '{$a->installername} ({$a->installerversion})';
|
||||
$string['welcomep20'] = 'Esteu veient aquesta pàgina perquè heu instal·lat amb èxit i heu executat el paquet <strong>{$a->packname} {$a->packversion}</strong>. Felicitacions!';
|
||||
$string['welcomep30'] = 'Aquesta versió de <strong>{$a->installername}</strong> inclou les aplicacions necessàries per crear un entorn en el qual funcioni <strong>Moodle</strong>:';
|
||||
$string['welcomep40'] = 'El paquet inclou també <strong>Moodle {$a->moodlerelease} ({$a->moodleversion})</strong>.';
|
||||
$string['welcomep50'] = 'L\'ús de totes les aplicacions d\'aquest paquet és governat per les seves llicències respectives. El paquet <strong>{$a->installername}</strong> complet és
|
||||
<a href="http://www.opensource.org/docs/definition_plain.html">codi font obert</a> i es distribueix
|
||||
$string['welcomep50'] = 'L\'ús de totes les aplicacions d\'aquest paquet és governat per les seves llicències respectives. El paquet <strong>{$a->installername}</strong> complet és
|
||||
<a href="http://www.opensource.org/docs/definition_plain.html">codi font obert</a> i es distribueix
|
||||
sota llicència <a href="http://www.gnu.org/copyleft/gpl.html">GPL</a>.';
|
||||
$string['welcomep60'] = 'Les pàgines següents us guiaran per una sèrie de passos fàcils de seguir per configurar <strong>Moodle</strong> en el vostre ordinador. Podeu acceptar els paràmetres per defecte o, opcionalment, modificar-los perquè s\'ajustin a les vostres necessitats.';
|
||||
$string['welcomep70'] = 'Feu clic en el botó "Següent" per continuar la configuració de <strong>Moodle</strong>.';
|
||||
|
||||
+12
-12
@@ -42,21 +42,21 @@ $string['installation'] = 'Gosod';
|
||||
$string['langdownloaderror'] = 'Yn anffodus, ni osodwyd yr iaith ganlynol: "{$a}". Bydd y broses osod yn cario ymlaen yn Saesneg.';
|
||||
$string['memorylimithelp'] = '<p>Mae maint y cof PHP yn eich gweinydd ar hyn o bryd yn {$a}.</p>
|
||||
|
||||
<p>Gall hyn arwain at broblemau â\'r cof yn nes ymlaen, yn enwedig
|
||||
<p>Gall hyn arwain at broblemau â\'r cof yn nes ymlaen, yn enwedig
|
||||
os ydych wedi galluogi llawer o fodiwlau a/neu lawer o ddefnyddwyr.</p>
|
||||
|
||||
<p>Rydym yn argymell eich bod yn ffurfweddu PHP gyda mwy o gof os yn bosib, megis 40M.
|
||||
<p>Rydym yn argymell eich bod yn ffurfweddu PHP gyda mwy o gof os yn bosib, megis 40M.
|
||||
Mae sawl ffordd o wneud hyn:</p>
|
||||
<ol>
|
||||
<li>Os ydych yn gallu, ceisiwch ail-grynhoi PHP gyda <i>--enable-memory-limit</i>.
|
||||
<li>Os ydych yn gallu, ceisiwch ail-grynhoi PHP gyda <i>--enable-memory-limit</i>.
|
||||
Bydd hyn yn gadael i Moodle osod maint y cof ei hun.</li>
|
||||
<li>Os ydych yn gallu mynd i mewn i\'ch ffeil php.ini, gallwch newid y gosodiad <b>memory_limit</b>
|
||||
yn y fan honno i tua 40M. Os nad ydych chi\'n gallu gwneud hyn eich hun, efallai
|
||||
<li>Os ydych yn gallu mynd i mewn i\'ch ffeil php.ini, gallwch newid y gosodiad <b>memory_limit</b>
|
||||
yn y fan honno i tua 40M. Os nad ydych chi\'n gallu gwneud hyn eich hun, efallai
|
||||
y gallech ofyn i\'ch gweinyddwr wneud hyn i chi.</li>
|
||||
<li>Ar rai gweinyddion PHP, gallwch greu ffeil .htaccess yng nghyfeiriadur Moodle
|
||||
<li>Ar rai gweinyddion PHP, gallwch greu ffeil .htaccess yng nghyfeiriadur Moodle
|
||||
sy\'n cynnwys y llinell hon:
|
||||
<p><blockquote>php_value memory_limit 40M</blockquote></p>
|
||||
<p>Fodd bynnag, ar rai gweinyddion bydd hyn yn atal <b>pob</b> tudalen PHP rhag gweithio
|
||||
<p>Fodd bynnag, ar rai gweinyddion bydd hyn yn atal <b>pob</b> tudalen PHP rhag gweithio
|
||||
(bydd gwallau\'n ymddangos pan fyddwch yn edrych ar dudalennau) felly bydd rhaid i chi dynnu\'r ffeil .htaccess file.</p></li>
|
||||
</ol>';
|
||||
$string['phpversion'] = 'Fersiwn PHP';
|
||||
@@ -65,15 +65,15 @@ $string['phpversionhelp'] = '<p>Mae angen o leiaf fersiwn PHP 4.3.0 neu 5.1.0 ar
|
||||
<p>Rhaid i chi uwchraddio PHP neu newid i westeiwr â fersiwn diweddarach o PHP!<br/>
|
||||
(Os oes gennych 5.0.x gallwch hefyd is-raddio i fersiwn 4.4.x)</p>';
|
||||
$string['welcomep10'] = '{$a->installername} ({$a->installerversion})';
|
||||
$string['welcomep20'] = 'Rydych chi\'n gweld y dudalen hon gan eich bod wedi gosod a
|
||||
$string['welcomep20'] = 'Rydych chi\'n gweld y dudalen hon gan eich bod wedi gosod a
|
||||
lansio\'r pecyn <strong>{$a->packname} {$a->packversion}</strong> yn llwyddiannus ar eich cyfrifiadur. Llongyfarchiadau!';
|
||||
$string['welcomep30'] = 'Mae\'r fersiwn <strong>{$a->installername}</strong> yn cynnwys rhaglenni
|
||||
$string['welcomep30'] = 'Mae\'r fersiwn <strong>{$a->installername}</strong> yn cynnwys rhaglenni
|
||||
i greu amgylchedd y gall <strong>Moodle</strong> weithio ynddo, sef:';
|
||||
$string['welcomep40'] = 'Mae\'r pecyn hefyd yn cynnwys <strong>Moodle {$a->moodlerelease} ({$a->moodleversion})</strong>.';
|
||||
$string['welcomep50'] = 'Y trwyddedau perthnasol sy\'n llywodraethu dros yr holl raglenni yn y pecyn hwn. Y pecyn cyflawn yw <strong>{$a->installername}</strong>
|
||||
$string['welcomep50'] = 'Y trwyddedau perthnasol sy\'n llywodraethu dros yr holl raglenni yn y pecyn hwn. Y pecyn cyflawn yw <strong>{$a->installername}</strong>
|
||||
<a href="http://www.opensource.org/docs/definition_plain.html">open source</a> a chaiff ei ddosbarthu dan y drwydded <a href="http://www.gnu.org/copyleft/gpl.html">GPL</a>.';
|
||||
$string['welcomep60'] = 'Bydd y tudalennau canlynol yn eich arwain drwy\'r camau syml i
|
||||
ffurfweddu a gosod <strong>Moodle</strong> ar eich cyfrifiadur. Gallwch ddewis derbyn y gosodiadau
|
||||
$string['welcomep60'] = 'Bydd y tudalennau canlynol yn eich arwain drwy\'r camau syml i
|
||||
ffurfweddu a gosod <strong>Moodle</strong> ar eich cyfrifiadur. Gallwch ddewis derbyn y gosodiadau
|
||||
diofyn, neu gallwch eu newid eich hun ar gyfer eich dibenion chi.';
|
||||
$string['welcomep70'] = 'Cliciwch y botwm "Nesaf" i fwrw ymlaen i osod <strong>Moodle</strong>.';
|
||||
$string['wwwroot'] = 'Cyfeiriad ar y we';
|
||||
|
||||
+15
-16
@@ -48,21 +48,21 @@ Installationsprogrammet udfører et tjek før hver installation og opgradering.
|
||||
$string['errorsinenvironment'] = 'Systemtjekket mislykkedes!';
|
||||
$string['installation'] = 'Installation';
|
||||
$string['langdownloaderror'] = 'Sproget "{$a}" blev desværre ikke installeret. Installationen vil fortsætte på engelsk.';
|
||||
$string['memorylimithelp'] = '<p>Den mængde hukommelse PHP kan bruge, er sat til {$a}.</p>
|
||||
$string['memorylimithelp'] = '<p>Den mængde hukommelse PHP kan bruge, er sat til {$a}.</p>
|
||||
|
||||
<p>Dette kan forårsage at der opstår problemer senere, især hvis du har mange moduler aktiveret eller mange brugere.</p>
|
||||
<p>Dette kan forårsage at der opstår problemer senere, især hvis du har mange moduler aktiveret eller mange brugere.</p>
|
||||
|
||||
<p>Vi anbefaler at du konfigurerer PHP med mere hukommelse, f.eks. 40M.
|
||||
Der er flere måder hvorpå du kan rette det.</p>
|
||||
<ol>
|
||||
<li>Hvis du har mulighed for det, kan du rekompilere PHP med <i>--enable-memory-limit</i>.
|
||||
Det vil tillade at Moodle selv kan definere hvor meget hukommelse der er brug for.</li>
|
||||
<p>Vi anbefaler at du konfigurerer PHP med mere hukommelse, f.eks. 40M.
|
||||
Der er flere måder hvorpå du kan rette det.</p>
|
||||
<ol>
|
||||
<li>Hvis du har mulighed for det, kan du rekompilere PHP med <i>--enable-memory-limit</i>.
|
||||
Det vil tillade at Moodle selv kan definere hvor meget hukommelse der er brug for.</li>
|
||||
|
||||
<li>Hvis du har adgang til php.ini filen kan du ændre <b>memory_limit</b>-indstillingen til noget i retning af 40M.
|
||||
Hvis du ikke har direkte adgang til den kan du bede systemadministratoren om at gøre det for dig.</li>
|
||||
<li>Hvis du har adgang til php.ini filen kan du ændre <b>memory_limit</b>-indstillingen til noget i retning af 40M.
|
||||
Hvis du ikke har direkte adgang til den kan du bede systemadministratoren om at gøre det for dig.</li>
|
||||
|
||||
<li>På nogle servere kan du oprette en \'.htaccess\' fil og gemme den i moodle-mappen med linjen:
|
||||
<blockquote><div>php_value memory_limit 40M</div></blockquote>
|
||||
<blockquote><div>php_value memory_limit 40M</div></blockquote>
|
||||
<p>Det kan dog på nogle servere forhindre <b>alle</b> PHP-siderne i at virke (du vil se fejl når du ser på siderne). I så fald kan du blive nødt til at fjerne \'.htaccess\' filen igen.</p></li> </ol>';
|
||||
$string['paths'] = 'Stier';
|
||||
$string['pathserrcreatedataroot'] = 'Datamappen ({$a->dataroot}) kan ikke oprettes af installationsprogrammet.';
|
||||
@@ -72,19 +72,18 @@ $string['pathsroparentdataroot'] = 'Den overordnede mappe ({$a->parent}) er skri
|
||||
$string['pathssubadmindir'] = 'Enkelte webhoteller bruger /admin som speciel URL til kontrolpanelet el. lign. Desværre konflikter det med Moodles standardplacering af admin-sider. Du kan klare dette ved at give admin-mappen et andet navn i din installation og skrive det her. Det kan f.eks. være <em>moodleadmin</em>. Det vil fikse admin-links i Moodle.';
|
||||
$string['pathssubdataroot'] = 'Du har brug for et sted, hvor Moodle kan gemme uploadede filer. Denne mappe skal kunne læses OG SKRIVES I af webserverbrugeren (oftest \'ingen\' eller \'apache\'), men må ikke være tilgængelig direkte via internettet. Installationsprogrammet vil forsøge at oprette mappen, hvis ikke den allerede eksisterer.';
|
||||
$string['pathssubdirroot'] = 'Den fulde sti til Moodleinstallationen.';
|
||||
$string['pathssubwwwroot'] = 'Moodles fulde web-adresse.
|
||||
$string['pathssubwwwroot'] = 'Moodles fulde web-adresse.
|
||||
Det er ikke muligt at komme ind på Moodle fra mere end en adresse.
|
||||
Hvis dit websted har flere offentlige adresser skal du opsætte permanent viderestilling til dem alle undtagen denne.
|
||||
Hvis dit websted er tilgængeligt fra både internet og intranet skal du bruge internetadressen her og opsætte din DNS sådan at intranet-brugerne kan bruge den offentlige adresse også.
|
||||
Hvis ikke adressen er korrekt må du ændre URL\'en i din browser og genstarte installationen med den rigtige adresse.
|
||||
';
|
||||
Hvis ikke adressen er korrekt må du ændre URL\'en i din browser og genstarte installationen med den rigtige adresse.';
|
||||
$string['pathsunsecuredataroot'] = 'Datamappen er ikke sikret';
|
||||
$string['pathswrongadmindir'] = 'Adminmappe eksisterer ikke';
|
||||
$string['phpextension'] = '{$a} PHP-extension';
|
||||
$string['phpversion'] = 'PHP version';
|
||||
$string['phpversionhelp'] = '<p>Moodle kræver mindst PHP version 4.3.0. eller 5.1.0 (5.0.x er behæftet med fejl).</p>
|
||||
<p>Webserveren bruger i øjeblikket version {$a}</p>
|
||||
<p>Du bliver nødt til at opdatere PHP eller flytte systemet over på en anden webserver der har en nyere version af PHP!</p>
|
||||
$string['phpversionhelp'] = '<p>Moodle kræver mindst PHP version 4.3.0. eller 5.1.0 (5.0.x er behæftet med fejl).</p>
|
||||
<p>Webserveren bruger i øjeblikket version {$a}</p>
|
||||
<p>Du bliver nødt til at opdatere PHP eller flytte systemet over på en anden webserver der har en nyere version af PHP!</p>
|
||||
(Har du ver. 5.0.x kan du også nedgradere til 4.4.x)</p>';
|
||||
$string['welcomep10'] = '{$a->installername} ({$a->installerversion})';
|
||||
$string['welcomep20'] = 'Du ser denne side fordi du med succes har installeret og åbnet pakken <strong>{$a->packname} {$a->packversion}</strong> på din computer.
|
||||
|
||||
@@ -36,7 +36,7 @@ $string['cliincorrectvalueerror'] = 'Fehler: Falscher Wert "{$a->value}" für "{
|
||||
$string['cliincorrectvalueretry'] = 'Falscher Wert - bitte nochmal';
|
||||
$string['clitypevalue'] = 'Wert eingeben';
|
||||
$string['clitypevaluedefault'] = 'Wert eingeben oder Standardwert benutzen ({$a})';
|
||||
$string['cliunknowoption'] = 'Nicht erkannte Optionen:
|
||||
$string['cliunknowoption'] = 'Nicht erkannte Optionen:
|
||||
{$a}
|
||||
Hilfe wird über die Option -help angezeigt.';
|
||||
$string['cliyesnoprompt'] = 'y (yes=ja) oder n (no=nein) eingeben';
|
||||
|
||||
@@ -66,7 +66,7 @@ $string['pathsroparentdataroot'] = 'Das Verzeichnis ({$a->parent}) ist schreibge
|
||||
$string['pathssubadmindir'] = 'Einige Webserver benutzen /admin als speziellen Link, um auf Einstellungsseiten oder Ähnliches zu verweisen. Unglücklicherweise kollidiert dies mit dem standardmäßigen Verzeichnis für die Moodle-Administration. Sie können dieses Problem beheben, indem Sie das Verzeichnis admin in Ihrer Moodle-Installation umbenennen und den neuen Namen hier eingeben (z.B. <em>moodleadmin</em>). Mit dieser Änderung werden alle Admin-Links korrigiert.';
|
||||
$string['pathssubdataroot'] = 'Sie benötigen einen Platz, wo Moodle hochgeladene Dateien abspeichern kann. Dieses Verzeichnis muss Lese- und Schreibrechte für das Nutzerkonto besitzen, mit dem Ihr Webservers läuft (üblicherweise \'nobody\', \'apache\' oder \'www\'). Außerdem sollte das Verzeichnis nicht direkt aus dem Internet erreichbar sein. Das Intallationsskript wird versuchen, ein solches Verzeichnis zu erstellen, falls es nicht existiert.</p>';
|
||||
$string['pathssubdirroot'] = 'Vollständiger Pfad der Moodle-Installation';
|
||||
$string['pathssubwwwroot'] = 'Vollständige Webadresse für den Zugriff auf Moodle. Es ist nicht möglich, über unterschiedliche Adressen auf Moodle zuzugreifen. Sollte Ihre Website mehrere öffentliche Adressen verwenden, so müssen Sie eine Adresse festlegen und für die übrigen Adressen dauerhafte Weiterleitungen dorthin einrichten.
|
||||
$string['pathssubwwwroot'] = 'Vollständige Webadresse für den Zugriff auf Moodle. Es ist nicht möglich, über unterschiedliche Adressen auf Moodle zuzugreifen. Sollte Ihre Website mehrere öffentliche Adressen verwenden, so müssen Sie eine Adresse festlegen und für die übrigen Adressen dauerhafte Weiterleitungen dorthin einrichten.
|
||||
<p>Falls Ihre Website gleichzeitig im Intranet und im Internet erreichbar ist, so tragen Sie die öffentliche Adresse ein. Konfigurieren Sie den DNS so, dass Moodle auch aus dem Intranet über die öffentliche Adresse erreichbar ist.
|
||||
<p>Führen Sie Ihre Moodle-Installation unbedingt mit der richtigen Adresse durch, weil es andernfalls zu Problemen kommen könnte.';
|
||||
$string['pathsunsecuredataroot'] = 'Der Speicherort des Verzeichnisses \'dataroot\' ist unsicher';
|
||||
|
||||
@@ -81,17 +81,17 @@ $string['phpextension'] = 'Extensión PHP {$a}';
|
||||
$string['phpversion'] = 'Versión PHP';
|
||||
$string['phpversionhelp'] = '<p>Moodle requiere al menos una versión de PHP 4.3.0 o 5.1.0 ((5.0.x tiene una serie de problemas conocidos).</p>
|
||||
<p>En este momento está ejecutando la versión {$a}</p>
|
||||
<p>¡Debe actualizar PHP o trasladarse a otro servidor con una versión más reciente de PHP!<br />
|
||||
<p>¡Debe actualizar PHP o trasladarse a otro servidor con una versión más reciente de PHP!<br />
|
||||
(En caso de 5.0.x podría también revertir a la versión 4.4.x)</p>';
|
||||
$string['welcomep10'] = '{$a->installername} ({$a->installerversion})';
|
||||
$string['welcomep20'] = 'Si está viendo esta página es porque ha podido ejecutar el paquete <strong>{$a->packname} {$a->packversion}</strong> en su ordenador. !Enhorabuena!';
|
||||
$string['welcomep30'] = 'Esta versión de <strong>{$a->installername}</strong> incluye las
|
||||
$string['welcomep30'] = 'Esta versión de <strong>{$a->installername}</strong> incluye las
|
||||
aplicaciones necesarias para que <strong>Moodle</strong> funcione en su ordenador,
|
||||
principalmente:';
|
||||
$string['welcomep40'] = 'El paquete también incluye <strong>Moodle {$a->moodlerelease} ({$a->moodleversion})</strong>.';
|
||||
$string['welcomep50'] = 'El uso de todas las aplicaciones del paquete está gobernado por sus respectivas
|
||||
licencias. El programa <strong>{$a->installername}</strong> es
|
||||
<a href="http://www.opensource.org/docs/definition_plain.html">código abierto</a> y se distribuye
|
||||
$string['welcomep50'] = 'El uso de todas las aplicaciones del paquete está gobernado por sus respectivas
|
||||
licencias. El programa <strong>{$a->installername}</strong> es
|
||||
<a href="http://www.opensource.org/docs/definition_plain.html">código abierto</a> y se distribuye
|
||||
bajo licencia <a href="http://www.gnu.org/copyleft/gpl.html">GPL</a>.';
|
||||
$string['welcomep60'] = 'Las siguientes páginas le guiarán a través de algunos sencillos pasos para configurar
|
||||
y ajustar <strong>Moodle</strong> en su ordenador. Puede utilizar los valores por defecto sugeridos o,
|
||||
|
||||
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
// This file is part of Moodle - http://moodle.org/
|
||||
//
|
||||
// Moodle 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 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// Moodle 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.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
/**
|
||||
* Automatically generated strings for Moodle 2.3dev installer
|
||||
*
|
||||
* Do not edit this file manually! It contains just a subset of strings
|
||||
* needed during the very first steps of installation. This file was
|
||||
* generated automatically by export-installer.php (which is part of AMOS
|
||||
* {@link http://docs.moodle.org/dev/Languages/AMOS}) using the
|
||||
* list of strings defined in /install/stringnames.txt.
|
||||
*
|
||||
* @package installer
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
|
||||
defined('MOODLE_INTERNAL') || die();
|
||||
|
||||
$string['environmentrequireinstall'] = 'debe estar instalado y activado';
|
||||
@@ -0,0 +1,38 @@
|
||||
<?php
|
||||
|
||||
// This file is part of Moodle - http://moodle.org/
|
||||
//
|
||||
// Moodle 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 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// Moodle 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.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
/**
|
||||
* Automatically generated strings for Moodle 2.3dev installer
|
||||
*
|
||||
* Do not edit this file manually! It contains just a subset of strings
|
||||
* needed during the very first steps of installation. This file was
|
||||
* generated automatically by export-installer.php (which is part of AMOS
|
||||
* {@link http://docs.moodle.org/dev/Languages/AMOS}) using the
|
||||
* list of strings defined in /install/stringnames.txt.
|
||||
*
|
||||
* @package installer
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
|
||||
defined('MOODLE_INTERNAL') || die();
|
||||
|
||||
$string['databasehost'] = 'host de la Base de Datos';
|
||||
$string['environmentsub2'] = 'Cada versión de Moodle tiene algún requisito mínimo de la versión de PHP y un número obligatorio de extensiones de PHP. Una comprobación del entorno completo se realiza antes de cada instalación y actualización. Por favor, póngase en contacto con el administrador del servidor si no sabe cómo instalar la nueva versión o habilitar las extensiones PHP.';
|
||||
$string['errorsinenvironment'] = '¡La comprobación del entorno falló!';
|
||||
$string['welcomep20'] = 'Si está viendo esta página es porque ha podido ejecutar el paquete <strong>{$a->packname} {$a->packversion}</strong> en su computadora. !Enhorabuena!';
|
||||
$string['welcomep30'] = 'Esta versión de <strong>{$a->installername}</strong> incluye las aplicaciones necesarias para que <strong>Moodle</strong> funcione en su computadora principalmente:';
|
||||
$string['welcomep60'] = 'Las siguientes páginas le guiarán a través de algunos sencillos pasos para configurar y ajustar <strong>Moodle</strong> en su computadora. Puede utilizar los valores por defecto sugeridos o, de forma opcional, modificarlos para que se ajusten a sus necesidades.';
|
||||
@@ -36,7 +36,7 @@ $string['cliincorrectvalueerror'] = 'Viga, vigane väärtus "{$a->value}" "{$a->
|
||||
$string['cliincorrectvalueretry'] = 'Vale väärtus(value), palun proovige uuesti';
|
||||
$string['clitypevalue'] = 'tüübi väärtus';
|
||||
$string['clitypevaluedefault'] = 'sisesta väärtus, vajuta Enter kasutamaks vaikeväärtust ({$a})';
|
||||
$string['cliunknowoption'] = 'Tundmatud valikud:
|
||||
$string['cliunknowoption'] = 'Tundmatud valikud:
|
||||
{$a}
|
||||
Palun kasuta --help valikut.';
|
||||
$string['cliyesnoprompt'] = 'kirjuta y (tähendab jah) või n (tähendab ei)';
|
||||
|
||||
@@ -75,13 +75,13 @@ $string['phpversionhelp'] = '<p>Moodle-k PHP 4.1.0 edo geroagoko bertsioa behar
|
||||
$string['welcomep10'] = '{$a->installername} ({$a->installerversion})';
|
||||
$string['welcomep20'] = 'Orri hau ikusten baduzu <strong>{$a->packname} {$a->packversion}</strong> paketea
|
||||
zure ordenadorean instalatu ahal izan duzu. Zorionak!';
|
||||
$string['welcomep30'] = '<strong>{$a->installername}</strong>ren bertsio honek <strong>Moodle</strong>k
|
||||
$string['welcomep30'] = '<strong>{$a->installername}</strong>ren bertsio honek <strong>Moodle</strong>k
|
||||
zure ordenadorean funtzionatzeko behar diren aplikazioak dauzka,
|
||||
bereziki:';
|
||||
$string['welcomep40'] = 'Paketeak ere zera dauka: <strong>Moodle {$a->moodlerelease} ({$a->moodleversion})</strong>.';
|
||||
$string['welcomep50'] = 'Paketeko aplikazio guztien erabilpena dagozkien lizentziek
|
||||
arautzen dute. <strong>{$a->installername}</strong> aplikazioak
|
||||
<a href="http://www.opensource.org/docs/definition_plain.html">kode irekia</a> dauka eta
|
||||
$string['welcomep50'] = 'Paketeko aplikazio guztien erabilpena dagozkien lizentziek
|
||||
arautzen dute. <strong>{$a->installername}</strong> aplikazioak
|
||||
<a href="http://www.opensource.org/docs/definition_plain.html">kode irekia</a> dauka eta
|
||||
<a href="http://www.gnu.org/copyleft/gpl.html">GPL</a> lizentziapean banatzen da.';
|
||||
$string['welcomep60'] = 'Datozen orriek urrats erraz batzuen bidez gidatuko zaituzte
|
||||
<strong>Moodle</strong> zure ordenadorean instalatu eta konfiguratzeko. Aholkatzen diren lehentsitako baloreak
|
||||
|
||||
@@ -44,10 +44,10 @@ $string['memorylimithelp'] = '<p>O límite de memoria para PHP do seu servidor e
|
||||
|
||||
<p>Isto fará que Moodle teña problemas de memoria máis tarde, especialmente se ten un número de módulos significativo e/ou un gran número de usuarios.</p>
|
||||
|
||||
<p>Recomendamos que configure PHP cun límite maior se é posible, como por exemplo 16M.
|
||||
<p>Recomendamos que configure PHP cun límite maior se é posible, como por exemplo 16M.
|
||||
Existen varias formas que pode tentar para facer esta modificación:</p>
|
||||
<ol>
|
||||
<li>Se pode, recompile PHP con <i>--enable-memory-limit</i>.
|
||||
<li>Se pode, recompile PHP con <i>--enable-memory-limit</i>.
|
||||
Iso permitirá que o propio Moodle modifique o límite de memoria.</li>
|
||||
<li>Se ten acceso ao seu ficheiro php.ini pode modificar o valor de <b>memory_limit</b> para algo semellante a 16M. Se non ten acceso a ese ficheiro tal vez poida pedir ao administrador do sistema que o faga.</li>
|
||||
<li>Nalgúns servidores PHP servers pode crear un ficheiro .htaccess no directorio Moodle coa liña seguinte:
|
||||
@@ -61,7 +61,7 @@ $string['phpversionhelp'] = '<p>Moodle require unha versión de PHP de 4.3.0 com
|
||||
(No caso de ter unha versión 5.0.x pode retornar para unha versión 4.4.x)</p>';
|
||||
$string['welcomep10'] = '{$a->installername} ({$a->installerversion})';
|
||||
$string['welcomep20'] = 'Está a ver esta páxina porque conseguiu instalar e iniciar o paquete <strong>{$a->packname} {$a->packversion}</strong> no seu computador. Parabéns!';
|
||||
$string['welcomep30'] = 'Esta versión do <strong>{$a->installername}</strong> inclúe as aplicacións
|
||||
$string['welcomep30'] = 'Esta versión do <strong>{$a->installername}</strong> inclúe as aplicacións
|
||||
para crear o ámbito en que <strong>Moodle</strong> pode funcionar, nomeadamente:';
|
||||
$string['welcomep40'] = 'O paquete tamén inclúe <strong>Moodle {$a->moodlerelease} ({$a->moodleversion})</strong>.';
|
||||
$string['welcomep50'] = 'A utilización de todas as aplicacións deste paquete réxese polas respectivas licenzas. O paquete <strong>{$a->installername}</strong> completo é <a href="http://www.opensource.org/docs/definition_plain.html"> código aberto</a> distribuído nos termos da licenza <a href="http://www.gnu.org/copyleft/gpl.html">GPL</a>.';
|
||||
|
||||
@@ -37,7 +37,7 @@ $string['cliincorrectvalueerror'] = 'שגיאה: ערך לא תקין
|
||||
$string['cliincorrectvalueretry'] = 'ערך שגוי, נסה שנית';
|
||||
$string['clitypevalue'] = 'סוג הערך';
|
||||
$string['clitypevaluedefault'] = 'סוג הערך, הקש Enter לשימוש בערך ברירת מחדל ({$a})';
|
||||
$string['cliunknowoption'] = 'אפשרויות לא מוכרות :
|
||||
$string['cliunknowoption'] = 'אפשרויות לא מוכרות :
|
||||
{$a}
|
||||
אנא השתמש באפשרות העזרה.';
|
||||
$string['cliyesnoprompt'] = 'רשום y (שפרושו כן) או n (שפרושו לא)';
|
||||
|
||||
@@ -79,8 +79,8 @@ $string['paths'] = 'נתיבים';
|
||||
$string['pathserrcreatedataroot'] = 'ספריית המידע (Data Directory) - ({$a->dataroot}) לא יכולה להיווצר על-ידי המתקין.';
|
||||
$string['pathshead'] = 'נתיבים מאושרים';
|
||||
$string['pathsrodataroot'] = 'ספריית המידע (Data Directory) לא ניתנת לכתיבה.';
|
||||
$string['pathsroparentdataroot'] = 'ספריית האב - ({$a->parent}) לא ניתנת לכתיבה.
|
||||
ספריית המידע (Data Directory) - ({$a->dataroot}) לא יכולה להיווצר על-ידי המתקין. ';
|
||||
$string['pathsroparentdataroot'] = 'ספריית האב - ({$a->parent}) לא ניתנת לכתיבה.
|
||||
ספריית המידע (Data Directory) - ({$a->dataroot}) לא יכולה להיווצר על-ידי המתקין.';
|
||||
$string['pathssubdirroot'] = 'הנתיב המלא לספריית ההתקנה של Moodle';
|
||||
$string['pathsunsecuredataroot'] = 'ספריית המידע (Data Directory) לא מאובטחת';
|
||||
$string['pathswrongadmindir'] = 'ספריית ה-admin לא קיימת';
|
||||
@@ -96,11 +96,11 @@ $string['welcomep20'] = 'הינך רואה את עמוד זה מפני שהתק
|
||||
חבילה במחשבך. ברכותינו!';
|
||||
$string['welcomep30'] = 'גירסת <strong>{$a->installername}</strong> כוללת את היישומים ליצור סביבה אשר בה <strong> Moodle </strong>
|
||||
יפעל דהיינו:';
|
||||
$string['welcomep40'] = 'החבילה כוללת בנוסף
|
||||
$string['welcomep40'] = 'החבילה כוללת בנוסף
|
||||
<strong>Moodle {$a->moodlerelease} ({$a->moodleversion})</strong>.';
|
||||
$string['welcomep50'] = 'השימוש בכל היישומים בחבילה זו מפוקח ע"י הרשיונות המתאימים להם. החבילה
|
||||
$string['welcomep50'] = 'השימוש בכל היישומים בחבילה זו מפוקח ע"י הרשיונות המתאימים להם. החבילה
|
||||
<strong>{$a->installername}</strong>
|
||||
השלמה היא
|
||||
השלמה היא
|
||||
<a href="http://www.opensource.org/docs/definition_plain.html"> קוד פתוח
|
||||
</a>
|
||||
והיא מבוזרת תחת רישיון
|
||||
|
||||
@@ -50,15 +50,15 @@ Puna provjera okruženja se obavlja prije svake instalacije ili nadogradnje post
|
||||
$string['errorsinenvironment'] = 'Pogreške u okruženju poslužitelja!';
|
||||
$string['installation'] = 'Instalacija';
|
||||
$string['langdownloaderror'] = 'Nažalost, jezik "{$a}" nije instaliran. Proces instalacije će biti nastavljen na engleskom jeziku.';
|
||||
$string['memorylimithelp'] = '<p>PHP ograničenje memorije na poslužitelju je trenutno podešeno na {$a}.</p>
|
||||
$string['memorylimithelp'] = '<p>PHP ograničenje memorije na poslužitelju je trenutno podešeno na {$a}.</p>
|
||||
|
||||
<p>Ova postavka može kasnije rezultirati memorijskim problemima na vašem Moodle sustavu, posebno ako imate veći broj uključenih modula i/ili veći broj korisnika.</p>
|
||||
<p>Ova postavka može kasnije rezultirati memorijskim problemima na vašem Moodle sustavu, posebno ako imate veći broj uključenih modula i/ili veći broj korisnika.</p>
|
||||
|
||||
<p>Preporučujemo da konfigurirate PHP s većim ograničenjem ako je moguće, recimo 40M. Postoji nekoliko načina na koje to možete napraviti:</p>
|
||||
<ol>
|
||||
<li>Ako možete, rekompajlirajte PHP s <i>--enable-memory-limit</i>. Ovo će dozvoliti Moodle sustavu samostalno postavljanje memorijskog ograničenja.</li>
|
||||
<li>Ako imate pristup php.ini datoteci, možete promijeniti <b>memory_limit</b> vrijednost na 40M. Ako nemate pristup toj datoteci možete pitati svog administratora da to uradi.</li>
|
||||
<li>Na nekim PHP poslužiteljima možete napraviti .htaccess datoteku u Moodle mapi koja sadrži red: <p><blockquote>php_value memory_limit 40M</blockquote></p>
|
||||
<ol>
|
||||
<li>Ako možete, rekompajlirajte PHP s <i>--enable-memory-limit</i>. Ovo će dozvoliti Moodle sustavu samostalno postavljanje memorijskog ograničenja.</li>
|
||||
<li>Ako imate pristup php.ini datoteci, možete promijeniti <b>memory_limit</b> vrijednost na 40M. Ako nemate pristup toj datoteci možete pitati svog administratora da to uradi.</li>
|
||||
<li>Na nekim PHP poslužiteljima možete napraviti .htaccess datoteku u Moodle mapi koja sadrži red: <p><blockquote>php_value memory_limit 40M</blockquote></p>
|
||||
<p>Uzmite u obzir da će na nekim poslužiteljima to spriječiti prikazivanje <b>svih</b> PHP stranica (bit će vam prikazana poruka o grešci), pa ćete na takvim poslužiteljima morati ukloniti .htaccess datoteku.</p></li> </ol>';
|
||||
$string['paths'] = 'Putanje (PATH)';
|
||||
$string['pathserrcreatedataroot'] = 'Instalacijska skripta ne može stvoriti \'Mapu s podacima\' ({$a->dataroot}).';
|
||||
@@ -69,8 +69,8 @@ $string['pathssubadmindir'] = 'Manji broj webhosting tvrtki koristi /admin kao p
|
||||
Ovo će promijeniti administratorsku poveznicu na Moodle sustavu u novu vrijednost.';
|
||||
$string['pathssubdataroot'] = 'Mora postojati mapa u koju Moodle može pohraniti upload datoteke. Korisnik pod kojim je pokrenut web server (obično \'nobody\' ili \'apache\') bi morao imati mogućnost čitanja/pisanja podataka u toj mapi, ali oni ne bi trebali biti dostupni direktno preko weba. Instalacijska skripta će pokušati stvoriti navedenu mapu ako ista ne postoji.';
|
||||
$string['pathssubdirroot'] = 'Puna putanja (PATH) do Moodle instalacije.';
|
||||
$string['pathssubwwwroot'] = 'Unesite punu web adresu putem koje će se pristupati vašem Moodle sustavu.
|
||||
Moodle sustavu NIJE MOGUĆE pristupiti preko više URL-ova, odaberite onaj koji vam najviše odgovara.
|
||||
$string['pathssubwwwroot'] = 'Unesite punu web adresu putem koje će se pristupati vašem Moodle sustavu.
|
||||
Moodle sustavu NIJE MOGUĆE pristupiti preko više URL-ova, odaberite onaj koji vam najviše odgovara.
|
||||
Ako vaš poslužitelj ima višestruke javne adrese, onda morate postaviti tzv. permanent redirect na sve osim ove adrese.
|
||||
Ako je vaš poslužitelj dostupan i putem intraneta i Interneta, onda ovdje unesite javnu adresu i podesite DNS tako da vaši intranet korisnici mogu koristiti tu javnu adresu.
|
||||
Ako adresa nije točna, molimo unesite točnu adresu u vaš internet preglednik i ponovno pokrenite instalaciju s promijenjenim vrijednostima.';
|
||||
|
||||
@@ -59,18 +59,18 @@ $string['pathsroparentdataroot'] = 'A felettes könyvtás ({$a->parent}) nem ír
|
||||
$string['pathssubadmindir'] = 'Egy pár webes gazdagép esetén az /admin speciális URL pl. a vezérlőpanel eléréséhez. Ez ütközik a Moodle admin oldalainak standard helyével. Javítás: a telepítésben nevezze át a rendszergazda könyvtárát, az új nevet pedig írja be ide. Például: <em>moodleadmin</em>. Ezzel helyrehozhatók a Moodle rendszergazdai ugrópontjai.';
|
||||
$string['pathssubdataroot'] = 'Szüksége van egy helyre, ahol a Moodle mentheti a feltöltött állományokat. Ez a könyvtár a webszerver felhasználója (általában \'nobody\' vagy \'apache\') számára legyen mind olvasható, MIND ÍRHATÓ. Ha nem létezik, a telepítő megpróbálja létrehozni.';
|
||||
$string['pathssubdirroot'] = 'Teljes útvonal a Moodle telepítéséhez. ';
|
||||
$string['pathssubwwwroot'] = 'A Moodle elérésére használandó teljes webcím. A Moodle egyszerre több
|
||||
címről nem érhető el. Ha portálja több címet használ, a jelen cím kivételével az összeshez állandó
|
||||
átirányítást kell beállítania. Ha portálja mind intranetről, mind az internetről elérhető, a nyilvános
|
||||
címet itt adja meg, a DNS-t pedig úgy állítsa be, hogy az intranetről a
|
||||
$string['pathssubwwwroot'] = 'A Moodle elérésére használandó teljes webcím. A Moodle egyszerre több
|
||||
címről nem érhető el. Ha portálja több címet használ, a jelen cím kivételével az összeshez állandó
|
||||
átirányítást kell beállítania. Ha portálja mind intranetről, mind az internetről elérhető, a nyilvános
|
||||
címet itt adja meg, a DNS-t pedig úgy állítsa be, hogy az intranetről a
|
||||
nyilvános cím is elérhető legyen. Ha a cím hibás, módosítsa böngészőjében az URL-t, hogy a telepítés egy másik értékkel induljon újra.';
|
||||
$string['pathsunsecuredataroot'] = 'Az adatok gyökérkönyvtára nem biztonságos.';
|
||||
$string['pathswrongadmindir'] = 'Nem létezik az admin könyvtár.';
|
||||
$string['phpextension'] = '{$a} PHP-bővítmény';
|
||||
$string['phpversion'] = 'PHP-verzió';
|
||||
$string['phpversionhelp'] = 'A Moodle használatához legalább a PHP 4.3.0 vagy 5.1.0 verziója szükséges
|
||||
(az 5.0.x több ismert gond miatt nem ajánlott). Az Ön által használt
|
||||
verzió {$a}. Frissítse a PHP-verziót, vagy térjen át újabb PHP-verziót
|
||||
(az 5.0.x több ismert gond miatt nem ajánlott). Az Ön által használt
|
||||
verzió {$a}. Frissítse a PHP-verziót, vagy térjen át újabb PHP-verziót
|
||||
működtető gazdagépre! (5.0.x esetén visszatérhet a 4.4.x verzióhoz is)';
|
||||
$string['welcomep10'] = '{$a->installername} ({$a->installerversion})';
|
||||
$string['welcomep20'] = 'Azért látja ezt az oldalt, mert sikeresen telepítette és futtatja az {$a->packname} {$a->packversion} csomagot számítógépén. Gratulálunk!';
|
||||
|
||||
@@ -42,17 +42,17 @@ $string['installation'] = 'Տեղակայում';
|
||||
$string['langdownloaderror'] = 'Ցավոք "{$a}" լեզուն տեղակայված չէ և տեղակայման գործընթացը կշարունակվի անգլերենով։';
|
||||
$string['memorylimithelp'] = '<p>PHP-ի հիշողության սահմանը սպասարկչի համար ներկայումս սահմանված է՝ {$a}։</p>
|
||||
|
||||
<p>հետագայում կարող եք հիշողության հետ կապված խնդիրներ ունենալ,
|
||||
<p>հետագայում կարող եք հիշողության հետ կապված խնդիրներ ունենալ,
|
||||
եթե Moodle-ում ունենաք շատ մոդուլներ և/կամ մեծ թվով օգտագործողներ։</p>
|
||||
|
||||
<p>Խորհուրդ ենք տալիս PHP-ն կազմաձևել հնարավորին շատ հիշողության համար, օրինակ` 40M: Դրա համար կան մի քանի ձևեր, որոնք կարող եք փորձել.</p>
|
||||
<ol>
|
||||
<li>Եթե դուք կարող եք, վերակազմարկել PHP-ն <i>--enable-memory-limit</i>-ով։ Այն թույլ կտա Moodle-ին ինքնուրույն կարգաբերել հիշողության սահմանը։</li>
|
||||
<li>Եթե Ձեզ մատչելի է php.ini ֆայլը, կարող եք փոխել <b>memory_limit</b>-ը՝
|
||||
<li>Եթե Ձեզ մատչելի է php.ini ֆայլը, կարող եք փոխել <b>memory_limit</b>-ը՝
|
||||
կարգաբերելով մոտավորապես 40M։ </li>
|
||||
<li>Որոշ PHP սպասարկիչներում Moodle դիրեկտորիայում կարող եք ստեղծել .htaccess ֆայլը, որը պարունակում է այս տողը՝
|
||||
<blockquote><div>php_value memory_limit 40M</div></blockquote>
|
||||
<p>Սակայն որոշ սպասարկիչներում սա կկանխարգելի <b>բոլոր</b> PHP էջերի աշխատելը
|
||||
<p>Սակայն որոշ սպասարկիչներում սա կկանխարգելի <b>բոլոր</b> PHP էջերի աշխատելը
|
||||
(դուք կտեսնեք սխալներ էջերը դիտելիս), այսպիսով դուք պետք է ջնջեք .htaccess ֆայլը։</p></li>
|
||||
</ol>';
|
||||
$string['phpversion'] = 'PHP տարբերակ';
|
||||
@@ -64,7 +64,7 @@ $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> փաթեթը
|
||||
$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>-ի կարգաբերման հաջորդ քայլին:';
|
||||
|
||||
@@ -38,21 +38,21 @@ $string['dirroot'] = 'Moodle-ის დირექტორია';
|
||||
$string['installation'] = 'ინსტალირება';
|
||||
$string['memorylimithelp'] = '<p>The PHP memory limit for your server is currently set to {$a}.</p>
|
||||
|
||||
<p>This may cause Moodle to have memory problems later on, especially
|
||||
<p>This may cause Moodle to have memory problems later on, especially
|
||||
if you have a lot of modules enabled and/or a lot of users.</p>
|
||||
|
||||
<p>We recommend that you configure PHP with a higher limit if possible, like 40M.
|
||||
<p>We recommend that you configure PHP with a higher limit if possible, like 40M.
|
||||
There are several ways of doing this that you can try:</p>
|
||||
<ol>
|
||||
<li>If you are able to, recompile PHP with <i>--enable-memory-limit</i>.
|
||||
<li>If you are able to, recompile PHP with <i>--enable-memory-limit</i>.
|
||||
This will allow Moodle to set the memory limit itself.</li>
|
||||
<li>If you have access to your php.ini file, you can change the <b>memory_limit</b>
|
||||
setting in there to something like 40M. If you don\'t have access you might
|
||||
<li>If you have access to your php.ini file, you can change the <b>memory_limit</b>
|
||||
setting in there to something like 40M. If you don\'t have access you might
|
||||
be able to ask your administrator to do this for you.</li>
|
||||
<li>On some PHP servers you can create a .htaccess file in the Moodle directory
|
||||
<li>On some PHP servers you can create a .htaccess file in the Moodle directory
|
||||
containing this line:
|
||||
<p><blockquote>php_value memory_limit 40M</blockquote></p>
|
||||
<p>However, on some servers this will prevent <b>all</b> PHP pages from working
|
||||
<p>However, on some servers this will prevent <b>all</b> PHP pages from working
|
||||
(you will see errors when you look at pages) so you\'ll have to remove the .htaccess file.</p></li>
|
||||
</ol>';
|
||||
$string['phpversion'] = 'PHP ვარიანტი';
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user