function tinyMCE(&$te)
{
    if ($_SESSION['adminLogIn']) {
        $editorCSSPath = "../";
        $editorCSS = "theme/editor_css.css";
        BsocketB('editor-css-path', array(&$editorCSS));
        ?>
        <!-- TinyMCE -->
        <script type="text/javascript">
	tinyMCE.init({
		// General options
		mode : "textareas",
		theme : "advanced",
		plugins : "safari,pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,inlinepopups,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template",

		// Theme options
		theme_advanced_buttons1 : "save,newdocument,|,bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,styleselect,formatselect,fontselect,fontsizeselect",
		theme_advanced_buttons2 : "cut,copy,paste,pastetext,pasteword,|,search,replace,|,bullist,numlist,|,outdent,indent,blockquote,|,undo,redo,|,link,unlink,anchor,image,cleanup,help,code,|,insertdate,inserttime,preview,|,forecolor,backcolor",
		theme_advanced_buttons3 : "tablecontrols,|,hr,removeformat,visualaid,|,sub,sup,|,charmap,emotions,iespell,media,advhr,|,print,|,ltr,rtl,|,fullscreen",
		theme_advanced_buttons4 : "insertlayer,moveforward,movebackward,absolute,|,styleprops,|,cite,abbr,acronym,del,ins,attribs,|,visualchars,nonbreaking,template,pagebreak",
		theme_advanced_toolbar_location : "top",
		theme_advanced_toolbar_align : "left",
		theme_advanced_statusbar_location : "bottom",
		theme_advanced_resizing : true,

		// Example content CSS (should be your site CSS)
		content_css : "<?php 
        echo $editorCSSPath . $editorCSS;
        ?>
",

		// Drop lists for link/image/media/template dialogs
		template_external_list_url : "lists/template_list.js",
		external_link_list_url : "lists/link_list.js",
		external_image_list_url : "lists/image_list.js",
		media_external_list_url : "lists/media_list.js",

		// Replace values for the template plugin
		template_replace_values : {
			username : "******",
			staffid : "991234"
		}
	});
        </script>
        <!-- /TinyMCE -->
<?php 
        $te[2] = '<textarea id="elm1" name="content" rows="30" style="width: 98%">' . $te[4] . '</textarea>';
    }
}
Esempio n. 2
0
function showBladePacks($type)
{
    if ($_SESSION['adminType'] == 'user') {
        return;
    }
    if (isset($_GET['bladeinfo']) && isset($_GET['blade']) && $_GET['bladeinfo'] == 'show') {
        $bladeName = stripslashes($_GET['blade']);
        if (file_exists(getSystemRoot(RAZOR_ADMIN_FILENAME) . RAZOR_BLADEPACK_DIR . $bladeName . '.xml')) {
            showBladePackInfo($bladeName . '.xml');
        }
    }
    global $bladeList, $razorArray;
    $activeBlades = $razorArray['active-bladepack'];
    $xmlList = array();
    $descTxt = lt('Description');
    $optTxt = lt('Options');
    // generate list of xml files and get data //
    $fileList = readDirContents(getSystemRoot(RAZOR_ADMIN_FILENAME) . RAZOR_BLADEPACK_DIR);
    foreach ($fileList as $foundFile) {
        $getFileExt = explode('.', basename($foundFile));
        $fileExt = end($getFileExt);
        if ($fileExt == 'xml') {
            $xmlData = file_get_contents(getSystemRoot(RAZOR_ADMIN_FILENAME) . RAZOR_BLADEPACK_DIR . $foundFile);
            $bpDetails = new BPCONTROL();
            if ($bpDetails->getXmlData($xmlData, $foundFile)) {
                // read xml data and remove file
                $bpDetails->getBPName();
                $bpDetails->getBPVersion();
                $bpDetails->getBPDesc();
                $bpDetails->getBPAuth();
                $bpDetails->getBPClass();
                $tempVar = explode('.', basename($foundFile));
                $bladeID = reset($tempVar);
                $xmlList[$bladeID]['title'] = $bpDetails->name;
                $xmlList[$bladeID]['version'] = $bpDetails->version;
                $xmlList[$bladeID]['description'] = $bpDetails->description;
                $xmlList[$bladeID]['author'] = $bpDetails->author;
                $xmlList[$bladeID]['class'] = $bpDetails->className;
            }
        }
    }
    // process form data //
    if (isset($_GET['do'])) {
        $do = $_GET['do'];
        $blade = $_GET['blade'];
        if (in_array($blade, array_keys($xmlList))) {
            if ($do == 'activate' && !in_array($blade, $activeBlades)) {
                $activeBlades[] = $blade;
                echo MsgBox(lt('Blade Pack Activated'), 'greenbox');
                $razorArray['active-bladepack'] = $activeBlades;
                saveRazorArray();
            }
            if ($do == 'deactivate' && in_array($blade, $activeBlades)) {
                $activeBlades = array_diff($activeBlades, (array) $blade);
                echo MsgBox(lt('Blade Pack Deactivated'), 'greenbox');
                $razorArray['active-bladepack'] = $activeBlades;
                saveRazorArray();
            }
            if ($do == 'delete' && $blade) {
                // remove the bladepack permanently
                if (file_exists(getSystemRoot(RAZOR_ADMIN_FILENAME) . RAZOR_BLADEPACK_DIR . $blade . '.xml')) {
                    $xmlData = file_get_contents(getSystemRoot(RAZOR_ADMIN_FILENAME) . RAZOR_BLADEPACK_DIR . $blade . '.xml');
                    $bpRemove = new BPCONTROL();
                    if ($bpRemove->getXmlData($xmlData, $blade . '.xml')) {
                        // read xml data and remove file
                        if ($bpRemove->getXMLName() && $bpRemove->getBFName()) {
                            if (deleteFile(RAZOR_BLADEPACK_DIR . $bpRemove->xmlName, false) && deleteFile(RAZOR_BLADEPACK_DIR . $bpRemove->bladepackName, false)) {
                                if ($bpRemove->getDIRName()) {
                                    deleteDirR(RAZOR_BLADEPACK_DIR . $bpRemove->folderName);
                                }
                                // remove from active blades //
                                if (in_array($blade, $activeBlades)) {
                                    $activeBlades = array_diff($activeBlades, (array) $blade);
                                    $razorArray['active-bladepack'] = $activeBlades;
                                    saveRazorArray();
                                }
                                MsgBox(lt('Blade pack removed sucessfully'), 'greenbox');
                            } else {
                                MsgBox(lt('Remove error, all files could not be deleted'), 'redbox');
                            }
                        } else {
                            MsgBox(lt('Could not remove bladepack, XML data incorrect'), 'redbox');
                        }
                    } else {
                        MsgBox(lt('Could not remove bladepack, could not get XML data'), 'redbox');
                    }
                } else {
                    MsgBox(lt('Could not remove bladepack, XML file not found'), 'redbox');
                }
            }
        }
    }
    // end //
    // scrub xml list clean //
    $xmlList = array();
    // re-generate list of xml files and get data //
    $fileList = readDirContents(getSystemRoot(RAZOR_ADMIN_FILENAME) . RAZOR_BLADEPACK_DIR);
    foreach ($fileList as $foundFile) {
        $getFileExt = explode('.', basename($foundFile));
        $fileExt = end($getFileExt);
        if ($fileExt == 'xml') {
            $xmlData = file_get_contents(getSystemRoot(RAZOR_ADMIN_FILENAME) . RAZOR_BLADEPACK_DIR . $foundFile);
            $bpDetails = new BPCONTROL();
            if ($bpDetails->getXmlData($xmlData, $foundFile)) {
                // read xml data and remove file
                $bpDetails->getBPName();
                $bpDetails->getBPVersion();
                $bpDetails->getBPDesc();
                $bpDetails->getBPAuth();
                $bpDetails->getBPClass();
                $tempVar = explode('.', basename($foundFile));
                $bladeID = reset($tempVar);
                $xmlList[$bladeID]['title'] = $bpDetails->name;
                $xmlList[$bladeID]['version'] = $bpDetails->version;
                $xmlList[$bladeID]['description'] = $bpDetails->description;
                $xmlList[$bladeID]['author'] = $bpDetails->author;
                $xmlList[$bladeID]['class'] = $bpDetails->className;
            }
        }
    }
    // sort xml data using xml compare function to sort by title //
    uasort($xmlList, "xmlCmp");
    // output text and table for blades installed //
    $bladeerDescTxt = lt('Blade Packs are sets of blades, each blade can be allocated to a socket to add extra functionality to the base system. The base system is capable of using many blades, even allocating more than one to a single slot. Use the manager to activate and deactivate your blade packs.');
    $delConfirmMsg = lt('Are you sure you want to permanently delete the blade pack from the system') . '?';
    BsocketB('output-blade-manager');
    echo "<h1>" . lt('Installed Blade Packs') . "</h1>";
    echo "<div class='contentwh'>";
    echo "<h3>" . lt(ucfirst($type)) . "</h3>";
    echo "<p>{$bladeerDescTxt}</p>";
    $t = "<table class='tableViewBlades'>";
    $t .= "<tr class='tableTitle'><th class='twenty'>" . lt('Blade Pack') . "</th><th class='auto'>{$descTxt}</th><th class='ten'>" . lt('Version') . "</th><th class='ten'>" . lt('Author') . "</th><th class='ten'>" . lt('Control') . "</th></tr>";
    foreach ($xmlList as $bladeName => $bladeInfo) {
        if (strtolower($bladeInfo['class']) == $type) {
            if (in_array($bladeName, $activeBlades)) {
                $Lable = makeLink("?action=blade{$type}&do=deactivate&blade={$bladeName}", "<img class='deactivate' src='theme/images/subtract.gif' alt='" . lt('Deactivate') . "' />");
            } else {
                $Lable = makeLink("?action=blade{$type}&do=activate&blade={$bladeName}", "<img class='activate' src='theme/images/add.gif' alt='" . lt('Activate') . "' />");
            }
            $desc = $xmlList[$bladeName]['description'];
            $name = $xmlList[$bladeName]['title'];
            $version = $xmlList[$bladeName]['version'];
            $author = $xmlList[$bladeName]['author'];
            $removePack = makeLink("?action=blade{$type}&do=delete&blade={$bladeName}", "<img class='deactivate' src='theme/images/trash.gif' alt='" . lt('Delete') . "' onclick='return confirm(\"{$delConfirmMsg}\");'/>");
            $info = makeLink("?action=blade{$type}&bladeinfo=show&blade={$bladeName}", "<img class='edit' src='theme/images/alert.gif' alt='" . lt('Info') . "'/>");
            $t .= "<tr><td>{$name}</td><td>{$desc}</td><td>{$version}</td><td>{$author}</td><td>{$Lable} {$removePack} {$info}</td></tr>";
        }
    }
    $t .= "<tr class='tableFooter'><th class='twenty'></th><th class='auto'></th><th class='ten'></th><th class='ten'></th><th class='ten'></th></tr></table></div>";
    echo $t;
    // end //
}

</div>
<div id="ft_btm">            <?php 
loadLinks('footer');
?>
            <?php 
loadSettings('copyright');
?>
            <?php 
BsocketB('public-xhtml-footer');
?>
<br />
<!--Credits -->
<a href="http://ramblingsoul.com">CSS Template</a> by Rambling Soul<br />
Images from<a href="http://sxc.hu"> sxc.hu</a>
<!--/Credits -->


</div>

</div>

</div>
<?php 
BsocketB('public-xhtml-endofdoc');
?>
  
</body>
</html>
Esempio n. 4
0
}
header("Content-type: text/html; charset={$charset}");
///////////////////////////////////////////////////////////
// load active installed blades ///////////////////////////
foreach ($razorArray['active-bladepack'] as $bladePack) {
    if (file_exists(getSystemRoot(RAZOR_HOME_FILENAME) . RAZOR_BLADEPACK_DIR . $bladePack . '.php')) {
        include_once getSystemRoot(RAZOR_HOME_FILENAME) . RAZOR_BLADEPACK_DIR . $bladePack . '.php';
    }
}
///////////////////////////////////////////////////////////
// edit razor array ///////////////////////////////////////
BsocketB('public-edit-razorarray', array(&$razorArray));
///////////////////////////////////////////////////////////
// set page contents to display ///////////////////////////
$theme = setActivePage();
///////////////////////////////////////////////////////////
// socket load points /////////////////////////////////////
BsocketB('public-index-socket1');
BsocketB('public-index-socket2');
BsocketB('public-index-socket3');
///////////////////////////////////////////////////////////
// end buffering of output ////////////////////////////////
ob_end_flush();
///////////////////////////////////////////////////////////
// Load theme for public //////////////////////////////////
if (isset($razorArray['settings']['maintenance']) && $razorArray['settings']['maintenance'] && !isset($_SESSION['adminLogIn'])) {
    include_once 'theme/maintenance_xhtml.php';
} else {
    include_once $loadTheme;
}
///////////////////////////////////////////////////////////
Esempio n. 5
0
function lt($defaultText)
{
    $text = $defaultText;
    BsocketB('language-select', array(&$text));
    return $text;
}
                </div>
            </div>
        </div>
        <div id="footer">
        <div id="footerr">
        <div id="footerl">
        <div id="footnav">
            <div id="footerLeft">
                <a href="http://www.razorcms.co.uk">www.razorcms.co.uk</a>
            </div>
            <div id="footerRight">
                <a href="http://www.mis-limited.com">www.mis-limited.com</a>
            </div>
	    <?php 
BsocketB('admin-xhtml-footer');
?>
        </div>  
        </div>
        </div>
        </div>
    </div>
    </div>
    </div>
<?php 
BsocketB('admin-xhtml-endofdoc');
?>
  
</body>
</html>

Esempio n. 7
0
    echo $form;
    exit;
}
// end ///////////
// if authenticated, continue //
// set up functions library ///////////////////////////////
include_once "core/admin_func.php";
include_once 'core/admin_class.php';
include_once 'lib/zip.lib.php';
include_once 'lib/unzip.lib.php';
include_once 'lib/razorXML.lib.php';
///////////////////////////////////////////////////////////
// set up logs directory //////////////////////////////////
createLogsDir();
///////////////////////////////////////////////////////////
// set page contents to display ///////////////////////////
setActivePage();
///////////////////////////////////////////////////////////
// socket load points /////////////////////////////////////
BsocketB('admin-index-socket1');
BsocketB('admin-index-socket2');
BsocketB('admin-index-socket3');
///////////////////////////////////////////////////////////
// Load default theme for admin //////////////////////////
$theme = "theme/default_admin_xhtml.php";
BsocketB('admin-change-theme', array(&$theme));
include_once $theme;
//////////////////////////////////////////////////////////
?>
 
 function loadSlab($slab)
 {
     global $razorArray;
     $detectSlab = false;
     $slabs = $razorArray['slabs'];
     $sids = array_flip($slabs);
     if (!in_array($slab, $slabs)) {
         BsocketB('detect-new-slab', array($slab, &$detectSlab));
         if (!$detectSlab) {
             return false;
         }
     }
     $this->slab = $slab;
     if (!$detectSlab) {
         $this->slabId = $sids[$slab];
     }
     $this->loadSlabDetails();
 }