updated elysia_cron, elfinder, metatag, libraries, email_registration, migrate, nodeform_cols
This commit is contained in:
@@ -1 +1,19 @@
|
||||
// $Id$
|
||||
/*
|
||||
* elFinder Integration
|
||||
*
|
||||
* Copyright (c) 2010-2018, Alexey Sukhotin. All rights reserved.
|
||||
*/
|
||||
|
||||
function elfinder_bueditor_callback(url) {
|
||||
var img = jQuery('<img/>').attr('src', url).css('display', 'none').insertBefore(jQuery('#finder'));
|
||||
parent.jQuery("#bue-tgd-form input[name=attr_width]").val(img.width());
|
||||
parent.jQuery("#bue-tgd-form input[name=attr_height]").val(img.height());
|
||||
parent.BUE.imce.target.value = url;
|
||||
parent.BUE.popups['bue-imce-pop'].close();
|
||||
}
|
||||
|
||||
function elfinder_bue_callback(url) {
|
||||
elfinder_bueditor_callback(url);
|
||||
}
|
||||
|
||||
|
||||
|
@@ -1,23 +1,29 @@
|
||||
<?php
|
||||
/**
|
||||
* elFinder Integration
|
||||
*
|
||||
* Copyright (c) 2010-2018, Alexey Sukhotin. All rights reserved.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file
|
||||
* BUEditor integration plugin
|
||||
*/
|
||||
|
||||
/**
|
||||
* Pseudo-hook for elfinder hook_wysiwyg_plugin implementation
|
||||
*/
|
||||
* Pseudo-hook for elfinder hook_wysiwyg_plugin implementation
|
||||
*/
|
||||
function elfinder_bueditor_elfinder_editor_plugin($options) {
|
||||
drupal_add_js(array('elfinder' => array('moduleUrl' => url('elfinder'))), 'setting');
|
||||
drupal_add_js(array('elfinder' => array('moduleUrl' => url('elfinder'))), 'setting');
|
||||
drupal_add_js($options['plugin_url_base'] . '/bueditor.js');
|
||||
drupal_add_js(array('elfinder' => array('moduleUrl' => url('elfinder'))), 'setting');
|
||||
drupal_add_js(array('elfinder' => array('moduleUrl' => url('elfinder'))), 'setting');
|
||||
drupal_add_js($options['plugin_url_base'] . '/bueditor.js');
|
||||
|
||||
return array(
|
||||
'elfinder' => array(
|
||||
'extensions' => array('elfinder' => t('elFinder')),
|
||||
'url' => $options['homepage_url'],
|
||||
'options' => array(),
|
||||
'load' => FALSE,
|
||||
),
|
||||
);
|
||||
return array(
|
||||
'elfinder' => array(
|
||||
'extensions' => array('elfinder' => t('elFinder')),
|
||||
'url' => $options['homepage_url'],
|
||||
'options' => array(),
|
||||
'load' => FALSE,
|
||||
),
|
||||
);
|
||||
}
|
||||
|
@@ -1,12 +1,18 @@
|
||||
/*
|
||||
* elFinder Integration
|
||||
*
|
||||
* Copyright (c) 2010-2018, Alexey Sukhotin. All rights reserved.
|
||||
*/
|
||||
|
||||
// $Id: elfinder.bueditor.js,v 1.1 2010/10/06 09:44:51 ph0enix Exp $
|
||||
|
||||
Drupal.elfinder.editor.bueditor = {
|
||||
fn : {
|
||||
fn: {
|
||||
attach: Drupal.wysiwyg.editor.attach.bueditor
|
||||
}
|
||||
}
|
||||
|
||||
Drupal.wysiwyg.editor.attach.bueditor = function(context, params, settings) {
|
||||
Drupal.settings.BUE.imceURL = Drupal.settings.elfinder.moduleUrl;
|
||||
Drupal.elfinder.editor.bueditor.fn.attach.apply(this, arguments);
|
||||
Drupal.settings.BUE.imceURL = Drupal.settings.elfinder.moduleUrl;
|
||||
Drupal.elfinder.editor.bueditor.fn.attach.apply(this, arguments);
|
||||
}
|
||||
|
@@ -1,4 +1,8 @@
|
||||
|
||||
/*
|
||||
* elFinder Integration
|
||||
*
|
||||
* Copyright (c) 2010-2019, Alexey Sukhotin. All rights reserved.
|
||||
*/
|
||||
|
||||
function elfinder_ckeditor_callback(arg1) {
|
||||
|
||||
@@ -7,13 +11,23 @@ function elfinder_ckeditor_callback(arg1) {
|
||||
if (typeof arg1 == 'object') {
|
||||
url = arg1.url;
|
||||
}
|
||||
|
||||
funcNum = window.location.search.replace(/^.*CKEditorFuncNum=(\d+).*$/, "$1");
|
||||
|
||||
window.opener.CKEDITOR.tools.callFunction(funcNum, url, function() {
|
||||
// adapted from http://docs.ckeditor.com/#!/guide/dev_file_browser_api
|
||||
|
||||
var dialog = this.getDialog();
|
||||
if (dialog.getName() == 'link' ) {
|
||||
|
||||
if (dialog.getName() == 'link') {
|
||||
|
||||
var element = dialog.getContentElement('info', 'linkDisplayText');
|
||||
var display_text = element.getValue();
|
||||
var display_text = null;
|
||||
|
||||
if (element) {
|
||||
display_text = element.getValue();
|
||||
}
|
||||
|
||||
// If display text is blank, insert the filename.
|
||||
if (element && !display_text) {
|
||||
element.setValue(arg1.name);
|
||||
@@ -24,7 +38,7 @@ function elfinder_ckeditor_callback(arg1) {
|
||||
// Avoid beforeunload event when selecting an image.
|
||||
// See https://github.com/Studio-42/elFinder/issues/1340
|
||||
// Maybe remove this when elfinder js library gets updated.
|
||||
$(window).off('beforeunload');
|
||||
jQuery(window).off('beforeunload');
|
||||
|
||||
window.close();
|
||||
}
|
||||
|
@@ -1,4 +1,9 @@
|
||||
<?php
|
||||
/**
|
||||
* elFinder Integration
|
||||
*
|
||||
* Copyright (c) 2010-2018, Alexey Sukhotin. All rights reserved.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file
|
||||
@@ -6,8 +11,8 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
* Pseudo-hook for elfinder hook_wysiwyg_plugin implementation
|
||||
*/
|
||||
* Pseudo-hook for elfinder hook_wysiwyg_plugin implementation
|
||||
*/
|
||||
function elfinder_ckeditor_elfinder_editor_plugin($options) {
|
||||
return array(
|
||||
'elfinder' => array(
|
||||
@@ -18,6 +23,7 @@ function elfinder_ckeditor_elfinder_editor_plugin($options) {
|
||||
'filebrowserUploadUrl' => url('elfinder/upload/ckeditor'),
|
||||
'filebrowserImageUploadUrl' => url('elfinder/upload/ckeditor'),
|
||||
'filebrowserFlashUploadUrl' => url('elfinder/upload/ckeditor'),
|
||||
//'filebrowserBrowseUrl' => 'javascript:alert(12345);return false;//',
|
||||
),
|
||||
'load' => FALSE,
|
||||
),
|
||||
|
@@ -1,36 +1,42 @@
|
||||
<?php
|
||||
/**
|
||||
* elFinder Integration
|
||||
*
|
||||
* Copyright (c) 2010-2018, Alexey Sukhotin. All rights reserved.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file
|
||||
*
|
||||
*
|
||||
* CKeditor Upload tab support
|
||||
*/
|
||||
|
||||
function elfinder_editor_upload_ckeditor() {
|
||||
|
||||
|
||||
$p = elfinder_get_user_profile();
|
||||
|
||||
$dest = file_build_uri('');
|
||||
|
||||
if (!strpos($p->settings['ckeditor_upload_directory'], '://')) {
|
||||
$dest .= $p->settings['ckeditor_upload_directory'];
|
||||
} else {
|
||||
$dest = $p->settings['ckeditor_upload_directory'];
|
||||
}
|
||||
|
||||
$dest = elfinder_parse_path_tokens($dest);
|
||||
|
||||
$destabs = drupal_realpath($dest);
|
||||
|
||||
if (!file_prepare_directory($destabs, FILE_CREATE_DIRECTORY)) {
|
||||
if (!strpos($p->settings['ckeditor_upload_directory'], '://')) {
|
||||
$dest .= $p->settings['ckeditor_upload_directory'];
|
||||
} else {
|
||||
$dest = $p->settings['ckeditor_upload_directory'];
|
||||
}
|
||||
|
||||
$dest = elfinder_parse_path_tokens($dest);
|
||||
|
||||
$destabs = drupal_realpath($dest);
|
||||
|
||||
if (!file_prepare_directory($destabs, FILE_CREATE_DIRECTORY)) {
|
||||
drupal_set_message(t('Error. Cannot initialize directory %dir', array('%dir' => $destabs)), 'error');
|
||||
}
|
||||
|
||||
|
||||
$tmpf = $_FILES;
|
||||
|
||||
|
||||
foreach (array_keys($_FILES['upload']) as $key) {
|
||||
$tmpf['files'][$key]['upload'] = $_FILES['upload'][$key];
|
||||
}
|
||||
|
||||
|
||||
$_FILES = $tmpf;
|
||||
|
||||
$file = file_save_upload('upload', array(), $dest);
|
||||
@@ -38,7 +44,7 @@ function elfinder_editor_upload_ckeditor() {
|
||||
file_save($file);
|
||||
|
||||
header('Content-Type: text/html');
|
||||
|
||||
|
||||
print '<script type="text/javascript">';
|
||||
|
||||
if ($file) {
|
||||
|
@@ -1,5 +1,10 @@
|
||||
// $Id$
|
||||
/*
|
||||
* elFinder Integration
|
||||
*
|
||||
* Copyright (c) 2010-2018, Alexey Sukhotin. All rights reserved.
|
||||
*/
|
||||
|
||||
function elfinder_drupalnodeattach_callback(url) {
|
||||
parent.jQuery('input#edit-attach-url').val(url);
|
||||
parent.jQuery('input#edit-attach-url').val(url);
|
||||
alert(url);
|
||||
}
|
@@ -1 +1,10 @@
|
||||
// $Id$
|
||||
/*
|
||||
* elFinder Integration
|
||||
*
|
||||
* Copyright (c) 2010-2018, Alexey Sukhotin. All rights reserved.
|
||||
*/
|
||||
|
||||
function elfinder_fckeditor_callback(url) {
|
||||
window.opener.SetUrl(url);
|
||||
window.close();
|
||||
}
|
@@ -1,34 +1,40 @@
|
||||
<?php
|
||||
/**
|
||||
* elFinder Integration
|
||||
*
|
||||
* Copyright (c) 2010-2018, Alexey Sukhotin. All rights reserved.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file
|
||||
* FCKeditor integration plugin
|
||||
*/
|
||||
|
||||
/**
|
||||
* Pseudo-hook for elfinder hook_wysiwyg_plugin implementation
|
||||
*/
|
||||
* Pseudo-hook for elfinder hook_wysiwyg_plugin implementation
|
||||
*/
|
||||
function elfinder_fckeditor_elfinder_editor_plugin($options) {
|
||||
return array(
|
||||
'elfinder' => array(
|
||||
'extensions' => array('elfinder' => t('elFinder')),
|
||||
'url' => $options['homepage_url'],
|
||||
'options' => array(
|
||||
'LinkBrowser' => TRUE,
|
||||
'LinkBrowserURL' => $options['elfinder_url'],
|
||||
'ImageBrowser' => TRUE,
|
||||
'ImageBrowserURL' => $options['elfinder_url'],
|
||||
'FlashBrowser' => TRUE,
|
||||
'FlashBrowserURL' => $options['elfinder_url'],
|
||||
'ImageUpload' => TRUE,
|
||||
'ImageUploadURL' => url('elfinder/upload/fckeditor'),
|
||||
'FlashUpload' => TRUE,
|
||||
// 'FlashUploadURL' => $options['elfinder_connector_url'],
|
||||
'LinkUpload' => TRUE,
|
||||
// 'LinkUploadURL' => $options['elfinder_connector_url'],
|
||||
|
||||
return array(
|
||||
'elfinder' => array(
|
||||
'extensions' => array('elfinder' => t('elFinder')),
|
||||
'url' => $options['homepage_url'],
|
||||
'options' => array(
|
||||
'LinkBrowser' => TRUE,
|
||||
'LinkBrowserURL' => $options['elfinder_url'],
|
||||
'ImageBrowser' => TRUE,
|
||||
'ImageBrowserURL' => $options['elfinder_url'],
|
||||
'FlashBrowser' => TRUE,
|
||||
'FlashBrowserURL' => $options['elfinder_url'],
|
||||
'ImageUpload' => TRUE,
|
||||
'ImageUploadURL' => url('elfinder/upload/fckeditor'),
|
||||
'FlashUpload' => TRUE,
|
||||
// 'FlashUploadURL' => $options['elfinder_connector_url'],
|
||||
'LinkUpload' => TRUE,
|
||||
// 'LinkUploadURL' => $options['elfinder_connector_url'],
|
||||
|
||||
),
|
||||
'load' => FALSE,
|
||||
),
|
||||
);
|
||||
|
||||
),
|
||||
'load' => FALSE,
|
||||
),
|
||||
);
|
||||
}
|
||||
|
@@ -1,53 +1,59 @@
|
||||
<?php
|
||||
/**
|
||||
* elFinder Integration
|
||||
*
|
||||
* Copyright (c) 2010-2018, Alexey Sukhotin. All rights reserved.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file
|
||||
*
|
||||
*
|
||||
* FCKeditor Upload tab support
|
||||
*/
|
||||
|
||||
function elfinder_editor_upload_fckeditor() {
|
||||
|
||||
|
||||
$p = elfinder_get_user_profile();
|
||||
|
||||
$dest = file_build_uri('');
|
||||
|
||||
if (!strpos($p->settings['ckeditor_upload_directory'], '://')) {
|
||||
$dest .= $p->settings['ckeditor_upload_directory'];
|
||||
} else {
|
||||
$dest = $p->settings['ckeditor_upload_directory'];
|
||||
}
|
||||
|
||||
$dest = elfinder_parse_path_tokens($dest);
|
||||
|
||||
$destabs = drupal_realpath($dest);
|
||||
|
||||
if (!file_prepare_directory($destabs, FILE_CREATE_DIRECTORY)) {
|
||||
if (!strpos($p->settings['ckeditor_upload_directory'], '://')) {
|
||||
$dest .= $p->settings['ckeditor_upload_directory'];
|
||||
} else {
|
||||
$dest = $p->settings['ckeditor_upload_directory'];
|
||||
}
|
||||
|
||||
$dest = elfinder_parse_path_tokens($dest);
|
||||
|
||||
$destabs = drupal_realpath($dest);
|
||||
|
||||
if (!file_prepare_directory($destabs, FILE_CREATE_DIRECTORY)) {
|
||||
drupal_set_message(t('Error. Cannot initialize directory %dir', array('%dir' => $destabs)), 'error');
|
||||
}
|
||||
|
||||
$tmpf = $_FILES;
|
||||
|
||||
|
||||
foreach (array_keys($_FILES['NewFile']) as $key) {
|
||||
$tmpf['files'][$key]['NewFile'] = $_FILES['NewFile'][$key];
|
||||
}
|
||||
|
||||
|
||||
$_FILES = $tmpf;
|
||||
|
||||
$file = file_save_upload('NewFile', array(), $dest);
|
||||
$file->status = FILE_STATUS_PERMANENT;
|
||||
file_save($file);
|
||||
|
||||
|
||||
|
||||
header('Content-Type: text/html');
|
||||
|
||||
print '<script type="text/javascript">';
|
||||
|
||||
|
||||
if ($file) {
|
||||
print "window.parent.OnUploadCompleted(0, '" . file_create_url($file->uri) . "', '" . $file->filename . "', '') ;";
|
||||
} else {
|
||||
print 'window.parent.OnUploadCompleted(1,"","", "' . t('Error uploading file!') . '") ;';
|
||||
}
|
||||
|
||||
|
||||
print '</script>';
|
||||
|
||||
exit();
|
||||
|
@@ -1 +1,10 @@
|
||||
// $Id$
|
||||
/*
|
||||
* elFinder Integration
|
||||
*
|
||||
* Copyright (c) 2010-2018, Alexey Sukhotin. All rights reserved.
|
||||
*/
|
||||
|
||||
function elfinder_jwysiwyg_callback(url) {
|
||||
window.opener.jQuery('.ui-dialog input[type=text][name=url]').val(url);
|
||||
window.close();
|
||||
}
|
@@ -1,29 +1,39 @@
|
||||
<?php
|
||||
/**
|
||||
* elFinder Integration
|
||||
*
|
||||
* Copyright (c) 2010-2018, Alexey Sukhotin. All rights reserved.
|
||||
*/
|
||||
|
||||
// $Id$
|
||||
|
||||
/**
|
||||
* @file
|
||||
* jWYSIWYG integration plugin
|
||||
*/
|
||||
|
||||
/**
|
||||
* Pseudo-hook for elfinder hook_wysiwyg_plugin implementation
|
||||
*/
|
||||
* Pseudo-hook for elfinder hook_wysiwyg_plugin implementation
|
||||
*/
|
||||
function elfinder_jwysiwyg_elfinder_editor_plugin($options) {
|
||||
if (module_exists('jquery_update') && module_exists('jquery_ui')) {
|
||||
drupal_add_css(JQUERY_UI_PATH . '/themes/base/ui.all.css');
|
||||
jquery_ui_add(array('ui.dialog', 'ui.accordion', 'ui.draggable', 'ui.droppable', 'ui.selectable'));
|
||||
} else {
|
||||
drupal_set_message(t('elFinder requires jQuery 1.3+ and jQuery UI 1.7+ for jWYSIWYG support. Please install and enable <a href="http://drupal.org/project/jquery_update">jquery_update</a> and <a href="http://drupal.org/project/jquery_ui">jquery_ui</a> modules.'), 'error');
|
||||
}
|
||||
|
||||
drupal_add_js(array('elfinder' => array('file_browser_url' => $options['elfinder_url'])), 'setting');
|
||||
drupal_add_js($options['plugin_url_base'] . '/jwysiwyg.js');
|
||||
|
||||
return array(
|
||||
'elfinder' => array(
|
||||
'extensions' => array('elfinder' => t('elFinder')),
|
||||
'url' => $options['homepage_url'],
|
||||
'options' => array(),
|
||||
'load' => FALSE,
|
||||
),
|
||||
);
|
||||
if (VERSION < 7) {
|
||||
if (module_exists('jquery_update') && module_exists('jquery_ui')) {
|
||||
drupal_add_css(JQUERY_UI_PATH . '/themes/base/ui.all.css');
|
||||
jquery_ui_add(array('ui.dialog', 'ui.accordion', 'ui.draggable', 'ui.droppable', 'ui.selectable'));
|
||||
} else {
|
||||
drupal_set_message(t('elFinder requires jQuery 1.3+ and jQuery UI 1.7+ for jWYSIWYG support. Please install and enable <a href="http://drupal.org/project/jquery_update">jquery_update</a> and <a href="http://drupal.org/project/jquery_ui">jquery_ui</a> modules.'), 'error');
|
||||
}
|
||||
}
|
||||
|
||||
drupal_add_js(array('elfinder' => array('file_browser_url' => $options['elfinder_url'])), 'setting');
|
||||
drupal_add_js($options['plugin_url_base'] . '/jwysiwyg.js');
|
||||
|
||||
return array(
|
||||
'elfinder' => array(
|
||||
'extensions' => array('elfinder' => t('elFinder')),
|
||||
'url' => $options['homepage_url'],
|
||||
'options' => array(),
|
||||
'load' => FALSE,
|
||||
),
|
||||
);
|
||||
}
|
||||
|
@@ -1,34 +1,40 @@
|
||||
/*
|
||||
* elFinder Integration
|
||||
*
|
||||
* Copyright (c) 2010-2018, Alexey Sukhotin. All rights reserved.
|
||||
*/
|
||||
|
||||
// $Id: elfinder.jwysiwyg.js,v 1.1 2010/10/06 09:44:51 ph0enix Exp $
|
||||
|
||||
(function($) {
|
||||
|
||||
Drupal.elfinder.editor.jwysiwyg = {
|
||||
fn : {
|
||||
attach: Drupal.wysiwyg.editor.attach.jwysiwyg
|
||||
}
|
||||
}
|
||||
|
||||
Drupal.wysiwyg.editor.attach.jwysiwyg = function(context, params, settings) {
|
||||
|
||||
var imgHtml = null;
|
||||
|
||||
if (jQuery.fn.wysiwyg.defaults) {
|
||||
imgHtml = jQuery.fn.wysiwyg.defaults.formImageHtml;
|
||||
}
|
||||
|
||||
var oImgHtml = $('<div>'+imgHtml+'</div>');
|
||||
var oUrl = $("input[name=url]", oImgHtml);
|
||||
var browsebutton = $('<input type="button">');
|
||||
|
||||
browsebutton.attr('value', Drupal.t('Browse Server'));
|
||||
browsebutton.attr('onclick', 'var w = window; w.open("' + Drupal.settings.elfinder.file_browser_url + '","","toolbar=no,menubar=no,width=600,height=600")');
|
||||
browsebutton.insertAfter(oUrl);
|
||||
|
||||
if (jQuery.fn.wysiwyg.defaults) {
|
||||
jQuery.fn.wysiwyg.defaults.formImageHtml = oImgHtml.html();
|
||||
Drupal.elfinder.editor.jwysiwyg = {
|
||||
fn: {
|
||||
attach: Drupal.wysiwyg.editor.attach.jwysiwyg
|
||||
}
|
||||
}
|
||||
|
||||
Drupal.elfinder.editor.jwysiwyg.fn.attach.apply(this, arguments);
|
||||
}
|
||||
Drupal.wysiwyg.editor.attach.jwysiwyg = function(context, params, settings) {
|
||||
|
||||
var imgHtml = null;
|
||||
|
||||
if (jQuery.fn.wysiwyg.defaults) {
|
||||
imgHtml = jQuery.fn.wysiwyg.defaults.formImageHtml;
|
||||
}
|
||||
|
||||
var oImgHtml = $('<div>' + imgHtml + '</div>');
|
||||
var oUrl = $("input[name=url]", oImgHtml);
|
||||
var browsebutton = $('<input type="button">');
|
||||
|
||||
browsebutton.attr('value', Drupal.t('Browse Server'));
|
||||
browsebutton.attr('onclick', 'var w = window; w.open("' + Drupal.settings.elfinder.file_browser_url + '","","toolbar=no,menubar=no,width=600,height=600")');
|
||||
browsebutton.insertAfter(oUrl);
|
||||
|
||||
if (jQuery.fn.wysiwyg.defaults) {
|
||||
jQuery.fn.wysiwyg.defaults.formImageHtml = oImgHtml.html();
|
||||
}
|
||||
|
||||
Drupal.elfinder.editor.jwysiwyg.fn.attach.apply(this, arguments);
|
||||
}
|
||||
|
||||
})(jQuery);
|
@@ -1 +1,38 @@
|
||||
// $Id$
|
||||
/*
|
||||
* elFinder Integration
|
||||
*
|
||||
* Copyright (c) 2010-2018, Alexey Sukhotin. All rights reserved.
|
||||
*/
|
||||
|
||||
var elfinder_tinymce_callback = function(arg1) {
|
||||
var url = arg1;
|
||||
|
||||
if (typeof arg1 == 'object') {
|
||||
url = arg1.url;
|
||||
}
|
||||
/* window.tinymceFileWin.document.forms[0].elements[window.tinymceFileField].value = url;
|
||||
window.tinymceFileWin.focus();
|
||||
window.close();*/
|
||||
|
||||
//make inline popup work
|
||||
|
||||
var win = tinyMCEPopup.getWindowArg("window");
|
||||
|
||||
// insert information now
|
||||
win.document.getElementById(tinyMCEPopup.getWindowArg("input")).value = url;
|
||||
|
||||
// are we an image browser
|
||||
if (typeof (win.ImageDialog) != "undefined") {
|
||||
// we are, so update image dimensions...
|
||||
if (win.ImageDialog.getImageData)
|
||||
win.ImageDialog.getImageData();
|
||||
|
||||
// ... and preview if necessary
|
||||
if (win.ImageDialog.showPreviewImage)
|
||||
win.ImageDialog.showPreviewImage(url);
|
||||
}
|
||||
|
||||
// close popup window
|
||||
tinyMCEPopup.close();
|
||||
|
||||
}
|
||||
|
@@ -1,24 +1,30 @@
|
||||
<?php
|
||||
/**
|
||||
* elFinder Integration
|
||||
*
|
||||
* Copyright (c) 2010-2018, Alexey Sukhotin. All rights reserved.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file
|
||||
* TinyMCE integration plugin
|
||||
*/
|
||||
|
||||
/**
|
||||
* Pseudo-hook for elfinder hook_wysiwyg_plugin implementation
|
||||
*/
|
||||
* Pseudo-hook for elfinder hook_wysiwyg_plugin implementation
|
||||
*/
|
||||
function elfinder_tinymce_elfinder_editor_plugin($options) {
|
||||
drupal_add_js($options['plugin_url_base'] . '/tinymce.js');
|
||||
return array(
|
||||
'elfinder' => array(
|
||||
'extensions' => array('elfinder' => t('elFinder')),
|
||||
'url' => $options['homepage_url'],
|
||||
'options' => array(
|
||||
'file_browser_callback' => 'elfinder_tinymce_browse_callback',
|
||||
'file_browser_url' => $options['elfinder_url'], // non standard TinyMCE configuration variable to pass source application to elFinder
|
||||
'inline_styles' => TRUE,
|
||||
),
|
||||
'load' => FALSE,
|
||||
),
|
||||
);
|
||||
drupal_add_js($options['plugin_url_base'] . '/tinymce.js');
|
||||
return array(
|
||||
'elfinder' => array(
|
||||
'extensions' => array('elfinder' => t('elFinder')),
|
||||
'url' => $options['homepage_url'],
|
||||
'options' => array(
|
||||
'file_browser_callback' => 'elfinder_tinymce_browse_callback',
|
||||
'file_browser_url' => $options['elfinder_url'], // non standard TinyMCE configuration variable to pass source application to elFinder
|
||||
'inline_styles' => TRUE,
|
||||
),
|
||||
'load' => FALSE,
|
||||
),
|
||||
);
|
||||
}
|
||||
|
@@ -1,27 +1,46 @@
|
||||
/*
|
||||
* elFinder Integration
|
||||
*
|
||||
* Copyright (c) 2010-2018, Alexey Sukhotin. All rights reserved.
|
||||
*/
|
||||
|
||||
// $Id$
|
||||
|
||||
/*function elfinder_tinymce_browse_callback(field_name, url, type, win) {
|
||||
var w = window.open(tinymce.settings.file_browser_url, null, 'toolbar=yes,menubar=yes,width=600,height=500, inline=yes');
|
||||
w.tinymceFileField = field_name;
|
||||
w.tinymceFileWin = win;
|
||||
}*/
|
||||
|
||||
// MAKE INLINE POPUP WORK
|
||||
|
||||
function elfinder_tinymce_browse_callback(field_name, url, type, win) {
|
||||
/*var w = window.open(tinymce.settings.file_browser_url, null, 'toolbar=yes,menubar=yes,width=600,height=500, inline=yes');
|
||||
w.tinymceFileField = field_name;
|
||||
w.tinymceFileWin = win;*/
|
||||
|
||||
var cmsURL = tinymce.settings.file_browser_url; // script URL - use an absolute path!
|
||||
if (cmsURL.indexOf("?") < 0) {
|
||||
//add the type as the only query parameter
|
||||
cmsURL = cmsURL + "?type=" + type;
|
||||
} else {
|
||||
//add the type as an additional query parameter
|
||||
// (PHP session ID is now included if there is one at all)
|
||||
cmsURL = cmsURL + "&type=" + type;
|
||||
}
|
||||
var cmsURL = tinymce.settings.file_browser_url; // script URL - use an absolute path!
|
||||
if (cmsURL.indexOf("?") < 0) {
|
||||
//add the type as the only query parameter
|
||||
cmsURL = cmsURL + "?type=" + type;
|
||||
} else {
|
||||
//add the type as an additional query parameter
|
||||
// (PHP session ID is now included if there is one at all)
|
||||
cmsURL = cmsURL + "&type=" + type;
|
||||
}
|
||||
|
||||
tinyMCE.activeEditor.windowManager.open({
|
||||
file: cmsURL,
|
||||
title: 'File Manager',
|
||||
width: 900,
|
||||
height: 450,
|
||||
resizable: "yes",
|
||||
inline: "yes", // This parameter only has an effect if you use the inlinepopups plugin!
|
||||
popup_css: false, // Disable TinyMCE's default popup CSS
|
||||
close_previous: "no"
|
||||
}, {
|
||||
window: win,
|
||||
input: field_name
|
||||
});
|
||||
return false;
|
||||
tinyMCE.activeEditor.windowManager.open({
|
||||
file: cmsURL,
|
||||
title: 'File Manager',
|
||||
width: 900,
|
||||
height: 450,
|
||||
resizable: "yes",
|
||||
inline: "yes", // This parameter only has an effect if you use the inlinepopups plugin!
|
||||
popup_css: false, // Disable TinyMCE's default popup CSS
|
||||
close_previous: "no"
|
||||
}, {
|
||||
window: win,
|
||||
input: field_name
|
||||
});
|
||||
return false;
|
||||
}
|
||||
|
@@ -1,4 +1,10 @@
|
||||
/*
|
||||
* elFinder Integration
|
||||
*
|
||||
* Copyright (c) 2010-2018, Alexey Sukhotin. All rights reserved.
|
||||
*/
|
||||
|
||||
function elfinder_wymeditor_callback(url) {
|
||||
window.opener.jQuery('input.wym_src').val(url);
|
||||
window.close();
|
||||
window.opener.jQuery('input.wym_src').val(url);
|
||||
window.close();
|
||||
}
|
||||
|
@@ -1,4 +1,10 @@
|
||||
<?php
|
||||
/**
|
||||
* elFinder Integration
|
||||
*
|
||||
* Copyright (c) 2010-2018, Alexey Sukhotin. All rights reserved.
|
||||
*/
|
||||
|
||||
// $Id$
|
||||
|
||||
/**
|
||||
@@ -7,17 +13,17 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
* Pseudo-hook for elfinder hook_wysiwyg_plugin implementation
|
||||
*/
|
||||
* Pseudo-hook for elfinder hook_wysiwyg_plugin implementation
|
||||
*/
|
||||
function elfinder_wymeditor_elfinder_editor_plugin($options) {
|
||||
drupal_add_js($options['plugin_url_base'] . '/wymeditor.js');
|
||||
drupal_add_js(array('elfinder' => array('file_browser_url' => $options['elfinder_url'])), 'setting');
|
||||
return array(
|
||||
'elfinder' => array(
|
||||
'extensions' => array('elfinder' => t('elFinder')),
|
||||
'url' => $options['homepage_url'],
|
||||
'options' => array(),
|
||||
'load' => FALSE,
|
||||
),
|
||||
);
|
||||
drupal_add_js($options['plugin_url_base'] . '/wymeditor.js');
|
||||
drupal_add_js(array('elfinder' => array('file_browser_url' => $options['elfinder_url'])), 'setting');
|
||||
return array(
|
||||
'elfinder' => array(
|
||||
'extensions' => array('elfinder' => t('elFinder')),
|
||||
'url' => $options['homepage_url'],
|
||||
'options' => array(),
|
||||
'load' => FALSE,
|
||||
),
|
||||
);
|
||||
}
|
||||
|
@@ -1,52 +1,64 @@
|
||||
/*
|
||||
* elFinder Integration
|
||||
*
|
||||
* Copyright (c) 2010-2018, Alexey Sukhotin. All rights reserved.
|
||||
*/
|
||||
|
||||
// $Id: elfinder.wymeditor.js,v 1.1.2.2 2010/12/11 11:53:49 ph0enix Exp $
|
||||
|
||||
(function($) {
|
||||
|
||||
Drupal.elfinder.editor.wymeditor = {
|
||||
fn : {
|
||||
attach: Drupal.wysiwyg.editor.attach.wymeditor
|
||||
}
|
||||
}
|
||||
|
||||
Drupal.wysiwyg.editor.attach.wymeditor = function(context, params, settings) {
|
||||
|
||||
Drupal.elfinder.editor.wymeditor.fn.attach.apply(this, arguments);
|
||||
|
||||
var $field = $('#' + params.field);
|
||||
var index = $field.data(WYMeditor.WYM_INDEX);
|
||||
|
||||
if (typeof index != 'undefined') {
|
||||
var instance = WYMeditor.INSTANCES[index];
|
||||
|
||||
var imgHtml = instance._options.dialogImageHtml;
|
||||
|
||||
var oImgHtml = $('<div>'+imgHtml+'</div>');
|
||||
|
||||
var oUrl = $("input.wym_src", oImgHtml);
|
||||
var browsebutton = $('<input type="button">');
|
||||
browsebutton.attr('value', Drupal.t('Browse Server'));
|
||||
|
||||
/* FIXME: url parameters duplicates for some reason */
|
||||
var tmp = Drupal.settings.elfinder.file_browser_url;
|
||||
var bugpos = tmp.indexOf(",");
|
||||
|
||||
var elfinderUrl = '';
|
||||
|
||||
if (bugpos != -1) {
|
||||
elfinderUrl = tmp.slice(0, bugpos);
|
||||
Drupal.elfinder.editor.wymeditor = {
|
||||
fn: {
|
||||
attach: Drupal.wysiwyg.editor.attach.wymeditor
|
||||
}
|
||||
}
|
||||
|
||||
Drupal.wysiwyg.editor.attach.wymeditor = function(context, params, settings) {
|
||||
|
||||
Drupal.elfinder.editor.wymeditor.fn.attach.apply(this, arguments);
|
||||
|
||||
var $field = $('#' + params.field);
|
||||
var index = $field.data(WYMeditor.WYM_INDEX);
|
||||
|
||||
if (typeof index != 'undefined') {
|
||||
var instance = WYMeditor.INSTANCES[index];
|
||||
|
||||
var imgHtml = instance._options.dialogImageHtml;
|
||||
|
||||
var oImgHtml = $('<div>' + imgHtml + '</div>');
|
||||
|
||||
|
||||
//$('body', oImgHtml).addClass('wym_dialog wym_dialog_image');
|
||||
//$('body', oImgHtml).attr('omload', 'WYMeditor.INIT_DIALOG(' + index + ')');
|
||||
|
||||
var oUrl = $("input.wym_src", oImgHtml);
|
||||
var browsebutton = $('<input type="button">');
|
||||
browsebutton.attr('value', Drupal.t('Browse Server'));
|
||||
|
||||
/* FIXME: url parameters duplicates for some reason */
|
||||
var tmp = Drupal.settings.elfinder.file_browser_url;
|
||||
var bugpos = tmp.indexOf(",");
|
||||
|
||||
var elfinderUrl = '';
|
||||
|
||||
if (bugpos != -1) {
|
||||
elfinderUrl = tmp.slice(0, bugpos);
|
||||
}
|
||||
else {
|
||||
elfinderUrl = tmp;
|
||||
}
|
||||
|
||||
/* */
|
||||
|
||||
browsebutton.attr('onclick', 'var w = window; w.open("' + elfinderUrl + '","","toolbar=no,menubar=no,width=600,height=600")');
|
||||
browsebutton.insertAfter(oUrl);
|
||||
|
||||
|
||||
ImgHtml = '<body class="wym_dialog wym_dialog_image" onload="WYMeditor.INIT_DIALOG(' + index + ')">' + oImgHtml.html() + '</body>';
|
||||
|
||||
instance._options.dialogImageHtml = ImgHtml;
|
||||
}
|
||||
else {
|
||||
elfinderUrl = tmp;
|
||||
}
|
||||
|
||||
browsebutton.attr('onclick', 'var w = window; w.open("' + elfinderUrl + '","","toolbar=no,menubar=no,width=600,height=600")');
|
||||
browsebutton.insertAfter(oUrl);
|
||||
|
||||
|
||||
ImgHtml = '<body class="wym_dialog wym_dialog_image" onload="WYMeditor.INIT_DIALOG(' + index + ')">' + oImgHtml.html() + '</body>';
|
||||
|
||||
instance._options.dialogImageHtml = ImgHtml;
|
||||
}
|
||||
}
|
||||
|
||||
})(jQuery);
|
||||
|
@@ -1,5 +1,11 @@
|
||||
/*
|
||||
* elFinder Integration
|
||||
*
|
||||
* Copyright (c) 2010-2018, Alexey Sukhotin. All rights reserved.
|
||||
*/
|
||||
|
||||
function elfinder_yui_callback(url) {
|
||||
var editorId = window.opener.Drupal.wysiwyg.activeId;
|
||||
window.opener.jQuery('input#' + editorId + '_insertimage_url').val(url);
|
||||
window.close();
|
||||
var editorId = window.opener.Drupal.wysiwyg.activeId;
|
||||
window.opener.jQuery('input#' + editorId + '_insertimage_url').val(url);
|
||||
window.close();
|
||||
}
|
||||
|
@@ -1,21 +1,29 @@
|
||||
<?php
|
||||
/**
|
||||
* elFinder Integration
|
||||
*
|
||||
* Copyright (c) 2010-2018, Alexey Sukhotin. All rights reserved.
|
||||
*/
|
||||
|
||||
// $Id$
|
||||
|
||||
/**
|
||||
* @file
|
||||
* YUI editor integration plugin
|
||||
*/
|
||||
|
||||
/**
|
||||
* Pseudo-hook for elfinder hook_wysiwyg_plugin implementation
|
||||
*/
|
||||
* Pseudo-hook for elfinder hook_wysiwyg_plugin implementation
|
||||
*/
|
||||
function elfinder_yui_elfinder_editor_plugin($options) {
|
||||
drupal_add_js($options['plugin_url_base'] . '/yui.js');
|
||||
drupal_add_js(array('elfinder' => array('file_browser_url' => $options['elfinder_url'])), 'setting');
|
||||
return array(
|
||||
'elfinder' => array(
|
||||
'extensions' => array('elfinder' => t('elFinder')),
|
||||
'url' => $options['homepage_url'],
|
||||
'options' => array(),
|
||||
'load' => FALSE,
|
||||
),
|
||||
);
|
||||
drupal_add_js($options['plugin_url_base'] . '/yui.js');
|
||||
drupal_add_js(array('elfinder' => array('file_browser_url' => $options['elfinder_url'])), 'setting');
|
||||
return array(
|
||||
'elfinder' => array(
|
||||
'extensions' => array('elfinder' => t('elFinder')),
|
||||
'url' => $options['homepage_url'],
|
||||
'options' => array(),
|
||||
'load' => FALSE,
|
||||
),
|
||||
);
|
||||
}
|
||||
|
@@ -1,33 +1,41 @@
|
||||
/*
|
||||
* elFinder Integration
|
||||
*
|
||||
* Copyright (c) 2010-2018, Alexey Sukhotin. All rights reserved.
|
||||
*/
|
||||
|
||||
// $Id: elfinder.yui.js,v 1.1 2010/10/06 09:44:51 ph0enix Exp $
|
||||
|
||||
(function($) {
|
||||
|
||||
Drupal.elfinder.editor.yui = {
|
||||
fn : {
|
||||
attach: Drupal.wysiwyg.editor.attach.yui
|
||||
Drupal.elfinder.editor.yui = {
|
||||
fn: {
|
||||
attach: Drupal.wysiwyg.editor.attach.yui
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Drupal.wysiwyg.editor.attach.yui = function(context, params, settings) {
|
||||
|
||||
$('#' + params.field).parent().addClass('yui-skin-' + settings.theme);
|
||||
// Attach editor.
|
||||
var editor = new YAHOO.widget.Editor(params.field, settings);
|
||||
|
||||
editor.on('windowInsertImageRender', function(e) {
|
||||
|
||||
var dialogcode = $('#' + params.field + '-panel');
|
||||
|
||||
var oUrl = $('input#' + params.field + '_insertimage_url');
|
||||
var browsebutton = $('<input type="button">');
|
||||
Drupal.wysiwyg.editor.attach.yui = function(context, params, settings) {
|
||||
|
||||
browsebutton.attr('value', Drupal.t('Browse Server'));
|
||||
browsebutton.attr('onclick', 'var w = window; w.open("' + Drupal.settings.elfinder.file_browser_url + '","","toolbar=no,menubar=no,width=600,height=600")');
|
||||
browsebutton.insertAfter(oUrl);
|
||||
$('#' + params.field).parent().addClass('yui-skin-' + settings.theme);
|
||||
// Attach editor.
|
||||
var editor = new YAHOO.widget.Editor(params.field, settings);
|
||||
|
||||
}, editor, true);
|
||||
|
||||
editor.render();
|
||||
}
|
||||
editor.on('windowInsertImageRender', function(e) {
|
||||
|
||||
var dialogcode = $('#' + params.field + '-panel');
|
||||
|
||||
|
||||
//var oImgHtml = $('<div>'+imgHtml+'</div>');
|
||||
var oUrl = $('input#' + params.field + '_insertimage_url');
|
||||
var browsebutton = $('<input type="button">');
|
||||
|
||||
browsebutton.attr('value', Drupal.t('Browse Server'));
|
||||
browsebutton.attr('onclick', 'var w = window; w.open("' + Drupal.settings.elfinder.file_browser_url + '","","toolbar=no,menubar=no,width=600,height=600")');
|
||||
browsebutton.insertAfter(oUrl);
|
||||
|
||||
}, editor, true);
|
||||
|
||||
editor.render();
|
||||
}
|
||||
|
||||
})(jQuery);
|
Reference in New Issue
Block a user