version 1.314, 2008/10/08 17:19:18
|
version 1.315, 2008/11/17 14:46:10
|
Line 26
|
Line 26
|
# http://www.lon-capa.org/ |
# http://www.lon-capa.org/ |
# |
# |
|
|
|
|
|
=head1 NAME |
|
|
|
Apache::londocs |
|
|
|
=head1 SYNOPSIS |
|
|
|
This is part of the LearningOnline Network with CAPA project |
|
described at http://www.lon-capa.org. |
|
|
|
=head1 SUBROUTINES |
|
|
|
=over |
|
|
|
=cut |
|
|
package Apache::londocs; |
package Apache::londocs; |
|
|
use strict; |
use strict; |
Line 53 my %alreadyseen=();
|
Line 69 my %alreadyseen=();
|
|
|
my $hadchanges; |
my $hadchanges; |
|
|
# Available help topics |
|
|
=pod |
|
|
|
=item %help=() |
|
|
|
Available help topics |
|
|
|
=cut |
|
|
my %help=(); |
my %help=(); |
|
|
# Mapread read maps into LONCAPA::map:: global arrays |
=pod |
# @order and @resources, determines status |
|
# sets @order - pointer to resources in right order |
=item mapread() |
# sets @resources - array with the resources with correct idx |
|
# |
Mapread read maps into LONCAPA::map:: global arrays |
|
@order and @resources, determines status |
|
sets @order - pointer to resources in right order |
|
sets @resources - array with the resources with correct idx |
|
|
|
=cut |
|
|
sub mapread { |
sub mapread { |
my ($coursenum,$coursedom,$map)=@_; |
my ($coursenum,$coursedom,$map)=@_; |
Line 81 sub storemap {
|
Line 109 sub storemap {
|
return ($errtext,0); |
return ($errtext,0); |
} |
} |
|
|
# ----------------------------------------- Return hash with valid author names |
|
|
=pod |
|
|
|
=item authorhosts() |
|
|
|
Return hash with valid author names |
|
|
|
=cut |
|
|
sub authorhosts { |
sub authorhosts { |
my %outhash=(); |
my %outhash=(); |
Line 116 sub authorhosts {
|
Line 151 sub authorhosts {
|
} |
} |
return ($home,$other,%outhash); |
return ($home,$other,%outhash); |
} |
} |
# ------------------------------------------------------ Generate "dump" button |
=pod |
|
|
|
=item dumpbutton() |
|
|
|
Generate "dump" button |
|
|
|
=cut |
|
|
sub dumpbutton { |
sub dumpbutton { |
my ($home,$other,%outhash)=&authorhosts(); |
my ($home,$other,%outhash)=&authorhosts(); |
Line 141 sub clean {
|
Line 182 sub clean {
|
$title=~s/[^\w\/\!\$\%\^\*\-\_\=\+\;\:\,\\\|\`\~]+/\_/gs; |
$title=~s/[^\w\/\!\$\%\^\*\-\_\=\+\;\:\,\\\|\`\~]+/\_/gs; |
return $title; |
return $title; |
} |
} |
# -------------------------------------------------------- Actually dump course |
|
|
=pod |
|
|
|
=item dumpcourse() |
|
|
|
Actually dump course |
|
|
|
=cut |
|
|
sub dumpcourse { |
sub dumpcourse { |
my ($r) = @_; |
my ($r) = @_; |
Line 263 sub dumpcourse {
|
Line 311 sub dumpcourse {
|
} |
} |
} |
} |
|
|
# ------------------------------------------------------ Generate "export" button |
=pod |
|
|
|
=item exportbutton() |
|
|
|
Generate "export" button |
|
|
|
=cut |
|
|
sub exportbutton { |
sub exportbutton { |
my $type = &Apache::loncommon::course_type(); |
my $type = &Apache::loncommon::course_type(); |
Line 273 sub exportbutton {
|
Line 327 sub exportbutton {
|
&Apache::loncommon::help_open_topic('Docs_Export_Course_Docs').'</div>'; |
&Apache::loncommon::help_open_topic('Docs_Export_Course_Docs').'</div>'; |
} |
} |
|
|
|
=pod |
|
|
|
=item exportcourse() |
|
|
|
=cut |
|
|
sub exportcourse { |
sub exportcourse { |
my $r=shift; |
my $r=shift; |
my $type = &Apache::loncommon::course_type(); |
my $type = &Apache::loncommon::course_type(); |
Line 911 sub store_template {
|
Line 971 sub store_template {
|
} |
} |
} |
} |
|
|
# Imports the given (name, url) resources into the course |
=pod |
# coursenum, coursedom, and folder must precede the list |
|
|
=item group_import() |
|
|
|
Imports the given (name, url) resources into the course |
|
coursenum, coursedom, and folder must precede the list |
|
|
|
=cut |
|
|
sub group_import { |
sub group_import { |
my ($coursenum, $coursedom, $folder, $container, $caller, @files) = @_; |
my ($coursenum, $coursedom, $folder, $container, $caller, @files) = @_; |
|
|
Line 1073 sub log_docs {
|
Line 1140 sub log_docs {
|
} |
} |
} |
} |
|
|
|
=pod |
|
|
|
=item docs_change_log() |
|
|
|
=cut |
|
|
# |
|
# Docs Change Log |
|
# |
|
sub docs_change_log { |
sub docs_change_log { |
my ($r)=@_; |
my ($r)=@_; |
my $folder=$env{'form.folder'}; |
my $folder=$env{'form.folder'}; |
Line 1964 ENDPARMS
|
Line 2033 ENDPARMS
|
return $line; |
return $line; |
} |
} |
|
|
# ---------------------------------------------------------------- tie the hash |
=pod |
|
|
|
=item tiehash() |
|
|
|
tie the hash |
|
|
|
=cut |
|
|
sub tiehash { |
sub tiehash { |
my ($mode)=@_; |
my ($mode)=@_; |
Line 1990 sub untiehash {
|
Line 2065 sub untiehash {
|
return OK; |
return OK; |
} |
} |
|
|
# --------------------------------------------------------------- check on this |
|
|
=pod |
|
|
|
=item checkonthis() |
|
|
|
check on this |
|
|
|
=cut |
|
|
|
|
sub checkonthis { |
sub checkonthis { |
my ($r,$url,$level,$title)=@_; |
my ($r,$url,$level,$title)=@_; |
Line 2064 sub checkonthis {
|
Line 2147 sub checkonthis {
|
} |
} |
|
|
|
|
# |
|
# ----------------------------------------------------------------- List Symbs |
=pod |
# |
|
|
=item list_symbs() |
|
|
|
List Symbs |
|
|
|
=cut |
|
|
sub list_symbs { |
sub list_symbs { |
my ($r) = @_; |
my ($r) = @_; |
|
|
Line 2082 sub list_symbs {
|
Line 2171 sub list_symbs {
|
} |
} |
|
|
|
|
# |
=pod |
# -------------------------------------------------------------- Verify Content |
|
# |
=item verifycontent() |
|
|
|
Verify Content |
|
|
|
=cut |
|
|
sub verifycontent { |
sub verifycontent { |
my ($r) = @_; |
my ($r) = @_; |
my $type = &Apache::loncommon::course_type(); |
my $type = &Apache::loncommon::course_type(); |
Line 2114 sub verifycontent {
|
Line 2208 sub verifycontent {
|
&mt('Return to DOCS').'</a>'); |
&mt('Return to DOCS').'</a>'); |
} |
} |
|
|
|
=pod |
|
|
# -------------------------------------------------------------- Check Versions |
=item devalidateversioncache() & checkversions() |
|
|
|
Check Versions |
|
|
|
=cut |
|
|
sub devalidateversioncache { |
sub devalidateversioncache { |
my $src=shift; |
my $src=shift; |
Line 2419 sub changewarning {
|
Line 2518 sub changewarning {
|
$help{'Caching'}.'</span></h3></form>'."\n\n"); |
$help{'Caching'}.'</span></h3></form>'."\n\n"); |
} |
} |
|
|
# =========================================== Breadcrumbs for special functions |
=pod |
|
|
|
=item init_breadcrumbs() |
|
|
|
Breadcrumbs for special functions |
|
|
|
=cut |
|
|
sub init_breadcrumbs { |
sub init_breadcrumbs { |
my ($form,$text)=@_; |
my ($form,$text)=@_; |
Line 2435 sub init_breadcrumbs {
|
Line 2540 sub init_breadcrumbs {
|
bug=>'Instructor Interface'}); |
bug=>'Instructor Interface'}); |
} |
} |
|
|
# ================================================================ Main Handler |
|
|
=pod |
|
|
|
=item handler() |
|
|
|
Main Handler |
|
|
|
=cut |
|
|
sub handler { |
sub handler { |
my $r = shift; |
my $r = shift; |
&Apache::loncommon::content_type($r,'text/html'); |
&Apache::loncommon::content_type($r,'text/html'); |
Line 3340 ENDNEWSCRIPT
|
Line 3453 ENDNEWSCRIPT
|
} |
} |
1; |
1; |
__END__ |
__END__ |
|
|
|
=pod |
|
|
|
=back |
|
|
|
=cut |