This repository has been archived on 2020-06-13. You can view files and clone it, but cannot push or open issues/pull-requests.
penguincoder.org-horde/lib/PenguinCoder.php

30 lines
1.2 KiB
PHP
Raw Normal View History

2020-02-18 10:47:46 -05:00
<?php
class PenguinCoder
{
function getMenu($returnType = 'object')
{
global $registry, $conf;
require_once 'Horde/Menu.php';
$menu = &new Menu();
$menu->add(Horde::applicationUrl('index.php', true, 1.), _("/home"), 'home.png');
$menu->add(Horde::applicationUrl('journal.php', true, 1.), _("Archive"), 'journal.png');
$menu->add(Util::addParameter(Util::addParameter(Horde::applicationUrl('data.php', true, 1.), 'category', 'Machine'), 'title', _("Machines")), _("Machines"), 'machine.png');
$menu->add(Util::addParameter(Util::addParameter(Horde::applicationUrl('data.php', true, 1.), 'category', 'About'), 'title', _("About")), _("About"), 'about.png');
$menu->add(Horde::applicationUrl('rss.php', true), _("RSS"), 'rss.png');
if ($returnType == 'object') {
return $menu;
}
return $menu->render();
}
function fileUrl($filename)
{
if(is_null($filename) || !file_exists(escapeshellcmd($filename)))
return '';
return Horde::url($registry->get('webroot') . '/fileset/' .
escapeshellcmd($filename), true, -1);
}
}