Function editDocManGroup($option, $uid)
{
global $database;
require_once("components/com_docman/docman_config.php");
$dmpath=base64_decode($dmpath);
$security_sites=base64_decode($security_sites);
$row = new mosDocManGroups($database);
$row -> load($uid);
// get selected members
$members_exploded=explode(",",$row->groups_members);
$database->setQuery( "SELECT id as value FROM #__users WHERE id IN ($row->groups_members)" );
$lookup = $database->loadObjectList();
// Create users List
$database -> setQuery("SELECT id,name,username FROM #__users ORDER BY id ASC");
$usersTemp = $database -> loadObjectList();
$musers = array();
$musers = array(mosHTML :: makeOption(0, '>>Select members of this group<<'));
// append the rest of the users to the array
foreach ($usersTemp as $ttt){
$musers[] = mosHTML :: makeOption($ttt -> id, $ttt -> id."-".$ttt -> name."(".$ttt->username.")");
}
$usersList = mosHTML :: selectList($musers, 'selections[]', 'class="inputbox" size="20" multiple="multiple"',
'value', 'text', $lookup);
HTML_DocMan :: editDocManGroups($option, $row, $usersList);
}
这是其中的一个关于这个组件的片断,不太理解,请大家帮我看一下,实在不清楚的地方
<B>
我猜想所有用户的ID是在这句话中被支解的
$members_exploded=explode(",",$row->groups_members);
这是表单中基于要被选中的成员
$usersTemp = $database -> loadObjectList();
foreach ($usersTemp as $ttt){
$musers[] = mosHTML :: makeOption($ttt -> id, $ttt -> id."-".$ttt -> name."(".$ttt->username.")");
}
</B>