| 1 |
<?php |
<?php |
| 2 |
// $Id: ckeditor.inc,v 1.2.4.2 2009/10/20 02:46:42 twod Exp $ |
// $Id: ckeditor.inc,v 1.2.4.3 2009/10/23 02:10:53 twod Exp $ |
| 3 |
|
|
| 4 |
/** |
/** |
| 5 |
* @file |
* @file |
| 23 |
), |
), |
| 24 |
'src' => array( |
'src' => array( |
| 25 |
'title' => 'Source', |
'title' => 'Source', |
| 26 |
'files' => array( |
'files' => array( |
| 27 |
'ckeditor_source.js' => array('preprocess' => FALSE), |
'ckeditor_source.js' => array('preprocess' => FALSE), |
| 28 |
), |
), |
| 29 |
), |
), |
| 92 |
function wysiwyg_ckeditor_themes($editor, $profile) { |
function wysiwyg_ckeditor_themes($editor, $profile) { |
| 93 |
// @todo Skins are not themes but this will do for now. |
// @todo Skins are not themes but this will do for now. |
| 94 |
$path = $editor['library path'] . '/skins/'; |
$path = $editor['library path'] . '/skins/'; |
| 95 |
$dir_handle = @opendir($path) or drupal_set_message('Unable to open ' . $path, $type = 'error'); |
if (file_exists($path) && ($dir_handle = opendir($path))) { |
| 96 |
$themes = array(); |
$themes = array(); |
| 97 |
while ($file = readdir($dir_handle)) { |
while ($file = readdir($dir_handle)) { |
| 98 |
if($file!="." && $file!=".." && $file!="CVS" && $file!=".svn") { |
if (is_dir($path . $file) && substr($file, 0, 1) != '.' && $file != 'CVS') { |
| 99 |
$themes[] = $file; |
$themes[] = $file; |
| 100 |
|
} |
| 101 |
} |
} |
| 102 |
|
closedir($dir_handle); |
| 103 |
|
return !empty($themes) ? $themes : array('default'); |
| 104 |
|
} |
| 105 |
|
else { |
| 106 |
|
return array('default'); |
| 107 |
} |
} |
|
closedir($dir_handle); |
|
|
return $themes; |
|
| 108 |
} |
} |
| 109 |
|
|
| 110 |
/** |
/** |
| 126 |
'baseHref' => base_path(), |
'baseHref' => base_path(), |
| 127 |
'width' => '100%', |
'width' => '100%', |
| 128 |
'height' => 420, |
'height' => 420, |
| 129 |
// Skin is not really the same as theme. |
// @todo Do not use skins as themes and add separate skin handling. |
| 130 |
'theme' => 'default', |
'theme' => 'default', |
| 131 |
'skin' => $theme, |
'skin' => !empty($theme) ? $theme : 'kama', |
| 132 |
// By default, CKeditor converts most characters into HTML entities. Since |
// By default, CKeditor converts most characters into HTML entities. Since |
| 133 |
// it does not support a custom definition, but Drupal supports Unicode, we |
// it does not support a custom definition, but Drupal supports Unicode, we |
| 134 |
// disable at least the additional character sets. CKeditor always converts |
// disable at least the additional character sets. CKeditor always converts |
| 166 |
} |
} |
| 167 |
} |
} |
| 168 |
|
|
|
// Language |
|
| 169 |
if (isset($config['language'])) { |
if (isset($config['language'])) { |
| 170 |
$settings['language'] = $config['language']; |
$settings['language'] = $config['language']; |
| 171 |
} |
} |
|
// Resizing button |
|
| 172 |
if (isset($config['resizing'])) { |
if (isset($config['resizing'])) { |
| 173 |
$settings['resize_enabled'] = $config['resizing']; |
$settings['resize_enabled'] = $config['resizing']; |
| 174 |
} |
} |
|
//Toolbar location |
|
| 175 |
if (isset($config['toolbar_loc'])) { |
if (isset($config['toolbar_loc'])) { |
| 176 |
$settings['toolbarLocation'] = $config['toolbar_loc']; |
$settings['toolbarLocation'] = $config['toolbar_loc']; |
| 177 |
} |
} |
| 271 |
|
|
| 272 |
/** |
/** |
| 273 |
* Return internal plugins for this editor; semi-implementation of hook_wysiwyg_plugin(). |
* Return internal plugins for this editor; semi-implementation of hook_wysiwyg_plugin(). |
|
* |
|
|
* Excluded native plugins: About, Button, Checkbox, Form, HiddenField, |
|
|
* ImageButton, NewPage, PageBreak, Print, Radio, Select, Save, TextField, |
|
|
* Textarea, Templates. |
|
| 274 |
*/ |
*/ |
| 275 |
function wysiwyg_ckeditor_plugins($editor) { |
function wysiwyg_ckeditor_plugins($editor) { |
| 276 |
$plugins = array( |
$plugins = array( |
| 277 |
'default' => array( |
'default' => array( |
| 278 |
'buttons' => array( |
'buttons' => array( |
| 279 |
'Bold' => t('Bold'), 'Italic' => t('Italic'), 'Underline' => t('Underline'), |
'Bold' => t('Bold'), 'Italic' => t('Italic'), 'Underline' => t('Underline'), |
| 280 |
'StrikeThrough' => t('Strike-through'), |
'Strike' => t('Strike-through'), |
| 281 |
'JustifyLeft' => t('Align left'), 'JustifyCenter' => t('Align center'), 'JustifyRight' => t('Align right'), 'JustifyFull' => t('Justify'), |
'JustifyLeft' => t('Align left'), 'JustifyCenter' => t('Align center'), 'JustifyRight' => t('Align right'), 'JustifyBlock' => t('Justify'), |
| 282 |
'BulletedList' => t('Bullet list'), 'NumberedList' => t('Numbered list'), |
'BulletedList' => t('Bullet list'), 'NumberedList' => t('Numbered list'), |
| 283 |
'Outdent' => t('Outdent'), 'Indent' => t('Indent'), |
'Outdent' => t('Outdent'), 'Indent' => t('Indent'), |
| 284 |
'Undo' => t('Undo'), 'Redo' => t('Redo'), |
'Undo' => t('Undo'), 'Redo' => t('Redo'), |
| 289 |
'Blockquote' => t('Blockquote'), 'Source' => t('Source code'), |
'Blockquote' => t('Blockquote'), 'Source' => t('Source code'), |
| 290 |
'HorizontalRule' => t('Horizontal rule'), |
'HorizontalRule' => t('Horizontal rule'), |
| 291 |
'Cut' => t('Cut'), 'Copy' => t('Copy'), 'Paste' => t('Paste'), |
'Cut' => t('Cut'), 'Copy' => t('Copy'), 'Paste' => t('Paste'), |
| 292 |
'PasteText' => t('Paste Text'), 'PasteWord' => t('Paste from Word'), |
'PasteText' => t('Paste Text'), 'PasteFromWord' => t('Paste from Word'), |
| 293 |
'ShowBlocks' => t('Show blocks'), |
'ShowBlocks' => t('Show blocks'), |
| 294 |
'RemoveFormat' => t('Remove format'), |
'RemoveFormat' => t('Remove format'), |
| 295 |
'SpecialChar' => t('Character map'), |
'SpecialChar' => t('Character map'), |
| 297 |
'Format' => t('HTML block format'), 'Font' => t('Font'), 'FontSize' => t('Font size'), 'Styles' => t('Font style'), |
'Format' => t('HTML block format'), 'Font' => t('Font'), 'FontSize' => t('Font size'), 'Styles' => t('Font style'), |
| 298 |
'Table' => t('Table'), |
'Table' => t('Table'), |
| 299 |
'Find' => t('Search'), 'Replace' => t('Replace'), 'SelectAll' => t('Select all'), |
'Find' => t('Search'), 'Replace' => t('Replace'), 'SelectAll' => t('Select all'), |
|
'CreateDiv' => t('Create DIV container'), |
|
| 300 |
'Flash' => t('Flash'), 'Smiley' => t('Smiley'), |
'Flash' => t('Flash'), 'Smiley' => t('Smiley'), |
| 301 |
'FitWindow' => t('FitWindow'), |
'Maximize' => t('Maximize'), |
| 302 |
'SpellChecker' => t('Check spelling'), 'Scayt' => t('Check spelling as you type'), |
'SpellChecker' => t('Check spelling'), 'Scayt' => t('Check spelling as you type'), |
| 303 |
), |
), |
| 304 |
'internal' => TRUE, |
'internal' => TRUE, |