<?php

namespace TourOperatorProAdminWooPanel\app\views\smscontent;

use TourOperatorPro\Html\ToolBar;
use TourOperatorPro\Mvc\Model\Model;
use TourOperatorPro\Mvc\View\View;
use TourOperatorPro\Factory as FactoryAlias;

class SmscontentView extends View
{
    public function display($tpl)
    {

        $modelsms = Model::getInstance("smscontent");
        $input = FactoryAlias::getInput();
        switch ($tpl) {
            case "list":
                ToolBar::add("smscontent.add");
                ToolBar::delete("smscontent.delete_list");
                ToolBar::_clone("smscontent.clone_list");
                $model = Model::getInstance("smscontent");
                $this->list = $model->getList();
                break;
            case "form":
                ToolBar::setTitle('Edit smscontent');
                ToolBar::apply("smscontent.apply");
                ToolBar::save("smscontent.save");
                ToolBar::cancel("smscontent.cancel");
                ToolBar::back_to_list("smscontent.back_to_list");
                $id = $input->getInt('id', 0);
                $this->item = $modelsms->getItem($id);
                $this->form = $modelsms->getForm();
                break;
        }
        return parent::display($tpl);
    }
}