Ejemplo n.º 1
0
 public function renderImage($intPersonId)
 {
     $objControlId = "personImage" . $intPersonId;
     if (!($objControl = $this->GetControl($objControlId))) {
         $objControl = new QImageControl($this, $objControlId);
         $imagePath = "../images/emoticons/" . $intPersonId . ".png";
         if (file_exists($imagePath)) {
             // Beautiful images are courtesy of Yellow Icon at http://yellowicon.com/downloads/page/4
             $objControl->ImagePath = $imagePath;
         } else {
             $objControl->ImagePath = "../images/emoticons/1.png";
             // fail-over case: default image
         }
     }
     // We pass the parameter of "false" to make sure the control doesn't render
     // itself RIGHT HERE - that it instead returns its string rendering result.
     return $objControl->Render(false);
 }
Ejemplo n.º 2
0
 public function renderImage($intPersonId)
 {
     $objControlId = "personImage" . $intPersonId;
     if (!($objControl = $this->GetControl($objControlId))) {
         $objControl = new QImageControl($this->dtgPersons, $objControlId);
         // And finally, let's specify a CacheFolder so that the images are cached
         // Notice that this CacheFolder path is a complete web-accessible relative-to-docroot path
         $objControl->CacheFolder = __VIRTUAL_DIRECTORY__ . __EXAMPLES__ . '/datagrid/cache';
         $imagePath = "../images/emoticons/" . $intPersonId . ".png";
         if (file_exists($imagePath)) {
             // Beautiful images are courtesy of Yellow Icon at http://yellowicon.com/downloads/page/4
             $objControl->ImagePath = $imagePath;
         } else {
             $objControl->ImagePath = "../images/emoticons/1.png";
             // fail-over case: default image
         }
     }
     // We pass the parameter of "false" to make sure the control doesn't render
     // itself RIGHT HERE - that it instead returns its string rendering result.
     return $objControl->Render(false);
 }