29 lines
		
	
	
		
			710 B
		
	
	
	
		
			PHP
		
	
	
		
			Executable File
		
	
	
	
	
			
		
		
	
	
			29 lines
		
	
	
		
			710 B
		
	
	
	
		
			PHP
		
	
	
		
			Executable File
		
	
	
	
	
<?php
 | 
						|
 | 
						|
require '../header.php';
 | 
						|
 | 
						|
$data = array();
 | 
						|
$data['links'] = array();
 | 
						|
$links = WebLink::getList();
 | 
						|
foreach ( $links as $link ) {
 | 
						|
   $row = array();
 | 
						|
   $row['id'] = $link->getID();
 | 
						|
   $row['url'] = $link->getURL();
 | 
						|
   $row['url_safe'] = $link->getURL(HTMLSAFE);
 | 
						|
   $row['title'] = $link->getTitle();
 | 
						|
   $row['title_safe'] = $link->getTitle(HTMLSAFE);
 | 
						|
   $row['description'] = $link->getDescription();
 | 
						|
   $row['description_safe'] = $link->getDescription(HTMLSAFE);
 | 
						|
   $data['links'][] = $row;
 | 
						|
}
 | 
						|
$data['canedit'] = $_SESSION['validated'];
 | 
						|
 | 
						|
pushData($data);
 | 
						|
exit();
 | 
						|
 | 
						|
function pushData($data) {
 | 
						|
   header('Content-Type: application/json');
 | 
						|
   echo json_encode($data);
 | 
						|
   exit();
 | 
						|
}
 |