- // Provided array could not be found we try to guess it.
-
- # Using the extension path ($m[1]) and filename ($m[2]):
- $m = array();
- preg_match( '%.*/(.*)/(.*).i18n\.php%', $this->mExt18nFilename, $m);
- $arPathCandidate = 'wg' . $m[1].'Messages';
- $arFileCandidate = 'wg' . $m[2].'Messages';
- $funcCandidate = "ef{$m[2]}Messages";
-
- // Try them:
- if( isset($$arPathCandidate) && is_array( $$arPathCandidate ) ) {
- print "warning> messages from guessed path array \$$arPathCandidate.\n";
- $foundarray = $$arPathCandidate;
- } elseif( isset($$arFileCandidate) && is_array( $$arFileCandidate ) ) {
- print "warning> messages from guessed file array \$$arFileCandidate.\n";
- $foundarray = $$arFileCandidate;
- } elseif( function_exists( $funcCandidate ) ) {
- print "warning> messages build from guessed function {$funcCandidate}().\n";
- $foundarray = $funcCandidate();
+
+ /* For extensions included elsewhere. For some reason other extensions
+ * break with the global statement, so recheck here.
+ */
+ global ${$this->mExtArrayName};
+ if( isset( ${$this->mExtArrayName} ) ) {
+ $foundarray = ${$this->mExtArrayName};
+ }
+
+ if(!$foundarray) {
+ // Provided array could not be found we try to guess it.
+
+ # Using the extension path ($m[1]) and filename ($m[2]):
+ $m = array();
+ preg_match( '%.*/(.*)/(.*).i18n\.php%', $this->mExt18nFilename, $m);
+ $arPathCandidate = 'wg' . $m[1].'Messages';
+ $arFileCandidate = 'wg' . $m[2].'Messages';
+ $funcCandidate = "ef{$m[2]}Messages";
+
+ // Try them:
+ if( isset($$arPathCandidate) && is_array( $$arPathCandidate ) ) {
+ print "warning> messages from guessed path array \$$arPathCandidate.\n";
+ $foundarray = $$arPathCandidate;
+ } elseif( isset($$arFileCandidate) && is_array( $$arFileCandidate ) ) {
+ print "warning> messages from guessed file array \$$arFileCandidate.\n";
+ $foundarray = $$arFileCandidate;
+ } elseif( function_exists( $funcCandidate ) ) {
+ print "warning> messages build from guessed function {$funcCandidate}().\n";
+ $foundarray = $funcCandidate();
+ }