Ejemplo n.º 1
0
 /**
  * Load initial properties from this project.
  * @param PROJECT $obj
  */
 public function load_from_object($obj)
 {
     parent::load_from_object($obj);
     $options = $obj->options();
     $this->set_value('defines_options', $obj->defines_options());
     $this->_apply_options_to_UI($options);
     $trunk = $obj->trunk();
     if ($trunk) {
         $this->set_value('trunk_id', $trunk->id);
     }
     $this->_set_up_options();
 }
Ejemplo n.º 2
0
 /**
  * Load initial properties from this album.
  * @param ALBUM $obj
  */
 public function load_from_object($obj)
 {
     parent::load_from_object($obj);
     $this->set_value('publication_state', 'silent');
     $this->set_value('show_times', $obj->show_times);
     $this->set_value('show_celsius', $obj->show_celsius);
     $this->set_value('max_picture_width', $obj->max_picture_width);
     $this->set_value('max_picture_height', $obj->max_picture_height);
     $this->set_value('url_root', $obj->url_root);
     $this->set_value('location', $obj->location);
     $this->set_visible('location', $this->login->is_allowed(Privilege_set_entry, Privilege_upload, $this->_folder));
     if (!$this->visible('location')) {
         $this->set_value('location', Album_location_type_remote);
     }
     $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'));
     $main_picture_id = read_var('main_picture_id', 'not set');
     if ($main_picture_id == 'not set') {
         $this->set_value('main_picture_id', $obj->main_picture_id);
     } else {
         $this->set_value('main_picture_id', $main_picture_id);
     }
     $this->set_value('constrain_picture_size', $this->value_for('max_picture_width') || $this->value_for('max_picture_height'));
     if (!$this->value_for('constrain_picture_size')) {
         /** @var ALBUM_APPLICATION $app */
         $app = $this->app;
         $this->set_value('max_picture_width', $app->picture_options->default_max_picture_width);
         $this->set_value('max_picture_height', $app->picture_options->default_max_picture_height);
     }
     $this->set_value('date_style', $obj->date_style());
     $this->set_value('first_day', $obj->first_day);
     $this->set_value('last_day', $obj->last_day);
 }