| Line |   | 
|---|
| 1 | <?php
 | 
|---|
| 2 | function enhanced_block($options)
 | 
|---|
| 3 | {
 | 
|---|
| 4 |         $mydirname = empty( $options[0] ) ? 'xpress' : $options[0] ;
 | 
|---|
| 5 |         $this_template = empty( $options[1] ) ? 'db:'.$mydirname.'_enhanced_block.html' : trim( $options[1] );
 | 
|---|
| 6 |         $include_file = empty( $options[2] ) ? '' : $options[2] ;
 | 
|---|
| 7 |         
 | 
|---|
| 8 |         $include_path = dirname(__FILE__) . '/my_' . $include_file . '_block.php';
 | 
|---|
| 9 | 
 | 
|---|
| 10 |         if (empty($include_file)) {
 | 
|---|
| 11 |                 $output = __('The include file name to display it is not set.','xpress');
 | 
|---|
| 12 |         } else if (! file_exists($include_path)) {
 | 
|---|
| 13 |                 $output = sprintf(__('File %s not exist.','xpress'),$include_path);
 | 
|---|
| 14 |         } else {
 | 
|---|
| 15 |                 ob_start();
 | 
|---|
| 16 |                         require $include_path;
 | 
|---|
| 17 |                         $output = ob_get_contents();
 | 
|---|
| 18 |                 ob_end_clean();
 | 
|---|
| 19 |                 if (empty($output)) $output = __('PHP code error','xpress') . '( ' . $php_code . ' )';
 | 
|---|
| 20 |         }
 | 
|---|
| 21 |         $block['enhanced'] = $output;
 | 
|---|
| 22 |         return $block ; 
 | 
|---|
| 23 | }
 | 
|---|
| 24 | ?> | 
|---|
       
      
      Note: See 
TracBrowser
        for help on using the repository browser.