element['class'] ? ' class="'.(string) $this->element['class'].'"' : ''; $attr .= $this->element['size'] ? ' size="'.(int) $this->element['size'].'"' : ''; $uid = $this->form->getValue('extfbuid'); $suffix = ''; if ($uid != '') { $suffix .= '&uid='.$uid;} $link = 'index.php?option=com_phocagallery&view=phocagalleryfba&tmpl=component&field='.$this->id. $suffix; // Initialize JavaScript field attributes. $onchange = (string) $this->element['onchange']; // Build the script. /* $script = array(); $script[] = ' function phocaSelectFbAlbum_'.$this->id.'(title) {'; $script[] = ' document.getElementById("'.$this->id.'_id").value = title;'; $script[] = ' '.$onchange; $script[] = ' SqueezeBox.close();'; $script[] = ' }';*/ HTMLHelper::_('jquery.framework'); $idA = 'pgselectfbalbum'; // Build the script. $script = array(); $script[] = ' function phocaSelectFBAlbum_'.$this->id.'(title) {'; $script[] = ' document.getElementById("'.$this->id.'").value = title;'; $script[] = ' '.$onchange; //$script[] = ' SqueezeBox.close();'; $script[] = ' jQuery(\'#'.$idA.'\').modal(\'toggle\');'; $script[] = ' }'; $script[] = 'window.closeModal = function(){'; $script[] = ' jQuery(\'#'.$idA.'\').modal(\'hide\');'; $script[] = '}'; // Add the script to the document head. Factory::getDocument()->addScriptDeclaration(implode("\n", $script)); /* $html[] = '
'; $html[] = ''; $html[] = '' . Text::_('COM_PHOCAGALLERY_FB_SELECT_ALBUM').''; $html[] = '
'. "\n";*/ $html[] = '
'; $html[] = ''; $html[] = '' . ' ' . Text::_('COM_PHOCAGALLERY_FB_SELECT_ALBUM') . ''; $html[] = '
'. "\n"; $html[] = HTMLHelper::_( 'bootstrap.renderModal', $idA, array( 'url' => $link, 'title' => Text::_('COM_PHOCAGALLERY_FB_SELECT_ALBUM'), 'width' => '700px', 'height' => '400px', 'modalWidth' => '80', 'bodyHeight' => '70', 'footer' => '' ) ); return implode("\n", $html); } } ?>