Page MenuHomeIn-Portal Phabricator

in-portal
No OneTemporary

File Metadata

Created
Sun, Feb 2, 2:58 AM

in-portal

Index: trunk/admin/editor/editor.php
===================================================================
--- trunk/admin/editor/editor.php (revision 718)
+++ trunk/admin/editor/editor.php (revision 719)
@@ -1,175 +1,182 @@
<?php
##############################################################
##In-portal ##
##############################################################
## In-portal ##
## Intechnic Corporation ##
## All Rights Reserved, 1998-2002 ##
## ##
## No portion of this code may be copied, reproduced or ##
## otherwise redistributed without proper written ##
## consent of Intechnic Corporation. Violation will ##
## result in revocation of the license and support ##
## privileges along maximum prosecution allowed by law. ##
##############################################################
if(!strlen($pathtoroot))
{
$path=dirname(realpath(__FILE__));
if(strlen($path))
{
/* determine the OS type for path parsing */
$pos = strpos($path,":");
if ($pos === false)
{
$gOS_TYPE="unix";
$pathchar = "/";
}
else
{
$gOS_TYPE="win";
$pathchar="\\";
}
$p = $path.$pathchar;
/*Start looking for the root flag file */
while(!strlen($pathtoroot) && strlen($p))
{
$sub = substr($p,strlen($pathchar)*-1);
if($sub==$pathchar)
{
$filename = $p."root.flg";
}
else
$filename = $p.$pathchar."root.flg";
if(file_exists($filename))
{
$pathtoroot = $p;
}
else
{
$parent = realpath($p.$pathchar."..".$pathchar);
if($parent!=$p)
{
$p = $parent;
}
else
$p = "";
}
}
if(!strlen($pathtoroot))
$pathtoroot = ".".$pathchar;
}
else
{
$pathtoroot = ".".$pathchar;
}
}
$sub = substr($pathtoroot,strlen($pathchar)*-1);
if($sub!=$pathchar)
{
$pathtoroot = $pathtoroot.$pathchar;
}
//echo $pathtoroot;
require_once($pathtoroot."kernel/startup.php");
//admin only util
$rootURL="http://".ThisDomain().$objConfig->Get("Site_Path");
$admin = $objConfig->Get("AdminDirectory");
if(!strlen($admin))
$admin = "admin";
$adminURL = $rootURL.$admin;
$imagesURL = $adminURL."/images";
require_once ($pathtoroot.$admin."/include/elements.php");
require_once ($pathtoroot."kernel/admin/include/navmenu.php");
require_once($pathtoroot.$admin."/toolbar.php");
require_once($pathtoroot.$admin."/editor/FCKeditor/fckeditor.php");
$style_sheet_global = $adminURL."/include/style.css";
?>
<html>
<head>
<title>Online Editor</title>
<?php print "<link rel=\"stylesheet\" type=\"text/css\" href=\"$style_sheet_global\">\n"; ?>
<?php require_once($pathtoroot.$admin."/include/mainscript.php"); ?>
+ <script>
+ function HasParam(param)
+ {
+ // checks of parameter is passed to function (cross-browser)
+ return typeof(param) == 'undefined' ? false : true;
+ }
+ </script>
</head>
<body marginwidth="0" leftmargin="0" topmargin="0" marginheight="0" style="overflow:auto">
<table width="100%" height="100%" cellspacing="0" cellpadding="0" border="0" align="center"><tr><td align="left" valign="top">
<?php
$section=$_GET["section"];
$objListToolBar = new clsToolBar();
$objListToolBar->Set("section",$section);
$objListToolBar->Set("load_menu_func","");
$objListToolBar->Set("CheckClass","");
$listImages = array();
//$img, $alt, $link, $onMouseOver, $onMouseOut, $onClick
$objListToolBar->Add("select", "la_ToolTip_Select","#","swap('select','toolbar/tool_select_f2.gif');",
"swap('select', 'toolbar/tool_select.gif');",
"document.frm.submit();","tool_select.gif");
$objListToolBar->Add("cancel", "la_ToolTip_Stop","#","swap('cancel','toolbar/tool_stop_f2.gif');",
"swap('cancel', 'toolbar/tool_stop.gif');","window.close();","tool_stop.gif");
$title = "Online HTML Editor";
$objSections->SetCurrentSection($section);
print $objSections->section_header($envar,NULL,$title);
$TargetForm = $_GET["TargetForm"];
$TargetField = $_GET["TargetField"];
echo $objListToolBar->Build();
?>
<form name="frm" action="javascript:update_opener();">
<?php
$oFCKeditor = new FCKeditor();
$oFCKeditor->Value = '' ;
$oFCKeditor->CreateFCKeditor( 'Content', '100%','80%' ) ;
?>
</FORM>
</td></tr></table>
</form>
</body>
<script>
<?php
print <<<END
function update_content()
{
if (window.opener)
{
if (!window.opener.closed)
{
bf = window.opener.document.$TargetForm;
current = bf.$TargetField.value;
//f = document.getElementById('editform');
d = document.getElementById('Content');
d.value = current;
}
else
window.close()
}
else
window.close()
}
function update_opener()
{
d = document.getElementById('Content');
if (d.form)
if (d.form.onsubmit)
d.form.onsubmit()
if (!window.opener) return;
if (!window.opener.closed)
bf.$TargetField.value = d.value;
//alert('Setting bf.$TargetField.value to'+d.value);
window.close();
}
END;
?>
setTimeout('update_content();',100);
</script>
</html>
Property changes on: trunk/admin/editor/editor.php
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.2
\ No newline at end of property
+1.3
\ No newline at end of property

Event Timeline