$devmsg = nl2br($devmsg); $usrmsg = nl2br($usrmsg); $blurb = $this->objLanguage->languagetext("mod_errors_blurb", "errors"); //$midcol .= $blurb; $midcol .= $objFeatureBox->show($this->objLanguage->languagetext("mod_errors_usrtitle", "errors"), $usrmsg); //'<div class="featurebox">' . nl2br($usrmsg) . '</div>'; $midcol .= $objFeatureBox->show($this->objLanguage->languagetext("mod_errors_devtitle", "errors"), $devmsg); //'<div class="featurebox">' . nl2br($devmsg) . '</div>'; //$logfile = htmlentities(file_get_contents('error_log/system_errors.log')); //$midcol .= $objFeatureBox->show($this->objLanguage->languagetext("mod_errors_logfiletitle", "errors"), $logfile); // CAPTCHA $objCaptcha = $this->getObject('captcha', 'utilities'); $captcha = new textinput('request_captcha'); $captchaLabel = NULL; // new label($this->objLanguage->languageText('phrase_verifyrequest', 'security', 'Verify Request'), 'input_request_captcha'); $cap = stripslashes($this->objLanguage->languageText('mod_security_explaincaptcha', 'security', 'To prevent abuse, please enter the code as shown below. If you are unable to view the code, click on "Redraw" for a new one.')) . '<br /><div id="captchaDiv">' . $objCaptcha->show() . '</div>' . $captcha->show() . ' <a href="javascript:redraw();">' . $this->objLanguage->languageText('word_redraw', 'security', 'Redraw') . '</a>'; //create the form $objForm->displayType = 4; $objForm->addToFormEx($objLanguage->languageText('mod_errors_submiterrs', 'errors')); $objForm->addToFormEx($objTextArea->show()); $objForm->addToFormEx($captchaLabel, $cap); $objForm->addToFormEx($objHiddenInput->show()); $objForm->addToFormEx($objHiddenInput2->show()); $objForm->addRule('request_captcha', $this->objLanguage->languageText("mod_blogcomments_captchaval", 'blogcomments'), 'required'); $this->objButton =& new button($objLanguage->languageText('word_sendtodevs', 'errors')); $this->objButton->setValue($objLanguage->languageText('word_sendtodevs', 'errors')); $this->objButton->setToSubmit(); $objForm->addToFormEx($this->objButton->show()); $midcol .= $objFeatureBox->show($this->objLanguage->languagetext("mod_errors_mailadmins", "errors"), $objForm->show()); $cssLayout->setMiddleColumnContent($midcol); echo $cssLayout->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; }
/** * 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; }
$objFmTable->endRow(); //Add a row for the story title $objFmTable->startRow(NULL, "top", NULL, NULL, " colspan=\"2\""); $objFmTable->addCell($objLanguage->languageText("word_title") . ": ", NULL, "top", "right"); $objTextInput = new textinput('title', $title); $objForm->addRule('title', $objLanguage->languageText("mod_stories_val_titnotnull", "stories"), 'required'); $objTextInput->size = "78"; $objTextInput->id = 'title'; $objFmTable->addCell($objTextInput->show(), NULL, "top", "left"); $objFmTable->endRow(); //Add a row for the abstract $objFmTable->startRow(); $objFmTable->addCell($objLanguage->languageText("word_abstract") . ": ", NULL, "top", "right"); $objTextArea = new textarea('abstract', $abstract); $objTextArea->cols = 77; $objFmTable->addCell($objTextArea->show(), NULL, "top", "left"); $objFmTable->endRow(); //Create a new table for the three other things $objFmTable2 = $this->newObject("htmltable", "htmlelements"); $objFmTable2->width = "100%"; //Add a row for the labels $objFmTable2->startRow(); $objFmTable2->addCell($objLanguage->languageText("phrase_isactive"), NULL, "top", "center"); $objFmTable2->addCell($objLanguage->languageText("phrase_dateposted"), NULL, "top", "center"); $objFmTable2->addCell($objLanguage->languageText("phrase_expirationdate"), NULL, "top", "center"); $objFmTable2->endRow(); //Add a row for the inputs $objFmTable2->startRow(); $objTextInput = new textinput('isActive', $isActive); //Is the story active if (!isset($isActive)) {
$table->addCell($description->show()); $table->endRow(); $table->startRow(); $label = new label($this->objLanguage->languageText('mod_filemanager_keywordstags', 'filemanager', 'Keywords/Tags') . ':<br />' . $this->objLanguage->languageText('mod_filemanager_separatewithcommas', 'filemanager', 'Separate with commas'), 'input_keywords'); $table->addCell($label->show()); $keywords = new textarea('keywords'); $keywordsList = ''; if (count($tags) > 0) { $comma = ''; foreach ($tags as $tag) { $keywordsList .= $comma . $tag; $comma = ', '; } } $keywords->value = $keywordsList; $table->addCell($keywords->show()); $table->endRow(); $objModules = $this->getObject('modules', 'modulecatalogue'); if ($objModules->checkIfRegistered('creativecommons')) { $table->startRow(); $table->addCell($this->objLanguage->languageText('mod_filemanager_filelicense', 'filemanager', 'File License') . ':'); $licensechooser = $this->newObject('licensechooser', 'creativecommons'); $licensechooser->defaultValue = $file['license']; $table->addCell($licensechooser->show()); $table->endRow(); } $form->addToForm($table->show()); $button = new button('submitform', $this->objLanguage->languageText('mod_filemanager_updatefileinfo', 'filemanager', 'Update File Info')); $button->setToSubmit(); $form->addToForm($button->show()); $hiddenInput = new hiddeninput('id', $file['id']);