コード例 #1
0
    public function __toString()
    {
        $element = parent::__toString();
        $title = htmlspecialchars(gettext($this->_title));
        $body = implode('', $this->_groups);
        $hdricon = "";
        $bodyclass = '<div class="panel-body">';
        if ($this->_collapsible & COLLAPSIBLE) {
            $hdricon = '<span class="widget-heading-icon">' . '<a data-toggle="collapse" href="#' . $this->_attributes['id'] . '_panel-body">' . '<i class="fa fa-plus-circle"></i>' . '</a>' . '</span>';
            $bodyclass = '<div id="' . $this->_attributes['id'] . '_panel-body" class="panel-body collapse ';
            if ($this->_collapsible & SEC_CLOSED) {
                $bodyclass .= 'out">';
            } else {
                $bodyclass .= 'in">';
            }
        }
        return <<<EOT
\t{$element}
\t\t<div class="panel-heading">
\t\t\t<h2 class="panel-title">{$title}{$hdricon}</h2>
\t\t</div>
\t\t{$bodyclass}
\t\t\t{$body}
\t\t</div>
\t</div>
EOT;
    }
コード例 #2
0
ファイル: Modal.class.php プロジェクト: dariomas/pfsense
    public function __toString()
    {
        $element = Form_Element::__toString();
        $title = htmlspecialchars(gettext($this->_title));
        $html = implode('', $this->_groups);
        $footer = implode('', $this->_global);
        $modalClass = $this->_isLarge ? 'modal-lg' : 'modal-sm';
        return <<<EOT
\t{$element}
\t\t<div class="modal-dialog {$modalClass}">
\t\t\t<div class="modal-content">
\t\t\t\t<div class="modal-header">
\t\t\t\t\t<button type="button" class="close" data-dismiss="modal" aria-label="Close">
\t\t\t\t\t\t<span aria-hidden="true">&times;</span>
\t\t\t\t\t</button>
\t\t\t\t\t<h3 class="modal-title">{$title}</h3>
\t\t\t\t</div>
<!--\t\t\t\t<form class="form-horizontal" action="" method="post"> -->
\t\t\t\t\t<div class="modal-body">
\t\t\t\t\t\t{$html}
\t\t\t\t\t</div>
\t\t\t\t\t<div class="modal-footer">
\t\t\t\t\t\t{$footer}
\t\t\t\t\t</div>
<!--\t\t\t\t</form> -->
\t\t\t</div>
\t\t</div>
\t</div>
EOT;
    }
コード例 #3
0
ファイル: Section.class.php プロジェクト: jefersonJim/pfsense
    public function __toString()
    {
        $element = parent::__toString();
        $title = htmlspecialchars(gettext($this->_title));
        $body = implode('', $this->_groups);
        return <<<EOT
\t{$element}
\t\t<div class="panel-heading">
\t\t\t<h2 class="panel-title">{$title}</h2>
\t\t</div>
\t\t<div class="panel-body">
\t\t\t{$body}
\t\t</div>
\t</div>
EOT;
    }
コード例 #4
0
ファイル: Form.class.php プロジェクト: calvinbui/pfsense
    public function __toString()
    {
        $element = parent::__toString();
        $html = implode('', $this->_sections);
        $buttons = '';
        foreach ($this->_global as $global) {
            if ($global instanceof Form_Button) {
                $buttons .= $global;
            } else {
                $html .= $global;
            }
        }
        if (!empty($buttons)) {
            $group = new Form_Element();
            $group->addClass('col-sm-' . Form::MAX_INPUT_WIDTH, 'col-sm-offset-' . Form::LABEL_WIDTH);
            $html .= $group . $buttons . '</div>';
        }
        return <<<EOT
\t{$element}
\t\t{$html}
\t</form>
EOT;
    }
コード例 #5
0
    public function __toString()
    {
        $element = Form_Element::__toString();
        $column = new Form_Element();
        $column->addClass('checkbox', 'multi', 'col-sm-10');
        $inputs = implode('', $this->_inputs);
        $help = $this->_getHelp();
        $label = new Form_Element('label');
        $label->addClass('col-sm-' . Form::LABEL_WIDTH, 'control-label');
        $title = htmlspecialchars(gettext($this->_title));
        return <<<EOT
\t{$element}
\t\t{$label}
\t\t\t{$title}
\t\t</label>

\t\t{$column}
\t\t\t{$inputs}
\t\t</div>

\t\t{$help}
\t</div>
EOT;
    }
コード例 #6
0
ファイル: Input.class.php プロジェクト: william9527/pfsense
 protected function _getInput()
 {
     return parent::__toString();
 }
コード例 #7
0
ファイル: Group.class.php プロジェクト: NewEraCracker/pfsense
    public function __toString()
    {
        global $config, $user_settings;
        $element = parent::__toString();
        // Automatically determine width for inputs without explicit set
        $spaceLeft = Form::MAX_INPUT_WIDTH;
        $missingWidth = array();
        foreach ($this->_inputs as $input) {
            if (count($this->_inputs) > 1 && !$input->hasAttribute('placeholder')) {
                $input->setPlaceholder($input->getTitle());
            }
            $width = $input->getWidth();
            if (isset($width)) {
                $spaceLeft -= $width;
            } else {
                array_push($missingWidth, $input);
            }
        }
        foreach ($missingWidth as $input) {
            $input->setWidth($spaceLeft / count($missingWidth));
        }
        if (strtolower($this->_labelTarget->getType()) == 'hidden') {
            $hidden = true;
        }
        $form_controls = array('input', 'select', 'button', 'textarea', 'option', 'optgroup', 'fieldset', 'label');
        if (in_array(strtolower($this->_labelTarget->getTagName()), $form_controls) && !$hidden) {
            $target = $this->_labelTarget->getId();
        }
        $inputs = implode('', $this->_inputs);
        $help = $this->_getHelp();
        if (!$user_settings['webgui']['webguileftcolumnhyper']) {
            $target = null;
        }
        $label = new Form_Element('label', false, ['for' => $target]);
        $label->addClass('col-sm-' . Form::LABEL_WIDTH, 'control-label');
        if (!empty(trim($this->_title)) || is_numeric($this->_title)) {
            $title = htmlspecialchars(gettext($this->_title));
        }
        return <<<EOT
\t{$element}
\t\t{$label}
\t\t\t{$title}
\t\t</label>
\t\t{$inputs}
\t\t{$help}
\t</div>
EOT;
    }
コード例 #8
0
ファイル: Group.class.php プロジェクト: michaeleino/pfsense
    public function __toString()
    {
        $element = parent::__toString();
        // Automatically determine width for inputs without explicit set
        $spaceLeft = Form::MAX_INPUT_WIDTH;
        $missingWidth = array();
        foreach ($this->_inputs as $input) {
            if (count($this->_inputs) > 1 && !$input->hasAttribute('placeholder')) {
                $input->setPlaceholder($input->getTitle());
            }
            $width = $input->getWidth();
            if (isset($width)) {
                $spaceLeft -= $width;
            } else {
                array_push($missingWidth, $input);
            }
        }
        foreach ($missingWidth as $input) {
            $input->setWidth($spaceLeft / count($missingWidth));
        }
        $target = $this->_labelTarget->getId();
        $inputs = implode('', $this->_inputs);
        $help = $this->_getHelp();
        $label = new Form_Element('label', false, ['for' => $target]);
        $label->addClass('col-sm-' . Form::LABEL_WIDTH, 'control-label');
        $title = htmlspecialchars(gettext($this->_title));
        return <<<EOT
\t{$element}
\t\t{$label}
\t\t\t{$title}
\t\t</label>
\t\t{$inputs}
\t\t{$help}
\t</div>
EOT;
    }