function fetchElement($name, $value, &$node, $control_name) { # cache activation $cache =& JFactory::getCache('JLanguage'); $admin = $cache->call('JLanguage::getKnownLanguages', JPATH_ADMINISTRATOR); $site = $cache->call('JLanguage::getKnownLanguages', JPATH_SITE); # only languages in both site and admin can be reference languages $languages = array(); foreach ($admin as $k => $v) { if (isset($site[$k])) { $languages[] = array('value' => $k, 'text' => $v['name']); } } # return the select box return JHTMLSelect::genericList($languages, '' . $control_name . '[' . $name . ']', 'class="inputbox"', 'value', 'text', $value, $control_name . $name); }
function fetchElement($name, $value, &$node, $control_name) { $doc = JFactory::getDocument(); $db = JFactory::getDBO(); if (FLEXI_J16GE) { $node =& $this->element; $attributes = get_object_vars($node->attributes()); $attributes = $attributes['@attributes']; } else { $attributes =& $node->_attributes; } $values = FLEXI_J16GE ? $this->value : $value; if (empty($values)) { $values = array(); } else { if (!is_array($values)) { $values = !FLEXI_J16GE ? array($values) : explode("|", $values); } } $fieldname = FLEXI_J16GE ? $this->name : $control_name . '[' . $name . ']'; $element_id = FLEXI_J16GE ? $this->id : $control_name . $name; // 'multiple' attribute in XML adds '[]' automatically in J2.5 and manually in J1.5 // This field is always multiple, we will add '[]' WHILE checking for the attribute ... $is_multiple = @$attributes['multiple'] == 'multiple' || @$attributes['multiple'] == 'true'; if (!FLEXI_J16GE || !$is_multiple) { $fieldname .= '[]'; } $plggroup = @$attributes['plggroup']; $plggroup = $plggroup ? $plggroup : 'content'; $query = 'SELECT element AS name' . ' FROM ' . (FLEXI_J16GE ? '#__extensions' : '#__plugins') . ' WHERE folder = ' . $db->Quote($plggroup) . (FLEXI_J16GE ? ' AND `type`=' . $db->Quote('plugin') : '') . ' AND element NOT IN (' . $db->Quote('pagebreak') . ',' . $db->Quote('pagenavigation') . ',' . $db->Quote('vote') . ')' . ' ORDER BY name'; $db->setQuery($query); $plgs = $db->loadObjectList(); $plugins = array(); //$plugins[] = JHTMLSelect::option('', JText::_( 'FLEXI_ENABLE_ALL_PLUGINS' )); foreach ($plgs as $plg) { $plugins[] = JHTMLSelect::option($plg->name, $plg->name); } $class = 'class="inputbox" multiple="multiple" size="5"'; $html = JHTMLSelect::genericList($plugins, $fieldname, $class, 'value', 'text', $values, $element_id); $onclick = "" . "{$element_id} = document.getElementById(\"{$element_id}\");" . "if ({$element_id}.size<40) {" . "\t{$element_id}_oldsize = {$element_id}.size;" . "\t{$element_id}.size=40;" . "} else {" . "\t{$element_id}.size = {$element_id}_oldsize;" . "}" . "parent = {$element_id}.getParent(); upcnt=0;" . "while(upcnt<10 && !parent.hasClass(\"jpane-slider\")) {" . "\tupcnt++; parent = parent.getParent();" . "}" . "if (parent.hasClass(\"jpane-slider\")) parent.setStyle(\"height\", \"auto\");"; $style = 'display:inline-block;' . (FLEXI_J16GE ? 'float:left; margin: 6px 0px 0px 18px;' : 'margin:0px 0px 6px 12px'); $maximize_link = "<a style='{$style}' href='javascript:;' onclick='{$onclick}' >Maximize/Minimize</a>"; return $html . $maximize_link; }
function fetchElement($name, $value, &$node, $control_name) { $images = array(); $images[] = JHTMLSelect::option('', JText::_('FLEXI_SELECT_IMAGE_FIELD')); $db = JFactory::getDBO(); if (FLEXI_J16GE) { $node =& $this->element; $attributes = get_object_vars($node->attributes()); $attributes = $attributes['@attributes']; } else { $attributes =& $node->_attributes; } $valcolumn = 'name'; if (@$attributes['valcolumn']) { $valcolumn = $attributes['valcolumn']; } $query = 'SELECT ' . $valcolumn . ' AS value, label AS text' . ' FROM #__flexicontent_fields' . ' WHERE published = 1' . ' AND field_type = ' . $db->Quote('image') . ' ORDER BY label ASC, id ASC'; $db->setQuery($query); $fields = $db->loadObjectList(); foreach ($fields as $field) { $images[] = JHTMLSelect::option($field->value, JText::_('FLEXI_FIELD') . ': ' . $field->text); } return JHTMLSelect::genericList($images, $control_name . '[' . $name . ']', $class = '', 'value', 'text', $value, $control_name . $name); }
function &getData() { $database =& JFactory::getDBO(); global $my, $mainframe; $option = "com_masscontent"; $contentSection = 0; $lists = null; $sectioncategories = 0; $javascript = "onchange=\"changeDynaList( 'catid', sectioncategories, document.adminForm.sectionid.options[document.adminForm.sectionid.selectedIndex].value, 0, 0);\""; //section $query = "SELECT s.id, s.title" . "\n FROM #__sections AS s" . "\n ORDER BY s.ordering"; $database->setQuery($query); $sections[] = JHTML::_('select.option', '-1', 'Select section', 'id', 'title'); $sections = array_merge($sections, $database->loadObjectList()); $lists['sectionid'] = JHTMLSelect::genericList($sections, 'sectionid', 'class="inputbox" size="1" ' . $javascript, 'id', 'title'); $contentSection = ''; foreach ($sections as $section) { if (isset($section->id)) { $section_list[] = $section->id; if (isset($sectionid)) { if ($section->id == $sectionid) { $contentSection = $section->title; } } } } $sectioncategories = array(); $sectioncategories[-1] = array(); $sectioncategories[-1][] = JHTML::_('select.option', '-1', 'Select Category', 'id', 'name'); JArrayHelper::toInteger($section_list); $section_list = 'section=' . implode(' OR section=', $section_list); $query = "SELECT id, title, section" . "\n FROM #__categories" . "\n WHERE ( {$section_list} )" . "\n ORDER BY ordering"; $database->setQuery($query); $cat_list = $database->loadObjectList(); /*foreach($sections as $section) { $sectioncategories[$section->id] = array(); $rows2 = array(); foreach($cat_list as $cat) { if ($cat->section == $section->id) { $rows2[] = $cat; } } foreach($rows2 as $row2) { $sectioncategories[$section->id][] = JHTML::_('select.option', $row2->id, $row2->name, 'id', 'name' ); } } */ foreach ($sections as $section) { if (isset($section->id)) { $sectioncategories[$section->id] = array(); } $rows2 = array(); foreach ($cat_list as $cat) { if (isset($section->id)) { $str_id = $section->id; } else { $str_id = ""; } if ($cat->section == $str_id) { $rows2[] = $cat; } } foreach ($rows2 as $row2) { $sectioncategories[$section->id][] = JHTML::_('select.option', $row2->id, $row2->title, 'id', 'name'); } } // get list of categories if (!isset($row->sectionid)) { $row->sectionid = 0; } if (!isset($row->catid)) { $row->catid = 0; } if (!$row->catid && !$row->sectionid) { $categories[] = JHTML::_('select.option', '0', 'Select Category', 'id', 'name'); $lists['catid'] = JHTMLSelect::genericList($categories, 'catid', 'class="inputbox" size="1"', 'id', 'name'); } else { $categoriesA = array(); if ($sectionid == 0) { foreach ($cat_list as $cat) { $categoriesA[] = $cat; } } else { //$where = "\n WHERE section = '$sectionid'"; foreach ($cat_list as $cat) { if ($cat->section == $sectionid) { $categoriesA[] = $cat; } } } $categories[] = JHTML::_('select.option', '0', 'Select Category', 'id', 'name'); $categories = array_merge($categories, $categoriesA); $lists['catid'] = JHTMLSelect::genericList($categories, 'catid', 'class="inputbox" size="1"', 'id', 'name', intval($row->catid)); } $lists['sectioncategories'] = $sectioncategories; return $lists; }
function &getData() { global $my, $mainframe; $database =& JFactory::getDBO(); $uid = 0; $scope = "content"; $option = "com_masscontent"; $row =& $this->getTable(); // load the row from the db table $row->load((int) $uid); $row->scope = $scope; $row->published = 1; $menus = array(); $javascript2 = "onchange=\"changeDynaList( 'menuselect3', menulist, document.adminForm.menuselect.options[document.adminForm.menuselect.selectedIndex].value, 0, 0);\""; // build the html select list for section types $types[] = JHTML::_('select.option', '', 'Select Type'); $types[] = JHTML::_('select.option', 'content_category', 'Category List Layout'); $types[] = JHTML::_('select.option', 'content_blog_category', 'Category Blog Layout'); $lists['link_type'] = JHTMLSelect::genericList($types, 'link_type', 'class="inputbox" size="1"', 'value', 'text'); // build the html select list for sections $query = "SELECT s.id AS value, s.title AS text" . "\n FROM #__sections AS s" . "\n ORDER BY s.ordering"; $database->setQuery($query); $sections = $database->loadObjectList(); $lists['section'] = JHTMLSelect::genericList($sections, 'section', 'class="inputbox" size="1"', 'value', 'text'); $menuTypes = $this->getMenuTypes(); foreach ($menuTypes as $menuType) { $menu[] = JHTML::_('select.option', $menuType, $menuType); } // build the html select list for the group access $lists['access'] = JHTML::_('list.accesslevel', $row); // build the html radio buttons for published $lists['published'] = JHTML::_('select.booleanlist', 'published', 'class="inputbox"', $row->published); $stop_notice = array(); $lists['menuselect3'] = JHTML::_('select.genericlist', $stop_notice, 'menuselect3', 'class="inputbox" size="10"', 'value', 'text', null); $lists['menulist'] = $this->createSubMenu(); $lists['menuselect'] = JHTML::_('select.genericlist', $menu, 'menuselect', 'class="inputbox" size="10" ' . $javascript2, 'value', 'text', null); return $lists; }
function &getData() { $database =& JFactory::getDBO(); global $mainframe, $my; $contentSection = 0; $lists = null; $sectioncategories = 0; if (!isset($id)) { $id = 0; } if (!isset($store)) { $store = ''; } $row =& $this->getTable(); $row->load($id); $javascript = "onchange=\"changeDynaList( 'catid', sectioncategories, document.adminForm.sectionid.options[document.adminForm.sectionid.selectedIndex].value, 0, 0);\""; $javascript2 = "onchange=\"changeDynaList( 'menuselect3', menulist, document.adminForm.menuselect.options[document.adminForm.menuselect.selectedIndex].value, 0, 0);\""; //section $query = "SELECT s.id, s.title" . "\n FROM #__sections AS s" . "\n ORDER BY s.ordering"; $database->setQuery($query); //$sections[] = JHTML::_('select.option', '-1', 'Static Content', 'id', 'title' ); $sections[] = JHTML::_('select.option', $store, JText::_(ucfirst($store)), 'id', 'title'); $sections = array_merge($sections, $database->loadObjectList()); $lists['sectionid'] = JHTMLSelect::genericList($sections, 'sectionid', 'class="inputbox" size="1" ' . $javascript, 'id', 'title'); $contentSection = ''; foreach ($sections as $section) { if (isset($section->id)) { $section_list[] = $section->id; if (isset($sectionid)) { if ($section->id == $sectionid) { $contentSection = $section->title; } } } } $sectioncategories = array(); $sectioncategories[-1] = array(); $sectioncategories[-1][] = JHTML::_('select.option', '-1', 'Select Category', 'id', 'name'); JArrayHelper::toInteger($section_list); $section_list = 'section=' . implode(' OR section=', $section_list); $query = "SELECT id, title, section" . "\n FROM #__categories" . "\n WHERE ( {$section_list} )" . "\n ORDER BY ordering"; $database->setQuery($query); $cat_list = $database->loadObjectList(); foreach ($sections as $section) { if (isset($section->id)) { $sectioncategories[$section->id] = array(); } $rows2 = array(); foreach ($cat_list as $cat) { if (isset($section->id)) { $str_id = $section->id; } else { $str_id = ""; } if ($cat->section == $str_id) { $rows2[] = $cat; } } foreach ($rows2 as $row2) { $sectioncategories[$section->id][] = JHTML::_('select.option', $row2->id, $row2->title, 'id', 'name'); } } // get list of categories if (!isset($row->sectionid)) { $row->sectionid = 0; } if (!isset($row->catid)) { $row->catid = 0; } if (!$row->catid && !$row->sectionid) { $categories[] = JHTML::_('select.option', '0', 'Select Category', 'id', 'name'); $lists['catid'] = JHTMLSelect::genericList($categories, 'catid', 'class="inputbox" size="1"', 'id', 'name'); } else { $categoriesA = array(); if ($sectionid == 0) { foreach ($cat_list as $cat) { $categoriesA[] = $cat; } } else { //$where = "\n WHERE section = '$sectionid'"; foreach ($cat_list as $cat) { if ($cat->section == $sectionid) { $categoriesA[] = $cat; } } } $categories[] = JHTML::_('select.option', '0', 'Select Category', 'id', 'name'); $categories = array_merge($categories, $categoriesA); $lists['catid'] = JHTMLSelect::genericList($categories, 'catid', 'class="inputbox" size="1"', 'id', 'name', intval($row->catid)); } // build the html select list for ordering $query = "SELECT ordering AS value, title AS text" . "\n FROM #__content" . "\n WHERE catid = " . (int) $row->catid . "\n AND state >= 0" . "\n ORDER BY ordering"; $uid = ""; $row->ordering = null; $lists['ordering'] = JHTML::_('list.specificordering', $row, $uid, $query, 1); /* $error_ordering= array(); $error_ordering=""; $row = array_merge( $row, $error_ordering ); */ // build the html select list for menu selection $menu3 = array(); $menulist = array(); $menuTypes = $this->getMenuTypes(); foreach ($menuTypes as $menuType) { $menu[] = JHTML::_('select.option', $menuType, $menuType); } $stop_notice = array(); $lists['menuselect3'] = JHTML::_('select.genericlist', $stop_notice, 'menuselect3', 'class="inputbox" size="10"', 'value', 'text', null); $lists['menuselect'] = JHTML::_('select.genericlist', $menu, 'menuselect', 'class="inputbox" size="10" ' . $javascript2, 'value', 'text', null); // build the html select list for the group access $lists['access'] = JHTML::_('list.accesslevel', $row); // build list of users $lists['created_by'] = JHTML::_('list.users', 'created_by', 1); //load params jimport('joomla.application.component.helper'); $lists['sectioncategories'] = $sectioncategories; $lists['menulist'] = $this->createSubMenu(); return $lists; }