$id) { $id = (integer) $id; $pwt->delWidget($id); } dcPage::addSuccessNotice( __('Posts widgets successfully delete.') ); if (!empty($_POST['redir'])) { http::redirect($_POST['redir']); } else { $core->adminurl->redirect('admin.plugin.postWidgetText'); } } catch (Exception $e) { $core->error->add($e->getMessage()); } } # filters $filter = new adminGenericFilter($core, 'pwt'); $filter->add(dcAdminFilters::getPageFilter()); $params = $filter->params(); # Get posts with text widget try { $posts = $pwt->getWidgets($params); $counter = $pwt->getWidgets($params, true); $posts_list = new postWidgetTextList($core, $posts, $counter->f(0)); } catch (Exception $e) { $core->error->add($e->getMessage()); } # Display echo ' ' . __('Post widget text') . '' . dcPage::jsLoad(dcPage::getPF('postWidgetText/js/index.js')) . $filter->js($core->adminurl->get('admin.plugin.postWidgetText')) . ' ' . dcPage::breadcrumb([ __('Plugins') => '', __('Posts widgets') => '' ]). dcPage::notices(); $filter->display('admin.plugin.postWidgetText', form::hidden('p', 'postWidgetText')); $posts_list->display($filter->page, $filter->nb, '
' . '%s' . '
' . '

' . '

' . '

' . $core->adminurl->getHiddenFormFields('admin.plugin.postWidgetText', array_merge(['p' => 'postWidgetText'], $filter->values(true))) . $core->formNonce() . '
' . '
' ); # Footer dcPage::helpBlock('postWidgetText'); echo '';