/** * Delete a handler * * @return void */ public function removeTask() { // Check for request forgeries Request::checkToken(); // Incoming (expecting an array) $ids = Request::getVar('id', array()); if (!is_array($ids)) { $ids = array($ids); } // Make sure we have IDs to work with if (count($ids) > 0) { // Loop through the array of ID's and delete foreach ($ids as $id) { $handler = Handler::oneOrFail($id); // Delete the rules first, then the handler itself if (!$handler->rules->destroyAll() || !$handler->destroy()) { App::redirect(Route::url('index.php?option=' . $this->_option . '&controller=' . $this->_controller, false), Lang::txt('COM_TOOLS_HANDLERS_DELETE_FAILED')); return; } } } // Redirect App::redirect(Route::url('index.php?option=' . $this->_option . '&controller=' . $this->_controller, false), Lang::txt('COM_TOOLS_HANDLERS_SUCCESSFULLY_DELETED', count($ids))); }
</td> <?php } ?> <?php $subdirPath = $this->subdir ? '&subdir=' . urlencode($this->subdir) : ''; ?> <td class="middle_valign nobsp is-relative"> <?php echo \Components\Projects\Models\File::drawIcon($item->getExtension()); ?> <?php if ($item->isFile()) { ?> <div class="file-action-dropdown<?php echo ($handlers = Handler::getLaunchUrlsForFile($handlerBase . $this->model->get('alias') . DS . $item->getPath())) ? ' hasMultiple' : ''; ?> "> <a href="<?php echo Route::url($this->model->link('files') . '&action=download&connection=' . $this->connection->id . $subdirPath . '&asset=' . urlencode($item->getName())); ?> " class="preview file:<?php echo urlencode($item->getName()); ?> "> <?php echo \Components\Projects\Helpers\Html::shortenFileName($item->getFileName(), 60); ?> </a> <?php if ($handlers && count($handlers) > 0) {