This was done from just the very bare basics of the razorcms plugin code and im sure it can be much much better but hopefully somebody will find a use. Just use this code as the blade php file and then create the required xml file also using the required details then activate the blade - easy as that. the code here forms the very bare basics of any in page blade.
- Code: Select all
<?php
///////////////////////////////////////////////////////////
// morgan integrated systems limited - razorCMS //
// Blade Pack //
// Include Google Map in page content //
// GPLv3 //
// Version 1.0 //
// smiffy6969 //
// www.razorcms.co.uk //
// www.mis-limited.com //
// 06/2009 //
///////////////////////////////////////////////////////////
///////////////////////
// Socket Allocation //
///////////////////////
// Add Blades to Sockets $bladeList['blade'] = 'socket'; //
$bladeList['addButtongoogleMap'] = 'admin-add-page-function';
$bladeList['scanPagegoogleMap'] = 'scan-content-slug';
///////////////////////
// Blades //
///////////////////////
// blade - ouput function button and place function in page //
function addButtongoogleMap(&$extraInfo,&$content) {
if($_SESSION['adminLogIn']) {
if( isset( $_POST['google-map'] ) ) {
$content = stripslashes($_POST['content']);
$content.= "in-page-blade(google-map)";
}
$extraInfo.= '<input id="button" type="submit" value="Add Map" name="google-map"> ¦';
}
}
//Output the data in page area
function scanPagegoogleMap(&$slugOut) {
//Define the custom code in a variable
$map = file_get_contents('map.html');
//Replace the in page tag with this variable and return the output
$slugOut = str_replace('<p>in-page-blade(google-map)</p>', $map , $slugOut);
$slugOut = str_replace('in-page-blade(google-map)', $map , $slugOut);
}
?>