getAttribute('multiple') : $node->attributes()->multiple; if (!$attribute) { $fieldName .= '[]'; } $image = JURI::root(true).'/administrator/templates/'.$mainframe->getTemplate().'/images/admin/publish_x.png'; } else { $fieldName = $control_name.'['.$name.'][]'; $image = JURI::root(true).'/administrator/images/publish_x.png'; } $js = " function jSelectItem(id, title, object) { var exists = false; \$K2('#itemsList input').each(function(){ if(\$K2(this).val()==id){ alert('".JText::_('K2_THE_SELECTED_ITEM_IS_ALREADY_IN_THE_LIST')."'); exists = true; } }); if(!exists){ var container = \$K2('
').appendTo(\$K2('#itemsList')); var img = \$K2('',{'class':'remove', src:'".$image."'}).appendTo(container); img.click(function(){\$K2(this).parent().remove();}); var span = \$K2('',{'class':'handle'}).html(title).appendTo(container); var input = \$K2('',{value:id, type:'hidden', name:'".$fieldName."'}).appendTo(container); var div = \$K2('',{style:'clear:both;'}).appendTo(container); \$K2('#itemsList').sortable('refresh'); alert('".JText::_('K2_ITEM_ADDED_IN_THE_LIST', true)."'); } } \$K2(document).ready(function(){ \$K2('#itemsList').sortable({ containment: '#itemsList', items: 'li', handle: 'span.handle' }); \$K2('body').css('overflow-y', 'scroll'); \$K2('#itemsList .remove').click(function(){ \$K2(this).parent().remove(); }); }); "; $document->addScriptDeclaration($js); $document->addStyleSheet(JURI::root(true).'/media/k2/assets/css/k2.modules.css?v=2.6.7'); $current = array(); if (is_string($value) && !empty($value)) { $current[] = $value; } if (is_array($value)) { $current = $value; } JTable::addIncludePath(JPATH_ADMINISTRATOR.DS.'components'.DS.'com_k2'.DS.'tables'); $output = '