第79行: |
第79行: |
| local anchor_property = frame.args.anchor_property | | local anchor_property = frame.args.anchor_property |
| local properties = mw.text.split(frame.args.properties, ",") | | local properties = mw.text.split(frame.args.properties, ",") |
− | local reversed_properties = _split_or_empty(frame.args.reversed_properties)
| |
| local children_title = frame.args.children_title | | local children_title = frame.args.children_title |
| | | |
第93行: |
第92行: |
| local title = frame.args[prop.."_title"] | | local title = frame.args[prop.."_title"] |
| local values = _split_or_empty(frame.args[prop.."_values"]) | | local values = _split_or_empty(frame.args[prop.."_values"]) |
| + | local reversed = frame.args[prop.."_reversed"] |
| local values_set = _table_to_keys(values) | | local values_set = _table_to_keys(values) |
| local inherited_values = p.query_inherited_property(anchor_property, prop, parents) | | local inherited_values = p.query_inherited_property(anchor_property, prop, parents) |
| local final_values = _merge_keys(values_set, inherited_values) | | local final_values = _merge_keys(values_set, inherited_values) |
− | local final_list = _keys_to_table(final_values) | + | if reversed then |
− | _create_list(root, title, final_list)
| + | local reversed_values = p.query_reversed_inherited_property(name, anchor_property, reversed) |
− | for i, k in ipairs(final_list) do
| + | final_values = _merge_keys(final_values, reversed_values) |
− | mw.smw.set({[prop]=k}) | |
| end | | end |
− | end
| |
− |
| |
− | for i, prop in ipairs(reversed_properties) do
| |
− | local title = frame.args[prop.."_title"]
| |
− | local rev_prop = frame.args[prop.."_property"]
| |
− | local final_values = p.query_reversed_inherited_property(name, anchor_property, rev_prop)
| |
| local final_list = _keys_to_table(final_values) | | local final_list = _keys_to_table(final_values) |
| _create_list(root, title, final_list) | | _create_list(root, title, final_list) |