<?php
include_once(dirname(__file__)."/../foundation/fgetandpost.php");
if(get_args('title') && get_args('version') && get_args('author') &&(get_args('jspath') || get_args('callfunction') || get_args('inurl')))
{
	$dom=new DOMDocument();
	$dom->encoding="UTF-8";
	$dom->version="1.0";
	$plugin=$dom->createElement("plugin");
	$title=$dom->createElement("title",get_args('title'));
	$plugin->appendChild($title);
	$version=$dom->createElement("version",get_args('version'));
	$plugin->appendChild($version);
	$author=$dom->createElement("author",get_args('author'));
	$plugin->appendChild($author);
	$image=$dom->createElement("image",get_args('image'));
	$plugin->appendChild($image);
	$description=$dom->createElement("description",get_args('description'));
	$plugin->appendChild($description);
	$website=$dom->createElement("website",get_args('website'));
	$plugin->appendChild($website);
	$csspath=$dom->createElement("csspath",get_args('csspath'));
	$plugin->appendChild($csspath);
	$jspath=$dom->createElement("jspath",get_args('jspath'));
	$plugin->appendChild($jspath);
	$callfunction=$dom->createElement("callfunction",get_args('callfunction'));
	$plugin->appendChild($callfunction);
	$inurl=$dom->createElement("inurl",get_args('inurl'));
	$plugin->appendChild($inurl);
	$show=$dom->createElement("show",get_args('show'));
	$plugin->appendChild($show);
	$sqlpath=$dom->createElement("sqlpath",get_args('sqlpath'));
	$plugin->appendChild($sqlpath);
	$dom->appendChild($plugin);
	$dom->formatOutput=true;
//	$dom->save("plugin.xml");
	header("Content-type:application/xml"); 
	header("Content-Disposition:attachment;filename=plugin.xml"); 
	echo $dom->saveXML(); 
	exit();
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<style>
.reg{color:#FF0000}
.blue{color:#0000FF}
</style>
<title>无标题文档</title>
</head>

<body>
<h1 style="text-align:center">插件信息生成器</h1>
<div >
<form action="" method="post">
<table width="56%" border="0">
  <tr>
    <td width="23%">插件名称：</td>
    <td width="77%"><input type="text" name="title" id="title" />
      <span class="reg">      *</span></td>
  </tr>
  <tr>
    <td>版本号：</td>
    <td><input type="text" name="version" id="version" />
      <span class="reg">*</span></td>
  </tr>
  <tr>
    <td>作者：</td>
    <td><input type="text" name="author" id="author" />
      <span class="reg">*</span></td>
  </tr>
  <tr>
    <td>缩略图：</td>
    <td><input type="text" name="image" id="image" /></td>
  </tr>
  <tr>
    <td>插件描述：</td>
    <td><textarea name="description" id="description" cols="45" rows="5"></textarea></td>
  </tr>
  <tr>
    <td>开发者主页：</td>
    <td><input name="website" type="text" id="website" size="80" /></td>
  </tr>
  <tr>
    <td>CSS文件：</td>
    <td><input name="csspath" type="text" id="csspath" size="80" /></td>
  </tr>
  <tr>
    <td>JavaScript路径：</td>
    <td><input name="jspath" type="text" id="jspath" size="80" />
      <span class="blue">*</span></td>
  </tr>
  <tr>
    <td>直接调用JS函数：</td>
    <td><input name="callfunction" type="text" id="callfunction" size="80" />
      <span class="blue">*</span></td>
  </tr>
  <tr>
    <td>入口文件：</td>
    <td><input name="inurl" type="text" id="inurl" size="80" />
      <span class="blue">*</span></td>
  </tr>
  <tr>
    <td>插件类型：</td>
    <td><p>
      <label>
        <input name="show" type="radio" id="show_0" value="0" checked="checked" />
        Widget插件      </label>
      <label>
        <input type="radio" name="show" value="1" id="show_1" />
        APP应用</label>
        <label>
        <input type="radio" name="show" value="2" id="show_1" />
        Widget+APP</label>
    </p></td>
  </tr>
  <tr>
    <td>数据库安装SQL文件：</td>
    <td><input name="sqlpath" type="text" id="sqlpath" size="80" /></td>
  </tr>
  <tr>
    <td colspan="2"><input type="submit" name="生成" id="生成" value="提交" /></td>
    </tr>
</table>
</form>
</div>
</body>
</html>
