Horde_Core_Ui_VarRenderer_Html::_renderVarInput_matrix PHP Method

_renderVarInput_matrix() protected method

protected _renderVarInput_matrix ( $form, &$var, &$vars )
    protected function _renderVarInput_matrix($form, &$var, &$vars)
    {
        $varname = $var->getVarName();
        $var_array = $var->getValue($vars);
        $cols = $var->type->getCols();
        $rows = $var->type->getRows();
        $matrix = $var->type->getMatrix();
        $new_input = $var->type->getNewInput();
        $html = '<table cellspacing="0"><tr>';
        $html .= '<td class="rightAlign" width="20%"></td>';
        foreach ($cols as $col_title) {
            $html .= '<td align="center" width="1%">' . htmlspecialchars($col_title) . '</td>';
        }
        $html .= '<td class="rightAlign" width="60%"></td></tr>';
        /* Offer a new row of data to be added to the matrix? */
        if ($new_input) {
            $html .= '<tr><td>';
            if (is_array($new_input)) {
                $html .= sprintf('<select %s name="%s[n][r]"><option value="">%s</option>%s</select><br />', $this->_genID($varname . '_n_r'), htmlspecialchars($var->getVarName()), Horde_Core_Translation::t("-- select --"), $this->selectOptions($new_input, $var_array['n']['r']));
            } elseif ($new_input == true) {
                $html .= sprintf('<input %s type="text" name="%s[n][r]" value="%s" />', $this->_genID($varname . '_n_r'), htmlspecialchars($var->getVarName()), $var_array['n']['r']);
            }
            $html .= ' </td>';
            foreach ($cols as $col_id => $col_title) {
                $html .= sprintf('<td align="center"><input type="checkbox" class="checkbox" name="%s[n][v][%s]" /></td>', htmlspecialchars($var->getVarName()), $col_id);
            }
            $html .= '<td> </td></tr>';
        }
        /* Loop through the rows and create checkboxes for each column. */
        foreach ($rows as $row_id => $row_title) {
            $html .= sprintf('<tr><td>%s</td>', $row_title);
            foreach ($cols as $col_id => $col_title) {
                $html .= sprintf('<td align="center"><input type="checkbox" class="checkbox" name="%s[r][%s][%s]"%s /></td>', htmlspecialchars($var->getVarName()), $row_id, $col_id, !empty($matrix[$row_id][$col_id]) ? ' checked="checked"' : '');
            }
            $html .= '<td> </td></tr>';
        }
        return $html . '</table>';
    }
Horde_Core_Ui_VarRenderer_Html