/**
  * Creates the StateBar. on articles.
  * @param SkinTemplate $sktemplate
  * @param BaseTemplate $tpl
  * @return boolean Always true to keep hook running
  */
 public function onSkinTemplateOutputPageBeforeExec(&$sktemplate, &$tpl)
 {
     if (BsExtensionManager::isContextActive('MW::StateBarShow') === false) {
         return true;
     }
     if (!is_null($this->oRedirectTargetTitle)) {
         $oTitle = $this->oRedirectTargetTitle;
     }
     wfRunHooks('BSStateBarBeforeTopViewAdd', array($this, &$this->aTopViews, $sktemplate->getUser(), $sktemplate->getTitle(), $sktemplate));
     if (count($this->aTopViews) == 0) {
         // TODO RBV (01.07.11 18:26): Ain't this too late?
         BsExtensionManager::removeContext('MW::StateBarShow');
         return true;
     }
     $aSortTopVars = BsConfig::get('MW::StateBar::SortTopVars');
     if (!empty($aSortTopVars)) {
         $this->aTopViews = $this->reorderViews($this->aTopViews, $aSortTopVars);
     }
     $oViewStateBar = new ViewStateBar();
     foreach ($this->aTopViews as $mKey => $oTopView) {
         $oViewStateBar->addStateBarTopView($oTopView);
     }
     if ($tpl instanceof BsBaseTemplate) {
         $tpl->data['bs_dataBeforeContent']['bs-statebar'] = array('position' => 20, 'label' => wfMessage('prefs-statebar')->text(), 'content' => $oViewStateBar);
     } else {
         //this is the case when BlueSpice Skin is not active, so use vector methods.
         $tpl->data['prebodyhtml'] .= $oViewStateBar;
     }
     return true;
 }