mirror of
https://github.com/moodle/moodle.git
synced 2025-04-14 04:52:36 +02:00
Merge branch 'MDL-44739-master' of git://github.com/FMCorz/moodle
This commit is contained in:
commit
0b5f523164
47
theme/more/db/install.php
Normal file
47
theme/more/db/install.php
Normal file
@ -0,0 +1,47 @@
|
||||
<?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/>.
|
||||
|
||||
/**
|
||||
* Theme More install.
|
||||
*
|
||||
* @package theme_more
|
||||
* @copyright 2014 Frédéric Massart
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
|
||||
defined('MOODLE_INTERNAL') || die();
|
||||
|
||||
/**
|
||||
* Theme_more install function.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
function xmldb_theme_more_install() {
|
||||
global $CFG;
|
||||
|
||||
// Set the default background.
|
||||
$fs = get_file_storage();
|
||||
|
||||
$filerecord = new stdClass();
|
||||
$filerecord->component = 'theme_more';
|
||||
$filerecord->contextid = context_system::instance()->id;
|
||||
$filerecord->userid = get_admin()->id;
|
||||
$filerecord->filearea = 'backgroundimage';
|
||||
$filerecord->filepath = '/';
|
||||
$filerecord->itemid = 0;
|
||||
$filerecord->filename = 'background.jpg';
|
||||
$fs->create_file_from_pathname($filerecord, $CFG->dirroot . '/theme/more/pix/background.jpg');
|
||||
}
|
60
theme/more/db/upgrade.php
Normal file
60
theme/more/db/upgrade.php
Normal file
@ -0,0 +1,60 @@
|
||||
<?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/>.
|
||||
|
||||
/**
|
||||
* Theme More upgrade.
|
||||
*
|
||||
* @package theme_more
|
||||
* @copyright 2014 Frédéric Massart
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
|
||||
defined('MOODLE_INTERNAL') || die();
|
||||
|
||||
/**
|
||||
* Theme_more upgrade function.
|
||||
*
|
||||
* @param int $oldversion The version we upgrade from.
|
||||
* @return bool
|
||||
*/
|
||||
function xmldb_theme_more_upgrade($oldversion) {
|
||||
global $CFG;
|
||||
|
||||
if ($oldversion < 2014032400) {
|
||||
|
||||
// Set the default background. If an image is already there then ignore.
|
||||
$fs = get_file_storage();
|
||||
$bg = $fs->get_area_files(context_system::instance()->id, 'theme_more', 'backgroundimage', 0);
|
||||
|
||||
// Add default background image.
|
||||
if (empty($bg)) {
|
||||
$filerecord = new stdClass();
|
||||
$filerecord->component = 'theme_more';
|
||||
$filerecord->contextid = context_system::instance()->id;
|
||||
$filerecord->userid = get_admin()->id;
|
||||
$filerecord->filearea = 'backgroundimage';
|
||||
$filerecord->filepath = '/';
|
||||
$filerecord->itemid = 0;
|
||||
$filerecord->filename = 'background.jpg';
|
||||
$fs->create_file_from_pathname($filerecord, $CFG->dirroot . '/theme/more/pix/background.jpg');
|
||||
}
|
||||
|
||||
upgrade_plugin_savepoint(true, 2014032400, 'theme', 'more');
|
||||
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
BIN
theme/more/pix/background.jpg
Normal file
BIN
theme/more/pix/background.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 4.3 KiB |
@ -39,7 +39,7 @@ if ($ADMIN->fulltree) {
|
||||
$name = 'theme_more/textcolor';
|
||||
$title = get_string('textcolor', 'theme_more');
|
||||
$description = get_string('textcolor_desc', 'theme_more');
|
||||
$default = '';
|
||||
$default = '#333366';
|
||||
$setting = new admin_setting_configcolourpicker($name, $title, $description, $default);
|
||||
$setting->set_updatedcallback('theme_reset_all_caches');
|
||||
$settings->add($setting);
|
||||
@ -48,7 +48,7 @@ if ($ADMIN->fulltree) {
|
||||
$name = 'theme_more/linkcolor';
|
||||
$title = get_string('linkcolor', 'theme_more');
|
||||
$description = get_string('linkcolor_desc', 'theme_more');
|
||||
$default = '';
|
||||
$default = '#FF6500';
|
||||
$setting = new admin_setting_configcolourpicker($name, $title, $description, $default);
|
||||
$setting->set_updatedcallback('theme_reset_all_caches');
|
||||
$settings->add($setting);
|
||||
@ -74,7 +74,7 @@ if ($ADMIN->fulltree) {
|
||||
$name = 'theme_more/backgroundrepeat';
|
||||
$title = get_string('backgroundrepeat', 'theme_more');
|
||||
$description = get_string('backgroundrepeat_desc', 'theme_more');;
|
||||
$default = '0';
|
||||
$default = 'repeat';
|
||||
$choices = array(
|
||||
'0' => get_string('default'),
|
||||
'repeat' => get_string('backgroundrepeatrepeat', 'theme_more'),
|
||||
@ -119,7 +119,7 @@ if ($ADMIN->fulltree) {
|
||||
$name = 'theme_more/contentbackground';
|
||||
$title = get_string('contentbackground', 'theme_more');
|
||||
$description = get_string('contentbackground_desc', 'theme_more');
|
||||
$default = '';
|
||||
$default = '#FFFFFF';
|
||||
$setting = new admin_setting_configcolourpicker($name, $title, $description, $default);
|
||||
$setting->set_updatedcallback('theme_reset_all_caches');
|
||||
$settings->add($setting);
|
||||
@ -128,7 +128,7 @@ if ($ADMIN->fulltree) {
|
||||
$name = 'theme_more/secondarybackground';
|
||||
$title = get_string('secondarybackground', 'theme_more');
|
||||
$description = get_string('secondarybackground_desc', 'theme_more');
|
||||
$default = '';
|
||||
$default = '#FFFFFF';
|
||||
$setting = new admin_setting_configcolourpicker($name, $title, $description, $default);
|
||||
$setting->set_updatedcallback('theme_reset_all_caches');
|
||||
$settings->add($setting);
|
||||
@ -137,7 +137,7 @@ if ($ADMIN->fulltree) {
|
||||
$name = 'theme_more/invert';
|
||||
$title = get_string('invert', 'theme_more');
|
||||
$description = get_string('invertdesc', 'theme_more');
|
||||
$setting = new admin_setting_configcheckbox($name, $title, $description, 0);
|
||||
$setting = new admin_setting_configcheckbox($name, $title, $description, 1);
|
||||
$setting->set_updatedcallback('theme_reset_all_caches');
|
||||
$settings->add($setting);
|
||||
|
||||
|
@ -24,7 +24,7 @@
|
||||
|
||||
defined('MOODLE_INTERNAL') || die;
|
||||
|
||||
$plugin->version = 2014031800;
|
||||
$plugin->version = 2014032400;
|
||||
$plugin->requires = 2013110500;
|
||||
$plugin->component = 'theme_more';
|
||||
$plugin->dependencies = array(
|
||||
|
Loading…
x
Reference in New Issue
Block a user