To participate you must create an account on apostrophenow.org. If you have already done so, click Login.
Changeset 4517
- Timestamp:
- 01/26/12 07:52:57 (4 months ago)
- Author:
- tboutell
- Message:
-
Preserve slideshow order. Thanks to metadan. relinkMediaItems now returns the valid ids in order.
- Files:
-
Legend:
- Unmodified
- Added
- Removed
-
|
r4484
|
r4517
|
|
| 26 | 26 | { |
| 27 | 27 | $ids = preg_split('/,/', $request->getParameter('aMediaIds')); |
| 28 | | $this->relinkMediaItems($ids); |
| | 28 | $links = $this->relinkMediaItems($ids); |
| 29 | 29 | |
| 30 | 30 | // This isn't a normal form submission, but the act of selecting items for a |
| … |
… |
|
| 46 | 46 | * Drop any existing links to media items and re-link to any valid media item ids |
| 47 | 47 | * mentioned in $ids. Doctrine is not very good at this, but this solution is |
| 48 | | * battle-tested |
| | 48 | * battle-tested. Return the valid ids in order |
| 49 | 49 | */ |
| 50 | 50 | protected function relinkMediaItems($ids) |
| … |
… |
|
| 56 | 56 | $links = aArray::getIds($items); |
| 57 | 57 | $this->slot->link('MediaItems', $links); |
| | 58 | return $links; |
| 58 | 59 | } |
| 59 | 60 | |
Download in other formats: