Ignore:
Timestamp:
03/04/2010 10:55:20 AM (2 years ago)
Author:
zhongzhen
Message:

Some changes in Help Extention

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/omcollab_zhongzhen2/wiki/extensions/Help/Help_Guide.php

    r1391 r1396  
    11<?php 
     2 
    23if ( !defined( 'MEDIAWIKI' ) ) 
    34        die (); 
    45  
    56$wgHooks['EditPage::showEditForm:initial'][] = 'showHelpGuide'; 
     7 
     8$wgExtensionCredits['specialpage'][] = array( 
     9    'name'           => 'Help_Guide', 
     10    'author'         => 'zhongzhen - yzz.webman@gmail.com', 
     11    'version'        => '1.0', 
     12    'description'    => 'When users contribute articles in article edit page, this extention helps them by giving article posting guide.', 
     13    'url'            => 'http://mike2.openmethodology.org', 
     14); 
    615  
    716function showHelpGuide($editPage) { 
    8         global $wgOut, $wgParser; 
     17        global $wgOut, $wgParser, $wgHelpExtentionTitle; 
    918        $section_text = ''; // temp variable for operation 
    1019        $matches = array(); // temp variable for operation 
     
    1221                $temp = ''; $index = 1; 
    1322         
     23        // If your site has not included jquery.js file in other parts, Please make below code works.  
     24        //$wgOut->addHTML("<script type='text/javascript' src='extensions/Help/jquery.js'></script>"); 
     25                 
    1426                // Add css file to Edit page 
    1527                $wgOut->addHTML("<link rel='stylesheet' type='text/css' href='extensions/Help/HelpExtention.css' />"); 
    1628        $wgOut->addHTML("<script type='text/javascript' src='extensions/Help/tabmenu.js'></script>"); 
    17  
     29         
    1830                // Add javascript to Edit page 
    1931                $wgOut->addHTML("<script> 
     
    3547                // Help content - Help article title 
    3648        $wgOut->parserOptions()->setEditSection(false); // Hide edit link 
    37         $title = Title::newFromText('Contribution_Guide'); // get title object 
     49        $title = Title::newFromText($wgHelpExtentionTitle); // get title object from Localsettings.php 
    3850        $article = new Article($title); // get article object 
    3951         
     
    6880        $editPage->editFormTextBeforeContent .= '<div id="shadow"><div id="helpArea">' . $html . '</div></div>';  
    6981                // Help button 
    70                 $editPage->editFormTextBeforeContent .= '<div class="button_class"><img src="extensions/Help/images/button_help.gif" style="cursor: pointer;" onclick="changeIcon(this)"/></div>';  
     82                $editPage->editFormTextBeforeContent .= '<div class="button_class"><img src="extensions/Help/images/button_hide.gif" style="cursor: pointer;" onclick="changeIcon(this)"/></div>';  
    7183 
    7284        return true; 
Note: See TracChangeset for help on using the changeset viewer.