本文整理汇总了PHP中LiteralField::Field方法的典型用法代码示例。如果您正苦于以下问题:PHP LiteralField::Field方法的具体用法?PHP LiteralField::Field怎么用?PHP LiteralField::Field使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LiteralField
的用法示例。
在下文中一共展示了LiteralField::Field方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: UploadForm
public function UploadForm()
{
// Sync up the DB
// singleton('Folder')->syncChildren();
$className = $this->sourceClass();
$childData = new $className();
$validator = $this->getValidatorFor($childData);
if ($this->Can('upload')) {
SWFUploadConfig::addPostParams(array('dataObjectClassName' => $this->sourceClass(), 'dataObjectFieldName' => $this->dataObjectFieldName, 'fileFieldName' => $this->fileFieldName, 'fileClassName' => $this->fileClassName, 'parentIDName' => $this->getParentIdName($this->getParentClass(), $this->sourceClass()), 'controllerID' => $this->controllerID, 'OverrideUploadFolder' => $this->getUploadFolder(), 'hasDataObject' => $this->hasDataObject ? 1 : 0));
if ($this->allowUploadFolderSelection) {
SWFUploadConfig::addDynamicPostParam('UploadFolder', 'FileDataObjectManager_Popup_UploadForm_UploadFolder');
}
if ($this->getAllowedFileTypes()) {
SWFUploadConfig::addFileTypes($this->getAllowedFileTypes());
}
if ($this->enableUploadDebugging) {
SWFUploadConfig::set_var('debug', 'true');
}
}
$fields = $this->Can('upload') ? $this->getUploadFields() : new FieldSet(new HeaderField($title = sprintf(_t('DataObjectManager.ADD', 'Add %s'), $this->PluralTitle()), $headingLevel = 2));
$form = Object::create($this->popupClass, $this, 'UploadForm', $fields, $validator, false, $childData);
$action = $this->Can('upload') ? new FieldSet(new FormAction('saveUploadForm', 'Upload')) : new FieldSet();
$form->setActions($action);
if ($this->Can('import')) {
$header = new HeaderField($title = _t('DataObjectManager.IMPORTFROMFOLDER', 'Import from an existing folder'), $headingLevel = 3);
$holder = new LiteralField("holder", "<div class='ajax-loader'></div><div id='import-holder'></div>");
if (!isset($_POST['uploaded_files'])) {
return $form->forTemplate() . $header->Field() . $this->ImportDropdown()->Field() . $holder->Field();
} else {
return $form;
}
}
return $form;
}