/**
  * Initialize the form's fields with default values and visibilities.
  */
 public function load_with_defaults()
 {
     parent::load_with_defaults();
     $this->set_value('branch_title', 'Dev');
     if ($this->_folder) {
         $options = $this->_folder->options();
         $this->set_value('defines_options', 0);
         $this->_apply_options_to_UI($options);
     }
     $this->_set_up_options();
 }
 /**
  * Initialize the form's fields with default values and visibilities.
  */
 public function load_with_defaults()
 {
     parent::load_with_defaults();
     /** @var ALBUM $folder */
     $folder = $this->_folder;
     if (isset($folder)) {
         $this->set_value('location', $folder->location);
         $this->set_value('url_root', $folder->url_root);
         $this->set_value('date_style', $folder->date_style());
         $this->set_value('first_day', $folder->first_day);
         $this->set_value('last_day', $folder->last_day);
         $this->set_value('show_times', $folder->show_times);
         $this->set_value('show_celsius', $folder->show_celsius);
         $this->set_value('max_picture_width', $folder->max_picture_width);
         $this->set_value('max_picture_height', $folder->max_picture_height);
     } else {
         $this->set_value('location', Album_location_type_remote);
         $this->set_value('show_celsius', true);
         $this->set_value('max_picture_width', 800);
         $this->set_value('max_picture_height', 600);
         $this->set_value('first_day', new DATE_TIME());
         $this->set_value('last_day', new DATE_TIME());
         $this->set_value('date_style', Album_is_adjusted);
     }
     $this->set_value('constrain_picture_size', $this->value_for('max_picture_width') || $this->value_for('max_picture_height'));
     $this->set_visible('location', $this->login->is_allowed(Privilege_set_entry, Privilege_upload, $folder));
     $this->set_visible('url_root_enabled', $this->value_for('url_root') != '' && $this->value_for('location') == Album_location_type_local);
     $this->set_enabled('url_root', !$this->visible('url_root_enabled'));
 }