Merge "Travis CI: Drop 5.3 as a build target"
[lhc/web/wiklou.git] / includes / SkinTemplate.php
index e8fa944..86bd979 100644 (file)
@@ -86,12 +86,6 @@ class SkinTemplate extends Skin {
         */
        public $template = 'QuickTemplate';
 
-       /**
-        * @var bool Whether this skin use OutputPage::headElement() to generate
-        *   the "<head>" tag.
-        */
-       public $useHeadElement = false;
-
        /**
         * Add specific styles for this skin
         *
@@ -111,8 +105,8 @@ class SkinTemplate extends Skin {
         * roughly equivalent to PHPTAL 0.7.
         *
         * @param string $classname
-        * @param string $repository Subdirectory where we keep template files
-        * @param string $cache_dir
+        * @param bool|string $repository Subdirectory where we keep template files
+        * @param bool|string $cache_dir
         * @return QuickTemplate
         * @private
         */
@@ -290,26 +284,6 @@ class SkinTemplate extends Skin {
                $out = $this->getOutput();
                $tpl = $this->setupTemplateForOutput();
 
-               wfProfileIn( __METHOD__ . '-stuff-head' );
-               if ( !$this->useHeadElement ) {
-                       $tpl->set( 'pagecss', false );
-                       $tpl->set( 'usercss', false );
-
-                       $tpl->set( 'userjs', false );
-                       $tpl->set( 'userjsprev', false );
-
-                       $tpl->set( 'jsvarurl', false );
-
-                       $tpl->set( 'xhtmldefaultnamespace', 'http://www.w3.org/1999/xhtml' );
-                       $tpl->set( 'xhtmlnamespaces', $wgXhtmlNamespaces );
-                       $tpl->set( 'html5version', $wgHtml5Version );
-                       $tpl->set( 'headlinks', $out->getHeadLinks() );
-                       $tpl->set( 'csslinks', $out->buildCssLinks() );
-                       $tpl->set( 'pageclass', $this->getPageClasses( $title ) );
-                       $tpl->set( 'skinnameclass', ( 'skin-' . Sanitizer::escapeClass( $this->getSkinName() ) ) );
-               }
-               wfProfileOut( __METHOD__ . '-stuff-head' );
-
                wfProfileIn( __METHOD__ . '-stuff2' );
                $tpl->set( 'title', $out->getPageTitle() );
                $tpl->set( 'pagetitle', $out->getHTMLTitle() );
@@ -540,11 +514,7 @@ class SkinTemplate extends Skin {
                $tpl->set( 'nav_urls', $this->buildNavUrls() );
 
                // Set the head scripts near the end, in case the above actions resulted in added scripts
-               if ( $this->useHeadElement ) {
-                       $tpl->set( 'headelement', $out->headElement( $this ) );
-               } else {
-                       $tpl->set( 'headscripts', $out->getHeadScripts() . $out->getHeadItems() );
-               }
+               $tpl->set( 'headelement', $out->headElement( $this ) );
 
                $tpl->set( 'debug', '' );
                $tpl->set( 'debughtml', $this->generateDebugHTML() );
@@ -1212,10 +1182,10 @@ class SkinTemplate extends Skin {
 
        /**
         * an array of edit links by default used for the tabs
+        * @param $content_navigation
         * @return array
-        * @private
         */
-       function buildContentActionUrls( $content_navigation ) {
+       private function buildContentActionUrls( $content_navigation ) {
 
                wfProfileIn( __METHOD__ );
 
@@ -1226,9 +1196,7 @@ class SkinTemplate extends Skin {
                $content_actions = array();
 
                foreach ( $content_navigation as $links ) {
-
                        foreach ( $links as $key => $value ) {
-
                                if ( isset( $value['redundant'] ) && $value['redundant'] ) {
                                        // Redundant tabs are dropped from content_actions
                                        continue;
@@ -1249,9 +1217,7 @@ class SkinTemplate extends Skin {
                                }
 
                                $content_actions[$key] = $value;
-
                        }
-
                }
 
                wfProfileOut( __METHOD__ );
@@ -1262,7 +1228,6 @@ class SkinTemplate extends Skin {
        /**
         * build array of common navigation links
         * @return array
-        * @private
         */
        protected function buildNavUrls() {
                global $wgUploadNavigationUrl;
@@ -1379,9 +1344,8 @@ class SkinTemplate extends Skin {
        /**
         * Generate strings used for xml 'id' names
         * @return string
-        * @private
         */
-       function getNameSpaceKey() {
+       protected function getNameSpaceKey() {
                return $this->getTitle()->getNamespaceKey();
        }
 }
@@ -2048,6 +2012,7 @@ abstract class BaseTemplate extends QuickTemplate {
         * If you pass "flat" as an option then the returned array will be a flat array
         * of footer icons instead of a key/value array of footerlinks arrays broken
         * up into categories.
+        * @param string $option
         * @return array|mixed
         */
        function getFooterLinks( $option = null ) {
@@ -2087,6 +2052,7 @@ abstract class BaseTemplate extends QuickTemplate {
         * in the list of footer icons. This is mostly useful for skins which only
         * display the text from footericons instead of the images and don't want a
         * duplicate copyright statement because footerlinks already rendered one.
+        * @param string $option
         * @return string
         */
        function getFooterIcons( $option = null ) {
@@ -2129,5 +2095,4 @@ abstract class BaseTemplate extends QuickTemplate {
 <?php $this->html( 'reporttime' ) ?>
 <?php
        }
-
 }