public function render() { foreach ($this->buttons as $value => $desc) { $is_checked = false; //----------------------------------------- // Is Checked? //----------------------------------------- if (isset($this->checked_value) && $this->checked_value == $value) { $is_checked = true; } //----------------------------------------- // Create Radio Button //----------------------------------------- $r = new radio($this->name, $value, $is_checked); //----------------------------------------- // Element Attributes //----------------------------------------- if (isset($this->elements_attrs[$value])) { $r->attrs($this->elements_attrs[$value]); } //----------------------------------------- // Output //----------------------------------------- print $r . ' ' . $desc; if ($this->style == 'newline') { print '<br/>'; } else { if ($this->style == 'custom') { print $this->custom_style; } } } }
public static function build($action, $settings) { global $config; if ($action == 'all') { file_write($config['dir']['home'] . $settings['file'], radio::install($settings)); } }
/** * 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(); }
/** * 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(); }
/** * 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(); }
public function render() { //============================================ // Pull items from database //============================================ $data = new data_trans($this->data_src); $data->data_query($this->strsql); $result = $data->data_assoc_result(); foreach ($result as $row) { //----------------------------------------- // Create Radio Button //----------------------------------------- $tmp_radio = new radio($this->name, $row[$this->opt_key]); //----------------------------------------- // Is Checked? //----------------------------------------- if (isset($this->checked_value)) { if ($this->checked_value == $row[$this->opt_key]) { $tmp_radio->set_attribute('checked', 'checked'); } } //----------------------------------------- // Element Attributes //----------------------------------------- if (isset($this->elements_attrs[$row[$this->opt_key]])) { $tmp_radio->attrs($this->elements_attrs[$row[$this->opt_key]]); } //----------------------------------------- // Output //----------------------------------------- $tmp_radio->render(); print ' ' . $row[$this->opt_val]; if ($this->style == 'newline') { print '<br/>'; } else { if ($this->style == 'custom') { print $this->custom_style; } } print "\n"; } }
/** * 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(); }
public function new_option($o) { $name = $this->get_name() . '_' . $o->name; $input = new radio($o->container, $name); if (isset($o->id)) { $input->set_attribute('id', $o->id); } if (isset($o->label)) { $input->label($o->label); } $input->set_attribute('name', $name); $input->set_attribute('value', $o->value); $input->label->update_for(); if ($this->is_required()) { $input->required(); } return $input; }
/** * 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(); }
public function add($param = "") { global $myAdmin; global $formMaj; global $datas_lang; global $smarty; global $thisSite; parent::add(); if ($this->insideForm == false) { $this->fileRequired = true; $this->legendeEnabled = true; } if ($this->insideForm == true) { $prefixe_field = $this->field . "__"; $mySelect = new mySelect(__FILE__); $mySelect->tables = $thisSite->PREFIXE_TBL_GEN . "medias"; $mySelect->fields = "*"; $mySelect->orderby = "id DESC"; // pour prendre le premier élément $mySelect->where = "field_media=:field_media AND id_parent=:id_parent"; $mySelect->whereValue["field_media"] = array($this->field, PDO::PARAM_STR); //$formMaj->tables . "." . $id_parent = $formMaj->datasForm[$myAdmin->LANG_DATAS]["id"]; if ($id_parent == "") { $id_parent = $formMaj->datasForm[""]["id"]; } $mySelect->whereValue["id_parent"] = array($id_parent, PDO::PARAM_INT); $resultmySelect = $mySelect->query(); foreach ($resultmySelect as $rowS) { $lg = $rowS["lg"]; $value_titre_media[$lg] = $rowS["titre_media"]; $value_lien_destination[$lg] = $rowS["lien_destination"]; $value_cible_destination[$lg] = $rowS["cible_destination"]; if ($lg == $myAdmin->LANG_DEF) { // pour les données monolangue $value_idMedia = $rowS["id"]; $value_titre_media[""] = $rowS["titre_media"]; $value_lien_destination[""] = $rowS["lien_destination"]; $value_cible_destination[""] = $rowS["cible_destination"]; } } } else { $prefixe_field = ""; } // champ Titre: légende de l'image, du fichier ou du lien if ($this->legendeEnabled == true) { $newfield = new input(); $newfield->field = $prefixe_field . "titre_media"; $newfield->multiLang = true; $newfield->value = $value_titre_media; $newfield->label = $datas_lang["legende"]; $newfield->addClass = $this->addClass; $newfield->tooltip = $datas_lang["tooltipsLegende"]; $newfield->widthLabel = 2; $newfield->widthField = 9; $result = $newfield->add(); $field_titre_media = $result; } $newfield = new input(); $newfield->field = $prefixe_field . "lien_destination"; $newfield->multiLang = $this->multiLangType; $newfield->label = $datas_lang["lien"]; $newfield->widthLabel = 2; $newfield->widthField = 9; $newfield->value = $value_lien_destination; if ($this->placeholder != "") { $newfield->placeholder = $this->placeholder; } else { $newfield->placeholder = "http://, https:// ..."; } $result = $newfield->add(); $field_lien_destination = $result; if ($this->complete_url == true) { $newfield->rule("complete_url", true); } if ($this->fileRequired == true) { $newfield->rule("required", true); } $newfield = new radio(); $newfield->field = $prefixe_field . "cible_destination"; $newfield->multiLang = false; $newfield->value = $value_cible_destination; $newfield->defaultValue = "_blank"; $newfield->label = $datas_lang["cible"]; $newfield->items = $datas_lang["listeCible"]; $newfield->widthLabel = 2; $newfield->widthField = 9; $result = $newfield->add(); $field_cible_destination = $result; $smarty->assign('field_titre_media', $field_titre_media); $smarty->assign('field_lien_destination', $field_lien_destination); $smarty->assign('field_cible_destination', $field_cible_destination); if ($this->insideForm == true) { $newfield = new hidden(); $newfield->field = "fieldMedia__" . $this->field; $newfield->multiLang = false; $newfield->value = serialize(array("type" => $this->type, "field_media" => $this->field, "idMedia" => $value_idMedia)); $result = $newfield->add(); $smarty->assign('fieldMediaField', $result); } $smarty->assign('this', $this); $data = $smarty->fetch($this->pathTemplate . 'inc/fields/class.mediaLink.tpl'); if ($this->insideForm == true) { $this->smartAssign($this->field, $data); } else { $this->smartAssign("media", $data); } return $data; }
/** * 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(); } }
<?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();
/** * 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; }
<?php include 'radio.php'; /** * Credentials */ $radio = new radio(); $radio->setpin('1337'); $radio->sethost('192.168.0.46'); // There is no need to obtain a session, this is done automaticaly by the first command connecting to the radio. /** * Logging */ // set the logger to log to stdout $radio->setDebugTarget('STDOUT'); // set the level at which the log is written to the log target (STDOUT) $radio->setDebugLevel(2); // Log Start to STDOUT $radio->debug('START', 1); // Do not Log Start to STDOUT,because loglevel is to high $radio->debug('hidden', 3); /** * Basic */ // Get the current power state of the device (on or off) $response = $radio->power(); $radio->debug($response, 1); // power on $response = $radio->power(1); $radio->debug($response, 1); // power off
$accountStatusRadio->setSelected($this->getParam('accountstatus')); } else { if ($user['isactive'] == '0') { $accountStatusRadio->setSelected(0); } else { $accountStatusRadio->setSelected(1); } } $table->addCell($accountStatusRadio->show()); $table->endRow(); // Type of Account if ($this->objConfig->getuseLDAP() == 'TRUE') { $table->startRow(); $table->addCell('Type of Account'); $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();
$objFmTable2->endRow(); //Add a row for the inputs $objFmTable2->startRow(); $objTextInput = new textinput('isActive', $isActive); //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');
$canvasLabel = new label($this->objLanguage->languageText('mod_contextadmin_theme', 'contextadmin', 'Theme'), 'input_canvas'); $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 ($mode == 'add' && is_array($fixup)) { $status->setSelected($fixup['status']); } else { if ($mode == 'edit') { $status->setSelected($context['status']); } } //$access = new hiddeninput('access', 'Private'); //} else { if ($objSysConfig->getValue('context_access_private_only', 'context', 'false') == 'false') { $access = new radio('access'); $access->setBreakSpace('<br />'); $access->addOption('Public', '<strong>' . $this->objLanguage->languageText('word_public', 'system', 'Public') . '</strong> - <span class="caption">' . $this->objLanguage->code2Txt('mod_context_publichelp', '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">' . $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 ($mode == 'add' && is_array($fixup)) { $access->setSelected($fixup['access']); } else { if ($mode == 'add') { $access->setSelected('Public'); } else { if ($mode == 'edit') { $access->setSelected($context['access']); } } }
$staffnum->value = $this->getParam('register_staffnum'); } $table->startRow(); $table->addCell($staffnumLabel->show(), 150, NULL, 'right'); $table->addCell($staffnum->show() . ' <em>' . $staffnumguestLabel->show() . '</em>'); $table->endRow(); $cellnum = new textinput('register_cellnum'); $cellnumLabel = new label($this->objLanguage->languageText('phrase_cellnumber', 'userregistration', 'Cell Number') . ' ', 'input_register_cellnum'); if ($mode == 'addfixup') { $cellnum->value = $this->getParam('register_cellnum'); } $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');
/** * Short description for function * * Long description (if any) ... * * @return void * @access public */ function valFormShow() { //I am not using multilingualized text for the examples $objForm = new form('testform'); $objForm->setAction($this->uri(array('action' => 'valform'), 'htmlelements')); $objForm->setDisplayType(2); $name = new textinput('name'); $name->label = 'Name(must be filled out)'; $objForm->addRule('name', 'Please enter your name', 'required'); $surname = new textinput('surname'); $surname->label = 'Surname (must be less than 15 characters)'; $objForm->addRule(array('name' => 'surname', 'length' => 15), 'Your surname is too long', 'maxlength'); $email = new textinput('email'); $email->label = 'Email (must be a valid email address)'; $objForm->addRule('email', 'Not a valid Email', 'email'); $pwd = new textinput('pwd'); $pwd->label = 'Password '; $pwd->fldType = 'password'; $pwd2 = new textinput('pwd2'); $pwd2->label = 'Retype password (must be the same as "Password" case sensitive)'; $pwd2->fldType = 'password'; $objForm->addRule(array('pwd', 'pwd2'), 'Password did not match', 'compare'); $age = new textinput('age'); $age->label = 'Age (must be older than 18)'; $objForm->addRule(array('name' => 'age', 'minnumber' => 18), 'You have to be older than 18', 'minnumber'); $colour = new textinput('colour'); $colour->label = 'Favourate Colour (must be between 3 and 15 characters inclusive)'; $objForm->addRule(array('name' => 'colour', 'lower' => 3, 'upper' => 10), 'must be between 3 and 10 characters inclusive', 'rangelength'); $sentence = new textinput('sentence'); $sentence->label = 'Sentence (must contain no punctuation) not working yet'; $car = new textinput('car'); $car->label = 'Favourate Car (must contain only alphabetic characters)'; $objForm->addRule('car', 'Must contain letters of the alphabet', 'letteronly'); $monitor = new textinput('monitor'); $monitor->label = 'Favourate Monitor (must contain only alphanumeric characters)'; $objForm->addRule('monitor', 'Must contain letters of the alphabet and valid numbers', 'alphanumeric'); $birthday = new textinput('birthday'); $birthday->label = 'Birthday (mm/dd/yyy) not working yet'; $sex = new radio('sex_radio'); $sex->addOption('m', 'Male'); $sex->addOption('f', 'Female'); $sex->addOption('n', 'Seaweed'); //$objForm->addRule('sex_radio','Please select your sex','select'); $save = new button('save'); $save->setToSubmit(); $save->setValue('Save'); $objForm->addToForm($name); $objForm->addToForm($surname); $objForm->addToForm($email); $objForm->addToForm($pwd); $objForm->addToForm($pwd2); $objForm->addToForm($age); $objForm->addToForm($sentence); $objForm->addToForm($colour); $objForm->addToForm($car); $objForm->addToForm($monitor); $objForm->addToForm($birthday); //$objForm->addToForm($sex); $objForm->addToForm($save); $this->setVar('left', ""); $this->setVar('right', ''); $this->setVar('content', $objForm->show()); $this->setVar('bottom', ''); }
/** * 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; }
$newfield->add(); $newfield = new input(); $newfield->field = "facebook_app_secret"; $newfield->multiLang = false; $newfield->label = "App Secret"; $newfield->add(); $newfield = new input(); $newfield->field = "mailchimp_list_id"; $newfield->multiLang = false; $newfield->label = "List ID"; $newfield->add(); $newfield = new input(); $newfield->field = "mailchimp_api_secret"; $newfield->multiLang = false; $newfield->label = "API Secret"; $newfield->add(); $newfield = new radio(); $newfield->field = "cookies_accept"; $newfield->defaultValue = 1; $newfield->multiLang = false; $newfield->label = "Message Acceptation Cookies"; $newfield->tooltip = "Utilisé uniquement pour les sites en langue française"; $newfield->items = $datas_lang["listeActif"]; $newfield->add(); $newfield = new textarea(); $newfield->field = "rich_snippet"; $newfield->multiLang = true; $newfield->rows = 25; $newfield->label = "Rich Snippet"; $newfield->add(); include DOS_INCPAGES_ADMIN . "maj-prepare.php";
/** * 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(); }
$studentIcon = $objIcon->show(); $objIcon->setIcon('guest'); $objIcon->alt = $this->objLanguage->code2Txt('mod_contextgroups_makeguest', 'contextgroups'); $objIcon->title = $this->objLanguage->code2Txt('mod_contextgroups_makeguest', 'contextgroups'); $guestIcon = $objIcon->show(); foreach ($results as $result) { $table->row_attributes = 'onmouseover="this.className=\'tbl_ruler\';" onmouseout="this.className=\'none\'; "'; $table->startRow(); $table->addCell($result['userid']); $table->addCell($result['staffnumber']); //$table->addCell($result['title']); $table->addCell($result['firstname']); $table->addCell($result['surname']); // $table->addCell($result['sex']); // $table->addCell($result['emailAddress']); $radio = new radio($result['userid']); $radio->addOption('none', $noneIcon . ' '); $radio->addOption('lecturer', $lecturerIcon); $radio->addOption('student', $studentIcon); $radio->addOption('guest', $guestIcon); // 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'); }
$this->loadClass('hiddeninput', 'htmlelements'); $header = new htmlHeading(); $header->type = 1; $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();
/** * 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()); }
/** * 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; }
/////////////////////////////// // PREPARATION DES DONNEES /////////////////////////////////// // champs de saisie /////////////////////////////////// $newfield = new input(); $newfield->field = "code_menu"; $newfield->multiLang = false; $newfield->widthField = 3; $newfield->counter = "countType:'characters', maxCount:20, strictMax:true"; $newfield->label = $datas_lang["code"]; $newfield->add(); $newfield->rule("required", true); $newfield->rule("alphanumeric", true); $newfield->rule("maxlength", 20); $newfield->rule("remote", array("script" => DOS_AJAX_ADMIN . "ajax_checkNotExiste.php", "table" => $myTable, "valOrigin" => "FIELD:code_menu", "params" => ""), $datas_lang["existedeja"]); $newfield = new input(); $newfield->field = "titre"; $newfield->multiLang = true; $newfield->label = $datas_lang["titre"]; $newfield->add(); $newfield->rule("required", true); $newfield = new radio(); $newfield->field = "actif"; $newfield->defaultValue = 1; $newfield->multiLang = false; $newfield->label = $datas_lang["actif"]; $newfield->items = $datas_lang["ouiNon"]; $newfield->add(); $newfield->rule("required", true); include DOS_INCPAGES_ADMIN . "maj-prepare.php";
/** * * 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; }