Documentation is available at menu.php
- <?php
- /*
- Program E related AIML knowledgebase tools
- Copyright 2004, Anne Kootstra [anne@aiml.info]
- http://www.AIML.info
- Program E 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.
- Program E is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
- You should have received a copy of the GNU General Public License
- along with Program E; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
- require_once "../admin/botloaderfuncs.php";
- require_once "include/menu.inc.php";
- require_once "include/common.inc.php";
- getRequest("pat_id", 0);
- getRequest("word_path", 0);
- getRequest("botid", 0);
- getRequest("pid", 0);
- $word_path = "a";
- //$botid = 1;
- // routine to create the bot selection list.
- $botnames = getbotnames();
- while(list($key, $val) = each($botnames)) {
- if($botid == $key){
- $bots .= "<option value=\"$key\" selected>$val</option>";
- }else{
- $bots .= "<option value=\"$key\">$val</option>";
- }
- }
- // auto select a previously selected bot.
- if(!$botid) {
- $page['{{bots}}'] = $bots;
- echo useTemplate('botselect',$page);
- return;
- }
- if (!$pid) {
- $pid = 1;
- }
- //$result2 = getNode('I am your', '1', $pid);
- //$result = getFirstWords($word_path, $botid, $pid);
- $result = getFirstWords($word_path, $botid, $pid);
- $resultTable .= "<table>\n";
- $resultTable .= "<tr>\n";
- $resultTable .= "<td colspan=\"2\">word</td>\n";
- $resultTable .= "<td>isend</td>\n";
- $resultTable .= "<td>no. nodes</td>\n";
- $resultTable .= "<td>template ID</td>\n";
- $resultTable .= "<td>max words</td>\n";
- $resultTable .= "<td>word</td>\n";
- $resultTable .= "<tr>\n";
- while(list($key, $val) = each($result)) {
- $sub = 0;
- $crap['{{WORD}}'] = strtolower($val);
- $crap['{{SUB}}'] = strtolower($val);
- $resultTable .= useTemplate('menu.mainnode',$crap);
- $fred = $word_path." ".$val;
- $result2 = getNode($val, $botid, $pid);
- if(is_array($result2)) {
- while(list($key2, $val2) = each($result2)) {
- $crap['{{SUB}}'] = strtolower($val)."-".$sub;
- $crap['{{NODE}}'] = strtolower($val2['word']);
- $crap['{{ISEND}}'] = $val2['isend'];
- $crap['{{NO_NODES}}'] = $val2['no_nodes'];
- $crap['{{TEMPLATE_ID}}'] = $val2['template_id'];
- $crap['{{MAX_WORDS}}'] = $val2['max_words'];
- $resultTable .= useTemplate('menu.subnode',$crap);
- $sub++;
- }
- }
- }
- $resultTable .= "</table>";
- $word_table['{{botid}}'] = $botid;
- $word_table['{{botname}}'] = getBotName($botid);
- $word_table['{{word_path}}'] = $word_path."<br>" ;
- $word_table['{{pid}}'] = $pid;
- $word_table['{{wordtable}}'] = $resultTable;
- echo useTemplate('menu',$word_table);
- ?>
Documentation generated on Tue, 11 Jan 2005 18:41:08 +0100 by phpDocumentor 1.3.0RC3