Example #1
0
 public function renderContent()
 {
     // Init linker
     FromKernel::uses('core/linker.lib');
     ResourceLinker::init();
     $output = '';
     $output .= '<dl id="portletAbout">' . "\n";
     $toolIntroIterator = new ToolIntroductionIterator($this->courseCode);
     if (count($toolIntroIterator) > 0) {
         $introList = '';
         foreach ($toolIntroIterator as $introItem) {
             if ($introItem->getVisibility() == 'SHOW') {
                 // Display attached resources (if any)
                 $currentLocator = ResourceLinker::$Navigator->getCurrentLocator(array('id' => $introItem->getId()));
                 $currentLocator->setModuleLabel('CLINTRO');
                 $currentLocator->setResourceId($introItem->getId());
                 $resources = ResourceLinker::renderLinkList($currentLocator);
                 // Prepare the render
                 $introList .= '<dt>' . "\n" . '</dt>' . "\n" . '<dd' . (!$toolIntroIterator->hasNext() ? ' class="last"' : '') . '>' . "\n" . claro_parse_user_text($introItem->getContent()) . "\n" . $resources . (claro_is_allowed_to_edit() ? '<div class="manageTools"><a
                                 href="' . claro_htmlspecialchars(Url::Contextualize(get_module_url('CLTI') . '/index.php?cmd=rqEd&amp;id=' . $introItem->getId())) . '"
                                 title="' . get_lang('Edit this item') . '">
                                 <img src="' . get_icon_url('edit') . '" alt="' . get_lang('Edit') . '" />
                             </a>
                             
                             <a
                                 href="' . claro_htmlspecialchars(Url::Contextualize(get_module_url('CLTI') . '/index.php?cmd=exDel&amp;id=' . $introItem->getId())) . '"
                                 title="' . get_lang('Delete this item') . '">
                                 <img src="' . get_icon_url('delete') . '" alt="' . get_lang('Delete') . '" />
                             </a></div>' : '') . '</dd>' . "\n";
             }
         }
     }
     if (count($toolIntroIterator) == 0 || empty($introList)) {
         $output .= '<dt></dt>' . '<dd>' . "\n" . ' ' . get_lang('No headline') . '. ' . (claro_is_allowed_to_edit() ? '<a href="' . claro_htmlspecialchars(Url::Contextualize(get_module_url('CLTI') . '/index.php?cmd=rqAdd')) . '">' . get_lang('Would you like to add one ?') . '</a>' . "\n" : '') . '</dd>' . "\n";
     } else {
         $output .= $introList;
     }
     $output .= '</dl>';
     return $output;
 }
Example #2
0
    ?>
<div class="item<?php 
    if ($this->intro->getVisibility() != 'SHOW') {
        ?>
 hidden<?php 
    }
    ?>
">
    <div class="content">
        <p><?php 
    echo claro_parse_user_text($this->intro->getContent());
    ?>
</p>
        
        <?php 
    echo ResourceLinker::renderLinkList($this->rsLocator);
    ?>
    </div>
    
    <?php 
    if (claro_is_allowed_to_edit()) {
        ?>
    <div class="manageTools">
        <a
            href="<?php 
        echo claro_htmlspecialchars(Url::Contextualize($_SERVER['PHP_SELF'] . '?cmd=rqEd&amp;id=' . $this->intro->getId()));
        ?>
"
            title="<?php 
        echo get_lang('Edit this item');
        ?>
Example #3
0
         }
     }
     // end elseif cmd == exCreate
     // Email sending (optionnal)
     if (1 == $emailOption) {
         $courseSender = claro_get_current_user_data('firstName') . ' ' . claro_get_current_user_data('lastName');
         $courseOfficialCode = claro_get_current_course_data('officialCode');
         $subject = '';
         if (!empty($title)) {
             $subject .= $title;
         } else {
             $subject .= get_lang('Message from your lecturer');
         }
         $msgContent = $content;
         // Enclosed resource
         $body = $msgContent . "\n" . "\n" . ResourceLinker::renderLinkList($currentLocator, true);
         require_once dirname(__FILE__) . '/../messaging/lib/message/messagetosend.lib.php';
         require_once dirname(__FILE__) . '/../messaging/lib/recipient/courserecipient.lib.php';
         $courseRecipient = new CourseRecipient(claro_get_current_course_id());
         $message = new MessageToSend(claro_get_current_user_id(), $subject, $body);
         $message->setCourse(claro_get_current_course_id());
         $message->setTools('CLANN');
         $messageId = $courseRecipient->sendMessage($message);
         if ($failure = claro_failure::get_last_failure()) {
             $dialogBox->warning($failure);
         }
     }
     // end if $emailOption==1
 }
 // end if $submit Announcement
 if ($autoExportRefresh) {
Example #4
0
            ?>
<h2><?php 
            echo claro_htmlspecialchars($event['title']);
            ?>
</h2><?php 
        }
        ?>
        <?php 
        if (!empty($event['content'])) {
            echo claro_parse_user_text($event['content']);
        }
        ?>
    </div>
    
    <?php 
        echo ResourceLinker::renderLinkList($event['currentLocator']);
        ?>
    
    <?php 
        if (claro_is_allowed_to_edit()) {
            ?>
    <div class="manageTools">
        <a href="<?php 
            echo claro_htmlspecialchars(Url::Contextualize($_SERVER['PHP_SELF'] . '?cmd=rqEdit&amp;id=' . $event['id']));
            ?>
">
            <img src="<?php 
            echo get_icon_url('edit');
            ?>
" alt="<?php 
            echo get_lang('Modify');
Example #5
0
            ?>
</h2><?php 
        }
        ?>
        <?php 
        if (!empty($announcement['content'])) {
            echo claro_parse_user_text($announcement['content']);
        }
        ?>
    </div>
    
    <?php 
        if (!empty($announcement['currentLocator'])) {
            ?>
    <?php 
            echo ResourceLinker::renderLinkList($announcement['currentLocator']);
            ?>
    
    <?php 
        }
        ?>
    
    <?php 
        if (claro_is_allowed_to_edit()) {
            ?>
    <div class="manageTools">
        <a href="<?php 
            echo claro_htmlspecialchars(Url::Contextualize($_SERVER['PHP_SELF'] . '?cmd=rqEdit&id=' . $announcement['id']));
            ?>
">
            <img src="<?php 
Example #6
0
 } else {
     foreach ($textIntroList as $thisIntroKey => $thisTextIntro) {
         $introId = $thisTextIntro['id'];
         $introVisibility = $thisTextIntro['visibility'];
         if ($introVisibility == 'SHOW' || $intro_editAllowed) {
             $cssClass = $introVisibility == 'HIDE' ? ' invisible' : '';
             $cssClass = $intro_editAllowed ? ' editable' : '';
             $intro_content = claro_parse_user_text($thisTextIntro['content']);
             $section = '';
             if (trim(strip_tags($intro_content, '<img><embed><object>')) != '') {
                 $section .= $intro_content . "\n";
             } elseif ($intro_editAllowed) {
                 $section .= '<div style="text-align:center;background-color:silver;margin:3px;">' . get_lang('This zone is empty') . '</div>' . "\n";
             }
             $currentLocator = ResourceLinker::$Navigator->getCurrentLocator(array('id' => $thisTextIntro['id']));
             $section .= ResourceLinker::renderLinkList($currentLocator);
             if ($intro_dispCommand) {
                 $section .= '<div class="toolbar">' . "\n";
                 $section .= '<a class="claroCmd" href="' . htmlspecialchars(Url::Contextualize($_SERVER['PHP_SELF'] . '?introCmd=rqEd&amp;introId=' . $introId)) . '">' . '<img src="' . get_icon_url('edit') . '" alt="' . get_lang('Edit') . '" />' . '</a>' . "\n" . '<a class="claroCmd" href="' . htmlspecialchars(Url::Contextualize($_SERVER['PHP_SELF'] . '?introCmd=exDel&amp;introId=' . $introId)) . '" ' . 'onclick="javascript:if(!confirm(\'' . clean_str_for_javascript(get_lang('Confirm Operation') . ' : ' . get_lang('Delete')) . '\')) ' . 'return false;">' . '<img src="' . get_icon_url('delete') . '" alt="' . get_lang('Delete') . '" />' . '</a>' . "\n";
                 if ($thisIntroKey > 0) {
                     $section .= '<a class="claroCmd" href="' . htmlspecialchars(Url::Contextualize($_SERVER['PHP_SELF'] . '?introCmd=exMvUp&amp;introId=' . $introId)) . '">' . '<img src="' . get_icon_url('move_up') . '" alt="' . get_lang('Move up') . '" />' . '</a> ';
                 }
                 if ($thisIntroKey + 1 < $introListCount) {
                     $section .= ' <a class="claroCmd" href="' . htmlspecialchars(Url::Contextualize($_SERVER['PHP_SELF'] . '?introCmd=exMvDown&amp;introId=' . $introId)) . '">' . '<img src="' . get_icon_url('move_down') . '" alt="' . get_lang('Move down') . '" />' . '</a>';
                 }
                 //  Visibility
                 if ($introVisibility == 'SHOW') {
                     $section .= '<a class="claroCmd" href="' . htmlspecialchars(Url::Contextualize($_SERVER['PHP_SELF'] . '?introCmd=mkInvisible&amp;introId=' . $introId)) . '" title="' . get_lang('Click to make invisible') . '">';
                     $section .= '<img src="' . get_icon_url('visible') . '" alt="' . get_lang('Visible') . '" />';
                     $section .= '</a>' . "\n";
                 } else {