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

📄 style.php

📁 极限网络智能办公系统 - Office Automation 2008 官方100% 源码
💻 PHP
📖 第 1 页 / 共 4 页
字号:
	$s_SubmitButton = "<input type=submit name=b value=' 保存设置 '>";
	echo "<table border=0 cellpadding=5 cellspacing=0 align=center><form action='?action=buttonsave&id=".$sStyleID."&toolbarid=".$sToolBarID."' method=post name=myform onsubmit='return checkform()'>"."<tr align=center><td>可选按钮</td><td></td><td>已选按钮</td><td></td></tr>"."<tr align=center>"."<td><select name='d_b1' size=20 style='width:250px' ondblclick='Add()'>".$s_Option1."</select></td>"."<td><input type=button name=b1 value=' → ' onclick='Add()'><br><br><input type=button name=b1 value=' ← ' onclick='Del()'></td>"."<td><select name='d_b2' size=20 style='width:250px' ondblclick='Del()'>".$s_Option2."</select></td>"."<td><input type=button name=b3 value='↑' onclick='Up()'><br><br><br><input type=button name=b4 value='↓' onclick='Down()'></td>"."</tr>"."<input type=hidden name='d_button' value=''>"."<tr><td colspan=4 align=right>".$s_SubmitButton."</td></tr>"."</form></table>";
	echo "<table border=0 cellspacing=1 align=center class=list><tr><th colspan=4>以下是按钮图片对照表(部分下拉框或特殊按钮可能没图):</th></tr>";
	$n = 0;
	$m = 0;
	$i = 1;
	for ( ;	$i <= count( $GLOBALS['aButton'] );	++$i	)
	{
		if ( $aButton[$i][8] == 1 )
		{
			$m = $m + 1;
			$n = $m % 4;
			if ( $n == 1 )
			{
				echo "<tr>";
			}
			echo "<td>";
			if ( $aButton[$i][3] != "" )
			{
				echo "<img border=0 align=absmiddle src='../buttonimage/".$sStyleDir."/".$aButton[$i][3]."'>";
			}
			echo $aButton[$i][2];
			echo "</td>";
			if ( $n == 0 )
			{
				echo "</tr>";
			}
		}
	}
	if ( 0 < $n )
	{
		$i = 1;
		for ( ;	$i <= 4 - $n;	++$i	)
		{
			echo "<td>&nbsp;</td>";
		}
		echo "</tr>";
	}
	echo "</table>";
}

function code2title( $s_Code )
{
	$i = 1;
	for ( ;	$i <= count( $GLOBALS['aButton'] );	++$i	)
	{
		if ( strtoupper( $GLOBALS['aButton'][$i][1] ) == strtoupper( $s_Code ) )
		{
			return $aButton[$i][2];
		}
	}
	return "";
}

function dobuttonsave( )
{
	$s_Button = totrim( "d_button" );
	$nToolBarID = ( integer )$sToolBarID;
	$aCurrToolbar = explode( "|||", $GLOBALS['aToolbar'][$nToolBarID] );
	$GLOBALS['aToolbar'][$nToolBarID] = $aCurrToolbar[0]."|||".$s_Button."|||".$aCurrToolbar[2]."|||".$aCurrToolbar[3];
	writeconfig( );
	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><li><a href='?action=buttonset&id=".$sStyleID."&toolbarid=".$sToolBarID."'>重新设置此工具栏下的按钮</a>" );
}

function initselect( $s_FieldName, $a_Name, $a_Value, $v_InitValue, $s_Sql, $s_AllName )
{
	$s_Result = "<select name='".$s_FieldName."' size=1>";
	if ( $s_AllName != "" )
	{
		$s_Result = $s_Result."<option value=''>".$s_AllName."</option>";
	}
	if ( $s_Sql == "" )
	{
		$i = 0;
		for ( ;	$i < count( $a_Name );	++$i	)
		{
			$s_Result = $s_Result."<option value=\"".htmlspecialchars( $a_Value[$i] )."\"";
			if ( $a_Value[$i] == $v_InitValue )
			{
				$s_Result = $s_Result." selected";
			}
			$s_Result = $s_Result.">".htmlspecialchars( $a_Name[$i] )."</option>";
		}
	}
	$s_Result = $s_Result."</select>";
	return $s_Result;
}

function writestyle( $n_StyleID )
{
	$sConfig = "";
	$aTmpStyle = explode( "|||", $GLOBALS['aStyle'][$n_StyleID] );
	$sConfig = $sConfig."config.ButtonDir = \"".$aTmpStyle[1]."\";\n";
	$sConfig = $sConfig."config.StyleUploadDir = \"".$aTmpStyle[3]."\";\n";
	$sConfig = $sConfig."config.InitMode = \"".$aTmpStyle[18]."\";\n";
	$sConfig = $sConfig."config.AutoDetectPasteFromWord = \"".$aTmpStyle[17]."\";\n";
	$sConfig = $sConfig."config.BaseUrl = \"".$aTmpStyle[19]."\";\n";
	$sConfig = $sConfig."config.BaseHref = \"".$aTmpStyle[22]."\";\n";
	$sConfig = $sConfig."config.AutoRemote = \"".$aTmpStyle[24]."\";\n";
	$sConfig = $sConfig."config.ShowBorder = \"".$aTmpStyle[25]."\";\n";
	$sConfig = $sConfig."config.StateFlag = \"".$aTmpStyle[16]."\";\n";
	$sConfig = $sConfig."config.CssDir = \"".$aTmpStyle[2]."\";\n";
	$sConfig = $sConfig."config.AutoDetectLanguage = \"".$aTmpStyle[27]."\";\n";
	$sConfig = $sConfig."config.DefaultLanguage = \"".$aTmpStyle[28]."\";\n";
	$sConfig = $sConfig."\n";
	$sConfig = $sConfig."function showToolbar(){\n";
	$sConfig = $sConfig."\n";
	$sConfig = $sConfig."\tdocument.write (\"";
	$sConfig = $sConfig."<table border=0 cellpadding=0 cellspacing=0 width='100%' class='Toolbar' id='eWebEditor_Toolbar'>";
	$s_Order = "";
	$s_ID = "";
	$n = 1;
	for ( ;	$n <= count( $GLOBALS['aToolbar'] );	++$n	)
	{
		if ( $aToolbar[$n] != "" )
		{
			$aTmpToolbar = explode( "|||", $GLOBALS['aToolbar'][$n] );
			if ( ( integer )$aTmpToolbar[0] == $n_StyleID )
			{
				if ( $s_ID != "" )
				{
					$s_ID = $s_ID."|";
					$s_Order = $s_Order."|";
				}
				$s_ID = $s_ID.$n;
				$s_Order = $s_Order.$aTmpToolbar[3];
			}
		}
	}
	if ( $s_ID != "" )
	{
		$a_ID = explode( "|", $s_ID );
		$a_Order = explode( "|", $s_Order );
		$n = 0;
		for ( ;	$n < count( $a_Order );	++$n	)
		{
			$a_Order[$n] = ( integer )$a_Order[$n];
			$a_ID[$n] = ( integer )$a_ID[$n];
		}
		$a_ID = dosort( $a_ID, $a_Order );
		$n = 0;
		for ( ;	$n < count( $a_ID );	++$n	)
		{
			$aTmpToolbar = explode( "|||", $GLOBALS['aToolbar'][$a_ID[$n]] );
			$aTmpButton = explode( "|", $aTmpToolbar[1] );
			$sConfig = $sConfig."<tr><td><div class=yToolbar>";
			$i = 0;
			for ( ;	$i < count( $aTmpButton );	++$i	)
			{
				if ( strtoupper( $aTmpButton[$i] ) == "MAXIMIZE" )
				{
					$sConfig = $sConfig."\");\n";
					$sConfig = $sConfig."\n";
					$sConfig = $sConfig."\tif (sFullScreen==\"1\"){\n";
					$sConfig = $sConfig."\t\tdocument.write (\"".code2html( "Minimize", $aTmpStyle[1] )."\");\n";
					$sConfig = $sConfig."\t}else{\n";
					$sConfig = $sConfig."\t\tdocument.write (\"".code2html( $aTmpButton[$i], $aTmpStyle[1] )."\");\n";
					$sConfig = $sConfig."\t}\n";
					$sConfig = $sConfig."\n";
					$sConfig = $sConfig."\tdocument.write (\"";
				}
				else
				{
					$sConfig = $sConfig.code2html( $aTmpButton[$i], $aTmpStyle[1] );
				}
			}
			$sConfig = $sConfig."</div></td></tr>";
		}
	}
	else
	{
		$sConfig = $sConfig."<tr><td></td></tr>";
	}
	$sConfig = $sConfig."</table>\");\n";
	$sConfig = $sConfig."\n";
	$sConfig = $sConfig."}\n";
	writefile( "../style/".strtolower( $aTmpStyle[0] ).".js", $sConfig );
}

function code2html( $s_Code, $s_ButtonDir )
{
	$s_Result = "";
	$i = 1;
	for ( ;	$i <= count( $GLOBALS['aButton'] );	++$i	)
	{
		if ( strtoupper( $GLOBALS['aButton'][$i][1] ) == strtoupper( $s_Code ) )
		{
			switch ( $aButton[$i][5] )
			{
			case 0 :
				$s_Result = "<DIV CLASS=".$aButton[$i][7]." TITLE='\"+lang[\"".$aButton[$i][1]."\"]+\"' onclick=\\\"".$aButton[$i][6]."\\\"><IMG CLASS=Ico SRC='buttonimage/".$s_ButtonDir."/".$aButton[$i][3]."'></DIV>";
			case 1 :
				do
				{
					if ( $aButton[$i][4] != "" )
					{
						$s_Result = "<SELECT CLASS=".$aButton[$i][7]." onchange=\\\"".$aButton[$i][6]."\\\">".$aButton[$i][4]."</SELECT>";
						break;
					}
					else
					{
						$s_Result = "<SELECT CLASS=".$aButton[$i][7]." onchange=\\\"".$aButton[$i][6]."\\\">\"+lang[\"".$aButton[$i][1]."\"]+\"</SELECT>";
						break;
					}
				case 2 :
					$s_Result = "<DIV CLASS=".$aButton[$i][7].">".$aButton[$i][4]."</DIV>";
				} while ( 0 );
			default :
				return $s_Result;
			}
		}
	}
	return $s_Result;
}

function deletefile( $s_StyleName )
{
	@unlink( "../style/".@strtolower( $s_StyleName ).".js" );
}

function isvalidcolor( $str )
{
	$s_Match = "/[A-Fa-f0-9]{6}/i";
	return preg_match( $s_Match, $str );
}

require( "private.php" );
$sPosition = $sPosition."样式管理";
if ( $sAction == "STYLEPREVIEW" )
{
	initstyle( );
	showstylepreview( );
	exit( );
}
ewebeditor_header( );
showposition( );
ewebeditor_content( );
ewebeditor_footer( );
?>

⌨️ 快捷键说明

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