choices)) { return; } if (!empty($this->label)) { ?> label); ?> description)) { ?> description; ?> value()); $choices = $this->choices; /* If values exist, use it. */ $options = array(); if ($values) { /* get individual item */ foreach ($values as $value) { /* separate item with option */ $value = explode(':', $value); /* build the array. remove options not listed on choices. */ if (array_key_exists($value[0], $choices)) { $options[$value[0]] = $value[1] ? '1' : '0'; } } } /* if there's new options (not saved yet), add it in the end. */ foreach ($choices as $key => $val) { /* if not exist, add it in the end. */ if (!array_key_exists($key, $options)) { $options[$key] = '0'; // use zero to deactivate as default for new items. } } ?> palette)) { $palette = implode('|', $this->palette); } else { // Default to true. $palette = ( false === $this->palette || 'false' === $this->palette ) ? 'false' : 'true'; } // Support passing show_opacity as string or boolean. Default to true. $show_opacity = ( false === $this->show_opacity || 'false' === $this->show_opacity ) ? 'false' : 'true'; // Begin the output. ?>