When I have time, I'll have to play around with Tiny4 and RESPONSIVE filemanager (their inexplicable orthography).
This looks interesting as well: http://forums.aurigma.com/yaf_postst4033_Amazon-S3-File-Manager-for-TinyMCE-and-CKEditor.aspx#post12430. Not sure if it works with Tiny4
<textarea id="np-content">blah blah</textarea>
<textarea class="modx-richtext"></textarea>
<script src = "//tinymce.cachefly.net/4.1/tinymce.min.js" ></script >
selector: ".modx-richtext"
relative_urls : false, remove_script_host : true, document_base_url : "http://yoursite.com/path/to/image/dir"
//this is the MODx addition to config.php, replacing lines 2 - 32
//session_start();
if (!defined('MODX_CORE_PATH')) {
define('MODX_CORE_PATH', '/path/to/core/');
}
if (!defined('MODX_CONFIG_KEY')) {
define('MODX_CONFIG_KEY', 'config');
}
require_once( MODX_CORE_PATH . 'model/modx/modx.class.php');
$modx = new modx();
$modx->initialize('web');
//DONE Loading MODx Externally! Now let's play with sweet ol' MODx
$modxId = $modx->user->get('id');
$myUsername = $modx->user->get('username');
//only trusted members of the Club have access to filemanger - better security
if ($modx->user->isMember('Writers-Club') ) {
} else {
header( 'Location: http://www.homepage.com' ) ; //send unwanted people home
}
/* another option to lock out unwanted pests - all non-members - spammer members still have access
//if ($modxId == 0)
//{header( 'Location: http://www.homepage.com' ) ;}
*/
/*CREATE PERSONAL FOLDER NAMES for Admin and mere plebeians.
ID of 1 is you, the ultimate Admin
If you have several admins and want them to share a folder, use something like the below lines
//if ($modxId == 1 || $modxId == 6 || $modxId == 13)
//{$personalFolder = "adminGuys";}
*/
if ($modxId == 1)
{$personalFolder = "admin";}
else
{$personalFolder = $modx->user->get('username');}
//all other non-admins get a folder with their name; if they have a strange username with spaces, let's clean it up a bit.
$personalFolder = strtolower($personalFolder);
$xters = array(" ", "_");
$personalFolder = str_replace($xters, "-", $personalFolder);
mb_internal_encoding('UTF-8');
date_default_timezone_set('America/Newyork'); //from the original filemanager file
/*CREATE ACTUAL FOLDERS AND SUB FOLDERS, FIRST TIME USER VISITS.
CREATE NEW CONFIG.PHP FILE, WHICH THE USER CANNOT SEE OR DELETE
/media/username/mp3
/media/username/pictures*/
if (!file_exists('../media/' . $personalFolder)) {
mkdir('../media/' . $personalFolder, 0755, true);
}
if (!file_exists('../media/' . $personalFolder . '/mp3')) {
mkdir('../media/' . $personalFolder . '/mp3', 0755, true);
}
if (!file_exists('../media/' . $personalFolder . '/pictures')) {
mkdir('../media/' . $personalFolder . '/pictures', 0755, true);
}
/*THE CONFIG.TXT FILE YOU ALREADY UPLOADED IS THE TEMPLATE FOR THIS NEW CONFIG.PHP
/media/username/config.php
*/
$userConfigTemplate = '../media/config.txt';
$newConfig = '../media/' . $personalFolder . '/config.php';
if ($modxId !== 1) //do not create a new config.php for the BOSS, he uses the filemanager/config/config.php file and has total access.
{
if (!file_exists('../media/' . $personalFolder . '/config.php')) {
copy($userConfigTemplate , $newConfig);
}
}
//FINISH MODx folders setup
//original Lines 23-32 - PLEASE BE CAREFUL WITH RELATIVE PATHS - observe the $personalFolder part
$base_url =
// Get HTTP/HTTPS
((isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] && !in_array(strtolower($_SERVER['HTTPS']),array('off','no'))) ? 'https' : 'http').
'://'.
// Get domain portion
$_SERVER['HTTP_HOST']; // DON'T TOUCH (base url (only domain) of site (without final /)).
$upload_dir = '/assets/media/' . $personalFolder . '/'; // path from base_url to base of upload folder (with start and final /)
$current_path = '../media/' . $personalFolder . '/'; // relative path from filemanager folder to upload folder (with final /)
//thumbs folder can't put inside upload folder
$thumbs_base_path = '../media/thumbs/'; // relative path from filemanager folder to thumbs folder (with final /)<?php
/*config.txt is our template for user specific config.php
it will be copied to each user's folder automatically*/
$relative_image_creation = true;
$file_number_limit_js=5;
$MaxSizeUpload=1000;
$default_language="en_EN";
$icon_theme="ico";
$show_folder_size=false;
$show_sorting_bar=false;
$loading_bar=true;
$transliteration=false;
$image_max_width=970;
$image_max_height=500;
$image_resizing=false;
$image_resizing_width=0;
$image_resizing_height=0;
$default_view=2;
$ellipsis_title_after_first_row=false;
$create_folders=false;
$delete_files=true;
$delete_folders=false;
$upload_files=true;
$rename_files=true;
$rename_folders=false;
$duplicate_files=false;
$ext_img = array('jpg', 'jpeg', 'png', 'gif'); //Images
$ext_file = array('jpg', 'jpeg', 'png', 'gif'); //Files
$ext_video = array('jpg', 'jpeg', 'png', 'gif'); //Video
$ext_music = array('jpg', 'jpeg', 'png', 'gif'); //Audio
$ext_misc = array('jpg', 'jpeg', 'png', 'gif'); //Archives
$folder_message= "Hello " . $myUsername . ", this is your folder (/media/" . $personalFolder . "). You may upload images. Right-click items for more info..."
?>and this, in the TinyMCE init section of NP, will make it work right away (after you remove the code that loads the MODX TinyMCE):
selector: ".modx-richtext"
[[+npx.insert]] [[+np.post_stuff]]