public $activeMenuItem = 'wcf.acp.menu.link.devtools.project.list';
/**
- * @var bool
+ * @inheritDoc
+ */
+ public $formAction = 'edit';
+
+ /**
+ * @var bool
*/
public $hasBrokenPath = false;
/**
- * @inheritDoc
+ * list of missing XML elements that should be present
+ * @var string[]
*/
- public $formAction = 'edit';
+ public $missingElements = [];
/**
* @inheritDoc
parent::assignVariables();
WCF::getTPL()->assign([
- 'hasBrokenPath' => $this->hasBrokenPath
+ 'hasBrokenPath' => $this->hasBrokenPath,
+ 'missingElements' => $this->missingElements
]);
}
/** @var TextFormField $packageIdentifier */
$packageIdentifier = $this->form->getNodeById('packageIdentifier');
- $packageIdentifier->value($packageArchive->getPackageInfo('name'));
+ if ($packageArchive->getPackageInfo('name') !== null) {
+ $packageIdentifier->value($packageArchive->getPackageInfo('name'));
+ }
+ else {
+ $this->missingElements[] = 'name';
+ }
/** @var TextFormField $packageName */
$packageName = $this->form->getNodeById('packageName');
$xmlPackageNames = $packageArchive->getPackageInfo('packageName');
- if (count($xmlPackageNames) === 1) {
- $packageName->value(reset($xmlPackageNames));
- }
- else {
- $packageNames = [];
- foreach (LanguageFactory::getInstance()->getLanguages() as $language) {
- $packageNames[$language->languageID] = '';
-
- if (isset($xmlPackageNames[$language->languageCode])) {
- $packageNames[$language->languageID] = $xmlPackageNames[$language->languageCode];
- }
- else if (isset($xmlPackageNames['default'])) {
- $packageNames[$language->languageID] = $xmlPackageNames['default'];
+ if ($xmlPackageNames !== null) {
+ if (count($xmlPackageNames) === 1) {
+ $packageName->value(reset($xmlPackageNames));
+ }
+ else {
+ $packageNames = [];
+ foreach (LanguageFactory::getInstance()->getLanguages() as $language) {
+ $packageNames[$language->languageID] = '';
+
+ if (isset($xmlPackageNames[$language->languageCode])) {
+ $packageNames[$language->languageID] = $xmlPackageNames[$language->languageCode];
+ }
+ else if (isset($xmlPackageNames['default'])) {
+ $packageNames[$language->languageID] = $xmlPackageNames['default'];
+ }
}
+
+ $packageName->value($packageNames);
}
-
- $packageName->value($packageNames);
+ }
+ else {
+ $this->missingElements[] = 'packageName';
}
/** @var TextFormField $packageDescription */
$packageDescription = $this->form->getNodeById('packageDescription');
$xmlPackageDescriptions = $packageArchive->getPackageInfo('packageDescription');
- if (count($xmlPackageDescriptions) === 1) {
- $packageDescription->value(reset($xmlPackageDescriptions));
- }
- else {
- $packageDescriptions = [];
- foreach (LanguageFactory::getInstance()->getLanguages() as $language) {
- $packageDescriptions[$language->languageID] = '';
-
- if (isset($xmlPackageDescriptions[$language->languageCode])) {
- $packageDescriptions[$language->languageID] = $xmlPackageDescriptions[$language->languageCode];
- } else if (isset($xmlPackageDescriptions['default'])) {
- $packageDescriptions[$language->languageID] = $xmlPackageDescriptions['default'];
+ if ($xmlPackageDescriptions !== null) {
+ if (count($xmlPackageDescriptions) === 1) {
+ $packageDescription->value(reset($xmlPackageDescriptions));
+ }
+ else {
+ $packageDescriptions = [];
+ foreach (LanguageFactory::getInstance()->getLanguages() as $language) {
+ $packageDescriptions[$language->languageID] = '';
+
+ if (isset($xmlPackageDescriptions[$language->languageCode])) {
+ $packageDescriptions[$language->languageID] = $xmlPackageDescriptions[$language->languageCode];
+ } else if (isset($xmlPackageDescriptions['default'])) {
+ $packageDescriptions[$language->languageID] = $xmlPackageDescriptions['default'];
+ }
}
+
+ $packageDescription->value($packageDescriptions);
}
-
- $packageDescription->value($packageDescriptions);
+ }
+ else {
+ $this->missingElements[] = 'packageDescription';
}
if (!empty($packageArchive->getPackageInfo('isApplication'))) {
/** @var TextFormField $version */
$version = $this->form->getNodeById('version');
- $version->value($packageArchive->getPackageInfo('version'));
+ if ($packageArchive->getPackageInfo('version') !== null) {
+ $version->value($packageArchive->getPackageInfo('version'));
+ }
+ else {
+ $this->missingElements[] = 'packageDescription';
+ }
/** @var TextFormField $date */
$date = $this->form->getNodeById('date');
- $date->value(date('Y-m-d', $packageArchive->getPackageInfo('date')));
+ if ($packageArchive->getPackageInfo('date') !== null) {
+ $date->value(date('Y-m-d', $packageArchive->getPackageInfo('date')));
+ }
+ else {
+ $this->missingElements[] = 'date';
+ }
if ($packageArchive->getPackageInfo('packageurl') !== null) {
/** @var TextFormField $packageUrl */
/** @var TextFormField $author */
$author = $this->form->getNodeById('author');
- $author->value($packageArchive->getAuthorInfo('author'));
+ if ($packageArchive->getAuthorInfo('author') !== null) {
+ $author->value($packageArchive->getAuthorInfo('author'));
+ }
+ else {
+ $this->missingElements[] = 'author';
+ }
if ($packageArchive->getAuthorInfo('authorURL') !== null) {
/** @var TextFormField $authorUrl */
<item name="wcf.acp.devtools.project.pip.entry.delete.addDeleteInstruction"><![CDATA[Add delete instruction]]></item>
<item name="wcf.acp.devtools.project.pip.entry.delete.addDeleteInstruction.description"><![CDATA[The entry will not only be deleted from database and its installation instruction removed, but a delete instruction will also be explicitly added.]]></item>
<item name="wcf.acp.devtools.project.edit.error.brokenPath"><![CDATA[There is no <kbd>package.xml</kbd> in the given directory. The package files have either been deleted or moved.]]></item>
+ <item name="wcf.acp.devtools.project.edit.warning.missingElements"><![CDATA[The following information is missing from the <kbd>package.xml</kbd> file: {implode from=$missingElements item=missingElement}<kbd>{$missingElement}</kbd>{/implode}.]]></item>
</category>
<category name="wcf.acp.email">
<item name="wcf.acp.email.smtp.test"><![CDATA[SMTP Connection Test]]></item>
<item name="wcf.acp.group.type.owner"><![CDATA[Owner]]></item>
<item name="wcf.acp.group.type.owner.description"><![CDATA[The owner group features a few irrevocable permissions and is protected from edits by other groups, only the owner group can edit itself. Members of this group can add other users to this group, but cannot remove themselves.]]></item>
<item name="wcf.acp.group.ownerGroupPermission"><![CDATA[The owner group always has this permission, it cannot be revoked.]]></item>
-
<item name="wcf.acp.group.missingOwnerGroup"><![CDATA[No owner group has been configured yet, <a href="{link controller='UserGroupPromoteOwner'}{/link}">please set it up now</a>.]]></item>
<item name="wcf.acp.group.promoteOwner"><![CDATA[Set Up the Owner Group]]></item>
<item name="wcf.acp.group.promoteOwner.group"><![CDATA[Select the owner group]]></item>