當前位置: 首頁>>代碼示例>>PHP>>正文


PHP core_plugin_manager::available_updates方法代碼示例

本文整理匯總了PHP中core_plugin_manager::available_updates方法的典型用法代碼示例。如果您正苦於以下問題:PHP core_plugin_manager::available_updates方法的具體用法?PHP core_plugin_manager::available_updates怎麽用?PHP core_plugin_manager::available_updates使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在core_plugin_manager的用法示例。


在下文中一共展示了core_plugin_manager::available_updates方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: plugins_overview_panel

 /**
  * Prints an overview about the plugins - number of installed, number of extensions etc.
  *
  * @param core_plugin_manager $pluginman provides information about the plugins
  * @param array $options filtering options
  * @return string as usually
  */
 public function plugins_overview_panel(core_plugin_manager $pluginman, array $options = array())
 {
     $plugininfo = $pluginman->get_plugins();
     $numtotal = $numextension = $numupdatable = 0;
     foreach ($plugininfo as $type => $plugins) {
         foreach ($plugins as $name => $plugin) {
             if ($plugin->available_updates()) {
                 $numupdatable++;
             }
             if ($plugin->get_status() === core_plugin_manager::PLUGIN_STATUS_MISSING) {
                 continue;
             }
             $numtotal++;
             if (!$plugin->is_standard()) {
                 $numextension++;
             }
         }
     }
     $infoall = html_writer::link(new moodle_url($this->page->url, array('contribonly' => 0, 'updatesonly' => 0)), get_string('overviewall', 'core_plugin'), array('title' => get_string('filterall', 'core_plugin'))) . ' ' . html_writer::span($numtotal, 'badge number number-all');
     $infoext = html_writer::link(new moodle_url($this->page->url, array('contribonly' => 1, 'updatesonly' => 0)), get_string('overviewext', 'core_plugin'), array('title' => get_string('filtercontribonly', 'core_plugin'))) . ' ' . html_writer::span($numextension, 'badge number number-additional');
     if ($numupdatable) {
         $infoupdatable = html_writer::link(new moodle_url($this->page->url, array('contribonly' => 0, 'updatesonly' => 1)), get_string('overviewupdatable', 'core_plugin'), array('title' => get_string('filterupdatesonly', 'core_plugin'))) . ' ' . html_writer::span($numupdatable, 'badge badge-info number number-updatable');
     } else {
         // No updates, or the notifications disabled.
         $infoupdatable = '';
     }
     $out = html_writer::start_div('', array('id' => 'plugins-overview-panel'));
     if (!empty($options['updatesonly'])) {
         $out .= $this->output->heading(get_string('overviewupdatable', 'core_plugin'), 3);
     } else {
         if (!empty($options['contribonly'])) {
             $out .= $this->output->heading(get_string('overviewext', 'core_plugin'), 3);
         }
     }
     if ($numupdatable) {
         $installableupdates = $pluginman->filter_installable($pluginman->available_updates());
         if ($installableupdates) {
             $out .= $this->output->single_button(new moodle_url($this->page->url, array('installupdatex' => 1)), get_string('updateavailableinstallall', 'core_admin', count($installableupdates)), 'post', array('class' => 'singlebutton updateavailableinstallall'));
         }
     }
     $out .= html_writer::div($infoall, 'info info-all') . html_writer::div($infoext, 'info info-ext') . html_writer::div($infoupdatable, 'info info-updatable');
     $out .= html_writer::end_div();
     // End of #plugins-overview-panel block.
     return $out;
 }
開發者ID:jeffthestampede,項目名稱:excelsior,代碼行數:52,代碼來源:renderer.php


注:本文中的core_plugin_manager::available_updates方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。