var _ = {}; _[<?php echo $proto->entry; ?> ]={name_enus:'<?php echo $proto->GetName(); ?> ',quality:<?php echo $proto->Quality; ?> ,icon:'<?php echo $proto->icon; ?> '}; <?php $questRewards = WoW_Items::GetQuestRewardSource(); if (is_array($questRewards)) { foreach ($questRewards as $quest) { if (is_array($quest['items'])) { foreach ($quest['items'] as $item) { echo sprintf('_[%d]={name_enus:\'%s\',quality:%d,icon:\'%s\'};', $item['entry'], isset($item['name_loc']) && $item['name_loc'] != null ? str_replace("'", "\\'", $item['name_loc']) : str_replace("'", "\\'", $item['name']), $item['quality'], $item['icon']); } } } } ?> $.extend(true, g_items, _); _ = g_items; _[<?php echo $proto->entry; ?>