⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 style.php

📁 极限网络智能办公系统 - Office Automation 2008 官方100% 源码
💻 PHP
📖 第 1 页 / 共 4 页
字号:
		goerror( "请填写有效的缩略图使用最小长度条件,不能为空,且为数字型!" );
	}
	if ( !is_numeric( $GLOBALS['sSLTOkSize'] ) )
	{
		goerror( "请填写有效的缩略图生成长度,不能为空,且为数字型!" );
	}
	if ( !is_numeric( $GLOBALS['sSYMinSize'] ) )
	{
		goerror( "请填写有效的水印的最小宽度条件,不能为空,且为数字型!" );
	}
	if ( $sSYText == "" )
	{
		goerror( "请填写有效水印文字内容,不能为空!" );
	}
	if ( !isvalidcolor( $GLOBALS['sSYFontColor'] ) )
	{
		goerror( "请填写有效的水印文字颜色,6位长度,如黑色:000000!" );
	}
	if ( !isvalidcolor( $GLOBALS['sSYShadowColor'] ) )
	{
		goerror( "请填写有效的水印文字阴影颜色,6位长度,如白色:FFFFFF!" );
	}
	if ( !is_numeric( $GLOBALS['sSYShadowOffset'] ) )
	{
		goerror( "请填写有效的水印文字阴影大小,不能为空,且为数字型!" );
	}
	if ( !is_numeric( $GLOBALS['sSYFontSize'] ) )
	{
		goerror( "请填写有效的水印文字大小,不能为空,且为数字型!" );
	}
}

function dostyleaddsave( )
{
	if ( stylename2id( $sStyleName ) != -1 )
	{
		goerror( "此样式名已经存在,请用另一个样式名!" );
	}
	$nNewStyleID = count( $GLOBALS['aStyle'] ) + 1;
	$GLOBALS['aStyle'][$nNewStyleID] = $sStyleName."|||".$sStyleDir."|||".$sStyleCSS."|||".$sStyleUploadDir."|||".$sStyleWidth."|||".$sStyleHeight."|||".$sStyleFileExt."|||".$sStyleFlashExt."|||".$sStyleImageExt."|||".$sStyleMediaExt."|||".$sStyleRemoteExt."|||".$sStyleFileSize."|||".$sStyleFlashSize."|||".$sStyleImageSize."|||".$sStyleMediaSize."|||".$sStyleRemoteSize."|||".$sStyleStateFlag."|||".$sStyleDetectFromWord."|||".$sStyleInitMode."|||".$sStyleBaseUrl."|||".$sStyleUploadObject."|||".$sStyleAutoDir."|||".$sStyleBaseHref."|||".$sStyleContentPath."|||".$sStyleAutoRemote."|||".$sStyleShowBorder."|||".$sStyleMemo."|||".$sAutoDetectLanguage."|||".$sDefaultLanguage."|||".$sSLTFlag."|||".$sSLTMinSize."|||".$sSLTOkSize."|||".$sSYFlag."|||".$sSYText."|||".$sSYFontColor."|||".$sSYFontSize."|||".$sSYFontName."|||".$sSYPicPath."|||".$sSLTSYObject."|||".$sSLTSYExt."|||".$sSYMinSize."|||".$sSYShadowColor."|||".$sSYShadowOffset;
	writeconfig( );
	writestyle( $nNewStyleID );
	showmessage( "<b><span class=red>样式增加成功!</span></b><li><a href='?action=toolbar&id=".$nNewStyleID."'>设置此样式下的工具栏</a>" );
}

function doupdateconfig( )
{
	writeconfig( );
	$i = 1;
	for ( ;	$i <= count( $GLOBALS['aStyle'] );	++$i	)
	{
		writestyle( $i );
	}
	showmessage( "<b><span class=red>所有样式的前台配置文件更新操作成功!</span></b><li><a href='?'>返回所有样式列表</a>" );
}

function dostylesetsave( )
{
	$GLOBALS['sStyleID'] = totrim( "id" );
	if ( is_numeric( $GLOBALS['sStyleID'] ) )
	{
		$n = stylename2id( $sStyleName );
		if ( $n != ( integer )$sStyleID && $n != -1 )
		{
			goerror( "此样式名已经存在,请用另一个样式名!" );
		}
		if ( ( integer )$sStyleID < 1 && count( $GLOBALS['aStyle'] ) < ( integer )$sStyleID )
		{
			goerror( "无效的样式ID号,请通过页面上的链接进行操作!" );
		}
		$aTemp = explode( "|||", $GLOBALS['aStyle'][$sStyleID] );
		$s_OldStyleName = $aTemp[0];
		$GLOBALS['aStyle'][$sStyleID] = $sStyleName."|||".$sStyleDir."|||".$sStyleCSS."|||".$sStyleUploadDir."|||".$sStyleWidth."|||".$sStyleHeight."|||".$sStyleFileExt."|||".$sStyleFlashExt."|||".$sStyleImageExt."|||".$sStyleMediaExt."|||".$sStyleRemoteExt."|||".$sStyleFileSize."|||".$sStyleFlashSize."|||".$sStyleImageSize."|||".$sStyleMediaSize."|||".$sStyleRemoteSize."|||".$sStyleStateFlag."|||".$sStyleDetectFromWord."|||".$sStyleInitMode."|||".$sStyleBaseUrl."|||".$sStyleUploadObject."|||".$sStyleAutoDir."|||".$sStyleBaseHref."|||".$sStyleContentPath."|||".$sStyleAutoRemote."|||".$sStyleShowBorder."|||".$sStyleMemo."|||".$sAutoDetectLanguage."|||".$sDefaultLanguage."|||".$sSLTFlag."|||".$sSLTMinSize."|||".$sSLTOkSize."|||".$sSYFlag."|||".$sSYText."|||".$sSYFontColor."|||".$sSYFontSize."|||".$sSYFontName."|||".$sSYPicPath."|||".$sSLTSYObject."|||".$sSLTSYExt."|||".$sSYMinSize."|||".$sSYShadowColor."|||".$sSYShadowOffset;
	}
	else
	{
		goerror( "无效的样式ID号,请通过页面上的链接进行操作!" );
	}
	writeconfig( );
	if ( strtolower( $s_OldStyleName ) != strtolower( $GLOBALS['sStyleName'] ) )
	{
		deletefile( $s_OldStyleName );
	}
	writestyle( $GLOBALS['sStyleID'] );
	showmessage( "<b><span class=red>样式修改成功!</span></b><li><a href='?action=stylepreview&id=".$sStyleID."' target='_blank'>预览此样式</a><li><a href='?action=toolbar&id=".$sStyleID."'>设置此样式下的工具栏</a>" );
}

function dostyledel( )
{
	$GLOBALS['aStyle'][$sStyleID] = "";
	writeconfig( );
	deletefile( $GLOBALS['sStyleName'] );
	gourl( "?" );
}

function showstylepreview( )
{
	echo "<html><head><title>样式预览</title><meta http-equiv='Content-Type' content='text/html; charset=gb2312'></head><body><input type=hidden name=content1  value=''><iframe ID='eWebEditor1' src='../ewebeditor.htm?id=content1&style=".$sStyleName."' frameborder=0 scrolling=no width='".$sStyleWidth."' HEIGHT='".$sStyleHeight."'></iframe>"."</body></html>";
}

function showstylecode( )
{
	echo "<table border=0 cellspacing=1 align=center class=list><tr><th>样式(".htmlspecialchars( $GLOBALS['sStyleName'] ).")的最佳调用代码如下(其中XXX按实际关联的表单项进行修改):</th></tr>"."<tr><td><textarea rows=5 cols=65 style='width:100%'><IFRAME ID=\"eWebEditor1\" SRC=\"ewebeditor.htm?id=XXX&style=".$sStyleName."\" FRAMEBORDER=\"0\" SCROLLING=\"no\" WIDTH=\"".$sStyleWidth."\" HEIGHT=\"".$sStyleHeight."\"></IFRAME></textarea></td></tr>"."</table>";
}

function showtoolbarlist( )
{
	showmessage( "<b class=blue>样式(".htmlspecialchars( $GLOBALS['sStyleName'] ).")下的工具栏管理:</b>" );
	$nMaxOrder = 0;
	$i = 1;
	for ( ;	$i <= count( $GLOBALS['aToolbar'] );	++$i	)
	{
		$aCurrToolbar = explode( "|||", $GLOBALS['aToolbar'][$i] );
		if ( !( $aCurrToolbar[0] == $sStyleID ) && !( $nMaxOrder < ( integer )$aCurrToolbar[3] ) )
		{
			$nMaxOrder = ( integer )$aCurrToolbar[3];
		}
	}
	$nMaxOrder = $nMaxOrder + 1;
	$s_AddForm = "<hr width='80%' align=center size=1><table border=0 cellpadding=4 cellspacing=0 align=center><form action='?id=".$sStyleID."&action=toolbaradd' name='addform' method=post>"."<tr><td>工具栏名:<input type=text name=d_name size=20 class=input value='工具栏".$nMaxOrder."'> 排序号:<input type=text name=d_order size=5 value='".$nMaxOrder."' class=input> <input type=submit name=b1 value='新增工具栏'></td></tr>"."</form></table><hr width='80%' align=center size=1>";
	$s_ModiForm = "<form action='?id=".$sStyleID."&action=toolbarmodi' name=modiform method=post>"."<table border=0 cellpadding=0 cellspacing=1 align=center class=form>"."<tr align=center><th>ID</th><th>工具栏名</th><th>排序号</th><th>操作</th></tr>";
	$i = 1;
	for ( ;	$i <= count( $GLOBALS['aToolbar'] );	++$i	)
	{
		$aCurrToolbar = explode( "|||", $GLOBALS['aToolbar'][$i] );
		if ( $aCurrToolbar[0] == $sStyleID )
		{
			$s_Manage = "<a href='?id=".$sStyleID."&action=buttonset&toolbarid=".$i."'>按钮设置</a>";
			$s_Manage = $s_Manage."|<a href='?id=".$sStyleID."&action=toolbardel&delid=".$i."'>删除</a>";
			$s_ModiForm = $s_ModiForm."<tr align=center>"."<td>".$i."</td>"."<td><input type=text name='d_name".$i."' value=\"".htmlspecialchars( $aCurrToolbar[2] )."\" size=30 class=input></td>"."<td><input type=text name='d_order".$i."' value='".$aCurrToolbar[3]."' size=5 class=input></td>"."<td>".$s_Manage."</td>"."</tr>";
		}
	}
	$s_SubmitButton = "<tr><td colspan=4 align=center><input type=submit name=b1 value='  修改  '></td></tr>";
	$s_ModiForm = $s_ModiForm.$s_SubmitButton."</table></form>";
	echo $s_AddForm.$s_ModiForm;
}

function dotoolbaradd( )
{
	$s_Name = totrim( "d_name" );
	$s_Order = totrim( "d_order" );
	if ( $s_Name == "" )
	{
		goerror( "工具栏名不能为空!" );
	}
	if ( !is_numeric( $s_Order ) )
	{
		goerror( "无效的工具栏排序号,排序号必须为数字!" );
	}
	$nToolbarNum = count( $GLOBALS['aToolbar'] ) + 1;
	$GLOBALS['aToolbar'][$nToolbarNum] = $sStyleID."||||||".$s_Name."|||".$s_Order;
	writeconfig( );
	writestyle( $GLOBALS['sStyleID'] );
	echo "<script language=javascript>alert(\"工具栏(".htmlspecialchars( $s_Name ).")增加操作成功!\");</script>";
	gourl( "?action=toolbar&id=".$sStyleID );
}

function dotoolbarmodi( )
{
	$i = 1;
	for ( ;	$i <= count( $GLOBALS['aToolbar'] );	++$i	)
	{
		$aCurrToolbar = explode( "|||", $GLOBALS['aToolbar'][$i] );
		if ( $aCurrToolbar[0] == $sStyleID )
		{
			$s_Name = totrim( "d_name".$i );
			$s_Order = totrim( "d_order".$i );
			if ( $s_Name == "" || is_numeric( $s_Order ) == false )
			{
				$aCurrToolbar[0] = "";
				$s_Name = "";
			}
			$GLOBALS['aToolbar'][$i] = $aCurrToolbar[0]."|||".$aCurrToolbar[1]."|||".$s_Name."|||".$s_Order;
		}
	}
	writeconfig( );
	writestyle( $GLOBALS['sStyleID'] );
	echo "<script language=javascript>alert('工具栏修改操作成功!');</script>";
	gourl( "?action=toolbar&id=".$sStyleID );
}

function dotoolbardel( )
{
	$s_DelID = totrim( "delid" );
	if ( is_numeric( $s_DelID ) )
	{
		$GLOBALS['aToolbar'][$s_DelID] = "";
		writeconfig( );
		writestyle( $GLOBALS['sStyleID'] );
		echo "<script language=javascript>alert('工具栏(ID:".$s_DelID.")删除操作成功!');</script>";
		gourl( "?action=toolbar&id=".$sStyleID );
	}
}

function inittoolbar( )
{
	$b = false;
	$GLOBALS['sToolBarID'] = totrim( "toolbarid" );
	if ( is_numeric( $GLOBALS['sToolBarID'] ) && ( integer )$sToolBarID <= count( $GLOBALS['aToolbar'] ) && 0 < ( integer )$sToolBarID )
	{
		$aCurrToolbar = explode( "|||", $GLOBALS['aToolbar'][$sToolBarID] );
		list( , $GLOBALS['sToolBarButton'], , $GLOBALS['sToolBarButton'], $GLOBALS['sToolBarButton'] ) = sToolBarButto;
		$b = true;
	}
	if ( $b == false )
	{
		goerror( "无效的工具栏ID号,请通过页面上的链接进行操作!" );
	}
}

function showbuttonlist( )
{
	showmessage( "<b class=blue>当前样式:<span class=red>".htmlspecialchars( $GLOBALS['sStyleName'] )."</span>&nbsp;&nbsp;当前工具栏:<span class=red>".htmlspecialchars( $GLOBALS['sToolBarName'] )."</span></b>" );
	$s_Option1 = "";
	$i = 1;
	for ( ;	$i <= count( $GLOBALS['aButton'] );	++$i	)
	{
		if ( $aButton[$i][8] == 1 )
		{
			$s_Option1 = $s_Option1."<option value='".$aButton[$i][1]."'>".$aButton[$i][2]."</option>";
		}
	}
	$aSelButton = explode( "|", $GLOBALS['sToolBarButton'] );
	$s_Option2 = "";
	$i = 0;
	for ( ;	$i < count( $aSelButton );	++$i	)
	{
		$s_Temp = code2title( $aSelButton[$i] );
		if ( $s_Temp != "" )
		{
			$s_Option2 = $s_Option2."<option value='".$aSelButton[$i]."'>".$s_Temp."</option>";
		}
	}
	echo "\r\n";
	echo "<s";
	echo "cript language=javascript>\r\nfunction Add() {\r\n\tvar sel1=document.myform.d_b1;\r\n\tvar sel2=document.myform.d_b2;\r\n\tif (sel1.selectedIndex<0) {\r\n\t\talert(\"请选择一个待选按钮!\");\r\n\t\treturn;\r\n\t}\r\n\tsel2.options[sel2.length]=new Option(sel1.options[sel1.selectedIndex].innerHTML,sel1.options[sel1.selectedIndex].value);\r\n}\r\n\r\nfunction Del() {\r\n\tvar sel=document.myform.d_b2;\r\n\tvar nIndex = sel.selectedIndex;";
	echo "\r\n\tvar nLen = sel.length;\r\n\tif (nLen<1) return;\r\n\tif (nIndex<0) {\r\n\t\talert(\"请选择一个已选按钮!\");\r\n\t\treturn;\r\n\t}\r\n\tfor (var i=nIndex;i<nLen-1;i++) {\r\n\t\tsel.options[i].value=sel.options[i+1].value;\r\n\t\tsel.options[i].innerHTML=sel.options[i+1].innerHTML;\r\n\t}\r\n\tsel.length=nLen-1;\r\n}\r\n\r\nfunction Up() {\r\n\tvar sel=document.myform.d_b2;\r\n\tvar nIndex = sel.selectedIndex;\r\n\tvar nLen = sel.length;\r\n\tif ((nLe";
	echo "n<1)||(nIndex==0)) return;\r\n\tif (nIndex<0) {\r\n\t\talert(\"请选择一个要移动的已选按钮!\");\r\n\t\treturn;\r\n\t}\r\n\tvar sValue=sel.options[nIndex].value;\r\n\tvar sHTML=sel.options[nIndex].innerHTML;\r\n\tsel.options[nIndex].value=sel.options[nIndex-1].value;\r\n\tsel.options[nIndex].innerHTML=sel.options[nIndex-1].innerHTML;\r\n\tsel.options[nIndex-1].value=sValue;\r\n\tsel.options[nIndex-1].innerHTML=sHTML;\r\n\tsel.selectedIn";
	echo "dex=nIndex-1;\r\n}\r\n\r\nfunction Down() {\r\n\tvar sel=document.myform.d_b2;\r\n\tvar nIndex = sel.selectedIndex;\r\n\tvar nLen = sel.length;\r\n\tif ((nLen<1)||(nIndex==nLen-1)) return;\r\n\tif (nIndex<0) {\r\n\t\talert(\"请选择一个要移动的已选按钮!\");\r\n\t\treturn;\r\n\t}\r\n\tvar sValue=sel.options[nIndex].value;\r\n\tvar sHTML=sel.options[nIndex].innerHTML;\r\n\tsel.options[nIndex].value=sel.options[nIndex+1].value;\r\n\tsel.options[nI";
	echo "ndex].innerHTML=sel.options[nIndex+1].innerHTML;\r\n\tsel.options[nIndex+1].value=sValue;\r\n\tsel.options[nIndex+1].innerHTML=sHTML;\r\n\tsel.selectedIndex=nIndex+1;\r\n}\r\n\r\nfunction checkform() {\r\n\tvar sel=document.myform.d_b2;\r\n\tvar nLen = sel.length;\r\n\tvar str=\"\";\r\n\tfor (var i=0;i<nLen;i++) {\r\n\t\tif (i>0) str+=\"|\";\r\n\t\tstr+=sel.options[i].value;\r\n\t}\r\n\tdocument.myform.d_button.value=str;\r\n\treturn true;\r\n}\r\n\r";
	echo "\n</script>\r\n\r\n";

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -