zentaolist.story.html.php 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. <?php
  2. namespace zin;
  3. $fnGenerateFormRows = function () use ($lang, $settings, $lowerType, $fnGenerateCustomSearch)
  4. {
  5. $products = $this->loadModel('product')->getPairs();
  6. $product = isset($settings['product']) ? $settings['product'] : 0;
  7. $searchConditions = array();
  8. foreach($lang->product->featureBar['browse'] as $key => $label)
  9. {
  10. if(strpos($key, 'byme') !== false || strpos($key, 'tome') !== false) continue;
  11. if($key == 'more')
  12. {
  13. foreach($lang->product->moreSelects['browse']['more'] as $moreKey => $moreLabel)
  14. {
  15. if(strpos($moreKey, 'byme') !== false || strpos($moreKey, 'tome') !== false) continue;
  16. $searchConditions[$moreKey] = $moreLabel;
  17. }
  18. }
  19. else
  20. {
  21. $searchConditions[$key] = $label;
  22. }
  23. }
  24. $searchConditions['customSearch'] = $lang->doc->customSearch;
  25. $storyType = 'story';
  26. if($lowerType == 'er') $storyType = 'epic';
  27. if($lowerType == 'ur') $storyType = 'requirement';
  28. $searchConfig = $this->product->buildSearchConfig((int)$product, $storyType);
  29. return array
  30. (
  31. formRow
  32. (
  33. formGroup
  34. (
  35. set::width('1/2'),
  36. set::name('product'),
  37. set::label($lang->doc->product),
  38. set::items($products),
  39. set::value($product),
  40. span
  41. (
  42. setClass('error-tip text-danger hidden'),
  43. $lang->doc->emptyError
  44. )
  45. )
  46. ),
  47. formRow
  48. (
  49. formGroup
  50. (
  51. set::width('1/2'),
  52. set::name('condition'),
  53. set::label($lang->doc->searchCondition),
  54. set::items($searchConditions),
  55. set::value(isset($settings['condition']) ? $settings['condition'] : '')
  56. )
  57. ),
  58. $fnGenerateCustomSearch($searchConfig)
  59. );
  60. };