/**
  *
  * @param OutputPage $oOutputPage
  * @param SkinTemplate $oSkinTemplate
  * @return boolean
  */
 public function onBeforePageDisplay($oOutputPage, $oSkinTemplate)
 {
     $oTitle = $oOutputPage->getTitle();
     $sHideTitlePageProp = BsArticleHelper::getInstance($oTitle)->getPageProp('bs_hidetitle');
     if ($sHideTitlePageProp === '') {
         $oOutputPage->mPagetitle = '';
         $oOutputPage->addInlineScript("\$('.firstHeading').remove()");
     }
     return true;
 }
function elmEasyRefOutput(OutputPage $outputPage, $skin)
{
    global $wgScriptPath;
    // Options
    global $wgElmEasyRefAddCSS, $wgElmEasyRefDebugMode, $wgElmEasyRefBodyContentId, $wgElmEasyRefAnimation, $wgElmEasyRefMetrics, $wgElmEasyRefNum_rp, $wgElmEasyRefNum_mt;
    // Register css for popup field
    $outputPage->addLink(array('rel' => 'stylesheet', 'type' => 'text/css', 'href' => $wgScriptPath . '/extensions/ElmEasyRef/css/referencefield.css'));
    // Additonal css if setted
    if ($wgElmEasyRefAddCSS) {
        $outputPage->addLink(array('rel' => 'stylesheet', 'type' => 'text/css', 'href' => $wgElmEasyRefAddCSS));
    }
    // Register js-script file
    $src = '/extensions/ElmEasyRef/js/elmEasyRef';
    if (!$wgElmEasyRefDebugMode) {
        $src .= '-min';
    }
    $outputPage->addScript(Html::linkedScript($wgScriptPath . $src . '.js'));
    // Settings
    $settings = '';
    if ($wgElmEasyRefDebugMode) {
        $settings .= 'elmEasyRef.debug = true;';
    }
    if ($wgElmEasyRefBodyContentId) {
        $settings .= 'elmEasyRef.bodyContentId = ' . Xml::encodeJsVar($wgElmEasyRefBodyContentId) . ';';
    }
    if ($wgElmEasyRefNum_rp) {
        $settings .= 'elmEasyRef.regRefNum_rp = /' . $wgElmEasyRefNum_rp . '/;';
    }
    if ($wgElmEasyRefNum_mt) {
        $settings .= 'elmEasyRef.regRefNum_mt = /' . $wgElmEasyRefNum_mt . '/;';
    }
    if ($wgElmEasyRefAnimation) {
        foreach ($wgElmEasyRefAnimation as $prop => $val) {
            $settings .= 'elmEasyRef.animation.' . $prop . ' = ' . Xml::encodeJsVar($val) . ';';
        }
    }
    if ($wgElmEasyRefMetrics) {
        foreach ($wgElmEasyRefMetrics as $prop => $val) {
            $settings .= 'elmEasyRef.fieldm.' . $prop . ' = ' . Xml::encodeJsVar($val) . ';';
        }
    }
    $msg = wfMsgExt('elm-easyref-ref', 'parseinline');
    $settings .= 'elmEasyRef.messages.elm_easyref_ref = ' . Xml::encodeJsVar($msg) . ';';
    $msg = wfMsgExt('elm-easyref-close', 'parseinline');
    $settings .= 'elmEasyRef.messages.elm_easyref_close = ' . Xml::encodeJsVar($msg) . ';';
    $outputPage->addInlineScript('addOnloadHook( function() {' . $settings . 'elmEasyRef.prepare();' . '} );');
    return true;
}
    /**
     * On new pages, open the editor right away.
     */
    private function renderOpenFullEditor(OutputPage $output)
    {
        if (!$this->article->exists()) {
            $output->addInlineScript('jQuery( document ).ready( function() {
					jQuery.inlineEditor.show( "inline-editor-root" );
				} );');
        }
    }