5 * Copyright 2004 (c) GForge LLC
8 * @author Daniel Perez daniel@gforgegroup.com
11 * This file is part of GForge.
13 * GForge is free software; you can redistribute it and/or modify
14 * it under the terms of the GNU General Public License as published by
15 * the Free Software Foundation; either version 2 of the License, or
16 * (at your option) any later version.
18 * GForge is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU General Public License for more details.
23 * You should have received a copy of the GNU General Public License
24 * along with GForge; if not, write to the Free Software
25 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
28 // This file is a popup window to edit docman
29 // By Daniel A. P�rez 2005
31 require_once('../env.inc.php');
32 require_once('pre.php');
34 $group_id = getIntFromRequest('group_id'); //get the group id
37 function getEditorValue( instanceName )
39 // Get the editor instance that we want to interact with.
40 var oEditor = FCKeditorAPI.GetInstance( instanceName ) ;
42 // Get the editor contents as XHTML.
43 return oEditor.GetXHTML( true ) ; // "true" means you want it formatted.
45 function setEditorValue( instanceName, text )
47 // Get the editor instance that we want to interact with.
48 var oEditor = FCKeditorAPI.GetInstance( instanceName ) ;
50 // Set the editor contents.
51 oEditor.SetHTML( text ) ;
55 echo '<form name="theform">';
56 $params['name'] = 'data';
57 $params['width'] = "800";
58 $params['height'] = "500";
59 $params['group'] = $group_id;
60 plugin_hook("text_editor",$params);
62 if (!$GLOBALS['editor_was_set_up']) {
63 //if we don�t have any plugin for text editor, display a simple textarea edit box
65 echo '<textarea name="data" rows="15" cols="100" wrap="soft"></textarea><br />';
67 window.document.theform.data.value = window.opener.document.adddata.data.value;
70 // we must make it wait a bit or else the fckeditor object won�t be set yet
71 echo '<script type="text/javascript">
72 setTimeout("setEditorValue(\'data\',window.opener.document.adddata.data.value)",2250);
78 unset($GLOBALS['editor_was_set_up']);
81 echo '<br><div align="right"><input type="submit" value="update" onclick="window.opener.document.adddata.data.value=getEditorValue(\'data\');window.close();"/></div>';
83 echo '<br><div align="right"><input type="submit" value="update" onclick="window.opener.document.adddata.data.value=window.document.theform.data.value;window.close();"/></div>';