$objDrop->addOption('organise', $catOrganise); if ($menu == 'admin') { $objDrop->addOption('site', $catSite); $objDrop->addOption('develop', $catDevelop); } else { 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()));
/** * * 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; }
$objTable->startRow(); $objTable->addCell($objLabel->show()); $objTable->addCell($closeField); $objTable->endRow(); /* $objElement = new checkbox('studentsonly', '', true); // this will checked $check = $objElement->show(); $objTable->addRow(array( $userOptLabel, $check )); */ $objContextModules = $this->getObject('dbcontextmodules', 'context'); $objModules = $this->getObject('modules', 'modulecatalogue'); $contextModules = $objContextModules->getContextModules($contextCode); $plugins = $objModules->getListContextPlugins(); $dropDown = new dropdown('moduleid'); //$dropDown->addOption('all','All'); foreach ($plugins as $plugin) { $dropDown->addOption($plugin['module_id'], $plugin['title']); } if ($action == 'showuseractivitybymodule') { $objTable->addRow(array('<b>' . $selectModuleLabel . '</b>', $dropDown->show())); } $saveLabel = "View"; $objButton = new button('save', $saveLabel); $objButton->setToSubmit(); $btnSave = $objButton->show(); $objForm = new form('showuseractivity', $this->uri(array('action' => $action))); $objForm->addToForm($objTable->show()); $objForm->addToForm($btnSave); echo $objForm->show();
/** * 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(); } }
$objBizCard->resetModule = $this->getParam('module'); echo $objBizCard->show(); echo '<div id="formresults"></div>'; $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($confirmPasswordLabel->show(), 150, 'top', 'right'); $table->addCell(' ', 5); $table->addCell($confirmPassword->show() . $required); $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'); }
<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';
$objTextInput = new textinput('category', $category); $objTextInput->extra = 'readonly="READONLY"'; $objForm->addRule('category', $objLanguage->languageText("mod_stories_val_catnotnull", "stories"), 'required'); $objFmTable->addCell($objTextInput->show() . " " . $objCat->show(), NULL, "top", "left"); $objFmTable->endRow(); //Add a row for the language $objFmTable->startRow(); $objFmTable->addCell($objLanguage->languageText("word_language") . ": ", NULL, "top", "right"); $objTextInput = new textinput('language', $language); $objTextInput->extra = 'readonly="READONLY"'; $objForm->addRule(array('name' => 'language', 'length' => 2), $objLanguage->languageText("mod_stories_val_lang2chargt", "stories"), 'maxlength'); $objForm->addRule('language', $objLanguage->languageText("mod_stories_val_langnotnull", "stories"), 'required'); //Create a dropdown for the language selector $objCat = new dropdown('language_selector'); $objCat->extra = " onchange=\"document.forms['storyinput'].language.value=document.forms['storyinput'].language_selector.value;\""; $objCat->addOption("", "Clear input"); $objLangList = $this->newObject('languagecode', 'language'); $objCat->selected = $language; foreach ($objLangList->iso_639_2_tags->codes as $key => $value) { $objCat->addOption($key, $value); } $objFmTable->addCell($objTextInput->show() . " " . $objCat->show(), NULL, "top", "left"); $objFmTable->endRow(); //Add a row for the parentId $objFmTable->startRow(); $objTextInput = new textinput('parentId', $parentId); $objTextInput->fldType = 'hidden'; if ($parentId != 'base') { $parentIdInput = $objTextInput->show(); } else { $objTextInput->fldType = "hidden";
$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(); $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(' ');
/** * * Gets the wide blocks for the template middle. It renders the dropdown * for selecting wide blocks when 'Turn editing on' is enabled. * * @return string A dropdown for selecting blocks * @access public * */ public function getWideBlocks() { // Create array for sorting $wideBlockOptions = array(); $wideBlocksDropDown = new dropdown('middleblocks'); $wideBlocksDropDown->cssId = 'ddmiddleblocks'; $wideBlocksDropDown->addOption('', $this->objLanguage->languageText('phrase_selectone', 'context', 'Select One') . '...'); foreach ($this->wideDynamicBlocks as $wideBlock) { $smallBlockOptions['dynamicblock|' . $wideBlock['id'] . '|' . $wideBlock['module']] = htmlentities($wideBlock['title']); } $wideBlocks = $this->objBlocks->getBlocks('wide', 'site|user'); foreach ($wideBlocks as $wideBlock) { if ($wideBlock["moduleid"] != "contentblocks") { $block = $this->newObject('block_' . $wideBlock['blockname'], $wideBlock['moduleid']); $title = $block->title; if ($title == '') { $title = $wideBlock['blockname'] . ' (' . $wideBlock['moduleid'] . ')'; } else { $title = $title . " (" . $wideBlock['moduleid'] . ")"; } $wideBlockOptions['block|' . $wideBlock['blockname'] . '|' . $wideBlock['moduleid']] = htmlentities($title); } else { // fetch contentblock data //$block = $this->objBlocks->showBlock($wideBlock["id"], "contentblocks"); $bData = $this->objBlocksContent->getBlockById($wideBlock["id"]); if (!empty($bData)) { $bData = $bData[0]; $title = $bData["title"]; //parse some abstractions $title = $this->objLanguage->abstractText($title); if ($title == '') { $title = $wideBlock['blockname'] . ' | '; } $title .= " (" . $wideBlock['moduleid'] . ")"; $wideBlockOptions['block|' . $bData["id"] . '|' . "contentblocks"] = htmlentities($bData["title"] . ' (contentblocks)'); } } } // Sort Alphabetically asort($wideBlockOptions); // Add wide Blocks foreach ($wideBlockOptions as $block => $title) { $wideBlocksDropDown->addOption($block, $title); } //Add content blocks if any $contentWideBlocks = ""; if ($this->cbExists) { $contentWideBlocks = $this->objBlocksContent->getBlocksArr('content_widetext'); //Add content sideblocks to options if (!empty($contentWideBlocks)) { foreach ($contentWideBlocks as $contentWideBlock) { $wideBlocksDropDown->addOption('block|' . $contentWideBlock["id"] . '|' . "contentblocks", htmlentities($contentWideBlock["title"]) . '(contentblocks)'); } } } return $wideBlocksDropDown->show(); }
/** * * 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; }
/** * Method to get a list of contexts. * The method returns a dropdown list of contexts in which the user is registered. */ function showDropDown() { $objForm = $this->newObject('form', 'htmlelements'); $objButton = $this->newObject('button', 'htmlelements'); $objDropDown = $this->newObject('dropdown', 'htmlelements'); $go = $this->objLanguage->languageText('word_go'); $objDropDown = new dropdown('context_dropdown'); $objDropDown->cssClass = 'coursechooser'; $contexts = $this->objManageGroups->userContextCodes(); if (!empty($contexts)) { foreach ($contexts as $code) { $menu = $this->objDBContext->getMenuText($code); $objDropDown->addOption($code, $menu); } $objDropDown->extra = 'onchange="document.enter.submit();"'; // submit button $objButton = new button('go', $go); $objButton->setToSubmit(); // Build form $objForm->form('enter', $this->uri(array('action' => 'joincontext'), 'context')); $objForm->addToForm($objDropDown->show()); $objForm->addToForm($objButton->show()); return $objForm->show(); } return FALSE; }
/** * * 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(); }
/** * 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; }
/** * * Method to put a dropdown list of categories * */ function putCategoryChooser() { $objCat = $this->getObject('dbstorycategory', 'storycategoryadmin'); $ar = $objCat->getAll(); //Load the form class that I need $this->loadClass('form', 'htmlelements'); $this->loadClass('dropdown', 'htmlelements'); //Instantiate the form class $objForm = new form('chCat'); //Instantiate a dropdown $objCatDrd = new dropdown('category_selector'); $objCatDrd->extra = " onchange=\"document.location=document.forms['chCat'].category_selector.value;\""; //Add the categories $objCatDrd->addOption("", $this->objLanguage->languageText("mod_stories_anothercat", 'stories')); foreach ($ar as $line) { $link = $this->uri(array('action' => $this->getParam('action', NULL), 'storycategory' => $line['category']), $this->getParam('module', '_default')); $objCatDrd->addOption($link, $line['title']); } $objForm->addToForm($objCatDrd->show()); return $objForm->show(); }
<div class="panel panel-default"> <div class="pull-right"> <div class="btn-group"> </div> </div> <div class="panel-heading"> <i class="fa fa-times fa-fw"></i> <?php //$content->dropdownMarketOrders_inactive($character_get, $typei); $orders_dropdown = new dropdown(); $orders_dropdown->setTitle("Order type"); $orders_dropdown->setCharacter($character_get); $orders_dropdown->setTargetURL("marketorders.php"); $typea_sell = "typei=sell&typea=" . $typea; $typea_buy = "typei=buy&typea=" . $typea; $orders_dropdown->addOption('Sell Orders', $typea_sell); $orders_dropdown->addOption("Buy Orders", $typea_buy); $orders_dropdown->renderDropdown(); echo "Inactive "; if (isset($_GET['typei'])) { $filter = $_GET['typei']; } else { $filter = 'sell'; } if (isset($filter) && $filter != "") { echo $filter . " orders"; } ?> </div> <!-- /.panel-heading --> <div class ="panel-body">
/** * * 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; }
</div> </div> <div class="panel-heading"> <i class="fa fa-times fa-fw"></i> <?php $contracts_dropdown2 = new dropdown(); $contracts_dropdown2->setTitle("Contract type"); $contracts_dropdown2->setCharacter($character_get); $contracts_dropdown2->setTargetURL("contracts.php"); $all_i = "typea=" . $typea . "&typei=all"; $exch_i = "typea=" . $typea . "&typei=ItemExchange"; $cour_i = "typea=" . $typea . "&typei=Courier"; $loan_i = "typea=" . $typea . "&typei=Loan"; $auc_i = "typea=" . $typea . "&typei=Auction"; $contracts_dropdown2->addOption('All', $all_i); $contracts_dropdown2->addOption("ItemExchange", $exch_i); $contracts_dropdown2->addOption("Courier", $cour_i); $contracts_dropdown2->addOption("Loan", $loan_i); $contracts_dropdown2->addOption("Auction", $auc_i); $contracts_dropdown2->renderDropdown(); echo "Inactive "; if (isset($_GET['typei'])) { $filter_inactive = $_GET['typei']; } else { $filter_inactive = "all"; } if (isset($filter_inactive) && $filter_inactive != "") { echo $filter_inactive . " contracts"; } ?>
$search2->setSelected($this->getParam('searchField_context')); $div2 = '<div class="contextform" style="display: ' . $contextDisplay . '">' . $search2->show() . '</div>'; $table->addCell($this->objLanguage->languageText('mod_filemanager_searchfield', 'filemanager', 'Search Field')); $table->addCell($div1 . $div2); $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';
/** * Method to render Language Chooser on the * index page. * Construct a form and populate it with all available * language translations for selection * @access public * @return form */ public function putlanguageChooser() { try { //$ret = $this->languageText("phrase_languagelist",'language') . ":<br />\n"; $script = $_SERVER['PHP_SELF']; $objNewForm = new form('languageCheck', $script); $objDropdown = new dropdown('Languages'); $objDropdown->extra = "onchange =\"document.forms['languageCheck'].submit();\""; $results = $this->languagelist(); foreach ($results as $list) { foreach ($list as $key) { $objDropdown->addOption($key, $key); } } $objNewForm->addToForm($this->languageText("phrase_languagelist") . ":<br />\n"); $objNewForm->addToForm($objDropdown->show()); $ret = $objNewForm->show(); return $ret; } catch (Exception $e) { $this->errorCallback($this->languageText('word_caught_exception') . $e->getMessage()); exit; } }
echo $header->show(); if ($errormessages) { $header2 = new htmlheading(); $header2->type = 3; $header2->str = $errormessages; echo $heade2->show(); } $course1Dropdown = new dropdown('context1'); foreach ($data as $contextCode) { $row = $this->objContext->getContextDetails($contextCode); $course1Dropdown->addOption($row['contextcode'], $row['menutext']); } $course2Dropdown = new dropdown('context2'); foreach ($data as $contextCode) { $row = $this->objContext->getContextDetails($contextCode); $course2Dropdown->addOption($row['contextcode'], $row['menutext']); } $objTable = $this->newObject('htmltable', 'htmlelements'); $objTable->startRow(); $objTable->addCell(ucwords($this->objLanguage->code2Txt('mod_context_contextfrom', 'context', null, '[-context-] from')) . ":"); $objTable->endRow(); $objTable->startRow(); $objTable->addCell($course1Dropdown->show()); $objTable->endRow(); $objTable->startRow(); $objTable->addCell(ucwords($this->objLanguage->code2Txt('mod_context_contextto', 'context', null, '[-context-] to')) . ":"); $objTable->endRow(); $objTable->startRow(); $objTable->addCell($course2Dropdown->show()); $objTable->endRow(); $objButton = new button('save', $this->objLanguage->languageText('word_save'));
$toolBar[$k++]['category'] = $item['category']; } } } } $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();
/** * * 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(); }
<body> <div class="row"> <div class="col-lg-12"> <div class="panel panel-default"> <div class="panel-heading"> <i class="fa fa-bar-chart-o fa-fw"></i> Statistics <?php echo $intStr; ?> <?php $trans_dropdown = new dropdown(); $trans_dropdown->setTitle("View results for..."); $trans_dropdown->setCharacter($character_get); $trans_dropdown->setTargetURL("statistics.php"); $trans_dropdown->addOption('Last 24 hours', "int=24"); $trans_dropdown->addOption("Last 7 days", "int=168"); $trans_dropdown->addOption("Last 30 days", "int=720"); $trans_dropdown->renderDropdown(); ?> <div class="pull-right"> </div> </div> <!-- /.panel-heading --> <div class="panel-body"> Here you can check some more in-depth data about your revenue. This page will be updated frequently with more graphs and data in future. </div> <!-- /.panel-body --> </div> </div>
/** * 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(); } }
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'; $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')));
/** * 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 parse the string * @param String $str The string to parse * @return The parsed string * */ public function parse($txt) { preg_match_all('/\\[LIBRARYSEARCH\\](.*)\\[\\/LIBRARYSEARCH\\]/U', $txt, $results, PREG_PATTERN_ORDER); preg_match_all('/\\[LIBRARYSEARCH:(.*?)\\]/', $txt, $results2, PREG_PATTERN_ORDER); $counter = 0; foreach ($results[1] as $item) { $objForm = new form('library_search_form', $this->uri(array('action' => 'search'), 'librarysearch')); $searchInput = new textinput('search_key'); $selectCluster = new dropdown('subject_cluster'); $selectCluster->addOption('database', 'Database'); $selectCluster->addOption('books', 'Books'); $selectCluster->addOption('websites', 'Websites'); $selectCluster->selected = 'websites'; // Submit Button $button = new button('submit_search', $this->objLanguage->languageText('word_search')); $button->setToSubmit(); $objForm->addToForm($searchInput->show() . ' '); $objForm->addToForm($selectCluster->show() . ' '); $objForm->addToForm($button->show()); $replacement = $objForm->show(); $txt = str_replace($results[0][$counter], $replacement, $txt); $counter++; } return $txt; }
/** * 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()); }