Esempio n. 1
0
$this->loadClass("radio", "htmlelements");
$this->loadClass("fieldset", "htmlelements");
$this->loadClass("label", "htmlelements");
$this->loadClass("form", "htmlelements");
$this->loadClass("button", "htmlelements");
$this->loadClass('htmlheading', 'htmlelements');
$this->loadClass('checkbox', 'htmlelements');
$this->loadClass('dropdown', 'htmlelements');
$header = new htmlHeading();
$header->type = "1";
$header->cssClass = "pagetitle";
$header->str = $this->objLanguage->languageText('mod_contextcontent_selectdates', 'contextcontent', 'Select dates') . ' - ' . $title;
$objContext = $this->getObject('dbcontext');
$contextCode = $objContext->getContextCode();
echo $header->show();
$objPopupcal = $this->newObject('datepickajax', 'popupcalendar');
$objTable = $this->getObject("htmltable", "htmlelements");
$startLabel = $this->objLanguage->languageText('mod_contextcontent_selectstartdate', 'contextcontent', "Start Date");
$closeLabel = $this->objLanguage->languageText('mod_contextcontent_selectclosedate', 'contextcontent', "Close Date");
$userOptLabel = $this->objLanguage->languageText('mod_contextcontent_onlystudents', 'contextcontent', "Show student activity only");
$selectModuleLabel = $this->objLanguage->languageText('mod_contextcontent_selectmodule', 'contextcontent', "Select module");
/* * ** start date & time *** */
// Set start date of test
$startField = $objPopupcal->show('startdate', 'yes', 'no', strftime('%Y-%m-%d %H:%M:%S', mktime()));
$objLabel = new label($startLabel . ':', 'input_start');
$objTable->startRow();
$objTable->addCell($objLabel->show());
$objTable->addCell($startField);
$objTable->endRow();
//$objTable->addRow(array(
<?php

$this->loadClass('link', 'htmlelements');
$this->loadClass('htmlheading', 'htmlelements');
$header = new htmlHeading();
$header->type = "1";
$header->cssClass = "useractivitytitle";
$header->str = $this->objLanguage->languageText('mod_contextcontent_useractivity', 'contextcontent', 'User activity') . '&nbsp;-&nbsp;' . $modulename . '&nbsp;(' . $startdate . '&nbsp;-&nbsp;' . $enddate . ')';
$homelink = new link($this->uri(array("action" => "selectuseractivitybymoduledates")));
$homelink->link = $this->objLanguage->languageText("word_back", "system", "Back");
$exportLink = new link($this->uri(array("action" => "exportospreadsheet", "assignmentid" => $assignment['id'])));
$exportLink->link = $this->objLanguage->languageText('mod_assignment_export', 'assignment', 'Export to spreadsheet');
$exportStr = '&nbsp;&nbsp;|&nbsp;&nbsp' . $exportLink->show();
echo $header->show() . $homelink->show();
$table = $this->getObject('htmltable', 'htmlelements');
$table->startHeaderRow();
$table->addHeaderCell('No');
$table->addHeaderCell('Names');
$table->addHeaderCell('Access Count');
$table->addHeaderCell('Last Access');
$table->endHeaderRow();
$count = 1;
foreach ($data as $row) {
    $link = new link($this->uri(array("action" => "viewuseractivitybyid", "userid" => $row['userid'], "startdate" => $startdate, "enddate" => $enddate, "moduleid" => $modulename)));
    $link->link = $this->objUser->fullname($row['userid']);
    $table->startRow();
    $table->addCell($count + ".");
    $table->addCell($link->show());
    $table->addCell($row['accesscount']);
    $table->addCell($row['lastaccess']);
    $table->endRow();
Esempio n. 3
0
            }
        }
        $permissions = $dAcl . '|' . $dGroup . '|_con_' . $dCon;
        $admin = $modData['isAdmin'];
        if (isset($modData['isContext'])) {
            $depends = $modData['isContext'];
        }
    }
}
$objHead = new htmlHeading();
$objHead->str = $addHeading;
if ($mode == 'edit') {
    $objHead->str = $editHeading;
}
$objHead->type = 1;
$str = $objHead->show();
$str .= '<p><b>' . $moduleLabel . ':</b>&nbsp;&nbsp;' . $moduleName . '</p>';
$objTable = new htmlTable();
$objTable->width = '99%';
$objTable->cellpadding = 5;
$objHead->str = $linkLabel;
$objHead->type = 3;
$objTable->startRow();
$objTable->addCell($objHead->show(), '', '', '', '', 'colspan="4"');
$objTable->endRow();
// Available side menus
$objDrop = new dropdown('menu');
if ($page) {
    $objLabel = new label($pageLabel, 'input_menu');
    $objDrop->extra = 'onChange = "javascript:changeOptions()"';
    $objDrop->addOption('lecturer', 'lecturer');
 /**
  * Method to display the information of a context in a block
  *
  * @param array $context
  * @param boolean $showEditDeleteLinks - Show Edit Links if applicable. THis function will determine it
  * @param boolean $includeFeatureBox - Display in a feature box or not
  * @param boolean $disablePrivateAccess - Should a javascript warning be alert be shown instead of link
  *                                        if context is private and user is not a member
  * @return string
  */
 public function formatContextDisplayBlock($context, $showEditDeleteLinks = TRUE, $includeFeatureBox = TRUE, $disablePrivateAccess = FALSE)
 {
     // Initialize the variable.
     $canEdit = FALSE;
     // Flag on whether to show link for private courses.
     $showLink = $disablePrivateAccess;
     if (!$disablePrivateAccess) {
         // If admin, show link.
         $access = $this->objDBContext->getField('access', $context['contextcode']);
         if ($this->objUser->isAdmin() || in_array($context['contextcode'], $this->userContexts) || $access == 'Public' || $access == 'Open') {
             $showLink = TRUE;
         }
     }
     $titleLink = $context['title'];
     if ($showLink) {
         $link = new link($this->uri(array('action' => 'joincontext', 'contextcode' => $context['contextcode'])));
         $link->link = $titleLink;
     } else {
         $link = new link('javascript:contextPrivate();');
         $link->link = $titleLink;
     }
     $link->cssClass = "contexttitle";
     // Add Permissions
     $str = '';
     // Get Context Image
     $contextImage = $this->objContextImage->getContextImage($context['contextcode']);
     // Show if it has an image
     if ($contextImage == FALSE) {
         $contextImage = $this->noImage;
     } else {
         $contextImage = '<img class="roundcorners_small" src="' . $contextImage . '" />';
     }
     if ($showLink) {
         $contextImageLink = new link($this->uri(array('action' => 'joincontext', 'contextcode' => $context['contextcode'])));
     } else {
         $contextImageLink = new link('javascript:contextPrivate();');
     }
     $contextImageLink->link = $contextImage;
     // Get the about text and shorten it.
     $objShorter = $this->getObject('trimstr', 'strings');
     $about = $objShorter->strTrim($context['about'], $len = 450, TRUE);
     $str = "<table><tr><td valign='top'>" . $contextImageLink->show() . "</td><td valign='top'>" . $about . "</td></tr></table>";
     $str .= '<p><strong>' . ucwords($this->objLanguage->code2Txt('mod_context_contextcode', 'system', NULL, '[-context-] Code')) . '</strong>: ' . $context['contextcode'] . '</p>';
     $lecturers = $this->objUserContext->getContextLecturers($context['contextcode']);
     if (count($lecturers) > 0) {
         $str .= '<p><strong>' . ucwords($this->objLanguage->code2Txt('word_lecturers', 'system', NULL, '[-authors-]')) . '</strong>: ';
         $divider = '';
         foreach ($lecturers as $lecturer) {
             $str .= $divider . $lecturer['firstname'] . ' ' . $lecturer['surname'];
             $divider = ', ';
             if ($this->objUser->userId() == $lecturer['userid']) {
                 $canEdit = TRUE;
             }
         }
     }
     switch (strtolower($context['access'])) {
         case 'public':
             $access = $this->objLanguage->code2Txt('mod_context_publiccontextexplanation', 'context', NULL, 'This is an open [-context-] that any user may enter');
             break;
         case 'open':
             $access = $this->objLanguage->code2Txt('mod_context_opencontextexplanation', 'context', NULL, 'This is an open [-context-] that any logged-in user may enter');
             break;
         default:
             $access = $this->objLanguage->code2Txt('mod_context_privatecontextexplanation', 'context', NULL, 'This is a closed [-context-] only accessible to members');
             break;
     }
     $str .= '<p><strong>' . ucwords($this->objLanguage->languageText('mod_context_accessettings', 'context', 'Access Settings')) . '</strong>: ' . $context['access'] . ' - ' . $access . '</p>';
     $table = $this->newObject('htmltable', 'htmlelements');
     $table->startRow();
     $table->addCell($contextImageLink->show(), 120);
     $table->addCell($str);
     $content = $str;
     $title = '';
     if ($this->objUser->isAdmin()) {
         $canEdit = TRUE;
     }
     if ($showEditDeleteLinks && $canEdit) {
         $objIcon = $this->newObject('geticon', 'htmlelements');
         $objIcon->setIcon('edit');
         $editLink = new link($this->uri(array('action' => 'edit', 'contextcode' => $context['contextcode']), $this->module));
         $editLink->link = $objIcon->show();
         $editOptions = ' ' . $editLink->show();
         $objIcon->setIcon('delete');
         $deleteLink = new link($this->uri(array('action' => 'delete', 'contextcode' => $context['contextcode']), $this->module));
         $deleteLink->link = $objIcon->show();
         $editOptions .= ' ' . $deleteLink->show();
         $studentCount = "";
         if (strtoupper($this->showStudentCount) == 'TRUE') {
             $studentCount = '&nbsp;(' . count($this->objUserContext->getContextStudents($context['contextcode'])) . ')';
         }
         $title = '<div style="float: right">' . $editOptions . '</div>';
     }
     $title .= $link->show();
     if ($includeFeatureBox) {
         $objFeatureBox = $this->newObject('featurebox', 'navigation');
         return $objFeatureBox->show($title, $content);
     } else {
         $header = new htmlHeading();
         $header->type = 3;
         $header->str = $title;
         return $header->show() . $content;
     }
 }
Esempio n. 5
0
$hTable->addCell(null, null, null, 'left');
$hTable->addCell($srch, null, 'top', 'right');
$hTable->endRow();
$searchForm->addToForm($hTable->show());
$this->appendArrayVar('headerParams', "<script type='text/javascript' src='core_modules/modulecatalogue/resources/remote.js'></script>");
$objSelectFile = new textinput('archive', null, 'file', 30);
$uploadSize = new textinput('MAX_FILE_SIZE', '8000000', 'hidden');
$fButton = new button('bupload', $this->objLanguage->languageText('word_upload'));
//,"javascript:uploadArchive($('form_fupload').archive.value,'$moduleId');");
$fButton->setToSubmit();
$objUForm = new form('fupload', $this->uri(array('action' => 'uploadarchive', 'cat' => $activeCat)));
$objUForm->extra = 'enctype="multipart/form-data"';
$objUForm->addToForm($uploadSize->show());
$objUForm->addToForm($objSelectFile->show());
$objUForm->addToForm($fButton->show());
$objUploadTable = $this->newObject('htmlTable', 'htmlelements');
$objUploadTable->startRow();
$objUploadTable->addCell('&nbsp;');
$objUploadTable->addCell($this->objLanguage->languageText('mod_modulecatalogue_uploadmod', 'modulecatalogue') . "<br />" . $objUForm->show(), null, null, 'right');
$objUploadTable->endRow();
if ($modules && $missingModules) {
    $remoteEx = new htmlHeading();
    $remoteEx->type = 4;
    $remoteEx->str = $this->objLanguage->languageText('mod_modulecatalogue_rpcex', 'modulecatalogue');
    $remote = $remoteEx->show() . "<br />" . $objUploadTable->show() . $objRemoteTable->show();
} else {
    $remote = '';
}
echo $searchForm->show() . $objForm->show() . $remote;
//$content = $objH->show().$notice.$topTable->show().$objTable->show().$bottomTable->show();
//echo $content;