[Pkg-owncloud-commits] [owncloud-doc] 30/270: more WIP
David Prévot
taffit at moszumanska.debian.org
Thu Jul 31 03:52:57 UTC 2014
This is an automated email from the git hooks/post-receive script.
taffit pushed a commit to branch master
in repository owncloud-doc.
commit b141a4ac507cff5b610f43b3974120cbf9c831d5
Author: Bernhard Posselt <dev at bernhard-posselt.com>
Date: Wed May 7 00:32:40 2014 +0200
more WIP
---
developer_manual/app/main.rst | 42 ++++++++++++++++++++++++++++++++++++++++++
1 file changed, 42 insertions(+)
diff --git a/developer_manual/app/main.rst b/developer_manual/app/main.rst
index 5b8323b..d6e1d8d 100644
--- a/developer_manual/app/main.rst
+++ b/developer_manual/app/main.rst
@@ -3,3 +3,45 @@ Main
.. sectionauthor:: Bernhard Posselt <dev at bernhard-posselt.com>
+The file :file:`appinfo/app.php` is the first file that is loaded and executed in ownCloud. Depending on the purpose of the app it usually just contains the ;:doc:`navigation` setup, :doc:`backgroundjobs` and :doc:`hooks` registration. This is how an example :file:`appinfo/app.php` could look like:
+
+.. code-block:: php
+
+ <?php
+
+ \OCP\App::addNavigationEntry(array(
+
+ // the string under which your app will be referenced in owncloud
+ 'id' => 'myapp',
+
+ // sorting weight for the navigation. The higher the number, the higher
+ // will it be listed in the navigation
+ 'order' => 10,
+
+ // the route that will be shown on startup
+ 'href' => \OCP\Util::linkToRoute('myapp.page.index'),
+
+ // the icon that will be shown in the navigation
+ // this file needs to exist in img/example.png
+ 'icon' => \OCP\Util::imagePath('myapp', 'app.svg'),
+
+ // the title of your application. This will be used in the
+ // navigation or on the settings page of your app
+ 'name' => \OC_L10N::get('myapp')->t('My App')
+ ));
+
+ // execute OCA\MyApp\BackgroundJob\Task::run when cron is called
+ \OCP\Backgroundjob::addRegularTask('OCA\MyApp\BackgroundJob\Task', 'run');
+
+ // execute OCA\MyApp\Hooks\User::deleteUser before a user is being deleted
+ \OCP\Util::connectHook('OC_User', 'pre_deleteUser', 'OCA\MyApp\Hooks\User', 'deleteUser');
+
+
+It is also possible to include :doc:`javascript` or :doc:`css` for other apps by placing the **loadScript** or **loadStyle** functions inside this file.
+
+.. code-block:: php
+
+ <?php
+
+ \OCP\Util::addScript('myapp', 'script'); // include js/script.js for every app
+ \OCP\Util::addStyle('myapp', 'style'); // include css/style.css for every app
\ No newline at end of file
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud-doc.git
More information about the Pkg-owncloud-commits
mailing list