1: <?php
2:
3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13:
14: $plugin_is_filter = 5 | ADMIN_PLUGIN;
15: $plugin_description = gettext('<em>jQuery</em> image upload handler.');
16: $plugin_author = 'Stephen Billard (sbillard)';
17: $plugin_disable = (version_compare(PHP_VERSION, '5.3') >= 0) ? false : gettext('jQuery uploader requires PHP 5.3 or greater.');
18:
19: if ($plugin_disable) {
20: enableExtension('uploader_jQuery', 0);
21: } else {
22: if (OFFSET_PATH == 2)
23: setoptiondefault('zp_plugin_uploader_jQuery', $plugin_is_filter);
24: if (zp_loggedin(UPLOAD_RIGHTS)) {
25: zp_register_filter('upload_handlers', 'jQueryUploadHandler');
26: zp_register_filter('admin_tabs', 'jQueryUploadHandler_admin_tabs', 5);
27: }
28: }
29:
30: function jQueryUploadHandler($uploadHandlers) {
31: $uploadHandlers['jQuery'] = SERVERPATH . '/' . ZENFOLDER . '/' . PLUGIN_FOLDER . '/uploader_jQuery';
32: return $uploadHandlers;
33: }
34:
35: function jQueryUploadHandler_admin_tabs($tabs) {
36: $me = sprintf(gettext('images (%s)'), 'jQuery');
37: $mylink = 'admin-upload.php?page=upload&tab=jQuery&type=' . gettext('images');
38: if (is_null($tabs['upload'])) {
39: $tabs['upload'] = array('text' => gettext("upload"),
40: 'link' => WEBPATH . "/" . ZENFOLDER . '/admin-upload.php',
41: 'subtabs' => NULL);
42: }
43: $tabs['upload']['subtabs'][$me] = $mylink;
44: if (zp_getcookie('uploadtype') == 'jQuery')
45: $tabs['upload']['link'] = $mylink;
46: return $tabs;
47: }
48:
49: ?>