Render `delete` tool.

@return string
355599
protected function renderDelete()
    {
        $trans = [
            'delete_confirm' => trans('admin.delete_confirm'),
            'confirm'        => trans('admin.confirm'),
            'cancel'         => trans('admin.cancel'),
            'delete'         => trans('admin.delete'),
        ];

        $class = uniqid();

        $script = <<<SCRIPT

$('.{$class}-delete').unbind('click').click(function() {

    swal({
        title: "{$trans['delete_confirm']}",
        type: "warning",
        showCancelButton: true,
        confirmButtonColor: "#DD6B55",
        confirmButtonText: "{$trans['confirm']}",
        showLoaderOnConfirm: true,
        cancelButtonText: "{$trans['cancel']}",
        preConfirm: function() {
            return new Promise(function(resolve) {
                $.ajax({
                    method: 'post',
                    url: '{$this->getDeletePath()}',
                    data: {
                        _method:'delete',
                        _token:LA.token,
                    },
                    success: function (data) {
                        $.pjax({container:'#pjax-container', url: '{$this->getListPath()}' });

                        resolve(data);
                    }
                });
            });
        }
    }).then(function(result) {
        var data = result.value;
        if (typeof data === 'object') {
            if (data.status) {
                swal(data.message, '', 'success');
            } else {
                swal(data.message, '', 'error');
            }
        }
    });
});

SCRIPT;
        Admin::script($script);

        return <<<HTML
<div class="btn-group pull-right" style="margin-right: 5px">
    <a href="javascript:void(0);" class="btn btn-sm btn-danger {$class}-delete" title="{$trans['delete']}">
        <i class="fa fa-trash"></i><span class="hidden-xs">  {$trans['delete']}</span>
    </a>
</div>
HTML;
    }
239904
public function delete()
    {
        $query = $this->getDeleteQuery();

        $query->where($this->morphType, $this->morphClass);

        return $query->delete();
    }
70749
public function renderPlatformContentActionDeleteAction()
    {
        $melisKey = $this->params()->fromRoute('melisKey', '');
    
        $view = new ViewModel();
        $view->melisKey = $melisKey;
    
        return $view;
    }
1346584
public function delete() 
	{
		$settings = static::_model();

		$result = DB::delete( $settings['table'] )
			->where( $settings['primary_key'], $this->_data_store[$settings['primary_key']] )
			->limit(1)
			->run( $settings['handler'] );

		$this->_data_store[$cache['primary_key']] = null;

		return $result;
	}
626273
public function delete()
    {
        $path = $this->model->getPath('destroy');

        return $this->query->from($path)
                ->delete();
    }
402353
protected function performDeleteOnModel()
    {
        if ($this->forceDeleting) {
            return $this->newQueryWithoutScopes()->where($this->getKeyName(), $this->getKey())->forceDelete();
        }

        return $this->runSoftDelete();
    }
1240067
public function delete()
    {
        return $this->forge->deleteWorker($this->serverId, $this->siteId, $this->id);
    }
391533
function renderDelete() {
        return $("<div id='recent-folder-delete' class='trash-icon'>&times;</div>")
            .mouseup(function (e) {
                // Don't let the click bubble upward.
                e.stopPropagation();

                // Remove the project from the preferences.
                var recentProjects = getRecentProjects(),
                    index = recentProjects.indexOf($(this).parent().data("path")),
                    newProjects = [],
                    i;
                for (i = 0; i < recentProjects.length; i++) {
                    if (i !== index) {
                        newProjects.push(recentProjects[i]);
                    }
                }
                PreferencesManager.setViewState("recentProjects", newProjects);
                $(this).closest("li").remove();
                checkHovers(e.pageX, e.pageY);

                if (newProjects.length === 1) {
                    $dropdown.find(".divider").remove();
                }
            });
    }
613165
public function render()
    {
        $toolbarClass = Str::contains($this->controlClass, 'hero') ? 'separator' : null;

        $this->vars['toolbarClass'] = $toolbarClass;

        return $this->makePartial('body', [
            'data' => $this->getData()
        ]);
    }
1160622
public function deleteAction()
	{
		if( config( 'shop.authorize', true ) ) {
			$this->authorize( 'admin', [JqadmController::class, ['admin', 'editor']] );
		}

		$cntl = $this->createAdmin();

		if( ( $html = $cntl->delete() ) == '' ) {
			return $cntl->getView()->response();
		}

		return $this->getHtml( $html );
	}
502814
public function actionDeleteIn()
    {
        $selected = Yii::$app->request->post('selected' , []);

        $ret = \yongtiger\admin\models\Log::deleteAll(['id' => explode(',', $selected)]);
        $str = $ret > 0 ? ' (IDs [' . $selected . '])' : '';
        Yii::$app->session->setFlash('info', Module::t('message', 'Deleted {0} logs.', $ret) . $str);

        return $this->redirect(['index']);
    }
943255
public static function render(Query\Delete $query)
    {
        return Compiler::withDb($query->getDb(), function () use ($query) {
            return Compiler::expression(array(
                'DELETE',
                $query->getType(),
                Aliased::combine($query->getTable()),
                Compiler::word('FROM', Aliased::combine($query->getFrom())),
                Join::combine($query->getJoin()),
                Compiler::word('WHERE', Condition::combine($query->getWhere())),
                Compiler::word('ORDER BY', Direction::combine($query->getOrder())),
                Compiler::word('LIMIT', $query->getLimit()),
            ));
        });
    }
267877
public function generate()
    {
        $result = '';

        $table = $this->buildTable();
        $where = $this->buildWhere();

        $result .= 'DELETE FROM '.$table;

        if ($where != '') {
            $result .= ' '.$where;
        }

        return $result;
    }
74560
public function getDeletedAt() : ?string 
    {
        if ( ! $this->hasDeletedAt()) {
            $this->setDeletedAt($this->getDefaultDeletedAt());
        }
        return $this->deletedAt;
    }
302640
public function render() {
        $args = func_get_args();
        if (isset($args[0]) && is_string($args[0])) {
            $tpl = array_shift($args);
        } else {
            $tpl = get_class($this);
            $paths = explode('\\', $tpl);
            array_shift($paths);
            $className = array_pop($paths);
            $actionSuffix = 'Action';
            if (substr($className, strrpos($className, $actionSuffix)) === $actionSuffix) {
                $basename = substr($className, 0, -strlen($actionSuffix));
            } else {
                $basename = $className;
            }
            array_push($paths, $basename);
            foreach ($paths as &$path) {
                $path = Toolkit::to_snake_case($path);
            }
            unset($path);
            $tpl = implode(DIRECTORY_SEPARATOR, $paths);
        }
        if (isset($args[0]) && is_array($args[0])) {
            $params = array_shift($args);
        } else {
            $params = [];
        }
        if (isset($args[0]) && is_string($args[0])) {
            $cacheId = array_shift($args);
        } else {
            $cacheId = '';
        }

        return $this->view->render($tpl, $params, $cacheId);
    }
414463
public function delete()
    {
        $app = Facade::getFacadeApplication();
        $db = $app->make('database')->connection();

        $cvID = $this->cvID;
        $c = Page::getByID($this->cID, $cvID);
        $cID = $c->getCollectionID();

        $q = "select bID, arHandle from CollectionVersionBlocks where cID = ? and cvID = ?";
        $r = $db->executeQuery($q, array(
            $cID,
            $cvID,
        ));
        while ($row = $r->fetch()) {
            if ($row['bID']) {
                $b = Block::getByID($row['bID'], $c, $row['arHandle']);
                if (is_object($b)) {
                    $b->deleteBlock();
                }
                unset($b);
            }
        }

        $features = CollectionVersionFeatureAssignment::getList($this);
        foreach ($features as $fa) {
            $fa->delete();
        }

        $category = $app->make('Concrete\Core\Attribute\Category\PageCategory');
        $attributes = $category->getAttributeValues($this);
        foreach ($attributes as $attribute) {
            $category->deleteValue($attribute);
        }

        $db->executeQuery('delete from CollectionVersionBlockStyles where cID = ? and cvID = ?', array(
            $cID,
            $cvID,
        ));
        $db->executeQuery('delete from CollectionVersionThemeCustomStyles where cID = ? and cvID = ?', array(
            $cID,
            $cvID,
        ));
        $db->executeQuery('delete from CollectionVersionRelatedEdits where cID = ? and cvID = ?', array(
            $cID,
            $cvID,
        ));
        $db->executeQuery('delete from CollectionVersionAreaStyles where cID = ? and cvID = ?', array(
            $cID,
            $cvID,
        ));

        $db->executeQuery('delete from PageTypeComposerOutputBlocks where cID = ? and cvID = ?', array(
            $cID,
            $cvID,
        ));

        $q = "delete from CollectionVersions where cID = '{$cID}' and cvID='{$cvID}'";
        $db->executeQuery($q);
        $this->refreshCache();
    }
965282
public function delete()
    {
        $query = "DELETE FROM `{$this->table}` {$this->join}";
        if ($this->condition) {
            $query .= " WHERE {$this->condition}";
        }
        if ($this->limit) {
            $query .= " LIMIT {$this->limit}";
        }

        return $this->connection->execQuery($query, $this->params);
    }