Fork me on GitHub

Rapport de message :*
 

Customisation du filemanager dans TinyMCE v4 pour XOOPS

Titre du sujet : Customisation du filemanager dans TinyMCE v4 pour XOOPS
par alain01 sur 12/12/2013 12:00:47

Hello,
je vais vous expliquer ici comment paramétrer votre filemanager issu de TinyMCE v4 dans XOOPS.

Je vous rappelle qu'il faut installer TinyMCE v4 pour XOOPS auparavant.
Je vous rappelle également que le filemanager n'est autre que ce que vous pouvez voir en démo ici :

Ce magnifique gestionnaire rend la dépose et l'utilisation de média bien plus simple et convivial pour vous et vos membres.

Maintenant, voyons comment configurer avec précision les droits et la gestion de filemanager.

Par défaut, le dossier utilisé se trouve sous :
/uploads/filemanager/media.

Vous trouverez sous
/class/xoopseditor/tinymce4/external_plugins/filemanager/config,
le fichier config.php.

Vous pourrez copier la partie se situant sous :
"// YOU CAN COPY AND CHANGE THESE VARIABLES INTO FOLDERS config.php FILES TO CUSTOMIZE EACH FOLDER OPTIONS"
dans n'importe quel dossier sous media.

A savoir : l'héritage des paramètres fonctionne.

Exemple :
sous média, vous créez un dossier "news" dans lequel vous placez votre fichier config.php avec pour paramètre :
$image_max_width=500;

Et bien sous :
- media/news,
- media/news/2013,
- media/news/2013/sports
vos photos auront une largeur max de 500 pixels.

Ce qui est pratique, c'est que pour votre mise en forme, vos membres n'ont plus à se soucier de la taille de leurs images, ils déposent leurs photos en l'état, et c'est le système qui fait la conversion dans la bonne taille, AUTOMATIQUEMENT.
Plus de problème de mise en page par un membre qui a fournit une image trop grande dans la news, pour le thème de votre site.

Pour les autorisations,
il y a dans ce fameux fichier config.php une section "Permissions configuration".

//*************************
//Permissions configuration
//******************
$delete_files=false;
$create_folders=false;
$delete_folders=false;
$upload_files=false;
$rename_files=false;
$rename_folders=false;
$duplicate_files=false;


On peut donc gérer par dossier et par groupe les paramètres suivants :
- Suppression de fichiers,
- Création de dossiers,
- Suppression de dossiers,
- Dépose de fichiers,
- Renommage de fichiers,
- Renommage de dossiers,
- Duplication de fichiers.

et ceci à définir pour chaque groupe, comme vous le voulez.

Exemple :
- Sous media/news/2013 vous autorisez le depot de fichiers que pour les membres "rédacteurs",
- Sous media/news/2013/sports vous autorisez le dépot de fichiers par les membres rédacteurs + membres "sport"

Facile,
sous media/news/2013/config.php :
// XOOPS
global $xoopsUser
// 1 : webmasters
// 2 : members
// 3 : anonymous
// 4 : redacteurs
// 5 : sports
$allowed_groups_upload=array(1,4); // id des groupes autoris?s en upload
$allowed_groups_createfolder=array(1); // id des groupes autoris?s create folder
if ($xoopsUser) {  
    
$usergroups $GLOBALS['xoopsUser']->getGroups(); 
    
$result_upload array_intersect($usergroups$allowed_groups_upload); 
        if (
$result_upload || $result_upload!=null) { 
           
$upload_files=true
        } 
  
$result_createfolder array_intersect($usergroups$allowed_groups_createfolder); 
       if (
$result_createfolder || $result_createfolder!=null) { 
          
$create_folders=true
        } 
}
// XOOPS

et
sous media/news/2013/sport/config.php :
// XOOPS
global $xoopsUser
// 1 : webmasters
// 2 : members
// 3 : anonymous
// 4 : redacteurs
// 5 : sports
$allowed_groups_upload=array(1,4,5); // id des groupes autoris?s en upload
$allowed_groups_createfolder=array(1); // id des groupes autoris?s create folder
if ($xoopsUser) {  
    
$usergroups $GLOBALS['xoopsUser']->getGroups(); 
    
$result_upload array_intersect($usergroups$allowed_groups_upload); 
        if (
$result_upload || $result_upload!=null) { 
           
$upload_files=true
        } 
  
$result_createfolder array_intersect($usergroups$allowed_groups_createfolder); 
       if (
$result_createfolder || $result_createfolder!=null) { 
          
$create_folders=true
        } 
}
// XOOPS


=============================================================
voici le fichier de configuration.

Si vous souhaitez plus de détails sur les paramètres disponibles dans ce fichier, ce sujet est là pour vous et je répondrai à vos questions.


//--------------------------------------------------------------------------------------------------------
// YOU CAN COPY AND CHANGE THESE VARIABLES INTO FOLDERS config.php FILES TO CUSTOMIZE EACH FOLDER OPTIONS
//--------------------------------------------------------------------------------------------------------

$MaxSizeUpload=100//Mb

$default_language="fr_FR"//default language file name
$icon_theme="ico"//ico or ico_dark you can cusatomize just putting a folder inside filemanager/img
$show_folder_size=true//Show or not show folder size in list view feature in filemanager (is possible, if there is a large folder, to greatly increase the calculations)
$show_sorting_bar=true//Show or not show sorting feature in filemanager
$loading_bar=true//Show or not show loading bar
$transliteration=false//active or deactive the transliteration (mean convert all strange characters in A..Za..z0..9 characters)

//*******************************************
//Images limit and resizing configuration
//*******************************************

// set maximum pixel width and/or maximum pixel height for all images
// If you set a maximum width or height, oversized images are converted to those limits. Images smaller than the limit(s) are unaffected
// if you don't need a limit set both to 0
$image_max_width=0;
$image_max_height=0;

//Automatic resizing //
// If you set $image_resizing to true the script converts all uploaded images exactly to image_resizing_width x image_resizing_height dimension
// If you set width or height to 0 the script automatically calculates the other dimension
// Is possible that if you upload very big images the script not work to overcome this increase the php configuration of memory and time limit
$image_resizing=false;
$image_resizing_width=0;
$image_resizing_height=0;

//******************
// Default layout setting
//
// 0 => boxes
// 1 => detailed list (1 column)
// 2 => columns list (multiple columns depending on the width of the page)
// YOU CAN ALSO PASS THIS PARAMETERS USING SESSION VAR => $_SESSION["VIEW"]=
//
//******************
$default_view=0;

//set if the filename is truncated when overflow first row 
$ellipsis_title_after_first_row=true;

//*************************
//Permissions configuration
//******************
$delete_files=false;
$create_folders=false;
$delete_folders=false;
$upload_files=false;
$rename_files=false;
$rename_folders=false;
$duplicate_files=false;

// XOOPS
global $xoopsUser
// 1 : webmasters
// 2 : members
// 3 : anonymous
// 4 : your new group
$allowed_groups_upload=array(1); // id des groupes autoris?s en upload
$allowed_groups_createfolder=array(1); // id des groupes autoris?s create folder
if ($xoopsUser) {  
    
$usergroups $GLOBALS['xoopsUser']->getGroups(); 
    
$result_upload array_intersect($usergroups$allowed_groups_upload); 
        if (
$result_upload || $result_upload!=null) { 
           
$upload_files=true
        } 
  
$result_createfolder array_intersect($usergroups$allowed_groups_createfolder); 
       if (
$result_createfolder || $result_createfolder!=null) { 
          
$create_folders=true
        } 
}
// XOOPS

//**********************
//Allowed extensions (lowercase insert)
//**********************
$ext_img = array('jpg''jpeg''png''gif''bmp''tiff''svg'); //Images
$ext_file = array('doc''docx','rtf''pdf''xls''xlsx''txt''csv','html','xhtml','psd','sql','log','fla','xml','ade','adp','mdb','accdb','ppt','pptx','odt','ots','ott','odb','odg','otp','otg','odf','ods','odp','css','ai'); //Files
$ext_video = array('mov''mpeg''mp4''avi''mpg','wma',"flv","webm"); //Video 
$ext_music = array('mp3''m4a''ac3''aiff''mid','ogg','wav'); //Audio
$ext_misc = array('zip''rar','gz','tar','iso','dmg'); //Archives

$ext=array_merge($ext_img$ext_file$ext_misc$ext_video,$ext_music); //allowed extensions


/******************
 * AVIARY config
*******************/
$aviary_active=true;
$aviary_key="dvh8qudbp6yx2bnp";
$aviary_secret="m6xaym5q42rpw433";
$aviary_version=3;
$aviary_language='en';


//The filter and sorter are managed through both javascript and php scripts because if you have a lot of
//file in a folder the javascript script can't sort all or filter all, so the filemanager switch to php script.
//The plugin automatic swich javascript to php when the current folder exceeds the below limit of files number
$file_number_limit_js=500;

//**********************
// Hidden files and folders
//**********************
// set the names of any folders you want hidden (eg "hidden_folder1", "hidden_folder2" ) Remember all folders with these names will be hidden (you can set any exceptions in config.php files on folders)
$hidden_folders = array();
// set the names of any files you want hidden. Remember these names will be hidden in all folders (eg "this_document.pdf", "that_image.jpg" )
$hidden_files = array('config.php');

//XOOPS
$hidden_files = array('index.html');
//XOOPS
/*******************
 * JAVA upload 
 *******************/
$java_upload=true;
$JAVAMaxSizeUpload=200//Gb


//************************************
//Thumbnail for external use creation
//************************************


// New image resized creation with fixed path from filemanager folder after uploading (thumbnails in fixed mode)
// If you want create images resized out of upload folder for use with external script you can choose this method, 
// You can create also more than one image at a time just simply add a value in the array
// Remember than the image creation respect the folder hierarchy so if you are inside source/test/test1/ the new image will create at
// path_from_filemanager/test/test1/
// PS if there isn't write permission in your destination folder you must set it
$fixed_image_creation                   false//activate or not the creation of one or more image resized with fixed path from filemanager folder
$fixed_path_from_filemanager            = array('../test/','../test1/'); //fixed path of the image folder from the current position on upload folder
$fixed_image_creation_name_to_prepend   = array('','test_'); //name to prepend on filename
$fixed_image_creation_to_append         = array('_test',''); //name to appendon filename
$fixed_image_creation_width             = array(300,400); //width of image (you can leave empty if you set height)
$fixed_image_creation_height            = array(200,''); //height of image (you can leave empty if you set width)


// New image resized creation with relative path inside to upload folder after uploading (thumbnails in relative mode)
// With Responsive filemanager you can create automatically resized image inside the upload folder, also more than one at a time
// just simply add a value in the array
// The image creation path is always relative so if i'm inside source/test/test1 and I upload an image, the path start from here
$relative_image_creation                false//activate or not the creation of one or more image resized with relative path from upload folder
$relative_path_from_current_pos         = array('thumb/','thumb/'); //relative path of the image folder from the current position on upload folder
$relative_image_creation_name_to_prepend= array('','test_'); //name to prepend on filename
$relative_image_creation_name_to_append = array('_test',''); //name to append on filename
$relative_image_creation_width          = array(300,400); //width of image (you can leave empty if you set height)
$relative_image_creation_height         = array(200,''); //height of image (you can leave empty if you set width)

?>
*/
Propulsé avec XOOPS | Graphisme adapté par Tatane, Grosdunord, Montuy337513

74 Personne(s) en ligne (59 Personne(s) connectée(s) sur Forum) | Utilisateur(s): 0 | Invité(s): 74 | Plus ...