當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Kronolith::deleteShare方法代碼示例

本文整理匯總了PHP中Kronolith::deleteShare方法的典型用法代碼示例。如果您正苦於以下問題:PHP Kronolith::deleteShare方法的具體用法?PHP Kronolith::deleteShare怎麽用?PHP Kronolith::deleteShare使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Kronolith的用法示例。


在下文中一共展示了Kronolith::deleteShare方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: execute

 /**
  * @throws Kronolith_Exception
  */
 public function execute()
 {
     if ($this->_vars->get('submitbutton') == _("Cancel")) {
         Horde::url($GLOBALS['prefs']->getValue('defaultview') . '.php', true)->redirect();
     }
     Kronolith::deleteShare($this->_calendar);
 }
開發者ID:DSNS-LAB,項目名稱:Dmail,代碼行數:10,代碼來源:DeleteCalendar.php

示例2: deleteCalendar

 /**
  * TODO
  */
 public function deleteCalendar()
 {
     $calendar_id = $this->vars->calendar;
     $result = new stdClass();
     switch ($this->vars->type) {
         case 'internal':
             try {
                 $calendar = $GLOBALS['injector']->getInstance('Kronolith_Shares')->getShare($calendar_id);
             } catch (Exception $e) {
                 $GLOBALS['notification']->push($e, 'horde.error');
                 return $result;
             }
             try {
                 Kronolith::deleteShare($calendar);
             } catch (Exception $e) {
                 $GLOBALS['notification']->push(sprintf(_("Unable to delete \"%s\": %s"), $calendar->get('name'), $e->getMessage()), 'horde.error');
                 return $result;
             }
             $GLOBALS['notification']->push(sprintf(_("The calendar \"%s\" has been deleted."), $calendar->get('name')), 'horde.success');
             break;
         case 'tasklists':
             $calendar_id = substr($calendar_id, 6);
             $tasklists = $GLOBALS['registry']->tasks->listTasklists(true);
             if (!isset($tasklists[$calendar_id])) {
                 $GLOBALS['notification']->push(_("You are not allowed to delete this task list."), 'horde.error');
                 return $result;
             }
             try {
                 $GLOBALS['registry']->tasks->deleteTasklist($calendar_id);
             } catch (Exception $e) {
                 $GLOBALS['notification']->push(sprintf(_("Unable to delete \"%s\": %s"), $tasklists[$calendar_id]->get('name'), $e->getMessage()), 'horde.error');
                 return $result;
             }
             $GLOBALS['notification']->push(sprintf(_("The task list \"%s\" has been deleted."), $tasklists[$calendar_id]->get('name')), 'horde.success');
             break;
         case 'remote':
             try {
                 $deleted = Kronolith::unsubscribeRemoteCalendar($calendar_id);
             } catch (Exception $e) {
                 $GLOBALS['notification']->push($e, 'horde.error');
                 return $result;
             }
             $GLOBALS['notification']->push(sprintf(_("You have been unsubscribed from \"%s\" (%s)."), $deleted['name'], $deleted['url']), 'horde.success');
             break;
         case 'resource':
             try {
                 $rdriver = Kronolith::getDriver('Resource');
                 $resource = $rdriver->getResource($rdriver->getResourceIdByCalendar($calendar_id));
                 if (!$resource->hasPermission($GLOBALS['registry']->getAuth(), Horde_Perms::DELETE)) {
                     $GLOBALS['notification']->push(_("You are not allowed to delete this resource."), 'horde.error');
                     return $result;
                 }
                 $name = $resource->get('name');
                 $rdriver->delete($resource);
             } catch (Kronolith_Exception $e) {
                 $GLOBALS['notification']->push($e->getMessage(), 'horde.error');
                 return $result;
             }
             $GLOBALS['notification']->push(sprintf(_("The resource \"%s\" has been deleted."), $name), 'horde.success');
             break;
         case 'resourcegroup':
             try {
                 $rdriver = Kronolith::getDriver('Resource');
                 $resource = $rdriver->getResource($calendar_id);
                 if (!$resource->hasPermission($GLOBALS['registry']->getAuth(), Horde_Perms::DELETE)) {
                     $GLOBALS['notification']->push(_("You are not allowed to delete this resource."), 'horde.error');
                     return $result;
                 }
                 $name = $resource->get('name');
                 $rdriver->delete($resource);
             } catch (Kronolith_Exception $e) {
                 $GLOBALS['notification']->push($e->getMessage(), 'horde.error');
                 return $result;
             }
             $GLOBALS['notification']->push(sprintf(_("The resource \"%s\" has been deleted."), $name), 'horde.success');
     }
     $result->deleted = true;
     return $result;
 }
開發者ID:kossamums,項目名稱:horde,代碼行數:82,代碼來源:Handler.php

示例3: deleteCalendar

 /**
  * Delete the specified calendar.
  *
  * @param string $id  The calendar id.
  */
 public function deleteCalendar($id)
 {
     $calendar = $GLOBALS['injector']->getInstance('Kronolith_Shares')->getShare($calendar);
     Kronolith::deleteShare($calendar);
 }
開發者ID:horde,項目名稱:horde,代碼行數:10,代碼來源:Api.php


注:本文中的Kronolith::deleteShare方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。