/home/web-project.uk/billing.web-project.uk/vendors/monolog/monolog/src/Monolog/ErrorHandler.php
/home/web-project.uk/billing.web-project.uk/plugins/support_manager/controllers/knowledgebase.php
/home/web-project.uk/billing.web-project.uk/vendors/minphp/bridge/src/Lib/Dispatcher.php
/home/web-project.uk/billing.web-project.uk/index.php
$category = null;
$logged_in = $this->isLoggedIn();
if ($current_category_id !== null
&& ($category = $this->SupportManagerKbCategories->get($current_category_id))
) {
// This category cannot be viewed if it is hidden, and is only accessible to users that are logged in
if ($category->company_id != $this->company_id || $category->access == 'hidden'
|| ($category->access == 'private' && !$logged_in)
) {
$category = null;
}
}
// Fetch popular articles on the home/overview page
$access = array_merge(['public'], ($logged_in ? ['private'] : []));
if ($category === null) {
// Fetch the popular articles
$popular_articles = $this->SupportManagerKbArticles->getPopular(
$this->company_id,
null,
$access,
(int)Configure::get('SupportManager.max_kb_popular_articles')
);
// Set the article content language to use into the article
foreach ($popular_articles as &$article) {
$article = (object)array_merge((array)$article, (array)$this->getArticleContent($article));
$article->uri_title = $this->getArticleTitleUri($article);
}
$this->set('popular_articles', $popular_articles);
} else {
// Fetch articles from this category
$articles = $this->SupportManagerKbArticles->getAll($this->company_id, $category->id, $access);
// Set the article content language to use into the article
foreach ($articles as &$article) {
$article = (object)array_merge((array)$article, (array)$this->getArticleContent($article));
$article->uri_title = $this->getArticleTitleUri($article);
}
$this->set('articles', $articles);
}
// Only show breadcrumbs on subcategory pages
if ($category) {
$this->setBreadCrumbs($category);
}
$this->set(
'categories',
$this->SupportManagerKbCategories->getAll($this->company_id, $current_category_id, false, $access)
);
$this->set('current_category', $category);
$this->setSearchBar();
}
/**
* List article results
*/
public function search()
{
$logged_in = $this->isLoggedIn();
$access = array_merge(['public'], ($logged_in ? ['private'] : []));
$page = (isset($this->get[0]) ? (int)$this->get[0] : 1);
$total_results = 0;
$search = '';