You are here

function plupload_library in Plupload integration 7

Same name and namespace in other branches
  1. 7.2 plupload.module \plupload_library()

Implements hook_library().

2 calls to plupload_library()
plupload_requirements in ./plupload.install
Implements hook_requirements().
_plupload_requirements_installed in ./plupload.install
Checks wether Plupload library exists or not.

File

./plupload.module, line 311
Implementation of plupload.module.

Code

function plupload_library() {
  $library_path = _plupload_library_path();
  $libraries['plupload'] = array(
    'title' => 'Plupload',
    'website' => 'http://www.plupload.com',
    'version' => '1.5.1.1',
    'js' => array(
      // @todo - only add gears JS if gears is an enabled runtime.
      // $library_path . '/js/gears_init.js' => array(),
      $library_path . '/js/jquery.plupload.queue/jquery.plupload.queue.js' => array(),
      $library_path . '/js/plupload.full.js' => array(),
      0 => array(
        'type' => 'setting',
        'data' => array(
          'plupload' => array(
            // Element-specific settings get keyed by the element id (see
            // plupload_element_pre_render()), so put default settings in
            // '_default' (Drupal element ids do not have underscores, because
            // they have hyphens instead).
            '_default' => array(
              // @todo Provide a settings page for configuring these.
              'runtimes' => 'html5,flash,html4',
              'url' => url('plupload-handle-uploads', array(
                'query' => array(
                  'plupload_token' => drupal_get_token('plupload-handle-uploads'),
                ),
              )),
              'max_file_size' => file_upload_max_size() . 'b',
              'chunk_size' => parse_size(ini_get('post_max_size')) . 'b',
              'unique_names' => TRUE,
              'flash_swf_url' => file_create_url($library_path . '/js/plupload.flash.swf'),
              'silverlight_xap_url' => file_create_url($library_path . '/js/plupload.silverlight.xap'),
            ),
          ),
        ),
      ),
    ),
  );
  if (module_exists('locale')) {
    $module_path = drupal_get_path('module', 'plupload');
    $libraries['plupload']['js'][$module_path . '/js/i18n.js'] = array(
      'scope' => 'footer',
    );
  }
  return $libraries;
}