You are not logged in.
Pages: 1
Hye everybody,
I'm trying to use Imagemanager plugin and pass array with config variables. But that doesn't work :s.
Here is my code :
<script type="text/javascript">
_editor_url = "external/xinha/" // (preferably absolute) URL (including trailing slash) where Xinha is installed
_editor_lang = "en"; // And the language we need to use in the editor.
</script>
<script type="text/javascript" src="external/xinha/XinhaCore.js"></script>
<script type="text/javascript" src="external/xinha/newsletter_config.js"></script>
external/xinha/newsletter_config.js
xinha_editors = null;
xinha_init = null;
xinha_config = null;
xinha_plugins = null;
// This contains the names of textareas we will make into Xinha editors
xinha_init = xinha_init ? xinha_init : function()
{
xinha_plugins = xinha_plugins ? xinha_plugins :
[
'CharacterMap',
'ContextMenu',
'ListType',
'SpellChecker',
'Stylist',
'SuperClean',
'TableOperations',
'ImageManager'
];
// THIS BIT OF JAVASCRIPT LOADS THE PLUGINS, NO TOUCHING :)
if(!Xinha.loadPlugins(xinha_plugins, xinha_init)) return;
xinha_editors = xinha_editors ? xinha_editors :
[
'content'
];
xinha_config = xinha_config ? xinha_config() : new Xinha.Config();
with(xinha_config.ImageManager)
{
<?php
require_once('/data/web/admin/external/xinha/contrib/php-xinha.php');
xinha_pass_to_php_backend(
array(
'images_dir' => '/data/web/pub/'
)
);
?>
}
xinha_editors = Xinha.makeEditors(xinha_editors, xinha_config, xinha_plugins);
Xinha.startEditors(xinha_editors);
}
Xinha._addEvent(window,'load', xinha_init); // this executes the xinha_init function on page load
// and does not interfere with window.onload properties set by other script
It's working when I put directory in config.inc.php directly :s.
Offline
Hi!
The newsletter_config.js file is just a javascript file for your server. It needs to be parsed by PHP engine for this to work. Rename this file to newsletter_config.js.php (and, of course, change the src of the <script> tag accordingly).
Cheers,
Chris Kotowicz
Offline
Wahhhh
I'm stupid boy. Thanks a lot.
Offline
Pages: 1