Example #1
0
 /**
  * setup administrator links and settings
  *
  * @param object $admin
  */
 public static function set_adminsettings($admin)
 {
     $me = new self();
     $me->grab_moodle_globals();
     $context = context_course::instance(SITEID);
     /*  $admin->add('localplugins', new admin_category('atypaxreports', $me->get_string('name')));
             //$admin->add('atypaxreports', new admin_externalpage('pathxmlatypaxreports', $me->get_string('insertpath'), $me->get_config('wwwroot') . '/local/globalmessage/index.php?id=' . SITEID, 'moodle/site:config', false, $context));
     
             $temp = new admin_settingpage('atypaxreportssettings', $me->get_string('wssettings'));
             $temp->add(new admin_setting_configcheckbox('atypaxreportscourseenable', $me->get_string('wsenabledcourse'), $me->get_string('enabledcoursedesc'), 0));
             $temp->add(new admin_setting_configtext('atypaxreportscoursepath', $me->get_string('insertpathcourse'),
                            $me->get_string('insertpathcoursedesc'), null, PARAM_TEXT));
     
     
             $temp->add(new admin_setting_configtext('atypaxreportstoken', $me->get_string('wstoken'),
                            $me->get_string('wstokendesc'), null, PARAM_TEXT));
     
             $admin->add('atypaxreports',$temp);
     
             $admin->add('localplugins', new admin_category('gradespeoplesoft', 'Grades Export to Peoplesoft'));
             $temp = new admin_settingpage('gradespeoplesoftsettings', 'Add web service path');
             $temp->add(new admin_setting_configtext('gradespeoplesoftpath', 'Insert Path',
                            'Path Web service Peoplesoft', null, PARAM_TEXT));
     
             $admin->add('gradespeoplesoft',$temp);*/
 }
Example #2
0
 /**
  * setup administrator links and settings
  *
  * @param object $admin
  */
 public static function set_adminsettings($admin)
 {
     $me = new self();
     $me->grab_moodle_globals();
     $context = context_course::instance(SITEID);
     $admin->add('localplugins', new admin_category('wspeoplesoft', $me->get_string('name')));
     //$admin->add('wspeoplesoft', new admin_externalpage('pathxmlwspeoplesoft', $me->get_string('insertpath'), $me->get_config('wwwroot') . '/local/globalmessage/index.php?id=' . SITEID, 'moodle/site:config', false, $context));
     $temp = new admin_settingpage('wspeoplesoftsettings', $me->get_string('wssettings'));
     $temp->add(new admin_setting_configcheckbox('wspeoplesoftcourseenable', $me->get_string('wsenabledcourse'), $me->get_string('enabledcoursedesc'), 0));
     $temp->add(new admin_setting_configtext('wspeoplesoftcoursepath', $me->get_string('insertpathcourse'), $me->get_string('insertpathcoursedesc'), null, PARAM_TEXT));
     $temp->add(new admin_setting_configcheckbox('wspeoplesoftuserenable', $me->get_string('wsenableduser'), $me->get_string('enableduserdesc'), 0));
     $temp->add(new admin_setting_configtext('wspeoplesoftuserpath', $me->get_string('insertpathuser'), $me->get_string('insertpathuserdesc'), null, PARAM_TEXT));
     $temp->add(new admin_setting_configcheckbox('wspeoplesoftmemberenable', $me->get_string('wsenabledmember'), $me->get_string('enabledmemberdesc'), 0));
     $temp->add(new admin_setting_configtext('wspeoplesoftmemberpath', $me->get_string('insertpathmembers'), $me->get_string('insertpathmemberdesc'), null, PARAM_TEXT));
     $temp->add(new admin_setting_configtext('wspeoplesofttoken', $me->get_string('wstoken'), $me->get_string('wstokendesc'), null, PARAM_TEXT));
     $admin->add('wspeoplesoft', $temp);
 }
 /**
  * Show message
  *
  * @return void
  */
 public static function show_message()
 {
     $me = new self();
     $me->grab_moodle_globals();
     // message is only available to logged in users
     // and the global message must be enabled
     if (!isloggedin() || !$me->get_config('globalmessageenable')) {
         return;
     }
     $uri = me();
     if ($me->get_config('globalmessagedisableforadminpage') && substr($uri, 0, 6) == '/admin') {
         return;
     }
     // dont show the message if the current user is admin
     // and globalmessagedisableforadminrole is true
     $context = context_system::instance();
     if ($me->get_config('globalmessagedisableforadminrole') && has_capability('local/globalmessage:isadminrole', $context)) {
         return;
     }
     $message = $me->model('message')->get_message_incurrentpage(array('user' => $me->get_user(), 'course' => $me->get_course(), 'time' => time()));
     $me->load_file('lib/view.php');
     $view = new moo_globalmessage_view($me);
     echo $view->render_partial('partial/message', array('message' => $message));
 }