function form($object) { pathos_lang_loadDictionary('standard', 'core'); pathos_lang_loadDictionary('modules', 'sharedcoremodule'); if (!defined('SYS_FORMS')) { require_once BASE . 'subsystems/forms.php'; } pathos_forms_initialize(); $form = new form(); if (!isset($object->id)) { $object->core_id = 0; $object->name = ''; $object->path = ''; $object->relpath = ''; $object->host = HOSTNAME; } else { $form->meta('id', $object->id); } $codebases = array(); global $db; foreach ($db->selectObjects('sharedcore_core') as $c) { $codebases[$c->id] = $c->name; } uasort($codebases, 'strnatcmp'); $form->register('core_id', TR_SHAREDCOREMODULE_SITECORE, new dropdowncontrol($object->core_id, $codebases)); $form->register('name', TR_SHAREDCOREMODULE_SITENAME, new textcontrol($object->name)); $path_ctl = new textcontrol($object->path); if (isset($object->id)) { $path_ctl->disabled = true; } $form->register('path', TR_SHAREDCOREMODULE_SITEPATH, $path_ctl); $host_ctl = new textcontrol($object->host); if (isset($object->id)) { $host_ctl->disabled = true; } $form->register('host', TR_SHAREDCOREMODULE_SITEHOST, $host_ctl); $relpath_ctl = new textcontrol($object->relpath); if (isset($object->id)) { $relpath_ctl->disabled = true; } $form->register('relpath', TR_SHAREDCOREMODULE_SITERELPATH, $relpath_ctl); if (!isset($object->id)) { pathos_lang_loadDictionary('config', 'database'); // Setup initial database config $form->register(null, '', new htmlcontrol('<hr size="1" /><b>' . TR_CONFIG_DATABASE_TITLE . '</b>')); $form->register('db_engine', TR_CONFIG_DATABASE_DB_ENGINE, new dropdowncontrol(DB_ENGINE, pathos_database_backends())); $form->register('db_host', TR_CONFIG_DATABASE_DB_HOST, new textcontrol(DB_HOST)); $form->register('db_port', TR_CONFIG_DATABASE_DB_PORT, new textcontrol(DB_PORT)); $form->register('db_name', TR_CONFIG_DATABASE_DB_NAME, new textcontrol(DB_NAME)); $form->register('db_user', TR_CONFIG_DATABASE_DB_USER, new textcontrol(DB_USER)); $form->register('db_pass', TR_CONFIG_DATABASE_DB_PASS, new textcontrol()); $form->register('db_table_prefix', TR_CONFIG_DATABASE_DB_TABLE_PREFIX, new textcontrol(DB_TABLE_PREFIX)); $form->meta('_db_config', 1); } $form->register('submit', '', new buttongroupcontrol(TR_CORE_SAVE, '', TR_CORE_CANCEL)); return $form; }
function form() { pathos_lang_loadDictionary('modules', 'database'); if (!defined('SYS_FORMS')) { require_once BASE . 'subsystems/forms.php'; } pathos_forms_initialize(); $form = new form(); //Form is created to collect information from the user //Values set previously (defaults or user-entered) are displayed $form->register('dbengine', TR_DATABASE_DBTYPE, new dropdowncontrol('', pathos_database_backends())); $form->register('host', TR_DATABASE_HOST, new textcontrol(DB_HOST)); $form->register('port', TR_DATABASE_PORT, new textcontrol(DB_PORT)); $form->register('dbname', TR_DATABASE_DBNAME, new textcontrol('')); $form->register('username', TR_DATABASE_USER, new textcontrol(DB_USER)); $form->register('pwd', TR_DATABASE_PWD, new passwordcontrol('')); return $form; }
# # Exponent is free software; you can redistribute # it and/or modify it under the terms of the GNU # General Public License as published by the Free # Software Foundation; either version 2 of the # License, or (at your option) any later version. # # Exponent is distributed in the hope that it # will be useful, but WITHOUT ANY WARRANTY; # without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR # PURPOSE. See the GNU General Public License # for more details. # # You should have received a copy of the GNU # General Public License along with Exponent; if # not, write to: # # Free Software Foundation, Inc., # 59 Temple Place, # Suite 330, # Boston, MA 02111-1307 USA # # $Id: database.structure.php,v 1.5 2005/02/19 00:39:18 filetreefrog Exp $ ################################################## if (!defined('PATHOS')) { exit(''); } pathos_lang_loadDictionary('config', 'database'); return array(TR_CONFIG_DATABASE_TITLE, array('DB_ENGINE' => array('title' => TR_CONFIG_DATABASE_DB_ENGINE, 'description' => TR_CONFIG_DATABASE_DB_ENGINE_DESC, 'control' => new dropdowncontrol('', pathos_database_backends())), 'DB_NAME' => array('title' => TR_CONFIG_DATABASE_DB_NAME, 'description' => TR_CONFIG_DATABASE_DB_NAME_DESC, 'control' => new textcontrol()), 'DB_USER' => array('title' => TR_CONFIG_DATABASE_DB_USER, 'description' => TR_CONFIG_DATABASE_DB_USER_DESC, 'control' => new textcontrol()), 'DB_PASS' => array('title' => TR_CONFIG_DATABASE_DB_PASS, 'description' => TR_CONFIG_DATABASE_DB_PASS_DESC, 'control' => new passwordcontrol()), 'DB_HOST' => array('title' => TR_CONFIG_DATABASE_DB_HOST, 'description' => TR_CONFIG_DATABASE_DB_HOST_DESC, 'control' => new textcontrol()), 'DB_PORT' => array('title' => TR_CONFIG_DATABASE_DB_PORT, 'description' => TR_CONFIG_DATABASE_DB_PORT_DESC, 'control' => new textcontrol()), 'DB_TABLE_PREFIX' => array('title' => TR_CONFIG_DATABASE_DB_TABLE_PREFIX, 'description' => TR_CONFIG_DATABASE_DB_TABLE_PREFIX_DESC, 'control' => new textcontrol())));