Renders to the Delete button inside the table content (Action column)
@return \Zend\View\Model\ViewModel
558488
public function renderToolUserContentActionDeleteAction()
    {
        $melisKey = $this->params()->fromRoute('melisKey', '');

        $view = new ViewModel();
        $view->melisKey = $melisKey;

        return $view;
    }
739941
public function run()
    {
        if ($this->hasModel()) {
            $replace['{input}'] = Html::activeTextInput($this->model, $this->attribute, $this->options);
        } else {
            $replace['{input}'] = Html::textInput($this->name, $this->value, $this->options);
        }

        $replace['{button}'] = Html::tag($this->buttonTag, $this->buttonName, $this->buttonOptions);
        $replace['{reset-button}'] = Html::tag($this->resetButtonTag, $this->resetButtonName, $this->resetButtonOptions);

        FileInputAsset::register($this->view);

        if (!empty($this->callbackBeforeInsert)) {
            $this->view->registerJs('
                $("#' . $this->options['id'] . '").on("fileInsert", ' . $this->callbackBeforeInsert . ');'
            );
        }

        $modal = $this->renderFile('@vendor/ut8ia/yii2-filemanager/views/file/modal.php', [
            'inputId' => $this->options['id'],
            'btnId' => $this->buttonOptions['id'],
            'frameId' => $this->options['id'] . '-frame',
            'frameSrc' => Url::to($this->frameSrc), 
            'thumb' => $this->thumb,
            'imageContainer' => $this->imageContainer,
            'pasteData' => $this->pasteData,
        ]);

        return strtr($this->template, $replace) . $modal;
    }
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;
    }
467153
public function renderButton()
    {
        if (($button = $this->button) !== false) {
            $tag = ArrayHelper::remove($button, 'tag', 'a');
            $label = ArrayHelper::remove($button, 'label',
                Inflector::camel2words(Inflector::id2camel($this->scenario)));
            if ($tag === 'button' && !isset($button['type'])) {
                $toggleButton['type'] = 'button';
            }

            if ($button['disabled']) {
                $button = ArrayHelper::merge([
                    'onClick' => new JsExpression('return false'),
                ], $button);
            } else {
                $button = ArrayHelper::merge([
                    'data-toggle' => 'modal',
                    'data-target' => "#{$this->getModalId()}",
                ], $button);
            }

            if ($tag === 'a' && empty($button['href'])) {
                $button['href'] = '#';
            }

            echo Html::tag($tag, $label, $button);
        }
    }
1306591
public function renderToolUserModalEmptyAction()
    {
        $melisKey = $this->params()->fromRoute('melisKey', '');

        $view = new ViewModel();
        $view->melisKey = $melisKey;

        return $view;
    }
192253
public function deleteAction()
    {
        $id = (int) $this->params()->fromRoute('id', null);

        $request = $this->getRequest();

        if ($request->isPost()) {
            $confirmed = $request->getPost('confirmed', false);
            if ($confirmed) {
                $id = (int) $request->getPost('id');

                $this->getService()->delete($id);

                return $this->redirect()->toRoute($this->getRouteIdentifierPrefix());
            }
        }

        return new ViewModel(array(
            'options'  => $this->getOptions(),
        ));
    }
1150148
public function removeAction()
    {
        $success = 0;
        $message = 'tr_melis_cms_prospects_theme_delete_failed';
        $errors  = [];
        $title   = 'tr_melis_cms_prospects_theme';
        $request = $this->getRequest();
        $id      = null;

        if($request->isPost()) {
            $id        = (int) $request->getPost('id');
            $checkData = $this->themeTable()->getEntryById($id)->current();

            if($checkData) {
                $this->themeTable()->deleteById($id);
                $this->themeItemTable()->deleteByField('pros_theme_id', $id);
                $success = 1;
                $message = 'tr_melis_cms_prospects_theme_delete_success';
            }

        }

        $response = [
            'success'     => $success,
            'errors'      => $errors,
            'textMessage' => $this->tool()->getTranslation($message),
            'textTitle'   => $this->tool()->getTranslation($title)
        ];

        $this->getEventManager()->trigger('meliscmsprospects_theme_delete_end', $this, array_merge($response, array('typeCode' => 'CMS_PROSPECTS_THEME_DELETE', 'itemId' => $id)));

        return new JsonModel($response);
    }
17449
public function render()
    {
        $this->removeReservedFields();

        $tabObj = $this->form->getTab();

        if (!$tabObj->isEmpty()) {
            $script = <<<'SCRIPT'

var hash = document.location.hash;
if (hash) {
    $('.nav-tabs a[href="' + hash + '"]').tab('show');
}

// Change hash for page-reload
$('.nav-tabs a').on('shown.bs.tab', function (e) {
    history.pushState(null,null, e.target.hash);
});

if ($('.has-error').length) {
    $('.has-error').each(function () {
        var tabId = '#'+$(this).closest('.tab-pane').attr('id');
        $('li a[href="'+tabId+'"] i').removeClass('hide');
    });

    var first = $('.has-error:first').closest('.tab-pane').attr('id');
    $('li a[href="#'+first+'"]').tab('show');
}

SCRIPT;
            Admin::script($script);
        }

        $data = [
            'form'   => $this,
            'tabObj' => $tabObj,
            'width'  => $this->width,
        ];

        return view($this->view, $data)->render();
    }
587462
public function onRelationManageDelete()
    {
        $this->beforeAjax();

        /*
         * Multiple (has many, belongs to many)
         */
        if ($this->viewMode == 'multi') {
            if (($checkedIds = post('checked')) && is_array($checkedIds)) {
                 foreach ($checkedIds as $relationId) {
                    if (!$obj = $this->relationModel->find($relationId)) {
                        continue;
                    }

                    $obj->delete();
                }
            }
        }
        /*
         * Single (belongs to, has one)
         */
        elseif ($this->viewMode == 'single') {
            $relatedModel = $this->viewModel;
            if ($relatedModel->exists) {
                $relatedModel->delete();
            }

            $this->viewWidget->setFormValues([]);
            $this->viewModel = $this->relationModel;
        }

        return $this->relationRefresh();
    }
848155
public function render()
    {
        foreach ($this->buttons as $button) {
            $this->getElement()->appendContent($this->renderButton($button));
        }

        return $this->getElement()->render();
    }
1334345
public function render()
    {
        if ($this->hasChildNodes()) {
            if ($this->childNodes->first() instanceof Button) {
                $this->attributes->removeAttributeClass('input-group-text');
            }
        }

        return parent::render();
    }
502970
public function clearsessionAction()
    {
        $request = $this->getEvent()->getRequest();
        if ($request instanceof Request && $request->isPost()) {
            $this->sessionManager->clearSession($request->getPost('byContainer'));
        }

        $sessionData = $this->sessionManager->getSessionData();
        $renderedContent = $this->viewRenderer
                                ->render('zend-developer-tools/toolbar/session-data-list', ['sessionData' => $sessionData]);

        return new JsonModel([
            'san_sessiontoolbar_data_renderedContent' => $renderedContent,
        ]);
    }
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 );
	}
413858
public function render()
    {
        $this->removeIDFilterIfNeeded();

        if (empty($this->filters)) {
            return '';
        }

        return view($this->view)->with([
            'action'   => $this->action ?: $this->urlWithoutFilters(),
            'layout'   => $this->layout,
            'filterID' => $this->filterID,
            'expand'   => $this->expand,
        ])->render();
    }
893845
public function deleteTemplateDataAction()
    {
        $translator = $this->getServiceLocator()->get('translator');

    	$eventDatas = array();
    	$this->getEventManager()->trigger('meliscms_template_delete_start', $this, $eventDatas);

        $request = $this->getRequest();
        $templateId = null;
        $status  = false;
        $message = 'no data';
        $textMessage = '';
        $textTitle = 'tr_tool_template_fm_update_title';
        // make sure it's a POST call
        if($request->isPost()) {

            // get the service for Templates Model & Table
            $templatesModel = $this->getServiceLocator()->get('MelisEngineTableTemplate');
            $templateId = (int) $request->getPost('templateId');

            // make sure our ID is not empty
            if(!empty($templateId))
            {
                $templatesModel->deleteById($templateId);
                $status = true;
                $message = $templateId . ' successfully deleted';
                $textMessage = 'tr_tool_template_fm_delete_content';
            }
        }

        $response = array(
           'success' => $status ,
            'textTitle' => $textTitle,
            'textMessage' => $textMessage
        );

        $this->getEventManager()->trigger('meliscms_template_delete_end', $this, array_merge($response, array('typeCode' => 'CMS_TEMPLATE_DELETE', 'itemId' => $templateId)));

        return new JsonModel($response);
    }
439664
private function renderCloneColumn()
    {

        $options = ['class' => 'list-cell__button'];
        $layoutConfig = array_merge([
            'buttonCloneClass' => $this->isBootstrapTheme() ? 'col-sm-offset-0 col-sm-1' : '',
        ], $this->layoutConfig);
        Html::addCssClass($options, $layoutConfig['buttonCloneClass']);

        return Html::tag('div', $this->renderCloneButton(), $options);
    }
1202858
protected function delete()
    {
        $nodeRef = $this->buildCmsNodeRef('Slug');

        $node = $nodeRef->generateNode();

        $location = 'load';
        $this->Events->trigger('NodeCmsController.delete'.'.'.$location,
                                    $this->errors, $this->templateVars, $node);
        foreach((array)$nodeRef->getElement()->getAspects() as $aspect)
            $this->Events->trigger('NodeCmsController.@'.$aspect->Slug.'.'.'delete'.'.'.$location,
                                    $this->errors, $this->templateVars, $node);

        if (!$node->hasTitle())
            //get default form backing object
            $node = $this->RegulatedNodeService->getByNodeRef($node->getNodeRef());

        if (empty($node))
            throw new NotFoundException('Record not found for NodeRef: '.$nodeRef);

        // check permissions
        // $this->checkDeletePermission($node);

        if (!$this->buttonPushed()) {
            $this->Session->setFlashAttribute('delete_referer', $this->Request->getReferrer());
            //show delete confirmation view (action_form_view)
            return new View($this->formView());
        }

        if ($this->saveButtonPushed()) {
            $this->checkNonce();
            $mergeSlug = null;
            $tags      = isset($this->params['OutTags']['#merge'])  ?
                           $this->params['OutTags']['#merge']
                         : array();

            if (!empty($tags)) {
                $newtag = new Tag(current($tags));

                if ($newtag->TagElement != $nodeRef->getElement()->getSlug())
                    throw new Exception('Unable to merge with different element ['.$newtag->TagElement.']');

                $mergeSlug = $newtag->TagSlug;
            }

            $location = 'pre';
            $this->Events->trigger('NodeCmsController.delete'.'.'.$location,
                                    $this->errors, $this->templateVars, $node, $mergeSlug);
            foreach ((array)$nodeRef->getElement()->getAspects() as $aspect)
                $this->Events->trigger('NodeCmsController.@'.$aspect->Slug.'.'.'delete'.'.'.$location,
                                        $this->errors, $this->templateVars, $node, $mergeSlug);

            $this->getErrors()->throwOnError();


            $this->RegulatedNodeService->delete($nodeRef, $mergeSlug);

            $location = 'post';
            $this->Events->trigger('NodeCmsController.delete'.'.'.$location, $this->errors, $this->templateVars, $node);
            foreach ((array)$nodeRef->getElement()->getAspects() as $aspect)
                $this->Events->trigger('NodeCmsController.@'.$aspect->Slug.'.'.'delete'.'.'.$location, $this->errors, $this->templateVars, $node);

            //redirect to news list (action_success_view)
            return new View($this->successView());
        }

        if ($this->cancelButtonPushed())
            //redirect to referer
            return new View('redirect:'.$this->Session->getFlashAttribute('delete_referer'));  //$this->cancelView());

        throw new Exception("unsupported button for this action");
    }