<?php

namespace ThurData\Servers\KerioEmail\Core\UI\Widget\CategoryMenu;

use ThurData\Servers\KerioEmail\Core\UI\Builder\BaseContainer;

/**
 * Container controler for category menu with dynemic content
 *
 * @autor ThurData <info@thurdata.ch>
 */
class CategoryMenuDynamicContent extends BaseContainer implements \ThurData\Servers\KerioEmail\Core\UI\Interfaces\AjaxElementInterface
{
    
    use \ThurData\Servers\KerioEmail\Core\UI\Traits\DatatableActionButtons;
    use \ThurData\Servers\KerioEmail\Core\UI\Traits\VSortable;
    
    protected $id                  = 'categoryMenuDynamicContent';
    protected $defaultTemplateName = 'categoryMenuDynamicContent';
    protected $searchable          = true;

    protected $vueComponent            = true;
    protected $defaultVueComponentName = 'category-menu';

    //todo add default returnAjaxData method for this menu
    public function returnAjaxData()
    {
        return (new ResponseTemplates\RawDataJsonResponse($this->elements))->setCallBackFunction($this->callBackFunction)->setRefreshTargetIds($this->refreshActionIds);
        //needs to be overwritten
        //use $this->getSearchKey(); to get search keyword
    }

    public function initContent()
    {
        //needs to be overwritten
    }
}
