Current Path :
/
home
/
develito
/
www
/
administrator
/
components
/
com_dmod
/
elements
/
Or
Select Your Path :
Upload File :
New :
File
Dir
//home/develito/www/administrator/components/com_dmod/elements/dmod.php
<?php /*------------------------------------------------------------------------ # com_dmod - Dmod Module Manager # ------------------------------------------------------------------------ # author Jesus Vargas Garita # copyright Copyright (C) 2010 www.joomlahill.com. All Rights Reserved. # @license - http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL # Websites: http://www.joomlahill.com # Technical Support: Forum - http://www.joomlahill.com/forum -------------------------------------------------------------------------*/ defined('_JEXEC') or die; class JElementDmod extends JElement { /** * Element name * * @var string */ var $_name = 'Dmod'; public function fetchElement($name, $value, &$node, $control_name) { $app = JFactory::getApplication(); $db = JFactory::getDbo(); $doc = JFactory::getDocument(); $template = $app->getTemplate(); $fieldName = $control_name.'['.$name.']'; $dmod = JTable::getInstance('dmod'); if ($value) { $dmod->load($value); } else { $dmod->title = JText::_('COM_CONTENT_SELECT_A_DMOD'); } $js = " function jSelectDmod(id, name, object) { document.getElementById(object + '_id').value = id; document.getElementById(object + '_name').value = name; document.getElementById('sbox-window').close(); }"; $doc->addScriptDeclaration($js); $link = 'index.php?option=com_dmod&task=element&tmpl=component&object='.$name; JHtml::_('behavior.modal', 'a.modal'); $html = "\n".'<div class="fltlft"><input type="text" id="'.$name.'_name" value="'.htmlspecialchars($dmod->name, ENT_QUOTES, 'UTF-8').'" disabled="disabled" /></div>'; // $html .= "\n   <input class=\"inputbox modal-button\" type=\"button\" value=\"".JText::_('JSELECT')."\" />"; $html .= '<div class="button2-left"><div class="blank"><a class="modal" title="'.JText::_('COM_CONTENT_SELECT_A_DMOD').'" href="'.$link.'" rel="{handler: \'iframe\', size: {x: 650, y: 375}}">'.JText::_('JSELECT').'</a></div></div>'."\n"; $html .= "\n".'<input type="hidden" id="'.$name.'_id" name="'.$fieldName.'" value="'.(int)$value.'" />'; return $html; } }