Source for file mod_components.php

Documentation is available at mod_components.php

  1. <?php
  2. /**
  3. @package Mambo
  4. @author Mambo Foundation Inc see README.php
  5. @copyright Mambo Foundation Inc.
  6. *  See COPYRIGHT.php for copyright notices and details.
  7. @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see
  8. *  LICENSE.php
  9. *  Mambo is free software; you can redistribute it and/or
  10. *  modify it under the terms of the GNU General Public License
  11. *  as published by the Free Software Foundation; version 2 of the
  12. *  License.
  13. */ 
  14.  
  15. /** ensure this file is being included by a parent file */
  16. defined'_VALID_MOS' or die'Direct Access to this location is not allowed.' );
  17.  
  18. // cache some acl checks
  19. $canConfig $acl->acl_check'administration''config''users'$my->usertype );
  20.  
  21. $manageTemplates     $acl->acl_check'administration''manage''users'$my->usertype'components''com_templates' );
  22. $manageLanguages     $acl->acl_check'administration''manage''users'$my->usertype'components''com_languages' );
  23. $installModules     $acl->acl_check'administration''install''users'$my->usertype'modules''all' );
  24. $editAllModules     $acl->acl_check'administration''edit''users'$my->usertype'modules''all' );
  25. $installComponents     $acl->acl_check'administration''install''users'$my->usertype'components''all' );
  26. $editAllComponents     $acl->acl_check'administration''edit''users'$my->usertype'components''all' );
  27. $canMassMail         $acl->acl_check'administration''manage''users'$my->usertype'components''com_massmail' );
  28. $canManageUsers     $acl->acl_check'administration''manage''users'$my->usertype'components''com_users' );
  29.  
  30. $query "SELECT * FROM #__components ORDER BY ordering,name";
  31. $database->setQuery$query );
  32. $comps $database->loadObjectList();    // component list
  33.  
  34. $subs array();    // sub menus
  35.  
  36. // first pass to collect sub-menu items
  37. foreach ($comps as $row{
  38.     if ($row->parent{
  39.         if (!array_key_exists$row->parent$subs )) {
  40.             $subs[$row->parentarray();
  41.         // if
  42.         $subs[$row->parent][$row;
  43.     // if
  44. // foreach
  45.  
  46. echo '<div align="right">';
  47.  
  48. $topLevelLimit 100;
  49. $i 0;
  50. foreach ($comps as $row{
  51.  
  52.     if $editAllComponents $acl->acl_check'administration''edit''users'$my->usertype'components'$row->option ) ) {
  53.  
  54.         if ($row->parent == && (trim$row->admin_menu_link || array_key_exists$row->id$subs ))) {
  55.  
  56.             if ($i >= $topLevelLimit{
  57.                 if ($i == $topLevelLimit{
  58.  
  59.                     echo "Error!<br />";
  60.                     $i 1000;
  61.                 // if
  62.             else {
  63.                 if ($i $topLevelLimit {
  64.                     $i++;
  65.                     $name htmlspecialchars$row->nameENT_QUOTES );
  66.                     // $alt = htmlspecialchars( $row->admin_menu_alt, ENT_QUOTES );
  67.                     if ($row->admin_menu_link{
  68.                         echo "\n".'<a href="index2.php?'.htmlspecialchars($row->admin_menu_link,ENT_QUOTES).'"><strong>'.$name.'</strong></a><br/>';
  69.                     else {
  70.                         echo "\n".'<strong>'.$name.'</strong><br/>';
  71.                     // if else
  72.                     if (array_key_exists$row->id$subs )) {
  73.                         foreach ($subs[$row->idas $sub{//print_r($row);
  74.                             $name htmlspecialchars$sub->name );
  75.                             // $alt = htmlspecialchars( $sub->admin_menu_alt );
  76.                             // $link = $sub->admin_menu_link ? "" : "null";
  77.                             // $img = $sub->admin_menu_img ? "<img src=\"../includes/$sub->admin_menu_img\" />" : '';
  78.                             if ($sub->admin_menu_link{
  79.                                 echo "\n<span dir=\"rtl\">".'&nbsp;&nbsp;- <a href="index2.php?'.htmlspecialchars($sub->admin_menu_linkENT_QUOTES).'">'.$name.'</a></span><br/>';
  80.                             else {
  81.                                 echo "\n<span dir=\"rtl\">".'- '.$name.'</span><br/>';
  82.                             // if else
  83.                         // foreach
  84.                     // if
  85.                 // if
  86.             // if else
  87.         // if
  88.     // if
  89. // foreach
  90. echo "\n".'</div>';
  91. ?>

Documentation generated on Mon, 05 May 2008 16:21:14 +0400 by phpDocumentor 1.4.0