* @link http://wp-dreams.com, http://codecanyon.net/user/anago/portfolio * @copyright Copyright (c) 2014, Ernest Marcinko */ class wpdreamsCustomArraySelect extends wpdreamsType { private $optionsArr = array(); private $selectedArr = array(); function getType() { parent::getType(); $this->processData(); echo "
"; foreach ($this->optionsArr as $k => $options) { // label for each box if ( is_array($this->label) && $this->label[$k] != '' ) echo ""; // this is not the parameter, its just a dummy echo ""; } echo "
"; } function processData() { if ( is_array($this->data) ) { // invoked on the backend $this->optionsArr = $this->data['optionsArr']; $this->selectedArr = explode('||', $this->data['value']); // change the data to the actual value $this->data = $this->data['value']; } else { // invoked by wpdreams_parse_params(), when saving $this->selectedArr = explode('||', $this->data); } } final function getData() { return $this->data; } final function getSelected() { return $this->selectedArr; } } }