public function onRTEUseDefaultPlaceholder($name, $params, $frame, $wikitextIdx) { if ($name !== 'place') { return true; } else { // store metadata index to be used when rendering placeholder for RTE PlacesParserHookHandler::$lastWikitextId = $wikitextIdx; return false; } }
/** * Renders the geolocation button for adding coordinates to a page */ public function getGeolocationButton() { if ($this->app->wg->title->isContentPage() && PlaceStorage::newFromTitle($this->app->wg->title)->getModel()->isEmpty() && PlaceCategory::newFromTitle($this->app->wg->title->getFullText())->isGeoTaggingEnabledForArticle($this->app->wg->title)) { $this->setVal('geolocationParams', $this->getGeolocationButtonParams()); $this->response->setVal('jsSnippet', PlacesParserHookHandler::getJSSnippet()); (new JSMessages())->enqueuePackage('PlacesGeoLocationModal', JSMessages::INLINE); } else { $this->skipRendering(); } }