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


PHP PMF_Category::getChildren方法代码示例

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


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

示例1: foreach

 /**
  * Build a logic sequence, for a WHERE statement, of those category IDs children of the provided category ID, if any
  *
  * @param   $nCatid
  * @param   $logicOp
  * @param   $oCat
  * @return  string
  * @access  private
  * @since   2005-11-02
  * @author  Matteo Scaramuccia <matteo@scaramuccia.com>
  */
 function _getCatidWhereSequence($nCatid, $logicOp = 'OR', $oCat = null)
 {
     $sqlWherefilter = '';
     if (!isset($oCat)) {
         $oCat = new PMF_Category();
     }
     $aChildren = array_values($oCat->getChildren($nCatid));
     foreach ($aChildren as $catid) {
         $sqlWherefilter .= " " . $logicOp . " fcr.category_id = " . $catid;
         $sqlWherefilter .= $this->_getCatidWhereSequence($catid, 'OR', $oCat);
     }
     return $sqlWherefilter;
 }
开发者ID:noon,项目名称:phpMyFAQ,代码行数:24,代码来源:Faq.php

示例2: elseif

 }
 if ($level < $open) {
     if ($level - $open == -1) {
         print '</li>';
     }
     print '</ul></li>';
 } elseif ($level == $open) {
     print '</li>';
 }
 if ($level > $open) {
     printf('<div id="div_%d" style="display: none; filter: inherit;">', $lastCatId);
     print '<ul><li>';
 } else {
     print '<li>';
 }
 if (count($category->getChildren($cat['id'])) != 0) {
     // Show name and icon for expand the sub-categories
     printf('<h4 class="category-header" data-category-id="%d">%s</h4> ', $cat['id'], $categoryName);
 } else {
     // Show just the name
     printf("<h4>%s</h4> ", $categoryName);
 }
 if ($cat["lang"] == $lang) {
     // add sub category (if current language)
     printf('
     <a class="btn btn-info btn-mini" href="?action=addcategory&amp;cat=%s&amp;lang=%s"><span title="%s" class="icon-plus-sign icon-white"></span></a> ', $cat['id'], $cat['lang'], $PMF_LANG['ad_quick_category']);
     // rename (sub) category (if current language)
     printf('
        <a class="btn btn-info btn-mini" href="?action=editcategory&amp;cat=%s"><span title="%s" class="icon-edit icon-white"></a> ', $cat['id'], $PMF_LANG['ad_kateg_rename']);
 }
 // translate category (always)
开发者ID:kapljr,项目名称:Jay-Kaplan-Farmingdale-BCS-Projects,代码行数:31,代码来源:category.main.php

示例3: elseif

            for ($i = $leveldiff; $i > 1; $i--) {
                $templateVars['categoryTree'] .= '</ul></div></li>';
            }
        }
        if ($level < $open) {
            if ($level - $open == -1) {
                $templateVars['categoryTree'] .= '</li>';
            }
            $templateVars['categoryTree'] .= '</ul></li>';
        } elseif ($level == $open) {
            $templateVars['categoryTree'] .= '</li>';
        }
        if ($level > $open) {
            $templateVars['categoryTree'] .= sprintf('<div id="div_%d" style="display: none;">', $lastCatId);
            $templateVars['categoryTree'] .= '<ul><li>';
        } else {
            $templateVars['categoryTree'] .= '<li>';
        }
        $templateVars['categoryTree'] .= $twig->loadTemplate('category/treeItem.twig')->render(array('PMF_LANG' => $PMF_LANG, 'id' => $cat['id'], 'addButtonUrl' => sprintf('?action=addcategory&cat=%s&lang=%s', $cat['id'], $cat['lang']), 'cutButtonUrl' => sprintf('?action=cutcategory&cat=%s', $cat['id']), 'deleteButtonUrl' => sprintf('?action=deletecategory&cat=%s&catlang=%s', $cat['id'], $cat['lang']), 'moveButtonUrl' => sprintf('?action=movecategory&cat=%s&parent_id=%s', $cat['id'], $cat['parent_id']), 'name' => $categoryName, 'renameButtonUrl' => sprintf('?action=editcategory&cat=%s', $cat['id']), 'renderAddButton' => $cat["lang"] == $lang, 'renderCutButton' => $cat["lang"] == $lang, 'renderDeleteButton' => count($category->getChildren($cat['id'])) == 0 && $cat["lang"] == $lang, 'renderMoveButton' => $cat["lang"] == $lang && $category->numParent($cat['parent_id']) > 1, 'renderRenameButton' => $cat["lang"] == $lang, 'renderToggler' => count($category->getChildren($cat['id'])) != 0, 'translateButtonUrl' => sprintf('?action=translatecategory&cat=%s', $cat['id'])));
        $open = $level;
        $lastCatId = $cat['id'];
    }
    if ($open > 0) {
        $templateVars['categoryTree'] .= str_repeat("</li>\n\t</ul>\n\t", $open);
    }
    $templateVars['categoryTree'] .= "</li>\n</ul>";
    $twig->loadTemplate('category/main.twig')->display($templateVars);
    unset($templateVars, $csrfToken, $open, $level, $category, $id, $cat, $lang, $lastCatId);
} else {
    require 'noperm.php';
}
开发者ID:ae120,项目名称:phpMyFAQ,代码行数:31,代码来源:category.main.php


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