當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。