function _showPageTree() { global $Logs; $aPages = admin_getAllPages(); //$Logs->addLog($aPages,"aPages"); ?> <h3>Pages</h3> <table border="1"> <thead> <tr> <td rowspan="2">Name</td> <td>Template(id)</td> <td>Use cache</td> <td>User</td> <td>Time created / last modified</td> <td>Published</td> <td rowspan="2"> </td> </tr> <tr> <td>Language</td> <td>Url</td> <td>Title</td> <td colspan="2">Title in menu</td> </tr> </thead> <?php foreach ($aPages as $page) { //var_dump($page); $editTemp = "<a href=''"; ?> <tr> <th rowspan="<?php print count($page['lng']) + 1; ?> "><?php print $page['name']; ?> </th> <td> <a title="edit template" href="<?php getUrl('admin'); ?> ?action=edittemplate&id=<?php print $page['template']; ?> "> <?php print $page['tempname']; ?> </a> </td> <td><?php print $page['usecache']; ?> </td> <td><?php print $page['user']; ?> </td> <td> <?php print getDateToPrintFromDb($page['timecreated']); print "/<br />" . getDateToPrintFromDb($page['timecreated']); ?> </td> <td><?php print $page['published']; ?> </td> <td rowspan="<?php print count($page['lng']) + 1; ?> "> <a href="<?php getUrl('admin'); ?> ?action=editpage&id=<?php print $page['id']; ?> ">edit</a> </td> </tr> <?php foreach ($page['lng'] as $lng => $aLng) { ?> <tr> <td><?php print !is_string($lng) ? "-all-" : $lng; ?> </td> <td><?php print $aLng['url']; ?> </td> <td><?php print $aLng['title']; ?> </td> <td colspan="2"><?php print !strlen($aLng['menutitle']) ? $aLng['title'] : $aLng['menutitle']; ?> </td> </tr> <?php } } ?> </table> <?php }
if (!$Check->isValid()) { foreach ($Check->getErrors() as $k => $error) { $aErrors[] = admin_getErrorToPrint($k, $error); } $result = false; } else { $result = add_insertNewPage(); } if ($result) { $aAlerts[] = "Page was added."; } $Logs->addLog($result, 'new page RESULT'); } $allTemps = admin_getAllTemps(); $Logs->addLog($allTemps, "allTemps"); $allPages = admin_getAllPages(); //add_getAllPages(); $Logs->addLog($allPages, "allPages"); ########################################################################################### ##################################### code to print ####################################### foreach ($aErrors as $error) { print "<div class='error'>{$error}</div>"; } foreach ($aAlerts as $alert) { print "<div class='alert'>{$alert}</div>"; } ?> <form action="" name="form_add" method="post"> <fieldset> <h3>Create template / Select existing template</h3> <fieldset>