コード例 #1
0
ファイル: image.php プロジェクト: iensenfirippu/RTK
 /**
  * A widget for displaying an image (img)
  * @param string $imgurl The url of the image
  * @param string $alttext A text that will be shown if the image could not be loaded
  * @param boolean $forcehttps Specify if the link has to have https 
  * @param HtmlAttributes $args Allows custom html tag arguments to be specified (not recommended)
  **/
 public function __construct($imgurl = EMPTYSTRING, $alttext = '[IMG]', $args = null)
 {
     parent::__construct();
     $img = new HtmlElement('img', $args);
     $img->AddAttributes(array('src' => RTK::GetBaseURL() . $imgurl, 'alt' => $alttext));
     $this->AddChild($img);
 }
コード例 #2
0
ファイル: listview.php プロジェクト: iensenfirippu/RTK
 /**
  * A widget for displaying a list of items
  * @param string[] $columnheaders The headers in the top row
  * @param boolean $alternaterow Determines if different styling should be applied to every other row
  * @param boolean $alternatecell Determines if different styling should be applied to every other cell
  * @param HtmlAttributes $args Allows custom html tag arguments to be specified (not recommended)
  **/
 public function __construct($columnheaders, $alternaterow = true, $alternatecell = false, $args = null)
 {
     parent::__construct();
     $table = new HtmlElement('div', array('class' => 'listview'), null, new HtmlElement('table'));
     $table->AddAttributes($args);
     $this->AddContainer($table, 'table');
     //$this->SetPointer('table');
     if ($alternaterow == false) {
         $this->_alternaterow = null;
     } else {
         $this->_alternaterow = true;
     }
     if ($alternatecell == false) {
         $this->_alternatecell = null;
     } else {
         $this->_alternatecell = true;
     }
     if (sizeof($columnheaders) > 0) {
         for ($i = 0; $i < sizeof($columnheaders); $i++) {
             $string = $columnheaders[$i];
             if (is_string($string) && strlen($string) > 0 && $string[0] == '_') {
                 $this->_compressedcols[] = $i;
                 $columnheaders[$i] = substr($columnheaders[$i], 1);
             }
         }
         $this->AddHeader($columnheaders);
     }
 }
コード例 #3
0
ファイル: htmldocument.php プロジェクト: iensenfirippu/RTK
 /**
  * Adds a javascript to the HTML document
  * @param string $filename The name of the file to add
  * @param HtmlAttributes $args Allows custom html tag arguments to be specified (not recommended)
  */
 public function AddJavascript($filename, $args = null)
 {
     $script = new HtmlElement('script', array('src' => $filename));
     $script->AddAttributes($args);
     $this->_javascripts[$filename] = $script;
 }