# The LearningOnline Network
# Page with Daxe on the left side and the preview on the right side
#
# $Id: daxepage.pm,v 1.5 2023/08/23 20:58:32 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
# This file is part of the LearningOnline Network with CAPA (LON-CAPA).
#
# LON-CAPA is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# LON-CAPA is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with LON-CAPA; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
# /home/httpd/html/adm/gpl.txt
#
# http://www.lon-capa.org/
#
###
package Apache::daxepage;
use strict;
use Apache::Constants qw(:common);
sub handler {
my $request = shift;
my $uri = $request->uri;
$uri =~ s{^/daxepage}{};
&Apache::loncommon::content_type($request,'text/html');
if ($uri !~ /\.(task|problem|exam|quiz|assess|survey|library|xml|html|htm|xhtml|xhtm)$/) {
$request->status(406);
return OK;
}
my $result = '';
$result .= "<!DOCTYPE html>\n";
$result .= "<html>\n";
$result .= "<head>\n";
my $name = $uri;
$name =~ s/^.*\/([^\/]+)$/$1/;
$result .= " <title>LON-CAPA Daxe: $name</title>\n";
$result .= " <style>\n";
$result .= " body { margin: 0; }\n";
$result .= " #daxe { position:absolute; top:0; left:0; width:100%; height:100%; border:none; }\n";
$result .= " </style>\n";
$result .= "</head>\n";
$result .= "<body>\n";
my $daxeurl = '/adm/daxe/daxe.html?config=config/loncapa_config.xml&file=/daxeopen'.$uri.
'&save=/daxesave';
$result .= ' <iframe id="daxe" src="'.$daxeurl.'"></iframe>'."\n";
$result .= "</body>\n";
$result .= "</html>\n";
$request->print($result);
return OK;
}
1;
__END__
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>