Location: PHPKode > projects > Phpwebfiles > phpwebfiles/design/default.php
<?php
/*

    Author: Attila Agas <hide@address.com>
    Copyright (C) 2007

    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License version 2,
    as published by the Free Software Foundation.

    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, write to the Free Software
    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
*/

$myicons='myicons';

class BaseDesign
{
	var $title;
	var $css;
	var $logo;
	var $mainclass;
	var $fillclass;

	function BaseDesign()
	{
		$this->title="phpwebfiles";
		$this->css="design/default.css";
		$this->logo="design/default/logo.gif";
		$this->mainclass="main";
		$this->fillclass="fill";
	}

	function window($caption,$data)
	{
		$tmp=<<<END
<table border="0" cellpadding="5" cellspacing="0">
<tr><td class="windowcap" align="center">$caption<hr /></td></tr>
<tr><td class="windowbody" align="center">$data</td></tr>
</table>
END;
		return $tmp;
	}

/*
info
*/
	function info($data,$cap='info')
	{
		global $dirid;
		global $webpath;
		global $lang;
		global $des;
		global $stringtable;
		$tmp=<<<END
<table border="0" width="320" cellpadding="5" cellspacing="0">
<tr><td align="center">$data<br /></td></tr>
<tr><td align="center">
<form action="index.php" method="GET" >
<input type="hidden" name="lang" value="$lang" />
<input type="hidden" name="des" value="$des" />
<input type="hidden" name="dirid" value="$dirid" />
<input type="hidden" name="path" value="$webpath" />
<input type="submit" value="$stringtable[ok]" />
</form>
</td></tr>
</table>
END;
		return $this->window($stringtable[$cap],$tmp);
	}

/*
error
*/
	function error($data,$cap='error')
	{
		return $this->info("<h2>$data</h2>",$cap);
	}


/*
question
*/
	function question($data,$yes,$no=array('nothing' => 'nothing'),$cap='question')
	{
		global $dirid;
		global $webpath;
		global $lang;
		global $des;
		global $stringtable;
		$tmp=<<<END
<table border="0" width="320" cellpadding="0" cellspacing="4">
<tr><td colspan="2" align="center">$data</td></tr>
<tr>
<td align="left">
<form action="index.php" method="post" />
END;
		foreach($no as $key => $value)
		{
			$tmp.="<input type='hidden' name='$key' value='$value' />";
		}
		$tmp.=<<<END
<input type="hidden" name="dirid" value="$dirid" />
<input type="hidden" name="path" value="$webpath" />
<input type="hidden" name="lang" value="$lang" />
<input type="hidden" name="des" value="$des" />
<input type="submit" value="$stringtable[no]" />
</form>
</td>
<td align="right">
<form action="index.php" method="post" />
END;
		foreach($yes as $key => $value)
		{
			$tmp.="<input type='hidden' name='$key' value='$value' />";
		}
		$tmp.=<<<END
<input type="hidden" name="dirid" value="$dirid" />
<input type="hidden" name="path" value="$webpath" />
<input type="hidden" name="lang" value="$lang" />
<input type="hidden" name="des" value="$des" />
<input type="submit" value="$stringtable[yes]" />
</form>
</td>
</tr>
</table>
END;
		return $this->window($stringtable[$cap],$tmp);
	}


/*
bubble
*/
	function bubble($caption,$data)
	{
		$tmp=<<<END
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td class="frame_left_top"></td>
<td class="frame_top" align="center" valign="middle">$caption</td>
<td class="frame_right_top"></td>
</tr>

<tr>
<td class="frame_left_middle"></td>
<td class="frame_middle" align="center" valign="middle">$data</td>
<td class="frame_right_middle"></td>
</tr>

<tr>
<td class="frame_left_bottom"></td>
<td class="frame_bottom"></td>
<td class="frame_right_bottom"></td>
</tr>
</table>
END;
		return $tmp;
	}


/*
menu
*/		
	function menu($links)
	{
		global $stringtable;
		$tmp="<table border='0' width='100%' cellpadding='4' cellspacing='4' >";
		$col=0;
		foreach($links as $key => $value)
		{
			if (($key!=='upload') && ($key!=='langselect') && ($key!=='designselect'))
			{
				if ($col==0) $tmp.="<tr>";
				$tmp.="<td align='center' class='menuframe'>$value</td>";
				$col++;
				if ($col==3)
				{
					$tmp.="</tr>";
					$col=0;
				}
			}
		}
		while(($col>0) && ($col<3))
		{
			$tmp.="<td></td>";
			$col++;
			if ($col==3) $tmp.="</tr>";
		}
		if (strlen($links['upload'])>0) $tmp.="<tr><td align='center' colspan='3'>$links[upload]</td></tr>";
		$tmp.="<tr><td align='left'>$links[langselect]</td><td></td><td align='right'>$links[designselect]</td></tr>";

		$tmp.="</table>";
		return $this->bubble("",$this->window($stringtable['menu'],$tmp));
	}
}



?>
Return current item: Phpwebfiles