1<?php 2 3require_once(dirname(__FILE__)."/../pfccommand.class.php"); 4 5class pfcCommand_help extends pfcCommand 6{ 7 var $usage = "/help"; 8 9 function run(&$xml_reponse, $p) 10 { 11 $clientid = $p["clientid"]; 12 $param = $p["param"]; 13 $sender = $p["sender"]; 14 $recipient = $p["recipient"]; 15 $recipientid = $p["recipientid"]; 16 17 $c =& pfcGlobalConfig::Instance(); 18 $u =& pfcUserConfig::Instance(); 19 20 $ignore = array("updatemynick", "getnewmsg", "notice", "getonlinenick", "error", "update", "asknick"); 21 22 $cmdlist = array(); 23 $dh = opendir(dirname(__FILE__)); 24 while (false !== ($file = readdir($dh))) 25 { 26 if (!preg_match("/^([a-z]+).class.php$/i",$file,$res)) continue; 27 if (!in_array($res[1],$ignore)) $cmdlist[] = $res[1]; 28 } 29 closedir($dh); 30 sort($cmdlist); 31 32 $str = _pfc("Here is the command list:")."<br/>"; 33 $str .= implode("<br/>", $cmdlist); 34 35 $xml_reponse->script("pfc.handleResponse('".$this->name."', 'ok', '".$str."');"); 36 } 37} 38 39?>