Skip to content

Commit

Permalink
V2.3.3
Browse files Browse the repository at this point in the history
  • Loading branch information
gjb2048 committed Aug 22, 2013
1 parent 45fbd13 commit 6a58b09
Show file tree
Hide file tree
Showing 11 changed files with 167 additions and 118 deletions.
63 changes: 35 additions & 28 deletions backup/moodle2/restore_format_grid_plugin.class.php
@@ -1,4 +1,18 @@
<?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/>.

/**
* Grid Information
Expand All @@ -10,18 +24,6 @@
* @author G J Barnard - gjbarnard at gmail dot com and {@link http://moodle.org/user/profile.php?id=442195}
* @license http://www.gnu.org/copyleft/gpl.html GNU Public License
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
defined('MOODLE_INTERNAL') || die();
require_once($CFG->dirroot . '/course/format/grid/lib.php');
Expand All @@ -41,17 +43,19 @@ protected function define_course_plugin_structure() {

// Add own format stuff.
$elename = 'grid'; // This defines the postfix of 'process_*' below.
/* This is defines the nested tag within 'plugin_format_grid_course' to allow '/course/plugin_format_grid_course' in the path
therefore as a path structure representing the levels in section.xml in the backup file. */
$elepath = $this->get_pathfor('/');
/*
* This is defines the nested tag within 'plugin_format_grid_course' to allow '/course/plugin_format_grid_course' in
* the path therefore as a path structure representing the levels in section.xml in the backup file.
*/
$elepath = $this->get_pathfor('/');
$paths[] = new restore_path_element($elename, $elepath);

return $paths; // And we return the interesting paths.
}

/**
* Process the 'plugin_format_grid_course' element within the 'course' element in the 'course.xml' file in the '/course' folder
* of the zipped backup 'mbz' file.
* Process the 'plugin_format_grid_course' element within the 'course' element in the 'course.xml' file in the '/course'
* folder of the zipped backup 'mbz' file.
*/
public function process_grid($data) {
global $DB;
Expand Down Expand Up @@ -85,24 +89,27 @@ protected function define_section_plugin_structure() {

$paths = array();

// Add own format stuff
// Add own format stuff.
$elename = 'gridsection'; // This defines the postfix of 'process_*' below.
/* This is defines the nested tag within 'plugin_format_grid_section' to allow '/section/plugin_format_grid_section' in the path therefore as
a path structure representing the levels in section.xml in the backup file. */
/* This is defines the nested tag within 'plugin_format_grid_section' to allow '/section/plugin_format_grid_section' in
* the path therefore as a path structure representing the levels in section.xml in the backup file.
*/
$elepath = $this->get_pathfor('/');
$paths[] = new restore_path_element($elename, $elepath);

return $paths; // And we return the interesting paths
return $paths; // And we return the interesting paths.
}

/**
* Process the 'plugin_format_grid_section' element within the 'section' element in the 'section.xml' file in the '/sections/section_sectionid' folder
* of the zipped backup 'mbz' file.
* Discovered that the files are contained in the course repository with the new section number, so we just need to alter to the new value if any.
* This was undertaken by performing a restore and using the url 'http://localhost/moodle23/pluginfile.php/94/course/section/162/mc_fs.png' where
* I had an image called 'mc_fs.png' in section 1 which was id 129 but now 162 as the debug code told me. '94' is just the context id. The url was
* originally created in '_make_block_icon_topics' of lib.php of the format.
* Still need courseid in the 'format_grid_icon' table as it is used in discovering what records to remove when deleting a course, see lib.php 'format_grid_delete_course'.
* Process the 'plugin_format_grid_section' element within the 'section' element in the 'section.xml' file in the
* '/sections/section_sectionid' folder of the zipped backup 'mbz' file.
* Discovered that the files are contained in the course repository with the new section number, so we just need to alter to
* the new value if any. * This was undertaken by performing a restore and using the url
* 'http://localhost/moodle23/pluginfile.php/94/course/section/162/mc_fs.png' where I had an image called 'mc_fs.png' in
* section 1 which was id 129 but now 162 as the debug code told me. '94' is just the context id. The url was originally
* created in '_make_block_icon_topics' of lib.php of the format.
* Still need courseid in the 'format_grid_icon' table as it is used in discovering what records to remove when deleting a
* course, see lib.php 'format_grid_delete_course'.
*/
public function process_gridsection($data) {
global $DB;
Expand Down
6 changes: 6 additions & 0 deletions db/upgrade.php
Expand Up @@ -71,5 +71,11 @@ function xmldb_format_grid_upgrade($oldversion = 0) {

upgrade_plugin_savepoint(true, '2012071500', 'format', 'grid');
}

// Automatic 'Purge all caches'....
if ($oldversion < 2012082201) {
purge_all_caches();
}

return true;
}
6 changes: 3 additions & 3 deletions module.js
Expand Up @@ -88,10 +88,10 @@ function initialize_shadebox() {

var content = document.getElementById('shadebox_content');
content.style.position = 'absolute';
content.style.width = '800px';
content.style.width = '90%';
content.style.top = '50px';
content.style.left = '50%';
content.style.marginLeft = '-400px';
content.style.left = '5%';
//content.style.marginLeft = '-400px';
content.style.zIndex = '9000001';
}

Expand Down
Binary file added pix/icon.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified pix/info.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified pix/new_activity.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified pix/new_activity_blue.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
78 changes: 59 additions & 19 deletions readme.txt
Expand Up @@ -2,22 +2,59 @@ Grid Course Format
============================
Package tested in: Moodle version 2012062504.01 release 2.3.4+ (Build: 20130118)

Required version of Moodle
==========================
Requires Moodle version 2012062504.01 release 2.3.4+ (Build: 20130118) because of MDL-36095.

BETA DEVELOPMENT VERSION - NOT FOR PRODUCTION SITES - Please place comments / feedback on:
http://tracker.moodle.org/browse/CONTRIB-3769 - preferred.
or
http://moodle.org/mod/forum/discuss.php?d=207059

QUICK INSTALL
Please ensure that your hardware and software complies with 'Requirements' in 'Installing Moodle' on
'docs.moodle.org/23/en/Installing_Moodle'.

Installation
============
1. Ensure you have the version of Moodle as stated above in 'Required version of Moodle'. This is essential as the
format relies on underlying core code that is out of my control.
2. Put Moodle in 'Maintenance Mode' (docs.moodle.org/en/admin/setting/maintenancemode) so that there are no
users using it bar you as the administrator - if you have not already done so.
3. Copy 'grid' to '/course/format/' if you have not already done so.
4. Login as an administrator and follow standard the 'plugin' update notification. If needed, go to
'Site administration' -> 'Notifications' if this does not happen.
5. Put Moodle out of Maintenance Mode.

Uninstallation
==============
Download zip package, extract the grid folder and upload this folder into course/format/.

NOTE: If you have previously installed a development version and get the latest code you MUST:
Remove the row with the 'plugin' of 'format_grid' in the 'config_plugins' table and drop the 'format_grid_icon'
and 'format_grid_summary' tables in the database before clicking on 'notifications'.

If upgrade fails, please perform the actions as detailed in the note above.
1. Put Moodle in 'Maintenance Mode' so that there are no users using it bar you as the administrator.
2. It is recommended but not essential to change all of the courses that use the format to another. If this is
not done Moodle will pick the last format in your list of formats to use but display in 'Edit settings' of the
course the first format in the list. You can then set the desired format.
3. In '/course/format/' remove the folder 'grid'.
4. In the database, remove the row with the 'plugin' of 'format_grid' in the 'config_plugins' table and drop the
'format_grid_icon' and 'format_grid_summary' tables.
5. Put Moodle out of Maintenance Mode.

Reporting Issues
================
Before reporting an issue, please ensure that you are running the latest version for your release of Moodle. The primary
release area is located on https://moodle.org/plugins/view.php?plugin=format_grid. It is also essential that you are
operating the required version of Moodle as stated at the top - this is because the format relies on core functionality that
is out of its control.

All 'Grid format' does is integrate with the course page and control it's layout, therefore what may appear to be an issue
with the format is in fact to do with a theme or core component. Please be confident that it is an issue with 'Grid format'
but if in doubt, ask.

We operate a policy that we will fix all genuine issues for free. Improvements are at our discretion. We are happy to make bespoke
customisations / improvements for a negotiated fee. We will endeavour to respond to all requests for support as quickly as possible,
if you require a faster service then offering payment for the service will expedite the response.

It takes time and effort to maintain the format, therefore donations are appreciated.

When reporting an issue you can post in the course format's forum on Moodle.org (currently 'moodle.org/mod/forum/view.php?id=47'),
on Moodle tracker 'tracker.moodle.org' ensuring that you chose the 'Non-core contributed modules' and 'Course Format: Grid'
for the component or contact us direct (details at the bottom).

It is essential that you provide as much information as possible, the critical information being the contents of the format's
version.php file. Other version information such as specific Moodle version, theme name and version also helps. A screen shot
can be really useful in visualising the issue along with any files you consider to be relevant.

MyMobile alterations
====================
Expand Down Expand Up @@ -104,12 +141,6 @@ to:
</div>
</body>


About
=============
Developed by:
Information in:

Files
--------------

Expand Down Expand Up @@ -199,6 +230,15 @@ Change by G J Barnard
1. Changes to 'format.php' and 'renderer.php' to use renamed 'lib.php' -> 'module.js' to use the page requirements manager
such that interaction with the MyMobile theme is reliable when 'MyMobile alterations' above implemented.

22nd August 2013 Version 2.3.3 - Stable
Change by G J Barnard
1. Fixed icon container size relative to icon size.
2. Added 'alt' image attribute information being that of the section name.
3. Fixed CONTRIB-4216 - Error importing quizzes with grid course format.
4. Fixed CONTRIB-4253 - mdl_log queried too often to generate New Activity tag. This has been fixed by using the 'course_sections'
table instead to spot when a new activity / resource has been added since last login.
5. Adapted the width of the shade box such that it is dynamic against the size of the window.

Authors
-------
J Ridden - Moodle profile: https://moodle.org/user/profile.php?id=39680 - Web: http://www.moodleman.net
Expand Down

0 comments on commit 6a58b09

Please sign in to comment.