예제 #1
0
 /**
  * @return string path to the error message file
  */
 protected function getErrorMessageFile()
 {
     $lang = Prado::getPreferredLanguage();
     $msgFile = Prado::getFrameworkPath() . '/Exceptions/messages/messages-' . $lang . '.txt';
     if (!is_file($msgFile)) {
         $msgFile = Prado::getFrameworkPath() . '/Exceptions/messages/messages.txt';
     }
     return $msgFile;
 }
 public function fileUploaded($sender, $param)
 {
     if ($sender->getHasFile()) {
         $tempUserFile = Prado::getFrameworkPath() . "/../rliq/assets/" . $this->user->Name . "Dimport.tmp";
         if (is_file($tempUserFile)) {
             unlink($tempUserFile);
         }
         $sender->saveAs($tempUserFile, true);
         $this->loadCSVFile($sender, $param);
     }
     $this->UploadFileError->Text = $sender->ErrorCode;
 }
예제 #3
0
 public function fileUploaded($sender, $param)
 {
     if ($sender->getHasFile()) {
         $filename = $sender->FileName;
         $tempUserFileName = date('Ymd_Hi_');
         $compFile = $tempUserFileName . $this->DMSAufTabelle->Text . "_" . $this->DMSAufId->Text . "_" . $filename;
         $tempUserFile = Prado::getFrameworkPath() . "/../rliq/assets/dms/" . $compFile;
         if (is_file($tempUserFile)) {
             unlink($tempUserFile);
         }
         $sender->saveAs($tempUserFile, true);
     }
     $this->UploadFileError->Text = $sender->ErrorCode;
     $this->loadDirectory();
     $this->UploadDialog->setDisplay("None");
 }
예제 #4
0
 public function getPradoScriptAssetUrl()
 {
     $base = Prado::getFrameworkPath() . DIRECTORY_SEPARATOR . self::SCRIPT_PATH;
     $assets = Prado::getApplication()->getAssetManager();
     return $assets->getPublishedUrl($base);
 }
 /**
  * Publishes a javascript library path and register packages to be loaded.
  * See TClientScriptLoader for component that enables users to register custom javascript libraries.
  * @param string javascript library base path
  * @param array list of packages or javascript files (without .js extension) to be loaded.
  * @param boolean true to enable keep comments in javascript files loaded, null to use application configuration.
  * @param boolean true to gzip the javascript code if browsers and php supports it.
  * @return string javascript src url
  * @since 3.1
  */
 public function registerJavascriptPackages($base, $packages, $debug = null, $gzip = true)
 {
     list($path, $url) = $this->getPackagePathUrl($base);
     $scriptLoaderPath = $path . '/' . basename(self::SCRIPT_LOADER);
     $scriptLoaderSrc = Prado::getFrameworkPath() . DIRECTORY_SEPARATOR . self::SCRIPT_LOADER;
     if (!is_file($scriptLoaderPath)) {
         copy($scriptLoaderSrc, $scriptLoaderPath);
         chmod($scriptLoaderPath, PRADO_CHMOD);
     }
     $url .= '/' . basename(self::SCRIPT_LOADER) . '?js=' . implode(',', $packages);
     if ($debug !== false && $this->getApplication()->getMode() === TApplicationMode::Debug) {
         $this->verifyJavascriptPackages($base, $path, $packages);
         $url .= '&mode=debug';
     }
     if ($gzip === false) {
         $url .= '&gzip=false';
     }
     return $url;
 }
예제 #6
0
 /**
  * Retrieves the template used for displaying internal exceptions.
  * Internal exceptions will be displayed with source code causing the exception.
  * This occurs when the application is in debug mode.
  * @param Exception the exception to be displayed
  * @return string the template content
  */
 protected function getExceptionTemplate($exception)
 {
     $lang = Prado::getPreferredLanguage();
     $exceptionFile = Prado::getFrameworkPath() . '/Exceptions/templates/' . self::EXCEPTION_FILE_NAME . '-' . $lang . '.html';
     if (!is_file($exceptionFile)) {
         $exceptionFile = Prado::getFrameworkPath() . '/Exceptions/templates/' . self::EXCEPTION_FILE_NAME . '.html';
     }
     if (($content = @file_get_contents($exceptionFile)) === false) {
         die("Unable to open exception template file '{$exceptionFile}'.");
     }
     return $content;
 }
예제 #7
0
 public function fileUploaded($sender, $param)
 {
     if ($sender->HasFile) {
         $this->UploadFileName->Text = $sender->FileName;
         $this->UploadFileLocalName->Text = $sender->LocalName;
         $this->UploadFileSize->Text = $sender->FileSize;
         $this->UploadFileType->Text = $sender->FileType;
         $tempUserFile = Prado::getFrameworkPath() . "/../rliq/assets/" . $this->user->Name . ".tmp";
         if (is_file($tempUserFile)) {
             unlink($tempUserFile);
         }
         $sender->saveAs($tempUserFile, true);
         $this->loadCSVFile();
         $this->bindList_FilePreview();
         $this->bindList_MappingPreview();
     }
 }
 public function onPreInit($param)
 {
     $myPDF = new HTML2FPDF();
     $myPDF->setBasePath(Prado::getFrameworkPath());
     $url = "http://" . $this->Application->Parameters['PDFHost'] . "/rliq/index.php?page=reports.protokoll.a_Protokoll&idtm_protokoll=2&idtm_termin=0";
     $html = "";
     $html = file_get_contents($url);
     $myPDF->WriteHTML($html);
     $myPDF->Output();
     $this->getResponse()->appendHeader("Content-Type:" . $this->header);
     $this->getResponse()->appendHeader("Content-Disposition:inline;filename=" . $this->docName . '.' . $this->ext);
     $writer->save('php://output');
     exit;
 }