function showCourseLinks($id, $option, &$rows)
    {
        $user = JLMSFactory::getUser();
        $db =& JFactory::getDbo();
        $JLMS_ACL =& JLMSFactory::getACL();
        $JLMS_CONFIG = JLMSFactory::getConfig();
        $Itemid = $JLMS_CONFIG->get('Itemid');
        ?>
<script language="javascript" type="text/javascript">
<!--//--><![CDATA[//><!--
function submitbutton(pressbutton) {
	var form = document.adminForm;
	if ( ((pressbutton == 'link_delete') || (pressbutton == 'pre_link_edit')) && (form.boxchecked.value == "0")){
		alert("<?php 
        echo _JLMS_ALERT_SELECT_ITEM;
        ?>
");
	} else {
		form.task.value = pressbutton;
		form.submit();
	}
}
function submitbutton_order(pressbutton, item_id) {
	var form = document.adminForm;
	if ((pressbutton == 'link_orderup') || (pressbutton == 'link_orderdown')){
		if (item_id) {
		form.task.value = pressbutton;
		form.row_id.value = item_id;
		form.submit();
		}
	}
}
function submitbutton_change(pressbutton, state) {
	var form = document.adminForm;
	if (pressbutton == 'change_link'){
		if (form.boxchecked.value == "0") {
			alert("<?php 
        echo _JLMS_ALERT_SELECT_ITEM;
        ?>
");
		} else {
			form.task.value = pressbutton;
			form.state.value = state;
			form.submit();
		}
	}
}
function submitbutton_change2(pressbutton, state, cid_id) {
	var form = document.adminForm;
	if (pressbutton == 'change_link'){
		form.task.value = pressbutton;
		form.state.value = state;
		form.cid2.value = cid_id;
		form.submit();
	}
}
//--><!]]>
</script>
<?php 
        JLMS_TMPL::OpenMT();
        $hparams = array();
        JLMS_TMPL::ShowHeader('link', _JLMS_LINKS_COURSE_LINKS, $hparams);
        JLMS_TMPL::OpenTS();
        ?>
		<form action="<?php 
        echo $JLMS_CONFIG->get('live_site') . "/index.php?option={$option}&amp;Itemid={$Itemid}";
        ?>
" method="post" name="adminForm">
<?php 
        if (!empty($rows)) {
            ?>
			<table width="100%" cellpadding="0" cellspacing="0" border="0" class="<?php 
            echo JLMSCSS::_('jlmslist');
            ?>
">
				<tr>
					<<?php 
            echo JLMSCSS::tableheadertag();
            ?>
 width="20" class="<?php 
            echo JLMSCSS::_('sectiontableheader');
            ?>
" align="center">#</<?php 
            echo $JLMS_CONFIG->get('tableheader_tag', 'td');
            ?>
>
				<?php 
            if ($JLMS_ACL->CheckPermissions('links', 'manage') || $JLMS_ACL->CheckPermissions('links', 'publish')) {
                ?>
					<<?php 
                echo JLMSCSS::tableheadertag();
                ?>
 width="20" class="<?php 
                echo JLMSCSS::_('sectiontableheader');
                ?>
" align="center"><input type="checkbox" name="toggle" value="" onclick="checkAll(<?php 
                echo count($rows);
                ?>
);" /></<?php 
                echo $JLMS_CONFIG->get('tableheader_tag', 'td');
                ?>
>
				<?php 
            }
            ?>
					<<?php 
            echo JLMSCSS::tableheadertag();
            ?>
 class="<?php 
            echo JLMSCSS::_('sectiontableheader');
            ?>
" width="40%"><?php 
            echo _JLMS_LINKS_TBL_HEAD_LINK;
            ?>
</<?php 
            echo $JLMS_CONFIG->get('tableheader_tag', 'td');
            ?>
>
				<?php 
            if ($JLMS_ACL->CheckPermissions('links', 'publish')) {
                ?>
					<<?php 
                echo JLMSCSS::tableheadertag();
                ?>
 class="<?php 
                echo JLMSCSS::_('sectiontableheader');
                ?>
" width="1">&nbsp;</<?php 
                echo $JLMS_CONFIG->get('tableheader_tag', 'td');
                ?>
>
				<?php 
            }
            if ($JLMS_ACL->CheckPermissions('links', 'order')) {
                ?>
					<<?php 
                echo JLMSCSS::tableheadertag();
                ?>
 class="<?php 
                echo JLMSCSS::_('sectiontableheader');
                ?>
" colspan="2" width="1">&nbsp;</<?php 
                echo $JLMS_CONFIG->get('tableheader_tag', 'td');
                ?>
>
				<?php 
            }
            ?>
					<<?php 
            echo JLMSCSS::tableheadertag();
            ?>
 class="<?php 
            echo JLMSCSS::_('sectiontableheader');
            ?>
" width="60%"><?php 
            echo _JLMS_LINKS_TBL_HEAD_DESCR;
            ?>
</<?php 
            echo $JLMS_CONFIG->get('tableheader_tag', 'td');
            ?>
>
				</tr>
			<?php 
            $there_were_squeezeboxes = false;
            $k = 1;
            for ($i = 0, $n = count($rows); $i < $n; $i++) {
                $is_squeezebox = false;
                $row = $rows[$i];
                $link = $row->link_href;
                if ($row->link_type == 2) {
                    $link = sefRelToAbs("index.php?option={$option}&Itemid={$Itemid}&task=view_inline_link&course_id={$id}&id={$row->id}");
                }
                if ($row->link_type == 3) {
                    $is_squeezebox = true;
                    $there_were_squeezeboxes = true;
                }
                $alt = $row->published ? _JLMS_STATUS_PUB : _JLMS_STATUS_UNPUB;
                $image = $row->published ? 'btn_accept.png' : 'btn_cancel.png';
                $state = $row->published ? 0 : 1;
                if ($row->is_time_related) {
                    $tooltip_txt = _JLMS_WILL_BE_RELEASED_IN;
                    $showperiod = $row->show_period;
                    $ost1 = $showperiod % (24 * 60);
                    $sp_days = ($showperiod - $ost1) / (24 * 60);
                    $ost2 = $showperiod % 60;
                    $sp_hours = ($ost1 - $ost2) / 60;
                    $sp_mins = $ost2;
                    $release_time_info = false;
                    if ($sp_days) {
                        $tooltip_txt .= ' ' . $sp_days . ' ' . _JLMS_RELEASED_IN_DAYS;
                        $release_time_info = true;
                    }
                    if ($sp_hours) {
                        $tooltip_txt .= ' ' . $sp_hours . ' ' . _JLMS_RELEASED_IN_HOURS;
                        $release_time_info = true;
                    }
                    if ($sp_mins) {
                        $tooltip_txt .= ' ' . $sp_mins . ' ' . _JLMS_RELEASED_IN_MINUTES;
                        $release_time_info = true;
                    }
                    if ($release_time_info) {
                        $tooltip_txt .= ' ' . _JLMS_RELEASED_AFTER_ENROLLMENT;
                    }
                }
                $checked = mosHTML::idBox($i, $row->id);
                ?>
				<tr class="<?php 
                echo JLMSCSS::_('sectiontableentry' . $k);
                ?>
">
					<td align="center"><?php 
                echo $i + 1;
                ?>
</td>
				<?php 
                if ($JLMS_ACL->CheckPermissions('links', 'manage') || $JLMS_ACL->CheckPermissions('links', 'publish')) {
                    $show_check = true;
                    if ($JLMS_ACL->CheckPermissions('links', 'only_own_items') && $row->owner_id != $user->get('id')) {
                        $show_check = false;
                    } elseif ($JLMS_ACL->CheckPermissions('links', 'only_own_role') && $JLMS_ACL->GetRole() != $JLMS_ACL->UserSystemRole($db, $row->owner_id)) {
                        $show_check = false;
                    }
                    ?>
					<td>
					<?php 
                    echo $show_check ? $checked : '&nbsp;';
                    ?>
					</td>
				<?php 
                }
                ?>
					<td align="left">
						<?php 
                if ($is_squeezebox) {
                    $tmp_params = new JLMSParameters($row->params);
                    $x_size = 0;
                    $y_size = 0;
                    if (is_object($tmp_params) && $tmp_params->get('display_width')) {
                        $x_size = intval($tmp_params->get('display_width'));
                    } elseif (isset($tmp_params->display_width)) {
                        $x_size = intval($tmp_params->display_width);
                    }
                    if (is_object($tmp_params) && $tmp_params->get('display_height')) {
                        $y_size = intval($tmp_params->get('display_height'));
                    } elseif (isset($tmp_params->display_height)) {
                        $y_size = intval($tmp_params->display_height);
                    }
                    ?>
							<a class="jlms_modal" rel="{handler:'iframe', size:{x:<?php 
                    echo $x_size;
                    ?>
,y:<?php 
                    echo $y_size;
                    ?>
}}" href="<?php 
                    echo $link;
                    ?>
" title="<?php 
                    echo str_replace('"', '&quot;', $row->link_name);
                    ?>
">
								<?php 
                    echo $row->link_name;
                    ?>
							</a>
						<?php 
                } else {
                    ?>
							<?php 
                    if ($link) {
                        ?>
							<a <?php 
                        echo !$row->link_type ? 'target="_blank" ' : ' ';
                        ?>
href="<?php 
                        echo $link;
                        ?>
" title="<?php 
                        echo str_replace('"', '&quot;', $row->link_name);
                        ?>
">
								<?php 
                        echo $row->link_name;
                        ?>
							</a>
							<?php 
                    } else {
                        echo $row->link_name;
                    }
                    ?>
						<?php 
                }
                ?>
						<?php 
                if ($JLMS_CONFIG->get('show_links_authors', 0)) {
                    ?>
						<br />
						<span class="small"><?php 
                    echo _JLMS_HOME_AUTHOR . "&nbsp;" . $row->author_name;
                    ?>
</span>
						<?php 
                }
                ?>
					</td>
				<?php 
                if ($JLMS_ACL->CheckPermissions('links', 'publish')) {
                    ?>
					<td valign="middle">
					<?php 
                    if ($JLMS_ACL->CheckPermissions('links', 'only_own_items') && $row->owner_id != $user->get('id')) {
                        ?>
						<img class="JLMS_png" src="<?php 
                        echo $JLMS_CONFIG->get('live_site');
                        ?>
/components/com_joomla_lms/lms_images/toolbar/<?php 
                        echo $image;
                        ?>
" width="16" height="16" border="0" alt="<?php 
                        echo $alt;
                        ?>
" />
					<?php 
                    } elseif ($JLMS_ACL->CheckPermissions('links', 'only_own_role') && $JLMS_ACL->GetRole() != $JLMS_ACL->UserSystemRole($db, $row->owner_id)) {
                        ?>
						<img class="JLMS_png" src="<?php 
                        echo $JLMS_CONFIG->get('live_site');
                        ?>
/components/com_joomla_lms/lms_images/toolbar/<?php 
                        echo $image;
                        ?>
" width="16" height="16" border="0" alt="<?php 
                        echo $alt;
                        ?>
" />
					<?php 
                    } else {
                        if ($row->is_time_related) {
                            if ($row->published) {
                                $image = 'btn_publish_wait.png';
                            }
                            $tooltip_link = 'javascript:submitbutton_change2(\'change_link\',' . $state . ',' . $row->id . ')';
                            $tooltip_name = '<img class="JLMS_png" src="' . $JLMS_CONFIG->get('live_site') . '/components/com_joomla_lms/lms_images/toolbar/' . $image . '" width="16" height="16" border="0" alt="' . $alt . '" />';
                            echo JLMS_toolTip($alt, $tooltip_txt, $tooltip_name, $tooltip_link);
                        } else {
                            echo '<a href="javascript:submitbutton_change2(\'change_link\',' . $state . ',' . $row->id . ')" title="' . $alt . '">';
                            echo '<img class="JLMS_png" src="' . $JLMS_CONFIG->get('live_site') . '/components/com_joomla_lms/lms_images/toolbar/' . $image . '" width="16" height="16" border="0" alt="' . $alt . '" />';
                            echo '</a>';
                        }
                    }
                    ?>
					</td>
				<?php 
                }
                if ($JLMS_ACL->CheckPermissions('links', 'order')) {
                    ?>
					<td><?php 
                    echo JLMS_orderUpIcon($i, $row->id, true, 'link_orderup');
                    ?>
</td>
					<td><?php 
                    echo JLMS_orderDownIcon($i, $n, $row->id, true, 'link_orderdown');
                    ?>
</td>
				<?php 
                }
                ?>
					<td><?php 
                echo $row->link_description ? $row->link_description : '&nbsp;';
                ?>
</td>
				</tr>
				<?php 
                $k = 3 - $k;
            }
            ?>
			</table>
<?php 
            if ($there_were_squeezeboxes) {
                JLMS_initialize_SqueezeBox(false);
            }
        } else {
            echo '<div class="joomlalms_user_message">' . _JLMS_NO_ITEMS_HERE . '</div>';
        }
        ?>
			<input type="hidden" name="option" value="<?php 
        echo $option;
        ?>
" />
			<input type="hidden" name="Itemid" value="<?php 
        echo $Itemid;
        ?>
" />
			<input type="hidden" name="task" value="setup_category" />
			<input type="hidden" name="boxchecked" value="0" />
			<input type="hidden" name="id" value="<?php 
        echo $id;
        ?>
" />
			<input type="hidden" name="row_id" value="0" />
			<input type="hidden" name="state" value="0" />
			<input type="hidden" name="cid2" value="0" />
		</form>
<?php 
        JLMS_TMPL::CloseTS();
        if ($id && ($JLMS_ACL->CheckPermissions('links', 'manage') || $JLMS_ACL->CheckPermissions('links', 'publish'))) {
            $link_new = JLMSRoute::_("index.php?option={$option}&amp;Itemid={$Itemid}&amp;task=pre_create_link&amp;id={$id}");
            $controls = array();
            if ($JLMS_ACL->CheckPermissions('links', 'publish')) {
                $controls[] = array('href' => "javascript:submitbutton_change('change_link',1);", 'title' => _JLMS_SET_PUB, 'img' => 'publish');
                $controls[] = array('href' => "javascript:submitbutton_change('change_link',0);", 'title' => _JLMS_SET_UNPUB, 'img' => 'unpublish');
                if ($JLMS_ACL->CheckPermissions('links', 'manage')) {
                    $controls[] = array('href' => 'spacer');
                }
            }
            if ($JLMS_ACL->CheckPermissions('links', 'manage')) {
                $controls[] = array('href' => $link_new, 'onclick' => "", 'title' => _JLMS_LINKS_IMG_NEW_LINK, 'img' => 'add');
                $controls[] = array('href' => "javascript:submitbutton('link_delete');", 'title' => _JLMS_LINKS_IMG_DEL_LINK, 'img' => 'delete');
                $controls[] = array('href' => "javascript:submitbutton('pre_link_edit');", 'title' => _JLMS_LINKS_IMG_EDIT_LINK, 'img' => 'edit');
            }
            JLMS_TMPL::ShowControlsFooter($controls);
        }
        JLMS_TMPL::CloseMT();
    }
    function showCourseDocuments($option, &$rows, &$lists, $is_teacher)
    {
        global $Itemid, $my, $JLMS_CONFIG;
        $JLMS_ACL =& JLMSFactory::getACL();
        $is_teacher = $JLMS_ACL->isTeacher();
        $can_do_everything = $JLMS_ACL->CheckPermissions('library', 'only_own_items') ? false : ($is_teacher ? true : false);
        $rows_c = $lists['collapsed_folders'];
        ?>
		
<script language="javascript" type="text/javascript">
<!--//--><![CDATA[//><!--
function submitbutton(pressbutton) {
	var form = document.adminForm;
	if ((pressbutton == 'outdoc_delete') && (form.boxchecked.value == '0')) {
		alert( "<?php 
        echo _JLMS_ALERT_SELECT_ITEM;
        ?>
" );
	} else if((pressbutton == 'outdoc_delete')){
		if(confirm('<?php 
        echo _JLMS_OUTDOCS_JS_CONFIRM_DELETE;
        ?>
')){
			form.task.value = pressbutton;
			form.submit();
		}
	} else if ((pressbutton == 'edit_outdoc') && (form.boxchecked.value == '0')) {
		alert( "<?php 
        echo _JLMS_ALERT_SELECT_ITEM;
        ?>
" );
	} else {
		form.task.value = pressbutton;
		form.submit();
	}
}
function submitbutton_change(pressbutton, state) {
	var form = document.adminForm;
	if (pressbutton == 'change_outdoc'){
		if (form.boxchecked.value == '0') {
			alert( "<?php 
        echo _JLMS_ALERT_SELECT_ITEM;
        ?>
" );
		} else {
			form.task.value = pressbutton;
			form.state.value = state;
			form.submit();
		}
	}
}
function submitbutton_change2(pressbutton, state, cid_id) {
	var form = document.adminForm;
	if (pressbutton == 'change_outdoc'){
		form.task.value = pressbutton;
		form.state.value = state;
		form.cid2.value = cid_id;
		form.submit();
	}
}
function submitbutton_order(pressbutton, item_id) {
	var form = document.adminForm;
	if ((pressbutton == 'outdoc_orderup') || (pressbutton == 'outdoc_orderdown')){
		if (item_id) {
		form.task.value = pressbutton;
		form.row_id.value = item_id;
		form.submit();
		}
	}
}

var TreeArray1 = new Array();
var TreeArray2 = new Array();
var Is_ex_Array = new Array();
<?php 
        $i = 1;
        foreach ($rows as $row) {
            echo "TreeArray1[" . $i . "] = " . $row->parent_id . ";";
            echo "TreeArray2[" . $i . "] = " . $row->id . ";";
            if (in_array($row->id, $rows_c)) {
                echo "Is_ex_Array[" . $i . "] = 0;";
            } else {
                echo "Is_ex_Array[" . $i . "] = 1;";
            }
            $i++;
        }
        ?>
function Hide_Folder(fid) {
	var vis_style = 'hidden';
	var dis_style = 'none';
	var i = 1;
	while (i < TreeArray1.length) {
		if (TreeArray1[i] == fid) {
			getObj('tree_row_'+TreeArray2[i]).style.visibility = vis_style;
			getObj('tree_row_'+TreeArray2[i]).style.display = dis_style;
			Hide_Folder(TreeArray2[i])
		}
		i ++;
	}
}
function Show_Folder(fid) {
	var vis_style = 'visible';
	var dis_style = '';
	var i = 1;
	while (i < TreeArray1.length) {
		if (TreeArray1[i] == fid) {
			if (getObj('tree_row_'+TreeArray2[i])) {
				getObj('tree_row_'+TreeArray2[i]).style.display = dis_style;
				getObj('tree_row_'+TreeArray2[i]).style.visibility = vis_style;
			}
			NoChange_Folder(TreeArray2[i])
		}
		i ++;
	}
}
function NoChange_Folder(fid) {
	var vis_style = 'hidden';var dis_style = 'none';var i = 1;var j = 0;
	while (i < TreeArray2.length) {
		if ( (TreeArray2[i] == fid) && (Is_ex_Array[i] == 1) ) {
			vis_style = 'visible';
			dis_style = '';
			j = 1;
		}
		i ++;
	}
	i = 1;
	while (i < TreeArray1.length) {
		if (TreeArray1[i] == fid) {
			getObj('tree_row_'+TreeArray2[i]).style.visibility = vis_style;
			getObj('tree_row_'+TreeArray2[i]).style.display = dis_style;
			if (j == 1) { NoChange_Folder(TreeArray2[i]);
			} else { Hide_Folder(TreeArray2[i]); }
		}
		i ++;
	}
}
function Ex_Folder(fid) {
	var i = 1;
	var j = 1;
	while (i < TreeArray2.length) {
		if ( (TreeArray2[i] == fid) && (Is_ex_Array[i] == 1) ) { j = 0; }
		i ++;
	}
	if (j == 1) {
		Show_Folder(fid);
		if (getObj('tree_img_' + fid).runtimeStyle) {
			var StStr = getObj('tree_img_' + fid).runtimeStyle.filter;
			var imgStr = getObj('tree_img_' + fid).outerHTML;
			imgStr = imgStr.replace('expandall.png','collapseall.png').replace('<?php 
        echo _JLMS_DOCS_EXP_FOLDER;
        ?>
', '<?php 
        echo _JLMS_DOCS_COLL_FOLDER;
        ?>
');
			StStr = StStr.replace('expandall.png','collapseall.png');
			getObj('tree_img_' + fid).outerHTML = imgStr;
			getObj('tree_img_' + fid).runtimeStyle.filter = StStr;
		} else {
			getObj('tree_img_' + fid).src = '<?php 
        echo $JLMS_CONFIG->get('live_site');
        ?>
/components/com_joomla_lms/lms_images/docs/collapseall.png';
			getObj('tree_img_' + fid).alt = '<?php 
        echo _JLMS_DOCS_COLLAPSE;
        ?>
';
			getObj('tree_img_' + fid).title = '<?php 
        echo _JLMS_DOCS_COLL_FOLDER;
        ?>
';
		}
	} else {
		Hide_Folder(fid);
		if (getObj('tree_img_' + fid).runtimeStyle) {
			var StStr = getObj('tree_img_' + fid).runtimeStyle.filter;
			var imgStr = getObj('tree_img_' + fid).outerHTML;
			imgStr = imgStr.replace('collapseall.png','expandall.png').replace('<?php 
        echo _JLMS_DOCS_COLL_FOLDER;
        ?>
', '<?php 
        echo _JLMS_DOCS_EXP_FOLDER;
        ?>
');
			StStr = StStr.replace('collapseall.png','expandall.png');
			getObj('tree_img_' + fid).outerHTML = imgStr;
			getObj('tree_img_' + fid).runtimeStyle.filter = StStr;
		} else {
			getObj('tree_img_' + fid).src = '<?php 
        echo $JLMS_CONFIG->get('live_site');
        ?>
/components/com_joomla_lms/lms_images/docs/expandall.png';
			getObj('tree_img_' + fid).alt = '<?php 
        echo _JLMS_DOCS_EXPAND;
        ?>
';
			getObj('tree_img_' + fid).title = '<?php 
        echo _JLMS_DOCS_EXP_FOLDER;
        ?>
';
		}
	}
	i = 1;
	while (i < TreeArray2.length) {
		if ( (TreeArray2[i] == fid) ) {
			if (Is_ex_Array[i] == 1) { Is_ex_Array[i] = 0;
			} else { Is_ex_Array[i] = 1; }
		}
		i ++;
	}
}
JLMS_preloadImages('<?php 
        echo $JLMS_CONFIG->get('live_site');
        ?>
/components/com_joomla_lms/lms_images/docs/expandall.png','<?php 
        echo $JLMS_CONFIG->get('live_site');
        ?>
/components/com_joomla_lms/lms_images/docs/collapseall.png'<?php 
        if ($is_teacher) {
            echo ", '" . $JLMS_CONFIG->get('live_site') . '/' . $JLMS_CONFIG->get('ajax_settings_small_indicator') . "'";
        }
        ?>
);
//--><!]]>
</script>
<?php 
        JLMS_TMPL::OpenMT();
        $hparams = array('show_menu' => true, 'simple_menu' => true);
        $toolbar = array();
        JLMS_TMPL::ShowHeader('outdocs', _JLMS_TOOLBAR_LIBRARY, $hparams, $toolbar);
        $max_tree_width = 0;
        if (isset($rows[0])) {
            $max_tree_width = $rows[0]->tree_max_width;
        }
        JLMS_TMPL::OpenTS('', ' align="right" style="text-align:right " width="100%"');
        $is_teacher = $JLMS_ACL->isTeacher();
        ?>
			<form action="<?php 
        echo $JLMS_CONFIG->get('live_site') . "/index.php?option=" . $option . "&amp;Itemid=" . $Itemid;
        ?>
" method="post" name="adminForm" enctype="multipart/form-data">
<?php 
        if (!empty($rows)) {
            ?>
				<table width="100%" cellpadding="0" cellspacing="0" border="0" class="<?php 
            echo JLMSCSS::_('jlmslist');
            ?>
">
					<tr>
						<<?php 
            echo JLMSCSS::tableheadertag();
            ?>
 width="20" class="<?php 
            echo JLMSCSS::_('sectiontableheader');
            ?>
" align="center">#</<?php 
            echo JLMSCSS::tableheadertag();
            ?>
>
					<?php 
            //if ($JLMS_ACL->CheckPermissions('docs', 'manage')) {
            ?>
						<<?php 
            echo JLMSCSS::tableheadertag();
            ?>
 width="20" class="<?php 
            echo JLMSCSS::_('sectiontableheader');
            ?>
"><input type="checkbox" style="visibility:hidden;" /></<?php 
            echo JLMSCSS::tableheadertag();
            ?>
>
					<?php 
            //}
            ?>
						<?php 
            for ($th_i = 0; $th_i < $max_tree_width + 1; $th_i++) {
                ?>
						<<?php 
                echo JLMSCSS::tableheadertag();
                ?>
 width="1%" class="<?php 
                echo JLMSCSS::_('sectiontableheader');
                ?>
"><span style="display: block; width: 16px;">&nbsp;</span></<?php 
                echo JLMSCSS::tableheadertag();
                ?>
>
						<?php 
            }
            ?>
						<<?php 
            echo JLMSCSS::tableheadertag();
            ?>
 class="<?php 
            echo JLMSCSS::_('sectiontableheader');
            ?>
" width="45%"><span style="display: block; width: 150px; text-align: left;"><?php 
            echo _JLMS_DOCS_TBL_DOCNAME;
            ?>
</span></<?php 
            echo JLMSCSS::tableheadertag();
            ?>
>
					<?php 
            //if ($JLMS_ACL->CheckPermissions('docs', 'manage')) {
            ?>
						<<?php 
            echo JLMSCSS::tableheadertag();
            ?>
 class="<?php 
            echo JLMSCSS::_('sectiontableheader');
            ?>
" colspan="2">&nbsp;</<?php 
            echo JLMSCSS::tableheadertag();
            ?>
>
						<<?php 
            echo JLMSCSS::tableheadertag();
            ?>
 class="<?php 
            echo JLMSCSS::_('sectiontableheader');
            ?>
" width="1">&nbsp;</<?php 
            echo JLMSCSS::tableheadertag();
            ?>
>
						<<?php 
            echo JLMSCSS::tableheadertag();
            ?>
 class="<?php 
            echo JLMSCSS::_('sectiontableheader');
            ?>
"><?php 
            echo _JLMS_DOCS_TBL_STARTING;
            ?>
</<?php 
            echo JLMSCSS::tableheadertag();
            ?>
>
						<<?php 
            echo JLMSCSS::tableheadertag();
            ?>
 class="<?php 
            echo JLMSCSS::_('sectiontableheader');
            ?>
"><?php 
            echo _JLMS_DOCS_TBL_ENDING;
            ?>
</<?php 
            echo JLMSCSS::tableheadertag();
            ?>
>
					<?php 
            //}
            ?>
						<<?php 
            echo JLMSCSS::tableheadertag();
            ?>
 class="<?php 
            echo JLMSCSS::_('sectiontableheader');
            ?>
" width="60%"><?php 
            echo _JLMS_DOCS_TBL_DESCR;
            ?>
</<?php 
            echo JLMSCSS::tableheadertag();
            ?>
>
					</tr>
				<?php 
            $k = 1;
            $tree_modes = array();
            $visible_folder = true;
            //$next_row_is_visible = true;
            $vis_mode = 0;
            for ($i = 0, $n = count($rows); $i < $n; $i++) {
                $row = $rows[$i];
                $max_tree_width = $row->tree_max_width;
                $link = '';
                $link_title = '';
                if ($row->folder_flag == 2) {
                    $link = sefRelToAbs("index.php?option=" . $option . "&amp;Itemid=" . $Itemid . "&amp;task=docs_view_zip&amp;id=" . $row->id);
                    $link_title = _JLMS_T_A_VIEW_ZIP_PACK;
                } elseif (!$row->folder_flag && $row->file_id) {
                    $link = sefRelToAbs("index.php?option=" . $option . "&amp;Itemid=" . $Itemid . "&amp;task=get_outdoc&amp;id=" . $row->id);
                    $link_title = _JLMS_DOCS_LINK_DOWNLOAD;
                } elseif (!$row->folder_flag && !$row->file_id) {
                    $link = sefRelToAbs("index.php?option=" . $option . "&amp;Itemid=" . $Itemid . "&amp;task=outdocs_view_content&amp;id=" . $row->id);
                    $link_title = _JLMS_T_A_VIEW_CONTENT;
                } elseif ($row->folder_flag == 3 && $row->file_id) {
                    $link = sefRelToAbs("index.php?option=" . $option . "&amp;Itemid=" . $Itemid . "&amp;task=playerSCORMFiles&amp;id=" . $row->file_id . "&amp;doc_id=" . $row->id);
                    $link_title = _JLMS_T_A_VIEW_CONTENT;
                }
                $time_p = $row->publish_start || $row->publish_end;
                $alt = $row->published ? $time_p ? _JLMS_STATUS_PUB2 : _JLMS_STATUS_PUB : _JLMS_STATUS_UNPUB;
                $image = $row->published ? $time_p ? 'btn_publish_wait.png' : 'btn_accept.png' : 'btn_cancel.png';
                //($time_p?'btn_unpublish_wait.png':'btn_cancel.png');
                if ($time_p) {
                    $is_expired = false;
                    if ($row->publish_start) {
                        $s_date = strtotime($row->start_date);
                        if ($s_date > time()) {
                            $is_expired = true;
                        }
                    }
                    if ($row->publish_end && !$is_expired) {
                        $e_date = strtotime($row->end_date);
                        if ($e_date < time()) {
                            $is_expired = true;
                        }
                    }
                    if ($is_expired) {
                        $alt = _JLMS_STATUS_EXPIRED;
                        $image = 'btn_expired.png';
                    }
                }
                $state = $row->published ? 0 : 1;
                $checked = mosHTML::idBox($i, $row->id);
                // Collapsed/Expanded view
                $tree_row_style = '';
                $visible_folder = true;
                //$next_row_is_visible;
                //$next_row_is_visible = true;
                if ($vis_mode) {
                    if ($row->tree_mode_num < $vis_mode) {
                        $vis_mode = 0;
                    }
                }
                if (in_array($row->id, $rows_c)) {
                    //$next_row_is_visible = false;
                    if ($vis_mode) {
                        if ($row->tree_mode_num < $vis_mode) {
                            $vis_mode = $row->tree_mode_num;
                        } else {
                            $visible_folder = false;
                        }
                    } else {
                        $vis_mode = $row->tree_mode_num + 1;
                    }
                } elseif ($vis_mode) {
                    if ($row->tree_mode_num >= $vis_mode) {
                        $visible_folder = false;
                    } else {
                        $vis_mode = 0;
                    }
                }
                if (!$visible_folder) {
                    $tree_row_style = ' style="visibility:hidden;display:none"';
                }
                ?>
					<tr id="tree_row_<?php 
                echo $row->id;
                ?>
" class="<?php 
                echo JLMSCSS::_('sectiontableentry' . $k);
                ?>
"<?php 
                echo $tree_row_style;
                ?>
>
						<td align="center" valign="middle"><?php 
                echo $i + 1;
                ?>
</td>
					
						<td valign="middle"><?php 
                if ($my->id == $row->owner_id || $can_do_everything) {
                    echo $checked;
                }
                ?>
</td>
					
						<?php 
                $add_img = '';
                if ($row->tree_mode_num) {
                    $g = 0;
                    $tree_modes[$row->tree_mode_num - 1] = $row->tree_mode;
                    while ($g < $row->tree_mode_num - 1) {
                        $pref = '';
                        if (isset($tree_modes[$g]) && $tree_modes[$g] == 2) {
                            $pref = 'empty_';
                        }
                        $add_img .= "<td width='16' valign='middle'><img src=\"" . $JLMS_CONFIG->get('live_site') . "/components/com_joomla_lms/lms_images/treeview/" . $pref . "line.png\" width='16' height='16' alt='" . $pref . "line' /></td>";
                        $g++;
                    }
                    $add_img .= "<td width='16' valign='middle'><img src=\"" . $JLMS_CONFIG->get('live_site') . "/components/com_joomla_lms/lms_images/treeview/sub" . $row->tree_mode . ".png\" width='16' height='16' alt='sub" . $row->tree_mode . "' /></td>";
                    $max_tree_width = $max_tree_width - $g - 1;
                }
                echo $add_img;
                ?>
						<td align="center" valign="middle" width='16'>
						<?php 
                if ($row->folder_flag == 1) {
                    $collapse_img = 'collapseall.png';
                    $collapse_alt = _JLMS_DOCS_COLL_FOLDER;
                    if (in_array($row->id, $rows_c)) {
                        $collapse_img = 'expandall.png';
                        $collapse_alt = _JLMS_DOCS_EXP_FOLDER;
                    }
                    echo "<span id='tree_div_" . $row->id . "' style='alignment:center; width:16px; font-weight:bold; cursor:pointer; vertical-align:middle;' onclick='Ex_Folder(" . $row->id . "," . $row->id . ",true)'><img class='JLMS_png' id='tree_img_" . $row->id . "' src=\"" . $JLMS_CONFIG->get('live_site') . "/components/com_joomla_lms/lms_images/docs/{$collapse_img}\" width='13' height='13' alt='" . $collapse_alt . "' title='" . $collapse_alt . "' /></span>";
                } else {
                    echo "<span style='alignment:center; width:16px; font-weight:bold; vertical-align:middle;'><img class='JLMS_png' src=\"" . $JLMS_CONFIG->get('live_site') . "/components/com_joomla_lms/lms_images/files/" . $row->file_icon . ".png\" width='16' height='16' alt='{$row->file_icon}' /></span>";
                }
                ?>
						</td>
						<td align="left" valign="middle" <?php 
                if ($max_tree_width > 0) {
                    echo "colspan='" . ($max_tree_width + 1) . "'";
                }
                ?>
 width="45%">
						<span style='font-weight:bold; vertical-align:middle;'>
						<?php 
                if ($row->folder_flag == 1) {
                    echo '&nbsp;<strong>' . $row->doc_name . '</strong>';
                } else {
                    ?>
							<?php 
                    if ($is_teacher && $row->outdoc_share || !$is_teacher && $row->outdoc_share == 2 || $my->id == $row->owner_id || $can_do_everything) {
                        $add_link_params = '';
                        if ($row->folder_flag == 3 && isset($row->scorm_params) && $row->scorm_params) {
                            $tmp_params = new JLMSParameters($row->scorm_params);
                            if ($tmp_params->get('scorm_layout', 0) == 1) {
                                $x_size = 0;
                                $y_size = 0;
                                if (isset($row->scorm_width) && $row->scorm_width > 100) {
                                    $x_size = $row->scorm_width;
                                }
                                if (isset($row->scorm_height) && $row->scorm_height > 100) {
                                    $y_size = $row->scorm_height;
                                }
                                $add_link_params = ' class="scorm_modal" rel="{handler:\'iframe\', size:{x:' . $x_size . ',y:' . $y_size . '}}"';
                                JLMS_initialize_SqueezeBox();
                            }
                        }
                        if ($link) {
                            ?>
							<a href="<?php 
                            echo $link;
                            ?>
"<?php 
                            echo $add_link_params;
                            ?>
 title="<?php 
                            echo str_replace('"', '&quot;', $row->doc_name);
                            ?>
">
<?php 
                        }
                        ?>
							<?php 
                    }
                    ?>
								&nbsp;<?php 
                    echo $row->doc_name;
                    ?>
								<?php 
                    if ($is_teacher && $row->outdoc_share || !$is_teacher && $row->outdoc_share == 2 || $my->id == $row->owner_id || $can_do_everything) {
                        if ($link) {
                            ?>
							</a>
<?php 
                        }
                        ?>
						<?php 
                    }
                }
                ?>
						</span>
						<?php 
                if ($JLMS_CONFIG->get('show_library_authors', 0) && $row->author_name) {
                    ?>
						<br />
						<span class="small"><?php 
                    echo _JLMS_HOME_AUTHOR . "&nbsp;" . $row->author_name;
                    ?>
</span>
						<?php 
                }
                ?>

						</td>
					<?php 
                //if ($JLMS_ACL->CheckPermissions('docs', 'manage')) {
                ?>
						<td valign="middle" style="vertical-align:middle "><?php 
                if ($row->allow_up == 1 && ($my->id == $row->owner_id || $can_do_everything)) {
                    echo JLMS_orderUpIcon(1, $row->id, true, 'outdoc_orderup');
                } else {
                    echo '&nbsp;';
                }
                ?>
</td>
						<td valign="middle" style="vertical-align:middle "><?php 
                if ($row->allow_down == 1 && ($my->id == $row->owner_id || $can_do_everything)) {
                    echo JLMS_orderDownIcon(1, 3, $row->id, true, 'outdoc_orderdown');
                } else {
                    echo '&nbsp;';
                }
                ?>
</td>
						<td valign="middle">
							<?php 
                if ($my->id == $row->owner_id || $can_do_everything) {
                    echo '<a class="jlms_img_link" href="javascript:submitbutton_change2(\'change_outdoc\',' . $state . ',' . $row->id . ')" title="' . $alt . '">';
                    echo '<img class="JLMS_png" src="' . $JLMS_CONFIG->get('live_site') . '/components/com_joomla_lms/lms_images/toolbar/' . $image . '" width="16" height="16" border="0" alt="' . $alt . '" />';
                    echo '</a>';
                } else {
                    echo '&nbsp;';
                }
                ?>
						</td>
						
						<td align="center" nowrap='nowrap' valign="middle"><?php 
                echo $row->publish_start ? JLMS_dateToDisplay($row->start_date) : '-';
                ?>
</td>
						<td align="center" nowrap='nowrap' valign="middle"><?php 
                echo $row->publish_end ? JLMS_dateToDisplay($row->end_date) : '-';
                ?>
</td>
					<?php 
                //}
                ?>
						<td><?php 
                $doc_descr = strip_tags($row->doc_description);
                if (!$row->folder_flag && !$row->file_id) {
                    if (strlen($doc_descr) > 75) {
                        $doc_descr = substr($doc_descr, 0, 75) . "...";
                    }
                }
                echo $doc_descr ? $doc_descr : '&nbsp;';
                ?>
						</td>
					</tr>
					<?php 
                $k = 3 - $k;
            }
            ?>
				</table>
<?php 
        } else {
            echo '<div class="joomlalms_user_message">' . _JLMS_NO_ITEMS_HERE . '</div>';
        }
        ?>
				<input type="hidden" name="option" value="<?php 
        echo $option;
        ?>
" />
				<input type="hidden" name="Itemid" value="<?php 
        echo $Itemid;
        ?>
" />
				<input type="hidden" name="task" value="" />
				<input type="hidden" name="boxchecked" value="0" />
				<input type="hidden" name="row_id" value="0" />
				<input type="hidden" name="state" value="0" />
				<input type="hidden" name="cid2" value="0" />
			</form>

<?php 
        JLMS_TMPL::CloseTS();
        //if ($JLMS_ACL->CheckPermissions('docs', 'manage')) {
        if ($is_teacher) {
            $link_foldernew = ampReplace(sefRelToAbs("index.php?option={$option}&amp;Itemid={$Itemid}&amp;task=new_outfolder"));
            $link_filenew = ampReplace(sefRelToAbs("index.php?option={$option}&amp;Itemid={$Itemid}&amp;task=new_outdocs"));
            $link_scormnew = ampReplace(sefRelToAbs("index.php?option={$option}&amp;Itemid={$Itemid}&amp;task=new_scorm"));
            $controls = array();
            $controls[] = array('href' => "javascript:submitbutton_change('change_outdoc',1);", 'title' => _JLMS_SET_PUB, 'img' => 'publish');
            $controls[] = array('href' => "javascript:submitbutton_change('change_outdoc',0);", 'title' => _JLMS_SET_UNPUB, 'img' => 'unpublish');
            $controls[] = array('href' => 'spacer');
            $controls[] = array('href' => $link_foldernew, 'title' => _JLMS_DOCS_LNK_NEW_FOLDER, 'img' => 'foldernew');
            $controls[] = array('href' => $link_filenew, 'title' => _JLMS_DOCS_LNK_NEW_DOC, 'img' => 'filenew');
            $controls[] = array('href' => "javascript:submitbutton('outdoc_delete');", 'title' => _JLMS_DELETE, 'img' => 'delete');
            $controls[] = array('href' => "javascript:submitbutton('edit_outdoc');", 'title' => _JLMS_EDIT, 'img' => 'edit');
            $controls[] = array('href' => $link_scormnew, 'title' => _JLMS_DOCS_NEW_SCORM_PACKAGE, 'img' => 'add_scorm');
            JLMS_TMPL::ShowControlsFooter($controls);
            //}
        }
        JLMS_TMPL::CloseMT();
    }
    function showCourseLPaths($course_id, $option, &$lpaths)
    {
        global $Itemid, $my, $JLMS_DB, $JLMS_CONFIG;
        $JLMS_ACL =& JLMSFactory::getACL();
        ?>
<script language="javascript" type="text/javascript">
<!--
function submitbutton(pressbutton) {
	var form = document.adminForm;
		
			if ( ((pressbutton == 'edit_lpath') || (pressbutton == 'lpath_delete') ) && (form.boxchecked.value == "0")) {
				alert('<?php 
        echo _JLMS_ALERT_SELECT_ITEM;
        ?>
');
			} else {
				if( pressbutton == 'lpath_delete' ) {
					if (confirm('<?php 
        echo _JLMS_ALERT_DELETE_ITEM;
        ?>
')) {
						form.task.value = pressbutton;
						form.submit();
					}
				}
				else {	
						form.task.value = pressbutton;
						form.submit();
				}
			}	
}
	
function submitbutton_order(pressbutton, item_id) {
	var form = document.adminForm;
	if ((pressbutton == 'lpath_orderup') || (pressbutton == 'lpath_orderdown')){
		if (item_id) {
		form.task.value = pressbutton;
		form.row_id.value = item_id;
		form.submit();
		}
	}
}
function submitbutton_change(pressbutton, state) {
	var form = document.adminForm;
	if (pressbutton == 'change_lpath'){
		if (form.boxchecked.value == 0 || form.boxchecked.value == "0") {
			alert('<?php 
        echo _JLMS_ALERT_SELECT_ITEM;
        ?>
');
		} else {
			form.task.value = pressbutton;
			form.state.value = state;
			form.submit();
		}
	}
}
function submitbutton_change2(pressbutton, state, cid_id) {
	var form = document.adminForm;
	if (pressbutton == 'change_lpath'){
		form.task.value = pressbutton;
		form.state.value = state;
		form.cid2.value = cid_id;
		form.submit();
	}
}
function submitbutton_allorder(n) {
	var form = document.adminForm;

	for ( var j = 0; j <= n; j++ ) {
		box = eval( "document.adminForm.cb" + j );
		if ( box ) {
			if ( box.checked == false ) {
				box.checked = true;
			}
		}
	}
	form.task.value = 'lpath_saveorederall';
	form.submit();
}
//-->
</script>
<?php 
        JLMS_TMPL::OpenMT();
        $hparams = array();
        JLMS_TMPL::ShowHeader('lpath', _JLMS_LPATH_TITLE, $hparams);
        JLMS_TMPL::OpenTS();
        //temporary check for number of items
        $num_items = 0;
        $there_were_squeezeboxes = false;
        for ($i = 0, $n = count($lpaths); $i < $n; $i++) {
            $row_path = $lpaths[$i];
            $is_hidden = false;
            if ($row_path->item_id) {
                $tmp_params = new JLMSParameters($row_path->lp_params);
                if ($tmp_params->get('hide_in_list', 0) == 1) {
                    $is_hidden = true;
                }
            }
            if ($JLMS_ACL->CheckPermissions('lpaths', 'manage')) {
                $task = 'compose_lpath';
                $title = _JLMS_LPATH_LINK_TITLE_COMPOSE;
            } elseif ($JLMS_ACL->CheckPermissions('lpaths', 'view')) {
                $task = 'show_lpath';
                $title = _JLMS_LPATH_LINK_TITLE_VIEW;
                if ($is_hidden) {
                    continue;
                }
            }
            if (isset($row_path->is_hidden) && $row_path->is_hidden && !$JLMS_ACL->CheckPermissions('lpaths', 'view_all')) {
                continue;
            }
            $num_items++;
        }
        ?>
			<form action="<?php 
        echo $JLMS_CONFIG->getCfg('live_site') . "/index.php?option={$option}&amp;Itemid={$Itemid}";
        ?>
" method="post" name="adminForm">
<?php 
        if ($num_items) {
            ?>
				<table width="100%" cellpadding="0" cellspacing="0" border="0" class="<?php 
            echo JLMSCSS::_('jlmslist');
            ?>
">
					<tr>
						<<?php 
            echo JLMSCSS::tableheadertag();
            ?>
 width="20" class="<?php 
            echo JLMSCSS::_('sectiontableheader');
            ?>
" align="center">#</<?php 
            echo JLMSCSS::tableheadertag();
            ?>
>
					<?php 
            if ($JLMS_ACL->CheckPermissions('lpaths', 'manage') || $JLMS_ACL->CheckPermissions('lpaths', 'publish')) {
                ?>
						<<?php 
                echo JLMSCSS::tableheadertag();
                ?>
 width="25" class="<?php 
                echo JLMSCSS::_('sectiontableheader');
                ?>
" align="center"><input type="checkbox" name="toggle" value="" onclick="checkAll(<?php 
                echo count($lpaths);
                ?>
);" /></<?php 
                echo JLMSCSS::tableheadertag();
                ?>
>
					<?php 
            }
            ?>
						<<?php 
            echo JLMSCSS::tableheadertag();
            ?>
 width="20" class="<?php 
            echo JLMSCSS::_('sectiontableheader');
            ?>
" align="center">&nbsp;</<?php 
            echo JLMSCSS::tableheadertag();
            ?>
>
						<<?php 
            echo JLMSCSS::tableheadertag();
            ?>
 class="<?php 
            echo JLMSCSS::_('sectiontableheader');
            ?>
"><?php 
            echo _JLMS_LPATH_TBL_HEAD_NAME;
            ?>
</<?php 
            echo JLMSCSS::tableheadertag();
            ?>
>
					<?php 
            if ($JLMS_ACL->CheckPermissions('lpaths', 'publish')) {
                ?>
						<<?php 
                echo JLMSCSS::tableheadertag();
                ?>
 class="<?php 
                echo JLMSCSS::_('sectiontableheader');
                ?>
" width="1">&nbsp;</<?php 
                echo JLMSCSS::tableheadertag();
                ?>
>
					<?php 
            }
            ?>
					<?php 
            if ($JLMS_ACL->CheckPermissions('lpaths', 'order')) {
                ?>
						<<?php 
                echo JLMSCSS::tableheadertag();
                ?>
 class="<?php 
                echo JLMSCSS::_('sectiontableheader');
                ?>
" width="1">&nbsp;</<?php 
                echo JLMSCSS::tableheadertag();
                ?>
>
						<<?php 
                echo JLMSCSS::tableheadertag();
                ?>
 class="<?php 
                echo JLMSCSS::_('sectiontableheader');
                ?>
" width="1">&nbsp;</<?php 
                echo JLMSCSS::tableheadertag();
                ?>
>
						<<?php 
                echo JLMSCSS::tableheadertag();
                ?>
 class="<?php 
                echo JLMSCSS::_('sectiontableheader');
                ?>
" width="1"><?php 
                echo _JLMS_REORDER;
                ?>
</<?php 
                echo JLMSCSS::tableheadertag();
                ?>
>
						<<?php 
                echo JLMSCSS::tableheadertag();
                ?>
 class="<?php 
                echo JLMSCSS::_('sectiontableheader');
                ?>
" width="1"><a class="jlms_img_link" href="javascript:submitbutton_allorder(<?php 
                echo count($lpaths) - 1;
                ?>
)"><img width="16" height="16" border="0" title="<?php 
                echo _JLMS_SAVEORDER;
                ?>
" alt="<?php 
                echo _JLMS_SAVEORDER;
                ?>
" src="<?php 
                echo $JLMS_CONFIG->get('live_site');
                ?>
/components/com_joomla_lms/lms_images/filesave.png"/></a></<?php 
                echo JLMSCSS::tableheadertag();
                ?>
>
					<?php 
            }
            ?>
					<?php 
            if ($JLMS_ACL->CheckPermissions('lpaths', 'manage')) {
                ?>
						<<?php 
                echo JLMSCSS::tableheadertag();
                ?>
 class="<?php 
                echo JLMSCSS::_('sectiontableheader');
                ?>
" width="1">&nbsp;</<?php 
                echo JLMSCSS::tableheadertag();
                ?>
>
					<?php 
            }
            ?>
					<?php 
            if (!$JLMS_ACL->CheckPermissions('lpaths', 'manage')) {
                ?>
						<<?php 
                echo JLMSCSS::tableheadertag();
                ?>
 class="<?php 
                echo JLMSCSS::_('sectiontableheader');
                ?>
" width="1">&nbsp;</<?php 
                echo JLMSCSS::tableheadertag();
                ?>
>
						<<?php 
                echo JLMSCSS::tableheadertag();
                ?>
 class="<?php 
                echo JLMSCSS::_('sectiontableheader');
                ?>
" align="center"><?php 
                echo _JLMS_LPATH_TBL_STARTING;
                ?>
</<?php 
                echo JLMSCSS::tableheadertag();
                ?>
>
						<<?php 
                echo JLMSCSS::tableheadertag();
                ?>
 class="<?php 
                echo JLMSCSS::_('sectiontableheader');
                ?>
" align="center"><?php 
                echo _JLMS_LPATH_TBL_ENDING;
                ?>
</<?php 
                echo JLMSCSS::tableheadertag();
                ?>
>
					<?php 
            }
            ?>
						<<?php 
            echo JLMSCSS::tableheadertag();
            ?>
 class="<?php 
            echo JLMSCSS::_('sectiontableheader');
            ?>
"><?php 
            echo _JLMS_LPATH_TBL_HEAD_DESCR;
            ?>
</<?php 
            echo JLMSCSS::tableheadertag();
            ?>
>
					</tr>
				<?php 
            $k = 1;
            $i_counter = 0;
            for ($i = 0, $n = count($lpaths); $i < $n; $i++) {
                $row_path = $lpaths[$i];
                $is_hidden = false;
                $is_squeezebox = false;
                if ($row_path->item_id) {
                    $tmp_params = new JLMSParameters($row_path->lp_params);
                    if ($tmp_params->get('hide_in_list', 0) == 1) {
                        $is_hidden = true;
                    }
                    if (isset($row_path->scorm_params)) {
                        $tmp_params2 = new JLMSParameters($row_path->scorm_params);
                        if ($tmp_params2->get('scorm_layout', 0) == 1) {
                            $is_squeezebox = true;
                            $there_were_squeezeboxes = true;
                        }
                    }
                }
                $manage_item = false;
                if ($JLMS_ACL->CheckPermissions('lpaths', 'manage')) {
                    $manage_item = true;
                }
                if ($JLMS_ACL->CheckPermissions('lpaths', 'only_own_items') && $row_path->owner_id != $my->id) {
                    $manage_item = false;
                } elseif ($JLMS_ACL->CheckPermissions('lpaths', 'only_own_role') && $JLMS_ACL->GetRole() != $JLMS_ACL->UserSystemRole($JLMS_DB, $row_path->owner_id)) {
                    $manage_item = false;
                }
                if ($manage_item) {
                    $task = 'compose_lpath';
                    $title = _JLMS_LPATH_LINK_TITLE_COMPOSE;
                } elseif ($JLMS_ACL->CheckPermissions('lpaths', 'view')) {
                    $task = 'show_lpath';
                    $title = _JLMS_LPATH_LINK_TITLE_VIEW;
                    if ($is_hidden && !$JLMS_ACL->CheckPermissions('lpaths', 'view_all')) {
                        continue;
                    }
                }
                if (isset($row_path->is_hidden) && $row_path->is_hidden && !$JLMS_ACL->CheckPermissions('lpaths', 'view_all')) {
                    continue;
                }
                $link = "index.php?option=" . $option . "&Itemid=" . $Itemid . "&task=" . $task . "&course_id=" . $course_id . "&id=" . $row_path->id;
                // sefRelToAbs() - est' nige
                $icon_img = "toolbar/tlb_lpath";
                $icon_alt = "learnpath";
                if ($row_path->item_id) {
                    $title = _JLMS_LPATH_LINK_TITLE_SCORM;
                    //$link = "index.php?option=".$option."&Itemid=".$Itemid."&task=player_scorm&course_id=".$course_id."&id=".$row_path->item_id."&lp_type=".$row_path->lp_type;
                    $link = "index.php?option=" . $option . "&Itemid=" . $Itemid . "&task=show_lpath&course_id=" . $course_id . "&id=" . $row_path->id;
                    //."&lp_type=".$row_path->lp_type;
                    $icon_img = "toolbar/tlb_scorm";
                    $icon_alt = "scorm";
                }
                $checked = mosHTML::idBox($i_counter, $row_path->id);
                $alt = $row_path->published ? $is_hidden ? _JLMS_STATUS_PUBLISHED_AND_HIDDEN : _JLMS_LPATH_STATUS_PUB : _JLMS_LPATH_STATUS_UNPUB;
                $image = $row_path->published ? $is_hidden ? 'btn_publish_hidden.png' : 'btn_accept.png' : 'btn_cancel.png';
                $state = $row_path->published ? 0 : 1;
                $released_info_txt = '';
                if ($row_path->is_time_related) {
                    $released_info_txt = _JLMS_WILL_BE_RELEASED_IN;
                    $showperiod = $row_path->show_period;
                    $ost1 = $showperiod % (24 * 60);
                    $sp_days = ($showperiod - $ost1) / (24 * 60);
                    $ost2 = $showperiod % 60;
                    $sp_hours = ($ost1 - $ost2) / 60;
                    $sp_mins = $ost2;
                    $release_time_info = false;
                    if ($sp_days) {
                        $released_info_txt .= ' ' . $sp_days . ' ' . _JLMS_RELEASED_IN_DAYS;
                        $release_time_info = true;
                    }
                    if ($sp_hours) {
                        $released_info_txt .= ' ' . $sp_hours . ' ' . _JLMS_RELEASED_IN_HOURS;
                        $release_time_info = true;
                    }
                    if ($sp_mins) {
                        $released_info_txt .= ' ' . $sp_mins . ' ' . _JLMS_RELEASED_IN_MINUTES;
                        $release_time_info = true;
                    }
                    if ($release_time_info) {
                        $released_info_txt .= ' ' . _JLMS_RELEASED_AFTER_ENROLLMENT;
                    }
                    if ($image == 'btn_accept.png') {
                        $image = 'btn_publish_wait.png';
                    }
                }
                $publish_icon = '&nbsp;';
                if ($JLMS_ACL->CheckPermissions('lpaths', 'publish')) {
                    /*$publish_icon = '<a href="javascript:submitbutton_change2(\'change_lpath\','.$state.','.$row_path->id.')" title="'.$alt.'">';
                    		$publish_icon .= '<img class="JLMS_png" src="'.$JLMS_CONFIG->get('live_site').'/components/com_joomla_lms/lms_images/toolbar/'.$image.'" width="16" height="16" border="0" alt="'.$alt.'" />';
                    		$publish_icon .= '</a>';*/
                    $title_tt = $alt;
                    $content_tt = $released_info_txt;
                    if (isset($row_path->is_prereqs) && $row_path->is_prereqs) {
                        if ($content_tt) {
                            $content_tt .= '<br />';
                        }
                        $content_tt .= _JLMS_STATUS_CONFIGURED_PREREQUISITES;
                    }
                    $name_tt = '<img class="JLMS_png" src="' . $JLMS_CONFIG->get('live_site') . '/components/com_joomla_lms/lms_images/toolbar/' . $image . '" width="16" height="16" border="0" alt="' . $alt . '" />';
                    $link_tt = 'javascript:submitbutton_change2(\'change_lpath\',' . $state . ',' . $row_path->id . ')';
                    $publish_icon = JLMS_toolTip($title_tt, $content_tt, $name_tt, $link_tt);
                }
                if ($JLMS_ACL->CheckPermissions('lpaths', 'only_own_items') && $row_path->owner_id != $my->id) {
                    $checked = '&nbsp;';
                    $publish_icon = '&nbsp;';
                } elseif ($JLMS_ACL->CheckPermissions('lpaths', 'only_own_role') && $JLMS_ACL->GetRole() != $JLMS_ACL->UserSystemRole($JLMS_DB, $row_path->owner_id)) {
                    $checked = '&nbsp;';
                    $publish_icon = '&nbsp;';
                }
                ?>
					<tr class="<?php 
                echo JLMSCSS::_('sectiontableentry' . $k);
                ?>
">
						<td valign="middle" align="center"><?php 
                echo $i_counter + 1;
                ?>
</td>
					<?php 
                if ($JLMS_ACL->CheckPermissions('lpaths', 'manage') || $JLMS_ACL->CheckPermissions('lpaths', 'publish')) {
                    ?>
						<td valign="middle" align="center"><?php 
                    if (!isset($row_path->is_link)) {
                        echo $checked;
                    }
                    ?>
</td>
					<?php 
                }
                ?>
						<td valign="middle" align="center">
							<span style="vertical-align:middle; text-align:center">
								<img class='JLMS_png' src="<?php 
                echo $JLMS_CONFIG->get('live_site');
                ?>
/components/com_joomla_lms/lms_images/<?php 
                echo $icon_img;
                ?>
.png" width='16' height='16' alt="<?php 
                echo $icon_alt;
                ?>
" />
							</span>
						</td>
						<td valign="middle" align="left">
							<?php 
                if (isset($row_path->is_link) && $row_path->is_link) {
                    echo $row_path->lpath_name;
                } elseif ($is_squeezebox) {
                    $x_size = 0;
                    $y_size = 0;
                    if (isset($row_path->scorm_width)) {
                        $x_size = $row_path->scorm_width;
                        if ($x_size == 100) {
                            //settings from 1.0.6 version (means 100% width)
                            $x_size = 0;
                        }
                    }
                    if (isset($row_path->scorm_height)) {
                        $y_size = $row_path->scorm_height;
                    }
                    ?>
									<a href="<?php 
                    echo sefRelToAbs($link);
                    ?>
" class="scorm_modal" rel="{handler:'iframe', size:{x:<?php 
                    echo $x_size;
                    ?>
,y:<?php 
                    echo $y_size;
                    ?>
}}" title="<?php 
                    echo str_replace('"', '&quot;', $row_path->lpath_name);
                    ?>
">
										<?php 
                    echo $row_path->lpath_name;
                    ?>
									</a>
							<?php 
                } else {
                    ?>
									<a href="<?php 
                    echo sefRelToAbs($link);
                    ?>
" title="<?php 
                    echo str_replace('"', '&quot;', $row_path->lpath_name);
                    ?>
">
										<?php 
                    echo $row_path->lpath_name;
                    ?>
									</a>
							<?php 
                }
                ?>
							
							<?php 
                if ($JLMS_CONFIG->get('show_lpaths_authors', 0)) {
                    ?>
							<br />
							<span class="small"><?php 
                    echo _JLMS_HOME_AUTHOR . "&nbsp;" . $row_path->author_name;
                    ?>
</span>
							<?php 
                }
                ?>
						</td>
					<?php 
                if ($JLMS_ACL->CheckPermissions('lpaths', 'publish')) {
                    ?>
						<td valign="middle">
							<?php 
                    echo $publish_icon;
                    ?>
						</td>
					<?php 
                }
                ?>
					<?php 
                if ($JLMS_ACL->CheckPermissions('lpaths', 'order')) {
                    ?>
						<td valign="middle"><?php 
                    echo JLMS_orderUpIcon($i_counter, $row_path->id, true, 'lpath_orderup');
                    ?>
</td>
						<td valign="middle"><?php 
                    echo JLMS_orderDownIcon($i_counter, $n, $row_path->id, true, 'lpath_orderdown');
                    ?>
</td>
						<td colspan="2">
							<input type="text" name="order[]" size="5" value="<?php 
                    echo $row_path->ordering;
                    ?>
" class="inputbox" style="text-align: center" />
						</td>
					<?php 
                }
                ?>
					<?php 
                if ($JLMS_ACL->CheckPermissions('lpaths', 'manage')) {
                    ?>
						<td valign="middle">
						<?php 
                    if ($manage_item && ($row_path->item_id && $row_path->lp_type != 2 || !$row_path->item_id)) {
                        $download_message = _JLMS_LPATH_LINK_TITLE_DOWN_SCORM;
                        if (!$row_path->item_id) {
                            $download_message = _JLMS_LPATH_EXPORT_LP;
                        }
                        ?>
						<a class="jlms_img_link" href="<?php 
                        echo sefRelToAbs("index.php?option={$option}&amp;Itemid={$Itemid}&amp;task=download_scorm&amp;course_id={$course_id}&amp;id={$row_path->id}");
                        ?>
" title="<?php 
                        echo $download_message;
                        ?>
"><img class='JLMS_png' src="<?php 
                        echo $JLMS_CONFIG->get('live_site');
                        ?>
/components/com_joomla_lms/lms_images/toolbar/btn_export.png" border="0" width="16" height="16" alt="<?php 
                        echo $download_message;
                        ?>
" title="<?php 
                        echo $download_message;
                        ?>
" /></a>
						<?php 
                    } else {
                        echo '&nbsp;';
                    }
                    ?>
						</td>
					<?php 
                }
                ?>
					<?php 
                if (!$JLMS_ACL->CheckPermissions('lpaths', 'manage')) {
                    $r_img = 'btn_cancel';
                    $r_sta = _JLMS_LPATH_STU_LPSTATUS_NOTCOMPLETED;
                    $r_start = '-';
                    $r_end = '-';
                    if (!$row_path->item_id) {
                        if (isset($row_path->r_status) && $row_path->r_status == 1) {
                            $r_img = 'btn_accept';
                            $r_sta = _JLMS_LPATH_STU_LPSTATUS_COMPLETED;
                            if ($row_path->r_start) {
                                $r_start = JLMS_dateToDisplay($row_path->r_start, false, $JLMS_CONFIG->get('offset') * 60 * 60, '\\<\\b\\r \\/>H:i:s');
                            }
                            if ($row_path->r_end) {
                                $r_end = JLMS_dateToDisplay($row_path->r_end, false, $JLMS_CONFIG->get('offset') * 60 * 60, '\\<\\b\\r \\/>H:i:s');
                            }
                        } elseif (isset($row_path->r_status) && $row_path->r_status == 0) {
                            $r_img = 'btn_pending_cur';
                            if ($row_path->r_start) {
                                $r_start = JLMS_dateToDisplay($row_path->r_start, false, $JLMS_CONFIG->get('offset') * 60 * 60, '\\<\\b\\r \\/>H:i:s');
                            }
                        }
                    } else {
                        if (isset($row_path->s_status) && $row_path->s_status == 1) {
                            $r_img = 'btn_accept';
                            $r_sta = _JLMS_LPATH_STU_LPSTATUS_COMPLETED;
                            $r_start = '-';
                            $r_end = '-';
                        }
                        if ($row_path->lp_type == 1 || $row_path->lp_type == 2) {
                            if (isset($row_path->r_end) && $row_path->r_end) {
                                $r_end = JLMS_dateToDisplay($row_path->r_end, true, $JLMS_CONFIG->get('offset') * 60 * 60, '\\<\\b\\r \\/>H:i:s');
                            }
                            if (isset($row_path->r_start) && $row_path->r_start) {
                                $r_start = JLMS_dateToDisplay($row_path->r_start, true, $JLMS_CONFIG->get('offset') * 60 * 60, '\\<\\b\\r \\/>H:i:s');
                            }
                        }
                    }
                    ?>
						<td valign="middle" align="center" width="16">
							<?php 
                    //Show Status Lapths/Scorms //by Max - 25.02.2011
                    joomla_lms_html::ShowStatusAs($row_path);
                    ?>
	
						</td>
						<td valign="middle" align="center" nowrap="nowrap"><?php 
                    echo $r_start;
                    ?>
</td>
						<td valign="middle" align="center" nowrap="nowrap"><?php 
                    echo $r_end;
                    ?>
</td>
					<?php 
                }
                ?>
						<td valign="middle"><?php 
                echo $row_path->lpath_shortdescription ? $row_path->lpath_shortdescription : '&nbsp;';
                ?>
</td>
					</tr>
					<?php 
                $k = 3 - $k;
                $i_counter++;
            }
            ?>
				</table>
<?php 
        } else {
            echo '<div class="joomlalms_user_message">' . _JLMS_NO_ITEMS_HERE . '</div>';
        }
        if ($there_were_squeezeboxes) {
            JLMS_initialize_SqueezeBox();
        }
        ?>
				<input type="hidden" name="option" value="<?php 
        echo $option;
        ?>
" />
				<input type="hidden" name="Itemid" value="<?php 
        echo $Itemid;
        ?>
" />
				<input type="hidden" name="task" value="learnpaths" />
				<input type="hidden" name="id" value="<?php 
        echo $course_id;
        ?>
" />
				<input type="hidden" name="boxchecked" value="0" />
				<input type="hidden" name="row_id" value="0" />
				<input type="hidden" name="state" value="0" />
				<input type="hidden" name="cid2" value="0" />
			</form>
<?php 
        JLMS_TMPL::CloseTS();
        if ($JLMS_ACL->CheckPermissions('lpaths', 'manage') || $JLMS_ACL->CheckPermissions('lpaths', 'publish')) {
            $link_new = JLMSRoute::_("index.php?option=" . $option . "&amp;Itemid=" . $Itemid . "&amp;task=new_lpath&amp;id=" . $course_id);
            $link_new_scorm = JLMSRoute::_("index.php?option=" . $option . "&amp;Itemid=" . $Itemid . "&amp;task=new_lpath_scorm&amp;id=" . $course_id);
            $link_new_scormlib = JLMSRoute::_("index.php?option={$option}&amp;Itemid={$Itemid}&amp;task=new_scorm_from_library&amp;id=" . $course_id);
            $controls = array();
            if ($JLMS_ACL->CheckPermissions('lpaths', 'publish')) {
                $controls[] = array('href' => "javascript:submitbutton_change('change_lpath',1);", 'title' => _JLMS_LPATH_SET_PUB, 'img' => 'publish');
                $controls[] = array('href' => "javascript:submitbutton_change('change_lpath',0);", 'title' => _JLMS_LPATH_SET_UNPUB, 'img' => 'unpublish');
                if ($JLMS_ACL->CheckPermissions('lpaths', 'manage')) {
                    $controls[] = array('href' => 'spacer');
                }
            }
            if ($JLMS_ACL->CheckPermissions('lpaths', 'manage')) {
                $controls[] = array('href' => ampReplace($link_new), 'onclick' => "", 'title' => _JLMS_LPATH_DO_NEW_LP, 'img' => 'add_lpath');
                //TODO: translate 'Import SCORM package'
                $controls[] = array('href' => ampReplace($link_new_scorm), 'onclick' => "", 'title' => _JLMS_LPATH_IMPORT_SCORM, 'img' => 'add_scorm');
                $controls[] = array('href' => $link_new_scormlib, 'title' => _JLMS_SCORM_ADD_A_SCORM_PACKAGE_FROM_THE_LIBRARY, 'img' => 'add_library');
                $controls[] = array('href' => 'spacer');
                $controls[] = array('href' => "javascript:submitbutton('lpath_delete');", 'title' => _JLMS_LPATH_DO_DEL_LP, 'img' => 'delete');
                $controls[] = array('href' => "javascript:submitbutton('edit_lpath');", 'title' => _JLMS_LPATH_DO_EDIT_LP, 'img' => 'edit');
            }
            JLMS_TMPL::ShowControlsFooter($controls);
        }
        JLMS_TMPL::CloseMT();
    }
    function showLPathRow(&$k, $row, $i, $topic_id, $checked = null, $manage = 1, $span = 1)
    {
        global $option, $Itemid, $my, $JLMS_DB, $Itemid, $JLMS_CONFIG, $JLMS_SESSION;
        $usertype = $JLMS_CONFIG->get('current_usertype', 0);
        $course_id = intval(mosGetParam($_REQUEST, 'id', 0));
        $k = 3 - $k;
        $is_hidden = false;
        if (isset($row->item_id) && $row->item_id) {
            $tmp_params = new JLMSParameters($row->lp_params);
            if ($tmp_params->get('hide_in_list', 0) == 1) {
                $is_hidden = true;
            }
        }
        if ($usertype == 1) {
            $task = 'compose_lpath';
            $title = _JLMS_LPATH_LINK_TITLE_COMPOSE;
        } elseif ($usertype == 2) {
            $task = 'show_lpath';
            $title = _JLMS_LPATH_LINK_TITLE_VIEW;
            if ($is_hidden) {
                return 0;
            }
        }
        if (isset($row->is_hidden) && $row->is_hidden && $usertype == 2) {
            return 0;
        }
        $link = "index.php?option=" . $option . "&Itemid=" . $Itemid . "&task=" . $task . "&course_id=" . $course_id . "&id=" . $row->id;
        $icon_img = "toolbar/tlb_lpath";
        $icon_alt = "learnpath";
        if ($row->item_id) {
            $title = _JLMS_LPATH_LINK_TITLE_SCORM;
            //$link = "index.php?option=".$option."&Itemid=".$Itemid."&task=player_scorm&course_id=".$course_id."&id=".$row->item_id."&lp_type=".$row->lp_type;
            $link = "index.php?option=" . $option . "&Itemid=" . $Itemid . "&task=show_lpath&course_id=" . $course_id . "&id=" . $row->id;
            //."&lp_type=".$row->lp_type;
            $icon_img = "toolbar/tlb_scorm";
            $icon_alt = _JLMS_TOPIC_SCORM;
        }
        $title = $row->lpath_name;
        if (!$checked && $manage == 1) {
            $checked = mosHTML::idBox($topic_id * 1000 + $i, $row->link_id);
        }
        // 01.12.2007 '$i' chenged to '$topic_id*1000+$i' by DEN - to avoid dublicate id's
        $alt = $row->published ? _JLMS_LPATH_STATUS_PUB : _JLMS_LPATH_STATUS_UNPUB;
        $image = $row->published ? $is_hidden ? 'btn_publish_hidden.png' : 'btn_accept.png' : 'btn_cancel.png';
        $state = $row->published ? 0 : 1;
        ?>
		<tr class="<?php 
        echo JLMSCSS::_('sectiontableentry' . $k);
        ?>
">
			<td width='1%' valign="middle" align="center"><?php 
        if ($usertype != 2) {
            echo $i + 1;
        } else {
            echo '&nbsp;';
        }
        ?>
</td>
		<?php 
        if ($usertype == 1) {
            ?>
			<?php 
            if ($checked) {
                echo "<td width='1%'>";
                if (!isset($row->is_link)) {
                    echo $checked;
                }
                echo "</td>";
            }
            ?>
		<?php 
        }
        ?>
			<td valign="middle" align="center" width="1%">				
					<img class='JLMS_png' src="<?php 
        echo $JLMS_CONFIG->get('live_site');
        ?>
/components/com_joomla_lms/lms_images/<?php 
        echo $icon_img;
        ?>
.png" width='16' height='16' alt="<?php 
        echo $icon_alt;
        ?>
" />
			</td>
			<td valign="middle" align="left" colspan="<?php 
        echo $span;
        ?>
">
			<?php 
        if (!isset($row->is_link)) {
            $add_link_params = '';
            if (isset($row->scorm_params) && $row->scorm_params) {
                $tmp_params = new JLMSParameters($row->scorm_params);
                if ($tmp_params->get('scorm_layout', 0) == 1) {
                    $x_size = 0;
                    $y_size = 0;
                    if (isset($row->scorm_width) && $row->scorm_width > 100) {
                        $x_size = $row->scorm_width;
                    }
                    if (isset($row->scorm_height) && $row->scorm_height > 100) {
                        $y_size = $row->scorm_height;
                    }
                    $add_link_params = ' class="scorm_modal" rel="{handler:\'iframe\', size:{x:' . $x_size . ',y:' . $y_size . '}}"';
                    JLMS_initialize_SqueezeBox();
                }
            }
            ?>
				<a href="<?php 
            echo sefRelToAbs($link);
            ?>
"<?php 
            echo $add_link_params;
            ?>
 title="<?php 
            echo $title;
            ?>
">
			<?php 
        }
        ?>
	
					<?php 
        echo $row->lpath_name;
        ?>
			<?php 
        if (!isset($row->is_link)) {
            ?>
		
				</a>
			<?php 
        }
        ?>
	
			</td>
		<?php 
        if ($usertype != 2) {
            //teacher/admin table handler
            ?>
			<?php 
            if ($manage == 1) {
                ?>
	
				<td valign="middle" class="controltd"><?php 
                if ($row->allow_up == 1) {
                    echo JLMS_orderIcon_element($topic_id, $course_id, 'orderup_element', _JLMS_TOPIC_I_MOVEUP, $row->ordering);
                } else {
                    echo '&nbsp;';
                }
                ?>
</td>
				<td valign="middle" class="controltd"><?php 
                if ($row->allow_down == 1 && $manage == 1) {
                    echo JLMS_orderIcon_element($topic_id, $course_id, 'orderdown_element', _JLMS_TOPIC_I_MOVEDOWN, $row->ordering);
                } else {
                    echo '&nbsp;';
                }
                ?>
</td>
				<?php 
                $state = publishUtility($row->published, $row->show);
                ?>
				<td valign="middle" class="controltd"><?php 
                echo JLMS_showHideIcon($row->link_id, $course_id, $topic_id, $state, 'change_element', $option);
                ?>
</td>
			<?php 
            }
            ?>
			<td align="center">-</td>
			<td align="center">-</td>
		<?php 
        } else {
            //user/student table handler
            $r_img = 'btn_cancel';
            $r_sta = _JLMS_LPATH_STU_LPSTATUS_NOTCOMPLETED;
            $r_start = '-';
            $r_end = '-';
            if (!$row->item_id) {
                if (isset($row->r_status) && $row->r_status == 1) {
                    $r_img = 'btn_accept';
                    $r_sta = _JLMS_LPATH_STU_LPSTATUS_COMPLETED;
                    if ($row->r_start) {
                        $r_start = JLMS_dateToDisplay($row->r_start, false, $JLMS_CONFIG->get('offset') * 60 * 60, '\\<\\b\\r \\/>H:i:s');
                    }
                    if ($row->r_end) {
                        $r_end = JLMS_dateToDisplay($row->r_end, false, $JLMS_CONFIG->get('offset') * 60 * 60, '\\<\\b\\r \\/>H:i:s');
                    }
                } elseif (isset($row->r_status) && $row->r_status == 0) {
                    $r_img = 'btn_pending_cur';
                    if ($row->r_start) {
                        $r_start = JLMS_dateToDisplay($row->r_start, false, $JLMS_CONFIG->get('offset') * 60 * 60, '\\<\\b\\r \\/>H:i:s');
                    }
                }
            } else {
                if (isset($row->s_status) && $row->s_status == 1) {
                    $r_img = 'btn_accept';
                    $r_sta = _JLMS_LPATH_STU_LPSTATUS_COMPLETED;
                    $r_start = '-';
                    $r_end = '-';
                }
                if ($row->lp_type == 1 || $row->lp_type == 2) {
                    if (isset($row->r_end) && $row->r_end) {
                        $r_end = JLMS_dateToDisplay($row->r_end, true, $JLMS_CONFIG->get('offset') * 60 * 60, '\\<\\b\\r \\/>H:i:s');
                    }
                    if (isset($row->r_start) && $row->r_start) {
                        $r_start = JLMS_dateToDisplay($row->r_start, true, $JLMS_CONFIG->get('offset') * 60 * 60, '\\<\\b\\r \\/>H:i:s');
                    }
                }
            }
            ?>
			<td valign="middle" align="center" width="1%">
				<?php 
            //Show Status Lapths/Scorms //by Max - 25.02.2011
            joomla_lms_html::ShowStatusAs($row);
            ?>
			</td>
			<td valign="middle" align="center" nowrap="nowrap"><?php 
            echo $r_start;
            ?>
</td>
			<td valign="middle" align="center" nowrap="nowrap"><?php 
            echo $r_end;
            ?>
</td>
		<?php 
        }
        ?>
			<td><?php 
        $descr = strip_tags($row->lpath_shortdescription);
        if (strlen($descr) > 75) {
            $descr = substr($descr, 0, 75) . "...";
        }
        echo $descr ? $descr : '&nbsp;';
        ?>
			</td>
		</tr>
		<?php 
        return 1;
    }