Virtlab:Řídící server/ParserTaskupload.php.inc

Z VirtlabWiki

(Rozdíly mezi verzemi)
Přejít na: navigace, hledání
Verze z 10:16, 22. 10. 2007
Vav166 (Diskuse | příspěvky)

← Předchozí porovnání
Verze z 11:59, 22. 10. 2007
Vav166 (Diskuse | příspěvky)

Následující porovnání →
Řádka 15: Řádka 15:
== Zdrojový kód == == Zdrojový kód ==
-<pre>+Aktuální zdrojový kód se nachází [https://vl-test.cs.vsb.cz/websvn/filedetails.php?repname=virtlab&path=%2FDISTR%2Fweb%2Fclass%2FvirtlabParserTaskupload.php.inc&rev=0&sc=0 zde].
-<?php+
- +
-class virtlabParserTaskupload {+
- private $parsed = array();+
- +
- function __construct($file, $is_file=0) {+
- $parser = new virtlabXmlParser(1);+
- +
- if($is_file) $parser->parse($file);+
- else $parser->parse_data($file);+
- +
- $this->parsed = $parser->output;+
- unset($parser);+
- }//konstruktor+
- +
- public function getShortname() {+
- if(isset($this->parsed[0]["attribs"]["NAME"]))+
- return $this->parsed[0]["attribs"]["NAME"];+
- else return NULL;+
- }//function+
- +
- public function getTime() {+
- if(isset($this->parsed[0]["attribs"]["TIME"]))+
- return $this->parsed[0]["attribs"]["TIME"];+
- else return NULL;+
- }//function+
- +
- public function getLongname() {+
- if(isset($this->parsed[0]["child"][0]["content"]))+
- return $this->parsed[0]["child"][0]["content"];+
- else return NULL;+
- }//function+
- +
- public function getShortdescription() {+
- if(isset($this->parsed[0]["child"][1]["content"]))+
- return $this->parsed[0]["child"][1]["content"];+
- else return NULL;+
- }//function+
- +
- private function getGroup($group) {+
- switch($group) {+
- case "descrip": $idx = 2; break;+
- case "pics": $idx = 3; break;+
- case "preconf": $idx = 4; break;+
- case "postconf":$idx = 5; break;+
- case "topology":$idx = 6; break;+
- default: return NULL;+
- }//switch+
- return $this->parsed[0]["child"][$idx];+
- }//function+
- +
- public function getGroupExists($group) {+
- $tmp = $this->getGroup($group);+
- if(is_null($tmp)) return NULL;+
- switch($tmp["attribs"]["EXISTS"]) {+
- case "yes": return TRUE;+
- case "no": return FALSE;+
- default: return NULL;+
- }//switch+
- }//function+
- +
- public function getGroupName($group) {+
- $tmp = $this->getGroup($group);+
- if(is_null($tmp)) return NULL;+
- return $tmp["attribs"]["NAME"];+
- }//function+
- +
- public function getGroupFileCount($group) {+
- $tmp = $this->getGroup($group);+
- if(is_null($tmp)) return NULL;+
- return count($tmp["child"]);+
- }//function+
- +
- private function getGroupFile($group, $fileidx) {+
- $tmp = $this->getGroup($group);+
- if(is_null($tmp)) return NULL;+
- if(!isset($tmp["child"][$fileidx])) return NULL;+
- return $tmp["child"][$fileidx];+
- }//function+
- +
- public function getGroupFileName($group, $fileidx) {+
- $tmp = $this->getGroupFile($group, $fileidx);+
- if(is_null($tmp)) return NULL;+
- return $tmp["attribs"]["NAME"];+
- }//function+
- +
- public function getGroupFilePath($group, $fileidx) {+
- $tmp = $this->getGroupFile($group, $fileidx);+
- if(is_null($tmp)) return NULL;+
- return $tmp["attribs"]["FILEPATH"];+
- }//function+
- +
- public function getGroupFileExists($group, $fileidx) {+
- $tmp = $this->getGroupFile($group, $fileidx);+
- if(is_null($tmp)) return NULL;+
- switch($tmp["attribs"]["EXISTS"]) {+
- case "yes": return TRUE;+
- case "no": return FALSE;+
- default: return NULL;+
- }//switch+
- }//function+
-}//class+
-?>+
- +
-</pre>+
 +[[Kategorie:Komponenty virtlabu]]
 +[[Kategorie:Server]]
 +[[Kategorie:Řídící server]]
[[Kategorie:PHP]] [[Kategorie:PHP]]
[[Kategorie:Třída]] [[Kategorie:Třída]]
 +[[Kategorie:UNCOMPLETE]]

Verze z 11:59, 22. 10. 2007

Metody

function __construct($file, $is_file=0)
public function getShortname()
public function getTime()
public function getLongname()
public function getShortdescription()
private function getGroup($group)
public function getGroupExists($group)
public function getGroupName($group)
public function getGroupFileCount($group)
private function getGroupFile($group, $fileidx)
public function getGroupFileName($group, $fileidx)
public function getGroupFilePath($group, $fileidx)
public function getGroupFileExists($group, $fileidx)

Zdrojový kód

Aktuální zdrojový kód se nachází zde.

Osobní nástroje