当前位置: 首页>>代码示例>>PHP>>正文


PHP PMF_Category::viewTree方法代码示例

本文整理汇总了PHP中PMF_Category::viewTree方法的典型用法代码示例。如果您正苦于以下问题:PHP PMF_Category::viewTree方法的具体用法?PHP PMF_Category::viewTree怎么用?PHP PMF_Category::viewTree使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在PMF_Category的用法示例。


在下文中一共展示了PMF_Category::viewTree方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: header

 * under the License.
 */
if (!defined('IS_VALID_PHPMYFAQ')) {
    header('Location: http://' . $_SERVER['HTTP_HOST'] . dirname($_SERVER['SCRIPT_NAME']));
    exit;
}
$currentCategory = PMF_Filter::filterInput(INPUT_GET, 'cat', FILTER_VALIDATE_INT);
if (!is_null($currentCategory) && isset($category->categoryName[$currentCategory])) {
    $faqsession->userTracking('show_category', $currentCategory);
    $parent = $category->categoryName[$currentCategory]['parent_id'];
    $name = $category->categoryName[$currentCategory]['name'];
    $records = $faq->showAllRecords($currentCategory, $faqconfig->get('records.orderby'), $faqconfig->get('records.sortby'));
    if (!$records) {
        $subCategory = new PMF_Category($current_user, $current_groups, true);
        $subCategory->transform($currentCategory);
        $records = $subCategory->viewTree();
    }
    $up = '';
    if ($parent != 0) {
        $url = sprintf('%saction=show&cat=%d', $sids, $parent);
        $oLink = new PMF_Link(PMF_Link::getSystemRelativeUri() . '?' . $url);
        $oLink->itemTitle = $category->categoryName[$parent]['name'];
        $oLink->text = $PMF_LANG['msgCategoryUp'];
        $up = $oLink->toHtmlAnchor();
    }
    $tpl->processTemplate('writeContent', array('writeCategory' => $PMF_LANG['msgEntriesIn'] . $name, 'writeThemes' => $records, 'writeOneThemeBack' => $up));
    $tpl->includeTemplate('writeContent', 'index');
} else {
    $faqsession->userTracking('show_all_categories', 0);
    $tpl->processTemplate('writeContent', array('writeCategory' => $PMF_LANG['msgFullCategories'], 'writeThemes' => $category->viewTree(), 'writeOneThemeBack' => ''));
    $tpl->includeTemplate('writeContent', 'index');
开发者ID:noon,项目名称:phpMyFAQ,代码行数:31,代码来源:show.php

示例2: array

    exit;
}
$currentCategory = PMF_Filter::filterInput(INPUT_GET, 'cat', FILTER_VALIDATE_INT);
$subCategoryContent = '';
if (!is_null($currentCategory) && isset($category->categoryName[$currentCategory])) {
    $faqsession->userTracking('show_category', $currentCategory);
    $catParent = $category->categoryName[$currentCategory]['parent_id'];
    $catName = $category->categoryName[$currentCategory]['name'];
    $catDescription = $category->categoryName[$currentCategory]['description'];
    $records = $faq->showAllRecords($currentCategory, $faqConfig->get('records.orderby'), $faqConfig->get('records.sortby'));
    if (empty($records) || $category->getChildNodes($currentCategory)) {
        $subCategory = new PMF_Category($faqConfig, $current_groups, true);
        $subCategory->setUser($current_user);
        $subCategory->transform($currentCategory);
        if (empty($records)) {
            $records = $subCategory->viewTree();
        }
        if (count($category->getChildNodes($currentCategory))) {
            $categoryFaqsHeader = $PMF_LANG['msgSubCategories'];
            $subCategoryContent = $subCategory->viewTree();
            $tpl->parseBlock('writeContent', 'subCategories', array('categorySubsHeader' => $categoryFaqsHeader));
        }
    }
    $up = '';
    if ($catParent != 0) {
        $url = sprintf('%s?%saction=show&cat=%d', PMF_Link::getSystemRelativeUri(), $sids, $catParent);
        $oLink = new PMF_Link($url, $faqConfig);
        $oLink->itemTitle = $category->categoryName[$catParent]['name'];
        $oLink->text = $PMF_LANG['msgCategoryUp'];
        $up = $oLink->toHtmlAnchor();
    }
开发者ID:kapljr,项目名称:Jay-Kaplan-Farmingdale-BCS-Projects,代码行数:31,代码来源:show.php


注:本文中的PMF_Category::viewTree方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。