version 1.500, 2012/10/31 05:10:16
|
version 1.501, 2012/10/31 12:54:13
|
Line 1743 sub handle_edit_cmd {
|
Line 1743 sub handle_edit_cmd {
|
|
|
sub editor { |
sub editor { |
my ($r,$coursenum,$coursedom,$folder,$allowed,$upload_output,$crstype, |
my ($r,$coursenum,$coursedom,$folder,$allowed,$upload_output,$crstype, |
$supplementalflag,$orderhash,$iconpath)=@_; |
$supplementalflag,$orderhash,$iconpath,$uploadtag)=@_; |
my $container= ($env{'form.pagepath'}) ? 'page' |
my $container= ($env{'form.pagepath'}) ? 'page' |
: 'sequence'; |
: 'sequence'; |
|
|
Line 1899 sub editor {
|
Line 1899 sub editor {
|
unless ($name) { $name=(split(/\//,$url))[-1]; } |
unless ($name) { $name=(split(/\//,$url))[-1]; } |
unless ($name) { $idx++; next; } |
unless ($name) { $idx++; next; } |
$output .= &entryline($idx,$name,$url,$folder,$allowed,$res, |
$output .= &entryline($idx,$name,$url,$folder,$allowed,$res, |
$coursenum,$crstype); |
$coursenum,$coursedom,$crstype, |
|
$uploadtag,$supplementalflag); |
$idx++; |
$idx++; |
$shown++; |
$shown++; |
} |
} |
Line 2116 sub is_supplemental_title {
|
Line 2117 sub is_supplemental_title {
|
# --------------------------------------------------------------- An entry line |
# --------------------------------------------------------------- An entry line |
|
|
sub entryline { |
sub entryline { |
my ($index,$title,$url,$folder,$allowed,$residx,$coursenum,$crstype)=@_; |
my ($index,$title,$url,$folder,$allowed,$residx,$coursenum,$coursedom, |
|
$crstype,$uploadtag,$supplementalflag)=@_; |
my ($foldertitle,$pagetitle,$renametitle); |
my ($foldertitle,$pagetitle,$renametitle); |
if (&is_supplemental_title($title)) { |
if (&is_supplemental_title($title)) { |
($title,$foldertitle,$renametitle) = &Apache::loncommon::parse_supplemental_title($title); |
($title,$foldertitle,$renametitle) = &Apache::loncommon::parse_supplemental_title($title); |
Line 2130 sub entryline {
|
Line 2132 sub entryline {
|
|
|
my $orderidx=$LONCAPA::map::order[$index]; |
my $orderidx=$LONCAPA::map::order[$index]; |
|
|
|
|
$renametitle=~s/\\/\\\\/g; |
$renametitle=~s/\\/\\\\/g; |
$renametitle=~s/\"\;/\\\"/g; |
$renametitle=~s/\"\;/\\\"/g; |
$renametitle=~s/ /%20/g; |
$renametitle=~s/ /%20/g; |
Line 2149 sub entryline {
|
Line 2150 sub entryline {
|
$type = $container = 'page'; |
$type = $container = 'page'; |
$esc_path=&escape($env{'form.pagepath'}); |
$esc_path=&escape($env{'form.pagepath'}); |
$path = &HTML::Entities::encode($env{'form.pagepath'},'<>&"'); |
$path = &HTML::Entities::encode($env{'form.pagepath'},'<>&"'); |
$symb=&escape($env{'form.pagesymb'}); |
|
} |
} |
|
if (!$supplementalflag && $residx) { |
|
my $currurl = $url; |
|
$currurl =~ s{^http(|s)(:|:)//}{/adm/wrapper/ext/}; |
|
my $path = 'uploaded/'. |
|
$env{'course.'.$env{'request.course.id'}.'.domain'}.'/'. |
|
$env{'course.'.$env{'request.course.id'}.'.num'}.'/'; |
|
$symb = &Apache::lonnet::encode_symb($path.$folder.".$container", |
|
$residx, |
|
&Apache::lonnet::declutter($currurl)); |
|
} |
|
my %lt; |
if ($allowed) { |
if ($allowed) { |
my $incindex=$index+1; |
my $incindex=$index+1; |
my $selectbox=''; |
my $selectbox=''; |
Line 2173 sub entryline {
|
Line 2184 sub entryline {
|
} |
} |
$selectbox.='</select>'; |
$selectbox.='</select>'; |
} |
} |
my %lt=&Apache::lonlocal::texthash( |
%lt=&Apache::lonlocal::texthash( |
'up' => 'Move Up', |
'up' => 'Move Up', |
'dw' => 'Move Down', |
'dw' => 'Move Down', |
'rm' => 'Remove', |
'rm' => 'Remove', |
'ct' => 'Cut', |
'ct' => 'Cut', |
'rn' => 'Rename', |
'rn' => 'Rename', |
'cp' => 'Copy'); |
'cp' => 'Copy', |
|
'ex' => 'External Resource', |
|
'ed' => 'Edit', |
|
'pr' => 'Preview', |
|
'sv' => 'Save', |
|
'ul' => 'URL', |
|
'ti' => 'Title', |
|
); |
my $nocopy=0; |
my $nocopy=0; |
my $nocut=0; |
my $nocut=0; |
my $noremove=0; |
my $noremove=0; |
Line 2285 END
|
Line 2303 END
|
<td> |
<td> |
<div class="LC_docs_entry_move"> |
<div class="LC_docs_entry_move"> |
<a href='/adm/coursedocs?cmd=up_$index&${type}path=$esc_path&${type}symb=$symb'> |
<a href='/adm/coursedocs?cmd=up_$index&${type}path=$esc_path&${type}symb=$symb'> |
<img src="${iconpath}move_up.gif" alt='$lt{'up'}' class="LC_icon" /> |
<img src="${iconpath}move_up.gif" alt="$lt{'up'}" class="LC_icon" /> |
</a> |
</a> |
</div> |
</div> |
<div class="LC_docs_entry_move"> |
<div class="LC_docs_entry_move"> |
<a href='/adm/coursedocs?cmd=down_$index&${type}path=$esc_path&${type}symb=$symb'> |
<a href='/adm/coursedocs?cmd=down_$index&${type}path=$esc_path&${type}symb=$symb'> |
<img src="${iconpath}move_down.gif" alt='$lt{'dw'}' class="LC_icon" /> |
<img src="${iconpath}move_down.gif" alt="$lt{'dw'}" class="LC_icon" /> |
</a> |
</a> |
</div> |
</div> |
</td> |
</td> |
Line 2341 END
|
Line 2359 END
|
} |
} |
} |
} |
|
|
|
my $editlink; |
my $orig_url = $url; |
my $orig_url = $url; |
$orig_url=~s{http(:|:)//https(:|:)//}{https$2//}; |
$orig_url=~s{http(:|:)//https(:|:)//}{https$2//}; |
my $external = ($url=~s{^http(|s)(:|:)//}{/adm/wrapper/ext/}); |
my $external = ($url=~s{^http(|s)(:|:)//}{/adm/wrapper/ext/}); |
if ((!$isfolder) && ($residx) && ($folder!~/supplemental/) && (!$ispage)) { |
if (!$supplementalflag && $residx && $symb) { |
my $symb=&Apache::lonnet::symbclean( |
if ($container eq 'page') { |
&Apache::lonnet::declutter('uploaded/'. |
$url=&Apache::lonnet::clutter((&Apache::lonnet::decode_symb($symb))[2]); |
$env{'course.'.$env{'request.course.id'}.'.domain'}.'/'. |
$url.=(($url=~/\?/)?'&':'?').'symb='.&escape($symb); |
$env{'course.'.$env{'request.course.id'}.'.num'}.'/'.$folder. |
} |
'.sequence'). |
if ((!$isfolder) && (!$ispage)) { |
'___'.$residx.'___'. |
(undef,undef,$url)=&Apache::lonnet::decode_symb($symb); |
&Apache::lonnet::declutter($url)); |
$url=&Apache::lonnet::clutter($url); |
(undef,undef,$url)=&Apache::lonnet::decode_symb($symb); |
if ($url=~/^\/*uploaded\//) { |
$url=&Apache::lonnet::clutter($url); |
$url=~/\.(\w+)$/; |
if ($url=~/^\/*uploaded\//) { |
my $embstyle=&Apache::loncommon::fileembstyle($1); |
$url=~/\.(\w+)$/; |
if (($embstyle eq 'img') || ($embstyle eq 'emb')) { |
my $embstyle=&Apache::loncommon::fileembstyle($1); |
$url='/adm/wrapper'.$url; |
if (($embstyle eq 'img') || ($embstyle eq 'emb')) { |
} elsif ($embstyle eq 'ssi') { |
$url='/adm/wrapper'.$url; |
#do nothing with these |
} elsif ($embstyle eq 'ssi') { |
} elsif ($url!~/\.(sequence|page)$/) { |
#do nothing with these |
$url='/adm/coursedocs/showdoc'.$url; |
} elsif ($url!~/\.(sequence|page)$/) { |
} |
$url='/adm/coursedocs/showdoc'.$url; |
} elsif ($url=~m|^/ext/|) { |
|
$url='/adm/wrapper'.$url; |
|
$external = 1; |
} |
} |
} elsif ($url=~m|^/ext/|) { |
if (&Apache::lonnet::symbverify($symb,$url)) { |
$url='/adm/wrapper'.$url; |
$url.=(($url=~/\?/)?'&':'?').'symb='.&escape($symb); |
$external = 1; |
} else { |
} |
$url=''; |
if (&Apache::lonnet::symbverify($symb,$url)) { |
} |
$url.=(($url=~/\?/)?'&':'?').'symb='.&escape($symb); |
|
} else { |
|
$url=''; |
|
} |
|
if ($container eq 'page') { |
|
my $symb=$env{'form.pagesymb'}; |
|
|
|
$url=&Apache::lonnet::clutter((&Apache::lonnet::decode_symb($symb))[2]); |
|
$url.=(($url=~/\?/)?'&':'?').'symb='.&escape($symb); |
|
} |
} |
} |
} |
my ($rand_pick_text,$rand_order_text); |
my ($rand_pick_text,$rand_order_text); |
Line 2424 $form_common.'
|
Line 2436 $form_common.'
|
my $folderpath=$env{'form.folderpath'}; |
my $folderpath=$env{'form.folderpath'}; |
if ($folderpath) { $pagepath = $folderpath.'&' }; |
if ($folderpath) { $pagepath = $folderpath.'&' }; |
$pagepath.=$pagearg.'&'.$pagename; |
$pagepath.=$pagearg.'&'.$pagename; |
my $symb=$env{'form.pagesymb'}; |
|
if (!$symb) { |
|
my $path='uploaded/'. |
|
$env{'course.'.$env{'request.course.id'}.'.domain'}.'/'. |
|
$env{'course.'.$env{'request.course.id'}.'.num'}.'/'; |
|
$symb=&Apache::lonnet::encode_symb($path.$folder.'.sequence', |
|
$residx, |
|
$path.$pagearg.'.page'); |
|
} |
|
$url.='pagepath='.&escape($pagepath). |
$url.='pagepath='.&escape($pagepath). |
'&pagesymb='.&escape($symb); |
'&pagesymb='.&escape($symb); |
} |
} |
if (($external) && ($allowed)) { |
if ($allowed) { |
my $form = ($folder =~ /^default/)? 'newext' : 'supnewext'; |
my $fileloc = |
$external = ' <a class="LC_docs_ext_edit" href="javascript:edittext(\''.$form.'\',\''.$residx.'\',\''.&escape($title).'\',\''.&escape($orig_url).'\');" >'.&mt('Edit').'</a>'; |
&Apache::lonnet::declutter(&Apache::lonnet::filelocation('',$orig_url)); |
} else { |
|
undef($external); |
if ($external) { |
|
$editlink = <<"EXTLNK"; |
|
|
|
<a class="LC_docs_ext_edit" href="javascript:editext('$residx');"> |
|
$lt{'ed'}</a> |
|
<form action="/adm/coursedocs" method="post" name="editext_$residx"> |
|
<fieldset id="uploadext$residx" style="display: none;" /> |
|
<input type="hidden" name="active" value="aa" /> |
|
<span class="LC_nobreak"> |
|
<span class="LC_docs_ext_edit">$lt{'ul'} </span> |
|
<input type="text" size="40" name="exturl" id="exturl_$residx" value="$orig_url" /> |
|
<a class="LC_docs_ext_edit" href="javascript:extUrlPreview('exturl_$residx');">$lt{'pr'}</a></span> |
|
</span><br /> |
|
<span class="LC_nobreak"> |
|
<span class="LC_docs_ext_edit">$lt{'ti'} </span> |
|
<input type="text" size="40" name="exttitle" value="$title" /> |
|
$uploadtag |
|
<input type="hidden" name="importdetail" value="" /> |
|
<input type="button" value="$lt{'sv'}" onclick="javascript:setExternal(this.form,'$residx')" /> |
|
</span> |
|
</fieldset> |
|
</form> |
|
EXTLNK |
|
} else { |
|
my ($cfile,$home,$switchserver,$uploaded) = |
|
&Apache::lonnet::can_edit_resource($fileloc,$coursenum,$coursedom); |
|
if (($cfile ne '') && ($symb ne '')) { |
|
my $jscall = |
|
&Apache::lonhtmlcommon::jump_to_editres($cfile,$home, |
|
$switchserver, |
|
$uploaded,$symb); |
|
if ($jscall) { |
|
$editlink = ' <a class="LC_docs_ext_edit" href="javascript:'. |
|
$jscall.'" >'.&mt('Edit').'</a>'; |
|
} |
|
} |
|
} |
} |
} |
my $reinit; |
my $reinit; |
if ($crstype eq 'Community') { |
if ($crstype eq 'Community') { |
Line 2466 $form_common.'
|
Line 2505 $form_common.'
|
} else { |
} else { |
$line.=$title.' <span class="LC_docs_reinit_warn">'.$reinit.'</span>'; |
$line.=$title.' <span class="LC_docs_reinit_warn">'.$reinit.'</span>'; |
} |
} |
$line.=$external."</td>"; |
$line.=$editlink."</td>"; |
$rand_pick_text = ' ' if ($rand_pick_text eq ''); |
$rand_pick_text = ' ' if ($rand_pick_text eq ''); |
$rand_order_text = ' ' if ($rand_order_text eq ''); |
$rand_order_text = ' ' if ($rand_order_text eq ''); |
if (($allowed) && ($folder!~/^supplemental/)) { |
if (($allowed) && ($folder!~/^supplemental/)) { |
Line 3029 sub init_breadcrumbs {
|
Line 3068 sub init_breadcrumbs {
|
sub create_list_elements { |
sub create_list_elements { |
my @formarr = @_; |
my @formarr = @_; |
my $list = ''; |
my $list = ''; |
for my $button (@formarr){ |
foreach my $button (@formarr){ |
for my $picture(keys %$button) { |
foreach my $picture (keys(%{$button})) { |
$list .= &Apache::lonhtmlcommon::htmltag('li', $picture.' '.$button->{$picture}, {class => 'LC_menubuttons_inline_text'}); |
$list .= &Apache::lonhtmlcommon::htmltag('li', $picture.' '.$button->{$picture}, {class => 'LC_menubuttons_inline_text', id => ''}); |
} |
} |
} |
} |
return $list; |
return $list; |
Line 3101 sub handler {
|
Line 3140 sub handler {
|
'Adding_External_Resource','Navigate_Content', |
'Adding_External_Resource','Navigate_Content', |
'Adding_Folders','Docs_Overview', 'Load_Map', |
'Adding_Folders','Docs_Overview', 'Load_Map', |
'Supplemental','Score_Upload_Form','Adding_Pages', |
'Supplemental','Score_Upload_Form','Adding_Pages', |
'Importing_LON-CAPA_Resource','Uploading_From_Harddrive', |
'Importing_LON-CAPA_Resource','Importing_IMS_Course', |
|
'Uploading_From_Harddrive', |
'Check_Resource_Versions','Verify_Content') { |
'Check_Resource_Versions','Verify_Content') { |
$help{$topic}=&Apache::loncommon::help_open_topic('Docs_'.$topic); |
$help{$topic}=&Apache::loncommon::help_open_topic('Docs_'.$topic); |
} |
} |
Line 3395 sub handler {
|
Line 3435 sub handler {
|
if ($env{'docs.markedcopy_url'}) { |
if ($env{'docs.markedcopy_url'}) { |
$script .= &paste_popup_js(); |
$script .= &paste_popup_js(); |
} |
} |
|
my $confirm_switch = &mt("Editing requires switching to the resource's home server.").'\n'. |
|
&mt('Switch server?'); |
|
|
|
|
} |
} |
# -------------------------------------------------------------------- Body tag |
# -------------------------------------------------------------------- Body tag |
$script = '<script type="text/javascript">'."\n" |
$script = '<script type="text/javascript">'."\n" |
Line 3487 sub handler {
|
Line 3531 sub handler {
|
'upls' => 'Upload a new supplemental '.lc($crstype).' document', |
'upls' => 'Upload a new supplemental '.lc($crstype).' document', |
'impp' => 'Import a document', |
'impp' => 'Import a document', |
'copm' => 'All documents out of a published map into this folder', |
'copm' => 'All documents out of a published map into this folder', |
'upld' => 'Import Document', |
'upfi' => 'Upload File', |
|
'upld' => 'Import Content', |
'srch' => 'Search', |
'srch' => 'Search', |
'impo' => 'Import', |
'impo' => 'Import', |
'lnks' => 'Import from Stored Links', |
'lnks' => 'Import from Stored Links', |
Line 3510 sub handler {
|
Line 3555 sub handler {
|
'abou' => 'Personal Information Page for a User', |
'abou' => 'Personal Information Page for a User', |
'imsf' => 'IMS Import', |
'imsf' => 'IMS Import', |
'imsl' => 'Import IMS package', |
'imsl' => 'Import IMS package', |
|
'cms' => 'Origin of IMS package', |
|
'se' => 'Select', |
'file' => 'File', |
'file' => 'File', |
'title' => 'Title', |
'title' => 'Title', |
'comment' => 'Comment', |
'comment' => 'Comment', |
|
'url' => 'URL', |
|
'prev' => 'Preview', |
|
'lnk' => 'Add Link', |
'parse' => 'Upload embedded images/multimedia files if HTML file', |
'parse' => 'Upload embedded images/multimedia files if HTML file', |
'nd' => 'Upload Document', |
'nd' => 'Upload Document', |
'pm' => 'Published Map', |
'pm' => 'Published Map', |
Line 3533 FIUP
|
Line 3583 FIUP
|
<input type="checkbox" name="parserflag" checked="checked" /> $lt{'parse'} |
<input type="checkbox" name="parserflag" checked="checked" /> $lt{'parse'} |
</label> |
</label> |
CHBO |
CHBO |
|
my $imsfolder = $env{'form.folder'}; |
|
if ($imsfolder eq '') { |
|
$imsfolder = 'default'; |
|
} |
|
my $imspform=(<<IMSFORM); |
|
<a class="LC_menubuttons_link" href="javascript:toggleUpload('ims');"> |
|
$lt{'imsf'}</a> $help{'Importing_IMS_Course'} |
|
<form name="uploadims" action="/adm/imsimportdocs" method="post" enctype="multipart/form-data" target="IMSimport"> |
|
<fieldset id="uploadimsform" style="display: none;" /> |
|
<legend>$lt{'imsf'}</legend> |
|
$fileupload |
|
<br /> |
|
<p> |
|
$lt{'cms'}: |
|
<select name="source"> |
|
<option value="-1" selected="selected">$lt{'se'}</option> |
|
<option value="bb5">Blackboard 5</option> |
|
<option value="bb6">Blackboard 6</option> |
|
<option value="angel5">ANGEL 5.5</option> |
|
<option value="webctce4">WebCT 4 Campus Edition</option> |
|
</select> |
|
<input type="hidden" name="folder" value="$imsfolder" /> |
|
</p> |
|
<input type="hidden" name="phase" value="one" /> |
|
<input type="button" value="$lt{'imsl'}" onclick="makeims(this.form);" /> |
|
</fieldset> |
|
</form> |
|
IMSFORM |
|
|
my $fileuploada = "<br clear='all' /><input type='submit' value='".$lt{'upld'}."' /> $help{'Uploading_From_Harddrive'}"; |
|
my $fileuploadform=(<<FUFORM); |
my $fileuploadform=(<<FUFORM); |
<form name="uploaddocument" action="/adm/coursedocs" method="post" enctype="multipart/form-data"> |
<a class="LC_menubuttons_link" href="javascript:toggleUpload('doc');"> |
|
$lt{'upfi'}</a> $help{'Uploading_From_Harddrive'} |
|
<form name="uploaddocument" action="/adm/coursedocs" method="post" enctype="multipart/form-data"> |
|
<fieldset id="uploaddocform" style="display: none;" /> |
|
<legend>$lt{'upfi'}</legend> |
<input type="hidden" name="active" value="aa" /> |
<input type="hidden" name="active" value="aa" /> |
$fileupload |
$fileupload |
<br /> |
<br /> |
Line 3548 CHBO
|
Line 3629 CHBO
|
<span class="LC_nobreak" style="float:left"> |
<span class="LC_nobreak" style="float:left"> |
$checkbox |
$checkbox |
</span> |
</span> |
|
<br clear="all" /> |
|
<input type="submit" value="$lt{'upld'}" /> |
|
</fieldset> |
|
</form> |
FUFORM |
FUFORM |
$fileuploadform .= $fileuploada.'</form>'; |
|
|
|
my $simpleeditdefaultform=(<<SEDFFORM); |
my $simpleeditdefaultform=(<<SEDFFORM); |
<form action="/adm/coursedocs" method="post" name="simpleeditdefault"> |
<form action="/adm/coursedocs" method="post" name="simpleeditdefault"> |
Line 3573 SEDFFORM
|
Line 3657 SEDFFORM
|
SEDFFORM |
SEDFFORM |
|
|
my $extresourcesform=(<<ERFORM); |
my $extresourcesform=(<<ERFORM); |
|
<a class="LC_menubuttons_link" href="javascript:toggleUpload('ext');">$lt{'extr'}</a>$help{'Adding_External_Resource'} |
<form action="/adm/coursedocs" method="post" name="newext"> |
<form action="/adm/coursedocs" method="post" name="newext"> |
|
<fieldset id="uploadextform" style="display: none;" /> |
|
<legend>$lt{'extr'}</legend> |
|
<input type="hidden" name="active" value="aa" /> |
|
$lt{'url'}:<br /> |
|
<input type="text" size="60" name="exturl" id="exturl" value="http://" /> |
|
<input type="button" name="view" value="$lt{'prev'}" onclick="javascript:extUrlPreview('exturl');" /><br /> |
|
$lt{'title'}:<br /> |
|
<input type="text" size="60" name="exttitle" value="$lt{'extr'}" /> |
$uploadtag |
$uploadtag |
|
<br /> |
<input type="hidden" name="importdetail" value="" /> |
<input type="hidden" name="importdetail" value="" /> |
<a class="LC_menubuttons_link" href="javascript:makenewext('newext');">$lt{'extr'}</a>$help{'Adding_External_Resource'} |
<input type="button" value="$lt{'lnk'}" onclick="javascript:setExternal(this.form,0)" /> |
|
</fieldset> |
</form> |
</form> |
ERFORM |
ERFORM |
|
|
Line 3645 HIDDENFORM
|
Line 3740 HIDDENFORM
|
} |
} |
my $readfile='/uploaded/'.$coursedom.'/'.$coursenum.'/'.$folder.'.'.$container; |
my $readfile='/uploaded/'.$coursedom.'/'.$coursenum.'/'.$folder.'.'.$container; |
|
|
my $imspform=(<<IMSPFORM); |
|
<form action="/adm/imsimportdocs" method="post" name="ims"> |
|
<input type="hidden" name="folder" value="$folder" /> |
|
<a class="LC_menubuttons_link" href="javascript:makeims();">$lt{'imsf'}</a> |
|
</form> |
|
IMSPFORM |
|
|
|
my $newnavform=(<<NNFORM); |
my $newnavform=(<<NNFORM); |
<form action="/adm/coursedocs" method="post" name="newnav"> |
<form action="/adm/coursedocs" method="post" name="newnav"> |
<input type="hidden" name="active" value="cc" /> |
<input type="hidden" name="active" value="cc" /> |
Line 3807 NGFFORM
|
Line 3895 NGFFORM
|
|
|
|
|
my @importdoc = ( |
my @importdoc = ( |
{'<img class="LC_noBorder LC_middle" src="/res/adm/pages/extres.png" alt="'.$lt{extr}.'" onclick="javascript:makenewext(\'newext\');" />'=>$extresourcesform}, |
{'<img class="LC_noBorder LC_middle" src="/res/adm/pages/extres.png" alt="'.$lt{extr}.'" onclick="toggleUpload(\'ext\');" />'=>$extresourcesform}, |
{'<img class="LC_noBorder LC_middle" src="/res/adm/pages/ims.png" alt="'.$lt{imsf}.'" onclick="javascript:makeims();" />'=>$imspform},); |
{'<img class="LC_noBorder LC_middle" src="/res/adm/pages/ims.png" alt="'.$lt{imsf}.'" onclick="javascript:toggleUpload(\'ims\');" />'=>$imspform}, |
$fileuploadform = &create_form_ul(&create_list_elements(@importdoc)) . '<hr id="cc_hrule" style="width:0px;text-align:left;margin-left:0" />' . $fileuploadform; |
{'<img class="LC_noBorder_LC_middle" src="/res/adm/pages/pdfupload.png" alt="'.$lt{upl}.'" onclick="javascript:toggleUpload(\'doc\');" />'=>$fileuploadform, |
|
}); |
|
$fileuploadform = &create_form_ul(&create_list_elements(@importdoc)); |
|
|
@gradingforma=( |
@gradingforma=( |
{'<img class="LC_noBorder LC_middle" src="/res/adm/pages/simpprob.png" alt="'.$lt{sipr}.'" onclick="javascript:makesmpproblem();" />'=>$newsmpproblemform}, |
{'<img class="LC_noBorder LC_middle" src="/res/adm/pages/simpprob.png" alt="'.$lt{sipr}.'" onclick="javascript:makesmpproblem();" />'=>$newsmpproblemform}, |
Line 3842 unless ($env{'form.pagepath'}) {
|
Line 3932 unless ($env{'form.pagepath'}) {
|
$hadchanges=0; |
$hadchanges=0; |
unless (($supplementalflag || $toolsflag)) { |
unless (($supplementalflag || $toolsflag)) { |
my $error = &editor($r,$coursenum,$coursedom,$folder,$allowed,'',$crstype, |
my $error = &editor($r,$coursenum,$coursedom,$folder,$allowed,'',$crstype, |
$supplementalflag,\%orderhash,$iconpath); |
$supplementalflag,\%orderhash,$iconpath,$uploadtag); |
if ($error) { |
if ($error) { |
$r->print('<p><span class="LC_error">'.$error.'</span></p>'); |
$r->print('<p><span class="LC_error">'.$error.'</span></p>'); |
} |
} |
Line 3874 unless ($env{'form.pagepath'}) {
|
Line 3964 unless ($env{'form.pagepath'}) {
|
|
|
my $path = &HTML::Entities::encode($env{'form.folderpath'},'<>&"'); |
my $path = &HTML::Entities::encode($env{'form.folderpath'},'<>&"'); |
|
|
my $supupdocformbtn = "<input type='submit' value='".$lt{'upld'}."' />$help{'Uploading_From_Harddrive'}"; |
|
my $supupdocform=(<<SUPDOCFORM); |
my $supupdocform=(<<SUPDOCFORM); |
|
<a class="LC_menubuttons_link" href="javascript:toggleUpload('suppdoc');"> |
|
$lt{'upfi'}</a> $help{'Uploading_From_Harddrive'} |
<form action="/adm/coursedocs" method="post" name="supuploaddocument" enctype="multipart/form-data"> |
<form action="/adm/coursedocs" method="post" name="supuploaddocument" enctype="multipart/form-data"> |
|
<fieldset id="uploadsuppdocform" style="display: none;" /> |
|
<legend>$lt{'upfi'}</legend> |
<input type="hidden" name="active" value="ee" /> |
<input type="hidden" name="active" value="ee" /> |
$fileupload |
$fileupload |
<br /> |
<br /> |
Line 3890 unless ($env{'form.pagepath'}) {
|
Line 3983 unless ($env{'form.pagepath'}) {
|
<br /> |
<br /> |
<input type="hidden" name="folderpath" value="$path" /> |
<input type="hidden" name="folderpath" value="$path" /> |
<input type="hidden" name="cmd" value="upload_supplemental" /> |
<input type="hidden" name="cmd" value="upload_supplemental" /> |
|
<input type='submit' value="$lt{'upld'}" /> |
|
</form> |
SUPDOCFORM |
SUPDOCFORM |
$supupdocform .= &create_form_ul(&Apache::lonhtmlcommon::htmltag('li',$supupdocformbtn,{class => 'LC_menubuttons_inline_text'}))."</form>"; |
|
|
|
my $supnewfolderform=(<<SNFFORM); |
my $supnewfolderform=(<<SNFFORM); |
<form action="/adm/coursedocs" method="post" name="supnewfolder"> |
<form action="/adm/coursedocs" method="post" name="supnewfolder"> |
Line 3903 SUPDOCFORM
|
Line 3997 SUPDOCFORM
|
</form> |
</form> |
SNFFORM |
SNFFORM |
|
|
|
my $supextform=(<<ERFORM); |
my $supnewextform=(<<SNEFORM); |
<a class="LC_menubuttons_link" href="javascript:toggleUpload('suppext');">$lt{'extr'}</a>$help{'Adding_External_Resource'} |
<form action="/adm/coursedocs" method="post" name="supnewext"> |
<form action="/adm/coursedocs" method="post" name="newsuppext"> |
<input type="hidden" name="active" value="ff" /> |
<fieldset id="uploadsuppextform" style="display: none;" /> |
<input type="hidden" name="folderpath" value="$path" /> |
<legend>$lt{'extr'}</legend> |
<input type="hidden" name="importdetail" value="" /> |
<input type="hidden" name="active" value="ee" /> |
<a class="LC_menubuttons_link" href="javascript:makenewext('supnewext');">$lt{'extr'}</a> $help{'Adding_External_Resource'} |
$lt{'url'}:<br /> |
</form> |
<input type="text" size="60" name="exturl" id="exturl" value="http://" /> |
SNEFORM |
<input type="button" name="view" value="$lt{'prev'}" onclick="javascript:extUrlPreview('exturl');" /><br /> |
|
$lt{'title'}:<br /> |
|
<input type="text" size="60" name="exttitle" value="$lt{'extr'}" /> |
|
$uploadtag |
|
<br /> |
|
<input type="hidden" name="importdetail" value="" /> |
|
<input type="button" value="$lt{'lnk'}" onclick="javascript:setExternal(this.form,0)" /> |
|
</fieldset> |
|
</form> |
|
ERFORM |
|
|
my $supnewsylform=(<<SNSFORM); |
my $supnewsylform=(<<SNSFORM); |
<form action="/adm/coursedocs" method="post" name="supnewsyl"> |
<form action="/adm/coursedocs" method="post" name="supnewsyl"> |
Line 3943 my @specialdocs = (
|
Line 4046 my @specialdocs = (
|
=>$supnewaboutmeform}, |
=>$supnewaboutmeform}, |
); |
); |
my @supimportdoc = ( |
my @supimportdoc = ( |
{'<img class="LC_noBorder LC_middle" src="/res/adm/pages/extres.png" alt="'.$lt{extr}.'" onclick="javascript:makenewext(\'supnewext\');" />' |
{'<img class="LC_noBorder LC_middle" src="/res/adm/pages/extres.png" alt="'.$lt{extr}.'" onclick="toggleUpload(\'suppext\')" />' |
=>$supnewextform}, |
=>$supextform}, |
); |
{'<img class="LC_noBorder LC_middle" src="/res/adm/pages/pdfupload.png" alt="'.$lt{upl}.'" onclick="javascript:toggleUpload(\'suppdoc\');" />' |
$supupdocform = &create_form_ul(&create_list_elements(@supimportdoc)) . '<hr id="ee_hrule" style="width:0px;text-align:left;margin-left:0" />' . $supupdocform; |
=>$supupdocform}, |
|
); |
|
|
|
$supupdocform = &create_form_ul(&create_list_elements(@supimportdoc)); |
my %suporderhash = ( |
my %suporderhash = ( |
'00' => ['Supnewfolder', $supnewfolderform], |
'00' => ['Supnewfolder', $supnewfolderform], |
'ee' => ['Import Content',$supupdocform], |
'ee' => ['Import Content',$supupdocform], |
Line 3954 my %suporderhash = (
|
Line 4060 my %suporderhash = (
|
); |
); |
if ($supplementalflag) { |
if ($supplementalflag) { |
my $error = &editor($r,$coursenum,$coursedom,$folder,$allowed,'',$crstype, |
my $error = &editor($r,$coursenum,$coursedom,$folder,$allowed,'',$crstype, |
$supplementalflag,\%suporderhash,$iconpath); |
$supplementalflag,\%suporderhash,$iconpath,$uploadtag); |
if ($error) { |
if ($error) { |
$r->print('<p><span class="LC_error">'.$error.'</span></p>'); |
$r->print('<p><span class="LC_error">'.$error.'</span></p>'); |
} |
} |
} |
} |
} elsif ($supplementalflag) { |
} elsif ($supplementalflag) { |
my $error = &editor($r,$coursenum,$coursedom,$folder,$allowed,'',$crstype, |
my $error = &editor($r,$coursenum,$coursedom,$folder,$allowed,'',$crstype, |
$supplementalflag,'',$iconpath); |
$supplementalflag,'',$iconpath,$uploadtag); |
if ($error) { |
if ($error) { |
$r->print('<p><span class="LC_error">'.$error.'</span></p>'); |
$r->print('<p><span class="LC_error">'.$error.'</span></p>'); |
} |
} |
Line 4317 sub editing_js {
|
Line 4423 sub editing_js {
|
p_ctr2a => 'Cut[_98]', |
p_ctr2a => 'Cut[_98]', |
p_ctr2b => '?[_98]', |
p_ctr2b => '?[_98]', |
rpck => 'Enter number to pick (e.g., 3)', |
rpck => 'Enter number to pick (e.g., 3)', |
|
imsfile => 'You must choose an IMS package for import', |
|
imscms => 'You must select which Course Management System was the source of the IMS package', |
|
invurl => 'Invalid URL', |
|
titbl => 'Title is blank', |
); |
); |
|
|
my $crstype = &Apache::loncommon::course_type(); |
my $crstype = &Apache::loncommon::course_type(); |
Line 4336 sub editing_js {
|
Line 4446 sub editing_js {
|
$backtourl = '/adm/supplemental'; |
$backtourl = '/adm/supplemental'; |
} |
} |
|
|
|
my $fieldsets = "'ext','doc','ims'"; |
|
if ($supplementalflag) { |
|
$fieldsets = "'suppext','suppdoc'"; |
|
} |
|
|
|
my $urlregexp = <<'ENDREGEXP'; |
|
/^([a-z]([a-z]|\d|\+|-|\.)*):(\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?((\[(|(v[\da-f]{1,}\.(([a-z]|\d|-|\.|_|~)|[!\$&'\(\)\*\+,;=]|:)+))\])|((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=])*)(:\d*)?)(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*|(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)|((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)|((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)){0})(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i |
|
ENDREGEXP |
|
|
return <<ENDNEWSCRIPT; |
return <<ENDNEWSCRIPT; |
function makenewfolder(targetform,folderseq) { |
function makenewfolder(targetform,folderseq) { |
var foldername=prompt('$lt{"p_mnf"}','$lt{"t_mnf"}'); |
var foldername=prompt('$lt{"p_mnf"}','$lt{"t_mnf"}'); |
Line 4353 function makenewpage(targetform,folderse
|
Line 4472 function makenewpage(targetform,folderse
|
} |
} |
} |
} |
|
|
function makenewext(targetname) { |
function editext(residx) { |
this.document.forms.extimport.useform.value=targetname; |
if (document.getElementById('uploadext'+residx)) { |
this.document.forms.extimport.title.value=''; |
var curr = document.getElementById('uploadext'+residx).style.display; |
this.document.forms.extimport.url.value=''; |
if (curr == 'none') { |
this.document.forms.extimport.residx.value=''; |
disp = 'block'; |
window.open('/adm/rat/extpickframe.html'); |
} else { |
} |
disp = 'none'; |
|
} |
function edittext(targetname,residx,title,url) { |
document.getElementById('uploadext'+residx).style.display=disp; |
this.document.forms.extimport.useform.value=targetname; |
} |
this.document.forms.extimport.residx.value=residx; |
resize_scrollbox('contentscroll','1','1'); |
this.document.forms.extimport.url.value=url; |
return; |
this.document.forms.extimport.title.value=title; |
|
window.open('/adm/rat/extpickframe.html'); |
|
} |
} |
|
|
function makeexamupload() { |
function makeexamupload() { |
Line 4433 function makeabout() {
|
Line 4550 function makeabout() {
|
} |
} |
} |
} |
|
|
function makeims() { |
function toggleUpload(caller) { |
var caller = document.forms.ims.folder.value; |
var blocks = Array($fieldsets); |
var newlocation = "/adm/imsimportdocs?folder="+caller+"&phase=one"; |
for (var i=0; i<blocks.length; i++) { |
newWindow = window.open("","IMSimport","HEIGHT=700,WIDTH=750,scrollbars=yes"); |
var disp = 'none'; |
newWindow.location.href = newlocation; |
if (caller == blocks[i]) { |
|
var curr = document.getElementById('upload'+caller+'form').style.display; |
|
if (curr == 'none') { |
|
disp='block'; |
|
} |
|
} |
|
document.getElementById('upload'+blocks[i]+'form').style.display=disp; |
|
} |
|
resize_scrollbox('contentscroll','1','0'); |
|
return; |
|
} |
|
|
|
function extUrlPreview(caller) { |
|
if (document.getElementById(caller)) { |
|
var url = document.getElementById(caller).value; |
|
var regexp = $urlregexp; |
|
if (regexp.test(url)) { |
|
openMyModal(url,500,400,'yes'); |
|
} else { |
|
alert("$lt{'invurl'}"); |
|
} |
|
} |
|
} |
|
|
|
function makeims(imsform) { |
|
if ((imsform.uploaddoc.value == '') || (!imsform.uploaddoc.value)) { |
|
alert("$lt{'imsfile'}"); |
|
return; |
|
} |
|
if (imsform.source.selectedIndex == 0) { |
|
alert("$lt{'imscms'}"); |
|
return; |
|
} |
|
newWindow = window.open('', 'IMSimport',"HEIGHT=700,WIDTH=750,scrollbars=yes"); |
|
imsform.submit(); |
} |
} |
|
|
function finishpick() { |
function setExternal(extform,residx) { |
var title=this.document.forms.extimport.title.value; |
var title=extform.exttitle.value; |
var url=this.document.forms.extimport.url.value; |
if (!String.trim) { |
var form=this.document.forms.extimport.useform.value; |
String.prototype.trim = function() {return this.replace(\/^\\s+|\\s+$\/g, "");}; } |
var residx=this.document.forms.extimport.residx.value; |
var url=extform.exturl.value; |
eval('this.document.forms.'+form+'.importdetail.value="'+title+'='+url+'='+residx+'";this.document.forms.'+form+'.submit();'); |
var regexp = $urlregexp; |
|
if (title == null || title.trim()=="") { |
|
alert("$lt{'titbl'}"); |
|
extform.exttitle.focus(); |
|
return; |
|
} |
|
if (regexp.test(url)) { |
|
url = escape(url); |
|
if (residx > 0) { |
|
eval("extform.importdetail.value=title+'='+url+'='+residx;extform.submit();"); |
|
} else { |
|
eval("extform.importdetail.value=title+'='+url;extform.submit();"); |
|
} |
|
} else { |
|
alert("$lt{'invurl'}"); |
|
extform.exturl.focus(); |
|
return; |
|
} |
} |
} |
|
|
function changename(folderpath,index,oldtitle,container,pagesymb) { |
function changename(folderpath,index,oldtitle,container,pagesymb) { |
Line 4599 function showPage(current, pageId, nav,
|
Line 4767 function showPage(current, pageId, nav,
|
currentData = document.getElementById(pageId); |
currentData = document.getElementById(pageId); |
currentData.style.display = 'block'; |
currentData.style.display = 'block'; |
activeTab = pageId; |
activeTab = pageId; |
|
toggleUpload(); |
if (nav == 'mainnav') { |
if (nav == 'mainnav') { |
var storedpath = "$docs_folderpath"; |
var storedpath = "$docs_folderpath"; |
if (storedpath == '') { |
if (storedpath == '') { |