version 1.332, 2012/11/27 23:45:08
|
version 1.339, 2012/12/22 14:45:35
|
Line 209 dependencies for a web page uploaded dir
|
Line 209 dependencies for a web page uploaded dir
|
=cut |
=cut |
|
|
sub dependencycheck_js { |
sub dependencycheck_js { |
my ($symb,$title,$url) = @_; |
my ($symb,$title,$url,$folderpath,$uri) = @_; |
my $link = '/adm/dependencies?symb='.&HTML::Entities::encode($symb,'<>&"'). |
my $link; |
'&title='.&HTML::Entities::encode($title,'<>&"'). |
if ($symb) { |
'&url='.&HTML::Entities::encode($url,'<>&"'); |
$link = '/adm/dependencies?symb='.&HTML::Entities::encode($symb,'<>&"'); |
|
} elsif ($folderpath) { |
|
$link = '/adm/dependencies?folderpath='.&HTML::Entities::encode($folderpath,'<>&"'); |
|
$url = $uri; |
|
} |
|
$link .= (($link=~/\?/)?'&':'?').'title='. |
|
&HTML::Entities::encode($title,'<>&"'); |
|
if ($url) { |
|
$link .= '&url='.&HTML::Entities::encode($url,'<>&"'); |
|
} |
return <<ENDJS; |
return <<ENDJS; |
<script type="text/javascript"> |
<script type="text/javascript"> |
// <![CDATA[ |
// <![CDATA[ |
Line 1387 sub htmlareaselectactive {
|
Line 1396 sub htmlareaselectactive {
|
# is used to determine when the countdown timer turns red to warn the user |
# is used to determine when the countdown timer turns red to warn the user |
# to think about submitting. |
# to think about submitting. |
|
|
my $dueDateLayout = &mt('Due in: {dn} {dl} {hnn}{sep}{mnn}{sep}{snn} [_1]',"<span id='submitearly'></span>"); |
my $dueDateLayout = &mt('Due in: {dn} {dl} {hnn}{sep}{mnn}{sep}{snn} [_1]', |
|
"<span id='submitearly'></span>"); |
my $early = '- <b>'.&mt('Submit Early').'</b>'; |
my $early = '- <b>'.&mt('Submit Early').'</b>'; |
my $pastdue = '- <b>'.&mt('Past Due').'</b>'; |
my $pastdue = '- <b>'.&mt('Past Due').'</b>'; |
$output .= <<JAVASCRIPT; |
$output .= <<JAVASCRIPT; |
Line 1751 returns: nothing
|
Line 1761 returns: nothing
|
.$links |
.$links |
; |
; |
} |
} |
|
my $nav_and_tools = 0; |
&render_tools(\$links); |
foreach my $item ('navigation','tools') { |
$links = &htmltag('div', $links, |
if (ref($tools{$item}) eq 'ARRAY') { |
{ id => "LC_breadcrumbs" }) unless ($CourseBreadcrumbs) ; |
$nav_and_tools += scalar(@{$tools{$item}}) |
&render_advtools(\$links); |
} |
|
} |
|
if (($links ne '') || ($nav_and_tools)) { |
|
&render_tools(\$links); |
|
$links = &htmltag('div', $links, |
|
{ id => "LC_breadcrumbs" }) unless ($CourseBreadcrumbs) ; |
|
} |
|
my $adv_tools = 0; |
|
if (ref($tools{'advtools'}) eq 'ARRAY') { |
|
$adv_tools = scalar(@{$tools{'advtools'}}); |
|
} |
|
if (($links ne '') || ($adv_tools)) { |
|
&render_advtools(\$links); |
|
} |
|
|
# Return the @Crumbs stack to what we started with |
# Return the @Crumbs stack to what we started with |
push(@Crumbs,$last); |
push(@Crumbs,$last); |
Line 1886 returns: nothing
|
Line 1909 returns: nothing
|
sub docs_breadcrumbs { |
sub docs_breadcrumbs { |
my ($allowed,$crstype,$contenteditor,$title,$precleared)=@_; |
my ($allowed,$crstype,$contenteditor,$title,$precleared)=@_; |
my ($folderpath,@folders); |
my ($folderpath,@folders); |
if ($env{'form.pagepath'}) { |
my @folders = split('&',$env{'form.folderpath'}); |
@folders = split('&',$env{'form.pagepath'}); |
|
} else { |
|
@folders = split('&',$env{'form.folderpath'}); |
|
} |
|
my $plain=''; |
my $plain=''; |
|
my $container = 'sequence'; |
my ($randompick,$isencrypted,$ishidden,$is_random_order) = (-1,0,0,0); |
my ($randompick,$isencrypted,$ishidden,$is_random_order) = (-1,0,0,0); |
my @docs_crumbs; |
my @docs_crumbs; |
while (@folders) { |
while (@folders) { |
Line 1907 sub docs_breadcrumbs {
|
Line 1927 sub docs_breadcrumbs {
|
} |
} |
$url .= &escape($folderpath); |
$url .= &escape($folderpath); |
my $name=&unescape($foldername); |
my $name=&unescape($foldername); |
# each of randompick number, hidden, encrypted, random order are |
# each of randompick number, hidden, encrypted, random order, is_page |
# appended with ":"s to the foldername |
# are appended with ":"s to the foldername |
$name=~s/\:(\d*)\:(\w*)\:(\w*):(\d*)$//; |
$name=~s/\:(\d*)\:(\w*)\:(\w*):(\d*)\:?(\d*)$//; |
if ($contenteditor) { |
if ($contenteditor) { |
if ($1 ne '') { |
if ($1 ne '') { |
$randompick=$1; |
$randompick=$1; |
Line 1919 sub docs_breadcrumbs {
|
Line 1939 sub docs_breadcrumbs {
|
if ($2) { $ishidden=1; } |
if ($2) { $ishidden=1; } |
if ($3) { $isencrypted=1; } |
if ($3) { $isencrypted=1; } |
if ($4 ne '') { $is_random_order = 1; } |
if ($4 ne '') { $is_random_order = 1; } |
|
if ($5 == 1) {$container = 'page'; } |
} |
} |
if ($folder eq 'supplemental') { |
if ($folder eq 'supplemental') { |
$name = &mt('Supplemental '.$crstype.' Contents'); |
$name = &mt('Supplemental '.$crstype.' Contents'); |
Line 1933 sub docs_breadcrumbs {
|
Line 1954 sub docs_breadcrumbs {
|
'no_mt' => 1, |
'no_mt' => 1, |
}); |
}); |
} |
} |
|
if ($title) { |
|
push(@docs_crumbs, |
|
{'title' => $title, |
|
'text' => $title, |
|
'no_mt' => 1,} |
|
); |
|
} |
if (wantarray) { |
if (wantarray) { |
unless ($precleared) { |
unless ($precleared) { |
&clear_breadcrumbs(); |
&clear_breadcrumbs(); |
} |
} |
&add_breadcrumb(@docs_crumbs); |
&add_breadcrumb(@docs_crumbs); |
if ($title) { |
|
&add_breadcrumb({text => $title}); |
|
} |
|
if ($contenteditor) { |
if ($contenteditor) { |
$plain=~s/\>\;\s*$//; |
$plain=~s/\>\;\s*$//; |
} |
} |
Line 1951 sub docs_breadcrumbs {
|
Line 1976 sub docs_breadcrumbs {
|
return (&breadcrumbs(undef,undef,$menulink,'nohelp',undef,undef, |
return (&breadcrumbs(undef,undef,$menulink,'nohelp',undef,undef, |
$contenteditor), |
$contenteditor), |
$randompick,$ishidden,$isencrypted,$plain, |
$randompick,$ishidden,$isencrypted,$plain, |
$is_random_order); |
$is_random_order,$container); |
} else { |
} else { |
return \@docs_crumbs; |
return \@docs_crumbs; |
} |
} |
Line 3014 PARAMSONE
|
Line 3039 PARAMSONE
|
} |
} |
if ((chkh == 1) || (listwchange)) { |
if ((chkh == 1) || (listwchange)) { |
var primaryheight = document.getElementById('LC_nav_bar').offsetHeight; |
var primaryheight = document.getElementById('LC_nav_bar').offsetHeight; |
var secondaryheight = document.getElementById('LC_secondary_menu').offsetHeight; |
var secondaryheight; |
|
if (document.getElementById('LC_secondary_menu') != null) { |
|
secondaryheight = document.getElementById('LC_secondary_menu').offsetHeight; |
|
} |
var crumbsheight = document.getElementById('LC_breadcrumbs').offsetHeight; |
var crumbsheight = document.getElementById('LC_breadcrumbs').offsetHeight; |
var dccidheight = 0; |
var dccidheight = 0; |
if (document.getElementById('dccid') != null) { |
if (document.getElementById('dccid') != null) { |
Line 3105 ENDUTILITY
|
Line 3133 ENDUTILITY
|
|
|
sub jump_to_editres { |
sub jump_to_editres { |
my ($cfile,$home,$switchserver,$forceedit,$forcereg,$symb,$folderpath, |
my ($cfile,$home,$switchserver,$forceedit,$forcereg,$symb,$folderpath, |
$title,$idx,$suppurl) = @_; |
$title,$idx,$suppurl,$todocs) = @_; |
my $jscall; |
my $jscall; |
if ($switchserver) { |
if ($switchserver) { |
if ($home) { |
if ($home) { |
Line 3149 sub jump_to_editres {
|
Line 3177 sub jump_to_editres {
|
if ($forcereg) { |
if ($forcereg) { |
$cfile .= (($cfile=~/\?/)?'&':'?').'register=1'; |
$cfile .= (($cfile=~/\?/)?'&':'?').'register=1'; |
} |
} |
|
if ($todocs) { |
|
$cfile .= (($cfile=~/\?/)?'&':'?').'todocs=1'; |
|
} |
} |
} |
$jscall = "go('$cfile')"; |
$jscall = "go('$cfile')"; |
} |
} |
Line 3521 sub funclist_from_array {
|
Line 3552 sub funclist_from_array {
|
{ listattr => {class => 'LC_funclist'} }); |
{ listattr => {class => 'LC_funclist'} }); |
} |
} |
|
|
|
=pod |
|
|
|
=item &actionbox( \@array ) |
|
|
|
Constructs a XHTML list from \@array with the first item being visually |
|
highlighted and set to the value 'Actions'. The list is wrapped in a division. |
|
|
|
The actionlist is used to offer contextual actions, mostly at the bottom |
|
of a page, on which the outcome of an processed action is shown, |
|
e.g. a file operation in Construction Space. |
|
|
|
=over |
|
|
|
=item \@array |
|
|
|
A reference to the array containing text. Details: sub funclist_from_array |
|
|
|
=back |
|
|
|
Returns: XHTML div as string. |
|
|
|
=back |
|
|
|
=cut |
|
|
|
sub actionbox { |
|
my ($items) = @_; |
|
return unless(ref($items) eq 'ARRAY'); |
|
return |
|
'<div class="LC_actionbox">' |
|
.&funclist_from_array($items, {legend => &mt('Actions')}) |
|
.'</div>'; |
|
} |
|
|
1; |
1; |
|
|
__END__ |
__END__ |