41 lines
1.4 KiB
PHP
41 lines
1.4 KiB
PHP
<?php
|
|
@define('PENGUINCODER_BASE', dirname(__FILE__));
|
|
require PENGUINCODER_BASE . '/lib/base.php';
|
|
|
|
$category = Util::getFormData('category');
|
|
$title = Util::getFormData('title');
|
|
if (empty($category) || empty($title)) {
|
|
header('Location: ' . Horde::applicationUrl('index.php', true));
|
|
}
|
|
|
|
$admin = Auth::getAuth('penguincoder:admin');
|
|
$adminDelete = Auth::getAuth('penguincoder:admin', PERMS_DELETE);
|
|
$appUrl = Horde::applicationUrl('journal.php');
|
|
|
|
global $pdata;
|
|
$data = $pdata->getByCategory($category);
|
|
if (is_a($data, 'PEAR_Error')) {
|
|
$notification->push("There was a problem getting the information: " .
|
|
$data->getMessage(), 'horde.error');
|
|
} elseif (!count($data)) {
|
|
$notification->push("No content was found, try again later (:^)");
|
|
}
|
|
|
|
require PENGUINCODER_TEMPLATES . '/common-header.inc';
|
|
require PENGUINCODER_TEMPLATES . '/menu/menu.inc';
|
|
|
|
if (is_array($data)) {
|
|
foreach ($data as $entry) {
|
|
require PENGUINCODER_TEMPLATES . '/data/header.inc';
|
|
if($admin) {
|
|
require PENGUINCODER_TEMPLATES . '/actions/header.inc';
|
|
require PENGUINCODER_TEMPLATES . '/actions/admin.inc';
|
|
require PENGUINCODER_TEMPLATES . '/actions/footer.inc';
|
|
}
|
|
require PENGUINCODER_TEMPLATES . '/data/data.inc';
|
|
require PENGUINCODER_TEMPLATES . '/data/footer.inc';
|
|
}
|
|
}
|
|
echo '<p> </p>';
|
|
require $registry->get('templates', 'horde') . '/common-footer.inc';
|