Exemple #1
0
function app_install($uid, $app)
{
    $app['uid'] = $uid;
    if (app_installed($uid, $app)) {
        $x = app_update($app);
    } else {
        $x = app_store($app);
    }
    if ($x['success']) {
        return $x['app_id'];
    }
    return false;
}
Exemple #2
0
function app_install($uid, $app)
{
    $app['uid'] = $uid;
    if (app_installed($uid, $app)) {
        $x = app_update($app);
    } else {
        $x = app_store($app);
    }
    if ($x['success']) {
        $r = q("select * from app where app_id = '%s' and app_channel = %d limit 1", dbesc($x['app_id']), intval($uid));
        if ($r) {
            build_sync_packet($uid, array('app' => $r[0]));
        }
        return $x['app_id'];
    }
    return false;
}
function core_createInterfaces($Installer)
{
    $apps = get_option('dt_int_Apps');
    $data = file_get_contents($Installer);
    if ($predata = @gzinflate($data)) {
        $data = $predata;
    }
    $data = unserialize(base64_decode($data));
    if (empty($apps[sanitize_title($data['application'])])) {
        $apps[sanitize_title($data['application'])]['state'] = 'open';
        $apps[sanitize_title($data['application'])]['name'] = $data['application'];
        update_option('dt_int_Apps', $apps);
    }
    if (!empty($data['interfaces'])) {
        foreach ($data['interfaces'] as $interface => $configData) {
            //vardump($interface);
            //$Config = unserialize(base64_decode($configData));
            $Config = $configData;
            array_walk_recursive($Config, 'core_applySystemTables');
            update_option($interface, $Config);
            app_update($data['application'], $interface, $Config['_menuAccess']);
        }
        // Update App Config
        return true;
    } else {
        unlink($Installer);
        unset($_SESSION['appInstall']);
        return false;
    }
    unlink($Installer);
    unset($_SESSION['appInstall']);
    return false;
    //vardump($data);
}
Exemple #4
0
function app_install($uid, $app)
{
    $app['uid'] = $uid;
    if (app_installed($uid, $app)) {
        $x = app_update($app);
    } else {
        $x = app_store($app);
    }
    if ($x['success']) {
        $r = q("select * from app where app_id = '%s' and app_channel = %d limit 1", dbesc($x['app_id']), intval($uid));
        if ($r) {
            if (!$r[0]['app_system']) {
                if ($app['categories'] && !$app['term']) {
                    $r[0]['term'] = q("select * from term where otype = %d and oid = d", intval(TERM_OBJ_APP), intval($r[0]['id']));
                    build_sync_packet($uid, array('app' => $r[0]));
                }
            }
        }
        return $x['app_id'];
    }
    return false;
}