Hi IA staff.
I'm creating a new plugin and with the current "Hook" list I am able to modify the "out put" to suit my plugin except in the "Section Editors" > "table" > "Field Editor".
In lib/database_functions.php, the function loadSchema($tableName, $schemaDir = '') is called prior to the "Field Editor" opening which over rides any plugin modification I have made else where.
Adding a hook in this function would allow for easy modifications to the "Field Editor" dialogue.
function loadSchema($tableName, $schemaDir = '') {
global $APP;
// error checking
if (!$tableName) { die(__FUNCTION__ . ": no tableName specified!"); }
if (preg_match('/[^a-zA-Z0-9\-\_\(\)]+/', $tableName)) { die(__FUNCTION__ . ": tableName '" .htmlspecialchars($tableName). "' contains invalid characters!"); }
// get schemapath
$tableNameWithoutPrefix = getTableNameWithoutPrefix($tableName);
if (!$schemaDir) { $schemaFilepath = DATA_DIR . "/schema/$tableNameWithoutPrefix.ini.php"; }
else { $schemaFilepath = "$schemaDir/". getTableNameWithoutPrefix($tableName) . ".ini.php"; }
// load schema
$schema = array();
if (file_exists($schemaFilepath)) {
$schema = loadStructOrINI($schemaFilepath);
}
// add _tableName (v2.16+)
if ($schema) {
$schema['_tableName'] = $tableNameWithoutPrefix;
}
doAction("new_loadSchema_hook",$tableName,$schemaDir);
//
return $schema;
}
As side from solving my plugin issue, it would seem that this is an ideal location for more advance customization due to the existence of the 2nd parameter "$schemaDir".
Would you consider adding a "hook" at this location in your next release?
Alternatively, can you suggest a way of intercepting the output to perform modifications?
Glen
http://www.CanadianDomainRegistry.ca
ITI Internetworking Technologies Inc.