<?

/*
FlexCMS (http://www.flexcms.com)
Flexible, Powerful, Affordable.

Contents of this file are protected by the copyright
notice found at http://www.flexcms.com/flex/pages/copyright.html,
and its usage is subject to the terms of the licensing agreement 
available at http://www.flexcms.com/flex/pages/license.html
*/



	// ========================================================================================
	// Manage Prefs
	// ========================================================================================
	
	$PageTitle = '<img src="'.$ImagesURL.'/admin/admincp_articles.gif" width="22" height="21"> '.$MsgText[7][3];
	$BrowserTitle = $MsgText[7][3];
	$LocationBar = '<a href="'.$IndexURL.'">'.$MsgText[0][1].'</a> > <a href="' . $MainURL . '/options.html">'.$MsgText[0][4].'</a> > '.$MsgText[7][3];
	
	if ($LoggedIn == 'y') {
		
		ReadPermissions();
		Global $Permissions;
		
		if ($Permissions[704] == 'y') {
		
			$query = "select * from `".$Settings['DBPrefix']."na-Settings`";
			$result = mysql_query($query) or die (mysql_error());
			while ($row = mysql_fetch_array($result)) {
				$naSettings[$row['Name']] = $row['Value'];
			}
			
			
			$TitleAlignmentSelected[$naSettings['TitleAlignment']] = ' selected';
			$PEAlignmentSelected[$naSettings['PEAlignment']] = ' selected';
			
			$TopTextAlignmentSelected[$naSettings['TopTextAlignment']] = ' selected';
				
				
			$PageContents = '<form name="PostForm" action="'.$MainURL.'/admin/articles-prefs-save" method="post">
			
			<br><b>'.$MsgText[2][49].':</b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;('.$MsgText[2][50].': <select name="TitleAlignment" style="'.$FormStyle.'">
			<option value="L"'.$TitleAlignmentSelected['L'].'> '.$MsgText[0][15].'</option>
			<option value="C"'.$TitleAlignmentSelected['C'].'> '.$MsgText[0][16].'</option>
			<option value="R"'.$TitleAlignmentSelected['R'].'> '.$MsgText[0][17].'</option>
			</select>)<br>
			<input type="text" name="Title" size="45" value="'.str_replace('"','&#34;',$naSettings['Title']).'" style="'.$FormStyle.'">
			<br>
			
			
			<script>
var ImageDestination = "";

var ExistingImagesWindowCode = "";

function SelectImage(ImageDestinationSent) {
	var WindowProperties = "width=420,height=300,left=" + (screen.width-420)/2 + ",top=" + (screen.height-300)/2 + ",location=no,menubar=no,directories=no,toolbar=no,status=no,scrollbars=no,resizable=yes";

	ImageDestination = ImageDestinationSent;

	if (ImageDestination == "Photo") {
		ExistingImagesWindowCode = window.open("'.$BaseURL.'/inc-core-admin-editor-existingimages.php?"+document.forms["PostForm"].elements["PhotoURL"].value,"existingimages",WindowProperties);
	}
	else {
		ExistingImagesWindowCode = window.open("'.$BaseURL.'/inc-core-admin-editor-existingimages.php?"+document.forms["PostForm"].elements["TitleImage"].value,"existingimages",WindowProperties);
	}
}
function ExistingImageSelected(ImageName,ImageWidth,ImageHeight) {

	ExistingImagesWindowCode.close();
	
	if (ImageDestination == "Photo") {
		document.forms["PostForm"].elements["PhotoURL"].value = "/images/uploaded/"+ImageName;
	}
	else {
		document.forms["PostForm"].elements["TitleImage"].value = "/images/uploaded/"+ImageName;
	}

}
function UploadToServer(ImageDestinationSent) {

		ImageDestination = ImageDestinationSent;

		var WindowProperties = "width=580,height=380,left=" + (screen.width-580)/2 + ",top=" + (screen.height-380)/2 + ",location=no,menubar=no,directories=no,toolbar=no,status=no,scrollbars=no,resizable=yes";

		UploadWindowCode = window.open("'.$BaseURL.'/inc-core-admin-editor-imageupload.php","imageupload",WindowProperties);

	  }

	  function UploadedImageSelected(ImageName,ImageWidth,ImageHeight) {

		UploadWindowCode.close();
		
		
		if (ImageDestination == "Photo") {
			document.forms["PostForm"].elements["PhotoURL"].value = "/images/uploaded/"+ImageName;
		}
		else {
			document.forms["PostForm"].elements["TitleImage"].value = "/images/uploaded/"+ImageName;
		}
		
	  }
</script>
			
			
			'.$MsgText[0][519].':<br>
			<input type="text" name="TitleImage" size="50" value="'.str_replace('"', '&#34;', $naSettings['TitleImage']).'" style="'.$FormStyle.'">
			<br>
			<input type="button" value="'.$MsgText[0][521].'" onClick="SelectImage();" style="'.$FormStyle.'">&nbsp;<input type="button" value="'.$MsgText[0][563].'" onClick="UploadToServer();" style="'.$FormStyle.'">
			
			
			
			<br><br>
			
			<br><br>
			
			<b>'.$MsgText[7][53].':</b><br>
			<select name="PEAlignment" style="'.$FormStyle.'">
			<option value="L"'.$PEAlignmentSelected['L'].'> '.$MsgText[0][15].'</option>
			<option value="C"'.$PEAlignmentSelected['C'].'> '.$MsgText[0][16].'</option>
			<option value="R"'.$PEAlignmentSelected['R'].'> '.$MsgText[0][17].'</option>
			</select>
			<br><br><br>
			
			<b>'.$MsgText[8][28].':</b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;('.$MsgText[1][26].': <select name="TopTextAlignment" style="'.$FormStyle.'">
			<option value="L"'.$TopTextAlignmentSelected['L'].'> '.$MsgText[0][15].'</option>
			<option value="C"'.$TopTextAlignmentSelected['C'].'> '.$MsgText[0][16].'</option>
			<option value="R"'.$TopTextAlignmentSelected['R'].'> '.$MsgText[0][17].'</option>
			</select>)<br>
			<textarea name="TopText" cols="39" rows="1" wrap="virtual" style="'.$FormStyle.'">'.str_replace('<','&lt;',$naSettings['TopText']).'</textarea>
			<br><font size="1">'.$MsgText[8][6].'<br></font>
			<br><br>
						
			<b>'.$MsgText[7][54].':</b> <input type="text" name="TeaserLength" size="5" value="'.$naSettings['TeaserLength'].'" style="'.$FormStyle.'"><br>
			<font size="1">'.$MsgText[7][55].'<br></font>
			<br>
			<br>
			<b>'.$MsgText[7][56].':</b><br>
			'.$MsgText[7][57].': <input type="text" name="MaxWidth" size="5" value="'.$naSettings['MaxWidth'].'" style="'.$FormStyle.'"> x '.$MsgText[7][58].': <input type="text" name="MaxHeight" size="5" value="'.$naSettings['MaxHeight'].'" style="'.$FormStyle.'">

			<br>
			<br>
			<b>'.$MsgText[7][59].':</b><br>
			'.$MsgText[7][57].': <input type="text" name="ThumbMaxWidth" size="5" value="'.$naSettings['ThumbMaxWidth'].'" style="'.$FormStyle.'"> x '.$MsgText[7][58].': <input type="text" name="ThumbMaxHeight" size="5" value="'.$naSettings['ThumbMaxHeight'].'" style="'.$FormStyle.'">

			<br><br>
			'.$MsgText[7][60].'

			
			<br>
			<br><br><br>
			<input type="submit" value="'.$MsgText[0][123].'" style="'.$FormStyle.'">
			</form>';
			
			
	
	
		}
		else {
		
			$PageContents = $MsgText[0][97];
		
		}

	}
	else {
	
		RedirectToLogin();
	
	}
	

	// ========================================================================================




?>
