コード例 #1
0
ファイル: uploader_jQuery.php プロジェクト: rb26/zenphoto
 * by Sebastian Tschan.
 *
 * PHP 5.3 or greater is required by the encorporated software.
 *
 * @package plugins
 * @subpackage uploader
 */
$plugin_is_filter = 5 | ADMIN_PLUGIN;
$plugin_description = gettext('<em>jQuery</em> image upload handler.');
$plugin_author = 'Stephen Billard (sbillard)';
$plugin_disable = version_compare(PHP_VERSION, '5.3') >= 0 ? false : gettext('jQuery uploader requires PHP 5.3 or greater.');
if ($plugin_disable) {
    enableExtension('uploader_jQuery', 0);
} else {
    if (OFFSET_PATH == 2) {
        setoptiondefault('zp_plugin_uploader_jQuery', $plugin_is_filter);
    }
    if (zp_loggedin(UPLOAD_RIGHTS)) {
        zp_register_filter('upload_handlers', 'jQueryUploadHandler');
        zp_register_filter('admin_tabs', 'jQueryUploadHandler_admin_tabs', 5);
    }
}
function jQueryUploadHandler($uploadHandlers)
{
    $uploadHandlers['jQuery'] = SERVERPATH . '/' . ZENFOLDER . '/' . PLUGIN_FOLDER . '/uploader_jQuery';
    return $uploadHandlers;
}
function jQueryUploadHandler_admin_tabs($tabs)
{
    $me = sprintf(gettext('images (%s)'), 'jQuery');
    $mylink = 'admin-upload.php?page=upload&tab=jQuery&type=' . gettext('images');
コード例 #2
0
ファイル: uploader_http.php プロジェクト: rb26/zenphoto
<?php

/**
 *
 * This plugin provides an HTTP based image upload handler for the <i>upload/images</i> admin tab.
 *
 * @package plugins
 * @subpackage uploader
 *
 */
$plugin_is_filter = 5 | ADMIN_PLUGIN;
$plugin_description = gettext('<em>http</em> image upload handler.');
$plugin_author = 'Stephen Billard (sbillard)';
if (OFFSET_PATH == 2) {
    setoptiondefault('zp_plugin_uploader_http', $plugin_is_filter);
}
if (zp_loggedin(UPLOAD_RIGHTS)) {
    zp_register_filter('upload_handlers', 'httpUploadHandler');
    zp_register_filter('admin_tabs', 'httpUploadHandler_admin_tabs', 10);
}
function httpUploadHandler($uploadHandlers)
{
    $uploadHandlers['http'] = SERVERPATH . '/' . ZENFOLDER . '/' . PLUGIN_FOLDER . '/uploader_http';
    return $uploadHandlers;
}
function httpUploadHandler_admin_tabs($tabs)
{
    $me = sprintf(gettext('images (%s)'), 'http');
    $mylink = 'admin-upload.php?page=upload&tab=http&type=' . gettext('images');
    if (is_null($tabs['upload'])) {
        $tabs['upload'] = array('text' => gettext("upload"), 'link' => WEBPATH . "/" . ZENFOLDER . '/admin-upload.php', 'subtabs' => NULL);