service = new UniteCreatorAddonChangelog();
parent::__construct($args);
}
/**
* Process the action.
*
* @return void
*/
public function processAction(){
$generalQueryArgs = array("_wp_http_referer", "_wpnonce", "ucwindow");
$actionQueryArgs = array("action", "action2", self::FILTER_ID, self::EDIT_FIELD_TYPE, self::EDIT_FIELD_TEXT);
$action = $this->current_action();
if($action === self::ACTION_EXPORT){
$this->processExportAction();
exit;
}
$ids = $this->getFilter(self::FILTER_ID);
if(empty($ids) === false){
$ids = is_array($ids) ? $ids : array($ids);
$result = false;
switch($action){
case self::ACTION_EDIT:
$result = $this->processEditAction($ids);
break;
case self::ACTION_DELETE:
$result = $this->processDeleteAction($ids);
break;
}
if(empty($result) === false){
$url = wp_get_referer();
$url = remove_query_arg($actionQueryArgs, $url);
wp_redirect($url);
exit;
}
}
$containedQueryArgs = array_intersect($generalQueryArgs, array_keys($_REQUEST));
if(empty($containedQueryArgs) === false){
$url = wp_unslash($_SERVER["REQUEST_URI"]);
$url = remove_query_arg(array_merge($generalQueryArgs, $actionQueryArgs), $url);
wp_redirect($url);
exit;
}
}
/**
* Gets the current action.
*
* @return string|false
*/
public function current_action(){
if(isset($_REQUEST[self::ACTION_EXPORT]))
return self::ACTION_EXPORT;
return parent::current_action();
}
/**
* Gets a list of columns.
*
* @return array
*/
public function get_columns(){
$columns = array(
"cb" => '',
"addon" => __("Widget", "unlimited-elements-for-elementor"),
"type" => __("Type", "unlimited-elements-for-elementor"),
"text" => __("Text", "unlimited-elements-for-elementor"),
"version" => __("Version", "unlimited-elements-for-elementor"),
"user" => __("Author", "unlimited-elements-for-elementor"),
"date" => __("Date", "unlimited-elements-for-elementor"),
);
return $columns;
}
/**
* Prepares the list of items for displaying.
*
* @return void
*/
public function prepare_items(){
$this->processAction();
// prepare columns
$columns = $this->get_columns();
$hidden = array();
$sortable = $this->get_sortable_columns();
$this->_column_headers = array($columns, $hidden, $sortable);
// prepare items and pagination
$data = $this->prepareData();
$limit = $this->getLimit();
$this->items = $data["items"];
$this->set_pagination_args([
"total_items" => $data["total"],
"per_page" => $limit,
]);
}
/**
* Message to be displayed when there are no items.
*
* @return void
*/
public function no_items(){
echo __("No changelogs found.", "unlimited-elements-for-elementor");
}
/**
* Displays the table.
*
* @return void
*/
public function display(){
$this->prepare_items();
$this->displayHeader();
?>
__("Delete Permanently", "unlimited-elements-for-elementor"),
);
return $actions;
}
/**
* Generates content for a single row of the table.
*
* @param array $item
*
* @return void
*/
public function single_row($item){
echo '