diff --git a/developer_manual/app/api.rst b/developer_manual/app/api.rst new file mode 100644 index 000000000..942e609b7 --- /dev/null +++ b/developer_manual/app/api.rst @@ -0,0 +1,4 @@ +RESTful API +=========== + +.. sectionauthor:: Bernhard Posselt \ No newline at end of file diff --git a/developer_manual/app/app/acceptancetesting.rst b/developer_manual/app/app/acceptancetesting.rst deleted file mode 100644 index 679deacf5..000000000 --- a/developer_manual/app/app/acceptancetesting.rst +++ /dev/null @@ -1,7 +0,0 @@ -Acceptance Tests -================ - -https://github.com/cucumber/cucumber/wiki/Given-When-Then -http://www.elabs.se/blog/15-you-re-cuking-it-wrong -https://github.com/cucumber/cucumber/wiki/Cucumber-Backgrounder -https://github.com/jnicklas/capybara#capybara \ No newline at end of file diff --git a/developer_manual/app/app/api/index.rst b/developer_manual/app/app/api/index.rst deleted file mode 100644 index fad85d89a..000000000 --- a/developer_manual/app/app/api/index.rst +++ /dev/null @@ -1,11 +0,0 @@ -============ -ownCloud API -============ - -.. toctree:: - :maxdepth: 1 - - ocs - ocs_result - templates - view diff --git a/developer_manual/app/app/api/ocs.rst b/developer_manual/app/app/api/ocs.rst deleted file mode 100644 index e147e3db1..000000000 --- a/developer_manual/app/app/api/ocs.rst +++ /dev/null @@ -1,21 +0,0 @@ -OCS -=== - -.. sectionauthor:: Tom Needham - -Manages the backend of the external API - -.. php:namespace:: OCP -.. php:class:: API - - .. php:method:: register($method, $url, $action, $app, $authlevel, $defaults, $requirements) - - Registers an API route with the backend. - - :param string $method: The HTTP method (get, post, put or delete) - :param string $url: The URL that defines the API route which can also include params (See the `Symfony Documentation `_) - :param callable $action: The function to call - :param string $app: The app id - :param int $authlevel: The required level of authentication to access the API method. The following constants can be passed: OC_API::ADMIN_AUTH, OC_API::SUBADMIN_AUTH, OC_API::USER_AUTH, OC_API::GUEST_AUTH - :param array $defaults: associative array of defaults for the URL parameters. Keys are the parameter names as defined in the url - :param array $requirements: associative array of requirements for the url parameters (See the `Symfony Documentation: Adding Requirements `_) \ No newline at end of file diff --git a/developer_manual/app/app/api/ocs_result.rst b/developer_manual/app/app/api/ocs_result.rst deleted file mode 100644 index 02316ad54..000000000 --- a/developer_manual/app/app/api/ocs_result.rst +++ /dev/null @@ -1,28 +0,0 @@ -OCS_Result -========== - -.. sectionauthor:: Tom Needham - -Holds data on the result of the API method. - -.. php:class:: OC_OCS_Result - - .. php:method:: __construct($data=null, $code=100, $message=null) - - Creates an OC_OCS_Result object - - :param mixed $data: The data you wish to return, this may be a string, integer or array - :param int $code: The response code you wish to return, defaults to success (100) - :param string $message: An optional message to return with the response (explaining the result) - - .. php:method:: setTotalItems($items) - - Sets the value in the response. Use this to inform the client of the range of data available. - - :param int $items: The number of items in the full data set - - .. php:method:: setItemsPerPage($items) - - Sets the value in the response. Use this to inform the client of the number of pieces of data per page. - - :param int $items: The number of items per page of data. diff --git a/developer_manual/app/app/api/templates.rst b/developer_manual/app/app/api/templates.rst deleted file mode 100644 index 45233fbd7..000000000 --- a/developer_manual/app/app/api/templates.rst +++ /dev/null @@ -1,405 +0,0 @@ -OC Templates -============ -.. sectionauthor:: Bernhard Posselt - -OC_Template ------------ - -.. php:class:: OC_Template - - - This class provides the templates for owncloud. It is used for loading template files, assign variables to it and render the whole template. - - .. php:method:: __construct($app, $name[, $renderas]) - - :param string $app: the name of the app - :param string $file: name of the template file (without suffix) - :param string $renderas: If $renderas is set, OC_Template will try to produce a full page in the according layout. For now, renderas can be set to "guest", "user" or "admin" - :returns: OC_Template object - - **Example:** - - .. code-block:: php - - - - - .. php:method:: addHeader($tag, $attributes[, $text='']) - - :param string $tag: tag name of the element - :param array $attributes: array of attrobutes for the element - :param string $text: the text content for the element - - Add a custom element to the html - - **Example:** - - .. code-block:: php - - addHeader('title', array(), 'My new Page'); - ?> - - .. php:method:: append($key, $value) - - :param string $key: the key under which the variable can be accessed in the template - :param $value: the value that we want to pass - :returns: bool - - This function assigns a variable in an array context. If the key already exists, the value will be appended. It can be accessed via $_[$key][$position] in the template. - - **Example:** - - .. code-block:: php - - assign('customers', $customers); - $mainTemplate->append('customers', 'hanna'); - ?> - - - .. php:method:: assign($key, $value) - - :param string $key: the key under which the variable can be accessed in the template - :param $value: the value that we want to pass - :returns: bool - - This function assigns a variable. It can be accessed via $_[$key] in the template. If the key existed before, it will be overwritten - - **Example:** - - .. code-block:: php - - assign('customers', $customers); - ?> - - - .. php:method:: detectFormfactor() - - :returns: The mode of the client as a string. **default** -> the normal desktop browser interface, **mobile** -> interface for smartphones, **tablet** -> interface for tablets, **standalone** -> the default interface but without header, footer and sidebar, just the application. Useful to use just a specific app on the desktop in a standalone window. - - **Example:** - - .. code-block:: php - - detectFormfactor(); - ?> - - - .. php:method:: fetchPage() - - :returns: the HTML of the template as string - - This function proceeds the template and but prints no output. - - **Example:** - - .. todo:: provide example - - - .. php:method:: getFormFactorExtension() - - :returns: Returns the formfactor extension for current formfactor (like .mobile or .tablet) - - - **Example:** - - .. code-block:: php - - detectFormfactorExtension(); - ?> - - - .. php:method:: inc($file[, $additionalparams]) - - :param string $file: the name of the template - :param array $additionalparams: an array with additional variables which should be used for the included template - :returns: returns content of included template as a string - - Includes another template. use inc('template')); ?> to do this. The included template has access to all parent template variables! - - **Example:** - - .. code-block:: php - -
- inc('nav.inc', array('active' => 'nav_entry_1')); ?> -
- - - .. php:method:: printPage() - - :returns: true when there is content to print - - This function proceeds the template and prints its output. - - **Example:** - - .. code-block:: php - - assign('test', array("test", "test2")); - $mainTemplate->printPage(); - ?> - - .. php:method:: printAdminPage($application, $name[, $parameters]) - - :param string $application: The application we render the template for - :param string $name: Name of the template - :param array $parameters: Parameters for the template - :returns: bool - - Shortcut to print a simple page for admin - - **Example:** - - .. todo:: provide example - - - .. php:method:: printGuestPage($application, $name[, $parameters]) - - :param string $application: The application we render the template for - :param string $name: Name of the template - :param array $parameters: Parameters for the template - :returns: bool - - Shortcut to print a simple page for guests - - **Example:** - - .. todo:: provide example - - - .. php:method:: printUserPage($application, $name[, $parameters]) - - :param string $application: The application we render the template for - :param string $name: Name of the template - :param array $parameters: Parameters for the template - :returns: bool - - Shortcut to print a simple page for users - - **Example:** - - .. todo:: provide example - - - -Template functions ------------------- - -These functions are automatically available in all templates. - -html_select_options -~~~~~~~~~~~~~~~~~~~ -.. php:function:: html_select_options($options, $selected[, $params]) - - :param array $options: an array of the form value => label - :param string/array $selected: an array containing strings or a simple string which sets a value as selected - :param array $params: optional parameters that are done in key => value - :returns: the html as string of preset