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


PHP zen_generate_category_path函数代码示例

本文整理汇总了PHP中zen_generate_category_path函数的典型用法代码示例。如果您正苦于以下问题:PHP zen_generate_category_path函数的具体用法?PHP zen_generate_category_path怎么用?PHP zen_generate_category_path使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


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

示例1: zen_get_generated_category_path_ids

function zen_get_generated_category_path_ids($id, $from = 'category')
{
    global $db;
    $calculated_category_path_string = '';
    $calculated_category_path = zen_generate_category_path($id, $from);
    for ($i = 0, $n = sizeof($calculated_category_path); $i < $n; $i++) {
        for ($j = 0, $k = sizeof($calculated_category_path[$i]); $j < $k; $j++) {
            $calculated_category_path_string .= $calculated_category_path[$i][$j]['id'] . '_';
        }
        $calculated_category_path_string = substr($calculated_category_path_string, 0, -1) . '<br>';
    }
    $calculated_category_path_string = substr($calculated_category_path_string, 0, -4);
    if (strlen($calculated_category_path_string) < 1) {
        $calculated_category_path_string = TEXT_TOP;
    }
    return $calculated_category_path_string;
}
开发者ID:andychang88,项目名称:daddy-store.com,代码行数:17,代码来源:functions_categories.php

示例2: array

     // eof: categories meta tags
 // eof: categories meta tags
 case 'move_category':
     $heading[] = array('text' => '<b>' . TEXT_INFO_HEADING_MOVE_CATEGORY . '</b>');
     $contents = array('form' => zen_draw_form('categories', FILENAME_CATEGORIES, 'action=move_category_confirm&cPath=' . $cPath) . zen_draw_hidden_field('categories_id', $cInfo->categories_id));
     $contents[] = array('text' => sprintf(TEXT_MOVE_CATEGORIES_INTRO, $cInfo->categories_name));
     $contents[] = array('text' => '<br />' . sprintf(TEXT_MOVE, $cInfo->categories_name) . '<br />' . zen_draw_pull_down_menu('move_to_category_id', zen_get_category_tree(), $current_category_id));
     $contents[] = array('align' => 'center', 'text' => '<br />' . zen_image_submit('button_move.gif', IMAGE_MOVE) . ' <a href="' . zen_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&cID=' . $cInfo->categories_id) . '">' . zen_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');
     break;
 case 'delete_product':
     $heading[] = array('text' => '<b>' . TEXT_INFO_HEADING_DELETE_PRODUCT . '</b>');
     $contents = array('form' => zen_draw_form('products', FILENAME_CATEGORIES, 'action=delete_product_confirm&cPath=' . $cPath . (isset($_GET['page']) ? '&page=' . $_GET['page'] : '')) . zen_draw_hidden_field('products_id', $pInfo->products_id));
     $contents[] = array('text' => TEXT_DELETE_PRODUCT_INTRO);
     $contents[] = array('text' => '<br /><b>' . $pInfo->products_name . ' ID#' . $pInfo->products_id . '</b>');
     $product_categories_string = '';
     $product_categories = zen_generate_category_path($pInfo->products_id, 'product');
     for ($i = 0, $n = sizeof($product_categories); $i < $n; $i++) {
         $category_path = '';
         for ($j = 0, $k = sizeof($product_categories[$i]); $j < $k; $j++) {
             $category_path .= $product_categories[$i][$j]['text'] . '&nbsp;&gt;&nbsp;';
         }
         $category_path = substr($category_path, 0, -16);
         $product_categories_string .= zen_draw_checkbox_field('product_categories[]', $product_categories[$i][sizeof($product_categories[$i]) - 1]['id'], true) . '&nbsp;' . $category_path . '<br />';
     }
     $product_categories_string = substr($product_categories_string, 0, -4);
     $contents[] = array('text' => '<br />' . $product_categories_string);
     $contents[] = array('align' => 'center', 'text' => '<br />' . zen_image_submit('button_delete.gif', IMAGE_DELETE) . ' <a href="' . zen_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&pID=' . $pInfo->products_id . (isset($_GET['page']) ? '&page=' . $_GET['page'] : '')) . '">' . zen_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');
     break;
 case 'move_product':
     $heading[] = array('text' => '<b>' . TEXT_INFO_HEADING_MOVE_PRODUCT . '</b>');
     $contents = array('form' => zen_draw_form('products', FILENAME_CATEGORIES, 'action=move_product_confirm&cPath=' . $cPath . (isset($_GET['page']) ? '&page=' . $_GET['page'] : '')) . zen_draw_hidden_field('products_id', $pInfo->products_id));
开发者ID:andychang88,项目名称:daddy-store.com,代码行数:31,代码来源:categories.php

示例3: get_breadcrumb

 function get_breadcrumb($categories_id, $separater = '&nbsp;&gt;&nbsp;')
 {
     $breadcrumbs = array();
     $categories = zen_generate_category_path($categories_id);
     for ($i = 0, $n = sizeof($categories); $i < $n; $i++) {
         for ($j = 0, $k = sizeof($categories[$i]); $j < $k; $j++) {
             $id = $categories[$i][$j]['id'];
             if (empty($id)) {
                 continue;
             }
             if ($id != $categories_id) {
                 $parm = array('category_id' => $id);
                 $link = easy_admin_products_html::href_link("categories", $parm);
                 $breadcrumb = '<a href="' . $link . '">' . zen_output_string_protected($categories[$i][$j]['text']) . '</a>';
             } else {
                 $breadcrumb = zen_output_string_protected($categories[$i][$j]['text']);
             }
             array_unshift($breadcrumbs, $breadcrumb);
         }
     }
     if (empty($breadcrumbs)) {
         $top = TEXT_TOP;
     } else {
         $top = '<a href="' . easy_admin_products_html::href_link("categories") . '">' . TEXT_TOP . '</a>';
     }
     array_unshift($breadcrumbs, $top);
     return join($separater, $breadcrumbs);
 }
开发者ID:homework-bazaar,项目名称:zencart-sugu,代码行数:28,代码来源:easy_admin_products_category_model.php


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