Exemplo n.º 1
0
            include __DIR__ . DS . 'task.js.tab.php';
        }
    }
    $folders = Get::closestFolders($destination, 'ASC', null, 'key:path');
    Config::set(array('page_title' => $speak->shields . $config->title_separator . $config->manager->title, 'page' => Shield::info($folder, true), 'cargo' => 'cargo.shield.php'));
    Shield::lot(array('segment' => 'shield', 'folder' => $folder, 'folders' => $folders, 'files' => Mecha::O(Get::files($destination . DS . $folder, SCRIPT_EXT, 'ASC', 'path'))))->attach('manager');
});
/**
 * Shield Repairer/Igniter
 * -----------------------
 */
Route::accept(array($config->manager->slug . '/shield/(:any)/ignite', $config->manager->slug . '/shield/(:any)/repair/file:(:all)'), function ($folder = false, $file = false) use($config, $speak) {
    if (!Guardian::happy(1)) {
        Shield::abort();
    }
    if (!($_folder = Shield::exist($folder))) {
        Shield::abort();
        // Folder not found!
    }
    if ($file === false) {
        $path = $content = $_file = false;
        $title = $speak->creating . ': ' . $speak->shield . $config->title_separator . $config->manager->title;
    } else {
        $path = File::path($file);
        if (!($_file = File::exist($_folder . DS . $path))) {
            Shield::abort();
            // File not found!
        }
        $content = File::open($_file)->read();
        $title = $speak->editing . ': ' . File::B($file) . $config->title_separator . $config->manager->title;
    }
Exemplo n.º 2
0
        } else {
            Notify::success(Config::speak('notify_success_deleted', $speak->shield));
        }
        Weapon::fire(array('on_shield_update', 'on_shield_destruct'), array($P, $P));
        Guardian::kick($config->manager->slug . '/shield' . ($_file !== false ? '/' . $folder : ""));
    } else {
        Notify::warning(Config::speak('notify_confirm_delete_', $file !== false ? '<code>' . $path . '</code>' : '<strong>' . $info->title . '</strong>'));
    }
    Shield::lot(array('segment' => 'shield', 'folder' => $folder, 'files' => Mecha::O(Get::files(SHIELD . DS . $folder, '*')), 'path' => $path))->attach('manager');
});
/**
 * Shield Attacher
 * ---------------
 */
Route::accept($config->manager->slug . '/shield/(attach|eject)/id:(:any)', function ($path = "", $slug = "") use($config, $speak) {
    if (!Guardian::happy(1) || !Shield::exist($slug)) {
        Shield::abort();
    }
    $mode = $path === 'attach' ? 'mount' : 'eject';
    Weapon::fire(array('on_shield_update', 'on_shield_' . $mode, 'on_shield_' . md5($slug) . '_update', 'on_shield_' . md5($slug) . '_' . $mode), array($G, $G));
    $new_config = Get::state_config();
    $new_config['shield'] = $path === 'attach' ? $slug : 'normal';
    File::serialize($new_config)->saveTo(STATE . DS . 'config.txt', 0600);
    $G = array('data' => array('id' => $slug, 'action' => $path));
    Notify::success(Config::speak('notify_success_updated', $speak->shield));
    foreach (glob(LOG . DS . 'asset.*.log', GLOB_NOSORT) as $asset_cache) {
        File::open($asset_cache)->delete();
    }
    Guardian::kick($config->manager->slug . '/shield/' . $slug);
});
/**