*
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 *
 * @package    mahara
 * @subpackage admin
 * @author     Catalyst IT Ltd
 * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL
 * @copyright  (C) 2006-2009 Catalyst IT Ltd http://catalyst.net.nz
 *
 */
define('INTERNAL', 1);
define('ADMIN', 1);
define('JSON', 1);
require dirname(dirname(dirname(__FILE__))) . '/init.php';
$public = param_boolean('public');
safe_require('artefact', 'file');
$result = array();
$result['adminfiles'] = ArtefactTypeFile::get_admin_files($public);
if (empty($result['adminfiles'])) {
    $result['adminfiles'] = null;
}
$result['error'] = false;
$result['message'] = false;
json_headers();
echo json_encode($result);