Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 871a70f0

Von Moritz Bunkus vor fast 12 Jahren hinzugefügt

Menüsysteme v3 & v4 verschmolzen (Stil von v4, Name & Code von v3)

Unterschiede anzeigen:

SL/Auth.pm
489 489
    @user_data{qw(id login)}    = @{$ref}{qw(id login)};
490 490
  }
491 491

  
492
  # The XUL/XML backed menu has been removed.
493
  $user_data{menustyle} = 'v3' if lc($user_data{menustyle} || '') eq 'xml';
492
  # The XUL/XML & 'CSS new' backed menus have been removed.
493
  my %menustyle_map = ( xml => 'new', v4 => 'v3' );
494
  $user_data{menustyle} = $menustyle_map{lc($user_data{menustyle} || '')} || $user_data{menustyle};
494 495

  
495 496
  # Set default language if selected language does not exist (anymore).
496 497
  $user_data{countrycode} = $::lx_office_conf{system}->{language} unless $user_data{countrycode} && -d "locale/$user_data{countrycode}";
SL/Form.pm
3581 3581
  my %style_to_script_map = (
3582 3582
    v3  => 'v3',
3583 3583
    neu => 'new',
3584
    v4  => 'v4',
3585 3584
  );
3586 3585

  
3587 3586
  my $menu_script = $style_to_script_map{$::myconfig{menustyle}} || '';
SL/Layout/Dispatcher.pm
6 6
use SL::Layout::Login;
7 7
use SL::Layout::Classic;
8 8
use SL::Layout::V3;
9
use SL::Layout::V4;
10 9
use SL::Layout::Javascript;
11 10

  
12 11
sub new {
......
14 13

  
15 14
  return SL::Layout::Classic->new    if $params{style} eq 'old';
16 15
  return SL::Layout::V3->new         if $params{style} eq 'v3';
17
  return SL::Layout::V4->new         if $params{style} eq 'v4';
18 16
  return SL::Layout::Javascript->new if $params{style} eq 'neu';
19 17
  return SL::Layout::Admin->new      if $params{style} eq 'admin';
20 18
  return SL::Layout::Login->new      if $params{style} eq 'login';
SL/Layout/Top.pm
24 24

  
25 25
=head1 NAME
26 26

  
27
SL::Layout::Top - Top line in classic and v4 menu.
27
SL::Layout::Top - Top line in classic and v3 menu.
28 28

  
29 29
=head1 DOM MODEL
30 30

  
SL/Layout/V4.pm
1
package SL::Layout::V4;
2

  
3
use strict;
4
use parent qw(SL::Layout::Base);
5
use SL::Layout::Css;
6
use SL::Layout::Top;
7

  
8
use URI;
9

  
10
sub init_sub_layouts {
11
  [
12
    SL::Layout::Top->new,
13
    SL::Layout::None->new,
14
  ]
15
}
16

  
17
sub start_content {
18
  "<div id='content'>\n";
19
}
20

  
21
sub end_content {
22
  "</div>\n";
23
}
24

  
25
sub pre_content {
26
  my ($self) = @_;
27

  
28
  $self->{sub_class} = 1;
29

  
30
  my $callback            = $::form->unescape($::form->{callback});
31
  $callback               = URI->new($callback)->rel($callback) if $callback;
32
  $callback               = "login.pl?action=company_logo"      if $callback =~ /^(\.\/)?$/;
33

  
34
  $self->SUPER::pre_content .
35

  
36
  $self->SUPER::render('menu/menuv4', { no_menu => 1, no_output => 1 },
37
    force_ul_width => 1,
38
    date           => $self->clock_line,
39
    menu           => $self->print_menu,
40
    callback       => $callback,
41
  );
42
}
43

  
44
1;
bin/mozilla/admin.pl
80 80
my @all_menustyles = (
81 81
  { id => 'old', title => $::locale->text('Old (on the side)') },
82 82
  { id => 'v3',  title => $::locale->text('Top (CSS)') },
83
  { id => 'v4',  title => $::locale->text('Top (CSS) new') },
84 83
  { id => 'neu', title => $::locale->text('Top (Javascript)') },
85 84
);
86 85

  
......
380 379
sub add_user {
381 380
  $::form->{title}   = "kivitendo " . $::locale->text('Administration') . " / " . $::locale->text('Add User');
382 381

  
383
# Note: Menu Style 'v3' is not compatible to all browsers!
384
# "menustyle"    => "old" sets the HTML Menu to default.
385
# User does not have a well behaved new constructor, so we#Ll just have to build one ourself
382
  # User does not have a well behaved new constructor, so we'll just have to build one ourself
386 383
  my $user     = bless {
387 384
    "vclimit"      => 200,
388 385
    "countrycode"  => "de",
389 386
    "numberformat" => "1.000,00",
390 387
    "dateformat"   => "dd.mm.yy",
391 388
    "stylesheet"   => "kivitendo.css",
392
    "menustyle"    => "old",
389
    "menustyle"    => "neu",
393 390
    dbport         => $::auth->{DB_config}->{port} || 5432,
394 391
    dbuser         => $::auth->{DB_config}->{user} || 'lxoffice',
395 392
    dbhost         => $::auth->{DB_config}->{host} || 'localhost',
css/Mobile/menuv4.css
1
../lx-office-erp/menuv4.css
css/kivitendo/menu.css
4 4
whiteMenu Hover background color #FFFFE0
5 5
DarkGreensubenu pointer
6 6
*/
7
body.menuv4 {
8
	behavior: url("css/csshover.htc");
9
	/*font-size: 14pt;*/
10
	line-height: 20pt;
11
	font-family: Verdana, Geneva, Tahoma, sans-serif;
12
	background-color: #FFFFFF;
13
	color: #000000;
14
}
15
#menuv4 {
16
	/*font-size: 85%;*/
17
	width: 99.8%;
18
	float: left;
19
	/*border: 3px solid;*/
20
	background-color: #FFFFFF;
21
	color: #000000;
22
}
23
#menuv4 a, #menuv4 h2, #menuv4 div.x {
24
	font-size: 80%;
25
	line-height: 120%;
26
	display: block;
27
	border: 0;
28
	white-space: nowrap;
29
	margin: 0;
30
	padding: 0.3em 1em;
31
}
32
#menuv4 h2 {
33
	background-color: #ffffff;
34
	color: #000000;
35
	/*padding: 2px 15px;*/
36
/* Firefox */
37
	-moz-border-radius: 0.4em 0.4em 0;
38
/* Safari, Chrome */
39
	-webkit-border-radius: 0.4em 0.4em 0;
40
/* Konqueror */
41
	-khtml-border-radius: 0.4em 0.4em 0;
42
/* CSS3 */
43
	border-radius: 0.4em 0.4em 0 0;
44
/* 	behavior: url(border-radius.htc); */
45
}
46
#menuv4 ul:hover h2 {
47
	background-color:#DCDCDC;
48
}
49
#menuv4 a, #menuv4 a:visited, #menuv4 div.x, #menuv4 div.x:visited {
50
	color: #000000;
51
	text-decoration: none;
52
	padding-right: 10px;
53
}
54
#menuv4 a {
55
	background: #EBEBEB;
56
}
57
#menuv4 div.x, #menuv4 div.x:visited {
58
	background-color: #EBEBEB;
59
	border-right: 1em solid #FE5F14;
60
}
61
#menuv4 div.x:hover {
62
	border-right: none;
63
}
64
#menuv4 a:hover, #menuv4 div.x:hover {
65
	color: #FE5F14;
66
	background-color: #EBEBEB;
67
}
68
#menuv4 a:active, #menuv4 div.x:active {
69
	color: #FE5F14;
70
	background-color: #EBEBEB;
71
}
72
#menuv4 ul {
73
	list-style: none;
74
	margin: 0;
75
	padding: 0;
76
	float: left;
77
}
78

  
79
#menuv4 li {
80
	position: relative;
81
	float: none;
82
	border: 0;
83
}
84
li.sub {
85
	position: relativ;
86
	left: 0.2em;
87
	top: 0px;
88
	background-color: #FFFFFF;
89
}
90
/* IE6 spacing bug fix, <li>s without a bottom border get spaced to far  * correction:the bug will change the height of the parent element! this will also cause the whole menu to grow  * so the only method to get this pile of crap going is to add a bottom border to the <li>s, where the enclosing <ul> already has * a bottom border, which just looks ugly * the trick:color the bottom border with the same color as the bottom pixel of the background image - noone notices */
91
#menuv4 ul li {
92
	/* border: solid;
93
	border-color: #991900;
94
	border-width: 0 0 1px 0;
95
*/
96
}
97
#menuv4 ul ul {
98
	padding: 0 2em 2em 2em;
99
	margin: 0 -2em -2em -2em;
100
}
101
#menuv4 ul ul li {
102
	/*padding-top: 0.01em;*/
103
	background-color: #FFFFFF;
104
}
105
/* IE6 event bug fix, without a background there hovers will be occassionally lost between the li's to the layer below  * causing the menu to close. Opera 9 has the same bug btw. */
106
#menuv4 ul ul {
107
	position: absolute;
108
	z-index: 500;
109
	top: auto;
110
	display: none;
111
}
112
#menuv4 ul ul ul {
113
	top: 0;
114
	left: 99%;
115
	padding: 2em;
116
	margin: -2em;
117
}
118
#menuv4 ul ul ul li {
119
	border-left: 0.2em solid #EBEBEB;
120
}
121
/* Begin non-anchor hover selectors */
122
/* Enter the more specific element (div) selectoron non-anchor hovers for IE5.x to comply with theolder version of csshover.htc - V1.21.041022. Itimproves IE's performance speed to use the olderfile and this method */
123
div#menuv4 h2:hover {
124
	background: #EBEBEB;
125
	color: #FE5F14;
126
}
127
div#menuv4 li:hover {
128
	cursor: pointer;
129
	z-index: 100;
130
}
131
div#menuv4 li:hover ul ul, div#menuv4 li li:hover ul ul, div#menuv4 li li li:hover ul ul, div#menuv4 li li li li:hover ul ul {
132
	display: none;
133
}
134
div#menuv4 li:hover ul, div#menuv4 li li:hover ul, div#menuv4 li li li:hover ul, div#menuv4 li li li li:hover ul {
135
	display: block;
136
	position: relativ: left: 10px;
137
}
138
/* End of non-anchor hover selectors */
139

  
140 7
body.menuv3 {
141 8
	behavior: url("css/csshover.htc");
142 9
	/*font-size: 14pt;*/
......
152 19
	/*border: 3px solid;*/
153 20
	background-color: #FFFFFF;
154 21
	color: #000000;
155
	margin-top: 0.2em;
156 22
}
157 23
#menuv3 a, #menuv3 h2, #menuv3 div.x {
158 24
	font-size: 80%;
......
163 29
	margin: 0;
164 30
	padding: 0.3em 1em;
165 31
}
166
#menuv3 h2:before {
167
	content: " ";
168
}
169
#menuv3 h2:after {
170
	content: " ";
171
}
172 32
#menuv3 h2 {
173 33
	background-color: #ffffff;
174 34
	color: #000000;
......
277 137
}
278 138
/* End of non-anchor hover selectors */
279 139

  
140
li.sub {
141
	position: relativ;
142
	left: 0.2em;
143
	top: 0px;
144
	background-color: #FFFFFF;
145
}
146

  
280 147
/* html menu */
281 148
/* types of lines: m sm i (menu submenu item)
282 149
   each line is a mi (menuitem) and has one mii (menu-item-icon) whcih is ms (menu-spacer)
......
314 181
body { margin: 0 }
315 182

  
316 183
@media print {
317
  #menuv3, #menuv4, #html-menu, #frame-header, #js-menu {   /* items with this class won't print */
184
  #menuv3, #html-menu, #frame-header, #js-menu {   /* items with this class won't print */
318 185
    display: none;
319 186
  }
320 187
  #content.html-menu { margin-left: 0; }
css/lx-office-erp/menu.css
51 51

  
52 52
#menuv3 h2 {
53 53
color:#fff;
54
padding:0 5px;
54
padding:2px 10px;
55 55
}
56 56

  
57 57
#menuv3 a, #menuv3 a:visited, #menuv3 div.x, #menuv3 div.x:visited {
......
63 63
#menuv3 a {
64 64
background:#eee;
65 65
}
66

  
67 66
#menuv3 div.x, #menuv3 div.x:visited {
68 67
background:#eee url(../../image/right.gif) no-repeat right;
69 68
}
......
83 82
margin:0;
84 83
padding:0;
85 84
float:left;
86
min-width:7em;
87 85
}
88 86

  
89 87
#menuv3 li {
......
119 117

  
120 118
#menuv3 ul ul ul {
121 119
top:0;
122
left:100%;
120
left:90%;
123 121
}
124 122

  
125 123
/* Begin non-anchor hover selectors */
......
154 152

  
155 153
/* End of non-anchor hover selectors */
156 154

  
157
#menuv4 {
158
width:99.8%;
159
float:left;
160
background:url(../../image/bg_css_menu.png) repeat bottom;
161
border:1px solid;
162
border-color:#ccc #888 #555 #bbb;
163
}
164

  
165
#menuv4 a, #menuv4 h2, #menuv4 div.x {
166
font:11px/16px arial,helvetica,sans-serif;
167
display:block;
168
border:0;
169
border-right:1px;
170
border-style:solid;
171
border-color:#ccc #888 #555 #bbb;
172
white-space:nowrap;
173
margin:0;
174
padding:1px 0 1px 3px;
175
}
176

  
177
#menuv4 h2 {
178
color:#fff;
179
padding:2px 10px;
180
}
181

  
182
#menuv4 a, #menuv4 a:visited, #menuv4 div.x, #menuv4 div.x:visited {
183
color:#000;
184
text-decoration:none;
185
padding-right:10px;
186
}
187

  
188
#menuv4 a {
189
background:#eee;
190
}
191
#menuv4 div.x, #menuv4 div.x:visited {
192
background:#eee url(../../image/right.gif) no-repeat right;
193
}
194

  
195
#menuv4 a:hover, #menuv4 div.x:hover {
196
color:#a00;
197
background-color:#ddd;
198
}
199

  
200
#menuv4 a:active, #menuv4 div.x:active {
201
color:#060;
202
background-color:#ccc;
203
}
204

  
205
#menuv4 ul {
206
list-style:none;
207
margin:0;
208
padding:0;
209
float:left;
210
}
211

  
212
#menuv4 li {
213
position:relative;
214
float:none;
215
border:0;
216
}
217

  
218
/* IE6 spacing bug fix, <li>s without a bottom border get spaced to far
219
 * correction: the bug will change the height of the parent element! this will also cause the whole menu to grow
220
 * so the only method to get this pile of crap going is to add a bottom border to the <li>s, where the enclosing <ul> already has
221
 * a bottom border, which just looks ugly
222
 * the trick: color the bottom border with the same color as the bottom pixel of the background image - noone notices */
223
#menuv4 ul li {
224
border:solid;
225
border-color:#ccd5e5;
226
border-width:0 0 1px 0;
227
}
228

  
229
#menuv4 ul ul li {
230
border:solid;
231
border-width:0 0 1px 0;
232
}
233

  
234
/* IE6 event bug fix, without a background there hovers will be occassionally lost between the li's to the layer below
235
 * causing the menu to close. Opera 9 has the same bug btw. */
236
#menuv4 ul ul {
237
position:absolute;
238
z-index:500;
239
top:auto;
240
display:none;
241
}
242

  
243
#menuv4 ul ul ul {
244
top:0;
245
left:90%;
246
}
247

  
248
/* Begin non-anchor hover selectors */
249

  
250
/* Enter the more specific element (div) selector
251
on non-anchor hovers for IE5.x to comply with the
252
older version of csshover.htc - V1.21.041022. It
253
improves IE's performance speed to use the older
254
file and this method */
255

  
256
div#menuv4 h2:hover {
257
background:#A3C5FF;
258
color:#a00;
259
}
260

  
261
div#menuv4 li:hover {
262
cursor:pointer;
263
z-index:100;
264
}
265

  
266
div#menuv4 li:hover ul ul,
267
div#menuv4 li li:hover ul ul,
268
div#menuv4 li li li:hover ul ul,
269
div#menuv4 li li li li:hover ul ul
270
{display:none;}
271

  
272
div#menuv4 li:hover ul,
273
div#menuv4 li li:hover ul,
274
div#menuv4 li li li:hover ul,
275
div#menuv4 li li li li:hover ul
276
{display:block;}
277

  
278
/* End of non-anchor hover selectors */
279

  
280 155
/* html menu */
281 156
/* types of lines: m sm i (menu submenu item)
282 157
   each line is a mi (menuitem) and has one mii (menu-item-icon) whcih is ms (menu-spacer)
......
315 190

  
316 191

  
317 192
@media print {
318
  #menuv3, #menuv4, #html-menu, #frame-header, #js-menu {   /* items with this class won't print */
193
  #menuv3, #html-menu, #frame-header, #js-menu {   /* items with this class won't print */
319 194
    display: none;
320 195
  }
321 196
  #content.html-menu { margin-left: 0; }
locale/de/all
2091 2091
  'To add a user to a group edit a name, change the login name and save.  A new user with the same variables will then be saved under the new login name.' => 'Um einer Gruppe einen neuen Benutzer hinzuzufügen, ändern und speichern Sie am einfachsten einen bestehenden Benutzernamen. Unter dem neuen Namen wird dann ein Benutzer mit denselben Einstellungen angelegt.',
2092 2092
  'Top'                         => 'Oben',
2093 2093
  'Top (CSS)'                   => 'Oben (mit CSS)',
2094
  'Top (CSS) new'               => 'Oben (mit CSS, neu)',
2095 2094
  'Top (Javascript)'            => 'Oben (mit Javascript)',
2096 2095
  'Top 100'                     => 'Top 100',
2097 2096
  'Top 100 hinzufuegen'         => 'Top 100 hinzufügen',
sql/Pg-upgrade2-auth/remove_menustyle_v4.sql
1
-- @tag: remove_menustyle_v4
2
-- @description: Menütyp "CSS (oben, neu)" wurde entfernt; also durch v3 ersetzen
3
-- @depends:
4
-- @charset: utf-8
5
UPDATE auth.user_config
6
SET cfg_value = 'v3'
7
WHERE ((cfg_key   = 'menustyle')
8
  AND  (cfg_value = 'v4'));
templates/webpages/am/config.html
122 122
       <select name="menustyle">
123 123
        <option value="old"[% IF myconfig_menustyle == 'old' %] selected[% END %]>[% 'Old (on the side)' | $T8 %]</option>
124 124
        <option value="v3"[% IF myconfig_menustyle == 'v3' %] selected[% END %]>[% 'Top (CSS)' | $T8 %]</option>
125
        <option value="v4"[% IF myconfig_menustyle == 'v4' %] selected[% END %]>[% 'Top (CSS) new' | $T8 %]</option>
126 125
        <option value="neu"[% IF myconfig_menustyle == 'neu' %] selected[% END %]>[% 'Top (Javascript)' | $T8 %]</option>
127 126
       </select>
128 127
      </td>
......
246 245
      maintab.init();
247 246
    -->
248 247
 </script>
249

  
templates/webpages/menu/menuv4.html
1
[%- USE T8 %]
2
[%- USE HTML %]
3
 <div id="menuv4">
4
  [% menu %]
5
 </div>
6
 <div style="clear: both;"></div>
7

  
8
 <script type="text/javascript">
9
<!--
10
function clockon() {
11
  var now = new Date();
12
  var h = now.getHours();
13
  var m = now.getMinutes();
14
  document.getElementById('clock_id').innerHTML = (h<10?'0'+h:h)+":"+(m<10?'0'+m:m);
15
  var timer=setTimeout("clockon()", 10000);
16
}
17
$(clockon);
18
//-->
19
 </script>

Auch abrufbar als: Unified diff