예제 #1
0
파일: renderer.php 프로젝트: nicusX/moodle
 /**
  * Display the plugin management page (admin/plugins.php).
  *
  * @param plugin_manager $pluginman
  * @param available_update_checker $checker
  * @return string HTML to output.
  */
 public function plugin_management_page(plugin_manager $pluginman, available_update_checker $checker)
 {
     global $CFG;
     $output = '';
     $output .= $this->header();
     $output .= $this->heading(get_string('pluginsoverview', 'core_admin'));
     $output .= $this->plugins_overview_panel($pluginman);
     if (empty($CFG->disableupdatenotifications)) {
         $output .= $this->container_start('checkforupdates');
         $output .= $this->single_button(new moodle_url($this->page->url, array('fetchremote' => 1)), get_string('checkforupdates', 'core_plugin'));
         if ($timefetched = $checker->get_last_timefetched()) {
             $output .= $this->container(get_string('checkforupdateslast', 'core_plugin', userdate($timefetched, get_string('strftimedatetime', 'core_langconfig'))));
         }
         $output .= $this->container_end();
     }
     $output .= $this->box($this->plugins_control_panel($pluginman), 'generalbox');
     $output .= $this->footer();
     return $output;
 }
예제 #2
0
 public function get_last_timefetched() {
     if ($this->fakerecentfetch == -1) {
         return parent::get_last_timefetched();
     } else {
         return $this->fakerecentfetch;
     }
 }
 /**
  * Display the upgrade page that lists all the plugins that require attention.
  * @param plugin_manager $pluginman provides information about the plugins.
  * @param available_update_checker $checker provides information about available updates.
  * @param int $version the version of the Moodle code from version.php.
  * @param bool $showallplugins
  * @param moodle_url $reloadurl
  * @param moodle_url $continueurl
  * @return string HTML to output.
  */
 public function upgrade_plugin_check_page(plugin_manager $pluginman, available_update_checker $checker, $version, $showallplugins, $reloadurl, $continueurl)
 {
     global $CFG;
     $output = $this->header();
     $output .= html::p(get_string('pluginchecknotice', 'core_plugin'));
     if (empty($CFG->disableupdatenotifications)) {
         $output .= $this->single_button(new moodle_url($reloadurl, array('fetchupdates' => 1)), get_string('checkforupdates', 'core_plugin'));
         if ($timefetched = $checker->get_last_timefetched()) {
             $output .= get_string('checkforupdateslast', 'core_plugin', userdate($timefetched, get_string('strftimedatetime', 'core_langconfig')));
         }
     }
     $output .= $this->plugins_check_table($pluginman, $version, array('full' => $showallplugins));
     $output .= $this->upgrade_reload($reloadurl);
     if ($pluginman->some_plugins_updatable()) {
         $output .= bootstrap::alert_info($this->help_icon('upgradepluginsinfo', 'core_admin', get_string('upgradepluginsfirst', 'core_admin')));
     }
     $button = new single_button($continueurl, get_string('upgradestart', 'admin'), 'get');
     $button->class = 'btn btn-primary';
     $output .= $this->render($button);
     $output .= $this->footer();
     return $output;
 }