/** * Gets the button's DOM identifier * * @return string */ public function getId() { if (empty($this->id)) { $filter = new Filter(); $this->id = $filter->clean($this->getTitle(), 'cmd'); } return $this->id; }
/** * Get a filtered state variable * * @param string $key The state variable's name * @param mixed $default The default value to return if it's not already set * @param string $filter_type The filter type to use * * @return mixed The state variable's contents */ public function getState($key = null, $default = null, $filter_type = 'raw') { if (empty($key)) { return $this->internal_getState(); } // Get the savestate status $value = $this->internal_getState($key); if (is_null($value) && !$this->_ignoreRequest) { $value = $this->getUserStateFromRequest($key, $key, $value, 'none', $this->_savestate); if (is_null($value)) { return $default; } } if (strtoupper($filter_type) == 'RAW') { return $value; } else { $filter = new Filter(); return $filter->clean($value, $filter_type); } }
/** * Method to unserialize the input. * * @param string $input The serialized input. * * @return \Awf\Input\Input The input object. */ public function unserialize($input) { // Unserialize the data, and inputs. list($this->options, $this->data, $this->inputs) = unserialize($input); // Load the filter. $this->filter = \Awf\Input\Filter::getInstance(); }