/** * Display a standart pager tool bar * * @author Hugues Peeters <*****@*****.**> * @param string $url - where the pager tool bar commands need to point to * @param int $linkMax - (optionnal) maximum of page links in the pager tool bar * @return string */ function disp_pager_tool_bar($url, $linkMax = 10) { $startPage = $this->get_first_offset(); $previousPage = $this->get_previous_offset(); $pageList = $this->get_offset_list(); $nextPage = $this->get_next_offset(); $endPage = $this->get_last_offset(); if (strrpos($url, '?') === false) { $url .= '?' . $this->pagerParamName . '='; } else { $url .= '&' . $this->pagerParamName . '='; } $output = "\n\n" . '<div class="claroPager">' . "\n" . '<span class="pagerBefore">' . "\n"; if ($previousPage !== false) { $output .= '<b>' . '<a href="' . $url . $startPage . '">' . claro_html_icon('pager_first') . '</a> ' . '<a href="' . $url . $previousPage . '">' . claro_html_icon('pager_previous') . '</a>' . '</b>'; } else { $output .= ' '; } $output .= "\n" . '</span>' . "\n" . '<span class="pagerPages">' . "\n"; // current page $currentPage = (int) $this->offset / $this->step; // total page $pageCount = $this->get_offset_count(); // start page if ($currentPage > $linkMax) { $firstLink = $currentPage - $linkMax; } else { $firstLink = 0; } // end page if ($currentPage + $linkMax < $pageCount) { $lastLink = $currentPage + $linkMax; } else { $lastLink = $pageCount; } // display 1 ... {start_page} if ($firstLink > 0) { $output .= '<a href="' . $url . $pageList[0] . '">' . (0 + 1) . '</a> '; if ($firstLink > 1) { $output .= '... '; } } if ($pageCount > 1) { // display page for ($link = $firstLink; $link < $lastLink; $link++) { if ($currentPage == $link) { $output .= '<b>' . ($link + 1) . '</b> '; // current page } else { $output .= '<a href="' . $url . $pageList[$link] . '">' . ($link + 1) . '</a> '; } } } // display 1 ... {start_page} if ($lastLink < $pageCount) { if ($lastLink + 1 < $pageCount) { $output .= '...'; } $output .= ' <a href="' . $url . $pageList[$pageCount - 1] . '">' . $pageCount . '</a>'; } $output .= "\n" . '</span>' . "\n" . '<span class="pagerAfter">' . "\n"; if ($nextPage !== false) { $output .= '<b>' . '<a href="' . $url . $nextPage . '">' . claro_html_icon('pager_next') . '</a> ' . '<a href="' . $url . $endPage . '">' . claro_html_icon('pager_last') . '</a>' . '</b>'; } else { $output .= ' '; } $output .= "\n" . '</span>' . "\n" . '</div>' . "\n\n"; return $output; }
$nameTools = get_lang('Manage user desktop'); $output = ''; $output .= claro_html_tool_title($nameTools); $output .= $dialogBox->render(); $output .= '<table class="claroTable emphaseLine" ' . 'width="100%" border="0" cellspacing="2">' . "\n" . '<thead>' . "\n" . '<tr align="center" valign="top">' . "\n" . '<th>' . get_lang('Title') . '</th>' . "\n" . '<th>' . get_lang('Visibility') . '</th>' . "\n" . '<th colspan="2">' . get_lang('Order') . '</th>' . "\n" . '</tr>' . "\n" . '</thead>' . "\n" . '<tbody>' . "\n"; if (is_array($portletList) && !empty($portletList)) { // only used to hide first up and last down commands $portletListSize = count($portletList); $i = 0; foreach ($portletList as $portlet) { $i++; $output .= "\n" . '<tr>' . "\n" . '<td>' . claro_htmlspecialchars(get_lang($portlet['name'])) . '</td>' . "\n"; if ($portlet['visibility'] == 'visible') { $output .= "\n" . '<td align="center">' . "\n" . '<a href="' . claro_htmlspecialchars(Url::Contextualize($_SERVER['PHP_SELF'] . '?cmd=exInvisible&label=' . claro_htmlspecialchars($portlet['label']))) . '">' . claro_html_icon('visible') . '</a>' . "\n" . '</td>' . "\n"; } else { $output .= "\n" . '<td align="center">' . "\n" . '<a href="' . claro_htmlspecialchars(Url::Contextualize($_SERVER['PHP_SELF'] . '?cmd=exVisible&label=' . claro_htmlspecialchars($portlet['label']))) . '">' . claro_html_icon('invisible') . '</a>' . "\n" . '</td>' . "\n"; } if ($i > 1) { $output .= '<td align="center">' . '<a href="' . claro_htmlspecialchars(Url::Contextualize($_SERVER['PHP_SELF'] . '?label=' . claro_htmlspecialchars($portlet['label']) . '&cmd=exUp')) . '">' . '<img src="' . get_icon_url('move_up') . '" alt="' . get_lang('Move up') . '" />' . '</a>' . '</td>' . "\n"; } else { $output .= '<td> </td>' . "\n"; } if ($i < $portletListSize) { $output .= '<td align="center">' . '<a href="' . claro_htmlspecialchars(Url::Contextualize($_SERVER['PHP_SELF'] . '?label=' . claro_htmlspecialchars($portlet['label']) . '&cmd=exDown')) . '">' . '<img src="' . get_icon_url('move_down') . '" alt="' . get_lang('Move down') . '" />' . '</a>' . '</td>' . "\n"; } else { $output .= '<td> </td>' . "\n"; } $output .= '</tr>' . "\n"; } } else { $output .= '<tr><td colspan="4">' . get_lang('Empty') . '</tr></td>' . "\n";
/** * Add a claroCmd button with icon to HTML output * @param string targetUrl url of the target page * @param string iconName name of the icon with or without file extension * (optional, default none) * @param string buttonText text of the button * (optional, default none) * @param string toolTip tooltip of the button * (optional, default none) */ function claro_html_icon_button($targetUrl, $iconName = '', $buttonText = '', $toolTip = '') { return '<a class="claroCmd"' . "\n" . ' href="' . $targetUrl . '"' . ($toolTip ? "\n" . ' title="' . claro_htmlspecialchars($toolTip) . '"' : '') . '>' . "\n" . ($iconName ? claro_html_icon($iconName) . "\n" : '') . ($buttonText ? claro_htmlspecialchars($buttonText) . "\n" : '') . '</a>'; }
/** * Render a link to register. */ private function renderRegistrationLink() { return '<a href="' . claro_htmlspecialchars(get_path('clarolineRepositoryWeb') . 'auth/courses.php?cmd=exReg&course=' . claro_get_current_course_id()) . '">' . claro_html_icon('enroll') . ' ' . '<b>' . get_lang('Enrolment') . '</b>' . '</a>'; }
public function render() { $nodeHtml = ''; if (!empty($this->url)) { $nodeHtml .= '<a href="' . $this->url . '" target="_top">'; } if (!empty($this->icon)) { $nodeHtml .= claro_html_icon('home', null, null) . ' '; } $nodeHtml .= $this->name; if (!empty($this->url)) { $nodeHtml .= '</a>'; } return $nodeHtml; }
if (!claro_is_platform_admin()) { $courseStatus = claro_get_current_course_data('status'); if ($courseStatus == 'trash' || $courseStatus == 'disable') { Claroline::getDisplay()->body->hideCourseTitleAndTools(); claro_die(get_lang('This course is not available anymore, please contact the platform administrator.')); } } // post kernel access check if (claro_is_in_a_course()) { if (!(basename(php_self()) == 'courses.php' && isset($_REQUEST['cmd']) && $_REQUEST['cmd'] == 'exReg')) { if (!claro_is_course_allowed()) { if (!claro_is_user_authenticated()) { claro_disp_auth_form(); } else { if (claro_get_current_course_data('access') == 'private' && !claro_is_course_member()) { claro_die(get_lang("You have to be enroled to this course to access its contents") . '<br /><a href="' . claro_htmlspecialchars(get_path('clarolineRepositoryWeb') . 'auth/courses.php?cmd=exReg&course=' . claro_get_current_course_id()) . '">' . claro_html_icon('enroll') . ' ' . '<b>' . get_lang('Enrolment') . '</b>' . '</a>'); } else { claro_die(get_lang("Not allowed!")); } } } } } // group_space.php?registration=1&selfReg=1 if (claro_is_in_a_group()) { if (!(basename(php_self()) == 'group_space.php' && isset($_REQUEST['registration']) && $_REQUEST['registration'] == '1')) { if (!claro_is_group_allowed()) { if (!claro_is_user_authenticated()) { claro_disp_auth_form(); } else { claro_die(get_lang("Not allowed!"));