本文整理汇总了PHP中learnpath::rl_get_resource_name方法的典型用法代码示例。如果您正苦于以下问题:PHP learnpath::rl_get_resource_name方法的具体用法?PHP learnpath::rl_get_resource_name怎么用?PHP learnpath::rl_get_resource_name使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类learnpath
的用法示例。
在下文中一共展示了learnpath::rl_get_resource_name方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getLpStats
//.........这里部分代码省略.........
if (!empty($view)) {
$viewCondition = " AND v.view_count = {$view} ";
}
$sql = "SELECT\n iv.status as mystatus,\n v.view_count as mycount,\n iv.score as myscore,\n iv.total_time as mytime,\n i.id as myid,\n i.lp_id as mylpid,\n iv.lp_view_id as mylpviewid,\n i.title as mytitle,\n i.max_score as mymaxscore,\n iv.max_score as myviewmaxscore,\n i.item_type as item_type,\n iv.view_count as iv_view_count,\n iv.id as iv_id,\n path\n FROM {$TBL_LP_ITEM} as i\n INNER JOIN {$TBL_LP_ITEM_VIEW} as iv\n ON (i.id = iv.lp_item_id AND i.c_id = iv.c_id)\n INNER JOIN {$TBL_LP_VIEW} as v\n ON (iv.lp_view_id = v.id AND v.c_id = iv.c_id)\n WHERE\n v.c_id = {$course_id} AND\n i.id = {$my_item_id} AND\n i.lp_id = {$lp_id} AND\n v.user_id = {$user_id} AND\n v.session_id = {$session_id}\n {$viewCondition}\n ORDER BY iv.view_count {$order} ";
$result = Database::query($sql);
$num = Database::num_rows($result);
$time_for_total = 'NaN';
// Extend all
if (($extend_this || $extend_all) && $num > 0) {
$row = Database::fetch_array($result);
$result_disabled_ext_all = false;
if ($row['item_type'] == 'quiz') {
// Check results_disabled in quiz table.
$my_path = Database::escape_string($row['path']);
$sql = "SELECT results_disabled\n FROM {$TBL_QUIZ}\n WHERE\n c_id = {$course_id} AND\n id ='" . $my_path . "'";
$res_result_disabled = Database::query($sql);
$row_result_disabled = Database::fetch_row($res_result_disabled);
if (Database::num_rows($res_result_disabled) > 0 && (int) $row_result_disabled[0] === 1) {
$result_disabled_ext_all = true;
}
}
// If there are several attempts, and the link to extend has been clicked, show each attempt...
if ($counter % 2 == 0) {
$oddclass = 'row_odd';
} else {
$oddclass = 'row_even';
}
$extend_link = '';
if (!empty($inter_num)) {
$extend_link = Display::url(Display::return_icon('visible.gif', get_lang('HideAttemptView')), api_get_self() . '?action=stats&fold_id=' . $my_item_id . $url_suffix);
}
$title = $row['mytitle'];
if (empty($title)) {
$title = learnpath::rl_get_resource_name($courseInfo['code'], $lp_id, $row['myid']);
}
if (in_array($row['item_type'], $chapterTypes)) {
$title = "<h4> {$title} </h4>";
}
$lesson_status = $row['mystatus'];
$title = Security::remove_XSS($title);
$counter++;
$action = null;
if ($type == 'classic') {
$action = '<td></td>';
}
if (in_array($row['item_type'], $chapterTypes)) {
$output .= '<tr class="' . $oddclass . '">
<td>' . $extend_link . '</td>
<td colspan="4">
' . $title . '
</td>
<td colspan="2">' . learnpathItem::humanize_status($lesson_status, true, $type) . '</td>
<td colspan="2"></td>
<td colspan="2"></td>
' . $action . '
</tr>';
continue;
} else {
$output .= '<tr class="' . $oddclass . '">
<td>' . $extend_link . '</td>
<td colspan="4">
' . $title . '
</td>
<td colspan="2"></td>
<td colspan="2"></td>
<td colspan="2"></td>