* rewrite the doc module.

This commit is contained in:
wangchunsheng
2011-02-25 14:48:49 +00:00
parent 3e843e3a70
commit cecf3d30e1
9 changed files with 210 additions and 238 deletions
+1
View File
@@ -0,0 +1 @@
body{background:white; margin-top:20px; padding-bottom:0}
+1
View File
@@ -0,0 +1 @@
body{background:white; margin-top:20px; padding-bottom:0}
+29
View File
@@ -0,0 +1,29 @@
/* Load the products of the roject. */
function loadProducts(project)
{
link = createLink('project', 'ajaxGetProducts', 'projectID=' + project);
$('#productBox').load(link);
}
/* Set doc type. */
function setType(type)
{
if(type == 'url')
{
$('#urlBox').show();
$('#fileBox').hide();
$('#contentBox').hide();
}
else if(type == 'text')
{
$('#urlBox').hide();
$('#fileBox').hide();
$('#contentBox').show();
}
else
{
$('#urlBox').hide();
$('#fileBox').show();
$('#contentBox').hide();
}
}
+1
View File
@@ -0,0 +1 @@
+55 -83
View File
@@ -12,87 +12,59 @@
?>
<?php include '../../common/view/header.html.php';?>
<?php include '../../common/view/kindeditor.html.php';?>
<script language='Javascript'>
function loadProducts(project)
{
link = createLink('project', 'ajaxGetProducts', 'projectID=' + project);
$('#productBox').load(link);
}
/* Set doc type. */
function setType(type)
{
if(type == 'url'){
$('#urlBox').show();
$('#fileBox').hide();
$('#contentBox').hide();
}
else if(type == 'text'){
$('#urlBox').hide();
$('#fileBox').hide();
$('#contentBox').show();
}
else{
$('#urlBox').hide();
$('#fileBox').show();
$('#contentBox').hide();
}
}
</script>
<div class='yui-d0'>
<form method='post' enctype='multipart/form-data' target='hiddenwin'>
<table class='table-1'>
<caption><?php echo $lang->doc->create;?></caption>
<?php if($libID == 'product'):?>
<tr>
<th class='rowhead'><?php echo $lang->doc->product;?></th>
<td><?php echo html::select('product', $products, $productID, "class='select-3'");?></td>
</tr>
<?php elseif($libID == 'project'):?>
<tr>
<th class='rowhead'><?php echo $lang->doc->project;?></th>
<td><?php echo html::select('project', $projects, $projectID, "class='select-3' onchange=loadProducts(this.value);");?></td>
</tr>
<tr>
<th class='rowhead'><?php echo $lang->doc->product;?></th>
<td><span id='productBox'><?php echo html::select('product', $products, '', "class='select-3'");?></span></td>
</tr>
<?php endif;?>
<tr>
<th class='rowhead'><?php echo $lang->doc->module;?></th>
<td><?php echo html::select('module', $moduleOptionMenu, $moduleID, "class='select-3'");?></td>
</tr>
<tr>
<th class='rowhead'><?php echo $lang->doc->type;?></th>
<td><?php echo html::radio('type', $lang->doc->types, 'file', "onclick=setType(this.value)");?></td>
</tr>
<tr>
<th class='rowhead'><?php echo $lang->doc->title;?></th>
<td><?php echo html::input('title', '', "class='text-1'");?></td>
</tr>
<tr id='urlBox' class='hidden'>
<th class='rowhead'><?php echo $lang->doc->url;?></th>
<td><?php echo html::input('url', '', "class='text-1'");?></td>
</tr>
<tr id='contentBox' class='hidden'>
<th class='rowhead'><?php echo $lang->doc->content;?></th>
<td><?php echo html::textarea('content', '', "class='area-1' style='width:90%; height:200px'");?></td>
</tr>
<tr>
<th class='rowhead'><?php echo $lang->doc->keywords;?></th>
<td><?php echo html::input('keywords', '', "class='text-1'");?></td>
</tr>
<tr>
<th class='rowhead'><?php echo $lang->doc->digest;?></th>
<td><?php echo html::textarea('digest', '', "class='text-1' rows=3");?></td>
</tr>
<tr id='fileBox'>
<th class='rowhead'><?php echo $lang->doc->files;?></th>
<td><?php echo $this->fetch('file', 'buildform', 'fileCount=2');?></td>
</tr>
<tr>
<td colspan='2' class='a-center'><?php echo html::submitButton() . html::resetButton() . html::hidden('lib', $libID);?></td>
</tr>
</table>
</form>
</div>
<form method='post' enctype='multipart/form-data' target='hiddenwin'>
<table class='table-1'>
<caption><?php echo $lang->doc->create;?></caption>
<?php if($libID == 'product'):?>
<tr>
<th class='rowhead'><?php echo $lang->doc->product;?></th>
<td><?php echo html::select('product', $products, $productID, "class='select-3'");?></td>
</tr>
<?php elseif($libID == 'project'):?>
<tr>
<th class='rowhead'><?php echo $lang->doc->project;?></th>
<td><?php echo html::select('project', $projects, $projectID, "class='select-3' onchange=loadProducts(this.value);");?></td>
</tr>
<tr>
<th class='rowhead'><?php echo $lang->doc->product;?></th>
<td><span id='productBox'><?php echo html::select('product', $products, '', "class='select-3'");?></span></td>
</tr>
<?php endif;?>
<tr>
<th class='rowhead'><?php echo $lang->doc->module;?></th>
<td><?php echo html::select('module', $moduleOptionMenu, $moduleID, "class='select-3'");?></td>
</tr>
<tr>
<th class='rowhead'><?php echo $lang->doc->type;?></th>
<td><?php echo html::radio('type', $lang->doc->types, 'file', "onclick=setType(this.value)");?></td>
</tr>
<tr>
<th class='rowhead'><?php echo $lang->doc->title;?></th>
<td><?php echo html::input('title', '', "class='text-1'");?></td>
</tr>
<tr id='urlBox' class='hidden'>
<th class='rowhead'><?php echo $lang->doc->url;?></th>
<td><?php echo html::input('url', '', "class='text-1'");?></td>
</tr>
<tr id='contentBox' class='hidden'>
<th class='rowhead'><?php echo $lang->doc->content;?></th>
<td><?php echo html::textarea('content', '', "class='area-1' style='width:90%; height:200px'");?></td>
</tr>
<tr>
<th class='rowhead'><?php echo $lang->doc->keywords;?></th>
<td><?php echo html::input('keywords', '', "class='text-1'");?></td>
</tr>
<tr>
<th class='rowhead'><?php echo $lang->doc->digest;?></th>
<td><?php echo html::textarea('digest', '', "class='text-1' rows=3");?></td>
</tr>
<tr id='fileBox'>
<th class='rowhead'><?php echo $lang->doc->files;?></th>
<td><?php echo $this->fetch('file', 'buildform', 'fileCount=2');?></td>
</tr>
<tr>
<td colspan='2' class='a-center'><?php echo html::submitButton() . html::resetButton() . html::hidden('lib', $libID);?></td>
</tr>
</table>
</form>
<?php include './footer.html.php';?>
+13 -19
View File
@@ -11,22 +11,16 @@
*/
?>
<?php include '../../common/view/header.lite.html.php';?>
<style>body{background:white; margin-top:20px; padding-bottom:0}</style>
<div id='yui-d0'>
<form method='post'>
<table class='table-1'>
<caption><?php echo $lang->doc->createLib;?></caption>
<tr>
<th class='rowhead'><?php echo $lang->doc->libName;?></th>
<td><?php echo html::input('name', '', "class='text-1'");?></td>
</tr>
<tr>
<td colspan='2' class='a-center'>
<?php echo html::submitButton();?>
</td>
</tr>
</table>
</form>
</div>
</body>
</html>
<form method='post'>
<table class='table-1'>
<caption><?php echo $lang->doc->createLib;?></caption>
<tr>
<th class='rowhead'><?php echo $lang->doc->libName;?></th>
<td><?php echo html::input('name', '', "class='text-1'");?></td>
</tr>
<tr>
<td colspan='2' class='a-center'><?php echo html::submitButton();?></td>
</tr>
</table>
</form>
<?php include '../../common/view/footer.lite.html.php';?>
+43 -60
View File
@@ -13,69 +13,52 @@
<?php include '../../common/view/header.html.php';?>
<?php include '../../common/view/kindeditor.html.php';?>
<script language='javascript'>
/* Set type. */
var type = '<?php echo $doc->type;?>';
$(document).ready(function()
{
if(type == 'url'){
$('#urlBox').show();
$('#contentBox').hide();
$('#fileBox').hide();
}
else if(type == 'text'){
$('#urlBox').hide();
$('#contentBox').show();
$('#fileBox').hide();
}
else{
$('#urlBox').hide();
$('#contentBox').hide();
$('#fileBox').show();
}
setType(type);
});
</script>
<div class='yui-d0'>
<form method='post' enctype='multipart/form-data' target='hiddenwin'>
<table class='table-1'>
<caption><?php echo $lang->doc->edit;?></caption>
<tr>
<th class='rowhead'><?php echo $lang->doc->module;?></th>
<td><?php echo html::select('module', $moduleOptionMenu, $doc->module, "class='select-3'");?></td>
</tr>
<tr>
<th class='rowhead'><?php echo $lang->doc->type;?></th>
<td><?php echo $lang->doc->types[$doc->type];?></td>
</tr>
<th class='rowhead'><?php echo $lang->doc->title;?></th>
<td><?php echo html::input('title', $doc->title, "class='text-1'");?></td>
</tr>
<tr>
<th class='rowhead'><?php echo $lang->doc->keywords;?></th>
<td><?php echo html::input('keywords', $doc->keywords, "class='text-1'");?></td>
</tr>
<tr id='urlBox' class='hidden'>
<th class='rowhead'><?php echo $lang->doc->url;?></th>
<td><?php echo html::input('url', urldecode($doc->url), "class='text-1'");?></td>
</tr>
<tr id='contentBox' class='hidden'>
<th class='rowhead'><?php echo $lang->doc->content;?></th>
<td><?php echo html::textarea('content', htmlspecialchars($doc->content), "class='text-1' rows='8' style='width:90%; height:200px'");?></td>
</tr>
<tr>
<th class='rowhead'><?php echo $lang->doc->digest;?></th>
<td><?php echo html::textarea('digest', $doc->digest, "class='text-1' rows=3");?></td>
</tr>
<tr id='fileBox' class='hidden'>
<th class='rowhead'><?php echo $lang->doc->files;?></th>
<td><?php echo $this->fetch('file', 'buildform', 'fileCount=2');?></td>
</tr>
<tr>
<td colspan='2' class='a-center'>
<?php echo html::submitButton() . html::resetButton() . html::hidden('lib', $libID);?>
<?php echo html::hidden('product', $doc->product) . html::hidden('project', $doc->project);?>
</td>
</tr>
</table>
</form>
</div>
<form method='post' enctype='multipart/form-data' target='hiddenwin'>
<table class='table-1'>
<caption><?php echo $lang->doc->edit;?></caption>
<tr>
<th class='rowhead'><?php echo $lang->doc->module;?></th>
<td><?php echo html::select('module', $moduleOptionMenu, $doc->module, "class='select-3'");?></td>
</tr>
<tr>
<th class='rowhead'><?php echo $lang->doc->type;?></th>
<td><?php echo $lang->doc->types[$doc->type];?></td>
</tr>
<th class='rowhead'><?php echo $lang->doc->title;?></th>
<td><?php echo html::input('title', $doc->title, "class='text-1'");?></td>
</tr>
<tr>
<th class='rowhead'><?php echo $lang->doc->keywords;?></th>
<td><?php echo html::input('keywords', $doc->keywords, "class='text-1'");?></td>
</tr>
<tr id='urlBox' class='hidden'>
<th class='rowhead'><?php echo $lang->doc->url;?></th>
<td><?php echo html::input('url', urldecode($doc->url), "class='text-1'");?></td>
</tr>
<tr id='contentBox' class='hidden'>
<th class='rowhead'><?php echo $lang->doc->content;?></th>
<td><?php echo html::textarea('content', htmlspecialchars($doc->content), "class='text-1' rows='8' style='width:90%; height:200px'");?></td>
</tr>
<tr>
<th class='rowhead'><?php echo $lang->doc->digest;?></th>
<td><?php echo html::textarea('digest', $doc->digest, "class='text-1' rows=3");?></td>
</tr>
<tr id='fileBox' class='hidden'>
<th class='rowhead'><?php echo $lang->doc->files;?></th>
<td><?php echo $this->fetch('file', 'buildform', 'fileCount=2');?></td>
</tr>
<tr>
<td colspan='2' class='a-center'>
<?php echo html::submitButton() . html::resetButton() . html::hidden('lib', $libID);?>
<?php echo html::hidden('product', $doc->product) . html::hidden('project', $doc->project);?>
</td>
</tr>
</table>
</form>
<?php include './footer.html.php';?>
+14 -19
View File
@@ -11,22 +11,17 @@
*/
?>
<?php include '../../common/view/header.lite.html.php';?>
<style>body{background:white; margin-top:20px; padding-bottom:0}</style>
<div id='yui-d0'>
<?php if($libID == 'product' or $libID == 'project'):?>
<h3><?php echo $lang->doc->errorEditSystemDoc;?></h3>
<?php else:?>
<form method='post'>
<table class='table-1'>
<caption><?php echo $lang->doc->editLib;?></caption>
<tr>
<th class='rowhead'><?php echo $lang->doc->libName;?></th>
<td><?php echo html::input('name', $libName, "class='text-1'");?></td>
</tr>
<tr><td colspan='2' class='a-center'><?php echo html::submitButton();?></td></tr>
</table>
</form>
<?php endif;?>
</div>
</body>
</html>
<?php if($libID == 'product' or $libID == 'project'):?>
<h3><?php echo $lang->doc->errorEditSystemDoc;?></h3>
<?php else:?>
<form method='post'>
<table class='table-1'>
<caption><?php echo $lang->doc->editLib;?></caption>
<tr>
<th class='rowhead'><?php echo $lang->doc->libName;?></th>
<td><?php echo html::input('name', $libName, "class='text-1'");?></td>
</tr>
<tr><td colspan='2' class='a-center'><?php echo html::submitButton();?></td></tr>
</table>
</form>
<?php endif;?>
+53 -57
View File
@@ -16,65 +16,61 @@
var type = '<?php echo $doc->type;?>';
$(document).ready(function()
{
/* Jude the type. */
if(type == 'url') $('#urlBox').show();
else if(type == 'text') $('#contentBox').show();
else $('#fileBox').show();
setType(type);
});
</script>
<div class='yui-d0'>
<table class='table-1'>
<table class='table-1'>
<caption><?php echo $doc->title . $lang->colon . $lang->doc->view;?></caption>
<tr>
<th class='rowhead'><?php echo $lang->doc->title;?></th>
<td <?php if($doc->deleted) echo "class='deleted'";?>><?php echo $doc->title;?></td>
</tr>
<tr>
<th class='rowhead'><?php echo $lang->doc->lib;?></th>
<td><?php echo $lib;?></td>
</tr>
<tr>
<th class='rowhead'><?php echo $lang->doc->module;?></th>
<td><?php echo $doc->moduleName;?></td>
</tr>
<tr>
<th class='rowhead'><?php echo $lang->doc->type;?></th>
<td><?php echo $lang->doc->types[$doc->type];?></td>
</tr>
<th class='rowhead'><?php echo $lang->doc->title;?></th>
<td><?php echo $doc->title;?></td>
</tr>
<tr>
<th class='rowhead'><?php echo $lang->doc->keywords;?></th>
<td><?php echo $doc->keywords;?></td>
</tr>
<tr id='urlBox' class='hidden'>
<th class='rowhead'><?php echo $lang->doc->url;?></th>
<td><?php echo html::a(urldecode($doc->url), '', '_blank');?></td>
</tr>
<tr id='contentBox' class='hidden'>
<th class='rowhead'><?php echo $lang->doc->content;?></th>
<td class='content'><?php echo $doc->content;?></td>
</tr>
<tr>
<th class='rowhead'><?php echo $lang->doc->digest;?></th>
<td><?php echo nl2br($doc->digest);?></td>
</tr>
<tr id='fileBox' class='hidden'>
<th class='rowhead'><?php echo $lang->files;?></th>
<td><?php echo $this->fetch('file', 'printFiles', array('files' => $doc->files, 'fieldset' => 'false'));?></td>
</tr>
</table>
<div class='a-center f-16px strong'>
<?php
$browseLink = $this->session->docList ? $this->session->docList : inlink('browse');
if(!$doc->deleted)
{
common::printLink('doc', 'edit', "docID=$doc->id", $lang->edit);
common::printLink('doc', 'delete', "docID=$doc->id", $lang->delete, 'hiddenwin');
}
echo html::a($browseLink, $lang->goback);
?>
</div>
<tr>
<th class='rowhead'><?php echo $lang->doc->title;?></th>
<td <?php if($doc->deleted) echo "class='deleted'";?>><?php echo $doc->title;?></td>
</tr>
<tr>
<th class='rowhead'><?php echo $lang->doc->lib;?></th>
<td><?php echo $lib;?></td>
</tr>
<tr>
<th class='rowhead'><?php echo $lang->doc->module;?></th>
<td><?php echo $doc->moduleName;?></td>
</tr>
<tr>
<th class='rowhead'><?php echo $lang->doc->type;?></th>
<td><?php echo $lang->doc->types[$doc->type];?></td>
</tr>
<th class='rowhead'><?php echo $lang->doc->title;?></th>
<td><?php echo $doc->title;?></td>
</tr>
<tr>
<th class='rowhead'><?php echo $lang->doc->keywords;?></th>
<td><?php echo $doc->keywords;?></td>
</tr>
<tr id='urlBox' class='hidden'>
<th class='rowhead'><?php echo $lang->doc->url;?></th>
<td><?php echo html::a(urldecode($doc->url), '', '_blank');?></td>
</tr>
<tr id='contentBox' class='hidden'>
<th class='rowhead'><?php echo $lang->doc->content;?></th>
<td class='content'><?php echo $doc->content;?></td>
</tr>
<tr>
<th class='rowhead'><?php echo $lang->doc->digest;?></th>
<td><?php echo nl2br($doc->digest);?></td>
</tr>
<tr id='fileBox' class='hidden'>
<th class='rowhead'><?php echo $lang->files;?></th>
<td><?php echo $this->fetch('file', 'printFiles', array('files' => $doc->files, 'fieldset' => 'false'));?></td>
</tr>
</table>
<div class='a-center f-16px strong'>
<?php
$browseLink = $this->session->docList ? $this->session->docList : inlink('browse');
if(!$doc->deleted)
{
common::printLink('doc', 'edit', "docID=$doc->id", $lang->edit);
common::printLink('doc', 'delete', "docID=$doc->id", $lang->delete, 'hiddenwin');
}
echo html::a($browseLink, $lang->goback);
?>
</div>
<?php include '../../common/view/action.html.php';?>
<?php include './footer.html.php';?>