コード例 #1
0
ファイル: QAttach.class.php プロジェクト: proxymoron/tracmor
 public function __construct($objParentObject, $strControlId = null, $intEntityQtypeId = null, $intEntityId = null)
 {
     parent::__construct($objParentObject, $strControlId);
     // Setup Default Properties
     $this->TemporaryUploadPath = __DOCROOT__ . __SUBDIRECTORY__ . '/uploads/attachments';
     $this->strTemplate = __DOCROOT__ . __SUBDIRECTORY__ . '/common/QAttach.tpl.php';
     $this->UploadText = QApplication::Translate('Upload');
     $this->CancelText = QApplication::Translate('Cancel');
     $this->btnUpload->Text = '<input type="button" class="button" value="Attach">';
     $this->DialogBoxHtml = '<h1>Upload a File</h1><p>Please select a file to upload.</p>';
     $this->DisplayStyle = QDisplayStyle::Inline;
     $this->EntityId = $intEntityId;
     $this->EntityQtypeId = $intEntityQtypeId;
     $this->dlgFileAsset->lblError->ForeColor = 'red';
     $this->dlgFileAsset->flcFileAsset = new QFileControlExt($this->dlgFileAsset);
     // This is appalling, but the best I could come up with
     // So I remove all of the actions that are created on btnUpload in QFileAssetBase
     // Then I add them back, but only after changing the src URI for the spinner gif. Gross.
     $this->dlgFileAsset->btnUpload->RemoveAllActions('onclick');
     $this->dlgFileAsset->btnUpload->AddAction(new QClickEvent(), new QToggleEnableAction($this->dlgFileAsset->btnUpload));
     $this->dlgFileAsset->btnUpload->AddAction(new QClickEvent(), new QToggleEnableAction($this->dlgFileAsset->btnCancel));
     $this->dlgFileAsset->objSpinner->Text = sprintf('<img src="%s/spinner_white.gif" width="14" height="14" alt="Please Wait..."/>', __VIRTUAL_DIRECTORY__ . __IMAGE_ASSETS__);
     $this->dlgFileAsset->btnUpload->AddAction(new QClickEvent(), new QToggleDisplayAction($this->dlgFileAsset->objSpinner));
     $this->dlgFileAsset->btnUpload->AddAction(new QClickEvent(), new QServerControlAction($this->dlgFileAsset, 'btnUpload_Click'));
 }
コード例 #2
0
 /**
  * QFileAsset::__construct()
  *
  * @param mixed  $objParentObject
  * @param string $strControlId
  *
  * @return \QFileAsset
  */
 public function __construct($objParentObject, $strControlId = null)
 {
     parent::__construct($objParentObject, $strControlId);
     // Setup Default Properties
     $this->strTemplate = __DOCROOT__ . __PHP_ASSETS__ . '/QFileAsset.tpl.php';
     $this->dlgFileAsset->Width = '300';
     $this->UploadText = QApplication::Translate('Upload');
     $this->CancelText = QApplication::Translate('Cancel');
     $this->btnUpload->Text = '<img src="' . __VIRTUAL_DIRECTORY__ . __IMAGE_ASSETS__ . '/add.png" alt="' . QApplication::Translate('Upload') . '" border="0"/> ' . QApplication::Translate('Upload');
     $this->btnDelete->Text = '<img src="' . __VIRTUAL_DIRECTORY__ . __IMAGE_ASSETS__ . '/delete.png" alt="' . QApplication::Translate('Delete') . '" border="0"/> ' . QApplication::Translate('Delete');
     $this->DialogBoxHtml = '<p>' . QApplication::Translate('Please select a file to upload.') . '</p>';
 }
コード例 #3
0
ファイル: QFileAsset.class.php プロジェクト: snowmann/qcodo
 public function __construct($objParentObject, $strControlId = null)
 {
     parent::__construct($objParentObject, $strControlId);
     // Setup Default Properties
     $this->strTemplate = __QCODO_CORE__ . '/assets/QFileAsset.tpl.php';
     $this->DialogBoxCssClass = 'fileassetDbox';
     $this->UploadText = QApplication::Translate('Upload');
     $this->CancelText = QApplication::Translate('Cancel');
     $this->btnUpload->Text = '<img src="' . __VIRTUAL_DIRECTORY__ . __IMAGE_ASSETS__ . '/add.png" alt="' . QApplication::Translate('Upload') . '" border="0"/> ' . QApplication::Translate('Upload');
     $this->btnDelete->Text = '<img src="' . __VIRTUAL_DIRECTORY__ . __IMAGE_ASSETS__ . '/delete.png" alt="' . QApplication::Translate('Delete') . '" border="0"/> ' . QApplication::Translate('Delete');
     $this->DialogBoxHtml = '<h1>Upload a File</h1><p>Please select a file to upload.</p>';
 }