Rasel160 has uploaded a new change for review.
https://gerrit.wikimedia.org/r/76356
Change subject: WIP loads templates with Extention TemplateData
......................................................................
WIP loads templates with Extention TemplateData
Change-Id: I7b6f0141c62a71ff4186d5f2d7df4f62b95aeb85
---
M includes/UploadWizardConfig.php
1 file changed, 22 insertions(+), 0 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/UploadWizard
refs/changes/56/76356/1
diff --git a/includes/UploadWizardConfig.php b/includes/UploadWizardConfig.php
index 7d88006..5bd3d6f 100644
--- a/includes/UploadWizardConfig.php
+++ b/includes/UploadWizardConfig.php
@@ -173,4 +173,26 @@
return $licenses;
}
+ /**
+ * API call using TemplateData to get Template Fields
+ *
+ * @param string $templateName
+ *
+ * @return array
+ */
+ public static function getTemplate( $templateName ) {
+ global $wgRequest;
+ $api = new ApiMain(
+ new DerivativeRequest(
+ $wgRequest,
+ array(
+ 'action' => 'templatedata',
+ 'titles' => $templateName
+ )
+ )
+ );
+ $api->execute();
+ return $api->getResultData();
+ }
+
}
--
To view, visit https://gerrit.wikimedia.org/r/76356
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I7b6f0141c62a71ff4186d5f2d7df4f62b95aeb85
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/UploadWizard
Gerrit-Branch: master
Gerrit-Owner: Rasel160 <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits