mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-01-14 09:58:16 +01:00
applay path #298 from Jose Luis Gordo Romero: sitmgr, api tiny->fck
This commit is contained in:
parent
c823cfa15c
commit
1eb9dbe961
@ -568,6 +568,66 @@ class html
|
|||||||
.'</textarea>';
|
.'</textarea>';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* this function is a wrapper for fckEditor to create some reuseable layouts
|
||||||
|
*
|
||||||
|
* @param string $_name name and id of the input-field
|
||||||
|
* @param string $_content='' of the tinymce (will be run through htmlspecialchars !!!), default ''
|
||||||
|
* @param string $_mode display mode of the tinymce editor can be: simple, extended or advanced
|
||||||
|
* @param array $_options (toolbar_expanded true/false)
|
||||||
|
* @param string $_height='400px'
|
||||||
|
* @param string $_width='100%'
|
||||||
|
* @param string $base_href='' if passed activates the browser for image at absolute path passed
|
||||||
|
* @return string the necessary html for the textarea
|
||||||
|
*/
|
||||||
|
function fckEditor($_name, $_content='', $_mode, $_options=array('toolbar_expanded' =>'true'), $_height='400px', $_width='100%',$_base_href) {
|
||||||
|
include_once(EGW_INCLUDE_ROOT."/phpgwapi/js/fckeditor/fckeditor.php");
|
||||||
|
|
||||||
|
$oFCKeditor = new FCKeditor($_name) ;
|
||||||
|
$oFCKeditor->BasePath = $GLOBALS['egw_info']['server']['webserver_url'].'/phpgwapi/js/fckeditor/' ;
|
||||||
|
$oFCKeditor->Value = $_content;
|
||||||
|
$oFCKeditor->Width = $_width ;
|
||||||
|
$oFCKeditor->Height = $_height ;
|
||||||
|
$oFCKeditor->Config['LinkBrowser'] = 'false';
|
||||||
|
$oFCKeditor->Config['FlashBrowser'] = 'false';
|
||||||
|
$oFCKeditor->Config['LinkUpload'] = 'false';
|
||||||
|
|
||||||
|
// Activate the browser and config upload pathimage dir ($_base_href/images) if passed (absolute path)
|
||||||
|
if ($_base_href)
|
||||||
|
{
|
||||||
|
// Only images for now
|
||||||
|
$oFCKeditor->Config['ImageBrowserURL'] = $oFCKeditor->BasePath.'editor/filemanager/browser/default/browser.html?ServerPath='.$_base_href.'&Type=images&Connector=connectors/php/connector.php';
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$oFCKeditor->Config['ImageBrowser'] = 'false';
|
||||||
|
}
|
||||||
|
// By default the editor start expanded
|
||||||
|
if ($_options['toolbar_expanded'] == 'false')
|
||||||
|
{
|
||||||
|
$oFCKeditor->Config['ToolbarStartExpanded'] = $_options['toolbar_expanded'];
|
||||||
|
}
|
||||||
|
|
||||||
|
switch($_mode) {
|
||||||
|
case 'ascii':
|
||||||
|
return "<textarea name=\"$_name\" style=\"width:".$_width."; height:".$_height."; border:0px;\">$_content</textarea>";
|
||||||
|
break;
|
||||||
|
case 'simple':
|
||||||
|
$oFCKeditor->ToolbarSet = 'egw_simple';
|
||||||
|
return $oFCKeditor->CreateHTML() ;
|
||||||
|
break;
|
||||||
|
case 'extended':
|
||||||
|
$oFCKeditor->ToolbarSet = 'egw_extended';
|
||||||
|
return $oFCKeditor->CreateHTML() ;
|
||||||
|
break;
|
||||||
|
case 'advanced':
|
||||||
|
$oFCKeditor->ToolbarSet = 'egw_advanced';
|
||||||
|
return $oFCKeditor->CreateHTML() ;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* this function is a wrapper for tinymce to create some reuseable layouts
|
* this function is a wrapper for tinymce to create some reuseable layouts
|
||||||
*
|
*
|
||||||
|
@ -21,10 +21,10 @@
|
|||||||
global $Config ;
|
global $Config ;
|
||||||
|
|
||||||
// SECURITY: You must explicitelly enable this "connector". (Set it to "true").
|
// SECURITY: You must explicitelly enable this "connector". (Set it to "true").
|
||||||
$Config['Enabled'] = false ;
|
$Config['Enabled'] = true ;
|
||||||
|
|
||||||
// Path to user files relative to the document root.
|
// Path to user files relative to the document root.
|
||||||
$Config['UserFilesPath'] = '/UserFiles/' ;
|
//$Config['UserFilesPath'] = '/UserFiles/' ;
|
||||||
|
|
||||||
// Fill the following value it you prefer to specify the absolute path for the
|
// Fill the following value it you prefer to specify the absolute path for the
|
||||||
// user files directory. Usefull if you are using a virtual directory, symbolic
|
// user files directory. Usefull if you are using a virtual directory, symbolic
|
||||||
|
@ -68,7 +68,7 @@ function DoResponse()
|
|||||||
$sCurrentFolder = $_GET['CurrentFolder'] ;
|
$sCurrentFolder = $_GET['CurrentFolder'] ;
|
||||||
|
|
||||||
// Check if it is an allowed type.
|
// Check if it is an allowed type.
|
||||||
if ( !in_array( $sResourceType, array('File','Image','Flash','Media') ) )
|
if ( !in_array( $sResourceType, array('File','images','Flash','Media') ) )
|
||||||
return ;
|
return ;
|
||||||
|
|
||||||
// Check the current folder syntax (must begin and start with a slash).
|
// Check the current folder syntax (must begin and start with a slash).
|
||||||
|
@ -31,7 +31,7 @@ function SetResourceType( type )
|
|||||||
|
|
||||||
var aTypes = [
|
var aTypes = [
|
||||||
['File','File'],
|
['File','File'],
|
||||||
['Image','Image'],
|
['images','Image'],
|
||||||
['Flash','Flash'],
|
['Flash','Flash'],
|
||||||
['Media','Media']
|
['Media','Media']
|
||||||
] ;
|
] ;
|
||||||
|
@ -28,7 +28,7 @@ $Config['Enabled'] = false ;
|
|||||||
$Config['UseFileType'] = false ;
|
$Config['UseFileType'] = false ;
|
||||||
|
|
||||||
// Path to uploaded files relative to the document root.
|
// Path to uploaded files relative to the document root.
|
||||||
$Config['UserFilesPath'] = '/UserFiles/' ;
|
//$Config['UserFilesPath'] = '/UserFiles/' ;
|
||||||
|
|
||||||
// Fill the following value it you prefer to specify the absolute path for the
|
// Fill the following value it you prefer to specify the absolute path for the
|
||||||
// user files directory. Usefull if you are using a virtual directory, symbolic
|
// user files directory. Usefull if you are using a virtual directory, symbolic
|
||||||
|
@ -113,6 +113,28 @@ FCKConfig.ToolbarSets["egw_simple"] = [
|
|||||||
['TextColor','BGColor']
|
['TextColor','BGColor']
|
||||||
] ;
|
] ;
|
||||||
|
|
||||||
|
FCKConfig.ToolbarSets["egw_extended"] = [
|
||||||
|
['Bold','Italic','Underline','-','JustifyLeft','JustifyCenter','JustifyRight','JustifyFull','-','UnorderedList','OrderedList','Outdent','Indent','Undo','Redo'],
|
||||||
|
'/',
|
||||||
|
['FontFormat','FontName','FontSize'],
|
||||||
|
['FitWindow','TextColor','BGColor']
|
||||||
|
] ;
|
||||||
|
|
||||||
|
FCKConfig.ToolbarSets["egw_advanced"] = [
|
||||||
|
['Source','DocProps','-','Save','NewPage','Preview','-','Templates'],
|
||||||
|
['Cut','Copy','Paste','PasteText','PasteWord','-','Print','SpellCheck'],
|
||||||
|
['Undo','Redo','-','Find','Replace','-','SelectAll','RemoveFormat'],
|
||||||
|
'/',
|
||||||
|
['Bold','Italic','Underline','StrikeThrough','-','Subscript','Superscript'],
|
||||||
|
['OrderedList','UnorderedList','-','Outdent','Indent'],
|
||||||
|
['JustifyLeft','JustifyCenter','JustifyRight','JustifyFull'],
|
||||||
|
['Link','Unlink','Anchor'],
|
||||||
|
['TextColor','BGColor','About'],
|
||||||
|
['Image','Flash','Table','Rule','Smiley','SpecialChar','PageBreak','UniversalKey'],
|
||||||
|
'/',
|
||||||
|
['FitWindow','Style','FontFormat','FontName','FontSize']
|
||||||
|
] ;
|
||||||
|
|
||||||
FCKConfig.ContextMenu = ['Generic','Link','Anchor','Image','Flash','Select','Textarea','Checkbox','Radio','TextField','HiddenField','ImageButton','Button','BulletedList','NumberedList','Table','Form'] ;
|
FCKConfig.ContextMenu = ['Generic','Link','Anchor','Image','Flash','Select','Textarea','Checkbox','Radio','TextField','HiddenField','ImageButton','Button','BulletedList','NumberedList','Table','Form'] ;
|
||||||
|
|
||||||
FCKConfig.FontColors = '000000,993300,333300,003300,003366,000080,333399,333333,800000,FF6600,808000,808080,008080,0000FF,666699,808080,FF0000,FF9900,99CC00,339966,33CCCC,3366FF,800080,999999,FF00FF,FFCC00,FFFF00,00FF00,00FFFF,00CCFF,993366,C0C0C0,FF99CC,FFCC99,FFFF99,CCFFCC,CCFFFF,99CCFF,CC99FF,FFFFFF' ;
|
FCKConfig.FontColors = '000000,993300,333300,003300,003366,000080,333399,333333,800000,FF6600,808000,808080,008080,0000FF,666699,808080,FF0000,FF9900,99CC00,339966,33CCCC,3366FF,800080,999999,FF00FF,FFCC00,FFFF00,00FF00,00FFFF,00CCFF,993366,C0C0C0,FF99CC,FFCC99,FFFF99,CCFFCC,CCFFFF,99CCFF,CC99FF,FFFFFF' ;
|
||||||
|
Loading…
Reference in New Issue
Block a user