Move plugins repository into roundcubemail root folder; svn:externals are not defined anymore
New file |
| | |
| | | /** |
| | | * ACL plugin script |
| | | * |
| | | * @version @package_version@ |
| | | * @author Aleksander Machniak <alec@alec.pl> |
| | | */ |
| | | |
| | | if (window.rcmail) { |
| | | rcmail.addEventListener('init', function() { |
| | | if (rcmail.gui_objects.acltable) { |
| | | rcmail.acl_list_init(); |
| | | // enable autocomplete on user input |
| | | if (rcmail.env.acl_users_source) { |
| | | rcmail.init_address_input_events($('#acluser'), {action:'settings/plugin.acl-autocomplete'}); |
| | | // fix inserted value |
| | | rcmail.addEventListener('autocomplete_insert', function(e) { |
| | | if (e.field.id != 'acluser') |
| | | return; |
| | | |
| | | var value = e.insert; |
| | | // get UID from the entry value |
| | | if (value.match(/\s*\(([^)]+)\)[, ]*$/)) |
| | | value = RegExp.$1; |
| | | e.field.value = value; |
| | | }); |
| | | } |
| | | } |
| | | |
| | | rcmail.enable_command('acl-create', 'acl-save', 'acl-cancel', 'acl-mode-switch', true); |
| | | rcmail.enable_command('acl-delete', 'acl-edit', false); |
| | | }); |
| | | } |
| | | |
| | | // Display new-entry form |
| | | rcube_webmail.prototype.acl_create = function() |
| | | { |
| | | this.acl_init_form(); |
| | | } |
| | | |
| | | // Display ACL edit form |
| | | rcube_webmail.prototype.acl_edit = function() |
| | | { |
| | | // @TODO: multi-row edition |
| | | var id = this.acl_list.get_single_selection(); |
| | | if (id) |
| | | this.acl_init_form(id); |
| | | } |
| | | |
| | | // ACL entry delete |
| | | rcube_webmail.prototype.acl_delete = function() |
| | | { |
| | | var users = this.acl_get_usernames(); |
| | | |
| | | if (users && users.length && confirm(this.get_label('acl.deleteconfirm'))) { |
| | | this.http_request('settings/plugin.acl', '_act=delete&_user='+urlencode(users.join(',')) |
| | | + '&_mbox='+urlencode(this.env.mailbox), |
| | | this.set_busy(true, 'acl.deleting')); |
| | | } |
| | | } |
| | | |
| | | // Save ACL data |
| | | rcube_webmail.prototype.acl_save = function() |
| | | { |
| | | var user = $('#acluser').val(), rights = '', type; |
| | | |
| | | $(':checkbox', this.env.acl_advanced ? $('#advancedrights') : sim_ul = $('#simplerights')).map(function() { |
| | | if (this.checked) |
| | | rights += this.value; |
| | | }); |
| | | |
| | | if (type = $('input:checked[name=usertype]').val()) { |
| | | if (type != 'user') |
| | | user = type; |
| | | } |
| | | |
| | | if (!user) { |
| | | alert(this.get_label('acl.nouser')); |
| | | return; |
| | | } |
| | | if (!rights) { |
| | | alert(this.get_label('acl.norights')); |
| | | return; |
| | | } |
| | | |
| | | this.http_request('settings/plugin.acl', '_act=save' |
| | | + '&_user='+urlencode(user) |
| | | + '&_acl=' +rights |
| | | + '&_mbox='+urlencode(this.env.mailbox) |
| | | + (this.acl_id ? '&_old='+this.acl_id : ''), |
| | | this.set_busy(true, 'acl.saving')); |
| | | } |
| | | |
| | | // Cancel/Hide form |
| | | rcube_webmail.prototype.acl_cancel = function() |
| | | { |
| | | this.ksearch_blur(); |
| | | this.acl_form.hide(); |
| | | } |
| | | |
| | | // Update data after save (and hide form) |
| | | rcube_webmail.prototype.acl_update = function(o) |
| | | { |
| | | // delete old row |
| | | if (o.old) |
| | | this.acl_remove_row(o.old); |
| | | // make sure the same ID doesn't exist |
| | | else if (this.env.acl[o.id]) |
| | | this.acl_remove_row(o.id); |
| | | |
| | | // add new row |
| | | this.acl_add_row(o, true); |
| | | // hide autocomplete popup |
| | | this.ksearch_blur(); |
| | | // hide form |
| | | this.acl_form.hide(); |
| | | } |
| | | |
| | | // Switch table display mode |
| | | rcube_webmail.prototype.acl_mode_switch = function(elem) |
| | | { |
| | | this.env.acl_advanced = !this.env.acl_advanced; |
| | | this.enable_command('acl-delete', 'acl-edit', false); |
| | | this.http_request('settings/plugin.acl', '_act=list' |
| | | + '&_mode='+(this.env.acl_advanced ? 'advanced' : 'simple') |
| | | + '&_mbox='+urlencode(this.env.mailbox), |
| | | this.set_busy(true, 'loading')); |
| | | } |
| | | |
| | | // ACL table initialization |
| | | rcube_webmail.prototype.acl_list_init = function() |
| | | { |
| | | this.acl_list = new rcube_list_widget(this.gui_objects.acltable, |
| | | {multiselect:true, draggable:false, keyboard:true, toggleselect:true}); |
| | | this.acl_list.addEventListener('select', function(o) { rcmail.acl_list_select(o); }); |
| | | this.acl_list.addEventListener('dblclick', function(o) { rcmail.acl_list_dblclick(o); }); |
| | | this.acl_list.addEventListener('keypress', function(o) { rcmail.acl_list_keypress(o); }); |
| | | this.acl_list.init(); |
| | | } |
| | | |
| | | // ACL table row selection handler |
| | | rcube_webmail.prototype.acl_list_select = function(list) |
| | | { |
| | | rcmail.enable_command('acl-delete', list.selection.length > 0); |
| | | rcmail.enable_command('acl-edit', list.selection.length == 1); |
| | | list.focus(); |
| | | } |
| | | |
| | | // ACL table double-click handler |
| | | rcube_webmail.prototype.acl_list_dblclick = function(list) |
| | | { |
| | | this.acl_edit(); |
| | | } |
| | | |
| | | // ACL table keypress handler |
| | | rcube_webmail.prototype.acl_list_keypress = function(list) |
| | | { |
| | | if (list.key_pressed == list.ENTER_KEY) |
| | | this.command('acl-edit'); |
| | | else if (list.key_pressed == list.DELETE_KEY || list.key_pressed == list.BACKSPACE_KEY) |
| | | if (!this.acl_form || !this.acl_form.is(':visible')) |
| | | this.command('acl-delete'); |
| | | } |
| | | |
| | | // Reloads ACL table |
| | | rcube_webmail.prototype.acl_list_update = function(html) |
| | | { |
| | | $(this.gui_objects.acltable).html(html); |
| | | this.acl_list_init(); |
| | | } |
| | | |
| | | // Returns names of users in selected rows |
| | | rcube_webmail.prototype.acl_get_usernames = function() |
| | | { |
| | | var users = [], n, len, cell, row, |
| | | list = this.acl_list, |
| | | selection = list.get_selection(); |
| | | |
| | | for (n=0, len=selection.length; n<len; n++) { |
| | | if (this.env.acl_specials.length && $.inArray(selection[n], this.env.acl_specials) >= 0) { |
| | | users.push(selection[n]); |
| | | } |
| | | else if (row = list.rows[selection[n]]) { |
| | | cell = $('td.user', row.obj); |
| | | if (cell.length == 1) |
| | | users.push(cell.text()); |
| | | } |
| | | } |
| | | |
| | | return users; |
| | | } |
| | | |
| | | // Removes ACL table row |
| | | rcube_webmail.prototype.acl_remove_row = function(id) |
| | | { |
| | | var list = this.acl_list; |
| | | |
| | | list.remove_row(id); |
| | | list.clear_selection(); |
| | | |
| | | // we don't need it anymore (remove id conflict) |
| | | $('#rcmrow'+id).remove(); |
| | | this.env.acl[id] = null; |
| | | |
| | | this.enable_command('acl-delete', list.selection.length > 0); |
| | | this.enable_command('acl-edit', list.selection.length == 1); |
| | | } |
| | | |
| | | // Adds ACL table row |
| | | rcube_webmail.prototype.acl_add_row = function(o, sel) |
| | | { |
| | | var n, len, ids = [], spec = [], id = o.id, list = this.acl_list, |
| | | items = this.env.acl_advanced ? [] : this.env.acl_items, |
| | | table = this.gui_objects.acltable, |
| | | row = $('thead > tr', table).clone(); |
| | | |
| | | // Update new row |
| | | $('td', row).map(function() { |
| | | var r, cl = this.className.replace(/^acl/, ''); |
| | | |
| | | if (items && items[cl]) |
| | | cl = items[cl]; |
| | | |
| | | if (cl == 'user') |
| | | $(this).text(o.username); |
| | | else |
| | | $(this).addClass(rcmail.acl_class(o.acl, cl)).text(''); |
| | | }); |
| | | |
| | | row.attr('id', 'rcmrow'+id); |
| | | row = row.get(0); |
| | | |
| | | this.env.acl[id] = o.acl; |
| | | |
| | | // sorting... (create an array of user identifiers, then sort it) |
| | | for (n in this.env.acl) { |
| | | if (this.env.acl[n]) { |
| | | if (this.env.acl_specials.length && $.inArray(n, this.env.acl_specials) >= 0) |
| | | spec.push(n); |
| | | else |
| | | ids.push(n); |
| | | } |
| | | } |
| | | ids.sort(); |
| | | // specials on the top |
| | | ids = spec.concat(ids); |
| | | |
| | | // find current id |
| | | for (n=0, len=ids.length; n<len; n++) |
| | | if (ids[n] == id) |
| | | break; |
| | | |
| | | // add row |
| | | if (n && n < len) { |
| | | $('#rcmrow'+ids[n-1]).after(row); |
| | | list.init_row(row); |
| | | list.rowcount++; |
| | | } |
| | | else |
| | | list.insert_row(row); |
| | | |
| | | if (sel) |
| | | list.select_row(o.id); |
| | | } |
| | | |
| | | // Initializes and shows ACL create/edit form |
| | | rcube_webmail.prototype.acl_init_form = function(id) |
| | | { |
| | | var ul, row, td, val = '', type = 'user', li_elements, body = $('body'), |
| | | adv_ul = $('#advancedrights'), sim_ul = $('#simplerights'), |
| | | name_input = $('#acluser'); |
| | | |
| | | if (!this.acl_form) { |
| | | var fn = function () { $('input[value=user]').prop('checked', true); }; |
| | | name_input.click(fn).keypress(fn); |
| | | } |
| | | |
| | | this.acl_form = $('#aclform'); |
| | | |
| | | // Hide unused items |
| | | if (this.env.acl_advanced) { |
| | | adv_ul.show(); |
| | | sim_ul.hide(); |
| | | ul = adv_ul; |
| | | } |
| | | else { |
| | | sim_ul.show(); |
| | | adv_ul.hide(); |
| | | ul = sim_ul; |
| | | } |
| | | |
| | | // initialize form fields |
| | | li_elements = $(':checkbox', ul); |
| | | li_elements.attr('checked', false); |
| | | |
| | | if (id && (row = this.acl_list.rows[id])) { |
| | | row = row.obj; |
| | | li_elements.map(function() { |
| | | val = this.value; |
| | | td = $('td.'+this.id, row); |
| | | if (td && td.hasClass('enabled')) |
| | | this.checked = true; |
| | | }); |
| | | |
| | | if (!this.env.acl_specials.length || $.inArray(id, this.env.acl_specials) < 0) |
| | | val = $('td.user', row).text(); |
| | | else |
| | | type = id; |
| | | } |
| | | // mark read (lrs) rights by default |
| | | else |
| | | li_elements.filter(function() { return this.id.match(/^acl([lrs]|read)$/); }).prop('checked', true); |
| | | |
| | | name_input.val(val); |
| | | $('input[value='+type+']').prop('checked', true); |
| | | |
| | | this.acl_id = id; |
| | | |
| | | // position the form horizontally |
| | | var bw = body.width(), mw = this.acl_form.width(); |
| | | |
| | | if (bw >= mw) |
| | | this.acl_form.css({left: parseInt((bw - mw)/2)+'px'}); |
| | | |
| | | // display it |
| | | this.acl_form.show(); |
| | | if (type == 'user') |
| | | name_input.focus(); |
| | | |
| | | // unfocus the list, make backspace key in name input field working |
| | | this.acl_list.blur(); |
| | | } |
| | | |
| | | // Returns class name according to ACL comparision result |
| | | rcube_webmail.prototype.acl_class = function(acl1, acl2) |
| | | { |
| | | var i, len, found = 0; |
| | | |
| | | acl1 = String(acl1); |
| | | acl2 = String(acl2); |
| | | |
| | | for (i=0, len=acl2.length; i<len; i++) |
| | | if (acl1.indexOf(acl2[i]) > -1) |
| | | found++; |
| | | |
| | | if (found == len) |
| | | return 'enabled'; |
| | | else if (found) |
| | | return 'partial'; |
| | | |
| | | return 'disabled'; |
| | | } |
New file |
| | |
| | | <?php |
| | | |
| | | /** |
| | | * Folders Access Control Lists Management (RFC4314, RFC2086) |
| | | * |
| | | * @version @package_version@ |
| | | * @author Aleksander Machniak <alec@alec.pl> |
| | | * |
| | | * |
| | | * Copyright (C) 2011-2012, Kolab Systems AG |
| | | * |
| | | * This program is free software; you can redistribute it and/or modify |
| | | * it under the terms of the GNU General Public License version 2 |
| | | * as published by the Free Software Foundation. |
| | | * |
| | | * This program is distributed in the hope that it will be useful, |
| | | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| | | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| | | * GNU General Public License for more details. |
| | | * |
| | | * You should have received a copy of the GNU General Public License along |
| | | * with this program; if not, write to the Free Software Foundation, Inc., |
| | | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. |
| | | */ |
| | | |
| | | class acl extends rcube_plugin |
| | | { |
| | | public $task = 'settings|addressbook|calendar'; |
| | | |
| | | private $rc; |
| | | private $supported = null; |
| | | private $mbox; |
| | | private $ldap; |
| | | private $specials = array('anyone', 'anonymous'); |
| | | |
| | | /** |
| | | * Plugin initialization |
| | | */ |
| | | function init() |
| | | { |
| | | $this->rc = rcmail::get_instance(); |
| | | |
| | | // Register hooks |
| | | $this->add_hook('folder_form', array($this, 'folder_form')); |
| | | // kolab_addressbook plugin |
| | | $this->add_hook('addressbook_form', array($this, 'folder_form')); |
| | | $this->add_hook('calendar_form_kolab', array($this, 'folder_form')); |
| | | // Plugin actions |
| | | $this->register_action('plugin.acl', array($this, 'acl_actions')); |
| | | $this->register_action('plugin.acl-autocomplete', array($this, 'acl_autocomplete')); |
| | | } |
| | | |
| | | /** |
| | | * Handler for plugin actions (AJAX) |
| | | */ |
| | | function acl_actions() |
| | | { |
| | | $action = trim(get_input_value('_act', RCUBE_INPUT_GPC)); |
| | | |
| | | // Connect to IMAP |
| | | $this->rc->storage_init(); |
| | | |
| | | // Load localization and configuration |
| | | $this->add_texts('localization/'); |
| | | $this->load_config(); |
| | | |
| | | if ($action == 'save') { |
| | | $this->action_save(); |
| | | } |
| | | else if ($action == 'delete') { |
| | | $this->action_delete(); |
| | | } |
| | | else if ($action == 'list') { |
| | | $this->action_list(); |
| | | } |
| | | |
| | | // Only AJAX actions |
| | | $this->rc->output->send(); |
| | | } |
| | | |
| | | /** |
| | | * Handler for user login autocomplete request |
| | | */ |
| | | function acl_autocomplete() |
| | | { |
| | | $this->load_config(); |
| | | |
| | | $search = get_input_value('_search', RCUBE_INPUT_GPC, true); |
| | | $sid = get_input_value('_id', RCUBE_INPUT_GPC); |
| | | $users = array(); |
| | | |
| | | if ($this->init_ldap()) { |
| | | $max = (int) $this->rc->config->get('autocomplete_max', 15); |
| | | $mode = (int) $this->rc->config->get('addressbook_search_mode'); |
| | | |
| | | $this->ldap->set_pagesize($max); |
| | | $result = $this->ldap->search('*', $search, $mode); |
| | | |
| | | foreach ($result->records as $record) { |
| | | $user = $record['uid']; |
| | | |
| | | if (is_array($user)) { |
| | | $user = array_filter($user); |
| | | $user = $user[0]; |
| | | } |
| | | |
| | | if ($user) { |
| | | if ($record['name']) |
| | | $user = $record['name'] . ' (' . $user . ')'; |
| | | |
| | | $users[] = $user; |
| | | } |
| | | } |
| | | } |
| | | |
| | | sort($users, SORT_LOCALE_STRING); |
| | | |
| | | $this->rc->output->command('ksearch_query_results', $users, $search, $sid); |
| | | $this->rc->output->send(); |
| | | } |
| | | |
| | | /** |
| | | * Handler for 'folder_form' hook |
| | | * |
| | | * @param array $args Hook arguments array (form data) |
| | | * |
| | | * @return array Hook arguments array |
| | | */ |
| | | function folder_form($args) |
| | | { |
| | | // Edited folder name (empty in create-folder mode) |
| | | $mbox_imap = $args['options']['name']; |
| | | if (!strlen($mbox_imap)) { |
| | | return $args; |
| | | } |
| | | /* |
| | | // Do nothing on protected folders (?) |
| | | if ($args['options']['protected']) { |
| | | return $args; |
| | | } |
| | | */ |
| | | // Namespace root |
| | | if ($args['options']['is_root']) { |
| | | return $args; |
| | | } |
| | | |
| | | // Get MYRIGHTS |
| | | if (!($myrights = $args['options']['rights'])) { |
| | | return $args; |
| | | } |
| | | |
| | | // Do nothing if no ACL support |
| | | if (!$this->rc->storage->get_capability('ACL')) { |
| | | return $args; |
| | | } |
| | | |
| | | // Load localization and include scripts |
| | | $this->load_config(); |
| | | $this->add_texts('localization/', array('deleteconfirm', 'norights', |
| | | 'nouser', 'deleting', 'saving')); |
| | | $this->include_script('acl.js'); |
| | | $this->rc->output->include_script('list.js'); |
| | | $this->include_stylesheet($this->local_skin_path().'/acl.css'); |
| | | |
| | | // add Info fieldset if it doesn't exist |
| | | if (!isset($args['form']['props']['fieldsets']['info'])) |
| | | $args['form']['props']['fieldsets']['info'] = array( |
| | | 'name' => rcube_label('info'), |
| | | 'content' => array()); |
| | | |
| | | // Display folder rights to 'Info' fieldset |
| | | $args['form']['props']['fieldsets']['info']['content']['myrights'] = array( |
| | | 'label' => Q($this->gettext('myrights')), |
| | | 'value' => $this->acl2text($myrights) |
| | | ); |
| | | |
| | | // Return if not folder admin |
| | | if (!in_array('a', $myrights)) { |
| | | return $args; |
| | | } |
| | | |
| | | // The 'Sharing' tab |
| | | $this->mbox = $mbox_imap; |
| | | $this->rc->output->set_env('acl_users_source', (bool) $this->rc->config->get('acl_users_source')); |
| | | $this->rc->output->set_env('mailbox', $mbox_imap); |
| | | $this->rc->output->add_handlers(array( |
| | | 'acltable' => array($this, 'templ_table'), |
| | | 'acluser' => array($this, 'templ_user'), |
| | | 'aclrights' => array($this, 'templ_rights'), |
| | | )); |
| | | |
| | | $this->rc->output->set_env('autocomplete_max', (int)$this->rc->config->get('autocomplete_max', 15)); |
| | | $this->rc->output->set_env('autocomplete_min_length', $this->rc->config->get('autocomplete_min_length')); |
| | | $this->rc->output->add_label('autocompletechars', 'autocompletemore'); |
| | | |
| | | $args['form']['sharing'] = array( |
| | | 'name' => Q($this->gettext('sharing')), |
| | | 'content' => $this->rc->output->parse('acl.table', false, false), |
| | | ); |
| | | |
| | | return $args; |
| | | } |
| | | |
| | | /** |
| | | * Creates ACL rights table |
| | | * |
| | | * @param array $attrib Template object attributes |
| | | * |
| | | * @return string HTML Content |
| | | */ |
| | | function templ_table($attrib) |
| | | { |
| | | if (empty($attrib['id'])) |
| | | $attrib['id'] = 'acl-table'; |
| | | |
| | | $out = $this->list_rights($attrib); |
| | | |
| | | $this->rc->output->add_gui_object('acltable', $attrib['id']); |
| | | |
| | | return $out; |
| | | } |
| | | |
| | | /** |
| | | * Creates ACL rights form (rights list part) |
| | | * |
| | | * @param array $attrib Template object attributes |
| | | * |
| | | * @return string HTML Content |
| | | */ |
| | | function templ_rights($attrib) |
| | | { |
| | | // Get supported rights |
| | | $supported = $this->rights_supported(); |
| | | |
| | | // depending on server capability either use 'te' or 'd' for deleting msgs |
| | | $deleteright = implode(array_intersect(str_split('ted'), $supported)); |
| | | |
| | | $out = ''; |
| | | $ul = ''; |
| | | $input = new html_checkbox(); |
| | | |
| | | // Advanced rights |
| | | $attrib['id'] = 'advancedrights'; |
| | | foreach ($supported as $val) { |
| | | $id = "acl$val"; |
| | | $ul .= html::tag('li', null, |
| | | $input->show('', array( |
| | | 'name' => "acl[$val]", 'value' => $val, 'id' => $id)) |
| | | . html::label(array('for' => $id, 'title' => $this->gettext('longacl'.$val)), |
| | | $this->gettext('acl'.$val))); |
| | | } |
| | | |
| | | $out = html::tag('ul', $attrib, $ul, html::$common_attrib); |
| | | |
| | | // Simple rights |
| | | $ul = ''; |
| | | $attrib['id'] = 'simplerights'; |
| | | $items = array( |
| | | 'read' => 'lrs', |
| | | 'write' => 'wi', |
| | | 'delete' => $deleteright, |
| | | 'other' => preg_replace('/[lrswi'.$deleteright.']/', '', implode($supported)), |
| | | ); |
| | | |
| | | foreach ($items as $key => $val) { |
| | | $id = "acl$key"; |
| | | $ul .= html::tag('li', null, |
| | | $input->show('', array( |
| | | 'name' => "acl[$val]", 'value' => $val, 'id' => $id)) |
| | | . html::label(array('for' => $id, 'title' => $this->gettext('longacl'.$key)), |
| | | $this->gettext('acl'.$key))); |
| | | } |
| | | |
| | | $out .= "\n" . html::tag('ul', $attrib, $ul, html::$common_attrib); |
| | | |
| | | $this->rc->output->set_env('acl_items', $items); |
| | | |
| | | return $out; |
| | | } |
| | | |
| | | /** |
| | | * Creates ACL rights form (user part) |
| | | * |
| | | * @param array $attrib Template object attributes |
| | | * |
| | | * @return string HTML Content |
| | | */ |
| | | function templ_user($attrib) |
| | | { |
| | | // Create username input |
| | | $attrib['name'] = 'acluser'; |
| | | |
| | | $textfield = new html_inputfield($attrib); |
| | | |
| | | $fields['user'] = html::label(array('for' => 'iduser'), $this->gettext('username')) |
| | | . ' ' . $textfield->show(); |
| | | |
| | | // Add special entries |
| | | if (!empty($this->specials)) { |
| | | foreach ($this->specials as $key) { |
| | | $fields[$key] = html::label(array('for' => 'id'.$key), $this->gettext($key)); |
| | | } |
| | | } |
| | | |
| | | $this->rc->output->set_env('acl_specials', $this->specials); |
| | | |
| | | // Create list with radio buttons |
| | | if (count($fields) > 1) { |
| | | $ul = ''; |
| | | $radio = new html_radiobutton(array('name' => 'usertype')); |
| | | foreach ($fields as $key => $val) { |
| | | $ul .= html::tag('li', null, $radio->show($key == 'user' ? 'user' : '', |
| | | array('value' => $key, 'id' => 'id'.$key)) |
| | | . $val); |
| | | } |
| | | |
| | | $out = html::tag('ul', array('id' => 'usertype'), $ul, html::$common_attrib); |
| | | } |
| | | // Display text input alone |
| | | else { |
| | | $out = $fields['user']; |
| | | } |
| | | |
| | | return $out; |
| | | } |
| | | |
| | | /** |
| | | * Creates ACL rights table |
| | | * |
| | | * @param array $attrib Template object attributes |
| | | * |
| | | * @return string HTML Content |
| | | */ |
| | | private function list_rights($attrib=array()) |
| | | { |
| | | // Get ACL for the folder |
| | | $acl = $this->rc->storage->get_acl($this->mbox); |
| | | |
| | | if (!is_array($acl)) { |
| | | $acl = array(); |
| | | } |
| | | |
| | | // Keep special entries (anyone/anonymous) on top of the list |
| | | if (!empty($this->specials) && !empty($acl)) { |
| | | foreach ($this->specials as $key) { |
| | | if (isset($acl[$key])) { |
| | | $acl_special[$key] = $acl[$key]; |
| | | unset($acl[$key]); |
| | | } |
| | | } |
| | | } |
| | | |
| | | // Sort the list by username |
| | | uksort($acl, 'strnatcasecmp'); |
| | | |
| | | if (!empty($acl_special)) { |
| | | $acl = array_merge($acl_special, $acl); |
| | | } |
| | | |
| | | // Get supported rights and build column names |
| | | $supported = $this->rights_supported(); |
| | | |
| | | // depending on server capability either use 'te' or 'd' for deleting msgs |
| | | $deleteright = implode(array_intersect(str_split('ted'), $supported)); |
| | | |
| | | // Use advanced or simple (grouped) rights |
| | | $advanced = $this->rc->config->get('acl_advanced_mode'); |
| | | |
| | | if ($advanced) { |
| | | $items = array(); |
| | | foreach ($supported as $sup) { |
| | | $items[$sup] = $sup; |
| | | } |
| | | } |
| | | else { |
| | | $items = array( |
| | | 'read' => 'lrs', |
| | | 'write' => 'wi', |
| | | 'delete' => $deleteright, |
| | | 'other' => preg_replace('/[lrswi'.$deleteright.']/', '', implode($supported)), |
| | | ); |
| | | } |
| | | |
| | | // Create the table |
| | | $attrib['noheader'] = true; |
| | | $table = new html_table($attrib); |
| | | |
| | | // Create table header |
| | | $table->add_header('user', $this->gettext('identifier')); |
| | | foreach (array_keys($items) as $key) { |
| | | $label = $this->gettext('shortacl'.$key); |
| | | $table->add_header(array('class' => 'acl'.$key, 'title' => $label), $label); |
| | | } |
| | | |
| | | $i = 1; |
| | | $js_table = array(); |
| | | foreach ($acl as $user => $rights) { |
| | | if ($this->rc->storage->conn->user == $user) { |
| | | continue; |
| | | } |
| | | |
| | | // filter out virtual rights (c or d) the server may return |
| | | $userrights = array_intersect($rights, $supported); |
| | | $userid = html_identifier($user); |
| | | |
| | | if (!empty($this->specials) && in_array($user, $this->specials)) { |
| | | $user = $this->gettext($user); |
| | | } |
| | | |
| | | $table->add_row(array('id' => 'rcmrow'.$userid)); |
| | | $table->add('user', Q($user)); |
| | | |
| | | foreach ($items as $key => $right) { |
| | | $in = $this->acl_compare($userrights, $right); |
| | | switch ($in) { |
| | | case 2: $class = 'enabled'; break; |
| | | case 1: $class = 'partial'; break; |
| | | default: $class = 'disabled'; break; |
| | | } |
| | | $table->add('acl' . $key . ' ' . $class, ''); |
| | | } |
| | | |
| | | $js_table[$userid] = implode($userrights); |
| | | } |
| | | |
| | | $this->rc->output->set_env('acl', $js_table); |
| | | $this->rc->output->set_env('acl_advanced', $advanced); |
| | | |
| | | $out = $table->show(); |
| | | |
| | | return $out; |
| | | } |
| | | |
| | | /** |
| | | * Handler for ACL update/create action |
| | | */ |
| | | private function action_save() |
| | | { |
| | | $mbox = trim(get_input_value('_mbox', RCUBE_INPUT_GPC, true)); // UTF7-IMAP |
| | | $user = trim(get_input_value('_user', RCUBE_INPUT_GPC)); |
| | | $acl = trim(get_input_value('_acl', RCUBE_INPUT_GPC)); |
| | | $oldid = trim(get_input_value('_old', RCUBE_INPUT_GPC)); |
| | | |
| | | $acl = array_intersect(str_split($acl), $this->rights_supported()); |
| | | $users = $oldid ? array($user) : explode(',', $user); |
| | | |
| | | foreach ($users as $user) { |
| | | $user = trim($user); |
| | | |
| | | if (!empty($this->specials) && in_array($user, $this->specials)) { |
| | | $username = $this->gettext($user); |
| | | } |
| | | else { |
| | | if (!strpos($user, '@') && ($realm = $this->get_realm())) { |
| | | $user .= '@' . rcube_idn_to_ascii(preg_replace('/^@/', '', $realm)); |
| | | } |
| | | $username = $user; |
| | | } |
| | | |
| | | if (!$acl || !$user || !strlen($mbox)) { |
| | | continue; |
| | | } |
| | | |
| | | if ($user != $_SESSION['username'] && $username != $_SESSION['username']) { |
| | | if ($this->rc->storage->set_acl($mbox, $user, $acl)) { |
| | | $ret = array('id' => html_identifier($user), |
| | | 'username' => $username, 'acl' => implode($acl), 'old' => $oldid); |
| | | $this->rc->output->command('acl_update', $ret); |
| | | $result++; |
| | | } |
| | | } |
| | | } |
| | | |
| | | if ($result) { |
| | | $this->rc->output->show_message($oldid ? 'acl.updatesuccess' : 'acl.createsuccess', 'confirmation'); |
| | | } |
| | | else { |
| | | $this->rc->output->show_message($oldid ? 'acl.updateerror' : 'acl.createerror', 'error'); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * Handler for ACL delete action |
| | | */ |
| | | private function action_delete() |
| | | { |
| | | $mbox = trim(get_input_value('_mbox', RCUBE_INPUT_GPC, true)); //UTF7-IMAP |
| | | $user = trim(get_input_value('_user', RCUBE_INPUT_GPC)); |
| | | |
| | | $user = explode(',', $user); |
| | | |
| | | foreach ($user as $u) { |
| | | $u = trim($u); |
| | | if ($this->rc->storage->delete_acl($mbox, $u)) { |
| | | $this->rc->output->command('acl_remove_row', html_identifier($u)); |
| | | } |
| | | else { |
| | | $error = true; |
| | | } |
| | | } |
| | | |
| | | if (!$error) { |
| | | $this->rc->output->show_message('acl.deletesuccess', 'confirmation'); |
| | | } |
| | | else { |
| | | $this->rc->output->show_message('acl.deleteerror', 'error'); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * Handler for ACL list update action (with display mode change) |
| | | */ |
| | | private function action_list() |
| | | { |
| | | if (in_array('acl_advanced_mode', (array)$this->rc->config->get('dont_override'))) { |
| | | return; |
| | | } |
| | | |
| | | $this->mbox = trim(get_input_value('_mbox', RCUBE_INPUT_GPC, true)); // UTF7-IMAP |
| | | $advanced = trim(get_input_value('_mode', RCUBE_INPUT_GPC)); |
| | | $advanced = $advanced == 'advanced' ? true : false; |
| | | |
| | | // Save state in user preferences |
| | | $this->rc->user->save_prefs(array('acl_advanced_mode' => $advanced)); |
| | | |
| | | $out = $this->list_rights(); |
| | | |
| | | $out = preg_replace(array('/^<table[^>]+>/', '/<\/table>$/'), '', $out); |
| | | |
| | | $this->rc->output->command('acl_list_update', $out); |
| | | } |
| | | |
| | | /** |
| | | * Creates <UL> list with descriptive access rights |
| | | * |
| | | * @param array $rights MYRIGHTS result |
| | | * |
| | | * @return string HTML content |
| | | */ |
| | | function acl2text($rights) |
| | | { |
| | | if (empty($rights)) { |
| | | return ''; |
| | | } |
| | | |
| | | $supported = $this->rights_supported(); |
| | | $list = array(); |
| | | $attrib = array( |
| | | 'name' => 'rcmyrights', |
| | | 'style' => 'margin:0; padding:0 15px;', |
| | | ); |
| | | |
| | | foreach ($supported as $right) { |
| | | if (in_array($right, $rights)) { |
| | | $list[] = html::tag('li', null, Q($this->gettext('acl' . $right))); |
| | | } |
| | | } |
| | | |
| | | if (count($list) == count($supported)) |
| | | return Q($this->gettext('aclfull')); |
| | | |
| | | return html::tag('ul', $attrib, implode("\n", $list)); |
| | | } |
| | | |
| | | /** |
| | | * Compares two ACLs (according to supported rights) |
| | | * |
| | | * @param array $acl1 ACL rights array (or string) |
| | | * @param array $acl2 ACL rights array (or string) |
| | | * |
| | | * @param int Comparision result, 2 - full match, 1 - partial match, 0 - no match |
| | | */ |
| | | function acl_compare($acl1, $acl2) |
| | | { |
| | | if (!is_array($acl1)) $acl1 = str_split($acl1); |
| | | if (!is_array($acl2)) $acl2 = str_split($acl2); |
| | | |
| | | $rights = $this->rights_supported(); |
| | | |
| | | $acl1 = array_intersect($acl1, $rights); |
| | | $acl2 = array_intersect($acl2, $rights); |
| | | $res = array_intersect($acl1, $acl2); |
| | | |
| | | $cnt1 = count($res); |
| | | $cnt2 = count($acl2); |
| | | |
| | | if ($cnt1 == $cnt2) |
| | | return 2; |
| | | else if ($cnt1) |
| | | return 1; |
| | | else |
| | | return 0; |
| | | } |
| | | |
| | | /** |
| | | * Get list of supported access rights (according to RIGHTS capability) |
| | | * |
| | | * @return array List of supported access rights abbreviations |
| | | */ |
| | | function rights_supported() |
| | | { |
| | | if ($this->supported !== null) { |
| | | return $this->supported; |
| | | } |
| | | |
| | | $capa = $this->rc->storage->get_capability('RIGHTS'); |
| | | |
| | | if (is_array($capa)) { |
| | | $rights = strtolower($capa[0]); |
| | | } |
| | | else { |
| | | $rights = 'cd'; |
| | | } |
| | | |
| | | return $this->supported = str_split('lrswi' . $rights . 'pa'); |
| | | } |
| | | |
| | | /** |
| | | * Username realm detection. |
| | | * |
| | | * @return string Username realm (domain) |
| | | */ |
| | | private function get_realm() |
| | | { |
| | | // When user enters a username without domain part, realm |
| | | // alows to add it to the username (and display correct username in the table) |
| | | |
| | | if (isset($_SESSION['acl_username_realm'])) { |
| | | return $_SESSION['acl_username_realm']; |
| | | } |
| | | |
| | | // find realm in username of logged user (?) |
| | | list($name, $domain) = explode('@', $_SESSION['username']); |
| | | |
| | | // Use (always existent) ACL entry on the INBOX for the user to determine |
| | | // whether or not the user ID in ACL entries need to be qualified and how |
| | | // they would need to be qualified. |
| | | if (empty($domain)) { |
| | | $acl = $this->rc->storage->get_acl('INBOX'); |
| | | if (is_array($acl)) { |
| | | $regexp = '/^' . preg_quote($_SESSION['username'], '/') . '@(.*)$/'; |
| | | foreach (array_keys($acl) as $name) { |
| | | if (preg_match($regexp, $name, $matches)) { |
| | | $domain = $matches[1]; |
| | | break; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | return $_SESSION['acl_username_realm'] = $domain; |
| | | } |
| | | |
| | | /** |
| | | * Initializes autocomplete LDAP backend |
| | | */ |
| | | private function init_ldap() |
| | | { |
| | | if ($this->ldap) |
| | | return $this->ldap->ready; |
| | | |
| | | // get LDAP config |
| | | $config = $this->rc->config->get('acl_users_source'); |
| | | |
| | | if (empty($config)) { |
| | | return false; |
| | | } |
| | | |
| | | // not an array, use configured ldap_public source |
| | | if (!is_array($config)) { |
| | | $ldap_config = (array) $this->rc->config->get('ldap_public'); |
| | | $config = $ldap_config[$config]; |
| | | } |
| | | |
| | | $uid_field = $this->rc->config->get('acl_users_field', 'mail'); |
| | | $filter = $this->rc->config->get('acl_users_filter'); |
| | | |
| | | if (empty($uid_field) || empty($config)) { |
| | | return false; |
| | | } |
| | | |
| | | // get name attribute |
| | | if (!empty($config['fieldmap'])) { |
| | | $name_field = $config['fieldmap']['name']; |
| | | } |
| | | // ... no fieldmap, use the old method |
| | | if (empty($name_field)) { |
| | | $name_field = $config['name_field']; |
| | | } |
| | | |
| | | // add UID field to fieldmap, so it will be returned in a record with name |
| | | $config['fieldmap'] = array( |
| | | 'name' => $name_field, |
| | | 'uid' => $uid_field, |
| | | ); |
| | | |
| | | // search in UID and name fields |
| | | $config['search_fields'] = array_values($config['fieldmap']); |
| | | $config['required_fields'] = array($uid_field); |
| | | |
| | | // set search filter |
| | | if ($filter) |
| | | $config['filter'] = $filter; |
| | | |
| | | // disable vlv |
| | | $config['vlv'] = false; |
| | | |
| | | // Initialize LDAP connection |
| | | $this->ldap = new rcube_ldap($config, |
| | | $this->rc->config->get('ldap_debug'), |
| | | $this->rc->config->mail_domain($_SESSION['imap_host'])); |
| | | |
| | | return $this->ldap->ready; |
| | | } |
| | | } |
New file |
| | |
| | | <?php |
| | | |
| | | // Default look of access rights table |
| | | // In advanced mode all access rights are displayed separately |
| | | // In simple mode access rights are grouped into four groups: read, write, delete, full |
| | | $rcmail_config['acl_advanced_mode'] = false; |
| | | |
| | | // LDAP addressbook that would be searched for user names autocomplete. |
| | | // That should be an array refering to the $rcmail_config['ldap_public'] array key |
| | | // or complete addressbook configuration array. |
| | | $rcmail_config['acl_users_source'] = ''; |
| | | |
| | | // The LDAP attribute which will be used as ACL user identifier |
| | | $rcmail_config['acl_users_field'] = 'mail'; |
| | | |
| | | // The LDAP search filter will be &'d with search queries |
| | | $rcmail_config['acl_users_filter'] = ''; |
| | | |
| | | ?> |
New file |
| | |
| | | <?php |
| | | |
| | | $labels['sharing'] = 'Freigabe'; |
| | | $labels['myrights'] = 'Zugriffsrechte'; |
| | | $labels['username'] = 'Benutzer:'; |
| | | $labels['advanced'] = 'erweiterter Modus'; |
| | | $labels['newuser'] = 'Eintrag hinzufügen'; |
| | | $labels['actions'] = 'Zugriffsrechte Aktionen...'; |
| | | $labels['anyone'] = 'Alle Benutzer (anyone)'; |
| | | $labels['anonymous'] = 'Gäste (anonymous)'; |
| | | $labels['identifier'] = 'Bezeichnung'; |
| | | |
| | | $labels['acll'] = 'Ordner sichtbar'; |
| | | $labels['aclr'] = 'Nachrichten lesen'; |
| | | $labels['acls'] = 'Lesestatus ändern'; |
| | | $labels['aclw'] = 'Flags schreiben'; |
| | | $labels['acli'] = 'Nachrichten Hinzufügen'; |
| | | $labels['aclp'] = 'Nachrichten Senden an'; |
| | | $labels['aclc'] = 'Unterordner erstellen'; |
| | | $labels['aclk'] = 'Unterordner erstellen'; |
| | | $labels['acld'] = 'Nachrichten als gelöscht markieren'; |
| | | $labels['aclt'] = 'Nachrichten als gelöscht markieren'; |
| | | $labels['acle'] = 'Nachrichten endgültig Löschen'; |
| | | $labels['aclx'] = 'Ordner löschen'; |
| | | $labels['acla'] = 'Zugriffsrechte Verwalten'; |
| | | |
| | | $labels['aclfull'] = 'Vollzugriff'; |
| | | $labels['aclother'] = 'Andere'; |
| | | $labels['aclread'] = 'Lesen'; |
| | | $labels['aclwrite'] = 'Schreiben'; |
| | | $labels['acldelete'] = 'Löschen'; |
| | | |
| | | $labels['shortacll'] = 'Sichtbar'; |
| | | $labels['shortaclr'] = 'Lesen'; |
| | | $labels['shortacls'] = 'Lesestatus'; |
| | | $labels['shortaclw'] = 'Flags ändern'; |
| | | $labels['shortacli'] = 'Hinzufügen'; |
| | | $labels['shortaclp'] = 'Senden an'; |
| | | $labels['shortaclc'] = 'Erstellen'; |
| | | $labels['shortaclk'] = 'Erstellen'; |
| | | $labels['shortacld'] = 'Löschen'; |
| | | $labels['shortaclt'] = 'Löschen'; |
| | | $labels['shortacle'] = 'endgültig löschen'; |
| | | $labels['shortaclx'] = 'Ordner löschen'; |
| | | $labels['shortacla'] = 'Verwalten'; |
| | | |
| | | $labels['shortaclother'] = 'Andere'; |
| | | $labels['shortaclread'] = 'Lesen'; |
| | | $labels['shortaclwrite'] = 'Schreiben'; |
| | | $labels['shortacldelete'] = 'Löschen'; |
| | | |
| | | $labels['longacll'] = 'Der Ordner ist sichtbar und kann abonniert werden'; |
| | | $labels['longaclr'] = 'Nachrichten im Ordner können gelesen werden'; |
| | | $labels['longacls'] = 'Der Lesestatus von Nachrichten kann geändert werden'; |
| | | $labels['longaclw'] = 'Alle Nachrichten-Flags und Schlüsselwörter außer "Gelesen" und "Gelöscht" können geändert werden'; |
| | | $labels['longacli'] = 'Nachrichten können in diesen Ordner kopiert oder verschoben werden'; |
| | | $labels['longaclp'] = 'Nachrichten können an diesen Ordner gesendet werden'; |
| | | $labels['longaclc'] = 'Unterordner können in diesem Ordner erstellt oder umbenannt werden'; |
| | | $labels['longaclk'] = 'Unterordner können in diesem Ordner erstellt oder umbenannt werden'; |
| | | $labels['longacld'] = 'Der "gelöscht" Status von Nachrichten kann geändert werden'; |
| | | $labels['longaclt'] = 'Der "gelöscht" Status von Nachrichten kann geändert werden'; |
| | | $labels['longacle'] = 'Als "gelöscht" markiert Nachrichten können gelöscht werden.'; |
| | | $labels['longaclx'] = 'Der Ordner kann gelöscht oder umbenannt werden'; |
| | | $labels['longacla'] = 'Die Zugriffsrechte des Ordners können geändert werden'; |
| | | |
| | | $labels['longaclfull'] = 'Vollzugriff inklusive Ordner-Verwaltung'; |
| | | $labels['longaclread'] = 'Der Ordnerinhalt kann gelesen werden'; |
| | | $labels['longaclwrite'] = 'Nachrichten können markiert, an den Ordner gesendet und in den Ordner kopiert oder verschoben werden'; |
| | | $labels['longacldelete'] = 'Nachrichten können gelöscht werden'; |
| | | |
| | | $messages['deleting'] = 'Zugriffsrechte werden entzogen...'; |
| | | $messages['saving'] = 'Zugriffsrechte werden gewährt...'; |
| | | $messages['updatesuccess'] = 'Zugriffsrechte erfolgreich geändert'; |
| | | $messages['deletesuccess'] = 'Zugriffsrechte erfolgreich entzogen'; |
| | | $messages['createsuccess'] = 'Zugriffsrechte erfolgreich gewährt'; |
| | | $messages['updateerror'] = 'Zugriffsrechte konnten nicht geändert werden'; |
| | | $messages['deleteerror'] = 'Zugriffsrechte konnten nicht entzogen werden'; |
| | | $messages['createerror'] = 'Zugriffsrechte konnten nicht gewährt werden'; |
| | | $messages['deleteconfirm'] = 'Sind Sie sicher, daß Sie die Zugriffsrechte den ausgewählten Benutzern entziehen möchten?'; |
| | | $messages['norights'] = 'Es wurden keine Zugriffsrechte ausgewählt!'; |
| | | $messages['nouser'] = 'Es wurde kein Benutzer ausgewählt!'; |
| | | |
| | | ?> |
New file |
| | |
| | | <?php |
| | | |
| | | $labels['sharing'] = 'Sharing'; |
| | | $labels['myrights'] = 'Access Rights'; |
| | | $labels['username'] = 'User:'; |
| | | $labels['advanced'] = 'advanced mode'; |
| | | $labels['newuser'] = 'Add entry'; |
| | | $labels['actions'] = 'Access right actions...'; |
| | | $labels['anyone'] = 'All users (anyone)'; |
| | | $labels['anonymous'] = 'Guests (anonymous)'; |
| | | $labels['identifier'] = 'Identifier'; |
| | | |
| | | $labels['acll'] = 'Lookup'; |
| | | $labels['aclr'] = 'Read messages'; |
| | | $labels['acls'] = 'Keep Seen state'; |
| | | $labels['aclw'] = 'Write flags'; |
| | | $labels['acli'] = 'Insert (Copy into)'; |
| | | $labels['aclp'] = 'Post'; |
| | | $labels['aclc'] = 'Create subfolders'; |
| | | $labels['aclk'] = 'Create subfolders'; |
| | | $labels['acld'] = 'Delete messages'; |
| | | $labels['aclt'] = 'Delete messages'; |
| | | $labels['acle'] = 'Expunge'; |
| | | $labels['aclx'] = 'Delete folder'; |
| | | $labels['acla'] = 'Administer'; |
| | | |
| | | $labels['aclfull'] = 'Full control'; |
| | | $labels['aclother'] = 'Other'; |
| | | $labels['aclread'] = 'Read'; |
| | | $labels['aclwrite'] = 'Write'; |
| | | $labels['acldelete'] = 'Delete'; |
| | | |
| | | $labels['shortacll'] = 'Lookup'; |
| | | $labels['shortaclr'] = 'Read'; |
| | | $labels['shortacls'] = 'Keep'; |
| | | $labels['shortaclw'] = 'Write'; |
| | | $labels['shortacli'] = 'Insert'; |
| | | $labels['shortaclp'] = 'Post'; |
| | | $labels['shortaclc'] = 'Create'; |
| | | $labels['shortaclk'] = 'Create'; |
| | | $labels['shortacld'] = 'Delete'; |
| | | $labels['shortaclt'] = 'Delete'; |
| | | $labels['shortacle'] = 'Expunge'; |
| | | $labels['shortaclx'] = 'Folder delete'; |
| | | $labels['shortacla'] = 'Administer'; |
| | | |
| | | $labels['shortaclother'] = 'Other'; |
| | | $labels['shortaclread'] = 'Read'; |
| | | $labels['shortaclwrite'] = 'Write'; |
| | | $labels['shortacldelete'] = 'Delete'; |
| | | |
| | | $labels['longacll'] = 'The folder is visible on lists and can be subscribed to'; |
| | | $labels['longaclr'] = 'The folder can be opened for reading'; |
| | | $labels['longacls'] = 'Messages Seen flag can be changed'; |
| | | $labels['longaclw'] = 'Messages flags and keywords can be changed, except Seen and Deleted'; |
| | | $labels['longacli'] = 'Messages can be written or copied to the folder'; |
| | | $labels['longaclp'] = 'Messages can be posted to this folder'; |
| | | $labels['longaclc'] = 'Folders can be created (or renamed) directly under this folder'; |
| | | $labels['longaclk'] = 'Folders can be created (or renamed) directly under this folder'; |
| | | $labels['longacld'] = 'Messages Delete flag can be changed'; |
| | | $labels['longaclt'] = 'Messages Delete flag can be changed'; |
| | | $labels['longacle'] = 'Messages can be expunged'; |
| | | $labels['longaclx'] = 'The folder can be deleted or renamed'; |
| | | $labels['longacla'] = 'The folder access rights can be changed'; |
| | | |
| | | $labels['longaclfull'] = 'Full control including folder administration'; |
| | | $labels['longaclread'] = 'The folder can be opened for reading'; |
| | | $labels['longaclwrite'] = 'Messages can be marked, written or copied to the folder'; |
| | | $labels['longacldelete'] = 'Messages can be deleted'; |
| | | |
| | | $messages['deleting'] = 'Deleting access rights...'; |
| | | $messages['saving'] = 'Saving access rights...'; |
| | | $messages['updatesuccess'] = 'Successfully changed access rights'; |
| | | $messages['deletesuccess'] = 'Successfully deleted access rights'; |
| | | $messages['createsuccess'] = 'Successfully added access rights'; |
| | | $messages['updateerror'] = 'Ubable to update access rights'; |
| | | $messages['deleteerror'] = 'Unable to delete access rights'; |
| | | $messages['createerror'] = 'Unable to add access rights'; |
| | | $messages['deleteconfirm'] = 'Are you sure, you want to remove access rights of selected user(s)?'; |
| | | $messages['norights'] = 'No rights has been specified!'; |
| | | $messages['nouser'] = 'No username has been specified!'; |
| | | |
| | | ?> |
New file |
| | |
| | | <?php |
| | | |
| | | $labels['sharing'] = 'Udostępnianie'; |
| | | $labels['myrights'] = 'Prawa dostępu'; |
| | | $labels['username'] = 'Użytkownik:'; |
| | | $labels['advanced'] = 'tryb zaawansowany'; |
| | | $labels['newuser'] = 'Dodaj rekord'; |
| | | $labels['actions'] = 'Akcje na prawach...'; |
| | | $labels['anyone'] = 'Wszyscy (anyone)'; |
| | | $labels['anonymous'] = 'Goście (anonymous)'; |
| | | $labels['identifier'] = 'Identyfikator'; |
| | | |
| | | $labels['acll'] = 'Podgląd (Lookup)'; |
| | | $labels['aclr'] = 'Odczyt (Read)'; |
| | | $labels['acls'] = 'Zmiana stanu wiadomości (Keep)'; |
| | | $labels['aclw'] = 'Zmiana flag wiadomości (Write)'; |
| | | $labels['acli'] = 'Dodawanie/Kopiowanie do (Insert)'; |
| | | $labels['aclp'] = 'Wysyłanie (Post)'; |
| | | $labels['aclc'] = 'Tworzenie podfolderów (Create)'; |
| | | $labels['aclk'] = 'Tworzenie podfolderów (Create)'; |
| | | $labels['acld'] = 'Usuwanie wiadomości (Delete)'; |
| | | $labels['aclt'] = 'Usuwanie wiadomości (Delete)'; |
| | | $labels['acle'] = 'Porządkowanie folderu (Expunge)'; |
| | | $labels['aclx'] = 'Usuwanie folderu (Delete)'; |
| | | $labels['acla'] = 'Administracja (Administer)'; |
| | | |
| | | $labels['aclfull'] = 'Wszystkie'; |
| | | $labels['aclother'] = 'Inne'; |
| | | $labels['aclread'] = 'Odczyt'; |
| | | $labels['aclwrite'] = 'Zapis'; |
| | | $labels['acldelete'] = 'Usuwanie'; |
| | | |
| | | $labels['shortacll'] = 'Podgląd'; |
| | | $labels['shortaclr'] = 'Odczyt'; |
| | | $labels['shortacls'] = 'Zmiana'; |
| | | $labels['shortaclw'] = 'Zmiana flag'; |
| | | $labels['shortacli'] = 'Dodawanie'; |
| | | $labels['shortaclp'] = 'Wysyłanie'; |
| | | $labels['shortaclc'] = 'Tworzenie'; |
| | | $labels['shortaclk'] = 'Tworzenie'; |
| | | $labels['shortacld'] = 'Usuwanie'; |
| | | $labels['shortaclt'] = 'Usuwanie'; |
| | | $labels['shortacle'] = 'Porządkowanie'; |
| | | $labels['shortaclx'] = 'Usuwanie folderu'; |
| | | $labels['shortacla'] = 'Administracja'; |
| | | |
| | | $labels['shortaclother'] = 'Pozostałe'; |
| | | $labels['shortaclread'] = 'Odczyt'; |
| | | $labels['shortaclwrite'] = 'Zapis'; |
| | | $labels['shortacldelete'] = 'Usuwanie'; |
| | | |
| | | $labels['longacll'] = 'Pozwala na subskrybowanie folderu i powoduje, że jest on widoczny na liście'; |
| | | $labels['longaclr'] = 'Pozwala na otwarcie folderu w trybie do odczytu'; |
| | | $labels['longacls'] = 'Pozwala na zmienę stanu wiadomości'; |
| | | $labels['longaclw'] = 'Pozwala zmieniać wszystkie flagi wiadomości, oprócz "Przeczytano" i "Usunięto"'; |
| | | $labels['longacli'] = 'Pozwala zapisywać wiadomości i kopiować do folderu'; |
| | | $labels['longaclp'] = 'Pozwala wysyłać wiadomości do folderu'; |
| | | $labels['longaclc'] = 'Pozwala tworzyć (lub zmieniać nazwę) podfoldery'; |
| | | $labels['longaclk'] = 'Pozwala tworzyć (lub zmieniać nazwę) podfoldery'; |
| | | $labels['longacld'] = 'Pozwala zmianiać flagę "Usunięto" wiadomości'; |
| | | $labels['longaclt'] = 'Pozwala zmianiać flagę "Usunięto" wiadomości'; |
| | | $labels['longacle'] = 'Pozwala na usuwanie wiadomości oznaczonych do usunięcia'; |
| | | $labels['longaclx'] = 'Pozwala na zmianę nazwy lub usunięcie folderu'; |
| | | $labels['longacla'] = 'Pozwala na zmiane praw dostępu do folderu'; |
| | | |
| | | $labels['longaclfull'] = 'Pełna kontrola włącznie z administrowaniem folderem'; |
| | | $labels['longaclread'] = 'Folder może być otwarty w trybie do odczytu'; |
| | | $labels['longaclwrite'] = 'Wiadomości mogą być oznaczane, zapisywane i kopiowane do folderu'; |
| | | $labels['longacldelete'] = 'Wiadomości mogą być usuwane'; |
| | | |
| | | $messages['deleting'] = 'Usuwanie praw dostępu...'; |
| | | $messages['saving'] = 'Zapisywanie praw dostępu...'; |
| | | $messages['updatesuccess'] = 'Pomyślnie zmieniono prawa dostępu'; |
| | | $messages['deletesuccess'] = 'Pomyślnie usunięto prawa dostępu'; |
| | | $messages['createsuccess'] = 'Pomyślnie dodano prawa dostępu'; |
| | | $messages['updateerror'] = 'Nie udało się zmienić praw dostępu'; |
| | | $messages['deleteerror'] = 'Nie udało się usunąć praw dostępu'; |
| | | $messages['createerror'] = 'Nie udało się dodać praw dostępu'; |
| | | $messages['deleteconfirm'] = 'Czy na pewno chcesz usunąć prawa wybranym użytkownikom?'; |
| | | $messages['norights'] = 'Nie wybrano praw dostępu!'; |
| | | $messages['nouser'] = 'Nie podano nazwy użytkownika!'; |
| | | |
| | | ?> |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <package xmlns="http://pear.php.net/dtd/package-2.0" xmlns:tasks="http://pear.php.net/dtd/tasks-1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" packagerversion="1.9.0" version="2.0" xsi:schemaLocation="http://pear.php.net/dtd/tasks-1.0 |
| | | http://pear.php.net/dtd/tasks-1.0.xsd |
| | | http://pear.php.net/dtd/package-2.0 |
| | | http://pear.php.net/dtd/package-2.0.xsd"> |
| | | <name>acl</name> |
| | | <channel>pear.roundcube.net</channel> |
| | | <summary>Folders Access Control Lists</summary> |
| | | <description>IMAP Folders Access Control Lists Management (RFC4314, RFC2086).</description> |
| | | <lead> |
| | | <name>Aleksander Machniak</name> |
| | | <user>alec</user> |
| | | <email>alec@alec.pl</email> |
| | | <active>yes</active> |
| | | </lead> |
| | | <date>2012-03-13</date> |
| | | <version> |
| | | <release>0.8</release> |
| | | <api>0.7</api> |
| | | </version> |
| | | <stability> |
| | | <release>stable</release> |
| | | <api>stable</api> |
| | | </stability> |
| | | <license uri="http://www.gnu.org/licenses/gpl-2.0.html">GNU GPLv2</license> |
| | | <notes>-</notes> |
| | | <contents> |
| | | <dir baseinstalldir="/" name="/"> |
| | | <file name="acl.php" role="php"> |
| | | <tasks:replace from="@name@" to="name" type="package-info"/> |
| | | <tasks:replace from="@package_version@" to="version" type="package-info"/> |
| | | </file> |
| | | <file name="acl.js" role="data"> |
| | | <tasks:replace from="@name@" to="name" type="package-info"/> |
| | | <tasks:replace from="@package_version@" to="version" type="package-info"/> |
| | | </file> |
| | | <file name="config.inc.php.dist" role="data"></file> |
| | | <file name="localization/de_DE.inc" role="data"></file> |
| | | <file name="localization/en_US.inc" role="data"></file> |
| | | <file name="localization/pl_PL.inc" role="data"></file> |
| | | <file name="skins/default/acl.css" role="data"></file> |
| | | <file name="skins/default/images/enabled.png" role="data"></file> |
| | | <file name="skins/default/images/partial.png" role="data"></file> |
| | | <file name="skins/default/templates/table.html" role="data"></file> |
| | | <file name="skins/larry/acl.css" role="data"></file> |
| | | <file name="skins/larry/images/enabled.png" role="data"></file> |
| | | <file name="skins/larry/images/partial.png" role="data"></file> |
| | | <file name="skins/larry/templates/table.html" role="data"></file> |
| | | </dir> |
| | | <!-- / --> |
| | | </contents> |
| | | <dependencies> |
| | | <required> |
| | | <php> |
| | | <min>5.2.1</min> |
| | | </php> |
| | | <pearinstaller> |
| | | <min>1.7.0</min> |
| | | </pearinstaller> |
| | | </required> |
| | | </dependencies> |
| | | <phprelease/> |
| | | </package> |
New file |
| | |
| | | #aclmanager |
| | | { |
| | | position: relative; |
| | | border: 1px solid #999; |
| | | min-height: 302px; |
| | | } |
| | | |
| | | #aclcontainer |
| | | { |
| | | overflow-x: auto; |
| | | } |
| | | |
| | | #acltable |
| | | { |
| | | width: 100%; |
| | | border-collapse: collapse; |
| | | background-color: #F9F9F9; |
| | | } |
| | | |
| | | #acltable td |
| | | { |
| | | width: 1%; |
| | | white-space: nowrap; |
| | | } |
| | | |
| | | #acltable thead td |
| | | { |
| | | padding: 0 4px 0 2px; |
| | | } |
| | | |
| | | #acltable tbody td |
| | | { |
| | | text-align: center; |
| | | padding: 2px; |
| | | border-bottom: 1px solid #999999; |
| | | cursor: default; |
| | | } |
| | | |
| | | #acltable tbody td.user |
| | | { |
| | | width: 96%; |
| | | text-align: left; |
| | | overflow: hidden; |
| | | text-overflow: ellipsis; |
| | | -o-text-overflow: ellipsis; |
| | | } |
| | | |
| | | #acltable tbody td.partial |
| | | { |
| | | background: url(images/partial.png) center no-repeat; |
| | | } |
| | | |
| | | #acltable tbody td.enabled |
| | | { |
| | | background: url(images/enabled.png) center no-repeat; |
| | | } |
| | | |
| | | #acltable tr.selected td |
| | | { |
| | | color: #FFFFFF; |
| | | background-color: #CC3333; |
| | | } |
| | | |
| | | #acltable tr.unfocused td |
| | | { |
| | | color: #FFFFFF; |
| | | background-color: #929292; |
| | | } |
| | | |
| | | #acladvswitch |
| | | { |
| | | position: absolute; |
| | | right: 4px; |
| | | text-align: right; |
| | | line-height: 22px; |
| | | } |
| | | |
| | | #acladvswitch input |
| | | { |
| | | vertical-align: middle; |
| | | } |
| | | |
| | | #acladvswitch span |
| | | { |
| | | display: block; |
| | | } |
| | | |
| | | #aclform |
| | | { |
| | | top: 80px; |
| | | width: 480px; |
| | | padding: 10px; |
| | | } |
| | | |
| | | #aclform div |
| | | { |
| | | padding: 0; |
| | | text-align: center; |
| | | clear: both; |
| | | } |
New file |
| | |
| | | <!--[if lte IE 6]> |
| | | <style type="text/css"> |
| | | #aclmanager { height: expression(Math.min(302, parseInt(document.documentElement.clientHeight))+'px'); } |
| | | </style> |
| | | <![endif]--> |
| | | |
| | | <div id="aclmanager"> |
| | | <div id="aclcontainer" class="boxlistcontent" style="top:0"> |
| | | <roundcube:object name="acltable" id="acltable" class="records-table" /> |
| | | </div> |
| | | <div class="boxfooter"> |
| | | <roundcube:button command="acl-create" id="aclcreatelink" type="link" title="acl.newuser" class="buttonPas addgroup" classAct="button addgroup" content=" " /> |
| | | <roundcube:button name="aclmenulink" id="aclmenulink" type="link" title="acl.actions" class="button groupactions" onclick="show_aclmenu(); return false" content=" " /> |
| | | <roundcube:if condition="!in_array('acl_advanced_mode', (array)config:dont_override)" /> |
| | | <div id="acladvswitch" class="pagenav"> |
| | | <span><label for="acl-switch"><roundcube:label name="acl.advanced" /></label> |
| | | <input type="checkbox" id="acl-switch" onclick="rcmail.command('acl-mode-switch')"<roundcube:exp expression="config:acl_advanced_mode == true ? ' checked=checked' : ''" /> /> |
| | | </span> |
| | | </div> |
| | | <roundcube:endif /> |
| | | </div> |
| | | </div> |
| | | |
| | | <div id="aclmenu" class="popupmenu"> |
| | | <ul> |
| | | <li><roundcube:button command="acl-edit" label="edit" classAct="active" /></li> |
| | | <li><roundcube:button command="acl-delete" label="delete" classAct="active" /></li> |
| | | </ul> |
| | | </div> |
| | | |
| | | <div id="aclform" class="popupmenu"> |
| | | <fieldset class="thinbordered"><legend><roundcube:label name="acl.identifier" /></legend> |
| | | <roundcube:object name="acluser" class="toolbarmenu" id="acluser" size="35" /> |
| | | </fieldset> |
| | | <fieldset class="thinbordered"><legend><roundcube:label name="acl.myrights" /></legend> |
| | | <roundcube:object name="aclrights" class="toolbarmenu" /> |
| | | </fieldset> |
| | | <div> |
| | | <roundcube:button command="acl-cancel" type="input" class="button" label="cancel" /> |
| | | <roundcube:button command="acl-save" type="input" class="button mainaction" label="save" /> |
| | | </div> |
| | | </div> |
| | | |
| | | <script type="text/javascript"> |
| | | function show_aclmenu() |
| | | { |
| | | if (!rcmail_ui) { |
| | | rcube_init_mail_ui(); |
| | | rcmail_ui.popups.aclmenu = {id:'aclmenu', above:1, obj: $('#aclmenu')}; |
| | | } |
| | | |
| | | rcmail_ui.show_popup('aclmenu'); |
| | | } |
| | | </script> |
New file |
| | |
| | | #aclcontainer |
| | | { |
| | | overflow-x: auto; |
| | | border: 1px solid #CCDDE4; |
| | | background-color: #D9ECF4; |
| | | height: 272px; |
| | | box-shadow: none; |
| | | } |
| | | |
| | | #acllist-content |
| | | { |
| | | position: relative; |
| | | height: 230px; |
| | | background-color: white; |
| | | } |
| | | |
| | | #acllist-footer |
| | | { |
| | | position: relative; |
| | | } |
| | | |
| | | #acltable |
| | | { |
| | | width: 100%; |
| | | border-collapse: collapse; |
| | | border: none; |
| | | } |
| | | |
| | | #acltable td |
| | | { |
| | | white-space: nowrap; |
| | | border: none; |
| | | text-align: center; |
| | | } |
| | | |
| | | #acltable thead tr td |
| | | { |
| | | border-left: #BBD3DA dotted 1px; |
| | | font-size: 11px; |
| | | font-weight: bold; |
| | | } |
| | | |
| | | #acltable tbody td |
| | | { |
| | | border-bottom: #DDDDDD 1px solid; |
| | | text-align: center; |
| | | padding: 2px; |
| | | cursor: default; |
| | | } |
| | | |
| | | #acltable thead td.user |
| | | { |
| | | border-left: none; |
| | | } |
| | | |
| | | #acltable tbody td.user |
| | | { |
| | | text-align: left; |
| | | overflow: hidden; |
| | | text-overflow: ellipsis; |
| | | -o-text-overflow: ellipsis; |
| | | border-left: none; |
| | | width: 50px; |
| | | } |
| | | |
| | | #acltable tbody td.partial |
| | | { |
| | | background-image: url(images/partial.png); |
| | | background-position: center; |
| | | background-repeat: no-repeat; |
| | | } |
| | | |
| | | #acltable tbody td.enabled |
| | | { |
| | | background-image: url(images/enabled.png); |
| | | background-position: center; |
| | | background-repeat: no-repeat; |
| | | } |
| | | |
| | | #acltable tbody tr.selected td.partial |
| | | { |
| | | background-color: #019bc6; |
| | | background-image: url(images/partial.png), -moz-linear-gradient(top, #019bc6 0%, #017cb4 100%); |
| | | background-image: url(images/partial.png), -webkit-gradient(linear, left top, left bottom, color-stop(0%,#019bc6), color-stop(100%,#017cb4)); |
| | | background-image: url(images/partial.png), -o-linear-gradient(top, #019bc6 0%, #017cb4 100%); |
| | | background-image: url(images/partial.png), -ms-linear-gradient(top, #019bc6 0%, #017cb4 100%); |
| | | background-image: url(images/partial.png), linear-gradient(top, #019bc6 0%, #017cb4 100%); |
| | | } |
| | | |
| | | #acltable tbody tr.selected td.enabled |
| | | { |
| | | background-color: #019bc6; |
| | | background-image: url(images/enabled.png), -moz-linear-gradient(top, #019bc6 0%, #017cb4 100%); |
| | | background-image: url(images/enabled.png), -webkit-gradient(linear, left top, left bottom, color-stop(0%,#019bc6), color-stop(100%,#017cb4)); |
| | | background-image: url(images/enabled.png), -o-linear-gradient(top, #019bc6 0%, #017cb4 100%); |
| | | background-image: url(images/enabled.png), -ms-linear-gradient(top, #019bc6 0%, #017cb4 100%); |
| | | background-image: url(images/enabled.png), linear-gradient(top, #019bc6 0%, #017cb4 100%); |
| | | } |
| | | |
| | | #aclform |
| | | { |
| | | top: 80px; |
| | | width: 480px; |
| | | padding: 10px; |
| | | background-color: white; |
| | | } |
| | | |
| | | #aclform div |
| | | { |
| | | padding: 0; |
| | | text-align: center; |
| | | clear: both; |
| | | } |
New file |
| | |
| | | <div id="aclcontainer" class="uibox listbox"> |
| | | <div id="acllist-content" class="scroller withfooter"> |
| | | <roundcube:object name="acltable" id="acltable" class="records-table" /> |
| | | </div> |
| | | <div id="acllist-footer" class="boxfooter"> |
| | | <roundcube:button command="acl-create" id="aclcreatelink" type="link" title="acl.newuser" class="listbutton add disabled" classAct="listbutton add" innerClass="inner" content="+" /><roundcube:button name="aclmenulink" id="aclmenulink" type="link" title="acl.actions" class="listbutton groupactions"onclick="UI.show_popup('aclmenu');return false" innerClass="inner" content="⚙" /> |
| | | <roundcube:if condition="!in_array('acl_advanced_mode', (array)config:dont_override)" /> |
| | | <span class="countdisplay" style="display: inline"> |
| | | <label for="acl-switch"><roundcube:label name="acl.advanced" /></label> |
| | | <input type="checkbox" id="acl-switch" onclick="rcmail.command('acl-mode-switch')"<roundcube:exp expression="config:acl_advanced_mode == true ? ' checked=checked' : ''" /> /> |
| | | </span> |
| | | <roundcube:endif /> |
| | | </div> |
| | | </div> |
| | | |
| | | <div id="aclmenu" class="popupmenu"> |
| | | <ul class="toolbarmenu"> |
| | | <li><roundcube:button command="acl-edit" label="edit" classAct="active" /></li> |
| | | <li><roundcube:button command="acl-delete" label="delete" classAct="active" /></li> |
| | | </ul> |
| | | </div> |
| | | |
| | | <div id="aclform" class="popupmenu propform"> |
| | | <fieldset class="thinbordered"><legend><roundcube:label name="acl.identifier" /></legend> |
| | | <roundcube:object name="acluser" id="acluser" size="35" /> |
| | | </fieldset> |
| | | <fieldset class="thinbordered"><legend><roundcube:label name="acl.myrights" /></legend> |
| | | <roundcube:object name="aclrights" /> |
| | | </fieldset> |
| | | <div class="formbuttons"> |
| | | <roundcube:button command="acl-cancel" type="input" class="button" label="cancel" /> |
| | | <roundcube:button command="acl-save" type="input" class="button mainaction" label="save" /> |
| | | </div> |
| | | </div> |
New file |
| | |
| | | <?php |
| | | |
| | | /** |
| | | * Additional Message Headers |
| | | * |
| | | * Very simple plugin which will add additional headers |
| | | * to or remove them from outgoing messages. |
| | | * |
| | | * Enable the plugin in config/main.inc.php and add your desired headers: |
| | | * $rcmail_config['additional_message_headers'] = array('User-Agent'); |
| | | * |
| | | * @version @package_version@ |
| | | * @author Ziba Scott |
| | | * @website http://roundcube.net |
| | | */ |
| | | class additional_message_headers extends rcube_plugin |
| | | { |
| | | public $task = 'mail'; |
| | | |
| | | function init() |
| | | { |
| | | $this->add_hook('message_outgoing_headers', array($this, 'message_headers')); |
| | | } |
| | | |
| | | function message_headers($args) |
| | | { |
| | | $this->load_config(); |
| | | |
| | | // additional email headers |
| | | $additional_headers = rcmail::get_instance()->config->get('additional_message_headers',array()); |
| | | foreach($additional_headers as $header=>$value){ |
| | | if (null === $value) { |
| | | unset($args['headers'][$header]); |
| | | } else { |
| | | $args['headers'][$header] = $value; |
| | | } |
| | | } |
| | | |
| | | return $args; |
| | | } |
| | | } |
| | | |
| | | ?> |
New file |
| | |
| | | <?php |
| | | |
| | | // $rcmail_config['additional_message_headers']['X-Remote-Browser'] = $_SERVER['HTTP_USER_AGENT']; |
| | | // $rcmail_config['additional_message_headers']['X-Originating-IP'] = $_SERVER['REMOTE_ADDR']; |
| | | // $rcmail_config['additional_message_headers']['X-RoundCube-Server'] = $_SERVER['SERVER_ADDR']; |
| | | |
| | | // if( isset( $_SERVER['MACHINE_NAME'] )) { |
| | | // $rcmail_config['additional_message_headers']['X-RoundCube-Server'] .= ' (' . $_SERVER['MACHINE_NAME'] . ')'; |
| | | // } |
| | | |
| | | // To remove (e.g. X-Sender) message header use null value |
| | | // $rcmail_config['additional_message_headers']['X-Sender'] = null; |
| | | |
| | | ?> |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <package packagerversion="1.9.0" version="2.0" xmlns="http://pear.php.net/dtd/package-2.0" xmlns:tasks="http://pear.php.net/dtd/tasks-1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://pear.php.net/dtd/tasks-1.0 |
| | | http://pear.php.net/dtd/tasks-1.0.xsd |
| | | http://pear.php.net/dtd/package-2.0 |
| | | http://pear.php.net/dtd/package-2.0.xsd"> |
| | | <name>additional_message_headers</name> |
| | | <channel>pear.roundcube.net</channel> |
| | | <summary>Additional message headers for Roundcube</summary> |
| | | <description>Very simple plugin which will add additional headers to or remove them from outgoing messages.</description> |
| | | <lead> |
| | | <name>Ziba Scott</name> |
| | | <user>ziba</user> |
| | | <email>email@example.org</email> |
| | | <active>yes</active> |
| | | </lead> |
| | | <date>2010-01-16</date> |
| | | <time>18:19:33</time> |
| | | <version> |
| | | <release>1.1.0</release> |
| | | <api>1.1.0</api> |
| | | </version> |
| | | <stability> |
| | | <release>stable</release> |
| | | <api>stable</api> |
| | | </stability> |
| | | <license uri="http://www.gnu.org/licenses/gpl-2.0.html">GNU GPL v2</license> |
| | | <notes>-</notes> |
| | | <contents> |
| | | <dir baseinstalldir="/" name="/"> |
| | | <file name="additional_message_headers.php" role="php"> |
| | | <tasks:replace from="@name@" to="name" type="package-info" /> |
| | | <tasks:replace from="@package_version@" to="version" type="package-info" /> |
| | | </file> |
| | | <file name="config.inc.php.dist" role="data"></file> |
| | | </dir> <!-- / --> |
| | | </contents> |
| | | <dependencies> |
| | | <required> |
| | | <php> |
| | | <min>5.2.1</min> |
| | | </php> |
| | | <pearinstaller> |
| | | <min>1.7.0</min> |
| | | </pearinstaller> |
| | | </required> |
| | | </dependencies> |
| | | <phprelease /> |
| | | </package> |
New file |
| | |
| | | /* |
| | | * Archive plugin script |
| | | * @version @package_version@ |
| | | */ |
| | | |
| | | function rcmail_archive(prop) |
| | | { |
| | | if (!rcmail.env.uid && (!rcmail.message_list || !rcmail.message_list.get_selection().length)) |
| | | return; |
| | | |
| | | if (rcmail.env.mailbox != rcmail.env.archive_folder) |
| | | rcmail.command('moveto', rcmail.env.archive_folder); |
| | | } |
| | | |
| | | // callback for app-onload event |
| | | if (window.rcmail) { |
| | | rcmail.addEventListener('init', function(evt) { |
| | | |
| | | // register command (directly enable in message view mode) |
| | | rcmail.register_command('plugin.archive', rcmail_archive, (rcmail.env.uid && rcmail.env.mailbox != rcmail.env.archive_folder)); |
| | | |
| | | // add event-listener to message list |
| | | if (rcmail.message_list) |
| | | rcmail.message_list.addEventListener('select', function(list){ |
| | | rcmail.enable_command('plugin.archive', (list.get_selection().length > 0 && rcmail.env.mailbox != rcmail.env.archive_folder)); |
| | | }); |
| | | |
| | | // set css style for archive folder |
| | | var li; |
| | | if (rcmail.env.archive_folder && (li = rcmail.get_folder_li(rcmail.env.archive_folder, '', true))) |
| | | $(li).addClass('archive'); |
| | | }) |
| | | } |
| | | |
New file |
| | |
| | | <?php |
| | | |
| | | /** |
| | | * Archive |
| | | * |
| | | * Plugin that adds a new button to the mailbox toolbar |
| | | * to move messages to a (user selectable) archive folder. |
| | | * |
| | | * @version @package_version@ |
| | | * @license GNU GPLv3+ |
| | | * @author Andre Rodier, Thomas Bruederli |
| | | */ |
| | | class archive extends rcube_plugin |
| | | { |
| | | public $task = 'mail|settings'; |
| | | |
| | | function init() |
| | | { |
| | | $rcmail = rcmail::get_instance(); |
| | | |
| | | // There is no "Archived flags" |
| | | // $GLOBALS['IMAP_FLAGS']['ARCHIVED'] = 'Archive'; |
| | | if ($rcmail->task == 'mail' && ($rcmail->action == '' || $rcmail->action == 'show') |
| | | && ($archive_folder = $rcmail->config->get('archive_mbox'))) { |
| | | $skin_path = $this->local_skin_path(); |
| | | if (is_file($this->home . "/$skin_path/archive.css")) |
| | | $this->include_stylesheet("$skin_path/archive.css"); |
| | | |
| | | $this->include_script('archive.js'); |
| | | $this->add_texts('localization', true); |
| | | $this->add_button( |
| | | array( |
| | | 'type' => 'link', |
| | | 'label' => 'buttontext', |
| | | 'command' => 'plugin.archive', |
| | | 'class' => 'button buttonPas archive disabled', |
| | | 'classact' => 'button archive', |
| | | 'width' => 32, |
| | | 'height' => 32, |
| | | 'title' => 'buttontitle', |
| | | 'domain' => $this->ID, |
| | | ), |
| | | 'toolbar'); |
| | | |
| | | // register hook to localize the archive folder |
| | | $this->add_hook('render_mailboxlist', array($this, 'render_mailboxlist')); |
| | | |
| | | // set env variable for client |
| | | $rcmail->output->set_env('archive_folder', $archive_folder); |
| | | |
| | | // add archive folder to the list of default mailboxes |
| | | if (($default_folders = $rcmail->config->get('default_folders')) && !in_array($archive_folder, $default_folders)) { |
| | | $default_folders[] = $archive_folder; |
| | | $rcmail->config->set('default_folders', $default_folders); |
| | | } |
| | | } |
| | | else if ($rcmail->task == 'settings') { |
| | | $dont_override = $rcmail->config->get('dont_override', array()); |
| | | if (!in_array('archive_mbox', $dont_override)) { |
| | | $this->add_hook('preferences_list', array($this, 'prefs_table')); |
| | | $this->add_hook('preferences_save', array($this, 'save_prefs')); |
| | | } |
| | | } |
| | | } |
| | | |
| | | function render_mailboxlist($p) |
| | | { |
| | | $rcmail = rcmail::get_instance(); |
| | | $archive_folder = $rcmail->config->get('archive_mbox'); |
| | | |
| | | // set localized name for the configured archive folder |
| | | if ($archive_folder) { |
| | | if (isset($p['list'][$archive_folder])) |
| | | $p['list'][$archive_folder]['name'] = $this->gettext('archivefolder'); |
| | | else // search in subfolders |
| | | $this->_mod_folder_name($p['list'], $archive_folder, $this->gettext('archivefolder')); |
| | | } |
| | | |
| | | return $p; |
| | | } |
| | | |
| | | function _mod_folder_name(&$list, $folder, $new_name) |
| | | { |
| | | foreach ($list as $idx => $item) { |
| | | if ($item['id'] == $folder) { |
| | | $list[$idx]['name'] = $new_name; |
| | | return true; |
| | | } else if (!empty($item['folders'])) |
| | | if ($this->_mod_folder_name($list[$idx]['folders'], $folder, $new_name)) |
| | | return true; |
| | | } |
| | | return false; |
| | | } |
| | | |
| | | function prefs_table($args) |
| | | { |
| | | global $CURR_SECTION; |
| | | |
| | | if ($args['section'] == 'folders') { |
| | | $this->add_texts('localization'); |
| | | |
| | | $rcmail = rcmail::get_instance(); |
| | | |
| | | // load folders list when needed |
| | | if ($CURR_SECTION) |
| | | $select = rcmail_mailbox_select(array('noselection' => '---', 'realnames' => true, |
| | | 'maxlength' => 30, 'exceptions' => array('INBOX'), 'folder_filter' => 'mail', 'folder_rights' => 'w')); |
| | | else |
| | | $select = new html_select(); |
| | | |
| | | $args['blocks']['main']['options']['archive_mbox'] = array( |
| | | 'title' => $this->gettext('archivefolder'), |
| | | 'content' => $select->show($rcmail->config->get('archive_mbox'), array('name' => "_archive_mbox")) |
| | | ); |
| | | } |
| | | |
| | | return $args; |
| | | } |
| | | |
| | | function save_prefs($args) |
| | | { |
| | | if ($args['section'] == 'folders') { |
| | | $args['prefs']['archive_mbox'] = get_input_value('_archive_mbox', RCUBE_INPUT_POST); |
| | | return $args; |
| | | } |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | <?php |
| | | |
| | | /* |
| | | |
| | | +-----------------------------------------------------------------------+ |
| | | | language/cs_CZ/labels.inc | |
| | | | | |
| | | | Language file of the Roundcube archive plugin | |
| | | | Copyright (C) 2005-2009, The Roundcube Dev Team | |
| | | | Licensed under the GNU GPL | |
| | | | | |
| | | +-----------------------------------------------------------------------+ |
| | | | Author: Milan Kozak <hodza@hodza.net> | |
| | | +-----------------------------------------------------------------------+ |
| | | |
| | | @version $Id: labels.inc 2993 2009-09-26 18:32:07Z alec $ |
| | | |
| | | */ |
| | | |
| | | $labels = array(); |
| | | $labels['buttontitle'] = 'Archivovat zprávu'; |
| | | $labels['archived'] = 'Úspěšně vloženo do archivu'; |
| | | $labels['archivefolder'] = 'Archiv'; |
| | | |
| | | ?> |
New file |
| | |
| | | <?php |
| | | |
| | | $labels = array(); |
| | | $labels['buttontitle'] = 'Nachricht archivieren'; |
| | | $labels['archived'] = 'Nachricht erfolgreich archiviert'; |
| | | $labels['archivefolder'] = 'Archiv'; |
| | | |
| | | ?> |
New file |
| | |
| | | <?php |
| | | |
| | | $labels = array(); |
| | | $labels['buttontitle'] = 'Nachricht archivieren'; |
| | | $labels['archived'] = 'Nachricht erfolgreich archiviert'; |
| | | $labels['archivefolder'] = 'Archiv'; |
| | | |
| | | ?> |
New file |
| | |
| | | <?php |
| | | |
| | | $labels = array(); |
| | | $labels['buttontext'] = 'Archive'; |
| | | $labels['buttontitle'] = 'Archive this message'; |
| | | $labels['archived'] = 'Successfully archived'; |
| | | $labels['archivefolder'] = 'Archive'; |
| | | |
| | | ?> |
New file |
| | |
| | | <?php |
| | | |
| | | // MPBAUPGRADE |
| | | |
| | | $labels = array(); |
| | | $labels['buttontitle'] = 'Archivar este mensaje'; |
| | | $labels['archived'] = 'Mensaje Archivado'; |
| | | $labels['archivefolder'] = 'Archivo'; |
| | | |
| | | ?> |
New file |
| | |
| | | <?php |
| | | |
| | | // MPBAUPGRADE |
| | | |
| | | $labels = array(); |
| | | $labels['buttontitle'] = 'Archivar este mensaje'; |
| | | $labels['archived'] = 'Mensaje Archivado'; |
| | | $labels['archivefolder'] = 'Archivo'; |
| | | |
| | | ?> |
New file |
| | |
| | | <?php |
| | | |
| | | $labels = array(); |
| | | $labels['buttontitle'] = 'Arhiveeri see kiri'; |
| | | $labels['archived'] = 'Edukalt arhiveeritud'; |
| | | $labels['archivefolder'] = 'Arhiveeri'; |
| | | |
| | | ?> |
New file |
| | |
| | | <?php |
| | | |
| | | $labels = array(); |
| | | $labels['buttontitle'] = 'Archiver ce message'; |
| | | $labels['archived'] = 'Message archivé avec success'; |
| | | $labels['archivefolder'] = 'Archive'; |
| | | |
| | | ?> |
New file |
| | |
| | | <?php |
| | | |
| | | // MPBAUPGRADE |
| | | |
| | | $labels = array(); |
| | | $labels['buttontitle'] = 'Arquivar esta mensaxe'; |
| | | $labels['archived'] = 'Aquivouse a mensaxe'; |
| | | $labels['archivefolder'] = 'Arquivo'; |
| | | |
| | | ?> |
New file |
| | |
| | | <?php |
| | | |
| | | /* |
| | | +-----------------------------------------------------------------------+ |
| | | | localization/ja_JP/labels.inc | |
| | | | | |
| | | | Language file of the Roundcube Webmail client | |
| | | | Copyright (C) 2012, The Roundcube Dev Team | |
| | | | Licensed under the GNU General Public License | |
| | | | | |
| | | +-----------------------------------------------------------------------+ |
| | | | Author: Takahiro Kambe <Unknown> | |
| | | +-----------------------------------------------------------------------+ |
| | | @version $Id$ |
| | | */ |
| | | |
| | | $labels = array(); |
| | | $labels['buttontitle'] = 'このメッセージをアーカイブ'; |
| | | $labels['archived'] = 'アーカイブしました。'; |
| | | $labels['archivefolder'] = 'アーカイブ'; |
| | | |
New file |
| | |
| | | <?php |
| | | |
| | | $labels = array(); |
| | | $labels['buttontitle'] = 'Archiveer dit bericht'; |
| | | $labels['archived'] = 'Succesvol gearchiveerd'; |
| | | $labels['archivefolder'] = 'Archief'; |
| | | |
| | | ?> |
New file |
| | |
| | | <?php |
| | | |
| | | /* |
| | | +-----------------------------------------------------------------------+ |
| | | | localization/pl_PL/labels.inc | |
| | | | | |
| | | | Language file of the Roundcube Webmail client | |
| | | | Copyright (C) 2012, The Roundcube Dev Team | |
| | | | Licensed under the GNU General Public License | |
| | | | | |
| | | +-----------------------------------------------------------------------+ |
| | | | Author: Thomas <Unknown> | |
| | | +-----------------------------------------------------------------------+ |
| | | @version $Id$ |
| | | */ |
| | | |
| | | $labels = array(); |
| | | $labels['buttontitle'] = 'Przenieś do archiwum'; |
| | | $labels['archived'] = 'Pomyślnie zarchiwizowano'; |
| | | $labels['archivefolder'] = 'Archiwum'; |
| | | |
New file |
| | |
| | | <?php |
| | | |
| | | $labels = array(); |
| | | $labels['buttontitle'] = 'Arquivar esta mensagem'; |
| | | $labels['archived'] = 'Arquivada com sucesso'; |
| | | $labels['archivefolder'] = 'Arquivo'; |
| | | |
| | | ?> |
New file |
| | |
| | | <?php |
| | | |
| | | $labels = array(); |
| | | $labels['buttontitle'] = 'Переместить выбранное в архив'; |
| | | $labels['archived'] = 'Перенесено в Архив'; |
| | | $labels['archivefolder'] = 'Архив'; |
| | | |
| | | ?> |
New file |
| | |
| | | <?php |
| | | |
| | | $labels = array(); |
| | | $labels['buttontitle'] = 'Arkivera meddelande'; |
| | | $labels['archived'] = 'Meddelandet är arkiverat'; |
| | | $labels['archivefolder'] = 'Arkiv'; |
| | | |
| | | ?> |
New file |
| | |
| | | <?php |
| | | |
| | | $labels = array(); |
| | | $labels['buttontitle'] = '封存此信件'; |
| | | $labels['archived'] = '已成功封存'; |
| | | $labels['archivefolder'] = '封存'; |
| | | |
| | | ?> |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <package xmlns="http://pear.php.net/dtd/package-2.0" xmlns:tasks="http://pear.php.net/dtd/tasks-1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" packagerversion="1.9.0" version="2.0" xsi:schemaLocation="http://pear.php.net/dtd/tasks-1.0 |
| | | http://pear.php.net/dtd/tasks-1.0.xsd |
| | | http://pear.php.net/dtd/package-2.0 |
| | | http://pear.php.net/dtd/package-2.0.xsd"> |
| | | <name>archive</name> |
| | | <channel>pear.roundcube.net</channel> |
| | | <summary>Archive feature for Roundcube</summary> |
| | | <description>This adds a button to move the selected messages to an archive folder. The folder can be selected in the settings panel.</description> |
| | | <lead> |
| | | <name>Thomas Bruederli</name> |
| | | <user>thomasb</user> |
| | | <email>roundcube@gmail.com</email> |
| | | <active>yes</active> |
| | | </lead> |
| | | <date>2011-11-23</date> |
| | | <version> |
| | | <release>1.6</release> |
| | | <api>1.6</api> |
| | | </version> |
| | | <stability> |
| | | <release>stable</release> |
| | | <api>stable</api> |
| | | </stability> |
| | | <license uri="http://www.gnu.org/licenses/gpl.html">GNU GPLv3+</license> |
| | | <notes>-</notes> |
| | | <contents> |
| | | <dir baseinstalldir="/" name="/"> |
| | | <file name="archive.php" role="php"> |
| | | <tasks:replace from="@name@" to="name" type="package-info"/> |
| | | <tasks:replace from="@package_version@" to="version" type="package-info"/> |
| | | </file> |
| | | <file name="archive.js" role="data"> |
| | | <tasks:replace from="@name@" to="name" type="package-info"/> |
| | | <tasks:replace from="@package_version@" to="version" type="package-info"/> |
| | | </file> |
| | | <file name="localization/cs_CZ.inc" role="data"></file> |
| | | <file name="localization/de_CH.inc" role="data"></file> |
| | | <file name="localization/de_DE.inc" role="data"></file> |
| | | <file name="localization/en_US.inc" role="data"></file> |
| | | <file name="localization/es_AR.inc" role="data"></file> |
| | | <file name="localization/es_ES.inc" role="data"></file> |
| | | <file name="localization/et_EE.inc" role="data"></file> |
| | | <file name="localization/fr_FR.inc" role="data"></file> |
| | | <file name="localization/gl_ES.inc" role="data"></file> |
| | | <file name="localization/ja_JP.inc" role="data"></file> |
| | | <file name="localization/nl_NL.inc" role="data"></file> |
| | | <file name="localization/pl_PL.inc" role="data"></file> |
| | | <file name="localization/pt_BR.inc" role="data"></file> |
| | | <file name="localization/ru_RU.inc" role="data"></file> |
| | | <file name="localization/sv_SE.inc" role="data"></file> |
| | | <file name="localization/zh_TW.inc" role="data"></file> |
| | | <file name="skins/default/archive_act.png" role="data"></file> |
| | | <file name="skins/default/archive_pas.png" role="data"></file> |
| | | <file name="skins/default/foldericon.png" role="data"></file> |
| | | </dir> |
| | | <!-- / --> |
| | | </contents> |
| | | <dependencies> |
| | | <required> |
| | | <php> |
| | | <min>5.2.1</min> |
| | | </php> |
| | | <pearinstaller> |
| | | <min>1.7.0</min> |
| | | </pearinstaller> |
| | | </required> |
| | | </dependencies> |
| | | <phprelease/> |
| | | </package> |
New file |
| | |
| | | |
| | | #messagetoolbar a.button.archive { |
| | | text-indent: -1000px; |
| | | background: url(archive_act.png) 0 0 no-repeat; |
| | | } |
| | | |
| | | #mailboxlist li.mailbox.archive { |
| | | background-image: url(foldericon.png); |
| | | background-position: 5px 1px; |
| | | } |
New file |
| | |
| | | <?php |
| | | |
| | | /** |
| | | * Sample plugin to try out some hooks. |
| | | * This performs an automatic login if accessed from localhost |
| | | * |
| | | * @license GNU GPLv3+ |
| | | * @author Thomas Bruederli |
| | | */ |
| | | class autologon extends rcube_plugin |
| | | { |
| | | public $task = 'login'; |
| | | |
| | | function init() |
| | | { |
| | | $this->add_hook('startup', array($this, 'startup')); |
| | | $this->add_hook('authenticate', array($this, 'authenticate')); |
| | | } |
| | | |
| | | function startup($args) |
| | | { |
| | | $rcmail = rcmail::get_instance(); |
| | | |
| | | // change action to login |
| | | if (empty($_SESSION['user_id']) && !empty($_GET['_autologin']) && $this->is_localhost()) |
| | | $args['action'] = 'login'; |
| | | |
| | | return $args; |
| | | } |
| | | |
| | | function authenticate($args) |
| | | { |
| | | if (!empty($_GET['_autologin']) && $this->is_localhost()) { |
| | | $args['user'] = 'me'; |
| | | $args['pass'] = '******'; |
| | | $args['host'] = 'localhost'; |
| | | $args['cookiecheck'] = false; |
| | | $args['valid'] = true; |
| | | } |
| | | |
| | | return $args; |
| | | } |
| | | |
| | | function is_localhost() |
| | | { |
| | | return $_SERVER['REMOTE_ADDR'] == '::1' || $_SERVER['REMOTE_ADDR'] == '127.0.0.1'; |
| | | } |
| | | |
| | | } |
| | | |
New file |
| | |
| | | <?php |
| | | /** |
| | | * Filesystem Attachments |
| | | * |
| | | * This plugin which provides database backed storage for temporary |
| | | * attachment file handling. The primary advantage of this plugin |
| | | * is its compatibility with round-robin dns multi-server roundcube |
| | | * installations. |
| | | * |
| | | * This plugin relies on the core filesystem_attachments plugin |
| | | * |
| | | * @author Ziba Scott <ziba@umich.edu> |
| | | * @author Aleksander Machniak <alec@alec.pl> |
| | | * @version @package_version@ |
| | | */ |
| | | require_once('plugins/filesystem_attachments/filesystem_attachments.php'); |
| | | class database_attachments extends filesystem_attachments |
| | | { |
| | | |
| | | // A prefix for the cache key used in the session and in the key field of the cache table |
| | | private $cache_prefix = "db_attach"; |
| | | |
| | | /** |
| | | * Helper method to generate a unique key for the given attachment file |
| | | */ |
| | | private function _key($args) |
| | | { |
| | | $uname = $args['path'] ? $args['path'] : $args['name']; |
| | | return $this->cache_prefix . $args['group'] . md5(mktime() . $uname . $_SESSION['user_id']); |
| | | } |
| | | |
| | | /** |
| | | * Save a newly uploaded attachment |
| | | */ |
| | | function upload($args) |
| | | { |
| | | $args['status'] = false; |
| | | $rcmail = rcmail::get_instance(); |
| | | $key = $this->_key($args); |
| | | |
| | | $data = file_get_contents($args['path']); |
| | | |
| | | if ($data === false) |
| | | return $args; |
| | | |
| | | $data = base64_encode($data); |
| | | |
| | | $status = $rcmail->db->query( |
| | | "INSERT INTO ".get_table_name('cache')." |
| | | (created, user_id, cache_key, data) |
| | | VALUES (".$rcmail->db->now().", ?, ?, ?)", |
| | | $_SESSION['user_id'], |
| | | $key, |
| | | $data); |
| | | |
| | | if ($status) { |
| | | $args['id'] = $key; |
| | | $args['status'] = true; |
| | | unset($args['path']); |
| | | } |
| | | |
| | | return $args; |
| | | } |
| | | |
| | | /** |
| | | * Save an attachment from a non-upload source (draft or forward) |
| | | */ |
| | | function save($args) |
| | | { |
| | | $args['status'] = false; |
| | | $rcmail = rcmail::get_instance(); |
| | | |
| | | $key = $this->_key($args); |
| | | |
| | | if ($args['path']) { |
| | | $args['data'] = file_get_contents($args['path']); |
| | | |
| | | if ($args['data'] === false) |
| | | return $args; |
| | | } |
| | | |
| | | $data = base64_encode($args['data']); |
| | | |
| | | $status = $rcmail->db->query( |
| | | "INSERT INTO ".get_table_name('cache')." |
| | | (created, user_id, cache_key, data) |
| | | VALUES (".$rcmail->db->now().", ?, ?, ?)", |
| | | $_SESSION['user_id'], |
| | | $key, |
| | | $data); |
| | | |
| | | if ($status) { |
| | | $args['id'] = $key; |
| | | $args['status'] = true; |
| | | } |
| | | |
| | | return $args; |
| | | } |
| | | |
| | | /** |
| | | * Remove an attachment from storage |
| | | * This is triggered by the remove attachment button on the compose screen |
| | | */ |
| | | function remove($args) |
| | | { |
| | | $args['status'] = false; |
| | | $rcmail = rcmail::get_instance(); |
| | | $status = $rcmail->db->query( |
| | | "DELETE FROM ".get_table_name('cache')." |
| | | WHERE user_id=? |
| | | AND cache_key=?", |
| | | $_SESSION['user_id'], |
| | | $args['id']); |
| | | |
| | | if ($status) { |
| | | $args['status'] = true; |
| | | } |
| | | |
| | | return $args; |
| | | } |
| | | |
| | | /** |
| | | * When composing an html message, image attachments may be shown |
| | | * For this plugin, $this->get() will check the file and |
| | | * return it's contents |
| | | */ |
| | | function display($args) |
| | | { |
| | | return $this->get($args); |
| | | } |
| | | |
| | | /** |
| | | * When displaying or sending the attachment the file contents are fetched |
| | | * using this method. This is also called by the attachment_display hook. |
| | | */ |
| | | function get($args) |
| | | { |
| | | $rcmail = rcmail::get_instance(); |
| | | |
| | | $sql_result = $rcmail->db->query( |
| | | "SELECT cache_id, data |
| | | FROM ".get_table_name('cache')." |
| | | WHERE user_id=? |
| | | AND cache_key=?", |
| | | $_SESSION['user_id'], |
| | | $args['id']); |
| | | |
| | | if ($sql_arr = $rcmail->db->fetch_assoc($sql_result)) { |
| | | $args['data'] = base64_decode($sql_arr['data']); |
| | | $args['status'] = true; |
| | | } |
| | | |
| | | return $args; |
| | | } |
| | | |
| | | /** |
| | | * Delete all temp files associated with this user |
| | | */ |
| | | function cleanup($args) |
| | | { |
| | | $prefix = $this->cache_prefix . $args['group']; |
| | | $rcmail = rcmail::get_instance(); |
| | | $rcmail->db->query( |
| | | "DELETE FROM ".get_table_name('cache')." |
| | | WHERE user_id=? |
| | | AND cache_key like '{$prefix}%'", |
| | | $_SESSION['user_id']); |
| | | } |
| | | } |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <package xmlns="http://pear.php.net/dtd/package-2.0" xmlns:tasks="http://pear.php.net/dtd/tasks-1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" packagerversion="1.9.0" version="2.0" xsi:schemaLocation="http://pear.php.net/dtd/tasks-1.0 |
| | | http://pear.php.net/dtd/tasks-1.0.xsd |
| | | http://pear.php.net/dtd/package-2.0 |
| | | http://pear.php.net/dtd/package-2.0.xsd"> |
| | | <name>database_attachments</name> |
| | | <channel>pear.roundcube.net</channel> |
| | | <summary>SQL database storage for uploaded attachments</summary> |
| | | <description> |
| | | This plugin which provides database backed storage for temporary |
| | | attachment file handling. The primary advantage of this plugin |
| | | is its compatibility with round-robin dns multi-server Roundcube |
| | | installations. |
| | | </description> |
| | | <lead> |
| | | <name>Aleksander Machniak</name> |
| | | <user>alec</user> |
| | | <email>alec@alec.pl</email> |
| | | <active>yes</active> |
| | | </lead> |
| | | <developer> |
| | | <name>Ziba Scott</name> |
| | | <user>ziba</user> |
| | | <email>ziba@umich.edu</email> |
| | | <active>yes</active> |
| | | </developer> |
| | | <date>2011-11-21</date> |
| | | <version> |
| | | <release>1.0</release> |
| | | <api>1.0</api> |
| | | </version> |
| | | <stability> |
| | | <release>stable</release> |
| | | <api>stable</api> |
| | | </stability> |
| | | <license uri="http://www.gnu.org/licenses/gpl-2.0.html">GNU GPLv2</license> |
| | | <notes>-</notes> |
| | | <contents> |
| | | <dir baseinstalldir="/" name="/"> |
| | | <file name="database_attachments.php" role="php"> |
| | | <tasks:replace from="@name@" to="name" type="package-info"/> |
| | | <tasks:replace from="@package_version@" to="version" type="package-info"/> |
| | | </file> |
| | | </dir> |
| | | <!-- / --> |
| | | </contents> |
| | | <dependencies> |
| | | <required> |
| | | <php> |
| | | <min>5.2.1</min> |
| | | </php> |
| | | <pearinstaller> |
| | | <min>1.7.0</min> |
| | | </pearinstaller> |
| | | <package> |
| | | <name>filesystem_attachments</name> |
| | | <channel>pear.roundcube.net</channel> |
| | | </package> |
| | | </required> |
| | | </dependencies> |
| | | <phprelease/> |
| | | </package> |
New file |
| | |
| | | <?php |
| | | |
| | | /** |
| | | * Debug Logger |
| | | * |
| | | * Enhanced logging for debugging purposes. It is not recommened |
| | | * to be enabled on production systems without testing because of |
| | | * the somewhat increased memory, cpu and disk i/o overhead. |
| | | * |
| | | * Debug Logger listens for existing console("message") calls and |
| | | * introduces start and end tags as well as free form tagging |
| | | * which can redirect messages to files. The resulting log files |
| | | * provide timing and tag quantity results. |
| | | * |
| | | * Enable the plugin in config/main.inc.php and add your desired |
| | | * log types and files. |
| | | * |
| | | * @version @package_version@ |
| | | * @author Ziba Scott |
| | | * @website http://roundcube.net |
| | | * |
| | | * Example: |
| | | * |
| | | * config/main.inc.php: |
| | | * |
| | | * // $rcmail_config['debug_logger'][type of logging] = name of file in log_dir |
| | | * // The 'master' log includes timing information |
| | | * $rcmail_config['debug_logger']['master'] = 'master'; |
| | | * // If you want sql messages to also go into a separate file |
| | | * $rcmail_config['debug_logger']['sql'] = 'sql'; |
| | | * |
| | | * index.php (just after $RCMAIL->plugins->init()): |
| | | * |
| | | * console("my test","start"); |
| | | * console("my message"); |
| | | * console("my sql calls","start"); |
| | | * console("cp -r * /dev/null","shell exec"); |
| | | * console("select * from example","sql"); |
| | | * console("select * from example","sql"); |
| | | * console("select * from example","sql"); |
| | | * console("end"); |
| | | * console("end"); |
| | | * |
| | | * |
| | | * logs/master (after reloading the main page): |
| | | * |
| | | * [17-Feb-2009 16:51:37 -0500] start: Task: mail. |
| | | * [17-Feb-2009 16:51:37 -0500] start: my test |
| | | * [17-Feb-2009 16:51:37 -0500] my message |
| | | * [17-Feb-2009 16:51:37 -0500] shell exec: cp -r * /dev/null |
| | | * [17-Feb-2009 16:51:37 -0500] start: my sql calls |
| | | * [17-Feb-2009 16:51:37 -0500] sql: select * from example |
| | | * [17-Feb-2009 16:51:37 -0500] sql: select * from example |
| | | * [17-Feb-2009 16:51:37 -0500] sql: select * from example |
| | | * [17-Feb-2009 16:51:37 -0500] end: my sql calls - 0.0018 seconds shell exec: 1, sql: 3, |
| | | * [17-Feb-2009 16:51:37 -0500] end: my test - 0.0055 seconds shell exec: 1, sql: 3, |
| | | * [17-Feb-2009 16:51:38 -0500] end: Task: mail. - 0.8854 seconds shell exec: 1, sql: 3, |
| | | * |
| | | * logs/sql (after reloading the main page): |
| | | * |
| | | * [17-Feb-2009 16:51:37 -0500] sql: select * from example |
| | | * [17-Feb-2009 16:51:37 -0500] sql: select * from example |
| | | * [17-Feb-2009 16:51:37 -0500] sql: select * from example |
| | | */ |
| | | class debug_logger extends rcube_plugin |
| | | { |
| | | function init() |
| | | { |
| | | require_once(dirname(__FILE__).'/runlog/runlog.php'); |
| | | $this->runlog = new runlog(); |
| | | |
| | | if(!rcmail::get_instance()->config->get('log_dir')){ |
| | | rcmail::get_instance()->config->set('log_dir',INSTALL_PATH.'logs'); |
| | | } |
| | | |
| | | $log_config = rcmail::get_instance()->config->get('debug_logger',array()); |
| | | |
| | | foreach($log_config as $type=>$file){ |
| | | $this->runlog->set_file(rcmail::get_instance()->config->get('log_dir').'/'.$file, $type); |
| | | } |
| | | |
| | | $start_string = ""; |
| | | $action = rcmail::get_instance()->action; |
| | | $task = rcmail::get_instance()->task; |
| | | if($action){ |
| | | $start_string .= "Action: ".$action.". "; |
| | | } |
| | | if($task){ |
| | | $start_string .= "Task: ".$task.". "; |
| | | } |
| | | $this->runlog->start($start_string); |
| | | |
| | | $this->add_hook('console', array($this, 'console')); |
| | | $this->add_hook('authenticate', array($this, 'authenticate')); |
| | | } |
| | | |
| | | function authenticate($args){ |
| | | $this->runlog->note('Authenticating '.$args['user'].'@'.$args['host']); |
| | | return $args; |
| | | } |
| | | |
| | | function console($args){ |
| | | $note = $args[0]; |
| | | $type = $args[1]; |
| | | |
| | | |
| | | if(!isset($args[1])){ |
| | | // This could be extended to detect types based on the |
| | | // file which called console. For now only rcube_imap/rcube_storage is supported |
| | | $bt = debug_backtrace(); |
| | | $file = $bt[3]['file']; |
| | | switch(basename($file)){ |
| | | case 'rcube_imap.php': |
| | | $type = 'imap'; |
| | | break; |
| | | case 'rcube_storage.php': |
| | | $type = 'storage'; |
| | | break; |
| | | default: |
| | | $type = FALSE; |
| | | break; |
| | | } |
| | | } |
| | | switch($note){ |
| | | case 'end': |
| | | $type = 'end'; |
| | | break; |
| | | } |
| | | |
| | | |
| | | switch($type){ |
| | | case 'start': |
| | | $this->runlog->start($note); |
| | | break; |
| | | case 'end': |
| | | $this->runlog->end(); |
| | | break; |
| | | default: |
| | | $this->runlog->note($note, $type); |
| | | break; |
| | | } |
| | | return $args; |
| | | } |
| | | |
| | | function __destruct(){ |
| | | $this->runlog->end(); |
| | | } |
| | | } |
| | | ?> |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <package xmlns="http://pear.php.net/dtd/package-2.0" xmlns:tasks="http://pear.php.net/dtd/tasks-1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" packagerversion="1.9.0" version="2.0" xsi:schemaLocation="http://pear.php.net/dtd/tasks-1.0 |
| | | http://pear.php.net/dtd/tasks-1.0.xsd |
| | | http://pear.php.net/dtd/package-2.0 |
| | | http://pear.php.net/dtd/package-2.0.xsd"> |
| | | <name>debug_logger</name> |
| | | <channel>pear.roundcube.net</channel> |
| | | <summary>Additional debugging logs</summary> |
| | | <description> |
| | | Enhanced logging for debugging purposes. It is not recommened |
| | | to be enabled on production systems without testing because of |
| | | the somewhat increased memory, cpu and disk i/o overhead. |
| | | </description> |
| | | <lead> |
| | | <name>Ziba Scott</name> |
| | | <user>ziba</user> |
| | | <email>ziba@umich.edu</email> |
| | | <active>yes</active> |
| | | </lead> |
| | | <date>2011-11-21</date> |
| | | <version> |
| | | <release>1.0</release> |
| | | <api>1.0</api> |
| | | </version> |
| | | <stability> |
| | | <release>stable</release> |
| | | <api>stable</api> |
| | | </stability> |
| | | <license uri="http://www.gnu.org/licenses/gpl-2.0.html">GNU GPLv2</license> |
| | | <notes>-</notes> |
| | | <contents> |
| | | <dir baseinstalldir="/" name="/"> |
| | | <file name="debug_logger.php" role="php"> |
| | | <tasks:replace from="@name@" to="name" type="package-info"/> |
| | | <tasks:replace from="@package_version@" to="version" type="package-info"/> |
| | | </file> |
| | | <file name="runlog/runlog.php" role="php"> |
| | | <tasks:replace from="@name@" to="name" type="package-info"/> |
| | | <tasks:replace from="@package_version@" to="version" type="package-info"/> |
| | | </file> |
| | | </dir> |
| | | <!-- / --> |
| | | </contents> |
| | | <dependencies> |
| | | <required> |
| | | <php> |
| | | <min>5.2.1</min> |
| | | </php> |
| | | <pearinstaller> |
| | | <min>1.7.0</min> |
| | | </pearinstaller> |
| | | </required> |
| | | </dependencies> |
| | | <phprelease/> |
| | | </package> |
New file |
| | |
| | | <?php |
| | | |
| | | /** |
| | | * runlog |
| | | * |
| | | * @author Ziba Scott <ziba@umich.edu> |
| | | */ |
| | | class runlog { |
| | | |
| | | private $start_time = FALSE; |
| | | |
| | | private $parent_stack = array(); |
| | | |
| | | public $print_to_console = FALSE; |
| | | |
| | | private $file_handles = array(); |
| | | |
| | | private $indent = 0; |
| | | |
| | | public $threshold = 0; |
| | | |
| | | public $tag_count = array(); |
| | | |
| | | public $timestamp = "d-M-Y H:i:s O"; |
| | | |
| | | public $max_line_size = 150; |
| | | |
| | | private $run_log = array(); |
| | | |
| | | function runlog() |
| | | { |
| | | $this->start_time = microtime( TRUE ); |
| | | } |
| | | |
| | | public function start( $name, $tag = FALSE ) |
| | | { |
| | | $this->run_log[] = array( 'type' => 'start', |
| | | 'tag' => $tag, |
| | | 'index' => count($this->run_log), |
| | | 'value' => $name, |
| | | 'time' => microtime( TRUE ), |
| | | 'parents' => $this->parent_stack, |
| | | 'ended' => false, |
| | | ); |
| | | $this->parent_stack[] = $name; |
| | | |
| | | $this->print_to_console("start: ".$name, $tag, 'start'); |
| | | $this->print_to_file("start: ".$name, $tag, 'start'); |
| | | $this->indent++; |
| | | } |
| | | |
| | | public function end() |
| | | { |
| | | $name = array_pop( $this->parent_stack ); |
| | | foreach ( $this->run_log as $k => $entry ) { |
| | | if ( $entry['value'] == $name && $entry['type'] == 'start' && $entry['ended'] == false) { |
| | | $lastk = $k; |
| | | } |
| | | } |
| | | $start = $this->run_log[$lastk]['time']; |
| | | $this->run_log[$lastk]['duration'] = microtime( TRUE ) - $start; |
| | | $this->run_log[$lastk]['ended'] = true; |
| | | |
| | | $this->run_log[] = array( 'type' => 'end', |
| | | 'tag' => $this->run_log[$lastk]['tag'], |
| | | 'index' => $lastk, |
| | | 'value' => $name, |
| | | 'time' => microtime( TRUE ), |
| | | 'duration' => microtime( TRUE ) - $start, |
| | | 'parents' => $this->parent_stack, |
| | | ); |
| | | $this->indent--; |
| | | if($this->run_log[$lastk]['duration'] >= $this->threshold){ |
| | | $tag_report = ""; |
| | | foreach($this->tag_count as $tag=>$count){ |
| | | $tag_report .= "$tag: $count, "; |
| | | } |
| | | if(!empty($tag_report)){ |
| | | // $tag_report = "\n$tag_report\n"; |
| | | } |
| | | $end_txt = sprintf("end: $name - %0.4f seconds $tag_report", $this->run_log[$lastk]['duration'] ); |
| | | $this->print_to_console($end_txt, $this->run_log[$lastk]['tag'] , 'end'); |
| | | $this->print_to_file($end_txt, $this->run_log[$lastk]['tag'], 'end'); |
| | | } |
| | | } |
| | | |
| | | public function increase_tag_count($tag){ |
| | | if(!isset($this->tag_count[$tag])){ |
| | | $this->tag_count[$tag] = 0; |
| | | } |
| | | $this->tag_count[$tag]++; |
| | | } |
| | | |
| | | public function get_text(){ |
| | | $text = ""; |
| | | foreach($this->run_log as $entry){ |
| | | $text .= str_repeat(" ",count($entry['parents'])); |
| | | if($entry['tag'] != 'text'){ |
| | | $text .= $entry['tag'].': '; |
| | | } |
| | | $text .= $entry['value']; |
| | | |
| | | if($entry['tag'] == 'end'){ |
| | | $text .= sprintf(" - %0.4f seconds", $entry['duration'] ); |
| | | } |
| | | |
| | | $text .= "\n"; |
| | | } |
| | | return $text; |
| | | } |
| | | |
| | | public function set_file($filename, $tag = 'master'){ |
| | | if(!isset($this->file_handle[$tag])){ |
| | | $this->file_handles[$tag] = fopen($filename, 'a'); |
| | | if(!$this->file_handles[$tag]){ |
| | | trigger_error('Could not open file for writing: '.$filename); |
| | | } |
| | | } |
| | | } |
| | | |
| | | public function note( $msg, $tag = FALSE ) |
| | | { |
| | | if($tag){ |
| | | $this->increase_tag_count($tag); |
| | | } |
| | | if ( is_array( $msg )) { |
| | | $msg = '<pre>' . print_r( $msg, TRUE ) . '</pre>'; |
| | | } |
| | | $this->debug_messages[] = $msg; |
| | | $this->run_log[] = array( 'type' => 'note', |
| | | 'tag' => $tag ? $tag:"text", |
| | | 'value' => htmlentities($msg), |
| | | 'time' => microtime( TRUE ), |
| | | 'parents' => $this->parent_stack, |
| | | ); |
| | | |
| | | $this->print_to_file($msg, $tag); |
| | | $this->print_to_console($msg, $tag); |
| | | |
| | | } |
| | | |
| | | public function print_to_file($msg, $tag = FALSE, $type = FALSE){ |
| | | if(!$tag){ |
| | | $file_handle_tag = 'master'; |
| | | } |
| | | else{ |
| | | $file_handle_tag = $tag; |
| | | } |
| | | if($file_handle_tag != 'master' && isset($this->file_handles[$file_handle_tag])){ |
| | | $buffer = $this->get_indent(); |
| | | $buffer .= "$msg\n"; |
| | | if(!empty($this->timestamp)){ |
| | | $buffer = sprintf("[%s] %s",date($this->timestamp, mktime()), $buffer); |
| | | } |
| | | fwrite($this->file_handles[$file_handle_tag], wordwrap($buffer, $this->max_line_size, "\n ")); |
| | | } |
| | | if(isset($this->file_handles['master']) && $this->file_handles['master']){ |
| | | $buffer = $this->get_indent(); |
| | | if($tag){ |
| | | $buffer .= "$tag: "; |
| | | } |
| | | $msg = str_replace("\n","",$msg); |
| | | $buffer .= "$msg"; |
| | | if(!empty($this->timestamp)){ |
| | | $buffer = sprintf("[%s] %s",date($this->timestamp, mktime()), $buffer); |
| | | } |
| | | if(strlen($buffer) > $this->max_line_size){ |
| | | $buffer = substr($buffer,0,$this->max_line_size - 3)."..."; |
| | | } |
| | | fwrite($this->file_handles['master'], $buffer."\n"); |
| | | } |
| | | } |
| | | |
| | | public function print_to_console($msg, $tag=FALSE){ |
| | | if($this->print_to_console){ |
| | | if(is_array($this->print_to_console)){ |
| | | if(in_array($tag, $this->print_to_console)){ |
| | | echo $this->get_indent(); |
| | | if($tag){ |
| | | echo "$tag: "; |
| | | } |
| | | echo "$msg\n"; |
| | | } |
| | | } |
| | | else{ |
| | | echo $this->get_indent(); |
| | | if($tag){ |
| | | echo "$tag: "; |
| | | } |
| | | echo "$msg\n"; |
| | | } |
| | | } |
| | | } |
| | | |
| | | public function print_totals(){ |
| | | $totals = array(); |
| | | foreach ( $this->run_log as $k => $entry ) { |
| | | if ( $entry['type'] == 'start' && $entry['ended'] == true) { |
| | | $totals[$entry['value']]['duration'] += $entry['duration']; |
| | | $totals[$entry['value']]['count'] += 1; |
| | | } |
| | | } |
| | | if($this->file_handle){ |
| | | foreach($totals as $name=>$details){ |
| | | fwrite($this->file_handle,$name.": ".number_format($details['duration'],4)."sec, ".$details['count']." calls \n"); |
| | | } |
| | | } |
| | | } |
| | | |
| | | private function get_indent(){ |
| | | $buf = ""; |
| | | for($i = 0; $i < $this->indent; $i++){ |
| | | $buf .= " "; |
| | | } |
| | | return $buf; |
| | | } |
| | | |
| | | |
| | | function __destruct(){ |
| | | foreach($this->file_handles as $handle){ |
| | | fclose($handle); |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | ?> |
New file |
| | |
| | | <?php |
| | | |
| | | /** |
| | | * Display Emoticons |
| | | * |
| | | * Sample plugin to replace emoticons in plain text message body with real icons |
| | | * |
| | | * @version @package_version@ |
| | | * @license GNU GPLv3+ |
| | | * @author Thomas Bruederli |
| | | * @author Aleksander Machniak |
| | | * @website http://roundcube.net |
| | | */ |
| | | class emoticons extends rcube_plugin |
| | | { |
| | | public $task = 'mail'; |
| | | |
| | | function init() |
| | | { |
| | | $this->add_hook('message_part_after', array($this, 'replace')); |
| | | } |
| | | |
| | | function replace($args) |
| | | { |
| | | // This is a lookbehind assertion which will exclude html entities |
| | | // E.g. situation when ";)" in "")" shouldn't be replaced by the icon |
| | | // It's so long because of assertion format restrictions |
| | | $entity = '(?<!&' |
| | | . '[a-zA-Z0-9]{2}' . '|' . '#[0-9]{2}' . '|' |
| | | . '[a-zA-Z0-9]{3}' . '|' . '#[0-9]{3}' . '|' |
| | | . '[a-zA-Z0-9]{4}' . '|' . '#[0-9]{4}' . '|' |
| | | . '[a-zA-Z0-9]{5}' . '|' |
| | | . '[a-zA-Z0-9]{6}' . '|' |
| | | . '[a-zA-Z0-9]{7}' |
| | | . ')'; |
| | | |
| | | // map of emoticon replacements |
| | | $map = array( |
| | | '/:\)/' => $this->img_tag('smiley-smile.gif', ':)' ), |
| | | '/:-\)/' => $this->img_tag('smiley-smile.gif', ':-)' ), |
| | | '/(?<!mailto):D/' => $this->img_tag('smiley-laughing.gif', ':D' ), |
| | | '/:-D/' => $this->img_tag('smiley-laughing.gif', ':-D' ), |
| | | '/:\(/' => $this->img_tag('smiley-frown.gif', ':(' ), |
| | | '/:-\(/' => $this->img_tag('smiley-frown.gif', ':-(' ), |
| | | '/'.$entity.';\)/' => $this->img_tag('smiley-wink.gif', ';)' ), |
| | | '/'.$entity.';-\)/' => $this->img_tag('smiley-wink.gif', ';-)' ), |
| | | '/8\)/' => $this->img_tag('smiley-cool.gif', '8)' ), |
| | | '/8-\)/' => $this->img_tag('smiley-cool.gif', '8-)' ), |
| | | '/(?<!mailto):O/i' => $this->img_tag('smiley-surprised.gif', ':O' ), |
| | | '/(?<!mailto):-O/i' => $this->img_tag('smiley-surprised.gif', ':-O' ), |
| | | '/(?<!mailto):P/i' => $this->img_tag('smiley-tongue-out.gif', ':P' ), |
| | | '/(?<!mailto):-P/i' => $this->img_tag('smiley-tongue-out.gif', ':-P' ), |
| | | '/(?<!mailto):@/i' => $this->img_tag('smiley-yell.gif', ':@' ), |
| | | '/(?<!mailto):-@/i' => $this->img_tag('smiley-yell.gif', ':-@' ), |
| | | '/O:\)/i' => $this->img_tag('smiley-innocent.gif', 'O:)' ), |
| | | '/O:-\)/i' => $this->img_tag('smiley-innocent.gif', 'O:-)' ), |
| | | '/(?<!mailto):$/' => $this->img_tag('smiley-embarassed.gif', ':$' ), |
| | | '/(?<!mailto):-$/' => $this->img_tag('smiley-embarassed.gif', ':-$' ), |
| | | '/(?<!mailto):\*/i' => $this->img_tag('smiley-kiss.gif', ':*' ), |
| | | '/(?<!mailto):-\*/i' => $this->img_tag('smiley-kiss.gif', ':-*' ), |
| | | '/(?<!mailto):S/i' => $this->img_tag('smiley-undecided.gif', ':S' ), |
| | | '/(?<!mailto):-S/i' => $this->img_tag('smiley-undecided.gif', ':-S' ), |
| | | ); |
| | | |
| | | if ($args['type'] == 'plain') { |
| | | $args['body'] = preg_replace( |
| | | array_keys($map), array_values($map), $args['body']); |
| | | } |
| | | |
| | | return $args; |
| | | } |
| | | |
| | | private function img_tag($ico, $title) |
| | | { |
| | | $path = './program/js/tiny_mce/plugins/emotions/img/'; |
| | | return html::img(array('src' => $path.$ico, 'title' => $title)); |
| | | } |
| | | } |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <package xmlns="http://pear.php.net/dtd/package-2.0" xmlns:tasks="http://pear.php.net/dtd/tasks-1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" packagerversion="1.9.0" version="2.0" xsi:schemaLocation="http://pear.php.net/dtd/tasks-1.0 |
| | | http://pear.php.net/dtd/tasks-1.0.xsd |
| | | http://pear.php.net/dtd/package-2.0 |
| | | http://pear.php.net/dtd/package-2.0.xsd"> |
| | | <name>emoticons</name> |
| | | <channel>pear.roundcube.net</channel> |
| | | <summary>Display emoticons in text messages</summary> |
| | | <description>Sample plugin to replace emoticons in plain text message body with real icons.</description> |
| | | <lead> |
| | | <name>Thomas Bruederli</name> |
| | | <user>thomasb</user> |
| | | <email>roundcube@gmail.com</email> |
| | | <active>yes</active> |
| | | </lead> |
| | | <developer> |
| | | <name>Aleksander Machniak</name> |
| | | <user>alec</user> |
| | | <email>alec@alec.pl</email> |
| | | <active>yes</active> |
| | | </developer> |
| | | <date>2011-11-21</date> |
| | | <version> |
| | | <release>1.3</release> |
| | | <api>1.3</api> |
| | | </version> |
| | | <stability> |
| | | <release>stable</release> |
| | | <api>stable</api> |
| | | </stability> |
| | | <license uri="http://www.gnu.org/licenses/gpl.html">GNU GPLv3+</license> |
| | | <notes>-</notes> |
| | | <contents> |
| | | <dir baseinstalldir="/" name="/"> |
| | | <file name="emoticons.php" role="php"> |
| | | <tasks:replace from="@name@" to="name" type="package-info"/> |
| | | <tasks:replace from="@package_version@" to="version" type="package-info"/> |
| | | </file> |
| | | </dir> |
| | | <!-- / --> |
| | | </contents> |
| | | <dependencies> |
| | | <required> |
| | | <php> |
| | | <min>5.2.1</min> |
| | | </php> |
| | | <pearinstaller> |
| | | <min>1.7.0</min> |
| | | </pearinstaller> |
| | | </required> |
| | | </dependencies> |
| | | <phprelease/> |
| | | </package> |
New file |
| | |
| | | ------------------------------------------------------------------ |
| | | THIS IS NOT EVEN AN "ALPHA" STATE. USE ONLY FOR DEVELOPMENT!!!!!!! |
| | | ------------------------------------------------------------------ |
| | | |
| | | WARNING: Don't use with gnupg-2.x! |
| | | |
| | | Enigma Plugin Status: |
| | | |
| | | * DONE: |
| | | |
| | | - PGP signed messages verification |
| | | - Handling of PGP keys files attached to incoming messages |
| | | - PGP encrypted messages decryption (started) |
| | | - PGP keys management UI (started) |
| | | |
| | | * TODO (must have): |
| | | |
| | | - Parsing of decrypted messages into array (see rcube_mime_struct) and then into rcube_message_part structure |
| | | (create core class rcube_mime_parser or take over PEAR::Mail_mimeDecode package and improve it) |
| | | - Sending encrypted/signed messages (probably some changes in core will be needed) |
| | | - Per-Identity settings (including keys/certs) |
| | | - Handling big messages with temp files (including changes in Roundcube core) |
| | | - Performance improvements (some caching, code review) |
| | | - better (and more) icons |
| | | |
| | | * TODO (later): |
| | | |
| | | - Keys generation |
| | | - Certs generation |
| | | - Keys/Certs info in Contacts details page (+ split Contact details page into tabs) |
| | | - Key server support |
| | | - S/MIME signed messages verification |
| | | - S/MIME encrypted messages decryption |
| | | - Handling of S/MIME certs files attached to incoming messages |
| | | - SSL (S/MIME) Certs management |
New file |
| | |
| | | <?php |
| | | |
| | | // Enigma Plugin options |
| | | // -------------------- |
| | | |
| | | // A driver to use for PGP. Default: "gnupg". |
| | | $rcmail_config['enigma_pgp_driver'] = 'gnupg'; |
| | | |
| | | // A driver to use for S/MIME. Default: "phpssl". |
| | | $rcmail_config['enigma_smime_driver'] = 'phpssl'; |
| | | |
| | | // Keys directory for all users. Default 'enigma/home'. |
| | | // Must be writeable by PHP process |
| | | $rcmail_config['enigma_pgp_homedir'] = null; |
New file |
| | |
| | | /* Enigma Plugin */ |
| | | |
| | | if (window.rcmail) |
| | | { |
| | | rcmail.addEventListener('init', function(evt) |
| | | { |
| | | if (rcmail.env.task == 'settings') { |
| | | rcmail.register_command('plugin.enigma', function() { rcmail.goto_url('plugin.enigma') }, true); |
| | | rcmail.register_command('plugin.enigma-key-import', function() { rcmail.enigma_key_import() }, true); |
| | | rcmail.register_command('plugin.enigma-key-export', function() { rcmail.enigma_key_export() }, true); |
| | | |
| | | if (rcmail.gui_objects.keyslist) |
| | | { |
| | | var p = rcmail; |
| | | rcmail.keys_list = new rcube_list_widget(rcmail.gui_objects.keyslist, |
| | | {multiselect:false, draggable:false, keyboard:false}); |
| | | rcmail.keys_list.addEventListener('select', function(o){ p.enigma_key_select(o); }); |
| | | rcmail.keys_list.init(); |
| | | rcmail.keys_list.focus(); |
| | | |
| | | rcmail.enigma_list(); |
| | | |
| | | rcmail.register_command('firstpage', function(props) {return rcmail.enigma_list_page('first'); }); |
| | | rcmail.register_command('previouspage', function(props) {return rcmail.enigma_list_page('previous'); }); |
| | | rcmail.register_command('nextpage', function(props) {return rcmail.enigma_list_page('next'); }); |
| | | rcmail.register_command('lastpage', function(props) {return rcmail.enigma_list_page('last'); }); |
| | | } |
| | | |
| | | if (rcmail.env.action == 'edit-prefs') { |
| | | rcmail.register_command('search', function(props) {return rcmail.enigma_search(props); }, true); |
| | | rcmail.register_command('reset-search', function(props) {return rcmail.enigma_search_reset(props); }, true); |
| | | } |
| | | else if (rcmail.env.action == 'plugin.enigma') { |
| | | rcmail.register_command('plugin.enigma-import', function() { rcmail.enigma_import() }, true); |
| | | rcmail.register_command('plugin.enigma-export', function() { rcmail.enigma_export() }, true); |
| | | } |
| | | } |
| | | }); |
| | | } |
| | | |
| | | /*********************************************************/ |
| | | /********* Enigma Settings/Keys/Certs UI *********/ |
| | | /*********************************************************/ |
| | | |
| | | // Display key(s) import form |
| | | rcube_webmail.prototype.enigma_key_import = function() |
| | | { |
| | | this.enigma_loadframe(null, '&_a=keyimport'); |
| | | }; |
| | | |
| | | // Submit key(s) form |
| | | rcube_webmail.prototype.enigma_import = function() |
| | | { |
| | | var form, file; |
| | | if (form = this.gui_objects.importform) { |
| | | file = document.getElementById('rcmimportfile'); |
| | | if (file && !file.value) { |
| | | alert(this.get_label('selectimportfile')); |
| | | return; |
| | | } |
| | | form.submit(); |
| | | this.set_busy(true, 'importwait'); |
| | | this.lock_form(form, true); |
| | | } |
| | | }; |
| | | |
| | | // list row selection handler |
| | | rcube_webmail.prototype.enigma_key_select = function(list) |
| | | { |
| | | var id; |
| | | if (id = list.get_single_selection()) |
| | | this.enigma_loadframe(id); |
| | | }; |
| | | |
| | | // load key frame |
| | | rcube_webmail.prototype.enigma_loadframe = function(id, url) |
| | | { |
| | | var frm, win; |
| | | if (this.env.contentframe && window.frames && (frm = window.frames[this.env.contentframe])) { |
| | | if (!id && !url && (win = window.frames[this.env.contentframe])) { |
| | | if (win.location && win.location.href.indexOf(this.env.blankpage)<0) |
| | | win.location.href = this.env.blankpage; |
| | | return; |
| | | } |
| | | this.set_busy(true); |
| | | if (!url) |
| | | url = '&_a=keyinfo&_id='+id; |
| | | frm.location.href = this.env.comm_path+'&_action=plugin.enigma&_framed=1' + url; |
| | | } |
| | | }; |
| | | |
| | | // Search keys/certs |
| | | rcube_webmail.prototype.enigma_search = function(props) |
| | | { |
| | | if (!props && this.gui_objects.qsearchbox) |
| | | props = this.gui_objects.qsearchbox.value; |
| | | |
| | | if (props || this.env.search_request) { |
| | | var params = {'_a': 'keysearch', '_q': urlencode(props)}, |
| | | lock = this.set_busy(true, 'searching'); |
| | | // if (this.gui_objects.search_filter) |
| | | // addurl += '&_filter=' + this.gui_objects.search_filter.value; |
| | | this.env.current_page = 1; |
| | | this.enigma_loadframe(); |
| | | this.enigma_clear_list(); |
| | | this.http_post('plugin.enigma', params, lock); |
| | | } |
| | | |
| | | return false; |
| | | } |
| | | |
| | | // Reset search filter and the list |
| | | rcube_webmail.prototype.enigma_search_reset = function(props) |
| | | { |
| | | var s = this.env.search_request; |
| | | this.reset_qsearch(); |
| | | |
| | | if (s) { |
| | | this.enigma_loadframe(); |
| | | this.enigma_clear_list(); |
| | | |
| | | // refresh the list |
| | | this.enigma_list(); |
| | | } |
| | | |
| | | return false; |
| | | } |
| | | |
| | | // Keys/certs listing |
| | | rcube_webmail.prototype.enigma_list = function(page) |
| | | { |
| | | var params = {'_a': 'keylist'}, |
| | | lock = this.set_busy(true, 'loading'); |
| | | |
| | | this.env.current_page = page ? page : 1; |
| | | |
| | | if (this.env.search_request) |
| | | params._q = this.env.search_request; |
| | | if (page) |
| | | params._p = page; |
| | | |
| | | this.enigma_clear_list(); |
| | | this.http_post('plugin.enigma', params, lock); |
| | | } |
| | | |
| | | // Change list page |
| | | rcube_webmail.prototype.enigma_list_page = function(page) |
| | | { |
| | | if (page == 'next') |
| | | page = this.env.current_page + 1; |
| | | else if (page == 'last') |
| | | page = this.env.pagecount; |
| | | else if (page == 'prev' && this.env.current_page > 1) |
| | | page = this.env.current_page - 1; |
| | | else if (page == 'first' && this.env.current_page > 1) |
| | | page = 1; |
| | | |
| | | this.enigma_list(page); |
| | | } |
| | | |
| | | // Remove list rows |
| | | rcube_webmail.prototype.enigma_clear_list = function() |
| | | { |
| | | this.enigma_loadframe(); |
| | | if (this.keys_list) |
| | | this.keys_list.clear(true); |
| | | } |
| | | |
| | | // Adds a row to the list |
| | | rcube_webmail.prototype.enigma_add_list_row = function(r) |
| | | { |
| | | if (!this.gui_objects.keyslist || !this.keys_list) |
| | | return false; |
| | | |
| | | var list = this.keys_list, |
| | | tbody = this.gui_objects.keyslist.tBodies[0], |
| | | rowcount = tbody.rows.length, |
| | | even = rowcount%2, |
| | | css_class = 'message' |
| | | + (even ? ' even' : ' odd'), |
| | | // for performance use DOM instead of jQuery here |
| | | row = document.createElement('tr'), |
| | | col = document.createElement('td'); |
| | | |
| | | row.id = 'rcmrow' + r.id; |
| | | row.className = css_class; |
| | | |
| | | col.innerHTML = r.name; |
| | | row.appendChild(col); |
| | | list.insert_row(row); |
| | | } |
| | | |
| | | /*********************************************************/ |
| | | /********* Enigma Message methods *********/ |
| | | /*********************************************************/ |
| | | |
| | | // Import attached keys/certs file |
| | | rcube_webmail.prototype.enigma_import_attachment = function(mime_id) |
| | | { |
| | | var lock = this.set_busy(true, 'loading'); |
| | | this.http_post('plugin.enigmaimport', '_uid='+this.env.uid+'&_mbox=' |
| | | +urlencode(this.env.mailbox)+'&_part='+urlencode(mime_id), lock); |
| | | |
| | | return false; |
| | | }; |
| | | |
New file |
| | |
| | | <?php |
| | | /* |
| | | +-------------------------------------------------------------------------+ |
| | | | Enigma Plugin for Roundcube | |
| | | | Version 0.1 | |
| | | | | |
| | | | This program is free software; you can redistribute it and/or modify | |
| | | | it under the terms of the GNU General Public License version 2 | |
| | | | as published by the Free Software Foundation. | |
| | | | | |
| | | | This program is distributed in the hope that it will be useful, | |
| | | | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| | | | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
| | | | GNU General Public License for more details. | |
| | | | | |
| | | | You should have received a copy of the GNU General Public License along | |
| | | | with this program; if not, write to the Free Software Foundation, Inc., | |
| | | | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. | |
| | | | | |
| | | +-------------------------------------------------------------------------+ |
| | | | Author: Aleksander Machniak <alec@alec.pl> | |
| | | +-------------------------------------------------------------------------+ |
| | | */ |
| | | |
| | | /* |
| | | This class contains only hooks and action handlers. |
| | | Most plugin logic is placed in enigma_engine and enigma_ui classes. |
| | | */ |
| | | |
| | | class enigma extends rcube_plugin |
| | | { |
| | | public $task = 'mail|settings'; |
| | | public $rc; |
| | | public $engine; |
| | | |
| | | private $env_loaded; |
| | | private $message; |
| | | private $keys_parts = array(); |
| | | private $keys_bodies = array(); |
| | | |
| | | |
| | | /** |
| | | * Plugin initialization. |
| | | */ |
| | | function init() |
| | | { |
| | | $rcmail = rcmail::get_instance(); |
| | | $this->rc = $rcmail; |
| | | |
| | | if ($this->rc->task == 'mail') { |
| | | // message parse/display hooks |
| | | $this->add_hook('message_part_structure', array($this, 'parse_structure')); |
| | | $this->add_hook('message_body_prefix', array($this, 'status_message')); |
| | | |
| | | // message displaying |
| | | if ($rcmail->action == 'show' || $rcmail->action == 'preview') { |
| | | $this->add_hook('message_load', array($this, 'message_load')); |
| | | $this->add_hook('template_object_messagebody', array($this, 'message_output')); |
| | | $this->register_action('plugin.enigmaimport', array($this, 'import_file')); |
| | | } |
| | | // message composing |
| | | else if ($rcmail->action == 'compose') { |
| | | $this->load_ui(); |
| | | $this->ui->init($section); |
| | | } |
| | | // message sending (and draft storing) |
| | | else if ($rcmail->action == 'sendmail') { |
| | | //$this->add_hook('outgoing_message_body', array($this, 'msg_encode')); |
| | | //$this->add_hook('outgoing_message_body', array($this, 'msg_sign')); |
| | | } |
| | | } |
| | | else if ($this->rc->task == 'settings') { |
| | | // add hooks for Enigma settings |
| | | $this->add_hook('preferences_sections_list', array($this, 'preferences_section')); |
| | | $this->add_hook('preferences_list', array($this, 'preferences_list')); |
| | | $this->add_hook('preferences_save', array($this, 'preferences_save')); |
| | | |
| | | // register handler for keys/certs management |
| | | $this->register_action('plugin.enigma', array($this, 'preferences_ui')); |
| | | |
| | | // grab keys/certs management iframe requests |
| | | $section = get_input_value('_section', RCUBE_INPUT_GET); |
| | | if ($this->rc->action == 'edit-prefs' && preg_match('/^enigma(certs|keys)/', $section)) { |
| | | $this->load_ui(); |
| | | $this->ui->init($section); |
| | | } |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * Plugin environment initialization. |
| | | */ |
| | | function load_env() |
| | | { |
| | | if ($this->env_loaded) |
| | | return; |
| | | |
| | | $this->env_loaded = true; |
| | | |
| | | // Add include path for Enigma classes and drivers |
| | | $include_path = $this->home . '/lib' . PATH_SEPARATOR; |
| | | $include_path .= ini_get('include_path'); |
| | | set_include_path($include_path); |
| | | |
| | | // load the Enigma plugin configuration |
| | | $this->load_config(); |
| | | |
| | | // include localization (if wasn't included before) |
| | | $this->add_texts('localization/'); |
| | | } |
| | | |
| | | /** |
| | | * Plugin UI initialization. |
| | | */ |
| | | function load_ui() |
| | | { |
| | | if ($this->ui) |
| | | return; |
| | | |
| | | // load config/localization |
| | | $this->load_env(); |
| | | |
| | | // Load UI |
| | | $this->ui = new enigma_ui($this, $this->home); |
| | | } |
| | | |
| | | /** |
| | | * Plugin engine initialization. |
| | | */ |
| | | function load_engine() |
| | | { |
| | | if ($this->engine) |
| | | return; |
| | | |
| | | // load config/localization |
| | | $this->load_env(); |
| | | |
| | | $this->engine = new enigma_engine($this); |
| | | } |
| | | |
| | | /** |
| | | * Handler for message_part_structure hook. |
| | | * Called for every part of the message. |
| | | * |
| | | * @param array Original parameters |
| | | * |
| | | * @return array Modified parameters |
| | | */ |
| | | function parse_structure($p) |
| | | { |
| | | $struct = $p['structure']; |
| | | |
| | | if ($p['mimetype'] == 'text/plain' || $p['mimetype'] == 'application/pgp') { |
| | | $this->parse_plain($p); |
| | | } |
| | | else if ($p['mimetype'] == 'multipart/signed') { |
| | | $this->parse_signed($p); |
| | | } |
| | | else if ($p['mimetype'] == 'multipart/encrypted') { |
| | | $this->parse_encrypted($p); |
| | | } |
| | | else if ($p['mimetype'] == 'application/pkcs7-mime') { |
| | | $this->parse_encrypted($p); |
| | | } |
| | | |
| | | return $p; |
| | | } |
| | | |
| | | /** |
| | | * Handler for preferences_sections_list hook. |
| | | * Adds Enigma settings sections into preferences sections list. |
| | | * |
| | | * @param array Original parameters |
| | | * |
| | | * @return array Modified parameters |
| | | */ |
| | | function preferences_section($p) |
| | | { |
| | | // add labels |
| | | $this->add_texts('localization/'); |
| | | |
| | | $p['list']['enigmasettings'] = array( |
| | | 'id' => 'enigmasettings', 'section' => $this->gettext('enigmasettings'), |
| | | ); |
| | | $p['list']['enigmacerts'] = array( |
| | | 'id' => 'enigmacerts', 'section' => $this->gettext('enigmacerts'), |
| | | ); |
| | | $p['list']['enigmakeys'] = array( |
| | | 'id' => 'enigmakeys', 'section' => $this->gettext('enigmakeys'), |
| | | ); |
| | | |
| | | return $p; |
| | | } |
| | | |
| | | /** |
| | | * Handler for preferences_list hook. |
| | | * Adds options blocks into Enigma settings sections in Preferences. |
| | | * |
| | | * @param array Original parameters |
| | | * |
| | | * @return array Modified parameters |
| | | */ |
| | | function preferences_list($p) |
| | | { |
| | | if ($p['section'] == 'enigmasettings') { |
| | | // This makes that section is not removed from the list |
| | | $p['blocks']['dummy']['options']['dummy'] = array(); |
| | | } |
| | | else if ($p['section'] == 'enigmacerts') { |
| | | // This makes that section is not removed from the list |
| | | $p['blocks']['dummy']['options']['dummy'] = array(); |
| | | } |
| | | else if ($p['section'] == 'enigmakeys') { |
| | | // This makes that section is not removed from the list |
| | | $p['blocks']['dummy']['options']['dummy'] = array(); |
| | | } |
| | | |
| | | return $p; |
| | | } |
| | | |
| | | /** |
| | | * Handler for preferences_save hook. |
| | | * Executed on Enigma settings form submit. |
| | | * |
| | | * @param array Original parameters |
| | | * |
| | | * @return array Modified parameters |
| | | */ |
| | | function preferences_save($p) |
| | | { |
| | | if ($p['section'] == 'enigmasettings') { |
| | | $a['prefs'] = array( |
| | | // 'dummy' => get_input_value('_dummy', RCUBE_INPUT_POST), |
| | | ); |
| | | } |
| | | |
| | | return $p; |
| | | } |
| | | |
| | | /** |
| | | * Handler for keys/certs management UI template. |
| | | */ |
| | | function preferences_ui() |
| | | { |
| | | $this->load_ui(); |
| | | $this->ui->init(); |
| | | } |
| | | |
| | | /** |
| | | * Handler for message_body_prefix hook. |
| | | * Called for every displayed (content) part of the message. |
| | | * Adds infobox about signature verification and/or decryption |
| | | * status above the body. |
| | | * |
| | | * @param array Original parameters |
| | | * |
| | | * @return array Modified parameters |
| | | */ |
| | | function status_message($p) |
| | | { |
| | | $part_id = $p['part']->mime_id; |
| | | |
| | | // skip: not a message part |
| | | if ($p['part'] instanceof rcube_message) |
| | | return $p; |
| | | |
| | | // skip: message has no signed/encoded content |
| | | if (!$this->engine) |
| | | return $p; |
| | | |
| | | // Decryption status |
| | | if (isset($this->engine->decryptions[$part_id])) { |
| | | |
| | | // get decryption status |
| | | $status = $this->engine->decryptions[$part_id]; |
| | | |
| | | // Load UI and add css script |
| | | $this->load_ui(); |
| | | $this->ui->add_css(); |
| | | |
| | | // display status info |
| | | $attrib['id'] = 'enigma-message'; |
| | | |
| | | if ($status instanceof enigma_error) { |
| | | $attrib['class'] = 'enigmaerror'; |
| | | $code = $status->getCode(); |
| | | if ($code == enigma_error::E_KEYNOTFOUND) |
| | | $msg = Q(str_replace('$keyid', enigma_key::format_id($status->getData('id')), |
| | | $this->gettext('decryptnokey'))); |
| | | else if ($code == enigma_error::E_BADPASS) |
| | | $msg = Q($this->gettext('decryptbadpass')); |
| | | else |
| | | $msg = Q($this->gettext('decrypterror')); |
| | | } |
| | | else { |
| | | $attrib['class'] = 'enigmanotice'; |
| | | $msg = Q($this->gettext('decryptok')); |
| | | } |
| | | |
| | | $p['prefix'] .= html::div($attrib, $msg); |
| | | } |
| | | |
| | | // Signature verification status |
| | | if (isset($this->engine->signed_parts[$part_id]) |
| | | && ($sig = $this->engine->signatures[$this->engine->signed_parts[$part_id]]) |
| | | ) { |
| | | // add css script |
| | | $this->load_ui(); |
| | | $this->ui->add_css(); |
| | | |
| | | // display status info |
| | | $attrib['id'] = 'enigma-message'; |
| | | |
| | | if ($sig instanceof enigma_signature) { |
| | | if ($sig->valid) { |
| | | $attrib['class'] = 'enigmanotice'; |
| | | $sender = ($sig->name ? $sig->name . ' ' : '') . '<' . $sig->email . '>'; |
| | | $msg = Q(str_replace('$sender', $sender, $this->gettext('sigvalid'))); |
| | | } |
| | | else { |
| | | $attrib['class'] = 'enigmawarning'; |
| | | $sender = ($sig->name ? $sig->name . ' ' : '') . '<' . $sig->email . '>'; |
| | | $msg = Q(str_replace('$sender', $sender, $this->gettext('siginvalid'))); |
| | | } |
| | | } |
| | | else if ($sig->getCode() == enigma_error::E_KEYNOTFOUND) { |
| | | $attrib['class'] = 'enigmawarning'; |
| | | $msg = Q(str_replace('$keyid', enigma_key::format_id($sig->getData('id')), |
| | | $this->gettext('signokey'))); |
| | | } |
| | | else { |
| | | $attrib['class'] = 'enigmaerror'; |
| | | $msg = Q($this->gettext('sigerror')); |
| | | } |
| | | /* |
| | | $msg .= ' ' . html::a(array('href' => "#sigdetails", |
| | | 'onclick' => JS_OBJECT_NAME.".command('enigma-sig-details')"), |
| | | Q($this->gettext('showdetails'))); |
| | | */ |
| | | // test |
| | | // $msg .= '<br /><pre>'.$sig->body.'</pre>'; |
| | | |
| | | $p['prefix'] .= html::div($attrib, $msg); |
| | | |
| | | // Display each signature message only once |
| | | unset($this->engine->signatures[$this->engine->signed_parts[$part_id]]); |
| | | } |
| | | |
| | | return $p; |
| | | } |
| | | |
| | | /** |
| | | * Handler for plain/text message. |
| | | * |
| | | * @param array Reference to hook's parameters (see enigma::parse_structure()) |
| | | */ |
| | | private function parse_plain(&$p) |
| | | { |
| | | $this->load_engine(); |
| | | $this->engine->parse_plain($p); |
| | | } |
| | | |
| | | /** |
| | | * Handler for multipart/signed message. |
| | | * Verifies signature. |
| | | * |
| | | * @param array Reference to hook's parameters (see enigma::parse_structure()) |
| | | */ |
| | | private function parse_signed(&$p) |
| | | { |
| | | $this->load_engine(); |
| | | $this->engine->parse_signed($p); |
| | | } |
| | | |
| | | /** |
| | | * Handler for multipart/encrypted and application/pkcs7-mime message. |
| | | * |
| | | * @param array Reference to hook's parameters (see enigma::parse_structure()) |
| | | */ |
| | | private function parse_encrypted(&$p) |
| | | { |
| | | $this->load_engine(); |
| | | $this->engine->parse_encrypted($p); |
| | | } |
| | | |
| | | /** |
| | | * Handler for message_load hook. |
| | | * Check message bodies and attachments for keys/certs. |
| | | */ |
| | | function message_load($p) |
| | | { |
| | | $this->message = $p['object']; |
| | | |
| | | // handle attachments vcard attachments |
| | | foreach ((array)$this->message->attachments as $attachment) { |
| | | if ($this->is_keys_part($attachment)) { |
| | | $this->keys_parts[] = $attachment->mime_id; |
| | | } |
| | | } |
| | | // the same with message bodies |
| | | foreach ((array)$this->message->parts as $idx => $part) { |
| | | if ($this->is_keys_part($part)) { |
| | | $this->keys_parts[] = $part->mime_id; |
| | | $this->keys_bodies[] = $part->mime_id; |
| | | } |
| | | } |
| | | // @TODO: inline PGP keys |
| | | |
| | | if ($this->keys_parts) { |
| | | $this->add_texts('localization'); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * Handler for template_object_messagebody hook. |
| | | * This callback function adds a box below the message content |
| | | * if there is a key/cert attachment available |
| | | */ |
| | | function message_output($p) |
| | | { |
| | | $attach_script = false; |
| | | |
| | | foreach ($this->keys_parts as $part) { |
| | | |
| | | // remove part's body |
| | | if (in_array($part, $this->keys_bodies)) |
| | | $p['content'] = ''; |
| | | |
| | | $style = "margin:0 1em; padding:0.2em 0.5em; border:1px solid #999; width: auto" |
| | | ." border-radius:4px; -moz-border-radius:4px; -webkit-border-radius:4px"; |
| | | |
| | | // add box below messsage body |
| | | $p['content'] .= html::p(array('style' => $style), |
| | | html::a(array( |
| | | 'href' => "#", |
| | | 'onclick' => "return ".JS_OBJECT_NAME.".enigma_import_attachment('".JQ($part)."')", |
| | | 'title' => $this->gettext('keyattimport')), |
| | | html::img(array('src' => $this->url('skins/default/key_add.png'), 'style' => "vertical-align:middle"))) |
| | | . ' ' . html::span(null, $this->gettext('keyattfound'))); |
| | | |
| | | $attach_script = true; |
| | | } |
| | | |
| | | if ($attach_script) { |
| | | $this->include_script('enigma.js'); |
| | | } |
| | | |
| | | return $p; |
| | | } |
| | | |
| | | /** |
| | | * Handler for attached keys/certs import |
| | | */ |
| | | function import_file() |
| | | { |
| | | $this->load_engine(); |
| | | $this->engine->import_file(); |
| | | } |
| | | |
| | | /** |
| | | * Checks if specified message part is a PGP-key or S/MIME cert data |
| | | * |
| | | * @param rcube_message_part Part object |
| | | * |
| | | * @return boolean True if part is a key/cert |
| | | */ |
| | | private function is_keys_part($part) |
| | | { |
| | | // @TODO: S/MIME |
| | | return ( |
| | | // Content-Type: application/pgp-keys |
| | | $part->mimetype == 'application/pgp-keys' |
| | | ); |
| | | } |
| | | } |
New file |
| | |
| | | Order allow,deny |
| | | Deny from all |
New file |
| | |
| | | <?php |
| | | |
| | | /* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */ |
| | | |
| | | /** |
| | | * Crypt_GPG is a package to use GPG from PHP |
| | | * |
| | | * This package provides an object oriented interface to GNU Privacy |
| | | * Guard (GPG). It requires the GPG executable to be on the system. |
| | | * |
| | | * Though GPG can support symmetric-key cryptography, this package is intended |
| | | * only to facilitate public-key cryptography. |
| | | * |
| | | * This file contains the main GPG class. The class in this file lets you |
| | | * encrypt, decrypt, sign and verify data; import and delete keys; and perform |
| | | * other useful GPG tasks. |
| | | * |
| | | * Example usage: |
| | | * <code> |
| | | * <?php |
| | | * // encrypt some data |
| | | * $gpg = new Crypt_GPG(); |
| | | * $gpg->addEncryptKey($mySecretKeyId); |
| | | * $encryptedData = $gpg->encrypt($data); |
| | | * ?> |
| | | * </code> |
| | | * |
| | | * PHP version 5 |
| | | * |
| | | * LICENSE: |
| | | * |
| | | * This library is free software; you can redistribute it and/or modify |
| | | * it under the terms of the GNU Lesser General Public License as |
| | | * published by the Free Software Foundation; either version 2.1 of the |
| | | * License, or (at your option) any later version. |
| | | * |
| | | * This library is distributed in the hope that it will be useful, |
| | | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| | | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| | | * Lesser General Public License for more details. |
| | | * |
| | | * You should have received a copy of the GNU Lesser General Public |
| | | * License along with this library; if not, write to the Free Software |
| | | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
| | | * |
| | | * @category Encryption |
| | | * @package Crypt_GPG |
| | | * @author Nathan Fredrickson <nathan@silverorange.com> |
| | | * @author Michael Gauthier <mike@silverorange.com> |
| | | * @copyright 2005-2010 silverorange |
| | | * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1 |
| | | * @version CVS: $Id: GPG.php 302814 2010-08-26 15:43:07Z gauthierm $ |
| | | * @link http://pear.php.net/package/Crypt_GPG |
| | | * @link http://pear.php.net/manual/en/package.encryption.crypt-gpg.php |
| | | * @link http://www.gnupg.org/ |
| | | */ |
| | | |
| | | /** |
| | | * Signature handler class |
| | | */ |
| | | require_once 'Crypt/GPG/VerifyStatusHandler.php'; |
| | | |
| | | /** |
| | | * Decryption handler class |
| | | */ |
| | | require_once 'Crypt/GPG/DecryptStatusHandler.php'; |
| | | |
| | | /** |
| | | * GPG key class |
| | | */ |
| | | require_once 'Crypt/GPG/Key.php'; |
| | | |
| | | /** |
| | | * GPG sub-key class |
| | | */ |
| | | require_once 'Crypt/GPG/SubKey.php'; |
| | | |
| | | /** |
| | | * GPG user id class |
| | | */ |
| | | require_once 'Crypt/GPG/UserId.php'; |
| | | |
| | | /** |
| | | * GPG process and I/O engine class |
| | | */ |
| | | require_once 'Crypt/GPG/Engine.php'; |
| | | |
| | | /** |
| | | * GPG exception classes |
| | | */ |
| | | require_once 'Crypt/GPG/Exceptions.php'; |
| | | |
| | | // {{{ class Crypt_GPG |
| | | |
| | | /** |
| | | * A class to use GPG from PHP |
| | | * |
| | | * This class provides an object oriented interface to GNU Privacy Guard (GPG). |
| | | * |
| | | * Though GPG can support symmetric-key cryptography, this class is intended |
| | | * only to facilitate public-key cryptography. |
| | | * |
| | | * @category Encryption |
| | | * @package Crypt_GPG |
| | | * @author Nathan Fredrickson <nathan@silverorange.com> |
| | | * @author Michael Gauthier <mike@silverorange.com> |
| | | * @copyright 2005-2010 silverorange |
| | | * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1 |
| | | * @link http://pear.php.net/package/Crypt_GPG |
| | | * @link http://www.gnupg.org/ |
| | | */ |
| | | class Crypt_GPG |
| | | { |
| | | // {{{ class error constants |
| | | |
| | | /** |
| | | * Error code returned when there is no error. |
| | | */ |
| | | const ERROR_NONE = 0; |
| | | |
| | | /** |
| | | * Error code returned when an unknown or unhandled error occurs. |
| | | */ |
| | | const ERROR_UNKNOWN = 1; |
| | | |
| | | /** |
| | | * Error code returned when a bad passphrase is used. |
| | | */ |
| | | const ERROR_BAD_PASSPHRASE = 2; |
| | | |
| | | /** |
| | | * Error code returned when a required passphrase is missing. |
| | | */ |
| | | const ERROR_MISSING_PASSPHRASE = 3; |
| | | |
| | | /** |
| | | * Error code returned when a key that is already in the keyring is |
| | | * imported. |
| | | */ |
| | | const ERROR_DUPLICATE_KEY = 4; |
| | | |
| | | /** |
| | | * Error code returned the required data is missing for an operation. |
| | | * |
| | | * This could be missing key data, missing encrypted data or missing |
| | | * signature data. |
| | | */ |
| | | const ERROR_NO_DATA = 5; |
| | | |
| | | /** |
| | | * Error code returned when an unsigned key is used. |
| | | */ |
| | | const ERROR_UNSIGNED_KEY = 6; |
| | | |
| | | /** |
| | | * Error code returned when a key that is not self-signed is used. |
| | | */ |
| | | const ERROR_NOT_SELF_SIGNED = 7; |
| | | |
| | | /** |
| | | * Error code returned when a public or private key that is not in the |
| | | * keyring is used. |
| | | */ |
| | | const ERROR_KEY_NOT_FOUND = 8; |
| | | |
| | | /** |
| | | * Error code returned when an attempt to delete public key having a |
| | | * private key is made. |
| | | */ |
| | | const ERROR_DELETE_PRIVATE_KEY = 9; |
| | | |
| | | /** |
| | | * Error code returned when one or more bad signatures are detected. |
| | | */ |
| | | const ERROR_BAD_SIGNATURE = 10; |
| | | |
| | | /** |
| | | * Error code returned when there is a problem reading GnuPG data files. |
| | | */ |
| | | const ERROR_FILE_PERMISSIONS = 11; |
| | | |
| | | // }}} |
| | | // {{{ class constants for data signing modes |
| | | |
| | | /** |
| | | * Signing mode for normal signing of data. The signed message will not |
| | | * be readable without special software. |
| | | * |
| | | * This is the default signing mode. |
| | | * |
| | | * @see Crypt_GPG::sign() |
| | | * @see Crypt_GPG::signFile() |
| | | */ |
| | | const SIGN_MODE_NORMAL = 1; |
| | | |
| | | /** |
| | | * Signing mode for clearsigning data. Clearsigned signatures are ASCII |
| | | * armored data and are readable without special software. If the signed |
| | | * message is unencrypted, the message will still be readable. The message |
| | | * text will be in the original encoding. |
| | | * |
| | | * @see Crypt_GPG::sign() |
| | | * @see Crypt_GPG::signFile() |
| | | */ |
| | | const SIGN_MODE_CLEAR = 2; |
| | | |
| | | /** |
| | | * Signing mode for creating a detached signature. When using detached |
| | | * signatures, only the signature data is returned. The original message |
| | | * text may be distributed separately from the signature data. This is |
| | | * useful for miltipart/signed email messages as per |
| | | * {@link http://www.ietf.org/rfc/rfc3156.txt RFC 3156}. |
| | | * |
| | | * @see Crypt_GPG::sign() |
| | | * @see Crypt_GPG::signFile() |
| | | */ |
| | | const SIGN_MODE_DETACHED = 3; |
| | | |
| | | // }}} |
| | | // {{{ class constants for fingerprint formats |
| | | |
| | | /** |
| | | * No formatting is performed. |
| | | * |
| | | * Example: C3BC615AD9C766E5A85C1F2716D27458B1BBA1C4 |
| | | * |
| | | * @see Crypt_GPG::getFingerprint() |
| | | */ |
| | | const FORMAT_NONE = 1; |
| | | |
| | | /** |
| | | * Fingerprint is formatted in the format used by the GnuPG gpg command's |
| | | * default output. |
| | | * |
| | | * Example: C3BC 615A D9C7 66E5 A85C 1F27 16D2 7458 B1BB A1C4 |
| | | * |
| | | * @see Crypt_GPG::getFingerprint() |
| | | */ |
| | | const FORMAT_CANONICAL = 2; |
| | | |
| | | /** |
| | | * Fingerprint is formatted in the format used when displaying X.509 |
| | | * certificates |
| | | * |
| | | * Example: C3:BC:61:5A:D9:C7:66:E5:A8:5C:1F:27:16:D2:74:58:B1:BB:A1:C4 |
| | | * |
| | | * @see Crypt_GPG::getFingerprint() |
| | | */ |
| | | const FORMAT_X509 = 3; |
| | | |
| | | // }}} |
| | | // {{{ other class constants |
| | | |
| | | /** |
| | | * URI at which package bugs may be reported. |
| | | */ |
| | | const BUG_URI = 'http://pear.php.net/bugs/report.php?package=Crypt_GPG'; |
| | | |
| | | // }}} |
| | | // {{{ protected class properties |
| | | |
| | | /** |
| | | * Engine used to control the GPG subprocess |
| | | * |
| | | * @var Crypt_GPG_Engine |
| | | * |
| | | * @see Crypt_GPG::setEngine() |
| | | */ |
| | | protected $engine = null; |
| | | |
| | | /** |
| | | * Keys used to encrypt |
| | | * |
| | | * The array is of the form: |
| | | * <code> |
| | | * array( |
| | | * $key_id => array( |
| | | * 'fingerprint' => $fingerprint, |
| | | * 'passphrase' => null |
| | | * ) |
| | | * ); |
| | | * </code> |
| | | * |
| | | * @var array |
| | | * @see Crypt_GPG::addEncryptKey() |
| | | * @see Crypt_GPG::clearEncryptKeys() |
| | | */ |
| | | protected $encryptKeys = array(); |
| | | |
| | | /** |
| | | * Keys used to decrypt |
| | | * |
| | | * The array is of the form: |
| | | * <code> |
| | | * array( |
| | | * $key_id => array( |
| | | * 'fingerprint' => $fingerprint, |
| | | * 'passphrase' => $passphrase |
| | | * ) |
| | | * ); |
| | | * </code> |
| | | * |
| | | * @var array |
| | | * @see Crypt_GPG::addSignKey() |
| | | * @see Crypt_GPG::clearSignKeys() |
| | | */ |
| | | protected $signKeys = array(); |
| | | |
| | | /** |
| | | * Keys used to sign |
| | | * |
| | | * The array is of the form: |
| | | * <code> |
| | | * array( |
| | | * $key_id => array( |
| | | * 'fingerprint' => $fingerprint, |
| | | * 'passphrase' => $passphrase |
| | | * ) |
| | | * ); |
| | | * </code> |
| | | * |
| | | * @var array |
| | | * @see Crypt_GPG::addDecryptKey() |
| | | * @see Crypt_GPG::clearDecryptKeys() |
| | | */ |
| | | protected $decryptKeys = array(); |
| | | |
| | | // }}} |
| | | // {{{ __construct() |
| | | |
| | | /** |
| | | * Creates a new GPG object |
| | | * |
| | | * Available options are: |
| | | * |
| | | * - <kbd>string homedir</kbd> - the directory where the GPG |
| | | * keyring files are stored. If not |
| | | * specified, Crypt_GPG uses the |
| | | * default of <kbd>~/.gnupg</kbd>. |
| | | * - <kbd>string publicKeyring</kbd> - the file path of the public |
| | | * keyring. Use this if the public |
| | | * keyring is not in the homedir, or |
| | | * if the keyring is in a directory |
| | | * not writable by the process |
| | | * invoking GPG (like Apache). Then |
| | | * you can specify the path to the |
| | | * keyring with this option |
| | | * (/foo/bar/pubring.gpg), and specify |
| | | * a writable directory (like /tmp) |
| | | * using the <i>homedir</i> option. |
| | | * - <kbd>string privateKeyring</kbd> - the file path of the private |
| | | * keyring. Use this if the private |
| | | * keyring is not in the homedir, or |
| | | * if the keyring is in a directory |
| | | * not writable by the process |
| | | * invoking GPG (like Apache). Then |
| | | * you can specify the path to the |
| | | * keyring with this option |
| | | * (/foo/bar/secring.gpg), and specify |
| | | * a writable directory (like /tmp) |
| | | * using the <i>homedir</i> option. |
| | | * - <kbd>string trustDb</kbd> - the file path of the web-of-trust |
| | | * database. Use this if the trust |
| | | * database is not in the homedir, or |
| | | * if the database is in a directory |
| | | * not writable by the process |
| | | * invoking GPG (like Apache). Then |
| | | * you can specify the path to the |
| | | * trust database with this option |
| | | * (/foo/bar/trustdb.gpg), and specify |
| | | * a writable directory (like /tmp) |
| | | * using the <i>homedir</i> option. |
| | | * - <kbd>string binary</kbd> - the location of the GPG binary. If |
| | | * not specified, the driver attempts |
| | | * to auto-detect the GPG binary |
| | | * location using a list of known |
| | | * default locations for the current |
| | | * operating system. The option |
| | | * <kbd>gpgBinary</kbd> is a |
| | | * deprecated alias for this option. |
| | | * - <kbd>boolean debug</kbd> - whether or not to use debug mode. |
| | | * When debug mode is on, all |
| | | * communication to and from the GPG |
| | | * subprocess is logged. This can be |
| | | * |
| | | * @param array $options optional. An array of options used to create the |
| | | * GPG object. All options are optional and are |
| | | * represented as key-value pairs. |
| | | * |
| | | * @throws Crypt_GPG_FileException if the <kbd>homedir</kbd> does not exist |
| | | * and cannot be created. This can happen if <kbd>homedir</kbd> is |
| | | * not specified, Crypt_GPG is run as the web user, and the web |
| | | * user has no home directory. This exception is also thrown if any |
| | | * of the options <kbd>publicKeyring</kbd>, |
| | | * <kbd>privateKeyring</kbd> or <kbd>trustDb</kbd> options are |
| | | * specified but the files do not exist or are are not readable. |
| | | * This can happen if the user running the Crypt_GPG process (for |
| | | * example, the Apache user) does not have permission to read the |
| | | * files. |
| | | * |
| | | * @throws PEAR_Exception if the provided <kbd>binary</kbd> is invalid, or |
| | | * if no <kbd>binary</kbd> is provided and no suitable binary could |
| | | * be found. |
| | | */ |
| | | public function __construct(array $options = array()) |
| | | { |
| | | $this->setEngine(new Crypt_GPG_Engine($options)); |
| | | } |
| | | |
| | | // }}} |
| | | // {{{ importKey() |
| | | |
| | | /** |
| | | * Imports a public or private key into the keyring |
| | | * |
| | | * Keys may be removed from the keyring using |
| | | * {@link Crypt_GPG::deletePublicKey()} or |
| | | * {@link Crypt_GPG::deletePrivateKey()}. |
| | | * |
| | | * @param string $data the key data to be imported. |
| | | * |
| | | * @return array an associative array containing the following elements: |
| | | * - <kbd>fingerprint</kbd> - the fingerprint of the |
| | | * imported key, |
| | | * - <kbd>public_imported</kbd> - the number of public |
| | | * keys imported, |
| | | * - <kbd>public_unchanged</kbd> - the number of unchanged |
| | | * public keys, |
| | | * - <kbd>private_imported</kbd> - the number of private |
| | | * keys imported, |
| | | * - <kbd>private_unchanged</kbd> - the number of unchanged |
| | | * private keys. |
| | | * |
| | | * @throws Crypt_GPG_NoDataException if the key data is missing or if the |
| | | * data is is not valid key data. |
| | | * |
| | | * @throws Crypt_GPG_Exception if an unknown or unexpected error occurs. |
| | | * Use the <kbd>debug</kbd> option and file a bug report if these |
| | | * exceptions occur. |
| | | */ |
| | | public function importKey($data) |
| | | { |
| | | return $this->_importKey($data, false); |
| | | } |
| | | |
| | | // }}} |
| | | // {{{ importKeyFile() |
| | | |
| | | /** |
| | | * Imports a public or private key file into the keyring |
| | | * |
| | | * Keys may be removed from the keyring using |
| | | * {@link Crypt_GPG::deletePublicKey()} or |
| | | * {@link Crypt_GPG::deletePrivateKey()}. |
| | | * |
| | | * @param string $filename the key file to be imported. |
| | | * |
| | | * @return array an associative array containing the following elements: |
| | | * - <kbd>fingerprint</kbd> - the fingerprint of the |
| | | * imported key, |
| | | * - <kbd>public_imported</kbd> - the number of public |
| | | * keys imported, |
| | | * - <kbd>public_unchanged</kbd> - the number of unchanged |
| | | * public keys, |
| | | * - <kbd>private_imported</kbd> - the number of private |
| | | * keys imported, |
| | | * - <kbd>private_unchanged</kbd> - the number of unchanged |
| | | * private keys. |
| | | * private keys. |
| | | * |
| | | * @throws Crypt_GPG_NoDataException if the key data is missing or if the |
| | | * data is is not valid key data. |
| | | * |
| | | * @throws Crypt_GPG_FileException if the key file is not readable. |
| | | * |
| | | * @throws Crypt_GPG_Exception if an unknown or unexpected error occurs. |
| | | * Use the <kbd>debug</kbd> option and file a bug report if these |
| | | * exceptions occur. |
| | | */ |
| | | public function importKeyFile($filename) |
| | | { |
| | | return $this->_importKey($filename, true); |
| | | } |
| | | |
| | | // }}} |
| | | // {{{ exportPublicKey() |
| | | |
| | | /** |
| | | * Exports a public key from the keyring |
| | | * |
| | | * The exported key remains on the keyring. To delete the public key, use |
| | | * {@link Crypt_GPG::deletePublicKey()}. |
| | | * |
| | | * If more than one key fingerprint is available for the specified |
| | | * <kbd>$keyId</kbd> (for example, if you use a non-unique uid) only the |
| | | * first public key is exported. |
| | | * |
| | | * @param string $keyId either the full uid of the public key, the email |
| | | * part of the uid of the public key or the key id of |
| | | * the public key. For example, |
| | | * "Test User (example) <test@example.com>", |
| | | * "test@example.com" or a hexadecimal string. |
| | | * @param boolean $armor optional. If true, ASCII armored data is returned; |
| | | * otherwise, binary data is returned. Defaults to |
| | | * true. |
| | | * |
| | | * @return string the public key data. |
| | | * |
| | | * @throws Crypt_GPG_KeyNotFoundException if a public key with the given |
| | | * <kbd>$keyId</kbd> is not found. |
| | | * |
| | | * @throws Crypt_GPG_Exception if an unknown or unexpected error occurs. |
| | | * Use the <kbd>debug</kbd> option and file a bug report if these |
| | | * exceptions occur. |
| | | */ |
| | | public function exportPublicKey($keyId, $armor = true) |
| | | { |
| | | $fingerprint = $this->getFingerprint($keyId); |
| | | |
| | | if ($fingerprint === null) { |
| | | throw new Crypt_GPG_KeyNotFoundException( |
| | | 'Public key not found: ' . $keyId, |
| | | Crypt_GPG::ERROR_KEY_NOT_FOUND, $keyId); |
| | | } |
| | | |
| | | $keyData = ''; |
| | | $operation = '--export ' . escapeshellarg($fingerprint); |
| | | $arguments = ($armor) ? array('--armor') : array(); |
| | | |
| | | $this->engine->reset(); |
| | | $this->engine->setOutput($keyData); |
| | | $this->engine->setOperation($operation, $arguments); |
| | | $this->engine->run(); |
| | | |
| | | $code = $this->engine->getErrorCode(); |
| | | |
| | | if ($code !== Crypt_GPG::ERROR_NONE) { |
| | | throw new Crypt_GPG_Exception( |
| | | 'Unknown error exporting public key. Please use the ' . |
| | | '\'debug\' option when creating the Crypt_GPG object, and ' . |
| | | 'file a bug report at ' . self::BUG_URI, $code); |
| | | } |
| | | |
| | | return $keyData; |
| | | } |
| | | |
| | | // }}} |
| | | // {{{ deletePublicKey() |
| | | |
| | | /** |
| | | * Deletes a public key from the keyring |
| | | * |
| | | * If more than one key fingerprint is available for the specified |
| | | * <kbd>$keyId</kbd> (for example, if you use a non-unique uid) only the |
| | | * first public key is deleted. |
| | | * |
| | | * The private key must be deleted first or an exception will be thrown. |
| | | * See {@link Crypt_GPG::deletePrivateKey()}. |
| | | * |
| | | * @param string $keyId either the full uid of the public key, the email |
| | | * part of the uid of the public key or the key id of |
| | | * the public key. For example, |
| | | * "Test User (example) <test@example.com>", |
| | | * "test@example.com" or a hexadecimal string. |
| | | * |
| | | * @return void |
| | | * |
| | | * @throws Crypt_GPG_KeyNotFoundException if a public key with the given |
| | | * <kbd>$keyId</kbd> is not found. |
| | | * |
| | | * @throws Crypt_GPG_DeletePrivateKeyException if the specified public key |
| | | * has an associated private key on the keyring. The private key |
| | | * must be deleted first. |
| | | * |
| | | * @throws Crypt_GPG_Exception if an unknown or unexpected error occurs. |
| | | * Use the <kbd>debug</kbd> option and file a bug report if these |
| | | * exceptions occur. |
| | | */ |
| | | public function deletePublicKey($keyId) |
| | | { |
| | | $fingerprint = $this->getFingerprint($keyId); |
| | | |
| | | if ($fingerprint === null) { |
| | | throw new Crypt_GPG_KeyNotFoundException( |
| | | 'Public key not found: ' . $keyId, |
| | | Crypt_GPG::ERROR_KEY_NOT_FOUND, $keyId); |
| | | } |
| | | |
| | | $operation = '--delete-key ' . escapeshellarg($fingerprint); |
| | | $arguments = array( |
| | | '--batch', |
| | | '--yes' |
| | | ); |
| | | |
| | | $this->engine->reset(); |
| | | $this->engine->setOperation($operation, $arguments); |
| | | $this->engine->run(); |
| | | |
| | | $code = $this->engine->getErrorCode(); |
| | | |
| | | switch ($code) { |
| | | case Crypt_GPG::ERROR_NONE: |
| | | break; |
| | | case Crypt_GPG::ERROR_DELETE_PRIVATE_KEY: |
| | | throw new Crypt_GPG_DeletePrivateKeyException( |
| | | 'Private key must be deleted before public key can be ' . |
| | | 'deleted.', $code, $keyId); |
| | | default: |
| | | throw new Crypt_GPG_Exception( |
| | | 'Unknown error deleting public key. Please use the ' . |
| | | '\'debug\' option when creating the Crypt_GPG object, and ' . |
| | | 'file a bug report at ' . self::BUG_URI, $code); |
| | | } |
| | | } |
| | | |
| | | // }}} |
| | | // {{{ deletePrivateKey() |
| | | |
| | | /** |
| | | * Deletes a private key from the keyring |
| | | * |
| | | * If more than one key fingerprint is available for the specified |
| | | * <kbd>$keyId</kbd> (for example, if you use a non-unique uid) only the |
| | | * first private key is deleted. |
| | | * |
| | | * Calls GPG with the <kbd>--delete-secret-key</kbd> command. |
| | | * |
| | | * @param string $keyId either the full uid of the private key, the email |
| | | * part of the uid of the private key or the key id of |
| | | * the private key. For example, |
| | | * "Test User (example) <test@example.com>", |
| | | * "test@example.com" or a hexadecimal string. |
| | | * |
| | | * @return void |
| | | * |
| | | * @throws Crypt_GPG_KeyNotFoundException if a private key with the given |
| | | * <kbd>$keyId</kbd> is not found. |
| | | * |
| | | * @throws Crypt_GPG_Exception if an unknown or unexpected error occurs. |
| | | * Use the <kbd>debug</kbd> option and file a bug report if these |
| | | * exceptions occur. |
| | | */ |
| | | public function deletePrivateKey($keyId) |
| | | { |
| | | $fingerprint = $this->getFingerprint($keyId); |
| | | |
| | | if ($fingerprint === null) { |
| | | throw new Crypt_GPG_KeyNotFoundException( |
| | | 'Private key not found: ' . $keyId, |
| | | Crypt_GPG::ERROR_KEY_NOT_FOUND, $keyId); |
| | | } |
| | | |
| | | $operation = '--delete-secret-key ' . escapeshellarg($fingerprint); |
| | | $arguments = array( |
| | | '--batch', |
| | | '--yes' |
| | | ); |
| | | |
| | | $this->engine->reset(); |
| | | $this->engine->setOperation($operation, $arguments); |
| | | $this->engine->run(); |
| | | |
| | | $code = $this->engine->getErrorCode(); |
| | | |
| | | switch ($code) { |
| | | case Crypt_GPG::ERROR_NONE: |
| | | break; |
| | | case Crypt_GPG::ERROR_KEY_NOT_FOUND: |
| | | throw new Crypt_GPG_KeyNotFoundException( |
| | | 'Private key not found: ' . $keyId, |
| | | $code, $keyId); |
| | | default: |
| | | throw new Crypt_GPG_Exception( |
| | | 'Unknown error deleting private key. Please use the ' . |
| | | '\'debug\' option when creating the Crypt_GPG object, and ' . |
| | | 'file a bug report at ' . self::BUG_URI, $code); |
| | | } |
| | | } |
| | | |
| | | // }}} |
| | | // {{{ getKeys() |
| | | |
| | | /** |
| | | * Gets the available keys in the keyring |
| | | * |
| | | * Calls GPG with the <kbd>--list-keys</kbd> command and grabs keys. See |
| | | * the first section of <b>doc/DETAILS</b> in the |
| | | * {@link http://www.gnupg.org/download/ GPG package} for a detailed |
| | | * description of how the GPG command output is parsed. |
| | | * |
| | | * @param string $keyId optional. Only keys with that match the specified |
| | | * pattern are returned. The pattern may be part of |
| | | * a user id, a key id or a key fingerprint. If not |
| | | * specified, all keys are returned. |
| | | * |
| | | * @return array an array of {@link Crypt_GPG_Key} objects. If no keys |
| | | * match the specified <kbd>$keyId</kbd> an empty array is |
| | | * returned. |
| | | * |
| | | * @throws Crypt_GPG_Exception if an unknown or unexpected error occurs. |
| | | * Use the <kbd>debug</kbd> option and file a bug report if these |
| | | * exceptions occur. |
| | | * |
| | | * @see Crypt_GPG_Key |
| | | */ |
| | | public function getKeys($keyId = '') |
| | | { |
| | | // get private key fingerprints |
| | | if ($keyId == '') { |
| | | $operation = '--list-secret-keys'; |
| | | } else { |
| | | $operation = '--list-secret-keys ' . escapeshellarg($keyId); |
| | | } |
| | | |
| | | // According to The file 'doc/DETAILS' in the GnuPG distribution, using |
| | | // double '--with-fingerprint' also prints the fingerprint for subkeys. |
| | | $arguments = array( |
| | | '--with-colons', |
| | | '--with-fingerprint', |
| | | '--with-fingerprint', |
| | | '--fixed-list-mode' |
| | | ); |
| | | |
| | | $output = ''; |
| | | |
| | | $this->engine->reset(); |
| | | $this->engine->setOutput($output); |
| | | $this->engine->setOperation($operation, $arguments); |
| | | $this->engine->run(); |
| | | |
| | | $code = $this->engine->getErrorCode(); |
| | | |
| | | switch ($code) { |
| | | case Crypt_GPG::ERROR_NONE: |
| | | case Crypt_GPG::ERROR_KEY_NOT_FOUND: |
| | | // ignore not found key errors |
| | | break; |
| | | case Crypt_GPG::ERROR_FILE_PERMISSIONS: |
| | | $filename = $this->engine->getErrorFilename(); |
| | | if ($filename) { |
| | | throw new Crypt_GPG_FileException(sprintf( |
| | | 'Error reading GnuPG data file \'%s\'. Check to make ' . |
| | | 'sure it is readable by the current user.', $filename), |
| | | $code, $filename); |
| | | } |
| | | throw new Crypt_GPG_FileException( |
| | | 'Error reading GnuPG data file. Check to make GnuPG data ' . |
| | | 'files are readable by the current user.', $code); |
| | | default: |
| | | throw new Crypt_GPG_Exception( |
| | | 'Unknown error getting keys. Please use the \'debug\' option ' . |
| | | 'when creating the Crypt_GPG object, and file a bug report ' . |
| | | 'at ' . self::BUG_URI, $code); |
| | | } |
| | | |
| | | $privateKeyFingerprints = array(); |
| | | |
| | | $lines = explode(PHP_EOL, $output); |
| | | foreach ($lines as $line) { |
| | | $lineExp = explode(':', $line); |
| | | if ($lineExp[0] == 'fpr') { |
| | | $privateKeyFingerprints[] = $lineExp[9]; |
| | | } |
| | | } |
| | | |
| | | // get public keys |
| | | if ($keyId == '') { |
| | | $operation = '--list-public-keys'; |
| | | } else { |
| | | $operation = '--list-public-keys ' . escapeshellarg($keyId); |
| | | } |
| | | |
| | | $output = ''; |
| | | |
| | | $this->engine->reset(); |
| | | $this->engine->setOutput($output); |
| | | $this->engine->setOperation($operation, $arguments); |
| | | $this->engine->run(); |
| | | |
| | | $code = $this->engine->getErrorCode(); |
| | | |
| | | switch ($code) { |
| | | case Crypt_GPG::ERROR_NONE: |
| | | case Crypt_GPG::ERROR_KEY_NOT_FOUND: |
| | | // ignore not found key errors |
| | | break; |
| | | case Crypt_GPG::ERROR_FILE_PERMISSIONS: |
| | | $filename = $this->engine->getErrorFilename(); |
| | | if ($filename) { |
| | | throw new Crypt_GPG_FileException(sprintf( |
| | | 'Error reading GnuPG data file \'%s\'. Check to make ' . |
| | | 'sure it is readable by the current user.', $filename), |
| | | $code, $filename); |
| | | } |
| | | throw new Crypt_GPG_FileException( |
| | | 'Error reading GnuPG data file. Check to make GnuPG data ' . |
| | | 'files are readable by the current user.', $code); |
| | | default: |
| | | throw new Crypt_GPG_Exception( |
| | | 'Unknown error getting keys. Please use the \'debug\' option ' . |
| | | 'when creating the Crypt_GPG object, and file a bug report ' . |
| | | 'at ' . self::BUG_URI, $code); |
| | | } |
| | | |
| | | $keys = array(); |
| | | |
| | | $key = null; // current key |
| | | $subKey = null; // current sub-key |
| | | |
| | | $lines = explode(PHP_EOL, $output); |
| | | foreach ($lines as $line) { |
| | | $lineExp = explode(':', $line); |
| | | |
| | | if ($lineExp[0] == 'pub') { |
| | | |
| | | // new primary key means last key should be added to the array |
| | | if ($key !== null) { |
| | | $keys[] = $key; |
| | | } |
| | | |
| | | $key = new Crypt_GPG_Key(); |
| | | |
| | | $subKey = Crypt_GPG_SubKey::parse($line); |
| | | $key->addSubKey($subKey); |
| | | |
| | | } elseif ($lineExp[0] == 'sub') { |
| | | |
| | | $subKey = Crypt_GPG_SubKey::parse($line); |
| | | $key->addSubKey($subKey); |
| | | |
| | | } elseif ($lineExp[0] == 'fpr') { |
| | | |
| | | $fingerprint = $lineExp[9]; |
| | | |
| | | // set current sub-key fingerprint |
| | | $subKey->setFingerprint($fingerprint); |
| | | |
| | | // if private key exists, set has private to true |
| | | if (in_array($fingerprint, $privateKeyFingerprints)) { |
| | | $subKey->setHasPrivate(true); |
| | | } |
| | | |
| | | } elseif ($lineExp[0] == 'uid') { |
| | | |
| | | $string = stripcslashes($lineExp[9]); // as per documentation |
| | | $userId = new Crypt_GPG_UserId($string); |
| | | |
| | | if ($lineExp[1] == 'r') { |
| | | $userId->setRevoked(true); |
| | | } |
| | | |
| | | $key->addUserId($userId); |
| | | |
| | | } |
| | | } |
| | | |
| | | // add last key |
| | | if ($key !== null) { |
| | | $keys[] = $key; |
| | | } |
| | | |
| | | return $keys; |
| | | } |
| | | |
| | | // }}} |
| | | // {{{ getFingerprint() |
| | | |
| | | /** |
| | | * Gets a key fingerprint from the keyring |
| | | * |
| | | * If more than one key fingerprint is available (for example, if you use |
| | | * a non-unique user id) only the first key fingerprint is returned. |
| | | * |
| | | * Calls the GPG <kbd>--list-keys</kbd> command with the |
| | | * <kbd>--with-fingerprint</kbd> option to retrieve a public key |
| | | * fingerprint. |
| | | * |
| | | * @param string $keyId either the full user id of the key, the email |
| | | * part of the user id of the key, or the key id of |
| | | * the key. For example, |
| | | * "Test User (example) <test@example.com>", |
| | | * "test@example.com" or a hexadecimal string. |
| | | * @param integer $format optional. How the fingerprint should be formatted. |
| | | * Use {@link Crypt_GPG::FORMAT_X509} for X.509 |
| | | * certificate format, |
| | | * {@link Crypt_GPG::FORMAT_CANONICAL} for the format |
| | | * used by GnuPG output and |
| | | * {@link Crypt_GPG::FORMAT_NONE} for no formatting. |
| | | * Defaults to <code>Crypt_GPG::FORMAT_NONE</code>. |
| | | * |
| | | * @return string the fingerprint of the key, or null if no fingerprint |
| | | * is found for the given <kbd>$keyId</kbd>. |
| | | * |
| | | * @throws Crypt_GPG_Exception if an unknown or unexpected error occurs. |
| | | * Use the <kbd>debug</kbd> option and file a bug report if these |
| | | * exceptions occur. |
| | | */ |
| | | public function getFingerprint($keyId, $format = Crypt_GPG::FORMAT_NONE) |
| | | { |
| | | $output = ''; |
| | | $operation = '--list-keys ' . escapeshellarg($keyId); |
| | | $arguments = array( |
| | | '--with-colons', |
| | | '--with-fingerprint' |
| | | ); |
| | | |
| | | $this->engine->reset(); |
| | | $this->engine->setOutput($output); |
| | | $this->engine->setOperation($operation, $arguments); |
| | | $this->engine->run(); |
| | | |
| | | $code = $this->engine->getErrorCode(); |
| | | |
| | | switch ($code) { |
| | | case Crypt_GPG::ERROR_NONE: |
| | | case Crypt_GPG::ERROR_KEY_NOT_FOUND: |
| | | // ignore not found key errors |
| | | break; |
| | | default: |
| | | throw new Crypt_GPG_Exception( |
| | | 'Unknown error getting key fingerprint. Please use the ' . |
| | | '\'debug\' option when creating the Crypt_GPG object, and ' . |
| | | 'file a bug report at ' . self::BUG_URI, $code); |
| | | } |
| | | |
| | | $fingerprint = null; |
| | | |
| | | $lines = explode(PHP_EOL, $output); |
| | | foreach ($lines as $line) { |
| | | if (substr($line, 0, 3) == 'fpr') { |
| | | $lineExp = explode(':', $line); |
| | | $fingerprint = $lineExp[9]; |
| | | |
| | | switch ($format) { |
| | | case Crypt_GPG::FORMAT_CANONICAL: |
| | | $fingerprintExp = str_split($fingerprint, 4); |
| | | $format = '%s %s %s %s %s %s %s %s %s %s'; |
| | | $fingerprint = vsprintf($format, $fingerprintExp); |
| | | break; |
| | | |
| | | case Crypt_GPG::FORMAT_X509: |
| | | $fingerprintExp = str_split($fingerprint, 2); |
| | | $fingerprint = implode(':', $fingerprintExp); |
| | | break; |
| | | } |
| | | |
| | | break; |
| | | } |
| | | } |
| | | |
| | | return $fingerprint; |
| | | } |
| | | |
| | | // }}} |
| | | // {{{ encrypt() |
| | | |
| | | /** |
| | | * Encrypts string data |
| | | * |
| | | * Data is ASCII armored by default but may optionally be returned as |
| | | * binary. |
| | | * |
| | | * @param string $data the data to be encrypted. |
| | | * @param boolean $armor optional. If true, ASCII armored data is returned; |
| | | * otherwise, binary data is returned. Defaults to |
| | | * true. |
| | | * |
| | | * @return string the encrypted data. |
| | | * |
| | | * @throws Crypt_GPG_KeyNotFoundException if no encryption key is specified. |
| | | * See {@link Crypt_GPG::addEncryptKey()}. |
| | | * |
| | | * @throws Crypt_GPG_Exception if an unknown or unexpected error occurs. |
| | | * Use the <kbd>debug</kbd> option and file a bug report if these |
| | | * exceptions occur. |
| | | * |
| | | * @sensitive $data |
| | | */ |
| | | public function encrypt($data, $armor = true) |
| | | { |
| | | return $this->_encrypt($data, false, null, $armor); |
| | | } |
| | | |
| | | // }}} |
| | | // {{{ encryptFile() |
| | | |
| | | /** |
| | | * Encrypts a file |
| | | * |
| | | * Encrypted data is ASCII armored by default but may optionally be saved |
| | | * as binary. |
| | | * |
| | | * @param string $filename the filename of the file to encrypt. |
| | | * @param string $encryptedFile optional. The filename of the file in |
| | | * which to store the encrypted data. If null |
| | | * or unspecified, the encrypted data is |
| | | * returned as a string. |
| | | * @param boolean $armor optional. If true, ASCII armored data is |
| | | * returned; otherwise, binary data is |
| | | * returned. Defaults to true. |
| | | * |
| | | * @return void|string if the <kbd>$encryptedFile</kbd> parameter is null, |
| | | * a string containing the encrypted data is returned. |
| | | * |
| | | * @throws Crypt_GPG_KeyNotFoundException if no encryption key is specified. |
| | | * See {@link Crypt_GPG::addEncryptKey()}. |
| | | * |
| | | * @throws Crypt_GPG_FileException if the output file is not writeable or |
| | | * if the input file is not readable. |
| | | * |
| | | * @throws Crypt_GPG_Exception if an unknown or unexpected error occurs. |
| | | * Use the <kbd>debug</kbd> option and file a bug report if these |
| | | * exceptions occur. |
| | | */ |
| | | public function encryptFile($filename, $encryptedFile = null, $armor = true) |
| | | { |
| | | return $this->_encrypt($filename, true, $encryptedFile, $armor); |
| | | } |
| | | |
| | | // }}} |
| | | // {{{ encryptAndSign() |
| | | |
| | | /** |
| | | * Encrypts and signs data |
| | | * |
| | | * Data is encrypted and signed in a single pass. |
| | | * |
| | | * NOTE: Until GnuPG version 1.4.10, it was not possible to verify |
| | | * encrypted-signed data without decrypting it at the same time. If you try |
| | | * to use {@link Crypt_GPG::verify()} method on encrypted-signed data with |
| | | * earlier GnuPG versions, you will get an error. Please use |
| | | * {@link Crypt_GPG::decryptAndVerify()} to verify encrypted-signed data. |
| | | * |
| | | * @param string $data the data to be encrypted and signed. |
| | | * @param boolean $armor optional. If true, ASCII armored data is returned; |
| | | * otherwise, binary data is returned. Defaults to |
| | | * true. |
| | | * |
| | | * @return string the encrypted signed data. |
| | | * |
| | | * @throws Crypt_GPG_KeyNotFoundException if no encryption key is specified |
| | | * or if no signing key is specified. See |
| | | * {@link Crypt_GPG::addEncryptKey()} and |
| | | * {@link Crypt_GPG::addSignKey()}. |
| | | * |
| | | * @throws Crypt_GPG_BadPassphraseException if a specified passphrase is |
| | | * incorrect or if a required passphrase is not specified. |
| | | * |
| | | * @throws Crypt_GPG_Exception if an unknown or unexpected error occurs. |
| | | * Use the <kbd>debug</kbd> option and file a bug report if these |
| | | * exceptions occur. |
| | | * |
| | | * @see Crypt_GPG::decryptAndVerify() |
| | | */ |
| | | public function encryptAndSign($data, $armor = true) |
| | | { |
| | | return $this->_encryptAndSign($data, false, null, $armor); |
| | | } |
| | | |
| | | // }}} |
| | | // {{{ encryptAndSignFile() |
| | | |
| | | /** |
| | | * Encrypts and signs a file |
| | | * |
| | | * The file is encrypted and signed in a single pass. |
| | | * |
| | | * NOTE: Until GnuPG version 1.4.10, it was not possible to verify |
| | | * encrypted-signed files without decrypting them at the same time. If you |
| | | * try to use {@link Crypt_GPG::verify()} method on encrypted-signed files |
| | | * with earlier GnuPG versions, you will get an error. Please use |
| | | * {@link Crypt_GPG::decryptAndVerifyFile()} to verify encrypted-signed |
| | | * files. |
| | | * |
| | | * @param string $filename the name of the file containing the data to |
| | | * be encrypted and signed. |
| | | * @param string $signedFile optional. The name of the file in which the |
| | | * encrypted, signed data should be stored. If |
| | | * null or unspecified, the encrypted, signed |
| | | * data is returned as a string. |
| | | * @param boolean $armor optional. If true, ASCII armored data is |
| | | * returned; otherwise, binary data is returned. |
| | | * Defaults to true. |
| | | * |
| | | * @return void|string if the <kbd>$signedFile</kbd> parameter is null, a |
| | | * string containing the encrypted, signed data is |
| | | * returned. |
| | | * |
| | | * @throws Crypt_GPG_KeyNotFoundException if no encryption key is specified |
| | | * or if no signing key is specified. See |
| | | * {@link Crypt_GPG::addEncryptKey()} and |
| | | * {@link Crypt_GPG::addSignKey()}. |
| | | * |
| | | * @throws Crypt_GPG_BadPassphraseException if a specified passphrase is |
| | | * incorrect or if a required passphrase is not specified. |
| | | * |
| | | * @throws Crypt_GPG_FileException if the output file is not writeable or |
| | | * if the input file is not readable. |
| | | * |
| | | * @throws Crypt_GPG_Exception if an unknown or unexpected error occurs. |
| | | * Use the <kbd>debug</kbd> option and file a bug report if these |
| | | * exceptions occur. |
| | | * |
| | | * @see Crypt_GPG::decryptAndVerifyFile() |
| | | */ |
| | | public function encryptAndSignFile($filename, $signedFile = null, |
| | | $armor = true |
| | | ) { |
| | | return $this->_encryptAndSign($filename, true, $signedFile, $armor); |
| | | } |
| | | |
| | | // }}} |
| | | // {{{ decrypt() |
| | | |
| | | /** |
| | | * Decrypts string data |
| | | * |
| | | * This method assumes the required private key is available in the keyring |
| | | * and throws an exception if the private key is not available. To add a |
| | | * private key to the keyring, use the {@link Crypt_GPG::importKey()} or |
| | | * {@link Crypt_GPG::importKeyFile()} methods. |
| | | * |
| | | * @param string $encryptedData the data to be decrypted. |
| | | * |
| | | * @return string the decrypted data. |
| | | * |
| | | * @throws Crypt_GPG_KeyNotFoundException if the private key needed to |
| | | * decrypt the data is not in the user's keyring. |
| | | * |
| | | * @throws Crypt_GPG_NoDataException if specified data does not contain |
| | | * GPG encrypted data. |
| | | * |
| | | * @throws Crypt_GPG_BadPassphraseException if a required passphrase is |
| | | * incorrect or if a required passphrase is not specified. See |
| | | * {@link Crypt_GPG::addDecryptKey()}. |
| | | * |
| | | * @throws Crypt_GPG_Exception if an unknown or unexpected error occurs. |
| | | * Use the <kbd>debug</kbd> option and file a bug report if these |
| | | * exceptions occur. |
| | | */ |
| | | public function decrypt($encryptedData) |
| | | { |
| | | return $this->_decrypt($encryptedData, false, null); |
| | | } |
| | | |
| | | // }}} |
| | | // {{{ decryptFile() |
| | | |
| | | /** |
| | | * Decrypts a file |
| | | * |
| | | * This method assumes the required private key is available in the keyring |
| | | * and throws an exception if the private key is not available. To add a |
| | | * private key to the keyring, use the {@link Crypt_GPG::importKey()} or |
| | | * {@link Crypt_GPG::importKeyFile()} methods. |
| | | * |
| | | * @param string $encryptedFile the name of the encrypted file data to |
| | | * decrypt. |
| | | * @param string $decryptedFile optional. The name of the file to which the |
| | | * decrypted data should be written. If null |
| | | * or unspecified, the decrypted data is |
| | | * returned as a string. |
| | | * |
| | | * @return void|string if the <kbd>$decryptedFile</kbd> parameter is null, |
| | | * a string containing the decrypted data is returned. |
| | | * |
| | | * @throws Crypt_GPG_KeyNotFoundException if the private key needed to |
| | | * decrypt the data is not in the user's keyring. |
| | | * |
| | | * @throws Crypt_GPG_NoDataException if specified data does not contain |
| | | * GPG encrypted data. |
| | | * |
| | | * @throws Crypt_GPG_BadPassphraseException if a required passphrase is |
| | | * incorrect or if a required passphrase is not specified. See |
| | | * {@link Crypt_GPG::addDecryptKey()}. |
| | | * |
| | | * @throws Crypt_GPG_FileException if the output file is not writeable or |
| | | * if the input file is not readable. |
| | | * |
| | | * @throws Crypt_GPG_Exception if an unknown or unexpected error occurs. |
| | | * Use the <kbd>debug</kbd> option and file a bug report if these |
| | | * exceptions occur. |
| | | */ |
| | | public function decryptFile($encryptedFile, $decryptedFile = null) |
| | | { |
| | | return $this->_decrypt($encryptedFile, true, $decryptedFile); |
| | | } |
| | | |
| | | // }}} |
| | | // {{{ decryptAndVerify() |
| | | |
| | | /** |
| | | * Decrypts and verifies string data |
| | | * |
| | | * This method assumes the required private key is available in the keyring |
| | | * and throws an exception if the private key is not available. To add a |
| | | * private key to the keyring, use the {@link Crypt_GPG::importKey()} or |
| | | * {@link Crypt_GPG::importKeyFile()} methods. |
| | | * |
| | | * @param string $encryptedData the encrypted, signed data to be decrypted |
| | | * and verified. |
| | | * |
| | | * @return array two element array. The array has an element 'data' |
| | | * containing the decrypted data and an element |
| | | * 'signatures' containing an array of |
| | | * {@link Crypt_GPG_Signature} objects for the signed data. |
| | | * |
| | | * @throws Crypt_GPG_KeyNotFoundException if the private key needed to |
| | | * decrypt the data is not in the user's keyring. |
| | | * |
| | | * @throws Crypt_GPG_NoDataException if specified data does not contain |
| | | * GPG encrypted data. |
| | | * |
| | | * @throws Crypt_GPG_BadPassphraseException if a required passphrase is |
| | | * incorrect or if a required passphrase is not specified. See |
| | | * {@link Crypt_GPG::addDecryptKey()}. |
| | | * |
| | | * @throws Crypt_GPG_Exception if an unknown or unexpected error occurs. |
| | | * Use the <kbd>debug</kbd> option and file a bug report if these |
| | | * exceptions occur. |
| | | */ |
| | | public function decryptAndVerify($encryptedData) |
| | | { |
| | | return $this->_decryptAndVerify($encryptedData, false, null); |
| | | } |
| | | |
| | | // }}} |
| | | // {{{ decryptAndVerifyFile() |
| | | |
| | | /** |
| | | * Decrypts and verifies a signed, encrypted file |
| | | * |
| | | * This method assumes the required private key is available in the keyring |
| | | * and throws an exception if the private key is not available. To add a |
| | | * private key to the keyring, use the {@link Crypt_GPG::importKey()} or |
| | | * {@link Crypt_GPG::importKeyFile()} methods. |
| | | * |
| | | * @param string $encryptedFile the name of the signed, encrypted file to |
| | | * to decrypt and verify. |
| | | * @param string $decryptedFile optional. The name of the file to which the |
| | | * decrypted data should be written. If null |
| | | * or unspecified, the decrypted data is |
| | | * returned in the results array. |
| | | * |
| | | * @return array two element array. The array has an element 'data' |
| | | * containing the decrypted data and an element |
| | | * 'signatures' containing an array of |
| | | * {@link Crypt_GPG_Signature} objects for the signed data. |
| | | * If the decrypted data is written to a file, the 'data' |
| | | * element is null. |
| | | * |
| | | * @throws Crypt_GPG_KeyNotFoundException if the private key needed to |
| | | * decrypt the data is not in the user's keyring. |
| | | * |
| | | * @throws Crypt_GPG_NoDataException if specified data does not contain |
| | | * GPG encrypted data. |
| | | * |
| | | * @throws Crypt_GPG_BadPassphraseException if a required passphrase is |
| | | * incorrect or if a required passphrase is not specified. See |
| | | * {@link Crypt_GPG::addDecryptKey()}. |
| | | * |
| | | * @throws Crypt_GPG_FileException if the output file is not writeable or |
| | | * if the input file is not readable. |
| | | * |
| | | * @throws Crypt_GPG_Exception if an unknown or unexpected error occurs. |
| | | * Use the <kbd>debug</kbd> option and file a bug report if these |
| | | * exceptions occur. |
| | | */ |
| | | public function decryptAndVerifyFile($encryptedFile, $decryptedFile = null) |
| | | { |
| | | return $this->_decryptAndVerify($encryptedFile, true, $decryptedFile); |
| | | } |
| | | |
| | | // }}} |
| | | // {{{ sign() |
| | | |
| | | /** |
| | | * Signs data |
| | | * |
| | | * Data may be signed using any one of the three available signing modes: |
| | | * - {@link Crypt_GPG::SIGN_MODE_NORMAL} |
| | | * - {@link Crypt_GPG::SIGN_MODE_CLEAR} |
| | | * - {@link Crypt_GPG::SIGN_MODE_DETACHED} |
| | | * |
| | | * @param string $data the data to be signed. |
| | | * @param boolean $mode optional. The data signing mode to use. Should |
| | | * be one of {@link Crypt_GPG::SIGN_MODE_NORMAL}, |
| | | * {@link Crypt_GPG::SIGN_MODE_CLEAR} or |
| | | * {@link Crypt_GPG::SIGN_MODE_DETACHED}. If not |
| | | * specified, defaults to |
| | | * <kbd>Crypt_GPG::SIGN_MODE_NORMAL</kbd>. |
| | | * @param boolean $armor optional. If true, ASCII armored data is |
| | | * returned; otherwise, binary data is returned. |
| | | * Defaults to true. This has no effect if the |
| | | * mode <kbd>Crypt_GPG::SIGN_MODE_CLEAR</kbd> is |
| | | * used. |
| | | * @param boolean $textmode optional. If true, line-breaks in signed data |
| | | * are normalized. Use this option when signing |
| | | * e-mail, or for greater compatibility between |
| | | * systems with different line-break formats. |
| | | * Defaults to false. This has no effect if the |
| | | * mode <kbd>Crypt_GPG::SIGN_MODE_CLEAR</kbd> is |
| | | * used as clear-signing always uses textmode. |
| | | * |
| | | * @return string the signed data, or the signature data if a detached |
| | | * signature is requested. |
| | | * |
| | | * @throws Crypt_GPG_KeyNotFoundException if no signing key is specified. |
| | | * See {@link Crypt_GPG::addSignKey()}. |
| | | * |
| | | * @throws Crypt_GPG_BadPassphraseException if a specified passphrase is |
| | | * incorrect or if a required passphrase is not specified. |
| | | * |
| | | * @throws Crypt_GPG_Exception if an unknown or unexpected error occurs. |
| | | * Use the <kbd>debug</kbd> option and file a bug report if these |
| | | * exceptions occur. |
| | | */ |
| | | public function sign($data, $mode = Crypt_GPG::SIGN_MODE_NORMAL, |
| | | $armor = true, $textmode = false |
| | | ) { |
| | | return $this->_sign($data, false, null, $mode, $armor, $textmode); |
| | | } |
| | | |
| | | // }}} |
| | | // {{{ signFile() |
| | | |
| | | /** |
| | | * Signs a file |
| | | * |
| | | * The file may be signed using any one of the three available signing |
| | | * modes: |
| | | * - {@link Crypt_GPG::SIGN_MODE_NORMAL} |
| | | * - {@link Crypt_GPG::SIGN_MODE_CLEAR} |
| | | * - {@link Crypt_GPG::SIGN_MODE_DETACHED} |
| | | * |
| | | * @param string $filename the name of the file containing the data to |
| | | * be signed. |
| | | * @param string $signedFile optional. The name of the file in which the |
| | | * signed data should be stored. If null or |
| | | * unspecified, the signed data is returned as a |
| | | * string. |
| | | * @param boolean $mode optional. The data signing mode to use. Should |
| | | * be one of {@link Crypt_GPG::SIGN_MODE_NORMAL}, |
| | | * {@link Crypt_GPG::SIGN_MODE_CLEAR} or |
| | | * {@link Crypt_GPG::SIGN_MODE_DETACHED}. If not |
| | | * specified, defaults to |
| | | * <kbd>Crypt_GPG::SIGN_MODE_NORMAL</kbd>. |
| | | * @param boolean $armor optional. If true, ASCII armored data is |
| | | * returned; otherwise, binary data is returned. |
| | | * Defaults to true. This has no effect if the |
| | | * mode <kbd>Crypt_GPG::SIGN_MODE_CLEAR</kbd> is |
| | | * used. |
| | | * @param boolean $textmode optional. If true, line-breaks in signed data |
| | | * are normalized. Use this option when signing |
| | | * e-mail, or for greater compatibility between |
| | | * systems with different line-break formats. |
| | | * Defaults to false. This has no effect if the |
| | | * mode <kbd>Crypt_GPG::SIGN_MODE_CLEAR</kbd> is |
| | | * used as clear-signing always uses textmode. |
| | | * |
| | | * @return void|string if the <kbd>$signedFile</kbd> parameter is null, a |
| | | * string containing the signed data (or the signature |
| | | * data if a detached signature is requested) is |
| | | * returned. |
| | | * |
| | | * @throws Crypt_GPG_KeyNotFoundException if no signing key is specified. |
| | | * See {@link Crypt_GPG::addSignKey()}. |
| | | * |
| | | * @throws Crypt_GPG_BadPassphraseException if a specified passphrase is |
| | | * incorrect or if a required passphrase is not specified. |
| | | * |
| | | * @throws Crypt_GPG_FileException if the output file is not writeable or |
| | | * if the input file is not readable. |
| | | * |
| | | * @throws Crypt_GPG_Exception if an unknown or unexpected error occurs. |
| | | * Use the <kbd>debug</kbd> option and file a bug report if these |
| | | * exceptions occur. |
| | | */ |
| | | public function signFile($filename, $signedFile = null, |
| | | $mode = Crypt_GPG::SIGN_MODE_NORMAL, $armor = true, $textmode = false |
| | | ) { |
| | | return $this->_sign( |
| | | $filename, |
| | | true, |
| | | $signedFile, |
| | | $mode, |
| | | $armor, |
| | | $textmode |
| | | ); |
| | | } |
| | | |
| | | // }}} |
| | | // {{{ verify() |
| | | |
| | | /** |
| | | * Verifies signed data |
| | | * |
| | | * The {@link Crypt_GPG::decrypt()} method may be used to get the original |
| | | * message if the signed data is not clearsigned and does not use a |
| | | * detached signature. |
| | | * |
| | | * @param string $signedData the signed data to be verified. |
| | | * @param string $signature optional. If verifying data signed using a |
| | | * detached signature, this must be the detached |
| | | * signature data. The data that was signed is |
| | | * specified in <kbd>$signedData</kbd>. |
| | | * |
| | | * @return array an array of {@link Crypt_GPG_Signature} objects for the |
| | | * signed data. For each signature that is valid, the |
| | | * {@link Crypt_GPG_Signature::isValid()} will return true. |
| | | * |
| | | * @throws Crypt_GPG_NoDataException if the provided data is not signed |
| | | * data. |
| | | * |
| | | * @throws Crypt_GPG_Exception if an unknown or unexpected error occurs. |
| | | * Use the <kbd>debug</kbd> option and file a bug report if these |
| | | * exceptions occur. |
| | | * |
| | | * @see Crypt_GPG_Signature |
| | | */ |
| | | public function verify($signedData, $signature = '') |
| | | { |
| | | return $this->_verify($signedData, false, $signature); |
| | | } |
| | | |
| | | // }}} |
| | | // {{{ verifyFile() |
| | | |
| | | /** |
| | | * Verifies a signed file |
| | | * |
| | | * The {@link Crypt_GPG::decryptFile()} method may be used to get the |
| | | * original message if the signed data is not clearsigned and does not use |
| | | * a detached signature. |
| | | * |
| | | * @param string $filename the signed file to be verified. |
| | | * @param string $signature optional. If verifying a file signed using a |
| | | * detached signature, this must be the detached |
| | | * signature data. The file that was signed is |
| | | * specified in <kbd>$filename</kbd>. |
| | | * |
| | | * @return array an array of {@link Crypt_GPG_Signature} objects for the |
| | | * signed data. For each signature that is valid, the |
| | | * {@link Crypt_GPG_Signature::isValid()} will return true. |
| | | * |
| | | * @throws Crypt_GPG_NoDataException if the provided data is not signed |
| | | * data. |
| | | * |
| | | * @throws Crypt_GPG_FileException if the input file is not readable. |
| | | * |
| | | * @throws Crypt_GPG_Exception if an unknown or unexpected error occurs. |
| | | * Use the <kbd>debug</kbd> option and file a bug report if these |
| | | * exceptions occur. |
| | | * |
| | | * @see Crypt_GPG_Signature |
| | | */ |
| | | public function verifyFile($filename, $signature = '') |
| | | { |
| | | return $this->_verify($filename, true, $signature); |
| | | } |
| | | |
| | | // }}} |
| | | // {{{ addDecryptKey() |
| | | |
| | | /** |
| | | * Adds a key to use for decryption |
| | | * |
| | | * @param mixed $key the key to use. This may be a key identifier, |
| | | * user id, fingerprint, {@link Crypt_GPG_Key} or |
| | | * {@link Crypt_GPG_SubKey}. The key must be able |
| | | * to encrypt. |
| | | * @param string $passphrase optional. The passphrase of the key required |
| | | * for decryption. |
| | | * |
| | | * @return void |
| | | * |
| | | * @see Crypt_GPG::decrypt() |
| | | * @see Crypt_GPG::decryptFile() |
| | | * @see Crypt_GPG::clearDecryptKeys() |
| | | * @see Crypt_GPG::_addKey() |
| | | * @see Crypt_GPG_DecryptStatusHandler |
| | | * |
| | | * @sensitive $passphrase |
| | | */ |
| | | public function addDecryptKey($key, $passphrase = null) |
| | | { |
| | | $this->_addKey($this->decryptKeys, true, false, $key, $passphrase); |
| | | } |
| | | |
| | | // }}} |
| | | // {{{ addEncryptKey() |
| | | |
| | | /** |
| | | * Adds a key to use for encryption |
| | | * |
| | | * @param mixed $key the key to use. This may be a key identifier, user id |
| | | * user id, fingerprint, {@link Crypt_GPG_Key} or |
| | | * {@link Crypt_GPG_SubKey}. The key must be able to |
| | | * encrypt. |
| | | * |
| | | * @return void |
| | | * |
| | | * @see Crypt_GPG::encrypt() |
| | | * @see Crypt_GPG::encryptFile() |
| | | * @see Crypt_GPG::clearEncryptKeys() |
| | | * @see Crypt_GPG::_addKey() |
| | | */ |
| | | public function addEncryptKey($key) |
| | | { |
| | | $this->_addKey($this->encryptKeys, true, false, $key); |
| | | } |
| | | |
| | | // }}} |
| | | // {{{ addSignKey() |
| | | |
| | | /** |
| | | * Adds a key to use for signing |
| | | * |
| | | * @param mixed $key the key to use. This may be a key identifier, |
| | | * user id, fingerprint, {@link Crypt_GPG_Key} or |
| | | * {@link Crypt_GPG_SubKey}. The key must be able |
| | | * to sign. |
| | | * @param string $passphrase optional. The passphrase of the key required |
| | | * for signing. |
| | | * |
| | | * @return void |
| | | * |
| | | * @see Crypt_GPG::sign() |
| | | * @see Crypt_GPG::signFile() |
| | | * @see Crypt_GPG::clearSignKeys() |
| | | * @see Crypt_GPG::handleSignStatus() |
| | | * @see Crypt_GPG::_addKey() |
| | | * |
| | | * @sensitive $passphrase |
| | | */ |
| | | public function addSignKey($key, $passphrase = null) |
| | | { |
| | | $this->_addKey($this->signKeys, false, true, $key, $passphrase); |
| | | } |
| | | |
| | | // }}} |
| | | // {{{ clearDecryptKeys() |
| | | |
| | | /** |
| | | * Clears all decryption keys |
| | | * |
| | | * @return void |
| | | * |
| | | * @see Crypt_GPG::decrypt() |
| | | * @see Crypt_GPG::addDecryptKey() |
| | | */ |
| | | public function clearDecryptKeys() |
| | | { |
| | | $this->decryptKeys = array(); |
| | | } |
| | | |
| | | // }}} |
| | | // {{{ clearEncryptKeys() |
| | | |
| | | /** |
| | | * Clears all encryption keys |
| | | * |
| | | * @return void |
| | | * |
| | | * @see Crypt_GPG::encrypt() |
| | | * @see Crypt_GPG::addEncryptKey() |
| | | */ |
| | | public function clearEncryptKeys() |
| | | { |
| | | $this->encryptKeys = array(); |
| | | } |
| | | |
| | | // }}} |
| | | // {{{ clearSignKeys() |
| | | |
| | | /** |
| | | * Clears all signing keys |
| | | * |
| | | * @return void |
| | | * |
| | | * @see Crypt_GPG::sign() |
| | | * @see Crypt_GPG::addSignKey() |
| | | */ |
| | | public function clearSignKeys() |
| | | { |
| | | $this->signKeys = array(); |
| | | } |
| | | |
| | | // }}} |
| | | // {{{ handleSignStatus() |
| | | |
| | | /** |
| | | * Handles the status output from GPG for the sign operation |
| | | * |
| | | * This method is responsible for sending the passphrase commands when |
| | | * required by the {@link Crypt_GPG::sign()} method. See <b>doc/DETAILS</b> |
| | | * in the {@link http://www.gnupg.org/download/ GPG distribution} for |
| | | * detailed information on GPG's status output. |
| | | * |
| | | * @param string $line the status line to handle. |
| | | * |
| | | * @return void |
| | | * |
| | | * @see Crypt_GPG::sign() |
| | | */ |
| | | public function handleSignStatus($line) |
| | | { |
| | | $tokens = explode(' ', $line); |
| | | switch ($tokens[0]) { |
| | | case 'NEED_PASSPHRASE': |
| | | $subKeyId = $tokens[1]; |
| | | if (array_key_exists($subKeyId, $this->signKeys)) { |
| | | $passphrase = $this->signKeys[$subKeyId]['passphrase']; |
| | | $this->engine->sendCommand($passphrase); |
| | | } else { |
| | | $this->engine->sendCommand(''); |
| | | } |
| | | break; |
| | | } |
| | | } |
| | | |
| | | // }}} |
| | | // {{{ handleImportKeyStatus() |
| | | |
| | | /** |
| | | * Handles the status output from GPG for the import operation |
| | | * |
| | | * This method is responsible for building the result array that is |
| | | * returned from the {@link Crypt_GPG::importKey()} method. See |
| | | * <b>doc/DETAILS</b> in the |
| | | * {@link http://www.gnupg.org/download/ GPG distribution} for detailed |
| | | * information on GPG's status output. |
| | | * |
| | | * @param string $line the status line to handle. |
| | | * @param array &$result the current result array being processed. |
| | | * |
| | | * @return void |
| | | * |
| | | * @see Crypt_GPG::importKey() |
| | | * @see Crypt_GPG::importKeyFile() |
| | | * @see Crypt_GPG_Engine::addStatusHandler() |
| | | */ |
| | | public function handleImportKeyStatus($line, array &$result) |
| | | { |
| | | $tokens = explode(' ', $line); |
| | | switch ($tokens[0]) { |
| | | case 'IMPORT_OK': |
| | | $result['fingerprint'] = $tokens[2]; |
| | | break; |
| | | |
| | | case 'IMPORT_RES': |
| | | $result['public_imported'] = intval($tokens[3]); |
| | | $result['public_unchanged'] = intval($tokens[5]); |
| | | $result['private_imported'] = intval($tokens[11]); |
| | | $result['private_unchanged'] = intval($tokens[12]); |
| | | break; |
| | | } |
| | | } |
| | | |
| | | // }}} |
| | | // {{{ setEngine() |
| | | |
| | | /** |
| | | * Sets the I/O engine to use for GnuPG operations |
| | | * |
| | | * Normally this method does not need to be used. It provides a means for |
| | | * dependency injection. |
| | | * |
| | | * @param Crypt_GPG_Engine $engine the engine to use. |
| | | * |
| | | * @return void |
| | | */ |
| | | public function setEngine(Crypt_GPG_Engine $engine) |
| | | { |
| | | $this->engine = $engine; |
| | | } |
| | | |
| | | // }}} |
| | | // {{{ _addKey() |
| | | |
| | | /** |
| | | * Adds a key to one of the internal key arrays |
| | | * |
| | | * This handles resolving full key objects from the provided |
| | | * <kbd>$key</kbd> value. |
| | | * |
| | | * @param array &$array the array to which the key should be added. |
| | | * @param boolean $encrypt whether or not the key must be able to |
| | | * encrypt. |
| | | * @param boolean $sign whether or not the key must be able to sign. |
| | | * @param mixed $key the key to add. This may be a key identifier, |
| | | * user id, fingerprint, {@link Crypt_GPG_Key} or |
| | | * {@link Crypt_GPG_SubKey}. |
| | | * @param string $passphrase optional. The passphrase associated with the |
| | | * key. |
| | | * |
| | | * @return void |
| | | * |
| | | * @sensitive $passphrase |
| | | */ |
| | | private function _addKey(array &$array, $encrypt, $sign, $key, |
| | | $passphrase = null |
| | | ) { |
| | | $subKeys = array(); |
| | | |
| | | if (is_scalar($key)) { |
| | | $keys = $this->getKeys($key); |
| | | if (count($keys) == 0) { |
| | | throw new Crypt_GPG_KeyNotFoundException( |
| | | 'Key "' . $key . '" not found.', 0, $key); |
| | | } |
| | | $key = $keys[0]; |
| | | } |
| | | |
| | | if ($key instanceof Crypt_GPG_Key) { |
| | | if ($encrypt && !$key->canEncrypt()) { |
| | | throw new InvalidArgumentException( |
| | | 'Key "' . $key . '" cannot encrypt.'); |
| | | } |
| | | |
| | | if ($sign && !$key->canSign()) { |
| | | throw new InvalidArgumentException( |
| | | 'Key "' . $key . '" cannot sign.'); |
| | | } |
| | | |
| | | foreach ($key->getSubKeys() as $subKey) { |
| | | $canEncrypt = $subKey->canEncrypt(); |
| | | $canSign = $subKey->canSign(); |
| | | if ( ($encrypt && $sign && $canEncrypt && $canSign) |
| | | || ($encrypt && !$sign && $canEncrypt) |
| | | || (!$encrypt && $sign && $canSign) |
| | | ) { |
| | | // We add all subkeys that meet the requirements because we |
| | | // were not told which subkey is required. |
| | | $subKeys[] = $subKey; |
| | | } |
| | | } |
| | | } elseif ($key instanceof Crypt_GPG_SubKey) { |
| | | $subKeys[] = $key; |
| | | } |
| | | |
| | | if (count($subKeys) === 0) { |
| | | throw new InvalidArgumentException( |
| | | 'Key "' . $key . '" is not in a recognized format.'); |
| | | } |
| | | |
| | | foreach ($subKeys as $subKey) { |
| | | if ($encrypt && !$subKey->canEncrypt()) { |
| | | throw new InvalidArgumentException( |
| | | 'Key "' . $key . '" cannot encrypt.'); |
| | | } |
| | | |
| | | if ($sign && !$subKey->canSign()) { |
| | | throw new InvalidArgumentException( |
| | | 'Key "' . $key . '" cannot sign.'); |
| | | } |
| | | |
| | | $array[$subKey->getId()] = array( |
| | | 'fingerprint' => $subKey->getFingerprint(), |
| | | 'passphrase' => $passphrase |
| | | ); |
| | | } |
| | | } |
| | | |
| | | // }}} |
| | | // {{{ _importKey() |
| | | |
| | | /** |
| | | * Imports a public or private key into the keyring |
| | | * |
| | | * @param string $key the key to be imported. |
| | | * @param boolean $isFile whether or not the input is a filename. |
| | | * |
| | | * @return array an associative array containing the following elements: |
| | | * - <kbd>fingerprint</kbd> - the fingerprint of the |
| | | * imported key, |
| | | * - <kbd>public_imported</kbd> - the number of public |
| | | * keys imported, |
| | | * - <kbd>public_unchanged</kbd> - the number of unchanged |
| | | * public keys, |
| | | * - <kbd>private_imported</kbd> - the number of private |
| | | * keys imported, |
| | | * - <kbd>private_unchanged</kbd> - the number of unchanged |
| | | * private keys. |
| | | * |
| | | * @throws Crypt_GPG_NoDataException if the key data is missing or if the |
| | | * data is is not valid key data. |
| | | * |
| | | * @throws Crypt_GPG_FileException if the key file is not readable. |
| | | * |
| | | * @throws Crypt_GPG_Exception if an unknown or unexpected error occurs. |
| | | * Use the <kbd>debug</kbd> option and file a bug report if these |
| | | * exceptions occur. |
| | | */ |
| | | private function _importKey($key, $isFile) |
| | | { |
| | | $result = array(); |
| | | |
| | | if ($isFile) { |
| | | $input = @fopen($key, 'rb'); |
| | | if ($input === false) { |
| | | throw new Crypt_GPG_FileException('Could not open key file "' . |
| | | $key . '" for importing.', 0, $key); |
| | | } |
| | | } else { |
| | | $input = strval($key); |
| | | if ($input == '') { |
| | | throw new Crypt_GPG_NoDataException( |
| | | 'No valid GPG key data found.', Crypt_GPG::ERROR_NO_DATA); |
| | | } |
| | | } |
| | | |
| | | $arguments = array(); |
| | | $version = $this->engine->getVersion(); |
| | | |
| | | if ( version_compare($version, '1.0.5', 'ge') |
| | | && version_compare($version, '1.0.7', 'lt') |
| | | ) { |
| | | $arguments[] = '--allow-secret-key-import'; |
| | | } |
| | | |
| | | $this->engine->reset(); |
| | | $this->engine->addStatusHandler( |
| | | array($this, 'handleImportKeyStatus'), |
| | | array(&$result) |
| | | ); |
| | | |
| | | $this->engine->setOperation('--import', $arguments); |
| | | $this->engine->setInput($input); |
| | | $this->engine->run(); |
| | | |
| | | if ($isFile) { |
| | | fclose($input); |
| | | } |
| | | |
| | | $code = $this->engine->getErrorCode(); |
| | | |
| | | switch ($code) { |
| | | case Crypt_GPG::ERROR_DUPLICATE_KEY: |
| | | case Crypt_GPG::ERROR_NONE: |
| | | // ignore duplicate key import errors |
| | | break; |
| | | case Crypt_GPG::ERROR_NO_DATA: |
| | | throw new Crypt_GPG_NoDataException( |
| | | 'No valid GPG key data found.', $code); |
| | | default: |
| | | throw new Crypt_GPG_Exception( |
| | | 'Unknown error importing GPG key. Please use the \'debug\' ' . |
| | | 'option when creating the Crypt_GPG object, and file a bug ' . |
| | | 'report at ' . self::BUG_URI, $code); |
| | | } |
| | | |
| | | return $result; |
| | | } |
| | | |
| | | // }}} |
| | | // {{{ _encrypt() |
| | | |
| | | /** |
| | | * Encrypts data |
| | | * |
| | | * @param string $data the data to encrypt. |
| | | * @param boolean $isFile whether or not the data is a filename. |
| | | * @param string $outputFile the filename of the file in which to store |
| | | * the encrypted data. If null, the encrypted |
| | | * data is returned as a string. |
| | | * @param boolean $armor if true, ASCII armored data is returned; |
| | | * otherwise, binary data is returned. |
| | | * |
| | | * @return void|string if the <kbd>$outputFile</kbd> parameter is null, a |
| | | * string containing the encrypted data is returned. |
| | | * |
| | | * @throws Crypt_GPG_KeyNotFoundException if no encryption key is specified. |
| | | * See {@link Crypt_GPG::addEncryptKey()}. |
| | | * |
| | | * @throws Crypt_GPG_FileException if the output file is not writeable or |
| | | * if the input file is not readable. |
| | | * |
| | | * @throws Crypt_GPG_Exception if an unknown or unexpected error occurs. |
| | | * Use the <kbd>debug</kbd> option and file a bug report if these |
| | | * exceptions occur. |
| | | */ |
| | | private function _encrypt($data, $isFile, $outputFile, $armor) |
| | | { |
| | | if (count($this->encryptKeys) === 0) { |
| | | throw new Crypt_GPG_KeyNotFoundException( |
| | | 'No encryption keys specified.'); |
| | | } |
| | | |
| | | if ($isFile) { |
| | | $input = @fopen($data, 'rb'); |
| | | if ($input === false) { |
| | | throw new Crypt_GPG_FileException('Could not open input file "' . |
| | | $data . '" for encryption.', 0, $data); |
| | | } |
| | | } else { |
| | | $input = strval($data); |
| | | } |
| | | |
| | | if ($outputFile === null) { |
| | | $output = ''; |
| | | } else { |
| | | $output = @fopen($outputFile, 'wb'); |
| | | if ($output === false) { |
| | | if ($isFile) { |
| | | fclose($input); |
| | | } |
| | | throw new Crypt_GPG_FileException('Could not open output ' . |
| | | 'file "' . $outputFile . '" for storing encrypted data.', |
| | | 0, $outputFile); |
| | | } |
| | | } |
| | | |
| | | $arguments = ($armor) ? array('--armor') : array(); |
| | | foreach ($this->encryptKeys as $key) { |
| | | $arguments[] = '--recipient ' . escapeshellarg($key['fingerprint']); |
| | | } |
| | | |
| | | $this->engine->reset(); |
| | | $this->engine->setInput($input); |
| | | $this->engine->setOutput($output); |
| | | $this->engine->setOperation('--encrypt', $arguments); |
| | | $this->engine->run(); |
| | | |
| | | if ($isFile) { |
| | | fclose($input); |
| | | } |
| | | |
| | | if ($outputFile !== null) { |
| | | fclose($output); |
| | | } |
| | | |
| | | $code = $this->engine->getErrorCode(); |
| | | |
| | | if ($code !== Crypt_GPG::ERROR_NONE) { |
| | | throw new Crypt_GPG_Exception( |
| | | 'Unknown error encrypting data. Please use the \'debug\' ' . |
| | | 'option when creating the Crypt_GPG object, and file a bug ' . |
| | | 'report at ' . self::BUG_URI, $code); |
| | | } |
| | | |
| | | if ($outputFile === null) { |
| | | return $output; |
| | | } |
| | | } |
| | | |
| | | // }}} |
| | | // {{{ _decrypt() |
| | | |
| | | /** |
| | | * Decrypts data |
| | | * |
| | | * @param string $data the data to be decrypted. |
| | | * @param boolean $isFile whether or not the data is a filename. |
| | | * @param string $outputFile the name of the file to which the decrypted |
| | | * data should be written. If null, the decrypted |
| | | * data is returned as a string. |
| | | * |
| | | * @return void|string if the <kbd>$outputFile</kbd> parameter is null, a |
| | | * string containing the decrypted data is returned. |
| | | * |
| | | * @throws Crypt_GPG_KeyNotFoundException if the private key needed to |
| | | * decrypt the data is not in the user's keyring. |
| | | * |
| | | * @throws Crypt_GPG_NoDataException if specified data does not contain |
| | | * GPG encrypted data. |
| | | * |
| | | * @throws Crypt_GPG_BadPassphraseException if a required passphrase is |
| | | * incorrect or if a required passphrase is not specified. See |
| | | * {@link Crypt_GPG::addDecryptKey()}. |
| | | * |
| | | * @throws Crypt_GPG_FileException if the output file is not writeable or |
| | | * if the input file is not readable. |
| | | * |
| | | * @throws Crypt_GPG_Exception if an unknown or unexpected error occurs. |
| | | * Use the <kbd>debug</kbd> option and file a bug report if these |
| | | * exceptions occur. |
| | | */ |
| | | private function _decrypt($data, $isFile, $outputFile) |
| | | { |
| | | if ($isFile) { |
| | | $input = @fopen($data, 'rb'); |
| | | if ($input === false) { |
| | | throw new Crypt_GPG_FileException('Could not open input file "' . |
| | | $data . '" for decryption.', 0, $data); |
| | | } |
| | | } else { |
| | | $input = strval($data); |
| | | if ($input == '') { |
| | | throw new Crypt_GPG_NoDataException( |
| | | 'Cannot decrypt data. No PGP encrypted data was found in '. |
| | | 'the provided data.', Crypt_GPG::ERROR_NO_DATA); |
| | | } |
| | | } |
| | | |
| | | if ($outputFile === null) { |
| | | $output = ''; |
| | | } else { |
| | | $output = @fopen($outputFile, 'wb'); |
| | | if ($output === false) { |
| | | if ($isFile) { |
| | | fclose($input); |
| | | } |
| | | throw new Crypt_GPG_FileException('Could not open output ' . |
| | | 'file "' . $outputFile . '" for storing decrypted data.', |
| | | 0, $outputFile); |
| | | } |
| | | } |
| | | |
| | | $handler = new Crypt_GPG_DecryptStatusHandler($this->engine, |
| | | $this->decryptKeys); |
| | | |
| | | $this->engine->reset(); |
| | | $this->engine->addStatusHandler(array($handler, 'handle')); |
| | | $this->engine->setOperation('--decrypt'); |
| | | $this->engine->setInput($input); |
| | | $this->engine->setOutput($output); |
| | | $this->engine->run(); |
| | | |
| | | if ($isFile) { |
| | | fclose($input); |
| | | } |
| | | |
| | | if ($outputFile !== null) { |
| | | fclose($output); |
| | | } |
| | | |
| | | // if there was any problem decrypting the data, the handler will |
| | | // deal with it here. |
| | | $handler->throwException(); |
| | | |
| | | if ($outputFile === null) { |
| | | return $output; |
| | | } |
| | | } |
| | | |
| | | // }}} |
| | | // {{{ _sign() |
| | | |
| | | /** |
| | | * Signs data |
| | | * |
| | | * @param string $data the data to be signed. |
| | | * @param boolean $isFile whether or not the data is a filename. |
| | | * @param string $outputFile the name of the file in which the signed data |
| | | * should be stored. If null, the signed data is |
| | | * returned as a string. |
| | | * @param boolean $mode the data signing mode to use. Should be one of |
| | | * {@link Crypt_GPG::SIGN_MODE_NORMAL}, |
| | | * {@link Crypt_GPG::SIGN_MODE_CLEAR} or |
| | | * {@link Crypt_GPG::SIGN_MODE_DETACHED}. |
| | | * @param boolean $armor if true, ASCII armored data is returned; |
| | | * otherwise, binary data is returned. This has |
| | | * no effect if the mode |
| | | * <kbd>Crypt_GPG::SIGN_MODE_CLEAR</kbd> is |
| | | * used. |
| | | * @param boolean $textmode if true, line-breaks in signed data be |
| | | * normalized. Use this option when signing |
| | | * e-mail, or for greater compatibility between |
| | | * systems with different line-break formats. |
| | | * Defaults to false. This has no effect if the |
| | | * mode <kbd>Crypt_GPG::SIGN_MODE_CLEAR</kbd> is |
| | | * used as clear-signing always uses textmode. |
| | | * |
| | | * @return void|string if the <kbd>$outputFile</kbd> parameter is null, a |
| | | * string containing the signed data (or the signature |
| | | * data if a detached signature is requested) is |
| | | * returned. |
| | | * |
| | | * @throws Crypt_GPG_KeyNotFoundException if no signing key is specified. |
| | | * See {@link Crypt_GPG::addSignKey()}. |
| | | * |
| | | * @throws Crypt_GPG_BadPassphraseException if a specified passphrase is |
| | | * incorrect or if a required passphrase is not specified. |
| | | * |
| | | * @throws Crypt_GPG_FileException if the output file is not writeable or |
| | | * if the input file is not readable. |
| | | * |
| | | * @throws Crypt_GPG_Exception if an unknown or unexpected error occurs. |
| | | * Use the <kbd>debug</kbd> option and file a bug report if these |
| | | * exceptions occur. |
| | | */ |
| | | private function _sign($data, $isFile, $outputFile, $mode, $armor, |
| | | $textmode |
| | | ) { |
| | | if (count($this->signKeys) === 0) { |
| | | throw new Crypt_GPG_KeyNotFoundException( |
| | | 'No signing keys specified.'); |
| | | } |
| | | |
| | | if ($isFile) { |
| | | $input = @fopen($data, 'rb'); |
| | | if ($input === false) { |
| | | throw new Crypt_GPG_FileException('Could not open input ' . |
| | | 'file "' . $data . '" for signing.', 0, $data); |
| | | } |
| | | } else { |
| | | $input = strval($data); |
| | | } |
| | | |
| | | if ($outputFile === null) { |
| | | $output = ''; |
| | | } else { |
| | | $output = @fopen($outputFile, 'wb'); |
| | | if ($output === false) { |
| | | if ($isFile) { |
| | | fclose($input); |
| | | } |
| | | throw new Crypt_GPG_FileException('Could not open output ' . |
| | | 'file "' . $outputFile . '" for storing signed ' . |
| | | 'data.', 0, $outputFile); |
| | | } |
| | | } |
| | | |
| | | switch ($mode) { |
| | | case Crypt_GPG::SIGN_MODE_DETACHED: |
| | | $operation = '--detach-sign'; |
| | | break; |
| | | case Crypt_GPG::SIGN_MODE_CLEAR: |
| | | $operation = '--clearsign'; |
| | | break; |
| | | case Crypt_GPG::SIGN_MODE_NORMAL: |
| | | default: |
| | | $operation = '--sign'; |
| | | break; |
| | | } |
| | | |
| | | $arguments = array(); |
| | | |
| | | if ($armor) { |
| | | $arguments[] = '--armor'; |
| | | } |
| | | if ($textmode) { |
| | | $arguments[] = '--textmode'; |
| | | } |
| | | |
| | | foreach ($this->signKeys as $key) { |
| | | $arguments[] = '--local-user ' . |
| | | escapeshellarg($key['fingerprint']); |
| | | } |
| | | |
| | | $this->engine->reset(); |
| | | $this->engine->addStatusHandler(array($this, 'handleSignStatus')); |
| | | $this->engine->setInput($input); |
| | | $this->engine->setOutput($output); |
| | | $this->engine->setOperation($operation, $arguments); |
| | | $this->engine->run(); |
| | | |
| | | if ($isFile) { |
| | | fclose($input); |
| | | } |
| | | |
| | | if ($outputFile !== null) { |
| | | fclose($output); |
| | | } |
| | | |
| | | $code = $this->engine->getErrorCode(); |
| | | |
| | | switch ($code) { |
| | | case Crypt_GPG::ERROR_NONE: |
| | | break; |
| | | case Crypt_GPG::ERROR_KEY_NOT_FOUND: |
| | | throw new Crypt_GPG_KeyNotFoundException( |
| | | 'Cannot sign data. Private key not found. Import the '. |
| | | 'private key before trying to sign data.', $code, |
| | | $this->engine->getErrorKeyId()); |
| | | case Crypt_GPG::ERROR_BAD_PASSPHRASE: |
| | | throw new Crypt_GPG_BadPassphraseException( |
| | | 'Cannot sign data. Incorrect passphrase provided.', $code); |
| | | case Crypt_GPG::ERROR_MISSING_PASSPHRASE: |
| | | throw new Crypt_GPG_BadPassphraseException( |
| | | 'Cannot sign data. No passphrase provided.', $code); |
| | | default: |
| | | throw new Crypt_GPG_Exception( |
| | | 'Unknown error signing data. Please use the \'debug\' option ' . |
| | | 'when creating the Crypt_GPG object, and file a bug report ' . |
| | | 'at ' . self::BUG_URI, $code); |
| | | } |
| | | |
| | | if ($outputFile === null) { |
| | | return $output; |
| | | } |
| | | } |
| | | |
| | | // }}} |
| | | // {{{ _encryptAndSign() |
| | | |
| | | /** |
| | | * Encrypts and signs data |
| | | * |
| | | * @param string $data the data to be encrypted and signed. |
| | | * @param boolean $isFile whether or not the data is a filename. |
| | | * @param string $outputFile the name of the file in which the encrypted, |
| | | * signed data should be stored. If null, the |
| | | * encrypted, signed data is returned as a |
| | | * string. |
| | | * @param boolean $armor if true, ASCII armored data is returned; |
| | | * otherwise, binary data is returned. |
| | | * |
| | | * @return void|string if the <kbd>$outputFile</kbd> parameter is null, a |
| | | * string containing the encrypted, signed data is |
| | | * returned. |
| | | * |
| | | * @throws Crypt_GPG_KeyNotFoundException if no encryption key is specified |
| | | * or if no signing key is specified. See |
| | | * {@link Crypt_GPG::addEncryptKey()} and |
| | | * {@link Crypt_GPG::addSignKey()}. |
| | | * |
| | | * @throws Crypt_GPG_BadPassphraseException if a specified passphrase is |
| | | * incorrect or if a required passphrase is not specified. |
| | | * |
| | | * @throws Crypt_GPG_FileException if the output file is not writeable or |
| | | * if the input file is not readable. |
| | | * |
| | | * @throws Crypt_GPG_Exception if an unknown or unexpected error occurs. |
| | | * Use the <kbd>debug</kbd> option and file a bug report if these |
| | | * exceptions occur. |
| | | */ |
| | | private function _encryptAndSign($data, $isFile, $outputFile, $armor) |
| | | { |
| | | if (count($this->signKeys) === 0) { |
| | | throw new Crypt_GPG_KeyNotFoundException( |
| | | 'No signing keys specified.'); |
| | | } |
| | | |
| | | if (count($this->encryptKeys) === 0) { |
| | | throw new Crypt_GPG_KeyNotFoundException( |
| | | 'No encryption keys specified.'); |
| | | } |
| | | |
| | | |
| | | if ($isFile) { |
| | | $input = @fopen($data, 'rb'); |
| | | if ($input === false) { |
| | | throw new Crypt_GPG_FileException('Could not open input ' . |
| | | 'file "' . $data . '" for encrypting and signing.', 0, |
| | | $data); |
| | | } |
| | | } else { |
| | | $input = strval($data); |
| | | } |
| | | |
| | | if ($outputFile === null) { |
| | | $output = ''; |
| | | } else { |
| | | $output = @fopen($outputFile, 'wb'); |
| | | if ($output === false) { |
| | | if ($isFile) { |
| | | fclose($input); |
| | | } |
| | | throw new Crypt_GPG_FileException('Could not open output ' . |
| | | 'file "' . $outputFile . '" for storing encrypted, ' . |
| | | 'signed data.', 0, $outputFile); |
| | | } |
| | | } |
| | | |
| | | $arguments = ($armor) ? array('--armor') : array(); |
| | | |
| | | foreach ($this->signKeys as $key) { |
| | | $arguments[] = '--local-user ' . |
| | | escapeshellarg($key['fingerprint']); |
| | | } |
| | | |
| | | foreach ($this->encryptKeys as $key) { |
| | | $arguments[] = '--recipient ' . escapeshellarg($key['fingerprint']); |
| | | } |
| | | |
| | | $this->engine->reset(); |
| | | $this->engine->addStatusHandler(array($this, 'handleSignStatus')); |
| | | $this->engine->setInput($input); |
| | | $this->engine->setOutput($output); |
| | | $this->engine->setOperation('--encrypt --sign', $arguments); |
| | | $this->engine->run(); |
| | | |
| | | if ($isFile) { |
| | | fclose($input); |
| | | } |
| | | |
| | | if ($outputFile !== null) { |
| | | fclose($output); |
| | | } |
| | | |
| | | $code = $this->engine->getErrorCode(); |
| | | |
| | | switch ($code) { |
| | | case Crypt_GPG::ERROR_NONE: |
| | | break; |
| | | case Crypt_GPG::ERROR_KEY_NOT_FOUND: |
| | | throw new Crypt_GPG_KeyNotFoundException( |
| | | 'Cannot sign encrypted data. Private key not found. Import '. |
| | | 'the private key before trying to sign the encrypted data.', |
| | | $code, $this->engine->getErrorKeyId()); |
| | | case Crypt_GPG::ERROR_BAD_PASSPHRASE: |
| | | throw new Crypt_GPG_BadPassphraseException( |
| | | 'Cannot sign encrypted data. Incorrect passphrase provided.', |
| | | $code); |
| | | case Crypt_GPG::ERROR_MISSING_PASSPHRASE: |
| | | throw new Crypt_GPG_BadPassphraseException( |
| | | 'Cannot sign encrypted data. No passphrase provided.', $code); |
| | | default: |
| | | throw new Crypt_GPG_Exception( |
| | | 'Unknown error encrypting and signing data. Please use the ' . |
| | | '\'debug\' option when creating the Crypt_GPG object, and ' . |
| | | 'file a bug report at ' . self::BUG_URI, $code); |
| | | } |
| | | |
| | | if ($outputFile === null) { |
| | | return $output; |
| | | } |
| | | } |
| | | |
| | | // }}} |
| | | // {{{ _verify() |
| | | |
| | | /** |
| | | * Verifies data |
| | | * |
| | | * @param string $data the signed data to be verified. |
| | | * @param boolean $isFile whether or not the data is a filename. |
| | | * @param string $signature if verifying a file signed using a detached |
| | | * signature, this must be the detached signature |
| | | * data. Otherwise, specify ''. |
| | | * |
| | | * @return array an array of {@link Crypt_GPG_Signature} objects for the |
| | | * signed data. |
| | | * |
| | | * @throws Crypt_GPG_NoDataException if the provided data is not signed |
| | | * data. |
| | | * |
| | | * @throws Crypt_GPG_FileException if the input file is not readable. |
| | | * |
| | | * @throws Crypt_GPG_Exception if an unknown or unexpected error occurs. |
| | | * Use the <kbd>debug</kbd> option and file a bug report if these |
| | | * exceptions occur. |
| | | * |
| | | * @see Crypt_GPG_Signature |
| | | */ |
| | | private function _verify($data, $isFile, $signature) |
| | | { |
| | | if ($signature == '') { |
| | | $operation = '--verify'; |
| | | $arguments = array(); |
| | | } else { |
| | | // Signed data goes in FD_MESSAGE, detached signature data goes in |
| | | // FD_INPUT. |
| | | $operation = '--verify - "-&' . Crypt_GPG_Engine::FD_MESSAGE. '"'; |
| | | $arguments = array('--enable-special-filenames'); |
| | | } |
| | | |
| | | $handler = new Crypt_GPG_VerifyStatusHandler(); |
| | | |
| | | if ($isFile) { |
| | | $input = @fopen($data, 'rb'); |
| | | if ($input === false) { |
| | | throw new Crypt_GPG_FileException('Could not open input ' . |
| | | 'file "' . $data . '" for verifying.', 0, $data); |
| | | } |
| | | } else { |
| | | $input = strval($data); |
| | | if ($input == '') { |
| | | throw new Crypt_GPG_NoDataException( |
| | | 'No valid signature data found.', Crypt_GPG::ERROR_NO_DATA); |
| | | } |
| | | } |
| | | |
| | | $this->engine->reset(); |
| | | $this->engine->addStatusHandler(array($handler, 'handle')); |
| | | |
| | | if ($signature == '') { |
| | | // signed or clearsigned data |
| | | $this->engine->setInput($input); |
| | | } else { |
| | | // detached signature |
| | | $this->engine->setInput($signature); |
| | | $this->engine->setMessage($input); |
| | | } |
| | | |
| | | $this->engine->setOperation($operation, $arguments); |
| | | $this->engine->run(); |
| | | |
| | | if ($isFile) { |
| | | fclose($input); |
| | | } |
| | | |
| | | $code = $this->engine->getErrorCode(); |
| | | |
| | | switch ($code) { |
| | | case Crypt_GPG::ERROR_NONE: |
| | | case Crypt_GPG::ERROR_BAD_SIGNATURE: |
| | | break; |
| | | case Crypt_GPG::ERROR_NO_DATA: |
| | | throw new Crypt_GPG_NoDataException( |
| | | 'No valid signature data found.', $code); |
| | | case Crypt_GPG::ERROR_KEY_NOT_FOUND: |
| | | throw new Crypt_GPG_KeyNotFoundException( |
| | | 'Public key required for data verification not in keyring.', |
| | | $code, $this->engine->getErrorKeyId()); |
| | | default: |
| | | throw new Crypt_GPG_Exception( |
| | | 'Unknown error validating signature details. Please use the ' . |
| | | '\'debug\' option when creating the Crypt_GPG object, and ' . |
| | | 'file a bug report at ' . self::BUG_URI, $code); |
| | | } |
| | | |
| | | return $handler->getSignatures(); |
| | | } |
| | | |
| | | // }}} |
| | | // {{{ _decryptAndVerify() |
| | | |
| | | /** |
| | | * Decrypts and verifies encrypted, signed data |
| | | * |
| | | * @param string $data the encrypted signed data to be decrypted and |
| | | * verified. |
| | | * @param boolean $isFile whether or not the data is a filename. |
| | | * @param string $outputFile the name of the file to which the decrypted |
| | | * data should be written. If null, the decrypted |
| | | * data is returned in the results array. |
| | | * |
| | | * @return array two element array. The array has an element 'data' |
| | | * containing the decrypted data and an element |
| | | * 'signatures' containing an array of |
| | | * {@link Crypt_GPG_Signature} objects for the signed data. |
| | | * If the decrypted data is written to a file, the 'data' |
| | | * element is null. |
| | | * |
| | | * @throws Crypt_GPG_KeyNotFoundException if the private key needed to |
| | | * decrypt the data is not in the user's keyring or it the public |
| | | * key needed for verification is not in the user's keyring. |
| | | * |
| | | * @throws Crypt_GPG_NoDataException if specified data does not contain |
| | | * GPG signed, encrypted data. |
| | | * |
| | | * @throws Crypt_GPG_BadPassphraseException if a required passphrase is |
| | | * incorrect or if a required passphrase is not specified. See |
| | | * {@link Crypt_GPG::addDecryptKey()}. |
| | | * |
| | | * @throws Crypt_GPG_FileException if the output file is not writeable or |
| | | * if the input file is not readable. |
| | | * |
| | | * @throws Crypt_GPG_Exception if an unknown or unexpected error occurs. |
| | | * Use the <kbd>debug</kbd> option and file a bug report if these |
| | | * exceptions occur. |
| | | * |
| | | * @see Crypt_GPG_Signature |
| | | */ |
| | | private function _decryptAndVerify($data, $isFile, $outputFile) |
| | | { |
| | | if ($isFile) { |
| | | $input = @fopen($data, 'rb'); |
| | | if ($input === false) { |
| | | throw new Crypt_GPG_FileException('Could not open input ' . |
| | | 'file "' . $data . '" for decrypting and verifying.', 0, |
| | | $data); |
| | | } |
| | | } else { |
| | | $input = strval($data); |
| | | if ($input == '') { |
| | | throw new Crypt_GPG_NoDataException( |
| | | 'No valid encrypted signed data found.', |
| | | Crypt_GPG::ERROR_NO_DATA); |
| | | } |
| | | } |
| | | |
| | | if ($outputFile === null) { |
| | | $output = ''; |
| | | } else { |
| | | $output = @fopen($outputFile, 'wb'); |
| | | if ($output === false) { |
| | | if ($isFile) { |
| | | fclose($input); |
| | | } |
| | | throw new Crypt_GPG_FileException('Could not open output ' . |
| | | 'file "' . $outputFile . '" for storing decrypted data.', |
| | | 0, $outputFile); |
| | | } |
| | | } |
| | | |
| | | $verifyHandler = new Crypt_GPG_VerifyStatusHandler(); |
| | | |
| | | $decryptHandler = new Crypt_GPG_DecryptStatusHandler($this->engine, |
| | | $this->decryptKeys); |
| | | |
| | | $this->engine->reset(); |
| | | $this->engine->addStatusHandler(array($verifyHandler, 'handle')); |
| | | $this->engine->addStatusHandler(array($decryptHandler, 'handle')); |
| | | $this->engine->setInput($input); |
| | | $this->engine->setOutput($output); |
| | | $this->engine->setOperation('--decrypt'); |
| | | $this->engine->run(); |
| | | |
| | | if ($isFile) { |
| | | fclose($input); |
| | | } |
| | | |
| | | if ($outputFile !== null) { |
| | | fclose($output); |
| | | } |
| | | |
| | | $return = array( |
| | | 'data' => null, |
| | | 'signatures' => $verifyHandler->getSignatures() |
| | | ); |
| | | |
| | | // if there was any problem decrypting the data, the handler will |
| | | // deal with it here. |
| | | try { |
| | | $decryptHandler->throwException(); |
| | | } catch (Exception $e) { |
| | | if ($e instanceof Crypt_GPG_KeyNotFoundException) { |
| | | throw new Crypt_GPG_KeyNotFoundException( |
| | | 'Public key required for data verification not in ', |
| | | 'the keyring. Either no suitable private decryption key ' . |
| | | 'is in the keyring or the public key required for data ' . |
| | | 'verification is not in the keyring. Import a suitable ' . |
| | | 'key before trying to decrypt and verify this data.', |
| | | self::ERROR_KEY_NOT_FOUND, $this->engine->getErrorKeyId()); |
| | | } |
| | | |
| | | if ($e instanceof Crypt_GPG_NoDataException) { |
| | | throw new Crypt_GPG_NoDataException( |
| | | 'Cannot decrypt and verify data. No PGP encrypted data ' . |
| | | 'was found in the provided data.', self::ERROR_NO_DATA); |
| | | } |
| | | |
| | | throw $e; |
| | | } |
| | | |
| | | if ($outputFile === null) { |
| | | $return['data'] = $output; |
| | | } |
| | | |
| | | return $return; |
| | | } |
| | | |
| | | // }}} |
| | | } |
| | | |
| | | // }}} |
| | | |
| | | ?> |
New file |
| | |
| | | <?php |
| | | |
| | | /* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */ |
| | | |
| | | /** |
| | | * Crypt_GPG is a package to use GPG from PHP |
| | | * |
| | | * This file contains an object that handles GPG's status output for the |
| | | * decrypt operation. |
| | | * |
| | | * PHP version 5 |
| | | * |
| | | * LICENSE: |
| | | * |
| | | * This library is free software; you can redistribute it and/or modify |
| | | * it under the terms of the GNU Lesser General Public License as |
| | | * published by the Free Software Foundation; either version 2.1 of the |
| | | * License, or (at your option) any later version. |
| | | * |
| | | * This library is distributed in the hope that it will be useful, |
| | | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| | | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| | | * Lesser General Public License for more details. |
| | | * |
| | | * You should have received a copy of the GNU Lesser General Public |
| | | * License along with this library; if not, write to the Free Software |
| | | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
| | | * |
| | | * @category Encryption |
| | | * @package Crypt_GPG |
| | | * @author Michael Gauthier <mike@silverorange.com> |
| | | * @copyright 2008-2009 silverorange |
| | | * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1 |
| | | * @version CVS: $Id: DecryptStatusHandler.php 302814 2010-08-26 15:43:07Z gauthierm $ |
| | | * @link http://pear.php.net/package/Crypt_GPG |
| | | * @link http://www.gnupg.org/ |
| | | */ |
| | | |
| | | /** |
| | | * Crypt_GPG base class |
| | | */ |
| | | require_once 'Crypt/GPG.php'; |
| | | |
| | | /** |
| | | * GPG exception classes |
| | | */ |
| | | require_once 'Crypt/GPG/Exceptions.php'; |
| | | |
| | | |
| | | /** |
| | | * Status line handler for the decrypt operation |
| | | * |
| | | * This class is used internally by Crypt_GPG and does not need be used |
| | | * directly. See the {@link Crypt_GPG} class for end-user API. |
| | | * |
| | | * This class is responsible for sending the passphrase commands when required |
| | | * by the {@link Crypt_GPG::decrypt()} method. See <b>doc/DETAILS</b> in the |
| | | * {@link http://www.gnupg.org/download/ GPG distribution} for detailed |
| | | * information on GPG's status output for the decrypt operation. |
| | | * |
| | | * This class is also responsible for parsing error status and throwing a |
| | | * meaningful exception in the event that decryption fails. |
| | | * |
| | | * @category Encryption |
| | | * @package Crypt_GPG |
| | | * @author Michael Gauthier <mike@silverorange.com> |
| | | * @copyright 2008 silverorange |
| | | * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1 |
| | | * @link http://pear.php.net/package/Crypt_GPG |
| | | * @link http://www.gnupg.org/ |
| | | */ |
| | | class Crypt_GPG_DecryptStatusHandler |
| | | { |
| | | // {{{ protected properties |
| | | |
| | | /** |
| | | * Keys used to decrypt |
| | | * |
| | | * The array is of the form: |
| | | * <code> |
| | | * array( |
| | | * $key_id => array( |
| | | * 'fingerprint' => $fingerprint, |
| | | * 'passphrase' => $passphrase |
| | | * ) |
| | | * ); |
| | | * </code> |
| | | * |
| | | * @var array |
| | | */ |
| | | protected $keys = array(); |
| | | |
| | | /** |
| | | * Engine used to which passphrases are passed |
| | | * |
| | | * @var Crypt_GPG_Engine |
| | | */ |
| | | protected $engine = null; |
| | | |
| | | /** |
| | | * The id of the current sub-key used for decryption |
| | | * |
| | | * @var string |
| | | */ |
| | | protected $currentSubKey = ''; |
| | | |
| | | /** |
| | | * Whether or not decryption succeeded |
| | | * |
| | | * If the message is only signed (compressed) and not encrypted, this is |
| | | * always true. If the message is encrypted, this flag is set to false |
| | | * until we know the decryption succeeded. |
| | | * |
| | | * @var boolean |
| | | */ |
| | | protected $decryptionOkay = true; |
| | | |
| | | /** |
| | | * Whether or not there was no data for decryption |
| | | * |
| | | * @var boolean |
| | | */ |
| | | protected $noData = false; |
| | | |
| | | /** |
| | | * Keys for which the passhprase is missing |
| | | * |
| | | * This contains primary user ids indexed by sub-key id and is used to |
| | | * create helpful exception messages. |
| | | * |
| | | * @var array |
| | | */ |
| | | protected $missingPassphrases = array(); |
| | | |
| | | /** |
| | | * Keys for which the passhprase is incorrect |
| | | * |
| | | * This contains primary user ids indexed by sub-key id and is used to |
| | | * create helpful exception messages. |
| | | * |
| | | * @var array |
| | | */ |
| | | protected $badPassphrases = array(); |
| | | |
| | | /** |
| | | * Keys that can be used to decrypt the data but are missing from the |
| | | * keychain |
| | | * |
| | | * This is an array with both the key and value being the sub-key id of |
| | | * the missing keys. |
| | | * |
| | | * @var array |
| | | */ |
| | | protected $missingKeys = array(); |
| | | |
| | | // }}} |
| | | // {{{ __construct() |
| | | |
| | | /** |
| | | * Creates a new decryption status handler |
| | | * |
| | | * @param Crypt_GPG_Engine $engine the GPG engine to which passphrases are |
| | | * passed. |
| | | * @param array $keys the decryption keys to use. |
| | | */ |
| | | public function __construct(Crypt_GPG_Engine $engine, array $keys) |
| | | { |
| | | $this->engine = $engine; |
| | | $this->keys = $keys; |
| | | } |
| | | |
| | | // }}} |
| | | // {{{ handle() |
| | | |
| | | /** |
| | | * Handles a status line |
| | | * |
| | | * @param string $line the status line to handle. |
| | | * |
| | | * @return void |
| | | */ |
| | | public function handle($line) |
| | | { |
| | | $tokens = explode(' ', $line); |
| | | switch ($tokens[0]) { |
| | | case 'ENC_TO': |
| | | // Now we know the message is encrypted. Set flag to check if |
| | | // decryption succeeded. |
| | | $this->decryptionOkay = false; |
| | | |
| | | // this is the new key message |
| | | $this->currentSubKeyId = $tokens[1]; |
| | | break; |
| | | |
| | | case 'NEED_PASSPHRASE': |
| | | // send passphrase to the GPG engine |
| | | $subKeyId = $tokens[1]; |
| | | if (array_key_exists($subKeyId, $this->keys)) { |
| | | $passphrase = $this->keys[$subKeyId]['passphrase']; |
| | | $this->engine->sendCommand($passphrase); |
| | | } else { |
| | | $this->engine->sendCommand(''); |
| | | } |
| | | break; |
| | | |
| | | case 'USERID_HINT': |
| | | // remember the user id for pretty exception messages |
| | | $this->badPassphrases[$tokens[1]] |
| | | = implode(' ', array_splice($tokens, 2)); |
| | | |
| | | break; |
| | | |
| | | case 'GOOD_PASSPHRASE': |
| | | // if we got a good passphrase, remove the key from the list of |
| | | // bad passphrases. |
| | | unset($this->badPassphrases[$this->currentSubKeyId]); |
| | | break; |
| | | |
| | | case 'MISSING_PASSPHRASE': |
| | | $this->missingPassphrases[$this->currentSubKeyId] |
| | | = $this->currentSubKeyId; |
| | | |
| | | break; |
| | | |
| | | case 'NO_SECKEY': |
| | | // note: this message is also received if there are multiple |
| | | // recipients and a previous key had a correct passphrase. |
| | | $this->missingKeys[$tokens[1]] = $tokens[1]; |
| | | break; |
| | | |
| | | case 'NODATA': |
| | | $this->noData = true; |
| | | break; |
| | | |
| | | case 'DECRYPTION_OKAY': |
| | | // If the message is encrypted, this is the all-clear signal. |
| | | $this->decryptionOkay = true; |
| | | break; |
| | | } |
| | | } |
| | | |
| | | // }}} |
| | | // {{{ throwException() |
| | | |
| | | /** |
| | | * Takes the final status of the decrypt operation and throws an |
| | | * appropriate exception |
| | | * |
| | | * If decryption was successful, no exception is thrown. |
| | | * |
| | | * @return void |
| | | * |
| | | * @throws Crypt_GPG_KeyNotFoundException if the private key needed to |
| | | * decrypt the data is not in the user's keyring. |
| | | * |
| | | * @throws Crypt_GPG_NoDataException if specified data does not contain |
| | | * GPG encrypted data. |
| | | * |
| | | * @throws Crypt_GPG_BadPassphraseException if a required passphrase is |
| | | * incorrect or if a required passphrase is not specified. See |
| | | * {@link Crypt_GPG::addDecryptKey()}. |
| | | * |
| | | * @throws Crypt_GPG_Exception if an unknown or unexpected error occurs. |
| | | * Use the <i>debug</i> option and file a bug report if these |
| | | * exceptions occur. |
| | | */ |
| | | public function throwException() |
| | | { |
| | | $code = Crypt_GPG::ERROR_NONE; |
| | | |
| | | if (!$this->decryptionOkay) { |
| | | if (count($this->badPassphrases) > 0) { |
| | | $code = Crypt_GPG::ERROR_BAD_PASSPHRASE; |
| | | } elseif (count($this->missingKeys) > 0) { |
| | | $code = Crypt_GPG::ERROR_KEY_NOT_FOUND; |
| | | } else { |
| | | $code = Crypt_GPG::ERROR_UNKNOWN; |
| | | } |
| | | } elseif ($this->noData) { |
| | | $code = Crypt_GPG::ERROR_NO_DATA; |
| | | } |
| | | |
| | | switch ($code) { |
| | | case Crypt_GPG::ERROR_NONE: |
| | | break; |
| | | |
| | | case Crypt_GPG::ERROR_KEY_NOT_FOUND: |
| | | if (count($this->missingKeys) > 0) { |
| | | $keyId = reset($this->missingKeys); |
| | | } else { |
| | | $keyId = ''; |
| | | } |
| | | throw new Crypt_GPG_KeyNotFoundException( |
| | | 'Cannot decrypt data. No suitable private key is in the ' . |
| | | 'keyring. Import a suitable private key before trying to ' . |
| | | 'decrypt this data.', $code, $keyId); |
| | | |
| | | case Crypt_GPG::ERROR_BAD_PASSPHRASE: |
| | | $badPassphrases = array_diff_key( |
| | | $this->badPassphrases, |
| | | $this->missingPassphrases |
| | | ); |
| | | |
| | | $missingPassphrases = array_intersect_key( |
| | | $this->badPassphrases, |
| | | $this->missingPassphrases |
| | | ); |
| | | |
| | | $message = 'Cannot decrypt data.'; |
| | | if (count($badPassphrases) > 0) { |
| | | $message = ' Incorrect passphrase provided for keys: "' . |
| | | implode('", "', $badPassphrases) . '".'; |
| | | } |
| | | if (count($missingPassphrases) > 0) { |
| | | $message = ' No passphrase provided for keys: "' . |
| | | implode('", "', $badPassphrases) . '".'; |
| | | } |
| | | |
| | | throw new Crypt_GPG_BadPassphraseException($message, $code, |
| | | $badPassphrases, $missingPassphrases); |
| | | |
| | | case Crypt_GPG::ERROR_NO_DATA: |
| | | throw new Crypt_GPG_NoDataException( |
| | | 'Cannot decrypt data. No PGP encrypted data was found in '. |
| | | 'the provided data.', $code); |
| | | |
| | | default: |
| | | throw new Crypt_GPG_Exception( |
| | | 'Unknown error decrypting data.', $code); |
| | | } |
| | | } |
| | | |
| | | // }}} |
| | | } |
| | | |
| | | ?> |
New file |
| | |
| | | <?php |
| | | |
| | | /* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */ |
| | | |
| | | /** |
| | | * Crypt_GPG is a package to use GPG from PHP |
| | | * |
| | | * This file contains an engine that handles GPG subprocess control and I/O. |
| | | * PHP's process manipulation functions are used to handle the GPG subprocess. |
| | | * |
| | | * PHP version 5 |
| | | * |
| | | * LICENSE: |
| | | * |
| | | * This library is free software; you can redistribute it and/or modify |
| | | * it under the terms of the GNU Lesser General Public License as |
| | | * published by the Free Software Foundation; either version 2.1 of the |
| | | * License, or (at your option) any later version. |
| | | * |
| | | * This library is distributed in the hope that it will be useful, |
| | | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| | | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| | | * Lesser General Public License for more details. |
| | | * |
| | | * You should have received a copy of the GNU Lesser General Public |
| | | * License along with this library; if not, write to the Free Software |
| | | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
| | | * |
| | | * @category Encryption |
| | | * @package Crypt_GPG |
| | | * @author Nathan Fredrickson <nathan@silverorange.com> |
| | | * @author Michael Gauthier <mike@silverorange.com> |
| | | * @copyright 2005-2010 silverorange |
| | | * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1 |
| | | * @version CVS: $Id: Engine.php 302822 2010-08-26 17:30:57Z gauthierm $ |
| | | * @link http://pear.php.net/package/Crypt_GPG |
| | | * @link http://www.gnupg.org/ |
| | | */ |
| | | |
| | | /** |
| | | * Crypt_GPG base class. |
| | | */ |
| | | require_once 'Crypt/GPG.php'; |
| | | |
| | | /** |
| | | * GPG exception classes. |
| | | */ |
| | | require_once 'Crypt/GPG/Exceptions.php'; |
| | | |
| | | /** |
| | | * Standard PEAR exception is used if GPG binary is not found. |
| | | */ |
| | | require_once 'PEAR/Exception.php'; |
| | | |
| | | // {{{ class Crypt_GPG_Engine |
| | | |
| | | /** |
| | | * Native PHP Crypt_GPG I/O engine |
| | | * |
| | | * This class is used internally by Crypt_GPG and does not need be used |
| | | * directly. See the {@link Crypt_GPG} class for end-user API. |
| | | * |
| | | * This engine uses PHP's native process control functions to directly control |
| | | * the GPG process. The GPG executable is required to be on the system. |
| | | * |
| | | * All data is passed to the GPG subprocess using file descriptors. This is the |
| | | * most secure method of passing data to the GPG subprocess. |
| | | * |
| | | * @category Encryption |
| | | * @package Crypt_GPG |
| | | * @author Nathan Fredrickson <nathan@silverorange.com> |
| | | * @author Michael Gauthier <mike@silverorange.com> |
| | | * @copyright 2005-2010 silverorange |
| | | * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1 |
| | | * @link http://pear.php.net/package/Crypt_GPG |
| | | * @link http://www.gnupg.org/ |
| | | */ |
| | | class Crypt_GPG_Engine |
| | | { |
| | | // {{{ constants |
| | | |
| | | /** |
| | | * Size of data chunks that are sent to and retrieved from the IPC pipes. |
| | | * |
| | | * PHP reads 8192 bytes. If this is set to less than 8192, PHP reads 8192 |
| | | * and buffers the rest so we might as well just read 8192. |
| | | * |
| | | * Using values other than 8192 also triggers PHP bugs. |
| | | * |
| | | * @see http://bugs.php.net/bug.php?id=35224 |
| | | */ |
| | | const CHUNK_SIZE = 8192; |
| | | |
| | | /** |
| | | * Standard input file descriptor. This is used to pass data to the GPG |
| | | * process. |
| | | */ |
| | | const FD_INPUT = 0; |
| | | |
| | | /** |
| | | * Standard output file descriptor. This is used to receive normal output |
| | | * from the GPG process. |
| | | */ |
| | | const FD_OUTPUT = 1; |
| | | |
| | | /** |
| | | * Standard output file descriptor. This is used to receive error output |
| | | * from the GPG process. |
| | | */ |
| | | const FD_ERROR = 2; |
| | | |
| | | /** |
| | | * GPG status output file descriptor. The status file descriptor outputs |
| | | * detailed information for many GPG commands. See the second section of |
| | | * the file <b>doc/DETAILS</b> in the |
| | | * {@link http://www.gnupg.org/download/ GPG package} for a detailed |
| | | * description of GPG's status output. |
| | | */ |
| | | const FD_STATUS = 3; |
| | | |
| | | /** |
| | | * Command input file descriptor. This is used for methods requiring |
| | | * passphrases. |
| | | */ |
| | | const FD_COMMAND = 4; |
| | | |
| | | /** |
| | | * Extra message input file descriptor. This is used for passing signed |
| | | * data when verifying a detached signature. |
| | | */ |
| | | const FD_MESSAGE = 5; |
| | | |
| | | /** |
| | | * Minimum version of GnuPG that is supported. |
| | | */ |
| | | const MIN_VERSION = '1.0.2'; |
| | | |
| | | // }}} |
| | | // {{{ private class properties |
| | | |
| | | /** |
| | | * Whether or not to use debugging mode |
| | | * |
| | | * When set to true, every GPG command is echoed before it is run. Sensitive |
| | | * data is always handled using pipes and is not specified as part of the |
| | | * command. As a result, sensitive data is never displayed when debug is |
| | | * enabled. Sensitive data includes private key data and passphrases. |
| | | * |
| | | * Debugging is off by default. |
| | | * |
| | | * @var boolean |
| | | * @see Crypt_GPG_Engine::__construct() |
| | | */ |
| | | private $_debug = false; |
| | | |
| | | /** |
| | | * Location of GPG binary |
| | | * |
| | | * @var string |
| | | * @see Crypt_GPG_Engine::__construct() |
| | | * @see Crypt_GPG_Engine::_getBinary() |
| | | */ |
| | | private $_binary = ''; |
| | | |
| | | /** |
| | | * Directory containing the GPG key files |
| | | * |
| | | * This property only contains the path when the <i>homedir</i> option |
| | | * is specified in the constructor. |
| | | * |
| | | * @var string |
| | | * @see Crypt_GPG_Engine::__construct() |
| | | */ |
| | | private $_homedir = ''; |
| | | |
| | | /** |
| | | * File path of the public keyring |
| | | * |
| | | * This property only contains the file path when the <i>public_keyring</i> |
| | | * option is specified in the constructor. |
| | | * |
| | | * If the specified file path starts with <kbd>~/</kbd>, the path is |
| | | * relative to the <i>homedir</i> if specified, otherwise to |
| | | * <kbd>~/.gnupg</kbd>. |
| | | * |
| | | * @var string |
| | | * @see Crypt_GPG_Engine::__construct() |
| | | */ |
| | | private $_publicKeyring = ''; |
| | | |
| | | /** |
| | | * File path of the private (secret) keyring |
| | | * |
| | | * This property only contains the file path when the <i>private_keyring</i> |
| | | * option is specified in the constructor. |
| | | * |
| | | * If the specified file path starts with <kbd>~/</kbd>, the path is |
| | | * relative to the <i>homedir</i> if specified, otherwise to |
| | | * <kbd>~/.gnupg</kbd>. |
| | | * |
| | | * @var string |
| | | * @see Crypt_GPG_Engine::__construct() |
| | | */ |
| | | private $_privateKeyring = ''; |
| | | |
| | | /** |
| | | * File path of the trust database |
| | | * |
| | | * This property only contains the file path when the <i>trust_db</i> |
| | | * option is specified in the constructor. |
| | | * |
| | | * If the specified file path starts with <kbd>~/</kbd>, the path is |
| | | * relative to the <i>homedir</i> if specified, otherwise to |
| | | * <kbd>~/.gnupg</kbd>. |
| | | * |
| | | * @var string |
| | | * @see Crypt_GPG_Engine::__construct() |
| | | */ |
| | | private $_trustDb = ''; |
| | | |
| | | /** |
| | | * Array of pipes used for communication with the GPG binary |
| | | * |
| | | * This is an array of file descriptor resources. |
| | | * |
| | | * @var array |
| | | */ |
| | | private $_pipes = array(); |
| | | |
| | | /** |
| | | * Array of currently opened pipes |
| | | * |
| | | * This array is used to keep track of remaining opened pipes so they can |
| | | * be closed when the GPG subprocess is finished. This array is a subset of |
| | | * the {@link Crypt_GPG_Engine::$_pipes} array and contains opened file |
| | | * descriptor resources. |
| | | * |
| | | * @var array |
| | | * @see Crypt_GPG_Engine::_closePipe() |
| | | */ |
| | | private $_openPipes = array(); |
| | | |
| | | /** |
| | | * A handle for the GPG process |
| | | * |
| | | * @var resource |
| | | */ |
| | | private $_process = null; |
| | | |
| | | /** |
| | | * Whether or not the operating system is Darwin (OS X) |
| | | * |
| | | * @var boolean |
| | | */ |
| | | private $_isDarwin = false; |
| | | |
| | | /** |
| | | * Commands to be sent to GPG's command input stream |
| | | * |
| | | * @var string |
| | | * @see Crypt_GPG_Engine::sendCommand() |
| | | */ |
| | | private $_commandBuffer = ''; |
| | | |
| | | /** |
| | | * Array of status line handlers |
| | | * |
| | | * @var array |
| | | * @see Crypt_GPG_Engine::addStatusHandler() |
| | | */ |
| | | private $_statusHandlers = array(); |
| | | |
| | | /** |
| | | * Array of error line handlers |
| | | * |
| | | * @var array |
| | | * @see Crypt_GPG_Engine::addErrorHandler() |
| | | */ |
| | | private $_errorHandlers = array(); |
| | | |
| | | /** |
| | | * The error code of the current operation |
| | | * |
| | | * @var integer |
| | | * @see Crypt_GPG_Engine::getErrorCode() |
| | | */ |
| | | private $_errorCode = Crypt_GPG::ERROR_NONE; |
| | | |
| | | /** |
| | | * File related to the error code of the current operation |
| | | * |
| | | * @var string |
| | | * @see Crypt_GPG_Engine::getErrorFilename() |
| | | */ |
| | | private $_errorFilename = ''; |
| | | |
| | | /** |
| | | * Key id related to the error code of the current operation |
| | | * |
| | | * @var string |
| | | * @see Crypt_GPG_Engine::getErrorKeyId() |
| | | */ |
| | | private $_errorkeyId = ''; |
| | | |
| | | /** |
| | | * The number of currently needed passphrases |
| | | * |
| | | * If this is not zero when the GPG command is completed, the error code is |
| | | * set to {@link Crypt_GPG::ERROR_MISSING_PASSPHRASE}. |
| | | * |
| | | * @var integer |
| | | */ |
| | | private $_needPassphrase = 0; |
| | | |
| | | /** |
| | | * The input source |
| | | * |
| | | * This is data to send to GPG. Either a string or a stream resource. |
| | | * |
| | | * @var string|resource |
| | | * @see Crypt_GPG_Engine::setInput() |
| | | */ |
| | | private $_input = null; |
| | | |
| | | /** |
| | | * The extra message input source |
| | | * |
| | | * Either a string or a stream resource. |
| | | * |
| | | * @var string|resource |
| | | * @see Crypt_GPG_Engine::setMessage() |
| | | */ |
| | | private $_message = null; |
| | | |
| | | /** |
| | | * The output location |
| | | * |
| | | * This is where the output from GPG is sent. Either a string or a stream |
| | | * resource. |
| | | * |
| | | * @var string|resource |
| | | * @see Crypt_GPG_Engine::setOutput() |
| | | */ |
| | | private $_output = ''; |
| | | |
| | | /** |
| | | * The GPG operation to execute |
| | | * |
| | | * @var string |
| | | * @see Crypt_GPG_Engine::setOperation() |
| | | */ |
| | | private $_operation; |
| | | |
| | | /** |
| | | * Arguments for the current operation |
| | | * |
| | | * @var array |
| | | * @see Crypt_GPG_Engine::setOperation() |
| | | */ |
| | | private $_arguments = array(); |
| | | |
| | | /** |
| | | * The version number of the GPG binary |
| | | * |
| | | * @var string |
| | | * @see Crypt_GPG_Engine::getVersion() |
| | | */ |
| | | private $_version = ''; |
| | | |
| | | /** |
| | | * Cached value indicating whether or not mbstring function overloading is |
| | | * on for strlen |
| | | * |
| | | * This is cached for optimal performance inside the I/O loop. |
| | | * |
| | | * @var boolean |
| | | * @see Crypt_GPG_Engine::_byteLength() |
| | | * @see Crypt_GPG_Engine::_byteSubstring() |
| | | */ |
| | | private static $_mbStringOverload = null; |
| | | |
| | | // }}} |
| | | // {{{ __construct() |
| | | |
| | | /** |
| | | * Creates a new GPG engine |
| | | * |
| | | * Available options are: |
| | | * |
| | | * - <kbd>string homedir</kbd> - the directory where the GPG |
| | | * keyring files are stored. If not |
| | | * specified, Crypt_GPG uses the |
| | | * default of <kbd>~/.gnupg</kbd>. |
| | | * - <kbd>string publicKeyring</kbd> - the file path of the public |
| | | * keyring. Use this if the public |
| | | * keyring is not in the homedir, or |
| | | * if the keyring is in a directory |
| | | * not writable by the process |
| | | * invoking GPG (like Apache). Then |
| | | * you can specify the path to the |
| | | * keyring with this option |
| | | * (/foo/bar/pubring.gpg), and specify |
| | | * a writable directory (like /tmp) |
| | | * using the <i>homedir</i> option. |
| | | * - <kbd>string privateKeyring</kbd> - the file path of the private |
| | | * keyring. Use this if the private |
| | | * keyring is not in the homedir, or |
| | | * if the keyring is in a directory |
| | | * not writable by the process |
| | | * invoking GPG (like Apache). Then |
| | | * you can specify the path to the |
| | | * keyring with this option |
| | | * (/foo/bar/secring.gpg), and specify |
| | | * a writable directory (like /tmp) |
| | | * using the <i>homedir</i> option. |
| | | * - <kbd>string trustDb</kbd> - the file path of the web-of-trust |
| | | * database. Use this if the trust |
| | | * database is not in the homedir, or |
| | | * if the database is in a directory |
| | | * not writable by the process |
| | | * invoking GPG (like Apache). Then |
| | | * you can specify the path to the |
| | | * trust database with this option |
| | | * (/foo/bar/trustdb.gpg), and specify |
| | | * a writable directory (like /tmp) |
| | | * using the <i>homedir</i> option. |
| | | * - <kbd>string binary</kbd> - the location of the GPG binary. If |
| | | * not specified, the driver attempts |
| | | * to auto-detect the GPG binary |
| | | * location using a list of known |
| | | * default locations for the current |
| | | * operating system. The option |
| | | * <kbd>gpgBinary</kbd> is a |
| | | * deprecated alias for this option. |
| | | * - <kbd>boolean debug</kbd> - whether or not to use debug mode. |
| | | * When debug mode is on, all |
| | | * communication to and from the GPG |
| | | * subprocess is logged. This can be |
| | | * useful to diagnose errors when |
| | | * using Crypt_GPG. |
| | | * |
| | | * @param array $options optional. An array of options used to create the |
| | | * GPG object. All options are optional and are |
| | | * represented as key-value pairs. |
| | | * |
| | | * @throws Crypt_GPG_FileException if the <kbd>homedir</kbd> does not exist |
| | | * and cannot be created. This can happen if <kbd>homedir</kbd> is |
| | | * not specified, Crypt_GPG is run as the web user, and the web |
| | | * user has no home directory. This exception is also thrown if any |
| | | * of the options <kbd>publicKeyring</kbd>, |
| | | * <kbd>privateKeyring</kbd> or <kbd>trustDb</kbd> options are |
| | | * specified but the files do not exist or are are not readable. |
| | | * This can happen if the user running the Crypt_GPG process (for |
| | | * example, the Apache user) does not have permission to read the |
| | | * files. |
| | | * |
| | | * @throws PEAR_Exception if the provided <kbd>binary</kbd> is invalid, or |
| | | * if no <kbd>binary</kbd> is provided and no suitable binary could |
| | | * be found. |
| | | */ |
| | | public function __construct(array $options = array()) |
| | | { |
| | | $this->_isDarwin = (strncmp(strtoupper(PHP_OS), 'DARWIN', 6) === 0); |
| | | |
| | | // populate mbstring overloading cache if not set |
| | | if (self::$_mbStringOverload === null) { |
| | | self::$_mbStringOverload = (extension_loaded('mbstring') |
| | | && (ini_get('mbstring.func_overload') & 0x02) === 0x02); |
| | | } |
| | | |
| | | // get homedir |
| | | if (array_key_exists('homedir', $options)) { |
| | | $this->_homedir = (string)$options['homedir']; |
| | | } else { |
| | | // note: this requires the package OS dep exclude 'windows' |
| | | $info = posix_getpwuid(posix_getuid()); |
| | | $this->_homedir = $info['dir'].'/.gnupg'; |
| | | } |
| | | |
| | | // attempt to create homedir if it does not exist |
| | | if (!is_dir($this->_homedir)) { |
| | | if (@mkdir($this->_homedir, 0777, true)) { |
| | | // Set permissions on homedir. Parent directories are created |
| | | // with 0777, homedir is set to 0700. |
| | | chmod($this->_homedir, 0700); |
| | | } else { |
| | | throw new Crypt_GPG_FileException('The \'homedir\' "' . |
| | | $this->_homedir . '" is not readable or does not exist '. |
| | | 'and cannot be created. This can happen if \'homedir\' '. |
| | | 'is not specified in the Crypt_GPG options, Crypt_GPG is '. |
| | | 'run as the web user, and the web user has no home '. |
| | | 'directory.', |
| | | 0, $this->_homedir); |
| | | } |
| | | } |
| | | |
| | | // get binary |
| | | if (array_key_exists('binary', $options)) { |
| | | $this->_binary = (string)$options['binary']; |
| | | } elseif (array_key_exists('gpgBinary', $options)) { |
| | | // deprecated alias |
| | | $this->_binary = (string)$options['gpgBinary']; |
| | | } else { |
| | | $this->_binary = $this->_getBinary(); |
| | | } |
| | | |
| | | if ($this->_binary == '' || !is_executable($this->_binary)) { |
| | | throw new PEAR_Exception('GPG binary not found. If you are sure '. |
| | | 'the GPG binary is installed, please specify the location of '. |
| | | 'the GPG binary using the \'binary\' driver option.'); |
| | | } |
| | | |
| | | /* |
| | | * Note: |
| | | * |
| | | * Normally, GnuPG expects keyrings to be in the homedir and expects |
| | | * to be able to write temporary files in the homedir. Sometimes, |
| | | * keyrings are not in the homedir, or location of the keyrings does |
| | | * not allow writing temporary files. In this case, the <i>homedir</i> |
| | | * option by itself is not enough to specify the keyrings because GnuPG |
| | | * can not write required temporary files. Additional options are |
| | | * provided so you can specify the location of the keyrings separately |
| | | * from the homedir. |
| | | */ |
| | | |
| | | // get public keyring |
| | | if (array_key_exists('publicKeyring', $options)) { |
| | | $this->_publicKeyring = (string)$options['publicKeyring']; |
| | | if (!is_readable($this->_publicKeyring)) { |
| | | throw new Crypt_GPG_FileException('The \'publicKeyring\' "' . |
| | | $this->_publicKeyring . '" does not exist or is ' . |
| | | 'not readable. Check the location and ensure the file ' . |
| | | 'permissions are correct.', 0, $this->_publicKeyring); |
| | | } |
| | | } |
| | | |
| | | // get private keyring |
| | | if (array_key_exists('privateKeyring', $options)) { |
| | | $this->_privateKeyring = (string)$options['privateKeyring']; |
| | | if (!is_readable($this->_privateKeyring)) { |
| | | throw new Crypt_GPG_FileException('The \'privateKeyring\' "' . |
| | | $this->_privateKeyring . '" does not exist or is ' . |
| | | 'not readable. Check the location and ensure the file ' . |
| | | 'permissions are correct.', 0, $this->_privateKeyring); |
| | | } |
| | | } |
| | | |
| | | // get trust database |
| | | if (array_key_exists('trustDb', $options)) { |
| | | $this->_trustDb = (string)$options['trustDb']; |
| | | if (!is_readable($this->_trustDb)) { |
| | | throw new Crypt_GPG_FileException('The \'trustDb\' "' . |
| | | $this->_trustDb . '" does not exist or is not readable. ' . |
| | | 'Check the location and ensure the file permissions are ' . |
| | | 'correct.', 0, $this->_trustDb); |
| | | } |
| | | } |
| | | |
| | | if (array_key_exists('debug', $options)) { |
| | | $this->_debug = (boolean)$options['debug']; |
| | | } |
| | | } |
| | | |
| | | // }}} |
| | | // {{{ __destruct() |
| | | |
| | | /** |
| | | * Closes open GPG subprocesses when this object is destroyed |
| | | * |
| | | * Subprocesses should never be left open by this class unless there is |
| | | * an unknown error and unexpected script termination occurs. |
| | | */ |
| | | public function __destruct() |
| | | { |
| | | $this->_closeSubprocess(); |
| | | } |
| | | |
| | | // }}} |
| | | // {{{ addErrorHandler() |
| | | |
| | | /** |
| | | * Adds an error handler method |
| | | * |
| | | * The method is run every time a new error line is received from the GPG |
| | | * subprocess. The handler method must accept the error line to be handled |
| | | * as its first parameter. |
| | | * |
| | | * @param callback $callback the callback method to use. |
| | | * @param array $args optional. Additional arguments to pass as |
| | | * parameters to the callback method. |
| | | * |
| | | * @return void |
| | | */ |
| | | public function addErrorHandler($callback, array $args = array()) |
| | | { |
| | | $this->_errorHandlers[] = array( |
| | | 'callback' => $callback, |
| | | 'args' => $args |
| | | ); |
| | | } |
| | | |
| | | // }}} |
| | | // {{{ addStatusHandler() |
| | | |
| | | /** |
| | | * Adds a status handler method |
| | | * |
| | | * The method is run every time a new status line is received from the |
| | | * GPG subprocess. The handler method must accept the status line to be |
| | | * handled as its first parameter. |
| | | * |
| | | * @param callback $callback the callback method to use. |
| | | * @param array $args optional. Additional arguments to pass as |
| | | * parameters to the callback method. |
| | | * |
| | | * @return void |
| | | */ |
| | | public function addStatusHandler($callback, array $args = array()) |
| | | { |
| | | $this->_statusHandlers[] = array( |
| | | 'callback' => $callback, |
| | | 'args' => $args |
| | | ); |
| | | } |
| | | |
| | | // }}} |
| | | // {{{ sendCommand() |
| | | |
| | | /** |
| | | * Sends a command to the GPG subprocess over the command file-descriptor |
| | | * pipe |
| | | * |
| | | * @param string $command the command to send. |
| | | * |
| | | * @return void |
| | | * |
| | | * @sensitive $command |
| | | */ |
| | | public function sendCommand($command) |
| | | { |
| | | if (array_key_exists(self::FD_COMMAND, $this->_openPipes)) { |
| | | $this->_commandBuffer .= $command . PHP_EOL; |
| | | } |
| | | } |
| | | |
| | | // }}} |
| | | // {{{ reset() |
| | | |
| | | /** |
| | | * Resets the GPG engine, preparing it for a new operation |
| | | * |
| | | * @return void |
| | | * |
| | | * @see Crypt_GPG_Engine::run() |
| | | * @see Crypt_GPG_Engine::setOperation() |
| | | */ |
| | | public function reset() |
| | | { |
| | | $this->_operation = ''; |
| | | $this->_arguments = array(); |
| | | $this->_input = null; |
| | | $this->_message = null; |
| | | $this->_output = ''; |
| | | $this->_errorCode = Crypt_GPG::ERROR_NONE; |
| | | $this->_needPassphrase = 0; |
| | | $this->_commandBuffer = ''; |
| | | |
| | | $this->_statusHandlers = array(); |
| | | $this->_errorHandlers = array(); |
| | | |
| | | $this->addStatusHandler(array($this, '_handleErrorStatus')); |
| | | $this->addErrorHandler(array($this, '_handleErrorError')); |
| | | |
| | | if ($this->_debug) { |
| | | $this->addStatusHandler(array($this, '_handleDebugStatus')); |
| | | $this->addErrorHandler(array($this, '_handleDebugError')); |
| | | } |
| | | } |
| | | |
| | | // }}} |
| | | // {{{ run() |
| | | |
| | | /** |
| | | * Runs the current GPG operation |
| | | * |
| | | * This creates and manages the GPG subprocess. |
| | | * |
| | | * The operation must be set with {@link Crypt_GPG_Engine::setOperation()} |
| | | * before this method is called. |
| | | * |
| | | * @return void |
| | | * |
| | | * @throws Crypt_GPG_InvalidOperationException if no operation is specified. |
| | | * |
| | | * @see Crypt_GPG_Engine::reset() |
| | | * @see Crypt_GPG_Engine::setOperation() |
| | | */ |
| | | public function run() |
| | | { |
| | | if ($this->_operation === '') { |
| | | throw new Crypt_GPG_InvalidOperationException('No GPG operation ' . |
| | | 'specified. Use Crypt_GPG_Engine::setOperation() before ' . |
| | | 'calling Crypt_GPG_Engine::run().'); |
| | | } |
| | | |
| | | $this->_openSubprocess(); |
| | | $this->_process(); |
| | | $this->_closeSubprocess(); |
| | | } |
| | | |
| | | // }}} |
| | | // {{{ getErrorCode() |
| | | |
| | | /** |
| | | * Gets the error code of the last executed operation |
| | | * |
| | | * This value is only meaningful after {@link Crypt_GPG_Engine::run()} has |
| | | * been executed. |
| | | * |
| | | * @return integer the error code of the last executed operation. |
| | | */ |
| | | public function getErrorCode() |
| | | { |
| | | return $this->_errorCode; |
| | | } |
| | | |
| | | // }}} |
| | | // {{{ getErrorFilename() |
| | | |
| | | /** |
| | | * Gets the file related to the error code of the last executed operation |
| | | * |
| | | * This value is only meaningful after {@link Crypt_GPG_Engine::run()} has |
| | | * been executed. If there is no file related to the error, an empty string |
| | | * is returned. |
| | | * |
| | | * @return string the file related to the error code of the last executed |
| | | * operation. |
| | | */ |
| | | public function getErrorFilename() |
| | | { |
| | | return $this->_errorFilename; |
| | | } |
| | | |
| | | // }}} |
| | | // {{{ getErrorKeyId() |
| | | |
| | | /** |
| | | * Gets the key id related to the error code of the last executed operation |
| | | * |
| | | * This value is only meaningful after {@link Crypt_GPG_Engine::run()} has |
| | | * been executed. If there is no key id related to the error, an empty |
| | | * string is returned. |
| | | * |
| | | * @return string the key id related to the error code of the last executed |
| | | * operation. |
| | | */ |
| | | public function getErrorKeyId() |
| | | { |
| | | return $this->_errorKeyId; |
| | | } |
| | | |
| | | // }}} |
| | | // {{{ setInput() |
| | | |
| | | /** |
| | | * Sets the input source for the current GPG operation |
| | | * |
| | | * @param string|resource &$input either a reference to the string |
| | | * containing the input data or an open |
| | | * stream resource containing the input |
| | | * data. |
| | | * |
| | | * @return void |
| | | */ |
| | | public function setInput(&$input) |
| | | { |
| | | $this->_input =& $input; |
| | | } |
| | | |
| | | // }}} |
| | | // {{{ setMessage() |
| | | |
| | | /** |
| | | * Sets the message source for the current GPG operation |
| | | * |
| | | * Detached signature data should be specified here. |
| | | * |
| | | * @param string|resource &$message either a reference to the string |
| | | * containing the message data or an open |
| | | * stream resource containing the message |
| | | * data. |
| | | * |
| | | * @return void |
| | | */ |
| | | public function setMessage(&$message) |
| | | { |
| | | $this->_message =& $message; |
| | | } |
| | | |
| | | // }}} |
| | | // {{{ setOutput() |
| | | |
| | | /** |
| | | * Sets the output destination for the current GPG operation |
| | | * |
| | | * @param string|resource &$output either a reference to the string in |
| | | * which to store GPG output or an open |
| | | * stream resource to which the output data |
| | | * should be written. |
| | | * |
| | | * @return void |
| | | */ |
| | | public function setOutput(&$output) |
| | | { |
| | | $this->_output =& $output; |
| | | } |
| | | |
| | | // }}} |
| | | // {{{ setOperation() |
| | | |
| | | /** |
| | | * Sets the operation to perform |
| | | * |
| | | * @param string $operation the operation to perform. This should be one |
| | | * of GPG's operations. For example, |
| | | * <kbd>--encrypt</kbd>, <kbd>--decrypt</kbd>, |
| | | * <kbd>--sign</kbd>, etc. |
| | | * @param array $arguments optional. Additional arguments for the GPG |
| | | * subprocess. See the GPG manual for specific |
| | | * values. |
| | | * |
| | | * @return void |
| | | * |
| | | * @see Crypt_GPG_Engine::reset() |
| | | * @see Crypt_GPG_Engine::run() |
| | | */ |
| | | public function setOperation($operation, array $arguments = array()) |
| | | { |
| | | $this->_operation = $operation; |
| | | $this->_arguments = $arguments; |
| | | } |
| | | |
| | | // }}} |
| | | // {{{ getVersion() |
| | | |
| | | /** |
| | | * Gets the version of the GnuPG binary |
| | | * |
| | | * @return string a version number string containing the version of GnuPG |
| | | * being used. This value is suitable to use with PHP's |
| | | * version_compare() function. |
| | | * |
| | | * @throws Crypt_GPG_Exception if an unknown or unexpected error occurs. |
| | | * Use the <kbd>debug</kbd> option and file a bug report if these |
| | | * exceptions occur. |
| | | * |
| | | * @throws Crypt_GPG_UnsupportedException if the provided binary is not |
| | | * GnuPG or if the GnuPG version is less than 1.0.2. |
| | | */ |
| | | public function getVersion() |
| | | { |
| | | if ($this->_version == '') { |
| | | |
| | | $options = array( |
| | | 'homedir' => $this->_homedir, |
| | | 'binary' => $this->_binary, |
| | | 'debug' => $this->_debug |
| | | ); |
| | | |
| | | $engine = new self($options); |
| | | $info = ''; |
| | | |
| | | // Set a garbage version so we do not end up looking up the version |
| | | // recursively. |
| | | $engine->_version = '1.0.0'; |
| | | |
| | | $engine->reset(); |
| | | $engine->setOutput($info); |
| | | $engine->setOperation('--version'); |
| | | $engine->run(); |
| | | |
| | | $code = $this->getErrorCode(); |
| | | |
| | | if ($code !== Crypt_GPG::ERROR_NONE) { |
| | | throw new Crypt_GPG_Exception( |
| | | 'Unknown error getting GnuPG version information. Please ' . |
| | | 'use the \'debug\' option when creating the Crypt_GPG ' . |
| | | 'object, and file a bug report at ' . Crypt_GPG::BUG_URI, |
| | | $code); |
| | | } |
| | | |
| | | $matches = array(); |
| | | $expression = '/gpg \(GnuPG\) (\S+)/'; |
| | | |
| | | if (preg_match($expression, $info, $matches) === 1) { |
| | | $this->_version = $matches[1]; |
| | | } else { |
| | | throw new Crypt_GPG_Exception( |
| | | 'No GnuPG version information provided by the binary "' . |
| | | $this->_binary . '". Are you sure it is GnuPG?'); |
| | | } |
| | | |
| | | if (version_compare($this->_version, self::MIN_VERSION, 'lt')) { |
| | | throw new Crypt_GPG_Exception( |
| | | 'The version of GnuPG being used (' . $this->_version . |
| | | ') is not supported by Crypt_GPG. The minimum version ' . |
| | | 'required by Crypt_GPG is ' . self::MIN_VERSION); |
| | | } |
| | | } |
| | | |
| | | |
| | | return $this->_version; |
| | | } |
| | | |
| | | // }}} |
| | | // {{{ _handleErrorStatus() |
| | | |
| | | /** |
| | | * Handles error values in the status output from GPG |
| | | * |
| | | * This method is responsible for setting the |
| | | * {@link Crypt_GPG_Engine::$_errorCode}. See <b>doc/DETAILS</b> in the |
| | | * {@link http://www.gnupg.org/download/ GPG distribution} for detailed |
| | | * information on GPG's status output. |
| | | * |
| | | * @param string $line the status line to handle. |
| | | * |
| | | * @return void |
| | | */ |
| | | private function _handleErrorStatus($line) |
| | | { |
| | | $tokens = explode(' ', $line); |
| | | switch ($tokens[0]) { |
| | | case 'BAD_PASSPHRASE': |
| | | $this->_errorCode = Crypt_GPG::ERROR_BAD_PASSPHRASE; |
| | | break; |
| | | |
| | | case 'MISSING_PASSPHRASE': |
| | | $this->_errorCode = Crypt_GPG::ERROR_MISSING_PASSPHRASE; |
| | | break; |
| | | |
| | | case 'NODATA': |
| | | $this->_errorCode = Crypt_GPG::ERROR_NO_DATA; |
| | | break; |
| | | |
| | | case 'DELETE_PROBLEM': |
| | | if ($tokens[1] == '1') { |
| | | $this->_errorCode = Crypt_GPG::ERROR_KEY_NOT_FOUND; |
| | | break; |
| | | } elseif ($tokens[1] == '2') { |
| | | $this->_errorCode = Crypt_GPG::ERROR_DELETE_PRIVATE_KEY; |
| | | break; |
| | | } |
| | | break; |
| | | |
| | | case 'IMPORT_RES': |
| | | if ($tokens[12] > 0) { |
| | | $this->_errorCode = Crypt_GPG::ERROR_DUPLICATE_KEY; |
| | | } |
| | | break; |
| | | |
| | | case 'NO_PUBKEY': |
| | | case 'NO_SECKEY': |
| | | $this->_errorKeyId = $tokens[1]; |
| | | $this->_errorCode = Crypt_GPG::ERROR_KEY_NOT_FOUND; |
| | | break; |
| | | |
| | | case 'NEED_PASSPHRASE': |
| | | $this->_needPassphrase++; |
| | | break; |
| | | |
| | | case 'GOOD_PASSPHRASE': |
| | | $this->_needPassphrase--; |
| | | break; |
| | | |
| | | case 'EXPSIG': |
| | | case 'EXPKEYSIG': |
| | | case 'REVKEYSIG': |
| | | case 'BADSIG': |
| | | $this->_errorCode = Crypt_GPG::ERROR_BAD_SIGNATURE; |
| | | break; |
| | | |
| | | } |
| | | } |
| | | |
| | | // }}} |
| | | // {{{ _handleErrorError() |
| | | |
| | | /** |
| | | * Handles error values in the error output from GPG |
| | | * |
| | | * This method is responsible for setting the |
| | | * {@link Crypt_GPG_Engine::$_errorCode}. |
| | | * |
| | | * @param string $line the error line to handle. |
| | | * |
| | | * @return void |
| | | */ |
| | | private function _handleErrorError($line) |
| | | { |
| | | if ($this->_errorCode === Crypt_GPG::ERROR_NONE) { |
| | | $pattern = '/no valid OpenPGP data found/'; |
| | | if (preg_match($pattern, $line) === 1) { |
| | | $this->_errorCode = Crypt_GPG::ERROR_NO_DATA; |
| | | } |
| | | } |
| | | |
| | | if ($this->_errorCode === Crypt_GPG::ERROR_NONE) { |
| | | $pattern = '/No secret key|secret key not available/'; |
| | | if (preg_match($pattern, $line) === 1) { |
| | | $this->_errorCode = Crypt_GPG::ERROR_KEY_NOT_FOUND; |
| | | } |
| | | } |
| | | |
| | | if ($this->_errorCode === Crypt_GPG::ERROR_NONE) { |
| | | $pattern = '/No public key|public key not found/'; |
| | | if (preg_match($pattern, $line) === 1) { |
| | | $this->_errorCode = Crypt_GPG::ERROR_KEY_NOT_FOUND; |
| | | } |
| | | } |
| | | |
| | | if ($this->_errorCode === Crypt_GPG::ERROR_NONE) { |
| | | $matches = array(); |
| | | $pattern = '/can\'t (?:access|open) `(.*?)\'/'; |
| | | if (preg_match($pattern, $line, $matches) === 1) { |
| | | $this->_errorFilename = $matches[1]; |
| | | $this->_errorCode = Crypt_GPG::ERROR_FILE_PERMISSIONS; |
| | | } |
| | | } |
| | | } |
| | | |
| | | // }}} |
| | | // {{{ _handleDebugStatus() |
| | | |
| | | /** |
| | | * Displays debug output for status lines |
| | | * |
| | | * @param string $line the status line to handle. |
| | | * |
| | | * @return void |
| | | */ |
| | | private function _handleDebugStatus($line) |
| | | { |
| | | $this->_debug('STATUS: ' . $line); |
| | | } |
| | | |
| | | // }}} |
| | | // {{{ _handleDebugError() |
| | | |
| | | /** |
| | | * Displays debug output for error lines |
| | | * |
| | | * @param string $line the error line to handle. |
| | | * |
| | | * @return void |
| | | */ |
| | | private function _handleDebugError($line) |
| | | { |
| | | $this->_debug('ERROR: ' . $line); |
| | | } |
| | | |
| | | // }}} |
| | | // {{{ _process() |
| | | |
| | | /** |
| | | * Performs internal streaming operations for the subprocess using either |
| | | * strings or streams as input / output points |
| | | * |
| | | * This is the main I/O loop for streaming to and from the GPG subprocess. |
| | | * |
| | | * The implementation of this method is verbose mainly for performance |
| | | * reasons. Adding streams to a lookup array and looping the array inside |
| | | * the main I/O loop would be siginficantly slower for large streams. |
| | | * |
| | | * @return void |
| | | * |
| | | * @throws Crypt_GPG_Exception if there is an error selecting streams for |
| | | * reading or writing. If this occurs, please file a bug report at |
| | | * http://pear.php.net/bugs/report.php?package=Crypt_GPG. |
| | | */ |
| | | private function _process() |
| | | { |
| | | $this->_debug('BEGIN PROCESSING'); |
| | | |
| | | $this->_commandBuffer = ''; // buffers input to GPG |
| | | $messageBuffer = ''; // buffers input to GPG |
| | | $inputBuffer = ''; // buffers input to GPG |
| | | $outputBuffer = ''; // buffers output from GPG |
| | | $statusBuffer = ''; // buffers output from GPG |
| | | $errorBuffer = ''; // buffers output from GPG |
| | | $inputComplete = false; // input stream is completely buffered |
| | | $messageComplete = false; // message stream is completely buffered |
| | | |
| | | if (is_string($this->_input)) { |
| | | $inputBuffer = $this->_input; |
| | | $inputComplete = true; |
| | | } |
| | | |
| | | if (is_string($this->_message)) { |
| | | $messageBuffer = $this->_message; |
| | | $messageComplete = true; |
| | | } |
| | | |
| | | if (is_string($this->_output)) { |
| | | $outputBuffer =& $this->_output; |
| | | } |
| | | |
| | | // convenience variables |
| | | $fdInput = $this->_pipes[self::FD_INPUT]; |
| | | $fdOutput = $this->_pipes[self::FD_OUTPUT]; |
| | | $fdError = $this->_pipes[self::FD_ERROR]; |
| | | $fdStatus = $this->_pipes[self::FD_STATUS]; |
| | | $fdCommand = $this->_pipes[self::FD_COMMAND]; |
| | | $fdMessage = $this->_pipes[self::FD_MESSAGE]; |
| | | |
| | | while (true) { |
| | | |
| | | $inputStreams = array(); |
| | | $outputStreams = array(); |
| | | $exceptionStreams = array(); |
| | | |
| | | // set up input streams |
| | | if (is_resource($this->_input) && !$inputComplete) { |
| | | if (feof($this->_input)) { |
| | | $inputComplete = true; |
| | | } else { |
| | | $inputStreams[] = $this->_input; |
| | | } |
| | | } |
| | | |
| | | // close GPG input pipe if there is no more data |
| | | if ($inputBuffer == '' && $inputComplete) { |
| | | $this->_debug('=> closing GPG input pipe'); |
| | | $this->_closePipe(self::FD_INPUT); |
| | | } |
| | | |
| | | if (is_resource($this->_message) && !$messageComplete) { |
| | | if (feof($this->_message)) { |
| | | $messageComplete = true; |
| | | } else { |
| | | $inputStreams[] = $this->_message; |
| | | } |
| | | } |
| | | |
| | | // close GPG message pipe if there is no more data |
| | | if ($messageBuffer == '' && $messageComplete) { |
| | | $this->_debug('=> closing GPG message pipe'); |
| | | $this->_closePipe(self::FD_MESSAGE); |
| | | } |
| | | |
| | | if (!feof($fdOutput)) { |
| | | $inputStreams[] = $fdOutput; |
| | | } |
| | | |
| | | if (!feof($fdStatus)) { |
| | | $inputStreams[] = $fdStatus; |
| | | } |
| | | |
| | | if (!feof($fdError)) { |
| | | $inputStreams[] = $fdError; |
| | | } |
| | | |
| | | // set up output streams |
| | | if ($outputBuffer != '' && is_resource($this->_output)) { |
| | | $outputStreams[] = $this->_output; |
| | | } |
| | | |
| | | if ($this->_commandBuffer != '') { |
| | | $outputStreams[] = $fdCommand; |
| | | } |
| | | |
| | | if ($messageBuffer != '') { |
| | | $outputStreams[] = $fdMessage; |
| | | } |
| | | |
| | | if ($inputBuffer != '') { |
| | | $outputStreams[] = $fdInput; |
| | | } |
| | | |
| | | // no streams left to read or write, we're all done |
| | | if (count($inputStreams) === 0 && count($outputStreams) === 0) { |
| | | break; |
| | | } |
| | | |
| | | $this->_debug('selecting streams'); |
| | | |
| | | $ready = stream_select( |
| | | $inputStreams, |
| | | $outputStreams, |
| | | $exceptionStreams, |
| | | null |
| | | ); |
| | | |
| | | $this->_debug('=> got ' . $ready); |
| | | |
| | | if ($ready === false) { |
| | | throw new Crypt_GPG_Exception( |
| | | 'Error selecting stream for communication with GPG ' . |
| | | 'subprocess. Please file a bug report at: ' . |
| | | 'http://pear.php.net/bugs/report.php?package=Crypt_GPG'); |
| | | } |
| | | |
| | | if ($ready === 0) { |
| | | throw new Crypt_GPG_Exception( |
| | | 'stream_select() returned 0. This can not happen! Please ' . |
| | | 'file a bug report at: ' . |
| | | 'http://pear.php.net/bugs/report.php?package=Crypt_GPG'); |
| | | } |
| | | |
| | | // write input (to GPG) |
| | | if (in_array($fdInput, $outputStreams)) { |
| | | $this->_debug('GPG is ready for input'); |
| | | |
| | | $chunk = self::_byteSubstring( |
| | | $inputBuffer, |
| | | 0, |
| | | self::CHUNK_SIZE |
| | | ); |
| | | |
| | | $length = self::_byteLength($chunk); |
| | | |
| | | $this->_debug( |
| | | '=> about to write ' . $length . ' bytes to GPG input' |
| | | ); |
| | | |
| | | $length = fwrite($fdInput, $chunk, $length); |
| | | |
| | | $this->_debug('=> wrote ' . $length . ' bytes'); |
| | | |
| | | $inputBuffer = self::_byteSubstring( |
| | | $inputBuffer, |
| | | $length |
| | | ); |
| | | } |
| | | |
| | | // read input (from PHP stream) |
| | | if (in_array($this->_input, $inputStreams)) { |
| | | $this->_debug('input stream is ready for reading'); |
| | | $this->_debug( |
| | | '=> about to read ' . self::CHUNK_SIZE . |
| | | ' bytes from input stream' |
| | | ); |
| | | |
| | | $chunk = fread($this->_input, self::CHUNK_SIZE); |
| | | $length = self::_byteLength($chunk); |
| | | $inputBuffer .= $chunk; |
| | | |
| | | $this->_debug('=> read ' . $length . ' bytes'); |
| | | } |
| | | |
| | | // write message (to GPG) |
| | | if (in_array($fdMessage, $outputStreams)) { |
| | | $this->_debug('GPG is ready for message data'); |
| | | |
| | | $chunk = self::_byteSubstring( |
| | | $messageBuffer, |
| | | 0, |
| | | self::CHUNK_SIZE |
| | | ); |
| | | |
| | | $length = self::_byteLength($chunk); |
| | | |
| | | $this->_debug( |
| | | '=> about to write ' . $length . ' bytes to GPG message' |
| | | ); |
| | | |
| | | $length = fwrite($fdMessage, $chunk, $length); |
| | | $this->_debug('=> wrote ' . $length . ' bytes'); |
| | | |
| | | $messageBuffer = self::_byteSubstring($messageBuffer, $length); |
| | | } |
| | | |
| | | // read message (from PHP stream) |
| | | if (in_array($this->_message, $inputStreams)) { |
| | | $this->_debug('message stream is ready for reading'); |
| | | $this->_debug( |
| | | '=> about to read ' . self::CHUNK_SIZE . |
| | | ' bytes from message stream' |
| | | ); |
| | | |
| | | $chunk = fread($this->_message, self::CHUNK_SIZE); |
| | | $length = self::_byteLength($chunk); |
| | | $messageBuffer .= $chunk; |
| | | |
| | | $this->_debug('=> read ' . $length . ' bytes'); |
| | | } |
| | | |
| | | // read output (from GPG) |
| | | if (in_array($fdOutput, $inputStreams)) { |
| | | $this->_debug('GPG output stream ready for reading'); |
| | | $this->_debug( |
| | | '=> about to read ' . self::CHUNK_SIZE . |
| | | ' bytes from GPG output' |
| | | ); |
| | | |
| | | $chunk = fread($fdOutput, self::CHUNK_SIZE); |
| | | $length = self::_byteLength($chunk); |
| | | $outputBuffer .= $chunk; |
| | | |
| | | $this->_debug('=> read ' . $length . ' bytes'); |
| | | } |
| | | |
| | | // write output (to PHP stream) |
| | | if (in_array($this->_output, $outputStreams)) { |
| | | $this->_debug('output stream is ready for data'); |
| | | |
| | | $chunk = self::_byteSubstring( |
| | | $outputBuffer, |
| | | 0, |
| | | self::CHUNK_SIZE |
| | | ); |
| | | |
| | | $length = self::_byteLength($chunk); |
| | | |
| | | $this->_debug( |
| | | '=> about to write ' . $length . ' bytes to output stream' |
| | | ); |
| | | |
| | | $length = fwrite($this->_output, $chunk, $length); |
| | | |
| | | $this->_debug('=> wrote ' . $length . ' bytes'); |
| | | |
| | | $outputBuffer = self::_byteSubstring($outputBuffer, $length); |
| | | } |
| | | |
| | | // read error (from GPG) |
| | | if (in_array($fdError, $inputStreams)) { |
| | | $this->_debug('GPG error stream ready for reading'); |
| | | $this->_debug( |
| | | '=> about to read ' . self::CHUNK_SIZE . |
| | | ' bytes from GPG error' |
| | | ); |
| | | |
| | | $chunk = fread($fdError, self::CHUNK_SIZE); |
| | | $length = self::_byteLength($chunk); |
| | | $errorBuffer .= $chunk; |
| | | |
| | | $this->_debug('=> read ' . $length . ' bytes'); |
| | | |
| | | // pass lines to error handlers |
| | | while (($pos = strpos($errorBuffer, PHP_EOL)) !== false) { |
| | | $line = self::_byteSubstring($errorBuffer, 0, $pos); |
| | | foreach ($this->_errorHandlers as $handler) { |
| | | array_unshift($handler['args'], $line); |
| | | call_user_func_array( |
| | | $handler['callback'], |
| | | $handler['args'] |
| | | ); |
| | | |
| | | array_shift($handler['args']); |
| | | } |
| | | $errorBuffer = self::_byteSubString( |
| | | $errorBuffer, |
| | | $pos + self::_byteLength(PHP_EOL) |
| | | ); |
| | | } |
| | | } |
| | | |
| | | // read status (from GPG) |
| | | if (in_array($fdStatus, $inputStreams)) { |
| | | $this->_debug('GPG status stream ready for reading'); |
| | | $this->_debug( |
| | | '=> about to read ' . self::CHUNK_SIZE . |
| | | ' bytes from GPG status' |
| | | ); |
| | | |
| | | $chunk = fread($fdStatus, self::CHUNK_SIZE); |
| | | $length = self::_byteLength($chunk); |
| | | $statusBuffer .= $chunk; |
| | | |
| | | $this->_debug('=> read ' . $length . ' bytes'); |
| | | |
| | | // pass lines to status handlers |
| | | while (($pos = strpos($statusBuffer, PHP_EOL)) !== false) { |
| | | $line = self::_byteSubstring($statusBuffer, 0, $pos); |
| | | // only pass lines beginning with magic prefix |
| | | if (self::_byteSubstring($line, 0, 9) == '[GNUPG:] ') { |
| | | $line = self::_byteSubstring($line, 9); |
| | | foreach ($this->_statusHandlers as $handler) { |
| | | array_unshift($handler['args'], $line); |
| | | call_user_func_array( |
| | | $handler['callback'], |
| | | $handler['args'] |
| | | ); |
| | | |
| | | array_shift($handler['args']); |
| | | } |
| | | } |
| | | $statusBuffer = self::_byteSubString( |
| | | $statusBuffer, |
| | | $pos + self::_byteLength(PHP_EOL) |
| | | ); |
| | | } |
| | | } |
| | | |
| | | // write command (to GPG) |
| | | if (in_array($fdCommand, $outputStreams)) { |
| | | $this->_debug('GPG is ready for command data'); |
| | | |
| | | // send commands |
| | | $chunk = self::_byteSubstring( |
| | | $this->_commandBuffer, |
| | | 0, |
| | | self::CHUNK_SIZE |
| | | ); |
| | | |
| | | $length = self::_byteLength($chunk); |
| | | |
| | | $this->_debug( |
| | | '=> about to write ' . $length . ' bytes to GPG command' |
| | | ); |
| | | |
| | | $length = fwrite($fdCommand, $chunk, $length); |
| | | |
| | | $this->_debug('=> wrote ' . $length); |
| | | |
| | | $this->_commandBuffer = self::_byteSubstring( |
| | | $this->_commandBuffer, |
| | | $length |
| | | ); |
| | | } |
| | | |
| | | } // end loop while streams are open |
| | | |
| | | $this->_debug('END PROCESSING'); |
| | | } |
| | | |
| | | // }}} |
| | | // {{{ _openSubprocess() |
| | | |
| | | /** |
| | | * Opens an internal GPG subprocess for the current operation |
| | | * |
| | | * Opens a GPG subprocess, then connects the subprocess to some pipes. Sets |
| | | * the private class property {@link Crypt_GPG_Engine::$_process} to |
| | | * the new subprocess. |
| | | * |
| | | * @return void |
| | | * |
| | | * @throws Crypt_GPG_OpenSubprocessException if the subprocess could not be |
| | | * opened. |
| | | * |
| | | * @see Crypt_GPG_Engine::setOperation() |
| | | * @see Crypt_GPG_Engine::_closeSubprocess() |
| | | * @see Crypt_GPG_Engine::$_process |
| | | */ |
| | | private function _openSubprocess() |
| | | { |
| | | $version = $this->getVersion(); |
| | | |
| | | $env = $_ENV; |
| | | |
| | | // Newer versions of GnuPG return localized results. Crypt_GPG only |
| | | // works with English, so set the locale to 'C' for the subprocess. |
| | | $env['LC_ALL'] = 'C'; |
| | | |
| | | $commandLine = $this->_binary; |
| | | |
| | | $defaultArguments = array( |
| | | '--status-fd ' . escapeshellarg(self::FD_STATUS), |
| | | '--command-fd ' . escapeshellarg(self::FD_COMMAND), |
| | | '--no-secmem-warning', |
| | | '--no-tty', |
| | | '--no-default-keyring', // ignored if keying files are not specified |
| | | '--no-options' // prevent creation of ~/.gnupg directory |
| | | ); |
| | | |
| | | if (version_compare($version, '1.0.7', 'ge')) { |
| | | if (version_compare($version, '2.0.0', 'lt')) { |
| | | $defaultArguments[] = '--no-use-agent'; |
| | | } |
| | | $defaultArguments[] = '--no-permission-warning'; |
| | | } |
| | | |
| | | if (version_compare($version, '1.4.2', 'ge')) { |
| | | $defaultArguments[] = '--exit-on-status-write-error'; |
| | | } |
| | | |
| | | if (version_compare($version, '1.3.2', 'ge')) { |
| | | $defaultArguments[] = '--trust-model always'; |
| | | } else { |
| | | $defaultArguments[] = '--always-trust'; |
| | | } |
| | | |
| | | $arguments = array_merge($defaultArguments, $this->_arguments); |
| | | |
| | | if ($this->_homedir) { |
| | | $arguments[] = '--homedir ' . escapeshellarg($this->_homedir); |
| | | |
| | | // the random seed file makes subsequent actions faster so only |
| | | // disable it if we have to. |
| | | if (!is_writeable($this->_homedir)) { |
| | | $arguments[] = '--no-random-seed-file'; |
| | | } |
| | | } |
| | | |
| | | if ($this->_publicKeyring) { |
| | | $arguments[] = '--keyring ' . escapeshellarg($this->_publicKeyring); |
| | | } |
| | | |
| | | if ($this->_privateKeyring) { |
| | | $arguments[] = '--secret-keyring ' . |
| | | escapeshellarg($this->_privateKeyring); |
| | | } |
| | | |
| | | if ($this->_trustDb) { |
| | | $arguments[] = '--trustdb-name ' . escapeshellarg($this->_trustDb); |
| | | } |
| | | |
| | | $commandLine .= ' ' . implode(' ', $arguments) . ' ' . |
| | | $this->_operation; |
| | | |
| | | // Binary operations will not work on Windows with PHP < 5.2.6. This is |
| | | // in case stream_select() ever works on Windows. |
| | | $rb = (version_compare(PHP_VERSION, '5.2.6') < 0) ? 'r' : 'rb'; |
| | | $wb = (version_compare(PHP_VERSION, '5.2.6') < 0) ? 'w' : 'wb'; |
| | | |
| | | $descriptorSpec = array( |
| | | self::FD_INPUT => array('pipe', $rb), // stdin |
| | | self::FD_OUTPUT => array('pipe', $wb), // stdout |
| | | self::FD_ERROR => array('pipe', $wb), // stderr |
| | | self::FD_STATUS => array('pipe', $wb), // status |
| | | self::FD_COMMAND => array('pipe', $rb), // command |
| | | self::FD_MESSAGE => array('pipe', $rb) // message |
| | | ); |
| | | |
| | | $this->_debug('OPENING SUBPROCESS WITH THE FOLLOWING COMMAND:'); |
| | | $this->_debug($commandLine); |
| | | |
| | | $this->_process = proc_open( |
| | | $commandLine, |
| | | $descriptorSpec, |
| | | $this->_pipes, |
| | | null, |
| | | $env, |
| | | array('binary_pipes' => true) |
| | | ); |
| | | |
| | | if (!is_resource($this->_process)) { |
| | | throw new Crypt_GPG_OpenSubprocessException( |
| | | 'Unable to open GPG subprocess.', 0, $commandLine); |
| | | } |
| | | |
| | | $this->_openPipes = $this->_pipes; |
| | | $this->_errorCode = Crypt_GPG::ERROR_NONE; |
| | | } |
| | | |
| | | // }}} |
| | | // {{{ _closeSubprocess() |
| | | |
| | | /** |
| | | * Closes a the internal GPG subprocess |
| | | * |
| | | * Closes the internal GPG subprocess. Sets the private class property |
| | | * {@link Crypt_GPG_Engine::$_process} to null. |
| | | * |
| | | * @return void |
| | | * |
| | | * @see Crypt_GPG_Engine::_openSubprocess() |
| | | * @see Crypt_GPG_Engine::$_process |
| | | */ |
| | | private function _closeSubprocess() |
| | | { |
| | | if (is_resource($this->_process)) { |
| | | $this->_debug('CLOSING SUBPROCESS'); |
| | | |
| | | // close remaining open pipes |
| | | foreach (array_keys($this->_openPipes) as $pipeNumber) { |
| | | $this->_closePipe($pipeNumber); |
| | | } |
| | | |
| | | $exitCode = proc_close($this->_process); |
| | | |
| | | if ($exitCode != 0) { |
| | | $this->_debug( |
| | | '=> subprocess returned an unexpected exit code: ' . |
| | | $exitCode |
| | | ); |
| | | |
| | | if ($this->_errorCode === Crypt_GPG::ERROR_NONE) { |
| | | if ($this->_needPassphrase > 0) { |
| | | $this->_errorCode = Crypt_GPG::ERROR_MISSING_PASSPHRASE; |
| | | } else { |
| | | $this->_errorCode = Crypt_GPG::ERROR_UNKNOWN; |
| | | } |
| | | } |
| | | } |
| | | |
| | | $this->_process = null; |
| | | $this->_pipes = array(); |
| | | } |
| | | } |
| | | |
| | | // }}} |
| | | // {{{ _closePipe() |
| | | |
| | | /** |
| | | * Closes an opened pipe used to communicate with the GPG subprocess |
| | | * |
| | | * If the pipe is already closed, it is ignored. If the pipe is open, it |
| | | * is flushed and then closed. |
| | | * |
| | | * @param integer $pipeNumber the file descriptor number of the pipe to |
| | | * close. |
| | | * |
| | | * @return void |
| | | */ |
| | | private function _closePipe($pipeNumber) |
| | | { |
| | | $pipeNumber = intval($pipeNumber); |
| | | if (array_key_exists($pipeNumber, $this->_openPipes)) { |
| | | fflush($this->_openPipes[$pipeNumber]); |
| | | fclose($this->_openPipes[$pipeNumber]); |
| | | unset($this->_openPipes[$pipeNumber]); |
| | | } |
| | | } |
| | | |
| | | // }}} |
| | | // {{{ _getBinary() |
| | | |
| | | /** |
| | | * Gets the name of the GPG binary for the current operating system |
| | | * |
| | | * This method is called if the '<kbd>binary</kbd>' option is <i>not</i> |
| | | * specified when creating this driver. |
| | | * |
| | | * @return string the name of the GPG binary for the current operating |
| | | * system. If no suitable binary could be found, an empty |
| | | * string is returned. |
| | | */ |
| | | private function _getBinary() |
| | | { |
| | | $binary = ''; |
| | | |
| | | if ($this->_isDarwin) { |
| | | $binaryFiles = array( |
| | | '/opt/local/bin/gpg', // MacPorts |
| | | '/usr/local/bin/gpg', // Mac GPG |
| | | '/sw/bin/gpg', // Fink |
| | | '/usr/bin/gpg' |
| | | ); |
| | | } else { |
| | | $binaryFiles = array( |
| | | '/usr/bin/gpg', |
| | | '/usr/local/bin/gpg' |
| | | ); |
| | | } |
| | | |
| | | foreach ($binaryFiles as $binaryFile) { |
| | | if (is_executable($binaryFile)) { |
| | | $binary = $binaryFile; |
| | | break; |
| | | } |
| | | } |
| | | |
| | | return $binary; |
| | | } |
| | | |
| | | // }}} |
| | | // {{{ _debug() |
| | | |
| | | /** |
| | | * Displays debug text if debugging is turned on |
| | | * |
| | | * Debugging text is prepended with a debug identifier and echoed to stdout. |
| | | * |
| | | * @param string $text the debugging text to display. |
| | | * |
| | | * @return void |
| | | */ |
| | | private function _debug($text) |
| | | { |
| | | if ($this->_debug) { |
| | | if (array_key_exists('SHELL', $_ENV)) { |
| | | foreach (explode(PHP_EOL, $text) as $line) { |
| | | echo "Crypt_GPG DEBUG: ", $line, PHP_EOL; |
| | | } |
| | | } else { |
| | | // running on a web server, format debug output nicely |
| | | foreach (explode(PHP_EOL, $text) as $line) { |
| | | echo "Crypt_GPG DEBUG: <strong>", $line, |
| | | '</strong><br />', PHP_EOL; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | // }}} |
| | | // {{{ _byteLength() |
| | | |
| | | /** |
| | | * Gets the length of a string in bytes even if mbstring function |
| | | * overloading is turned on |
| | | * |
| | | * This is used for stream-based communication with the GPG subprocess. |
| | | * |
| | | * @param string $string the string for which to get the length. |
| | | * |
| | | * @return integer the length of the string in bytes. |
| | | * |
| | | * @see Crypt_GPG_Engine::$_mbStringOverload |
| | | */ |
| | | private static function _byteLength($string) |
| | | { |
| | | if (self::$_mbStringOverload) { |
| | | return mb_strlen($string, '8bit'); |
| | | } |
| | | |
| | | return strlen((binary)$string); |
| | | } |
| | | |
| | | // }}} |
| | | // {{{ _byteSubstring() |
| | | |
| | | /** |
| | | * Gets the substring of a string in bytes even if mbstring function |
| | | * overloading is turned on |
| | | * |
| | | * This is used for stream-based communication with the GPG subprocess. |
| | | * |
| | | * @param string $string the input string. |
| | | * @param integer $start the starting point at which to get the substring. |
| | | * @param integer $length optional. The length of the substring. |
| | | * |
| | | * @return string the extracted part of the string. Unlike the default PHP |
| | | * <kbd>substr()</kbd> function, the returned value is |
| | | * always a string and never false. |
| | | * |
| | | * @see Crypt_GPG_Engine::$_mbStringOverload |
| | | */ |
| | | private static function _byteSubstring($string, $start, $length = null) |
| | | { |
| | | if (self::$_mbStringOverload) { |
| | | if ($length === null) { |
| | | return mb_substr( |
| | | $string, |
| | | $start, |
| | | self::_byteLength($string) - $start, '8bit' |
| | | ); |
| | | } |
| | | |
| | | return mb_substr($string, $start, $length, '8bit'); |
| | | } |
| | | |
| | | if ($length === null) { |
| | | return (string)substr((binary)$string, $start); |
| | | } |
| | | |
| | | return (string)substr((binary)$string, $start, $length); |
| | | } |
| | | |
| | | // }}} |
| | | } |
| | | |
| | | // }}} |
| | | |
| | | ?> |
New file |
| | |
| | | <?php |
| | | |
| | | /* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */ |
| | | |
| | | /** |
| | | * Various exception handling classes for Crypt_GPG |
| | | * |
| | | * Crypt_GPG provides an object oriented interface to GNU Privacy |
| | | * Guard (GPG). It requires the GPG executable to be on the system. |
| | | * |
| | | * This file contains various exception classes used by the Crypt_GPG package. |
| | | * |
| | | * PHP version 5 |
| | | * |
| | | * LICENSE: |
| | | * |
| | | * This library is free software; you can redistribute it and/or modify |
| | | * it under the terms of the GNU Lesser General Public License as |
| | | * published by the Free Software Foundation; either version 2.1 of the |
| | | * License, or (at your option) any later version. |
| | | * |
| | | * This library is distributed in the hope that it will be useful, |
| | | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| | | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| | | * Lesser General Public License for more details. |
| | | * |
| | | * You should have received a copy of the GNU Lesser General Public |
| | | * License along with this library; if not, write to the Free Software |
| | | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
| | | * |
| | | * @category Encryption |
| | | * @package Crypt_GPG |
| | | * @author Nathan Fredrickson <nathan@silverorange.com> |
| | | * @author Michael Gauthier <mike@silverorange.com> |
| | | * @copyright 2005 silverorange |
| | | * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1 |
| | | * @version CVS: $Id: Exceptions.php 273745 2009-01-18 05:24:25Z gauthierm $ |
| | | * @link http://pear.php.net/package/Crypt_GPG |
| | | */ |
| | | |
| | | /** |
| | | * PEAR Exception handler and base class |
| | | */ |
| | | require_once 'PEAR/Exception.php'; |
| | | |
| | | // {{{ class Crypt_GPG_Exception |
| | | |
| | | /** |
| | | * An exception thrown by the Crypt_GPG package |
| | | * |
| | | * @category Encryption |
| | | * @package Crypt_GPG |
| | | * @author Michael Gauthier <mike@silverorange.com> |
| | | * @copyright 2005 silverorange |
| | | * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1 |
| | | * @link http://pear.php.net/package/Crypt_GPG |
| | | */ |
| | | class Crypt_GPG_Exception extends PEAR_Exception |
| | | { |
| | | } |
| | | |
| | | // }}} |
| | | // {{{ class Crypt_GPG_FileException |
| | | |
| | | /** |
| | | * An exception thrown when a file is used in ways it cannot be used |
| | | * |
| | | * For example, if an output file is specified and the file is not writeable, or |
| | | * if an input file is specified and the file is not readable, this exception |
| | | * is thrown. |
| | | * |
| | | * @category Encryption |
| | | * @package Crypt_GPG |
| | | * @author Michael Gauthier <mike@silverorange.com> |
| | | * @copyright 2007-2008 silverorange |
| | | * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1 |
| | | * @link http://pear.php.net/package/Crypt_GPG |
| | | */ |
| | | class Crypt_GPG_FileException extends Crypt_GPG_Exception |
| | | { |
| | | // {{{ private class properties |
| | | |
| | | /** |
| | | * The name of the file that caused this exception |
| | | * |
| | | * @var string |
| | | */ |
| | | private $_filename = ''; |
| | | |
| | | // }}} |
| | | // {{{ __construct() |
| | | |
| | | /** |
| | | * Creates a new Crypt_GPG_FileException |
| | | * |
| | | * @param string $message an error message. |
| | | * @param integer $code a user defined error code. |
| | | * @param string $filename the name of the file that caused this exception. |
| | | */ |
| | | public function __construct($message, $code = 0, $filename = '') |
| | | { |
| | | $this->_filename = $filename; |
| | | parent::__construct($message, $code); |
| | | } |
| | | |
| | | // }}} |
| | | // {{{ getFilename() |
| | | |
| | | /** |
| | | * Returns the filename of the file that caused this exception |
| | | * |
| | | * @return string the filename of the file that caused this exception. |
| | | * |
| | | * @see Crypt_GPG_FileException::$_filename |
| | | */ |
| | | public function getFilename() |
| | | { |
| | | return $this->_filename; |
| | | } |
| | | |
| | | // }}} |
| | | } |
| | | |
| | | // }}} |
| | | // {{{ class Crypt_GPG_OpenSubprocessException |
| | | |
| | | /** |
| | | * An exception thrown when the GPG subprocess cannot be opened |
| | | * |
| | | * This exception is thrown when the {@link Crypt_GPG_Engine} tries to open a |
| | | * new subprocess and fails. |
| | | * |
| | | * @category Encryption |
| | | * @package Crypt_GPG |
| | | * @author Michael Gauthier <mike@silverorange.com> |
| | | * @copyright 2005 silverorange |
| | | * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1 |
| | | * @link http://pear.php.net/package/Crypt_GPG |
| | | */ |
| | | class Crypt_GPG_OpenSubprocessException extends Crypt_GPG_Exception |
| | | { |
| | | // {{{ private class properties |
| | | |
| | | /** |
| | | * The command used to try to open the subprocess |
| | | * |
| | | * @var string |
| | | */ |
| | | private $_command = ''; |
| | | |
| | | // }}} |
| | | // {{{ __construct() |
| | | |
| | | /** |
| | | * Creates a new Crypt_GPG_OpenSubprocessException |
| | | * |
| | | * @param string $message an error message. |
| | | * @param integer $code a user defined error code. |
| | | * @param string $command the command that was called to open the |
| | | * new subprocess. |
| | | * |
| | | * @see Crypt_GPG::_openSubprocess() |
| | | */ |
| | | public function __construct($message, $code = 0, $command = '') |
| | | { |
| | | $this->_command = $command; |
| | | parent::__construct($message, $code); |
| | | } |
| | | |
| | | // }}} |
| | | // {{{ getCommand() |
| | | |
| | | /** |
| | | * Returns the contents of the internal _command property |
| | | * |
| | | * @return string the command used to open the subprocess. |
| | | * |
| | | * @see Crypt_GPG_OpenSubprocessException::$_command |
| | | */ |
| | | public function getCommand() |
| | | { |
| | | return $this->_command; |
| | | } |
| | | |
| | | // }}} |
| | | } |
| | | |
| | | // }}} |
| | | // {{{ class Crypt_GPG_InvalidOperationException |
| | | |
| | | /** |
| | | * An exception thrown when an invalid GPG operation is attempted |
| | | * |
| | | * @category Encryption |
| | | * @package Crypt_GPG |
| | | * @author Michael Gauthier <mike@silverorange.com> |
| | | * @copyright 2008 silverorange |
| | | * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1 |
| | | * @link http://pear.php.net/package/Crypt_GPG |
| | | */ |
| | | class Crypt_GPG_InvalidOperationException extends Crypt_GPG_Exception |
| | | { |
| | | // {{{ private class properties |
| | | |
| | | /** |
| | | * The attempted operation |
| | | * |
| | | * @var string |
| | | */ |
| | | private $_operation = ''; |
| | | |
| | | // }}} |
| | | // {{{ __construct() |
| | | |
| | | /** |
| | | * Creates a new Crypt_GPG_OpenSubprocessException |
| | | * |
| | | * @param string $message an error message. |
| | | * @param integer $code a user defined error code. |
| | | * @param string $operation the operation. |
| | | */ |
| | | public function __construct($message, $code = 0, $operation = '') |
| | | { |
| | | $this->_operation = $operation; |
| | | parent::__construct($message, $code); |
| | | } |
| | | |
| | | // }}} |
| | | // {{{ getOperation() |
| | | |
| | | /** |
| | | * Returns the contents of the internal _operation property |
| | | * |
| | | * @return string the attempted operation. |
| | | * |
| | | * @see Crypt_GPG_InvalidOperationException::$_operation |
| | | */ |
| | | public function getOperation() |
| | | { |
| | | return $this->_operation; |
| | | } |
| | | |
| | | // }}} |
| | | } |
| | | |
| | | // }}} |
| | | // {{{ class Crypt_GPG_KeyNotFoundException |
| | | |
| | | /** |
| | | * An exception thrown when Crypt_GPG fails to find the key for various |
| | | * operations |
| | | * |
| | | * @category Encryption |
| | | * @package Crypt_GPG |
| | | * @author Michael Gauthier <mike@silverorange.com> |
| | | * @copyright 2005 silverorange |
| | | * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1 |
| | | * @link http://pear.php.net/package/Crypt_GPG |
| | | */ |
| | | class Crypt_GPG_KeyNotFoundException extends Crypt_GPG_Exception |
| | | { |
| | | // {{{ private class properties |
| | | |
| | | /** |
| | | * The key identifier that was searched for |
| | | * |
| | | * @var string |
| | | */ |
| | | private $_keyId = ''; |
| | | |
| | | // }}} |
| | | // {{{ __construct() |
| | | |
| | | /** |
| | | * Creates a new Crypt_GPG_KeyNotFoundException |
| | | * |
| | | * @param string $message an error message. |
| | | * @param integer $code a user defined error code. |
| | | * @param string $keyId the key identifier of the key. |
| | | */ |
| | | public function __construct($message, $code = 0, $keyId= '') |
| | | { |
| | | $this->_keyId = $keyId; |
| | | parent::__construct($message, $code); |
| | | } |
| | | |
| | | // }}} |
| | | // {{{ getKeyId() |
| | | |
| | | /** |
| | | * Gets the key identifier of the key that was not found |
| | | * |
| | | * @return string the key identifier of the key that was not found. |
| | | */ |
| | | public function getKeyId() |
| | | { |
| | | return $this->_keyId; |
| | | } |
| | | |
| | | // }}} |
| | | } |
| | | |
| | | // }}} |
| | | // {{{ class Crypt_GPG_NoDataException |
| | | |
| | | /** |
| | | * An exception thrown when Crypt_GPG cannot find valid data for various |
| | | * operations |
| | | * |
| | | * @category Encryption |
| | | * @package Crypt_GPG |
| | | * @author Michael Gauthier <mike@silverorange.com> |
| | | * @copyright 2006 silverorange |
| | | * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1 |
| | | * @link http://pear.php.net/package/Crypt_GPG |
| | | */ |
| | | class Crypt_GPG_NoDataException extends Crypt_GPG_Exception |
| | | { |
| | | } |
| | | |
| | | // }}} |
| | | // {{{ class Crypt_GPG_BadPassphraseException |
| | | |
| | | /** |
| | | * An exception thrown when a required passphrase is incorrect or missing |
| | | * |
| | | * @category Encryption |
| | | * @package Crypt_GPG |
| | | * @author Michael Gauthier <mike@silverorange.com> |
| | | * @copyright 2006-2008 silverorange |
| | | * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1 |
| | | * @link http://pear.php.net/package/Crypt_GPG |
| | | */ |
| | | class Crypt_GPG_BadPassphraseException extends Crypt_GPG_Exception |
| | | { |
| | | // {{{ private class properties |
| | | |
| | | /** |
| | | * Keys for which the passhprase is missing |
| | | * |
| | | * This contains primary user ids indexed by sub-key id. |
| | | * |
| | | * @var array |
| | | */ |
| | | private $_missingPassphrases = array(); |
| | | |
| | | /** |
| | | * Keys for which the passhprase is incorrect |
| | | * |
| | | * This contains primary user ids indexed by sub-key id. |
| | | * |
| | | * @var array |
| | | */ |
| | | private $_badPassphrases = array(); |
| | | |
| | | // }}} |
| | | // {{{ __construct() |
| | | |
| | | /** |
| | | * Creates a new Crypt_GPG_BadPassphraseException |
| | | * |
| | | * @param string $message an error message. |
| | | * @param integer $code a user defined error code. |
| | | * @param string $badPassphrases an array containing user ids of keys |
| | | * for which the passphrase is incorrect. |
| | | * @param string $missingPassphrases an array containing user ids of keys |
| | | * for which the passphrase is missing. |
| | | */ |
| | | public function __construct($message, $code = 0, |
| | | array $badPassphrases = array(), array $missingPassphrases = array() |
| | | ) { |
| | | $this->_badPassphrases = $badPassphrases; |
| | | $this->_missingPassphrases = $missingPassphrases; |
| | | |
| | | parent::__construct($message, $code); |
| | | } |
| | | |
| | | // }}} |
| | | // {{{ getBadPassphrases() |
| | | |
| | | /** |
| | | * Gets keys for which the passhprase is incorrect |
| | | * |
| | | * @return array an array of keys for which the passphrase is incorrect. |
| | | * The array contains primary user ids indexed by the sub-key |
| | | * id. |
| | | */ |
| | | public function getBadPassphrases() |
| | | { |
| | | return $this->_badPassphrases; |
| | | } |
| | | |
| | | // }}} |
| | | // {{{ getMissingPassphrases() |
| | | |
| | | /** |
| | | * Gets keys for which the passhprase is missing |
| | | * |
| | | * @return array an array of keys for which the passphrase is missing. |
| | | * The array contains primary user ids indexed by the sub-key |
| | | * id. |
| | | */ |
| | | public function getMissingPassphrases() |
| | | { |
| | | return $this->_missingPassphrases; |
| | | } |
| | | |
| | | // }}} |
| | | } |
| | | |
| | | // }}} |
| | | // {{{ class Crypt_GPG_DeletePrivateKeyException |
| | | |
| | | /** |
| | | * An exception thrown when an attempt is made to delete public key that has an |
| | | * associated private key on the keyring |
| | | * |
| | | * @category Encryption |
| | | * @package Crypt_GPG |
| | | * @author Michael Gauthier <mike@silverorange.com> |
| | | * @copyright 2008 silverorange |
| | | * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1 |
| | | * @link http://pear.php.net/package/Crypt_GPG |
| | | */ |
| | | class Crypt_GPG_DeletePrivateKeyException extends Crypt_GPG_Exception |
| | | { |
| | | // {{{ private class properties |
| | | |
| | | /** |
| | | * The key identifier the deletion attempt was made upon |
| | | * |
| | | * @var string |
| | | */ |
| | | private $_keyId = ''; |
| | | |
| | | // }}} |
| | | // {{{ __construct() |
| | | |
| | | /** |
| | | * Creates a new Crypt_GPG_DeletePrivateKeyException |
| | | * |
| | | * @param string $message an error message. |
| | | * @param integer $code a user defined error code. |
| | | * @param string $keyId the key identifier of the public key that was |
| | | * attempted to delete. |
| | | * |
| | | * @see Crypt_GPG::deletePublicKey() |
| | | */ |
| | | public function __construct($message, $code = 0, $keyId = '') |
| | | { |
| | | $this->_keyId = $keyId; |
| | | parent::__construct($message, $code); |
| | | } |
| | | |
| | | // }}} |
| | | // {{{ getKeyId() |
| | | |
| | | /** |
| | | * Gets the key identifier of the key that was not found |
| | | * |
| | | * @return string the key identifier of the key that was not found. |
| | | */ |
| | | public function getKeyId() |
| | | { |
| | | return $this->_keyId; |
| | | } |
| | | |
| | | // }}} |
| | | } |
| | | |
| | | // }}} |
| | | |
| | | ?> |
New file |
| | |
| | | <?php |
| | | |
| | | /* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */ |
| | | |
| | | /** |
| | | * Contains a class representing GPG keys |
| | | * |
| | | * PHP version 5 |
| | | * |
| | | * LICENSE: |
| | | * |
| | | * This library is free software; you can redistribute it and/or modify |
| | | * it under the terms of the GNU Lesser General Public License as |
| | | * published by the Free Software Foundation; either version 2.1 of the |
| | | * License, or (at your option) any later version. |
| | | * |
| | | * This library is distributed in the hope that it will be useful, |
| | | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| | | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| | | * Lesser General Public License for more details. |
| | | * |
| | | * You should have received a copy of the GNU Lesser General Public |
| | | * License along with this library; if not, write to the Free Software |
| | | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
| | | * |
| | | * @category Encryption |
| | | * @package Crypt_GPG |
| | | * @author Michael Gauthier <mike@silverorange.com> |
| | | * @copyright 2008-2010 silverorange |
| | | * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1 |
| | | * @version CVS: $Id: Key.php 295621 2010-03-01 04:18:54Z gauthierm $ |
| | | * @link http://pear.php.net/package/Crypt_GPG |
| | | */ |
| | | |
| | | /** |
| | | * Sub-key class definition |
| | | */ |
| | | require_once 'Crypt/GPG/SubKey.php'; |
| | | |
| | | /** |
| | | * User id class definition |
| | | */ |
| | | require_once 'Crypt/GPG/UserId.php'; |
| | | |
| | | // {{{ class Crypt_GPG_Key |
| | | |
| | | /** |
| | | * A data class for GPG key information |
| | | * |
| | | * This class is used to store the results of the {@link Crypt_GPG::getKeys()} |
| | | * method. |
| | | * |
| | | * @category Encryption |
| | | * @package Crypt_GPG |
| | | * @author Michael Gauthier <mike@silverorange.com> |
| | | * @copyright 2008-2010 silverorange |
| | | * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1 |
| | | * @link http://pear.php.net/package/Crypt_GPG |
| | | * @see Crypt_GPG::getKeys() |
| | | */ |
| | | class Crypt_GPG_Key |
| | | { |
| | | // {{{ class properties |
| | | |
| | | /** |
| | | * The user ids associated with this key |
| | | * |
| | | * This is an array of {@link Crypt_GPG_UserId} objects. |
| | | * |
| | | * @var array |
| | | * |
| | | * @see Crypt_GPG_Key::addUserId() |
| | | * @see Crypt_GPG_Key::getUserIds() |
| | | */ |
| | | private $_userIds = array(); |
| | | |
| | | /** |
| | | * The subkeys of this key |
| | | * |
| | | * This is an array of {@link Crypt_GPG_SubKey} objects. |
| | | * |
| | | * @var array |
| | | * |
| | | * @see Crypt_GPG_Key::addSubKey() |
| | | * @see Crypt_GPG_Key::getSubKeys() |
| | | */ |
| | | private $_subKeys = array(); |
| | | |
| | | // }}} |
| | | // {{{ getSubKeys() |
| | | |
| | | /** |
| | | * Gets the sub-keys of this key |
| | | * |
| | | * @return array the sub-keys of this key. |
| | | * |
| | | * @see Crypt_GPG_Key::addSubKey() |
| | | */ |
| | | public function getSubKeys() |
| | | { |
| | | return $this->_subKeys; |
| | | } |
| | | |
| | | // }}} |
| | | // {{{ getUserIds() |
| | | |
| | | /** |
| | | * Gets the user ids of this key |
| | | * |
| | | * @return array the user ids of this key. |
| | | * |
| | | * @see Crypt_GPG_Key::addUserId() |
| | | */ |
| | | public function getUserIds() |
| | | { |
| | | return $this->_userIds; |
| | | } |
| | | |
| | | // }}} |
| | | // {{{ getPrimaryKey() |
| | | |
| | | /** |
| | | * Gets the primary sub-key of this key |
| | | * |
| | | * The primary key is the first added sub-key. |
| | | * |
| | | * @return Crypt_GPG_SubKey the primary sub-key of this key. |
| | | */ |
| | | public function getPrimaryKey() |
| | | { |
| | | $primary_key = null; |
| | | if (count($this->_subKeys) > 0) { |
| | | $primary_key = $this->_subKeys[0]; |
| | | } |
| | | return $primary_key; |
| | | } |
| | | |
| | | // }}} |
| | | // {{{ canSign() |
| | | |
| | | /** |
| | | * Gets whether or not this key can sign data |
| | | * |
| | | * This key can sign data if any sub-key of this key can sign data. |
| | | * |
| | | * @return boolean true if this key can sign data and false if this key |
| | | * cannot sign data. |
| | | */ |
| | | public function canSign() |
| | | { |
| | | $canSign = false; |
| | | foreach ($this->_subKeys as $subKey) { |
| | | if ($subKey->canSign()) { |
| | | $canSign = true; |
| | | break; |
| | | } |
| | | } |
| | | return $canSign; |
| | | } |
| | | |
| | | // }}} |
| | | // {{{ canEncrypt() |
| | | |
| | | /** |
| | | * Gets whether or not this key can encrypt data |
| | | * |
| | | * This key can encrypt data if any sub-key of this key can encrypt data. |
| | | * |
| | | * @return boolean true if this key can encrypt data and false if this |
| | | * key cannot encrypt data. |
| | | */ |
| | | public function canEncrypt() |
| | | { |
| | | $canEncrypt = false; |
| | | foreach ($this->_subKeys as $subKey) { |
| | | if ($subKey->canEncrypt()) { |
| | | $canEncrypt = true; |
| | | break; |
| | | } |
| | | } |
| | | return $canEncrypt; |
| | | } |
| | | |
| | | // }}} |
| | | // {{{ addSubKey() |
| | | |
| | | /** |
| | | * Adds a sub-key to this key |
| | | * |
| | | * The first added sub-key will be the primary key of this key. |
| | | * |
| | | * @param Crypt_GPG_SubKey $subKey the sub-key to add. |
| | | * |
| | | * @return Crypt_GPG_Key the current object, for fluent interface. |
| | | */ |
| | | public function addSubKey(Crypt_GPG_SubKey $subKey) |
| | | { |
| | | $this->_subKeys[] = $subKey; |
| | | return $this; |
| | | } |
| | | |
| | | // }}} |
| | | // {{{ addUserId() |
| | | |
| | | /** |
| | | * Adds a user id to this key |
| | | * |
| | | * @param Crypt_GPG_UserId $userId the user id to add. |
| | | * |
| | | * @return Crypt_GPG_Key the current object, for fluent interface. |
| | | */ |
| | | public function addUserId(Crypt_GPG_UserId $userId) |
| | | { |
| | | $this->_userIds[] = $userId; |
| | | return $this; |
| | | } |
| | | |
| | | // }}} |
| | | } |
| | | |
| | | // }}} |
| | | |
| | | ?> |
New file |
| | |
| | | <?php |
| | | |
| | | /* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */ |
| | | |
| | | /** |
| | | * A class representing GPG signatures |
| | | * |
| | | * This file contains a data class representing a GPG signature. |
| | | * |
| | | * PHP version 5 |
| | | * |
| | | * LICENSE: |
| | | * |
| | | * This library is free software; you can redistribute it and/or modify |
| | | * it under the terms of the GNU Lesser General Public License as |
| | | * published by the Free Software Foundation; either version 2.1 of the |
| | | * License, or (at your option) any later version. |
| | | * |
| | | * This library is distributed in the hope that it will be useful, |
| | | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| | | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| | | * Lesser General Public License for more details. |
| | | * |
| | | * You should have received a copy of the GNU Lesser General Public |
| | | * License along with this library; if not, write to the Free Software |
| | | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
| | | * |
| | | * @category Encryption |
| | | * @package Crypt_GPG |
| | | * @author Nathan Fredrickson <nathan@silverorange.com> |
| | | * @copyright 2005-2010 silverorange |
| | | * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1 |
| | | * @version CVS: $Id: Signature.php 302773 2010-08-25 14:16:28Z gauthierm $ |
| | | * @link http://pear.php.net/package/Crypt_GPG |
| | | */ |
| | | |
| | | /** |
| | | * User id class definition |
| | | */ |
| | | require_once 'Crypt/GPG/UserId.php'; |
| | | |
| | | // {{{ class Crypt_GPG_Signature |
| | | |
| | | /** |
| | | * A class for GPG signature information |
| | | * |
| | | * This class is used to store the results of the Crypt_GPG::verify() method. |
| | | * |
| | | * @category Encryption |
| | | * @package Crypt_GPG |
| | | * @author Nathan Fredrickson <nathan@silverorange.com> |
| | | * @author Michael Gauthier <mike@silverorange.com> |
| | | * @copyright 2005-2010 silverorange |
| | | * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1 |
| | | * @link http://pear.php.net/package/Crypt_GPG |
| | | * @see Crypt_GPG::verify() |
| | | */ |
| | | class Crypt_GPG_Signature |
| | | { |
| | | // {{{ class properties |
| | | |
| | | /** |
| | | * A base64-encoded string containing a unique id for this signature if |
| | | * this signature has been verified as ok |
| | | * |
| | | * This id is used to prevent replay attacks and is not present for all |
| | | * types of signatures. |
| | | * |
| | | * @var string |
| | | */ |
| | | private $_id = ''; |
| | | |
| | | /** |
| | | * The fingerprint of the key used to create the signature |
| | | * |
| | | * @var string |
| | | */ |
| | | private $_keyFingerprint = ''; |
| | | |
| | | /** |
| | | * The id of the key used to create the signature |
| | | * |
| | | * @var string |
| | | */ |
| | | private $_keyId = ''; |
| | | |
| | | /** |
| | | * The creation date of this signature |
| | | * |
| | | * This is a Unix timestamp. |
| | | * |
| | | * @var integer |
| | | */ |
| | | private $_creationDate = 0; |
| | | |
| | | /** |
| | | * The expiration date of the signature |
| | | * |
| | | * This is a Unix timestamp. If this signature does not expire, this will |
| | | * be zero. |
| | | * |
| | | * @var integer |
| | | */ |
| | | private $_expirationDate = 0; |
| | | |
| | | /** |
| | | * The user id associated with this signature |
| | | * |
| | | * @var Crypt_GPG_UserId |
| | | */ |
| | | private $_userId = null; |
| | | |
| | | /** |
| | | * Whether or not this signature is valid |
| | | * |
| | | * @var boolean |
| | | */ |
| | | private $_isValid = false; |
| | | |
| | | // }}} |
| | | // {{{ __construct() |
| | | |
| | | /** |
| | | * Creates a new signature |
| | | * |
| | | * Signatures can be initialized from an array of named values. Available |
| | | * names are: |
| | | * |
| | | * - <kbd>string id</kbd> - the unique id of this signature. |
| | | * - <kbd>string fingerprint</kbd> - the fingerprint of the key used to |
| | | * create the signature. The fingerprint |
| | | * should not contain formatting |
| | | * characters. |
| | | * - <kbd>string keyId</kbd> - the id of the key used to create the |
| | | * the signature. |
| | | * - <kbd>integer creation</kbd> - the date the signature was created. |
| | | * This is a UNIX timestamp. |
| | | * - <kbd>integer expiration</kbd> - the date the signature expired. This |
| | | * is a UNIX timestamp. If the signature |
| | | * does not expire, use 0. |
| | | * - <kbd>boolean valid</kbd> - whether or not the signature is valid. |
| | | * - <kbd>string userId</kbd> - the user id associated with the |
| | | * signature. This may also be a |
| | | * {@link Crypt_GPG_UserId} object. |
| | | * |
| | | * @param Crypt_GPG_Signature|array $signature optional. Either an existing |
| | | * signature object, which is copied; or an array of initial values. |
| | | */ |
| | | public function __construct($signature = null) |
| | | { |
| | | // copy from object |
| | | if ($signature instanceof Crypt_GPG_Signature) { |
| | | $this->_id = $signature->_id; |
| | | $this->_keyFingerprint = $signature->_keyFingerprint; |
| | | $this->_keyId = $signature->_keyId; |
| | | $this->_creationDate = $signature->_creationDate; |
| | | $this->_expirationDate = $signature->_expirationDate; |
| | | $this->_isValid = $signature->_isValid; |
| | | |
| | | if ($signature->_userId instanceof Crypt_GPG_UserId) { |
| | | $this->_userId = clone $signature->_userId; |
| | | } else { |
| | | $this->_userId = $signature->_userId; |
| | | } |
| | | } |
| | | |
| | | // initialize from array |
| | | if (is_array($signature)) { |
| | | if (array_key_exists('id', $signature)) { |
| | | $this->setId($signature['id']); |
| | | } |
| | | |
| | | if (array_key_exists('fingerprint', $signature)) { |
| | | $this->setKeyFingerprint($signature['fingerprint']); |
| | | } |
| | | |
| | | if (array_key_exists('keyId', $signature)) { |
| | | $this->setKeyId($signature['keyId']); |
| | | } |
| | | |
| | | if (array_key_exists('creation', $signature)) { |
| | | $this->setCreationDate($signature['creation']); |
| | | } |
| | | |
| | | if (array_key_exists('expiration', $signature)) { |
| | | $this->setExpirationDate($signature['expiration']); |
| | | } |
| | | |
| | | if (array_key_exists('valid', $signature)) { |
| | | $this->setValid($signature['valid']); |
| | | } |
| | | |
| | | if (array_key_exists('userId', $signature)) { |
| | | $userId = new Crypt_GPG_UserId($signature['userId']); |
| | | $this->setUserId($userId); |
| | | } |
| | | } |
| | | } |
| | | |
| | | // }}} |
| | | // {{{ getId() |
| | | |
| | | /** |
| | | * Gets the id of this signature |
| | | * |
| | | * @return string a base64-encoded string containing a unique id for this |
| | | * signature. This id is used to prevent replay attacks and |
| | | * is not present for all types of signatures. |
| | | */ |
| | | public function getId() |
| | | { |
| | | return $this->_id; |
| | | } |
| | | |
| | | // }}} |
| | | // {{{ getKeyFingerprint() |
| | | |
| | | /** |
| | | * Gets the fingerprint of the key used to create this signature |
| | | * |
| | | * @return string the fingerprint of the key used to create this signature. |
| | | */ |
| | | public function getKeyFingerprint() |
| | | { |
| | | return $this->_keyFingerprint; |
| | | } |
| | | |
| | | // }}} |
| | | // {{{ getKeyId() |
| | | |
| | | /** |
| | | * Gets the id of the key used to create this signature |
| | | * |
| | | * Whereas the fingerprint of the signing key may not always be available |
| | | * (for example if the signature is bad), the id should always be |
| | | * available. |
| | | * |
| | | * @return string the id of the key used to create this signature. |
| | | */ |
| | | public function getKeyId() |
| | | { |
| | | return $this->_keyId; |
| | | } |
| | | |
| | | // }}} |
| | | // {{{ getCreationDate() |
| | | |
| | | /** |
| | | * Gets the creation date of this signature |
| | | * |
| | | * @return integer the creation date of this signature. This is a Unix |
| | | * timestamp. |
| | | */ |
| | | public function getCreationDate() |
| | | { |
| | | return $this->_creationDate; |
| | | } |
| | | |
| | | // }}} |
| | | // {{{ getExpirationDate() |
| | | |
| | | /** |
| | | * Gets the expiration date of the signature |
| | | * |
| | | * @return integer the expiration date of this signature. This is a Unix |
| | | * timestamp. If this signature does not expire, this will |
| | | * be zero. |
| | | */ |
| | | public function getExpirationDate() |
| | | { |
| | | return $this->_expirationDate; |
| | | } |
| | | |
| | | // }}} |
| | | // {{{ getUserId() |
| | | |
| | | /** |
| | | * Gets the user id associated with this signature |
| | | * |
| | | * @return Crypt_GPG_UserId the user id associated with this signature. |
| | | */ |
| | | public function getUserId() |
| | | { |
| | | return $this->_userId; |
| | | } |
| | | |
| | | // }}} |
| | | // {{{ isValid() |
| | | |
| | | /** |
| | | * Gets whether or no this signature is valid |
| | | * |
| | | * @return boolean true if this signature is valid and false if it is not. |
| | | */ |
| | | public function isValid() |
| | | { |
| | | return $this->_isValid; |
| | | } |
| | | |
| | | // }}} |
| | | // {{{ setId() |
| | | |
| | | /** |
| | | * Sets the id of this signature |
| | | * |
| | | * @param string $id a base64-encoded string containing a unique id for |
| | | * this signature. |
| | | * |
| | | * @return Crypt_GPG_Signature the current object, for fluent interface. |
| | | * |
| | | * @see Crypt_GPG_Signature::getId() |
| | | */ |
| | | public function setId($id) |
| | | { |
| | | $this->_id = strval($id); |
| | | return $this; |
| | | } |
| | | |
| | | // }}} |
| | | // {{{ setKeyFingerprint() |
| | | |
| | | /** |
| | | * Sets the key fingerprint of this signature |
| | | * |
| | | * @param string $fingerprint the key fingerprint of this signature. This |
| | | * is the fingerprint of the primary key used to |
| | | * create this signature. |
| | | * |
| | | * @return Crypt_GPG_Signature the current object, for fluent interface. |
| | | */ |
| | | public function setKeyFingerprint($fingerprint) |
| | | { |
| | | $this->_keyFingerprint = strval($fingerprint); |
| | | return $this; |
| | | } |
| | | |
| | | // }}} |
| | | // {{{ setKeyId() |
| | | |
| | | /** |
| | | * Sets the key id of this signature |
| | | * |
| | | * @param string $id the key id of this signature. This is the id of the |
| | | * primary key used to create this signature. |
| | | * |
| | | * @return Crypt_GPG_Signature the current object, for fluent interface. |
| | | */ |
| | | public function setKeyId($id) |
| | | { |
| | | $this->_keyId = strval($id); |
| | | return $this; |
| | | } |
| | | |
| | | // }}} |
| | | // {{{ setCreationDate() |
| | | |
| | | /** |
| | | * Sets the creation date of this signature |
| | | * |
| | | * @param integer $creationDate the creation date of this signature. This |
| | | * is a Unix timestamp. |
| | | * |
| | | * @return Crypt_GPG_Signature the current object, for fluent interface. |
| | | */ |
| | | public function setCreationDate($creationDate) |
| | | { |
| | | $this->_creationDate = intval($creationDate); |
| | | return $this; |
| | | } |
| | | |
| | | // }}} |
| | | // {{{ setExpirationDate() |
| | | |
| | | /** |
| | | * Sets the expiration date of this signature |
| | | * |
| | | * @param integer $expirationDate the expiration date of this signature. |
| | | * This is a Unix timestamp. Specify zero if |
| | | * this signature does not expire. |
| | | * |
| | | * @return Crypt_GPG_Signature the current object, for fluent interface. |
| | | */ |
| | | public function setExpirationDate($expirationDate) |
| | | { |
| | | $this->_expirationDate = intval($expirationDate); |
| | | return $this; |
| | | } |
| | | |
| | | // }}} |
| | | // {{{ setUserId() |
| | | |
| | | /** |
| | | * Sets the user id associated with this signature |
| | | * |
| | | * @param Crypt_GPG_UserId $userId the user id associated with this |
| | | * signature. |
| | | * |
| | | * @return Crypt_GPG_Signature the current object, for fluent interface. |
| | | */ |
| | | public function setUserId(Crypt_GPG_UserId $userId) |
| | | { |
| | | $this->_userId = $userId; |
| | | return $this; |
| | | } |
| | | |
| | | // }}} |
| | | // {{{ setValid() |
| | | |
| | | /** |
| | | * Sets whether or not this signature is valid |
| | | * |
| | | * @param boolean $isValid true if this signature is valid and false if it |
| | | * is not. |
| | | * |
| | | * @return Crypt_GPG_Signature the current object, for fluent interface. |
| | | */ |
| | | public function setValid($isValid) |
| | | { |
| | | $this->_isValid = ($isValid) ? true : false; |
| | | return $this; |
| | | } |
| | | |
| | | // }}} |
| | | } |
| | | |
| | | // }}} |
| | | |
| | | ?> |
New file |
| | |
| | | <?php |
| | | |
| | | /* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */ |
| | | |
| | | /** |
| | | * Contains a class representing GPG sub-keys and constants for GPG algorithms |
| | | * |
| | | * PHP version 5 |
| | | * |
| | | * LICENSE: |
| | | * |
| | | * This library is free software; you can redistribute it and/or modify |
| | | * it under the terms of the GNU Lesser General Public License as |
| | | * published by the Free Software Foundation; either version 2.1 of the |
| | | * License, or (at your option) any later version. |
| | | * |
| | | * This library is distributed in the hope that it will be useful, |
| | | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| | | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| | | * Lesser General Public License for more details. |
| | | * |
| | | * You should have received a copy of the GNU Lesser General Public |
| | | * License along with this library; if not, write to the Free Software |
| | | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
| | | * |
| | | * @category Encryption |
| | | * @package Crypt_GPG |
| | | * @author Michael Gauthier <mike@silverorange.com> |
| | | * @author Nathan Fredrickson <nathan@silverorange.com> |
| | | * @copyright 2005-2010 silverorange |
| | | * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1 |
| | | * @version CVS: $Id: SubKey.php 302768 2010-08-25 13:45:52Z gauthierm $ |
| | | * @link http://pear.php.net/package/Crypt_GPG |
| | | */ |
| | | |
| | | // {{{ class Crypt_GPG_SubKey |
| | | |
| | | /** |
| | | * A class for GPG sub-key information |
| | | * |
| | | * This class is used to store the results of the {@link Crypt_GPG::getKeys()} |
| | | * method. Sub-key objects are members of a {@link Crypt_GPG_Key} object. |
| | | * |
| | | * @category Encryption |
| | | * @package Crypt_GPG |
| | | * @author Michael Gauthier <mike@silverorange.com> |
| | | * @author Nathan Fredrickson <nathan@silverorange.com> |
| | | * @copyright 2005-2010 silverorange |
| | | * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1 |
| | | * @link http://pear.php.net/package/Crypt_GPG |
| | | * @see Crypt_GPG::getKeys() |
| | | * @see Crypt_GPG_Key::getSubKeys() |
| | | */ |
| | | class Crypt_GPG_SubKey |
| | | { |
| | | // {{{ class constants |
| | | |
| | | /** |
| | | * RSA encryption algorithm. |
| | | */ |
| | | const ALGORITHM_RSA = 1; |
| | | |
| | | /** |
| | | * Elgamal encryption algorithm (encryption only). |
| | | */ |
| | | const ALGORITHM_ELGAMAL_ENC = 16; |
| | | |
| | | /** |
| | | * DSA encryption algorithm (sometimes called DH, sign only). |
| | | */ |
| | | const ALGORITHM_DSA = 17; |
| | | |
| | | /** |
| | | * Elgamal encryption algorithm (signage and encryption - should not be |
| | | * used). |
| | | */ |
| | | const ALGORITHM_ELGAMAL_ENC_SGN = 20; |
| | | |
| | | // }}} |
| | | // {{{ class properties |
| | | |
| | | /** |
| | | * The id of this sub-key |
| | | * |
| | | * @var string |
| | | */ |
| | | private $_id = ''; |
| | | |
| | | /** |
| | | * The algorithm used to create this sub-key |
| | | * |
| | | * The value is one of the Crypt_GPG_SubKey::ALGORITHM_* constants. |
| | | * |
| | | * @var integer |
| | | */ |
| | | private $_algorithm = 0; |
| | | |
| | | /** |
| | | * The fingerprint of this sub-key |
| | | * |
| | | * @var string |
| | | */ |
| | | private $_fingerprint = ''; |
| | | |
| | | /** |
| | | * Length of this sub-key in bits |
| | | * |
| | | * @var integer |
| | | */ |
| | | private $_length = 0; |
| | | |
| | | /** |
| | | * Date this sub-key was created |
| | | * |
| | | * This is a Unix timestamp. |
| | | * |
| | | * @var integer |
| | | */ |
| | | private $_creationDate = 0; |
| | | |
| | | /** |
| | | * Date this sub-key expires |
| | | * |
| | | * This is a Unix timestamp. If this sub-key does not expire, this will be |
| | | * zero. |
| | | * |
| | | * @var integer |
| | | */ |
| | | private $_expirationDate = 0; |
| | | |
| | | /** |
| | | * Whether or not this sub-key can sign data |
| | | * |
| | | * @var boolean |
| | | */ |
| | | private $_canSign = false; |
| | | |
| | | /** |
| | | * Whether or not this sub-key can encrypt data |
| | | * |
| | | * @var boolean |
| | | */ |
| | | private $_canEncrypt = false; |
| | | |
| | | /** |
| | | * Whether or not the private key for this sub-key exists in the keyring |
| | | * |
| | | * @var boolean |
| | | */ |
| | | private $_hasPrivate = false; |
| | | |
| | | /** |
| | | * Whether or not this sub-key is revoked |
| | | * |
| | | * @var boolean |
| | | */ |
| | | private $_isRevoked = false; |
| | | |
| | | // }}} |
| | | // {{{ __construct() |
| | | |
| | | /** |
| | | * Creates a new sub-key object |
| | | * |
| | | * Sub-keys can be initialized from an array of named values. Available |
| | | * names are: |
| | | * |
| | | * - <kbd>string id</kbd> - the key id of the sub-key. |
| | | * - <kbd>integer algorithm</kbd> - the encryption algorithm of the |
| | | * sub-key. |
| | | * - <kbd>string fingerprint</kbd> - the fingerprint of the sub-key. The |
| | | * fingerprint should not contain |
| | | * formatting characters. |
| | | * - <kbd>integer length</kbd> - the length of the sub-key in bits. |
| | | * - <kbd>integer creation</kbd> - the date the sub-key was created. |
| | | * This is a UNIX timestamp. |
| | | * - <kbd>integer expiration</kbd> - the date the sub-key expires. This |
| | | * is a UNIX timestamp. If the sub-key |
| | | * does not expire, use 0. |
| | | * - <kbd>boolean canSign</kbd> - whether or not the sub-key can be |
| | | * used to sign data. |
| | | * - <kbd>boolean canEncrypt</kbd> - whether or not the sub-key can be |
| | | * used to encrypt data. |
| | | * - <kbd>boolean hasPrivate</kbd> - whether or not the private key for |
| | | * the sub-key exists in the keyring. |
| | | * - <kbd>boolean isRevoked</kbd> - whether or not this sub-key is |
| | | * revoked. |
| | | * |
| | | * @param Crypt_GPG_SubKey|string|array $key optional. Either an existing |
| | | * sub-key object, which is copied; a sub-key string, which is |
| | | * parsed; or an array of initial values. |
| | | */ |
| | | public function __construct($key = null) |
| | | { |
| | | // parse from string |
| | | if (is_string($key)) { |
| | | $key = self::parse($key); |
| | | } |
| | | |
| | | // copy from object |
| | | if ($key instanceof Crypt_GPG_SubKey) { |
| | | $this->_id = $key->_id; |
| | | $this->_algorithm = $key->_algorithm; |
| | | $this->_fingerprint = $key->_fingerprint; |
| | | $this->_length = $key->_length; |
| | | $this->_creationDate = $key->_creationDate; |
| | | $this->_expirationDate = $key->_expirationDate; |
| | | $this->_canSign = $key->_canSign; |
| | | $this->_canEncrypt = $key->_canEncrypt; |
| | | $this->_hasPrivate = $key->_hasPrivate; |
| | | $this->_isRevoked = $key->_isRevoked; |
| | | } |
| | | |
| | | // initialize from array |
| | | if (is_array($key)) { |
| | | if (array_key_exists('id', $key)) { |
| | | $this->setId($key['id']); |
| | | } |
| | | |
| | | if (array_key_exists('algorithm', $key)) { |
| | | $this->setAlgorithm($key['algorithm']); |
| | | } |
| | | |
| | | if (array_key_exists('fingerprint', $key)) { |
| | | $this->setFingerprint($key['fingerprint']); |
| | | } |
| | | |
| | | if (array_key_exists('length', $key)) { |
| | | $this->setLength($key['length']); |
| | | } |
| | | |
| | | if (array_key_exists('creation', $key)) { |
| | | $this->setCreationDate($key['creation']); |
| | | } |
| | | |
| | | if (array_key_exists('expiration', $key)) { |
| | | $this->setExpirationDate($key['expiration']); |
| | | } |
| | | |
| | | if (array_key_exists('canSign', $key)) { |
| | | $this->setCanSign($key['canSign']); |
| | | } |
| | | |
| | | if (array_key_exists('canEncrypt', $key)) { |
| | | $this->setCanEncrypt($key['canEncrypt']); |
| | | } |
| | | |
| | | if (array_key_exists('hasPrivate', $key)) { |
| | | $this->setHasPrivate($key['hasPrivate']); |
| | | } |
| | | |
| | | if (array_key_exists('isRevoked', $key)) { |
| | | $this->setRevoked($key['isRevoked']); |
| | | } |
| | | } |
| | | } |
| | | |
| | | // }}} |
| | | // {{{ getId() |
| | | |
| | | /** |
| | | * Gets the id of this sub-key |
| | | * |
| | | * @return string the id of this sub-key. |
| | | */ |
| | | public function getId() |
| | | { |
| | | return $this->_id; |
| | | } |
| | | |
| | | // }}} |
| | | // {{{ getAlgorithm() |
| | | |
| | | /** |
| | | * Gets the algorithm used by this sub-key |
| | | * |
| | | * The algorithm should be one of the Crypt_GPG_SubKey::ALGORITHM_* |
| | | * constants. |
| | | * |
| | | * @return integer the algorithm used by this sub-key. |
| | | */ |
| | | public function getAlgorithm() |
| | | { |
| | | return $this->_algorithm; |
| | | } |
| | | |
| | | // }}} |
| | | // {{{ getCreationDate() |
| | | |
| | | /** |
| | | * Gets the creation date of this sub-key |
| | | * |
| | | * This is a Unix timestamp. |
| | | * |
| | | * @return integer the creation date of this sub-key. |
| | | */ |
| | | public function getCreationDate() |
| | | { |
| | | return $this->_creationDate; |
| | | } |
| | | |
| | | // }}} |
| | | // {{{ getExpirationDate() |
| | | |
| | | /** |
| | | * Gets the date this sub-key expires |
| | | * |
| | | * This is a Unix timestamp. If this sub-key does not expire, this will be |
| | | * zero. |
| | | * |
| | | * @return integer the date this sub-key expires. |
| | | */ |
| | | public function getExpirationDate() |
| | | { |
| | | return $this->_expirationDate; |
| | | } |
| | | |
| | | // }}} |
| | | // {{{ getFingerprint() |
| | | |
| | | /** |
| | | * Gets the fingerprint of this sub-key |
| | | * |
| | | * @return string the fingerprint of this sub-key. |
| | | */ |
| | | public function getFingerprint() |
| | | { |
| | | return $this->_fingerprint; |
| | | } |
| | | |
| | | // }}} |
| | | // {{{ getLength() |
| | | |
| | | /** |
| | | * Gets the length of this sub-key in bits |
| | | * |
| | | * @return integer the length of this sub-key in bits. |
| | | */ |
| | | public function getLength() |
| | | { |
| | | return $this->_length; |
| | | } |
| | | |
| | | // }}} |
| | | // {{{ canSign() |
| | | |
| | | /** |
| | | * Gets whether or not this sub-key can sign data |
| | | * |
| | | * @return boolean true if this sub-key can sign data and false if this |
| | | * sub-key can not sign data. |
| | | */ |
| | | public function canSign() |
| | | { |
| | | return $this->_canSign; |
| | | } |
| | | |
| | | // }}} |
| | | // {{{ canEncrypt() |
| | | |
| | | /** |
| | | * Gets whether or not this sub-key can encrypt data |
| | | * |
| | | * @return boolean true if this sub-key can encrypt data and false if this |
| | | * sub-key can not encrypt data. |
| | | */ |
| | | public function canEncrypt() |
| | | { |
| | | return $this->_canEncrypt; |
| | | } |
| | | |
| | | // }}} |
| | | // {{{ hasPrivate() |
| | | |
| | | /** |
| | | * Gets whether or not the private key for this sub-key exists in the |
| | | * keyring |
| | | * |
| | | * @return boolean true the private key for this sub-key exists in the |
| | | * keyring and false if it does not. |
| | | */ |
| | | public function hasPrivate() |
| | | { |
| | | return $this->_hasPrivate; |
| | | } |
| | | |
| | | // }}} |
| | | // {{{ isRevoked() |
| | | |
| | | /** |
| | | * Gets whether or not this sub-key is revoked |
| | | * |
| | | * @return boolean true if this sub-key is revoked and false if it is not. |
| | | */ |
| | | public function isRevoked() |
| | | { |
| | | return $this->_isRevoked; |
| | | } |
| | | |
| | | // }}} |
| | | // {{{ setCreationDate() |
| | | |
| | | /** |
| | | * Sets the creation date of this sub-key |
| | | * |
| | | * The creation date is a Unix timestamp. |
| | | * |
| | | * @param integer $creationDate the creation date of this sub-key. |
| | | * |
| | | * @return Crypt_GPG_SubKey the current object, for fluent interface. |
| | | */ |
| | | public function setCreationDate($creationDate) |
| | | { |
| | | $this->_creationDate = intval($creationDate); |
| | | return $this; |
| | | } |
| | | |
| | | // }}} |
| | | // {{{ setExpirationDate() |
| | | |
| | | /** |
| | | * Sets the expiration date of this sub-key |
| | | * |
| | | * The expiration date is a Unix timestamp. Specify zero if this sub-key |
| | | * does not expire. |
| | | * |
| | | * @param integer $expirationDate the expiration date of this sub-key. |
| | | * |
| | | * @return Crypt_GPG_SubKey the current object, for fluent interface. |
| | | */ |
| | | public function setExpirationDate($expirationDate) |
| | | { |
| | | $this->_expirationDate = intval($expirationDate); |
| | | return $this; |
| | | } |
| | | |
| | | // }}} |
| | | // {{{ setId() |
| | | |
| | | /** |
| | | * Sets the id of this sub-key |
| | | * |
| | | * @param string $id the id of this sub-key. |
| | | * |
| | | * @return Crypt_GPG_SubKey the current object, for fluent interface. |
| | | */ |
| | | public function setId($id) |
| | | { |
| | | $this->_id = strval($id); |
| | | return $this; |
| | | } |
| | | |
| | | // }}} |
| | | // {{{ setAlgorithm() |
| | | |
| | | /** |
| | | * Sets the algorithm used by this sub-key |
| | | * |
| | | * @param integer $algorithm the algorithm used by this sub-key. |
| | | * |
| | | * @return Crypt_GPG_SubKey the current object, for fluent interface. |
| | | */ |
| | | public function setAlgorithm($algorithm) |
| | | { |
| | | $this->_algorithm = intval($algorithm); |
| | | return $this; |
| | | } |
| | | |
| | | // }}} |
| | | // {{{ setFingerprint() |
| | | |
| | | /** |
| | | * Sets the fingerprint of this sub-key |
| | | * |
| | | * @param string $fingerprint the fingerprint of this sub-key. |
| | | * |
| | | * @return Crypt_GPG_SubKey the current object, for fluent interface. |
| | | */ |
| | | public function setFingerprint($fingerprint) |
| | | { |
| | | $this->_fingerprint = strval($fingerprint); |
| | | return $this; |
| | | } |
| | | |
| | | // }}} |
| | | // {{{ setLength() |
| | | |
| | | /** |
| | | * Sets the length of this sub-key in bits |
| | | * |
| | | * @param integer $length the length of this sub-key in bits. |
| | | * |
| | | * @return Crypt_GPG_SubKey the current object, for fluent interface. |
| | | */ |
| | | public function setLength($length) |
| | | { |
| | | $this->_length = intval($length); |
| | | return $this; |
| | | } |
| | | |
| | | // }}} |
| | | // {{{ setCanSign() |
| | | |
| | | /** |
| | | * Sets whether of not this sub-key can sign data |
| | | * |
| | | * @param boolean $canSign true if this sub-key can sign data and false if |
| | | * it can not. |
| | | * |
| | | * @return Crypt_GPG_SubKey the current object, for fluent interface. |
| | | */ |
| | | public function setCanSign($canSign) |
| | | { |
| | | $this->_canSign = ($canSign) ? true : false; |
| | | return $this; |
| | | } |
| | | |
| | | // }}} |
| | | // {{{ setCanEncrypt() |
| | | |
| | | /** |
| | | * Sets whether of not this sub-key can encrypt data |
| | | * |
| | | * @param boolean $canEncrypt true if this sub-key can encrypt data and |
| | | * false if it can not. |
| | | * |
| | | * @return Crypt_GPG_SubKey the current object, for fluent interface. |
| | | */ |
| | | public function setCanEncrypt($canEncrypt) |
| | | { |
| | | $this->_canEncrypt = ($canEncrypt) ? true : false; |
| | | return $this; |
| | | } |
| | | |
| | | // }}} |
| | | // {{{ setHasPrivate() |
| | | |
| | | /** |
| | | * Sets whether of not the private key for this sub-key exists in the |
| | | * keyring |
| | | * |
| | | * @param boolean $hasPrivate true if the private key for this sub-key |
| | | * exists in the keyring and false if it does |
| | | * not. |
| | | * |
| | | * @return Crypt_GPG_SubKey the current object, for fluent interface. |
| | | */ |
| | | public function setHasPrivate($hasPrivate) |
| | | { |
| | | $this->_hasPrivate = ($hasPrivate) ? true : false; |
| | | return $this; |
| | | } |
| | | |
| | | // }}} |
| | | // {{{ setRevoked() |
| | | |
| | | /** |
| | | * Sets whether or not this sub-key is revoked |
| | | * |
| | | * @param boolean $isRevoked whether or not this sub-key is revoked. |
| | | * |
| | | * @return Crypt_GPG_SubKey the current object, for fluent interface. |
| | | */ |
| | | public function setRevoked($isRevoked) |
| | | { |
| | | $this->_isRevoked = ($isRevoked) ? true : false; |
| | | return $this; |
| | | } |
| | | |
| | | // }}} |
| | | // {{{ parse() |
| | | |
| | | /** |
| | | * Parses a sub-key object from a sub-key string |
| | | * |
| | | * See <b>doc/DETAILS</b> in the |
| | | * {@link http://www.gnupg.org/download/ GPG distribution} for information |
| | | * on how the sub-key string is parsed. |
| | | * |
| | | * @param string $string the string containing the sub-key. |
| | | * |
| | | * @return Crypt_GPG_SubKey the sub-key object parsed from the string. |
| | | */ |
| | | public static function parse($string) |
| | | { |
| | | $tokens = explode(':', $string); |
| | | |
| | | $subKey = new Crypt_GPG_SubKey(); |
| | | |
| | | $subKey->setId($tokens[4]); |
| | | $subKey->setLength($tokens[2]); |
| | | $subKey->setAlgorithm($tokens[3]); |
| | | $subKey->setCreationDate(self::_parseDate($tokens[5])); |
| | | $subKey->setExpirationDate(self::_parseDate($tokens[6])); |
| | | |
| | | if ($tokens[1] == 'r') { |
| | | $subKey->setRevoked(true); |
| | | } |
| | | |
| | | if (strpos($tokens[11], 's') !== false) { |
| | | $subKey->setCanSign(true); |
| | | } |
| | | |
| | | if (strpos($tokens[11], 'e') !== false) { |
| | | $subKey->setCanEncrypt(true); |
| | | } |
| | | |
| | | return $subKey; |
| | | } |
| | | |
| | | // }}} |
| | | // {{{ _parseDate() |
| | | |
| | | /** |
| | | * Parses a date string as provided by GPG into a UNIX timestamp |
| | | * |
| | | * @param string $string the date string. |
| | | * |
| | | * @return integer the UNIX timestamp corresponding to the provided date |
| | | * string. |
| | | */ |
| | | private static function _parseDate($string) |
| | | { |
| | | if ($string == '') { |
| | | $timestamp = 0; |
| | | } else { |
| | | // all times are in UTC according to GPG documentation |
| | | $timeZone = new DateTimeZone('UTC'); |
| | | |
| | | if (strpos($string, 'T') === false) { |
| | | // interpret as UNIX timestamp |
| | | $string = '@' . $string; |
| | | } |
| | | |
| | | $date = new DateTime($string, $timeZone); |
| | | |
| | | // convert to UNIX timestamp |
| | | $timestamp = intval($date->format('U')); |
| | | } |
| | | |
| | | return $timestamp; |
| | | } |
| | | |
| | | // }}} |
| | | } |
| | | |
| | | // }}} |
| | | |
| | | ?> |
New file |
| | |
| | | <?php |
| | | |
| | | /* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */ |
| | | |
| | | /** |
| | | * Contains a data class representing a GPG user id |
| | | * |
| | | * PHP version 5 |
| | | * |
| | | * LICENSE: |
| | | * |
| | | * This library is free software; you can redistribute it and/or modify |
| | | * it under the terms of the GNU Lesser General Public License as |
| | | * published by the Free Software Foundation; either version 2.1 of the |
| | | * License, or (at your option) any later version. |
| | | * |
| | | * This library is distributed in the hope that it will be useful, |
| | | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| | | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| | | * Lesser General Public License for more details. |
| | | * |
| | | * You should have received a copy of the GNU Lesser General Public |
| | | * License along with this library; if not, write to the Free Software |
| | | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
| | | * |
| | | * @category Encryption |
| | | * @package Crypt_GPG |
| | | * @author Michael Gauthier <mike@silverorange.com> |
| | | * @copyright 2008-2010 silverorange |
| | | * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1 |
| | | * @version CVS: $Id: UserId.php 295621 2010-03-01 04:18:54Z gauthierm $ |
| | | * @link http://pear.php.net/package/Crypt_GPG |
| | | */ |
| | | |
| | | // {{{ class Crypt_GPG_UserId |
| | | |
| | | /** |
| | | * A class for GPG user id information |
| | | * |
| | | * This class is used to store the results of the {@link Crypt_GPG::getKeys()} |
| | | * method. User id objects are members of a {@link Crypt_GPG_Key} object. |
| | | * |
| | | * @category Encryption |
| | | * @package Crypt_GPG |
| | | * @author Michael Gauthier <mike@silverorange.com> |
| | | * @copyright 2008-2010 silverorange |
| | | * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1 |
| | | * @link http://pear.php.net/package/Crypt_GPG |
| | | * @see Crypt_GPG::getKeys() |
| | | * @see Crypt_GPG_Key::getUserIds() |
| | | */ |
| | | class Crypt_GPG_UserId |
| | | { |
| | | // {{{ class properties |
| | | |
| | | /** |
| | | * The name field of this user id |
| | | * |
| | | * @var string |
| | | */ |
| | | private $_name = ''; |
| | | |
| | | /** |
| | | * The comment field of this user id |
| | | * |
| | | * @var string |
| | | */ |
| | | private $_comment = ''; |
| | | |
| | | /** |
| | | * The email field of this user id |
| | | * |
| | | * @var string |
| | | */ |
| | | private $_email = ''; |
| | | |
| | | /** |
| | | * Whether or not this user id is revoked |
| | | * |
| | | * @var boolean |
| | | */ |
| | | private $_isRevoked = false; |
| | | |
| | | /** |
| | | * Whether or not this user id is valid |
| | | * |
| | | * @var boolean |
| | | */ |
| | | private $_isValid = true; |
| | | |
| | | // }}} |
| | | // {{{ __construct() |
| | | |
| | | /** |
| | | * Creates a new user id |
| | | * |
| | | * User ids can be initialized from an array of named values. Available |
| | | * names are: |
| | | * |
| | | * - <kbd>string name</kbd> - the name field of the user id. |
| | | * - <kbd>string comment</kbd> - the comment field of the user id. |
| | | * - <kbd>string email</kbd> - the email field of the user id. |
| | | * - <kbd>boolean valid</kbd> - whether or not the user id is valid. |
| | | * - <kbd>boolean revoked</kbd> - whether or not the user id is revoked. |
| | | * |
| | | * @param Crypt_GPG_UserId|string|array $userId optional. Either an |
| | | * existing user id object, which is copied; a user id string, which |
| | | * is parsed; or an array of initial values. |
| | | */ |
| | | public function __construct($userId = null) |
| | | { |
| | | // parse from string |
| | | if (is_string($userId)) { |
| | | $userId = self::parse($userId); |
| | | } |
| | | |
| | | // copy from object |
| | | if ($userId instanceof Crypt_GPG_UserId) { |
| | | $this->_name = $userId->_name; |
| | | $this->_comment = $userId->_comment; |
| | | $this->_email = $userId->_email; |
| | | $this->_isRevoked = $userId->_isRevoked; |
| | | $this->_isValid = $userId->_isValid; |
| | | } |
| | | |
| | | // initialize from array |
| | | if (is_array($userId)) { |
| | | if (array_key_exists('name', $userId)) { |
| | | $this->setName($userId['name']); |
| | | } |
| | | |
| | | if (array_key_exists('comment', $userId)) { |
| | | $this->setComment($userId['comment']); |
| | | } |
| | | |
| | | if (array_key_exists('email', $userId)) { |
| | | $this->setEmail($userId['email']); |
| | | } |
| | | |
| | | if (array_key_exists('revoked', $userId)) { |
| | | $this->setRevoked($userId['revoked']); |
| | | } |
| | | |
| | | if (array_key_exists('valid', $userId)) { |
| | | $this->setValid($userId['valid']); |
| | | } |
| | | } |
| | | } |
| | | |
| | | // }}} |
| | | // {{{ getName() |
| | | |
| | | /** |
| | | * Gets the name field of this user id |
| | | * |
| | | * @return string the name field of this user id. |
| | | */ |
| | | public function getName() |
| | | { |
| | | return $this->_name; |
| | | } |
| | | |
| | | // }}} |
| | | // {{{ getComment() |
| | | |
| | | /** |
| | | * Gets the comments field of this user id |
| | | * |
| | | * @return string the comments field of this user id. |
| | | */ |
| | | public function getComment() |
| | | { |
| | | return $this->_comment; |
| | | } |
| | | |
| | | // }}} |
| | | // {{{ getEmail() |
| | | |
| | | /** |
| | | * Gets the email field of this user id |
| | | * |
| | | * @return string the email field of this user id. |
| | | */ |
| | | public function getEmail() |
| | | { |
| | | return $this->_email; |
| | | } |
| | | |
| | | // }}} |
| | | // {{{ isRevoked() |
| | | |
| | | /** |
| | | * Gets whether or not this user id is revoked |
| | | * |
| | | * @return boolean true if this user id is revoked and false if it is not. |
| | | */ |
| | | public function isRevoked() |
| | | { |
| | | return $this->_isRevoked; |
| | | } |
| | | |
| | | // }}} |
| | | // {{{ isValid() |
| | | |
| | | /** |
| | | * Gets whether or not this user id is valid |
| | | * |
| | | * @return boolean true if this user id is valid and false if it is not. |
| | | */ |
| | | public function isValid() |
| | | { |
| | | return $this->_isValid; |
| | | } |
| | | |
| | | // }}} |
| | | // {{{ __toString() |
| | | |
| | | /** |
| | | * Gets a string representation of this user id |
| | | * |
| | | * The string is formatted as: |
| | | * <b><kbd>name (comment) <email-address></kbd></b>. |
| | | * |
| | | * @return string a string representation of this user id. |
| | | */ |
| | | public function __toString() |
| | | { |
| | | $components = array(); |
| | | |
| | | if (strlen($this->_name) > 0) { |
| | | $components[] = $this->_name; |
| | | } |
| | | |
| | | if (strlen($this->_comment) > 0) { |
| | | $components[] = '(' . $this->_comment . ')'; |
| | | } |
| | | |
| | | if (strlen($this->_email) > 0) { |
| | | $components[] = '<' . $this->_email. '>'; |
| | | } |
| | | |
| | | return implode(' ', $components); |
| | | } |
| | | |
| | | // }}} |
| | | // {{{ setName() |
| | | |
| | | /** |
| | | * Sets the name field of this user id |
| | | * |
| | | * @param string $name the name field of this user id. |
| | | * |
| | | * @return Crypt_GPG_UserId the current object, for fluent interface. |
| | | */ |
| | | public function setName($name) |
| | | { |
| | | $this->_name = strval($name); |
| | | return $this; |
| | | } |
| | | |
| | | // }}} |
| | | // {{{ setComment() |
| | | |
| | | /** |
| | | * Sets the comment field of this user id |
| | | * |
| | | * @param string $comment the comment field of this user id. |
| | | * |
| | | * @return Crypt_GPG_UserId the current object, for fluent interface. |
| | | */ |
| | | public function setComment($comment) |
| | | { |
| | | $this->_comment = strval($comment); |
| | | return $this; |
| | | } |
| | | |
| | | // }}} |
| | | // {{{ setEmail() |
| | | |
| | | /** |
| | | * Sets the email field of this user id |
| | | * |
| | | * @param string $email the email field of this user id. |
| | | * |
| | | * @return Crypt_GPG_UserId the current object, for fluent interface. |
| | | */ |
| | | public function setEmail($email) |
| | | { |
| | | $this->_email = strval($email); |
| | | return $this; |
| | | } |
| | | |
| | | // }}} |
| | | // {{{ setRevoked() |
| | | |
| | | /** |
| | | * Sets whether or not this user id is revoked |
| | | * |
| | | * @param boolean $isRevoked whether or not this user id is revoked. |
| | | * |
| | | * @return Crypt_GPG_UserId the current object, for fluent interface. |
| | | */ |
| | | public function setRevoked($isRevoked) |
| | | { |
| | | $this->_isRevoked = ($isRevoked) ? true : false; |
| | | return $this; |
| | | } |
| | | |
| | | // }}} |
| | | // {{{ setValid() |
| | | |
| | | /** |
| | | * Sets whether or not this user id is valid |
| | | * |
| | | * @param boolean $isValid whether or not this user id is valid. |
| | | * |
| | | * @return Crypt_GPG_UserId the current object, for fluent interface. |
| | | */ |
| | | public function setValid($isValid) |
| | | { |
| | | $this->_isValid = ($isValid) ? true : false; |
| | | return $this; |
| | | } |
| | | |
| | | // }}} |
| | | // {{{ parse() |
| | | |
| | | /** |
| | | * Parses a user id object from a user id string |
| | | * |
| | | * A user id string is of the form: |
| | | * <b><kbd>name (comment) <email-address></kbd></b> with the <i>comment</i> |
| | | * and <i>email-address</i> fields being optional. |
| | | * |
| | | * @param string $string the user id string to parse. |
| | | * |
| | | * @return Crypt_GPG_UserId the user id object parsed from the string. |
| | | */ |
| | | public static function parse($string) |
| | | { |
| | | $userId = new Crypt_GPG_UserId(); |
| | | $email = ''; |
| | | $comment = ''; |
| | | |
| | | // get email address from end of string if it exists |
| | | $matches = array(); |
| | | if (preg_match('/^(.+?) <([^>]+)>$/', $string, $matches) === 1) { |
| | | $string = $matches[1]; |
| | | $email = $matches[2]; |
| | | } |
| | | |
| | | // get comment from end of string if it exists |
| | | $matches = array(); |
| | | if (preg_match('/^(.+?) \(([^\)]+)\)$/', $string, $matches) === 1) { |
| | | $string = $matches[1]; |
| | | $comment = $matches[2]; |
| | | } |
| | | |
| | | $name = $string; |
| | | |
| | | $userId->setName($name); |
| | | $userId->setComment($comment); |
| | | $userId->setEmail($email); |
| | | |
| | | return $userId; |
| | | } |
| | | |
| | | // }}} |
| | | } |
| | | |
| | | // }}} |
| | | |
| | | ?> |
New file |
| | |
| | | <?php |
| | | |
| | | /* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */ |
| | | |
| | | /** |
| | | * Crypt_GPG is a package to use GPG from PHP |
| | | * |
| | | * This file contains an object that handles GPG's status output for the verify |
| | | * operation. |
| | | * |
| | | * PHP version 5 |
| | | * |
| | | * LICENSE: |
| | | * |
| | | * This library is free software; you can redistribute it and/or modify |
| | | * it under the terms of the GNU Lesser General Public License as |
| | | * published by the Free Software Foundation; either version 2.1 of the |
| | | * License, or (at your option) any later version. |
| | | * |
| | | * This library is distributed in the hope that it will be useful, |
| | | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| | | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| | | * Lesser General Public License for more details. |
| | | * |
| | | * You should have received a copy of the GNU Lesser General Public |
| | | * License along with this library; if not, write to the Free Software |
| | | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
| | | * |
| | | * @category Encryption |
| | | * @package Crypt_GPG |
| | | * @author Michael Gauthier <mike@silverorange.com> |
| | | * @copyright 2008 silverorange |
| | | * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1 |
| | | * @version CVS: $Id: VerifyStatusHandler.php 302908 2010-08-31 03:56:54Z gauthierm $ |
| | | * @link http://pear.php.net/package/Crypt_GPG |
| | | * @link http://www.gnupg.org/ |
| | | */ |
| | | |
| | | /** |
| | | * Signature object class definition |
| | | */ |
| | | require_once 'Crypt/GPG/Signature.php'; |
| | | |
| | | /** |
| | | * Status line handler for the verify operation |
| | | * |
| | | * This class is used internally by Crypt_GPG and does not need be used |
| | | * directly. See the {@link Crypt_GPG} class for end-user API. |
| | | * |
| | | * This class is responsible for building signature objects that are returned |
| | | * by the {@link Crypt_GPG::verify()} method. See <b>doc/DETAILS</b> in the |
| | | * {@link http://www.gnupg.org/download/ GPG distribution} for detailed |
| | | * information on GPG's status output for the verify operation. |
| | | * |
| | | * @category Encryption |
| | | * @package Crypt_GPG |
| | | * @author Michael Gauthier <mike@silverorange.com> |
| | | * @copyright 2008 silverorange |
| | | * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1 |
| | | * @link http://pear.php.net/package/Crypt_GPG |
| | | * @link http://www.gnupg.org/ |
| | | */ |
| | | class Crypt_GPG_VerifyStatusHandler |
| | | { |
| | | // {{{ protected properties |
| | | |
| | | /** |
| | | * The current signature id |
| | | * |
| | | * Ths signature id is emitted by GPG before the new signature line so we |
| | | * must remember it temporarily. |
| | | * |
| | | * @var string |
| | | */ |
| | | protected $signatureId = ''; |
| | | |
| | | /** |
| | | * List of parsed {@link Crypt_GPG_Signature} objects |
| | | * |
| | | * @var array |
| | | */ |
| | | protected $signatures = array(); |
| | | |
| | | /** |
| | | * Array index of the current signature |
| | | * |
| | | * @var integer |
| | | */ |
| | | protected $index = -1; |
| | | |
| | | // }}} |
| | | // {{{ handle() |
| | | |
| | | /** |
| | | * Handles a status line |
| | | * |
| | | * @param string $line the status line to handle. |
| | | * |
| | | * @return void |
| | | */ |
| | | public function handle($line) |
| | | { |
| | | $tokens = explode(' ', $line); |
| | | switch ($tokens[0]) { |
| | | case 'GOODSIG': |
| | | case 'EXPSIG': |
| | | case 'EXPKEYSIG': |
| | | case 'REVKEYSIG': |
| | | case 'BADSIG': |
| | | $signature = new Crypt_GPG_Signature(); |
| | | |
| | | // if there was a signature id, set it on the new signature |
| | | if ($this->signatureId != '') { |
| | | $signature->setId($this->signatureId); |
| | | $this->signatureId = ''; |
| | | } |
| | | |
| | | // Detect whether fingerprint or key id was returned and set |
| | | // signature values appropriately. Key ids are strings of either |
| | | // 16 or 8 hexadecimal characters. Fingerprints are strings of 40 |
| | | // hexadecimal characters. The key id is the last 16 characters of |
| | | // the key fingerprint. |
| | | if (strlen($tokens[1]) > 16) { |
| | | $signature->setKeyFingerprint($tokens[1]); |
| | | $signature->setKeyId(substr($tokens[1], -16)); |
| | | } else { |
| | | $signature->setKeyId($tokens[1]); |
| | | } |
| | | |
| | | // get user id string |
| | | $string = implode(' ', array_splice($tokens, 2)); |
| | | $string = rawurldecode($string); |
| | | |
| | | $signature->setUserId(Crypt_GPG_UserId::parse($string)); |
| | | |
| | | $this->index++; |
| | | $this->signatures[$this->index] = $signature; |
| | | break; |
| | | |
| | | case 'ERRSIG': |
| | | $signature = new Crypt_GPG_Signature(); |
| | | |
| | | // if there was a signature id, set it on the new signature |
| | | if ($this->signatureId != '') { |
| | | $signature->setId($this->signatureId); |
| | | $this->signatureId = ''; |
| | | } |
| | | |
| | | // Detect whether fingerprint or key id was returned and set |
| | | // signature values appropriately. Key ids are strings of either |
| | | // 16 or 8 hexadecimal characters. Fingerprints are strings of 40 |
| | | // hexadecimal characters. The key id is the last 16 characters of |
| | | // the key fingerprint. |
| | | if (strlen($tokens[1]) > 16) { |
| | | $signature->setKeyFingerprint($tokens[1]); |
| | | $signature->setKeyId(substr($tokens[1], -16)); |
| | | } else { |
| | | $signature->setKeyId($tokens[1]); |
| | | } |
| | | |
| | | $this->index++; |
| | | $this->signatures[$this->index] = $signature; |
| | | |
| | | break; |
| | | |
| | | case 'VALIDSIG': |
| | | if (!array_key_exists($this->index, $this->signatures)) { |
| | | break; |
| | | } |
| | | |
| | | $signature = $this->signatures[$this->index]; |
| | | |
| | | $signature->setValid(true); |
| | | $signature->setKeyFingerprint($tokens[1]); |
| | | |
| | | if (strpos($tokens[3], 'T') === false) { |
| | | $signature->setCreationDate($tokens[3]); |
| | | } else { |
| | | $signature->setCreationDate(strtotime($tokens[3])); |
| | | } |
| | | |
| | | if (array_key_exists(4, $tokens)) { |
| | | if (strpos($tokens[4], 'T') === false) { |
| | | $signature->setExpirationDate($tokens[4]); |
| | | } else { |
| | | $signature->setExpirationDate(strtotime($tokens[4])); |
| | | } |
| | | } |
| | | |
| | | break; |
| | | |
| | | case 'SIG_ID': |
| | | // note: signature id comes before new signature line and may not |
| | | // exist for some signature types |
| | | $this->signatureId = $tokens[1]; |
| | | break; |
| | | } |
| | | } |
| | | |
| | | // }}} |
| | | // {{{ getSignatures() |
| | | |
| | | /** |
| | | * Gets the {@link Crypt_GPG_Signature} objects parsed by this handler |
| | | * |
| | | * @return array the signature objects parsed by this handler. |
| | | */ |
| | | public function getSignatures() |
| | | { |
| | | return $this->signatures; |
| | | } |
| | | |
| | | // }}} |
| | | } |
| | | |
| | | ?> |
New file |
| | |
| | | <?php |
| | | /* |
| | | +-------------------------------------------------------------------------+ |
| | | | Abstract driver for the Enigma Plugin | |
| | | | | |
| | | | This program is free software; you can redistribute it and/or modify | |
| | | | it under the terms of the GNU General Public License version 2 | |
| | | | as published by the Free Software Foundation. | |
| | | | | |
| | | | This program is distributed in the hope that it will be useful, | |
| | | | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| | | | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
| | | | GNU General Public License for more details. | |
| | | | | |
| | | | You should have received a copy of the GNU General Public License along | |
| | | | with this program; if not, write to the Free Software Foundation, Inc., | |
| | | | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. | |
| | | | | |
| | | +-------------------------------------------------------------------------+ |
| | | | Author: Aleksander Machniak <alec@alec.pl> | |
| | | +-------------------------------------------------------------------------+ |
| | | */ |
| | | |
| | | abstract class enigma_driver |
| | | { |
| | | /** |
| | | * Class constructor. |
| | | * |
| | | * @param string User name (email address) |
| | | */ |
| | | abstract function __construct($user); |
| | | |
| | | /** |
| | | * Driver initialization. |
| | | * |
| | | * @return mixed NULL on success, enigma_error on failure |
| | | */ |
| | | abstract function init(); |
| | | |
| | | /** |
| | | * Encryption. |
| | | */ |
| | | abstract function encrypt($text, $keys); |
| | | |
| | | /** |
| | | * Decryption.. |
| | | */ |
| | | abstract function decrypt($text, $key, $passwd); |
| | | |
| | | /** |
| | | * Signing. |
| | | */ |
| | | abstract function sign($text, $key, $passwd); |
| | | |
| | | /** |
| | | * Signature verification. |
| | | * |
| | | * @param string Message body |
| | | * @param string Signature, if message is of type PGP/MIME and body doesn't contain it |
| | | * |
| | | * @return mixed Signature information (enigma_signature) or enigma_error |
| | | */ |
| | | abstract function verify($text, $signature); |
| | | |
| | | /** |
| | | * Key/Cert file import. |
| | | * |
| | | * @param string File name or file content |
| | | * @param bollean True if first argument is a filename |
| | | * |
| | | * @return mixed Import status array or enigma_error |
| | | */ |
| | | abstract function import($content, $isfile=false); |
| | | |
| | | /** |
| | | * Keys listing. |
| | | * |
| | | * @param string Optional pattern for key ID, user ID or fingerprint |
| | | * |
| | | * @return mixed Array of enigma_key objects or enigma_error |
| | | */ |
| | | abstract function list_keys($pattern=''); |
| | | |
| | | /** |
| | | * Single key information. |
| | | * |
| | | * @param string Key ID, user ID or fingerprint |
| | | * |
| | | * @return mixed Key (enigma_key) object or enigma_error |
| | | */ |
| | | abstract function get_key($keyid); |
| | | |
| | | /** |
| | | * Key pair generation. |
| | | * |
| | | * @param array Key/User data |
| | | * |
| | | * @return mixed Key (enigma_key) object or enigma_error |
| | | */ |
| | | abstract function gen_key($data); |
| | | |
| | | /** |
| | | * Key deletion. |
| | | */ |
| | | abstract function del_key($keyid); |
| | | } |
New file |
| | |
| | | <?php |
| | | /* |
| | | +-------------------------------------------------------------------------+ |
| | | | GnuPG (PGP) driver for the Enigma Plugin | |
| | | | | |
| | | | This program is free software; you can redistribute it and/or modify | |
| | | | it under the terms of the GNU General Public License version 2 | |
| | | | as published by the Free Software Foundation. | |
| | | | | |
| | | | This program is distributed in the hope that it will be useful, | |
| | | | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| | | | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
| | | | GNU General Public License for more details. | |
| | | | | |
| | | | You should have received a copy of the GNU General Public License along | |
| | | | with this program; if not, write to the Free Software Foundation, Inc., | |
| | | | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. | |
| | | | | |
| | | +-------------------------------------------------------------------------+ |
| | | | Author: Aleksander Machniak <alec@alec.pl> | |
| | | +-------------------------------------------------------------------------+ |
| | | */ |
| | | |
| | | require_once 'Crypt/GPG.php'; |
| | | |
| | | class enigma_driver_gnupg extends enigma_driver |
| | | { |
| | | private $rc; |
| | | private $gpg; |
| | | private $homedir; |
| | | private $user; |
| | | |
| | | function __construct($user) |
| | | { |
| | | $rcmail = rcmail::get_instance(); |
| | | $this->rc = $rcmail; |
| | | $this->user = $user; |
| | | } |
| | | |
| | | /** |
| | | * Driver initialization and environment checking. |
| | | * Should only return critical errors. |
| | | * |
| | | * @return mixed NULL on success, enigma_error on failure |
| | | */ |
| | | function init() |
| | | { |
| | | $homedir = $this->rc->config->get('enigma_pgp_homedir', INSTALL_PATH . '/plugins/enigma/home'); |
| | | |
| | | if (!$homedir) |
| | | return new enigma_error(enigma_error::E_INTERNAL, |
| | | "Option 'enigma_pgp_homedir' not specified"); |
| | | |
| | | // check if homedir exists (create it if not) and is readable |
| | | if (!file_exists($homedir)) |
| | | return new enigma_error(enigma_error::E_INTERNAL, |
| | | "Keys directory doesn't exists: $homedir"); |
| | | if (!is_writable($homedir)) |
| | | return new enigma_error(enigma_error::E_INTERNAL, |
| | | "Keys directory isn't writeable: $homedir"); |
| | | |
| | | $homedir = $homedir . '/' . $this->user; |
| | | |
| | | // check if user's homedir exists (create it if not) and is readable |
| | | if (!file_exists($homedir)) |
| | | mkdir($homedir, 0700); |
| | | |
| | | if (!file_exists($homedir)) |
| | | return new enigma_error(enigma_error::E_INTERNAL, |
| | | "Unable to create keys directory: $homedir"); |
| | | if (!is_writable($homedir)) |
| | | return new enigma_error(enigma_error::E_INTERNAL, |
| | | "Unable to write to keys directory: $homedir"); |
| | | |
| | | $this->homedir = $homedir; |
| | | |
| | | // Create Crypt_GPG object |
| | | try { |
| | | $this->gpg = new Crypt_GPG(array( |
| | | 'homedir' => $this->homedir, |
| | | // 'debug' => true, |
| | | )); |
| | | } |
| | | catch (Exception $e) { |
| | | return $this->get_error_from_exception($e); |
| | | } |
| | | } |
| | | |
| | | function encrypt($text, $keys) |
| | | { |
| | | /* |
| | | foreach ($keys as $key) { |
| | | $this->gpg->addEncryptKey($key); |
| | | } |
| | | $enc = $this->gpg->encrypt($text); |
| | | return $enc; |
| | | */ |
| | | } |
| | | |
| | | function decrypt($text, $key, $passwd) |
| | | { |
| | | // $this->gpg->addDecryptKey($key, $passwd); |
| | | try { |
| | | $dec = $this->gpg->decrypt($text); |
| | | return $dec; |
| | | } |
| | | catch (Exception $e) { |
| | | return $this->get_error_from_exception($e); |
| | | } |
| | | } |
| | | |
| | | function sign($text, $key, $passwd) |
| | | { |
| | | /* |
| | | $this->gpg->addSignKey($key, $passwd); |
| | | $signed = $this->gpg->sign($text, Crypt_GPG::SIGN_MODE_DETACHED); |
| | | return $signed; |
| | | */ |
| | | } |
| | | |
| | | function verify($text, $signature) |
| | | { |
| | | try { |
| | | $verified = $this->gpg->verify($text, $signature); |
| | | return $this->parse_signature($verified[0]); |
| | | } |
| | | catch (Exception $e) { |
| | | return $this->get_error_from_exception($e); |
| | | } |
| | | } |
| | | |
| | | public function import($content, $isfile=false) |
| | | { |
| | | try { |
| | | if ($isfile) |
| | | return $this->gpg->importKeyFile($content); |
| | | else |
| | | return $this->gpg->importKey($content); |
| | | } |
| | | catch (Exception $e) { |
| | | return $this->get_error_from_exception($e); |
| | | } |
| | | } |
| | | |
| | | public function list_keys($pattern='') |
| | | { |
| | | try { |
| | | $keys = $this->gpg->getKeys($pattern); |
| | | $result = array(); |
| | | //print_r($keys); |
| | | foreach ($keys as $idx => $key) { |
| | | $result[] = $this->parse_key($key); |
| | | unset($keys[$idx]); |
| | | } |
| | | //print_r($result); |
| | | return $result; |
| | | } |
| | | catch (Exception $e) { |
| | | return $this->get_error_from_exception($e); |
| | | } |
| | | } |
| | | |
| | | public function get_key($keyid) |
| | | { |
| | | $list = $this->list_keys($keyid); |
| | | |
| | | if (is_array($list)) |
| | | return array_shift($list); |
| | | |
| | | // error |
| | | return $list; |
| | | } |
| | | |
| | | public function gen_key($data) |
| | | { |
| | | } |
| | | |
| | | public function del_key($keyid) |
| | | { |
| | | // $this->get_key($keyid); |
| | | |
| | | |
| | | } |
| | | |
| | | public function del_privkey($keyid) |
| | | { |
| | | try { |
| | | $this->gpg->deletePrivateKey($keyid); |
| | | return true; |
| | | } |
| | | catch (Exception $e) { |
| | | return $this->get_error_from_exception($e); |
| | | } |
| | | } |
| | | |
| | | public function del_pubkey($keyid) |
| | | { |
| | | try { |
| | | $this->gpg->deletePublicKey($keyid); |
| | | return true; |
| | | } |
| | | catch (Exception $e) { |
| | | return $this->get_error_from_exception($e); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * Converts Crypt_GPG exception into Enigma's error object |
| | | * |
| | | * @param mixed Exception object |
| | | * |
| | | * @return enigma_error Error object |
| | | */ |
| | | private function get_error_from_exception($e) |
| | | { |
| | | $data = array(); |
| | | |
| | | if ($e instanceof Crypt_GPG_KeyNotFoundException) { |
| | | $error = enigma_error::E_KEYNOTFOUND; |
| | | $data['id'] = $e->getKeyId(); |
| | | } |
| | | else if ($e instanceof Crypt_GPG_BadPassphraseException) { |
| | | $error = enigma_error::E_BADPASS; |
| | | $data['bad'] = $e->getBadPassphrases(); |
| | | $data['missing'] = $e->getMissingPassphrases(); |
| | | } |
| | | else if ($e instanceof Crypt_GPG_NoDataException) |
| | | $error = enigma_error::E_NODATA; |
| | | else if ($e instanceof Crypt_GPG_DeletePrivateKeyException) |
| | | $error = enigma_error::E_DELKEY; |
| | | else |
| | | $error = enigma_error::E_INTERNAL; |
| | | |
| | | $msg = $e->getMessage(); |
| | | |
| | | return new enigma_error($error, $msg, $data); |
| | | } |
| | | |
| | | /** |
| | | * Converts Crypt_GPG_Signature object into Enigma's signature object |
| | | * |
| | | * @param Crypt_GPG_Signature Signature object |
| | | * |
| | | * @return enigma_signature Signature object |
| | | */ |
| | | private function parse_signature($sig) |
| | | { |
| | | $user = $sig->getUserId(); |
| | | |
| | | $data = new enigma_signature(); |
| | | $data->id = $sig->getId(); |
| | | $data->valid = $sig->isValid(); |
| | | $data->fingerprint = $sig->getKeyFingerprint(); |
| | | $data->created = $sig->getCreationDate(); |
| | | $data->expires = $sig->getExpirationDate(); |
| | | $data->name = $user->getName(); |
| | | $data->comment = $user->getComment(); |
| | | $data->email = $user->getEmail(); |
| | | |
| | | return $data; |
| | | } |
| | | |
| | | /** |
| | | * Converts Crypt_GPG_Key object into Enigma's key object |
| | | * |
| | | * @param Crypt_GPG_Key Key object |
| | | * |
| | | * @return enigma_key Key object |
| | | */ |
| | | private function parse_key($key) |
| | | { |
| | | $ekey = new enigma_key(); |
| | | |
| | | foreach ($key->getUserIds() as $idx => $user) { |
| | | $id = new enigma_userid(); |
| | | $id->name = $user->getName(); |
| | | $id->comment = $user->getComment(); |
| | | $id->email = $user->getEmail(); |
| | | $id->valid = $user->isValid(); |
| | | $id->revoked = $user->isRevoked(); |
| | | |
| | | $ekey->users[$idx] = $id; |
| | | } |
| | | |
| | | $ekey->name = trim($ekey->users[0]->name . ' <' . $ekey->users[0]->email . '>'); |
| | | |
| | | foreach ($key->getSubKeys() as $idx => $subkey) { |
| | | $skey = new enigma_subkey(); |
| | | $skey->id = $subkey->getId(); |
| | | $skey->revoked = $subkey->isRevoked(); |
| | | $skey->created = $subkey->getCreationDate(); |
| | | $skey->expires = $subkey->getExpirationDate(); |
| | | $skey->fingerprint = $subkey->getFingerprint(); |
| | | $skey->has_private = $subkey->hasPrivate(); |
| | | $skey->can_sign = $subkey->canSign(); |
| | | $skey->can_encrypt = $subkey->canEncrypt(); |
| | | |
| | | $ekey->subkeys[$idx] = $skey; |
| | | }; |
| | | |
| | | $ekey->id = $ekey->subkeys[0]->id; |
| | | |
| | | return $ekey; |
| | | } |
| | | } |
New file |
| | |
| | | <?php |
| | | /* |
| | | +-------------------------------------------------------------------------+ |
| | | | Engine of the Enigma Plugin | |
| | | | | |
| | | | This program is free software; you can redistribute it and/or modify | |
| | | | it under the terms of the GNU General Public License version 2 | |
| | | | as published by the Free Software Foundation. | |
| | | | | |
| | | | This program is distributed in the hope that it will be useful, | |
| | | | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| | | | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
| | | | GNU General Public License for more details. | |
| | | | | |
| | | | You should have received a copy of the GNU General Public License along | |
| | | | with this program; if not, write to the Free Software Foundation, Inc., | |
| | | | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. | |
| | | | | |
| | | +-------------------------------------------------------------------------+ |
| | | | Author: Aleksander Machniak <alec@alec.pl> | |
| | | +-------------------------------------------------------------------------+ |
| | | |
| | | */ |
| | | |
| | | /* |
| | | RFC2440: OpenPGP Message Format |
| | | RFC3156: MIME Security with OpenPGP |
| | | RFC3851: S/MIME |
| | | */ |
| | | |
| | | class enigma_engine |
| | | { |
| | | private $rc; |
| | | private $enigma; |
| | | private $pgp_driver; |
| | | private $smime_driver; |
| | | |
| | | public $decryptions = array(); |
| | | public $signatures = array(); |
| | | public $signed_parts = array(); |
| | | |
| | | |
| | | /** |
| | | * Plugin initialization. |
| | | */ |
| | | function __construct($enigma) |
| | | { |
| | | $rcmail = rcmail::get_instance(); |
| | | $this->rc = $rcmail; |
| | | $this->enigma = $enigma; |
| | | } |
| | | |
| | | /** |
| | | * PGP driver initialization. |
| | | */ |
| | | function load_pgp_driver() |
| | | { |
| | | if ($this->pgp_driver) |
| | | return; |
| | | |
| | | $driver = 'enigma_driver_' . $this->rc->config->get('enigma_pgp_driver', 'gnupg'); |
| | | $username = $this->rc->user->get_username(); |
| | | |
| | | // Load driver |
| | | $this->pgp_driver = new $driver($username); |
| | | |
| | | if (!$this->pgp_driver) { |
| | | raise_error(array( |
| | | 'code' => 600, 'type' => 'php', |
| | | 'file' => __FILE__, 'line' => __LINE__, |
| | | 'message' => "Enigma plugin: Unable to load PGP driver: $driver" |
| | | ), true, true); |
| | | } |
| | | |
| | | // Initialise driver |
| | | $result = $this->pgp_driver->init(); |
| | | |
| | | if ($result instanceof enigma_error) { |
| | | raise_error(array( |
| | | 'code' => 600, 'type' => 'php', |
| | | 'file' => __FILE__, 'line' => __LINE__, |
| | | 'message' => "Enigma plugin: ".$result->getMessage() |
| | | ), true, true); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * S/MIME driver initialization. |
| | | */ |
| | | function load_smime_driver() |
| | | { |
| | | if ($this->smime_driver) |
| | | return; |
| | | |
| | | // NOT IMPLEMENTED! |
| | | return; |
| | | |
| | | $driver = 'enigma_driver_' . $this->rc->config->get('enigma_smime_driver', 'phpssl'); |
| | | $username = $this->rc->user->get_username(); |
| | | |
| | | // Load driver |
| | | $this->smime_driver = new $driver($username); |
| | | |
| | | if (!$this->smime_driver) { |
| | | raise_error(array( |
| | | 'code' => 600, 'type' => 'php', |
| | | 'file' => __FILE__, 'line' => __LINE__, |
| | | 'message' => "Enigma plugin: Unable to load S/MIME driver: $driver" |
| | | ), true, true); |
| | | } |
| | | |
| | | // Initialise driver |
| | | $result = $this->smime_driver->init(); |
| | | |
| | | if ($result instanceof enigma_error) { |
| | | raise_error(array( |
| | | 'code' => 600, 'type' => 'php', |
| | | 'file' => __FILE__, 'line' => __LINE__, |
| | | 'message' => "Enigma plugin: ".$result->getMessage() |
| | | ), true, true); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * Handler for plain/text message. |
| | | * |
| | | * @param array Reference to hook's parameters |
| | | */ |
| | | function parse_plain(&$p) |
| | | { |
| | | $part = $p['structure']; |
| | | |
| | | // Get message body from IMAP server |
| | | $this->set_part_body($part, $p['object']->uid); |
| | | |
| | | // @TODO: big message body can be a file resource |
| | | // PGP signed message |
| | | if (preg_match('/^-----BEGIN PGP SIGNED MESSAGE-----/', $part->body)) { |
| | | $this->parse_plain_signed($p); |
| | | } |
| | | // PGP encrypted message |
| | | else if (preg_match('/^-----BEGIN PGP MESSAGE-----/', $part->body)) { |
| | | $this->parse_plain_encrypted($p); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * Handler for multipart/signed message. |
| | | * |
| | | * @param array Reference to hook's parameters |
| | | */ |
| | | function parse_signed(&$p) |
| | | { |
| | | $struct = $p['structure']; |
| | | |
| | | // S/MIME |
| | | if ($struct->parts[1] && $struct->parts[1]->mimetype == 'application/pkcs7-signature') { |
| | | $this->parse_smime_signed($p); |
| | | } |
| | | // PGP/MIME: |
| | | // The multipart/signed body MUST consist of exactly two parts. |
| | | // The first part contains the signed data in MIME canonical format, |
| | | // including a set of appropriate content headers describing the data. |
| | | // The second body MUST contain the PGP digital signature. It MUST be |
| | | // labeled with a content type of "application/pgp-signature". |
| | | else if ($struct->parts[1] && $struct->parts[1]->mimetype == 'application/pgp-signature') { |
| | | $this->parse_pgp_signed($p); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * Handler for multipart/encrypted message. |
| | | * |
| | | * @param array Reference to hook's parameters |
| | | */ |
| | | function parse_encrypted(&$p) |
| | | { |
| | | $struct = $p['structure']; |
| | | |
| | | // S/MIME |
| | | if ($struct->mimetype == 'application/pkcs7-mime') { |
| | | $this->parse_smime_encrypted($p); |
| | | } |
| | | // PGP/MIME: |
| | | // The multipart/encrypted MUST consist of exactly two parts. The first |
| | | // MIME body part must have a content type of "application/pgp-encrypted". |
| | | // This body contains the control information. |
| | | // The second MIME body part MUST contain the actual encrypted data. It |
| | | // must be labeled with a content type of "application/octet-stream". |
| | | else if ($struct->parts[0] && $struct->parts[0]->mimetype == 'application/pgp-encrypted' && |
| | | $struct->parts[1] && $struct->parts[1]->mimetype == 'application/octet-stream' |
| | | ) { |
| | | $this->parse_pgp_encrypted($p); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * Handler for plain signed message. |
| | | * Excludes message and signature bodies and verifies signature. |
| | | * |
| | | * @param array Reference to hook's parameters |
| | | */ |
| | | private function parse_plain_signed(&$p) |
| | | { |
| | | $this->load_pgp_driver(); |
| | | $part = $p['structure']; |
| | | |
| | | // Verify signature |
| | | if ($this->rc->action == 'show' || $this->rc->action == 'preview') { |
| | | $sig = $this->pgp_verify($part->body); |
| | | } |
| | | |
| | | // @TODO: Handle big bodies using (temp) files |
| | | |
| | | // In this way we can use fgets on string as on file handle |
| | | $fh = fopen('php://memory', 'br+'); |
| | | // @TODO: fopen/fwrite errors handling |
| | | if ($fh) { |
| | | fwrite($fh, $part->body); |
| | | rewind($fh); |
| | | } |
| | | $part->body = null; |
| | | |
| | | // Extract body (and signature?) |
| | | while (!feof($fh)) { |
| | | $line = fgets($fh, 1024); |
| | | |
| | | if ($part->body === null) |
| | | $part->body = ''; |
| | | else if (preg_match('/^-----BEGIN PGP SIGNATURE-----/', $line)) |
| | | break; |
| | | else |
| | | $part->body .= $line; |
| | | } |
| | | |
| | | // Remove "Hash" Armor Headers |
| | | $part->body = preg_replace('/^.*\r*\n\r*\n/', '', $part->body); |
| | | // de-Dash-Escape (RFC2440) |
| | | $part->body = preg_replace('/(^|\n)- -/', '\\1-', $part->body); |
| | | |
| | | // Store signature data for display |
| | | if (!empty($sig)) { |
| | | $this->signed_parts[$part->mime_id] = $part->mime_id; |
| | | $this->signatures[$part->mime_id] = $sig; |
| | | } |
| | | |
| | | fclose($fh); |
| | | } |
| | | |
| | | /** |
| | | * Handler for PGP/MIME signed message. |
| | | * Verifies signature. |
| | | * |
| | | * @param array Reference to hook's parameters |
| | | */ |
| | | private function parse_pgp_signed(&$p) |
| | | { |
| | | $this->load_pgp_driver(); |
| | | $struct = $p['structure']; |
| | | |
| | | // Verify signature |
| | | if ($this->rc->action == 'show' || $this->rc->action == 'preview') { |
| | | $msg_part = $struct->parts[0]; |
| | | $sig_part = $struct->parts[1]; |
| | | |
| | | // Get bodies |
| | | $this->set_part_body($msg_part, $p['object']->uid); |
| | | $this->set_part_body($sig_part, $p['object']->uid); |
| | | |
| | | // Verify |
| | | $sig = $this->pgp_verify($msg_part->body, $sig_part->body); |
| | | |
| | | // Store signature data for display |
| | | $this->signatures[$struct->mime_id] = $sig; |
| | | |
| | | // Message can be multipart (assign signature to each subpart) |
| | | if (!empty($msg_part->parts)) { |
| | | foreach ($msg_part->parts as $part) |
| | | $this->signed_parts[$part->mime_id] = $struct->mime_id; |
| | | } |
| | | else |
| | | $this->signed_parts[$msg_part->mime_id] = $struct->mime_id; |
| | | |
| | | // Remove signature file from attachments list |
| | | unset($struct->parts[1]); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * Handler for S/MIME signed message. |
| | | * Verifies signature. |
| | | * |
| | | * @param array Reference to hook's parameters |
| | | */ |
| | | private function parse_smime_signed(&$p) |
| | | { |
| | | $this->load_smime_driver(); |
| | | } |
| | | |
| | | /** |
| | | * Handler for plain encrypted message. |
| | | * |
| | | * @param array Reference to hook's parameters |
| | | */ |
| | | private function parse_plain_encrypted(&$p) |
| | | { |
| | | $this->load_pgp_driver(); |
| | | $part = $p['structure']; |
| | | |
| | | // Get body |
| | | $this->set_part_body($part, $p['object']->uid); |
| | | |
| | | // Decrypt |
| | | $result = $this->pgp_decrypt($part->body); |
| | | |
| | | // Store decryption status |
| | | $this->decryptions[$part->mime_id] = $result; |
| | | |
| | | // Parse decrypted message |
| | | if ($result === true) { |
| | | // @TODO |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * Handler for PGP/MIME encrypted message. |
| | | * |
| | | * @param array Reference to hook's parameters |
| | | */ |
| | | private function parse_pgp_encrypted(&$p) |
| | | { |
| | | $this->load_pgp_driver(); |
| | | $struct = $p['structure']; |
| | | $part = $struct->parts[1]; |
| | | |
| | | // Get body |
| | | $this->set_part_body($part, $p['object']->uid); |
| | | |
| | | // Decrypt |
| | | $result = $this->pgp_decrypt($part->body); |
| | | |
| | | $this->decryptions[$part->mime_id] = $result; |
| | | //print_r($part); |
| | | // Parse decrypted message |
| | | if ($result === true) { |
| | | // @TODO |
| | | } |
| | | else { |
| | | // Make sure decryption status message will be displayed |
| | | $part->type = 'content'; |
| | | $p['object']->parts[] = $part; |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * Handler for S/MIME encrypted message. |
| | | * |
| | | * @param array Reference to hook's parameters |
| | | */ |
| | | private function parse_smime_encrypted(&$p) |
| | | { |
| | | $this->load_smime_driver(); |
| | | } |
| | | |
| | | /** |
| | | * PGP signature verification. |
| | | * |
| | | * @param mixed Message body |
| | | * @param mixed Signature body (for MIME messages) |
| | | * |
| | | * @return mixed enigma_signature or enigma_error |
| | | */ |
| | | private function pgp_verify(&$msg_body, $sig_body=null) |
| | | { |
| | | // @TODO: Handle big bodies using (temp) files |
| | | // @TODO: caching of verification result |
| | | |
| | | $sig = $this->pgp_driver->verify($msg_body, $sig_body); |
| | | |
| | | if (($sig instanceof enigma_error) && $sig->getCode() != enigma_error::E_KEYNOTFOUND) |
| | | raise_error(array( |
| | | 'code' => 600, 'type' => 'php', |
| | | 'file' => __FILE__, 'line' => __LINE__, |
| | | 'message' => "Enigma plugin: " . $error->getMessage() |
| | | ), true, false); |
| | | |
| | | //print_r($sig); |
| | | return $sig; |
| | | } |
| | | |
| | | /** |
| | | * PGP message decryption. |
| | | * |
| | | * @param mixed Message body |
| | | * |
| | | * @return mixed True or enigma_error |
| | | */ |
| | | private function pgp_decrypt(&$msg_body) |
| | | { |
| | | // @TODO: Handle big bodies using (temp) files |
| | | // @TODO: caching of verification result |
| | | |
| | | $result = $this->pgp_driver->decrypt($msg_body, $key, $pass); |
| | | |
| | | //print_r($result); |
| | | |
| | | if ($result instanceof enigma_error) { |
| | | $err_code = $result->getCode(); |
| | | if (!in_array($err_code, array(enigma_error::E_KEYNOTFOUND, enigma_error::E_BADPASS))) |
| | | raise_error(array( |
| | | 'code' => 600, 'type' => 'php', |
| | | 'file' => __FILE__, 'line' => __LINE__, |
| | | 'message' => "Enigma plugin: " . $result->getMessage() |
| | | ), true, false); |
| | | return $result; |
| | | } |
| | | |
| | | // $msg_body = $result; |
| | | return true; |
| | | } |
| | | |
| | | /** |
| | | * PGP keys listing. |
| | | * |
| | | * @param mixed Key ID/Name pattern |
| | | * |
| | | * @return mixed Array of keys or enigma_error |
| | | */ |
| | | function list_keys($pattern='') |
| | | { |
| | | $this->load_pgp_driver(); |
| | | $result = $this->pgp_driver->list_keys($pattern); |
| | | |
| | | if ($result instanceof enigma_error) { |
| | | raise_error(array( |
| | | 'code' => 600, 'type' => 'php', |
| | | 'file' => __FILE__, 'line' => __LINE__, |
| | | 'message' => "Enigma plugin: " . $result->getMessage() |
| | | ), true, false); |
| | | } |
| | | |
| | | return $result; |
| | | } |
| | | |
| | | /** |
| | | * PGP key details. |
| | | * |
| | | * @param mixed Key ID |
| | | * |
| | | * @return mixed enigma_key or enigma_error |
| | | */ |
| | | function get_key($keyid) |
| | | { |
| | | $this->load_pgp_driver(); |
| | | $result = $this->pgp_driver->get_key($keyid); |
| | | |
| | | if ($result instanceof enigma_error) { |
| | | raise_error(array( |
| | | 'code' => 600, 'type' => 'php', |
| | | 'file' => __FILE__, 'line' => __LINE__, |
| | | 'message' => "Enigma plugin: " . $result->getMessage() |
| | | ), true, false); |
| | | } |
| | | |
| | | return $result; |
| | | } |
| | | |
| | | /** |
| | | * PGP keys/certs importing. |
| | | * |
| | | * @param mixed Import file name or content |
| | | * @param boolean True if first argument is a filename |
| | | * |
| | | * @return mixed Import status data array or enigma_error |
| | | */ |
| | | function import_key($content, $isfile=false) |
| | | { |
| | | $this->load_pgp_driver(); |
| | | $result = $this->pgp_driver->import($content, $isfile); |
| | | |
| | | if ($result instanceof enigma_error) { |
| | | raise_error(array( |
| | | 'code' => 600, 'type' => 'php', |
| | | 'file' => __FILE__, 'line' => __LINE__, |
| | | 'message' => "Enigma plugin: " . $result->getMessage() |
| | | ), true, false); |
| | | } |
| | | else { |
| | | $result['imported'] = $result['public_imported'] + $result['private_imported']; |
| | | $result['unchanged'] = $result['public_unchanged'] + $result['private_unchanged']; |
| | | } |
| | | |
| | | return $result; |
| | | } |
| | | |
| | | /** |
| | | * Handler for keys/certs import request action |
| | | */ |
| | | function import_file() |
| | | { |
| | | $uid = get_input_value('_uid', RCUBE_INPUT_POST); |
| | | $mbox = get_input_value('_mbox', RCUBE_INPUT_POST); |
| | | $mime_id = get_input_value('_part', RCUBE_INPUT_POST); |
| | | |
| | | if ($uid && $mime_id) { |
| | | $part = $this->rc->storage->get_message_part($uid, $mime_id); |
| | | } |
| | | |
| | | if ($part && is_array($result = $this->import_key($part))) { |
| | | $this->rc->output->show_message('enigma.keysimportsuccess', 'confirmation', |
| | | array('new' => $result['imported'], 'old' => $result['unchanged'])); |
| | | } |
| | | else |
| | | $this->rc->output->show_message('enigma.keysimportfailed', 'error'); |
| | | |
| | | $this->rc->output->send(); |
| | | } |
| | | |
| | | /** |
| | | * Checks if specified message part contains body data. |
| | | * If body is not set it will be fetched from IMAP server. |
| | | * |
| | | * @param rcube_message_part Message part object |
| | | * @param integer Message UID |
| | | */ |
| | | private function set_part_body($part, $uid) |
| | | { |
| | | // @TODO: Create such function in core |
| | | // @TODO: Handle big bodies using file handles |
| | | if (!isset($part->body)) { |
| | | $part->body = $this->rc->storage->get_message_part( |
| | | $uid, $part->mime_id, $part); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * Adds CSS style file to the page header. |
| | | */ |
| | | private function add_css() |
| | | { |
| | | $skin = $this->rc->config->get('skin'); |
| | | if (!file_exists($this->home . "/skins/$skin/enigma.css")) |
| | | $skin = 'default'; |
| | | |
| | | $this->include_stylesheet("skins/$skin/enigma.css"); |
| | | } |
| | | } |
New file |
| | |
| | | <?php |
| | | /* |
| | | +-------------------------------------------------------------------------+ |
| | | | Error class for the Enigma Plugin | |
| | | | | |
| | | | This program is free software; you can redistribute it and/or modify | |
| | | | it under the terms of the GNU General Public License version 2 | |
| | | | as published by the Free Software Foundation. | |
| | | | | |
| | | | This program is distributed in the hope that it will be useful, | |
| | | | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| | | | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
| | | | GNU General Public License for more details. | |
| | | | | |
| | | | You should have received a copy of the GNU General Public License along | |
| | | | with this program; if not, write to the Free Software Foundation, Inc., | |
| | | | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. | |
| | | | | |
| | | +-------------------------------------------------------------------------+ |
| | | | Author: Aleksander Machniak <alec@alec.pl> | |
| | | +-------------------------------------------------------------------------+ |
| | | */ |
| | | |
| | | class enigma_error |
| | | { |
| | | private $code; |
| | | private $message; |
| | | private $data = array(); |
| | | |
| | | // error codes |
| | | const E_OK = 0; |
| | | const E_INTERNAL = 1; |
| | | const E_NODATA = 2; |
| | | const E_KEYNOTFOUND = 3; |
| | | const E_DELKEY = 4; |
| | | const E_BADPASS = 5; |
| | | |
| | | function __construct($code = null, $message = '', $data = array()) |
| | | { |
| | | $this->code = $code; |
| | | $this->message = $message; |
| | | $this->data = $data; |
| | | } |
| | | |
| | | function getCode() |
| | | { |
| | | return $this->code; |
| | | } |
| | | |
| | | function getMessage() |
| | | { |
| | | return $this->message; |
| | | } |
| | | |
| | | function getData($name) |
| | | { |
| | | if ($name) |
| | | return $this->data[$name]; |
| | | else |
| | | return $this->data; |
| | | } |
| | | } |
New file |
| | |
| | | <?php |
| | | /* |
| | | +-------------------------------------------------------------------------+ |
| | | | Key class for the Enigma Plugin | |
| | | | | |
| | | | This program is free software; you can redistribute it and/or modify | |
| | | | it under the terms of the GNU General Public License version 2 | |
| | | | as published by the Free Software Foundation. | |
| | | | | |
| | | | This program is distributed in the hope that it will be useful, | |
| | | | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| | | | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
| | | | GNU General Public License for more details. | |
| | | | | |
| | | | You should have received a copy of the GNU General Public License along | |
| | | | with this program; if not, write to the Free Software Foundation, Inc., | |
| | | | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. | |
| | | | | |
| | | +-------------------------------------------------------------------------+ |
| | | | Author: Aleksander Machniak <alec@alec.pl> | |
| | | +-------------------------------------------------------------------------+ |
| | | */ |
| | | |
| | | class enigma_key |
| | | { |
| | | public $id; |
| | | public $name; |
| | | public $users = array(); |
| | | public $subkeys = array(); |
| | | |
| | | const TYPE_UNKNOWN = 0; |
| | | const TYPE_KEYPAIR = 1; |
| | | const TYPE_PUBLIC = 2; |
| | | |
| | | /** |
| | | * Keys list sorting callback for usort() |
| | | */ |
| | | static function cmp($a, $b) |
| | | { |
| | | return strcmp($a->name, $b->name); |
| | | } |
| | | |
| | | /** |
| | | * Returns key type |
| | | */ |
| | | function get_type() |
| | | { |
| | | if ($this->subkeys[0]->has_private) |
| | | return enigma_key::TYPE_KEYPAIR; |
| | | else if (!empty($this->subkeys[0])) |
| | | return enigma_key::TYPE_PUBLIC; |
| | | |
| | | return enigma_key::TYPE_UNKNOWN; |
| | | } |
| | | |
| | | /** |
| | | * Returns true if all user IDs are revoked |
| | | */ |
| | | function is_revoked() |
| | | { |
| | | foreach ($this->subkeys as $subkey) |
| | | if (!$subkey->revoked) |
| | | return false; |
| | | |
| | | return true; |
| | | } |
| | | |
| | | /** |
| | | * Returns true if any user ID is valid |
| | | */ |
| | | function is_valid() |
| | | { |
| | | foreach ($this->users as $user) |
| | | if ($user->valid) |
| | | return true; |
| | | |
| | | return false; |
| | | } |
| | | |
| | | /** |
| | | * Returns true if any of subkeys is not expired |
| | | */ |
| | | function is_expired() |
| | | { |
| | | $now = time(); |
| | | |
| | | foreach ($this->subkeys as $subkey) |
| | | if (!$subkey->expires || $subkey->expires > $now) |
| | | return true; |
| | | |
| | | return false; |
| | | } |
| | | |
| | | /** |
| | | * Converts long ID or Fingerprint to short ID |
| | | * Crypt_GPG uses internal, but e.g. Thunderbird's Enigmail displays short ID |
| | | * |
| | | * @param string Key ID or fingerprint |
| | | * @return string Key short ID |
| | | */ |
| | | static function format_id($id) |
| | | { |
| | | // E.g. 04622F2089E037A5 => 89E037A5 |
| | | |
| | | return substr($id, -8); |
| | | } |
| | | |
| | | /** |
| | | * Formats fingerprint string |
| | | * |
| | | * @param string Key fingerprint |
| | | * |
| | | * @return string Formatted fingerprint (with spaces) |
| | | */ |
| | | static function format_fingerprint($fingerprint) |
| | | { |
| | | if (!$fingerprint) |
| | | return ''; |
| | | |
| | | $result = ''; |
| | | for ($i=0; $i<40; $i++) { |
| | | if ($i % 4 == 0) |
| | | $result .= ' '; |
| | | $result .= $fingerprint[$i]; |
| | | } |
| | | return $result; |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | <?php |
| | | /* |
| | | +-------------------------------------------------------------------------+ |
| | | | Signature class for the Enigma Plugin | |
| | | | | |
| | | | This program is free software; you can redistribute it and/or modify | |
| | | | it under the terms of the GNU General Public License version 2 | |
| | | | as published by the Free Software Foundation. | |
| | | | | |
| | | | This program is distributed in the hope that it will be useful, | |
| | | | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| | | | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
| | | | GNU General Public License for more details. | |
| | | | | |
| | | | You should have received a copy of the GNU General Public License along | |
| | | | with this program; if not, write to the Free Software Foundation, Inc., | |
| | | | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. | |
| | | | | |
| | | +-------------------------------------------------------------------------+ |
| | | | Author: Aleksander Machniak <alec@alec.pl> | |
| | | +-------------------------------------------------------------------------+ |
| | | */ |
| | | |
| | | class enigma_signature |
| | | { |
| | | public $id; |
| | | public $valid; |
| | | public $fingerprint; |
| | | public $created; |
| | | public $expires; |
| | | public $name; |
| | | public $comment; |
| | | public $email; |
| | | } |
New file |
| | |
| | | <?php |
| | | /* |
| | | +-------------------------------------------------------------------------+ |
| | | | SubKey class for the Enigma Plugin | |
| | | | | |
| | | | This program is free software; you can redistribute it and/or modify | |
| | | | it under the terms of the GNU General Public License version 2 | |
| | | | as published by the Free Software Foundation. | |
| | | | | |
| | | | This program is distributed in the hope that it will be useful, | |
| | | | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| | | | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
| | | | GNU General Public License for more details. | |
| | | | | |
| | | | You should have received a copy of the GNU General Public License along | |
| | | | with this program; if not, write to the Free Software Foundation, Inc., | |
| | | | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. | |
| | | | | |
| | | +-------------------------------------------------------------------------+ |
| | | | Author: Aleksander Machniak <alec@alec.pl> | |
| | | +-------------------------------------------------------------------------+ |
| | | */ |
| | | |
| | | class enigma_subkey |
| | | { |
| | | public $id; |
| | | public $fingerprint; |
| | | public $expires; |
| | | public $created; |
| | | public $revoked; |
| | | public $has_private; |
| | | public $can_sign; |
| | | public $can_encrypt; |
| | | |
| | | /** |
| | | * Converts internal ID to short ID |
| | | * Crypt_GPG uses internal, but e.g. Thunderbird's Enigmail displays short ID |
| | | * |
| | | * @return string Key ID |
| | | */ |
| | | function get_short_id() |
| | | { |
| | | // E.g. 04622F2089E037A5 => 89E037A5 |
| | | return enigma_key::format_id($this->id); |
| | | } |
| | | |
| | | /** |
| | | * Getter for formatted fingerprint |
| | | * |
| | | * @return string Formatted fingerprint |
| | | */ |
| | | function get_fingerprint() |
| | | { |
| | | return enigma_key::format_fingerprint($this->fingerprint); |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | <?php |
| | | /* |
| | | +-------------------------------------------------------------------------+ |
| | | | User Interface for the Enigma Plugin | |
| | | | | |
| | | | This program is free software; you can redistribute it and/or modify | |
| | | | it under the terms of the GNU General Public License version 2 | |
| | | | as published by the Free Software Foundation. | |
| | | | | |
| | | | This program is distributed in the hope that it will be useful, | |
| | | | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| | | | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
| | | | GNU General Public License for more details. | |
| | | | | |
| | | | You should have received a copy of the GNU General Public License along | |
| | | | with this program; if not, write to the Free Software Foundation, Inc., | |
| | | | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. | |
| | | | | |
| | | +-------------------------------------------------------------------------+ |
| | | | Author: Aleksander Machniak <alec@alec.pl> | |
| | | +-------------------------------------------------------------------------+ |
| | | */ |
| | | |
| | | class enigma_ui |
| | | { |
| | | private $rc; |
| | | private $enigma; |
| | | private $home; |
| | | private $css_added; |
| | | private $data; |
| | | |
| | | |
| | | function __construct($enigma_plugin, $home='') |
| | | { |
| | | $this->enigma = $enigma_plugin; |
| | | $this->rc = $enigma_plugin->rc; |
| | | // we cannot use $enigma_plugin->home here |
| | | $this->home = $home; |
| | | } |
| | | |
| | | /** |
| | | * UI initialization and requests handlers. |
| | | * |
| | | * @param string Preferences section |
| | | */ |
| | | function init($section='') |
| | | { |
| | | $this->enigma->include_script('enigma.js'); |
| | | |
| | | // Enigma actions |
| | | if ($this->rc->action == 'plugin.enigma') { |
| | | $action = get_input_value('_a', RCUBE_INPUT_GPC); |
| | | |
| | | switch ($action) { |
| | | case 'keyedit': |
| | | $this->key_edit(); |
| | | break; |
| | | case 'keyimport': |
| | | $this->key_import(); |
| | | break; |
| | | case 'keysearch': |
| | | case 'keylist': |
| | | $this->key_list(); |
| | | break; |
| | | case 'keyinfo': |
| | | default: |
| | | $this->key_info(); |
| | | } |
| | | } |
| | | // Message composing UI |
| | | else if ($this->rc->action == 'compose') { |
| | | $this->compose_ui(); |
| | | } |
| | | // Preferences UI |
| | | else { // if ($this->rc->action == 'edit-prefs') { |
| | | if ($section == 'enigmacerts') { |
| | | $this->rc->output->add_handlers(array( |
| | | 'keyslist' => array($this, 'tpl_certs_list'), |
| | | 'keyframe' => array($this, 'tpl_cert_frame'), |
| | | 'countdisplay' => array($this, 'tpl_certs_rowcount'), |
| | | 'searchform' => array($this->rc->output, 'search_form'), |
| | | )); |
| | | $this->rc->output->set_pagetitle($this->enigma->gettext('enigmacerts')); |
| | | $this->rc->output->send('enigma.certs'); |
| | | } |
| | | else { |
| | | $this->rc->output->add_handlers(array( |
| | | 'keyslist' => array($this, 'tpl_keys_list'), |
| | | 'keyframe' => array($this, 'tpl_key_frame'), |
| | | 'countdisplay' => array($this, 'tpl_keys_rowcount'), |
| | | 'searchform' => array($this->rc->output, 'search_form'), |
| | | )); |
| | | $this->rc->output->set_pagetitle($this->enigma->gettext('enigmakeys')); |
| | | $this->rc->output->send('enigma.keys'); |
| | | } |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * Adds CSS style file to the page header. |
| | | */ |
| | | function add_css() |
| | | { |
| | | if ($this->css_loaded) |
| | | return; |
| | | |
| | | $skin = $this->rc->config->get('skin'); |
| | | if (!file_exists($this->home . "/skins/$skin/enigma.css")) |
| | | $skin = 'default'; |
| | | |
| | | $this->enigma->include_stylesheet("skins/$skin/enigma.css"); |
| | | $this->css_added = true; |
| | | } |
| | | |
| | | /** |
| | | * Template object for key info/edit frame. |
| | | * |
| | | * @param array Object attributes |
| | | * |
| | | * @return string HTML output |
| | | */ |
| | | function tpl_key_frame($attrib) |
| | | { |
| | | if (!$attrib['id']) { |
| | | $attrib['id'] = 'rcmkeysframe'; |
| | | } |
| | | |
| | | $attrib['name'] = $attrib['id']; |
| | | |
| | | $this->rc->output->set_env('contentframe', $attrib['name']); |
| | | $this->rc->output->set_env('blankpage', $attrib['src'] ? |
| | | $this->rc->output->abs_url($attrib['src']) : 'program/blank.gif'); |
| | | |
| | | return html::tag('iframe', $attrib); |
| | | } |
| | | |
| | | /** |
| | | * Template object for list of keys. |
| | | * |
| | | * @param array Object attributes |
| | | * |
| | | * @return string HTML content |
| | | */ |
| | | function tpl_keys_list($attrib) |
| | | { |
| | | // add id to message list table if not specified |
| | | if (!strlen($attrib['id'])) { |
| | | $attrib['id'] = 'rcmenigmakeyslist'; |
| | | } |
| | | |
| | | // define list of cols to be displayed |
| | | $a_show_cols = array('name'); |
| | | |
| | | // create XHTML table |
| | | $out = rcube_table_output($attrib, array(), $a_show_cols, 'id'); |
| | | |
| | | // set client env |
| | | $this->rc->output->add_gui_object('keyslist', $attrib['id']); |
| | | $this->rc->output->include_script('list.js'); |
| | | |
| | | // add some labels to client |
| | | $this->rc->output->add_label('enigma.keyconfirmdelete'); |
| | | |
| | | return $out; |
| | | } |
| | | |
| | | /** |
| | | * Key listing (and searching) request handler |
| | | */ |
| | | private function key_list() |
| | | { |
| | | $this->enigma->load_engine(); |
| | | |
| | | $pagesize = $this->rc->config->get('pagesize', 100); |
| | | $page = max(intval(get_input_value('_p', RCUBE_INPUT_GPC)), 1); |
| | | $search = get_input_value('_q', RCUBE_INPUT_GPC); |
| | | |
| | | // define list of cols to be displayed |
| | | $a_show_cols = array('name'); |
| | | $result = array(); |
| | | |
| | | // Get the list |
| | | $list = $this->enigma->engine->list_keys($search); |
| | | |
| | | if ($list && ($list instanceof enigma_error)) |
| | | $this->rc->output->show_message('enigma.keylisterror', 'error'); |
| | | else if (empty($list)) |
| | | $this->rc->output->show_message('enigma.nokeysfound', 'notice'); |
| | | else { |
| | | if (is_array($list)) { |
| | | // Save the size |
| | | $listsize = count($list); |
| | | |
| | | // Sort the list by key (user) name |
| | | usort($list, array('enigma_key', 'cmp')); |
| | | |
| | | // Slice current page |
| | | $list = array_slice($list, ($page - 1) * $pagesize, $pagesize); |
| | | |
| | | $size = count($list); |
| | | |
| | | // Add rows |
| | | foreach($list as $idx => $key) { |
| | | $this->rc->output->command('enigma_add_list_row', |
| | | array('name' => Q($key->name), 'id' => $key->id)); |
| | | } |
| | | } |
| | | } |
| | | |
| | | $this->rc->output->set_env('search_request', $search); |
| | | $this->rc->output->set_env('pagecount', ceil($listsize/$pagesize)); |
| | | $this->rc->output->set_env('current_page', $page); |
| | | $this->rc->output->command('set_rowcount', |
| | | $this->get_rowcount_text($listsize, $size, $page)); |
| | | |
| | | $this->rc->output->send(); |
| | | } |
| | | |
| | | /** |
| | | * Template object for list records counter. |
| | | * |
| | | * @param array Object attributes |
| | | * |
| | | * @return string HTML output |
| | | */ |
| | | function tpl_keys_rowcount($attrib) |
| | | { |
| | | if (!$attrib['id']) |
| | | $attrib['id'] = 'rcmcountdisplay'; |
| | | |
| | | $this->rc->output->add_gui_object('countdisplay', $attrib['id']); |
| | | |
| | | return html::span($attrib, $this->get_rowcount_text()); |
| | | } |
| | | |
| | | /** |
| | | * Returns text representation of list records counter |
| | | */ |
| | | private function get_rowcount_text($all=0, $curr_count=0, $page=1) |
| | | { |
| | | if (!$curr_count) |
| | | $out = $this->enigma->gettext('nokeysfound'); |
| | | else { |
| | | $pagesize = $this->rc->config->get('pagesize', 100); |
| | | $first = ($page - 1) * $pagesize; |
| | | |
| | | $out = $this->enigma->gettext(array( |
| | | 'name' => 'keysfromto', |
| | | 'vars' => array( |
| | | 'from' => $first + 1, |
| | | 'to' => $first + $curr_count, |
| | | 'count' => $all) |
| | | )); |
| | | } |
| | | |
| | | return $out; |
| | | } |
| | | |
| | | /** |
| | | * Key information page handler |
| | | */ |
| | | private function key_info() |
| | | { |
| | | $id = get_input_value('_id', RCUBE_INPUT_GET); |
| | | |
| | | $this->enigma->load_engine(); |
| | | $res = $this->enigma->engine->get_key($id); |
| | | |
| | | if ($res instanceof enigma_key) |
| | | $this->data = $res; |
| | | else { // error |
| | | $this->rc->output->show_message('enigma.keyopenerror', 'error'); |
| | | $this->rc->output->command('parent.enigma_loadframe'); |
| | | $this->rc->output->send('iframe'); |
| | | } |
| | | |
| | | $this->rc->output->add_handlers(array( |
| | | 'keyname' => array($this, 'tpl_key_name'), |
| | | 'keydata' => array($this, 'tpl_key_data'), |
| | | )); |
| | | |
| | | $this->rc->output->set_pagetitle($this->enigma->gettext('keyinfo')); |
| | | $this->rc->output->send('enigma.keyinfo'); |
| | | } |
| | | |
| | | /** |
| | | * Template object for key name |
| | | */ |
| | | function tpl_key_name($attrib) |
| | | { |
| | | return Q($this->data->name); |
| | | } |
| | | |
| | | /** |
| | | * Template object for key information page content |
| | | */ |
| | | function tpl_key_data($attrib) |
| | | { |
| | | $out = ''; |
| | | $table = new html_table(array('cols' => 2)); |
| | | |
| | | // Key user ID |
| | | $table->add('title', $this->enigma->gettext('keyuserid')); |
| | | $table->add(null, Q($this->data->name)); |
| | | // Key ID |
| | | $table->add('title', $this->enigma->gettext('keyid')); |
| | | $table->add(null, $this->data->subkeys[0]->get_short_id()); |
| | | // Key type |
| | | $keytype = $this->data->get_type(); |
| | | if ($keytype == enigma_key::TYPE_KEYPAIR) |
| | | $type = $this->enigma->gettext('typekeypair'); |
| | | else if ($keytype == enigma_key::TYPE_PUBLIC) |
| | | $type = $this->enigma->gettext('typepublickey'); |
| | | $table->add('title', $this->enigma->gettext('keytype')); |
| | | $table->add(null, $type); |
| | | // Key fingerprint |
| | | $table->add('title', $this->enigma->gettext('fingerprint')); |
| | | $table->add(null, $this->data->subkeys[0]->get_fingerprint()); |
| | | |
| | | $out .= html::tag('fieldset', null, |
| | | html::tag('legend', null, |
| | | $this->enigma->gettext('basicinfo')) . $table->show($attrib)); |
| | | |
| | | // Subkeys |
| | | $table = new html_table(array('cols' => 6)); |
| | | // Columns: Type, ID, Algorithm, Size, Created, Expires |
| | | |
| | | $out .= html::tag('fieldset', null, |
| | | html::tag('legend', null, |
| | | $this->enigma->gettext('subkeys')) . $table->show($attrib)); |
| | | |
| | | // Additional user IDs |
| | | $table = new html_table(array('cols' => 2)); |
| | | // Columns: User ID, Validity |
| | | |
| | | $out .= html::tag('fieldset', null, |
| | | html::tag('legend', null, |
| | | $this->enigma->gettext('userids')) . $table->show($attrib)); |
| | | |
| | | return $out; |
| | | } |
| | | |
| | | /** |
| | | * Key import page handler |
| | | */ |
| | | private function key_import() |
| | | { |
| | | // Import process |
| | | if ($_FILES['_file']['tmp_name'] && is_uploaded_file($_FILES['_file']['tmp_name'])) { |
| | | $this->enigma->load_engine(); |
| | | $result = $this->enigma->engine->import_key($_FILES['_file']['tmp_name'], true); |
| | | |
| | | if (is_array($result)) { |
| | | // reload list if any keys has been added |
| | | if ($result['imported']) { |
| | | $this->rc->output->command('parent.enigma_list', 1); |
| | | } |
| | | else |
| | | $this->rc->output->command('parent.enigma_loadframe'); |
| | | |
| | | $this->rc->output->show_message('enigma.keysimportsuccess', 'confirmation', |
| | | array('new' => $result['imported'], 'old' => $result['unchanged'])); |
| | | |
| | | $this->rc->output->send('iframe'); |
| | | } |
| | | else |
| | | $this->rc->output->show_message('enigma.keysimportfailed', 'error'); |
| | | } |
| | | else if ($err = $_FILES['_file']['error']) { |
| | | if ($err == UPLOAD_ERR_INI_SIZE || $err == UPLOAD_ERR_FORM_SIZE) { |
| | | $this->rc->output->show_message('filesizeerror', 'error', |
| | | array('size' => show_bytes(parse_bytes(ini_get('upload_max_filesize'))))); |
| | | } else { |
| | | $this->rc->output->show_message('fileuploaderror', 'error'); |
| | | } |
| | | } |
| | | |
| | | $this->rc->output->add_handlers(array( |
| | | 'importform' => array($this, 'tpl_key_import_form'), |
| | | )); |
| | | |
| | | $this->rc->output->set_pagetitle($this->enigma->gettext('keyimport')); |
| | | $this->rc->output->send('enigma.keyimport'); |
| | | } |
| | | |
| | | /** |
| | | * Template object for key import (upload) form |
| | | */ |
| | | function tpl_key_import_form($attrib) |
| | | { |
| | | $attrib += array('id' => 'rcmKeyImportForm'); |
| | | |
| | | $upload = new html_inputfield(array('type' => 'file', 'name' => '_file', |
| | | 'id' => 'rcmimportfile', 'size' => 30)); |
| | | |
| | | $form = html::p(null, |
| | | Q($this->enigma->gettext('keyimporttext'), 'show') |
| | | . html::br() . html::br() . $upload->show() |
| | | ); |
| | | |
| | | $this->rc->output->add_label('selectimportfile', 'importwait'); |
| | | $this->rc->output->add_gui_object('importform', $attrib['id']); |
| | | |
| | | $out = $this->rc->output->form_tag(array( |
| | | 'action' => $this->rc->url(array('action' => 'plugin.enigma', 'a' => 'keyimport')), |
| | | 'method' => 'post', |
| | | 'enctype' => 'multipart/form-data') + $attrib, |
| | | $form); |
| | | |
| | | return $out; |
| | | } |
| | | |
| | | private function compose_ui() |
| | | { |
| | | // Options menu button |
| | | // @TODO: make this work with non-default skins |
| | | $this->enigma->add_button(array( |
| | | 'name' => 'enigmamenu', |
| | | 'imagepas' => 'skins/default/enigma.png', |
| | | 'imageact' => 'skins/default/enigma.png', |
| | | 'onclick' => "rcmail_ui.show_popup('enigmamenu', true); return false", |
| | | 'title' => 'securityoptions', |
| | | 'domain' => 'enigma', |
| | | ), 'toolbar'); |
| | | |
| | | // Options menu contents |
| | | $this->enigma->add_hook('render_page', array($this, 'compose_menu')); |
| | | } |
| | | |
| | | function compose_menu($p) |
| | | { |
| | | $menu = new html_table(array('cols' => 2)); |
| | | $chbox = new html_checkbox(array('value' => 1)); |
| | | |
| | | $menu->add(null, html::label(array('for' => 'enigmadefaultopt'), |
| | | Q($this->enigma->gettext('identdefault')))); |
| | | $menu->add(null, $chbox->show(1, array('name' => '_enigma_default', 'id' => 'enigmadefaultopt'))); |
| | | |
| | | $menu->add(null, html::label(array('for' => 'enigmasignopt'), |
| | | Q($this->enigma->gettext('signmsg')))); |
| | | $menu->add(null, $chbox->show(1, array('name' => '_enigma_sign', 'id' => 'enigmasignopt'))); |
| | | |
| | | $menu->add(null, html::label(array('for' => 'enigmacryptopt'), |
| | | Q($this->enigma->gettext('encryptmsg')))); |
| | | $menu->add(null, $chbox->show(1, array('name' => '_enigma_crypt', 'id' => 'enigmacryptopt'))); |
| | | |
| | | $menu = html::div(array('id' => 'enigmamenu', 'class' => 'popupmenu'), |
| | | $menu->show()); |
| | | |
| | | $p['content'] = preg_replace('/(<form name="form"[^>]+>)/i', '\\1'."\n$menu", $p['content']); |
| | | |
| | | return $p; |
| | | |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | <?php |
| | | /* |
| | | +-------------------------------------------------------------------------+ |
| | | | User ID class for the Enigma Plugin | |
| | | | | |
| | | | This program is free software; you can redistribute it and/or modify | |
| | | | it under the terms of the GNU General Public License version 2 | |
| | | | as published by the Free Software Foundation. | |
| | | | | |
| | | | This program is distributed in the hope that it will be useful, | |
| | | | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| | | | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
| | | | GNU General Public License for more details. | |
| | | | | |
| | | | You should have received a copy of the GNU General Public License along | |
| | | | with this program; if not, write to the Free Software Foundation, Inc., | |
| | | | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. | |
| | | | | |
| | | +-------------------------------------------------------------------------+ |
| | | | Author: Aleksander Machniak <alec@alec.pl> | |
| | | +-------------------------------------------------------------------------+ |
| | | */ |
| | | |
| | | class enigma_userid |
| | | { |
| | | public $revoked; |
| | | public $valid; |
| | | public $name; |
| | | public $comment; |
| | | public $email; |
| | | } |
New file |
| | |
| | | <?php |
| | | |
| | | $labels = array(); |
| | | $labels['enigmasettings'] = 'Enigma: Settings'; |
| | | $labels['enigmacerts'] = 'Enigma: Certificates (S/MIME)'; |
| | | $labels['enigmakeys'] = 'Enigma: Keys (PGP)'; |
| | | $labels['keysfromto'] = 'Keys $from to $to of $count'; |
| | | $labels['keyname'] = 'Name'; |
| | | $labels['keyid'] = 'Key ID'; |
| | | $labels['keyuserid'] = 'User ID'; |
| | | $labels['keytype'] = 'Key type'; |
| | | $labels['fingerprint'] = 'Fingerprint'; |
| | | $labels['subkeys'] = 'Subkeys'; |
| | | $labels['basicinfo'] = 'Basic Information'; |
| | | $labels['userids'] = 'Additional User IDs'; |
| | | $labels['typepublickey'] = 'public key'; |
| | | $labels['typekeypair'] = 'key pair'; |
| | | $labels['keyattfound'] = 'This message contains attached PGP key(s).'; |
| | | $labels['keyattimport'] = 'Import key(s)'; |
| | | |
| | | $labels['createkeys'] = 'Create a new key pair'; |
| | | $labels['importkeys'] = 'Import key(s)'; |
| | | $labels['exportkeys'] = 'Export key(s)'; |
| | | $labels['deletekeys'] = 'Delete key(s)'; |
| | | $labels['keyactions'] = 'Key actions...'; |
| | | $labels['keydisable'] = 'Disable key'; |
| | | $labels['keyrevoke'] = 'Revoke key'; |
| | | $labels['keysend'] = 'Send public key in a message'; |
| | | $labels['keychpass'] = 'Change password'; |
| | | |
| | | $labels['securityoptions'] = 'Message security options...'; |
| | | $labels['identdefault'] = 'Use settings of selected identity'; |
| | | $labels['encryptmsg'] = 'Encrypt this message'; |
| | | $labels['signmsg'] = 'Digitally sign this message'; |
| | | |
| | | $messages = array(); |
| | | $messages['sigvalid'] = 'Verified signature from $sender.'; |
| | | $messages['siginvalid'] = 'Invalid signature from $sender.'; |
| | | $messages['signokey'] = 'Unverified signature. Public key not found. Key ID: $keyid.'; |
| | | $messages['sigerror'] = 'Unverified signature. Internal error.'; |
| | | $messages['decryptok'] = 'Message decrypted.'; |
| | | $messages['decrypterror'] = 'Decryption failed.'; |
| | | $messages['decryptnokey'] = 'Decryption failed. Private key not found. Key ID: $keyid.'; |
| | | $messages['decryptbadpass'] = 'Decryption failed. Bad password.'; |
| | | $messages['nokeysfound'] = 'No keys found'; |
| | | $messages['keyopenerror'] = 'Unable to get key information! Internal error.'; |
| | | $messages['keylisterror'] = 'Unable to list keys! Internal error.'; |
| | | $messages['keysimportfailed'] = 'Unable to import key(s)! Internal error.'; |
| | | $messages['keysimportsuccess'] = 'Key(s) imported successfully. Imported: $new, unchanged: $old.'; |
| | | $messages['keyconfirmdelete'] = 'Are you sure, you want to delete selected key(s)?'; |
| | | $messages['keyimporttext'] = 'You can import private and public key(s) or revocation signatures in ASCII-Armor format.'; |
| | | |
| | | ?> |
New file |
| | |
| | | <?php |
| | | |
| | | // EN-Revision: 4203 |
| | | |
| | | $labels = array(); |
| | | $labels['enigmasettings'] = 'Enigma: 設定'; |
| | | $labels['enigmacerts'] = 'Enigma: 証明書 (S/MIME)'; |
| | | $labels['enigmakeys'] = 'Enigma: 鍵 (PGP)'; |
| | | $labels['keysfromto'] = '鍵の一覧 $from ~ $to (合計: $count )'; |
| | | $labels['keyname'] = '名前'; |
| | | $labels['keyid'] = '鍵 ID'; |
| | | $labels['keyuserid'] = 'ユーザー ID'; |
| | | $labels['keytype'] = '鍵の種類'; |
| | | $labels['fingerprint'] = '指紋'; |
| | | $labels['subkeys'] = 'Subkeys'; |
| | | $labels['basicinfo'] = '基本情報'; |
| | | $labels['userids'] = '追加のユーザー ID'; |
| | | $labels['typepublickey'] = '公開鍵'; |
| | | $labels['typekeypair'] = '鍵のペア'; |
| | | $labels['keyattfound'] = 'このメールは PGP 鍵の添付があります。'; |
| | | $labels['keyattimport'] = '鍵のインポート'; |
| | | |
| | | $labels['createkeys'] = '新しい鍵のペアを作成する'; |
| | | $labels['importkeys'] = '鍵のインポート'; |
| | | $labels['exportkeys'] = '鍵のエクスポート'; |
| | | $labels['deletekeys'] = '鍵の削除'; |
| | | $labels['keyactions'] = '鍵の操作...'; |
| | | $labels['keydisable'] = '鍵を無効にする'; |
| | | $labels['keyrevoke'] = '鍵を取り消す'; |
| | | $labels['keysend'] = 'メッセージに公開鍵を含んで送信する'; |
| | | $labels['keychpass'] = 'パスワードの変更'; |
| | | |
| | | $labels['securityoptions'] = 'メールのセキュリティ オプション...'; |
| | | $labels['identdefault'] = '選択した識別子の設定を使う'; |
| | | $labels['encryptmsg'] = 'このメールの暗号化'; |
| | | $labels['signmsg'] = 'このメールのデジタル署名'; |
| | | |
| | | $messages = array(); |
| | | $messages['sigvalid'] = '$sender からの署名を検証しました。'; |
| | | $messages['siginvalid'] = '$sender からの署名が正しくありません。'; |
| | | $messages['signokey'] = '署名は未検証です。公開鍵が見つかりません。鍵 ID: $keyid'; |
| | | $messages['sigerror'] = '署名は未検証です。内部エラーです。'; |
| | | $messages['decryptok'] = 'メールを復号しました。'; |
| | | $messages['decrypterror'] = '復号に失敗しました。'; |
| | | $messages['decryptnokey'] = '復号に失敗しました。秘密鍵が見つかりません。鍵 ID: $keyid.'; |
| | | $messages['decryptbadpass'] = '復号に失敗しました。パスワードが正しくありません。'; |
| | | $messages['nokeysfound'] = '鍵が見つかりません。'; |
| | | $messages['keyopenerror'] = '鍵情報の取得に失敗しました! 内部エラーです。'; |
| | | $messages['keylisterror'] = '鍵情報のリストに失敗しました! 内部エラーです。'; |
| | | $messages['keysimportfailed'] = '鍵のインポートに失敗しました! 内部エラーです。'; |
| | | $messages['keysimportsuccess'] = '鍵をインポートしました。インポート: $new, 未変更: $old'; |
| | | $messages['keyconfirmdelete'] = '選択した鍵を本当に削除しますか?'; |
| | | $messages['keyimporttext'] = '秘密鍵と公開鍵のインポート、または ASCII 形式の署名を無効にできます。'; |
| | | |
| | | ?> |
New file |
| | |
| | | <?php |
| | | /* |
| | | |
| | | +-----------------------------------------------------------------------+ |
| | | | plugins/enigma/localization/ru_RU.inc | |
| | | | | |
| | | | Russian translation for roundcube/enigma plugin | |
| | | | Copyright (C) 2010 | |
| | | | Licensed under the GNU GPL | |
| | | | | |
| | | +-----------------------------------------------------------------------+ |
| | | | Author: Sergey Dukachev <iam@dukess.ru> | |
| | | | Updates: | |
| | | +-----------------------------------------------------------------------+ |
| | | |
| | | @version 2010-12-23 |
| | | |
| | | */ |
| | | |
| | | $labels = array(); |
| | | $labels['enigmasettings'] = 'Enigma: Настройки'; |
| | | $labels['enigmacerts'] = 'Enigma: Сертификаты (S/MIME)'; |
| | | $labels['enigmakeys'] = 'Enigma: Ключи (PGP)'; |
| | | $labels['keysfromto'] = 'Ключи от $from к $to в количестве $count'; |
| | | $labels['keyname'] = 'Имя'; |
| | | $labels['keyid'] = 'Идентификатор ключа'; |
| | | $labels['keyuserid'] = 'Идентификатор пользователя'; |
| | | $labels['keytype'] = 'Тип ключа'; |
| | | $labels['fingerprint'] = 'Отпечаток (хэш) ключа'; |
| | | $labels['subkeys'] = 'Подразделы'; |
| | | $labels['basicinfo'] = 'Основные сведения'; |
| | | $labels['userids'] = 'Дополнительные идентификаторы пользователя'; |
| | | $labels['typepublickey'] = 'Открытый ключ'; |
| | | $labels['typekeypair'] = 'пара ключей'; |
| | | $labels['keyattfound'] = 'Это сообщение содержит один или несколько ключей PGP.'; |
| | | $labels['keyattimport'] = 'Импортировать ключи'; |
| | | |
| | | $labels['createkeys'] = 'Создать новую пару ключей'; |
| | | $labels['importkeys'] = 'Импортировать ключ(и)'; |
| | | $labels['exportkeys'] = 'Экспортировать ключ(и)'; |
| | | $labels['deletekeys'] = 'Удалить ключ(и)'; |
| | | $labels['keyactions'] = 'Действия с ключами...'; |
| | | $labels['keydisable'] = 'Отключить ключ'; |
| | | $labels['keyrevoke'] = 'Отозвать ключ'; |
| | | $labels['keysend'] = 'Отправить публичный ключ в собщении'; |
| | | $labels['keychpass'] = 'Изменить пароль'; |
| | | |
| | | $messages = array(); |
| | | $messages['sigvalid'] = 'Проверенная подпись у $sender.'; |
| | | $messages['siginvalid'] = 'Неверная подпись у $sender.'; |
| | | $messages['signokey'] = 'Непроверяемая подпись. Открытый ключ не найден. Идентификатор ключа: $keyid.'; |
| | | $messages['sigerror'] = 'Непроверяемая подпись. Внутренняя ошибка.'; |
| | | $messages['decryptok'] = 'Сообщение расшифровано.'; |
| | | $messages['decrypterror'] = 'Расшифровка не удалась.'; |
| | | $messages['decryptnokey'] = 'Расшифровка не удалась. Секретный ключ не найден. Идентификатор ключа: $keyid.'; |
| | | $messages['decryptbadpass'] = 'Расшифровка не удалась. Неправильный пароль.'; |
| | | $messages['nokeysfound'] = 'Ключи не найдены'; |
| | | $messages['keyopenerror'] = 'Невозможно получить информацию о ключе! Внутренняя ошибка.'; |
| | | $messages['keylisterror'] = 'Невозможно сделать список ключей! Внутренняя ошибка.'; |
| | | $messages['keysimportfailed'] = 'Невозможно импортировать ключ(и)! Внутренняя ошибка.'; |
| | | $messages['keysimportsuccess'] = 'Ключи успешно импортированы. Импортировано: $new, без изменений: $old.'; |
| | | $messages['keyconfirmdelete'] = 'Вы точно хотите удалить выбранные ключи?'; |
| | | $messages['keyimporttext'] = 'Вы можете импортировать открытые и секретные ключи или сообщения об отзыве ключей в формате ASCII-Armor.'; |
| | | |
| | | ?> |
New file |
| | |
| | | /*** Style for Enigma plugin ***/ |
| | | |
| | | /***** Messages displaying *****/ |
| | | |
| | | #enigma-message, |
| | | /* fixes border-top */ |
| | | #messagebody div #enigma-message |
| | | { |
| | | margin: 0; |
| | | margin-bottom: 5px; |
| | | min-height: 20px; |
| | | padding: 10px 10px 6px 46px; |
| | | } |
| | | |
| | | div.enigmaerror, |
| | | /* fixes border-top */ |
| | | #messagebody div.enigmaerror |
| | | { |
| | | background: url(enigma_error.png) 6px 1px no-repeat; |
| | | background-color: #EF9398; |
| | | border: 1px solid #DC5757; |
| | | } |
| | | |
| | | div.enigmanotice, |
| | | /* fixes border-top */ |
| | | #messagebody div.enigmanotice |
| | | { |
| | | background: url(enigma.png) 6px 1px no-repeat; |
| | | background-color: #A6EF7B; |
| | | border: 1px solid #76C83F; |
| | | } |
| | | |
| | | div.enigmawarning, |
| | | /* fixes border-top */ |
| | | #messagebody div.enigmawarning |
| | | { |
| | | background: url(enigma.png) 6px 1px no-repeat; |
| | | background-color: #F7FDCB; |
| | | border: 1px solid #C2D071; |
| | | } |
| | | |
| | | #enigma-message a |
| | | { |
| | | color: #666666; |
| | | padding-left: 10px; |
| | | } |
| | | |
| | | #enigma-message a:hover |
| | | { |
| | | color: #333333; |
| | | } |
| | | |
| | | /***** Keys/Certs Management *****/ |
| | | |
| | | div.enigmascreen |
| | | { |
| | | position: absolute; |
| | | top: 65px; |
| | | right: 10px; |
| | | bottom: 10px; |
| | | left: 10px; |
| | | } |
| | | |
| | | #enigmacontent-box |
| | | { |
| | | position: absolute; |
| | | top: 0px; |
| | | left: 290px; |
| | | right: 0px; |
| | | bottom: 0px; |
| | | border: 1px solid #999999; |
| | | overflow: hidden; |
| | | } |
| | | |
| | | #enigmakeyslist |
| | | { |
| | | position: absolute; |
| | | top: 0; |
| | | bottom: 0; |
| | | left: 0; |
| | | border: 1px solid #999999; |
| | | background-color: #F9F9F9; |
| | | overflow: hidden; |
| | | } |
| | | |
| | | #keylistcountbar |
| | | { |
| | | margin-top: 4px; |
| | | margin-left: 4px; |
| | | } |
| | | |
| | | #keys-table |
| | | { |
| | | width: 100%; |
| | | table-layout: fixed; |
| | | } |
| | | |
| | | #keys-table td |
| | | { |
| | | cursor: default; |
| | | text-overflow: ellipsis; |
| | | -o-text-overflow: ellipsis; |
| | | } |
| | | |
| | | #key-details table td.title |
| | | { |
| | | font-weight: bold; |
| | | text-align: right; |
| | | } |
| | | |
| | | #keystoolbar |
| | | { |
| | | position: absolute; |
| | | top: 30px; |
| | | left: 10px; |
| | | height: 35px; |
| | | } |
| | | |
| | | #keystoolbar a |
| | | { |
| | | padding-right: 10px; |
| | | } |
| | | |
| | | #keystoolbar a.button, |
| | | #keystoolbar a.buttonPas, |
| | | #keystoolbar span.separator { |
| | | display: block; |
| | | float: left; |
| | | width: 32px; |
| | | height: 32px; |
| | | padding: 0; |
| | | margin-right: 10px; |
| | | overflow: hidden; |
| | | background: url(keys_toolbar.png) 0 0 no-repeat transparent; |
| | | opacity: 0.99; /* this is needed to make buttons appear correctly in Chrome */ |
| | | } |
| | | |
| | | #keystoolbar a.buttonPas { |
| | | opacity: 0.35; |
| | | } |
| | | |
| | | #keystoolbar a.createSel { |
| | | background-position: 0 -32px; |
| | | } |
| | | |
| | | #keystoolbar a.create { |
| | | background-position: 0 0; |
| | | } |
| | | |
| | | #keystoolbar a.deleteSel { |
| | | background-position: -32px -32px; |
| | | } |
| | | |
| | | #keystoolbar a.delete { |
| | | background-position: -32px 0; |
| | | } |
| | | |
| | | #keystoolbar a.importSel { |
| | | background-position: -64px -32px; |
| | | } |
| | | |
| | | #keystoolbar a.import { |
| | | background-position: -64px 0; |
| | | } |
| | | |
| | | #keystoolbar a.exportSel { |
| | | background-position: -96px -32px; |
| | | } |
| | | |
| | | #keystoolbar a.export { |
| | | background-position: -96px 0; |
| | | } |
| | | |
| | | #keystoolbar a.keymenu { |
| | | background-position: -128px 0; |
| | | width: 36px; |
| | | } |
| | | |
| | | #keystoolbar span.separator { |
| | | width: 5px; |
| | | background-position: -166px 0; |
| | | } |
New file |
| | |
| | | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
| | | <html xmlns="http://www.w3.org/1999/xhtml"> |
| | | <head> |
| | | <title><roundcube:object name="pagetitle" /></title> |
| | | <roundcube:include file="/includes/links.html" /> |
| | | <link rel="stylesheet" type="text/css" href="/this/enigma.css" /> |
| | | </head> |
| | | <body class="iframe"> |
| | | |
| | | <div id="keyimport-title" class="boxtitle"><roundcube:label name="enigma.importkeys" /></div> |
| | | |
| | | <div id="import-form" class="boxcontent"> |
| | | <roundcube:object name="importform" /> |
| | | <p> |
| | | <br /><roundcube:button command="plugin.enigma-import" type="input" class="button mainaction" label="import" /> |
| | | </p> |
| | | </div> |
| | | |
| | | </body> |
| | | </html> |
New file |
| | |
| | | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
| | | <html xmlns="http://www.w3.org/1999/xhtml"> |
| | | <head> |
| | | <title><roundcube:object name="pagetitle" /></title> |
| | | <roundcube:include file="/includes/links.html" /> |
| | | <link rel="stylesheet" type="text/css" href="/this/enigma.css" /> |
| | | </head> |
| | | <body class="iframe"> |
| | | |
| | | <div id="keyinfo-title" class="boxtitle"><roundcube:object name="keyname" part="name" /></div> |
| | | |
| | | <div id="key-details" class="boxcontent"> |
| | | <roundcube:object name="keydata" /> |
| | | </div> |
| | | |
| | | </body> |
| | | </html> |
New file |
| | |
| | | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
| | | <html xmlns="http://www.w3.org/1999/xhtml"> |
| | | <head> |
| | | <title><roundcube:object name="pagetitle" /></title> |
| | | <roundcube:include file="/includes/links.html" /> |
| | | <link rel="stylesheet" type="text/css" href="/this/enigma.css" /> |
| | | <script type="text/javascript" src="/functions.js"></script> |
| | | <script type="text/javascript" src="/splitter.js"></script> |
| | | <style type="text/css"> |
| | | #enigmakeyslist { width: <roundcube:exp expression="!empty(cookie:enigmaviewsplitter) ? cookie:enigmaviewsplitter-5 : 210" />px; } |
| | | #enigmacontent-box { left: <roundcube:exp expression="!empty(cookie:enigmaviewsplitter) ? cookie:enigmaviewsplitter+5 : 220" />px; |
| | | <roundcube:exp expression="browser:ie ? ('width:expression((parseInt(this.parentNode.offsetWidth)-'.(!empty(cookie:enigmaeviewsplitter) ? cookie:enigmaviewsplitter+5 : 220).')+\\'px\\');') : ''" /> |
| | | } |
| | | </style> |
| | | </head> |
| | | <body class="iframe" onload="rcube_init_mail_ui()"> |
| | | |
| | | <div id="prefs-title" class="boxtitle"><roundcube:label name="enigma.enigmakeys" /></div> |
| | | <div id="prefs-details" class="boxcontent"> |
| | | |
| | | <div id="keystoolbar"> |
| | | <roundcube:button command="plugin.enigma-key-create" type="link" class="buttonPas create" classAct="button create" classSel="button createSel" title="enigma.createkeys" content=" " /> |
| | | <roundcube:button command="plugin.enigma-key-delete" type="link" class="buttonPas delete" classAct="button delete" classSel="button deleteSel" title="enigma.deletekeys" content=" " /> |
| | | <span class="separator"> </span> |
| | | <roundcube:button command="plugin.enigma-key-import" type="link" class="buttonPas import" classAct="button import" classSel="button importSel" title="enigma.importkeys" content=" " /> |
| | | <roundcube:button command="plugin.enigma-key-export" type="link" class="buttonPas export" classAct="button export" classSel="button exportSel" title="enigma.exportkeys" content=" " /> |
| | | <roundcube:button name="messagemenulink" id="messagemenulink" type="link" class="button keymenu" title="enigma.keyactions" onclick="rcmail_ui.show_popup('messagemenu');return false" content=" " /> |
| | | </div> |
| | | |
| | | <div id="quicksearchbar" style="top: 35px; right: 10px;"> |
| | | <roundcube:button name="searchmenulink" id="searchmenulink" image="/images/icons/glass.png" /> |
| | | <roundcube:object name="searchform" id="quicksearchbox" /> |
| | | <roundcube:button command="reset-search" id="searchreset" image="/images/icons/reset.gif" title="resetsearch" /> |
| | | </div> |
| | | |
| | | <div class="enigmascreen"> |
| | | |
| | | <div id="enigmakeyslist"> |
| | | <div class="boxtitle"><roundcube:label name="enigma.keyname" /></div> |
| | | <div class="boxlistcontent"> |
| | | <roundcube:object name="keyslist" id="keys-table" class="records-table" cellspacing="0" noheader="true" /> |
| | | </div> |
| | | <div class="boxfooter"> |
| | | <div id="keylistcountbar" class="pagenav"> |
| | | <roundcube:button command="firstpage" type="link" class="buttonPas firstpage" classAct="button firstpage" classSel="button firstpageSel" title="firstpage" content=" " /> |
| | | <roundcube:button command="previouspage" type="link" class="buttonPas prevpage" classAct="button prevpage" classSel="button prevpageSel" title="previouspage" content=" " /> |
| | | <roundcube:object name="countdisplay" style="padding:0 .5em; float:left" /> |
| | | <roundcube:button command="nextpage" type="link" class="buttonPas nextpage" classAct="button nextpage" classSel="button nextpageSel" title="nextpage" content=" " /> |
| | | <roundcube:button command="lastpage" type="link" class="buttonPas lastpage" classAct="button lastpage" classSel="button lastpageSel" title="lastpage" content=" " /> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | |
| | | <script type="text/javascript"> |
| | | var enigmaviewsplit = new rcube_splitter({id:'enigmaviewsplitter', p1: 'enigmakeyslist', p2: 'enigmacontent-box', orientation: 'v', relative: true, start: 215}); |
| | | rcmail.add_onload('enigmaviewsplit.init()'); |
| | | </script> |
| | | |
| | | <div id="enigmacontent-box"> |
| | | <roundcube:object name="keyframe" id="keyframe" width="100%" height="100%" frameborder="0" src="/watermark.html" /> |
| | | </div> |
| | | |
| | | </div> |
| | | </div> |
| | | |
| | | <div id="messagemenu" class="popupmenu"> |
| | | <ul class="toolbarmenu"> |
| | | <li><roundcube:button class="disablelink" command="enigma.key-disable" label="enigma.keydisable" target="_blank" classAct="disablelink active" /></li> |
| | | <li><roundcube:button class="revokelink" command="enigma.key-revoke" label="enigma.keyrevoke" classAct="revokelink active" /></li> |
| | | <li class="separator_below"><roundcube:button class="sendlink" command="enigma.key-send" label="enigma.keysend" classAct="sendlink active" /></li> |
| | | <li><roundcube:button class="chpasslink" command="enigma.key-chpass" label="enigma.keychpass" classAct="chpasslink active" /></li> |
| | | </ul> |
| | | </div> |
| | | |
| | | </body> |
| | | </html> |
New file |
| | |
| | | <?php |
| | | |
| | | require_once(dirname(__FILE__) . '/example_addressbook_backend.php'); |
| | | |
| | | /** |
| | | * Sample plugin to add a new address book |
| | | * with just a static list of contacts |
| | | */ |
| | | class example_addressbook extends rcube_plugin |
| | | { |
| | | private $abook_id = 'static'; |
| | | private $abook_name = 'Static List'; |
| | | |
| | | public function init() |
| | | { |
| | | $this->add_hook('addressbooks_list', array($this, 'address_sources')); |
| | | $this->add_hook('addressbook_get', array($this, 'get_address_book')); |
| | | |
| | | // use this address book for autocompletion queries |
| | | // (maybe this should be configurable by the user?) |
| | | $config = rcmail::get_instance()->config; |
| | | $sources = (array) $config->get('autocomplete_addressbooks', array('sql')); |
| | | if (!in_array($this->abook_id, $sources)) { |
| | | $sources[] = $this->abook_id; |
| | | $config->set('autocomplete_addressbooks', $sources); |
| | | } |
| | | } |
| | | |
| | | public function address_sources($p) |
| | | { |
| | | $abook = new example_addressbook_backend($this->abook_name); |
| | | $p['sources'][$this->abook_id] = array( |
| | | 'id' => $this->abook_id, |
| | | 'name' => $this->abook_name, |
| | | 'readonly' => $abook->readonly, |
| | | 'groups' => $abook->groups, |
| | | ); |
| | | return $p; |
| | | } |
| | | |
| | | public function get_address_book($p) |
| | | { |
| | | if ($p['id'] === $this->abook_id) { |
| | | $p['instance'] = new example_addressbook_backend($this->abook_name); |
| | | } |
| | | |
| | | return $p; |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | <?php |
| | | |
| | | /** |
| | | * Example backend class for a custom address book |
| | | * |
| | | * This one just holds a static list of address records |
| | | * |
| | | * @author Thomas Bruederli |
| | | */ |
| | | class example_addressbook_backend extends rcube_addressbook |
| | | { |
| | | public $primary_key = 'ID'; |
| | | public $readonly = true; |
| | | public $groups = true; |
| | | |
| | | private $filter; |
| | | private $result; |
| | | private $name; |
| | | |
| | | public function __construct($name) |
| | | { |
| | | $this->ready = true; |
| | | $this->name = $name; |
| | | } |
| | | |
| | | public function get_name() |
| | | { |
| | | return $this->name; |
| | | } |
| | | |
| | | public function set_search_set($filter) |
| | | { |
| | | $this->filter = $filter; |
| | | } |
| | | |
| | | public function get_search_set() |
| | | { |
| | | return $this->filter; |
| | | } |
| | | |
| | | public function reset() |
| | | { |
| | | $this->result = null; |
| | | $this->filter = null; |
| | | } |
| | | |
| | | function list_groups($search = null) |
| | | { |
| | | return array( |
| | | array('ID' => 'testgroup1', 'name' => "Testgroup"), |
| | | array('ID' => 'testgroup2', 'name' => "Sample Group"), |
| | | ); |
| | | } |
| | | |
| | | public function list_records($cols=null, $subset=0) |
| | | { |
| | | $this->result = $this->count(); |
| | | $this->result->add(array('ID' => '111', 'name' => "Example Contact", 'firstname' => "Example", 'surname' => "Contact", 'email' => "example@roundcube.net")); |
| | | |
| | | return $this->result; |
| | | } |
| | | |
| | | public function search($fields, $value, $strict=false, $select=true, $nocount=false, $required=array()) |
| | | { |
| | | // no search implemented, just list all records |
| | | return $this->list_records(); |
| | | } |
| | | |
| | | public function count() |
| | | { |
| | | return new rcube_result_set(1, ($this->list_page-1) * $this->page_size); |
| | | } |
| | | |
| | | public function get_result() |
| | | { |
| | | return $this->result; |
| | | } |
| | | |
| | | public function get_record($id, $assoc=false) |
| | | { |
| | | $this->list_records(); |
| | | $first = $this->result->first(); |
| | | $sql_arr = $first['ID'] == $id ? $first : null; |
| | | |
| | | return $assoc && $sql_arr ? $sql_arr : $this->result; |
| | | } |
| | | |
| | | |
| | | function create_group($name) |
| | | { |
| | | $result = false; |
| | | |
| | | return $result; |
| | | } |
| | | |
| | | function delete_group($gid) |
| | | { |
| | | return false; |
| | | } |
| | | |
| | | function rename_group($gid, $newname) |
| | | { |
| | | return $newname; |
| | | } |
| | | |
| | | function add_to_group($group_id, $ids) |
| | | { |
| | | return false; |
| | | } |
| | | |
| | | function remove_from_group($group_id, $ids) |
| | | { |
| | | return false; |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <package xmlns="http://pear.php.net/dtd/package-2.0" xmlns:tasks="http://pear.php.net/dtd/tasks-1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" packagerversion="1.9.0" version="2.0" xsi:schemaLocation="http://pear.php.net/dtd/tasks-1.0 |
| | | http://pear.php.net/dtd/tasks-1.0.xsd |
| | | http://pear.php.net/dtd/package-2.0 |
| | | http://pear.php.net/dtd/package-2.0.xsd"> |
| | | <name>example_addressbook</name> |
| | | <channel>pear.roundcube.net</channel> |
| | | <summary>Example addressbook plugin implementation</summary> |
| | | <description>Sample plugin to add a new address book with just a static list of contacts.</description> |
| | | <lead> |
| | | <name>Thomas Bruederli</name> |
| | | <user>thomasb</user> |
| | | <email>roundcube@gmail.com</email> |
| | | <active>yes</active> |
| | | </lead> |
| | | <date>2011-11-21</date> |
| | | <version> |
| | | <release>1.0</release> |
| | | <api>1.0</api> |
| | | </version> |
| | | <stability> |
| | | <release>stable</release> |
| | | <api>stable</api> |
| | | </stability> |
| | | <license uri="http://www.gnu.org/licenses/gpl.html">GNU GPLv3+</license> |
| | | <notes>-</notes> |
| | | <contents> |
| | | <dir baseinstalldir="/" name="/"> |
| | | <file name="example_addressbook.php" role="php"> |
| | | <tasks:replace from="@name@" to="name" type="package-info"/> |
| | | <tasks:replace from="@package_version@" to="version" type="package-info"/> |
| | | </file> |
| | | <file name="example_addressbook_backend.php" role="php"> |
| | | <tasks:replace from="@name@" to="name" type="package-info"/> |
| | | <tasks:replace from="@package_version@" to="version" type="package-info"/> |
| | | </file> |
| | | </dir> |
| | | <!-- / --> |
| | | </contents> |
| | | <dependencies> |
| | | <required> |
| | | <php> |
| | | <min>5.2.1</min> |
| | | </php> |
| | | <pearinstaller> |
| | | <min>1.7.0</min> |
| | | </pearinstaller> |
| | | </required> |
| | | </dependencies> |
| | | <phprelease/> |
| | | </package> |
New file |
| | |
| | | <?php |
| | | /** |
| | | * Filesystem Attachments |
| | | * |
| | | * This is a core plugin which provides basic, filesystem based |
| | | * attachment temporary file handling. This includes storing |
| | | * attachments of messages currently being composed, writing attachments |
| | | * to disk when drafts with attachments are re-opened and writing |
| | | * attachments to disk for inline display in current html compositions. |
| | | * |
| | | * Developers may wish to extend this class when creating attachment |
| | | * handler plugins: |
| | | * require_once('plugins/filesystem_attachments/filesystem_attachments.php'); |
| | | * class myCustom_attachments extends filesystem_attachments |
| | | * |
| | | * @author Ziba Scott <ziba@umich.edu> |
| | | * @author Thomas Bruederli <roundcube@gmail.com> |
| | | * |
| | | */ |
| | | class filesystem_attachments extends rcube_plugin |
| | | { |
| | | public $task = '?(?!login).*'; |
| | | |
| | | function init() |
| | | { |
| | | // Save a newly uploaded attachment |
| | | $this->add_hook('attachment_upload', array($this, 'upload')); |
| | | |
| | | // Save an attachment from a non-upload source (draft or forward) |
| | | $this->add_hook('attachment_save', array($this, 'save')); |
| | | |
| | | // Remove an attachment from storage |
| | | $this->add_hook('attachment_delete', array($this, 'remove')); |
| | | |
| | | // When composing an html message, image attachments may be shown |
| | | $this->add_hook('attachment_display', array($this, 'display')); |
| | | |
| | | // Get the attachment from storage and place it on disk to be sent |
| | | $this->add_hook('attachment_get', array($this, 'get')); |
| | | |
| | | // Delete all temp files associated with this user |
| | | $this->add_hook('attachments_cleanup', array($this, 'cleanup')); |
| | | $this->add_hook('session_destroy', array($this, 'cleanup')); |
| | | } |
| | | |
| | | /** |
| | | * Save a newly uploaded attachment |
| | | */ |
| | | function upload($args) |
| | | { |
| | | $args['status'] = false; |
| | | $group = $args['group']; |
| | | $rcmail = rcmail::get_instance(); |
| | | |
| | | // use common temp dir for file uploads |
| | | $temp_dir = $rcmail->config->get('temp_dir'); |
| | | $tmpfname = tempnam($temp_dir, 'rcmAttmnt'); |
| | | |
| | | if (move_uploaded_file($args['path'], $tmpfname) && file_exists($tmpfname)) { |
| | | $args['id'] = $this->file_id(); |
| | | $args['path'] = $tmpfname; |
| | | $args['status'] = true; |
| | | |
| | | // Note the file for later cleanup |
| | | $_SESSION['plugins']['filesystem_attachments'][$group][] = $tmpfname; |
| | | } |
| | | |
| | | return $args; |
| | | } |
| | | |
| | | /** |
| | | * Save an attachment from a non-upload source (draft or forward) |
| | | */ |
| | | function save($args) |
| | | { |
| | | $group = $args['group']; |
| | | $args['status'] = false; |
| | | |
| | | if (!$args['path']) { |
| | | $rcmail = rcmail::get_instance(); |
| | | $temp_dir = $rcmail->config->get('temp_dir'); |
| | | $tmp_path = tempnam($temp_dir, 'rcmAttmnt'); |
| | | |
| | | if ($fp = fopen($tmp_path, 'w')) { |
| | | fwrite($fp, $args['data']); |
| | | fclose($fp); |
| | | $args['path'] = $tmp_path; |
| | | } else |
| | | return $args; |
| | | } |
| | | |
| | | $args['id'] = $this->file_id(); |
| | | $args['status'] = true; |
| | | |
| | | // Note the file for later cleanup |
| | | $_SESSION['plugins']['filesystem_attachments'][$group][] = $args['path']; |
| | | |
| | | return $args; |
| | | } |
| | | |
| | | /** |
| | | * Remove an attachment from storage |
| | | * This is triggered by the remove attachment button on the compose screen |
| | | */ |
| | | function remove($args) |
| | | { |
| | | $args['status'] = @unlink($args['path']); |
| | | return $args; |
| | | } |
| | | |
| | | /** |
| | | * When composing an html message, image attachments may be shown |
| | | * For this plugin, the file is already in place, just check for |
| | | * the existance of the proper metadata |
| | | */ |
| | | function display($args) |
| | | { |
| | | $args['status'] = file_exists($args['path']); |
| | | return $args; |
| | | } |
| | | |
| | | /** |
| | | * This attachment plugin doesn't require any steps to put the file |
| | | * on disk for use. This stub function is kept here to make this |
| | | * class handy as a parent class for other plugins which may need it. |
| | | */ |
| | | function get($args) |
| | | { |
| | | return $args; |
| | | } |
| | | |
| | | /** |
| | | * Delete all temp files associated with this user |
| | | */ |
| | | function cleanup($args) |
| | | { |
| | | // $_SESSION['compose']['attachments'] is not a complete record of |
| | | // temporary files because loading a draft or starting a forward copies |
| | | // the file to disk, but does not make an entry in that array |
| | | if (is_array($_SESSION['plugins']['filesystem_attachments'])){ |
| | | foreach ($_SESSION['plugins']['filesystem_attachments'] as $group => $files) { |
| | | if ($args['group'] && $args['group'] != $group) |
| | | continue; |
| | | foreach ((array)$files as $filename){ |
| | | if(file_exists($filename)){ |
| | | unlink($filename); |
| | | } |
| | | } |
| | | unset($_SESSION['plugins']['filesystem_attachments'][$group]); |
| | | } |
| | | } |
| | | return $args; |
| | | } |
| | | |
| | | function file_id() |
| | | { |
| | | $userid = rcmail::get_instance()->user->ID; |
| | | list($usec, $sec) = explode(' ', microtime()); |
| | | return preg_replace('/[^0-9]/', '', $userid . $sec . $usec); |
| | | } |
| | | } |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <package xmlns="http://pear.php.net/dtd/package-2.0" xmlns:tasks="http://pear.php.net/dtd/tasks-1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" packagerversion="1.9.0" version="2.0" xsi:schemaLocation="http://pear.php.net/dtd/tasks-1.0 |
| | | http://pear.php.net/dtd/tasks-1.0.xsd |
| | | http://pear.php.net/dtd/package-2.0 |
| | | http://pear.php.net/dtd/package-2.0.xsd"> |
| | | <name>filesystem_attachments</name> |
| | | <channel>pear.roundcube.net</channel> |
| | | <summary>Default database storage for uploaded attachments</summary> |
| | | <description> |
| | | This is a core plugin which provides basic, filesystem based |
| | | attachment temporary file handling. This includes storing |
| | | attachments of messages currently being composed, writing attachments |
| | | to disk when drafts with attachments are re-opened and writing |
| | | attachments to disk for inline display in current html compositions. |
| | | </description> |
| | | <lead> |
| | | <name>Thomas Bruederli</name> |
| | | <user>thomasb</user> |
| | | <email>roundcube@gmail.com</email> |
| | | <active>yes</active> |
| | | </lead> |
| | | <developer> |
| | | <name>Ziba Scott</name> |
| | | <user>ziba</user> |
| | | <email>ziba@umich.edu</email> |
| | | <active>yes</active> |
| | | </developer> |
| | | <date>2011-11-21</date> |
| | | <version> |
| | | <release>1.0</release> |
| | | <api>1.0</api> |
| | | </version> |
| | | <stability> |
| | | <release>stable</release> |
| | | <api>stable</api> |
| | | </stability> |
| | | <license uri="http://www.gnu.org/licenses/gpl-2.0.html">GNU GPLv2</license> |
| | | <notes>-</notes> |
| | | <contents> |
| | | <dir baseinstalldir="/" name="/"> |
| | | <file name="filesystem_attachments.php" role="php"> |
| | | <tasks:replace from="@name@" to="name" type="package-info"/> |
| | | <tasks:replace from="@package_version@" to="version" type="package-info"/> |
| | | </file> |
| | | </dir> |
| | | <!-- / --> |
| | | </contents> |
| | | <dependencies> |
| | | <required> |
| | | <php> |
| | | <min>5.2.1</min> |
| | | </php> |
| | | <pearinstaller> |
| | | <min>1.7.0</min> |
| | | </pearinstaller> |
| | | </required> |
| | | </dependencies> |
| | | <phprelease/> |
| | | </package> |
New file |
| | |
| | | <?php |
| | | |
| | | // Help content iframe source |
| | | // $rcmail_config['help_source'] = 'http://trac.roundcube.net/wiki'; |
| | | $rcmail_config['help_source'] = ''; |
New file |
| | |
| | | <div id="helpabout" class="readtext"> |
| | | <h2 align="center">Copyright © 2005-2012, The Roundcube Dev Team</h2> |
| | | |
| | | <p> |
| | | This program is free software: you can redistribute it and/or modify |
| | | it under the terms of the GNU General Public License (with exceptions |
| | | for skins & plugins) as published by the Free Software Foundation, |
| | | either version 3 of the License, or (at your option) any later version. |
| | | </p> |
| | | <p> |
| | | This program is distributed in the hope that it will be useful, |
| | | but WITHOUT ANY WARRANTY; without even the implied warranty of |
| | | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| | | GNU General Public License for more details. |
| | | </p> |
| | | <p> |
| | | You should have received a copy of the GNU General Public License |
| | | along with this program. If not, see <a href="http://www.gnu.org/licenses/">www.gnu.org/licenses</a>. |
| | | </p> |
| | | |
| | | <p> |
| | | For more details about licensing and the expections for skins and plugins |
| | | see <a href="http://roundcube.net/license">roundcube.net/license</a>. |
| | | </p> |
| | | |
| | | <p><br/>Website: <a href="http://roundcube.net">roundcube.net</a></p> |
| | | </div> |
| | | </div> |
New file |
| | |
| | | <div id="helplicense" class="readtext"> |
| | | <h2 style="text-align: center;">GNU GENERAL PUBLIC LICENSE</h2> |
| | | <p style="text-align: center;">Version 3, 29 June 2007</p> |
| | | |
| | | <p>Copyright © 2007 Free Software Foundation, Inc. |
| | | <<a href="http://fsf.org/">http://fsf.org/</a>></p><p> |
| | | Everyone is permitted to copy and distribute verbatim copies |
| | | of this license document, but changing it is not allowed.</p> |
| | | |
| | | <h3>Preamble</h3> |
| | | |
| | | <p>The GNU General Public License is a free, copyleft license for |
| | | software and other kinds of works.</p> |
| | | |
| | | <p>The licenses for most software and other practical works are designed |
| | | to take away your freedom to share and change the works. By contrast, |
| | | the GNU General Public License is intended to guarantee your freedom to |
| | | share and change all versions of a program--to make sure it remains free |
| | | software for all its users. We, the Free Software Foundation, use the |
| | | GNU General Public License for most of our software; it applies also to |
| | | any other work released this way by its authors. You can apply it to |
| | | your programs, too.</p> |
| | | |
| | | <p>When we speak of free software, we are referring to freedom, not |
| | | price. Our General Public Licenses are designed to make sure that you |
| | | have the freedom to distribute copies of free software (and charge for |
| | | them if you wish), that you receive source code or can get it if you |
| | | want it, that you can change the software or use pieces of it in new |
| | | free programs, and that you know you can do these things.</p> |
| | | |
| | | <p>To protect your rights, we need to prevent others from denying you |
| | | these rights or asking you to surrender the rights. Therefore, you have |
| | | certain responsibilities if you distribute copies of the software, or if |
| | | you modify it: responsibilities to respect the freedom of others.</p> |
| | | |
| | | <p>For example, if you distribute copies of such a program, whether |
| | | gratis or for a fee, you must pass on to the recipients the same |
| | | freedoms that you received. You must make sure that they, too, receive |
| | | or can get the source code. And you must show them these terms so they |
| | | know their rights.</p> |
| | | |
| | | <p>Developers that use the GNU GPL protect your rights with two steps: |
| | | (1) assert copyright on the software, and (2) offer you this License |
| | | giving you legal permission to copy, distribute and/or modify it.</p> |
| | | |
| | | <p>For the developers' and authors' protection, the GPL clearly explains |
| | | that there is no warranty for this free software. For both users' and |
| | | authors' sake, the GPL requires that modified versions be marked as |
| | | changed, so that their problems will not be attributed erroneously to |
| | | authors of previous versions.</p> |
| | | |
| | | <p>Some devices are designed to deny users access to install or run |
| | | modified versions of the software inside them, although the manufacturer |
| | | can do so. This is fundamentally incompatible with the aim of |
| | | protecting users' freedom to change the software. The systematic |
| | | pattern of such abuse occurs in the area of products for individuals to |
| | | use, which is precisely where it is most unacceptable. Therefore, we |
| | | have designed this version of the GPL to prohibit the practice for those |
| | | products. If such problems arise substantially in other domains, we |
| | | stand ready to extend this provision to those domains in future versions |
| | | of the GPL, as needed to protect the freedom of users.</p> |
| | | |
| | | <p>Finally, every program is threatened constantly by software patents. |
| | | States should not allow patents to restrict development and use of |
| | | software on general-purpose computers, but in those that do, we wish to |
| | | avoid the special danger that patents applied to a free program could |
| | | make it effectively proprietary. To prevent this, the GPL assures that |
| | | patents cannot be used to render the program non-free.</p> |
| | | |
| | | <p>The precise terms and conditions for copying, distribution and |
| | | modification follow.</p> |
| | | |
| | | <h3><a name="terms"></a>TERMS AND CONDITIONS</h3> |
| | | |
| | | <h4><a name="section0"></a>0. Definitions.</h4> |
| | | |
| | | <p>“This License” refers to version 3 of the GNU General Public License.</p> |
| | | |
| | | <p>“Copyright” also means copyright-like laws that apply to other kinds of |
| | | works, such as semiconductor masks.</p> |
| | | |
| | | <p>“The Program” refers to any copyrightable work licensed under this |
| | | License. Each licensee is addressed as “you”. “Licensees” and |
| | | “recipients” may be individuals or organizations.</p> |
| | | |
| | | <p>To “modify” a work means to copy from or adapt all or part of the work |
| | | in a fashion requiring copyright permission, other than the making of an |
| | | exact copy. The resulting work is called a “modified version” of the |
| | | earlier work or a work “based on” the earlier work.</p> |
| | | |
| | | <p>A “covered work” means either the unmodified Program or a work based |
| | | on the Program.</p> |
| | | |
| | | <p>To “propagate” a work means to do anything with it that, without |
| | | permission, would make you directly or secondarily liable for |
| | | infringement under applicable copyright law, except executing it on a |
| | | computer or modifying a private copy. Propagation includes copying, |
| | | distribution (with or without modification), making available to the |
| | | public, and in some countries other activities as well.</p> |
| | | |
| | | <p>To “convey” a work means any kind of propagation that enables other |
| | | parties to make or receive copies. Mere interaction with a user through |
| | | a computer network, with no transfer of a copy, is not conveying.</p> |
| | | |
| | | <p>An interactive user interface displays “Appropriate Legal Notices” |
| | | to the extent that it includes a convenient and prominently visible |
| | | feature that (1) displays an appropriate copyright notice, and (2) |
| | | tells the user that there is no warranty for the work (except to the |
| | | extent that warranties are provided), that licensees may convey the |
| | | work under this License, and how to view a copy of this License. If |
| | | the interface presents a list of user commands or options, such as a |
| | | menu, a prominent item in the list meets this criterion.</p> |
| | | |
| | | <h4><a name="section1"></a>1. Source Code.</h4> |
| | | |
| | | <p>The “source code” for a work means the preferred form of the work |
| | | for making modifications to it. “Object code” means any non-source |
| | | form of a work.</p> |
| | | |
| | | <p>A “Standard Interface” means an interface that either is an official |
| | | standard defined by a recognized standards body, or, in the case of |
| | | interfaces specified for a particular programming language, one that |
| | | is widely used among developers working in that language.</p> |
| | | |
| | | <p>The “System Libraries” of an executable work include anything, other |
| | | than the work as a whole, that (a) is included in the normal form of |
| | | packaging a Major Component, but which is not part of that Major |
| | | Component, and (b) serves only to enable use of the work with that |
| | | Major Component, or to implement a Standard Interface for which an |
| | | implementation is available to the public in source code form. A |
| | | “Major Component”, in this context, means a major essential component |
| | | (kernel, window system, and so on) of the specific operating system |
| | | (if any) on which the executable work runs, or a compiler used to |
| | | produce the work, or an object code interpreter used to run it.</p> |
| | | |
| | | <p>The “Corresponding Source” for a work in object code form means all |
| | | the source code needed to generate, install, and (for an executable |
| | | work) run the object code and to modify the work, including scripts to |
| | | control those activities. However, it does not include the work's |
| | | System Libraries, or general-purpose tools or generally available free |
| | | programs which are used unmodified in performing those activities but |
| | | which are not part of the work. For example, Corresponding Source |
| | | includes interface definition files associated with source files for |
| | | the work, and the source code for shared libraries and dynamically |
| | | linked subprograms that the work is specifically designed to require, |
| | | such as by intimate data communication or control flow between those |
| | | subprograms and other parts of the work.</p> |
| | | |
| | | <p>The Corresponding Source need not include anything that users |
| | | can regenerate automatically from other parts of the Corresponding |
| | | Source.</p> |
| | | |
| | | <p>The Corresponding Source for a work in source code form is that |
| | | same work.</p> |
| | | |
| | | <h4><a name="section2"></a>2. Basic Permissions.</h4> |
| | | |
| | | <p>All rights granted under this License are granted for the term of |
| | | copyright on the Program, and are irrevocable provided the stated |
| | | conditions are met. This License explicitly affirms your unlimited |
| | | permission to run the unmodified Program. The output from running a |
| | | covered work is covered by this License only if the output, given its |
| | | content, constitutes a covered work. This License acknowledges your |
| | | rights of fair use or other equivalent, as provided by copyright law.</p> |
| | | |
| | | <p>You may make, run and propagate covered works that you do not |
| | | convey, without conditions so long as your license otherwise remains |
| | | in force. You may convey covered works to others for the sole purpose |
| | | of having them make modifications exclusively for you, or provide you |
| | | with facilities for running those works, provided that you comply with |
| | | the terms of this License in conveying all material for which you do |
| | | not control copyright. Those thus making or running the covered works |
| | | for you must do so exclusively on your behalf, under your direction |
| | | and control, on terms that prohibit them from making any copies of |
| | | your copyrighted material outside their relationship with you.</p> |
| | | |
| | | <p>Conveying under any other circumstances is permitted solely under |
| | | the conditions stated below. Sublicensing is not allowed; section 10 |
| | | makes it unnecessary.</p> |
| | | |
| | | <h4><a name="section3"></a>3. Protecting Users' Legal Rights From Anti-Circumvention Law.</h4> |
| | | |
| | | <p>No covered work shall be deemed part of an effective technological |
| | | measure under any applicable law fulfilling obligations under article |
| | | 11 of the WIPO copyright treaty adopted on 20 December 1996, or |
| | | similar laws prohibiting or restricting circumvention of such |
| | | measures.</p> |
| | | |
| | | <p>When you convey a covered work, you waive any legal power to forbid |
| | | circumvention of technological measures to the extent such circumvention |
| | | is effected by exercising rights under this License with respect to |
| | | the covered work, and you disclaim any intention to limit operation or |
| | | modification of the work as a means of enforcing, against the work's |
| | | users, your or third parties' legal rights to forbid circumvention of |
| | | technological measures.</p> |
| | | |
| | | <h4><a name="section4"></a>4. Conveying Verbatim Copies.</h4> |
| | | |
| | | <p>You may convey verbatim copies of the Program's source code as you |
| | | receive it, in any medium, provided that you conspicuously and |
| | | appropriately publish on each copy an appropriate copyright notice; |
| | | keep intact all notices stating that this License and any |
| | | non-permissive terms added in accord with section 7 apply to the code; |
| | | keep intact all notices of the absence of any warranty; and give all |
| | | recipients a copy of this License along with the Program.</p> |
| | | |
| | | <p>You may charge any price or no price for each copy that you convey, |
| | | and you may offer support or warranty protection for a fee.</p> |
| | | |
| | | <h4><a name="section5"></a>5. Conveying Modified Source Versions.</h4> |
| | | |
| | | <p>You may convey a work based on the Program, or the modifications to |
| | | produce it from the Program, in the form of source code under the |
| | | terms of section 4, provided that you also meet all of these conditions:</p> |
| | | |
| | | <ul> |
| | | <li>a) The work must carry prominent notices stating that you modified |
| | | it, and giving a relevant date.</li> |
| | | |
| | | <li>b) The work must carry prominent notices stating that it is |
| | | released under this License and any conditions added under section |
| | | 7. This requirement modifies the requirement in section 4 to |
| | | “keep intact all notices”.</li> |
| | | |
| | | <li>c) You must license the entire work, as a whole, under this |
| | | License to anyone who comes into possession of a copy. This |
| | | License will therefore apply, along with any applicable section 7 |
| | | additional terms, to the whole of the work, and all its parts, |
| | | regardless of how they are packaged. This License gives no |
| | | permission to license the work in any other way, but it does not |
| | | invalidate such permission if you have separately received it.</li> |
| | | |
| | | <li>d) If the work has interactive user interfaces, each must display |
| | | Appropriate Legal Notices; however, if the Program has interactive |
| | | interfaces that do not display Appropriate Legal Notices, your |
| | | work need not make them do so.</li> |
| | | |
| | | </ul> |
| | | |
| | | <p>A compilation of a covered work with other separate and independent |
| | | works, which are not by their nature extensions of the covered work, |
| | | and which are not combined with it such as to form a larger program, |
| | | in or on a volume of a storage or distribution medium, is called an |
| | | “aggregate” if the compilation and its resulting copyright are not |
| | | used to limit the access or legal rights of the compilation's users |
| | | beyond what the individual works permit. Inclusion of a covered work |
| | | in an aggregate does not cause this License to apply to the other |
| | | parts of the aggregate.</p> |
| | | |
| | | <h4><a name="section6"></a>6. Conveying Non-Source Forms.</h4> |
| | | |
| | | <p>You may convey a covered work in object code form under the terms |
| | | of sections 4 and 5, provided that you also convey the |
| | | machine-readable Corresponding Source under the terms of this License, |
| | | in one of these ways:</p> |
| | | |
| | | <ul> |
| | | <li>a) Convey the object code in, or embodied in, a physical product |
| | | (including a physical distribution medium), accompanied by the |
| | | Corresponding Source fixed on a durable physical medium |
| | | customarily used for software interchange.</li> |
| | | |
| | | <li>b) Convey the object code in, or embodied in, a physical product |
| | | (including a physical distribution medium), accompanied by a |
| | | written offer, valid for at least three years and valid for as |
| | | long as you offer spare parts or customer support for that product |
| | | model, to give anyone who possesses the object code either (1) a |
| | | copy of the Corresponding Source for all the software in the |
| | | product that is covered by this License, on a durable physical |
| | | medium customarily used for software interchange, for a price no |
| | | more than your reasonable cost of physically performing this |
| | | conveying of source, or (2) access to copy the |
| | | Corresponding Source from a network server at no charge.</li> |
| | | |
| | | <li>c) Convey individual copies of the object code with a copy of the |
| | | written offer to provide the Corresponding Source. This |
| | | alternative is allowed only occasionally and noncommercially, and |
| | | only if you received the object code with such an offer, in accord |
| | | with subsection 6b.</li> |
| | | |
| | | <li>d) Convey the object code by offering access from a designated |
| | | place (gratis or for a charge), and offer equivalent access to the |
| | | Corresponding Source in the same way through the same place at no |
| | | further charge. You need not require recipients to copy the |
| | | Corresponding Source along with the object code. If the place to |
| | | copy the object code is a network server, the Corresponding Source |
| | | may be on a different server (operated by you or a third party) |
| | | that supports equivalent copying facilities, provided you maintain |
| | | clear directions next to the object code saying where to find the |
| | | Corresponding Source. Regardless of what server hosts the |
| | | Corresponding Source, you remain obligated to ensure that it is |
| | | available for as long as needed to satisfy these requirements.</li> |
| | | |
| | | <li>e) Convey the object code using peer-to-peer transmission, provided |
| | | you inform other peers where the object code and Corresponding |
| | | Source of the work are being offered to the general public at no |
| | | charge under subsection 6d.</li> |
| | | </ul> |
| | | |
| | | <p>A separable portion of the object code, whose source code is excluded |
| | | from the Corresponding Source as a System Library, need not be |
| | | included in conveying the object code work.</p> |
| | | |
| | | <p>A “User Product” is either (1) a “consumer product”, which means any |
| | | tangible personal property which is normally used for personal, family, |
| | | or household purposes, or (2) anything designed or sold for incorporation |
| | | into a dwelling. In determining whether a product is a consumer product, |
| | | doubtful cases shall be resolved in favor of coverage. For a particular |
| | | product received by a particular user, “normally used” refers to a |
| | | typical or common use of that class of product, regardless of the status |
| | | of the particular user or of the way in which the particular user |
| | | actually uses, or expects or is expected to use, the product. A product |
| | | is a consumer product regardless of whether the product has substantial |
| | | commercial, industrial or non-consumer uses, unless such uses represent |
| | | the only significant mode of use of the product.</p> |
| | | |
| | | <p>“Installation Information” for a User Product means any methods, |
| | | procedures, authorization keys, or other information required to install |
| | | and execute modified versions of a covered work in that User Product from |
| | | a modified version of its Corresponding Source. The information must |
| | | suffice to ensure that the continued functioning of the modified object |
| | | code is in no case prevented or interfered with solely because |
| | | modification has been made.</p> |
| | | |
| | | <p>If you convey an object code work under this section in, or with, or |
| | | specifically for use in, a User Product, and the conveying occurs as |
| | | part of a transaction in which the right of possession and use of the |
| | | User Product is transferred to the recipient in perpetuity or for a |
| | | fixed term (regardless of how the transaction is characterized), the |
| | | Corresponding Source conveyed under this section must be accompanied |
| | | by the Installation Information. But this requirement does not apply |
| | | if neither you nor any third party retains the ability to install |
| | | modified object code on the User Product (for example, the work has |
| | | been installed in ROM).</p> |
| | | |
| | | <p>The requirement to provide Installation Information does not include a |
| | | requirement to continue to provide support service, warranty, or updates |
| | | for a work that has been modified or installed by the recipient, or for |
| | | the User Product in which it has been modified or installed. Access to a |
| | | network may be denied when the modification itself materially and |
| | | adversely affects the operation of the network or violates the rules and |
| | | protocols for communication across the network.</p> |
| | | |
| | | <p>Corresponding Source conveyed, and Installation Information provided, |
| | | in accord with this section must be in a format that is publicly |
| | | documented (and with an implementation available to the public in |
| | | source code form), and must require no special password or key for |
| | | unpacking, reading or copying.</p> |
| | | |
| | | <h4><a name="section7"></a>7. Additional Terms.</h4> |
| | | |
| | | <p>“Additional permissions” are terms that supplement the terms of this |
| | | License by making exceptions from one or more of its conditions. |
| | | Additional permissions that are applicable to the entire Program shall |
| | | be treated as though they were included in this License, to the extent |
| | | that they are valid under applicable law. If additional permissions |
| | | apply only to part of the Program, that part may be used separately |
| | | under those permissions, but the entire Program remains governed by |
| | | this License without regard to the additional permissions.</p> |
| | | |
| | | <p>When you convey a copy of a covered work, you may at your option |
| | | remove any additional permissions from that copy, or from any part of |
| | | it. (Additional permissions may be written to require their own |
| | | removal in certain cases when you modify the work.) You may place |
| | | additional permissions on material, added by you to a covered work, |
| | | for which you have or can give appropriate copyright permission.</p> |
| | | |
| | | <p>Notwithstanding any other provision of this License, for material you |
| | | add to a covered work, you may (if authorized by the copyright holders of |
| | | that material) supplement the terms of this License with terms:</p> |
| | | |
| | | <ul> |
| | | <li>a) Disclaiming warranty or limiting liability differently from the |
| | | terms of sections 15 and 16 of this License; or</li> |
| | | |
| | | <li>b) Requiring preservation of specified reasonable legal notices or |
| | | author attributions in that material or in the Appropriate Legal |
| | | Notices displayed by works containing it; or</li> |
| | | |
| | | <li>c) Prohibiting misrepresentation of the origin of that material, or |
| | | requiring that modified versions of such material be marked in |
| | | reasonable ways as different from the original version; or</li> |
| | | |
| | | <li>d) Limiting the use for publicity purposes of names of licensors or |
| | | authors of the material; or</li> |
| | | |
| | | <li>e) Declining to grant rights under trademark law for use of some |
| | | trade names, trademarks, or service marks; or</li> |
| | | |
| | | <li>f) Requiring indemnification of licensors and authors of that |
| | | material by anyone who conveys the material (or modified versions of |
| | | it) with contractual assumptions of liability to the recipient, for |
| | | any liability that these contractual assumptions directly impose on |
| | | those licensors and authors.</li> |
| | | </ul> |
| | | |
| | | <p>All other non-permissive additional terms are considered “further |
| | | restrictions” within the meaning of section 10. If the Program as you |
| | | received it, or any part of it, contains a notice stating that it is |
| | | governed by this License along with a term that is a further |
| | | restriction, you may remove that term. If a license document contains |
| | | a further restriction but permits relicensing or conveying under this |
| | | License, you may add to a covered work material governed by the terms |
| | | of that license document, provided that the further restriction does |
| | | not survive such relicensing or conveying.</p> |
| | | |
| | | <p>If you add terms to a covered work in accord with this section, you |
| | | must place, in the relevant source files, a statement of the |
| | | additional terms that apply to those files, or a notice indicating |
| | | where to find the applicable terms.</p> |
| | | |
| | | <p>Additional terms, permissive or non-permissive, may be stated in the |
| | | form of a separately written license, or stated as exceptions; |
| | | the above requirements apply either way.</p> |
| | | |
| | | <h4><a name="section8"></a>8. Termination.</h4> |
| | | |
| | | <p>You may not propagate or modify a covered work except as expressly |
| | | provided under this License. Any attempt otherwise to propagate or |
| | | modify it is void, and will automatically terminate your rights under |
| | | this License (including any patent licenses granted under the third |
| | | paragraph of section 11).</p> |
| | | |
| | | <p>However, if you cease all violation of this License, then your |
| | | license from a particular copyright holder is reinstated (a) |
| | | provisionally, unless and until the copyright holder explicitly and |
| | | finally terminates your license, and (b) permanently, if the copyright |
| | | holder fails to notify you of the violation by some reasonable means |
| | | prior to 60 days after the cessation.</p> |
| | | |
| | | <p>Moreover, your license from a particular copyright holder is |
| | | reinstated permanently if the copyright holder notifies you of the |
| | | violation by some reasonable means, this is the first time you have |
| | | received notice of violation of this License (for any work) from that |
| | | copyright holder, and you cure the violation prior to 30 days after |
| | | your receipt of the notice.</p> |
| | | |
| | | <p>Termination of your rights under this section does not terminate the |
| | | licenses of parties who have received copies or rights from you under |
| | | this License. If your rights have been terminated and not permanently |
| | | reinstated, you do not qualify to receive new licenses for the same |
| | | material under section 10.</p> |
| | | |
| | | <h4><a name="section9"></a>9. Acceptance Not Required for Having Copies.</h4> |
| | | |
| | | <p>You are not required to accept this License in order to receive or |
| | | run a copy of the Program. Ancillary propagation of a covered work |
| | | occurring solely as a consequence of using peer-to-peer transmission |
| | | to receive a copy likewise does not require acceptance. However, |
| | | nothing other than this License grants you permission to propagate or |
| | | modify any covered work. These actions infringe copyright if you do |
| | | not accept this License. Therefore, by modifying or propagating a |
| | | covered work, you indicate your acceptance of this License to do so.</p> |
| | | |
| | | <h4><a name="section10"></a>10. Automatic Licensing of Downstream Recipients.</h4> |
| | | |
| | | <p>Each time you convey a covered work, the recipient automatically |
| | | receives a license from the original licensors, to run, modify and |
| | | propagate that work, subject to this License. You are not responsible |
| | | for enforcing compliance by third parties with this License.</p> |
| | | |
| | | <p>An “entity transaction” is a transaction transferring control of an |
| | | organization, or substantially all assets of one, or subdividing an |
| | | organization, or merging organizations. If propagation of a covered |
| | | work results from an entity transaction, each party to that |
| | | transaction who receives a copy of the work also receives whatever |
| | | licenses to the work the party's predecessor in interest had or could |
| | | give under the previous paragraph, plus a right to possession of the |
| | | Corresponding Source of the work from the predecessor in interest, if |
| | | the predecessor has it or can get it with reasonable efforts.</p> |
| | | |
| | | <p>You may not impose any further restrictions on the exercise of the |
| | | rights granted or affirmed under this License. For example, you may |
| | | not impose a license fee, royalty, or other charge for exercise of |
| | | rights granted under this License, and you may not initiate litigation |
| | | (including a cross-claim or counterclaim in a lawsuit) alleging that |
| | | any patent claim is infringed by making, using, selling, offering for |
| | | sale, or importing the Program or any portion of it.</p> |
| | | |
| | | <h4><a name="section11"></a>11. Patents.</h4> |
| | | |
| | | <p>A “contributor” is a copyright holder who authorizes use under this |
| | | License of the Program or a work on which the Program is based. The |
| | | work thus licensed is called the contributor's “contributor version”.</p> |
| | | |
| | | <p>A contributor's “essential patent claims” are all patent claims |
| | | owned or controlled by the contributor, whether already acquired or |
| | | hereafter acquired, that would be infringed by some manner, permitted |
| | | by this License, of making, using, or selling its contributor version, |
| | | but do not include claims that would be infringed only as a |
| | | consequence of further modification of the contributor version. For |
| | | purposes of this definition, “control” includes the right to grant |
| | | patent sublicenses in a manner consistent with the requirements of |
| | | this License.</p> |
| | | |
| | | <p>Each contributor grants you a non-exclusive, worldwide, royalty-free |
| | | patent license under the contributor's essential patent claims, to |
| | | make, use, sell, offer for sale, import and otherwise run, modify and |
| | | propagate the contents of its contributor version.</p> |
| | | |
| | | <p>In the following three paragraphs, a “patent license” is any express |
| | | agreement or commitment, however denominated, not to enforce a patent |
| | | (such as an express permission to practice a patent or covenant not to |
| | | sue for patent infringement). To “grant” such a patent license to a |
| | | party means to make such an agreement or commitment not to enforce a |
| | | patent against the party.</p> |
| | | |
| | | <p>If you convey a covered work, knowingly relying on a patent license, |
| | | and the Corresponding Source of the work is not available for anyone |
| | | to copy, free of charge and under the terms of this License, through a |
| | | publicly available network server or other readily accessible means, |
| | | then you must either (1) cause the Corresponding Source to be so |
| | | available, or (2) arrange to deprive yourself of the benefit of the |
| | | patent license for this particular work, or (3) arrange, in a manner |
| | | consistent with the requirements of this License, to extend the patent |
| | | license to downstream recipients. “Knowingly relying” means you have |
| | | actual knowledge that, but for the patent license, your conveying the |
| | | covered work in a country, or your recipient's use of the covered work |
| | | in a country, would infringe one or more identifiable patents in that |
| | | country that you have reason to believe are valid.</p> |
| | | |
| | | |
| | | <p>If, pursuant to or in connection with a single transaction or |
| | | arrangement, you convey, or propagate by procuring conveyance of, a |
| | | covered work, and grant a patent license to some of the parties |
| | | receiving the covered work authorizing them to use, propagate, modify |
| | | or convey a specific copy of the covered work, then the patent license |
| | | you grant is automatically extended to all recipients of the covered |
| | | work and works based on it.</p> |
| | | |
| | | <p>A patent license is “discriminatory” if it does not include within |
| | | the scope of its coverage, prohibits the exercise of, or is |
| | | conditioned on the non-exercise of one or more of the rights that are |
| | | specifically granted under this License. You may not convey a covered |
| | | work if you are a party to an arrangement with a third party that is |
| | | in the business of distributing software, under which you make payment |
| | | to the third party based on the extent of your activity of conveying |
| | | the work, and under which the third party grants, to any of the |
| | | parties who would receive the covered work from you, a discriminatory |
| | | patent license (a) in connection with copies of the covered work |
| | | conveyed by you (or copies made from those copies), or (b) primarily |
| | | for and in connection with specific products or compilations that |
| | | contain the covered work, unless you entered into that arrangement, |
| | | or that patent license was granted, prior to 28 March 2007.</p> |
| | | |
| | | <p>Nothing in this License shall be construed as excluding or limiting |
| | | any implied license or other defenses to infringement that may |
| | | otherwise be available to you under applicable patent law.</p> |
| | | |
| | | <h4><a name="section12"></a>12. No Surrender of Others' Freedom.</h4> |
| | | |
| | | <p>If conditions are imposed on you (whether by court order, agreement or |
| | | otherwise) that contradict the conditions of this License, they do not |
| | | excuse you from the conditions of this License. If you cannot convey a |
| | | covered work so as to satisfy simultaneously your obligations under this |
| | | License and any other pertinent obligations, then as a consequence you may |
| | | not convey it at all. For example, if you agree to terms that obligate you |
| | | to collect a royalty for further conveying from those to whom you convey |
| | | the Program, the only way you could satisfy both those terms and this |
| | | License would be to refrain entirely from conveying the Program.</p> |
| | | |
| | | <h4><a name="section13"></a>13. Use with the GNU Affero General Public License.</h4> |
| | | |
| | | <p>Notwithstanding any other provision of this License, you have |
| | | permission to link or combine any covered work with a work licensed |
| | | under version 3 of the GNU Affero General Public License into a single |
| | | combined work, and to convey the resulting work. The terms of this |
| | | License will continue to apply to the part which is the covered work, |
| | | but the special requirements of the GNU Affero General Public License, |
| | | section 13, concerning interaction through a network will apply to the |
| | | combination as such.</p> |
| | | |
| | | <h4><a name="section14"></a>14. Revised Versions of this License.</h4> |
| | | |
| | | <p>The Free Software Foundation may publish revised and/or new versions of |
| | | the GNU General Public License from time to time. Such new versions will |
| | | be similar in spirit to the present version, but may differ in detail to |
| | | address new problems or concerns.</p> |
| | | |
| | | <p>Each version is given a distinguishing version number. If the |
| | | Program specifies that a certain numbered version of the GNU General |
| | | Public License “or any later version” applies to it, you have the |
| | | option of following the terms and conditions either of that numbered |
| | | version or of any later version published by the Free Software |
| | | Foundation. If the Program does not specify a version number of the |
| | | GNU General Public License, you may choose any version ever published |
| | | by the Free Software Foundation.</p> |
| | | |
| | | <p>If the Program specifies that a proxy can decide which future |
| | | versions of the GNU General Public License can be used, that proxy's |
| | | public statement of acceptance of a version permanently authorizes you |
| | | to choose that version for the Program.</p> |
| | | |
| | | <p>Later license versions may give you additional or different |
| | | permissions. However, no additional obligations are imposed on any |
| | | author or copyright holder as a result of your choosing to follow a |
| | | later version.</p> |
| | | |
| | | <h4><a name="section15"></a>15. Disclaimer of Warranty.</h4> |
| | | |
| | | <p>THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY |
| | | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT |
| | | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM “AS IS” WITHOUT WARRANTY |
| | | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, |
| | | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR |
| | | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM |
| | | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF |
| | | ALL NECESSARY SERVICING, REPAIR OR CORRECTION.</p> |
| | | |
| | | <h4><a name="section16"></a>16. Limitation of Liability.</h4> |
| | | |
| | | <p>IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING |
| | | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS |
| | | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY |
| | | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE |
| | | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF |
| | | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD |
| | | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), |
| | | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF |
| | | SUCH DAMAGES.</p> |
| | | |
| | | <h4><a name="section17"></a>17. Interpretation of Sections 15 and 16.</h4> |
| | | |
| | | <p>If the disclaimer of warranty and limitation of liability provided |
| | | above cannot be given local legal effect according to their terms, |
| | | reviewing courts shall apply local law that most closely approximates |
| | | an absolute waiver of all civil liability in connection with the |
| | | Program, unless a warranty or assumption of liability accompanies a |
| | | copy of the Program in return for a fee.</p> |
| | | |
| | | <p>END OF TERMS AND CONDITIONS</p> |
| | | |
| | | <h3><a name="howto"></a>How to Apply These Terms to Your New Programs</h3> |
| | | |
| | | <p>If you develop a new program, and you want it to be of the greatest |
| | | possible use to the public, the best way to achieve this is to make it |
| | | free software which everyone can redistribute and change under these terms.</p> |
| | | |
| | | <p>To do so, attach the following notices to the program. It is safest |
| | | to attach them to the start of each source file to most effectively |
| | | state the exclusion of warranty; and each file should have at least |
| | | the “copyright” line and a pointer to where the full notice is found.</p> |
| | | |
| | | <pre> <one line to give the program's name and a brief idea of what it does.> |
| | | Copyright (C) <year> <name of author> |
| | | |
| | | This program is free software: you can redistribute it and/or modify |
| | | it under the terms of the GNU General Public License as published by |
| | | the Free Software Foundation, either version 3 of the License, or |
| | | (at your option) any later version. |
| | | |
| | | This program is distributed in the hope that it will be useful, |
| | | but WITHOUT ANY WARRANTY; without even the implied warranty of |
| | | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| | | GNU General Public License for more details. |
| | | |
| | | You should have received a copy of the GNU General Public License |
| | | along with this program. If not, see <http://www.gnu.org/licenses/>. |
| | | </pre> |
| | | |
| | | <p>Also add information on how to contact you by electronic and paper mail.</p> |
| | | |
| | | <p>If the program does terminal interaction, make it output a short |
| | | notice like this when it starts in an interactive mode:</p> |
| | | |
| | | <pre> <program> Copyright (C) <year> <name of author> |
| | | |
| | | This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. |
| | | This is free software, and you are welcome to redistribute it |
| | | under certain conditions; type `show c' for details. |
| | | </pre> |
| | | |
| | | <p>The hypothetical commands `show w' and `show c' should show the appropriate |
| | | parts of the General Public License. Of course, your program's commands |
| | | might be different; for a GUI interface, you would use an “about box”.</p> |
| | | |
| | | <p>You should also get your employer (if you work as a programmer) or school, |
| | | if any, to sign a “copyright disclaimer” for the program, if necessary. |
| | | For more information on this, and how to apply and follow the GNU GPL, see |
| | | <<a href="http://www.gnu.org/licenses/">http://www.gnu.org/licenses/</a>>.</p> |
| | | |
| | | <p>The GNU General Public License does not permit incorporating your program |
| | | into proprietary programs. If your program is a subroutine library, you |
| | | may consider it more useful to permit linking proprietary applications with |
| | | the library. If this is what you want to do, use the GNU Lesser General |
| | | Public License instead of this License. But first, please read |
| | | <<a href="http://www.gnu.org/philosophy/why-not-lgpl.html">http://www.gnu.org/philosophy/why-not-lgpl.html</a>>.</p> |
| | | |
| | | </div> |
New file |
| | |
| | | <?php |
| | | |
| | | /** |
| | | * Help Plugin |
| | | * |
| | | * @author Aleksander 'A.L.E.C' Machniak |
| | | * @license GNU GPLv3+ |
| | | * |
| | | * Configuration (see config.inc.php.dist) |
| | | * |
| | | **/ |
| | | |
| | | class help extends rcube_plugin |
| | | { |
| | | // all task excluding 'login' and 'logout' |
| | | public $task = '?(?!login|logout).*'; |
| | | // we've got no ajax handlers |
| | | public $noajax = true; |
| | | // skip frames |
| | | public $noframe = true; |
| | | |
| | | function init() |
| | | { |
| | | $rcmail = rcmail::get_instance(); |
| | | |
| | | $this->add_texts('localization/', false); |
| | | |
| | | // register task |
| | | $this->register_task('help'); |
| | | |
| | | // register actions |
| | | $this->register_action('index', array($this, 'action')); |
| | | $this->register_action('about', array($this, 'action')); |
| | | $this->register_action('license', array($this, 'action')); |
| | | |
| | | // add taskbar button |
| | | $this->add_button(array( |
| | | 'command' => 'help', |
| | | 'class' => 'button-help', |
| | | 'classsel' => 'button-help button-selected', |
| | | 'innerclass' => 'button-inner', |
| | | 'label' => 'help.help', |
| | | ), 'taskbar'); |
| | | |
| | | $skin = $rcmail->config->get('skin'); |
| | | if (!file_exists($this->home."/skins/$skin/help.css")) |
| | | $skin = 'default'; |
| | | |
| | | // add style for taskbar button (must be here) and Help UI |
| | | $this->include_stylesheet("skins/$skin/help.css"); |
| | | } |
| | | |
| | | function action() |
| | | { |
| | | $rcmail = rcmail::get_instance(); |
| | | |
| | | $this->load_config(); |
| | | |
| | | // register UI objects |
| | | $rcmail->output->add_handlers(array( |
| | | 'helpcontent' => array($this, 'content'), |
| | | )); |
| | | |
| | | if ($rcmail->action == 'about') |
| | | $rcmail->output->set_pagetitle($this->gettext('about')); |
| | | else if ($rcmail->action == 'license') |
| | | $rcmail->output->set_pagetitle($this->gettext('license')); |
| | | else |
| | | $rcmail->output->set_pagetitle($this->gettext('help')); |
| | | |
| | | $rcmail->output->send('help.help'); |
| | | } |
| | | |
| | | function content($attrib) |
| | | { |
| | | $rcmail = rcmail::get_instance(); |
| | | |
| | | if ($rcmail->action == 'about') { |
| | | return @file_get_contents($this->home.'/content/about.html'); |
| | | } |
| | | else if ($rcmail->action == 'license') { |
| | | return @file_get_contents($this->home.'/content/license.html'); |
| | | } |
| | | |
| | | // default content: iframe |
| | | if ($src = $rcmail->config->get('help_source')) |
| | | $attrib['src'] = $src; |
| | | |
| | | if (empty($attrib['id'])) |
| | | $attrib['id'] = 'rcmailhelpcontent'; |
| | | |
| | | $attrib['name'] = $attrib['id']; |
| | | |
| | | return html::tag('iframe', $attrib, '', array( |
| | | 'id', 'class', 'style', 'src', 'width', 'height', 'frameborder')); |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | <?php |
| | | |
| | | /* |
| | | |
| | | +-----------------------------------------------------------------------+ |
| | | | language/cs_CZ/labels.inc | |
| | | | | |
| | | | Language file of the Roundcube help plugin | |
| | | | Copyright (C) 2005-2009, The Roundcube Dev Team | |
| | | | Licensed under the GNU GPL | |
| | | | | |
| | | +-----------------------------------------------------------------------+ |
| | | | Author: Milan Kozak <hodza@hodza.net> | |
| | | +-----------------------------------------------------------------------+ |
| | | |
| | | @version $Id: labels.inc 2993 2009-09-26 18:32:07Z alec $ |
| | | |
| | | */ |
| | | |
| | | $labels = array(); |
| | | $labels['help'] = 'Nápověda'; |
| | | $labels['about'] = 'O aplikaci'; |
| | | $labels['license'] = 'Licence'; |
| | | |
| | | ?> |
New file |
| | |
| | | <?php |
| | | |
| | | $labels = array(); |
| | | $labels['help'] = 'Hjælp'; |
| | | $labels['about'] = 'Om'; |
| | | $labels['license'] = 'Licens'; |
| | | |
| | | ?> |
New file |
| | |
| | | <?php |
| | | // translation done by Ulli Heist - http://heist.hobby-site.org/ |
| | | $labels = array(); |
| | | $labels['help'] = 'Hilfe'; |
| | | $labels['about'] = 'Über'; |
| | | $labels['license'] = 'Lizenz'; |
| | | |
| | | ?> |
New file |
| | |
| | | <?php |
| | | |
| | | $labels = array(); |
| | | $labels['help'] = 'Help'; |
| | | $labels['about'] = 'About'; |
| | | $labels['license'] = 'License'; |
| | | |
| | | ?> |
New file |
| | |
| | | <?php |
| | | |
| | | $labels = array(); |
| | | $labels['help'] = 'Help'; |
| | | $labels['about'] = 'About'; |
| | | $labels['license'] = 'License'; |
| | | |
| | | ?> |
New file |
| | |
| | | <?php |
| | | |
| | | $labels = array(); |
| | | $labels['help'] = 'Ayuda'; |
| | | $labels['about'] = 'Acerca de'; |
| | | $labels['license'] = 'Licencia'; |
| | | |
| | | ?> |
New file |
| | |
| | | <?php |
| | | |
| | | $labels = array(); |
| | | $labels['help'] = 'Abi'; |
| | | $labels['about'] = 'Roundcube info'; |
| | | $labels['license'] = 'Litsents'; |
| | | |
| | | ?> |
New file |
| | |
| | | <?php |
| | | |
| | | $labels = array(); |
| | | $labels['help'] = 'Axuda'; |
| | | $labels['about'] = 'Acerca de'; |
| | | $labels['license'] = 'Licencia'; |
| | | |
| | | ?> |
New file |
| | |
| | | <?php |
| | | |
| | | $labels = array(); |
| | | $labels['help'] = 'Segítség'; |
| | | $labels['about'] = 'Névjegy'; |
| | | $labels['license'] = 'Licenc'; |
| | | |
| | | ?> |
New file |
| | |
| | | <?php |
| | | |
| | | // EN-Revision: 3891 |
| | | |
| | | $labels = array(); |
| | | $labels['help'] = 'ヘルプ'; |
| | | $labels['about'] = '紹介'; |
| | | $labels['license'] = 'ライセンス'; |
| | | |
| | | ?> |
New file |
| | |
| | | <?php |
| | | |
| | | $labels = array(); |
| | | $labels['help'] = 'Pomoc'; |
| | | $labels['about'] = 'O programie'; |
| | | $labels['license'] = 'Licencja'; |
| | | |
| | | ?> |
New file |
| | |
| | | <?php |
| | | |
| | | $labels = array(); |
| | | $labels['help'] = 'Ajuda'; |
| | | $labels['about'] = 'Sobre'; |
| | | $labels['license'] = 'Licença'; |
| | | |
| | | ?> |
New file |
| | |
| | | <?php |
| | | |
| | | /* |
| | | |
| | | +-----------------------------------------------------------------------+ |
| | | | plugins/help/localization/ru_RU.inc | |
| | | | | |
| | | | Language file of the Roundcube help plugin | |
| | | | Copyright (C) 2005-2010, The Roundcube Dev Team | |
| | | | Licensed under the GNU GPL | |
| | | | | |
| | | +-----------------------------------------------------------------------+ |
| | | | Author: Sergey Dukachev <iam@dukess.ru> | |
| | | +-----------------------------------------------------------------------+ |
| | | |
| | | */ |
| | | |
| | | $labels = array(); |
| | | $labels['help'] = 'Помощь'; |
| | | $labels['about'] = 'О программе'; |
| | | $labels['license'] = 'Лицензия'; |
| | | |
| | | ?> |
New file |
| | |
| | | <?php |
| | | |
| | | $labels = array(); |
| | | $labels['help'] = 'Hjälp'; |
| | | $labels['about'] = 'Om'; |
| | | $labels['license'] = 'Licens'; |
| | | |
| | | ?> |
New file |
| | |
| | | <?php |
| | | |
| | | $labels = array(); |
| | | $labels['help'] = '說明'; |
| | | $labels['about'] = '關於'; |
| | | $labels['license'] = '許可證'; |
| | | |
| | | ?> |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <package xmlns="http://pear.php.net/dtd/package-2.0" xmlns:tasks="http://pear.php.net/dtd/tasks-1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" packagerversion="1.9.0" version="2.0" xsi:schemaLocation="http://pear.php.net/dtd/tasks-1.0 |
| | | http://pear.php.net/dtd/tasks-1.0.xsd |
| | | http://pear.php.net/dtd/package-2.0 |
| | | http://pear.php.net/dtd/package-2.0.xsd"> |
| | | <name>help</name> |
| | | <channel>pear.roundcube.net</channel> |
| | | <summary>Help for Roundcube</summary> |
| | | <description>Plugin adds a new item (Help) in taskbar.</description> |
| | | <lead> |
| | | <name>Aleksander Machniak</name> |
| | | <user>alec</user> |
| | | <email>alec@alec.pl</email> |
| | | <active>yes</active> |
| | | </lead> |
| | | <date>2012-01-18</date> |
| | | <version> |
| | | <release>1.2</release> |
| | | <api>1.2</api> |
| | | </version> |
| | | <stability> |
| | | <release>stable</release> |
| | | <api>stable</api> |
| | | </stability> |
| | | <license uri="http://www.gnu.org/licenses/gpl.html">GNU GPLv3+</license> |
| | | <notes>-</notes> |
| | | <contents> |
| | | <dir baseinstalldir="/" name="/"> |
| | | <file name="help.php" role="php"> |
| | | <tasks:replace from="@name@" to="name" type="package-info"/> |
| | | <tasks:replace from="@package_version@" to="version" type="package-info"/> |
| | | </file> |
| | | <file name="content/about.html" role="data"></file> |
| | | <file name="content/license.html" role="data"></file> |
| | | <file name="config.inc.php.dist" role="data"></file> |
| | | <file name="skins/default/help.css" role="data"></file> |
| | | <file name="skins/default/help.gif" role="data"></file> |
| | | <file name="skins/default/templates/help.html" role="data"></file> |
| | | <file name="localization/cs_CZ.inc" role="data"></file> |
| | | <file name="localization/da_DK.inc" role="data"></file> |
| | | <file name="localization/de_DE.inc" role="data"></file> |
| | | <file name="localization/en_US.inc" role="data"></file> |
| | | <file name="localization/es_ES.inc" role="data"></file> |
| | | <file name="localization/et_EE.inc" role="data"></file> |
| | | <file name="localization/gl_ES.inc" role="data"></file> |
| | | <file name="localization/hu_HU.inc" role="data"></file> |
| | | <file name="localization/ja_JP.inc" role="data"></file> |
| | | <file name="localization/pl_PL.inc" role="data"></file> |
| | | <file name="localization/pt_BR.inc" role="data"></file> |
| | | <file name="localization/ru_RU.inc" role="data"></file> |
| | | <file name="localization/sv_SE.inc" role="data"></file> |
| | | <file name="localization/zh_TW.inc" role="data"></file> |
| | | </dir> |
| | | <!-- / --> |
| | | </contents> |
| | | <dependencies> |
| | | <required> |
| | | <php> |
| | | <min>5.2.1</min> |
| | | </php> |
| | | <pearinstaller> |
| | | <min>1.7.0</min> |
| | | </pearinstaller> |
| | | </required> |
| | | </dependencies> |
| | | <phprelease/> |
| | | </package> |
New file |
| | |
| | | /***** Roundcube|Mail Help task styles *****/ |
| | | |
| | | #taskbar a.button-help |
| | | { |
| | | background-image: url('help.gif'); |
| | | } |
| | | |
| | | .help-box |
| | | { |
| | | overflow: auto; |
| | | background-color: #F2F2F2; |
| | | } |
| | | |
| | | #helplicense, #helpabout |
| | | { |
| | | width: 46em; |
| | | padding: 1em 2em; |
| | | } |
| | | |
| | | #helplicense a, #helpabout a |
| | | { |
| | | color: #900; |
| | | } |
| | | |
| | | #helpabout |
| | | { |
| | | margin: 0 auto; |
| | | } |
| | | |
New file |
| | |
| | | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
| | | <html xmlns="http://www.w3.org/1999/xhtml"> |
| | | <head> |
| | | <title><roundcube:object name="pagetitle" /></title> |
| | | <roundcube:include file="/includes/links.html" /> |
| | | <link rel="stylesheet" type="text/css" href="/this/help.css" /> |
| | | <link rel="stylesheet" type="text/css" href="/settings.css" /> |
| | | <script type="text/javascript"> |
| | | function help_init_settings_tabs() |
| | | { |
| | | var action, tab = '#helptabdefault'; |
| | | if (window.rcmail && (action = rcmail.env.action)) { |
| | | tab = '#helptab' + (action ? action : 'default'); |
| | | } |
| | | $(tab).addClass('tablink-selected'); |
| | | } |
| | | </script> |
| | | </head> |
| | | <body> |
| | | |
| | | <roundcube:include file="/includes/taskbar.html" /> |
| | | <roundcube:include file="/includes/header.html" /> |
| | | |
| | | <div id="tabsbar"> |
| | | <span id="helptabdefault" class="tablink"><roundcube:button name="helpdefault" href="?_task=help" type="link" label="help.help" title="help.help" /></span> |
| | | <span id="helptababout" class="tablink"><roundcube:button name="helpabout" href="?_task=help&_action=about" type="link" label="help.about" title="help.about" class="tablink" /></span> |
| | | <span id="helptablicense" class="tablink"><roundcube:button name="helplicense" href="?_task=help&_action=license" type="link" label="help.license" title="help.license" class="tablink" /></span> |
| | | <roundcube:container name="helptabs" id="helptabsbar" /> |
| | | <script type="text/javascript"> if (window.rcmail) rcmail.add_onload(help_init_settings_tabs);</script> |
| | | </div> |
| | | |
| | | <div id="mainscreen" class="box help-box"> |
| | | <roundcube:object name="helpcontent" id="helpcontentframe" width="100%" height="100%" frameborder="0" src="/watermark.html" /> |
| | | </div> |
| | | |
| | | </body> |
| | | </html> |
New file |
| | |
| | | |
| | | #helpcontentframe { |
| | | border: 0; |
| | | border-radius: 4px; |
| | | } |
| | | |
| | | #mainscreen .readtext { |
| | | margin: 0 auto; |
| | | } |
| | | |
| | | #helptoolbar { |
| | | position: absolute; |
| | | top: -4px; |
| | | right: 0; |
| | | right: 0; |
| | | height: 40px; |
| | | white-space: nowrap; |
| | | } |
| | | |
| | | #taskbar a.button-help span.button-inner |
| | | { |
| | | background: url(help.png) 2px 0px no-repeat; |
| | | height: 19px; |
| | | } |
| | | |
| | | #taskbar a.button-help:hover span.button-inner, |
| | | #taskbar a.button-help.button-selected span.button-inner |
| | | { |
| | | background: url(help.png) 2px -24px no-repeat; |
| | | height: 19px; |
| | | } |
| | | |
| | | #helptoolbar a.button |
| | | { |
| | | height: 19px; |
| | | padding-top: 26px; |
| | | } |
| | | |
| | | .toolbar a.button.help |
| | | { |
| | | background: url(help.png) center -48px no-repeat; |
| | | } |
| | | |
| | | .toolbar a.button.about |
| | | { |
| | | background: url(help.png) center -48px no-repeat; |
| | | } |
| | | |
| | | .toolbar a.button.license |
| | | { |
| | | background: url(help.png) center -48px no-repeat; |
| | | } |
New file |
| | |
| | | <roundcube:object name="doctype" value="html5" /> |
| | | <html> |
| | | <head> |
| | | <title><roundcube:object name="pagetitle" /></title> |
| | | <roundcube:include file="/includes/links.html" /> |
| | | <link rel="stylesheet" type="text/css" href="/this/help.css" /> |
| | | </head> |
| | | <body> |
| | | |
| | | <roundcube:include file="/includes/header.html" /> |
| | | |
| | | <div id="mainscreen"> |
| | | |
| | | <div id="helptoolbar" class="toolbar"> |
| | | <roundcube:button name="helpdefault" href="?_task=help" type="link" label="help.help" title="help.help" class="button help" /> |
| | | <roundcube:button name="helpabout" href="?_task=help&_action=about" type="link" label="help.about" title="help.about" class="button about" /> |
| | | <roundcube:button name="helplicense" href="?_task=help&_action=license" type="link" label="help.license" title="help.license" class="button license" /> |
| | | <roundcube:container name="helptabs" id="helptabsbar" /> |
| | | </div> |
| | | |
| | | <div id="pluginbody" class="uibox offset scroller"> |
| | | <roundcube:object name="helpcontent" id="helpcontentframe" style="width:100%; height:99%" src="/watermark.html" /> |
| | | </div> |
| | | |
| | | </div> |
| | | |
| | | <roundcube:include file="/includes/footer.html" /> |
| | | |
| | | </body> |
| | | </html> |
New file |
| | |
| | | <?php |
| | | |
| | | /** |
| | | * HTTP Basic Authentication |
| | | * |
| | | * Make use of an existing HTTP authentication and perform login with the existing user credentials |
| | | * |
| | | * Configuration: |
| | | * // redirect the client to this URL after logout. This page is then responsible to clear HTTP auth |
| | | * $rcmail_config['logout_url'] = 'http://server.tld/logout.html'; |
| | | * |
| | | * See logout.html (in this directory) for an example how HTTP auth can be cleared. |
| | | * |
| | | * @version @package_version@ |
| | | * @license GNU GPLv3+ |
| | | * @author Thomas Bruederli |
| | | */ |
| | | class http_authentication extends rcube_plugin |
| | | { |
| | | public $task = 'login|logout'; |
| | | |
| | | function init() |
| | | { |
| | | $this->add_hook('startup', array($this, 'startup')); |
| | | $this->add_hook('authenticate', array($this, 'authenticate')); |
| | | $this->add_hook('logout_after', array($this, 'logout')); |
| | | } |
| | | |
| | | function startup($args) |
| | | { |
| | | // change action to login |
| | | if (empty($args['action']) && empty($_SESSION['user_id']) |
| | | && !empty($_SERVER['PHP_AUTH_USER']) && !empty($_SERVER['PHP_AUTH_PW'])) |
| | | $args['action'] = 'login'; |
| | | |
| | | return $args; |
| | | } |
| | | |
| | | function authenticate($args) |
| | | { |
| | | // Allow entering other user data in login form, |
| | | // e.g. after log out (#1487953) |
| | | if (!empty($args['user'])) { |
| | | return $args; |
| | | } |
| | | |
| | | if (!empty($_SERVER['PHP_AUTH_USER']) && !empty($_SERVER['PHP_AUTH_PW'])) { |
| | | $args['user'] = $_SERVER['PHP_AUTH_USER']; |
| | | $args['pass'] = $_SERVER['PHP_AUTH_PW']; |
| | | } |
| | | |
| | | $args['cookiecheck'] = false; |
| | | $args['valid'] = true; |
| | | |
| | | return $args; |
| | | } |
| | | |
| | | function logout($args) |
| | | { |
| | | // redirect to configured URL in order to clear HTTP auth credentials |
| | | if (!empty($_SERVER['PHP_AUTH_USER']) && $args['user'] == $_SERVER['PHP_AUTH_USER'] && ($url = rcmail::get_instance()->config->get('logout_url'))) { |
| | | header("Location: $url", true, 307); |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
New file |
| | |
| | | <!DOCTYPE html> |
| | | <html> |
| | | <head> |
| | | <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> |
| | | <title>Logout</title> |
| | | <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.6/jquery.min.js"></script> |
| | | <script type="text/javascript"> |
| | | |
| | | // as seen on http://stackoverflow.com/questions/31326/is-there-a-browser-equivalent-to-ies-clearauthenticationcache |
| | | $(document).ready(function(){ |
| | | if (document.all && document.execCommand) { |
| | | document.execCommand("ClearAuthenticationCache", "false"); |
| | | } |
| | | else { |
| | | $.ajax({ |
| | | url: location.href, |
| | | type: 'POST', |
| | | username: '__LOGOUT__', |
| | | password: '***********' |
| | | }); |
| | | } |
| | | }); |
| | | |
| | | </script> |
| | | </head> |
| | | <body> |
| | | <h1>You've successully been logged out!</h1> |
| | | |
| | | </body> |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <package xmlns="http://pear.php.net/dtd/package-2.0" xmlns:tasks="http://pear.php.net/dtd/tasks-1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" packagerversion="1.9.0" version="2.0" xsi:schemaLocation="http://pear.php.net/dtd/tasks-1.0 |
| | | http://pear.php.net/dtd/tasks-1.0.xsd |
| | | http://pear.php.net/dtd/package-2.0 |
| | | http://pear.php.net/dtd/package-2.0.xsd"> |
| | | <name>http_authentication</name> |
| | | <channel>pear.roundcube.net</channel> |
| | | <summary>HTTP Basic Authentication</summary> |
| | | <description>Make use of an existing HTTP authentication and perform login with the existing user credentials.</description> |
| | | <lead> |
| | | <name>Thomas Bruederli</name> |
| | | <user>thomasb</user> |
| | | <email>roundcube@gmail.com</email> |
| | | <active>yes</active> |
| | | </lead> |
| | | <date>2011-11-21</date> |
| | | <version> |
| | | <release>1.4</release> |
| | | <api>1.4</api> |
| | | </version> |
| | | <stability> |
| | | <release>stable</release> |
| | | <api>stable</api> |
| | | </stability> |
| | | <license uri="http://www.gnu.org/licenses/gpl.html">GNU GPLv3+</license> |
| | | <notes>-</notes> |
| | | <contents> |
| | | <dir baseinstalldir="/" name="/"> |
| | | <file name="http_authentication.php" role="php"> |
| | | <tasks:replace from="@name@" to="name" type="package-info"/> |
| | | <tasks:replace from="@package_version@" to="version" type="package-info"/> |
| | | </file> |
| | | <file name="logout.html" role="data"></file> |
| | | </dir> |
| | | <!-- / --> |
| | | </contents> |
| | | <dependencies> |
| | | <required> |
| | | <php> |
| | | <min>5.2.1</min> |
| | | </php> |
| | | <pearinstaller> |
| | | <min>1.7.0</min> |
| | | </pearinstaller> |
| | | </required> |
| | | </dependencies> |
| | | <phprelease/> |
| | | </package> |
New file |
| | |
| | | +-------------------------------------------------------------------------+ |
| | | | |
| | | | Author: Cor Bosman (roundcube@wa.ter.net) |
| | | | Plugin: jqueryui |
| | | | Version: 1.8.14 |
| | | | Purpose: Add jquery-ui to roundcube for every plugin to use |
| | | | |
| | | +-------------------------------------------------------------------------+ |
| | | |
| | | jqueryui adds the complete jquery-ui library including the smoothness |
| | | theme to roundcube. This allows other plugins to use jquery-ui without |
| | | having to load their own version. The benefit of using 1 central jquery-ui |
| | | is that we wont run into problems of conflicting jquery libraries being |
| | | loaded. All plugins that want to use jquery-ui should use this plugin as |
| | | a requirement. |
| | | |
| | | It is possible for plugin authors to override the default smoothness theme. |
| | | To do this, go to the jquery-ui website, and use the download feature to |
| | | download your own theme. In the advanced settings, provide a scope class to |
| | | your theme and add that class to all your UI elements. Finally, load the |
| | | downloaded css files in your own plugin. |
| | | |
| | | Some jquery-ui modules provide localization. One example is the datepicker module. |
| | | If you want to load localization for a specific module, then set up config.inc.php. |
| | | Check the config.inc.php.dist file on how to set this up for the datepicker module. |
| | | |
| | | As of version 1.8.6 this plugin also supports other themes. If you're a theme |
| | | developer and would like a different default theme to be used for your RC theme |
| | | then let me know and we can set things up. |
New file |
| | |
| | | <?php |
| | | |
| | | // if you want to load localization strings for specific sub-libraries of jquery-ui, configure them here |
| | | $rcmail_config['jquery_ui_i18n'] = array('datepicker'); |
| | | |
| | | // map Roundcube skins with jquery-ui themes here |
| | | $rcmail_config['jquery_ui_skin_map'] = array( |
| | | 'larry' => 'larry', |
| | | 'groupvice4' => 'redmond', |
| | | ); |
| | | |
| | | ?> |
New file |
| | |
| | | <?php |
| | | |
| | | /** |
| | | * jQuery UI |
| | | * |
| | | * Provide the jQuery UI library with according themes. |
| | | * |
| | | * @version 1.8.18 |
| | | * @author Cor Bosman <roundcube@wa.ter.net> |
| | | * @author Thomas Bruederli <roundcube@gmail.com> |
| | | */ |
| | | class jqueryui extends rcube_plugin |
| | | { |
| | | public $noajax = true; |
| | | |
| | | public function init() |
| | | { |
| | | $version = '1.8.18'; |
| | | |
| | | $rcmail = rcmail::get_instance(); |
| | | $this->load_config(); |
| | | |
| | | // include UI scripts |
| | | $this->include_script("js/jquery-ui-$version.custom.min.js"); |
| | | |
| | | // include UI stylesheet |
| | | $skin = $rcmail->config->get('skin', 'default'); |
| | | $ui_map = $rcmail->config->get('jquery_ui_skin_map', array()); |
| | | $ui_theme = $ui_map[$skin] ? $ui_map[$skin] : $skin; |
| | | |
| | | if (file_exists($this->home . "/themes/$ui_theme/jquery-ui-$version.custom.css")) { |
| | | $this->include_stylesheet("themes/$ui_theme/jquery-ui-$version.custom.css"); |
| | | } |
| | | else { |
| | | $this->include_stylesheet("themes/default/jquery-ui-$version.custom.css"); |
| | | } |
| | | |
| | | // jquery UI localization |
| | | $jquery_ui_i18n = $rcmail->config->get('jquery_ui_i18n', array('datepicker')); |
| | | if (count($jquery_ui_i18n) > 0) { |
| | | $lang_l = str_replace('_', '-', substr($_SESSION['language'], 0, 5)); |
| | | $lang_s = substr($_SESSION['language'], 0, 2); |
| | | foreach ($jquery_ui_i18n as $package) { |
| | | if (file_exists($this->home . "/js/i18n/jquery.ui.$package-$lang_l.js")) { |
| | | $this->include_script("js/i18n/jquery.ui.$package-$lang_l.js"); |
| | | } |
| | | else |
| | | if (file_exists($this->home . "/js/i18n/jquery.ui.$package-$lang_s.js")) { |
| | | $this->include_script("js/i18n/jquery.ui.$package-$lang_s.js"); |
| | | } |
| | | } |
| | | } |
| | | |
| | | // Date format for datepicker |
| | | $date_format = $rcmail->config->get('date_format', 'Y-m-d'); |
| | | $date_format = strtr($date_format, array( |
| | | 'y' => 'y', |
| | | 'Y' => 'yy', |
| | | 'm' => 'mm', |
| | | 'n' => 'm', |
| | | 'd' => 'dd', |
| | | 'j' => 'd', |
| | | )); |
| | | $rcmail->output->set_env('date_format', $date_format); |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | /* Afrikaans initialisation for the jQuery UI date picker plugin. */ |
| | | /* Written by Renier Pretorius. */ |
| | | jQuery(function($){ |
| | | $.datepicker.regional['af'] = { |
| | | closeText: 'Selekteer', |
| | | prevText: 'Vorige', |
| | | nextText: 'Volgende', |
| | | currentText: 'Vandag', |
| | | monthNames: ['Januarie','Februarie','Maart','April','Mei','Junie', |
| | | 'Julie','Augustus','September','Oktober','November','Desember'], |
| | | monthNamesShort: ['Jan', 'Feb', 'Mrt', 'Apr', 'Mei', 'Jun', |
| | | 'Jul', 'Aug', 'Sep', 'Okt', 'Nov', 'Des'], |
| | | dayNames: ['Sondag', 'Maandag', 'Dinsdag', 'Woensdag', 'Donderdag', 'Vrydag', 'Saterdag'], |
| | | dayNamesShort: ['Son', 'Maa', 'Din', 'Woe', 'Don', 'Vry', 'Sat'], |
| | | dayNamesMin: ['So','Ma','Di','Wo','Do','Vr','Sa'], |
| | | weekHeader: 'Wk', |
| | | dateFormat: 'dd/mm/yy', |
| | | firstDay: 1, |
| | | isRTL: false, |
| | | showMonthAfterYear: false, |
| | | yearSuffix: ''}; |
| | | $.datepicker.setDefaults($.datepicker.regional['af']); |
| | | }); |
| | | /* Arabic Translation for jQuery UI date picker plugin. */ |
| | | /* Khaled Al Horani -- koko.dw@gmail.com */ |
| | | /* خالد الحوراني -- koko.dw@gmail.com */ |
| | | /* NOTE: monthNames are the original months names and they are the Arabic names, not the new months name فبراير - يناير and there isn't any Arabic roots for these months */ |
| | | jQuery(function($){ |
| | | $.datepicker.regional['ar'] = { |
| | | closeText: 'إغلاق', |
| | | prevText: '<السابق', |
| | | nextText: 'التالي>', |
| | | currentText: 'اليوم', |
| | | monthNames: ['كانون الثاني', 'شباط', 'آذار', 'نيسان', 'آذار', 'حزيران', |
| | | 'تموز', 'آب', 'أيلول', 'تشرين الأول', 'تشرين الثاني', 'كانون الأول'], |
| | | monthNamesShort: ['1','2','3','4','5','6','7','8','9','10','11','12'], |
| | | dayNames: ['السبت', 'الأحد', 'الاثنين', 'الثلاثاء', 'الأربعاء', 'الخميس', 'الجمعة'], |
| | | dayNamesShort: ['سبت', 'أحد', 'اثنين', 'ثلاثاء', 'أربعاء', 'خميس', 'جمعة'], |
| | | dayNamesMin: ['سبت', 'أحد', 'اثنين', 'ثلاثاء', 'أربعاء', 'خميس', 'جمعة'], |
| | | weekHeader: 'أسبوع', |
| | | dateFormat: 'dd/mm/yy', |
| | | firstDay: 0, |
| | | isRTL: true, |
| | | showMonthAfterYear: false, |
| | | yearSuffix: ''}; |
| | | $.datepicker.setDefaults($.datepicker.regional['ar']); |
| | | });/* Azerbaijani (UTF-8) initialisation for the jQuery UI date picker plugin. */ |
| | | /* Written by Jamil Najafov (necefov33@gmail.com). */ |
| | | jQuery(function($) { |
| | | $.datepicker.regional['az'] = { |
| | | closeText: 'Bağla', |
| | | prevText: '<Geri', |
| | | nextText: 'İrəli>', |
| | | currentText: 'Bugün', |
| | | monthNames: ['Yanvar','Fevral','Mart','Aprel','May','İyun', |
| | | 'İyul','Avqust','Sentyabr','Oktyabr','Noyabr','Dekabr'], |
| | | monthNamesShort: ['Yan','Fev','Mar','Apr','May','İyun', |
| | | 'İyul','Avq','Sen','Okt','Noy','Dek'], |
| | | dayNames: ['Bazar','Bazar ertəsi','Çərşənbə axşamı','Çərşənbə','Cümə axşamı','Cümə','Şənbə'], |
| | | dayNamesShort: ['B','Be','Ça','Ç','Ca','C','Ş'], |
| | | dayNamesMin: ['B','B','Ç','С','Ç','C','Ş'], |
| | | weekHeader: 'Hf', |
| | | dateFormat: 'dd.mm.yy', |
| | | firstDay: 1, |
| | | isRTL: false, |
| | | showMonthAfterYear: false, |
| | | yearSuffix: ''}; |
| | | $.datepicker.setDefaults($.datepicker.regional['az']); |
| | | });/* Bulgarian initialisation for the jQuery UI date picker plugin. */ |
| | | /* Written by Stoyan Kyosev (http://svest.org). */ |
| | | jQuery(function($){ |
| | | $.datepicker.regional['bg'] = { |
| | | closeText: 'затвори', |
| | | prevText: '<назад', |
| | | nextText: 'напред>', |
| | | nextBigText: '>>', |
| | | currentText: 'днес', |
| | | monthNames: ['Януари','Февруари','Март','Април','Май','Юни', |
| | | 'Юли','Август','Септември','Октомври','Ноември','Декември'], |
| | | monthNamesShort: ['Яну','Фев','Мар','Апр','Май','Юни', |
| | | 'Юли','Авг','Сеп','Окт','Нов','Дек'], |
| | | dayNames: ['Неделя','Понеделник','Вторник','Сряда','Четвъртък','Петък','Събота'], |
| | | dayNamesShort: ['Нед','Пон','Вто','Сря','Чет','Пет','Съб'], |
| | | dayNamesMin: ['Не','По','Вт','Ср','Че','Пе','Съ'], |
| | | weekHeader: 'Wk', |
| | | dateFormat: 'dd.mm.yy', |
| | | firstDay: 1, |
| | | isRTL: false, |
| | | showMonthAfterYear: false, |
| | | yearSuffix: ''}; |
| | | $.datepicker.setDefaults($.datepicker.regional['bg']); |
| | | }); |
| | | /* Bosnian i18n for the jQuery UI date picker plugin. */ |
| | | /* Written by Kenan Konjo. */ |
| | | jQuery(function($){ |
| | | $.datepicker.regional['bs'] = { |
| | | closeText: 'Zatvori', |
| | | prevText: '<', |
| | | nextText: '>', |
| | | currentText: 'Danas', |
| | | monthNames: ['Januar','Februar','Mart','April','Maj','Juni', |
| | | 'Juli','August','Septembar','Oktobar','Novembar','Decembar'], |
| | | monthNamesShort: ['Jan','Feb','Mar','Apr','Maj','Jun', |
| | | 'Jul','Aug','Sep','Okt','Nov','Dec'], |
| | | dayNames: ['Nedelja','Ponedeljak','Utorak','Srijeda','Četvrtak','Petak','Subota'], |
| | | dayNamesShort: ['Ned','Pon','Uto','Sri','Čet','Pet','Sub'], |
| | | dayNamesMin: ['Ne','Po','Ut','Sr','Če','Pe','Su'], |
| | | weekHeader: 'Wk', |
| | | dateFormat: 'dd.mm.yy', |
| | | firstDay: 1, |
| | | isRTL: false, |
| | | showMonthAfterYear: false, |
| | | yearSuffix: ''}; |
| | | $.datepicker.setDefaults($.datepicker.regional['bs']); |
| | | });/* Inicialització en català per a l'extenció 'calendar' per jQuery. */ |
| | | /* Writers: (joan.leon@gmail.com). */ |
| | | jQuery(function($){ |
| | | $.datepicker.regional['ca'] = { |
| | | closeText: 'Tancar', |
| | | prevText: '<Ant', |
| | | nextText: 'Seg>', |
| | | currentText: 'Avui', |
| | | monthNames: ['Gener','Febrer','Març','Abril','Maig','Juny', |
| | | 'Juliol','Agost','Setembre','Octubre','Novembre','Desembre'], |
| | | monthNamesShort: ['Gen','Feb','Mar','Abr','Mai','Jun', |
| | | 'Jul','Ago','Set','Oct','Nov','Des'], |
| | | dayNames: ['Diumenge','Dilluns','Dimarts','Dimecres','Dijous','Divendres','Dissabte'], |
| | | dayNamesShort: ['Dug','Dln','Dmt','Dmc','Djs','Dvn','Dsb'], |
| | | dayNamesMin: ['Dg','Dl','Dt','Dc','Dj','Dv','Ds'], |
| | | weekHeader: 'Sm', |
| | | dateFormat: 'dd/mm/yy', |
| | | firstDay: 1, |
| | | isRTL: false, |
| | | showMonthAfterYear: false, |
| | | yearSuffix: ''}; |
| | | $.datepicker.setDefaults($.datepicker.regional['ca']); |
| | | });/* Czech initialisation for the jQuery UI date picker plugin. */ |
| | | /* Written by Tomas Muller (tomas@tomas-muller.net). */ |
| | | jQuery(function($){ |
| | | $.datepicker.regional['cs'] = { |
| | | closeText: 'Zavřít', |
| | | prevText: '<Dříve', |
| | | nextText: 'Později>', |
| | | currentText: 'Nyní', |
| | | monthNames: ['leden','únor','březen','duben','květen','červen', |
| | | 'červenec','srpen','září','říjen','listopad','prosinec'], |
| | | monthNamesShort: ['led','úno','bře','dub','kvě','čer', |
| | | 'čvc','srp','zář','říj','lis','pro'], |
| | | dayNames: ['neděle', 'pondělí', 'úterý', 'středa', 'čtvrtek', 'pátek', 'sobota'], |
| | | dayNamesShort: ['ne', 'po', 'út', 'st', 'čt', 'pá', 'so'], |
| | | dayNamesMin: ['ne','po','út','st','čt','pá','so'], |
| | | weekHeader: 'Týd', |
| | | dateFormat: 'dd.mm.yy', |
| | | firstDay: 1, |
| | | isRTL: false, |
| | | showMonthAfterYear: false, |
| | | yearSuffix: ''}; |
| | | $.datepicker.setDefaults($.datepicker.regional['cs']); |
| | | }); |
| | | /* Danish initialisation for the jQuery UI date picker plugin. */ |
| | | /* Written by Jan Christensen ( deletestuff@gmail.com). */ |
| | | jQuery(function($){ |
| | | $.datepicker.regional['da'] = { |
| | | closeText: 'Luk', |
| | | prevText: '<Forrige', |
| | | nextText: 'Næste>', |
| | | currentText: 'Idag', |
| | | monthNames: ['Januar','Februar','Marts','April','Maj','Juni', |
| | | 'Juli','August','September','Oktober','November','December'], |
| | | monthNamesShort: ['Jan','Feb','Mar','Apr','Maj','Jun', |
| | | 'Jul','Aug','Sep','Okt','Nov','Dec'], |
| | | dayNames: ['Søndag','Mandag','Tirsdag','Onsdag','Torsdag','Fredag','Lørdag'], |
| | | dayNamesShort: ['Søn','Man','Tir','Ons','Tor','Fre','Lør'], |
| | | dayNamesMin: ['Sø','Ma','Ti','On','To','Fr','Lø'], |
| | | weekHeader: 'Uge', |
| | | dateFormat: 'dd-mm-yy', |
| | | firstDay: 1, |
| | | isRTL: false, |
| | | showMonthAfterYear: false, |
| | | yearSuffix: ''}; |
| | | $.datepicker.setDefaults($.datepicker.regional['da']); |
| | | }); |
| | | /* German initialisation for the jQuery UI date picker plugin. */ |
| | | /* Written by Milian Wolff (mail@milianw.de). */ |
| | | jQuery(function($){ |
| | | $.datepicker.regional['de'] = { |
| | | closeText: 'schließen', |
| | | prevText: '<zurück', |
| | | nextText: 'Vor>', |
| | | currentText: 'heute', |
| | | monthNames: ['Januar','Februar','März','April','Mai','Juni', |
| | | 'Juli','August','September','Oktober','November','Dezember'], |
| | | monthNamesShort: ['Jan','Feb','Mär','Apr','Mai','Jun', |
| | | 'Jul','Aug','Sep','Okt','Nov','Dez'], |
| | | dayNames: ['Sonntag','Montag','Dienstag','Mittwoch','Donnerstag','Freitag','Samstag'], |
| | | dayNamesShort: ['So','Mo','Di','Mi','Do','Fr','Sa'], |
| | | dayNamesMin: ['So','Mo','Di','Mi','Do','Fr','Sa'], |
| | | weekHeader: 'Wo', |
| | | dateFormat: 'dd.mm.yy', |
| | | firstDay: 1, |
| | | isRTL: false, |
| | | showMonthAfterYear: false, |
| | | yearSuffix: ''}; |
| | | $.datepicker.setDefaults($.datepicker.regional['de']); |
| | | }); |
| | | /* Greek (el) initialisation for the jQuery UI date picker plugin. */ |
| | | /* Written by Alex Cicovic (http://www.alexcicovic.com) */ |
| | | jQuery(function($){ |
| | | $.datepicker.regional['el'] = { |
| | | closeText: 'Κλείσιμο', |
| | | prevText: 'Προηγούμενος', |
| | | nextText: 'Επόμενος', |
| | | currentText: 'Τρέχων Μήνας', |
| | | monthNames: ['Ιανουάριος','Φεβρουάριος','Μάρτιος','Απρίλιος','Μάιος','Ιούνιος', |
| | | 'Ιούλιος','Αύγουστος','Σεπτέμβριος','Οκτώβριος','Νοέμβριος','Δεκέμβριος'], |
| | | monthNamesShort: ['Ιαν','Φεβ','Μαρ','Απρ','Μαι','Ιουν', |
| | | 'Ιουλ','Αυγ','Σεπ','Οκτ','Νοε','Δεκ'], |
| | | dayNames: ['Κυριακή','Δευτέρα','Τρίτη','Τετάρτη','Πέμπτη','Παρασκευή','Σάββατο'], |
| | | dayNamesShort: ['Κυρ','Δευ','Τρι','Τετ','Πεμ','Παρ','Σαβ'], |
| | | dayNamesMin: ['Κυ','Δε','Τρ','Τε','Πε','Πα','Σα'], |
| | | weekHeader: 'Εβδ', |
| | | dateFormat: 'dd/mm/yy', |
| | | firstDay: 1, |
| | | isRTL: false, |
| | | showMonthAfterYear: false, |
| | | yearSuffix: ''}; |
| | | $.datepicker.setDefaults($.datepicker.regional['el']); |
| | | });/* English/UK initialisation for the jQuery UI date picker plugin. */ |
| | | /* Written by Stuart. */ |
| | | jQuery(function($){ |
| | | $.datepicker.regional['en-GB'] = { |
| | | closeText: 'Done', |
| | | prevText: 'Prev', |
| | | nextText: 'Next', |
| | | currentText: 'Today', |
| | | monthNames: ['January','February','March','April','May','June', |
| | | 'July','August','September','October','November','December'], |
| | | monthNamesShort: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', |
| | | 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'], |
| | | dayNames: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'], |
| | | dayNamesShort: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'], |
| | | dayNamesMin: ['Su','Mo','Tu','We','Th','Fr','Sa'], |
| | | weekHeader: 'Wk', |
| | | dateFormat: 'dd/mm/yy', |
| | | firstDay: 1, |
| | | isRTL: false, |
| | | showMonthAfterYear: false, |
| | | yearSuffix: ''}; |
| | | $.datepicker.setDefaults($.datepicker.regional['en-GB']); |
| | | }); |
| | | /* Esperanto initialisation for the jQuery UI date picker plugin. */ |
| | | /* Written by Olivier M. (olivierweb@ifrance.com). */ |
| | | jQuery(function($){ |
| | | $.datepicker.regional['eo'] = { |
| | | closeText: 'Fermi', |
| | | prevText: '<Anta', |
| | | nextText: 'Sekv>', |
| | | currentText: 'Nuna', |
| | | monthNames: ['Januaro','Februaro','Marto','Aprilo','Majo','Junio', |
| | | 'Julio','Aŭgusto','Septembro','Oktobro','Novembro','Decembro'], |
| | | monthNamesShort: ['Jan','Feb','Mar','Apr','Maj','Jun', |
| | | 'Jul','Aŭg','Sep','Okt','Nov','Dec'], |
| | | dayNames: ['Dimanĉo','Lundo','Mardo','Merkredo','Ĵaŭdo','Vendredo','Sabato'], |
| | | dayNamesShort: ['Dim','Lun','Mar','Mer','Ĵaŭ','Ven','Sab'], |
| | | dayNamesMin: ['Di','Lu','Ma','Me','Ĵa','Ve','Sa'], |
| | | weekHeader: 'Sb', |
| | | dateFormat: 'dd/mm/yy', |
| | | firstDay: 0, |
| | | isRTL: false, |
| | | showMonthAfterYear: false, |
| | | yearSuffix: ''}; |
| | | $.datepicker.setDefaults($.datepicker.regional['eo']); |
| | | }); |
| | | /* Inicialización en español para la extensión 'UI date picker' para jQuery. */ |
| | | /* Traducido por Vester (xvester@gmail.com). */ |
| | | jQuery(function($){ |
| | | $.datepicker.regional['es'] = { |
| | | closeText: 'Cerrar', |
| | | prevText: '<Ant', |
| | | nextText: 'Sig>', |
| | | currentText: 'Hoy', |
| | | monthNames: ['Enero','Febrero','Marzo','Abril','Mayo','Junio', |
| | | 'Julio','Agosto','Septiembre','Octubre','Noviembre','Diciembre'], |
| | | monthNamesShort: ['Ene','Feb','Mar','Abr','May','Jun', |
| | | 'Jul','Ago','Sep','Oct','Nov','Dic'], |
| | | dayNames: ['Domingo','Lunes','Martes','Miércoles','Jueves','Viernes','Sábado'], |
| | | dayNamesShort: ['Dom','Lun','Mar','Mié','Juv','Vie','Sáb'], |
| | | dayNamesMin: ['Do','Lu','Ma','Mi','Ju','Vi','Sá'], |
| | | weekHeader: 'Sm', |
| | | dateFormat: 'dd/mm/yy', |
| | | firstDay: 1, |
| | | isRTL: false, |
| | | showMonthAfterYear: false, |
| | | yearSuffix: ''}; |
| | | $.datepicker.setDefaults($.datepicker.regional['es']); |
| | | });/* Estonian initialisation for the jQuery UI date picker plugin. */ |
| | | /* Written by Mart Sõmermaa (mrts.pydev at gmail com). */ |
| | | jQuery(function($){ |
| | | $.datepicker.regional['et'] = { |
| | | closeText: 'Sulge', |
| | | prevText: 'Eelnev', |
| | | nextText: 'Järgnev', |
| | | currentText: 'Täna', |
| | | monthNames: ['Jaanuar','Veebruar','Märts','Aprill','Mai','Juuni', |
| | | 'Juuli','August','September','Oktoober','November','Detsember'], |
| | | monthNamesShort: ['Jaan', 'Veebr', 'Märts', 'Apr', 'Mai', 'Juuni', |
| | | 'Juuli', 'Aug', 'Sept', 'Okt', 'Nov', 'Dets'], |
| | | dayNames: ['Pühapäev', 'Esmaspäev', 'Teisipäev', 'Kolmapäev', 'Neljapäev', 'Reede', 'Laupäev'], |
| | | dayNamesShort: ['Pühap', 'Esmasp', 'Teisip', 'Kolmap', 'Neljap', 'Reede', 'Laup'], |
| | | dayNamesMin: ['P','E','T','K','N','R','L'], |
| | | weekHeader: 'Sm', |
| | | dateFormat: 'dd.mm.yy', |
| | | firstDay: 1, |
| | | isRTL: false, |
| | | showMonthAfterYear: false, |
| | | yearSuffix: ''}; |
| | | $.datepicker.setDefaults($.datepicker.regional['et']); |
| | | }); /* Euskarako oinarria 'UI date picker' jquery-ko extentsioarentzat */ |
| | | /* Karrikas-ek itzulia (karrikas@karrikas.com) */ |
| | | jQuery(function($){ |
| | | $.datepicker.regional['eu'] = { |
| | | closeText: 'Egina', |
| | | prevText: '<Aur', |
| | | nextText: 'Hur>', |
| | | currentText: 'Gaur', |
| | | monthNames: ['Urtarrila','Otsaila','Martxoa','Apirila','Maiatza','Ekaina', |
| | | 'Uztaila','Abuztua','Iraila','Urria','Azaroa','Abendua'], |
| | | monthNamesShort: ['Urt','Ots','Mar','Api','Mai','Eka', |
| | | 'Uzt','Abu','Ira','Urr','Aza','Abe'], |
| | | dayNames: ['Igandea','Astelehena','Asteartea','Asteazkena','Osteguna','Ostirala','Larunbata'], |
| | | dayNamesShort: ['Iga','Ast','Ast','Ast','Ost','Ost','Lar'], |
| | | dayNamesMin: ['Ig','As','As','As','Os','Os','La'], |
| | | weekHeader: 'Wk', |
| | | dateFormat: 'yy/mm/dd', |
| | | firstDay: 1, |
| | | isRTL: false, |
| | | showMonthAfterYear: false, |
| | | yearSuffix: ''}; |
| | | $.datepicker.setDefaults($.datepicker.regional['eu']); |
| | | });/* Persian (Farsi) Translation for the jQuery UI date picker plugin. */ |
| | | /* Javad Mowlanezhad -- jmowla@gmail.com */ |
| | | /* Jalali calendar should supported soon! (Its implemented but I have to test it) */ |
| | | jQuery(function($) { |
| | | $.datepicker.regional['fa'] = { |
| | | closeText: 'بستن', |
| | | prevText: '<قبلي', |
| | | nextText: 'بعدي>', |
| | | currentText: 'امروز', |
| | | monthNames: ['فروردين','ارديبهشت','خرداد','تير','مرداد','شهريور', |
| | | 'مهر','آبان','آذر','دي','بهمن','اسفند'], |
| | | monthNamesShort: ['1','2','3','4','5','6','7','8','9','10','11','12'], |
| | | dayNames: ['يکشنبه','دوشنبه','سهشنبه','چهارشنبه','پنجشنبه','جمعه','شنبه'], |
| | | dayNamesShort: ['ي','د','س','چ','پ','ج', 'ش'], |
| | | dayNamesMin: ['ي','د','س','چ','پ','ج', 'ش'], |
| | | weekHeader: 'هف', |
| | | dateFormat: 'yy/mm/dd', |
| | | firstDay: 6, |
| | | isRTL: true, |
| | | showMonthAfterYear: false, |
| | | yearSuffix: ''}; |
| | | $.datepicker.setDefaults($.datepicker.regional['fa']); |
| | | });/* Finnish initialisation for the jQuery UI date picker plugin. */ |
| | | /* Written by Harri Kilpi� (harrikilpio@gmail.com). */ |
| | | jQuery(function($){ |
| | | $.datepicker.regional['fi'] = { |
| | | closeText: 'Sulje', |
| | | prevText: '«Edellinen', |
| | | nextText: 'Seuraava»', |
| | | currentText: 'Tänään', |
| | | monthNames: ['Tammikuu','Helmikuu','Maaliskuu','Huhtikuu','Toukokuu','Kesäkuu', |
| | | 'Heinäkuu','Elokuu','Syyskuu','Lokakuu','Marraskuu','Joulukuu'], |
| | | monthNamesShort: ['Tammi','Helmi','Maalis','Huhti','Touko','Kesä', |
| | | 'Heinä','Elo','Syys','Loka','Marras','Joulu'], |
| | | dayNamesShort: ['Su','Ma','Ti','Ke','To','Pe','Su'], |
| | | dayNames: ['Sunnuntai','Maanantai','Tiistai','Keskiviikko','Torstai','Perjantai','Lauantai'], |
| | | dayNamesMin: ['Su','Ma','Ti','Ke','To','Pe','La'], |
| | | weekHeader: 'Vk', |
| | | dateFormat: 'dd.mm.yy', |
| | | firstDay: 1, |
| | | isRTL: false, |
| | | showMonthAfterYear: false, |
| | | yearSuffix: ''}; |
| | | $.datepicker.setDefaults($.datepicker.regional['fi']); |
| | | }); |
| | | /* Faroese initialisation for the jQuery UI date picker plugin */ |
| | | /* Written by Sverri Mohr Olsen, sverrimo@gmail.com */ |
| | | jQuery(function($){ |
| | | $.datepicker.regional['fo'] = { |
| | | closeText: 'Lat aftur', |
| | | prevText: '<Fyrra', |
| | | nextText: 'Næsta>', |
| | | currentText: 'Í dag', |
| | | monthNames: ['Januar','Februar','Mars','Apríl','Mei','Juni', |
| | | 'Juli','August','September','Oktober','November','Desember'], |
| | | monthNamesShort: ['Jan','Feb','Mar','Apr','Mei','Jun', |
| | | 'Jul','Aug','Sep','Okt','Nov','Des'], |
| | | dayNames: ['Sunnudagur','Mánadagur','Týsdagur','Mikudagur','Hósdagur','Fríggjadagur','Leyardagur'], |
| | | dayNamesShort: ['Sun','Mán','Týs','Mik','Hós','Frí','Ley'], |
| | | dayNamesMin: ['Su','Má','Tý','Mi','Hó','Fr','Le'], |
| | | weekHeader: 'Vk', |
| | | dateFormat: 'dd-mm-yy', |
| | | firstDay: 0, |
| | | isRTL: false, |
| | | showMonthAfterYear: false, |
| | | yearSuffix: ''}; |
| | | $.datepicker.setDefaults($.datepicker.regional['fo']); |
| | | }); |
| | | /* Swiss-French initialisation for the jQuery UI date picker plugin. */ |
| | | /* Written Martin Voelkle (martin.voelkle@e-tc.ch). */ |
| | | jQuery(function($){ |
| | | $.datepicker.regional['fr-CH'] = { |
| | | closeText: 'Fermer', |
| | | prevText: '<Préc', |
| | | nextText: 'Suiv>', |
| | | currentText: 'Courant', |
| | | monthNames: ['Janvier','Février','Mars','Avril','Mai','Juin', |
| | | 'Juillet','Août','Septembre','Octobre','Novembre','Décembre'], |
| | | monthNamesShort: ['Jan','Fév','Mar','Avr','Mai','Jun', |
| | | 'Jul','Aoû','Sep','Oct','Nov','Déc'], |
| | | dayNames: ['Dimanche','Lundi','Mardi','Mercredi','Jeudi','Vendredi','Samedi'], |
| | | dayNamesShort: ['Dim','Lun','Mar','Mer','Jeu','Ven','Sam'], |
| | | dayNamesMin: ['Di','Lu','Ma','Me','Je','Ve','Sa'], |
| | | weekHeader: 'Sm', |
| | | dateFormat: 'dd.mm.yy', |
| | | firstDay: 1, |
| | | isRTL: false, |
| | | showMonthAfterYear: false, |
| | | yearSuffix: ''}; |
| | | $.datepicker.setDefaults($.datepicker.regional['fr-CH']); |
| | | });/* French initialisation for the jQuery UI date picker plugin. */ |
| | | /* Written by Keith Wood (kbwood{at}iinet.com.au) and Stéphane Nahmani (sholby@sholby.net). */ |
| | | jQuery(function($){ |
| | | $.datepicker.regional['fr'] = { |
| | | closeText: 'Fermer', |
| | | prevText: '<Préc', |
| | | nextText: 'Suiv>', |
| | | currentText: 'Courant', |
| | | monthNames: ['Janvier','Février','Mars','Avril','Mai','Juin', |
| | | 'Juillet','Août','Septembre','Octobre','Novembre','Décembre'], |
| | | monthNamesShort: ['Jan','Fév','Mar','Avr','Mai','Jun', |
| | | 'Jul','Aoû','Sep','Oct','Nov','Déc'], |
| | | dayNames: ['Dimanche','Lundi','Mardi','Mercredi','Jeudi','Vendredi','Samedi'], |
| | | dayNamesShort: ['Dim','Lun','Mar','Mer','Jeu','Ven','Sam'], |
| | | dayNamesMin: ['Di','Lu','Ma','Me','Je','Ve','Sa'], |
| | | weekHeader: 'Sm', |
| | | dateFormat: 'dd/mm/yy', |
| | | firstDay: 1, |
| | | isRTL: false, |
| | | showMonthAfterYear: false, |
| | | yearSuffix: ''}; |
| | | $.datepicker.setDefaults($.datepicker.regional['fr']); |
| | | });/* Galician localization for 'UI date picker' jQuery extension. */ |
| | | /* Translated by Jorge Barreiro <yortx.barry@gmail.com>. */ |
| | | jQuery(function($){ |
| | | $.datepicker.regional['gl'] = { |
| | | closeText: 'Pechar', |
| | | prevText: '<Ant', |
| | | nextText: 'Seg>', |
| | | currentText: 'Hoxe', |
| | | monthNames: ['Xaneiro','Febreiro','Marzo','Abril','Maio','Xuño', |
| | | 'Xullo','Agosto','Setembro','Outubro','Novembro','Decembro'], |
| | | monthNamesShort: ['Xan','Feb','Mar','Abr','Mai','Xuñ', |
| | | 'Xul','Ago','Set','Out','Nov','Dec'], |
| | | dayNames: ['Domingo','Luns','Martes','Mércores','Xoves','Venres','Sábado'], |
| | | dayNamesShort: ['Dom','Lun','Mar','Mér','Xov','Ven','Sáb'], |
| | | dayNamesMin: ['Do','Lu','Ma','Mé','Xo','Ve','Sá'], |
| | | weekHeader: 'Sm', |
| | | dateFormat: 'dd/mm/yy', |
| | | firstDay: 1, |
| | | isRTL: false, |
| | | showMonthAfterYear: false, |
| | | yearSuffix: ''}; |
| | | $.datepicker.setDefaults($.datepicker.regional['gl']); |
| | | });/* Hebrew initialisation for the UI Datepicker extension. */ |
| | | /* Written by Amir Hardon (ahardon at gmail dot com). */ |
| | | jQuery(function($){ |
| | | $.datepicker.regional['he'] = { |
| | | closeText: 'סגור', |
| | | prevText: '<הקודם', |
| | | nextText: 'הבא>', |
| | | currentText: 'היום', |
| | | monthNames: ['ינואר','פברואר','מרץ','אפריל','מאי','יוני', |
| | | 'יולי','אוגוסט','ספטמבר','אוקטובר','נובמבר','דצמבר'], |
| | | monthNamesShort: ['1','2','3','4','5','6', |
| | | '7','8','9','10','11','12'], |
| | | dayNames: ['ראשון','שני','שלישי','רביעי','חמישי','שישי','שבת'], |
| | | dayNamesShort: ['א\'','ב\'','ג\'','ד\'','ה\'','ו\'','שבת'], |
| | | dayNamesMin: ['א\'','ב\'','ג\'','ד\'','ה\'','ו\'','שבת'], |
| | | weekHeader: 'Wk', |
| | | dateFormat: 'dd/mm/yy', |
| | | firstDay: 0, |
| | | isRTL: true, |
| | | showMonthAfterYear: false, |
| | | yearSuffix: ''}; |
| | | $.datepicker.setDefaults($.datepicker.regional['he']); |
| | | }); |
| | | /* Croatian i18n for the jQuery UI date picker plugin. */ |
| | | /* Written by Vjekoslav Nesek. */ |
| | | jQuery(function($){ |
| | | $.datepicker.regional['hr'] = { |
| | | closeText: 'Zatvori', |
| | | prevText: '<', |
| | | nextText: '>', |
| | | currentText: 'Danas', |
| | | monthNames: ['Siječanj','Veljača','Ožujak','Travanj','Svibanj','Lipanj', |
| | | 'Srpanj','Kolovoz','Rujan','Listopad','Studeni','Prosinac'], |
| | | monthNamesShort: ['Sij','Velj','Ožu','Tra','Svi','Lip', |
| | | 'Srp','Kol','Ruj','Lis','Stu','Pro'], |
| | | dayNames: ['Nedjelja','Ponedjeljak','Utorak','Srijeda','Četvrtak','Petak','Subota'], |
| | | dayNamesShort: ['Ned','Pon','Uto','Sri','Čet','Pet','Sub'], |
| | | dayNamesMin: ['Ne','Po','Ut','Sr','Če','Pe','Su'], |
| | | weekHeader: 'Tje', |
| | | dateFormat: 'dd.mm.yy.', |
| | | firstDay: 1, |
| | | isRTL: false, |
| | | showMonthAfterYear: false, |
| | | yearSuffix: ''}; |
| | | $.datepicker.setDefaults($.datepicker.regional['hr']); |
| | | });/* Hungarian initialisation for the jQuery UI date picker plugin. */ |
| | | /* Written by Istvan Karaszi (jquery@spam.raszi.hu). */ |
| | | jQuery(function($){ |
| | | $.datepicker.regional['hu'] = { |
| | | closeText: 'bezárás', |
| | | prevText: '« vissza', |
| | | nextText: 'előre »', |
| | | currentText: 'ma', |
| | | monthNames: ['Január', 'Február', 'Március', 'Április', 'Május', 'Június', |
| | | 'Július', 'Augusztus', 'Szeptember', 'Október', 'November', 'December'], |
| | | monthNamesShort: ['Jan', 'Feb', 'Már', 'Ápr', 'Máj', 'Jún', |
| | | 'Júl', 'Aug', 'Szep', 'Okt', 'Nov', 'Dec'], |
| | | dayNames: ['Vasárnap', 'Hétfö', 'Kedd', 'Szerda', 'Csütörtök', 'Péntek', 'Szombat'], |
| | | dayNamesShort: ['Vas', 'Hét', 'Ked', 'Sze', 'Csü', 'Pén', 'Szo'], |
| | | dayNamesMin: ['V', 'H', 'K', 'Sze', 'Cs', 'P', 'Szo'], |
| | | weekHeader: 'Hé', |
| | | dateFormat: 'yy-mm-dd', |
| | | firstDay: 1, |
| | | isRTL: false, |
| | | showMonthAfterYear: false, |
| | | yearSuffix: ''}; |
| | | $.datepicker.setDefaults($.datepicker.regional['hu']); |
| | | }); |
| | | /* Armenian(UTF-8) initialisation for the jQuery UI date picker plugin. */ |
| | | /* Written by Levon Zakaryan (levon.zakaryan@gmail.com)*/ |
| | | jQuery(function($){ |
| | | $.datepicker.regional['hy'] = { |
| | | closeText: 'Փակել', |
| | | prevText: '<Նախ.', |
| | | nextText: 'Հաջ.>', |
| | | currentText: 'Այսօր', |
| | | monthNames: ['Հունվար','Փետրվար','Մարտ','Ապրիլ','Մայիս','Հունիս', |
| | | 'Հուլիս','Օգոստոս','Սեպտեմբեր','Հոկտեմբեր','Նոյեմբեր','Դեկտեմբեր'], |
| | | monthNamesShort: ['Հունվ','Փետր','Մարտ','Ապր','Մայիս','Հունիս', |
| | | 'Հուլ','Օգս','Սեպ','Հոկ','Նոյ','Դեկ'], |
| | | dayNames: ['կիրակի','եկուշաբթի','երեքշաբթի','չորեքշաբթի','հինգշաբթի','ուրբաթ','շաբաթ'], |
| | | dayNamesShort: ['կիր','երկ','երք','չրք','հնգ','ուրբ','շբթ'], |
| | | dayNamesMin: ['կիր','երկ','երք','չրք','հնգ','ուրբ','շբթ'], |
| | | weekHeader: 'ՇԲՏ', |
| | | dateFormat: 'dd.mm.yy', |
| | | firstDay: 1, |
| | | isRTL: false, |
| | | showMonthAfterYear: false, |
| | | yearSuffix: ''}; |
| | | $.datepicker.setDefaults($.datepicker.regional['hy']); |
| | | });/* Indonesian initialisation for the jQuery UI date picker plugin. */ |
| | | /* Written by Deden Fathurahman (dedenf@gmail.com). */ |
| | | jQuery(function($){ |
| | | $.datepicker.regional['id'] = { |
| | | closeText: 'Tutup', |
| | | prevText: '<mundur', |
| | | nextText: 'maju>', |
| | | currentText: 'hari ini', |
| | | monthNames: ['Januari','Februari','Maret','April','Mei','Juni', |
| | | 'Juli','Agustus','September','Oktober','Nopember','Desember'], |
| | | monthNamesShort: ['Jan','Feb','Mar','Apr','Mei','Jun', |
| | | 'Jul','Agus','Sep','Okt','Nop','Des'], |
| | | dayNames: ['Minggu','Senin','Selasa','Rabu','Kamis','Jumat','Sabtu'], |
| | | dayNamesShort: ['Min','Sen','Sel','Rab','kam','Jum','Sab'], |
| | | dayNamesMin: ['Mg','Sn','Sl','Rb','Km','jm','Sb'], |
| | | weekHeader: 'Mg', |
| | | dateFormat: 'dd/mm/yy', |
| | | firstDay: 0, |
| | | isRTL: false, |
| | | showMonthAfterYear: false, |
| | | yearSuffix: ''}; |
| | | $.datepicker.setDefaults($.datepicker.regional['id']); |
| | | });/* Icelandic initialisation for the jQuery UI date picker plugin. */ |
| | | /* Written by Haukur H. Thorsson (haukur@eskill.is). */ |
| | | jQuery(function($){ |
| | | $.datepicker.regional['is'] = { |
| | | closeText: 'Loka', |
| | | prevText: '< Fyrri', |
| | | nextText: 'Næsti >', |
| | | currentText: 'Í dag', |
| | | monthNames: ['Janúar','Febrúar','Mars','Apríl','Maí','Júní', |
| | | 'Júlí','Ágúst','September','Október','Nóvember','Desember'], |
| | | monthNamesShort: ['Jan','Feb','Mar','Apr','Maí','Jún', |
| | | 'Júl','Ágú','Sep','Okt','Nóv','Des'], |
| | | dayNames: ['Sunnudagur','Mánudagur','Þriðjudagur','Miðvikudagur','Fimmtudagur','Föstudagur','Laugardagur'], |
| | | dayNamesShort: ['Sun','Mán','Þri','Mið','Fim','Fös','Lau'], |
| | | dayNamesMin: ['Su','Má','Þr','Mi','Fi','Fö','La'], |
| | | weekHeader: 'Vika', |
| | | dateFormat: 'dd/mm/yy', |
| | | firstDay: 0, |
| | | isRTL: false, |
| | | showMonthAfterYear: false, |
| | | yearSuffix: ''}; |
| | | $.datepicker.setDefaults($.datepicker.regional['is']); |
| | | });/* Italian initialisation for the jQuery UI date picker plugin. */ |
| | | /* Written by Antonello Pasella (antonello.pasella@gmail.com). */ |
| | | jQuery(function($){ |
| | | $.datepicker.regional['it'] = { |
| | | closeText: 'Chiudi', |
| | | prevText: '<Prec', |
| | | nextText: 'Succ>', |
| | | currentText: 'Oggi', |
| | | monthNames: ['Gennaio','Febbraio','Marzo','Aprile','Maggio','Giugno', |
| | | 'Luglio','Agosto','Settembre','Ottobre','Novembre','Dicembre'], |
| | | monthNamesShort: ['Gen','Feb','Mar','Apr','Mag','Giu', |
| | | 'Lug','Ago','Set','Ott','Nov','Dic'], |
| | | dayNames: ['Domenica','Lunedì','Martedì','Mercoledì','Giovedì','Venerdì','Sabato'], |
| | | dayNamesShort: ['Dom','Lun','Mar','Mer','Gio','Ven','Sab'], |
| | | dayNamesMin: ['Do','Lu','Ma','Me','Gi','Ve','Sa'], |
| | | weekHeader: 'Sm', |
| | | dateFormat: 'dd/mm/yy', |
| | | firstDay: 1, |
| | | isRTL: false, |
| | | showMonthAfterYear: false, |
| | | yearSuffix: ''}; |
| | | $.datepicker.setDefaults($.datepicker.regional['it']); |
| | | }); |
| | | /* Japanese initialisation for the jQuery UI date picker plugin. */ |
| | | /* Written by Kentaro SATO (kentaro@ranvis.com). */ |
| | | jQuery(function($){ |
| | | $.datepicker.regional['ja'] = { |
| | | closeText: '閉じる', |
| | | prevText: '<前', |
| | | nextText: '次>', |
| | | currentText: '今日', |
| | | monthNames: ['1月','2月','3月','4月','5月','6月', |
| | | '7月','8月','9月','10月','11月','12月'], |
| | | monthNamesShort: ['1月','2月','3月','4月','5月','6月', |
| | | '7月','8月','9月','10月','11月','12月'], |
| | | dayNames: ['日曜日','月曜日','火曜日','水曜日','木曜日','金曜日','土曜日'], |
| | | dayNamesShort: ['日','月','火','水','木','金','土'], |
| | | dayNamesMin: ['日','月','火','水','木','金','土'], |
| | | weekHeader: '週', |
| | | dateFormat: 'yy/mm/dd', |
| | | firstDay: 0, |
| | | isRTL: false, |
| | | showMonthAfterYear: true, |
| | | yearSuffix: '年'}; |
| | | $.datepicker.setDefaults($.datepicker.regional['ja']); |
| | | });/* Korean initialisation for the jQuery calendar extension. */ |
| | | /* Written by DaeKwon Kang (ncrash.dk@gmail.com). */ |
| | | jQuery(function($){ |
| | | $.datepicker.regional['ko'] = { |
| | | closeText: '닫기', |
| | | prevText: '이전달', |
| | | nextText: '다음달', |
| | | currentText: '오늘', |
| | | monthNames: ['1월(JAN)','2월(FEB)','3월(MAR)','4월(APR)','5월(MAY)','6월(JUN)', |
| | | '7월(JUL)','8월(AUG)','9월(SEP)','10월(OCT)','11월(NOV)','12월(DEC)'], |
| | | monthNamesShort: ['1월(JAN)','2월(FEB)','3월(MAR)','4월(APR)','5월(MAY)','6월(JUN)', |
| | | '7월(JUL)','8월(AUG)','9월(SEP)','10월(OCT)','11월(NOV)','12월(DEC)'], |
| | | dayNames: ['일','월','화','수','목','금','토'], |
| | | dayNamesShort: ['일','월','화','수','목','금','토'], |
| | | dayNamesMin: ['일','월','화','수','목','금','토'], |
| | | weekHeader: 'Wk', |
| | | dateFormat: 'yy-mm-dd', |
| | | firstDay: 0, |
| | | isRTL: false, |
| | | showMonthAfterYear: false, |
| | | yearSuffix: '년'}; |
| | | $.datepicker.setDefaults($.datepicker.regional['ko']); |
| | | });/* Kazakh (UTF-8) initialisation for the jQuery UI date picker plugin. */ |
| | | /* Written by Dmitriy Karasyov (dmitriy.karasyov@gmail.com). */ |
| | | jQuery(function($){ |
| | | $.datepicker.regional['kz'] = { |
| | | closeText: 'Жабу', |
| | | prevText: '<Алдыңғы', |
| | | nextText: 'Келесі>', |
| | | currentText: 'Бүгін', |
| | | monthNames: ['Қаңтар','Ақпан','Наурыз','Сәуір','Мамыр','Маусым', |
| | | 'Шілде','Тамыз','Қыркүйек','Қазан','Қараша','Желтоқсан'], |
| | | monthNamesShort: ['Қаң','Ақп','Нау','Сәу','Мам','Мау', |
| | | 'Шіл','Там','Қыр','Қаз','Қар','Жел'], |
| | | dayNames: ['Жексенбі','Дүйсенбі','Сейсенбі','Сәрсенбі','Бейсенбі','Жұма','Сенбі'], |
| | | dayNamesShort: ['жкс','дсн','ссн','срс','бсн','жма','снб'], |
| | | dayNamesMin: ['Жк','Дс','Сс','Ср','Бс','Жм','Сн'], |
| | | weekHeader: 'Не', |
| | | dateFormat: 'dd.mm.yy', |
| | | firstDay: 1, |
| | | isRTL: false, |
| | | showMonthAfterYear: false, |
| | | yearSuffix: ''}; |
| | | $.datepicker.setDefaults($.datepicker.regional['kz']); |
| | | }); |
| | | /* Lithuanian (UTF-8) initialisation for the jQuery UI date picker plugin. */ |
| | | /* @author Arturas Paleicikas <arturas@avalon.lt> */ |
| | | jQuery(function($){ |
| | | $.datepicker.regional['lt'] = { |
| | | closeText: 'Uždaryti', |
| | | prevText: '<Atgal', |
| | | nextText: 'Pirmyn>', |
| | | currentText: 'Šiandien', |
| | | monthNames: ['Sausis','Vasaris','Kovas','Balandis','Gegužė','Birželis', |
| | | 'Liepa','Rugpjūtis','Rugsėjis','Spalis','Lapkritis','Gruodis'], |
| | | monthNamesShort: ['Sau','Vas','Kov','Bal','Geg','Bir', |
| | | 'Lie','Rugp','Rugs','Spa','Lap','Gru'], |
| | | dayNames: ['sekmadienis','pirmadienis','antradienis','trečiadienis','ketvirtadienis','penktadienis','šeštadienis'], |
| | | dayNamesShort: ['sek','pir','ant','tre','ket','pen','šeš'], |
| | | dayNamesMin: ['Se','Pr','An','Tr','Ke','Pe','Še'], |
| | | weekHeader: 'Wk', |
| | | dateFormat: 'yy-mm-dd', |
| | | firstDay: 1, |
| | | isRTL: false, |
| | | showMonthAfterYear: false, |
| | | yearSuffix: ''}; |
| | | $.datepicker.setDefaults($.datepicker.regional['lt']); |
| | | });/* Latvian (UTF-8) initialisation for the jQuery UI date picker plugin. */ |
| | | /* @author Arturas Paleicikas <arturas.paleicikas@metasite.net> */ |
| | | jQuery(function($){ |
| | | $.datepicker.regional['lv'] = { |
| | | closeText: 'Aizvērt', |
| | | prevText: 'Iepr', |
| | | nextText: 'Nāka', |
| | | currentText: 'Šodien', |
| | | monthNames: ['Janvāris','Februāris','Marts','Aprīlis','Maijs','Jūnijs', |
| | | 'Jūlijs','Augusts','Septembris','Oktobris','Novembris','Decembris'], |
| | | monthNamesShort: ['Jan','Feb','Mar','Apr','Mai','Jūn', |
| | | 'Jūl','Aug','Sep','Okt','Nov','Dec'], |
| | | dayNames: ['svētdiena','pirmdiena','otrdiena','trešdiena','ceturtdiena','piektdiena','sestdiena'], |
| | | dayNamesShort: ['svt','prm','otr','tre','ctr','pkt','sst'], |
| | | dayNamesMin: ['Sv','Pr','Ot','Tr','Ct','Pk','Ss'], |
| | | weekHeader: 'Nav', |
| | | dateFormat: 'dd-mm-yy', |
| | | firstDay: 1, |
| | | isRTL: false, |
| | | showMonthAfterYear: false, |
| | | yearSuffix: ''}; |
| | | $.datepicker.setDefaults($.datepicker.regional['lv']); |
| | | });/* Malaysian initialisation for the jQuery UI date picker plugin. */ |
| | | /* Written by Mohd Nawawi Mohamad Jamili (nawawi@ronggeng.net). */ |
| | | jQuery(function($){ |
| | | $.datepicker.regional['ms'] = { |
| | | closeText: 'Tutup', |
| | | prevText: '<Sebelum', |
| | | nextText: 'Selepas>', |
| | | currentText: 'hari ini', |
| | | monthNames: ['Januari','Februari','Mac','April','Mei','Jun', |
| | | 'Julai','Ogos','September','Oktober','November','Disember'], |
| | | monthNamesShort: ['Jan','Feb','Mac','Apr','Mei','Jun', |
| | | 'Jul','Ogo','Sep','Okt','Nov','Dis'], |
| | | dayNames: ['Ahad','Isnin','Selasa','Rabu','Khamis','Jumaat','Sabtu'], |
| | | dayNamesShort: ['Aha','Isn','Sel','Rab','kha','Jum','Sab'], |
| | | dayNamesMin: ['Ah','Is','Se','Ra','Kh','Ju','Sa'], |
| | | weekHeader: 'Mg', |
| | | dateFormat: 'dd/mm/yy', |
| | | firstDay: 0, |
| | | isRTL: false, |
| | | showMonthAfterYear: false, |
| | | yearSuffix: ''}; |
| | | $.datepicker.setDefaults($.datepicker.regional['ms']); |
| | | });/* Dutch (UTF-8) initialisation for the jQuery UI date picker plugin. */ |
| | | /* Written by Mathias Bynens <http://mathiasbynens.be/> */ |
| | | jQuery(function($){ |
| | | $.datepicker.regional.nl = { |
| | | closeText: 'Sluiten', |
| | | prevText: '←', |
| | | nextText: '→', |
| | | currentText: 'Vandaag', |
| | | monthNames: ['januari', 'februari', 'maart', 'april', 'mei', 'juni', |
| | | 'juli', 'augustus', 'september', 'oktober', 'november', 'december'], |
| | | monthNamesShort: ['jan', 'feb', 'maa', 'apr', 'mei', 'jun', |
| | | 'jul', 'aug', 'sep', 'okt', 'nov', 'dec'], |
| | | dayNames: ['zondag', 'maandag', 'dinsdag', 'woensdag', 'donderdag', 'vrijdag', 'zaterdag'], |
| | | dayNamesShort: ['zon', 'maa', 'din', 'woe', 'don', 'vri', 'zat'], |
| | | dayNamesMin: ['zo', 'ma', 'di', 'wo', 'do', 'vr', 'za'], |
| | | weekHeader: 'Wk', |
| | | dateFormat: 'dd/mm/yy', |
| | | firstDay: 1, |
| | | isRTL: false, |
| | | showMonthAfterYear: false, |
| | | yearSuffix: ''}; |
| | | $.datepicker.setDefaults($.datepicker.regional.nl); |
| | | });/* Norwegian initialisation for the jQuery UI date picker plugin. */ |
| | | /* Written by Naimdjon Takhirov (naimdjon@gmail.com). */ |
| | | jQuery(function($){ |
| | | $.datepicker.regional['no'] = { |
| | | closeText: 'Lukk', |
| | | prevText: '«Forrige', |
| | | nextText: 'Neste»', |
| | | currentText: 'I dag', |
| | | monthNames: ['Januar','Februar','Mars','April','Mai','Juni', |
| | | 'Juli','August','September','Oktober','November','Desember'], |
| | | monthNamesShort: ['Jan','Feb','Mar','Apr','Mai','Jun', |
| | | 'Jul','Aug','Sep','Okt','Nov','Des'], |
| | | dayNamesShort: ['Søn','Man','Tir','Ons','Tor','Fre','Lør'], |
| | | dayNames: ['Søndag','Mandag','Tirsdag','Onsdag','Torsdag','Fredag','Lørdag'], |
| | | dayNamesMin: ['Sø','Ma','Ti','On','To','Fr','Lø'], |
| | | weekHeader: 'Uke', |
| | | dateFormat: 'yy-mm-dd', |
| | | firstDay: 0, |
| | | isRTL: false, |
| | | showMonthAfterYear: false, |
| | | yearSuffix: ''}; |
| | | $.datepicker.setDefaults($.datepicker.regional['no']); |
| | | }); |
| | | /* Polish initialisation for the jQuery UI date picker plugin. */ |
| | | /* Written by Jacek Wysocki (jacek.wysocki@gmail.com). */ |
| | | jQuery(function($){ |
| | | $.datepicker.regional['pl'] = { |
| | | closeText: 'Zamknij', |
| | | prevText: '<Poprzedni', |
| | | nextText: 'Następny>', |
| | | currentText: 'Dziś', |
| | | monthNames: ['Styczeń','Luty','Marzec','Kwiecień','Maj','Czerwiec', |
| | | 'Lipiec','Sierpień','Wrzesień','Październik','Listopad','Grudzień'], |
| | | monthNamesShort: ['Sty','Lu','Mar','Kw','Maj','Cze', |
| | | 'Lip','Sie','Wrz','Pa','Lis','Gru'], |
| | | dayNames: ['Niedziela','Poniedziałek','Wtorek','Środa','Czwartek','Piątek','Sobota'], |
| | | dayNamesShort: ['Nie','Pn','Wt','Śr','Czw','Pt','So'], |
| | | dayNamesMin: ['N','Pn','Wt','Śr','Cz','Pt','So'], |
| | | weekHeader: 'Tydz', |
| | | dateFormat: 'dd.mm.yy', |
| | | firstDay: 1, |
| | | isRTL: false, |
| | | showMonthAfterYear: false, |
| | | yearSuffix: ''}; |
| | | $.datepicker.setDefaults($.datepicker.regional['pl']); |
| | | }); |
| | | /* Brazilian initialisation for the jQuery UI date picker plugin. */ |
| | | /* Written by Leonildo Costa Silva (leocsilva@gmail.com). */ |
| | | jQuery(function($){ |
| | | $.datepicker.regional['pt-BR'] = { |
| | | closeText: 'Fechar', |
| | | prevText: '<Anterior', |
| | | nextText: 'Próximo>', |
| | | currentText: 'Hoje', |
| | | monthNames: ['Janeiro','Fevereiro','Março','Abril','Maio','Junho', |
| | | 'Julho','Agosto','Setembro','Outubro','Novembro','Dezembro'], |
| | | monthNamesShort: ['Jan','Fev','Mar','Abr','Mai','Jun', |
| | | 'Jul','Ago','Set','Out','Nov','Dez'], |
| | | dayNames: ['Domingo','Segunda-feira','Terça-feira','Quarta-feira','Quinta-feira','Sexta-feira','Sábado'], |
| | | dayNamesShort: ['Dom','Seg','Ter','Qua','Qui','Sex','Sáb'], |
| | | dayNamesMin: ['Dom','Seg','Ter','Qua','Qui','Sex','Sáb'], |
| | | weekHeader: 'Sm', |
| | | dateFormat: 'dd/mm/yy', |
| | | firstDay: 0, |
| | | isRTL: false, |
| | | showMonthAfterYear: false, |
| | | yearSuffix: ''}; |
| | | $.datepicker.setDefaults($.datepicker.regional['pt-BR']); |
| | | });/* Portuguese initialisation for the jQuery UI date picker plugin. */ |
| | | jQuery(function($){ |
| | | $.datepicker.regional['pt'] = { |
| | | closeText: 'Fechar', |
| | | prevText: '<Anterior', |
| | | nextText: 'Seguinte', |
| | | currentText: 'Hoje', |
| | | monthNames: ['Janeiro','Fevereiro','Março','Abril','Maio','Junho', |
| | | 'Julho','Agosto','Setembro','Outubro','Novembro','Dezembro'], |
| | | monthNamesShort: ['Jan','Fev','Mar','Abr','Mai','Jun', |
| | | 'Jul','Ago','Set','Out','Nov','Dez'], |
| | | dayNames: ['Domingo','Segunda-feira','Terça-feira','Quarta-feira','Quinta-feira','Sexta-feira','Sábado'], |
| | | dayNamesShort: ['Dom','Seg','Ter','Qua','Qui','Sex','Sáb'], |
| | | dayNamesMin: ['Dom','Seg','Ter','Qua','Qui','Sex','Sáb'], |
| | | weekHeader: 'Sem', |
| | | dateFormat: 'dd/mm/yy', |
| | | firstDay: 0, |
| | | isRTL: false, |
| | | showMonthAfterYear: false, |
| | | yearSuffix: ''}; |
| | | $.datepicker.setDefaults($.datepicker.regional['pt']); |
| | | });/* Romanian initialisation for the jQuery UI date picker plugin. |
| | | * |
| | | * Written by Edmond L. (ll_edmond@walla.com) |
| | | * and Ionut G. Stan (ionut.g.stan@gmail.com) |
| | | */ |
| | | jQuery(function($){ |
| | | $.datepicker.regional['ro'] = { |
| | | closeText: 'Închide', |
| | | prevText: '« Luna precedentă', |
| | | nextText: 'Luna următoare »', |
| | | currentText: 'Azi', |
| | | monthNames: ['Ianuarie','Februarie','Martie','Aprilie','Mai','Iunie', |
| | | 'Iulie','August','Septembrie','Octombrie','Noiembrie','Decembrie'], |
| | | monthNamesShort: ['Ian', 'Feb', 'Mar', 'Apr', 'Mai', 'Iun', |
| | | 'Iul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'], |
| | | dayNames: ['Duminică', 'Luni', 'Marţi', 'Miercuri', 'Joi', 'Vineri', 'Sâmbătă'], |
| | | dayNamesShort: ['Dum', 'Lun', 'Mar', 'Mie', 'Joi', 'Vin', 'Sâm'], |
| | | dayNamesMin: ['Du','Lu','Ma','Mi','Jo','Vi','Sâ'], |
| | | weekHeader: 'Săpt', |
| | | dateFormat: 'dd.mm.yy', |
| | | firstDay: 1, |
| | | isRTL: false, |
| | | showMonthAfterYear: false, |
| | | yearSuffix: ''}; |
| | | $.datepicker.setDefaults($.datepicker.regional['ro']); |
| | | }); |
| | | /* Russian (UTF-8) initialisation for the jQuery UI date picker plugin. */ |
| | | /* Written by Andrew Stromnov (stromnov@gmail.com). */ |
| | | jQuery(function($){ |
| | | $.datepicker.regional['ru'] = { |
| | | closeText: 'Закрыть', |
| | | prevText: '<Пред', |
| | | nextText: 'След>', |
| | | currentText: 'Сегодня', |
| | | monthNames: ['Январь','Февраль','Март','Апрель','Май','Июнь', |
| | | 'Июль','Август','Сентябрь','Октябрь','Ноябрь','Декабрь'], |
| | | monthNamesShort: ['Янв','Фев','Мар','Апр','Май','Июн', |
| | | 'Июл','Авг','Сен','Окт','Ноя','Дек'], |
| | | dayNames: ['воскресенье','понедельник','вторник','среда','четверг','пятница','суббота'], |
| | | dayNamesShort: ['вск','пнд','втр','срд','чтв','птн','сбт'], |
| | | dayNamesMin: ['Вс','Пн','Вт','Ср','Чт','Пт','Сб'], |
| | | weekHeader: 'Нед', |
| | | dateFormat: 'dd.mm.yy', |
| | | firstDay: 1, |
| | | isRTL: false, |
| | | showMonthAfterYear: false, |
| | | yearSuffix: ''}; |
| | | $.datepicker.setDefaults($.datepicker.regional['ru']); |
| | | });/* Slovak initialisation for the jQuery UI date picker plugin. */ |
| | | /* Written by Vojtech Rinik (vojto@hmm.sk). */ |
| | | jQuery(function($){ |
| | | $.datepicker.regional['sk'] = { |
| | | closeText: 'Zavrieť', |
| | | prevText: '<Predchádzajúci', |
| | | nextText: 'Nasledujúci>', |
| | | currentText: 'Dnes', |
| | | monthNames: ['Január','Február','Marec','Apríl','Máj','Jún', |
| | | 'Júl','August','September','Október','November','December'], |
| | | monthNamesShort: ['Jan','Feb','Mar','Apr','Máj','Jún', |
| | | 'Júl','Aug','Sep','Okt','Nov','Dec'], |
| | | dayNames: ['Nedel\'a','Pondelok','Utorok','Streda','Štvrtok','Piatok','Sobota'], |
| | | dayNamesShort: ['Ned','Pon','Uto','Str','Štv','Pia','Sob'], |
| | | dayNamesMin: ['Ne','Po','Ut','St','Št','Pia','So'], |
| | | weekHeader: 'Ty', |
| | | dateFormat: 'dd.mm.yy', |
| | | firstDay: 1, |
| | | isRTL: false, |
| | | showMonthAfterYear: false, |
| | | yearSuffix: ''}; |
| | | $.datepicker.setDefaults($.datepicker.regional['sk']); |
| | | }); |
| | | /* Slovenian initialisation for the jQuery UI date picker plugin. */ |
| | | /* Written by Jaka Jancar (jaka@kubje.org). */ |
| | | /* c = č, s = š z = ž C = Č S = Š Z = Ž */ |
| | | jQuery(function($){ |
| | | $.datepicker.regional['sl'] = { |
| | | closeText: 'Zapri', |
| | | prevText: '<Prejšnji', |
| | | nextText: 'Naslednji>', |
| | | currentText: 'Trenutni', |
| | | monthNames: ['Januar','Februar','Marec','April','Maj','Junij', |
| | | 'Julij','Avgust','September','Oktober','November','December'], |
| | | monthNamesShort: ['Jan','Feb','Mar','Apr','Maj','Jun', |
| | | 'Jul','Avg','Sep','Okt','Nov','Dec'], |
| | | dayNames: ['Nedelja','Ponedeljek','Torek','Sreda','Četrtek','Petek','Sobota'], |
| | | dayNamesShort: ['Ned','Pon','Tor','Sre','Čet','Pet','Sob'], |
| | | dayNamesMin: ['Ne','Po','To','Sr','Če','Pe','So'], |
| | | weekHeader: 'Teden', |
| | | dateFormat: 'dd.mm.yy', |
| | | firstDay: 1, |
| | | isRTL: false, |
| | | showMonthAfterYear: false, |
| | | yearSuffix: ''}; |
| | | $.datepicker.setDefaults($.datepicker.regional['sl']); |
| | | }); |
| | | /* Albanian initialisation for the jQuery UI date picker plugin. */ |
| | | /* Written by Flakron Bytyqi (flakron@gmail.com). */ |
| | | jQuery(function($){ |
| | | $.datepicker.regional['sq'] = { |
| | | closeText: 'mbylle', |
| | | prevText: '<mbrapa', |
| | | nextText: 'Përpara>', |
| | | currentText: 'sot', |
| | | monthNames: ['Janar','Shkurt','Mars','Prill','Maj','Qershor', |
| | | 'Korrik','Gusht','Shtator','Tetor','Nëntor','Dhjetor'], |
| | | monthNamesShort: ['Jan','Shk','Mar','Pri','Maj','Qer', |
| | | 'Kor','Gus','Sht','Tet','Nën','Dhj'], |
| | | dayNames: ['E Diel','E Hënë','E Martë','E Mërkurë','E Enjte','E Premte','E Shtune'], |
| | | dayNamesShort: ['Di','Hë','Ma','Më','En','Pr','Sh'], |
| | | dayNamesMin: ['Di','Hë','Ma','Më','En','Pr','Sh'], |
| | | weekHeader: 'Ja', |
| | | dateFormat: 'dd.mm.yy', |
| | | firstDay: 1, |
| | | isRTL: false, |
| | | showMonthAfterYear: false, |
| | | yearSuffix: ''}; |
| | | $.datepicker.setDefaults($.datepicker.regional['sq']); |
| | | }); |
| | | /* Serbian i18n for the jQuery UI date picker plugin. */ |
| | | /* Written by Dejan Dimić. */ |
| | | jQuery(function($){ |
| | | $.datepicker.regional['sr-SR'] = { |
| | | closeText: 'Zatvori', |
| | | prevText: '<', |
| | | nextText: '>', |
| | | currentText: 'Danas', |
| | | monthNames: ['Januar','Februar','Mart','April','Maj','Jun', |
| | | 'Jul','Avgust','Septembar','Oktobar','Novembar','Decembar'], |
| | | monthNamesShort: ['Jan','Feb','Mar','Apr','Maj','Jun', |
| | | 'Jul','Avg','Sep','Okt','Nov','Dec'], |
| | | dayNames: ['Nedelja','Ponedeljak','Utorak','Sreda','Četvrtak','Petak','Subota'], |
| | | dayNamesShort: ['Ned','Pon','Uto','Sre','Čet','Pet','Sub'], |
| | | dayNamesMin: ['Ne','Po','Ut','Sr','Če','Pe','Su'], |
| | | weekHeader: 'Sed', |
| | | dateFormat: 'dd/mm/yy', |
| | | firstDay: 1, |
| | | isRTL: false, |
| | | showMonthAfterYear: false, |
| | | yearSuffix: ''}; |
| | | $.datepicker.setDefaults($.datepicker.regional['sr-SR']); |
| | | }); |
| | | /* Serbian i18n for the jQuery UI date picker plugin. */ |
| | | /* Written by Dejan Dimić. */ |
| | | jQuery(function($){ |
| | | $.datepicker.regional['sr'] = { |
| | | closeText: 'Затвори', |
| | | prevText: '<', |
| | | nextText: '>', |
| | | currentText: 'Данас', |
| | | monthNames: ['Јануар','Фебруар','Март','Април','Мај','Јун', |
| | | 'Јул','Август','Септембар','Октобар','Новембар','Децембар'], |
| | | monthNamesShort: ['Јан','Феб','Мар','Апр','Мај','Јун', |
| | | 'Јул','Авг','Сеп','Окт','Нов','Дец'], |
| | | dayNames: ['Недеља','Понедељак','Уторак','Среда','Четвртак','Петак','Субота'], |
| | | dayNamesShort: ['Нед','Пон','Уто','Сре','Чет','Пет','Суб'], |
| | | dayNamesMin: ['Не','По','Ут','Ср','Че','Пе','Су'], |
| | | weekHeader: 'Сед', |
| | | dateFormat: 'dd/mm/yy', |
| | | firstDay: 1, |
| | | isRTL: false, |
| | | showMonthAfterYear: false, |
| | | yearSuffix: ''}; |
| | | $.datepicker.setDefaults($.datepicker.regional['sr']); |
| | | }); |
| | | /* Swedish initialisation for the jQuery UI date picker plugin. */ |
| | | /* Written by Anders Ekdahl ( anders@nomadiz.se). */ |
| | | jQuery(function($){ |
| | | $.datepicker.regional['sv'] = { |
| | | closeText: 'Stäng', |
| | | prevText: '«Förra', |
| | | nextText: 'Nästa»', |
| | | currentText: 'Idag', |
| | | monthNames: ['Januari','Februari','Mars','April','Maj','Juni', |
| | | 'Juli','Augusti','September','Oktober','November','December'], |
| | | monthNamesShort: ['Jan','Feb','Mar','Apr','Maj','Jun', |
| | | 'Jul','Aug','Sep','Okt','Nov','Dec'], |
| | | dayNamesShort: ['Sön','Mån','Tis','Ons','Tor','Fre','Lör'], |
| | | dayNames: ['Söndag','Måndag','Tisdag','Onsdag','Torsdag','Fredag','Lördag'], |
| | | dayNamesMin: ['Sö','Må','Ti','On','To','Fr','Lö'], |
| | | weekHeader: 'Ve', |
| | | dateFormat: 'yy-mm-dd', |
| | | firstDay: 1, |
| | | isRTL: false, |
| | | showMonthAfterYear: false, |
| | | yearSuffix: ''}; |
| | | $.datepicker.setDefaults($.datepicker.regional['sv']); |
| | | }); |
| | | /* Tamil (UTF-8) initialisation for the jQuery UI date picker plugin. */ |
| | | /* Written by S A Sureshkumar (saskumar@live.com). */ |
| | | jQuery(function($){ |
| | | $.datepicker.regional['ta'] = { |
| | | closeText: 'மூடு', |
| | | prevText: 'முன்னையது', |
| | | nextText: 'அடுத்தது', |
| | | currentText: 'இன்று', |
| | | monthNames: ['தை','மாசி','பங்குனி','சித்திரை','வைகாசி','ஆனி', |
| | | 'ஆடி','ஆவணி','புரட்டாசி','ஐப்பசி','கார்த்திகை','மார்கழி'], |
| | | monthNamesShort: ['தை','மாசி','பங்','சித்','வைகா','ஆனி', |
| | | 'ஆடி','ஆவ','புர','ஐப்','கார்','மார்'], |
| | | dayNames: ['ஞாயிற்றுக்கிழமை','திங்கட்கிழமை','செவ்வாய்க்கிழமை','புதன்கிழமை','வியாழக்கிழமை','வெள்ளிக்கிழமை','சனிக்கிழமை'], |
| | | dayNamesShort: ['ஞாயிறு','திங்கள்','செவ்வாய்','புதன்','வியாழன்','வெள்ளி','சனி'], |
| | | dayNamesMin: ['ஞா','தி','செ','பு','வி','வெ','ச'], |
| | | weekHeader: 'Не', |
| | | dateFormat: 'dd/mm/yy', |
| | | firstDay: 1, |
| | | isRTL: false, |
| | | showMonthAfterYear: false, |
| | | yearSuffix: ''}; |
| | | $.datepicker.setDefaults($.datepicker.regional['ta']); |
| | | }); |
| | | /* Thai initialisation for the jQuery UI date picker plugin. */ |
| | | /* Written by pipo (pipo@sixhead.com). */ |
| | | jQuery(function($){ |
| | | $.datepicker.regional['th'] = { |
| | | closeText: 'ปิด', |
| | | prevText: '« ย้อน', |
| | | nextText: 'ถัดไป »', |
| | | currentText: 'วันนี้', |
| | | monthNames: ['มกราคม','กุมภาพันธ์','มีนาคม','เมษายน','พฤษภาคม','มิถุนายน', |
| | | 'กรกฏาคม','สิงหาคม','กันยายน','ตุลาคม','พฤศจิกายน','ธันวาคม'], |
| | | monthNamesShort: ['ม.ค.','ก.พ.','มี.ค.','เม.ย.','พ.ค.','มิ.ย.', |
| | | 'ก.ค.','ส.ค.','ก.ย.','ต.ค.','พ.ย.','ธ.ค.'], |
| | | dayNames: ['อาทิตย์','จันทร์','อังคาร','พุธ','พฤหัสบดี','ศุกร์','เสาร์'], |
| | | dayNamesShort: ['อา.','จ.','อ.','พ.','พฤ.','ศ.','ส.'], |
| | | dayNamesMin: ['อา.','จ.','อ.','พ.','พฤ.','ศ.','ส.'], |
| | | weekHeader: 'Wk', |
| | | dateFormat: 'dd/mm/yy', |
| | | firstDay: 0, |
| | | isRTL: false, |
| | | showMonthAfterYear: false, |
| | | yearSuffix: ''}; |
| | | $.datepicker.setDefaults($.datepicker.regional['th']); |
| | | });/* Turkish initialisation for the jQuery UI date picker plugin. */ |
| | | /* Written by Izzet Emre Erkan (kara@karalamalar.net). */ |
| | | jQuery(function($){ |
| | | $.datepicker.regional['tr'] = { |
| | | closeText: 'kapat', |
| | | prevText: '<geri', |
| | | nextText: 'ileri>', |
| | | currentText: 'bugün', |
| | | monthNames: ['Ocak','Şubat','Mart','Nisan','Mayıs','Haziran', |
| | | 'Temmuz','Ağustos','Eylül','Ekim','Kasım','Aralık'], |
| | | monthNamesShort: ['Oca','Şub','Mar','Nis','May','Haz', |
| | | 'Tem','Ağu','Eyl','Eki','Kas','Ara'], |
| | | dayNames: ['Pazar','Pazartesi','Salı','Çarşamba','Perşembe','Cuma','Cumartesi'], |
| | | dayNamesShort: ['Pz','Pt','Sa','Ça','Pe','Cu','Ct'], |
| | | dayNamesMin: ['Pz','Pt','Sa','Ça','Pe','Cu','Ct'], |
| | | weekHeader: 'Hf', |
| | | dateFormat: 'dd.mm.yy', |
| | | firstDay: 1, |
| | | isRTL: false, |
| | | showMonthAfterYear: false, |
| | | yearSuffix: ''}; |
| | | $.datepicker.setDefaults($.datepicker.regional['tr']); |
| | | });/* Ukrainian (UTF-8) initialisation for the jQuery UI date picker plugin. */ |
| | | /* Written by Maxim Drogobitskiy (maxdao@gmail.com). */ |
| | | jQuery(function($){ |
| | | $.datepicker.regional['uk'] = { |
| | | closeText: 'Закрити', |
| | | prevText: '<', |
| | | nextText: '>', |
| | | currentText: 'Сьогодні', |
| | | monthNames: ['Січень','Лютий','Березень','Квітень','Травень','Червень', |
| | | 'Липень','Серпень','Вересень','Жовтень','Листопад','Грудень'], |
| | | monthNamesShort: ['Січ','Лют','Бер','Кві','Тра','Чер', |
| | | 'Лип','Сер','Вер','Жов','Лис','Гру'], |
| | | dayNames: ['неділя','понеділок','вівторок','середа','четвер','п’ятниця','субота'], |
| | | dayNamesShort: ['нед','пнд','вів','срд','чтв','птн','сбт'], |
| | | dayNamesMin: ['Нд','Пн','Вт','Ср','Чт','Пт','Сб'], |
| | | weekHeader: 'Не', |
| | | dateFormat: 'dd/mm/yy', |
| | | firstDay: 1, |
| | | isRTL: false, |
| | | showMonthAfterYear: false, |
| | | yearSuffix: ''}; |
| | | $.datepicker.setDefaults($.datepicker.regional['uk']); |
| | | });/* Vietnamese initialisation for the jQuery UI date picker plugin. */ |
| | | /* Translated by Le Thanh Huy (lthanhhuy@cit.ctu.edu.vn). */ |
| | | jQuery(function($){ |
| | | $.datepicker.regional['vi'] = { |
| | | closeText: 'Đóng', |
| | | prevText: '<Trước', |
| | | nextText: 'Tiếp>', |
| | | currentText: 'Hôm nay', |
| | | monthNames: ['Tháng Một', 'Tháng Hai', 'Tháng Ba', 'Tháng Tư', 'Tháng Năm', 'Tháng Sáu', |
| | | 'Tháng Bảy', 'Tháng Tám', 'Tháng Chín', 'Tháng Mười', 'Tháng Mười Một', 'Tháng Mười Hai'], |
| | | monthNamesShort: ['Tháng 1', 'Tháng 2', 'Tháng 3', 'Tháng 4', 'Tháng 5', 'Tháng 6', |
| | | 'Tháng 7', 'Tháng 8', 'Tháng 9', 'Tháng 10', 'Tháng 11', 'Tháng 12'], |
| | | dayNames: ['Chủ Nhật', 'Thứ Hai', 'Thứ Ba', 'Thứ Tư', 'Thứ Năm', 'Thứ Sáu', 'Thứ Bảy'], |
| | | dayNamesShort: ['CN', 'T2', 'T3', 'T4', 'T5', 'T6', 'T7'], |
| | | dayNamesMin: ['CN', 'T2', 'T3', 'T4', 'T5', 'T6', 'T7'], |
| | | weekHeader: 'Tu', |
| | | dateFormat: 'dd/mm/yy', |
| | | firstDay: 0, |
| | | isRTL: false, |
| | | showMonthAfterYear: false, |
| | | yearSuffix: ''}; |
| | | $.datepicker.setDefaults($.datepicker.regional['vi']); |
| | | }); |
| | | /* Chinese initialisation for the jQuery UI date picker plugin. */ |
| | | /* Written by Cloudream (cloudream@gmail.com). */ |
| | | jQuery(function($){ |
| | | $.datepicker.regional['zh-CN'] = { |
| | | closeText: '关闭', |
| | | prevText: '<上月', |
| | | nextText: '下月>', |
| | | currentText: '今天', |
| | | monthNames: ['一月','二月','三月','四月','五月','六月', |
| | | '七月','八月','九月','十月','十一月','十二月'], |
| | | monthNamesShort: ['一','二','三','四','五','六', |
| | | '七','八','九','十','十一','十二'], |
| | | dayNames: ['星期日','星期一','星期二','星期三','星期四','星期五','星期六'], |
| | | dayNamesShort: ['周日','周一','周二','周三','周四','周五','周六'], |
| | | dayNamesMin: ['日','一','二','三','四','五','六'], |
| | | weekHeader: '周', |
| | | dateFormat: 'yy-mm-dd', |
| | | firstDay: 1, |
| | | isRTL: false, |
| | | showMonthAfterYear: true, |
| | | yearSuffix: '年'}; |
| | | $.datepicker.setDefaults($.datepicker.regional['zh-CN']); |
| | | }); |
| | | /* Chinese initialisation for the jQuery UI date picker plugin. */ |
| | | /* Written by SCCY (samuelcychan@gmail.com). */ |
| | | jQuery(function($){ |
| | | $.datepicker.regional['zh-HK'] = { |
| | | closeText: '關閉', |
| | | prevText: '<上月', |
| | | nextText: '下月>', |
| | | currentText: '今天', |
| | | monthNames: ['一月','二月','三月','四月','五月','六月', |
| | | '七月','八月','九月','十月','十一月','十二月'], |
| | | monthNamesShort: ['一','二','三','四','五','六', |
| | | '七','八','九','十','十一','十二'], |
| | | dayNames: ['星期日','星期一','星期二','星期三','星期四','星期五','星期六'], |
| | | dayNamesShort: ['周日','周一','周二','周三','周四','周五','周六'], |
| | | dayNamesMin: ['日','一','二','三','四','五','六'], |
| | | weekHeader: '周', |
| | | dateFormat: 'dd-mm-yy', |
| | | firstDay: 0, |
| | | isRTL: false, |
| | | showMonthAfterYear: true, |
| | | yearSuffix: '年'}; |
| | | $.datepicker.setDefaults($.datepicker.regional['zh-HK']); |
| | | }); |
| | | /* Chinese initialisation for the jQuery UI date picker plugin. */ |
| | | /* Written by Ressol (ressol@gmail.com). */ |
| | | jQuery(function($){ |
| | | $.datepicker.regional['zh-TW'] = { |
| | | closeText: '關閉', |
| | | prevText: '<上月', |
| | | nextText: '下月>', |
| | | currentText: '今天', |
| | | monthNames: ['一月','二月','三月','四月','五月','六月', |
| | | '七月','八月','九月','十月','十一月','十二月'], |
| | | monthNamesShort: ['一','二','三','四','五','六', |
| | | '七','八','九','十','十一','十二'], |
| | | dayNames: ['星期日','星期一','星期二','星期三','星期四','星期五','星期六'], |
| | | dayNamesShort: ['周日','周一','周二','周三','周四','周五','周六'], |
| | | dayNamesMin: ['日','一','二','三','四','五','六'], |
| | | weekHeader: '周', |
| | | dateFormat: 'yy/mm/dd', |
| | | firstDay: 1, |
| | | isRTL: false, |
| | | showMonthAfterYear: true, |
| | | yearSuffix: '年'}; |
| | | $.datepicker.setDefaults($.datepicker.regional['zh-TW']); |
| | | }); |
New file |
| | |
| | | /* Afrikaans initialisation for the jQuery UI date picker plugin. */ |
| | | /* Written by Renier Pretorius. */ |
| | | jQuery(function($){ |
| | | $.datepicker.regional['af'] = { |
| | | closeText: 'Selekteer', |
| | | prevText: 'Vorige', |
| | | nextText: 'Volgende', |
| | | currentText: 'Vandag', |
| | | monthNames: ['Januarie','Februarie','Maart','April','Mei','Junie', |
| | | 'Julie','Augustus','September','Oktober','November','Desember'], |
| | | monthNamesShort: ['Jan', 'Feb', 'Mrt', 'Apr', 'Mei', 'Jun', |
| | | 'Jul', 'Aug', 'Sep', 'Okt', 'Nov', 'Des'], |
| | | dayNames: ['Sondag', 'Maandag', 'Dinsdag', 'Woensdag', 'Donderdag', 'Vrydag', 'Saterdag'], |
| | | dayNamesShort: ['Son', 'Maa', 'Din', 'Woe', 'Don', 'Vry', 'Sat'], |
| | | dayNamesMin: ['So','Ma','Di','Wo','Do','Vr','Sa'], |
| | | weekHeader: 'Wk', |
| | | dateFormat: 'dd/mm/yy', |
| | | firstDay: 1, |
| | | isRTL: false, |
| | | showMonthAfterYear: false, |
| | | yearSuffix: ''}; |
| | | $.datepicker.setDefaults($.datepicker.regional['af']); |
| | | }); |
New file |
| | |
| | | /* Arabic Translation for jQuery UI date picker plugin. */ |
| | | /* Khaled Al Horani -- koko.dw@gmail.com */ |
| | | /* خالد الحوراني -- koko.dw@gmail.com */ |
| | | /* NOTE: monthNames are the original months names and they are the Arabic names, not the new months name فبراير - يناير and there isn't any Arabic roots for these months */ |
| | | jQuery(function($){ |
| | | $.datepicker.regional['ar'] = { |
| | | closeText: 'إغلاق', |
| | | prevText: '<السابق', |
| | | nextText: 'التالي>', |
| | | currentText: 'اليوم', |
| | | monthNames: ['كانون الثاني', 'شباط', 'آذار', 'نيسان', 'آذار', 'حزيران', |
| | | 'تموز', 'آب', 'أيلول', 'تشرين الأول', 'تشرين الثاني', 'كانون الأول'], |
| | | monthNamesShort: ['1','2','3','4','5','6','7','8','9','10','11','12'], |
| | | dayNames: ['السبت', 'الأحد', 'الاثنين', 'الثلاثاء', 'الأربعاء', 'الخميس', 'الجمعة'], |
| | | dayNamesShort: ['سبت', 'أحد', 'اثنين', 'ثلاثاء', 'أربعاء', 'خميس', 'جمعة'], |
| | | dayNamesMin: ['سبت', 'أحد', 'اثنين', 'ثلاثاء', 'أربعاء', 'خميس', 'جمعة'], |
| | | weekHeader: 'أسبوع', |
| | | dateFormat: 'dd/mm/yy', |
| | | firstDay: 0, |
| | | isRTL: true, |
| | | showMonthAfterYear: false, |
| | | yearSuffix: ''}; |
| | | $.datepicker.setDefaults($.datepicker.regional['ar']); |
| | | }); |
New file |
| | |
| | | /* Azerbaijani (UTF-8) initialisation for the jQuery UI date picker plugin. */ |
| | | /* Written by Jamil Najafov (necefov33@gmail.com). */ |
| | | jQuery(function($) { |
| | | $.datepicker.regional['az'] = { |
| | | closeText: 'Bağla', |
| | | prevText: '<Geri', |
| | | nextText: 'İrəli>', |
| | | currentText: 'Bugün', |
| | | monthNames: ['Yanvar','Fevral','Mart','Aprel','May','İyun', |
| | | 'İyul','Avqust','Sentyabr','Oktyabr','Noyabr','Dekabr'], |
| | | monthNamesShort: ['Yan','Fev','Mar','Apr','May','İyun', |
| | | 'İyul','Avq','Sen','Okt','Noy','Dek'], |
| | | dayNames: ['Bazar','Bazar ertəsi','Çərşənbə axşamı','Çərşənbə','Cümə axşamı','Cümə','Şənbə'], |
| | | dayNamesShort: ['B','Be','Ça','Ç','Ca','C','Ş'], |
| | | dayNamesMin: ['B','B','Ç','С','Ç','C','Ş'], |
| | | weekHeader: 'Hf', |
| | | dateFormat: 'dd.mm.yy', |
| | | firstDay: 1, |
| | | isRTL: false, |
| | | showMonthAfterYear: false, |
| | | yearSuffix: ''}; |
| | | $.datepicker.setDefaults($.datepicker.regional['az']); |
| | | }); |
New file |
| | |
| | | /* Bulgarian initialisation for the jQuery UI date picker plugin. */ |
| | | /* Written by Stoyan Kyosev (http://svest.org). */ |
| | | jQuery(function($){ |
| | | $.datepicker.regional['bg'] = { |
| | | closeText: 'затвори', |
| | | prevText: '<назад', |
| | | nextText: 'напред>', |
| | | nextBigText: '>>', |
| | | currentText: 'днес', |
| | | monthNames: ['Януари','Февруари','Март','Април','Май','Юни', |
| | | 'Юли','Август','Септември','Октомври','Ноември','Декември'], |
| | | monthNamesShort: ['Яну','Фев','Мар','Апр','Май','Юни', |
| | | 'Юли','Авг','Сеп','Окт','Нов','Дек'], |
| | | dayNames: ['Неделя','Понеделник','Вторник','Сряда','Четвъртък','Петък','Събота'], |
| | | dayNamesShort: ['Нед','Пон','Вто','Сря','Чет','Пет','Съб'], |
| | | dayNamesMin: ['Не','По','Вт','Ср','Че','Пе','Съ'], |
| | | weekHeader: 'Wk', |
| | | dateFormat: 'dd.mm.yy', |
| | | firstDay: 1, |
| | | isRTL: false, |
| | | showMonthAfterYear: false, |
| | | yearSuffix: ''}; |
| | | $.datepicker.setDefaults($.datepicker.regional['bg']); |
| | | }); |
New file |
| | |
| | | /* Bosnian i18n for the jQuery UI date picker plugin. */ |
| | | /* Written by Kenan Konjo. */ |
| | | jQuery(function($){ |
| | | $.datepicker.regional['bs'] = { |
| | | closeText: 'Zatvori', |
| | | prevText: '<', |
| | | nextText: '>', |
| | | currentText: 'Danas', |
| | | monthNames: ['Januar','Februar','Mart','April','Maj','Juni', |
| | | 'Juli','August','Septembar','Oktobar','Novembar','Decembar'], |
| | | monthNamesShort: ['Jan','Feb','Mar','Apr','Maj','Jun', |
| | | 'Jul','Aug','Sep','Okt','Nov','Dec'], |
| | | dayNames: ['Nedelja','Ponedeljak','Utorak','Srijeda','Četvrtak','Petak','Subota'], |
| | | dayNamesShort: ['Ned','Pon','Uto','Sri','Čet','Pet','Sub'], |
| | | dayNamesMin: ['Ne','Po','Ut','Sr','Če','Pe','Su'], |
| | | weekHeader: 'Wk', |
| | | dateFormat: 'dd.mm.yy', |
| | | firstDay: 1, |
| | | isRTL: false, |
| | | showMonthAfterYear: false, |
| | | yearSuffix: ''}; |
| | | $.datepicker.setDefaults($.datepicker.regional['bs']); |
| | | }); |
New file |
| | |
| | | /* Inicialització en català per a l'extenció 'calendar' per jQuery. */ |
| | | /* Writers: (joan.leon@gmail.com). */ |
| | | jQuery(function($){ |
| | | $.datepicker.regional['ca'] = { |
| | | closeText: 'Tancar', |
| | | prevText: '<Ant', |
| | | nextText: 'Seg>', |
| | | currentText: 'Avui', |
| | | monthNames: ['Gener','Febrer','Març','Abril','Maig','Juny', |
| | | 'Juliol','Agost','Setembre','Octubre','Novembre','Desembre'], |
| | | monthNamesShort: ['Gen','Feb','Mar','Abr','Mai','Jun', |
| | | 'Jul','Ago','Set','Oct','Nov','Des'], |
| | | dayNames: ['Diumenge','Dilluns','Dimarts','Dimecres','Dijous','Divendres','Dissabte'], |
| | | dayNamesShort: ['Dug','Dln','Dmt','Dmc','Djs','Dvn','Dsb'], |
| | | dayNamesMin: ['Dg','Dl','Dt','Dc','Dj','Dv','Ds'], |
| | | weekHeader: 'Sm', |
| | | dateFormat: 'dd/mm/yy', |
| | | firstDay: 1, |
| | | isRTL: false, |
| | | showMonthAfterYear: false, |
| | | yearSuffix: ''}; |
| | | $.datepicker.setDefaults($.datepicker.regional['ca']); |
| | | }); |
New file |
| | |
| | | /* Czech initialisation for the jQuery UI date picker plugin. */ |
| | | /* Written by Tomas Muller (tomas@tomas-muller.net). */ |
| | | jQuery(function($){ |
| | | $.datepicker.regional['cs'] = { |
| | | closeText: 'Zavřít', |
| | | prevText: '<Dříve', |
| | | nextText: 'Později>', |
| | | currentText: 'Nyní', |
| | | monthNames: ['leden','únor','březen','duben','květen','červen', |
| | | 'červenec','srpen','září','říjen','listopad','prosinec'], |
| | | monthNamesShort: ['led','úno','bře','dub','kvě','čer', |
| | | 'čvc','srp','zář','říj','lis','pro'], |
| | | dayNames: ['neděle', 'pondělí', 'úterý', 'středa', 'čtvrtek', 'pátek', 'sobota'], |
| | | dayNamesShort: ['ne', 'po', 'út', 'st', 'čt', 'pá', 'so'], |
| | | dayNamesMin: ['ne','po','út','st','čt','pá','so'], |
| | | weekHeader: 'Týd', |
| | | dateFormat: 'dd.mm.yy', |
| | | firstDay: 1, |
| | | isRTL: false, |
| | | showMonthAfterYear: false, |
| | | yearSuffix: ''}; |
| | | $.datepicker.setDefaults($.datepicker.regional['cs']); |
| | | }); |
New file |
| | |
| | | /* Danish initialisation for the jQuery UI date picker plugin. */ |
| | | /* Written by Jan Christensen ( deletestuff@gmail.com). */ |
| | | jQuery(function($){ |
| | | $.datepicker.regional['da'] = { |
| | | closeText: 'Luk', |
| | | prevText: '<Forrige', |
| | | nextText: 'Næste>', |
| | | currentText: 'Idag', |
| | | monthNames: ['Januar','Februar','Marts','April','Maj','Juni', |
| | | 'Juli','August','September','Oktober','November','December'], |
| | | monthNamesShort: ['Jan','Feb','Mar','Apr','Maj','Jun', |
| | | 'Jul','Aug','Sep','Okt','Nov','Dec'], |
| | | dayNames: ['Søndag','Mandag','Tirsdag','Onsdag','Torsdag','Fredag','Lørdag'], |
| | | dayNamesShort: ['Søn','Man','Tir','Ons','Tor','Fre','Lør'], |
| | | dayNamesMin: ['Sø','Ma','Ti','On','To','Fr','Lø'], |
| | | weekHeader: 'Uge', |
| | | dateFormat: 'dd-mm-yy', |
| | | firstDay: 1, |
| | | isRTL: false, |
| | | showMonthAfterYear: false, |
| | | yearSuffix: ''}; |
| | | $.datepicker.setDefaults($.datepicker.regional['da']); |
| | | }); |
New file |
| | |
| | | /* Swiss-German initialisation for the jQuery UI date picker plugin. */ |
| | | /* By Douglas Jose & Juerg Meier. */ |
| | | jQuery(function($){ |
| | | $.datepicker.regional['de-CH'] = { |
| | | closeText: 'schliessen', |
| | | prevText: '<zurück', |
| | | nextText: 'nächster>', |
| | | currentText: 'heute', |
| | | monthNames: ['Januar','Februar','März','April','Mai','Juni', |
| | | 'Juli','August','September','Oktober','November','Dezember'], |
| | | monthNamesShort: ['Jan','Feb','Mär','Apr','Mai','Jun', |
| | | 'Jul','Aug','Sep','Okt','Nov','Dez'], |
| | | dayNames: ['Sonntag','Montag','Dienstag','Mittwoch','Donnerstag','Freitag','Samstag'], |
| | | dayNamesShort: ['So','Mo','Di','Mi','Do','Fr','Sa'], |
| | | dayNamesMin: ['So','Mo','Di','Mi','Do','Fr','Sa'], |
| | | weekHeader: 'Wo', |
| | | dateFormat: 'dd.mm.yy', |
| | | firstDay: 1, |
| | | isRTL: false, |
| | | showMonthAfterYear: false, |
| | | yearSuffix: ''}; |
| | | $.datepicker.setDefaults($.datepicker.regional['de-CH']); |
| | | }); |
New file |
| | |
| | | /* German initialisation for the jQuery UI date picker plugin. */ |
| | | /* Written by Milian Wolff (mail@milianw.de). */ |
| | | jQuery(function($){ |
| | | $.datepicker.regional['de'] = { |
| | | closeText: 'schließen', |
| | | prevText: '<zurück', |
| | | nextText: 'Vor>', |
| | | currentText: 'heute', |
| | | monthNames: ['Januar','Februar','März','April','Mai','Juni', |
| | | 'Juli','August','September','Oktober','November','Dezember'], |
| | | monthNamesShort: ['Jan','Feb','Mär','Apr','Mai','Jun', |
| | | 'Jul','Aug','Sep','Okt','Nov','Dez'], |
| | | dayNames: ['Sonntag','Montag','Dienstag','Mittwoch','Donnerstag','Freitag','Samstag'], |
| | | dayNamesShort: ['So','Mo','Di','Mi','Do','Fr','Sa'], |
| | | dayNamesMin: ['So','Mo','Di','Mi','Do','Fr','Sa'], |
| | | weekHeader: 'Wo', |
| | | dateFormat: 'dd.mm.yy', |
| | | firstDay: 1, |
| | | isRTL: false, |
| | | showMonthAfterYear: false, |
| | | yearSuffix: ''}; |
| | | $.datepicker.setDefaults($.datepicker.regional['de']); |
| | | }); |
New file |
| | |
| | | /* Greek (el) initialisation for the jQuery UI date picker plugin. */ |
| | | /* Written by Alex Cicovic (http://www.alexcicovic.com) */ |
| | | jQuery(function($){ |
| | | $.datepicker.regional['el'] = { |
| | | closeText: 'Κλείσιμο', |
| | | prevText: 'Προηγούμενος', |
| | | nextText: 'Επόμενος', |
| | | currentText: 'Τρέχων Μήνας', |
| | | monthNames: ['Ιανουάριος','Φεβρουάριος','Μάρτιος','Απρίλιος','Μάιος','Ιούνιος', |
| | | 'Ιούλιος','Αύγουστος','Σεπτέμβριος','Οκτώβριος','Νοέμβριος','Δεκέμβριος'], |
| | | monthNamesShort: ['Ιαν','Φεβ','Μαρ','Απρ','Μαι','Ιουν', |
| | | 'Ιουλ','Αυγ','Σεπ','Οκτ','Νοε','Δεκ'], |
| | | dayNames: ['Κυριακή','Δευτέρα','Τρίτη','Τετάρτη','Πέμπτη','Παρασκευή','Σάββατο'], |
| | | dayNamesShort: ['Κυρ','Δευ','Τρι','Τετ','Πεμ','Παρ','Σαβ'], |
| | | dayNamesMin: ['Κυ','Δε','Τρ','Τε','Πε','Πα','Σα'], |
| | | weekHeader: 'Εβδ', |
| | | dateFormat: 'dd/mm/yy', |
| | | firstDay: 1, |
| | | isRTL: false, |
| | | showMonthAfterYear: false, |
| | | yearSuffix: ''}; |
| | | $.datepicker.setDefaults($.datepicker.regional['el']); |
| | | }); |
New file |
| | |
| | | /* English/UK initialisation for the jQuery UI date picker plugin. */ |
| | | /* Written by Stuart. */ |
| | | jQuery(function($){ |
| | | $.datepicker.regional['en-GB'] = { |
| | | closeText: 'Done', |
| | | prevText: 'Prev', |
| | | nextText: 'Next', |
| | | currentText: 'Today', |
| | | monthNames: ['January','February','March','April','May','June', |
| | | 'July','August','September','October','November','December'], |
| | | monthNamesShort: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', |
| | | 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'], |
| | | dayNames: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'], |
| | | dayNamesShort: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'], |
| | | dayNamesMin: ['Su','Mo','Tu','We','Th','Fr','Sa'], |
| | | weekHeader: 'Wk', |
| | | dateFormat: 'dd/mm/yy', |
| | | firstDay: 1, |
| | | isRTL: false, |
| | | showMonthAfterYear: false, |
| | | yearSuffix: ''}; |
| | | $.datepicker.setDefaults($.datepicker.regional['en-GB']); |
| | | }); |
New file |
| | |
| | | /* Esperanto initialisation for the jQuery UI date picker plugin. */ |
| | | /* Written by Olivier M. (olivierweb@ifrance.com). */ |
| | | jQuery(function($){ |
| | | $.datepicker.regional['eo'] = { |
| | | closeText: 'Fermi', |
| | | prevText: '<Anta', |
| | | nextText: 'Sekv>', |
| | | currentText: 'Nuna', |
| | | monthNames: ['Januaro','Februaro','Marto','Aprilo','Majo','Junio', |
| | | 'Julio','Aŭgusto','Septembro','Oktobro','Novembro','Decembro'], |
| | | monthNamesShort: ['Jan','Feb','Mar','Apr','Maj','Jun', |
| | | 'Jul','Aŭg','Sep','Okt','Nov','Dec'], |
| | | dayNames: ['Dimanĉo','Lundo','Mardo','Merkredo','Ĵaŭdo','Vendredo','Sabato'], |
| | | dayNamesShort: ['Dim','Lun','Mar','Mer','Ĵaŭ','Ven','Sab'], |
| | | dayNamesMin: ['Di','Lu','Ma','Me','Ĵa','Ve','Sa'], |
| | | weekHeader: 'Sb', |
| | | dateFormat: 'dd/mm/yy', |
| | | firstDay: 0, |
| | | isRTL: false, |
| | | showMonthAfterYear: false, |
| | | yearSuffix: ''}; |
| | | $.datepicker.setDefaults($.datepicker.regional['eo']); |
| | | }); |
New file |
| | |
| | | /* Inicialización en español para la extensión 'UI date picker' para jQuery. */ |
| | | /* Traducido por Vester (xvester@gmail.com). */ |
| | | jQuery(function($){ |
| | | $.datepicker.regional['es'] = { |
| | | closeText: 'Cerrar', |
| | | prevText: '<Ant', |
| | | nextText: 'Sig>', |
| | | currentText: 'Hoy', |
| | | monthNames: ['Enero','Febrero','Marzo','Abril','Mayo','Junio', |
| | | 'Julio','Agosto','Septiembre','Octubre','Noviembre','Diciembre'], |
| | | monthNamesShort: ['Ene','Feb','Mar','Abr','May','Jun', |
| | | 'Jul','Ago','Sep','Oct','Nov','Dic'], |
| | | dayNames: ['Domingo','Lunes','Martes','Miércoles','Jueves','Viernes','Sábado'], |
| | | dayNamesShort: ['Dom','Lun','Mar','Mié','Juv','Vie','Sáb'], |
| | | dayNamesMin: ['Do','Lu','Ma','Mi','Ju','Vi','Sá'], |
| | | weekHeader: 'Sm', |
| | | dateFormat: 'dd/mm/yy', |
| | | firstDay: 1, |
| | | isRTL: false, |
| | | showMonthAfterYear: false, |
| | | yearSuffix: ''}; |
| | | $.datepicker.setDefaults($.datepicker.regional['es']); |
| | | }); |
New file |
| | |
| | | /* Estonian initialisation for the jQuery UI date picker plugin. */ |
| | | /* Written by Mart Sõmermaa (mrts.pydev at gmail com). */ |
| | | jQuery(function($){ |
| | | $.datepicker.regional['et'] = { |
| | | closeText: 'Sulge', |
| | | prevText: 'Eelnev', |
| | | nextText: 'Järgnev', |
| | | currentText: 'Täna', |
| | | monthNames: ['Jaanuar','Veebruar','Märts','Aprill','Mai','Juuni', |
| | | 'Juuli','August','September','Oktoober','November','Detsember'], |
| | | monthNamesShort: ['Jaan', 'Veebr', 'Märts', 'Apr', 'Mai', 'Juuni', |
| | | 'Juuli', 'Aug', 'Sept', 'Okt', 'Nov', 'Dets'], |
| | | dayNames: ['Pühapäev', 'Esmaspäev', 'Teisipäev', 'Kolmapäev', 'Neljapäev', 'Reede', 'Laupäev'], |
| | | dayNamesShort: ['Pühap', 'Esmasp', 'Teisip', 'Kolmap', 'Neljap', 'Reede', 'Laup'], |
| | | dayNamesMin: ['P','E','T','K','N','R','L'], |
| | | weekHeader: 'Sm', |
| | | dateFormat: 'dd.mm.yy', |
| | | firstDay: 1, |
| | | isRTL: false, |
| | | showMonthAfterYear: false, |
| | | yearSuffix: ''}; |
| | | $.datepicker.setDefaults($.datepicker.regional['et']); |
| | | }); |
New file |
| | |
| | | /* Euskarako oinarria 'UI date picker' jquery-ko extentsioarentzat */ |
| | | /* Karrikas-ek itzulia (karrikas@karrikas.com) */ |
| | | jQuery(function($){ |
| | | $.datepicker.regional['eu'] = { |
| | | closeText: 'Egina', |
| | | prevText: '<Aur', |
| | | nextText: 'Hur>', |
| | | currentText: 'Gaur', |
| | | monthNames: ['Urtarrila','Otsaila','Martxoa','Apirila','Maiatza','Ekaina', |
| | | 'Uztaila','Abuztua','Iraila','Urria','Azaroa','Abendua'], |
| | | monthNamesShort: ['Urt','Ots','Mar','Api','Mai','Eka', |
| | | 'Uzt','Abu','Ira','Urr','Aza','Abe'], |
| | | dayNames: ['Igandea','Astelehena','Asteartea','Asteazkena','Osteguna','Ostirala','Larunbata'], |
| | | dayNamesShort: ['Iga','Ast','Ast','Ast','Ost','Ost','Lar'], |
| | | dayNamesMin: ['Ig','As','As','As','Os','Os','La'], |
| | | weekHeader: 'Wk', |
| | | dateFormat: 'yy/mm/dd', |
| | | firstDay: 1, |
| | | isRTL: false, |
| | | showMonthAfterYear: false, |
| | | yearSuffix: ''}; |
| | | $.datepicker.setDefaults($.datepicker.regional['eu']); |
| | | }); |
New file |
| | |
| | | /* Persian (Farsi) Translation for the jQuery UI date picker plugin. */ |
| | | /* Javad Mowlanezhad -- jmowla@gmail.com */ |
| | | /* Jalali calendar should supported soon! (Its implemented but I have to test it) */ |
| | | jQuery(function($) { |
| | | $.datepicker.regional['fa'] = { |
| | | closeText: 'بستن', |
| | | prevText: '<قبلي', |
| | | nextText: 'بعدي>', |
| | | currentText: 'امروز', |
| | | monthNames: ['فروردين','ارديبهشت','خرداد','تير','مرداد','شهريور', |
| | | 'مهر','آبان','آذر','دي','بهمن','اسفند'], |
| | | monthNamesShort: ['1','2','3','4','5','6','7','8','9','10','11','12'], |
| | | dayNames: ['يکشنبه','دوشنبه','سهشنبه','چهارشنبه','پنجشنبه','جمعه','شنبه'], |
| | | dayNamesShort: ['ي','د','س','چ','پ','ج', 'ش'], |
| | | dayNamesMin: ['ي','د','س','چ','پ','ج', 'ش'], |
| | | weekHeader: 'هف', |
| | | dateFormat: 'yy/mm/dd', |
| | | firstDay: 6, |
| | | isRTL: true, |
| | | showMonthAfterYear: false, |
| | | yearSuffix: ''}; |
| | | $.datepicker.setDefaults($.datepicker.regional['fa']); |
| | | }); |
New file |
| | |
| | | /* Finnish initialisation for the jQuery UI date picker plugin. */ |
| | | /* Written by Harri Kilpi� (harrikilpio@gmail.com). */ |
| | | jQuery(function($){ |
| | | $.datepicker.regional['fi'] = { |
| | | closeText: 'Sulje', |
| | | prevText: '«Edellinen', |
| | | nextText: 'Seuraava»', |
| | | currentText: 'Tänään', |
| | | monthNames: ['Tammikuu','Helmikuu','Maaliskuu','Huhtikuu','Toukokuu','Kesäkuu', |
| | | 'Heinäkuu','Elokuu','Syyskuu','Lokakuu','Marraskuu','Joulukuu'], |
| | | monthNamesShort: ['Tammi','Helmi','Maalis','Huhti','Touko','Kesä', |
| | | 'Heinä','Elo','Syys','Loka','Marras','Joulu'], |
| | | dayNamesShort: ['Su','Ma','Ti','Ke','To','Pe','Su'], |
| | | dayNames: ['Sunnuntai','Maanantai','Tiistai','Keskiviikko','Torstai','Perjantai','Lauantai'], |
| | | dayNamesMin: ['Su','Ma','Ti','Ke','To','Pe','La'], |
| | | weekHeader: 'Vk', |
| | | dateFormat: 'dd.mm.yy', |
| | | firstDay: 1, |
| | | isRTL: false, |
| | | showMonthAfterYear: false, |
| | | yearSuffix: ''}; |
| | | $.datepicker.setDefaults($.datepicker.regional['fi']); |
| | | }); |
New file |
| | |
| | | /* Faroese initialisation for the jQuery UI date picker plugin */ |
| | | /* Written by Sverri Mohr Olsen, sverrimo@gmail.com */ |
| | | jQuery(function($){ |
| | | $.datepicker.regional['fo'] = { |
| | | closeText: 'Lat aftur', |
| | | prevText: '<Fyrra', |
| | | nextText: 'Næsta>', |
| | | currentText: 'Í dag', |
| | | monthNames: ['Januar','Februar','Mars','Apríl','Mei','Juni', |
| | | 'Juli','August','September','Oktober','November','Desember'], |
| | | monthNamesShort: ['Jan','Feb','Mar','Apr','Mei','Jun', |
| | | 'Jul','Aug','Sep','Okt','Nov','Des'], |
| | | dayNames: ['Sunnudagur','Mánadagur','Týsdagur','Mikudagur','Hósdagur','Fríggjadagur','Leyardagur'], |
| | | dayNamesShort: ['Sun','Mán','Týs','Mik','Hós','Frí','Ley'], |
| | | dayNamesMin: ['Su','Má','Tý','Mi','Hó','Fr','Le'], |
| | | weekHeader: 'Vk', |
| | | dateFormat: 'dd-mm-yy', |
| | | firstDay: 0, |
| | | isRTL: false, |
| | | showMonthAfterYear: false, |
| | | yearSuffix: ''}; |
| | | $.datepicker.setDefaults($.datepicker.regional['fo']); |
| | | }); |
New file |
| | |
| | | /* Swiss-French initialisation for the jQuery UI date picker plugin. */ |
| | | /* Written Martin Voelkle (martin.voelkle@e-tc.ch). */ |
| | | jQuery(function($){ |
| | | $.datepicker.regional['fr-CH'] = { |
| | | closeText: 'Fermer', |
| | | prevText: '<Préc', |
| | | nextText: 'Suiv>', |
| | | currentText: 'Courant', |
| | | monthNames: ['Janvier','Février','Mars','Avril','Mai','Juin', |
| | | 'Juillet','Août','Septembre','Octobre','Novembre','Décembre'], |
| | | monthNamesShort: ['Jan','Fév','Mar','Avr','Mai','Jun', |
| | | 'Jul','Aoû','Sep','Oct','Nov','Déc'], |
| | | dayNames: ['Dimanche','Lundi','Mardi','Mercredi','Jeudi','Vendredi','Samedi'], |
| | | dayNamesShort: ['Dim','Lun','Mar','Mer','Jeu','Ven','Sam'], |
| | | dayNamesMin: ['Di','Lu','Ma','Me','Je','Ve','Sa'], |
| | | weekHeader: 'Sm', |
| | | dateFormat: 'dd.mm.yy', |
| | | firstDay: 1, |
| | | isRTL: false, |
| | | showMonthAfterYear: false, |
| | | yearSuffix: ''}; |
| | | $.datepicker.setDefaults($.datepicker.regional['fr-CH']); |
| | | }); |
New file |
| | |
| | | /* French initialisation for the jQuery UI date picker plugin. */ |
| | | /* Written by Keith Wood (kbwood{at}iinet.com.au) and Stéphane Nahmani (sholby@sholby.net). */ |
| | | jQuery(function($){ |
| | | $.datepicker.regional['fr'] = { |
| | | closeText: 'Fermer', |
| | | prevText: '<Préc', |
| | | nextText: 'Suiv>', |
| | | currentText: 'Courant', |
| | | monthNames: ['Janvier','Février','Mars','Avril','Mai','Juin', |
| | | 'Juillet','Août','Septembre','Octobre','Novembre','Décembre'], |
| | | monthNamesShort: ['Jan','Fév','Mar','Avr','Mai','Jun', |
| | | 'Jul','Aoû','Sep','Oct','Nov','Déc'], |
| | | dayNames: ['Dimanche','Lundi','Mardi','Mercredi','Jeudi','Vendredi','Samedi'], |
| | | dayNamesShort: ['Dim','Lun','Mar','Mer','Jeu','Ven','Sam'], |
| | | dayNamesMin: ['Di','Lu','Ma','Me','Je','Ve','Sa'], |
| | | weekHeader: 'Sm', |
| | | dateFormat: 'dd/mm/yy', |
| | | firstDay: 1, |
| | | isRTL: false, |
| | | showMonthAfterYear: false, |
| | | yearSuffix: ''}; |
| | | $.datepicker.setDefaults($.datepicker.regional['fr']); |
| | | }); |
New file |
| | |
| | | /* Galician localization for 'UI date picker' jQuery extension. */ |
| | | /* Translated by Jorge Barreiro <yortx.barry@gmail.com>. */ |
| | | jQuery(function($){ |
| | | $.datepicker.regional['gl'] = { |
| | | closeText: 'Pechar', |
| | | prevText: '<Ant', |
| | | nextText: 'Seg>', |
| | | currentText: 'Hoxe', |
| | | monthNames: ['Xaneiro','Febreiro','Marzo','Abril','Maio','Xuño', |
| | | 'Xullo','Agosto','Setembro','Outubro','Novembro','Decembro'], |
| | | monthNamesShort: ['Xan','Feb','Mar','Abr','Mai','Xuñ', |
| | | 'Xul','Ago','Set','Out','Nov','Dec'], |
| | | dayNames: ['Domingo','Luns','Martes','Mércores','Xoves','Venres','Sábado'], |
| | | dayNamesShort: ['Dom','Lun','Mar','Mér','Xov','Ven','Sáb'], |
| | | dayNamesMin: ['Do','Lu','Ma','Mé','Xo','Ve','Sá'], |
| | | weekHeader: 'Sm', |
| | | dateFormat: 'dd/mm/yy', |
| | | firstDay: 1, |
| | | isRTL: false, |
| | | showMonthAfterYear: false, |
| | | yearSuffix: ''}; |
| | | $.datepicker.setDefaults($.datepicker.regional['gl']); |
| | | }); |
New file |
| | |
| | | /* Hebrew initialisation for the UI Datepicker extension. */ |
| | | /* Written by Amir Hardon (ahardon at gmail dot com). */ |
| | | jQuery(function($){ |
| | | $.datepicker.regional['he'] = { |
| | | closeText: 'סגור', |
| | | prevText: '<הקודם', |
| | | nextText: 'הבא>', |
| | | currentText: 'היום', |
| | | monthNames: ['ינואר','פברואר','מרץ','אפריל','מאי','יוני', |
| | | 'יולי','אוגוסט','ספטמבר','אוקטובר','נובמבר','דצמבר'], |
| | | monthNamesShort: ['1','2','3','4','5','6', |
| | | '7','8','9','10','11','12'], |
| | | dayNames: ['ראשון','שני','שלישי','רביעי','חמישי','שישי','שבת'], |
| | | dayNamesShort: ['א\'','ב\'','ג\'','ד\'','ה\'','ו\'','שבת'], |
| | | dayNamesMin: ['א\'','ב\'','ג\'','ד\'','ה\'','ו\'','שבת'], |
| | | weekHeader: 'Wk', |
| | | dateFormat: 'dd/mm/yy', |
| | | firstDay: 0, |
| | | isRTL: true, |
| | | showMonthAfterYear: false, |
| | | yearSuffix: ''}; |
| | | $.datepicker.setDefaults($.datepicker.regional['he']); |
| | | }); |
New file |
| | |
| | | /* Croatian i18n for the jQuery UI date picker plugin. */ |
| | | /* Written by Vjekoslav Nesek. */ |
| | | jQuery(function($){ |
| | | $.datepicker.regional['hr'] = { |
| | | closeText: 'Zatvori', |
| | | prevText: '<', |
| | | nextText: '>', |
| | | currentText: 'Danas', |
| | | monthNames: ['Siječanj','Veljača','Ožujak','Travanj','Svibanj','Lipanj', |
| | | 'Srpanj','Kolovoz','Rujan','Listopad','Studeni','Prosinac'], |
| | | monthNamesShort: ['Sij','Velj','Ožu','Tra','Svi','Lip', |
| | | 'Srp','Kol','Ruj','Lis','Stu','Pro'], |
| | | dayNames: ['Nedjelja','Ponedjeljak','Utorak','Srijeda','Četvrtak','Petak','Subota'], |
| | | dayNamesShort: ['Ned','Pon','Uto','Sri','Čet','Pet','Sub'], |
| | | dayNamesMin: ['Ne','Po','Ut','Sr','Če','Pe','Su'], |
| | | weekHeader: 'Tje', |
| | | dateFormat: 'dd.mm.yy.', |
| | | firstDay: 1, |
| | | isRTL: false, |
| | | showMonthAfterYear: false, |
| | | yearSuffix: ''}; |
| | | $.datepicker.setDefaults($.datepicker.regional['hr']); |
| | | }); |
New file |
| | |
| | | /* Hungarian initialisation for the jQuery UI date picker plugin. */ |
| | | /* Written by Istvan Karaszi (jquery@spam.raszi.hu). */ |
| | | jQuery(function($){ |
| | | $.datepicker.regional['hu'] = { |
| | | closeText: 'bezárás', |
| | | prevText: '« vissza', |
| | | nextText: 'előre »', |
| | | currentText: 'ma', |
| | | monthNames: ['Január', 'Február', 'Március', 'Április', 'Május', 'Június', |
| | | 'Július', 'Augusztus', 'Szeptember', 'Október', 'November', 'December'], |
| | | monthNamesShort: ['Jan', 'Feb', 'Már', 'Ápr', 'Máj', 'Jún', |
| | | 'Júl', 'Aug', 'Szep', 'Okt', 'Nov', 'Dec'], |
| | | dayNames: ['Vasárnap', 'Hétfö', 'Kedd', 'Szerda', 'Csütörtök', 'Péntek', 'Szombat'], |
| | | dayNamesShort: ['Vas', 'Hét', 'Ked', 'Sze', 'Csü', 'Pén', 'Szo'], |
| | | dayNamesMin: ['V', 'H', 'K', 'Sze', 'Cs', 'P', 'Szo'], |
| | | weekHeader: 'Hé', |
| | | dateFormat: 'yy-mm-dd', |
| | | firstDay: 1, |
| | | isRTL: false, |
| | | showMonthAfterYear: false, |
| | | yearSuffix: ''}; |
| | | $.datepicker.setDefaults($.datepicker.regional['hu']); |
| | | }); |
New file |
| | |
| | | /* Armenian(UTF-8) initialisation for the jQuery UI date picker plugin. */ |
| | | /* Written by Levon Zakaryan (levon.zakaryan@gmail.com)*/ |
| | | jQuery(function($){ |
| | | $.datepicker.regional['hy'] = { |
| | | closeText: 'Փակել', |
| | | prevText: '<Նախ.', |
| | | nextText: 'Հաջ.>', |
| | | currentText: 'Այսօր', |
| | | monthNames: ['Հունվար','Փետրվար','Մարտ','Ապրիլ','Մայիս','Հունիս', |
| | | 'Հուլիս','Օգոստոս','Սեպտեմբեր','Հոկտեմբեր','Նոյեմբեր','Դեկտեմբեր'], |
| | | monthNamesShort: ['Հունվ','Փետր','Մարտ','Ապր','Մայիս','Հունիս', |
| | | 'Հուլ','Օգս','Սեպ','Հոկ','Նոյ','Դեկ'], |
| | | dayNames: ['կիրակի','եկուշաբթի','երեքշաբթի','չորեքշաբթի','հինգշաբթի','ուրբաթ','շաբաթ'], |
| | | dayNamesShort: ['կիր','երկ','երք','չրք','հնգ','ուրբ','շբթ'], |
| | | dayNamesMin: ['կիր','երկ','երք','չրք','հնգ','ուրբ','շբթ'], |
| | | weekHeader: 'ՇԲՏ', |
| | | dateFormat: 'dd.mm.yy', |
| | | firstDay: 1, |
| | | isRTL: false, |
| | | showMonthAfterYear: false, |
| | | yearSuffix: ''}; |
| | | $.datepicker.setDefaults($.datepicker.regional['hy']); |
| | | }); |
New file |
| | |
| | | /* Indonesian initialisation for the jQuery UI date picker plugin. */ |
| | | /* Written by Deden Fathurahman (dedenf@gmail.com). */ |
| | | jQuery(function($){ |
| | | $.datepicker.regional['id'] = { |
| | | closeText: 'Tutup', |
| | | prevText: '<mundur', |
| | | nextText: 'maju>', |
| | | currentText: 'hari ini', |
| | | monthNames: ['Januari','Februari','Maret','April','Mei','Juni', |
| | | 'Juli','Agustus','September','Oktober','Nopember','Desember'], |
| | | monthNamesShort: ['Jan','Feb','Mar','Apr','Mei','Jun', |
| | | 'Jul','Agus','Sep','Okt','Nop','Des'], |
| | | dayNames: ['Minggu','Senin','Selasa','Rabu','Kamis','Jumat','Sabtu'], |
| | | dayNamesShort: ['Min','Sen','Sel','Rab','kam','Jum','Sab'], |
| | | dayNamesMin: ['Mg','Sn','Sl','Rb','Km','jm','Sb'], |
| | | weekHeader: 'Mg', |
| | | dateFormat: 'dd/mm/yy', |
| | | firstDay: 0, |
| | | isRTL: false, |
| | | showMonthAfterYear: false, |
| | | yearSuffix: ''}; |
| | | $.datepicker.setDefaults($.datepicker.regional['id']); |
| | | }); |
New file |
| | |
| | | /* Icelandic initialisation for the jQuery UI date picker plugin. */ |
| | | /* Written by Haukur H. Thorsson (haukur@eskill.is). */ |
| | | jQuery(function($){ |
| | | $.datepicker.regional['is'] = { |
| | | closeText: 'Loka', |
| | | prevText: '< Fyrri', |
| | | nextText: 'Næsti >', |
| | | currentText: 'Í dag', |
| | | monthNames: ['Janúar','Febrúar','Mars','Apríl','Maí','Júní', |
| | | 'Júlí','Ágúst','September','Október','Nóvember','Desember'], |
| | | monthNamesShort: ['Jan','Feb','Mar','Apr','Maí','Jún', |
| | | 'Júl','Ágú','Sep','Okt','Nóv','Des'], |
| | | dayNames: ['Sunnudagur','Mánudagur','Þriðjudagur','Miðvikudagur','Fimmtudagur','Föstudagur','Laugardagur'], |
| | | dayNamesShort: ['Sun','Mán','Þri','Mið','Fim','Fös','Lau'], |
| | | dayNamesMin: ['Su','Má','Þr','Mi','Fi','Fö','La'], |
| | | weekHeader: 'Vika', |
| | | dateFormat: 'dd/mm/yy', |
| | | firstDay: 0, |
| | | isRTL: false, |
| | | showMonthAfterYear: false, |
| | | yearSuffix: ''}; |
| | | $.datepicker.setDefaults($.datepicker.regional['is']); |
| | | }); |
New file |
| | |
| | | /* Italian initialisation for the jQuery UI date picker plugin. */ |
| | | /* Written by Antonello Pasella (antonello.pasella@gmail.com). */ |
| | | jQuery(function($){ |
| | | $.datepicker.regional['it'] = { |
| | | closeText: 'Chiudi', |
| | | prevText: '<Prec', |
| | | nextText: 'Succ>', |
| | | currentText: 'Oggi', |
| | | monthNames: ['Gennaio','Febbraio','Marzo','Aprile','Maggio','Giugno', |
| | | 'Luglio','Agosto','Settembre','Ottobre','Novembre','Dicembre'], |
| | | monthNamesShort: ['Gen','Feb','Mar','Apr','Mag','Giu', |
| | | 'Lug','Ago','Set','Ott','Nov','Dic'], |
| | | dayNames: ['Domenica','Lunedì','Martedì','Mercoledì','Giovedì','Venerdì','Sabato'], |
| | | dayNamesShort: ['Dom','Lun','Mar','Mer','Gio','Ven','Sab'], |
| | | dayNamesMin: ['Do','Lu','Ma','Me','Gi','Ve','Sa'], |
| | | weekHeader: 'Sm', |
| | | dateFormat: 'dd/mm/yy', |
| | | firstDay: 1, |
| | | isRTL: false, |
| | | showMonthAfterYear: false, |
| | | yearSuffix: ''}; |
| | | $.datepicker.setDefaults($.datepicker.regional['it']); |
| | | }); |
New file |
| | |
| | | /* Japanese initialisation for the jQuery UI date picker plugin. */ |
| | | /* Written by Kentaro SATO (kentaro@ranvis.com). */ |
| | | jQuery(function($){ |
| | | $.datepicker.regional['ja'] = { |
| | | closeText: '閉じる', |
| | | prevText: '<前', |
| | | nextText: '次>', |
| | | currentText: '今日', |
| | | monthNames: ['1月','2月','3月','4月','5月','6月', |
| | | '7月','8月','9月','10月','11月','12月'], |
| | | monthNamesShort: ['1月','2月','3月','4月','5月','6月', |
| | | '7月','8月','9月','10月','11月','12月'], |
| | | dayNames: ['日曜日','月曜日','火曜日','水曜日','木曜日','金曜日','土曜日'], |
| | | dayNamesShort: ['日','月','火','水','木','金','土'], |
| | | dayNamesMin: ['日','月','火','水','木','金','土'], |
| | | weekHeader: '週', |
| | | dateFormat: 'yy/mm/dd', |
| | | firstDay: 0, |
| | | isRTL: false, |
| | | showMonthAfterYear: true, |
| | | yearSuffix: '年'}; |
| | | $.datepicker.setDefaults($.datepicker.regional['ja']); |
| | | }); |
New file |
| | |
| | | /* Korean initialisation for the jQuery calendar extension. */ |
| | | /* Written by DaeKwon Kang (ncrash.dk@gmail.com). */ |
| | | jQuery(function($){ |
| | | $.datepicker.regional['ko'] = { |
| | | closeText: '닫기', |
| | | prevText: '이전달', |
| | | nextText: '다음달', |
| | | currentText: '오늘', |
| | | monthNames: ['1월(JAN)','2월(FEB)','3월(MAR)','4월(APR)','5월(MAY)','6월(JUN)', |
| | | '7월(JUL)','8월(AUG)','9월(SEP)','10월(OCT)','11월(NOV)','12월(DEC)'], |
| | | monthNamesShort: ['1월(JAN)','2월(FEB)','3월(MAR)','4월(APR)','5월(MAY)','6월(JUN)', |
| | | '7월(JUL)','8월(AUG)','9월(SEP)','10월(OCT)','11월(NOV)','12월(DEC)'], |
| | | dayNames: ['일','월','화','수','목','금','토'], |
| | | dayNamesShort: ['일','월','화','수','목','금','토'], |
| | | dayNamesMin: ['일','월','화','수','목','금','토'], |
| | | weekHeader: 'Wk', |
| | | dateFormat: 'yy-mm-dd', |
| | | firstDay: 0, |
| | | isRTL: false, |
| | | showMonthAfterYear: false, |
| | | yearSuffix: '년'}; |
| | | $.datepicker.setDefaults($.datepicker.regional['ko']); |
| | | }); |
New file |
| | |
| | | /* Kazakh (UTF-8) initialisation for the jQuery UI date picker plugin. */ |
| | | /* Written by Dmitriy Karasyov (dmitriy.karasyov@gmail.com). */ |
| | | jQuery(function($){ |
| | | $.datepicker.regional['kz'] = { |
| | | closeText: 'Жабу', |
| | | prevText: '<Алдыңғы', |
| | | nextText: 'Келесі>', |
| | | currentText: 'Бүгін', |
| | | monthNames: ['Қаңтар','Ақпан','Наурыз','Сәуір','Мамыр','Маусым', |
| | | 'Шілде','Тамыз','Қыркүйек','Қазан','Қараша','Желтоқсан'], |
| | | monthNamesShort: ['Қаң','Ақп','Нау','Сәу','Мам','Мау', |
| | | 'Шіл','Там','Қыр','Қаз','Қар','Жел'], |
| | | dayNames: ['Жексенбі','Дүйсенбі','Сейсенбі','Сәрсенбі','Бейсенбі','Жұма','Сенбі'], |
| | | dayNamesShort: ['жкс','дсн','ссн','срс','бсн','жма','снб'], |
| | | dayNamesMin: ['Жк','Дс','Сс','Ср','Бс','Жм','Сн'], |
| | | weekHeader: 'Не', |
| | | dateFormat: 'dd.mm.yy', |
| | | firstDay: 1, |
| | | isRTL: false, |
| | | showMonthAfterYear: false, |
| | | yearSuffix: ''}; |
| | | $.datepicker.setDefaults($.datepicker.regional['kz']); |
| | | }); |
New file |
| | |
| | | /* Lithuanian (UTF-8) initialisation for the jQuery UI date picker plugin. */ |
| | | /* @author Arturas Paleicikas <arturas@avalon.lt> */ |
| | | jQuery(function($){ |
| | | $.datepicker.regional['lt'] = { |
| | | closeText: 'Uždaryti', |
| | | prevText: '<Atgal', |
| | | nextText: 'Pirmyn>', |
| | | currentText: 'Šiandien', |
| | | monthNames: ['Sausis','Vasaris','Kovas','Balandis','Gegužė','Birželis', |
| | | 'Liepa','Rugpjūtis','Rugsėjis','Spalis','Lapkritis','Gruodis'], |
| | | monthNamesShort: ['Sau','Vas','Kov','Bal','Geg','Bir', |
| | | 'Lie','Rugp','Rugs','Spa','Lap','Gru'], |
| | | dayNames: ['sekmadienis','pirmadienis','antradienis','trečiadienis','ketvirtadienis','penktadienis','šeštadienis'], |
| | | dayNamesShort: ['sek','pir','ant','tre','ket','pen','šeš'], |
| | | dayNamesMin: ['Se','Pr','An','Tr','Ke','Pe','Še'], |
| | | weekHeader: 'Wk', |
| | | dateFormat: 'yy-mm-dd', |
| | | firstDay: 1, |
| | | isRTL: false, |
| | | showMonthAfterYear: false, |
| | | yearSuffix: ''}; |
| | | $.datepicker.setDefaults($.datepicker.regional['lt']); |
| | | }); |
New file |
| | |
| | | /* Latvian (UTF-8) initialisation for the jQuery UI date picker plugin. */ |
| | | /* @author Arturas Paleicikas <arturas.paleicikas@metasite.net> */ |
| | | jQuery(function($){ |
| | | $.datepicker.regional['lv'] = { |
| | | closeText: 'Aizvērt', |
| | | prevText: 'Iepr', |
| | | nextText: 'Nāka', |
| | | currentText: 'Šodien', |
| | | monthNames: ['Janvāris','Februāris','Marts','Aprīlis','Maijs','Jūnijs', |
| | | 'Jūlijs','Augusts','Septembris','Oktobris','Novembris','Decembris'], |
| | | monthNamesShort: ['Jan','Feb','Mar','Apr','Mai','Jūn', |
| | | 'Jūl','Aug','Sep','Okt','Nov','Dec'], |
| | | dayNames: ['svētdiena','pirmdiena','otrdiena','trešdiena','ceturtdiena','piektdiena','sestdiena'], |
| | | dayNamesShort: ['svt','prm','otr','tre','ctr','pkt','sst'], |
| | | dayNamesMin: ['Sv','Pr','Ot','Tr','Ct','Pk','Ss'], |
| | | weekHeader: 'Nav', |
| | | dateFormat: 'dd-mm-yy', |
| | | firstDay: 1, |
| | | isRTL: false, |
| | | showMonthAfterYear: false, |
| | | yearSuffix: ''}; |
| | | $.datepicker.setDefaults($.datepicker.regional['lv']); |
| | | }); |
New file |
| | |
| | | /* Malaysian initialisation for the jQuery UI date picker plugin. */ |
| | | /* Written by Mohd Nawawi Mohamad Jamili (nawawi@ronggeng.net). */ |
| | | jQuery(function($){ |
| | | $.datepicker.regional['ms'] = { |
| | | closeText: 'Tutup', |
| | | prevText: '<Sebelum', |
| | | nextText: 'Selepas>', |
| | | currentText: 'hari ini', |
| | | monthNames: ['Januari','Februari','Mac','April','Mei','Jun', |
| | | 'Julai','Ogos','September','Oktober','November','Disember'], |
| | | monthNamesShort: ['Jan','Feb','Mac','Apr','Mei','Jun', |
| | | 'Jul','Ogo','Sep','Okt','Nov','Dis'], |
| | | dayNames: ['Ahad','Isnin','Selasa','Rabu','Khamis','Jumaat','Sabtu'], |
| | | dayNamesShort: ['Aha','Isn','Sel','Rab','kha','Jum','Sab'], |
| | | dayNamesMin: ['Ah','Is','Se','Ra','Kh','Ju','Sa'], |
| | | weekHeader: 'Mg', |
| | | dateFormat: 'dd/mm/yy', |
| | | firstDay: 0, |
| | | isRTL: false, |
| | | showMonthAfterYear: false, |
| | | yearSuffix: ''}; |
| | | $.datepicker.setDefaults($.datepicker.regional['ms']); |
| | | }); |
New file |
| | |
| | | /* Dutch/Belgian (UTF-8) initialisation for the jQuery UI date picker plugin. */ |
| | | /* Written by Mathias Bynens <http://mathiasbynens.be/> */ |
| | | jQuery(function($){ |
| | | $.datepicker.regional['nl-BE'] = { |
| | | closeText: 'Sluiten', |
| | | prevText: '←', |
| | | nextText: '→', |
| | | currentText: 'Vandaag', |
| | | monthNames: ['januari', 'februari', 'maart', 'april', 'mei', 'juni', |
| | | 'juli', 'augustus', 'september', 'oktober', 'november', 'december'], |
| | | monthNamesShort: ['jan', 'feb', 'maa', 'apr', 'mei', 'jun', |
| | | 'jul', 'aug', 'sep', 'okt', 'nov', 'dec'], |
| | | dayNames: ['zondag', 'maandag', 'dinsdag', 'woensdag', 'donderdag', 'vrijdag', 'zaterdag'], |
| | | dayNamesShort: ['zon', 'maa', 'din', 'woe', 'don', 'vri', 'zat'], |
| | | dayNamesMin: ['zo', 'ma', 'di', 'wo', 'do', 'vr', 'za'], |
| | | weekHeader: 'Wk', |
| | | dateFormat: 'dd/mm/yy', |
| | | firstDay: 1, |
| | | isRTL: false, |
| | | showMonthAfterYear: false, |
| | | yearSuffix: ''}; |
| | | $.datepicker.setDefaults($.datepicker.regional['nl-BE']); |
| | | }); |
New file |
| | |
| | | /* Dutch (UTF-8) initialisation for the jQuery UI date picker plugin. */ |
| | | /* Written by Mathias Bynens <http://mathiasbynens.be/> */ |
| | | jQuery(function($){ |
| | | $.datepicker.regional.nl = { |
| | | closeText: 'Sluiten', |
| | | prevText: '←', |
| | | nextText: '→', |
| | | currentText: 'Vandaag', |
| | | monthNames: ['januari', 'februari', 'maart', 'april', 'mei', 'juni', |
| | | 'juli', 'augustus', 'september', 'oktober', 'november', 'december'], |
| | | monthNamesShort: ['jan', 'feb', 'maa', 'apr', 'mei', 'jun', |
| | | 'jul', 'aug', 'sep', 'okt', 'nov', 'dec'], |
| | | dayNames: ['zondag', 'maandag', 'dinsdag', 'woensdag', 'donderdag', 'vrijdag', 'zaterdag'], |
| | | dayNamesShort: ['zon', 'maa', 'din', 'woe', 'don', 'vri', 'zat'], |
| | | dayNamesMin: ['zo', 'ma', 'di', 'wo', 'do', 'vr', 'za'], |
| | | weekHeader: 'Wk', |
| | | dateFormat: 'dd/mm/yy', |
| | | firstDay: 1, |
| | | isRTL: false, |
| | | showMonthAfterYear: false, |
| | | yearSuffix: ''}; |
| | | $.datepicker.setDefaults($.datepicker.regional.nl); |
| | | }); |
New file |
| | |
| | | /* Norwegian initialisation for the jQuery UI date picker plugin. */ |
| | | /* Written by Naimdjon Takhirov (naimdjon@gmail.com). */ |
| | | jQuery(function($){ |
| | | $.datepicker.regional['no'] = { |
| | | closeText: 'Lukk', |
| | | prevText: '«Forrige', |
| | | nextText: 'Neste»', |
| | | currentText: 'I dag', |
| | | monthNames: ['Januar','Februar','Mars','April','Mai','Juni', |
| | | 'Juli','August','September','Oktober','November','Desember'], |
| | | monthNamesShort: ['Jan','Feb','Mar','Apr','Mai','Jun', |
| | | 'Jul','Aug','Sep','Okt','Nov','Des'], |
| | | dayNamesShort: ['Søn','Man','Tir','Ons','Tor','Fre','Lør'], |
| | | dayNames: ['Søndag','Mandag','Tirsdag','Onsdag','Torsdag','Fredag','Lørdag'], |
| | | dayNamesMin: ['Sø','Ma','Ti','On','To','Fr','Lø'], |
| | | weekHeader: 'Uke', |
| | | dateFormat: 'yy-mm-dd', |
| | | firstDay: 0, |
| | | isRTL: false, |
| | | showMonthAfterYear: false, |
| | | yearSuffix: ''}; |
| | | $.datepicker.setDefaults($.datepicker.regional['no']); |
| | | }); |
New file |
| | |
| | | /* Polish initialisation for the jQuery UI date picker plugin. */ |
| | | /* Written by Jacek Wysocki (jacek.wysocki@gmail.com). */ |
| | | jQuery(function($){ |
| | | $.datepicker.regional['pl'] = { |
| | | closeText: 'Zamknij', |
| | | prevText: '<Poprzedni', |
| | | nextText: 'Następny>', |
| | | currentText: 'Dziś', |
| | | monthNames: ['Styczeń','Luty','Marzec','Kwiecień','Maj','Czerwiec', |
| | | 'Lipiec','Sierpień','Wrzesień','Październik','Listopad','Grudzień'], |
| | | monthNamesShort: ['Sty','Lu','Mar','Kw','Maj','Cze', |
| | | 'Lip','Sie','Wrz','Pa','Lis','Gru'], |
| | | dayNames: ['Niedziela','Poniedziałek','Wtorek','Środa','Czwartek','Piątek','Sobota'], |
| | | dayNamesShort: ['Nie','Pn','Wt','Śr','Czw','Pt','So'], |
| | | dayNamesMin: ['N','Pn','Wt','Śr','Cz','Pt','So'], |
| | | weekHeader: 'Tydz', |
| | | dateFormat: 'dd.mm.yy', |
| | | firstDay: 1, |
| | | isRTL: false, |
| | | showMonthAfterYear: false, |
| | | yearSuffix: ''}; |
| | | $.datepicker.setDefaults($.datepicker.regional['pl']); |
| | | }); |
New file |
| | |
| | | /* Brazilian initialisation for the jQuery UI date picker plugin. */ |
| | | /* Written by Leonildo Costa Silva (leocsilva@gmail.com). */ |
| | | jQuery(function($){ |
| | | $.datepicker.regional['pt-BR'] = { |
| | | closeText: 'Fechar', |
| | | prevText: '<Anterior', |
| | | nextText: 'Próximo>', |
| | | currentText: 'Hoje', |
| | | monthNames: ['Janeiro','Fevereiro','Março','Abril','Maio','Junho', |
| | | 'Julho','Agosto','Setembro','Outubro','Novembro','Dezembro'], |
| | | monthNamesShort: ['Jan','Fev','Mar','Abr','Mai','Jun', |
| | | 'Jul','Ago','Set','Out','Nov','Dez'], |
| | | dayNames: ['Domingo','Segunda-feira','Terça-feira','Quarta-feira','Quinta-feira','Sexta-feira','Sábado'], |
| | | dayNamesShort: ['Dom','Seg','Ter','Qua','Qui','Sex','Sáb'], |
| | | dayNamesMin: ['Dom','Seg','Ter','Qua','Qui','Sex','Sáb'], |
| | | weekHeader: 'Sm', |
| | | dateFormat: 'dd/mm/yy', |
| | | firstDay: 0, |
| | | isRTL: false, |
| | | showMonthAfterYear: false, |
| | | yearSuffix: ''}; |
| | | $.datepicker.setDefaults($.datepicker.regional['pt-BR']); |
| | | }); |
New file |
| | |
| | | /* Portuguese initialisation for the jQuery UI date picker plugin. */ |
| | | jQuery(function($){ |
| | | $.datepicker.regional['pt'] = { |
| | | closeText: 'Fechar', |
| | | prevText: '<Anterior', |
| | | nextText: 'Seguinte', |
| | | currentText: 'Hoje', |
| | | monthNames: ['Janeiro','Fevereiro','Março','Abril','Maio','Junho', |
| | | 'Julho','Agosto','Setembro','Outubro','Novembro','Dezembro'], |
| | | monthNamesShort: ['Jan','Fev','Mar','Abr','Mai','Jun', |
| | | 'Jul','Ago','Set','Out','Nov','Dez'], |
| | | dayNames: ['Domingo','Segunda-feira','Terça-feira','Quarta-feira','Quinta-feira','Sexta-feira','Sábado'], |
| | | dayNamesShort: ['Dom','Seg','Ter','Qua','Qui','Sex','Sáb'], |
| | | dayNamesMin: ['Dom','Seg','Ter','Qua','Qui','Sex','Sáb'], |
| | | weekHeader: 'Sem', |
| | | dateFormat: 'dd/mm/yy', |
| | | firstDay: 0, |
| | | isRTL: false, |
| | | showMonthAfterYear: false, |
| | | yearSuffix: ''}; |
| | | $.datepicker.setDefaults($.datepicker.regional['pt']); |
| | | }); |
New file |
| | |
| | | /* Romanian initialisation for the jQuery UI date picker plugin. |
| | | * |
| | | * Written by Edmond L. (ll_edmond@walla.com) |
| | | * and Ionut G. Stan (ionut.g.stan@gmail.com) |
| | | */ |
| | | jQuery(function($){ |
| | | $.datepicker.regional['ro'] = { |
| | | closeText: 'Închide', |
| | | prevText: '« Luna precedentă', |
| | | nextText: 'Luna următoare »', |
| | | currentText: 'Azi', |
| | | monthNames: ['Ianuarie','Februarie','Martie','Aprilie','Mai','Iunie', |
| | | 'Iulie','August','Septembrie','Octombrie','Noiembrie','Decembrie'], |
| | | monthNamesShort: ['Ian', 'Feb', 'Mar', 'Apr', 'Mai', 'Iun', |
| | | 'Iul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'], |
| | | dayNames: ['Duminică', 'Luni', 'Marţi', 'Miercuri', 'Joi', 'Vineri', 'Sâmbătă'], |
| | | dayNamesShort: ['Dum', 'Lun', 'Mar', 'Mie', 'Joi', 'Vin', 'Sâm'], |
| | | dayNamesMin: ['Du','Lu','Ma','Mi','Jo','Vi','Sâ'], |
| | | weekHeader: 'Săpt', |
| | | dateFormat: 'dd.mm.yy', |
| | | firstDay: 1, |
| | | isRTL: false, |
| | | showMonthAfterYear: false, |
| | | yearSuffix: ''}; |
| | | $.datepicker.setDefaults($.datepicker.regional['ro']); |
| | | }); |
New file |
| | |
| | | /* Russian (UTF-8) initialisation for the jQuery UI date picker plugin. */ |
| | | /* Written by Andrew Stromnov (stromnov@gmail.com). */ |
| | | jQuery(function($){ |
| | | $.datepicker.regional['ru'] = { |
| | | closeText: 'Закрыть', |
| | | prevText: '<Пред', |
| | | nextText: 'След>', |
| | | currentText: 'Сегодня', |
| | | monthNames: ['Январь','Февраль','Март','Апрель','Май','Июнь', |
| | | 'Июль','Август','Сентябрь','Октябрь','Ноябрь','Декабрь'], |
| | | monthNamesShort: ['Янв','Фев','Мар','Апр','Май','Июн', |
| | | 'Июл','Авг','Сен','Окт','Ноя','Дек'], |
| | | dayNames: ['воскресенье','понедельник','вторник','среда','четверг','пятница','суббота'], |
| | | dayNamesShort: ['вск','пнд','втр','срд','чтв','птн','сбт'], |
| | | dayNamesMin: ['Вс','Пн','Вт','Ср','Чт','Пт','Сб'], |
| | | weekHeader: 'Нед', |
| | | dateFormat: 'dd.mm.yy', |
| | | firstDay: 1, |
| | | isRTL: false, |
| | | showMonthAfterYear: false, |
| | | yearSuffix: ''}; |
| | | $.datepicker.setDefaults($.datepicker.regional['ru']); |
| | | }); |
New file |
| | |
| | | /* Slovak initialisation for the jQuery UI date picker plugin. */ |
| | | /* Written by Vojtech Rinik (vojto@hmm.sk). */ |
| | | jQuery(function($){ |
| | | $.datepicker.regional['sk'] = { |
| | | closeText: 'Zavrieť', |
| | | prevText: '<Predchádzajúci', |
| | | nextText: 'Nasledujúci>', |
| | | currentText: 'Dnes', |
| | | monthNames: ['Január','Február','Marec','Apríl','Máj','Jún', |
| | | 'Júl','August','September','Október','November','December'], |
| | | monthNamesShort: ['Jan','Feb','Mar','Apr','Máj','Jún', |
| | | 'Júl','Aug','Sep','Okt','Nov','Dec'], |
| | | dayNames: ['Nedel\'a','Pondelok','Utorok','Streda','Štvrtok','Piatok','Sobota'], |
| | | dayNamesShort: ['Ned','Pon','Uto','Str','Štv','Pia','Sob'], |
| | | dayNamesMin: ['Ne','Po','Ut','St','Št','Pia','So'], |
| | | weekHeader: 'Ty', |
| | | dateFormat: 'dd.mm.yy', |
| | | firstDay: 1, |
| | | isRTL: false, |
| | | showMonthAfterYear: false, |
| | | yearSuffix: ''}; |
| | | $.datepicker.setDefaults($.datepicker.regional['sk']); |
| | | }); |
New file |
| | |
| | | /* Slovenian initialisation for the jQuery UI date picker plugin. */ |
| | | /* Written by Jaka Jancar (jaka@kubje.org). */ |
| | | /* c = č, s = š z = ž C = Č S = Š Z = Ž */ |
| | | jQuery(function($){ |
| | | $.datepicker.regional['sl'] = { |
| | | closeText: 'Zapri', |
| | | prevText: '<Prejšnji', |
| | | nextText: 'Naslednji>', |
| | | currentText: 'Trenutni', |
| | | monthNames: ['Januar','Februar','Marec','April','Maj','Junij', |
| | | 'Julij','Avgust','September','Oktober','November','December'], |
| | | monthNamesShort: ['Jan','Feb','Mar','Apr','Maj','Jun', |
| | | 'Jul','Avg','Sep','Okt','Nov','Dec'], |
| | | dayNames: ['Nedelja','Ponedeljek','Torek','Sreda','Četrtek','Petek','Sobota'], |
| | | dayNamesShort: ['Ned','Pon','Tor','Sre','Čet','Pet','Sob'], |
| | | dayNamesMin: ['Ne','Po','To','Sr','Če','Pe','So'], |
| | | weekHeader: 'Teden', |
| | | dateFormat: 'dd.mm.yy', |
| | | firstDay: 1, |
| | | isRTL: false, |
| | | showMonthAfterYear: false, |
| | | yearSuffix: ''}; |
| | | $.datepicker.setDefaults($.datepicker.regional['sl']); |
| | | }); |
New file |
| | |
| | | /* Albanian initialisation for the jQuery UI date picker plugin. */ |
| | | /* Written by Flakron Bytyqi (flakron@gmail.com). */ |
| | | jQuery(function($){ |
| | | $.datepicker.regional['sq'] = { |
| | | closeText: 'mbylle', |
| | | prevText: '<mbrapa', |
| | | nextText: 'Përpara>', |
| | | currentText: 'sot', |
| | | monthNames: ['Janar','Shkurt','Mars','Prill','Maj','Qershor', |
| | | 'Korrik','Gusht','Shtator','Tetor','Nëntor','Dhjetor'], |
| | | monthNamesShort: ['Jan','Shk','Mar','Pri','Maj','Qer', |
| | | 'Kor','Gus','Sht','Tet','Nën','Dhj'], |
| | | dayNames: ['E Diel','E Hënë','E Martë','E Mërkurë','E Enjte','E Premte','E Shtune'], |
| | | dayNamesShort: ['Di','Hë','Ma','Më','En','Pr','Sh'], |
| | | dayNamesMin: ['Di','Hë','Ma','Më','En','Pr','Sh'], |
| | | weekHeader: 'Ja', |
| | | dateFormat: 'dd.mm.yy', |
| | | firstDay: 1, |
| | | isRTL: false, |
| | | showMonthAfterYear: false, |
| | | yearSuffix: ''}; |
| | | $.datepicker.setDefaults($.datepicker.regional['sq']); |
| | | }); |
New file |
| | |
| | | /* Serbian i18n for the jQuery UI date picker plugin. */ |
| | | /* Written by Dejan Dimić. */ |
| | | jQuery(function($){ |
| | | $.datepicker.regional['sr-SR'] = { |
| | | closeText: 'Zatvori', |
| | | prevText: '<', |
| | | nextText: '>', |
| | | currentText: 'Danas', |
| | | monthNames: ['Januar','Februar','Mart','April','Maj','Jun', |
| | | 'Jul','Avgust','Septembar','Oktobar','Novembar','Decembar'], |
| | | monthNamesShort: ['Jan','Feb','Mar','Apr','Maj','Jun', |
| | | 'Jul','Avg','Sep','Okt','Nov','Dec'], |
| | | dayNames: ['Nedelja','Ponedeljak','Utorak','Sreda','Četvrtak','Petak','Subota'], |
| | | dayNamesShort: ['Ned','Pon','Uto','Sre','Čet','Pet','Sub'], |
| | | dayNamesMin: ['Ne','Po','Ut','Sr','Če','Pe','Su'], |
| | | weekHeader: 'Sed', |
| | | dateFormat: 'dd/mm/yy', |
| | | firstDay: 1, |
| | | isRTL: false, |
| | | showMonthAfterYear: false, |
| | | yearSuffix: ''}; |
| | | $.datepicker.setDefaults($.datepicker.regional['sr-SR']); |
| | | }); |
New file |
| | |
| | | /* Serbian i18n for the jQuery UI date picker plugin. */ |
| | | /* Written by Dejan Dimić. */ |
| | | jQuery(function($){ |
| | | $.datepicker.regional['sr'] = { |
| | | closeText: 'Затвори', |
| | | prevText: '<', |
| | | nextText: '>', |
| | | currentText: 'Данас', |
| | | monthNames: ['Јануар','Фебруар','Март','Април','Мај','Јун', |
| | | 'Јул','Август','Септембар','Октобар','Новембар','Децембар'], |
| | | monthNamesShort: ['Јан','Феб','Мар','Апр','Мај','Јун', |
| | | 'Јул','Авг','Сеп','Окт','Нов','Дец'], |
| | | dayNames: ['Недеља','Понедељак','Уторак','Среда','Четвртак','Петак','Субота'], |
| | | dayNamesShort: ['Нед','Пон','Уто','Сре','Чет','Пет','Суб'], |
| | | dayNamesMin: ['Не','По','Ут','Ср','Че','Пе','Су'], |
| | | weekHeader: 'Сед', |
| | | dateFormat: 'dd/mm/yy', |
| | | firstDay: 1, |
| | | isRTL: false, |
| | | showMonthAfterYear: false, |
| | | yearSuffix: ''}; |
| | | $.datepicker.setDefaults($.datepicker.regional['sr']); |
| | | }); |
New file |
| | |
| | | /* Swedish initialisation for the jQuery UI date picker plugin. */ |
| | | /* Written by Anders Ekdahl ( anders@nomadiz.se). */ |
| | | jQuery(function($){ |
| | | $.datepicker.regional['sv'] = { |
| | | closeText: 'Stäng', |
| | | prevText: '«Förra', |
| | | nextText: 'Nästa»', |
| | | currentText: 'Idag', |
| | | monthNames: ['Januari','Februari','Mars','April','Maj','Juni', |
| | | 'Juli','Augusti','September','Oktober','November','December'], |
| | | monthNamesShort: ['Jan','Feb','Mar','Apr','Maj','Jun', |
| | | 'Jul','Aug','Sep','Okt','Nov','Dec'], |
| | | dayNamesShort: ['Sön','Mån','Tis','Ons','Tor','Fre','Lör'], |
| | | dayNames: ['Söndag','Måndag','Tisdag','Onsdag','Torsdag','Fredag','Lördag'], |
| | | dayNamesMin: ['Sö','Må','Ti','On','To','Fr','Lö'], |
| | | weekHeader: 'Ve', |
| | | dateFormat: 'yy-mm-dd', |
| | | firstDay: 1, |
| | | isRTL: false, |
| | | showMonthAfterYear: false, |
| | | yearSuffix: ''}; |
| | | $.datepicker.setDefaults($.datepicker.regional['sv']); |
| | | }); |
New file |
| | |
| | | /* Tamil (UTF-8) initialisation for the jQuery UI date picker plugin. */ |
| | | /* Written by S A Sureshkumar (saskumar@live.com). */ |
| | | jQuery(function($){ |
| | | $.datepicker.regional['ta'] = { |
| | | closeText: 'மூடு', |
| | | prevText: 'முன்னையது', |
| | | nextText: 'அடுத்தது', |
| | | currentText: 'இன்று', |
| | | monthNames: ['தை','மாசி','பங்குனி','சித்திரை','வைகாசி','ஆனி', |
| | | 'ஆடி','ஆவணி','புரட்டாசி','ஐப்பசி','கார்த்திகை','மார்கழி'], |
| | | monthNamesShort: ['தை','மாசி','பங்','சித்','வைகா','ஆனி', |
| | | 'ஆடி','ஆவ','புர','ஐப்','கார்','மார்'], |
| | | dayNames: ['ஞாயிற்றுக்கிழமை','திங்கட்கிழமை','செவ்வாய்க்கிழமை','புதன்கிழமை','வியாழக்கிழமை','வெள்ளிக்கிழமை','சனிக்கிழமை'], |
| | | dayNamesShort: ['ஞாயிறு','திங்கள்','செவ்வாய்','புதன்','வியாழன்','வெள்ளி','சனி'], |
| | | dayNamesMin: ['ஞா','தி','செ','பு','வி','வெ','ச'], |
| | | weekHeader: 'Не', |
| | | dateFormat: 'dd/mm/yy', |
| | | firstDay: 1, |
| | | isRTL: false, |
| | | showMonthAfterYear: false, |
| | | yearSuffix: ''}; |
| | | $.datepicker.setDefaults($.datepicker.regional['ta']); |
| | | }); |
New file |
| | |
| | | /* Thai initialisation for the jQuery UI date picker plugin. */ |
| | | /* Written by pipo (pipo@sixhead.com). */ |
| | | jQuery(function($){ |
| | | $.datepicker.regional['th'] = { |
| | | closeText: 'ปิด', |
| | | prevText: '« ย้อน', |
| | | nextText: 'ถัดไป »', |
| | | currentText: 'วันนี้', |
| | | monthNames: ['มกราคม','กุมภาพันธ์','มีนาคม','เมษายน','พฤษภาคม','มิถุนายน', |
| | | 'กรกฏาคม','สิงหาคม','กันยายน','ตุลาคม','พฤศจิกายน','ธันวาคม'], |
| | | monthNamesShort: ['ม.ค.','ก.พ.','มี.ค.','เม.ย.','พ.ค.','มิ.ย.', |
| | | 'ก.ค.','ส.ค.','ก.ย.','ต.ค.','พ.ย.','ธ.ค.'], |
| | | dayNames: ['อาทิตย์','จันทร์','อังคาร','พุธ','พฤหัสบดี','ศุกร์','เสาร์'], |
| | | dayNamesShort: ['อา.','จ.','อ.','พ.','พฤ.','ศ.','ส.'], |
| | | dayNamesMin: ['อา.','จ.','อ.','พ.','พฤ.','ศ.','ส.'], |
| | | weekHeader: 'Wk', |
| | | dateFormat: 'dd/mm/yy', |
| | | firstDay: 0, |
| | | isRTL: false, |
| | | showMonthAfterYear: false, |
| | | yearSuffix: ''}; |
| | | $.datepicker.setDefaults($.datepicker.regional['th']); |
| | | }); |
New file |
| | |
| | | /* Turkish initialisation for the jQuery UI date picker plugin. */ |
| | | /* Written by Izzet Emre Erkan (kara@karalamalar.net). */ |
| | | jQuery(function($){ |
| | | $.datepicker.regional['tr'] = { |
| | | closeText: 'kapat', |
| | | prevText: '<geri', |
| | | nextText: 'ileri>', |
| | | currentText: 'bugün', |
| | | monthNames: ['Ocak','Şubat','Mart','Nisan','Mayıs','Haziran', |
| | | 'Temmuz','Ağustos','Eylül','Ekim','Kasım','Aralık'], |
| | | monthNamesShort: ['Oca','Şub','Mar','Nis','May','Haz', |
| | | 'Tem','Ağu','Eyl','Eki','Kas','Ara'], |
| | | dayNames: ['Pazar','Pazartesi','Salı','Çarşamba','Perşembe','Cuma','Cumartesi'], |
| | | dayNamesShort: ['Pz','Pt','Sa','Ça','Pe','Cu','Ct'], |
| | | dayNamesMin: ['Pz','Pt','Sa','Ça','Pe','Cu','Ct'], |
| | | weekHeader: 'Hf', |
| | | dateFormat: 'dd.mm.yy', |
| | | firstDay: 1, |
| | | isRTL: false, |
| | | showMonthAfterYear: false, |
| | | yearSuffix: ''}; |
| | | $.datepicker.setDefaults($.datepicker.regional['tr']); |
| | | }); |
New file |
| | |
| | | /* Ukrainian (UTF-8) initialisation for the jQuery UI date picker plugin. */ |
| | | /* Written by Maxim Drogobitskiy (maxdao@gmail.com). */ |
| | | jQuery(function($){ |
| | | $.datepicker.regional['uk'] = { |
| | | closeText: 'Закрити', |
| | | prevText: '<', |
| | | nextText: '>', |
| | | currentText: 'Сьогодні', |
| | | monthNames: ['Січень','Лютий','Березень','Квітень','Травень','Червень', |
| | | 'Липень','Серпень','Вересень','Жовтень','Листопад','Грудень'], |
| | | monthNamesShort: ['Січ','Лют','Бер','Кві','Тра','Чер', |
| | | 'Лип','Сер','Вер','Жов','Лис','Гру'], |
| | | dayNames: ['неділя','понеділок','вівторок','середа','четвер','п’ятниця','субота'], |
| | | dayNamesShort: ['нед','пнд','вів','срд','чтв','птн','сбт'], |
| | | dayNamesMin: ['Нд','Пн','Вт','Ср','Чт','Пт','Сб'], |
| | | weekHeader: 'Не', |
| | | dateFormat: 'dd/mm/yy', |
| | | firstDay: 1, |
| | | isRTL: false, |
| | | showMonthAfterYear: false, |
| | | yearSuffix: ''}; |
| | | $.datepicker.setDefaults($.datepicker.regional['uk']); |
| | | }); |
New file |
| | |
| | | /* Vietnamese initialisation for the jQuery UI date picker plugin. */ |
| | | /* Translated by Le Thanh Huy (lthanhhuy@cit.ctu.edu.vn). */ |
| | | jQuery(function($){ |
| | | $.datepicker.regional['vi'] = { |
| | | closeText: 'Đóng', |
| | | prevText: '<Trước', |
| | | nextText: 'Tiếp>', |
| | | currentText: 'Hôm nay', |
| | | monthNames: ['Tháng Một', 'Tháng Hai', 'Tháng Ba', 'Tháng Tư', 'Tháng Năm', 'Tháng Sáu', |
| | | 'Tháng Bảy', 'Tháng Tám', 'Tháng Chín', 'Tháng Mười', 'Tháng Mười Một', 'Tháng Mười Hai'], |
| | | monthNamesShort: ['Tháng 1', 'Tháng 2', 'Tháng 3', 'Tháng 4', 'Tháng 5', 'Tháng 6', |
| | | 'Tháng 7', 'Tháng 8', 'Tháng 9', 'Tháng 10', 'Tháng 11', 'Tháng 12'], |
| | | dayNames: ['Chủ Nhật', 'Thứ Hai', 'Thứ Ba', 'Thứ Tư', 'Thứ Năm', 'Thứ Sáu', 'Thứ Bảy'], |
| | | dayNamesShort: ['CN', 'T2', 'T3', 'T4', 'T5', 'T6', 'T7'], |
| | | dayNamesMin: ['CN', 'T2', 'T3', 'T4', 'T5', 'T6', 'T7'], |
| | | weekHeader: 'Tu', |
| | | dateFormat: 'dd/mm/yy', |
| | | firstDay: 0, |
| | | isRTL: false, |
| | | showMonthAfterYear: false, |
| | | yearSuffix: ''}; |
| | | $.datepicker.setDefaults($.datepicker.regional['vi']); |
| | | }); |
New file |
| | |
| | | /* Chinese initialisation for the jQuery UI date picker plugin. */ |
| | | /* Written by Cloudream (cloudream@gmail.com). */ |
| | | jQuery(function($){ |
| | | $.datepicker.regional['zh-CN'] = { |
| | | closeText: '关闭', |
| | | prevText: '<上月', |
| | | nextText: '下月>', |
| | | currentText: '今天', |
| | | monthNames: ['一月','二月','三月','四月','五月','六月', |
| | | '七月','八月','九月','十月','十一月','十二月'], |
| | | monthNamesShort: ['一','二','三','四','五','六', |
| | | '七','八','九','十','十一','十二'], |
| | | dayNames: ['星期日','星期一','星期二','星期三','星期四','星期五','星期六'], |
| | | dayNamesShort: ['周日','周一','周二','周三','周四','周五','周六'], |
| | | dayNamesMin: ['日','一','二','三','四','五','六'], |
| | | weekHeader: '周', |
| | | dateFormat: 'yy-mm-dd', |
| | | firstDay: 1, |
| | | isRTL: false, |
| | | showMonthAfterYear: true, |
| | | yearSuffix: '年'}; |
| | | $.datepicker.setDefaults($.datepicker.regional['zh-CN']); |
| | | }); |
New file |
| | |
| | | /* Chinese initialisation for the jQuery UI date picker plugin. */ |
| | | /* Written by SCCY (samuelcychan@gmail.com). */ |
| | | jQuery(function($){ |
| | | $.datepicker.regional['zh-HK'] = { |
| | | closeText: '關閉', |
| | | prevText: '<上月', |
| | | nextText: '下月>', |
| | | currentText: '今天', |
| | | monthNames: ['一月','二月','三月','四月','五月','六月', |
| | | '七月','八月','九月','十月','十一月','十二月'], |
| | | monthNamesShort: ['一','二','三','四','五','六', |
| | | '七','八','九','十','十一','十二'], |
| | | dayNames: ['星期日','星期一','星期二','星期三','星期四','星期五','星期六'], |
| | | dayNamesShort: ['周日','周一','周二','周三','周四','周五','周六'], |
| | | dayNamesMin: ['日','一','二','三','四','五','六'], |
| | | weekHeader: '周', |
| | | dateFormat: 'dd-mm-yy', |
| | | firstDay: 0, |
| | | isRTL: false, |
| | | showMonthAfterYear: true, |
| | | yearSuffix: '年'}; |
| | | $.datepicker.setDefaults($.datepicker.regional['zh-HK']); |
| | | }); |
New file |
| | |
| | | /* Chinese initialisation for the jQuery UI date picker plugin. */ |
| | | /* Written by Ressol (ressol@gmail.com). */ |
| | | jQuery(function($){ |
| | | $.datepicker.regional['zh-TW'] = { |
| | | closeText: '關閉', |
| | | prevText: '<上月', |
| | | nextText: '下月>', |
| | | currentText: '今天', |
| | | monthNames: ['一月','二月','三月','四月','五月','六月', |
| | | '七月','八月','九月','十月','十一月','十二月'], |
| | | monthNamesShort: ['一','二','三','四','五','六', |
| | | '七','八','九','十','十一','十二'], |
| | | dayNames: ['星期日','星期一','星期二','星期三','星期四','星期五','星期六'], |
| | | dayNamesShort: ['周日','周一','周二','周三','周四','周五','周六'], |
| | | dayNamesMin: ['日','一','二','三','四','五','六'], |
| | | weekHeader: '周', |
| | | dateFormat: 'yy/mm/dd', |
| | | firstDay: 1, |
| | | isRTL: false, |
| | | showMonthAfterYear: true, |
| | | yearSuffix: '年'}; |
| | | $.datepicker.setDefaults($.datepicker.regional['zh-TW']); |
| | | }); |
New file |
| | |
| | | /*! |
| | | * jQuery UI 1.8.18 |
| | | * |
| | | * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) |
| | | * Dual licensed under the MIT or GPL Version 2 licenses. |
| | | * http://jquery.org/license |
| | | * |
| | | * http://docs.jquery.com/UI |
| | | */(function(a,b){function d(b){return!a(b).parents().andSelf().filter(function(){return a.curCSS(this,"visibility")==="hidden"||a.expr.filters.hidden(this)}).length}function c(b,c){var e=b.nodeName.toLowerCase();if("area"===e){var f=b.parentNode,g=f.name,h;if(!b.href||!g||f.nodeName.toLowerCase()!=="map")return!1;h=a("img[usemap=#"+g+"]")[0];return!!h&&d(h)}return(/input|select|textarea|button|object/.test(e)?!b.disabled:"a"==e?b.href||c:c)&&d(b)}a.ui=a.ui||{};a.ui.version||(a.extend(a.ui,{version:"1.8.18",keyCode:{ALT:18,BACKSPACE:8,CAPS_LOCK:20,COMMA:188,COMMAND:91,COMMAND_LEFT:91,COMMAND_RIGHT:93,CONTROL:17,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,INSERT:45,LEFT:37,MENU:93,NUMPAD_ADD:107,NUMPAD_DECIMAL:110,NUMPAD_DIVIDE:111,NUMPAD_ENTER:108,NUMPAD_MULTIPLY:106,NUMPAD_SUBTRACT:109,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SHIFT:16,SPACE:32,TAB:9,UP:38,WINDOWS:91}}),a.fn.extend({propAttr:a.fn.prop||a.fn.attr,_focus:a.fn.focus,focus:function(b,c){return typeof b=="number"?this.each(function(){var d=this;setTimeout(function(){a(d).focus(),c&&c.call(d)},b)}):this._focus.apply(this,arguments)},scrollParent:function(){var b;a.browser.msie&&/(static|relative)/.test(this.css("position"))||/absolute/.test(this.css("position"))?b=this.parents().filter(function(){return/(relative|absolute|fixed)/.test(a.curCSS(this,"position",1))&&/(auto|scroll)/.test(a.curCSS(this,"overflow",1)+a.curCSS(this,"overflow-y",1)+a.curCSS(this,"overflow-x",1))}).eq(0):b=this.parents().filter(function(){return/(auto|scroll)/.test(a.curCSS(this,"overflow",1)+a.curCSS(this,"overflow-y",1)+a.curCSS(this,"overflow-x",1))}).eq(0);return/fixed/.test(this.css("position"))||!b.length?a(document):b},zIndex:function(c){if(c!==b)return this.css("zIndex",c);if(this.length){var d=a(this[0]),e,f;while(d.length&&d[0]!==document){e=d.css("position");if(e==="absolute"||e==="relative"||e==="fixed"){f=parseInt(d.css("zIndex"),10);if(!isNaN(f)&&f!==0)return f}d=d.parent()}}return 0},disableSelection:function(){return this.bind((a.support.selectstart?"selectstart":"mousedown")+".ui-disableSelection",function(a){a.preventDefault()})},enableSelection:function(){return this.unbind(".ui-disableSelection")}}),a.each(["Width","Height"],function(c,d){function h(b,c,d,f){a.each(e,function(){c-=parseFloat(a.curCSS(b,"padding"+this,!0))||0,d&&(c-=parseFloat(a.curCSS(b,"border"+this+"Width",!0))||0),f&&(c-=parseFloat(a.curCSS(b,"margin"+this,!0))||0)});return c}var e=d==="Width"?["Left","Right"]:["Top","Bottom"],f=d.toLowerCase(),g={innerWidth:a.fn.innerWidth,innerHeight:a.fn.innerHeight,outerWidth:a.fn.outerWidth,outerHeight:a.fn.outerHeight};a.fn["inner"+d]=function(c){if(c===b)return g["inner"+d].call(this);return this.each(function(){a(this).css(f,h(this,c)+"px")})},a.fn["outer"+d]=function(b,c){if(typeof b!="number")return g["outer"+d].call(this,b);return this.each(function(){a(this).css(f,h(this,b,!0,c)+"px")})}}),a.extend(a.expr[":"],{data:function(b,c,d){return!!a.data(b,d[3])},focusable:function(b){return c(b,!isNaN(a.attr(b,"tabindex")))},tabbable:function(b){var d=a.attr(b,"tabindex"),e=isNaN(d);return(e||d>=0)&&c(b,!e)}}),a(function(){var b=document.body,c=b.appendChild(c=document.createElement("div"));c.offsetHeight,a.extend(c.style,{minHeight:"100px",height:"auto",padding:0,borderWidth:0}),a.support.minHeight=c.offsetHeight===100,a.support.selectstart="onselectstart"in c,b.removeChild(c).style.display="none"}),a.extend(a.ui,{plugin:{add:function(b,c,d){var e=a.ui[b].prototype;for(var f in d)e.plugins[f]=e.plugins[f]||[],e.plugins[f].push([c,d[f]])},call:function(a,b,c){var d=a.plugins[b];if(!!d&&!!a.element[0].parentNode)for(var e=0;e<d.length;e++)a.options[d[e][0]]&&d[e][1].apply(a.element,c)}},contains:function(a,b){return document.compareDocumentPosition?a.compareDocumentPosition(b)&16:a!==b&&a.contains(b)},hasScroll:function(b,c){if(a(b).css("overflow")==="hidden")return!1;var d=c&&c==="left"?"scrollLeft":"scrollTop",e=!1;if(b[d]>0)return!0;b[d]=1,e=b[d]>0,b[d]=0;return e},isOverAxis:function(a,b,c){return a>b&&a<b+c},isOver:function(b,c,d,e,f,g){return a.ui.isOverAxis(b,d,f)&&a.ui.isOverAxis(c,e,g)}}))})(jQuery);/*! |
| | | * jQuery UI Widget 1.8.18 |
| | | * |
| | | * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) |
| | | * Dual licensed under the MIT or GPL Version 2 licenses. |
| | | * http://jquery.org/license |
| | | * |
| | | * http://docs.jquery.com/UI/Widget |
| | | */(function(a,b){if(a.cleanData){var c=a.cleanData;a.cleanData=function(b){for(var d=0,e;(e=b[d])!=null;d++)try{a(e).triggerHandler("remove")}catch(f){}c(b)}}else{var d=a.fn.remove;a.fn.remove=function(b,c){return this.each(function(){c||(!b||a.filter(b,[this]).length)&&a("*",this).add([this]).each(function(){try{a(this).triggerHandler("remove")}catch(b){}});return d.call(a(this),b,c)})}}a.widget=function(b,c,d){var e=b.split(".")[0],f;b=b.split(".")[1],f=e+"-"+b,d||(d=c,c=a.Widget),a.expr[":"][f]=function(c){return!!a.data(c,b)},a[e]=a[e]||{},a[e][b]=function(a,b){arguments.length&&this._createWidget(a,b)};var g=new c;g.options=a.extend(!0,{},g.options),a[e][b].prototype=a.extend(!0,g,{namespace:e,widgetName:b,widgetEventPrefix:a[e][b].prototype.widgetEventPrefix||b,widgetBaseClass:f},d),a.widget.bridge(b,a[e][b])},a.widget.bridge=function(c,d){a.fn[c]=function(e){var f=typeof e=="string",g=Array.prototype.slice.call(arguments,1),h=this;e=!f&&g.length?a.extend.apply(null,[!0,e].concat(g)):e;if(f&&e.charAt(0)==="_")return h;f?this.each(function(){var d=a.data(this,c),f=d&&a.isFunction(d[e])?d[e].apply(d,g):d;if(f!==d&&f!==b){h=f;return!1}}):this.each(function(){var b=a.data(this,c);b?b.option(e||{})._init():a.data(this,c,new d(e,this))});return h}},a.Widget=function(a,b){arguments.length&&this._createWidget(a,b)},a.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",options:{disabled:!1},_createWidget:function(b,c){a.data(c,this.widgetName,this),this.element=a(c),this.options=a.extend(!0,{},this.options,this._getCreateOptions(),b);var d=this;this.element.bind("remove."+this.widgetName,function(){d.destroy()}),this._create(),this._trigger("create"),this._init()},_getCreateOptions:function(){return a.metadata&&a.metadata.get(this.element[0])[this.widgetName]},_create:function(){},_init:function(){},destroy:function(){this.element.unbind("."+this.widgetName).removeData(this.widgetName),this.widget().unbind("."+this.widgetName).removeAttr("aria-disabled").removeClass(this.widgetBaseClass+"-disabled "+"ui-state-disabled")},widget:function(){return this.element},option:function(c,d){var e=c;if(arguments.length===0)return a.extend({},this.options);if(typeof c=="string"){if(d===b)return this.options[c];e={},e[c]=d}this._setOptions(e);return this},_setOptions:function(b){var c=this;a.each(b,function(a,b){c._setOption(a,b)});return this},_setOption:function(a,b){this.options[a]=b,a==="disabled"&&this.widget()[b?"addClass":"removeClass"](this.widgetBaseClass+"-disabled"+" "+"ui-state-disabled").attr("aria-disabled",b);return this},enable:function(){return this._setOption("disabled",!1)},disable:function(){return this._setOption("disabled",!0)},_trigger:function(b,c,d){var e,f,g=this.options[b];d=d||{},c=a.Event(c),c.type=(b===this.widgetEventPrefix?b:this.widgetEventPrefix+b).toLowerCase(),c.target=this.element[0],f=c.originalEvent;if(f)for(e in f)e in c||(c[e]=f[e]);this.element.trigger(c,d);return!(a.isFunction(g)&&g.call(this.element[0],c,d)===!1||c.isDefaultPrevented())}}})(jQuery);/*! |
| | | * jQuery UI Mouse 1.8.18 |
| | | * |
| | | * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) |
| | | * Dual licensed under the MIT or GPL Version 2 licenses. |
| | | * http://jquery.org/license |
| | | * |
| | | * http://docs.jquery.com/UI/Mouse |
| | | * |
| | | * Depends: |
| | | * jquery.ui.widget.js |
| | | */(function(a,b){var c=!1;a(document).mouseup(function(a){c=!1}),a.widget("ui.mouse",{options:{cancel:":input,option",distance:1,delay:0},_mouseInit:function(){var b=this;this.element.bind("mousedown."+this.widgetName,function(a){return b._mouseDown(a)}).bind("click."+this.widgetName,function(c){if(!0===a.data(c.target,b.widgetName+".preventClickEvent")){a.removeData(c.target,b.widgetName+".preventClickEvent"),c.stopImmediatePropagation();return!1}}),this.started=!1},_mouseDestroy:function(){this.element.unbind("."+this.widgetName)},_mouseDown:function(b){if(!c){this._mouseStarted&&this._mouseUp(b),this._mouseDownEvent=b;var d=this,e=b.which==1,f=typeof this.options.cancel=="string"&&b.target.nodeName?a(b.target).closest(this.options.cancel).length:!1;if(!e||f||!this._mouseCapture(b))return!0;this.mouseDelayMet=!this.options.delay,this.mouseDelayMet||(this._mouseDelayTimer=setTimeout(function(){d.mouseDelayMet=!0},this.options.delay));if(this._mouseDistanceMet(b)&&this._mouseDelayMet(b)){this._mouseStarted=this._mouseStart(b)!==!1;if(!this._mouseStarted){b.preventDefault();return!0}}!0===a.data(b.target,this.widgetName+".preventClickEvent")&&a.removeData(b.target,this.widgetName+".preventClickEvent"),this._mouseMoveDelegate=function(a){return d._mouseMove(a)},this._mouseUpDelegate=function(a){return d._mouseUp(a)},a(document).bind("mousemove."+this.widgetName,this._mouseMoveDelegate).bind("mouseup."+this.widgetName,this._mouseUpDelegate),b.preventDefault(),c=!0;return!0}},_mouseMove:function(b){if(a.browser.msie&&!(document.documentMode>=9)&&!b.button)return this._mouseUp(b);if(this._mouseStarted){this._mouseDrag(b);return b.preventDefault()}this._mouseDistanceMet(b)&&this._mouseDelayMet(b)&&(this._mouseStarted=this._mouseStart(this._mouseDownEvent,b)!==!1,this._mouseStarted?this._mouseDrag(b):this._mouseUp(b));return!this._mouseStarted},_mouseUp:function(b){a(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate),this._mouseStarted&&(this._mouseStarted=!1,b.target==this._mouseDownEvent.target&&a.data(b.target,this.widgetName+".preventClickEvent",!0),this._mouseStop(b));return!1},_mouseDistanceMet:function(a){return Math.max(Math.abs(this._mouseDownEvent.pageX-a.pageX),Math.abs(this._mouseDownEvent.pageY-a.pageY))>=this.options.distance},_mouseDelayMet:function(a){return this.mouseDelayMet},_mouseStart:function(a){},_mouseDrag:function(a){},_mouseStop:function(a){},_mouseCapture:function(a){return!0}})})(jQuery);/* |
| | | * jQuery UI Position 1.8.18 |
| | | * |
| | | * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) |
| | | * Dual licensed under the MIT or GPL Version 2 licenses. |
| | | * http://jquery.org/license |
| | | * |
| | | * http://docs.jquery.com/UI/Position |
| | | */(function(a,b){a.ui=a.ui||{};var c=/left|center|right/,d=/top|center|bottom/,e="center",f={},g=a.fn.position,h=a.fn.offset;a.fn.position=function(b){if(!b||!b.of)return g.apply(this,arguments);b=a.extend({},b);var h=a(b.of),i=h[0],j=(b.collision||"flip").split(" "),k=b.offset?b.offset.split(" "):[0,0],l,m,n;i.nodeType===9?(l=h.width(),m=h.height(),n={top:0,left:0}):i.setTimeout?(l=h.width(),m=h.height(),n={top:h.scrollTop(),left:h.scrollLeft()}):i.preventDefault?(b.at="left top",l=m=0,n={top:b.of.pageY,left:b.of.pageX}):(l=h.outerWidth(),m=h.outerHeight(),n=h.offset()),a.each(["my","at"],function(){var a=(b[this]||"").split(" ");a.length===1&&(a=c.test(a[0])?a.concat([e]):d.test(a[0])?[e].concat(a):[e,e]),a[0]=c.test(a[0])?a[0]:e,a[1]=d.test(a[1])?a[1]:e,b[this]=a}),j.length===1&&(j[1]=j[0]),k[0]=parseInt(k[0],10)||0,k.length===1&&(k[1]=k[0]),k[1]=parseInt(k[1],10)||0,b.at[0]==="right"?n.left+=l:b.at[0]===e&&(n.left+=l/2),b.at[1]==="bottom"?n.top+=m:b.at[1]===e&&(n.top+=m/2),n.left+=k[0],n.top+=k[1];return this.each(function(){var c=a(this),d=c.outerWidth(),g=c.outerHeight(),h=parseInt(a.curCSS(this,"marginLeft",!0))||0,i=parseInt(a.curCSS(this,"marginTop",!0))||0,o=d+h+(parseInt(a.curCSS(this,"marginRight",!0))||0),p=g+i+(parseInt(a.curCSS(this,"marginBottom",!0))||0),q=a.extend({},n),r;b.my[0]==="right"?q.left-=d:b.my[0]===e&&(q.left-=d/2),b.my[1]==="bottom"?q.top-=g:b.my[1]===e&&(q.top-=g/2),f.fractions||(q.left=Math.round(q.left),q.top=Math.round(q.top)),r={left:q.left-h,top:q.top-i},a.each(["left","top"],function(c,e){a.ui.position[j[c]]&&a.ui.position[j[c]][e](q,{targetWidth:l,targetHeight:m,elemWidth:d,elemHeight:g,collisionPosition:r,collisionWidth:o,collisionHeight:p,offset:k,my:b.my,at:b.at})}),a.fn.bgiframe&&c.bgiframe(),c.offset(a.extend(q,{using:b.using}))})},a.ui.position={fit:{left:function(b,c){var d=a(window),e=c.collisionPosition.left+c.collisionWidth-d.width()-d.scrollLeft();b.left=e>0?b.left-e:Math.max(b.left-c.collisionPosition.left,b.left)},top:function(b,c){var d=a(window),e=c.collisionPosition.top+c.collisionHeight-d.height()-d.scrollTop();b.top=e>0?b.top-e:Math.max(b.top-c.collisionPosition.top,b.top)}},flip:{left:function(b,c){if(c.at[0]!==e){var d=a(window),f=c.collisionPosition.left+c.collisionWidth-d.width()-d.scrollLeft(),g=c.my[0]==="left"?-c.elemWidth:c.my[0]==="right"?c.elemWidth:0,h=c.at[0]==="left"?c.targetWidth:-c.targetWidth,i=-2*c.offset[0];b.left+=c.collisionPosition.left<0?g+h+i:f>0?g+h+i:0}},top:function(b,c){if(c.at[1]!==e){var d=a(window),f=c.collisionPosition.top+c.collisionHeight-d.height()-d.scrollTop(),g=c.my[1]==="top"?-c.elemHeight:c.my[1]==="bottom"?c.elemHeight:0,h=c.at[1]==="top"?c.targetHeight:-c.targetHeight,i=-2*c.offset[1];b.top+=c.collisionPosition.top<0?g+h+i:f>0?g+h+i:0}}}},a.offset.setOffset||(a.offset.setOffset=function(b,c){/static/.test(a.curCSS(b,"position"))&&(b.style.position="relative");var d=a(b),e=d.offset(),f=parseInt(a.curCSS(b,"top",!0),10)||0,g=parseInt(a.curCSS(b,"left",!0),10)||0,h={top:c.top-e.top+f,left:c.left-e.left+g};"using"in c?c.using.call(b,h):d.css(h)},a.fn.offset=function(b){var c=this[0];if(!c||!c.ownerDocument)return null;if(b)return this.each(function(){a.offset.setOffset(this,b)});return h.call(this)}),function(){var b=document.getElementsByTagName("body")[0],c=document.createElement("div"),d,e,g,h,i;d=document.createElement(b?"div":"body"),g={visibility:"hidden",width:0,height:0,border:0,margin:0,background:"none"},b&&a.extend(g,{position:"absolute",left:"-1000px",top:"-1000px"});for(var j in g)d.style[j]=g[j];d.appendChild(c),e=b||document.documentElement,e.insertBefore(d,e.firstChild),c.style.cssText="position: absolute; left: 10.7432222px; top: 10.432325px; height: 30px; width: 201px;",h=a(c).offset(function(a,b){return b}).offset(),d.innerHTML="",e.removeChild(d),i=h.top+h.left+(b?2e3:0),f.fractions=i>21&&i<22}()})(jQuery);/* |
| | | * jQuery UI Draggable 1.8.18 |
| | | * |
| | | * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) |
| | | * Dual licensed under the MIT or GPL Version 2 licenses. |
| | | * http://jquery.org/license |
| | | * |
| | | * http://docs.jquery.com/UI/Draggables |
| | | * |
| | | * Depends: |
| | | * jquery.ui.core.js |
| | | * jquery.ui.mouse.js |
| | | * jquery.ui.widget.js |
| | | */(function(a,b){a.widget("ui.draggable",a.ui.mouse,{widgetEventPrefix:"drag",options:{addClasses:!0,appendTo:"parent",axis:!1,connectToSortable:!1,containment:!1,cursor:"auto",cursorAt:!1,grid:!1,handle:!1,helper:"original",iframeFix:!1,opacity:!1,refreshPositions:!1,revert:!1,revertDuration:500,scope:"default",scroll:!0,scrollSensitivity:20,scrollSpeed:20,snap:!1,snapMode:"both",snapTolerance:20,stack:!1,zIndex:!1},_create:function(){this.options.helper=="original"&&!/^(?:r|a|f)/.test(this.element.css("position"))&&(this.element[0].style.position="relative"),this.options.addClasses&&this.element.addClass("ui-draggable"),this.options.disabled&&this.element.addClass("ui-draggable-disabled"),this._mouseInit()},destroy:function(){if(!!this.element.data("draggable")){this.element.removeData("draggable").unbind(".draggable").removeClass("ui-draggable ui-draggable-dragging ui-draggable-disabled"),this._mouseDestroy();return this}},_mouseCapture:function(b){var c=this.options;if(this.helper||c.disabled||a(b.target).is(".ui-resizable-handle"))return!1;this.handle=this._getHandle(b);if(!this.handle)return!1;c.iframeFix&&a(c.iframeFix===!0?"iframe":c.iframeFix).each(function(){a('<div class="ui-draggable-iframeFix" style="background: #fff;"></div>').css({width:this.offsetWidth+"px",height:this.offsetHeight+"px",position:"absolute",opacity:"0.001",zIndex:1e3}).css(a(this).offset()).appendTo("body")});return!0},_mouseStart:function(b){var c=this.options;this.helper=this._createHelper(b),this._cacheHelperProportions(),a.ui.ddmanager&&(a.ui.ddmanager.current=this),this._cacheMargins(),this.cssPosition=this.helper.css("position"),this.scrollParent=this.helper.scrollParent(),this.offset=this.positionAbs=this.element.offset(),this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left},a.extend(this.offset,{click:{left:b.pageX-this.offset.left,top:b.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()}),this.originalPosition=this.position=this._generatePosition(b),this.originalPageX=b.pageX,this.originalPageY=b.pageY,c.cursorAt&&this._adjustOffsetFromHelper(c.cursorAt),c.containment&&this._setContainment();if(this._trigger("start",b)===!1){this._clear();return!1}this._cacheHelperProportions(),a.ui.ddmanager&&!c.dropBehaviour&&a.ui.ddmanager.prepareOffsets(this,b),this.helper.addClass("ui-draggable-dragging"),this._mouseDrag(b,!0),a.ui.ddmanager&&a.ui.ddmanager.dragStart(this,b);return!0},_mouseDrag:function(b,c){this.position=this._generatePosition(b),this.positionAbs=this._convertPositionTo("absolute");if(!c){var d=this._uiHash();if(this._trigger("drag",b,d)===!1){this._mouseUp({});return!1}this.position=d.position}if(!this.options.axis||this.options.axis!="y")this.helper[0].style.left=this.position.left+"px";if(!this.options.axis||this.options.axis!="x")this.helper[0].style.top=this.position.top+"px";a.ui.ddmanager&&a.ui.ddmanager.drag(this,b);return!1},_mouseStop:function(b){var c=!1;a.ui.ddmanager&&!this.options.dropBehaviour&&(c=a.ui.ddmanager.drop(this,b)),this.dropped&&(c=this.dropped,this.dropped=!1);if((!this.element[0]||!this.element[0].parentNode)&&this.options.helper=="original")return!1;if(this.options.revert=="invalid"&&!c||this.options.revert=="valid"&&c||this.options.revert===!0||a.isFunction(this.options.revert)&&this.options.revert.call(this.element,c)){var d=this;a(this.helper).animate(this.originalPosition,parseInt(this.options.revertDuration,10),function(){d._trigger("stop",b)!==!1&&d._clear()})}else this._trigger("stop",b)!==!1&&this._clear();return!1},_mouseUp:function(b){this.options.iframeFix===!0&&a("div.ui-draggable-iframeFix").each(function(){this.parentNode.removeChild(this)}),a.ui.ddmanager&&a.ui.ddmanager.dragStop(this,b);return a.ui.mouse.prototype._mouseUp.call(this,b)},cancel:function(){this.helper.is(".ui-draggable-dragging")?this._mouseUp({}):this._clear();return this},_getHandle:function(b){var c=!this.options.handle||!a(this.options.handle,this.element).length?!0:!1;a(this.options.handle,this.element).find("*").andSelf().each(function(){this==b.target&&(c=!0)});return c},_createHelper:function(b){var c=this.options,d=a.isFunction(c.helper)?a(c.helper.apply(this.element[0],[b])):c.helper=="clone"?this.element.clone().removeAttr("id"):this.element;d.parents("body").length||d.appendTo(c.appendTo=="parent"?this.element[0].parentNode:c.appendTo),d[0]!=this.element[0]&&!/(fixed|absolute)/.test(d.css("position"))&&d.css("position","absolute");return d},_adjustOffsetFromHelper:function(b){typeof b=="string"&&(b=b.split(" ")),a.isArray(b)&&(b={left:+b[0],top:+b[1]||0}),"left"in b&&(this.offset.click.left=b.left+this.margins.left),"right"in b&&(this.offset.click.left=this.helperProportions.width-b.right+this.margins.left),"top"in b&&(this.offset.click.top=b.top+this.margins.top),"bottom"in b&&(this.offset.click.top=this.helperProportions.height-b.bottom+this.margins.top)},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var b=this.offsetParent.offset();this.cssPosition=="absolute"&&this.scrollParent[0]!=document&&a.ui.contains(this.scrollParent[0],this.offsetParent[0])&&(b.left+=this.scrollParent.scrollLeft(),b.top+=this.scrollParent.scrollTop());if(this.offsetParent[0]==document.body||this.offsetParent[0].tagName&&this.offsetParent[0].tagName.toLowerCase()=="html"&&a.browser.msie)b={top:0,left:0};return{top:b.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:b.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if(this.cssPosition=="relative"){var a=this.element.position();return{top:a.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:a.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}return{top:0,left:0}},_cacheMargins:function(){this.margins={left:parseInt(this.element.css("marginLeft"),10)||0,top:parseInt(this.element.css("marginTop"),10)||0,right:parseInt(this.element.css("marginRight"),10)||0,bottom:parseInt(this.element.css("marginBottom"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var b=this.options;b.containment=="parent"&&(b.containment=this.helper[0].parentNode);if(b.containment=="document"||b.containment=="window")this.containment=[b.containment=="document"?0:a(window).scrollLeft()-this.offset.relative.left-this.offset.parent.left,b.containment=="document"?0:a(window).scrollTop()-this.offset.relative.top-this.offset.parent.top,(b.containment=="document"?0:a(window).scrollLeft())+a(b.containment=="document"?document:window).width()-this.helperProportions.width-this.margins.left,(b.containment=="document"?0:a(window).scrollTop())+(a(b.containment=="document"?document:window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top];if(!/^(document|window|parent)$/.test(b.containment)&&b.containment.constructor!=Array){var c=a(b.containment),d=c[0];if(!d)return;var e=c.offset(),f=a(d).css("overflow")!="hidden";this.containment=[(parseInt(a(d).css("borderLeftWidth"),10)||0)+(parseInt(a(d).css("paddingLeft"),10)||0),(parseInt(a(d).css("borderTopWidth"),10)||0)+(parseInt(a(d).css("paddingTop"),10)||0),(f?Math.max(d.scrollWidth,d.offsetWidth):d.offsetWidth)-(parseInt(a(d).css("borderLeftWidth"),10)||0)-(parseInt(a(d).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left-this.margins.right,(f?Math.max(d.scrollHeight,d.offsetHeight):d.offsetHeight)-(parseInt(a(d).css("borderTopWidth"),10)||0)-(parseInt(a(d).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top-this.margins.bottom],this.relative_container=c}else b.containment.constructor==Array&&(this.containment=b.containment)},_convertPositionTo:function(b,c){c||(c=this.position);var d=b=="absolute"?1:-1,e=this.options,f=this.cssPosition=="absolute"&&(this.scrollParent[0]==document||!a.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,g=/(html|body)/i.test(f[0].tagName);return{top:c.top+this.offset.relative.top*d+this.offset.parent.top*d-(a.browser.safari&&a.browser.version<526&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollTop():g?0:f.scrollTop())*d),left:c.left+this.offset.relative.left*d+this.offset.parent.left*d-(a.browser.safari&&a.browser.version<526&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():g?0:f.scrollLeft())*d)}},_generatePosition:function(b){var c=this.options,d=this.cssPosition=="absolute"&&(this.scrollParent[0]==document||!a.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,e=/(html|body)/i.test(d[0].tagName),f=b.pageX,g=b.pageY;if(this.originalPosition){var h;if(this.containment){if(this.relative_container){var i=this.relative_container.offset();h=[this.containment[0]+i.left,this.containment[1]+i.top,this.containment[2]+i.left,this.containment[3]+i.top]}else h=this.containment;b.pageX-this.offset.click.left<h[0]&&(f=h[0]+this.offset.click.left),b.pageY-this.offset.click.top<h[1]&&(g=h[1]+this.offset.click.top),b.pageX-this.offset.click.left>h[2]&&(f=h[2]+this.offset.click.left),b.pageY-this.offset.click.top>h[3]&&(g=h[3]+this.offset.click.top)}if(c.grid){var j=c.grid[1]?this.originalPageY+Math.round((g-this.originalPageY)/c.grid[1])*c.grid[1]:this.originalPageY;g=h?j-this.offset.click.top<h[1]||j-this.offset.click.top>h[3]?j-this.offset.click.top<h[1]?j+c.grid[1]:j-c.grid[1]:j:j;var k=c.grid[0]?this.originalPageX+Math.round((f-this.originalPageX)/c.grid[0])*c.grid[0]:this.originalPageX;f=h?k-this.offset.click.left<h[0]||k-this.offset.click.left>h[2]?k-this.offset.click.left<h[0]?k+c.grid[0]:k-c.grid[0]:k:k}}return{top:g-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+(a.browser.safari&&a.browser.version<526&&this.cssPosition=="fixed"?0:this.cssPosition=="fixed"?-this.scrollParent.scrollTop():e?0:d.scrollTop()),left:f-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+(a.browser.safari&&a.browser.version<526&&this.cssPosition=="fixed"?0:this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():e?0:d.scrollLeft())}},_clear:function(){this.helper.removeClass("ui-draggable-dragging"),this.helper[0]!=this.element[0]&&!this.cancelHelperRemoval&&this.helper.remove(),this.helper=null,this.cancelHelperRemoval=!1},_trigger:function(b,c,d){d=d||this._uiHash(),a.ui.plugin.call(this,b,[c,d]),b=="drag"&&(this.positionAbs=this._convertPositionTo("absolute"));return a.Widget.prototype._trigger.call(this,b,c,d)},plugins:{},_uiHash:function(a){return{helper:this.helper,position:this.position,originalPosition:this.originalPosition,offset:this.positionAbs}}}),a.extend(a.ui.draggable,{version:"1.8.18"}),a.ui.plugin.add("draggable","connectToSortable",{start:function(b,c){var d=a(this).data("draggable"),e=d.options,f=a.extend({},c,{item:d.element});d.sortables=[],a(e.connectToSortable).each(function(){var c=a.data(this,"sortable");c&&!c.options.disabled&&(d.sortables.push({instance:c,shouldRevert:c.options.revert}),c.refreshPositions(),c._trigger("activate",b,f))})},stop:function(b,c){var d=a(this).data("draggable"),e=a.extend({},c,{item:d.element});a.each(d.sortables,function(){this.instance.isOver?(this.instance.isOver=0,d.cancelHelperRemoval=!0,this.instance.cancelHelperRemoval=!1,this.shouldRevert&&(this.instance.options.revert=!0),this.instance._mouseStop(b),this.instance.options.helper=this.instance.options._helper,d.options.helper=="original"&&this.instance.currentItem.css({top:"auto",left:"auto"})):(this.instance.cancelHelperRemoval=!1,this.instance._trigger("deactivate",b,e))})},drag:function(b,c){var d=a(this).data("draggable"),e=this,f=function(b){var c=this.offset.click.top,d=this.offset.click.left,e=this.positionAbs.top,f=this.positionAbs.left,g=b.height,h=b.width,i=b.top,j=b.left;return a.ui.isOver(e+c,f+d,i,j,g,h)};a.each(d.sortables,function(f){this.instance.positionAbs=d.positionAbs,this.instance.helperProportions=d.helperProportions,this.instance.offset.click=d.offset.click,this.instance._intersectsWith(this.instance.containerCache)?(this.instance.isOver||(this.instance.isOver=1,this.instance.currentItem=a(e).clone().removeAttr("id").appendTo(this.instance.element).data("sortable-item",!0),this.instance.options._helper=this.instance.options.helper,this.instance.options.helper=function(){return c.helper[0]},b.target=this.instance.currentItem[0],this.instance._mouseCapture(b,!0),this.instance._mouseStart(b,!0,!0),this.instance.offset.click.top=d.offset.click.top,this.instance.offset.click.left=d.offset.click.left,this.instance.offset.parent.left-=d.offset.parent.left-this.instance.offset.parent.left,this.instance.offset.parent.top-=d.offset.parent.top-this.instance.offset.parent.top,d._trigger("toSortable",b),d.dropped=this.instance.element,d.currentItem=d.element,this.instance.fromOutside=d),this.instance.currentItem&&this.instance._mouseDrag(b)):this.instance.isOver&&(this.instance.isOver=0,this.instance.cancelHelperRemoval=!0,this.instance.options.revert=!1,this.instance._trigger("out",b,this.instance._uiHash(this.instance)),this.instance._mouseStop(b,!0),this.instance.options.helper=this.instance.options._helper,this.instance.currentItem.remove(),this.instance.placeholder&&this.instance.placeholder.remove(),d._trigger("fromSortable",b),d.dropped=!1)})}}),a.ui.plugin.add("draggable","cursor",{start:function(b,c){var d=a("body"),e=a(this).data("draggable").options;d.css("cursor")&&(e._cursor=d.css("cursor")),d.css("cursor",e.cursor)},stop:function(b,c){var d=a(this).data("draggable").options;d._cursor&&a("body").css("cursor",d._cursor)}}),a.ui.plugin.add("draggable","opacity",{start:function(b,c){var d=a(c.helper),e=a(this).data("draggable").options;d.css("opacity")&&(e._opacity=d.css("opacity")),d.css("opacity",e.opacity)},stop:function(b,c){var d=a(this).data("draggable").options;d._opacity&&a(c.helper).css("opacity",d._opacity)}}),a.ui.plugin.add("draggable","scroll",{start:function(b,c){var d=a(this).data("draggable");d.scrollParent[0]!=document&&d.scrollParent[0].tagName!="HTML"&&(d.overflowOffset=d.scrollParent.offset())},drag:function(b,c){var d=a(this).data("draggable"),e=d.options,f=!1;if(d.scrollParent[0]!=document&&d.scrollParent[0].tagName!="HTML"){if(!e.axis||e.axis!="x")d.overflowOffset.top+d.scrollParent[0].offsetHeight-b.pageY<e.scrollSensitivity?d.scrollParent[0].scrollTop=f=d.scrollParent[0].scrollTop+e.scrollSpeed:b.pageY-d.overflowOffset.top<e.scrollSensitivity&&(d.scrollParent[0].scrollTop=f=d.scrollParent[0].scrollTop-e.scrollSpeed);if(!e.axis||e.axis!="y")d.overflowOffset.left+d.scrollParent[0].offsetWidth-b.pageX<e.scrollSensitivity?d.scrollParent[0].scrollLeft=f=d.scrollParent[0].scrollLeft+e.scrollSpeed:b.pageX-d.overflowOffset.left<e.scrollSensitivity&&(d.scrollParent[0].scrollLeft=f=d.scrollParent[0].scrollLeft-e.scrollSpeed)}else{if(!e.axis||e.axis!="x")b.pageY-a(document).scrollTop()<e.scrollSensitivity?f=a(document).scrollTop(a(document).scrollTop()-e.scrollSpeed):a(window).height()-(b.pageY-a(document).scrollTop())<e.scrollSensitivity&&(f=a(document).scrollTop(a(document).scrollTop()+e.scrollSpeed));if(!e.axis||e.axis!="y")b.pageX-a(document).scrollLeft()<e.scrollSensitivity?f=a(document).scrollLeft(a(document).scrollLeft()-e.scrollSpeed):a(window).width()-(b.pageX-a(document).scrollLeft())<e.scrollSensitivity&&(f=a(document).scrollLeft(a(document).scrollLeft()+e.scrollSpeed))}f!==!1&&a.ui.ddmanager&&!e.dropBehaviour&&a.ui.ddmanager.prepareOffsets(d,b)}}),a.ui.plugin.add("draggable","snap",{start:function(b,c){var d=a(this).data("draggable"),e=d.options;d.snapElements=[],a(e.snap.constructor!=String?e.snap.items||":data(draggable)":e.snap).each(function(){var b=a(this),c=b.offset();this!=d.element[0]&&d.snapElements.push({item:this,width:b.outerWidth(),height:b.outerHeight(),top:c.top,left:c.left})})},drag:function(b,c){var d=a(this).data("draggable"),e=d.options,f=e.snapTolerance,g=c.offset.left,h=g+d.helperProportions.width,i=c.offset.top,j=i+d.helperProportions.height;for(var k=d.snapElements.length-1;k>=0;k--){var l=d.snapElements[k].left,m=l+d.snapElements[k].width,n=d.snapElements[k].top,o=n+d.snapElements[k].height;if(!(l-f<g&&g<m+f&&n-f<i&&i<o+f||l-f<g&&g<m+f&&n-f<j&&j<o+f||l-f<h&&h<m+f&&n-f<i&&i<o+f||l-f<h&&h<m+f&&n-f<j&&j<o+f)){d.snapElements[k].snapping&&d.options.snap.release&&d.options.snap.release.call(d.element,b,a.extend(d._uiHash(),{snapItem:d.snapElements[k].item})),d.snapElements[k].snapping=!1;continue}if(e.snapMode!="inner"){var p=Math.abs(n-j)<=f,q=Math.abs(o-i)<=f,r=Math.abs(l-h)<=f,s=Math.abs(m-g)<=f;p&&(c.position.top=d._convertPositionTo("relative",{top:n-d.helperProportions.height,left:0}).top-d.margins.top),q&&(c.position.top=d._convertPositionTo("relative",{top:o,left:0}).top-d.margins.top),r&&(c.position.left=d._convertPositionTo("relative",{top:0,left:l-d.helperProportions.width}).left-d.margins.left),s&&(c.position.left=d._convertPositionTo("relative",{top:0,left:m}).left-d.margins.left)}var t=p||q||r||s;if(e.snapMode!="outer"){var p=Math.abs(n-i)<=f,q=Math.abs(o-j)<=f,r=Math.abs(l-g)<=f,s=Math.abs(m-h)<=f;p&&(c.position.top=d._convertPositionTo("relative",{top:n,left:0}).top-d.margins.top),q&&(c.position.top=d._convertPositionTo("relative",{top:o-d.helperProportions.height,left:0}).top-d.margins.top),r&&(c.position.left=d._convertPositionTo("relative",{top:0,left:l}).left-d.margins.left),s&&(c.position.left=d._convertPositionTo("relative",{top:0,left:m-d.helperProportions.width}).left-d.margins.left)}!d.snapElements[k].snapping&&(p||q||r||s||t)&&d.options.snap.snap&&d.options.snap.snap.call(d.element,b,a.extend(d._uiHash(),{snapItem:d.snapElements[k].item})),d.snapElements[k].snapping=p||q||r||s||t}}}),a.ui.plugin.add("draggable","stack",{start:function(b,c){var d=a(this).data("draggable").options,e=a.makeArray(a(d.stack)).sort(function(b,c){return(parseInt(a(b).css("zIndex"),10)||0)-(parseInt(a(c).css("zIndex"),10)||0)});if(!!e.length){var f=parseInt(e[0].style.zIndex)||0;a(e).each(function(a){this.style.zIndex=f+a}),this[0].style.zIndex=f+e.length}}}),a.ui.plugin.add("draggable","zIndex",{start:function(b,c){var d=a(c.helper),e=a(this).data("draggable").options;d.css("zIndex")&&(e._zIndex=d.css("zIndex")),d.css("zIndex",e.zIndex)},stop:function(b,c){var d=a(this).data("draggable").options;d._zIndex&&a(c.helper).css("zIndex",d._zIndex)}})})(jQuery);/* |
| | | * jQuery UI Droppable 1.8.18 |
| | | * |
| | | * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) |
| | | * Dual licensed under the MIT or GPL Version 2 licenses. |
| | | * http://jquery.org/license |
| | | * |
| | | * http://docs.jquery.com/UI/Droppables |
| | | * |
| | | * Depends: |
| | | * jquery.ui.core.js |
| | | * jquery.ui.widget.js |
| | | * jquery.ui.mouse.js |
| | | * jquery.ui.draggable.js |
| | | */(function(a,b){a.widget("ui.droppable",{widgetEventPrefix:"drop",options:{accept:"*",activeClass:!1,addClasses:!0,greedy:!1,hoverClass:!1,scope:"default",tolerance:"intersect"},_create:function(){var b=this.options,c=b.accept;this.isover=0,this.isout=1,this.accept=a.isFunction(c)?c:function(a){return a.is(c)},this.proportions={width:this.element[0].offsetWidth,height:this.element[0].offsetHeight},a.ui.ddmanager.droppables[b.scope]=a.ui.ddmanager.droppables[b.scope]||[],a.ui.ddmanager.droppables[b.scope].push(this),b.addClasses&&this.element.addClass("ui-droppable")},destroy:function(){var b=a.ui.ddmanager.droppables[this.options.scope];for(var c=0;c<b.length;c++)b[c]==this&&b.splice(c,1);this.element.removeClass("ui-droppable ui-droppable-disabled").removeData("droppable").unbind(".droppable");return this},_setOption:function(b,c){b=="accept"&&(this.accept=a.isFunction(c)?c:function(a){return a.is(c)}),a.Widget.prototype._setOption.apply(this,arguments)},_activate:function(b){var c=a.ui.ddmanager.current;this.options.activeClass&&this.element.addClass(this.options.activeClass),c&&this._trigger("activate",b,this.ui(c))},_deactivate:function(b){var c=a.ui.ddmanager.current;this.options.activeClass&&this.element.removeClass(this.options.activeClass),c&&this._trigger("deactivate",b,this.ui(c))},_over:function(b){var c=a.ui.ddmanager.current;!!c&&(c.currentItem||c.element)[0]!=this.element[0]&&this.accept.call(this.element[0],c.currentItem||c.element)&&(this.options.hoverClass&&this.element.addClass(this.options.hoverClass),this._trigger("over",b,this.ui(c)))},_out:function(b){var c=a.ui.ddmanager.current;!!c&&(c.currentItem||c.element)[0]!=this.element[0]&&this.accept.call(this.element[0],c.currentItem||c.element)&&(this.options.hoverClass&&this.element.removeClass(this.options.hoverClass),this._trigger("out",b,this.ui(c)))},_drop:function(b,c){var d=c||a.ui.ddmanager.current;if(!d||(d.currentItem||d.element)[0]==this.element[0])return!1;var e=!1;this.element.find(":data(droppable)").not(".ui-draggable-dragging").each(function(){var b=a.data(this,"droppable");if(b.options.greedy&&!b.options.disabled&&b.options.scope==d.options.scope&&b.accept.call(b.element[0],d.currentItem||d.element)&&a.ui.intersect(d,a.extend(b,{offset:b.element.offset()}),b.options.tolerance)){e=!0;return!1}});if(e)return!1;if(this.accept.call(this.element[0],d.currentItem||d.element)){this.options.activeClass&&this.element.removeClass(this.options.activeClass),this.options.hoverClass&&this.element.removeClass(this.options.hoverClass),this._trigger("drop",b,this.ui(d));return this.element}return!1},ui:function(a){return{draggable:a.currentItem||a.element,helper:a.helper,position:a.position,offset:a.positionAbs}}}),a.extend(a.ui.droppable,{version:"1.8.18"}),a.ui.intersect=function(b,c,d){if(!c.offset)return!1;var e=(b.positionAbs||b.position.absolute).left,f=e+b.helperProportions.width,g=(b.positionAbs||b.position.absolute).top,h=g+b.helperProportions.height,i=c.offset.left,j=i+c.proportions.width,k=c.offset.top,l=k+c.proportions.height;switch(d){case"fit":return i<=e&&f<=j&&k<=g&&h<=l;case"intersect":return i<e+b.helperProportions.width/2&&f-b.helperProportions.width/2<j&&k<g+b.helperProportions.height/2&&h-b.helperProportions.height/2<l;case"pointer":var m=(b.positionAbs||b.position.absolute).left+(b.clickOffset||b.offset.click).left,n=(b.positionAbs||b.position.absolute).top+(b.clickOffset||b.offset.click).top,o=a.ui.isOver(n,m,k,i,c.proportions.height,c.proportions.width);return o;case"touch":return(g>=k&&g<=l||h>=k&&h<=l||g<k&&h>l)&&(e>=i&&e<=j||f>=i&&f<=j||e<i&&f>j);default:return!1}},a.ui.ddmanager={current:null,droppables:{"default":[]},prepareOffsets:function(b,c){var d=a.ui.ddmanager.droppables[b.options.scope]||[],e=c?c.type:null,f=(b.currentItem||b.element).find(":data(droppable)").andSelf();droppablesLoop:for(var g=0;g<d.length;g++){if(d[g].options.disabled||b&&!d[g].accept.call(d[g].element[0],b.currentItem||b.element))continue;for(var h=0;h<f.length;h++)if(f[h]==d[g].element[0]){d[g].proportions.height=0;continue droppablesLoop}d[g].visible=d[g].element.css("display")!="none";if(!d[g].visible)continue;e=="mousedown"&&d[g]._activate.call(d[g],c),d[g].offset=d[g].element.offset(),d[g].proportions={width:d[g].element[0].offsetWidth,height:d[g].element[0].offsetHeight}}},drop:function(b,c){var d=!1;a.each(a.ui.ddmanager.droppables[b.options.scope]||[],function(){!this.options||(!this.options.disabled&&this.visible&&a.ui.intersect(b,this,this.options.tolerance)&&(d=this._drop.call(this,c)||d),!this.options.disabled&&this.visible&&this.accept.call(this.element[0],b.currentItem||b.element)&&(this.isout=1,this.isover=0,this._deactivate.call(this,c)))});return d},dragStart:function(b,c){b.element.parents(":not(body,html)").bind("scroll.droppable",function(){b.options.refreshPositions||a.ui.ddmanager.prepareOffsets(b,c)})},drag:function(b,c){b.options.refreshPositions&&a.ui.ddmanager.prepareOffsets(b,c),a.each(a.ui.ddmanager.droppables[b.options.scope]||[],function(){if(!(this.options.disabled||this.greedyChild||!this.visible)){var d=a.ui.intersect(b,this,this.options.tolerance),e=!d&&this.isover==1?"isout":d&&this.isover==0?"isover":null;if(!e)return;var f;if(this.options.greedy){var g=this.element.parents(":data(droppable):eq(0)");g.length&&(f=a.data(g[0],"droppable"),f.greedyChild=e=="isover"?1:0)}f&&e=="isover"&&(f.isover=0,f.isout=1,f._out.call(f,c)),this[e]=1,this[e=="isout"?"isover":"isout"]=0,this[e=="isover"?"_over":"_out"].call(this,c),f&&e=="isout"&&(f.isout=0,f.isover=1,f._over.call(f,c))}})},dragStop:function(b,c){b.element.parents(":not(body,html)").unbind("scroll.droppable"),b.options.refreshPositions||a.ui.ddmanager.prepareOffsets(b,c)}}})(jQuery);/* |
| | | * jQuery UI Resizable 1.8.18 |
| | | * |
| | | * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) |
| | | * Dual licensed under the MIT or GPL Version 2 licenses. |
| | | * http://jquery.org/license |
| | | * |
| | | * http://docs.jquery.com/UI/Resizables |
| | | * |
| | | * Depends: |
| | | * jquery.ui.core.js |
| | | * jquery.ui.mouse.js |
| | | * jquery.ui.widget.js |
| | | */(function(a,b){a.widget("ui.resizable",a.ui.mouse,{widgetEventPrefix:"resize",options:{alsoResize:!1,animate:!1,animateDuration:"slow",animateEasing:"swing",aspectRatio:!1,autoHide:!1,containment:!1,ghost:!1,grid:!1,handles:"e,s,se",helper:!1,maxHeight:null,maxWidth:null,minHeight:10,minWidth:10,zIndex:1e3},_create:function(){var b=this,c=this.options;this.element.addClass("ui-resizable"),a.extend(this,{_aspectRatio:!!c.aspectRatio,aspectRatio:c.aspectRatio,originalElement:this.element,_proportionallyResizeElements:[],_helper:c.helper||c.ghost||c.animate?c.helper||"ui-resizable-helper":null}),this.element[0].nodeName.match(/canvas|textarea|input|select|button|img/i)&&(this.element.wrap(a('<div class="ui-wrapper" style="overflow: hidden;"></div>').css({position:this.element.css("position"),width:this.element.outerWidth(),height:this.element.outerHeight(),top:this.element.css("top"),left:this.element.css("left")})),this.element=this.element.parent().data("resizable",this.element.data("resizable")),this.elementIsWrapper=!0,this.element.css({marginLeft:this.originalElement.css("marginLeft"),marginTop:this.originalElement.css("marginTop"),marginRight:this.originalElement.css("marginRight"),marginBottom:this.originalElement.css("marginBottom")}),this.originalElement.css({marginLeft:0,marginTop:0,marginRight:0,marginBottom:0}),this.originalResizeStyle=this.originalElement.css("resize"),this.originalElement.css("resize","none"),this._proportionallyResizeElements.push(this.originalElement.css({position:"static",zoom:1,display:"block"})),this.originalElement.css({margin:this.originalElement.css("margin")}),this._proportionallyResize()),this.handles=c.handles||(a(".ui-resizable-handle",this.element).length?{n:".ui-resizable-n",e:".ui-resizable-e",s:".ui-resizable-s",w:".ui-resizable-w",se:".ui-resizable-se",sw:".ui-resizable-sw",ne:".ui-resizable-ne",nw:".ui-resizable-nw"}:"e,s,se");if(this.handles.constructor==String){this.handles=="all"&&(this.handles="n,e,s,w,se,sw,ne,nw");var d=this.handles.split(",");this.handles={};for(var e=0;e<d.length;e++){var f=a.trim(d[e]),g="ui-resizable-"+f,h=a('<div class="ui-resizable-handle '+g+'"></div>');/sw|se|ne|nw/.test(f)&&h.css({zIndex:++c.zIndex}),"se"==f&&h.addClass("ui-icon ui-icon-gripsmall-diagonal-se"),this.handles[f]=".ui-resizable-"+f,this.element.append(h)}}this._renderAxis=function(b){b=b||this.element;for(var c in this.handles){this.handles[c].constructor==String&&(this.handles[c]=a(this.handles[c],this.element).show());if(this.elementIsWrapper&&this.originalElement[0].nodeName.match(/textarea|input|select|button/i)){var d=a(this.handles[c],this.element),e=0;e=/sw|ne|nw|se|n|s/.test(c)?d.outerHeight():d.outerWidth();var f=["padding",/ne|nw|n/.test(c)?"Top":/se|sw|s/.test(c)?"Bottom":/^e$/.test(c)?"Right":"Left"].join("");b.css(f,e),this._proportionallyResize()}if(!a(this.handles[c]).length)continue}},this._renderAxis(this.element),this._handles=a(".ui-resizable-handle",this.element).disableSelection(),this._handles.mouseover(function(){if(!b.resizing){if(this.className)var a=this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i);b.axis=a&&a[1]?a[1]:"se"}}),c.autoHide&&(this._handles.hide(),a(this.element).addClass("ui-resizable-autohide").hover(function(){c.disabled||(a(this).removeClass("ui-resizable-autohide"),b._handles.show())},function(){c.disabled||b.resizing||(a(this).addClass("ui-resizable-autohide"),b._handles.hide())})),this._mouseInit()},destroy:function(){this._mouseDestroy();var b=function(b){a(b).removeClass("ui-resizable ui-resizable-disabled ui-resizable-resizing").removeData("resizable").unbind(".resizable").find(".ui-resizable-handle").remove()};if(this.elementIsWrapper){b(this.element);var c=this.element;c.after(this.originalElement.css({position:c.css("position"),width:c.outerWidth(),height:c.outerHeight(),top:c.css("top"),left:c.css("left")})).remove()}this.originalElement.css("resize",this.originalResizeStyle),b(this.originalElement);return this},_mouseCapture:function(b){var c=!1;for(var d in this.handles)a(this.handles[d])[0]==b.target&&(c=!0);return!this.options.disabled&&c},_mouseStart:function(b){var d=this.options,e=this.element.position(),f=this.element;this.resizing=!0,this.documentScroll={top:a(document).scrollTop(),left:a(document).scrollLeft()},(f.is(".ui-draggable")||/absolute/.test(f.css("position")))&&f.css({position:"absolute",top:e.top,left:e.left}),this._renderProxy();var g=c(this.helper.css("left")),h=c(this.helper.css("top"));d.containment&&(g+=a(d.containment).scrollLeft()||0,h+=a(d.containment).scrollTop()||0),this.offset=this.helper.offset(),this.position={left:g,top:h},this.size=this._helper?{width:f.outerWidth(),height:f.outerHeight()}:{width:f.width(),height:f.height()},this.originalSize=this._helper?{width:f.outerWidth(),height:f.outerHeight()}:{width:f.width(),height:f.height()},this.originalPosition={left:g,top:h},this.sizeDiff={width:f.outerWidth()-f.width(),height:f.outerHeight()-f.height()},this.originalMousePosition={left:b.pageX,top:b.pageY},this.aspectRatio=typeof d.aspectRatio=="number"?d.aspectRatio:this.originalSize.width/this.originalSize.height||1;var i=a(".ui-resizable-"+this.axis).css("cursor");a("body").css("cursor",i=="auto"?this.axis+"-resize":i),f.addClass("ui-resizable-resizing"),this._propagate("start",b);return!0},_mouseDrag:function(b){var c=this.helper,d=this.options,e={},f=this,g=this.originalMousePosition,h=this.axis,i=b.pageX-g.left||0,j=b.pageY-g.top||0,k=this._change[h];if(!k)return!1;var l=k.apply(this,[b,i,j]),m=a.browser.msie&&a.browser.version<7,n=this.sizeDiff;this._updateVirtualBoundaries(b.shiftKey);if(this._aspectRatio||b.shiftKey)l=this._updateRatio(l,b);l=this._respectSize(l,b),this._propagate("resize",b),c.css({top:this.position.top+"px",left:this.position.left+"px",width:this.size.width+"px",height:this.size.height+"px"}),!this._helper&&this._proportionallyResizeElements.length&&this._proportionallyResize(),this._updateCache(l),this._trigger("resize",b,this.ui());return!1},_mouseStop:function(b){this.resizing=!1;var c=this.options,d=this;if(this._helper){var e=this._proportionallyResizeElements,f=e.length&&/textarea/i.test(e[0].nodeName),g=f&&a.ui.hasScroll(e[0],"left")?0:d.sizeDiff.height,h=f?0:d.sizeDiff.width,i={width:d.helper.width()-h,height:d.helper.height()-g},j=parseInt(d.element.css("left"),10)+(d.position.left-d.originalPosition.left)||null,k=parseInt(d.element.css("top"),10)+(d.position.top-d.originalPosition.top)||null;c.animate||this.element.css(a.extend(i,{top:k,left:j})),d.helper.height(d.size.height),d.helper.width(d.size.width),this._helper&&!c.animate&&this._proportionallyResize()}a("body").css("cursor","auto"),this.element.removeClass("ui-resizable-resizing"),this._propagate("stop",b),this._helper&&this.helper.remove();return!1},_updateVirtualBoundaries:function(a){var b=this.options,c,e,f,g,h;h={minWidth:d(b.minWidth)?b.minWidth:0,maxWidth:d(b.maxWidth)?b.maxWidth:Infinity,minHeight:d(b.minHeight)?b.minHeight:0,maxHeight:d(b.maxHeight)?b.maxHeight:Infinity};if(this._aspectRatio||a)c=h.minHeight*this.aspectRatio,f=h.minWidth/this.aspectRatio,e=h.maxHeight*this.aspectRatio,g=h.maxWidth/this.aspectRatio,c>h.minWidth&&(h.minWidth=c),f>h.minHeight&&(h.minHeight=f),e<h.maxWidth&&(h.maxWidth=e),g<h.maxHeight&&(h.maxHeight=g);this._vBoundaries=h},_updateCache:function(a){var b=this.options;this.offset=this.helper.offset(),d(a.left)&&(this.position.left=a.left),d(a.top)&&(this.position.top=a.top),d(a.height)&&(this.size.height=a.height),d(a.width)&&(this.size.width=a.width)},_updateRatio:function(a,b){var c=this.options,e=this.position,f=this.size,g=this.axis;d(a.height)?a.width=a.height*this.aspectRatio:d(a.width)&&(a.height=a.width/this.aspectRatio),g=="sw"&&(a.left=e.left+(f.width-a.width),a.top=null),g=="nw"&&(a.top=e.top+(f.height-a.height),a.left=e.left+(f.width-a.width));return a},_respectSize:function(a,b){var c=this.helper,e=this._vBoundaries,f=this._aspectRatio||b.shiftKey,g=this.axis,h=d(a.width)&&e.maxWidth&&e.maxWidth<a.width,i=d(a.height)&&e.maxHeight&&e.maxHeight<a.height,j=d(a.width)&&e.minWidth&&e.minWidth>a.width,k=d(a.height)&&e.minHeight&&e.minHeight>a.height;j&&(a.width=e.minWidth),k&&(a.height=e.minHeight),h&&(a.width=e.maxWidth),i&&(a.height=e.maxHeight);var l=this.originalPosition.left+this.originalSize.width,m=this.position.top+this.size.height,n=/sw|nw|w/.test(g),o=/nw|ne|n/.test(g);j&&n&&(a.left=l-e.minWidth),h&&n&&(a.left=l-e.maxWidth),k&&o&&(a.top=m-e.minHeight),i&&o&&(a.top=m-e.maxHeight);var p=!a.width&&!a.height;p&&!a.left&&a.top?a.top=null:p&&!a.top&&a.left&&(a.left=null);return a},_proportionallyResize:function(){var b=this.options;if(!!this._proportionallyResizeElements.length){var c=this.helper||this.element;for(var d=0;d<this._proportionallyResizeElements.length;d++){var e=this._proportionallyResizeElements[d];if(!this.borderDif){var f=[e.css("borderTopWidth"),e.css("borderRightWidth"),e.css("borderBottomWidth"),e.css("borderLeftWidth")],g=[e.css("paddingTop"),e.css("paddingRight"),e.css("paddingBottom"),e.css("paddingLeft")];this.borderDif=a.map(f,function(a,b){var c=parseInt(a,10)||0,d=parseInt(g[b],10)||0;return c+d})}if(a.browser.msie&&(!!a(c).is(":hidden")||!!a(c).parents(":hidden").length))continue;e.css({height:c.height()-this.borderDif[0]-this.borderDif[2]||0,width:c.width()-this.borderDif[1]-this.borderDif[3]||0})}}},_renderProxy:function(){var b=this.element,c=this.options;this.elementOffset=b.offset();if(this._helper){this.helper=this.helper||a('<div style="overflow:hidden;"></div>');var d=a.browser.msie&&a.browser.version<7,e=d?1:0,f=d?2:-1;this.helper.addClass(this._helper).css({width:this.element.outerWidth()+f,height:this.element.outerHeight()+f,position:"absolute",left:this.elementOffset.left-e+"px",top:this.elementOffset.top-e+"px",zIndex:++c.zIndex}),this.helper.appendTo("body").disableSelection()}else this.helper=this.element},_change:{e:function(a,b,c){return{width:this.originalSize.width+b}},w:function(a,b,c){var d=this.options,e=this.originalSize,f=this.originalPosition;return{left:f.left+b,width:e.width-b}},n:function(a,b,c){var d=this.options,e=this.originalSize,f=this.originalPosition;return{top:f.top+c,height:e.height-c}},s:function(a,b,c){return{height:this.originalSize.height+c}},se:function(b,c,d){return a.extend(this._change.s.apply(this,arguments),this._change.e.apply(this,[b,c,d]))},sw:function(b,c,d){return a.extend(this._change.s.apply(this,arguments),this._change.w.apply(this,[b,c,d]))},ne:function(b,c,d){return a.extend(this._change.n.apply(this,arguments),this._change.e.apply(this,[b,c,d]))},nw:function(b,c,d){return a.extend(this._change.n.apply(this,arguments),this._change.w.apply(this,[b,c,d]))}},_propagate:function(b,c){a.ui.plugin.call(this,b,[c,this.ui()]),b!="resize"&&this._trigger(b,c,this.ui())},plugins:{},ui:function(){return{originalElement:this.originalElement,element:this.element,helper:this.helper,position:this.position,size:this.size,originalSize:this.originalSize,originalPosition:this.originalPosition}}}),a.extend(a.ui.resizable,{version:"1.8.18"}),a.ui.plugin.add("resizable","alsoResize",{start:function(b,c){var d=a(this).data("resizable"),e=d.options,f=function(b){a(b).each(function(){var b=a(this);b.data("resizable-alsoresize",{width:parseInt(b.width(),10),height:parseInt(b.height(),10),left:parseInt(b.css("left"),10),top:parseInt(b.css("top"),10)})})};typeof e.alsoResize=="object"&&!e.alsoResize.parentNode?e.alsoResize.length?(e.alsoResize=e.alsoResize[0],f(e.alsoResize)):a.each(e.alsoResize,function(a){f(a)}):f(e.alsoResize)},resize:function(b,c){var d=a(this).data("resizable"),e=d.options,f=d.originalSize,g=d.originalPosition,h={height:d.size.height-f.height||0,width:d.size.width-f.width||0,top:d.position.top-g.top||0,left:d.position.left-g.left||0},i=function(b,d){a(b).each(function(){var b=a(this),e=a(this).data("resizable-alsoresize"),f={},g=d&&d.length?d:b.parents(c.originalElement[0]).length?["width","height"]:["width","height","top","left"];a.each(g,function(a,b){var c=(e[b]||0)+(h[b]||0);c&&c>=0&&(f[b]=c||null)}),b.css(f)})};typeof e.alsoResize=="object"&&!e.alsoResize.nodeType?a.each(e.alsoResize,function(a,b){i(a,b)}):i(e.alsoResize)},stop:function(b,c){a(this).removeData("resizable-alsoresize")}}),a.ui.plugin.add("resizable","animate",{stop:function(b,c){var d=a(this).data("resizable"),e=d.options,f=d._proportionallyResizeElements,g=f.length&&/textarea/i.test(f[0].nodeName),h=g&&a.ui.hasScroll(f[0],"left")?0:d.sizeDiff.height,i=g?0:d.sizeDiff.width,j={width:d.size.width-i,height:d.size.height-h},k=parseInt(d.element.css("left"),10)+(d.position.left-d.originalPosition.left)||null,l=parseInt(d.element.css("top"),10)+(d.position.top-d.originalPosition.top)||null;d.element.animate(a.extend(j,l&&k?{top:l,left:k}:{}),{duration:e.animateDuration,easing:e.animateEasing,step:function(){var c={width:parseInt(d.element.css("width"),10),height:parseInt(d.element.css("height"),10),top:parseInt(d.element.css("top"),10),left:parseInt(d.element.css("left"),10)};f&&f.length&&a(f[0]).css({width:c.width,height:c.height}),d._updateCache(c),d._propagate("resize",b)}})}}),a.ui.plugin.add("resizable","containment",{start:function(b,d){var e=a(this).data("resizable"),f=e.options,g=e.element,h=f.containment,i=h instanceof a?h.get(0):/parent/.test(h)?g.parent().get(0):h;if(!!i){e.containerElement=a(i);if(/document/.test(h)||h==document)e.containerOffset={left:0,top:0},e.containerPosition={left:0,top:0},e.parentData={element:a(document),left:0,top:0,width:a(document).width(),height:a(document).height()||document.body.parentNode.scrollHeight};else{var j=a(i),k=[];a(["Top","Right","Left","Bottom"]).each(function(a,b){k[a]=c(j.css("padding"+b))}),e.containerOffset=j.offset(),e.containerPosition=j.position(),e.containerSize={height:j.innerHeight()-k[3],width:j.innerWidth()-k[1]};var l=e.containerOffset,m=e.containerSize.height,n=e.containerSize.width,o=a.ui.hasScroll(i,"left")?i.scrollWidth:n,p=a.ui.hasScroll(i)?i.scrollHeight:m;e.parentData={element:i,left:l.left,top:l.top,width:o,height:p}}}},resize:function(b,c){var d=a(this).data("resizable"),e=d.options,f=d.containerSize,g=d.containerOffset,h=d.size,i=d.position,j=d._aspectRatio||b.shiftKey,k={top:0,left:0},l=d.containerElement;l[0]!=document&&/static/.test(l.css("position"))&&(k=g),i.left<(d._helper?g.left:0)&&(d.size.width=d.size.width+(d._helper?d.position.left-g.left:d.position.left-k.left),j&&(d.size.height=d.size.width/e.aspectRatio),d.position.left=e.helper?g.left:0),i.top<(d._helper?g.top:0)&&(d.size.height=d.size.height+(d._helper?d.position.top-g.top:d.position.top),j&&(d.size.width=d.size.height*e.aspectRatio),d.position.top=d._helper?g.top:0),d.offset.left=d.parentData.left+d.position.left,d.offset.top=d.parentData.top+d.position.top;var m=Math.abs((d._helper?d.offset.left-k.left:d.offset.left-k.left)+d.sizeDiff.width),n=Math.abs((d._helper?d.offset.top-k.top:d.offset.top-g.top)+d.sizeDiff.height),o=d.containerElement.get(0)==d.element.parent().get(0),p=/relative|absolute/.test(d.containerElement.css("position"));o&&p&&(m-=d.parentData.left),m+d.size.width>=d.parentData.width&&(d.size.width=d.parentData.width-m,j&&(d.size.height=d.size.width/d.aspectRatio)),n+d.size.height>=d.parentData.height&&(d.size.height=d.parentData.height-n,j&&(d.size.width=d.size.height*d.aspectRatio))},stop:function(b,c){var d=a(this).data("resizable"),e=d.options,f=d.position,g=d.containerOffset,h=d.containerPosition,i=d.containerElement,j=a(d.helper),k=j.offset(),l=j.outerWidth()-d.sizeDiff.width,m=j.outerHeight()-d.sizeDiff.height;d._helper&&!e.animate&&/relative/.test(i.css("position"))&&a(this).css({left:k.left-h.left-g.left,width:l,height:m}),d._helper&&!e.animate&&/static/.test(i.css("position"))&&a(this).css({left:k.left-h.left-g.left,width:l,height:m})}}),a.ui.plugin.add("resizable","ghost",{start:function(b,c){var d=a(this).data("resizable"),e=d.options,f=d.size;d.ghost=d.originalElement.clone(),d.ghost.css({opacity:.25,display:"block",position:"relative",height:f.height,width:f.width,margin:0,left:0,top:0}).addClass("ui-resizable-ghost").addClass(typeof e.ghost=="string"?e.ghost:""),d.ghost.appendTo(d.helper)},resize:function(b,c){var d=a(this).data("resizable"),e=d.options;d.ghost&&d.ghost.css({position:"relative",height:d.size.height,width:d.size.width})},stop:function(b,c){var d=a(this).data("resizable"),e=d.options;d.ghost&&d.helper&&d.helper.get(0).removeChild(d.ghost.get(0))}}),a.ui.plugin.add("resizable","grid",{resize:function(b,c){var d=a(this).data("resizable"),e=d.options,f=d.size,g=d.originalSize,h=d.originalPosition,i=d.axis,j=e._aspectRatio||b.shiftKey;e.grid=typeof e.grid=="number"?[e.grid,e.grid]:e.grid;var k=Math.round((f.width-g.width)/(e.grid[0]||1))*(e.grid[0]||1),l=Math.round((f.height-g.height)/(e.grid[1]||1))*(e.grid[1]||1);/^(se|s|e)$/.test(i)?(d.size.width=g.width+k,d.size.height=g.height+l):/^(ne)$/.test(i)?(d.size.width=g.width+k,d.size.height=g.height+l,d.position.top=h.top-l):/^(sw)$/.test(i)?(d.size.width=g.width+k,d.size.height=g.height+l,d.position.left=h.left-k):(d.size.width=g.width+k,d.size.height=g.height+l,d.position.top=h.top-l,d.position.left=h.left-k)}});var c=function(a){return parseInt(a,10)||0},d=function(a){return!isNaN(parseInt(a,10))}})(jQuery);/* |
| | | * jQuery UI Selectable 1.8.18 |
| | | * |
| | | * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) |
| | | * Dual licensed under the MIT or GPL Version 2 licenses. |
| | | * http://jquery.org/license |
| | | * |
| | | * http://docs.jquery.com/UI/Selectables |
| | | * |
| | | * Depends: |
| | | * jquery.ui.core.js |
| | | * jquery.ui.mouse.js |
| | | * jquery.ui.widget.js |
| | | */(function(a,b){a.widget("ui.selectable",a.ui.mouse,{options:{appendTo:"body",autoRefresh:!0,distance:0,filter:"*",tolerance:"touch"},_create:function(){var b=this;this.element.addClass("ui-selectable"),this.dragged=!1;var c;this.refresh=function(){c=a(b.options.filter,b.element[0]),c.addClass("ui-selectee"),c.each(function(){var b=a(this),c=b.offset();a.data(this,"selectable-item",{element:this,$element:b,left:c.left,top:c.top,right:c.left+b.outerWidth(),bottom:c.top+b.outerHeight(),startselected:!1,selected:b.hasClass("ui-selected"),selecting:b.hasClass("ui-selecting"),unselecting:b.hasClass("ui-unselecting")})})},this.refresh(),this.selectees=c.addClass("ui-selectee"),this._mouseInit(),this.helper=a("<div class='ui-selectable-helper'></div>")},destroy:function(){this.selectees.removeClass("ui-selectee").removeData("selectable-item"),this.element.removeClass("ui-selectable ui-selectable-disabled").removeData("selectable").unbind(".selectable"),this._mouseDestroy();return this},_mouseStart:function(b){var c=this;this.opos=[b.pageX,b.pageY];if(!this.options.disabled){var d=this.options;this.selectees=a(d.filter,this.element[0]),this._trigger("start",b),a(d.appendTo).append(this.helper),this.helper.css({left:b.clientX,top:b.clientY,width:0,height:0}),d.autoRefresh&&this.refresh(),this.selectees.filter(".ui-selected").each(function(){var d=a.data(this,"selectable-item");d.startselected=!0,!b.metaKey&&!b.ctrlKey&&(d.$element.removeClass("ui-selected"),d.selected=!1,d.$element.addClass("ui-unselecting"),d.unselecting=!0,c._trigger("unselecting",b,{unselecting:d.element}))}),a(b.target).parents().andSelf().each(function(){var d=a.data(this,"selectable-item");if(d){var e=!b.metaKey&&!b.ctrlKey||!d.$element.hasClass("ui-selected");d.$element.removeClass(e?"ui-unselecting":"ui-selected").addClass(e?"ui-selecting":"ui-unselecting"),d.unselecting=!e,d.selecting=e,d.selected=e,e?c._trigger("selecting",b,{selecting:d.element}):c._trigger("unselecting",b,{unselecting:d.element});return!1}})}},_mouseDrag:function(b){var c=this;this.dragged=!0;if(!this.options.disabled){var d=this.options,e=this.opos[0],f=this.opos[1],g=b.pageX,h=b.pageY;if(e>g){var i=g;g=e,e=i}if(f>h){var i=h;h=f,f=i}this.helper.css({left:e,top:f,width:g-e,height:h-f}),this.selectees.each(function(){var i=a.data(this,"selectable-item");if(!!i&&i.element!=c.element[0]){var j=!1;d.tolerance=="touch"?j=!(i.left>g||i.right<e||i.top>h||i.bottom<f):d.tolerance=="fit"&&(j=i.left>e&&i.right<g&&i.top>f&&i.bottom<h),j?(i.selected&&(i.$element.removeClass("ui-selected"),i.selected=!1),i.unselecting&&(i.$element.removeClass("ui-unselecting"),i.unselecting=!1),i.selecting||(i.$element.addClass("ui-selecting"),i.selecting=!0,c._trigger("selecting",b,{selecting:i.element}))):(i.selecting&&((b.metaKey||b.ctrlKey)&&i.startselected?(i.$element.removeClass("ui-selecting"),i.selecting=!1,i.$element.addClass("ui-selected"),i.selected=!0):(i.$element.removeClass("ui-selecting"),i.selecting=!1,i.startselected&&(i.$element.addClass("ui-unselecting"),i.unselecting=!0),c._trigger("unselecting",b,{unselecting:i.element}))),i.selected&&!b.metaKey&&!b.ctrlKey&&!i.startselected&&(i.$element.removeClass("ui-selected"),i.selected=!1,i.$element.addClass("ui-unselecting"),i.unselecting=!0,c._trigger("unselecting",b,{unselecting:i.element})))}});return!1}},_mouseStop:function(b){var c=this;this.dragged=!1;var d=this.options;a(".ui-unselecting",this.element[0]).each(function(){var d=a.data(this,"selectable-item");d.$element.removeClass("ui-unselecting"),d.unselecting=!1,d.startselected=!1,c._trigger("unselected",b,{unselected:d.element})}),a(".ui-selecting",this.element[0]).each(function(){var d=a.data(this,"selectable-item");d.$element.removeClass("ui-selecting").addClass("ui-selected"),d.selecting=!1,d.selected=!0,d.startselected=!0,c._trigger("selected",b,{selected:d.element})}),this._trigger("stop",b),this.helper.remove();return!1}}),a.extend(a.ui.selectable,{version:"1.8.18"})})(jQuery);/* |
| | | * jQuery UI Sortable 1.8.18 |
| | | * |
| | | * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) |
| | | * Dual licensed under the MIT or GPL Version 2 licenses. |
| | | * http://jquery.org/license |
| | | * |
| | | * http://docs.jquery.com/UI/Sortables |
| | | * |
| | | * Depends: |
| | | * jquery.ui.core.js |
| | | * jquery.ui.mouse.js |
| | | * jquery.ui.widget.js |
| | | */(function(a,b){a.widget("ui.sortable",a.ui.mouse,{widgetEventPrefix:"sort",ready:!1,options:{appendTo:"parent",axis:!1,connectWith:!1,containment:!1,cursor:"auto",cursorAt:!1,dropOnEmpty:!0,forcePlaceholderSize:!1,forceHelperSize:!1,grid:!1,handle:!1,helper:"original",items:"> *",opacity:!1,placeholder:!1,revert:!1,scroll:!0,scrollSensitivity:20,scrollSpeed:20,scope:"default",tolerance:"intersect",zIndex:1e3},_create:function(){var a=this.options;this.containerCache={},this.element.addClass("ui-sortable"),this.refresh(),this.floating=this.items.length?a.axis==="x"||/left|right/.test(this.items[0].item.css("float"))||/inline|table-cell/.test(this.items[0].item.css("display")):!1,this.offset=this.element.offset(),this._mouseInit(),this.ready=!0},destroy:function(){a.Widget.prototype.destroy.call(this),this.element.removeClass("ui-sortable ui-sortable-disabled"),this._mouseDestroy();for(var b=this.items.length-1;b>=0;b--)this.items[b].item.removeData(this.widgetName+"-item");return this},_setOption:function(b,c){b==="disabled"?(this.options[b]=c,this.widget()[c?"addClass":"removeClass"]("ui-sortable-disabled")):a.Widget.prototype._setOption.apply(this,arguments)},_mouseCapture:function(b,c){var d=this;if(this.reverting)return!1;if(this.options.disabled||this.options.type=="static")return!1;this._refreshItems(b);var e=null,f=this,g=a(b.target).parents().each(function(){if(a.data(this,d.widgetName+"-item")==f){e=a(this);return!1}});a.data(b.target,d.widgetName+"-item")==f&&(e=a(b.target));if(!e)return!1;if(this.options.handle&&!c){var h=!1;a(this.options.handle,e).find("*").andSelf().each(function(){this==b.target&&(h=!0)});if(!h)return!1}this.currentItem=e,this._removeCurrentsFromItems();return!0},_mouseStart:function(b,c,d){var e=this.options,f=this;this.currentContainer=this,this.refreshPositions(),this.helper=this._createHelper(b),this._cacheHelperProportions(),this._cacheMargins(),this.scrollParent=this.helper.scrollParent(),this.offset=this.currentItem.offset(),this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left},this.helper.css("position","absolute"),this.cssPosition=this.helper.css("position"),a.extend(this.offset,{click:{left:b.pageX-this.offset.left,top:b.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()}),this.originalPosition=this._generatePosition(b),this.originalPageX=b.pageX,this.originalPageY=b.pageY,e.cursorAt&&this._adjustOffsetFromHelper(e.cursorAt),this.domPosition={prev:this.currentItem.prev()[0],parent:this.currentItem.parent()[0]},this.helper[0]!=this.currentItem[0]&&this.currentItem.hide(),this._createPlaceholder(),e.containment&&this._setContainment(),e.cursor&&(a("body").css("cursor")&&(this._storedCursor=a("body").css("cursor")),a("body").css("cursor",e.cursor)),e.opacity&&(this.helper.css("opacity")&&(this._storedOpacity=this.helper.css("opacity")),this.helper.css("opacity",e.opacity)),e.zIndex&&(this.helper.css("zIndex")&&(this._storedZIndex=this.helper.css("zIndex")),this.helper.css("zIndex",e.zIndex)),this.scrollParent[0]!=document&&this.scrollParent[0].tagName!="HTML"&&(this.overflowOffset=this.scrollParent.offset()),this._trigger("start",b,this._uiHash()),this._preserveHelperProportions||this._cacheHelperProportions();if(!d)for(var g=this.containers.length-1;g>=0;g--)this.containers[g]._trigger("activate",b,f._uiHash(this));a.ui.ddmanager&&(a.ui.ddmanager.current=this),a.ui.ddmanager&&!e.dropBehaviour&&a.ui.ddmanager.prepareOffsets(this,b),this.dragging=!0,this.helper.addClass("ui-sortable-helper"),this._mouseDrag(b);return!0},_mouseDrag:function(b){this.position=this._generatePosition(b),this.positionAbs=this._convertPositionTo("absolute"),this.lastPositionAbs||(this.lastPositionAbs=this.positionAbs);if(this.options.scroll){var c=this.options,d=!1;this.scrollParent[0]!=document&&this.scrollParent[0].tagName!="HTML"?(this.overflowOffset.top+this.scrollParent[0].offsetHeight-b.pageY<c.scrollSensitivity?this.scrollParent[0].scrollTop=d=this.scrollParent[0].scrollTop+c.scrollSpeed:b.pageY-this.overflowOffset.top<c.scrollSensitivity&&(this.scrollParent[0].scrollTop=d=this.scrollParent[0].scrollTop-c.scrollSpeed),this.overflowOffset.left+this.scrollParent[0].offsetWidth-b.pageX<c.scrollSensitivity?this.scrollParent[0].scrollLeft=d=this.scrollParent[0].scrollLeft+c.scrollSpeed:b.pageX-this.overflowOffset.left<c.scrollSensitivity&&(this.scrollParent[0].scrollLeft=d=this.scrollParent[0].scrollLeft-c.scrollSpeed)):(b.pageY-a(document).scrollTop()<c.scrollSensitivity?d=a(document).scrollTop(a(document).scrollTop()-c.scrollSpeed):a(window).height()-(b.pageY-a(document).scrollTop())<c.scrollSensitivity&&(d=a(document).scrollTop(a(document).scrollTop()+c.scrollSpeed)),b.pageX-a(document).scrollLeft()<c.scrollSensitivity?d=a(document).scrollLeft(a(document).scrollLeft()-c.scrollSpeed):a(window).width()-(b.pageX-a(document).scrollLeft())<c.scrollSensitivity&&(d=a(document).scrollLeft(a(document).scrollLeft()+c.scrollSpeed))),d!==!1&&a.ui.ddmanager&&!c.dropBehaviour&&a.ui.ddmanager.prepareOffsets(this,b)}this.positionAbs=this._convertPositionTo("absolute");if(!this.options.axis||this.options.axis!="y")this.helper[0].style.left=this.position.left+"px";if(!this.options.axis||this.options.axis!="x")this.helper[0].style.top=this.position.top+"px";for(var e=this.items.length-1;e>=0;e--){var f=this.items[e],g=f.item[0],h=this._intersectsWithPointer(f);if(!h)continue;if(g!=this.currentItem[0]&&this.placeholder[h==1?"next":"prev"]()[0]!=g&&!a.ui.contains(this.placeholder[0],g)&&(this.options.type=="semi-dynamic"?!a.ui.contains(this.element[0],g):!0)){this.direction=h==1?"down":"up";if(this.options.tolerance=="pointer"||this._intersectsWithSides(f))this._rearrange(b,f);else break;this._trigger("change",b,this._uiHash());break}}this._contactContainers(b),a.ui.ddmanager&&a.ui.ddmanager.drag(this,b),this._trigger("sort",b,this._uiHash()),this.lastPositionAbs=this.positionAbs;return!1},_mouseStop:function(b,c){if(!!b){a.ui.ddmanager&&!this.options.dropBehaviour&&a.ui.ddmanager.drop(this,b);if(this.options.revert){var d=this,e=d.placeholder.offset();d.reverting=!0,a(this.helper).animate({left:e.left-this.offset.parent.left-d.margins.left+(this.offsetParent[0]==document.body?0:this.offsetParent[0].scrollLeft),top:e.top-this.offset.parent.top-d.margins.top+(this.offsetParent[0]==document.body?0:this.offsetParent[0].scrollTop)},parseInt(this.options.revert,10)||500,function(){d._clear(b)})}else this._clear(b,c);return!1}},cancel:function(){var b=this;if(this.dragging){this._mouseUp({target:null}),this.options.helper=="original"?this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper"):this.currentItem.show();for(var c=this.containers.length-1;c>=0;c--)this.containers[c]._trigger("deactivate",null,b._uiHash(this)),this.containers[c].containerCache.over&&(this.containers[c]._trigger("out",null,b._uiHash(this)),this.containers[c].containerCache.over=0)}this.placeholder&&(this.placeholder[0].parentNode&&this.placeholder[0].parentNode.removeChild(this.placeholder[0]),this.options.helper!="original"&&this.helper&&this.helper[0].parentNode&&this.helper.remove(),a.extend(this,{helper:null,dragging:!1,reverting:!1,_noFinalSort:null}),this.domPosition.prev?a(this.domPosition.prev).after(this.currentItem):a(this.domPosition.parent).prepend(this.currentItem));return this},serialize:function(b){var c=this._getItemsAsjQuery(b&&b.connected),d=[];b=b||{},a(c).each(function(){var c=(a(b.item||this).attr(b.attribute||"id")||"").match(b.expression||/(.+)[-=_](.+)/);c&&d.push((b.key||c[1]+"[]")+"="+(b.key&&b.expression?c[1]:c[2]))}),!d.length&&b.key&&d.push(b.key+"=");return d.join("&")},toArray:function(b){var c=this._getItemsAsjQuery(b&&b.connected),d=[];b=b||{},c.each(function(){d.push(a(b.item||this).attr(b.attribute||"id")||"")});return d},_intersectsWith:function(a){var b=this.positionAbs.left,c=b+this.helperProportions.width,d=this.positionAbs.top,e=d+this.helperProportions.height,f=a.left,g=f+a.width,h=a.top,i=h+a.height,j=this.offset.click.top,k=this.offset.click.left,l=d+j>h&&d+j<i&&b+k>f&&b+k<g;return this.options.tolerance=="pointer"||this.options.forcePointerForContainers||this.options.tolerance!="pointer"&&this.helperProportions[this.floating?"width":"height"]>a[this.floating?"width":"height"]?l:f<b+this.helperProportions.width/2&&c-this.helperProportions.width/2<g&&h<d+this.helperProportions.height/2&&e-this.helperProportions.height/2<i},_intersectsWithPointer:function(b){var c=a.ui.isOverAxis(this.positionAbs.top+this.offset.click.top,b.top,b.height),d=a.ui.isOverAxis(this.positionAbs.left+this.offset.click.left,b.left,b.width),e=c&&d,f=this._getDragVerticalDirection(),g=this._getDragHorizontalDirection();if(!e)return!1;return this.floating?g&&g=="right"||f=="down"?2:1:f&&(f=="down"?2:1)},_intersectsWithSides:function(b){var c=a.ui.isOverAxis(this.positionAbs.top+this.offset.click.top,b.top+b.height/2,b.height),d=a.ui.isOverAxis(this.positionAbs.left+this.offset.click.left,b.left+b.width/2,b.width),e=this._getDragVerticalDirection(),f=this._getDragHorizontalDirection();return this.floating&&f?f=="right"&&d||f=="left"&&!d:e&&(e=="down"&&c||e=="up"&&!c)},_getDragVerticalDirection:function(){var a=this.positionAbs.top-this.lastPositionAbs.top;return a!=0&&(a>0?"down":"up")},_getDragHorizontalDirection:function(){var a=this.positionAbs.left-this.lastPositionAbs.left;return a!=0&&(a>0?"right":"left")},refresh:function(a){this._refreshItems(a),this.refreshPositions();return this},_connectWith:function(){var a=this.options;return a.connectWith.constructor==String?[a.connectWith]:a.connectWith},_getItemsAsjQuery:function(b){var c=this,d=[],e=[],f=this._connectWith();if(f&&b)for(var g=f.length-1;g>=0;g--){var h=a(f[g]);for(var i=h.length-1;i>=0;i--){var j=a.data(h[i],this.widgetName);j&&j!=this&&!j.options.disabled&&e.push([a.isFunction(j.options.items)?j.options.items.call(j.element):a(j.options.items,j.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),j])}}e.push([a.isFunction(this.options.items)?this.options.items.call(this.element,null,{options:this.options,item:this.currentItem}):a(this.options.items,this.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),this]);for(var g=e.length-1;g>=0;g--)e[g][0].each(function(){d.push(this)});return a(d)},_removeCurrentsFromItems:function(){var a=this.currentItem.find(":data("+this.widgetName+"-item)");for(var b=0;b<this.items.length;b++)for(var c=0;c<a.length;c++)a[c]==this.items[b].item[0]&&this.items.splice(b,1)},_refreshItems:function(b){this.items=[],this.containers=[this];var c=this.items,d=this,e=[[a.isFunction(this.options.items)?this.options.items.call(this.element[0],b,{item:this.currentItem}):a(this.options.items,this.element),this]],f=this._connectWith();if(f&&this.ready)for(var g=f.length-1;g>=0;g--){var h=a(f[g]);for(var i=h.length-1;i>=0;i--){var j=a.data(h[i],this.widgetName);j&&j!=this&&!j.options.disabled&&(e.push([a.isFunction(j.options.items)?j.options.items.call(j.element[0],b,{item:this.currentItem}):a(j.options.items,j.element),j]),this.containers.push(j))}}for(var g=e.length-1;g>=0;g--){var k=e[g][1],l=e[g][0];for(var i=0,m=l.length;i<m;i++){var n=a(l[i]);n.data(this.widgetName+"-item",k),c.push({item:n,instance:k,width:0,height:0,left:0,top:0})}}},refreshPositions:function(b){this.offsetParent&&this.helper&&(this.offset.parent=this._getParentOffset());for(var c=this.items.length-1;c>=0;c--){var d=this.items[c];if(d.instance!=this.currentContainer&&this.currentContainer&&d.item[0]!=this.currentItem[0])continue;var e=this.options.toleranceElement?a(this.options.toleranceElement,d.item):d.item;b||(d.width=e.outerWidth(),d.height=e.outerHeight());var f=e.offset();d.left=f.left,d.top=f.top}if(this.options.custom&&this.options.custom.refreshContainers)this.options.custom.refreshContainers.call(this);else for(var c=this.containers.length-1;c>=0;c--){var f=this.containers[c].element.offset();this.containers[c].containerCache.left=f.left,this.containers[c].containerCache.top=f.top,this.containers[c].containerCache.width=this.containers[c].element.outerWidth(),this.containers[c].containerCache.height=this.containers[c].element.outerHeight()}return this},_createPlaceholder:function(b){var c=b||this,d=c.options;if(!d.placeholder||d.placeholder.constructor==String){var e=d.placeholder;d.placeholder={element:function(){var b=a(document.createElement(c.currentItem[0].nodeName)).addClass(e||c.currentItem[0].className+" ui-sortable-placeholder").removeClass("ui-sortable-helper")[0];e||(b.style.visibility="hidden");return b},update:function(a,b){if(!e||!!d.forcePlaceholderSize)b.height()||b.height(c.currentItem.innerHeight()-parseInt(c.currentItem.css("paddingTop")||0,10)-parseInt(c.currentItem.css("paddingBottom")||0,10)),b.width()||b.width(c.currentItem.innerWidth()-parseInt(c.currentItem.css("paddingLeft")||0,10)-parseInt(c.currentItem.css("paddingRight")||0,10))}}}c.placeholder=a(d.placeholder.element.call(c.element,c.currentItem)),c.currentItem.after(c.placeholder),d.placeholder.update(c,c.placeholder)},_contactContainers:function(b){var c=null,d=null;for(var e=this.containers.length-1;e>=0;e--){if(a.ui.contains(this.currentItem[0],this.containers[e].element[0]))continue;if(this._intersectsWith(this.containers[e].containerCache)){if(c&&a.ui.contains(this.containers[e].element[0],c.element[0]))continue;c=this.containers[e],d=e}else this.containers[e].containerCache.over&&(this.containers[e]._trigger("out",b,this._uiHash(this)),this.containers[e].containerCache.over=0)}if(!!c)if(this.containers.length===1)this.containers[d]._trigger("over",b,this._uiHash(this)),this.containers[d].containerCache.over=1;else if(this.currentContainer!=this.containers[d]){var f=1e4,g=null,h=this.positionAbs[this.containers[d].floating?"left":"top"];for(var i=this.items.length-1;i>=0;i--){if(!a.ui.contains(this.containers[d].element[0],this.items[i].item[0]))continue;var j=this.items[i][this.containers[d].floating?"left":"top"];Math.abs(j-h)<f&&(f=Math.abs(j-h),g=this.items[i])}if(!g&&!this.options.dropOnEmpty)return;this.currentContainer=this.containers[d],g?this._rearrange(b,g,null,!0):this._rearrange(b,null,this.containers[d].element,!0),this._trigger("change",b,this._uiHash()),this.containers[d]._trigger("change",b,this._uiHash(this)),this.options.placeholder.update(this.currentContainer,this.placeholder),this.containers[d]._trigger("over",b,this._uiHash(this)),this.containers[d].containerCache.over=1}},_createHelper:function(b){var c=this.options,d=a.isFunction(c.helper)?a(c.helper.apply(this.element[0],[b,this.currentItem])):c.helper=="clone"?this.currentItem.clone():this.currentItem;d.parents("body").length||a(c.appendTo!="parent"?c.appendTo:this.currentItem[0].parentNode)[0].appendChild(d[0]),d[0]==this.currentItem[0]&&(this._storedCSS={width:this.currentItem[0].style.width,height:this.currentItem[0].style.height,position:this.currentItem.css("position"),top:this.currentItem.css("top"),left:this.currentItem.css("left")}),(d[0].style.width==""||c.forceHelperSize)&&d.width(this.currentItem.width()),(d[0].style.height==""||c.forceHelperSize)&&d.height(this.currentItem.height());return d},_adjustOffsetFromHelper:function(b){typeof b=="string"&&(b=b.split(" ")),a.isArray(b)&&(b={left:+b[0],top:+b[1]||0}),"left"in b&&(this.offset.click.left=b.left+this.margins.left),"right"in b&&(this.offset.click.left=this.helperProportions.width-b.right+this.margins.left),"top"in b&&(this.offset.click.top=b.top+this.margins.top),"bottom"in b&&(this.offset.click.top=this.helperProportions.height-b.bottom+this.margins.top)},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var b=this.offsetParent.offset();this.cssPosition=="absolute"&&this.scrollParent[0]!=document&&a.ui.contains(this.scrollParent[0],this.offsetParent[0])&&(b.left+=this.scrollParent.scrollLeft(),b.top+=this.scrollParent.scrollTop());if(this.offsetParent[0]==document.body||this.offsetParent[0].tagName&&this.offsetParent[0].tagName.toLowerCase()=="html"&&a.browser.msie)b={top:0,left:0};return{top:b.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:b.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if(this.cssPosition=="relative"){var a=this.currentItem.position();return{top:a.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:a.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}return{top:0,left:0}},_cacheMargins:function(){this.margins={left:parseInt(this.currentItem.css("marginLeft"),10)||0,top:parseInt(this.currentItem.css("marginTop"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var b=this.options;b.containment=="parent"&&(b.containment=this.helper[0].parentNode);if(b.containment=="document"||b.containment=="window")this.containment=[0-this.offset.relative.left-this.offset.parent.left,0-this.offset.relative.top-this.offset.parent.top,a(b.containment=="document"?document:window).width()-this.helperProportions.width-this.margins.left,(a(b.containment=="document"?document:window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top];if(!/^(document|window|parent)$/.test(b.containment)){var c=a(b.containment)[0],d=a(b.containment).offset(),e=a(c).css("overflow")!="hidden";this.containment=[d.left+(parseInt(a(c).css("borderLeftWidth"),10)||0)+(parseInt(a(c).css("paddingLeft"),10)||0)-this.margins.left,d.top+(parseInt(a(c).css("borderTopWidth"),10)||0)+(parseInt(a(c).css("paddingTop"),10)||0)-this.margins.top,d.left+(e?Math.max(c.scrollWidth,c.offsetWidth):c.offsetWidth)-(parseInt(a(c).css("borderLeftWidth"),10)||0)-(parseInt(a(c).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left,d.top+(e?Math.max(c.scrollHeight,c.offsetHeight):c.offsetHeight)-(parseInt(a(c).css("borderTopWidth"),10)||0)-(parseInt(a(c).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top]}},_convertPositionTo:function(b,c){c||(c=this.position);var d=b=="absolute"?1:-1,e=this.options,f=this.cssPosition=="absolute"&&(this.scrollParent[0]==document||!a.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,g=/(html|body)/i.test(f[0].tagName);return{top:c.top+this.offset.relative.top*d+this.offset.parent.top*d-(a.browser.safari&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollTop():g?0:f.scrollTop())*d),left:c.left+this.offset.relative.left*d+this.offset.parent.left*d-(a.browser.safari&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():g?0:f.scrollLeft())*d)}},_generatePosition:function(b){var c=this.options,d=this.cssPosition=="absolute"&&(this.scrollParent[0]==document||!a.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,e=/(html|body)/i.test(d[0].tagName);this.cssPosition=="relative"&&(this.scrollParent[0]==document||this.scrollParent[0]==this.offsetParent[0])&&(this.offset.relative=this._getRelativeOffset());var f=b.pageX,g=b.pageY;if(this.originalPosition){this.containment&&(b.pageX-this.offset.click.left<this.containment[0]&&(f=this.containment[0]+this.offset.click.left),b.pageY-this.offset.click.top<this.containment[1]&&(g=this.containment[1]+this.offset.click.top),b.pageX-this.offset.click.left>this.containment[2]&&(f=this.containment[2]+this.offset.click.left),b.pageY-this.offset.click.top>this.containment[3]&&(g=this.containment[3]+this.offset.click.top));if(c.grid){var h=this.originalPageY+Math.round((g-this.originalPageY)/c.grid[1])*c.grid[1];g=this.containment?h-this.offset.click.top<this.containment[1]||h-this.offset.click.top>this.containment[3]?h-this.offset.click.top<this.containment[1]?h+c.grid[1]:h-c.grid[1]:h:h;var i=this.originalPageX+Math.round((f-this.originalPageX)/c.grid[0])*c.grid[0];f=this.containment?i-this.offset.click.left<this.containment[0]||i-this.offset.click.left>this.containment[2]?i-this.offset.click.left<this.containment[0]?i+c.grid[0]:i-c.grid[0]:i:i}}return{top:g-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+(a.browser.safari&&this.cssPosition=="fixed"?0:this.cssPosition=="fixed"?-this.scrollParent.scrollTop():e?0:d.scrollTop()),left:f-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+(a.browser.safari&&this.cssPosition=="fixed"?0:this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():e?0:d.scrollLeft())}},_rearrange:function(a,b,c,d){c?c[0].appendChild(this.placeholder[0]):b.item[0].parentNode.insertBefore(this.placeholder[0],this.direction=="down"?b.item[0]:b.item[0].nextSibling),this.counter=this.counter?++this.counter:1;var e=this,f=this.counter;window.setTimeout(function(){f==e.counter&&e.refreshPositions(!d)},0)},_clear:function(b,c){this.reverting=!1;var d=[],e=this;!this._noFinalSort&&this.currentItem.parent().length&&this.placeholder.before(this.currentItem),this._noFinalSort=null;if(this.helper[0]==this.currentItem[0]){for(var f in this._storedCSS)if(this._storedCSS[f]=="auto"||this._storedCSS[f]=="static")this._storedCSS[f]="";this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper")}else this.currentItem.show();this.fromOutside&&!c&&d.push(function(a){this._trigger("receive",a,this._uiHash(this.fromOutside))}),(this.fromOutside||this.domPosition.prev!=this.currentItem.prev().not(".ui-sortable-helper")[0]||this.domPosition.parent!=this.currentItem.parent()[0])&&!c&&d.push(function(a){this._trigger("update",a,this._uiHash())});if(!a.ui.contains(this.element[0],this.currentItem[0])){c||d.push(function(a){this._trigger("remove",a,this._uiHash())});for(var f=this.containers.length-1;f>=0;f--)a.ui.contains(this.containers[f].element[0],this.currentItem[0])&&!c&&(d.push(function(a){return function(b){a._trigger("receive",b,this._uiHash(this))}}.call(this,this.containers[f])),d.push(function(a){return function(b){a._trigger("update",b,this._uiHash(this))}}.call(this,this.containers[f])))}for(var f=this.containers.length-1;f>=0;f--)c||d.push(function(a){return function(b){a._trigger("deactivate",b,this._uiHash(this))}}.call(this,this.containers[f])),this.containers[f].containerCache.over&&(d.push(function(a){return function(b){a._trigger("out",b,this._uiHash(this))}}.call(this,this.containers[f])),this.containers[f].containerCache.over=0);this._storedCursor&&a("body").css("cursor",this._storedCursor),this._storedOpacity&&this.helper.css("opacity",this._storedOpacity),this._storedZIndex&&this.helper.css("zIndex",this._storedZIndex=="auto"?"":this._storedZIndex),this.dragging=!1;if(this.cancelHelperRemoval){if(!c){this._trigger("beforeStop",b,this._uiHash());for(var f=0;f<d.length;f++)d[f].call(this,b);this._trigger("stop",b,this._uiHash())}return!1}c||this._trigger("beforeStop",b,this._uiHash()),this.placeholder[0].parentNode.removeChild(this.placeholder[0]),this.helper[0]!=this.currentItem[0]&&this.helper.remove(),this.helper=null;if(!c){for(var f=0;f<d.length;f++)d[f].call(this,b);this._trigger("stop",b,this._uiHash())}this.fromOutside=!1;return!0},_trigger:function(){a.Widget.prototype._trigger.apply(this,arguments)===!1&&this.cancel()},_uiHash:function(b){var c=b||this;return{helper:c.helper,placeholder:c.placeholder||a([]),position:c.position,originalPosition:c.originalPosition,offset:c.positionAbs,item:c.currentItem,sender:b?b.element:null}}}),a.extend(a.ui.sortable,{version:"1.8.18"})})(jQuery);/* |
| | | * jQuery UI Accordion 1.8.18 |
| | | * |
| | | * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) |
| | | * Dual licensed under the MIT or GPL Version 2 licenses. |
| | | * http://jquery.org/license |
| | | * |
| | | * http://docs.jquery.com/UI/Accordion |
| | | * |
| | | * Depends: |
| | | * jquery.ui.core.js |
| | | * jquery.ui.widget.js |
| | | */(function(a,b){a.widget("ui.accordion",{options:{active:0,animated:"slide",autoHeight:!0,clearStyle:!1,collapsible:!1,event:"click",fillSpace:!1,header:"> li > :first-child,> :not(li):even",icons:{header:"ui-icon-triangle-1-e",headerSelected:"ui-icon-triangle-1-s"},navigation:!1,navigationFilter:function(){return this.href.toLowerCase()===location.href.toLowerCase()}},_create:function(){var b=this,c=b.options;b.running=0,b.element.addClass("ui-accordion ui-widget ui-helper-reset").children("li").addClass("ui-accordion-li-fix"),b.headers=b.element.find(c.header).addClass("ui-accordion-header ui-helper-reset ui-state-default ui-corner-all").bind("mouseenter.accordion",function(){c.disabled||a(this).addClass("ui-state-hover")}).bind("mouseleave.accordion",function(){c.disabled||a(this).removeClass("ui-state-hover")}).bind("focus.accordion",function(){c.disabled||a(this).addClass("ui-state-focus")}).bind("blur.accordion",function(){c.disabled||a(this).removeClass("ui-state-focus")}),b.headers.next().addClass("ui-accordion-content ui-helper-reset ui-widget-content ui-corner-bottom");if(c.navigation){var d=b.element.find("a").filter(c.navigationFilter).eq(0);if(d.length){var e=d.closest(".ui-accordion-header");e.length?b.active=e:b.active=d.closest(".ui-accordion-content").prev()}}b.active=b._findActive(b.active||c.active).addClass("ui-state-default ui-state-active").toggleClass("ui-corner-all").toggleClass("ui-corner-top"),b.active.next().addClass("ui-accordion-content-active"),b._createIcons(),b.resize(),b.element.attr("role","tablist"),b.headers.attr("role","tab").bind("keydown.accordion",function(a){return b._keydown(a)}).next().attr("role","tabpanel"),b.headers.not(b.active||"").attr({"aria-expanded":"false","aria-selected":"false",tabIndex:-1}).next().hide(),b.active.length?b.active.attr({"aria-expanded":"true","aria-selected":"true",tabIndex:0}):b.headers.eq(0).attr("tabIndex",0),a.browser.safari||b.headers.find("a").attr("tabIndex",-1),c.event&&b.headers.bind(c.event.split(" ").join(".accordion ")+".accordion",function(a){b._clickHandler.call(b,a,this),a.preventDefault()})},_createIcons:function(){var b=this.options;b.icons&&(a("<span></span>").addClass("ui-icon "+b.icons.header).prependTo(this.headers),this.active.children(".ui-icon").toggleClass(b.icons.header).toggleClass(b.icons.headerSelected),this.element.addClass("ui-accordion-icons"))},_destroyIcons:function(){this.headers.children(".ui-icon").remove(),this.element.removeClass("ui-accordion-icons")},destroy:function(){var b=this.options;this.element.removeClass("ui-accordion ui-widget ui-helper-reset").removeAttr("role"),this.headers.unbind(".accordion").removeClass("ui-accordion-header ui-accordion-disabled ui-helper-reset ui-state-default ui-corner-all ui-state-active ui-state-disabled ui-corner-top").removeAttr("role").removeAttr("aria-expanded").removeAttr("aria-selected").removeAttr("tabIndex"),this.headers.find("a").removeAttr("tabIndex"),this._destroyIcons();var c=this.headers.next().css("display","").removeAttr("role").removeClass("ui-helper-reset ui-widget-content ui-corner-bottom ui-accordion-content ui-accordion-content-active ui-accordion-disabled ui-state-disabled");(b.autoHeight||b.fillHeight)&&c.css("height","");return a.Widget.prototype.destroy.call(this)},_setOption:function(b,c){a.Widget.prototype._setOption.apply(this,arguments),b=="active"&&this.activate(c),b=="icons"&&(this._destroyIcons(),c&&this._createIcons()),b=="disabled"&&this.headers.add(this.headers.next())[c?"addClass":"removeClass"]("ui-accordion-disabled ui-state-disabled")},_keydown:function(b){if(!(this.options.disabled||b.altKey||b.ctrlKey)){var c=a.ui.keyCode,d=this.headers.length,e=this.headers.index(b.target),f=!1;switch(b.keyCode){case c.RIGHT:case c.DOWN:f=this.headers[(e+1)%d];break;case c.LEFT:case c.UP:f=this.headers[(e-1+d)%d];break;case c.SPACE:case c.ENTER:this._clickHandler({target:b.target},b.target),b.preventDefault()}if(f){a(b.target).attr("tabIndex",-1),a(f).attr("tabIndex",0),f.focus();return!1}return!0}},resize:function(){var b=this.options,c;if(b.fillSpace){if(a.browser.msie){var d=this.element.parent().css("overflow");this.element.parent().css("overflow","hidden")}c=this.element.parent().height(),a.browser.msie&&this.element.parent().css("overflow",d),this.headers.each(function(){c-=a(this).outerHeight(!0)}),this.headers.next().each(function(){a(this).height(Math.max(0,c-a(this).innerHeight()+a(this).height()))}).css("overflow","auto")}else b.autoHeight&&(c=0,this.headers.next().each(function(){c=Math.max(c,a(this).height("").height())}).height(c));return this},activate:function(a){this.options.active=a;var b=this._findActive(a)[0];this._clickHandler({target:b},b);return this},_findActive:function(b){return b?typeof b=="number"?this.headers.filter(":eq("+b+")"):this.headers.not(this.headers.not(b)):b===!1?a([]):this.headers.filter(":eq(0)")},_clickHandler:function(b,c){var d=this.options;if(!d.disabled){if(!b.target){if(!d.collapsible)return;this.active.removeClass("ui-state-active ui-corner-top").addClass("ui-state-default ui-corner-all").children(".ui-icon").removeClass(d.icons.headerSelected).addClass(d.icons.header),this.active.next().addClass("ui-accordion-content-active");var e=this.active.next(),f={options:d,newHeader:a([]),oldHeader:d.active,newContent:a([]),oldContent:e},g=this.active=a([]);this._toggle(g,e,f);return}var h=a(b.currentTarget||c),i=h[0]===this.active[0];d.active=d.collapsible&&i?!1:this.headers.index(h);if(this.running||!d.collapsible&&i)return;var j=this.active,g=h.next(),e=this.active.next(),f={options:d,newHeader:i&&d.collapsible?a([]):h,oldHeader:this.active,newContent:i&&d.collapsible?a([]):g,oldContent:e},k=this.headers.index(this.active[0])>this.headers.index(h[0]);this.active=i?a([]):h,this._toggle(g,e,f,i,k),j.removeClass("ui-state-active ui-corner-top").addClass("ui-state-default ui-corner-all").children(".ui-icon").removeClass(d.icons.headerSelected).addClass(d.icons.header),i||(h.removeClass("ui-state-default ui-corner-all").addClass("ui-state-active ui-corner-top").children(".ui-icon").removeClass(d.icons.header).addClass(d.icons.headerSelected),h.next().addClass("ui-accordion-content-active"));return}},_toggle:function(b,c,d,e,f){var g=this,h=g.options;g.toShow=b,g.toHide=c,g.data=d;var i=function(){if(!!g)return g._completed.apply(g,arguments)};g._trigger("changestart",null,g.data),g.running=c.size()===0?b.size():c.size();if(h.animated){var j={};h.collapsible&&e?j={toShow:a([]),toHide:c,complete:i,down:f,autoHeight:h.autoHeight||h.fillSpace}:j={toShow:b,toHide:c,complete:i,down:f,autoHeight:h.autoHeight||h.fillSpace},h.proxied||(h.proxied=h.animated),h.proxiedDuration||(h.proxiedDuration=h.duration),h.animated=a.isFunction(h.proxied)?h.proxied(j):h.proxied,h.duration=a.isFunction(h.proxiedDuration)?h.proxiedDuration(j):h.proxiedDuration;var k=a.ui.accordion.animations,l=h.duration,m=h.animated;m&&!k[m]&&!a.easing[m]&&(m="slide"),k[m]||(k[m]=function(a){this.slide(a,{easing:m,duration:l||700})}),k[m](j)}else h.collapsible&&e?b.toggle():(c.hide(),b.show()),i(!0);c.prev().attr({"aria-expanded":"false","aria-selected":"false",tabIndex:-1}).blur(),b.prev().attr({"aria-expanded":"true","aria-selected":"true",tabIndex:0}).focus()},_completed:function(a){this.running=a?0:--this.running;this.running||(this.options.clearStyle&&this.toShow.add(this.toHide).css({height:"",overflow:""}),this.toHide.removeClass("ui-accordion-content-active"),this.toHide.length&&(this.toHide.parent()[0].className=this.toHide.parent()[0].className),this._trigger("change",null,this.data))}}),a.extend(a.ui.accordion,{version:"1.8.18",animations:{slide:function(b,c){b=a.extend({easing:"swing",duration:300},b,c);if(!b.toHide.size())b.toShow.animate({height:"show",paddingTop:"show",paddingBottom:"show"},b);else{if(!b.toShow.size()){b.toHide.animate({height:"hide",paddingTop:"hide",paddingBottom:"hide"},b);return}var d=b.toShow.css("overflow"),e=0,f={},g={},h=["height","paddingTop","paddingBottom"],i,j=b.toShow;i=j[0].style.width,j.width(j.parent().width()-parseFloat(j.css("paddingLeft"))-parseFloat(j.css("paddingRight"))-(parseFloat(j.css("borderLeftWidth"))||0)-(parseFloat(j.css("borderRightWidth"))||0)),a.each(h,function(c,d){g[d]="hide";var e=(""+a.css(b.toShow[0],d)).match(/^([\d+-.]+)(.*)$/);f[d]={value:e[1],unit:e[2]||"px"}}),b.toShow.css({height:0,overflow:"hidden"}).show(),b.toHide.filter(":hidden").each(b.complete).end().filter(":visible").animate(g,{step:function(a,c){c.prop=="height"&&(e=c.end-c.start===0?0:(c.now-c.start)/(c.end-c.start)),b.toShow[0].style[c.prop]=e*f[c.prop].value+f[c.prop].unit},duration:b.duration,easing:b.easing,complete:function(){b.autoHeight||b.toShow.css("height",""),b.toShow.css({width:i,overflow:d}),b.complete()}})}},bounceslide:function(a){this.slide(a,{easing:a.down?"easeOutBounce":"swing",duration:a.down?1e3:200})}}})})(jQuery);/* |
| | | * jQuery UI Autocomplete 1.8.18 |
| | | * |
| | | * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) |
| | | * Dual licensed under the MIT or GPL Version 2 licenses. |
| | | * http://jquery.org/license |
| | | * |
| | | * http://docs.jquery.com/UI/Autocomplete |
| | | * |
| | | * Depends: |
| | | * jquery.ui.core.js |
| | | * jquery.ui.widget.js |
| | | * jquery.ui.position.js |
| | | */(function(a,b){var c=0;a.widget("ui.autocomplete",{options:{appendTo:"body",autoFocus:!1,delay:300,minLength:1,position:{my:"left top",at:"left bottom",collision:"none"},source:null},pending:0,_create:function(){var b=this,c=this.element[0].ownerDocument,d;this.element.addClass("ui-autocomplete-input").attr("autocomplete","off").attr({role:"textbox","aria-autocomplete":"list","aria-haspopup":"true"}).bind("keydown.autocomplete",function(c){if(!b.options.disabled&&!b.element.propAttr("readOnly")){d=!1;var e=a.ui.keyCode;switch(c.keyCode){case e.PAGE_UP:b._move("previousPage",c);break;case e.PAGE_DOWN:b._move("nextPage",c);break;case e.UP:b._move("previous",c),c.preventDefault();break;case e.DOWN:b._move("next",c),c.preventDefault();break;case e.ENTER:case e.NUMPAD_ENTER:b.menu.active&&(d=!0,c.preventDefault());case e.TAB:if(!b.menu.active)return;b.menu.select(c);break;case e.ESCAPE:b.element.val(b.term),b.close(c);break;default:clearTimeout(b.searching),b.searching=setTimeout(function(){b.term!=b.element.val()&&(b.selectedItem=null,b.search(null,c))},b.options.delay)}}}).bind("keypress.autocomplete",function(a){d&&(d=!1,a.preventDefault())}).bind("focus.autocomplete",function(){b.options.disabled||(b.selectedItem=null,b.previous=b.element.val())}).bind("blur.autocomplete",function(a){b.options.disabled||(clearTimeout(b.searching),b.closing=setTimeout(function(){b.close(a),b._change(a)},150))}),this._initSource(),this.response=function(){return b._response.apply(b,arguments)},this.menu=a("<ul></ul>").addClass("ui-autocomplete").appendTo(a(this.options.appendTo||"body",c)[0]).mousedown(function(c){var d=b.menu.element[0];a(c.target).closest(".ui-menu-item").length||setTimeout(function(){a(document).one("mousedown",function(c){c.target!==b.element[0]&&c.target!==d&&!a.ui.contains(d,c.target)&&b.close()})},1),setTimeout(function(){clearTimeout(b.closing)},13)}).menu({focus:function(a,c){var d=c.item.data("item.autocomplete");!1!==b._trigger("focus",a,{item:d})&&/^key/.test(a.originalEvent.type)&&b.element.val(d.value)},selected:function(a,d){var e=d.item.data("item.autocomplete"),f=b.previous;b.element[0]!==c.activeElement&&(b.element.focus(),b.previous=f,setTimeout(function(){b.previous=f,b.selectedItem=e},1)),!1!==b._trigger("select",a,{item:e})&&b.element.val(e.value),b.term=b.element.val(),b.close(a),b.selectedItem=e},blur:function(a,c){b.menu.element.is(":visible")&&b.element.val()!==b.term&&b.element.val(b.term)}}).zIndex(this.element.zIndex()+1).css({top:0,left:0}).hide().data("menu"),a.fn.bgiframe&&this.menu.element.bgiframe(),b.beforeunloadHandler=function(){b.element.removeAttr("autocomplete")},a(window).bind("beforeunload",b.beforeunloadHandler)},destroy:function(){this.element.removeClass("ui-autocomplete-input").removeAttr("autocomplete").removeAttr("role").removeAttr("aria-autocomplete").removeAttr("aria-haspopup"),this.menu.element.remove(),a(window).unbind("beforeunload",this.beforeunloadHandler),a.Widget.prototype.destroy.call(this)},_setOption:function(b,c){a.Widget.prototype._setOption.apply(this,arguments),b==="source"&&this._initSource(),b==="appendTo"&&this.menu.element.appendTo(a(c||"body",this.element[0].ownerDocument)[0]),b==="disabled"&&c&&this.xhr&&this.xhr.abort()},_initSource:function(){var b=this,d,e;a.isArray(this.options.source)?(d=this.options.source,this.source=function(b,c){c(a.ui.autocomplete.filter(d,b.term))}):typeof this.options.source=="string"?(e=this.options.source,this.source=function(d,f){b.xhr&&b.xhr.abort(),b.xhr=a.ajax({url:e,data:d,dataType:"json",context:{autocompleteRequest:++c},success:function(a,b){this.autocompleteRequest===c&&f(a)},error:function(){this.autocompleteRequest===c&&f([])}})}):this.source=this.options.source},search:function(a,b){a=a!=null?a:this.element.val(),this.term=this.element.val();if(a.length<this.options.minLength)return this.close(b);clearTimeout(this.closing);if(this._trigger("search",b)!==!1)return this._search(a)},_search:function(a){this.pending++,this.element.addClass("ui-autocomplete-loading"),this.source({term:a},this.response)},_response:function(a){!this.options.disabled&&a&&a.length?(a=this._normalize(a),this._suggest(a),this._trigger("open")):this.close(),this.pending--,this.pending||this.element.removeClass("ui-autocomplete-loading")},close:function(a){clearTimeout(this.closing),this.menu.element.is(":visible")&&(this.menu.element.hide(),this.menu.deactivate(),this._trigger("close",a))},_change:function(a){this.previous!==this.element.val()&&this._trigger("change",a,{item:this.selectedItem})},_normalize:function(b){if(b.length&&b[0].label&&b[0].value)return b;return a.map(b,function(b){if(typeof b=="string")return{label:b,value:b};return a.extend({label:b.label||b.value,value:b.value||b.label},b)})},_suggest:function(b){var c=this.menu.element.empty().zIndex(this.element.zIndex()+1);this._renderMenu(c,b),this.menu.deactivate(),this.menu.refresh(),c.show(),this._resizeMenu(),c.position(a.extend({of:this.element},this.options.position)),this.options.autoFocus&&this.menu.next(new a.Event("mouseover"))},_resizeMenu:function(){var a=this.menu.element;a.outerWidth(Math.max(a.width("").outerWidth()+1,this.element.outerWidth()))},_renderMenu:function(b,c){var d=this;a.each(c,function(a,c){d._renderItem(b,c)})},_renderItem:function(b,c){return a("<li></li>").data("item.autocomplete",c).append(a("<a></a>").text(c.label)).appendTo(b)},_move:function(a,b){if(!this.menu.element.is(":visible"))this.search(null,b);else{if(this.menu.first()&&/^previous/.test(a)||this.menu.last()&&/^next/.test(a)){this.element.val(this.term),this.menu.deactivate();return}this.menu[a](b)}},widget:function(){return this.menu.element}}),a.extend(a.ui.autocomplete,{escapeRegex:function(a){return a.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")},filter:function(b,c){var d=new RegExp(a.ui.autocomplete.escapeRegex(c),"i");return a.grep(b,function(a){return d.test(a.label||a.value||a)})}})})(jQuery),function(a){a.widget("ui.menu",{_create:function(){var b=this;this.element.addClass("ui-menu ui-widget ui-widget-content ui-corner-all").attr({role:"listbox","aria-activedescendant":"ui-active-menuitem"}).click(function(c){!a(c.target).closest(".ui-menu-item a").length||(c.preventDefault(),b.select(c))}),this.refresh()},refresh:function(){var b=this,c=this.element.children("li:not(.ui-menu-item):has(a)").addClass("ui-menu-item").attr("role","menuitem");c.children("a").addClass("ui-corner-all").attr("tabindex",-1).mouseenter(function(c){b.activate(c,a(this).parent())}).mouseleave(function(){b.deactivate()})},activate:function(a,b){this.deactivate();if(this.hasScroll()){var c=b.offset().top-this.element.offset().top,d=this.element.scrollTop(),e=this.element.height();c<0?this.element.scrollTop(d+c):c>=e&&this.element.scrollTop(d+c-e+b.height())}this.active=b.eq(0).children("a").addClass("ui-state-hover").attr("id","ui-active-menuitem").end(),this._trigger("focus",a,{item:b})},deactivate:function(){!this.active||(this.active.children("a").removeClass("ui-state-hover").removeAttr("id"),this._trigger("blur"),this.active=null)},next:function(a){this.move("next",".ui-menu-item:first",a)},previous:function(a){this.move("prev",".ui-menu-item:last",a)},first:function(){return this.active&&!this.active.prevAll(".ui-menu-item").length},last:function(){return this.active&&!this.active.nextAll(".ui-menu-item").length},move:function(a,b,c){if(!this.active)this.activate(c,this.element.children(b));else{var d=this.active[a+"All"](".ui-menu-item").eq(0);d.length?this.activate(c,d):this.activate(c,this.element.children(b))}},nextPage:function(b){if(this.hasScroll()){if(!this.active||this.last()){this.activate(b,this.element.children(".ui-menu-item:first"));return}var c=this.active.offset().top,d=this.element.height(),e=this.element.children(".ui-menu-item").filter(function(){var b=a(this).offset().top-c-d+a(this).height();return b<10&&b>-10});e.length||(e=this.element.children(".ui-menu-item:last")),this.activate(b,e)}else this.activate(b,this.element.children(".ui-menu-item").filter(!this.active||this.last()?":first":":last"))},previousPage:function(b){if(this.hasScroll()){if(!this.active||this.first()){this.activate(b,this.element.children(".ui-menu-item:last"));return}var c=this.active.offset().top,d=this.element.height();result=this.element.children(".ui-menu-item").filter(function(){var b=a(this).offset().top-c+d-a(this).height();return b<10&&b>-10}),result.length||(result=this.element.children(".ui-menu-item:first")),this.activate(b,result)}else this.activate(b,this.element.children(".ui-menu-item").filter(!this.active||this.first()?":last":":first"))},hasScroll:function(){return this.element.height()<this.element[a.fn.prop?"prop":"attr"]("scrollHeight")},select:function(a){this._trigger("selected",a,{item:this.active})}})}(jQuery);/* |
| | | * jQuery UI Button 1.8.18 |
| | | * |
| | | * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) |
| | | * Dual licensed under the MIT or GPL Version 2 licenses. |
| | | * http://jquery.org/license |
| | | * |
| | | * http://docs.jquery.com/UI/Button |
| | | * |
| | | * Depends: |
| | | * jquery.ui.core.js |
| | | * jquery.ui.widget.js |
| | | */(function(a,b){var c,d,e,f,g="ui-button ui-widget ui-state-default ui-corner-all",h="ui-state-hover ui-state-active ",i="ui-button-icons-only ui-button-icon-only ui-button-text-icons ui-button-text-icon-primary ui-button-text-icon-secondary ui-button-text-only",j=function(){var b=a(this).find(":ui-button");setTimeout(function(){b.button("refresh")},1)},k=function(b){var c=b.name,d=b.form,e=a([]);c&&(d?e=a(d).find("[name='"+c+"']"):e=a("[name='"+c+"']",b.ownerDocument).filter(function(){return!this.form}));return e};a.widget("ui.button",{options:{disabled:null,text:!0,label:null,icons:{primary:null,secondary:null}},_create:function(){this.element.closest("form").unbind("reset.button").bind("reset.button",j),typeof this.options.disabled!="boolean"?this.options.disabled=!!this.element.propAttr("disabled"):this.element.propAttr("disabled",this.options.disabled),this._determineButtonType(),this.hasTitle=!!this.buttonElement.attr("title");var b=this,h=this.options,i=this.type==="checkbox"||this.type==="radio",l="ui-state-hover"+(i?"":" ui-state-active"),m="ui-state-focus";h.label===null&&(h.label=this.buttonElement.html()),this.buttonElement.addClass(g).attr("role","button").bind("mouseenter.button",function(){h.disabled||(a(this).addClass("ui-state-hover"),this===c&&a(this).addClass("ui-state-active"))}).bind("mouseleave.button",function(){h.disabled||a(this).removeClass(l)}).bind("click.button",function(a){h.disabled&&(a.preventDefault(),a.stopImmediatePropagation())}),this.element.bind("focus.button",function(){b.buttonElement.addClass(m)}).bind("blur.button",function(){b.buttonElement.removeClass(m)}),i&&(this.element.bind("change.button",function(){f||b.refresh()}),this.buttonElement.bind("mousedown.button",function(a){h.disabled||(f=!1,d=a.pageX,e=a.pageY)}).bind("mouseup.button",function(a){!h.disabled&&(d!==a.pageX||e!==a.pageY)&&(f=!0)})),this.type==="checkbox"?this.buttonElement.bind("click.button",function(){if(h.disabled||f)return!1;a(this).toggleClass("ui-state-active"),b.buttonElement.attr("aria-pressed",b.element[0].checked)}):this.type==="radio"?this.buttonElement.bind("click.button",function(){if(h.disabled||f)return!1;a(this).addClass("ui-state-active"),b.buttonElement.attr("aria-pressed","true");var c=b.element[0];k(c).not(c).map(function(){return a(this).button("widget")[0]}).removeClass("ui-state-active").attr("aria-pressed","false")}):(this.buttonElement.bind("mousedown.button",function(){if(h.disabled)return!1;a(this).addClass("ui-state-active"),c=this,a(document).one("mouseup",function(){c=null})}).bind("mouseup.button",function(){if(h.disabled)return!1;a(this).removeClass("ui-state-active")}).bind("keydown.button",function(b){if(h.disabled)return!1;(b.keyCode==a.ui.keyCode.SPACE||b.keyCode==a.ui.keyCode.ENTER)&&a(this).addClass("ui-state-active")}).bind("keyup.button",function(){a(this).removeClass("ui-state-active")}),this.buttonElement.is("a")&&this.buttonElement.keyup(function(b){b.keyCode===a.ui.keyCode.SPACE&&a(this).click()})),this._setOption("disabled",h.disabled),this._resetButton()},_determineButtonType:function(){this.element.is(":checkbox")?this.type="checkbox":this.element.is(":radio")?this.type="radio":this.element.is("input")?this.type="input":this.type="button";if(this.type==="checkbox"||this.type==="radio"){var a=this.element.parents().filter(":last"),b="label[for='"+this.element.attr("id")+"']";this.buttonElement=a.find(b),this.buttonElement.length||(a=a.length?a.siblings():this.element.siblings(),this.buttonElement=a.filter(b),this.buttonElement.length||(this.buttonElement=a.find(b))),this.element.addClass("ui-helper-hidden-accessible");var c=this.element.is(":checked");c&&this.buttonElement.addClass("ui-state-active"),this.buttonElement.attr("aria-pressed",c)}else this.buttonElement=this.element},widget:function(){return this.buttonElement},destroy:function(){this.element.removeClass("ui-helper-hidden-accessible"),this.buttonElement.removeClass(g+" "+h+" "+i).removeAttr("role").removeAttr("aria-pressed").html(this.buttonElement.find(".ui-button-text").html()),this.hasTitle||this.buttonElement.removeAttr("title"),a.Widget.prototype.destroy.call(this)},_setOption:function(b,c){a.Widget.prototype._setOption.apply(this,arguments);b==="disabled"?c?this.element.propAttr("disabled",!0):this.element.propAttr("disabled",!1):this._resetButton()},refresh:function(){var b=this.element.is(":disabled");b!==this.options.disabled&&this._setOption("disabled",b),this.type==="radio"?k(this.element[0]).each(function(){a(this).is(":checked")?a(this).button("widget").addClass("ui-state-active").attr("aria-pressed","true"):a(this).button("widget").removeClass("ui-state-active").attr("aria-pressed","false")}):this.type==="checkbox"&&(this.element.is(":checked")?this.buttonElement.addClass("ui-state-active").attr("aria-pressed","true"):this.buttonElement.removeClass("ui-state-active").attr("aria-pressed","false"))},_resetButton:function(){if(this.type==="input")this.options.label&&this.element.val(this.options.label);else{var b=this.buttonElement.removeClass(i),c=a("<span></span>",this.element[0].ownerDocument).addClass("ui-button-text").html(this.options.label).appendTo(b.empty()).text(),d=this.options.icons,e=d.primary&&d.secondary,f=[];d.primary||d.secondary?(this.options.text&&f.push("ui-button-text-icon"+(e?"s":d.primary?"-primary":"-secondary")),d.primary&&b.prepend("<span class='ui-button-icon-primary ui-icon "+d.primary+"'></span>"),d.secondary&&b.append("<span class='ui-button-icon-secondary ui-icon "+d.secondary+"'></span>"),this.options.text||(f.push(e?"ui-button-icons-only":"ui-button-icon-only"),this.hasTitle||b.attr("title",c))):f.push("ui-button-text-only"),b.addClass(f.join(" "))}}}),a.widget("ui.buttonset",{options:{items:":button, :submit, :reset, :checkbox, :radio, a, :data(button)"},_create:function(){this.element.addClass("ui-buttonset")},_init:function(){this.refresh()},_setOption:function(b,c){b==="disabled"&&this.buttons.button("option",b,c),a.Widget.prototype._setOption.apply(this,arguments)},refresh:function(){var b=this.element.css("direction")==="rtl";this.buttons=this.element.find(this.options.items).filter(":ui-button").button("refresh").end().not(":ui-button").button().end().map(function(){return a(this).button("widget")[0]}).removeClass("ui-corner-all ui-corner-left ui-corner-right").filter(":first").addClass(b?"ui-corner-right":"ui-corner-left").end().filter(":last").addClass(b?"ui-corner-left":"ui-corner-right").end().end()},destroy:function(){this.element.removeClass("ui-buttonset"),this.buttons.map(function(){return a(this).button("widget")[0]}).removeClass("ui-corner-left ui-corner-right").end().button("destroy"),a.Widget.prototype.destroy.call(this)}})})(jQuery);/* |
| | | * jQuery UI Dialog 1.8.18 |
| | | * |
| | | * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) |
| | | * Dual licensed under the MIT or GPL Version 2 licenses. |
| | | * http://jquery.org/license |
| | | * |
| | | * http://docs.jquery.com/UI/Dialog |
| | | * |
| | | * Depends: |
| | | * jquery.ui.core.js |
| | | * jquery.ui.widget.js |
| | | * jquery.ui.button.js |
| | | * jquery.ui.draggable.js |
| | | * jquery.ui.mouse.js |
| | | * jquery.ui.position.js |
| | | * jquery.ui.resizable.js |
| | | */(function(a,b){var c="ui-dialog ui-widget ui-widget-content ui-corner-all ",d={buttons:!0,height:!0,maxHeight:!0,maxWidth:!0,minHeight:!0,minWidth:!0,width:!0},e={maxHeight:!0,maxWidth:!0,minHeight:!0,minWidth:!0},f=a.attrFn||{val:!0,css:!0,html:!0,text:!0,data:!0,width:!0,height:!0,offset:!0,click:!0};a.widget("ui.dialog",{options:{autoOpen:!0,buttons:{},closeOnEscape:!0,closeText:"close",dialogClass:"",draggable:!0,hide:null,height:"auto",maxHeight:!1,maxWidth:!1,minHeight:150,minWidth:150,modal:!1,position:{my:"center",at:"center",collision:"fit",using:function(b){var c=a(this).css(b).offset().top;c<0&&a(this).css("top",b.top-c)}},resizable:!0,show:null,stack:!0,title:"",width:300,zIndex:1e3},_create:function(){this.originalTitle=this.element.attr("title"),typeof this.originalTitle!="string"&&(this.originalTitle=""),this.options.title=this.options.title||this.originalTitle;var b=this,d=b.options,e=d.title||" ",f=a.ui.dialog.getTitleId(b.element),g=(b.uiDialog=a("<div></div>")).appendTo(document.body).hide().addClass(c+d.dialogClass).css({zIndex:d.zIndex}).attr("tabIndex",-1).css("outline",0).keydown(function(c){d.closeOnEscape&&!c.isDefaultPrevented()&&c.keyCode&&c.keyCode===a.ui.keyCode.ESCAPE&&(b.close(c),c.preventDefault())}).attr({role:"dialog","aria-labelledby":f}).mousedown(function(a){b.moveToTop(!1,a)}),h=b.element.show().removeAttr("title").addClass("ui-dialog-content ui-widget-content").appendTo(g),i=(b.uiDialogTitlebar=a("<div></div>")).addClass("ui-dialog-titlebar ui-widget-header ui-corner-all ui-helper-clearfix").prependTo(g),j=a('<a href="#"></a>').addClass("ui-dialog-titlebar-close ui-corner-all").attr("role","button").hover(function(){j.addClass("ui-state-hover")},function(){j.removeClass("ui-state-hover")}).focus(function(){j.addClass("ui-state-focus")}).blur(function(){j.removeClass("ui-state-focus")}).click(function(a){b.close(a);return!1}).appendTo(i),k=(b.uiDialogTitlebarCloseText=a("<span></span>")).addClass("ui-icon ui-icon-closethick").text(d.closeText).appendTo(j),l=a("<span></span>").addClass("ui-dialog-title").attr("id",f).html(e).prependTo(i);a.isFunction(d.beforeclose)&&!a.isFunction(d.beforeClose)&&(d.beforeClose=d.beforeclose),i.find("*").add(i).disableSelection(),d.draggable&&a.fn.draggable&&b._makeDraggable(),d.resizable&&a.fn.resizable&&b._makeResizable(),b._createButtons(d.buttons),b._isOpen=!1,a.fn.bgiframe&&g.bgiframe()},_init:function(){this.options.autoOpen&&this.open()},destroy:function(){var a=this;a.overlay&&a.overlay.destroy(),a.uiDialog.hide(),a.element.unbind(".dialog").removeData("dialog").removeClass("ui-dialog-content ui-widget-content").hide().appendTo("body"),a.uiDialog.remove(),a.originalTitle&&a.element.attr("title",a.originalTitle);return a},widget:function(){return this.uiDialog},close:function(b){var c=this,d,e;if(!1!==c._trigger("beforeClose",b)){c.overlay&&c.overlay.destroy(),c.uiDialog.unbind("keypress.ui-dialog"),c._isOpen=!1,c.options.hide?c.uiDialog.hide(c.options.hide,function(){c._trigger("close",b)}):(c.uiDialog.hide(),c._trigger("close",b)),a.ui.dialog.overlay.resize(),c.options.modal&&(d=0,a(".ui-dialog").each(function(){this!==c.uiDialog[0]&&(e=a(this).css("z-index"),isNaN(e)||(d=Math.max(d,e)))}),a.ui.dialog.maxZ=d);return c}},isOpen:function(){return this._isOpen},moveToTop:function(b,c){var d=this,e=d.options,f;if(e.modal&&!b||!e.stack&&!e.modal)return d._trigger("focus",c);e.zIndex>a.ui.dialog.maxZ&&(a.ui.dialog.maxZ=e.zIndex),d.overlay&&(a.ui.dialog.maxZ+=1,d.overlay.$el.css("z-index",a.ui.dialog.overlay.maxZ=a.ui.dialog.maxZ)),f={scrollTop:d.element.scrollTop(),scrollLeft:d.element.scrollLeft()},a.ui.dialog.maxZ+=1,d.uiDialog.css("z-index",a.ui.dialog.maxZ),d.element.attr(f),d._trigger("focus",c);return d},open:function(){if(!this._isOpen){var b=this,c=b.options,d=b.uiDialog;b.overlay=c.modal?new a.ui.dialog.overlay(b):null,b._size(),b._position(c.position),d.show(c.show),b.moveToTop(!0),c.modal&&d.bind("keydown.ui-dialog",function(b){if(b.keyCode===a.ui.keyCode.TAB){var c=a(":tabbable",this),d=c.filter(":first"),e=c.filter(":last");if(b.target===e[0]&&!b.shiftKey){d.focus(1);return!1}if(b.target===d[0]&&b.shiftKey){e.focus(1);return!1}}}),a(b.element.find(":tabbable").get().concat(d.find(".ui-dialog-buttonpane :tabbable").get().concat(d.get()))).eq(0).focus(),b._isOpen=!0,b._trigger("open");return b}},_createButtons:function(b){var c=this,d=!1,e=a("<div></div>").addClass("ui-dialog-buttonpane ui-widget-content ui-helper-clearfix"),g=a("<div></div>").addClass("ui-dialog-buttonset").appendTo(e);c.uiDialog.find(".ui-dialog-buttonpane").remove(),typeof b=="object"&&b!==null&&a.each(b,function(){return!(d=!0)}),d&&(a.each(b,function(b,d){d=a.isFunction(d)?{click:d,text:b}:d;var e=a('<button type="button"></button>').click(function(){d.click.apply(c.element[0],arguments)}).appendTo(g);a.each(d,function(a,b){a!=="click"&&(a in f?e[a](b):e.attr(a,b))}),a.fn.button&&e.button()}),e.appendTo(c.uiDialog))},_makeDraggable:function(){function f(a){return{position:a.position,offset:a.offset}}var b=this,c=b.options,d=a(document),e;b.uiDialog.draggable({cancel:".ui-dialog-content, .ui-dialog-titlebar-close",handle:".ui-dialog-titlebar",containment:"document",start:function(d,g){e=c.height==="auto"?"auto":a(this).height(),a(this).height(a(this).height()).addClass("ui-dialog-dragging"),b._trigger("dragStart",d,f(g))},drag:function(a,c){b._trigger("drag",a,f(c))},stop:function(g,h){c.position=[h.position.left-d.scrollLeft(),h.position.top-d.scrollTop()],a(this).removeClass("ui-dialog-dragging").height(e),b._trigger("dragStop",g,f(h)),a.ui.dialog.overlay.resize()}})},_makeResizable:function(c){function h(a){return{originalPosition:a.originalPosition,originalSize:a.originalSize,position:a.position,size:a.size}}c=c===b?this.options.resizable:c;var d=this,e=d.options,f=d.uiDialog.css("position"),g=typeof c=="string"?c:"n,e,s,w,se,sw,ne,nw";d.uiDialog.resizable({cancel:".ui-dialog-content",containment:"document",alsoResize:d.element,maxWidth:e.maxWidth,maxHeight:e.maxHeight,minWidth:e.minWidth,minHeight:d._minHeight(),handles:g,start:function(b,c){a(this).addClass("ui-dialog-resizing"),d._trigger("resizeStart",b,h(c))},resize:function(a,b){d._trigger("resize",a,h(b))},stop:function(b,c){a(this).removeClass("ui-dialog-resizing"),e.height=a(this).height(),e.width=a(this).width(),d._trigger("resizeStop",b,h(c)),a.ui.dialog.overlay.resize()}}).css("position",f).find(".ui-resizable-se").addClass("ui-icon ui-icon-grip-diagonal-se")},_minHeight:function(){var a=this.options;return a.height==="auto"?a.minHeight:Math.min(a.minHeight,a.height)},_position:function(b){var c=[],d=[0,0],e;if(b){if(typeof b=="string"||typeof b=="object"&&"0"in b)c=b.split?b.split(" "):[b[0],b[1]],c.length===1&&(c[1]=c[0]),a.each(["left","top"],function(a,b){+c[a]===c[a]&&(d[a]=c[a],c[a]=b)}),b={my:c.join(" "),at:c.join(" "),offset:d.join(" ")};b=a.extend({},a.ui.dialog.prototype.options.position,b)}else b=a.ui.dialog.prototype.options.position;e=this.uiDialog.is(":visible"),e||this.uiDialog.show(),this.uiDialog.css({top:0,left:0}).position(a.extend({of:window},b)),e||this.uiDialog.hide()},_setOptions:function(b){var c=this,f={},g=!1;a.each(b,function(a,b){c._setOption(a,b),a in d&&(g=!0),a in e&&(f[a]=b)}),g&&this._size(),this.uiDialog.is(":data(resizable)")&&this.uiDialog.resizable("option",f)},_setOption:function(b,d){var e=this,f=e.uiDialog;switch(b){case"beforeclose":b="beforeClose";break;case"buttons":e._createButtons(d);break;case"closeText":e.uiDialogTitlebarCloseText.text(""+d);break;case"dialogClass":f.removeClass(e.options.dialogClass).addClass(c+d);break;case"disabled":d?f.addClass("ui-dialog-disabled"):f.removeClass("ui-dialog-disabled");break;case"draggable":var g=f.is(":data(draggable)");g&&!d&&f.draggable("destroy"),!g&&d&&e._makeDraggable();break;case"position":e._position(d);break;case"resizable":var h=f.is(":data(resizable)");h&&!d&&f.resizable("destroy"),h&&typeof d=="string"&&f.resizable("option","handles",d),!h&&d!==!1&&e._makeResizable(d);break;case"title":a(".ui-dialog-title",e.uiDialogTitlebar).html(""+(d||" "))}a.Widget.prototype._setOption.apply(e,arguments)},_size:function(){var b=this.options,c,d,e=this.uiDialog.is(":visible");this.element.show().css({width:"auto",minHeight:0,height:0}),b.minWidth>b.width&&(b.width=b.minWidth),c=this.uiDialog.css({height:"auto",width:b.width}).height(),d=Math.max(0,b.minHeight-c);if(b.height==="auto")if(a.support.minHeight)this.element.css({minHeight:d,height:"auto"});else{this.uiDialog.show();var f=this.element.css("height","auto").height();e||this.uiDialog.hide(),this.element.height(Math.max(f,d))}else this.element.height(Math.max(b.height-c,0));this.uiDialog.is(":data(resizable)")&&this.uiDialog.resizable("option","minHeight",this._minHeight())}}),a.extend(a.ui.dialog,{version:"1.8.18",uuid:0,maxZ:0,getTitleId:function(a){var b=a.attr("id");b||(this.uuid+=1,b=this.uuid);return"ui-dialog-title-"+b},overlay:function(b){this.$el=a.ui.dialog.overlay.create(b)}}),a.extend(a.ui.dialog.overlay,{instances:[],oldInstances:[],maxZ:0,events:a.map("focus,mousedown,mouseup,keydown,keypress,click".split(","),function(a){return a+".dialog-overlay"}).join(" "),create:function(b){this.instances.length===0&&(setTimeout(function(){a.ui.dialog.overlay.instances.length&&a(document).bind(a.ui.dialog.overlay.events,function(b){if(a(b.target).zIndex()<a.ui.dialog.overlay.maxZ)return!1})},1),a(document).bind("keydown.dialog-overlay",function(c){b.options.closeOnEscape&&!c.isDefaultPrevented()&&c.keyCode&&c.keyCode===a.ui.keyCode.ESCAPE&&(b.close(c),c.preventDefault())}),a(window).bind("resize.dialog-overlay",a.ui.dialog.overlay.resize));var c=(this.oldInstances.pop()||a("<div></div>").addClass("ui-widget-overlay")).appendTo(document.body).css({width:this.width(),height:this.height()});a.fn.bgiframe&&c.bgiframe(),this.instances.push(c);return c},destroy:function(b){var c=a.inArray(b,this.instances);c!=-1&&this.oldInstances.push(this.instances.splice(c,1)[0]),this.instances.length===0&&a([document,window]).unbind(".dialog-overlay"),b.remove();var d=0;a.each(this.instances,function(){d=Math.max(d,this.css("z-index"))}),this.maxZ=d},height:function(){var b,c;if(a.browser.msie&&a.browser.version<7){b=Math.max(document.documentElement.scrollHeight,document.body.scrollHeight),c=Math.max(document.documentElement.offsetHeight,document.body.offsetHeight);return b<c?a(window).height()+"px":b+"px"}return a(document).height()+"px"},width:function(){var b,c;if(a.browser.msie){b=Math.max(document.documentElement.scrollWidth,document.body.scrollWidth),c=Math.max(document.documentElement.offsetWidth,document.body.offsetWidth);return b<c?a(window).width()+"px":b+"px"}return a(document).width()+"px"},resize:function(){var b=a([]);a.each(a.ui.dialog.overlay.instances,function(){b=b.add(this)}),b.css({width:0,height:0}).css({width:a.ui.dialog.overlay.width(),height:a.ui.dialog.overlay.height()})}}),a.extend(a.ui.dialog.overlay.prototype,{destroy:function(){a.ui.dialog.overlay.destroy(this.$el)}})})(jQuery);/* |
| | | * jQuery UI Slider 1.8.18 |
| | | * |
| | | * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) |
| | | * Dual licensed under the MIT or GPL Version 2 licenses. |
| | | * http://jquery.org/license |
| | | * |
| | | * http://docs.jquery.com/UI/Slider |
| | | * |
| | | * Depends: |
| | | * jquery.ui.core.js |
| | | * jquery.ui.mouse.js |
| | | * jquery.ui.widget.js |
| | | */(function(a,b){var c=5;a.widget("ui.slider",a.ui.mouse,{widgetEventPrefix:"slide",options:{animate:!1,distance:0,max:100,min:0,orientation:"horizontal",range:!1,step:1,value:0,values:null},_create:function(){var b=this,d=this.options,e=this.element.find(".ui-slider-handle").addClass("ui-state-default ui-corner-all"),f="<a class='ui-slider-handle ui-state-default ui-corner-all' href='#'></a>",g=d.values&&d.values.length||1,h=[];this._keySliding=!1,this._mouseSliding=!1,this._animateOff=!0,this._handleIndex=null,this._detectOrientation(),this._mouseInit(),this.element.addClass("ui-slider ui-slider-"+this.orientation+" ui-widget"+" ui-widget-content"+" ui-corner-all"+(d.disabled?" ui-slider-disabled ui-disabled":"")),this.range=a([]),d.range&&(d.range===!0&&(d.values||(d.values=[this._valueMin(),this._valueMin()]),d.values.length&&d.values.length!==2&&(d.values=[d.values[0],d.values[0]])),this.range=a("<div></div>").appendTo(this.element).addClass("ui-slider-range ui-widget-header"+(d.range==="min"||d.range==="max"?" ui-slider-range-"+d.range:"")));for(var i=e.length;i<g;i+=1)h.push(f);this.handles=e.add(a(h.join("")).appendTo(b.element)),this.handle=this.handles.eq(0),this.handles.add(this.range).filter("a").click(function(a){a.preventDefault()}).hover(function(){d.disabled||a(this).addClass("ui-state-hover")},function(){a(this).removeClass("ui-state-hover")}).focus(function(){d.disabled?a(this).blur():(a(".ui-slider .ui-state-focus").removeClass("ui-state-focus"),a(this).addClass("ui-state-focus"))}).blur(function(){a(this).removeClass("ui-state-focus")}),this.handles.each(function(b){a(this).data("index.ui-slider-handle",b)}),this.handles.keydown(function(d){var e=a(this).data("index.ui-slider-handle"),f,g,h,i;if(!b.options.disabled){switch(d.keyCode){case a.ui.keyCode.HOME:case a.ui.keyCode.END:case a.ui.keyCode.PAGE_UP:case a.ui.keyCode.PAGE_DOWN:case a.ui.keyCode.UP:case a.ui.keyCode.RIGHT:case a.ui.keyCode.DOWN:case a.ui.keyCode.LEFT:d.preventDefault();if(!b._keySliding){b._keySliding=!0,a(this).addClass("ui-state-active"),f=b._start(d,e);if(f===!1)return}}i=b.options.step,b.options.values&&b.options.values.length?g=h=b.values(e):g=h=b.value();switch(d.keyCode){case a.ui.keyCode.HOME:h=b._valueMin();break;case a.ui.keyCode.END:h=b._valueMax();break;case a.ui.keyCode.PAGE_UP:h=b._trimAlignValue(g+(b._valueMax()-b._valueMin())/c);break;case a.ui.keyCode.PAGE_DOWN:h=b._trimAlignValue(g-(b._valueMax()-b._valueMin())/c);break;case a.ui.keyCode.UP:case a.ui.keyCode.RIGHT:if(g===b._valueMax())return;h=b._trimAlignValue(g+i);break;case a.ui.keyCode.DOWN:case a.ui.keyCode.LEFT:if(g===b._valueMin())return;h=b._trimAlignValue(g-i)}b._slide(d,e,h)}}).keyup(function(c){var d=a(this).data("index.ui-slider-handle");b._keySliding&&(b._keySliding=!1,b._stop(c,d),b._change(c,d),a(this).removeClass("ui-state-active"))}),this._refreshValue(),this._animateOff=!1},destroy:function(){this.handles.remove(),this.range.remove(),this.element.removeClass("ui-slider ui-slider-horizontal ui-slider-vertical ui-slider-disabled ui-widget ui-widget-content ui-corner-all").removeData("slider").unbind(".slider"),this._mouseDestroy();return this},_mouseCapture:function(b){var c=this.options,d,e,f,g,h,i,j,k,l;if(c.disabled)return!1;this.elementSize={width:this.element.outerWidth(),height:this.element.outerHeight()},this.elementOffset=this.element.offset(),d={x:b.pageX,y:b.pageY},e=this._normValueFromMouse(d),f=this._valueMax()-this._valueMin()+1,h=this,this.handles.each(function(b){var c=Math.abs(e-h.values(b));f>c&&(f=c,g=a(this),i=b)}),c.range===!0&&this.values(1)===c.min&&(i+=1,g=a(this.handles[i])),j=this._start(b,i);if(j===!1)return!1;this._mouseSliding=!0,h._handleIndex=i,g.addClass("ui-state-active").focus(),k=g.offset(),l=!a(b.target).parents().andSelf().is(".ui-slider-handle"),this._clickOffset=l?{left:0,top:0}:{left:b.pageX-k.left-g.width()/2,top:b.pageY-k.top-g.height()/2-(parseInt(g.css("borderTopWidth"),10)||0)-(parseInt(g.css("borderBottomWidth"),10)||0)+(parseInt(g.css("marginTop"),10)||0)},this.handles.hasClass("ui-state-hover")||this._slide(b,i,e),this._animateOff=!0;return!0},_mouseStart:function(a){return!0},_mouseDrag:function(a){var b={x:a.pageX,y:a.pageY},c=this._normValueFromMouse(b);this._slide(a,this._handleIndex,c);return!1},_mouseStop:function(a){this.handles.removeClass("ui-state-active"),this._mouseSliding=!1,this._stop(a,this._handleIndex),this._change(a,this._handleIndex),this._handleIndex=null,this._clickOffset=null,this._animateOff=!1;return!1},_detectOrientation:function(){this.orientation=this.options.orientation==="vertical"?"vertical":"horizontal"},_normValueFromMouse:function(a){var b,c,d,e,f;this.orientation==="horizontal"?(b=this.elementSize.width,c=a.x-this.elementOffset.left-(this._clickOffset?this._clickOffset.left:0)):(b=this.elementSize.height,c=a.y-this.elementOffset.top-(this._clickOffset?this._clickOffset.top:0)),d=c/b,d>1&&(d=1),d<0&&(d=0),this.orientation==="vertical"&&(d=1-d),e=this._valueMax()-this._valueMin(),f=this._valueMin()+d*e;return this._trimAlignValue(f)},_start:function(a,b){var c={handle:this.handles[b],value:this.value()};this.options.values&&this.options.values.length&&(c.value=this.values(b),c.values=this.values());return this._trigger("start",a,c)},_slide:function(a,b,c){var d,e,f;this.options.values&&this.options.values.length?(d=this.values(b?0:1),this.options.values.length===2&&this.options.range===!0&&(b===0&&c>d||b===1&&c<d)&&(c=d),c!==this.values(b)&&(e=this.values(),e[b]=c,f=this._trigger("slide",a,{handle:this.handles[b],value:c,values:e}),d=this.values(b?0:1),f!==!1&&this.values(b,c,!0))):c!==this.value()&&(f=this._trigger("slide",a,{handle:this.handles[b],value:c}),f!==!1&&this.value(c))},_stop:function(a,b){var c={handle:this.handles[b],value:this.value()};this.options.values&&this.options.values.length&&(c.value=this.values(b),c.values=this.values()),this._trigger("stop",a,c)},_change:function(a,b){if(!this._keySliding&&!this._mouseSliding){var c={handle:this.handles[b],value:this.value()};this.options.values&&this.options.values.length&&(c.value=this.values(b),c.values=this.values()),this._trigger("change",a,c)}},value:function(a){if(arguments.length)this.options.value=this._trimAlignValue(a),this._refreshValue(),this._change(null,0);else return this._value()},values:function(b,c){var d,e,f;if(arguments.length>1)this.options.values[b]=this._trimAlignValue(c),this._refreshValue(),this._change(null,b);else{if(!arguments.length)return this._values();if(!a.isArray(arguments[0]))return this.options.values&&this.options.values.length?this._values(b):this.value();d=this.options.values,e=arguments[0];for(f=0;f<d.length;f+=1)d[f]=this._trimAlignValue(e[f]),this._change(null,f);this._refreshValue()}},_setOption:function(b,c){var d,e=0;a.isArray(this.options.values)&&(e=this.options.values.length),a.Widget.prototype._setOption.apply(this,arguments);switch(b){case"disabled":c?(this.handles.filter(".ui-state-focus").blur(),this.handles.removeClass("ui-state-hover"),this.handles.propAttr("disabled",!0),this.element.addClass("ui-disabled")):(this.handles.propAttr("disabled",!1),this.element.removeClass("ui-disabled"));break;case"orientation":this._detectOrientation(),this.element.removeClass("ui-slider-horizontal ui-slider-vertical").addClass("ui-slider-"+this.orientation),this._refreshValue();break;case"value":this._animateOff=!0,this._refreshValue(),this._change(null,0),this._animateOff=!1;break;case"values":this._animateOff=!0,this._refreshValue();for(d=0;d<e;d+=1)this._change(null,d);this._animateOff=!1}},_value:function(){var a=this.options.value;a=this._trimAlignValue(a);return a},_values:function(a){var b,c,d;if(arguments.length){b=this.options.values[a],b=this._trimAlignValue(b);return b}c=this.options.values.slice();for(d=0;d<c.length;d+=1)c[d]=this._trimAlignValue(c[d]);return c},_trimAlignValue:function(a){if(a<=this._valueMin())return this._valueMin();if(a>=this._valueMax())return this._valueMax();var b=this.options.step>0?this.options.step:1,c=(a-this._valueMin())%b,d=a-c;Math.abs(c)*2>=b&&(d+=c>0?b:-b);return parseFloat(d.toFixed(5))},_valueMin:function(){return this.options.min},_valueMax:function(){return this.options.max},_refreshValue:function(){var b=this.options.range,c=this.options,d=this,e=this._animateOff?!1:c.animate,f,g={},h,i,j,k;this.options.values&&this.options.values.length?this.handles.each(function(b,i){f=(d.values(b)-d._valueMin())/(d._valueMax()-d._valueMin())*100,g[d.orientation==="horizontal"?"left":"bottom"]=f+"%",a(this).stop(1,1)[e?"animate":"css"](g,c.animate),d.options.range===!0&&(d.orientation==="horizontal"?(b===0&&d.range.stop(1,1)[e?"animate":"css"]({left:f+"%"},c.animate),b===1&&d.range[e?"animate":"css"]({width:f-h+"%"},{queue:!1,duration:c.animate})):(b===0&&d.range.stop(1,1)[e?"animate":"css"]({bottom:f+"%"},c.animate),b===1&&d.range[e?"animate":"css"]({height:f-h+"%"},{queue:!1,duration:c.animate}))),h=f}):(i=this.value(),j=this._valueMin(),k=this._valueMax(),f=k!==j?(i-j)/(k-j)*100:0,g[d.orientation==="horizontal"?"left":"bottom"]=f+"%",this.handle.stop(1,1)[e?"animate":"css"](g,c.animate),b==="min"&&this.orientation==="horizontal"&&this.range.stop(1,1)[e?"animate":"css"]({width:f+"%"},c.animate),b==="max"&&this.orientation==="horizontal"&&this.range[e?"animate":"css"]({width:100-f+"%"},{queue:!1,duration:c.animate}),b==="min"&&this.orientation==="vertical"&&this.range.stop(1,1)[e?"animate":"css"]({height:f+"%"},c.animate),b==="max"&&this.orientation==="vertical"&&this.range[e?"animate":"css"]({height:100-f+"%"},{queue:!1,duration:c.animate}))}}),a.extend(a.ui.slider,{version:"1.8.18"})})(jQuery);/* |
| | | * jQuery UI Tabs 1.8.18 |
| | | * |
| | | * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) |
| | | * Dual licensed under the MIT or GPL Version 2 licenses. |
| | | * http://jquery.org/license |
| | | * |
| | | * http://docs.jquery.com/UI/Tabs |
| | | * |
| | | * Depends: |
| | | * jquery.ui.core.js |
| | | * jquery.ui.widget.js |
| | | */(function(a,b){function f(){return++d}function e(){return++c}var c=0,d=0;a.widget("ui.tabs",{options:{add:null,ajaxOptions:null,cache:!1,cookie:null,collapsible:!1,disable:null,disabled:[],enable:null,event:"click",fx:null,idPrefix:"ui-tabs-",load:null,panelTemplate:"<div></div>",remove:null,select:null,show:null,spinner:"<em>Loading…</em>",tabTemplate:"<li><a href='#{href}'><span>#{label}</span></a></li>"},_create:function(){this._tabify(!0)},_setOption:function(a,b){if(a=="selected"){if(this.options.collapsible&&b==this.options.selected)return;this.select(b)}else this.options[a]=b,this._tabify()},_tabId:function(a){return a.title&&a.title.replace(/\s/g,"_").replace(/[^\w\u00c0-\uFFFF-]/g,"")||this.options.idPrefix+e()},_sanitizeSelector:function(a){return a.replace(/:/g,"\\:")},_cookie:function(){var b=this.cookie||(this.cookie=this.options.cookie.name||"ui-tabs-"+f());return a.cookie.apply(null,[b].concat(a.makeArray(arguments)))},_ui:function(a,b){return{tab:a,panel:b,index:this.anchors.index(a)}},_cleanup:function(){this.lis.filter(".ui-state-processing").removeClass("ui-state-processing").find("span:data(label.tabs)").each(function(){var b=a(this);b.html(b.data("label.tabs")).removeData("label.tabs")})},_tabify:function(c){function m(b,c){b.css("display",""),!a.support.opacity&&c.opacity&&b[0].style.removeAttribute("filter")}var d=this,e=this.options,f=/^#.+/;this.list=this.element.find("ol,ul").eq(0),this.lis=a(" > li:has(a[href])",this.list),this.anchors=this.lis.map(function(){return a("a",this)[0]}),this.panels=a([]),this.anchors.each(function(b,c){var g=a(c).attr("href"),h=g.split("#")[0],i;h&&(h===location.toString().split("#")[0]||(i=a("base")[0])&&h===i.href)&&(g=c.hash,c.href=g);if(f.test(g))d.panels=d.panels.add(d.element.find(d._sanitizeSelector(g)));else if(g&&g!=="#"){a.data(c,"href.tabs",g),a.data(c,"load.tabs",g.replace(/#.*$/,""));var j=d._tabId(c);c.href="#"+j;var k=d.element.find("#"+j);k.length||(k=a(e.panelTemplate).attr("id",j).addClass("ui-tabs-panel ui-widget-content ui-corner-bottom").insertAfter(d.panels[b-1]||d.list),k.data("destroy.tabs",!0)),d.panels=d.panels.add(k)}else e.disabled.push(b)}),c?(this.element.addClass("ui-tabs ui-widget ui-widget-content ui-corner-all"),this.list.addClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all"),this.lis.addClass("ui-state-default ui-corner-top"),this.panels.addClass("ui-tabs-panel ui-widget-content ui-corner-bottom"),e.selected===b?(location.hash&&this.anchors.each(function(a,b){if(b.hash==location.hash){e.selected=a;return!1}}),typeof e.selected!="number"&&e.cookie&&(e.selected=parseInt(d._cookie(),10)),typeof e.selected!="number"&&this.lis.filter(".ui-tabs-selected").length&&(e.selected=this.lis.index(this.lis.filter(".ui-tabs-selected"))),e.selected=e.selected||(this.lis.length?0:-1)):e.selected===null&&(e.selected=-1),e.selected=e.selected>=0&&this.anchors[e.selected]||e.selected<0?e.selected:0,e.disabled=a.unique(e.disabled.concat(a.map(this.lis.filter(".ui-state-disabled"),function(a,b){return d.lis.index(a)}))).sort(),a.inArray(e.selected,e.disabled)!=-1&&e.disabled.splice(a.inArray(e.selected,e.disabled),1),this.panels.addClass("ui-tabs-hide"),this.lis.removeClass("ui-tabs-selected ui-state-active"),e.selected>=0&&this.anchors.length&&(d.element.find(d._sanitizeSelector(d.anchors[e.selected].hash)).removeClass("ui-tabs-hide"),this.lis.eq(e.selected).addClass("ui-tabs-selected ui-state-active"),d.element.queue("tabs",function(){d._trigger("show",null,d._ui(d.anchors[e.selected],d.element.find(d._sanitizeSelector(d.anchors[e.selected].hash))[0]))}),this.load(e.selected)),a(window).bind("unload",function(){d.lis.add(d.anchors).unbind(".tabs"),d.lis=d.anchors=d.panels=null})):e.selected=this.lis.index(this.lis.filter(".ui-tabs-selected")),this.element[e.collapsible?"addClass":"removeClass"]("ui-tabs-collapsible"),e.cookie&&this._cookie(e.selected,e.cookie);for(var g=0,h;h=this.lis[g];g++)a(h)[a.inArray(g,e.disabled)!=-1&&!a(h).hasClass("ui-tabs-selected")?"addClass":"removeClass"]("ui-state-disabled");e.cache===!1&&this.anchors.removeData("cache.tabs"),this.lis.add(this.anchors).unbind(".tabs");if(e.event!=="mouseover"){var i=function(a,b){b.is(":not(.ui-state-disabled)")&&b.addClass("ui-state-"+a)},j=function(a,b){b.removeClass("ui-state-"+a)};this.lis.bind("mouseover.tabs",function(){i("hover",a(this))}),this.lis.bind("mouseout.tabs",function(){j("hover",a(this))}),this.anchors.bind("focus.tabs",function(){i("focus",a(this).closest("li"))}),this.anchors.bind("blur.tabs",function(){j("focus",a(this).closest("li"))})}var k,l;e.fx&&(a.isArray(e.fx)?(k=e.fx[0],l=e.fx[1]):k=l=e.fx);var n=l?function(b,c){a(b).closest("li").addClass("ui-tabs-selected ui-state-active"),c.hide().removeClass("ui-tabs-hide").animate(l,l.duration||"normal",function(){m(c,l),d._trigger("show",null,d._ui(b,c[0]))})}:function(b,c){a(b).closest("li").addClass("ui-tabs-selected ui-state-active"),c.removeClass("ui-tabs-hide"),d._trigger("show",null,d._ui(b,c[0]))},o=k?function(a,b){b.animate(k,k.duration||"normal",function(){d.lis.removeClass("ui-tabs-selected ui-state-active"),b.addClass("ui-tabs-hide"),m(b,k),d.element.dequeue("tabs")})}:function(a,b,c){d.lis.removeClass("ui-tabs-selected ui-state-active"),b.addClass("ui-tabs-hide"),d.element.dequeue("tabs")};this.anchors.bind(e.event+".tabs",function(){var b=this,c=a(b).closest("li"),f=d.panels.filter(":not(.ui-tabs-hide)"),g=d.element.find(d._sanitizeSelector(b.hash));if(c.hasClass("ui-tabs-selected")&&!e.collapsible||c.hasClass("ui-state-disabled")||c.hasClass("ui-state-processing")||d.panels.filter(":animated").length||d._trigger("select",null,d._ui(this,g[0]))===!1){this.blur();return!1}e.selected=d.anchors.index(this),d.abort();if(e.collapsible){if(c.hasClass("ui-tabs-selected")){e.selected=-1,e.cookie&&d._cookie(e.selected,e.cookie),d.element.queue("tabs",function(){o(b,f)}).dequeue("tabs"),this.blur();return!1}if(!f.length){e.cookie&&d._cookie(e.selected,e.cookie),d.element.queue("tabs",function(){n(b,g)}),d.load(d.anchors.index(this)),this.blur();return!1}}e.cookie&&d._cookie(e.selected,e.cookie);if(g.length)f.length&&d.element.queue("tabs",function(){o(b,f)}),d.element.queue("tabs",function(){n(b,g)}),d.load(d.anchors.index(this));else throw"jQuery UI Tabs: Mismatching fragment identifier.";a.browser.msie&&this.blur()}),this.anchors.bind("click.tabs",function(){return!1})},_getIndex:function(a){typeof a=="string"&&(a=this.anchors.index(this.anchors.filter("[href$="+a+"]")));return a},destroy:function(){var b=this.options;this.abort(),this.element.unbind(".tabs").removeClass("ui-tabs ui-widget ui-widget-content ui-corner-all ui-tabs-collapsible").removeData("tabs"),this.list.removeClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all"),this.anchors.each(function(){var b=a.data(this,"href.tabs");b&&(this.href=b);var c=a(this).unbind(".tabs");a.each(["href","load","cache"],function(a,b){c.removeData(b+".tabs")})}),this.lis.unbind(".tabs").add(this.panels).each(function(){a.data(this,"destroy.tabs")?a(this).remove():a(this).removeClass(["ui-state-default","ui-corner-top","ui-tabs-selected","ui-state-active","ui-state-hover","ui-state-focus","ui-state-disabled","ui-tabs-panel","ui-widget-content","ui-corner-bottom","ui-tabs-hide"].join(" "))}),b.cookie&&this._cookie(null,b.cookie);return this},add:function(c,d,e){e===b&&(e=this.anchors.length);var f=this,g=this.options,h=a(g.tabTemplate.replace(/#\{href\}/g,c).replace(/#\{label\}/g,d)),i=c.indexOf("#")?this._tabId(a("a",h)[0]):c.replace("#","");h.addClass("ui-state-default ui-corner-top").data("destroy.tabs",!0);var j=f.element.find("#"+i);j.length||(j=a(g.panelTemplate).attr("id",i).data("destroy.tabs",!0)),j.addClass("ui-tabs-panel ui-widget-content ui-corner-bottom ui-tabs-hide"),e>=this.lis.length?(h.appendTo(this.list),j.appendTo(this.list[0].parentNode)):(h.insertBefore(this.lis[e]),j.insertBefore(this.panels[e])),g.disabled=a.map(g.disabled,function(a,b){return a>=e?++a:a}),this._tabify(),this.anchors.length==1&&(g.selected=0,h.addClass("ui-tabs-selected ui-state-active"),j.removeClass("ui-tabs-hide"),this.element.queue("tabs",function(){f._trigger("show",null,f._ui(f.anchors[0],f.panels[0]))}),this.load(0)),this._trigger("add",null,this._ui(this.anchors[e],this.panels[e]));return this},remove:function(b){b=this._getIndex(b);var c=this.options,d=this.lis.eq(b).remove(),e=this.panels.eq(b).remove();d.hasClass("ui-tabs-selected")&&this.anchors.length>1&&this.select(b+(b+1<this.anchors.length?1:-1)),c.disabled=a.map(a.grep(c.disabled,function(a,c){return a!=b}),function(a,c){return a>=b?--a:a}),this._tabify(),this._trigger("remove",null,this._ui(d.find("a")[0],e[0]));return this},enable:function(b){b=this._getIndex(b);var c=this.options;if(a.inArray(b,c.disabled)!=-1){this.lis.eq(b).removeClass("ui-state-disabled"),c.disabled=a.grep(c.disabled,function(a,c){return a!=b}),this._trigger("enable",null,this._ui(this.anchors[b],this.panels[b]));return this}},disable:function(a){a=this._getIndex(a);var b=this,c=this.options;a!=c.selected&&(this.lis.eq(a).addClass("ui-state-disabled"),c.disabled.push(a),c.disabled.sort(),this._trigger("disable",null,this._ui(this.anchors[a],this.panels[a])));return this},select:function(a){a=this._getIndex(a);if(a==-1)if(this.options.collapsible&&this.options.selected!=-1)a=this.options.selected;else return this;this.anchors.eq(a).trigger(this.options.event+".tabs");return this},load:function(b){b=this._getIndex(b);var c=this,d=this.options,e=this.anchors.eq(b)[0],f=a.data(e,"load.tabs");this.abort();if(!f||this.element.queue("tabs").length!==0&&a.data(e,"cache.tabs"))this.element.dequeue("tabs");else{this.lis.eq(b).addClass("ui-state-processing");if(d.spinner){var g=a("span",e);g.data("label.tabs",g.html()).html(d.spinner)}this.xhr=a.ajax(a.extend({},d.ajaxOptions,{url:f,success:function(f,g){c.element.find(c._sanitizeSelector(e.hash)).html(f),c._cleanup(),d.cache&&a.data(e,"cache.tabs",!0),c._trigger("load",null,c._ui(c.anchors[b],c.panels[b]));try{d.ajaxOptions.success(f,g)}catch(h){}},error:function(a,f,g){c._cleanup(),c._trigger("load",null,c._ui(c.anchors[b],c.panels[b]));try{d.ajaxOptions.error(a,f,b,e)}catch(g){}}})),c.element.dequeue("tabs");return this}},abort:function(){this.element.queue([]),this.panels.stop(!1,!0),this.element.queue("tabs",this.element.queue("tabs").splice(-2,2)),this.xhr&&(this.xhr.abort(),delete this.xhr),this._cleanup();return this},url:function(a,b){this.anchors.eq(a).removeData("cache.tabs").data("load.tabs",b);return this},length:function(){return this.anchors.length}}),a.extend(a.ui.tabs,{version:"1.8.18"}),a.extend(a.ui.tabs.prototype,{rotation:null,rotate:function(a,b){var c=this,d=this.options,e=c._rotate||(c._rotate=function(b){clearTimeout(c.rotation),c.rotation=setTimeout(function(){var a=d.selected;c.select(++a<c.anchors.length?a:0)},a),b&&b.stopPropagation()}),f=c._unrotate||(c._unrotate=b?function(a){t=d.selected,e()}:function(a){a.clientX&&c.rotate(null)});a?(this.element.bind("tabsshow",e),this.anchors.bind(d.event+".tabs",f),e()):(clearTimeout(c.rotation),this.element.unbind("tabsshow",e),this.anchors.unbind(d.event+".tabs",f),delete this._rotate,delete this._unrotate);return this}})})(jQuery);/* |
| | | * jQuery UI Datepicker 1.8.18 |
| | | * |
| | | * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) |
| | | * Dual licensed under the MIT or GPL Version 2 licenses. |
| | | * http://jquery.org/license |
| | | * |
| | | * http://docs.jquery.com/UI/Datepicker |
| | | * |
| | | * Depends: |
| | | * jquery.ui.core.js |
| | | */(function($,undefined){function isArray(a){return a&&($.browser.safari&&typeof a=="object"&&a.length||a.constructor&&a.constructor.toString().match(/\Array\(\)/))}function extendRemove(a,b){$.extend(a,b);for(var c in b)if(b[c]==null||b[c]==undefined)a[c]=b[c];return a}function bindHover(a){var b="button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a";return a.bind("mouseout",function(a){var c=$(a.target).closest(b);!c.length||c.removeClass("ui-state-hover ui-datepicker-prev-hover ui-datepicker-next-hover")}).bind("mouseover",function(c){var d=$(c.target).closest(b);!$.datepicker._isDisabledDatepicker(instActive.inline?a.parent()[0]:instActive.input[0])&&!!d.length&&(d.parents(".ui-datepicker-calendar").find("a").removeClass("ui-state-hover"),d.addClass("ui-state-hover"),d.hasClass("ui-datepicker-prev")&&d.addClass("ui-datepicker-prev-hover"),d.hasClass("ui-datepicker-next")&&d.addClass("ui-datepicker-next-hover"))})}function Datepicker(){this.debug=!1,this._curInst=null,this._keyEvent=!1,this._disabledInputs=[],this._datepickerShowing=!1,this._inDialog=!1,this._mainDivId="ui-datepicker-div",this._inlineClass="ui-datepicker-inline",this._appendClass="ui-datepicker-append",this._triggerClass="ui-datepicker-trigger",this._dialogClass="ui-datepicker-dialog",this._disableClass="ui-datepicker-disabled",this._unselectableClass="ui-datepicker-unselectable",this._currentClass="ui-datepicker-current-day",this._dayOverClass="ui-datepicker-days-cell-over",this.regional=[],this.regional[""]={closeText:"Done",prevText:"Prev",nextText:"Next",currentText:"Today",monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],weekHeader:"Wk",dateFormat:"mm/dd/yy",firstDay:0,isRTL:!1,showMonthAfterYear:!1,yearSuffix:""},this._defaults={showOn:"focus",showAnim:"fadeIn",showOptions:{},defaultDate:null,appendText:"",buttonText:"...",buttonImage:"",buttonImageOnly:!1,hideIfNoPrevNext:!1,navigationAsDateFormat:!1,gotoCurrent:!1,changeMonth:!1,changeYear:!1,yearRange:"c-10:c+10",showOtherMonths:!1,selectOtherMonths:!1,showWeek:!1,calculateWeek:this.iso8601Week,shortYearCutoff:"+10",minDate:null,maxDate:null,duration:"fast",beforeShowDay:null,beforeShow:null,onSelect:null,onChangeMonthYear:null,onClose:null,numberOfMonths:1,showCurrentAtPos:0,stepMonths:1,stepBigMonths:12,altField:"",altFormat:"",constrainInput:!0,showButtonPanel:!1,autoSize:!1,disabled:!1},$.extend(this._defaults,this.regional[""]),this.dpDiv=bindHover($('<div id="'+this._mainDivId+'" class="ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all"></div>'))}$.extend($.ui,{datepicker:{version:"1.8.18"}});var PROP_NAME="datepicker",dpuuid=(new Date).getTime(),instActive;$.extend(Datepicker.prototype,{markerClassName:"hasDatepicker",maxRows:4,log:function(){this.debug&&console.log.apply("",arguments)},_widgetDatepicker:function(){return this.dpDiv},setDefaults:function(a){extendRemove(this._defaults,a||{});return this},_attachDatepicker:function(target,settings){var inlineSettings=null;for(var attrName in this._defaults){var attrValue=target.getAttribute("date:"+attrName);if(attrValue){inlineSettings=inlineSettings||{};try{inlineSettings[attrName]=eval(attrValue)}catch(err){inlineSettings[attrName]=attrValue}}}var nodeName=target.nodeName.toLowerCase(),inline=nodeName=="div"||nodeName=="span";target.id||(this.uuid+=1,target.id="dp"+this.uuid);var inst=this._newInst($(target),inline);inst.settings=$.extend({},settings||{},inlineSettings||{}),nodeName=="input"?this._connectDatepicker(target,inst):inline&&this._inlineDatepicker(target,inst)},_newInst:function(a,b){var c=a[0].id.replace(/([^A-Za-z0-9_-])/g,"\\\\$1");return{id:c,input:a,selectedDay:0,selectedMonth:0,selectedYear:0,drawMonth:0,drawYear:0,inline:b,dpDiv:b?bindHover($('<div class="'+this._inlineClass+' ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all"></div>')):this.dpDiv}},_connectDatepicker:function(a,b){var c=$(a);b.append=$([]),b.trigger=$([]);c.hasClass(this.markerClassName)||(this._attachments(c,b),c.addClass(this.markerClassName).keydown(this._doKeyDown).keypress(this._doKeyPress).keyup(this._doKeyUp).bind("setData.datepicker",function(a,c,d){b.settings[c]=d}).bind("getData.datepicker",function(a,c){return this._get(b,c)}),this._autoSize(b),$.data(a,PROP_NAME,b),b.settings.disabled&&this._disableDatepicker(a))},_attachments:function(a,b){var c=this._get(b,"appendText"),d=this._get(b,"isRTL");b.append&&b.append.remove(),c&&(b.append=$('<span class="'+this._appendClass+'">'+c+"</span>"),a[d?"before":"after"](b.append)),a.unbind("focus",this._showDatepicker),b.trigger&&b.trigger.remove();var e=this._get(b,"showOn");(e=="focus"||e=="both")&&a.focus(this._showDatepicker);if(e=="button"||e=="both"){var f=this._get(b,"buttonText"),g=this._get(b,"buttonImage");b.trigger=$(this._get(b,"buttonImageOnly")?$("<img/>").addClass(this._triggerClass).attr({src:g,alt:f,title:f}):$('<button type="button"></button>').addClass(this._triggerClass).html(g==""?f:$("<img/>").attr({src:g,alt:f,title:f}))),a[d?"before":"after"](b.trigger),b.trigger.click(function(){$.datepicker._datepickerShowing&&$.datepicker._lastInput==a[0]?$.datepicker._hideDatepicker():$.datepicker._datepickerShowing&&$.datepicker._lastInput!=a[0]?($.datepicker._hideDatepicker(),$.datepicker._showDatepicker(a[0])):$.datepicker._showDatepicker(a[0]);return!1})}},_autoSize:function(a){if(this._get(a,"autoSize")&&!a.inline){var b=new Date(2009,11,20),c=this._get(a,"dateFormat");if(c.match(/[DM]/)){var d=function(a){var b=0,c=0;for(var d=0;d<a.length;d++)a[d].length>b&&(b=a[d].length,c=d);return c};b.setMonth(d(this._get(a,c.match(/MM/)?"monthNames":"monthNamesShort"))),b.setDate(d(this._get(a,c.match(/DD/)?"dayNames":"dayNamesShort"))+20-b.getDay())}a.input.attr("size",this._formatDate(a,b).length)}},_inlineDatepicker:function(a,b){var c=$(a);c.hasClass(this.markerClassName)||(c.addClass(this.markerClassName).append(b.dpDiv).bind("setData.datepicker",function(a,c,d){b.settings[c]=d}).bind("getData.datepicker",function(a,c){return this._get(b,c)}),$.data(a,PROP_NAME,b),this._setDate(b,this._getDefaultDate(b),!0),this._updateDatepicker(b),this._updateAlternate(b),b.settings.disabled&&this._disableDatepicker(a),b.dpDiv.css("display","block"))},_dialogDatepicker:function(a,b,c,d,e){var f=this._dialogInst;if(!f){this.uuid+=1;var g="dp"+this.uuid;this._dialogInput=$('<input type="text" id="'+g+'" style="position: absolute; top: -100px; width: 0px; z-index: -10;"/>'),this._dialogInput.keydown(this._doKeyDown),$("body").append(this._dialogInput),f=this._dialogInst=this._newInst(this._dialogInput,!1),f.settings={},$.data(this._dialogInput[0],PROP_NAME,f)}extendRemove(f.settings,d||{}),b=b&&b.constructor==Date?this._formatDate(f,b):b,this._dialogInput.val(b),this._pos=e?e.length?e:[e.pageX,e.pageY]:null;if(!this._pos){var h=document.documentElement.clientWidth,i=document.documentElement.clientHeight,j=document.documentElement.scrollLeft||document.body.scrollLeft,k=document.documentElement.scrollTop||document.body.scrollTop;this._pos=[h/2-100+j,i/2-150+k]}this._dialogInput.css("left",this._pos[0]+20+"px").css("top",this._pos[1]+"px"),f.settings.onSelect=c,this._inDialog=!0,this.dpDiv.addClass(this._dialogClass),this._showDatepicker(this._dialogInput[0]),$.blockUI&&$.blockUI(this.dpDiv),$.data(this._dialogInput[0],PROP_NAME,f);return this},_destroyDatepicker:function(a){var b=$(a),c=$.data(a,PROP_NAME);if(!!b.hasClass(this.markerClassName)){var d=a.nodeName.toLowerCase();$.removeData(a,PROP_NAME),d=="input"?(c.append.remove(),c.trigger.remove(),b.removeClass(this.markerClassName).unbind("focus",this._showDatepicker).unbind("keydown",this._doKeyDown).unbind("keypress",this._doKeyPress).unbind("keyup",this._doKeyUp)):(d=="div"||d=="span")&&b.removeClass(this.markerClassName).empty()}},_enableDatepicker:function(a){var b=$(a),c=$.data(a,PROP_NAME);if(!!b.hasClass(this.markerClassName)){var d=a.nodeName.toLowerCase();if(d=="input")a.disabled=!1,c.trigger.filter("button").each(function(){this.disabled=!1}).end().filter("img").css({opacity:"1.0",cursor:""});else if(d=="div"||d=="span"){var e=b.children("."+this._inlineClass);e.children().removeClass("ui-state-disabled"),e.find("select.ui-datepicker-month, select.ui-datepicker-year").removeAttr("disabled")}this._disabledInputs=$.map(this._disabledInputs,function(b){return b==a?null:b})}},_disableDatepicker:function(a){var b=$(a),c=$.data(a,PROP_NAME);if(!!b.hasClass(this.markerClassName)){var d=a.nodeName.toLowerCase();if(d=="input")a.disabled=!0,c.trigger.filter("button").each(function(){this.disabled=!0}).end().filter("img").css({opacity:"0.5",cursor:"default"});else if(d=="div"||d=="span"){var e=b.children("."+this._inlineClass);e.children().addClass("ui-state-disabled"),e.find("select.ui-datepicker-month, select.ui-datepicker-year").attr("disabled","disabled")}this._disabledInputs=$.map(this._disabledInputs,function(b){return b==a?null:b}),this._disabledInputs[this._disabledInputs.length]=a}},_isDisabledDatepicker:function(a){if(!a)return!1;for(var b=0;b<this._disabledInputs.length;b++)if(this._disabledInputs[b]==a)return!0;return!1},_getInst:function(a){try{return $.data(a,PROP_NAME)}catch(b){throw"Missing instance data for this datepicker"}},_optionDatepicker:function(a,b,c){var d=this._getInst(a);if(arguments.length==2&&typeof b=="string")return b=="defaults"?$.extend({},$.datepicker._defaults):d?b=="all"?$.extend({},d.settings):this._get(d,b):null;var e=b||{};typeof b=="string"&&(e={},e[b]=c);if(d){this._curInst==d&&this._hideDatepicker();var f=this._getDateDatepicker(a,!0),g=this._getMinMaxDate(d,"min"),h=this._getMinMaxDate(d,"max");extendRemove(d.settings,e),g!==null&&e.dateFormat!==undefined&&e.minDate===undefined&&(d.settings.minDate=this._formatDate(d,g)),h!==null&&e.dateFormat!==undefined&&e.maxDate===undefined&&(d.settings.maxDate=this._formatDate(d,h)),this._attachments($(a),d),this._autoSize(d),this._setDate(d,f),this._updateAlternate(d),this._updateDatepicker(d)}},_changeDatepicker:function(a,b,c){this._optionDatepicker(a,b,c)},_refreshDatepicker:function(a){var b=this._getInst(a);b&&this._updateDatepicker(b)},_setDateDatepicker:function(a,b){var c=this._getInst(a);c&&(this._setDate(c,b),this._updateDatepicker(c),this._updateAlternate(c))},_getDateDatepicker:function(a,b){var c=this._getInst(a);c&&!c.inline&&this._setDateFromField(c,b);return c?this._getDate(c):null},_doKeyDown:function(a){var b=$.datepicker._getInst(a.target),c=!0,d=b.dpDiv.is(".ui-datepicker-rtl");b._keyEvent=!0;if($.datepicker._datepickerShowing)switch(a.keyCode){case 9:$.datepicker._hideDatepicker(),c=!1;break;case 13:var e=$("td."+$.datepicker._dayOverClass+":not(."+$.datepicker._currentClass+")",b.dpDiv);e[0]&&$.datepicker._selectDay(a.target,b.selectedMonth,b.selectedYear,e[0]);var f=$.datepicker._get(b,"onSelect");if(f){var g=$.datepicker._formatDate(b);f.apply(b.input?b.input[0]:null,[g,b])}else $.datepicker._hideDatepicker();return!1;case 27:$.datepicker._hideDatepicker();break;case 33:$.datepicker._adjustDate(a.target,a.ctrlKey?-$.datepicker._get(b,"stepBigMonths"):-$.datepicker._get(b,"stepMonths"),"M");break;case 34:$.datepicker._adjustDate(a.target,a.ctrlKey?+$.datepicker._get(b,"stepBigMonths"):+$.datepicker._get(b,"stepMonths"),"M");break;case 35:(a.ctrlKey||a.metaKey)&&$.datepicker._clearDate(a.target),c=a.ctrlKey||a.metaKey;break;case 36:(a.ctrlKey||a.metaKey)&&$.datepicker._gotoToday(a.target),c=a.ctrlKey||a.metaKey;break;case 37:(a.ctrlKey||a.metaKey)&&$.datepicker._adjustDate(a.target,d?1:-1,"D"),c=a.ctrlKey||a.metaKey,a.originalEvent.altKey&&$.datepicker._adjustDate(a.target,a.ctrlKey?-$.datepicker._get(b,"stepBigMonths"):-$.datepicker._get(b,"stepMonths"),"M");break;case 38:(a.ctrlKey||a.metaKey)&&$.datepicker._adjustDate(a.target,-7,"D"),c=a.ctrlKey||a.metaKey;break;case 39:(a.ctrlKey||a.metaKey)&&$.datepicker._adjustDate(a.target,d?-1:1,"D"),c=a.ctrlKey||a.metaKey,a.originalEvent.altKey&&$.datepicker._adjustDate(a.target,a.ctrlKey?+$.datepicker._get(b,"stepBigMonths"):+$.datepicker._get(b,"stepMonths"),"M");break;case 40:(a.ctrlKey||a.metaKey)&&$.datepicker._adjustDate(a.target,7,"D"),c=a.ctrlKey||a.metaKey;break;default:c=!1}else a.keyCode==36&&a.ctrlKey?$.datepicker._showDatepicker(this):c=!1;c&&(a.preventDefault(),a.stopPropagation())},_doKeyPress:function(a){var b=$.datepicker._getInst(a.target);if($.datepicker._get(b,"constrainInput")){var c=$.datepicker._possibleChars($.datepicker._get(b,"dateFormat")),d=String.fromCharCode(a.charCode==undefined?a.keyCode:a.charCode);return a.ctrlKey||a.metaKey||d<" "||!c||c.indexOf(d)>-1}},_doKeyUp:function(a){var b=$.datepicker._getInst(a.target);if(b.input.val()!=b.lastVal)try{var c=$.datepicker.parseDate($.datepicker._get(b,"dateFormat"),b.input?b.input.val():null,$.datepicker._getFormatConfig(b));c&&($.datepicker._setDateFromField(b),$.datepicker._updateAlternate(b),$.datepicker._updateDatepicker(b))}catch(a){$.datepicker.log(a)}return!0},_showDatepicker:function(a){a=a.target||a,a.nodeName.toLowerCase()!="input"&&(a=$("input",a.parentNode)[0]);if(!$.datepicker._isDisabledDatepicker(a)&&$.datepicker._lastInput!=a){var b=$.datepicker._getInst(a);$.datepicker._curInst&&$.datepicker._curInst!=b&&($.datepicker._curInst.dpDiv.stop(!0,!0),b&&$.datepicker._datepickerShowing&&$.datepicker._hideDatepicker($.datepicker._curInst.input[0]));var c=$.datepicker._get(b,"beforeShow"),d=c?c.apply(a,[a,b]):{};if(d===!1)return;extendRemove(b.settings,d),b.lastVal=null,$.datepicker._lastInput=a,$.datepicker._setDateFromField(b),$.datepicker._inDialog&&(a.value=""),$.datepicker._pos||($.datepicker._pos=$.datepicker._findPos(a),$.datepicker._pos[1]+=a.offsetHeight);var e=!1;$(a).parents().each(function(){e|=$(this).css("position")=="fixed";return!e}),e&&$.browser.opera&&($.datepicker._pos[0]-=document.documentElement.scrollLeft,$.datepicker._pos[1]-=document.documentElement.scrollTop);var f={left:$.datepicker._pos[0],top:$.datepicker._pos[1]};$.datepicker._pos=null,b.dpDiv.empty(),b.dpDiv.css({position:"absolute",display:"block",top:"-1000px"}),$.datepicker._updateDatepicker(b),f=$.datepicker._checkOffset(b,f,e),b.dpDiv.css({position:$.datepicker._inDialog&&$.blockUI?"static":e?"fixed":"absolute",display:"none",left:f.left+"px",top:f.top+"px"});if(!b.inline){var g=$.datepicker._get(b,"showAnim"),h=$.datepicker._get(b,"duration"),i=function(){var a=b.dpDiv.find("iframe.ui-datepicker-cover");if(!!a.length){var c=$.datepicker._getBorders(b.dpDiv);a.css({left:-c[0],top:-c[1],width:b.dpDiv.outerWidth(),height:b.dpDiv.outerHeight()})}};b.dpDiv.zIndex($(a).zIndex()+1),$.datepicker._datepickerShowing=!0,$.effects&&$.effects[g]?b.dpDiv.show(g,$.datepicker._get(b,"showOptions"),h,i):b.dpDiv[g||"show"](g?h:null,i),(!g||!h)&&i(),b.input.is(":visible")&&!b.input.is(":disabled")&&b.input.focus(),$.datepicker._curInst=b}}},_updateDatepicker:function(a){var b=this;b.maxRows=4;var c=$.datepicker._getBorders(a.dpDiv);instActive=a,a.dpDiv.empty().append(this._generateHTML(a));var d=a.dpDiv.find("iframe.ui-datepicker-cover");!d.length||d.css({left:-c[0],top:-c[1],width:a.dpDiv.outerWidth(),height:a.dpDiv.outerHeight()}),a.dpDiv.find("."+this._dayOverClass+" a").mouseover();var e=this._getNumberOfMonths(a),f=e[1],g=17;a.dpDiv.removeClass("ui-datepicker-multi-2 ui-datepicker-multi-3 ui-datepicker-multi-4").width(""),f>1&&a.dpDiv.addClass("ui-datepicker-multi-"+f).css("width",g*f+"em"),a.dpDiv[(e[0]!=1||e[1]!=1?"add":"remove")+"Class"]("ui-datepicker-multi"),a.dpDiv[(this._get(a,"isRTL")?"add":"remove")+"Class"]("ui-datepicker-rtl"),a==$.datepicker._curInst&&$.datepicker._datepickerShowing&&a.input&&a.input.is(":visible")&&!a.input.is(":disabled")&&a.input[0]!=document.activeElement&&a.input.focus();if(a.yearshtml){var h=a.yearshtml;setTimeout(function(){h===a.yearshtml&&a.yearshtml&&a.dpDiv.find("select.ui-datepicker-year:first").replaceWith(a.yearshtml),h=a.yearshtml=null},0)}},_getBorders:function(a){var b=function(a){return{thin:1,medium:2,thick:3}[a]||a};return[parseFloat(b(a.css("border-left-width"))),parseFloat(b(a.css("border-top-width")))]},_checkOffset:function(a,b,c){var d=a.dpDiv.outerWidth(),e=a.dpDiv.outerHeight(),f=a.input?a.input.outerWidth():0,g=a.input?a.input.outerHeight():0,h=document.documentElement.clientWidth+$(document).scrollLeft(),i=document.documentElement.clientHeight+$(document).scrollTop();b.left-=this._get(a,"isRTL")?d-f:0,b.left-=c&&b.left==a.input.offset().left?$(document).scrollLeft():0,b.top-=c&&b.top==a.input.offset().top+g?$(document).scrollTop():0,b.left-=Math.min(b.left,b.left+d>h&&h>d?Math.abs(b.left+d-h):0),b.top-=Math.min(b.top,b.top+e>i&&i>e?Math.abs(e+g):0);return b},_findPos:function(a){var b=this._getInst(a),c=this._get(b,"isRTL");while(a&&(a.type=="hidden"||a.nodeType!=1||$.expr.filters.hidden(a)))a=a[c?"previousSibling":"nextSibling"];var d=$(a).offset();return[d.left,d.top]},_hideDatepicker:function(a){var b=this._curInst;if(!(!b||a&&b!=$.data(a,PROP_NAME))&&this._datepickerShowing){var c=this._get(b,"showAnim"),d=this._get(b,"duration"),e=this,f=function(){$.datepicker._tidyDialog(b),e._curInst=null};$.effects&&$.effects[c]?b.dpDiv.hide(c,$.datepicker._get(b,"showOptions"),d,f):b.dpDiv[c=="slideDown"?"slideUp":c=="fadeIn"?"fadeOut":"hide"](c?d:null,f),c||f(),this._datepickerShowing=!1;var g=this._get(b,"onClose");g&&g.apply(b.input?b.input[0]:null,[b.input?b.input.val():"",b]),this._lastInput=null,this._inDialog&&(this._dialogInput.css({position:"absolute",left:"0",top:"-100px"}),$.blockUI&&($.unblockUI(),$("body").append(this.dpDiv))),this._inDialog=!1}},_tidyDialog:function(a){a.dpDiv.removeClass(this._dialogClass).unbind(".ui-datepicker-calendar")},_checkExternalClick:function(a){if(!!$.datepicker._curInst){var b=$(a.target),c=$.datepicker._getInst(b[0]);(b[0].id!=$.datepicker._mainDivId&&b.parents("#"+$.datepicker._mainDivId).length==0&&!b.hasClass($.datepicker.markerClassName)&&!b.closest("."+$.datepicker._triggerClass).length&&$.datepicker._datepickerShowing&&(!$.datepicker._inDialog||!$.blockUI)||b.hasClass($.datepicker.markerClassName)&&$.datepicker._curInst!=c)&&$.datepicker._hideDatepicker()}},_adjustDate:function(a,b,c){var d=$(a),e=this._getInst(d[0]);this._isDisabledDatepicker(d[0])||(this._adjustInstDate(e,b+(c=="M"?this._get(e,"showCurrentAtPos"):0),c),this._updateDatepicker(e))},_gotoToday:function(a){var b=$(a),c=this._getInst(b[0]);if(this._get(c,"gotoCurrent")&&c.currentDay)c.selectedDay=c.currentDay,c.drawMonth=c.selectedMonth=c.currentMonth,c.drawYear=c.selectedYear=c.currentYear;else{var d=new Date;c.selectedDay=d.getDate(),c.drawMonth=c.selectedMonth=d.getMonth(),c.drawYear=c.selectedYear=d.getFullYear()}this._notifyChange(c),this._adjustDate(b)},_selectMonthYear:function(a,b,c){var d=$(a),e=this._getInst(d[0]);e["selected"+(c=="M"?"Month":"Year")]=e["draw"+(c=="M"?"Month":"Year")]=parseInt(b.options[b.selectedIndex].value,10),this._notifyChange(e),this._adjustDate(d)},_selectDay:function(a,b,c,d){var e=$(a);if(!$(d).hasClass(this._unselectableClass)&&!this._isDisabledDatepicker(e[0])){var f=this._getInst(e[0]);f.selectedDay=f.currentDay=$("a",d).html(),f.selectedMonth=f.currentMonth=b,f.selectedYear=f.currentYear=c,this._selectDate(a,this._formatDate(f,f.currentDay,f.currentMonth,f.currentYear))}},_clearDate:function(a){var b=$(a),c=this._getInst(b[0]);this._selectDate(b,"")},_selectDate:function(a,b){var c=$(a),d=this._getInst(c[0]);b=b!=null?b:this._formatDate(d),d.input&&d.input.val(b),this._updateAlternate(d);var e=this._get(d,"onSelect");e?e.apply(d.input?d.input[0]:null,[b,d]):d.input&&d.input.trigger("change"),d.inline?this._updateDatepicker(d):(this._hideDatepicker(),this._lastInput=d.input[0],typeof d.input[0]!="object"&&d.input.focus(),this._lastInput=null)},_updateAlternate:function(a){var b=this._get(a,"altField");if(b){var c=this._get(a,"altFormat")||this._get(a,"dateFormat"),d=this._getDate(a),e=this.formatDate(c,d,this._getFormatConfig(a));$(b).each(function(){$(this).val(e)})}},noWeekends:function(a){var b=a.getDay();return[b>0&&b<6,""]},iso8601Week:function(a){var b=new Date(a.getTime());b.setDate(b.getDate()+4-(b.getDay()||7));var c=b.getTime();b.setMonth(0),b.setDate(1);return Math.floor(Math.round((c-b)/864e5)/7)+1},parseDate:function(a,b,c){if(a==null||b==null)throw"Invalid arguments";b=typeof b=="object"?b.toString():b+"";if(b=="")return null;var d=(c?c.shortYearCutoff:null)||this._defaults.shortYearCutoff;d=typeof d!="string"?d:(new Date).getFullYear()%100+parseInt(d,10);var e=(c?c.dayNamesShort:null)||this._defaults.dayNamesShort,f=(c?c.dayNames:null)||this._defaults.dayNames,g=(c?c.monthNamesShort:null)||this._defaults.monthNamesShort,h=(c?c.monthNames:null)||this._defaults.monthNames,i=-1,j=-1,k=-1,l=-1,m=!1,n=function(b){var c=s+1<a.length&&a.charAt(s+1)==b;c&&s++;return c},o=function(a){var c=n(a),d=a=="@"?14:a=="!"?20:a=="y"&&c?4:a=="o"?3:2,e=new RegExp("^\\d{1,"+d+"}"),f=b.substring(r).match(e);if(!f)throw"Missing number at position "+r;r+=f[0].length;return parseInt(f[0],10)},p=function(a,c,d){var e=$.map(n(a)?d:c,function(a,b){return[[b,a]]}).sort(function(a,b){return-(a[1].length-b[1].length)}),f=-1;$.each(e,function(a,c){var d=c[1];if(b.substr(r,d.length).toLowerCase()==d.toLowerCase()){f=c[0],r+=d.length;return!1}});if(f!=-1)return f+1;throw"Unknown name at position "+r},q=function(){if(b.charAt(r)!=a.charAt(s))throw"Unexpected literal at position "+r;r++},r=0;for(var s=0;s<a.length;s++)if(m)a.charAt(s)=="'"&&!n("'")?m=!1:q();else switch(a.charAt(s)){case"d":k=o("d");break;case"D":p("D",e,f);break;case"o":l=o("o");break;case"m":j=o("m");break;case"M":j=p("M",g,h);break;case"y":i=o("y");break;case"@":var t=new Date(o("@"));i=t.getFullYear(),j=t.getMonth()+1,k=t.getDate();break;case"!":var t=new Date((o("!")-this._ticksTo1970)/1e4);i=t.getFullYear(),j=t.getMonth()+1,k=t.getDate();break;case"'":n("'")?q():m=!0;break;default:q()}if(r<b.length)throw"Extra/unparsed characters found in date: "+b.substring(r);i==-1?i=(new Date).getFullYear():i<100&&(i+=(new Date).getFullYear()-(new Date).getFullYear()%100+(i<=d?0:-100));if(l>-1){j=1,k=l;for(;;){var u=this._getDaysInMonth(i,j-1);if(k<=u)break;j++,k-=u}}var t=this._daylightSavingAdjust(new Date(i,j-1,k));if(t.getFullYear()!=i||t.getMonth()+1!=j||t.getDate()!=k)throw"Invalid date";return t},ATOM:"yy-mm-dd",COOKIE:"D, dd M yy",ISO_8601:"yy-mm-dd",RFC_822:"D, d M y",RFC_850:"DD, dd-M-y",RFC_1036:"D, d M y",RFC_1123:"D, d M yy",RFC_2822:"D, d M yy",RSS:"D, d M y",TICKS:"!",TIMESTAMP:"@",W3C:"yy-mm-dd",_ticksTo1970:(718685+Math.floor(492.5)-Math.floor(19.7)+Math.floor(4.925))*24*60*60*1e7,formatDate:function(a,b,c){if(!b)return"";var d=(c?c.dayNamesShort:null)||this._defaults.dayNamesShort,e=(c?c.dayNames:null)||this._defaults.dayNames,f=(c?c.monthNamesShort:null)||this._defaults.monthNamesShort,g=(c?c.monthNames:null)||this._defaults.monthNames,h=function(b){var c=m+1<a.length&&a.charAt(m+1)==b;c&&m++;return c},i=function(a,b,c){var d=""+b;if(h(a))while(d.length<c)d="0"+d;return d},j=function(a,b,c,d){return h(a)?d[b]:c[b]},k="",l=!1;if(b)for(var m=0;m<a.length;m++)if(l)a.charAt(m)=="'"&&!h("'")?l=!1:k+=a.charAt(m);else switch(a.charAt(m)){case"d":k+=i("d",b.getDate(),2);break;case"D":k+=j("D",b.getDay(),d,e);break;case"o":k+=i("o",Math.round(((new Date(b.getFullYear(),b.getMonth(),b.getDate())).getTime()-(new Date(b.getFullYear(),0,0)).getTime())/864e5),3);break;case"m":k+=i("m",b.getMonth()+1,2);break;case"M":k+=j("M",b.getMonth(),f,g);break;case"y":k+=h("y")?b.getFullYear():(b.getYear()%100<10?"0":"")+b.getYear()%100;break;case"@":k+=b.getTime();break;case"!":k+=b.getTime()*1e4+this._ticksTo1970;break;case"'":h("'")?k+="'":l=!0;break;default:k+=a.charAt(m)}return k},_possibleChars:function(a){var b="",c=!1,d=function(b){var c=e+1<a.length&&a.charAt(e+1)==b;c&&e++;return c};for(var e=0;e<a.length;e++)if(c)a.charAt(e)=="'"&&!d("'")?c=!1:b+=a.charAt(e);else switch(a.charAt(e)){case"d":case"m":case"y":case"@":b+="0123456789";break;case"D":case"M":return null;case"'":d("'")?b+="'":c=!0;break;default:b+=a.charAt(e)}return b},_get:function(a,b){return a.settings[b]!==undefined?a.settings[b]:this._defaults[b]},_setDateFromField:function(a,b){if(a.input.val()!=a.lastVal){var c=this._get(a,"dateFormat"),d=a.lastVal=a.input?a.input.val():null,e,f;e=f=this._getDefaultDate(a);var g=this._getFormatConfig(a);try{e=this.parseDate(c,d,g)||f}catch(h){this.log(h),d=b?"":d}a.selectedDay=e.getDate(),a.drawMonth=a.selectedMonth=e.getMonth(),a.drawYear=a.selectedYear=e.getFullYear(),a.currentDay=d?e.getDate():0,a.currentMonth=d?e.getMonth():0,a.currentYear=d?e.getFullYear():0,this._adjustInstDate(a)}},_getDefaultDate:function(a){return this._restrictMinMax(a,this._determineDate(a,this._get(a,"defaultDate"),new Date))},_determineDate:function(a,b,c){var d=function(a){var b=new Date;b.setDate(b.getDate()+a);return b},e=function(b){try{return $.datepicker.parseDate($.datepicker._get(a,"dateFormat"),b,$.datepicker._getFormatConfig(a))}catch(c){}var d=(b.toLowerCase().match(/^c/)?$.datepicker._getDate(a):null)||new Date,e=d.getFullYear(),f=d.getMonth(),g=d.getDate(),h=/([+-]?[0-9]+)\s*(d|D|w|W|m|M|y|Y)?/g,i=h.exec(b);while(i){switch(i[2]||"d"){case"d":case"D":g+=parseInt(i[1],10);break;case"w":case"W":g+=parseInt(i[1],10)*7;break;case"m":case"M":f+=parseInt(i[1],10),g=Math.min(g,$.datepicker._getDaysInMonth(e,f));break;case"y":case"Y":e+=parseInt(i[1],10),g=Math.min(g,$.datepicker._getDaysInMonth(e,f))}i=h.exec(b)}return new Date(e,f,g)},f=b==null||b===""?c:typeof b=="string"?e(b):typeof b=="number"?isNaN(b)?c:d(b):new Date(b.getTime());f=f&&f.toString()=="Invalid Date"?c:f,f&&(f.setHours(0),f.setMinutes(0),f.setSeconds(0),f.setMilliseconds(0));return this._daylightSavingAdjust(f)},_daylightSavingAdjust:function(a){if(!a)return null;a.setHours(a.getHours()>12?a.getHours()+2:0);return a},_setDate:function(a,b,c){var d=!b,e=a.selectedMonth,f=a.selectedYear,g=this._restrictMinMax(a,this._determineDate(a,b,new Date));a.selectedDay=a.currentDay=g.getDate(),a.drawMonth=a.selectedMonth=a.currentMonth=g.getMonth(),a.drawYear=a.selectedYear=a.currentYear=g.getFullYear(),(e!=a.selectedMonth||f!=a.selectedYear)&&!c&&this._notifyChange(a),this._adjustInstDate(a),a.input&&a.input.val(d?"":this._formatDate(a))},_getDate:function(a){var b=!a.currentYear||a.input&&a.input.val()==""?null:this._daylightSavingAdjust(new Date(a.currentYear,a.currentMonth,a.currentDay));return b},_generateHTML:function(a){var b=new Date;b=this._daylightSavingAdjust(new Date(b.getFullYear(),b.getMonth(),b.getDate()));var c=this._get(a,"isRTL"),d=this._get(a,"showButtonPanel"),e=this._get(a,"hideIfNoPrevNext"),f=this._get(a,"navigationAsDateFormat"),g=this._getNumberOfMonths(a),h=this._get(a,"showCurrentAtPos"),i=this._get(a,"stepMonths"),j=g[0]!=1||g[1]!=1,k=this._daylightSavingAdjust(a.currentDay?new Date(a.currentYear,a.currentMonth,a.currentDay):new Date(9999,9,9)),l=this._getMinMaxDate(a,"min"),m=this._getMinMaxDate(a,"max"),n=a.drawMonth-h,o=a.drawYear;n<0&&(n+=12,o--);if(m){var p=this._daylightSavingAdjust(new Date(m.getFullYear(),m.getMonth()-g[0]*g[1]+1,m.getDate()));p=l&&p<l?l:p;while(this._daylightSavingAdjust(new Date(o,n,1))>p)n--,n<0&&(n=11,o--)}a.drawMonth=n,a.drawYear=o;var q=this._get(a,"prevText");q=f?this.formatDate(q,this._daylightSavingAdjust(new Date(o,n-i,1)),this._getFormatConfig(a)):q;var r=this._canAdjustMonth(a,-1,o,n)?'<a class="ui-datepicker-prev ui-corner-all" onclick="DP_jQuery_'+dpuuid+".datepicker._adjustDate('#"+a.id+"', -"+i+", 'M');\""+' title="'+q+'"><span class="ui-icon ui-icon-circle-triangle-'+(c?"e":"w")+'">'+q+"</span></a>":e?"":'<a class="ui-datepicker-prev ui-corner-all ui-state-disabled" title="'+q+'"><span class="ui-icon ui-icon-circle-triangle-'+(c?"e":"w")+'">'+q+"</span></a>",s=this._get(a,"nextText");s=f?this.formatDate(s,this._daylightSavingAdjust(new Date(o,n+i,1)),this._getFormatConfig(a)):s;var t=this._canAdjustMonth(a,1,o,n)?'<a class="ui-datepicker-next ui-corner-all" onclick="DP_jQuery_'+dpuuid+".datepicker._adjustDate('#"+a.id+"', +"+i+", 'M');\""+' title="'+s+'"><span class="ui-icon ui-icon-circle-triangle-'+(c?"w":"e")+'">'+s+"</span></a>":e?"":'<a class="ui-datepicker-next ui-corner-all ui-state-disabled" title="'+s+'"><span class="ui-icon ui-icon-circle-triangle-'+(c?"w":"e")+'">'+s+"</span></a>",u=this._get(a,"currentText"),v=this._get(a,"gotoCurrent")&&a.currentDay?k:b;u=f?this.formatDate(u,v,this._getFormatConfig(a)):u;var w=a.inline?"":'<button type="button" class="ui-datepicker-close ui-state-default ui-priority-primary ui-corner-all" onclick="DP_jQuery_'+dpuuid+'.datepicker._hideDatepicker();">'+this._get(a,"closeText")+"</button>",x=d?'<div class="ui-datepicker-buttonpane ui-widget-content">'+(c?w:"")+(this._isInRange(a,v)?'<button type="button" class="ui-datepicker-current ui-state-default ui-priority-secondary ui-corner-all" onclick="DP_jQuery_'+dpuuid+".datepicker._gotoToday('#"+a.id+"');\""+">"+u+"</button>":"")+(c?"":w)+"</div>":"",y=parseInt(this._get(a,"firstDay"),10);y=isNaN(y)?0:y;var z=this._get(a,"showWeek"),A=this._get(a,"dayNames"),B=this._get(a,"dayNamesShort"),C=this._get(a,"dayNamesMin"),D=this._get(a,"monthNames"),E=this._get(a,"monthNamesShort"),F=this._get(a,"beforeShowDay"),G=this._get(a,"showOtherMonths"),H=this._get(a,"selectOtherMonths"),I=this._get(a,"calculateWeek")||this.iso8601Week,J=this._getDefaultDate(a),K="";for(var L=0;L<g[0];L++){var M="";this.maxRows=4;for(var N=0;N<g[1];N++){var O=this._daylightSavingAdjust(new Date(o,n,a.selectedDay)),P=" ui-corner-all",Q="";if(j){Q+='<div class="ui-datepicker-group';if(g[1]>1)switch(N){case 0:Q+=" ui-datepicker-group-first",P=" ui-corner-"+(c?"right":"left");break;case g[1]-1:Q+=" ui-datepicker-group-last",P=" ui-corner-"+(c?"left":"right");break;default:Q+=" ui-datepicker-group-middle",P=""}Q+='">'}Q+='<div class="ui-datepicker-header ui-widget-header ui-helper-clearfix'+P+'">'+(/all|left/.test(P)&&L==0?c?t:r:"")+(/all|right/.test(P)&&L==0?c?r:t:"")+this._generateMonthYearHeader(a,n,o,l,m,L>0||N>0,D,E)+'</div><table class="ui-datepicker-calendar"><thead>'+"<tr>";var R=z?'<th class="ui-datepicker-week-col">'+this._get(a,"weekHeader")+"</th>":"";for(var S=0;S<7;S++){var T=(S+y)%7;R+="<th"+((S+y+6)%7>=5?' class="ui-datepicker-week-end"':"")+">"+'<span title="'+A[T]+'">'+C[T]+"</span></th>"}Q+=R+"</tr></thead><tbody>";var U=this._getDaysInMonth(o,n);o==a.selectedYear&&n==a.selectedMonth&&(a.selectedDay=Math.min(a.selectedDay,U));var V=(this._getFirstDayOfMonth(o,n)-y+7)%7,W=Math.ceil((V+U)/7),X=j?this.maxRows>W?this.maxRows:W:W;this.maxRows=X;var Y=this._daylightSavingAdjust(new Date(o,n,1-V));for(var Z=0;Z<X;Z++){Q+="<tr>";var _=z?'<td class="ui-datepicker-week-col">'+this._get(a,"calculateWeek")(Y)+"</td>":"";for(var S=0;S<7;S++){var ba=F?F.apply(a.input?a.input[0]:null,[Y]):[!0,""],bb=Y.getMonth()!=n,bc=bb&&!H||!ba[0]||l&&Y<l||m&&Y>m;_+='<td class="'+((S+y+6)%7>=5?" ui-datepicker-week-end":"")+(bb?" ui-datepicker-other-month":"")+(Y.getTime()==O.getTime()&&n==a.selectedMonth&&a._keyEvent||J.getTime()==Y.getTime()&&J.getTime()==O.getTime()?" "+this._dayOverClass:"")+(bc?" "+this._unselectableClass+" ui-state-disabled":"")+(bb&&!G?"":" "+ba[1]+(Y.getTime()==k.getTime()?" "+this._currentClass:"")+(Y.getTime()==b.getTime()?" ui-datepicker-today":""))+'"'+((!bb||G)&&ba[2]?' title="'+ba[2]+'"':"")+(bc?"":' onclick="DP_jQuery_'+dpuuid+".datepicker._selectDay('#"+a.id+"',"+Y.getMonth()+","+Y.getFullYear()+', this);return false;"')+">"+(bb&&!G?" ":bc?'<span class="ui-state-default">'+Y.getDate()+"</span>":'<a class="ui-state-default'+(Y.getTime()==b.getTime()?" ui-state-highlight":"")+(Y.getTime()==k.getTime()?" ui-state-active":"")+(bb?" ui-priority-secondary":"")+'" href="#">'+Y.getDate()+"</a>")+"</td>",Y.setDate(Y.getDate()+1),Y=this._daylightSavingAdjust(Y)}Q+=_+"</tr>"}n++,n>11&&(n=0,o++),Q+="</tbody></table>"+(j?"</div>"+(g[0]>0&&N==g[1]-1?'<div class="ui-datepicker-row-break"></div>':""):""),M+=Q}K+=M}K+=x+($.browser.msie&&parseInt($.browser.version,10)<7&&!a.inline?'<iframe src="javascript:false;" class="ui-datepicker-cover" frameborder="0"></iframe>':""), |
| | | a._keyEvent=!1;return K},_generateMonthYearHeader:function(a,b,c,d,e,f,g,h){var i=this._get(a,"changeMonth"),j=this._get(a,"changeYear"),k=this._get(a,"showMonthAfterYear"),l='<div class="ui-datepicker-title">',m="";if(f||!i)m+='<span class="ui-datepicker-month">'+g[b]+"</span>";else{var n=d&&d.getFullYear()==c,o=e&&e.getFullYear()==c;m+='<select class="ui-datepicker-month" onchange="DP_jQuery_'+dpuuid+".datepicker._selectMonthYear('#"+a.id+"', this, 'M');\" "+">";for(var p=0;p<12;p++)(!n||p>=d.getMonth())&&(!o||p<=e.getMonth())&&(m+='<option value="'+p+'"'+(p==b?' selected="selected"':"")+">"+h[p]+"</option>");m+="</select>"}k||(l+=m+(f||!i||!j?" ":""));if(!a.yearshtml){a.yearshtml="";if(f||!j)l+='<span class="ui-datepicker-year">'+c+"</span>";else{var q=this._get(a,"yearRange").split(":"),r=(new Date).getFullYear(),s=function(a){var b=a.match(/c[+-].*/)?c+parseInt(a.substring(1),10):a.match(/[+-].*/)?r+parseInt(a,10):parseInt(a,10);return isNaN(b)?r:b},t=s(q[0]),u=Math.max(t,s(q[1]||""));t=d?Math.max(t,d.getFullYear()):t,u=e?Math.min(u,e.getFullYear()):u,a.yearshtml+='<select class="ui-datepicker-year" onchange="DP_jQuery_'+dpuuid+".datepicker._selectMonthYear('#"+a.id+"', this, 'Y');\" "+">";for(;t<=u;t++)a.yearshtml+='<option value="'+t+'"'+(t==c?' selected="selected"':"")+">"+t+"</option>";a.yearshtml+="</select>",l+=a.yearshtml,a.yearshtml=null}}l+=this._get(a,"yearSuffix"),k&&(l+=(f||!i||!j?" ":"")+m),l+="</div>";return l},_adjustInstDate:function(a,b,c){var d=a.drawYear+(c=="Y"?b:0),e=a.drawMonth+(c=="M"?b:0),f=Math.min(a.selectedDay,this._getDaysInMonth(d,e))+(c=="D"?b:0),g=this._restrictMinMax(a,this._daylightSavingAdjust(new Date(d,e,f)));a.selectedDay=g.getDate(),a.drawMonth=a.selectedMonth=g.getMonth(),a.drawYear=a.selectedYear=g.getFullYear(),(c=="M"||c=="Y")&&this._notifyChange(a)},_restrictMinMax:function(a,b){var c=this._getMinMaxDate(a,"min"),d=this._getMinMaxDate(a,"max"),e=c&&b<c?c:b;e=d&&e>d?d:e;return e},_notifyChange:function(a){var b=this._get(a,"onChangeMonthYear");b&&b.apply(a.input?a.input[0]:null,[a.selectedYear,a.selectedMonth+1,a])},_getNumberOfMonths:function(a){var b=this._get(a,"numberOfMonths");return b==null?[1,1]:typeof b=="number"?[1,b]:b},_getMinMaxDate:function(a,b){return this._determineDate(a,this._get(a,b+"Date"),null)},_getDaysInMonth:function(a,b){return 32-this._daylightSavingAdjust(new Date(a,b,32)).getDate()},_getFirstDayOfMonth:function(a,b){return(new Date(a,b,1)).getDay()},_canAdjustMonth:function(a,b,c,d){var e=this._getNumberOfMonths(a),f=this._daylightSavingAdjust(new Date(c,d+(b<0?b:e[0]*e[1]),1));b<0&&f.setDate(this._getDaysInMonth(f.getFullYear(),f.getMonth()));return this._isInRange(a,f)},_isInRange:function(a,b){var c=this._getMinMaxDate(a,"min"),d=this._getMinMaxDate(a,"max");return(!c||b.getTime()>=c.getTime())&&(!d||b.getTime()<=d.getTime())},_getFormatConfig:function(a){var b=this._get(a,"shortYearCutoff");b=typeof b!="string"?b:(new Date).getFullYear()%100+parseInt(b,10);return{shortYearCutoff:b,dayNamesShort:this._get(a,"dayNamesShort"),dayNames:this._get(a,"dayNames"),monthNamesShort:this._get(a,"monthNamesShort"),monthNames:this._get(a,"monthNames")}},_formatDate:function(a,b,c,d){b||(a.currentDay=a.selectedDay,a.currentMonth=a.selectedMonth,a.currentYear=a.selectedYear);var e=b?typeof b=="object"?b:this._daylightSavingAdjust(new Date(d,c,b)):this._daylightSavingAdjust(new Date(a.currentYear,a.currentMonth,a.currentDay));return this.formatDate(this._get(a,"dateFormat"),e,this._getFormatConfig(a))}}),$.fn.datepicker=function(a){if(!this.length)return this;$.datepicker.initialized||($(document).mousedown($.datepicker._checkExternalClick).find("body").append($.datepicker.dpDiv),$.datepicker.initialized=!0);var b=Array.prototype.slice.call(arguments,1);if(typeof a=="string"&&(a=="isDisabled"||a=="getDate"||a=="widget"))return $.datepicker["_"+a+"Datepicker"].apply($.datepicker,[this[0]].concat(b));if(a=="option"&&arguments.length==2&&typeof arguments[1]=="string")return $.datepicker["_"+a+"Datepicker"].apply($.datepicker,[this[0]].concat(b));return this.each(function(){typeof a=="string"?$.datepicker["_"+a+"Datepicker"].apply($.datepicker,[this].concat(b)):$.datepicker._attachDatepicker(this,a)})},$.datepicker=new Datepicker,$.datepicker.initialized=!1,$.datepicker.uuid=(new Date).getTime(),$.datepicker.version="1.8.18",window["DP_jQuery_"+dpuuid]=$})(jQuery);/* |
| | | * jQuery UI Progressbar 1.8.18 |
| | | * |
| | | * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) |
| | | * Dual licensed under the MIT or GPL Version 2 licenses. |
| | | * http://jquery.org/license |
| | | * |
| | | * http://docs.jquery.com/UI/Progressbar |
| | | * |
| | | * Depends: |
| | | * jquery.ui.core.js |
| | | * jquery.ui.widget.js |
| | | */(function(a,b){a.widget("ui.progressbar",{options:{value:0,max:100},min:0,_create:function(){this.element.addClass("ui-progressbar ui-widget ui-widget-content ui-corner-all").attr({role:"progressbar","aria-valuemin":this.min,"aria-valuemax":this.options.max,"aria-valuenow":this._value()}),this.valueDiv=a("<div class='ui-progressbar-value ui-widget-header ui-corner-left'></div>").appendTo(this.element),this.oldValue=this._value(),this._refreshValue()},destroy:function(){this.element.removeClass("ui-progressbar ui-widget ui-widget-content ui-corner-all").removeAttr("role").removeAttr("aria-valuemin").removeAttr("aria-valuemax").removeAttr("aria-valuenow"),this.valueDiv.remove(),a.Widget.prototype.destroy.apply(this,arguments)},value:function(a){if(a===b)return this._value();this._setOption("value",a);return this},_setOption:function(b,c){b==="value"&&(this.options.value=c,this._refreshValue(),this._value()===this.options.max&&this._trigger("complete")),a.Widget.prototype._setOption.apply(this,arguments)},_value:function(){var a=this.options.value;typeof a!="number"&&(a=0);return Math.min(this.options.max,Math.max(this.min,a))},_percentage:function(){return 100*this._value()/this.options.max},_refreshValue:function(){var a=this.value(),b=this._percentage();this.oldValue!==a&&(this.oldValue=a,this._trigger("change")),this.valueDiv.toggle(a>this.min).toggleClass("ui-corner-right",a===this.options.max).width(b.toFixed(0)+"%"),this.element.attr("aria-valuenow",a)}}),a.extend(a.ui.progressbar,{version:"1.8.18"})})(jQuery);/* |
| | | * jQuery UI Effects 1.8.18 |
| | | * |
| | | * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) |
| | | * Dual licensed under the MIT or GPL Version 2 licenses. |
| | | * http://jquery.org/license |
| | | * |
| | | * http://docs.jquery.com/UI/Effects/ |
| | | */jQuery.effects||function(a,b){function l(b){if(!b||typeof b=="number"||a.fx.speeds[b])return!0;if(typeof b=="string"&&!a.effects[b])return!0;return!1}function k(b,c,d,e){typeof b=="object"&&(e=c,d=null,c=b,b=c.effect),a.isFunction(c)&&(e=c,d=null,c={});if(typeof c=="number"||a.fx.speeds[c])e=d,d=c,c={};a.isFunction(d)&&(e=d,d=null),c=c||{},d=d||c.duration,d=a.fx.off?0:typeof d=="number"?d:d in a.fx.speeds?a.fx.speeds[d]:a.fx.speeds._default,e=e||c.complete;return[b,c,d,e]}function j(a,b){var c={_:0},d;for(d in b)a[d]!=b[d]&&(c[d]=b[d]);return c}function i(b){var c,d;for(c in b)d=b[c],(d==null||a.isFunction(d)||c in g||/scrollbar/.test(c)||!/color/i.test(c)&&isNaN(parseFloat(d)))&&delete b[c];return b}function h(){var a=document.defaultView?document.defaultView.getComputedStyle(this,null):this.currentStyle,b={},c,d;if(a&&a.length&&a[0]&&a[a[0]]){var e=a.length;while(e--)c=a[e],typeof a[c]=="string"&&(d=c.replace(/\-(\w)/g,function(a,b){return b.toUpperCase()}),b[d]=a[c])}else for(c in a)typeof a[c]=="string"&&(b[c]=a[c]);return b}function d(b,d){var e;do{e=a.curCSS(b,d);if(e!=""&&e!="transparent"||a.nodeName(b,"body"))break;d="backgroundColor"}while(b=b.parentNode);return c(e)}function c(b){var c;if(b&&b.constructor==Array&&b.length==3)return b;if(c=/rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/.exec(b))return[parseInt(c[1],10),parseInt(c[2],10),parseInt(c[3],10)];if(c=/rgb\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*\)/.exec(b))return[parseFloat(c[1])*2.55,parseFloat(c[2])*2.55,parseFloat(c[3])*2.55];if(c=/#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(b))return[parseInt(c[1],16),parseInt(c[2],16),parseInt(c[3],16)];if(c=/#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/.exec(b))return[parseInt(c[1]+c[1],16),parseInt(c[2]+c[2],16),parseInt(c[3]+c[3],16)];if(c=/rgba\(0, 0, 0, 0\)/.exec(b))return e.transparent;return e[a.trim(b).toLowerCase()]}a.effects={},a.each(["backgroundColor","borderBottomColor","borderLeftColor","borderRightColor","borderTopColor","borderColor","color","outlineColor"],function(b,e){a.fx.step[e]=function(a){a.colorInit||(a.start=d(a.elem,e),a.end=c(a.end),a.colorInit=!0),a.elem.style[e]="rgb("+Math.max(Math.min(parseInt(a.pos*(a.end[0]-a.start[0])+a.start[0],10),255),0)+","+Math.max(Math.min(parseInt(a.pos*(a.end[1]-a.start[1])+a.start[1],10),255),0)+","+Math.max(Math.min(parseInt(a.pos*(a.end[2]-a.start[2])+a.start[2],10),255),0)+")"}});var e={aqua:[0,255,255],azure:[240,255,255],beige:[245,245,220],black:[0,0,0],blue:[0,0,255],brown:[165,42,42],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgrey:[169,169,169],darkgreen:[0,100,0],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkviolet:[148,0,211],fuchsia:[255,0,255],gold:[255,215,0],green:[0,128,0],indigo:[75,0,130],khaki:[240,230,140],lightblue:[173,216,230],lightcyan:[224,255,255],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightyellow:[255,255,224],lime:[0,255,0],magenta:[255,0,255],maroon:[128,0,0],navy:[0,0,128],olive:[128,128,0],orange:[255,165,0],pink:[255,192,203],purple:[128,0,128],violet:[128,0,128],red:[255,0,0],silver:[192,192,192],white:[255,255,255],yellow:[255,255,0],transparent:[255,255,255]},f=["add","remove","toggle"],g={border:1,borderBottom:1,borderColor:1,borderLeft:1,borderRight:1,borderTop:1,borderWidth:1,margin:1,padding:1};a.effects.animateClass=function(b,c,d,e){a.isFunction(d)&&(e=d,d=null);return this.queue(function(){var g=a(this),k=g.attr("style")||" ",l=i(h.call(this)),m,n=g.attr("class");a.each(f,function(a,c){b[c]&&g[c+"Class"](b[c])}),m=i(h.call(this)),g.attr("class",n),g.animate(j(l,m),{queue:!1,duration:c,easing:d,complete:function(){a.each(f,function(a,c){b[c]&&g[c+"Class"](b[c])}),typeof g.attr("style")=="object"?(g.attr("style").cssText="",g.attr("style").cssText=k):g.attr("style",k),e&&e.apply(this,arguments),a.dequeue(this)}})})},a.fn.extend({_addClass:a.fn.addClass,addClass:function(b,c,d,e){return c?a.effects.animateClass.apply(this,[{add:b},c,d,e]):this._addClass(b)},_removeClass:a.fn.removeClass,removeClass:function(b,c,d,e){return c?a.effects.animateClass.apply(this,[{remove:b},c,d,e]):this._removeClass(b)},_toggleClass:a.fn.toggleClass,toggleClass:function(c,d,e,f,g){return typeof d=="boolean"||d===b?e?a.effects.animateClass.apply(this,[d?{add:c}:{remove:c},e,f,g]):this._toggleClass(c,d):a.effects.animateClass.apply(this,[{toggle:c},d,e,f])},switchClass:function(b,c,d,e,f){return a.effects.animateClass.apply(this,[{add:c,remove:b},d,e,f])}}),a.extend(a.effects,{version:"1.8.18",save:function(a,b){for(var c=0;c<b.length;c++)b[c]!==null&&a.data("ec.storage."+b[c],a[0].style[b[c]])},restore:function(a,b){for(var c=0;c<b.length;c++)b[c]!==null&&a.css(b[c],a.data("ec.storage."+b[c]))},setMode:function(a,b){b=="toggle"&&(b=a.is(":hidden")?"show":"hide");return b},getBaseline:function(a,b){var c,d;switch(a[0]){case"top":c=0;break;case"middle":c=.5;break;case"bottom":c=1;break;default:c=a[0]/b.height}switch(a[1]){case"left":d=0;break;case"center":d=.5;break;case"right":d=1;break;default:d=a[1]/b.width}return{x:d,y:c}},createWrapper:function(b){if(b.parent().is(".ui-effects-wrapper"))return b.parent();var c={width:b.outerWidth(!0),height:b.outerHeight(!0),"float":b.css("float")},d=a("<div></div>").addClass("ui-effects-wrapper").css({fontSize:"100%",background:"transparent",border:"none",margin:0,padding:0}),e=document.activeElement;b.wrap(d),(b[0]===e||a.contains(b[0],e))&&a(e).focus(),d=b.parent(),b.css("position")=="static"?(d.css({position:"relative"}),b.css({position:"relative"})):(a.extend(c,{position:b.css("position"),zIndex:b.css("z-index")}),a.each(["top","left","bottom","right"],function(a,d){c[d]=b.css(d),isNaN(parseInt(c[d],10))&&(c[d]="auto")}),b.css({position:"relative",top:0,left:0,right:"auto",bottom:"auto"}));return d.css(c).show()},removeWrapper:function(b){var c,d=document.activeElement;if(b.parent().is(".ui-effects-wrapper")){c=b.parent().replaceWith(b),(b[0]===d||a.contains(b[0],d))&&a(d).focus();return c}return b},setTransition:function(b,c,d,e){e=e||{},a.each(c,function(a,c){unit=b.cssUnit(c),unit[0]>0&&(e[c]=unit[0]*d+unit[1])});return e}}),a.fn.extend({effect:function(b,c,d,e){var f=k.apply(this,arguments),g={options:f[1],duration:f[2],callback:f[3]},h=g.options.mode,i=a.effects[b];if(a.fx.off||!i)return h?this[h](g.duration,g.callback):this.each(function(){g.callback&&g.callback.call(this)});return i.call(this,g)},_show:a.fn.show,show:function(a){if(l(a))return this._show.apply(this,arguments);var b=k.apply(this,arguments);b[1].mode="show";return this.effect.apply(this,b)},_hide:a.fn.hide,hide:function(a){if(l(a))return this._hide.apply(this,arguments);var b=k.apply(this,arguments);b[1].mode="hide";return this.effect.apply(this,b)},__toggle:a.fn.toggle,toggle:function(b){if(l(b)||typeof b=="boolean"||a.isFunction(b))return this.__toggle.apply(this,arguments);var c=k.apply(this,arguments);c[1].mode="toggle";return this.effect.apply(this,c)},cssUnit:function(b){var c=this.css(b),d=[];a.each(["em","px","%","pt"],function(a,b){c.indexOf(b)>0&&(d=[parseFloat(c),b])});return d}}),a.easing.jswing=a.easing.swing,a.extend(a.easing,{def:"easeOutQuad",swing:function(b,c,d,e,f){return a.easing[a.easing.def](b,c,d,e,f)},easeInQuad:function(a,b,c,d,e){return d*(b/=e)*b+c},easeOutQuad:function(a,b,c,d,e){return-d*(b/=e)*(b-2)+c},easeInOutQuad:function(a,b,c,d,e){if((b/=e/2)<1)return d/2*b*b+c;return-d/2*(--b*(b-2)-1)+c},easeInCubic:function(a,b,c,d,e){return d*(b/=e)*b*b+c},easeOutCubic:function(a,b,c,d,e){return d*((b=b/e-1)*b*b+1)+c},easeInOutCubic:function(a,b,c,d,e){if((b/=e/2)<1)return d/2*b*b*b+c;return d/2*((b-=2)*b*b+2)+c},easeInQuart:function(a,b,c,d,e){return d*(b/=e)*b*b*b+c},easeOutQuart:function(a,b,c,d,e){return-d*((b=b/e-1)*b*b*b-1)+c},easeInOutQuart:function(a,b,c,d,e){if((b/=e/2)<1)return d/2*b*b*b*b+c;return-d/2*((b-=2)*b*b*b-2)+c},easeInQuint:function(a,b,c,d,e){return d*(b/=e)*b*b*b*b+c},easeOutQuint:function(a,b,c,d,e){return d*((b=b/e-1)*b*b*b*b+1)+c},easeInOutQuint:function(a,b,c,d,e){if((b/=e/2)<1)return d/2*b*b*b*b*b+c;return d/2*((b-=2)*b*b*b*b+2)+c},easeInSine:function(a,b,c,d,e){return-d*Math.cos(b/e*(Math.PI/2))+d+c},easeOutSine:function(a,b,c,d,e){return d*Math.sin(b/e*(Math.PI/2))+c},easeInOutSine:function(a,b,c,d,e){return-d/2*(Math.cos(Math.PI*b/e)-1)+c},easeInExpo:function(a,b,c,d,e){return b==0?c:d*Math.pow(2,10*(b/e-1))+c},easeOutExpo:function(a,b,c,d,e){return b==e?c+d:d*(-Math.pow(2,-10*b/e)+1)+c},easeInOutExpo:function(a,b,c,d,e){if(b==0)return c;if(b==e)return c+d;if((b/=e/2)<1)return d/2*Math.pow(2,10*(b-1))+c;return d/2*(-Math.pow(2,-10*--b)+2)+c},easeInCirc:function(a,b,c,d,e){return-d*(Math.sqrt(1-(b/=e)*b)-1)+c},easeOutCirc:function(a,b,c,d,e){return d*Math.sqrt(1-(b=b/e-1)*b)+c},easeInOutCirc:function(a,b,c,d,e){if((b/=e/2)<1)return-d/2*(Math.sqrt(1-b*b)-1)+c;return d/2*(Math.sqrt(1-(b-=2)*b)+1)+c},easeInElastic:function(a,b,c,d,e){var f=1.70158,g=0,h=d;if(b==0)return c;if((b/=e)==1)return c+d;g||(g=e*.3);if(h<Math.abs(d)){h=d;var f=g/4}else var f=g/(2*Math.PI)*Math.asin(d/h);return-(h*Math.pow(2,10*(b-=1))*Math.sin((b*e-f)*2*Math.PI/g))+c},easeOutElastic:function(a,b,c,d,e){var f=1.70158,g=0,h=d;if(b==0)return c;if((b/=e)==1)return c+d;g||(g=e*.3);if(h<Math.abs(d)){h=d;var f=g/4}else var f=g/(2*Math.PI)*Math.asin(d/h);return h*Math.pow(2,-10*b)*Math.sin((b*e-f)*2*Math.PI/g)+d+c},easeInOutElastic:function(a,b,c,d,e){var f=1.70158,g=0,h=d;if(b==0)return c;if((b/=e/2)==2)return c+d;g||(g=e*.3*1.5);if(h<Math.abs(d)){h=d;var f=g/4}else var f=g/(2*Math.PI)*Math.asin(d/h);if(b<1)return-0.5*h*Math.pow(2,10*(b-=1))*Math.sin((b*e-f)*2*Math.PI/g)+c;return h*Math.pow(2,-10*(b-=1))*Math.sin((b*e-f)*2*Math.PI/g)*.5+d+c},easeInBack:function(a,c,d,e,f,g){g==b&&(g=1.70158);return e*(c/=f)*c*((g+1)*c-g)+d},easeOutBack:function(a,c,d,e,f,g){g==b&&(g=1.70158);return e*((c=c/f-1)*c*((g+1)*c+g)+1)+d},easeInOutBack:function(a,c,d,e,f,g){g==b&&(g=1.70158);if((c/=f/2)<1)return e/2*c*c*(((g*=1.525)+1)*c-g)+d;return e/2*((c-=2)*c*(((g*=1.525)+1)*c+g)+2)+d},easeInBounce:function(b,c,d,e,f){return e-a.easing.easeOutBounce(b,f-c,0,e,f)+d},easeOutBounce:function(a,b,c,d,e){return(b/=e)<1/2.75?d*7.5625*b*b+c:b<2/2.75?d*(7.5625*(b-=1.5/2.75)*b+.75)+c:b<2.5/2.75?d*(7.5625*(b-=2.25/2.75)*b+.9375)+c:d*(7.5625*(b-=2.625/2.75)*b+.984375)+c},easeInOutBounce:function(b,c,d,e,f){if(c<f/2)return a.easing.easeInBounce(b,c*2,0,e,f)*.5+d;return a.easing.easeOutBounce(b,c*2-f,0,e,f)*.5+e*.5+d}})}(jQuery);/* |
| | | * jQuery UI Effects Blind 1.8.18 |
| | | * |
| | | * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) |
| | | * Dual licensed under the MIT or GPL Version 2 licenses. |
| | | * http://jquery.org/license |
| | | * |
| | | * http://docs.jquery.com/UI/Effects/Blind |
| | | * |
| | | * Depends: |
| | | * jquery.effects.core.js |
| | | */(function(a,b){a.effects.blind=function(b){return this.queue(function(){var c=a(this),d=["position","top","bottom","left","right"],e=a.effects.setMode(c,b.options.mode||"hide"),f=b.options.direction||"vertical";a.effects.save(c,d),c.show();var g=a.effects.createWrapper(c).css({overflow:"hidden"}),h=f=="vertical"?"height":"width",i=f=="vertical"?g.height():g.width();e=="show"&&g.css(h,0);var j={};j[h]=e=="show"?i:0,g.animate(j,b.duration,b.options.easing,function(){e=="hide"&&c.hide(),a.effects.restore(c,d),a.effects.removeWrapper(c),b.callback&&b.callback.apply(c[0],arguments),c.dequeue()})})}})(jQuery);/* |
| | | * jQuery UI Effects Bounce 1.8.18 |
| | | * |
| | | * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) |
| | | * Dual licensed under the MIT or GPL Version 2 licenses. |
| | | * http://jquery.org/license |
| | | * |
| | | * http://docs.jquery.com/UI/Effects/Bounce |
| | | * |
| | | * Depends: |
| | | * jquery.effects.core.js |
| | | */(function(a,b){a.effects.bounce=function(b){return this.queue(function(){var c=a(this),d=["position","top","bottom","left","right"],e=a.effects.setMode(c,b.options.mode||"effect"),f=b.options.direction||"up",g=b.options.distance||20,h=b.options.times||5,i=b.duration||250;/show|hide/.test(e)&&d.push("opacity"),a.effects.save(c,d),c.show(),a.effects.createWrapper(c);var j=f=="up"||f=="down"?"top":"left",k=f=="up"||f=="left"?"pos":"neg",g=b.options.distance||(j=="top"?c.outerHeight({margin:!0})/3:c.outerWidth({margin:!0})/3);e=="show"&&c.css("opacity",0).css(j,k=="pos"?-g:g),e=="hide"&&(g=g/(h*2)),e!="hide"&&h--;if(e=="show"){var l={opacity:1};l[j]=(k=="pos"?"+=":"-=")+g,c.animate(l,i/2,b.options.easing),g=g/2,h--}for(var m=0;m<h;m++){var n={},p={};n[j]=(k=="pos"?"-=":"+=")+g,p[j]=(k=="pos"?"+=":"-=")+g,c.animate(n,i/2,b.options.easing).animate(p,i/2,b.options.easing),g=e=="hide"?g*2:g/2}if(e=="hide"){var l={opacity:0};l[j]=(k=="pos"?"-=":"+=")+g,c.animate(l,i/2,b.options.easing,function(){c.hide(),a.effects.restore(c,d),a.effects.removeWrapper(c),b.callback&&b.callback.apply(this,arguments)})}else{var n={},p={};n[j]=(k=="pos"?"-=":"+=")+g,p[j]=(k=="pos"?"+=":"-=")+g,c.animate(n,i/2,b.options.easing).animate(p,i/2,b.options.easing,function(){a.effects.restore(c,d),a.effects.removeWrapper(c),b.callback&&b.callback.apply(this,arguments)})}c.queue("fx",function(){c.dequeue()}),c.dequeue()})}})(jQuery);/* |
| | | * jQuery UI Effects Clip 1.8.18 |
| | | * |
| | | * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) |
| | | * Dual licensed under the MIT or GPL Version 2 licenses. |
| | | * http://jquery.org/license |
| | | * |
| | | * http://docs.jquery.com/UI/Effects/Clip |
| | | * |
| | | * Depends: |
| | | * jquery.effects.core.js |
| | | */(function(a,b){a.effects.clip=function(b){return this.queue(function(){var c=a(this),d=["position","top","bottom","left","right","height","width"],e=a.effects.setMode(c,b.options.mode||"hide"),f=b.options.direction||"vertical";a.effects.save(c,d),c.show();var g=a.effects.createWrapper(c).css({overflow:"hidden"}),h=c[0].tagName=="IMG"?g:c,i={size:f=="vertical"?"height":"width",position:f=="vertical"?"top":"left"},j=f=="vertical"?h.height():h.width();e=="show"&&(h.css(i.size,0),h.css(i.position,j/2));var k={};k[i.size]=e=="show"?j:0,k[i.position]=e=="show"?0:j/2,h.animate(k,{queue:!1,duration:b.duration,easing:b.options.easing,complete:function(){e=="hide"&&c.hide(),a.effects.restore(c,d),a.effects.removeWrapper(c),b.callback&&b.callback.apply(c[0],arguments),c.dequeue()}})})}})(jQuery);/* |
| | | * jQuery UI Effects Drop 1.8.18 |
| | | * |
| | | * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) |
| | | * Dual licensed under the MIT or GPL Version 2 licenses. |
| | | * http://jquery.org/license |
| | | * |
| | | * http://docs.jquery.com/UI/Effects/Drop |
| | | * |
| | | * Depends: |
| | | * jquery.effects.core.js |
| | | */(function(a,b){a.effects.drop=function(b){return this.queue(function(){var c=a(this),d=["position","top","bottom","left","right","opacity"],e=a.effects.setMode(c,b.options.mode||"hide"),f=b.options.direction||"left";a.effects.save(c,d),c.show(),a.effects.createWrapper(c);var g=f=="up"||f=="down"?"top":"left",h=f=="up"||f=="left"?"pos":"neg",i=b.options.distance||(g=="top"?c.outerHeight({margin:!0})/2:c.outerWidth({margin:!0})/2);e=="show"&&c.css("opacity",0).css(g,h=="pos"?-i:i);var j={opacity:e=="show"?1:0};j[g]=(e=="show"?h=="pos"?"+=":"-=":h=="pos"?"-=":"+=")+i,c.animate(j,{queue:!1,duration:b.duration,easing:b.options.easing,complete:function(){e=="hide"&&c.hide(),a.effects.restore(c,d),a.effects.removeWrapper(c),b.callback&&b.callback.apply(this,arguments),c.dequeue()}})})}})(jQuery);/* |
| | | * jQuery UI Effects Explode 1.8.18 |
| | | * |
| | | * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) |
| | | * Dual licensed under the MIT or GPL Version 2 licenses. |
| | | * http://jquery.org/license |
| | | * |
| | | * http://docs.jquery.com/UI/Effects/Explode |
| | | * |
| | | * Depends: |
| | | * jquery.effects.core.js |
| | | */(function(a,b){a.effects.explode=function(b){return this.queue(function(){var c=b.options.pieces?Math.round(Math.sqrt(b.options.pieces)):3,d=b.options.pieces?Math.round(Math.sqrt(b.options.pieces)):3;b.options.mode=b.options.mode=="toggle"?a(this).is(":visible")?"hide":"show":b.options.mode;var e=a(this).show().css("visibility","hidden"),f=e.offset();f.top-=parseInt(e.css("marginTop"),10)||0,f.left-=parseInt(e.css("marginLeft"),10)||0;var g=e.outerWidth(!0),h=e.outerHeight(!0);for(var i=0;i<c;i++)for(var j=0;j<d;j++)e.clone().appendTo("body").wrap("<div></div>").css({position:"absolute",visibility:"visible",left:-j*(g/d),top:-i*(h/c)}).parent().addClass("ui-effects-explode").css({position:"absolute",overflow:"hidden",width:g/d,height:h/c,left:f.left+j*(g/d)+(b.options.mode=="show"?(j-Math.floor(d/2))*(g/d):0),top:f.top+i*(h/c)+(b.options.mode=="show"?(i-Math.floor(c/2))*(h/c):0),opacity:b.options.mode=="show"?0:1}).animate({left:f.left+j*(g/d)+(b.options.mode=="show"?0:(j-Math.floor(d/2))*(g/d)),top:f.top+i*(h/c)+(b.options.mode=="show"?0:(i-Math.floor(c/2))*(h/c)),opacity:b.options.mode=="show"?1:0},b.duration||500);setTimeout(function(){b.options.mode=="show"?e.css({visibility:"visible"}):e.css({visibility:"visible"}).hide(),b.callback&&b.callback.apply(e[0]),e.dequeue(),a("div.ui-effects-explode").remove()},b.duration||500)})}})(jQuery);/* |
| | | * jQuery UI Effects Fade 1.8.18 |
| | | * |
| | | * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) |
| | | * Dual licensed under the MIT or GPL Version 2 licenses. |
| | | * http://jquery.org/license |
| | | * |
| | | * http://docs.jquery.com/UI/Effects/Fade |
| | | * |
| | | * Depends: |
| | | * jquery.effects.core.js |
| | | */(function(a,b){a.effects.fade=function(b){return this.queue(function(){var c=a(this),d=a.effects.setMode(c,b.options.mode||"hide");c.animate({opacity:d},{queue:!1,duration:b.duration,easing:b.options.easing,complete:function(){b.callback&&b.callback.apply(this,arguments),c.dequeue()}})})}})(jQuery);/* |
| | | * jQuery UI Effects Fold 1.8.18 |
| | | * |
| | | * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) |
| | | * Dual licensed under the MIT or GPL Version 2 licenses. |
| | | * http://jquery.org/license |
| | | * |
| | | * http://docs.jquery.com/UI/Effects/Fold |
| | | * |
| | | * Depends: |
| | | * jquery.effects.core.js |
| | | */(function(a,b){a.effects.fold=function(b){return this.queue(function(){var c=a(this),d=["position","top","bottom","left","right"],e=a.effects.setMode(c,b.options.mode||"hide"),f=b.options.size||15,g=!!b.options.horizFirst,h=b.duration?b.duration/2:a.fx.speeds._default/2;a.effects.save(c,d),c.show();var i=a.effects.createWrapper(c).css({overflow:"hidden"}),j=e=="show"!=g,k=j?["width","height"]:["height","width"],l=j?[i.width(),i.height()]:[i.height(),i.width()],m=/([0-9]+)%/.exec(f);m&&(f=parseInt(m[1],10)/100*l[e=="hide"?0:1]),e=="show"&&i.css(g?{height:0,width:f}:{height:f,width:0});var n={},p={};n[k[0]]=e=="show"?l[0]:f,p[k[1]]=e=="show"?l[1]:0,i.animate(n,h,b.options.easing).animate(p,h,b.options.easing,function(){e=="hide"&&c.hide(),a.effects.restore(c,d),a.effects.removeWrapper(c),b.callback&&b.callback.apply(c[0],arguments),c.dequeue()})})}})(jQuery);/* |
| | | * jQuery UI Effects Highlight 1.8.18 |
| | | * |
| | | * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) |
| | | * Dual licensed under the MIT or GPL Version 2 licenses. |
| | | * http://jquery.org/license |
| | | * |
| | | * http://docs.jquery.com/UI/Effects/Highlight |
| | | * |
| | | * Depends: |
| | | * jquery.effects.core.js |
| | | */(function(a,b){a.effects.highlight=function(b){return this.queue(function(){var c=a(this),d=["backgroundImage","backgroundColor","opacity"],e=a.effects.setMode(c,b.options.mode||"show"),f={backgroundColor:c.css("backgroundColor")};e=="hide"&&(f.opacity=0),a.effects.save(c,d),c.show().css({backgroundImage:"none",backgroundColor:b.options.color||"#ffff99"}).animate(f,{queue:!1,duration:b.duration,easing:b.options.easing,complete:function(){e=="hide"&&c.hide(),a.effects.restore(c,d),e=="show"&&!a.support.opacity&&this.style.removeAttribute("filter"),b.callback&&b.callback.apply(this,arguments),c.dequeue()}})})}})(jQuery);/* |
| | | * jQuery UI Effects Pulsate 1.8.18 |
| | | * |
| | | * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) |
| | | * Dual licensed under the MIT or GPL Version 2 licenses. |
| | | * http://jquery.org/license |
| | | * |
| | | * http://docs.jquery.com/UI/Effects/Pulsate |
| | | * |
| | | * Depends: |
| | | * jquery.effects.core.js |
| | | */(function(a,b){a.effects.pulsate=function(b){return this.queue(function(){var c=a(this),d=a.effects.setMode(c,b.options.mode||"show");times=(b.options.times||5)*2-1,duration=b.duration?b.duration/2:a.fx.speeds._default/2,isVisible=c.is(":visible"),animateTo=0,isVisible||(c.css("opacity",0).show(),animateTo=1),(d=="hide"&&isVisible||d=="show"&&!isVisible)&×--;for(var e=0;e<times;e++)c.animate({opacity:animateTo},duration,b.options.easing),animateTo=(animateTo+1)%2;c.animate({opacity:animateTo},duration,b.options.easing,function(){animateTo==0&&c.hide(),b.callback&&b.callback.apply(this,arguments)}),c.queue("fx",function(){c.dequeue()}).dequeue()})}})(jQuery);/* |
| | | * jQuery UI Effects Scale 1.8.18 |
| | | * |
| | | * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) |
| | | * Dual licensed under the MIT or GPL Version 2 licenses. |
| | | * http://jquery.org/license |
| | | * |
| | | * http://docs.jquery.com/UI/Effects/Scale |
| | | * |
| | | * Depends: |
| | | * jquery.effects.core.js |
| | | */(function(a,b){a.effects.puff=function(b){return this.queue(function(){var c=a(this),d=a.effects.setMode(c,b.options.mode||"hide"),e=parseInt(b.options.percent,10)||150,f=e/100,g={height:c.height(),width:c.width()};a.extend(b.options,{fade:!0,mode:d,percent:d=="hide"?e:100,from:d=="hide"?g:{height:g.height*f,width:g.width*f}}),c.effect("scale",b.options,b.duration,b.callback),c.dequeue()})},a.effects.scale=function(b){return this.queue(function(){var c=a(this),d=a.extend(!0,{},b.options),e=a.effects.setMode(c,b.options.mode||"effect"),f=parseInt(b.options.percent,10)||(parseInt(b.options.percent,10)==0?0:e=="hide"?0:100),g=b.options.direction||"both",h=b.options.origin;e!="effect"&&(d.origin=h||["middle","center"],d.restore=!0);var i={height:c.height(),width:c.width()};c.from=b.options.from||(e=="show"?{height:0,width:0}:i);var j={y:g!="horizontal"?f/100:1,x:g!="vertical"?f/100:1};c.to={height:i.height*j.y,width:i.width*j.x},b.options.fade&&(e=="show"&&(c.from.opacity=0,c.to.opacity=1),e=="hide"&&(c.from.opacity=1,c.to.opacity=0)),d.from=c.from,d.to=c.to,d.mode=e,c.effect("size",d,b.duration,b.callback),c.dequeue()})},a.effects.size=function(b){return this.queue(function(){var c=a(this),d=["position","top","bottom","left","right","width","height","overflow","opacity"],e=["position","top","bottom","left","right","overflow","opacity"],f=["width","height","overflow"],g=["fontSize"],h=["borderTopWidth","borderBottomWidth","paddingTop","paddingBottom"],i=["borderLeftWidth","borderRightWidth","paddingLeft","paddingRight"],j=a.effects.setMode(c,b.options.mode||"effect"),k=b.options.restore||!1,l=b.options.scale||"both",m=b.options.origin,n={height:c.height(),width:c.width()};c.from=b.options.from||n,c.to=b.options.to||n;if(m){var p=a.effects.getBaseline(m,n);c.from.top=(n.height-c.from.height)*p.y,c.from.left=(n.width-c.from.width)*p.x,c.to.top=(n.height-c.to.height)*p.y,c.to.left=(n.width-c.to.width)*p.x}var q={from:{y:c.from.height/n.height,x:c.from.width/n.width},to:{y:c.to.height/n.height,x:c.to.width/n.width}};if(l=="box"||l=="both")q.from.y!=q.to.y&&(d=d.concat(h),c.from=a.effects.setTransition(c,h,q.from.y,c.from),c.to=a.effects.setTransition(c,h,q.to.y,c.to)),q.from.x!=q.to.x&&(d=d.concat(i),c.from=a.effects.setTransition(c,i,q.from.x,c.from),c.to=a.effects.setTransition(c,i,q.to.x,c.to));(l=="content"||l=="both")&&q.from.y!=q.to.y&&(d=d.concat(g),c.from=a.effects.setTransition(c,g,q.from.y,c.from),c.to=a.effects.setTransition(c,g,q.to.y,c.to)),a.effects.save(c,k?d:e),c.show(),a.effects.createWrapper(c),c.css("overflow","hidden").css(c.from);if(l=="content"||l=="both")h=h.concat(["marginTop","marginBottom"]).concat(g),i=i.concat(["marginLeft","marginRight"]),f=d.concat(h).concat(i),c.find("*[width]").each(function(){child=a(this),k&&a.effects.save(child,f);var c={height:child.height(),width:child.width()};child.from={height:c.height*q.from.y,width:c.width*q.from.x},child.to={height:c.height*q.to.y,width:c.width*q.to.x},q.from.y!=q.to.y&&(child.from=a.effects.setTransition(child,h,q.from.y,child.from),child.to=a.effects.setTransition(child,h,q.to.y,child.to)),q.from.x!=q.to.x&&(child.from=a.effects.setTransition(child,i,q.from.x,child.from),child.to=a.effects.setTransition(child,i,q.to.x,child.to)),child.css(child.from),child.animate(child.to,b.duration,b.options.easing,function(){k&&a.effects.restore(child,f)})});c.animate(c.to,{queue:!1,duration:b.duration,easing:b.options.easing,complete:function(){c.to.opacity===0&&c.css("opacity",c.from.opacity),j=="hide"&&c.hide(),a.effects.restore(c,k?d:e),a.effects.removeWrapper(c),b.callback&&b.callback.apply(this,arguments),c.dequeue()}})})}})(jQuery);/* |
| | | * jQuery UI Effects Shake 1.8.18 |
| | | * |
| | | * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) |
| | | * Dual licensed under the MIT or GPL Version 2 licenses. |
| | | * http://jquery.org/license |
| | | * |
| | | * http://docs.jquery.com/UI/Effects/Shake |
| | | * |
| | | * Depends: |
| | | * jquery.effects.core.js |
| | | */(function(a,b){a.effects.shake=function(b){return this.queue(function(){var c=a(this),d=["position","top","bottom","left","right"],e=a.effects.setMode(c,b.options.mode||"effect"),f=b.options.direction||"left",g=b.options.distance||20,h=b.options.times||3,i=b.duration||b.options.duration||140;a.effects.save(c,d),c.show(),a.effects.createWrapper(c);var j=f=="up"||f=="down"?"top":"left",k=f=="up"||f=="left"?"pos":"neg",l={},m={},n={};l[j]=(k=="pos"?"-=":"+=")+g,m[j]=(k=="pos"?"+=":"-=")+g*2,n[j]=(k=="pos"?"-=":"+=")+g*2,c.animate(l,i,b.options.easing);for(var p=1;p<h;p++)c.animate(m,i,b.options.easing).animate(n,i,b.options.easing);c.animate(m,i,b.options.easing).animate(l,i/2,b.options.easing,function(){a.effects.restore(c,d),a.effects.removeWrapper(c),b.callback&&b.callback.apply(this,arguments)}),c.queue("fx",function(){c.dequeue()}),c.dequeue()})}})(jQuery);/* |
| | | * jQuery UI Effects Slide 1.8.18 |
| | | * |
| | | * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) |
| | | * Dual licensed under the MIT or GPL Version 2 licenses. |
| | | * http://jquery.org/license |
| | | * |
| | | * http://docs.jquery.com/UI/Effects/Slide |
| | | * |
| | | * Depends: |
| | | * jquery.effects.core.js |
| | | */(function(a,b){a.effects.slide=function(b){return this.queue(function(){var c=a(this),d=["position","top","bottom","left","right"],e=a.effects.setMode(c,b.options.mode||"show"),f=b.options.direction||"left";a.effects.save(c,d),c.show(),a.effects.createWrapper(c).css({overflow:"hidden"});var g=f=="up"||f=="down"?"top":"left",h=f=="up"||f=="left"?"pos":"neg",i=b.options.distance||(g=="top"?c.outerHeight({margin:!0}):c.outerWidth({margin:!0}));e=="show"&&c.css(g,h=="pos"?isNaN(i)?"-"+i:-i:i);var j={};j[g]=(e=="show"?h=="pos"?"+=":"-=":h=="pos"?"-=":"+=")+i,c.animate(j,{queue:!1,duration:b.duration,easing:b.options.easing,complete:function(){e=="hide"&&c.hide(),a.effects.restore(c,d),a.effects.removeWrapper(c),b.callback&&b.callback.apply(this,arguments),c.dequeue()}})})}})(jQuery);/* |
| | | * jQuery UI Effects Transfer 1.8.18 |
| | | * |
| | | * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) |
| | | * Dual licensed under the MIT or GPL Version 2 licenses. |
| | | * http://jquery.org/license |
| | | * |
| | | * http://docs.jquery.com/UI/Effects/Transfer |
| | | * |
| | | * Depends: |
| | | * jquery.effects.core.js |
| | | */(function(a,b){a.effects.transfer=function(b){return this.queue(function(){var c=a(this),d=a(b.options.to),e=d.offset(),f={top:e.top,left:e.left,height:d.innerHeight(),width:d.innerWidth()},g=c.offset(),h=a('<div class="ui-effects-transfer"></div>').appendTo(document.body).addClass(b.options.className).css({top:g.top,left:g.left,height:c.innerHeight(),width:c.innerWidth(),position:"absolute"}).animate(f,b.duration,b.options.easing,function(){h.remove(),b.callback&&b.callback.apply(c[0],arguments),c.dequeue()})})}})(jQuery); |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <package xmlns="http://pear.php.net/dtd/package-2.0" xmlns:tasks="http://pear.php.net/dtd/tasks-1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" packagerversion="1.9.0" version="2.0" xsi:schemaLocation="http://pear.php.net/dtd/tasks-1.0 |
| | | http://pear.php.net/dtd/tasks-1.0.xsd |
| | | http://pear.php.net/dtd/package-2.0 |
| | | http://pear.php.net/dtd/package-2.0.xsd"> |
| | | <name>jqueryui</name> |
| | | <channel>pear.roundcube.net</channel> |
| | | <summary>jQuery-UI library</summary> |
| | | <description> |
| | | Plugin adds the complete jQuery-UI library including the smoothness |
| | | theme to Roundcube. This allows other plugins to use jQuery-UI without |
| | | having to load their own version. The benefit of using one central jQuery-UI |
| | | is that we wont run into problems of conflicting jQuery libraries being |
| | | loaded. All plugins that want to use jQuery-UI should use this plugin as |
| | | a requirement. |
| | | </description> |
| | | <lead> |
| | | <name>Thomas Bruederli</name> |
| | | <user>thomasb</user> |
| | | <email>roundcube@gmail.com</email> |
| | | <active>yes</active> |
| | | </lead> |
| | | <date>2011-11-21</date> |
| | | <version> |
| | | <release>1.8.14</release> |
| | | <api>1.8</api> |
| | | </version> |
| | | <stability> |
| | | <release>stable</release> |
| | | <api>stable</api> |
| | | </stability> |
| | | <license uri="http://www.gnu.org/licenses/gpl-2.0.html">GNU GPLv2</license> |
| | | <notes>-</notes> |
| | | <contents> |
| | | <dir baseinstalldir="/" name="/"> |
| | | <file name="jqueryui.php" role="php"> |
| | | <tasks:replace from="@name@" to="name" type="package-info"/> |
| | | <tasks:replace from="@package_version@" to="version" type="package-info"/> |
| | | </file> |
| | | <file name="README" role="data"></file> |
| | | <file name="config.inc.php.dist" role="data"></file> |
| | | |
| | | <file name="js/jquery-ui-1.8.14.custom.min.js" role="data"></file> |
| | | <file name="js/i18n/jquery.ui.datepicker-af.js" role="data"></file> |
| | | <file name="js/i18n/jquery.ui.datepicker-ar.js" role="data"></file> |
| | | <file name="js/i18n/jquery.ui.datepicker-az.js" role="data"></file> |
| | | <file name="js/i18n/jquery.ui.datepicker-bg.js" role="data"></file> |
| | | <file name="js/i18n/jquery.ui.datepicker-bz.js" role="data"></file> |
| | | <file name="js/i18n/jquery.ui.datepicker-ca.js" role="data"></file> |
| | | <file name="js/i18n/jquery.ui.datepicker-cs.js" role="data"></file> |
| | | <file name="js/i18n/jquery.ui.datepicker-da.js" role="data"></file> |
| | | <file name="js/i18n/jquery.ui.datepicker-de-CH.js" role="data"></file> |
| | | <file name="js/i18n/jquery.ui.datepicker-de.js" role="data"></file> |
| | | <file name="js/i18n/jquery.ui.datepicker-el.js" role="data"></file> |
| | | <file name="js/i18n/jquery.ui.datepicker-en-GB.js" role="data"></file> |
| | | <file name="js/i18n/jquery.ui.datepicker-eo.js" role="data"></file> |
| | | <file name="js/i18n/jquery.ui.datepicker-es.js" role="data"></file> |
| | | <file name="js/i18n/jquery.ui.datepicker-et.js" role="data"></file> |
| | | <file name="js/i18n/jquery.ui.datepicker-eu.js" role="data"></file> |
| | | <file name="js/i18n/jquery.ui.datepicker-fa.js" role="data"></file> |
| | | <file name="js/i18n/jquery.ui.datepicker-fi.js" role="data"></file> |
| | | <file name="js/i18n/jquery.ui.datepicker-fo.js" role="data"></file> |
| | | <file name="js/i18n/jquery.ui.datepicker-fr-CH.js" role="data"></file> |
| | | <file name="js/i18n/jquery.ui.datepicker-fr.js" role="data"></file> |
| | | <file name="js/i18n/jquery.ui.datepicker-gl.js" role="data"></file> |
| | | <file name="js/i18n/jquery.ui.datepicker-he.js" role="data"></file> |
| | | <file name="js/i18n/jquery.ui.datepicker-hr.js" role="data"></file> |
| | | <file name="js/i18n/jquery.ui.datepicker-hu.js" role="data"></file> |
| | | <file name="js/i18n/jquery.ui.datepicker-hy.js" role="data"></file> |
| | | <file name="js/i18n/jquery.ui.datepicker-id.js" role="data"></file> |
| | | <file name="js/i18n/jquery.ui.datepicker-is.js" role="data"></file> |
| | | <file name="js/i18n/jquery.ui.datepicker-it.js" role="data"></file> |
| | | <file name="js/i18n/jquery.ui.datepicker-ja.js" role="data"></file> |
| | | <file name="js/i18n/jquery.ui.datepicker-ko.js" role="data"></file> |
| | | <file name="js/i18n/jquery.ui.datepicker-kz.js" role="data"></file> |
| | | <file name="js/i18n/jquery.ui.datepicker-lt.js" role="data"></file> |
| | | <file name="js/i18n/jquery.ui.datepicker-lv.js" role="data"></file> |
| | | <file name="js/i18n/jquery.ui.datepicker-ms.js" role="data"></file> |
| | | <file name="js/i18n/jquery.ui.datepicker-nl-BE.js" role="data"></file> |
| | | <file name="js/i18n/jquery.ui.datepicker-nl.js" role="data"></file> |
| | | <file name="js/i18n/jquery.ui.datepicker-no.js" role="data"></file> |
| | | <file name="js/i18n/jquery.ui.datepicker-pl.js" role="data"></file> |
| | | <file name="js/i18n/jquery.ui.datepicker-pt-BR.js" role="data"></file> |
| | | <file name="js/i18n/jquery.ui.datepicker-pt.js" role="data"></file> |
| | | <file name="js/i18n/jquery.ui.datepicker-ro.js" role="data"></file> |
| | | <file name="js/i18n/jquery.ui.datepicker-ru.js" role="data"></file> |
| | | <file name="js/i18n/jquery.ui.datepicker-sk.js" role="data"></file> |
| | | <file name="js/i18n/jquery.ui.datepicker-sl.js" role="data"></file> |
| | | <file name="js/i18n/jquery.ui.datepicker-sq.js" role="data"></file> |
| | | <file name="js/i18n/jquery.ui.datepicker-sr.js" role="data"></file> |
| | | <file name="js/i18n/jquery.ui.datepicker-sr-SR.js" role="data"></file> |
| | | <file name="js/i18n/jquery.ui.datepicker-sv.js" role="data"></file> |
| | | <file name="js/i18n/jquery.ui.datepicker-ta.js" role="data"></file> |
| | | <file name="js/i18n/jquery.ui.datepicker-th.js" role="data"></file> |
| | | <file name="js/i18n/jquery.ui.datepicker-tr.js" role="data"></file> |
| | | <file name="js/i18n/jquery.ui.datepicker-uk.js" role="data"></file> |
| | | <file name="js/i18n/jquery.ui.datepicker-vi.js" role="data"></file> |
| | | <file name="js/i18n/jquery.ui.datepicker-zh-CN.js" role="data"></file> |
| | | <file name="js/i18n/jquery.ui.datepicker-zh-HK.js" role="data"></file> |
| | | <file name="js/i18n/jquery.ui.datepicker-zh-TW.js" role="data"></file> |
| | | |
| | | <file name="themes/default/jquery-ui-1.8.14.custom.css" role="data"></file> |
| | | <file name="themes/default/roundcube-custom.diff" role="data"></file> |
| | | <file name="themes/default/images/buttongradient.png" role="data"></file> |
| | | <file name="themes/default/images/ui-bg_flat_90_cc3333_40x100.png" role="data"></file> |
| | | <file name="themes/default/images/ui-bg_highlight-hard_90_f4f4f4_1x100.png" role="data"></file> |
| | | <file name="themes/default/images/ui-icons_cc3333_256x240.png" role="data"></file> |
| | | <file name="themes/default/images/listheader.png" role="data"></file> |
| | | <file name="themes/default/images/ui-bg_glass_95_fef1ec_1x400.png" role="data"></file> |
| | | <file name="themes/default/images/ui-icons_000000_256x240.png" role="data"></file> |
| | | <file name="themes/default/images/ui-icons_dddddd_256x240.png" role="data"></file> |
| | | <file name="themes/default/images/ui-bg_flat_0_aaaaaa_40x100.png" role="data"></file> |
| | | <file name="themes/default/images/ui-bg_highlight-hard_90_a3a3a3_1x100.png" role="data"></file> |
| | | <file name="themes/default/images/ui-icons_333333_256x240.png" role="data"></file> |
| | | <file name="themes/default/images/ui-bg_flat_75_ffffff_40x100.png" role="data"></file> |
| | | <file name="themes/default/images/ui-bg_highlight-hard_90_e6e6e7_1x100.png" role="data"></file> |
| | | <file name="themes/default/images/ui-icons_666666_256x240.png" role="data"></file> |
| | | |
| | | <file name="themes/redmont/jquery-ui-1.8.14.custom.css" role="data"></file> |
| | | <file name="themes/redmont/images/ui-bg_flat_0_aaaaaa_40x100.png" role="data"></file> |
| | | <file name="themes/redmont/images/ui-bg_glass_95_fef1ec_1x400.png" role="data"></file> |
| | | <file name="themes/redmont/images/ui-icons_217bc0_256x240.png" role="data"></file> |
| | | <file name="themes/redmont/images/ui-icons_cd0a0a_256x240.png" role="data"></file> |
| | | <file name="themes/redmont/images/ui-bg_flat_55_fbec88_40x100.png" role="data"></file> |
| | | <file name="themes/redmont/images/ui-bg_gloss-wave_55_5c9ccc_500x100.png" role="data"></file> |
| | | <file name="themes/redmont/images/ui-icons_2e83ff_256x240.png" role="data"></file> |
| | | <file name="themes/redmont/images/ui-icons_d8e7f3_256x240.png" role="data"></file> |
| | | <file name="themes/redmont/images/ui-bg_glass_75_d0e5f5_1x400.png" role="data"></file> |
| | | <file name="themes/redmont/images/ui-bg_inset-hard_100_f5f8f9_1x100.png" role="data"></file> |
| | | <file name="themes/redmont/images/ui-icons_469bdd_256x240.png" role="data"></file> |
| | | <file name="themes/redmont/images/ui-icons_f9bd01_256x240.png" role="data"></file> |
| | | <file name="themes/redmont/images/ui-bg_glass_85_dfeffc_1x400.png" role="data"></file> |
| | | <file name="themes/redmont/images/ui-bg_inset-hard_100_fcfdfd_1x100.png" role="data"></file> |
| | | <file name="themes/redmont/images/ui-icons_6da8d5_256x240.png" role="data"></file> |
| | | </dir> |
| | | <!-- / --> |
| | | </contents> |
| | | <dependencies> |
| | | <required> |
| | | <php> |
| | | <min>5.2.1</min> |
| | | </php> |
| | | <pearinstaller> |
| | | <min>1.7.0</min> |
| | | </pearinstaller> |
| | | </required> |
| | | </dependencies> |
| | | <phprelease/> |
| | | </package> |
New file |
| | |
| | | /* |
| | | * jQuery UI CSS Framework 1.8.18 |
| | | * |
| | | * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) |
| | | * Dual licensed under the MIT or GPL Version 2 licenses. |
| | | * http://jquery.org/license |
| | | * |
| | | * http://docs.jquery.com/UI/Theming/API |
| | | */ |
| | | |
| | | /* Layout helpers |
| | | ----------------------------------*/ |
| | | .ui-helper-hidden { display: none; } |
| | | .ui-helper-hidden-accessible { position: absolute !important; clip: rect(1px 1px 1px 1px); clip: rect(1px,1px,1px,1px); } |
| | | .ui-helper-reset { margin: 0; padding: 0; border: 0; outline: 0; line-height: 1.3; text-decoration: none; font-size: 100%; list-style: none; } |
| | | .ui-helper-clearfix:before, .ui-helper-clearfix:after { content: ""; display: table; } |
| | | .ui-helper-clearfix:after { clear: both; } |
| | | .ui-helper-clearfix { zoom: 1; } |
| | | .ui-helper-zfix { width: 100%; height: 100%; top: 0; left: 0; position: absolute; opacity: 0; filter:Alpha(Opacity=0); } |
| | | |
| | | |
| | | /* Interaction Cues |
| | | ----------------------------------*/ |
| | | .ui-state-disabled { cursor: default !important; } |
| | | |
| | | |
| | | /* Icons |
| | | ----------------------------------*/ |
| | | |
| | | /* states and images */ |
| | | .ui-icon { display: block; text-indent: -99999px; overflow: hidden; background-repeat: no-repeat; } |
| | | |
| | | |
| | | /* Misc visuals |
| | | ----------------------------------*/ |
| | | |
| | | /* Overlays */ |
| | | .ui-widget-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; } |
| | | |
| | | |
| | | /* |
| | | * jQuery UI CSS Framework 1.8.18 |
| | | * |
| | | * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) |
| | | * Dual licensed under the MIT or GPL Version 2 licenses. |
| | | * http://jquery.org/license |
| | | * |
| | | * http://docs.jquery.com/UI/Theming/API |
| | | * |
| | | * To view and modify this theme, visit http://jqueryui.com/themeroller/?ctl=themeroller&ctl=themeroller&ffDefault=Lucida%20Grande,%20Verdana,%20Arial,%20Helvetica,%20sans-serif&fwDefault=normal&fsDefault=1em&cornerRadius=0&bgColorHeader=f4f4f4&bgTextureHeader=04_highlight_hard.png&bgImgOpacityHeader=90&borderColorHeader=999999&fcHeader=333333&iconColorHeader=333333&bgColorContent=ffffff&bgTextureContent=01_flat.png&bgImgOpacityContent=75&borderColorContent=aaaaaa&fcContent=000000&iconColorContent=000000&bgColorDefault=e6e6e7&bgTextureDefault=04_highlight_hard.png&bgImgOpacityDefault=90&borderColorDefault=aaaaaa&fcDefault=000000&iconColorDefault=666666&bgColorHover=e6e6e7&bgTextureHover=04_highlight_hard.png&bgImgOpacityHover=90&borderColorHover=999999&fcHover=000000&iconColorHover=333333&bgColorActive=a3a3a3&bgTextureActive=04_highlight_hard.png&bgImgOpacityActive=90&borderColorActive=a4a4a4&fcActive=000000&iconColorActive=333333&bgColorHighlight=cc3333&bgTextureHighlight=01_flat.png&bgImgOpacityHighlight=90&borderColorHighlight=cc3333&fcHighlight=ffffff&iconColorHighlight=dddddd&bgColorError=fef1ec&bgTextureError=02_glass.png&bgImgOpacityError=95&borderColorError=cc3333&fcError=cc3333&iconColorError=cc3333&bgColorOverlay=aaaaaa&bgTextureOverlay=01_flat.png&bgImgOpacityOverlay=0&opacityOverlay=30&bgColorShadow=aaaaaa&bgTextureShadow=01_flat.png&bgImgOpacityShadow=0&opacityShadow=35&thicknessShadow=6px&offsetTopShadow=-6px&offsetLeftShadow=-6px&cornerRadiusShadow=6px |
| | | */ |
| | | |
| | | |
| | | /* Component containers |
| | | ----------------------------------*/ |
| | | .ui-widget { font-family: Lucida Grande, Verdana, Arial, Helvetica, sans-serif; font-size: 1em; } |
| | | .ui-widget .ui-widget { font-size: 1em; } |
| | | .ui-widget input, .ui-widget select, .ui-widget textarea, .ui-widget button { font-family: Lucida Grande, Verdana, Arial, Helvetica, sans-serif; font-size: 1em; } |
| | | .ui-widget-content { border: 1px solid #aaaaaa; background: #ffffff url(images/ui-bg_flat_75_ffffff_40x100.png) 50% 50% repeat-x; color: #000000; } |
| | | .ui-widget-content a { color: #000000; } |
| | | .ui-widget-header { border: 1px solid #999999; border-width: 0 0 1px 0; background: #f4f4f4 url(images/listheader.png) 50% 50% repeat; color: #333333; font-weight: bold; margin: -0.2em -0.2em 0 -0.2em; } |
| | | .ui-widget-header a { color: #333333; } |
| | | |
| | | /* Interaction states |
| | | ----------------------------------*/ |
| | | .ui-state-default, .ui-widget-content .ui-state-default, .ui-widget-header .ui-state-default { border: 1px solid #aaaaaa; background: #e6e6e7 url(images/ui-bg_highlight-hard_90_e6e6e7_1x100.png) 50% 50% repeat-x; font-weight: normal; color: #000000; } |
| | | .ui-state-default a, .ui-state-default a:link, .ui-state-default a:visited { color: #000000; text-decoration: none; } |
| | | .ui-state-hover, .ui-widget-content .ui-state-hover, .ui-widget-header .ui-state-hover, .ui-state-focus, .ui-widget-content .ui-state-focus, .ui-widget-header .ui-state-focus { border: 1px solid #999999; background: #e6e6e7 url(images/ui-bg_highlight-hard_90_e6e6e7_1x100.png) 50% 50% repeat-x; font-weight: normal; color: #000000; } |
| | | .ui-state-hover a, .ui-state-hover a:hover { color: #000000; text-decoration: none; } |
| | | .ui-state-active, .ui-widget-content .ui-state-active, .ui-widget-header .ui-state-active { border: 1px solid #a4a4a4; background: #a3a3a3 url(images/ui-bg_highlight-hard_90_a3a3a3_1x100.png) 50% 50% repeat-x; font-weight: normal; color: #000000; } |
| | | .ui-state-active a, .ui-state-active a:link, .ui-state-active a:visited { color: #000000; text-decoration: none; } |
| | | .ui-state-focus, .ui-widget-content .ui-state-focus { border: 1px solid #c33; color: #a00; } |
| | | .ui-tabs-nav .ui-state-focus { border: 1px solid #a4a4a4; color: #000000; } |
| | | .ui-widget :active { outline: none; } |
| | | |
| | | /* Interaction Cues |
| | | ----------------------------------*/ |
| | | .ui-state-highlight, .ui-widget-content .ui-state-highlight, .ui-widget-header .ui-state-highlight {border: 1px solid #cc3333; background: #cc3333 url(images/ui-bg_flat_90_cc3333_40x100.png) 50% 50% repeat-x; color: #ffffff; } |
| | | .ui-state-highlight a, .ui-widget-content .ui-state-highlight a,.ui-widget-header .ui-state-highlight a { color: #ffffff; } |
| | | .ui-state-error, .ui-widget-content .ui-state-error, .ui-widget-header .ui-state-error {border: 1px solid #cc3333; background: #fef1ec url(images/ui-bg_glass_95_fef1ec_1x400.png) 50% 50% repeat-x; color: #cc3333; } |
| | | .ui-state-error a, .ui-widget-content .ui-state-error a, .ui-widget-header .ui-state-error a { color: #cc3333; } |
| | | .ui-state-error-text, .ui-widget-content .ui-state-error-text, .ui-widget-header .ui-state-error-text { color: #cc3333; } |
| | | .ui-priority-primary, .ui-widget-content .ui-priority-primary, .ui-widget-header .ui-priority-primary { font-weight: bold; } |
| | | .ui-priority-secondary, .ui-widget-content .ui-priority-secondary, .ui-widget-header .ui-priority-secondary { opacity: .6; filter:Alpha(Opacity=60); font-weight: normal; } |
| | | .ui-state-disabled, .ui-widget-content .ui-state-disabled, .ui-widget-header .ui-state-disabled { opacity: .35; filter:Alpha(Opacity=35); background-image: none; } |
| | | |
| | | /* Icons |
| | | ----------------------------------*/ |
| | | |
| | | /* states and images */ |
| | | .ui-icon { width: 16px; height: 16px; background-image: url(images/ui-icons_000000_256x240.png); } |
| | | .ui-widget-content .ui-icon {background-image: url(images/ui-icons_000000_256x240.png); } |
| | | .ui-widget-header .ui-icon {background-image: url(images/ui-icons_333333_256x240.png); } |
| | | .ui-state-default .ui-icon { background-image: url(images/ui-icons_666666_256x240.png); } |
| | | .ui-state-hover .ui-icon, .ui-state-focus .ui-icon {background-image: url(images/ui-icons_333333_256x240.png); } |
| | | .ui-state-active .ui-icon {background-image: url(images/ui-icons_333333_256x240.png); } |
| | | .ui-state-highlight .ui-icon {background-image: url(images/ui-icons_dddddd_256x240.png); } |
| | | .ui-state-error .ui-icon, .ui-state-error-text .ui-icon {background-image: url(images/ui-icons_cc3333_256x240.png); } |
| | | |
| | | /* positioning */ |
| | | .ui-icon-carat-1-n { background-position: 0 0; } |
| | | .ui-icon-carat-1-ne { background-position: -16px 0; } |
| | | .ui-icon-carat-1-e { background-position: -32px 0; } |
| | | .ui-icon-carat-1-se { background-position: -48px 0; } |
| | | .ui-icon-carat-1-s { background-position: -64px 0; } |
| | | .ui-icon-carat-1-sw { background-position: -80px 0; } |
| | | .ui-icon-carat-1-w { background-position: -96px 0; } |
| | | .ui-icon-carat-1-nw { background-position: -112px 0; } |
| | | .ui-icon-carat-2-n-s { background-position: -128px 0; } |
| | | .ui-icon-carat-2-e-w { background-position: -144px 0; } |
| | | .ui-icon-triangle-1-n { background-position: 0 -16px; } |
| | | .ui-icon-triangle-1-ne { background-position: -16px -16px; } |
| | | .ui-icon-triangle-1-e { background-position: -32px -16px; } |
| | | .ui-icon-triangle-1-se { background-position: -48px -16px; } |
| | | .ui-icon-triangle-1-s { background-position: -64px -16px; } |
| | | .ui-icon-triangle-1-sw { background-position: -80px -16px; } |
| | | .ui-icon-triangle-1-w { background-position: -96px -16px; } |
| | | .ui-icon-triangle-1-nw { background-position: -112px -16px; } |
| | | .ui-icon-triangle-2-n-s { background-position: -128px -16px; } |
| | | .ui-icon-triangle-2-e-w { background-position: -144px -16px; } |
| | | .ui-icon-arrow-1-n { background-position: 0 -32px; } |
| | | .ui-icon-arrow-1-ne { background-position: -16px -32px; } |
| | | .ui-icon-arrow-1-e { background-position: -32px -32px; } |
| | | .ui-icon-arrow-1-se { background-position: -48px -32px; } |
| | | .ui-icon-arrow-1-s { background-position: -64px -32px; } |
| | | .ui-icon-arrow-1-sw { background-position: -80px -32px; } |
| | | .ui-icon-arrow-1-w { background-position: -96px -32px; } |
| | | .ui-icon-arrow-1-nw { background-position: -112px -32px; } |
| | | .ui-icon-arrow-2-n-s { background-position: -128px -32px; } |
| | | .ui-icon-arrow-2-ne-sw { background-position: -144px -32px; } |
| | | .ui-icon-arrow-2-e-w { background-position: -160px -32px; } |
| | | .ui-icon-arrow-2-se-nw { background-position: -176px -32px; } |
| | | .ui-icon-arrowstop-1-n { background-position: -192px -32px; } |
| | | .ui-icon-arrowstop-1-e { background-position: -208px -32px; } |
| | | .ui-icon-arrowstop-1-s { background-position: -224px -32px; } |
| | | .ui-icon-arrowstop-1-w { background-position: -240px -32px; } |
| | | .ui-icon-arrowthick-1-n { background-position: 0 -48px; } |
| | | .ui-icon-arrowthick-1-ne { background-position: -16px -48px; } |
| | | .ui-icon-arrowthick-1-e { background-position: -32px -48px; } |
| | | .ui-icon-arrowthick-1-se { background-position: -48px -48px; } |
| | | .ui-icon-arrowthick-1-s { background-position: -64px -48px; } |
| | | .ui-icon-arrowthick-1-sw { background-position: -80px -48px; } |
| | | .ui-icon-arrowthick-1-w { background-position: -96px -48px; } |
| | | .ui-icon-arrowthick-1-nw { background-position: -112px -48px; } |
| | | .ui-icon-arrowthick-2-n-s { background-position: -128px -48px; } |
| | | .ui-icon-arrowthick-2-ne-sw { background-position: -144px -48px; } |
| | | .ui-icon-arrowthick-2-e-w { background-position: -160px -48px; } |
| | | .ui-icon-arrowthick-2-se-nw { background-position: -176px -48px; } |
| | | .ui-icon-arrowthickstop-1-n { background-position: -192px -48px; } |
| | | .ui-icon-arrowthickstop-1-e { background-position: -208px -48px; } |
| | | .ui-icon-arrowthickstop-1-s { background-position: -224px -48px; } |
| | | .ui-icon-arrowthickstop-1-w { background-position: -240px -48px; } |
| | | .ui-icon-arrowreturnthick-1-w { background-position: 0 -64px; } |
| | | .ui-icon-arrowreturnthick-1-n { background-position: -16px -64px; } |
| | | .ui-icon-arrowreturnthick-1-e { background-position: -32px -64px; } |
| | | .ui-icon-arrowreturnthick-1-s { background-position: -48px -64px; } |
| | | .ui-icon-arrowreturn-1-w { background-position: -64px -64px; } |
| | | .ui-icon-arrowreturn-1-n { background-position: -80px -64px; } |
| | | .ui-icon-arrowreturn-1-e { background-position: -96px -64px; } |
| | | .ui-icon-arrowreturn-1-s { background-position: -112px -64px; } |
| | | .ui-icon-arrowrefresh-1-w { background-position: -128px -64px; } |
| | | .ui-icon-arrowrefresh-1-n { background-position: -144px -64px; } |
| | | .ui-icon-arrowrefresh-1-e { background-position: -160px -64px; } |
| | | .ui-icon-arrowrefresh-1-s { background-position: -176px -64px; } |
| | | .ui-icon-arrow-4 { background-position: 0 -80px; } |
| | | .ui-icon-arrow-4-diag { background-position: -16px -80px; } |
| | | .ui-icon-extlink { background-position: -32px -80px; } |
| | | .ui-icon-newwin { background-position: -48px -80px; } |
| | | .ui-icon-refresh { background-position: -64px -80px; } |
| | | .ui-icon-shuffle { background-position: -80px -80px; } |
| | | .ui-icon-transfer-e-w { background-position: -96px -80px; } |
| | | .ui-icon-transferthick-e-w { background-position: -112px -80px; } |
| | | .ui-icon-folder-collapsed { background-position: 0 -96px; } |
| | | .ui-icon-folder-open { background-position: -16px -96px; } |
| | | .ui-icon-document { background-position: -32px -96px; } |
| | | .ui-icon-document-b { background-position: -48px -96px; } |
| | | .ui-icon-note { background-position: -64px -96px; } |
| | | .ui-icon-mail-closed { background-position: -80px -96px; } |
| | | .ui-icon-mail-open { background-position: -96px -96px; } |
| | | .ui-icon-suitcase { background-position: -112px -96px; } |
| | | .ui-icon-comment { background-position: -128px -96px; } |
| | | .ui-icon-person { background-position: -144px -96px; } |
| | | .ui-icon-print { background-position: -160px -96px; } |
| | | .ui-icon-trash { background-position: -176px -96px; } |
| | | .ui-icon-locked { background-position: -192px -96px; } |
| | | .ui-icon-unlocked { background-position: -208px -96px; } |
| | | .ui-icon-bookmark { background-position: -224px -96px; } |
| | | .ui-icon-tag { background-position: -240px -96px; } |
| | | .ui-icon-home { background-position: 0 -112px; } |
| | | .ui-icon-flag { background-position: -16px -112px; } |
| | | .ui-icon-calendar { background-position: -32px -112px; } |
| | | .ui-icon-cart { background-position: -48px -112px; } |
| | | .ui-icon-pencil { background-position: -64px -112px; } |
| | | .ui-icon-clock { background-position: -80px -112px; } |
| | | .ui-icon-disk { background-position: -96px -112px; } |
| | | .ui-icon-calculator { background-position: -112px -112px; } |
| | | .ui-icon-zoomin { background-position: -128px -112px; } |
| | | .ui-icon-zoomout { background-position: -144px -112px; } |
| | | .ui-icon-search { background-position: -160px -112px; } |
| | | .ui-icon-wrench { background-position: -176px -112px; } |
| | | .ui-icon-gear { background-position: -192px -112px; } |
| | | .ui-icon-heart { background-position: -208px -112px; } |
| | | .ui-icon-star { background-position: -224px -112px; } |
| | | .ui-icon-link { background-position: -240px -112px; } |
| | | .ui-icon-cancel { background-position: 0 -128px; } |
| | | .ui-icon-plus { background-position: -16px -128px; } |
| | | .ui-icon-plusthick { background-position: -32px -128px; } |
| | | .ui-icon-minus { background-position: -48px -128px; } |
| | | .ui-icon-minusthick { background-position: -64px -128px; } |
| | | .ui-icon-close { background-position: -80px -128px; } |
| | | .ui-icon-closethick { background-position: -96px -128px; } |
| | | .ui-icon-key { background-position: -112px -128px; } |
| | | .ui-icon-lightbulb { background-position: -128px -128px; } |
| | | .ui-icon-scissors { background-position: -144px -128px; } |
| | | .ui-icon-clipboard { background-position: -160px -128px; } |
| | | .ui-icon-copy { background-position: -176px -128px; } |
| | | .ui-icon-contact { background-position: -192px -128px; } |
| | | .ui-icon-image { background-position: -208px -128px; } |
| | | .ui-icon-video { background-position: -224px -128px; } |
| | | .ui-icon-script { background-position: -240px -128px; } |
| | | .ui-icon-alert { background-position: 0 -144px; } |
| | | .ui-icon-info { background-position: -16px -144px; } |
| | | .ui-icon-notice { background-position: -32px -144px; } |
| | | .ui-icon-help { background-position: -48px -144px; } |
| | | .ui-icon-check { background-position: -64px -144px; } |
| | | .ui-icon-bullet { background-position: -80px -144px; } |
| | | .ui-icon-radio-off { background-position: -96px -144px; } |
| | | .ui-icon-radio-on { background-position: -112px -144px; } |
| | | .ui-icon-pin-w { background-position: -128px -144px; } |
| | | .ui-icon-pin-s { background-position: -144px -144px; } |
| | | .ui-icon-play { background-position: 0 -160px; } |
| | | .ui-icon-pause { background-position: -16px -160px; } |
| | | .ui-icon-seek-next { background-position: -32px -160px; } |
| | | .ui-icon-seek-prev { background-position: -48px -160px; } |
| | | .ui-icon-seek-end { background-position: -64px -160px; } |
| | | .ui-icon-seek-start { background-position: -80px -160px; } |
| | | /* ui-icon-seek-first is deprecated, use ui-icon-seek-start instead */ |
| | | .ui-icon-seek-first { background-position: -80px -160px; } |
| | | .ui-icon-stop { background-position: -96px -160px; } |
| | | .ui-icon-eject { background-position: -112px -160px; } |
| | | .ui-icon-volume-off { background-position: -128px -160px; } |
| | | .ui-icon-volume-on { background-position: -144px -160px; } |
| | | .ui-icon-power { background-position: 0 -176px; } |
| | | .ui-icon-signal-diag { background-position: -16px -176px; } |
| | | .ui-icon-signal { background-position: -32px -176px; } |
| | | .ui-icon-battery-0 { background-position: -48px -176px; } |
| | | .ui-icon-battery-1 { background-position: -64px -176px; } |
| | | .ui-icon-battery-2 { background-position: -80px -176px; } |
| | | .ui-icon-battery-3 { background-position: -96px -176px; } |
| | | .ui-icon-circle-plus { background-position: 0 -192px; } |
| | | .ui-icon-circle-minus { background-position: -16px -192px; } |
| | | .ui-icon-circle-close { background-position: -32px -192px; } |
| | | .ui-icon-circle-triangle-e { background-position: -48px -192px; } |
| | | .ui-icon-circle-triangle-s { background-position: -64px -192px; } |
| | | .ui-icon-circle-triangle-w { background-position: -80px -192px; } |
| | | .ui-icon-circle-triangle-n { background-position: -96px -192px; } |
| | | .ui-icon-circle-arrow-e { background-position: -112px -192px; } |
| | | .ui-icon-circle-arrow-s { background-position: -128px -192px; } |
| | | .ui-icon-circle-arrow-w { background-position: -144px -192px; } |
| | | .ui-icon-circle-arrow-n { background-position: -160px -192px; } |
| | | .ui-icon-circle-zoomin { background-position: -176px -192px; } |
| | | .ui-icon-circle-zoomout { background-position: -192px -192px; } |
| | | .ui-icon-circle-check { background-position: -208px -192px; } |
| | | .ui-icon-circlesmall-plus { background-position: 0 -208px; } |
| | | .ui-icon-circlesmall-minus { background-position: -16px -208px; } |
| | | .ui-icon-circlesmall-close { background-position: -32px -208px; } |
| | | .ui-icon-squaresmall-plus { background-position: -48px -208px; } |
| | | .ui-icon-squaresmall-minus { background-position: -64px -208px; } |
| | | .ui-icon-squaresmall-close { background-position: -80px -208px; } |
| | | .ui-icon-grip-dotted-vertical { background-position: 0 -224px; } |
| | | .ui-icon-grip-dotted-horizontal { background-position: -16px -224px; } |
| | | .ui-icon-grip-solid-vertical { background-position: -32px -224px; } |
| | | .ui-icon-grip-solid-horizontal { background-position: -48px -224px; } |
| | | .ui-icon-gripsmall-diagonal-se { background-position: -64px -224px; } |
| | | .ui-icon-grip-diagonal-se { background-position: -80px -224px; } |
| | | |
| | | |
| | | /* Misc visuals |
| | | ----------------------------------*/ |
| | | |
| | | /* Corner radius */ |
| | | .ui-corner-all, .ui-corner-top, .ui-corner-left, .ui-corner-tl { -moz-border-radius-topleft: 0; -webkit-border-top-left-radius: 0; -khtml-border-top-left-radius: 0; border-top-left-radius: 0; } |
| | | .ui-corner-all, .ui-corner-top, .ui-corner-right, .ui-corner-tr { -moz-border-radius-topright: 0; -webkit-border-top-right-radius: 0; -khtml-border-top-right-radius: 0; border-top-right-radius: 0; } |
| | | .ui-corner-all, .ui-corner-bottom, .ui-corner-left, .ui-corner-bl { -moz-border-radius-bottomleft: 0; -webkit-border-bottom-left-radius: 0; -khtml-border-bottom-left-radius: 0; border-bottom-left-radius: 0; } |
| | | .ui-corner-all, .ui-corner-bottom, .ui-corner-right, .ui-corner-br { -moz-border-radius-bottomright: 0; -webkit-border-bottom-right-radius: 0; -khtml-border-bottom-right-radius: 0; border-bottom-right-radius: 0; } |
| | | |
| | | /* Overlays */ |
| | | .ui-widget-overlay { background: #aaaaaa url(images/ui-bg_flat_0_aaaaaa_40x100.png) 50% 50% repeat-x; opacity: .30;filter:Alpha(Opacity=30); } |
| | | .ui-widget-shadow { margin: -6px 0 0 -6px; padding: 6px; background: #aaaaaa url(images/ui-bg_flat_0_aaaaaa_40x100.png) 50% 50% repeat-x; opacity: .35;filter:Alpha(Opacity=35); -moz-border-radius: 6px; -khtml-border-radius: 6px; -webkit-border-radius: 6px; border-radius: 6px; }/* |
| | | * jQuery UI Resizable 1.8.18 |
| | | * |
| | | * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) |
| | | * Dual licensed under the MIT or GPL Version 2 licenses. |
| | | * http://jquery.org/license |
| | | * |
| | | * http://docs.jquery.com/UI/Resizable#theming |
| | | */ |
| | | .ui-resizable { position: relative;} |
| | | .ui-resizable-handle { position: absolute;font-size: 0.1px;z-index: 99999; display: block; } |
| | | .ui-resizable-disabled .ui-resizable-handle, .ui-resizable-autohide .ui-resizable-handle { display: none; } |
| | | .ui-resizable-n { cursor: n-resize; height: 7px; width: 100%; top: -5px; left: 0; } |
| | | .ui-resizable-s { cursor: s-resize; height: 7px; width: 100%; bottom: -5px; left: 0; } |
| | | .ui-resizable-e { cursor: e-resize; width: 7px; right: -5px; top: 0; height: 100%; } |
| | | .ui-resizable-w { cursor: w-resize; width: 7px; left: -5px; top: 0; height: 100%; } |
| | | .ui-resizable-se { cursor: se-resize; width: 12px; height: 12px; right: 1px; bottom: 1px; } |
| | | .ui-resizable-sw { cursor: sw-resize; width: 9px; height: 9px; left: -5px; bottom: -5px; } |
| | | .ui-resizable-nw { cursor: nw-resize; width: 9px; height: 9px; left: -5px; top: -5px; } |
| | | .ui-resizable-ne { cursor: ne-resize; width: 9px; height: 9px; right: -5px; top: -5px;}/* |
| | | * jQuery UI Selectable 1.8.18 |
| | | * |
| | | * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) |
| | | * Dual licensed under the MIT or GPL Version 2 licenses. |
| | | * http://jquery.org/license |
| | | * |
| | | * http://docs.jquery.com/UI/Selectable#theming |
| | | */ |
| | | .ui-selectable-helper { position: absolute; z-index: 100; border:1px dotted black; } |
| | | /* |
| | | * jQuery UI Accordion 1.8.18 |
| | | * |
| | | * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) |
| | | * Dual licensed under the MIT or GPL Version 2 licenses. |
| | | * http://jquery.org/license |
| | | * |
| | | * http://docs.jquery.com/UI/Accordion#theming |
| | | */ |
| | | /* IE/Win - Fix animation bug - #4615 */ |
| | | .ui-accordion { width: 100%; } |
| | | .ui-accordion .ui-accordion-header { cursor: pointer; position: relative; margin-top: 1px; zoom: 1; } |
| | | .ui-accordion .ui-accordion-li-fix { display: inline; } |
| | | .ui-accordion .ui-accordion-header-active { border-bottom: 0 !important; } |
| | | .ui-accordion .ui-accordion-header a { display: block; font-size: 1em; padding: .5em .5em .5em .7em; } |
| | | .ui-accordion-icons .ui-accordion-header a { padding-left: 2.2em; } |
| | | .ui-accordion .ui-accordion-header .ui-icon { position: absolute; left: .5em; top: 50%; margin-top: -8px; } |
| | | .ui-accordion .ui-accordion-content { padding: 1em 2.2em; border-top: 0; margin-top: -2px; position: relative; top: 1px; margin-bottom: 2px; overflow: auto; display: none; zoom: 1; } |
| | | .ui-accordion .ui-accordion-content-active { display: block; } |
| | | /* |
| | | * jQuery UI Autocomplete 1.8.18 |
| | | * |
| | | * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) |
| | | * Dual licensed under the MIT or GPL Version 2 licenses. |
| | | * http://jquery.org/license |
| | | * |
| | | * http://docs.jquery.com/UI/Autocomplete#theming |
| | | */ |
| | | .ui-autocomplete { position: absolute; cursor: default; } |
| | | |
| | | /* workarounds */ |
| | | * html .ui-autocomplete { width:1px; } /* without this, the menu expands to 100% in IE6 */ |
| | | |
| | | #ui-active-menuitem { background:#c33; border-color:#a22; color:#fff; } |
| | | |
| | | /* |
| | | * jQuery UI Menu 1.8.18 |
| | | * |
| | | * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about) |
| | | * Dual licensed under the MIT or GPL Version 2 licenses. |
| | | * http://jquery.org/license |
| | | * |
| | | * http://docs.jquery.com/UI/Menu#theming |
| | | */ |
| | | .ui-menu { |
| | | list-style:none; |
| | | padding: 2px; |
| | | margin: 0; |
| | | display:block; |
| | | float: left; |
| | | box-shadow: 1px 1px 18px #999; |
| | | -moz-box-shadow: 1px 1px 12px #999; |
| | | -webkit-box-shadow: #999 1px 1px 12px; |
| | | } |
| | | .ui-menu .ui-menu { |
| | | margin-top: -3px; |
| | | } |
| | | .ui-menu .ui-menu-item { |
| | | margin:0; |
| | | padding: 0; |
| | | zoom: 1; |
| | | float: left; |
| | | clear: left; |
| | | width: 100%; |
| | | } |
| | | .ui-menu .ui-menu-item a { |
| | | text-decoration:none; |
| | | display:block; |
| | | padding:.2em .4em; |
| | | line-height:1.5; |
| | | zoom:1; |
| | | } |
| | | .ui-menu .ui-menu-item a.ui-state-hover, |
| | | .ui-menu .ui-menu-item a.ui-state-active { |
| | | font-weight: normal; |
| | | margin: -1px; |
| | | } |
| | | /* |
| | | * jQuery UI Button 1.8.18 |
| | | * |
| | | * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) |
| | | * Dual licensed under the MIT or GPL Version 2 licenses. |
| | | * http://jquery.org/license |
| | | * |
| | | * http://docs.jquery.com/UI/Button#theming |
| | | */ |
| | | .ui-button { display: inline-block; position: relative; padding: 0; margin-right: .1em; text-decoration: none !important; cursor: pointer; text-align: center; zoom: 1; overflow: hidden; *overflow: visible; } /* the overflow property removes extra width in IE */ |
| | | .ui-button-icon-only { width: 2.2em; } /* to make room for the icon, a width needs to be set here */ |
| | | button.ui-button-icon-only { width: 2.4em; } /* button elements seem to need a little more width */ |
| | | .ui-button-icons-only { width: 3.4em; } |
| | | button.ui-button-icons-only { width: 3.7em; } |
| | | button.ui-button-text-only, a.ui-button-text-only { background-image: url(images/buttongradient.png) !important; } |
| | | |
| | | /*button text element */ |
| | | .ui-button .ui-button-text { display: block; line-height: 1.4; } |
| | | .ui-button-text-only .ui-button-text { padding: .3em 1em; } |
| | | .ui-button-icon-only .ui-button-text, .ui-button-icons-only .ui-button-text { padding: .4em; text-indent: -9999999px; } |
| | | .ui-button-text-icon-primary .ui-button-text, .ui-button-text-icons .ui-button-text { padding: .4em 1em .4em 2.1em; } |
| | | .ui-button-text-icon-secondary .ui-button-text, .ui-button-text-icons .ui-button-text { padding: .4em 2.1em .4em 1em; } |
| | | .ui-button-text-icons .ui-button-text { padding-left: 2.1em; padding-right: 2.1em; } |
| | | /* no icon support for input elements, provide padding by default */ |
| | | input.ui-button { padding: .4em 1em; } |
| | | |
| | | /*button icon element(s) */ |
| | | .ui-button-icon-only .ui-icon, .ui-button-text-icon-primary .ui-icon, .ui-button-text-icon-secondary .ui-icon, .ui-button-text-icons .ui-icon, .ui-button-icons-only .ui-icon { position: absolute; top: 50%; margin-top: -8px; } |
| | | .ui-button-icon-only .ui-icon { left: 50%; margin-left: -8px; } |
| | | .ui-button-text-icon-primary .ui-button-icon-primary, .ui-button-text-icons .ui-button-icon-primary, .ui-button-icons-only .ui-button-icon-primary { left: .5em; } |
| | | .ui-button-text-icon-secondary .ui-button-icon-secondary, .ui-button-text-icons .ui-button-icon-secondary, .ui-button-icons-only .ui-button-icon-secondary { right: .5em; } |
| | | .ui-button-text-icons .ui-button-icon-secondary, .ui-button-icons-only .ui-button-icon-secondary { right: .5em; } |
| | | |
| | | /*button sets*/ |
| | | .ui-buttonset { margin-right: 7px; } |
| | | .ui-buttonset .ui-button { margin-left: 0; margin-right: -.3em; } |
| | | |
| | | /* workarounds */ |
| | | button.ui-button::-moz-focus-inner { border: 0; padding: 0; } /* reset extra padding in Firefox */ |
| | | /* |
| | | * jQuery UI Dialog 1.8.18 |
| | | * |
| | | * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) |
| | | * Dual licensed under the MIT or GPL Version 2 licenses. |
| | | * http://jquery.org/license |
| | | * |
| | | * http://docs.jquery.com/UI/Dialog#theming |
| | | */ |
| | | .ui-dialog { position: absolute; padding: .2em; width: 300px; overflow: hidden; box-shadow: 1px 1px 18px #999; -moz-box-shadow: 1px 1px 12px #999; -webkit-box-shadow: #999 1px 1px 12px; } |
| | | .ui-dialog .ui-dialog-titlebar { padding: .4em 1em; position: relative; } |
| | | .ui-dialog .ui-dialog-title { float: left; margin: .1em 16px .1em 0; } |
| | | .ui-dialog .ui-dialog-titlebar-close { position: absolute; right: .3em; top: 50%; width: 19px; margin: -10px 0 0 0; padding: 1px; height: 18px; } |
| | | .ui-dialog .ui-dialog-titlebar-close span { display: block; margin: 1px; } |
| | | .ui-dialog .ui-dialog-titlebar-close:hover, .ui-dialog .ui-dialog-titlebar-close:focus { padding: 0; } |
| | | .ui-dialog .ui-dialog-content { position: relative; border: 0; padding: .5em 1em; background: none; overflow: auto; zoom: 1; } |
| | | .ui-dialog .ui-dialog-buttonpane { text-align: left; border-width: 1px 0 0 0; background-image: none; margin: .5em 0 0 0; padding: .3em 1em .5em .4em; } |
| | | .ui-dialog .ui-dialog-buttonpane .ui-dialog-buttonset { float: right; } |
| | | .ui-dialog .ui-dialog-buttonpane button { margin: .5em .4em .5em 0; cursor: default; } |
| | | .ui-dialog .ui-resizable-se { width: 14px; height: 14px; right: 3px; bottom: 3px; } |
| | | .ui-draggable .ui-dialog-titlebar { cursor: move; } |
| | | /* |
| | | * jQuery UI Slider 1.8.18 |
| | | * |
| | | * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) |
| | | * Dual licensed under the MIT or GPL Version 2 licenses. |
| | | * http://jquery.org/license |
| | | * |
| | | * http://docs.jquery.com/UI/Slider#theming |
| | | */ |
| | | .ui-slider { position: relative; text-align: left; } |
| | | .ui-slider .ui-slider-handle { position: absolute; z-index: 2; width: 1.2em; height: 1.2em; cursor: default; } |
| | | .ui-slider .ui-slider-range { position: absolute; z-index: 1; font-size: .7em; display: block; border: 0; background-position: 0 0; } |
| | | |
| | | .ui-slider-horizontal { height: .8em; } |
| | | .ui-slider-horizontal .ui-slider-handle { top: -.3em; margin-left: -.6em; } |
| | | .ui-slider-horizontal .ui-slider-range { top: 0; height: 100%; } |
| | | .ui-slider-horizontal .ui-slider-range-min { left: 0; } |
| | | .ui-slider-horizontal .ui-slider-range-max { right: 0; } |
| | | |
| | | .ui-slider-vertical { width: .8em; height: 100px; } |
| | | .ui-slider-vertical .ui-slider-handle { left: -.3em; margin-left: 0; margin-bottom: -.6em; } |
| | | .ui-slider-vertical .ui-slider-range { left: 0; width: 100%; } |
| | | .ui-slider-vertical .ui-slider-range-min { bottom: 0; } |
| | | .ui-slider-vertical .ui-slider-range-max { top: 0; }/* |
| | | * jQuery UI Tabs 1.8.18 |
| | | * |
| | | * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) |
| | | * Dual licensed under the MIT or GPL Version 2 licenses. |
| | | * http://jquery.org/license |
| | | * |
| | | * http://docs.jquery.com/UI/Tabs#theming |
| | | */ |
| | | .ui-tabs { position: relative; padding: .2em; zoom: 1; } /* position: relative prevents IE scroll bug (element with position: relative inside container with overflow: auto appear as "fixed") */ |
| | | .ui-tabs .ui-tabs-nav { margin: 0; padding: .2em .2em 0; } |
| | | .ui-tabs .ui-tabs-nav li { list-style: none; float: left; position: relative; top: 1px; margin: 0 0 1px 0; border-bottom: 0 !important; padding: 0; white-space: nowrap; -moz-border-radius-topleft: 2px; -webkit-border-top-left-radius: 2px; border-top-left-radius: 2px; -moz-border-radius-topright: 2px; -webkit-border-top-right-radius: 2px; border-top-right-radius: 2px; } |
| | | .ui-tabs .ui-tabs-nav li a { float: left; padding: .3em 1em; text-decoration: none; } |
| | | .ui-tabs .ui-tabs-nav li.ui-tabs-selected { margin-bottom: 0; padding-bottom: 1px; } |
| | | .ui-tabs .ui-tabs-nav li.ui-tabs-selected a, .ui-tabs .ui-tabs-nav li.ui-state-disabled a, .ui-tabs .ui-tabs-nav li.ui-state-processing a { cursor: text; } |
| | | .ui-tabs .ui-tabs-nav li a, .ui-tabs.ui-tabs-collapsible .ui-tabs-nav li.ui-tabs-selected a { cursor: pointer; } /* first selector in group seems obsolete, but required to overcome bug in Opera applying cursor: text overall if defined elsewhere... */ |
| | | .ui-tabs .ui-tabs-panel { display: block; border-width: 0; padding: 1em 1.4em; background: none; } |
| | | .ui-tabs .ui-tabs-hide { display: none !important; } |
| | | |
| | | .ui-dialog .ui-tabs .ui-tabs-nav li.ui-tabs-selected { background:#fff; } |
| | | |
| | | /* |
| | | * jQuery UI Datepicker 1.8.18 |
| | | * |
| | | * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) |
| | | * Dual licensed under the MIT or GPL Version 2 licenses. |
| | | * http://jquery.org/license |
| | | * |
| | | * http://docs.jquery.com/UI/Datepicker#theming |
| | | */ |
| | | .ui-datepicker { width: 17em; padding: .2em .2em 0; display: none; box-shadow: 1px 1px 18px #999; -moz-box-shadow: 1px 1px 12px #999; -webkit-box-shadow: #999 1px 1px 12px; } |
| | | .ui-datepicker .ui-datepicker-header { position:relative; padding:.2em 0; } |
| | | .ui-datepicker .ui-datepicker-prev, .ui-datepicker .ui-datepicker-next { position:absolute; top: 2px; width: 1.8em; height: 1.8em; } |
| | | .ui-datepicker .ui-datepicker-prev-hover, .ui-datepicker .ui-datepicker-next-hover { top: 1px; } |
| | | .ui-datepicker .ui-datepicker-prev { left:2px; } |
| | | .ui-datepicker .ui-datepicker-next { right:2px; } |
| | | .ui-datepicker .ui-datepicker-prev-hover { left:1px; } |
| | | .ui-datepicker .ui-datepicker-next-hover { right:1px; } |
| | | .ui-datepicker .ui-datepicker-prev span, .ui-datepicker .ui-datepicker-next span { display: block; position: absolute; left: 50%; margin-left: -8px; top: 50%; margin-top: -8px; } |
| | | .ui-datepicker .ui-datepicker-title { margin: 0 2.3em; line-height: 1.8em; text-align: center; } |
| | | .ui-datepicker .ui-datepicker-title select { font-size:1em; margin:1px 0; } |
| | | .ui-datepicker select.ui-datepicker-month-year {width: 100%;} |
| | | .ui-datepicker select.ui-datepicker-month, |
| | | .ui-datepicker select.ui-datepicker-year { width: 49%;} |
| | | .ui-datepicker table {width: 100%; font-size: .9em; border-collapse: collapse; margin:0 0 .4em; } |
| | | .ui-datepicker th { padding: .7em .3em; text-align: center; font-weight: bold; border: 0; } |
| | | .ui-datepicker td { border: 0; padding: 1px; } |
| | | .ui-datepicker td span, .ui-datepicker td a { display: block; padding: .2em; text-align: right; text-decoration: none; } |
| | | .ui-datepicker td.ui-datepicker-current-day .ui-state-active { background:#c33; border-color:#a22; color:#fff; } |
| | | .ui-datepicker .ui-datepicker-buttonpane { background-image: none; margin: .7em 0 0 0; padding:0 .2em; border-left: 0; border-right: 0; border-bottom: 0; } |
| | | .ui-datepicker .ui-datepicker-buttonpane button { float: right; margin: .5em .2em .4em; cursor: default; padding: .2em .6em .3em .6em; width:auto; overflow:visible; } |
| | | .ui-datepicker .ui-datepicker-buttonpane button.ui-datepicker-current { float:left; } |
| | | |
| | | /* with multiple calendars */ |
| | | .ui-datepicker.ui-datepicker-multi { width:auto; } |
| | | .ui-datepicker-multi .ui-datepicker-group { float:left; } |
| | | .ui-datepicker-multi .ui-datepicker-group table { width:95%; margin:0 auto .4em; } |
| | | .ui-datepicker-multi-2 .ui-datepicker-group { width:50%; } |
| | | .ui-datepicker-multi-3 .ui-datepicker-group { width:33.3%; } |
| | | .ui-datepicker-multi-4 .ui-datepicker-group { width:25%; } |
| | | .ui-datepicker-multi .ui-datepicker-group-last .ui-datepicker-header { border-left-width:0; } |
| | | .ui-datepicker-multi .ui-datepicker-group-middle .ui-datepicker-header { border-left-width:0; } |
| | | .ui-datepicker-multi .ui-datepicker-buttonpane { clear:left; } |
| | | .ui-datepicker-row-break { clear:both; width:100%; font-size:0em; } |
| | | |
| | | /* RTL support */ |
| | | .ui-datepicker-rtl { direction: rtl; } |
| | | .ui-datepicker-rtl .ui-datepicker-prev { right: 2px; left: auto; } |
| | | .ui-datepicker-rtl .ui-datepicker-next { left: 2px; right: auto; } |
| | | .ui-datepicker-rtl .ui-datepicker-prev:hover { right: 1px; left: auto; } |
| | | .ui-datepicker-rtl .ui-datepicker-next:hover { left: 1px; right: auto; } |
| | | .ui-datepicker-rtl .ui-datepicker-buttonpane { clear:right; } |
| | | .ui-datepicker-rtl .ui-datepicker-buttonpane button { float: left; } |
| | | .ui-datepicker-rtl .ui-datepicker-buttonpane button.ui-datepicker-current { float:right; } |
| | | .ui-datepicker-rtl .ui-datepicker-group { float:right; } |
| | | .ui-datepicker-rtl .ui-datepicker-group-last .ui-datepicker-header { border-right-width:0; border-left-width:1px; } |
| | | .ui-datepicker-rtl .ui-datepicker-group-middle .ui-datepicker-header { border-right-width:0; border-left-width:1px; } |
| | | |
| | | /* IE6 IFRAME FIX (taken from datepicker 1.5.3 */ |
| | | .ui-datepicker-cover { |
| | | display: none; /*sorry for IE5*/ |
| | | display/**/: block; /*sorry for IE5*/ |
| | | position: absolute; /*must have*/ |
| | | z-index: -1; /*must have*/ |
| | | filter: mask(); /*must have*/ |
| | | top: -4px; /*must have*/ |
| | | left: -4px; /*must have*/ |
| | | width: 200px; /*must have*/ |
| | | height: 200px; /*must have*/ |
| | | }/* |
| | | * jQuery UI Progressbar 1.8.18 |
| | | * |
| | | * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) |
| | | * Dual licensed under the MIT or GPL Version 2 licenses. |
| | | * http://jquery.org/license |
| | | * |
| | | * http://docs.jquery.com/UI/Progressbar#theming |
| | | */ |
| | | .ui-progressbar { height:2em; text-align: left; overflow: hidden; } |
| | | .ui-progressbar .ui-progressbar-value {margin: -1px; height:100%; } |
New file |
| | |
| | | --- jquery-ui-1.8.18.custom.css.orig 2012-03-02 08:13:36.000000000 +0100 |
| | | +++ jquery-ui-1.8.18.custom.css 2012-03-02 17:22:10.000000000 +0100 |
| | | @@ -58,7 +58,7 @@ |
| | | .ui-widget input, .ui-widget select, .ui-widget textarea, .ui-widget button { font-family: Lucida Grande, Verdana, Arial, Helvetica, sans-serif; font-size: 1em; } |
| | | .ui-widget-content { border: 1px solid #aaaaaa; background: #ffffff url(images/ui-bg_flat_75_ffffff_40x100.png) 50% 50% repeat-x; color: #000000; } |
| | | .ui-widget-content a { color: #000000; } |
| | | -.ui-widget-header { border: 1px solid #999999; background: #f4f4f4 url(images/ui-bg_highlight-hard_90_f4f4f4_1x100.png) 50% 50% repeat-x; color: #333333; font-weight: bold; } |
| | | +.ui-widget-header { border: 1px solid #999999; border-width: 0 0 1px 0; background: #f4f4f4 url(images/listheader.png) 50% 50% repeat; color: #333333; font-weight: bold; margin: -0.2em -0.2em 0 -0.2em; } |
| | | .ui-widget-header a { color: #333333; } |
| | | |
| | | /* Interaction states |
| | | @@ -69,6 +69,8 @@ |
| | | .ui-state-hover a, .ui-state-hover a:hover { color: #000000; text-decoration: none; } |
| | | .ui-state-active, .ui-widget-content .ui-state-active, .ui-widget-header .ui-state-active { border: 1px solid #a4a4a4; background: #a3a3a3 url(images/ui-bg_highlight-hard_90_a3a3a3_1x100.png) 50% 50% repeat-x; font-weight: normal; color: #000000; } |
| | | .ui-state-active a, .ui-state-active a:link, .ui-state-active a:visited { color: #000000; text-decoration: none; } |
| | | +.ui-state-focus, .ui-widget-content .ui-state-focus { border: 1px solid #c33; color: #a00; } |
| | | +.ui-tabs-nav .ui-state-focus { border: 1px solid #a4a4a4; color: #000000; } |
| | | .ui-widget :active { outline: none; } |
| | | |
| | | /* Interaction Cues |
| | | @@ -79,7 +81,7 @@ |
| | | .ui-state-error a, .ui-widget-content .ui-state-error a, .ui-widget-header .ui-state-error a { color: #cc3333; } |
| | | .ui-state-error-text, .ui-widget-content .ui-state-error-text, .ui-widget-header .ui-state-error-text { color: #cc3333; } |
| | | .ui-priority-primary, .ui-widget-content .ui-priority-primary, .ui-widget-header .ui-priority-primary { font-weight: bold; } |
| | | -.ui-priority-secondary, .ui-widget-content .ui-priority-secondary, .ui-widget-header .ui-priority-secondary { opacity: .7; filter:Alpha(Opacity=70); font-weight: normal; } |
| | | +.ui-priority-secondary, .ui-widget-content .ui-priority-secondary, .ui-widget-header .ui-priority-secondary { opacity: .6; filter:Alpha(Opacity=60); font-weight: normal; } |
| | | .ui-state-disabled, .ui-widget-content .ui-state-disabled, .ui-widget-header .ui-state-disabled { opacity: .35; filter:Alpha(Opacity=35); background-image: none; } |
| | | |
| | | /* Icons |
| | | @@ -346,6 +348,8 @@ |
| | | /* workarounds */ |
| | | * html .ui-autocomplete { width:1px; } /* without this, the menu expands to 100% in IE6 */ |
| | | |
| | | +#ui-active-menuitem { background:#c33; border-color:#a22; color:#fff; } |
| | | + |
| | | /* |
| | | * jQuery UI Menu 1.8.18 |
| | | * |
| | | @@ -361,6 +365,9 @@ |
| | | margin: 0; |
| | | display:block; |
| | | float: left; |
| | | + box-shadow: 1px 1px 18px #999; |
| | | + -moz-box-shadow: 1px 1px 12px #999; |
| | | + -webkit-box-shadow: #999 1px 1px 12px; |
| | | } |
| | | .ui-menu .ui-menu { |
| | | margin-top: -3px; |
| | | @@ -399,10 +406,11 @@ |
| | | button.ui-button-icon-only { width: 2.4em; } /* button elements seem to need a little more width */ |
| | | .ui-button-icons-only { width: 3.4em; } |
| | | button.ui-button-icons-only { width: 3.7em; } |
| | | +button.ui-button-text-only, a.ui-button-text-only { background-image: url(images/buttongradient.png) !important; } |
| | | |
| | | /*button text element */ |
| | | .ui-button .ui-button-text { display: block; line-height: 1.4; } |
| | | -.ui-button-text-only .ui-button-text { padding: .4em 1em; } |
| | | +.ui-button-text-only .ui-button-text { padding: .3em 1em; } |
| | | .ui-button-icon-only .ui-button-text, .ui-button-icons-only .ui-button-text { padding: .4em; text-indent: -9999999px; } |
| | | .ui-button-text-icon-primary .ui-button-text, .ui-button-text-icons .ui-button-text { padding: .4em 1em .4em 2.1em; } |
| | | .ui-button-text-icon-secondary .ui-button-text, .ui-button-text-icons .ui-button-text { padding: .4em 2.1em .4em 1em; } |
| | | @@ -432,7 +440,7 @@ |
| | | * |
| | | * http://docs.jquery.com/UI/Dialog#theming |
| | | */ |
| | | -.ui-dialog { position: absolute; padding: .2em; width: 300px; overflow: hidden; } |
| | | +.ui-dialog { position: absolute; padding: .2em; width: 300px; overflow: hidden; box-shadow: 1px 1px 18px #999; -moz-box-shadow: 1px 1px 12px #999; -webkit-box-shadow: #999 1px 1px 12px; } |
| | | .ui-dialog .ui-dialog-titlebar { padding: .4em 1em; position: relative; } |
| | | .ui-dialog .ui-dialog-title { float: left; margin: .1em 16px .1em 0; } |
| | | .ui-dialog .ui-dialog-titlebar-close { position: absolute; right: .3em; top: 50%; width: 19px; margin: -10px 0 0 0; padding: 1px; height: 18px; } |
| | | @@ -441,7 +449,7 @@ |
| | | .ui-dialog .ui-dialog-content { position: relative; border: 0; padding: .5em 1em; background: none; overflow: auto; zoom: 1; } |
| | | .ui-dialog .ui-dialog-buttonpane { text-align: left; border-width: 1px 0 0 0; background-image: none; margin: .5em 0 0 0; padding: .3em 1em .5em .4em; } |
| | | .ui-dialog .ui-dialog-buttonpane .ui-dialog-buttonset { float: right; } |
| | | -.ui-dialog .ui-dialog-buttonpane button { margin: .5em .4em .5em 0; cursor: pointer; } |
| | | +.ui-dialog .ui-dialog-buttonpane button { margin: .5em .4em .5em 0; cursor: default; } |
| | | .ui-dialog .ui-resizable-se { width: 14px; height: 14px; right: 3px; bottom: 3px; } |
| | | .ui-draggable .ui-dialog-titlebar { cursor: move; } |
| | | /* |
| | | @@ -478,13 +486,16 @@ |
| | | */ |
| | | .ui-tabs { position: relative; padding: .2em; zoom: 1; } /* position: relative prevents IE scroll bug (element with position: relative inside container with overflow: auto appear as "fixed") */ |
| | | .ui-tabs .ui-tabs-nav { margin: 0; padding: .2em .2em 0; } |
| | | -.ui-tabs .ui-tabs-nav li { list-style: none; float: left; position: relative; top: 1px; margin: 0 .2em 1px 0; border-bottom: 0 !important; padding: 0; white-space: nowrap; } |
| | | -.ui-tabs .ui-tabs-nav li a { float: left; padding: .5em 1em; text-decoration: none; } |
| | | +.ui-tabs .ui-tabs-nav li { list-style: none; float: left; position: relative; top: 1px; margin: 0 0 1px 0; border-bottom: 0 !important; padding: 0; white-space: nowrap; -moz-border-radius-topleft: 2px; -webkit-border-top-left-radius: 2px; border-top-left-radius: 2px; -moz-border-radius-topright: 2px; -webkit-border-top-right-radius: 2px; border-top-right-radius: 2px; } |
| | | +.ui-tabs .ui-tabs-nav li a { float: left; padding: .3em 1em; text-decoration: none; } |
| | | .ui-tabs .ui-tabs-nav li.ui-tabs-selected { margin-bottom: 0; padding-bottom: 1px; } |
| | | .ui-tabs .ui-tabs-nav li.ui-tabs-selected a, .ui-tabs .ui-tabs-nav li.ui-state-disabled a, .ui-tabs .ui-tabs-nav li.ui-state-processing a { cursor: text; } |
| | | .ui-tabs .ui-tabs-nav li a, .ui-tabs.ui-tabs-collapsible .ui-tabs-nav li.ui-tabs-selected a { cursor: pointer; } /* first selector in group seems obsolete, but required to overcome bug in Opera applying cursor: text overall if defined elsewhere... */ |
| | | .ui-tabs .ui-tabs-panel { display: block; border-width: 0; padding: 1em 1.4em; background: none; } |
| | | .ui-tabs .ui-tabs-hide { display: none !important; } |
| | | + |
| | | +.ui-dialog .ui-tabs .ui-tabs-nav li.ui-tabs-selected { background:#fff; } |
| | | + |
| | | /* |
| | | * jQuery UI Datepicker 1.8.18 |
| | | * |
| | | @@ -494,7 +505,7 @@ |
| | | * |
| | | * http://docs.jquery.com/UI/Datepicker#theming |
| | | */ |
| | | -.ui-datepicker { width: 17em; padding: .2em .2em 0; display: none; } |
| | | +.ui-datepicker { width: 17em; padding: .2em .2em 0; display: none; box-shadow: 1px 1px 18px #999; -moz-box-shadow: 1px 1px 12px #999; -webkit-box-shadow: #999 1px 1px 12px; } |
| | | .ui-datepicker .ui-datepicker-header { position:relative; padding:.2em 0; } |
| | | .ui-datepicker .ui-datepicker-prev, .ui-datepicker .ui-datepicker-next { position:absolute; top: 2px; width: 1.8em; height: 1.8em; } |
| | | .ui-datepicker .ui-datepicker-prev-hover, .ui-datepicker .ui-datepicker-next-hover { top: 1px; } |
| | | @@ -512,8 +523,9 @@ |
| | | .ui-datepicker th { padding: .7em .3em; text-align: center; font-weight: bold; border: 0; } |
| | | .ui-datepicker td { border: 0; padding: 1px; } |
| | | .ui-datepicker td span, .ui-datepicker td a { display: block; padding: .2em; text-align: right; text-decoration: none; } |
| | | +.ui-datepicker td.ui-datepicker-current-day .ui-state-active { background:#c33; border-color:#a22; color:#fff; } |
| | | .ui-datepicker .ui-datepicker-buttonpane { background-image: none; margin: .7em 0 0 0; padding:0 .2em; border-left: 0; border-right: 0; border-bottom: 0; } |
| | | -.ui-datepicker .ui-datepicker-buttonpane button { float: right; margin: .5em .2em .4em; cursor: pointer; padding: .2em .6em .3em .6em; width:auto; overflow:visible; } |
| | | +.ui-datepicker .ui-datepicker-buttonpane button { float: right; margin: .5em .2em .4em; cursor: default; padding: .2em .6em .3em .6em; width:auto; overflow:visible; } |
| | | .ui-datepicker .ui-datepicker-buttonpane button.ui-datepicker-current { float:left; } |
| | | |
| | | /* with multiple calendars */ |
New file |
| | |
| | | /* |
| | | * jQuery UI CSS Framework 1.8.18 |
| | | * |
| | | * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) |
| | | * Dual licensed under the MIT or GPL Version 2 licenses. |
| | | * http://jquery.org/license |
| | | * |
| | | * http://docs.jquery.com/UI/Theming/API |
| | | */ |
| | | |
| | | /* Layout helpers |
| | | ----------------------------------*/ |
| | | .ui-helper-hidden { display: none; } |
| | | .ui-helper-hidden-accessible { position: absolute !important; clip: rect(1px 1px 1px 1px); clip: rect(1px,1px,1px,1px); } |
| | | .ui-helper-reset { margin: 0; padding: 0; border: 0; outline: 0; line-height: 1.3; text-decoration: none; font-size: 100%; list-style: none; } |
| | | .ui-helper-clearfix:before, .ui-helper-clearfix:after { content: ""; display: table; } |
| | | .ui-helper-clearfix:after { clear: both; } |
| | | .ui-helper-clearfix { zoom: 1; } |
| | | .ui-helper-zfix { width: 100%; height: 100%; top: 0; left: 0; position: absolute; opacity: 0; filter:Alpha(Opacity=0); } |
| | | |
| | | |
| | | /* Interaction Cues |
| | | ----------------------------------*/ |
| | | .ui-state-disabled { cursor: default !important; } |
| | | |
| | | |
| | | /* Icons |
| | | ----------------------------------*/ |
| | | |
| | | /* states and images */ |
| | | .ui-icon { display: block; text-indent: -99999px; overflow: hidden; background-repeat: no-repeat; } |
| | | |
| | | |
| | | /* Misc visuals |
| | | ----------------------------------*/ |
| | | |
| | | /* Overlays */ |
| | | .ui-widget-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; } |
| | | |
| | | |
| | | /* |
| | | * jQuery UI CSS Framework 1.8.18 |
| | | * |
| | | * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) |
| | | * Dual licensed under the MIT or GPL Version 2 licenses. |
| | | * http://jquery.org/license |
| | | * |
| | | * http://docs.jquery.com/UI/Theming/API |
| | | * |
| | | * To view and modify this theme, visit http://jqueryui.com/themeroller/?ffDefault=Lucida%20Grande,Verdana,Arial,sans-serif&fwDefault=bold&fsDefault=1.0em&cornerRadius=5px&bgColorHeader=e4e4e4&bgTextureHeader=03_highlight_soft.png&bgImgOpacityHeader=90&borderColorHeader=fafafa&fcHeader=666666&iconColorHeader=004458&bgColorContent=fafafa&bgTextureContent=03_highlight_soft.png&bgImgOpacityContent=75&borderColorContent=aaaaaa&fcContent=33333&iconColorContent=004458&bgColorDefault=f8f8f8&bgTextureDefault=04_highlight_hard.png&bgImgOpacityDefault=75&borderColorDefault=cccccc&fcDefault=666666&iconColorDefault=004458&bgColorHover=eaeaea&bgTextureHover=04_highlight_hard.png&bgImgOpacityHover=75&borderColorHover=aaaaaa&fcHover=333333&iconColorHover=004458&bgColorActive=ffffff&bgTextureActive=04_highlight_hard.png&bgImgOpacityActive=65&borderColorActive=aaaaaa&fcActive=333333&iconColorActive=004458&bgColorHighlight=b0ccd7&bgTextureHighlight=04_highlight_hard.png&bgImgOpacityHighlight=55&borderColorHighlight=a3a3a3&fcHighlight=004458&iconColorHighlight=004458&bgColorError=fef1ec&bgTextureError=01_flat.png&bgImgOpacityError=95&borderColorError=d7211e&fcError=d64040&iconColorError=d7211e&bgColorOverlay=333333&bgTextureOverlay=01_flat.png&bgImgOpacityOverlay=0&opacityOverlay=50&bgColorShadow=666666&bgTextureShadow=01_flat.png&bgImgOpacityShadow=0&opacityShadow=20&thicknessShadow=6px&offsetTopShadow=-6px&offsetLeftShadow=-6px&cornerRadiusShadow=8px |
| | | */ |
| | | |
| | | |
| | | /* Component containers |
| | | ----------------------------------*/ |
| | | .ui-widget { font-family: Lucida Grande,Verdana,Arial,sans-serif; font-size: 1.0em; } |
| | | .ui-widget .ui-widget { font-size: 1em; } |
| | | .ui-widget input, .ui-widget select, .ui-widget textarea, .ui-widget button { font-family: Lucida Grande,Verdana,Arial,sans-serif; font-size: 1em; } |
| | | .ui-widget-content { border: 0; background: #fafafa url(images/ui-bg_highlight-soft_75_fafafa_1x100.png) 50% top repeat-x; color: #333; } |
| | | /*.ui-widget-content a { color: #333; }*/ |
| | | .ui-widget-header { border: 2px solid #fafafa; background: #e4e4e4 url(images/ui-bg_highlight-soft_90_e4e4e4_1x100.png) 50% 50% repeat-x; color: #666666; font-weight: bold; } |
| | | .ui-widget-header a { color: #aaaaaa; } |
| | | |
| | | /* Interaction states |
| | | ----------------------------------*/ |
| | | .ui-state-default, .ui-widget-content .ui-state-default, .ui-widget-header .ui-state-default { border: 1px solid #cccccc; background: #f8f8f8 url(images/ui-bg_highlight-hard_75_f8f8f8_1x100.png) 50% 50% repeat-x; font-weight: bold; color: #666666; } |
| | | .ui-state-default a, .ui-state-default a:link, .ui-state-default a:visited { color: #666666; text-decoration: none; } |
| | | .ui-state-hover, .ui-widget-content .ui-state-hover, .ui-widget-header .ui-state-hover, .ui-state-focus, .ui-widget-content .ui-state-focus, .ui-widget-header .ui-state-focus { border: 1px solid #aaaaaa; background: #eaeaea url(images/ui-bg_highlight-hard_75_eaeaea_1x100.png) 50% 50% repeat-x; font-weight: bold; color: #333333; } |
| | | .ui-state-hover a, .ui-state-hover a:hover { color: #333333; text-decoration: none; } |
| | | .ui-state-active, .ui-widget-content .ui-state-active, .ui-widget-header .ui-state-active { border: 1px solid #aaaaaa; background: #ffffff url(images/ui-bg_highlight-hard_65_ffffff_1x100.png) 50% 50% repeat-x; font-weight: bold; color: #333333; } |
| | | .ui-state-active a, .ui-state-active a:link, .ui-state-active a:visited { color: #333333; text-decoration: none; } |
| | | .ui-widget :active { outline: none; } |
| | | |
| | | /* Interaction Cues |
| | | ----------------------------------*/ |
| | | .ui-state-highlight, .ui-widget-content .ui-state-highlight, .ui-widget-header .ui-state-highlight {border: 1px solid #a3a3a3; background: #b0ccd7 url(images/ui-bg_highlight-hard_55_b0ccd7_1x100.png) 50% top repeat-x; color: #004458; } |
| | | .ui-state-highlight a, .ui-widget-content .ui-state-highlight a,.ui-widget-header .ui-state-highlight a { color: #004458; } |
| | | .ui-state-error, .ui-widget-content .ui-state-error, .ui-widget-header .ui-state-error {border: 1px solid #d7211e; background: #fef1ec; color: #d64040; } |
| | | .ui-state-error a, .ui-widget-content .ui-state-error a, .ui-widget-header .ui-state-error a { color: #d64040; } |
| | | .ui-state-error-text, .ui-widget-content .ui-state-error-text, .ui-widget-header .ui-state-error-text { color: #d64040; } |
| | | .ui-priority-primary, .ui-widget-content .ui-priority-primary, .ui-widget-header .ui-priority-primary { font-weight: bold; } |
| | | .ui-priority-secondary, .ui-widget-content .ui-priority-secondary, .ui-widget-header .ui-priority-secondary { opacity: .7; filter:Alpha(Opacity=70); font-weight: normal; } |
| | | .ui-state-disabled, .ui-widget-content .ui-state-disabled, .ui-widget-header .ui-state-disabled { opacity: .35; filter:Alpha(Opacity=35); background-image: none; } |
| | | |
| | | /* Icons |
| | | ----------------------------------*/ |
| | | |
| | | /* states and images */ |
| | | .ui-icon { width: 16px; height: 16px; background-image: url(images/ui-icons_004458_256x240.png); } |
| | | .ui-widget-content .ui-icon {background-image: url(images/ui-icons_004458_256x240.png); } |
| | | .ui-widget-header .ui-icon {background-image: url(images/ui-icons_004458_256x240.png); } |
| | | .ui-state-default .ui-icon { background-image: url(images/ui-icons_004458_256x240.png); } |
| | | .ui-state-hover .ui-icon, .ui-state-focus .ui-icon {background-image: url(images/ui-icons_004458_256x240.png); } |
| | | .ui-state-active .ui-icon {background-image: url(images/ui-icons_004458_256x240.png); } |
| | | .ui-state-highlight .ui-icon {background-image: url(images/ui-icons_004458_256x240.png); } |
| | | .ui-state-error .ui-icon, .ui-state-error-text .ui-icon {background-image: url(images/ui-icons_d7211e_256x240.png); } |
| | | |
| | | /* positioning */ |
| | | .ui-icon-carat-1-n { background-position: 0 0; } |
| | | .ui-icon-carat-1-ne { background-position: -16px 0; } |
| | | .ui-icon-carat-1-e { background-position: -32px 0; } |
| | | .ui-icon-carat-1-se { background-position: -48px 0; } |
| | | .ui-icon-carat-1-s { background-position: -64px 0; } |
| | | .ui-icon-carat-1-sw { background-position: -80px 0; } |
| | | .ui-icon-carat-1-w { background-position: -96px 0; } |
| | | .ui-icon-carat-1-nw { background-position: -112px 0; } |
| | | .ui-icon-carat-2-n-s { background-position: -128px 0; } |
| | | .ui-icon-carat-2-e-w { background-position: -144px 0; } |
| | | .ui-icon-triangle-1-n { background-position: 0 -16px; } |
| | | .ui-icon-triangle-1-ne { background-position: -16px -16px; } |
| | | .ui-icon-triangle-1-e { background-position: -32px -16px; } |
| | | .ui-icon-triangle-1-se { background-position: -48px -16px; } |
| | | .ui-icon-triangle-1-s { background-position: -64px -16px; } |
| | | .ui-icon-triangle-1-sw { background-position: -80px -16px; } |
| | | .ui-icon-triangle-1-w { background-position: -96px -16px; } |
| | | .ui-icon-triangle-1-nw { background-position: -112px -16px; } |
| | | .ui-icon-triangle-2-n-s { background-position: -128px -16px; } |
| | | .ui-icon-triangle-2-e-w { background-position: -144px -16px; } |
| | | .ui-icon-arrow-1-n { background-position: 0 -32px; } |
| | | .ui-icon-arrow-1-ne { background-position: -16px -32px; } |
| | | .ui-icon-arrow-1-e { background-position: -32px -32px; } |
| | | .ui-icon-arrow-1-se { background-position: -48px -32px; } |
| | | .ui-icon-arrow-1-s { background-position: -64px -32px; } |
| | | .ui-icon-arrow-1-sw { background-position: -80px -32px; } |
| | | .ui-icon-arrow-1-w { background-position: -96px -32px; } |
| | | .ui-icon-arrow-1-nw { background-position: -112px -32px; } |
| | | .ui-icon-arrow-2-n-s { background-position: -128px -32px; } |
| | | .ui-icon-arrow-2-ne-sw { background-position: -144px -32px; } |
| | | .ui-icon-arrow-2-e-w { background-position: -160px -32px; } |
| | | .ui-icon-arrow-2-se-nw { background-position: -176px -32px; } |
| | | .ui-icon-arrowstop-1-n { background-position: -192px -32px; } |
| | | .ui-icon-arrowstop-1-e { background-position: -208px -32px; } |
| | | .ui-icon-arrowstop-1-s { background-position: -224px -32px; } |
| | | .ui-icon-arrowstop-1-w { background-position: -240px -32px; } |
| | | .ui-icon-arrowthick-1-n { background-position: 0 -48px; } |
| | | .ui-icon-arrowthick-1-ne { background-position: -16px -48px; } |
| | | .ui-icon-arrowthick-1-e { background-position: -32px -48px; } |
| | | .ui-icon-arrowthick-1-se { background-position: -48px -48px; } |
| | | .ui-icon-arrowthick-1-s { background-position: -64px -48px; } |
| | | .ui-icon-arrowthick-1-sw { background-position: -80px -48px; } |
| | | .ui-icon-arrowthick-1-w { background-position: -96px -48px; } |
| | | .ui-icon-arrowthick-1-nw { background-position: -112px -48px; } |
| | | .ui-icon-arrowthick-2-n-s { background-position: -128px -48px; } |
| | | .ui-icon-arrowthick-2-ne-sw { background-position: -144px -48px; } |
| | | .ui-icon-arrowthick-2-e-w { background-position: -160px -48px; } |
| | | .ui-icon-arrowthick-2-se-nw { background-position: -176px -48px; } |
| | | .ui-icon-arrowthickstop-1-n { background-position: -192px -48px; } |
| | | .ui-icon-arrowthickstop-1-e { background-position: -208px -48px; } |
| | | .ui-icon-arrowthickstop-1-s { background-position: -224px -48px; } |
| | | .ui-icon-arrowthickstop-1-w { background-position: -240px -48px; } |
| | | .ui-icon-arrowreturnthick-1-w { background-position: 0 -64px; } |
| | | .ui-icon-arrowreturnthick-1-n { background-position: -16px -64px; } |
| | | .ui-icon-arrowreturnthick-1-e { background-position: -32px -64px; } |
| | | .ui-icon-arrowreturnthick-1-s { background-position: -48px -64px; } |
| | | .ui-icon-arrowreturn-1-w { background-position: -64px -64px; } |
| | | .ui-icon-arrowreturn-1-n { background-position: -80px -64px; } |
| | | .ui-icon-arrowreturn-1-e { background-position: -96px -64px; } |
| | | .ui-icon-arrowreturn-1-s { background-position: -112px -64px; } |
| | | .ui-icon-arrowrefresh-1-w { background-position: -128px -64px; } |
| | | .ui-icon-arrowrefresh-1-n { background-position: -144px -64px; } |
| | | .ui-icon-arrowrefresh-1-e { background-position: -160px -64px; } |
| | | .ui-icon-arrowrefresh-1-s { background-position: -176px -64px; } |
| | | .ui-icon-arrow-4 { background-position: 0 -80px; } |
| | | .ui-icon-arrow-4-diag { background-position: -16px -80px; } |
| | | .ui-icon-extlink { background-position: -32px -80px; } |
| | | .ui-icon-newwin { background-position: -48px -80px; } |
| | | .ui-icon-refresh { background-position: -64px -80px; } |
| | | .ui-icon-shuffle { background-position: -80px -80px; } |
| | | .ui-icon-transfer-e-w { background-position: -96px -80px; } |
| | | .ui-icon-transferthick-e-w { background-position: -112px -80px; } |
| | | .ui-icon-folder-collapsed { background-position: 0 -96px; } |
| | | .ui-icon-folder-open { background-position: -16px -96px; } |
| | | .ui-icon-document { background-position: -32px -96px; } |
| | | .ui-icon-document-b { background-position: -48px -96px; } |
| | | .ui-icon-note { background-position: -64px -96px; } |
| | | .ui-icon-mail-closed { background-position: -80px -96px; } |
| | | .ui-icon-mail-open { background-position: -96px -96px; } |
| | | .ui-icon-suitcase { background-position: -112px -96px; } |
| | | .ui-icon-comment { background-position: -128px -96px; } |
| | | .ui-icon-person { background-position: -144px -96px; } |
| | | .ui-icon-print { background-position: -160px -96px; } |
| | | .ui-icon-trash { background-position: -176px -96px; } |
| | | .ui-icon-locked { background-position: -192px -96px; } |
| | | .ui-icon-unlocked { background-position: -208px -96px; } |
| | | .ui-icon-bookmark { background-position: -224px -96px; } |
| | | .ui-icon-tag { background-position: -240px -96px; } |
| | | .ui-icon-home { background-position: 0 -112px; } |
| | | .ui-icon-flag { background-position: -16px -112px; } |
| | | .ui-icon-calendar { background-position: -32px -112px; } |
| | | .ui-icon-cart { background-position: -48px -112px; } |
| | | .ui-icon-pencil { background-position: -64px -112px; } |
| | | .ui-icon-clock { background-position: -80px -112px; } |
| | | .ui-icon-disk { background-position: -96px -112px; } |
| | | .ui-icon-calculator { background-position: -112px -112px; } |
| | | .ui-icon-zoomin { background-position: -128px -112px; } |
| | | .ui-icon-zoomout { background-position: -144px -112px; } |
| | | .ui-icon-search { background-position: -160px -112px; } |
| | | .ui-icon-wrench { background-position: -176px -112px; } |
| | | .ui-icon-gear { background-position: -192px -112px; } |
| | | .ui-icon-heart { background-position: -208px -112px; } |
| | | .ui-icon-star { background-position: -224px -112px; } |
| | | .ui-icon-link { background-position: -240px -112px; } |
| | | .ui-icon-cancel { background-position: 0 -128px; } |
| | | .ui-icon-plus { background-position: -16px -128px; } |
| | | .ui-icon-plusthick { background-position: -32px -128px; } |
| | | .ui-icon-minus { background-position: -48px -128px; } |
| | | .ui-icon-minusthick { background-position: -64px -128px; } |
| | | .ui-icon-close { background-position: -80px -128px; } |
| | | .ui-icon-closethick { background-position: -96px -128px; } |
| | | .ui-icon-key { background-position: -112px -128px; } |
| | | .ui-icon-lightbulb { background-position: -128px -128px; } |
| | | .ui-icon-scissors { background-position: -144px -128px; } |
| | | .ui-icon-clipboard { background-position: -160px -128px; } |
| | | .ui-icon-copy { background-position: -176px -128px; } |
| | | .ui-icon-contact { background-position: -192px -128px; } |
| | | .ui-icon-image { background-position: -208px -128px; } |
| | | .ui-icon-video { background-position: -224px -128px; } |
| | | .ui-icon-script { background-position: -240px -128px; } |
| | | .ui-icon-alert { background-position: 0 -144px; } |
| | | .ui-icon-info { background-position: -16px -144px; } |
| | | .ui-icon-notice { background-position: -32px -144px; } |
| | | .ui-icon-help { background-position: -48px -144px; } |
| | | .ui-icon-check { background-position: -64px -144px; } |
| | | .ui-icon-bullet { background-position: -80px -144px; } |
| | | .ui-icon-radio-off { background-position: -96px -144px; } |
| | | .ui-icon-radio-on { background-position: -112px -144px; } |
| | | .ui-icon-pin-w { background-position: -128px -144px; } |
| | | .ui-icon-pin-s { background-position: -144px -144px; } |
| | | .ui-icon-play { background-position: 0 -160px; } |
| | | .ui-icon-pause { background-position: -16px -160px; } |
| | | .ui-icon-seek-next { background-position: -32px -160px; } |
| | | .ui-icon-seek-prev { background-position: -48px -160px; } |
| | | .ui-icon-seek-end { background-position: -64px -160px; } |
| | | .ui-icon-seek-start { background-position: -80px -160px; } |
| | | /* ui-icon-seek-first is deprecated, use ui-icon-seek-start instead */ |
| | | .ui-icon-seek-first { background-position: -80px -160px; } |
| | | .ui-icon-stop { background-position: -96px -160px; } |
| | | .ui-icon-eject { background-position: -112px -160px; } |
| | | .ui-icon-volume-off { background-position: -128px -160px; } |
| | | .ui-icon-volume-on { background-position: -144px -160px; } |
| | | .ui-icon-power { background-position: 0 -176px; } |
| | | .ui-icon-signal-diag { background-position: -16px -176px; } |
| | | .ui-icon-signal { background-position: -32px -176px; } |
| | | .ui-icon-battery-0 { background-position: -48px -176px; } |
| | | .ui-icon-battery-1 { background-position: -64px -176px; } |
| | | .ui-icon-battery-2 { background-position: -80px -176px; } |
| | | .ui-icon-battery-3 { background-position: -96px -176px; } |
| | | .ui-icon-circle-plus { background-position: 0 -192px; } |
| | | .ui-icon-circle-minus { background-position: -16px -192px; } |
| | | .ui-icon-circle-close { background-position: -32px -192px; } |
| | | .ui-icon-circle-triangle-e { background-position: -48px -192px; } |
| | | .ui-icon-circle-triangle-s { background-position: -64px -192px; } |
| | | .ui-icon-circle-triangle-w { background-position: -80px -192px; } |
| | | .ui-icon-circle-triangle-n { background-position: -96px -192px; } |
| | | .ui-icon-circle-arrow-e { background-position: -112px -192px; } |
| | | .ui-icon-circle-arrow-s { background-position: -128px -192px; } |
| | | .ui-icon-circle-arrow-w { background-position: -144px -192px; } |
| | | .ui-icon-circle-arrow-n { background-position: -160px -192px; } |
| | | .ui-icon-circle-zoomin { background-position: -176px -192px; } |
| | | .ui-icon-circle-zoomout { background-position: -192px -192px; } |
| | | .ui-icon-circle-check { background-position: -208px -192px; } |
| | | .ui-icon-circlesmall-plus { background-position: 0 -208px; } |
| | | .ui-icon-circlesmall-minus { background-position: -16px -208px; } |
| | | .ui-icon-circlesmall-close { background-position: -32px -208px; } |
| | | .ui-icon-squaresmall-plus { background-position: -48px -208px; } |
| | | .ui-icon-squaresmall-minus { background-position: -64px -208px; } |
| | | .ui-icon-squaresmall-close { background-position: -80px -208px; } |
| | | .ui-icon-grip-dotted-vertical { background-position: 0 -224px; } |
| | | .ui-icon-grip-dotted-horizontal { background-position: -16px -224px; } |
| | | .ui-icon-grip-solid-vertical { background-position: -32px -224px; } |
| | | .ui-icon-grip-solid-horizontal { background-position: -48px -224px; } |
| | | .ui-icon-gripsmall-diagonal-se { background-position: -64px -224px; } |
| | | .ui-icon-grip-diagonal-se { background-position: -80px -224px; } |
| | | |
| | | |
| | | /* Misc visuals |
| | | ----------------------------------*/ |
| | | |
| | | /* Corner radius */ |
| | | .ui-corner-all, .ui-corner-top, .ui-corner-left, .ui-corner-tl { -moz-border-radius-topleft: 5px; -webkit-border-top-left-radius: 5px; -khtml-border-top-left-radius: 5px; border-top-left-radius: 5px; } |
| | | .ui-corner-all, .ui-corner-top, .ui-corner-right, .ui-corner-tr { -moz-border-radius-topright: 5px; -webkit-border-top-right-radius: 5px; -khtml-border-top-right-radius: 5px; border-top-right-radius: 5px; } |
| | | .ui-corner-all, .ui-corner-bottom, .ui-corner-left, .ui-corner-bl { -moz-border-radius-bottomleft: 5px; -webkit-border-bottom-left-radius: 5px; -khtml-border-bottom-left-radius: 5px; border-bottom-left-radius: 5px; } |
| | | .ui-corner-all, .ui-corner-bottom, .ui-corner-right, .ui-corner-br { -moz-border-radius-bottomright: 5px; -webkit-border-bottom-right-radius: 5px; -khtml-border-bottom-right-radius: 5px; border-bottom-right-radius: 5px; } |
| | | |
| | | /* Overlays */ |
| | | .ui-widget-overlay { background: #333333; opacity: .50;filter:Alpha(Opacity=50); } |
| | | .ui-widget-shadow { visibility: hidden; }/* |
| | | * jQuery UI Resizable 1.8.18 |
| | | * |
| | | * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) |
| | | * Dual licensed under the MIT or GPL Version 2 licenses. |
| | | * http://jquery.org/license |
| | | * |
| | | * http://docs.jquery.com/UI/Resizable#theming |
| | | */ |
| | | .ui-resizable { position: relative;} |
| | | .ui-resizable-handle { position: absolute;font-size: 0.1px;z-index: 99998; display: block; } |
| | | .ui-resizable-disabled .ui-resizable-handle, .ui-resizable-autohide .ui-resizable-handle { display: none; } |
| | | .ui-resizable-n { cursor: n-resize; height: 7px; width: 100%; top: -5px; left: 0; } |
| | | .ui-resizable-s { cursor: s-resize; height: 7px; width: 100%; bottom: -5px; left: 0; } |
| | | .ui-resizable-e { cursor: e-resize; width: 7px; right: -5px; top: 0; height: 100%; } |
| | | .ui-resizable-w { cursor: w-resize; width: 7px; left: -5px; top: 0; height: 100%; } |
| | | .ui-resizable-se { cursor: se-resize; width: 12px; height: 12px; right: 1px; bottom: 1px; } |
| | | .ui-resizable-sw { cursor: sw-resize; width: 9px; height: 9px; left: -5px; bottom: -5px; } |
| | | .ui-resizable-nw { cursor: nw-resize; width: 9px; height: 9px; left: -5px; top: -5px; } |
| | | .ui-resizable-ne { cursor: ne-resize; width: 9px; height: 9px; right: -5px; top: -5px;}/* |
| | | * jQuery UI Selectable 1.8.18 |
| | | * |
| | | * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) |
| | | * Dual licensed under the MIT or GPL Version 2 licenses. |
| | | * http://jquery.org/license |
| | | * |
| | | * http://docs.jquery.com/UI/Selectable#theming |
| | | */ |
| | | .ui-selectable-helper { position: absolute; z-index: 100; border:1px dotted black; } |
| | | /* |
| | | * jQuery UI Accordion 1.8.18 |
| | | * |
| | | * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) |
| | | * Dual licensed under the MIT or GPL Version 2 licenses. |
| | | * http://jquery.org/license |
| | | * |
| | | * http://docs.jquery.com/UI/Accordion#theming |
| | | */ |
| | | /* IE/Win - Fix animation bug - #4615 */ |
| | | .ui-accordion { width: 100%; } |
| | | .ui-accordion .ui-accordion-header { cursor: pointer; position: relative; margin-top: 1px; zoom: 1; } |
| | | .ui-accordion .ui-accordion-li-fix { display: inline; } |
| | | .ui-accordion .ui-accordion-header-active { border-bottom: 0 !important; } |
| | | .ui-accordion .ui-accordion-header a { display: block; font-size: 1em; padding: .5em .5em .5em .7em; } |
| | | .ui-accordion-icons .ui-accordion-header a { padding-left: 2.2em; } |
| | | .ui-accordion .ui-accordion-header .ui-icon { position: absolute; left: .5em; top: 50%; margin-top: -8px; } |
| | | .ui-accordion .ui-accordion-content { padding: 1em 2.2em; border-top: 0; margin-top: -2px; position: relative; top: 1px; margin-bottom: 2px; overflow: auto; display: none; zoom: 1; } |
| | | .ui-accordion .ui-accordion-content-active { display: block; } |
| | | /* |
| | | * jQuery UI Autocomplete 1.8.18 |
| | | * |
| | | * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) |
| | | * Dual licensed under the MIT or GPL Version 2 licenses. |
| | | * http://jquery.org/license |
| | | * |
| | | * http://docs.jquery.com/UI/Autocomplete#theming |
| | | */ |
| | | .ui-autocomplete { position: absolute; cursor: default; } |
| | | |
| | | /* workarounds */ |
| | | * html .ui-autocomplete { width:1px; } /* without this, the menu expands to 100% in IE6 */ |
| | | |
| | | /* |
| | | * jQuery UI Menu 1.8.18 |
| | | * |
| | | * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about) |
| | | * Dual licensed under the MIT or GPL Version 2 licenses. |
| | | * http://jquery.org/license |
| | | * |
| | | * http://docs.jquery.com/UI/Menu#theming |
| | | */ |
| | | .ui-menu { |
| | | list-style:none; |
| | | padding: 0; |
| | | margin: 0; |
| | | display:block; |
| | | float: left; |
| | | background: #444; |
| | | border: 1px solid #999; |
| | | border-radius: 4px; |
| | | box-shadow: 0 2px 6px 0 #333; |
| | | -moz-box-shadow: 0 2px 6px 0 #333; |
| | | -webkit-box-shadow: 0 2px 6px 0 #333; |
| | | -o-box-shadow: 0 2px 6px 0 #333; |
| | | } |
| | | .ui-menu .ui-menu { |
| | | margin-top: -3px; |
| | | } |
| | | .ui-menu .ui-menu-item { |
| | | margin:0; |
| | | padding: 0; |
| | | zoom: 1; |
| | | float: left; |
| | | clear: left; |
| | | width: 100%; |
| | | color: #fff; |
| | | white-space: nowrap; |
| | | border-top: 1px solid #5a5a5a; |
| | | border-bottom: 1px solid #333; |
| | | } |
| | | .ui-menu .ui-menu-item:first-child { |
| | | border-top: 0; |
| | | } |
| | | .ui-menu .ui-menu-item:last-child { |
| | | border-bottom: 0; |
| | | } |
| | | .ui-menu .ui-menu-item a { |
| | | text-decoration:none; |
| | | display:block; |
| | | padding:.2em .4em; |
| | | line-height:1.5; |
| | | zoom:1; |
| | | border:0; |
| | | margin:0; |
| | | border-radius:0; |
| | | color: #fff; |
| | | text-shadow: 0px 1px 1px #333; |
| | | padding: 6px 10px 4px 10px; |
| | | } |
| | | .ui-menu .ui-menu-item a.ui-state-hover, |
| | | .ui-menu .ui-menu-item a.ui-state-active { |
| | | font-weight: normal; |
| | | background: #00aad6; |
| | | background: -moz-linear-gradient(top, #00aad6 0%, #008fc9 100%); |
| | | background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#00aad6), color-stop(100%,#008fc9)); |
| | | background: -o-linear-gradient(top, #00aad6 0%, #008fc9 100%); |
| | | background: -ms-linear-gradient(top, #00aad6 0%, #008fc9 100%); |
| | | background: linear-gradient(top, #00aad6 0%, #008fc9 100%); |
| | | } |
| | | /* |
| | | * jQuery UI Button 1.8.18 |
| | | * |
| | | * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) |
| | | * Dual licensed under the MIT or GPL Version 2 licenses. |
| | | * http://jquery.org/license |
| | | * |
| | | * http://docs.jquery.com/UI/Button#theming |
| | | */ |
| | | .ui-button { display: inline-block; position: relative; padding: 0; margin-right: .1em; text-decoration: none !important; cursor: pointer; text-align: center; zoom: 1; overflow: visible; *overflow: visible; } /* the overflow property removes extra width in IE */ |
| | | .ui-button-icon-only { width: 2.2em; } /* to make room for the icon, a width needs to be set here */ |
| | | button.ui-button-icon-only { width: 2.4em; } /* button elements seem to need a little more width */ |
| | | .ui-button-icons-only { width: 3.4em; } |
| | | button.ui-button-icons-only { width: 3.7em; } |
| | | |
| | | /*button text element */ |
| | | .ui-button .ui-button-text { display: block; line-height: 1.4; } |
| | | .ui-button-text-only .ui-button-text { padding: .4em 1em; } |
| | | .ui-button-icon-only .ui-button-text, .ui-button-icons-only .ui-button-text { padding: .4em; text-indent: -9999999px; } |
| | | .ui-button-text-icon-primary .ui-button-text, .ui-button-text-icons .ui-button-text { padding: .4em 1em .4em 2.1em; } |
| | | .ui-button-text-icon-secondary .ui-button-text, .ui-button-text-icons .ui-button-text { padding: .4em 2.1em .4em 1em; } |
| | | .ui-button-text-icons .ui-button-text { padding-left: 2.1em; padding-right: 2.1em; } |
| | | /* no icon support for input elements, provide padding by default */ |
| | | input.ui-button { padding: .4em 1em; } |
| | | |
| | | /*button icon element(s) */ |
| | | .ui-button-icon-only .ui-icon, .ui-button-text-icon-primary .ui-icon, .ui-button-text-icon-secondary .ui-icon, .ui-button-text-icons .ui-icon, .ui-button-icons-only .ui-icon { position: absolute; top: 50%; margin-top: -8px; } |
| | | .ui-button-icon-only .ui-icon { left: 50%; margin-left: -8px; } |
| | | .ui-button-text-icon-primary .ui-button-icon-primary, .ui-button-text-icons .ui-button-icon-primary, .ui-button-icons-only .ui-button-icon-primary { left: .5em; } |
| | | .ui-button-text-icon-secondary .ui-button-icon-secondary, .ui-button-text-icons .ui-button-icon-secondary, .ui-button-icons-only .ui-button-icon-secondary { right: .5em; } |
| | | .ui-button-text-icons .ui-button-icon-secondary, .ui-button-icons-only .ui-button-icon-secondary { right: .5em; } |
| | | |
| | | /*button sets*/ |
| | | .ui-buttonset { margin-right: 7px; } |
| | | .ui-buttonset .ui-button { margin-left: 0; margin-right: -.3em; } |
| | | |
| | | /* workarounds */ |
| | | button.ui-button::-moz-focus-inner { border: 0; padding: 0; } /* reset extra padding in Firefox */ |
| | | |
| | | /* Roundcube button styling */ |
| | | .ui-button.ui-state-default { |
| | | display: inline-block; |
| | | margin: 0 2px; |
| | | padding: 1px 2px; |
| | | text-shadow: 0px 1px 1px #fff; |
| | | border: 1px solid #c6c6c6; |
| | | border-radius: 4px; |
| | | background: #f7f7f7; |
| | | background: -moz-linear-gradient(top, #f9f9f9 0%, #e6e6e6 100%); |
| | | background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#f9f9f9), color-stop(100%,#e6e6e6)); |
| | | background: -o-linear-gradient(top, #f9f9f9 0%, #e6e6e6 100%); |
| | | background: -ms-linear-gradient(top, #f9f9f9 0%, #e6e6e6 100%); |
| | | background: linear-gradient(top, #f9f9f9 0%, #e6e6e6 100%); |
| | | box-shadow: 0 1px 1px 0 rgba(140, 140, 140, 0.3); |
| | | -o-box-shadow: 0 1px 1px 0 rgba(140, 140, 140, 0.3); |
| | | -webkit-box-shadow: 0 1px 1px 0 rgba(140, 140, 140, 0.3); |
| | | -moz-box-shadow: 0 1px 1px 0 rgba(140, 140, 140, 0.3); |
| | | text-decoration: none; |
| | | outline: none; |
| | | } |
| | | |
| | | .ui-button.ui-state-focus { |
| | | color: #525252; |
| | | border-color: #4fadd5; |
| | | box-shadow: 0 0 2px 1px rgba(71,135,177, 0.6); |
| | | -moz-box-shadow: 0 0 2px 1px rgba(71,135,177, 0.6); |
| | | -webkit-box-shadow: 0 0 2px 1px rgba(71,135,177, 0.6); |
| | | -o-box-shadow: 0 0 2px 1px rgba(71,135,177, 0.6); |
| | | } |
| | | |
| | | .ui-button.ui-state-active { |
| | | color: #525252; |
| | | border-color: #aaa; |
| | | background: #e6e6e6; |
| | | background: -moz-linear-gradient(top, #e6e6e6 0%, #f9f9f9 100%); |
| | | background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#e6e6e6), color-stop(100%,#f9f9f9)); |
| | | background: -o-linear-gradient(top, #e6e6e6 0%, #f9f9f9 100%); |
| | | background: -ms-linear-gradient(top, #e6e6e6 0%, #f9f9f9 100%); |
| | | background: linear-gradient(top, #e6e6e6 0%, #f9f9f9 100%); |
| | | |
| | | } |
| | | |
| | | /* |
| | | * jQuery UI Dialog 1.8.18 |
| | | * |
| | | * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) |
| | | * Dual licensed under the MIT or GPL Version 2 licenses. |
| | | * http://jquery.org/license |
| | | * |
| | | * http://docs.jquery.com/UI/Dialog#theming |
| | | */ |
| | | .ui-dialog { position: absolute; padding: 3px; width: 300px; background: #fff; border-radius:6px; box-shadow: 1px 1px 18px #666; -moz-box-shadow: 1px 1px 12px #666; -webkit-box-shadow: #666 1px 1px 12px; } |
| | | .ui-dialog .ui-dialog-titlebar { padding: 15px 1em 8px 1em; position: relative; border: 0; border-radius: 5px 5px 0 0; } |
| | | .ui-dialog .ui-dialog-title { float: left; margin: .1em 16px .1em 0; font-size: 1.3em; text-shadow: 1px 1px 1px #fff; } |
| | | .ui-dialog .ui-dialog-titlebar-close { position: absolute; right: -15px; top: -15px; margin:0; width: 30px; height: 30px; z-index:99999; } |
| | | .ui-dialog .ui-dialog-titlebar-close span { display: block; margin: 0; background: url(images/ui-dialog-close.png) 0 0 no-repeat; width: 30px; height: 30px; } |
| | | .ui-dialog .ui-dialog-titlebar-close:hover, .ui-dialog .ui-dialog-titlebar-close:focus { border: 0; background: none; padding: 0; } |
| | | .ui-dialog .ui-dialog-content { position: relative; border: 0; padding: 1.5em 1em 0.5em 1em; overflow: auto; zoom: 1; } |
| | | .ui-dialog .ui-dialog-buttonpane { text-align: left; border-width: 1px 0 0 0; border-color: #ddd; border-style: solid; background-image: none; margin: 0; padding: .4em 1em .5em 1em; box-shadow: inset 0 1px 0 0 #fff; -o-box-shadow: inset 0 1px 0 0 #fff; -webkit-box-shadow: inset 0 1px 0 0 #fff; -moz-box-shadow: inset 0 1px 0 0 #fff; } |
| | | .ui-dialog .ui-dialog-buttonpane .ui-dialog-buttonset { float: left; } |
| | | .ui-dialog .ui-dialog-buttonpane button { margin: .5em .4em .5em 0; cursor: pointer; } |
| | | .ui-dialog .ui-resizable-se { width: 14px; height: 14px; right: 3px; bottom: 3px; } |
| | | .ui-draggable .ui-dialog-titlebar { cursor: move; } |
| | | /* |
| | | * jQuery UI Slider 1.8.18 |
| | | * |
| | | * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) |
| | | * Dual licensed under the MIT or GPL Version 2 licenses. |
| | | * http://jquery.org/license |
| | | * |
| | | * http://docs.jquery.com/UI/Slider#theming |
| | | */ |
| | | .ui-slider { position: relative; text-align: left; } |
| | | .ui-slider .ui-slider-handle { position: absolute; z-index: 2; width: 1.2em; height: 1.2em; cursor: default; } |
| | | .ui-slider .ui-slider-range { position: absolute; z-index: 1; font-size: .7em; display: block; border: 0; |
| | | border-radius: 5px; |
| | | background: #019bc6; |
| | | background: -moz-linear-gradient(top, #019bc6 0%, #017cb4 100%); |
| | | background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#019bc6), color-stop(100%,#017cb4)); |
| | | background: -o-linear-gradient(top, #019bc6 0%, #017cb4 100%); |
| | | background: -ms-linear-gradient(top, #019bc6 0%, #017cb4 100%); |
| | | background: linear-gradient(top, #019bc6 0%, #017cb4 100%); |
| | | }; |
| | | |
| | | .ui-slider-horizontal { height: .8em; } |
| | | .ui-slider-horizontal .ui-slider-handle { top: -.3em; margin-left: -.6em; } |
| | | .ui-slider-horizontal .ui-slider-range { top: 0; height: 100%; } |
| | | .ui-slider-horizontal .ui-slider-range-min { left: 0; } |
| | | .ui-slider-horizontal .ui-slider-range-max { right: 0; } |
| | | |
| | | .ui-slider-vertical { width: .8em; height: 100px; } |
| | | .ui-slider-vertical .ui-slider-handle { left: -.3em; margin-left: 0; margin-bottom: -.6em; } |
| | | .ui-slider-vertical .ui-slider-range { left: 0; width: 100%; } |
| | | .ui-slider-vertical .ui-slider-range-min { bottom: 0; } |
| | | .ui-slider-vertical .ui-slider-range-max { top: 0; }/* |
| | | * jQuery UI Tabs 1.8.18 |
| | | * |
| | | * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) |
| | | * Dual licensed under the MIT or GPL Version 2 licenses. |
| | | * http://jquery.org/license |
| | | * |
| | | * http://docs.jquery.com/UI/Tabs#theming |
| | | */ |
| | | .ui-tabs { position: relative; padding: .2em; zoom: 1; } /* position: relative prevents IE scroll bug (element with position: relative inside container with overflow: auto appear as "fixed") */ |
| | | .ui-tabs .ui-tabs-nav { margin: 0; padding: 0; border: 0; background: transparent; height: 44px; } |
| | | .ui-tabs .ui-tabs-nav li { list-style: none; display: inline; border: 0; border-radius: 0; margin: 0; border-bottom: 0 !important; padding: 15px 1px 15px 0; white-space: nowrap; background: #f8f8f8; background: -moz-linear-gradient(top, #f8f8f8 0%, #d3d3d3 50%, #f8f8f8 100%); background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#f8f8f8), color-stop(50%,#d3d3d3), color-stop(100%,#f8f8f8)); background: -webkit-linear-gradient(top, #f8f8f8 0%, #d3d3d3 50%, #f8f8f8 100%); background: -o-linear-gradient(top, #f8f8f8 0%, #d3d3d3 50%, #f8f8f8 100%); background: -ms-linear-gradient(top, #f8f8f8 0%, #d3d3d3 50%, #f8f8f8 100%); background: linear-gradient(top, #f8f8f8 0%, #d3d3d3 50%, #f8f8f8 100%); } |
| | | .ui-tabs .ui-tabs-nav li a { display: inline-block; padding: 15px; text-decoration: none; font-size: 12px; color: #999; background: #fafafa; border-right: 1px solid #fafafa; } |
| | | .ui-dialog-content .tabsbar .tablink a { background: #fafafa; } |
| | | .ui-tabs .ui-tabs-nav li.ui-tabs-selected { } |
| | | .ui-tabs .ui-tabs-nav li.ui-tabs-selected a, .ui-dialog-content .tabsbar .tablink.selected a { color: #004458; background: #efefef; background: -moz-linear-gradient(top, #fafafa 40%, #e4e4e4 100%); background: -webkit-gradient(linear, left top, left bottom, color-stop(40%,#fff), color-stop(100%,#e4e4e4)); background: -o-linear-gradient(top, #fafafa 40%, #e4e4e4 100%); background: -ms-linear-gradient(top, #fafafa 40%, #e4e4e4 100%); background: linear-gradient(top, #fafafa 40%, #e4e4e4 100%); } |
| | | .ui-tabs .ui-tabs-nav li.ui-tabs-selected a, .ui-tabs .ui-tabs-nav li.ui-state-disabled a, .ui-tabs .ui-tabs-nav li.ui-state-processing a { cursor: text; } |
| | | .ui-tabs .ui-tabs-nav li:last-child { background: none; } |
| | | .ui-tabs .ui-tabs-nav li:last-child a { border: 0; } |
| | | .ui-tabs .ui-tabs-nav li a, .ui-tabs.ui-tabs-collapsible .ui-tabs-nav li.ui-tabs-selected a { cursor: pointer; } /* first selector in group seems obsolete, but required to overcome bug in Opera applying cursor: text overall if defined elsewhere... */ |
| | | .ui-tabs .ui-tabs-panel { display: block; border-width: 0; padding: 0.5em 1em; margin-top: 0.5em; background: #efefef; } |
| | | .ui-tabs .ui-tabs-hide { display: none !important; } |
| | | /* |
| | | * jQuery UI Datepicker 1.8.18 |
| | | * |
| | | * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) |
| | | * Dual licensed under the MIT or GPL Version 2 licenses. |
| | | * http://jquery.org/license |
| | | * |
| | | * http://docs.jquery.com/UI/Datepicker#theming |
| | | */ |
| | | .ui-datepicker { min-width: 18em; padding: 0; display: none; border: 0; border-radius: 3px; box-shadow: 1px 1px 16px #666; -moz-box-shadow: 1px 1px 10px #666; -webkit-box-shadow: #666 1px 1px 10px; } |
| | | .ui-datepicker .ui-datepicker-header { position:relative; padding: .3em 0; border-radius: 3px 3px 0 0; border: 0; background: #3a3a3a; color: #fff; text-shadow: text-shadow: 0px 1px 1px #000; } |
| | | .ui-datepicker .ui-datepicker-prev, .ui-datepicker .ui-datepicker-next { position:absolute; top: 2px; width: 1.8em; height: 1.8em; border: 0; background: none; } |
| | | .ui-datepicker .ui-datepicker-header .ui-icon { background: url(images/ui-icons-datepicker.png) 0 0 no-repeat; } |
| | | .ui-datepicker .ui-datepicker-header .ui-icon-circle-triangle-w { background-position: 0 2px; } |
| | | .ui-datepicker .ui-datepicker-header .ui-icon-circle-triangle-e { background-position: -14px 2px; } |
| | | .ui-datepicker .ui-datepicker-prev-hover, .ui-datepicker .ui-datepicker-next-hover { top: 2px; border: 0; background: 0; } |
| | | .ui-datepicker .ui-datepicker-prev { left:2px; } |
| | | .ui-datepicker .ui-datepicker-next { right:2px; } |
| | | .ui-datepicker .ui-datepicker-prev-hover { left:2px; } |
| | | .ui-datepicker .ui-datepicker-next-hover { right:2px; } |
| | | .ui-datepicker .ui-datepicker-prev span, .ui-datepicker .ui-datepicker-next span { display: block; position: absolute; left: 50%; margin-left: -8px; top: 50%; margin-top: -8px; } |
| | | .ui-datepicker .ui-datepicker-title { margin: 0 2.3em; line-height: 1.8em; text-align: center; } |
| | | .ui-datepicker .ui-datepicker-title select { font-size:1em; margin:1px 0; } |
| | | .ui-datepicker select.ui-datepicker-month-year {width: 100%;} |
| | | .ui-datepicker select.ui-datepicker-month, |
| | | .ui-datepicker select.ui-datepicker-year { width: 49%;} |
| | | .ui-datepicker table { width: 100%; border-collapse: collapse; margin:0; border-spacing: 0; } |
| | | .ui-datepicker th { padding: .7em .3em; text-align: center; font-weight: bold; border: 0; color: #666; } |
| | | .ui-datepicker td { border: 1px solid #bbb; padding: 0; } |
| | | .ui-datepicker td span, .ui-datepicker td a { display: block; padding: .3em; text-align: right; text-decoration: none; border: 0; text-shadow: 0px 1px 1px #fff; } |
| | | .ui-datepicker td a.ui-state-default { border: 0px solid #fff; border-top-width: 1px; border-left-width: 1px; background: #e6e6e6; background: -moz-linear-gradient(top, #e6e6e6 0%, #d6d6d6 100%); background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#e6e6e6), color-stop(100%,#d6d6d6)); background: -o-linear-gradient(top, #e6e6e6 0%, #d6d6d6 100%); background: -ms-linear-gradient(top, #e6e6e6 0%, #d6d6d6 100%); background: linear-gradient(top, #e6e6e6 0%, #d6d6d6 100%); } |
| | | .ui-datepicker td a.ui-priority-secondary { background: #eee; } |
| | | .ui-datepicker td a.ui-state-active { color: #fff; border-color: #0286ac; text-shadow: 0px 1px 1px #00516e; background: #00acd4; background: -moz-linear-gradient(top, #00acd4 0%, #008fc7 100%); background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#00acd4), color-stop(100%,#008fc7)); background: -o-linear-gradient(top, #00acd4 0%, #008fc7 100%); background: -ms-linear-gradient(top, #00acd4 0%, #008fc7 100%); background: linear-gradient(top, #00acd4 0%, #008fc7 100%); } |
| | | .ui-datepicker .ui-state-highlight { color: #0081c2; } |
| | | .ui-datepicker .ui-datepicker-buttonpane { background-image: none; margin: .7em 0 0 0; padding:0 .2em; border-left: 0; border-right: 0; border-bottom: 0; } |
| | | .ui-datepicker .ui-datepicker-buttonpane button { float: right; margin: .5em .2em .4em; cursor: pointer; padding: .2em .6em .3em .6em; width:auto; overflow:visible; } |
| | | .ui-datepicker .ui-datepicker-buttonpane button.ui-datepicker-current { float:left; } |
| | | |
| | | /* with multiple calendars */ |
| | | .ui-datepicker.ui-datepicker-multi { width:auto; } |
| | | .ui-datepicker-multi .ui-datepicker-group { float:left; } |
| | | .ui-datepicker-multi .ui-datepicker-group table { width:95%; margin:0 auto .4em; } |
| | | .ui-datepicker-multi-2 .ui-datepicker-group { width:50%; } |
| | | .ui-datepicker-multi-3 .ui-datepicker-group { width:33.3%; } |
| | | .ui-datepicker-multi-4 .ui-datepicker-group { width:25%; } |
| | | .ui-datepicker-multi .ui-datepicker-group-last .ui-datepicker-header { border-left-width:0; } |
| | | .ui-datepicker-multi .ui-datepicker-group-middle .ui-datepicker-header { border-left-width:0; } |
| | | .ui-datepicker-multi .ui-datepicker-buttonpane { clear:left; } |
| | | .ui-datepicker-row-break { clear:both; width:100%; font-size:0em; } |
| | | |
| | | /* RTL support */ |
| | | .ui-datepicker-rtl { direction: rtl; } |
| | | .ui-datepicker-rtl .ui-datepicker-prev { right: 2px; left: auto; } |
| | | .ui-datepicker-rtl .ui-datepicker-next { left: 2px; right: auto; } |
| | | .ui-datepicker-rtl .ui-datepicker-prev:hover { right: 1px; left: auto; } |
| | | .ui-datepicker-rtl .ui-datepicker-next:hover { left: 1px; right: auto; } |
| | | .ui-datepicker-rtl .ui-datepicker-buttonpane { clear:right; } |
| | | .ui-datepicker-rtl .ui-datepicker-buttonpane button { float: left; } |
| | | .ui-datepicker-rtl .ui-datepicker-buttonpane button.ui-datepicker-current { float:right; } |
| | | .ui-datepicker-rtl .ui-datepicker-group { float:right; } |
| | | .ui-datepicker-rtl .ui-datepicker-group-last .ui-datepicker-header { border-right-width:0; border-left-width:1px; } |
| | | .ui-datepicker-rtl .ui-datepicker-group-middle .ui-datepicker-header { border-right-width:0; border-left-width:1px; } |
| | | |
| | | /* IE6 IFRAME FIX (taken from datepicker 1.5.3 */ |
| | | .ui-datepicker-cover { |
| | | display: none; /*sorry for IE5*/ |
| | | display/**/: block; /*sorry for IE5*/ |
| | | position: absolute; /*must have*/ |
| | | z-index: -1; /*must have*/ |
| | | filter: mask(); /*must have*/ |
| | | top: -4px; /*must have*/ |
| | | left: -4px; /*must have*/ |
| | | width: 200px; /*must have*/ |
| | | height: 200px; /*must have*/ |
| | | }/* |
| | | * jQuery UI Progressbar 1.8.18 |
| | | * |
| | | * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) |
| | | * Dual licensed under the MIT or GPL Version 2 licenses. |
| | | * http://jquery.org/license |
| | | * |
| | | * http://docs.jquery.com/UI/Progressbar#theming |
| | | */ |
| | | .ui-progressbar { height:2em; text-align: left; overflow: hidden; } |
| | | .ui-progressbar .ui-progressbar-value {margin: -1px; height:100%; } |
New file |
| | |
| | | /* |
| | | * jQuery UI CSS Framework 1.8.18 |
| | | * |
| | | * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) |
| | | * Dual licensed under the MIT or GPL Version 2 licenses. |
| | | * http://jquery.org/license |
| | | * |
| | | * http://docs.jquery.com/UI/Theming/API |
| | | */ |
| | | |
| | | /* Layout helpers |
| | | ----------------------------------*/ |
| | | .ui-helper-hidden { display: none; } |
| | | .ui-helper-hidden-accessible { position: absolute !important; clip: rect(1px 1px 1px 1px); clip: rect(1px,1px,1px,1px); } |
| | | .ui-helper-reset { margin: 0; padding: 0; border: 0; outline: 0; line-height: 1.3; text-decoration: none; font-size: 100%; list-style: none; } |
| | | .ui-helper-clearfix:before, .ui-helper-clearfix:after { content: ""; display: table; } |
| | | .ui-helper-clearfix:after { clear: both; } |
| | | .ui-helper-clearfix { zoom: 1; } |
| | | .ui-helper-zfix { width: 100%; height: 100%; top: 0; left: 0; position: absolute; opacity: 0; filter:Alpha(Opacity=0); } |
| | | |
| | | |
| | | /* Interaction Cues |
| | | ----------------------------------*/ |
| | | .ui-state-disabled { cursor: default !important; } |
| | | |
| | | |
| | | /* Icons |
| | | ----------------------------------*/ |
| | | |
| | | /* states and images */ |
| | | .ui-icon { display: block; text-indent: -99999px; overflow: hidden; background-repeat: no-repeat; } |
| | | |
| | | |
| | | /* Misc visuals |
| | | ----------------------------------*/ |
| | | |
| | | /* Overlays */ |
| | | .ui-widget-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; } |
| | | |
| | | |
| | | /* |
| | | * jQuery UI CSS Framework 1.8.18 |
| | | * |
| | | * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) |
| | | * Dual licensed under the MIT or GPL Version 2 licenses. |
| | | * http://jquery.org/license |
| | | * |
| | | * http://docs.jquery.com/UI/Theming/API |
| | | * |
| | | * To view and modify this theme, visit http://jqueryui.com/themeroller/?ctl=themeroller&ffDefault=Lucida%20Grande,%20Lucida%20Sans,%20Arial,%20sans-serif&fwDefault=bold&fsDefault=1.1em&cornerRadius=5px&bgColorHeader=5c9ccc&bgTextureHeader=12_gloss_wave.png&bgImgOpacityHeader=55&borderColorHeader=4297d7&fcHeader=ffffff&iconColorHeader=d8e7f3&bgColorContent=fcfdfd&bgTextureContent=06_inset_hard.png&bgImgOpacityContent=100&borderColorContent=a6c9e2&fcContent=222222&iconColorContent=469bdd&bgColorDefault=dfeffc&bgTextureDefault=02_glass.png&bgImgOpacityDefault=85&borderColorDefault=c5dbec&fcDefault=2e6e9e&iconColorDefault=6da8d5&bgColorHover=d0e5f5&bgTextureHover=02_glass.png&bgImgOpacityHover=75&borderColorHover=79b7e7&fcHover=1d5987&iconColorHover=217bc0&bgColorActive=f5f8f9&bgTextureActive=06_inset_hard.png&bgImgOpacityActive=100&borderColorActive=79b7e7&fcActive=e17009&iconColorActive=f9bd01&bgColorHighlight=fbec88&bgTextureHighlight=01_flat.png&bgImgOpacityHighlight=55&borderColorHighlight=fad42e&fcHighlight=363636&iconColorHighlight=2e83ff&bgColorError=fef1ec&bgTextureError=02_glass.png&bgImgOpacityError=95&borderColorError=cd0a0a&fcError=cd0a0a&iconColorError=cd0a0a&bgColorOverlay=aaaaaa&bgTextureOverlay=01_flat.png&bgImgOpacityOverlay=0&opacityOverlay=30&bgColorShadow=aaaaaa&bgTextureShadow=01_flat.png&bgImgOpacityShadow=0&opacityShadow=30&thicknessShadow=8px&offsetTopShadow=-8px&offsetLeftShadow=-8px&cornerRadiusShadow=8px |
| | | */ |
| | | |
| | | |
| | | /* Component containers |
| | | ----------------------------------*/ |
| | | .ui-widget { font-family: Lucida Grande, Lucida Sans, Arial, sans-serif; font-size: 1.1em; } |
| | | .ui-widget .ui-widget { font-size: 1em; } |
| | | .ui-widget input, .ui-widget select, .ui-widget textarea, .ui-widget button { font-family: Lucida Grande, Lucida Sans, Arial, sans-serif; font-size: 1em; } |
| | | .ui-widget-content { border: 1px solid #a6c9e2; background: #fcfdfd url(images/ui-bg_inset-hard_100_fcfdfd_1x100.png) 50% bottom repeat-x; color: #222222; } |
| | | .ui-widget-content a { color: #222222; } |
| | | .ui-widget-header { border: 1px solid #4297d7; background: #5c9ccc url(images/ui-bg_gloss-wave_55_5c9ccc_500x100.png) 50% 50% repeat-x; color: #ffffff; font-weight: bold; } |
| | | .ui-widget-header a { color: #ffffff; } |
| | | |
| | | /* Interaction states |
| | | ----------------------------------*/ |
| | | .ui-state-default, .ui-widget-content .ui-state-default, .ui-widget-header .ui-state-default { border: 1px solid #c5dbec; background: #dfeffc url(images/ui-bg_glass_85_dfeffc_1x400.png) 50% 50% repeat-x; font-weight: bold; color: #2e6e9e; } |
| | | .ui-state-default a, .ui-state-default a:link, .ui-state-default a:visited { color: #2e6e9e; text-decoration: none; } |
| | | .ui-state-hover, .ui-widget-content .ui-state-hover, .ui-widget-header .ui-state-hover, .ui-state-focus, .ui-widget-content .ui-state-focus, .ui-widget-header .ui-state-focus { border: 1px solid #79b7e7; background: #d0e5f5 url(images/ui-bg_glass_75_d0e5f5_1x400.png) 50% 50% repeat-x; font-weight: bold; color: #1d5987; } |
| | | .ui-state-hover a, .ui-state-hover a:hover { color: #1d5987; text-decoration: none; } |
| | | .ui-state-active, .ui-widget-content .ui-state-active, .ui-widget-header .ui-state-active { border: 1px solid #79b7e7; background: #f5f8f9 url(images/ui-bg_inset-hard_100_f5f8f9_1x100.png) 50% 50% repeat-x; font-weight: bold; color: #e17009; } |
| | | .ui-state-active a, .ui-state-active a:link, .ui-state-active a:visited { color: #e17009; text-decoration: none; } |
| | | .ui-widget :active { outline: none; } |
| | | |
| | | /* Interaction Cues |
| | | ----------------------------------*/ |
| | | .ui-state-highlight, .ui-widget-content .ui-state-highlight, .ui-widget-header .ui-state-highlight {border: 1px solid #fad42e; background: #fbec88 url(images/ui-bg_flat_55_fbec88_40x100.png) 50% 50% repeat-x; color: #363636; } |
| | | .ui-state-highlight a, .ui-widget-content .ui-state-highlight a,.ui-widget-header .ui-state-highlight a { color: #363636; } |
| | | .ui-state-error, .ui-widget-content .ui-state-error, .ui-widget-header .ui-state-error {border: 1px solid #cd0a0a; background: #fef1ec url(images/ui-bg_glass_95_fef1ec_1x400.png) 50% 50% repeat-x; color: #cd0a0a; } |
| | | .ui-state-error a, .ui-widget-content .ui-state-error a, .ui-widget-header .ui-state-error a { color: #cd0a0a; } |
| | | .ui-state-error-text, .ui-widget-content .ui-state-error-text, .ui-widget-header .ui-state-error-text { color: #cd0a0a; } |
| | | .ui-priority-primary, .ui-widget-content .ui-priority-primary, .ui-widget-header .ui-priority-primary { font-weight: bold; } |
| | | .ui-priority-secondary, .ui-widget-content .ui-priority-secondary, .ui-widget-header .ui-priority-secondary { opacity: .7; filter:Alpha(Opacity=70); font-weight: normal; } |
| | | .ui-state-disabled, .ui-widget-content .ui-state-disabled, .ui-widget-header .ui-state-disabled { opacity: .35; filter:Alpha(Opacity=35); background-image: none; } |
| | | |
| | | /* Icons |
| | | ----------------------------------*/ |
| | | |
| | | /* states and images */ |
| | | .ui-icon { width: 16px; height: 16px; background-image: url(images/ui-icons_469bdd_256x240.png); } |
| | | .ui-widget-content .ui-icon {background-image: url(images/ui-icons_469bdd_256x240.png); } |
| | | .ui-widget-header .ui-icon {background-image: url(images/ui-icons_d8e7f3_256x240.png); } |
| | | .ui-state-default .ui-icon { background-image: url(images/ui-icons_6da8d5_256x240.png); } |
| | | .ui-state-hover .ui-icon, .ui-state-focus .ui-icon {background-image: url(images/ui-icons_217bc0_256x240.png); } |
| | | .ui-state-active .ui-icon {background-image: url(images/ui-icons_f9bd01_256x240.png); } |
| | | .ui-state-highlight .ui-icon {background-image: url(images/ui-icons_2e83ff_256x240.png); } |
| | | .ui-state-error .ui-icon, .ui-state-error-text .ui-icon {background-image: url(images/ui-icons_cd0a0a_256x240.png); } |
| | | |
| | | /* positioning */ |
| | | .ui-icon-carat-1-n { background-position: 0 0; } |
| | | .ui-icon-carat-1-ne { background-position: -16px 0; } |
| | | .ui-icon-carat-1-e { background-position: -32px 0; } |
| | | .ui-icon-carat-1-se { background-position: -48px 0; } |
| | | .ui-icon-carat-1-s { background-position: -64px 0; } |
| | | .ui-icon-carat-1-sw { background-position: -80px 0; } |
| | | .ui-icon-carat-1-w { background-position: -96px 0; } |
| | | .ui-icon-carat-1-nw { background-position: -112px 0; } |
| | | .ui-icon-carat-2-n-s { background-position: -128px 0; } |
| | | .ui-icon-carat-2-e-w { background-position: -144px 0; } |
| | | .ui-icon-triangle-1-n { background-position: 0 -16px; } |
| | | .ui-icon-triangle-1-ne { background-position: -16px -16px; } |
| | | .ui-icon-triangle-1-e { background-position: -32px -16px; } |
| | | .ui-icon-triangle-1-se { background-position: -48px -16px; } |
| | | .ui-icon-triangle-1-s { background-position: -64px -16px; } |
| | | .ui-icon-triangle-1-sw { background-position: -80px -16px; } |
| | | .ui-icon-triangle-1-w { background-position: -96px -16px; } |
| | | .ui-icon-triangle-1-nw { background-position: -112px -16px; } |
| | | .ui-icon-triangle-2-n-s { background-position: -128px -16px; } |
| | | .ui-icon-triangle-2-e-w { background-position: -144px -16px; } |
| | | .ui-icon-arrow-1-n { background-position: 0 -32px; } |
| | | .ui-icon-arrow-1-ne { background-position: -16px -32px; } |
| | | .ui-icon-arrow-1-e { background-position: -32px -32px; } |
| | | .ui-icon-arrow-1-se { background-position: -48px -32px; } |
| | | .ui-icon-arrow-1-s { background-position: -64px -32px; } |
| | | .ui-icon-arrow-1-sw { background-position: -80px -32px; } |
| | | .ui-icon-arrow-1-w { background-position: -96px -32px; } |
| | | .ui-icon-arrow-1-nw { background-position: -112px -32px; } |
| | | .ui-icon-arrow-2-n-s { background-position: -128px -32px; } |
| | | .ui-icon-arrow-2-ne-sw { background-position: -144px -32px; } |
| | | .ui-icon-arrow-2-e-w { background-position: -160px -32px; } |
| | | .ui-icon-arrow-2-se-nw { background-position: -176px -32px; } |
| | | .ui-icon-arrowstop-1-n { background-position: -192px -32px; } |
| | | .ui-icon-arrowstop-1-e { background-position: -208px -32px; } |
| | | .ui-icon-arrowstop-1-s { background-position: -224px -32px; } |
| | | .ui-icon-arrowstop-1-w { background-position: -240px -32px; } |
| | | .ui-icon-arrowthick-1-n { background-position: 0 -48px; } |
| | | .ui-icon-arrowthick-1-ne { background-position: -16px -48px; } |
| | | .ui-icon-arrowthick-1-e { background-position: -32px -48px; } |
| | | .ui-icon-arrowthick-1-se { background-position: -48px -48px; } |
| | | .ui-icon-arrowthick-1-s { background-position: -64px -48px; } |
| | | .ui-icon-arrowthick-1-sw { background-position: -80px -48px; } |
| | | .ui-icon-arrowthick-1-w { background-position: -96px -48px; } |
| | | .ui-icon-arrowthick-1-nw { background-position: -112px -48px; } |
| | | .ui-icon-arrowthick-2-n-s { background-position: -128px -48px; } |
| | | .ui-icon-arrowthick-2-ne-sw { background-position: -144px -48px; } |
| | | .ui-icon-arrowthick-2-e-w { background-position: -160px -48px; } |
| | | .ui-icon-arrowthick-2-se-nw { background-position: -176px -48px; } |
| | | .ui-icon-arrowthickstop-1-n { background-position: -192px -48px; } |
| | | .ui-icon-arrowthickstop-1-e { background-position: -208px -48px; } |
| | | .ui-icon-arrowthickstop-1-s { background-position: -224px -48px; } |
| | | .ui-icon-arrowthickstop-1-w { background-position: -240px -48px; } |
| | | .ui-icon-arrowreturnthick-1-w { background-position: 0 -64px; } |
| | | .ui-icon-arrowreturnthick-1-n { background-position: -16px -64px; } |
| | | .ui-icon-arrowreturnthick-1-e { background-position: -32px -64px; } |
| | | .ui-icon-arrowreturnthick-1-s { background-position: -48px -64px; } |
| | | .ui-icon-arrowreturn-1-w { background-position: -64px -64px; } |
| | | .ui-icon-arrowreturn-1-n { background-position: -80px -64px; } |
| | | .ui-icon-arrowreturn-1-e { background-position: -96px -64px; } |
| | | .ui-icon-arrowreturn-1-s { background-position: -112px -64px; } |
| | | .ui-icon-arrowrefresh-1-w { background-position: -128px -64px; } |
| | | .ui-icon-arrowrefresh-1-n { background-position: -144px -64px; } |
| | | .ui-icon-arrowrefresh-1-e { background-position: -160px -64px; } |
| | | .ui-icon-arrowrefresh-1-s { background-position: -176px -64px; } |
| | | .ui-icon-arrow-4 { background-position: 0 -80px; } |
| | | .ui-icon-arrow-4-diag { background-position: -16px -80px; } |
| | | .ui-icon-extlink { background-position: -32px -80px; } |
| | | .ui-icon-newwin { background-position: -48px -80px; } |
| | | .ui-icon-refresh { background-position: -64px -80px; } |
| | | .ui-icon-shuffle { background-position: -80px -80px; } |
| | | .ui-icon-transfer-e-w { background-position: -96px -80px; } |
| | | .ui-icon-transferthick-e-w { background-position: -112px -80px; } |
| | | .ui-icon-folder-collapsed { background-position: 0 -96px; } |
| | | .ui-icon-folder-open { background-position: -16px -96px; } |
| | | .ui-icon-document { background-position: -32px -96px; } |
| | | .ui-icon-document-b { background-position: -48px -96px; } |
| | | .ui-icon-note { background-position: -64px -96px; } |
| | | .ui-icon-mail-closed { background-position: -80px -96px; } |
| | | .ui-icon-mail-open { background-position: -96px -96px; } |
| | | .ui-icon-suitcase { background-position: -112px -96px; } |
| | | .ui-icon-comment { background-position: -128px -96px; } |
| | | .ui-icon-person { background-position: -144px -96px; } |
| | | .ui-icon-print { background-position: -160px -96px; } |
| | | .ui-icon-trash { background-position: -176px -96px; } |
| | | .ui-icon-locked { background-position: -192px -96px; } |
| | | .ui-icon-unlocked { background-position: -208px -96px; } |
| | | .ui-icon-bookmark { background-position: -224px -96px; } |
| | | .ui-icon-tag { background-position: -240px -96px; } |
| | | .ui-icon-home { background-position: 0 -112px; } |
| | | .ui-icon-flag { background-position: -16px -112px; } |
| | | .ui-icon-calendar { background-position: -32px -112px; } |
| | | .ui-icon-cart { background-position: -48px -112px; } |
| | | .ui-icon-pencil { background-position: -64px -112px; } |
| | | .ui-icon-clock { background-position: -80px -112px; } |
| | | .ui-icon-disk { background-position: -96px -112px; } |
| | | .ui-icon-calculator { background-position: -112px -112px; } |
| | | .ui-icon-zoomin { background-position: -128px -112px; } |
| | | .ui-icon-zoomout { background-position: -144px -112px; } |
| | | .ui-icon-search { background-position: -160px -112px; } |
| | | .ui-icon-wrench { background-position: -176px -112px; } |
| | | .ui-icon-gear { background-position: -192px -112px; } |
| | | .ui-icon-heart { background-position: -208px -112px; } |
| | | .ui-icon-star { background-position: -224px -112px; } |
| | | .ui-icon-link { background-position: -240px -112px; } |
| | | .ui-icon-cancel { background-position: 0 -128px; } |
| | | .ui-icon-plus { background-position: -16px -128px; } |
| | | .ui-icon-plusthick { background-position: -32px -128px; } |
| | | .ui-icon-minus { background-position: -48px -128px; } |
| | | .ui-icon-minusthick { background-position: -64px -128px; } |
| | | .ui-icon-close { background-position: -80px -128px; } |
| | | .ui-icon-closethick { background-position: -96px -128px; } |
| | | .ui-icon-key { background-position: -112px -128px; } |
| | | .ui-icon-lightbulb { background-position: -128px -128px; } |
| | | .ui-icon-scissors { background-position: -144px -128px; } |
| | | .ui-icon-clipboard { background-position: -160px -128px; } |
| | | .ui-icon-copy { background-position: -176px -128px; } |
| | | .ui-icon-contact { background-position: -192px -128px; } |
| | | .ui-icon-image { background-position: -208px -128px; } |
| | | .ui-icon-video { background-position: -224px -128px; } |
| | | .ui-icon-script { background-position: -240px -128px; } |
| | | .ui-icon-alert { background-position: 0 -144px; } |
| | | .ui-icon-info { background-position: -16px -144px; } |
| | | .ui-icon-notice { background-position: -32px -144px; } |
| | | .ui-icon-help { background-position: -48px -144px; } |
| | | .ui-icon-check { background-position: -64px -144px; } |
| | | .ui-icon-bullet { background-position: -80px -144px; } |
| | | .ui-icon-radio-off { background-position: -96px -144px; } |
| | | .ui-icon-radio-on { background-position: -112px -144px; } |
| | | .ui-icon-pin-w { background-position: -128px -144px; } |
| | | .ui-icon-pin-s { background-position: -144px -144px; } |
| | | .ui-icon-play { background-position: 0 -160px; } |
| | | .ui-icon-pause { background-position: -16px -160px; } |
| | | .ui-icon-seek-next { background-position: -32px -160px; } |
| | | .ui-icon-seek-prev { background-position: -48px -160px; } |
| | | .ui-icon-seek-end { background-position: -64px -160px; } |
| | | .ui-icon-seek-start { background-position: -80px -160px; } |
| | | /* ui-icon-seek-first is deprecated, use ui-icon-seek-start instead */ |
| | | .ui-icon-seek-first { background-position: -80px -160px; } |
| | | .ui-icon-stop { background-position: -96px -160px; } |
| | | .ui-icon-eject { background-position: -112px -160px; } |
| | | .ui-icon-volume-off { background-position: -128px -160px; } |
| | | .ui-icon-volume-on { background-position: -144px -160px; } |
| | | .ui-icon-power { background-position: 0 -176px; } |
| | | .ui-icon-signal-diag { background-position: -16px -176px; } |
| | | .ui-icon-signal { background-position: -32px -176px; } |
| | | .ui-icon-battery-0 { background-position: -48px -176px; } |
| | | .ui-icon-battery-1 { background-position: -64px -176px; } |
| | | .ui-icon-battery-2 { background-position: -80px -176px; } |
| | | .ui-icon-battery-3 { background-position: -96px -176px; } |
| | | .ui-icon-circle-plus { background-position: 0 -192px; } |
| | | .ui-icon-circle-minus { background-position: -16px -192px; } |
| | | .ui-icon-circle-close { background-position: -32px -192px; } |
| | | .ui-icon-circle-triangle-e { background-position: -48px -192px; } |
| | | .ui-icon-circle-triangle-s { background-position: -64px -192px; } |
| | | .ui-icon-circle-triangle-w { background-position: -80px -192px; } |
| | | .ui-icon-circle-triangle-n { background-position: -96px -192px; } |
| | | .ui-icon-circle-arrow-e { background-position: -112px -192px; } |
| | | .ui-icon-circle-arrow-s { background-position: -128px -192px; } |
| | | .ui-icon-circle-arrow-w { background-position: -144px -192px; } |
| | | .ui-icon-circle-arrow-n { background-position: -160px -192px; } |
| | | .ui-icon-circle-zoomin { background-position: -176px -192px; } |
| | | .ui-icon-circle-zoomout { background-position: -192px -192px; } |
| | | .ui-icon-circle-check { background-position: -208px -192px; } |
| | | .ui-icon-circlesmall-plus { background-position: 0 -208px; } |
| | | .ui-icon-circlesmall-minus { background-position: -16px -208px; } |
| | | .ui-icon-circlesmall-close { background-position: -32px -208px; } |
| | | .ui-icon-squaresmall-plus { background-position: -48px -208px; } |
| | | .ui-icon-squaresmall-minus { background-position: -64px -208px; } |
| | | .ui-icon-squaresmall-close { background-position: -80px -208px; } |
| | | .ui-icon-grip-dotted-vertical { background-position: 0 -224px; } |
| | | .ui-icon-grip-dotted-horizontal { background-position: -16px -224px; } |
| | | .ui-icon-grip-solid-vertical { background-position: -32px -224px; } |
| | | .ui-icon-grip-solid-horizontal { background-position: -48px -224px; } |
| | | .ui-icon-gripsmall-diagonal-se { background-position: -64px -224px; } |
| | | .ui-icon-grip-diagonal-se { background-position: -80px -224px; } |
| | | |
| | | |
| | | /* Misc visuals |
| | | ----------------------------------*/ |
| | | |
| | | /* Corner radius */ |
| | | .ui-corner-all, .ui-corner-top, .ui-corner-left, .ui-corner-tl { -moz-border-radius-topleft: 5px; -webkit-border-top-left-radius: 5px; -khtml-border-top-left-radius: 5px; border-top-left-radius: 5px; } |
| | | .ui-corner-all, .ui-corner-top, .ui-corner-right, .ui-corner-tr { -moz-border-radius-topright: 5px; -webkit-border-top-right-radius: 5px; -khtml-border-top-right-radius: 5px; border-top-right-radius: 5px; } |
| | | .ui-corner-all, .ui-corner-bottom, .ui-corner-left, .ui-corner-bl { -moz-border-radius-bottomleft: 5px; -webkit-border-bottom-left-radius: 5px; -khtml-border-bottom-left-radius: 5px; border-bottom-left-radius: 5px; } |
| | | .ui-corner-all, .ui-corner-bottom, .ui-corner-right, .ui-corner-br { -moz-border-radius-bottomright: 5px; -webkit-border-bottom-right-radius: 5px; -khtml-border-bottom-right-radius: 5px; border-bottom-right-radius: 5px; } |
| | | |
| | | /* Overlays */ |
| | | .ui-widget-overlay { background: #aaaaaa url(images/ui-bg_flat_0_aaaaaa_40x100.png) 50% 50% repeat-x; opacity: .30;filter:Alpha(Opacity=30); } |
| | | .ui-widget-shadow { margin: -8px 0 0 -8px; padding: 8px; background: #aaaaaa url(images/ui-bg_flat_0_aaaaaa_40x100.png) 50% 50% repeat-x; opacity: .30;filter:Alpha(Opacity=30); -moz-border-radius: 8px; -khtml-border-radius: 8px; -webkit-border-radius: 8px; border-radius: 8px; }/* |
| | | * jQuery UI Resizable 1.8.18 |
| | | * |
| | | * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) |
| | | * Dual licensed under the MIT or GPL Version 2 licenses. |
| | | * http://jquery.org/license |
| | | * |
| | | * http://docs.jquery.com/UI/Resizable#theming |
| | | */ |
| | | .ui-resizable { position: relative;} |
| | | .ui-resizable-handle { position: absolute;font-size: 0.1px;z-index: 99999; display: block; } |
| | | .ui-resizable-disabled .ui-resizable-handle, .ui-resizable-autohide .ui-resizable-handle { display: none; } |
| | | .ui-resizable-n { cursor: n-resize; height: 7px; width: 100%; top: -5px; left: 0; } |
| | | .ui-resizable-s { cursor: s-resize; height: 7px; width: 100%; bottom: -5px; left: 0; } |
| | | .ui-resizable-e { cursor: e-resize; width: 7px; right: -5px; top: 0; height: 100%; } |
| | | .ui-resizable-w { cursor: w-resize; width: 7px; left: -5px; top: 0; height: 100%; } |
| | | .ui-resizable-se { cursor: se-resize; width: 12px; height: 12px; right: 1px; bottom: 1px; } |
| | | .ui-resizable-sw { cursor: sw-resize; width: 9px; height: 9px; left: -5px; bottom: -5px; } |
| | | .ui-resizable-nw { cursor: nw-resize; width: 9px; height: 9px; left: -5px; top: -5px; } |
| | | .ui-resizable-ne { cursor: ne-resize; width: 9px; height: 9px; right: -5px; top: -5px;}/* |
| | | * jQuery UI Selectable 1.8.18 |
| | | * |
| | | * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) |
| | | * Dual licensed under the MIT or GPL Version 2 licenses. |
| | | * http://jquery.org/license |
| | | * |
| | | * http://docs.jquery.com/UI/Selectable#theming |
| | | */ |
| | | .ui-selectable-helper { position: absolute; z-index: 100; border:1px dotted black; } |
| | | /* |
| | | * jQuery UI Accordion 1.8.18 |
| | | * |
| | | * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) |
| | | * Dual licensed under the MIT or GPL Version 2 licenses. |
| | | * http://jquery.org/license |
| | | * |
| | | * http://docs.jquery.com/UI/Accordion#theming |
| | | */ |
| | | /* IE/Win - Fix animation bug - #4615 */ |
| | | .ui-accordion { width: 100%; } |
| | | .ui-accordion .ui-accordion-header { cursor: pointer; position: relative; margin-top: 1px; zoom: 1; } |
| | | .ui-accordion .ui-accordion-li-fix { display: inline; } |
| | | .ui-accordion .ui-accordion-header-active { border-bottom: 0 !important; } |
| | | .ui-accordion .ui-accordion-header a { display: block; font-size: 1em; padding: .5em .5em .5em .7em; } |
| | | .ui-accordion-icons .ui-accordion-header a { padding-left: 2.2em; } |
| | | .ui-accordion .ui-accordion-header .ui-icon { position: absolute; left: .5em; top: 50%; margin-top: -8px; } |
| | | .ui-accordion .ui-accordion-content { padding: 1em 2.2em; border-top: 0; margin-top: -2px; position: relative; top: 1px; margin-bottom: 2px; overflow: auto; display: none; zoom: 1; } |
| | | .ui-accordion .ui-accordion-content-active { display: block; } |
| | | /* |
| | | * jQuery UI Autocomplete 1.8.18 |
| | | * |
| | | * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) |
| | | * Dual licensed under the MIT or GPL Version 2 licenses. |
| | | * http://jquery.org/license |
| | | * |
| | | * http://docs.jquery.com/UI/Autocomplete#theming |
| | | */ |
| | | .ui-autocomplete { position: absolute; cursor: default; } |
| | | |
| | | /* workarounds */ |
| | | * html .ui-autocomplete { width:1px; } /* without this, the menu expands to 100% in IE6 */ |
| | | |
| | | /* |
| | | * jQuery UI Menu 1.8.18 |
| | | * |
| | | * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about) |
| | | * Dual licensed under the MIT or GPL Version 2 licenses. |
| | | * http://jquery.org/license |
| | | * |
| | | * http://docs.jquery.com/UI/Menu#theming |
| | | */ |
| | | .ui-menu { |
| | | list-style:none; |
| | | padding: 2px; |
| | | margin: 0; |
| | | display:block; |
| | | float: left; |
| | | } |
| | | .ui-menu .ui-menu { |
| | | margin-top: -3px; |
| | | } |
| | | .ui-menu .ui-menu-item { |
| | | margin:0; |
| | | padding: 0; |
| | | zoom: 1; |
| | | float: left; |
| | | clear: left; |
| | | width: 100%; |
| | | } |
| | | .ui-menu .ui-menu-item a { |
| | | text-decoration:none; |
| | | display:block; |
| | | padding:.2em .4em; |
| | | line-height:1.5; |
| | | zoom:1; |
| | | } |
| | | .ui-menu .ui-menu-item a.ui-state-hover, |
| | | .ui-menu .ui-menu-item a.ui-state-active { |
| | | font-weight: normal; |
| | | margin: -1px; |
| | | } |
| | | /* |
| | | * jQuery UI Button 1.8.18 |
| | | * |
| | | * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) |
| | | * Dual licensed under the MIT or GPL Version 2 licenses. |
| | | * http://jquery.org/license |
| | | * |
| | | * http://docs.jquery.com/UI/Button#theming |
| | | */ |
| | | .ui-button { display: inline-block; position: relative; padding: 0; margin-right: .1em; text-decoration: none !important; cursor: pointer; text-align: center; zoom: 1; overflow: hidden; *overflow: visible; } /* the overflow property removes extra width in IE */ |
| | | .ui-button-icon-only { width: 2.2em; } /* to make room for the icon, a width needs to be set here */ |
| | | button.ui-button-icon-only { width: 2.4em; } /* button elements seem to need a little more width */ |
| | | .ui-button-icons-only { width: 3.4em; } |
| | | button.ui-button-icons-only { width: 3.7em; } |
| | | |
| | | /*button text element */ |
| | | .ui-button .ui-button-text { display: block; line-height: 1.4; } |
| | | .ui-button-text-only .ui-button-text { padding: .4em 1em; } |
| | | .ui-button-icon-only .ui-button-text, .ui-button-icons-only .ui-button-text { padding: .4em; text-indent: -9999999px; } |
| | | .ui-button-text-icon-primary .ui-button-text, .ui-button-text-icons .ui-button-text { padding: .4em 1em .4em 2.1em; } |
| | | .ui-button-text-icon-secondary .ui-button-text, .ui-button-text-icons .ui-button-text { padding: .4em 2.1em .4em 1em; } |
| | | .ui-button-text-icons .ui-button-text { padding-left: 2.1em; padding-right: 2.1em; } |
| | | /* no icon support for input elements, provide padding by default */ |
| | | input.ui-button { padding: .4em 1em; } |
| | | |
| | | /*button icon element(s) */ |
| | | .ui-button-icon-only .ui-icon, .ui-button-text-icon-primary .ui-icon, .ui-button-text-icon-secondary .ui-icon, .ui-button-text-icons .ui-icon, .ui-button-icons-only .ui-icon { position: absolute; top: 50%; margin-top: -8px; } |
| | | .ui-button-icon-only .ui-icon { left: 50%; margin-left: -8px; } |
| | | .ui-button-text-icon-primary .ui-button-icon-primary, .ui-button-text-icons .ui-button-icon-primary, .ui-button-icons-only .ui-button-icon-primary { left: .5em; } |
| | | .ui-button-text-icon-secondary .ui-button-icon-secondary, .ui-button-text-icons .ui-button-icon-secondary, .ui-button-icons-only .ui-button-icon-secondary { right: .5em; } |
| | | .ui-button-text-icons .ui-button-icon-secondary, .ui-button-icons-only .ui-button-icon-secondary { right: .5em; } |
| | | |
| | | /*button sets*/ |
| | | .ui-buttonset { margin-right: 7px; } |
| | | .ui-buttonset .ui-button { margin-left: 0; margin-right: -.3em; } |
| | | |
| | | /* workarounds */ |
| | | button.ui-button::-moz-focus-inner { border: 0; padding: 0; } /* reset extra padding in Firefox */ |
| | | /* |
| | | * jQuery UI Dialog 1.8.18 |
| | | * |
| | | * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) |
| | | * Dual licensed under the MIT or GPL Version 2 licenses. |
| | | * http://jquery.org/license |
| | | * |
| | | * http://docs.jquery.com/UI/Dialog#theming |
| | | */ |
| | | .ui-dialog { position: absolute; padding: .2em; width: 300px; overflow: hidden; } |
| | | .ui-dialog .ui-dialog-titlebar { padding: .4em 1em; position: relative; } |
| | | .ui-dialog .ui-dialog-title { float: left; margin: .1em 16px .1em 0; } |
| | | .ui-dialog .ui-dialog-titlebar-close { position: absolute; right: .3em; top: 50%; width: 19px; margin: -10px 0 0 0; padding: 1px; height: 18px; } |
| | | .ui-dialog .ui-dialog-titlebar-close span { display: block; margin: 1px; } |
| | | .ui-dialog .ui-dialog-titlebar-close:hover, .ui-dialog .ui-dialog-titlebar-close:focus { padding: 0; } |
| | | .ui-dialog .ui-dialog-content { position: relative; border: 0; padding: .5em 1em; background: none; overflow: auto; zoom: 1; } |
| | | .ui-dialog .ui-dialog-buttonpane { text-align: left; border-width: 1px 0 0 0; background-image: none; margin: .5em 0 0 0; padding: .3em 1em .5em .4em; } |
| | | .ui-dialog .ui-dialog-buttonpane .ui-dialog-buttonset { float: right; } |
| | | .ui-dialog .ui-dialog-buttonpane button { margin: .5em .4em .5em 0; cursor: pointer; } |
| | | .ui-dialog .ui-resizable-se { width: 14px; height: 14px; right: 3px; bottom: 3px; } |
| | | .ui-draggable .ui-dialog-titlebar { cursor: move; } |
| | | /* |
| | | * jQuery UI Slider 1.8.18 |
| | | * |
| | | * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) |
| | | * Dual licensed under the MIT or GPL Version 2 licenses. |
| | | * http://jquery.org/license |
| | | * |
| | | * http://docs.jquery.com/UI/Slider#theming |
| | | */ |
| | | .ui-slider { position: relative; text-align: left; } |
| | | .ui-slider .ui-slider-handle { position: absolute; z-index: 2; width: 1.2em; height: 1.2em; cursor: default; } |
| | | .ui-slider .ui-slider-range { position: absolute; z-index: 1; font-size: .7em; display: block; border: 0; background-position: 0 0; } |
| | | |
| | | .ui-slider-horizontal { height: .8em; } |
| | | .ui-slider-horizontal .ui-slider-handle { top: -.3em; margin-left: -.6em; } |
| | | .ui-slider-horizontal .ui-slider-range { top: 0; height: 100%; } |
| | | .ui-slider-horizontal .ui-slider-range-min { left: 0; } |
| | | .ui-slider-horizontal .ui-slider-range-max { right: 0; } |
| | | |
| | | .ui-slider-vertical { width: .8em; height: 100px; } |
| | | .ui-slider-vertical .ui-slider-handle { left: -.3em; margin-left: 0; margin-bottom: -.6em; } |
| | | .ui-slider-vertical .ui-slider-range { left: 0; width: 100%; } |
| | | .ui-slider-vertical .ui-slider-range-min { bottom: 0; } |
| | | .ui-slider-vertical .ui-slider-range-max { top: 0; }/* |
| | | * jQuery UI Tabs 1.8.18 |
| | | * |
| | | * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) |
| | | * Dual licensed under the MIT or GPL Version 2 licenses. |
| | | * http://jquery.org/license |
| | | * |
| | | * http://docs.jquery.com/UI/Tabs#theming |
| | | */ |
| | | .ui-tabs { position: relative; padding: .2em; zoom: 1; } /* position: relative prevents IE scroll bug (element with position: relative inside container with overflow: auto appear as "fixed") */ |
| | | .ui-tabs .ui-tabs-nav { margin: 0; padding: .2em .2em 0; } |
| | | .ui-tabs .ui-tabs-nav li { list-style: none; float: left; position: relative; top: 1px; margin: 0 .2em 1px 0; border-bottom: 0 !important; padding: 0; white-space: nowrap; } |
| | | .ui-tabs .ui-tabs-nav li a { float: left; padding: .5em 1em; text-decoration: none; } |
| | | .ui-tabs .ui-tabs-nav li.ui-tabs-selected { margin-bottom: 0; padding-bottom: 1px; } |
| | | .ui-tabs .ui-tabs-nav li.ui-tabs-selected a, .ui-tabs .ui-tabs-nav li.ui-state-disabled a, .ui-tabs .ui-tabs-nav li.ui-state-processing a { cursor: text; } |
| | | .ui-tabs .ui-tabs-nav li a, .ui-tabs.ui-tabs-collapsible .ui-tabs-nav li.ui-tabs-selected a { cursor: pointer; } /* first selector in group seems obsolete, but required to overcome bug in Opera applying cursor: text overall if defined elsewhere... */ |
| | | .ui-tabs .ui-tabs-panel { display: block; border-width: 0; padding: 1em 1.4em; background: none; } |
| | | .ui-tabs .ui-tabs-hide { display: none !important; } |
| | | /* |
| | | * jQuery UI Datepicker 1.8.18 |
| | | * |
| | | * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) |
| | | * Dual licensed under the MIT or GPL Version 2 licenses. |
| | | * http://jquery.org/license |
| | | * |
| | | * http://docs.jquery.com/UI/Datepicker#theming |
| | | */ |
| | | .ui-datepicker { width: 17em; padding: .2em .2em 0; display: none; } |
| | | .ui-datepicker .ui-datepicker-header { position:relative; padding:.2em 0; } |
| | | .ui-datepicker .ui-datepicker-prev, .ui-datepicker .ui-datepicker-next { position:absolute; top: 2px; width: 1.8em; height: 1.8em; } |
| | | .ui-datepicker .ui-datepicker-prev-hover, .ui-datepicker .ui-datepicker-next-hover { top: 1px; } |
| | | .ui-datepicker .ui-datepicker-prev { left:2px; } |
| | | .ui-datepicker .ui-datepicker-next { right:2px; } |
| | | .ui-datepicker .ui-datepicker-prev-hover { left:1px; } |
| | | .ui-datepicker .ui-datepicker-next-hover { right:1px; } |
| | | .ui-datepicker .ui-datepicker-prev span, .ui-datepicker .ui-datepicker-next span { display: block; position: absolute; left: 50%; margin-left: -8px; top: 50%; margin-top: -8px; } |
| | | .ui-datepicker .ui-datepicker-title { margin: 0 2.3em; line-height: 1.8em; text-align: center; } |
| | | .ui-datepicker .ui-datepicker-title select { font-size:1em; margin:1px 0; } |
| | | .ui-datepicker select.ui-datepicker-month-year {width: 100%;} |
| | | .ui-datepicker select.ui-datepicker-month, |
| | | .ui-datepicker select.ui-datepicker-year { width: 49%;} |
| | | .ui-datepicker table {width: 100%; font-size: .9em; border-collapse: collapse; margin:0 0 .4em; } |
| | | .ui-datepicker th { padding: .7em .3em; text-align: center; font-weight: bold; border: 0; } |
| | | .ui-datepicker td { border: 0; padding: 1px; } |
| | | .ui-datepicker td span, .ui-datepicker td a { display: block; padding: .2em; text-align: right; text-decoration: none; } |
| | | .ui-datepicker .ui-datepicker-buttonpane { background-image: none; margin: .7em 0 0 0; padding:0 .2em; border-left: 0; border-right: 0; border-bottom: 0; } |
| | | .ui-datepicker .ui-datepicker-buttonpane button { float: right; margin: .5em .2em .4em; cursor: pointer; padding: .2em .6em .3em .6em; width:auto; overflow:visible; } |
| | | .ui-datepicker .ui-datepicker-buttonpane button.ui-datepicker-current { float:left; } |
| | | |
| | | /* with multiple calendars */ |
| | | .ui-datepicker.ui-datepicker-multi { width:auto; } |
| | | .ui-datepicker-multi .ui-datepicker-group { float:left; } |
| | | .ui-datepicker-multi .ui-datepicker-group table { width:95%; margin:0 auto .4em; } |
| | | .ui-datepicker-multi-2 .ui-datepicker-group { width:50%; } |
| | | .ui-datepicker-multi-3 .ui-datepicker-group { width:33.3%; } |
| | | .ui-datepicker-multi-4 .ui-datepicker-group { width:25%; } |
| | | .ui-datepicker-multi .ui-datepicker-group-last .ui-datepicker-header { border-left-width:0; } |
| | | .ui-datepicker-multi .ui-datepicker-group-middle .ui-datepicker-header { border-left-width:0; } |
| | | .ui-datepicker-multi .ui-datepicker-buttonpane { clear:left; } |
| | | .ui-datepicker-row-break { clear:both; width:100%; font-size:0em; } |
| | | |
| | | /* RTL support */ |
| | | .ui-datepicker-rtl { direction: rtl; } |
| | | .ui-datepicker-rtl .ui-datepicker-prev { right: 2px; left: auto; } |
| | | .ui-datepicker-rtl .ui-datepicker-next { left: 2px; right: auto; } |
| | | .ui-datepicker-rtl .ui-datepicker-prev:hover { right: 1px; left: auto; } |
| | | .ui-datepicker-rtl .ui-datepicker-next:hover { left: 1px; right: auto; } |
| | | .ui-datepicker-rtl .ui-datepicker-buttonpane { clear:right; } |
| | | .ui-datepicker-rtl .ui-datepicker-buttonpane button { float: left; } |
| | | .ui-datepicker-rtl .ui-datepicker-buttonpane button.ui-datepicker-current { float:right; } |
| | | .ui-datepicker-rtl .ui-datepicker-group { float:right; } |
| | | .ui-datepicker-rtl .ui-datepicker-group-last .ui-datepicker-header { border-right-width:0; border-left-width:1px; } |
| | | .ui-datepicker-rtl .ui-datepicker-group-middle .ui-datepicker-header { border-right-width:0; border-left-width:1px; } |
| | | |
| | | /* IE6 IFRAME FIX (taken from datepicker 1.5.3 */ |
| | | .ui-datepicker-cover { |
| | | display: none; /*sorry for IE5*/ |
| | | display/**/: block; /*sorry for IE5*/ |
| | | position: absolute; /*must have*/ |
| | | z-index: -1; /*must have*/ |
| | | filter: mask(); /*must have*/ |
| | | top: -4px; /*must have*/ |
| | | left: -4px; /*must have*/ |
| | | width: 200px; /*must have*/ |
| | | height: 200px; /*must have*/ |
| | | }/* |
| | | * jQuery UI Progressbar 1.8.18 |
| | | * |
| | | * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) |
| | | * Dual licensed under the MIT or GPL Version 2 licenses. |
| | | * http://jquery.org/license |
| | | * |
| | | * http://docs.jquery.com/UI/Progressbar#theming |
| | | */ |
| | | .ui-progressbar { height:2em; text-align: left; overflow: hidden; } |
| | | .ui-progressbar .ui-progressbar-value {margin: -1px; height:100%; } |
plugins/managesieve/Changelog
plugins/managesieve/config.inc.php.dist
plugins/managesieve/lib/Net/Sieve.php
plugins/managesieve/lib/rcube_sieve.php
plugins/managesieve/lib/rcube_sieve_script.php
plugins/managesieve/localization/bg_BG.inc
plugins/managesieve/localization/cs_CZ.inc
plugins/managesieve/localization/de_CH.inc
plugins/managesieve/localization/de_DE.inc
plugins/managesieve/localization/el_GR.inc
plugins/managesieve/localization/en_GB.inc
plugins/managesieve/localization/en_US.inc
plugins/managesieve/localization/es_AR.inc
plugins/managesieve/localization/es_ES.inc
plugins/managesieve/localization/et_EE.inc
plugins/managesieve/localization/fi_FI.inc
plugins/managesieve/localization/fr_FR.inc
plugins/managesieve/localization/gl_ES.inc
plugins/managesieve/localization/hr_HR.inc
plugins/managesieve/localization/hu_HU.inc
plugins/managesieve/localization/it_IT.inc
plugins/managesieve/localization/ja_JP.inc
plugins/managesieve/localization/lv_LV.inc
plugins/managesieve/localization/nb_NO.inc
plugins/managesieve/localization/nl_NL.inc
plugins/managesieve/localization/pl_PL.inc
plugins/managesieve/localization/pt_BR.inc
plugins/managesieve/localization/pt_PT.inc
plugins/managesieve/localization/ru_RU.inc
plugins/managesieve/localization/sk_SK.inc
plugins/managesieve/localization/sl_SI.inc
plugins/managesieve/localization/sv_SE.inc
plugins/managesieve/localization/uk_UA.inc
plugins/managesieve/localization/zh_CN.inc
plugins/managesieve/localization/zh_TW.inc
plugins/managesieve/managesieve.js
plugins/managesieve/managesieve.php
plugins/managesieve/package.xml
plugins/managesieve/skins/default/images/add.png
plugins/managesieve/skins/default/images/del.png
plugins/managesieve/skins/default/images/down_small.gif
plugins/managesieve/skins/default/images/filter.png
plugins/managesieve/skins/default/images/up_small.gif
plugins/managesieve/skins/default/managesieve.css
plugins/managesieve/skins/default/managesieve_mail.css
plugins/managesieve/skins/default/templates/filteredit.html
plugins/managesieve/skins/default/templates/managesieve.html
plugins/managesieve/skins/default/templates/setedit.html
plugins/managesieve/tests/Makefile
plugins/managesieve/tests/parser.phpt
plugins/managesieve/tests/parser_body.phpt
plugins/managesieve/tests/parser_imapflags.phpt
plugins/managesieve/tests/parser_include.phpt
plugins/managesieve/tests/parser_kep14.phpt
plugins/managesieve/tests/parser_prefix.phpt
plugins/managesieve/tests/parser_relational.phpt
plugins/managesieve/tests/parser_vacation.phpt
plugins/managesieve/tests/parser_variables.phpt
plugins/managesieve/tests/parset_subaddress.phpt
plugins/managesieve/tests/tokenize.phpt
plugins/markasjunk/localization/cs_CZ.inc
plugins/markasjunk/localization/da_DK.inc
plugins/markasjunk/localization/de_CH.inc
plugins/markasjunk/localization/de_DE.inc
plugins/markasjunk/localization/en_US.inc
plugins/markasjunk/localization/es_AR.inc
plugins/markasjunk/localization/es_ES.inc
plugins/markasjunk/localization/et_EE.inc
plugins/markasjunk/localization/gl_ES.inc
plugins/markasjunk/localization/it_IT.inc
plugins/markasjunk/localization/ja_JP.inc
plugins/markasjunk/localization/pl_PL.inc
plugins/markasjunk/localization/ru_RU.inc
plugins/markasjunk/localization/sk_SK.inc
plugins/markasjunk/localization/sv_SE.inc
plugins/markasjunk/localization/zh_TW.inc
plugins/markasjunk/markasjunk.js
plugins/markasjunk/markasjunk.php
plugins/markasjunk/package.xml
plugins/markasjunk/skins/default/junk_act.png
plugins/markasjunk/skins/default/junk_pas.png
plugins/markasjunk/skins/default/markasjunk.css
plugins/new_user_dialog/localization/bg_BG.inc
plugins/new_user_dialog/localization/cs_CZ.inc
plugins/new_user_dialog/localization/de_CH.inc
plugins/new_user_dialog/localization/de_DE.inc
plugins/new_user_dialog/localization/en_US.inc
plugins/new_user_dialog/localization/es_ES.inc
plugins/new_user_dialog/localization/et_EE.inc
plugins/new_user_dialog/localization/gl_ES.inc
plugins/new_user_dialog/localization/it_IT.inc
plugins/new_user_dialog/localization/ja_JP.inc
plugins/new_user_dialog/localization/nl_NL.inc
plugins/new_user_dialog/localization/pl_PL.inc
plugins/new_user_dialog/localization/pt_BR.inc
plugins/new_user_dialog/localization/pt_PT.inc
plugins/new_user_dialog/localization/ru_RU.inc
plugins/new_user_dialog/localization/sk_SK.inc
plugins/new_user_dialog/localization/sl_SI.inc
plugins/new_user_dialog/localization/sv_SE.inc
plugins/new_user_dialog/localization/zh_TW.inc
plugins/new_user_dialog/new_user_dialog.php
plugins/new_user_dialog/newuserdialog.css
plugins/new_user_dialog/package.xml
plugins/new_user_identity/new_user_identity.php
plugins/new_user_identity/package.xml
plugins/newmail_notifier/config.inc.php.dist
plugins/newmail_notifier/favicon.ico
plugins/newmail_notifier/localization/de_CH.inc
plugins/newmail_notifier/localization/de_DE.inc
plugins/newmail_notifier/localization/en_US.inc
plugins/newmail_notifier/localization/ja_JP.inc
plugins/newmail_notifier/localization/lv_LV.inc
plugins/newmail_notifier/localization/pl_PL.inc
plugins/newmail_notifier/localization/pt_BR.inc
plugins/newmail_notifier/localization/ru_RU.inc
plugins/newmail_notifier/localization/sv_SE.inc
plugins/newmail_notifier/mail.png
plugins/newmail_notifier/newmail_notifier.js
plugins/newmail_notifier/newmail_notifier.php
plugins/newmail_notifier/package.xml
plugins/newmail_notifier/sound.wav
plugins/password/README
plugins/password/config.inc.php.dist
plugins/password/drivers/chpasswd.php
plugins/password/drivers/cpanel.php
plugins/password/drivers/dbmail.php
plugins/password/drivers/directadmin.php
plugins/password/drivers/domainfactory.php
plugins/password/drivers/expect.php
plugins/password/drivers/hmail.php
plugins/password/drivers/ldap.php
plugins/password/drivers/ldap_simple.php
plugins/password/drivers/pam.php
plugins/password/drivers/poppassd.php
plugins/password/drivers/pw_usermod.php
plugins/password/drivers/sasl.php
plugins/password/drivers/smb.php
plugins/password/drivers/sql.php
plugins/password/drivers/virtualmin.php
plugins/password/drivers/vpopmaild.php
plugins/password/drivers/ximss.php
plugins/password/drivers/xmail.php
plugins/password/helpers/chgdbmailusers.c
plugins/password/helpers/chgsaslpasswd.c
plugins/password/helpers/chgvirtualminpasswd.c
plugins/password/helpers/chpass-wrapper.py
plugins/password/helpers/passwd-expect
plugins/password/localization/az_AZ.inc
plugins/password/localization/bg_BG.inc
plugins/password/localization/ca_ES.inc
plugins/password/localization/cs_CZ.inc
plugins/password/localization/da_DK.inc
plugins/password/localization/de_CH.inc
plugins/password/localization/de_DE.inc
plugins/password/localization/en_US.inc
plugins/password/localization/es_AR.inc
plugins/password/localization/es_ES.inc
plugins/password/localization/et_EE.inc
plugins/password/localization/fi_FI.inc
plugins/password/localization/fr_FR.inc
plugins/password/localization/gl_ES.inc
plugins/password/localization/hr_HR.inc
plugins/password/localization/hu_HU.inc
plugins/password/localization/it_IT.inc
plugins/password/localization/ja_JP.inc
plugins/password/localization/lt_LT.inc
plugins/password/localization/lv_LV.inc
plugins/password/localization/nl_NL.inc
plugins/password/localization/pl_PL.inc
plugins/password/localization/pt_BR.inc
plugins/password/localization/pt_PT.inc
plugins/password/localization/ru_RU.inc
plugins/password/localization/sk_SK.inc
plugins/password/localization/sl_SI.inc
plugins/password/localization/sv_SE.inc
plugins/password/localization/tr_TR.inc
plugins/password/localization/zh_TW.inc
plugins/password/package.xml
plugins/password/password.js
plugins/password/password.php
plugins/redundant_attachments/config.inc.php.dist
plugins/redundant_attachments/package.xml
plugins/redundant_attachments/redundant_attachments.php
plugins/show_additional_headers/package.xml
plugins/show_additional_headers/show_additional_headers.php
plugins/squirrelmail_usercopy/config.inc.php.dist
plugins/squirrelmail_usercopy/squirrelmail_usercopy.php
plugins/subscriptions_option/localization/cs_CZ.inc
plugins/subscriptions_option/localization/de_CH.inc
plugins/subscriptions_option/localization/de_DE.inc
plugins/subscriptions_option/localization/en_US.inc
plugins/subscriptions_option/localization/es_ES.inc
plugins/subscriptions_option/localization/et_EE.inc
plugins/subscriptions_option/localization/gl_ES.inc
plugins/subscriptions_option/localization/ja_JP.inc
plugins/subscriptions_option/localization/pl_PL.inc
plugins/subscriptions_option/localization/ru_RU.inc
plugins/subscriptions_option/localization/sv_SE.inc
plugins/subscriptions_option/localization/zh_TW.inc
plugins/subscriptions_option/package.xml
plugins/subscriptions_option/subscriptions_option.php
plugins/userinfo/localization/cs_CZ.inc
plugins/userinfo/localization/da_DK.inc
plugins/userinfo/localization/de_CH.inc
plugins/userinfo/localization/en_US.inc
plugins/userinfo/localization/es_ES.inc
plugins/userinfo/localization/et_EE.inc
plugins/userinfo/localization/fr_FR.inc
plugins/userinfo/localization/gl_ES.inc
plugins/userinfo/localization/ja_JP.inc
plugins/userinfo/localization/pl_PL.inc
plugins/userinfo/localization/pt_BR.inc
plugins/userinfo/localization/pt_PT.inc
plugins/userinfo/localization/ro_RO.inc
plugins/userinfo/localization/ru_RU.inc
plugins/userinfo/localization/sv_SE.inc
plugins/userinfo/localization/zh_TW.inc
plugins/userinfo/package.xml
plugins/userinfo/userinfo.js
plugins/userinfo/userinfo.php
plugins/vcard_attachments/localization/cs_CZ.inc
plugins/vcard_attachments/localization/de_CH.inc
plugins/vcard_attachments/localization/de_DE.inc
plugins/vcard_attachments/localization/en_US.inc
plugins/vcard_attachments/localization/es_ES.inc
plugins/vcard_attachments/localization/et_EE.inc
plugins/vcard_attachments/localization/gl_ES.inc
plugins/vcard_attachments/localization/it_IT.inc
plugins/vcard_attachments/localization/ja_JP.inc
plugins/vcard_attachments/localization/pl_PL.inc
plugins/vcard_attachments/localization/pt_BR.inc
plugins/vcard_attachments/localization/ru_RU.inc
plugins/vcard_attachments/localization/sv_SE.inc
plugins/vcard_attachments/localization/zh_TW.inc
plugins/vcard_attachments/package.xml
plugins/vcard_attachments/skins/default/style.css
plugins/vcard_attachments/skins/default/vcard.png
plugins/vcard_attachments/skins/default/vcard_add_contact.png
plugins/vcard_attachments/skins/larry/style.css
plugins/vcard_attachments/skins/larry/vcard.png
plugins/vcard_attachments/skins/larry/vcard_add_contact.png
plugins/vcard_attachments/vcard_attachments.php
plugins/vcard_attachments/vcardattach.js
plugins/virtuser_file/package.xml
plugins/virtuser_file/virtuser_file.php
plugins/virtuser_query/package.xml
plugins/virtuser_query/virtuser_query.php |