Login   Register  
PHP Classes
elePHPant
Icontem

File: tpl/button.tpl.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Jacek Lukasiewicz  >  jQueryUI PHP wrapper  >  tpl/button.tpl.php  >  Download  
File: tpl/button.tpl.php
Role: Auxiliary script
Content type: text/plain
Description: button template
Class: jQueryUI PHP wrapper
Generate HTML for pages using jQuery UI widgets
Author: By
Last change:
Date: 3 years ago
Size: 910 bytes
 

Contents

Class file image Download
<?php 
switch($this->type) {
    case 
'button':
        
$js '$( "#buttonWrapp-'.$this->id.' button").button({'.$this->optionsString.'});';
        
$element =     '<button id="'.$this->id.'">'.$this->text.'</button>';    
        break;
    case 
'submit':
        
$js '$( "#buttonWrapp-'.$this->id.' input:submit").button({'.$this->optionsString.'});';    
        
$element =     '<input id="'.$this->id.'" value="'.$this->text.'" type="submit">';
        break;
    case 
'link':
        
$js '$( "#buttonWrapp-'.$this->id.' a").button({'.$this->optionsString.'});';
        
$element =     '<a id="'.$this->id.'" href="'.$this->anchor.'">'.$this->text.'</a>';    
        break;
    default:
        
$js '$( "#buttonWrapp-'.$this->id.' a").button({'.$this->optionsString.'});';
        
$element =     '<button id="'.$this->id.'">'.$this->text.'</button>';        
}
?>
<script>
$(function() {
    
    <?php print $js?>
});
</script>
<div id="buttonWrapp-<?php print $this->id?>"><?php print $element?></div>