function openlayers_style_save in Openlayers 6.2
Same name and namespace in other branches
- 7.2 openlayers.module \openlayers_style_save()
Save style.
Parameters
$style: The style object to save.
Return value
The results of DB write or FALSE if no name.
1 call to openlayers_style_save()
- openlayers_ui_styles_form_submit in modules/
openlayers_ui/ includes/ openlayers_ui.styles.inc - Submit handler for layers.
File
- ./
openlayers.module, line 538 - Main OpenLayers API File
Code
function openlayers_style_save($style) {
if (!empty($style->name)) {
$exists = db_result(db_query("SELECT name FROM {openlayers_styles} \n WHERE name = '%s'", $style->name));
return $exists ? drupal_write_record('openlayers_styles', $style, 'name') : drupal_write_record('openlayers_styles', $style);
}
return FALSE;
}