Rev | Line | |
---|
[138] | 1 | <?php
|
---|
[541] | 2 | // Block Version: 1.1
|
---|
[138] | 3 | function enhanced_block($options)
|
---|
| 4 | {
|
---|
| 5 | $mydirname = empty( $options[0] ) ? 'xpress' : $options[0] ;
|
---|
| 6 | $this_template = empty( $options[1] ) ? 'db:'.$mydirname.'_enhanced_block.html' : trim( $options[1] );
|
---|
| 7 | $include_file = empty( $options[2] ) ? '' : $options[2] ;
|
---|
| 8 |
|
---|
| 9 | $include_path = dirname(__FILE__) . '/my_' . $include_file . '_block.php';
|
---|
| 10 |
|
---|
[541] | 11 | $file_found = true;
|
---|
[138] | 12 | if (empty($include_file)) {
|
---|
[541] | 13 | $file_found = false;
|
---|
[138] | 14 | $output = __('The include file name to display it is not set.','xpress');
|
---|
[541] | 15 | }
|
---|
| 16 | if (! file_exists($include_path)) {
|
---|
| 17 | $include_path_temp = $include_path;
|
---|
| 18 | $include_path = dirname(dirname(dirname(__FILE__))).'/xpress_default/blocks/my_' . $include_file . '_block.php';
|
---|
| 19 | if (! file_exists($include_path)) {
|
---|
| 20 | $file_found = false;
|
---|
| 21 | $output = sprintf(__('File %s not exist.','xpress'),$include_path_temp);
|
---|
| 22 | }
|
---|
| 23 | }
|
---|
| 24 | if($file_found) {
|
---|
[138] | 25 | ob_start();
|
---|
| 26 | require $include_path;
|
---|
| 27 | $output = ob_get_contents();
|
---|
| 28 | ob_end_clean();
|
---|
[681] | 29 | if (empty($output)) $output = __('Data is Empty','xpress');
|
---|
[138] | 30 | }
|
---|
| 31 | $block['enhanced'] = $output;
|
---|
| 32 | return $block ;
|
---|
| 33 | }
|
---|
| 34 | ?> |
---|
Note: See
TracBrowser
for help on using the repository browser.