Skip to content
This repository was archived by the owner on Jan 22, 2020. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
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
8 changes: 8 additions & 0 deletions d8/modules/custom/dmaps/dmaps.libraries.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
dmaps.gmap:
version: VERSION
dmaps.gmap_macrotext:
version: VERSION
dmaps.gmap_overlay_edit:
version: VERSION
dmaps.gmap_address:
version: VERSION
52 changes: 52 additions & 0 deletions d8/modules/custom/dmaps/src/Element/Gmap.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
<?php
/**
* @file
* Contains \Drupal\dmaps\Element\Gmap.
*/

namespace Drupal\dmaps\Element;

use Drupal\Core\Render\Element\FormElement;


/**
* Provides gmap form element.
*
* @FormElement("gmap")
*/
class Gmap extends FormElement {

public function getInfo() {
$class = get_class($this);
return [
// This isn't a *form* input.
'#input' => FALSE,
// @todo: Need include default settings.
//'#gmap_settings' => array_merge(gmap_defaults(), [
'#gmap_settings' => [
'points' => [],
'pointsOverlays' => [],
'lines' => [],
],
'#attached' => [
'library' => ['dmap/gmap'],
],
'#pre_render' => [
[$class, 'preRenderMap'],
],
'#theme' => 'gmap',
];
}

/**
* Pre render function to make sure all required JS is available.
*
* Depending on the display's behavior.
*/
function preRenderMap($element) {
// @todo Converted _gmap_pre_render_map function should be here.
return $element;
}

}
?>
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need ?> in the end.

43 changes: 43 additions & 0 deletions d8/modules/custom/dmaps/src/Element/GmapAddress.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
<?php
/**
* @file
* Contains \Drupal\dmaps\Element\GmapAddress.
*/

namespace Drupal\dmaps\Element;

use Drupal\Core\Render\Element\FormElement;


/**
* Provides gmap_address form element.
*
* @FormElement("gmap_address")
*/
class GmapAddress extends FormElement {

public function getInfo() {
$class = get_class($this);
return [
'#input' => TRUE,
'#pre_render' => [
[$class, 'processAddress'],
],
'#attached' => [
'library' => ['dmaps/gmap_address'],
],
'#autocomplete_path' => '',
'#theme' => 'textfield',
];
}

/**
* Style fieldset #process function.
*/
function processAddress($element) {
// @todo Converted process_gmap_address function should be here.
return $element;
}

}
?>
49 changes: 49 additions & 0 deletions d8/modules/custom/dmaps/src/Element/GmapDimension.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
<?php
/**
* @file
* Contains \Drupal\dmaps\Element\GmapDimension.
*/

namespace Drupal\dmaps\Element;

use Drupal\Core\Render\Element\FormElement;


/**
* Provides gmap_dimension form element.
*
* @FormElement("gmap_dimension")
*/
class GmapDimension extends FormElement {

public function getInfo() {
$class = get_class($this);
return [
'#input' => TRUE,
'#gmap_newtype' => 'textfield',
'#process' => [
[$class, 'processGmapControl'],
],
'#element_validate' => [
[$class, 'dimensionValidate'],
],
];
}

/**
* Generic gmap control #process function.
*/
function processGmapControl($element, &$form_state, $complete_form) {
// @todo Converted process_gmap_control function should be here.
return $element;
}

/**
* Ensure a textfield is a valid css dimension string.
*/
function dimensionValidate(&$elem, &$form_state) {
// @todo Converted gmap_dimension_validate function should be here.
}

}
?>
39 changes: 39 additions & 0 deletions d8/modules/custom/dmaps/src/Element/GmapLatitude.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
<?php
/**
* @file
* Contains \Drupal\dmaps\Element\GmapLatitude.
*/

namespace Drupal\dmaps\Element;

use Drupal\Core\Render\Element\FormElement;


/**
* Provides gmap_latitude form element.
*
* @FormElement("gmap_latitude")
*/
class GmapLatitude extends FormElement {

public function getInfo() {
$class = get_class($this);
return [
'#input' => TRUE,
'#gmap_newtype' => 'textfield',
'#process' => [
[$class, 'processGmapControl'],
],
];
}

/**
* Generic gmap control #process function.
*/
function processGmapControl($element, &$form_state, $complete_form) {
// @todo Converted process_gmap_control function should be here.
return $element;
}

}
?>
39 changes: 39 additions & 0 deletions d8/modules/custom/dmaps/src/Element/GmapLatlon.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
<?php
/**
* @file
* Contains \Drupal\dmaps\Element\GmapLatlon.
*/

namespace Drupal\dmaps\Element;

use Drupal\Core\Render\Element\FormElement;


/**
* Provides gmap form element.
*
* @FormElement("gmap_latlon")
*/
class GmapLatlon extends FormElement {

public function getInfo() {
$class = get_class($this);
return [
'#input' => TRUE,
'#gmap_newtype' => 'textfield',
'#process' => [
[$class, 'processGmapControl'],
],
];
}

/**
* Generic gmap control #process function.
*/
function processGmapControl($element, &$form_state, $complete_form) {
// @todo Converted process_gmap_control function should be here.
return $element;
}

}
?>
38 changes: 38 additions & 0 deletions d8/modules/custom/dmaps/src/Element/GmapLongitude.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
<?php
/**
* @file
* Contains \Drupal\dmaps\Element\GmapLongitude.
*/

namespace Drupal\dmaps\Element;

use Drupal\Core\Render\Element\FormElement;


/**
* Provides gmap_longitude form element.
*
* @FormElement("gmap_longitude")
*/
class GmapLongitude extends FormElement {

public function getInfo() {
$class = get_class($this);
return [
'#input' => TRUE,
'#gmap_newtype' => 'textfield',
'#process' => [
[$class, 'processGmapControl'],
],
];
}

/**
* Generic gmap control #process function.
*/
function processGmapControl($element, &$form_state, $complete_form) {
// @todo Converted process_gmap_control function should be here.
return $element;
}
}
?>
43 changes: 43 additions & 0 deletions d8/modules/custom/dmaps/src/Element/GmapMacrotext.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
<?php
/**
* @file
* Contains \Drupal\dmaps\Element\GmapMacrotext.
*/

namespace Drupal\dmaps\Element;

use Drupal\Core\Render\Element\FormElement;


/**
* Provides gmap_macrotext form element.
*
* @FormElement("gmap_macrotext")
*/
class GmapMacrotext extends FormElement {

public function getInfo() {
$class = get_class($this);
return [
'#input' => TRUE,
'#gmap_newtype' => 'textarea',
'#process' => [
[$class, 'processGmapControl'],
],
'#attached' => [
'library' => ['dmap/gmap_macrotext'],
],
'#theme' => 'textarea',
];
}

/**
* Generic gmap control #process function.
*/
function processGmapControl($element, &$form_state, $complete_form) {
// @todo Converted process_gmap_control function should be here.
return $element;
}

}
?>
38 changes: 38 additions & 0 deletions d8/modules/custom/dmaps/src/Element/GmapMarkerchooser.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
<?php
/**
* @file
* Contains \Drupal\dmaps\Element\GmapMarkerchooser.
*/

namespace Drupal\dmaps\Element;

use Drupal\Core\Render\Element\FormElement;


/**
* Provides gmap_markerchooser form element.
*
* @FormElement("gmap_markerchooser")
*/
class GmapMarkerchooser extends FormElement {

public function getInfo() {
$class = get_class($this);
return [
'#input' => TRUE,
'#process' => [
[$class, 'process_gmap_markerchooser'],
],
];
}

/**
* Marker chooser #process function.
*/
function processGmapMarkerchooser($element) {
// @todo Converted process_gmap_markerchooser function should be here.
return $element;
}

}
?>
41 changes: 41 additions & 0 deletions d8/modules/custom/dmaps/src/Element/GmapOverlayEdit.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<?php
/**
* @file
* Contains \Drupal\dmaps\Element\GmapOverlayEdit.
*/

namespace Drupal\dmaps\Element;

use Drupal\Core\Render\Element\FormElement;


/**
* Provides gmap_overlay_edit form element.
*
* @FormElement("gmap_overlay_edit")
*/
class GmapOverlayEdit extends FormElement {

public function getInfo() {
$class = get_class($this);
return [
'#input' => TRUE,
'#process' => [
[$class, 'processGmapOverlayEdit'],
],
'#attached' => [
'library' => ['dmaps/gmap_overlay_edit'],
],
];
}

/**
* Generic gmap_overlay_edit #process function.
*/
function processGmapOverlayEdit($element, &$form_state, $complete_form) {
// @todo Converted process_gmap_overlay_edit function should be here.
return $element;
}

}
?>
Loading