예제 #1
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);
     }
 }