diff --git a/actions-log.php b/actions-log.php index c4dcb776..00e5e6a6 100644 --- a/actions-log.php +++ b/actions-log.php @@ -271,10 +271,9 @@ echo $table->render(); - /** - * PAGINATION - */ - echo $table->pagination([ + // PAGINATION + $pagination = new \ProjectSend\Classes\PaginationLayout; + echo $pagination->make([ 'link' => 'actions-log.php', 'current' => $pagination_page, 'item_count' => $count_for_pagination, diff --git a/assets/src/js/parts/main.js b/assets/src/js/parts/main.js index 2a8b5ebf..156d62b9 100644 --- a/assets/src/js/parts/main.js +++ b/assets/src/js/parts/main.js @@ -109,15 +109,15 @@ $('.footable').footable().find('> tbody > tr:not(.footable-row-detail):nth-child(even)').addClass('odd'); } - /** Pagination */ - $(".go_to_page").on("click", "button", function() { - var _page = $('.go_to_page #page_number').data('link'); - var _page_no = parseInt($('.go_to_page #page_number').val()); - if (typeof _page_no == 'number'){ - _page = _page.replace('_pgn_', _page_no); - } - window.location.href = _page; - }); + // /** Pagination */ + // $(".go_to_page").on("click", "button", function() { + // var _page = $('.go_to_page #page_number').data('link'); + // var _page_no = parseInt($('.go_to_page #page_number').val()); + // if (typeof _page_no == 'number'){ + // _page = _page.replace('_pgn_', _page_no); + // } + // window.location.href = _page; + // }); /** Password generator */ var hdl = new Jen(true); diff --git a/assets/src/scss/main.scss b/assets/src/scss/main.scss index 80f017a3..d9a1229a 100644 --- a/assets/src/scss/main.scss +++ b/assets/src/scss/main.scss @@ -909,7 +909,7 @@ li .required.password_toggle { } .go_to_page #page_number { - width:4em !important; + width:3.5rem !important; text-align:center; } diff --git a/categories.php b/categories.php index 3bb6905b..229e9fc1 100644 --- a/categories.php +++ b/categories.php @@ -306,7 +306,8 @@ function format_category_row($arranged) echo $table->render(); // PAGINATION - echo $table->pagination([ + $pagination = new \ProjectSend\Classes\PaginationLayout; + echo $pagination->make([ 'link' => basename($_SERVER['SCRIPT_FILENAME']), 'current' => $params['page'], 'item_count' => $get_categories['count'], diff --git a/clients-membership-requests.php b/clients-membership-requests.php index 31ea4f7f..aaefb324 100644 --- a/clients-membership-requests.php +++ b/clients-membership-requests.php @@ -355,7 +355,8 @@ echo $table->render(); // PAGINATION - echo $table->pagination([ + $pagination = new \ProjectSend\Classes\PaginationLayout; + echo $pagination->make([ 'link' => $this_page, 'current' => $pagination_page, 'item_count' => $count_for_pagination, diff --git a/clients-requests.php b/clients-requests.php index 8b0362a6..10a7b028 100644 --- a/clients-requests.php +++ b/clients-requests.php @@ -407,7 +407,8 @@ echo $table->render(); // PAGINATION - echo $table->pagination([ + $pagination = new \ProjectSend\Classes\PaginationLayout; + echo $pagination->make([ 'link' => $this_page, 'current' => $pagination_page, 'item_count' => $count_for_pagination, diff --git a/clients.php b/clients.php index 10e5de87..2744ef6a 100644 --- a/clients.php +++ b/clients.php @@ -386,7 +386,8 @@ echo $table->render(); // PAGINATION - echo $table->pagination([ + $pagination = new \ProjectSend\Classes\PaginationLayout; + echo $pagination->make([ 'link' => 'clients.php', 'current' => $pagination_page, 'item_count' => $count_for_pagination, diff --git a/cron-log.php b/cron-log.php index ce5fc929..ee19a597 100644 --- a/cron-log.php +++ b/cron-log.php @@ -214,8 +214,9 @@ echo $table->render(); // PAGINATION - echo $table->pagination([ - 'link' => 'cron-log.php', + $pagination = new \ProjectSend\Classes\PaginationLayout; + echo $pagination->make([ + 'link' => 'cron-log.php', 'current' => $pagination_page, 'item_count' => $count_for_pagination, ]); diff --git a/custom-assets.php b/custom-assets.php index 270a67b4..4a3e5981 100644 --- a/custom-assets.php +++ b/custom-assets.php @@ -297,8 +297,9 @@ echo $table->render(); // PAGINATION - echo $table->pagination([ - 'link' => 'custom-assets.php', + $pagination = new \ProjectSend\Classes\PaginationLayout; + echo $pagination->make([ + 'link' => 'custom-assets.php', 'current' => $pagination_page, 'item_count' => $count_for_pagination, ]); diff --git a/download-information.php b/download-information.php index 253bd43d..f00c73f4 100644 --- a/download-information.php +++ b/download-information.php @@ -206,8 +206,9 @@ echo $table->render(); // PAGINATION - echo $table->pagination([ - 'link' => 'download-information.php', + $pagination = new \ProjectSend\Classes\PaginationLayout; + echo $pagination->make([ + 'link' => 'download-information.php', 'current' => $pagination_page, 'item_count' => $count_for_pagination, ]); diff --git a/footer.php b/footer.php index 471994ce..bbbfb9e3 100644 --- a/footer.php +++ b/footer.php @@ -1,6 +1,5 @@ - - - + + render(); // PAGINATION - echo $table->pagination([ + $pagination = new \ProjectSend\Classes\PaginationLayout; + echo $pagination->make([ 'link' => 'groups.php', 'current' => $pagination_page, 'item_count' => $count_for_pagination, diff --git a/includes/Classes/PaginationLayout.php b/includes/Classes/PaginationLayout.php new file mode 100644 index 00000000..3e8eecc0 --- /dev/null +++ b/includes/Classes/PaginationLayout.php @@ -0,0 +1,152 @@ +template = ' +
+
+
+
+ +
+
+
+
+ +
+ +
+
+ +
+
+
+
+
+
+
+ '; + } + + private function constructPaginationLink($link, $page = 1) + { + $params['page'] = $page; + + /** + * List of parameters to ignore when building the pagination links. + * TODO: change it so it ignores all but 'search' instead? must check + * if there are other parameters that need to be saved. + */ + $ignore_current_params = array( + 'page', + 'categories_actions', + 'action', + 'do_action', + 'batch', + ); + + if (!empty($_GET)) { + foreach ($_GET as $param => $value) { + if (!in_array($param, $ignore_current_params)) { + $params[$param] = $value; + } + } + } + $this->query = http_build_query($params); + + return BASE_URI . $link . '?' . $this->query; + } + + public function make($parameters) + { + if (!is_numeric($parameters['current'])) { + $parameters['current'] = 1; + } else { + $parameters['current'] = (int)$parameters['current']; + } + + $layout = ''; + + $pages = 0; + $items_per_page = get_option('pagination_results_per_page'); + if (!empty($parameters['items_per_page']) && is_numeric($parameters['items_per_page'])) { + $items_per_page = $parameters['items_per_page']; + } + if (!empty($parameters['item_count']) && is_numeric($parameters['item_count'])) { + $pages = ceil($parameters['item_count'] / $items_per_page); + } + + if ($pages > 1) { + $layout_pages = ''; + // First and previous + if ($parameters['current'] > 1) { + $layout_pages .= '
  • + +
  • +
  • + +
  • '; + } + + /** Pages */ + $already_spaced = false; + for ($i = 1; $i <= $pages; $i++) { + if ( + ($i < $parameters['current'] - 3 || $i > $parameters['current'] + 3) && + ($i != 1 && $i != $pages) + ) { + if ($already_spaced == false) { + $layout_pages .= '
  • ...
  • '; + $already_spaced = true; + } + continue; + } + if ($parameters['current'] == $i) { + $layout_pages .= '
  • ' . $i . '
  • '; + } else { + $layout_pages .= '
  • ' . $i . '
  • '; + } + + if ($i > $parameters['current']) { + $already_spaced = false; + } + } + + /** Next and last */ + if ($parameters['current'] != $pages) { + $layout_pages .= '
  • + +
  • +
  • + +
  • '; + } + + $goto_action = $this->removePageUrlParam($this->constructPaginationLink($parameters['link'])); + + $layout = str_replace( + ['{pages}', '{goto_action}', '{current_page}'], + [$layout_pages, $goto_action, $parameters['current']], + $this->template + ); + } + + return $layout; + } + + private function removePageUrlParam($url) + { + $url = preg_replace('/(&|\?)'.preg_quote('page').'=[^&]*$/', '', $url); + $url = preg_replace('/(&|\?)'.preg_quote('page').'=[^&]*&/', '$1', $url); + + return $url; + } +} \ No newline at end of file diff --git a/includes/Classes/TableGenerate.php b/includes/Classes/TableGenerate.php index 20591c21..8e90b82c 100644 --- a/includes/Classes/TableGenerate.php +++ b/includes/Classes/TableGenerate.php @@ -221,130 +221,4 @@ public function render() $this->contents .= "\n\n"; return $this->contents; } - - /** - * PAGINATION - */ - private function constructPaginationLink($link, $page = 1) - { - $params['page'] = $page; - - /** - * List of parameters to ignore when building the pagination links. - * TODO: change it so it ignores all but 'search' instead? must check - * if there are other parameters that need to be saved. - */ - $ignore_current_params = array( - 'page', - 'categories_actions', - 'action', - 'do_action', - 'batch', - ); - - if (!empty($_GET)) { - foreach ($_GET as $param => $value) { - if (!in_array($param, $ignore_current_params)) { - $params[$param] = $value; - } - } - } - $this->query = http_build_query($params); - - return BASE_URI . $link . '?' . $this->query; - } - - public function pagination($params) - { - if (!is_numeric($params['current'])) { - $params['current'] = 1; - } else { - $params['current'] = (int)$params['current']; - } - - $this->output = ''; - - $pages = 0; - $items_per_page = get_option('pagination_results_per_page'); - if (!empty($params['items_per_page']) && is_numeric($params['items_per_page'])) { - $items_per_page = $params['items_per_page']; - } - if (!empty($params['item_count']) && is_numeric($params['item_count'])) { - $pages = ceil($params['item_count'] / $items_per_page); - } - - if ($pages > 1) { - $this->output = '
    -
    -
    - '; - - $this->output .= '
    -
    - - -
    -
    - -
    -
    '; - - $this->output .= '
    -
    -
    '; - } - - return $this->output; - } } diff --git a/manage-files.php b/manage-files.php index 55fcb252..b8acae97 100644 --- a/manage-files.php +++ b/manage-files.php @@ -494,324 +494,325 @@ } ?> - -
    - -
    + +
    +
    + -
    -
    - 0) { - // Generate the table using the class. - $table_attributes = array( - 'id' => 'files_tbl', - 'class' => 'footable table', - ); - $table = new \ProjectSend\Classes\TableGenerate($table_attributes); - - /** - * Set the conditions to true or false once here to - * avoid repetition - * They will be used to generate or no certain columns - */ - $conditions = array( +
    +
    + 0) { + // Generate the table using the class. + $table_attributes = array( + 'id' => 'files_tbl', + 'class' => 'footable table', + ); + $table = new \ProjectSend\Classes\TableGenerate($table_attributes); + + /** + * Set the conditions to true or false once here to + * avoid repetition + * They will be used to generate or no certain columns + */ + $conditions = array( + 'select_all' => true, + 'is_not_client' => (CURRENT_USER_LEVEL != '0') ? true : false, + 'can_set_public' => (CURRENT_USER_LEVEL != '0' || current_user_can_upload_public()) ? true : false, + 'total_downloads' => (CURRENT_USER_LEVEL != '0' && !isset($search_on)) ? true : false, + 'is_search_on' => (isset($search_on)) ? true : false, + ); + + $thead_columns = array( + array( 'select_all' => true, - 'is_not_client' => (CURRENT_USER_LEVEL != '0') ? true : false, - 'can_set_public' => (CURRENT_USER_LEVEL != '0' || current_user_can_upload_public()) ? true : false, - 'total_downloads' => (CURRENT_USER_LEVEL != '0' && !isset($search_on)) ? true : false, - 'is_search_on' => (isset($search_on)) ? true : false, - ); + 'attributes' => array( + 'class' => array('td_checkbox'), + ), + 'condition' => $conditions['select_all'], + ), + array( + 'content' => __('Preview', 'cftp_admin'), + 'hide' => 'phone,tablet', + ), + array( + 'sortable' => true, + 'sort_url' => 'timestamp', + 'sort_default' => true, + 'content' => __('Added on', 'cftp_admin'), + 'hide' => 'phone', + ), + array( + 'content' => __('Type', 'cftp_admin'), + 'hide' => 'phone,tablet', + ), + array( + 'sortable' => true, + 'sort_url' => 'filename', + 'content' => __('Title', 'cftp_admin'), + ), + array( + 'sortable' => true, + 'sort_url' => 'description', + 'content' => __('Description', 'cftp_admin'), + ), + array( + 'content' => __('Size', 'cftp_admin'), + ), + array( + 'sortable' => true, + 'sort_url' => 'uploader', + 'content' => __('Uploader', 'cftp_admin'), + 'hide' => 'phone,tablet', + 'condition' => $conditions['is_not_client'], + ), + array( + 'content' => __('Assigned', 'cftp_admin'), + 'hide' => 'phone', + 'condition' => ($conditions['is_not_client'] && !$conditions['is_search_on']), + ), + array( + 'sortable' => true, + 'sort_url' => 'public_allow', + 'content' => __('Public permissions', 'cftp_admin'), + 'hide' => 'phone', + 'condition' => $conditions['can_set_public'], + ), + array( + 'content' => __('Expiry', 'cftp_admin'), + 'hide' => 'phone', + 'condition' => $conditions['is_not_client'], + ), + array( + 'content' => __('Status', 'cftp_admin'), + 'hide' => 'phone', + 'condition' => $conditions['is_search_on'], + ), + array( + 'sortable' => true, + 'sort_url' => 'download_count', + 'content' => __('Download count', 'cftp_admin'), + 'hide' => 'phone', + 'condition' => $conditions['is_search_on'], + ), + array( + 'sortable' => true, + 'sort_url' => 'download_count', + 'content' => __('Total downloads', 'cftp_admin'), + 'hide' => 'phone', + 'condition' => $conditions['total_downloads'], + ), + array( + 'content' => __('Actions', 'cftp_admin'), + 'hide' => 'phone', + ), + ); + + $table->thead($thead_columns); + + $sql->setFetchMode(PDO::FETCH_ASSOC); + while ($row = $sql->fetch()) { + $table->addRow(); + $file = new \ProjectSend\Classes\Files(); + $file->get($row['id']); + + // Visibility is only available when filtering by client or group. + $assignations = get_file_assignations($file->id); + + $count_assignations = 0; + if (!empty($assignations['clients'])) { + $count_assignations += count($assignations['clients']); + } + if (!empty($assignations['groups'])) { + $count_assignations += count($assignations['groups']); + } + + switch ($results_type) { + case 'client': + $hidden = $assignations['clients'][$this_id]['hidden']; + break; + case 'group': + $hidden = $assignations['groups'][$this_id]['hidden']; + break; + } + + // Preview + $preview_cell = ''; + if ($file->embeddable) { + $preview_cell = ''; + } + if (file_is_image($file->full_path)) { + $thumbnail = make_thumbnail($file->full_path, null, 50, 50); + if (!empty($thumbnail['thumbnail']['url'])) { + $preview_cell = ' + + '; + } + } + + // Is file assigned? + $assigned_class = ($count_assignations == 0) ? 'danger' : 'success'; + $assigned_status = ($count_assignations == 0) ? __('No', 'cftp_admin') : __('Yes', 'cftp_admin'); + + // Visibility + if ($file->isPublic()) { + $visibility_link = '' . __('Download', 'cftp_admin') . ''; + } else { + if (get_option('enable_landing_for_all_files') == '1') { + $visibility_link = '' . __('View information', 'cftp_admin') . ''; + } else { + $visibility_link = '' . __('None', 'cftp_admin') . ''; + } + } + + // Expiration + if ($file->expires == '0') { + $expires_button = 'success'; + $expires_label = __('Does not expire', 'cftp_admin'); + } else { + $expires_date = date(get_option('timeformat'), strtotime($file->expiry_date)); + + if ($file->expired == true) { + $expires_button = 'danger'; + $expires_label = __('Expired on', 'cftp_admin') . ' ' . $expires_date; + } else { + $expires_button = 'info'; + $expires_label = __('Expires on', 'cftp_admin') . ' ' . $expires_date; + } + } + + // Visibility + $status_class = ''; + $status_label = ''; + if (isset($search_on)) { + $status_class = ($hidden == 1) ? 'danger' : 'success'; + $status_label = ($hidden == 1) ? __('Hidden', 'cftp_admin') : __('Visible', 'cftp_admin'); + } + + // Download count when filtering by group or client + if (isset($search_on)) { + $download_count_content = $row['download_count'] . ' ' . __('times', 'cftp_admin'); + + switch ($results_type) { + case 'client': + break; + case 'group': + case 'category': + $download_count_class = ($row['download_count'] > 0) ? 'downloaders btn-primary' : 'btn-pslight disabled'; + $download_count_content = '' . $download_count_content . ''; + break; + } + } + + // Download count and link on the unfiltered files table no specific client or group selected) + if (!isset($search_on)) { + if (CURRENT_USER_LEVEL != '0') { + if ($row["download_count"] > 0) { + $btn_class = 'downloaders btn-primary'; + } else { + $btn_class = 'btn-pslight disabled'; + } + + $downloads_table_link = '' . $row["download_count"] . ' ' . __('downloads', 'cftp_admin') . ''; + } + } - $thead_columns = array( + //* Add the cells to the row + $tbody_cells = array( array( - 'select_all' => true, - 'attributes' => array( - 'class' => array('td_checkbox'), - ), + 'checkbox' => true, + 'value' => $file->id, 'condition' => $conditions['select_all'], ), array( - 'content' => __('Preview', 'cftp_admin'), - 'hide' => 'phone,tablet', + 'content' => $preview_cell, ), array( - 'sortable' => true, - 'sort_url' => 'timestamp', - 'sort_default' => true, - 'content' => __('Added on', 'cftp_admin'), - 'hide' => 'phone', + 'content' => format_date($file->uploaded_date), ), array( - 'content' => __('Type', 'cftp_admin'), - 'hide' => 'phone,tablet', + 'content' => $file->extension, ), array( - 'sortable' => true, - 'sort_url' => 'filename', - 'content' => __('Title', 'cftp_admin'), + 'attributes' => array( + 'class' => array('file_name'), + ), + 'content' => '' . $file->title . '', ), array( - 'sortable' => true, - 'sort_url' => 'description', - 'content' => __('Description', 'cftp_admin'), + 'content' => $file->description, ), array( - 'content' => __('Size', 'cftp_admin'), + 'content' => $file->size_formatted, ), array( - 'sortable' => true, - 'sort_url' => 'uploader', - 'content' => __('Uploader', 'cftp_admin'), - 'hide' => 'phone,tablet', + 'content' => $file->uploaded_by, 'condition' => $conditions['is_not_client'], ), array( - 'content' => __('Assigned', 'cftp_admin'), - 'hide' => 'phone', + 'content' => '' . $assigned_status . '', 'condition' => ($conditions['is_not_client'] && !$conditions['is_search_on']), ), array( - 'sortable' => true, - 'sort_url' => 'public_allow', - 'content' => __('Public permissions', 'cftp_admin'), - 'hide' => 'phone', + 'attributes' => array( + 'class' => array('col_visibility'), + ), + 'content' => $visibility_link, 'condition' => $conditions['can_set_public'], ), array( - 'content' => __('Expiry', 'cftp_admin'), - 'hide' => 'phone', + 'content' => '' . $expires_label . '', 'condition' => $conditions['is_not_client'], ), array( - 'content' => __('Status', 'cftp_admin'), - 'hide' => 'phone', + 'content' => '' . $status_label . '', 'condition' => $conditions['is_search_on'], ), array( - 'sortable' => true, - 'sort_url' => 'download_count', - 'content' => __('Download count', 'cftp_admin'), - 'hide' => 'phone', + 'content' => (!empty($download_count_content)) ? $download_count_content : false, 'condition' => $conditions['is_search_on'], ), array( - 'sortable' => true, - 'sort_url' => 'download_count', - 'content' => __('Total downloads', 'cftp_admin'), - 'hide' => 'phone', + 'content' => (!empty($downloads_table_link)) ? $downloads_table_link : false, 'condition' => $conditions['total_downloads'], ), array( - 'content' => __('Actions', 'cftp_admin'), - 'hide' => 'phone', + 'content' => '' . __('Edit', 'cftp_admin') . '', ), ); - $table->thead($thead_columns); - - $sql->setFetchMode(PDO::FETCH_ASSOC); - while ($row = $sql->fetch()) { - $table->addRow(); - $file = new \ProjectSend\Classes\Files(); - $file->get($row['id']); - - // Visibility is only available when filtering by client or group. - $assignations = get_file_assignations($file->id); - - $count_assignations = 0; - if (!empty($assignations['clients'])) { - $count_assignations += count($assignations['clients']); - } - if (!empty($assignations['groups'])) { - $count_assignations += count($assignations['groups']); - } - - switch ($results_type) { - case 'client': - $hidden = $assignations['clients'][$this_id]['hidden']; - break; - case 'group': - $hidden = $assignations['groups'][$this_id]['hidden']; - break; - } - - // Preview - $preview_cell = ''; - if ($file->embeddable) { - $preview_cell = ''; - } - if (file_is_image($file->full_path)) { - $thumbnail = make_thumbnail($file->full_path, null, 50, 50); - if (!empty($thumbnail['thumbnail']['url'])) { - $preview_cell = ' - - '; - } - } - - // Is file assigned? - $assigned_class = ($count_assignations == 0) ? 'danger' : 'success'; - $assigned_status = ($count_assignations == 0) ? __('No', 'cftp_admin') : __('Yes', 'cftp_admin'); - - // Visibility - if ($file->isPublic()) { - $visibility_link = '' . __('Download', 'cftp_admin') . ''; - } else { - if (get_option('enable_landing_for_all_files') == '1') { - $visibility_link = '' . __('View information', 'cftp_admin') . ''; - } else { - $visibility_link = '' . __('None', 'cftp_admin') . ''; - } - } - - // Expiration - if ($file->expires == '0') { - $expires_button = 'success'; - $expires_label = __('Does not expire', 'cftp_admin'); - } else { - $expires_date = date(get_option('timeformat'), strtotime($file->expiry_date)); - - if ($file->expired == true) { - $expires_button = 'danger'; - $expires_label = __('Expired on', 'cftp_admin') . ' ' . $expires_date; - } else { - $expires_button = 'info'; - $expires_label = __('Expires on', 'cftp_admin') . ' ' . $expires_date; - } - } - - // Visibility - $status_class = ''; - $status_label = ''; - if (isset($search_on)) { - $status_class = ($hidden == 1) ? 'danger' : 'success'; - $status_label = ($hidden == 1) ? __('Hidden', 'cftp_admin') : __('Visible', 'cftp_admin'); - } - - // Download count when filtering by group or client - if (isset($search_on)) { - $download_count_content = $row['download_count'] . ' ' . __('times', 'cftp_admin'); - - switch ($results_type) { - case 'client': - break; - case 'group': - case 'category': - $download_count_class = ($row['download_count'] > 0) ? 'downloaders btn-primary' : 'btn-pslight disabled'; - $download_count_content = '' . $download_count_content . ''; - break; - } - } - - // Download count and link on the unfiltered files table no specific client or group selected) - if (!isset($search_on)) { - if (CURRENT_USER_LEVEL != '0') { - if ($row["download_count"] > 0) { - $btn_class = 'downloaders btn-primary'; - } else { - $btn_class = 'btn-pslight disabled'; - } - - $downloads_table_link = '' . $row["download_count"] . ' ' . __('downloads', 'cftp_admin') . ''; - } - } - - //* Add the cells to the row - $tbody_cells = array( - array( - 'checkbox' => true, - 'value' => $file->id, - 'condition' => $conditions['select_all'], - ), - array( - 'content' => $preview_cell, - ), - array( - 'content' => format_date($file->uploaded_date), - ), - array( - 'content' => $file->extension, - ), - array( - 'attributes' => array( - 'class' => array('file_name'), - ), - 'content' => '' . $file->title . '', - ), - array( - 'content' => $file->description, - ), - array( - 'content' => $file->size_formatted, - ), - array( - 'content' => $file->uploaded_by, - 'condition' => $conditions['is_not_client'], - ), - array( - 'content' => '' . $assigned_status . '', - 'condition' => ($conditions['is_not_client'] && !$conditions['is_search_on']), - ), - array( - 'attributes' => array( - 'class' => array('col_visibility'), - ), - 'content' => $visibility_link, - 'condition' => $conditions['can_set_public'], - ), - array( - 'content' => '' . $expires_label . '', - 'condition' => $conditions['is_not_client'], - ), - array( - 'content' => '' . $status_label . '', - 'condition' => $conditions['is_search_on'], - ), - array( - 'content' => (!empty($download_count_content)) ? $download_count_content : false, - 'condition' => $conditions['is_search_on'], - ), - array( - 'content' => (!empty($downloads_table_link)) ? $downloads_table_link : false, - 'condition' => $conditions['total_downloads'], - ), - array( - 'content' => '' . __('Edit', 'cftp_admin') . '', - ), - ); - - foreach ($tbody_cells as $cell) { - $table->addCell($cell); - } - - $table->end_row(); + foreach ($tbody_cells as $cell) { + $table->addCell($cell); } - echo $table->render(); + $table->end_row(); } - ?> -
    -
    -
    -
    - pagination([ - 'link' => 'manage-files.php', - 'current' => $pagination_page, - 'item_count' => $count_for_pagination, - ]); - } - ?> -
    + echo $table->render(); + } + ?>
    + +
    +
    + make([ + 'link' => 'manage-files.php', + 'current' => $pagination_page, + 'item_count' => $count_for_pagination, + ]); + } + ?> +
    +
    + render(); - /** - * PAGINATION - */ - echo $table->pagination([ + // PAGINATION + $pagination = new \ProjectSend\Classes\PaginationLayout; + echo $pagination->make([ 'link' => 'public.php', 'current' => $pagination_page, 'item_count' => $files['pagination']['total'], diff --git a/templates/default/template.php b/templates/default/template.php index dc34468c..b5c75a8d 100644 --- a/templates/default/template.php +++ b/templates/default/template.php @@ -301,10 +301,9 @@ echo $table->render(); - /** - * PAGINATION - */ - echo $table->pagination([ + // PAGINATION + $pagination = new \ProjectSend\Classes\PaginationLayout; + echo $pagination->make([ 'link' => 'my_files/index.php', 'current' => $pagination_page, 'item_count' => $count_for_pagination, diff --git a/users.php b/users.php index 0ec57414..5f66da36 100644 --- a/users.php +++ b/users.php @@ -362,7 +362,8 @@ echo $table->render(); // PAGINATION - echo $table->pagination([ + $pagination = new \ProjectSend\Classes\PaginationLayout; + echo $pagination->make([ 'link' => 'users.php', 'current' => $pagination_page, 'item_count' => $count_for_pagination,