nextcloud/apps/tasks/ajax/addtaskform.php

20 lines
571 B
PHP
Raw Normal View History

2011-09-12 23:28:28 +04:00
<?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 )));