Phundament-Packages
[ class tree: Phundament-Packages ] [ index: Phundament-Packages ] [ all elements ]

Source for file LMediaDisplay.php

Documentation is available at LMediaDisplay.php

  1. <?php
  2. /**
  3.  * class file.
  4.  *
  5.  * @license http://opensource.org/licenses/mozilla1.1.php Mozilla Public License
  6.  * @copyright 2005, diemeisterei GmbH. All rights reserved.
  7.  * @author $Author: schmunk $
  8.  * @version $Revision: 188 $  $Date: 2006-05-11 10:50:16 +0200 (Do, 11 Mai 2006) $
  9.  * @package Phundament.Packages
  10.  * @subpackage LMediaManager
  11.  */
  12.  
  13. /**
  14.  * Default display template for media files
  15.  *
  16.  * Extends this class, if you need your own templates.
  17.  *
  18.  * @package System.Web.UI.WebControls
  19.  * @subpackage MetaData
  20.  */
  21.  
  22. class LMediaDisplay extends TControl
  23. {
  24.     function setMediaId($value)
  25.     {
  26.         $this->setViewState("MediaId"$value);
  27.     }
  28.  
  29.     function getMediaId()
  30.     {
  31.         return $this->getViewState("MediaId"null);
  32.     }
  33.  
  34.     function setDestWidth($value)
  35.     {
  36.         $this->setViewState("DestWidth"$value);
  37.     }
  38.  
  39.     function getDestWidth()
  40.     {
  41.         return $this->getViewState("DestWidth"null);
  42.     }
  43.  
  44.     function setDestHeight($value)
  45.     {
  46.         $this->setViewState("DestHeight"$value);
  47.     }
  48.  
  49.     function getDestHeight()
  50.     {
  51.         return $this->getViewState("DestHeight"null);
  52.     }
  53.  
  54.     function onPreRender($param)
  55.     {
  56.         parent :: onPreRender($param);
  57.         $mId$this->getMediaId();
  58.         if ($mId != null)
  59.         {
  60.             $objLMediaManagerCore :: queryRecords($mId);
  61.             if (!is_object($obj))
  62.                 return//TODO
  63.  
  64.         }
  65.         else
  66.         {
  67.             Prado :: trace("Media file n/a"4"LMediaDisplay");
  68.             return;
  69.         }
  70.  
  71.         $namePrado :: getPathOfAlias("Root""/" $obj->getDirectory("/" $obj->getFileName();
  72.  
  73.         $imgnew LImage;
  74.         $img->setImageUrl($name);
  75.  
  76.         // take width and height from PopupLink parameters, if given
  77.         if ($this->getDestWidth(&& $this->getDestHeight())
  78.         {
  79.             $img->setDestWidth($this->getDestWidth());
  80.             $img->setDestHeight($this->getDestHeight());
  81.         else {
  82.             $img->setDestWidth(700);
  83.             $img->setDestHeight(500);
  84.         }
  85.  
  86.         $this->Controls[]$img;
  87.     }
  88. }
  89. ?>

Documentation generated on Sun, 25 Feb 2007 16:10:53 +0100 by phpDocumentor 1.3.1