|
Lines 46-51
BEGIN {
Link Here
|
| 46 |
&GetSupportName &GetSupportList |
46 |
&GetSupportName &GetSupportList |
| 47 |
&get_itemtypeinfos_of |
47 |
&get_itemtypeinfos_of |
| 48 |
&getframeworks &getframeworkinfo |
48 |
&getframeworks &getframeworkinfo |
|
|
49 |
&GetFrameworksLoop |
| 49 |
&getauthtypes &getauthtype |
50 |
&getauthtypes &getauthtype |
| 50 |
&getallthemes |
51 |
&getallthemes |
| 51 |
&getFacets |
52 |
&getFacets |
|
Lines 363-374
build a HTML select with the following code :
Link Here
|
| 363 |
|
364 |
|
| 364 |
=head3 in PERL SCRIPT |
365 |
=head3 in PERL SCRIPT |
| 365 |
|
366 |
|
| 366 |
my $frameworks = frameworks(); |
367 |
my $frameworks = getframeworks(); |
| 367 |
my @frameworkloop; |
368 |
my @frameworkloop; |
| 368 |
foreach my $thisframework (keys %$frameworks) { |
369 |
foreach my $thisframework (keys %$frameworks) { |
| 369 |
my $selected = 1 if $thisframework eq $frameworkcode; |
370 |
my $selected = 1 if $thisframework eq $frameworkcode; |
| 370 |
my %row =(value => $thisframework, |
371 |
my %row =( |
| 371 |
selected => $selected, |
372 |
value => $thisframework, |
|
|
373 |
selected => $selected, |
| 372 |
description => $frameworks->{$thisframework}->{'frameworktext'}, |
374 |
description => $frameworks->{$thisframework}->{'frameworktext'}, |
| 373 |
); |
375 |
); |
| 374 |
push @frameworksloop, \%row; |
376 |
push @frameworksloop, \%row; |
|
Lines 377-390
build a HTML select with the following code :
Link Here
|
| 377 |
|
379 |
|
| 378 |
=head3 in TEMPLATE |
380 |
=head3 in TEMPLATE |
| 379 |
|
381 |
|
| 380 |
<form action='<!-- TMPL_VAR name="script_name" -->' method=post> |
382 |
<form action="[% script_name %] method=post> |
| 381 |
<select name="frameworkcode"> |
383 |
<select name="frameworkcode"> |
| 382 |
<option value="">Default</option> |
384 |
<option value="">Default</option> |
| 383 |
<!-- TMPL_LOOP name="frameworkloop" --> |
385 |
[% FOREACH framework IN frameworkloop %] |
| 384 |
<option value="<!-- TMPL_VAR name="value" -->" <!-- TMPL_IF name="selected" -->selected<!-- /TMPL_IF -->><!-- TMPL_VAR name="frameworktext" --></option> |
386 |
[% IF ( framework.selected ) %] |
| 385 |
<!-- /TMPL_LOOP --> |
387 |
<option value="[% framework.value %]" selected="selected">[% framework.description %]</option> |
|
|
388 |
[% ELSE %] |
| 389 |
<option value="[% framework.value %]">[% framework.description %]</option> |
| 390 |
[% END %] |
| 391 |
[% END %] |
| 386 |
</select> |
392 |
</select> |
| 387 |
<input type=text name=searchfield value="<!-- TMPL_VAR name="searchfield" -->"> |
393 |
<input type=text name=searchfield value="[% searchfield %]"> |
| 388 |
<input type="submit" value="OK" class="button"> |
394 |
<input type="submit" value="OK" class="button"> |
| 389 |
</form> |
395 |
</form> |
| 390 |
|
396 |
|
|
Lines 403-408
sub getframeworks {
Link Here
|
| 403 |
return ( \%itemtypes ); |
409 |
return ( \%itemtypes ); |
| 404 |
} |
410 |
} |
| 405 |
|
411 |
|
|
|
412 |
=head2 GetFrameworksLoop |
| 413 |
|
| 414 |
$frameworks = GetFrameworksLoop( $frameworkcode ); |
| 415 |
|
| 416 |
Returns the loop suggested on getframework(), but ordered by framework description. |
| 417 |
|
| 418 |
build a HTML select with the following code : |
| 419 |
|
| 420 |
=head3 in PERL SCRIPT |
| 421 |
|
| 422 |
$template->param( frameworkloop => GetFrameworksLoop( $frameworkcode ) ); |
| 423 |
|
| 424 |
=head3 in TEMPLATE |
| 425 |
|
| 426 |
Same as getframework() |
| 427 |
|
| 428 |
<form action="[% script_name %] method=post> |
| 429 |
<select name="frameworkcode"> |
| 430 |
<option value="">Default</option> |
| 431 |
[% FOREACH framework IN frameworkloop %] |
| 432 |
[% IF ( framework.selected ) %] |
| 433 |
<option value="[% framework.value %]" selected="selected">[% framework.description %]</option> |
| 434 |
[% ELSE %] |
| 435 |
<option value="[% framework.value %]">[% framework.description %]</option> |
| 436 |
[% END %] |
| 437 |
[% END %] |
| 438 |
</select> |
| 439 |
<input type=text name=searchfield value="[% searchfield %]"> |
| 440 |
<input type="submit" value="OK" class="button"> |
| 441 |
</form> |
| 442 |
|
| 443 |
=cut |
| 444 |
|
| 445 |
sub GetFrameworksLoop { |
| 446 |
my $frameworkcode = shift; |
| 447 |
my $frameworks = getframeworks(); |
| 448 |
my @frameworkloop; |
| 449 |
foreach my $thisframework (sort { uc($frameworks->{$a}->{'frameworktext'}) cmp uc($frameworks->{$b}->{'frameworktext'}) } keys %$frameworks) { |
| 450 |
my $selected = ( $thisframework eq $frameworkcode ) ? 1 : undef; |
| 451 |
my %row = ( |
| 452 |
value => $thisframework, |
| 453 |
selected => $selected, |
| 454 |
description => $frameworks->{$thisframework}->{'frameworktext'}, |
| 455 |
); |
| 456 |
push @frameworkloop, \%row; |
| 457 |
} |
| 458 |
return \@frameworkloop; |
| 459 |
} |
| 460 |
|
| 406 |
=head2 getframeworkinfo |
461 |
=head2 getframeworkinfo |
| 407 |
|
462 |
|
| 408 |
$frameworkinfo = &getframeworkinfo($frameworkcode); |
463 |
$frameworkinfo = &getframeworkinfo($frameworkcode); |