1<?php 2if(!defined('OSTCLIENTINC') || !$category || !$category->isPublic()) die('Access Denied'); 3?> 4<div class="row"> 5<div class="span8"> 6 <h1><?php echo $category->getFullName(); ?></h1> 7<p> 8<?php echo Format::safe_html($category->getLocalDescriptionWithImages()); ?> 9</p> 10<?php 11 12if (($subs=$category->getSubCategories(array('public' => true)))) { 13 echo '<div>'; 14 foreach ($subs as $c) { 15 echo sprintf('<div><i class="icon-folder-open-alt"></i> 16 <a href="faq.php?cid=%d">%s (%d)</a></div>', 17 $c->getId(), 18 $c->getLocalName(), 19 $c->getNumFAQs() 20 ); 21 } 22 echo '</div>'; 23} ?> 24<hr> 25<?php 26$faqs = FAQ::objects() 27 ->filter(array('category'=>$category)) 28 ->exclude(array('ispublished'=>FAQ::VISIBILITY_PRIVATE)) 29 ->annotate(array('has_attachments' => SqlAggregate::COUNT(SqlCase::N() 30 ->when(array('attachments__inline'=>0), 1) 31 ->otherwise(null) 32 ))) 33 ->order_by('-ispublished', 'question'); 34 35if ($faqs->exists(true)) { 36 echo ' 37 <h2>'.__('Frequently Asked Questions').'</h2> 38 <div id="faq"> 39 <ol>'; 40foreach ($faqs as $F) { 41 $attachments=$F->has_attachments?'<span class="Icon file"></span>':''; 42 echo sprintf(' 43 <li><a href="faq.php?id=%d" >%s %s</a></li>', 44 $F->getId(),Format::htmlchars($F->question), $attachments); 45 } 46 echo ' </ol> 47 </div>'; 48} elseif (!$category->children) { 49 echo '<strong>'.__('This category does not have any FAQs.').' <a href="index.php">'.__('Back To Index').'</a></strong>'; 50} 51?> 52</div> 53 54<div class="span4"> 55 <div class="sidebar"> 56 <div class="searchbar"> 57 <form method="get" action="faq.php"> 58 <input type="hidden" name="a" value="search"/> 59 <input type="text" name="q" class="search" placeholder="<?php 60 echo __('Search our knowledge base'); ?>"/> 61 <input type="submit" style="display:none" value="search"/> 62 </form> 63 </div> 64 <div class="content"> 65 <section> 66 <div class="header"><?php echo __('Help Topics'); ?></div> 67<?php 68foreach (Topic::objects() 69 ->filter(array('faqs__faq__category__category_id'=>$category->getId())) 70 ->distinct('topic_id') 71 as $t) { ?> 72 <a href="?topicId=<?php echo urlencode($t->getId()); ?>" 73 ><?php echo $t->getFullName(); ?></a> 74<?php } ?> 75 </section> 76 </div> 77 </div> 78</div> 79</div> 80