2 namespace wcf\system\message\embedded\object;
3 use wcf\system\cache\runtime\MediaRuntimeCache;
4 use wcf\system\html\input\HtmlInputProcessor;
5 use wcf\util\ArrayUtil;
8 * IMessageEmbeddedObjectHandler implementation for shared media.
10 * @author Alexander Ebert
11 * @copyright 2001-2016 WoltLab GmbH
12 * @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
13 * @package WoltLabSuite\Core\System\Message\Embedded\Object
15 class MediaMessageEmbeddedObjectHandler extends AbstractMessageEmbeddedObjectHandler {
19 public function parse(HtmlInputProcessor $htmlInputProcessor, array $embeddedData) {
21 foreach (['wsm', 'wsmg'] as $name) {
22 if (empty($embeddedData[$name])) {
26 for ($i = 0, $length = count($embeddedData[$name]); $i < $length; $i++) {
27 $parsedIDs = ArrayUtil::toIntegerArray(explode(',', $embeddedData[$name][$i][0]));
29 $mediaIDs = array_merge($mediaIDs, $parsedIDs);
39 public function loadObjects(array $objectIDs) {
40 return MediaRuntimeCache::getInstance()->getObjects($objectIDs);