Paging: Integrate Button class. Theme: Add supporting classes for upcoming changes to list pages.
This commit is contained in:
parent
238c689630
commit
e2a2e64e61
|
|
@ -1881,26 +1881,6 @@ $text['label-multicast_paging']['ru-ru'] = "Multicast Paging";
|
|||
$text['label-multicast_paging']['sv-se'] = "Multicast Paging";
|
||||
$text['label-multicast_paging']['uk-ua'] = "";
|
||||
|
||||
$text['label-page']['en-us'] = "Page";
|
||||
$text['label-page']['ar-eg'] = "";
|
||||
$text['label-page']['de-at'] = "Page"; //copied from de-de
|
||||
$text['label-page']['de-ch'] = "Page"; //copied from de-de
|
||||
$text['label-page']['de-de'] = "Page";
|
||||
$text['label-page']['es-cl'] = "";
|
||||
$text['label-page']['es-mx'] = "";
|
||||
$text['label-page']['fr-ca'] = "Page";
|
||||
$text['label-page']['fr-fr'] = "Page";
|
||||
$text['label-page']['he-il'] = "";
|
||||
$text['label-page']['it-it'] = "Page";
|
||||
$text['label-page']['nl-nl'] = "";
|
||||
$text['label-page']['pl-pl'] = "";
|
||||
$text['label-page']['pt-br'] = "";
|
||||
$text['label-page']['pt-pt'] = "";
|
||||
$text['label-page']['ro-ro'] = "";
|
||||
$text['label-page']['ru-ru'] = "Page";
|
||||
$text['label-page']['sv-se'] = "Page";
|
||||
$text['label-page']['uk-ua'] = "";
|
||||
|
||||
$text['label-park']['en-us'] = "Park";
|
||||
$text['label-park']['ar-eg'] = "";
|
||||
$text['label-park']['de-at'] = "Park"; //copied from de-de
|
||||
|
|
|
|||
|
|
@ -3351,6 +3351,26 @@ $text['label-tickets']['ru-ru'] = "";
|
|||
$text['label-tickets']['sv-se'] = "";
|
||||
$text['label-tickets']['uk-ua'] = "";
|
||||
|
||||
$text['label-page']['en-us'] = "Page";
|
||||
$text['label-page']['ar-eg'] = "";
|
||||
$text['label-page']['de-at'] = "Page"; //copied from de-de
|
||||
$text['label-page']['de-ch'] = "Page"; //copied from de-de
|
||||
$text['label-page']['de-de'] = "Page";
|
||||
$text['label-page']['es-cl'] = "";
|
||||
$text['label-page']['es-mx'] = "";
|
||||
$text['label-page']['fr-ca'] = "Page";
|
||||
$text['label-page']['fr-fr'] = "Page";
|
||||
$text['label-page']['he-il'] = "";
|
||||
$text['label-page']['it-it'] = "Page";
|
||||
$text['label-page']['nl-nl'] = "";
|
||||
$text['label-page']['pl-pl'] = "";
|
||||
$text['label-page']['pt-br'] = "";
|
||||
$text['label-page']['pt-pt'] = "";
|
||||
$text['label-page']['ro-ro'] = "";
|
||||
$text['label-page']['ru-ru'] = "Page";
|
||||
$text['label-page']['sv-se'] = "Page";
|
||||
$text['label-page']['uk-ua'] = "";
|
||||
|
||||
$text['button-tickets']['en-us'] = "Tickets";
|
||||
$text['button-tickets']['ar-eg'] = "";
|
||||
$text['button-tickets']['de-at'] = ""; //copied from de-de
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ function paging($num_rows, $param, $rows_per_page, $mini = false, $result_count
|
|||
if (!is_numeric($result_count)) { $result_count = 0; }
|
||||
|
||||
// if $_get['page'] defined, use it as page number
|
||||
if(isset($_GET['page']) && is_numeric($_GET['page'])) {
|
||||
if (isset($_GET['page']) && is_numeric($_GET['page'])) {
|
||||
$page_number = $_GET['page'];
|
||||
}
|
||||
else {
|
||||
|
|
@ -52,7 +52,7 @@ function paging($num_rows, $param, $rows_per_page, $mini = false, $result_count
|
|||
//validate order by
|
||||
$sanitized_parameters .= "&order_by=". preg_replace('#[^a-zA-Z0-9_\-]#', '', $value);
|
||||
}
|
||||
elseif ($key == 'order' && strlen($value) > 0) {
|
||||
else if ($key == 'order' && strlen($value) > 0) {
|
||||
//validate order
|
||||
switch ($value) {
|
||||
case 'asc':
|
||||
|
|
@ -63,7 +63,7 @@ function paging($num_rows, $param, $rows_per_page, $mini = false, $result_count
|
|||
break;
|
||||
}
|
||||
}
|
||||
elseif (strlen($value) > 0 && is_numeric($value)) {
|
||||
else if (strlen($value) > 0 && is_numeric($value)) {
|
||||
$sanitized_parameters .= "&".$key."=".$value;
|
||||
}
|
||||
else {
|
||||
|
|
@ -88,37 +88,37 @@ function paging($num_rows, $param, $rows_per_page, $mini = false, $result_count
|
|||
//print the link to access each page
|
||||
$self = htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8');
|
||||
$nav = '';
|
||||
for($page = 1; $page <= $max_page; $page++){
|
||||
for ($page = 1; $page <= $max_page; $page++){
|
||||
if ($page == $page_number) {
|
||||
$nav .= " $page "; // no need to create a link to current page
|
||||
}
|
||||
else {
|
||||
$nav .= " <a href=\"$self?page=$page\">$page</a> \n";
|
||||
$nav .= " <a href='".$self."?page=".$page."'>".$page."</a> \n";
|
||||
}
|
||||
}
|
||||
|
||||
if ($page_number > 0) {
|
||||
$page = $page_number - 1;
|
||||
$prev = "<input class='btn' type='button' value='".$text['button-back']."' alt='".($page+1)."' title='".($page+1)."' onClick=\"window.location = '".$self."?page=".$page.$sanitized_parameters."';\">\n"; //◀
|
||||
$first = "<input class='btn' type='button' value='".$text['button-next']."' onClick=\"window.location = '".$self."?page=1".$sanitized_parameters."';\">\n"; //▲
|
||||
$prev = button::create(['type'=>'button','label'=>(!$mini ? $text['button-back'] : null),'icon'=>($mini ? 'chevron-left' : null),'link'=>$self."?page=".$page.$sanitized_parameters,'title'=>$text['label-page'].' '.($page+1)]);
|
||||
$first = button::create(['type'=>'button','label'=>(!$mini ? $text['button-next'] : null),'icon'=>($mini ? 'chevron-left' : null),'link'=>$self."?page=1".$sanitized_parameters]);
|
||||
}
|
||||
else {
|
||||
$prev = "<input class='btn' type='button' disabled value='".$text['button-back']."' style='opacity: 0.4; -moz-opacity: 0.4; cursor: default;'>\n"; //◀
|
||||
$prev = button::create(['type'=>'button','label'=>(!$mini ? $text['button-back'] : null),'icon'=>($mini ? 'chevron-left' : null),'onclick'=>"return false;",'title'=>'','style'=>'opacity: 0.4; -moz-opacity: 0.4; cursor: default;']);
|
||||
}
|
||||
|
||||
if (($page_number + 1) < $max_page) {
|
||||
$page = $page_number + 1;
|
||||
$next = "<input class='btn' type='button' value='".$text['button-next']."' alt='".($page+1)."' title='".($page+1)."' onClick=\"window.location = '".$self."?page=".$page.$sanitized_parameters."';\">\n"; //▶
|
||||
$last = "<input class='btn' type='button' value='".$text['button-back']."' onClick=\"window.location = '".$self."?page=".$max_page.$sanitized_parameters."';\">\n"; //▼
|
||||
$next = button::create(['type'=>'button','label'=>(!$mini ? $text['button-next'] : null),'icon'=>($mini ? 'chevron-right' : null),'link'=>$self."?page=".$page.$sanitized_parameters,'title'=>$text['label-page'].' '.($page+1)]);
|
||||
$last = button::create(['type'=>'button','label'=>(!$mini ? $text['button-back'] : null),'icon'=>($mini ? 'chevron-right' : null),'link'=>$self."?page=".$max_page.$sanitized_parameters]);
|
||||
}
|
||||
else {
|
||||
$last = "<input class='btn' type='button' value='".$text['button-next']."' onClick=\"window.location = '".$self."?page=".$max_page.$sanitized_parameters."';\">\n"; //▼
|
||||
$next = "<input class='btn' type='button' disabled value='".$text['button-next']."' style='opacity: 0.4; -moz-opacity: 0.4; cursor: default;'>\n"; //▶
|
||||
$last = button::create(['type'=>'button','label'=>(!$mini ? $text['button-next'] : null),'icon'=>($mini ? 'chevron-right' : null),'link'=>$self."?page=".$max_page.$sanitized_parameters]);
|
||||
$next = button::create(['type'=>'button','label'=>(!$mini ? $text['button-next'] : null),'icon'=>($mini ? 'chevron-right' : null),'onclick'=>"return false;",'title'=>'','style'=>'opacity: 0.4; -moz-opacity: 0.4; cursor: default;']);
|
||||
}
|
||||
|
||||
//if the result count is less than the rows per page then this is the last page of results
|
||||
if ($result_count > 0 and $result_count < $rows_per_page) {
|
||||
$next = "<input class='btn' type='button' disabled value='".$text['button-next']."' style='opacity: 0.4; -moz-opacity: 0.4; cursor: default;'>\n"; //▶
|
||||
$next = button::create(['type'=>'button','label'=>(!$mini ? $text['button-next'] : null),'icon'=>($mini ? 'chevron-right' : null),'onclick'=>"return false;",'title'=>'','style'=>'opacity: 0.4; -moz-opacity: 0.4; cursor: default;']);
|
||||
}
|
||||
|
||||
$array = array();
|
||||
|
|
@ -191,4 +191,4 @@ function paging($num_rows, $param, $rows_per_page, $mini = false, $result_count
|
|||
|
||||
}
|
||||
|
||||
?>
|
||||
?>
|
||||
|
|
@ -1239,8 +1239,8 @@ $default_login = ($_REQUEST['login'] == 'default') ? true : false;
|
|||
display: none;
|
||||
}
|
||||
|
||||
/* expand search input on focus */
|
||||
input[type=text].search {
|
||||
/* expand list search input on focus */
|
||||
input[type=text].list-search {
|
||||
width: 70px;
|
||||
min-width: 70px;
|
||||
margin-left: 15px;
|
||||
|
|
@ -1249,7 +1249,7 @@ $default_login = ($_REQUEST['login'] == 'default') ? true : false;
|
|||
transition: all .5s ease;
|
||||
}
|
||||
|
||||
input[type=text].search:focus {
|
||||
input[type=text].list-search:focus {
|
||||
width: 150px;
|
||||
}
|
||||
|
||||
|
|
@ -2097,7 +2097,7 @@ $default_login = ($_REQUEST['login'] == 'default') ? true : false;
|
|||
white-space: nowrap;
|
||||
}
|
||||
|
||||
/*******************************************************************************/
|
||||
/* LIST ACTION BAR *************************************************************/
|
||||
|
||||
div.action_bar {
|
||||
position: -webkit-sticky;
|
||||
|
|
@ -2141,3 +2141,85 @@ $default_login = ($_REQUEST['login'] == 'default') ? true : false;
|
|||
background: <?php echo ($_SESSION['theme']['action_bar_background_scroll']['text'] != '') ? $_SESSION['theme']['action_bar_background_scroll']['text'] : 'rgba(255,255,255,0.9)'; ?>;
|
||||
box-shadow: <?php echo ($_SESSION['theme']['action_bar_shadow_scroll']['text'] != '') ? $_SESSION['theme']['action_bar_shadow_scroll']['text'] : '0 3px 3px 0 rgba(0,0,0,0.2)'; ?>;
|
||||
}
|
||||
|
||||
/* LIST ************************************************************************/
|
||||
|
||||
.list {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.list tr {
|
||||
cursor: default;
|
||||
}
|
||||
|
||||
.list tr:hover td:not(.no-link),
|
||||
.list tr:hover td:not(.no-link) a {
|
||||
color: <?php echo ($_SESSION['theme']['text_link_color_hover']['text'] != '') ? $_SESSION['theme']['text_link_color_hover']['text'] : '#5082ca'; ?>;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.list-header > th {
|
||||
padding: 4px 7px;
|
||||
text-align: left;
|
||||
color: <?php echo ($_SESSION['theme']['table_heading_text_color']['text'] != '') ? $_SESSION['theme']['table_heading_text_color']['text'] : '#3164ad'; ?>;
|
||||
font-size: <?php echo ($_SESSION['theme']['table_heading_text_size']['text'] != '') ? $_SESSION['theme']['table_heading_text_size']['text'] : '12px'; ?>;
|
||||
font-family: <?php echo ($_SESSION['theme']['table_heading_text_font']['text'] != '') ? $_SESSION['theme']['table_heading_text_font']['text'] : 'arial'; ?>;
|
||||
background: <?php echo ($_SESSION['theme']['table_heading_background_color']['text'] != '') ? $_SESSION['theme']['table_heading_background_color']['text'] : 'none'; ?>;
|
||||
border-bottom: 1px solid <?php echo ($_SESSION['theme']['table_heading_border_color']['text'] != '') ? $_SESSION['theme']['table_heading_border_color']['text'] : '#a4aebf'; ?>;
|
||||
}
|
||||
|
||||
.list-row:nth-child(odd) > :not(.action-button) {
|
||||
background: <?php echo ($_SESSION['theme']['table_row_background_color_light']['text'] != '') ? $_SESSION['theme']['table_row_background_color_light']['text'] : '#ffffff'; ?>;
|
||||
}
|
||||
|
||||
.list-row:nth-child(even) > :not(.action-button) {
|
||||
background: <?php echo ($_SESSION['theme']['table_row_background_color_dark']['text'] != '') ? $_SESSION['theme']['table_row_background_color_dark']['text'] : '#e5e9f0'; ?>;
|
||||
}
|
||||
|
||||
.list-row > td:not(.action-button) {
|
||||
border-bottom: 1px solid <?php echo ($_SESSION['theme']['table_row_border_color']['text'] != '') ? $_SESSION['theme']['table_row_border_color']['text'] : '#c5d1e5'; ?>;
|
||||
color: <?php echo ($_SESSION['theme']['table_row_text_color']['text'] != '') ? $_SESSION['theme']['table_row_text_color']['text'] : '#000'; ?>;
|
||||
font-family: <?php echo ($_SESSION['theme']['table_row_text_font']['text'] != '') ? $_SESSION['theme']['table_row_text_font']['text'] : 'arial'; ?>;
|
||||
font-size: <?php echo ($_SESSION['theme']['table_row_text_size']['text'] != '') ? $_SESSION['theme']['table_row_text_size']['text'] : '12px'; ?>;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.list-row > :not(.checkbox) {
|
||||
padding: <?php echo ($_SESSION['theme']['table_row_padding']['text'] != '') ? $_SESSION['theme']['table_row_padding']['text'] : '4px 7px 4px 7px'; ?>;
|
||||
}
|
||||
|
||||
.list-row > td.description {
|
||||
background: <?php echo ($_SESSION['theme']['table_row_background_color_medium']['text'] != '') ? $_SESSION['theme']['table_row_background_color_medium']['text'] : '#f0f2f6'; ?> !important;
|
||||
}
|
||||
|
||||
.list-header > .checkbox,
|
||||
.list-row > .checkbox {
|
||||
width: 1px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.list-row > .checkbox {
|
||||
padding: 3px 7px 1px 7px;
|
||||
}
|
||||
|
||||
.list-row > .button {
|
||||
margin: 0;
|
||||
padding-top: 0;
|
||||
padding-bottom: 0;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.list-row > .overflow {
|
||||
max-width: 50px;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.list-header > .action-button,
|
||||
.list-row > .action-button {
|
||||
width: 1px;
|
||||
white-space: nowrap;
|
||||
background: none;
|
||||
padding: 0;
|
||||
}
|
||||
|
|
@ -205,8 +205,8 @@ echo "<script language='JavaScript' type='text/javascript' src='<!--{project_pat
|
|||
?>
|
||||
|
||||
//link table rows (except the last - the list_control_icons cell) on a table with a class of 'tr_hover', according to the href attribute of the <tr> tag
|
||||
$('.tr_hover tr').each(function(i,e) {
|
||||
$(e).children('td:not(.list_control_icon,.list_control_icons,.tr_link_void)').on('click', function() {
|
||||
$('.tr_hover tr,.list tr').each(function(i,e) {
|
||||
$(e).children('td:not(.list_control_icon,.list_control_icons,.tr_link_void,.list-row > .no-link,.list-row > .checkbox,.list-row > .button,.list-row > .action-button)').on('click', function() {
|
||||
var href = $(this).closest("tr").attr("href");
|
||||
var target = $(this).closest('tr').attr('target');
|
||||
if (href) {
|
||||
|
|
@ -378,7 +378,7 @@ echo "<script language='JavaScript' type='text/javascript' src='<!--{project_pat
|
|||
}
|
||||
}
|
||||
|
||||
//handle action bar style on scroll
|
||||
//handle action bar style on scroll
|
||||
window.addEventListener('scroll', action_bar_scroll , false);
|
||||
function action_bar_scroll() {
|
||||
if (document.getElementById('action_bar')) {
|
||||
|
|
@ -387,6 +387,48 @@ echo "<script language='JavaScript' type='text/javascript' src='<!--{project_pat
|
|||
}
|
||||
}
|
||||
|
||||
//list functions
|
||||
function list_all_toggle() {
|
||||
var inputs = document.getElementsByTagName('input');
|
||||
var checkbox_checked = document.getElementById('checkbox_all').checked;
|
||||
for (var i = 0, max = inputs.length; i < max; i++) {
|
||||
if (inputs[i].type === 'checkbox') {
|
||||
inputs[i].checked = checkbox_checked;
|
||||
}
|
||||
}
|
||||
if (checkbox_checked) {
|
||||
document.getElementById('btn_check_all').style.display = 'none';
|
||||
document.getElementById('btn_check_none').style.display = '';
|
||||
}
|
||||
else {
|
||||
document.getElementById('btn_check_all').style.display = '';
|
||||
document.getElementById('btn_check_none').style.display = 'none';
|
||||
}
|
||||
}
|
||||
|
||||
function list_self_check(checkbox_id) {
|
||||
var inputs = document.getElementsByTagName('input');
|
||||
for (var i = 0, max = inputs.length; i < max; i++) {
|
||||
if (inputs[i].type === 'checkbox') {
|
||||
inputs[i].checked = false;
|
||||
}
|
||||
}
|
||||
document.getElementById(checkbox_id).checked = true;
|
||||
}
|
||||
|
||||
function list_action_set(action) {
|
||||
document.getElementById('action').value = action;
|
||||
}
|
||||
|
||||
function list_form_submit(form_id) {
|
||||
document.getElementById(form_id).submit();
|
||||
}
|
||||
|
||||
function list_search_reset() {
|
||||
document.getElementById('btn_reset').style.display = 'none';
|
||||
document.getElementById('btn_search').style.display = '';
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
<?php
|
||||
|
|
|
|||
Loading…
Reference in New Issue