Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //step-1
- $('.step1').on('click', function () {
- $(this).parent().find('.step2').prop('checked', $(this).prop('checked'))
- .end().find('.step3').prop('checked', $(this).prop('checked'));
- });
- //step-2
- $('.step2').on('click', function () {
- $(this).parent().find('.step3').prop('checked', $(this).prop('checked'));
- if ($(this).parent().parent().find('input:checked').length > 0) {
- $(this).parent().parent().parent().find('.step1').prop('checked', true);
- } else {
- $(this).parent().parent().parent().find('.step1').prop('checked', false);
- }
- });
- //step-3
- $('.step3').on('click', function () {
- if ($(this).parent().parent().find('input:checked').length > 0) {
- $(this).parent().parent().parent().find('.step2').prop('checked', true);
- $(this).parent().parent().parent().parent().parent().find('.step1').prop('checked', true);
- } else {
- $(this).parent().parent().parent().find('.step2').prop('checked', false);
- $(this).parent().parent().parent().parent().parent().find('.step1').prop('checked', false);
- }
- });
- <?php $allActions = unserialize(All_ACTION);
- foreach ($allActions as $key => $value) {
- ?>
- <div class="main-ul-div">
- <ul>
- <li>
- <input <?php if (in_array($value['url'], $limitArray)) echo "checked"; ?> class="step1" type="checkbox" name="position_keys[]" value="<?php echo $value['url']; ?>"> <span class="main-li-div"><?php echo $value['name']; ?></span> <br />
- <hr>
- <?php if (isset($value['child']) && !empty($value['child'])) { ?>
- <ul>
- <?php
- foreach ($value['child'] as $value2) {
- // p($value2);
- ?>
- <li>
- <input <?php if (in_array($value2['url'], $limitArray)) echo "checked"; ?> class="step2" type="checkbox" name="position_keys[]" value="<?php echo $value2['url']; ?>"> <?php echo $value2['name']; ?> <br />
- <?php
- if (isset($value2['child']) && !empty($value2['child'])) {
- ?>
- <ul>
- <?php
- foreach ($value2['child'] as $value3) {
- ?>
- <li>
- <input <?php if (in_array($value3['url'], $limitArray)) echo "checked"; ?> class="step3" type="checkbox" name="position_keys[]" value="<?php echo $value3['url']; ?>"> <?php echo $value3['name']; ?> <br />
- </li> <?php
- }
- ?>
- </ul>
- <?php
- }
- ?>
- </li>
- <?php
- }
- }
- ?></ul>
- <?php ?>
- </li>
- </ul>
- </div>
- <?php }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement