load($value); } else { $item->title = JText::_('K2_SELECT_AN_ITEM'); } $js = " function jSelectItem(id, title, object) { document.getElementById('".$name."' + '_id').value = id; document.getElementById('".$name."' + '_name').value = title; if(typeof(window.parent.SqueezeBox.close=='function')){ window.parent.SqueezeBox.close(); } else { document.getElementById('sbox-window').close(); } } "; $doc->addScriptDeclaration($js); $link = 'index.php?option=com_k2&view=items&task=element&tmpl=component&object='.$name; JHTML::_('behavior.modal', 'a.modal'); if (K2_JVERSION == '30') { $html = ' '.JText::_('K2_SELECT').' '; } else { $html = '
'.JText::_('K2_SELECT').'
'; } return $html; } } class JFormFieldItem extends K2ElementItem { var $type = 'item'; } class JElementItem extends K2ElementItem { var $_name = 'item'; }