File/lib/api.php

Description

Nag external API interface.

$Horde: nag/lib/api.php,v 1.100.10.47 2010/05/09 19:00:31 mrubinsk Exp $

This file defines Nag's external API interface. Other applications can interact with Nag through this API.

Functions
_nag_addTasklist (line 241)

Add a new task list

  • return: The new tasklist's id.
integer _nag_addTasklist (string $name, [string $description = ''])
  • string $name: Task list name
  • string $description: Task list description
_nag_browse (line 294)

Browse through Nag's object tree.

  • return: The contents of $path
array _nag_browse ([string $path = ''], [array $properties = array()])
  • string $path: The level of the tree to browse.
  • array $properties: The item properties to return. Defaults to 'name', 'icon', and 'browseable'.
_nag_delete (line 1112)

Deletes a task identified by UID.

  • return: Success or failure.
boolean _nag_delete (string|array $uid)
  • string|array $uid: Identify the task to delete, either a single UID or an array.
_nag_export (line 1015)

Exports a task, identified by UID, in the requested content type.

  • return: The requested data.
string _nag_export (string $uid, string $contentType)
  • string $uid: Identify the task to export.
  • string $contentType: What format should the data be in? A string with one of:
     text/calendar    - (VCALENDAR 2.0. Recommended as this is specified in
                        rfc2445)
     text/x-vcalendar - (old VCALENDAR 1.0 format. Still in wide use)
_nag_exportTasklist (line 1070)

Exports a tasklist in the requested content type.

  • return: The iCalendar representation of the tasklist.
string _nag_exportTasklist (string $tasklist, string $contentType)
  • string $tasklist: The tasklist to export.
  • string $contentType: What format should the data be in? A string with one of:
                                 text/calendar (VCALENDAR 2.0. Recommended as
                                                this is specified in rfc2445)
                                 text/x-vcalendar (old VCALENDAR 1.0 format.
                                                  Still in wide use)
_nag_getActionTimestamp (line 862)

Returns the timestamp of an operation for a given uid an action.

  • return: The timestamp for this action.
integer _nag_getActionTimestamp (string $uid, string $action, [string $tasklist = null])
  • string $uid: The uid to look for.
  • string $action: The action to check for - add, modify, or delete.
  • string $tasklist: The tasklist to be used. If 'null', the user's default tasklist will be used.
_nag_import (line 896)

Imports one or more tasks represented in the specified content type.

If a UID is present in the content and the task is already in the database, a replace is performed rather than an add.

  • return: The new UID on one import, an array of UIDs on multiple imports, or PEAR_Error on failure.
string _nag_import (string $content, string $contentType, [string $tasklist = null])
  • string $content: The content of the task.
  • string $contentType: What format is the data in? Currently supports: text/calendar text/x-vcalendar
  • string $tasklist: The tasklist into which the task will be imported. If 'null', the user's default tasklist will be used.
_nag_list (line 787)

Returns an array of UIDs for all tasks that the current user is authorized to see.

  • return: An array of UIDs for all tasks the user can access.
array _nag_list ([variant $tasklist = null])
  • variant $tasklist: The tasklist or an array of taskslists to list.
_nag_listAlarms (line 1327)

Lists alarms for a given moment.

  • return: An array of UIDs
array _nag_listAlarms (integer $time, [string $user = null])
  • integer $time: The time to retrieve alarms for.
  • string $user: The user to retreive alarms for. All users if null.
_nag_listBy (line 829)

Returns an array of UIDs for tasks that have had $action happen since $timestamp.

  • return: An array of UIDs matching the action and time criteria.
array _nag_listBy (string $action, integer $timestamp, [string $tasklist = null])
  • string $action: The action to check for - add, modify, or delete.
  • integer $timestamp: The time to start the search.
  • string $tasklist: The tasklist to be used. If 'null', the user's default tasklist will be used.
_nag_listCostObjects (line 1236)

Lists active tasks as cost objects.

  • todo: Implement $criteria parameter.
void _nag_listCostObjects (array $criteria)
  • array $criteria: Filter attributes
_nag_listTasklists (line 771)
  • return: The task lists.
array _nag_listTasklists (boolean $owneronly, integer $permission)
  • boolean $owneronly: Only return tasklists that this user owns? Defaults to false.
  • integer $permission: The permission to filter tasklists by.
_nag_listTasks (line 212)

Retrieves the current user's task list from storage.

This function will also sort the resulting list, if requested.

  • return: A list of the requested tasks.
Nag_Task _nag_listTasks ([string $sortby = null], [integer $sortdir = null])
  • string $sortby: The field by which to sort (NAG_SORT_PRIORITY, NAG_SORT_NAME NAG_SORT_DUE, NAG_SORT_COMPLETION).
  • integer $sortdir: The direction by which to sort
_nag_listTimeObjectCategories (line 1260)
void _nag_listTimeObjectCategories ()
_nag_listTimeObjects (line 1279)

Lists active tasks as time objects.

void _nag_listTimeObjects (array $categories, mixed $start, mixed $end)
  • array $categories: The time categories (from listTimeObjectCategories) to list.
  • mixed $start: The start date of the period.
  • mixed $end: The end date of the period.
_nag_path_delete (line 703)

Deletes a file from the Nag tree.

  • return: The event's UID, or a PEAR_Error on failure.
mixed _nag_path_delete (string $path)
  • string $path: The path to the file.
_nag_perms (line 121)

Returns a list of available permissions.

  • return: An array describing all available permissions.
array _nag_perms ()
_nag_put (line 530)

Saves a file into the Nag tree.

  • return: The event UIDs, or a PEAR_Error on failure.
array _nag_put (string $path, string $content, string $content_type)
  • string $path: The path where to PUT the file.
  • string $content: The file content.
  • string $content_type: The file's content type.
_nag_removeUserData (line 138)

Removes user data.

  • return: true on success | PEAR_Error on failure
mixed _nag_removeUserData (string $user)
  • string $user: Name of user to remove data for.
_nag_replace (line 1161)

Replaces the task identified by UID with the content represented in the specified content type.

If you want to replace multiple tasks with the UID specified in the VCALENDAR data, you may use _nag_import instead. This automatically does a replace if existings UIDs are found.

  • return: Success or failure.
boolean _nag_replace (string $uid, string $content, string $contentType)
  • string $uid: Identify the task to replace.
  • string $content: The content of the task.
  • string $contentType: What format is the data in? Currently supports:
    • text/x-vcalendar
    • text/calendar
__nag_modified (line 276)

Returns the last modification timestamp of a given uid.

  • return: The timestamp for the last modification of $uid.
integer __nag_modified (string $uid, [string $tasklist = null])
  • string $uid: The uid to look for.
  • string $tasklist: The tasklist to look in.

Documentation generated on Sun, 30 Jan 2011 05:35:02 +0000 by phpDocumentor 1.4.3