Hchuying has uploaded a new change for review.
https://gerrit.wikimedia.org/r/120470
Change subject: Updates AddBadge.php
......................................................................
Updates AddBadge.php
Change-Id: I192d7a9b3963056f62ffd3e0fcd47b3ef6a71bf0
---
M OpenBadges.i18n.php
M manage/AddBadge.php
2 files changed, 44 insertions(+), 38 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/OpenBadges
refs/changes/70/120470/1
diff --git a/OpenBadges.i18n.php b/OpenBadges.i18n.php
index 41760b7..1b627f8 100644
--- a/OpenBadges.i18n.php
+++ b/OpenBadges.i18n.php
@@ -17,6 +17,13 @@
'ob-addbadge-submit' => 'Add Badge to Database',
'ob-manager-header' => 'Use this special page to add/edit/modify badge
assignments to users.',
'ob-viewbadges-header' => 'Use this page to view the badges a user
has.',
+
+ 'addbadge' => "Add a Badge",
+ 'addbadge-desc' => "",
+ 'viewbadges' => "View Badges",
+ 'viewbadges-desc' => "",
+ 'badgemanager' => "Badge Manager",
+ 'badgemanager-desc' => "",
);
/** Message documentation (Message documentation)
diff --git a/manage/AddBadge.php b/manage/AddBadge.php
index f837abf..9c1a359 100644
--- a/manage/AddBadge.php
+++ b/manage/AddBadge.php
@@ -1,48 +1,47 @@
<?php
-/**
- * OpenBadges special page to add new badge types to the database.
- *
- * @file
- * @ingroup Extensions
- */
-
class AddBadge extends SpecialPage {
- public function __construct() {
+ function __construct() {
parent::__construct( 'AddBadge' );
}
-
- /**
- * Shows the page to the user.
- * @param string $sub: The subpage string argument (if any).
- * [[Special:BadgeManager/subpage]].
- */
- public function execute( $sub ) {
+
+ function execute( $sub ) {
$out = $this->getOutput();
- $out->setPageTitle( $this->msg( 'AddBadge' ) );
- $out->addWikiMsg( 'ob-addbadge-header' );
- $formFields = array(
- 'userfield' => array('label' => 'Name of Badge
to Add',
- 'class' => 'HTMLTextField',
- 'required' => true,
- ),
- 'badgefield' => array('label' => 'More badge
info',
- 'class' => 'HTMLTextField',
- 'required' => true,
- ),
- );
- $htmlForm = new HTMLForm($formFields, $this->getContext() );
- $htmlForm->setSubmitText( 'Add Badge to Database');
- $htmlForm->setSubmitCallback( array( 'AddBadge',
'addBadgeType'));
- $htmlForm->show();
+ $out->setPageTitle($this->msg('AddBadge'));
+ $formFields = array(
+ 'nameoftheAcheivement' => array('label'
=> 'Name of the acheivement',
+ 'class' =>
'HTMLTextField',
+ 'required'
=> true,
+ ),
+
+ 'description' => array('label' =>
'Description of the badge',
+ 'class' =>
'HTMLTextField',
+ 'required'
=> true,
+ ),
+
+ 'Criteria' => array('label' =>
'Criteria of the badge',
+ 'class' =>
'HTMLTextField',
+ 'required'
=> true,
+ ),
+
+ 'Tags' => array('label' => 'Tags of the
badge',
+ 'class' =>
'HTMLTextField',
+ 'required'
=> true,
+ ),
+);
+
+ $htmlForm = new HTMLForm($formFields, $this->getContext() );
+ $htmlForm->setSubmitText('Create a badge');
+ $htmlForm->setSubmitCallBack( array('CreateBadge', 'addBadge'));
+ $htmlForm->show();
}
- # TODO: Load Database table, then:
- # TODO: Add DB logic to add a new badge to the database
- static function addBadgeType( $formInput ) {
- #return false to redisplay the form, not sure how to 'refresh'
the page
- return false;
- }
-
+ static function addBadge($formInput) {
+ return false;
+ }
+
+
+
}
+
--
To view, visit https://gerrit.wikimedia.org/r/120470
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I192d7a9b3963056f62ffd3e0fcd47b3ef6a71bf0
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/OpenBadges
Gerrit-Branch: master
Gerrit-Owner: Hchuying <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits