DrupalBin
Submit Code
About
Recent Posts
Fix for Views cumulus: tag_cloud
Fix for Code
sjfgjgjfgidfgh
Code
Code
test.berniecram.com.alias.drushrc.php
Code
provision-deploy error
Create node programmatically with file
Code
more
User login
Log in using OpenID:
What is OpenID?
Username:
*
Password:
*
Log in using OpenID
Cancel OpenID login
Create new account
Request new password
Tags
CCK
drupal
fapi
jquery
menu
module
php
simpletest
taxonomy
test
theme
views
more tags
Home
Fix for jwysiwyg.inc
View
Fix
October 20, 2008 - 3:34pm —
Rob Loach
<?php
// $Id$
/**
* Plugin implementation of hook_editor().
*/
function
wysiwyg_jwysiwyg_editor
(
)
{
$editor
=
array
(
)
;
$editor
[
'jwysiwyg'
]
=
array
(
// Required properties
'title'
=
>
'jWYSIWYG'
,
'vendor url'
=
>
'http://plugins.jquery.com/project/jwysiwyg'
,
'download url'
=
>
'http://code.google.com/p/jwysiwyg/downloads/list'
,
'library path'
=
>
wysiwyg_get_path
(
'jwysiwyg'
)
,
/*'libraries' => array( // We cannot assume that all editors need just one js library.
'' => array( // Key may be used in wysiwyg_tinymce_settings() for exec mode.
'title' => 'Packed',
'files' => array('jquery.wysiwyg.pack.js'),
),
'src' => array(
'title' => 'Source',
'files' => array('jquery.wysiwyg.js'),
),
),*/
'version callback'
=
>
'wysiwyg_jwysiwyg_version'
,
//'themes callback' => 'wysiwyg_jwysiwyg_themes',
//'settings callback' => 'wysiwyg_jwysiwyg_settings',
//'plugin callback' => 'wysiwyg_jwysiwyg_plugins',
//'plugin settings callback' => 'wysiwyg_jwysiwyg_plugin_settings',
'versions'
=
>
array
(
// Each version can override global editor properties.
'0.4'
=
>
array
(
'download url'
=
>
'http://code.google.com/p/jwysiwyg/downloads/detail?name=jwysiwyg-0.4.zip&can=2&q='
,
// 'include files' => array('tinymce-3.inc'),
'js files'
=
>
array
(
'jquery.wysiwyg.pack.js'
)
,
'css files'
=
>
array
(
'jquery.jwysiwyg.css'
)
,
// 'plugin callback' => 'wysiwyg_tinymce_3_plugins',
'libraries'
=
>
array
(
''
=
>
array
(
'title'
=
>
'Packed'
,
'files'
=
>
array
(
'jquery.jwysiwyg.pack.js'
)
,
)
,
'src'
=
>
array
(
'title'
=
>
'jQuery'
,
'files'
=
>
array
(
'jquery.jwysiwyg.js'
)
,
)
,
)
,
)
,
)
,
// Optional properties
//'editor path' => wysiwyg_get_path('aaa'), // Assumed by default.
//'js path' => wysiwyg_get_path('jwysiwyg'), // Assumed by default.
//'css path' => wysiwyg_get_path('editors/jwysiwyg'), // Assumed by default.
)
;
return
$editor
;
}
/**
* Detect editor version.
*
* @param $editor
* An array containing editor properties as returned from hook_editor().
*
* @return
* The installed editor version.
*/
function
wysiwyg_jwysiwyg_version
(
$editor
)
{
$data
=
file_get_contents
(
wysiwyg_get_path
(
'jwysiwyg/jquery.wysiwyg.js'
)
, FILE_USE_INCLUDE_PATH,
NULL
, 0, 100
)
;
if
(
preg_match
(
'/plugin
\s
*([0-9
\.
]+)/'
,
$data
,
$version
)
)
{
return
$version
[
1
]
;
}
}
/**
* Return runtime editor settings for a given wysiwyg profile.
*
* @param $editor
* A processed hook_editor() array of editor properties.
* @param $config
* An array containing wysiwyg editor profile settings.
* @param $theme
* The name of a theme/GUI/skin to use.
*
* @return
* A settings array to be populated in
* Drupal.settings.wysiwyg.configs.{editor}
*/
//function wysiwyg_jwysiwyg_settings($editor, $config, $theme) {
// return array();
//}
/**
* Determine available editor themes or check/reset a given one.
*
* @param $editor
* A processed hook_editor() array of editor properties.
* @param $profile
* A wysiwyg editor profile.
*
* @return
* An array of theme names. The first returned name should be the default
* theme name.
*/
/*function wysiwyg_tinymce_themes($editor, $profile) {
return array();
}*/
/**
* Build a JS settings array of external plugins that need to be loaded separately.
*/
/*function wysiwyg_tinymce_plugin_settings($editor, $profile, $plugins) {
return array();
}*/
jwysiwyg
wysiwyg
Submit Fix
Summary:
Tags:
Any tags you'd like to associate with your code, delimitered by commas (example: Views, CCK, Module, etc).
Show summary in full view
<?php // $Id$ /** * Plugin implementation of hook_editor(). */ function wysiwyg_jwysiwyg_editor() { $editor = array(); $editor['jwysiwyg'] = array( // Required properties 'title' => 'jWYSIWYG', 'vendor url' => 'http://plugins.jquery.com/project/jwysiwyg', 'download url' => 'http://code.google.com/p/jwysiwyg/downloads/list', 'library path' => wysiwyg_get_path('jwysiwyg'), /*'libraries' => array( // We cannot assume that all editors need just one js library. '' => array( // Key may be used in wysiwyg_tinymce_settings() for exec mode. 'title' => 'Packed', 'files' => array('jquery.wysiwyg.pack.js'), ), 'src' => array( 'title' => 'Source', 'files' => array('jquery.wysiwyg.js'), ), ),*/ 'version callback' => 'wysiwyg_jwysiwyg_version', //'themes callback' => 'wysiwyg_jwysiwyg_themes', //'settings callback' => 'wysiwyg_jwysiwyg_settings', //'plugin callback' => 'wysiwyg_jwysiwyg_plugins', //'plugin settings callback' => 'wysiwyg_jwysiwyg_plugin_settings', 'versions' => array( // Each version can override global editor properties. '0.4' => array( 'download url' => 'http://code.google.com/p/jwysiwyg/downloads/detail?name=jwysiwyg-0.4.zip&can=2&q=', // 'include files' => array('tinymce-3.inc'), 'js files' => array('jquery.wysiwyg.pack.js'), 'css files' => array('jquery.jwysiwyg.css'), // 'plugin callback' => 'wysiwyg_tinymce_3_plugins', 'libraries' => array( '' => array( 'title' => 'Packed', 'files' => array('jquery.jwysiwyg.pack.js'), ), 'src' => array( 'title' => 'jQuery', 'files' => array('jquery.jwysiwyg.js'), ), ), ), ), // Optional properties //'editor path' => wysiwyg_get_path('aaa'), // Assumed by default. //'js path' => wysiwyg_get_path('jwysiwyg'), // Assumed by default. //'css path' => wysiwyg_get_path('editors/jwysiwyg'), // Assumed by default. ); return $editor; } /** * Detect editor version. * * @param $editor * An array containing editor properties as returned from hook_editor(). * * @return * The installed editor version. */ function wysiwyg_jwysiwyg_version($editor) { $data = file_get_contents(wysiwyg_get_path('jwysiwyg/jquery.wysiwyg.js'), FILE_USE_INCLUDE_PATH, NULL, 0, 100); if (preg_match('/plugin\s*([0-9\.]+)/', $data, $version)) { return $version[1]; } } /** * Return runtime editor settings for a given wysiwyg profile. * * @param $editor * A processed hook_editor() array of editor properties. * @param $config * An array containing wysiwyg editor profile settings. * @param $theme * The name of a theme/GUI/skin to use. * * @return * A settings array to be populated in * Drupal.settings.wysiwyg.configs.{editor} */ //function wysiwyg_jwysiwyg_settings($editor, $config, $theme) { // return array(); //} /** * Determine available editor themes or check/reset a given one. * * @param $editor * A processed hook_editor() array of editor properties. * @param $profile * A wysiwyg editor profile. * * @return * An array of theme names. The first returned name should be the default * theme name. */ /*function wysiwyg_tinymce_themes($editor, $profile) { return array(); }*/ /** * Build a JS settings array of external plugins that need to be loaded separately. */ /*function wysiwyg_tinymce_plugin_settings($editor, $profile, $plugins) { return array(); }*/
Syntax highlighting mode:
ActionScript
ColdFusion
Diff
Drupal 5
Drupal 6
HTML
INI
Javascript
MySQL
PHP
Python
robots.txt
SQL
Text
Select the syntax highlighting mode to use.
See Also:
Order
Title:
URL:
-1
0
1
Title:
URL:
-1
0
1
Any links you'd like to have associated with the post (Drupal.org issue, Wikipedia article, etc).
File attachments
Changes made to the attachments are not permanent until you save this post. The first "listed" file will be included in RSS feeds.
Attach new file:
The maximum upload size is
1 MB
. Only files with the following extensions may be uploaded:
jpg jpeg gif png txt doc xls pdf ppt pps odt ods odp phps
.