private function ip_geoloc_plugin_style_leaflet::_add_default_marker in IP Geolocation Views & Maps 7
1 call to ip_geoloc_plugin_style_leaflet::_add_default_marker()
- ip_geoloc_plugin_style_leaflet::options_form in views/
ip_geoloc_plugin_style_leaflet.inc - Implements options_form().
File
- views/
ip_geoloc_plugin_style_leaflet.inc, line 248
Class
Code
private function _add_default_marker(&$form, &$weight) {
$path = drupal_get_path('module', 'ip_geoloc');
$desc1 = t('In addition to selecting a color, you may superimpose a special icon on top of each marker. <br><a target="fsymbols" href="!url_fsymbols">fsymbols</a> characters can be copied and pasted straight into the <strong>Font icon character</strong> field. Other libraries like <a target="fontawesome" href="!url_fontawesome">Font Awesome</a> and <a target="flaticon" href="!url_flaticon">flaticon</a> use names that you type in the <strong>Font icon class</strong> field.', array(
'!url_fsymbols' => url('http://fsymbols.com'),
'!url_fontawesome' => url('http://fortawesome.github.io/Font-Awesome/cheatsheet'),
'!url_flaticon' => url('http://flaticon.com'),
));
$desc2 = t('<em>fsymbols</em> require no further installation. For other libraries see the <a target="readme" href="!url_readme">README</a>.', array(
'!url_readme' => url("{$path}/README.txt"),
));
$desc3 = t('All this works best with the markers from the <em>/amarkers</em> directory, configurable <a target="config" href="!url_config">here</a>.', array(
'!url_config' => url('admin/config/system/ip_geoloc'),
));
$form['default_marker'] = array(
'#type' => 'fieldset',
'#title' => t('Default marker style'),
'#description' => $desc1 . '<br/>' . $desc2 . '<br/>' . $desc3,
'#weight' => $weight++,
);
$form['default_marker']['default_marker_color'] = array(
'#title' => t('Style/color'),
'#type' => 'select',
'#default_value' => $this->options['default_marker']['default_marker_color'],
'#options' => ip_geoloc_marker_colors(),
'#description' => t('Select an image to use for all location markers whose images are not overridden by the <strong>Location differentiator</strong> below.'),
'#attributes' => array(
'class' => array(
'marker-color',
),
),
);
$form['default_marker']['default_marker_special_char'] = array(
'#title' => t('Font icon character'),
'#type' => 'textfield',
'#size' => 8,
'#default_value' => $this->options['default_marker']['default_marker_special_char'],
'#description' => t('Paste directly from <a target="fsymbols" href="!url_fsymbols">fsymbols</a>. If the character displays in color or as a square then it may not save or display correctly.', array(
'!url_fsymbols' => url('http://text-symbols.com'),
)),
);
$desc4 = t('Use the class name from the font icon library you are using. Append <strong>light</strong>, <strong>dark</strong> or <strong>red</strong> to change the color. Examples:<br/>Font Awesome: <strong>fa fa-beer light</strong><br/>flaticon: <strong>flaticon-bicycle12 red</strong>');
$form['default_marker']['default_marker_special_char_class'] = array(
'#title' => t('Font icon class'),
'#type' => 'textfield',
'#size' => 25,
'#default_value' => $this->options['default_marker']['default_marker_special_char_class'],
'#description' => $desc4,
);
}