public function getInfo() { $data = parent::getInfo(); $data['oOrder'] = array(); if (isset($this->options['iso_codes']) && is_array($this->options['iso_codes'])) { $iso_codes = array_flip($this->options['iso_codes']); } else { $iso_codes = null; } foreach ($this->model->allWithFav() as $c) { if (!$iso_codes || isset($iso_codes[$c['iso3letter']]) || $c['iso3letter'] === '') { $data['oOrder'][] = $c['iso3letter']; } } $data['options'][''] = ' '; return $data; }
public function getHTML($params = array(), $attrs = '') { $url = wa()->getRootUrl() . 'wa-content/img/country/'; $id = 'wa-country-field-' . uniqid(); $html = parent::getHTML($params, $attrs . ' id="' . $id . '"'); $html = '<i style="display:none" class="icon16" style=""></i>' . $html; $html .= '<script> if ($) { $("#' . $id . '").change(function () { if ($(this).val()) { $(this).prev().show().css("background", "url(' . $url . '" + $(this).val() + ".gif) 0 center no-repeat"); } else { $(this).prev().hide(); } }).change(); } </script>'; return $html; }
public function getInfo() { $info = parent::getInfo(); $info['hrefPrefix'] = isset($this->options['hrefPrefix']) ? $this->options['hrefPrefix'] : ''; return $info; }