manage_kb uses new style

merge-requests/27/head
Mike Koch 8 years ago
parent d1145b0e98
commit 44f90c595a

@ -492,35 +492,6 @@ if (!isset($_SESSION['hide']['new_article']))
</form>
</section>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td>
<div align="center">
<table border="0">
<tr>
<td>
<form action="manage_knowledgebase.php" method="post" name="form1" enctype="multipart/form-data">
<p>&nbsp;<br /><br />
<br />&nbsp;
</p>
<p align="center"></p>
</form>
</td>
</tr>
</table>
</div>
</td>
</tr>
</table>
<?php
} // END hide article
@ -538,13 +509,10 @@ if (!isset($_SESSION['hide']['new_category']))
<li><a href="manage_knowledgebase.php"><?php echo $hesklang['kb']; ?></a></li>
<li class="active"><?php echo $hesklang['kb_cat_new']; ?></li>
</ol>
<!-- SUB NAVIGATION -->
<section class="content">
<?php show_subnav('newc'); ?>
<!-- SUB NAVIGATION -->
<div class="row">
<div class="col-md-4 move-right-40">
<div class="col-md-5">
<?php
/* Show the treemenu? */
if (isset($_SESSION['hide']['cat_treemenu']))
@ -553,11 +521,20 @@ if (!isset($_SESSION['hide']['new_category']))
}
?>
</div>
<div class="col-md-7 move-left-20">
<div class="col-md-7">
<form action="manage_knowledgebase.php" class="form-horizontal" method="post" role="form" name="form2" data-toggle="validator">
<h3><a name="new_category"></a><?php echo $hesklang['kb_cat_new']; ?></h3>
<div class="footerWithBorder blankSpace"></div>
<div class="box">
<div class="box-header with-border">
<h1 class="box-title">
<a name="new_category"></a><?php echo $hesklang['kb_cat_new']; ?>
</h1>
<div class="box-tools pull-right">
<button type="button" class="btn btn-box-tool" data-widget="collapse">
<i class="fa fa-minus"></i>
</button>
</div>
</div>
<div class="box-body">
<div class="form-group">
<label for="title" class="col-sm-3 control-label"><?php echo $hesklang['kb_cat_title']; ?></label>
<div class="col-sm-9">
@ -594,12 +571,14 @@ if (!isset($_SESSION['hide']['new_category']))
</div>
</div>
</div>
</div>
</div>
</form>
</div>
</div>
</section>
<?php
} // END hide new category form
/* Clean unneeded session variables */
@ -627,49 +606,47 @@ function list_draft() {
/* Print main manage users page */
require_once(HESK_PATH . 'inc/show_admin_nav.inc.php');
?>
</td>
</tr>
<tr>
<td>
<ol class="breadcrumb">
<li><a href="manage_knowledgebase.php"><?php echo $hesklang['kb']; ?></a></li>
<li class="active"><?php echo $hesklang['kb_cat_man']; ?></li>
</ol>
<!-- SUB NAVIGATION -->
<?php show_subnav('',$catid); ?>
<!-- SUB NAVIGATION -->
<section class="content">
<?php
show_subnav('',$catid);
$res = hesk_dbQuery("SELECT * FROM `". hesk_dbEscape($hesk_settings['db_pfix'])."kb_articles` WHERE `type`='2' ORDER BY `catid` ASC, `id` ASC");
$num = hesk_dbNumRows($res);
?>
<div class="box">
<div class="box-header with-border">
<h1 class="box-title">
<?php echo $hesklang['artd']; ?>
</h1>
<div class="box-tools pull-right">
<button type="button" class="btn btn-box-tool" data-widget="collapse">
<i class="fa fa-minus"></i>
</button>
</div>
</div>
<div class="box-body">
<?php
if ($num == 0)
{
echo '<p class="move-right-40">'.$hesklang['kb_no_dart'].' &nbsp; <a href="manage_knowledgebase.php?a=add_article&amp;catid='.$catid.'&amp;type=2"><i class="fa fa-plus"></i></a> <a href="manage_knowledgebase.php?a=add_article&amp;catid='.$catid.'&amp;type=2"><b>'.$hesklang['kb_i_art2'].'</b></a></p>';
echo $hesklang['kb_no_dart'];
}
else
{
?>
<div class="nu-floatRight">
<?php echo '<a href="manage_knowledgebase.php?a=add_article&amp;catid='.$catid.'&amp;type=2"><i class="fa fa-plus font-size-16p green"></i></a> <a href="manage_knowledgebase.php?a=add_article&amp;catid='.$catid.'&amp;type=2"><b>'.$hesklang['kb_i_art2'].'</b></a>'; ?>
</div>
<h3 class="pad-up-5">&raquo; <?php echo $hesklang['artd']; ?></h3>
<div align="center">
<table border="0" width="100%" cellspacing="1" cellpadding="3" class="white">
<table class="table table-striped">
<thead>
<tr>
<th class="admin_white">&nbsp;</th>
<th class="admin_white"><b><i><?php echo $hesklang['kb_subject']; ?></i></b></th>
<th class="admin_white"><b><i><?php echo $hesklang['kb_cat']; ?></i></b></th>
<th class="admin_white" style="width:120px"><b><i>&nbsp;<?php echo $hesklang['opt']; ?>&nbsp;</i></b></th>
<th>&nbsp;</th>
<th><?php echo $hesklang['kb_subject']; ?></th>
<th><?php echo $hesklang['kb_cat']; ?></th>
<th><?php echo $hesklang['opt']; ?></th>
</tr>
</thead>
<?php
$i=1;
$j=1;
while ($article = hesk_dbFetchAssoc($res))
@ -677,13 +654,8 @@ function list_draft() {
if (isset($_SESSION['artord']) && $article['id'] == $_SESSION['artord'])
{
$color = 'admin_green';
unset($_SESSION['artord']);
}
else
{
$color = $i ? 'admin_white' : 'admin_gray';
}
// Check for articles with no existing parent category
if ( ! isset($kb_cat[$article['catid']]) )
@ -691,29 +663,35 @@ function list_draft() {
$article['catid'] = hesk_stray_article($article['id']);
}
$tmp = $i ? 'White' : 'Blue';
$style = 'class="option'.$tmp.'OFF" onmouseover="this.className=\'option'.$tmp.'ON\'" onmouseout="this.className=\'option'.$tmp.'OFF\'"';
$i = $i ? 0 : 1;
$type = $hesklang['kb_draft'];
?>
<tr>
<td class="<?php echo $color; ?>"><?php echo $j; ?>.</td>
<td class="<?php echo $color; ?>"><?php echo $article['subject']; ?></td>
<td class="<?php echo $color; ?>"><?php echo $kb_cat[$article['catid']]; ?></td>
<td class="<?php echo $color; ?> text-center" style="white-space:nowrap;">
<a href="knowledgebase_private.php?article=<?php echo $article['id']; ?>&amp;back=1<?php if ($article['type'] == 2) {echo '&amp;draft=1';} ?>" target="_blank"><img src="../img/article_text.png" width="16" height="16" alt="<?php echo $hesklang['viewart']; ?>" title="<?php echo $hesklang['viewart']; ?>" <?php echo $style; ?> /></a>
<a href="manage_knowledgebase.php?a=edit_article&amp;id=<?php echo $article['id']; ?>"><i class="fa fa-pencil icon-link orange"></i></a>
<a href="manage_knowledgebase.php?a=remove_article&amp;id=<?php echo $article['id']; ?>&amp;token=<?php hesk_token_echo(); ?>" onclick="return hesk_confirmExecute('<?php echo hesk_makeJsString($hesklang['del_art']); ?>');"><img src="../img/delete.png" width="16" height="16" alt="<?php echo $hesklang['delete']; ?>" title="<?php echo $hesklang['delete']; ?>" <?php echo $style; ?> /></a>&nbsp;</td>
<td><?php echo $j; ?>.</td>
<td><?php echo $article['subject']; ?></td>
<td><?php echo $kb_cat[$article['catid']]; ?></td>
<td style="white-space:nowrap;">
<a href="knowledgebase_private.php?article=<?php echo $article['id']; ?>&amp;back=1<?php if ($article['type'] == 2) {echo '&amp;draft=1';} ?>" target="_blank"><i class="fa fa-file-o" data-toggle="tooltip" title="<?php echo $hesklang['viewart']; ?>"></i></a>
<a href="manage_knowledgebase.php?a=edit_article&amp;id=<?php echo $article['id']; ?>"><i class="fa fa-pencil icon-link orange" data-toggle="tooltip" title="<?php echo $hesklang['edit']; ?>"></i></a>
<a href="manage_knowledgebase.php?a=remove_article&amp;id=<?php echo $article['id']; ?>&amp;token=<?php hesk_token_echo(); ?>" onclick="return hesk_confirmExecute('<?php echo hesk_makeJsString($hesklang['del_art']); ?>');"><i class="fa fa-times icon-link red" data-toggle="tooltip" title="<?php echo $hesklang['delete']; ?>"></i></a></td>
</tr>
<?php
$j++;
} // End while
?>
</table>
</div>
<?php
}
?>
</div>
<div class="box-footer">
<a class="btn btn-success" href="manage_knowledgebase.php?a=add_article&amp;catid=<?php echo $catid; ?>&amp;type=2">
<i class="fa fa-plus"></i>
<?php echo $hesklang['kb_i_art2']; ?>
</a>
</div>
</div>
</section>
<?php
echo '&nbsp;<br />&nbsp;';
@ -751,56 +729,55 @@ function list_private() {
/* Print main manage users page */
require_once(HESK_PATH . 'inc/show_admin_nav.inc.php');
?>
</td>
</tr>
<tr>
<td>
$res = hesk_dbQuery("SELECT * FROM `". hesk_dbEscape($hesk_settings['db_pfix'])."kb_articles` WHERE `type`='1' " . (count($private_categories) ? " OR `catid` IN('" . implode("','", $private_categories) . "') " : '') . " ORDER BY `catid` ASC, `id` ASC");
$num = hesk_dbNumRows($res);
?>
<ol class="breadcrumb">
<li><a href="manage_knowledgebase.php"><?php echo $hesklang['kb']; ?></a></li>
<li class="active"><?php echo $hesklang['kb_cat_man']; ?></li>
</ol>
<!-- SUB NAVIGATION -->
<section class="content">
<?php show_subnav('',$catid); ?>
<!-- SUB NAVIGATION -->
<div class="box">
<div class="box-header with-border">
<h1 class="box-title">
<?php echo $hesklang['artp']; ?>
</h1>
<div class="box-tools pull-right">
<button type="button" class="btn btn-box-tool" data-widget="collapse">
<i class="fa fa-minus"></i>
</button>
</div>
</div>
<div class="box-body">
<?php
$res = hesk_dbQuery("SELECT * FROM `". hesk_dbEscape($hesk_settings['db_pfix'])."kb_articles` WHERE `type`='1' " . (count($private_categories) ? " OR `catid` IN('" . implode("','", $private_categories) . "') " : '') . " ORDER BY `catid` ASC, `id` ASC");
$num = hesk_dbNumRows($res);
if ($num == 0)
{
echo '<p class="move-right-40">'.$hesklang['kb_no_part'].' &nbsp; <a href="manage_knowledgebase.php?a=add_article&amp;catid='.$catid.'&amp;type=1"><i class="fa fa-plus"></i></a> <a href="manage_knowledgebase.php?a=add_article&amp;catid='.$catid.'&amp;type=1"><b>'.$hesklang['kb_i_art2'].'</b></a></p>';
echo '<p>'.$hesklang['kb_no_part'].'</p>';
}
else
{
?>
<div class="nu-floatRight">
<?php echo '<a href="manage_knowledgebase.php?a=add_article&amp;catid='.$catid.'&amp;type=1"><i class="fa fa-plus icon-link green"></i></a> <a href="manage_knowledgebase.php?a=add_article&amp;catid='.$catid.'&amp;type=1"><b>'.$hesklang['kb_i_art2'].'</b></a>'; ?>
</div>
<h3 style="padding-bottom:5px;">&raquo; <?php echo $hesklang['artp']; ?></h3>
<div align="center">
<table border="0" width="100%" cellspacing="1" cellpadding="3" class="white">
<table class="table table-striped">
<thead>
<tr>
<th class="admin_white">&nbsp;</th>
<th class="admin_white"><b><i><?php echo $hesklang['kb_subject']; ?></i></b></th>
<th class="admin_white"><b><i><?php echo $hesklang['kb_cat']; ?></i></b></th>
<th class="admin_white"><b><i><?php echo $hesklang['views']; ?></i></b></th>
<th>&nbsp;</th>
<th><?php echo $hesklang['kb_subject']; ?></th>
<th><?php echo $hesklang['kb_cat']; ?></th>
<th><?php echo $hesklang['views']; ?></th>
<?php
if ($hesk_settings['kb_rating'])
{
?>
<th class="admin_white" style="white-space:nowrap" nowrap="nowrap" width="130"><b><i><?php echo $hesklang['rating'].' ('.$hesklang['votes'].')'; ?></i></b></th>
<th style="white-space:nowrap" nowrap="nowrap" width="130"><?php echo $hesklang['rating'].' ('.$hesklang['votes'].')'; ?></th>
<?php
}
?>
<th class="admin_white" style="width:120px"><b><i>&nbsp;<?php echo $hesklang['opt']; ?>&nbsp;</i></b></th>
<th style="width:120px"><?php echo $hesklang['opt']; ?></th>
</tr>
</thead>
<?php
$i=1;
@ -811,13 +788,8 @@ function list_private() {
if (isset($_SESSION['artord']) && $article['id'] == $_SESSION['artord'])
{
$color = 'admin_green';
unset($_SESSION['artord']);
}
else
{
$color = $i ? 'admin_white' : 'admin_gray';
}
// Check for articles with no existing parent category
if ( ! isset($kb_cat[$article['catid']]) )
@ -826,15 +798,14 @@ function list_private() {
}
$tmp = $i ? 'White' : 'Blue';
$style = 'class="option'.$tmp.'OFF" onmouseover="this.className=\'option'.$tmp.'ON\'" onmouseout="this.className=\'option'.$tmp.'OFF\'"';
$i = $i ? 0 : 1;
$type = $hesklang['kb_private'];
if ($hesk_settings['kb_rating'])
{
$alt = $article['rating'] ? sprintf($hesklang['kb_rated'], sprintf("%01.1f", $article['rating'])) : $hesklang['kb_not_rated'];
$rat = '<td class="'.$color.'" style="white-space:nowrap;"><img src="../img/star_'.(hesk_round_to_half($article['rating'])*10).'.png" width="85" height="16" alt="'.$alt.'" title="'.$alt.'" border="0" style="vertical-align:text-bottom" /> ('.$article['votes'].') </td>';
$rat = '<td><span data-toggle="tooltip" title="' . $alt . '">' . mfh_get_stars(hesk_round_to_half($article['rating'])*10) . '</span> (' . $article['votes'] . ')</td>';
//$rat = '<td style="white-space:nowrap;"><img src="../img/star_'.(hesk_round_to_half($article['rating'])*10).'.png" width="85" height="16" alt="'.$alt.'" title="'.$alt.'" border="0" style="vertical-align:text-bottom" /> ('.$article['votes'].') </td>';
}
else
{
@ -843,24 +814,35 @@ function list_private() {
?>
<tr>
<td class="<?php echo $color; ?>"><?php echo $j; ?>.</td>
<td class="<?php echo $color; ?>"><?php echo $article['subject']; ?></td>
<td class="<?php echo $color; ?>"><?php echo $kb_cat[$article['catid']]; ?></td>
<td class="<?php echo $color; ?>"><?php echo $article['views']; ?></td>
<td><?php echo $j; ?>.</td>
<td><?php echo $article['subject']; ?></td>
<td><?php echo $kb_cat[$article['catid']]; ?></td>
<td><?php echo $article['views']; ?></td>
<?php echo $rat; ?>
<td class="<?php echo $color; ?> text-center">
<a href="knowledgebase_private.php?article=<?php echo $article['id']; ?>&amp;back=1<?php if ($article['type'] == 2) {echo '&amp;draft=1';} ?>" target="_blank"><img src="../img/article_text.png" width="16" height="16" alt="<?php echo $hesklang['viewart']; ?>" title="<?php echo $hesklang['viewart']; ?>" <?php echo $style; ?> /></a>
<a href="manage_knowledgebase.php?a=edit_article&amp;id=<?php echo $article['id']; ?>"><i class="fa fa-pencil icon-link orange"></i></a>
<a href="manage_knowledgebase.php?a=remove_article&amp;id=<?php echo $article['id']; ?>&amp;token=<?php hesk_token_echo(); ?>" onclick="return hesk_confirmExecute('<?php echo hesk_makeJsString($hesklang['del_art']); ?>');"><img src="../img/delete.png" width="16" height="16" alt="<?php echo $hesklang['delete']; ?>" title="<?php echo $hesklang['delete']; ?>" <?php echo $style; ?> /></a>&nbsp;</td>
<td class="text-center">
<a href="knowledgebase_private.php?article=<?php echo $article['id']; ?>&amp;back=1<?php if ($article['type'] == 2) {echo '&amp;draft=1';} ?>" target="_blank"><i class="fa fa-file-o icon-link" data-toggle="tooltip" title="<?php echo $hesklang['viewart']; ?>"></i></a>
<a href="manage_knowledgebase.php?a=edit_article&amp;id=<?php echo $article['id']; ?>"><i class="fa fa-pencil icon-link orange" data-toggle="tooltip" title="<?php echo $hesklang['edit']; ?>"></i></a>
<a href="manage_knowledgebase.php?a=remove_article&amp;id=<?php echo $article['id']; ?>&amp;token=<?php hesk_token_echo(); ?>" onclick="return hesk_confirmExecute('<?php echo hesk_makeJsString($hesklang['del_art']); ?>');"><i class="fa fa-times red icon-link" data-toggle="tooltip" title="<?php echo $hesklang['delete']; ?>"></i></a>&nbsp;</td>
</tr>
<?php
$j++;
} // End while
?>
</table>
</div>
<?php
}
?>
</div>
<div class="box-footer">
<a class="btn btn-success" href="manage_knowledgebase.php?a=add_article&amp;catid=<?php echo $catid; ?>&amp;type=1">
<i class="fa fa-plus"></i>
<?php echo $hesklang['kb_i_art2']; ?>
</a>
</div>
</div>
</section>
<?php
echo '&nbsp;<br />&nbsp;';
@ -1664,41 +1646,34 @@ function manage_category() {
require_once(HESK_PATH . 'inc/show_admin_nav.inc.php');
?>
</td>
</tr>
<ol class="breadcrumb">
<li><a href="manage_knowledgebase.php"><?php echo $hesklang['kb']; ?></a></li>
<li class="active"><?php echo $hesklang['kb_cat_man']; ?></li>
</ol>
<!-- SUB NAVIGATION -->
<?php show_subnav('',$catid); ?>
<!-- SUB NAVIGATION -->
<?php
if ( ! isset($_SESSION['hide']['article_list']))
{
?>
<h3 class="move-right-40"><?php echo $hesklang['category']; ?>: <span class="black"><?php echo $this_cat['name']; ?></span></h3>
&nbsp;<br />
<section class="content">
<?php
show_subnav('',$catid);
$result = hesk_dbQuery("SELECT * FROM `".hesk_dbEscape($hesk_settings['db_pfix'])."kb_articles` WHERE `catid`='{$catid}' ORDER BY `sticky` DESC, `art_order` ASC");
$num = hesk_dbNumRows($result);
$secondCol = $catid == 1 ? 'col-md-12' : 'col-md-8';
$secondStyle = $catid == 1 ? 'margin-left: 25px' : 'padding-right: 40px';
if ( ! isset($_SESSION['hide']['article_list'])):
?>
<div class="row">
<?php if ($catid != 1): ?>
<div class="col-md-4">
<div class="move-right-25">
<div class="panel panel-default">
<div class="panel-heading"><?php echo $hesklang['catset']; ?></div>
<div class="panel-body">
<div class="box">
<div class="box-header with-border">
<h1 class="box-title">
<?php echo $hesklang['catset']; ?>
</h1>
<div class="box-tools pull-right">
<button type="button" class="btn btn-box-tool" data-widget="collapse">
<i class="fa fa-minus"></i>
</button>
</div>
</div>
<div class="box-body">
<form action="manage_knowledgebase.php" method="post" role="form" name="form1" data-toggle="validator"
onsubmit="Javascript:return hesk_deleteIfSelected('dodelete','<?php echo hesk_makeJsString($hesklang['kb_delcat']); ?>')">
<div class="form-group">
@ -1751,13 +1726,24 @@ function manage_category() {
</div>
</div>
</div>
</div>
<?php endif; ?>
<div class="<?php echo $secondCol; ?>" style="<?php echo $secondStyle; ?>">
<div class="<?php echo $secondCol; ?>">
<div class="box">
<div class="box-header with-border">
<h1 class="box-title">
<?php echo sprintf($hesklang['articles_in_category_x'], '<strong>'.$this_cat['name']).'</strong>'; ?>
</h1>
<div class="box-tools pull-right">
<button type="button" class="btn btn-box-tool" data-widget="collapse">
<i class="fa fa-minus"></i>
</button>
</div>
</div>
<div class="box-body">
<?php
if ($num == 0)
{
echo '<p>'.$hesklang['kb_no_art'].' &nbsp; <a href="manage_knowledgebase.php?a=add_article&amp;catid='.$catid.'"><i class="fa fa-plus icon-link green"></i></a> <a href="manage_knowledgebase.php?a=add_article&amp;catid='.$catid.'"><b>'.$hesklang['kb_i_art2'].'</b></a></p>';
echo '<p>'.$hesklang['kb_no_art'].'</p>';
}
else
{
@ -1768,10 +1754,8 @@ function manage_category() {
$num_nosticky = $num - $num_sticky;
?>
<h3><?php echo $hesklang['kb_cat_art']; ?> <small class="nu-floatRight"><?php echo '<a href="manage_knowledgebase.php?a=add_article&amp;catid='.$catid.'"><i class="fa fa-plus"></i></a> <a href="manage_knowledgebase.php?a=add_article&amp;catid='.$catid.'"><b>'.$hesklang['kb_i_art2'].'</b></a>'; ?></small></h3>
<div class="footerWithBorder blankSpace"></div>
<table class="table table-striped">
<thead>
<tr>
<th>&nbsp;</th>
<th><?php echo $hesklang['kb_subject']; ?></th>
@ -1787,6 +1771,7 @@ function manage_category() {
?>
<th>&nbsp;<?php echo $hesklang['opt']; ?>&nbsp;</th>
</tr>
</thead>
<?php
$i=1;
@ -1807,20 +1792,10 @@ function manage_category() {
if (isset($_SESSION['artord']) && $article['id'] == $_SESSION['artord'])
{
$color = 'admin_green';
unset($_SESSION['artord']);
}
elseif ($article['sticky'])
{
$color = 'admin_yellow';
}
else
{
$color = $i ? 'admin_white' : 'admin_gray';
}
$tmp = $i ? 'White' : 'Blue';
$style = 'class="option'.$tmp.'OFF" onmouseover="this.className=\'option'.$tmp.'ON\'" onmouseout="this.className=\'option'.$tmp.'OFF\'"';
$i = $i ? 0 : 1;
switch ($article['type'])
@ -1838,7 +1813,7 @@ function manage_category() {
if ($hesk_settings['kb_rating'])
{
$alt = $article['rating'] ? sprintf($hesklang['kb_rated'], sprintf("%01.1f", $article['rating'])) : $hesklang['kb_not_rated'];
$rat = '<td><img src="../img/star_'.(hesk_round_to_half($article['rating'])*10).'.png" width="85" height="16" alt="'.$alt.'" title="'.$alt.'" border="0" style="vertical-align:text-bottom" /> ('.$article['votes'].') </td>';
$rat = '<td><span data-toggle="tooltip" title="' . $alt . '">' . mfh_get_stars(hesk_round_to_half($article['rating']*10)) . '</span> (' . $article['votes'] . ')</td>';
}
else
{
@ -1883,7 +1858,7 @@ function manage_category() {
echo '<img src="../img/blank.gif" width="16" height="16" alt="" style="padding:3px;border:none;vertical-align:text-bottom;" /> <img src="../img/blank.gif" width="16" height="16" alt="" style="padding:3px;border:none;vertical-align:text-bottom;" />';
}
?>
<a href="manage_knowledgebase.php?a=sticky&amp;s=<?php echo $article['sticky'] ? 0 : 1 ?>&amp;id=<?php echo $article['id']; ?>&amp;catid=<?php echo $catid; ?>&amp;token=<?php hesk_token_echo(); ?>"><i class="fa fa-exclamation-triangle icon-link" style="color:<?php if ( ! $article['sticky']) {echo 'gray';} else {echo 'orange';} ?>" data-toggle="tooltip" data-placement="top" title="<?php if (!$article['sticky']) {echo $hesklang['stickyon'];} else {echo $hesklang['stickyoff'];} ?>"></i></a>
<a href="manage_knowledgebase.php?a=sticky&amp;s=<?php echo $article['sticky'] ? 0 : 1 ?>&amp;id=<?php echo $article['id']; ?>&amp;catid=<?php echo $catid; ?>&amp;token=<?php hesk_token_echo(); ?>"><i class="glyphicon glyphicon-pushpin icon-link" style="color:<?php if ( ! $article['sticky']) {echo 'gray';} else {echo 'red';} ?>" data-toggle="tooltip" data-placement="top" title="<?php if (!$article['sticky']) {echo $hesklang['stickyon'];} else {echo $hesklang['stickyoff'];} ?>"></i></a>
<a href="knowledgebase_private.php?article=<?php echo $article['id']; ?>&amp;back=1<?php if ($article['type'] == 2) {echo '&amp;draft=1';} ?>" target="_blank"><i class="fa fa-file-o icon-link" data-toggle="tooltip" data-placement="top" title="<?php echo $hesklang['viewart'] ?>"></i></a>
<a href="manage_knowledgebase.php?a=edit_article&amp;id=<?php echo $article['id']; ?>"><i class="fa fa-pencil" style="color:orange;font-size:16px" data-toggle="tooltip" data-placement="top" title="<?php echo $hesklang['edit'] ?>"></i></a>
<a href="manage_knowledgebase.php?a=remove_article&amp;id=<?php echo $article['id']; ?>&amp;token=<?php hesk_token_echo(); ?>" onclick="return hesk_confirmExecute('<?php echo hesk_makeJsString($hesklang['del_art']); ?>');"><i class="fa fa-times icon-link red" data-toggle="tooltip" data-placement="top" title="<?php echo $hesklang['delete'] ?>"></i></a>&nbsp;</td>
@ -1897,15 +1872,20 @@ function manage_category() {
<?php
} ?>
</div>
<div class="box-footer">
<a href="manage_knowledgebase.php?a=add_article&amp;catid=<?php echo $catid; ?>" class="btn btn-success">
<i class="fa fa-plus"></i>
<?php echo $hesklang['kb_i_art2']; ?>
</a>
</div>
</div>
</div>
</div>
<?php endif; ?>
</section>
<?php } // END if hide article list
echo '&nbsp;<br />&nbsp;';
<?php
/* Clean unneeded session variables */
hesk_cleanSessionVars(array('hide','manage_cat','edit_article'));

@ -11,7 +11,8 @@
color: green;
}
.orange {
.orange,
.rating {
color: orange;
}

@ -2,3 +2,7 @@
.sidebar-menu, .main-sidebar .user-panel, .sidebar-menu > li.header{
white-space: normal;
}
.icon-link {
font-size: 16px; !important;
}

@ -1886,3 +1886,26 @@ function mfh_bytesToUnits($size) {
return intval($quotient);
}
/**
* Returns the star markup based on the rating provided. Filled in stars are orange, empty stars are gray.
*/
function mfh_get_stars($rating) {
$int_value = intval($rating);
$has_half = $int_value === $rating;
$markup = '';
for ($i = 0; $i < $int_value; $i++) {
$markup .= '<i class="fa fa-star orange"></i>';
}
if ($has_half) {
$markup .= '<i class="fa fa-star-half-o orange"></i>';
}
for ($i = 0; $i < 5 - $int_value; $i++) {
$markup .= '<i class="fa fa-star-o gray"></i>';
}
return $markup;
}

@ -29,6 +29,7 @@ $hesklang['deleted_user_title_case'] = 'Deleted User';
$hesklang['main_navigation_uppercase'] = 'MAIN NAVIGATION';
$hesklang['x_system_warnings'] = '%s System %s'; // %s: Number of warnings, $s: "Warning" or "Warnings", depending on #
$hesklang['warnings_title_case'] = 'Warnings';
$hesklang['articles_in_category_x'] = 'Articles in Category %s'; // %s: category name
// ADDED OR MODIFIED IN Mods for HESK 2.6.0
$hesklang['search_logs'] = 'Search Logs';

Loading…
Cancel
Save