AAAAhome/academiac/www/administrator/components/com_newsfeeds/models/fields/ordering.php000064400000004044151372124420025153 0ustar00element['class'] ? ' class="'.(string) $this->element['class'].'"' : ''; $attr .= ((string) $this->element['disabled'] == 'true') ? ' disabled="disabled"' : ''; $attr .= $this->element['size'] ? ' size="'.(int) $this->element['size'].'"' : ''; // Initialize JavaScript field attributes. $attr .= $this->element['onchange'] ? ' onchange="'.(string) $this->element['onchange'].'"' : ''; // Get some field values from the form. $newsfeedId = (int) $this->form->getValue('id'); $categoryId = (int) $this->form->getValue('catid'); // Build the query for the ordering list. $query = 'SELECT ordering AS value, name AS text' . ' FROM #__newsfeeds' . ' WHERE catid = ' . (int) $categoryId . ' ORDER BY ordering'; // Create a read-only list (no name) with a hidden input to store the value. if ((string) $this->element['readonly'] == 'true') { $html[] = JHtml::_('list.ordering', '', $query, trim($attr), $this->value, $newsfeedId ? 0 : 1); $html[] = ''; } // Create a regular list. else { $html[] = JHtml::_('list.ordering', $this->name, $query, trim($attr), $this->value, $newsfeedId ? 0 : 1); } return implode($html); } }