From raeburn at source.lon-capa.org Mon Jul 30 09:04:37 2012
From: raeburn at source.lon-capa.org (raeburn)
Date: Mon, 30 Jul 2012 13:04:37 -0000
Subject: [LON-CAPA-cvs] cvs: doc /build ubuntu12LTS_install.frag
Message-ID:
raeburn Mon Jul 30 13:04:37 2012 EDT
Added files:
/doc/build ubuntu12LTS_install.frag
Log:
- Installation instructions for Ubuntu 12 LTS.
-------------- next part --------------
Index: doc/build/ubuntu12LTS_install.frag
+++ doc/build/ubuntu12LTS_install.frag
Installing LON-CAPA on a basic Ubuntu 12.04 LTS Server
This document guides you through the process of setting up a new LON-CAPA
server running Ubuntu 12.04 LTS Server with only the base set of packages installed.
The computer will be configured solely as a LON-CAPA server and will be
expected to have no other services running. Your server is expected to have
a reasonably fast connection to the internet.
Installing Linux is getting easier and easier.
You will be required to log in to the machine and execute
some routine Unix commands. Familiarity with the Apache web server, mod_perl,
perl, and MySQL are not required to install and run LON-CAPA.
Installation Overview
The installation process takes the following steps:
Ubuntu 12.04 LTS (server install) isos can be obtained from the Ubuntu Server download page
An .iso file (either 32 bit or 64 bit) can be burned to a CD.
You will need to know the following network settings for your installation.
Note:You must have a static IP address to use LON-CAPA.
DHCP is not supported.
Installing Ubuntu Linux is easy.
Documentation is available from
https://help.ubuntu.com/community/Installation/
Most of the installation screens are self explanatory.
There are a few steps that require comment and are dealt with below.
Installation Language
Use English as your installation language.
Installation Type
If this is a fresh install choose "Install Ubuntu Server".
Partitioning your Drive
For a fresh install you may want to use the automatic partitioning feature of the installer.
If you decide to customize partitioning, the following may be useful to know.
LON-CAPA resource files are stored in the /home directory, so the
majority of the disk space should be allocated here. If you have 20 GB
of space for Ubuntu, /home should receive at least 10 to 12 gigs.
Since MySQL uses the /var filesystem to store its databases you should
have at least 4 gigs of space available on /var. Be sure to
include adequate swap space. A minimum is 512 Megs, but you should
typically have 1 or 2x as much swap space as you do physical RAM.
Network Configuration
LON-CAPA will not work with a machine set up to use a dynamic
IP address. When configuring your network card, be sure to unselect
the DHCP option and enter in your network information.
Software Selection
The base system will be installed. Once that is complete you will have the option to select additional software collections. Leave all unselected.
Finish installing your server, reboot it, and log in with the username you created during installation.
Firewall Configuration
Use ufw to allow incoming traffic for the following services:
ssh, www, https
This may take some minutes due to LON-CAPA's large number of dependencies.
Retrieve and execute LON-CAPA setup program
Retrieve the LON-CAPA setup script and dependencies with the following command:
wget http://install.loncapa.org/linux/install.tar
Extract the archive with the following command:
tar xf install.tar
This creates a directory named installation. Change to it and
execute the setup script with the following commands:
cd installation
sudo ./install.pl
The script is used to prepare a Linux system to run LON-CAPA, and can also be
used to check the configuration of a system on which LON-CAPA has already been installed. Typically, though, you will run this script only once, when you first install LON-CAPA.
The script will analyze your system to determine which actions are recommended. The script will then prompt you to choose the actions you would like taken.
Once a choice has been entered for all nine possible actions, required changes will be made.
The possible actions are:
Create the www user/group
Install the package LON-CAPA uses to authenticate users.
Set-up the MySQL database
Set-up MySQL permissions
Configure Apache web server
Configure start-up of services
Check firewall settings
Stop services not used by LON-CAPA,
e.g., services for a print server: cups daemon
Download LON-CAPA source code in readiness for installation
Determine LON-CAPA Settings
LON-CAPA requires a number of identifying parameters to be set in order
for it to function at all. Below is a list with descriptions.
Host Type (library or access)
The server must be designated a 'library' or an 'access' server. In
general you should have a library server for your instructors to create
their course content on and run their courses. Students should connect
to access servers. If you are doing the first install of LON-CAPA at
your site, or if you are playing with it for your own edification you
should make your machine a 'library' server.
LON-CAPA domain
Each site or school which installs LON-CAPA needs its own domain.
Here at MSU we use 'msu'. You should choose something short but
meaningful. Restriction: One word, no hyphens, underscores, or
special characters. Domain names which include a departmental
abbreviation are not recommended as although LON-CAPA may start in
a single department, other departments frequently join subsequently.
For a domain name: 'msu' is a superior choice to 'msuphys' for example.
LON-CAPA host id
Each LON-CAPA server requires a unique internal name. We use names
such as "msul1" for the first library server. Restriction: One word,
no hyphens, underscores, or special characters.
Domain's Primary Library Server ID
If you are setting up a domain with a single library server, then the domain's primary library server ID will be the LON-CAPA host id of that server (e.g., msul1). Once your domain grows and you need to add more servers, one of the library servers in the domain should be assigned as the domain's primary library server. This will be where domain-wide settings will be stored.
Host administrator email
The amount of email sent to this address is relatively minimal. Messages
are sent every time the system starts up, or if the system is in
serious trouble. On a laptop, make this root at localhost.
Support email address
If you enter an e-mail address here, then users of the system
will be able to click an "Ask Helpdesk" link in the system to
display a web form which they will complete to request support from
your institution's helpdesk. On form submission the contents
will be sent to the e-mail address you specify.
Configuring LON-CAPA
To configure and install LON-CAPA, become root and execute the following commands:
sudo -i
cd /root/loncapa-X.Y.Z (X.Y.Z should correspond to a version number like '2.11.0')
/UPDATE
You will need to enter the LON-CAPA configuration information you determined
in the previous section.
You will need at least one user at your site who has the role of
'domain coordinator'. This user creates accounts for other users and
grants them additional privileges. The make_domain_coordinator.pl script
invoked below requires that you enter the user's password.
Replace USERNAME and DOMAIN with an appropriate username and your domain.
cd /root/loncapa-X.Y.Z/loncom/build
perl make_domain_coordinator.pl USERNAME DOMAIN
The LON-CAPA network services take a moment to start. Most misconfigurations
will be apparent at this step. Lastly, exit from root status to resume use of your regular account.
If you receive warnings about missing perl modules when starting Apache,
please make sure you followed the instructions in
Installing prerequisites. If you still have errors, please
contact the MSU LON-CAPA group.
Point a web browser at your new machine and log in as the domain
coordinator. Congratulations!
If things aren't working right
If you've followed the steps above and the server doesn't start or you think
there's something wrong, please send a help request to the MSU LON-CAPA group. If there were errors in installation of the dependency .deb packages or errors during the
automatic setup, please send us as much information as possible.
If some part of this document is unclear please let us know.
From bisitz at source.lon-capa.org Mon Jul 30 09:10:57 2012
From: bisitz at source.lon-capa.org (bisitz)
Date: Mon, 30 Jul 2012 13:10:57 -0000
Subject: [LON-CAPA-cvs] cvs: loncom /interface portfolio.pm
Message-ID:
bisitz Mon Jul 30 13:10:57 2012 EDT
Modified files:
/loncom/interface portfolio.pm
Log:
Localize start and end date output in confirm message after access control change.
Index: loncom/interface/portfolio.pm
diff -u loncom/interface/portfolio.pm:1.235 loncom/interface/portfolio.pm:1.236
--- loncom/interface/portfolio.pm:1.235 Fri Jun 8 12:25:59 2012
+++ loncom/interface/portfolio.pm Mon Jul 30 13:10:57 2012
@@ -1,7 +1,7 @@
# The LearningOnline Network
# portfolio browser
#
-# $Id: portfolio.pm,v 1.235 2012/06/08 12:25:59 raeburn Exp $
+# $Id: portfolio.pm,v 1.236 2012/07/30 13:10:57 bisitz Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -981,11 +981,11 @@
$showstart = &mt('Deleted');
$showend = $showstart;
} else {
- $showstart = localtime($start);
+ $showstart = &Apache::lonlocal::locallocaltime($start);
if ($end == 0) {
$showend = &mt('No end date');
} else {
- $showend = localtime($end);
+ $showend = &Apache::lonlocal::locallocaltime($end);
}
}
$r->print('
'.&mt($scope_desc{$scope}));
From raeburn at source.lon-capa.org Tue Jul 31 19:38:13 2012
From: raeburn at source.lon-capa.org (raeburn)
Date: Tue, 31 Jul 2012 23:38:13 -0000
Subject: [LON-CAPA-cvs] cvs: loncom(version_2_11_X) /interface londocs.pm
Message-ID:
raeburn Tue Jul 31 23:38:13 2012 EDT
Modified files: (Branch: version_2_11_X)
/loncom/interface londocs.pm
Log:
- For 2.11
- Backport 1.488, 1.489, 1.490, 1.491, 1.492.
-------------- next part --------------
Index: loncom/interface/londocs.pm
diff -u loncom/interface/londocs.pm:1.484.2.6 loncom/interface/londocs.pm:1.484.2.7
--- loncom/interface/londocs.pm:1.484.2.6 Tue May 29 20:56:34 2012
+++ loncom/interface/londocs.pm Tue Jul 31 23:38:13 2012
@@ -1,7 +1,7 @@
# The LearningOnline Network
# Documents
#
-# $Id: londocs.pm,v 1.484.2.6 2012/05/29 20:56:34 raeburn Exp $
+# $Id: londocs.pm,v 1.484.2.7 2012/07/31 23:38:13 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -40,7 +40,9 @@
use Apache::lonclonecourse;
use Apache::lonnavmaps;
use Apache::lonnavdisplay();
+use Apache::lonuserstate();
use HTML::Entities;
+use HTML::TokeParser;
use GDBM_File;
use Apache::lonlocal;
use Cwd;
@@ -67,10 +69,14 @@
}
sub storemap {
- my ($coursenum,$coursedom,$map)=@_;
+ my ($coursenum,$coursedom,$map,$contentchg)=@_;
+ my $report;
+ if (($contentchg) && ($map =~ /^default/)) {
+ $report = 1;
+ }
my ($outtext,$errtext)=
&LONCAPA::map::storemap('/uploaded/'.$coursedom.'/'.$coursenum.'/'.
- $map,1);
+ $map,1,$report);
if ($errtext) { return ($errtext,2); }
$hadchanges=1;
@@ -303,7 +309,7 @@
join(':', ($name, $url, $ext, 'normal', 'res'));
}
}
- return &storemap($coursenum, $coursedom, $folder.'.'.$container);
+ return &storemap($coursenum, $coursedom, $folder.'.'.$container,1);
}
sub breadcrumbs {
@@ -436,7 +442,7 @@
''."\n";
$r->print(&Apache::loncommon::start_page('Content Change Log',$js));
$r->print(&Apache::lonhtmlcommon::breadcrumbs('Content Change Log'));
- $r->print(&startContentScreen('docs'));
+ $r->print(&startContentScreen(($supplementalflag?'suppdocs':'docs')));
my %orderhash;
my $container='sequence';
my $pathitem;
@@ -455,6 +461,9 @@
my $jumpto = $readfile;
$jumpto =~ s{^/}{};
my $tid = 1;
+ if ($supplementalflag) {
+ $tid = 2;
+ }
my ($breadcrumbtrail) = &breadcrumbs($allowed,$crstype);
$r->print($breadcrumbtrail.
&generate_edit_table($tid,\%orderhash,undef,$iconpath,$jumpto,
@@ -529,18 +538,30 @@
':'.$docslog{$id}{'exe_udom'}.''.
$send_msg_link.'
'.
$docslog{$id}{'logentry'}{'folder'}.'
');
+ my $is_supp = 0;
+ if ($docslog{$id}{'logentry'}{'currentfolder'} =~ /^supplemental/) {
+ $is_supp = 1;
+ }
# Before
for (my $idx=0;$idx<=$docslog{$id}{'logentry'}{'maxidx'};$idx++) {
my $oldname=(split(/\:/,$docslog{$id}{'logentry'}{'before_resources_'.$idx}))[0];
my $newname=(split(/\:/,$docslog{$id}{'logentry'}{'after_resources_'.$idx}))[0];
if ($oldname ne $newname) {
- $r->print(&LONCAPA::map::qtescape($oldname));
+ my $shown = &LONCAPA::map::qtescape($oldname);
+ if ($is_supp) {
+ $shown = &Apache::loncommon::parse_supplemental_title($shown);
+ }
+ $r->print($shown);
}
}
$r->print('
');
for (my $idx=0;$idx<=$docslog{$id}{'logentry'}{'maxidx'};$idx++) {
if ($docslog{$id}{'logentry'}{'before_order_res_'.$idx}) {
- $r->print('
');
}
+ if (keys(%paste_errors) > 0) {
+ $r->print('
'."\n".
+ &mt('The following files are either dependencies of a web page or references within a folder and/or composite page which could not be copied during the paste operation:')."\n".
+ '
'."\n");
+ foreach my $key (sort(keys(%paste_errors))) {
+ $r->print('
'.$key.'
'."\n");
+ }
+ $r->print('
'."\n");
+ }
}
$r->print($upload_output);
if (&handle_edit_cmd()) {
- ($errtext,$fatal)=&storemap($coursenum,$coursedom,$folder.'.'.$container);
+ my $contentchg;
+ if ($env{'form.cmd'} =~ /^(del|cut)_/) {
+ $contentchg = 1;
+ }
+ ($errtext,$fatal)=&storemap($coursenum,$coursedom,$folder.'.'.$container,$contentchg);
return $errtext if ($fatal);
}
# Group import/search
@@ -924,7 +1846,7 @@
$LONCAPA::map::order[$#LONCAPA::map::order+1]=$idx;
}
($errtext,$fatal)=&storemap($coursenum,$coursedom,
- $folder.'.'.$container);
+ $folder.'.'.$container,1);
return $errtext if ($fatal);
} else {
$r->print('
'.&mt('No map selected.').'
');
@@ -1016,7 +1938,7 @@
my $readfile="/uploaded/$coursedom/$coursenum/$folder.$container";
$r->print(&generate_edit_table($tid,$orderhash,$to_show,$iconpath,$jumpto,
$readfile));
- &print_paste_buffer($r,$container);
+ &print_paste_buffer($r,$container,$folder,$coursedom,$coursenum);
} else {
if (&Apache::lonnet::allowed('mdc',$env{'request.course.id'})) {
#Function Box for Supplemental Content for users with mdc priv.
@@ -1104,7 +2026,7 @@
$comment.':'.$url.':'.$ext.':normal:res';
$LONCAPA::map::order[$#LONCAPA::map::order+1]= $newidx;
($errtext,$fatal)=&storemap($coursenum,$coursedom,
- $folder.'.'.$container);
+ $folder.'.'.$container,1);
if ($fatal) {
$$upload_output = '
'.$errtext.'
';
return;
@@ -1192,36 +2114,13 @@
return scalar($title =~ m/^(\d+)___&&&___($match_username)___&&&___($match_domain)___&&&___(.*)$/);
}
-sub parse_supplemental_title {
- my ($title) = @_;
-
- my ($foldertitle,$renametitle);
- if ($title =~ /&&&/) {
- $title = &HTML::Entites::decode($title);
- }
- if ($title =~ m/^(\d+)___&&&___($match_username)___&&&___($match_domain)___&&&___(.*)$/) {
- $renametitle=$4;
- my ($time,$uname,$udom) = ($1,$2,$3);
- $foldertitle=&Apache::lontexconvert::msgtexconverted($4);
- my $name = &Apache::loncommon::plainname($uname,$udom);
- $name = &HTML::Entities::encode($name,'"<>&\'');
- $renametitle = &HTML::Entities::encode($renametitle,'"<>&\'');
- $title=''.&Apache::lonlocal::locallocaltime($time).' '.
- $name.': '.$foldertitle;
- }
- if (wantarray) {
- return ($title,$foldertitle,$renametitle);
- }
- return $title;
-}
-
# --------------------------------------------------------------- An entry line
sub entryline {
my ($index,$title,$url,$folder,$allowed,$residx,$coursenum,$crstype)=@_;
my ($foldertitle,$pagetitle,$renametitle);
if (&is_supplemental_title($title)) {
- ($title,$foldertitle,$renametitle) = &parse_supplemental_title($title);
+ ($title,$foldertitle,$renametitle) = &Apache::loncommon::parse_supplemental_title($title);
$pagetitle = $foldertitle;
} else {
$title=&HTML::Entities::encode($title,'"<>&\'');
@@ -1285,20 +2184,10 @@
'cp' => 'Copy');
my $nocopy=0;
my $nocut=0;
- if ($url=~/\.(page|sequence)$/) {
- if ($url =~ m{/res/}) {
- # no copy for published maps
- $nocopy = 1;
- } else {
- foreach my $item (&Apache::lonsequence::attemptread(&Apache::lonnet::filelocation('',$url),1)) {
- my ($title,$url,$ext,$type)=split(/\:/,$item);
- if (($url=~/\.(page|sequence)/) && ($type ne 'zombie')) {
- $nocopy=1;
- last;
- }
- }
- }
- }
+ if ($url=~ m{^/res/.+\.(page|sequence)$}) {
+ # no copy for published maps
+ $nocopy=1;
+ }
if ($url=~/^\/res\/lib\/templates\//) {
$nocopy=1;
$nocut=1;
@@ -2447,6 +3336,9 @@
onload => "javascript:resize_scrollbox('contentscroll','1','1');",
};
}
+ if ($env{'docs.markedcopy_url'}) {
+ $script .= &paste_popup_js();
+ }
}
# -------------------------------------------------------------------- Body tag
$script = ''
+ .$force_title;
+ }
+# Graphical display after login only
+ if ($env{'request.registered'} && !$forcereg) { return ''; }
+ $result.=&innerregister($forcereg);
+ return $result.$force_title;
+}
+
sub innerregister {
my ($forcereg,$bread_crumbs) = @_;
my $const_space = ($env{'request.state'} eq 'construct');
@@ -467,8 +515,19 @@
$env{'request.registered'} = 1;
+ my $noremote = ($env{'environment.remote'} eq 'off');
+
undef(@inlineremote);
+ my $reopen=&Apache::lonmenu::reopenmenu();
+
+ my $newmail='';
+
+ if (&Apache::lonmsg::newmail() && !$noremote) {
+ # We have new mail and remote is up
+ $newmail= 'swmenu.setstatus("you have","messages");';
+ }
+
my $resurl;
if ( $env{'request.symb'} && $env{'request.course.id'} ) {
@@ -507,10 +566,48 @@
&Apache::lonhtmlcommon::clear_breadcrumbs();
&Apache::lonhtmlcommon::add_breadcrumb({text => 'View Resource'});
}
+ my $timesync = ( $noremote ? '' : 'swmenu.syncclock(1000*'.time.');' );
# =============================================================================
# ============================ This is for URLs that actually can be registered
- return '' unless ( ($env{'request.noversionuri'}!~m{^/(res/)*adm/})
- || $forcereg );
+ unless ( ($env{'request.noversionuri'}!~m{^/(res/)*adm/})
+ || ($forcereg)) {
+ unless ($noremote) {
+# Not registered, graphical
+ return (<
+//
+
+ENDDONOTREGTHIS
+
+ }
+ return '';
+ }
# -- This applies to homework problems for users with grading privileges
my $crs='/'.$env{'request.course.id'};
@@ -792,7 +889,7 @@
s&9&1&wishlist-link.png&Stored Links&wishlistlink[_2]&set_wishlistlink()&Save a link for this resource in your personal Stored Links repository&&1
ENDMENUITEMS
$got_wishlist = 1;
- }
+ }
}
}
my $buttons='';
@@ -813,44 +910,94 @@
}
}
}
-
+ if ($noremote) {
my $addremote=0;
foreach (@inlineremote) { if ($_ ne '') { $addremote=1; last;} }
- if ($addremote) {
+ if ($addremote) {
- &Apache::lonhtmlcommon::clear_breadcrumb_tools();
+ &Apache::lonhtmlcommon::clear_breadcrumb_tools();
- &Apache::lonhtmlcommon::add_breadcrumb_tool(
- 'navigation', @inlineremote[21,23]);
+ &Apache::lonhtmlcommon::add_breadcrumb_tool(
+ 'navigation', @inlineremote[21,23]);
+
+ my $countdown = &countdown_timer();
+ if (&hidden_button_check() eq 'yes') {
+ if ($countdown) {
+ &Apache::lonhtmlcommon::add_breadcrumb_tool('tools',$countdown);
+ }
+ } else {
+ my @tools = @inlineremote[93,91,81,82,83];
+ if ($countdown) {
+ unshift(@tools,$countdown);
+ }
+ &Apache::lonhtmlcommon::add_breadcrumb_tool(
+ 'tools', at tools);
- my $countdown = &countdown_timer();
- if (&hidden_button_check() eq 'yes') {
- if ($countdown) {
- &Apache::lonhtmlcommon::add_breadcrumb_tool('tools',$countdown);
+ #publish button in construction space
+ if ($env{'request.state'} eq 'construct'){
+ &Apache::lonhtmlcommon::add_breadcrumb_tool(
+ 'advtools', $inlineremote[63]);
+ } else {
+ &Apache::lonhtmlcommon::add_breadcrumb_tool(
+ 'tools', $inlineremote[63]);
+ }
+ unless ($env{'request.noversionuri'}=~ m{^/adm/(navmaps|viewclasslist)(\?|$)}) {
+ &Apache::lonhtmlcommon::add_breadcrumb_tool(
+ 'advtools', @inlineremote[61,71,72,73,74,92]);
+ }
+ }
}
} else {
- my @tools = @inlineremote[93,91,81,82,83];
- if ($countdown) {
- unshift(@tools,$countdown);
- }
- &Apache::lonhtmlcommon::add_breadcrumb_tool(
- 'tools', at tools);
+ my $requri=&Apache::lonnet::clutter(&Apache::lonnet::fixversion((split(/\?/,$env{'request.noversionuri'}))[0]));
+ $requri=&Apache::lonenc::check_encrypt(&unescape($requri));
+ my $cursymb=&Apache::lonenc::check_encrypt($env{'request.symb'});
+ my $navstatus=&get_nav_status();
+ my $clearcstr;
- #publish button in construction space
- if ($env{'request.state'} eq 'construct'){
- &Apache::lonhtmlcommon::add_breadcrumb_tool(
- 'advtools', $inlineremote[63]);
- } else {
- &Apache::lonhtmlcommon::add_breadcrumb_tool(
- 'tools', $inlineremote[63]);
- }
-
- unless ($env{'request.noversionuri'}=~ m{^/adm/(navmaps|viewclasslist)(\?|$)}) {
- &Apache::lonhtmlcommon::add_breadcrumb_tool(
- 'advtools', @inlineremote[61,71,72,73,74,92]);
- }
+ if ($env{'user.adv'}) { $clearcstr='clearbut(6,1)'; }
+ return <
+//
+
+ENDREGTHIS
}
- }
return &Apache::lonhtmlcommon::scripttag('', 'start')
. &Apache::lonhtmlcommon::breadcrumbs(undef,undef,0)
@@ -893,10 +1040,22 @@
return $cfile;
}
+sub loadevents() {
+ if ($env{'request.state'} eq 'construct' ||
+ $env{'request.noversionuri'} =~ m{^/res/adm/pages/}) { return ''; }
+ return 'LONCAPAreg();';
+}
+
+sub unloadevents() {
+ if ($env{'request.state'} eq 'construct' ||
+ $env{'request.noversionuri'} =~ m{^/res/adm/pages/}) { return ''; }
+ return 'LONCAPAstale();';
+}
+
sub startupremote {
my ($lowerurl)=@_;
- if ($env{'environment.remote'} eq 'off') {
- return ('');
+ unless ($env{'environment.remote'} eq 'on') {
+ return ('');
}
#
# The Remote actually gets launched!
@@ -974,7 +1133,7 @@
}
sub maincall() {
- if ($env{'environment.remote'} eq 'off') { return ''; }
+ unless ($env{'environment.remote'} eq 'on') { return ''; }
return(<
// '."\n"
.'// 13)) { return ''; }
+ return "\n".qq(window.status+='.';swmenu.clearbut($row,$col););
+ } else {
+ $inlineremote[10*$row+$col]='';
+ return '';
+ }
}
# ============================================ Switch a button or create a link
@@ -1073,6 +1237,14 @@
my $idx=10*$row+$col;
$category_members{$cat}.=':'.$idx;
+ if ($env{'environment.remote'} eq 'on') {
+ if (($row<1) || ($row>13)) { return ''; }
+# Remote
+ $img=~s/\.png$/\.gif/;
+ return "\n".
+ qq(window.status+='.';swmenu.switchbutton($row,$col,"$img","$top","$bot","$act","$desc"););
+ }
+
# Inline Menu
if ($nobreak==2) { return ''; }
my $text=$top.' '.$bot;
@@ -1134,6 +1306,13 @@
return $output;
}
+sub openmenu {
+ my $menuname = &get_menu_name();
+ unless ($env{'environment.remote'} eq 'on') { return ''; }
+ my $nothing = &Apache::lonhtmlcommon::javascript_nothing();
+ return "window.open(".$nothing.",'".$menuname."');";
+}
+
sub inlinemenu {
undef(@inlineremote);
undef(%category_members);
@@ -1176,7 +1355,13 @@
#
my $textualoverride=shift;
my $output='';
- return '' unless $textualoverride;
+ if ($env{'environment.remote'} eq 'on') {
+ $output.=
+ "window.status='Opening Remote Control';var swmenu=".&openmenu().
+"\nwindow.status='Configuring Remote Control ';";
+ } else {
+ unless ($textualoverride) { return ''; }
+ }
my $uname=$env{'user.name'};
my $udom=$env{'user.domain'};
my $adv=$env{'user.adv'};
@@ -1351,6 +1536,12 @@
$uname,$udom,$rol,$crs,$pub,$con,$row,$col,$prt,$img,$top,$bot,$act,$desc,$cat);
}
}
+ if ($env{'environment.remote'} eq 'on') {
+ $output.="\nwindow.status='Synchronizing Time';swmenu.syncclock(1000*".time.");\nwindow.status='Remote Control Configured.';";
+ if (&Apache::lonmsg::newmail()) {
+ $output.='swmenu.setstatus("you have","messages");';
+ }
+ }
return $output;
}
@@ -1379,7 +1570,7 @@
# ======================================================================= Close
sub close {
- if ($env{'environment.remote'} eq 'off') { return ''; }
+ unless ($env{'environment.remote'} eq 'on') { return ''; }
my $menuname = &get_menu_name();
return(<
@@ -1664,6 +1855,16 @@
ENDCONSTSPACEFORM
}
+sub get_nav_status {
+ my $navstatus="swmenu.w_loncapanav_flag=";
+ if ($env{'environment.remotenavmap'} eq 'on') {
+ $navstatus.="1";
+ } else {
+ $navstatus.="-1";
+ }
+ return $navstatus;
+}
+
sub hidden_button_check {
if ( $env{'request.course.id'} eq ''
|| $env{'request.role.adv'} ) {
Index: loncom/auth/lonroles.pm
diff -u loncom/auth/lonroles.pm:1.269 loncom/auth/lonroles.pm:1.269.2.1
--- loncom/auth/lonroles.pm:1.269 Sat Jul 21 21:09:03 2012
+++ loncom/auth/lonroles.pm Fri Aug 3 17:35:39 2012
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# User Roles Screen
#
-# $Id: lonroles.pm,v 1.269 2012/07/21 21:09:03 raeburn Exp $
+# $Id: lonroles.pm,v 1.269.2.1 2012/08/03 17:35:39 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -149,6 +149,7 @@
&Apache::loncommon::content_type($r,'text/html');
&Apache::loncommon::no_cache($r);
$r->send_http_header;
+ my $swinfo=&Apache::lonmenu::rawconfig();
# Breadcrumbs
my $brcrum = [{'href' => $url,
@@ -163,6 +164,11 @@
$url=~s/ /\%20/g;
$r->print(<
+//
+
$msg
$end_page
ENDREDIR
From raeburn at source.lon-capa.org Fri Aug 3 18:38:35 2012
From: raeburn at source.lon-capa.org (raeburn)
Date: Fri, 03 Aug 2012 22:38:35 -0000
Subject: [LON-CAPA-cvs] cvs: loncom(version_2_11_X) /interface lonmenu.pm
Message-ID:
raeburn Fri Aug 3 22:38:35 2012 EDT
Modified files: (Branch: version_2_11_X)
/loncom/interface lonmenu.pm
Log:
- For 2.11.
- Modify changes in 1.1075.2.12 so CSTR button is available for editing
a resource in course context, where uses has au/ca role for resource's
authorship.
- Prevent javascript error for Folder/Page Content item when remote control
is active.
Index: loncom/interface/lonmenu.pm
diff -u loncom/interface/lonmenu.pm:1.369.2.17 loncom/interface/lonmenu.pm:1.369.2.18
--- loncom/interface/lonmenu.pm:1.369.2.17 Fri Aug 3 17:35:32 2012
+++ loncom/interface/lonmenu.pm Fri Aug 3 22:38:35 2012
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Routines to control the menu
#
-# $Id: lonmenu.pm,v 1.369.2.17 2012/08/03 17:35:32 raeburn Exp $
+# $Id: lonmenu.pm,v 1.369.2.18 2012/08/03 22:38:35 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -569,46 +569,8 @@
my $timesync = ( $noremote ? '' : 'swmenu.syncclock(1000*'.time.');' );
# =============================================================================
# ============================ This is for URLs that actually can be registered
- unless ( ($env{'request.noversionuri'}!~m{^/(res/)*adm/})
+ if ( ($env{'request.noversionuri'}!~m{^/(res/)*adm/})
|| ($forcereg)) {
- unless ($noremote) {
-# Not registered, graphical
- return (<
-//
-
-ENDDONOTREGTHIS
-
- }
- return '';
- }
-
# -- This applies to homework problems for users with grading privileges
my $crs='/'.$env{'request.course.id'};
if ($env{'request.course.sec'}) {
@@ -635,11 +597,13 @@
"gocmd('/adm/parmset','set')",
'Content Settings');
}
- if ($env{'request.symb'}=~/^uploaded/ &&
- &Apache::lonnet::allowed('mdc',$crs)) {
- $hwkadd.=&switch('','',7,4,'docs.png','Folder/Page Content','parms[_2]',
- "gocmd('/adm/coursedocs','direct')",
- 'Folder/Page Content');
+ if ($noremote) {
+ if ($env{'request.symb'}=~/^uploaded/ &&
+ &Apache::lonnet::allowed('mdc',$crs)) {
+ $hwkadd.=&switch('','',7,4,'docs.png','Folder/Page Content','parms[_2]',
+ "gocmd('/adm/coursedocs','direct')",
+ 'Folder/Page Content');
+ }
}
# -- End Homework
###
@@ -947,6 +911,10 @@
}
}
}
+ return &Apache::lonhtmlcommon::scripttag('', 'start')
+ . &Apache::lonhtmlcommon::breadcrumbs(undef,undef,0)
+ . &Apache::lonhtmlcommon::scripttag('', 'end');
+
} else {
my $requri=&Apache::lonnet::clutter(&Apache::lonnet::fixversion((split(/\?/,$env{'request.noversionuri'}))[0]));
$requri=&Apache::lonenc::check_encrypt(&unescape($requri));
@@ -998,10 +966,44 @@
ENDREGTHIS
}
+ } else {
+ unless ($noremote) {
+# Not registered, graphical
+ return (<
+//
+
+ENDDONOTREGTHIS
+
+ }
+ return '';
+ }
}
sub is_course_upload {
From raeburn at source.lon-capa.org Sat Aug 4 12:37:49 2012
From: raeburn at source.lon-capa.org (raeburn)
Date: Sat, 04 Aug 2012 16:37:49 -0000
Subject: [LON-CAPA-cvs] cvs: loncom /html/res/adm/pages menu.html
Message-ID:
raeburn Sat Aug 4 16:37:49 2012 EDT
Modified files:
/loncom/html/res/adm/pages menu.html
Log:
- For 2.11
- Remote Control retained in 2.11. Retrieve menu.html from attic.
- Stored links replace bookmarks
- remove set_bookmark() and add set_wishlistlink().
- switchbutton() includes checking that 'b'+idx item is an object.
-------------- next part --------------
Index: loncom/html/res/adm/pages/menu.html
diff -u /dev/null loncom/html/res/adm/pages/menu.html:1.130
--- /dev/null Sat Aug 4 16:37:49 2012
+++ loncom/html/res/adm/pages/menu.html Sat Aug 4 16:37:49 2012
@@ -0,0 +1,656 @@
+
+
+
+LON-CAPA Remote
+
+
+
+
+
+
+
+return '';
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
From raeburn at source.lon-capa.org Sun Aug 5 21:56:02 2012
From: raeburn at source.lon-capa.org (raeburn)
Date: Mon, 06 Aug 2012 01:56:02 -0000
Subject: [LON-CAPA-cvs] cvs: loncom /html/res/adm/pages alnk.png slnk.png
Message-ID:
raeburn Mon Aug 6 01:56:02 2012 EDT
Added files:
/loncom/html/res/adm/pages alnk.png slnk.png
Log:
- For 2.11.
- Icons for adding Stored Link, or viewing Stored Links.
- File names use four-character names for consistency with .gif files
for Remote Control.
From raeburn at source.lon-capa.org Sun Aug 5 22:03:58 2012
From: raeburn at source.lon-capa.org (raeburn)
Date: Mon, 06 Aug 2012 02:03:58 -0000
Subject: [LON-CAPA-cvs] cvs: loncom /html/res/adm/pages alnk.gif slnk.gif
Message-ID:
raeburn Mon Aug 6 02:03:58 2012 EDT
Added files:
/loncom/html/res/adm/pages alnk.gif slnk.gif
Log:
- For 2.11.
Icons for adding "Store Link", or viewing "Stored Links" for Remote Control.
From raeburn at source.lon-capa.org Sun Aug 5 23:34:21 2012
From: raeburn at source.lon-capa.org (raeburn)
Date: Mon, 06 Aug 2012 03:34:21 -0000
Subject: [LON-CAPA-cvs] cvs: doc(version_2_11_X) /loncapafiles
loncapafiles.lpml
Message-ID:
raeburn Mon Aug 6 03:34:21 2012 EDT
Modified files: (Branch: version_2_11_X)
/doc/loncapafiles loncapafiles.lpml
Log:
- For 2.11.
- Bookmarks replaces with Stored Links.
- Remote Control retained.
Index: doc/loncapafiles/loncapafiles.lpml
diff -u doc/loncapafiles/loncapafiles.lpml:1.797.2.14 doc/loncapafiles/loncapafiles.lpml:1.797.2.15
--- doc/loncapafiles/loncapafiles.lpml:1.797.2.14 Thu Aug 2 18:19:34 2012
+++ doc/loncapafiles/loncapafiles.lpml Mon Aug 6 03:34:21 2012
@@ -2,7 +2,7 @@
"http://lpml.sourceforge.net/DTD/lpml.dtd">
-
+