Exemple #1
0
    return abs($a) - abs($b);
}
function make_consecutive(&$orders, $step = 50)
{
    uasort($orders, 'abs_fn_cmp');
    $crt = 1;
    foreach ($orders as $id => $pos) {
        $orders[$id] = $step * ($pos < 0 ? -$crt : $crt);
        $crt++;
    }
}
global $template;
include_once PHPWG_ROOT_PATH . 'include/block.class.php';
$menu = new BlockManager('menubar');
$menu->load_registered_blocks();
$reg_blocks = $menu->get_registered_blocks();
$mb_conf = @$conf['blk_' . $menu->get_id()];
if (is_string($mb_conf)) {
    $mb_conf = unserialize($mb_conf);
}
if (!is_array($mb_conf)) {
    $mb_conf = array();
}
foreach ($mb_conf as $id => $pos) {
    if (!isset($reg_blocks[$id])) {
        unset($mb_conf[$id]);
    }
}
if (isset($_POST['reset'])) {
    $mb_conf = array();
    $query = '