This repository was archived by the owner on Jan 22, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 9
Convert hook_element_info. initial commmit #58
Open
andriyun
wants to merge
1
commit into
drupal-ukraine:8.x-1.x
Choose a base branch
from
andriyun:8.x-1.x
base: 8.x-1.x
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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; | ||
| } | ||
|
|
||
| } | ||
| ?> | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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; | ||
| } | ||
|
|
||
| } | ||
| ?> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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. | ||
| } | ||
|
|
||
| } | ||
| ?> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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; | ||
| } | ||
|
|
||
| } | ||
| ?> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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; | ||
| } | ||
|
|
||
| } | ||
| ?> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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; | ||
| } | ||
| } | ||
| ?> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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; | ||
| } | ||
|
|
||
| } | ||
| ?> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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; | ||
| } | ||
|
|
||
| } | ||
| ?> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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; | ||
| } | ||
|
|
||
| } | ||
| ?> |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
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.