Demo Configuration Plugin

< Back to demos

Demo Plugin Source:

We are loading a plugin to apply shared configuration settings to the demo editors.

<?php
if (!defined('IN_WPRO')) exit;

class 
wproPlugin_demoConfig {

    function 
init(&$editor) {
        
        
// Load content into the editor from a file (this is not the only way to load content, you can load content from any source)
        
$editor->loadValueFromFile(dirname(dirname(dirname(dirname(__FILE__)))).'/content/1.html');
        
        
// apply a default appearance to the document:
        
$editor->stylesheet '/assets/templates/wysiwygpro/site.css';
        
$editor->cssText 'body { background-color: #ffffff; background-image: none; text-align: left; margin: 5px; padding: 0px; }';
        
        
// CONFIGURE THE FILE MANAGER:
        
        // full directory path for your images folder:
        
$editor->imageDir dirname(dirname(dirname(dirname(__FILE__)))).'/images/';
        
// URL of your images folder:
        
$editor->imageURL '/demosV3/images/';
        
        
// full directory path of your documents folder for storing PDF and Word files etc:
        
$editor->documentDir dirname(dirname(dirname(dirname(__FILE__)))).'/documents/';
        
// url of your documents folder:
        
$editor->documentURL '/demosV3/documents/';
        
        
// full directory path of your media folder for storing video files:
        
$editor->mediaDir dirname(dirname(dirname(dirname(__FILE__)))).'/media/';
        
// url of your media folder:
        
$editor->mediaURL '/demosV3/media/';
        
        
// File editing permissions:
        
$editor->editImages true;
        
$editor->renameFiles true;
        
$editor->renameFolders true;
        
$editor->deleteFiles true;
        
$editor->deleteFolders true;
        
$editor->copyFiles true;
        
$editor->copyFolders true;
        
$editor->moveFiles true;
        
$editor->moveFolders true;
        
$editor->upload true;
        
$editor->overwrite false;
        
$editor->createFolders true;
        
        
$editor->diskQuota '4 MB';
                
        
// second image folder
        
$dir = new wproDirectory();
        
$dir->dir dirname(dirname(dirname(dirname(dirname(__FILE__))))).'/images/';
        
$dir->URL '/images/';
        
$dir->name 'Shared Images (uneditable)';
        
$dir->diskQuota 4;
        
$editor->addDirectory($dir);
        
        
// Add some links that you can choose from when inserting a hyperlink:
        
$editor->links = array(
            array(
'title'=>'Home','URL'=>'/index.php?id=1'),
            array(
'title'=>'Products','URL'=>'/index.php?id=49'),
            array(
'title'=>'Features','URL'=>'/index.php?id=50'),
            array(
'title'=>'Requirements','URL'=>'/index.php?id=51'),
            array(
'title'=>'Demos','URL'=>'/index.php?id=52'),
            array(
'title'=>'FAQ','URL'=>'/index.php?id=53'),
            array(
'title'=>'Support','URL'=>'/index.php?id=54'),
        );
        
        
// route the editor scripts
        
$editor->route '/WPDemoRouter.php';
            
    }
}

?>

WysiwygPro.com