version 1.392, 2009/10/16 18:50:18
|
version 1.393, 2009/10/16 19:00:44
|
Line 1032 sub breadcrumbs {
|
Line 1032 sub breadcrumbs {
|
if ($3) { $isencrypted=1; } |
if ($3) { $isencrypted=1; } |
if ($4 ne '') { $is_random_order = 1; } |
if ($4 ne '') { $is_random_order = 1; } |
if ($folder eq 'supplemental') { |
if ($folder eq 'supplemental') { |
if ($allowed) { |
$name = &mt('Supplemental '.$type.' Documents'); |
$name = &mt('Supplemental '.$type.' Documents'); |
|
} else { |
|
$name = &mt($type.' Documents'); |
|
} |
|
} |
} |
&Apache::lonhtmlcommon::add_breadcrumb( |
&Apache::lonhtmlcommon::add_breadcrumb( |
{'href'=>$url.$cpinfo, |
{'href'=>$url.$cpinfo, |
Line 1493 sub handle_edit_cmd {
|
Line 1489 sub handle_edit_cmd {
|
|
|
sub editor { |
sub editor { |
my ($r,$coursenum,$coursedom,$folder,$allowed,$upload_output,$type)=@_; |
my ($r,$coursenum,$coursedom,$folder,$allowed,$upload_output,$type)=@_; |
|
|
my $container= ($env{'form.pagepath'}) ? 'page' |
my $container= ($env{'form.pagepath'}) ? 'page' |
: 'sequence'; |
: 'sequence'; |
|
|
Line 1632 sub editor {
|
Line 1627 sub editor {
|
$shown++; |
$shown++; |
} |
} |
if ($shown) { |
if ($shown) { |
$r->print(&Apache::loncommon::start_data_table() |
$r->print(&Apache::loncommon::start_data_table()); |
.&Apache::loncommon::start_data_table_header_row() |
if ($allowed) { |
.'<th colspan="2">'.&mt('Move').'</th>' |
$r->print(&Apache::loncommon::start_data_table_header_row() |
.'<th>'.&mt('Actions').'</th>' |
.'<th colspan="2">'.&mt('Move').'</th>' |
.'<th colspan="2">'.&mt('Document').'</th>' |
.'<th>'.&mt('Actions').'</th>' |
.'<th colspan="4">'.&mt('Settings').'</th>' |
.'<th colspan="2">'.&mt('Document').'</th>'); |
.&Apache::loncommon::end_data_table_header_row() |
if ($folder !~ /^supplemental/) { |
.$output |
$->print('<th colspan="4">'.&mt('Settings').'</th>'); |
.&Apache::loncommon::end_data_table() |
} |
) |
$r->print(&Apache::loncommon::end_data_table_header_row()); |
} |
} |
unless($shown) { |
$r->print($output |
|
.&Apache::loncommon::end_data_table() |
|
); |
|
} else { |
$r->print('<p class="LC_info">' |
$r->print('<p class="LC_info">' |
.&mt('Currently no documents.') |
.&mt('Currently no documents.') |
.'</p>' |
.'</p>' |
Line 1793 sub parse_supplemental_title {
|
Line 1791 sub parse_supplemental_title {
|
|
|
sub entryline { |
sub entryline { |
my ($index,$title,$url,$folder,$allowed,$residx,$coursenum)=@_; |
my ($index,$title,$url,$folder,$allowed,$residx,$coursenum)=@_; |
|
|
my ($foldertitle,$pagetitle,$renametitle); |
my ($foldertitle,$pagetitle,$renametitle); |
if (&is_supplemental_title($title)) { |
if (&is_supplemental_title($title)) { |
($title,$foldertitle,$renametitle) = &parse_supplemental_title($title); |
($title,$foldertitle,$renametitle) = &parse_supplemental_title($title); |
Line 3008 HIDDENFORM
|
Line 3005 HIDDENFORM
|
$activeClass = 0; |
$activeClass = 0; |
} |
} |
} |
} |
if($env{'request.role'}=~/^cc/){ |
if ($allowed){ |
$r->print('<li '.$active.' onclick="javascript:showPage(this,\'mainCourseDocuments\',\'mainnav\',\'maincoursedoc\');"><a href="#"><b>'.&mt('Main Course Documents').'</b></a></li>'); |
$r->print('<li '.$active.' onclick="javascript:showPage(this,\'mainCourseDocuments\',\'mainnav\',\'maincoursedoc\');"><a href="#"><b>'.&mt('Main Course Documents').'</b></a></li>'); |
} |
} |
$active = ''; |
$active = ''; |
if (!$forcestandard || ($env{'form.folderpath'}=~/^supplemental/)) { |
if (!$forcestandard || ($env{'form.folderpath'}=~/^supplemental/)) { |
Line 3027 HIDDENFORM
|
Line 3024 HIDDENFORM
|
if($activeClass == 0){ |
if($activeClass == 0){ |
$active = 'style="display: block;"'; |
$active = 'style="display: block;"'; |
} |
} |
if($env{'request.role'}=~/^cc/){ |
if ($allowed) { |
$r->print('<div class="LC_ContentBox" id="mainCourseDocuments" '.$active.'>'); |
$r->print('<div class="LC_ContentBox" id="mainCourseDocuments" '.$active.'>'); |
my $folder=$env{'form.folder'}; |
my $folder=$env{'form.folder'}; |
if ($folder eq '' || $folder=~/^supplemental/) { |
if ($folder eq '' || $folder=~/^supplemental/) { |
Line 3288 $r->print('</div>');
|
Line 3285 $r->print('</div>');
|
(($env{'form.folderpath'} =~ /^default\&/) || ($env{'form.folderpath'} eq ''))) { |
(($env{'form.folderpath'} =~ /^default\&/) || ($env{'form.folderpath'} eq ''))) { |
$env{'form.folderpath'} = 'supplemental&'. |
$env{'form.folderpath'} = 'supplemental&'. |
&escape(&mt('Supplemental '.$type.' Documents')); |
&escape(&mt('Supplemental '.$type.' Documents')); |
}else{ |
} elsif ($allowed) { |
$env{'form.folderpath'} = $savefolderpath; |
$env{'form.folderpath'} = $savefolderpath; |
} |
} |
$env{'form.pagepath'} = ''; |
$env{'form.pagepath'} = ''; |
Line 3374 my %suporderhash = (
|
Line 3371 my %suporderhash = (
|
'ff' => ['Special Documents',create_form_ul(create_list_elements(@specialdocs))] |
'ff' => ['Special Documents',create_form_ul(create_list_elements(@specialdocs))] |
); |
); |
|
|
my $tid='2'; |
my $error = &editor($r,$coursenum,$coursedom,$folder,$allowed,'',$type); |
my $varscd = 'Supplemental Course Documents'; |
if ($error) { |
my $error = &editor($r,$coursenum,$coursedom,$folder,$allowed,'',$type); |
$r->print('<p><span class="LC_error">'.$error.'</span></p>'); |
if ($error) { |
|
$r->print('<p><span class="LC_error">'.$error.'</span></p>'); |
|
} |
} |
$r->print(&generate_edit_table($tid,$varscd,\%suporderhash)); |
my $tid='2'; |
} |
my $varscd = 'Supplemental Course Documents'; |
|
$r->print(&generate_edit_table($tid,$varscd,\%suporderhash)); |
|
} else { |
|
my $error = &editor($r,$coursenum,$coursedom,$folder,$allowed,'',$type); |
|
if ($error) { |
|
$r->print('<p><span class="LC_error">'.$error.'</span></p>'); |
|
} |
|
} |
|
|
|
|
$r->print('</div>'); |
$r->print('</div>'); |