Пример #1
0
 /**
  * @desc Method for getting diff between actual Wikia.css file and text given in request parameter
  * @paramRequest string wikitext - request param in which you can provide text to create a diff
  */
 public function getDiff()
 {
     $wikitext = $this->request->getVal('wikitext', '');
     $model = new SpecialCssModel();
     $editPageService = new EditPageService($model->getCssFileTitle());
     $this->diff = $editPageService->getDiff($wikitext);
 }
Пример #2
0
 /**
  * @param WikiaApp $app
  * @param SpecialCssModel $model 
  * @param integer $articleId
  *
  * @return boolean
  */
 private static function shouldRedirect($app, $model, $title)
 {
     $result = false;
     // currently special:css cannot handle undo mode
     if ($app->wg->Request->getInt('undo') > 0 || $app->wg->Request->getInt('undoafter') > 0) {
         return $result;
     }
     if ($app->wg->EnableSpecialCssExt) {
         $specialCss = new SpecialCssController();
         /** @noinspection PhpUndefinedVariableInspection
          * SpecialCssModel::$suppoertedSkins is defined -- lint has issues with it
          */
         $result = $model->isWikiaCssTitle($title) && $app->checkSkin($model::$supportedSkins) && $specialCss->userCanExecute($app->wg->User);
     }
     return $result;
 }