Skip to content

Commit

Permalink
revert the config var names to be as before the commit #836
Browse files Browse the repository at this point in the history
  • Loading branch information
gesinn-it-ilm committed Aug 14, 2024
1 parent 6fa02c2 commit adc21e5
Show file tree
Hide file tree
Showing 9 changed files with 75 additions and 73 deletions.
3 changes: 3 additions & 0 deletions .phpcs.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@
<exclude name="Generic.Files.OneObjectStructurePerFile.MultipleFound" />
<exclude name="MediaWiki.NamingConventions.ValidGlobalName.allowedPrefix" />
<exclude name="MediaWiki.Usage.ExtendClassUsage.FunctionConfigUsage" />
<exclude name="MediaWiki.Usage.DeprecatedGlobalVariables.Deprecated$wgContLang" />
<exclude name="MediaWiki.WhiteSpace.SpaceBeforeSingleLineComment.NewLineComment" />
<exclude name="MediaWiki.Usage.DeprecatedGlobalVariables.Deprecated$wgTitle" />
</rule>
<rule ref="MediaWiki.NamingConventions.ValidGlobalName">
<properties>
Expand Down
2 changes: 1 addition & 1 deletion SemanticResultFormats.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public static function initExtension( $credits = [] ) {
$GLOBALS['wgExtensionMessagesFiles']['SemanticResultFormats'] = __DIR__ . '/SemanticResultFormats.i18n.php';
$GLOBALS['wgExtensionMessagesFiles']['SemanticResultFormatsMagic'] = __DIR__ . '/SemanticResultFormats.i18n.magic.php';

$GLOBALS['wgSrfgIP'] = __DIR__;
$GLOBALS['srfgIP'] = __DIR__;
$GLOBALS['wgResourceModules'] = array_merge( $GLOBALS['wgResourceModules'], include __DIR__ . "/Resources.php" );
}

Expand Down
16 changes: 8 additions & 8 deletions formats/Exhibit/SRF_Exhibit.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ protected function determineNamespace( $res ) {
}

protected function getResultText( SMWQueryResult $res, $outputmode ) {
global $wgSmIQRunningNumber, $wgScriptPath, $wgGoogleMapsKey, $wgSrfgScriptPath;
global $smwgIQRunningNumber, $wgScriptPath, $wgGoogleMapsKey, $srfgScriptPath;

if ( defined( 'MW_SUPPORTS_RESOURCE_MODULES' ) ) {
SMWOutputs::requireHeadItem( 'exhibit-compat', Html::linkedScript( "$wgScriptPath/common/wikibits.js" ) );
Expand Down Expand Up @@ -140,12 +140,12 @@ protected function getResultText( SMWQueryResult $res, $outputmode ) {
array_unshift( $colstack, 'label' );

if ( self::$exhibitRunningNumber == 0 ) {
$sourcesrc = "var ex_sources = { source" . ( $wgSmIQRunningNumber - 1 ) . ": { id: 'querytable" . $wgSmIQRunningNumber . "' , columns: '" . implode(
$sourcesrc = "var ex_sources = { source" . ( $smwgIQRunningNumber - 1 ) . ": { id: 'querytable" . $smwgIQRunningNumber . "' , columns: '" . implode(
',',
$colstack
) . "'.split(','), hideTable: '1', type: 'Item', label: 'Item', pluralLabel: 'Items' } };";
} else {
$sourcesrc = "sources.source" . $wgSmIQRunningNumber . " = { id: 'querytable" . $wgSmIQRunningNumber . "' , columns: '" . implode(
$sourcesrc = "sources.source" . $smwgIQRunningNumber . " = { id: 'querytable" . $smwgIQRunningNumber . "' , columns: '" . implode(
',',
$colstack
) . "'.split(','), hideTable: '1', type: 'Item', label: 'Item', pluralLabel: 'Items' };";
Expand Down Expand Up @@ -510,16 +510,16 @@ protected function getResultText( SMWQueryResult $res, $outputmode ) {

// To run Exhibit some links to the scripts of the API need to be included in the header

$ExhibitScriptSrc1 = '<script type="text/javascript" src="' . $wgSrfgScriptPath . '/Exhibit/exhibit/exhibit-api.js?autoCreate=false&safe=true&bundle=false';
$ExhibitScriptSrc1 = '<script type="text/javascript" src="' . $srfgScriptPath . '/Exhibit/exhibit/exhibit-api.js?autoCreate=false&safe=true&bundle=false';
if ( $timeline ) {
$ExhibitScriptSrc1 .= '&views=timeline';
}
if ( $map ) {
$ExhibitScriptSrc1 .= '&gmapkey=' . $wgGoogleMapsKey;
}
$ExhibitScriptSrc1 .= '"></script>';
$ExhibitScriptSrc2 = '<script type="text/javascript" src="' . $wgSrfgScriptPath . '/Exhibit/SRF_Exhibit.js"></script>';
$CSSSrc = '<link rel="stylesheet" type="text/css" href="' . $wgSrfgScriptPath . '/Exhibit/SRF_Exhibit.css"></link>';
$ExhibitScriptSrc2 = '<script type="text/javascript" src="' . $srfgScriptPath . '/Exhibit/SRF_Exhibit.js"></script>';
$CSSSrc = '<link rel="stylesheet" type="text/css" href="' . $srfgScriptPath . '/Exhibit/SRF_Exhibit.css"></link>';
// include CSS
SMWOutputs::requireHeadItem( 'CSS', $CSSSrc );
// include Exhibit API
Expand All @@ -529,15 +529,15 @@ protected function getResultText( SMWQueryResult $res, $outputmode ) {
$ExhibitScriptSrc2
);
// includes javascript overwriting the Exhibit start-up functions, include sources variable
SMWOutputs::requireHeadItem( 'SOURCES' . $wgSmIQRunningNumber, $sourcesrc );
SMWOutputs::requireHeadItem( 'SOURCES' . $smwgIQRunningNumber, $sourcesrc );
// include views and facets variable
SMWOutputs::requireHeadItem( 'VIEWSFACETS', $headervars );

if ( !$remote ) {

// print input table
// print header
$result = "<table style=\"display:none\" class=\"smwtable\" id=\"querytable" . $wgSmIQRunningNumber . "\">\n";
$result = "<table style=\"display:none\" class=\"smwtable\" id=\"querytable" . $smwgIQRunningNumber . "\">\n";
if ( $this->mShowHeaders ) {
// building headers
$result .= "\t<tr>\n";
Expand Down
15 changes: 7 additions & 8 deletions formats/JitGraph/SRF_JitGraph.php
Original file line number Diff line number Diff line change
Expand Up @@ -144,8 +144,7 @@ public function getName() {
}

protected function getResultText( SMWQueryResult $res, $outputmode ) {
global $wgOut;
$title = RequestContext::getMain()->getTitle();
global $wgTitle, $wgOut;

if ( class_exists( 'ResourceLoader' ) ) {
$wgOut->addModules( 'ext.srf.jitgraph' );
Expand All @@ -172,7 +171,7 @@ protected function getResultText( SMWQueryResult $res, $outputmode ) {
$firstcolvalue = $object->getShortText( $outputmode );

// Title of the page where the result format is being displayed
$thisPageTitle = $title->getPrefixedText();
$thisPageTitle = $wgTitle->getPrefixedText();

// This little block adds the name of the current edge to the list later used to compile the graph legend
$req = $field->getPrintRequest();
Expand Down Expand Up @@ -314,26 +313,26 @@ protected function includeJS() {

// $wgOut->addModules( 'ext.srf.jitgraph' );

global $wgSrfgScriptPath;
global $srfgScriptPath;

SMWOutputs::requireHeadItem(
'smw_jgcss',
'<link rel="stylesheet" type="text/css" href="' . $wgSrfgScriptPath .
'<link rel="stylesheet" type="text/css" href="' . $srfgScriptPath .
'/JitGraph/base.css"></link>'
);
SMWOutputs::requireHeadItem(
'smw_jgloader',
'<script type="text/javascript" src="' . $wgSrfgScriptPath .
'<script type="text/javascript" src="' . $srfgScriptPath .
'/JitGraph/jquery.progressbar.js"></script>'
);
SMWOutputs::requireHeadItem(
'smw_jg',
'<script type="text/javascript" src="' . $wgSrfgScriptPath .
'<script type="text/javascript" src="' . $srfgScriptPath .
'/JitGraph/Jit/jit.js"></script>'
);
SMWOutputs::requireHeadItem(
'smw_jghelper',
'<script type="text/javascript" src="' . $wgSrfgScriptPath .
'<script type="text/javascript" src="' . $srfgScriptPath .
'/JitGraph/SRF_JitGraph.js"></script>'
);
}
Expand Down
12 changes: 6 additions & 6 deletions formats/array/SRF_Array.php
Original file line number Diff line number Diff line change
Expand Up @@ -439,32 +439,32 @@ public function getParamDefinitions( array $definitions ) {
];

// separators (default values are defined in the following globals:)
global $wgSrfgArraySep, $wgSrfgArrayPropSep, $wgSrfgArrayManySep, $wgSrfgArrayRecordSep, $wgSrfgArrayHeaderSep;
global $srfgArraySep, $srfgArrayPropSep, $srfgArrayManySep, $srfgArrayRecordSep, $srfgArrayHeaderSep;

$params['sep'] = [
'message' => 'smw-paramdesc-sep',
'default' => $this->initializeCfgValue( $wgSrfgArraySep, 'sep' ),
'default' => $this->initializeCfgValue( $srfgArraySep, 'sep' ),
];

$params['propsep'] = [
'message' => 'srf_paramdesc_propsep',
'default' => $this->initializeCfgValue( $wgSrfgArrayPropSep, 'propsep' ),
'default' => $this->initializeCfgValue( $srfgArrayPropSep, 'propsep' ),
];

$params['manysep'] = [
'message' => 'srf_paramdesc_manysep',
'default' => $this->initializeCfgValue( $wgSrfgArrayManySep, 'manysep' ),
'default' => $this->initializeCfgValue( $srfgArrayManySep, 'manysep' ),
];

$params['recordsep'] = [
'message' => 'srf_paramdesc_recordsep',
'default' => $this->initializeCfgValue( $wgSrfgArrayRecordSep, 'recordsep' ),
'default' => $this->initializeCfgValue( $srfgArrayRecordSep, 'recordsep' ),
'aliases' => [ 'narysep', 'rcrdsep', 'recsep' ],
];

$params['headersep'] = [
'message' => 'srf_paramdesc_headersep',
'default' => $this->initializeCfgValue( $wgSrfgArrayHeaderSep, 'headersep' ),
'default' => $this->initializeCfgValue( $srfgArrayHeaderSep, 'headersep' ),
'aliases' => [ 'narysep', 'rcrdsep', 'recsep' ],
];

Expand Down
20 changes: 10 additions & 10 deletions formats/calendar/SRF_Calendar.php
Original file line number Diff line number Diff line change
Expand Up @@ -316,8 +316,8 @@ public function formatDateStr( $object ) {
}

public function displayCalendar( $events ) {
global $wgSrfgFirstDayOfWeek;
global $wgSrfgScriptPath;
global $srfgFirstDayOfWeek;
global $srfgScriptPath;

$context = RequestContext::getMain();
$request = $context->getRequest();
Expand All @@ -332,7 +332,7 @@ public function displayCalendar( $events ) {
'rel' => 'stylesheet',
'type' => 'text/css',
'media' => 'screen, print',
'href' => $wgSrfgScriptPath
'href' => $srfgScriptPath
. '/formats/calendar/resources/ext.srf.calendar.css'
]
);
Expand Down Expand Up @@ -385,16 +385,16 @@ public function displayCalendar( $events ) {
6 => wfMessage( 'friday' )->text(),
7 => wfMessage( 'saturday' )->text()
];
if ( empty( $wgSrfgFirstDayOfWeek ) ) {
if ( empty( $srfgFirstDayOfWeek ) ) {
$firstDayOfWeek = 1;
$lastDayOfWeek = 7;
} else {
$firstDayOfWeek =
array_search( $wgSrfgFirstDayOfWeek, $weekDayNames );
array_search( $srfgFirstDayOfWeek, $weekDayNames );
if ( $firstDayOfWeek === false ) {
// Bad value for $wgSrfgFirstDayOfWeek!
print 'Warning: Bad value for $wgSrfgFirstDayOfWeek "' .
'(' . $wgSrfgFirstDayOfWeek . '")';
// Bad value for $srfgFirstDayOfWeek!
print 'Warning: Bad value for $srfgFirstDayOfWeek "' .
'(' . $srfgFirstDayOfWeek . '")';
$firstDayOfWeek = 1;
}
if ( $firstDayOfWeek == 1 ) {
Expand Down Expand Up @@ -516,10 +516,10 @@ public function displayCalendar( $events ) {
<table class="navigation_table">
<tr><td class="month_name">$curMonth $curYear</td>
<td class="nav_links"><a href="$prevMonthUrl" title="$prevMonthText">
<img src="{$wgSrfgScriptPath}/formats/calendar/resources/images/left-arrow.png" border="0" />
<img src="{$srfgScriptPath}/formats/calendar/resources/images/left-arrow.png" border="0" />
</a>&#160;<a href="$todayUrl">$todayText</a>&#160;
<a href="$nextMonthUrl" title="$nextMonthText">
<img src="{$wgSrfgScriptPath}/formats/calendar/resources/images/right-arrow.png" border="0" />
<img src="{$srfgScriptPath}/formats/calendar/resources/images/right-arrow.png" border="0" />
</a></td><td class="nav_form"><form>
<input type="hidden" name="title" value="$pageName">
<select name="month">
Expand Down
58 changes: 29 additions & 29 deletions formats/graphviz/SRF_Process.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@

// global variable defining picture path

$wgSrfgPicturePath = "formats/graphviz/images/";
$srfgPicturePath = "formats/graphviz/images/";

class SRFProcess extends SMWResultPrinter {

Expand Down Expand Up @@ -204,8 +204,8 @@ protected function getResultText( SMWQueryResult $res, $outputmode ) {
wfWarn( 'The SRF Graph printer needs the Diagrams or GraphViz extension to be installed.' );
return '';
}
// content language object
$lang = RequestContext::getMain()->getLanguage();

global $wgContLang; // content language object

//
// GraphViz settings
Expand Down Expand Up @@ -250,13 +250,13 @@ protected function getResultText( SMWQueryResult $res, $outputmode ) {
$req = $field->getPrintRequest();
switch ( ( strtolower( $req->getLabel() ) ) ) {

case strtolower( $lang->getNsText( NS_CATEGORY ) ):
case strtolower( $wgContLang->getNsText( NS_CATEGORY ) ):
foreach ( $field->getContent() as $value ) {
$wikiPageValue = new SMWWikiPageValue( '_wpg' );
$wikiPageValue->setDataItem( $value );
$val = $wikiPageValue->getShortWikiText();

if ( $val == ( $lang->getNsText( NS_CATEGORY ) . ':' . $this->m_processCategory ) ) {
if ( $val == ( $wgContLang->getNsText( NS_CATEGORY ) . ':' . $this->m_processCategory ) ) {
$node->setAtomic( false );
}
}
Expand Down Expand Up @@ -957,19 +957,19 @@ public function setAtomic( $atomic ) {
}

public function getGraphVizCode() {
global $wgIP, $wgSrfgPicturePath, $wgSrfgIP;
global $IP, $srfgPicturePath, $srfgIP;
//
// show node status
//
$status = '';
if ( $this->getProcess()->getShowStatus() ) {

if ( file_exists( $wgIP . "/images/p000.png" ) ) {
$PicturePath = $wgIP . "/images/";
} elseif ( file_exists( $wgSrfgIP . "/formats/graphviz/images/p000.png" ) ) {
$PicturePath = $wgSrfgIP . "/formats/graphviz/images/";
if ( file_exists( $IP . "/images/p000.png" ) ) {
$PicturePath = $IP . "/images/";
} elseif ( file_exists( $srfgIP . "/formats/graphviz/images/p000.png" ) ) {
$PicturePath = $srfgIP . "/formats/graphviz/images/";
} else {
$PicturePath = $wgIP . $wgSrfgPicturePath;
$PicturePath = $IP . $srfgPicturePath;
}
// $color = 'grey' . $this->getStatus();
// $color = 'grey' . rand(1, 100);
Expand Down Expand Up @@ -1001,12 +1001,12 @@ public function getGraphVizCode() {
$discussion = '';
if ( $this->getProcess()->getShowDiscussion() ) {

if ( file_exists( $wgIP . "/images/discuss_icon.png" ) ) {
$PicturePath = $wgIP . "/images/";
} elseif ( file_exists( $wgSrfgIP . "/formats/graphviz/images/discuss_icon.png" ) ) {
$PicturePath = $wgSrfgIP . "/formats/graphviz/images/";
if ( file_exists( $IP . "/images/discuss_icon.png" ) ) {
$PicturePath = $IP . "/images/";
} elseif ( file_exists( $srfgIP . "/formats/graphviz/images/discuss_icon.png" ) ) {
$PicturePath = $srfgIP . "/formats/graphviz/images/";
} else {
$PicturePath = $wgIP . $wgSrfgPicturePath;
$PicturePath = $IP . $srfgPicturePath;
}
$discussionTitle = Title::newFromText( 'Talk:' . $this->getId() . '' );
if ( $discussionTitle->isKnown() ) {
Expand All @@ -1028,12 +1028,12 @@ public function getGraphVizCode() {
// insert icon for non-atomic nodes (i.e. subprocesses)
$compound = '<TR><TD ALIGN="LEFT" BORDER="0" WIDTH="20px">';
if ( $this->getProcess()->getShowCompound() ) {
if ( file_exists( $wgIP . "/images/subprocess.png" ) ) {
$PicturePath = $wgIP . "/images/";
} elseif ( file_exists( $wgSrfgIP . "/formats/graphviz/images/subprocess.png" ) ) {
$PicturePath = $wgSrfgIP . "/formats/graphviz/images/";
if ( file_exists( $IP . "/images/subprocess.png" ) ) {
$PicturePath = $IP . "/images/";
} elseif ( file_exists( $srfgIP . "/formats/graphviz/images/subprocess.png" ) ) {
$PicturePath = $srfgIP . "/formats/graphviz/images/";
} else {
$PicturePath = $wgIP . $wgSrfgPicturePath;
$PicturePath = $IP . $srfgPicturePath;
}
if ( !$this->isAtomic() ) {
$compound = '<TR><TD ALIGN="LEFT" BORDER="0" WIDTH="20px" HREF="[[' . $this->getId(
Expand Down Expand Up @@ -1267,11 +1267,11 @@ public function getGraphVizCode() {
class SplitExclusiveOrEdge extends SplitEdge {

public function getGraphVizCode() {
global $wgSrfgShapeStyle;
global $srfgShapeStyle;
$p = $this->getPred();
$p = $p[0];
if ( $wgSrfgShapeStyle == '' ) {
$wgSrfgShapeStyle = "box";
if ( $srfgShapeStyle == '' ) {
$srfgShapeStyle = "box";
}
$res =
'subgraph "clus_' . $this->getId() . '" {
Expand All @@ -1280,7 +1280,7 @@ public function getGraphVizCode() {
// add OR-Shape
$orx = 'or' . rand( 1, 99999 );
$res .=
'"' . $orx . '"[shape=' . $wgSrfgShapeStyle . ',label="+",style=filled,color=gold];
'"' . $orx . '"[shape=' . $srfgShapeStyle . ',label="+",style=filled,color=gold];
"' . $p->getId() . '":port1:s -> "' . $orx . '";
';

Expand All @@ -1306,9 +1306,9 @@ public function getGraphVizCode() {
class SplitParallelEdge extends SplitEdge {

public function getGraphVizCode() {
global $wgSrfgShapeStyle;
if ( $wgSrfgShapeStyle == '' ) {
$wgSrfgShapeStyle = "box";
global $srfgShapeStyle;
if ( $srfgShapeStyle == '' ) {
$srfgShapeStyle = "box";
}
$p = $this->getPred();
$p = $p[0];
Expand All @@ -1320,7 +1320,7 @@ public function getGraphVizCode() {
// add AND-Shape
$and = 'and' . rand( 1, 99999 );
$res .=
'"' . $and . '"[shape=' . $wgSrfgShapeStyle . ',label="||",style=filled,color=palegreen];
'"' . $and . '"[shape=' . $srfgShapeStyle . ',label="||",style=filled,color=palegreen];
"' . $p->getId() . '":port1:s -> "' . $and . '";
';

Expand Down
Loading

0 comments on commit adc21e5

Please sign in to comment.