<?php
/*
Fast Edit 1.0 - An "edit in place" tool with extended CMS capabilities (C) 2010 Beverley Hooton
(author website - http://fast-edit.co.uk/)

    Fast Edit is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
*/

// name of website
$website_title = 'My Website';

// website domain with trailing slash
$siteurl = 'http://www.mywebsite.com/';

// website root path with trailing slash
// $rooturl = '/home/www/mywebsite.com/'; - below setting should work automatically but if not, set root path manually
$rooturl = dirname(realpath(dirname(__FILE__))).'/';

// username and password (defaults = admin/demo)
$admin_name = 'admin';
$admin_password = 'demo';

// time difference corrector - hours offset from GMT (+/-) 
$gmt_offset = '+1';

// sort menu items alphabetically (A-Z) or manually
// 0; = manually, 1; = A-Z   -   default is manually
$menu_sort = 0;

// allow usage of template manager (user can edit "fast_edit/editable_site_styles.css")
// 0; = no, 1; = yes   -   default is yes
$use_template_manager = 1;

// use basic or advanced page manager (basic does not include menu order, menu status toggle, menu alias, create page or delete page)
// 0; = basic, 1; = advanced   -   default is advanced
$adv_page_manager = 1;

// settings for file manager 
// see "fast_edit/tinymce_3_3_6/tinymce/jscripts/tiny_mce/plugins/tinybrowser/config_tinybrowser.php"
// - File upload paths
// - File link paths
// - File upload size limit in bytes (0 is unlimited) (512000 = 500KB) (1048576 = 1MB) (2097152 = 2MB) (1073741824 = 1GB)
// - Permitted file extensions
// - Assign Permissions for Upload, Edit, Delete & Folder actions (true or false)





#### NO NEED TO EDIT PAST THIS LINE ####

// website root path to editable content (.txt files) with trailing slash
$root = $rooturl.'fast_edit/_content/'; 

// website root path to backup content (.txt files) with trailing slash
$rootbackup = $rooturl.'fast_edit/_backup/'; 

// website root path to menu status files with trailing slash
$menu_status = $rooturl.'fast_edit/_menu_status/';

// website root path to page status files with trailing slash
$menu_alias = $rooturl.'fast_edit/_menu_alias/';

// dynamic auto title script for <title> tag
$title = basename(substr($_SERVER['PHP_SELF'], 0,strrpos($_SERVER['PHP_SELF'],'.'))); // get page name and strip path and extention
$title1 = str_replace('_and_', ' & ', $title); // convert 'and' to &
$title2 = str_replace('_', ' ', strtolower($title1)); // convert name to lowercase and replace underscores with space
						
if ($title2 == 'index') 
	{ 
	$dynamic_title = 'Home'; // index to Home
	} 
	else 
	{ 
	$dynamic_title = ucwords($title2); // capitalize first letter
	}

$alias = @file_get_contents($menu_alias.$title.'.txt');
if ( $alias != '' )
	{
	$dynamic_title = $alias;
	}
	else
	{
	$dynamic_title = $dynamic_title;
	}

//recognise editable content .txt file from base .php file
$basepage = basename(substr($_SERVER['PHP_SELF'], 0,strrpos($_SERVER['PHP_SELF'],'.')));
$contentpage = $root.$basepage.".txt"; 

// dynamic auto title script for preview pages
if (isset($_GET['previewfile'])) 
  	{
  	$previewfile = $_GET['previewfile'];
  	}
	else
  	{
  	$previewfile = ''; 
  	}

$basepage_preview = substr($previewfile, 0, strpos($previewfile, '.'));
$basepage_preview = str_replace('_and_', ' & ', $basepage_preview); // convert 'and' to &
$title_preview = str_replace('_', ' ', strtolower($basepage_preview)); // convert name to lowercase and replace underscores with space
if ( $title_preview == 'index' )
	{
	$dynamic_title_preview = 'Home'; // 'index' to 'Home'
	}
	else
	{
	$dynamic_title_preview = ucwords($title_preview); // capitalize first letter 
	}

?>