| | |
| | | $this->errorMessage .= "Custom datasource class or function is empty<br />\r\n"; |
| | | } |
| | | } |
| | | |
| | | if($api == false && isset($field['filters']) && is_array($field['filters'])) { |
| | | $new_values = array(); |
| | | foreach($values as $index => $value) { |
| | | $new_index = $app->tform->filterField($index, $index, $field['filters'], 'SHOW'); |
| | | $new_values[$new_index] = $app->tform->filterField($index, (isset($values[$index]))?$values[$index]:'', $field['filters'], 'SHOW'); |
| | | } |
| | | $values = $new_values; |
| | | unset($new_values); |
| | | unset($new_index); |
| | | } |
| | | return $values; |
| | | } |
| | | |
| | |
| | | return $this->pagingValues[$key]; |
| | | } |
| | | |
| | | /* TODO: maybe rewrite sql */ |
| | | public function getPagingSQL($sql_where = '1') |
| | | { |
| | | global $app, $conf; |
| | |
| | | if($this->searchChanged == 1) $_SESSION['search'][$list_name]['page'] = 0; |
| | | |
| | | $sql_von = $app->functions->intval($_SESSION['search'][$list_name]['page'] * $records_per_page); |
| | | $record_count = $app->db->queryOneRecord("SELECT count(*) AS anzahl FROM $table".($app->listform->listDef['additional_tables'] != ''? ','.$app->listform->listDef['additional_tables'] : '')." WHERE $sql_where"); |
| | | $record_count = $app->db->queryOneRecord("SELECT count(*) AS anzahl FROM ??".($app->listform->listDef['additional_tables'] != ''? ','.$app->listform->listDef['additional_tables'] : '')." WHERE $sql_where", $table); |
| | | $pages = $app->functions->intval(($record_count['anzahl'] - 1) / $records_per_page); |
| | | |
| | | |
| | |
| | | |
| | | sort($show_pages); |
| | | $show_pages = array_unique($show_pages); |
| | | |
| | | |
| | | $content = '<nav> |
| | | <ul class="pagination">'; |
| | | |
| | | //* Show Back |
| | | if(isset($vars['show_page_back']) && $vars['show_page_back'] == 1){ |
| | | $content = '<a class="btn-page first-page" href="'."javascript:loadContent('".$vars['list_file'].'?page=0'.$vars['page_params']."');".'">' |
| | | .'<img src="themes/'.$_SESSION['s']['theme'].'/icons/x16/arrow_stop_180.png"></a> '; |
| | | $content .= '<a class="btn-page previous-page" href="'."javascript:loadContent('".$vars['list_file'].'?page='.$vars['last_page'].$vars['page_params']."');".'">' |
| | | .'<img src="themes/'.$_SESSION['s']['theme'].'/icons/x16/arrow_180.png"></a> '; |
| | | $content .= '<li><a href="#" data-load-content="'.$vars['list_file'].'?page=0'.$vars['page_params'].'" aria-label="First"> |
| | | <span aria-hidden="true">«</span></a></li>'; |
| | | $content .= '<li><a href="#" data-load-content='.$vars['list_file'].'?page='.$vars['last_page'].$vars['page_params'].'" aria-label="Previous"> |
| | | <span aria-hidden="true">‹</span></a></li>'; |
| | | } |
| | | $content .= ' '.$this->lng('page_txt').' '; |
| | | $prev = -1; |
| | | foreach($show_pages as $p) { |
| | | if($prev != -1 && $p > $prev + 1) $content .= '<span class="page-spacer">...</span>'; |
| | | $content .= '<a class="link-page' . ($p == $vars['page'] ? ' current-page' : '') . '" href="'."javascript:loadContent('".$vars['list_file'].'?page='.$p.$vars['page_params']."');".'">'. ($p+1) .'</a>'; |
| | | if($prev != -1 && $p > $prev + 1) $content .= '<li class="disabled"><a href="#">…</a></li>'; |
| | | $content .= '<li' . ($p == $vars['page'] ? ' class="active"' : '') . '><a href="#" data-load-content="'.$vars['list_file'].'?page='.$p.$vars['page_params'].'">'. ($p+1) .'</a></li>'; |
| | | $prev = $p; |
| | | } |
| | | //.$vars['next_page'].' '.$this->lng('page_of_txt').' '.$vars['max_pages'].' '; |
| | | //* Show Next |
| | | if(isset($vars['show_page_next']) && $vars['show_page_next'] == 1){ |
| | | $content .= '<a class="btn-page next-page" href="'."javascript:loadContent('".$vars['list_file'].'?page='.$vars['next_page'].$vars['page_params']."');".'">' |
| | | .'<img src="themes/'.$_SESSION['s']['theme'].'/icons/x16/arrow.png"></a> '; |
| | | $content .= '<a class="btn-page last-page" href="'."javascript:loadContent('".$vars['list_file'].'?page='.$vars['pages'].$vars['page_params']."');".'">' |
| | | .'<img src="themes/'.$_SESSION['s']['theme'].'/icons/x16/arrow_stop.png"></a>'; |
| | | $content .= '<li><a href="#" data-load-content="'.$vars['list_file'].'?page='.$vars['next_page'].$vars['page_params'].'" aria-label="Next"> |
| | | <span aria-hidden="true">›</span></a></li>'; |
| | | $content .= '<li><a href="#" data-load-content="'.$vars['list_file'].'?page='.$vars['pages'].$vars['page_params'].'" aria-label="Last"> |
| | | <span aria-hidden="true">»</span></a></li>'; |
| | | } |
| | | $content .= '</ul></nav>'; |
| | | |
| | | return $content; |
| | | } |
| | | |
| | |
| | | } |
| | | return $record; |
| | | } |
| | | |
| | | |
| | | /* TODO: check double quoting of SQL */ |
| | | public function encode($record) |
| | | { |
| | | global $app; |