menu->params); $template = $params->get('template'); if (!isset($id)) { $id = $params->get('default_category'); } if (!$id) { trigger_error('Failed get id', E_USER_WARNING); mosNotAuth(); return; } if (!preg_match('/^[1-9][0-9]*$/', $id)) { trigger_error("Failed get id: {$id}", E_USER_WARNING); mosNotAuth(); return; } $id = (int) $id; global $database; $category = new mosCategory($database); $result = $category->load($id); if (!$result) { trigger_error("Unknown category: {$id}", E_USER_WARNING); mosNotAuth(); return; } $access = (int) $category->access; if ($access > $gid) { trigger_error("User can not access category: {$id}", E_USER_WARNING); mosNotAuth(); return; } $section = new mosSection($database); $result = $section->load($category->section); if (!$result) { trigger_error("Unknown section: {$category->section}", E_USER_WARNING); mosNotAuth(); return; } $access = (int) $section->access; if ($access > $gid) { trigger_error("User can not access category: {$id}", E_USER_WARNING); mosNotAuth(); return; } $unpublish = $params->get('unpublish'); if (!$unpublish && (!$category->published || !$section->published)) { trigger_error("Category unpublish: {$id}", E_USER_NOTICE); mosNotAuth(); return; } if ($params->get('category_page_title')) { $mainframe->setPageTitle($category->title); } else if ($params->get('menu_page_title')) { $mainframe->setPageTitle($mainframe->menu->name); } require_once $mainframe->getPath('front_html', $option); $html = new HTML_kingyoya_category_view(); $html->option = $option; $html->id = $id; $Itemid and $html->Itemid = $Itemid; $html->category = $category; $html->section = $section; $html->template = preg_replace('#
#i', "\n", $template); $html->show(); } } if ($option === 'com_kingyoya_category_view') { TASK_kingyoya_category_view::show($option, $gid, isset($_REQUEST['id']) ? $_REQUEST['id'] : null, $Itemid); }