Esempio n. 1
0
    function showMainPage_front($option, &$lists, &$my_courses, &$my_dropbox, &$my_homework, &$my_announcements, &$my_mailbox, &$my_certificates, &$latest_forum_posts)
    {
        global $Itemid, $JLMS_CONFIG;
        $JLMS_ACL =& JLMSFactory::getACL();
        ?>
		
		<table width="100%" cellpadding="0" cellspacing="3" border="0" id="jlms_mainarea" style="border-collapse: separate">
		<?php 
        if ($JLMS_CONFIG->get('lofe_show_top', true)) {
            ?>
			<tr>
				<td colspan="2" align="right"><?php 
            JLMS_showTopMenu_simple($option);
            ?>
</td>
			</tr>
		<?php 
        }
        ?>
			<tr>
				<td colspan="2" align="left">
				<?php 
        echo JLMS_ShowText_WithFeatures($lists['homepage_text']);
        ?>
<br /><br />
				</td>
			</tr>
			<?php 
        global $JLMS_DB, $my;
        if (class_exists('Jfactory')) {
            $user = JLMSFactory::getUser();
            $my->id = $user->id;
        }
        $is_ceo = $JLMS_ACL->isStaff();
        $JLMS_ACL =& JLMSFactory::getACL();
        if ($JLMS_CONFIG->get('show_statistics_reports')) {
            if ($JLMS_ACL->isTeacher()) {
                // user is a teacher - he can see reports module
            } else {
                if ($is_ceo) {
                    $JLMS_CONFIG->set('show_statistics_reports', true);
                } else {
                    $JLMS_CONFIG->set('show_statistics_reports', false);
                }
            }
        }
        $on_modules = false;
        if ($JLMS_CONFIG->get('frontpage_announcements') || $JLMS_CONFIG->get('frontpage_dropbox') || $JLMS_CONFIG->get('frontpage_homework') || $JLMS_CONFIG->get('frontpage_mailbox') || $JLMS_CONFIG->get('frontpage_certificates') || $JLMS_CONFIG->get('plugin_forum') || $JLMS_CONFIG->get('show_statistics_reports') || $JLMS_CONFIG->get('frontpage_notices_teacher')) {
            $on_modules = true;
        }
        $td_width = "100%";
        $colspan = ' colspan="2"';
        if ($on_modules) {
            $td_width = "50%";
            $colspan = '';
        }
        ?>
			<tr>
				<td width="<?php 
        echo $td_width;
        ?>
" valign="top"<?php 
        echo $colspan;
        ?>
>
					<?php 
        if ($JLMS_CONFIG->get('frontpage_courses_tree', 1) && $JLMS_CONFIG->get('frontpage_courses')) {
            joomla_lms_html::echoMyCourses_tree($option, $Itemid, $my_courses, $lists);
        } elseif ($JLMS_CONFIG->get('frontpage_courses')) {
            joomla_lms_html::echoMyCourses($option, $Itemid, $my_courses);
        } else {
            echo '&nbsp;';
        }
        echo '<br />';
        if ($JLMS_CONFIG->get('frontpage_allcourses', 1)) {
            ?>
					<table width="100%" cellpadding="0" cellspacing="0" border="0" class="<?php 
            echo JLMSCSS::_('jlmslist', 'jlms_homepage_list');
            ?>
">
						<tr><<?php 
            echo JLMSCSS::tableheadertag();
            ?>
 class="<?php 
            echo JLMSCSS::_('sectiontableheader');
            ?>
" align="center"><?php 
            echo _JLMS_HOME_COURSES_LIST;
            ?>
</<?php 
            echo JLMSCSS::tableheadertag();
            ?>
></tr>
						<tr class='<?php 
            echo JLMSCSS::_('sectiontableentry1');
            ?>
'><td><a href="<?php 
            echo sefRelToabs("index.php?option=" . $option . "&amp;Itemid=" . $Itemid . "&amp;task=courses");
            ?>
" title="<?php 
            echo _JLMS_HOME_COURSES_LIST_HREF;
            ?>
"><?php 
            echo _JLMS_HOME_COURSES_LIST_HREF;
            ?>
</a></td></tr>
					</table>
					<?php 
        }
        ?>
				</td>
				<?php 
        if ($on_modules) {
            ?>
				<td width="50%" valign="top">
				<?php 
            if ($JLMS_CONFIG->get('frontpage_announcements')) {
                joomla_lms_html::echoMyAgenda($option, $Itemid, $my_announcements);
                echo '<br />';
            }
            if ($JLMS_CONFIG->get('frontpage_dropbox')) {
                joomla_lms_html::echoMyDropBox($option, $Itemid, $my_dropbox, $lists);
                echo '<br />';
            }
            if ($JLMS_CONFIG->get('frontpage_homework')) {
                joomla_lms_html::echoMyHomeWork($option, $Itemid, $my_homework);
                echo '<br />';
            }
            if ($JLMS_CONFIG->get('frontpage_mailbox')) {
                joomla_lms_html::echoMyMailBox($option, $Itemid, $my_mailbox, $lists);
                echo '<br />';
            }
            if ($JLMS_CONFIG->get('frontpage_certificates')) {
                joomla_lms_html::echoMyCertificates($option, $Itemid, $my_certificates, $lists);
                echo '<br />';
            }
            if ($JLMS_CONFIG->get('plugin_forum') && $JLMS_CONFIG->get('frontpage_latest_forum_posts')) {
                joomla_lms_html::echoLatestForumPosts($option, $Itemid, $latest_forum_posts, $lists);
                echo '<br />';
            }
            if ($JLMS_CONFIG->get('show_statistics_reports')) {
                joomla_lms_html::echoMyReports($option, $Itemid);
                echo '<br />';
            }
            if ($JLMS_CONFIG->get('frontpage_notices_teacher')) {
                joomla_lms_html::echoMyNotices($option, $Itemid, $lists['my_notices']);
            }
            ?>
				</td>
				<?php 
        }
        ?>
			</tr>
		</table>
	<?php 
    }