/** * Method to show the time picker * @return string The time picker */ public function show() { $dropdown = new dropdown($this->name); $dropdown->cssClass = 'timepicker'; for ($hour = 0; $hour < 24; $hour++) { $time = $hour . ':00'; $dropdown->addOption($time, $time); for ($minute = 1; $minute < 4; $minute++) { $time = $hour . ':' . $minute * 15; $dropdown->addOption($time, $time); } } $dropdown->setSelected($this->value); return $dropdown->show(); }
/** * * Method to show the user selectable grades * * @acces public * @return VOID */ public function showGrades() { $selectGradeLabel = $this->objLanguage->code2Txt('mod_grades_grade', 'grades', NULL, 'ERROR: mod_grades_grade'); $selectLabel = $this->objLanguage->languageText('word_select', 'system', 'ERROR: word_select'); $successTitleLabel = $this->objLanguage->languageText('word_success', 'system', 'ERROR: word_success'); $successLabel = $this->objLanguage->code2Txt('mod_userdetails_gradesuccess', 'userdetails', NULL, 'ERROR: mod_userdetails_gradesuccess'); $errorTitleLabel = $this->objLanguage->languageText('word_error', 'system', 'ERROR: word_error'); $errorLabel = $this->objLanguage->code2Txt('mod_userdetails_gradeerror', 'userdetails', NULL, 'ERROR: mod_userdetails_gradeerror'); $grades = $this->objDBgrades->getAll(); $userGroups = $this->objGroups->getUserGroups($this->objUser->userId()); $name = NULL; if (!empty($userGroups)) { foreach ($userGroups as $group) { foreach ($grades as $grade) { if ($group['group_define_name'] == $grade['name']) { $name = $grade['name']; break; break; } } } } $objDrop = new dropdown('new_name'); $objDrop->addFromDB($grades, 'name', 'name'); $objDrop->setSelected($name); $gradeDrop = $objDrop->show(); $objInput = new textinput('old_name', $name, 'hidden', '50'); $nameInput = $objInput->show(); $objButton = new button('select', $selectLabel); $objButton->setId('grade_select'); $selectButton = $objButton->show(); $objTable = new htmltable(); $objTable->cellpadding = '4'; $objTable->startRow(); $objTable->addCell('<b>' . ucfirst(strtolower($selectGradeLabel)) . ': </b>', '', '', '', '', '', ''); $objTable->endRow(); $objTable->startRow(); $objTable->addCell($nameInput . $gradeDrop, '', '', '', '', '', ''); $objTable->endRow(); $objTable->startRow(); $objTable->addCell($selectButton, '', '', '', '', '', ''); $objTable->endRow(); $gradeTable = $objTable->show(); $objForm = new form('user', $this->uri(array('action' => 'change_grade'))); $objForm->extra = ' enctype="multipart/form-data"'; $objForm->addToForm($gradeTable); $gradeForm = $objForm->show(); $string = $gradeForm; $this->objDialog = $this->newObject('dialog', 'jquerycore'); $this->objDialog->setCssId('dialog_grade_success'); $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_grade_error'); $this->objDialog->setTitle(ucwords($errorTitleLabel)); $this->objDialog->setCloseOnEscape(FALSE); $this->objDialog->setContent('<span class="error">' . $errorLabel . '</span>'); $this->objDialog->setAutoOpen(FALSE); $this->objDialog->setOpen("jQuery('.ui-dialog-titlebar-close').hide();"); $dialog .= $this->objDialog->show(); return $string . $dialog; }
/** * * Method to return a customised input to the sysconfig form * * @access public * @return string $string The html string to be displayed in sysconfig */ public function show() { $string = $this->objLanguage->languageText('mod_jquerycore_selectversion', 'jquerycore', 'ERROR: mod_jquerycore_selectversion'); $objDrop = new dropdown('pvalue'); foreach ($this->coreVersions as $version) { $objDrop->addOption($version, $version); } $objDrop->setSelected($this->defaultValue); $string .= ' ' . $objDrop->show(); return $string; }
/** * Method to get a dropdown with the list of countries * * @param string $name: Name of the Select Dropdown * @param string $defaultCountry: Two letter country code of the default country. * @return $flagsrc string : Flag Image File Url */ public function getDropDown($name = 'country', $defaultCountry = NULL) { $dropdown = new dropdown($name); foreach ($this->countries as $code => $country) { $dropdown->addOption($code, htmlentities($country)); } if ($defaultCountry != NULL) { $dropdown->setSelected($defaultCountry); } return $dropdown->show(); }
/** * 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(); } }
$form = new form('updatedetails', $this->uri(array('action' => 'updateuserdetails'))); $form->addToForm($useridinput->show()); echo '<div style="width:70%; float:left; padding:5px; boorder:1px solid red;">'; echo '<h3>' . $this->objLanguage->languageText('phrase_userinformation', 'userdetails') . ':</h3>'; $table = $this->newObject('htmltable', 'htmlelements'); // Title $table->startRow(); $label = new label($this->objLanguage->languageText('word_title', 'system'), 'input_useradmin_title'); $objDropdown = new dropdown('useradmin_title'); $titles = array("title_mr", "title_miss", "title_mrs", "title_ms", "title_dr", "title_prof", "title_rev", "title_assocprof"); foreach ($titles as $title) { $_title = trim($objLanguage->languageText($title)); $objDropdown->addOption($_title, $_title); } if ($mode == 'addfixup') { $objDropdown->setSelected($this->getParam('useradmin_title')); } else { $objDropdown->setSelected($user['title']); } $table->addCell($label->show(), 140); $table->addCell(' '); $table->addCell($objDropdown->show()); $table->endRow(); // Firstname $table->startRow(); $label = new label($this->objLanguage->languageText('phrase_firstname', 'system'), 'input_useradmin_firstname'); $table->addCell($label->show()); $table->addCell(' '); $table->addCell($firstname->show()); $table->endRow(); // Surname
/** * Short description for function * * Long description (if any) ... * * @return void * @access public */ function showForms() { //Text Input $objForm = new form('testform'); $url = $this->uri(array('action' => 'add'), 'htmlelements'); $objForm->setAction($this->uri(array('action' => 'save'), 'htmlelements')); $objForm->setDisplayType(2); $objElement = new textinput('textbox'); $objElement->setValue('Some text'); $objElement->label = 'Textbox\'s label'; $text = $objElement->show() . '<br />'; $objForm->addToForm('<span class="warning">Start of Form</span><br />'); $objForm->addToForm($objElement); //Calendar /*$objElement = new calendar('cal'); $today = getdate(); $objElement->setDate($today['mon'],$today['mday'],$today['year']); $calendar = $objElement->show().'<br />';*/ //Radion button Group $objElement = new radio('sex_radio'); $objElement->addOption('m', 'Male'); $objElement->addOption('f', 'Female'); $objElement->addOption('n', 'Seaweed'); $objElement->setSelected('f'); $radio = $objElement->show() . '<br />'; //Check boxes $objElement = new checkbox('m', 'Male', true); $check = $objElement->show(); $objElement = new checkbox('f', 'Female'); $check .= $objElement->show(); $objElement = new checkbox('n', 'Seawood'); $check .= $objElement->show() . '<br />'; //Dropdown $objElement = new dropdown('sex_dropdown'); $objElement->addOption('', ''); //adding a blank option $objElement->addOption('m', 'Male'); $objElement->addOption('f', 'Female'); $objElement->addOption('n', 'Seaweed'); $objElement->setSelected('f'); $dropdown = $objElement->show() . "<br />"; //Dropdown created from array $objElement = new dropdown('user_dropdown'); $objElement->addFromDB($this->objDBUser->getAll(), 'username', 'userid', $this->objDBUser->userName()); $objElement->label = 'User list'; $dropdown .= $objElement->show() . "<br />"; //Textarea $objElement = new textarea('text_area'); $objElement->setRows(3); $objElement->setColumns('45'); $objElement->setContent('This is some content for the textarea'); $ta = $objElement->show() . '<br />'; //Button $objElement = new button('mybutton'); $objElement->setValue('Normal Button'); $objElement->setOnClick('alert(\'An onclick Event\')'); $button = $objElement->show() . '<br />'; //Submit Button $objElement = new button('mybutton'); $objElement->setToSubmit(); $objElement->label = 'Buttons Label'; $objElement->setValue('Submit Button'); $submit = $objElement->show() . '<br />'; //add submit button to the form; $objForm->addToForm($objElement); $mouseoverpopup = new mouseoverpopup('this is some text'); $mouseoverpopup = $mouseoverpopup->show(); //Add all the above to a tabbedbox $objElement = new tabbedbox(); $objElement->addTabLabel('Tabbed box 1'); $objElement->addBoxContent($mouseoverpopup . $text . $dropdown . $button . $submit); $tab = '<br />' . $objElement->show() . '<br />'; //add the tab to the form $objForm->addToForm($objElement); $objForm->addToForm('<span class="warning">End of Form</span>'); $form = $objForm->show() . '<br />'; //create a multitabbedbox $objElement = new multitabbedbox('100px', '500px'); $objElement->addTab(array('name' => 'First', 'url' => 'http://localhost', 'content' => $form, 'default' => true)); $objElement->addTab(array('name' => 'Second', 'url' => 'http://localhost', 'content' => $check . $radio)); $objElement->addTab(array('name' => 'Third', 'url' => 'http://localhost', 'content' => $tab, 'height' => '300px', 'width' => '600px')); //$objElement->addTab(array('name'=>'Test Validation','url'=>'http://localhost','content' => $this->valFormShow(),'height' => '300','width' => '700')); //set layers $left = $tab; $content = 'This is an example using most of the classes in the htmlelements module<br />'; $content .= '<br />' . $objElement->show(); //this to make the centre layer strech downwards for ($i = 0; $i < 10; $i++) { $content .= '<br />'; } $right = $tab; $bottom = $ta; $this->setVar('left', $left); $this->setVar('right', $right); $this->setVar('content', $content); $this->setVar('bottom', $bottom); //return $str; }
//Ehb-added-begin $label = new label($this->objLanguage->languageText('mod_contextgroups_choosecourse', 'contextgroups'), 'input_course'); $courseDropdown = new dropdown('course'); $courseDropdown->addOption('all', $this->objLanguage->languageText('mod_contextgroups_allcourses', 'contextgroups')); for ($i = 0; $i < count($data); $i++) { $courseDropdown->addOption($data[$i]['contextcode'], $data[$i]['title']); } $courseDropdown->setSelected($course); $label2 = new label($this->objLanguage->languageText('mod_contextgroups_choosegroup', 'contextgroups'), 'input_group'); $groupDropdown = new dropdown('group'); $groupDropdown->addOption('all', 'All groups'); $groups = array("Lecturers", "Students", "Guest"); for ($i = 0; $i < count($groups); $i++) { $groupDropdown->addOption($groups[$i], $groups[$i]); } $groupDropdown->setSelected($group); $table->addCell($label2->show() . $groupDropdown->show() . " " . $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');
/** * Callback method to evaluate the value parameter for permissions. * * @access public * @author Jonathan Abrahams * @param string Access control list reference name. * @return true|false Returns result of the evaluation. * @version V0.1 */ function hasContextPermission($aclName = NULL) { $function = 'hasContextPermission | '; $objDropDown = new dropdown('value'); $lblSelectContextACL = $this->objLanguage->languageText('mod_contextpermissions_lblSelectContextACL', 'contextpermissions', "[-- Select an access control list for the context--]"); $objDropDown->addOption('hasContextPermission', $lblSelectContextACL); $options = array('isAuthor', 'isEditor', 'isReader'); // Get context permissions foreach ($options as $aclName) { $objDropDown->addOption($function . $aclName, $aclName); } $objDropDown->setSelected($function . $aclName); $lblACL = $this->objLanguage->languageText('mod_contextpermissions_lblACL', 'contextpermissions', "[Access control list: ]"); $objLabel = new label($lblACL, 'input_value'); $lblName = $objLabel->show(); return array('lblName' => $lblName, 'element' => $objDropDown->show()); }
if ($menu == 'manage') { $objDrop->addOption('site', $catSite); } else { $objDrop->addOption('assign', $catAssign); } } $objDrop->setSelected($category); } else { $objLabel = new label($positionLabel, 'input_position'); $objDrop = new dropdown('position'); $objDrop->addOption(1, $topLabel); $objDrop->addOption(2, $uppermiddleLabel); $objDrop->addOption(3, $middleLabel); $objDrop->addOption(4, $lowermiddleLabel); $objDrop->addOption(5, $bottomLabel); $objDrop->setSelected($position); } $objTable->addRow(array($label1, $drop1, $objLabel->show(), $objDrop->show())); // action $objLabel = new label($actionLabel, 'input_actionName'); $objInput = new textinput('actionName', $action); $objTable->addRow(array($objLabel->show(), $objInput->show())); // icon $objLabel = new label($iconLabel, 'input_icon'); $objInput = new textinput('icon', $icon); $objTable->addRow(array($objLabel->show(), $objInput->show())); // language code for link text $objLabel = new label($langCodeLabel, 'input_code'); $objInput = new textinput('code', $code); $objTable->addRow(array($objLabel->show(), $objInput->show())); $objHead->str = $settingsLabel;
/** * Get context edit form * @return string * */ public function getEditContextForm($contextCode = NULL) { if (empty($contextCode)) { $contextCode = $this->_objDBContext->getContextCode(); } $context = $this->_objDBContext->getRow('contextcode', $contextCode); $objH = new htmlheading(); $objForm = new form(); $inpContextCode = new textinput(); $inpMenuText = new textinput(); $inpTitle = new textinput(); $inpButton = new button(); $objIcon = $this->newObject('geticon', 'htmlelements'); $dropAccess = new dropdown(); //$radioStatus = new radio(); $objStartDate = $this->newObject('datepicker', 'htmlelements'); $objFinishDate = $this->newObject('datepicker', 'htmlelements'); $objIcon->setIcon('help'); $objH->str = $this->_objLanguage->languageText("mod_context_step", 'context') . ' 1: ' . $this->_objLanguage->languageText("mod_context_addcontext", 'context'); $objH->type = 3; //setup the form $objForm->name = 'addfrm'; $objForm->action = $this->uri(array('action' => 'saveedit')); $objForm->extra = 'class="f-wrap-1"'; $objForm->displayType = 3; //contextcode $inpContextCode->name = 'contextcode'; $inpContextCode->id = 'contextcode'; $inpContextCode->value = ''; $inpContextCode->cssClass = 'f-name'; //title $inpTitle->name = 'title'; $inpTitle->id = 'title'; $inpTitle->value = $context['title']; $inpTitle->cssClass = 'f-name'; //menu text $inpMenuText->value = $context['menutext']; $inpMenuText->name = 'menutext'; $inpMenuText->id = 'menutext'; $inpMenuText->cssClass = 'f-name'; //status $dropAccess->name = 'status'; $dropAccess->addOption('Published', $this->_objLanguage->languageText("mod_context_published", 'context')); $dropAccess->addOption('Unpublished', $this->_objLanguage->languageText("mod_context_unpublished", 'context')); $dropAccess->setSelected(trim($context['status'])); //access $checked = $context['access'] == 'Public' ? ' checked = "checked" ' : ''; $drop = '<fieldset class="f-radio-wrap"> <b>' . $this->_objLanguage->languageText("mod_context_access", 'context') . ':</b> <fieldset> <label for="Public"> <input id="Public" type="radio" name="access" ' . $checked . ' value="Public" class="f-radio" tabindex="8" /> ' . $this->_objLanguage->languageText("mod_context_public", 'context') . ' <span class="caption"> - ' . $this->_objLanguage->code2Txt("mod_context_publichelp", 'context', array('context' => 'Course')) . '</span></label>'; $checked = $context['access'] == 'Open' ? ' checked = "checked" ' : ''; $drop .= '<label for="Open"> <input id="Open" type="radio" name="access" ' . $checked . ' value="Open" class="f-radio" tabindex="9" /> ' . $this->_objLanguage->languageText("mod_context_open", 'context') . ' <span class="caption"> - ' . $this->_objLanguage->code2Txt("mod_context_openhelp", 'context', array('context' => 'Course')) . '</span></label>'; $checked = $context['access'] == 'Private' ? ' checked = "checked" ' : ''; $drop .= ' <label for="Private"> <input id="Private" type="radio" name="access" ' . $checked . ' value="Private" class="f-radio" tabindex="10" /> ' . $this->_objLanguage->languageText("mod_context_private", 'context') . ' <span class="caption"> - ' . $this->_objLanguage->code2Txt("mod_context_privatehelp", 'context', array('context' => 'course')) . '</span></label> </fieldset> </fieldset>'; //start date $objStartDate->name = 'startdate'; $objStartDate->value = $context['startdate']; //finish date $objFinishDate->name = 'finishdate'; $objFinishDate->value = $context['finishdate']; //button $inpButton->setToSubmit(); $inpButton->cssClass = 'f-submit'; $inpButton->value = ucwords($this->_objLanguage->languageText("word_save")); //validation $objForm->addRule('menutext', $this->_objLanguage->languageText("mod_contextadmin_err_requiremenutext", 'contextadmin'), 'required!'); $objForm->addRule('title', $this->_objLanguage->languageText("mod_contextadmin_err_requiretitle", 'contextadmin'), 'required!'); $objForm->addToForm('<div class="req"><b>*</b>' . $this->_objLanguage->languageText("mod_context_required", 'context') . '</div>'); $objForm->addToForm('<fieldset>'); $objForm->addToForm('<label for="contextcode"><b><span class="req">*</span>' . ucwords($this->_objLanguage->code2Txt("mod_context_contextcode", 'context', array('context' => 'Course'))) . ':</b> <span class="highlight">'); $objForm->addToForm($this->_objDBContext->getContextCode() . '</span><br /></label>'); $objForm->addToForm('<label for="title"><b><span class="req">*</span>' . $this->_objLanguage->languageText("word_title") . ':</b>'); $objForm->addToForm($inpTitle->show() . '<br /></label>'); $objForm->addToForm('<label for="menutext"><b><span class="req">*</span>' . $this->_objLanguage->languageText("mod_context_menutext", 'context') . ':</b>'); $objForm->addToForm($inpMenuText->show() . '<br /></label>'); $objForm->addToForm('<label for="access"><b><span class="req">*</span>' . $this->_objLanguage->languageText("mod_context_status", 'context') . ':</b>'); $objForm->addToForm($dropAccess->show() . '<br /></label>'); $objForm->addToForm($drop); $objForm->addToForm('<label> <br/></label>'); $objForm->addToForm('<br/><div class="f-submit-wrap">' . $inpButton->show() . '</div></fieldset>'); return $objForm->show() . '<br/>'; }
<DIV><?php $this->loadClass('label', 'htmlelements'); $this->loadClass('form', 'htmlelements'); $this->loadClass('dropdown', 'htmlelements'); // Get all modules $objModAdmin = $this->getObject('modules', 'modulecatalogue'); $modules = $objModAdmin->getAll('ORDER BY module_id'); $ddbModules = new dropdown('module_name'); $ddbModules->extra = ' onchange="document.frmMod.submit();"'; foreach ($modules as $aModule) { $ddbModules->addOption($aModule['module_id'], $aModule['module_id']); } $ddbModules->setSelected($this->getSession('module_name')); // Select a module: $lblSelectModule = $this->objLanguage->languageText("mod_contextpermissions_lblSelectModule", 'contextpermissions', "[Select a module: ]"); $objLabel = new label($lblSelectModule, 'input_module_name'); $frmMod = new form(); $frmMod->action = $this->uri(array('action' => 'show_main')); $frmMod->name = 'frmMod'; $frmMod->addToForm('<H1>' . $title . ' </H1>'); $frmMod->addToForm('<P>' . $objLabel->show() . ' ' . $ddbModules->show() . '</P>'); echo $frmMod->show(); // Initialize links $lnkCreateAction = $this->lnkText($lblCreateAction, 'create_action', NULL); $lnkCreateRule = $this->lnkText($lblCreateRule, 'create_rule', NULL); $lnkCreateCondition = $this->lnkText($lblCreateCondition, 'create_condition', NULL); $lnkGenerateConfig = $this->lnkText($lblGenerateConfig, 'generate_config', NULL); $lnkUpdatePermissions = $this->lnkText($lblUpdatePerms, 'update_perms', NULL); $lnkGetControllerActions = $this->lnkText($lblControllerActions, 'controller_actions', NULL); $properties = array(); $properties['lblAction'] = $lblAction;
$objForm->addToForm($top); $objForm->addToForm($objTable->show()); $objForm->addToForm($bot); $searchForm = new form('searchform', $this->uri(array('action' => 'search', 'cat' => 'all'), 'modulecatalogue')); $searchForm->displayType = 3; $srchStr = new textinput('srchstr', $this->getParam('srchstr'), null, '21'); $srchButton = new button('search'); $srchButton->setIconClass("search"); $srchButton->setValue($this->objLanguage->languageText('word_search')); $srchButton->setToSubmit(); $srchType = new dropdown('srchtype'); $srchType->addOption('name', $this->objLanguage->languageText('mod_modulecatalogue_modname', 'modulecatalogue')); $srchType->addOption('description', $this->objLanguage->languageText('mod_modulecatalogue_description', 'modulecatalogue')); $srchType->addOption('both', $this->objLanguage->languageText('word_all')); $srchType->addOption('tags', $this->objLanguage->languageText('mod_modulecatalogue_tags', 'modulecatalogue')); $srchType->setSelected($this->getParam('srchtype')); $srch = $srchType->show() . $srchButton->show(); $hTable = $this->newObject('htmltable', 'htmlelements'); $hTable->startRow(); $hTable->addCell($objH->show(), null, null, 'left'); $hTable->addCell($srchStr->show(), null, 'bottom', 'right'); $hTable->endRow(); $hTable->startRow(); $hTable->addCell(null, null, null, 'left'); $hTable->addCell($srch, null, 'top', 'right'); $hTable->endRow(); $searchForm->addToForm($hTable->show()); $this->appendArrayVar('headerParams', "<script type='text/javascript' src='core_modules/modulecatalogue/resources/remote.js'></script>"); $objSelectFile = new textinput('archive', null, 'file', 30); $uploadSize = new textinput('MAX_FILE_SIZE', '8000000', 'hidden'); $fButton = new button('bupload', $this->objLanguage->languageText('word_upload'));
$table->endRow(); $fieldset = $this->newObject('fieldset', 'htmlelements'); $fieldset->legend = $this->objLanguage->languageText('phrase_accountdetails', 'userregistration', 'Account Details'); $fieldset->contents = $table->show(); $form->addToForm($fieldset->show()); $form->addToForm('<br />'); $table = $this->newObject('htmltable', 'htmlelements'); $titlesDropdown = new dropdown('register_title'); $titlesLabel = new label($this->objLanguage->languageText('word_title', 'system') . ' ', 'input_register_title'); $titles = array("title_mr", "title_miss", "title_mrs", "title_ms", "title_dr", "title_prof", "title_rev", "title_assocprof"); foreach ($titles as $title) { $_title = trim($this->objLanguage->languageText($title)); $titlesDropdown->addOption($_title, $_title); } if ($mode == 'addfixup') { $titlesDropdown->setSelected($this->getParam('register_title')); } $table->startRow(); $table->addCell($titlesLabel->show(), 150, NULL, 'right'); $table->addCell($titlesDropdown->show()); $table->endRow(); $firstname = new textinput('register_firstname'); $firstnameLabel = new label($this->objLanguage->languageText('phrase_firstname', 'system', "First name") . ' ', 'input_register_firstname'); if ($mode == 'addfixup') { $firstname->value = $this->getParam('register_firstname'); if ($this->getParam('register_firstname') == '') { $messages[] = $this->objLanguage->languageText('mod_userdetails_enterfirstname', 'userdetails'); } } if (isset($userstring) && $mode == 'add') { $firstname->value = $userstring[0];
/** * * Method to return an alphabetical select box * of countries * * @param string $tongue the two letter code for the language to be * selected in the select box * @return string The select box for countries * @access Public */ public function countryAlpha($tongue = NULL) { $ar = $this->countryListArr(); asort($ar); $this->loadClass('dropdown', 'htmlelements'); $objSelect = new dropdown('country'); // set a selected entry if ($tongue) { $language = $tongue; } else { $language = strtoupper($this->objConfig->getCountry()); } foreach ($ar as $code => $country) { $objSelect->addOption($code, $country); } $objSelect->setSelected($language); return $objSelect->show(); }
$searchFor = new textinput('searchfor', $this->getParam('searchfor')); $table->addCell($this->objLanguage->languageText('mod_forum_searchfor', 'system', 'Search for')); $table->addCell($searchFor->show()); $orderBy1 = new dropdown('orderBy_user'); $orderBy1->addOption('quotausage_desc', $this->objLanguage->languageText('mod_filemanager_mostusage', 'filemanager', 'Most Usage')); $orderBy1->addOption('quotausage', $this->objLanguage->languageText('mod_filemanager_leastusage', 'filemanager', 'Least Usage')); $orderBy1->addOption('firstname', $this->objLanguage->languageText('phrase_firstname', 'system', 'First Name')); $orderBy1->addOption('surname', $this->objLanguage->languageText('word_surname', 'system', 'Surname')); $orderBy1->setSelected($this->getParam('orderBy_user')); $div1 = '<div class="userform" style="display: ' . $userDisplay . '">' . $orderBy1->show() . '</div>'; $orderBy2 = new dropdown('orderBy_context'); $orderBy2->addOption('quotausage_desc', $this->objLanguage->languageText('mod_filemanager_mostusage', 'filemanager', 'Most Usage')); $orderBy2->addOption('quotausage', $this->objLanguage->languageText('mod_filemanager_leastusage', 'filemanager', 'Least Usage')); $orderBy2->addOption('title', ucwords($this->objLanguage->code2Txt('mod_context_contexttitle', 'context', NULL, '[-context-] Title'))); $orderBy2->addOption('contextcode', ucwords($this->objLanguage->code2Txt('mod_context_contextcode', 'context', NULL, '[-context-] Code'))); $orderBy2->setSelected($this->getParam('orderBy_context')); $div2 = '<div class="contextform" style="display: ' . $contextDisplay . '">' . $orderBy2->show() . '</div>'; $table->addCell($this->objLanguage->languageText('mod_filemanager_orderby', 'filemanager', 'Order By')); $table->addCell($div1 . $div2); $button = new button('go', $this->objLanguage->languageText('word_go', 'system', 'Go')); $button->setToSubmit(); $table->addCell($button->show()); $table->endRow(); $form->addToForm($table->show()); echo $form->show(); $objPagination = $this->newObject('pagination', 'navigation'); $objPagination->id = 'quotalist'; $numItemsPerPage = 20; $objPagination->numPageLinks = $this->objQuotas->getNumPages($searchType, $searchField, $this->getParam('searchfor'), $orderBy, $numItemsPerPage); $objPagination->module = 'filemanager'; $objPagination->action = 'ajaxgetquotas';
/** * * Method to return a customised input to the sysconfig form * * @access public * @return string $string The html string to be displayed in sysconfig */ public function show() { $string = $this->objLanguage->languageText('mod_jquerycore_selecttheme', 'jquerycore', 'ERROR: mod_jquerycore_selecttheme'); $objDrop = new dropdown('pvalue'); foreach ($this->themes as $theme) { $objDrop->addOption($theme, ucfirst($theme)); } $objDrop->setSelected($this->defaultValue); $string .= ' ' . $objDrop->show(); return $string; }
<H1><?php echo $title . $this->lnkIcnCreate('create_condition'); ?> </H1> <DIV><?php $this->loadClass('label', 'htmlelements'); $this->loadClass('dropdown', 'htmlelements'); $viewCondition = $this->getObject('viewcondition', 'decisiontable'); $viewCondition->connect($condition); extract($viewCondition->elements()); $ddbType = new dropdown('type'); foreach ($condition->objConditionType->getAll() as $option) { $ddbType->addOption($option['name'], $option['name']); } $ddbType->setSelected($condition->_function); $ddbType->extra = 'onChange="javascript:document.frmCond[\'button\'].value=\'save\';document.frmCond.submit();"'; $lnkSave = $this->newObject('link', 'htmlelements'); $lnkSave->href = "#"; $lnkSave->extra = 'onclick="javascript:document.frmCond[\'button\'].value=\'save\';document.frmCond.submit();"'; $lnkSave->link = $this->objLanguage->languageText("word_save"); $lnkBack = $this->newObject('link', 'htmlelements'); $lnkBack->href = '#'; $lnkBack->extra = 'onclick="javascript:document.frmCond[\'button\'].value=\'cancel\';document.frmCond.submit();"'; $lnkBack->link = $this->objLanguage->languageText("word_back"); $arrControls = array($lnkSave->show(), $lnkBack->show()); $lblConditionType = $this->objLanguage->code2Txt('mod_contextpermissions_lblConditionType', 'contextpermissions'); $objLabel = new label($lblConditionType, 'input_type'); $lblType = $objLabel->show(); $frmCond = $this->newObject('form', 'htmlelements'); $frmCond->name = 'frmCond'; $frmCond->displayType = '3';
$table->addCell(' '); $table->endRow(); $table->startRow(); $table->addCell($this->objLanguage->languageText('word_status', 'system', 'Status')); $table->addCell($status->show()); $table->endRow(); $table->startRow(); $table->addCell(' '); $table->addCell(' '); $table->endRow(); $showcomment = new dropdown('showcomment'); //$status->setBreakSpace('<br />'); $showcomment->addOption('1', $this->objLanguage->languageText('word_yes', 'system', 'No') . " "); $showcomment->addOption('0', $this->objLanguage->languageText('word_no', 'system', 'No') . " "); if ($mode == 'add' && is_array($fixup)) { $showcomment->setSelected($fixup['showcomment']); } else { if ($mode == 'edit') { $showcomment->setSelected($context['showcomment']); } } $table->startRow(); $table->addCell($this->objLanguage->languageText('mod_contextadmin_comment', 'contextadmin', 'Comment')); $table->addCell($showcomment->show() . " *" . $this->objLanguage->languageText('mod_contextadmin_comments', 'contextadmin', 'Enable or Disable users to post comments on page content')); $table->endRow(); $table->startRow(); $table->addCell(' '); $table->addCell(' '); $table->endRow(); if ($objSysConfig->getValue('context_access_private_only', 'context', 'false') == 'false') { $table->startRow();
/** * * Render the dropdown skin chooser so that it is processed * by the skinselect module, for use with Ajax * * @return string Form with dropdown * @access public * */ public function show() { $script = $this->uri(array('action' => 'save'), 'skinselect'); $objNewForm = new form('selectskin', $script); $objDropdown = new dropdown('skinlocation'); $objDropdown->extra = "onchange =\"document.forms['selectskin'].submit();\""; $skins = array(); $curPage = $this->curPageURL(); $objSelf = new textinput('returnUri', $curPage); $objSelf->fldType = "hidden"; // Get all the skins as an array $dirList = $this->getAllSkins(); // Sort the array of skins alphabetically asort($dirList); // Loop and add them to the dropdown foreach ($dirList as $element => $value) { $objDropdown->addOption($element, $value); } $objNewForm->addToForm($this->objLanguage->languageText('phrase_selectskin') . ":<br />\n"); // Set the current skin as the default selected skin $objDropdown->setSelected($this->getSession('skin')); $objDropdown->cssClass = 'coursechooser'; $objNewForm->addToForm($objDropdown->show()); $objNewForm->addToForm($objSelf->show()); return $objNewForm->show(); }
} } } $objHead->str = $heading; $objHead->type = 1; $str = $objHead->show(); $str .= '<p><b>' . $moduleLabel . ':</b> ' . $modName . '</p>'; // Drop down to select a different module $objLabel = new label($selectLabel, 'input_modulename'); $objDrop = new dropdown('modulename'); $objDrop->extra = 'onchange="document.forms[\'modselect\'].submit()"'; foreach ($moduleList as $item) { $modName = $objLanguage->code2Txt('mod_' . $item['module_id'] . '_name', $item['module_id']); $objDrop->addOption($item['module_id'], $modName); } $objDrop->setSelected($moduleName); $objForm = new form('modselect', $this->uri(array('action' => 'editlinks'))); $objForm->addToForm('<b>' . $objLabel->show() . ':</b> ' . $objDrop->show()); $str .= '<p>' . $objForm->show() . '</p>'; // Toolbar links $addTool = $objIcon->getAddIcon($this->uri(array('action' => 'addtool', 'modulename' => $moduleName))); $objHead->str = $toolbarLabel . ' ' . $addTool; $objHead->type = 3; $str .= $objHead->show(); $objTable = new htmltable(); $objTable->width = '99%'; $objTable->cellspacing = 2; $objTable->cellpadding = 5; $tableHd = array(); $tableHd[] = $categoryLabel; $tableHd[] = '';
/** * 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(' '); $table->addCell(' '); $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(' '); $table2->addCell(' '); $table2->addCell(' '); $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(' '); $table2->addCell(' '); $table2->addCell(' '); $table2->endRow(); $table2->startRow(); $table2->addCell(' ', 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; }
/** * 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(); } }
//Ehb-added-End $table->startRow(); $orderLabel = new label($this->objLanguage->languageText('mod_contextgroups_orderresultsby', 'contextgroups') . ': ', 'input_order'); $searchdropdown->name = 'order'; $searchdropdown->cssId = 'input_order'; $searchdropdown->setSelected($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'); $dropdown->setSelected($numresults); $table->addCell($orderLabel->show() . $searchdropdown->show() . " " . $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(' '); $table->endRow(); $form = new form('searchforusers', $this->uri(array('action' => 'searchforusers'))); $form->addToForm($table->show()); echo $form->show(); // -------------------------------- if (count($results) == 0) { echo '<div class="noRecordsMessage">' . $this->objLanguage->languageText('mod_contextgroups_nousersfoundsearchcriteria', 'contextgroups', 'No Users found with search criteria') . '</div>'; } else {
$objLabel = new label($selectLabel, 'input_category'); $objDrop = new dropdown('category'); $objDrop->addOption('organise', $organise); $objDrop->addOption('communicate', $communicate); $objDrop->addOption('learn', $learn); $objDrop->addOption('admin', $admin); $objDrop->addOption('about', $about); $objDrop->addOption('postgrad', $postgrad); $objDrop->addOption('user', $user); $objDrop->addOption('course', $course); $objDrop->addOption('assessment', $assessment); $objDrop->addOption('site', $site); $objDrop->addOption('sems', 'SEMS'); if ($mode == 'edit') { $cat = $data['category']; $objDrop->setSelected($cat); } $objTable->addRow(array($objLabel->show(), $objDrop->show())); $objHead->str = $settingsLabel; $objHead->type = 3; $objTable->startRow(); $objTable->addCell($objHead->show(), '', '', '', '', 'colspan="4"'); $objTable->endRow(); // Admin only module $objLabel = new label($adminLabel, 'input_adminOnly'); $objCheck = new checkbox('adminOnly'); $objCheck->setChecked($adminOnly); $objTable->addRow(array($objLabel->show(), $objCheck->show())); // Context dependent module $objLabel = new label($dependsLabel, 'input_dependsContext'); $objCheck = new checkbox('dependsContext');