![]() |
Xataface 2.0
Xataface Application Framework
|
00001 <?php 00012 class dataface_actions_custom { 00013 function handle($params){ 00014 if ( !isset($params['action']['page']) ){ 00015 trigger_error( 00016 df_translate( 00017 'Page not specified', 00018 'No page specified at '.Dataface_Error::printStackTrace(), 00019 array('stack_trace'=>Dataface_Error::printStackTrace()) 00020 ) 00021 , 00022 E_USER_ERROR 00023 ); 00024 } else { 00025 $page = $params['action']['page']; 00026 } 00027 $app =& Dataface_Application::getInstance(); 00028 $pages = $app->getCustomPages(); 00029 if (!isset( $pages[$page] ) ){ 00030 trigger_error( 00031 df_translate( 00032 'Custom page not found', 00033 "Request for custom page '$page' failed because page does not exist in pages directory.". Dataface_Error::printStackTrace(), 00034 array('page'=>$page, 'stack_trace'=>Dataface_Error::printStackTrace()) 00035 ), 00036 E_USER_ERROR 00037 ); 00038 } 00039 ob_start(); 00040 include $pages[$page]; 00041 $out = ob_get_contents(); 00042 ob_end_clean(); 00043 df_display(array('content'=>$out), 'Dataface_Custom_Template.html'); 00044 return true; 00045 } 00046 00047 } 00048 00049 ?>