From: <jon...@us...> - 2009-09-28 17:54:30
|
Revision: 21830 http://tikiwiki.svn.sourceforge.net/tikiwiki/?rev=21830&view=rev Author: jonnybradley Date: 2009-09-28 17:54:17 +0000 (Mon, 28 Sep 2009) Log Message: ----------- [FIX] Removed on-doc-ready jQuery code showing group inheritance that was killing the page in several browsers - just too much work client-side. Needs to be replaced with something better rendered into the page - i am working on it... Modified Paths: -------------- trunk/tiki-objectpermissions.php Modified: trunk/tiki-objectpermissions.php =================================================================== --- trunk/tiki-objectpermissions.php 2009-09-28 17:49:03 UTC (rev 21829) +++ trunk/tiki-objectpermissions.php 2009-09-28 17:54:17 UTC (rev 21830) @@ -316,6 +316,7 @@ $smarty->assign('permGroups', implode(',', $permGroups)); $smarty->assign('permGroupCols', $groupIndices); $smarty->assign('groupNames', implode(',', $groupNames)); +//$smarty->assign('groupInheritance', $groupInheritance); // Get the big list of permissions @@ -421,46 +422,47 @@ $js = ''; -for( $i = 0; $i < count($groupNames); $i++) { +//for( $i = 0; $i < count($groupNames); $i++) { +// +// $groupName = addslashes($groupNames[$i]); +// $beneficiaries = ''; +// for( $j = 0; $j < count($groupInheritance); $j++) { +// if (is_array($groupInheritance[$j]) && in_array($groupName, $groupInheritance[$j])) { +// $beneficiaries .= !empty($beneficiaries) ? ',' : ''; +// $beneficiaries .='input[name="perm['. addslashes($groupNames[$j]).'][]"]'; +// } +// } +// +// +// $js .= <<< JS +//\$jq('input[name="perm[$groupName][]"]').each( function() { // each one of this group +// +// if (\$jq(this).attr('checked')) { +// \$jq('input[value="'+\$jq(this).val()+'"]'). // other checkboxes of same value (perm) +// filter('$beneficiaries'). // which inherit from this +// attr('checked',\$jq(this).attr('checked')). // check and disable +// attr('disabled',\$jq(this).attr('checked') ? 'disabled' : ''); +// } +// +// \$jq(this).click( function() { // bind click event +// +// if (\$jq(this).attr('checked')) { +// \$jq('input[value="'+\$jq(this).val()+'"]'). // same... +// filter('$beneficiaries'). +// attr('checked','checked'). // check? +// attr('disabled','disabled'); // disable +// } else { +// \$jq('input[value="'+\$jq(this).val()+'"]'). // same... +// filter('$beneficiaries'). +// attr('checked',''). // check? +// attr('disabled',''); // disable +//} +// }); +//}); +// +//JS; +//} // end of for $groupNames loop - $groupName = $groupNames[$i]; - $beneficiaries = ''; - for( $j = 0; $j < count($groupInheritance); $j++) { - if (is_array($groupInheritance[$j]) && in_array($groupName, $groupInheritance[$j])) { - $beneficiaries .= !empty($beneficiaries) ? ',' : ''; - $beneficiaries .= 'input[name="perm['.$groupNames[$j].'][]"]'; - } - } - - $js .= <<< JS -\$jq('input[name="perm[$groupName][]"]').each( function() { // each one of this group - - if (\$jq(this).attr('checked')) { - \$jq('input[value="'+\$jq(this).val()+'"]'). // other checkboxes of same value (perm) - filter('$beneficiaries'). // which inherit from this - attr('checked',\$jq(this).attr('checked')). // check and disable - attr('disabled',\$jq(this).attr('checked') ? 'disabled' : ''); - } - - \$jq(this).click( function() { // bind click event - - if (\$jq(this).attr('checked')) { - \$jq('input[value="'+\$jq(this).val()+'"]'). // same... - filter('$beneficiaries'). - attr('checked','checked'). // check? - attr('disabled','disabled'); // disable - } else { - \$jq('input[value="'+\$jq(this).val()+'"]'). // same... - filter('$beneficiaries'). - attr('checked',''). // check? - attr('disabled',''); // disable -} - }); -}); - -JS; -} // end of for $groupNames loop - $maxGroupsToShow = 6; // maybe a pref one day? if (count($groupNames) >= $maxGroupsToShow) { $hideGroups = implode(',',array_keys(array_fill($maxGroupsToShow+1, count($groupNames)-$maxGroupsToShow, 1))); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |