12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694 |
- <?php
- include_once(api_get_path(LIBRARY_PATH).'fileDisplay.lib.php');
- include('../exercice/hotpotatoes.lib.php');
- function unset_session_resources()
- {
- $_SESSION['addedresource']='';
- $_SESSION['addedresourceid']='';
- api_session_unregister('addedresource');
- api_session_unregister('addedresourceid');
- }
- function show_folder_up()
- {
- global $folder;
- global $source_id, $action, $learnpath_id, $chapter_id, $originalresource;
- $level = get_levels($folder);
- if ($level == 1)
- {
- echo "<a href='".api_get_self()."?content=Document&source_forum=".$_GET['source_forum']."&source_id=$source_id&action=$action&learnpath_id=$learnpath_id&chapter_id=$chapter_id&originalresource=no'><img src='../img/folder_up.gif' border='0' />".get_lang('LevelUp')."</a>";
- }
- if ($level and $level != 0 and $level != 1)
- {
- $folder_up=$folder;
- $folder_temp=explode('/',$folder);
- $last=count($folder_temp)-1;
- unset($folder_temp[$last]);
- $folder_up=implode('/',$folder_temp);
- echo "<a href='".api_get_self()."?content=Document&source_forum=".$_GET['source_forum']."&folder=$folder_up&source_id=$source_id&action=$action&learnpath_id=$learnpath_id&chapter_id=$chapter_id&originalresource=no'><img src='../img/folder_up.gif' border='0' />".get_lang('LevelUp')."</a>";
- }
- }
- function show_documents($folder)
- {
- global $_course;
- global $source_id, $action, $learnpath_id, $chapter_id, $originalresource;
-
-
- if (is_allowed_to_edit())
- {
- $visibility="visibility<>'2'";
- }
- else
- {
- $visibility="visibility='1'";
- }
- $item_property_table = Database::get_course_table(TABLE_ITEM_PROPERTY);
- $document_table = Database::get_course_table(TABLE_DOCUMENT);
- $sql="SELECT * from $document_table, $item_property_table WHERE id=ref AND tool = '".TOOL_DOCUMENT."' AND $visibility AND to_group_id = 0 AND to_user_id IS NULL ORDER BY path ASC";
- $result=api_sql_query($sql,__FILE__,__LINE__);
- while ($row=mysql_fetch_array($result))
- {
- if (!$folder)
- {
- if (get_levels($row['path'])-1==1)
- {
-
- if (file_or_folder($row['path']))
- {
- echo '<img src="../img/file.gif" align="middle" />';
- }
- else
- {
- $image = choose_image($row['path']);
- echo "<img src=\"../img/$image\" align=\"middle\" />";
- }
-
- if (file_or_folder($row['path']))
- {
- echo "<a href='".api_get_self()."?content=Document";
- echo "&folder=".substr($row['path'],1)."&source_id=$source_id&source_forum=".$_GET['source_forum']."&action=$action&learnpath_id=$learnpath_id&chapter_id=$chapter_id&originalresource=no'>".substr($row['path'],1).'</a><br />';
- }
- else
- {
- echo substr($row['path'],1).' ';
- echo showorhide_addresourcelink('Document',$row['id']);
- echo '<br />';
- }
- }
- }
- else
- {
-
-
- $level=get_levels($folder)+1;
-
- $file_level=get_levels($row['path'])-1;
-
-
- if ($file_level==$level)
- {
- $good_paths[]=$row['path'];
- $good_ids[]=$row['id'];
- }
-
-
-
-
-
-
-
-
- }
- }
-
- if ($good_paths)
- {
-
- foreach ($good_paths as $path)
- {
- if (strstr($path,$folder))
- {
- $good_key=key($good_paths);
-
- if (file_or_folder($path))
- {
- echo '<img src="../img/file.gif" align="middle" />';
- }
- else
- {
- $image = choose_image($path);
- echo "<img src=\"../img/$image\" align=\"middle\" />";
- }
-
- if (file_or_folder($path))
- {
- $path=substr($path,1);
- $uri=str_replace($folder,$path,$_SERVER['REQUEST_URI']);
- $newuri=str_replace('add=','addnot=',$uri);
-
- $folder_name=str_replace($folder.'/','',$path);
- echo "<a href='$newuri'>".$folder_name.'</a><br />';
- }
- else
- {
- echo str_replace("/$folder/", '',$path).' ';
- echo showorhide_addresourcelink('Document',$good_ids[$good_key]);
- echo '<br />';
- }
- }
- next($good_paths);
- }
- }
- }
- function file_or_folder($filefolder)
- {
- global $_course;
- global $baseServDir;
- $courseDir = $_course['path'].'/document';
- $baseWorkDir = api_get_path(SYS_COURSE_PATH).$courseDir;
- return (is_dir($baseWorkDir.$filefolder) ? 1 : 0);
- }
- function store_resources($source_type, $source_id)
- {
- global $_course;
- $resource_table = Database::get_course_table(TABLE_LINKED_RESOURCES);
- $addedresource = $_SESSION['addedresource'];
- $addedresourceid = $_SESSION['addedresourceid'];
- if ($_SESSION['addedresource'])
- {
- foreach ($addedresource as $resource_type)
- {
- $sql="INSERT INTO $resource_table (source_type, source_id, resource_type, resource_id) VALUES ('$source_type', '$source_id', '$resource_type', '".$addedresourceid[key($addedresource)]."')";
- api_sql_query($sql,__FILE__,__LINE__);
- $i=key($addedresource);
- next($addedresource);
- }
- $_SESSION['addedresource']='';
- $_SESSION['addedresourceid']='';
- }
- }
- function display_addedresource_link($type, $id, $style='')
- {
- global $_course;
-
- if ($style <> '')
- {
- $styling = ' class="'.$style.'"';
- }
- switch ($type)
- {
- case 'Agenda':
- $TABLEAGENDA = $_course['dbNameGlu'].'calendar_event';
- $result = api_sql_query("SELECT * FROM `$TABLEAGENDA` WHERE id=$id",__FILE__,__LINE__);
- $myrow = mysql_fetch_array($result);
- echo '<img src="../img/agenda.gif" align="middle" /> <a href="../calendar/agenda.php"'.$styling.'>'.$myrow['title']."</a><br />\n";
- break;
- case 'Ad_Valvas':
- $tbl_announcement = $_course['dbNameGlu'].'announcement';
- $result = api_sql_query("SELECT * FROM `$tbl_announcement` WHERE id=$id",__FILE__,__LINE__);
- $myrow = mysql_fetch_array($result);
- echo '<img src="../img/valves.gif" align="middle" /> <a href="../announcements/announcements.php"'.$styling.'>'.$myrow['title']."</a><br />\n";
- break;
- case 'Link':
- $TABLETOOLLINK = $_course['dbNameGlu'].'link';
- $result = api_sql_query("SELECT * FROM `$TABLETOOLLINK` WHERE id=$id",__FILE__,__LINE__);
- $myrow = mysql_fetch_array($result);
- echo '<img src="../img/links.gif" align="middle" /> <a href="#" onclick="javascript:window.open(\'../link/link_goto.php?link_id='.$myrow['id'].'&link_url='.urlencode($myrow['url'])."','MyWindow','width=500,height=400,top='+((screen.height-400)/2)+',left='+((screen.width-500)/2)+',scrollbars=1,resizable=1,menubar=1'); return false;\"".$styling.'>'.$myrow['title']."</a><br />\n";
- break;
- case 'Exercise':
- $TBL_EXERCICES = $_course['dbNameGlu'].'quiz';
- $result = api_sql_query("SELECT * FROM `$TBL_EXERCICES` WHERE id=$id",__FILE__,__LINE__);
- $myrow = mysql_fetch_array($result);
- echo '<img src="../img/quiz.gif" align="middle" /> <a href="../exercice/exercice_submit.php?exerciseId='.$myrow['id'].'"'.$styling.'>'.$myrow['title']."</a><br />\n";
- break;
- case 'Forum':
- $TBL_FORUMS = $_course['dbNameGlu'].'bb_forums';
- $result = api_sql_query("SELECT * FROM `$TBL_FORUMS` WHERE forum_id=$id",__FILE__,__LINE__);
- $myrow = mysql_fetch_array($result);
- echo '<img src="../img/forum.gif" align="middle" /> <a href="../phpbb/viewforum.php?forum='.$myrow['forum_id'].'&md5='.$myrow['md5'].'"'.$styling.'>'.$myrow['forum_name']."</a><br />\n";
- break;
- case 'Thread':
- $tbl_posts = $_course['dbNameGlu'].'bb_posts';
- $tbl_posts_text = $_course['dbNameGlu'].'bb_posts_text';
- $TBL_FORUMS = $_course['dbNameGlu'].'bb_forums';
- $result = api_sql_query("SELECT * FROM `$tbl_posts` posts, `$TBL_FORUMS` forum WHERE forum.forum_id=posts.forum_id and post_id=$id",__FILE__,__LINE__);
- $myrow = mysql_fetch_array($result);
-
- $sql_title = "SELECT * FROM `$tbl_posts_text` WHERE post_id=".$myrow["post_id"];
- $result_title = api_sql_query($sql_title,__FILE__,__LINE__);
- $myrow_title = mysql_fetch_array($result_title);
- echo '<img src="../img/forum.gif" align="middle" /> <a href="../phpbb/viewtopic.php?topic='.$myrow['topic_id'].'&forum='.$myrow['forum_id'].'&md5='.$myrow['md5'].'"'.$styling.'>'.$myrow_title['post_title']."</a><br />\n";
- break;
- case 'Post':
- $tbl_post = Database::get_course_table(TABLE_FORUM_POST);
- $tbl_post_text = Database::get_course_table(TOOL_FORUM_POST_TEXT_TABLE);
- $sql = "SELECT * FROM $tbl_post p, $tbl_post_text t WHERE p.post_id = t.post_id AND p.post_id = $id";
- $result = api_sql_query($sql,__FILE__,__LINE__);
- $post = mysql_fetch_object($result);
- echo '<img src="../img/forum.gif" align="middle" /> <a href="../phpbb/viewtopic.php?topic='.$post->topic_id.'&forum='.$post->forum_id.'"'.$styling.'>'.$post->post_title."</a><br />\n";
- break;
- case 'Document':
- $dbTable = $_course['dbNameGlu'].'document';
- $result = api_sql_query("SELECT * FROM `$dbTable` WHERE id=$id",__FILE__,__LINE__);
- $myrow = mysql_fetch_array($result);
- $pathname = explode('/',$myrow['path']);
- $last = count($pathname) - 1;
- $filename = $pathname[$last];
- $image = choose_image($filename);
- $ext = explode('.',$filename);
- $ext = strtolower($ext[sizeof($ext)-1]);
- $myrow['path'] = rawurlencode($myrow['path']);
- $in_frames = in_array($ext, array('htm','html','gif','jpg','jpeg','png'));
- echo '<img src="../img/'.$image.'" align="middle" /> <a href="../document/'.($in_frames ? 'showinframes.php?file=' : 'download.php?doc_url=').$myrow['path'].'"'.$styling.'>'.$filename."</a><br />\n";
- break;
- case 'Externallink':
- echo '<img src="../img/links.gif" align="middle" /> <a href="'.$id.'"'.$styling.'>'.$id."</a><br />\n";
- break;
- }
- }
- function display_addedresource_link_in_learnpath($type, $id, $completed, $id_in_path, $builder, $icon, $level = 0)
- {
- global $learnpath_id, $tbl_learnpath_item, $items;
- global $_course, $curDirPath, $_configuration, $enableDocumentParsing, $_user, $_cid;
- $hyperlink_target_parameter = '';
- $length = ((($builder == 'builder') and ($icon == 'nolink')) ? 65 : 32);
- if ($builder != 'builder') $origin = 'learnpath';
- $linktype = $type;
- if (($type == 'Link _self') or ($type == 'Link _blank')) $type = 'Link';
- switch ($type)
- {
- case "Agenda":
- $TABLEAGENDA = $_course['dbNameGlu']."calendar_event";
- $result = api_sql_query("SELECT * FROM `$TABLEAGENDA` WHERE id=$id",__FILE__,__LINE__);
- $myrow=mysql_fetch_array($result);
- $sql="select * from $tbl_learnpath_item where id=$id_in_path";
- $result=api_sql_query($sql,__FILE__,__LINE__); $row=mysql_fetch_array($result);
- if ($row['title'] != '') { $myrow["title"]=$row['title']; }
- $desc=$row['description'];
- $agenda_id=$row['item_id'];
- echo str_repeat(" >",$level);
- if (($builder != 'builder') and ($icon != 'wrap')) { echo "<td>"; }
- if ($icon != 'nolink')
- {
- if ($completed=='completed') {
- echo "<img src='../img/checkbox_on2.gif' border='0' width='13' height='11' alt='on'>";
- } else {
- echo "<img src='../img/checkbox_on2.gif' border='0' width='13' height='11' alt='on' style='visibility: hidden'>";
-
- }
- }
- if (($builder != 'builder') and ($icon != 'wrap')) { echo "</td><td>"; }
- if ($myrow["title"]=='') { echo "<span class='messagesmall'>".get_lang('StepDeleted1')." $type ".get_lang('StepDeleted2')."</span>"; return(true); }
- if ($icon == 'nolink') { return(shorten($myrow["title"],$length)); }
- if ($icon == 'icon') { echo "<img src='../img/agenda.gif' align=\"absmiddle\" alt='agenda'>"; }
- if ($builder != 'builder')
- {
- echo "<a href=\"".api_get_self()."?action=closelesson&source_forum=".$_GET['source_forum']."&how=complete&id_in_path=$id_in_path&learnpath_id=$learnpath_id&type=Agenda&origin=$origin&agenda_id=$agenda_id#$id_in_path\" class='$completed'>".shorten($myrow["title"],($length-3*$level))."</a>";
- $items[]=api_get_self()."?action=closelesson&source_forum=".$_GET['source_forum']."&how=complete&id_in_path=$id_in_path&learnpath_id=$learnpath_id&type=Agenda&origin=$origin&agenda_id=$agenda_id#$id_in_path";
- if ($desc != '')
- {
- if ($icon != 'wrap')
- {
- echo "</tr><tr><td></td><td></td><td><div class='description'> ".shorten($desc,($length-3*$level))."</div></td></tr>";
- }
- else
- {
- echo "<div class='description'> ".shorten($desc,($length-3*$level))."</div>";
- }
- }
- }
- else
- {
- echo "<a href=\"../calendar/agenda.php?origin=$origin&agenda_id=$agenda_id\" class='$completed' target='_blank'>".shorten($myrow["title"],($length-3*$level))."</a>";
- }
- break;
- case "Ad_Valvas":
- $tbl_announcement = $_course['dbNameGlu']."announcement";
- $result = api_sql_query("SELECT * FROM `$tbl_announcement` WHERE id=$id",__FILE__,__LINE__);
- $myrow=mysql_fetch_array($result);
- $sql="select * from $tbl_learnpath_item where id=$id_in_path";
- $result=api_sql_query($sql,__FILE__,__LINE__); $row=mysql_fetch_array($result);
- if ($row['title'] != '') { $myrow["content"]=$row['title']; }
- $desc=$row['description'];
- $ann_id=$row['item_id'];
- echo str_repeat(" >",$level);
-
- list($title, $text)=split('<br>',$myrow['content']);
- if ($title=='') { $title=$myrow['content']; }
- $title=$myrow['title'];
- $text=$myrow['content'];
- if (($builder != 'builder') and ($icon != 'wrap')) { echo "<td>"; }
- if ($icon != 'nolink')
- {
- if ($completed=='completed') {
- echo "<img src='../img/checkbox_on2.gif' border='0' width='13' height='11' alt='on'>";
- } else {
- echo "<img src='../img/checkbox_on2.gif' border='0' width='13' height='11' alt='on' style='visibility: hidden'>";
-
- }
- }
- if (($builder != 'builder') and ($icon != 'wrap')) { echo "</td><td>"; }
- if ($title=='') {
- $type="Announcement";
- echo "<span class='messagesmall'>".get_lang('StepDeleted1')." $type ".get_lang('StepDeleted2')."</span>";
- return(true);
- }
- if ($icon == 'nolink') { return(shorten($title,$length)); }
- if ($icon == 'icon') { echo "<img src='../img/valves.gif' align=\"absmiddle\" alt='ad valvas'>"; }
- if ($builder != 'builder')
- {
- echo "<a href=\"".api_get_self()."?action=closelesson&source_forum=".$_GET['source_forum']."&how=complete&id_in_path=$id_in_path&learnpath_id=$learnpath_id&type=Ad_Valvas&origin=$origin&ann_id=$ann_id#$id_in_path\" class='$completed'>".shorten($title,($length-3*$level))."</a>";
- $items[]=api_get_self()."?action=closelesson&source_forum=".$_GET['source_forum']."&how=complete&id_in_path=$id_in_path&learnpath_id=$learnpath_id&type=Ad_Valvas&origin=$origin&ann_id=$ann_id#$id_in_path";
- if ($desc != '')
- {
- if ($icon != 'wrap')
- {
- echo "</tr><tr><td></td><td></td><td><div class='description'> ".shorten($desc,($length-3*$level))."</div></td></tr>";
- }
- else
- {
- echo "<div class='description'> ".shorten($desc,($length-3*$level))."</div>";
- }
- }
- }
- else
- {
- echo "<a href=\"../announcements/announcements.php?origin=$origin&ann_id=$ann_id\" class='$completed' target='_blank'>".shorten($title,($length-3*$level))."</a>";
- }
- break;
- case "Link" :
- $TABLETOOLLINK = $_course['dbNameGlu']."link";
- $result= api_sql_query("SELECT * FROM `$TABLETOOLLINK` WHERE id=$id",__FILE__,__LINE__);
- $myrow=mysql_fetch_array($result);
- $sql="select * from $tbl_learnpath_item where id=$id_in_path";
- $result=api_sql_query($sql,__FILE__,__LINE__); $row=mysql_fetch_array($result);
- if ($row['title'] != '') { $myrow["title"]=$row['title']; }
- $desc=$row['description'];
- echo str_repeat(" >",$level);
- if (($builder != 'builder') and ($icon != 'wrap')) { echo "<td>"; }
- if ($icon != 'nolink')
- {
- if ($completed=='completed') {
- echo "<img src='../img/checkbox_on2.gif' border='0' width='13' height='11' alt='on'>";
- } else {
- echo "<img src='../img/checkbox_on2.gif' border='0' width='13' height='11' alt='on' style='visibility: hidden'>";
-
- }
- }
- if (($builder != 'builder') and ($icon != 'wrap')) { echo "</td><td>"; }
- if ($myrow["title"]=='')
- {
- echo "<span class='messagesmall'>".get_lang('StepDeleted1')." $type ".get_lang('StepDeleted2')."</span>";
- return(true);
- }
- if ($icon == 'nolink') { return(shorten($myrow["title"],$length)); }
- if ($icon == 'icon')
- {
- if ($linktype=='Link _self') { echo "<img src='../img/links.gif' align=\"absmiddle\" alt='links'>"; }
- else { echo "<img src='../img/link_blank.gif' align=\"absmiddle\" alt='blank links'>"; }
- }
- $thelink=$myrow["url"];
- if ($builder != 'builder')
- {
- echo "<a href=\"".api_get_self()."?action=closelesson&source_forum=".$_GET['source_forum']."&how=complete&id_in_path=$id_in_path&learnpath_id=$learnpath_id&type=$linktype&origin=$origin&thelink=$thelink#$id_in_path\" class='$completed'>".shorten($myrow["title"],($length-3*$level))."</a>";
- $items[]=api_get_self()."?action=closelesson&source_forum=".$_GET['source_forum']."&how=complete&id_in_path=$id_in_path&learnpath_id=$learnpath_id&type=$linktype&origin=$origin&thelink=$thelink#$id_in_path";
- if ($desc != '')
- {
- if ($icon != 'wrap')
- {
- echo "</tr><tr><td></td><td></td><td><div class='description'> ".shorten($desc,($length-3*$level))."</div></td></tr>";
- }
- else
- {
- echo "<div class='description'> ".shorten($desc,($length-3*$level))."</div>";
- }
- }
- }
- else
- {
- echo "<a href=\"$thelink\" class='$completed' target='_blank'>".shorten($myrow["title"],($length-3*$level))."</a>";
- }
- break;
- case "Exercise":
- $TBL_EXERCICES = $_course['dbNameGlu'].'quiz';
- $result= api_sql_query("SELECT * FROM `$TBL_EXERCICES` WHERE id=$id",__FILE__,__LINE__);
- $myrow=mysql_fetch_array($result);
- if ($builder=='builder') { $origin='builder'; }
-
- $sql="select * from $tbl_learnpath_item where id=$id_in_path";
- $result=api_sql_query($sql,__FILE__,__LINE__); $row=mysql_fetch_array($result);
- if ($row['title'] != '') { $myrow["title"]=$row['title']; }
- $desc=$row['description'];
- echo str_repeat(" >",$level);
- if (($builder != 'builder') and ($icon != 'wrap')) { echo "<td>"; }
- if ($icon != 'nolink')
- {
- if ($completed=='completed') {
- echo "<img src='../img/checkbox_on2.gif' border='0' width='13' height='11' alt='on'>";
- } else {
- echo "<img src='../img/checkbox_on2.gif' border='0' width='13' height='11' alt='on' style='visibility: hidden'>";
-
- }
- }
- if (($builder != 'builder') and ($icon != 'wrap')) { echo "</td><td>"; }
- if ($myrow["title"]=='') {
- echo "<span class='messagesmall'>".get_lang('StepDeleted1')." $type ".get_lang('StepDeleted2')."</span>";
- return(true);
- }
- if ($icon == 'nolink') { return(shorten($myrow["title"],$length)); }
- if ($icon == 'icon') { echo "<img src='../img/quiz.gif' align=\"absmiddle\" alt='quizz'>"; }
- if ($builder != 'builder')
- {
- echo "<a href=\"".api_get_self()."?action=closelesson&source_forum=".$_GET['source_forum']."&how=complete&id_in_path=$id_in_path&learnpath_id=$learnpath_id&type=Exercise&origin=$origin&exerciseId=".$myrow["id"]."#$id_in_path\" class='$completed'>".shorten($myrow["title"],($length-3*$level))."</a>";
- $items[]=api_get_self()."?action=closelesson&source_forum=".$_GET['source_forum']."&how=complete&id_in_path=$id_in_path&learnpath_id=$learnpath_id&type=Exercise&origin=$origin&exerciseId=".$myrow["id"]."#$id_in_path";
- if ($desc != '')
- {
- if ($icon != 'wrap')
- {
- echo "</tr><tr><td></td><td></td><td><div class='description'> ".shorten($desc,($length-3*$level))."</div></td></tr>";
- }
- else
- {
- echo "<div class='description'> ".shorten($desc,($length-3*$level))."</div>";
- }
- }
- }
- else
- {
- echo "<a href=\"../exercice/exercice_submit.php?origin=$origin&exerciseId=".$myrow["id"]."\" class='$completed' target='_blank'>".shorten($myrow["title"],($length-3*$level))."</a>";
- }
- break;
- case "HotPotatoes":
- $TBL_DOCUMENT = $_course['dbNameGlu'].'document';
- $documentPath=api_get_path('SYS_COURSE_PATH').$_course['path'].'/document';
- $result = api_sql_query("SELECT * FROM `".$TBL_DOCUMENT."` WHERE id=$id");
- $myrow= mysql_fetch_array($result);
- $path=$myrow["path"];
- $name=GetQuizName($path,$documentPath);
- if ($builder=='builder') { $origin='builder'; }
-
- $sql="select * from $tbl_learnpath_item where id=$id_in_path";
- $result=api_sql_query($sql,__FILE__,__LINE__); $row=mysql_fetch_array($result);
- if ($row['title'] != '') { $name=$row['title']; }
- $desc=$row['description'];
- echo str_repeat(" >",$level);
- if (($builder != 'builder') and ($icon != 'wrap')) { echo "<td>"; }
- if ($icon != 'nolink')
- {
- if ($completed=='completed') {
- echo "<img src='../img/checkbox_on2.gif' border='0' width='13' height='11' alt='on'>";
- } else {
- echo "<img src='../img/checkbox_on2.gif' border='0' width='13' height='11' alt='on' style='visibility: hidden'>";
-
- }
- }
- if (($builder != 'builder') and ($icon != 'wrap')) { echo "</td><td>"; }
- if ($name=='') { echo "<span class='messagesmall'>".get_lang('StepDeleted1')." $type ".get_lang('StepDeleted2')."</span>"; return(true); }
- if ($icon == 'nolink') { return(shorten($name,$length)); }
- if ($icon == 'icon') { echo "<img src='../img/jqz.gif' align=\"absmiddle\" alt='hot potatoes'>"; }
- $cid = $_course['official_code'];
- if ($builder != 'builder')
- {
- echo "<a href=\"".api_get_self()."?action=closelesson&source_forum=".$_GET['source_forum']."&how=complete&id_in_path=$id_in_path&learnpath_id=$learnpath_id&type=HotPotatoes&origin=$origin&id=$id#$id_in_path\" class='$completed'>".shorten($name,($length-3*$level))."</a>";
- $items[]=api_get_self()."?action=closelesson&source_forum=".$_GET['source_forum']."&how=complete&id_in_path=$id_in_path&learnpath_id=$learnpath_id&type=HotPotatoes&origin=$origin&id=$id#$id_in_path";
- if ($desc != '')
- {
- if ($icon != 'wrap')
- {
- echo "</tr><tr><td></td><td></td><td><div class='description'> ".shorten($desc,($length-3*$level))."</div></td></tr>";
- }
- else
- {
- echo "<div class='description'> ".shorten($desc,($length-3*$level))."</div>";
- }
- }
- }
- else
- {
- echo " <a href=\"../exercice/showinframes.php?file=$path&cid=$cid&uid=".$_user['user_id']."\" class='$completed' target='_blank'>".shorten($name,($length-3*$level))."</a>";
- }
- break;
- case "Forum":
- $TBL_FORUMS = $_course['dbNameGlu']."bb_forums";
- $result= api_sql_query("SELECT * FROM `$TBL_FORUMS` WHERE forum_id=$id",__FILE__,__LINE__);
- $myrow=mysql_fetch_array($result);
- $sql="select * from $tbl_learnpath_item where id=$id_in_path";
- $result=api_sql_query($sql,__FILE__,__LINE__); $row=mysql_fetch_array($result);
- if ($row['title'] != '') { $myrow["forum_name"]=$row['title']; }
- $desc=$row['description'];
- echo str_repeat(" >",$level);
- if (($builder != 'builder') and ($icon != 'wrap')) { echo "<td>"; }
- if ($icon != 'nolink')
- {
- if ($completed=='completed') {
- echo "<img src='../img/checkbox_on2.gif' border='0' width='13' height='11' alt='on'>";
- } else {
- echo "<img src='../img/checkbox_on2.gif' border='0' width='13' height='11' alt='on' style='visibility: hidden'>";
-
- }
- }
- if (($builder != 'builder') and ($icon != 'wrap')) { echo "</td><td>"; }
- if ($myrow["forum_name"]=='') { $type="Forum"; echo "<span class='messagesmall'>".get_lang('StepDeleted1')." $type ".get_lang('step_deleted2')."</span>"; return(true); }
- if ($icon == 'nolink') { return(shorten($myrow["forum_name"],$length)); }
- if ($icon == 'icon') { echo "<img src='../img/forum.gif' align=\"absmiddle\" alt='forum'>"; }
- $forumparameters="forum=".$myrow["forum_id"]."&md5=".$myrow["md5"];
- if ($builder != 'builder')
- {
- echo "<a href=\"".api_get_self()."?action=closelesson&source_forum=".$_GET['source_forum']."&how=complete&id_in_path=$id_in_path&learnpath_id=$learnpath_id&type=Forum&origin=$origin&forumparameters=$forumparameters#$id_in_path\" class='$completed'>".shorten($myrow["forum_name"],($length-3*$level))."</a>";
- $items[]=api_get_self()."?action=closelesson&source_forum=".$_GET['source_forum']."&how=complete&id_in_path=$id_in_path&learnpath_id=$learnpath_id&type=Forum&origin=$origin&forumparameters=$forumparameters#$id_in_path";
- if ($desc != '')
- {
- if ($icon != 'wrap')
- {
- echo "</tr><tr><td></td><td></td><td><div class='description'> ".shorten($desc,($length-3*$level))."</div></td></tr>";
- }
- else
- {
- echo "<div class='description'> ".shorten($desc,($length-3*$level))."</div>";
- }
- }
- }
- else
- {
- echo "<a href=\"../phpbb/viewforum.php?$forumparameters\" class='$completed' target='_blank'>".shorten($myrow["forum_name"],($length-3*$level))."</a>";
- }
- break;
- case "Thread":
- $tbl_topics = $_course['dbNameGlu'].'bb_topics';
- $tbl_posts = $_course['dbNameGlu'].'bb_posts';
- $TBL_FORUMS = $_course['dbNameGlu']."bb_forums";
- $sql="SELECT * FROM `$tbl_topics` where topic_id=$id";
- $result= api_sql_query($sql,__FILE__,__LINE__);
- $myrow=mysql_fetch_array($result);
- $sql="select * from $tbl_learnpath_item where id=$id_in_path";
- $result=api_sql_query($sql,__FILE__,__LINE__); $row=mysql_fetch_array($result);
- if ($row['title'] != '') { $myrow["topic_title"]=$row['title']; }
- $desc=$row['description'];
- echo str_repeat(" >",$level);
- if (($builder != 'builder') and ($icon != 'wrap')) { echo "<td>"; }
- if ($icon != 'nolink')
- {
- if ($completed=='completed') {
- echo "<img src='../img/checkbox_on2.gif' border='0' width='13' height='11' alt='on'>";
- } else {
- echo "<img src='../img/checkbox_on2.gif' border='0' width='13' height='11' alt='on' style='visibility: hidden'>";
-
- }
- }
- if (($builder != 'builder') and ($icon != 'wrap')) { echo "</td><td>"; }
- if ($myrow["topic_title"]=='') { $type="Forum Post"; echo "<span class='messagesmall'>".get_lang('StepDeleted1')." $type ".get_lang('StepDeleted2')."</span>"; return(true); }
- if ($icon == 'nolink') { return(shorten($myrow["topic_title"],$length)); }
- if ($icon == 'icon') { echo "<img src='../img/forum.gif' align=\"absmiddle\" alt='forum'>"; }
- if ($builder != 'builder')
- {
- echo "<a href=\"".api_get_self()."?action=closelesson&source_forum=".$_GET['source_forum']."&how=complete&id_in_path=$id_in_path&learnpath_id=$learnpath_id&type=Thread&origin=$origin&topic=".$myrow["topic_id"]."&forum=".$myrow["forum_id"]."&md5=".$myrow["md5"]."#$id_in_path\" class='$completed'>".shorten($myrow["topic_title"],($length-3*$level))."</a>";
- $items[]=api_get_self()."?action=closelesson&source_forum=".$_GET['source_forum']."&how=complete&id_in_path=$id_in_path&learnpath_id=$learnpath_id&type=Thread&origin=$origin&topic=".$myrow["topic_id"]."&forum=".$myrow["forum_id"]."&md5=".$myrow["md5"]."#$id_in_path";
- if ($desc != '')
- {
- if ($icon != 'wrap')
- {
- echo "</tr><tr><td></td><td></td><td><div class='description'> ".shorten($desc,($length-3*$level))."</div></td></tr>";
- }
- else
- {
- echo "<div class='description'> ".shorten($desc,($length-3*$level))."</div>";
- }
- }
- }
- else
- {
- echo "<a href=\"../phpbb/viewtopic.php?topic=".$myrow["topic_id"]."&forum=".$myrow["forum_id"]."&md5=".$myrow["md5"]."\" class='$completed' target='_blank'>".shorten($myrow["topic_title"],($length-3*$level))."</a>";
- }
- break;
- case "Post":
- $tbl_posts = $_course['dbNameGlu'].'bb_posts';
- $tbl_posts_text = $_course['dbNameGlu'].'bb_posts_text';
- $TBL_FORUMS = $_course['dbNameGlu']."bb_forums";
- $result= api_sql_query("SELECT * FROM `$tbl_posts` where post_id=$id",__FILE__,__LINE__);
- $myrow=mysql_fetch_array($result);
-
- $sql_titel="SELECT * FROM `$tbl_posts_text` WHERE post_id=".$myrow["post_id"];
- $result_titel=api_sql_query($sql_titel,__FILE__,__LINE__);
- $myrow_titel=mysql_fetch_array($result_titel);
- $sql="select * from $tbl_learnpath_item where id=$id_in_path";
- $result=api_sql_query($sql,__FILE__,__LINE__); $row=mysql_fetch_array($result);
- if ($row['title'] != '') { $myrow_titel["post_title"]=$row['title']; }
- $desc=$row['description'];
- echo str_repeat(" >",$level);
- $posternom=$myrow['nom']; $posterprenom=$myrow['prenom'];
- $posttime=$myrow['post_time']; $posttext=$myrow_titel['post_text'];
- $posttitle=$myrow_titel['post_title'];
- $posttext = str_replace('"',"'",$posttext);
- if (($builder != 'builder') and ($icon != 'wrap')) { echo "<td>"; }
- if ($icon != 'nolink')
- {
- if ($completed=='completed') {
- echo "<img src='../img/checkbox_on2.gif' border='0' width='13' height='11' alt='on'>";
- } else {
- echo "<img src='../img/checkbox_on2.gif' border='0' width='13' height='11' alt='on' style='visibility: hidden'>";
-
- }
- }
- if (($builder != 'builder') and ($icon != 'wrap')) { echo "</td><td>"; }
- if ($myrow_titel["post_title"]=='')
- {
- $type="Forum";
- echo "<span class='messagesmall'>".get_lang('StepDeleted1')." $type ".get_lang('StepDeleted2')."</span>"; return(true);
- }
- if ($icon == 'nolink') { return(shorten($myrow_titel["post_title"],$length)); }
- if ($icon == 'icon') { echo "<img src='../img/forum.gif' align=\"absmiddle\" alt='forum'>"; }
- if ($builder != 'builder')
- {
- echo "<a href=\"".api_get_self()."?action=closelesson&source_forum=".$_GET['source_forum']."&how=complete&id_in_path=$id_in_path&learnpath_id=$learnpath_id&type=Post&origin=$origin&posternom=$posternom&posterprenom=$posterprenom&posttime=$posttime&posttext=$posttext&posttitle=$posttitle#$id_in_path\" class='$completed'>".shorten($myrow_titel["post_title"],($length-3*$level))."</a>"; $items[]=api_get_self()."?action=closelesson&source_forum=".$_GET['source_forum']."&how=complete&id_in_path=$id_in_path&learnpath_id=$learnpath_id&type=Post&origin=$origin&posternom=$posternom&posterprenom=$posterprenom&posttime=$posttime&posttext=$posttext&posttitle=$posttitle#$id_in_path";
- if ($desc != '')
- {
- if ($icon != 'wrap')
- {
- echo "</tr><tr><td></td><td></td><td><div class='description'> ".shorten($desc,($length-3*$level))."</div></td></tr>";
- }
- else
- {
- echo "<div class='description'> ".shorten($desc,($length-3*$level))."</div>";
- }
- }
- }
- else
- {
- echo "<a href=\"../phpbb/viewtopic.php?topic=".$myrow["topic_id"]."&forum=".$myrow["forum_id"]."&md5=".$myrow["md5"]."\" class='$completed' target='_blank'>".shorten($myrow_titel["post_title"],($length-3*$level))."</a>";
- }
- break;
- case "Document":
- $dbTable = $_course['dbNameGlu']."document";
- $result=api_sql_query("SELECT * FROM `$dbTable` WHERE id=$id",__FILE__,__LINE__);
- $myrow=mysql_fetch_array($result);
- $pathname=explode("/",$myrow["path"]);
- $last=count($pathname)-1;
- $filename=$pathname[$last];
- if (($builder != 'builder') and ($icon != 'wrap')) { echo "<td>"; }
- echo str_repeat(" >",$level);
- if ($icon != 'nolink') {
- if ($completed=='completed') {
- echo "<img src='../img/checkbox_on2.gif' border='0' width='13' height='11' alt='on'>";
- } else {
- echo "<img src='../img/checkbox_on2.gif' border='0' width='13' height='11' alt='on' style='visibility: hidden'>";
-
- }
- }
- if (($builder != 'builder') and ($icon != 'wrap')) { echo "</td><td>"; }
- $image=choose_image($filename);
- $sql="select * from $tbl_learnpath_item where id=$id_in_path";
- $result=api_sql_query($sql,__FILE__,__LINE__); $row=mysql_fetch_array($result);
- if ($row['title'] != '') { $filename=$row['title']; }
- $desc=$row['description'];
- if (($myrow["path"]=='') and ($filename=='')) {
- echo "<span class='messagesmall'>".get_lang('StepDeleted1')." $type ".get_lang('StepDeleted2')."</span>";
- return(true);
- }
- if ($icon == 'nolink') { return(shorten($filename,$length)); }
- if ($icon == 'icon') { echo "<img src='../img/$image' align=\"absmiddle\" alt='$image'>"; }
- if ($builder != 'builder')
- {
- echo "<a href=\"".api_get_self()."?action=closelesson&source_forum=".$_GET['source_forum']."&how=complete&id_in_path=$id_in_path&learnpath_id=$learnpath_id&type=Document&origin=$origin&docurl=".$myrow["path"]."#$id_in_path\" class='$completed'>".shorten($filename,($length-3*$level))."</a>";
- if ($desc != '')
- {
- if ($icon != 'wrap')
- {
- echo "</tr><tr><td></td><td></td><td><div class='description'> ".shorten($desc,($length-3*$level))."</div></td></tr>";
- }
- else
- {
- echo "<div class='description'> ".shorten($desc,($length-3*$level))."</div>";
- }
- } $items[]=api_get_self()."?action=closelesson&source_forum=".$_GET['source_forum']."&how=complete&id_in_path=$id_in_path&learnpath_id=$learnpath_id&type=Document&origin=$origin&docurl=".$myrow["path"]."#$id_in_path";
- }
- else
- {
- $enableDocumentParsing='yes';
- if (!$enableDocumentParsing)
- {
- $file=urlencode($myrow["path"]);
- echo "<a href='../document/showinframes.php?file=$file' class='$completed' $hyperlink_target_parameter>".shorten($filename,($length-3*$level))."</a>";
- }
- else
- {
- echo "<a href=\"../document/download.php?doc_url=".$myrow["path"]."\" class='$completed' $hyperlink_target_parameter>".shorten($filename,($length-3*$level))."</a>";
- }
- }
- break;
- case "Assignments":
- $name=get_lang('Assignments');
- $sql="select * from $tbl_learnpath_item where id=$id_in_path";
- $result=api_sql_query($sql,__FILE__,__LINE__); $row=mysql_fetch_array($result);
- if ($row['title'] != '') { $name=$row['title']; }
- $desc=$row['description'];
- echo str_repeat(" >",$level);
- if (($builder != 'builder') and ($icon != 'wrap')) { echo "<td>"; }
- if ($icon != 'nolink')
- {
- if ($completed=='completed') {
- echo "<img src='../img/checkbox_on2.gif' border='0' width='13' height='11' alt='on'>";
- } else {
- echo "<img src='../img/checkbox_on2.gif' border='0' width='13' height='11' alt='on' style='visibility: hidden'>";
-
- }
- }
- if (($builder != 'builder') and ($icon != 'wrap')) { echo "</td><td>"; }
- if ($name=='')
- {
- echo "<span class='messagesmall'>".get_lang('StepDeleted1')." $type ".get_lang('StepDeleted2')."</span>"; return(true);
- }
- if ($icon == 'nolink') { return(shorten($name,$length)); }
- if ($icon == 'icon') { echo "<img src='../img/works.gif' align=\"absmiddle\">"; }
- if ($builder != 'builder')
- {
- echo "<a href=\"".api_get_self()."?action=closelesson&source_forum=".$_GET['source_forum']."&how=complete&id_in_path=$id_in_path&learnpath_id=$learnpath_id&type=Assignments&origin=$origin#$id_in_path\" class='$completed'>".shorten($name,($length-3*$level))."</a>"; $items[]=api_get_self()."?action=closelesson&source_forum=".$_GET['source_forum']."&how=complete&id_in_path=$id_in_path&learnpath_id=$learnpath_id&type=Assignments&origin=$origin#$id_in_path";
- if ($desc != '')
- {
- if ($icon != 'wrap')
- {
- echo "</tr><tr><td></td><td></td><td><div class='description'> ".shorten($desc,($length-3*$level))."</div></td></tr>";
- }
- else
- {
- echo "<div class='description'> ".shorten($desc,($length-3*$level))."</div>";
- }
- }
- }
- else
- {
- echo "<a href=\"../work/work.php\" class='$completed' target='_blank'>".shorten($name,($length-3*$level))."</a>";
- }
- break;
- case "Dropbox":
- $name=get_lang('Dropbox');
- $sql="select * from $tbl_learnpath_item where id=$id_in_path";
- $result=api_sql_query($sql,__FILE__,__LINE__); $row=mysql_fetch_array($result);
- if ($row['title'] != '') { $name=$row['title']; }
- $desc=$row['description'];
- echo str_repeat(" >",$level);
- if (($builder != 'builder') and ($icon != 'wrap')) { echo "<td>"; }
- if ($icon != 'nolink') {
- if ($completed=='completed') {
- echo "<img src='../img/checkbox_on2.gif' border='0' width='13' height='11' alt='on'>";
- } else {
- echo "<img src='../img/checkbox_on2.gif' border='0' width='13' height='11' alt='on' style='visibility: hidden'>";
-
- }
- }
- if (($builder != 'builder') and ($icon != 'wrap')) { echo "</td><td>"; }
- if ($name=='') { echo "<span class='messagesmall'>".get_lang('StepDeleted1')." $type ".get_lang('StepDeleted2')."</span>"; return(true); }
- if ($icon == 'nolink') { return(shorten($name,$length)); }
- if ($icon == 'icon') { echo "<img src='../img/dropbox.gif' align=\"absmiddle\">"; }
- if ($builder != 'builder')
- {
- echo "<a href=\"".api_get_self()."?action=closelesson&source_forum=".$_GET['source_forum']."&how=complete&id_in_path=$id_in_path&learnpath_id=$learnpath_id&type=Dropbox&origin=$origin#$id_in_path\" class='$completed'>".shorten($name,($length-3*$level))."</a>"; $items[]=api_get_self()."?action=closelesson&source_forum=".$_GET['source_forum']."&how=complete&id_in_path=$id_in_path&learnpath_id=$learnpath_id&type=Dropbox&origin=$origin#$id_in_path";
- if ($desc != '') {
- if ($icon != 'wrap') {
- echo "</tr><tr><td></td><td></td><td><div class='description'> ".shorten($desc,($length-3*$level))."</div></td></tr>"; }
- else {
- echo "<div class='description'> ".shorten($desc,($length-3*$level))."</div>"; }
- }
- } else {
- echo "<a href=\"../dropbox/index.php\" class='$completed' target='_blank'>".shorten($name,($length-3*$level))."</a>";
- }
- break;
- case "Introduction_text":
- $name=get_lang('IntroductionText');
- $sql="select * from $tbl_learnpath_item where id=$id_in_path";
- $result=api_sql_query($sql,__FILE__,__LINE__); $row=mysql_fetch_array($result);
- if ($row['title'] != '') { $name=$row['title']; }
- $desc=$row['description'];
- echo str_repeat(" >",$level);
- if (($builder != 'builder') and ($icon != 'wrap')) { echo "<td>"; }
- if ($icon != 'nolink') {
- if ($completed=='completed') {
- echo "<img src='../img/checkbox_on2.gif' border='0' width='13' height='11' alt='on'>";
- } else {
- echo "<img src='../img/checkbox_on2.gif' border='0' width='13' height='11' alt='on' style='visibility: hidden'>";
-
- }
- }
- if (($builder != 'builder') and ($icon != 'wrap')) { echo "</td><td>"; }
- if ($name=='') { echo "<span class='messagesmall'>".get_lang('StepDeleted1')." $type ".get_lang('StepDeleted2')."</span>"; return(true); }
- if ($icon == 'nolink') { return(shorten($name,$length)); }
- if ($icon == 'icon') { echo "<img src='../img/introduction.gif' align=\"absmiddle\" alt='introduction'>"; }
- if ($builder != 'builder')
- {
- echo "<a href=\"".api_get_self()."?action=closelesson&source_forum=".$_GET['source_forum']."&how=complete&id_in_path=$id_in_path&learnpath_id=$learnpath_id&type=Introduction_text&origin=$origin#$id_in_path\" class='$completed'>".shorten($name,($length-3*$level))."</a>";
- $items[]=api_get_self()."?action=closelesson&source_forum=".$_GET['source_forum']."&how=complete&id_in_path=$id_in_path&learnpath_id=$learnpath_id&type=Introduction_text&origin=$origin#$id_in_path";
- if ($desc != '') {
- if ($icon != 'wrap') {
- echo "</tr><tr><td></td><td></td><td><div class='description'> ".shorten($desc,($length-3*$level))."</div></td></tr>"; }
- else {
- echo "<div class='description'> ".shorten($desc,($length-3*$level))."</div>"; }
- }
- } else {
- $s=api_get_path('WEB_COURSE_PATH')."$_cid/index.php?intro_cmdEdit=1";
- echo "<a href=\"$s\" class='$completed' target='_blank'>".shorten($name,($length-3*$level))."</a>";
- }
- break;
- case "Course_description":
- $name=get_lang('CourseDescription');
- $sql="select * from $tbl_learnpath_item where id=$id_in_path";
- $result=api_sql_query($sql,__FILE__,__LINE__); $row=mysql_fetch_array($result);
- if ($row['title'] != '') { $name=$row['title']; }
- $desc=$row['description'];
- echo str_repeat(" >",$level);
- if (($builder != 'builder') and ($icon != 'wrap')) { echo "<td>"; }
- if ($icon != 'nolink') {
- if ($completed=='completed') {
- echo "<img src='../img/checkbox_on2.gif' border='0' width='13' height='11' alt='on'>";
- } else {
- echo "<img src='../img/checkbox_on2.gif' border='0' width='13' height='11' alt='on' style='visibility: hidden'>";
-
- }
- }
- if (($builder != 'builder') and ($icon != 'wrap')) { echo "</td><td>"; }
- if ($name=='') { echo "<span class='messagesmall'>".get_lang('StepDeleted1')." $type ".get_lang('StepDeleted2')."</span>"; return(true); }
- if ($icon == 'nolink') { return(shorten($name,$length)); }
- if ($icon == 'icon') { echo "<img src='../img/info.gif' align=\"absmiddle\" alt='info'>"; }
- if ($builder != 'builder')
- {
- echo "<a href=\"".api_get_self()."?action=closelesson&source_forum=".$_GET['source_forum']."&how=complete&id_in_path=$id_in_path&learnpath_id=$learnpath_id&type=Course_description&origin=$origin#$id_in_path\" class='$completed'>".shorten($name,($length-3*$level))."</a>"; $items[]=api_get_self()."?action=closelesson&source_forum=".$_GET['source_forum']."&how=complete&id_in_path=$id_in_path&learnpath_id=$learnpath_id&type=Course_description&origin=$origin#$id_in_path";
- if ($desc != '') {
- if ($icon != 'wrap') {
- echo "</tr><tr><td></td><td></td><td><div class='description'> ".shorten($desc,($length-3*$level))."</div></td></tr>"; }
- else {
- echo "<div class='description'> ".shorten($desc,($length-3*$level))."</div>"; }
- }
- } else {
- $s=api_get_path('WEB_CODE_PATH')."course_description";
- echo "<a href=\"$s\" class='$completed' target='_blank'>".shorten($name,($length-3*$level))."</a>";
- }
- break;
- case "Groups":
- $name=get_lang('Groups');
- $sql="select * from $tbl_learnpath_item where id=$id_in_path";
- $result=api_sql_query($sql,__FILE__,__LINE__); $row=mysql_fetch_array($result);
- if ($row['title'] != '') { $name=$row['title']; }
- $desc=$row['description'];
- echo str_repeat(" >",$level);
- if (($builder != 'builder') and ($icon != 'wrap')) { echo "<td>"; }
- if ($icon != 'nolink') {
- if ($completed=='completed') {
- echo "<img src='../img/checkbox_on2.gif' border='0' width='13' height='11' alt='on'>";
- } else {
- echo "<img src='../img/checkbox_on2.gif' border='0' width='13' height='11' alt='on' style='visibility: hidden'>";
-
- }
- }
- if (($builder != 'builder') and ($icon != 'wrap')) { echo "</td><td>"; }
- if ($name=='') { echo "<span class='messagesmall'>".get_lang('StepDeleted1')." $type ".get_lang('StepDeleted2')."</span>"; return(true); }
- if ($icon == 'nolink') { return(shorten($name,$length)); }
- if ($icon == 'icon') { echo "<img src='../img/group.gif' align=\"absmiddle\" alt='group'>"; }
- if ($builder != 'builder')
- {
- echo "<a href=\"".api_get_self()."?action=closelesson&source_forum=".$_GET['source_forum']."&how=complete&id_in_path=$id_in_path&learnpath_id=$learnpath_id&type=Groups&origin=$origin#$id_in_path\" class='$completed'>".shorten($name,($length-3*$level))."</a>"; $items[]=api_get_self()."?action=closelesson&source_forum=".$_GET['source_forum']."&how=complete&id_in_path=$id_in_path&learnpath_id=$learnpath_id&type=Groups&origin=$origin#$id_in_path";
- if ($desc != '') {
- if ($icon != 'wrap') {
- echo "</tr><tr><td></td><td></td><td><div class='description'> ".shorten($desc,($length-3*$level))."</div></td></tr>"; }
- else {
- echo "<div class='description'> ".shorten($desc,($length-3*$level))."</div>"; }
- }
- } else {
- echo "<a href=\"../group/group.php?origin=$origin\" class='$completed' target='_blank'>".shorten($name,($length-3*$level))."</a>";
- }
- break;
- case "Users":
- $name=get_lang('Users');
- $sql="select * from $tbl_learnpath_item where id=$id_in_path";
- $result=api_sql_query($sql,__FILE__,__LINE__); $row=mysql_fetch_array($result);
- if ($row['title'] != '') { $name=$row['title']; }
- $desc=$row['description'];
- echo str_repeat(" >",$level);
- if (($builder != 'builder') and ($icon != 'wrap')) { echo "<td>"; }
- if ($icon != 'nolink') {
- if ($completed=='completed') {
- echo "<img src='../img/checkbox_on2.gif' border='0' width='13' height='11' alt='on'>";
- } else {
- echo "<img src='../img/checkbox_on2.gif' border='0' width='13' height='11' alt='on' style='visibility: hidden'>";
-
- }
- }
- if (($builder != 'builder') and ($icon != 'wrap')) { echo "</td><td>"; }
- if ($name=='') { echo "<span class='messagesmall'>".get_lang('StepDeleted1')." $type ".get_lang('StepDeleted2')."</span>"; return(true); }
- if ($icon == 'nolink') { return(shorten($name,$length)); }
- if ($icon == 'icon') { echo "<img src='../img/members.gif' align=\"absmiddle\" alt='members'>"; }
- if ($builder != 'builder')
- {
- echo "<a href=\"".api_get_self()."?action=closelesson&source_forum=".$_GET['source_forum']."&how=complete&id_in_path=$id_in_path&learnpath_id=$learnpath_id&type=Users&origin=$origin#$id_in_path\" class='$completed'>".shorten($name,($length-3*$level))."</a>"; $items[]=api_get_self()."?action=closelesson&source_forum=".$_GET['source_forum']."&how=complete&id_in_path=$id_in_path&learnpath_id=$learnpath_id&type=Users&origin=$origin#$id_in_path";
- if ($desc != '') {
- if ($icon != 'wrap') {
- echo "</tr><tr><td></td><td></td><td><div class='description'> ".shorten($desc,($length-3*$level))."</div></td></tr>"; }
- else {
- echo "<div class='description'> ".shorten($desc,($length-3*$level))."</div>"; }
- }
- } else {
- echo "<a href=\"../user/user.php?origin=$origin\" class='$completed' target='_blank'>".shorten($name,($length-3*$level))."</a>";
- }
- break;
- }
- }
- function get_addedresource_link_in_learnpath($type, $id, $id_in_path)
- {
- global $_course, $learnpath_id, $tbl_learnpath_item, $items;
- global $curDirPath, $_configuration, $enableDocumentParsing, $_user , $_cid;
- $hyperlink_target_parameter = "";
- $builder = 'player';
- $origin='learnpath';
- $linktype=$type;
- if (($type=="Link _self") or ($type=="Link _blank")) { $type="Link"; }
- $link = '';
- switch ($type)
- {
- case "Agenda":
- $TABLEAGENDA = $_course['dbNameGlu']."calendar_event";
- $result = api_sql_query("SELECT * FROM `$TABLEAGENDA` WHERE id=$id",__FILE__,__LINE__);
- $myrow=mysql_fetch_array($result);
- $sql="select * from $tbl_learnpath_item where id=$id_in_path";
- $result=api_sql_query($sql,__FILE__,__LINE__); $row=mysql_fetch_array($result);
- if ($row['title'] != '') { $myrow["title"]=$row['title']; }
- $desc=$row['description'];
- $agenda_id=$row['item_id'];
- if ($builder != 'builder')
- {
- $link .= api_get_self()."?action=closelesson&source_forum=".$_GET['source_forum']."&how=complete&id_in_path=$id_in_path&learnpath_id=$learnpath_id&type=Agenda&origin=$origin&agenda_id=$agenda_id#$id_in_path";
- }
- else
- {
- $link .= "../calendar/agenda.php?origin=$origin&agenda_id=$agenda_id";
- }
- break;
- case "Ad_Valvas":
- $tbl_announcement = Database::get_course_table(TABLE_ANNOUNCEMENT);
- $result = api_sql_query("SELECT * FROM $tbl_announcement WHERE id=$id",__FILE__,__LINE__);
- $myrow=mysql_fetch_array($result);
- if ($builder != 'builder')
- {
- $link .= api_get_self()."?action=closelesson&source_forum=".$_GET['source_forum']."&how=complete&id_in_path=$id_in_path&learnpath_id=$learnpath_id&type=Ad_Valvas&origin=$origin&ann_id=$id#$id_in_path";
- }
- else
- {
- $link .= "../announcements/announcements.php?origin=$origin&ann_id=$id";
- }
- break;
- case "Link" :
- $TABLETOOLLINK = $_course['dbNameGlu']."link";
- $result= api_sql_query("SELECT * FROM `$TABLETOOLLINK` WHERE id=$id",__FILE__,__LINE__);
- $myrow=mysql_fetch_array($result);
- $sql="select * from $tbl_learnpath_item where id=$id_in_path";
- $result=api_sql_query($sql,__FILE__,__LINE__); $row=mysql_fetch_array($result);
- $thelink=$myrow["url"];
- if ($builder != 'builder')
- {
- $link .= api_get_self()."?action=closelesson&source_forum=".$_GET['source_forum']."&how=complete&id_in_path=$id_in_path&learnpath_id=$learnpath_id&type=$linktype&origin=$origin&thelink=$thelink#$id_in_path";
- }
- else
- {
- $link .= $thelink;
- }
- break;
- case "Exercise":
- $TBL_EXERCICES = $_course['dbNameGlu'].'quiz';
- $result= api_sql_query("SELECT * FROM `$TBL_EXERCICES` WHERE id=$id",__FILE__,__LINE__);
- $myrow=mysql_fetch_array($result);
- if ($builder=='builder') { $origin='builder'; }
-
- $sql="select * from $tbl_learnpath_item where id=$id_in_path";
- $result=api_sql_query($sql,__FILE__,__LINE__); $row=mysql_fetch_array($result);
- if ($row['title'] != '') { $myrow["title"]=$row['title']; }
- if ($builder != 'builder')
- {
- $link .= api_get_self()."?action=closelesson&source_forum=".$_GET['source_forum']."&how=complete&id_in_path=$id_in_path&learnpath_id=$learnpath_id&type=Exercise&origin=$origin&exerciseId=".$myrow["id"]."#$id_in_path";
- }
- else
- {
- $link .= "../exercice/exercice_submit.php?origin=$origin&exerciseId=".$myrow["id"];
- }
- break;
- case "HotPotatoes":
- $TBL_DOCUMENT = $_course['dbNameGlu'].'document';
- $documentPath=api_get_path('SYS_COURSE_PATH').$_course['path'].'/document';
- $result = api_sql_query("SELECT * FROM `".$TBL_DOCUMENT."` WHERE id=$id");
- $myrow= mysql_fetch_array($result);
- $path=$myrow["path"];
- $name=GetQuizName($path,$documentPath);
- if ($builder=='builder') { $origin='builder'; }
- $cid = $_course['official_code'];
- if ($builder != 'builder')
- {
- $link .= api_get_self()."?action=closelesson&source_forum=".$_GET['source_forum']."&how=complete&id_in_path=$id_in_path&learnpath_id=$learnpath_id&type=HotPotatoes&origin=$origin&id=$id#$id_in_path";
- }
- else
- {
- $link .= "../exercice/showinframes.php?file=$path&cid=$cid&uid=".$_user['user_id']."";
- }
- break;
- case "Forum":
- $TBL_FORUMS = $_course['dbNameGlu']."bb_forums";
- $result= api_sql_query("SELECT * FROM `$TBL_FORUMS` WHERE forum_id=$id",__FILE__,__LINE__);
- $myrow=mysql_fetch_array($result);
- if ($builder=='builder') { $origin='builder'; }
- $sql="select * from $tbl_learnpath_item where id=$id_in_path";
- $result=api_sql_query($sql,__FILE__,__LINE__); $row=mysql_fetch_array($result);
- if ($row['title'] != '') { $myrow["forum_name"]=$row['title']; }
- if ($myrow["forum_name"]=='') { $type="Forum"; }
- $forumparameters="forum=".$myrow["forum_id"]."&md5=".$myrow["md5"];
- if ($builder != 'builder')
- {
- $link .= api_get_self()."?action=closelesson&source_forum=".$_GET['source_forum']."&how=complete&id_in_path=$id_in_path&learnpath_id=$learnpath_id&type=Forum&origin=$origin&forumparameters=$forumparameters#$id_in_path";
- }
- else
- {
- $link .= "../phpbb/viewforum.php?$forumparameters";
- }
- break;
- case "Thread":
- $tbl_topics = $_course['dbNameGlu'].'bb_topics';
- $tbl_posts = $_course['dbNameGlu'].'bb_posts';
- $TBL_FORUMS = $_course['dbNameGlu']."bb_forums";
- $sql="SELECT * FROM `$tbl_topics` where topic_id=$id";
- $result= api_sql_query($sql,__FILE__,__LINE__);
- $myrow=mysql_fetch_array($result);
- $sql="select * from $tbl_learnpath_item where id=$id_in_path";
- $result=api_sql_query($sql,__FILE__,__LINE__); $row=mysql_fetch_array($result);
- if ($builder != 'builder')
- {
- $link .= api_get_self()."?action=closelesson&source_forum=".$_GET['source_forum']."&how=complete&id_in_path=$id_in_path&learnpath_id=$learnpath_id&type=Thread&origin=$origin&topic=".$myrow["topic_id"]."&forum=".$myrow["forum_id"]."&md5=".$myrow["md5"]."#$id_in_path";
- }
- else
- {
- $link .= "../phpbb/viewtopic.php?topic=".$myrow["topic_id"]."&forum=".$myrow["forum_id"]."&md5=".$myrow["md5"];
- }
- break;
- case "Post":
-
- break;
- case "Document":
- $dbTable = $_course['dbNameGlu']."document";
- $result=api_sql_query("SELECT * FROM `$dbTable` WHERE id=$id",__FILE__,__LINE);
- $myrow=mysql_fetch_array($result);
- $pathname=explode("/",$myrow["path"]);
- $last=count($pathname)-1;
- $filename=$pathname[$last];
- $sql="select * from $tbl_learnpath_item where id=$id_in_path";
- $result=api_sql_query($sql,__FILE__,__LINE__); $row=mysql_fetch_array($result);
- if ($builder != 'builder')
- {
- $link .= api_get_self()."?action=closelesson&source_forum=".$_GET['source_forum']."&how=complete&id_in_path=$id_in_path&learnpath_id=$learnpath_id&type=Document&origin=$origin&docurl=".$myrow["path"]."#$id_in_path";
- }
- else
- {
- $enableDocumentParsing='yes';
- if (!$enableDocumentParsing)
- {
- $file=urlencode($myrow["path"]);
- $link .= "../document/showinframes.php?file=$file";
- }
- else
- {
- $link .= "../document/download.php?doc_url=".$myrow["path"];
- }
- }
- break;
- case "Assignments":
- if ($builder != 'builder')
- {
- $link .= api_get_self()."?action=closelesson&source_forum=".$_GET['source_forum']."&how=complete&id_in_path=$id_in_path&learnpath_id=$learnpath_id&type=Assignments&origin=$origin#$id_in_path";
- }
- else
- {
- $link .= "../work/work.php";
- }
- break;
- case "Dropbox":
- if ($builder != 'builder')
- {
- $link .= api_get_self()."?action=closelesson&source_forum=".$_GET['source_forum']."&how=complete&id_in_path=$id_in_path&learnpath_id=$learnpath_id&type=Dropbox&origin=$origin#$id_in_path";
- } else {
- $link .= "../dropbox/index.php";
- }
- break;
- case "Introduction_text":
- if ($builder != 'builder')
- {
- $link .= api_get_self()."?action=closelesson&source_forum=".$_GET['source_forum']."&how=complete&id_in_path=$id_in_path&learnpath_id=$learnpath_id&type=Introduction_text&origin=$origin#$id_in_path";
- } else {
- $s=api_get_path('WEB_COURSE_PATH')."$_cid/index.php?intro_cmdEdit=1";
- $link .= $s;
- }
- break;
- case "Course_description":
- if ($builder != 'builder')
- {
- $link .= api_get_self()."?action=closelesson&source_forum=".$_GET['source_forum']."&how=complete&id_in_path=$id_in_path&learnpath_id=$learnpath_id&type=Course_description&origin=$origin#$id_in_path";
- } else {
- $s=api_get_path('WEB_CODE_PATH')."course_description";
- $link .= $s;
- }
- break;
- case "Groups":
- if ($builder != 'builder')
- {
- $link .= api_get_self()."?action=closelesson&source_forum=".$_GET['source_forum']."&how=complete&id_in_path=$id_in_path&learnpath_id=$learnpath_id&type=Groups&origin=$origin#$id_in_path";
- } else {
- $link .= "../group/group.php?origin=$origin";
- }
- break;
- case "Users":
- if ($builder != 'builder')
- {
- $link .= api_get_self()."?action=closelesson&source_forum=".$_GET['source_forum']."&how=complete&id_in_path=$id_in_path&learnpath_id=$learnpath_id&type=Users&origin=$origin#$id_in_path";
- } else {
- $link .= "../user/user.php?origin=$origin";
- }
- break;
- }
- return $link;
- }
- function remove_resource($resource_key)
- {
- $addedresource = $_SESSION['addedresource'];
- $addedresourceid = $_SESSION['addedresourceid'];
- unset($addedresource[$resource_key]);
- unset($addedresourceid[$resource_key]);
- $_SESSION['addedresource']=$addedresource;
- $_SESSION['addedresourceid']=$addedresourceid ;
- }
- function show_addresource_button($additionalparameters = '')
- {
- global $charset;
- echo '<label for="addresources"><img src="../img/attachment.gif" /></label><input class="link_alike" type="submit" name="addresources" id="addresources" value="'.api_htmlentities(get_lang('Attachment'), ENT_QUOTES, $charset).'" '.$additionalparameters.' />';
- }
- function delete_one_added_resource($source_type, $source_id, $resource_type, $resource_id)
- {
- echo "delete_one_added_resource";
- global $_course;
- $TABLERESOURCE = $_course['dbNameGlu']."resource";
- $sql="DELETE FROM `$TABLERESOURCE` WHERE source_type='$source_type' and source_id='$source_id' and resource_type='$resource_type' and resource_id='$resource_id'";
- api_sql_query($sql,__FILE__,__LINE__);
- }
- function delete_added_resource($type, $id)
- {
- global $_course;
- $TABLERESOURCE = $_course['dbNameGlu']."resource";
- $sql="DELETE FROM `$TABLERESOURCE` WHERE source_type='$type' and source_id='$id'";
- api_sql_query($sql,__FILE__,__LINE__);
- }
- function delete_all_resources_type($type)
- {
- global $_course;
- $TABLERESOURCE = $_course['dbNameGlu']."resource";
- $sql="DELETE FROM `$TABLERESOURCE` WHERE source_type='$type'";
- api_sql_query($sql,__FILE__,__LINE__);
- }
- function check_added_resources($type, $id)
- {
- global $_course, $origin;
- $TABLERESOURCE = $_course['dbNameGlu']."resource";
- $sql="SELECT * FROM `$TABLERESOURCE` WHERE source_type='$type' and source_id='$id'";
- $result=api_sql_query($sql,__FILE__,__LINE__);
- $number_added=mysql_num_rows($result);
- if ($number_added<>0)
- return true;
- else
- return false;
- }
- function edit_added_resources($type, $id)
- {
- global $_course;
- $TABLERESOURCE = $_course['dbNameGlu']."resource";
- $sql="SELECT * FROM `$TABLERESOURCE` WHERE source_type='$type' and source_id=$id";
- $result=api_sql_query($sql,__FILE__,__LINE__);
- while ($row=mysql_fetch_array($result))
- {
- $addedresource[]=$row["resource_type"];
- $addedresourceid[]=$row["resource_id"];
- }
- $_SESSION['addedresource']=$addedresource;
- $_SESSION['addedresourceid']=$addedresourceid;
- }
- function update_added_resources($type, $id)
- {
- global $_course;
- $TABLERESOURCE = $_course['dbNameGlu']."resource";
-
- $sql="DELETE FROM `$TABLERESOURCE` WHERE source_type='$type' AND source_id='$id'";
-
- api_sql_query($sql,__FILE__,__LINE__);
-
- store_resources($type, $id);
-
- unset_session_resources();
- }
- function display_added_resources($type, $id, $style='')
- {
-
- $arr_icons=array('Agenda'=>'../img/agenda.gif', 'Ad Valvas'=>'../img/valves.gif', 'Link'=>'../img/links.gif', 'Exercise'=>'../img/quiz.gif' );
- global $_course, $origin;
- $TABLERESOURCE = $_course['dbNameGlu']."resource";
- $sql="SELECT * FROM `$TABLERESOURCE` WHERE source_type='$type' and source_id='$id'";
- $result=api_sql_query($sql,__FILE__,__LINE__);
- while ($row=mysql_fetch_array($result))
- {
- if ($origin != 'learnpath')
- {
- display_addedresource_link($row['resource_type'], $row['resource_id'], $style) ;
- }
- else
- {
- display_addedresource_link_in_learnpath($row['resource_type'], $row['resource_id'],'agendaitems','','builder','icon') ; echo "<br>";
- }
- }
- }
- function display_resources($showdeleteimg)
- {
- global $action;
- global $resourceaction;
- global $id;
- global $locationkey;
- global $source_id, $action, $learnpath_id, $chapter_id, $originalresource;
- if ($resourceaction=="removeresource")
- {
-
-
- remove_resource($locationkey);
- }
- $addedresource=$_SESSION['addedresource'];
- $addedresourceid=$_SESSION['addedresourceid'];
- if (is_array($addedresource))
- {
- echo '<table>';
- foreach ($addedresource as $resource)
- {
-
- echo '<tr><td>';
- display_addedresource_link($resource,$addedresourceid[key($addedresource)]);
- echo '</td><td width="30">';
-
-
- $test=parse_url($_SERVER['REQUEST_URI']);
- $output = array();
- parse_str($test['query'],$output);
- if ($showdeleteimg==1)
- {
-
-
-
-
-
-
- echo "<a href=".api_get_self()."?showresources=true&source_forum=".$_GET['source_forum']."&resourceaction=removeresource&locationkey=".key($addedresource)."&source_id=$source_id&action=$action&learnpath_id=$learnpath_id&chapter_id=$chapter_id&originalresource=no><img src='../img/delete.gif' border='0' alt='resource ".get_lang('Delete')."' /></a><br />";
- }
- echo '</td></tr>';
- next($addedresource);
-
- }
- echo '</table>';
- }
- else
- {
- echo '';
- }
- }
- function showorhide_addresourcelink($type, $id)
- {
- global $from_learnpath, $source_id, $action, $learnpath_id, $chapter_id, $originalresource, $folder, $content, $target;
-
-
- $addedresource=$_SESSION['addedresource'];
- $addedresourceid=$_SESSION['addedresourceid'];
- if (is_array($_SESSION['addedresource']))
- {
- foreach ($addedresource as $toolcompare)
- {
-
-
-
-
-
-
- if ($toolcompare==$type and $addedresourceid[key($addedresource)]==$id)
- {
- $show=0;
- }
- next($addedresource);
- }
- if ($from_learnpath) { $lang_add_it_or_resource=get_lang('AddIt'); } else { $lang_add_it_or_resource=get_lang('AddResource'); }
- if ($show!==0)
- {
- if ($type=="Document")
- {
- echo "<a href=".api_get_self()."?content=".$type."&folder=".$folder."&source_forum=".$_GET['source_forum']."&add=".$id."&source_id=$source_id&action=$action&learnpath_id=$learnpath_id&chapter_id=$chapter_id&originalresource=no>".$lang_add_it_or_resource."</a>";
- }
- else
- {
- echo "<a href='".api_get_self()."?content=".$type."&source_forum=".$_GET['source_forum']."&add=".$id."&source_id=$source_id&action=$action&learnpath_id=$learnpath_id&chapter_id=$chapter_id&originalresource=no&target=$target'>".$lang_add_it_or_resource."</a>";
- }
- }
- }
- else
- {
- if ($_SESSION['addedresource']!==$type or $_SESSION['addedresourceid']!==$id)
- {
- if ($from_learnpath) { $lang_add_it_or_resource=get_lang('AddIt'); } else { $lang_add_it_or_resource=get_lang('AddResource'); }
- echo "<a href='".api_get_self()."?content=".$type."&folder=".$folder."&source_forum=".$_GET['source_forum']."&add=".$id."&source_id=$source_id&action=$action&learnpath_id=$learnpath_id&chapter_id=$chapter_id&originalresource=no&target=$target'>".$lang_add_it_or_resource."</a>";
- }
- }
- }
- ?>
|