version 1.268.2.2, 2007/09/21 17:25:58
|
version 1.270, 2007/08/18 00:10:50
|
Line 196 sub check_ip_acc {
|
Line 196 sub check_ip_acc {
|
return 1; |
return 1; |
} |
} |
my $allowed=0; |
my $allowed=0; |
my $ip=$env{'request.host'} || $ENV{'REMOTE_ADDR'}; |
my $ip=$ENV{'REMOTE_ADDR'}; |
|
|
my $name; |
my $name; |
foreach my $pattern (split(',',$acc)) { |
foreach my $pattern (split(',',$acc)) { |
$pattern =~ s/^\s*//; |
$pattern =~ s/^\s*//; |
Line 862 sub editxmlmode {
|
Line 861 sub editxmlmode {
|
if ($cols > 80) { $cols = 80; } |
if ($cols > 80) { $cols = 80; } |
if ($cols < 70) { $cols = 70; } |
if ($cols < 70) { $cols = 70; } |
if ($rows < 20) { $rows = 20; } |
if ($rows < 20) { $rows = 20; } |
|
my $js = |
|
&Apache::edit::js_change_detection(). |
|
&Apache::loncommon::resize_textarea_js(); |
|
my $only_body = ($env{'environment.remote'} eq 'off')? 0 : 1; |
my $start_page = |
my $start_page = |
&Apache::loncommon::start_page(&mt("EditXML [_1]",$file), |
&Apache::loncommon::start_page(&mt("EditXML [_1]",$file),$js, |
&Apache::edit::js_change_detection(), |
{'no_auto_mt_title' => 1, |
{'no_auto_mt_title' => 1,}); |
'only_body' => $only_body, |
|
'add_entries' => { |
|
'onresize' => q[resize_textarea('LC_editxmltext','LC_aftertextarea')], |
|
'onload' => q[resize_textarea('LC_editxmltext','LC_aftertextarea')], |
|
}}); |
|
|
$result.=$start_page. |
$result.=$start_page. |
&renderpage($request,$file,['no_output_web'],1). |
&renderpage($request,$file,['no_output_web'],1). |
Line 882 sub editxmlmode {
|
Line 889 sub editxmlmode {
|
<input type="submit" name="submit" accesskey="v" value="'.&mt('Submit Changes and View').'" /> |
<input type="submit" name="submit" accesskey="v" value="'.&mt('Submit Changes and View').'" /> |
<hr /> |
<hr /> |
' . $xml_help . ' |
' . $xml_help . ' |
<textarea '.&Apache::edit::element_change_detection().' style="width:100%" rows="'.$rows.'" cols="'.$cols.'" name="editxmltext">'. |
<textarea '.&Apache::edit::element_change_detection(). |
&HTML::Entities::encode($problem,'<>&"').'</textarea><br /> |
' rows="'.$rows.'" cols="'.$cols.'" style="width:100%" '. |
<input type="submit" name="submit" accesskey="s" value="'.&mt('Submit Changes').'" /> |
' name="editxmltext" id="LC_editxmltext">'. |
<input type="submit" name="submit" accesskey="v" value="'.&mt('Submit Changes and View').'" /> |
&HTML::Entities::encode($problem,'<>&"').'</textarea> |
|
<div id="LC_aftertextarea"> |
|
<input type="submit" name="submit" accesskey="s" value="'.&mt('Submit Changes').'" /> |
|
<input type="submit" name="submit" accesskey="v" value="'.&mt('Submit Changes and View').'" /> |
|
</div> |
</form>'.&Apache::loncommon::end_page(); |
</form>'.&Apache::loncommon::end_page(); |
&Apache::lonxml::add_messages(\$result); |
&Apache::lonxml::add_messages(\$result); |
$request->print($result); |
$request->print($result); |
Line 940 sub renderpage {
|
Line 951 sub renderpage {
|
&Apache::lonxml::debug("Should be parsing now"); |
&Apache::lonxml::debug("Should be parsing now"); |
$result .= &Apache::lonxml::xmlparse($request, $target, $problem, |
$result .= &Apache::lonxml::xmlparse($request, $target, $problem, |
&setup_vars($target),%mystyle); |
&setup_vars($target),%mystyle); |
&finished_parsing(); |
undef($Apache::lonhomework::parsing_a_problem); |
if (!$output) { $result = ''; } |
if (!$output) { $result = ''; } |
#$request->print("Result follows:"); |
#$request->print("Result follows:"); |
if ($target eq 'modified') { |
if ($target eq 'modified') { |
Line 971 sub renderpage {
|
Line 982 sub renderpage {
|
} |
} |
} |
} |
|
|
sub finished_parsing { |
|
undef($Apache::lonhomework::parsing_a_problem); |
|
undef($Apache::lonhomework::parsing_a_task); |
|
} |
|
|
|
# with no arg it returns a HTML <option> list of the template titles |
# with no arg it returns a HTML <option> list of the template titles |
# with one arg it returns the filename associated with the arg passed |
# with one arg it returns the filename associated with the arg passed |
sub get_template_list { |
sub get_template_list { |