diff options
author | Luke Shumaker <LukeShu@sbcglobal.net> | 2011-10-09 04:00:06 -0400 |
---|---|---|
committer | Luke Shumaker <LukeShu@sbcglobal.net> | 2011-10-09 04:00:06 -0400 |
commit | 38bb3a7c752199ee8f58e16bc784f48a6a600e08 (patch) | |
tree | 771b6d80fbf4fceb6f708ada6bb7b3838e593d66 /src/lib/Form.class.php | |
parent | f72b9a7658cea71ee1edf4ae678a2c8043d9e5bf (diff) | |
parent | 0fd0403876aacecfde74fca0641530875f09200f (diff) |
Merge branch 'master' into concurrent-editing
So, here's the deal:
* The meat of [concurrent-editing]:Form.class got merged into [master]:DB.class
* The string-generation stuff in [concurrent-editing]:Form.class didn't fit
nicely anywhere anymore, so I got rid of it by makeing datatype explicit.
* Users.class: declare datatypes explicitly in attrib()
* index.html.php: use this new explicit data
* style.scss: add a .small, which we can do because of the datatypes thing.
Conflicts:
src/controllers/Users.class.php
Diffstat (limited to 'src/lib/Form.class.php')
-rw-r--r-- | src/lib/Form.class.php | 57 |
1 files changed, 0 insertions, 57 deletions
diff --git a/src/lib/Form.class.php b/src/lib/Form.class.php deleted file mode 100644 index 725bac5..0000000 --- a/src/lib/Form.class.php +++ /dev/null @@ -1,57 +0,0 @@ -<?php - -require_once('Auth.class.php'); - -class Form { - public $getter = null; - public $setter = null; - public function __constructor($get, $set) { - $this->getter = $get; - $this->setter = $set; - } - private function getConf($key) { - call_user_func($getter, $key); - } - public function setConf($key, $value) { - call_user_func($setter, $key, $value); - } - private function getConfString($key) { - $raw = $this->getConf($key); - $value = $raw['value']; - if ($value===false) return 'false'; - if ($value===true) return 'true'; - return $value; - } - - public function updateValue($value, $value_base=null) { - $doit = true; - $forked = false; - $have_old = ($value_base!==null); - if ($have_old) { - @$value_base = $old[$uid]; - $we_changed_it = $value_base != $value; - if ($we_changed_it) { - $value_fork = $this->getConfString($key); - $someone_else_changed_it = - $value_fork != $value_base; - if ($someone_else_changed_it) { - if ($value == $value_fork) { - // we might as well not have - $we_changed_it = false; - } else { - $forked = true; - } - } - } - if (!$we_changed_it) { - $doit = false;// nothing to do - } - } - if ($doit) { - return $this->setConf($key, $value); - } - if ($forked) { - return $value_fork; - } - } -} |