Exemplo n.º 1
0
function _showTemplateTree()
{
    global $Logs;
    $aTemps = admin_getAllTemps();
    //$Logs->addLog($aTemps,"aPages");
    ?>
	<h3>Templates</h3>
	<table border="1">
		<thead>
		<tr>
			<td>Name</td>
			<td>Parent Template</td>
			<td>Time created / last modified</td>
			<td>Javascript files</td>
			<td>CSS files</td>
			<td>&nbsp;</td>
		</tr>
		</thead>
<?php 
    foreach ($aTemps as $temp) {
        if (!is_null($temp['parentid'])) {
            $parent = admin_getTempData($temp['parentid']);
            $parent_name = $parent['name'];
        } else {
            $parent_name = '---';
        }
        //var_dump($temp);
        ?>
		<tr>
			<th><?php 
        print $temp['name'];
        ?>
</th>
			<td><?php 
        print $parent_name;
        ?>
</td>
			<td>
				<?php 
        print getDateToPrintFromDb($temp['timecreated']);
        print "/<br />" . getDateToPrintFromDb($temp['timemodified']);
        ?>
			</td>
			<td><?php 
        print str_replace(',', '<br />', $temp['js']);
        ?>
</td>
			<td><?php 
        print str_replace(',', '<br />', $temp['css']);
        ?>
</td>
			<td>
				<a href="<?php 
        getUrl('admin');
        ?>
?action=edittemplate&id=<?php 
        print $temp['id'];
        ?>
">edit</a>
			</td>
		</tr>
<?php 
    }
    ?>
	</table>
<?php 
}
Exemplo n.º 2
0
    $Logs->addLog($Check->isValid(), 'valid');
    //$Logs->addLog($Check->getErrors(),'errors');
    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>