version 1.291, 2008/03/12 02:46:53
|
version 1.295, 2008/07/07 11:02:25
|
Line 937 sub editxmlmode {
|
Line 937 sub editxmlmode {
|
&Apache::loncommon::resize_textarea_js(). |
&Apache::loncommon::resize_textarea_js(). |
&Apache::structuretags::setmode_javascript(); |
&Apache::structuretags::setmode_javascript(); |
my $only_body = ($env{'environment.remote'} eq 'off')? 0 : 1; |
my $only_body = ($env{'environment.remote'} eq 'off')? 0 : 1; |
|
my $dragmath = &Apache::lonhtmlcommon::dragmath("LC_editxmltext"); |
my $start_page = |
my $start_page = |
&Apache::loncommon::start_page(&mt("EditXML [_1]",$file),$js, |
&Apache::loncommon::start_page(&mt("EditXML [_1]",$file),$js, |
{'no_auto_mt_title' => 1, |
{'no_auto_mt_title' => 1, |
Line 959 sub editxmlmode {
|
Line 960 sub editxmlmode {
|
</table> |
</table> |
<div class="LC_edit_problem_discards"> |
<div class="LC_edit_problem_discards"> |
<input type="hidden" name="problemmode" value="editxml" /> |
<input type="hidden" name="problemmode" value="editxml" /> |
|
|
<input type="button" name="submitmode" accesskey="d" value="'.&mt('Discard Edits and View').'" '. |
<input type="button" name="submitmode" accesskey="d" value="'.&mt('Discard Edits and View').'" '. |
'onclick="javascript:setmode(this.form,'."'discard'".')" /> |
'onclick="javascript:setmode(this.form,'."'discard'".')" /> |
<input type="button" '.&Apache::edit::submit_ask_anyway('setmode(this.form,'."'edit'".')').'name="submitmode" accesskey="e" value="'.&mt('Edit').'" /> |
<input type="button" '.&Apache::edit::submit_ask_anyway('setmode(this.form,'."'edit'".')').'name="submitmode" accesskey="e" value="'.&mt('Edit').'" /> |
Line 966 sub editxmlmode {
|
Line 968 sub editxmlmode {
|
</div> |
</div> |
<div class="LC_edit_problem_saves"> |
<div class="LC_edit_problem_saves"> |
<input type="submit" name="submitbutton" accesskey="s" value="'.&mt('Save').'" /> |
<input type="submit" name="submitbutton" accesskey="s" value="'.&mt('Save').'" /> |
<input type="submit" name="submitbutton" accesskey="v" value="'.&mt('Save and View').'" /> |
<input type="submit" name="submitbutton" accesskey="v" value="'.&mt('Save and View').'" />' |
|
.$dragmath.' |
</div> |
</div> |
<hr class="LC_edit_problem_divide" /> |
<hr class="LC_edit_problem_divide" /> |
'.&Apache::lonxml::message_location().' |
'.&Apache::lonxml::message_location().' |
Line 1079 sub get_template_list {
|
Line 1082 sub get_template_list {
|
} |
} |
my @files = glob($Apache::lonnet::perlvar{'lonIncludes'}. |
my @files = glob($Apache::lonnet::perlvar{'lonIncludes'}. |
'/templates/*.'.$glob_extension); |
'/templates/*.'.$glob_extension); |
@files = map {[$_,&mt(&Apache::lonnet::metadata($_, 'title'))]} (@files); |
@files = map {[$_,&mt(&Apache::lonnet::metadata($_, 'title')), |
@files = sort {$a->[1] cmp $b->[1]} (@files); |
(&Apache::lonnet::metadata($_, 'category')?&mt(&Apache::lonnet::metadata($_, 'category')):&mt('Miscellaneous')), |
|
&mt(&Apache::lonnet::metadata($_, 'help'))]} (@files); |
|
@files = sort {$a->[2].$a->[1] cmp $b->[2].$b->[1]} (@files); |
my ($midpoint,$seconddiv,$numfiles); |
my ($midpoint,$seconddiv,$numfiles); |
$numfiles = 0; |
$numfiles = 0; |
foreach my $file (@files) { |
foreach my $file (@files) { |
Line 1095 sub get_template_list {
|
Line 1100 sub get_template_list {
|
} |
} |
} |
} |
my $count = 0; |
my $count = 0; |
|
my $currentcategory=''; |
foreach my $file (@files) { |
foreach my $file (@files) { |
next if ($file->[1] !~ /\S/); |
next if ($file->[1] !~ /\S/); |
|
if ($file->[2] ne $currentcategory) { |
|
$currentcategory=$file->[2]; |
|
if ((!$seconddiv) && ($count >= $midpoint)) { |
|
$result .= '</div>'."\n".'<div class="LC_left_float">'."\n"; |
|
$seconddiv = 1; |
|
} |
|
$result.='<h3>'.$currentcategory.'</h3>'; |
|
$count++; |
|
} |
$result .= |
$result .= |
'<label><input type="radio" name="template" value="'.$file->[0].'" />'. |
'<label><input type="radio" name="template" value="'.$file->[0].'" />'. |
$file->[1].'</label><br />'."\n"; |
$file->[1].'</label>'; |
$count ++; |
if ($file->[3]) { |
if ((!$seconddiv) && ($count >= $midpoint)) { |
$result.=&Apache::loncommon::help_open_topic($file->[3]); |
$result .= '</div>'."\n".'<div class="LC_left_float">'."\n"; |
|
$seconddiv = 1; |
|
} |
} |
|
my $filename=$file->[0]; |
|
$filename=~s/^\/home\/httpd\/html//; |
|
$result.=' <font size="-2"><a href="'.$filename.'" target="sample">'.&mt('Example').'</font></a><br />'."\n"; |
|
$count ++; |
} |
} |
if ($numfiles > 0) { |
if ($numfiles > 0) { |
$result .= '</div>'."\n".'<div class="LC_clear_float_footer"></div>'."\n"; |
$result .= '</div>'."\n".'<div class="LC_clear_float_footer"></div>'."\n"; |