Your IP : 10.10.0.253


Current Path : /var/www/administrator/components/com_qf3/src/view/
Upload File :
Current File : /var/www/administrator/components/com_qf3/src/view/forms.php

<?php
/**
* @Copyright ((c) plasma-web.ru
        * @license    GPLv2 or later
        */

namespace QuickForm;

\defined('QF3_VERSION') or die;

class viewHtml extends baseView
{
    protected $items;
    protected $projectid;

    public function __construct()
    {
        $this->projectid = (int) $this->get('projectid', $_GET);
        if(! $this->projectid) {
            echo '<script>document.location.href = "index.php?option=com_qf3&view=projects";</script>';
            exit;
        }
        parent::__construct('forms');
        $this->display();
    }

    public function display()
    {
        $this->items = $this->getItems();
        // if(! $this->model->total) {
        //     $this->redirect('projects&task=form.add&projectid=' . $this->projectid);
        // }
        $this->pagination = $this->getPagination();
        $this->projectTitle  = $this->getModel()->getProjectTitle();

        $this->addToolbar();
        $this->addFilters();

        parent::display();
    }

    protected function addToolbar()
    {
        $this->settitle('QuickForm. QF_FIELD_GROUPS');

        $html = '<div class="qf3_toolbar">';
        $html .= $this->toolbarBtn('form.add', 'QF_ADD_NEW', ' green');
        $html .= $this->toolbarBtn('forms.delete', 'Delete', ' red');
        $html .= $this->toolbarBtn('forms.help', 'Help', '');
        $html .= '</div>';
        echo $html;
    }

    protected function addFilters()
    {
        $html = '<div class="qf3_filters">';
        $html .= $this->filtersearch('forms.search');
        $html .= $this->filter('forms.limit', [''=>'12', 24=>'24', 48=>'48']);
        $html .= '</div>';
        echo $html;
    }
}