/**
 * $RCSfile: editor_plugin_src.js,v $
 * $Revision: 1.38 $
 * $Date: 2006/02/11 18:53:51 $
 *
 * @author Moxiecode
 * @copyright Copyright © 2004-2006, Moxiecode Systems AB, All rights reserved.
 */
/* Import plugin specific language pack */
tinyMCE.importPluginLanguagePack('npds', 'english,french');
// Plucin static class
var TinyMCE_NPDSPlugin = {
   getInfo : function() {
      return {
         longname  : 'NPDS',
         author    : 'web-@-ressources',
         authorurl : 'http://www.web-adresses.com',
         infourl   : 'http://www.npds.org',
         version   : tinyMCE.majorVersion + "." + tinyMCE.minorVersion
      };
   },
   /**
   * Returns the HTML contents of the NPDS_img control.
   */

   getControlHTML : function(cn) {
      switch (cn)
      {
         case "npds_img":
         return tinyMCE.getButtonHTML(cn, 'lang_npds_img_desc', '{$pluginurl}/images/npds_img.gif', 'NPDS_img');

         case "npds_perso":
         return tinyMCE.getButtonHTML(cn, 'lang_npds_perso_desc', '{$pluginurl}/images/npds_perso.gif', 'NPDS_Perso');
         
         case "npds_mns":
         return tinyMCE.getButtonHTML(cn, 'lang_npds_mns_desc', '{$pluginurl}/images/npds_mns.gif', 'NPDS_Mns');
         
         case "npds_upl":
         return tinyMCE.getButtonHTML(cn, 'lang_npds_upl_desc', '{$pluginurl}/images/npds_upload.gif', 'NPDS_Upl');
         
         case "npds_metal":
         return tinyMCE.getButtonHTML(cn, 'lang_npds_metal_desc', '{$pluginurl}/images/npds_metal.gif', 'NPDS_MetaL');
         
         case "npds_plug":
         return tinyMCE.getButtonHTML(cn, 'lang_npds_plug_desc', '{$pluginurl}/images/npds_plug.gif', 'NPDS_Plug');
         
         case "npds_langue":
         return '<select id="{$editor_id}_langueSelect" name="{$editor_id}_langueSelect" onfocus="tinyMCE.addSelectAccessibility(event, this, window);" onchange="tinyMCE.execInstanceCommand(\'{$editor_id}\',\'mceInsertContent\',false,this.options[this.selectedIndex].value);" class="mceSelectList">'+
            '<option value="0">{$lang_npds_what_desc}</option>'+
            '<option value="[french] [/french]">{$lang_npds_french_desc}</option>'+
            '<option value="[!french] [/french]">{$lang_npds_frenchonly_desc}</option>'+
            '<option value="[english] [/english]">{$lang_npds_english_desc}</option>'+
            '<option value="[!english] [/english]">{$lang_npds_englishonly_desc}</option>'+
            '<option value="[spanish] [/spanish]">{$lang_npds_spanish_desc}</option>'+
            '<option value="[!spanish] [/spanish]">{$lang_npds_spanishonly_desc}</option>'+
            '<option value="[chinese] [/chinese]">{$lang_npds_chinese_desc}</option>'+
            '<option value="[!chinese] [/chinese]">{$lang_npds_chineseonly_desc}</option>'+
            '</select>';

      }
      return "";
   },
   /**
   * Executes the mceEmotion command.
   */
   execCommand : function(editor_id, element, command, user_interface, value) {
      // Handle commands
      switch (command) {
      // NPDS
      case "NPDS_img":
      var template = new Array();
      template['file'] = '../../../../modules.php?ModPath=f-manager&ModStart=f-manager&FmaRep=bank-public';
      template['width'] = 450;
      template['height'] = 500;
      tinyMCE.openWindow(template,{editor_id:editor_id,name:"itmp",resizable:"yes",scrollbars:"yes"});
      return true;
      
      case "NPDS_Perso":
      var template = new Array();
      template['file'] = '../../../../modules.php?ModPath=f-manager&ModStart=f-manager&FmaRep=bank-membre';
      template['width'] = 600;
      template['height'] = 400;
      tinyMCE.openWindow(template,{editor_id:editor_id,name:"ptmp",resizable:"yes",scrollbars:"yes"});
      return true;
      
      case "NPDS_Mns":
      var template = new Array();
      template['file'] = '../../../../modules.php?ModPath=upload&ModStart=include_minisite/upload_minisite2&apli=minisite';
      template['width'] = 750;
      template['height'] = 500;
      tinyMCE.openWindow(template,{editor_id:editor_id,name:"mnstmp",resizable:"yes",scrollbars:"yes"});
      return true;
      
      case "NPDS_MetaL":
      var template = new Array();
      template['file'] = '../../../../modules.php?ModPath=meta-lang&ModStart=adv-meta_lang-doc';
      template['width'] = 700;
      template['height'] = 500;
      tinyMCE.openWindow(template,{editor_id:editor_id,name:"mtmp",resizable:"yes",scrollbars:"yes"});
      return true;
      
      case "NPDS_Upl":
      var template = new Array();
      template['file'] = '../../../../modules.php?ModPath=upload&ModStart=include_editeur/upload_editeur2&apli=editeur';
      template['width'] = 350;
      template['height'] = 150;
      tinyMCE.openWindow(template,{editor_id:editor_id,name:"utmp",resizable:"no",scrollbars:"no"});
      return true;
      
      case "NPDS_Plug":
      var template = new Array();
      template['file'] = '../../../editor_plugins.php?op=plugins';
      template['width'] = 380;
      template['height'] = 450;
      tinyMCE.openWindow(template,{editor_id:editor_id,name:"itmp",resizable:"yes",scrollbars:"no"});
      return true;
      }
      // Pass to next handler in chain
      return false;
   }
};
tinyMCE.addPlugin("npds", TinyMCE_NPDSPlugin);