Пример #1
0
 /**
  * return the content
  *
  * @param coursecode $key
  * @param array $context
  * @return string : html content
  */
 public static function get_content($key, $context = null, $right = null)
 {
     $textZoneFile = claro_text_zone::get_textzone_file_path($key, $context, $right);
     if (file_exists($textZoneFile)) {
         $content = file_get_contents($textZoneFile);
     } else {
         $content = '';
     }
     return $content;
 }
Пример #2
0
    $userInfo = get_user_property_list(claro_get_current_user_id());
} elseif ('exMoreInfo' == $cmd && 0 < count($extraInfoDefList)) {
    if (array_key_exists('extraInfoList', $_REQUEST)) {
        foreach ($_REQUEST['extraInfoList'] as $extraInfoName => $extraInfoValue) {
            set_user_property(claro_get_current_user_id(), $extraInfoName, $extraInfoValue, 'userExtraInfo');
        }
    }
}
// Initialise
$userData['userExtraInfoList'] = get_user_property_list(claro_get_current_user_id());
// Command list
$cmdList = array();
switch ($display) {
    case DISP_PROFILE_FORM:
        // Display user tracking link
        $profileText = claro_text_zone::get_content('textzone_edit_profile_form');
        if (get_conf('is_trackingEnabled')) {
            // Display user tracking link
            $cmdList[] = array('img' => 'statistics', 'name' => get_lang('View my statistics'), 'url' => claro_htmlspecialchars(Url::Contextualize(get_conf('urlAppend') . '/claroline/tracking/userReport.php?userId=' . claro_get_current_user_id())));
        }
        // 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.'));
        }
Пример #3
0
 /*
  * Technical note: 'cmd=exUpload' is added into the 'action'
  * attributes of the form, rather than simply put in a post
  * hidden input. That way, this parameter is concatenated with
  * the URL, and it guarantees than it will be received by the
  * server. The reason of this trick, is because, sometimes,
  * when file upload fails, no form data are received at all by
  * the server. For example when the size of the sent file is so
  * huge that its reception exceeds the max execution time
  * allowed for the script. When no 'cmd' argument are sent it is
  * impossible to manage this error gracefully. That's why,
  * exceptionally, we pass 'cmd' in the 'action' attribute of
  * the form.
  */
 $dialogBox->title(get_lang('Upload file'));
 $agreementText = claro_text_zone::get_content('textzone_upload_file_disclaimer');
 if (!empty($agreementText)) {
     $dialogBox->info($agreementText);
 }
 $form = '<form action="' . claro_htmlspecialchars($_SERVER['PHP_SELF']) . '" method="post" enctype="multipart/form-data">' . '<fieldset>' . claro_form_relay_context() . '<input type="hidden" name="claroFormId" value="' . uniqid('') . '" />' . "\n" . '<input type="hidden" name="cmd" value="exUpload" />' . "\n" . '<input type="hidden" name="cwd" value="' . claro_htmlspecialchars($cwd) . '" />' . "\n" . '<dl>' . '<dt><label for="userFile">' . get_lang('File') . '&nbsp;<span class="required">*</span></label>' . '</dt>' . "\n" . '<dd>' . '<input type="file" id="userFile" name="userFile" />' . "\n" . '<p class="notice">' . get_lang("Max file size") . ' : ' . format_file_size($maxUploadSize) . '</p>' . "\n" . '</dd>' . '<dt>' . get_lang("Disk space available") . '</dt>' . '<dd>' . claro_html_progress_bar($spaceAlreadyOccupied / $maxFilledSpace * 100, 1) . ' <span class="notice">' . format_file_size($remainingDiskSpace) . '</span>' . '</dd>' . "\n";
 if ($is_allowedToUnzip) {
     // uncompress
     $form .= '<dt>' . "\n" . '<label for="uncompress"><img src="' . get_icon_url('mime/package-x-generic') . '" alt="" /> ' . get_lang('uncompress zipped (.zip) file on the server') . '</label>' . "\n" . '</dt>' . '<dd>' . '<input type="checkbox" id="uncompress" name="uncompress" value="1" />' . '</dd>' . "\n";
 }
 if ($courseContext) {
     if (!isset($oldComment)) {
         $oldComment = "";
     }
     // comment
     $form .= '<dt>' . "\n" . '<label for="comment">' . get_lang('Comment') . '</label>' . '</dt>' . "\n" . '<dd>' . '<textarea rows=2 cols=50 id="comment" name="comment">' . claro_htmlspecialchars($oldComment) . '</textarea>' . "\n" . '</dd>' . "\n";
 }
Пример #4
0
if ($currentUserId != claro_get_current_user_id()) {
    $userData = user_get_properties($currentUserId);
    if ($userData === false) {
        claro_die(get_lang("User not found"));
    } else {
        $title = get_lang('Messages of %firstName %lastName', array('%firstName' => claro_htmlspecialchars($userData['firstname']), '%lastName' => claro_htmlspecialchars($userData['lastname'])));
    }
} else {
    $title = get_lang('My messages');
}
$linkPage = $_SERVER['PHP_SELF'];
$acceptedValues = array('inbox', 'outbox', 'trashbox');
if (!isset($_REQUEST['box']) || !in_array($_REQUEST['box'], $acceptedValues)) {
    $_REQUEST['box'] = "inbox";
}
$link_arg['box'] = $_REQUEST['box'];
require_once dirname(__FILE__) . '/lib/tools.lib.php';
$content = "";
if ($link_arg['box'] == "inbox") {
    include dirname(__FILE__) . '/inboxcontroler.inc.php';
} elseif ($link_arg['box'] == "outbox") {
    include dirname(__FILE__) . '/outboxcontroler.inc.php';
} else {
    include dirname(__FILE__) . '/trashboxcontroler.inc.php';
}
$claroline->display->banner->breadcrumbs->append($title, $_SERVER['PHP_SELF'] . '?box=' . $link_arg['box']);
$claroline->display->body->appendContent(claro_html_tool_title($title));
$claroline->display->body->appendContent(claro_text_zone::get_block('textzone_messaging_top', claro_is_platform_admin()));
$claroline->display->body->appendContent($content);
// ------------ display ----------------------
echo $claroline->display->render();
Пример #5
0
                if ('MISSING_DATA' == claro_failure::get_last_failure()) {
                    $messageList[] = get_lang('Data missing');
                } else {
                    $messageList[] = get_lang('Unknown error');
                }
            }
        } else {
            // User validate form return error messages
            $error = true;
        }
    }
    if ('registration' == $cmd && $error == false) {
        $display = DISP_REGISTRATION_SUCCEED;
    } elseif ('agree' == $cmd || !get_conf('show_agreement_panel') || 'registration' == $cmd || '' == $agreementText) {
        $display = DISP_REGISTRATION_FORM;
        $subscriptionText = claro_text_zone::get_content('textzone_inscription_form');
    } else {
        $display = DISP_REGISTRATION_AGREEMENT;
    }
} elseif (!get_conf('show_agreement_panel')) {
    // This  section is not use actually.
    // it's only when selfReg =false so  It's need another textZoneContent
    $display = DISP_REGISTRATION_AGREEMENT;
} else {
    $display = DISP_REGISTRATION_NOT_ALLOWED;
}
/*= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
Display Section
= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = */
ClaroBreadCrumbs::getInstance()->append(get_lang('Create user account'), 'inscription.php');
$out = '';
Пример #6
0
/**
 * Return the editable textzone for a course where subscript are locked.
 *
 * @param string        $course_id
 * @return string       html content
 */
function get_locked_course_by_key_explanation($course_id = null)
{
    $courseExplanation = claro_text_zone::get_content('course_subscription_locked_by_key', array(CLARO_CONTEXT_COURSE => $course_id));
    if (!empty($courseExplanation)) {
        return $courseExplanation;
    } else {
        $globalExplanation = claro_text_zone::get_content('course_subscription_locked_by_key');
        if (!empty($globalExplanation)) {
            return $globalExplanation;
        } else {
            return get_lang('Subscription not allowed');
        }
    }
}