Hello Folks,

I hope someone can help with a 1.23.8 to  MW 1.24 upgrade and a custom
skin I am trying to convert. It is a very basic custom skin based on
Vector I "authored" a while ago, but without a proper understanding and
with lots of help from this list.

I get no output (blank) and I see the log says it is due to a skin
error.

Looking through the release notes, I see the problem will be down to the
skin "auto-discovery" changes. Looking at the help page about migrating
skins to 1.24 :

https://www.mediawiki.org/wiki/Manual:Skin_autodiscovery

I have tried to adjust my custom skin files but without success. In
1.24.1 skins/ I have :

CologneBlue/
Modern/
MonoBook/
README
Vector/
ZedDocs/

ZedDocs is the custom skin based on Vector.

The Apache error I get is :

Tue Jan 13 15:43:10 2015] [error] [client 192.168.0.124] PHP Warning: 
require_once(/home/user/mediawiki-1.24.1/skins/zeddocs/../Vector.php):
failed to open stream: No such file or directory in
/home/user/mediawiki-1.24.1/skins/zeddocs/ZedDocs.skin.php on line 9,
referer: http://wpdev/w/index.php?title=Main_Page

On line 9 of zeddocs/ZedDocs.skin.php I have/had :

require_once( dirname( __FILE__ ) . '/../Vector.php' );

If I set this to :

require_once( dirname( __FILE__ ) . '/../Vector/Vector.php' );

I get error :

[Tue Jan 13 16:38:50 2015] [error] [client 192.168.0.124] PHP Catchable
fatal error:  Argument 1 passed to SkinVector::__construct() must
implement interface Config, string given, called in
/home/user/mediawiki-1.24.1/includes/Setup.php on line 285 and defined
in /home/user/mediawiki-1.24.1/skins/Vector/SkinVector.php on line 38,
referer: http://wpdev/w/index.php?title=Main_Page


I have tried to set up my skin files (and renamed as CamelCase) as per
the Skin_autodiscovery manual page.

skins/ZedDocs/
 - css
 - images
 - ZedDocs.i18n.php
 - ZedDocs.php
 - ZedDocs.skin.php

I have made changes to files ZedDocs.php and ZedDocs.Skin.pnp, please
see the attached PHP files. I have added a .txt extension for the list
(just in case).

Can someone have a look and see where I am going wrong?


Many Thanks,

Alastair




-- 
Alastair Sherringham
http://www.sherringham.net
<?php
/**
 * Internationalization file for skin Zed Docs
 *
 * @file
 * @ingroup Skins
 */

$messages = array();

$messages['en'] = array(
    'skinname-zeddocs' => "ZedDocs",
    'zeddocs-desc' => "Some skin of mine.",
);

<?php
/**
 * Zed Docs skin
 *
 * @file
 * @ingroup Skins
 * @author AS
 * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License 2.0 
or later
 */

if( !defined( 'MEDIAWIKI' ) ) die( "This is an extension to the MediaWiki 
package and cannot be run standalone." );

$wgExtensionCredits['skin'][] = array (
    'path' => __FILE__,
    'name' => 'ZedDocs',
    'url' => "[...]",
    'author' => '[http://digitalvision.se]',
    'descriptionmsg' => 'This is a skin based on Vector but with Digital Vision 
banner and a few other changes.',
);

$wgValidSkinNames['zeddocs'] = 'ZedDocs';
$wgAutoloadClasses['SkinZedDocs'] = __DIR__ . '/ZedDocs.skin.php';
$wgExtensionMessagesFiles['ZedDocs'] = __DIR__ . '/ZedDocs.i18n.php';

$wgResourceModules['skins.zeddocs'] = array(
    'styles' => array(
        'css/screen.css' => array( 'media' => 'screen' ),
    ),
    'remoteSkinPath' => 'ZedDocs',
    'localBasePath' => __DIR__,
);

<?php
/**
* Skin file for skin Zed Docs.
*
* @file
* @ingroup Skins
*/

#require_once( dirname( __FILE__ ) . '/../Vector.php' );
require_once( dirname( __FILE__ ) . '/../Vector/Vector.php' );

/**
 * SkinTemplate class for My Skin skin
 * @ingroup Skins
 */
class SkinZedDocs extends SkinVector {

    var $skinname = 'ZedDocs', $stylename = 'ZedDocs', $template = 
'ZedDocsTemplate';

    /**
     * @param $out OutputPage object
     */
    function setupSkinUserCss( OutputPage $out ){
        parent::setupSkinUserCss( $out );
        $out->addModuleStyles( "skins.zeddocs" );
    }

}

// Can insert ZedDocsTemplate.txt here if wanted - NOTE: set $template = 
'ZedDocsTemplate' above!


class ZedDocsTemplate extends VectorTemplate {

    /* Functions */

    /**
     * Outputs the entire contents of the (X)HTML page
     */
    public function execute() {
        global $wgVectorUseIconWatch;

        // Build additional attributes for navigation urls
        $nav = $this->data['content_navigation'];

        if ( $wgVectorUseIconWatch ) {
            $mode = $this->getSkin()->getUser()->isWatched( 
$this->getSkin()->getRelevantTitle() ) ? 'unwatch' : 'watch';
            if ( isset( $nav['actions'][$mode] ) ) {
                $nav['views'][$mode] = $nav['actions'][$mode];
                $nav['views'][$mode]['class'] = rtrim( 'icon ' . 
$nav['views'][$mode]['class'], ' ' );
                $nav['views'][$mode]['primary'] = true;
                unset( $nav['actions'][$mode] );
            }
        }

        $xmlID = '';
        foreach ( $nav as $section => $links ) {
            foreach ( $links as $key => $link ) {
                if ( $section == 'views' && !( isset( $link['primary'] ) && 
$link['primary'] ) ) {
                    $link['class'] = rtrim( 'collapsible ' . $link['class'], ' 
' );
                }

                $xmlID = isset( $link['id'] ) ? $link['id'] : 'ca-' . $xmlID;
                $nav[$section][$key]['attributes'] =
                    ' id="' . Sanitizer::escapeId( $xmlID ) . '"';
                if ( $link['class'] ) {
                    $nav[$section][$key]['attributes'] .=
                        ' class="' . htmlspecialchars( $link['class'] ) . '"';
                    unset( $nav[$section][$key]['class'] );
                }
                if ( isset( $link['tooltiponly'] ) && $link['tooltiponly'] ) {
                    $nav[$section][$key]['key'] =
                        Linker::tooltip( $xmlID );
                } else {
                    $nav[$section][$key]['key'] =
                        Xml::expandAttributes( 
Linker::tooltipAndAccesskeyAttribs( $xmlID ) );
                }
            }
        }
        $this->data['namespace_urls'] = $nav['namespaces'];
        $this->data['view_urls'] = $nav['views'];
        $this->data['action_urls'] = $nav['actions'];
        $this->data['variant_urls'] = $nav['variants'];

        // Reverse horizontally rendered navigation elements
        if ( $this->data['rtl'] ) {
            $this->data['view_urls'] =
                array_reverse( $this->data['view_urls'] );
            $this->data['namespace_urls'] =
                array_reverse( $this->data['namespace_urls'] );
            $this->data['personal_urls'] =
                array_reverse( $this->data['personal_urls'] );
        }
        // Output HTML Page
        $this->html( 'headelement' );
?>
        <!-- The main banner -->
        <div id="zeddocs-banner">
        <div id="menu"><span id="menu-text">
        <a href="/">Home</a> | <a href="/products">Products</a> | <a 
href="/news">News</a> | <a href="/support">Support</a> | <a 
href="/company-info/dealer-maps/">Sales</a> | <a 
href="/company-info/digital_vision_contacts/">Contact</a></span></div>
        </div>


        <div id="mw-page-base" class="noprint"></div>
        <div id="mw-head-base" class="noprint"></div>
        <div id="content" class="mw-body" role="main">
            <a id="top"></a>
            <div id="mw-js-message" style="display:none;"<?php $this->html( 
'userlangattributes' ) ?>></div>
            <?php if ( $this->data['sitenotice'] ) { ?>
            <div id="siteNotice"><?php $this->html( 'sitenotice' ) ?></div>
            <?php } ?>
            <h1 id="firstHeading" class="firstHeading" lang="<?php
                $this->data['pageLanguage'] = 
$this->getSkin()->getTitle()->getPageViewLanguage()->getHtmlCode();
                $this->text( 'pageLanguage' );
            ?>"><span dir="auto"><?php $this->html( 'title' ) ?></span></h1>
            <div id="bodyContent">
                <?php if ( $this->data['isarticle'] ) { ?>
                <div id="siteSub"><?php $this->msg( 'tagline' ) ?></div>
                <?php } ?>
                <div id="contentSub"<?php $this->html( 'userlangattributes' ) 
?>><?php $this->html( 'subtitle' ) ?></div>
                <?php if ( $this->data['undelete'] ) { ?>
                <div id="contentSub2"><?php $this->html( 'undelete' ) ?></div>
                <?php } ?>
                <?php if ( $this->data['newtalk'] ) { ?>
                <div class="usermessage"><?php $this->html( 'newtalk' ) ?></div>
                <?php } ?>
                <div id="jump-to-nav" class="mw-jump">
                    <?php $this->msg( 'jumpto' ) ?>
                    <a href="#mw-navigation"><?php $this->msg( 
'jumptonavigation' ) ?></a><?php $this->msg( 'comma-separator' ) ?>
                    <a href="#p-search"><?php $this->msg( 'jumptosearch' ) 
?></a>
                </div>
                <?php $this->html( 'bodycontent' ) ?>
                <?php if ( $this->data['printfooter'] ) { ?>
                <div class="printfooter">
                <?php $this->html( 'printfooter' ); ?>
                </div>
                <?php } ?>
                <?php if ( $this->data['catlinks'] ) { ?>
                <?php $this->html( 'catlinks' ); ?>
                <?php } ?>
                <?php if ( $this->data['dataAfterContent'] ) { ?>
                <?php $this->html( 'dataAfterContent' ); ?>
                <?php } ?>
                <div class="visualClear"></div>
                <?php $this->html( 'debughtml' ); ?>
            </div>
        </div>
        <div id="mw-navigation">
            <h2><?php $this->msg( 'navigation-heading' ) ?></h2>
            <div id="mw-head">
                <?php $this->renderNavigation( 'PERSONAL' ); ?>
                <div id="left-navigation">
                    <?php $this->renderNavigation( array( 'NAMESPACES', 
'VARIANTS' ) ); ?>
                </div>
                <div id="right-navigation">
                    <?php $this->renderNavigation( array( 'VIEWS', 'ACTIONS', 
'SEARCH' ) ); ?>
                </div>
            </div>
            <div id="mw-panel">
                    <div id="p-logo" role="banner"><a style="background-image: 
url(<?php $this->text( 'logopath' ) ?>);" href="<?php echo htmlspecialchars( 
$this->data['nav_urls']['mainpage']['href'] ) ?>" <?php echo 
Xml::expandAttributes( Linker::tooltipAndAccesskeyAttribs( 'p-logo' ) ) 
?>></a></div>
                <?php $this->renderPortals( $this->data['sidebar'] ); ?>
            </div>
        </div>
        <div id="footer" role="contentinfo"<?php $this->html( 
'userlangattributes' ) ?>>
            <?php foreach ( $this->getFooterLinks() as $category => $links ) { 
?>
                <ul id="footer-<?php echo $category ?>">
                    <?php foreach ( $links as $link ) { ?>
                        <li id="footer-<?php echo $category ?>-<?php echo $link 
?>"><?php $this->html( $link ) ?></li>
                    <?php } ?>
                </ul>
            <?php } ?>
            <?php $footericons = $this->getFooterIcons( "icononly" );
            if ( count( $footericons ) > 0 ) { ?>
                <ul id="footer-icons" class="noprint">
<?php            foreach ( $footericons as $blockName => $footerIcons ) { ?>
                    <li id="footer-<?php echo htmlspecialchars( $blockName ); 
?>ico">
<?php                foreach ( $footerIcons as $icon ) { ?>
                        <?php echo $this->getSkin()->makeFooterIcon( $icon ); ?>

<?php                } ?>
                    </li>
<?php            } ?>
                </ul>
            <?php } ?>
            <div style="clear:both"></div>
        </div>
        <?php $this->printTrail(); ?>

    </body>
</html>
<?php
    }
}



_______________________________________________
MediaWiki-l mailing list
To unsubscribe, go to:
https://lists.wikimedia.org/mailman/listinfo/mediawiki-l

Reply via email to