本文整理汇总了PHP中OC_Calendar_Object::delete方法的典型用法代码示例。如果您正苦于以下问题:PHP OC_Calendar_Object::delete方法的具体用法?PHP OC_Calendar_Object::delete怎么用?PHP OC_Calendar_Object::delete使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OC_Calendar_Object
的用法示例。
在下文中一共展示了OC_Calendar_Object::delete方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1:
<?php
/**
* Copyright (c) 2011 Bart Visscher <bartv@thisnet.nl>
* This file is licensed under the Affero General Public License version 3 or
* later.
* See the COPYING-README file.
*/
OCP\JSON::checkLoggedIn();
OCP\JSON::checkAppEnabled('calendar');
$id = $_POST['id'];
$access = OC_Calendar_App::getaccess($id, OC_Calendar_App::EVENT);
if ($access != 'owner' && $access != 'rw') {
OCP\JSON::error(array('message' => 'permission denied'));
exit;
}
$result = OC_Calendar_Object::delete($id);
OCP\JSON::success();
示例2: array
<?php
/**
* ownCloud - Addressbook
*
* @author Jakob Sack
* @copyright 2011 Jakob Sack mail@jakobsack.de
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
* License as published by the Free Software Foundation; either
* version 3 of the License, or any later version.
*
* This library 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 AFFERO GENERAL PUBLIC LICENSE for more details.
*
* You should have received a copy of the GNU Affero General Public
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
*
*/
// Init owncloud
OCP\JSON::checkLoggedIn();
OCP\JSON::checkAppEnabled('tasks');
OCP\JSON::callCheck();
$id = $_POST['id'];
$task = OC_Calendar_App::getEventObject($id);
OC_Calendar_Object::delete($id);
OCP\JSON::success(array('data' => array('id' => $id)));
示例3: import
public function import()
{
if (!$this->isValid()) {
return false;
}
$numofcomponents = count($this->calobject->getComponents());
if ($this->overwrite) {
foreach (OC_Calendar_Object::all($this->id) as $obj) {
OC_Calendar_Object::delete($obj['id']);
}
}
foreach ($this->calobject->getComponents() as $object) {
if (!$object instanceof Sabre\VObject\Component\VEvent && !$object instanceof Sabre\VObject\Component\VJournal && !$object instanceof Sabre\VObject\Component\VTodo) {
continue;
}
if (!is_null($object->DTSTART)) {
$dtend = OC_Calendar_Object::getDTEndFromVEvent($object);
if ($object->DTEND) {
$object->DTEND->setDateTime($dtend->getDateTime(), $object->DTSTART->getDateType());
}
}
$vcalendar = $this->createVCalendar($object->serialize());
$insertid = OC_Calendar_Object::add($this->id, $vcalendar);
$this->abscount++;
if ($this->isDuplicate($insertid)) {
OC_Calendar_Object::delete($insertid);
} else {
$this->count++;
}
$this->updateProgress(intval($this->abscount / $numofcomponents * 100));
}
OC_Cache::remove($this->progresskey);
return true;
}
示例4: p
p($_['task']);
?>
" />
<input type="hidden" name="title" value="<?php
p($_POST['title']);
?>
" />
</form>
<?php
if (strcmp($_['permission_granted'], 'true') == 0) {
$event_id = OC_Collaboration_Calendar::getEventId($_POST['tid']);
if (!isset($_POST['status'])) {
$_POST['member'] = "";
}
if (isset($_POST['status']) && strcasecmp($_POST['status'], 'Cancelled') == 0) {
OC_Calendar_Object::delete($event_id);
} else {
$start = new DateTime(OC_Collaboration_Calendar::getEventStartTime($event_id));
$start->setTimezone(new DateTimeZone('Asia/Kolkata'));
$start_date = $start->format('d-m-Y');
$start_time = $start->format('H:i:s');
$deadline = new DateTime(OC_Collaboration_Time::convertUITimeShortToDBTimeShort($_POST['deadline_time']));
$deadline_date = $deadline->format('d-m-Y');
$deadline_time = $deadline->format('H:i:s');
$last_modified = new DateTime();
?>
<form id="ev_form" action="" method="post" >
<input type="hidden" name="create_new" value="false" id="create_new" />
<input type="hidden" name="id" value="<?php
p($event_id);
?>
示例5: deleteTask
/**
* @NoAdminRequired
*/
public function deleteTask()
{
$response = new JSONResponse();
$taskId = $this->params('taskID');
\OC_Calendar_Object::delete($taskId);
return $response;
}
示例6: delete
/**
* delete task by id
*
* @param int $taskID
* @return bool
*/
public function delete($taskID)
{
return \OC_Calendar_Object::delete($taskID);
}