Exemplo n.º 1
0
 /**
  * Acutally commit the collected requirements to a given OutputPage object that
  * will later generate the HTML output. This makes sure that HTML output contains
  * all required output items. Note that there is no parser caching at this level of
  * processing. In particular, data should not be committed to $wgOut in methods
  * that run during page parsing, since these would not run next time when the page
  * is produced from parser cache.
  *
  * @param OutputPage $output
  */
 public static function commitToOutputPage(OutputPage $output)
 {
     foreach (self::$scripts as $script) {
         $output->addScript($script);
     }
     foreach (self::$headItems as $key => $item) {
         $output->addHeadItem($key, "\t\t" . $item . "\n");
     }
     $output->addModules(array_values(self::$resourceModules));
     self::$resourceModules = array();
     self::$headItems = array();
 }
Exemplo n.º 2
0
 /**
  * Acutally commit the collected requirements to a given OutputPage object that
  * will later generate the HTML output. This makes sure that HTML output contains
  * all required output items. Note that there is no parser caching at this level of
  * processing. In particular, data should not be committed to $wgOut in methods
  * that run during page parsing, since these would not run next time when the page
  * is produced from parser cache.
  *
  * @param OutputPage $output
  */
 public static function commitToOutputPage(OutputPage $output)
 {
     foreach (self::$scripts as $script) {
         $output->addScript($script);
     }
     foreach (self::$headItems as $key => $item) {
         $output->addHeadItem($key, "\t\t" . $item . "\n");
     }
     // Check if the resource loader can be used or not.
     if (method_exists($output, 'addModules')) {
         $output->addModules(array_values(self::$resourceModules));
     } else {
         self::addModulesBC($output);
     }
     self::$resourceModules = array();
     self::$headItems = array();
 }