/**
 * Получить блок по текущему URL
 *
 * @param string $name
 * @return string
 */
function get_url_block($name = null)
{
    $url = sfContext::getInstance()->getRequest()->getPathInfo();
    if ($name) {
        $url = sprintf('%s:%s', $name, $url);
    }
    return get_block($url);
}
Example #2
0
 /**
  * notify by email the user of the reception of a message
  *
  * @param array of int: $userDataList user identificatin list
  * @param MessageToSend $message message envoy�
  * @param int $messageId identification of the message
  * 
  */
 public function notify($userDataList, $message, $messageId)
 {
     if (!get_conf('mailNotification', TRUE)) {
         return;
     }
     // sender name and email
     if ($message->getSender() == 0) {
         $userData = array('mail' => get_conf('no_reply_mail') ? get_conf('no_reply_mail') : get_conf('administrator_email'), 'firstName' => get_lang('Message from %platformName', array('%platformName' => get_conf('siteName'))), 'lastName' => '');
     } else {
         $userData = claro_get_current_user_data();
     }
     //************************************ IS MANAGER
     $stringManager = false;
     $courseManagers = claro_get_course_manager_id($message->getCourseCode());
     $nbrOfManagers = count($courseManagers);
     for ($countManager = 0; $countManager < $nbrOfManagers; $countManager++) {
         if ($message->getSender() == $courseManagers[$countManager]) {
             $courseData = claro_get_course_data($message->getCourseCode());
             $stringManager = get_block('Course manager of %course%(%courseCode%)', array('%course%' => $courseData['name'], '%courseCode%' => $courseData['officialCode']));
         }
     }
     //---------------------- email subject
     $emailSubject = '[' . get_conf('siteName');
     if (!is_null($message->getCourseCode())) {
         $courseData = claro_get_course_data($message->getCourseCode());
         if ($courseData) {
             $emailSubject .= ' - ' . $courseData['officialCode'];
         }
     }
     $emailSubject .= '] ' . $message->getSubject();
     //------------------------------subject
     /* $altBody = get_lang('If you can\'t read this message go to: ') . rtrim( get_path('rootWeb'), '/' ) . '/claroline/messaging/readmessage.php?messageId=' . $messageId . '&type=received' . "\n\n"
        . '-- '
        . claro_get_current_user_data('lastName') . " " . claro_get_current_user_data('firstName') . "\n"
        . $stringManager
        . "\n\n" . get_conf('siteName') ." <" . get_conf('rootWeb') . '>' . "\n"
        . '   ' . get_lang('Administrator') . ' : ' . get_conf('administrator_name') . ' <' . get_conf('administrator_email') . '>' . "\n"
        ; */
     //-------------------------BODY
     $msgContent = claro_parse_user_text($message->getMessage());
     $urlAppend = get_path('url');
     if (!empty($urlAppend)) {
         $msgContent = preg_replace('!href="' . get_path('url') . '!', 'href="' . rtrim(get_path('rootWeb'), '/') . '/', $msgContent);
         $msgContent = preg_replace('!\\>' . get_path('url') . '!', '>' . get_path('rootWeb'), $msgContent);
     } else {
         $msgContent = preg_replace('!href="/!', 'href="' . rtrim(get_path('rootWeb'), '/') . '/', $msgContent);
     }
     $emailBody = "<html><head></head><body>" . $msgContent . '<br /><br />' . '-- <br />' . get_lang('%firstName %lastName', array('%firstName' => $userData['firstName'], '%lastName' => $userData['lastName'])) . "<br />" . $stringManager . '<br /><br /><a href="' . get_conf('rootWeb') . '">' . get_conf('siteName') . '</a><br />' . '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;' . get_lang('Administrator') . ': <a href="mailto:' . get_conf('administrator_email') . '">' . get_conf('administrator_name') . '</a><br />' . '</body></html>';
     //******************************** END BODY
     //******************************************
     if (empty($userData['mail']) || !is_well_formed_email_address($userData['mail'])) {
         // do not send email for a user with no mail address
         pushClaroMessage('Mail Notification Failed : User has no email or an invalid one : ' . var_export($userData, true) . '!');
         return claro_failure::set_failure(get_lang("Mail Notification Failed : You don't have any email address defined in your user profile or the defined email address is not valid."));
     }
     self::emailNotification($userDataList, $emailBody, $emailSubject, $userData['mail'], get_lang('%firstName %lastName', array('%firstName' => $userData['firstName'], '%lastName' => $userData['lastName'])));
 }
Example #3
0
function get_all_blocks($content, $start_pattern, $end_pattern, $include_tags = False)
{
    $result = '';
    while (($block = get_block($content, $start_pattern, $end_pattern, $include_tags)) == True) {
        $content = str_replace($block, '', $content);
        $result .= $block;
    }
    return $result;
}
Example #4
0
function get_menu($pos)
{
    global $TABLE_PREFIX, $CURUSER, $FORUMLINK, $CACHE_DURATION, $language;
    $blocks = get_result('SELECT title, content, cache FROM ' . $TABLE_PREFIX . 'blocks WHERE position="' . $pos . '" AND status=1 AND ' . $CURUSER['id_level'] . '>=minclassview  AND ' . $CURUSER['id_level'] . '<=maxclassview ' . ($FORUMLINK == '' || $FORUMLINK == 'internal' || substr($FORUMLINK, 0, 3) == 'smf' || $FORUMLINK == 'ipb' ? '' : ' AND content!="forum"') . ' ORDER BY sortid', true, $CACHE_DURATION);
    $return = '';
    foreach ($blocks as $entry) {
        $return .= get_block($language[$entry['title']], 'justify', $entry['content'], $entry['cache'] == 'yes');
    }
    return $return;
}
Example #5
0
function get()
{
    list($name, $opt1, $opt2) = func_get_args();
    switch ($name) {
        case 'path':
            echo TEMPL_PATH;
            return;
        case 'name':
            echo NAME;
            return;
        case 'slogan':
            echo SLOGAN;
            return;
        case 'copy':
            echo COPYRIGHT;
            return;
        case 'generate':
            echo GENERATE;
            return;
        case 'title':
            echo TITLE;
            return;
        case 'menu':
            echo MENU;
            return;
        case 'content':
            echo CONTENT;
            return;
        case 'first_page':
            echo href(FIRST_PAGE);
            return;
        case 'block':
            get_block($opt1, $opt2);
            return;
    }
}
Example #6
0
             $userAccountList[] = array('firstname' => $user['firstName'], 'lastname' => $user['lastName'], 'username' => $user['loginName'], 'password' => $user['password']);
         } else {
             $extAuthPasswordCount++;
         }
     }
     if ($passwordFound) {
         /*
          * Prepare the email message wich has to be send to the user
          */
         // mail subject
         $emailSubject = get_lang('Login request') . ' ' . get_conf('siteName');
         $blockLoginInfo = '';
         foreach ($userAccountList as $userAccount) {
             $blockLoginInfo .= get_block('blockLoginInfo', array('%firstname' => $userAccount['firstname'], '%lastname' => $userAccount['lastname'], '%username' => $userAccount['username'], '%password' => $userAccount['password']));
         }
         $emailBody = get_block('blockLoginRequest', array('%siteName' => get_conf('siteName'), '%rootWeb' => get_path('rootWeb'), '%loginInfo' => $blockLoginInfo));
         // send message
         if (claro_mail_user($userList[0]['uid'], $emailBody, $emailSubject)) {
             $dialogBox->success(get_lang('Your password has been emailed to') . ' : ' . $emailTo);
         } else {
             $dialogBox->error(get_lang('The system is unable to send you an e-mail.') . '<br />' . get_lang('Please contact') . ' : ' . '<a href="mailto:' . get_conf('administrator_email') . '?BODY=' . $emailTo . '">' . get_lang('Platform administrator') . '</a>');
         }
     }
 } else {
     $dialogBox->error(get_lang('There is no user account with this email address.'));
 }
 if ($extAuthPasswordCount > 0) {
     if ($extAuthPasswordCount == count($userList)) {
         $dialogBox->warning(get_lang('Your password(s) is (are) recorded in an external authentication system outside the platform.'));
     } else {
         $dialogBox->warning(get_lang('Passwords of some of your user account(s) are recorded an in external authentication system outside the platform.'));
Example #7
0
<?php

// $Id: tiplistinit.inc.php 13708 2011-10-19 10:46:34Z abourguignon $
if (count(get_included_files()) == 1) {
    die('---');
}
/**
 * CLAROLINE
 *
 * @version     $Revision: 13708 $
 * @copyright   (c) 2001-2011, Universite catholique de Louvain (UCL)
 * @author      Claroline Team <*****@*****.**>
 * @license     http://www.gnu.org/copyleft/gpl.html
 *              GNU GENERAL PUBLIC LICENSE version 2 or later
 */
unset($tipList);
$tipList[] = array('title' => get_block('blockCourseDescriptionDescription'), 'isEditable' => false, 'question' => get_block('blockCourseDescriptionDescriptionComment1'), 'information' => get_block('blockCourseDescriptionDescriptionComment2'));
$tipList[] = array('title' => get_block('blockCourseDescriptionQualificationsAndGoals'), 'isEditable' => false, 'question' => get_block('blockCourseDescriptionQualificationsAndGoalsComment1'), 'information' => get_block('blockCourseDescriptionQualificationsAndGoalsComment2'));
$tipList[] = array('title' => get_block('blockCourseDescriptionCourseContent'), 'isEditable' => false, 'question' => get_block('blockCourseDescriptionCourseContentComment1'), 'information' => get_block('blockCourseDescriptionCourseContentComment2'));
$tipList[] = array('title' => get_block('blockCourseDescriptionTeachingTrainingActivities'), 'isEditable' => false, 'question' => get_block('blockCourseDescriptionTeachingTrainingActivitiesComment1'), 'information' => get_block('blockCourseDescriptionTeachingTrainingActivitiesComment2'));
$tipList[] = array('title' => get_block('blockCourseDescriptionSupports'), 'isEditable' => false, 'question' => get_block('blockCourseDescriptionSupportsComment1'), 'information' => get_block('blockCourseDescriptionSupportsComment2'));
$tipList[] = array('title' => get_block('blockCourseDescriptionHumanAndPhysicalRessources'), 'isEditable' => false, 'question' => get_block('blockCourseDescriptionHumanAndPhysicalResourcesComment1'), 'information' => get_block('blockCourseDescriptionHumanAndPhysicalResourcesComment2'));
$tipList[] = array('title' => get_block('blockCourseDescriptionMethodsOfEvaluation'), 'isEditable' => false, 'question' => '', 'information' => get_block('blockCourseDescriptionMethodsOfEvaluationComment1'));
Example #8
0
/**
 * Send enroll to course succeded email to user
 * @author Mathieu Laurent <*****@*****.**>
 *
 * @param $userId integer
 * @param $data array
 * @return boolean
 */
function user_send_enroll_to_course_mail($userId, $data, $course = null)
{
    require_once dirname(__FILE__) . '/../../messaging/lib/message/messagetosend.lib.php';
    require_once dirname(__FILE__) . '/../../messaging/lib/recipient/singleuserrecipient.lib.php';
    $courseData = claro_get_course_data($course);
    $subject = get_lang('Your registration');
    $body = get_block('blockCourseSubscriptionNotification', array('%firstname' => $data['firstname'], '%lastname' => $data['lastname'], '%courseCode' => $courseData['officialCode'], '%courseName' => $courseData['name'], '%coursePath' => get_path('rootWeb') . 'claroline/course/index.php?cid=' . $courseData['sysCode'], '%siteName' => get_conf('siteName'), '%rootWeb' => get_path('rootWeb'), '%administratorName' => get_conf('administrator_name'), '%administratorPhone' => get_conf('administrator_phone'), '%administratorEmail' => get_conf('administrator_email')));
    $message = new MessageToSend(claro_get_current_user_id(), $subject, $body);
    $message->setCourse($courseData['sysCode']);
    $recipient = new SingleUserRecipient($userId);
    //$message->sendTo($recipient);
    $recipient->sendMessage($message);
    return true;
}
Example #9
0
<!-- $Id: help.tpl.php 13552 2011-09-07 12:55:36Z zefredz $ -->

<table width="100%" border="0" cellpadding="1" cellspacing="1">
<tr>
  <td align="left" valign="top">
    <h4><?php 
echo get_lang('%module% help', array('%module%' => ucfirst($this->module)));
?>
</h4>
  </td>
</tr>
<tr>
  <td>
    <?php 
echo get_block($this->block);
?>
 
  </td>
</tr>
</table>
Example #10
0
<!-- $Id: help_user.tpl.php 12676 2010-10-20 14:59:33Z abourguignon $ -->

<table width="100%" border="0" cellpadding="1" cellspacing="1">
<tr>
  <td align="left" valign="top">
    <?php 
echo '<h4>' . get_lang('Users help') . '</h4>';
?>
  </td>
</tr>
<tr>
  <td>
    <?php 
echo get_block('blockUsersHelp');
?>
  </td>
</tr>
</table>
Example #11
0
$sql = "SELECT `comment`, `startAsset_id`, `contentType`\n        FROM `" . $TABLEMODULE . "`\n        WHERE `module_id` = " . (int) $_SESSION['module_id'];
$module = claro_sql_query_get_single_row($sql);
if (empty($module['comment']) || $module['comment'] == get_block('blockDefaultModuleComment')) {
    $noModuleComment = true;
} else {
    $noModuleComment = false;
}
if ($module['startAsset_id'] == 0) {
    $noStartAsset = true;
} else {
    $noStartAsset = false;
}
// check if there is a specific comment for this module in this path
$sql = "SELECT `specificComment`\n        FROM `" . $TABLELEARNPATHMODULE . "`\n        WHERE `module_id` = " . (int) $_SESSION['module_id'];
$learnpath_module = claro_sql_query_get_single_row($sql);
if (empty($learnpath_module['specificComment']) || $learnpath_module['specificComment'] == get_block('blockDefaultModuleAddedComment')) {
    $noModuleSpecificComment = true;
} else {
    $noModuleSpecificComment = false;
}
// check in DB if user has already browsed this module
$sql = "SELECT `contentType`,\n                `total_time`,\n                `session_time`,\n                `scoreMax`,\n                `raw`,\n                `lesson_status`\n        FROM `" . $TABLEUSERMODULEPROGRESS . "` AS UMP,\n             `" . $TABLELEARNPATHMODULE . "` AS LPM,\n             `" . $TABLEMODULE . "` AS M\n        WHERE UMP.`user_id` = '" . (int) claro_get_current_user_id() . "'\n          AND UMP.`learnPath_module_id` = LPM.`learnPath_module_id`\n          AND LPM.`learnPath_id` = " . (int) $_SESSION['path_id'] . "\n          AND LPM.`module_id` = " . (int) $_SESSION['module_id'] . "\n          AND LPM.`module_id` = M.`module_id`\n             ";
$resultBrowsed = claro_sql_query_get_single_row($sql);
// redirect user to the path browser if needed
if (!$is_allowedToEdit && (!is_array($resultBrowsed) || !$resultBrowsed || count($resultBrowsed) <= 0) && $noModuleComment && $noModuleSpecificComment && !$noStartAsset) {
    header("Location: " . Url::Contextualize("./navigation/viewer.php"));
    exit;
}
// Back button
if (!empty($_SESSION['returnToTrackingUserId'])) {
    $pathBack = Url::Contextualize(get_path('clarolineRepositoryWeb') . 'tracking/lp_modules_details.php?' . 'uInfo=' . (int) $_SESSION['returnToTrackingUserId'] . '&path_id=' . (int) $_SESSION['path_id']);
Example #12
0
<!-- $Id: help_document.tpl.php 12676 2010-10-20 14:59:33Z abourguignon $ -->

<table width="100%" border="0" cellpadding="1" cellspacing="1">
<tr>
  <td align="left" valign="top">
    <?php 
echo '<h4>' . get_lang('Documents help') . '</h4>';
?>
  </td>
</tr>
<tr>
  <td>
    <?php 
echo get_block('blockDocumentsHelp');
?>
  </td>
</tr>
</table>
Example #13
0
function extraire_module_sumary($baliza)
{
    if (strpos($baliza, '</block>')) {
        $baliza = str_replace("<br class='autobr' />", "", $baliza);
        $block_list = explode('</block>', $baliza);
        $return = "";
        for ($i = 0; $i < count($block_list) - 1; $i++) {
            $block = get_block($block_list[$i]);
            // $return .= '('.$i.') '.$block['class'];
            $modules = get_modules($block['content']);
            // $return .= ' - num modules:'.count($modules).' ';
            $n_audio = 0;
            $n_image = 0;
            $n_text = 0;
            $n_link = 0;
            $t = "\t\t\t\t\t\t";
            for ($u = 0; $u < count($modules); $u++) {
                // $return .= $modules[$u]['class'].' ';
                switch ($modules[$u]['class']) {
                    case "text":
                        $return .= "<p>" . $modules[$u]['content'] . "</p>\n";
                        $n_text++;
                        break;
                }
            }
        }
        return $return;
    } else {
        return $baliza;
    }
}
Example #14
0
 function get_block($file, $height = false)
 {
     return get_block($file);
 }
Example #15
0
 $out .= '<td>';
 if ($module['contentType'] == CTLABEL_) {
     $out .= "&nbsp;";
 } elseif ($module['lock'] == 'OPEN') {
     $out .= "<a href=\"" . claro_htmlspecialchars(Url::Contextualize($_SERVER['PHP_SELF'] . "?cmd=mkBlock&cmdid=" . $module['learnPath_module_id'])) . "\">" . "<img src=\"" . get_icon_url('unblock') . "\" alt=\"" . get_lang('Block') . "\" />" . "</a>";
 } elseif ($module['lock'] == 'CLOSE') {
     $out .= "<a href=\"" . claro_htmlspecialchars(Url::Contextualize($_SERVER['PHP_SELF'] . "?cmd=mkUnblock&cmdid=" . $module['learnPath_module_id'])) . "\">" . "<img src=\"" . get_icon_url('block') . "\" alt=\"" . get_lang('Unblock') . "\" />" . "</a>";
 }
 $out .= "</td>";
 // VISIBILITY
 $out .= "<td>";
 if ($module['visibility'] == 'HIDE') {
     $out .= "<a href=\"" . claro_htmlspecialchars(Url::Contextualize($_SERVER['PHP_SELF'] . "?cmd=mkVisibl&cmdid=" . $module['module_id'])) . "\">" . "<img src=\"" . get_icon_url('invisible') . "\" alt=\"" . get_lang('Make visible') . "\" />" . "</a>";
 } else {
     if ($module['lock'] == 'CLOSE') {
         $onclick = "onclick=\"return confirmation('" . clean_str_for_javascript(get_block('blockConfirmBlockingModuleMadeInvisible')) . "');\"";
     } else {
         $onclick = "";
     }
     $out .= "<a href=\"" . claro_htmlspecialchars(Url::Contextualize($_SERVER['PHP_SELF'] . "?cmd=mkInvisibl&cmdid=" . $module['module_id'])) . "\" " . $onclick . " >" . "<img src=\"" . get_icon_url('visible') . "\" alt=\"" . get_lang('Make invisible') . "\" />" . "</a>";
 }
 $out .= "</td>";
 // ORDER COMMANDS
 // DISPLAY CATEGORY MOVE COMMAND
 $out .= "<td>" . "<a href=\"" . claro_htmlspecialchars(Url::Contextualize($_SERVER['PHP_SELF'] . "?cmd=changePos&cmdid=" . $module['learnPath_module_id'])) . "\">" . "<img src=\"" . get_icon_url('move') . "\" alt=\"" . get_lang('Move') . "\" />" . "</a>" . "</td>";
 // DISPLAY MOVE UP COMMAND only if it is not the top learning path
 if ($module['up']) {
     $out .= "<td>" . "<a href=\"" . claro_htmlspecialchars(Url::Contextualize($_SERVER['PHP_SELF'] . "?cmd=moveUp&cmdid=" . $module['learnPath_module_id'])) . "\">" . "<img src=\"" . get_icon_url('move_up') . "\" alt=\"" . get_lang('Move up') . "\" />" . "</a>" . "</td>";
 } else {
     $out .= "<td>&nbsp;</td>";
 }
Example #16
0
 * @license     http://www.gnu.org/copyleft/gpl.html (GPL) GENERAL PUBLIC LICENSE
 *              This program is under the terms of the GENERAL PUBLIC LICENSE (GPL)
 *              as published by the FREE SOFTWARE FOUNDATION. The GPL is available
 *              through the world-wide-web at http://www.gnu.org/copyleft/gpl.html
 * @author      Frederic Minne <*****@*****.**>
 * @package     Wiki
 */
require '../inc/claro_init_global.inc.php';
$nameTools = get_lang("Wiki");
$hide_banner = TRUE;
$htmlHeadXtra[] = '<style type="text/css">
        dt{font-weight:bold;margin-top:5px;}
    </style>';
$out = '';
$help = isset($_REQUEST['help']) ? $_REQUEST['help'] : 'syntax';
//$out .= '<center><a href="#" onclick="window.close()">'.get_lang("Close window").'</a></center>' . "\n";
switch ($help) {
    case 'syntax':
        $out .= get_block('blockWikiHelpSyntaxContent');
        break;
    case 'admin':
        $out .= get_block('blockWikiHelpAdminContent');
        break;
    default:
        $out .= '<center><h1>' . get_lang('Wrong parameters') . '</h1></center>';
}
//$out .= '<center><a href="#" onclick="window.close()">'.get_lang("Close window").'</a></center>' . "\n";
$hide_footer = true;
$claroline->setDisplayType(Claroline::POPUP);
$claroline->display->body->appendContent($out);
echo $claroline->display->render();
Example #17
0
    }
    if ('edit' == $action || 'diff' == $action) {
        $helpUrl = get_help_page_url('blockWikiHelpSyntaxContent', 'CLWIKI');
    }
}
switch ($action) {
    case 'conflict':
        if ('__MainPage__' === $title) {
            $displaytitle = get_lang("Main page");
        } else {
            $displaytitle = $title;
        }
        $out .= '<div class="wikiTitle">' . "\n";
        $out .= '<h1>' . $displaytitle . ' : ' . get_lang("Edit conflict") . '</h1>' . "\n";
        $out .= '</div>' . "\n";
        $message = get_block('blockWikiConflictHowTo');
        $dialogBox->info($message);
        $out .= '<form id="editConflict" action="' . claro_htmlspecialchars(Url::Contextualize($_SERVER['PHP_SELF'])) . '" method="post">';
        $out .= '<textarea name="conflictContent" id="content"' . ' cols="80" rows="15" >';
        $out .= $content;
        $out .= '</textarea><br /><br />' . "\n";
        $out .= '<div>' . "\n";
        $out .= '<input type="hidden" name="wikiId" value="' . (int) $wikiId . '" />' . "\n";
        $out .= '<input type="hidden" name="title" value="' . claro_htmlspecialchars($title) . '" />' . "\n";
        $out .= '<input type="submit" name="action[edit]" value="' . get_lang("Edit last version") . '" />' . "\n";
        $url = claro_htmlspecialchars(Url::Contextualize($_SERVER['PHP_SELF'] . '?wikiId=' . $wikiId . '&title=' . $title . '&action=show'));
        $out .= claro_html_button($url, get_lang("Cancel")) . "\n";
        $out .= '</div>' . "\n";
        $out .= '</form>';
        break;
    case 'diff':
Example #18
0
  ============================================================================*/
$soapclient = new nusoap_client('http://www.claroline.net/worldwide/worldwide_soap.php');
/*============================================================================
                        COMMANDS
  ============================================================================*/
$dialogBox = new DialogBox();
// -- register campus
if (isset($_REQUEST['register'])) {
    $country = isset($_REQUEST['country']) ? $_REQUEST['country'] : '';
    $parameters = array('campusName' => addslashes(get_conf('siteName')), 'campusUrl' => get_path('rootWeb'), 'institutionName' => addslashes(get_conf('institution_name')), 'institutionUrl' => get_conf('institution_url'), 'country' => $country, 'adminEmail' => get_conf('administrator_email'));
    // make the soap call to register the campus
    $soapResponse = $soapclient->call('registerCampus', $parameters);
    if ($soapResponse == CAMPUS_ADDED) {
        $dialogBox->success(get_lang('Your campus has been submitted and is waiting to be validate by Claroline.net team'));
    } elseif ($soapResponse == LOCAL_URL_ERROR) {
        $dialogBox->error(get_block('blockRegisterLocalUrl'));
    } elseif ($soapResponse == CAMPUS_ALREADY_IN_LIST) {
        $dialogBox->warning(get_lang('It seems that you already have registered your campus.'));
    } elseif ($soapResponse == COUNTRY_CODE_ERROR) {
        $dialogBox->error(get_lang('Country code seems to be incorrect.'));
    } else {
        // unknown soap error
        $dialogBox->error(get_lang('An error occurred while contacting Claroline.net'));
    }
} else {
    $parameters = array('campusUrl' => get_path('rootWeb'));
    $soapResponse = $soapclient->call('getCampusRegistrationStatus', $parameters);
    if ($soapResponse) {
        $dialogBoxContent = get_lang('Current registration status : ') . '<br /><br />' . "\n";
        switch ($soapResponse) {
            case 'SUBMITTED':
Example #19
0
        ?>
">
                    <?php 
        echo get_lang('Add a new portlet');
        ?>
: <?php 
        echo get_lang($portlet['name']);
        ?>
                </a>
            </li>
            <?php 
    }
    ?>
        </ul>
        <?php 
}
?>
        
        <?php 
if (count($this->portletIterator) > 0) {
    foreach ($this->portletIterator as $portlet) {
        if ($portlet->getVisible() || !$portlet->getVisible() && claro_is_allowed_to_edit()) {
            echo $portlet->render();
        }
    }
} elseif (count($this->portletIterator) == 0 && claro_is_allowed_to_edit()) {
    echo get_block('blockIntroCourse');
}
?>
    </div>
Example #20
0
<!-- $Id: help_home.tpl.php 12676 2010-10-20 14:59:33Z abourguignon $ -->

<table width="100%" border="0" cellpadding="1" cellspacing="1">
<tr>
  <td align="left" valign="top">
    <?php 
echo '<h4>' . get_lang('Home page help') . '</h4>';
?>
  </td>
</tr>
<tr>
  <td>
    <?php 
echo get_block('blockHomepageHelp');
?>
  </td>
</tr>
</table>
$completionRef = strtotime("-{$completionSec} seconds");
# Scan header for spelling...; at least 1 word has to match the spelling
if ($use_spellCheck && !function_exists('pspell_check')) {
    echo "Note: Disabling spell checking as it is not available in your PHP installation.\n";
    echo "      Consider the following to enable it:";
    echo "             ubuntu #> sudo apt-get install php5-pspell\n";
    echo "             redhat #> yum install php-pspell\n";
    echo "             other  #> # re-compile php with --with-pspell flag\n";
    $use_spellCheck = false;
}
$binaries = new Binaries();
if ($use_NNRegexDB) {
    # Over-ride Blacklist up top and use database
    $blacklist = $binaries->getBlacklist(true);
}
while ($res = get_block($offset, $batch)) {
    $subtotal = count($res);
    $total += $subtotal;
    $release = new Releases();
    $category = new Category();
    // Track error count changes
    $_errcnt = $errcnt;
    foreach ($res as $header) {
        // if a white list is detected we now are required to
        // only accept the entry if it matches at least 1 whitelist
        // while a blacklist will over-ride all
        $whitelist = array();
        $matches_whitelist = false;
        foreach ($blacklist as $bl) {
            // opttype = 1 -> Blacklist (Default)
            // opttype = 2 -> Whitelist
Example #22
0
 public static function invoke_block($block)
 {
     if (is_object($block)) {
         $bo = $block;
     } else {
         $bo = get_block($block);
     }
     if (isset($bo->access) && $bo->access != null) {
         if (callable_exists($bo->access)) {
             if (call_user_func_array($bo->access, array())) {
                 if (callable_exists($bo->callback)) {
                     return call_user_func_array($bo->callback, array());
                 }
             }
         }
     }
     return null;
 }
Example #23
0
 />
                    &nbsp;
                    <label for="registration_false">
                        <?php 
echo get_lang('Denied');
?>
                    </label>
                </dd>
                
                <!-- Course settings tips -->
                <dt>
                    &nbsp;
                </dt>
                <dd>
                    <span class="notice"><?php 
echo get_block('blockCourseSettingsTip');
?>
</span>
                </dd>
                
            </dl>
        </div>
    </fieldset>
    
    
    <!-- SECOND SECTION: optionnal settings -->
    <fieldset  class="collapsible collapsed" id="options">
        <legend>
            <a href="#" class="doCollapse"><?php 
echo get_lang('Optionnal settings');
?>
Example #24
0
            $order = $orderMax + 1;
            // finally : insert in learning path
            $sql = "INSERT INTO `" . $TABLELEARNPATHMODULE . "`\n                    (`learnPath_id`, `module_id`, `specificComment`, `rank`, `lock`)\n                    VALUES ('" . (int) $_SESSION['path_id'] . "', '" . (int) $moduleId . "','" . claro_sql_escape(get_block('blockDefaultModuleAddedComment')) . "', " . $order . ",'OPEN')";
            claro_sql_query($sql);
            $msgList['info'][] = get_lang("%moduleName has been added as module", array('%moduleName' => $exercise['title'])) . '<br />' . "\n";
        } else {
            // check if this is this LP that used this exercise as a module
            $sql = "SELECT COUNT(*)\n                      FROM `" . $TABLELEARNPATHMODULE . "` AS LPM,\n                           `" . $TABLEMODULE . "` AS M,\n                           `" . $TABLEASSET . "` AS A\n                     WHERE M.`module_id` =  LPM.`module_id`\n                       AND M.`startAsset_id` = A.`asset_id`\n                       AND A.`path` = " . (int) $exercise['id'] . "\n                       AND LPM.`learnPath_id` = " . (int) $_SESSION['path_id'];
            $num = claro_sql_query_get_single_value($sql);
            if ($num == 0) {
                // determine the default order of this Learning path
                $sql = "SELECT MAX(`rank`)\n                        FROM `" . $TABLELEARNPATHMODULE . "`";
                $orderMax = claro_sql_query_get_single_value($sql);
                $order = $orderMax + 1;
                // finally : insert in learning path
                $sql = "INSERT INTO `" . $TABLELEARNPATHMODULE . "`\n                        (`learnPath_id`, `module_id`, `specificComment`, `rank`, `lock`)\n                        VALUES (" . (int) $_SESSION['path_id'] . ", " . (int) $existingModule['module_id'] . ",'" . claro_sql_escape(get_block('blockDefaultModuleAddedComment')) . "', " . $order . ", 'OPEN')";
                $query = claro_sql_query($sql);
                $msgList['info'][] = get_lang("%moduleName has been added as module", array('%moduleName' => $exercise['title'])) . '<br />' . "\n";
            } else {
                $msgList['info'][] = get_lang("%moduleName is already used as a module in this learning path", array('%moduleName' => $exercise['title'])) . '<br />' . "\n";
            }
        }
    }
}
//end while
//STEP ONE : display form to add an exercise
$out .= claro_html_msg_list($msgList);
$out .= display_my_exercises($dialogBox);
//STEP TWO : display learning path content
$out .= claro_html_tool_title(get_lang('Learning path content'));
// display list of modules used by this learning path
Example #25
0
<!-- $Id: help_group.tpl.php 12676 2010-10-20 14:59:33Z abourguignon $ -->

<table width="100%" border="0" cellpadding="1" cellspacing="1">
<tr>
  <td align="left" valign="top">
    <?php 
echo '<h4>' . get_lang('Groups help') . '</h4>';
?>
  </td>
</tr>
<tr>
  <td>
    <?php 
echo get_block('blockGroupsHelp');
?>
  </td>
</tr>
</table>
Example #26
0
function save_position($block_position)
{
    $menus = MenuService::get_menu_list();
    $menus_tree = json_decode(TextHelper::html_entity_decode(AppContext::get_request()->get_value('menu_tree_' . get_block($block_position))));
    foreach ($menus_tree as $position => $tree) {
        $id = $tree->id;
        if (array_key_exists($id, $menus)) {
            $menu = $menus[$id];
            $menu->set_block_position($position + 1);
            MenuService::move($menu, $block_position, $menu->get_block_position());
        }
    }
}
Example #27
0
function get()
{
    list($name, $param1, $param2) = func_get_args();
    switch ($name) {
        case 'path':
            echo TEMPL_PATH;
            return;
        case 'name':
            echo NAME;
            return;
        case 'slogan':
            echo SLOGAN;
            return;
        case 'copy':
            echo COPYRIGHT;
            return;
        case 'generate':
            echo GENERATE;
            return;
        case 'title':
            echo TITLE;
            return;
        case 'menu':
            echo MENU;
            return;
        case 'content':
            echo CONTENT;
            return;
        case 'first_page':
            echo href(FIRST_PAGE);
            return;
        case 'block':
            get_block($param1, $param2);
            return;
        case 'keywords':
            echo KEYWORDS;
            return;
        case 'description':
            echo DESCRIPTION;
            return;
    }
}
Example #28
0
 /**
  * Send course creation information by mail to all platform administrators
  *
  * @param string creator firstName
  * @param string creator lastname
  * @param string creator email
  */
 public function mailAdministratorOnCourseCreation($creatorFirstName, $creatorLastName, $creatorEmail)
 {
     $subject = get_lang('Course created : %course_name', array('%course_name' => $this->title));
     $categoryCodeList = array();
     foreach ($this->categories as $category) {
         $categoryCodeList[] = $category->name;
     }
     $body = nl2br(get_block('blockCourseCreationEmailMessage', array('%date' => claro_html_localised_date(get_locale('dateTimeFormatLong')), '%sitename' => get_conf('siteName'), '%user_firstname' => $creatorFirstName, '%user_lastname' => $creatorLastName, '%user_email' => $creatorEmail, '%course_code' => $this->officialCode, '%course_title' => $this->title, '%course_lecturers' => $this->titular, '%course_email' => $this->email, '%course_categories' => !empty($this->categories) ? implode(', ', $categoryCodeList) : get_lang('No category'), '%course_language' => $this->language, '%course_url' => get_path('rootWeb') . 'claroline/course/index.php?cid=' . claro_htmlspecialchars($this->courseId))));
     // Get the concerned senders of the email
     $mailToUidList = claro_get_uid_of_system_notification_recipient();
     if (empty($mailToUidList)) {
         $mailToUidList = claro_get_uid_of_platform_admin();
     }
     $message = new MessageToSend(claro_get_current_user_id(), $subject, $body);
     $recipient = new UserListRecipient();
     $recipient->addUserIdList($mailToUidList);
     //$message->sendTo($recipient);
     $recipient->sendMessage($message);
 }
Example #29
0
//this bloc would be removed later by direct use of var name
$TABLELEARNPATH = $tbl_lp_learnPath;
$TABLEMODULE = $tbl_lp_module;
$TABLELEARNPATHMODULE = $tbl_lp_rel_learnPath_module;
$TABLEASSET = $tbl_lp_asset;
$TABLEUSERMODULEPROGRESS = $tbl_lp_user_module_progress;
//lib of this tool
require_once get_path('incRepositorySys') . "/lib/learnPath.lib.inc.php";
/*======================================
       CLAROLINE MAIN
  ======================================*/
$out = '';
// display title
$out .= claro_html_tool_title($nameTools);
// display use explication text
$out .= get_block('blockModulePoolHelp') . "<br /><br />";
// HANDLE COMMANDS:
$cmd = isset($_REQUEST['cmd']) ? $_REQUEST['cmd'] : '';
switch ($cmd) {
    // MODULE DELETE
    case "eraseModule":
        // used to physically delete the module  from server
        require_once get_path('incRepositorySys') . "/lib/fileManage.lib.php";
        $moduleDir = claro_get_course_path() . '/modules';
        $moduleWorkDir = get_path('coursesRepositorySys') . $moduleDir;
        // delete all assets of this module
        $sql = "DELETE\n                FROM `" . $TABLEASSET . "`\n                WHERE `module_id` = " . (int) $_REQUEST['cmdid'];
        claro_sql_query($sql);
        // delete from all learning path of this course but keep there id before
        $sql = "SELECT *\n                FROM `" . $TABLELEARNPATHMODULE . "`\n                WHERE `module_id` = " . (int) $_REQUEST['cmdid'];
        $result = claro_sql_query($sql);
Example #30
0
// Communication's administration menu
$menu['Communication'][] = '<a href="../messaging/admin.php">' . get_lang('Internal messaging') . '</a>';
$adminModuleList = get_admin_module_list(true);
if (count($adminModuleList) > 0) {
    foreach ($adminModuleList as $module) {
        language::load_module_translation($module['label']);
        $menu['ExtraTools'][] = '<a href="' . get_module_entry_url($module['label']) . '">' . get_lang($module['name']) . '</a>';
    }
}
// Deal with interbreadcrumbs and title variable
$nameTools = get_lang('Administration');
// No sense because not allowed with claro_is_platform_admin(),
// but claro_is_platform_admin() should be later replaced by
// get_user_property ('can view admin menu')
$is_allowedToAdmin = claro_is_platform_admin();
// Is our installation system accessible ?
if (file_exists('../install/index.php') && !file_exists('../install/.htaccess')) {
    // If yes, warn the administrator
    $dialogBox->warning(get_block('blockWarningRemoveInstallDirectory'));
}
$register_globals_value = ini_get('register_globals');
// Is the php 'register_globals' param enable ?
if (!empty($register_globals_value) && strtolower($register_globals_value) != 'off') {
    // If yes, warn the administrator
    $dialogBox->warning(get_lang('<b>Security :</b> We recommend to set register_globals to off in php.ini'));
}
$template = new CoreTemplate('admin_panel.tpl.php');
$template->assign('dialogBox', $dialogBox);
$template->assign('menu', $menu);
$claroline->display->body->appendContent($template->render());
echo $claroline->display->render();