3 * headermenuPlugin Class
5 * Copyright 2012 Franck Villaume - TrivialDev
6 * http://fusionforge.org
8 * This file is part of FusionForge. FusionForge is free software;
9 * you can redistribute it and/or modify it under the terms of the
10 * GNU General Public License as published by the Free Software
11 * Foundation; either version 2 of the Licence, or (at your option)
14 * FusionForge is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
19 * You should have received a copy of the GNU General Public License along
20 * with FusionForge; if not, write to the Free Software Foundation, Inc.,
21 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
27 session_require_global_perm('forge_admin');
29 $linksArray = $headermenu->getAvailableLinks();
30 if (sizeof($linksArray)) {
31 echo $HTML->boxTop(_('Manage available links'));
32 $tabletop = array(_('URL'), _('Displayed Name'), _('Description'), _('Status'), _('Actions'));
33 $classth = array('','','','','unsortable');
34 echo $HTML->listTableTop($tabletop, false, 'sortable_headermenu_listlinks', 'sortable', $classth);
35 foreach ($linksArray as $link) {
37 echo '<td>'.$link['url'].'</td>';
38 echo '<td>'.$link['name'].'</td>';
39 echo '<td>'.$link['description'].'</td>';
40 if ($link['is_enable']) {
41 echo '<td>'.html_image('docman/validate.png', 22, 22, array('alt'=>_('link is on'), 'class'=>'tabtitle', 'title'=>_('link is on'))).'</td>';
42 echo '<td><a class="tabtitle-ne" title="'._('Desactivate this link').'" href="index.php?type=globaladmin&action=updateLinkStatus&linkid='.$link['id_headermenu'].'&linkstatus=0">'.html_image('docman/release-document.png', 22, 22, array('alt'=>_('Desactivate this link'))). '</a>';
44 echo '<td>'.html_image('docman/delete-directory.png', 22, 22, array('alt'=>_('link is off'), 'class'=>'tabtitle', 'title'=>_('link is off'))).'</td>';
45 echo '<td><a class="tabtitle-ne" title="'._('Activate this link').'" href="index.php?type=globaladmin&action=updateLinkStatus&linkid='.$link['id_headermenu'].'&linkstatus=1">'.html_image('docman/reserve-document.png', 22, 22, array('alt'=>_('Activate this link'))). '</a>';
47 echo '<a class="tabtitle-ne" title="'._('Delete this link').'" href="index.php?type=globaladmin&action=deleteLink&linkid='.$link['id_headermenu'].'">'.html_image('docman/trash-empty.png',22,22, array('alt'=>_('Delete this link'))). '</a>';
51 echo $HTML->listTableBottom();
52 echo $HTML->boxBottom();
56 echo '<form method="POST" name="addLink" action="index.php?type=globaladmin&action=addLink">';
58 echo $HTML->boxTop(_('Add a new link'));
59 echo '<td>'._('URL').'</td><td><input name="link" type="text" maxsize="255" /></td>';
61 echo '<td>'._('Displayed Name').'</td><td><input name="name" type="text" maxsize="255" /></td>';
63 echo '<td>'._('Description').'</td><td><input name="description" type="text" maxsize="255" /></td>';
66 echo '<input type="submit" value="'. _('Add') .'" />';
68 echo $HTML->boxBottom();