<?php
/**
 * FW Food menu 5.1.1
 * @copyright (C) 2020 Fastw3b
 * @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
 * @link http://www.fastw3b.net/ Official website
 **/

defined('_JEXEC') or die('Restricted access');

JHTML::_('formbehavior.chosen');

JToolBarHelper :: title(JText::_('FWFM_ADMIN_BADGESEDIT_TOOLBAR_TITLE'), 'badge');

echo JLayoutHelper::render('common.menu_begin', array(
    'view' => $this,
    'title' => empty($this->object->id)?JText::_('FWFM_ADMIN_BADGESEDIT_ADD'):JText::sprintf('FWFM_ADMIN_BADGESEDIT_EDIT',$this->object->name),
    'title_hint' => JText::_('FWFM_DOC_ADMIN_BADGESEDIT_HINT').'<span class="uk-align-right uk-badge uk-badge-default"><i uk-icon="puzzle-piece" class="uk-margin-small-right"></i>'.JText::_('FWFM_DOC_ADMIN_BADGES_TITLE').'</span>'
), JPATH_COMPONENT);

if (!$this->plugin_installed or !$this->plugin_enabled) {
?>
<div class="uk-alert uk-alert-danger">
<?php
    if (!$this->plugin_installed) {
        echo JText::_('FWFM_BADGES_PLUGIN_NOT_INSTALLED');
    } else {
        echo JText::_('FWFM_BADGES_PLUGIN_NOT_ENABLED');
    }
?>
</div>
<?php
} else {
    echo JLayoutHelper::render('admin.mealbadges.edit', array('view'=>$this), JPATH_SITE.'/plugins/fwfoodmenu/mealbadges/layouts');
}
echo JLayoutHelper::render('utilites.quick_categories', array('view'=>$this), JPATH_COMPONENT);
echo JLayoutHelper::render('utilites.quick_meals', array('view'=>$this), JPATH_COMPONENT);
echo JLayoutHelper::render('common.menu_end', array(), JPATH_COMPONENT);
