/** * Method to display the sysconfig interface */ public function show() { // Load the Radio button class $this->loadClass('radio', 'htmlelements'); // Input MUST be called 'pvalue' $objElement = new radio('pvalue'); $objElement->addOption('postlogin', $this->objLanguage->languageText('mod_postlogin_defaultpostlogin', 'postlogin', 'Default Postlogin Menu')); $objElement->addOption('elearnpostlogin', $this->objLanguage->languageText('mod_postlogin_elearnpostlogin', 'postlogin', 'Elearn Postlogin Menu')); // Set Default Selected $objElement->setSelected($this->defaultValue); // Set radio buttons to be one per line $objElement->setBreakSpace('<br />'); // return finished radio button return $objElement->show(); }
/** * Method to display the sysconfig interface * */ public function show() { // Load the Radio button class $this->loadClass('radio', 'htmlelements'); // Input MUST be called 'pvalue' $objElement = new radio('pvalue'); $objElement->addOption('TRUE', $this->objLanguage->languageText('word_true', 'system', 'True')); $objElement->addOption('FALSE', $this->objLanguage->languageText('word_false', 'system', 'False')); // Set Default Selected $objElement->setSelected($this->defaultVaule); // Set radio buttons to be inline $objElement->setBreakSpace(' '); $str = '<p>' . $this->objLanguage->languageText('mod_config_enableapcinfo', 'config', 'This parameter enables APC caching to improve the site speed. However it requires APC to be installed by the server owner - pecl install apc') . '</p>'; // return finished radio button return $str . $objElement->show(); }
/** * Method to return a customized input to the SysConfig form */ function show() { // Load the Radio button class $this->loadClass('radio', 'htmlelements'); // Input MUST be called 'pvalue' $objElement = new radio('pvalue'); $objElement->addOption('Y', $this->objLanguage->languageText('word_yes')); $objElement->addOption('N', $this->objLanguage->languageText('word_no')); // Set Default Selected $objElement->setSelected($this->defaultValue); // Set radio buttons to be one per line $objElement->setBreakSpace(' '); $string = '<p>' . $this->objLanguage->languageText('mod_creativecommons_enableby', 'creativecommons') . '</p>'; // return finished radio button return $string . $objElement->show(); }
/** * Method to display the sysconfig interface */ public function show() { // Load the Radio button class $this->loadClass('radio', 'htmlelements'); // Input MUST be called 'pvalue' $objElement = new radio('pvalue'); $objElement->addOption('dropdown', $this->objLanguage->languageText('mod_toolbar_dynamicdropdown', 'toolbar', 'Dynamic Dropdown')); $objElement->addOption('flat', $this->objLanguage->languageText('mod_toolbar_flatbuttons', 'toolbar', 'Flat Buttons')); $objElement->addOption('elearning', $this->objLanguage->languageText('mod_toolbar_elearningtoolbar', 'toolbar', 'Elearning Toolbar')); // Set Default Selected $objElement->setSelected($this->defaultValue); // Set radio buttons to be one per line $objElement->setBreakSpace('<br />'); // return finished radio button return $objElement->show(); }
/** * Method to return a customized input to the SysConfig form */ public function show() { // Load the Radio Button Class $this->loadClass('radio', 'htmlelements'); // Input MUST be called 'pvalue' $objElement = new radio('pvalue'); $systemTypeList = $this->objAbstract->listSystemTypes(); foreach ($systemTypeList as $systemType) { $objElement->addOption($systemType['systemtype'], $systemType['systemtype']); } // Set Default Selected $objElement->setSelected($this->defaultValue); $objElement->setBreakSpace('<br />'); $string = '<p>Please select the type of system text should be abstracted to:</p>'; // Return String return $string . $objElement->show(); }
/** * Method to display the sysconfig interface * */ public function show() { // Load the Radio button class $this->loadClass('radio', 'htmlelements'); // Load the Skin Object $objSkin = $this->getObject('skinchooser', 'skin'); $skinsList = $objSkin->getAllSkins(); // Input MUST be called 'pvalue' $objElement = new radio('pvalue'); foreach ($skinsList as $element => $value) { $objElement->addOption($element, $value); } // Set Default Selected $objElement->setSelected($this->defaultVaule); // Set radio buttons to be one per line $objElement->setBreakSpace('<br />'); // return finished radio button return $objElement->show(); }
/** * Method to display the list * * @return string Rendered Input */ public function show() { $objModules = $this->getObject('modules', 'modulecatalogue'); if (!$objModules->checkIfRegistered('creativecommons')) { return ''; } else { // Get All Licenses $licenses = $this->objCC->getAll(); // Create Radio Button $radio = new radio($this->inputName); // Set Breakspace $radio->setBreakSpace('<br />'); $iconsFolder = 'icons/creativecommons_v3'; // Generate Blank Icon $this->objIcon->setIcon('blank', NULL, $iconsFolder); $blankIcon = $this->objIcon->show(); // Loop through Licenses foreach ($licenses as $license) { // Check if License is Enabled if ($this->objSysConfig->getValue($license['code'], 'creativecommons') == 'Y') { if ($this->icontype == 'big') { $filename = $license['code'] . '_big'; } else { $filename = $license['code']; } $filename = str_replace('/', '_', $filename); $this->objIcon->setIcon($filename, NULL, $iconsFolder); $iconList = $this->objIcon->show(); $title = $license['title']; if ($title == 'Attribution Non-commercial Share') { $title = 'Attribution Non-commercial Share Alike'; } if ($license['url'] == '') { $url = $title; } else { $url = new link($license['url']); $url->link = $title; $url = $url->show(); } $title = $url; // Add to Radio Group $radio->addOption($license['code'], $iconList . ' ' . $title); } } // Set Default Selected Value if ($this->defaultValue) { $radio->setSelected($this->defaultValue); } else { $radio->setSelected($this->objSysConfig->getValue('default', 'creativecommons')); } // Return Radio Button return $radio->show(); } }
/** * 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; }
/** * Generate the (X)HTML to display the customised form. * * @return string The generated (X)HTML. */ function show() { // Get the parameter description. $description = '<p>' . $this->objLanguage->languageText('mod_creativecommons_default', 'creativecommons') . '</p>'; // Load the radio button class form the htmlelements module. $this->loadClass('radio', 'htmlelements'); // The name of the input field must be "pvalue". $objElement = new radio('pvalue'); // Add the licenses as options. foreach ($this->objCC->getAll() as $license) { $objElement->addOption($license['code'], $license['title']); } // Have the current value selected by default. $objElement->setSelected($this->defaultValue); // Display the radio buttons on separate lines. $objElement->setBreakSpace('<br />'); // Return the output. return $description . $objElement->show(); }
$table->addCell(' '); $accountTypeRadio = new radio('accounttype'); $accountTypeRadio->addOption('ldap', ' Network ID Authentication'); $accountTypeRadio->addOption('useradmin', ' Site / Database Authentication'); $accountTypeRadio->setBreakSpace('<br />'); $accountTypeRadio->extra = 'onclick="checkAccountType(this.value);"'; if ($mode == 'addfixup') { $accountTypeRadio->setSelected($this->getParam('accounttype')); } else { if ($user['howcreated'] == 'LDAP') { $accountTypeRadio->setSelected('ldap'); } else { $accountTypeRadio->setSelected('useradmin'); } } $table->addCell($accountTypeRadio->show()); $table->endRow(); } else { $accountType = new hiddeninput('accounttype', 'useradmin'); $form->addToForm($accountType->show()); } // Username $table->startRow(); $label = new label('Username', 'input_useradmin_username'); $textinput = new textinput('useradmin_username'); $textinput->size = 30; $textinput->extra = ' maxlength="25"'; $textinput->value = $user['username']; $usernameAddition = ''; if ($mode == 'addfixup') { $textinput->value = $this->getParam('useradmin_username');
$header->str = $this->objLanguage->languageText('mod_filemanager_editquota', 'filemanager', 'Edit Quota') . ': '; if (substr($quota['path'], 0, 7) == 'context') { $header->str .= ucfirst($this->objLanguage->code2Txt('mod_filemanager_contextfilesof', 'filemanager', NULL, '[-context-] Files of')) . ' ' . $this->objContext->getTitle(substr($quota['path'], 8)); $defaultQuota = $this->objQuotas->getDefaultContextQuota(); } else { $header->str .= $this->objLanguage->languageText('mod_filemanager_userfilesof', 'filemanager', 'User files of') . ' ' . $this->objUser->fullName(substr($quota['path'], 6)); $defaultQuota = $this->objQuotas->getDefaultUserQuota(); } echo $header->show(); $form = new form('updatequota', $this->uri(array('action' => 'updatequota'))); $hiddeninput = new hiddeninput('id', $quota['id']); $form->addToForm($hiddeninput->show()); $radio = new radio('quotatype'); $radio->addOption('Y', $this->objLanguage->languageText('mod_filemanager_usedefaultquotaof', 'filemanager', 'Use Default Quota of') . ' ' . $defaultQuota . ' MB'); $radio->addOption('N', $this->objLanguage->languageText('mod_filemanager_usecustomquota', 'filemanager', 'Use Custom Quota')); $radio->setBreakSpace('<br />'); $radio->setSelected($quota['usedefault']); $form->addToForm($radio->show()); $customQuota = new textinput('customquota'); $customQuota->size = 5; if ($quota['usedefault'] == 'Y') { $customQuota->value = $defaultQuota; } else { $customQuota->value = $quota['quota']; } $form->addToForm(': ' . $customQuota->show() . ' MB'); $button = new button('confirm', $this->objLanguage->languageText('mod_filemanager_updatequota', 'filemanager', 'Update Quota')); $button->setToSubmit(); $form->addToForm('<br /><br />' . $button->show()); $form->addRule('customquota', $this->objLanguage->languageText('mod_filemanager_validatenumber', 'filemanager', 'Please enter a number for the custom quota'), 'numeric'); echo $form->show();
/** * Method to process Error Upload Messages * @return string Confirmation message of error uploads */ public function processOverwriteMessages() { if ($this->getParam('overwrite') == '') { $overwriteMessage = ''; } else { $items = explode('__', $this->getParam('overwrite')); $overwriteMessage = ''; $table = $this->newObject('htmltable', 'htmlelements'); $table->startHeaderRow(); $table->addHeaderCell('Filename'); $table->addHeaderCell('File Size of Existing File', NULL, NULL, 'center'); $table->addHeaderCell('File Size of New File', NULL, NULL, 'center'); $table->addHeaderCell('Overwrite File?', NULL, NULL, 'center'); $table->endHeaderRow(); $actualItems = array(); $formatsize = new formatfilesize(); foreach ($items as $item) { // Get File Details $file = $this->objFiles->getFile($item); // Generate Path to File $tempFilePath = $this->objConfig->getcontentBasePath() . '/filemanager_tempfiles/' . $item; // Create Boolean Variable - does file exist if (file_exists($tempFilePath)) { $tempFileExists = TRUE; } else { $tempFileExists = FALSE; } // If no record if ($file == FALSE) { // Delete temp file if it exists if ($tempFileExists && is_file($tempFilePath)) { unlink($tempFilePath); } } else { if ($file && $tempFileExists) { // If Record and Temp File exists // Add to Form for User to choose option $actualItems[] = $item; $table->startRow(); $table->addCell('<strong>' . $file['filename'] . '</strong>'); $table->addCell($formatsize->formatsize($file['filesize']), NULL, NULL, 'center'); $table->addCell($formatsize->formatsize(filesize($tempFilePath)), NULL, NULL, 'center'); $radio = new radio($item); $radio->addOption('delete', ' No'); $radio->addOption('overwrite', ' Yes'); $radio->setSelected('delete'); $radio->setBreakSpace(' '); $table->addCell($radio->show(), NULL, NULL, 'center'); $table->endRow(); } } } if (count($actualItems) > 0) { $form = new form('overwriteoptions', $this->uri(array('action' => 'fixtempfiles'))); $form->addToForm($table->show()); $list = ''; $separator = ''; foreach ($actualItems as $itemId) { $list .= $separator . $itemId; $separator = '__'; } $hiddenInput = new hiddeninput('listitems', $list); $form->addToForm($hiddenInput->show()); $overMsg = $this->objLanguage->languageText('mod_filemanager_overwriteconfirm', 'filemanager', 'Do you wish to overwrite?'); $button = new button('submitform', $overMsg); $button->setToSubmit(); $form->addToForm($button->show()); $overwriteMessage = $form->show(); } } return $overwriteMessage; }
/** * 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; }
$table->startRow(); $table->addCell($cellnumLabel->show(), 150, NULL, 'right'); $table->addCell($cellnum->show()); $table->endRow(); $sexRadio = new radio('register_sex'); $sexRadio->addOption('M', $this->objLanguage->languageText('word_male', 'system')); $sexRadio->addOption('F', $this->objLanguage->languageText('word_female', 'system')); $sexRadio->setBreakSpace(' '); if ($mode == 'addfixup') { $sexRadio->setSelected($this->getParam('register_sex')); } else { $sexRadio->setSelected('M'); } $table->startRow(); $table->addCell($this->objLanguage->languageText('word_gender', 'userregistration', 'Gender') . ' ', 150, NULL, 'right'); $table->addCell($sexRadio->show()); $table->endRow(); $table->startRow(); $objCountries =& $this->getObject('languagecode', 'language'); $table->addCell($this->objLanguage->languageText('word_country', 'system') . ' ', 150, NULL, 'right'); if ($mode == 'addfixup') { $table->addCell($objCountries->countryAlpha($this->getParam('country'))); } else { $table->addCell($objCountries->countryAlpha()); } $table->endRow(); $fieldset = $this->newObject('fieldset', 'htmlelements'); $fieldset->legend = $this->objLanguage->languageText('phrase_userdetails', 'userregistration', 'User Details'); $fieldset->contents = $table->show(); $form->addToForm($fieldset->show()); $form->addToForm('<br />');
<?php $this->loadClass('htmlheading', 'htmlelements'); $this->loadClass('form', 'htmlelements'); $this->loadClass('radio', 'htmlelements'); $this->loadClass('hiddeninput', 'htmlelements'); $this->loadClass('button', 'htmlelements'); $header = new htmlheading(); $header->type = 1; $header->str = ucwords($this->objLanguage->code2Txt('mod_contextadmin_deletecontext', 'contextadmin', NULL, 'Delete [-context-]')) . ':' . $context['title']; echo $header->show(); $objDisplayContext = $this->getObject('displaycontext', 'context'); echo $objDisplayContext->formatContextDisplayBlock($context); $form = new form('deletecontext', $this->uri(array('action' => 'deleteconfirm'))); $radio = new radio('deleteconfirm'); $radio->addOption('no', ' ' . $this->objLanguage->languageText('word_no', 'system', 'No') . ' - ' . $this->objLanguage->code2Txt('mod_contextadmin_donotdeletecontext', 'contextadmin', NULL, 'Do not delete the [-context-]')); $radio->addOption('yes', ' ' . $this->objLanguage->languageText('word_yes', 'system', 'Yes') . ' - ' . $this->objLanguage->code2Txt('mod_contextadmin_dodeletecontext', 'contextadmin', NULL, 'Delete the [-context-]')); $radio->setSelected('no'); $radio->setBreakSpace(' '); $form->addToForm('<p>' . $this->objLanguage->languageText('mod_contextadmin_confirmdeletecontext', 'contextadmin', 'Are you sure you want to delete this context?') . '</p>'); $form->addToForm('<p>' . $radio->show() . '</p>'); $button = new button('confirm', $this->objLanguage->languageText('word_confirm', 'system', 'Confirm')); $button->setToSubmit(); $cancelButton = new button('cancel', $this->objLanguage->languageText('word_cancel', 'system', 'Cancel')); $cancelButton->setOnClick("javascript: history.go(-1);"); $form->addToForm('<p>' . $button->show() . ' ' . $cancelButton->show() . '</p>'); $hiddenInput = new hiddeninput('contextcode', $context['contextcode']); $form->addToForm($hiddenInput->show()); echo $form->show();
/** * this creates the visibility control field * @param type $id * @return type */ function createFileVisibilityForm($id) { $dbFile = $this->getObject("dbfile", "filemanager"); $file = $dbFile->getFile($id); $form = new form('visibilityform', $this->uri(array('action' => 'setfilevisibility', 'id' => $id))); $visibleTxt = $this->objLanguage->languageText('mod_filemanager_visible', 'filemanager'); $hiddenTxt = $this->objLanguage->languageText('mod_filemanager_hidden', 'filemanager'); $legend = $this->objLanguage->languageText('mod_filemanager_visibility', 'filemanager'); $objElement = new radio('access_radio'); $objElement->addOption('visible', $visibleTxt . '<br/>'); $objElement->addOption('hidden', $hiddenTxt . '<br/>'); $access = $file['visibility'] == NULL ? 'visible' : $file['visibility']; $objElement->setSelected($access); $applyButton = new button('apply', $this->objLanguage->languageText('mod_filemanager_apply', 'filemanager')); $applyButton->setToSubmit(); $fieldset = new fieldset(); $fieldset->setLegend($legend); $fieldset->addContent($objElement->show() . '<br/>' . $applyButton->show()); $hiddeninput = new hiddeninput('id', $id); $form->addToForm($hiddeninput->show()); $form->addToForm($fieldset->show()); $content = $form->show(); $objModule = $this->getObject('modules', 'modulecatalogue'); //See if the simple map module is registered and set a param $isRegistered = $objModule->checkIfRegistered('digitallibrary'); if ($isRegistered) { $dlfieldset = new fieldset(); $dlfieldset->setLegend("Link to digital library"); $link = new link($this->uri(array("action" => "linkfromfilemanager", "fileid" => $id), "digitallibrary")); $link->link = "<strong>Link this file</>"; $dlfieldset->addContent($link->show()); $content .= $dlfieldset->show(); } return $content; }
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(); $table->addCell($this->objLanguage->languageText('word_access', 'system', 'Access')); $table->addCell($access->show()); $table->endRow(); } $emailAlert = new checkbox('emailalertopt', $this->objLanguage->languageText('mod_contextadmin_emailalertwhat', 'contextadmin', 'Send email alerts'), true); // this will checked if ($mode == 'add' && is_array($fixup)) { $emailAlert->setChecked($fixup['alerts']); } elseif ($mode == 'add') { $emailAlert->setChecked('0'); } else { if ($mode == 'edit') { $emailAlert->setChecked($context['alerts']); } } $table->startRow(); $table->addCell($this->objLanguage->languageText('mod_contextadmin_emailalert', 'contextadmin', 'Alerts'));
//Is the story active if (!isset($isActive)) { $isActive = '1'; } //Add a row for the make sticky $act = 0; if (isset($isActive)) { if ($isActive == 1) { $act = 1; } } $objRadioElement = new radio('isActive'); $objRadioElement->addOption('1', $objLanguage->languageText("word_yes")); $objRadioElement->addOption('0', $objLanguage->languageText("word_no")); $objRadioElement->setSelected($act); $objFmTable2->addCell($objRadioElement->show(), NULL, "top", "center"); $objFmTable2->addCell($this->formatDate($dateCreated), NULL, "top", "center"); //Correct the date format for expirationDate for the popup cal if (strlen($expirationDate) == 19) { $expirationDate = substr($expirationDate, 0, 16); #this is a dirty hack } $objTextInput = new textinput('expirationDate', $expirationDate); $cell = $objTextInput->show(); $objIcon = $this->newObject('geticon', 'htmlelements'); $objIcon->setIcon('modules/calendar'); $objIcon->alt = $this->objLanguage->code2Txt('mod_' . $textModule . '_dpick'); $objLink = $this->newObject('link', 'htmlelements'); $objLink->link("javascript:show_calendar('document.storyinput.expirationDate', document.storyinput.expirationDate.value);"); $objLink->link = $objIcon->show(); $cell .= $objLink->show();
// Default Set to None $radio->setSelected('none'); $radio->extra = 'onclick="updateChangeList(\'' . $result['userid'] . '\');"'; // Check if Guest if (in_array($result['userid'], $guests)) { $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();
/** * Method to show the interface for overwriting files */ public function showUserOverwiteInterface() { $userId = $this->objUser->userId(); $tempFiles = $this->objFile->getTemporaryFiles($userId); $form = new form('fixtempfiles', $this->uri(array('action' => 'fixtempfiles'))); $divider = ''; $splitter = ''; $listItems = ''; $submitButton = new button('submitform', 'Update Files'); $submitButton->setToSubmit(); $objHighlightLabels = $this->getObject('highlightlabels', 'htmlelements'); $objHighlightLabels->show(); $formatsize = new formatfilesize(); foreach ($tempFiles as $file) { //$form->addToForm($divider); //$divider = '<hr size="1" width="70%" />'; $listItems .= $splitter . $file['id']; $splitter = '|'; // Rename Id of the button to keep them unique $submitButton->cssId = 'input_button_' . $file['id']; $originalFile = $this->objFile->getOriginalFile($file['filename'], $userId); $form->addToForm('<h2>' . $file['filename'] . '</h2>'); $table = $this->newObject('htmltable', 'htmlelements'); $table->startHeaderRow(); $table->addHeaderCell('Info', '20%'); $table->addHeaderCell('Old File', '40%'); $table->addHeaderCell('New File', '40%'); $table->endHeaderRow(); if ($originalFile['category'] == 'images') { $oldThumbnail = $this->objFileEmbed->embed($this->objThumbnails->getThumbnail($originalFile['id'], $originalFile['filename']), 'image'); $newThumbnail = $this->objFileEmbed->embed($this->objThumbnails->getThumbnail($file['id'], $file['filename']), 'image'); // File Preview $table->startRow(); $table->addCell('File Preview'); $table->addCell($oldThumbnail); $table->addCell($newThumbnail); $table->endRow(); } else { $oldThumbnail = 'gdsgsd'; $newThumbnail = 'gdsgsd'; } // File Size $table->startRow(); $table->addCell('Size of File'); $table->addCell($formatsize->formatsize($originalFile['filesize'])); $table->addCell($formatsize->formatsize($file['filesize'])); $table->endRow(); // Date Uploaded $table->startRow(); $table->addCell('Date Uploaded'); $table->addCell($this->objFormatDateTime->formatDateOnly($originalFile['datecreated']) . ' at ' . $this->objFormatDateTime->formatTime($originalFile['timecreated'])); $table->addCell($this->objFormatDateTime->formatDateOnly($file['datecreated']) . ' at ' . $this->objFormatDateTime->formatTime($file['timecreated'])); $table->endRow(); $form->addToForm($table->show()); $form->addToForm('<h4>Options:</h4>'); $radio = new radio($file['id']); $radio->setBreakSpace('<br />'); $radio->addOption('ignore', 'Ignore this file for the time being'); $radio->addOption('overwrite', 'Overwrite old file with new one'); $radio->addOption('deletetemp', 'Delete the Temporary File'); $extension = $this->objFileParts->getExtension($file['filename']); if (strlen($extension) == strlen($file['filename'])) { $filename = $file['filename']; $extension = ''; } else { $filename = substr($file['filename'], 0, strlen($file['filename']) - strlen($extension) - 1); $extension = '.' . $extension; } $textinput = new textinput('rename__' . $file['id'], $filename); $textinput->size = 50; $extensioninput = new textinput('extension__' . $file['id'], $extension); $extensioninput->size = 5; $extensioninput->extra = ' readonly="true"'; // Fix Up - Highlight Radio Button //$textinput->extra = ' onclick="document.getElementById(\'input_gen19Srv1Nme34_247ignore\').focus();"; '; //$radio->addOption('rename', 'Rename the temporary file to: '); $radio->setSelected('ignore'); //$form->addToForm($radio->show().$textinput->show().$extensioninput->show()); $form->addToForm($radio->show()); $form->addToForm('<p align="center">' . $submitButton->show() . '</p>'); } $hiddenInput = new hiddeninput('listitems', $listItems); $form->addToForm($hiddenInput->show()); return $form->show(); }
/** * * Method to generate the html for the form template * * @access public * @return string $string The html string to be sent to the template */ public function showMain() { if ($this->check) { $userArray = $this->objDBusers->getUser($this->userId); } else { $userArray = $this->objUserAdmin->getUserDetails($this->userId); } $titleValue = $userArray['title']; $firstNameValue = $userArray['firstname']; $lastNameValue = $userArray['surname']; $genderValue = $userArray['sex']; $countryValue = $userArray['country']; $emailAddressValue = $userArray['emailaddress']; $contactNumberValue = $userArray['cellnumber']; $userId = $userArray['userid']; $passwordValue = NULL; $confirmPasswordValue = NULL; if ($this->check) { $middleNameValue = $userArray['middle_name']; $dayValue = !empty($userArray['date_of_birth']) ? date('j', strtotime($userArray['date_of_birth'])) : NULL; $monthValue = !empty($userArray['date_of_birth']) ? date('n', strtotime($userArray['date_of_birth'])) : NULL; $yearValue = !empty($userArray['date_of_birth']) ? date('Y', strtotime($userArray['date_of_birth'])) : NULL; if (!empty($userArray['address'])) { $address = explode('|', $userArray['address']); $addressOneValue = $address[0]; $addressTwoValue = $address[1]; } else { $addressOneValue = NULL; $addressTwoValue = NULL; } $cityValue = $userArray['city']; $stateValue = $userArray['state']; $postalCodeValue = $userArray['postal_code']; $schoolIdValue = $userArray['school_id']; $schoolArray = $this->objDBschools->getSchool($schoolIdValue); $schoolValue = $schoolArray['name']; $descriptionValue = $userArray['description']; } else { $staffNumberValue = $userArray['staffnumber']; } $errors = $this->getSession('errors'); $titleValue = !empty($errors) ? $errors['data']['title'] : $titleValue; $firstNameValue = !empty($errors) ? $errors['data']['first_name'] : $firstNameValue; $lastNameValue = !empty($errors) ? $errors['data']['last_name'] : $lastNameValue; $genderValue = !empty($errors) ? $errors['data']['gender'] : $genderValue; $countryValue = !empty($errors) ? $errors['data']['country'] : $countryValue; $emailAddressValue = !empty($errors) ? $errors['data']['email_address'] : $emailAddressValue; $contactNumberValue = !empty($errors) ? $errors['data']['contact_number'] : $contactNumberValue; $passwordValue = !empty($errors) ? $errors['data']['password'] : $passwordValue; $confirmPasswordValue = !empty($errors) ? $errors['data']['confirm_password'] : $confirmPasswordValue; $titleError = !empty($errors) && array_key_exists('title', $errors['errors']) ? $errors['errors']['title'] : NULL; $firstNameError = !empty($errors) && array_key_exists('first_name', $errors['errors']) ? $errors['errors']['first_name'] : NULL; $lastNameError = !empty($errors) && array_key_exists('last_name', $errors['errors']) ? $errors['errors']['last_name'] : NULL; $genderError = !empty($errors) && array_key_exists('gender', $errors['errors']) ? $errors['errors']['gender'] : NULL; $emailAddressError = !empty($errors) && array_key_exists('email_address', $errors['errors']) ? $errors['errors']['email_address'] : NULL; $passwordError = !empty($errors) && array_key_exists('password', $errors['errors']) ? $errors['errors']['password'] : NULL; if ($this->check) { $middleNameValue = !empty($errors) ? $errors['data']['middle_name'] : $middleNameValue; $dayValue = !empty($errors) ? $errors['data']['date_of_birth'][0] : $dayValue; $monthValue = !empty($errors) ? $errors['data']['date_of_birth'][1] : $monthValue; $yearValue = !empty($errors) ? $errors['data']['date_of_birth'][2] : $yearValue; $addressOneValue = !empty($errors) ? $errors['data']['address'][0] : $addressOneValue; $addressTwoValue = !empty($errors) ? $errors['data']['address'][1] : $addressTwoValue; $cityValue = !empty($errors) ? $errors['data']['city'] : $cityValue; $stateValue = !empty($errors) ? $errors['data']['state'] : $stateValue; $postalCodeValue = !empty($errors) ? $errors['data']['postal_code'] : $postalCodeValue; $schoolIdValue = !empty($errors) ? $errors['data']['school_id'] : $schoolIdValue; if (!is_null($schoolIdValue)) { $schoolArray = $this->objDBschools->getSchool($schoolIdValue); $schoolValue = $schoolArray['name']; } $descriptionValue = !empty($errors) ? $errors['data']['description'] : $descriptionValue; $schoolError = !empty($errors) && array_key_exists('school_id', $errors['errors']) ? $errors['errors']['school_id'] : NULL; $dateOfBirthError = !empty($errors) && array_key_exists('date_of_birth', $errors['errors']) ? $errors['errors']['date_of_birth'] : NULL; $addressError = !empty($errors) && array_key_exists('address', $errors['errors']) ? $errors['errors']['address'] : NULL; $cityError = !empty($errors) && array_key_exists('city', $errors['errors']) ? $errors['errors']['city'] : NULL; $stateError = !empty($errors) && array_key_exists('state', $errors['errors']) ? $errors['errors']['state'] : NULL; $postalCodeError = !empty($errors) && array_key_exists('postal_code', $errors['errors']) ? $errors['errors']['postal_code'] : NULL; $descriptionError = !empty($errors) && array_key_exists('description', $errors['errors']) ? $errors['errors']['description'] : NULL; } $titleLabel = $this->objLanguage->languageText('word_title', 'system', 'ERROR: word_title'); $mr = $this->objLanguage->languageText('title_mr', 'system', 'TITLE: title_mr'); $miss = $this->objLanguage->languageText('title_miss', 'system', 'TITLE: title_miss'); $mrs = $this->objLanguage->languageText('title_mrs', 'system', 'TITLE: title_mrs'); $ms = $this->objLanguage->languageText('title_ms', 'system', 'TITLE: title_ms'); $dr = $this->objLanguage->languageText('title_dr', 'system', 'TITLE: title_dr'); $rev = $this->objLanguage->languageText('title_rev', 'system', 'TITLE: title_rev'); $prof = $this->objLanguage->languageText('title_prof', 'system', 'TITLE: title_prof'); $assocprof = $this->objLanguage->languageText('title_assocprof', 'system', 'TITLE: title_assocprof'); $sir = $this->objLanguage->languageText('title_sir', 'system', 'TITLE: title_sir'); $dame = $this->objLanguage->languageText('title_dame', 'system', 'TITLE: title_dame'); $firstNameLabel = $this->objLanguage->languageText('phrase_firstname', 'system', 'ERROR: phrase_firstname'); $lastNameLabel = $this->objLanguage->languageText('phrase_lastname', 'system', 'ERROR: phrase_lastname'); $genderLabel = $this->objLanguage->languageText('word_gender', 'system', 'ERROR: word_gender'); $maleLabel = $this->objLanguage->languageText('word_male', 'system', 'ERROR: word_male'); $femaleLabel = $this->objLanguage->languageText('word_female', 'system', 'ERROR: word_female'); $dateOfBirthLabel = $this->objLanguage->languageText('phrase_dateofbirth', 'system', 'ERROR: phrase_dateofbirth'); $addressLabel = $this->objLanguage->languageText('word_address', 'system', 'ERROR: word_address'); $cityLabel = $this->objLanguage->languageText('word_city', 'system', 'ERROR: word_city'); $stateLabel = $this->objLanguage->languageText('word_state', 'system', 'ERROR: word_state'); $countryLabel = $this->objLanguage->languageText('word_country', 'system', 'ERROR: word_country'); $postalCodeLabel = $this->objLanguage->languageText('phrase_postalcode', 'system', 'ERROR: phrase_postalcode'); $emailAddressLabel = $this->objLanguage->languageText('phrase_emailaddress', 'system', 'ERROR: phrase_emailaddress'); $contactNumberLabel = $this->objLanguage->languageText('phrase_contactnumber', 'system', 'ERROR: phrase_contactnumber'); $usernameLabel = $this->objLanguage->languageText('word_username', 'system', 'ERROR: word_username'); $passwordLabel = $this->objLanguage->languageText('word_password', 'system', 'ERROR: word_password'); $confirmPasswordLabel = $this->objLanguage->languageText('phrase_confirmpassword', 'system', 'ERROR: phrase_confirmpassword'); $passwordNotAlike = $this->objLanguage->languageText('mod_userdetails_passwordsnotalike', 'userdetails', 'ERROR: mod_userdetails_passwordsnotalike'); $updateLabel = $this->objLanguage->languageText('mod_userdetails_updatedetails', 'userdetails', 'ERROR: mod_userdetails_updatedetails'); $successTitleLabel = $this->objLanguage->languageText('word_success', 'system', 'ERROR: word_success'); $successImageLabel = $this->objLanguage->languageText('mod_userdetails_userimagereset', 'userdetails', 'ERROR: mod_userdetails_userimagereset'); $resetLabel = $this->objLanguage->languageText('phrase_resetform', 'system', 'ERROR: phrase_resetform'); $successDetailsLabel = $this->objLanguage->languageText('mod_userdetails_detailssuccessfullyupdate', 'userdetails', 'ERROR: mod_userdetails_detailssuccessfullyupdate'); $successPasswordLabel = $this->objLanguage->languageText('mod_userdetails_passwordupdated', 'userdetails', 'ERROR: mod_userdetails_passwordupdated'); $errorLabel = $this->objLanguage->languageText('word_error', 'system', 'ERROR: word_error'); $noChangeLabel = $this->objLanguage->languageText('mod_userdetails_nochange', 'userdetails', 'ERROR: mod_userdetails_nochange'); if ($this->check) { $middleNameLabel = $this->objLanguage->languageText('mod_schoolusers_middlename', 'schoolusers', 'ERROR: mod_schoolusers_middlename'); $schoolLabel = $this->objLanguage->code2Txt('mod_schools_school', 'schools', NULL, 'ERROR: mod_schools_school'); $descriptionLabel = $this->objLanguage->languageText('mod_schoolusers_aboutyourself', 'schoolusers', 'ERROR: mod_schoolusers_aboutyourself'); } else { $staffNumberLabel = $this->objLanguage->languageText('phrase_staffstudnumber', 'system', 'ERROR: phrase_staffstudnumber'); } $arrayVars = array(); $arrayVars['password_not_alike'] = $passwordNotAlike; // pass password error to javascript. $this->objSvars->varsToJs($arrayVars); $bizcard = $this->showBizCard(); $objLayer = new layer(); $objLayer->id = 'bizcard'; $objLayer->str = $bizcard; $bizcardLayer = $objLayer->show(); $string = $bizcardLayer; // Show the userid so the user has a place to find it $uidExplain = $this->objLanguage->languageText('mod_userdetails_uidexplain', 'userdetails', 'Your user ID'); $objLayer = new layer(); $objLayer->id = 'userid_exp'; $objLayer->str = $uidExplain . ": <span class='uid'>" . $userId . "</span>"; $expLayer = $objLayer->show(); $string = $string . $expLayer; // set up html elements $objDrop = new dropdown('title'); $objDrop->addOption($mr, $mr); $objDrop->addOption($miss, $miss); $objDrop->addOption($mrs, $mrs); $objDrop->addOption($ms, $ms); $objDrop->addOption($dr, $dr); $objDrop->addOption($rev, $rev); $objDrop->addOption($prof, $prof); $objDrop->addOption($assocprof, $assocprof); $objDrop->addOption($sir, $sir); $objDrop->addOption($dame, $dame); $objDrop->setSelected($titleValue); $titleDrop = $objDrop->show(); $objInput = new textinput('first_name', $firstNameValue, '', '50'); $firstNameInput = $objInput->show(); $objInput = new textinput('last_name', $lastNameValue, '', '50'); $lastNameInput = $objInput->show(); $objRadio = new radio('gender'); $objRadio->addOption('M', $maleLabel); $objRadio->addOption('F', $femaleLabel); $objRadio->setSelected($genderValue); $genderRadio = $objRadio->show(); $countryDrop = $this->objCountries->countryAlpha($countryValue); $objInput = new textinput('email_address', $emailAddressValue, '', '50'); $emailAddressInput = $objInput->show(); $objInput = new textinput('contact_number', $contactNumberValue, '', '50'); $contactNumberInput = $objInput->show(); $objInput = new textinput('password', $passwordValue, 'password', '50'); $passwordInput = $objInput->show(); $objInput = new textinput('confirm_password', $confirmPasswordValue, 'password', '50'); $confirmPasswordInput = $objInput->show(); $objButton = new button('update', $updateLabel); $objButton->setToSubmit(); $updateButton = $objButton->show(); $objButton = new button('reset', $resetLabel); $objButton->setToSubmit(); $resetButton = $objButton->show(); if ($this->check) { $objInput = new textinput('school', $schoolValue, '', '50'); $schoolInput = $objInput->show(); $objInput = new textinput('school_id', $schoolIdValue, 'hidden', ''); $schoolIdInput = $objInput->show(); $objInput = new textinput('middle_name', $middleNameValue, '', '50'); $middleNameInput = $objInput->show(); $day = range(1, 31); array_unshift($day, '-'); $days = array_combine($day, $day); $months = array('-' => '-', 1 => 'Jan', 2 => 'Feb', 3 => 'Mar', 4 => 'Apr', 5 => 'May', 6 => 'Jun', 7 => 'Jul', 8 => 'Aug', 9 => 'Sep', 10 => 'Oct', 11 => 'Nov', 12 => 'Dec'); $year = range(date('Y'), date('Y') - 85); array_unshift($year, '-'); $years = array_combine($year, $year); $objDrop = new dropdown('date_of_birth[]'); $objDrop->extra = 'style="width: auto;"'; $objDrop->addFromArray($days); $objDrop->setSelected($dayValue); $dayDrop = $objDrop->show(); $objDrop = new dropdown('date_of_birth[]'); $objDrop->extra = 'style="width: auto;"'; $objDrop->addFromArray($months); $objDrop->setSelected($monthValue); $monthDrop = $objDrop->show(); $objDrop = new dropdown('date_of_birth[]'); $objDrop->extra = 'style="width: auto;"'; $objDrop->addFromArray($years); $objDrop->setSelected($yearValue); $yearDrop = $objDrop->show(); $objInput = new textinput('address[]', $addressOneValue, '', '50'); $addressOneInput = $objInput->show(); $objInput = new textinput('address[]', $addressTwoValue, '', '50'); $addressTwoInput = $objInput->show(); $objInput = new textinput('city', $cityValue, '', '50'); $cityInput = $objInput->show(); $objInput = new textinput('state', $stateValue, '', '50'); $stateInput = $objInput->show(); $objInput = new textinput('postal_code', $postalCodeValue, '', '50'); $postalCodeInput = $objInput->show(); $objText = new textarea('description', $descriptionValue); $descriptionText = $objText->show(); } else { $objInput = new textinput('staffnumber', $staffNumberValue, '', '50'); $staffNumberInput = $objInput->show(); } $objTable = new htmltable(); $objTable->cellpadding = '4'; if ($this->check) { $objTable->startRow(); $objTable->addCell('<b>' . ucfirst(strtolower($schoolLabel)) . ': </b>', '', '', '', '', '', ''); $objTable->addCell($schoolError . $schoolIdInput . $schoolInput, '', '', '', '', '', ''); $objTable->endRow(); } $objTable->startRow(); $objTable->addCell('<b>' . $titleLabel . ': </b>', '200px', '', '', '', '', ''); $objTable->addCell($titleError . $titleDrop, '', '', '', '', '', ''); $objTable->endRow(); $objTable->startRow(); $objTable->addCell('<b>' . $firstNameLabel . ': </b>', '', '', '', '', '', ''); $objTable->addCell($firstNameError . $firstNameInput, '', '', '', '', '', ''); $objTable->endRow(); if ($this->check) { $objTable->startRow(); $objTable->addCell('<b>' . $middleNameLabel . ': </b>', '', '', '', '', '', ''); $objTable->addCell($middleNameInput, '', '', '', '', '', ''); $objTable->endRow(); } $objTable->startRow(); $objTable->addCell('<b>' . $lastNameLabel . ': </b>', '', '', '', '', '', ''); $objTable->addCell($lastNameError . $lastNameInput, '', '', '', '', '', ''); $objTable->endRow(); if (!$this->check) { $objTable->startRow(); $objTable->addCell('<b>' . $staffNumberLabel . ': </b>', '', '', '', '', '', ''); $objTable->addCell($staffNumberInput, '', '', '', '', '', ''); $objTable->endRow(); } $objTable->startRow(); $objTable->addCell('<b>' . $genderLabel . ': </b>', '', '', '', '', '', ''); $objTable->addCell($genderError . $genderRadio, '', '', '', '', '', ''); $objTable->endRow(); if ($this->check) { $objTable->startRow(); $objTable->addCell('<b>' . $dateOfBirthLabel . ': </b>', '', '', '', '', '', ''); $objTable->addCell($dateOfBirthError . $dayDrop . ' / ' . $monthDrop . ' / ' . $yearDrop, '', '', '', '', '', ''); $objTable->endRow(); $objTable->startRow(); $objTable->addCell('<b>' . $addressLabel . ': </b>', '', '', '', '', '', ''); $objTable->addCell($addressError . $addressOneInput, '', '', '', '', '', ''); $objTable->endRow(); $objTable->startRow(); $objTable->addCell('', '', '', '', '', '', ''); $objTable->addCell($addressTwoInput, '', '', '', '', '', ''); $objTable->endRow(); $objTable->startRow(); $objTable->addCell('<b>' . $cityLabel . ': </b>', '', '', '', '', '', ''); $objTable->addCell($cityError . $cityInput, '', '', '', '', '', ''); $objTable->endRow(); $objTable->startRow(); $objTable->addCell('<b>' . $stateLabel . ': </b>', '', '', '', '', '', ''); $objTable->addCell($stateError . $stateInput, '', '', '', '', '', ''); $objTable->endRow(); } $objTable->startRow(); $objTable->addCell('<b>' . $countryLabel . ': </b>', '', '', '', '', '', ''); $objTable->addCell($countryDrop, '', '', '', '', '', ''); $objTable->endRow(); if ($this->check) { $objTable->startRow(); $objTable->addCell('<b>' . $postalCodeLabel . ': </b>', '', '', '', '', '', ''); $objTable->addCell($postalCodeError . $postalCodeInput, '', '', '', '', '', ''); $objTable->endRow(); } $objTable->startRow(); $objTable->addCell('<b>' . $emailAddressLabel . ': </b>', '', '', '', '', '', ''); $objTable->addCell($emailAddressError . $emailAddressInput, '', '', '', '', '', ''); $objTable->endRow(); $objTable->startRow(); $objTable->addCell('<b>' . $contactNumberLabel . ': </b>', '', '', '', '', '', ''); $objTable->addCell($contactNumberInput, '', '', '', '', '', ''); $objTable->endRow(); if ($this->check) { $objTable->startRow(); $objTable->addCell('<b>' . $descriptionLabel . ': </b>', '', '', '', '', '', ''); $objTable->addCell($descriptionError . $descriptionText, '', '', '', '', '', ''); $objTable->endRow(); } $objTable->startRow(); $objTable->addCell('<b>' . $usernameLabel . ': </b>', '', '', '', '', '', ''); $objTable->addCell('<strong>' . $userArray['username'] . '</strong>', '', '', '', '', '', ''); $objTable->endRow(); $objTable->startRow(); $objTable->addCell('<b>' . $passwordLabel . ': </b>', '', '', '', '', '', ''); $objTable->addCell($passwordError . $passwordInput, '', '', '', '', '', ''); $objTable->endRow(); $objTable->startRow(); $objTable->addCell('<b>' . $confirmPasswordLabel . ': </b>', '', '', '', '', '', ''); $objTable->addCell($confirmPasswordInput, '', '', '', '', '', ''); $objTable->endRow(); $objTable->startRow(); $objTable->addCell($updateButton . ' ' . $resetButton, '', '', '', '', 'colspan="2"', ''); $objTable->endRow(); $userTable = $objTable->show(); $objForm = new form('user', $this->uri(array('action' => 'validate'), 'userdetails')); $objForm->extra = ' enctype="multipart/form-data"'; $objForm->addToForm($userTable); $addForm = $objForm->show(); $string .= '<br />' . $addForm; $this->objDialog = $this->newObject('dialog', 'jquerycore'); $this->objDialog->setCssId('dialog_imagereset'); $this->objDialog->setTitle(ucwords($successTitleLabel)); $this->objDialog->setCloseOnEscape(FALSE); $this->objDialog->setContent('<span class="success">' . $successImageLabel . '</span>'); $this->objDialog->setAutoOpen(FALSE); $this->objDialog->setOpen("jQuery('.ui-dialog-titlebar-close').hide();"); $dialog = $this->objDialog->show(); $success = $this->getSession('success', NULL); if (!empty($success)) { if (in_array('no change', $success)) { $this->objDialog = $this->newObject('dialog', 'jquerycore'); $this->objDialog->setCssId('dialog_nochange'); $this->objDialog->setTitle(ucwords($errorLabel)); $this->objDialog->setCloseOnEscape(FALSE); $this->objDialog->setContent('<span class="error">' . $noChangeLabel . '</span>'); $this->objDialog->setAutoOpen(TRUE); $this->objDialog->setOpen("jQuery('.ui-dialog-titlebar-close').hide();"); $this->objDialog->setBeforeClose('resetSession(this)'); $dialog .= $this->objDialog->show(); } else { $content = ''; if (in_array('details', $success)) { $content .= '<span class="success">' . $successDetailsLabel . '</span><br />'; } if (in_array('password', $success)) { $content .= '<span class="success">' . $successPasswordLabel . '</span>'; } $this->objDialog = $this->newObject('dialog', 'jquerycore'); $this->objDialog->setCssId('dialog_updatesuccess'); $this->objDialog->setTitle(ucwords($successTitleLabel)); $this->objDialog->setCloseOnEscape(FALSE); $this->objDialog->setContent($content); $this->objDialog->setAutoOpen(TRUE); $this->objDialog->setOpen("jQuery('.ui-dialog-titlebar-close').hide();"); $this->objDialog->setBeforeClose('resetSession(this)'); $dialog .= $this->objDialog->show(); } } $string .= $dialog; return $string; }
/** * CallBack method used by the evaluate method. * * @access public * @author Jonathan Abrahams * @return array */ function dependsOnContext($dependOn = 'TRUE') { $function = 'dependsOnContext | '; $objRadio = new radio('value'); $objRadio->addOption($function . 'TRUE', 'TRUE'); $objRadio->addOption($function . 'FALSE', 'FALSE'); $selected = $function . $dependOn; $objRadio->setSelected($selected); $lblDependsOnContext = $this->objLanguage->code2Txt('mod_contextpermissions_lblDependsOnContext', 'contextpermissions'); $objLabel = new label($lblDependsOnContext, 'input_value'); $lblName = $objLabel->show(); return array('lblName' => $lblName, 'element' => $objRadio->show()); }