public function GetImageHint()
 {
     if (isset($this->imageHintTemplate)) {
         return FormatDatasetFieldsTemplate($this->dataset, $this->imageHintTemplate);
     } else {
         return $this->GetCaption();
     }
 }
 public function GetValue()
 {
     $fieldValue = $this->GetDataset()->GetFieldValueByName($this->fieldName);
     if ($fieldValue == null) {
         return '<em class="pgui-null-value">NULL</em>';
     } else {
         return sprintf('<img src="%s" alt="%s">', $this->sourcePrefix . $fieldValue . $this->sourceSuffix, FormatDatasetFieldsTemplate($this->dataset, $this->hintTemplate));
     }
 }
 public function GetValue()
 {
     $fieldValue = $this->GetDataset()->GetFieldValueByName($this->fieldName);
     if ($fieldValue == null) {
         return '<em class="pgui-null-value">NULL</em>';
     } else {
         return StringUtils::Format('<i class="icon-download"></i>&nbsp;' . '<a target="_blank" title="%s" href="%s">%s</a>', FormatDatasetFieldsTemplate($this->dataset, $this->downloadLinkHintTemplate), $this->sourcePrefix . $fieldValue . $this->sourceSuffix, $this->captions->GetMessageString('Download'));
     }
 }
示例#4
0
 public function Render(Renderer $renderer)
 {
     $primaryKeyValues = array();
     ExtractPrimaryKeyValues($primaryKeyValues, METHOD_GET);
     $this->dataset->SetSingleRecordState($primaryKeyValues);
     $this->dataset->Open();
     $result = '';
     if ($this->dataset->Next()) {
         $result = $this->dataset->GetFieldValueByName($this->fieldName);
     }
     $this->dataset->Close();
     header('Content-type: ' . FormatDatasetFieldsTemplate($this->dataset, $this->contentType));
     if ($this->forceDownload) {
         header('Content-Disposition: attachment; filename="' . FormatDatasetFieldsTemplate($this->dataset, $this->downloadFileName) . '"');
     }
     echo $result;
 }
 public function GetLink()
 {
     return FormatDatasetFieldsTemplate($this->dataset, $this->template);
 }
 public function Generate()
 {
     $rssChannel = new RssChannel($this->channelTitle, $this->channelLink, $this->channelDescription);
     $this->ApplyOrderingToDataset();
     $this->ApplyLimitCountToDataset();
     $this->dataset->Open();
     while ($this->dataset->Next()) {
         $item = new RssItem(FormatDatasetFieldsTemplate($this->dataset, $this->itemTitleTemplate), FormatDatasetFieldsTemplate($this->dataset, $this->itemLinkTemplate), FormatDatasetFieldsTemplate($this->dataset, $this->itemDescriptionTemplate));
         $this->SetItemPublicationDate($item);
         $rssChannel->AddItem($item);
     }
     $this->dataset->Close();
     return $rssChannel->GenerateRss();
 }
示例#7
0
 private function GetThumbnailFileName($original_file_name, $original_file_extension, $file_size)
 {
     $result = '';
     $handled = false;
     $this->generateFileNameDelegate->CallFromArray(array(&$result, &$handled, $original_file_name, $original_file_extension, $file_size));
     $targetFolder = FormatDatasetFieldsTemplate($this->GetDataset(), $this->directoryToSaveThumbnails);
     FileUtils::ForceDirectories($this->directoryToSaveThumbnails);
     if (!$handled) {
         $filename = FileUtils::AppendFileExtension(rand(), $original_file_extension);
         $result = Path::Combine($targetFolder, $filename);
         while (file_exists($result)) {
             $filename = FileUtils::AppendFileExtension(rand(), $original_file_extension);
             $result = Path::Combine($targetFolder, $filename);
         }
     }
     return $result;
 }
 public function picture_GenerateFileName_insert(&$filepath, &$handled, $original_file_name, $original_file_extension, $file_size)
 {
     $targetFolder = FormatDatasetFieldsTemplate($this->GetDataset(), 'images');
     FileUtils::ForceDirectories($targetFolder);
     $filename = ApplyVarablesMapToTemplate('%original_file_name%', array('original_file_name' => $original_file_name, 'original_file_extension' => $original_file_extension, 'file_size' => $file_size));
     $filepath = Path::Combine($targetFolder, $filename);
     $handled = true;
 }
示例#9
0
 public function image_GenerateFileName_insert(&$filepath, &$handled, $original_file_name, $original_file_extension, $file_size)
 {
     $targetFolder = FormatDatasetFieldsTemplate($this->GetDataset(), 'ckupload');
     FileUtils::ForceDirectories($targetFolder);
     $filename = FileUtils::AppendFileExtension(rand(), $original_file_extension);
     $filepath = Path::Combine($targetFolder, $filename);
     while (file_exists($filepath)) {
         $filename = FileUtils::AppendFileExtension(rand(), $original_file_extension);
         $filepath = Path::Combine($targetFolder, $filename);
     }
     $handled = true;
 }