Exemplo n.º 1
0
/**
 * 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 <*****@*****.**>
 * @author      Lederer Guillaume <*****@*****.**>
 * @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;
}
Exemplo n.º 2
0
 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, "&nbsp;", $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);
 }
Exemplo n.º 3
0
/**
 * 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;
}
Exemplo n.º 4
0
/**
 * 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 <*****@*****.**>
 * @author      Lederer Guillaume <*****@*****.**>
 * @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;
}
Exemplo n.º 5
0
/**
* 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 <*****@*****.**>
* @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;
}
Exemplo n.º 6
0
                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());
Exemplo n.º 7
0
 *  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());
Exemplo n.º 8
0
    $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 .= "&amp;";
    }
    $orderLink .= "order=" . $nextOrder . "&amp;";
    $javascriptDelete = '
    <script type="text/javascript">
  
        function deleteSelection ()
        {
           if ( $("input[@type=checkbox][@checked]").size() < 1 )
           {
Exemplo n.º 9
0
 /*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')) . '">&lt;&lt; ' . 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;
Exemplo n.º 10
0
 /**
  * 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;
 }
Exemplo n.º 11
0
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.
Exemplo n.º 12
0
/**
 * 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 <*****@*****.**>
 * @author Lederer Guillaume <*****@*****.**>
 */
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&amp;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 = '&nbsp;';
                $date = '&nbsp;';
                $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>&nbsp;</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";
            }
            $out .= '</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,">"
             */
            $out .= '</tr>' . "\n";
        }
        // end each ($fileList)
        // form button
        $out .= '</tbody>' . '</table>' . "\n\n" . '<input type="hidden" name="openDir" value="' . $curDirPath . '" />' . "\n" . '<input type="hidden" name="maxDocForm" value ="' . $iterator . '" />' . "\n" . '<input type="submit" name="submitInsertedDocument" value="' . get_lang('Add selection') . '" />';
    } else {
        $out .= '<tr>' . "\n" . '<td colspan="2" align="center">' . get_lang('There is no document for the moment') . '</td>' . "\n" . '</tr>' . "\n" . '</tbody>' . '</table>' . "\n\n";
    }
    $out .= '</form>' . "\n" . '<br /><br />' . '<!-- end of display_my_documents output -->' . "\n";
    return $out;
}
Exemplo n.º 13
0
/**
 * 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
}
Exemplo n.º 14
0
$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();
Exemplo n.º 15
0
    $urlDelete = $_SERVER['PHP_SELF'] . '?cmd=exLocalRemove&amp;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";
Exemplo n.º 16
0
        $dialogBox->question($question);
    }
    if ($cmd == 'exMerge') {
        $uidToKeep = $userInput->getMandatory('uidToKeep');
        $uidToRemove = $userInput->getMandatory('uidToRemove');
        if ($uidToKeep == $uidToRemove) {
            throw new Exception(get_lang('Cannot merge one user account with itself'));
        }
        if (!user_get_properties($uidToKeep)) {
            throw new Exception(get_lang('User to keep not found'));
        }
        if (!user_get_properties($uidToRemove)) {
            throw new Exception(get_lang('User to remove not found'));
        }
        $mergeUser = new MergeUser();
        $mergeUser->merge($uidToRemove, $uidToKeep);
        if ($mergeUser->hasError()) {
            $dialogBox->error(get_lang('Some errors have occured while merging those user account, check the log table in the platform main database for more details'));
        } else {
            $dialogBox->success(get_lang('User accounts merged'));
        }
    }
} catch (Exception $e) {
    $dialogBox->error(get_lang('Cannot perform the requested action') . ' : <br />' . $e->getMessage());
    pushClaroMessage('<pre>' . $e->__toString() . '</pre>');
}
ClaroBreadCrumbs::getInstance()->prepend(get_lang('Administration'), get_path('rootAdminWeb'));
ClaroBreadCrumbs::getInstance()->setCurrent(get_lang('Merge user accounts'), php_self());
ClaroBody::getInstance()->appendContent(claro_html_tool_title(get_lang('Merge user accounts')));
ClaroBody::getInstance()->appendContent($dialogBox->render());
echo Claroline::getInstance()->display->render();
Exemplo n.º 17
0
        $manager = new $ctr(claro_get_current_course_id());
        $manager->deleteAll();
    }
    $dialogBox->success(get_lang('Course statistics are now empty'));
    Console::log("In course " . claro_get_current_course_id() . " : all tracking events deleted by user " . claro_get_current_user_id(), 'COURSE_RESET_ALL_TRACKING');
    $display = DISP_FLUSH_RESULT;
}
/*
 * Prepare output
 */
$nameTools = get_lang('Delete all course statistics');
/*
 * Output
 */
$html = '';
$html .= claro_html_tool_title($nameTools);
if (DISP_FLUSH_RESULT == $display) {
    // display confirm msg and back link
    $dialogBox->info('<small>' . '<a href="courseReport.php">' . '&lt;&lt;&nbsp;' . get_lang('Back') . '</a>' . '</small>' . "\n");
} elseif (DISP_FORM == $display) {
    $dialogBox->warning(get_lang('Delete is definitive.  There is no way to get your data back after delete.'));
    $dialogBox->form('<form action="' . $_SERVER['PHP_SELF'] . '">' . "\n" . claro_form_relay_context() . '<input type="hidden" name="cmd" value="exDelete" />' . "\n" . '<input type="radio" name="scope" id="scope_all" value="ALL" />' . "\n" . '<label for="scope_all">' . get_lang('All') . '</label>' . "\n" . '<br />' . "\n" . '<input type="radio" name="scope" id="scope_before" value="BEFORE" checked="checked" />' . "\n" . '<label for="scope_before" >' . get_lang('Before') . '</label> ' . "\n" . claro_html_date_form('beforeDate[day]', 'beforeDate[month]', 'beforeDate[year]', time(), 'short') . '<br /><br />' . "\n" . '<input type="submit" name="action" value="' . get_lang('Ok') . '" />&nbsp; ' . claro_html_button('courseReport.php', get_lang('Cancel')) . '</form>' . "\n");
}
// end else if $delete
$html .= $dialogBox->render();
/*
 * Output rendering
 */
ClaroBreadCrumbs::getInstance()->prepend(get_lang('Statistics'), 'courseReport.php');
$claroline->display->body->setContent($html);
echo $claroline->display->render();
Exemplo n.º 18
0
     /*
      * When you enroll another user and if you are platform admin, 
      * give the possibility to enroll him as a student or as a teacher
      */
     if ($fromAdmin == 'usercourse' && claro_is_platform_admin()) {
         // Rewrite the "asTeacher" URL parameter only for this button action
         if ($asTeacher) {
             $cmdList[] = array('img' => 'user', 'name' => get_lang('Enrol as student'), 'url' => Url::buildUrl($_SERVER['PHP_SELF'] . '?cmd=rqReg', array_merge($urlParamList, array('asTeacher' => 'false')), null)->toUrl());
         } else {
             $cmdList[] = array('img' => 'manager', 'name' => get_lang('Enrol as teacher'), 'url' => Url::buildUrl($_SERVER['PHP_SELF'] . '?cmd=rqReg', array_merge($urlParamList, array('asTeacher' => 'true')), null)->toUrl());
         }
     }
     // Display the title
     $out .= claro_html_tool_title(array('mainTitle' => $mainTitle, 'subTitle' => $subTitle), null, $cmdList);
     // Display dialogbox and backlink
     $out .= $dialogBox->render();
     $out .= $categoryBrowser->getTemplate()->render() . $searchBox->render();
     break;
     /*---------------------------------------------------------------------
       Display message
       ---------------------------------------------------------------------*/
 /*---------------------------------------------------------------------
   Display message
   ---------------------------------------------------------------------*/
 case DISPLAY_MESSAGE_SCREEN:
     $mainTitle = get_lang('User\'s course');
     $subTitle = $userInfo['firstname'] . ' ' . $userInfo['lastname'];
     $out .= claro_html_tool_title(array('mainTitle' => $mainTitle, 'subTitle' => $subTitle)) . $dialogBox->render();
     break;
     /*---------------------------------------------------------------------
       Display user courses in order to unenroll (default display)
 /**
  * Method getAjaxEventFunctionRender
  * @access protected
  * @return string
  * @since 1.0.35
  */
 protected function getAjaxEventFunctionRender()
 {
     $html = "";
     $loading_obj = null;
     if (get_class($this) == "UploadFile") {
         $loading_obj = $this->getProgressBarObject();
         if ($this->isSizeLimitJsCheckActivated() && $this->getFileSizeLimit() != -1) {
             $size_alert = new DialogBox(__(ERROR), __(UPLOAD_FILESIZE_LIMIT_ERROR_MSG, $this->getFileSizeLimitStr()));
             $size_alert->activateCloseButton()->setWidth(500);
             $size_alert->setDialogBoxLevel(rand(90000, 99999));
             $html .= "var displaySizeErrorDialogBox" . get_class($this) . "_" . $this->getEventObjectName() . " = function(filename) {\n";
             $html .= $size_alert->render();
             $html .= "};\n";
         } else {
             $html .= "var displaySizeErrorDialogBox" . get_class($this) . "_" . $this->getEventObjectName() . " = null;\n";
         }
         if ($this->isMimeTypeJsCheckActivated() && sizeof($this->getAuthorizedMimeTypes()) > 0) {
             $mime_alert = new DialogBox(__(ERROR), __(UPLOAD_MIME_TYPES_ERROR_MSG, implode(", ", $this->getAuthorizedMimeTypes())));
             $mime_alert->activateCloseButton()->setWidth(500);
             $mime_alert->setDialogBoxLevel(rand(90000, 99999));
             $html .= "var displayMimeErrorDialogBox" . get_class($this) . "_" . $this->getEventObjectName() . " = function(filename, mime_type) {\n";
             $html .= $mime_alert->render();
             $html .= "};\n";
         } else {
             $html .= "var displayMimeErrorDialogBox" . get_class($this) . "_" . $this->getEventObjectName() . " = null;\n";
         }
     }
     if (gettype($this->ajax_wait_message) != "object") {
         $loading_img = new Picture("wsp/img/loading.gif", 32, 32);
         $loading_img->setId("wspAjaxEventLoadingPic" . get_class($this) . "_" . $this->getEventObjectName());
         $loading_modalbox = new DialogBox(__(LOADING), new Object($this->ajax_wait_message, "<br/>", $loading_img, $loading_obj));
         $loading_modalbox->setDialogBoxLevel(rand(90000, 99999))->modal();
     }
     $error_alert = new DialogBox(__(ERROR), __(SUBMIT_ERROR));
     $error_alert->activateCloseButton()->setWidth(500);
     $error_alert->setDialogBoxLevel(rand(90000, 99999));
     $error_unknow_alert = new DialogBox(__(ERROR), __(SUBMIT_UNKNOW_ERROR));
     $error_unknow_alert->activateCloseButton()->setWidth(400);
     $error_unknow_alert->setDialogBoxLevel(rand(90000, 99999));
     $html .= "\tvar isRequestedAjaxEvent" . get_class($this) . "_" . $this->getEventObjectName() . " = false;\n";
     $html .= "\tvar lastAjaxRequest" . get_class($this) . "_" . $this->getEventObjectName() . " = Array();\n";
     $html .= "\tvar nbAjaxRequest" . get_class($this) . "_" . $this->getEventObjectName() . " = 0;\n";
     if ($this->is_ajax_event) {
         $html .= "\tvar encryptedObjectValueArray" . get_class($this) . "_" . $this->getEventObjectName() . " = Array();\n";
     }
     $html .= "\tcallAjax" . get_class($this) . "_" . $this->getEventObjectName() . "_event = function(callback_value, abort_last_request) {\n";
     $html .= "\t\tif (isRequestedAjaxEvent" . get_class($this) . "_" . $this->getEventObjectName() . " && !abort_last_request) { return; }\n";
     $html .= "\t\tisRequestedAjaxEvent" . get_class($this) . "_" . $this->getEventObjectName() . " = true;\n";
     $html .= "\t\tnbAjaxRequest" . get_class($this) . "_" . $this->getEventObjectName() . "++;\n";
     if (!$this->disable_ajax_wait_message) {
         if (gettype($this->ajax_wait_message) == "object") {
             $html .= "\t\t\$('#" . $this->ajax_wait_message->getId() . "').css('display', 'block');\n";
         } else {
             $html .= "\t\t" . $loading_modalbox->render() . "\n";
         }
         $html .= "\t\tsetTimeout(\"requestAjaxEvent" . get_class($this) . "_" . $this->getEventObjectName() . "(\\\"\" + callback_value + \"\\\", \" + abort_last_request + \");\", " . (gettype($this->ajax_wait_message) == "object" ? "1" : "1000") . ");\n";
     } else {
         $html .= "\t\tsetTimeout(\"requestAjaxEvent" . get_class($this) . "_" . $this->getEventObjectName() . "(\\\"\" + callback_value + \"\\\", \" + abort_last_request + \");\", (abort_last_request?(lastAjaxRequest" . get_class($this) . "_" . $this->getEventObjectName() . ".length==0?1:200):1));\n";
     }
     $html .= "\t};\n";
     $html .= "\trequestAjaxEvent" . get_class($this) . "_" . $this->getEventObjectName() . " = function(callback_value, abort_last_request) {\n";
     $html .= "\t\tnbAjaxRequest" . get_class($this) . "_" . $this->getEventObjectName() . "--;\n";
     $html .= "\t\tif (abort_last_request) { for (var i=0; i < lastAjaxRequest" . get_class($this) . "_" . $this->getEventObjectName() . ".length; i++) { if (lastAjaxRequest" . get_class($this) . "_" . $this->getEventObjectName() . "[i]!=null) { lastAjaxRequest" . get_class($this) . "_" . $this->getEventObjectName() . "[i].abort(); lastAjaxRequest" . get_class($this) . "_" . $this->getEventObjectName() . "[i]=null; } } if (nbAjaxRequest" . get_class($this) . "_" . $this->getEventObjectName() . " > 0) { return; } }\n";
     // encrypt formular if encrypt is active
     if ($this->form_object != null) {
         $html .= "\t\t" . $this->encryptObjectData($this->form_object, "isRequestedAjaxEvent" . get_class($this) . "_" . $this->getEventObjectName() . " = false;" . ($loading_modalbox == null ? "" : $loading_modalbox->close()->render()));
     }
     if (get_class($this) == "UploadFile") {
         $html .= "var upload_status = \$('#" . $this->getId() . "').upload('";
     } else {
         $html .= "\t\tlastAjaxRequest" . get_class($this) . "_" . $this->getEventObjectName() . "[lastAjaxRequest" . get_class($this) . "_" . $this->getEventObjectName() . ".length] = \$.ajax({ type: '";
         if ($this->form_object != null) {
             $html .= $this->form_object->getMethod();
         } else {
             $html .= "POST";
         }
         $html .= "', url: '";
     }
     $html .= BASE_URL . LANGUAGE_URL . "/ajax/";
     if ($this->form_object == null) {
         $html .= $this->getPage()->getPage() . ".html";
         if (PARAMS_URL != "") {
             $pos = find(PARAMS_URL, "?", 0, $pos);
             if ($pos > 0) {
                 $pos2 = strlen(PARAMS_URL);
                 $html .= "?" . substr(PARAMS_URL, $pos, $pos2 - $pos);
             }
         }
     } else {
         if ($this->form_object->getAction() == "") {
             $html .= $this->form_object->getPageObject()->getPage() . ".html";
             if (PARAMS_URL != "") {
                 $pos = find(PARAMS_URL, "?", 0, $pos);
                 if ($pos > 0) {
                     $pos2 = strlen(PARAMS_URL);
                     $html .= "?" . substr(PARAMS_URL, $pos, $pos2 - $pos);
                 }
             }
         } else {
             $html .= $this->form_object->getAction();
         }
     }
     $html .= "',\n";
     if (get_class($this) == "UploadFile") {
         $html .= "\t\t\t\$('#Callback_" . $this->getEventObjectName() . "').serialize(),\n";
     } else {
         if ($this->form_object != null) {
             $html .= "\t\t\tdata: ";
             if ($this->form_object->isEncrypted()) {
                 $html .= "encrypt_data";
             } else {
                 $html .= "\$('#" . $this->form_object->getId() . "').serialize() + '&Callback_" . $this->getEventObjectName() . "=' + callback_value";
             }
             $html .= ",\n";
         } else {
             $html .= "\t\t\tdata: 'Callback_" . $this->getEventObjectName() . "=' + callback_value,\n";
         }
         $html .= "\t\t\tdataType: 'json',\n";
         $html .= "\t\t\tsuccess: ";
     }
     $html .= "function(ajax_event_response) {\n";
     $html .= "\t\t\t\tisRequestedAjaxEvent" . get_class($this) . "_" . $this->getEventObjectName() . " = false;\n";
     $html .= "\t\t\t\tif (ajax_event_response != \"\") {\n";
     $html .= "\t\t\t\t\tvar dialogbox_is_change = false;\n";
     if (isLocalDebug()) {
         $html .= "\t\t\t\t\tvar alert_local_eval_error = true;\n";
     }
     $html .= "\t\t\t\t\tfor (var ajax_event_ind=0; ajax_event_ind < ajax_event_response.length; ajax_event_ind++) {\n";
     if (!$this->disable_ajax_wait_message) {
         $html .= "\t\t\t\t\t\tif (ajax_event_response[ajax_event_ind] != null && ajax_event_response[ajax_event_ind].indexOf('wspDialogBox" . $modalbox_indice . "' + ' = ') != -1) {\n";
         $html .= "\t\t\t\t\t\t\tdialogbox_is_change = true;\n";
         $html .= "\t\t\t\t\t\t}\n";
     }
     if (get_class($this) == "UploadFile") {
         $html .= "\t\t\t\t\t\tajax_event_response[ajax_event_ind] = myReplaceAll(myReplaceAll(ajax_event_response[ajax_event_ind], '{#wsp_lt}', '<'), '{#wsp_gt}', '>');\n";
     }
     $html .= "\t\t\t\t\t\ttry {\n";
     $html .= "\t\t\t\t\t\t\teval(ajax_event_response[ajax_event_ind]);\n";
     $html .= "\t\t\t\t\t\t} catch (e) {\n";
     $html .= "\t\t\t\t\t\t\tconsole.log('Js error: ' + e.message + '\\nCode: ' + ajax_event_response[ajax_event_ind]);\n";
     // display ajax render error message when it's local or debug execution (useful to debug)
     if (isLocalDebug()) {
         $html .= "\t\t\t\t\t\t\tif (alert_local_eval_error) {\n";
         $html .= "\t\t\t\t\t\t\t\talert('An error appeared during Ajax event, please check the console of your browser to see the error(s).');";
         $html .= "\t\t\t\t\t\t\t\talert_local_eval_error = false;\n";
         $html .= "\t\t\t\t\t\t\t}\n";
     }
     $html .= "\t\t\t\t\t\t}\n";
     $html .= "\t\t\t\t\t}\n";
     if (!$this->disable_ajax_wait_message) {
         if (gettype($this->ajax_wait_message) == "object") {
             $html .= "\t\t\t\t\t\$('#" . $this->ajax_wait_message->getId() . "').css('display', 'none');\n";
         } else {
             $html .= "\t\t\t\t\tif (!dialogbox_is_change) {\n";
             $html .= "\t\t\t\t\t\t" . $loading_modalbox->close()->render();
             $html .= "\t\t\t\t\t}\n";
         }
     }
     $html .= "\t\t\t\t} else {\n";
     if (gettype($this->ajax_wait_message) == "object") {
         $html .= "\t\t\t\t\t\$('#" . $this->ajax_wait_message->getId() . "').css('display', 'none');\n";
     } else {
         $html .= "\t\t\t\t\t" . $loading_modalbox->close()->render();
     }
     $html .= "\t\t\t\t\t" . $error_unknow_alert->render() . "\n";
     $html .= "\t\t\t\t}\n";
     $html .= "\t\t\t\t\$('#Callback_" . $this->getEventObjectName() . "').val('');\n";
     if ($this->is_ajax_event) {
         $html .= "\t\t\t\trestoreEncryptedObject" . get_class($this) . "_" . $this->getEventObjectName() . "();\n";
     }
     $html .= "\t\t\t},\n";
     if (get_class($this) == "UploadFile") {
         $html .= "\t\t\t'json', \$('#wsp_object_wspAjaxEventLoadingObj" . get_class($this) . "_" . $this->getEventObjectName() . "'), \$('#wspAjaxEventLoadingPic" . get_class($this) . "_" . $this->getEventObjectName() . "'), displaySizeErrorDialogBox" . get_class($this) . "_" . $this->getEventObjectName() . ", '" . $this->getFileSizeLimit() . "', displayMimeErrorDialogBox" . get_class($this) . "_" . $this->getEventObjectName() . ", '" . implode(", ", $this->getAuthorizedMimeTypes()) . "');\n";
         $html .= "\t\t\tisRequestedAjaxEvent" . get_class($this) . "_" . $this->getEventObjectName() . " = false;\n";
         $html .= "\t\t\tif (upload_status === false) {\n";
         if (gettype($this->ajax_wait_message) == "object") {
             $html .= "\t\t\t\t\t\$('#" . $this->ajax_wait_message->getId() . "').css('display', 'none');\n";
         } else {
             $html .= "\t\t\t\t\t" . $loading_modalbox->close()->render() . "\n";
         }
         $html .= "\t\t\t}\n";
     } else {
         $html .= "\t\t\terror: function(transport) {\n";
         $html .= "\t\t\t\tisRequestedAjaxEvent" . get_class($this) . "_" . $this->getEventObjectName() . " = false;\n";
         $html .= "\t\t\t\tif (!abort_last_request || (abort_last_request && trim(transport.statusText) != 'abort')) {\n";
         if (gettype($this->ajax_wait_message) == "object") {
             $html .= "\t\t\t\t\t\$('#" . $this->ajax_wait_message->getId() . "').css('display', 'none');\n";
         } else {
             $html .= "\t\t\t\t\t" . $loading_modalbox->close()->render() . "\n";
         }
         $html .= "\t\t\t\t\tif (trim(transport.responseText) == '') {\n";
         $html .= "\t\t\t\t\t\t" . $error_unknow_alert->render();
         $html .= "\t\t\t\t\t} else {\n";
         $html .= "\t\t\t\t\t\t" . $error_alert->render();
         $html .= "\t\t\t\t\t}\n";
         $html .= "\t\t\t\t}\n";
         $html .= "\t\t\t\t\$('#Callback_" . $this->getEventObjectName() . "').val('');\n";
         if ($this->is_ajax_event) {
             $html .= "\t\t\t\trestoreEncryptedObject" . get_class($this) . "_" . $this->getEventObjectName() . "();\n";
         }
         $html .= "\t\t\t}\n";
     }
     if (get_class($this) != "UploadFile") {
         $html .= "\t\t});\n";
     }
     $html .= "\t};\n";
     if ($this->is_ajax_event) {
         $html .= "\trestoreEncryptedObject" . get_class($this) . "_" . $this->getEventObjectName() . " = function() {\n";
         $html .= "\t\tfor (var i=0; i < encryptedObjectValueArray" . get_class($this) . "_" . $this->getEventObjectName() . ".length; i++) {\n";
         $html .= "\t\t\t\$('#' + encryptedObjectValueArray" . get_class($this) . "_" . $this->getEventObjectName() . "[i][0]).val(encryptedObjectValueArray" . get_class($this) . "_" . $this->getEventObjectName() . "[i][1]);\n";
         $html .= "\t\t}\n";
         $html .= "\t};\n";
     }
     return $html;
 }
Exemplo n.º 20
0
    $dialogBox = new DialogBox();
    $dialogBoxMsg = get_lang('All messages older than %date% have been deleted', array('%date%' => $date)) . '<br /><br />' . '<a href="admin.php">' . get_lang('Back') . '</a>';
    $dialogBox->success($dialogBoxMsg);
    $content .= '<br />' . $dialogBox->render();
}
// --------------- end older than
// ------------ platform message
if ($displayRemovePlatformMessageConfirmation) {
    $dialogBox = new DialogBox();
    $dialogBox->setBoxType('question');
    $dialogBox->question(get_lang('Are you sure to delete all platform messages?'));
    $dialogBox->warning(get_lang('There is no way to restore deleted messages.'));
    $dialogBox->info('<br /><br /><a href="' . $_SERVER['PHP_SELF'] . '?cmd=exPlatformMessage">' . get_lang('Yes') . '</a> | <a href="admin.php">' . get_lang('No') . '</a>');
    $content .= '<br />' . $dialogBox->render();
}
if ($displayRemovePlatformMessageValidated) {
    $dialogBoxMsg = get_lang('All platform messages have been deleted') . '<br /><br />' . '<a href="admin.php">' . get_lang('Back') . '</a>';
    $dialogBox = new DialogBox();
    $dialogBox->info($dialogBoxMsg);
    $content .= '<br />' . $dialogBox->render();
}
// ------------- end platform message
// ------------------- render ----------------------------
$claroline->display->banner->breadcrumbs->append(get_lang('Administration'), get_path('rootAdminWeb'));
$claroline->display->banner->breadcrumbs->append(get_lang('Internal messaging'), 'admin.php');
$claroline->display->banner->breadcrumbs->append(get_lang('Delete'), 'admin_delete.php?cmd=' . addslashes($_REQUEST['cmd']));
$title['mainTitle'] = get_lang('Internal messaging') . ' - ' . get_lang('Delete');
$title['subTitle'] = $subTitle;
$claroline->display->body->appendContent(claro_html_tool_title($title));
$claroline->display->body->appendContent($content);
echo $claroline->display->render();
Exemplo n.º 21
0
// display select box with language in the table
$sql = "SELECT DISTINCT language \n        FROM " . $tbl_translation . "\n        ORDER BY language ";
$results = claro_sql_query($sql);
$form .= "<select name=\"language\">";
while ($result = mysql_fetch_row($results)) {
    if ($result[0] == $language) {
        $form .= "<option value={$result['0']} selected=\"selected\">" . $result[0] . "</option>";
    } else {
        $form .= "<option value={$result['0']}>" . $result[0] . "</option>";
    }
}
$form .= "</select>";
$form .= "<input type=\"submit\" value=\"OK\" />";
$form .= "</form>";
$dialogBox->form($form);
echo $dialogBox->render();
// select variables with same content
$sql = " SELECT DISTINCT L1.language , L1.varContent , L1.varName , L1.sourceFile\n    FROM " . $tbl_translation . " L1,\n         " . $tbl_translation . " L2,\n         " . $tbl_used_lang . " U\n    WHERE L1.language = \"" . $language . "\" and\n        L1.language = L2.language and\n        L1.varContent = L2.varContent and\n        L1.varName <> L2.varName and\n        L1.varName = U.varName\n    ORDER BY L1.varContent, L1.varName";
// build pager
$myPager = new claro_sql_pager($sql, $offset, $resultPerPage);
$results = $myPager->get_result_list();
// display nb results
echo '<p>' . get_lang('Total') . ': ' . $myPager->totalItemCount . '</p>';
// display pager
echo $myPager->disp_pager_tool_bar($_SERVER['PHP_SELF'] . '?language=' . $language);
// display table header
echo "<table class=\"claroTable\" width=\"100%\">\n<thead>\n<tr class=\"headerX\">\n<th>N°</th>\n<th>language</th>\n<th>varName</th>\n<th>varContent</th>\n<th>sourceFile</th>\n</tr>\n</thead>\n<tbody>";
$varContent = "";
$i = $offset;
$color = true;
foreach ($results as $result) {
Exemplo n.º 22
0
    } else {
        ClaroBreadCrumbs::getInstance()->setCurrent(get_lang('Question pool'), Url::Contextualize($_SERVER['PHP_SELF']));
        $pagerUrl = Url::Contextualize($_SERVER['PHP_SELF']);
    }
}
ClaroBreadCrumbs::getInstance()->prepend(get_lang('Exercises'), Url::Contextualize(get_module_url('CLQWZ') . '/exercise.php'));
$nameTools = get_lang('Question pool');
// Tool list
$toolList = array();
if (!is_null($exId)) {
    $toolList[] = array('img' => 'back', 'name' => get_lang('Go back to the exercise'), 'url' => claro_htmlspecialchars(Url::Contextualize('edit_exercise.php?exId=' . $exId)));
}
$toolList[] = array('img' => 'default_new', 'name' => get_lang('New question'), 'url' => claro_htmlspecialchars(Url::Contextualize('edit_question.php?cmd=rqEdit')));
$out = '';
$out .= claro_html_tool_title($nameTools, null, $toolList);
$out .= $dialogBox->render();
//-- filter listbox
$attr['onchange'] = 'filterForm.submit()';
$out .= "\n" . '<form method="get" name="filterForm" action="question_pool.php">' . "\n" . '<input type="hidden" name="exId" value="' . $exId . '" />' . "\n" . claro_form_relay_context() . "\n" . '<p align="right">' . "\n" . '<label for="filter">' . get_lang('Filter') . '&nbsp;:&nbsp;</label>' . "\n" . claro_html_form_select('filter', $filterList, $filter, $attr) . "\n" . '<noscript>' . "\n" . '<input type="submit" value="' . get_lang('Ok') . '" />' . "\n" . '</noscript>' . "\n" . '</p>' . "\n" . '</form>' . "\n\n";
//-- pager
$out .= $myPager->disp_pager_tool_bar($pagerUrl);
/*
 * enable multiple question selection
 */
if (!is_null($exId)) {
    $out .= '<form method="post" name="QCMEncode" action="' . $_SERVER['PHP_SELF'] . '?cmd=recupMultipleQuestions">' . "\n";
    $out .= '<input type="hidden" name="exId" value="' . $exId . '" />' . "\n";
}
//-- list
$display = new ModuleTemplate('CLQWZ', 'question_list.tpl.php');
$display->assign('exId', $exId);
Exemplo n.º 23
0
 /**
  * Method getAjaxRender
  * @access public
  * @return string javascript code to update initial html with ajax call
  * @since 1.0.35
  */
 public function getAjaxRender()
 {
     if ($this->object_change && !$this->is_new_object_after_init) {
         $alert_box = new DialogBox("Ajax Error", "Warning: No Ajax render for object " . get_class($this), '');
         return $alert_box->render(true);
     }
 }
Exemplo n.º 24
0
if ($cmd == 'rqFlush' && $is_allowedToEdit) {
    $msgList = new ChatMsgList($courseId, $groupId);
    if ($msgList->flush()) {
        $dialogBox = new DialogBox();
        $dialogBox->success(get_lang('Chat reset'));
        echo claro_utf8_encode($dialogBox->render());
    }
    return;
}
if ($cmd == 'rqLogs' && $is_allowedToEdit) {
    $msgList = new ChatMsgList($courseId, $groupId);
    $msgList->load(1, $_SESSION['chat_connectionTime']);
    echo claro_utf8_encode($msgList->render());
    return;
}
if ($cmd == 'rqArchive' && $is_allowedToEdit) {
    $msgList = new ChatMsgList($courseId, $groupId);
    $msgList->load();
    if ($chatFilename = $msgList->archive()) {
        $downloadLink = '<a href="' . get_module_url('CLDOC') . '/document.php' . claro_url_relay_context('?') . '">' . basename($chatFilename) . '</a>';
        $dialogBox = new DialogBox();
        $dialogBox->success(get_lang('%chat_filename is now in the document tool. (<em>This file is visible</em>)', array('%chat_filename' => $downloadLink)));
        echo claro_utf8_encode($dialogBox->render());
        return;
    } else {
        $dialogBox = new DialogBox();
        $dialogBox->error(get_lang('Store failed'));
        echo claro_utf8_encode($dialogBox->render());
        return;
    }
}
Exemplo n.º 25
0
if ('show' != $cmd) {
    if ('default' == $anonymityStatus) {
        $info = '<tr valign="top">' . "\n" . '<td>&nbsp;</td>' . '<td><strong>' . get_lang('Contributions to this forum are anonymous by default!<br/>') . get_lang('If you want to sign your post all the same, uncheck the checkbox above the "OK" button') . '</strong></td>' . '</tr>' . '<tr style="height:1px;"><td colspan="2">&nbsp;</td></tr>';
    } elseif ('allowed' == $anonymityStatus) {
        $info = '<tr valign="top">' . "\n" . '<td>&nbsp;</td>' . '<td><strong>' . get_lang('This forum allows anonymous contributions!<br/>') . get_lang('If you do not want to sign your post, check the checkbox above the "OK" button') . '</strong></td>' . '</tr>' . '<tr style="height:1px;"><td colspan="2">&nbsp;</td></tr>';
    }
    if (!empty($info)) {
        $dialogBox->info($info);
    }
}
$out .= $dialogBox->render();
//display edit form if any
if (isset($form)) {
    $formBox = new DialogBox();
    $formBox->form($form->render());
    $out .= $formBox->render() . '<hr />';
}
//display topic review if any
if ($topicSettingList) {
    // get post and use pager
    if (!$viewall) {
        $postLister = new postLister($topicId, $start, get_conf('posts_per_page'));
    } else {
        $postLister = new postLister($topicId, $start, get_total_posts($topicId, 'topic'));
        $incrementViewCount = false;
    }
    // get post and use pager
    $postList = $postLister->get_post_list();
    $totalPosts = $postLister->sqlPager->get_total_item_count();
    $pagerUrl = claro_htmlspecialchars(Url::Contextualize($_SERVER['PHP_SELF'] . '?topic=' . $topicId));
    //increment topic view count if required
Exemplo n.º 26
0
if (isset($_REQUEST['cfrom']) && $_REQUEST['cfrom'] == 'ulist') {
    ClaroBreadCrumbs::getInstance()->prepend(get_lang('User list'), get_path('rootAdminWeb') . 'adminusers.php');
}
ClaroBreadCrumbs::getInstance()->prepend(get_lang('Administration'), get_path('rootAdminWeb'));
$htmlHeadXtra[] = "<script>\n            function confirmation (name)\n            {\n                if (confirm(\"" . clean_str_for_javascript(get_lang('Are you sure to delete')) . " \"+ name + \"? \"))\n                    {return true;}\n                else\n                    {return false;}\n            }\n            </script>";
$user_data['is_admin'] = user_is_admin($userId);
$cmd_menu[] = '<a class="claroCmd" href="../auth/courses.php' . '?cmd=rqReg' . '&amp;uidToEdit=' . $userId . '&amp;fromAdmin=settings' . '&amp;category=" >' . '<img src="' . get_icon_url('enroll') . '" />' . get_lang('Enrol to a new course') . '</a>';
$cmd_menu[] = '<a class="claroCmd" href="../auth/lostPassword.php' . '?Femail=' . urlencode($user_data['email']) . '&amp;searchPassword=1" >' . '<img src="' . get_icon_url('mail_close') . '" />' . get_lang('Send account information to user by email') . '</a>';
$cmd_menu[] = '<a class="claroCmd" href="adminuserdeleted.php' . '?uidToEdit=' . $userId . '&amp;cmd=rqDelete" ' . ' id="delete" >' . '<img src="' . get_icon_url('deluser') . '" /> ' . get_lang('Delete user') . '</a>';
$cmd_menu[] = '<a class="claroCmd" href="../messaging/sendmessage.php' . '?cmd=rqMessageToUser' . '&amp;userId=' . $userId . '">' . get_lang('Send a message to the user') . '</a>';
if (isset($_REQUEST['cfrom']) && $_REQUEST['cfrom'] == 'ulist') {
    $cmd_menu[] = '<a class="claroCmd" href="adminusers.php" >' . get_lang('Back to user list') . '</a>';
}
/**
 * DISPLAY
 */
$out = '';
// Display tool title
$out .= claro_html_tool_title($nameTools) . $dialogBox->render() . '<p>' . claro_html_menu_horizontal($cmd_menu) . '</p>' . user_html_form_admin_user_profile($user_data);
if (!is_null($dgExtra)) {
    $out .= $dgExtra->render();
}
$out .= '<script type="text/javascript">
    $(document).ready(function(){
        $("#delete").click(function(){
            return confirmation("' . $user_data['firstname'] . " " . $user_data['lastname'] . '");
        }).attr("href","adminuserdeleted.php?uidToEdit=' . $userId . '&cmd=exDelete");
    });
</script>';
$claroline->display->body->appendContent($out);
echo $claroline->display->render();
Exemplo n.º 27
0
if (isset($_REQUEST['cmd'])) {
    $cmd = $_REQUEST['cmd'];
} else {
    $cmd = '';
}
/*=====================================================================
  Display Section
 =====================================================================*/
ClaroBreadCrumbs::getInstance()->prepend(get_lang('Administration'), get_path('rootAdminWeb'));
$noQUERY_STRING = true;
if ($display == DISP_REGISTRATION_FORM) {
    $dialogBox->info('Cette op&eacute;ration synchronise les comptes utilistateurs Claroline avec le LDAP du LCS');
}
$out = '';
// Display title
$out .= claro_html_tool_title(array('mainTitle' => $nameTools)) . $dialogBox->render();
if ($display == DISP_REGISTRATION_SUCCEED) {
    //$out .= claro_html_list($newUserMenu);
} else {
    //  if registration failed display error message
    $out .= '<style>
  .message {background-color: #E6E6E6;
    color: #339933;font-size: 0.9 em;}
  </style>';
    $out .= 'La synchronisation : <br />
    <ul>
    <li> ajoute les &#233;l&#232;ves pr&#233;sents dans le ldap mais absents de la plateforme et les affecte &#224; leur classe : <span id="cr0" class="message"></span></li>
    <li> ajoute les profs pr&#233;sents dans le ldap mais absents de la plateforme et les affecte &#224; la classe Profs : <span id="cr1"class="message"></span></li>
    <li> supprime les &#233;l&#232;ves qui ne sont plus dans l\'annuaire : <span id="cr2"class="message"></span></li>
    <li> supprime les profs qui ne sont plus dans l\'annuaire : <span id="cr3"class="message"></span></li>
    <li> d&#233;clare "orphelins" les cours des profs supprim&#233;s : <span id="cr4"class="message"></span></li>
Exemplo n.º 28
0
function disp_search_box()
{
    if (isset($_REQUEST['cmd']) && $_REQUEST['cmd'] == 'rqSearch') {
        $dialogBox = new DialogBox();
        $dialogBox->form('<form action="' . claro_htmlspecialchars(get_module_url('CLFRM') . '/viewsearch.php') . '" method="post">' . claro_form_relay_context() . get_lang('Search') . ' : <br />' . '<input type="text" name="searchPattern" /><br />' . '<input type="submit" value="' . get_lang('Ok') . '" />&nbsp; ' . claro_html_button(claro_htmlspecialchars(Url::Contextualize($_SERVER['PHP_SELF'])), get_lang('Cancel')) . '</form>');
        return $dialogBox->render();
    } else {
        return '';
    }
}
Exemplo n.º 29
0
        // Display request course creator status
        if (!claro_is_allowed_to_create_course() && get_conf('can_request_course_creator_status')) {
            $cmdList[] = array('name' => get_lang('Request course creation status'), 'url' => claro_htmlspecialchars(Url::Contextualize($_SERVER['PHP_SELF'] . '?cmd=reqCCstatus')));
        }
        // Display user revoquation
        if (get_conf('can_request_revoquation')) {
            $cmdList[] = array('img' => 'delete', 'name' => get_lang('Delete my account'), 'url' => claro_htmlspecialchars(Url::Contextualize($_SERVER['PHP_SELF'] . '?cmd=reqRevoquation')));
        }
        if (claro_is_platform_admin()) {
            $dialogBox->info(get_lang('As a platform administrator, you can edit any field you want, even if this field isn\'t editable for other users.<br />You can check the list of editable fields in your platform\'s configuration.'));
        }
        break;
}
// Display
$out = '';
$out .= claro_html_tool_title($nameTools, null, $cmdList) . $dialogBox->render();
switch ($display) {
    case DISP_PROFILE_FORM:
        // Display form profile
        if (trim($profileText) != '') {
            $out .= '<div class="info profileEdit">' . $profileText . '</div>';
        }
        $out .= user_html_form($userId);
        break;
    case DISP_MOREINFO_FORM:
        // Display request course creator form
        $out .= '<form action="' . $_SERVER['PHP_SELF'] . '" method="post">' . "\n" . '<input type="hidden" name="cmd" value="exMoreInfo" />' . "\n" . '<table>' . "\n";
        foreach ($extraInfoDefList as $extraInfoDef) {
            $currentValue = array_key_exists($extraInfoDef['propertyId'], $userInfo) ? $userInfo[$extraInfoDef['propertyId']] : $extraInfoDef['defaultValue'];
            $requirement = (bool) (true == $extraInfoDef['required']);
            $labelExtraInfoDef = $extraInfoDef['label'];
Exemplo n.º 30
0
function getAlertVersiobObject($page)
{
    $alert_version_obj = null;
    if (extension_loaded('soap')) {
        $wsp_version = isNewWspVersion();
        $browscap_version = isNewBrowscapVersion();
        if ($wsp_version != false || $browscap_version != false) {
            $alert_version_obj = new Object();
            $alert_version_obj->setClass("warning");
            if ($wsp_version != false) {
                if (extension_loaded('zip')) {
                    $dialog_update_wsp = new DialogBox(__(UPDATE_FRAMEWORK), new Url("wsp-admin/update/update-confirm.call?update=update-wsp&text=WebSite-PHP"));
                    $dialog_update_wsp->displayFormURL();
                    $alert_version_obj->add(__(NEW_WSP_VERSION, $dialog_update_wsp->render(), $wsp_version), "<br/>");
                } else {
                    $alert_version_obj->add(__(NEW_WSP_VERSION, "location.href='http://www.website-php.com/download/website-php-update.zip';", $wsp_version));
                    $alert_version_obj->add(" ", __(NEW_WSP_VERSION_INSTALL_PHP_ZIP), "<br/>");
                }
            }
            if ($browscap_version != false) {
                $dialog_update_browscap = new DialogBox(__(UPDATE_FRAMEWORK), new Url("wsp-admin/update/update-confirm.call?update=update-browscap&text=Browscap.ini"));
                $dialog_update_browscap->displayFormURL()->modal();
                $alert_version_obj->add(__(NEW_BROWSCAP_VERSION, $dialog_update_browscap->render(), $browscap_version));
            }
        }
    } else {
        $alert_version_obj = new Object();
        $alert_version_obj->setClass("warning");
        $soap_alert = new Label(__(INSTALL_PHP_SOAP));
        $alert_version_obj->add($soap_alert);
    }
    return $alert_version_obj;
}