* code for custom size in webapp.

This commit is contained in:
wangyidong
2013-05-02 09:00:19 +00:00
parent 8a28758a6a
commit 7e63678faa
4 changed files with 10 additions and 5 deletions

View File

@@ -36,7 +36,12 @@ function toggleShowapp(webappID, webappName)
function setSize(target)
{
$('.size').hide();
if(target == 'popup') $('.size').show();
$('.customSize').hide();
if(target == 'popup')
{
$('.size').show();
customSize($('#size').val());
}
}
function addView(webappID)

View File

@@ -254,7 +254,7 @@ class webappModel extends model
{
$webapp = $this->getLocalAppByID($webappID);
$data = fixer::input('post')->remove('files,customWidth,customHeight')->get();
if($data->size == 'custom') $data->size = $this->post->customWidth . 'x' . $this->post->customHeight;
if($data->size == 'custom') $data->size = (float)$this->post->customWidth . 'x' . (float)$this->post->customHeight;
$this->dao->update(TABLE_WEBAPP)->data($data)->where('id')->eq($webappID)->check('url', 'unique', "id != $webappID", false)->exec();
@@ -290,7 +290,7 @@ class webappModel extends model
->add('addedDate', helper::now())
->add('author', $this->app->user->account)
->remove('files,customWidth,customHeight')->get();
if($data->size == 'custom') $data->size = $this->post->customWidth . 'x' . $this->post->customHeight;
if($data->size == 'custom') $data->size = (float)$this->post->customWidth . 'x' . (float)$this->post->customHeight;
$this->dao->insert(TABLE_WEBAPP)->data($data)
->autocheck()
->batchCheck($this->config->webapp->create->requiredFields, 'notempty')

View File

@@ -36,7 +36,7 @@
</tr>
<tr class="customSize hidden">
<th align='left'><?php echo $lang->webapp->custom?></th>
<td><?php echo html::input('customWidth', '', "class='w-40px'") . ' x ' . html::input('customHeight', '', "class='w-40px'");?></td>
<td><?php echo html::input('customWidth', '', "class='w-40px'") . 'px X ' . html::input('customHeight', '', "class='w-40px'") . 'px';?></td>
</tr>
<tr>
<th align='left'><?php echo $lang->webapp->abstract?></th>

View File

@@ -48,7 +48,7 @@
</tr>
<tr class="customSize <?php if($webapp->size != 'custom') echo 'hidden'?>">
<th align='left'><?php echo $lang->webapp->custom?></th>
<td><?php echo html::input('customWidth', $customWidth, "class='w-40px'") . ' x ' . html::input('customHeight', $customHeight, "class='w-40px'");?></td>
<td><?php echo html::input('customWidth', $customWidth, "class='w-40px'") . 'px X ' . html::input('customHeight', $customHeight, "class='w-40px'") . 'px';?></td>
</tr>
<tr>
<th align='left'><?php echo $lang->webapp->abstract?></th>