/** * Determines the value for the element in the form view * * @param array $data Form data * @param int $repeatCounter When repeating joined groups we need to know what part of the array to access * @param array $opts Options, 'raw' = 1/0 use raw value * * @return string value */ public function getValue($data, $repeatCounter = 0, $opts = array()) { $value = parent::getValue($data, $repeatCounter, $opts); if (is_array($value)) { $day = FArrayHelper::getValue($value, 0); $month = FArrayHelper::getValue($value, 1); $year = FArrayHelper::getValue($value, 2); $value = $year . '-' . $month . '-' . $day; } return $value; }
/** * Determines the value for the element in the form view * * @param array $data Form data * @param int $repeatCounter When repeating joined groups we need to know what part of the array to access * @param array $opts Options * * @return string value */ public function getValue($data, $repeatCounter = 0, $opts = array()) { $v = parent::getValue($data, $repeatCounter, $opts); if (is_string($v)) { $v = FabrikWorker::JSONtoData($v, true); } return $v; }
/** * Determines the value for the element in the form view * * @param array $data Form data * @param int $repeatCounter When repeating joined groups we need to know what part of the array to access * @param array $opts Options, 'raw' = 1/0 use raw value * * @return string value */ public function getValue($data, $repeatCounter = 0, $opts = array()) { $value = parent::getValue($data, $repeatCounter, $opts); if (is_array($value)) { return array_pop($value); } return $value; }
/** * Determines the value for the element in the form view * * @param array $data Element value * @param int $repeatCounter When repeating joined groups we need to know what part of the array to access * @param array $opts Options * * @return string Value */ public function getValue($data, $repeatCounter = 0, $opts = array()) { $value = parent::getValue($data, $repeatCounter, $opts); return $value; }
/** * Determines the value for the element in the form view. Ensure its set to be a r,g,b string * * @param array $data Form data * @param int $repeatCounter When repeating joined groups we need to know what part of the array to access * @param array $opts Options, 'raw' = 1/0 use raw value * * @return string value */ public function getValue($data, $repeatCounter = 0, $opts = array()) { $value = parent::getValue($data, $repeatCounter, $opts); $value = strstr($value, '#') ? FabrikString::hex2rgb($value) : $value; return $value; }
/** * Determines the value for the element in the form view * * @param array $data form data * @param int $repeatCounter when repeating joined groups we need to know what part of the array to access * @param array $opts options * * @return string value */ public function getValue($data, $repeatCounter = 0, $opts = array()) { // Kludge for 2 scenarios if (array_key_exists('rowid', $data)) { // When validating the data on form submission $key = 'rowid'; } else { // When rendering the element to the form $key = '__pk_val'; } if (empty($data) || !array_key_exists($key, $data) || array_key_exists($key, $data) && empty($data[$key])) { $value = $this->getDefaultOnACL($data, $opts); return $value; } $res = parent::getValue($data, $repeatCounter, $opts); return $res; }