Exemplo n.º 1
0
            $deletes = array($name);
        }
    }
    Config::set(array('page_title' => $speak->deleting . ': ' . (count($deletes) === 1 ? File::B($name) : $speak->assets) . $config->title_separator . $config->manager->title, 'cargo' => 'kill.asset.php'));
    if ($request = Request::post()) {
        Guardian::checkToken($request['token']);
        $info_path = Mecha::walk($deletes, function ($v) {
            $_path = ASSET . DS . $v;
            File::open($_path)->delete();
            return $_path;
        });
        $is_folder_or_file = count($deletes) === 1 && is_dir(ASSET . DS . $deletes[0]) ? 'folder' : 'file';
        $P = array('data' => array('files' => $info_path));
        Notify::success(Config::speak('notify_' . $is_folder_or_file . '_deleted', '<code>' . implode('</code>, <code>', $deletes) . '</code>'));
        Weapon::fire(array('on_asset_update', 'on_asset_destruct'), array($P, $P));
        Guardian::kick($config->manager->slug . '/asset/1' . str_replace('&', '&amp;', HTTP::query('path', $p)));
    } else {
        Notify::warning(count($deletes) === 1 ? Config::speak('notify_confirm_delete_', '<code>' . File::path($name) . '</code>') : $speak->notify_confirm_delete);
    }
    Shield::lot(array('segment' => 'asset', 'files' => Mecha::O($deletes)))->attach('manager');
});
/**
 * Multiple Asset Action
 * ---------------------
 */
Route::accept($config->manager->slug . '/asset/do', function ($path = "") use($config, $speak) {
    if ($request = Request::post()) {
        Guardian::checkToken($request['token']);
        if (!isset($request['selected'])) {
            Notify::error($speak->notify_error_no_files_selected);
            Guardian::kick($config->manager->slug . '/asset/1');
 function do_response_reply($response)
 {
     global $speak;
     $prefix = File::B(File::D($response->path));
     echo (Weapon::exist($prefix . '_footer') && Guardian::happy() ? ' / ' : "") . '<a class="a-reply" data-parent="' . $response->id . '" href="' . str_replace('&', '&amp;', HTTP::query('reply', $response->id)) . '#' . $prefix . '-form" title="' . Config::speak($prefix . '_reply_to_', Text::parse($response->name_raw, '->text')) . '">' . $speak->reply . '</a>';
 }
Exemplo n.º 3
0
    // Create proper query string data
    if ($path !== "") {
        array_shift($_GET);
    }
    // Loading the language file(s)
    $lang = LANGUAGE . DS . 'en_US' . DS . 'speak.txt';
    $lang_a = LANGUAGE . DS . $config['language'] . DS . 'speak.txt';
    if (!file_exists($lang) && !file_exists($lang_a)) {
        Guardian::abort('Language file not found.');
    }
    $lang = Text::toArray(File::open($lang)->read(""), S, '  ');
    if ($config['language'] !== 'en_US') {
        $lang_a = Text::toArray(File::open($lang_a)->read(""), S, '  ');
        Mecha::extend($lang, $lang_a);
    }
    $config['query'] = $config['url_query'] = HTTP::query($_GET);
    $config['offset'] = isset($s[1]) && is_numeric($s[1]) ? (int) $s[1] : 1;
    $config['page_type'] = $page;
    $config['speak'] = $lang;
    $config['is'] = array('post' => $page !== '404' && Mecha::walk(glob(POST . DS . '*', GLOB_NOSORT | GLOB_ONLYDIR))->has(POST . DS . $page), 'posts' => Mecha::walk(array('index', 'tag', 'archive', 'search', ""))->has($page), 'response' => false, 'responses' => false);
    unset($ss, $s, $lang, $lang_a);
    Config::set($config);
});
/**
 * =============================================================
 *  GET LANGUAGE FILE TO SPEAK
 * =============================================================
 *
 * -- CODE: ----------------------------------------------------
 *
 *    echo Config::speak('home');
Exemplo n.º 4
0
    }
    ?>
            <?php 
}
?>
            <?php 
if ($q_path) {
    ?>
            <tr>
              <?php 
    $__ = array();
    $___ = explode('/', $q_path);
    foreach ($___ as $_) {
        array_pop($___);
        $t = end($___);
        $__[] = Cell::a($asset_url . '/1' . str_replace('&', '&amp', HTTP::query(array('path' => $___ ? implode('/', $___) : false, 'q' => false))), $t ? $t : '..');
    }
    ?>
              <td colspan="3"><?php 
    echo implode(' &raquo; ', array_reverse($__)) . ' &raquo; ' . File::B($q_path);
    ?>
</td>
              <td class="td-icon"><?php 
    echo Jot::a('accept', $config->url_path . $q_path_parent_, Jot::icon('folder-open'), array('title' => $speak->exit . '&hellip;'));
    ?>
</td>
              <td class="td-icon"><?php 
    echo Jot::a('destruct', $asset_url_kill . $q_path . $q_path_parent_, Jot::icon('times'), array('title' => $speak->delete));
    ?>
</td>
            </tr>
function __do_response_reply($response)
{
    global $config, $speak, $segment;
    $q = str_replace('&', '&amp;', HTTP::query(array('parent' => $response->id, 'post' => $response->post)));
    echo (Weapon::exist($segment[0] . '_footer') ? ' / ' : "") . Cell::a($config->manager->slug . '/' . $segment[0] . '/ignite' . $q, $speak->reply);
}