Example #1
0
            $radio->setSelected('guest');
        }
        // Check if Student
        if (in_array($result['userid'], $students)) {
            $radio->setSelected('student');
        }
        // Check if Lecturer
        if (in_array($result['userid'], $lecturers)) {
            $radio->setSelected('lecturer');
        }
        $table->addCell($radio->show());
        $table->endRow();
    }
    $addUsersForm = new form('addusers', $this->uri(array('action' => 'addusers')));
    $button = new button('submitform', $this->objLanguage->languageText('mod_contextgroups_updateuserroles', 'contextgroups'));
    $button->setToSubmit();
    $button->extra = 'style="margin-right: 50px;"';
    $hiddenInput = new hiddeninput('context', $contextCode);
    $addUsersForm->addToForm($hiddenInput->show());
    $hiddenInput = new hiddeninput('changedItems', '');
    // $hiddenInput->cssId = 'changedItems';
    $hiddenInput->extra = 'id="changedItems"';
    $addUsersForm->addToForm($hiddenInput->show());
    $addUsersForm->addToForm($table->show());
    $addUsersForm->addToForm('<p align="right">' . $button->show() . '</p>');
    echo $addUsersForm->show();
    echo '<p>' . $this->objLanguage->languageText('mod_contextgroups_browseresults', 'contextgroups', 'Browse Results') . ': ' . $paging . '</p>';
}
$returnLink = new link($this->uri(NULL));
$returnLink->link = ucwords($this->objLanguage->code2Txt('phrase_returntocontextgroups', 'contextgroups'));
echo '<p align="center">' . $returnLink->show() . '</p>';
Example #2
0
$header->str = $this->objLanguage->languageText('mod_errors_heading', 'errors');
// Add Post login menu to left column
$leftSideColumn = '';
if ($objUser->isLoggedIn()) {
    $leftSideColumn = $userMenu->show();
} else {
    $linkhome = new href($this->objConfig->getSiteRoot(), $this->objLanguage->languageText("word_home", "system"));
    $leftSideColumn = $linkhome->show();
}
$midcol = $header->show();
// Add Left column
$cssLayout->setLeftColumnContent($leftSideColumn);
$this->href = $this->getObject('href', 'htmlelements');
$devmsg = htmlentities(stripslashes(urldecode($devmsg)));
$objHiddenInput = new hiddeninput('error', htmlentities($devmsg));
$objHiddenInput2 = new hiddeninput('server', $_SERVER['HTTP_HOST']);
$usrmsg = urldecode($usrmsg);
$devmsg = nl2br($devmsg);
$usrmsg = nl2br($usrmsg);
$blurb = $this->objLanguage->languagetext("mod_errors_blurb", "errors");
//$midcol .= $blurb;
$midcol .= $objFeatureBox->show($this->objLanguage->languagetext("mod_errors_usrtitle", "errors"), $usrmsg);
//'<div class="featurebox">' . nl2br($usrmsg) . '</div>';
$midcol .= $objFeatureBox->show($this->objLanguage->languagetext("mod_errors_devtitle", "errors"), $devmsg);
//'<div class="featurebox">' . nl2br($devmsg) . '</div>';
//$logfile = htmlentities(file_get_contents('error_log/system_errors.log'));
//$midcol .= $objFeatureBox->show($this->objLanguage->languagetext("mod_errors_logfiletitle", "errors"), $logfile);
// CAPTCHA
$objCaptcha = $this->getObject('captcha', 'utilities');
$captcha = new textinput('request_captcha');
$captchaLabel = NULL;
Example #3
0
<?php

$display = '<h1>' . $this->objLanguage->languageText('mod_blog_searchresults', 'blog', 'Search Results') . '</h1>';
$this->loadClass('textinput', 'htmlelements');
$this->loadClass('button', 'htmlelements');
$this->loadClass('form', 'htmlelements');
$this->loadClass('label', 'htmlelements');
$this->loadClass('hiddeninput', 'htmlelements');
$form = new form('search', $this->uri(NULL));
$form->method = 'GET';
$formModule = new hiddeninput('module', 'search');
$search = new textinput('search', $this->getParam('search'));
$module = new textinput('searchmodule', $this->getParam('searchmodule'));
$searchLabel = new label($this->objLanguage->languageText('word_search', 'system', 'Search') . ': ', 'input_search');
$moduleLabel = new label($this->objLanguage->languageText('word_module', 'system', 'Module') . ': ', 'input_module');
$form->addToForm($formModule->show() . $searchLabel->show() . $search->show());
$form->addToForm(' &nbsp; &nbsp; ');
$form->addToForm($moduleLabel->show() . $module->show());
$button = new button('go', $this->objLanguage->languageText('word_go', 'system', 'Go'));
$button->setToSubmit();
$form->addToForm(' &nbsp; ' . $button->show());
$display .= $form->show();
$objSearchResults = $this->getObject('searchresults');
$searchKey = $this->getParam('search', $this->getParam('query'));
$display .= $objSearchResults->displaySearchResults($searchKey, $this->getParam('searchmodule'));
$this->setVar('middleContent', $display);
$cssLayout = $this->newObject('csslayout', 'htmlelements');
$cssLayout->setNumColumns(1);
$middleColumn = $display;
$cssLayout->setMiddleColumnContent($middleColumn);
echo $cssLayout->show();
 /**
  * Method to Display the Business Card
  * @return string
  */
 public function show()
 {
     switch ($this->userArray['sex']) {
         case 'M':
             $gender = 'Male';
             break;
         case 'F':
             $gender = 'Female';
             break;
         default:
             $gender = 'Unknown';
             break;
     }
     $emailLabel = $this->objLanguage->languageText('phrase_emailaddress');
     $genderLabel = $this->objLanguage->languageText('word_gender');
     $mobileLabel = $this->objLanguage->languageText('phrase_mobilenumber');
     $countryLabel = $this->objLanguage->languageText('word_country');
     $image = $this->objUser->getUserImage($this->userArray['userid'], TRUE);
     if ($this->showResetImage) {
         if ($this->objUser->hasCustomImage($this->userArray['userid'])) {
             $resetimageform = new form('updateimage', $this->uri(array('action' => $this->resetAction), $this->resetModule));
             $id = new hiddeninput('id', $this->userArray['id']);
             $resetimageform->addToForm($id->show());
             $userid = new hiddeninput('userid', $this->userArray['userid']);
             $resetimageform->addToForm($userid->show());
             $button = new button('resetimage', 'Reset Image');
             $button->setToSubmit();
             $resetimageform->addToForm(' ' . $button->show());
             $image .= $resetimageform->show();
         }
     }
     $objHeading = new htmlheading();
     $objHeading->str = $this->userArray['title'] . ' ' . $this->userArray['firstname'] . ' ' . $this->userArray['surname'];
     $objHeading->type = 1;
     $heading = $objHeading->show();
     $objTable = new htmltable();
     $objTable->width = '100%';
     $objTable->cellpadding = '4';
     $objTable->startRow();
     $objTable->addCell($image, '25%', 'center', 'center', 'userbizcardleft', 'rowspan="6"');
     $objTable->endRow();
     $objTable->startRow();
     $objTable->addCell('<strong>' . ucfirst(strtolower($emailLabel)) . ':</strong>', '30%', '', '', 'heading', '');
     $objTable->addCell($this->userArray['emailaddress'], '', '', '', 'heading', '');
     $objTable->endRow();
     $objTable->startRow();
     $objTable->addCell('<strong>' . $mobileLabel . ':</strong>', '', '', '', 'heading', '');
     $objTable->addCell($this->userArray['cellnumber'], '', '', '', 'heading', '');
     $objTable->endRow();
     $objTable->startRow();
     $objTable->addCell('<strong>' . $countryLabel . ':</strong>', '', '', '', 'heading', '');
     $objTable->addCell($this->objCountries->getCountryName($this->userArray['country']) . ' ' . $this->objCountries->getCountryFlag($this->userArray['country']), '', '', '', 'heading', '');
     $objTable->endRow();
     $objTable->startRow();
     $objTable->addCell('<strong>' . $genderLabel . ':</strong>', '', '', '', 'heading', '');
     $objTable->addCell($gender, '', '', '', 'heading', '');
     $objTable->endRow();
     $string = $objTable->show();
     $objFieldset = new fieldset();
     $objFieldset->legend = $heading;
     $objFieldset->contents = $string;
     $objFieldset->width = '500px';
     $fieldset = $objFieldset->show();
     return $fieldset;
 }
 /**
  * Method to generate an edit context settings form
  * @param array $context Current Context Settings
  * @return str
  */
 public function editContextForm($context)
 {
     $header = new htmlheading();
     $header->type = 1;
     $header->str = $this->objLanguage->languageText('word_edit', 'system', 'Edit') . ': ' . $context['title'];
     $str = $header->show();
     $title = new textinput('title');
     $title->size = 50;
     if ($context != NULL) {
         $title->value = htmlentities($context['title']);
     }
     $titleLabel = new label($this->objLanguage->languageText('word_title', 'system', 'Title'), 'input_title');
     $status = new dropdown('status');
     //$status->setBreakSpace('<br />');
     $status->addOption('Published', $this->objLanguage->languageText('word_published', 'system', 'Published'));
     $status->addOption('Unpublished', $this->objLanguage->languageText('word_unpublished', 'system', 'Unpublished'));
     if ($context != NULL) {
         $status->setSelected($context['status']);
     }
     if ($this->objSysConfig->getValue('context_access_private_only', 'context', 'false') == 'true') {
         if (is_null($context)) {
             $access_ = 'Private';
         } else {
             $access_ = $context['access'];
         }
         $access = new hiddeninput('access', $access_);
     } else {
         $access = new radio('access');
         $access->setBreakSpace('<br />');
         $access->addOption('Public', '<strong>' . $this->objLanguage->languageText('word_public', 'system', 'Public') . '</strong> - <span class="caption">' . ucfirst($this->objLanguage->code2Txt('mod_context_publiccontextdescription', 'context', NULL, '[-context-] can be accessed by all users, including anonymous users')) . '</span>');
         $access->addOption('Open', '<strong>' . $this->objLanguage->languageText('word_open', 'system', 'Open') . '</strong> - <span class="caption">' . ucfirst($this->objLanguage->code2Txt('mod_context_opencontextdescription', 'context', NULL, '[-context-] can be accessed by all users that are logged in')) . '</span>');
         $access->addOption('Private', '<strong>' . $this->objLanguage->languageText('word_private', 'system', 'Private') . '</strong> - <span class="caption">' . $this->objLanguage->code2Txt('mod_context_privatecontextdescription', 'context', NULL, 'Only [-context-] members can enter the [-context-]') . '<span class="caption">');
         if ($context != NULL) {
             $access->setSelected($context['access']);
         } else {
             $access->setSelected('Public');
         }
     }
     $table = $this->newObject('htmltable', 'htmlelements');
     if ($context != NULL) {
         $table->startRow();
         $table->addCell(ucwords($this->objLanguage->code2Txt('mod_context_contextcode', 'context', NULL, '[-context-] Code')) . ':', 100);
         $table->addCell('<strong>' . $context['contextcode'] . '</strong>');
         $table->endRow();
     } else {
         $code = new textinput('contextcode');
         $codeLabel = new label(ucwords($this->objLanguage->code2Txt('mod_context_contextcode', 'context', NULL, '[-context-] Code')), 'input_contextcode');
         $table->startRow();
         $table->addCell($codeLabel->show(), 100);
         $table->addCell($code->show() . ' <span id="contextcodemessage"></span>');
         $table->endRow();
     }
     $table->startRow();
     $table->addCell($titleLabel->show() . ':');
     $table->addCell($title->show());
     $table->endRow();
     $table->startRow();
     $table->addCell('&nbsp;');
     $table->addCell('&nbsp;');
     $table->endRow();
     $table->startRow();
     $table->addCell($this->objLanguage->languageText('word_status', 'system', 'Status') . ':');
     $table->addCell($status->show());
     $table->endRow();
     if ($this->objSysConfig->getValue('context_access_private_only', 'context', 'false') == 'false') {
         $table->startRow();
         $table->addCell($this->objLanguage->languageText('word_access', 'system', 'Access') . ':');
         $table->addCell($access->show());
         $table->endRow();
     }
     $alerts = explode("|", $context['alerts']);
     $emailAlert = new checkbox('emailalertopt', $this->objLanguage->languageText('mod_contextadmin_emailalert', 'contextadmin', 'Email alerts'), $alerts[0] == 'e' || $alerts[0] == '1');
     // this will checked
     //$alerts=array();
     //$emailchecked=;
     //$emailAlert->setChecked(FALSE);
     //if($emailchecked) {
     //    $emailAlert->setChecked($emailchecked);
     //}
     $table->startRow();
     $table->addCell($this->objLanguage->languageText('mod_contextadmin_emailalert', 'contextadmin', 'Alerts'));
     $table->addCell($emailAlert->show());
     $table->endRow();
     $objSelectImage = $this->getObject('selectimage', 'filemanager');
     $objSelectImage->context = TRUE;
     $table2 = $this->newObject('htmltable', 'htmlelements');
     $table2->startRow();
     $table2->addCell($table->show(), 600, NULL, NULL, NULL, 'colspan="2"');
     $table2->addCell($objSelectImage->show());
     $table2->endRow();
     $table2->startRow();
     $table2->addCell('&nbsp;');
     $table2->addCell('&nbsp;');
     $table2->addCell('&nbsp;');
     $table2->endRow();
     $table2->startRow();
     $table2->addCell(ucwords($this->objLanguage->code2Txt('mod_context_aboutcontext', 'context', NULL, 'About [-context-]')) . ':', 100);
     $htmlEditor = $this->newObject('htmlarea', 'htmlelements');
     $htmlEditor->name = 'about';
     $htmlEditor->toolbarSet = 'advanced';
     if ($context != NULL) {
         $htmlEditor->value = $context['about'];
     }
     $table2->addCell($htmlEditor->show(), NULL, NULL, NULL, NULL, 'colspan="2"');
     $table2->endRow();
     $table2->startRow();
     $table2->addCell('&nbsp;');
     $table2->addCell('&nbsp;');
     $table2->addCell('&nbsp;');
     $table2->endRow();
     $table2->startRow();
     $table2->addCell('&nbsp;', 100);
     if ($context == NULL) {
         $button = new button('savecontext', $formButton);
     } else {
         $button = new button('savecontext', ucwords($this->objLanguage->code2Txt('mod_context_updatecontext', 'context', NULL, 'Update [-context-]')));
     }
     $button->setToSubmit();
     $table2->addCell($button->show(), NULL, NULL, NULL, NULL, 'colspan="2"');
     $table2->endRow();
     $form = new form('createcontext', $this->uri(array('action' => $this->formAction), $this->formModule));
     $form->addToForm($table2->show());
     if ($this->objSysConfig->getValue('context_access_private_only', 'context', 'false') == 'true') {
         $form->addToForm($access->show());
     }
     if ($context != NULL) {
         $hiddenInput = new hiddeninput('contextcode', $context['contextcode']);
         $form->addToForm($hiddenInput->show());
     }
     $form->addRule('title', $this->objLanguage->code2Txt('mod_context_entertitleofcontext', 'context', NULL, 'Please enter the title of your [-context-]'), 'required');
     $str .= $form->show();
     return $str;
 }
Example #6
0
    $tabContent->addTab(array('name' => $this->objLanguage->languageText('mod_filemanager_embedcode', 'filemanager', 'Embed Code'), 'content' => $embedCode));
}
$fileInfo = $this->objLanguage->languageText('mod_filemanager_fileinfo', 'filemanager', 'File Information');
$fileInfoContent = '<h2>' . $fileInfo . '</h2>' . $this->objFiles->getFileInfoTable($file['id']);
if (array_key_exists('width', $file)) {
    $mediaInfo = $this->objLanguage->languageText('mod_filemanager_mediainfo', 'filemanager', 'Media Information');
    $fileInfoContent .= '<br /><h2>' . $mediaInfo . '</h2>' . $this->objFiles->getFileMediaInfoTable($file['id']);
}
$tabContent->addTab(array('name' => $fileInfo, 'content' => $fileInfoContent));
if ($folderPermission) {
    $fileAccess = $this->getObject("folderaccess", "filemanager");
    $tabContent->addTab(array('name' => $this->objLanguage->languageText('mod_filemanager_access', 'filemanager', 'Access'), 'content' => $fileAccess->createFileAccessControlForm($file['id']) . '<br/>' . $fileAccess->createFileVisibilityForm($file['id'])));
}
echo $tabContent->show();
if ($file['category'] == 'archives' && $file['datatype'] == 'zip') {
    $folderParts = explode('/', $file['filefolder']);
    //getTree($folderType='users', $id, $treeType='dhtml', $selected='')
    //get the archive file id
    $archiveId = $this->getParam('id');
    $form = new form('extractarchive', $this->uri(array('action' => 'extractarchive', 'id' => $archiveId)));
    $form->addToForm($this->objLanguage->languageText('mod_filemanager_extractarchiveto', 'filemanager', 'Extract Archive to') . ': ' . $this->objFolders->getTree($folderParts[0], $folderParts[1], 'htmldropdown', $folderId));
    $button = new button('submitform', $this->objLanguage->languageText('mod_filemanager_extractfiles', 'filemanager', 'Extract Files'));
    $button->setToSubmit();
    $form->addToForm($button->show());
    $hiddeninput = new hiddeninput('file', $file['id']);
    $form->addToForm($hiddeninput->show());
    echo $form->show();
}
// echo '<h3>'.$this->objLanguage->languageText('mod_filemanager_filehistory', 'filemanager', 'File History').'</h3>';
// echo $this->objFiles->getFileHistory($file['id']);
echo '<p><br />' . $link->show() . ' ' . $link2->show() . '</p>';
 /**
  * Method to process Error Upload Messages
  * @return string Confirmation message of error uploads
  */
 public function processOverwriteMessages()
 {
     if ($this->getParam('overwrite') == '') {
         $overwriteMessage = '';
     } else {
         $items = explode('__', $this->getParam('overwrite'));
         $overwriteMessage = '';
         $table = $this->newObject('htmltable', 'htmlelements');
         $table->startHeaderRow();
         $table->addHeaderCell('Filename');
         $table->addHeaderCell('File Size of Existing File', NULL, NULL, 'center');
         $table->addHeaderCell('File Size of New File', NULL, NULL, 'center');
         $table->addHeaderCell('Overwrite File?', NULL, NULL, 'center');
         $table->endHeaderRow();
         $actualItems = array();
         $formatsize = new formatfilesize();
         foreach ($items as $item) {
             // Get File Details
             $file = $this->objFiles->getFile($item);
             // Generate Path to File
             $tempFilePath = $this->objConfig->getcontentBasePath() . '/filemanager_tempfiles/' . $item;
             // Create Boolean Variable - does file exist
             if (file_exists($tempFilePath)) {
                 $tempFileExists = TRUE;
             } else {
                 $tempFileExists = FALSE;
             }
             // If no record
             if ($file == FALSE) {
                 // Delete temp file if it exists
                 if ($tempFileExists && is_file($tempFilePath)) {
                     unlink($tempFilePath);
                 }
             } else {
                 if ($file && $tempFileExists) {
                     // If Record and Temp File exists
                     // Add to Form for User to choose option
                     $actualItems[] = $item;
                     $table->startRow();
                     $table->addCell('<strong>' . $file['filename'] . '</strong>');
                     $table->addCell($formatsize->formatsize($file['filesize']), NULL, NULL, 'center');
                     $table->addCell($formatsize->formatsize(filesize($tempFilePath)), NULL, NULL, 'center');
                     $radio = new radio($item);
                     $radio->addOption('delete', ' No');
                     $radio->addOption('overwrite', ' Yes');
                     $radio->setSelected('delete');
                     $radio->setBreakSpace(' &nbsp; ');
                     $table->addCell($radio->show(), NULL, NULL, 'center');
                     $table->endRow();
                 }
             }
         }
         if (count($actualItems) > 0) {
             $form = new form('overwriteoptions', $this->uri(array('action' => 'fixtempfiles')));
             $form->addToForm($table->show());
             $list = '';
             $separator = '';
             foreach ($actualItems as $itemId) {
                 $list .= $separator . $itemId;
                 $separator = '__';
             }
             $hiddenInput = new hiddeninput('listitems', $list);
             $form->addToForm($hiddenInput->show());
             $overMsg = $this->objLanguage->languageText('mod_filemanager_overwriteconfirm', 'filemanager', 'Do you wish to overwrite?');
             $button = new button('submitform', $overMsg);
             $button->setToSubmit();
             $form->addToForm($button->show());
             $overwriteMessage = $form->show();
         }
     }
     return $overwriteMessage;
 }
 /**
  * Method to show the file selector input
  * @return string File Selector
  */
 public function show($context = "no")
 {
     $this->appendArrayVar('headerParams', $this->showClearInputJavaScript());
     if ($this->defaultFile == '') {
         $defaultId = '';
         $defaultName = '';
         $defaultPath = NULL;
     } else {
         $file = $this->objFile->getFile($this->defaultFile);
         if ($file == FALSE) {
             $defaultId = '';
             $defaultName = '';
             $defaultPath = NULL;
         } else {
             $defaultId = $file['id'];
             $defaultName = $file['filename'];
             $defaultPath = $file['path'];
         }
     }
     $input = new hiddeninput($this->name, $defaultId);
     $input->extra = ' id="hidden_' . $this->name . '"';
     $objPop = new windowpop();
     if ($this->context == '') {
         $context = 'no';
     } else {
         $context = 'yes';
     }
     if ($this->workgroup) {
         $workgroup = 'yes';
     } else {
         $workgroup = 'no';
     }
     $location = $this->uri(array('mode' => 'selectimagewindow', 'restriction' => 'jpg____gif____png____jpeg', 'name' => $this->name, 'context' => $context, 'workgroup' => $workgroup), 'filemanager');
     // Couldnt do this via uri function due to embedded JS
     $location .= '&amp;value=\'+document.getElementById(\'hidden_' . $this->name . '\').value+\'&amp;';
     $objPop->set('location', $location);
     $this->objIcon->setIcon('find_file');
     $this->objIcon->alt = 'Select File';
     $this->objIcon->title = 'Select File';
     $objPop->set('linkType', 'button');
     $objPop->set('linktext', 'Select File');
     //$objPop->set('linktext', $this->objIcon->show());
     $objPop->set('width', '750');
     $objPop->set('height', '500');
     $objPop->set('resizable', 'yes');
     $objPop->set('scrollbars', 'yes');
     $objPop->set('left', '50');
     $objPop->set('top', '100');
     $objPop->set('status', 'yes');
     //leave the rest at default values
     $objPop->putJs();
     if ($defaultId == '') {
         $this->objIcon->setIcon('imagepreview');
         $this->objIcon->alt = 'Image Preview';
         $this->objIcon->title = 'Image Preview';
         $this->objIcon->extra = ' id="imagepreview_' . $this->name . '" class="ImagePreview"';
         $previewImg = $this->objIcon->show();
     } else {
         $img = $this->objThumbnails->getThumbnail($defaultId, $file['filename'], $defaultPath);
         $previewImg = '<img src="' . $img . '" id="imagepreview_' . $this->name . '" class="ImagePreview"/>';
     }
     $textinput = new textinput('selectfile_' . $this->name, $defaultName);
     $textinput->setId('selectfile_' . $this->name);
     $textinput->extra = ' readonly="true" style="width:' . $this->widthOfInput . '";height="50" ';
     $button = new button('clear', 'Reset', 'clearFileInputJS(\'' . $this->name . '\');');
     // Option for showing via submodal window
     // $objSubModalWindow = $this->getObject('submodalwindow', 'htmlelements');
     // $subModal = $objSubModalWindow->show('Select', $location, 'button');
     // return $input->show().$textinput->show().' &nbsp; '.$subModal.$button->show();
     return $input->show() . '<div class="ImagePreviewArea">' . $previewImg . '</div><br /><div>' . $objPop->show() . ' ' . $button->show() . '</div>';
     //$textinput->show()
 }
 /**
  * Method to show the file input
  *
  * Remember to add $form->extra = 'enctype="multipart/form-data"'; to the form
  * @return string
  */
 public function show()
 {
     $input = new textinput($this->name);
     $input->fldType = 'file';
     $input->cssClass = '';
     $input->size = '50';
     $objLanguage = $this->getObject('language', 'language');
     $objFolder = $this->getObject('dbfolder');
     $this->objContext = $this->getObject('dbcontext', 'context');
     $this->contextCode = $this->objContext->getContextCode();
     $tree = "";
     $targetDirLabel = "";
     if ($this->showTargetDir) {
         if ($this->targetDirMode == TARGETDIRMODE_USER) {
             $tree = $objFolder->getTree('users', $this->objUser->userId(), 'htmldropdown');
         } else {
             if ($this->targetDirMode == TARGETDIRMODE_CONTEXT && $this->contextCode != '') {
                 $tree = $objFolder->getTree('context', $this->contextCode, 'htmldropdown');
             } else {
                 $tree = '';
             }
         }
         $targetDirLabel = $objLanguage->languageText('mod_filemanager_saveuploadfilein', 'filemanager', 'Save Uploaded File in') . ':';
     }
     $objQuotas = $this->getObject('dbquotas');
     $maxFileSize = new hiddeninput('MAX_FILE_SIZE', $objQuotas->getRemainingSpaceUser($this->objUser->userId()));
     $restrict = '';
     $restrictStr = '';
     if (count($this->restrictFileList) > 0) {
         $divider = '';
         $comma = '';
         foreach ($this->restrictFileList as $restriction) {
             $restrict .= $divider . $restriction;
             $restrictStr .= $comma . $restriction;
             $divider = '___';
             $comma = ', ';
         }
         $restrictInput = new hiddeninput('restrictions__' . $this->name, $restrict);
         $restrict = $restrictInput->show();
         $restrictStr = ' (' . $restrictStr . ')';
     }
     return $maxFileSize->show() . $input->show() . $restrictStr . '<br /> ' . $targetDirLabel . ' ' . $tree . $restrict;
 }
 /**
  * Method to generate a context search form
  */
 public function searchForm()
 {
     $this->loadClass('form', 'htmlelements');
     $this->loadClass('textinput', 'htmlelements');
     $this->loadClass('button', 'htmlelements');
     $this->loadClass('hiddeninput', 'htmlelements');
     $form = new form('contextsearch', $this->uri(array('action' => 'search'), 'context'));
     $form->method = 'GET';
     $module = new hiddeninput('module', 'context');
     $action = new hiddeninput('action', 'search');
     $form->addToForm($module->show() . $action->show());
     $textinput = new textinput('search', $this->getParam('search'));
     $button = new button('searchButton', ucwords($this->objLanguage->code2Txt('mod_context_searchcontext', 'context', NULL, 'Search [-context-]')));
     $button->setIconClass("search");
     $button->setToSubmit();
     $form->addToForm('<p align="center">' . $textinput->show() . '<br />' . $button->show() . '</p>');
     return $form->show();
 }
 /**
  * this creates the visibility control field
  * @param type $id
  * @return type 
  */
 function createFileVisibilityForm($id)
 {
     $dbFile = $this->getObject("dbfile", "filemanager");
     $file = $dbFile->getFile($id);
     $form = new form('visibilityform', $this->uri(array('action' => 'setfilevisibility', 'id' => $id)));
     $visibleTxt = $this->objLanguage->languageText('mod_filemanager_visible', 'filemanager');
     $hiddenTxt = $this->objLanguage->languageText('mod_filemanager_hidden', 'filemanager');
     $legend = $this->objLanguage->languageText('mod_filemanager_visibility', 'filemanager');
     $objElement = new radio('access_radio');
     $objElement->addOption('visible', $visibleTxt . '<br/>');
     $objElement->addOption('hidden', $hiddenTxt . '<br/>');
     $access = $file['visibility'] == NULL ? 'visible' : $file['visibility'];
     $objElement->setSelected($access);
     $applyButton = new button('apply', $this->objLanguage->languageText('mod_filemanager_apply', 'filemanager'));
     $applyButton->setToSubmit();
     $fieldset = new fieldset();
     $fieldset->setLegend($legend);
     $fieldset->addContent($objElement->show() . '<br/>' . $applyButton->show());
     $hiddeninput = new hiddeninput('id', $id);
     $form->addToForm($hiddeninput->show());
     $form->addToForm($fieldset->show());
     $content = $form->show();
     $objModule = $this->getObject('modules', 'modulecatalogue');
     //See if the simple map module is registered and set a param
     $isRegistered = $objModule->checkIfRegistered('digitallibrary');
     if ($isRegistered) {
         $dlfieldset = new fieldset();
         $dlfieldset->setLegend("Link to digital library");
         $link = new link($this->uri(array("action" => "linkfromfilemanager", "fileid" => $id), "digitallibrary"));
         $link->link = "<strong>Link this file</>";
         $dlfieldset->addContent($link->show());
         $content .= $dlfieldset->show();
     }
     return $content;
 }
 /**
  *
  * Render a login box
  *
  * @param string $module The module we are in or will go to
  * @param boolean $ajaxLogin Whether or not to do ajax login
  * @return string The login box
  * @access public
  *
  */
 public function renderLoginBox($module = NULL, $ajaxLogin = FALSE)
 {
     try {
         // Determine if we need to use https
         $useHTTPS = $this->objSysConfig->getValue('MOD_SECURITY_HTTPS', 'security');
         // Set the formaction depending on whether it is going to use ajax or not.
         if (!$ajaxLogin) {
             // Set the action for the login form depending on if there is a module or not.
             if ($module != NULL) {
                 $formAction = $this->uri(array('action' => 'login', 'mod' => $module), 'security');
             } else {
                 $formAction = $this->uri(array('action' => 'login'), 'login');
             }
             if ($useHTTPS == '1' || $useHTTPS == 'TRUE') {
                 $formAction = str_replace("http:", "https:", $formAction);
             }
         } else {
             // We want an ajax login.
             $formAction = 'javascript:void(0);';
         }
         // Create a Form object.
         $objForm = new form('loginform', $formAction);
         $objFields = new fieldset();
         $objFields->setLegend(' ');
         //--Create an element for the username
         $objInput = new textinput('username', '', 'text', '15');
         $objInput->extra = 'maxlength="255"';
         $objInput->setCss('required minlength(2)');
         $objLabel = new label($this->objLanguage->languageText('word_username') . ': ', 'input_username');
         //Add the username box to the form
         $objFields->addContent($objLabel->show() . '<br />');
         $objFields->addContent($objInput->show() . '<br />');
         //--- Create an element for the password
         $objInput = new textinput('password', '', 'password', '15');
         $objInput->extra = 'maxlength="255"';
         $objInput->setCss('required');
         $objLabel = new label($this->objLanguage->languageText('word_password') . ': ', 'input_password');
         $objFields->addContent($objLabel->show() . '<br />');
         $objFields->addContent($objInput->show());
         //--- Create an element for the network login radio
         $objElement = new checkbox("useLdap");
         $objElement->setCSS("transparentbgnb");
         $objElement->label = $this->objLanguage->languageText("phrase_networkid") . ' ';
         $ldap = '';
         $objSysConfig = $this->getObject('dbsysconfig', 'sysconfig');
         $showLDAPCheckBox = $objSysConfig->getValue('show_ldap_checkbox', 'security');
         // Get a nonce
         $objNonce = $this->getObject('nonce', 'login');
         $nonce = $objNonce->storeNonce();
         // Create a hidden field for the nonce
         $objNonce = new hiddeninput('nonce', $nonce);
         $objNonce->extra = ' id=\'nonce\'';
         $nonce = $objNonce->show();
         //----------------------------------------------------------------------------------------Checking this is a violation of the principle of chain of responsiblity @todo fix it
         if ($this->objConfig->getuseLDAP() && $showLDAPCheckBox == 'true') {
             $ldap .= $objElement->label . ' ' . $objElement->show();
         }
         //--- Create an element for the remember me checkbox
         $objRElement = new checkbox("remember");
         $objRElement->setCSS("transparentbgnb noborder");
         $objRElement->label = $this->objLanguage->languageText("phrase_rememberme", "security");
         $rem = $objRElement->show() . "<br />";
         //--- Create a submit button
         $objButton = new button('submit', $this->objLanguage->languageText("word_login"));
         // Add the login icon
         $objButton->setIconClass("user");
         // Set the button type to submit
         $objButton->setToSubmit();
         // Give the button an ID for jQuery to grab.
         $objButton->setId('loginButton');
         // Add the button to the form ----------------------------------------------------------- Note LDAP breaks the COR pattern
         $objFields->addContent($ldap . '<br />' . $nonce . $rem . "<div class='loginbuttonwrap'>" . $objButton->show() . '</div>');
         $helpText = strtoupper($this->objLanguage->languageText('word_help', 'system'));
         $helpIcon = $this->objHelp->show('register', 'useradmin', $helpText);
         $resetLink = new Link($this->uri(array('action' => 'needpassword'), 'security'));
         $resetLink->link = $this->objLanguage->languageText('mod_security_forgotpassword');
         // the help link
         $p = '<br/>' . $resetLink->show() . '<br />' . $helpIcon;
         $objFields->addContent($p);
         $objForm->addToForm($objFields->show());
         return '<div id="login_block_wrapper">' . $objForm->show() . '</div>';
     } catch (Exception $e) {
         customException::cleanUp();
     }
 }
Example #13
0
 /**
  * This is a method to display the CAPTCHA images
  *
  */
 function show()
 {
     // Creat an array
     $CAPTCHA_INIT = array('tempfolder' => $this->tempFolder, 'localfolder' => $this->localFolder, 'TTF_folder' => $this->getResourcePath('captcha/'), 'TTF_RANGE' => $this->fonts, 'chars' => $this->numChars, 'minsize' => $this->minFontSize, 'maxsize' => $this->maxFontSize, 'maxrotation' => $this->maxRotation, 'noise' => $this->useNoise, 'websafecolors' => $this->useWebSafeColors, 'lang' => 'en', 'maxtry' => 9, 'badguys_url' => '/', 'secretstring' => 'A very, very secret string which is used to generate a md5-key!', 'secretposition' => 15, 'debug' => $this->debug);
     $captcha =& new hn_captcha($CAPTCHA_INIT);
     $image = $captcha->display_captcha(TRUE);
     $hiddenInput = new hiddeninput($this->name, md5(strtoupper($captcha->private_key)));
     $publicKey = new hiddeninput($this->name . '_publickey', $captcha->public_key);
     return $image . $hiddenInput->show() . $publicKey->show();
 }
 /**
  * Method to show the interface for overwriting files
  */
 public function showUserOverwiteInterface()
 {
     $userId = $this->objUser->userId();
     $tempFiles = $this->objFile->getTemporaryFiles($userId);
     $form = new form('fixtempfiles', $this->uri(array('action' => 'fixtempfiles')));
     $divider = '';
     $splitter = '';
     $listItems = '';
     $submitButton = new button('submitform', 'Update Files');
     $submitButton->setToSubmit();
     $objHighlightLabels = $this->getObject('highlightlabels', 'htmlelements');
     $objHighlightLabels->show();
     $formatsize = new formatfilesize();
     foreach ($tempFiles as $file) {
         //$form->addToForm($divider);
         //$divider = '<hr size="1" width="70%" />';
         $listItems .= $splitter . $file['id'];
         $splitter = '|';
         // Rename Id of the button to keep them unique
         $submitButton->cssId = 'input_button_' . $file['id'];
         $originalFile = $this->objFile->getOriginalFile($file['filename'], $userId);
         $form->addToForm('<h2>' . $file['filename'] . '</h2>');
         $table = $this->newObject('htmltable', 'htmlelements');
         $table->startHeaderRow();
         $table->addHeaderCell('Info', '20%');
         $table->addHeaderCell('Old File', '40%');
         $table->addHeaderCell('New File', '40%');
         $table->endHeaderRow();
         if ($originalFile['category'] == 'images') {
             $oldThumbnail = $this->objFileEmbed->embed($this->objThumbnails->getThumbnail($originalFile['id'], $originalFile['filename']), 'image');
             $newThumbnail = $this->objFileEmbed->embed($this->objThumbnails->getThumbnail($file['id'], $file['filename']), 'image');
             // File Preview
             $table->startRow();
             $table->addCell('File Preview');
             $table->addCell($oldThumbnail);
             $table->addCell($newThumbnail);
             $table->endRow();
         } else {
             $oldThumbnail = 'gdsgsd';
             $newThumbnail = 'gdsgsd';
         }
         // File Size
         $table->startRow();
         $table->addCell('Size of File');
         $table->addCell($formatsize->formatsize($originalFile['filesize']));
         $table->addCell($formatsize->formatsize($file['filesize']));
         $table->endRow();
         // Date Uploaded
         $table->startRow();
         $table->addCell('Date Uploaded');
         $table->addCell($this->objFormatDateTime->formatDateOnly($originalFile['datecreated']) . ' at ' . $this->objFormatDateTime->formatTime($originalFile['timecreated']));
         $table->addCell($this->objFormatDateTime->formatDateOnly($file['datecreated']) . ' at ' . $this->objFormatDateTime->formatTime($file['timecreated']));
         $table->endRow();
         $form->addToForm($table->show());
         $form->addToForm('<h4>Options:</h4>');
         $radio = new radio($file['id']);
         $radio->setBreakSpace('<br />');
         $radio->addOption('ignore', 'Ignore this file for the time being');
         $radio->addOption('overwrite', 'Overwrite old file with new one');
         $radio->addOption('deletetemp', 'Delete the Temporary File');
         $extension = $this->objFileParts->getExtension($file['filename']);
         if (strlen($extension) == strlen($file['filename'])) {
             $filename = $file['filename'];
             $extension = '';
         } else {
             $filename = substr($file['filename'], 0, strlen($file['filename']) - strlen($extension) - 1);
             $extension = '.' . $extension;
         }
         $textinput = new textinput('rename__' . $file['id'], $filename);
         $textinput->size = 50;
         $extensioninput = new textinput('extension__' . $file['id'], $extension);
         $extensioninput->size = 5;
         $extensioninput->extra = ' readonly="true"';
         // Fix Up - Highlight Radio Button
         //$textinput->extra = ' onclick="document.getElementById(\'input_gen19Srv1Nme34_247ignore\').focus();"; ';
         //$radio->addOption('rename', 'Rename the temporary file to: ');
         $radio->setSelected('ignore');
         //$form->addToForm($radio->show().$textinput->show().$extensioninput->show());
         $form->addToForm($radio->show());
         $form->addToForm('<p align="center">' . $submitButton->show() . '</p>');
     }
     $hiddenInput = new hiddeninput('listitems', $listItems);
     $form->addToForm($hiddenInput->show());
     return $form->show();
 }
$objLayer = new layer();
$objLayer->position = 'absolute; top: 60px; right: 10px; bottom: 110px; left: 10px';
$objLayer->zIndex = '2; overflow-y:scroll; overflow-x:hidden';
$objLayer->addToStr($string);
$str .= $objLayer->show();
$objHeading = new htmlheading();
$objHeading->str = $uploadFile;
$objHeading->type = 1;
$string = $objHeading->show();
$this->objUpload->formaction = $this->uri(array('action' => 'selectfileuploads'));
$this->objUpload->numInputs = 1;
$mode = new hiddeninput('mode', 'selectimagewindow');
$name = new hiddeninput('name', $this->getParam('name'));
$context = new hiddeninput('context', $this->getParam('context'));
$workgroup = new hiddeninput('workgroup', $this->getParam('workgroup'));
$restrict = new hiddeninput('restrict', $this->getParam('restrict'));
$value = new hiddeninput('value', $this->getParam('value'));
$this->objUpload->formExtra = $mode->show() . $name->show() . $context->show() . $workgroup->show() . $value->show() . $restrict->show();
$string .= $this->objUpload->show();
$objLayer = new layer();
$objLayer->position = 'absolute; left: 10px; right: 10px; bottom: 10px';
$objLayer->height = '105px';
$objLayer->zIndex = '3';
$objLayer->addToStr($string);
$str .= $objLayer->show();
$objLayer = new layer();
$objLayer->cssClass = "featurebox";
$objLayer->position = 'absolute; top: 0px; right: 0px; bottom: 0px; left: 0px';
$objLayer->zIndex = '100';
$objLayer->addToStr($str);
echo $objLayer->show();
<?php

$this->loadClass('link', 'htmlelements');
$this->loadClass('form', 'htmlelements');
$this->loadClass('textinput', 'htmlelements');
$this->loadClass('hiddeninput', 'htmlelements');
$this->loadClass('button', 'htmlelements');
$this->loadClass('htmlheading', 'htmlelements');
$searchForm = new form('filesearch', $this->uri(array('action' => 'search')));
$searchForm->method = 'GET';
$hiddenInput = new hiddeninput('module', 'filemanager');
$searchForm->addToForm($hiddenInput->show());
$hiddenInput = new hiddeninput('action', 'search');
$searchForm->addToForm($hiddenInput->show());
$textinput = new textinput('filequery', $this->getParam('filequery'));
$searchForm->addToForm($textinput->show());
$button = new button('search', $this->objLanguage->languageText('word_search', 'system', 'Search'));
$button->setToSubmit();
$searchForm->addToForm($button->show());
// Create an Instance of the CSS Layout
$cssLayout = $this->newObject('csslayout', 'htmlelements');
$objFolders = $this->getObject('dbfolder');
$objQuotas = $this->getObject('dbquotas');
$header = new htmlheading();
$header->type = 2;
$header->str = $this->objLanguage->languageText('mod_filemanager_name', 'filemanager', 'File Manager');
$leftColumn = $header->show();
$tagCloudLink = new link($this->uri(array('action' => 'tagcloud')));
$tagCloudLink->link = 'Tag Cloud';
$leftColumn .= $searchForm->show() . '<ul><li>' . $tagCloudLink->show() . '</li>';
if ($objUser->isAdmin()) {
Example #17
0
    $folderCounter = 0;
    foreach ($files as $file) {
        if (substr($file, 0, 8) == 'folder__') {
            $folderCounter++;
        } else {
            $fileDetails = $this->objFiles->getFile($file);
            if ($fileDetails != FALSE) {
                $counter++;
                $checkbox = new checkbox('files[]', htmlentities($fileDetails['filename']), TRUE);
                $checkbox->value = $file;
                $form->addToForm('<li>' . $checkbox->show() . ' ' . htmlentities($fileDetails['filename']) . '</li>');
            }
        }
    }
    $form->addToForm('</ul>');
    $form->addToForm($this->objFolders->getTree('context', $this->contextCode, 'htmldropdown'));
    $button = new button('submitform', $this->objLanguage->code2Txt('mod_filemanager_attachtocontext', 'filemanager', NULL, 'Attach to [-context-]'));
    $button->setToSubmit();
    $form->addToForm('<br />' . $button->show());
    $folderInput = new hiddeninput('folder', $this->getParam('folder'));
    $this->setVar('folderId', $this->getParam('folder'));
    $form->addToForm($folderInput->show());
    if ($counter > 0) {
        echo '<h1>' . $this->objLanguage->code2Txt('mod_filemanager_attachtocontext', 'filemanager', NULL, 'Attach to [-context-]') . '?</h1>';
        echo '<p>' . $this->objLanguage->languageText('mod_filemanager_selectfolderattachfiles', 'filemanager', 'Please select the folder you would like these files to be placed in') . '</p>';
        echo $form->show();
    } else {
        echo '<h1 class="error">' . $this->objLanguage->languageText('word_error', 'system', 'Error') . ':</h1>';
        echo '<p>xx' . $this->objLanguage->languageText('mod_filemanager_warnfilesnolonger', 'filemanager', 'The files/folders you have attempted to delete no longer exist') . '.</p>';
    }
}
Example #18
0
    $accountTypeRadio->addOption('useradmin', ' Site / Database Authentication');
    $accountTypeRadio->setBreakSpace('<br />');
    $accountTypeRadio->extra = 'onclick="checkAccountType(this.value);"';
    if ($mode == 'addfixup') {
        $accountTypeRadio->setSelected($this->getParam('accounttype'));
    } else {
        if ($user['howcreated'] == 'LDAP') {
            $accountTypeRadio->setSelected('ldap');
        } else {
            $accountTypeRadio->setSelected('useradmin');
        }
    }
    $table->addCell($accountTypeRadio->show());
    $table->endRow();
} else {
    $accountType = new hiddeninput('accounttype', 'useradmin');
    $form->addToForm($accountType->show());
}
// Username
$table->startRow();
$label = new label('Username', 'input_useradmin_username');
$textinput = new textinput('useradmin_username');
$textinput->size = 30;
$textinput->extra = ' maxlength="25"';
$textinput->value = $user['username'];
$usernameAddition = '';
if ($mode == 'addfixup') {
    $textinput->value = $this->getParam('useradmin_username');
    if ($this->getParam('useradmin_username') == '') {
        $messages[] = 'Username cannot be blank';
    }
 /**
  * Method to show the file selector input
  * @return string File Selector
  */
 public function show()
 {
     $this->appendArrayVar('headerParams', $this->showClearInputJavaScript());
     if ($this->defaultFile == '') {
         $defaultId = '';
         $defaultName = '';
     } else {
         $file = $this->objFile->getFile($this->defaultFile);
         if ($file == FALSE) {
             $defaultId = '';
             $defaultName = '';
         } else {
             $defaultId = $file['id'];
             $defaultName = $file['filename'];
         }
     }
     $input = new hiddeninput($this->name, $defaultId);
     $input->extra = ' id="hidden_' . $this->name . '"';
     if (count($this->restrictFileList) == 0) {
         $ext = '';
     } else {
         $ext = '';
         $divider = '';
         foreach ($this->restrictFileList as $type) {
             $ext .= $divider . $type;
             $divider = '____';
         }
     }
     $forceRestrictions = $this->forceRestrictions ? 'yes' : 'no';
     $objPop = new windowpop();
     if ($this->context) {
         $context = 'yes';
     } else {
         $context = 'no';
     }
     if ($this->workgroup) {
         $workgroup = 'yes';
     } else {
         $workgroup = 'no';
     }
     $location = $this->uri(array('mode' => 'selectfilewindow', 'restriction' => $ext, 'forcerestrictions' => $forceRestrictions, 'name' => $this->name, 'context' => $context, 'workgroup' => $workgroup), 'filemanager');
     // Couldnt do this via uri function due to embedded JS
     $location .= '&amp;value=\'+document.getElementById(\'hidden_' . $this->name . '\').value+\'&amp;';
     $objPop->set('location', $location);
     $this->objIcon->setIcon('find_file');
     $this->objIcon->alt = 'Select File';
     $this->objIcon->title = 'Select File';
     $objPop->set('linktext', $this->objIcon->show());
     $objPop->set('linktext', 'Browse');
     $objPop->set('linkType', 'button');
     $objPop->set('width', '750');
     $objPop->set('height', '500');
     $objPop->set('resizable', 'yes');
     $objPop->set('scrollbars', 'yes');
     $objPop->set('left', '50');
     $objPop->set('top', '100');
     $objPop->set('status', 'yes');
     //leave the rest at default values
     $objPop->putJs();
     $textinput = new textinput('selectfile_' . $this->name, $defaultName);
     $textinput->setId('input_selectfile_' . $this->name);
     $textinput->extra = ' readonly="true" style="width:' . $this->widthOfInput . '" ';
     $button = new button('clear', 'Clear', 'clearFileInputJS(\'' . $this->name . '\');');
     return $input->show() . $textinput->show() . ' ' . $objPop->show() . ' ' . $button->show();
 }
 /**
  * Method to display the navigation
  */
 public function show()
 {
     $str = '';
     $heading = new htmlheading();
     $heading->type = 2;
     $heading->str = ucwords($this->objLanguage->code2Txt('mod_contextadmin_name', 'contextadmin', NULL, '[-context-] Admin'));
     $str = $heading->show();
     $str .= '<ul id="nav-secondary">';
     $mycoursesLink = new link($this->uri(NULL));
     $mycoursesLink->link = ucwords($this->objLanguage->code2Txt('phrase_mycourses', 'system', NULL, 'My [-contexts-]'));
     $str .= '<li>' . $mycoursesLink->show() . '</li>';
     $objUser = $this->getObject('user', 'security');
     if ($objUser->isAdmin() || $objUser->isLecturer()) {
         $createCourse = new link($this->uri(array('action' => 'add')));
         $createCourse->link = ucwords($this->objLanguage->code2Txt('mod_contextadmin_createcontext', 'contextadmin', NULL, 'Create [-context-]'));
         $str .= '<li>' . $createCourse->show() . '</li>';
     }
     $str .= '</ul>';
     $heading = new htmlheading();
     $heading->type = 3;
     $heading->str = ucwords($this->objLanguage->code2Txt('mod_contextadmin_searchforcontext', 'contextadmin', NULL, 'Search for [-context-]'));
     $str .= '<br />' . $heading->show();
     $form = new form('searchform', $this->uri(array('action' => 'search')));
     $form->method = 'GET';
     $module = new hiddeninput('module', $this->getParam('module', 'contextadmin'));
     $action = new hiddeninput('action', 'search');
     $textinput = new textinput('search', $this->getParam('search'));
     $button = new button('searchbutton', $this->objLanguage->languageText('word_search', 'system', 'Search'));
     $button->setToSubmit();
     $form->addToForm($module->show() . $action->show() . $textinput->show() . $button->show());
     $str .= $form->show();
     $heading = new htmlheading();
     $heading->type = 3;
     $heading->str = ucwords($this->objLanguage->code2Txt('phrase_browsecourses', 'system', NULL, 'Browse [-contexts-]'));
     $str .= $heading->show();
     $str .= $this->getAlphaListingTable();
     return $str;
 }