Guest User

Untitled

a guest
Jul 22nd, 2018
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.75 KB | None | 0 0
  1. <?php
  2. // Exit, if script is called directly (must be included via eID in index_ts.php)
  3. if (!defined ('PATH_typo3conf')) die ('Could not access this script directly!');
  4. require_once(t3lib_extMgm::extPath('lang', 'lang.php'));
  5. require_once(PATH_site . 't3lib/class.t3lib_tcemain.php');
  6.  
  7. class tx_knowledge_base_pi1_eID {
  8.  
  9. function init() {
  10. $GLOBALS['LANG'] = t3lib_div::makeInstance('language');
  11. $GLOBALS['LANG']->init('default');
  12. $GLOBALS['LANG']->includeLLFile('EXT:knowledge_base/pi1/locallang_eID.xml');
  13.  
  14. tslib_eidtools::connectDB();
  15. $this->option1 = t3lib_div::_GET('option1');
  16. $this->option2 = t3lib_div::_GET('option2');
  17. $this->option3 = t3lib_div::_GET('option3');
  18. }
  19.  
  20. function main() {
  21.  
  22.  
  23. $where = 'hidden=0 AND deleted=0';
  24. $form .= '
  25. <div id="option1" class="option">
  26. <label for="option1">'.$GLOBALS['LANG']->getLL('option1').'</label>
  27. <select name="option1">
  28. <option></option>';
  29. $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('*','tx_knowledgebase_application',$where);
  30. while($row = mysql_fetch_assoc($res)){
  31. $form .= '<option value="'.$row['uid'].'">'.$row['title'].'</option>';
  32. }
  33. $form .='</select>
  34. </div>
  35. <div id="option2" class="option">
  36. <label for="option2">'.$GLOBALS['LANG']->getLL('option2').'</label>
  37. <select name="option2">
  38. <option></option>';
  39. if($this->option1) {
  40. $where .= ' AND uid='.$this->option1;
  41. }
  42. print $where;
  43. $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('*','tx_knowledgebase_func',$where);
  44.  
  45. while($row = mysql_fetch_assoc($res)){
  46. $form .= '<option value="'.$row['uid'].'">'.$row['title'].'</option>';
  47. }
  48. $form .='</select>
  49. </div>
  50. <div id="option3" class="option">
  51. <label for="option3">'.$GLOBALS['LANG']->getLL('option3').'</label>
  52. <select name="option3" onchange="this.form.submit()">
  53. <option></option>';
  54. $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('*','tx_knowledgebase_con',$where);
  55. while($row = mysql_fetch_assoc($res)){
  56. $form .= '<option value="'.$row['uid'].'">'.$row['title'].'</option>';
  57. }
  58. $form .='</select>
  59. </div>
  60. <div id="jsSubmit">
  61. <img src="typo3conf/ext/knowledge_base/pi1/spinner.gif" width="12px" />'.$GLOBALS['LANG']->getLL('loading').'</div>';
  62.  
  63. echo $form;
  64. }
  65. //if(t3lib_div::_GET('option1')&&t3lib_div::_GET('option1')>0){
  66. //echo "option1 is loaded";
  67. //}else{
  68. }
  69.  
  70. if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/knowledge_base/pi1/class.tx_knowledge_base_pi1_eID.php']) {
  71. include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/knowledge_base/pi1/class.tx_knowledge_base_pi1_eID.php']);
  72. }
  73.  
  74. // Make instance:
  75. $SOBE = t3lib_div::makeInstance('tx_knowledge_base_pi1_eID');
  76. $SOBE->init();
  77. $SOBE->main();
  78. ?>
Add Comment
Please, Sign In to add comment