<?php

if (!isset($gCms)) {
    exit;
}
if (!$this->CheckPermission('Manage Calendar Attributes')) {
    return;
}
$this->SetCurrentTab('admin_manage_categories');
$catid = (int) cge_utils::get_param($params, 'catid');
if ($catid < 1) {
    $this->SetError($this->Lang('error_insufficientparams'));
}
try {
    \CGCalendar\category::delete($catid);
    $this->SetMessage($this->Lang('categorydeleted'));
} catch (Exception $e) {
    $this->SetError($e->GetMessage());
}
$this->RedirectToTab();