Xataface 2.0
Xataface Application Framework
actions/get_page_to_translate.php
Go to the documentation of this file.
00001 <?php
00002 
00003 class dataface_actions_get_page_to_translate {
00004 
00005         
00006         function handle($params){
00007                 $app =& Dataface_Application::getInstance();
00008                 if ( !isset($_GET['key']) ) trigger_error("No key specified", E_USER_ERROR);
00009                 
00010                 $sql = "select `value` from `".TRANSLATION_PAGE_TABLE."` where `key` = '".addslashes($_GET['key'])."'";
00011                 $res = mysql_query($sql,$app->db());
00012                 if ( !$res ) trigger_error(mysql_error($app->db()), E_USER_ERROR);
00013                 if ( mysql_num_rows($res) == 0 ) trigger_error("Sorry the specified key was invalid.", E_USER_ERROR);
00014                 list($content) = mysql_fetch_row($res);
00015                 @mysql_free_result($res);
00016                 
00017                 if ( function_exists('tidy_parse_string') ){
00018                         $config = array('show-body-only'=>true, 'output-encoding'=>'utf8');
00019                         
00020                         $html = tidy_repair_string($content, $config, "utf8");
00021                         $content = trim($html);
00022                 }
00023                 
00024                 df_display(array('content'=>$content), 'TranslationPageTemplate.html');
00025                 return true;
00026                 
00027         }
00028 
00029 }
00030 
00031 ?>
 All Data Structures Namespaces Files Functions Variables Enumerations