[ Index ] |
|
Code source de Joomla 1.0.13 |
1 <?php 2 /** 3 * @version $Id: mod_components.php 7409 2007-05-14 21:10:47Z robs $ 4 * @package Joomla 5 * @copyright Copyright (C) 2005 Open Source Matters. All rights reserved. 6 * @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php 7 * Joomla! is free software. This version may have been modified pursuant 8 * to the GNU General Public License, and as distributed it includes or 9 * is derivative of works licensed under the GNU General Public License or 10 * other free or open source software licenses. 11 * See COPYRIGHT.php for copyright notices and details. 12 */ 13 14 // no direct access 15 defined( '_VALID_MOS' ) or die( 'Restricted access' ); 16 17 // cache some acl checks 18 $canConfig = $acl->acl_check( 'administration', 'config', 'users', $my->usertype ); 19 20 $manageTemplates = $acl->acl_check( 'administration', 'manage', 'users', $my->usertype, 'components', 'com_templates' ); 21 $manageLanguages = $acl->acl_check( 'administration', 'manage', 'users', $my->usertype, 'components', 'com_languages' ); 22 $installModules = $acl->acl_check( 'administration', 'install', 'users', $my->usertype, 'modules', 'all' ); 23 $editAllModules = $acl->acl_check( 'administration', 'edit', 'users', $my->usertype, 'modules', 'all' ); 24 $installComponents = $acl->acl_check( 'administration', 'install', 'users', $my->usertype, 'components', 'all' ); 25 $editAllComponents = $acl->acl_check( 'administration', 'edit', 'users', $my->usertype, 'components', 'all' ); 26 $canMassMail = $acl->acl_check( 'administration', 'manage', 'users', $my->usertype, 'components', 'com_massmail' ); 27 $canManageUsers = $acl->acl_check( 'administration', 'manage', 'users', $my->usertype, 'components', 'com_users' ); 28 29 $count = intval( $params->def( 'count', 10 ) ); 30 31 $query = "SELECT *" 32 . "\n FROM #__components" 33 . "\n ORDER BY ordering, name" 34 ; 35 $database->setQuery( $query ); 36 $comps = $database->loadObjectList(); // component list 37 38 $subs = array(); // sub menus 39 40 // first pass to collect sub-menu items 41 foreach ($comps as $row) { 42 if ($row->parent) { 43 if (!array_key_exists( $row->parent, $subs )) { 44 $subs[$row->parent] = array(); 45 } // if 46 $subs[$row->parent][] = $row; 47 } // if 48 } // foreach 49 ?> 50 <table class="adminlist"> 51 <tr> 52 <th class="title"> 53 Components 54 </th> 55 </tr> 56 <tr> 57 <td> 58 <?php 59 if ( $task == 'listcomponents' ) { 60 $topLevelLimit = 10000; 61 } else { 62 $topLevelLimit = $count; 63 } 64 $i = 0; 65 $z = 0; 66 foreach ($comps as $row) { 67 if ( $editAllComponents | $acl->acl_check( 'administration', 'edit', 'users', $my->usertype, 'components', $row->option ) ) { 68 69 if ($row->parent == 0 && (trim( $row->admin_menu_link ) || array_key_exists( $row->id, $subs ))) { 70 71 if ($i >= $topLevelLimit) { 72 if ($i == $topLevelLimit) { 73 ?> 74 <div> 75 <table width="100%" class="adminlist"> 76 <tr> 77 <td align="center" style="text-align: center; font-weight: bold;"> 78 <a href="index2.php?option=com_admin&task=listcomponents">Full Component List</a> 79 </td> 80 </tr> 81 </table> 82 </div> 83 <?php 84 $i = 1000; 85 } // if 86 } else { 87 ?> 88 <table width="50%" class="adminlist" border="1" style="text-align: left"> 89 <?php 90 if ($i < $topLevelLimit ) { 91 $i++; 92 $name = htmlspecialchars( $row->name, ENT_QUOTES ); 93 // $alt = htmlspecialchars( $row->admin_menu_alt, ENT_QUOTES ); 94 if ($row->admin_menu_link) { 95 ?> 96 <tr> 97 <td> 98 <?php 99 echo '<a href="index2.php?'.htmlspecialchars($row->admin_menu_link,ENT_QUOTES).'"><strong>'.$name.'</strong></a><br/>'; 100 ?> 101 </td> 102 </tr> 103 <?php 104 } else { 105 ?> 106 <tr> 107 <td> 108 <strong> 109 <?php echo $name; ?> 110 </strong> 111 <br/> 112 </td> 113 </tr> 114 <?php 115 } // if else 116 if (array_key_exists( $row->id, $subs )) { 117 foreach ($subs[$row->id] as $sub) {//print_r($row); 118 ?> 119 <tr> 120 <td> 121 <ul style="padding: 0px 0px 0px 20px; margin: 0px;"> 122 <?php 123 $name = htmlspecialchars( $sub->name ); 124 // $alt = htmlspecialchars( $sub->admin_menu_alt ); 125 // $link = $sub->admin_menu_link ? "" : "null"; 126 // $img = $sub->admin_menu_img ? "<img src=\"../includes/$sub->admin_menu_img\" />" : ''; 127 if ($sub->admin_menu_link) { 128 ?> 129 <li> 130 <?php echo '<a href="index2.php?'.htmlspecialchars($sub->admin_menu_link, ENT_QUOTES).'">'.$name.'</a><br/>'; ?> 131 </li> 132 <?php 133 } else { 134 ?> 135 <li> 136 <?php echo $name; ?> 137 <br/> 138 </li> 139 <?php 140 } // if else 141 ?> 142 </ul> 143 </td> 144 </tr> 145 <?php 146 } // foreach 147 } // if 148 } // if 149 ?> 150 </table> 151 <?php 152 } // if else 153 } // if 154 } // if 155 156 $z++; 157 } // foreach 158 ?> 159 </td> 160 </tr> 161 <tr> 162 <th> 163 </th> 164 </tr> 165 </table>
titre
Description
Corps
titre
Description
Corps
titre
Description
Corps
titre
Corps
Généré le : Wed Nov 21 14:43:32 2007 | par Balluche grâce à PHPXref 0.7 |
![]() |