Location: PHPKode > projects > JaxBlog > JaxBlog/app/admin/admin_files/admin_files_list.php
<?php

require_once('../../../config.php');
require_once(FOLDER_RELATIVE_COMMON . 'authorization.php');
require_once(FOLDER_RELATIVE_COMMON . 'database.php');

// Check for XML request (XMLHttpRequest).
$request = isset($_GET['request']) ? $_GET['request'] : '';
if ($request == 'xml') {
	
	// Get all files
	$sql = 'SELECT id, parent_id, stamp, is_file, title, path FROM Files ORDER BY parent_id, is_file, id';
	$rows = databaseGetRows($sql, array());
	
	header('Content-Type: text/xml');
	$xml = '<?xml version="1.0" encoding="UTF-8" standalone="yes"?>' . "\n";
	$xml .= '<root>' . "\n";
	
	foreach ($rows as $row) {
		$xml .= '	<record>' . "\n";
		$xml .= '		<id>' . $row['id'] . '</id>' . "\n";
		$xml .= '		<parent_id>' . $row['parent_id'] . '</parent_id>' . "\n";
		$xml .= '		<is_leaf>' . $row['is_file'] . '</is_leaf>' . "\n";
		$xml .= '		<title>' . $row['title'] . '</title>' . "\n";
		$xml .= '		<path>' . $row['path'] . '</path>' . "\n";
		$xml .= '	</record>' . "\n";
	}
	$xml .= '</root>' . "\n";
	echo $xml;
	exit;
}


// Show the pages list form.
require_once(FOLDER_RELATIVE_COMMON . 'builder-admin.php');

$header   = '<script type="text/javascript">';
$header  .= 'jaxTreeShowAdd("admin_files.php");';
$header  .= 'jaxTreeShowEdit("admin_files.php");';
$header  .= 'jaxTreeShowDelete("admin_files.php");';
$header  .= 'jaxTreeDisableEditTopLevelNonLeafs();';
$header  .= '</script>' . "\n";
$onload   = "jaxTreeRegister('admin_files_list.php?request=xml', 'filelist');";
$title    = 'Files';
$content  = 'admin_files_list.html';
$page     = buildAdminPage($header, $onload, $title, $content);

echo $page;

?>
Return current item: JaxBlog