Hello Jim, during the course of our integration with WordPress we have the following code changes that have been made to two files helper_base.php and data_entry_helper.php. I would be interested to hear your thoughts on integrating these to the master files. I haven't put this up as a merge request on the git, rather suggested these here first for discussion.
helper_base.php
Add to $indicia_templates:
'email_input' => '<input type="email" id="{id}" name="{fieldname}"{class} {disabled} {readonly} value="{default}" {title} {maxlength} />'."\n",
'number_input' => '<input type="number" id="{id}" name="{fieldname}"{class} {disabled} {readonly} value="{default}" {title} {maxlength} />'."\n",
Edit: remove size="30":
'date_picker' => '<input type="text" placeholder="{placeholder}" size="30"{class} id="{id}" name="{fieldname}" value="{default}" {title}/>'."\n",
to:
'date_picker' => '<input type="text" placeholder="{placeholder}" {class} id="{id}" name="{fieldname}" value="{default}" {title}/>'."\n",
I've suggested this as I think size is better controlled via CSS.
Add to $indicia_templates:
'native_date_picker' => '<input type="date" placeholder="{placeholder}" {class} id="{id}" name="{fieldname}" value="{default}" {title}/>'."\n",
Google api key
public static $google_api_key = '';
I do not believe this should not be held in helper_base.php, it should be stored in helper_config, inclusion here causes problems for anyone including client_helpers if they are using google services elsewhere and requires the helper_base.php file to be edited in addition to the configuration file, interestingly there is a comment on this line to suggest it shouldn't be there but is due to it being new(?).
**********************
data_entry_helper.php
Add
public static function email_input($options) {
$options = array_merge(array(
'default'=>''
), self::check_options($options));
return self::apply_template('email_input', $options);
}
public static function number_input($options) {
$options = array_merge(array(
'default'=>''
), self::check_options($options));
return self::apply_template('number_input', $options);
}
Google maps inclusion - line 684
'googlemaps' => array('javascript' => array("$protocol://maps.google.com/maps/api/js?v=3" .
(empty(self::$google_maps_api_key) ? '' : '&key=' . self::$google_maps_api_key))),
I've had to comment this line out as it causes issues with our inclusion of google maps elsewhere. I think there should be an additional static variable to determine whether to include google maps or not. Something like the following should work and includes maps by default but allows for an override if a static variable is set in helper_config.php:
'googlemaps' => (!empty($disable_indicia_gmaps_inclusion)?'':array('javascript' => array("$protocol://maps.google.com/maps/api/js?v=3" .
(empty(self::$google_maps_api_key) ? '' : '&key=' . self::$google_maps_api_key)))),
Line 1200
* google_places_api - uses the Google Places API text search service.
Should read
* google_places - uses the Google Places API text search service.
When using the map function map($options) allows for no control over georeference_lookup, suggest a minimum of 'label' and 'driver':
if ($options['locate']) {
$r .= self::georeference_lookup(array(
'label'=>(!empty($options['locateLabel'])?$options['locateLabel']:lang::get('search for place on map')),
'driver'=>$options['locateDriver']
));
}