Advertisement
Guest User

Untitled

a guest
Jul 28th, 2015
209
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.19 KB | None | 0 0
  1. function ckeditor_insert_view_ckeditor_plugin() {
  2. return array(
  3. 'insert_view' => array(
  4. // Plugin name.
  5. 'name' => 'insert_view',
  6. // Plugin description - it will be displayed in the plugins management section of the profile settings.
  7. 'desc' => t('Plugin for adding Insert Views shortcode.'),
  8. // The full path to the CKEditor plugin directory, trailing slash included.
  9. 'path' => drupal_get_path('module', 'ckeditor_insert_view') . '/plugins/insert_view/',
  10. // Plugin buttons definition (optional).
  11. 'buttons' => array(
  12. 'insert_view' => array('label' => 'Insert View', 'icon' => 'icons/insert_view.png')
  13. )
  14. )
  15. );
  16. }
  17.  
  18. CKEDITOR.plugins.add( 'insert_view', {
  19. init: function( editor ) {
  20. editor.addCommand( 'insert_view', new CKEDITOR.dialogCommand( 'viewDialog' ) );
  21. editor.ui.addButton( 'View', {
  22. label: 'Insert View',
  23. command: 'insert_view',
  24. //toolbar: 'insert',
  25. icon: this.path + 'icons/insert_view.png'
  26. });
  27. CKEDITOR.dialog.add( 'viewDialog', this.path + 'dialogs/insert_view.js' );
  28. }
  29. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement