aboutsummaryrefslogtreecommitdiffstats
path: root/apps/tasks/ajax/addtaskform.php
blob: 297c590060d4dc4c4a093ae607328015231a2df5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
<?php

// Init owncloud
require_once('../../../lib/base.php');

$l10n = new OC_L10N('tasks');

// Check if we are a user
if( !OC_User::isLoggedIn()){
        echo json_encode( array( 'status' => 'error', 'data' => array( 'message' => $l10n->t('You need to log in!'))));
        exit();
}

$calendars = OC_Calendar_Calendar::allCalendars(OC_User::getUser(), true);
$tmpl = new OC_Template('tasks','part.addtaskform');
$tmpl->assign('calendars',$calendars);
$page = $tmpl->fetchPage();

echo json_encode( array( 'status' => 'success', 'data' => array( 'page' => $page )));