
//  Copyright 2001 Jamie McClelland, pagetool@mediajumpstart.org

/*
    This file is part of the Pagetool Administrator Manual Installer, a
    plugin for Pagetool.

    The Pagetool Administrator Manual Installer, like Pagetool, is free
    software; you can redistribute it and/or modify it under the
    terms of the GNU General Public License as published by
    the Free Software Foundation; either version 2 of the License, or
    (at your option) any later version.
*/

// First, insert the help file into pt_core_wwwpages

// Open the source file
$filename = $plugins_dir . "pt_admin_man_en/pt_admin_man_en.src";
$fd = fopen ($filename, "r");
$contents = fread ($fd, filesize ($filename));
fclose ($fd);

// Set the variables to be inserted into the table
$new_name="pt_admin_man_en";
$new_title="Pagetool Administrator Manual (en)";
$new_category="pt_help";
$new_code_type="html";
$new_html = addslashes($contents);
$new_username="admin";

// Create the sql statement
$sql="insert into pt_core_wwwpages (name,title,category,code_type,html,username,tstamp) values('$new_name','$new_title','$new_category','$new_code_type','$new_html','$new_username',now())";

// Execute the sql statement and check for errors.
pt_query($sql);
pt_errcheck("Pagetool Administrator Manual (en) $str_plugin_added_to_wwwpages");
echo "<br>";

// Now, insert the plugin into pt_core_plugins.
$sql="insert into pt_core_plugins (name, type) values('pt_admin_man_en','app')";
pt_query($sql);
pt_errcheck("Pagetool Administrator Manual (en) $str_plugin_added_to_plugins");
echo "<br><br>";

// Now echo a post-installation message
if ($install_message!="n") {
	echo "The Pagetool Administrator Manual has been installed. You can view it by 
     clicking the help link from within the admin section.<br><br>";
}
