<div id="app-navigation">
 
        <!--主页面-->
    <div class="layui-side layui-bg-white">
    <div class="layui-side-scroll">
       <!-- 左侧导航区域（可配合layui已有的垂直导航） -->
      <ul id="leftMenu" class="layui-nav layui-nav-tree hidden" >
         
        <li class="layui-nav-item layui-nav-itemed">
          <a data-dir="/" data-id="files" data-view="files">
              <i class="ton ton-file-left"></i> <span><?php p($l->t('My Documents'));?></span></a>
          <dl class="layui-nav-child">
              <dd><a href="/apps/gallery/"><span><?php p($l->t('Picture'));?></span></a></dd>
              <dd><a href="/apps/gallery/video"><span><?php p($l->t('Video'));?></span></a></dd> 
              <dd><a href="/apps/gallery/document"><span><?php p($l->t('Document'));?></span></a></dd>
              <dd><a href="/apps/gallery/music"><span><?php p($l->t('Music'));?></span></a></dd>
	      <dd><a href="/apps/gallery/other"><span><?php p($l->t('Other'));?></span></a></dd>
          </dl>
        </li>
       <li class="layui-nav-item"><a data-dir="/" data-id="shareoverview" data-view="shareoverview" > <i class="ton ton-share"></i><span><?php p($l->t('ShareLink'));?></span></a></li> 
       <li class="layui-nav-item"><a data-dir="/" data-id="trashbin" data-view="trashbin"> <i class="ton ton-trust"></i><span><?php p($l->t('RecycleBin'));?></span></a></li>
      </ul>
       <ul id="transMenu" class="layui-nav layui-nav-tree hidden" >
         <li class="layui-nav-item  layui-nav-itemed">
           <a class='active' data-dir="/" data-id="complete" data-view="complete"> <i class="ton ton-complete"></i><span><?php p($l->t('Upload complete'));?></span><span></span></a></li>  
        <li class="layui-nav-item">
          <a data-dir="/" data-id="download" data-view="download">  <i class="ton  ton-down"></i><span><?php p($l->t('Download records'));?></span><span></span></a> </li>
      <!-- <li class="layui-nav-item">
           <a data-dir="/" data-id="upfilelist" data-view="upfilelist"> <i class="ton ton-upload1"></i><span><?php p($l->t('Uploading'));?></span><span></span></a></li> 
          -->   
       </ul> 
       
       
      
    </div>
  </div>
    
    
	<div id="app-settings">
             <ul id="usebill">
                <li id="quota"
                             class="pinned <?php
                             if ($_['quota'] !== \OCP\Files\FileInfo::SPACE_UNLIMITED) {
                             ?>has-tooltip" title="<?php p($_['usage_relative'] . '%');
                     } ?>">
                             <a href="#" class="icon-quota svg">
                                     <p id="quotatext"><?php
                                             if ($_['quota'] !== \OCP\Files\FileInfo::SPACE_UNLIMITED) {
                                                     p($l->t('%1$s of %2$s used', [$_['usage'], $_['total_space']]));
                                             } else {
                                                     p($l->t('%s used', [$_['usage']]));
                                             } ?></p>
                                     <div class="quota-container">
                                             <progress value="<?php p($_['usage_relative']); ?>"
                                                               max="100"
                                                     <?php if ($_['usage_relative'] > 80): ?> class="warn" <?php endif; ?>></progress>
                                     </div>
                             </a>
                     </li>
            </ul>
		<!--<div id="app-settings-header">
			<button class="settings-button"
					data-apps-slide-toggle="#app-settings-content">
				<?php p($l->t('Settings')); ?>
			</button>
		</div>
		<div id="app-settings-content">
			<div id="files-setting-showhidden">
				<input class="checkbox" id="showhiddenfilesToggle"
					   checked="checked" type="checkbox">
				<label for="showhiddenfilesToggle"><?php p($l->t('Show hidden files')); ?></label>
			</div>
			<label for="webdavurl"><?php p($l->t('WebDAV')); ?></label>
			<input id="webdavurl" type="text" readonly="readonly"
				   value="<?php p(\OCP\Util::linkToRemote('webdav')); ?>"/>
			<em><?php print_unescaped($l->t('Use this address to <a href="%s" target="_blank" rel="noreferrer noopener">access your Files via WebDAV</a>', array(link_to_docs('user-webdav')))); ?></em>
		</div>-->
	</div>

</div>


<?php

/**
 * Prints the HTML for a single Entry.
 *
 * @param $item The item to be added
 * @param $l Translator
 * @param $pinned IntegerValue to count the pinned entries at the bottom
 *
 * @return int Returns the pinned value
 */
function NavigationListElements($item, $l, $pinned) {
	strpos($item['classes'] ?? '', 'pinned') !== false ? $pinned++ : '';
	?>
	<li
		data-id="<?php p($item['id']) ?>"
		<?php if (isset($item['dir'])) { ?> data-dir="<?php p($item['dir']); ?>" <?php } ?>
		<?php if (isset($item['view'])) { ?> data-view="<?php p($item['view']); ?>" <?php } ?>
		<?php if (isset($item['expandedState'])) { ?> data-expandedstate="<?php p($item['expandedState']); ?>" <?php } ?>
		class="nav-<?php p($item['id']) ?>
		<?php if (isset($item['classes'])) { p($item['classes']); } ?>
		<?php p($pinned === 1 ? 'first-pinned' : '') ?>
		<?php if (isset($item['defaultExpandedState']) && $item['defaultExpandedState']) { ?> open<?php } ?>"
		<?php if (isset($item['folderPosition'])) { ?> folderposition="<?php p($item['folderPosition']); ?>" <?php } ?>>

		<a href="<?php p(isset($item['href']) ? $item['href'] : '#') ?>"
		   class="nav-icon-<?php p(isset($item['icon']) && $item['icon'] !== '' ? $item['icon'] : $item['id']) ?> svg"><?php p($item['name']); ?></a>


		<?php
		NavigationElementMenu($item);
		if (isset($item['sublist'])) {
			?>
			<button class="collapse app-navigation-noclose" <?php if (sizeof($item['sublist']) == 0) { ?> style="display: none" <?php } ?>></button>
			<ul id="sublist-<?php p($item['id']); ?>">
				<?php
				foreach ($item['sublist'] as $item) {
					$pinned = NavigationListElements($item, $l, $pinned);
				}
				?>
			</ul>
		<?php } ?>
	</li>


	<?php
	return $pinned;
}

/**
 * Prints the HTML for a dotmenu.
 *
 * @param $item The item to be added
 *
 * @return void
 */
function NavigationElementMenu($item) {
	if (isset($item['menubuttons']) && $item['menubuttons'] === 'true') {
		?>
		<div id="dotmenu-<?php p($item['id']); ?>"
			 class="app-navigation-entry-utils" <?php if (isset($item['enableMenuButton']) && $item['enableMenuButton'] === 0) { ?> style="display: none"<?php } ?>>
			<ul>
				<li class="app-navigation-entry-utils-menu-button svg">
					<button id="dotmenu-button-<?php p($item['id']) ?>"></button>
				</li>
			</ul>
		</div>
		<div id="dotmenu-content-<?php p($item['id']) ?>"
			 class="app-navigation-entry-menu">
			<ul>

			</ul>
		</div>
	<?php }
}
