$_knowledgebaseCategoryContainer_Temp[$_knowledgebaseCategory['id']] = $_knowledgebaseCategory;
    if (isset($_GET['catid']) && $_knowledgebaseCategory['parentkbcategoryid'] == $_GET['catid'] || !isset($_GET['catid']) && $_knowledgebaseCategory['parentkbcategoryid'] == 0) {
        if ($_index > $_settings['categorycolumns']) {
            $_index = 1;
            $_knowledgebaseCategory['jumptorow'] = true;
        } else {
            $_knowledgebaseCategory['jumptorow'] = false;
        }
        $_knowledgebaseCategoryContainer[$_knowledgebaseCategory['id']] = $_knowledgebaseCategory;
        $_index++;
    }
}
$_knowledgebaseCategoryContainer_Complete = $_knowledgebaseCategoryContainer_Temp;
unset($_knowledgebaseCategoryContainer_Temp);
if ($_parentCategoryID != 0) {
    $_parentCategoryList = RetreiveParentCategoryList($_parentCategoryID, $_knowledgebaseCategoryContainer_Complete);
    $smarty->assign('_parentCategoryList', $_parentCategoryList);
}
$_offset = $_GET['page'] > 1 ? ($_GET['page'] - 1) * $_settings['recordsperpage'] : 0;
$_searchParameters = array('ListAll', $_parentCategoryID, $_settings['recordsperpage'], $_offset);
$_parentCategoryArticleContainer_Complete = $_restClient->get($_articalController, $_searchParameters);
$_parentCategoryArticleContainer_Complete = $_parentCategoryArticleContainer_Complete['kbarticle'];
$_knowledgebaseArticleContainer = array();
foreach ($_parentCategoryArticleContainer_Complete as $_knowledgebaseArticle) {
    if (in_array($_parentCategoryID, $_privateCategoryContainer)) {
        continue;
    }
    if (in_array($_parentCategoryID, $_knowledgebaseArticle['categories'][0]) || in_array($_parentCategoryID, $_knowledgebaseArticle['categories'][0]['categoryid'])) {
        $_knowledgebaseArticleContainer[] = $_knowledgebaseArticle;
    }
}
Пример #2
0
/**
 * Retrieve List of parent categories for Knowledgebase system
 *
 * @author Ruchi Kothari
 *
 * @param int   $_categoryID             Category ID
 * @param array $_knowledgebaseContainer Knowledgebase Container
 *
 * @return array $_parentCategoryList List of parent categories
 */
function RetreiveParentCategoryList($_categoryID, $_knowledgebaseContainer)
{
    $_knowledgebase = $_knowledgebaseContainer[$_categoryID];
    $_parentCategoryList = array();
    if (isset($_knowledgebase['parentkbcategoryid']) && $_knowledgebase['parentkbcategoryid'] != 0) {
        $_parentCategoryList = RetreiveParentCategoryList($_knowledgebase['parentkbcategoryid'], $_knowledgebaseContainer);
    }
    $_parentCategoryList[$_categoryID] = $_knowledgebase['title'];
    return $_parentCategoryList;
}