Modifed "update" and "insert" function / many changed queries

This commit is contained in:
Michael 2017-08-09 21:12:41 +00:00
parent a5e7f7bf70
commit fce72cbbc8
11 changed files with 66 additions and 123 deletions

View file

@ -183,20 +183,18 @@ function unregister_hook($hook,$file,$function) {
}}
if (! function_exists('load_hooks')) {
function load_hooks() {
$a = get_app();
$a->hooks = array();
$r = q("SELECT * FROM `hook` WHERE 1 ORDER BY `priority` DESC, `file`");
$r = dba::select('hook', array('hook', 'file', 'function'), array(), array('order' => array('priority' => 'desc', 'file')));
if (dbm::is_result($r)) {
foreach ($r as $rr) {
if (! array_key_exists($rr['hook'],$a->hooks))
$a->hooks[$rr['hook']] = array();
$a->hooks[$rr['hook']][] = array($rr['file'],$rr['function']);
while ($rr = dba::fetch($r)) {
if (! array_key_exists($rr['hook'],$a->hooks)) {
$a->hooks[$rr['hook']] = array();
}
$a->hooks[$rr['hook']][] = array($rr['file'],$rr['function']);
}
}}
}
/**
* @brief Calls a hook.