|
@@ 583-594 (lines=12) @@
|
| 580 |
|
$about = self::about($extension_handle); |
| 581 |
|
|
| 582 |
|
// Fields: |
| 583 |
|
if (is_dir(EXTENSIONS . "/{$extension_handle}/fields")) { |
| 584 |
|
foreach (glob(EXTENSIONS . "/{$extension_handle}/fields/field.*.php") as $file) { |
| 585 |
|
$type = preg_replace(array('/^field\./i', '/\.php$/i'), null, basename($file)); |
| 586 |
|
|
| 587 |
|
if (FieldManager::isFieldUsed($type)) { |
| 588 |
|
throw new Exception( |
| 589 |
|
__('The field ‘%s’, provided by the Extension ‘%s’, is currently in use.', array(basename($file), $about['name'])) |
| 590 |
|
. ' ' . __("Please remove it from your sections prior to uninstalling or disabling.") |
| 591 |
|
); |
| 592 |
|
} |
| 593 |
|
} |
| 594 |
|
} |
| 595 |
|
|
| 596 |
|
// Data Sources: |
| 597 |
|
if (is_dir(EXTENSIONS . "/{$extension_handle}/data-sources")) { |
|
@@ 597-608 (lines=12) @@
|
| 594 |
|
} |
| 595 |
|
|
| 596 |
|
// Data Sources: |
| 597 |
|
if (is_dir(EXTENSIONS . "/{$extension_handle}/data-sources")) { |
| 598 |
|
foreach (glob(EXTENSIONS . "/{$extension_handle}/data-sources/data.*.php") as $file) { |
| 599 |
|
$handle = preg_replace(array('/^data\./i', '/\.php$/i'), null, basename($file)); |
| 600 |
|
|
| 601 |
|
if (PageManager::isDataSourceUsed($handle)) { |
| 602 |
|
throw new Exception( |
| 603 |
|
__('The Data Source ‘%s’, provided by the Extension ‘%s’, is currently in use.', array(basename($file), $about['name'])) |
| 604 |
|
. ' ' . __("Please remove it from your pages prior to uninstalling or disabling.") |
| 605 |
|
); |
| 606 |
|
} |
| 607 |
|
} |
| 608 |
|
} |
| 609 |
|
|
| 610 |
|
// Events |
| 611 |
|
if (is_dir(EXTENSIONS . "/{$extension_handle}/events")) { |
|
@@ 611-622 (lines=12) @@
|
| 608 |
|
} |
| 609 |
|
|
| 610 |
|
// Events |
| 611 |
|
if (is_dir(EXTENSIONS . "/{$extension_handle}/events")) { |
| 612 |
|
foreach (glob(EXTENSIONS . "/{$extension_handle}/events/event.*.php") as $file) { |
| 613 |
|
$handle = preg_replace(array('/^event\./i', '/\.php$/i'), null, basename($file)); |
| 614 |
|
|
| 615 |
|
if (PageManager::isEventUsed($handle)) { |
| 616 |
|
throw new Exception( |
| 617 |
|
__('The Event ‘%s’, provided by the Extension ‘%s’, is currently in use.', array(basename($file), $about['name'])) |
| 618 |
|
. ' ' . __("Please remove it from your pages prior to uninstalling or disabling.") |
| 619 |
|
); |
| 620 |
|
} |
| 621 |
|
} |
| 622 |
|
} |
| 623 |
|
|
| 624 |
|
// Text Formatters |
| 625 |
|
if (is_dir(EXTENSIONS . "/{$extension_handle}/text-formatters")) { |
|
@@ 625-636 (lines=12) @@
|
| 622 |
|
} |
| 623 |
|
|
| 624 |
|
// Text Formatters |
| 625 |
|
if (is_dir(EXTENSIONS . "/{$extension_handle}/text-formatters")) { |
| 626 |
|
foreach (glob(EXTENSIONS . "/{$extension_handle}/text-formatters/formatter.*.php") as $file) { |
| 627 |
|
$handle = preg_replace(array('/^formatter\./i', '/\.php$/i'), null, basename($file)); |
| 628 |
|
|
| 629 |
|
if (FieldManager::isTextFormatterUsed($handle)) { |
| 630 |
|
throw new Exception( |
| 631 |
|
__('The Text Formatter ‘%s’, provided by the Extension ‘%s’, is currently in use.', array(basename($file), $about['name'])) |
| 632 |
|
. ' ' . __("Please remove it from your fields prior to uninstalling or disabling.") |
| 633 |
|
); |
| 634 |
|
} |
| 635 |
|
} |
| 636 |
|
} |
| 637 |
|
} |
| 638 |
|
|
| 639 |
|
/** |