function showCEO_page($option, &$lists, &$rows) { global $Itemid, $JLMS_CONFIG; ?> <table width="100%" cellpadding="0" cellspacing="3" border="0" class="jlms_table_no_borders"> <tr> <td align="right"><?php JLMS_showTopMenu_simple($option); ?> </td> </tr> <tr> <td> <table width="100%" cellpadding="0" cellspacing="0" border="0" class="<?php echo JLMSCSS::_('jlmslist'); ?> "> <tr> <<?php echo JLMSCSS::tableheadertag(); ?> class="<?php echo JLMSCSS::_('sectiontableheader'); ?> " width="16"> </<?php echo JLMSCSS::tableheadertag(); ?> > <<?php echo JLMSCSS::tableheadertag(); ?> class="<?php echo JLMSCSS::_('sectiontableheader'); ?> " width="16"> </<?php echo JLMSCSS::tableheadertag(); ?> > <<?php echo JLMSCSS::tableheadertag(); ?> class="<?php echo JLMSCSS::_('sectiontableheader'); ?> "><?php echo _JLMS_CEO_PAGE_LEARNER_COURSE_TITLE; ?> </<?php echo JLMSCSS::tableheadertag(); ?> > </tr> <?php $user_id = 0; $is_open = false; $i = 0; $k = 1; foreach ($rows as $row) { if ($row->user_id != $user_id) { echo '<tr class="' . $JLMS_CONFIG->get('visual_set_main_row_class', 'sectiotableentry' . $k) . '"><td colspan="3">' . $row->username . ', ' . $row->name . ' (' . $row->email . ')' . "</td></tr>\n"; $k = 3 - $k; $user_id = $row->user_id; } if ($row->course_id) { $sub_index = 2; if (isset($rows[$i + 1]) && $rows[$i + 1]->user_id == $row->user_id) { $sub_index = 1; } $completion_image = 'spacer'; if (isset($row->course_completion)) { if ($row->course_completion == 1) { $completion_image = 'toolbar/btn_accept'; } elseif ($row->course_completion == 2) { $completion_image = 'toolbar/btn_certificate'; } } echo '<tr class="' . $JLMS_CONFIG->get('visual_set_child_row_class', 'sectiotableentry' . $k) . '">'; echo '<td><img src="' . $JLMS_CONFIG->get('live_site') . '/components/com_joomla_lms/lms_images/treeview/sub' . $sub_index . '.png" width="16" height="16" border="0" alt="sub" /></td>'; echo '<td><img src="' . $JLMS_CONFIG->get('live_site') . '/components/com_joomla_lms/lms_images/' . $completion_image . '.png" width="16" height="16" border="0" alt="sub" /></td>'; echo '<td><a href="' . sefRelToAbs("index.php?option={$option}&Itemid={$Itemid}&task=enter_ceo&course_id={$row->course_id}") . '">' . $row->course_name . '</a></td></tr>'; $k = 3 - $k; } $i++; } ?> </table> </td> </tr> </table> <?php }
function showStepConditions($course_id, $lpath_id, $step_id, $option, &$conds, &$lists, $step_name) { global $Itemid, $JLMS_CONFIG; ?> <script language="javascript" type="text/javascript"> <!-- function submitbutton_del(pressbutton) { var form = document.adminForm; if (form.boxchecked.value == '0') { alert('<?php echo _JLMS_ALERT_SELECT_ITEM; ?> '); } else { form.task.value = pressbutton; form.submit(); } } function submitbutton_add(pressbutton) { var form = document.newcondForm; form.task.value = pressbutton; form.submit(); } //--> </script> <?php JLMS_TMPL::OpenMT(); $hparams = array(); $toolbar = array(); $toolbar[] = array('btn_type' => 'back', 'btn_js' => sefRelToAbs("index.php?option={$option}&Itemid={$Itemid}&task=compose_lpath&course_id={$course_id}&id={$lpath_id}")); JLMS_TMPL::ShowHeader('lpath', '', $hparams, $toolbar); JLMS_TMPL::OpenTS(); echo JLMSCSS::h2(_JLMS_LPATH_TITLE_CONDITIONS . $step_name); ?> <form action="<?php echo sefRelToAbs("index.php?option=" . $option . "&Itemid=" . $Itemid); ?> " method="post" name="adminForm"> <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 echo JLMSCSS::tableheadertag(); ?> width="20" class="<?php echo JLMSCSS::_('sectiontableheader'); ?> "> </<?php echo JLMSCSS::tableheadertag(); ?> > <<?php echo JLMSCSS::tableheadertag(); ?> class="<?php echo JLMSCSS::_('sectiontableheader'); ?> "> </<?php echo JLMSCSS::tableheadertag(); ?> > <<?php echo JLMSCSS::tableheadertag(); ?> class="<?php echo JLMSCSS::_('sectiontableheader'); ?> "><?php echo _JLMS_LPATH_COND_REF_STEP; ?> </<?php echo JLMSCSS::tableheadertag(); ?> > </tr> <?php $k = 1; for ($i = 0, $n = count($conds); $i < $n; $i++) { $row_cond = $conds[$i]; $checked = mosHTML::idBox($i, $row_cond->id); ?> <tr id="tree_row_<?php echo $row_cond->id; ?> " class="<?php echo JLMSCSS::_('sectiontableentry' . $k); ?> "> <td align="center" valign="middle"><?php echo $i + 1; ?> </td> <td valign="middle"><?php echo $checked; ?> </td> <td valign="middle"><?php echo _JLMS_LPATH_CONDTYPE_COMPLETE; ?> </td> <td valign="middle" style="vertical-align:middle "> <?php if (isset($row_cond->cond_time) && $row_cond->cond_time) { $row_cond->ref_step_name .= ' (' . _JLMS_LPATH_CONDTYPE_SPENT . ' ' . $row_cond->cond_time . ' ' . _JLMS_LPATH_CONDTYPE_TIME_SPENT_MIN . ')'; } echo $row_cond->ref_step_name; ?> </td> </tr> <?php $k = 3 - $k; } ?> </table> <input type="hidden" name="option" value="<?php echo $option; ?> " /> <input type="hidden" name="Itemid" value="<?php echo $Itemid; ?> " /> <input type="hidden" name="task" value="lpath_item_delete" /> <input type="hidden" name="id" value="<?php echo $step_id; ?> " /> <input type="hidden" name="step_id" value="<?php echo $step_id; ?> " /> <input type="hidden" name="lpath_id" value="<?php echo $lpath_id; ?> " /> <input type="hidden" name="course_id" value="<?php echo $course_id; ?> " /> <input type="hidden" name="boxchecked" value="0" /> </form> <form action="<?php echo sefRelToAbs("index.php?option=" . $option . "&Itemid=" . $Itemid); ?> " method="post" name="newcondForm"> <?php echo '<table cellpadding="0" cellspacing="0" border="0" width="100%" class="jlms_table_no_borders">'; $controls = array(); $controls[] = array('href' => "javascript:submitbutton_del('lpath_cond_delete');", 'title' => _JLMS_LPATH_LINK_DEL_COND, 'img' => 'buttons_22/btn_delete_22.png'); $controls[] = array('href' => "javascript:submitbutton_add('lpath_save_cond');", 'title' => _JLMS_LPATH_LINK_NEW_COND, 'img' => 'buttons_22/btn_add_22.png'); $custom = _JLMS_LPATH_CONDTYPE_COMPLETE . ' ' . $lists['lpath_steps']; if ($JLMS_CONFIG->get('enable_timetracking')) { $custom .= ' ' . _JLMS_LPATH_CONDTYPE_AND_SPENT . ': <input type="text" name="cond_time" value="" size="5" class="inputbox" style="text-align: center;" /> <small>min</small>'; } $controls[] = array('href' => '', 'title' => '', 'img' => '', 'custom' => $custom); JLMS_TMPL::ShowControlsFooter($controls, '', false, true); echo '</table>'; /* <table width="100%" cellpadding="0" cellspacing="0" border="0"> <tr> <td> <table width="100%" cellpadding="0" cellspacing="0" border="0"><tr> <td align="center" valign="middle" width="16"><a href="javascript:submitbutton_del('lpath_cond_delete');" title="<?php echo _JLMS_LPATH_LINK_DEL_COND;?>"><img class="JLMS_png" src="<?php echo $JLMS_CONFIG->get('live_site');?>/components/com_joomla_lms/lms_images/toolbar/btn_remove.png" width="16" height="16" border="0" alt="<?php echo _JLMS_LPATH_LINK_DEL_COND;?>" title="<?php echo _JLMS_LPATH_LINK_DEL_COND;?>" /></a></td> <td align="center" valign="middle" width="16"><a href="javascript:submitbutton_add('lpath_save_cond');" title="<?php echo _JLMS_LPATH_LINK_NEW_COND;?>"><img class="JLMS_png" src="<?php echo $JLMS_CONFIG->get('live_site');?>/components/com_joomla_lms/lms_images/toolbar/btn_add.png" width="16" height="16" border="0" alt="<?php echo _JLMS_LPATH_LINK_NEW_COND;?>" title="<?php echo _JLMS_LPATH_LINK_NEW_COND;?>" /></a></td> <td align="left" valign="middle"> <?php echo _JLMS_LPATH_CONDTYPE_COMPLETE. " " . $lists['lpath_steps']; ?> <?php echo _JLMS_LPATH_CONDTYPE_AND_SPENT;?>: <input type="text" name="cond_time" value="" size="5" class="inputbox" style="text-align: center;" /> <small>min</small> </td> </tr></table> </td> </tr> </table> */ ?> <input type="hidden" name="option" value="<?php echo $option; ?> " /> <input type="hidden" name="Itemid" value="<?php echo $Itemid; ?> " /> <input type="hidden" name="task" value="lpath_save_cond" /> <input type="hidden" name="id" value="<?php echo $step_id; ?> " /> <input type="hidden" name="step_id" value="<?php echo $step_id; ?> " /> <input type="hidden" name="lpath_id" value="<?php echo $lpath_id; ?> " /> <input type="hidden" name="course_id" value="<?php echo $course_id; ?> " /> </form> <?php JLMS_TMPL::CloseTS(); JLMS_TMPL::CloseMT(); }
function JLMS_free_subscriptions($option, $course_info, $course_id, $multi_sub = false) { /*if ($multi_sub) { $course_info = $course_info[0]; }*/ global $Itemid, $JLMS_CONFIG, $my; ?> <script language="javascript" type="text/javascript"> <!-- function jlms_submitbutton(pressbutton) { var form = document.JLMS_adminForm; <?php if ($JLMS_CONFIG->get('enableterms')) { ?> if( (pressbutton == 'course_subscribe') && (document.getElementById('agreement').checked == false) ){ alert( "<?php echo addslashes(_JLMS_AGREEMENT); ?> " ); } else{ form.task.value = pressbutton; form.submit(); } <?php } else { ?> form.task.value = pressbutton; form.submit(); <?php } ?> } //--> </script> <?php JLMS_TMPL::OpenMT(); $params = array('show_menu' => true, 'simple_menu' => true); JLMS_TMPL::ShowHeader('subscription', _JLMS_HEAD_SUBSCRIPTION_STR, $params); JLMS_TMPL::OpenTS('', ' align="right" style="text-align:right " width="100%"'); //echo "Sub name: "."<input type='text' class='inputbox' name='sub_name' />"." "; JLMS_TMPL::CloseTS(); JLMS_TMPL::CloseMT(); ?> <form action="<?php echo sefRelToAbs("index.php?option={$option}&Itemid={$Itemid}"); ?> " method="post" name="JLMS_adminForm"> <table width="100%" cellpadding="0" cellspacing="0" border="0" class="jlms_table_no_borders"> <tr> <td colspan="2"> <table width="100%" cellpadding="0" cellspacing="0" border="0" class="<?php echo JLMSCSS::_('jlmslist'); ?> "> <tr> <<?php echo JLMSCSS::tableheadertag(); ?> class="<?php echo JLMSCSS::_('sectiontableheader'); ?> " align="left" width="200"><?php echo _JLMS_SUBSCRIBE_COURSE_NAME; ?> </<?php echo JLMSCSS::tableheadertag(); ?> > <<?php echo JLMSCSS::tableheadertag(); ?> class="<?php echo JLMSCSS::_('sectiontableheader'); ?> " align="left" width="70" ><?php echo _JLMS_COURSES_FEE_TYPE; ?> </<?php echo JLMSCSS::tableheadertag(); ?> > </tr> <?php if ($multi_sub) { $k = 1; foreach ($course_info as $course_info1) { ?> <tr class="<?php echo JLMSCSS::_('sectiontableentry' . $k); ?> "> <td align="left" valign="middle"><?php echo $course_info1->course_name; ?> </td> <td align="left" valign="middle"><?php echo _JLMS_COURSES_FREE; ?> </td> </tr> <?php $k = 3 - $k; } } else { ?> <tr class="<?php echo JLMSCSS::_('sectiontableentry1'); ?> "> <td align="left" valign="middle"><?php echo $course_info->course_name; ?> </td> <td align="left" valign="middle"><?php echo _JLMS_COURSES_FREE; ?> </td> </tr> <?php } ?> </table> </td> </tr> <?php if ($JLMS_CONFIG->get('enableterms')) { if ($my->id) { echo "<tr><td colspan='2'><table align='center' class='jlms_table_no_borders'><tr><td width='20'>\n\t\t\t\t\t\t\t<input type='checkbox' name='agreement' id='agreement' />\n\t\t\t\t\t\t</td><td style='text-align:left'>\n\t\t\t\t\t\t\t<label for='agreement'>" . $JLMS_CONFIG->get('jlms_terms') . "</label>\n\t\t\t\t\t\t</td></tr></table></td></tr>"; } else { /* echo "<tr><td colspan='2'><br /><table align='center'><tr><td width='20'> <input type='checkbox' name='agreement' id='agreement' disabled='disabled' /> </td><td style='text-align:left'> <label for='agreement'>" . $JLMS_CONFIG->get('jlms_terms')."</label> </td></tr></table></td></tr>";*/ } /* ?> <tr> <td class="sectiontableheader">Terms and conditions</td> </tr> <tr> <td> <?php echo "<input type='checkbox' name='agreement' id='agreement' />"; echo $JLMS_CONFIG->get('jlms_terms'); ?> </td> </tr> <?php */ } ?> <tr> <td colspan="2" align="center"> <?php $toolbar = array(); if ($my->id) { $toolbar[] = array('btn_type' => 'yes', 'btn_str' => _JLMS_SUBSCRIBE, 'btn_js' => "javascript:jlms_submitbutton('course_subscribe','');"); echo JLMS_ShowToolbar($toolbar, true, 'center'); } else { //$toolbar[] = array('btn_type' => 'yes', 'btn_str' => _JLMS_SUBSCRIBE, 'btn_js' => "javascript:void(0);"); //echo JLMS_ShowToolbar($toolbar, true, 'center'); } ?> <noscript> <div class="joomlalms_sys_message"> <?php echo _JLMS_JS_COOKIES_REQUIRES; ?> </div> </noscript> </td> </tr> </table> <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="id" value="<?php echo $course_id; ?> " /> <input type="hidden" name="state" value="0" /> </form> <?php if (!$my->id) { JLMS_UserSessions_html::loginPanel($course_id, 'subs'); } }
function JLMS_sreportGradeFV($option, &$rows, &$pageNav, &$lists, $levels, $filt_group, $filt_cat, $user_id, $is_full) { $JLMS_CONFIG =& JLMSFactory::getConfig(); $Itemid = $JLMS_CONFIG->get('Itemid'); //FLMS multicat $multicat = array(); if ($JLMS_CONFIG->get('multicat_use', 0)) { $multicat = array(); $i = 0; foreach ($lists as $key => $item) { if (substr($key, 0, 7) == 'filter_') { $multicat[] = $lists['filter_' . $i]; $i++; } } } JLMS_TMPL::OpenMT(); $lists['user_id'] = isset($lists['user_id']) ? $lists['user_id'] : 0; if ($is_full) { $hparams = array('show_menu' => false); } else { $hparams = array('simple_menu' => true); } $toolbar = array(); $page_heading = _JLMS_REPORTS_USER . ' ' . date("Y-m-d H:i:s"); if ($JLMS_CONFIG->get('is_trial', false) && $JLMS_CONFIG->get('trial_reports_heading_text', '')) { $page_heading = _JLMS_REPORTS_USER . $JLMS_CONFIG->get('trial_reports_heading_text', ''); } JLMS_TMPL::ShowHeader('tracking', $page_heading, $hparams, $toolbar); JLMS_TMPL::OpenTS(); ?> <script language="javascript" type="text/javascript"> <!--//--><![CDATA[//><!-- var old_filters = new Array(); function read_filter(){ var form = document.adminForm; var count_levels = '<?php echo count($levels); ?> '; for(var i=0;i<parseInt(count_levels);i++){ if(form['filter_id_'+i] != null){ old_filters[i] = form['filter_id_'+i].value; } } } function write_filter(){ var form = document.adminForm; var count_levels = '<?php echo count($levels); ?> '; var j; for(var i=0;i<parseInt(count_levels);i++){ if(form['filter_id_'+i+''] != null && form['filter_id_'+i+''].value != old_filters[i]){ j = i; } if(i > j){ if(form['filter_id_'+i] != null){ form['filter_id_'+i].value = 0; } } } } function submitFormView(){ var form = document.adminForm; // form.view.value = view; form.task.value='report_grade'; form.submit(); } //--><!]]> </script> <?php $action_url = $is_full ? $JLMS_CONFIG->get('live_site') . "/index.php?tmpl=component&option={$option}&Itemid={$Itemid}" : sefRelToAbs("index.php?option={$option}&Itemid={$Itemid}"); ?> <form action="<?php echo $action_url; ?> " method="post" name="adminForm"> <table cellpadding="0" cellspacing="0" border="0" id="TheTable" <?php echo $is_full ? "" : 'width="100%"'; ?> class="jlms_table_no_borders"> <?php if (!$is_full) { ?> <tr> <td align="<?php echo $is_full ? "left" : "right"; ?> " <?php echo !$is_full ? 'colspan="2"' : ''; ?> > <table <?php echo $is_full ? '' : 'width="30%"'; ?> class="jlms_table_no_borders"> <tr> <td valign="top" <?php echo $is_full ? 'width="400"' : 'width="40%"'; ?> > <table width="100%" border="0" class="jlms_table_no_borders"> <tr> <td <?php echo $is_full ? 'width="100"' : 'width="20%"'; ?> nowrap="nowrap"> Report Type: </td> <td> <?php echo JLMS_switchType($option); ?> </td> </tr> </table> </td> </tr> </table> </td> </tr> <?php } ?> <tr> <td align="left"> <table <?php echo $is_full ? '' : 'width="100%"'; ?> class="jlms_table_no_borders"> <tr> <td valign="top" <?php echo $is_full ? 'width="400"' : 'width="40%"'; ?> > <table width="100%" border="0" class="jlms_table_no_borders"> <?php if ($is_full) { ?> <tr> <td <?php echo $is_full ? 'width="100"' : 'width="20%"'; ?> nowrap="nowrap"> Report Type: </td> <td> <?php echo JLMS_switchType($option); ?> </td> </tr> <?php } ?> <tr> <td <?php echo $is_full ? 'width="100"' : 'width="20%"'; ?> nowrap="nowrap"> <?php if ($JLMS_CONFIG->get('multicat_use', 0)) { echo isset($levels[0]->cat_name) && $levels[0]->cat_name != '' ? $levels[0]->cat_name : _JLMS_COURSES_COURSES_GROUPS; } else { echo _JLMS_COURSES_COURSES_GROUPS; } ?> </td> <td> <?php if ($JLMS_CONFIG->get('multicat_use', 0)) { echo $lists['filter_0']; } else { echo $lists['jlms_course_cats']; } ?> </td> </tr> <?php if (count($multicat)) { for ($i = 0; $i < count($multicat); $i++) { if ($i > 0) { ?> <tr> <td <?php echo $is_full ? 'width="100"' : 'width="20%"'; ?> nowrap="nowrap"> <?php echo isset($levels[$i]->cat_name) && $levels[$i]->cat_name != '' ? $levels[$i]->cat_name : _JLMS_COURSES_COURSES_GROUPS; ?> </td> <td> <?php echo $lists['filter_' . $i]; ?> </td> </tr> <?php } } } ?> </table> </td> <td valign="top" <?php echo $is_full ? 'width="400"' : 'width="40%"'; ?> > <table width="100%" border="0" class="jlms_table_no_borders"> <?php if ($is_full) { ?> <tr> <td colspan="2"> </td> </tr> <?php } if ($JLMS_CONFIG->get('use_global_groups', 1)) { ?> <tr> <td <?php echo $is_full ? 'width="100"' : 'width="20%"'; ?> nowrap="nowrap" style="padding-left: 5px;"> <?php echo _JLMS_USER_GROUP_INFO; ?> </td> <td> <?php echo $lists['filter']; ?> </td> </tr> <?php } ?> <tr> <td <?php echo $is_full ? 'width="100"' : 'width="20%"'; ?> nowrap="nowrap" style="padding-left: 5px;"> <?php echo _JLMS_USERS_TBL_HEAD_USERNAME . ':'; ?> </td> <td> <?php echo $lists['jlms_filt_user']; ?> </td> </tr> </table> </td> <?php if (!$is_full) { ?> <td style="padding-left:15px;" align="right"> <?php $link = $JLMS_CONFIG->get('live_site') . "/index.php?tmpl=component&option=" . $option . "&Itemid={$Itemid}&task=report_grade&is_full=1"; if ($filt_group) { $link .= "&filt_group=" . $filt_group; } if ($user_id) { $link .= "&filt_user="******"<?php echo $link; ?> " target="_blank" title="<?php echo _JLMS_FULL_VIEW_BUTTON; ?> "><?php echo _JLMS_FULL_VIEW_BUTTON; ?> </a> </td> <?php } ?> </tr> </table> </td> </tr> </table> <?php $max_row = 0; for ($i = 0, $n = count($rows); $i < $n; $i++) { $latest_max_row = 0; $sc_rows = array(); if (count($lists['sc_rows'][$i])) { $j = 0; foreach ($lists['sc_rows'][$i] as $sc_row) { if ($sc_row->show_in_gradebook) { $sc_rows[$j] = $sc_row; $j++; } } } $latest_max_row = $latest_max_row + count($sc_rows); $latest_max_row = $latest_max_row + count($lists['quiz_rows'][$i]); $latest_max_row = $latest_max_row + count($lists['gb_rows'][$i]); if ($latest_max_row > $max_row) { $max_row = $latest_max_row; } } ?> <table cellpadding="0" cellspacing="0" border="0" width="100%" class="<?php echo JLMSCSS::_('jlmslist'); ?> "> <?php for ($i = 0, $n = count($rows); $i < $n; $i++) { $row = $rows[$i]; ?> <tr style="border: 0px none;"> <td colspan="<?php echo $max_row + 1; ?> " style="border: 0px none;"> <br /> <?php echo JLMSCSS::h2($row->course_name); ?> <span class="small"><?php echo _JLMS_REPORTS_ACCESSED_TIMES . " " . $lists['hits'][$i]; ?> </span> </td> </tr> <tr class="jlms_report_fullview_row"> <<?php echo JLMSCSS::tableheadertag(); ?> class="<?php echo JLMSCSS::_('sectiontableheader', 'first_td'); ?> " style="text-align:center; white-space:nowrap"><?php echo _JLMS_REPORTS_CONCLUSION_ROW; ?> </<?php echo JLMSCSS::tableheadertag(); ?> > <?php $sc_num = 0; $i_row = 0; foreach ($lists['sc_rows'][$i] as $sc_row) { if ($sc_row->show_in_gradebook) { $sc_num++; echo '<' . JLMSCSS::tableheadertag() . ' align=\'center\' nowrap=\'nowrap\' class="' . JLMSCSS::_('sectiontableheader') . '" style="text-align:center; white-space:nowrap">' . JLMS_reports_html::Echo_tbl_header($sc_row->lpath_name) . '</' . JLMSCSS::tableheadertag() . '>'; $i_row++; } } foreach ($lists['quiz_rows'][$i] as $quiz_row) { echo '<' . JLMSCSS::tableheadertag() . ' align=\'center\' nowrap=\'nowrap\' class="' . JLMSCSS::_('sectiontableheader') . '" style="text-align:center; white-space:nowrap">' . JLMS_reports_html::Echo_tbl_header($quiz_row->c_title) . '</' . JLMSCSS::tableheadertag() . '>'; $i_row++; } foreach ($lists['gb_rows'][$i] as $gb_row) { echo '<' . JLMSCSS::tableheadertag() . ' align=\'center\' nowrap=\'nowrap\' class="' . JLMSCSS::_('sectiontableheader') . '" style="text-align:center; white-space:nowrap">' . JLMS_reports_html::Echo_tbl_header($gb_row->gbi_name) . '</' . JLMSCSS::tableheadertag() . '>'; $i_row++; } if ($i_row < $max_row) { for ($jj = $i_row; $jj < $max_row; $jj++) { echo '<' . JLMSCSS::tableheadertag() . ' align=\'center\' nowrap=\'nowrap\' class="' . JLMSCSS::_('sectiontableheader') . '" style="text-align:center; white-space:nowrap"> <!--x--></' . JLMSCSS::tableheadertag() . '>'; } } ?> </tr> <?php $k = 1; ?> <tr class="<?php echo JLMSCSS::_('sectiontableentry' . $k, 'jlms_report_fullview_row_bottom'); ?> "> <td align="center" valign="middle" style=" text-align:center; vertical-align:middle" class="first_td"> <?php $image = $row->user_certificate ? 'btn_accept.png' : 'btn_cancel.png'; $alt = ''; $state = $row->user_certificate ? 0 : 1; echo JLMS_reports_html::publishIcon($row->user_id, 0, $state, 'gb_crt', $alt, $image, $option); ?> </td> <?php $sc_num2 = 0; foreach ($lists['sc_rows'][$i] as $sc_row) { if ($sc_row->show_in_gradebook) { $j = 0; while ($j < count($row->scorm_info)) { if ($row->scorm_info[$j]->gbi_id == $sc_row->item_id) { if ($sc_num2 < $sc_num) { if ($row->scorm_info[$j]->user_status == -1) { echo '<td align=\'center\' style="text-align:center">-</td>'; } else { $image = $row->scorm_info[$j]->user_status ? 'btn_accept.png' : 'btn_cancel.png'; $alt = $row->scorm_info[$j]->user_status ? 'btn_accept' : 'btn_cancel'; $alt .= '" align="top'; $img = JLMS_reports_html::publishIcon(0, 0, 0, '', $alt, $image, $option, false); echo '<td style="vertical-align:middle; text-align:center" nowrap="nowrap">' . $img . ' <strong>' . $row->scorm_info[$j]->user_grade . "</strong> (" . $row->scorm_info[$j]->user_pts . ")" . '</td>'; } $sc_num2++; } } $j++; } } } foreach ($lists['quiz_rows'][$i] as $quiz_row) { $j = 0; while ($j < count($row->quiz_info)) { if ($row->quiz_info[$j]->gbi_id == $quiz_row->c_id) { if ($row->quiz_info[$j]->user_status == -1) { echo '<td align=\'center\' style="text-align:center">-</td>'; } else { // $image = $row->quiz_info[$j]->user_status ? 'btn_accept.png' : 'btn_cancel.png'; // $alt = $row->quiz_info[$j]->user_status ? 'btn_accept' : 'btn_cancel'; // $alt .= '" align="top'; // $img = JLMS_reports_html::publishIcon(0, 0, 0, '', $alt, $image, $option, false ); // // echo '<td style="vertical-align:middle; text-align:center" nowrap="nowrap">'.$img // . ' <strong>' . $row->quiz_info[$j]->user_grade . "</strong> (" . $row->quiz_info[$j]->user_pts_full .")" // . '</td>'; echo '<td style="vertical-align:middle; text-align:center" nowrap="nowrap">'; echo JLMS_showQuizStatus($row->quiz_info[$j], 50); echo '</td>'; } } $j++; } } $j = 0; while ($j < count($row->grade_info)) { echo '<td align=\'center\' valign="middle" style="vertical-align:middle;text-align:center "><strong>' . $row->grade_info[$j]->user_grade . '</strong></td>'; $j++; } if ($i_row < $max_row) { for ($jj = $i_row; $jj < $max_row; $jj++) { echo '<td align=\'center\' style="text-align:center;"> <!--x--></td>'; } } ?> </tr> <?php $k = 3 - $k; } ?> </table> <?php if (!$lists['user_id']) { echo '<div class="joomlalms_page_tip" style="text-align:center">' . _JLMS_REPORTS_SELECT_USER . '</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="report_grade" /> <input type="hidden" name="state" value="0" /> <input type="hidden" name="view" value="" /> <input type="hidden" name="boxchecked" value="0" /> <input type="hidden" name="is_full" value="<?php echo $is_full; ?> " /> </form> <?php JLMS_TMPL::CloseTS(); JLMS_TMPL::CloseMT(); }
function showpageTracking($id, $option, &$rows, &$lists) { $JLMS_CONFIG =& JLMSFactory::getConfig(); $JLMS_SESSION =& JLMSFactory::getSession(); $Itemid = $JLMS_CONFIG->get('Itemid'); global $my; JLMS_TMPL::OpenMT(); $hparams = array(); $page_13_stats_shown = false; $page_12_stats_shown = false; $page_14_stats_shown = false; if ($lists['page'] == 12) { $hparams['second_tb_header'] = _JLMS_TRACKING_DOCUMENTS_STATISTICS; } elseif ($lists['page'] == 13) { $hparams['second_tb_header'] = _JLMS_TRACKING_LPATHS_STATISTICS; } elseif ($lists['page'] == 14) { $hparams['second_tb_header'] = _JLMS_TRACKING_LATEST_COURSE_ACTIVITIES_REPORT; } else { $hparams['second_tb_header'] = _JLMS_TRACK_TITLE_ACCESS . JLMS_TRACKING_getTitle($lists['page']); } $toolbar = array(); $toolbar[] = array('btn_type' => 'back', 'btn_js' => sefRelToAbs("index.php?option={$option}&Itemid={$Itemid}&task=tracking&id={$id}")); JLMS_TMPL::ShowHeader('tracking', _JLMS_TRACK_TITLE, $hparams, $toolbar); JLMS_TMPL::OpenTS(); ?> <form action="<?php echo sefRelToAbs("index.php?option={$option}&Itemid={$Itemid}"); ?> " method="post" name="adminForm"> <table width="100%" cellpadding="0" cellspacing="0" border="0" class="jlms_table_no_borders"> <tr> <td align="right" style="text-align:right "> <div align="right" style="white-space:nowrap "> <?php if ($lists['page'] == 12 || $lists['page'] == 13 || $lists['page'] == 14) { //only group and user filters if (isset($lists['filter_lpath']) && $lists['page'] == 13) { echo $lists['filter_lpath'] . '<br />'; } if (isset($lists['filter2'])) { echo $lists['filter2'] . '<br />'; } if (isset($lists['filter3'])) { echo $lists['filter3'] . '<br />'; } echo $lists['filter_stu'] . '<br />'; } else { echo $lists['filter_pages'] . $lists['filter'] . $lists['filter_month'] . $lists['filter_day']; ?> <br /> <?php /*if(isset($lists['filter_lpath'])){ echo $lists['filter_lpath'].'<br />'; }*/ if (isset($lists['filter2'])) { echo $lists['filter2'] . '<br />'; } if (isset($lists['filter3'])) { echo $lists['filter3'] . '<br />'; } echo $lists['filter_stu'] . '<br />'; } ?> </div> </td> </tr> </table> <?php if ($lists['page'] == 12 || $lists['page'] == 13 || $lists['page'] == 14) { //do nothing } else { //show hits statistics ?> <?php $link = "index.php?option={$option}&Itemid={$Itemid}&task=tracking&id={$id}"; ?> <table width="100%" cellpadding="0" cellspacing="0" border="0" class="<?php echo JLMSCSS::_('jlmslist'); ?> "> <tr> <<?php echo JLMSCSS::tableheadertag(); ?> class="<?php echo JLMSCSS::_('sectiontableheader'); ?> "><?php echo _JLMS_TRACK_TBL_H_STU; ?> </<?php echo JLMSCSS::tableheadertag(); ?> > <?php $rr = array(); if ($lists['is_day']) { foreach ($lists['months'] as $ma) { echo '<' . JLMSCSS::tableheadertag() . ' class="' . JLMSCSS::_('sectiontableheader') . '" align="center">' . JLMS_dateToDisplay(mktime(0, 0, 0, $ma->month, $ma->day, $ma->year), true) . '</' . JLMSCSS::tableheadertag() . '>'; $rr[] = $ma->month; } } else { foreach ($lists['months'] as $ma) { echo '<' . JLMSCSS::tableheadertag() . ' class="' . JLMSCSS::_('sectiontableheader') . '" align="center">' . month_lang(strftime('%m', mktime(0, 0, 0, $ma->month + 1, 0, 0)), 0, 2) . ', ' . $ma->year . '</' . JLMSCSS::tableheadertag() . '>'; $rr[] = $ma->month; } } ?> </tr> <?php $k = 1; $i = 0; $total_counts = array(); for ($j = 0; $j < count($lists['months']); $j++) { $total_counts[$j] = 0; } while ($i < count($rows)) { $row = $rows[$i]; $link = ''; $link = "index.php?option={$option}&Itemid={$Itemid}&task=tracking&id={$id}&filter_stu=" . $row->user_id . "&page=" . $lists['page']; ?> <tr class="<?php echo JLMSCSS::_('sectiontableentry' . $k); ?> "> <td align="left" valign="middle" style="vertical-align:middle "> <a href="<?php echo sefRelToAbs($link); ?> " title="<?php echo _JLMS_VIEW_DETAILS; ?> "> <?php echo $row->username; ?> </a> </td> <?php #$j = $lists['month']-1; $e = 0; $user = $rows[$i]->user_id; #$month = $rows[$i]->month; #$year = $rows[$i]->year; do { if ($lists['is_day']) { while (($lists['months'][$e]->day != $rows[$i]->day || $lists['months'][$e]->month != $rows[$i]->month || $lists['months'][$e]->year != $rows[$i]->year) && $e < count($lists['months'])) { echo '<td align="center">0</td>'; $e++; } if ($rows[$i]->user_id == $user && $rows[$i]->day == $lists['months'][$e]->day && $rows[$i]->month == $lists['months'][$e]->month && $rows[$i]->year == $lists['months'][$e]->year) { echo '<td align="center">' . $rows[$i]->count_hits . '</td>'; $total_counts[$e] = $total_counts[$e] + $rows[$i]->count_hits; } } else { while (($lists['months'][$e]->month != $rows[$i]->month || $lists['months'][$e]->year != $rows[$i]->year) && $e < count($lists['months'])) { echo '<td align="center">0</td>'; $e++; } if ($rows[$i]->user_id == $user && $rows[$i]->month == $lists['months'][$e]->month && $rows[$i]->year == $lists['months'][$e]->year) { echo '<td align="center">' . $rows[$i]->count_hits . '</td>'; $total_counts[$e] = $total_counts[$e] + $rows[$i]->count_hits; } } #$j ++; $e++; $i++; } while ($i < count($rows) && $rows[$i]->user_id == $user); while ($e < count($lists['months'])) { echo '<td align="center">0</td>'; $e++; } if (isset($rows[$i]->user_id) && $rows[$i]->user_id != $user) { $i--; } ?> </tr> <?php $k = 3 - $k; $i++; } ?> <tr class="<?php echo JLMSCSS::_('sectiontableentry' . $k); ?> "> <td align="left" valign="middle" style="vertical-align:middle "><?php echo _JLMS_TOTAL; ?> </td> <?php for ($j = 0; $j < count($lists['months']); $j++) { echo '<td align="center"><strong>' . $total_counts[$j] . '</strong></td>'; } ?> </tr> </table> <br /><br /> <?php } ?> <?php if ($lists['page'] == 14 && isset($lists['page14_stats']) && !empty($lists['page14_stats'])) { $page_14_stats_shown = true; ?> <script type="text/javascript"> function submitbutton(pressbutton){ var form = document.adminForm; form.view.value = pressbutton; form.submit(); } </script> <table width="100%" cellpadding="0" cellspacing="0" border="0" class="<?php echo JLMSCSS::_('jlmslist'); ?> "> <tr> <<?php echo JLMSCSS::tableheadertag(); ?> class="<?php echo JLMSCSS::_('sectiontableheader'); ?> " width="20">#</<?php echo JLMSCSS::tableheadertag(); ?> > <<?php echo JLMSCSS::tableheadertag(); ?> class="<?php echo JLMSCSS::_('sectiontableheader'); ?> "> <?php echo _JLMS_TRACK_TBL_H_STU; ?> </<?php echo JLMSCSS::tableheadertag(); ?> > <<?php echo JLMSCSS::tableheadertag(); ?> class="<?php echo JLMSCSS::_('sectiontableheader'); ?> "> </<?php echo JLMSCSS::tableheadertag(); ?> > <<?php echo JLMSCSS::tableheadertag(); ?> class="<?php echo JLMSCSS::_('sectiontableheader'); ?> "> <?php echo _JLMS_TRACK_TBL_H_ACTIVITY; ?> </<?php echo JLMSCSS::tableheadertag(); ?> > <<?php echo JLMSCSS::tableheadertag(); ?> class="<?php echo JLMSCSS::_('sectiontableheader'); ?> "> <?php echo _JLMS_TRACK_TBL_H_TIME; ?> </<?php echo JLMSCSS::tableheadertag(); ?> > </tr> <?php $limit = intval(mosGetParam($_GET, 'limit', $JLMS_SESSION->get('list_limit', $JLMS_CONFIG->getCfg('list_limit')))); $JLMS_SESSION->set('list_limit', $limit); $limitstart = intval(mosGetParam($_GET, 'limitstart', 0)); $total = count($lists['page14_stats']); require_once _JOOMLMS_FRONT_HOME . DS . "includes" . DS . "classes" . DS . "lms.pagination.php"; $pageNav = new JLMSPageNav($total, $limitstart, $limit); $k = 1; $count_activities = 0; $items_counter = 0; foreach ($lists['page14_stats'] as $latest_activity) { if ($count_activities >= $pageNav->limitstart && $count_activities < $pageNav->limitstart + $pageNav->limit) { echo '<tr class="' . JLMSCSS::_('sectiontableentry' . $k) . '">'; echo '<td>'; echo $pageNav->limitstart + $items_counter + 1; echo '</td>'; echo '<td>' . $latest_activity->user . '</td>'; echo '<td width="16"><img src="' . $JLMS_CONFIG->get('live_site') . '/components/com_joomla_lms/lms_images/' . $latest_activity->icon . '" alt="i" width="16" height="16" border="0" /></td>'; echo '<td>' . $latest_activity->activity . '</td>'; echo '<td>' . JLMS_dateToDisplay($latest_activity->time, true, $JLMS_CONFIG->get('offset') * 60 * 60, ' H:i:s') . '</td>'; echo '</tr>'; $k = 3 - $k; $items_counter++; } $count_activities++; } ?> <tr> <td colspan="5" align="center"class="<?php echo JLMSCSS::_('jlmslist-footer_td'); ?> "> <div align="center"> <?php $link = "index.php?option={$option}&Itemid={$Itemid}&task=tracking&id={$id}&page=14"; echo $pageNav->writePagesLinks($link); ?> </div> </td> </tr> </table> <table width="100%" cellpadding="0" cellspacing="0" class="jlms_table_no_borders"> <tr> <td align="center"> <?php $controls = array(); $controls[] = array('href' => "javascript:submitbutton('csv');", 'title' => 'CSV', 'img' => 'csv'); $controls[] = array('href' => "javascript:submitbutton('xls');", 'title' => 'XLS', 'img' => 'xls'); JLMS_TMPL::ShowControlsFooterC($controls, '', false, false, _JLMS_EXPORT_TO . ':'); ?> </td> </tr> </table> <?php } elseif ($lists['page'] == 14 && !$page_14_stats_shown) { echo '<div class="joomlalms_user_message">' . _JLMS_TRACKING_NO_STATISTICS . '</div>'; } elseif ($lists['page'] == 12 && $lists['filter_stu_val'] && isset($lists['page12_stats']) && !empty($lists['page12_stats'])) { $page_12_stats_shown = true; $max_tree_width = 0; if (isset($lists['page12_stats'][0])) { $max_tree_width = $lists['page12_stats'][0]->tree_max_width; } ?> <table width="100%" cellpadding="0" cellspacing="0" border="0" class="<?php echo JLMSCSS::_('jlmslist'); ?> "> <tr> <<?php echo JLMSCSS::tableheadertag(); ?> width="<?php echo 16 * ($max_tree_width + 1); ?> " class="<?php echo JLMSCSS::_('sectiontableheader'); ?> " colspan="<?php echo $max_tree_width + 1; ?> "> </<?php echo JLMSCSS::tableheadertag(); ?> > <<?php echo JLMSCSS::tableheadertag(); ?> class="<?php echo JLMSCSS::_('sectiontableheader'); ?> " width="45%"><?php echo _JLMS_TRACK_TBL_DOC_NAME; ?> </<?php echo JLMSCSS::tableheadertag(); ?> > <<?php echo JLMSCSS::tableheadertag(); ?> class="<?php echo JLMSCSS::_('sectiontableheader'); ?> " align="center"><?php echo _JLMS_TRACK_TBL_DOC_DOWNS; ?> </<?php echo JLMSCSS::tableheadertag(); ?> > <<?php echo JLMSCSS::tableheadertag(); ?> class="<?php echo JLMSCSS::_('sectiontableheader'); ?> " align="center"><?php echo _JLMS_TRACK_TBL_DOC_LAST; ?> </<?php echo JLMSCSS::tableheadertag(); ?> > </tr> <?php $k = 1; $tree_modes = array(); for ($i = 0, $n = count($lists['page12_stats']); $i < $n; $i++) { $row_doc = $lists['page12_stats'][$i]; $max_tree_width = $row_doc->tree_max_width; ?> <tr class="<?php echo JLMSCSS::_('sectiontableentry' . $k); ?> "> <?php $add_img = ''; if ($row_doc->tree_mode_num) { $g = 0; $tree_modes[$row_doc->tree_mode_num - 1] = $row_doc->tree_mode; while ($g < $row_doc->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' /></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_doc->tree_mode . ".png\" width='16' height='16' /></td>"; $max_tree_width = $max_tree_width - $g - 1; } echo $add_img; ?> <td align="center" valign="middle" style="vertical-align:middle " width='16'> <?php if ($row_doc->folder_flag == 1) { echo "<span style='alignment:center; font-weight:bold; vertical-align:middle;'><img class='JLMS_png' src=\"" . $JLMS_CONFIG->get('live_site') . "/components/com_joomla_lms/lms_images/folder.png\" width='16' height='16' alt='Folder' /></span>"; } else { echo "<span style='alignment:center; font-weight:bold; vertical-align:middle;'><img class='JLMS_png' src=\"" . $JLMS_CONFIG->get('live_site') . "/components/com_joomla_lms/lms_images/files/" . $row_doc->file_icon . ".png\" width='16' height='16' alt='File' /></span>"; } ?> </td> <td align="left" valign="middle" <?php if ($max_tree_width > 0) { echo "colspan='" . ($max_tree_width + 1) . "'"; } ?> width="35%"> <?php if ($row_doc->folder_flag || !$row_doc->folder_flag && !$row_doc->file_id) { echo '<strong>' . $row_doc->doc_name . '</strong>'; } else { echo $row_doc->doc_name; } ?> </td> <td valign="middle" align="center"> <?php echo $row_doc->downloads; ?> </td> <td valign="middle" align="center"> <?php echo JLMS_dateToDisplay($row_doc->last_access, false, $JLMS_CONFIG->get('offset') * 60 * 60, ' H:i:s'); ?> </td> </tr> <?php $k = 3 - $k; } ?> </table> <?php } elseif ($lists['page'] == 12 && !$lists['filter_stu_val'] && isset($lists['page12_stats']) && !empty($lists['page12_stats'])) { $page_12_stats_shown = true; $max_tree_width = 0; if (isset($lists['page12_stats'][0])) { $max_tree_width = $lists['page12_stats'][0]->tree_max_width; } ?> <script language="javascript" type="text/javascript"> <!--//--><![CDATA[//><!-- var block_stats = 0; var tID = ''; var url_prefix = '<?php echo $JLMS_CONFIG->get('live_site') . "/index.php?tmpl=component&option={$option}&Itemid={$Itemid}&id={$id}"; ?> '; function jlms_MakeRequest(url) { var http_request = false; if (window.ActiveXObject) { // IE try { http_request = new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) { try { http_request = new ActiveXObject("Microsoft.XMLHTTP"); } catch (e) {} } } else if (window.XMLHttpRequest) { // Mozilla, Safari,... http_request = new XMLHttpRequest(); if (http_request.overrideMimeType) { http_request.overrideMimeType('text/xml'); } } if (!http_request) { return false; } http_request.onreadystatechange = function() { jlms_AnalizeRequest(http_request); }; http_request.open('GET', url_prefix + url, true); http_request.send(null); } function jlms_AnalizeRequest(http_request) { if (http_request.readyState == 4) { if ((http_request.status == 200)) { block_stats = 0; if(http_request.responseXML.documentElement == null){ try { http_request.responseXML.loadXML(http_request.responseText) } catch (e) { /*alert("Can't load");*/ } } response = http_request.responseXML.documentElement; var task = response.getElementsByTagName('task')[0].firstChild.data; switch (task) { case 'doc_xml': var response_data = response.getElementsByTagName('stats_table')[0].firstChild.data; var sec_indx = gl_el.parentNode.sectionRowIndex; var table = gl_el.parentNode.parentNode; var row = table.insertRow(sec_indx + 1); var cell1 = document.createElement("td"); cell1.align = 'left'; cell1.colSpan = "<?php echo $max_tree_width + 5; ?> "; cell1.style.padding = '0px'; cell1.style.margin = '0px'; cell1.innerHTML = response_data; row.appendChild(cell1); gl_el.innerHTML = "<img class='JLMS_png' src='<?php echo $JLMS_CONFIG->get('live_site'); ?> /components/com_joomla_lms/lms_images/toolbar/btn_accept.png' width='16' height='16' alt=\"done\" title=\"done\" />"; break; } } else { } } } var gl_el = ''; function jlms_RequestDOCS_stats( doc_id, element ) { if (block_stats == 0) { block_stats = 1; gl_el = element.parentNode; jlms_MakeRequest('&task=get_docs_stats&doc_id='+doc_id+'&colspan=<?php echo $max_tree_width + 2; ?> '); gl_el.innerHTML = "<img src='<?php echo $JLMS_CONFIG->get('live_site') . '/' . $JLMS_CONFIG->get('ajax_settings_small_indicator'); ?> ' width='16' height='16' alt=\"loading\" title=\"loading\" />"; } } JLMS_preloadImages('<?php echo $JLMS_CONFIG->get('live_site') . '/' . $JLMS_CONFIG->get('ajax_settings_small_indicator'); ?> ', '<?php echo $JLMS_CONFIG->get('live_site'); ?> /components/com_joomla_lms/lms_images/toolbar/btn_accept.png'); //--><!]]> </script> <table width="100%" cellpadding="0" cellspacing="0" border="0" class="<?php echo JLMSCSS::_('jlmslist'); ?> "> <tr> <<?php echo JLMSCSS::tableheadertag(); ?> width="16" class="<?php echo JLMSCSS::_('sectiontableheader'); ?> "> </<?php echo JLMSCSS::tableheadertag(); ?> > <<?php echo JLMSCSS::tableheadertag(); ?> width="<?php echo 16 * ($max_tree_width + 1); ?> " class="<?php echo JLMSCSS::_('sectiontableheader'); ?> " colspan="<?php echo $max_tree_width + 1; ?> "> </<?php echo JLMSCSS::tableheadertag(); ?> > <<?php echo JLMSCSS::tableheadertag(); ?> class="<?php echo JLMSCSS::_('sectiontableheader'); ?> " width="45%"><?php echo _JLMS_TRACK_TBL_DOC_NAME; ?> </<?php echo JLMSCSS::tableheadertag(); ?> > <<?php echo JLMSCSS::tableheadertag(); ?> class="<?php echo JLMSCSS::_('sectiontableheader'); ?> " width="100" align="center"><?php echo _JLMS_TRACK_TBL_DOC_DOWNS; ?> </<?php echo JLMSCSS::tableheadertag(); ?> > <<?php echo JLMSCSS::tableheadertag(); ?> class="<?php echo JLMSCSS::_('sectiontableheader'); ?> " width="100" align="center"><?php echo _JLMS_TRACK_TBL_DOC_LAST; ?> </<?php echo JLMSCSS::tableheadertag(); ?> > </tr> <?php $k = 1; $tree_modes = array(); for ($i = 0, $n = count($lists['page12_stats']); $i < $n; $i++) { $row_doc = $lists['page12_stats'][$i]; $max_tree_width = $row_doc->tree_max_width; ?> <tr class="<?php echo JLMSCSS::_('sectiontableentry' . $k); ?> "> <td valign="middle" align="center"> <?php if ($row_doc->folder_flag != 1) { ?> <span style="alignment:center; vertical-align:middle; cursor:pointer" onclick="jlms_RequestDOCS_stats(<?php echo $row_doc->id; ?> , this);"> <img class='JLMS_png' src="<?php echo $JLMS_CONFIG->get('live_site'); ?> /components/com_joomla_lms/lms_images/toolbar/btn_pending_cur.png" width='16' height='16' alt="<?php echo _JLMS_TRACK_VIEW_DETAILS; ?> " title="<?php echo _JLMS_TRACK_VIEW_DETAILS; ?> " /> </span> <?php } else { echo ' '; } ?> </td> <?php $add_img = ''; if ($row_doc->tree_mode_num) { $g = 0; $tree_modes[$row_doc->tree_mode_num - 1] = $row_doc->tree_mode; while ($g < $row_doc->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='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_doc->tree_mode . ".png\" width='16' height='16' alt='sub' /></td>"; $max_tree_width = $max_tree_width - $g - 1; } echo $add_img; ?> <td align="center" valign="middle" style="vertical-align:middle " width='16'> <?php if ($row_doc->folder_flag == 1) { echo "<span style='alignment:center; font-weight:bold; vertical-align:middle;'><img class='JLMS_png' src=\"" . $JLMS_CONFIG->get('live_site') . "/components/com_joomla_lms/lms_images/folder.png\" width='16' height='16' alt='Folder' /></span>"; } else { echo "<span style='alignment:center; font-weight:bold; vertical-align:middle;'><img class='JLMS_png' src=\"" . $JLMS_CONFIG->get('live_site') . "/components/com_joomla_lms/lms_images/files/" . $row_doc->file_icon . ".png\" width='16' height='16' alt='File' /></span>"; } ?> </td> <td align="left" valign="middle" <?php if ($max_tree_width > 0) { echo "colspan='" . ($max_tree_width + 1) . "'"; } ?> width="35%"> <?php if ($row_doc->folder_flag || !$row_doc->folder_flag && !$row_doc->file_id) { echo '<strong>' . $row_doc->doc_name . '</strong>'; } else { echo $row_doc->doc_name; } ?> </td> <td valign="middle" align="center"> <?php echo $row_doc->downloads; ?> </td> <td valign="middle" align="center"> <?php echo JLMS_dateToDisplay($row_doc->last_access, false, $JLMS_CONFIG->get('offset') * 60 * 60, ' H:i:s'); ?> </td> </tr> <?php $k = 3 - $k; } ?> </table> <?php } elseif ($lists['page'] == 12 && !$page_12_stats_shown) { echo '<div class="joomlalms_user_message">' . _JLMS_TRACKING_NO_STATISTICS . '</div>'; } elseif ($lists['page'] == 13 && $lists['filter_stu_val'] && isset($lists['page13_stats']) && !empty($lists['page13_stats'])) { $page_13_stats_shown = true; ?> <script language="javascript" type="text/javascript"> <!--//--><![CDATA[//><!-- function submitbutton(pressbutton){ var form = document.adminForm; form.view.value = pressbutton; form.submit(); } var block_stats = 0; var tID = ''; var url_prefix = '<?php echo $JLMS_CONFIG->get('live_site') . "/index.php?tmpl=component&option={$option}&Itemid={$Itemid}&id={$id}"; ?> '; function jlms_MakeRequest(url) { var http_request = false; if (window.XMLHttpRequest) { // Mozilla, Safari,... http_request = new XMLHttpRequest(); if (http_request.overrideMimeType) { http_request.overrideMimeType('text/xml'); } } else if (window.ActiveXObject) { // IE try { http_request = new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) { try { http_request = new ActiveXObject("Microsoft.XMLHTTP"); } catch (e) {} } } if (!http_request) { return false; } http_request.onreadystatechange = function() { jlms_AnalizeRequest(http_request); }; http_request.open('GET', url_prefix + url, true); http_request.send(null); } function jlms_AnalizeRequest(http_request) { if (http_request.readyState == 4) { if ((http_request.status == 200)) { block_stats = 0; if(http_request.responseXML.documentElement == null){ try { http_request.responseXML.loadXML(http_request.responseText) } catch (e) { /*alert("Can't load");*/ } } response = http_request.responseXML.documentElement; var task = response.getElementsByTagName('task')[0].firstChild.data; switch (task) { case 'lpath_xml': var response_data = response.getElementsByTagName('stats_table')[0].firstChild.data; if (response_data && response_data != '' && response_data != ' ') { var sec_indx = gl_el.parentNode.sectionRowIndex; var table = gl_el.parentNode.parentNode; var row = table.insertRow(sec_indx + 1); var cell1 = document.createElement("td"); cell1.align = 'left'; cell1.colSpan = "3"; cell1.style.padding = '0px'; cell1.style.margin = '0px'; cell1.innerHTML = response_data; row.appendChild(cell1); } gl_el.innerHTML = "<img class='JLMS_png' src='<?php echo $JLMS_CONFIG->get('live_site'); ?> /components/com_joomla_lms/lms_images/toolbar/btn_accept.png' width='16' height='16' alt=\"done\" title=\"done\" />"; break; case 'scorm_progress_xml': var response_data = response.getElementsByTagName('stats_table')[0].firstChild.data; var res_user = response.getElementsByTagName('user_id')[0].firstChild.data; var res_lpsc = response.getElementsByTagName('lpath_id')[0].firstChild.data; if (response_data && response_data != '' && response_data != ' ') { gl_el_res = document.getElementById('sc_progress_td_'+res_user+'_'+res_lpsc); if (gl_el_res) { gl_el_res.innerHTML = response_data; } } break; } } else { } } } var gl_el = ''; function jlms_RequestLP_stats( lp_id, element ) { if (block_stats == 0) { block_stats = 1; gl_el = element.parentNode; jlms_MakeRequest('&task=get_lp_stats&lpath_id='+lp_id); gl_el.innerHTML = "<img src='<?php echo $JLMS_CONFIG->get('live_site') . '/' . $JLMS_CONFIG->get('ajax_settings_small_indicator'); ?> ' width='16' height='16' alt=\"loading\" title=\"loading\" />"; } } function ChangeScormProgress( user_id, sc_id, new_stat, element) { if (block_stats == 0) { block_stats = 1; gl_el = document.getElementById('sc_progress_td_'+user_id+'_'+sc_id); jlms_MakeRequest('&task=get_lp_stats&mode=scormstatus&user_id='+user_id+'&nstat='+new_stat+'&lpath_id='+sc_id); gl_el.innerHTML = "<img src='<?php echo $JLMS_CONFIG->get('live_site') . '/' . $JLMS_CONFIG->get('ajax_settings_small_indicator'); ?> ' width='16' height='16' alt=\"loading\" title=\"loading\" />"; } } JLMS_preloadImages('<?php echo $JLMS_CONFIG->get('live_site') . '/' . $JLMS_CONFIG->get('ajax_settings_small_indicator'); ?> ', '<?php echo $JLMS_CONFIG->get('live_site'); ?> /components/com_joomla_lms/lms_images/toolbar/btn_accept.png', '<?php echo $JLMS_CONFIG->get('live_site'); ?> /components/com_joomla_lms/lms_images/toolbar/btn_cancel.png'); //--><!]]> </script> <table width="100%" cellpadding="0" cellspacing="0" border="0" class="<?php echo JLMSCSS::_('jlmslist'); ?> "> <tr> <<?php echo JLMSCSS::tableheadertag(); ?> width="16" class="<?php echo JLMSCSS::_('sectiontableheader'); ?> " align="center"> </<?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 echo JLMSCSS::tableheadertag(); ?> class="<?php echo JLMSCSS::_('sectiontableheader'); ?> " width="1" colspan="3"> </<?php echo JLMSCSS::tableheadertag(); ?> > <<?php echo JLMSCSS::tableheadertag(); ?> class="<?php echo JLMSCSS::_('sectiontableheader'); ?> " align="center"><?php echo _JLMS_LPATH_TBL_TIME_SPENT; ?> </<?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(); ?> > </tr> <?php $k = 1; for ($i = 0, $n = count($lists['page13_stats']); $i < $n; $i++) { $row_path = $lists['page13_stats'][$i]; $icon_img = "toolbar/tlb_lpath"; $icon_alt = "learnpath"; if ($row_path->item_id) { $icon_img = "toolbar/tlb_scorm"; $icon_alt = "scorm"; } ?> <tr class="<?php echo JLMSCSS::_('sectiontableentry' . $k); ?> "> <td valign="middle" align="center"> </td> <td valign="middle" align="left"> <?php if ($lists['f_lpath']) { echo JLMS_tracking_html::Echo_userinfo($row_path->u_name, $row_path->username, $row_path->email, 'javascript:void(0);'); } else { echo $row_path->lpath_name; } ?> </td> <?php if ($lists['f_lpath']) { ?> <td width="1%" style="white-space: nowrap;"><?php echo JLMS_getLpathProgress($row_path, $row_path->user_id ? $row_path->user_id : 0); ?> </td> <?php } else { ?> <td width="1%" style="white-space: nowrap;"><?php echo JLMS_getLpathProgress($row_path, $lists['filter_stu_val']); ?> </td> <?php } ?> <?php $r_img = 'btn_cancel'; $r_sta = _JLMS_LPATH_STU_LPSTATUS_NOTCOMPLETED; $time_spent = $row_path->time_spent; $r_start = '-'; $r_end = '-'; $new_s_status = '1'; 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; $r_start = isset($row_path->r_start) && $row_path->r_start ? JLMS_dateToDisplay($row_path->r_start, false, $JLMS_CONFIG->get('offset') * 60 * 60, '\\<\\b\\r \\/>H:i:s') : '-'; $r_end = isset($row_path->r_start) && $row_path->r_start ? 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'; $r_start = isset($row_path->r_start) && $row_path->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 = '-'; $new_s_status = '0'; } if ($row_path->lp_type == 1 || $row_path->lp_type == 2) { $r_end = isset($row_path->r_end) && $row_path->r_end ? JLMS_dateToDisplay($row_path->r_end, true, $JLMS_CONFIG->get('offset') * 60 * 60, '\\<\\b\\r \\/>H:i:s') : '-'; $r_start = isset($row_path->r_start) && $row_path->r_start ? JLMS_dateToDisplay($row_path->r_start, true, $JLMS_CONFIG->get('offset') * 60 * 60, '\\<\\b\\r \\/>H:i:s') : '-'; } } ?> <?php if ($row_path->item_id) { ?> <td valign="middle" align="center" width="16" id="sc_progress_td_<?php echo $lists['filter_stu_val'] . "_" . $row_path->item_id; ?> "> <a class="jlms_img_link" id="sc_progress_a_<?php echo $lists['filter_stu_val'] . "_" . $row_path->item_id; ?> " href="javascript:ChangeScormProgress(<?php echo $lists['filter_stu_val']; ?> ,<?php echo $row_path->item_id; ?> ,<?php echo $new_s_status; ?> ,this);"><img id="sc_progress_img_<?php echo $lists['filter_stu_val'] . "_" . $row_path->item_id; ?> " align="absmiddle" class="JLMS_png" src="<?php echo $JLMS_CONFIG->get('live_site'); ?> /components/com_joomla_lms/lms_images/toolbar/<?php echo $r_img; ?> .png" width="16" height="16" border="0" alt="<?php echo $r_sta; ?> " title="<?php echo $r_sta; ?> " /></a> <?php } else { ?> <td valign="middle" align="center" width="16"> <img class='JLMS_png' src='<?php echo $JLMS_CONFIG->get('live_site'); ?> /components/com_joomla_lms/lms_images/toolbar/<?php echo $r_img; ?> .png' width='16' height='16' alt="<?php echo $r_sta; ?> " title="<?php echo $r_sta; ?> " /> <?php } ?> </td> <td valign="middle" align="center" nowrap="nowrap"> <?php echo $row_path->item_id ? isset($row_path->s_score) ? $row_path->s_score . _JLMS_GB_POINTS : ' ' : ' '; ?> </td> <td valign="middle" align="center" nowrap="nowrap"><?php echo $time_spent; ?> </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> </tr> <?php $k = 3 - $k; } ?> </table> <table width="100%" cellpadding="0" cellspacing="0" class="jlms_table_no_borders"> <tr> <td align="center"> <?php $controls = array(); $controls[] = array('href' => "javascript:submitbutton('csv');", 'title' => 'CSV', 'img' => 'csv'); $controls[] = array('href' => "javascript:submitbutton('xls');", 'title' => 'XLS', 'img' => 'xls'); JLMS_TMPL::ShowControlsFooterC($controls, '', false, false, _JLMS_EXPORT_TO . ':'); ?> </td> </tr> </table> <?php } elseif ($lists['page'] == 13 && !$lists['filter_stu_val'] && isset($lists['page13_stats']) && !empty($lists['page13_stats'])) { $page_13_stats_shown = true; ?> <script language="javascript" type="text/javascript"> <!--//--><![CDATA[//><!-- var block_stats = 0; var tID = ''; var url_prefix = '<?php echo $JLMS_CONFIG->get('live_site') . "/index.php?tmpl=component&option={$option}&Itemid={$Itemid}&id={$id}"; ?> '; function jlms_MakeRequest(url) { var http_request = false; if (window.XMLHttpRequest) { // Mozilla, Safari,... http_request = new XMLHttpRequest(); if (http_request.overrideMimeType) { http_request.overrideMimeType('text/xml'); } } else if (window.ActiveXObject) { // IE try { http_request = new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) { try { http_request = new ActiveXObject("Microsoft.XMLHTTP"); } catch (e) {} } } if (!http_request) { return false; } http_request.onreadystatechange = function() { jlms_AnalizeRequest(http_request); }; http_request.open('GET', url_prefix + url, true); http_request.send(null); } function jlms_AnalizeRequest(http_request) { if (http_request.readyState == 4) { if ((http_request.status == 200)) { block_stats = 0; if(http_request.responseXML.documentElement == null){ try { http_request.responseXML.loadXML(http_request.responseText) } catch (e) { /*alert("Can't load");*/ } } response = http_request.responseXML.documentElement; var task = response.getElementsByTagName('task')[0].firstChild.data; switch (task) { case 'lpath_xml': var response_data = response.getElementsByTagName('stats_table')[0].firstChild.data; if (response_data && response_data != '' && response_data != ' ') { var sec_indx = gl_el.parentNode.sectionRowIndex; var table = gl_el.parentNode.parentNode; var row = table.insertRow(sec_indx + 1); var cell1 = document.createElement("td"); cell1.align = 'left'; cell1.colSpan = "3"; cell1.style.padding = '0px'; cell1.style.margin = '0px'; cell1.innerHTML = response_data; row.appendChild(cell1); } gl_el.innerHTML = "<img class='JLMS_png' src='<?php echo $JLMS_CONFIG->get('live_site'); ?> /components/com_joomla_lms/lms_images/toolbar/btn_accept.png' width='16' height='16' alt=\"done\" title=\"done\" />"; break; case 'scorm_progress_xml': var response_data = response.getElementsByTagName('stats_table')[0].firstChild.data; var res_user = response.getElementsByTagName('user_id')[0].firstChild.data; var res_lpsc = response.getElementsByTagName('lpath_id')[0].firstChild.data; if (response_data && response_data != '' && response_data != ' ') { gl_el_res = document.getElementById('sc_progress_td_'+res_user+'_'+res_lpsc); if (gl_el_res) { gl_el_res.innerHTML = response_data; } } break; } } else { } } } var gl_el = ''; function jlms_RequestLP_stats( lp_id, element ) { if (block_stats == 0) { block_stats = 1; gl_el = element.parentNode; jlms_MakeRequest('&task=get_lp_stats&lpath_id='+lp_id); gl_el.innerHTML = "<img src='<?php echo $JLMS_CONFIG->get('live_site') . '/' . $JLMS_CONFIG->get('ajax_settings_small_indicator'); ?> ' width='16' height='16' alt=\"loading\" title=\"loading\" />"; } } function ChangeScormProgress( user_id, sc_id, new_stat, element) { if (block_stats == 0) { block_stats = 1; gl_el = document.getElementById('sc_progress_td_'+user_id+'_'+sc_id); jlms_MakeRequest('&task=get_lp_stats&mode=scormstatus&user_id='+user_id+'&nstat='+new_stat+'&lpath_id='+sc_id); gl_el.innerHTML = "<img src='<?php echo $JLMS_CONFIG->get('live_site') . '/' . $JLMS_CONFIG->get('ajax_settings_small_indicator'); ?> ' width='16' height='16' alt=\"loading\" title=\"loading\" />"; } } JLMS_preloadImages('<?php echo $JLMS_CONFIG->get('live_site') . '/' . $JLMS_CONFIG->get('ajax_settings_small_indicator'); ?> ', '<?php echo $JLMS_CONFIG->get('live_site'); ?> /components/com_joomla_lms/lms_images/toolbar/btn_accept.png'); //--><!]]> </script> <table width="100%" cellpadding="0" cellspacing="0" border="0" class="<?php echo JLMSCSS::_('jlmslist'); ?> "> <tr> <<?php echo JLMSCSS::tableheadertag(); ?> width="16" class="<?php echo JLMSCSS::_('sectiontableheader'); ?> " align="center"> </<?php echo JLMSCSS::tableheadertag(); ?> > <<?php echo JLMSCSS::tableheadertag(); ?> width="16" class="<?php echo JLMSCSS::_('sectiontableheader'); ?> " align="center"> </<?php echo JLMSCSS::tableheadertag(); ?> > <<?php echo JLMSCSS::tableheadertag(); ?> class="<?php echo JLMSCSS::_('sectiontableheader'); ?> " width="100%"><?php echo _JLMS_LPATH_TBL_HEAD_NAME; ?> </<?php echo JLMSCSS::tableheadertag(); ?> > </tr> <?php $k = 1; for ($i = 0, $n = count($lists['page13_stats']); $i < $n; $i++) { $row_path = $lists['page13_stats'][$i]; $icon_img = "toolbar/tlb_lpath"; $icon_alt = "learnpath"; if ($row_path->item_id) { $icon_img = "toolbar/tlb_scorm"; $icon_alt = "scorm"; } ?> <tr class="<?php echo JLMSCSS::_('sectiontableentry' . $k); ?> "> <td valign="middle" align="center"> <?php if (!isset($row_path->is_link)) { ?> <span style="alignment:center; vertical-align:middle; cursor:pointer" onclick="jlms_RequestLP_stats(<?php echo $row_path->id; ?> , this);"> <img class='JLMS_png' src="<?php echo $JLMS_CONFIG->get('live_site'); ?> /components/com_joomla_lms/lms_images/toolbar/btn_pending_cur.png" width='16' height='16' alt="<?php echo _JLMS_TRACK_VIEW_DETAILS; ?> " title="<?php echo _JLMS_TRACK_VIEW_DETAILS; ?> " /> </span> <?php } ?> </td> <td valign="middle" align="center"> <span style="alignment:center; vertical-align:middle"> <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 echo $row_path->lpath_name; ?> </td> </tr> <?php $k = 3 - $k; } ?> </table> <?php } elseif ($lists['page'] == 13 && !$page_13_stats_shown) { echo '<div class="joomlalms_user_message">' . _JLMS_TRACKING_NO_STATISTICS . '</div>'; } elseif ($lists['page'] == 5 && $lists['filter_stu_val'] && isset($lists['page5_stats'])) { ?> <br /><br /> <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 echo JLMSCSS::tableheadertag(); ?> class="<?php echo JLMSCSS::_('sectiontableheader'); ?> " width="30%"><?php echo _JLMS_HW_TBL_HEAD_HW; ?> </<?php echo JLMSCSS::tableheadertag(); ?> > <<?php echo JLMSCSS::tableheadertag(); ?> class="<?php echo JLMSCSS::_('sectiontableheader'); ?> "><?php echo _JLMS_HW_TBL_HEAD_DATE; ?> </<?php echo JLMSCSS::tableheadertag(); ?> > <<?php echo JLMSCSS::tableheadertag(); ?> class="<?php echo JLMSCSS::_('sectiontableheader'); ?> "><?php echo _JLMS_HW_TBL_HEAD_ENDDATE; ?> </<?php echo JLMSCSS::tableheadertag(); ?> > <<?php echo JLMSCSS::tableheadertag(); ?> class="<?php echo JLMSCSS::_('sectiontableheader'); ?> " width="1"> </<?php echo JLMSCSS::tableheadertag(); ?> > </tr> <?php $k = 1; for ($i = 0, $n = count($lists['page5_stats']); $i < $n; $i++) { $row_hw = $lists['page5_stats'][$i]; $alt = $row_hw->hw_status ? _JLMS_HW_STATUS_COMPLETED : _JLMS_HW_STATUS_INCOMPLETED; $image = $row_hw->hw_status ? 'btn_accept.png' : 'btn_cancel.png'; ?> <tr class="<?php echo JLMSCSS::_('sectiontableentry' . $k); ?> "> <td align="center"><?php echo $i + 1; ?> </td> <td align="left" valign="middle" style="vertical-align:middle "> <?php echo $row_hw->hw_name; ?> </td> <td valign="middle" style="vertical-align:middle "> <?php echo $row_hw->post_date; ?> </td> <td valign="middle" style="vertical-align:middle "> <?php echo $row_hw->end_date; ?> </td> <td align="left" valign="middle" style="vertical-align:middle; text-align:left; white-space:nowrap " nowrap="nowrap"> <?php echo '<img align="absmiddle" 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 . '" />'; if ($row_hw->hw_status) { echo ' ' . JLMS_dateToDisplay($row_hw->hw_date, false, $JLMS_CONFIG->get('offset') * 60 * 60, ' H:i:s'); } ?> </td> </tr> <?php $k = 3 - $k; } ?> </table> <?php } elseif ($lists['page'] == 11 && $lists['filter_stu_val'] && isset($lists['page11_stats']) && !empty($lists['page11_stats'])) { ?> <br /><br /> <table width="100%" cellpadding="0" cellspacing="0" border="0" class="<?php echo JLMSCSS::_('jlmslist'); ?> "> <tr> <<?php echo JLMSCSS::tableheadertag(); ?> width="16" class="<?php echo JLMSCSS::_('sectiontableheader'); ?> " align="center"> </<?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 echo JLMSCSS::tableheadertag(); ?> class="<?php echo JLMSCSS::_('sectiontableheader'); ?> "> </<?php echo JLMSCSS::tableheadertag(); ?> > <<?php echo JLMSCSS::tableheadertag(); ?> class="<?php echo JLMSCSS::_('sectiontableheader'); ?> " width="1" colspan="2"> </<?php echo JLMSCSS::tableheadertag(); ?> > </tr> <?php $k = 1; for ($i = 0, $n = count($lists['page11_stats']); $i < $n; $i++) { $row_path = $lists['page11_stats'][$i]; $icon_img = "toolbar/tlb_lpath"; $icon_alt = "learnpath"; if ($row_path->c_id) { $icon_img = "toolbar/tlb_scorm"; $icon_alt = "scorm"; } ?> <tr class="<?php echo JLMSCSS::_('sectiontableentry' . $k); ?> "> <td valign="middle" align="center"> <span style="alignment:center; vertical-align:middle"> <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 echo $row_path->c_title; ?> </td> <?php $r_img = 'btn_cancel'; $r_sta = _JLMS_LPATH_STU_LPSTATUS_NOTCOMPLETED; $r_start = '-'; $r_end = '-'; if (!$row_path->c_id) { if (isset($row_path->published) && $row_path->published == 1) { $r_img = 'btn_accept'; $r_sta = _JLMS_LPATH_STU_LPSTATUS_COMPLETED; $r_start = $row_path->r_start ? JLMS_dateToDisplay($row_path->r_start, false, $JLMS_CONFIG->get('offset') * 60 * 60, '\\<\\b\\r \\/>H:i:s') : '-'; $r_end = $row_path->r_start ? JLMS_dateToDisplay($row_path->r_end, false, $JLMS_CONFIG->get('offset') * 60 * 60, '\\<\\b\\r \\/>H:i:s') : '-'; } elseif (isset($row_path->published) && $row_path->published == 0) { $r_img = 'btn_pending_cur'; $r_start = $row_path->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->published) && $row_path->published == 1) { $r_img = 'btn_accept'; $r_sta = _JLMS_LPATH_STU_LPSTATUS_COMPLETED; $r_start = '-'; $r_end = '-'; } } ?> <td valign="middle" align="center"> <a style="border:0px;" href="<?php echo sefRelToAbs("index.php?option=" . $option . "&task=quizzes&id=" . $id . "&page=reports&quiz_id=" . $row_path->c_id . ""); ?> "><img class='JLMS_png' src="<?php echo $JLMS_CONFIG->get('live_site'); ?> /components/com_joomla_lms/lms_images/toolbar/btn_pending_cur.png" width='16' height='16' alt="<?php echo 'Report'; ?> " title="<?php echo 'Report'; ?> " border="0" /></a> </td> <td valign="middle" align="center" width="16"> <img class='JLMS_png' src="<?php echo $JLMS_CONFIG->get('live_site'); ?> /components/com_joomla_lms/lms_images/toolbar/<?php echo $r_img; ?> .png" width='16' height='16' alt="<?php echo $r_sta; ?> " title="<?php echo $r_sta; ?> " /> </td> <td valign="middle" align="center" nowrap="nowrap"> <?php echo $row_path->c_id ? isset($row_path->s_score) ? $row_path->s_score . _JLMS_GB_POINTS : ' ' : ' '; ?> </td> </tr> <?php $k = 3 - $k; } ?> </table> <?php } elseif ($lists['page'] == 11 && !$lists['filter_stu_val'] && isset($lists['page11_stats']) && !empty($lists['page11_stats'])) { ?> <script language="javascript" type="text/javascript"> <!--//--><![CDATA[//><!-- var block_stats = 0; var tID = ''; var url_prefix = '<?php echo $JLMS_CONFIG->get('live_site') . "/index.php?tmpl=component&option={$option}&Itemid={$Itemid}&id={$id}"; ?> '; function jlms_MakeRequest(url) { var http_request = false; if (window.XMLHttpRequest) { // Mozilla, Safari,... http_request = new XMLHttpRequest(); if (http_request.overrideMimeType) { http_request.overrideMimeType('text/xml'); } } else if (window.ActiveXObject) { // IE try { http_request = new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) { try { http_request = new ActiveXObject("Microsoft.XMLHTTP"); } catch (e) {} } } if (!http_request) { return false; } http_request.onreadystatechange = function() { jlms_AnalizeRequest(http_request); }; http_request.open('GET', url_prefix + url, true); http_request.send(null); } function jlms_AnalizeRequest(http_request) { if (http_request.readyState == 4) { if ((http_request.status == 200)) { block_stats = 0; if(http_request.responseXML.documentElement == null){ try { http_request.responseXML.loadXML(http_request.responseText) } catch (e) { /*alert("Can't load");*/ } } response = http_request.responseXML.documentElement; var task = response.getElementsByTagName('task')[0].firstChild.data; switch (task) { case 'lpath_xml': var response_data = response.getElementsByTagName('stats_table')[0].firstChild.data; if (response_data && response_data != '' && response_data != ' ') { var sec_indx = gl_el.parentNode.sectionRowIndex; var table = gl_el.parentNode.parentNode; var row = table.insertRow(sec_indx + 1); var cell1 = document.createElement("td"); cell1.align = 'left'; cell1.colSpan = "4"; cell1.style.padding = '0px'; cell1.style.margin = '0px'; cell1.innerHTML = response_data; row.appendChild(cell1); } gl_el.innerHTML = "<img class='JLMS_png' src='<?php echo $JLMS_CONFIG->get('live_site'); ?> /components/com_joomla_lms/lms_images/toolbar/btn_accept.png' width='16' height='16' alt=\"done\" title=\"done\" />"; break; case 'scorm_progress_xml': var response_data = response.getElementsByTagName('stats_table')[0].firstChild.data; var res_user = response.getElementsByTagName('user_id')[0].firstChild.data; var res_lpsc = response.getElementsByTagName('quiz_id')[0].firstChild.data; if (response_data && response_data != '' && response_data != ' ') { gl_el_res = document.getElementById('quizid_'+res_lpsc); if (gl_el_res) { gl_el_res.innerHTML = response_data; } } break; } } else { } } } var gl_el = ''; function jlms_RequestQuiz_stats( lp_id, element ) { if (block_stats == 0) { block_stats = 1; gl_el = element.parentNode; jlms_MakeRequest('&task=get_quiz_stats&quiz_id='+lp_id); gl_el.innerHTML = "<img src='<?php echo $JLMS_CONFIG->get('live_site') . '/' . $JLMS_CONFIG->get('ajax_settings_small_indicator'); ?> ' width='16' height='16' alt=\"loading\" title=\"loading\" />"; } } JLMS_preloadImages('<?php echo $JLMS_CONFIG->get('live_site') . '/' . $JLMS_CONFIG->get('ajax_settings_small_indicator'); ?> ', '<?php echo $JLMS_CONFIG->get('live_site'); ?> /components/com_joomla_lms/lms_images/toolbar/btn_accept.png', 'components/com_joomla_lms/lms_images/toolbar/btn_cancel.png'); //--><!]]> </script> <table width="100%" cellpadding="0" cellspacing="0" border="0" class="<?php echo JLMSCSS::_('jlmslist'); ?> "> <tr> <<?php echo JLMSCSS::tableheadertag(); ?> width="16" class="<?php echo JLMSCSS::_('sectiontableheader'); ?> " align="center"> </<?php echo JLMSCSS::tableheadertag(); ?> > <<?php echo JLMSCSS::tableheadertag(); ?> width="16" class="<?php echo JLMSCSS::_('sectiontableheader'); ?> " align="center"> </<?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 echo JLMSCSS::tableheadertag(); ?> class="<?php echo JLMSCSS::_('sectiontableheader'); ?> "> </<?php echo JLMSCSS::tableheadertag(); ?> > </tr> <?php $k = 1; for ($i = 0, $n = count($lists['page11_stats']); $i < $n; $i++) { $row_path = $lists['page11_stats'][$i]; $icon_img = "toolbar/tlb_lpath"; $icon_alt = "learnpath"; if ($row_path->c_id) { $icon_img = "toolbar/tlb_quiz"; $icon_alt = "scorm"; } ?> <tr class="<?php echo JLMSCSS::_('sectiontableentry' . $k); ?> "> <td valign="middle" align="center"> <span style="alignment:center; vertical-align:middle; cursor:pointer" onclick="jlms_RequestQuiz_stats(<?php echo $row_path->c_id; ?> , this);"> <img class='JLMS_png' src="<?php echo $JLMS_CONFIG->get('live_site'); ?> /components/com_joomla_lms/lms_images/toolbar/btn_pending_cur.png" width='16' height='16' alt="<?php echo _JLMS_TRACK_VIEW_DETAILS; ?> " title="<?php echo _JLMS_TRACK_VIEW_DETAILS; ?> " /> </span> </td> <td valign="middle" align="center"> <span style="alignment:center; vertical-align:middle"> <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 echo $row_path->c_title; ?> </td> <td valign="middle" align="center"> <a class="jlms_img_link" style="border:0px;" href="<?php echo sefRelToAbs("index.php?option=" . $option . "&task=quizzes&id=" . $id . "&page=reports&quiz_id=" . $row_path->c_id . ""); ?> "><img class='JLMS_png' src="<?php echo $JLMS_CONFIG->get('live_site'); ?> /components/com_joomla_lms/lms_images/toolbar/btn_pending_cur.png" width='16' height='16' alt="<?php echo 'Report'; ?> " title="<?php echo 'Report'; ?> " border="0" /></a> </td> </tr> <?php $k = 3 - $k; } ?> </table> <?php } ?> <input type="hidden" name="option" value="<?php echo $option; ?> " /> <input type="hidden" name="Itemid" value="<?php echo $Itemid; ?> " /> <input type="hidden" name="task" value="tracking" /> <input type="hidden" name="id" value="<?php echo $id; ?> " /> <input type="hidden" name="page" value="<?php echo $lists['page']; ?> " /> <input type="hidden" name="view" value="" /> </form> <?php JLMS_TMPL::CloseTS(); JLMS_TMPL::CloseMT(); }
function showUserAttendance($option, &$rows, &$per_rows, &$date_rows, &$lists) { global $Itemid, $my, $JLMS_CONFIG; $JLMS_ACL =& JLMSFactory::getACL(); ?> <script language="javascript" type="text/javascript"> <!--//--><![CDATA[//><!-- function submitbutton_change(pressbutton, period_id, state) { var form = document.adminForm; if (pressbutton == 'at_dateschange'){ if (form.boxchecked.value == 0) { alert( "<?php echo _JLMS_ALERT_SELECT_ITEM; ?> " ); } else { form.task.value = pressbutton; form.state.value = state; form.period_id.value = period_id; form.submit(); } } } function submitbutton_change_user(pressbutton, period_id, state, cid_id, at_date_value) { var form = document.adminForm; if (pressbutton == 'at_uchange'){ form.cid2.value = cid_id; form.task.value = pressbutton; form.at_date.value = at_date_value; form.state.value = state; form.period_id.value = period_id; form.submit(); } } function pickup_date(){ var form = document.adminForm; form.at_date.value = form.pick_date.value; form.submit(); } //--><!]]> </script> <?php JLMS_TMPL::OpenMT(); $hparams = array(); $toolbar = array(); if ($JLMS_ACL->CheckPermissions('attendance', 'manage')) { $hparams['second_tb_header'] = $lists['username'] . ', ' . $lists['name']; $toolbar[] = array('btn_type' => 'back', 'btn_js' => sefRelToAbs("index.php?option={$option}&Itemid={$Itemid}&task=attendance&id=" . $lists['course_id'])); } JLMS_TMPL::ShowHeader('attendance', $JLMS_ACL->CheckPermissions('attendance', 'manage') ? _JLMS_ATT_TITLE : _JLMS_ATT_TITLE_STU, $hparams, $toolbar); if ($JLMS_ACL->CheckPermissions('attendance', 'manage')) { JLMS_TMPL::OpenTS('', ' class="contentheading"'); //echo $lists['username'].', '.$lists['name']; JLMS_TMPL::CloseTS(); } JLMS_TMPL::OpenTS(); ?> <form action="<?php echo sefRelToAbs("index.php?option={$option}&Itemid={$Itemid}"); ?> " method="post" name="adminForm"> <table width="100%" cellpadding="0" cellspacing="0" border="0" class="jlms_table_no_borders"> <tr> <td align="left" style="text-align:left "> <div align="left" style="white-space:nowrap "> </div> </td> <td align="right" style="text-align:right "> <div align="right" style="white-space:nowrap "> <table cellpadding="0" cellspacing="0" border="0" style="height:16px" class="jlms_table_no_borders"> <tr> <td><?php echo $lists['filter']; ?> </td> <td valign="middle" align="center" width="16"> <?php echo JLMS_HTML::_('calendar.calendar', $lists['at_date'], 'pick', 'pick', null, null, 'statictext'); ?> </td><td valign="middle" align="center" width="18" style="vertical-align:middle "> <a class="jlms_img_link" href="javascript:pickup_date();" title="<?php echo _JLMS_AGENDA_GO_DATE; ?> "> <img class="JLMS_png" src="<?php echo $JLMS_CONFIG->get('live_site'); ?> /components/com_joomla_lms/lms_images/agenda/loopnone.png" alt="<?php echo _JLMS_AGENDA_GO_DATE; ?> " title="<?php echo _JLMS_AGENDA_GO_DATE; ?> " border="0" width="16" height="16" /> </a> <noscript> <input type="submit" name="OK" value="OK" /> <input type="hidden" name="no_script" value="1" /> </noscript> </td> </tr> </table> </div> </td> </tr> </table> <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('attendance', 'manage')) { ?> <<?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 JLMSCSS::tableheadertag(); ?> > <?php } ?> <<?php echo JLMSCSS::tableheadertag(); ?> class="<?php echo JLMSCSS::_('sectiontableheader'); ?> ">date</<?php echo JLMSCSS::tableheadertag(); ?> > <?php foreach ($per_rows as $per_row) { echo '<' . JLMSCSS::tableheadertag() . ' align=\'center\' nowrap="nowrap" class="' . JLMSCSS::_('sectiontableheader') . '" style="text-align:center; white-space:nowrap">' . substr($per_row->period_begin, 0, 5) . ' - ' . substr($per_row->period_end, 0, 5) . '</' . JLMSCSS::tableheadertag() . '>'; } ?> </tr> <?php $k = 1; for ($i = 0, $n = count($rows); $i < $n; $i++) { $row = $rows[$i]; #$link = "index.php?option=$option&Itemid=".$Itemid."&task=at_userattend&course_id=".$lists['course_id']."&at_date=".$lists['at_date']."&id={$row->user_id}"; $checked = JLMS_attendance_html::idBox($i, $row->at_date, $row->is_selected); ?> <tr class="<?php echo JLMSCSS::_('sectiontableentry' . $k); ?> "> <td align="center" valign="middle"><?php echo $i + 1; ?> </td> <?php if ($JLMS_ACL->CheckPermissions('attendance', 'manage')) { ?> <td><?php echo $checked; ?> </td> <?php } ?> <td align="left" valign="middle" style="vertical-align:middle "> <?php echo JLMS_dateToDisplay($row->at_date); ?> </td> <?php $j = 0; while ($j < count($row->at_stats)) { $alt = $row->at_stats[$j]->at_status ? _JLMS_ATT_STATUS_ATTENDED : _JLMS_ATT_STATUS_NOTATTENDED; $image = $row->at_stats[$j]->at_status ? 'btn_accept.png' : 'btn_cancel.png'; $state = $row->at_stats[$j]->at_status ? 0 : 1; echo '<td align=\'center\' valign="middle" style="vertical-align:middle;text-align:center ">'; if ($JLMS_ACL->CheckPermissions('attendance', 'manage')) { echo '<a class="jlms_img_link" href="javascript:submitbutton_change_user(\'at_uchange\',' . $row->at_stats[$j]->period_id . ',' . $state . ',' . $lists['user_id'] . ',\'' . $row->at_date . '\');" title="' . $alt . '"><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 . '" /></a>'; } elseif ($JLMS_ACL->CheckPermissions('attendance', 'view')) { 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 '</td>'; $j++; } ?> </tr> <?php $k = 3 - $k; } if ($JLMS_ACL->CheckPermissions('attendance', 'manage')) { ?> <tr class="<?php echo JLMSCSS::_('sectiontableentry' . $k); ?> "> <td colspan="3"><?php echo _JLMS_ATT_WITH_SELECTED; ?> </td> <?php foreach ($per_rows as $per_row) { echo '<td align=\'center\' valign="middle" style="text-align:center; vertical-align:middle;">'; echo '<a class="jlms_img_link" href="javascript:submitbutton_change(\'at_dateschange\',' . $per_row->id . ',1);" title="' . _JLMS_ATT_MARK_ATTENDED . '">'; echo '<img class="JLMS_png" src="' . $JLMS_CONFIG->get('live_site') . '/components/com_joomla_lms/lms_images/toolbar/btn_accept.png" width="16" height="16" border="0" alt="' . _JLMS_ATT_MARK_ATTENDED . '" />'; echo '</a> '; echo '<a class="jlms_img_link" href="javascript:submitbutton_change(\'at_dateschange\',' . $per_row->id . ',0);" title="' . _JLMS_ATT_MARK_NOTATTENDED . '">'; echo '<img class="JLMS_png" src="' . $JLMS_CONFIG->get('live_site') . '/components/com_joomla_lms/lms_images/toolbar/btn_cancel.png" width="16" height="16" border="0" alt="' . _JLMS_ATT_MARK_NOTATTENDED . '" />'; echo '</a>'; echo '</td>'; } ?> </tr> <?php } ?> </table> <input type="hidden" name="option" value="<?php echo $option; ?> " /> <input type="hidden" name="Itemid" value="<?php echo $Itemid; ?> " /> <input type="hidden" name="task" value="<?php echo $JLMS_ACL->CheckPermissions('attendance', 'manage') ? 'at_userattend' : 'attendance'; ?> " /> <input type="hidden" name="at_date" value="<?php echo JLMS_dateToDisplay($lists['at_date']); ?> " /> <input type="hidden" name="period_id" value="0" /> <input type="hidden" name="state" value="0" /> <input type="hidden" name="cid2" value="0" /> <input type="hidden" name="boxchecked" value="<?php echo $lists['box']; ?> " /> <input type="hidden" name="course_id" value="<?php echo $lists['course_id']; ?> " /> <input type="hidden" name="id" value="<?php echo $JLMS_ACL->CheckPermissions('attendance', 'manage') ? $lists['user_id'] : $lists['course_id']; ?> " /> </form> <?php JLMS_TMPL::CloseTS(); JLMS_TMPL::CloseMT(); }
function showHomeWorks($id, $option, &$rows, &$pageNav, $usertype = 1) { global $JLMS_CONFIG; $Itemid = $JLMS_CONFIG->get('Itemid'); $JLMS_ACL =& JLMSFactory::getACL(); if ($JLMS_ACL->CheckPermissions('homework', 'manage')) { ?> <script language="javascript" type="text/javascript"> <!--//--><![CDATA[//><!-- function submitbutton(pressbutton) { var form = document.adminForm; if ( ((pressbutton == 'hw_delete') || (pressbutton == 'hw_edit')) && (form.boxchecked.value == "0")){ alert("<?php echo _JLMS_ALERT_SELECT_ITEM; ?> "); } else { form.task.value = pressbutton; form.submit(); } } function submitbutton_change2(pressbutton, state, cid_id) { var form = document.adminForm; if (pressbutton == 'hw_publish'){ 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('homework', _JLMS_HW_TITLE_HW, $hparams); JLMS_TMPL::OpenTS(); ?> <form action="<?php echo sefRelToAbs("index.php?option={$option}&Itemid={$Itemid}"); ?> " method="post" name="adminForm"> <?php if (!empty($rows)) { ?> <?php $hw_colspan = 5; ?> <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 ($usertype == 1) { if ($JLMS_ACL->CheckPermissions('homework', 'manage')) { $hw_colspan++; ?> <<?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 JLMSCSS::tableheadertag(); ?> > <?php } ?> <<?php echo JLMSCSS::tableheadertag(); ?> class="<?php echo JLMSCSS::_('sectiontableheader'); ?> " width="30%"><?php echo _JLMS_HW_TBL_HEAD_HW; ?> </<?php echo JLMSCSS::tableheadertag(); ?> > <<?php echo JLMSCSS::tableheadertag(); ?> class="<?php echo JLMSCSS::_('sectiontableheader'); ?> " nowrap='nowrap' style="white-space:nowrap"><?php echo _JLMS_HW_TBL_HEAD_DATE; ?> </<?php echo JLMSCSS::tableheadertag(); ?> > <<?php echo JLMSCSS::tableheadertag(); ?> class="<?php echo JLMSCSS::_('sectiontableheader'); ?> " nowrap='nowrap' style="white-space:nowrap"><?php echo _JLMS_HW_TBL_HEAD_ENDDATE; ?> </<?php echo JLMSCSS::tableheadertag(); ?> > <?php if ($JLMS_ACL->CheckPermissions('homework', 'manage')) { $hw_colspan++; ?> <<?php echo JLMSCSS::tableheadertag(); ?> class="<?php echo JLMSCSS::_('sectiontableheader'); ?> " nowrap='nowrap' style="white-space:nowrap"> </<?php echo JLMSCSS::tableheadertag(); ?> > <?php } ?> <<?php echo JLMSCSS::tableheadertag(); ?> class="<?php echo JLMSCSS::_('sectiontableheader'); ?> " width="50%"><?php echo _JLMS_HW_TBL_HEAD_DESCR; ?> </<?php echo JLMSCSS::tableheadertag(); ?> > </tr> <?php $k = 1; for ($i = 0, $n = count($rows); $i < $n; $i++) { $row = $rows[$i]; $link = "index.php?option={$option}&Itemid={$Itemid}&task=hw_stats&course_id={$id}&id={$row->id}"; $alt = $row->published ? _JLMS_STATUS_PUB : _JLMS_STATUS_UNPUB; $image = $row->published ? 'btn_accept.png' : 'btn_cancel.png'; $state = $row->published ? 0 : 1; $tooltip_txt = ''; $tooltip_title = ''; if ($row->is_time_related) { if ($row->published) { $image = 'btn_publish_wait.png'; $tooltip_title = _JLMS_STATUS_PUB; } else { $image = 'btn_unpublish_wait.png'; $tooltip_title = _JLMS_STATUS_UNPUB; } $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 = ''; if ($JLMS_ACL->CheckPermissions('homework', 'manage')) { $checked = mosHTML::idBox($i, $row->id, $row->checkedout); } ?> <tr class="<?php echo JLMSCSS::_('sectiontableentry' . $k); ?> "> <td align="center"><?php echo $pageNav->limitstart + $i + 1; ?> </td> <?php if ($JLMS_ACL->CheckPermissions('homework', 'manage')) { echo '<td>' . $checked . '</td>'; } ?> <td align="left" valign="middle" style="vertical-align:middle "> <a href="<?php echo sefRelToAbs($link); ?> " title="<?php echo str_replace('"', ' ', $row->hw_name); ?> "> <?php echo $row->hw_name; ?> </a> </td> <td valign="middle" style="vertical-align:middle" nowrap="nowrap"> <?php echo JLMS_dateToDisplay($row->post_date); ?> </td> <td valign="middle" style="vertical-align:middle" nowrap="nowrap"> <?php echo JLMS_dateToDisplay($row->end_date); ?> </td> <?php if ($JLMS_ACL->CheckPermissions('homework', 'manage')) { ?> <td valign="middle"> <?php if ($row->is_time_related) { $tooltip_link = 'javascript:submitbutton_change2(\'hw_publish\',' . $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($tooltip_title, $tooltip_txt, $tooltip_name, $tooltip_link); } else { echo '<a class="jlms_img_link" href="javascript:submitbutton_change2(\'hw_publish\',' . $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 } ?> <td valign="middle" style="vertical-align:middle "><?php echo $row->hw_shortdescription ? $row->hw_shortdescription : ' '; ?> </td> </tr> <?php $k = 3 - $k; } ?> <tr> <td align="center" class="<?php echo JLMSCSS::_('jlmslist-footer_td'); ?> " colspan="<?php echo $hw_colspan; ?> "><div align="center" style="white-space:nowrap;"> <?php $link = "index.php?option={$option}&Itemid={$Itemid}&task=homework&id={$id}"; echo _JLMS_PN_DISPLAY_NUM . $pageNav->getLimitBox($link) . ' ' . $pageNav->getPagesCounter(); echo '<br />'; echo $pageNav->writePagesLinks($link); ?> </div></td> </tr> </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="homework" /> <input type="hidden" name="boxchecked" value="0" /> <input type="hidden" name="id" value="<?php echo $id; ?> " /> <input type="hidden" name="state" value="0" /> <input type="hidden" name="cid2" value="0" /> </form> <?php JLMS_TMPL::CloseTS(); if ($id && $JLMS_ACL->CheckPermissions('homework', 'manage')) { $link_new = sefRelToAbs("index.php?option={$option}&Itemid={$Itemid}&task=hw_create&id={$id}"); $controls = array(); $controls[] = array('href' => $link_new, 'onclick' => "", 'title' => _JLMS_HW_IMG_NEW_HW, 'img' => 'add'); $controls[] = array('href' => "javascript:submitbutton('hw_delete');", 'title' => _JLMS_HW_IMG_DEL_HW, 'img' => 'delete'); $controls[] = array('href' => "javascript:submitbutton('hw_edit');", 'title' => _JLMS_HW_IMG_EDIT_HW, 'img' => 'edit'); JLMS_TMPL::ShowControlsFooter($controls); } JLMS_TMPL::CloseMT(); }
function view_preDeletePage(&$rows, $id, $option) { global $Itemid; ?> <script language="javascript" type="text/javascript"> <!-- function submitbutton(pressbutton) { var form = document.adminForm; if ((pressbutton == 'course_delete_yes') && (form.boxchecked.value == "0")){ alert( "<?php echo _JLMS_ALERT_SELECT_ITEM; ?> " ); } else { form.task.value = pressbutton; form.submit(); } } //--> </script> <?php JLMS_TMPL::OpenMT(); $params = array('show_menu' => false, 'sys_msg' => _JLMS_COURSES_DEL_ALERT_MESSAGE, 'toolbar_position' => 'center'); $toolbar = array(); $toolbar[] = array('btn_type' => 'yes', 'btn_js' => "javascript:submitbutton('course_delete_yes');"); $toolbar[] = array('btn_type' => 'cancel', 'btn_js' => "javascript:submitbutton('cancel_course');"); JLMS_TMPL::ShowHeader('course', _JLMS_COURSES_TITLE_DEL_COURSE, $params, $toolbar); JLMS_TMPL::OpenTS(); ?> <br /> <form action="<?php echo sefRelToAbs("index.php?option=" . $option . "&Itemid=" . $Itemid); ?> " method="post" name="adminForm"> <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 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 JLMSCSS::tableheadertag(); ?> > <<?php echo JLMSCSS::tableheadertag(); ?> class="<?php echo JLMSCSS::_('sectiontableheader'); ?> "><?php echo _JLMS_COURSES_TBL_HEAD_NAME; ?> </<?php echo JLMSCSS::tableheadertag(); ?> > </tr> <?php $k = 1; for ($i = 0, $n = count($rows); $i < $n; $i++) { $row = $rows[$i]; $checked = JLMS_course_html::idBox($i, $row->id, true); ?> <tr class="<?php echo JLMSCSS::_('sectiontableentry' . $k); ?> "> <td align="center"><?php echo $i + 1; ?> </td> <td><?php echo $checked; ?> </td> <td align="left"> <?php echo $row->course_name; ?> </td> </tr> <?php $k = 3 - $k; } ?> </table> <input type="hidden" name="option" value="<?php echo $option; ?> " /> <input type="hidden" name="Itemid" value="<?php echo $Itemid; ?> " /> <input type="hidden" name="task" value="delete_course" /> <input type="hidden" name="id" value="<?php echo $id; ?> " /> <input type="hidden" name="boxchecked" value="<?php echo count($rows); ?> " /> </form> <?php JLMS_TMPL::CloseTS(); JLMS_TMPL::CloseMT(); }
function showChat($course_id, $group_id, $option, $lists, $chat_users) { global $Itemid, $JLMS_CONFIG; $additon_js = ' var Chat_scroll_obj; function jlms_prepare_el_Chat_scroll_obj() { var Chat_scroll_obj = new Fx.Scroll(\'jlms_chat_window\', { wait: false, duration: 0, offset: {\'x\': 0, \'y\': 0} }); Chat_scroll_obj.toBottom(); } '; $JLMS_CONFIG->set('jlms_aditional_js_code', $JLMS_CONFIG->get('jlms_aditional_js_code', '') . $additon_js); $domready = ' jlms_prepare_el_Chat_scroll_obj(); '; $JLMS_CONFIG->set('web20_domready_code', $JLMS_CONFIG->get('web20_domready_code', '') . $domready); ?> <script language="javascript" type="text/javascript"> <!-- var timer_msec = 4000; var block_chat = 0; var chat_last_msg = 0; var ste_k = 2; var tID = ''; var url_prefix = '<?php echo "index.php?tmpl=component&option={$option}&Itemid={$Itemid}&id={$course_id}&group_id={$group_id}"; ?> '; function jlms_MakeRequest(url) { var http_request = false; if (window.ActiveXObject) { // IE try { http_request = new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) { try { http_request = new ActiveXObject("Microsoft.XMLHTTP"); } catch (e) {} } } else if (window.XMLHttpRequest) { // Mozilla, Safari,... http_request = new XMLHttpRequest(); if (http_request.overrideMimeType) { http_request.overrideMimeType('text/xml'); } } if (!http_request) { return false; } http_request.onreadystatechange = function() { if (window.jlms_AnalizeRequest) {jlms_AnalizeRequest(http_request);} }; http_request.open('POST', url_prefix, true); http_request.setRequestHeader("Content-type", "application/x-www-form-urlencoded"); http_request.setRequestHeader("Content-length", url.length); http_request.send(url); } function jlms_AnalizeRequest(http_request) { if (http_request.readyState == 4) { if ((http_request.status == 200)) { block_chat = 0; if(http_request.responseXML.documentElement == null){ try { http_request.responseXML.loadXML(http_request.responseText) } catch (e) { /*alert("Can't load");*/ } } response = http_request.responseXML.documentElement; var task = response.getElementsByTagName('task')[0].firstChild.data; switch (task) { case 'chat_xml': //var response_chat = response.getElementsByTagName('chat_history')[0].firstChild.data; var response_users = response.getElementsByTagName('chat_users')[0].firstChild.data; var chat_last_id = response.getElementsByTagName('chat_last_id')[0].firstChild.data; if (parseInt(chat_last_id)) { chat_last_msg = parseInt(chat_last_id); } //var response_do_scroll = response.getElementsByTagName('do_scroll')[0].firstChild.data; /*getObj('JLMS_chat_history').innerHTML = response_chat; getObj('JLMS_chat_users').innerHTML = response_users; if (response_do_scroll == 1 || response_do_scroll == '1') { if ($defined(Chat_scroll_obj)) { var type = typeof Chat_scroll_obj; if (type == 'object') { Chat_scroll_obj.toBottom(); } else { jlms_prepare_el_Chat_scroll_obj(); } } else { jlms_prepare_el_Chat_scroll_obj(); } }*/ var count_new_mess = response.getElementsByTagName('count_new_msgs')[0].firstChild.data; if(parseInt(count_new_mess)){ count_new_mess = parseInt(count_new_mess); var el_history = getObj('jlms_chathistory'); for(var j=1;j < (count_new_mess + 1);j++){ var message = response.getElementsByTagName('chat_message_'+j)[0].firstChild.data; var tbody = new Array(); tbody = el_history.childNodes; for(var i=0;i < tbody.length;i++){ if(tbody[i].tagName == "TBODY"){ var el_tbody = tbody[i]; } } var tr_111 = document.createElement("tr"); var td_111 = document.createElement("td"); td_111.innerHTML = message; tr_111.appendChild(td_111); tr_111.className = 'sectiontableentry'+ste_k; ste_k = 3 - ste_k; el_tbody.appendChild(tr_111); } /*var scroll_y = parseInt(el_history.offsetHeight); document.getElementById("jlms_chat_window").scrollTop = scroll_y;*/ if ($defined(Chat_scroll_obj)) { var type = typeof Chat_scroll_obj; if (type == 'object') { Chat_scroll_obj.toBottom(); } else { jlms_prepare_el_Chat_scroll_obj(); } } else { jlms_prepare_el_Chat_scroll_obj(); } } clearTimeout(tID); tID = setTimeout("jlms_RequestChatHistory()", timer_msec); break; } } else { } } } function ctrlenter(e){ $('chat_new_mes').onkeypress = function(event){ var event = new Event(event); if ( ((window.opera || window.gecko) && event.code == '13' && event.control) || ((window.ie || window.webkit) && event.code == '10' && event.control) ){ jlms_chatPostMessage(); } } } function jlms_RequestChatHistory() { jlms_MakeRequest('task=get_chat_xml&last_msg='+chat_last_msg); } function TRIM_str(sStr) { return (sStr.replace(/^[\s\xA0]+/, "").replace(/[\s\xA0]+$/, "")); } function URLencode(sStr) { return escape(sStr).replace(/\+/g, '%2B').replace(/\"/g,'%22').replace(/\'/g, '%27').replace(/\//g,'%2F'); } function jlms_chatPostMessage() { if (block_chat != 1) { clearTimeout(tID); var form = document.chatMesForm; var user_message = form.chat_new_mes.value; if (user_message != '') { form.chat_new_mes.value = ''; if (TRIM_str(user_message) != '') { block_chat = 1; jlms_MakeRequest('task=chat_post&last_msg='+chat_last_msg+'&message='+URLencode(TRIM_str(user_message))); } } } } //--> </script> <?php JLMS_TMPL::OpenMT(); $hparams = array(); JLMS_TMPL::ShowHeader('chat', _JLMS_CHAT_TITLE, $hparams); JLMS_TMPL::OpenTS(); ?> <noscript> <div class="joomlalms_sys_message"> <?php echo _JLMS_JS_COOKIES_REQUIRES; ?> </div> </noscript> <table cellpadding="0" cellspacing="0" border="0" width="100%" class="jlms_table_no_borders"> <tr> <td colspan="2" align="right" style="text-align:right "> <form action="<?php echo sefRelToAbs("index.php?option={$option}&Itemid={$Itemid}"); ?> " method="post" name="chatForm"> <?php echo $lists['course_chats']; ?> <input type="hidden" name="option" value="<?php echo $option; ?> " /> <input type="hidden" name="Itemid" value="<?php echo $Itemid; ?> " /> <input type="hidden" name="task" value="chat" /> <input type="hidden" name="id" value="<?php echo $course_id; ?> " /> </form> </td> </tr> </table> <div style="width:100%; height:400px; overflow:auto; overflow-x:hidden;" id="jlms_chat_window"> <table cellpadding="0" cellspacing="1" border="0" width="100%" class="<?php echo JLMSCSS::_('jlmslist'); ?> "> <tr> <<?php echo JLMSCSS::tableheadertag(); ?> class="<?php echo JLMSCSS::_('sectiontableheader'); ?> " width="70%"><?php echo _JLMS_CHAT_TBL_HEAD_CHAT; ?> </<?php echo JLMSCSS::tableheadertag(); ?> > <<?php echo JLMSCSS::tableheadertag(); ?> class="<?php echo JLMSCSS::_('sectiontableheader'); ?> " width="30%"><?php echo _JLMS_CHAT_TBL_HEAD_USERS; ?> </<?php echo JLMSCSS::tableheadertag(); ?> > </tr> <tr> <td id="JLMS_chat_history" valign="top" align="left" style="text-align:left;padding:0px;margin:0px;" width="70%"> <table width="100%" cellpadding="0" cellspacing="0" border="0" id="jlms_chathistory" class="<?php echo JLMSCSS::_('jlmslist'); ?> " style="margin:0px; padding:0px;"> <tr class="<?php echo JLMSCSS::_('sectiontableentry1'); ?> "><td align="left"><?php echo _JLMS_CHAT_WELCOME_MESSAGE; ?> </td></tr> </table> </td> <td id="JLMS_chat_users" valign="top" align="left" style="text-align:left;padding:0px;margin:0px;" width="30%"> <?php echo JLMS_chat_html::prepareUserList($chat_users); ?> </td> </tr> </table> </div> <table cellpadding="0" cellspacing="0" border="0" width="100%" class="jlms_table_no_borders"> <tr> <td> <form action="<?php echo sefRelToAbs("index.php?option={$option}&Itemid={$Itemid}"); ?> " onsubmit="jlms_chatPostMessage();return false;" method="get" name="chatMesForm"> <table cellpadding="0" cellspacing="0" border="0" width="100%" class="jlms_table_no_borders"> <tr> <td align="left" width="90%"> <textarea id="chat_new_mes" name="chat_new_mes" class="inputbox" cols="65" rows="3" style="width:99%; overflow-y:auto; border: 1px solid rgb(198, 198, 198);" onkeypress="ctrlenter(this);"></textarea> </td> <td align="left" style="padding-left:20px; width:64px;"> <img class="JLMS_png" src="<?php echo $JLMS_CONFIG->get('live_site'); ?> /components/<?php echo $option; ?> /lms_images/send_post_chat.png" border="0" alt="<?php echo _JLMS_CHAT_BTN_POST; ?> " title="<?php echo _JLMS_CHAT_BTN_POST; ?> " onclick="jlms_chatPostMessage();" style="cursor:pointer;"/> </td> </tr> </table> </form> </td> </tr> </table> <script language="javascript" type="text/javascript"> <!-- tID = setTimeout("jlms_RequestChatHistory()", timer_msec); //--> </script> <?php JLMS_TMPL::CloseTS(); JLMS_TMPL::CloseMT(); }
function showCourseDropBox($course_id, $option, &$rows, &$lists) { global $Itemid, $my, $JLMS_CONFIG; ?> <script language="javascript" type="text/javascript"> <!--//--><![CDATA[//><!-- function submitbutton(pressbutton) { var form = document.adminForm; if ((pressbutton == 'del_dropbox') && (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_dropbox'){ if (form.boxchecked.value == '0') { alert('<?php echo _JLMS_DROP_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_dropbox'){ 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('dropbox', _JLMS_DROP_TITLE, $hparams); JLMS_TMPL::OpenTS(); ?> <form action="<?php echo sefRelToAbs("index.php?option=" . $option . "&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(); ?> colspan="8" class="<?php echo JLMSCSS::_('sectiontableheader'); ?> "> <table width="100%" cellpadding="0" cellspacing="0" border="0"> <tr> <td width="50%" align="center"> <?php echo _JLMS_DROP_INBOX . ' ' . $lists['dropbox_in_new'] . ' / ' . $lists['dropbox_in_total']; ?> </td> <td width="50%" align="center"> <?php echo _JLMS_DROP_OUTBOX . ' ' . $lists['dropbox_out_total']; ?> </td> </tr> </table> </<?php echo JLMSCSS::tableheadertag(); ?> > </tr> <tr> <<?php echo JLMSCSS::tableheadertag(); ?> width="20" class="<?php echo JLMSCSS::_('sectiontableheader'); ?> " align="center">#</<?php echo JLMSCSS::tableheadertag(); ?> > <<?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 JLMSCSS::tableheadertag(); ?> > <<?php echo JLMSCSS::tableheadertag(); ?> class="<?php echo JLMSCSS::_('sectiontableheader'); ?> " width="16"> </<?php echo JLMSCSS::tableheadertag(); ?> > <<?php echo JLMSCSS::tableheadertag(); ?> class="<?php echo JLMSCSS::_('sectiontableheader'); ?> "><?php echo _JLMS_DROP_TBL_HEAD_NAME; ?> </<?php echo JLMSCSS::tableheadertag(); ?> > <<?php echo JLMSCSS::tableheadertag(); ?> class="<?php echo JLMSCSS::_('sectiontableheader'); ?> "><?php echo _JLMS_DROP_TBL_HEAD_FROM; ?> </<?php echo JLMSCSS::tableheadertag(); ?> > <<?php echo JLMSCSS::tableheadertag(); ?> class="<?php echo JLMSCSS::_('sectiontableheader'); ?> "><?php echo _JLMS_DROP_TBL_HEAD_TO; ?> </<?php echo JLMSCSS::tableheadertag(); ?> > <<?php echo JLMSCSS::tableheadertag(); ?> class="<?php echo JLMSCSS::_('sectiontableheader'); ?> "><?php echo _JLMS_DROP_TBL_HEAD_CORRECTED; ?> </<?php echo JLMSCSS::tableheadertag(); ?> > <<?php echo JLMSCSS::tableheadertag(); ?> class="<?php echo JLMSCSS::_('sectiontableheader'); ?> "><?php echo _JLMS_DROP_TBL_HEAD_DESCR; ?> </<?php echo JLMSCSS::tableheadertag(); ?> > </tr> <?php $k = 1; for ($i = 0, $n = count($rows); $i < $n; $i++) { $row = $rows[$i]; $link = sefRelToAbs("index.php?option=" . $option . "&Itemid=" . $Itemid . "&task=get_frombox&course_id=" . $course_id . "&id=" . $row->id); $checked = mosHTML::idBox($i, $row->id); $mark_read = 1; if ($row->drp_mark == 1 && $row->recv_id == $my->id) { $mark_read = 0; } if ($mark_read) { $alt = _JLMS_DROP_STATUS_READ; $image = 'btn_drp_readed.png'; $state = 1; } else { $alt = _JLMS_DROP_STATUS_UNREAD; $image = 'btn_drp_unreaded.png'; $state = 0; } $state = 0; // 23.11.2006 - Bjarne request #if ($row->drp_mark == 1) { $alt = _JLMS_DROP_STATUS_READ; } elseif ($row->drp_mark == 2) { $alt = _JLMS_DROP_STATUS_CORRECT; } else { $alt = _JLMS_DROP_STATUS_UNREAD; } #if ($row->drp_mark == 1) { $image = 'btn_drp_readed.png'; } elseif ($row->drp_mark == 2) { $image = 'btn_drp_corrected.png'; } else { $image = 'btn_drp_unreaded.png'; } #if ($row->drp_mark == 1) { $state = 2; } elseif ($row->drp_mark == 2) { $state = 0; } else { $state = 1; } ?> <tr class="<?php echo JLMSCSS::_('sectiontableentry' . $k); ?> "> <td align="center" valign="middle"><?php echo $i + 1; ?> </td> <td align="center" valign="middle"><?php echo $checked; ?> </td> <td align="center" valign="middle"> <?php echo '<a class="jlms_img_link" href="javascript:submitbutton_change2(\'change_dropbox\',' . $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> <td align="left" valign="middle"> <?php if (!$mark_read) { echo '<strong>'; } ?> <a href="<?php echo $link; ?> " title="<?php echo str_replace('"', '"', $row->drp_name); ?> "> <?php echo $row->drp_name; ?> </a> <?php if (!$mark_read) { echo '</strong>'; } ?> </td> <td valign="middle"><?php echo $row->owner_username; ?> </td> <td valign="middle"><?php echo $row->recv_username; ?> </td> <td valign="middle"><?php if ($row->drp_corrected) { ?> <img class="JLMS_png" src="<?php echo $JLMS_CONFIG->get('live_site'); ?> /components/com_joomla_lms/lms_images/toolbar/btn_accept.png" width="16" height="16" alt="<?php echo _JLMS_DROP_STATUS_CORRECT; ?> " title="<?php echo _JLMS_DROP_STATUS_CORRECT; ?> " border="0" /> <?php } else { echo ' '; } ?> </td> <td valign="middle"><?php $drp_descr = strip_tags($row->drp_description); if (strlen($drp_descr) > 100) { $link_drp_descr = sefrelToAbs("index.php?option={$option}&Itemid={$Itemid}&task=drp_view_descr&course_id={$course_id}&id={$row->id}"); $drp_descr = substr($drp_descr, 0, 100) . "... <a title='" . _JLMS_DROP_LINK_FULL_DESCR . "' href='" . $link_drp_descr . "'>" . _JLMS_DROP_LINK_MORE_TEXT . "</a>"; } echo $drp_descr ? $drp_descr : ' '; ?> </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="dropbox" /> <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(); $link_new = "index.php?option=" . $option . "&Itemid=" . $Itemid . "&task=new_dropbox&id=" . $course_id; $controls = array(); $controls[] = array('href' => "javascript:submitbutton_change('change_dropbox',0);", 'title' => _JLMS_DROP_SET_READ, 'img' => 'letter'); // $controls[] = array('href' => ampReplace(sefRelToAbs($link_new)), 'title' => _JLMS_DROP_NEW_ITEM, 'img' => 'add'); $controls[] = array('href' => "javascript:submitbutton('new_dropbox');", 'title' => _JLMS_DROP_NEW_ITEM, 'img' => 'add'); $controls[] = array('href' => "javascript:submitbutton('del_dropbox');", 'title' => _JLMS_DROP_DEL_ITEM, 'img' => 'delete'); 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 . "&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;"> </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"> </<?php echo JLMSCSS::tableheadertag(); ?> > <<?php echo JLMSCSS::tableheadertag(); ?> class="<?php echo JLMSCSS::_('sectiontableheader'); ?> " width="1"> </<?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 . "&Itemid=" . $Itemid . "&task=docs_view_zip&id=" . $row->id); $link_title = _JLMS_T_A_VIEW_ZIP_PACK; } elseif (!$row->folder_flag && $row->file_id) { $link = sefRelToAbs("index.php?option=" . $option . "&Itemid=" . $Itemid . "&task=get_outdoc&id=" . $row->id); $link_title = _JLMS_DOCS_LINK_DOWNLOAD; } elseif (!$row->folder_flag && !$row->file_id) { $link = sefRelToAbs("index.php?option=" . $option . "&Itemid=" . $Itemid . "&task=outdocs_view_content&id=" . $row->id); $link_title = _JLMS_T_A_VIEW_CONTENT; } elseif ($row->folder_flag == 3 && $row->file_id) { $link = sefRelToAbs("index.php?option=" . $option . "&Itemid=" . $Itemid . "&task=playerSCORMFiles&id=" . $row->file_id . "&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 ' <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('"', '"', $row->doc_name); ?> "> <?php } ?> <?php } ?> <?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 . " " . $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 ' '; } ?> </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 ' '; } ?> </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 ' '; } ?> </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 : ' '; ?> </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}&Itemid={$Itemid}&task=new_outfolder")); $link_filenew = ampReplace(sefRelToAbs("index.php?option={$option}&Itemid={$Itemid}&task=new_outdocs")); $link_scormnew = ampReplace(sefRelToAbs("index.php?option={$option}&Itemid={$Itemid}&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 showUserGradebook($id, $option, &$rows, &$lists) { global $Itemid, $JLMS_CONFIG; $juser = JLMSFactory::getUser(); $JLMS_ACL =& JLMSFactory::getACL(); if ($JLMS_ACL->CheckPermissions('gradebook', 'manage')) { ?> <script language="javascript" type="text/javascript"> <!-- function submitbutton(pressbutton) { var form = document.adminForm; form.task.value = pressbutton; form.submit(); } function submitbutton_crtf(pressbutton, state, cid_id) { var form = document.adminForm; if (pressbutton == 'gb_crtA'){ form.task.value = pressbutton; form.state.value = state; form.cid2.value = cid_id; form.submit(); } } //--> </script> <?php } ?> <?php echo '<table class="contentpane" id="joomlalms_usergradebook" style="width:100%" cellpadding="0" cellspacing="0" border="0">' . "\r\n"; $hparams = array(); $toolbar = array(); if ($JLMS_ACL->CheckPermissions('gradebook', 'manage')) { if (count($lists['gb_rows'])) { $toolbar[] = array('btn_type' => 'save', 'btn_js' => "javascript:submitbutton('save_grades');"); } $toolbar[] = array('btn_type' => 'pdf', 'btn_js' => JLMSRoute::_("index.php?option={$option}&Itemid={$Itemid}&task=gb_user_pdf&course_id={$id}&id=" . $lists['user_id'])); $toolbar[] = array('btn_type' => 'back', 'btn_js' => sefRelToAbs("index.php?option={$option}&Itemid={$Itemid}&task=gradebook&id={$id}")); } else { $toolbar[] = array('btn_type' => 'pdf', 'btn_js' => JLMSRoute::_("index.php?option={$option}&Itemid={$Itemid}&task=gb_user_pdf&course_id={$id}&id=" . $lists['user_id'])); } JLMS_TMPL::ShowHeader('gradebook', _JLMS_GB_TITLE, $hparams, $toolbar); $userinfo = array(); $userinfo['text'] = JLMS_outputUserInfo($rows[0]->username, $rows[0]->name, $rows[0]->email, $rows[0]->ug_name, '20%'); $crtf_txt = array(); $crtf_txt['text'] = ''; $crtf_txt['attrib'] = ' nowrap="nowrap"'; if ($JLMS_ACL->CheckPermissions('gradebook', 'manage')) { $crtf_txt['text'] = '<table width="100%" cellpadding="0" cellspacing="0" border="0" class="jlms_table_no_borders"><tr><td width="30%" nowrap="nowrap">' . _JLMS_COURSE_COMPLETED_ADMIN . '</td>'; $crtf_txt['text'] .= '<td> '; $image = $rows[0]->user_certificate ? 'btn_accept.png' : 'btn_cancel.png'; $alt = $rows[0]->user_certificate ? _JLMS_GB_USER_HAVE_CRT : _JLMS_GB_USER_HAVE_NO_CRT; $state = $rows[0]->user_certificate ? 0 : 1; $crtf_txt['text'] .= '<a class="jlms_img_link" href="javascript:submitbutton_crtf(\'gb_crtA\',' . $state . ',' . $rows[0]->user_id . ')" title="' . $alt . '"><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 . '" /></a>'; $crtf_txt['text'] .= '</td></tr></table>'; } elseif ($JLMS_ACL->CheckPermissions('gradebook', 'view') && $rows[0]->user_certificate) { $crtf_txt['text'] = '<table width="100%" cellpadding="0" cellspacing="0" border="0" id="usergradebook_header_crtf_info" class="jlms_table_no_borders"><tr><td width="30%">' . ($juser->get('id') == $rows[0]->user_id ? _JLMS_COURSE_COMPLETED_USER : _JLMS_COURSE_COMPLETED_ADMIN) . '</td>'; $crtf_txt['text'] .= '<td> '; $image = $rows[0]->user_certificate ? 'btn_accept.png' : 'btn_cancel.png'; $alt = $rows[0]->user_certificate ? _JLMS_GB_USER_HAVE_CRT : _JLMS_GB_USER_HAVE_NO_CRT; $state = $rows[0]->user_certificate ? 0 : 1; $crtf_txt['text'] .= JLMS_gradebook_html::publishIcon($rows[0]->user_id, $id, $state, 'gb_crtA', $alt, $image, $option, ''); $crtf_txt['text'] .= '</td></tr></table>'; } $params_cs = array(); if ($JLMS_ACL->CheckPermissions('gradebook', 'manage') && !empty($lists['enrollment_answers'])) { JLMS_TMPL::OpenTS('', ' id="usergradebook_header"'); echo '<table width="100%" class="jlms_table_no_borders">'; echo '<tr><td width="50%" valign="top"><table width="100%" cellpadding="0" cellspacing="0" border="0" id="usergradebook_header_user_info" class="' . JLMSCSS::_('jlmslist') . '" style="margin:0px;padding:0px;">'; echo '<tr><' . JLMSCSS::tableheadertag() . ' class="' . JLMSCSS::_('sectiontableheader') . '" colspan="2">' . _JLMS_GB_USER_INFORMATION . '</' . JLMSCSS::tableheadertag() . '></tr>'; echo '<tr class="' . JLMSCSS::_('sectiontableentry1') . '"><td align="left">' . _JLMS_UI_USERNAME . '</td><td align="left">' . $rows[0]->username . '</td></tr>'; echo '<tr class="' . JLMSCSS::_('sectiontableentry2') . '"><td align="left">' . _JLMS_UI_NAME . '</td><td align="left">' . $rows[0]->name . '</td></tr>'; echo '<tr class="' . JLMSCSS::_('sectiontableentry1') . '"><td align="left">' . _JLMS_UI_EMAIL . '</td><td align="left">' . $rows[0]->email . '</td></tr>'; echo '<tr class="' . JLMSCSS::_('sectiontableentry2') . '"><td align="left">' . _JLMS_UI_GROUP . '</td><td align="left">' . ($rows[0]->ug_name ? $rows[0]->ug_name : ' ') . '</td></tr>'; echo '</table><br />'; echo $crtf_txt['text']; echo '</td><td width="50%" valign="top"><table width="100%" cellpadding="0" cellspacing="0" border="0" id="usergradebook_header_reg_info" class="' . JLMSCSS::_('jlmslist') . '" style="margin:0px;padding:0px;">'; echo '<tr><' . JLMSCSS::tableheadertag() . ' class="' . JLMSCSS::_('sectiontableheader') . '" colspan="2">' . _JLMS_GB_REG_INFORMATION . '</' . JLMSCSS::tableheadertag() . '></tr>'; $k = 1; foreach ($lists['enrollment_answers'] as $ea) { echo '<tr class="' . JLMSCSS::_('sectiontableentry' . $k) . '"><td>' . $ea->course_question . '</td><td>' . ($ea->user_answer ? $ea->user_answer : ' ') . '</td></tr>'; $k = 3 - $k; } echo '</table></td></tr>'; echo '</table>'; JLMS_TMPL::CloseTS(); } else { $params_cs[] = $userinfo; $params_cs[] = $crtf_txt; JLMS_TMPL::ShowCustomSection($params_cs); } /** * Certificates MOD - 04.10.2007 (DEN) * We will show the list of all achieved certificates in the User Gradebook */ global $JLMS_DB; $query = "SELECT count(*) FROM #__lms_certificates WHERE course_id = '" . $id . "' AND published = 1 AND crtf_type = 1 AND parent_id = 0"; $JLMS_DB->SetQuery($query); $is_course_certificate = $JLMS_DB->loadResult(); if (!empty($lists['user_quiz_certificates']) || isset($rows[0]->user_certificate) && $rows[0]->user_certificate && $is_course_certificate) { JLMS_TMPL::OpenTS('', ' id="usergradebook_certificates_title"'); echo '<br />'; echo JLMSCSS::h2(_JLMS_GB_CERTIFICATES); JLMS_TMPL::CloseTS(); JLMS_TMPL::OpenTS(); $old_format = $JLMS_CONFIG->get('date_format', 'Y-m-d'); $new_format = $JLMS_CONFIG->get('gradebook_certificate_date', ''); if ($new_format) { $JLMS_CONFIG->set('date_format', $new_format); } echo '<table class="' . JLMSCSS::_('jlmslist') . '" id="usergradebook_certificates" style="width:100%" cellpadding="0" cellspacing="0" border="0">' . "\r\n"; $k = 2; foreach ($lists['user_quiz_certificates'] as $crtf_row) { echo '<tr class="' . JLMSCSS::_('sectiontableentry' . $k) . '"><td width="16"><img class="JLMS_png" src="' . $JLMS_CONFIG->get('live_site') . '/components/com_joomla_lms/lms_images/toolbar/btn_certificate.png" alt="certificate" width="16" height="16" /></td><td width="30%" align="left"><strong>' . $crtf_row->quiz_name . '</strong></td>' . '<td>' . JLMS_offsetDateToDisplay($crtf_row->crtf_date) . '</td>' . '<td align=\'left\'>' . ($JLMS_ACL->CheckPermissions('gradebook', 'view') ? '<a target="_blank" href="' . ampReplace($JLMS_CONFIG->get('live_site') . "/index.php?tmpl=component&option={$option}&Itemid={$Itemid}&no_html=1&task=print_quiz_cert&course_id={$id}&stu_quiz_id={$crtf_row->stu_quiz_id}&user_unique_id={$crtf_row->user_unique_id}") . '">' . _JLMS_GB_PRINT_CERTIFICATE . '</a>' : '') . '</td></tr>'; $k = 3 - $k; } if (isset($rows[0]->user_certificate) && $rows[0]->user_certificate && $is_course_certificate) { $cert_user_id = 0; if (isset($lists['user_id']) && $lists['user_id']) { global $my; if ($my->id == $lists['user_id']) { } else { $cert_user_id = $lists['user_id']; } } $link = ampReplace(sefRelToAbs("index.php?option={$option}&Itemid={$Itemid}&task=gb_get_cert&id={$id}" . ($cert_user_id ? "&user_id={$cert_user_id}" : ''))); echo '<tr class="' . JLMSCSS::_('sectiontableentry' . $k) . '"><td width="16"><img class="JLMS_png" src="' . $JLMS_CONFIG->get('live_site') . '/components/com_joomla_lms/lms_images/toolbar/btn_certificate.png" alt="certificate" width="16" height="16" /></td><td width="30%" align="left"><strong>' . _JLMS_GB_COURSE_CERTIFICATE . '</strong></td>' . '<td>' . JLMS_offsetDateToDisplay($rows[0]->user_certificate_date) . '</td>' . '<td align=\'left\'>' . ($JLMS_ACL->CheckPermissions('gradebook', 'view') ? '<a target="_blank" href="' . $link . '">' . _JLMS_GB_PRINT_CERTIFICATE . '</a>' : ' ') . '</td></tr>'; } JLMS_TMPL::CloseMT(); JLMS_TMPL::CloseTS(); $JLMS_CONFIG->set('date_format', $old_format); } /* END of Certificates MOD */ if (count($lists['sc_rows'])) { $k = 2; $is_shown = 0; foreach ($lists['sc_rows'] as $sc_row) { if ($sc_row->show_in_gradebook) { $is_shown++; if ($is_shown == 1) { JLMS_TMPL::OpenTS('', ' id="usergradebook_scorms_title"'); echo '<br />'; echo JLMSCSS::h2(_JLMS_GB_SCORM_RESULTS); JLMS_TMPL::CloseTS(); JLMS_TMPL::OpenTS(); echo '<table class="' . JLMSCSS::_('jlmslist') . '" id="usergradebook_scorms" style="width:100%" cellpadding="0" cellspacing="0" border="0">' . "\r\n"; } $j = 0; while ($j < count($rows[0]->scorm_info)) { if ($rows[0]->scorm_info[$j]->gbi_id == $sc_row->item_id) { if ($rows[0]->scorm_info[$j]->user_status == -1) { echo '<tr class="' . JLMSCSS::_('sectiontableentry' . $k) . '"><td width="30%" align="left"><strong>' . $sc_row->lpath_name . '</strong></td>' . '<td align=\'left\' colspan="2">' . '-' . '</td></tr>'; $k = 3 - $k; } else { $image = $rows[0]->scorm_info[$j]->user_status ? 'btn_accept.png' : 'btn_cancel.png'; $alt = $rows[0]->scorm_info[$j]->user_status ? 'btn_accept' : 'btn_cancel'; $img = JLMS_gradebook_html::publishIcon(0, 0, 0, '', $alt, $image, $option, false); echo '<tr class="' . JLMSCSS::_('sectiontableentry' . $k) . '"><td width="30%" align="left"><strong>' . $sc_row->lpath_name . '</strong></td>' . '<td width="16">' . $img . '</td>' . '<td align=\'left\'>' . '<b>' . $rows[0]->scorm_info[$j]->user_grade . "</b> (" . $rows[0]->scorm_info[$j]->user_pts . _JLMS_GB_POINTS . ")" . '</td></tr>'; $k = 3 - $k; } } $j++; } } } if ($is_shown) { JLMS_TMPL::CloseMT(); JLMS_TMPL::CloseTS(); } } if (count($lists['quiz_rows'])) { JLMS_TMPL::OpenTS('', ' id="usergradebook_quizzes_title"'); echo '<br />'; echo JLMSCSS::h2(_JLMS_GB_QUIZ_RESULTS); JLMS_TMPL::CloseTS(); JLMS_TMPL::OpenTS(); /*Integration Plugin Percentiles*/ if (isset($lists['chart_percentiles']->show) && $lists['chart_percentiles']->show) { JLMS_TMPL::OpenTS(); echo $lists['chart_percentiles']->chart; JLMS_TMPL::CloseTS(); } /*Integration Plugin Percentiles*/ echo '<table class="' . JLMSCSS::_('jlmslist') . '" id="usergradebook_quizzes" style="width:100%" cellpadding="0" cellspacing="0" border="0">' . "\r\n"; $k = 2; foreach ($lists['quiz_rows'] as $quiz_row) { $j = 0; while ($j < count($rows[0]->quiz_info)) { if ($rows[0]->quiz_info[$j]->gbi_id == $quiz_row->c_id) { // if ($rows[0]->quiz_info[$j]->user_status == -1) { // echo '<tr class="'.JLMSCSS::_('sectiontableentry'.$k).'"><td width="30%" align="left"><strong>'.$quiz_row->c_title.'</strong></td>' // . '<td align=\'left\' colspan="2">' // . '-' // . '</td></tr>'; // $k = 3 - $k; // } else { // $image = $rows[0]->quiz_info[$j]->user_status ? 'btn_accept.png' : 'btn_cancel.png'; // $alt = $rows[0]->quiz_info[$j]->user_status ? 'btn_accept' : 'btn_cancel'; // $img = JLMS_gradebook_html::publishIcon(0, 0, 0, '', $alt, $image, $option, false ); echo '<tr class="' . JLMSCSS::_('sectiontableentry' . $k) . '"><td width="30%" align="left"><strong>' . $quiz_row->c_title . '</strong></td>'; //old functional // echo '<td width="16">'. $img.'</td>'; // echo '<td align=\'left\'>' // . '<b>' . $rows[0]->quiz_info[$j]->user_grade . "</b> (" . $rows[0]->quiz_info[$j]->user_pts_full .")"; // /*Integration Plugin Percentiles*/ // if (isset($rows[0]->quiz_info[$j]->user_percentile)) { // echo ' - '.$rows[0]->quiz_info[$j]->user_percentile; // } // /*Integration Plugin Percentiles*/ // echo '</td>'; //new functional echo '<td>'; echo JLMS_showQuizStatus($rows[0]->quiz_info[$j]); echo '</td>'; if (isset($rows[0]->quiz_info[$j]->user_unique_id)) { $show_print = false; if (isset($rows[0]->quiz_info[$j]->allow_user_pdf_print) && $rows[0]->quiz_info[$j]->allow_user_pdf_print) { $show_print = true; } elseif ($JLMS_ACL->CheckPermissions('gradebook', 'manage')) { $show_print = true; } elseif ($JLMS_ACL->isStaff()) { $show_print = true; } if ($show_print) { echo '' . '<td><a target="_blank" href="' . $JLMS_CONFIG->get('live_site') . '/index.php?tmpl=component&option=com_joomla_lms&Itemid=' . $Itemid . '&no_html=1&task=print_quiz_result&course_id=' . $quiz_row->course_id . '&stu_quiz_id=' . $rows[0]->quiz_info[$j]->stu_quiz_id . '&user_unique_id=' . $rows[0]->quiz_info[$j]->user_unique_id . '">' . _JLMS_PRINT_RESULTS . '</a></td>'; } else { echo '<td>'; echo ' '; echo '</td>'; } } else { echo '<td>'; echo ' '; echo '</td>'; } echo '</tr>'; $k = 3 - $k; // } } $j++; } } JLMS_TMPL::CloseMT(); JLMS_TMPL::CloseTS(); } if (count($lists['gb_rows'])) { JLMS_TMPL::OpenTS('', ' id="usergradebook_grades_title"'); echo '<br />'; echo JLMSCSS::h2(_JLMS_GB_GBI_RESULTS); JLMS_TMPL::CloseTS(); JLMS_TMPL::OpenTS(); ?> <form action="<?php echo sefRelToAbs("index.php?option={$option}&Itemid={$Itemid}"); ?> " method="post" name="adminForm"> <?php echo '<table class="' . JLMSCSS::_('jlmslist') . '" id="usergradebook_grades" style="width:100%" cellpadding="0" cellspacing="0" border="0">' . "\r\n"; $k = 2; foreach ($lists['gb_rows'] as $gb_row) { $j = 0; while ($j < count($rows[0]->grade_info)) { if ($rows[0]->grade_info[$j]->gbi_id == $gb_row->id) { echo '<tr class="' . JLMSCSS::_('sectiontableentry' . $k) . '"><td width="30%" align="left"><strong>' . $gb_row->gbi_name . '</strong></td>' . '<td align=\'left\' colspan="2">' . ($JLMS_ACL->CheckPermissions('gradebook', 'manage') ? JLMS_gradebook_html::Create_SelectList($id, $rows[0]->grade_info[$j]->scale_id, $gb_row->id) : $rows[0]->grade_info[$j]->user_grade); echo '</td></tr>'; $k = 3 - $k; } $j++; } } JLMS_TMPL::CloseMT(); ?> <input type="hidden" name="option" value="<?php echo $option; ?> " /> <input type="hidden" name="Itemid" value="<?php echo $Itemid; ?> " /> <input type="hidden" name="task" value="gradebook" /> <input type="hidden" name="state" value="0" /> <input type="hidden" name="cid2" value="0" /> <input type="hidden" name="boxchecked" value="0" /> <input type="hidden" name="id" value="<?php echo $id; ?> " /> <input type="hidden" name="user_id" value="<?php echo $lists['user_id']; ?> " /> </form> <?php JLMS_TMPL::CloseTS(); JLMS_TMPL::CloseMT(); } else { JLMS_TMPL::CloseMT(); ?> <form action="<?php echo sefRelToAbs("index.php?option={$option}&Itemid={$Itemid}"); ?> " method="post" name="adminForm"> <input type="hidden" name="option" value="<?php echo $option; ?> " /> <input type="hidden" name="Itemid" value="<?php echo $Itemid; ?> " /> <input type="hidden" name="task" value="gradebook" /> <input type="hidden" name="state" value="0" /> <input type="hidden" name="cid2" value="0" /> <input type="hidden" name="boxchecked" value="0" /> <input type="hidden" name="id" value="<?php echo $id; ?> " /> <input type="hidden" name="user_id" value="<?php echo $lists['user_id']; ?> " /> </form> <?php } ?> <?php }
function showTopicElements($course_id, $topic, $links, $elements, $span = 1) { global $option, $Itemid, $max_lvl, $JLMS_CONFIG; $usertype = $JLMS_CONFIG->get('current_usertype', 0); $date_format = $JLMS_CONFIG->get('date_format_fdow', 1); ob_start(); ?> <table border="0" cellpadding="0" cellspacing="0" width="100%" id="topic_<?php echo $topic->id; ?> _elements_table" class="<?php echo JLMSCSS::_('jlmslist'); ?> "> <tr> <<?php echo JLMSCSS::tableheadertag(); ?> class="<?php echo JLMSCSS::_('sectiontableheader'); ?> " style="width:1%;"><?php echo $usertype != 2 ? '#' : ' '; ?> </<?php echo JLMSCSS::tableheadertag(); ?> > <?php if ($usertype != 2) { ?> <<?php echo JLMSCSS::tableheadertag(); ?> class="<?php echo JLMSCSS::_('sectiontableheader'); ?> " style="width:1%;"><input type="checkbox" onclick="checkAll_mod(<?php echo count($links[$topic->id]); ?> , 'cb<?php echo $topic->id . '_'; ?> ', 'topicForm_<?php echo $topic->id; ?> ');" value="" name="toggle"/></<?php echo JLMSCSS::tableheadertag(); ?> ><?php } ?> <<?php echo JLMSCSS::tableheadertag(); ?> class="<?php echo JLMSCSS::_('sectiontableheader'); ?> " style="width:95%;" colspan="<?php echo $span + 1; ?> "><?php echo _JLMS_TOPIC_E_NAME; ?> </<?php echo JLMSCSS::tableheadertag(); ?> > <?php if ($usertype != 2) { ?> <<?php echo JLMSCSS::tableheadertag(); ?> class="<?php echo JLMSCSS::_('sectiontableheader'); ?> " colspan="3" align="center" style="width:1%;"><?php echo _JLMS_TOPIC_E_CONTROLS; ?> </<?php echo JLMSCSS::tableheadertag(); ?> ><?php } ?> <<?php echo JLMSCSS::tableheadertag(); ?> class="<?php echo JLMSCSS::_('sectiontableheader'); ?> " colspan="<?php echo $usertype != 2 ? 2 : 3; ?> " align="center" style="width:1%;"><?php echo _JLMS_TOPIC_E_DETAILS; ?> </<?php echo JLMSCSS::tableheadertag(); ?> > <<?php echo JLMSCSS::tableheadertag(); ?> class="<?php echo JLMSCSS::_('sectiontableheader'); ?> " style="width:1%;"><span style="display: block; width:150px;"><?php echo _JLMS_TOPIC_E_DESRIPTION; ?> </span></<?php echo JLMSCSS::tableheadertag(); ?> > </tr> <?php $i = 0; $vis_mode = 0; $k = 2; $displayed = 0; if ($count = count($links[$topic->id])) { //checks if there are elements in topic foreach ($links[$topic->id] as $link) { if (isset($link->item_type) && $link->item_type == _DOCUMENT_ID) { if (!isset($elements[_DOCUMENT_ID][$link->item_id])) { continue; } /* (23 July 2008) - added by DEN */ } // 01.12.2007 '$i' chenged to '$topic_id*1000+$i' by DEN - to avoid dublicate id's $iii = $topic->id . '_' . $i; $checked = '<input type="checkbox" id="cb' . $iii . '" name="cid[]" value="' . $link->id . '" onclick="isChecked_mod(this.checked, \'topicForm_' . $topic->id . '\');" />'; switch ($link->item_type) { case _DOCUMENT_ID: $elements[_DOCUMENT_ID][$link->item_id]->allow_up = $i > 0 ? 1 : 0; $elements[_DOCUMENT_ID][$link->item_id]->allow_down = $i < $count - 1 ? 1 : 0; $elements[_DOCUMENT_ID][$link->item_id]->show = $link->show; $elements[_DOCUMENT_ID][$link->item_id]->ordering = $link->ordering; $elements[_DOCUMENT_ID][$link->item_id]->link_id = $link->id; $publish_options = publishUtility($elements[_DOCUMENT_ID][$link->item_id]->published, $elements[_DOCUMENT_ID][$link->item_id]->show, $elements[_DOCUMENT_ID][$link->item_id]->publish_start, $elements[_DOCUMENT_ID][$link->item_id]->publish_end, $elements[_DOCUMENT_ID][$link->item_id]->start_date, $elements[_DOCUMENT_ID][$link->item_id]->end_date); if ($usertype == 2 && $publish_options->show * $publish_options->state == 0) { continue; } if (!$elements[_DOCUMENT_ID][$link->item_id]->folder_flag || $elements[_DOCUMENT_ID][$link->item_id]->folder_flag == 3 || $elements[_DOCUMENT_ID][$link->item_id]->folder_flag == 2) { JLMS_topic_html::showDocumentRow($k, $elements[_DOCUMENT_ID][$link->item_id], $i, $topic->id, $checked, 1, 0, $span); } else { showFolderWithContent($k, $elements[_DOCUMENT_ID][$link->item_id], $i, $topic->id, $checked, $span); } $displayed++; break; case _LINK_ID: $elements[_LINK_ID][$link->item_id]->allow_up = $i > 0 ? 1 : 0; $elements[_LINK_ID][$link->item_id]->allow_down = $i < $count - 1 ? 1 : 0; $elements[_LINK_ID][$link->item_id]->show = $link->show; $elements[_LINK_ID][$link->item_id]->ordering = $link->ordering; $elements[_LINK_ID][$link->item_id]->link_id = $link->id; if ($usertype == 2 && $elements[_LINK_ID][$link->item_id]->show * $elements[_LINK_ID][$link->item_id]->published == 0) { continue; } JLMS_topic_html::showLinkRow($k, $elements[_LINK_ID][$link->item_id], $i, $topic->id, $checked, 1, $span); $displayed++; break; case _QUIZ_ID: $elements[_QUIZ_ID][$link->item_id]->allow_up = $i > 0 ? 1 : 0; $elements[_QUIZ_ID][$link->item_id]->allow_down = $i < $count - 1 ? 1 : 0; $elements[_QUIZ_ID][$link->item_id]->show = $link->show; $elements[_QUIZ_ID][$link->item_id]->ordering = $link->ordering; $elements[_QUIZ_ID][$link->item_id]->link_id = $link->id; if ($usertype == 2 && $elements[_QUIZ_ID][$link->item_id]->show * $elements[_QUIZ_ID][$link->item_id]->published == 0) { continue; } JLMS_topic_html::showQuizRow($k, $elements[_QUIZ_ID][$link->item_id], $i, $topic->id, $checked, 1, $span); $displayed++; break; case _LPATH_ID: $elements[_LPATH_ID][$link->item_id]->allow_up = $i > 0 ? 1 : 0; $elements[_LPATH_ID][$link->item_id]->allow_down = $i < $count - 1 ? 1 : 0; $elements[_LPATH_ID][$link->item_id]->show = $link->show; $elements[_LPATH_ID][$link->item_id]->ordering = $link->ordering; $elements[_LPATH_ID][$link->item_id]->link_id = $link->id; if (isset($link->lpath_name)) { $elements[_LPATH_ID][$link->item_id]->lpath_name = $link->lpath_name; } if (isset($link->is_link)) { $elements[_LPATH_ID][$link->item_id]->is_link = $link->is_link; } // 01.12.2007 - (DEN) - esli v topike ni odin element ne 'shown' - vyletaet notice if (!isset($elements[_LPATH_ID][$link->item_id]->published)) { $elements[_LPATH_ID][$link->item_id]->published = 0; } if ($usertype == 2 && $elements[_LPATH_ID][$link->item_id]->show * $elements[_LPATH_ID][$link->item_id]->published == 0) { continue; } $displayed += JLMS_topic_html::showLPathRow($k, $elements[_LPATH_ID][$link->item_id], $i, $topic->id, $checked, 1, $span); break; } $i++; } } ?> </table> <?php if ($displayed == 0) { ?> <script type="text/javascript" language="javascript"> document.getElementById('topic_<?php echo $topic->id; ?> _elements_table').style.display='none'; </script> <?php } ?> <?php $return = ob_get_clean(); return $return; }
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}&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"> </<?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"> </<?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 : ' '; ?> </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('"', '"', $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('"', '"', $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 . " " . $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 : ' '; ?> </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}&Itemid={$Itemid}&task=pre_create_link&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 NewDocLink($doc_details, $lists, $id, $option, $cur_id) { $JLMS_CONFIG =& JLMSFactory::getConfig(); $Itemid = $JLMS_CONFIG->get('Itemid'); $rows_c = $lists['collapsed_folders']; $rows = $lists['out_files']; $is_dis_start = !($doc_details->publish_end == 1); $is_dis_end = !($doc_details->publish_end == 1); ?> <script language="javascript" type="text/javascript"> <!--//--><![CDATA[//><!-- window.addEvent('domready', function() { document.adminForm.startday.disabled = true; document.adminForm.startmonth.disabled = true; document.adminForm.startyear.disabled = true; document.adminForm.endday.disabled = true; document.adminForm.endmonth.disabled = true; document.adminForm.endyear.disabled = true; } ); function submitbutton(pressbutton) { var form=document.adminForm; if (is_start_c == 1) {if (form.start_date.value == ''){jlms_getDate('start');}} if (is_end_c == 1) {if (form.end_date.value == ''){jlms_getDate('end');}} form.task.value = pressbutton;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 = '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 = '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 ++; } } var is_start_c = <?php echo $doc_details->publish_start ? '1' : '0'; ?> ; var is_end_c = <?php echo $doc_details->publish_end ? '1' : '0'; ?> ; function jlms_Change_start() { var form=document.adminForm; if (is_start_c == 1) { is_start_c = 0 form.startday.disabled = true; form.startmonth.disabled = true; form.startyear.disabled = true; } else { is_start_c = 1 form.startday.disabled = false; form.startmonth.disabled = false; form.startyear.disabled = false; } } function jlms_Change_end() { var form=document.adminForm; if (is_end_c == 1) { is_end_c = 0 form.endday.disabled = true; form.endmonth.disabled = true; form.endyear.disabled = true; } else { is_end_c = 1 form.endday.disabled = false; form.endmonth.disabled = false; form.endyear.disabled = false; } } //--><!]]> </script> <?php JLMS_TMPL::OpenMT(); $hparams = array(); $toolbar = array(); $title = ''; $title = $doc_details->id ? _JLMS_DOCS_TITLE_EDIT_DOC : _JLMS_DOCS_TITLE_NEW_DOC; $toolbar[] = array('btn_type' => 'save', 'btn_js' => "javascript:submitbutton('save_doclink');"); $toolbar[] = array('btn_type' => 'cancel', 'btn_js' => "javascript:submitbutton('cancel_doc');"); if (!empty($rows)) { JLMS_TMPL::ShowHeader('doc', $title, $hparams, $toolbar); } JLMS_TMPL::OpenTS(); ?> <form action="<?php echo sefRelToAbs("index.php?option=" . $option . "&Itemid=" . $Itemid); ?> " method="post" name="adminForm" enctype="multipart/form-data"> <?php $max_tree_width = 0; if (isset($rows[0])) { $max_tree_width = $rows[0]->tree_max_width; } 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 echo JLMSCSS::tableheadertag(); ?> width="16" class="<?php echo JLMSCSS::_('sectiontableheader'); ?> "><input type="checkbox" value="0" name="hidden_box" style="visibility:hidden" /></<?php echo JLMSCSS::tableheadertag(); ?> > <?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;"> </span></<?php echo JLMSCSS::tableheadertag(); ?> > <?php } ?> <<?php echo JLMSCSS::tableheadertag(); ?> class="<?php echo JLMSCSS::_('sectiontableheader'); ?> " width="45%"><span style="display: block; width: 200px; text-align: left;"><?php echo _JLMS_DOCS_TBL_DOCNAME; ?> </span></<?php echo JLMSCSS::tableheadertag(); ?> > <<?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 . "&Itemid=" . $Itemid . "&task=docs_view_zip&course_id=" . $id . "&id=" . $row->id); $link_title = _JLMS_T_A_VIEW_ZIP_PACK; } elseif ((!$row->folder_flag || $row->folder_flag == 3) && $row->file_id) { $link = sefRelToAbs("index.php?option=" . $option . "&Itemid=" . $Itemid . "&task=get_document&course_id=" . $id . "&id=" . $row->id); $link_title = _JLMS_DOCS_LINK_DOWNLOAD; } elseif ((!$row->folder_flag || $row->folder_flag == 3) && !$row->file_id) { $link = sefRelToAbs("index.php?option=" . $option . "&Itemid=" . $Itemid . "&task=docs_view_content&course_id=" . $id . "&id=" . $row->id); $link_title = _JLMS_T_A_VIEW_CONTENT; } // 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; } } $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 ($row->folder_flag != 1) { 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 ' <strong>' . $row->doc_name . '</strong>'; } else { ?> <a href="<?php echo $link; ?> " title="<?php echo $link_title; ?> "> <?php echo $row->doc_name; ?> </a> <?php } ?> </span> </td> <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 : ' '; ?> </td> </tr> <?php $k = 3 - $k; } ?> </table> <table width="100%" cellpadding="0" cellspacing="0" border="0" class="jlms_item_properties"> <tr> <td valign="middle" style="vertical-align:middle"><br /><?php echo _JLMS_PLACE_IN; ?> </td> <td><br /><?php echo $lists['course_folders']; ?> </td> </tr> <tr> <td valign="middle" style="vertical-align:middle"><br /><?php echo _JLMS_PUBLISHING; ?> </td> <td><br /><?php echo $lists['publishing']; ?> </td> </tr> <tr> <td valign="middle"><br /><?php echo _JLMS_START_DATE; ?> </td> <td valign="middle" style="vertical-align:middle "><br /> <table cellpadding="0" cellspacing="0" border="0" class="jlms_date_outer"><tr><td valign="middle"><input type="checkbox" value="1" name="is_start" onclick="jlms_Change_start()" <?php echo $doc_details->publish_start ? 'checked' : ''; ?> /></td> <td valign="middle" style="vertical-align:middle "> <?php $s_date = $is_dis_start ? date('Y-m-d') : $doc_details->start_date; echo JLMS_HTML::_('calendar.calendar', $s_date, 'start', 'start'); ?> </td></tr></table> </td> </tr> <tr> <td><br /><?php echo _JLMS_END_DATE; ?> </td> <td valign="middle" style="vertical-align:middle "><br /> <table cellpadding="0" cellspacing="0" border="0" class="jlms_date_outer"><tr><td valign="middle"><input type="checkbox" value="1" name="is_end" onclick="jlms_Change_end()" <?php echo $doc_details->publish_end ? 'checked="checked"' : ''; ?> /></td> <td valign="middle" style="vertical-align:middle "> <?php $e_date = $is_dis_end ? date('Y-m-d') : $doc_details->end_date; echo JLMS_HTML::_('calendar.calendar', $e_date, 'end', 'end'); ?> </td></tr></table> </td> </tr> </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="update_document" /> <input type="hidden" name="boxchecked" value="0" /> <input type="hidden" name="course_id" value="<?php echo $id; ?> " /> <input type="hidden" name="folder_flag" value="0" /> <input type="hidden" name="id" value="<?php echo $doc_details->id; ?> " /> </form> <?php JLMS_TMPL::CloseTS(); JLMS_TMPL::CloseMT(); }
function ShowCart($option, &$subscriptions, &$lists, $procs = array()) { global $Itemid, $JLMS_CONFIG, $JLMS_SESSION, $JLMS_DB, $my; $jlms_tax_counting = $JLMS_CONFIG->get('enabletax'); $sub_total = 0; $tax_amount = 0; $rows2 = array(); $custom_code = ''; $discounts = array(); $app =& JFactory::getApplication(); $coupon_code = $app->getUserStateFromRequest('com_joomla_lms_dis_coupon_code', 'dis_coupon_code', ''); $discounts['t_coupon_disc'] = JLMS_DISCOUNTS::getTotalCouponDiscount($coupon_code, $subscriptions); $discounts['t_disc'] = JLMS_DISCOUNTS::getTotalDiscounts($subscriptions); // counting taxes if ($jlms_tax_counting) { $is_cb_installed = $JLMS_CONFIG->get('is_cb_installed', 0); $get_country_info = $JLMS_CONFIG->get('get_country_info', 0); $cb_country_filed_id = intval($JLMS_CONFIG->get('jlms_cb_country')); $isset_country = false; if ($is_cb_installed && $get_country_info && $cb_country_filed_id) { //by Max (get country info) $query = "SELECT cf.name" . "\n FROM #__comprofiler_fields as cf" . "\n WHERE 1" . "\n AND cf.fieldid = '" . $cb_country_filed_id . "'"; $JLMS_DB->setQuery($query); $cb_country_field_name = $JLMS_DB->loadResult(); $query = "SELECT " . $cb_country_field_name . "" . "\n FROM #__comprofiler" . "\n WHERE 1" . "\n AND user_id = '" . $my->id . "'"; $JLMS_DB->setQuery($query); $country_name = $JLMS_DB->loadResult(); require_once 'components' . DS . $option . DS . 'includes' . DS . 'libraries' . DS . 'lms.lib.countries.php'; $CodeCountry = new CodeCountries(); $code = $CodeCountry->code($country_name); if ($code) { $user_country = $code; } $user_country_name = ''; $us_state = ''; } else { $ip_address = $_SERVER['REMOTE_ADDR']; //$ip_address = '213.184.248.211'; // $ip_address = '12.225.42.19'; // $ip_address = '111.215.41.12'; if (@ini_get('allow_url_fopen')) { $fn = @file('http://api.hostip.info/get_html.php?ip=' . $ip_address); // country ip identified if ($fn != false) { $ip_info = implode('', $fn); preg_match_all("(\\(..\\))", $ip_info, $dop); $user_country = str_replace('(', '', str_replace(")", '', $dop[0][0])); preg_match_all("(\\:.*\\()", $ip_info, $dop2); $user_country_name = str_replace(': ', '', str_replace(" (", '', $dop2[0][0])); preg_match_all("(\\, ..)", $ip_info, $dop3); $us_state = @str_replace(', ', '', $dop3[0][0]); } } } if (isset($user_country)) { $query = "SELECT * FROM #__lms_subscriptions_countries WHERE published = 1 AND code='" . $user_country . "' "; $JLMS_DB->setQuery($query); $rows2 = $JLMS_DB->loadObjectList(); // if no country found if (!count($rows2)) { // check if in EU $query = "SELECT * FROM #__lms_subscriptions_countries WHERE published = 1 AND code='EU' AND list REGEXP '" . $user_country . "' "; $JLMS_DB->setQuery($query); $rows_eu = $JLMS_DB->loadObjectList(); if (count($rows_eu)) { $isset_country = true; $rows2[0]->tax_type = $rows_eu[0]->tax_type; $rows2[0]->tax = $rows_eu[0]->tax; $user_country_name = $rows_eu[0]->name . ' (' . $user_country_name . ')'; } } else { $isset_country = true; } // additional check for US if ($user_country == 'US') { $query = "SELECT * FROM #__lms_subscriptions_countries WHERE published = 1 AND code = 'US-" . $us_state . "' "; $JLMS_DB->setQuery($query); $rows_states = $JLMS_DB->loadObjectList(); if (count($rows_states)) { $isset_country = true; $rows2 = array(); $rows2[0]->tax_type = $rows_states[0]->tax_type; $rows2[0]->tax = $rows_states[0]->tax; $user_country_name = 'United states (' . $rows_states[0]->name . ' )'; } } } //10.01.09 (Max) default tax option if (!$isset_country) { $rows2[0]->tax_type = $JLMS_CONFIG->get('default_tax_type', 1); $rows2[0]->tax = $JLMS_CONFIG->get('default_tax', 0); } } ?> <script language="javascript" type="text/javascript"> <!-- function jq_Check_selectCheckbox(check_name, form_name) { selItem = eval("document."+form_name+"['"+check_name+"']"); if (selItem) { if (selItem.length) { var i; for (i = 0; i<selItem.length; i++) { if (selItem[i].checked) { if (selItem[i].value) { return true; } }} } else if (selItem.checked) { return true; }} return false; } function jlms_submitbutton(pressbutton) { var form = document.JLMS_adminForm; if( pressbutton == 'remove_from_cart' ){ var ttt = jq_Check_selectCheckbox('jlms_sub[]', 'JLMS_adminForm'); if (ttt) { form.task.value = pressbutton; form.submit(); } else { alert("<?php echo _JLMS_ALERT_SELECT_ITEM; ?> "); } } if( pressbutton == 'update_cart' ){ form.task.value = pressbutton; form.submit(); } if (pressbutton == 'cart_login') { form.task.value = pressbutton; form.submit(); } if (pressbutton == 'apply_coupon_code') { form.task.value = pressbutton; form.submit(); } } //--> </script> <form action="<?php echo sefRelToAbs("index.php?option={$option}&Itemid={$Itemid}"); ?> " method="post" name="JLMS_adminForm"> <input type="hidden" value="<?php echo $option; ?> " name="option"> <input type="hidden" value="<?php echo $Itemid; ?> " name="Itemid"> <input type="hidden" value="" name="task"> <input type="hidden" value="" name="id"> <?php JLMS_TMPL::OpenMT(); $params = array('show_menu' => true, 'simple_menu' => true); JLMS_TMPL::ShowHeader('cart', _JLMS_MY_CART, $params); JLMS_TMPL::ShowPageTip('show_cart'); JLMS_TMPL::CloseMT(); $count_subs = count($subscriptions); ?> <br /> <?php if ($count_subs > 0) { ?> <input type="text" name="dis_coupon_code" value="<?php echo $coupon_code; ?> " /> <input type="button" value="Check coupon" onclick="jlms_submitbutton('apply_coupon_code');" /> <?php } ?> <table cellpadding="0" cellspacing="0" border="0" width="100%" class="jlms_cart_list_outer" style="width:100%"> <?php if ($count_subs > 0) { ?> <tr> <td> <?php $need_upd_txt = false; for ($i = 0, $n = count($subscriptions); $i < $n; $i++) { if (isset($subscriptions[$i]->allow_multiple) && $subscriptions[$i]->allow_multiple) { $need_upd_txt = true; break; } } $jlms_cs = $JLMS_CONFIG->get('jlms_cur_sign'); $total_subs = 0; $total_disc = 0; $total_tax = 0; $discounts['total_p_disc'] = 0; $reccSubId = false; for ($i = 0, $n = count($subscriptions); $i < $n; $i++) { JLMS_CART_html::initSubscriptionPaymentParams($subscriptions[$i], $rows2); if ($subscriptions[$i]->account_type == '6') { $reccSubId = $i; } if (isset($subscriptions[$i]->count_items) && $subscriptions[$i]->count_items && isset($subscriptions[$i]->allow_multiple) && $subscriptions[$i]->allow_multiple) { $total_subs += $subscriptions[$i]->sub_total * $subscriptions[$i]->count_items; $total_tax += $subscriptions[$i]->tax_amount * $subscriptions[$i]->count_items; $total_disc += $subscriptions[$i]->disc * $subscriptions[$i]->count_items; } else { $total_subs += $subscriptions[$i]->sub_total; $total_tax += $subscriptions[$i]->tax_amount; $total_disc += $subscriptions[$i]->disc; } if ($subscriptions[$i]->p_coupon_disc || $subscriptions[$i]->p_disc) { $params['showDiscount'] = true; } } if (isset($rows2[0]->tax_type) && $rows2[0]->tax_type == 2) { $total_tax += $rows2[0]->tax; // if tx is not in percentage.... } $discounts['total_p_disc'] = $total_disc; $total_disc = $total_disc + ($discounts['t_coupon_disc'] + $discounts['t_disc']); $total_price = $total_subs - $total_disc; if ($total_price < 0) { $total_price = $total_tax; } else { $total_price += $total_tax; } $price_diff = $total_subs - $total_disc; if ($price_diff < 0) { $balance = abs($price_diff); } else { $balance = 0; } $recurr_total_desc = ''; if ($reccSubId !== false) { $price = JLMS_RECURRENT_PAY::getPriceDesc($subscriptions[$reccSubId], 'basket_list', $balance, $total_price); $recurr_total_desc = JLMS_RECURRENT_PAY::getPriceDesc($subscriptions[$reccSubId], 'total', $balance, $total_price); if ($total_price == 0) { $total_price = JLMS_RECURRENT_PAY::getAmountFromReccurentPrice($subscriptions[$reccSubId]); } } ?> <div style="float:right; padding-top:5px; padding-right:25px"> <b><?php echo _JLMS_SUBSCR_SUB_TOTAL . ' ' . $jlms_cs . sprintf('%.2f', round($total_price, 2)); ?> </b> </div> </td> </tr> <tr> <td> <?php if ($need_upd_txt) { ?> <table width="100%" cellpadding="0" cellspacing="0" border="0" class="jlms_table_no_borders"> <tr> <td><div style="float:right; text-align:center"><?php echo _JLMS_CART_HAVE_CHANGED_QUANTITY; ?> <a href="javascript:jlms_submitbutton('update_cart');"><?php echo _JLMS_CART_UPDATE; ?> </a></div></td> </tr> </table> <?php } ?> <?php $do_show_index = false; for ($i = 0, $n = count($subscriptions); $i < $n; $i++) { $subscription = $subscriptions[$i]; $s = 1; foreach ($subscription->course_names as $course_name) { $course_usertype = 0; if (in_array($subscription->courses[$s - 1], $JLMS_CONFIG->get('teacher_in_courses', array(0)))) { $course_usertype = 1; } elseif (in_array($subscription->courses[$s - 1], $JLMS_CONFIG->get('student_in_courses', array(0)))) { $course_usertype = 2; } if ($course_usertype) { $do_show_index = true; break; } $s++; } if ($do_show_index) { break; } } ?> <table width="100%" cellpadding="0" cellspacing="0" border="0" class="<?php echo JLMSCSS::_('jlmslist', 'jlms_cart_list'); ?> "> <tr> <?php if ($do_show_index) { ?> <<?php echo JLMSCSS::tableheadertag(); ?> class="<?php echo JLMSCSS::_('sectiontableheader'); ?> " align="center" width="16">#</<?php echo JLMSCSS::tableheadertag(); ?> ><?php } ?> <<?php echo JLMSCSS::tableheadertag(); ?> class="<?php echo JLMSCSS::_('sectiontableheader'); ?> " align="left" width="20"> </<?php echo JLMSCSS::tableheadertag(); ?> > <<?php echo JLMSCSS::tableheadertag(); ?> class="<?php echo JLMSCSS::_('sectiontableheader'); ?> " align="left"><?php echo _JLMS_SUBSCRIBE_SUB_COURSES; ?> </<?php echo JLMSCSS::tableheadertag(); ?> > <<?php echo JLMSCSS::tableheadertag(); ?> class="<?php echo JLMSCSS::_('sectiontableheader'); ?> " align="left"><?php echo _JLMS_DETAILS; ?> </<?php echo JLMSCSS::tableheadertag(); ?> > <<?php echo JLMSCSS::tableheadertag(); ?> class="<?php echo JLMSCSS::_('sectiontableheader'); ?> " align="center" width="170"><?php echo _JLMS_COURSES_PRICE; ?> </<?php echo JLMSCSS::tableheadertag(); ?> > <?php if (isset($params['showDiscount']) && $params['showDiscount']) { ?> <<?php echo JLMSCSS::tableheadertag(); ?> class="<?php echo JLMSCSS::_('sectiontableheader'); ?> " align="center" width="40" nowrap="nowrap"><?php echo _JLMS_CART_DISCOUNT; ?> </<?php echo JLMSCSS::tableheadertag(); ?> > <?php } if (isset($rows2[0]) && $rows2[0]->tax_type == 1 && $rows2[0]->tax) { ?> <<?php echo JLMSCSS::tableheadertag(); ?> class="<?php echo JLMSCSS::_('sectiontableheader'); ?> " align="center" width="40" nowrap="nowrap"><?php echo _JLMS_CART_TAX; ?> </<?php echo JLMSCSS::tableheadertag(); ?> > <?php } ?> <<?php echo JLMSCSS::tableheadertag(); ?> class="<?php echo JLMSCSS::_('sectiontableheader'); ?> " align="center" width="40" nowrap="nowrap"><?php echo _JLMS_CART_QUANTITY; ?> </<?php echo JLMSCSS::tableheadertag(); ?> > </tr> <?php for ($i = 0, $n = count($subscriptions); $i < $n; $i++) { $subscription = $subscriptions[$i]; $tax_amount = 0; $disc = 0; if ($subscription->account_type != '6') { $price = $jlms_cs . sprintf('%.2f', round($subscriptions[$i]->sub_total, 2)); } $price_sub = $price; $custom_code .= JLMS_CART_html::ShowSub($subscription, $i + 1, '', $price_sub, $do_show_index, false, $params); } ?> </table> </td> </tr> <tr> <td> <div style="float:right; padding-top:5px; padding-right:25px; text-align:right;"> <?php if ($total_tax || $total_disc) { echo '<b>' . $jlms_cs . sprintf('%.2f', round($total_subs, 2)) . '</b><br />'; if ($total_disc) { echo '<b>' . _JLMS_SUBSCR_DISCOUNT_AMOUNT . ' ' . $jlms_cs . sprintf('%.2f', round($total_disc, 2)) . '</b><br />'; } if ($total_tax) { echo '<b>' . _JLMS_SUBSCR_TAX_AMOUNT . ' ' . $jlms_cs . sprintf('%.2f', round($total_tax, 2)) . '</b><br />'; } } echo '<b>' . _JLMS_SUBSCR_SUB_TOTAL . ' ' . $jlms_cs . sprintf('%.2f', round($total_price, 2)) . '</b><br />'; echo '<b>' . $recurr_total_desc . '</b>'; ?> </div> </td> </tr> <?php $controls = array(); if ($JLMS_CONFIG->get('under_ssl') && $JLMS_CONFIG->get('real_live_site')) { $temp_href = $JLMS_CONFIG->get('real_live_site') . "/index.php?option={$option}&Itemid={$Itemid}&task=subscription"; } else { $temp_href = $JLMS_CONFIG->get('live_site') . "/index.php?option={$option}&Itemid={$Itemid}&task=subscription"; } $controls[] = array('href' => $temp_href, 'title' => _JLMS_CART_BACK_TO_SHOP, 'img' => 'back'); $controls[] = array('href' => "javascript:jlms_submitbutton('remove_from_cart');", 'title' => _JLMS_CART_REMOVE, 'img' => 'cartremove'); JLMS_TMPL::ShowControlsFooter($controls, '', false); ?> </table> <?php if ($my->id && !empty($procs)) { JLMS_TMPL::OpenMT('jlms_table_no_borders'); JLMS_TMPL::OpenTS(); $sub_proc = $JLMS_SESSION->get('sub_proc'); if (isset($_COOKIE['proc_id'])) { $sub_proc = $_COOKIE['proc_id']; } $temp2 = ""; foreach ($procs as $proc) { $checked = ''; if (count($procs) == 1) { $temp2 = "checkProcessor('" . $proc->id . "','" . $proc->filename . "');"; $checked = 'checked="checked"'; } if ($sub_proc) { if ($sub_proc == $proc->id) { $temp2 = "checkProcessor('" . $proc->id . "','" . $proc->filename . "');"; $checked = 'checked="checked"'; } } else { if ($proc->default_p) { $temp2 = "checkProcessor('" . $proc->id . "','" . $proc->filename . "');"; $checked = 'checked="checked"'; } } echo '<input type="radio" name="proc_id" value="' . $proc->id . '" onclick="checkProcessor(\'' . $proc->id . '\',\'' . $proc->filename . '\');" id="proc_' . $proc->id . '" ' . $checked . ' /> <label class="msspro_sel_proc2" for="proc_' . $proc->id . '">' . $proc->name . '</label><br />'; } if ($temp2) { echo '<script type="text/javascript" language="javascript"><!--' . "\r\n"; echo $temp2; echo "\r\n--></script>"; } JLMS_TMPL::CloseTS(); JLMS_TMPL::CloseMT(); } ?> <?php echo "</form>"; if (!$my->id) { JLMS_UserSessions_html::loginPanel(); } } else { echo "<tr><td><div class='joomlalms_sys_message'>"; echo _JLMS_CART_IS_EMPTY; echo '<br />'; if ($JLMS_CONFIG->get('under_ssl') && $JLMS_CONFIG->get('real_live_site')) { $temp_href = $JLMS_CONFIG->get('real_live_site') . "/index.php?option={$option}&Itemid={$Itemid}&task=subscription"; } else { $temp_href = $JLMS_CONFIG->get('live_site') . "/index.php?option={$option}&Itemid={$Itemid}&task=subscription"; } echo '<a href="' . $temp_href . '" title="' . _JLMS_CART_BACK_TO_SHOP . '">[' . _JLMS_CART_BACK_TO_SHOP . ']</a>'; echo "</div></td></tr></table>"; echo "</form>"; } return $custom_code; }
function JQ_createScale($qdata, $is_review = 0) { $jq_tmpl_html = "<table width='80%' align='center' cellpadding='0' cellspacing='0' class='" . JLMSCSS::_('jlmslist') . "' style='margin-left: auto !important; margin-right: auto !important; width: 80% !important;'><tr><" . JLMSCSS::tableheadertag() . " class=" . JLMSCSS::_('sectiontableheader') . "> </" . JLMSCSS::tableheadertag() . ">" . "\n"; $arr_scale = array(); foreach ($qdata as $qone) { if ($qone->c_type == 1) { $jq_tmpl_html .= "<" . JLMSCSS::tableheadertag() . " class=" . JLMSCSS::_('sectiontableheader') . " align='center' style='text-align: center !important;'>" . $qone->c_field . "</" . JLMSCSS::tableheadertag() . ">" . "\n"; $arr_scale[] = $qone->c_id; } } $jq_tmpl_html .= "</tr>" . "\n"; $k = 1; $z = 0; foreach ($qdata as $qone) { if ($qone->c_type == 0) { $jq_tmpl_html .= "<tr class='" . JLMSCSS::_('sectiontableentry' . $k) . "'>" . "\n"; $jq_tmpl_html .= "<td align='left' style='padding-right:30px;'>" . $qone->c_field . "</td>" . "\n"; for ($i = 0; $i < count($arr_scale); $i++) { $chk = ''; if (isset($qone->inchek) && $qone->inchek && $arr_scale[$i] == $qone->inchek) { $chk = 'checked="checked"'; } $jq_tmpl_html .= "<td align='center'><input name='ch_scale_" . $z . "' type='radio' value='" . $arr_scale[$i] . "' " . $chk . " " . ($is_review == 1 ? " disabled='disabled'" : "") . " /></td>" . "\n"; } $z++; $jq_tmpl_html .= "</tr>" . "\n"; $k = 3 - $k; } } $jq_tmpl_html .= "</table>" . "\n"; $jq_tmpl_html .= "<input type='hidden' name='scale_count' value='" . $z . "' />" . "\n"; return $jq_tmpl_html; }
function JLMS_editCertificate_OneRole(&$row, &$fonts, $pref = '', $default = false) { global $JLMS_DB, $JLMS_CONFIG; $parent_id = isset($row->id) ? intval($row->id) : 0; $parent_course = isset($row->course_id) ? intval($row->course_id) : 0; $query = "SELECT * FROM #__lms_certificates WHERE parent_id = {$parent_id} AND course_id = {$parent_course} AND crtf_type = '-2' ORDER BY crtf_align"; $JLMS_DB->SetQuery($query); $cmsgs_saved = $JLMS_DB->LoadObjectList(); $f = mosHTML::selectList($fonts, 'crtf_font' . ($pref ? '_' . $pref : ''), $default ? ' disabled="disabled"' : '', 'value', 'text', isset($row->crtf_font) ? $row->crtf_font : 'arial.ttf'); $f2 = mosHTML::selectList($fonts, 'new_txt_mes_font' . ($pref ? '_' . $pref : ''), ' style="width:180px"' . ($default ? ' disabled="disabled"' : ''), 'value', 'text'); if ($pref) { ?> <tr> <td valign="middle" style="vertical-align:middle" width="25%"><br /><?php echo _JLMS_CRTF_USE_DEFAULT; ?> </td> <td> <br /><input size="40" onchange="jlms_changeCrtfDefaultValue(this, '<?php echo $pref; ?> ')" class="inputbox" type="checkbox"<?php echo $default ? ' checked="checked"' : ''; ?> name="certificate_default<?php echo $pref ? '_' . $pref : ''; ?> " value="1" /> </td> </tr> <?php } ?> <tr> <td valign="middle" style="vertical-align:middle" width="25%"><br /><?php echo _JLMS_CHOOSE_FILE; ?> </td> <td> <br /><input size="40" class="inputbox" type="file"<?php echo $default ? ' disabled="disabled"' : ''; ?> name="userfile<?php echo $pref ? '_' . $pref : ''; ?> " /> <?php echo $row->file_id && !$default ? '<br />' . _JLMS_FILE_ATTACHED : '<br />' . _JLMS_FILE_NOT_ATTACHED; ?> </td> </tr> <tr> <td><br /><?php echo _JLMS_GB_CRT_TEXT; ?> </td> <td><br /> <textarea class="inputbox" name="crtf_text<?php echo $pref ? '_' . $pref : ''; ?> "<?php echo $default ? ' disabled="disabled"' : ''; ?> rows="6" cols="40"><?php echo $row->crtf_text; ?> </textarea> </td> </tr> <tr><td colspan="2"><div class="joomlalms_info_legend"><?php echo _JLMS_GB_CRTF_TEXT_NOTE; ?> </div></td></tr> <tr> <td valign="middle" style="vertical-align:middle"><br /><?php echo _JLMS_GB_CRT_TEXT_ALIGN; ?> </td> <td> <?php $list_a = array(); $list_a[] = mosHTML::makeOption('0', _JLMS_LEFT); $list_a[] = mosHTML::makeOption('1', _JLMS_CENTER); $list_a[] = mosHTML::makeOption('2', _JLMS_RIGHT); $rrr = mosHTML::radioList($list_a, 'crtf_align' . ($pref ? '_' . $pref : ''), $default ? ' disabled="disabled"' : '', $row->crtf_align); ?> <br /><?php echo $rrr; ?> </td> </tr> <tr> <td valign="middle" style="vertical-align:middle"><br /><?php echo _JLMS_GB_CRT_TEXT_SHADOW; ?> </td> <td><br /> <?php echo mosHTML::yesnoRadioList('crtf_shadow' . ($pref ? '_' . $pref : ''), $default ? ' disabled="disabled"' : '', $row->crtf_shadow); ?> </td> </tr> <tr> <td valign="middle" style="vertical-align:middle"><br /><?php echo _JLMS_GB_CRT_TEXT_X; ?> </td> <td> <br /><input size="40" class="inputbox" type="text"<?php echo $default ? ' disabled="disabled"' : ''; ?> name="text_x<?php echo $pref ? '_' . $pref : ''; ?> " value="<?php echo $row->text_x; ?> " /> </td> </tr> <tr> <td valign="middle" style="vertical-align:middle"><br /><?php echo _JLMS_GB_CRT_TEXT_Y; ?> </td> <td> <br /><input size="40" class="inputbox" type="text"<?php echo $default ? ' disabled="disabled"' : ''; ?> name="text_y<?php echo $pref ? '_' . $pref : ''; ?> " value="<?php echo $row->text_y; ?> " /> </td> </tr> <tr> <td valign="middle" style="vertical-align:middle"><br /><?php echo _JLMS_GB_CRT_TEXT_SIZE; ?> </td> <td> <br /><input size="40" class="inputbox" type="text"<?php echo $default ? ' disabled="disabled"' : ''; ?> name="text_size<?php echo $pref ? '_' . $pref : ''; ?> " value="<?php echo $row->text_size; ?> " /> <input type="hidden" name="certificate_types[]" value="<?php echo $pref; ?> " /> </td> </tr> <tr> <td valign="middle" style="vertical-align:middle"><br /><?php echo _JLMS_CRTF_FONT . ':'; ?> </td> <td> <br /><?php echo $f; ?> </td> </tr> <tr> <td colspan="2"><?php echo JLMSCSS::h2(_JLMS_CRTF_TEXT_FIELDS); ?> </td> </tr> <tr> <td colspan="2"> <?php echo '<table width="100%" cellpadding="0" cellspacing="0" id="certificate_custom_msgs' . ($pref ? '_' . $pref : '') . '" class="' . JLMSCSS::_('jlmslist') . '">'; echo '<tr>'; echo ' <' . JLMSCSS::tableheadertag() . ' width="20" class="' . JLMSCSS::_('sectiontableheader') . '" align="center">#</' . JLMSCSS::tableheadertag() . '>'; echo ' <' . JLMSCSS::tableheadertag() . ' class="' . JLMSCSS::_('sectiontableheader') . '" width="200">' . _JLMS_CRTF_SHORT_TEXT_FIELD . '</' . JLMSCSS::tableheadertag() . '>'; echo ' <' . JLMSCSS::tableheadertag() . ' class="' . JLMSCSS::_('sectiontableheader') . '" width="30" align="center">' . _JLMS_CRTF_SHORT_SHADOW . '</' . JLMSCSS::tableheadertag() . '>'; echo ' <' . JLMSCSS::tableheadertag() . ' class="' . JLMSCSS::_('sectiontableheader') . '" width="40" align="center">' . _JLMS_CRTF_SHORT_X . '</' . JLMSCSS::tableheadertag() . '>'; echo ' <' . JLMSCSS::tableheadertag() . ' class="' . JLMSCSS::_('sectiontableheader') . '" width="40" align="center">' . _JLMS_CRTF_SHORT_Y . '</' . JLMSCSS::tableheadertag() . '>'; echo ' <' . JLMSCSS::tableheadertag() . ' class="' . JLMSCSS::_('sectiontableheader') . '" width="40" align="center">' . _JLMS_CRTF_SHORT_HEIGHT . '</' . JLMSCSS::tableheadertag() . '>'; echo ' <' . JLMSCSS::tableheadertag() . ' class="' . JLMSCSS::_('sectiontableheader') . '">' . _JLMS_CRTF_SHORT_FONT . '</' . JLMSCSS::tableheadertag() . '>'; echo '<' . JLMSCSS::tableheadertag() . ' class="' . JLMSCSS::_('sectiontableheader') . '" width="20"> </' . JLMSCSS::tableheadertag() . '>'; echo '<' . JLMSCSS::tableheadertag() . ' class="' . JLMSCSS::_('sectiontableheader') . '" width="20"> </' . JLMSCSS::tableheadertag() . '>'; echo '<' . JLMSCSS::tableheadertag() . ' class="' . JLMSCSS::_('sectiontableheader') . '" width="20"> </' . JLMSCSS::tableheadertag() . '>'; echo '</tr>'; $k = 1; $i = 1; foreach ($cmsgs_saved as $cmsg_s) { echo '<tr class="' . JLMSCSS::_('sectiontableentry' . $k) . '">'; echo '<td align="center">' . $i . '</td>'; echo '<td><input type="hidden" name="ctxt_mes_id' . ($pref ? '_' . $pref : '') . '[]" value="' . $cmsg_s->id . '" /><input type="text" size="24" name="ctxt_mes_text' . ($pref ? '_' . $pref : '') . '[]"' . ($default ? ' disabled="disabled"' : '') . ' value="' . $cmsg_s->crtf_text . '" /></td>'; echo '<td align="center">'; echo '<input type="hidden"' . ($default ? ' disabled="disabled"' : '') . ' name="ctxt_mes_shadow_hid' . ($pref ? '_' . $pref : '') . '[]" value="' . ($cmsg_s->crtf_shadow ? '1' : '0') . '" />'; echo '<input type="checkbox"' . ($default ? ' disabled="disabled"' : '') . ' onchange="analyze_change_check2(this)" name="ctxt_mes_shadow' . ($pref ? '_' . $pref : '') . '[]"' . ($cmsg_s->crtf_shadow ? ' checked="checked"' : '') . ' value="1" />'; echo '</td>'; echo '<td><input type="text" size="3" name="ctxt_mes_x' . ($pref ? '_' . $pref : '') . '[]"' . ($default ? ' disabled="disabled"' : '') . ' value="' . $cmsg_s->text_x . '" /></td>'; echo '<td><input type="text" size="3" name="ctxt_mes_y' . ($pref ? '_' . $pref : '') . '[]"' . ($default ? ' disabled="disabled"' : '') . ' value="' . $cmsg_s->text_y . '" /></td>'; echo '<td><input type="text" size="3" name="ctxt_mes_h' . ($pref ? '_' . $pref : '') . '[]"' . ($default ? ' disabled="disabled"' : '') . ' value="' . $cmsg_s->text_size . '" /></td>'; $f3 = mosHTML::selectList($fonts, 'ctxt_mes_font' . ($pref ? '_' . $pref : '') . '[]', ' style="width:180px"' . ($default ? ' disabled="disabled"' : ''), 'value', 'text', isset($cmsg_s->crtf_font) ? $cmsg_s->crtf_font : 'arial.ttf'); echo '<td>' . $f3 . '</td>'; echo '<td><a class="jlms_img_link" href="javascript:void(0);" onclick="Delete_tbl_row(this); return false;" title="Delete"><img src="' . $JLMS_CONFIG->get('live_site') . '/components/com_joomla_lms/lms_images/toolbar/btn_cancel.png" width="16" height="16" border="0" alt="Delete" /></a></td>'; echo '<td>'; if ($i > 1) { echo '<a class="jlms_img_link" href="javascript:void(0);" onclick="Up_tbl_row(this); return false;" title="' . _JLMS_MOVEUP . '"><img src="' . $JLMS_CONFIG->get('live_site') . '/components/com_joomla_lms/lms_images/toolbar/btn_uparrow.png" width="16" height="16" border="0" alt="' . _JLMS_MOVEUP . '" /></a>'; } else { echo ' '; } echo '</td>'; echo '<td>'; if ($i < count($cmsgs_saved)) { echo '<a class="jlms_img_link" href="javascript:void(0);" onclick="Down_tbl_row(this); return false;" title="' . _JLMS_MOVEDOWN . '"><img src="' . $JLMS_CONFIG->get('live_site') . '/components/com_joomla_lms/lms_images/toolbar/btn_downarrow.png" width="16" height="16" border="0" alt="' . _JLMS_MOVEDOWN . '" /></a>'; } else { echo ' '; } echo '</tr>'; $k = 3 - $k; $i++; } /*echo '</table>'; echo '<br />'; echo '<table width="100%" cellpadding="0" cellspacing="0">';*/ echo '<tr class="' . JLMSCSS::_('sectiontableentry' . $k) . '">'; echo '<td> </td>'; echo ' <td width="200"><br />'; echo ' <input id="new_txt_message' . ($pref ? '_' . $pref : '') . '" class="inputbox"' . ($default ? ' disabled="disabled"' : '') . ' size="24" type="text" name="new_txt_message' . ($pref ? '_' . $pref : '') . '" />'; echo '</td><td width="20" align="center"><br />'; echo ' <input id="new_txt_mes_shadow' . ($pref ? '_' . $pref : '') . '"' . ($default ? ' disabled="disabled"' : '') . ' type="checkbox" name="new_txt_mes_shadow' . ($pref ? '_' . $pref : '') . '" />'; echo '</td><td width="40"><br />'; echo ' <input id="new_txt_message_X' . ($pref ? '_' . $pref : '') . '" class="inputbox"' . ($default ? ' disabled="disabled"' : '') . ' size="3" type="text" name="new_txt_message_X' . ($pref ? '_' . $pref : '') . '" />'; echo '</td><td width="40"><br />'; echo ' <input id="new_txt_message_Y' . ($pref ? '_' . $pref : '') . '" class="inputbox"' . ($default ? ' disabled="disabled"' : '') . ' size="3" type="text" name="new_txt_message_Y' . ($pref ? '_' . $pref : '') . '" />'; echo '</td><td width="40"><br />'; echo ' <input id="new_txt_message_H' . ($pref ? '_' . $pref : '') . '" class="inputbox"' . ($default ? ' disabled="disabled"' : '') . ' size="3" type="text" name="new_txt_message_H' . ($pref ? '_' . $pref : '') . '" />'; echo '</td>'; echo '<td width="100"><br />'; echo $f2; echo '</td><td align="left" colspan="3"><br />'; echo ' <input class="inputbox" type="button"' . ($default ? ' disabled="disabled"' : '') . ' name="add_new_field' . ($pref ? '_' . $pref : '') . '" style="width:70px " value="' . _JLMS_GB_ADD_NEW_FIELD . '" onclick="javascript:Add_new_tbl_field(this,\'' . ($pref ? '_' . $pref : ''), '\');" />'; echo '</td>'; echo '</tr>'; echo '</table>'; ?> </td> </tr> <?php }
function mailbox_users(&$stats, $option, $course_id, &$lists, $filt_group) { global $Itemid, $JLMS_DB, $JLMS_CONFIG; ?> <script language="javascript" type="text/javascript"> <!--//--><![CDATA[//><!-- var r_count = parseInt('<?php echo (isset($_POST['usr_id']) ? count($_POST['usr_id']) : 0) + (isset($_POST['grp_id']) ? count($_POST['grp_id']) : 0) + (isset($_POST['mail_id']) ? count($_POST['mail_id']) : 0) + (isset($lists['repl']) ? 1 : 0); ?> '); function reanalize_class(){ var tbl_id = getObj('show_mailz'); if(tbl_id.rows[1]){ for(var i=1;i<tbl_id.rows.length;i++){ if((i % 2 + 1)==1){ tbl_id.rows[i].className = 'sectiontableentry1 odd'; } else { tbl_id.rows[i].className = 'sectiontableentry2 even'; } } } } function Delete_tbl_row(element) { var del_index = element.parentNode.parentNode.sectionRowIndex; var tbl_id = element.parentNode.parentNode.parentNode.parentNode.id; element.parentNode.parentNode.parentNode.deleteRow(del_index); r_count = r_count - 1; reanalize_class(); } function ading_row(texts,valuez,group) { var form = document.adminForm; var tbl_id = getObj('show_mailz'); var row = tbl_id.insertRow(1); row.className = "sectiontableentry1 odd"; var cell1 = document.createElement("td"); var cell2 = document.createElement("td"); var cell3 = document.createElement("td"); var cell4 = document.createElement("td"); input_button = document.createElement("IMG"); input_button.src = "<?php echo $JLMS_CONFIG->get('live_site') . '/' . $JLMS_CONFIG->get('lms_path_to_images') . '/buttons_22/btn_delete_22.png'; ?> "; input_button.onclick = new Function('Delete_tbl_row(this)'); input_button.style.cursor = "pointer"; input_img = document.createElement("IMG"); if(!group) input_img.src = "<?php echo $JLMS_CONFIG->get('live_site') . '/' . $JLMS_CONFIG->get('lms_path_to_images') . '/buttons_22/btn_edituser_22.png'; ?> "; else input_img.src = "<?php echo $JLMS_CONFIG->get('live_site') . '/' . $JLMS_CONFIG->get('lms_path_to_images') . '/buttons_22/btn_editusergroup_22.png'; ?> "; cell1.appendChild(input_button); //cell2.style.width = "10px;"; cell2.appendChild(input_img); cell3.innerHTML = texts; var input_text = document.createElement("input"); input_text.type = "hidden"; if(group==1) { input_text.name = "grp_id[]"; input_text.setAttribute("name","grp_id[]"); } else if(group==2) { input_text.name = "mail_id[]"; input_text.setAttribute("name","mail_id[]"); } else { input_text.name = "usr_id[]"; input_text.setAttribute("name","usr_id[]"); } input_text.value = valuez; cell3.appendChild(input_text); row.appendChild(cell1); row.appendChild(cell2); row.appendChild(cell3); r_count = r_count + 1; reanalize_class(); } function setgood() { return true; } function submitbutton(pressbutton) { var form = document.adminForm; try { form.onsubmit(); } catch(e) { //alert(e); } if (pressbutton == 'mail_send'){ if (form.jlms_subject.value == ''){ alert('<?php echo _JLMS_MB_ENTER_SUBJECT; ?> '); } else{ if (r_count){ form.task.value = pressbutton; form.submit(); } else{ alert('<?php echo _JLMS_MB_ENTER_USERNAME; ?> '); } } } else { form.task.value = pressbutton; form.submit(); } } function mail_to_text() { var ulist = document.adminForm['mailbox_users[]']; for(i=0;i<ulist.length;i++) { if(ulist[i].value == 0 && ulist[i].selected) { ading_row(ulist[i].text,'<?php echo $filt_group; ?> ',1); break; } else if(ulist[i].selected) { if(ulist[i].value>0) ading_row(ulist[i].text,ulist[i].value,0); else ading_row(ulist[i].text,ulist[i].value,2); } } } //--><!]]> </script> <?php JLMS_TMPL::OpenMT(); if (!$course_id) { $hparams = array('show_menu' => false); } else { $hparams = array(); } $toolbar = array(); $toolbar[] = array('btn_type' => 'mail_inbox', 'btn_js' => "javascript:submitbutton('mailbox');"); $toolbar[] = array('btn_type' => 'mail_outbox', 'btn_js' => "javascript:submitbutton('mail_sendbox');"); $toolbar[] = array('btn_type' => 'send', 'btn_js' => "javascript:submitbutton('mail_send');"); JLMS_TMPL::ShowHeader('mailbox', _JLMS_MB_TITLE, $hparams, $toolbar); JLMS_TMPL::OpenTS(); ?> <form action="<?php echo sefRelToAbs("index.php?option={$option}&Itemid={$Itemid}"); ?> " enctype="multipart/form-data" method="post" name="adminForm" onsubmit="setgood();"> <table width="100%" cellpadding="2" cellspacing="0" border="0" class="jlms_table_no_borders" style="float:left;"> <tr> <td align="left" style="text-align:left; width:360px; " valign="top"> <div align="left" style="white-space:nowrap "> <?php echo $lists['mailbox_users']; ?> </div> <div align="left" style="white-space:nowrap "><?php echo $lists['filter2']; ?> </div> </td> <td width="50" valign="top"> <?php $btn_img = '2rightarrow.png'; // 29.04.2008 - 'alt' and 'src' - changed by DEN echo "<img src=\"" . $JLMS_CONFIG->get('live_site') . '/' . $JLMS_CONFIG->get('lms_path_to_images') . "/" . $btn_img . "\" alt='>' onclick='mail_to_text();' style='cursor:pointer; padding-top:45px;' />"; ?> </td> <td valign="top" width="45%"> <table id="show_mailz" cellpadding="0" cellspacing="0" border="0" width="100%" class="<?php echo JLMSCSS::_('jlmslist'); ?> "> <tr> <<?php echo JLMSCSS::tableheadertag(); ?> class="<?php echo JLMSCSS::_('sectiontableheader'); ?> " width="25"><!-- gg --> </<?php echo JLMSCSS::tableheadertag(); ?> > <<?php echo JLMSCSS::tableheadertag(); ?> class="<?php echo JLMSCSS::_('sectiontableheader'); ?> " width="25"><!-- gg --> </<?php echo JLMSCSS::tableheadertag(); ?> > <<?php echo JLMSCSS::tableheadertag(); ?> class="<?php echo JLMSCSS::_('sectiontableheader'); ?> "><?php echo _JLMS_MB_RECEPIENTS; ?> </<?php echo JLMSCSS::tableheadertag(); ?> > </tr> <?php $z = 0; if (isset($lists['repl'])) { $_POST['usr_id'][0] = $lists['repl']->sender_id; } if (isset($_POST['usr_id']) && count($_POST['usr_id'])) { for ($i = 0; $i < count($_POST['usr_id']); $i++) { if ($_POST['usr_id'][$i]) { echo '<tr class="' . JLMSCSS::_('sectiontableentry' . ($z % 2 + 1)) . '">'; echo '<td width="25" aligh="center"><img src="' . $JLMS_CONFIG->get('live_site') . '/' . $JLMS_CONFIG->get('lms_path_to_images') . '/buttons_22/btn_delete_22.png" alt="' . _JLMS_DELETE . '" onclick="Delete_tbl_row(this);" style="cursor:pointer;" /></td>'; echo '<td width="10" aligh="center"><img src="' . $JLMS_CONFIG->get('live_site') . '/' . $JLMS_CONFIG->get('lms_path_to_images') . '//buttons_22/btn_edituser_22.png" /></td>'; if ($JLMS_CONFIG->get('use_global_groups', 0)) { $query = "SELECT a.id, a.name, a.username, a.email, b.ug_name" . "\n FROM #__users as a, #__lms_users_in_global_groups as c" . "\n LEFT JOIN #__lms_usergroups as b ON c.group_id = b.id AND b.course_id = '0'" . "\n WHERE a.id = c.user_id AND a.id=" . intval($_POST['usr_id'][$i]) . "" . "\n ORDER BY b.ug_name, a.username"; $JLMS_DB->SetQuery($query); $users = $JLMS_DB->LoadObjectList(); } else { $query = "SELECT a.id, a.name, a.username, a.email, b.ug_name" . "\n FROM #__users as a, #__lms_users_in_groups as c" . "\n LEFT JOIN #__lms_usergroups as b ON c.group_id = b.id AND b.course_id = '" . $course_id . "'" . "\n WHERE a.id = c.user_id AND c.course_id = '" . $course_id . "' AND a.id=" . intval($_POST['usr_id'][$i]) . "" . "\n ORDER BY b.ug_name, a.username"; $JLMS_DB->SetQuery($query); $users = $JLMS_DB->LoadObjectList(); } if (!count($users)) { $query = "SELECT username,name FROM #__users WHERE id=" . intval($_POST['usr_id'][$i]); $JLMS_DB->SetQuery($query); $users = $JLMS_DB->LoadObjectList(); if (count($users)) { $users[0]->username = _JLMS_ROLE_TEACHER . ' - ' . $users[0]->username . ' (' . $users[0]->name . ')'; } } else { $users[0]->username = ($users[0]->ug_name ? $users[0]->ug_name : '') . ' - ' . $users[0]->username . ' (' . $users[0]->name . ')'; } echo '<td>' . $users[0]->username . '<input type="hidden" name="usr_id[]" value="' . intval($_POST['usr_id'][$i]) . '" /></td>'; echo '</tr>'; $z++; } } } if (isset($_POST['grp_id']) && count($_POST['grp_id'])) { for ($i = 0; $i < count($_POST['grp_id']); $i++) { echo '<tr class="' . JLMSCSS::_('sectiontableentry' . ($z % 2 + 1)) . '">'; echo '<td width="25" aligh="center"><img src="' . $JLMS_CONFIG->get('live_site') . '/' . $JLMS_CONFIG->get('lms_path_to_images') . '/buttons_22/btn_delete_22.png" alt="' . _JLMS_DELETE . '" onclick="Delete_tbl_row(this);" style="cursor:pointer;" /></td>'; echo '<td width="10" aligh="center"><img src="' . $JLMS_CONFIG->get('live_site') . '/' . $JLMS_CONFIG->get('lms_path_to_images') . '/buttons_22/btn_editusergroup_22.png" /></td>'; $query = "SELECT distinct a.ug_name as text FROM #__lms_usergroups as a" . "\n WHERE a.id = '" . intval($_POST['grp_id'][$i]) . "' ORDER BY a.ug_name"; $JLMS_DB->SetQuery($query); echo '<td>' . ($JLMS_DB->loadResult() ? $JLMS_DB->loadResult() : _JLMS_MB_ALL_USRS) . '<input type="hidden" name="grp_id[]" value="' . intval($_POST['grp_id'][$i]) . '" /></td>'; echo '</tr>'; $z++; } } if (isset($_POST['mail_id']) && count($_POST['mail_id'])) { for ($i = 0; $i < count($_POST['mail_id']); $i++) { echo '<tr class="' . JLMSCSS::_('sectiontableentry' . ($z % 2 + 1)) . '">'; echo '<td width="25"><img src="' . $JLMS_CONFIG->get('live_site') . '/' . $JLMS_CONFIG->get('lms_path_to_images') . '/buttons_22/btn_delete_22.png" alt="' . _JLMS_DELETE . '" onclick="Delete_tbl_row(this);" style="cursor:pointer;" /></td>'; echo '<td width="10"><img src="' . $JLMS_CONFIG->get('live_site') . '/' . $JLMS_CONFIG->get('lms_path_to_images') . '/buttons_22/btn_editusergroup_22.png" /></td>'; $query = "SELECT pm_name FROM #__lms_messagelist WHERE id=" . intval(abs($_POST['mail_id'][$i])); $JLMS_DB->SetQuery($query); echo '<td>' . ($JLMS_DB->loadResult() ? $JLMS_DB->loadResult() : _JLMS_MB_ALL_USRS) . '<input type="hidden" name="mail_id[]" value="' . intval($_POST['mail_id'][$i]) . '" /></td>'; echo '</tr>'; $z++; } } ?> </table> <br /> </td> </tr> </table> <div style="clear:both;"></div> <br /> <table width="100%" cellpadding="2" cellspacing="0" border="0" class="jlms_table_no_borders"> <tr> <td valign="top" align="left" > <?php echo _JLMS_MB_SUBJECT; ?> : </td> </tr> <tr> <td> <input type="text" name="jlms_subject" size="60" value="<?php if (isset($lists['repl'])) { echo _JLMS_MB_REPL_RE . $lists['repl']->subject; } ?> " class="inputbox" /> </td> </tr> <tr> <td align="left"> <?php echo _JLMS_MB_TEXT . " :"; ?> </td> </tr> <tr> <td> <?php $curmsg = ''; if (isset($lists['repl'])) { $date_mas = $lists['repl']->data; $main_data = explode('-', substr($date_mas, 0, 10)); $other_data = explode(':', substr($date_mas, 11, 8)); $view_format = date(_JLMS_MB_REPL_DF, mktime($other_data[0], $other_data[1], $other_data[2], $main_data[1], $main_data[2], $main_data[0])); $curmsg_pre = $view_format . ' ' . _JLMS_MB_REPL_YW . ':<br />'; $linebreak = '<br /><br />'; $str = ''; for ($i = 0; $i < 50; $i++) { $str = $str . '-'; } $linebreak .= $str; $linebreak .= '<br />'; $old_msg_external = $lists['repl']->message; $curmsg = $linebreak . $curmsg_pre . $old_msg_external; } jlms_editorArea('editor1', $curmsg, 'jlms_mailbox_letter', '100%;', '250', '40', '20'); ?> </td> </tr> <tr id="hide"> <td> <a href="javascript:void(0)" onclick="javascript:getObj('attach').style.display = '';getObj('hide').style.display = 'none'"><?php echo _JLMS_MB_ATTACH; ?> </a> </td> </tr> <tr style="display:none " id="attach"> <td> <table class="jlms_table_no_borders" width="100%"> <tr> <td> <a href="javascript:void(0)" onclick="javascript:getObj('attach').style.display = 'none';getObj('hide').style.display = ''"><?php echo _JLMS_MB_HIDE; ?> </a> </td> </tr> <tr> <td><input type="file" name="jlms_attach_file" size="60" class="inputbox" /></td> </tr> </table> </td> </tr> </table> <input type="hidden" name="option" value="<?php echo $option; ?> " /> <input type="hidden" name="Itemid" value="<?php echo $Itemid; ?> " /> <input type="hidden" name="task" value="mailbox_new" /> <input type="hidden" name="id" value="<?php echo $course_id; ?> " /> <input type="hidden" name="m_course_id" value="<?php echo isset($lists['repl']->course_id) && $lists['repl']->course_id ? $lists['repl']->course_id : -1; ?> " /> <input type="hidden" name="boxchecked" value="0" /> <input type="hidden" name="state" value="0" /> </form> <?php JLMS_TMPL::CloseTS(); JLMS_TMPL::CloseMT(); // 29.04.2008 - line added by DEN (layout fix) }
function confirm_delUsers(&$del_users, &$lists, $option, $course_id, $group_id, $utype, $del_group) { global $Itemid; ?> <script language="javascript" type="text/javascript"> <!-- function submitbutton(pressbutton) { var form = document.adminForm; if ((pressbutton == 'user_delete_yes') && (form.boxchecked.value == "0")){ alert( "<?php echo _JLMS_USER_SELECT_USER; ?> " ); } else { form.task.value = pressbutton; form.submit(); } } //--> </script> <?php JLMS_TMPL::OpenMT(); $hparams = array(); if ($utype == 1) { $hparams['sys_msg'] = _JLMS_USERS_DEL_ALERT_MESSAGE; } elseif ($utype == 2) { $hparams['sys_msg'] = _JLMS_USERS_DEL_A_ALERT_MESSAGE; } $toolbar = array(); $toolbar[] = array('btn_type' => 'yes', 'btn_js' => "javascript:submitbutton('" . ($group_id == -1 ? 'user_delete_yes2' : 'user_delete_yes') . "');"); $toolbar[] = array('btn_type' => 'cancel', 'btn_js' => "javascript:submitbutton('" . ($group_id == -1 ? 'cancel_csv_delete' : 'cancel_user') . "');"); $hparams['toolbar_position'] = 'center'; JLMS_TMPL::ShowHeader('userman', _JLMS_USERS_DEL_TITLE, $hparams, $toolbar); JLMS_TMPL::OpenTS(); ?> <form action="<?php echo sefRelToAbs("index.php?option=" . $option . "&Itemid=" . $Itemid); ?> " method="post" name="adminForm"> <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 echo JLMSCSS::tableheadertag(); ?> width="20" class="<?php echo JLMSCSS::_('sectiontableheader'); ?> " align="center"><input type="checkbox" name="toggle" value="" onclick="checkAll(<?php echo count($del_users); ?> );" /></<?php echo JLMSCSS::tableheadertag(); ?> > <<?php echo JLMSCSS::tableheadertag(); ?> class="<?php echo JLMSCSS::_('sectiontableheader'); ?> "><?php echo _JLMS_USERS_TBL_HEAD_USERNAME; ?> </<?php echo JLMSCSS::tableheadertag(); ?> > <<?php echo JLMSCSS::tableheadertag(); ?> class="<?php echo JLMSCSS::_('sectiontableheader'); ?> "><?php echo _JLMS_USERS_TBL_HEAD_USER_ADDINFO; ?> </<?php echo JLMSCSS::tableheadertag(); ?> > <<?php echo JLMSCSS::tableheadertag(); ?> class="<?php echo JLMSCSS::_('sectiontableheader'); ?> "><?php echo _JLMS_USERS_TBL_HEAD_USER_GROUP; ?> </<?php echo JLMSCSS::tableheadertag(); ?> > </tr> <?php $k = 1; for ($i = 0, $n = count($del_users); $i < $n; $i++) { $row = $del_users[$i]; $link = "index.php?option=" . $option . "&Itemid=" . $Itemid . "&task=view_users&course_id=" . $course_id . "&id=" . $row->id; $checked = JLMS_course_users_html::idBox($i, $row->id, true); ?> <tr class="<?php echo JLMSCSS::_('sectiontableentry' . $k); ?> "> <td align="center"><?php echo $i + 1; ?> </td> <td><?php echo $checked; ?> </td> <td align="left"> <?php echo $row->username; ?> </td> <td><?php echo $row->name; ?> (<?php echo $row->email; ?> )</td> <?php if ($utype == 1) { ?> <td><?php echo $row->ug_name ? $row->ug_name : _JLMS_USER_NO_GROUP_NAME; ?> </td> <?php } else { ?> <td><?php echo _JLMS_USER_ASSIST_GROUP_NAME; ?> </td> <?php } ?> </tr> <?php $k = 3 - $k; } ?> </table> <input type="hidden" name="option" value="<?php echo $option; ?> " /> <input type="hidden" name="Itemid" value="<?php echo $Itemid; ?> " /> <input type="hidden" name="task" value="delete_user" /> <input type="hidden" name="course_id" value="<?php echo $course_id; ?> " /> <input type="hidden" name="id" value="<?php echo $group_id; ?> " /> <input type="hidden" name="group_id" value="<?php echo $group_id; ?> " /> <input type="hidden" name="boxchecked" value="<?php echo count($del_users); ?> " /> <input type="hidden" name="row_id" value="0" /> <input type="hidden" name="state" value="0" /> <input type="hidden" name="del_group" value="<?php echo $del_group ? '1' : '0'; ?> " /> <input type="hidden" name="utype" value="<?php echo $utype; ?> " /> </form> <?php JLMS_TMPL::CloseTS(); JLMS_TMPL::CloseMT(); }
function JQ_showImgsList(&$rows, &$pageNav, $option, $page, $id) { global $Itemid; $toolbar = array(); $toolbar[] = array('btn_type' => 'new', 'btn_txt' => _JLMS_QUIZ_NEW_IMGS_BTN, 'btn_js' => sefRelToAbs("index.php?option={$option}&Itemid={$Itemid}&id={$id}&task=quizzes&page=add_imgs")); $toolbar[] = array('btn_type' => 'edit', 'btn_txt' => _JLMS_QUIZ_EDIT_IMGS_BTN, 'btn_js' => "javascript:submitbutton('edit_imgs');"); $toolbar[] = array('btn_type' => 'del', 'btn_txt' => _JLMS_QUIZ_DEL_IMGS_BTN, 'btn_js' => "javascript:submitbutton('del_imgs');"); JLMS_quiz_admin_html_class::showQuizHead($id, $option, _JLMS_QUIZ_IMGS_TITLE, true, $toolbar); ?> <script language="javascript" type="text/javascript"> <!-- function submitbutton(pressbutton) { var form = document.adminForm; if ( ((pressbutton == 'edit_imgs') || (pressbutton == 'del_imgs') ) && (form.boxchecked.value == "0")) { alert('<?php echo _JLMS_ALERT_SELECT_ITEM; ?> '); } else { form.page.value = pressbutton; form.submit(); } } //--> </script> <form action="<?php echo sefRelToAbs("index.php?option={$option}&Itemid={$Itemid}"); ?> " method="post" name="adminForm"> <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 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 JLMSCSS::tableheadertag(); ?> > <<?php echo JLMSCSS::tableheadertag(); ?> class="<?php echo JLMSCSS::_('sectiontableheader'); ?> "><?php echo _JLMS_QUIZ_TBL_IMGS_NAME; ?> </<?php echo JLMSCSS::tableheadertag(); ?> > </tr> <?php $k = 1; for ($i = 0, $n = count($rows); $i < $n; $i++) { $row = $rows[$i]; $link = sefRelToAbs("index.php?option=" . $option . "&Itemid=" . $Itemid . "&id={$id}&task=quizzes&page=editA_imgs&c_id=" . $row->c_id); $checked = mosHTML::idBox($i, $row->c_id); ?> <tr class="<?php echo JLMSCSS::_('sectiontableentry' . $k); ?> "> <td align="center"><?php echo $pageNav->limitstart + $i + 1; ?> </td> <td align="center"><?php echo $checked; ?> </td> <td align="left"> <span> <?php #echo mosToolTip( mysql_escape_string(nl2br($row->c_instruction)), _JLMS_QUIZ_CAT_TOOLTIP_HEAD, 280, 'tooltip.png', $row->imgs_name, $link ); ?> <a href="<?php echo $link; ?> " title="<?php echo $row->imgs_name; ?> "> <?php echo $row->imgs_name; ?> </a> </span> </td> </tr> <?php $k = 3 - $k; } ?> <tr> <td colspan="3" align="center" class="<?php echo JLMSCSS::_('jlmslist-footer_td'); ?> "> <div align="center" style="white-space:nowrap "> <?php $link = "index.php?option={$option}&Itemid={$Itemid}&task=quizzes&id={$id}&page={$page}"; echo _JLMS_PN_DISPLAY_NUM . ' ' . $pageNav->getLimitBox($link) . ' ' . $pageNav->getPagesCounter(); echo '<br />'; echo $pageNav->writePagesLinks($link); ?> </div> </td> </tr> </table> <input type="hidden" name="option" value="<?php echo $option; ?> " /> <input type="hidden" name="page" value="<?php echo $page; ?> " /> <input type="hidden" name="task" value="quizzes" /> <input type="hidden" name="boxchecked" value="0" /> <input type="hidden" name="id" value="<?php echo $id; ?> " /> </form> <?php JLMS_quiz_admin_html_class::showQuizFooter(); ?> <?php }
function jlms_conference_archive($course_id, $option, $records, $pageNav) { global $my, $Itemid, $JLMS_CONFIG, $JLMS_SESSION; //$usertype = $JLMS_CONFIG->get('current_usertype') ; $JLMS_ACL =& JLMSFactory::getACL(); ?> <script type="text/javascript" language="javascript"> <!--//--><![CDATA[//><!-- function submitbutton(pressbutton) { var form = document.adminForm; if ( form.boxchecked.value == "0" ){ alert("<?php echo _JLMS_ALERT_SELECT_ITEM; ?> "); } else { if (pressbutton == 'record_delete'){ if (confirm("<?php echo 'Are you sure?'; ?> ") == true){ form.mode.value = pressbutton; form.submit(); } }else{ form.mode.value = pressbutton; form.submit(); } } } function startAppPlayback(path) { var y= (screen.height/2) - 359; var x= (screen.width/2) - 510 ; window.open(path,'Conference_playback','top='+y+', left='+x+',width=995, height=640, scrollbars=no, status=0, toolbar=no, resizable=yes'); } function submitbutton_change(pressbutton, state) { var form = document.adminForm; if (pressbutton == 'change_record'){ if (form.boxchecked.value == "0") { alert("<?php echo _JLMS_ALERT_SELECT_ITEM; ?> "); } else { form.mode.value = pressbutton; form.state.value = state; form.submit(); } } } function submitbutton_change_record(pressbutton, state, cid_id) { var form = document.adminForm; if (pressbutton == 'change_record'){ form.mode.value = pressbutton; form.state.value = state; form.cid2.value = cid_id; form.submit(); } } //--><!]]> </script> <?php JLMS_TMPL::OpenMT(); $params = array('show_menu' => true); JLMS_TMPL::ShowHeader('conference', _JLMS_HEAD_CONF_STR, $params); JLMS_TMPL::OpenTS(); //'', ' align="right" style="text-align:right " width="100%"'); ?> <table width="100%" cellpadding="0" cellspacing="0" border="0" class="jlms_table_no_borders"> <tr> <td colspan="2"> </td> <td style="text-align:right;"><br /> <?php $toolbar = array(); //$toolbar[] = array('btn_type' => 'edit', 'btn_js' => sefRelToAbs("index.php?option=$option&Itemid=$Itemid&task=conference&id=$course_id&mode=archive") ); $toolbar[] = array('btn_type' => 'back', 'btn_js' => sefRelToAbs("index.php?option={$option}&Itemid={$Itemid}&task=conference&id={$course_id}")); echo JLMS_ShowToolbar($toolbar); ?> </td> </tr> </table> <?php JLMS_TMPL::CloseTS(); JLMS_TMPL::OpenTS(); ?> <form action="<?php echo sefRelToAbs("index.php?option={$option}&Itemid={$Itemid}"); ?> " method="post" name="adminForm"> <table width="100%" cellpadding="0" cellspacing="0" border="0" class="<?php echo JLMSCSS::_('jlmslist'); ?> "> <tr> <<?php echo JLMSCSS::tableheadertag(); ?> class="<?php echo JLMSCSS::_('sectiontableheader'); ?> " align="left" width="15">#</<?php echo JLMSCSS::tableheadertag(); ?> > <?php if ($JLMS_ACL->CheckPermissions('conference', 'manage')) { ?> <<?php echo JLMSCSS::tableheadertag(); ?> class="<?php echo JLMSCSS::_('sectiontableheader'); ?> " align="left" width="10"><input type="checkbox" name="toggle" value="" onclick="checkAll(<?php echo count($records); ?> );" /></<?php echo JLMSCSS::tableheadertag(); ?> > <?php } ?> <<?php echo JLMSCSS::tableheadertag(); ?> class="<?php echo JLMSCSS::_('sectiontableheader'); ?> " width="25%" align="left"><?php echo _JLMS_CONFERENCE_RECORD; ?> </<?php echo JLMSCSS::tableheadertag(); ?> > <?php if ($JLMS_ACL->CheckPermissions('conference', 'manage')) { ?> <<?php echo JLMSCSS::tableheadertag(); ?> class="<?php echo JLMSCSS::_('sectiontableheader'); ?> " width="140" align="left"><?php echo _JLMS_CONFERENCE_SESSION; ?> </<?php echo JLMSCSS::tableheadertag(); ?> > <?php } ?> <<?php echo JLMSCSS::tableheadertag(); ?> class="<?php echo JLMSCSS::_('sectiontableheader'); ?> " width="110" align="left"><?php echo _JLMS_CONFERENCE_RECORD_START; ?> </<?php echo JLMSCSS::tableheadertag(); ?> > <?php if ($JLMS_ACL->CheckPermissions('conference', 'manage')) { ?> <<?php echo JLMSCSS::tableheadertag(); ?> class="<?php echo JLMSCSS::_('sectiontableheader'); ?> " width="50" align="center"> </<?php echo JLMSCSS::tableheadertag(); ?> > <?php } ?> <<?php echo JLMSCSS::tableheadertag(); ?> class="<?php echo JLMSCSS::_('sectiontableheader'); ?> "> </<?php echo JLMSCSS::tableheadertag(); ?> > <<?php echo JLMSCSS::tableheadertag(); ?> class="<?php echo JLMSCSS::_('sectiontableheader'); ?> " width="100" align="center" style="text-align:center;"><?php echo _JLMS_CONFERENCE_RECORD_PB; ?> </<?php echo JLMSCSS::tableheadertag(); ?> > </tr> <?php $k = 1; for ($i = 0, $n = count($records); $i < $n; $i++) { $row = $records[$i]; $link = sefRelToAbs("index.php?option=" . $option . "&Itemid=" . $Itemid . "&task=details_course&id=" . $row->id); $checked = mosHTML::idBox($i, $row->id); $overlib_descr = JLMS_txt2overlib($row->description); $overlib_title = "Description"; ?> <tr valign="middle" style="vertical-align:middle" class="<?php echo JLMSCSS::_('sectiontableentry' . $k); ?> "> <td align="left"><?php echo $pageNav->limitstart + $i + 1; ?> </td> <?php if ($JLMS_ACL->CheckPermissions('conference', 'manage')) { ?> <td align="left"><?php echo $checked; ?> </td> <?php } ?> <td align="left"> <?php $inside_tag = $row->record_name ? $row->record_name : "Record"; $link_href = "javascript:startAppPlayback('" . $JLMS_CONFIG->get('live_site') . '/index.php?tmpl=component&option=com_joomla_lms&task=conference&mode=conference_playback&Itemid=' . $Itemid . '&id=' . $course_id . '&name=' . $row->session_name . "');"; echo JLMS_toolTip($overlib_title, $overlib_descr, $inside_tag, $link_href); ?> <br /> <span class="small"><?php echo _JLMS_HOME_AUTHOR . " " . $row->username; ?> </span> </td> <?php if ($JLMS_ACL->CheckPermissions('conference', 'manage')) { ?> <td align="left"> <?php echo $row->session_name; /* <a href="javascript:startAppPlayback('<?php echo sefRelToAbs('index.php?tmpl=component&option=com_joomla_lms&task=conference&mode=conference_playback&Itemid='.$Itemid.'&id='.$course_id.'&name='.$row->record_name );?>');" title="View details"> <?php echo $row->session_name;?> </a> */ ?> </td> <?php } ?> <td align="left"><?php echo JLMS_dateToDisplay($row->start_date); ?> </td> <?php if ($JLMS_ACL->CheckPermissions('conference', 'manage')) { ?> <td align="center" valign="middle"> <?php if ($JLMS_ACL->CheckPermissions('conference', 'manage')) { $alt = $row->published ? _JLMS_STATUS_PUB : _JLMS_STATUS_UNPUB; $image = $row->published ? 'btn_accept.png' : 'btn_cancel.png'; $state = $row->published ? 0 : 1; echo '<a href="javascript:submitbutton_change_record(\'change_record\', ' . $state . ', ' . $row->id . ')" title="' . $alt . '"><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 . '" /></a>'; } ?> </td> <?php } ?> <td> </td> <td align="center" valign="middle"> <a href="javascript:startAppPlayback('<?php echo $JLMS_CONFIG->get('live_site') . '/index.php?tmpl=component&option=com_joomla_lms&task=conference&mode=conference_playback&Itemid=' . $Itemid . '&id=' . $course_id . '&name=' . $row->session_name; ?> ');" title="<?php echo _JLMS_CONFERENCE_RECORD_PB; ?> " > <img class="JLMS_png" src="<?php echo $JLMS_CONFIG->get('live_site'); ?> /components/com_joomla_lms/lms_images/toolbar/btn_playback.png" width="16" height="16" border="0" alt="<?php echo _JLMS_CONFERENCE_RECORD_PB; ?> " title="<?php echo _JLMS_CONFERENCE_RECORD_PB; ?> " /> </a> </td> </tr> <?php $k = 3 - $k; } ?> <tr> <td class="<?php echo JLMSCSS::_('jlmslist-footer_td'); ?> " colspan="<?php echo $JLMS_ACL->CheckPermissions('conference', 'manage') ? 8 : 5; ?> " align="center"><div align="center"> <?php if (count($records) == 0) { echo _JLMS_CONFERENCE_NO_RECORD; } else { $link_PN = "index.php?option={$option}&Itemid={$Itemid}&task=conference&mode=archive&course_id=" . $course_id; echo _JLMS_PN_DISPLAY_NUM . $pageNav->getLimitBox($link_PN) . " " . $pageNav->getPagesCounter($link_PN) . '<br />'; echo $pageNav->writePagesLinks($link_PN); } ?> </div></td> </tr> </table> <input type="hidden" name="task" value="conference" /> <input type="hidden" name="mode" value="" /> <input type="hidden" name="boxchecked" value="0" /> <input type="hidden" name="id" value="<?php echo $course_id; ?> " /> <input type="hidden" name="state" value="0" /> <input type="hidden" name="cid2" value="0" /> </form> <?php JLMS_TMPL::CloseTS(); if ($JLMS_ACL->CheckPermissions('conference', 'manage')) { $controls = array(); $controls[] = array('href' => "javascript:submitbutton_change('change_record',1);", 'title' => _JLMS_SET_PUB, 'img' => 'publish'); $controls[] = array('href' => "javascript:submitbutton_change('change_record',0);", 'title' => _JLMS_SET_UNPUB, 'img' => 'unpublish'); $controls[] = array('href' => 'spacer'); $controls[] = array('href' => "javascript:submitbutton('record_delete');", 'title' => _JLMS_DELETE, 'img' => 'delete'); $controls[] = array('href' => "javascript:submitbutton('edit_record');", 'title' => _JLMS_EDIT, 'img' => 'edit'); JLMS_TMPL::ShowControlsFooter($controls, sefRelToAbs("index.php?option={$option}&Itemid={$Itemid}&task=conference&id={$course_id}")); } JLMS_TMPL::CloseMT(); }
function ShowCertificates($option, $id, &$rows) { global $Itemid; $JLMS_CONFIG =& JLMSFactory::getConfig(); $toolbar = array(); $toolbar[] = array('btn_type' => 'new', 'btn_txt' => _JLMS_QUIZ_NEW_CRTF_BTN, 'btn_js' => sefRelToAbs("index.php?option={$option}&Itemid={$Itemid}&id={$id}&task=quizzes&page=add_crtf")); $toolbar[] = array('btn_type' => 'edit', 'btn_txt' => _JLMS_QUIZ_EDIT_CRTF_BTN, 'btn_js' => "javascript:submitbutton('edit_crtf');"); $toolbar[] = array('btn_type' => 'del', 'btn_txt' => _JLMS_QUIZ_DEL_CRTF_BTN, 'btn_js' => "javascript:submitbutton('del_crtf');"); $toolbar[] = array('btn_type' => 'preview', 'btn_txt' => _JLMS_QUIZ_PREVIEW_CRTF_BTN, 'btn_js' => "javascript:submit_preview();"); JLMS_quiz_admin_html_class::showQuizHead($id, $option, _JLMS_QUIZ_CERTIFICATES_TITLE, true, $toolbar); ?> <script language="javascript" type="text/javascript"> <!-- function submitbutton(pressbutton) { var form = document.adminForm; if ( ((pressbutton == 'edit_crtf') || (pressbutton == 'del_crtf') ) && (form.boxchecked.value == "0")) { alert('<?php echo _JLMS_ALERT_SELECT_ITEM; ?> '); } else { form.page.value = pressbutton; form.submit(); } } function submit_preview() { var crtf_id = 0; var form = document.adminForm; if (form.boxchecked.value == "0") { alert('<?php echo _JLMS_ALERT_SELECT_ITEM; ?> '); } else { var selItem = document.adminForm['cid[]']; if (selItem) { if (selItem.length) { var i; for (i = 0; i<selItem.length; i++) { if (selItem[i].checked) { if (selItem[i].value > 0) { crtf_id = selItem[i].value; break; } } } } else if (selItem.checked) { crtf_id = selItem.value; } } if (crtf_id != '0' && crtf_id != '0') { window.open('<?php echo $JLMS_CONFIG->get('live_site') . "/index.php?tmpl=component&option=com_joomla_lms&Itemid={$Itemid}&no_html=1&task=quizzes&id={$id}&page=preview_crtf&crtf_id='+crtf_id+'"; ?> '); } } } //--> </script> <form action="<?php echo sefRelToAbs("index.php?option={$option}&Itemid={$Itemid}"); ?> " method="post" name="adminForm"> <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 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 JLMSCSS::tableheadertag(); ?> > <<?php echo JLMSCSS::tableheadertag(); ?> class="<?php echo JLMSCSS::_('sectiontableheader'); ?> "><?php echo _JLMS_QUIZ_TBL_CRTF_NAME; ?> </<?php echo JLMSCSS::tableheadertag(); ?> > </tr> <?php $k = 1; for ($i = 0, $n = count($rows); $i < $n; $i++) { $row = $rows[$i]; #$link = sefRelToAbs("index.php?option=".$option."&Itemid=".$Itemid."&task=quizzes&id=$id&page=quizzes&cat_id=". $row->c_id); $checked = mosHTML::idBox($i, $row->id); ?> <tr class="<?php echo JLMSCSS::_('sectiontableentry' . $k); ?> "> <td align="center"><?php echo $i + 1; ?> </td> <td align="center"><?php echo $checked; ?> </td> <td align="left"> <?php echo $row->crtf_name ? $row->crtf_name : $row->crtf_text; ?> </td> </tr> <?php $k = 3 - $k; } ?> </table> <input type="hidden" name="option" value="<?php echo $option; ?> " /> <input type="hidden" name="page" value="" /> <input type="hidden" name="task" value="quizzes" /> <input type="hidden" name="boxchecked" value="0" /> <input type="hidden" name="id" value="<?php echo $id; ?> " /> </form> <?php JLMS_quiz_admin_html_class::showQuizFooter(); }