Source

phpHgAdmin / admin / application / helpers / hg_template_helper.php

The default branch has multiple heads

<?php 

function phphg_header()
{
	echo '<link rel="stylesheet" href="' . base_url(). 'static/css/smoothness/jquery-ui-1.8.2.custom.css" type="text/css" />' 
			.'<script type="text/javascript" src="' . base_url(). 'static/js/jquery-1.4.2.min.js"></script>'
			.'<script type="text/javascript" src="' . base_url(). 'static/js/jquery-ui-1.8.2.custom.min.js"></script>'
			.'<link rel="icon" href="'. base_url(). 'static/hgicon.png" type="image/png" /> '
			.'<meta name="robots" content="index, nofollow" /> ';
}

function hgserve_url($uri='')
{
	$ci =& get_instance();
	$profiles = $ci->config->item('profile');
	return $profiles[current_profile()]['hgserve_url'] . $uri;
}

function theme_name()
{
	return get_phphginfo('theme_name');
}

function get_theme_resource($rel_path)
{
	// FIXME do not allow reverse directory traversal
	include(FCPATH . 'themes/'.theme_name().'/'.$rel_path);
}

function get_header()
{
	get_theme_resource('header.php');
}

function get_sidebar()
{
	get_theme_resource('sidebar.php');
}

function get_footer()
{
	get_theme_resource('footer.php');
}

function is_user_authenticated()
{
	$ci =& get_instance();
	return $ci->auth->auth_is_user_authenticated();
}

function is_directory()
{
	return get_phphginfo('pagetype') === 'directory';
}

function is_repo_config()
{
	return get_phphginfo('pagetype') === 'config';
}

function is_repo_browser()
{
	return get_phphginfo('pagetype') == 'browser';
}

function has_messages()
{
	return get_phphginfo('user_msg') !== FALSE;
}

function user_messages()
{
	phphginfo('user_msg');
}

function has_errors()
{
	return get_phphginfo('user_err') !== FALSE;
}

function user_errors()
{
	phphginfo('user_err');
}

function the_title()
{
	phphginfo('title');
}

function user_profiles()
{
	$ci =& get_instance();
	$profiles = $ci->config->item('profile');
	$profiles_arr = array();
	
	if($ci->auth->auth_is_user_authenticated())
	{
		foreach($profiles as $p_name => $profile)
		{
			$profiles_arr[$p_name] = $p_name;
		}
	}
	return $profiles_arr;
}

function current_profile()
{
	return get_phphginfo('profile');
}

function phphginfo($item)
{
	echo get_phphginfo($item);
}

function get_phphginfo($item)
{
	$ci =& get_instance();
	if(isset($ci->load->_ci_cached_vars[$item]))
	{
		return $ci->load->_ci_cached_vars[$item];
	}
	return FALSE;
}