ajaxgetdropmenu.html.php 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. <?php js::set('productID', $productID);?>
  2. <?php js::set('module', $module);?>
  3. <?php js::set('method', $method);?>
  4. <?php js::set('extra', $extra);?>
  5. <?php
  6. $activeBranchesHtml = '';
  7. $closedBranchesHtml = '';
  8. $currentBranchID = $currentBranchID === '' ? '0' : $currentBranchID;
  9. foreach($branches as $branchID => $branch)
  10. {
  11. $selected = (string)$branchID == $currentBranchID ? 'selected' : '';
  12. $linkHtml = $this->branch->setParamsForLink($module, $link, $projectID, $productID, $branchID);
  13. if($branchID == 'all' or empty($branchID) or $statusList[$branchID] == 'active')
  14. {
  15. $activeBranchesHtml .= html::a($linkHtml, $branch, '', "class='$selected' data-key='{$branchesPinyin[$branch]}' data-app='{$this->app->tab}'");
  16. }
  17. else
  18. {
  19. $closedBranchesHtml .= html::a($linkHtml, $branch, '', "class='$selected' data-key='{$branchesPinyin[$branch]}' data-app='{$this->app->tab}'");
  20. }
  21. }
  22. ?>
  23. <div class="table-row">
  24. <div class="table-col col-left">
  25. <div class='list-group'>
  26. <?php echo $activeBranchesHtml;?>
  27. </div>
  28. <div class="col-footer">
  29. <a class='pull-right toggle-right-col not-list-item'><?php echo $lang->branch->closed;?><i class='icon icon-angle-right'></i></a>
  30. </div>
  31. </div>
  32. <div class="table-col col-right">
  33. <div class='list-group'><?php echo $closedBranchesHtml;?></div>
  34. </div>
  35. </div>
  36. <script>
  37. $(function()
  38. {
  39. $('#currentBranch + #dropMenu .list-group .table-row .table-col a').mouseout(function()
  40. {
  41. $(this).removeClass('active');
  42. })
  43. })
  44. </script>