Permalink
Browse files

Small cleanup

  • Loading branch information...
1 parent 8f46fed commit 6e5bfbf461c401b9b9ae1e097463853cae770d64 @mdesign mdesign committed Oct 28, 2009
Showing with 15 additions and 21 deletions.
  1. +15 −21 system/extensions/fieldtypes/sl_google_map/ft.sl_google_map.php
@@ -141,35 +141,29 @@ function display_site_settings()
$r .= $sd->block('sitewide_settings');
$r .= $sd->info_row('settings_tip', FALSE);
-
+ // API key.
$this->google_maps_api_key_conf = isset($PREFS->core_ini['sl_go_api']) ? $PREFS->core_ini['sl_go_api'] : FALSE;
-
+
if ($this->google_maps_api_key_conf)
{
-
$attr = array(
'extras' => 'disabled="disabled"'
- );
+ );
- // API key.
- $r .= $sd->row(array(
- $sd->label('api_key_conf'),
- $sd->text('api_key', $this->google_maps_api_key_conf, $attr)
- ));
-
- } else {
-
- // API key.
- $r .= $sd->row(array(
- $sd->label('api_key'),
- $sd->text('api_key', isset($this->site_settings['api_key']) ? $this->site_settings['api_key'] : '')
- ));
+ $r .= $sd->row(array(
+ $sd->label('api_key_conf'),
+ $sd->text('api_key', $this->google_maps_api_key_conf, $attr)
+ ));
+ }
+ else
+ {
+ $r .= $sd->row(array(
+ $sd->label('api_key'),
+ $sd->text('api_key', isset($this->site_settings['api_key']) ? $this->site_settings['api_key'] : '')
+ ));
}
-
-
-
// Default latitude.
$r .= $sd->row(
@@ -360,7 +354,7 @@ function _display_field($field_name, $field_data, $field_settings, $init)
$LANG->fetch_language_file('sl_google_map');
// Retrieve the API key from the site settings array.
- $this->google_maps_api_key_conf = $PREFS->core_ini['sl_go_api'];
+ $this->google_maps_api_key_conf = isset($PREFS->core_ini['sl_go_api']) ? $PREFS->core_ini['sl_go_api'] : FALSE;
if ($this->google_maps_api_key_conf)
{
$api_key = $this->google_maps_api_key_conf;

0 comments on commit 6e5bfbf

Please sign in to comment.