Commit 1abfb38a authored by Daniel Neis Araujo's avatar Daniel Neis Araujo

fixing more coding style

parent cf142399
......@@ -15,7 +15,7 @@
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* Newblock block caps.
* Featured coures block main class.
*
* @package block_featuredcourses
* @copyright Daniel Neis <danielneis@gmail.com>
......
......@@ -27,7 +27,7 @@ require_once($CFG->dirroot.'/blocks/featuredcourses/delete_featuredcourse_form.p
$courseid = required_param('courseid', PARAM_INT);
$PAGE->set_url('/blocks/featuredcourses/delete_featuredcourse.php', array('courseid'=>$courseid));
$PAGE->set_url('/blocks/featuredcourses/delete_featuredcourse.php', array('courseid' => $courseid));
$context = context_system::instance();
$PAGE->set_context($context);
......@@ -36,8 +36,7 @@ require_login();
require_capability('block/featuredcourses:addinstance', $context);
$mform = new block_featuredcourses_delete_featuredcourse_form();
$newformdata = array('courseid'=>$courseid,
'confirmdelete'=>'1');
$newformdata = array('courseid' => $courseid, 'confirmdelete' => '1');
$mform->set_data($newformdata);
$formdata = $mform->get_data();
......
......@@ -22,14 +22,12 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU Public License
*/
//It must be included from a Moodle page
if (!defined('MOODLE_INTERNAL')) {
die('Direct access to this script is forbidden.');
}
defined('MOODLE_INTERNAL') || die();
require_once($CFG->libdir.'/formslib.php');
class block_featuredcourses_delete_featuredcourse_form extends moodleform {
public function definition() {
$mform =& $this->_form;
......
<?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/>.
/**
* The block settings.
*
* @package block_featuredcourses
* @copyright Daniel Neis <danielneis@gmail.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();
class block_featuredcourses_edit_form extends block_edit_form {
......@@ -6,6 +30,8 @@ class block_featuredcourses_edit_form extends block_edit_form {
global $CFG;
$mform->addElement('header', 'configheader', get_string('blocksettings', 'block'));
$mform->addElement('static', 'link', get_string('editlink', 'block_featuredcourses', $CFG->wwwroot.'/blocks/featuredcourses/featuredcourses.php'));
$mform->addElement('static', 'link',
get_string('editlink', 'block_featuredcourses',
$CFG->wwwroot.'/blocks/featuredcourses/featuredcourses.php'));
}
}
<?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/>.
/**
* Version details
*
* @package block_featuredcourses
* @copyright Daniel Neis <danielneis@gmail.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
require_once('../../config.php');
require_once($CFG->libdir.'/coursecatlib.php');
......@@ -8,13 +30,13 @@ require_once($CFG->dirroot.'/blocks/featuredcourses/featuredcourses_form.php');
require_login();
$system_context = context_system::instance();
$systemcontext = context_system::instance();
require_capability('block/featuredcourses:addinstance', $system_context);
require_capability('block/featuredcourses:addinstance', $systemcontext);
$PAGE->set_pagelayout('admin');
$PAGE->set_url('/blocks/featuredcourses/featuredcourses.php');
$PAGE->set_context($system_context);
$PAGE->set_context($systemcontext);
$args = array(
'availablecourses' => coursecat::get(0)->get_courses(array('recursive' => true)),
......
<?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/>.
/**
* The list of featured courses form.
*
* @package block_featuredcourses
* @copyright Daniel Neis <danielneis@gmail.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die;
......
......@@ -18,7 +18,7 @@
* Version details
*
* @package block_featuredcourses
* @copyright 1999 onwards Martin Dougiamas (http://dougiamas.com)
* @copyright Daniel Neis <danielneis@gmail.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment