settings.php 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. <?php
  2. /**
  3. * ownCloud - ajax frontend
  4. *
  5. * @author Robin Appelman
  6. * @copyright 2010 Robin Appelman icewind1991@gmail.com
  7. *
  8. * This library is free software; you can redistribute it and/or
  9. * modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
  10. * License as published by the Free Software Foundation; either
  11. * version 3 of the License, or any later version.
  12. *
  13. * This library is distributed in the hope that it will be useful,
  14. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16. * GNU AFFERO GENERAL PUBLIC LICENSE for more details.
  17. *
  18. * You should have received a copy of the GNU Affero General Public
  19. * License along with this library. If not, see <http://www.gnu.org/licenses/>.
  20. *
  21. */
  22. // Init owncloud
  23. // Check if we are a user
  24. OCP\User::checkLoggedIn();
  25. // Load the files we need
  26. OCP\Util::addStyle( "files", "files" );
  27. OCP\Util::addscript( "files", "files" );
  28. // Load the files
  29. $dir = isset( $_GET['dir'] ) ? $_GET['dir'] : '';
  30. $files = array();
  31. foreach( OC_Files::getdirectorycontent( $dir ) as $i ) {
  32. $i["date"] = date( $CONFIG_DATEFORMAT, $i["mtime"] );
  33. $files[] = $i;
  34. }
  35. // Make breadcrumb
  36. $breadcrumb = array();
  37. $pathtohere = "/";
  38. foreach( explode( "/", $dir ) as $i ) {
  39. if( $i != "" ) {
  40. $pathtohere .= "$i/";
  41. $breadcrumb[] = array( "dir" => $pathtohere, "name" => $i );
  42. }
  43. }
  44. // return template
  45. $tmpl = new OCP\Template( "files", "index", "user" );
  46. $tmpl->assign( 'files', $files );
  47. $tmpl->assign( "breadcrumb", $breadcrumb );
  48. $tmpl->printPage();