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


PHP PMF_Category::numParent方法代码示例

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


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

示例1: printf

            // 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)
        printf('<a class="btn btn-info btn-mini" href="?action=translatecategory&amp;cat=%s"><span title="%s" class="icon-share icon-white"></a> ', $cat['id'], $PMF_LANG['ad_categ_translate']);
        // delete (sub) category (if current language)
        if (count($category->getChildren($cat['id'])) == 0 && $cat["lang"] == $lang) {
            printf('<a class="btn btn-danger btn-mini" href="?action=deletecategory&amp;cat=%s&amp;catlang=%s"><span title="%s" class="icon-trash icon-white"></a> ', $cat['id'], $cat['lang'], $PMF_LANG['ad_categ_delete']);
        } else {
            echo '<a class="btn btn-inverse btn-mini" style="cursor: not-allowed;"><span class="icon-trash icon-white"></a> ';
        }
        if ($cat["lang"] == $lang) {
            // cut category (if current language)
            printf('<a class="btn btn-warning btn-mini" href="?action=cutcategory&amp;cat=%s"><span title="%s" class="icon-cut icon-white"></a> ', $cat['id'], $PMF_LANG['ad_categ_cut']);
            if ($category->numParent($cat['parent_id']) > 1) {
                // move category (if current language) AND more than 1 category at the same level)
                printf('<a class="btn btn-warning btn-mini" href="?action=movecategory&amp;cat=%s&amp;parent_id=%s"><span title="%s" class="icon-resize-vertical icon-white"></a> ', $cat['id'], $cat['parent_id'], $PMF_LANG['ad_categ_move']);
            }
        }
        $open = $level;
        $lastCatId = $cat['id'];
    }
    if ($open > 0) {
        print str_repeat("</li>\n\t</ul>\n\t", $open);
    }
    print "</li>\n</ul>";
    printf('<p class="alert alert-info">%s</p>', $PMF_LANG['ad_categ_remark']);
    echo '<script type="text/javascript" src="assets/js/category.js"></script>';
} else {
    print $PMF_LANG['err_NotAuth'];
开发者ID:kapljr,项目名称:Jay-Kaplan-Farmingdale-BCS-Projects,代码行数:31,代码来源:category.main.php

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