| @@ 460-494 (lines=35) @@ | ||
| 457 | ||
| 458 | $origin = LocaliseHelper::getOrigin($name, $client); |
|
| 459 | ||
| 460 | foreach ($tags as $tag) |
|
| 461 | { |
|
| 462 | if (JFile::exists($client_folder . '/' . $tag . '/' . $tag . '.xml')) |
|
| 463 | { |
|
| 464 | if (array_key_exists("$client|$reftag|$name", $this->translations)) |
|
| 465 | { |
|
| 466 | $reftranslation = $this->translations["$client|$reftag|$name"]; |
|
| 467 | ||
| 468 | if (array_key_exists("$client|$tag|$name", $this->translations)) |
|
| 469 | { |
|
| 470 | $this->translations["$client|$tag|$name"]->setProperties(array('refpath' => $reftranslation->path, 'state' => 'inlanguage')); |
|
| 471 | } |
|
| 472 | else |
|
| 473 | { |
|
| 474 | $path = constant('LOCALISEPATH_' . strtoupper($client)) . "/language/$tag/$tag.$name.ini"; |
|
| 475 | $translation = new JObject( |
|
| 476 | array( |
|
| 477 | 'type' => '', |
|
| 478 | 'tag' => $tag, |
|
| 479 | 'client' => $client, |
|
| 480 | 'storage' => 'global', |
|
| 481 | 'filename' => $name, |
|
| 482 | 'name' => $name, |
|
| 483 | 'refpath' => $reftranslation->path, |
|
| 484 | 'path' => $path, |
|
| 485 | 'state' => 'unexisting', |
|
| 486 | 'writable' => LocaliseHelper::isWritable($path), |
|
| 487 | 'origin' => 'core' |
|
| 488 | ) |
|
| 489 | ); |
|
| 490 | $this->translations["$client|$tag|$name"] = $translation; |
|
| 491 | } |
|
| 492 | } |
|
| 493 | } |
|
| 494 | } |
|
| 495 | ||
| 496 | if (preg_match("/^$reftag\.(lib.*)\.ini$/", $file, $matches)) |
|
| 497 | { |
|
| @@ 501-535 (lines=35) @@ | ||
| 498 | $name = $matches[1]; |
|
| 499 | $origin = LocaliseHelper::getOrigin($name, $client); |
|
| 500 | ||
| 501 | foreach ($tags as $tag) |
|
| 502 | { |
|
| 503 | if (JFile::exists($client_folder . '/' . $tag . '/' . $tag . '.xml')) |
|
| 504 | { |
|
| 505 | if (array_key_exists("$client|$reftag|$name", $this->translations)) |
|
| 506 | { |
|
| 507 | $reftranslation = $this->translations["$client|$reftag|$name"]; |
|
| 508 | ||
| 509 | if (array_key_exists("$client|$tag|$name", $this->translations)) |
|
| 510 | { |
|
| 511 | $this->translations["$client|$tag|$name"]->setProperties(array('refpath' => $reftranslation->path, 'state' => 'inlanguage')); |
|
| 512 | } |
|
| 513 | else |
|
| 514 | { |
|
| 515 | $path = constant('LOCALISEPATH_' . strtoupper($client)) . "/language/$tag/$tag.$name.ini"; |
|
| 516 | $translation = new JObject( |
|
| 517 | array( |
|
| 518 | 'type' => 'library', |
|
| 519 | 'tag' => $tag, |
|
| 520 | 'client' => $client, |
|
| 521 | 'storage' => 'global', |
|
| 522 | 'filename' => $name, |
|
| 523 | 'name' => $name, |
|
| 524 | 'refpath' => $reftranslation->path, |
|
| 525 | 'path' => $path, |
|
| 526 | 'state' => 'unexisting', |
|
| 527 | 'writable' => LocaliseHelper::isWritable($path), |
|
| 528 | 'origin' => '_thirdparty' |
|
| 529 | ) |
|
| 530 | ); |
|
| 531 | $this->translations["$client|$tag|$name"] = $translation; |
|
| 532 | } |
|
| 533 | } |
|
| 534 | } |
|
| 535 | } |
|
| 536 | } |
|
| 537 | elseif (preg_match("/^$reftag\.(pkg.*)\.ini$/", $file, $matches)) |
|
| 538 | { |
|
| @@ 542-576 (lines=35) @@ | ||
| 539 | $name = $matches[1]; |
|
| 540 | $origin = LocaliseHelper::getOrigin($name, $client); |
|
| 541 | ||
| 542 | foreach ($tags as $tag) |
|
| 543 | { |
|
| 544 | if (JFile::exists($client_folder . '/' . $tag . '/' . $tag . '.xml')) |
|
| 545 | { |
|
| 546 | if (array_key_exists("$client|$reftag|$name", $this->translations)) |
|
| 547 | { |
|
| 548 | $reftranslation = $this->translations["$client|$reftag|$name"]; |
|
| 549 | ||
| 550 | if (array_key_exists("$client|$tag|$name", $this->translations)) |
|
| 551 | { |
|
| 552 | $this->translations["$client|$tag|$name"]->setProperties(array('refpath' => $reftranslation->path, 'state' => 'inlanguage')); |
|
| 553 | } |
|
| 554 | else |
|
| 555 | { |
|
| 556 | $path = constant('LOCALISEPATH_' . strtoupper($client)) . "/language/$tag/$tag.$name.ini"; |
|
| 557 | $translation = new JObject( |
|
| 558 | array( |
|
| 559 | 'type' => 'package', |
|
| 560 | 'tag' => $tag, |
|
| 561 | 'client' => $client, |
|
| 562 | 'storage' => 'global', |
|
| 563 | 'filename' => $name, |
|
| 564 | 'name' => $name, |
|
| 565 | 'refpath' => $reftranslation->path, |
|
| 566 | 'path' => $path, |
|
| 567 | 'state' => 'unexisting', |
|
| 568 | 'writable' => LocaliseHelper::isWritable($path), |
|
| 569 | 'origin' => '_thirdparty' |
|
| 570 | ) |
|
| 571 | ); |
|
| 572 | $this->translations["$client|$tag|$name"] = $translation; |
|
| 573 | } |
|
| 574 | } |
|
| 575 | } |
|
| 576 | } |
|
| 577 | } |
|
| 578 | elseif (preg_match("/^$reftag\.(finder_cli)\.ini$/", $file, $matches) |
|
| 579 | || preg_match("/^$reftag\.(files_joomla.sys)\.ini$/", $file, $matches) ) |
|