本文整理汇总了PHP中clean_str_for_javascript函数的典型用法代码示例。如果您正苦于以下问题:PHP clean_str_for_javascript函数的具体用法?PHP clean_str_for_javascript怎么用?PHP clean_str_for_javascript使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了clean_str_for_javascript函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: prepareFiles
//.........这里部分代码省略.........
$pageBody = '<body onload="loadPage()">
<div id="claroBody"><form id="quiz">
<table width="100%" border="0" cellpadding="1" cellspacing="0" class="claroTable">' . "\n";
// Get the question list
$questionList = $quiz->getQuestionList();
$questionCount = count($questionList);
// Keep track of raw scores (ponderation) for each question
$questionPonderationList = array();
// Keep track of correct texts for fill-in type questions
// TODO La variable $fillAnswerList n'apparaît qu'une fois
$fillAnswerList = array();
// Display each question
$questionCount = 0;
foreach ($questionList as $question) {
// Update question number
$questionCount++;
// read the question, abort on error
$scormQuestion = new ScormQuestion();
if (!$scormQuestion->load($question['id'])) {
$this->error[] = get_lang('Unable to load exercise\'s question');
return false;
}
$questionPonderationList[] = $scormQuestion->getGrade();
$pageBody .= '<thead>' . "\n" . '<tr>' . "\n" . '<th>' . get_lang('Question') . ' ' . $questionCount . '</th>' . "\n" . '</tr>' . "\n" . '</thead>' . "\n";
$pageBody .= '<tr>' . "\n" . '<td>' . "\n" . $scormQuestion->export() . "\n" . '</td>' . "\n" . '</tr>' . "\n";
}
$pageEnd = '
<tr>
<td align="center"><br /><input type="button" value="' . get_lang('Ok') . '" onclick="calcScore()" /></td>
</tr>
</table>
</form>
</div></body></html>' . "\n";
/* Generate the javascript that'll calculate the score
* We have the following variables to help us :
* $idCounter : number of elements to check. their id are "scorm_XY"
* $raw_to_pass : score (on 100) needed to pass the quiz
* $fillAnswerList : a list of arrays (text, score) indexed on <input>'s names
*
*/
$pageHeader .= '
<script type="text/javascript" language="javascript">
var raw_to_pass = ' . $completionThresold . ';
var weighting = ' . array_sum($questionPonderationList) . ';
var rawScore;
var scoreCommited = false;
var showScore = true;
var fillAnswerList = new Array();' . "\n";
// This is the actual code present in every exported exercise.
// use claro_html_entity_decode in output to prevent double encoding errors with some languages...
$pageHeader .= '
function calcScore()
{
if( !scoreCommited )
{
rawScore = CalculateRawScore(document, ' . getIdCounter() . ', fillAnswerList);
var score = Math.max(Math.round(rawScore * 100 / weighting), 0);
var oldScore = doLMSGetValue("cmi.score.raw");
doLMSSetValue("cmi.score.max", weighting);
doLMSSetValue("cmi.score.min", 0);
computeTime();
if (score > oldScore) // Update only if score is better than the previous time.
{
doLMSSetValue("cmi.raw", rawScore);
}
var oldStatus = doLMSGetValue( "cmi.completion_status" )
if (score >= raw_to_pass)
{
doLMSSetValue("cmi.completion_status", "completed");
}
else if (oldStatus != "completed" ) // If passed once, never mark it as failed.
{
doLMSSetValue("cmi.completion_status", "failed");
}
doLMSCommit();
doLMSFinish();
scoreCommited = true;
if(showScore) alert(\'' . clean_str_for_javascript(claro_html_entity_decode(get_lang('Score'))) . ' :\\n\' + rawScore + \'/\' + weighting );
}
}
</script>
';
// Construct the HTML file and save it.
$filename = "quiz_" . $quizId . ".html";
$pageContent = $pageHeader . $pageBody . $pageEnd;
if (!($f = fopen($destDir . '/' . $filename, 'w'))) {
$this->error = get_lang('Unable to create file : ') . $filename;
return false;
}
fwrite($f, $pageContent);
fclose($f);
return true;
}
示例2: get_lang
?>
" alt="<?php
echo get_lang('Empty');
?>
" />
</a>
</td>
<td align="center">
<?php
if (is_null($thisForum['group_id'])) {
?>
<a href="<?php
echo get_lang(claro_htmlspecialchars(Url::Contextualize($_SERVER['PHP_SELF'] . '?cmd=exDelForum&forumId=' . $thisForum['forum_id'])));
?>
" onclick="return confirm_delete('<?php
echo clean_str_for_javascript($thisForum['forum_name']);
?>
');">
<img src="<?php
echo get_icon_url('delete');
?>
" alt="<?php
echo get_lang('Delete');
?>
" />
</a>
<?php
}
?>
</td>
<td align="center">
示例3: deleteSelection
$orderLink = $_SERVER['PHP_SELF'] . '?' . $argLink;
if ($argLink != "") {
$orderLink .= "&";
}
$orderLink .= "order=" . $nextOrder . "&";
$javascriptDelete = '
<script type="text/javascript">
function deleteSelection ()
{
if ( $("input[@type=checkbox][@checked]").size() < 1 )
{
return false;
}
if (confirm("' . clean_str_for_javascript(get_lang('Are you sure to delete selected message(s) ?')) . '"))
{
$("input[@name=cmd]").val("exDeleteSelection");
return true;
}
else
{
return false;
}
}
</script>';
$claroline->display->header->addHtmlHeader($javascriptDelete);
$argDeleteSelection = makeArgLink($arguments, array('cmd'));
$content .= '<form action="' . $_SERVER['PHP_SELF'] . '?' . $argDeleteSelection . '" method="post"
onsubmit="return deleteSelection(this)">' . "\n" . '<input type="hidden" name="cmd" value="rqDeleteSelection" />' . "\n\n";
$content .= '<br />' . '<table class="claroTable emphaseLine" width="100%">' . "\n\n" . '<thead>' . '<tr>' . "\n" . '<th> </th>' . "\n" . '<th>' . get_lang('Subject') . '</th>' . "\n" . '<th><a href="' . $orderLink . 'fieldOrder=name">' . get_lang('Sender') . '</a></th>' . "\n" . '<th><a href="' . $orderLink . 'fieldOrder=username">' . get_lang('Username') . '</a></th>' . "\n" . '<th><a href="' . $orderLink . 'fieldOrder=date">' . get_lang('Date') . '</a></th>' . "\n" . '<th class="im_list_action">' . get_lang('Delete') . '</th>' . "\n" . '</tr>' . "\n" . '</thead>' . "\n";
示例4: course_user_get_properties
$courseUserProperties = course_user_get_properties($uidToEdit, $cidToEdit);
}
//------------------------------------
// PREPARE DISPLAY
//------------------------------------
// Javascript confirm pop up declaration for header
JavascriptLanguage::getInstance()->addLangVar('Are you sure you want to unregister %name ?');
JavascriptLoader::getInstance()->load('admin');
$displayBackToCU = false;
$displayBackToUC = false;
if ('culist' == $ccfrom) {
$displayBackToCU = TRUE;
} elseif ('uclist' == $ccfrom) {
$displayBackToUC = TRUE;
}
$cmd_menu[] = '<a class="claroCmd" href="adminuserunregistered.php' . '?cidToEdit=' . $cidToEdit . '&cmd=UnReg' . '&uidToEdit=' . $uidToEdit . '" ' . ' onclick="return ADMIN.confirmationUnReg(\'' . clean_str_for_javascript(claro_htmlspecialchars($courseUserProperties['firstName']) . ' ' . claro_htmlspecialchars($courseUserProperties['lastName'])) . '\');">' . get_lang('Unsubscribe') . '</a>';
$cmd_menu[] = '<a class="claroCmd" href="admin_profile.php' . '?uidToEdit=' . $uidToEdit . '">' . get_lang('User settings') . '</a>';
//link to go back to list : depend where we come from...
if ($displayBackToCU) {
$cmd_menu[] = '<a class="claroCmd" href="admincourseusers.php' . '?cidToEdit=' . $cidToEdit . '&uidToEdit=' . $uidToEdit . '">' . get_lang('Back to list') . '</a> ';
} elseif ($displayBackToUC) {
$cmd_menu[] = '<a class="claroCmd" href="adminusercourses.php' . '?cidToEdit=' . $cidToEdit . '&uidToEdit=' . $uidToEdit . '">' . get_lang('Back to list') . '</a> ';
}
//------------------------------------
// DISPLAY
//------------------------------------
$out = '';
// Display tool title
$out .= claro_html_tool_title(array('mainTitle' => $nameTools, 'subTitle' => get_lang('Course') . ' : ' . claro_htmlspecialchars($courseUserProperties['courseName']) . '<br />' . get_lang('User') . ' : ' . claro_htmlspecialchars($courseUserProperties['firstName']) . ' ' . claro_htmlspecialchars($courseUserProperties['lastName'])));
// Display Forms or dialog box(if needed)
$out .= $dialogBox->render();
示例5: choose_image
} else {
if ($module['contentType'] == CTMEDIA_ || $module['contentType'] == CTMEDIALINK_) {
$moduleImg = "fa-film";
} else {
$moduleImg = choose_image(basename($module['path']));
}
}
}
}
}
$contentType_alt = selectAlt($module['contentType']);
$tool_content .= "<span style=\"vertical-align: middle;\">" . icon($moduleImg, $contentType_alt) . "</span> <a href=\"viewer.php?course={$course_code}&path_id=" . (int) $_SESSION['path_id'] . "&module_id=" . $module['module_id'] . "\"" . $style . ">" . htmlspecialchars($module['name']) . "</a>";
}
$tool_content .= "</td>";
// end of td of module name
if ($module['contentType'] == CTSCORM_ || $module['contentType'] == CTSCORMASSET_) {
$del_conf_text = clean_str_for_javascript($langAreYouSureToRemoveSCORM);
} else {
if ($module['contentType'] == CTLABEL_) {
$del_conf_text = clean_str_for_javascript($langAreYouSureToRemoveLabel);
} else {
$del_conf_text = clean_str_for_javascript($langAreYouSureToRemoveStd);
}
}
$tool_content .= "<td class='option-btn-cell'>" . action_button(array(array('title' => $langBlock, 'url' => $_SERVER['SCRIPT_NAME'] . "?course={$course_code}&cmd=mkBlock&cmdid=" . $module['learnPath_module_id'], 'icon' => 'fa-unlock', 'show' => $module['lock'] == 'OPEN'), array('title' => $langAltMakeNotBlocking, 'url' => $_SERVER['SCRIPT_NAME'] . "?course={$course_code}&cmd=mkUnblock&cmdid=" . $module['learnPath_module_id'], 'icon' => 'fa-lock', 'show' => $module['lock'] == 'CLOSE'), array('title' => $langModify, 'url' => "module.php?course={$course_code}&module_id=" . $module['module_id'], 'icon' => 'fa-edit'), array('title' => $langRemove, 'url' => $_SERVER['SCRIPT_NAME'] . "?course={$course_code}&cmd=delModule&cmdid=" . $module['learnPath_module_id'], 'class' => 'delete', 'confirm' => $del_conf_text + " " + $module['name'], 'icon' => 'fa-times'), array('title' => $langVisible, 'url' => $_SERVER['SCRIPT_NAME'] . "?course={$course_code}&cmd=mkVisibl&cmdid=" . $module['module_id'], 'icon' => 'fa-eye-slash', 'show' => $module['visible'] == 0), array('title' => $langVisible, 'url' => $_SERVER['SCRIPT_NAME'] . "?course={$course_code}&cmd=mkInvisibl&cmdid=" . $module['module_id'], 'icon' => 'fa-eye', 'confirm' => $module['lock'] == 'CLOSE' ? $langAlertBlockingMakedInvisible : null, 'confirm_title' => "", 'confirm_button' => $langAccept, 'show' => $module['visible'] != 0), array('title' => $langMove, 'url' => $_SERVER['SCRIPT_NAME'] . "?course={$course_code}&cmd=changePos&cmdid=" . $module['learnPath_module_id'], 'icon' => 'fa-mail-forward'), array('title' => $langUp, 'url' => $_SERVER['SCRIPT_NAME'] . "?course={$course_code}&cmd=moveUp&cmdid=" . $module['learnPath_module_id'], 'level' => 'primary', 'icon' => 'fa-arrow-up', 'disabled' => !$module['up']), array('title' => $langDown, 'url' => $_SERVER['SCRIPT_NAME'] . "?course={$course_code}&cmd=moveDown&cmdid=" . $module['learnPath_module_id'], 'level' => 'primary', 'icon' => 'fa-arrow-down', 'disabled' => !$module['down']))) . "</td>";
$tool_content .= "</tr>";
$ind++;
}
// end of foreach
$tool_content .= "</table></div><br>";
draw($tool_content, 2, null, $head_content, $body_action);
示例6: render
/**
* Render the HTML page header
* @return string
*/
public function render()
{
$this->_globalVarsCompat();
$this->addInlineJavascript(JavascriptLanguage::getInstance()->buildJavascript());
$titlePage = '';
if (empty($this->_toolName) && !empty($this->_nameTools)) {
$titlePage .= $this->_nameTools . ' - ';
} elseif (!empty($this->_toolName)) {
$titlePage .= $this->_toolName . ' - ';
}
if (claro_is_in_a_course() && claro_get_current_course_data('officialCode') != '') {
$titlePage .= claro_get_current_course_data('officialCode') . ' - ';
}
$titlePage .= get_conf('siteName');
$this->assign('pageTitle', $titlePage);
if (true === get_conf('warnSessionLost', true) && claro_get_current_user_id()) {
$this->assign('warnSessionLost', "function claro_session_loss_countdown(sessionLifeTime){\n var chrono = setTimeout('claro_warn_of_session_loss()', sessionLifeTime * 1000);\n}\n\nfunction claro_warn_of_session_loss() {\n alert('" . clean_str_for_javascript(get_lang('WARNING ! You have just lost your session on the server.') . "\n" . get_lang('Copy any text you are currently writing and paste it outside the browser')) . "');\n}\n");
} else {
$this->assign('warnSessionLost', '');
}
$htmlXtraHeaders = '';
if (!empty($this->_htmlXtraHeaders)) {
$htmlXtraHeaders .= implode("\n", $this->_htmlXtraHeaders);
}
$this->assign('htmlScriptDefinedHeaders', $htmlXtraHeaders);
return parent::render() . "\n";
}
示例7: claro_htmlspecialchars
$out .= '<tr align="center">' . "\n" . '<td align="left">';
if (is_image($thisFile['path'])) {
$out .= '<a class="' . $style . ' item' . $classItem . '" href="' . claro_htmlspecialchars(Url::Contextualize($_SERVER['PHP_SELF'] . '?docView=image&file=' . download_url_encode($thisFile['path']) . '&cwd=' . $curDirPath . $searchCmdUrl)) . '">';
} else {
$out .= '<a class="' . $style . ' item' . $classItem . '" href="' . $urlFileName . '" ' . $target . ' >';
}
// end if is_image
$out .= '<img src="' . get_icon_url($image) . '" alt="" /> ' . $dspFileName . '</a>' . '</td>' . "\n" . '<td><small>' . $size . '</small></td>' . "\n" . '<td><small>' . $date . '</small></td>' . "\n";
/* NB : Before tracking implementation the url above was simply
* "<a href=\"",$urlFileName,"\"",$style,">"
*/
if ($is_allowedToEdit) {
/* EDIT COMMAND */
$out .= '<td>' . '<a href="' . claro_htmlspecialchars(Url::Contextualize($_SERVER['PHP_SELF'] . '?cmd=rqEdit&file=' . $cmdFileName)) . '">' . '<img src="' . get_icon_url('edit') . '" alt="' . get_lang('Modify') . '" />' . '</a>' . '</td>' . "\n";
/* DELETE COMMAND */
$out .= '<td>' . '<a href="' . claro_htmlspecialchars(Url::Contextualize($_SERVER['PHP_SELF'] . '?cmd=exRm&file=' . $cmdFileName)) . '" ' . 'onclick="return CLDOC.confirmation(\'' . clean_str_for_javascript($dspFileName) . '\');">' . '<img src="' . get_icon_url('delete') . '" alt="' . get_lang('Delete') . '" />' . '</a>' . '</td>' . "\n";
/* MOVE COMMAND */
$out .= '<td>' . '<a href="' . claro_htmlspecialchars(Url::Contextualize($_SERVER['PHP_SELF'] . '?cmd=rqMv&file=' . $cmdFileName)) . '">' . '<img src="' . get_icon_url('move') . '" alt="' . get_lang('Move') . '" />' . '</a>' . '</td>' . "\n" . '<td>';
if ($groupContext) {
/* PUBLISH COMMAND */
if ($thisFile['type'] == A_FILE) {
$out .= '<a href="' . claro_htmlspecialchars(Url::Contextualize(get_module_url('CLWRK') . '/work.php?' . 'submitGroupWorkUrl=' . urlencode($thisFile['path']))) . '">' . '<small>' . get_lang('Publish') . '</small>' . '</a>';
}
// else noop
} elseif ($courseContext) {
/* VISIBILITY COMMAND */
if ($thisFile['visibility'] == "i") {
$out .= '<a href="' . claro_htmlspecialchars(Url::Contextualize($_SERVER['PHP_SELF'] . '?cmd=exChVis&file=' . $cmdFileName . '&vis=v')) . '">' . '<img src="' . get_icon_url('invisible') . '" alt="' . get_lang('Make visible') . '" />' . '</a>';
} else {
$out .= '<a href="' . claro_htmlspecialchars(Url::Contextualize($_SERVER['PHP_SELF'] . '?cmd=exChVis&file=' . $cmdFileName . '&vis=i')) . '">' . '<img src="' . get_icon_url('visible') . '" alt="' . get_lang('Make invisible') . '" />' . '</a>';
}
示例8: preg_replace
$userGrid[$userKey]['firstname'] = preg_replace('/(' . $bold_search . ')/i', '<b>\\1</b>', $user['firstname']);
$userEmailLabel = preg_replace('/(' . $bold_search . ')/i', '<b>\\1</b>', $user['email']);
}
$userGrid[$userKey]['officialCode'] = empty($user['officialCode']) ? ' - ' : $user['officialCode'];
$userGrid[$userKey]['email'] = claro_html_mailTo($user['email'], $userEmailLabel);
$userGrid[$userKey]['isCourseCreator'] = $user['isCourseCreator'] ? get_lang('Course creator') : get_lang('User');
if ($user['isPlatformAdmin']) {
$userGrid[$userKey]['isCourseCreator'] .= '<br /><span class="highlight">' . get_lang('Administrator') . '</span>';
}
$userGrid[$userKey]['settings'] = '<a href="admin_profile.php' . '?uidToEdit=' . $user['user_id'] . '&cfrom=ulist' . $addToURL . '">' . '<img src="' . get_icon_url('usersetting') . '" alt="' . get_lang('User settings') . '" />' . '</a>';
if (get_conf("registrationRestrictedThroughCategories")) {
$userGrid[$userKey]['qty_category'] = '<a class="showUserCategory">' . '<span class="' . $user['user_id'] . '"></span>' . "\n" . get_lang('%nb category(ies)', array('%nb' => $user['qty_category'])) . "\n" . '</a>' . "\n";
}
$userGrid[$userKey]['qty_class'] = '<span class="showUserClasses" ><span class="' . $user['user_id'] . '"></span>' . "\n" . get_lang('%nb class(es)', array('%nb' => $user['qty_class'])) . "\n" . '</span>' . "\n";
$userGrid[$userKey]['qty_course'] = '<a class="showUserCourses" href="adminusercourses.php?uidToEdit=' . $user['user_id'] . '&cfrom=ulist' . $addToURL . '"><span class="' . $user['user_id'] . '"></span>' . "\n" . get_lang('%nb course(s)', array('%nb' => $user['qty_course'])) . "\n" . '</a>' . "\n";
$userGrid[$userKey]['delete'] = '<a href="' . claro_htmlspecialchars($_SERVER['PHP_SELF'] . '?cmd=exDelete&user_id=' . $user['user_id'] . '&offset=' . $offset . $addToURL) . '" ' . 'onclick="return ADMIN.confirmationDel(\'' . clean_str_for_javascript($user['firstname'] . ' ' . $user['name'] . ' (' . $user['user_id']) . ')\');">' . "\n" . '<img src="' . get_icon_url('delete') . '" alt="' . get_lang('Delete') . '" />' . "\n" . '</a> ' . "\n";
if (!$user['isPlatformAdmin']) {
$userGrid[$userKey]['login_as'] = '<a href="' . get_conf('rootWeb') . 'index.php?' . 'switchToUser=' . $user['user_id'] . '">' . "\n" . '<img src="' . get_icon_url('login_as') . '" alt="' . get_lang('Login as') . '" />' . "\n" . '</a> ' . "\n";
} else {
$userGrid[$userKey]['login_as'] = ' - ';
}
}
}
$sortUrlList = $myPager->get_sort_url_list($_SERVER['PHP_SELF']);
// Build the list of columns' titles
$colTitleList = array('user_id' => '<a href="' . $sortUrlList['user_id'] . '">' . get_lang('Numero') . '</a>', 'name' => '<a href="' . $sortUrlList['name'] . '">' . get_lang('Last name') . '</a>', 'firstname' => '<a href="' . $sortUrlList['firstname'] . '">' . get_lang('First name') . '</a>', 'officialCode' => '<a href="' . $sortUrlList['officialCode'] . '">' . get_lang('Administrative code') . '</a>', 'email' => '<a href="' . $sortUrlList['email'] . '">' . get_lang('Email') . '</a>', 'isCourseCreator' => '<a href="' . $sortUrlList['isCourseCreator'] . '">' . get_lang('Status') . '</a>', 'settings' => get_lang('User settings'));
if (get_conf("registrationRestrictedThroughCategories")) {
$colTitleList['qty_category'] = get_lang('Categories');
}
$colTitleList['qty_class'] = get_lang('Classes');
$colTitleList['qty_course'] = get_lang('Courses');
示例9: strtolower
} else {
$out .= strtolower($module['lesson_status']);
}
$out .= '</td>' . "\n";
//-- progression
if ($module['contentType'] != CTLABEL_) {
// display the progress value for current module
$out .= '<td align="right">' . claro_html_progress_bar($progress, 1) . '</td>' . "\n";
$out .= '<td align="left"><small> ' . $progress . '%</small></td>' . "\n";
} else {
$out .= '<td colspan="2"> </td>' . "\n";
}
if (isAnwsersViewingSupported($module['contentType'])) {
if (claro_get_current_user_id() != (int) $_REQUEST['uInfo']) {
if (getModuleProgression((int) $_REQUEST['uInfo'], (int) $_REQUEST['path_id'], (int) $module['module_id'])) {
$out .= '<td>' . "\n" . '<a href="' . get_path('clarolineRepositoryWeb') . 'learnPath/module.php?cidReset=true&cidReq=' . claro_get_current_course_id() . '&module_id=' . (int) $module['module_id'] . '&path_id=' . (int) $_REQUEST['path_id'] . '©From=' . (int) $_REQUEST['uInfo'] . '" ' . 'onclick="return confirm(\'' . clean_str_for_javascript(get_lang('This will copy the learning path user progression over your own. Do you want to proceed anyway?')) . '\');">' . "\n" . '<img src="' . get_icon_url('login_as') . '" alt="' . get_lang('Consult') . '" />' . "\n" . '</a>' . "\n" . '</td>' . "\n";
} else {
$out .= '<td>' . get_lang('No results available') . '</td>' . "\n";
}
} else {
$out .= '<td>' . get_lang('Consulting your own results is not allowed') . '</td>' . "\n";
}
} else {
$out .= '<td>' . get_lang('Unsupported module type') . '</td>' . "\n";
}
if ($progress > 0) {
$globalProg += $progress;
}
if ($module['contentType'] != CTLABEL_) {
$moduleNb++;
}
示例10: claro_disp_tree
/**
*This function display the bom whith option to edit or delete the categories
*
* @author - < Benoît Muret >
* @param - elem array : the array of each category
* @param - father string : the father of the category
*
* @return - $out
*
* display the bom whith option to edit or delete the categories
*/
function claro_disp_tree($elem, $father, $space)
{
$out = '';
if ($elem) {
$space .= " ";
$num = 0;
foreach ($elem as $one_faculty) {
if (!strcmp($one_faculty['code_P'], $father)) {
$num++;
$out .= '<tr><td>';
$out .= $space;
if ($one_faculty['nb_childs'] > 0) {
$out .= '<a href="' . $_SERVER['PHP_SELF'] . '?id=' . $one_faculty['id'] . '"> ' . ($one_faculty['visible'] ? '<img src="' . get_icon_url('collapse') . '" alt="-" />' : '<img src="' . get_icon_url('expand') . '" alt="+" />') . '</a> ' . ' ';
} else {
$out .= ' ° ';
}
$out .= $one_faculty['name'] . ' (' . $one_faculty['code'] . ') ';
//Number of faculty in this parent
$nb = 0;
foreach ($elem as $one_elem) {
if (!strcmp($one_elem['code_P'], $one_faculty['code_P'])) {
$nb++;
}
}
//Display the picture to edit and delete a category
$out .= '</td>' . '<td align="center">' . '<a href="./admincourses.php?category=' . urlencode($one_faculty['code']) . '">' . get_node_children_count_course($one_faculty['code']) . '</a>';
$out .= '</td>' . '<td align="center">' . '<a href="' . $_SERVER['PHP_SELF'] . '?id=' . $one_faculty['id'] . '&cmd=rqEdit" >' . '<img src="' . get_icon_url('edit') . '"alt="' . get_lang('Edit') . '" /></a>' . '</td>' . '<td align="center">' . '<a href="' . $_SERVER['PHP_SELF'] . '?id=' . $one_faculty['id'] . '&cmd=rqMove" >' . '<img src="' . get_icon_url('move') . '" alt="' . get_lang('Move') . '" /></a>' . '</td>' . '<td align="center">' . '<a href="' . $_SERVER['PHP_SELF'] . '?id=' . $one_faculty['id'] . '&cmd=exDelete"' . 'onclick="javascript:if(!confirm(\'' . clean_str_for_javascript(get_lang('Do you really want to delete the "%categoryCode%" category ?', array('%categoryCode%' => $one_faculty['code']))) . '\')) return false" >' . '<img src="' . get_icon_url('delete') . '" alt="' . get_lang('Delete') . '" /> </a>' . '</td>';
//Search nbChild of the father
$nbChild = 0;
$father = $one_faculty['code_P'];
foreach ($elem as $fac) {
if ($fac['code_P'] == $father) {
$nbChild++;
}
}
//If the number of child is >0, display the arrow up and down
if ($nb > 1) {
$out .= '<td align="center">' . "\n";
//If isn't the first child, you can up
if ($num > 1) {
$out .= '<a href="' . $_SERVER['PHP_SELF'] . '?id=' . $one_faculty['id'] . '&cmd=exUp">' . '<img src="' . get_icon_url('move_up') . '" alt="' . get_lang('Move up') . '" /></a>';
} else {
$out .= ' ';
}
$out .= '</td>' . "\n";
$out .= '<td align="center">' . "\n";
// If isn't the last child, you can down
if ($num < $nbChild) {
$out .= '<a href="' . $_SERVER['PHP_SELF'] . '?id=' . $one_faculty['id'] . '&cmd=exDown">' . '<img src="' . get_icon_url('move_down') . '" alt="' . get_lang('Move down') . '" /> </a>';
} else {
$out .= ' ';
}
$out .= '</td>' . "\n";
} else {
$out .= '<td> </td>' . "\n" . '<td> </td>' . "\n";
}
$out .= '</tr>' . "\n";
//display the bom of this category
if ($one_faculty['visible']) {
$out .= claro_disp_tree($elem, $one_faculty['code'], $space);
}
}
}
}
return $out;
}
示例11: get_icon_url
$out .= '<img src="' . get_icon_url('user') . '" alt="' . get_lang('Individual') . '" />';
} elseif ($anAssignment['assignment_type'] == 'GROUP') {
$out .= '<img src="' . get_icon_url('group') . '" alt="' . get_lang('Groups (from groups tool, only group members can post)') . '" />';
} else {
$out .= ' ';
}
$out .= '</td>' . "\n" . '<td><small>' . claro_html_localised_date(get_locale('dateTimeFormatLong'), $anAssignment['start_date_unix']) . '</small></td>' . "\n" . '<td><small>' . claro_html_localised_date(get_locale('dateTimeFormatLong'), $anAssignment['end_date_unix']) . '</small></td>' . "\n";
if (isset($_REQUEST['submitGroupWorkUrl']) && !empty($_REQUEST['submitGroupWorkUrl'])) {
if (!isset($anAssignment['authorized_content']) || $anAssignment['authorized_content'] != 'TEXT') {
$out .= '<td align="center">' . '<a href="' . claro_htmlspecialchars($assignmentUrl) . '">' . '<small>' . get_lang('Publish') . '</small>' . '</a>' . '</td>' . "\n";
} else {
$out .= '<td align="center">' . '<small>-</small>' . '</td>' . "\n";
}
}
if ($is_allowedToEdit) {
$out .= '<td align="center">' . '<a href="' . claro_htmlspecialchars(Url::Contextualize($_SERVER['PHP_SELF'] . '?cmd=rqEditAssig&assigId=' . $anAssignment['id'])) . '">' . '<img src="' . get_icon_url('edit') . '" alt="' . get_lang('Modify') . '" /></a>' . '</td>' . "\n" . '<td align="center">' . '<a href="' . claro_htmlspecialchars(Url::Contextualize($_SERVER['PHP_SELF'] . '?cmd=exRmAssig&assigId=' . $anAssignment['id'])) . '" onclick="return WORK.confirmationDel(\'' . clean_str_for_javascript($anAssignment['title']) . '\');">' . '<img src="' . get_icon_url('delete') . '" alt="' . get_lang('Delete') . '" /></a>' . '</td>' . "\n" . '<td align="center">';
if ($anAssignment['visibility'] == "INVISIBLE") {
$out .= '<a href="' . claro_htmlspecialchars(Url::Contextualize($_SERVER['PHP_SELF'] . '?cmd=exChVis&assigId=' . $anAssignment['id'] . '&vis=v')) . '">' . '<img src="' . get_icon_url('invisible') . '" alt="' . get_lang('Make visible') . '" />' . '</a>';
} else {
$out .= '<a href="' . claro_htmlspecialchars(Url::Contextualize($_SERVER['PHP_SELF'] . '?cmd=exChVis&assigId=' . $anAssignment['id'] . '&vis=i')) . '">' . '<img src="' . get_icon_url('visible') . '" alt="' . get_lang('Make invisible') . '" />' . '</a>';
}
$out .= '</td>' . "\n" . '</tr>' . "\n\n";
}
$atLeastOneAssignmentToShow = true;
}
if (!$atLeastOneAssignmentToShow) {
$out .= '<tr>' . "\n" . '<td colspan=' . $colspan . '>' . "\n" . get_lang('There is no assignment at the moment') . '</td>' . "\n" . '</tr>' . "\n";
}
$out .= '</tbody>' . "\n" . '</table>' . "\n\n";
}
if (isset($displayAssigForm) && $displayAssigForm) {
示例12: get_lang
$cssLoader = CssLoader::getInstance();
$cssLoader->load('clchat', 'screen');
//-- Content
$out = '';
$nameTools = get_lang('Chat');
$out .= claro_html_tool_title($nameTools);
if (claro_is_javascript_enabled() && $_uid) {
$jsloader = JavascriptLoader::getInstance();
$jsloader->load('jquery');
$jsloader->load('clchat');
// init var with values from get_conf before including tool library
$htmlHeaders = '<script type="text/javascript">' . "\n" . 'var refreshRate = "' . get_conf('msg_list_refresh_rate', 5) * 1000 . '";' . "\n" . 'var userListRefresh = "' . get_conf('user_list_refresh_rate') * 1000 . '";' . "\n" . 'var cidReq = "' . claro_get_current_course_id() . '";' . "\n";
if (claro_is_in_a_group()) {
$htmlHeaders .= 'var gidReq = "' . claro_get_current_group_id() . '";' . "\n";
}
$htmlHeaders .= 'var lang = new Array();' . "\n" . 'lang["confirmFlush"] = "' . clean_str_for_javascript(get_lang('Are you sure to delete all logs ?')) . '";' . '</script>';
$claroline->display->header->addHtmlHeader($htmlHeaders);
// dialog box
$out .= '<div id="clchat_user_list"></div>' . "\n" . '<div id="clchat_chatarea">' . "\n" . ' <div id="clchat_log"></div>' . "\n" . ' <div id="clchat_connectTime">' . get_lang('Start of this chat session (%connectTime)', array('%connectTime' => claro_html_localised_date(get_locale('dateTimeFormatLong'), $_SESSION['chat_connectionTime']))) . '</div>' . "\n" . ' <div id="clchat_text"></div>' . "\n" . '</div>' . "\n";
// display form
$out .= '<form action="#" id="clchat_form" method="get" >' . "\n" . claro_form_relay_context() . "\n" . '<img src="' . get_module_url('CLCHAT') . '/img/loading.gif" alt="' . get_lang('Loading...') . '" id="clchat_loading" width="16" height="16" />' . "\n" . '<input id="clchat_msg" type="text" name="message" maxlength="200" size="80" />' . "\n" . '<input type="submit" name="Submit" value=" >> " />' . "\n" . '</form>' . "\n" . claro_html_menu_horizontal($cmdMenu) . "\n" . '<p id="clchat_dialogBox"></p>' . "\n";
} else {
if (!claro_is_javascript_enabled()) {
$dialogBox = new DialogBox();
$dialogBox->error(get_lang('Javascript must be enabled in order to use this tool.'));
$out .= $dialogBox->render();
} elseif (!$_uid) {
$dialogBox = new DialogBox();
$dialogBox->error(get_lang('Anonymous users cannot use this tool.'));
$out .= $dialogBox->render();
}
示例13: get_lang
$out .= '<tr>' . "\n" . '<td> </td>' . "\n" . '<td><small>' . get_lang('<span class="required">*</span> denotes required field') . '</small></td>' . "\n" . '</tr>' . "\n\n";
//-- buttons
$out .= '<tr>' . "\n" . '<td> </td>' . "\n" . '<td>' . '<input type="submit" name="" id="" value="' . get_lang('Ok') . '" /> ' . claro_html_button(Url::Contextualize($_SERVER['PHP_SELF']), get_lang("Cancel")) . '</td>' . "\n" . '</tr>' . "\n\n";
$out .= '</table>' . "\n\n" . '</form>' . "\n\n";
}
//-- pager
$out .= $myPager->disp_pager_tool_bar($_SERVER['PHP_SELF']);
//-- list
$out .= '<table class="claroTable emphaseLine" border="0" align="center" cellpadding="2" cellspacing="2" width="100%">' . "\n\n" . '<thead>' . "\n" . '<tr>' . "\n" . '<th>' . get_lang('Title') . '</th>' . "\n";
$colspan = 1;
if ($is_allowedToEdit) {
$out .= '<th>' . get_lang('Modify') . '</th>' . "\n" . '<th>' . get_lang('Delete') . '</th>' . "\n";
$colspan = 3;
}
$out .= '</tr>' . "\n" . '</thead>' . "\n\n" . '<tbody>' . "\n\n";
if (!empty($questionCategoryList)) {
foreach ($questionCategoryList as $aCategory) {
$out .= '<tr>' . "\n" . '<td>' . $aCategory['title'] . '</a>' . '</td>' . "\n";
$out .= '<td align="center">' . '<a href="' . claro_htmlspecialchars(Url::Contextualize('question_category.php?cmd=rqEdit&catId=' . $aCategory['id'])) . '">' . '<img src="' . get_icon_url('edit') . '" alt="' . get_lang('Modify') . '" />' . '</a>' . '</td>' . "\n";
$confirmString = get_lang('Are you sure you want to delete this category ?');
$out .= '<td align="center">' . '<a href="' . claro_htmlspecialchars(Url::Contextualize('question_category.php?catId=' . $aCategory['id'] . '&cmd=exDel')) . '" onclick="javascript:if(!confirm(\'' . clean_str_for_javascript($confirmString) . '\')) return false;">' . '<img src="' . get_icon_url('delete') . '" alt="' . get_lang('Delete') . '" />' . '</a>' . '</td>' . "\n";
$out .= '</tr>' . "\n\n";
}
} else {
$out .= '<tr>' . "\n" . '<td colspan="' . $colspan . '">' . get_lang('Empty') . '</td>' . "\n" . '</tr>' . "\n\n";
}
$out .= '</tbody>' . "\n\n" . '</table>' . "\n\n";
//-- pager
$out .= $myPager->disp_pager_tool_bar($_SERVER['PHP_SELF']);
$claroline->display->body->appendContent($out);
echo $claroline->display->render();
示例14: get_icon_url
} else {
$moduleImg = get_icon_url(choose_image(basename($module['path'])));
}
$out .= '<img src="' . $moduleImg . '" alt="' . $contentType_alt . '" border="0" /> ' . "\n" . claro_htmlspecialchars(claro_utf8_decode($module['name'], get_conf('charset')));
}
$out .= '</td>' . "\n";
if (claro_is_user_authenticated() && $module['contentType'] != CTLABEL_) {
// display the progress value for current module
$out .= '<td align="right">' . claro_html_progress_bar($progress, 1) . '</td>' . "\n" . '<td align="left">' . '<small> ' . $progress . '%</small>' . '</td>' . "\n";
} elseif (claro_is_user_authenticated() && $module['contentType'] == CTLABEL_) {
$out .= '<td colspan="2"> </td>' . "\n";
}
//-- reset link for current module
if (claro_is_user_authenticated() && (get_conf('cllnp_resetByUserAllowed', false) || claro_is_allowed_to_edit())) {
if (getModuleProgression(claro_get_current_user_id(), $_SESSION['path_id'], $module['learnPath_module_id'])) {
$out .= '<td><a href="' . Url::Contextualize($_SERVER['PHP_SELF'] . '?cmd=resetModuleProgression&learnPath_module_id=' . $module['learnPath_module_id'] . '&path_id=' . $_SESSION['path_id']) . '" onclick="return confirm(\'' . clean_str_for_javascript(get_lang('Do you really want to reset module ') . $module['name']) . '?\');"><img src="' . get_icon_url('delete') . '" alt="' . get_lang('Reset') . '" /></a></td>' . "\n";
} else {
$out .= '<td>' . get_lang('No results available') . '</td>' . "\n";
}
}
if ($progress > 0) {
$globalProg = $globalProg + $progress;
}
if ($module['contentType'] != CTLABEL_) {
$moduleNb++;
}
// increment number of modules used to compute global progression except if the module is a title
$out .= '</tr>' . "\n\n";
$atleastOne = true;
}
$out .= '</tbody>' . "\n\n";
示例15: get_lang
?>
" title="<?php
echo get_lang('Lock');
?>
" />
</a>
<?php
}
?>
</td>
<td align="center">
<a href="<?php
echo claro_htmlspecialchars(Url::Contextualize($_SERVER['PHP_SELF'] . '?cmd=exDelTopic&forum=' . $this->forumId . '&topic=' . $thisTopic['topic_id']));
?>
" onclick="return confirmationDel('<?php
echo clean_str_for_javascript($thisTopic['topic_title']);
?>
');">
<img src="<?php
echo get_icon_url('delete');
?>
" alt="<?php
echo get_lang('Delete');
?>
" />
</a>
</td>
<?php
}
?>
</tr>