public function filter_atts_by_context($data, $context, $op = true) { // Remember any uncontrolled items $diff = array_diff(array_keys($data), $this->get_control_keys()); // Filter out known controls based on context $this->filter_keys = $this->get_keys_by_context($context, $op); $this->filter_op = true; $filtered = cs_array_filter_use_keys($data, array($this, '_key_filter')); // Allow uncontrolled items to passthrough. foreach ($diff as $key) { $filtered[$key] = $data[$key]; } return $filtered; }
public function available_defaults() { return cs_array_filter_use_keys($this->defaults(), array($this, 'can_use')); }
public function filter_atts_by_context($data, $context, $op = true) { $this->filter_keys = $this->get_keys_by_context($context, $op); $this->filter_op = true; return cs_array_filter_use_keys($data, array($this, '_key_filter')); }