So you are wanting drastically different configurations depending on the level of user that is logged in, and want to be able to have different sets of configuration files for different users? This currently isn't really possible, however I have achieved similar things by using the decorateFieldsINI() event that was added in Xataface 1.2 (I believe)... not documented yet.
Example: In the application delegate class
- Code: Select all
/**
* Function called after fields.ini file is finished loading for each table.
* @param array &$conf The contents of the fields.ini file as a 2-d array.
* @param Dataface_Table &$table The database table object for which the fields.ini were just loaded.
* @return void This just modifies $conf in place.
*/
function decorateFieldsINI(&$conf, &$table){
if ( preg_match('/^conference_feed/', $table->tablename) ){
$newconf = parse_ini_file('tables/conference_feed/fields.ini', true);
foreach ( $newconf as $key=>$val){
$conf[$key] = $val;
}
} else if ( preg_match('/^courses_feed/', $table->tablename) ){
$newconf = parse_ini_file('tables/courses_feed/fields.ini', true);
foreach ( $newconf as $key=>$val){
$conf[$key] = $val;
}
} else if ( preg_match('/^authors_feed/', $table->tablename) ){
$newconf = parse_ini_file('tables/authors_feed/fields.ini', true);
foreach ( $newconf as $key=>$val){
$conf[$key] = $val;
}
}
}
So you can have a base fields.ini file and then decorate it with whatever parameters you like by overlaying other configuration information.
This strategy opens the door for you to store your configuration information however you like (at least as it pertains to the fields.ini file).