コード例 #1
0
ファイル: index.php プロジェクト: anilch/Personel
// 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 <avinod@eabyas.in>
 * @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
コード例 #2
0
ファイル: lib.php プロジェクト: anilch/Personel
 public static function getInstance() {
     if (!self::$_mentor) {
         self::$_mentor = new mentor();
     }
     return self::$_mentor;
 }