本文整理匯總了PHP中InstallUtil::getMaxAllowedFileSize方法的典型用法代碼示例。如果您正苦於以下問題:PHP InstallUtil::getMaxAllowedFileSize方法的具體用法?PHP InstallUtil::getMaxAllowedFileSize怎麽用?PHP InstallUtil::getMaxAllowedFileSize使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類InstallUtil
的用法示例。
在下文中一共展示了InstallUtil::getMaxAllowedFileSize方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: renderControlEditable
protected function renderControlEditable()
{
assert('$this->model instanceof ImportWizardForm');
assert('$this->attribute == null');
$existingFilesInformation = array();
if (!empty($this->model->fileUploadData)) {
$existingFilesInformation[] = $this->model->fileUploadData;
$existingFilesInformation[0]['id'] = $this->model->id;
}
$content = $this->renderDelimiterAndEnclosureContent($existingFilesInformation);
$inputNameAndId = $this->getEditableInputId('file');
$beforeUploadAction = "\$('#{$this->getEditableInputId('rowColumnDelimiter')}').attr('readonly', true);";
$beforeUploadAction .= "\$('#{$this->getEditableInputId('rowColumnDelimiter')}').addClass('readonly-field');";
$beforeUploadAction .= "\$('#{$this->getEditableInputId('rowColumnEnclosure')}').attr('readonly', true);";
$beforeUploadAction .= "\$('#{$this->getEditableInputId('rowColumnEnclosure')}').addClass('readonly-field');";
$afterDeleteAction = "\$('#{$this->getEditableInputId('rowColumnDelimiter')}').removeAttr('readonly');";
$afterDeleteAction .= "\$('#{$this->getEditableInputId('rowColumnDelimiter')}').removeClass('readonly-field');";
$afterDeleteAction .= "\$('#{$this->getEditableInputId('rowColumnEnclosure')}').removeAttr('readonly');";
$afterDeleteAction .= "\$('#{$this->getEditableInputId('rowColumnEnclosure')}').removeClass('readonly-field');";
$cClipWidget = new CClipWidget();
$cClipWidget->beginClip("filesElement");
$cClipWidget->widget('application.core.widgets.FileUpload', array('uploadUrl' => Yii::app()->createUrl("import/default/uploadFile", array('filesVariableName' => $inputNameAndId, 'id' => $this->model->id)), 'deleteUrl' => Yii::app()->createUrl("import/default/deleteFile"), 'inputName' => $inputNameAndId, 'inputId' => $inputNameAndId, 'hiddenInputName' => 'fileId', 'formName' => $this->form->id, 'existingFiles' => $existingFilesInformation, 'maxSize' => (int) InstallUtil::getMaxAllowedFileSize(), 'beforeUploadAction' => $beforeUploadAction, 'afterDeleteAction' => $afterDeleteAction));
$cClipWidget->endClip();
$content .= '<tr><td></td><td colspan="3"><div class="file-upload-box">' . $cClipWidget->getController()->clips['filesElement'] . '</div></td></tr>';
return $content;
}
示例2: renderImagesUploadInput
protected function renderImagesUploadInput()
{
$inputNameAndId = 'file';
$cClipWidget = new CClipWidget();
$cClipWidget->beginClip("imageFilesElement");
$cClipWidget->widget('application.core.widgets.ImageFileUpload', array('uploadUrl' => Yii::app()->createUrl("zurmo/imageModel/upload"), 'deleteUrl' => Yii::app()->createUrl("zurmo/imageModel/delete"), 'inputName' => $inputNameAndId, 'inputId' => $inputNameAndId, 'hiddenInputName' => 'filesIds', 'allowMultipleUpload' => true, 'existingFiles' => array(), 'maxSize' => (int) InstallUtil::getMaxAllowedFileSize(), 'showMaxSize' => true, 'id' => __CLASS__, 'onSuccessAction' => "\$('#{$this->listViewGridId}').yiiGridView('update');", 'formData' => "{'" . Yii::app()->request->csrfTokenName . "' : '" . Yii::app()->request->csrfToken . "'}"));
$cClipWidget->endClip();
return $cClipWidget->getController()->clips['imageFilesElement'];
}
示例3: renderControlEditable
protected function renderControlEditable()
{
assert('$this->model instanceof Item || $this->model->getModel() instanceof Item');
$existingFilesInformation = array();
foreach ($this->model->files as $existingFile) {
$existingFilesInformation[] = array('name' => $existingFile->name, 'size' => FileModelDisplayUtil::convertSizeToHumanReadableAndGet((int) $existingFile->size), 'id' => $existingFile->id);
}
$inputNameAndId = $this->getEditableInputId('files');
$cClipWidget = new CClipWidget();
$cClipWidget->beginClip("filesElement");
$cClipWidget->widget('application.core.widgets.FileUpload', array('uploadUrl' => Yii::app()->createUrl("zurmo/fileModel/upload", array('filesVariableName' => $inputNameAndId)), 'deleteUrl' => Yii::app()->createUrl("zurmo/fileModel/delete"), 'inputName' => $inputNameAndId, 'inputId' => $inputNameAndId, 'hiddenInputName' => 'filesIds', 'formName' => $this->form->id, 'allowMultipleUpload' => true, 'existingFiles' => $existingFilesInformation, 'maxSize' => (int) InstallUtil::getMaxAllowedFileSize(), 'showMaxSize' => $this->getShowMaxSize(), 'id' => $this->getId()));
$cClipWidget->endClip();
return $cClipWidget->getController()->clips['filesElement'];
}
示例4: renderControlEditable
protected function renderControlEditable()
{
// assert('$this->model instanceof ZurmoUserInterfaceConfigurationForm');
$existingFilesInformation = array();
if (!empty($this->model->logoFileData)) {
$existingFilesInformation[] = $this->model->logoFileData;
$existingFilesInformation[0]['id'] = $this->model->id;
}
$inputNameAndId = $this->getEditableInputId('logo');
$cClipWidget = new CClipWidget();
$cClipWidget->beginClip("logoFileElement");
$cClipWidget->widget('application.core.widgets.LogoFileUpload', array('uploadUrl' => Yii::app()->createUrl("zurmo/default/uploadLogo", array('filesVariableName' => $inputNameAndId)), 'deleteUrl' => Yii::app()->createUrl("zurmo/default/deleteLogo"), 'inputName' => $inputNameAndId, 'inputId' => $inputNameAndId, 'hiddenInputName' => 'logoFileName', 'formName' => $this->form->id, 'existingFiles' => $existingFilesInformation, 'maxSize' => (int) InstallUtil::getMaxAllowedFileSize(), 'beforeUploadAction' => null, 'afterDeleteAction' => null));
$cClipWidget->endClip();
$content = '<div class="file-upload-box">' . $cClipWidget->getController()->clips['logoFileElement'] . '</div>';
return $content;
}