<?php
/**
 * @package	RSMembership!
 * @copyright	(c) 2009 - 2016 RSJoomla!
 * @link		https://www.rsjoomla.com
 * @license	GNU General Public License http://www.gnu.org/licenses/gpl-3.0.en.html
 */

class RSFieldset {

    public function startFieldset( $legend='', $class='rsmembership_form_table input') {
        $return = '<fieldset class="' . $class . '">';
        if ($legend) {
            $return .= '<p class="rule-desc">' . $legend . '</p>';
        }

        echo $return;
    }

    public function showField( $label, $input) {
        $return = '<div class="rsmemgrid-form-group rsmemgrid-row">';
        if ($label) {
            $return .= '<div class="rsmemgrid-col-sm-2 rsmemgrid-col-form-label">'. $label .'</div>';
        }
        $return .= '<div' . ( $label ? ' class="rsmemgrid-col-sm-10"' : ' class="rsmemgrid-col-sm-12"') .'>'. $input .'</div>';
        $return .= '</div>';

        echo $return;
    }

    public function endFieldset() {
       echo '</fieldset>';
    }
}