// output using the $oOption object $aPreferences[0]['text'] = $group . ' ' . $strPreferences; $count = count($aConfig['preferences']); $i = 0; foreach ($aConfig['preferences'] as $k => $v) { $aPreferences[0]['items'][] = array('type' => $v['type'], 'name' => $group . '_' . $v['name'], 'text' => $v['label'], 'req' => $v['required'], 'size' => $v['size'], 'value' => $v['value'], 'visible' => $v['visible']); //add break after a field excluding last $i++; if ($i < $count) { $aPreferences[0]['items'][] = array('type' => 'break'); } } $aPreferences[0]['items'][] = array('type' => 'hiddenfield', 'name' => 'plugin', 'value' => $plugin); $aPreferences[0]['items'][] = array('type' => 'hiddenfield', 'name' => 'group', 'value' => $group); $GLOBALS['_MAX']['PREF_EXTRA'] = OA_Preferences::loadPreferences(true, true); /*-------------------------------------------------------*/ /* HTML framework */ /*-------------------------------------------------------*/ phpAds_PageHeader("plugin-index", new OA_Admin_UI_Model_PageHeaderModel($GLOBALS['strPluginPreferences']), '', false, true); /*-------------------------------------------------------*/ /* Main code */ /*-------------------------------------------------------*/ //display back link $oTpl = new OA_Admin_Template('plugin-group-preferences.html'); $oTpl->assign('backURL', MAX::constructURL(MAX_URL_ADMIN, $backURL)); $oTpl->assign('plugin', $plugin); $oTpl->assign('group', $group); $oTpl->display(); //display options form $oOptions->show($aPreferences, $aErrormessage); phpAds_PageFooter();
} if (!count($aErrormessage)) { if ($doUsers->update() === false) { // Unable to update the preferences $aErrormessage[0][] = $strUnableToWritePrefs; } else { $translation = new OX_Translation(); $translated_message = $translation->translate($GLOBALS['strPasswordChanged']); OA_Admin_UI::queueMessage($translated_message, 'local', 'confirm', 0); // The "preferences" were written correctly saved to the database, // go to the "next" preferences page from here OX_Admin_Redirect::redirect(basename($_SERVER['SCRIPT_NAME'])); } } } // Set the correct section of the preference pages and display the drop-down menu $prefSection = "password"; $setPref = $oOptions->getSettingsPreferences($prefSection); $title = $setPref[$prefSection]['name']; // Display the settings page's header and sections $oHeaderModel = new OA_Admin_UI_Model_PageHeaderModel($title); phpAds_PageHeader('account-user-index', $oHeaderModel); // Get the current logged in user details $oUser = OA_Permission::getCurrentUser(); $aUser = $oUser->aUser; // Prepare an array of HTML elements to display for the form, and // output using the $oOption object $aSettings = array(array('text' => $strChangePassword, 'items' => array(array('type' => 'plaintext', 'name' => 'username', 'value' => $aUser['username'], 'text' => $strUsername, 'size' => 35), array('type' => 'break'), array('type' => 'plaintext', 'name' => 'contact_name', 'value' => $aUser['contact_name'], 'text' => $strFullName, 'size' => 35), array('type' => 'break'), array('type' => 'plaintext', 'name' => 'email_address', 'value' => $aUser['email_address'], 'text' => $strEmailAddress, 'size' => 35), array('type' => 'break'), array('type' => 'password', 'name' => 'pwold', 'text' => $strCurrentPassword, 'disabled' => ''), array('type' => 'break'), array('type' => 'password', 'name' => 'pw', 'text' => $strChooseNewPassword), array('type' => 'break'), array('type' => 'password', 'name' => 'pw2', 'text' => $strReenterNewPassword, 'check' => 'compare:pw')))); $oOptions->show($aSettings, $aErrormessage); // Display the page footer phpAds_PageFooter();
$result = $oSettings->processSettingsFromForm($aElements); if ($result) { // Queue confirmation message $setPref = $oOptions->getSettingsPreferences($prefSection); $title = $setPref[$prefSection]['name']; $translation = new OX_Translation (); $translated_message = $translation->translate($GLOBALS['strXSettingsHaveBeenUpdated'], array(htmlspecialchars($title))); //$GLOBALS['_MAX']['CONF'] = parseIniFile(); OA_Admin_UI::queueMessage($translated_message, 'local', 'confirm', 0); // The settings configuration file was written correctly, OX_Admin_Redirect::redirect(basename($_SERVER['PHP_SELF'])); } // Could not write the settings configuration file, store this // error message and continue $aErrormessage[0][] = $strUnableToWriteConfig; } }*/ // Set the correct section of the settings pages and display the drop-down menu $setPref = $oOptions->getSettingsPreferences($prefSection); $title = $setPref[$prefSection]['name']; // Display the settings page's header and sections $oHeaderModel = new OA_Admin_UI_Model_PageHeaderModel($title); phpAds_PageHeader('account-settings-index', $oHeaderModel); // Prepare an array of HTML elements to display for the form, and // output using the $oOption object $oSettings = array(array('text' => $strDatabaseServer, 'items' => array(array('type' => 'select', 'name' => 'database_type', 'text' => $strDbType, 'items' => array($GLOBALS['_MAX']['CONF']['database']['type'] => $GLOBALS['_MAX']['CONF']['database']['type']), 'disabled' => true), array('type' => 'break'), array('type' => 'checkbox', 'name' => 'database_localsocket', 'text' => $strDbLocal, 'onclick' => 'toggleSocketInput(this);', 'disabled' => true), array('type' => 'hidden', 'name' => 'database_protocol'), array('type' => 'break'), array('type' => 'text', 'name' => 'database_socket', 'text' => $strDbSocket, 'disabled' => true), array('type' => 'break'), array('type' => 'text', 'name' => 'database_host', 'text' => $strDbHost, 'disabled' => true), array('type' => 'break'), array('type' => 'text', 'name' => 'database_port', 'text' => $strDbPort, 'check' => 'wholeNumber', 'disabled' => true), array('type' => 'break'), array('type' => 'text', 'name' => 'database_username', 'text' => $strDbUser, 'disabled' => true), array('type' => 'break'), array('type' => 'password', 'name' => 'database_password', 'text' => $strDbPassword, 'disabled' => true), array('type' => 'break'), array('type' => 'text', 'name' => 'database_name', 'text' => $strDbName, 'value' => stripslashes($GLOBALS['_MAX']['CONF']['database']['name']), 'decode' => true, 'disabled' => true))), array('text' => $strAdvancedSettings, 'items' => array(array('type' => 'select', 'name' => 'table_type', 'text' => $strTablesType, 'items' => array($GLOBALS['_MAX']['CONF']['table']['type'] => $GLOBALS['_MAX']['CONF']['table']['type']), 'disabled' => true), array('type' => 'break'), array('type' => 'text', 'name' => 'table_prefix', 'text' => $strTablesPrefix, 'maxlength' => '7', 'value' => stripslashes($GLOBALS['_MAX']['CONF']['table']['prefix']), 'decode' => true, 'disabled' => true))), array('text' => $strDatabaseOptimalisations, 'items' => array(array('type' => 'checkbox', 'name' => 'database_persistent', 'text' => $strPersistentConnections, 'disabled' => true)))); $oOptions->oTpl->assign('formIsDisabled', true); $oOptions->show($oSettings, $aErrormessage, true); // Display the page footer phpAds_PageFooter();