class Ansel_Api extends Horde_Registry_Api
{
/**
- * Returns a list of available permissions.
- *
- * @return array An array describing all available permissions.
- */
- public function perms()
- {
- $perms = array();
- $perms['tree']['ansel']['admin'] = false;
- $perms['title']['ansel:admin'] = _("Administrators");
-
- return $perms;
- }
-
- /**
* Browse through Ansel's gallery tree.
*
* @param string $path The level of the tree to browse.
public $version = 'H4 (2.0-git)';
/**
+ * Returns a list of available permissions.
+ *
+ * @return array An array describing all available permissions.
+ */
+ public function perms()
+ {
+ $perms = array();
+ $perms['tree']['ansel']['admin'] = false;
+ $perms['title']['ansel:admin'] = _("Administrators");
+
+ return $perms;
+ }
+
+ /**
* Special preferences handling on update.
*
* @param string $item The preference name.
+++ /dev/null
-<?php
-/**
- * Babel external API interface.
- *
- * This file defines Babel's external API interface. Other applications can
- * interact with Babel through this API.
- *
- * Copyright 2009 The Horde Project (http://www.horde.org/)
- *
- * @author Joel Vandal <joel@scopserv.com>
- * @package Babel
- */
-class Babel_Api extends Horde_Registry_Api
-{
- public function perms()
- {
- global $registry;
-
- static $perms = array();
- if (!empty($perms)) {
- return $perms;
- }
-
- $perms['tree']['babel']['language'] = array();
- $perms['title']['babel:language'] = _("Languages");
- $perms['type']['babel:language'] = 'none';
-
- foreach(Horde_Nls::$config['languages'] as $langcode => $langdesc) {
- $perms['tree']['babel']['language'][$langcode] = false;
- $perms['title']['babel:language:' . $langcode] = sprintf("%s (%s)", $langdesc, $langcode);
- $perms['type']['babel:language:' . $langcode] = 'boolean';
- }
-
- $perms['tree']['babel']['module'] = array();
- $perms['title']['babel:module'] = _("Modules");
- $perms['type']['babel:module'] = 'none';
-
- foreach ($registry->applications as $app => $params) {
- if ($params['status'] == 'heading' || $params['status'] == 'block') {
- continue;
- }
-
- if (isset($params['fileroot']) && !is_dir($params['fileroot'])) {
- continue;
- }
-
- if (preg_match('/_reports$/', $app) || preg_match('/_tools$/', $app)) {
- continue;
- }
-
- $perms['tree']['babel']['module'][$app] = false;
- $perms['title']['babel:module:' . $app] = sprintf("%s (%s)", $params['name'], $app);
- $perms['type']['babel:module:' . $app] = 'boolean';
- }
-
- $tabdesc['download'] = _("Download");
- $tabdesc['upload'] = _("Upload");
- $tabdesc['stats'] = _("Statistics");
- $tabdesc['view'] = _("View/Edit");
- $tabdesc['viewsource'] = _("View Source");
- $tabdesc['extract'] = _("Extract");
- $tabdesc['make'] = _("Make");
- $tabdesc['commit'] = _("Commit");
- $tabdesc['reset'] = _("Reset");
-
- foreach ($tabdesc as $cat => $desc) {
- $perms['tree']['babel'][$cat] = array();
- $perms['title']['babel:' . $cat] = $desc;
- }
-
- return $perms;
- }
-
-}
class Babel_Application extends Horde_Registry_Application
{
public $version = 'H4 (0.1-git)';
+
+ /**
+ * Returns a list of available permissions.
+ *
+ * @return array An array describing all available permissions.
+ */
+ public function perms()
+ {
+ global $registry;
+
+ static $perms = array();
+ if (!empty($perms)) {
+ return $perms;
+ }
+
+ $perms['tree']['babel']['language'] = array();
+ $perms['title']['babel:language'] = _("Languages");
+ $perms['type']['babel:language'] = 'none';
+
+ foreach(Horde_Nls::$config['languages'] as $langcode => $langdesc) {
+ $perms['tree']['babel']['language'][$langcode] = false;
+ $perms['title']['babel:language:' . $langcode] = sprintf("%s (%s)", $langdesc, $langcode);
+ $perms['type']['babel:language:' . $langcode] = 'boolean';
+ }
+
+ $perms['tree']['babel']['module'] = array();
+ $perms['title']['babel:module'] = _("Modules");
+ $perms['type']['babel:module'] = 'none';
+
+ foreach ($registry->applications as $app => $params) {
+ if ($params['status'] == 'heading' || $params['status'] == 'block') {
+ continue;
+ }
+
+ if (isset($params['fileroot']) && !is_dir($params['fileroot'])) {
+ continue;
+ }
+
+ if (preg_match('/_reports$/', $app) || preg_match('/_tools$/', $app)) {
+ continue;
+ }
+
+ $perms['tree']['babel']['module'][$app] = false;
+ $perms['title']['babel:module:' . $app] = sprintf("%s (%s)", $params['name'], $app);
+ $perms['type']['babel:module:' . $app] = 'boolean';
+ }
+
+ $tabdesc['download'] = _("Download");
+ $tabdesc['upload'] = _("Upload");
+ $tabdesc['stats'] = _("Statistics");
+ $tabdesc['view'] = _("View/Edit");
+ $tabdesc['viewsource'] = _("View Source");
+ $tabdesc['extract'] = _("Extract");
+ $tabdesc['make'] = _("Make");
+ $tabdesc['commit'] = _("Commit");
+ $tabdesc['reset'] = _("Reset");
+
+ foreach ($tabdesc as $cat => $desc) {
+ $perms['tree']['babel'][$cat] = array();
+ $perms['title']['babel:' . $cat] = $desc;
+ }
+
+ return $perms;
+ }
+
}
+++ /dev/null
-<?php
-/**
- * Chora external API interface.
- *
- * This file defines Chora's external API interface. Other applications can
- * interact with Chora through this API.
- *
- * @package Chora
- */
-class Chora_Api extends Horde_Registry_Api
-{
- public function perms()
- {
- static $perms = array();
-
- if (!empty($perms)) {
- return $perms;
- }
-
- require_once dirname(__FILE__) . '/../config/sourceroots.php';
-
- $perms['tree']['chora']['sourceroots'] = false;
- $perms['title']['chora:sourceroots'] = _("Repositories");
-
- // Run through every source repository
- foreach ($sourceroots as $sourceroot => $srconfig) {
- $perms['tree']['chora']['sourceroots'][$sourceroot] = false;
- $perms['title']['chora:sourceroots:' . $sourceroot] = $srconfig['name'];
- }
-
- return $perms;
- }
-
-}
public $version = 'H4 (3.0-git)';
/**
+ * Returns a list of available permissions.
+ *
+ * @return array An array describing all available permissions.
+ */
+ public function perms()
+ {
+ static $perms = array();
+
+ if (!empty($perms)) {
+ return $perms;
+ }
+
+ require_once dirname(__FILE__) . '/../config/sourceroots.php';
+
+ $perms['tree']['chora']['sourceroots'] = false;
+ $perms['title']['chora:sourceroots'] = _("Repositories");
+
+ // Run through every source repository
+ foreach ($sourceroots as $sourceroot => $srconfig) {
+ $perms['tree']['chora']['sourceroots'][$sourceroot] = false;
+ $perms['title']['chora:sourceroots:' . $sourceroot] = $srconfig['name'];
+ }
+
+ return $perms;
+ }
+
+ /**
* Generate the menu to use on the prefs page.
*
* @return Horde_Menu A Horde_Menu object.
class Gollem_Api extends Horde_Registry_Api
{
/**
- * TODO
- */
- public function perms()
- {
- static $perms = array();
- if (!empty($perms)) {
- return $perms;
- }
-
- require_once dirname(__FILE__) . '/base.load.php';
- require GOLLEM_BASE . '/config/backends.php';
-
- $perms['tree']['gollem']['backends'] = false;
- $perms['title']['gollem:backends'] = _("Backends");
-
- // Run through every backend.
- foreach ($backends as $backend => $curBackend) {
- $perms['tree']['gollem']['backends'][$backend] = false;
- $perms['title']['gollem:backends:' . $backend] = $curBackend['name'];
- }
-
- return $perms;
- }
-
- /**
* Browses through the VFS tree.
*
* Each VFS backend is listed as a directory at the top level. No modify
public $version = 'H4 (2.0-git)';
/**
+ * Returns a list of available permissions.
+ *
+ * @return array An array describing all available permissions.
+ */
+ public function perms()
+ {
+ static $perms = array();
+ if (!empty($perms)) {
+ return $perms;
+ }
+
+ require_once dirname(__FILE__) . '/base.load.php';
+ require GOLLEM_BASE . '/config/backends.php';
+
+ $perms['tree']['gollem']['backends'] = false;
+ $perms['title']['gollem:backends'] = _("Backends");
+
+ // Run through every backend.
+ foreach ($backends as $backend => $curBackend) {
+ $perms['tree']['gollem']['backends'][$backend] = false;
+ $perms['title']['gollem:backends:' . $backend] = $curBackend['name'];
+ }
+
+ return $perms;
+ }
+
+ /**
* Special preferences handling on update.
*
* @param string $item The preference name.
*/
class IMP_Api extends Horde_Registry_Api
{
- /* Horde-defined functions. */
-
- /**
- * Returns a list of available permissions.
- *
- * @return array The permissions list.
- */
- public function perms()
- {
- return array(
- 'tree' => array(
- 'imp' => array(
- 'create_folders' => false,
- 'max_folders' => false,
- 'max_recipients' => false,
- 'max_timelimit' => false,
- ),
- ),
- 'title' => array(
- 'imp:create_folders' => _("Allow Folder Creation?"),
- 'imp:max_folders' => _("Maximum Number of Folders"),
- 'imp:max_recipients' => _("Maximum Number of Recipients per Message"),
- 'imp:max_timelimit' => _("Maximum Number of Recipients per Time Period"),
- ),
- 'type' => array(
- 'imp:create_folders' => 'boolean',
- 'imp:max_folders' => 'int',
- 'imp:max_recipients' => 'int',
- 'imp:max_timelimit' => 'int',
- )
- );
- }
-
- /* IMP-specific functions. */
-
/**
* Returns a compose window link.
*
IMP::initialize();
}
+ /* Horde permissions. */
+
+ /**
+ * Returns a list of available permissions.
+ *
+ * @return array An array describing all available permissions.
+ */
+ public function perms()
+ {
+ return array(
+ 'tree' => array(
+ 'imp' => array(
+ 'create_folders' => false,
+ 'max_folders' => false,
+ 'max_recipients' => false,
+ 'max_timelimit' => false,
+ ),
+ ),
+ 'title' => array(
+ 'imp:create_folders' => _("Allow Folder Creation?"),
+ 'imp:max_folders' => _("Maximum Number of Folders"),
+ 'imp:max_recipients' => _("Maximum Number of Recipients per Message"),
+ 'imp:max_timelimit' => _("Maximum Number of Recipients per Time Period"),
+ ),
+ 'type' => array(
+ 'imp:create_folders' => 'boolean',
+ 'imp:max_folders' => 'int',
+ 'imp:max_recipients' => 'int',
+ 'imp:max_timelimit' => 'int',
+ )
+ );
+ }
+
/* Horde_Auth_Application methods. */
/**
);
/**
- * Returns a list of available permissions.
- *
- * @return array An array describing all available permissions.
- */
- public function perms()
- {
- return array(
- 'title' => array(
- 'ingo:allow_rules' => _("Allow Rules"),
- 'ingo:max_rules' => _("Maximum Number of Rules")
- ),
- 'tree' => array(
- 'ingo' => array(
- 'allow_rules' => false,
- 'max_rules' => false
- )
- ),
- 'type' => array(
- 'ingo:allow_rules' => 'boolean',
- 'ingo:max_rules' => 'int'
- )
- );
- }
-
- /**
* Removes user data.
*
* @param string $user Name of user to remove data for.
public $version = 'H4 (2.0-git)';
/**
+ * Returns a list of available permissions.
+ *
+ * @return array An array describing all available permissions.
+ */
+ public function perms()
+ {
+ return array(
+ 'title' => array(
+ 'ingo:allow_rules' => _("Allow Rules"),
+ 'ingo:max_rules' => _("Maximum Number of Rules")
+ ),
+ 'tree' => array(
+ 'ingo' => array(
+ 'allow_rules' => false,
+ 'max_rules' => false
+ )
+ ),
+ 'type' => array(
+ 'ingo:allow_rules' => 'boolean',
+ 'ingo:max_rules' => 'int'
+ )
+ );
+ }
+
+ /**
* Generate the menu to use on the prefs page.
*
* @return Horde_Menu A Horde_Menu object.
);
/**
- * Returns a list of available permissions.
- *
- * @return array An array describing all available permissions.
- */
- public function perms()
- {
- $perms = array();
- $perms['tree']['kronolith']['max_events'] = false;
- $perms['title']['kronolith:max_events'] = _("Maximum Number of Events");
- $perms['type']['kronolith:max_events'] = 'int';
-
- return $perms;
- }
-
- /**
* Removes user data.
*
* @param string $user Name of user to remove data for.
public $version = 'H3 (3.0-git)';
/**
+ * Returns a list of available permissions.
+ *
+ * @return array An array describing all available permissions.
+ */
+ public function perms()
+ {
+ $perms = array();
+ $perms['tree']['kronolith']['max_events'] = false;
+ $perms['title']['kronolith:max_events'] = _("Maximum Number of Events");
+ $perms['type']['kronolith:max_events'] = 'int';
+
+ return $perms;
+ }
+
+ /**
* Code to run when viewing prefs for this application.
*
* @param string $group The prefGroup name.
);
/**
- * Returns a list of available permissions.
- *
- * @return array An array describing all available permissions.
- */
- public function perms()
- {
- $perms = array();
- $perms['tree']['nag']['max_tasks'] = false;
- $perms['title']['nag:max_tasks'] = _("Maximum Number of Tasks");
- $perms['type']['nag:max_tasks'] = 'int';
-
- return $perms;
- }
-
- /**
* Removes user data.
*
* @param string $user Name of user to remove data for.
public $version = 'H4 (3.0-git)';
/**
+ * Returns a list of available permissions.
+ *
+ * @return array An array describing all available permissions.
+ */
+ public function perms()
+ {
+ $perms = array();
+ $perms['tree']['nag']['max_tasks'] = false;
+ $perms['title']['nag:max_tasks'] = _("Maximum Number of Tasks");
+ $perms['type']['nag:max_tasks'] = 'int';
+
+ return $perms;
+ }
+
+ /**
* Special preferences handling on update.
*
* @param string $item The preference name.
class News_Api extends Horde_Registry_Api
{
/**
- * Categories/Permissions
- */
- public function perms()
- {
- static $perms = array();
- if (!empty($perms)) {
- return $perms;
- }
-
- $perms['tree']['news']['admin'] = true;
- $perms['title']['news:admin'] = _("Admin");
-
- $perms['tree']['news']['editors'] = true;
- $perms['title']['news:editors'] = _("Editors");
-
- require_once dirname(__FILE__) . '/base.php';
- $tree = $GLOBALS['news_cat']->getEnum();
-
- $perms['title']['news:categories'] = _("Categories");
- foreach ($tree as $cat_id => $cat_name) {
- $perms['tree']['news']['categories'][$cat_id] = false;
- $perms['title']['news:categories:' . $cat_id] = $cat_name;
- }
-
- return $perms;
- }
-
- /**
* Callback for comment API
*
* @param int $id Internal data identifier
public $version = 'H4 (0.1-git)';
/**
+ * Returns a list of available permissions.
+ *
+ * @return array An array describing all available permissions.
+ */
+ public function perms()
+ {
+ static $perms = array();
+ if (!empty($perms)) {
+ return $perms;
+ }
+
+ $perms['tree']['news']['admin'] = true;
+ $perms['title']['news:admin'] = _("Admin");
+
+ $perms['tree']['news']['editors'] = true;
+ $perms['title']['news:editors'] = _("Editors");
+
+ require_once dirname(__FILE__) . '/base.php';
+ $tree = $GLOBALS['news_cat']->getEnum();
+
+ $perms['title']['news:categories'] = _("Categories");
+ foreach ($tree as $cat_id => $cat_name) {
+ $perms['tree']['news']['categories'][$cat_id] = false;
+ $perms['title']['news:categories:' . $cat_id] = $cat_name;
+ }
+
+ return $perms;
+ }
+
+ /**
* Generate the menu to use on the prefs page.
*
* @return Horde_Menu A Horde_Menu object.
);
/**
- * Returns a list of available permissions.
- *
- * @return array An array describing all available permissions.
- */
- public function perms()
- {
- static $perms = array();
- if (!empty($perms)) {
- return $perms;
- }
-
- require_once dirname(__FILE__) . '/base.php';
- require TURBA_BASE . '/config/sources.php';
-
- $perms['tree']['turba']['sources'] = false;
- $perms['title']['turba:sources'] = _("Sources");
-
- // Run through every contact source.
- foreach ($cfgSources as $source => $curSource) {
- $perms['tree']['turba']['sources'][$source] = false;
- $perms['title']['turba:sources:' . $source] = $curSource['title'];
- $perms['tree']['turba']['sources'][$source]['max_contacts'] = false;
- $perms['title']['turba:sources:' . $source . ':max_contacts'] = _("Maximum Number of Contacts");
- $perms['type']['turba:sources:' . $source . ':max_contacts'] = 'int';
- }
-
- return $perms;
- }
-
- /**
* Removes user data.
*
* @param string $user Name of user to remove data for.
public $version = 'H3 (3.0-git)';
/**
+ * Returns a list of available permissions.
+ *
+ * @return array An array describing all available permissions.
+ */
+ public function perms()
+ {
+ static $perms = array();
+ if (!empty($perms)) {
+ return $perms;
+ }
+
+ require_once dirname(__FILE__) . '/base.php';
+ require TURBA_BASE . '/config/sources.php';
+
+ $perms['tree']['turba']['sources'] = false;
+ $perms['title']['turba:sources'] = _("Sources");
+
+ // Run through every contact source.
+ foreach ($cfgSources as $source => $curSource) {
+ $perms['tree']['turba']['sources'][$source] = false;
+ $perms['title']['turba:sources:' . $source] = $curSource['title'];
+ $perms['tree']['turba']['sources'][$source]['max_contacts'] = false;
+ $perms['title']['turba:sources:' . $source . ':max_contacts'] = _("Maximum Number of Contacts");
+ $perms['type']['turba:sources:' . $source . ':max_contacts'] = 'int';
+ }
+
+ return $perms;
+ }
+
+ /**
* Code to run when viewing prefs for this application.
*
* @param string $group The prefGroup name.