#!/usr/bin/perl # MimerDesk # Web based groupware and eLearning environment # www.mimerdesk.org # # Copyright (C) 2001 Ionstream Ltd. # www.ionstream.fi # # This program 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. # # This program is distributed with a 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 this program; if not, write to the Free Software Foundation, Inc., # 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # $Id: smil.html,v 1.20 2002/06/06 14:58:02 inf Exp $ ########################################### # # # MimerDesk: Media Player # # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # # (c) Sublime software ltd. 2001 # # # # Programmed by: Sublime software # # # ########################################### # Asetukset ################################## use strict; use vars qw ($APPLICATION $ACTIVEGRP $USER $IP $LAST_ACT $trans $FORWARDED $TIME_USED $IDLE $form $ref $sth); use lib::MimerDesk; use CGI::Carp "fatalsToBrowser"; sub print_template; sub get_presentations; $APPLICATION = 'Resources - Media Player'; # Program ################################## read_config('../config/mimerdesk.cfg'); initialize(); $form = decode_multipart(); $form->{'ID'} =~ tr/0-9//cd; $form->{'auth'} =~ tr/0-9a-z//cd; ($USER, $IP, $LAST_ACT, $FORWARDED, $TIME_USED, $IDLE, $ACTIVEGRP) = authenticate($form->{'ID'}, $form->{'auth'}, $form->{'changeGroup'}); $trans = lib::MimerDesk->new_gettext(program => 'Medialist',language => $config{'language'}); $APPLICATION = $trans->gettext("Resources - Media Player"); print_template("$config{'theme'}_medialist"); ################################## # Read template and process it # ################################## sub print_template { my ($template,$ref,$fulltemplate,$medialist); $template = shift; print_header('pragma'); $ref = get_template('maintemplate',$template); $ref->{'maintemplate'} =~ s/<>/$ref->{$template}/m; $fulltemplate = $ref->{'maintemplate'}; $ref = get_template('js_doClock', 'js_help', 'js_gotosite'); my $stuff = join "", ($ref->{'js_doClock'},$ref->{'js_help'},$ref->{'js_gotosite'}); $fulltemplate =~ s/<>/$stuff/ms; $fulltemplate = create_buttons($fulltemplate, 'Resources', 'Media Player', $form); $fulltemplate =~ s/<>/minea/gm; $medialist = get_presentations(); $fulltemplate =~ s/<>/$medialist/m; $fulltemplate =~ s/<>/MimerDesk\: $APPLICATION/ms; $fulltemplate = replace_tags($fulltemplate, $USER, $form->{'auth'}, $form->{'ID'}, $TIME_USED); $fulltemplate = add_popups($fulltemplate, $USER, $form->{'auth'}, $form->{'ID'}); print $fulltemplate; db_end('disconnect'); exit; } sub get_presentations { my ($presentations, $type); lock_tables('READ', 'presentations', 'groupusers','users'); db_list("select * from presentations,groupusers where presentations.groupid = 0 or groupusers.GID and groupusers.USER = '$USER'"); while (my $ref = $sth->fetchrow_hashref()) { # $link="linkki"; if ($ref->{'pres_type'} = 1) {$type=""}; if ($ref->{'pres_type'} = 2) {$type=""}; # startrow(). # column(bgcolor => '#CEDFE8', # content => starttable(border => 3, align => 'center'). $presentations .= startrow(). column(width => '10%', bgcolor => 'white', align => 'center', class => 'content', content => $ref->{'pid'}). column(width => '10%', bgcolor => 'white', align => 'center', class => 'content', content => $ref->{'author'}). column(width => '15%', bgcolor => 'white', align => 'center', class => 'content', content => tagged('a',{href => '#', content => $ref->{'pres_filename'}, onClick => 'popup(\'player.html?w='.$ref->{'pres_width'}.'&h='.$ref->{'pres_height'}.'&src='.$ref->{'pres_url'}.'&auth='.$form->{'auth'}.'&ID='.$form->{'ID'}.'\', '.$ref->{'pres_type'}.', '.($ref->{'pres_width'}+120).', '.($ref->{'pres_height'}+210).')' } )). column(width => '15%', bgcolor => 'white', align => 'center', class => 'content', content => $ref->{'description'}). column(width => '15%', bgcolor => 'white', align => 'center', class => 'content', content => $ref->{'pres_size'}). column(width => '15%', bgcolor => 'white', align => 'center', class => 'content', content => $type). endrow(); # endtable() # ). # endrow(); } #Mariah # $links .= tagged('a',{href => "$ref->{'link_url'}", # class => 'contentLink', # target => 'blank_', # content => $ref->{'link_name'} # }) # .tag('br'); # db_end(); unlock_tables(); # $presentations .= endtable('hasgrid').tag('br'); return $presentations; } # #starttable(width => '95%',align => 'center',cellspacing => 1,cellpadding => 4,gridcolor => 'black'). # startrow(). # column(bgcolor => '#CEDFE8', # content => starttable(). # startrow(). # $startimage. # column(width => '65%',class => 'blackTitle', content => ' '.$title.$addlink). # column(width => '35%',align => 'right', content => $buttons). # endrow(). # endtable() # ). # endrow(). # startrow(bgcolor => 'white'); # if ($toggle) # { # $box .= # column(valign => 'top', class => 'content', content => $content); # } # $box .= endrow(). # endtable('hasgrid').tag('br');