Template::GetFullPath PHP Method

GetFullPath() public static method

Return the full path to the file.
public static GetFullPath ( string $p_path, string $p_filename ) : string
$p_path string Path of the file starting from the base template directory.
$p_filename string
return string
    public static function GetFullPath($p_path, $p_filename)
    {
        global $Campsite;
        $fileFullPath = $Campsite['TEMPLATE_DIRECTORY'] . $p_path . "/" . $p_filename;
        return $fileFullPath;
    }

Usage Example

Ejemplo n.º 1
0
	camp_html_goto_page("/$ADMIN/templates/new_template.php?Path=".urlencode($f_path));
}

$f_name = strtr($f_name,'?~#%*&|"\'\\/<>', '_____________');

// Set the extension of the new file if it doesnt have one already.
$new_path_info = pathinfo($f_name);
$newExtension = isset($new_path_info["extension"]) ? $new_path_info["extension"] : "";
if (empty($newExtension)) {
	if ($f_name[strlen($f_name)-1] != ".") {
		$f_name .= ".";
	}
	$f_name .= "tpl";
}

$newTempl = Template::GetFullPath($f_path, $f_name);
$ok = 0;

$file_exists = file_exists($newTempl);
if (!$file_exists) {
	$ok = touch ($newTempl);
	Template::UpdateStatus();
	$logtext = getGS('New template $1 created',$f_path."/".$f_name);
	Log::Message($logtext, $g_user->getUserId(), 114);
	camp_html_add_msg($logtext, "ok");
	camp_html_goto_page("/$ADMIN/templates/edit_template.php?f_path=$f_path&f_name=$f_name");
} else {
	camp_html_add_msg(getGS('A file or folder having the name $1 already exists','<b>'.$f_name.'</B>'));
	camp_html_goto_page("/$ADMIN/templates/new_template.php?Path=".urlencode($f_path));
}
All Usage Examples Of Template::GetFullPath