--- loncom/interface/lonhtmlcommon.pm 2012/09/10 09:51:06 1.322 +++ loncom/interface/lonhtmlcommon.pm 2013/06/04 23:12:08 1.346 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # a pile of common html routines # -# $Id: lonhtmlcommon.pm,v 1.322 2012/09/10 09:51:06 foxr Exp $ +# $Id: lonhtmlcommon.pm,v 1.346 2013/06/04 23:12:08 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -61,7 +61,7 @@ use Time::HiRes; use Apache::lonlocal; use Apache::lonnet; use HTML::Entities(); -use LONCAPA; +use LONCAPA qw(:DEFAULT :match); sub java_not_enabled { return "\n".''. @@ -209,10 +209,21 @@ dependencies for a web page uploaded dir =cut sub dependencycheck_js { - my ($symb,$title,$url) = @_; - my $link = '/adm/dependencies?symb='.&HTML::Entities::encode($symb,'<>&"'). - '&title='.&HTML::Entities::encode($title,'<>&"'). - '&url='.&HTML::Entities::encode($url,'<>&"'); + my ($symb,$title,$url,$folderpath,$uri) = @_; + my $link; + if ($symb) { + $link = '/adm/dependencies?symb='.&HTML::Entities::encode($symb,'<>&"'); + } elsif ($folderpath) { + $link = '/adm/dependencies?folderpath='.&HTML::Entities::encode($folderpath,'<>&"'); + $url = $uri; + } elsif ($uri =~ m{^/public/$match_domain/$match_courseid/syllabus$}) { + $link = '/adm/dependencies'; + } + $link .= (($link=~/\?/)?'&':'?').'title='. + &HTML::Entities::encode($title,'<>&"'); + if ($url) { + $link .= '&url='.&HTML::Entities::encode($url,'<>&"'); + } return < // - + ENDJQUERY @@ -1230,6 +1242,17 @@ sub htmlarea_lang { return $lang; } +# return javacsript to activate elements of .colorchooser with jpicker: +# Caller is responsible for enclosing this in