form->getValue('catid'); if ((int)$catid > 0) { $suffix .= '&catid='.$catid; } else { $suffix .= '&catid=0'; } $link = 'index.php?option=com_phocagallery&view=phocagalleryytb&tmpl=component&field='.$this->id.$suffix; // Initialize some field attributes. $class = $this->element['class'] ? ' class="'.(string) $this->element['class'].'"' : ''; $disabled = ((string) $this->element['disabled'] == 'true') ? ' disabled="disabled"' : ''; $columns = $this->element['cols'] ? ' cols="'.(int) $this->element['cols'].'"' : ''; $rows = $this->element['rows'] ? ' rows="'.(int) $this->element['rows'].'"' : ''; //$required = ($v = $this->element['required']) ? ' required="required"' : ''; // Initialize JavaScript field attributes. $onchange = (string) $this->element['onchange']; HTMLHelper::_('jquery.framework'); $idA = 'pgselectytb'; // Build the script. $script = array(); $script[] = ' function phocaSelectYtb_'.$this->id.'(link, title, desc, filename) {'; $script[] = ' document.getElementById("'.$this->id.'").value = link;'; $script[] = ' document.getElementById("jform_title").value = title;'; $script[] = ' document.getElementById("jform_description").value = desc;'; $script[] = ' document.getElementById("jform_filename").value = filename;'; $script[] = ' '.$onchange; //$script[] = ' SqueezeBox.close();'; //$script[] = ' jQuery(\'#'.$idA.'\').modal(\'toggle\');'; $script[] = ' jQuery(\'#'.$idA.'\').modal(\'hide\');'; $script[] = ' }'; // Add the script to the document head. Factory::getDocument()->addScriptDeclaration(implode("\n", $script)); /* $html[] = '
'; $html[] = ''; $html[] = '
'; // Create the user select button. $html[] = '
'; $html[] = '
'; $html[] = ' '; $html[] = ' '.Text::_('COM_PHOCAGALLERY_FORM_SELECT_YTB').''; $html[] = '
'; $html[] = '
';*/ $html[] = '
'; $html[] = ''; //$html[] = '' // . JText::_('COM_PHOCAGALLERY_FORM_SELECT_YTB').''; //$html[] = ''; /*$html[] = '' . ' ' . Text::_('COM_PHOCAGALLERY_FORM_SELECT_YTB') . ''; $html[] = '
'. "\n"; $html[] = HTMLHelper::_( 'bootstrap.renderModal', $idA, array( 'url' => $link, 'title' => Text::_('COM_PHOCAGALLERY_FORM_SELECT_YTB'), 'width' => '700px', 'height' => '400px', 'modalWidth' => '80', 'bodyHeight' => '70', 'footer' => '' ) ); */ $html[] = '' . ' ' . Text::_('COM_PHOCAGALLERY_FORM_SELECT_YTB') . ''; $html[] = ''. "\n"; $html[] = HTMLHelper::_( 'bootstrap.renderModal', $idA, array( 'url' => $link, 'title' => Text::_('COM_PHOCAGALLERY_FORM_SELECT_YTB'), 'width' => '560px', 'height' => '470px', 'modalWidth' => '50', 'bodyHeight' => '70', 'footer' => '
' ) ); return implode("\n", $html); } }