version 1.327, 2011/01/17 20:18:02
|
version 1.331.4.1, 2012/05/10 18:34:18
|
Line 151 sub handler {
|
Line 151 sub handler {
|
## Initialize global variables |
## Initialize global variables |
## |
## |
my $domain = $r->dir_config('lonDefDomain'); |
my $domain = $r->dir_config('lonDefDomain'); |
$diropendb= "/home/httpd/perl/tmp/". |
my $temp_file_dir = LONCAPA::tempdir(); |
|
$diropendb= $temp_file_dir . |
"$env{'user.domain'}_$env{'user.name'}_sel_res.db"; |
"$env{'user.domain'}_$env{'user.name'}_sel_res.db"; |
# |
# |
# set the name of the persistent database |
# set the name of the persistent database |
Line 162 sub handler {
|
Line 163 sub handler {
|
$env{'form.persistent_db_id'} = time; |
$env{'form.persistent_db_id'} = time; |
} |
} |
|
|
my $persistent_db_file = "/home/httpd/perl/tmp/". |
my $persistent_db_file = $temp_file_dir . |
&escape($domain). |
&escape($domain). |
'_'.&escape($env{'user.name'}). |
'_'.&escape($env{'user.name'}). |
'_'.$env{'form.persistent_db_id'}.'_persistent_search.db'; |
'_'.$env{'form.persistent_db_id'}.'_persistent_search.db'; |
Line 2382 END
|
Line 2383 END
|
next; |
next; |
} |
} |
$status=~s|/||g; |
$status=~s|/||g; |
my $datafile=$r->dir_config('lonDaemons').'/tmp/'.$status; |
|
|
|
|
|
|
my $datafile=LONCAPA::tempdir().$status; |
if (-e $datafile && ! -e "$datafile.end") { |
if (-e $datafile && ! -e "$datafile.end") { |
&update_status($r,&mt('Receiving results from [_1]',$server)); |
&update_status($r,&mt('Receiving results from [_1]',$server)); |
next; |
next; |
Line 3058 SCRIPT
|
Line 3062 SCRIPT
|
</script> |
</script> |
SCRIPT |
SCRIPT |
|
|
# HTML-Markup for 'Set a link for this resource to wishlist' |
|
# this is written via JavaScript document.write (function set_wishlistlink) |
|
# it is split into 3 parts and the inputfields for title and path are left out |
|
# these fields are inserted later to set the values for title and path |
|
# automatically via JavaScript (document.title and location.pathname) |
|
my %folders = &Apache::lonnet::get('wishlist',['folders']); |
|
if ($folders{'folders'} eq '') { |
|
$folders{'folders'} = '<option value="" selected="selected">('.&mt('Top level').')</option>'; |
|
} |
|
my $start_page_wishlistlink = |
|
&Apache::loncommon::start_page('Set link to wishlist',undef, |
|
{'only_body' => 1, |
|
'js_ready' => 1, |
|
'bgcolor' => '#FFFFFF',}); |
|
|
|
my $warningLink = &mt('You must insert a title!'); |
|
|
|
my $in_page_wishlistlink1 = '<h1>'.&mt('Set a link to wishlist').'</h1>'. |
|
'<form method="post" name="newlink" action="/adm/wishlist?mode=set" '. |
|
'onsubmit="return newlinksubmit();" >'. |
|
&Apache::lonhtmlcommon::start_pick_box(). |
|
&Apache::lonhtmlcommon::row_title(&mt('Link Title')); |
|
|
|
my $in_page_wishlistlink2 = &Apache::lonhtmlcommon::row_closure(). |
|
&Apache::lonhtmlcommon::row_title(&mt('Path')); |
|
|
|
my $in_page_wishlistlink3 = &Apache::lonhtmlcommon::row_closure(). |
|
&Apache::lonhtmlcommon::row_title(&mt('Note')). |
|
'<textarea name="note" rows="3" cols="35" style="width:100%"></textarea>'. |
|
&Apache::lonhtmlcommon::row_closure(1). |
|
&Apache::lonhtmlcommon::end_pick_box(). |
|
'<br/><br/>'. |
|
'<input type="submit" value="'.&mt('Save in').'" />'. |
|
'<select name="folders">'. |
|
$folders{'folders'}. |
|
'</select>'. |
|
'<input type="button" value="'.&mt('cancel').'" onclick="javascript:window.close();" />'. |
|
'</form>'; |
|
|
|
# remove all \n for inserting on javascript document.write |
|
$in_page_wishlistlink1 =~ s/\n//g; |
|
$in_page_wishlistlink2 =~ s/\n//g; |
|
$in_page_wishlistlink3 =~ s/\n//g; |
|
|
|
my $end_page_wishlistlink = |
|
&Apache::loncommon::end_page({'js_ready' => 1}); |
|
|
|
# Add JavaScript-function to set link for a ressource to wishlist |
|
$js.=<<SCRIPT; |
|
<script type="text/javascript"> |
|
// <![CDATA[ |
|
function set_wishlistlink(title, path){ |
|
if(!title){ |
|
title=document.title; |
|
} |
|
if(!path){ |
|
path=location.pathname; |
|
} |
|
wishlistlink=window.open('','wishlistNewLink','width=560,height=350,scrollbars=0'); |
|
wishlistlink.document.write( |
|
'$start_page_wishlistlink' |
|
+'<script type="text\/javascript">' |
|
+'function newlinksubmit(){' |
|
+'var title = document.getElementsByName("title")[0].value;' |
|
+'if (!title) {' |
|
+'alert("$warningLink");' |
|
+'return false;}' |
|
+'return true;}' |
|
+'<\/scr'+'ipt>' |
|
+'$in_page_wishlistlink1' |
|
+'<input type="text" name="title" size="45" value="'+title+'"/>' |
|
+'$in_page_wishlistlink2' |
|
+'<input type="text" name="path" size="45" value="'+path+'" ' |
|
+'readonly="readonly" style="background-color: #DDDDDD"/>' |
|
+'$in_page_wishlistlink3' |
|
+'$end_page_wishlistlink' ); |
|
wishlistlink.document.close(); |
|
} |
|
|
|
// ]]> |
|
</script> |
|
SCRIPT |
|
|
|
my $start_page = &Apache::loncommon::start_page(undef,$js, |
my $start_page = &Apache::loncommon::start_page(undef,$js, |
{'only_body' =>1}); |
{'only_body' =>1,}); |
my $result=<<END; |
my $result=<<END; |
$start_page |
$start_page |
<form name="results" method="post" action="/adm/searchcat"> |
<form name="results" method="post" action="/adm/searchcat"> |
Line 3261 sub detailed_citation_view {
|
Line 3182 sub detailed_citation_view {
|
$result .= '<b>'.$prefix. |
$result .= '<b>'.$prefix. |
'<img src="'.&Apache::loncommon::icon($values{'url'}).'" alt="" />'.' '. |
'<img src="'.&Apache::loncommon::icon($values{'url'}).'" alt="" />'.' '. |
'<a href="'.$jumpurl.'?inhibitmenu=yes" '. |
'<a href="'.$jumpurl.'?inhibitmenu=yes" '. |
'target="preview">'.$values{'title'}."</a></b>\n". |
'target="preview">'.$values{'title'}."</a></b>\n"; |
'<a href="javascript:;" onclick="set_wishlistlink('."'$values{'title'}','$jumpurl'".')" '. |
|
'title="'.&mt('Set link to wishlist').'">'. |
|
'<img class="LC_icon" src="/res/adm/pages/wishlist.png" '. |
|
'alt="set wishlistlink" style="width:22px;"/></a>'; |
|
$result .= "<p>\n"; |
$result .= "<p>\n"; |
$result .= '<b>'.$values{'author'}.'</b>,'. |
$result .= '<b>'.$values{'author'}.'</b>,'. |
' <i>'.$values{'owner'}.'</i><br />'; |
' <i>'.$values{'owner'}.'</i><br />'; |
Line 3396 sub summary_view {
|
Line 3313 sub summary_view {
|
$jumpurl=~s|^/ext/|http://|; |
$jumpurl=~s|^/ext/|http://|; |
my $link = '<br />'.&display_url($jumpurl,1).'<br />'; |
my $link = '<br />'.&display_url($jumpurl,1).'<br />'; |
|
|
my $titleWL = &mt('Set link to wishlist'); |
|
$result.=<<END; |
$result.=<<END; |
<a href="$jumpurl?inhibitmenu=yes" |
<a href="$jumpurl?inhibitmenu=yes" |
target="preview">$values{'title'}</a> |
target="preview">$values{'title'}</a> |
<a href="javascript:;" onclick="set_wishlistlink('$values{'title'}','$jumpurl')" |
|
title="$titleWL"> |
|
<img class="LC_icon" src="/res/adm/pages/wishlist.png" |
|
alt="set wishlistlink" style="width:22px;"/> |
|
</a> |
|
<br /> |
<br /> |
$link<br /> |
$link<br /> |
$values{'author'}, $values{'owner'} -- $values{'lastrevisiondate'}<br /> |
$values{'author'}, $values{'owner'} -- $values{'lastrevisiondate'}<br /> |
Line 3451 sub compact_view {
|
Line 3362 sub compact_view {
|
$result.=' <span class="LC_nobreak">'. |
$result.=' <span class="LC_nobreak">'. |
'<a href="'.$jumpurl.'?inhibitmenu=yes" target="preview">'. |
'<a href="'.$jumpurl.'?inhibitmenu=yes" target="preview">'. |
&HTML::Entities::encode($values{'title'},'<>&"').'</a></span> '. |
&HTML::Entities::encode($values{'title'},'<>&"').'</a></span> '. |
'<a href="javascript:;" onclick="set_wishlistlink('."'$values{'title'}','$jumpurl'".')" '. |
|
'title="'.&mt('Set link to wishlist').'">'. |
|
'<img class="LC_icon" src="/res/adm/pages/wishlist.png" '. |
|
'alt="set wishlistlink" style="width:22px;"/>'. |
|
'</a>'. |
|
$link.' <b>'.$values{'author'}.'</b> ('.$values{'domain'}.')'; |
$link.' <b>'.$values{'author'}.'</b> ('.$values{'domain'}.')'; |
return $result; |
return $result; |
} |
} |
Line 3497 sub fielded_format_view {
|
Line 3403 sub fielded_format_view {
|
my $jumpurl=$values{'url'}; |
my $jumpurl=$values{'url'}; |
$jumpurl=~s|^/ext/|http://|; |
$jumpurl=~s|^/ext/|http://|; |
|
|
my $titleWL = ('Set link to wishlist'); |
|
my $result=<<END; |
my $result=<<END; |
$prefix <img src="$icon" alt="" /> |
$prefix <img src="$icon" alt="" /> |
<dl> |
<dl> |
<dt>URL:</dt> |
<dt>URL:</dt> |
<dd><a href="$jumpurl?inhibitmenu=yes" |
<dd><a href="$jumpurl?inhibitmenu=yes" |
target='preview'>$values{'url'}</a> |
target='preview'>$values{'url'}</a> |
<a href="javascript:;" onclick="set_wishlistlink('$values{'title'}','$jumpurl')" |
|
title="$titleWL"> |
|
<img class="LC_icon" src="/res/adm/pages/wishlist.png" |
|
alt="set wishlistlink" style="width:22px;"/> |
|
</a> |
|
</dd> |
</dd> |
END |
END |
foreach my $field ('title','author','domain','subject','keywords','notes', |
foreach my $field ('title','author','domain','subject','keywords','notes', |