- deleted test plugin
- added FML Library
This commit is contained in:
		
							
								
								
									
										42
									
								
								application/FML/Elements/SimpleScript.php
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										42
									
								
								application/FML/Elements/SimpleScript.php
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,42 @@ | ||||
| <?php | ||||
|  | ||||
| namespace FML\Elements; | ||||
|  | ||||
| use FML\Types\Renderable; | ||||
|  | ||||
| /** | ||||
|  * Class representing a manialink script tag with a simple script text | ||||
|  * | ||||
|  * @author steeffeen | ||||
|  */ | ||||
| class SimpleScript implements Renderable { | ||||
| 	/** | ||||
| 	 * Protected properties | ||||
| 	 */ | ||||
| 	protected $tagName = 'script'; | ||||
| 	protected $text = ''; | ||||
|  | ||||
| 	/** | ||||
| 	 * Set script text | ||||
| 	 * | ||||
| 	 * @param string $text        	 | ||||
| 	 * @return \FML\Script\Script | ||||
| 	 */ | ||||
| 	public function setText($text) { | ||||
| 		$this->text = $text; | ||||
| 		return $this; | ||||
| 	} | ||||
|  | ||||
| 	/** | ||||
| 	 * | ||||
| 	 * @see \FML\Types\Renderable::render() | ||||
| 	 */ | ||||
| 	public function render(\DOMDocument $domDocument) { | ||||
| 		$xml = $domDocument->createElement($this->tagName); | ||||
| 		$scriptComment = $domDocument->createComment($this->text); | ||||
| 		$xml->appendChild($scriptComment); | ||||
| 		return $xml; | ||||
| 	} | ||||
| } | ||||
|  | ||||
| ?> | ||||
		Reference in New Issue
	
	Block a user