Nooku Components is an open source project powered by Assembla

Assembla offers free public and private SVN/Git repositories and project hosting with bug/issue tracking and collaboration tools.

nooku-components

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
/**
 * @version     $Id$
 * @category    Nooku
 * @package     Nooku_Server
 * @subpackage  Files
 * @copyright   Copyright (C) 2011 Timble CVBA and Contributors. (http://www.timble.net).
 * @license     GNU GPLv3 <http://www.gnu.org/licenses/gpl.html>
 * @link        http://www.nooku.org
 */

/**
 * Component Loader
 *
 * @author      Ercan Ozkaya <http://nooku.assembla.com/profile/ercanozkaya>
 * @category    Nooku
 * @package     Nooku_Server
 * @subpackage  Files
 */

try {
    echo KService::get('com://admin/files.dispatcher')->dispatch();
}
catch (KControllerException $e){
    if (KRequest::get('get.format', 'cmd') == 'json') {
        $obj = new stdClass;
        $obj->status = false;
        $obj->error = $e->getMessage();
        $obj->code = $e->getCode();

        $code = KRequest::get('get.plupload', 'int') ? 200 : $e->getCode();

        JResponse::setHeader('status', $code.' '.str_replace("\n", ' ', $e->getMessage()));

        echo json_encode($obj);
    }
    else {
        throw $e;
    }
}
Ajax-loader Loading, please wait...