diff options
author | Brice Maron <brice@bmaron.net> | 2011-10-21 23:30:12 +0200 |
---|---|---|
committer | Brice Maron <brice@bmaron.net> | 2011-10-21 23:30:12 +0200 |
commit | 8c7fc032969cdb0a989b5f18e8b5ce915de2a0f4 (patch) | |
tree | f10cee296d6ad5d2442168f13c8f295baba02638 /files | |
parent | 61660c068a1d24f3723e4f82573143e2a4d884e8 (diff) | |
download | nextcloud-server-8c7fc032969cdb0a989b5f18e8b5ce915de2a0f4.tar.gz nextcloud-server-8c7fc032969cdb0a989b5f18e8b5ce915de2a0f4.zip |
Correct unknown breadcrumb add '/' permanantly in it and DRY code for last breadcrumb
Diffstat (limited to 'files')
-rw-r--r-- | files/index.php | 4 | ||||
-rw-r--r-- | files/templates/part.breadcrumb.php | 10 |
2 files changed, 5 insertions, 9 deletions
diff --git a/files/index.php b/files/index.php index bd37598289a..7a9bf793a0e 100644 --- a/files/index.php +++ b/files/index.php @@ -41,7 +41,7 @@ if(!isset($_SESSION['timezone'])){ } OC_App::setActiveNavigationEntry( "files_index" ); // Load the files -$dir = isset( $_GET['dir'] ) ? $_GET['dir'] : ''; +$dir = isset( $_GET['dir'] ) && $_GET['dir'] != '/' ? $_GET['dir'] : ''; $files = array(); foreach( OC_Files::getdirectorycontent( $dir ) as $i ){ @@ -63,7 +63,7 @@ foreach( OC_Files::getdirectorycontent( $dir ) as $i ){ } // Make breadcrumb -$breadcrumb = array(); +$breadcrumb = array('/'); $pathtohere = ""; foreach( explode( "/", $dir ) as $i ){ if( $i != "" ){ diff --git a/files/templates/part.breadcrumb.php b/files/templates/part.breadcrumb.php index b26f6097153..ab81cc5c039 100644 --- a/files/templates/part.breadcrumb.php +++ b/files/templates/part.breadcrumb.php @@ -1,10 +1,6 @@ - <?php for($i=0; $i<count($_["breadcrumb"])-1; $i++): + <?php for($i=0; $i<count($_["breadcrumb"]); $i++): $crumb = $_["breadcrumb"][$i]; ?> - <div class="crumb svg" data-dir='<?php echo $crumb["dir"];?>' style='background-image:url("<?php echo image_path('core','breadcrumb.png');?>")'> + <div class="crumb <?php if($i == count($_["breadcrumb"])-1) echo 'last';?> svg" data-dir='<?php echo $crumb["dir"];?>' style='background-image:url("<?php echo image_path('core','breadcrumb.png');?>")'> <a href="<?php echo $_['baseURL'].$crumb["dir"]; ?>"><?php echo htmlspecialchars($crumb["name"]); ?></a> </div> - <?php endfor; - $crumb = $_["breadcrumb"][count($_["breadcrumb"])-1] ?> - <div class="crumb last svg" data-dir='<?php echo $crumb["dir"];?>' style='background-image:url("<?php echo image_path('core','breadcrumb.png');?>")'> - <a href="<?php echo $_['baseURL'].$crumb["dir"]; ?>"><?php echo htmlspecialchars($crumb["name"]); ?></a> - </div>
\ No newline at end of file + <?php endfor;?>
\ No newline at end of file |