File: api.php

package info (click to toggle)
chora2 2.1.1%2Bdebian0-1
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 2,928 kB
  • ctags: 351
  • sloc: php: 1,479; xml: 384; makefile: 66
file content (40 lines) | stat: -rw-r--r-- 1,023 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
<?php
/**
 * Chora external API interface.
 *
 * $Horde: chora/lib/api.php,v 1.1.2.1 2008/10/09 17:40:05 jan Exp $
 *
 * This file defines Chora's external API interface. Other applications can
 * interact with Chora through this API.
 *
 * @package Chora
 */
@define('CHORA_BASE', dirname(__FILE__) . "/..");

$_services['perms'] = array(
    'args' => array(),
    'type' => '{urn:horde}stringArray'
);

function _chora_perms()
{
    static $perms = array();
    if (!empty($perms)) {
        return $perms;
    }

    @define('CHORA_BASE', dirname(__FILE__) . '/..');
    require_once CHORA_BASE . '/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;
}