| [ Index ] |
PHP Cross Reference of Joomla 2.5.4 DE |
[Summary view] [Print] [Text view]
1 <?php 2 /** 3 * @package Joomla.Administrator 4 * @copyright Copyright (C) 2005 - 2012 Open Source Matters, Inc. All rights reserved. 5 * @license GNU General Public License version 2 or later; see LICENSE.txt 6 */ 7 8 // No direct access 9 defined('_JEXEC') or die; 10 11 /** 12 * Renders a contact element 13 * 14 * @package Joomla.Administrator 15 * @subpackage com_contact 16 * @deprecated JParameter is deprecated and will be removed in a future version. Use JForm instead. 17 * @since 1.5 18 */ 19 class JElementContact extends JElement 20 { 21 /** 22 * Element name 23 * 24 * @var string 25 */ 26 var $_name = 'Contact'; 27 28 public function fetchElement($name, $value, &$node, $control_name) 29 { 30 $app = JFactory::getApplication(); 31 $db = JFactory::getDbo(); 32 $doc = JFactory::getDocument(); 33 $template = $app->getTemplate(); 34 $fieldName = $control_name.'['.$name.']'; 35 $contact = JTable::getInstance('contact'); 36 if ($value) { 37 $contact->load($value); 38 } else { 39 $contact->title = JText::_('COM_CONTENT_SELECT_A_CONTACT'); 40 } 41 $js = " 42 function jSelectContact(id, name, object) { 43 document.getElementById(object + '_id').value = id; 44 document.getElementById(object + '_name').value = name; 45 document.getElementById('sbox-window').close(); 46 }"; 47 $doc->addScriptDeclaration($js); 48 $link = 'index.php?option=com_contact&task=element&tmpl=component&object='.$name; 49 50 JHtml::_('behavior.modal', 'a.modal'); 51 $html = "\n".'<div class="fltlft"><input type="text" id="'.$name.'_name" value="'.htmlspecialchars($contact->name, ENT_QUOTES, 'UTF-8').'" disabled="disabled" /></div>'; 52 // $html .= "\n   <input class=\"inputbox modal-button\" type=\"button\" value=\"".JText::_('JSELECT')."\" />"; 53 $html .= '<div class="button2-left"><div class="blank"><a class="modal" title="'.JText::_('COM_CONTENT_SELECT_A_CONTACT').'" href="'.$link.'" rel="{handler: \'iframe\', size: {x: 650, y: 375}}">'.JText::_('JSELECT').'</a></div></div>'."\n"; 54 $html .= "\n".'<input type="hidden" id="'.$name.'_id" name="'.$fieldName.'" value="'.(int)$value.'" />'; 55 56 return $html; 57 } 58 }
title
Description
Body
title
Description
Body
title
Description
Body
title
Body
| Generated: Tue Apr 3 11:40:28 2012 | Cross-referenced by PHPXref 0.7.1 |