Skip to content

Commit

Permalink
FileUpload next step.
Browse files Browse the repository at this point in the history
  • Loading branch information
Artazor committed May 23, 2012
1 parent 59aa07a commit f15d7e8
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 19 deletions.
2 changes: 1 addition & 1 deletion common/file_upload/file_upload.class.php
Expand Up @@ -13,7 +13,7 @@ public function __construct($fileScope = false) {
}

public function post() {
throw new Exception(print_r($this->scope->FILES,true));
throw new Exception(print_r($this->scope->POST,true));
return '';
}

Expand Down
8 changes: 8 additions & 0 deletions common/file_upload/view.js
@@ -0,0 +1,8 @@
var $a = $this.find('a.test');

$a.click(function(){
remoteCall('class',function(err,data){
console.log(data);
});
});

4 changes: 4 additions & 0 deletions common/file_upload/view.less
Expand Up @@ -3,6 +3,10 @@ div.fileScope {
font-size:20px;
}

a.test {
cursor: pointer;
}


table.history {
margin: 20px;
Expand Down
37 changes: 19 additions & 18 deletions common/file_upload/view.php
@@ -1,18 +1,19 @@
<div class="<?=$this->getTemplateClass()?>">
<div class="fileScope">Upload for <?=$this->fileScope?></div>
<form class="upload std-form" enctype="multipart/form-data" method="post" action="<?=$this->go()?>">
<label><span>Format:</span><select>
<?foreach($this->getFileFormats() as $ff):?>
<option value="<?=$ff->id?>"><?=$ff?></option>
<?endforeach?>
</select></label>
<label><span>Select file:</span><input type="file" name="file"/></label>
<input type="submit" name="upload" value="Upload"/>
</form>
<?if($this->child):?>
<?$this->put_selected_file($this->child)?>
<?$this->child->put_view()?>
<?else:?>
<?$this->put_history()?>
<?endif?>
</div>
<?o(array('rpc'=>$this->go()))?>
<div class="fileScope">Upload for <?=$this->fileScope?></div>
<form class="upload std-form" enctype="multipart/form-data" method="post" action="<?=$this->go()?>">
<label><span>Format:</span><select name="format">
<?foreach($this->getFileFormats() as $ff):?>
<option value="<?=$ff->id?>"><?=$ff?></option>
<?endforeach?>
</select></label>
<label><span>Select file:</span><input type="file" name="file"/></label>
<a class="test">Test</a>
<input type="submit" name="upload" value="Upload"/>
</form>
<?if($this->child):?>
<?$this->put_selected_file($this->child)?>
<?$this->child->put_view()?>
<?else:?>
<?$this->put_history()?>
<?endif?>

0 comments on commit f15d7e8

Please sign in to comment.