*/ class Mage_XmlConnect_Block_Adminhtml_Mobile_Form_Element_Country extends Varien_Data_Form_Element_Checkboxes { /** * Flag of using the border in the table's TD * * @var bool */ protected $_useBorderClass = false; /** * Init Element * * @param array $attributes */ public function __construct($attributes=array()) { parent::__construct($attributes); $this->setType('checkbox'); $this->setExtType('country'); } /** * Retrieve HTML * * @return string */ public function getElementHtml() { $values = $this->_prepareValues(); if (empty($values)) { return ''; } $columns = (int)$this->getData('columns'); $columns = $columns ? $columns : 1; $rows = ceil(count($values) / $columns); $row = $column = 0; $options = array(); foreach ($values as $value) { if (empty($value['value'])) { continue; } $options[$row++][$column] = $value; if ($row == $rows) { $row = 0; $column++; } } while ($row < $rows) { $options[$row++][$column] = ''; } $id = $this->getData('id'); $id = empty($id) ? '' : ' id="' . $id . '-table"'; $class = $this->getData('class'); $html = PHP_EOL . "