コード例 #1
0
 /**
  * Check the ghostscript path is valid to see if the plugin should be enabled.
  * @return bool
  */
 public function is_enabled()
 {
     global $CFG;
     static $gspathok = null;
     if (is_null($gspathok)) {
         require_once $CFG->dirroot . '/mod/assign/feedback/pdf/mypdflib.php';
         $result = AssignPDFLib::test_gs_path(false);
         $gspathok = $result->status == AssignPDFLib::GSPATH_OK;
         if (!$gspathok && $this->is_visible()) {
             // Setting 'gspath' is invalid, so the plugin should be globally disabled.
             set_config('disabled', true, $this->get_subtype() . '_' . $this->get_type());
         }
     }
     if (!parent::is_enabled()) {
         return false;
     }
     return $gspathok;
 }
コード例 #2
0
ファイル: locallib.php プロジェクト: pzhu2004/moodle
 /**
  * Override the default is_enabled to disable this plugin if advanced grading is active
  *
  * @return bool
  */
 public function is_enabled()
 {
     if ($this->enabledcache === null) {
         $gradingmanager = get_grading_manager($this->assignment->get_context(), 'mod_assign', 'submissions');
         $controller = $gradingmanager->get_active_controller();
         $active = !empty($controller);
         if ($active) {
             $this->enabledcache = false;
         } else {
             $this->enabledcache = parent::is_enabled();
         }
     }
     return $this->enabledcache;
 }
コード例 #3
0
ファイル: locallib.php プロジェクト: eugeneventer/o365-moodle
 /**
  * Automatically hide the setting for the submission plugin.
  *
  * @return bool
  */
 public function is_configurable()
 {
     if ($this->isonfrontpage() === true) {
         return false;
     }
     return parent::is_configurable();
 }