apps.php 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  1. <?php
  2. /*
  3. FusionPBX
  4. Version: MPL 1.1
  5. The contents of this file are subject to the Mozilla Public License Version
  6. 1.1 (the "License"); you may not use this file except in compliance with
  7. the License. You may obtain a copy of the License at
  8. http://www.mozilla.org/MPL/
  9. Software distributed under the License is distributed on an "AS IS" basis,
  10. WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
  11. for the specific language governing rights and limitations under the
  12. License.
  13. The Original Code is FusionPBX
  14. The Initial Developer of the Original Code is
  15. Mark J Crane <[email protected]>
  16. Portions created by the Initial Developer are Copyright (C) 2008-2012
  17. the Initial Developer. All Rights Reserved.
  18. Contributor(s):
  19. Mark J Crane <[email protected]>
  20. */
  21. require_once "root.php";
  22. require_once "includes/require.php";
  23. require_once "includes/checkauth.php";
  24. if (if_group("admin") || if_group("superadmin")) {
  25. //access granted
  26. }
  27. else {
  28. echo "access denied";
  29. exit;
  30. }
  31. require_once "includes/header.php";
  32. require_once "includes/paging.php";
  33. //get variables used to control the order
  34. $order_by = $_GET["order_by"];
  35. $order = $_GET["order"];
  36. //get the list of installed apps from the core and mod directories
  37. $config_list = glob($_SERVER["DOCUMENT_ROOT"] . PROJECT_PATH . "/*/*/app_config.php");
  38. $x=0;
  39. foreach ($config_list as $config_path) {
  40. include($config_path);
  41. $x++;
  42. }
  43. //show the content
  44. echo "<div align='center'>";
  45. echo "<table width='100%' border='0' cellpadding='0' cellspacing='2'>\n";
  46. echo "<tr class='border'>\n";
  47. echo " <td align=\"center\">\n";
  48. echo " <br />";
  49. echo "<table width='100%' border='0'>\n";
  50. echo " <tr>\n";
  51. echo " <td width='50%' align='left' nowrap><b>App Manager</b></td>\n";
  52. echo " <td width='50%' align='right'>&nbsp;</td>\n";
  53. echo " </tr>\n";
  54. echo " <tr>\n";
  55. echo " <td align='left' colspan='2'>\n";
  56. echo " Manage the applications that are installed.<br /><br />\n";
  57. echo " </td>\n";
  58. echo " </tr>\n";
  59. echo "</table>\n";
  60. $c = 0;
  61. $row_style["0"] = "row_style0";
  62. $row_style["1"] = "row_style1";
  63. echo "<div align='center'>\n";
  64. echo "<table width='100%' border='0' cellpadding='0' cellspacing='0'>\n";
  65. echo "<tr>\n";
  66. echo " <th>Name</th>\n";
  67. echo " <th>Category</th>\n";
  68. echo " <th>Subcategory</th>\n";
  69. echo " <th>Version</th>\n";
  70. echo " <th>Description</th>\n";
  71. //echo "<td align='right' width='42'>\n";
  72. //echo " <a href='apps_edit.php' alt='add'>$v_link_label_add</a>\n";
  73. //echo "</td>\n";
  74. echo "<tr>\n";
  75. foreach($apps as $row) {
  76. if ($row['uuid'] != "d8704214-75a0-e52f-1336-f0780e29fef8") {
  77. echo "<tr >\n";
  78. echo " <td valign='top' class='".$row_style[$c]."' nowrap='nowrap'>".$row['name']."&nbsp;</td>\n";
  79. echo " <td valign='top' class='".$row_style[$c]."'>".$row['category']."&nbsp;</td>\n";
  80. echo " <td valign='top' class='".$row_style[$c]."'>".$row['subcategory']."&nbsp;</td>\n";
  81. echo " <td valign='top' class='".$row_style[$c]."'>".$row['version']."&nbsp;</td>\n";
  82. echo " <td valign='top' class='".$row_style[$c]."' width='35%'>".$row['description']['en']."&nbsp;</td>\n";
  83. echo " <td valign='top' align='left' nowrap='nowrap' width='42'>\n";
  84. echo " &nbsp;<a href='apps_edit.php?id=".$row['uuid']."' alt='edit'>$v_link_label_edit</a>\n";
  85. echo " <a href='apps_delete.php?id=".$row['uuid']."' alt='delete' onclick=\"return confirm('Do you really want to delete this?')\">$v_link_label_delete</a>\n";
  86. echo " </td>\n";
  87. echo "</tr>\n";
  88. }
  89. if ($c==0) { $c=1; } else { $c=0; }
  90. } //end foreach
  91. unset($sql, $result, $row_count);
  92. echo "</table>";
  93. echo "</div>";
  94. echo "<br /><br />";
  95. echo "<br /><br />";
  96. echo "</td>";
  97. echo "</tr>";
  98. echo "</table>";
  99. echo "</div>";
  100. echo "<br /><br />";
  101. //include the footer
  102. require_once "includes/footer.php";
  103. ?>