Project

General

Profile

Bug #18888 » patch_permajax_20080804_8578_d.diff

Administrator Admin, 2008-08-04 21:13

View differences:

typo3/mod/web/perm/class.sc_mod_web_perm_ajax.php (working copy)
$this->conf['editLockState'] = intval(t3lib_div::_POST('editLockState'));
// User: Replace some parts of the posted values
$this->conf['owner_data'] = urldecode(t3lib_div::_POST('owner_data'));
$this->conf['owner_data'] = str_replace('new_page_owner=', '', $this->conf['owner_data']);
$this->conf['owner_data'] = str_replace('%3B', ';', $this->conf['owner_data']);
$temp_owner_data = explode(';', $this->conf['owner_data']);
$this->conf['new_owner_uid'] = intval($temp_owner_data[0]);
$this->conf['new_owner_username'] = htmlspecialchars($temp_owner_data[1]);
$this->conf['new_owner_uid'] = intval(t3lib_div::_POST('new_page_owner'));
$temp_owner_data = t3lib_BEfunc::getUserNames(
'username,uid',
' AND uid = '. intval( $this->conf['new_owner_uid'] )
);
$this->conf['new_owner_username'] = htmlspecialchars(
$temp_owner_data[$this->conf['new_owner_uid']]['username']
);
// Group: Replace some parts of the posted values
$this->conf['group_data'] = urldecode(t3lib_div::_POST('group_data'));
$this->conf['group_data'] = str_replace('new_page_group=', '', $this->conf['group_data']);
$this->conf['group_data'] = str_replace('%3B', ';', $this->conf['group_data']);
$temp_group_data = explode(';', $this->conf['group_data']);
$this->conf['new_group_uid'] = intval($temp_group_data[0]);
$this->conf['new_group_username'] = htmlspecialchars($temp_group_data[1]);
$this->conf['new_group_uid'] = intval(t3lib_div::_POST('new_page_group'));
$temp_group_data = t3lib_BEfunc::getGroupNames(
'title,uid',
' AND uid = '. intval( $this->conf['new_group_uid'] )
);
$this->conf['new_group_username'] = htmlspecialchars(
$temp_group_data[$this->conf['new_group_uid']]['title']
);
}
......
// Loop through the users
foreach ($beUsers as $uid => $row) {
$selected = ($uid == $ownerUid ? ' selected="selected"' : '');
$options .= '<option value="'.$uid.';'.htmlspecialchars($row['username']).'"'.$selected.'>'.htmlspecialchars($row['username']).'</option>';
$options .= '<option value="'.$uid.'"'.$selected.'>'.htmlspecialchars($row['username']).'</option>';
}
$elementId = 'o_'.$page;
......
} else {
$selected = '';
}
$options .= '<option value="'.$uid.';'.htmlspecialchars($row['title']).'"'.$selected.'>'.htmlspecialchars($row['title']).'</option>';
$options .= '<option value="'.$uid.'"'.$selected.'>'.htmlspecialchars($row['title']).'</option>';
}
// If the group was not set AND there is a group for the page
typo3/mod/web/perm/perm.js (working copy)
// Set the new owner of a page by executing an ajax call
changeOwner: function(page, ownerUid, elementID) {
new Ajax.Updater($(elementID), this.thisScript, {
parameters: { ajaxID: this.ajaxID, action: 'change_owner', page: page, ownerUid: ownerUid, owner_data: $('new_page_owner').serialize(true) }
parameters: { ajaxID: this.ajaxID, action: 'change_owner', page: page, ownerUid: ownerUid, new_page_owner: $('new_page_owner').value }
});
},
......
// Set the new group by executing an ajax call
changeGroup: function(page, groupUid, elementID) {
new Ajax.Updater($(elementID), this.thisScript, {
parameters: { ajaxID: this.ajaxID, action: 'change_group', page: page, groupUid: groupUid, group_data: $('new_page_group').serialize(true) }
parameters: { ajaxID: this.ajaxID, action: 'change_group', page: page, groupUid: groupUid, new_page_group: $('new_page_group').value }
});
},
(6-6/6)