|
From: mdw c. <myd...@li...> - 2001-10-12 20:36:38
|
MyDynaWeb CVS committal
Author : sukria
Project : mydynaweb
Module : htdocs
Dir : mydynaweb/htdocs/admin
Modified Files:
db_interface.php
Log Message:
*** New feature : Help System ***
I've made some tools to easily open help files in wmart popup.
To make a link to the appropriate help popu proceed as folling :
include the admin-libs in the script you want to put a help link :
include(DYNA_ROOT . '/include/admin-libs.php');
build the link like that :
$helplink = ("<a href='#' onClick=\"open_popup('".popup_help_url('$topic', $help_section)."');return(false);\">" . translate("HELP", $DBH) . "</a>");
where $topic is the name of the directory that contains the HTML help file in htdocs/help/
and $help_section is the name of the help to open.
Don't forget to include the JavaScript libtool in the HTML output of the script you are written ; like that :
$header = "
<html>
<head>
<script src='js/utils.js'></script>
</head>";
print $header;
To see it in an example (probably more easy to understand :), look at the script htdocs/admin/db_interface.php
Have fun :)
===================================================================
RCS file: /cvsroot/mydynaweb/mydynaweb/htdocs/admin/db_interface.php,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -3 -r1.6 -r1.7
--- db_interface.php 2001/10/10 21:28:17 1.6
+++ db_interface.php 2001/10/12 20:36:07 1.7
@@ -2,6 +2,7 @@
include "../include/mydynaweb.init.php";
include(DYNA_ROOT . '/include/mydynaweb.libs.php');
+include(DYNA_ROOT . '/include/admin-libs.php');
$DBH = new db();
@@ -17,7 +18,21 @@
die();
}
-$header = "<html><head></head><body bgcolor=\"#ffffff\"><p> </p><center><h2>$table</h2><p> </p></center>";
+$helplink = ("<a href='#' onClick=\"open_popup('".popup_help_url('building', $table)."');return(false);\">" . translate("HELP", $DBH) . "</a>");
+
+$header = "
+<html>
+<head>
+<script src='js/utils.js'></script>
+</head>
+<body bgcolor=\"#ffffff\">
+<p> </p>
+<center>
+<h2>$table</h2>
+<p>$helplink</p>
+<p> </p>
+</center>";
+
$footer = "</body></html>";
switch ($MODE)
|