You are here

function gallery_config::save in Node Gallery 6

File

./node_gallery.model.inc, line 57
Node gallery module.

Class

gallery_config

Code

function save() {
  if (empty($this->data)) {
    $this->upload_settings['number_uploads'] = preg_replace("[^0-9]", "", $this->upload_settings['number_uploads']);
    foreach ((array) $this as $k => $v) {
      if ($k != 'name' || $k != 'gallery_type' || $k != 'image_type') {
        $this->data[$k] = $v;
      }
    }
  }
  $this->data = serialize($this->data);
  if (!empty($this->gallery_type) && gallery_config_gateway::get_types('gallery', $this->gallery_type)) {
    drupal_write_record('ng_gallery_config', $this, 'gallery_type');
  }
  else {
    drupal_write_record('ng_gallery_config', $this);
  }
}