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


PHP file::hierarchy方法代码示例

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


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

示例1: generate


//.........这里部分代码省略.........
        if ($this->parent > 0) {
            $icon = $this->mimeIcon('folder/back');
            $html[] = '<div class="navibrowse-folder navibrowse-back ui-corner-all" id="item-' . $this->previous . '">';
            $html[] = '		<img src="' . $icon . '" width="' . $this->icon_size . '" height="' . $this->icon_size . '" />';
            $html[] = '		<div class="navibrowse-item-name">' . t(139, 'Back') . '</div>';
            $html[] = '</div>';
        }
        if (empty($this->items)) {
            $this->items = array();
        }
        foreach ($this->items as $item) {
            $icon = $this->mimeIcon($item->mime, $item->type);
            $thumbnail = '';
            if ($item->type == 'image') {
                $thumbnail = NAVIGATE_DOWNLOAD . '?wid=' . $website->id . '&id=' . $item->id . '&disposition=inline&width=' . intval($this->icon_size) . '&height=' . intval($this->icon_size);
            }
            if ($item->type == 'folder') {
                $html[] = '<div class="navibrowse-folder ui-corner-all" mime="' . $item->mime . '" id="item-' . $item->id . '" data-file-type="' . $item->type . '" data-file-id="' . $item->id . '">';
                $html[] = '		<img src="' . $icon . '" width="' . $this->icon_size . '" height="' . $this->icon_size . '" />';
                $html[] = '		<div class="navibrowse-item-name">' . $item->name . '</div>';
                $html[] = '</div>';
            } else {
                $html[] = '<div class="navibrowse-file ui-corner-all" mime="' . $item->mime . '" id="item-' . $item->id . '" data-file-type="' . $item->type . '" data-file-id="' . $item->id . '">';
                $html[] = '     <div class="navibrowse-file-access-icons">' . $permissions[$item->permission] . $access[$item->access] . '</div>';
                $html[] = '		<img src="' . $icon . '" data-src="' . $thumbnail . '"  width="' . $this->icon_size . '" height="' . $this->icon_size . '" />';
                $html[] = '		<div class="navibrowse-item-name">' . $item->name . '</div>';
                $html[] = '</div>';
            }
        }
        $html[] = '<div class="clearer">&nbsp;</div>';
        $html[] = '</div>';
        $html[] = '</div>';
        $html[] = '</div>';
        $hierarchy = file::hierarchy(0);
        $folders_tree = file::hierarchyList($hierarchy, $item->parent);
        $html[] = '
			<div id="navibrowse-folder-tree-dialog" class="hidden">			
				<div class="navibrowse_folder_tree" style=" width: 90%; ">
				    <img src="img/icons/silk/folder_home.png" align="absmiddle" />  ' . t(18, 'Home') . '<div class="tree_ul">' . $folders_tree . '</div>
                </div>
			</div>
		';
        $html[] = '<script language="javascript" type="text/javascript">';
        // replace placeholder images by real thumbnails after document is ready
        $html[] = '
			$(window).on("load", function()
			{
				new LazyLoad({
				    threshold: 200,
				    container: document.getElementById("navigate-content-safe"),
				    elements_selector: ".navibrowse-file img",
				    throttle: 40,
				    data_src: "src",
				    show_while_loading: true
				});
			});
		';
        //		$html[] = '$(".navibrowse-file, .navibrowse-folder").on("mouseover", function() { $(this).css("opacity", 0.7); });';
        //		$html[] = '$(".navibrowse-file, .navibrowse-folder").on("mouseout", function() { $(this).css("opacity", 1); });';
        $html[] = '$(".navibrowse-path a").button();';
        $html[] = '$(".navibrowse-items").children().on("click", function(e)
				   {
					   if(e.ctrlKey)
					   {
							// just add or remove the item as selected  
							if($(this).hasClass("ui-selected"))
开发者ID:NavigateCMS,项目名称:Navigate-CMS,代码行数:67,代码来源:navibrowse.class.php

示例2: hierarchy

 public static function hierarchy($id_parent = 0)
 {
     $tree = array();
     if ($id_parent == -1) {
         /*
         $tree[] = array(   'id' => '0',
         				   'parent' => -1,
         				   'position' => 0,
         				   'permission' => 0,
         				   'icon' => 0,
         				   'metatags' => '',
         				   'label' => $website->name,
         				   'date_published' => '',
         				   'date_unpublish' => '',
         				   'dates' => 'x - x',
         				   'children' => structure::hierarchy(0)
         				);
         */
         $obj = new structure();
         $obj->id = 0;
         $obj->label = t(18, 'Home');
         $obj->parent = -1;
         $obj->children = file::hierarchy(0);
         $tree[] = $obj;
     } else {
         $tree = file::loadTree($id_parent);
         for ($i = 0; $i < count($tree); $i++) {
             $children = file::hierarchy($tree[$i]->id);
             $tree[$i]->children = $children;
             $tree[$i]->label = $tree[$i]->name;
             if (empty($tree[$i]->label)) {
                 $tree[$i]->label = '[ ? ]';
             }
         }
     }
     return $tree;
 }
开发者ID:NavigateCMS,项目名称:Navigate-CMS,代码行数:37,代码来源:file.class.php


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