| Server IP : 180.180.241.3 / Your IP : 216.73.216.35 Web Server : Microsoft-IIS/7.5 System : Windows NT NETWORK-NHRC 6.1 build 7601 (Windows Server 2008 R2 Standard Edition Service Pack 1) i586 User : IUSR ( 0) PHP Version : 5.3.28 Disable Function : NONE MySQL : ON | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : C:/AppServ/www/news/modules/mod_junewsultra/elements/ |
Upload File : |
<?php
class JElementMulticategory extends JElement
{
/**
* Element name
*
* @access protected
* @var string
*/
var $_name = 'Multicategory';
function fetchElement($name, $value, &$node, $control_name)
{
$db = &JFactory::getDBO();
$section = $node->attributes('section');
$class = $node->attributes('class');
if (!$class) {
$class = "inputbox";
}
if (!isset ($section)) {
$section = $node->attributes('scope');
if (!isset ($section)) {
$section = 'content';
}
}
$size = ( $node->attributes('size') ? $node->attributes('size') : 5 );
if ($section == 'content') {
$query = 'SELECT c.id AS value, CONCAT_WS( "/",s.title, c.title ) AS text' .
' FROM #__categories AS c' .
' LEFT JOIN #__sections AS s ON s.id=c.section' .
' WHERE c.published = 1' .
' AND s.scope = '.$db->Quote($section).
' ORDER BY s.title, c.title';
} else {
$query = 'SELECT c.id AS value, c.title AS text' .
' FROM #__categories AS c' .
' WHERE c.published = 1' .
' AND c.section = '.$db->Quote($section).
' ORDER BY c.title';
}
$db->setQuery($query);
$options = $db->loadObjectList();
return JHTML::_('select.genericlist', $options, ''.$control_name.'['.$name.'][]',
'class="inputbox" multiple="multiple" size="$size',
'value', 'text', $value, $control_name.$name);
}
}
?>