Bootswatch, Summernote, and Captcheck mods for Mods for HESK (mods-for-hesk.com). In use at support.netsyms.com.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

knowledgebase_private.php 19KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625
  1. <?php
  2. /**
  3. *
  4. * This file is part of HESK - PHP Help Desk Software.
  5. *
  6. * (c) Copyright Klemen Stirn. All rights reserved.
  7. * https://www.hesk.com
  8. *
  9. * For the full copyright and license agreement information visit
  10. * https://www.hesk.com/eula.php
  11. *
  12. */
  13. define('IN_SCRIPT',1);
  14. define('HESK_PATH','../');
  15. define('PAGE_TITLE', 'ADMIN_KB');
  16. define('MFH_PAGE_LAYOUT', 'TOP_ONLY');
  17. /* Get all the required files and functions */
  18. require(HESK_PATH . 'hesk_settings.inc.php');
  19. require(HESK_PATH . 'inc/common.inc.php');
  20. require(HESK_PATH . 'inc/admin_functions.inc.php');
  21. require(HESK_PATH . 'inc/knowledgebase_functions.inc.php');
  22. require(HESK_PATH . 'inc/mail_functions.inc.php');
  23. hesk_load_database_functions();
  24. hesk_session_start();
  25. hesk_dbConnect();
  26. hesk_isLoggedIn();
  27. hesk_kb_preheader();
  28. /* Is Knowledgebase enabled? */
  29. if ( ! $hesk_settings['kb_enable'])
  30. {
  31. hesk_error($hesklang['kbdis']);
  32. }
  33. /* Can this user manage Knowledgebase or just view it? */
  34. $can_man_kb = hesk_checkPermission('can_man_kb',0);
  35. /* Any category ID set? */
  36. $catid = intval( hesk_GET('category', 1) );
  37. $artid = intval( hesk_GET('article', 0) );
  38. if (isset($_GET['search']))
  39. {
  40. $query = hesk_input( hesk_GET('search') );
  41. }
  42. else
  43. {
  44. $query = 0;
  45. }
  46. $hesk_settings['kb_link'] = ($artid || $catid != 1 || $query) ? '<a href="knowledgebase_private.php">'.$hesklang['gopr'].'</a>' : ($can_man_kb ? $hesklang['gopr'] : '');
  47. if ($hesk_settings['kb_search'] && $query)
  48. {
  49. if (hesk_kb_search($query)) {
  50. hesk_show_kb_category(1,1);
  51. }
  52. }
  53. elseif ($artid)
  54. {
  55. // Show drafts only to staff who can manage knowledgebase
  56. if ($can_man_kb)
  57. {
  58. $result = hesk_dbQuery("SELECT t1.*, t2.`name` AS `cat_name`
  59. FROM `".hesk_dbEscape($hesk_settings['db_pfix'])."kb_articles` AS `t1`
  60. LEFT JOIN `".hesk_dbEscape($hesk_settings['db_pfix'])."kb_categories` AS `t2` ON `t1`.`catid` = `t2`.`id`
  61. WHERE `t1`.`id` = '{$artid}'
  62. ");
  63. }
  64. else
  65. {
  66. $result = hesk_dbQuery("SELECT t1.*, t2.`name` AS `cat_name`
  67. FROM `".hesk_dbEscape($hesk_settings['db_pfix'])."kb_articles` AS `t1`
  68. LEFT JOIN `".hesk_dbEscape($hesk_settings['db_pfix'])."kb_categories` AS `t2` ON `t1`.`catid` = `t2`.`id`
  69. WHERE `t1`.`id` = '{$artid}' AND `t1`.`type` IN ('0', '1')
  70. ");
  71. }
  72. $article = hesk_dbFetchAssoc($result) or hesk_error($hesklang['kb_art_id']);
  73. hesk_show_kb_article($artid);
  74. }
  75. else
  76. {
  77. hesk_show_kb_category($catid);
  78. }
  79. require_once(HESK_PATH . 'inc/footer.inc.php');
  80. exit();
  81. /*** START FUNCTIONS ***/
  82. function hesk_kb_preheader() {
  83. global $hesk_settings, $hesklang, $can_man_kb;
  84. /* Print admin navigation */
  85. require_once(HESK_PATH . 'inc/headerAdmin.inc.php');
  86. require_once(HESK_PATH . 'inc/show_admin_nav.inc.php');
  87. }
  88. function hesk_kb_header($kb_link, $catid=1)
  89. {
  90. global $hesk_settings, $hesklang, $can_man_kb;
  91. ?>
  92. <ol class="breadcrumb">
  93. <?php
  94. if ($can_man_kb)
  95. {
  96. ?>
  97. <li><a href="manage_knowledgebase.php"><?php echo $hesklang['kb']; ?></a></li>
  98. <?php
  99. }
  100. ?>
  101. <li class="active"><?php echo $kb_link; ?></li>
  102. </ol>
  103. <?php
  104. show_subnav('view', $catid);
  105. echo '<div style="margin-left:40px;margin-right:40px">';
  106. hesk_kbSearchLarge(1);
  107. echo '</div>';
  108. } // END hesk_kb_header()
  109. function hesk_kb_search($query)
  110. {
  111. global $hesk_settings, $hesklang;
  112. $res = hesk_dbQuery('SELECT t1.`id`, t1.`subject`, LEFT(`t1`.`content`, '.max(200, $hesk_settings['kb_substrart'] * 2).') AS `content`, t1.`rating` FROM `'.hesk_dbEscape($hesk_settings['db_pfix']).'kb_articles` AS t1 LEFT JOIN `'.hesk_dbEscape($hesk_settings['db_pfix']).'kb_categories` AS t2 ON t1.`catid` = t2.`id` '." WHERE t1.`type` IN ('0','1') AND MATCH(`subject`,`content`,`keywords`) AGAINST ('".hesk_dbEscape($query)."') LIMIT ".intval($hesk_settings['kb_search_limit']));
  113. $num = hesk_dbNumRows($res);
  114. $show_default_category = false;
  115. ?>
  116. <div class="content-wrapper">
  117. <?php hesk_kb_header($hesk_settings['kb_link']); ?>
  118. <section style="padding: 15px">
  119. <div class="box">
  120. <div class="box-header with-border">
  121. <h1 class="box-title">
  122. <?php echo $hesklang['sr']; ?> (<?php echo $num; ?>)
  123. </h1>
  124. <div class="box-tools pull-right">
  125. <button type="button" class="btn btn-box-tool" data-widget="collapse">
  126. <i class="fa fa-minus"></i>
  127. </button>
  128. </div>
  129. </div>
  130. <div class="box-body">
  131. <?php
  132. if ($num == 0) {
  133. echo '<i>'.$hesklang['nosr'].'</i>';
  134. $show_default_category = true;
  135. } else {
  136. ?>
  137. <table class="table table-striped">
  138. <?php
  139. while ($article = hesk_dbFetchAssoc($res))
  140. {
  141. $txt = hesk_kbArticleContentPreview($article['content']);
  142. if ($hesk_settings['kb_rating'])
  143. {
  144. $rat = '<td width="1" valign="top">' . mfh_get_stars($article['rating']) . '</td>';
  145. }
  146. else
  147. {
  148. $rat = '';
  149. }
  150. echo '
  151. <tr>
  152. <td>
  153. <table border="0" width="100%" cellspacing="0" cellpadding="1">
  154. <tr>
  155. <td width="1" valign="top"><span class="glyphicon glyphicon-file"></span></td>
  156. <td valign="top"><a href="knowledgebase_private.php?article='.$article['id'].'">'.$article['subject'].'</a></td>
  157. '.$rat.'
  158. </tr>
  159. </table>
  160. <table border="0" width="100%" cellspacing="0" cellpadding="1">
  161. <tr>
  162. <td width="1" valign="top"><img src="../img/blank.gif" width="16" height="10" style="vertical-align:middle" alt="" /></td>
  163. <td><span class="article_list">'.$txt.'</span></td>
  164. </tr>
  165. </table>
  166. </td>
  167. </tr>';
  168. }
  169. ?>
  170. </table>
  171. <a href="javascript:history.go(-1)"><span class="glyphicon glyphicon-circle-arrow-left"></span>&nbsp;<?php echo $hesklang['back']; ?></a>
  172. <?php } ?>
  173. </div>
  174. </div>
  175. </section>
  176. </div>
  177. <?php
  178. return $show_default_category;
  179. } // END hesk_kb_search()
  180. function hesk_show_kb_article($artid)
  181. {
  182. global $hesk_settings, $hesklang, $article;
  183. // Print header
  184. $hesk_settings['tmp_title'] = $article['subject'];
  185. // Update views by 1
  186. hesk_dbQuery('UPDATE `'.hesk_dbEscape($hesk_settings['db_pfix'])."kb_articles` SET `views`=`views`+1 WHERE `id`={$artid}");
  187. ?>
  188. <div class="content-wrapper">
  189. <?php
  190. hesk_kb_header($hesk_settings['kb_link'], $article['catid']);
  191. echo '<div style="margin-left:40px;margin-right:40px">';
  192. $service_messages = mfh_get_service_messages('STAFF_VIEW_KB_ARTICLE');
  193. foreach ($service_messages as $sm) {
  194. hesk_service_message($sm);
  195. }
  196. echo '</div>';
  197. ?>
  198. <section class="content">
  199. <div class="box">
  200. <div class="box-header with-border">
  201. <h1 class="box-title">
  202. <?php echo $article['subject']; ?>
  203. </h1>
  204. <div class="box-tools pull-right">
  205. <button type="button" class="btn btn-box-tool" data-widget="collapse">
  206. <i class="fa fa-minus"></i>
  207. </button>
  208. </div>
  209. </div>
  210. <div class="box-body">
  211. <?php echo $article['content']; ?>
  212. </div>
  213. <?php if (!empty($article['attachments'])): ?>
  214. <div class="box-footer">
  215. <p><b><?php echo $hesklang['attachments']; ?></b></p>
  216. <?php
  217. $att=explode(',',substr($article['attachments'], 0, -1));
  218. foreach ($att as $myatt)
  219. {
  220. list($att_id, $att_name) = explode('#', $myatt);
  221. echo '<i class="fa fa-paperclip"></i> <a href="../download_attachment.php?kb_att='.$att_id.'" rel="nofollow">'.$att_name.'</a><br />';
  222. }
  223. ?>
  224. </div>
  225. <?php endif; ?>
  226. </div>
  227. <?php
  228. if ($article['catid']==1)
  229. {
  230. $link = 'knowledgebase_private.php';
  231. }
  232. else
  233. {
  234. $link = 'knowledgebase_private.php?category='.$article['catid'];
  235. }
  236. ?>
  237. <br><br>
  238. <div class="row">
  239. <?php
  240. $showRelated = false;
  241. $column = 'col-md-12';
  242. require(HESK_PATH . 'inc/mail/email_parser.php');
  243. $query = hesk_dbEscape( $article['subject'] . ' ' . convert_html_to_text($article['content']) );
  244. // Get relevant articles from the database
  245. $res = hesk_dbQuery("SELECT `id`, `subject`, MATCH(`subject`,`content`,`keywords`) AGAINST ('{$query}') AS `score` FROM `".hesk_dbEscape($hesk_settings['db_pfix'])."kb_articles` WHERE `type` IN ('0','1') AND MATCH(`subject`,`content`,`keywords`) AGAINST ('{$query}') LIMIT ".intval($hesk_settings['kb_related']+1));
  246. // Array with related articles
  247. $related_articles = array();
  248. while ($related = hesk_dbFetchAssoc($res))
  249. {
  250. // Get base match score from the first (this) article
  251. if ( ! isset($base_score) )
  252. {
  253. $base_score = $related['score'];
  254. }
  255. // Ignore this article
  256. if ($related['id'] == $artid)
  257. {
  258. continue;
  259. }
  260. // Stop when articles reach less than 10% of base score
  261. if ($related['score'] / $base_score < 0.10)
  262. {
  263. break;
  264. }
  265. // This is a valid related article
  266. $related_articles[$related['id']] = $related['subject'];
  267. }
  268. // Print related articles if we have any valid matches
  269. if ( count($related_articles) ) {
  270. $column = 'col-md-6';
  271. $showRelated = true;
  272. }
  273. ?>
  274. <div class="<?php echo $column; ?> col-sm-12">
  275. <div class="box">
  276. <div class="box-header with-border">
  277. <h1 class="box-title">
  278. <?php echo $hesklang['ad']; ?>
  279. </h1>
  280. <div class="box-tools pull-right">
  281. <button type="button" class="btn btn-box-tool" data-widget="collapse">
  282. <i class="fa fa-minus"></i>
  283. </button>
  284. </div>
  285. </div>
  286. <div class="box-body">
  287. <table border="0">
  288. <tr>
  289. <td><?php echo $hesklang['aid']; ?>: </td>
  290. <td>
  291. <?php
  292. echo $article['id'];
  293. if ($article['type'] == 0)
  294. {
  295. echo ' [<a href="' . $hesk_settings['hesk_url'] . '/knowledgebase.php?article=' . $article['id'] . '">' . $hesklang['public_link'] . '</a>]';
  296. }
  297. ?>
  298. </td>
  299. </tr>
  300. <tr>
  301. <td><?php echo $hesklang['category']; ?>: </td>
  302. <td><a href="<?php echo $link; ?>"><?php echo $article['cat_name']; ?></a></td>
  303. </tr>
  304. <tr>
  305. <td><?php echo $hesklang['dta']; ?>: </td>
  306. <td><?php echo hesk_date($article['dt'], true); ?></td>
  307. </tr>
  308. <tr>
  309. <td><?php echo $hesklang['views']; ?>: </td>
  310. <td><?php echo (isset($_GET['rated']) ? $article['views'] : $article['views']+1); ?></td>
  311. </tr>
  312. </table>
  313. </div>
  314. </div>
  315. </div>
  316. <?php if ($showRelated) { ?>
  317. <div class="col-md-6 col-sm-12">
  318. <div class="box">
  319. <div class="box-header with-border">
  320. <h1 class="box-title">
  321. <?php echo $hesklang['relart']; ?>
  322. </h1>
  323. <div class="box-tools pull-right">
  324. <button type="button" class="btn btn-box-tool" data-widget="collapse">
  325. <i class="fa fa-minus"></i>
  326. </button>
  327. </div>
  328. </div>
  329. <div class="box-body">
  330. <?php
  331. // Related articles
  332. foreach ($related_articles as $id => $subject)
  333. {
  334. echo '<span class="glyphicon glyphicon-file" style="font-size: 16px;"></span> <a href="knowledgebase_private.php?article='.$id.'">'.$subject.'</a><br />';
  335. }
  336. ?>
  337. </div>
  338. </div>
  339. </div>
  340. <?php } ?>
  341. </div>
  342. <?php
  343. if (!isset($_GET['back']))
  344. {
  345. ?>
  346. <p><br /><a href="javascript:history.go(-1)"><span class="glyphicon glyphicon-circle-arrow-left"></span>&nbsp;<?php echo $hesklang['back']; ?></a></p>
  347. <?php
  348. }
  349. ?>
  350. </section>
  351. </div>
  352. <?php
  353. } // END hesk_show_kb_article()
  354. function hesk_show_kb_category($catid, $is_search = 0) {
  355. global $hesk_settings, $hesklang;
  356. $res = hesk_dbQuery("SELECT `name`,`parent` FROM `".hesk_dbEscape($hesk_settings['db_pfix'])."kb_categories` WHERE `id`='".intval($catid)."' LIMIT 1");
  357. $thiscat = hesk_dbFetchAssoc($res) or hesk_error($hesklang['kb_cat_inv']);
  358. ?>
  359. <div class="content-wrapper">
  360. <?php
  361. if ($is_search == 0)
  362. {
  363. /* Print header */
  364. hesk_kb_header($hesk_settings['kb_link'], $catid);
  365. echo '<div style="margin-left:40px;margin-right:40px">';
  366. $service_messages = mfh_get_service_messages('STAFF_KB_HOME');
  367. foreach ($service_messages as $sm) {
  368. hesk_service_message($sm);
  369. }
  370. echo '</div>';
  371. } ?>
  372. <section class="content">
  373. <?php if ($thiscat['parent']): ?>
  374. <h3><?php echo $hesklang['kb_cat'].': '.$thiscat['name']; ?></h3>
  375. <p align="left"><a href="javascript:history.go(-1)">
  376. <span class="glyphicon glyphicon-circle-arrow-left"></span>
  377. <?php echo $hesklang['back']; ?>
  378. </a></p>
  379. <?php
  380. endif;
  381. $result = hesk_dbQuery("SELECT `id`,`name`,`articles`,`type` FROM `".hesk_dbEscape($hesk_settings['db_pfix'])."kb_categories` WHERE `parent`='".intval($catid)."' ORDER BY `parent` ASC, `cat_order` ASC");
  382. if (hesk_dbNumRows($result) > 0) {
  383. ?>
  384. <div class="box">
  385. <div class="box-header with-border">
  386. <h1 class="box-title">
  387. <?php echo $hesklang['kb_cat_sub']; ?>
  388. </h1>
  389. <div class="box-tools pull-right">
  390. <button type="button" class="btn btn-box-tool" data-widget="collapse">
  391. <i class="fa fa-minus"></i>
  392. </button>
  393. </div>
  394. </div>
  395. <div class="box-body">
  396. <table class="table table-striped">
  397. <?php
  398. $per_col = $hesk_settings['kb_cols'];
  399. $i = 1;
  400. while ($cat = hesk_dbFetchAssoc($result))
  401. {
  402. if ($i == 1)
  403. {
  404. echo '<tr>';
  405. }
  406. $private = ($cat['type'] == 1) ? ' *' : '';
  407. echo '
  408. <td width="50%" valign="top">
  409. <table border="0">
  410. <tr><td><span class="glyphicon glyphicon-folder-close"></span>&nbsp;<a href="knowledgebase_private.php?category='.$cat['id'].'">'.$cat['name'].'</a>'.$private.'</td></tr>
  411. ';
  412. /* Print most popular/sticky articles */
  413. if ($hesk_settings['kb_numshow'] && $cat['articles'])
  414. {
  415. $res = hesk_dbQuery("SELECT `id`,`subject`,`type` FROM `".hesk_dbEscape($hesk_settings['db_pfix'])."kb_articles` WHERE `catid`='".intval($cat['id'])."' AND `type` IN ('0','1') ORDER BY `sticky` DESC, `views` DESC, `art_order` ASC LIMIT " . (intval($hesk_settings['kb_numshow']) + 1) );
  416. $num = 1;
  417. while ($art = hesk_dbFetchAssoc($res))
  418. {
  419. $private = ($art['type'] == 1) ? ' *' : '';
  420. echo '
  421. <tr>
  422. <td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="glyphicon glyphicon-file"></span>
  423. <a href="knowledgebase_private.php?article='.$art['id'].'" class="article">'.$art['subject'].'</a>'.$private.'</td>
  424. </tr>';
  425. if ($num == $hesk_settings['kb_numshow'])
  426. {
  427. break;
  428. }
  429. else
  430. {
  431. $num++;
  432. }
  433. }
  434. if (hesk_dbNumRows($res) > $hesk_settings['kb_numshow'])
  435. {
  436. echo '<tr><td>&raquo; <a href="knowledgebase_private.php?category='.$cat['id'].'"><i>'.$hesklang['m'].'</i></a></td></tr>';
  437. }
  438. }
  439. echo '
  440. </table>
  441. </td>
  442. ';
  443. if ($i == $per_col)
  444. {
  445. echo '</tr>';
  446. $i = 0;
  447. }
  448. $i++;
  449. }
  450. /* Finish the table if needed */
  451. if ($i != 1)
  452. {
  453. for ($j=1;$j<=$per_col;$j++)
  454. {
  455. echo '<td width="50%">&nbsp;</td>';
  456. if ($i == $per_col)
  457. {
  458. echo '</tr>';
  459. break;
  460. }
  461. $i++;
  462. }
  463. }
  464. ?>
  465. </table>
  466. </div>
  467. <div class="box-footer">
  468. <?php echo $hesklang['private_category_star']; ?>
  469. </div>
  470. </div>
  471. <?php } ?>
  472. <div class="box">
  473. <div class="box-header with-border">
  474. <h1 class="box-title">
  475. <?php echo $hesklang['ac']; ?>
  476. </h1>
  477. <div class="box-tools pull-right">
  478. <button type="button" class="btn btn-box-tool" data-widget="collapse">
  479. <i class="fa fa-minus"></i>
  480. </button>
  481. </div>
  482. </div>
  483. <div class="box-body">
  484. <?php
  485. $res = hesk_dbQuery("SELECT `id`, `subject`, LEFT(`content`, ".max(200, $hesk_settings['kb_substrart'] * 2).") AS `content`, `rating`, `type` FROM `".hesk_dbEscape($hesk_settings['db_pfix'])."kb_articles` WHERE `catid`='".intval($catid)."' AND `type` IN ('0','1') ORDER BY `sticky` DESC, `art_order` ASC");
  486. if (hesk_dbNumRows($res) == 0)
  487. {
  488. echo '<i>'.$hesklang['noac'].'</i>';
  489. }
  490. else
  491. {
  492. echo '<table border="0" cellspacing="1" cellpadding="3" width="100%">';
  493. while ($article = hesk_dbFetchAssoc($res))
  494. {
  495. $private = ($article['type'] == 1) ? ' *' : '';
  496. $txt = hesk_kbArticleContentPreview($article['content']);
  497. echo '
  498. <tr>
  499. <td>
  500. <table border="0" width="100%" cellspacing="0" cellpadding="1">
  501. <tr>
  502. <td width="1" valign="top"><span class="glyphicon glyphicon-file"></span></td>
  503. <td valign="top"><a href="knowledgebase_private.php?article='.$article['id'].'">'.$article['subject'].'</a>'.$private.'</td>
  504. </tr>
  505. </table>
  506. <table border="0" width="100%" cellspacing="0" cellpadding="1">
  507. <tr>
  508. <td width="1" valign="top"><img src="../img/blank.gif" width="16" height="10" style="vertical-align:middle" alt="" /></td>
  509. <td><span class="article_list">'.$txt.'</span></td>
  510. </tr>
  511. </table>
  512. </td>
  513. </tr>';
  514. }
  515. echo '</table>';
  516. }
  517. ?>
  518. </div>
  519. <div class="box-footer">
  520. <?php echo $hesklang['private_article_star']; ?>
  521. </div>
  522. </div>
  523. </section>
  524. </div>
  525. <?php
  526. } // END hesk_show_kb_category()
  527. function show_subnav($hide='', $catid=1)
  528. {
  529. global $hesk_settings, $hesklang, $can_man_kb, $artid;
  530. if ( ! $can_man_kb)
  531. {
  532. echo '';
  533. return true;
  534. }
  535. $catid = intval($catid);
  536. echo '<div style="margin-left:40px;margin-right:40px">';
  537. $link['view'] = '<a href="knowledgebase_private.php"><i class="fa fa-search" style="font-size:16px"></i></a> <a href="knowledgebase_private.php">'.$hesklang['gopr'].'</a> | ';
  538. $link['newa'] = '<a href="manage_knowledgebase.php?a=add_article&amp;catid='.$catid.'"><i class="fa fa-plus" style="color: green;font-size:16px"></i></a> <a href="manage_knowledgebase.php?a=add_article&amp;catid='.$catid.'">'.$hesklang['kb_i_art'].'</a> | ';
  539. $link['newc'] = '<a href="manage_knowledgebase.php?a=add_category&amp;parent='.$catid.'"><i class="fa fa-caret-right" style="font-size:18px; color:blue"></i></a> <a href="manage_knowledgebase.php?a=add_category&amp;parent='.$catid.'">'.$hesklang['kb_i_cat'].'</a> | ';
  540. if ($hide && isset($link[$hide]))
  541. {
  542. $link[$hide] = preg_replace('/<a([^<]*)>/', '', $link[$hide]);
  543. $link[$hide] = str_replace('</a>','',$link[$hide]);
  544. }
  545. ?>
  546. <form style="margin:0px;padding:0px;" method="get" action="manage_knowledgebase.php">
  547. <?php
  548. echo $link['view'];
  549. echo $link['newa'];
  550. echo $link['newc'];
  551. ?>
  552. <i class="fa fa-pencil" style="color:orange;font-size:16px"></i> <input type="hidden" name="a" value="edit_article" /><?php echo $hesklang['aid']; ?>: <input type="text" name="id" size="3" <?php if ($artid) echo 'value="' . $artid . '"'; ?> /> <input type="submit" value="<?php echo $hesklang['edit']; ?>" class="btn btn-default btn-xs" />
  553. </form>
  554. </div>
  555. <?php
  556. } // End show_subnav()
  557. ?>