Skip to content
Snippets Groups Projects
Commit 718920bb authored by Jared Hancock's avatar Jared Hancock
Browse files

i18n: FAQ categories list is translated

parent 062266f9
Branches
Tags
No related merge requests found
...@@ -489,6 +489,7 @@ body { ...@@ -489,6 +489,7 @@ body {
width: 49.7%; width: 49.7%;
display: inline-block; display: inline-block;
box-sizing: border-box; box-sizing: border-box;
vertical-align: top;
} }
.category-name { .category-name {
display: inline-block; display: inline-block;
...@@ -1014,11 +1015,13 @@ img.sign-in-image { ...@@ -1014,11 +1015,13 @@ img.sign-in-image {
} }
.span4 { .span4 {
display: inline-block; display: inline-block;
width: 31%; width: 30.5%;
margin: 0 1%; margin: 0 1%;
vertical-align: top;
} }
.span8 { .span8 {
display: inline-block; display: inline-block;
width: 65%; width: 64.5%;
margin: 0 1%; margin: 0 1%;
vertical-align: top;
} }
...@@ -27,6 +27,10 @@ class Category extends VerySimpleModel { ...@@ -27,6 +27,10 @@ class Category extends VerySimpleModel {
), ),
); );
const VISIBILITY_FEATURED = 2;
const VISIBILITY_PUBLIC = 1;
const VISIBILITY_PRIVATE = 0;
var $_local; var $_local;
/* ------------------> Getter methods <--------------------- */ /* ------------------> Getter methods <--------------------- */
...@@ -34,11 +38,24 @@ class Category extends VerySimpleModel { ...@@ -34,11 +38,24 @@ class Category extends VerySimpleModel {
function getName() { return $this->name; } function getName() { return $this->name; }
function getNumFAQs() { return $this->faqs->count(); } function getNumFAQs() { return $this->faqs->count(); }
function getDescription() { return $this->description; } function getDescription() { return $this->description; }
function getDescriptionWithImages() { return Format::viewableImages($this->description); }
function getNotes() { return $this->notes; } function getNotes() { return $this->notes; }
function getCreateDate() { return $this->created; } function getCreateDate() { return $this->created; }
function getUpdateDate() { return $this->updated; } function getUpdateDate() { return $this->updated; }
function isPublic() { return $this->ispublic; } function isPublic() {
return $this->ispublic != self::VISIBILITY_PRIVATE;
}
function getVisibilityDescription() {
switch ($this->ispublic) {
case self::VISIBILITY_PRIVATE:
return __('Private');
case self::VISIBILITY_PUBLIC:
return __('Public');
case self::VISIBILITY_FEATURED:
return __('Featured');
}
}
function getHashtable() { return $this->ht; } function getHashtable() { return $this->ht; }
// Translation interface ---------------------------------- // Translation interface ----------------------------------
...@@ -50,8 +67,8 @@ class Category extends VerySimpleModel { ...@@ -50,8 +67,8 @@ class Category extends VerySimpleModel {
$T = CustomDataTranslation::translate($tag); $T = CustomDataTranslation::translate($tag);
return $T != $tag ? $T : $this->ht[$subtag]; return $T != $tag ? $T : $this->ht[$subtag];
} }
function getLocalDescription($lang=false) { function getLocalDescriptionWithImages($lang=false) {
return $this->_getLocal('description', $lang); return Format::viewableImages($this->_getLocal('description', $lang));
} }
function getLocalName($lang=false) { function getLocalName($lang=false) {
return $this->_getLocal('name', $lang); return $this->_getLocal('name', $lang);
...@@ -223,7 +240,7 @@ class Category extends VerySimpleModel { ...@@ -223,7 +240,7 @@ class Category extends VerySimpleModel {
static function getFeatured() { static function getFeatured() {
return self::objects()->filter(array( return self::objects()->filter(array(
'ispublic'=>2 'ispublic'=>self::VISIBILITY_FEATURED
)); ));
} }
......
...@@ -22,6 +22,7 @@ class FAQ extends VerySimpleModel { ...@@ -22,6 +22,7 @@ class FAQ extends VerySimpleModel {
'pk' => array('faq_id'), 'pk' => array('faq_id'),
'ordering' => array('question'), 'ordering' => array('question'),
'defer' => array('answer'), 'defer' => array('answer'),
'select_related'=> array('category'),
'joins' => array( 'joins' => array(
'category' => array( 'category' => array(
'constraint' => array( 'constraint' => array(
...@@ -36,6 +37,12 @@ class FAQ extends VerySimpleModel { ...@@ -36,6 +37,12 @@ class FAQ extends VerySimpleModel {
'list' => true, 'list' => true,
'null' => true, 'null' => true,
), ),
'topics' => array(
'constraint' => array(
'faq_id' => 'FaqTopic.faq_id'
),
'null' => true,
),
), ),
); );
...@@ -43,6 +50,10 @@ class FAQ extends VerySimpleModel { ...@@ -43,6 +50,10 @@ class FAQ extends VerySimpleModel {
var $topics; var $topics;
var $_local; var $_local;
const VISIBILITY_PRIVATE = 0;
const VISIBILITY_PUBLIC = 1;
const VISIBILITY_FEATURED = 2;
function __onload() { function __onload() {
if (isset($this->faq_id)) if (isset($this->faq_id))
$this->attachments = new GenericAttachments($this->getId(), 'F'); $this->attachments = new GenericAttachments($this->getId(), 'F');
...@@ -50,7 +61,11 @@ class FAQ extends VerySimpleModel { ...@@ -50,7 +61,11 @@ class FAQ extends VerySimpleModel {
/* ------------------> Getter methods <--------------------- */ /* ------------------> Getter methods <--------------------- */
function getId() { return $this->faq_id; } function getId() { return $this->faq_id; }
function getHashtable() { return $this->ht; } function getHashtable() {
$base = $this->ht;
unset($base['category']);
return $base;
}
function getKeywords() { return $this->keywords; } function getKeywords() { return $this->keywords; }
function getQuestion() { return $this->question; } function getQuestion() { return $this->question; }
function getAnswer() { return $this->answer; } function getAnswer() { return $this->answer; }
...@@ -67,7 +82,20 @@ class FAQ extends VerySimpleModel { ...@@ -67,7 +82,20 @@ class FAQ extends VerySimpleModel {
function getNotes() { return $this->notes; } function getNotes() { return $this->notes; }
function getNumAttachments() { return $this->attachments->count(); } function getNumAttachments() { return $this->attachments->count(); }
function isPublished() { return (!!$this->ispublished && !!$this->category->ispublic); } function isPublished() {
return $this->ispublished != self::VISIBILITY_PRIVATE
&& $this->category->isPublic();
}
function getVisibilityDescription() {
switch ($this->ispublished) {
case self::VISIBILITY_PRIVATE:
return __('Internal');
case self::VISIBILITY_PUBLIC:
return __('Public');
case self::VISIBILITY_FEATURED:
return __('Featured');
}
}
function getCreateDate() { return $this->created; } function getCreateDate() { return $this->created; }
function getUpdateDate() { return $this->updated; } function getUpdateDate() { return $this->updated; }
......
...@@ -2,39 +2,35 @@ ...@@ -2,39 +2,35 @@
if(!defined('OSTSCPINC') || !$thisstaff) die('Access Denied'); if(!defined('OSTSCPINC') || !$thisstaff) die('Access Denied');
$qstr=''; $qstr='';
$sql='SELECT cat.category_id, cat.name, cat.ispublic, cat.updated, count(faq.faq_id) as faqs '. $categories = Category::objects()
' FROM '.FAQ_CATEGORY_TABLE.' cat '. ->annotate(array('faq_count'=>Aggregate::COUNT('faqs')));
' LEFT JOIN '.FAQ_TABLE.' faq ON (faq.category_id=cat.category_id) '; $sortOptions=array('name'=>'name','type'=>'ispublic','faqs'=>'faq_count','updated'=>'updated');
$sql.=' WHERE 1'; $orderWays=array('DESC'=>'-','ASC'=>'');
$sortOptions=array('name'=>'cat.name','type'=>'cat.ispublic','faqs'=>'faqs','updated'=>'cat.updated');
$orderWays=array('DESC'=>'DESC','ASC'=>'ASC');
$sort=($_REQUEST['sort'] && $sortOptions[strtolower($_REQUEST['sort'])])?strtolower($_REQUEST['sort']):'name'; $sort=($_REQUEST['sort'] && $sortOptions[strtolower($_REQUEST['sort'])])?strtolower($_REQUEST['sort']):'name';
//Sorting options... //Sorting options...
if($sort && $sortOptions[$sort]) { if($sort && $sortOptions[$sort]) {
$order_column =$sortOptions[$sort]; $order_column =$sortOptions[$sort];
} }
$order_column=$order_column?$order_column:'cat.name'; $order_column=$order_column ?: 'name';
if($_REQUEST['order'] && $orderWays[strtoupper($_REQUEST['order'])]) { if($_REQUEST['order'] && $orderWays[strtoupper($_REQUEST['order'])]) {
$order=$orderWays[strtoupper($_REQUEST['order'])]; $order=$orderWays[strtoupper($_REQUEST['order'])];
} }
$order=$order?$order:'ASC'; $order=$order ?: '';
if($order_column && strpos($order_column,',')){
$order_column=str_replace(','," $order,",$order_column);
}
$x=$sort.'_sort'; $x=$sort.'_sort';
$$x=' class="'.strtolower($order).'" '; $$x=' class="'.strtolower($order).'" ';
$order_by="$order_column $order "; $order_by="$order_column $order ";
$total=db_count('SELECT count(*) FROM '.FAQ_CATEGORY_TABLE.' cat '); $total=$categories->count();
$page=($_GET['p'] && is_numeric($_GET['p']))?$_GET['p']:1; $page=($_GET['p'] && is_numeric($_GET['p']))?$_GET['p']:1;
$pageNav=new Pagenate($total, $page, PAGE_LIMIT); $pageNav=new Pagenate($total, $page, PAGE_LIMIT);
$pageNav->setURL('categories.php',$qstr.'&sort='.urlencode($_REQUEST['sort']).'&order='.urlencode($_REQUEST['order'])); $pageNav->setURL('categories.php',$qstr.'&sort='.urlencode($_REQUEST['sort']).'&order='.urlencode($_REQUEST['order']));
$qstr.='&order='.($order=='DESC'?'ASC':'DESC'); $qstr.='&order='.($order=='DESC'?'ASC':'DESC');
$query="$sql GROUP BY cat.category_id ORDER BY $order_by LIMIT ".$pageNav->getStart().",".$pageNav->getLimit();
$res=db_query($query); $categories = $categories->offset($pageNav->getStart())
if($res && ($num=db_num_rows($res))) ->limit($pageNav->getLimit());
if ($total)
$showing=$pageNav->showing().' '.__('categories'); $showing=$pageNav->showing().' '.__('categories');
else else
$showing=__('No FAQ categories found!'); $showing=__('No FAQ categories found!');
...@@ -65,29 +61,27 @@ else ...@@ -65,29 +61,27 @@ else
<?php <?php
$total=0; $total=0;
$ids=($errors && is_array($_POST['ids']))?$_POST['ids']:null; $ids=($errors && is_array($_POST['ids']))?$_POST['ids']:null;
if($res && db_num_rows($res)): foreach ($categories as $C) {
while ($row = db_fetch_array($res)) { $sel=false;
$sel=false; if ($ids && in_array($C->getId(), $ids))
if($ids && in_array($row['category_id'],$ids)) $sel=true;
$sel=true;
$faqs=0; $faqs=0;
if($row['faqs']) if ($C->faq_count)
$faqs=sprintf('<a href="faq.php?cid=%d">%d</a>',$row['category_id'],$row['faqs']); $faqs=sprintf('<a href="faq.php?cid=%d">%d</a>',$C->getId(),$C->faq_count);
?> ?>
<tr id="<?php echo $row['category_id']; ?>"> <tr id="<?php echo $C->getId(); ?>">
<td width=7px> <td width=7px>
<input type="checkbox" name="ids[]" value="<?php echo $row['category_id']; ?>" class="ckb" <input type="checkbox" name="ids[]" value="<?php echo $C->getId(); ?>" class="ckb"
<?php echo $sel?'checked="checked"':''; ?>> <?php echo $sel?'checked="checked"':''; ?>>
</td> </td>
<td><a href="categories.php?id=<?php echo $row['category_id']; ?>"><?php echo Format::truncate($row['name'],200); ?></a>&nbsp;</td> <td><a class="truncate" style="width:500px" href="categories.php?id=<?php echo $C->getId(); ?>"><?php
<td><?php echo $row['ispublic']?'<b>'.__('Public').'</b>':__('Internal'); ?></td> echo $C->getLocalName(); ?></a></td>
<td><?php echo $C->getVisibilityDescription(); ?></td>
<td style="text-align:right;padding-right:25px;"><?php echo $faqs; ?></td> <td style="text-align:right;padding-right:25px;"><?php echo $faqs; ?></td>
<td>&nbsp;<?php echo Format::db_datetime($row['updated']); ?></td> <td>&nbsp;<?php echo Format::db_datetime($C->updated); ?></td>
</tr> </tr><?php
<?php } // end of foreach ?>
} //end of while.
endif; ?>
<tfoot> <tfoot>
<tr> <tr>
<td colspan="5"> <td colspan="5">
......
...@@ -10,21 +10,19 @@ if(!defined('OSTSTAFFINC') || !$thisstaff) die('Access Denied'); ...@@ -10,21 +10,19 @@ if(!defined('OSTSTAFFINC') || !$thisstaff) die('Access Denied');
<select name="cid" id="cid"> <select name="cid" id="cid">
<option value="">&mdash; <?php echo __('All Categories');?> &mdash;</option> <option value="">&mdash; <?php echo __('All Categories');?> &mdash;</option>
<?php <?php
$sql='SELECT category_id, name, count(faq.category_id) as faqs ' $categories = Category::objects()
.' FROM '.FAQ_CATEGORY_TABLE.' cat ' ->annotate(array('faq_count'=>Aggregate::COUNT('faqs')))
.' LEFT JOIN '.FAQ_TABLE.' faq USING(category_id) ' ->filter(array('faq_count__gt'=>0))
.' GROUP BY cat.category_id ' ->order_by('name');
.' HAVING faqs>0 ' print $categories;
.' ORDER BY cat.name DESC '; foreach ($categories as $C) {
if(($res=db_query($sql)) && db_num_rows($res)) { echo sprintf('<option value="%d" %s>%s (%d)</option>',
while($row=db_fetch_array($res)) $C->getId(),
echo sprintf('<option value="%d" %s>%s (%d)</option>', ($_REQUEST['cid'] && $C->getId()==$_REQUEST['cid']?'selected="selected"':''),
$row['category_id'], $C->getLocalName(),
($_REQUEST['cid'] && $row['category_id']==$_REQUEST['cid']?'selected="selected"':''), $C->faq_count
$row['name'], );
$row['faqs']); } ?>
}
?>
</select> </select>
<input id="searchSubmit" type="submit" value="<?php echo __('Search');?>"> <input id="searchSubmit" type="submit" value="<?php echo __('Search');?>">
</div> </div>
...@@ -32,19 +30,18 @@ if(!defined('OSTSTAFFINC') || !$thisstaff) die('Access Denied'); ...@@ -32,19 +30,18 @@ if(!defined('OSTSTAFFINC') || !$thisstaff) die('Access Denied');
<select name="topicId" style="width:350px;" id="topic-id"> <select name="topicId" style="width:350px;" id="topic-id">
<option value="">&mdash; <?php echo __('All Help Topics');?> &mdash;</option> <option value="">&mdash; <?php echo __('All Help Topics');?> &mdash;</option>
<?php <?php
$sql='SELECT ht.topic_id, CONCAT_WS(" / ", pht.topic, ht.topic) as helptopic, count(faq.topic_id) as faqs ' $topics = Topic::objects()
.' FROM '.TOPIC_TABLE.' ht ' ->annotate(array('faq_count'=>Aggregate::COUNT('faqs')))
.' LEFT JOIN '.TOPIC_TABLE.' pht ON (pht.topic_id=ht.topic_pid) ' ->filter(array('faq_count__gt'=>0))
.' LEFT JOIN '.FAQ_TOPIC_TABLE.' faq ON(faq.topic_id=ht.topic_id) ' ->all();
.' GROUP BY ht.topic_id ' usort($topics, function($a, $b) {
.' HAVING faqs>0 ' return strcmp($a->getFullName(), $b->getFullName());
.' ORDER BY helptopic'; });
if(($res=db_query($sql)) && db_num_rows($res)) { foreach ($topics as $T) {
while($row=db_fetch_array($res)) echo sprintf('<option value="%d" %s>%s (%d)</option>',
echo sprintf('<option value="%d" %s>%s (%d)</option>', $T->getId(),
$row['topic_id'], ($_REQUEST['topicId'] && $T->getId()==$_REQUEST['topicId']?'selected="selected"':''),
($_REQUEST['topicId'] && $row['topic_id']==$_REQUEST['topicId']?'selected="selected"':''), $T->getFullName(), $T->faq_count);
$row['helptopic'], $row['faqs']);
} }
?> ?>
</select> </select>
...@@ -54,39 +51,36 @@ if(!defined('OSTSTAFFINC') || !$thisstaff) die('Access Denied'); ...@@ -54,39 +51,36 @@ if(!defined('OSTSTAFFINC') || !$thisstaff) die('Access Denied');
<div> <div>
<?php <?php
if($_REQUEST['q'] || $_REQUEST['cid'] || $_REQUEST['topicId']) { //Search. if($_REQUEST['q'] || $_REQUEST['cid'] || $_REQUEST['topicId']) { //Search.
$sql='SELECT faq.faq_id, question, ispublished, count(attach.file_id) as attachments, count(ft.topic_id) as topics ' $faqs = FAQ::objects()
.' FROM '.FAQ_TABLE.' faq ' ->annotate(array(
.' LEFT JOIN '.FAQ_CATEGORY_TABLE.' cat ON(cat.category_id=faq.category_id) ' 'attachment_count'=>Aggregate::COUNT('attachments'),
.' LEFT JOIN '.FAQ_TOPIC_TABLE.' ft ON(ft.faq_id=faq.faq_id) ' 'topic_count'=>Aggregate::COUNT('topics')
.' LEFT JOIN '.ATTACHMENT_TABLE.' attach ))
ON(attach.object_id=faq.faq_id AND attach.type=\'F\' AND attach.inline = 0) ' ->order_by('question');
.' WHERE 1 ';
if($_REQUEST['cid']) if ($_REQUEST['cid'])
$sql.=' AND faq.category_id='.db_input($_REQUEST['cid']); $faqs->filter(array('category_id'=>$_REQUEST['cid']));
if($_REQUEST['topicId']) if ($_REQUEST['topicId'])
$sql.=' AND ft.topic_id='.db_input($_REQUEST['topicId']); $faqs->filter(array('topic_id'=>$_REQUEST['topicId']));
if($_REQUEST['q']) {
$sql.=" AND (question LIKE ('%".db_input($_REQUEST['q'],false)."%')
OR answer LIKE ('%".db_input($_REQUEST['q'],false)."%')
OR keywords LIKE ('%".db_input($_REQUEST['q'],false)."%')
OR cat.name LIKE ('%".db_input($_REQUEST['q'],false)."%')
OR cat.description LIKE ('%".db_input($_REQUEST['q'],false)."%')
)";
}
$sql.=' GROUP BY faq.faq_id ORDER BY question'; if ($_REQUEST['q'])
$faqs->filter(Q::ANY(array(
'question__contains'=>$_REQUEST['q'],
'answer__contains'=>$_REQUEST['q'],
'keywords__contains'=>$_REQUEST['q'],
'category__name__contains'=>$_REQUEST['q'],
'category__description__contains'=>$_REQUEST['q'],
)));
echo "<div><strong>".__('Search Results')."</strong></div><div class='clear'></div>"; echo "<div><strong>".__('Search Results')."</strong></div><div class='clear'></div>";
if(($res=db_query($sql)) && db_num_rows($res)) { if ($faqs->exists(true)) {
echo '<div id="faq"> echo '<div id="faq">
<ol>'; <ol>';
while($row=db_fetch_array($res)) { foreach ($faqs as $F) {
echo sprintf(' echo sprintf(
<li><a href="faq.php?id=%d" class="previewfaq">%s</a> - <span>%s</span></li>', '<li><a href="faq.php?id=%d" class="previewfaq">%s</a> - <span>%s</span></li>',
$row['faq_id'],$row['question'],$row['ispublished']?__('Published'):__('Internal')); $F->getId(), $F->getLocalQuestion(), $F->getVisibilityDescription());
} }
echo ' </ol> echo ' </ol>
</div>'; </div>';
...@@ -94,23 +88,25 @@ if($_REQUEST['q'] || $_REQUEST['cid'] || $_REQUEST['topicId']) { //Search. ...@@ -94,23 +88,25 @@ if($_REQUEST['q'] || $_REQUEST['cid'] || $_REQUEST['topicId']) { //Search.
echo '<strong class="faded">'.__('The search did not match any FAQs.').'</strong>'; echo '<strong class="faded">'.__('The search did not match any FAQs.').'</strong>';
} }
} else { //Category Listing. } else { //Category Listing.
$sql='SELECT cat.category_id, cat.name, cat.description, cat.ispublic, count(faq.faq_id) as faqs ' $categories = Category::objects()
.' FROM '.FAQ_CATEGORY_TABLE.' cat ' ->annotate(array('faq_count'=>Aggregate::COUNT('faqs')))
.' LEFT JOIN '.FAQ_TABLE.' faq ON(faq.category_id=cat.category_id) ' ->all();
.' GROUP BY cat.category_id '
.' ORDER BY cat.name'; if (count($categories)) {
if(($res=db_query($sql)) && db_num_rows($res)) { usort($categories, function($a, $b) {
return strcmp($a->getLocalName(), $b->getLocalName());
});
echo '<div>'.__('Click on the category to browse FAQs or manage its existing FAQs.').'</div> echo '<div>'.__('Click on the category to browse FAQs or manage its existing FAQs.').'</div>
<ul id="kb">'; <ul id="kb">';
while($row=db_fetch_array($res)) { foreach ($categories as $C) {
echo sprintf(' echo sprintf('
<li> <li>
<h4><a href="kb.php?cid=%d">%s (%d)</a> - <span>%s</span></h4> <h4><a class="truncate" style="max-width:600px" href="kb.php?cid=%d">%s (%d)</a> - <span>%s</span></h4>
%s %s
</li>',$row['category_id'],$row['name'],$row['faqs'], </li>',$C->getId(),$C->getLocalName(),$C->faq_count,
($row['ispublic']?__('Public'):__('Internal')), $C->getVisibilityDescription(),
Format::safe_html($row['description'])); Format::safe_html($C->getLocalDescriptionWithImages())
);
} }
echo '</ul>'; echo '</ul>';
} else { } else {
......
...@@ -49,9 +49,9 @@ if ($otherLangs) { ?> ...@@ -49,9 +49,9 @@ if ($otherLangs) { ?>
<div><strong><?php echo __('Other Languages'); ?></strong></div> <div><strong><?php echo __('Other Languages'); ?></strong></div>
<?php <?php
foreach ($otherLangs as $lang) { ?> foreach ($otherLangs as $lang) { ?>
<a href="faq.php?kblang=<?php echo $lang; ?>&id=<?php echo $faq->getId(); ?>"> <div><a href="faq.php?kblang=<?php echo $lang; ?>&id=<?php echo $faq->getId(); ?>">
<?php echo Internationalization::getLanguageDescription($lang); ?> <?php echo Internationalization::getLanguageDescription($lang); ?>
</a> </a></div>
<?php } ?> <?php } ?>
</section> </section>
<?php } ?> <?php } ?>
......
...@@ -14,7 +14,7 @@ if($faq){ ...@@ -14,7 +14,7 @@ if($faq){
$qstr='id='.$faq->getId(); $qstr='id='.$faq->getId();
$langs = $cfg->getSecondaryLanguages(); $langs = $cfg->getSecondaryLanguages();
$translations = $faq->getAllTranslations(); $translations = $faq->getAllTranslations();
foreach ($cfg->getSecondaryLanguages() as $tag) { foreach ($langs as $tag) {
foreach ($translations as $t) { foreach ($translations as $t) {
if (strcasecmp($t->lang, $tag) === 0) { if (strcasecmp($t->lang, $tag) === 0) {
$trans = $t->getComplex(); $trans = $t->getComplex();
...@@ -102,10 +102,10 @@ if ($topics = Topic::getAllHelpTopics()) { ...@@ -102,10 +102,10 @@ if ($topics = Topic::getAllHelpTopics()) {
<?php echo __('Featured (promote to front page)'); ?> <?php echo __('Featured (promote to front page)'); ?>
</option> </option>
<option value="1" <?php echo $info['ispublished'] ? 'selected="selected"' : ''; ?>> <option value="1" <?php echo $info['ispublished'] ? 'selected="selected"' : ''; ?>>
<?php echo __('Public (publish)'); ?> <?php echo __('Public').' '.__('(publish)'); ?>
</option> </option>
<option value="0" <?php echo !$info['ispublished'] ? 'selected="selected"' : ''; ?>> <option value="0" <?php echo !$info['ispublished'] ? 'selected="selected"' : ''; ?>>
<?php echo __('Internal (private)'); ?> <?php echo __('Internal').' '.('(private)'); ?>
</option> </option>
</select> </select>
<div class="error"><?php echo $errors['ispublished']; ?></div> <div class="error"><?php echo $errors['ispublished']; ?></div>
...@@ -125,6 +125,7 @@ if ($topics = Topic::getAllHelpTopics()) { ...@@ -125,6 +125,7 @@ if ($topics = Topic::getAllHelpTopics()) {
<strong><?php echo __('Knowledgebase Article Content'); ?></strong><br/> <strong><?php echo __('Knowledgebase Article Content'); ?></strong><br/>
<?php echo __('Here you can manage the question and answer for the article. Multiple languages are available if enabled in the admin panel.'); ?> <?php echo __('Here you can manage the question and answer for the article. Multiple languages are available if enabled in the admin panel.'); ?>
<div class="clear"></div> <div class="clear"></div>
<?php <?php
$langs = Internationalization::getConfiguredSystemLanguages(); $langs = Internationalization::getConfiguredSystemLanguages();
if ($faq) { ?> if ($faq) { ?>
......
...@@ -15,6 +15,7 @@ ...@@ -15,6 +15,7 @@
**********************************************************************/ **********************************************************************/
require('admin.inc.php'); require('admin.inc.php');
include_once(INCLUDE_DIR.'class.topic.php'); include_once(INCLUDE_DIR.'class.topic.php');
include_once(INCLUDE_DIR.'class.faq.php');
require_once(INCLUDE_DIR.'class.dynamic_forms.php'); require_once(INCLUDE_DIR.'class.dynamic_forms.php');
$topic=null; $topic=null;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment