|
Answers
Database Table specs
Every database table must have primary key named ID with autoincrement enabled.
MySQL:
CREATE TABLE IF NOT EXISTS `Addresses`( `ID` bigint NOT NULL auto_increment PRIMARY KEY,
PostgreSQL:
CREATE TABLE "Addresses"( "ID" bigserial NOT NULL PRIMARY KEY,
Please use '_' instead of ' ' in table names.
Install DataPal
Download and unzip Datapal, then upload it to the PHP enabled web server. It could be uploaded to the server root or to the dedicated
directory. Now proceed to database registration.
Register Database
To register database open DBSelector.php and follow the syntax of database registration just after the
function DBSelector(){ line. Please know your database login, password, database server URL or IP address.
Please ensure that database login has approapriate permissions for data view, edit and delete operations and possibly
creating indexes on table for applicable databases. For MySQL database registration use
$this->_DBa[$dbID]->DBtype=CMySQL;
for PostgreSQL database registration use
$this->_DBa[$dbID]->DBtype=CPostGreSQL;
Repeat database registration process for other databases. With each database registration increment $dbID variable by one.
$dbID integer value assigned at registration is used as a database pseudonym while referring to it during users registration
in Users.php.
Open a Subset of Tables within Database to DataPal
During database registration process specify tables subset like this:
$this->_DBa[$dbID]->tables=array("table1","table2","table3", "etc");
When specific database tables are not specified (line is commented out), all tables will be editable in DataPal. Specific database tables
could be overridden during user access setup. User table access setup takes priority over database registration table
access setup.
Add new User
Open Users.php and follow the syntax of users inside function Users()
Limit User Access
Open Users.php and follow the syntax of users inside function Users()
To give user access to all tables in database1 and database2 follow this syntax:
$this->_u[$login]->db=array('0','1');
to give user access to table1 and table2 in database1 and table3 and table5 in database2 only please follow this
syntax inside function Users():
$this->_u[$login]->db=array('0'=>array("table1","table2"),'1'=>array("table3","table5"));
Please note if no specific databases and tables specified for the user, he is given access to all databases and all tables that are registered in
DBSelector.php, if no tables are specified for databases in DBSelector.php and no tables are specified for the user in Users.php then user is given access
to all tables within allowed databases, if no databases are specified for the user in Users.php then user is given access to all databases and all tables
that are registered in DBSelector.php.
Disable Delete Option
To disable delete option globally for all users open constants.php and set CLetDelete constant to False.
To disable delete option for a specific user open Users.php and set $this->_u[$login]->allowDelete=False; to a corresponding
user login.
Disable Mass Delete Option
To disable delete option globally for all users open constants.php and set CLetMassDelete constant to False.
To disable delete option for a specific user open Users.php and set $this->_u[$login]->allowMassDelete=False; to a corresponding
user login.
Using Mass Delete Option
Do search and make sure that search results only display records that need delete operation.
Then click ‘Control Panel’ -> ‘Delete all current search results records’ . Confirm your action.
Please note that all pages of search results records will be deleted.
Disable Add Option
To disable add option for a user open Users.php and set $this->_u[$login]->allowAdd=False; to a corresponding
user login.
Disable Edit Option
To disable edit option globally for all users open constants.php and set CLetEdit constant to False.
To disable edit option for a specific user open Users.php and set $this->_u[$login]->allowEdit=False; to
a corresponding user login.
Disable Mass Edit Option
To disable edit option globally for all users open constants.php and set CLetMassEdit constant to False.
To disable edit option for a specific user open Users.php and set $this->_u[$login]->allowMassEdit=False; to
a corresponding user login.
Using Mass Edit Option
Do search and make sure that search results only display records that need mass update operation. Then click ‘Modify’ icon on any record
on search result page and go to record edit form. Modify the field that you need to mass update, but instead of
clicking ‘Submit’ button on the bottom click ‘Mass update’ icon on the very left of the field, to the left of the
field name. Confirm your action. The field will be updated for all search results records.
MySQL persistent connection
To specify persistent MySQL database connection open constants.php and set
PersistCnnMySQL to True. To specify regilar connection set it to False. You will need persistent connection on
slow servers with fast connection timeout.
PostgreSQL persistent connection
To specify persistent PostgreSQL database connection open constants.php and set
PersistCnnPostGreSQL to True. To specify regilar connection set it to False. You will need persistent connection on
slow servers with fast connection timeout.
Display table names with _
Open constants.php and set C_ to True.
Open constants.php and set CleftMenuJS to 0.
Disable multiple skins
Open constants.php and set CUSEMULTCSS to False.
Set default login skin
Open constants.php and set CSSF to a .css file name of the skin.
Create a new skin
Create your .css file and put it into styles directory. Name of the css file will be the name of the skin.
Disable SQL display
Open constants.php and set CDisplaySQL to False.
Open constants.php and set CJSexempt to a .css file name of the skin.
Disable DBPal.com credit link
Open constants.php and set CCREDIT to False.
Setting default interface language
Open constants.php and set "CDLN" constant to the default language name. Please note that language name must match
one of the $lan values in 'Language.php' file. The value also must match file name with language strings translations in
/languages/ directory.
Translating interface into another language
1. Open file '/languages/English' and save it as the name of your language in English without file extension.
Then translate every line in the file into your language and put it encoded into the same line position ( you might use Dreamweaver for encoding, have it display design and code
view at the same time, paste you language string into design view and copy encoded string from code view.)
2. Open 'Language.php' file and just before this line:
$l=$this->activeLanguage();
Add 2 lines as in example below, but instead of 'BrazilianPortuguese' use your language name in English, your language name must match file name containing translation strings that has been
created in step 1, and $this->_l[$lan]=array() value must be your encoded language name in your new language:
$lan='BrazilianPortuguese';
$this->_l[$lan]=array('Português do Brasil');
Now your language will show in 'Control Panel' language selector. Checking contextual correctness of translated strings and fixing then in language file is the last step.
|