HEX
Server: Apache
System: Linux v38079.2is.nl 3.10.0-1160.119.1.el7.x86_64 #1 SMP Tue Jun 4 14:43:51 UTC 2024 x86_64
User: democfellows (10015)
PHP: 8.1.34
Disabled: opcache_get_status
Upload Files
File: /var/www/vhosts/creativefellows.nl/test.creativefellows.nl/e-pact/views/view.pagination.about.php
<?php

	/*
	 * Get Header
	 */
	$header_top_color = 'no-header-transition';
	require_once 'inc/header.php';
	
	
	/*
	 * Paginate items
	 */
	$html = '<div class="grid-x grid-padding-x grid-margin-x">';
		
		$html .= '<div class="small-12 cell text-center">';
			$html .= '<h1>'. $data["section_name"] .'</h1>';
		$html .= '</div>';
		
		$html .= '<div class="small-12 cell white-background">';
			$html .= '<div class="grid-x grid-padding-x">';
			
			
			foreach($data["page"] as $page)
			{		
						
				switch($page->getProperty("template")){
			
					case 1:
						$text_field = $page->getProperty("contents");
					break;
		
					default:
						$text_field = $page->getProperty("tekst");
					break;
				}
				
				
				$html .= '<div class="small-12 medium-3 cell view-epact">';
				
					$html .= $page->getProperty("image","img");
				
					$html .= '<h3><a href="'. $page->getProperty("entry_link") .'">'. $page->getProperty("titel") .'</a></h3>';		
					$html .= $page->getProperty("subtitel","h5");	
				
					$html .= '<p>';
					$html .= '<span class="hide-after-4-lines">';
						$html .= $data["config"]->makeIntro($text_field,350,false," &hellip;");
					$html .= '</span>';
					$html .= '<a href="'. $page->getProperty("entry_link") .'" class="overlay-button">&raquo; Lees verder</a>';
					$html .= '</p>';
				
				$html .= '</div>';
					
			}			
		
			$html .= '</div>';
		$html .= '</div>';
	
	
	$html .= '</div>';
	
	
	/*
	 * Output 
	 */
	echo $data["config"]->wrapAsSection($html);
	
	
	/*
	 * Pagination 
	 */
	if($data["pagination"]["pagination_count"] > 1)
	{
		
		if($data["category_name"]) $page_link = $router->pathFor('cassette.viewCategory', ['name' => $data["section_name"], "category"=> $data["category_name"]]);
		else $page_link = $router->pathFor('cassette.viewSection', ['name' => $data["section_name"]]); 
		
		
		//$page_link 		= $router->pathFor('cassette.viewCategory', ['name' => $data["section_name"], "category"=> $data["category_name"]]);
		
		$current_page	= (isset($_GET["p"])) ? $_GET["p"] : 1;
		$hide_first 	= false;
		$hide_last 		= false;	

		$html = '<ul class="pagination">';
			$start 	= $data["pagination"]["pagination_count"] > 20 ? $data["pagination"]["current_page"]-10 : 1;
			$end 	= $data["pagination"]["pagination_count"] > 20 ? ($data["pagination"]["current_page"]+10) : $data["pagination"]["pagination_count"];

			if($start <= 1)
			{
				$hide_first = true;
				$start = 1;	
			}
	
			if($end >= $data["pagination"]["pagination_count"])
			{
				$hide_last = true;	
				$end = $data["pagination"]["pagination_count"];
			}
		
			// previous page
			if($data["pagination"]["current_page"] == 1) $html .= '<li class="pagination-previous disabled">Previous <span class="show-for-sr">page</span></li>';
			else $html .= '<li class="pagination-previous"><a href="'. $page_link . $data["pagination"]["previous_page"] .'" aria-label="Next page">Previous <span class="show-for-sr">page</span></a></li>';
		
			// loop pages
			for($i=$start; $i<= $end; $i++)
			{	
				if($data["pagination"]["current_page"] == $i || !isset($data["pagination"]["current_page"]) && $i == 1) $html .= '<li><span class="current">'.$i.'</span></li>';
				else $html .= '<li><a href="'. $page_link . $i .'">'.$i.'</a></li>';	
			}
	
			// next page
			if($data["pagination"]["current_page"] == $data["pagination"]["pagination_count"]) $html .= '<li class="pagination-next disabled">Next <span class="show-for-sr">page</span></li>';
			else $html .= '<li class="pagination-next"><a href="'. $page_link . $data["pagination"]["next_page"] .'" aria-label="Next page">Next <span class="show-for-sr">page</span></a></li>';
		
		$html .= '</ul>';
	
		echo $data["config"]->wrapAsSection($html,"","page-pagination");
	}

	
	/*
	 * Get Footer
	 */
	require_once 'inc/footer.php';
	
?>