Esempio n. 1
0
 /**
  * Store theme to a client-side storage (cookie).
  * @param CLIENT_STORAGE $storage
  */
 public function store_to_client($storage)
 {
     $storage->set_value('theme_id', $this->id);
     $storage->set_value('theme_title', $this->title);
     $storage->set_value('theme_name', $this->main_CSS_file_name);
     $storage->set_value('theme_renderer', $this->renderer_class_name);
     $storage->set_value('theme_font_name', $this->font_name_CSS_file_name);
     $storage->set_value('theme_font_size', $this->font_size_CSS_file_name);
     $storage->set_value('theme_icon_extension', $this->icon_extension);
     $storage->set_value('theme_icon_set', $this->icon_set);
     $storage->set_value('theme_dont_apply_to_forms', $this->dont_apply_to_forms);
 }
Esempio n. 2
0
 /**
  * Loads a value from the 'storage' into the field.
  * @param FORM $form
  * @param CLIENT_STORAGE $storage
  * @param object $default Use this value if the client is empty.
  */
 public function load_from_client($form, $storage, $default)
 {
     $key = $this->storage_id_for($form);
     if ($storage->exists_on_client($key)) {
         $this->set_value_from_text($storage->value($key));
     } else {
         $this->set_value($default);
     }
 }