/**
  * Deletes ical properties and the appropriate calendar.
  *
  * @see database_driver::remove_calendar()
  */
 public function remove_calendar($prop)
 {
     $removed = $this->_get_ical_props($prop['id'], self::OBJ_TYPE_ICAL);
     $protected = array();
     $preinstalled_calendars = $this->rc->config->get('calendar_preinstalled_calendars', array());
     foreach ($preinstalled_calendars as $idx => $properties) {
         if ($properties['driver'] == 'ical') {
             $url = str_replace('@', urlencode('@'), str_replace('%u', $this->rc->get_user_name(), $properties['ical_url']));
             if (stripos($removed['url'], $url) === 0) {
                 if (isset($properties['deleteable']) && !$properties['deleteable']) {
                     $this->last_error = $this->rc->gettext('calendar.protected');
                     return false;
                 }
             }
         }
     }
     if (is_array($removed)) {
         $removed = slashify($removed['url']);
         $removed = array_merge($this->rc->config->get('calendar_icals_removed', array()), array($removed => time()));
         $this->rc->user->save_prefs(array('calendar_icals_removed' => $removed));
     }
     if (parent::remove_calendar($prop, $ical)) {
         $this->_remove_ical_props($prop['id'], self::OBJ_TYPE_ICAL);
         return true;
     }
     return false;
 }