/**
  * Gets the posted value of the name, optional name prefix automatically attached
  * @param string $name The checkbox name without prefix
  */
 protected function Value($name)
 {
     if (Request::IsPost()) {
         return (bool) trim(Request::PostData($this->namePrefix . $name));
     }
     if ($this->Rights()) {
         return $this->Rights()->{$name};
     }
     if ($this->ParentRights()) {
         return $this->ParentRights()->{$name};
     }
     return false;
 }
示例#2
0
 /**
  * Gets the value of a field
  * @param string $field The field name
  * @param bool $trim True if the value shall be trimmed by whitespace characters
  */
 function Value($field, $trim = true)
 {
     $result = Request::IsPost() ? Request::PostData($field) : $this->DefaultValue($field);
     if ($trim) {
         return trim($result);
     }
     return $result;
 }