Annotation of loncom/interface/lonpickresource.pm, revision 1.1
1.1 ! www 1: # The LearningOnline Network with CAPA
! 2: # Pick resource or folder in the course
! 3: #
! 4: # $Id: lonpickauthor.pm,v 1.2 2008/10/15 09:49:52 bisitz Exp $
! 5: #
! 6: # Copyright Michigan State University Board of Trustees
! 7: #
! 8: # This file is part of the LearningOnline Network with CAPA (LON-CAPA).
! 9: #
! 10: # LON-CAPA is free software; you can redistribute it and/or modify
! 11: # it under the terms of the GNU General Public License as published by
! 12: # the Free Software Foundation; either version 2 of the License, or
! 13: # (at your option) any later version.
! 14: #
! 15: # LON-CAPA is distributed in the hope that it will be useful,
! 16: # but WITHOUT ANY WARRANTY; without even the implied warranty of
! 17: # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
! 18: # GNU General Public License for more details.
! 19: #
! 20: # You should have received a copy of the GNU General Public License
! 21: # along with LON-CAPA; if not, write to the Free Software
! 22: # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
! 23: #
! 24: # /home/httpd/html/adm/gpl.txt
! 25: #
! 26: # http://www.lon-capa.org/
! 27: #
! 28: #
! 29: ###############################################################
! 30: ###############################################################
! 31:
! 32: package Apache::lonpickresource;
! 33:
! 34: use strict;
! 35: use Apache::Constants qw(:common);
! 36: use Apache::loncommon;
! 37: use Apache::lonnet;
! 38: use Apache::lonlocal;
! 39: use Apache::lonroles;
! 40: use Apache::lonuserutils;
! 41: use Apache::lonstathelpers;
! 42: use LONCAPA;
! 43:
! 44: sub handler {
! 45: my $r = shift;
! 46: &Apache::loncommon::content_type($r,'text/html');
! 47: $r->send_http_header;
! 48: return OK if $r->header_only;
! 49:
! 50: # ------------------------------------------------------------ Print the screen
! 51: $r->print(&Apache::loncommon::start_page("Selecting Resource",undef,
! 52: {'no_nav_bar' => 1}));
! 53:
! 54: &Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'},['form','reslink']);
! 55: my $form='opener.document.'.$env{'form.form'};
! 56: my $reslink=$env{'form.reslink'};
! 57:
! 58: $r->print('<form name="pickresource" action="/adm/pickresource">');
! 59: $r->print(&Apache::lonstathelpers::problem_selector('.',undef,1,1,'resource'));
! 60: $r->print('<input type="button" value="'.&mt('Pick').
! 61: '" onClick="if (this.form.resourcesymb.value!=null) { '.
! 62: $form.'.resourcesymb.value=this.form.resourcesymb.value;'.
! 63: $form.".cmd.value='".$reslink."';} window.close();".'" />');
! 64: $r->print('</form>');
! 65: $r->print(&Apache::loncommon::end_page());
! 66: return OK;
! 67: }
! 68:
! 69: 1;
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>