You are here

function properties_template_save in Dynamic properties 7

Save a template object.

Parameters

$template: Template object.

3 calls to properties_template_save()
properties_template_admin_templates_add in properties_template/properties_template.admin.inc
Form builder; Submit callback to save a template and redirect to list.
properties_template_admin_templates_add_another in properties_template/properties_template.admin.inc
Form builder; Submit callback to save a template and stay on form.
properties_template_admin_templates_save in properties_template/properties_template.admin.inc
Form builder; Submit callback to save a template and redirect to list.

File

properties_template/properties_template.module, line 132
This module implements the template functionality for properties.

Code

function properties_template_save($template) {
  foreach ($template->categories as $delta => $category) {

    // New category, save it first.
    if (!empty($category->new)) {
      properties_category_save($category);
    }

    // Empty category, remove from array.
    if (empty($category->name)) {
      unset($template->categories[$delta]);
    }
  }
  $function_name = _properties_get_call('template', 'save');
  return $function_name($template);
}