protected function AddHeadShotToPanel($mixSource, $blnSetAsActive, $intIdFromDatabase = null)
 {
     $imgHeadShot = new QImageControl($this->dtrHeadShots);
     if ($mixSource instanceof QFileUploader) {
         $imgHeadShot->SetImagePathFromFileUploader($mixSource);
     } else {
         if (is_file($mixSource)) {
             $imgHeadShot->ImagePath = $mixSource;
         } else {
             $imgHeadShot->ImagePath = __DOCROOT__ . __IMAGE_ASSETS__ . '/no_headshot.png';
         }
     }
     $imgHeadShot->Width = 160;
     $imgHeadShot->Height = 160;
     $imgHeadShot->ActionParameter = $intIdFromDatabase;
     if ($blnSetAsActive) {
         $this->strSelectedImageControlId = $imgHeadShot->ControlId;
     }
     $imgHeadShot->ToolTip = 'Set as Active';
     $imgHeadShot->AddAction(new QClickEvent(), new QAjaxControlAction($this, 'imgHeadShot_Click'));
     $this->imgHeadShotArray[] = $imgHeadShot;
 }
 public function reload()
 {
     $this->RemoveChildControls(true);
     $img = null;
     // get the QImageBrowser control
     $objImageBrowser = $this->ParentControl;
     while (!$objImageBrowser instanceof QImageBrowserBase) {
         $objImageBrowser = $objImageBrowser->ParentControl;
         if (is_null($objImageBrowser) || $objImageBrowser instanceof QForm) {
             throw new QCallerException("QImageBrowserThumbnails must be inside a QImageBrowser");
         }
     }
     $iEnd = $objImageBrowser->ImageCount();
     for ($i = 0; $i < $iEnd; ++$i) {
         $strImagePath = $objImageBrowser->ThumbnailImagePath($i);
         $img = new QImageControl($this);
         $img->CssClass = 'ib_thm_image';
         $img->ImagePath = $strImagePath;
         $img->AlternateText = $strImagePath;
         $img->ActionParameter = $i;
         // 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
         $img->CacheFolder = __IMAGE_CACHE_ASSETS__;
         $img->AddAction(new QClickEvent(), new QAjaxControlAction($objImageBrowser, "imgThm_Click"));
     }
     if ($img) {
         $img->CssClass = 'ib_thm_image ib_thm_image_last';
         $this->Text = '';
     } else {
         $this->Text = QApplication::Translate('No thumbnails');
     }
 }
예제 #3
0
 public function reload()
 {
     $this->RemoveChildControls(true);
     $img = null;
     // get the QImageBrowser control
     $objImageBrowser = $this->ParentControl;
     while (!$objImageBrowser instanceof QImageBrowserBase) {
         $objImageBrowser = $objImageBrowser->ParentControl;
         if (is_null($objImageBrowser) || $objImageBrowser instanceof QForm) {
             throw new QCallerException("QImageBrowserThumbnails must be inside a QImageBrowser");
         }
     }
     $iEnd = $objImageBrowser->ImageCount();
     for ($i = 0; $i < $iEnd; ++$i) {
         $strImagePath = $objImageBrowser->ThumbnailImagePath($i);
         $img = new QImageControl($this);
         $img->CssClass = 'ib_thm_image';
         $img->ImagePath = $strImagePath;
         $img->AlternateText = $strImagePath;
         $img->ActionParameter = $i;
         $img->AddAction(new QClickEvent(), new QAjaxControlAction($objImageBrowser, "imgThm_Click"));
     }
     if ($img) {
         $img->CssClass = 'ib_thm_image ib_thm_image_last';
         $this->Text = '';
     } else {
         $this->Text = QApplication::Translate('No thumbnails');
     }
 }