<?php

namespace TourOperatorProAdmin\app\views\emailaccount;

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

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

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