. */ function ryzom_app_render($title, $content, $style='', $files=array(), $homeLink=false) { $c = ''; // get Lua code $c .= ryLua::get(RYZOM_IG); $at_end = ryLua::getEnd(RYZOM_IG); // Render header $title_prefix = ''; if (ON_IPHONE) { $title_prefix = 'Ryzom - '; } if (!RYZOM_IG) $c .= ''."\n"; $c .= ''."\n"; $c .= ' '.$title_prefix.(translation_exists($title)?_t($title):$title).''."\n"; if (!RYZOM_IG) $c .= ' '."\n"; $events = ''; if (!RYZOM_IG) { $c .= ryzom_render_header(); $c .= ryzom_render_header_www(); if (function_exists('newrelic_get_browser_timing_header')) $c .= newrelic_get_browser_timing_header(); if(ON_IPHONE) $events = 'onorientationchange="updateOrientation();" '; } else { #if (!$style) $style='bgcolor="#00000000"'; } if (!RYZOM_IG) { // Javascript $extra_code = ''; if (is_string($files)) $files = array($files); foreach ($files as $file) { $sfile = explode('.', $file); if ($sfile[count($sfile)-1] == 'js') $extra_code .= ' '."\n"; else if ($sfile[count($sfile)-1] == 'css') $extra_code .= ' '."\n"; } $c .= $extra_code; } $c .= ' '."\n"; $c .= ' '."\n"; if (!RYZOM_IG) { $c .= ryzom_render_www(ryzom_render_window($title, $content, $homeLink)); $c .= ''; if (function_exists('newrelic_get_browser_timing_header')) $c .= newrelic_get_browser_timing_footer(); } else { $c .= $content.'
'.ryLogger::getInstance()->getLogs().'
'; } $c .= ''.$at_end; return $c; } function ryzom_render_header() { if (ON_IPHONE) { return ''; } else { return ' '; } } // Call this inside the part if you want to use ryzom_render_www function ryzom_render_header_www() { if (ON_IPHONE) { return ' '; } else { return ' '; } } // Render a Ryzom style window function ryzom_render_window($title, $content, $homeLink=false) { return ryzom_render_window_begin($title, $homeLink) . $content . ryzom_render_window_end(); } function ryzom_render_window_begin($title, $homeLink=false) { if ($homeLink === false) $homeLink = ''._t('home').''; return '
'.(translation_exists($title)?_t($title):$title).$homeLink.'
'; } function ryzom_render_window_end() { global $user; return '
P_'.(isset($user['id'])?$user['id']:'GUEST').':'.(isset( $user['groups'])?implode(':', $user['groups']):'').'
'.ryLogger::getInstance()->getLogs().'

powered by ryzom-api

'; } // Render a webpage using www.ryzom.com style function ryzom_render_www($content) { return ryzom_render_www_begin() . $content . ryzom_render_www_end(); } function ryzom_render_www_begin($url='') { $style1 = 'position: relative; padding-top: 20px; padding-right: 30px; margin-bottom: -3px'; $style2 = 'position: absolute; bottom: 0; right: 0; '; if (ON_IPHONE) { $style1 = 'position: relative; padding-top: 30px; padding-right: 30px; '; $style2 = 'position: fixed; top: 0; right: 0; padding-right: 0px;'; $marginBottom = ''; } if (!$url) { $url_params = parse_query($_SERVER['REQUEST_URI']); unset($url_params['lang']); $url = 'http://'.$_SERVER['HTTP_HOST'].$_SERVER['PHP_SELF'].'?'.http_build_query($url_params); } return '
English French German Spanish Russian
'; } function ryzom_render_www_end() { return '
'; } function _s($tag, $text) { global $ryzom_render_styles, $ryzom_render_tmpls; if (!array_key_exists($tag, $ryzom_render_tmpls)) return $text; if (is_array($text)) return $p = $text; else $p[0] = $text; $p['color1'] = $ryzom_render_styles[$tag][0]; $p['color2'] = $ryzom_render_styles[$tag][1]; $code = '$c = "'.str_replace('"', '\"', $ryzom_render_tmpls[$tag]).'";'; eval($code); return $c; } function ryzom_get_color_style($tag, $color=0) { global $ryzom_render_styles; if (!array_key_exists($tag, $ryzom_render_styles)) return '000000'; return $ryzom_render_styles[$tag][$color]; } function ryzom_set_title($title) { $GLOBALS['ryzom_render_title'] = $title; } function ryzom_get_title() { return $GLOBALS['ryzom_render_title']; } function ryzom_font($text, $color="", $size="") { if (RYZOM_IG) { $color = $color?'color="'.$color.'"':''; $size = $size?'size="'.$size.'"':''; } else { $color = $color?'color:'.$color.';':''; $size = $size?'font-size:'.$size.'pt':''; } return (RYZOM_IG?"":"").$text.''; } function ryzom_render_login_form($char, $aligned=true, $action="") { $c = ''; if ($aligned) { $c .= '
'; $c .= ''; $c .= ''; $c .= ''; if (RYZOM_IG) $c .= ''; else $c .= ''; $c .= ''; } else { $c .= '
'._t('enter_char').'
'._t('enter_password').'
'; $c .= ''; $c .= ''; $c .= ''; if (RYZOM_IG) $c .= ''; else $c .= ''; $c .= ''; } $c .= '
'._t('login').'
'._t('password').'
'; return $c; } function ryzom_dialog_yes_no($desc, $action, $name) { // will append ryzom_dialog=yes|no to url return '
'.(RYZOM_IG?'':''). $desc.'
'; } $GLOBALS['ryzom_render_title'] = defined('APP_NAME')?APP_NAME:'Ryzom'; $ig = (isset($_SERVER['HTTP_USER_AGENT']) && strpos($_SERVER['HTTP_USER_AGENT'], 'Ryzom')) || ryzom_get_param('ig'); // need be set using url param because auth is not done $transparency = $ig?'':''; $ryzom_render_styles = array(); $ryzom_render_tmpls = array(); $ryzom_render_styles['main title'] = array('#222222'.$transparency, '#FFFFFF'); $ryzom_render_tmpls['main title'] = '
 ${p[0]}
'."\n"; $ryzom_render_styles['section'] = array('#555555'.$transparency, '#FFFFFF'); $ryzom_render_tmpls['section'] = '
 ${p[0]}
'."\n"; $ryzom_render_styles['color'] = array('', ''); $ryzom_render_tmpls['color'] = ($ig?'':'').'${p[0]}'; $ryzom_render_styles['link'] = array('#111111', ''); $ryzom_render_tmpls['link'] = '
 ${p[0]}
'."\n"; $ryzom_render_styles['button'] = array('#000000', ''); $ryzom_render_tmpls['button'] = '
 ${p[0]}
'."\n"; $ryzom_render_styles['links'] = array('#111111'.$transparency, ''); $ryzom_render_tmpls['links'] = '
 ${p[0]}
'."\n"; $ryzom_render_styles['back'] = array('#000000'.$transparency, ''); $ryzom_render_tmpls['back'] = '
 «'.'main'.'
 
'; $ryzom_render_styles['highlight'] = array('#55ff55'.$transparency, ''); $ryzom_render_tmpls['highlight'] = '${p[0]}'; $ryzom_render_styles['backlight'] = array('#272727'.$transparency, ''); $ryzom_render_tmpls['backlight'] = '
${p[0]}
'."\n"; $ryzom_render_styles['actionbar'] = array('#555555'.$transparency, ''); $ryzom_render_tmpls['actionbar'] = '${p[0]}'."\n"; $ryzom_render_styles['table'] = array('#050505'.$transparency, '#FFFFFF'); $ryzom_render_tmpls['table'] = '${p[0]}
'."\n"; $ryzom_render_styles['t header'] = array('#111111'.$transparency, '#FFFFFF'); $ryzom_render_tmpls['t header'] = '${p[0]}'."\n"; $ryzom_render_styles['t row 0'] = array('#353535'.$transparency, ''); $ryzom_render_tmpls['t row 0'] = '${p[0]}'."\n"; $ryzom_render_styles['t row 1'] = array('#252525'.$transparency, ''); $ryzom_render_tmpls['t row 1'] = '${p[0]}'."\n"; $ryzom_render_styles['t element'] = array('#FFFFFF'.$transparency, ''); $ryzom_render_tmpls['t element'] = '${p[0]}'; $ryzom_render_styles['log'] = array('#001100'.$transparency, ''); $ryzom_render_tmpls['log'] = '
${p[0]}
'."\n"; $ryzom_render_styles['message'] = array('#445566'.$transparency, '#FFDDAA'); $ryzom_render_tmpls['message'] = '
${p[0]}
'."\n"; $ryzom_render_styles['message warning'] = array('#AA3300'.$transparency, ''); $ryzom_render_tmpls['message warning'] = '

 ${p[0]}

'."\n"; $ryzom_render_styles['message window'] = array('#5555ff'.$transparency, '#7799ff'); $ryzom_render_tmpls['message window'] = ''.''. '
${p[0]}${p[0]}
'."\n"; $ryzom_render_styles['message ask'] = array('#333333'.$transparency, ''); $ryzom_render_tmpls['message ask'] = '
'.($ig?'':'').'${p[0]}
'."\n"; $ryzom_render_styles['message error'] = array('#AA2222'.$transparency, ''); $ryzom_render_tmpls['message error'] = '

 ${p[0]}

'."\n"; $ryzom_render_styles['message debug'] = array('#FFAA22'.$transparency, ''); $ryzom_render_tmpls['message debug'] = '
${p[0]}
'."\n"; $ryzom_render_styles['progress bar'] = array('#FF0000'.$transparency, '#000000'); $ryzom_render_tmpls['progress bar'] = '${p[0]}
 ${p[0]} 
'."\n"; ?>