You are here

function imageeditor_editors in Image Editor 6

6 calls to imageeditor_editors()
imageeditor_enabled in ./imageeditor.module
imageeditor_process_element in ./imageeditor.module
Process function for pixlr-enabled fields.
imageeditor_widget_settings in ./imageeditor.module
A list of settings needed by Pixlr module on widgets.
imageeditor_widget_settings_form in ./imageeditor.module
Configuration form for editing Pixlr settings for a field instance.
theme_imageeditor_widget_editors in ./imageeditor.module

... See full list

File

./imageeditor.module, line 705
Allows online editing of images using different image editing services.

Code

function imageeditor_editors() {
  static $editors;
  if (empty($editors)) {
    global $user;
    $close_path = 'imageeditor/ajax/close';
    $save_path = 'imageeditor/ajax/save';
    $editors = array(
      'paintweb' => array(
        'name' => t('PaintWeb'),
        'description' => 'EXPERIMENTAL: ' . t('Open-source HTML 5 image editor'),
        'class' => 'paintweb',
        'site' => 'http://code.google.com/p/paintweb/',
        'api_key' => FALSE,
        'launch_type' => 'overlay',
        'save_url_param' => 'data',
        'save_url_default' => url($save_path . '/paintweb', array(
          'absolute' => TRUE,
        )),
        'options' => array(
          'configFile' => 'config-example.json',
        ),
      ),
      'pixlr_editor' => array(
        'name' => t('Pixlr Editor'),
        'description' => t('Advanced Photoshop like editor'),
        'class' => 'pixlr-editor',
        'site' => 'http://pixlr.com',
        'api_key' => FALSE,
        'launch_type' => 'overlay',
        //either 'overlay' or 'popup'
        'image_url_param' => 'image',
        'save_url_param' => 'target',
        'save_url_default' => url($save_path . '/pixlr', array(
          'absolute' => TRUE,
        )),
        'options' => array(
          'launch_url' => 'http://pixlr.com/editor/',
          'exit' => url($close_path . '/pixlr', array(
            'absolute' => TRUE,
          )),
          'loc' => $user->language,
          //'referrer' => 'Drupal: ' . variable_get('site_name', '') . ' (' . url('', array('absolute' => TRUE)) . ')',
          'referrer' => 'Drupal: ' . url('', array(
            'absolute' => TRUE,
          )),
          'credentials' => 'false',
        ),
      ),
      'pixlr_express' => array(
        'name' => t('Pixlr Express'),
        'description' => t('Photo editor'),
        'class' => 'pixlr-express',
        'site' => 'http://pixlr.com',
        'api_key' => FALSE,
        'launch_type' => 'overlay',
        'image_url_param' => 'image',
        'save_url_param' => 'target',
        'save_url_default' => url($save_path . '/pixlr', array(
          'absolute' => TRUE,
        )),
        'options' => array(
          'launch_url' => 'http://pixlr.com/express/',
          'exit' => url($close_path . '/pixlr', array(
            'absolute' => TRUE,
          )),
          'loc' => $user->language,
          //'referrer' => 'Drupal: ' . variable_get('site_name', '') . ' (' . url('', array('absolute' => TRUE)) . ')',
          'referrer' => 'Drupal: ' . url('', array(
            'absolute' => TRUE,
          )),
          'credentials' => 'false',
        ),
      ),
      'picnik' => array(
        'name' => t('Picnik'),
        'description' => t('Photo editor'),
        'class' => 'picnik',
        'site' => 'http://www.picnik.com',
        'api_key' => TRUE,
        'api_key_codename' => 'imageeditor_picnik_api_key',
        'launch_type' => 'overlay',
        'image_url_param' => '_import',
        'save_url_param' => '_export',
        'save_url_default' => url($save_path . '/picnik', array(
          'absolute' => TRUE,
        )),
        'options' => array(
          '_apikey' => variable_get('imageeditor_picnik_api_key', ''),
          'launch_url' => 'http://www.picnik.com/service/',
          '_close_target' => url($close_path . '/picnik', array(
            'absolute' => TRUE,
          )),
          '_export_agent' => 'browser',
          '_export_method' => 'GET',
          '_export_title' => 'Save to ' . variable_get('site_name', ''),
          '_host_name' => variable_get('site_name', ''),
          '_replace' => 'ask',
        ),
        'lang_option' => '_locale',
        'lang_default' => 'en_US',
        'lang_map' => array(
          'en' => 'en_US',
          //English
          'de' => 'de_DE',
          //German
          'es' => 'es_ES',
          //Spanish
          'fr' => 'fr_FR',
          //French
          'it' => 'it_IT',
          //Italian
          'ja' => 'jp_JP',
          //Japanese
          'ru' => 'ru_RU',
          //Russian
          'zh-hans' => 'zh_CN',
          //Chinese simplified
          'zh-hant' => 'zh_HK',
          //Chinese traditional
          'id' => 'id_ID',
          //Indonesian
          'ko' => 'ko_KR',
          //Korean
          'nn' => 'no_NO',
          //Norwegian Nynorsk
          'nb' => 'no_NO',
          //Norwegian Bokmal
          'pt-br' => 'pt_BR',
          //Portuguese Brazil
          'pt-pt' => 'pt_BR',
          //Portuguese Portugal
          'sv' => 'sv_SV',
          //Swedish
          'vi' => 'vi_VN',
        ),
      ),
      'aviary_feather' => array(
        'name' => t('Aviary Feather'),
        'description' => t('Simple photo editor - only edit images, no create new image option'),
        'class' => 'aviary-feather',
        'site' => 'http://www.aviary.com/',
        'api_key' => TRUE,
        'api_key_codename' => 'imageeditor_aviary_api_key',
        'options' => array(),
      ),
      'aviary_phoenix' => array(
        'name' => t('Aviary Phoenix'),
        'description' => t('Advanced image editor'),
        'class' => 'aviary-phoenix',
        'site' => 'http://www.aviary.com/tools/image-editor',
        'api_key' => TRUE,
        'api_key_codename' => 'imageeditor_aviary_adv_api_key',
        'launch_type' => 'overlay',
        'image_url_param' => 'loadurl',
        'save_url_param' => 'posturl',
        'save_url_default' => url($save_path . '/aviary', array(
          'absolute' => TRUE,
        )),
        'options' => array(
          'apil' => variable_get('imageeditor_aviary_adv_api_key', ''),
          'launch_url' => 'http://www.aviary.com/online/image-editor',
          'postagent' => 'client',
          'exiturl' => url($close_path . '/aviary', array(
            'absolute' => TRUE,
          )),
          'exiturltarget' => 'replace',
          'sitename' => variable_get('site_name', ''),
        ),
      ),
      'aviary_raven' => array(
        'name' => t('Aviary Raven'),
        'description' => 'NOT WORKING: ' . t('Vector editor'),
        'class' => 'aviary-raven',
        'site' => 'http://www.aviary.com/tools/vector-editor',
        'api_key' => TRUE,
        'api_key_codename' => 'imageeditor_aviary_adv_api_key',
        'launch_type' => 'overlay',
        'image_url_param' => 'loadurl',
        'save_url_param' => 'posturl',
        'save_url_default' => url($save_path . '/aviary', array(
          'absolute' => TRUE,
        )),
        'options' => array(
          'apil' => variable_get('imageeditor_aviary_adv_api_key', ''),
          'launch_url' => 'http://www.aviary.com/online/vector-editor',
          'postagent' => 'client',
          'exiturl' => url($close_path . '/aviary', array(
            'absolute' => TRUE,
          )),
          'exiturltarget' => 'replace',
          'sitename' => variable_get('site_name', ''),
        ),
      ),
      'aviary_peacock' => array(
        'name' => t('Aviary Peacock'),
        'description' => t('Effects editor'),
        'class' => 'aviary-peacock',
        'site' => 'http://www.aviary.com/tools/filter-editor',
        'api_key' => TRUE,
        'api_key_codename' => 'imageeditor_aviary_adv_api_key',
        'launch_type' => 'overlay',
        'image_url_param' => 'loadurl',
        'save_url_param' => 'posturl',
        'save_url_default' => url($save_path . '/aviary', array(
          'absolute' => TRUE,
        )),
        'options' => array(
          'apil' => variable_get('imageeditor_aviary_adv_api_key', ''),
          'launch_url' => 'http://www.aviary.com/online/filter-editor',
          'postagent' => 'client',
          'exiturl' => url($close_path . '/aviary', array(
            'absolute' => TRUE,
          )),
          'exiturltarget' => 'replace',
          'sitename' => variable_get('site_name', ''),
        ),
      ),
      'aviary_falcon' => array(
        'name' => t('Aviary Falcon'),
        'description' => 'NOT SAVING BACK: ' . t('Image markup editor'),
        'class' => 'aviary-falcon',
        'site' => 'http://www.aviary.com/tools/falcon',
        'api_key' => TRUE,
        'api_key_codename' => 'imageeditor_aviary_adv_api_key',
        'launch_type' => 'overlay',
        'image_url_param' => 'loadurl',
        'save_url_param' => 'posturl',
        'save_url_default' => url($save_path . '/aviary', array(
          'absolute' => TRUE,
        )),
        'options' => array(
          'apil' => variable_get('imageeditor_aviary_adv_api_key', ''),
          'launch_url' => 'http://www.aviary.com/launch/falcon',
          'postagent' => 'client',
          'exiturl' => url($close_path . '/aviary', array(
            'absolute' => TRUE,
          )),
          'exiturltarget' => 'replace',
          'sitename' => variable_get('site_name', ''),
        ),
      ),
      'sumopaint' => array(
        'name' => t('Sumo Paint'),
        'description' => t('Advanced image editor'),
        'class' => 'sumopaint',
        'site' => 'http://www.sumopaint.com/home/',
        'api_key' => TRUE,
        'api_key_codename' => 'imageeditor_sumopaint_api_key',
        'launch_type' => 'popup',
        'image_url_param' => 'url',
        'save_url_param' => 'target',
        'save_url_default' => url($save_path . '/sumopaint', array(
          'absolute' => TRUE,
        )),
        'options' => array(
          'key' => variable_get('imageeditor_sumopaint_api_key', ''),
          'launch_url' => 'http://www.sumopaint.com/app/',
          'service' => 'Save to ' . variable_get('site_name', ''),
        ),
      ),
      'fotoflexer' => array(
        'name' => t('FotoFlexer'),
        'description' => t('Simple photo editor'),
        'class' => 'fotoflexer',
        'site' => 'http://fotoflexer.com/',
        'api_key' => FALSE,
        'launch_type' => 'popup',
        'image_url_param' => 'ff_image_url',
        'save_url_param' => 'ff_callback_url',
        'save_url_default' => url($save_path . '/fotoflexer', array(
          'absolute' => TRUE,
        )),
        'options' => array(
          'launch_url' => 'http://fotoflexer.com/API/API_Loader_v1_01.php',
          'ff_cancel_url' => url($close_path . '/fotoflexer', array(
            'absolute' => TRUE,
          )),
        ),
        'lang_option' => 'ff_lang',
        'lang_default' => 'en-US',
        'lang_map' => array(
          'en' => 'en-US',
          //English
          'de' => 'de-DE',
          //German
          'es' => 'es-ES',
          //Spanish
          'fr' => 'fr-FR',
          //French
          'it' => 'it-IT',
          //Italian
          'ja' => 'ja-JP',
          //Japanese
          'ru' => 'ru-RU',
          //Russian
          'zh-hans' => 'zh-CN',
          //Chinese simplified
          'zh-hant' => 'zh-TW',
          //Chinese traditional
          'ko' => 'ko-KR',
          //Korean
          'nb' => 'nb-NO',
          //Norwegian Bokmal
          'pl' => 'pl-PL',
          //Polish
          'pt-br' => 'pt-BR',
          //Portuguese Brazil
          'pt-pt' => 'pt-PT',
          //Portuguese Portugal
          'sv' => 'sv_SE',
          //Swedish
          'vi' => 'vi-VN',
          //Vietnamese
          'da' => 'da-DK',
          //Danish
          'nl' => 'nl-NL',
          //Dutch
          'fi' => 'fi-FI',
          //Finnish
          'tr' => 'tu-TR',
        ),
      ),
      'flauntr_styler' => array(
        'name' => t('flauntR stylR'),
        'description' => 'NOT SAVING BACK: ' . t('Advanced image editor'),
        'class' => 'flauntr-styler',
        'site' => 'http://www.flauntr.com/',
        'api_key' => FALSE,
        'launch_type' => 'overlay',
        'image_url_param' => 'url',
        'save_url_param' => 'none',
        'save_url_default' => 'none',
        'options' => array(
          'launch_url' => 'http://www.flauntr.com/flauntr/applauncher.do',
          'app' => 'styler',
        ),
      ),
    );
    if (module_exists('libraries')) {
      $editors['paintweb']['include_js'] = libraries_get_path('paintweb') . '/build/paintweb.src.js';

      //$editors['paintweb']['include_js'] = libraries_get_path('paintweb') . '/build/paintweb.js';
    }
    else {
      $editors['paintweb']['include_js'] = 'sites/all/libraries/paintweb' . '/build/paintweb.src.js';

      //$editors['paintweb']['include_js'] = 'sites/all/libraries/paintweb' . '/build/paintweb.js';
    }

    // Invoke hook_imageeditor_editors_alter().
    drupal_alter('imageeditor_editors', $editors);
  }
  return $editors;
}