id.'_id").value = id;'; $script[] = ' document.getElementById("'.$this->id.'_name").value = title;'; // $script[] = ' SqueezeBox.close();'; $script[] = ' $("#event-modal").modal("hide");'; $script[] = ' }'; // Add the script to the document head. Factory::getApplication()->getDocument()->getWebAssetManager()->addInlineScript(implode("\n", $script)); // Setup variables for display. $html = array(); $link = 'index.php?option=com_jem&view=eventelement&tmpl=component&object='.$this->id; $db = Factory::getContainer()->get('DatabaseDriver'); $db->setQuery( 'SELECT title' . ' FROM #__jem_events' . ' WHERE id = '.(int) $this->value ); try { $title = $db->loadResult(); } catch (RuntimeException $e) { Factory::getApplication()->enqueueMessage($e->getMessage(), 'warning'); } if (empty($title)) { $title = Text::_('COM_JEM_SELECT_EVENT'); } $title = htmlspecialchars($title, ENT_QUOTES, 'UTF-8'); // The current user display field. $html[] = '
'; $html[] = ' '; $html[] = '
'; // The user select button. $html[] = '
'; $html[] = '
'; $html[] = HTMLHelper::_( 'bootstrap.renderModal', 'event-modal', array( 'url' => $link.'&'.Session::getFormToken().'=1', 'title' => Text::_('COM_JEM_SELECT_EVENT'), 'width' => '800px', 'height' => '450px', 'footer' => '' ) ); $html[] =''; $html[] = '
'; $html[] = '
'; // The active event-id field. if (0 == (int)$this->value) { $value = ''; } else { $value = (int)$this->value; } // class='required' for client side validation $class = ''; if ($this->required) { $class = ' class="required modal-value"'; } $html[] = ''; return implode("\n", $html); } } ?>