本文整理汇总了PHP中DialogBox::render方法的典型用法代码示例。如果您正苦于以下问题:PHP DialogBox::render方法的具体用法?PHP DialogBox::render怎么用?PHP DialogBox::render使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DialogBox
的用法示例。
在下文中一共展示了DialogBox::render方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: lp_display_scorm
/**
* CLAROLINE
*
* @version $Revision: 14314 $
* @copyright (c) 2001-2011, Universite catholique de Louvain (UCL)
* @license http://www.gnu.org/copyleft/gpl.html (GPL) GENERAL PUBLIC LICENSE
* @author Piraux Sebastien <pir@cerdecam.be>
* @author Lederer Guillaume <led@cerdecam.be>
* @package CLLNP
* @since 1.8
*/
function lp_display_scorm($TABLELEARNPATHMODULE)
{
$out = '';
// change raw if value is a number between 0 and 100
if (isset($_POST['newRaw']) && is_num($_POST['newRaw']) && $_POST['newRaw'] <= 100 && $_POST['newRaw'] >= 0) {
$sql = "UPDATE `" . $TABLELEARNPATHMODULE . "`\n SET `raw_to_pass` = " . (int) $_POST['newRaw'] . "\n WHERE `module_id` = " . (int) $_SESSION['module_id'] . "\n AND `learnPath_id` = " . (int) $_SESSION['path_id'];
claro_sql_query($sql);
$dialogBoxContent = get_lang('Minimum raw to pass has been changed');
}
$out .= '<hr noshade="noshade" size="1" />';
//####################################################################################\\
//############################### DIALOG BOX SECTION #################################\\
//####################################################################################\\
if (!empty($dialogBoxContent)) {
$dialogBox = new DialogBox();
$dialogBox->success($dialogBoxContent);
$out .= $dialogBox->render();
}
// form to change raw needed to pass the exercise
$sql = "SELECT `lock`, `raw_to_pass`\n FROM `" . $TABLELEARNPATHMODULE . "` AS LPM\n WHERE LPM.`module_id` = " . (int) $_SESSION['module_id'] . "\n AND LPM.`learnPath_id` = " . (int) $_SESSION['path_id'];
$learningPath_module = claro_sql_query_fetch_all($sql);
if (isset($learningPath_module[0]['lock']) && $learningPath_module[0]['lock'] == 'CLOSE' && isset($learningPath_module[0]['raw_to_pass'])) {
$out .= "\n\n" . '<form method="post" action="' . $_SERVER['PHP_SELF'] . '">' . "\n" . '<label for="newRaw">' . get_lang('Change minimum raw mark to pass this module (percentage) : ') . '</label>' . "\n" . '<input type="text" value="' . claro_htmlspecialchars($learningPath_module[0]['raw_to_pass']) . '" name="newRaw" id="newRaw" size="3" maxlength="3" /> % ' . "\n" . '<input type="submit" value="' . get_lang('Ok') . '" />' . "\n" . '</form>' . "\n\n";
}
return $out;
}
示例2: Load
public function Load()
{
$dialog_update = new DialogBox(__(UPDATE_FRAMEWORK), new Url($this->getBaseLanguageURL() . "wsp-admin/update/update-framework.call?update=" . $_GET['update'] . "&parent_dialog_level=" . DialogBox::getCurrentDialogBoxLevel()));
$dialog_update->displayFormURL()->modal();
$button_yes = new Button($this);
$button_yes->onClickJs($dialog_update->render())->setValue(__(UPDATE_FRAMEWORK_YES));
$button_no = new Button($this);
$button_no->onClickJs(DialogBox::closeAll())->setValue(__(UPDATE_FRAMEWORK_NO));
$table_yes_no = new Table();
$table_yes_no->addRowColumns($button_yes, " ", $button_no);
if ($_GET['update'] == "update-wsp") {
$warning_lbl = new Label(__(UPDATE_FRAMEWORK_WSP_WARNING));
$warning_lbl->setColor("red")->setItalic();
$this->render = new Object(__(UPDATE_FRAMEWORK_CONFIRM, $_GET['text']), "<br/><br/>", $warning_lbl, "<br/><br/>", $table_yes_no);
} else {
$this->render = new Object(__(UPDATE_FRAMEWORK_CONFIRM, $_GET['text']), "<br/><br/>", $table_yes_no);
}
$this->render->setAlign(Object::ALIGN_CENTER);
}
示例3: claro_disp_wiki_preview
/**
* Generate html code of the wiki page preview
* @param Wiki2xhtmlRenderer wikiRenderer rendering engine
* @param string title page title
* @param string content page content
* @return string html code of the preview pannel
*/
function claro_disp_wiki_preview(&$wikiRenderer, $title, $content = '')
{
$out = "<div id=\"preview\" class=\"wikiTitle\">\n";
if ($title === '__MainPage__') {
$title = get_lang("Main page");
}
$title = "<h1 class=\"wikiTitle\">" . get_lang('Preview :') . "{$title}</h1>\n";
$out .= $title;
$out .= '</div>' . "\n";
$dialogBox = new DialogBox();
$dialogBox->warning('<small>' . get_lang("WARNING: this page is a preview. Your modifications to the wiki has not been saved yet ! To save them do not forget to click on the 'save' button at the bottom of the page.") . '</small>');
$out .= $dialogBox->render() . "\n";
$out .= '<div class="wiki2xhtml">' . "\n";
if ($content != '') {
$out .= $wikiRenderer->render($content);
} else {
$out .= get_lang("This page is empty, click on 'Edit this page' to add a content");
}
$out .= "</div>\n";
return $out;
}
示例4: lp_display_exercise
/**
* CLAROLINE
*
* @version $Revision: 14314 $
* @copyright (c) 2001-2011, Universite catholique de Louvain (UCL)
* @license http://www.gnu.org/copyleft/gpl.html (GPL) GENERAL PUBLIC LICENSE
* @author Piraux Sebastien <pir@cerdecam.be>
* @author Lederer Guillaume <led@cerdecam.be>
* @package CLLNP
* @since 1.8
*/
function lp_display_exercise($cmd, $TABLELEARNPATHMODULE, $TABLEMODULE, $TABLEASSET, $tbl_quiz_exercise)
{
$out = '';
if (isset($cmd) && ($cmd = "raw")) {
// change raw if value is a number between 0 and 100
if (isset($_POST['newRaw']) && is_num($_POST['newRaw']) && $_POST['newRaw'] <= 100 && $_POST['newRaw'] >= 0) {
$sql = "UPDATE `" . $TABLELEARNPATHMODULE . "`\n SET `raw_to_pass` = " . (int) $_POST['newRaw'] . "\n WHERE `module_id` = " . (int) $_SESSION['module_id'] . "\n AND `learnPath_id` = " . (int) $_SESSION['path_id'];
claro_sql_query($sql);
$dialogBoxContent = get_lang('Minimum raw to pass has been changed');
}
}
$out .= '<hr noshade="noshade" size="1" />';
//####################################################################################\\
//############################### DIALOG BOX SECTION #################################\\
//####################################################################################\\
if (!empty($dialogBoxContent)) {
$dialogBox = new DialogBox();
$dialogBox->success($dialogBoxContent);
$out .= $dialogBox->render();
}
// form to change raw needed to pass the exercise
$sql = "SELECT `lock`, `raw_to_pass`\n FROM `" . $TABLELEARNPATHMODULE . "` AS LPM\n WHERE LPM.`module_id` = " . (int) $_SESSION['module_id'] . "\n AND LPM.`learnPath_id` = " . (int) $_SESSION['path_id'];
$learningPath_module = claro_sql_query_get_single_row($sql);
// if this module blocks the user if he doesn't complete
if (isset($learningPath_module['lock']) && $learningPath_module['lock'] == 'CLOSE' && isset($learningPath_module['raw_to_pass'])) {
$out .= '<form method="post" action="' . $_SERVER['PHP_SELF'] . '">' . "\n" . claro_form_relay_context() . '<label for="newRaw">' . get_lang('Change minimum raw mark to pass this module (percentage) :') . ' </label>' . "\n" . '<input type="text" value="' . claro_htmlspecialchars($learningPath_module['raw_to_pass']) . '" name="newRaw" id="newRaw" size="3" maxlength="3" /> % ' . "\n" . '<input type="hidden" name="cmd" value="raw" />' . "\n" . '<input type="submit" value="' . get_lang('Ok') . '" />' . "\n" . '</form>' . "\n\n";
}
// display current exercise info and change comment link
$sql = "SELECT `E`.`id` AS `exerciseId`, `M`.`name`\n FROM `" . $TABLEMODULE . "` AS `M`,\n `" . $TABLEASSET . "` AS `A`,\n `" . $tbl_quiz_exercise . "` AS `E`\n WHERE `A`.`module_id` = M.`module_id`\n AND `M`.`module_id` = " . (int) $_SESSION['module_id'] . "\n AND `E`.`id` = `A`.`path`";
$module = claro_sql_query_get_single_row($sql);
if ($module) {
$out .= "\n\n" . '<h4>' . get_lang('Exercise in module') . ' :</h4>' . "\n" . '<p>' . "\n" . claro_htmlspecialchars($module['name']) . '<a href="../exercise/admin/edit_exercise.php?exId=' . $module['exerciseId'] . '">' . '<img src="' . get_icon_url('edit') . '" alt="' . get_lang('Modify') . '" />' . '</a>' . "\n" . '</p>' . "\n";
}
// else sql error, do nothing except in debug mode, where claro_sql_query_fetch_all will show the error
return $out;
}
示例5: claro_html_msg_list
/**
* Display list of messages in substyled boxes in a message_box
*
* In most of cases function message_box() is enough.
*
* @param array $msgArrBody of array of blocs containing array of messages
* @author Christophe Gesche <moosh@claroline.net>
* @version 1.0
* @see message_box()
*
* code for using this in your tools:
* $msgArrBody["nameOfCssClass"][]="foo";
* css class can be defined in script but try to use
* class from generic css ()
* error success warning
* ...
*
* @todo this must be a message object where code add messages with a priority,
* and the rendering is set by by priority
*
*/
function claro_html_msg_list($msgArrBody, $return = true)
{
$msgBox = '';
if (is_array($msgArrBody) && count($msgArrBody) > 0) {
foreach ($msgArrBody as $classMsg => $thisMsgArr) {
if (is_array($thisMsgArr)) {
$msgBox .= '<div class="' . $classMsg . '">';
foreach ($thisMsgArr as $anotherThis) {
$msgBox .= '<div class="msgLine" >' . $anotherThis . '</div>';
}
$msgBox .= '</div>';
} else {
$msgBox .= '<div class="' . $classMsg . '">';
$msgBox .= '<div class="msgLine" >' . $thisMsgArr . '</div>';
$msgBox .= '</div>';
}
}
}
$dialogBox = new DialogBox();
if ($msgBox) {
$dialogBox->form($msgBox);
}
if ($return) {
return $dialogBox->render();
} else {
echo $dialogBox->render();
}
return true;
}
示例6: pushClaroMessage
continue;
}
if ($portlet['label'] == 'mycourselist') {
continue;
}
$plabel = $portlet['label'];
$portlet = new $plabel($plabel);
if (!$portlet instanceof UserDesktopPortlet) {
pushClaroMessage("{$portlet['label']} is not a valid user desktop portlet !");
continue;
}
$outPortlet .= $portlet->render();
} catch (Exception $e) {
$portletDialog = new DialogBox();
$portletDialog->error(get_lang('An error occured while loading the portlet : %error%', array('%error%' => $e->getMessage())));
$outPortlet .= '<div class="claroBlock portlet">' . '<h3 class="blockHeader">' . "\n" . $portlet->renderTitle() . '</h3>' . "\n" . '<div class="claroBlockContent">' . "\n" . $portletDialog->render() . '</div>' . "\n" . '</div>' . "\n\n";
}
}
} else {
$dialogBox->error(get_lang('Cannot load portlet list'));
}
// Generate Script Output
CssLoader::getInstance()->load('desktop', 'all');
$template = new CoreTemplate('user_desktop.tpl.php');
$userProfileBox = new UserProfileBox(false);
$myCourseList = new MyCourseList();
$template->assign('dialogBox', $dialogBox);
$template->assign('userProfileBox', $userProfileBox);
$template->assign('outPortlet', $outPortlet);
$template->assign('mycourselist', $myCourseList->render());
$claroline->display->body->appendContent($template->render());
示例7: array
* DISPLAY SECTION
*/
$nameTools = get_lang('Announcements');
$noQUERY_STRING = true;
// Javascript confirm pop up declaration for header
JavascriptLanguage::getInstance()->addLangVar('Are you sure you want to delete all the announcements ?');
JavascriptLanguage::getInstance()->addLangVar('Are you sure to delete %name ?');
JavascriptLoader::getInstance()->load('announcements');
$output = '';
if (!empty($subTitle)) {
$titleParts = array('mainTitle' => $nameTools, 'subTitle' => $subTitle);
} else {
$titleParts = $nameTools;
}
Claroline::getDisplay()->body->appendContent(claro_html_tool_title($titleParts, null, $cmdList));
Claroline::getDisplay()->body->appendContent($dialogBox->render());
/**
* FORM TO FILL OR MODIFY AN ANNOUNCEMENT
*/
if ($displayForm) {
// DISPLAY ADD ANNOUNCEMENT COMMAND
// Ressource linker
if ($_REQUEST['cmd'] == 'rqEdit') {
ResourceLinker::setCurrentLocator(ResourceLinker::$Navigator->getCurrentLocator(array('id' => (int) $_REQUEST['id'])));
}
$template = new ModuleTemplate($tlabelReq, 'form.tpl.php');
$template->assign('formAction', Url::Contextualize($_SERVER['PHP_SELF']));
$template->assign('relayContext', claro_form_relay_context());
$template->assign('cmd', $formCmd);
$template->assign('announcement', $announcement);
Claroline::getDisplay()->body->appendContent($template->render());
示例8: function
$javascript = '
<script type="text/javascript" charset="utf-8">
$(document).ready( function(){
$(".daterange").datepicker({dateFormat: \'dd/mm/yy\', beforeShow: customRange});
function customRange(input) {
return {minDate: (input.id == \'dateinput2\' ? $(\'#dateinput1\').datepicker(\'getDate\') : null),
maxDate: (input.id == \'dateinput1\' ? $(\'#dateinput2\').datepicker(\'getDate\') : null)};
}
});
</script>';
$claroline->display->header->addHtmlHeader($javascript);
$disp = "\n" . get_lang('Select interval') . '<br />' . "\n" . '<form action="' . $_SERVER['PHP_SELF'] . '?search=timeInterval" method="post">' . "\n" . get_lang('From') . ' <input type="text" name="date1" value="' . $date1 . '" class="daterange" id="dateinput1" /> ' . "\n" . get_lang('to') . ' <input type="text" name="date2" value="' . $date2 . '" class="daterange" id="dateinput2" /> ' . get_lang('(jj/mm/aaaa)') . '<br />' . "\n" . '<input type="submit" value="' . get_lang('Search') . '" />' . "\n" . '</form>' . "\n\n";
$dialogbox = new DialogBox();
$dialogbox->form($disp);
$content .= $dialogbox->render();
}
if ($displayTable) {
$argLink = makeArgLink($arguments, array('fieldOrder', 'order'));
$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 )
{
示例9: DialogBox
/*if( $exercise->getShuffle() && $exercise->getUseSameShuffle() && isset( $_SESSION['lastRandomQuestionList'] ) )
{
$out .= '<div style="font-weight: bold;">' . "\n"
. '<a href="exercise.php?exId=' . $exercise->getId() .'&cmd=exSaveQwz'.( $inLP ? '&calledFrom=CLLP&embedded=true' : '' ).'">' . get_lang('Save this questions list') . '</a>'
. '</div>'
;
}*/
if ($recordResults) {
$dialogBoxResults = new DialogBox();
$outDialogbox = '';
if ($exercise->getTimeLimit() > 0) {
$outDialogbox .= get_lang('Your time is %time', array('%time' => claro_html_duration($timeToCompleteExe))) . '<br />' . "\n";
}
$outDialogbox .= '<strong>' . get_lang('Your total score is %score', array('%score' => $totalResult . "/" . $totalGrade)) . '</strong>';
$dialogBoxResults->info($outDialogbox);
$out .= $dialogBoxResults->render();
} else {
$contentDialogBox = '';
if ($exercise->getTimeLimit() > 0) {
$contentDialogBox .= get_lang('Your time is %time', array('%time' => claro_html_duration($timeToCompleteExe))) . '<br />' . "\n";
}
$contentDialogBox .= get_lang('Time is over, results not submitted.');
$dialogBox->error($contentDialogBox);
$dialogBox->info('<a href="' . claro_htmlspecialchars(Url::Contextualize('./exercise.php')) . '"><< ' . get_lang('Back') . '</a>');
}
//-- question(s)
if (!empty($questionList)) {
$out .= "\n" . '<table width="100%" border="0" cellpadding="1" cellspacing="0" class="claroTable">' . "\n\n";
// foreach question
$questionIterator = 1;
$i = 0;
示例10: render
/**
* Method render
* @access public
* @param boolean $ajax_render [default value: false]
* @return string html code of object LiveValidation
* @since 1.0.35
*/
public function render($ajax_render = false)
{
if (!isset($this->object)) {
throw new NewException("1 argument for " . get_class($this) . "::__construct() is mandatory", 0, getDebugBacktrace(1));
}
if (get_class($this->object) == "Form") {
return;
}
$html = $this->getJavascriptTagOpen();
if (get_class($this->object) == "Editor") {
$id = $this->object->getHiddenId();
} else {
$id = $this->object->getId();
}
$html .= "\tLV_" . $id . " = new LiveValidation('" . $id . "'";
if ($this->onlyOnSubmit) {
$html .= ", {onlyOnSubmit: true}";
}
$html .= ");\n";
$html .= "\tLV_" . $id . $this->validate_js . ";\n";
if ($this->valid_init) {
$html .= "\tLV_" . $id . ".validate();\n";
}
if (method_exists($this->object, "getFormObject")) {
$form_object = $this->object->getFormObject();
if ($form_object != null) {
// search all button of the form
$event_object_name = "Button_" . $form_object->getName();
$eventObject = $form_object->getPageObject()->getEventObjects($event_object_name);
for ($i = 0; $i < sizeof($eventObject); $i++) {
if (find($eventObject[$i]->getOnClickJs(), "/*LV_condition_zone*/", 0, 0) > 0) {
$eventObject[$i]->onClickJs(str_replace("/*LV_validate_zone*/", "LV_" . $id . ".validate();/*LV_validate_zone*/", $eventObject[$i]->getOnClickJs()));
$eventObject[$i]->onClickJs(str_replace("/*LV_condition_zone*/", "&&LiveValidationForm_" . $form_object->getName() . "_" . $id . "()/*LV_condition_zone*/", $eventObject[$i]->getOnClickJs()));
} else {
$html .= "\tlv_error_alert_id = '';\n\tlv_error_alert_field_name = '';\n\tlv_error_alert_msg = '';\n\tLV_ErrorAlert_" . $form_object->getName() . " = function() { ";
$error_dialogbox_msg = new DialogBox(__(ERROR), __(LIVE_VALIDATION_FORMULAR_ERROR_MSG));
$error_dialogbox_msg->activateCloseButton("\$('#'+lv_error_alert_id).focus();");
$error_dialogbox_field = new DialogBox(__(ERROR), __(LIVE_VALIDATION_FORMULAR_FIELD_ERROR));
$error_dialogbox_field->activateCloseButton("\$('#'+lv_error_alert_id).focus();");
if (DEBUG) {
$error_dialogbox = new DialogBox(__(ERROR), __(LIVE_VALIDATION_FORMULAR_ERROR_DEBUG));
} else {
$error_dialogbox = new DialogBox(__(ERROR), __(LIVE_VALIDATION_FORMULAR_ERROR));
}
$error_dialogbox->activateCloseButton();
$html .= "\tif (lv_error_alert_msg != '') {\n";
$html .= "\t\t" . $error_dialogbox_msg->render() . "\n";
$html .= "\t} else if (lv_error_alert_field_name != '') {\n";
$html .= "\t\t" . $error_dialogbox_field->render();
$html .= "\t} else {\n";
$html .= "\t\t" . $error_dialogbox->render() . "\n";
$html .= "\t}\n";
$html .= " };\n";
$eventObject[$i]->onClickJs("LV_" . $id . ".validate();/*LV_validate_zone*/if(LiveValidationForm_" . $form_object->getName() . "_" . $id . "()/*LV_condition_zone*/){" . $eventObject[$i]->getOnClickJs() . "}else{LV_ErrorAlert_" . $form_object->getName() . "();return false;}");
}
}
$html .= "\tLiveValidationForm_" . $form_object->getName() . "_" . $id . " = function() {\n";
$html .= "\t\tif (\$('#" . $id . "').attr('disabled')) {\n";
$html .= "\t\t\treturn true;\n";
$html .= "\t\t} else {\n";
$html .= "\t\t\tvar valid=(LV_" . $id . ".message!='Thankyou!'||LV_" . $id . ".message==null)?false:true;\n";
$html .= "\t\t\tif (valid) return true;\n";
$html .= "\t\t\tlv_error_alert_id = '" . $id . "';\n";
if ($this->field_name != "") {
$html .= "\t\t\tlv_error_alert_field_name = '" . addslashes($this->field_name) . "';\n";
} else {
$html .= "\t\t\tlv_error_alert_field_name = '';\n";
}
if ($this->alert_msg != "") {
$html .= "\t\t\tlv_error_alert_msg = '" . addslashes($this->alert_msg) . "';\n";
} else {
$html .= "\t\t\tlv_error_alert_msg = '';\n";
}
$html .= "\t\t\treturn false;\n";
$html .= "\t\t}\n";
$html .= "\t};\n";
} else {
throw new NewException("To use LineValidation for object " . get_class($this->object) . " you must add him in a form (form object is null).", 0, getDebugBacktrace(1));
}
} else {
throw new NewException("LineValidation error: method getFormObject is missing for object " . get_class($this->object) . ".", 0, getDebugBacktrace(1));
}
$html .= $this->getJavascriptTagClose();
$this->object_change = false;
return $html;
}
示例11: DialogBox
unset($_SESSION['serializedExercise']);
unset($_SESSION['serializedQuestionList']);
unset($_SESSION['exeStartTime']);
if (!empty($_REQUEST['copyFrom']) && $is_allowedToEdit) {
$_SESSION['returnToTrackingUserId'] = (int) $_GET['copyFrom'];
$copyError = false;
//we could simply copy the requested module progression...
//but since we can navigate between modules while completing a module,
//we have to copy the whole learning path progression.
if (!copyLearnPathProgression((int) $_SESSION['returnToTrackingUserId'], (int) claro_get_current_user_id(), (int) $_SESSION['path_id'])) {
$copyError = true;
}
$dialogBox = new DialogBox();
if ($copyError) {
$dialogBox->error(get_lang('An error occured while accessing student module'));
$claroline->display->body->appendContent($dialogBox->render());
echo $claroline->display->render();
exit;
} else {
$user_data = user_get_properties((int) $_SESSION['returnToTrackingUserId']);
$dialogBox->success(get_lang('Currently viewing module of ') . $user_data['firstname'] . ' ' . $user_data['lastname']);
unset($user_data);
}
unset($copyError);
} else {
unset($_SESSION['returnToTrackingUserId']);
}
// main page
// FIRST WE SEE IF USER MUST SKIP THE PRESENTATION PAGE OR NOT
// triggers are : if there is no introdution text or no user module progression statistics yet and user is not admin,
// then there is nothing to show and we must enter in the module without displaying this page.
示例12: display_my_documents
/**
* This function is used to display the list of document available in the course
* It also displays the form used to add selected document in the learning path
*
* @param string $dialogBox Error or confirmation text
* @return nothing
* @author Piraux S�bastien <pir@cerdecam.be>
* @author Lederer Guillaume <led@cerdecam.be>
*/
function display_my_documents($dialogBox)
{
global $is_allowedToEdit;
global $curDirName;
global $curDirPath;
global $parentDir;
global $fileList;
/**
* DISPLAY
*/
$out = '';
$out .= '<!-- display_my_documents output -->' . "\n";
$dspCurDirName = claro_htmlspecialchars($curDirName);
$cmdCurDirPath = rawurlencode($curDirPath);
$cmdParentDir = rawurlencode($parentDir);
$out .= '<br />' . '<form action="' . $_SERVER['PHP_SELF'] . '" method="post">';
/*--------------------------------------
DIALOG BOX SECTION
--------------------------------------*/
$colspan = 4;
if (!empty($dialogBox)) {
$_dialogBox = new DialogBox();
$_dialogBox->form($dialogBox);
$out .= $_dialogBox->render();
}
/*--------------------------------------
CURRENT DIRECTORY LINE
--------------------------------------*/
/* GO TO PARENT DIRECTORY */
if ($curDirName) {
$out .= '<a href="' . $_SERVER['PHP_SELF'] . '?cmd=exChDir&file=' . $cmdParentDir . '">' . "\n" . '<img src="' . get_icon_url('parent') . '" hspace="5" alt="" /> ' . "\n" . '<small>' . get_lang('Up') . '</small>' . "\n" . '</a>' . "\n";
}
/* CURRENT DIRECTORY */
$out .= '<table class="claroTable emphaseLine">' . '<thead>';
// If the $curDirName is empty, we're in the root point
// and there is'nt a dir name to display
if ($curDirName) {
$out .= '<!-- current dir name -->' . "\n" . '<tr>' . "\n" . '<th class="superHeader" colspan="' . $colspan . '" align="left">' . "\n" . '<img src="' . get_icon_url('opendir') . '" vspace=2 hspace=5 alt="" /> ' . "\n" . $dspCurDirName . "\n" . '</td>' . "\n" . '</tr>' . "\n";
}
$out .= '<tr align="center" valign="top">' . "\n" . '<th width="10%">' . get_lang('Add module(s)') . '</th>' . "\n" . '<th>' . get_lang('Name') . '</th>' . "\n" . '<th>' . get_lang('Size') . '</th>' . "\n" . '<th>' . get_lang('Date') . '</th>' . "\n" . '</tr>' . '</thead>' . '<tbody>' . "\n";
/*--------------------------------------
DISPLAY FILE LIST
--------------------------------------*/
if ($fileList) {
$iterator = 0;
while (list($fileKey, $fileName) = each($fileList['name'])) {
$dspFileName = claro_htmlspecialchars($fileName);
$cmdFileName = str_replace("%2F", "/", rawurlencode($curDirPath . "/" . $fileName));
if ($fileList['visibility'][$fileKey] == "i") {
if ($is_allowedToEdit) {
$style = ' class="invisible"';
} else {
$style = "";
continue;
// skip the display of this file
}
} else {
$style = "";
}
if ($fileList['type'][$fileKey] == A_FILE) {
$image = choose_image($fileName);
$size = format_file_size($fileList['size'][$fileKey]);
$date = format_date($fileList['date'][$fileKey]);
if ($GLOBALS['is_Apache'] && get_conf('secureDocumentDownload')) {
// slash argument method - only compatible with Apache
$doc_url = $cmdFileName;
} else {
// question mark argument method, for IIS ...
$doc_url = '?url=' . $cmdFileName;
}
$urlFileName = get_path('clarolineRepositoryWeb') . 'backends/download.php' . $doc_url;
} elseif ($fileList['type'][$fileKey] == A_DIRECTORY) {
$image = 'folder';
$size = ' ';
$date = ' ';
$urlFileName = $_SERVER['PHP_SELF'] . '?openDir=' . $cmdFileName;
}
$out .= '<tr ' . $style . '>' . "\n";
if ($fileList['type'][$fileKey] == A_FILE) {
$iterator++;
$out .= '<td style="vertical-align:top; text-align: center;">' . '<input type="checkbox" name="insertDocument_' . $iterator . '" id="insertDocument_' . $iterator . '" value="' . $curDirPath . "/" . $fileName . '" />' . '</td>' . "\n";
} else {
$out .= '<td> </td>';
}
$out .= '<td>' . '<a href="' . $urlFileName . '" ' . $style . '>' . '<img src="' . get_icon_url($image) . '" hspace="5" alt="" /> ' . $dspFileName . '</a>';
// Comments
if ($fileList['comment'][$fileKey] != "") {
$fileList['comment'][$fileKey] = claro_htmlspecialchars($fileList['comment'][$fileKey]);
$fileList['comment'][$fileKey] = claro_parse_user_text($fileList['comment'][$fileKey]);
$out .= '<div class="comment">' . $fileList['comment'][$fileKey] . '</div>' . "\n";
}
//.........这里部分代码省略.........
示例13: claro_die
/**
* Terminate the script and display message
*
* @param string message
*/
function claro_die($message)
{
FromKernel::uses('display/dialogBox.lib');
$dialogBox = new DialogBox();
$dialogBox->error($message);
Claroline::getInstance()->display->setContent($dialogBox->render());
if (claro_debug_mode()) {
pushClaroMessage(var_export(debug_backtrace(), true), 'debug');
}
echo Claroline::getInstance()->display->render();
die;
// necessary to prevent any continuation of the application
}
示例14: array
$cmdList = array();
if (!empty($userId)) {
$cmdList[] = array('img' => 'enroll', 'name' => get_lang('Enrol to a new course'), 'url' => claro_htmlspecialchars('../auth/courses.php' . '?cmd=rqReg' . '&uidToEdit=' . $userId . '&fromAdmin=settings' . '&category='));
$cmdList[] = array('img' => 'mail_close', 'name' => get_lang('Send account information to user by email'), 'url' => claro_htmlspecialchars('../auth/lostPassword.php' . '?Femail=' . urlencode($userData['email']) . '&searchPassword=1'));
$cmdList[] = array('img' => 'course', 'name' => get_lang('User course list'), 'url' => claro_htmlspecialchars('adminusercourses.php?uidToEdit=' . $userData['user_id']));
$cmdList[] = array('img' => 'deluser', 'name' => get_lang('Delete user'), 'url' => claro_htmlspecialchars('adminuserdeleted.php' . '?uidToEdit=' . $userId . '&cmd=rqDelete'));
$cmdList[] = array('name' => get_lang('Send a message to the user'), 'url' => claro_htmlspecialchars('../messaging/sendmessage.php' . '?cmd=rqMessageToUser' . '&userId=' . $userId));
if (isset($_REQUEST['cfrom']) && $_REQUEST['cfrom'] == 'ulist') {
$cmdList[] = array('img' => 'back', 'name' => get_lang('Back to user list'), 'url' => claro_htmlspecialchars('admin_users.php'));
} elseif (isset($_REQUEST['cfrom']) && $_REQUEST['cfrom'] == 'culist') {
$cid = isset($_REQUEST['cid']) ? $_REQUEST['cid'] : null;
$cmdList[] = array('img' => 'back', 'name' => get_lang('Back to user list'), 'url' => claro_htmlspecialchars(get_path('url') . '/claroline/user/user.php?cidReq=' . $cid . '&cidReset=true'));
}
}
// Display
$out = '';
// Tool title
if (!empty($userId)) {
$titleParts = array('mainTitle' => get_lang('User settings'), 'subTitle' => $userData['firstname'] . ' ' . $userData['lastname']);
} else {
$titleParts = array('mainTitle' => get_lang('User settings'));
}
$out .= claro_html_tool_title($titleParts, null, $cmdList) . $dialogBox->render();
if (!empty($userId)) {
$out .= user_html_form($userId);
}
if (!empty($dgExtra)) {
$out .= $dgExtra->render();
}
$claroline->display->body->appendContent($out);
echo $claroline->display->render();
示例15: rawurlencode
$urlDelete = $_SERVER['PHP_SELF'] . '?cmd=exLocalRemove&moduleDir=' . rawurlencode($module_folder);
$dialogBox->warning(get_lang('There is a folder called <b><i>%module_name</i></b> for which there is no module installed.', array('%module_name' => $module_folder)) . '<ul>' . "\n" . '<li>' . "\n" . '<a href="' . $urlTryInstall . '">' . get_lang('Install this module') . '</a>' . '</li>' . "\n" . '<li>' . "\n" . '<a href="' . $urlDelete . '">' . get_lang('Remove this module') . '</a>' . '</li>' . "\n" . '</ul>' . "\n");
}
//needed info for reorder buttons to known if we must display action (or not)
$course_tool_min_rank = get_course_tool_min_rank();
$course_tool_max_rank = get_course_tool_max_rank();
// Command list
$cmdList = array();
$cmdList[] = array('name' => get_lang('Install module'), 'url' => 'module_list.php?cmd=rqInstall');
//----------------------------------
// DISPLAY
//----------------------------------
$noQUERY_STRING = true;
$out = '';
// Title
$out .= claro_html_tool_title($nameTools, null, $cmdList) . $dialogBox->render() . '<div>' . "\n" . '<ul id="navlist">' . "\n";
// Display the module type tabbed naviguation bar
foreach ($moduleTypeList as $type) {
if ($typeReq == $type) {
$out .= '<li><a href="module_list.php?typeReq=' . $type . '" class="current">' . $typeLabel[$type] . '</a></li>' . "\n";
} else {
$out .= '<li><a href="module_list.php?typeReq=' . $type . '">' . $typeLabel[$type] . '</a></li>' . "\n";
}
}
$out .= '</ul>' . "\n" . '</div>' . "\n";
// Display Pager list
if ($myPager->get_next_offset()) {
$out .= $myPager->disp_pager_tool_bar('module_list.php?typeReq=' . $typeReq);
}
// Start table...
$out .= '<table class="claroTable emphaseLine" width="100%" border="0" cellspacing="2">' . "\n\n" . '<thead>' . "\n" . '<tr>' . "\n" . '<th>' . get_lang('Icon') . '</th>' . "\n" . '<th>' . get_lang('Module name') . '</th>' . "\n" . '<th>' . get_lang('Module administration') . '</th>' . "\n";