==================================== Navigation and pre-app configuration ==================================== .. sectionauthor:: Bernhard Posselt Adding a navigation entry ------------------------- Navigation entries for apps can be created by adding a navigation section to the :file:`appinfo/info.xml` file, containing the name, order and route the navigation entry should link to. For details on the XML schema check the `app store documentation `_. .. code-block:: xml MyApp myapp.page.index 0 Further pre-app configuration ----------------------------- The :file:`appinfo/app.php` is the first file that is loaded and executed in Nextcloud. Depending on the purpose of the app it is usually used to setup things that need to be available on every request to the server, like :doc:`backgroundjobs` and :doc:`hooks` registrations. This is how an example :file:`appinfo/app.php` could look like: .. code-block:: php getJobList()->add('OCA\MyApp\BackgroundJob\Task'); // execute OCA\MyApp\Hooks\User::deleteUser before a user is being deleted \OCP\Util::connectHook('OC_User', 'pre_deleteUser', 'OCA\MyApp\Hooks\User', 'deleteUser'); Although it is also possible to include :doc:`js` or :doc:`css` for other apps by placing the **addScript** or **addStyle** functions inside this file, it is strongly discouraged, because the file is loaded on each request (also such requests that do not return HTML, but e.g. json or webdav). .. code-block:: php registerHooks(); lib/AppInfo/Application.php ^^^^^^^^^^^^^^^^^^^^^^^^^^^ .. code-block:: php