Browse Source

Coding guideline fixes

MOODLE_23_STABLE
Dan Marsden 12 years ago
parent
commit
a68be60db2
  1. 14
      add_form.php
  2. 8
      duration_form.php
  3. 5
      export.php
  4. 8
      export_form.php
  5. 23
      index.php
  6. 10
      lib.php
  7. 8
      locallib.php
  8. 5
      manage.php
  9. 8
      mod_form.php
  10. 5
      preferences.php
  11. 4
      renderables.php
  12. 4
      renderer.php
  13. 4
      renderhelpers.php
  14. 5
      report.php
  15. 5
      sessions.php
  16. 8
      take.php
  17. 9
      update_form.php
  18. 7
      version.php
  19. 4
      view.php

14
add_form.php

@ -14,11 +14,19 @@
// 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 add
*
* @package mod_attendance
* @copyright 2011 Artem Andreev <andreev.artem@gmail.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
require_once($CFG->libdir.'/formslib.php');
class mod_attforblock_add_form extends moodleform {
function definition() {
public function definition() {
global $CFG, $USER;
$mform =& $this->_form;
@ -27,9 +35,7 @@ class mod_attforblock_add_form extends moodleform {
$cm = $this->_customdata['cm'];
$modcontext = $this->_customdata['modcontext'];
$mform->addElement('header', 'general', get_string('addsession','attforblock'));//fill in the data depending on page params
//later using set_data
$mform->addElement('header', 'general', get_string('addsession','attforblock'));
$groupmode = groups_get_activity_groupmode($cm);
switch ($groupmode) {

8
duration_form.php

@ -14,6 +14,14 @@
// 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 for duration
*
* @package mod_attendance
* @copyright 2011 Artem Andreev <andreev.artem@gmail.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
require_once($CFG->libdir.'/formslib.php');
class mod_attforblock_duration_form extends moodleform {

5
export.php

@ -17,12 +17,11 @@
/**
* Export attendance sessions
*
* @package mod
* @subpackage attforblock
* @package mod_attendance
* @copyright 2011 Artem Andreev <andreev.artem@gmail.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
require_once(dirname(__FILE__).'/../../config.php');
require_once(dirname(__FILE__).'/locallib.php');
require_once(dirname(__FILE__).'/export_form.php');

8
export_form.php

@ -14,6 +14,14 @@
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* Export attendance sessions forms
*
* @package mod_attendance
* @copyright 2011 Artem Andreev <andreev.artem@gmail.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
require_once($CFG->libdir.'/formslib.php');
class mod_attforblock_export_form extends moodleform {

23
index.php

@ -14,19 +14,24 @@
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/// This page lists all the instances of attforblock in a particular course
/// Replace attforblock with the name of your module
/**
* lists all the instances of attforblock in a particular course
*
* @package mod_attendance
* @copyright 2011 Artem Andreev <andreev.artem@gmail.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
require_once('../../config.php');
require_once('../../config.php');
$id = required_param('id', PARAM_INT); // Course id
$id = required_param('id', PARAM_INT); // Course id
if (! $course = $DB->get_record('course', array('id'=> $id))) {
if (! $course = $DB->get_record('course', array('id'=> $id))) {
error('Course ID is incorrect');
}
}
if ($att = array_pop(get_all_instances_in_course('attforblock', $course, NULL, true))) {
if ($att = array_pop(get_all_instances_in_course('attforblock', $course, NULL, true))) {
redirect("view.php?id=$att->coursemodule");
} else {
} else {
print_error('notfound', 'attforblock');
}
}

10
lib.php

@ -14,7 +14,13 @@
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/// Library of functions and constants for module attforblock
/**
* Library of functions and constants for module attforblock
*
* @package mod_attendance
* @copyright 2011 Artem Andreev <andreev.artem@gmail.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
/**
* Returns the information if the module supports a feature
@ -68,7 +74,7 @@ function attforblock_add_instance($attforblock) {
att_add_default_statuses($attforblock->id);
attforblock_grade_item_update($attforblock);
// attforblock_update_grades($attforblock);
//attforblock_update_grades($attforblock);
return $attforblock->id;
}

8
locallib.php

@ -14,6 +14,14 @@
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* local functions and constants for module attforblock
*
* @package mod_attendance
* @copyright 2011 Artem Andreev <andreev.artem@gmail.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();
global $CFG;

5
manage.php

@ -17,12 +17,11 @@
/**
* Manage attendance sessions
*
* @package mod
* @subpackage attforblock
* @package mod_attforblock
* @copyright 2011 Artem Andreev <andreev.artem@gmail.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
require_once(dirname(__FILE__).'/../../config.php');
require_once(dirname(__FILE__).'/locallib.php');

8
mod_form.php

@ -14,6 +14,14 @@
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* Forms for updating/adding attforblock
*
* @package mod_attforblock
* @copyright 2011 Artem Andreev <andreev.artem@gmail.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
if (!defined('MOODLE_INTERNAL')) {
die('Direct access to this script is forbidden.'); /// It must be included from a Moodle page
}

5
preferences.php

@ -17,12 +17,11 @@
/**
* Manage attendance settings
*
* @package mod
* @subpackage attforblock
* @package mod_attforblock
* @copyright 2011 Artem Andreev <andreev.artem@gmail.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
require_once(dirname(__FILE__).'/../../config.php');
require_once(dirname(__FILE__).'/locallib.php');

4
renderables.php

@ -17,8 +17,8 @@
/**
* Attendance module renderable components are defined here
*
* @package mod
* @subpackage attforblock
* @package mod_attforblock
* @copyright 2011 Artem Andreev <andreev.artem@gmail.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/

4
renderer.php

@ -17,8 +17,8 @@
/**
* Attendance module renderering methods
*
* @package mod
* @subpackage attforblock
* @package mod_attforblock
* @copyright 2011 Artem Andreev <andreev.artem@gmail.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/

4
renderhelpers.php

@ -17,8 +17,8 @@
/**
* Attendance module renderering helpers
*
* @package mod
* @subpackage attforblock
* @package mod_attforblock
* @copyright 2011 Artem Andreev <andreev.artem@gmail.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/

5
report.php

@ -17,12 +17,11 @@
/**
* Attendance report
*
* @package mod
* @subpackage attforblock
* @package mod_attforblock
* @copyright 2011 Artem Andreev <andreev.artem@gmail.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
require_once(dirname(__FILE__).'/../../config.php');
require_once(dirname(__FILE__).'/locallib.php');

5
sessions.php

@ -17,12 +17,11 @@
/**
* Adding attendance sessions
*
* @package mod
* @subpackage attforblock
* @package mod_attforblock
* @copyright 2011 Artem Andreev <andreev.artem@gmail.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
require_once(dirname(__FILE__).'/../../config.php');
require_once(dirname(__FILE__).'/locallib.php');
require_once(dirname(__FILE__).'/add_form.php');

8
take.php

@ -14,6 +14,14 @@
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* Take Attendance
*
* @package mod_attforblock
* @copyright 2011 Artem Andreev <andreev.artem@gmail.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
require_once(dirname(__FILE__).'/../../config.php');
require_once(dirname(__FILE__).'/locallib.php');

9
update_form.php

@ -14,6 +14,15 @@
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* Update form
*
* @package mod_attforblock
* @copyright 2011 Artem Andreev <andreev.artem@gmail.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
require_once($CFG->libdir.'/formslib.php');
class mod_attforblock_update_form extends moodleform {

7
version.php

@ -17,13 +17,14 @@
/**
* Version information
*
* @package mod
* @subpackage attforblock
* @package mod_attforblock
* @copyright 2011 Artem Andreev <andreev.artem@gmail.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
$module->version = 2012120700; // The current module version (Date: YYYYMMDDXX)
$module->release = '2.4.0';
$module->requires = 2012120300;
$module->release = '2.4.1';
$module->maturity = MATURITY_ALPHA;
$module->cron = 0; // Period for cron to check this module (secs)
$module->component = 'mod_attforblock'; // Full name of the plugin (used for diagnostics)

4
view.php

@ -17,8 +17,8 @@
/**
* Prints attendance info for particular user
*
* @package mod
* @subpackage attforblock
* @package mod_attforblock
* @copyright 2011 Artem Andreev <andreev.artem@gmail.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/

Loading…
Cancel
Save