r1998 - in branches/milestone_43.x/wpi/extensions: CreatePathwayPage Pathways

0 views
Skip to first unread message

martijn....@bigcat.unimaas.nl

unread,
Apr 26, 2017, 9:00:24 PM4/26/17
to wikipathw...@googlegroups.com
Author: AlexanderPico
Date: Thu Apr 27 04:59:13 2017
New Revision: 1998

Log:
fixed CreatePathway and moved Description up

Modified:
branches/milestone_43.x/wpi/extensions/CreatePathwayPage/CreatePathwayPage_body.php
branches/milestone_43.x/wpi/extensions/Pathways/PathwayPage.php

Modified: branches/milestone_43.x/wpi/extensions/CreatePathwayPage/CreatePathwayPage_body.php
==============================================================================
--- branches/milestone_43.x/wpi/extensions/CreatePathwayPage/CreatePathwayPage_body.php (original)
+++ branches/milestone_43.x/wpi/extensions/CreatePathwayPage/CreatePathwayPage_body.php Thu Apr 27 04:59:13 2017
@@ -75,7 +75,7 @@
$wgOut->addWikiText("'''Please specify a name with less than 200 characters.'''\n----\n");
$this->showForm($pwName, $pwSpecies, false, $private);
} else {
- $this->startEditor($pwName, $pwSpecies, $private);
+ $this->createPage($pwName, $pwSpecies, $private);
}
} elseif($uploading == '1') { //Upload button pressed
$this->doUpload($uploading, $private2);
@@ -126,14 +126,21 @@
}
}

- function startEditor($pwName, $pwSpecies, $private) {
+ function createPage($pwName, $pwSpecies, $private) {
global $wgRequest, $wgOut, $wpiScriptURL;
$backlink = '<a href="javascript:history.back(-1)">Back</a>';
try {
- $wgOut->addHTML("<div id='applet'></div>");
- $pwTitle = "$pwName:$pwSpecies";
- $new = $private ? 'private' : 'true';
- $wgOut->addWikiText("{{#editApplet:direct|applet|$new|$pwTitle}}");
+ $gpmlData='<?xml version="1.0" encoding="UTF-8"?>'."\n".
+ '<Pathway xmlns="http://pathvisio.org/GPML/2013a" Name="'.$pwName.'" Organism="'.$pwSpecies.'">'."\n".
+ '<Graphics BoardWidth="30.0" BoardHeight="30.0" />'."\n".
+ '<InfoBox CenterX="0.0" CenterY="0.0" />'."\n".
+ '</Pathway>';
+ $pathway = Pathway::createNewPathway($gpmlData);
+ $title = $pathway->getTitleObject();
+ $name = $pathway->getName();
+ if($private2) $pathway->makePrivate($wgUser);
+ $wgOut->addWikiText("'''<font color='green'>Pathway successfully created!</font>'''\n'''Check it out: [[$title|$name]]'''\n----\n");
+ $this->showForm('','',false,'', $uploading, $private2);
} catch(Exception $e) {
$wgOut->addHTML("<B>Error:</B><P>{$e->getMessage()}</P><BR>$backlink</BR>");
return;

Modified: branches/milestone_43.x/wpi/extensions/Pathways/PathwayPage.php
==============================================================================
--- branches/milestone_43.x/wpi/extensions/Pathways/PathwayPage.php (original)
+++ branches/milestone_43.x/wpi/extensions/Pathways/PathwayPage.php Thu Apr 27 04:59:13 2017
@@ -75,8 +75,8 @@
{$this->titleEditor()}
{$this->privateWarning()}
{{Template:PathwayPage:Top}}
-{$this->curationTags()}
{$this->descriptionText()}
+{$this->curationTags()}
{$this->ontologyTags()}
{$this->bibliographyText()}
{{Template:PathwayPage:Bottom}}
Reply all
Reply to author
Forward
0 new messages