Zikula: A Flexible Open Source Content Management System
home | forum | contact us

Dizkus

Bottom
Disable Visual Editor for one or more Modules
  • Posted: 25.04.2003, 20:56
     
    igmg
    rank:
    Freshman Freshman
    registered:
     December 1969
    Status:
    offline
    last visit:
    22.05.03
    Posts:
    18
    For many reasons you may want to disable the visual editor included in the last versions of PostNuke but only for one or some Modules. This is what you shall do:

    Edit www.yourdomain.com/header.php

    More or less line 170 you'll find this code:

    Code

    /* Enable Wysiwyg editor configuration at seeting Added by bharvey42 edited by Neo */
       $pnWysiwygEditor = pnConfigGetVar('WYSIWYGEditor');

    Right afterwards insert this piece of code:

    Code

    ////// Start: MODULES WITHOUT VISUAL EDITOR //////
       $modInfo = pnModGetInfo(pnModGetIDFromName(pnModGetName()));
       $ModName = pnVarPrepForStore($modInfo['directory']);
       $novisualeditor = array('Module1',
                               'Module2'); // Insert here the Modules which you don't want to display Visual Editor.

       foreach ($novisualeditor as $nve) {
          if ($ModName == $nve) {
             $pnWysiwygEditor = 0;
          }
       }
    ////// End: MODULES WITHOUT VISUAL EDITOR //////


    Replace in the array where it says Module1, Module2, etc with the directory Name of the modules in which you don't want the Visual Editor to show.
    That's it.

    Cheers,
    ÑÑ. 8)
  • Posted: 01.06.2003, 22:07
     
    mtcook01
    rank:
    Freshman Freshman
    registered:
     June 2003
    Status:
    offline
    last visit:
    01.06.03
    Posts:
    2
    Thank You, Thank You , Thank You , Thank You

    Oh yea did I say Thank You

    This is what makes PostNuke so great... The Support

    Once again

    Thank You

    Mike :D
  • Posted: 16.07.2003, 20:07
     
    ZippySLC
    rank:
    Freshman Freshman
    registered:
     April 2002
    Status:
    offline
    last visit:
    17.07.03
    Posts:
    38
    Awesome, thanks!
  • Posted: 23.08.2003, 09:44
     
    KenJi
    rank:
    Freshman Freshman
    registered:
     February 2003
    Status:
    offline
    last visit:
    25.08.03
    Posts:
    4
    Please... It's not working for me! It returns errors! I tried to add a simple line of code like this:

    Code

    $pnWysiwygEditor = pnConfigGetVar('WYSIWYGEditor');
       $pnWysiwygEditor = 0; // Add this line


    And it has already become erroneous! How? Please...
  • Posted: 26.08.2003, 00:44
     
    rank:
    Professional Professional
    registered:
     April 2002
    Status:
    offline
    last visit:
    24.11.08
    Posts:
    716
    There is a code snippet telling you how to disable the editor based on permissions. It might be a good addition to igmgs snippet.

    BTW: If you have these snippets at hand, please put them in the NOC code snippets collection.


    Jörg
  • Posted: 10.09.2003, 08:16
     
    Lucifer
    rank:
    Freshman Freshman
    registered:
     May 2003
    Status:
    offline
    last visit:
    17.02.04
    Posts:
    6
    Recently tried disabling visual mode on a few modules on my PostNuke site. Seems to have worked for most of them except for 'Comments'. Any idea why?
  • Posted: 10.09.2003, 11:23
     
    rank:
    Professional Professional
    registered:
     April 2002
    Status:
    offline
    last visit:
    24.11.08
    Posts:
    716
    Comments (the Original Comments module as well as EZComments) are ALWAYS shown with a module to comment on -- this "upmost" module ist the one you can en/disable the WYSIWSG for...

Extensions Moderation

Main Menu

Extensions Database

Documentation

Development

Login

Donate to Zikula