예제 #1
0
 /**
  * Load theme from a client-side storage (cookie).
  * @param CLIENT_STORAGE $storage
  */
 public function load_from_client($storage)
 {
     $this->id = $storage->value('theme_id');
     $this->title = $storage->value('theme_title');
     $this->renderer_class_name = $storage->value('theme_renderer');
     $this->main_CSS_file_name = $storage->value('theme_name');
     $this->font_name_CSS_file_name = $storage->value('theme_font_name');
     $this->font_size_CSS_file_name = $storage->value('theme_font_size');
     $this->icon_set = $storage->value('theme_icon_set');
     $this->icon_extension = $storage->value('theme_icon_extension');
     $this->dont_apply_to_forms = $storage->value('theme_dont_apply_to_forms');
 }
예제 #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);
     }
 }