Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Google Maps für Einsatzorte #114

Open
wants to merge 13 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Merge commit '5403d5d25c2bf188f4436827232fc8832dc3919e' into develop
# Conflicts:
#	src/einsatzverwaltung-core.php
#	src/einsatzverwaltung-settings.php
  • Loading branch information
jhbriese committed Oct 6, 2017
commit 1548271dc3bbe02d5909d32ba5696849ed9a2abe
28 changes: 11 additions & 17 deletions src/einsatzverwaltung-core.php
Original file line number Diff line number Diff line change
Expand Up @@ -251,11 +251,21 @@ class Core
*/
private $data;

/**
* @var Frontend
*/
private $frontend;

/**
* @var Settings
*/
private $settings;

/**
* @var Options
*/
private $options;

/**
* @var ImportTool
*/
Expand Down Expand Up @@ -351,7 +361,6 @@ public function onDeactivation()
public function onInit()
{
$this->registerTypes();
$this->registerScripts();
$this->addRewriteRules();
if ($this->options->isFlushRewriteRules()) {
flush_rewrite_rules();
Expand Down Expand Up @@ -407,21 +416,6 @@ private function registerTypes()
));
}

/**
* Registriert externe Scripts
*/
private function registerScripts()
{
if( $this->options->isGMapActivate() ) {
/* Google Maps */
$protocal = is_ssl() ? 'https://' : 'http:https://';
$url = add_query_arg( array(
'key' => $this->options->getGMapAPI(),
), "{$protocal}maps.googleapis.com/maps/api/js");
wp_register_script( 'einsatzvw_GoogleMap', $url );
}
}

private function addRewriteRules()
{
global $wp_rewrite;
Expand Down
43 changes: 2 additions & 41 deletions src/einsatzverwaltung-settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -194,16 +194,8 @@ public function registerSettings()
);
register_setting(
'einsatzvw_settings',
'einsatzvw_gmap',
array($this->utilities, 'sanitizeCheckbox')
);
register_setting(
'einsatzvw_settings',
'einsatzvw_gmap_api'
);
register_setting(
'einsatzvw_settings',
'einsatzvw_gmap_default_pos'
'einsatzvw_list_annotations_color_off',
array($this, 'sanitizeAnnotationOffColor') // NEEDS_WP4.6 das globale sanitize_hex_color() verwenden
);
register_setting(
'einsatzvw_settings',
Expand Down Expand Up @@ -346,13 +338,6 @@ private function addSettingsFields()
self::EVW_SETTINGS_SLUG,
'einsatzvw_settings_einsatzberichte'
);
add_settings_field(
'einsatzvw_settings_gmap',
'Google Maps',
array($this, 'echoSettingsGmap'),
self::EVW_SETTINGS_SLUG,
'einsatzvw_settings_einsatzberichte'
);
add_settings_field(
'einsatzvw_settings_columns',
'Spalten der Einsatzliste',
Expand Down Expand Up @@ -589,30 +574,6 @@ public function echoSettingsExcerpt()
echo '<p class="description">Bitte auch die Einstellung zum Umfang der Eintr&auml;ge im Feed (Einstellungen &gt; Lesen) beachten!<br/>Im Feed werden bei den Einsatzdetails aus technischen Gr&uuml;nden keine Links zu gefilterten Einsatzlisten angezeigt.</p>';
}

/**
* Gibt die Einstellmöglichkeiten für den Auszug aus
*/
public function echoSettingsGmap()
{
$this->echoSettingsCheckbox(
'einsatzvw_gmap',
'Googel Maps aktivieren',
$this->options->isGMapActivate()
);
echo '<p>Googel Maps JavaScript API-Key:&nbsp;';
$this->echoSettingsInput(
'einsatzvw_gmap_api',
'Wie generiere ich einen <a href="https://developers.google.com/maps/documentation/javascript/get-api-key" target="_blank">API-Key</a>',
$this->options->getGMapAPI()
);
echo '<p>Standartposition der Karte:&nbsp;';
$this->echoSettingsInput(
'einsatzvw_gmap_default_pos',
'Als Lat,Lon: 53.523463,9.482329',
$this->options->getGMapDefaultPos()
);
}


/**
*
Expand Down
You are viewing a condensed version of this merge commit. You can view the full changes here.