コード例 #1
0
 /**
  * @since 0.4
  *
  * @param string $title The title of the special page
  * @param string $restriction The required user right, 'edit' per default.
  */
 public function __construct($title, $restriction = 'edit')
 {
     parent::__construct($title, $restriction);
     $settings = WikibaseRepo::getDefaultInstance()->getSettings();
     $this->rightsUrl = $settings->getSetting('dataRightsUrl');
     $this->rightsText = $settings->getSetting('dataRightsText');
 }
コード例 #2
0
 /**
  * @param string $name Name of the special page, as seen in links and URLs.
  * @param string $restriction User right required, 'createpage' per default.
  *
  * @since 0.1
  */
 public function __construct($name, $restriction = 'createpage')
 {
     parent::__construct($name, $restriction);
     $wikibaseRepo = WikibaseRepo::getDefaultInstance();
     // TODO: find a way to inject these
     $this->summaryFormatter = $wikibaseRepo->getSummaryFormatter();
     $this->languageCodes = $wikibaseRepo->getTermsLanguages()->getLanguages();
     $settings = $wikibaseRepo->getSettings();
     $this->rightsUrl = $settings->getSetting('dataRightsUrl');
     $this->rightsText = $settings->getSetting('dataRightsText');
 }