3 * headermenu : viewProjectConfiguration page
5 * Copyright 2012-2013, 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.
30 <script type="text/javascript">//<![CDATA[
31 var controllerGroupMenu;
33 jQuery(document).ready(function() {
34 controllerGroupMenu = new GroupMenuController({
35 inputHtmlCode: jQuery('#typemenu_htmlcode'),
36 inputURL: jQuery('#typemenu_url'),
37 trHtmlCode: jQuery('#trhtmlcode'),
38 trUrlCode: jQuery('#urlcode'),
39 trIframeView: jQuery('#iframe'),
40 tableTbodyLink: jQuery('#sortable').find('tbody'),
41 validateButton: jQuery('#linkordervalidatebutton'),
42 groupId: '<?php echo $group_id ?>',
43 headerMenuUrl: '<?php util_make_uri("/plugins/headermenu") ?>',
44 validMessage: '<?php echo _('Link Order successfully validated') ?>',
45 errorMessage: '<?php echo _('Error in Link Order validation') ?>'
52 $linksArray = $headermenu->getAvailableLinks('groupmenu', $group_id);
53 if (sizeof($linksArray)) {
54 echo '<h2>'._('Manage available tabs')."</h2>\n";
55 echo '<p class="information">'. _('You can reorder tabs, just drag & drop rows in the table below and save order. Please note that those extra tabs can only appear after the standard tabs. And you can only move them inside the set of extra tabs.').'</p>';
56 $tabletop = array(_('Order'), _('Tab Type'), _('Displayed Name'), _('Description'), _('Status'), _('Actions'));
57 $classth = array('', '', '', '', '', 'unsortable');
58 echo $HTML->listTableTop($tabletop, false, 'sortable_headermenu_listlinks', 'sortable', $classth);
59 foreach ($linksArray as $link) {
60 echo '<tr id="'.$link['id_headermenu'].'" ><td>'.$link['ordering']."</td>\n";
61 if (strlen($link['url']) > 0) {
63 if ($link['linktype'] == 'iframe') {
64 echo ' '._('displayed as iframe');
66 echo ' ('.htmlspecialchars($link['url']).")</td>\n";
68 echo '<td>'._('HTML Page')."</td>\n";
70 echo '<td>'.htmlspecialchars($link['name'])."</td>\n";
71 echo '<td>'.htmlspecialchars($link['description'])."</td>\n";
72 if ($link['is_enable']) {
73 echo '<td>'.html_image('docman/validate.png', 22, 22, array('alt'=>_('link is on'), 'class'=>'tabtitle', 'title'=>_('link is on')))."</td>\n";
74 echo '<td><a class="tabtitle-ne" title="'._('Desactivate this link').'" href="index.php?type=projectadmin&group_id='.$group_id.'&action=updateLinkStatus&linkid='.$link['id_headermenu'].'&linkstatus=0">'.html_image('docman/release-document.png', 22, 22, array('alt'=>_('Desactivate this link'))). '</a>';
76 echo '<td>'.html_image('docman/delete-directory.png', 22, 22, array('alt'=>_('link is off'), 'class'=>'tabtitle', 'title'=>_('link is off')))."</td>\n";
77 echo '<td><a class="tabtitle-ne" title="'._('Activate this link').'" href="index.php?type=projectadmin&group_id='.$group_id.'&action=updateLinkStatus&linkid='.$link['id_headermenu'].'&linkstatus=1">'.html_image('docman/reserve-document.png', 22, 22, array('alt'=>_('Activate this link'))). '</a>';
79 echo '<a class="tabtitle-ne" title="'._('Edit this link').'" href="index.php?type=projectadmin&group_id='.$group_id.'&view=updateLinkValue&linkid='.$link['id_headermenu'].'">'.html_image('docman/edit-file.png',22,22, array('alt'=>_('Edit this link'))). '</a>';
80 echo '<a class="tabtitle-ne" title="'._('Delete this link').'" href="index.php?type=projectadmin&group_id='.$group_id.'&action=deleteLink&linkid='.$link['id_headermenu'].'">'.html_image('docman/trash-empty.png',22,22, array('alt'=>_('Delete this link'))). '</a>';
84 echo $HTML->listTableBottom();
85 echo '<input type="button" id="linkordervalidatebutton" value="'._('Save Order').'" style="display:none;" />';
89 echo '<h2>'._('Add new tab')."</h2>\n";
90 echo '<p class="information">'._('You can add your own tabs in the menu bar with the form below.').'</p>';
91 echo '<form method="POST" name="addLink" action="index.php?type=projectadmin&group_id='.$group_id.'&action=addLink">';
92 echo '<table class="infotable">'."\n";
94 echo '<td>'._('Displayed Name').utils_requiredField()._(':')."</td>\n";
95 echo '<td><input required="required" name="name" type="text" maxlength="255" /></td>';
97 echo '<td>'._('Description')._(':').'</td><td><input name="description" type="text" maxlength="255" /></td>';
99 echo '<td>'._('Tab Type')._(':').'</td><td>';
100 $texts = array('URL', 'HTML Page');
101 $vals = array('url', 'htmlcode');
102 $select_name = 'typemenu';
103 echo html_build_radio_buttons_from_arrays($vals, $texts, $select_name, 'url', false);
105 echo '</tr>'."\n".'<tr id="trhtmlcode" style="display:none">';
106 echo '<td>'._('HTML Page').utils_requiredField()._(':').'</td><td>';
108 $params['name'] = 'htmlcode';
109 $params['body'] = _('Just paste your code here...');
110 $params['width'] = "800";
111 $params['height'] = "500";
112 $params['content'] = '<textarea name="htmlcode" rows="5" cols="80">'.$params['body'].'</textarea>';
113 plugin_hook_by_reference("text_editor", $params);
114 echo $params['content'];
116 echo '</td></tr><tr id="urlcode" >';
117 echo '<td>'._('URL').utils_requiredField()._(':').'</td><td><input name="link" type="text" maxlength="255" /></td>';
118 echo '</tr><tr id="iframe" >';
119 echo '<td colspan="2"><input name="iframeview" type="checkbox" value="1" />Display URL as iframe</td>';
121 echo '<td colspan="2">';
122 echo '<input type="hidden" name="linkmenu" value="groupmenu" />';
123 echo '<input type="submit" value="'. _('Add') .'" />';
124 echo '</td></tr></table>';
127 echo utils_requiredField().' '._('Indicates required fields.');