  |
1 | 1 | | <?php |
| |
2 | 2 | | /* |
  |
3 | | - | $Id: services.php 151 2005-08-02 14:33:25Z mattice $ |
| |
| 3 | + | $Id: services.php 368 2005-12-22 16:27:23Z hpdl $ |
|
4 | 4 | | |
| |
5 | 5 | | osCommerce, Open Source E-Commerce Solutions |
| |
6 | 6 | | http://www.oscommerce.com |
| |
|
|
 |
… |
|
12 | 12 | | |
| |
13 | 13 | | class osC_Services { |
| |
14 | 14 | | var $services, |
  |
15 | | - | $started_services; |
| |
| 15 | + | $started_services, |
| |
| 16 | + | $call_before_page_content = array(), |
| |
| 17 | + | $call_after_page_content = array(); |
|
16 | 18 | | |
| |
17 | 19 | | function osC_Services() { |
| |
18 | 20 | | $this->services = explode(';', MODULE_SERVICES_INSTALLED); |
| |
|
|
 |
… |
|
44 | 46 | | } |
| |
45 | 47 | | |
| |
46 | 48 | | function startService($service) { |
  |
47 | | - | include('includes/modules/services/' . $service . '.php'); |
| |
| 49 | + | include('includes/services/' . $service . '.php'); |
|
48 | 50 | | |
| |
49 | 51 | | if (@call_user_func(array('osC_Services_' . $service, 'start'))) { |
| |
50 | 52 | | $this->started_services[] = $service; |
| |
|
|
 |
… |
|
59 | 61 | | function isStarted($service) { |
| |
60 | 62 | | return in_array($service, $this->started_services); |
| |
61 | 63 | | } |
  |
| 64 | + | |
| |
| 65 | + | function addCallBeforePageContent($object, $method) { |
| |
| 66 | + | $this->call_before_page_content[] = array($object, $method); |
| |
| 67 | + | } |
| |
| 68 | + | |
| |
| 69 | + | function addCallAfterPageContent($object, $method) { |
| |
| 70 | + | $this->call_after_page_content[] = array($object, $method); |
| |
| 71 | + | } |
| |
| 72 | + | |
| |
| 73 | + | function hasBeforePageContentCalls() { |
| |
| 74 | + | return !empty($this->call_before_page_content); |
| |
| 75 | + | } |
| |
| 76 | + | |
| |
| 77 | + | function hasAfterPageContentCalls() { |
| |
| 78 | + | return !empty($this->call_after_page_content); |
| |
| 79 | + | } |
| |
| 80 | + | |
| |
| 81 | + | function getCallBeforePageContent() { |
| |
| 82 | + | return $this->call_before_page_content; |
| |
| 83 | + | } |
| |
| 84 | + | |
| |
| 85 | + | function getCallAfterPageContent() { |
| |
| 86 | + | return $this->call_after_page_content; |
| |
| 87 | + | } |
  |
62 | 88 | | } |
| |
63 | 89 | | ?> |