* @link http://wp-dreams.com, http://codecanyon.net/user/anago/portfolio * @copyright Copyright (c) 2014, Ernest Marcinko */ class wpdreamsDraggable extends wpdreamsType { private $selects, $selected; function getType() { $verified_sel = array(); parent::getType(); $this->processData(); echo "
" . $this->label . ""; if (isset($this->data['description'])) echo "

" . $this->data['description'] . "

"; echo '
    '; foreach ($this->selects as $k => $v) { if (!in_array($k, $this->selected)) echo '
  • ' . $v . '
  • '; } echo "
"; echo '
    '; if ($this->selected != null && is_array($this->selected)) { foreach ($this->selected as $k => $v) { if ( isset($this->selects[$v]) ) { echo '
  • ' . $this->selects[$v] . '
  • '; $verified_sel[] = $v; } } } echo "
"; echo " "; echo " "; echo "
"; } function processData() { if (is_array($this->data)) { if (isset($this->data['selects']) && is_array($this->data['selects'])) $this->selects = $this->data['selects']; else $this->selects = array(); if ( is_array($this->data) && isset($this->data['value']) ) $this->selected = explode("|", $this->data['value']); else $this->selected = array(); } else { $this->selects = array(); $this->selected = explode("|", $this->data); } } final function getData() { return $this->data; } final function getSelected() { return $this->selected; } } }