create.max.html.hook.php 1.1 KB

1234567891011121314151617181920212223242526272829
  1. <?php
  2. namespace zin;
  3. $features = data('features');
  4. if(data('execution.type') == 'stage')
  5. {
  6. query('formGridPanel')->each(function($node) use($features)
  7. {
  8. $fields = $node->prop('fields');
  9. $fields->field('design')
  10. ->foldable()
  11. ->control('picker')
  12. ->items(array());
  13. if(!empty($features['story']))
  14. {
  15. $fields->field('mailto')->className('lite:w-full');
  16. $fields->field('name')->className('full:w-full');
  17. }
  18. if(empty($features['story'])) $fields->field('name')->remove('className')->className('full:w-1/2');
  19. $fields->orders('type,testStoryBox', 'type,testStoryBox,parent,assignedToBox', 'desc,module,storyBox,design,keywords,mailto,files');
  20. $fields->fullModeOrders('type,module,storyBox,testStoryBox,parent,assignedToBox,name', 'design,desc,files,mailto,keywords');
  21. if(empty($features['story'])) $fields->fullModeOrders('type,module,storyBox,testStoryBox,design,assignedToBox', 'desc,files,mailto,keywords', 'design,name,assignedToBox');
  22. $node->setProp('fields', $fields);
  23. });
  24. }