PATH:
var
/
www
/
clients
/
client1
/
web1
/
web
/
wp-content
/
wp-google-maps
/
includes
<?php namespace WPGMZA\UI; class ComponentAnchorControl { const TOP = 0; const LEFT = 1; const CENTER = 2; const RIGHT = 3; const BOTTOM = 4; const TOP_LEFT = 5; const TOP_RIGHT = 6; const BOTTOM_LEFT = 7; const BOTTOM_RIGHT = 8; const ABOVE = 9; const BELOW = 10; /** * Create a controller * * @param DomElement $element The element to be converted */ public function __construct($element){ $this->element = $element; $this->parseOptions(); $this->render(); } private function parseOptions(){ $this->default = $this->element->getAttribute("data-default"); $this->anchors = $this->element->getAttribute("data-anchors"); $this->exclude = $this->element->getAttribute("data-anchors-exclude"); if(!empty($this->anchors)){ $this->anchors = explode(",", $this->anchors); } if(!empty($this->exclude)){ $this->exclude = explode(",", $this->exclude); } } private function render(){ $available = self::getAnchors(); $options = array(); if(!empty($this->default) && isset($available[$this->default])){ $options[$this->default] = $available[$this->default]; } foreach($available as $key => $value){ if($key !== $this->default){ if(!empty($this->anchors)){ if(!in_array($key, $this->anchors)){ continue; } } if(!empty($this->exclude)){ if(in_array($key, $this->exclude)){ continue; } } $options[$key] = $value; } } foreach($options as $key => $value){ $key = ucwords(strtolower(str_replace("_", " ", $key))) . (self::isLegacyAnchor($value) ? ' Map' : ''); $option = "<option value='{$value}'>{$key}</option>"; $this->element->import($option); } } public static function getAnchors() { $class = new \ReflectionClass(__CLASS__); return $class->getConstants(); } public static function isLegacyAnchor($anchor){ return ($anchor === self::ABOVE || $anchor === self::BELOW); } }
[-] class.admin-ui.php
[edit]
[+]
3rd-party-integration
[-] class.latlng.php
[edit]
[-] class.map.php
[edit]
[-] class.admin-notices.php
[edit]
[-] class.dom-query-results.php
[edit]
[-] class.pointlabel.php
[edit]
[-] class.upgrader.php
[edit]
[-] class.map-list-page.php
[edit]
[-] class.integrity-checker.php
[edit]
[-] class.dom-document.php
[edit]
[-] class.crud.php
[edit]
[+]
styling
[-] class.dynamic-translations.php
[edit]
[-] class.strings.php
[edit]
[-] class.library-script-panel.php
[edit]
[+]
open-layers
[-] class.maps-engine-dialog.php
[edit]
[+]
compat
[-] class.plugin.php
[edit]
[-] class.theme-panel.php
[edit]
[-] class.global-settings.php
[edit]
[+]
google-maps
[-] class.query.php
[edit]
[-] class.modal-dialog.php
[edit]
[-] class.script-loader.php
[edit]
[-] class.internal-engine.php
[edit]
[-] class.selector-to-xpath.php
[edit]
[-] class.polygon.php
[edit]
[-] class.rectangle.php
[edit]
[-] class.system-info.php
[edit]
[-] class.shortcodes.php
[edit]
[-] class.gdpr-compliance.php
[edit]
[+]
php8
[-] build.log
[edit]
[+]
tables
[-] class.polyline.php
[edit]
[-] class.settings.php
[edit]
[-] class.store-locator.php
[edit]
[-] class.country-select.php
[edit]
[-] class.settings-page.php
[edit]
[-] class.dom-element.php
[edit]
[+]
..
[-] class.elias-fano.php
[edit]
[-] class.distance.php
[edit]
[-] class.auto-loader.php
[edit]
[-] class.circle.php
[edit]
[-] class.page.php
[edit]
[-] class.component-anchor-control.php
[edit]
[+]
map-edit-page
[-] class.feature.php
[edit]
[-] class.marker.php
[edit]
[-] class.database.php
[edit]
[-] class.marker-filter.php
[edit]
[-] class.google-maps-api-loader.php
[edit]
[-] class.factory.php
[edit]
[+]
legacy
[-] class.installer-page.php
[edit]
[-] class.query-fragment.php
[edit]