$id) { $id = (integer) $id; $pwt->delWidget($id); } dcPage::addSuccessNotice( __('Posts widgets successfully delete.') ); http::redirect( $p_url ); } catch (Exception $e) { $core->error->add($e->getMessage()); } } # Combos $sortby_combo = array( __('Post title') => 'post_title', __('Post date') => 'post_dt', __('Widget title') => 'option_title', __('Widget date') => 'option_upddt', ); $order_combo = array( __('Descending') => 'desc', __('Ascending') => 'asc' ); # Filters $show_filters = false; $nb_per_page = 1; $sortby = !empty($_GET['sortby']) ? $_GET['sortby'] : 'post_dt'; $order = !empty($_GET['order']) ? $_GET['order'] : 'desc'; $page = !empty($_GET['page']) ? (integer) $_GET['page'] : 1; if (!empty($_GET['nb']) && (integer) $_GET['nb'] > 0) { if ($nb_per_page != $_GET['nb']) { $show_filters = true; } $nb_per_page = (integer) $_GET['nb']; } $params['limit'] = array((($page-1)*$nb_per_page), $nb_per_page); if ($sortby !== '' && in_array($sortby,$sortby_combo)) { if ($order !== '' && in_array($order,$order_combo)) { $params['order'] = $sortby.' '.$order; } if ($sortby != 'post_dt' || $order != 'desc') { $show_filters = true; } } # 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 '
'.__('Configuration').' - postWidgetText - '.$core->plugins->moduleInfo('postWidgetText', 'version').'
';