mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2026-01-06 17:13:03 +01:00
NEW: Rename path for generic medias files into '/medias' instead of
fckeditor. Add location of medias into title of media browser of ckeditor. Work on website module
This commit is contained in:
@@ -52,7 +52,7 @@ class DolEditor
|
||||
* @param string $content Content of WYSIWIG field
|
||||
* @param int $width Width in pixel of edit area (auto by default)
|
||||
* @param int $height Height in pixel of edit area (200px by default)
|
||||
* @param string $toolbarname Name of bar set to use ('Full', 'dolibarr_notes[_encoded]', 'dolibarr_details[_encoded]'=the less featured, 'dolibarr_mailings[_encoded]', ')
|
||||
* @param string $toolbarname Name of bar set to use ('Full', 'dolibarr_notes[_encoded]', 'dolibarr_details[_encoded]'=the less featured, 'dolibarr_mailings[_encoded]', 'dolibarr_readonly')
|
||||
* @param string $toolbarlocation Where bar is stored :
|
||||
* 'In' each window has its own toolbar
|
||||
* 'Out:name' share toolbar into the div called 'name'
|
||||
|
||||
@@ -19,15 +19,20 @@
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
define('NOTOKENRENEWAL',1); // Disables token renewal
|
||||
//define('NOTOKENRENEWAL',1); // Disables token renewal
|
||||
//require '../../../../main.inc.php';
|
||||
require '../../connectors/php/config.php'; // This include the define('NOTOKENRENEWAL',1) and the require main.in.php
|
||||
|
||||
global $Config;
|
||||
|
||||
|
||||
|
||||
require '../../../../main.inc.php';
|
||||
?>
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN"
|
||||
"http://www.w3.org/TR/html4/frameset.dtd">
|
||||
<html>
|
||||
<head>
|
||||
<title>FCKeditor - Resources Browser</title>
|
||||
<title><?php echo $langs->trans("MediaBrowser").' - '.$Config['UserFilesAbsolutePathRelative']; ?></title>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||
<script type="text/javascript" src="js/fckxml.js"></script>
|
||||
<script type="text/javascript">
|
||||
|
||||
@@ -23,6 +23,7 @@
|
||||
*/
|
||||
|
||||
global $Config ;
|
||||
global $website;
|
||||
|
||||
define('NOTOKENRENEWAL',1); // Disables token renewal
|
||||
|
||||
@@ -44,13 +45,15 @@ $Config['Enabled'] = true ;
|
||||
|
||||
|
||||
// Path to user files relative to the document root.
|
||||
$Config['UserFilesPath'] = DOL_URL_ROOT.'/viewimage.php?modulepart=fckeditor&file=' ;
|
||||
$Config['UserFilesPath'] = DOL_URL_ROOT.'/viewimage.php?modulepart=medias'.(empty($website)?'':'_'.$website).'&file=' ;
|
||||
|
||||
$Config['UserFilesAbsolutePathRelative'] = (empty($website) ? ((!empty($entity) ? '/' . $entity : '') . '/medias/') : ('/websites/'.$website));
|
||||
|
||||
// Fill the following value it you prefer to specify the absolute path for the
|
||||
// user files directory. Useful if you are using a virtual directory, symbolic
|
||||
// link or alias. Examples: 'C:\\MySite\\userfiles\\' or '/root/mysite/userfiles/'.
|
||||
// Attention: The above 'UserFilesPath' must point to the same directory.
|
||||
$Config['UserFilesAbsolutePath'] = $dolibarr_main_data_root . (!empty($entity) ? '/' . $entity : '') . '/fckeditor/';
|
||||
$Config['UserFilesAbsolutePath'] = $dolibarr_main_data_root . $Config['UserFilesAbsolutePathRelative'];
|
||||
|
||||
// Due to security issues with Apache modules, it is recommended to leave the
|
||||
// following setting enabled.
|
||||
|
||||
@@ -42,7 +42,7 @@ function SendError($number, $text)
|
||||
|
||||
// Check if this uploader has been enabled.
|
||||
if ( !$Config['Enabled'] )
|
||||
SendUploadResults('1', '', '', 'This file uploader is disabled. Please check the "editor/filemanager/connectors/php/config.php" file');
|
||||
SendUploadResults('1', '', '', 'This file uploader is disabled. Please check the "filemanagerdol/connectors/php/config.php" file');
|
||||
|
||||
$sCommand = 'QuickUpload' ;
|
||||
|
||||
|
||||
@@ -2213,8 +2213,6 @@ function dol_check_secure_access_document($modulepart,$original_file,$entity,$fu
|
||||
// Wrapping for import module
|
||||
else if ($modulepart == 'import')
|
||||
{
|
||||
// Aucun test necessaire car on force le rep de download sur
|
||||
// le rep export qui est propre a l'utilisateur
|
||||
$accessallowed=1;
|
||||
$original_file=$conf->import->dir_temp.'/'.$original_file;
|
||||
}
|
||||
@@ -2222,13 +2220,19 @@ function dol_check_secure_access_document($modulepart,$original_file,$entity,$fu
|
||||
// Wrapping pour l'editeur wysiwyg
|
||||
else if ($modulepart == 'editor')
|
||||
{
|
||||
// Aucun test necessaire car on force le rep de download sur
|
||||
// le rep export qui est propre a l'utilisateur
|
||||
$accessallowed=1;
|
||||
$original_file=$conf->fckeditor->dir_output.'/'.$original_file;
|
||||
}
|
||||
|
||||
// Wrapping pour les backups
|
||||
|
||||
// Wrapping for miscellaneous medias files
|
||||
elseif ($modulepart == 'medias')
|
||||
{
|
||||
$accessallowed=1;
|
||||
global $dolibarr_main_data_root;
|
||||
$original_file=$dolibarr_main_data_root.'/medias/'.$original_file;
|
||||
}
|
||||
|
||||
// Wrapping for backups
|
||||
else if ($modulepart == 'systemtools')
|
||||
{
|
||||
if ($fuser->admin)
|
||||
|
||||
@@ -57,7 +57,7 @@ class modFckeditor extends DolibarrModules
|
||||
$this->picto='list';
|
||||
|
||||
// Data directories to create when module is enabled
|
||||
$this->dirs = array("/fckeditor/temp","/fckeditor/image");
|
||||
$this->dirs = array("/medias/temp","/medias/image");
|
||||
|
||||
// Config pages
|
||||
$this->config_page_url = array("fckeditor.php");
|
||||
@@ -65,7 +65,7 @@ class modFckeditor extends DolibarrModules
|
||||
// Dependencies
|
||||
$this->disabled = (in_array(constant('JS_CKEDITOR'),array('disabled','disabled/'))?1:0); // A condition to disable module (used for native debian packages)
|
||||
$this->depends = array();
|
||||
$this->requiredby = array();
|
||||
$this->requiredby = array('modWebsites');
|
||||
|
||||
// Constants
|
||||
$this->const = array();
|
||||
|
||||
@@ -58,8 +58,8 @@ class modWebsites extends DolibarrModules
|
||||
// Name of image file used for this module.
|
||||
$this->picto='globe';
|
||||
|
||||
// Data directories to create when module is enabled
|
||||
$this->dirs = array();
|
||||
// Data directories to create when module is enabled
|
||||
$this->dirs = array("/websites/temp");
|
||||
|
||||
// Config pages
|
||||
//-------------
|
||||
@@ -68,7 +68,7 @@ class modWebsites extends DolibarrModules
|
||||
// Dependancies
|
||||
//-------------
|
||||
$this->hidden = ! empty($conf->global->WEBSITE_MODULE_DISABLED); // A condition to disable module
|
||||
$this->depends = array(); // List of modules id that must be enabled if this module is enabled
|
||||
$this->depends = array('modFckeditor'); // List of modules id that must be enabled if this module is enabled
|
||||
$this->requiredby = array(); // List of modules id to disable if this one is disabled
|
||||
$this->conflictwith = array(); // List of modules id this module is in conflict with
|
||||
$this->langfiles = array("websites");
|
||||
|
||||
Reference in New Issue
Block a user