PATH:
home
/
centosnipponia
/
public_html
/
ticketing.nipponia.com
/
osta
/
templates
<?php /* osta start - Unified Sidebar Replaces fragmented sidebars across Client Portal with a consistent, conditional sidebar. Each section only displays if content exists. Sections: 1. Attachments (only on FAQ detail pages if attachments exist) 2. Featured FAQs (if any marked featured) 3. Help Topics (if any public topics exist) 4. Knowledgebase Categories (if KB enabled + categories exist) 5. Other Resources (if pages of type 'other' exist) 6. Search (always - at bottom) */ ?> <div class="sidebar"> <!--osta start - unified sidebar--> <?php //osta - FAQ Attachments (only shown on FAQ detail page if $faq exists and has attachments) if (isset($faq) && ($attachments = $faq->getLocalAttachments()->all())) { ?> <div class="content"> <section> <div class="header"><?php echo __('Attachments'); ?></div> <?php foreach ($attachments as $att) { ?> <div> <a href="<?php echo $att->file->getDownloadUrl(['id' => $att->getId()]); ?>" class="no-pjax"> <i class="icon-file"></i> <?php echo Format::htmlchars($att->getFilename()); ?> </a> </div> <?php } ?> </section> </div> <?php } ?> <div class="content"> <?php // Featured FAQs - only if KB enabled and featured FAQs exist if ($cfg->isKnowledgebaseEnabled()) { $featured = FAQ::getFeatured()->select_related('category')->limit(5); if ($featured->all()) { ?> <section> <div class="header"><?php echo __('Featured Questions'); ?></div> <?php foreach ($featured as $F) { ?> <div><a href="<?php echo ROOT_PATH; ?>kb/faq.php?id=<?php echo urlencode($F->getId()); ?>"><?php echo $F->getLocalQuestion(); ?></a></div> <?php } ?> </section> <?php } } // Help Topics - only if public topics with FAQs exist // osta - using pattern from original kb-search.inc.php $topics = Topic::objects() ->annotate(array('faqs_count'=>SqlAggregate::COUNT('faqs'))) ->filter(array('faqs_count__gt'=>0)); if ($topics->all()) { ?> <section> <div class="header"><?php echo __('Help Topics'); ?></div> <?php foreach ($topics as $T) { ?> <div><a href="<?php echo ROOT_PATH; ?>kb/faq.php?topicId=<?php echo urlencode($T->getId()); ?>"><?php echo $T->getFullName(); ?></a></div> <?php } ?> </section> <?php } // Knowledgebase Categories - only if KB enabled and public categories exist // osta - using pattern from original kb-search.inc.php if ($cfg->isKnowledgebaseEnabled()) { $categories = Category::objects() ->exclude(Q::any(array('ispublic'=>Category::VISIBILITY_PRIVATE))) ->annotate(array('faqs_count'=>SqlAggregate::COUNT('faqs'))) ->filter(array('faqs_count__gt'=>0)); if ($categories->all()) { ?> <section> <div class="header"><?php echo __('Knowledgebase'); ?></div> <?php foreach ($categories as $C) { ?> <div><a href="<?php echo ROOT_PATH; ?>kb/faq.php?cid=<?php echo urlencode($C->getId()); ?>"><?php echo $C->getLocalName(); ?></a></div> <?php } ?> </section> <?php } } // Other Resources - only if pages of type 'other' exist $resources = Page::getActivePages()->filter(array('type'=>'other')); if ($resources->all()) { ?> <section> <div class="header"><?php echo __('Other Resources'); ?></div> <?php foreach ($resources as $page) { ?> <div><a href="<?php echo ROOT_PATH; ?>pages/<?php echo $page->getNameAsSlug(); ?>"><?php echo $page->getLocalName(); ?></a></div> <?php } ?> </section> <?php } ?> </div> <!-- Search - Always visible, at bottom --> <div class="searchbar"> <form method="get" action="<?php echo ROOT_PATH; ?>kb/faq.php"> <input type="hidden" name="a" value="search"/> <div class="sidebar-search-container"> <input type="text" name="q" class="search" placeholder="<?php echo __('Search our Knowledge Base'); ?>"/> <button type="submit" class="sidebar-search-btn"><i class="icon-search"></i></button> </div> </form> </div> <!--osta end - unified sidebar--> </div>
[+]
..
[-] sidebar-unified.inc.php
[edit]
[-] .htaccess.disabled
[edit]