// along with Moodle. If not, see <http://www.gnu.org/licenses/>. /** * List the tool provided in a course * * @package local * @subpackage programs * @copyright 2013 Vinodkumar <*****@*****.**> * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ require_once(dirname(__FILE__) . '/../../config.php'); require_once($CFG->dirroot . '/local/mentor/lib.php'); $currenttab = optional_param('mode', 'view', PARAM_RAW); global $CFG, $USER; $mymentor = mentor::getInstance(); $systemcontext =context_system::instance(); require_login(); //print_object($systemcontext); $mentor = false; if (has_capability('local/clclasses:approvemystudentclclasses', $systemcontext)) { $mentor = true; //}else if(has_capability('clclasses:approvemystudentclclasses', $systemcontext)){ // $mentor = false ; } else { print_error('You dont have permissions'); } //get the admin layout $PAGE->set_pagelayout('admin'); //check the context level of the user and check weather the user is login to the system or not
public static function getInstance() { if (!self::$_mentor) { self::$_mentor = new mentor(); } return self::$_mentor; }