コード例 #1
0
 public function searchForm()
 {
     $this->loadClass('form', 'htmlelements');
     $this->loadClass('textinput', 'htmlelements');
     $this->loadClass('button', 'htmlelements');
     $form = new form('searchfile', $this->uri(array('action' => 'search')));
     $textinput = new textinput('filesearch');
     $button = new button('submitsearch', 'Search');
     $button->setToSubmit();
     $form->addToForm($textinput->show() . ' ' . $button->show());
     return $form->show();
 }
コード例 #2
0
 /**
  * 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 .= '&value=\'+document.getElementById(\'hidden_' . $this->name . '\').value+\'&';
     $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()
 }
コード例 #3
0
 /**
  *
  * Method to parse the string
  * @param  String $str The string to parse
  * @return The    parsed string
  *                
  */
 public function parse($txt)
 {
     preg_match_all('/\\[LIBRARYSEARCH\\](.*)\\[\\/LIBRARYSEARCH\\]/U', $txt, $results, PREG_PATTERN_ORDER);
     preg_match_all('/\\[LIBRARYSEARCH:(.*?)\\]/', $txt, $results2, PREG_PATTERN_ORDER);
     $counter = 0;
     foreach ($results[1] as $item) {
         $objForm = new form('library_search_form', $this->uri(array('action' => 'search'), 'librarysearch'));
         $searchInput = new textinput('search_key');
         $selectCluster = new dropdown('subject_cluster');
         $selectCluster->addOption('database', 'Database');
         $selectCluster->addOption('books', 'Books');
         $selectCluster->addOption('websites', 'Websites');
         $selectCluster->selected = 'websites';
         // Submit Button
         $button = new button('submit_search', $this->objLanguage->languageText('word_search'));
         $button->setToSubmit();
         $objForm->addToForm($searchInput->show() . ' ');
         $objForm->addToForm($selectCluster->show() . ' ');
         $objForm->addToForm($button->show());
         $replacement = $objForm->show();
         $txt = str_replace($results[0][$counter], $replacement, $txt);
         $counter++;
     }
     return $txt;
 }
コード例 #4
0
ファイル: languages_tpl.php プロジェクト: ookwudili/chisimba
$this->loadClass('form', 'htmlelements');
//$this->loadClass('textinput','htmlelements');
//$this->loadClass('dropdown','htmlelements');
$this->loadClass('button', 'htmlelements');
//
$form = new form('language', $this->uri(array('action' => 'downloadpo')));
//$textinput = new textinput('langname','');
$dropdown = $this->newObject('dropdown', 'htmlelements');
$dropdown->name = 'langname';
$langs = $this->objLanguage->languagelist();
//echo '<pre>';
//var_dump($langs);
//var_dump($objLanguageCode->iso_639_2_tags->codes);
//echo '</pre>';
foreach ($langs as $lang) {
    $langName = $lang['languagename'];
    //$_langName = strtolower($langName);
    $langCode = 'unknown';
    foreach ($this->objLanguageCode->iso_639_2_tags->codes as $ISO => $language) {
        if ($langName == $language) {
            $langCode = $ISO;
            break;
        }
    }
    $dropdown->addOption($langCode, $langName);
}
$submit = new button('submit', $this->objLanguage->languageText('word_submit'));
$submit->setToSubmit();
$form->addToForm($this->objLanguage->languageText('mod_modulecatalogue_language', 'modulecatalogue') . ' : ' . $dropdown->show());
$form->addToForm('&nbsp;' . $submit->show());
echo $form->show();
コード例 #5
0
ファイル: fileinfo_tpl.php プロジェクト: ookwudili/chisimba
    $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>';
コード例 #6
0
$objTable->startRow();
$objTable->addCell($objLabel->show());
$objTable->addCell($closeField);
$objTable->endRow();
/*
  $objElement = new checkbox('studentsonly', '', true);  // this will checked
  $check = $objElement->show();
  $objTable->addRow(array(
  $userOptLabel,
  $check
  )); */
$objContextModules = $this->getObject('dbcontextmodules', 'context');
$objModules = $this->getObject('modules', 'modulecatalogue');
$contextModules = $objContextModules->getContextModules($contextCode);
$plugins = $objModules->getListContextPlugins();
$dropDown = new dropdown('moduleid');
//$dropDown->addOption('all','All');
foreach ($plugins as $plugin) {
    $dropDown->addOption($plugin['module_id'], $plugin['title']);
}
if ($action == 'showuseractivitybymodule') {
    $objTable->addRow(array('<b>' . $selectModuleLabel . '</b>', $dropDown->show()));
}
$saveLabel = "View";
$objButton = new button('save', $saveLabel);
$objButton->setToSubmit();
$btnSave = $objButton->show();
$objForm = new form('showuseractivity', $this->uri(array('action' => $action)));
$objForm->addToForm($objTable->show());
$objForm->addToForm($btnSave);
echo $objForm->show();
コード例 #7
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>';
コード例 #8
0
 /**
  * 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;
 }
コード例 #9
0
ファイル: home_tpl.php プロジェクト: ookwudili/chisimba
        $groupDropdown->addOption($groups[$i], $groups[$i]);
    }
    $groupDropdown->setSelected($group);
    $table->addCell($label2->show() . $groupDropdown->show() . "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;" . $label->show() . $courseDropdown->show());
    $table->endRow();
    //Ehb-added-End
    $table->startRow();
    $orderLabel = new label($this->objLanguage->languageText('mod_contextgroups_orderresultsby', 'contextgroups') . ': ', 'input_order');
    $searchdropdown->name = 'order';
    $searchdropdown->cssId = 'input_order';
    //$table->addCell($orderLabel->show().$searchdropdown->show());
    $label = new label($this->objLanguage->languageText('mod_contextgroups_noofresults', 'contextgroups') . ': ', 'input_results');
    $dropdown = new dropdown('results');
    $dropdown->addOption('20', '20');
    $dropdown->addOption('30', '30');
    $dropdown->addOption('50', '50');
    $dropdown->addOption('75', '75');
    $dropdown->addOption('100', '100');
    //$dropdown->addOption('all', 'All Results');
    $table->addCell($orderLabel->show() . $searchdropdown->show() . "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;" . $label->show() . $dropdown->show());
    $table->endRow();
    $button = new button('searchbutton');
    $button->value = $this->objLanguage->languageText('word_search');
    $button->setToSubmit();
    $table->addCell($button->show());
    $table->addCell('&nbsp;');
    $table->endRow();
    $form = new form('searchforusers', $this->uri(array('action' => 'searchforusers')));
    $form->addToForm($table->show());
    echo $form->show();
}
コード例 #10
0
 /**
  * Short description for function
  *
  * Long description (if any) ...
  *
  * @param  unknown $folderId Parameter description (if any) ...
  * @return object  Return description (if any) ...
  * @access public
  */
 function showCreateFolderForm($folderId)
 {
     $folderPath = $this->getFolderPath($folderId);
     if ($folderPath == FALSE) {
         return '';
     }
     $folderParts = explode('/', $folderPath);
     $form = new form('createfolder', $this->uri(array('action' => 'createfolder')));
     $label = new label('Create a subfolder in: ', 'input_parentfolder');
     $form->addToForm($label->show() . '<br/>' . $this->getTree($folderParts[0], $folderParts[1], 'htmldropdown', $folderId));
     $textinput = new textinput('foldername');
     $label = new label('Name of Folder: ', 'input_foldername');
     $form->addToForm('<br/>' . $label->show() . '<br/>' . $textinput->show() . '&nbsp;');
     $button = new button('create', 'Create Folder');
     $button->setToSubmit();
     $form->addToForm('<br/>' . $button->show());
     return $form->show();
 }
コード例 #11
0
ファイル: editperms_tpl.php プロジェクト: ookwudili/chisimba
$conGroups[0] = array('id' => 'Lecturers', 'name' => $authorLabel);
$conGroups[1] = array('id' => 'Students', 'name' => $readonlyLabel);
$conGroups[2] = array('id' => 'Guest', 'name' => $guestLabel);
$objSelectBox->insertLeftOptions($conGroups, 'id', 'name');
$objSelectBox->insertRightOptions(array());
// Insert the selectbox into the form object.
$objHead->str = $conGroupLabel;
$objHead->type = 3;
$objForm->addToForm('<p>' . $objHead->show() . '</p><p>' . $objSelectBox->show() . '</p>');
/* *********** Save and close buttons ************* */
$objButton = new button('save', $saveLabel);
$objButton->setOnClick('submitPerms()');
$btns = '<p><br/>' . $objButton->show();
$objButton = new button('save', $closeLabel);
$objButton->setOnClick('window.close()');
$btns .= '&nbsp;&nbsp;' . $objButton->show() . '</p>';
$objForm->addToForm($btns);
/* ************ Show the form ************* */
$str .= $objForm->show();
/* ************ Restore default permissions ************ */
$objInput = new textinput('modulename', $moduleName);
$objInput->fldType = 'hidden';
$objLink = new link('javascript:void(0)');
$objLink->extra = "onclick=\"restoreDefaults()\"";
$objLink->link = $restoreLabel;
$objForm = new form('restore', $this->uri(array('action' => 'restoreperms')));
$objForm->addToForm($objInput->show());
$objForm->addToForm($objLink->show());
$str .= '<p><br/>' . $objForm->show() . '</p>';
$objLayer = new layer();
$objLayer->str = $str;
コード例 #12
0
$table->endRow();
$fieldset = $this->newObject('fieldset', 'htmlelements');
$fieldset->legend = $this->objLanguage->languageText('phrase_emailaddress', 'system', 'Email Address');
$fieldset->contents = $table->show();
$form->addToForm($fieldset->show());
$form->addToForm('<br />');
$objCaptcha = $this->getObject('captcha', 'utilities');
$captcha = new textinput('request_captcha');
$captchaLabel = new label($this->objLanguage->languageText('phrase_verifyrequest', 'security', 'Verify Request'), 'input_request_captcha');
$fieldset = $this->newObject('fieldset', 'htmlelements');
$fieldset->legend = 'Verify Image';
$fieldset->contents = stripslashes($this->objLanguage->languageText('mod_security_explaincaptcha', 'security', 'To prevent abuse, please enter the code as shown below. If you are unable to view the code, click on "Redraw" for a new one.')) . '<br /><div id="captchaDiv">' . $objCaptcha->show() . '</div>' . $captcha->show() . $required . '  <a href="javascript:redraw();">' . $this->objLanguage->languageText('word_redraw', 'security', 'Redraw') . '</a>';
$form->addToForm($fieldset->show());
$button = new button('submitform', 'Complete Registration');
$button->setToSubmit();
$form->addToForm('<p align="center"><br />' . $button->show() . '</p>');
if ($mode == 'addfixup') {
    foreach ($problems as $problem) {
        $messages[] = $this->explainProblemsInfo($problem);
    }
}
if ($mode == 'addfixup' && count($messages) > 0) {
    echo '<ul><li><span class="error">' . $this->objLanguage->languageText('mod_userdetails_infonotsavedduetoerrors', 'userdetails') . '</span>';
    echo '<ul>';
    foreach ($messages as $message) {
        if ($message != '') {
            echo '<li class="error">' . $message . '</li>';
        }
    }
    echo '</ul></li></ul>';
}
コード例 #13
0
 /**
  *
  * Method to display the user image
  * 
  * @access public
  * @return string $string The html string for display 
  */
 public function showUserImage()
 {
     $updateLabel = $this->objLanguage->languageText('phrase_updateimage', 'system', 'ERROR: phrase_updateimage');
     $errorTitleLabel = $this->objLanguage->languageText('word_error', 'system', 'ERROR: word_error');
     $successTitleLabel = $this->objLanguage->languageText('word_success', 'system', 'ERROR: word_success');
     $successLabel = $this->objLanguage->languageText('mod_userdetails_userimagechanged', 'userdetails', 'ERROR: mod_userdetails_userimagechanged');
     $errorNoFileLabel = $this->objLanguage->languageText('mod_userdetails_imagedoesnotexist', 'userdetails', 'ERROR: mod_userdetails_imagedoesnotexist');
     $errorNoImageLabel = $this->objLanguage->languageText('mod_userdetails_noimageprovided', 'userdetails', 'ERROR: mod_userdetails_noimageprovided');
     $errorNotImageLabel = $this->objLanguage->languageText('mod_userdetails_filenotimage', 'userdetails', 'ERROR: mod_userdetails_filenotimage');
     $objSelectFile = $this->newObject('selectimage', 'filemanager');
     $objSelectFile->name = 'imageselect';
     $objSelectFile->restrictFileList = array('jpg', 'gif', 'png', 'jpeg', 'bmp');
     $image = $objSelectFile->show();
     $objButton = new button('update', $updateLabel);
     $objButton->setId('update_image');
     $updateButton = $objButton->show();
     $objForm = new form('user_image', $this->uri(array('action' => 'ajaxChangeImage'), 'userdetails'));
     $objForm->extra = ' enctype="multipart/form-data"';
     $objForm->addToForm($image . '<br />' . $updateButton);
     $imageForm = $objForm->show();
     $string = $imageForm;
     $this->objDialog = $this->newObject('dialog', 'jquerycore');
     $this->objDialog->setCssId('dialog_imagechanged');
     $this->objDialog->setTitle(ucwords($successTitleLabel));
     $this->objDialog->setCloseOnEscape(FALSE);
     $this->objDialog->setContent('<span class="success">' . $successLabel . '</span>');
     $this->objDialog->setAutoOpen(FALSE);
     $this->objDialog->setOpen("jQuery('.ui-dialog-titlebar-close').hide();");
     $dialog = $this->objDialog->show();
     $this->objDialog = $this->newObject('dialog', 'jquerycore');
     $this->objDialog->setCssId('dialog_nopicturegiven');
     $this->objDialog->setTitle(ucwords($errorTitleLabel));
     $this->objDialog->setCloseOnEscape(FALSE);
     $this->objDialog->setContent('<span class="error">' . $errorNoImageLabel . '</span>');
     $this->objDialog->setAutoOpen(FALSE);
     $this->objDialog->setOpen("jQuery('.ui-dialog-titlebar-close').hide();");
     $dialog .= $this->objDialog->show();
     $this->objDialog = $this->newObject('dialog', 'jquerycore');
     $this->objDialog->setCssId('dialog_imagedoesnotexist');
     $this->objDialog->setTitle(ucwords($errorTitleLabel));
     $this->objDialog->setCloseOnEscape(FALSE);
     $this->objDialog->setContent('<span class="error">' . $errorNoFileLabel . '</span>');
     $this->objDialog->setAutoOpen(FALSE);
     $this->objDialog->setOpen("jQuery('.ui-dialog-titlebar-close').hide();");
     $dialog .= $this->objDialog->show();
     $this->objDialog = $this->newObject('dialog', 'jquerycore');
     $this->objDialog->setCssId('dialog_fileisnotimage');
     $this->objDialog->setTitle(ucwords($errorTitleLabel));
     $this->objDialog->setCloseOnEscape(FALSE);
     $this->objDialog->setContent('<span class="error">' . $errorNotImageLabel . '</span>');
     $this->objDialog->setAutoOpen(FALSE);
     $this->objDialog->setOpen("jQuery('.ui-dialog-titlebar-close').hide();");
     $dialog .= $this->objDialog->show();
     return $string . $dialog;
 }
コード例 #14
0
 /**
  * Method to Show Sub Modal Window Open from Button
  */
 private function showButton()
 {
     // Loadd Button Class
     $this->loadClass('button', 'htmlelements');
     // Generate a Random Number
     srand((double) microtime() * 1000000);
     $random_number = rand();
     // Create Button
     $button = new button('modal_' . $random_number, $this->text, 'showPopWin(\'' . $this->url . '\', ' . $this->width . ', ' . $this->height . ', null);');
     // Return Button
     return $button->show();
 }
コード例 #15
0
 /**
  * Standard block show method. 
  */
 public function show()
 {
     // Get all user contents
     $contexts = $this->objUserContext->getUserContext($this->objUser->userId());
     if (count($contexts) == 0) {
         return $this->objLanguage->code2Txt('mod_context_youdonotbelongtocontexts', 'context', NULL, 'You do not belong to any [-contexts-]');
     } else {
         $form = new form('joincontext', $this->uri(array('action' => 'joincontext'), 'context'));
         $dropdown = new dropdown('contextcode');
         $contextArray = array();
         foreach ($contexts as $contextCode) {
             $contextDetails = $this->objContext->getContextDetails($contextCode);
             //check if this course is unpublished
             if ($contextDetails["status"] == "Unpublished") {
                 //if so check if this person is lecturer lecturer of the course
                 $groupId = $this->objGroups->getLeafId(array($contextCode, 'Lecturers'));
                 $ret = $this->objGroups->isGroupMember($this->objUser->userId(), $groupId);
                 if ($ret) {
                     $contextArray[$contextDetails['title']] = $contextCode;
                 }
             } else {
                 $contextArray[$contextDetails['title']] = $contextCode;
             }
         }
         if (count($contextArray) < 1) {
             return $this->objLanguage->code2Txt('mod_context_youdonotbelongtocontexts', 'context', NULL, 'You do not belong to any [-contexts-]');
         }
         ksort($contextArray);
         foreach ($contextArray as $title => $code) {
             $dropdown->addOption($code, $title);
         }
         $dropdown->setSelected($this->objContext->getContextCode());
         $button = new button('submitform', ucwords($this->objLanguage->code2Txt('mod_context_entercourse', 'context', NULL, 'Enter [-context-]')));
         $button->setToSubmit();
         $form->addToForm($dropdown->show() . '<br />' . $button->show());
         return $form->show();
     }
 }
コード例 #16
0
$form->addToForm($table->show());
$button = new button('submitform', $this->objLanguage->languageText('mod_useradmin_updatedetails', 'useradmin', 'Update Details'));
$button->setToSubmit();
// $button->setOnClick('validateForm()');
$form->addToForm('<p>' . $button->show() . '</p>');
$form->addRule('useradmin_firstname', $this->objLanguage->languageText('mod_userdetails_enterfirstname', 'userdetails'), 'required');
$form->addRule('useradmin_surname', $this->objLanguage->languageText('mod_userdetails_entersurname', 'userdetails'), 'required');
$form->addRule('useradmin_email', $this->objLanguage->languageText('mod_userdetails_enteremailaddress', 'userdetails'), 'required');
$form->addRule('useradmin_email', $this->objLanguage->languageText('mod_userdetails_entervalidemailaddress', 'userdetails'), 'email');
echo $form->show();
echo '</div>';
echo '<div><div style="width:25%;  float: left; padding: 5px;">';
echo '<h3>' . $this->objLanguage->languageText('phrase_userimage', 'userdetails') . ':</h3>';
$objModule = $this->getObject('modules', 'modulecatalogue');
$changeimageform = new form('changeimage', $this->uri(array('action' => 'changeimage')));
$changeimageform->addToForm($useridinput->show());
if ($objModule->checkIfRegistered('filemanager')) {
    $objSelectFile = $this->getObject('selectimage', 'filemanager');
    $objSelectFile->name = 'imageselect';
    $objSelectFile->restrictFileList = array('jpg', 'gif', 'png', 'jpeg', 'bmp');
    $changeimageform->addToForm($objSelectFile->show());
    $button = new button('changeimage', $this->objLanguage->languageText('phrase_updateimage', 'userdetails'));
    $button->setToSubmit();
    $changeimageform->addToForm('<br />' . $button->show());
}
echo $changeimageform->show();
echo '</div>';
echo '</div>';
$returnlink = new link($this->uri(NULL));
$returnlink->link = 'Return to User Administration';
echo '<br clear="left" />' . $returnlink->show();
コード例 #17
0
 /**
  * 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;
 }
コード例 #18
0
    default:
        break;
    case 'nofoldernameprovided':
        echo '<span class="error">' . $this->objLanguage->languageText('mod_filemanager_folderwasnotcreatednoname', 'filemanager', 'Folder was not created. No name provided') . '</span>';
        break;
    case 'illegalcharacters':
        echo '<span class="error">' . $this->objLanguage->languageText('mod_filemanager_folderwasnotcreatedillegalchars', 'filemanager', 'Folder was not created. Folders cannot contain any of the following characters') . ': \\ / : * ? &quot; &lt; &gt; |</span>';
        break;
}
echo '<h1>' . $folderpath . ' ' . $icon . '</h1>';
if ((count($files) > 0 || count($subfolders) > 0) && $folderPermission) {
    $form = new form('deletefiles', $this->uri(array('action' => 'multidelete')));
    $form->addToForm($table);
    $button = new button('submitform', $this->objLanguage->languageText('mod_filemanager_deleteselecteditems', 'filemanager', 'Delete Selected Items'));
    $button->setToSubmit();
    $selectallbutton = new button('selectall', $this->objLanguage->languageText('phrase_selectall', 'system', 'Select All'));
    $selectallbutton->setOnClick("javascript:SetAllCheckBoxes('deletefiles', 'files[]', true);");
    $deselectallbutton = new button('deselectall', $this->objLanguage->languageText('phrase_deselectall', 'system', 'Deselect all'));
    $deselectallbutton->setOnClick("javascript:SetAllCheckBoxes('deletefiles', 'files[]', false);");
    $form->addToForm($button->show() . ' &nbsp; &nbsp; ' . $selectallbutton->show() . ' ' . $deselectallbutton->show());
    $folderInput = new hiddeninput('folder', $folderId);
    $form->addToForm($folderInput->show());
    echo $form->show();
} else {
    echo $table;
}
if ($folderPermission) {
    echo '<h3>' . $this->objLanguage->languageText('phrase_uploadfiles', 'system', 'Upload Files') . '</h3>';
    echo $this->objUpload->show($folderId);
    echo $this->objFolders->showCreateFolderForm($folderId);
}
コード例 #19
0
ファイル: search_results.php プロジェクト: ookwudili/chisimba
<?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();
コード例 #20
0
}
$course1Dropdown = new dropdown('context1');
foreach ($data as $contextCode) {
    $row = $this->objContext->getContextDetails($contextCode);
    $course1Dropdown->addOption($row['contextcode'], $row['menutext']);
}
$course2Dropdown = new dropdown('context2');
foreach ($data as $contextCode) {
    $row = $this->objContext->getContextDetails($contextCode);
    $course2Dropdown->addOption($row['contextcode'], $row['menutext']);
}
$objTable = $this->newObject('htmltable', 'htmlelements');
$objTable->startRow();
$objTable->addCell(ucwords($this->objLanguage->code2Txt('mod_context_contextfrom', 'context', null, '[-context-] from')) . ":");
$objTable->endRow();
$objTable->startRow();
$objTable->addCell($course1Dropdown->show());
$objTable->endRow();
$objTable->startRow();
$objTable->addCell(ucwords($this->objLanguage->code2Txt('mod_context_contextto', 'context', null, '[-context-] to')) . ":");
$objTable->endRow();
$objTable->startRow();
$objTable->addCell($course2Dropdown->show());
$objTable->endRow();
$objButton = new button('save', $this->objLanguage->languageText('word_save'));
$objButton->extra = 'onclick="javascript:if(confirm(\'' . $this->objLanguage->code2Txt('mod_contextgroups_confirmtransfer', 'context', NULL, 'Are you sure you want to transfer these [-readonlys-]') . '?\')){document.confirmtransfercontextusers.submit();;}else{return false;}"';
$buttons = $objButton->show();
$objForm = new form('confirmtransfercontextusers', $this->uri(array('action' => 'savetransfercontextusers')));
$objForm->addToForm($objTable->show());
$objForm->addToForm($buttons);
echo $objForm->show();
コード例 #21
0
ファイル: step3.php プロジェクト: ookwudili/chisimba
$loHiddenLOCount = $this->newObject('textinput', 'htmlelements');
$loHiddenLOCount->textinput("outcount", $value = $outcomesCount, $type = 'hidden', $size = "10");
//Hidden textinput to store the count of new LO's
$loHiddenLODrops = $this->newObject('textinput', 'htmlelements');
$table->startRow();
$table->addCell('<div id="textBoxes"></div>');
$table->endRow();
//Spacer
$table->startRow();
$table->addCell(Null);
$table->endRow();
//Spacer
$table->startRow();
$table->addCell('<div id="countDiv">' . $loHiddenLOCount->show() . '</div>');
$table->endRow();
$button = new button('savecontext', $formButton);
$button->setToSubmit();
$delButton = new button('deleteoutcomes', $deleteLOButton);
$delButton->setToSubmit();
$form = new form('createcontext', $this->uri(array('action' => $formAction)));
// Fixed Ticket #3128 J C O'Connor
//$backUri = $this->uri(array('action' => 'step2', 'mode' => 'edit', 'contextcode' => $contextCode), 'contextadmin');
$backButton = new button('back', $this->objLanguage->languageText('word_back'));
$backButton->setToSubmit();
$form->addToForm($table->show());
$form->addToForm($backButton->show() . " " . $delButton->show() . " " . $button->show());
$hiddenInput = new hiddeninput('mode', $mode);
$form->addToForm($hiddenInput->show());
$hiddenInput = new hiddeninput('contextCode', $contextCode);
$form->addToForm($hiddenInput->show());
echo $form->show();
コード例 #22
0
$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()) {
    $quotaManager = new link($this->uri(array('action' => 'quotamanager')));
    $quotaManager->link = $this->objLanguage->languageText('mod_filemanager_quotamanager', 'filemanager', 'Quota Manager');
    $leftColumn .= '<li>' . $quotaManager->show() . '</li>';
コード例 #23
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>';
    }
}
コード例 #24
0
<?php

/*
* Template for uploading themes.
* 
*/
// set up html elements
$this->loadClass('htmlheading', 'htmlelements');
$this->loadclass('htmltable', 'htmlelements');
$this->loadclass('textinput', 'htmlelements');
$objConfirm = $this->newObject('timeoutmessage', 'htmlelements');
$objSelectFile = $this->newObject('selectfile', 'filemanager');
// set up language items
$btnupload = $this->objLanguage->languageText('mod_contextadmin_upload', 'contextadmin', 'Upload Theme');
$uploadhead = $btnupload;
$head = $uploadhead;
$btnexit = $this->objLanguage->languageText('word_exit');
$wordstudent = ucwords($this->objLanguage->languageText('mod_context_readonly'));
/************************* set up table ******************************/
$header = new htmlHeading();
$header->str = $this->objLanguage->languageText('mod_filemanager_uploadnewfile', 'filemanager', 'Upload new file');
$header->type = 4;
echo $header->show();
$form = new form('addpodcastbyupload', $this->uri(array('action' => 'saveuploadedtheme', 'id' => $id)));
$form->extra = 'enctype="multipart/form-data"';
$objUpload = $this->newObject('uploadinput', 'filemanager');
$objUpload->showTargetDir = FALSE;
$button = new button('submitform', $btnupload);
$button->setToSubmit();
$form->addToForm($objUpload->show() . '<br />' . $button->show());
echo $form->show();
コード例 #25
0
 /**
  * Method to render an add form to a template
  *
  * @param string $module The module to add the parameter
  */
 function showEditAddForm($pmodule)
 {
     //Create a form
     $formAction = $this->uri(array('action' => 'save'));
     //Load the form class
     $this->loadClass('form', 'htmlelements');
     //Create and instance of the form class
     $objForm = new form('sysconfig');
     //Set the action for the form to the uri with paramArray
     $objForm->setAction($formAction);
     //Set the displayType to 3 for freeform
     $objForm->displayType = 3;
     //Create a heading for the title
     //$objHd = $this->newObject('htmlheading', 'htmlelements');
     //Load the textinput class
     $this->loadClass('textinput', 'htmlelements');
     //Load the label class
     $this->loadClass('label', 'htmlelements');
     //Load the dropdown class
     //Kevin Cyster
     $this->loadClass('dropdown', 'htmlelements');
     //Create an element for the input of module
     $objElement = new textinput("pmodule");
     //Set the value of the element to $module
     if (isset($pmodule)) {
         $objElement->setValue($pmodule);
     }
     //Create label for input of module
     $label = new label($this->objLanguage->languageText("mod_sysconfig_modtxt", 'sysconfig'), "input_pmodule");
     $objForm->addToForm("<p><strong>" . $this->objLanguage->languageText("mod_sysconfig_modtxt", 'sysconfig') . "</strong>: " . $pmodule . "</p>");
     //Get the pk value
     $id = $this->getParam('id');
     //Get the records for editing
     $ar = $this->objDbSysconfig->getRow('id', $id, 'tbl_sysconfig_properties');
     //Get the two values needed
     if (isset($ar)) {
         $pname = $ar['pname'];
         $pvalue = $ar['pvalue'];
     } else {
         $pname = $this->getParam('id', NULL);
         $pvalue = $this->getParam('value', NULL);
     }
     #if
     //Create an element for the input of id
     $objElement = new textinput("id");
     $objElement->fldType = "hidden";
     $objElement->setValue($id);
     $objForm->addToForm($objElement->show());
     //Create an element for the input of id
     $objElement = new textinput("pmodule");
     $objElement->fldType = "hidden";
     $objElement->setValue($pmodule);
     $objForm->addToForm($objElement->show());
     //Add the $name element to the form
     $objForm->addToForm('<p><b>' . $this->objLanguage->languageText("mod_sysconfig_paramname", 'sysconfig') . '</b>: ' . $pname . '</p>');
     // Check in Config folder if module is gives as _site_
     if ($pmodule == '_site_') {
         $moduleToCheck = 'config';
     } else {
         $moduleToCheck = $pmodule;
     }
     // Load object that checks if class exists
     $checkobject = $this->getObject('checkobject', 'utilities');
     // Check if class 'sysconfig_{pname}' exists in module.
     if ($checkobject->objectFileExists('sysconfig_' . str_replace('/', '_', str_replace('-', '_', $pname)), $moduleToCheck)) {
         // If yes, instantiate the object
         $objParamValue = $this->getObject(strtolower('sysconfig_' . str_replace('/', '_', str_replace('-', '_', $pname))), $moduleToCheck);
         // send it the current default value
         $objParamValue->setDefaultValue($pvalue);
     } else {
         $valueLabel = new label($this->objLanguage->languageText("mod_sysconfig_paramvalue", 'sysconfig'), "input_pvalue");
         //Add the $value element to the form
         $objForm->addToForm("<b>" . $valueLabel->show() . "</b>: ");
         //Create an element for the input of value
         $objParamValue = new textinput("pvalue");
         $objParamValue->size = "50";
         //Set the value of the element to $value
         if (isset($pvalue)) {
             $objParamValue->setValue($pvalue);
         }
         #if
     }
     //Create text add link
     $objForm->addToForm($objParamValue->show() . "<br /><br />");
     // Create an instance of the button object and add a save button to the form
     $this->loadClass('button', 'htmlelements');
     // Create a submit button
     $objElement = new button('submit');
     // Set the button type to submit
     $objElement->setToSubmit();
     // Use the language object to add the word save
     $objElement->setValue(' ' . $this->objLanguage->languageText("word_save") . ' ');
     // Add the button to the form
     $objForm->addToForm('<br/>' . $objElement->show());
     //Add the form
     return $objForm->show();
 }
コード例 #26
0
$table->addCell($usernameLabel->show(), 100);
$table->addCell($username->show());
$table->endRow();
$table->startRow();
$table->addCell($emailLabel->show());
$table->addCell($email->show());
$table->endRow();
$table->startRow();
$table->addCell('&nbsp;');
$table->addCell('&nbsp;');
$table->endRow();
$table->startRow();
$redrawButton = new button('redraw', 'Redraw', 'redraw();');
$table->addCell($captchaLabel->show());
$table->addCell(stripslashes($this->objLanguage->languageText('mod_security_explaincaptcha', 'security', 'To prevent abuse, please enter the code as shown below. If you are unable to view the code, click on "Redraw" for a new one.')) . '<br /><div id="captchaDiv">' . $objCaptcha->show() . '</div>' . $captcha->show() . ' <a href="javascript:redraw();">' . $this->objLanguage->languageText('word_redraw', 'security', 'Redraw') . '</a>');
$table->endRow();
$form->addToForm($table->show());
$button = new button('submitform', $this->objLanguage->languageText('mod_security_sendmenewpassword', 'security', 'Send me a new password'));
$button->setToSubmit();
$form->addToForm('<p><br />' . $button->show() . '</p>');
$form->addRule('request_username', 'Please enter your username', 'required');
//$form->addRule('request_email', 'Not a valid Email', 'email');
$form->addRule('request_email', 'Please enter your emailaddress', 'required');
$form->addRule('request_captcha', 'Please enter the code in the image', 'required');
echo $form->show();
//$this->setLayoutTemplate(NULL);
//$this->setVar('pageSuppressXML', TRUE);
//echo '<div id="captchaDiv">'.$objCaptcha->show().'</div>'.$redrawButton->show();
echo '<p>' . $this->objLanguage->languageText('word_note', 'security', 'Note') . ': ';
echo $this->objLanguage->languageText('mod_security_passworddoesntworkldap', 'security', 'This does not work for accounts that use Network Identification. For assistance in this regard, please contact your System Administrator');
echo ' (' . $this->objConfig->getsiteEmail() . ')</p>';
コード例 #27
0
ファイル: edit_tpl.php プロジェクト: ookwudili/chisimba
//Add the fieldset to the form
$objForm->addToForm($objFieldset->show());
// Create an instance of the button object
$this->loadClass('button', 'htmlelements');
// Create a submit button
$objElement = new button('submit');
$objElement->setIconClass("save");
// Set the button type to submit
$objElement->setToSubmit();
// Use the language object to add the word save
$objElement->setValue(' ' . $this->objLanguage->languageText("word_save") . ' ');
// Create cancel button
$objCancel = new button('cancel');
$objCancel->setIconClass("cancel");
$objCancel->setOnClick("window.location='" . $this->uri(NULL) . "';");
$objCancel->setValue(' ' . $this->objLanguage->languageText("mod_storycategoryadmin_cancel", "storycategoryadmin") . ' ');
// Add the button to the form
$objForm->addToForm('<br/>' . $objElement->show() . "&nbsp;" . $objCancel->show());
//Add the heading to the layer
$this->objH = $this->getObject('htmlheading', 'htmlelements');
$this->objH->type = 1;
//Heading <h1>
$this->objH->str = $objLanguage->code2txt("mod_storycategoryadmin_title", "storycategoryadmin");
$rightSideColumn = $this->objH->show();
$rightSideColumn .= $objForm->show();
// Add Left column
$cssLayout->setLeftColumnContent($leftSideColumn);
// Add Right Column
$cssLayout->setMiddleColumnContent($rightSideColumn);
//Output the content to the page
echo $cssLayout->show();
コード例 #28
0
 /**
  * Standard block show method. 
  */
 public function show()
 {
     try {
         $objContext = $this->getObject('dbcontext', 'context');
         $courses = $objContext->getListOfPublicContext();
         if (count($courses) == 0) {
             $msg = $this->objLanguage->code2Txt('mod_context_nocontexts', 'context');
             return "<span class='noRecordsMessage'>{$msg}</span>";
         } else {
             $form = new form('joincontext', $this->uri(array('action' => 'joincontext'), 'context'));
             $dropdown = new dropdown('contextcode');
             foreach ($courses as $course) {
                 $dropdown->addOption($course['contextcode'], $course['menutext']);
             }
             $dropdown->setSelected($objContext->getContextCode());
             $button = new button('submitform', ucwords($this->objLanguage->code2Txt('mod_context_entercourse', 'context', NULL, 'Enter [-context-]')));
             $button->setToSubmit();
             $form->addToForm($dropdown->show() . '<br />' . $button->show());
             return $form->show();
         }
     } catch (customException $e) {
         customException::cleanUp();
     }
 }
コード例 #29
0
 /**
  * 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();
 }
コード例 #30
0
ファイル: showfolder.php プロジェクト: ookwudili/chisimba
    // Set Ability to create symlinks to nothing - default no ability
    $symlink = '';
    // Check ability to create symlinks
    if ($this->contextCode != '' && $this->getParam('context') != 'no' && substr($folder['folderpath'], 0, 7) != 'context') {
        $folderPermission = $this->objFolders->checkPermissionUploadFolder('context', $this->contextCode);
        if ($folderPermission) {
            $symlinkButton = new button('symlinkcontext', $this->objLanguage->code2Txt('mod_filemanager_attachtocontext', 'filemanager', NULL, 'Attach to [-context-]'));
            $symlinkButton->setToSubmit();
            $symlink = '&nbsp;' . $symlinkButton->show();
        }
    }
    $selectallbutton = new button('selectall', $this->objLanguage->languageText('phrase_selectall', 'system', 'Select All'));
    $selectallbutton->setOnClick("javascript:SetAllCheckBoxes('movedeletefiles', 'files[]', true);");
    $deselectallbutton = new button('deselectall', $this->objLanguage->languageText('phrase_deselectall', 'system', 'Deselect all'));
    $deselectallbutton->setOnClick("javascript:SetAllCheckBoxes('movedeletefiles', 'files[]', false);");
    $form->addToForm($move . $button->show() . $symlink . '&nbsp;' . $selectallbutton->show() . '&nbsp;' . $deselectallbutton->show());
    $folderInput = new hiddeninput('folder', $folderId);
    $form->addToForm($folderInput->show());
    $folderContent .= $form->show();
} else {
    $folderContent .= $table;
}
if ($folderPermission2) {
    $folderContent .= '<h3>' . $this->objLanguage->languageText('phrase_uploadfiles', 'system', 'Upload Files') . '</h3>';
    if ($quota['quotausage'] >= $quota['quota']) {
        $folderContent .= '<p class="warning">' . $this->objLanguage->languageText('mod_filemanager_quotaexceeded', 'filemanager', 'Allocated Quota Exceeded. First delete some files and then try to upload again.') . '</p>';
    } else {
        $folderContent .= $this->objUpload->show($folderId, $quota['quota'] - $quota['quotausage']);
    }
}
$tabContent = $this->newObject('tabber', 'htmlelements');