help.php 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. <?php
  2. /**
  3. * @copyright Copyright (c) 2016, ownCloud, Inc.
  4. *
  5. * @author Bart Visscher <bartv@thisnet.nl>
  6. * @author Christopher Schäpers <kondou@ts.unde.re>
  7. * @author Frank Karlitschek <frank@karlitschek.de>
  8. * @author Jakob Sack <mail@jakobsack.de>
  9. * @author Jan-Christoph Borchardt <hey@jancborchardt.net>
  10. * @author Lukas Reschke <lukas@statuscode.ch>
  11. * @author Morris Jobke <hey@morrisjobke.de>
  12. * @author Robin Appelman <robin@icewind.nl>
  13. * @author Roeland Jago Douma <roeland@famdouma.nl>
  14. *
  15. * @license AGPL-3.0
  16. *
  17. * This code is free software: you can redistribute it and/or modify
  18. * it under the terms of the GNU Affero General Public License, version 3,
  19. * as published by the Free Software Foundation.
  20. *
  21. * This program is distributed in the hope that it will be useful,
  22. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  23. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  24. * GNU Affero General Public License for more details.
  25. *
  26. * You should have received a copy of the GNU Affero General Public License, version 3,
  27. * along with this program. If not, see <http://www.gnu.org/licenses/>
  28. *
  29. */
  30. use OCP\AppFramework\Http\TemplateResponse;
  31. OC_Util::checkLoggedIn();
  32. \OC::$server->getEventDispatcher()->dispatch(TemplateResponse::EVENT_LOAD_ADDITIONAL_SCRIPTS_LOGGEDIN);
  33. // Load the files we need
  34. OC_Util::addStyle( "settings", "settings" );
  35. \OC::$server->getNavigationManager()->setActiveEntry('help');
  36. if(isset($_GET['mode']) and $_GET['mode'] === 'admin') {
  37. $url=\OCP\Util::linkToAbsolute( 'core', 'doc/admin/index.html' );
  38. $style1='';
  39. $style2=' active';
  40. }else{
  41. $url=\OCP\Util::linkToAbsolute( 'core', 'doc/user/index.html' );
  42. $style1=' active';
  43. $style2='';
  44. }
  45. $url1=\OC::$server->getURLGenerator()->linkToRoute('settings_help').'?mode=user';
  46. $url2=\OC::$server->getURLGenerator()->linkToRoute('settings_help').'?mode=admin';
  47. $tmpl = new OC_Template( "settings", "help", "user" );
  48. $tmpl->assign( "admin", OC_User::isAdminUser(OC_User::getUser()));
  49. $tmpl->assign( "url", $url );
  50. $tmpl->assign( "url1", $url1 );
  51. $tmpl->assign( "url2", $url2 );
  52. $tmpl->assign( "style1", $style1 );
  53. $tmpl->assign( "style2", $style2 );
  54. $tmpl->printPage();