function td_getOrderStatusSelect($select, $id) { OrderStatus::init(); return JHtmlSelect::genericlist(OrderStatus::$map, $id, 'class="td_orderstatus input-small"', 'value', 'text', $select); }
function display($tpl = null) { $option = JRequest::getCmd('option'); $mainframe = JFactory::getApplication(); $project_id = $mainframe->getUserState($option . 'project'); $uri = JFactory::getURI()->toString(); $user = JFactory::getUser(); // Get data from the model $items = $this->get('Data'); $total = $this->get('Total'); $pagination = $this->get('Pagination'); $model = $this->getModel(); $projectws = $this->get('Data', 'project'); $division = $mainframe->getUserStateFromRequest($option . 'tt_division', 'division', '', 'string'); //build the html options for divisions $divisions[] = JHtmlSelect::option('0', JText::_('COM_JOOMLEAGUE_GLOBAL_SELECT_DIVISION')); $mdlDivisions = JModelLegacy::getInstance("divisions", "JoomLeagueModel"); if ($res = $mdlDivisions->getDivisions($project_id)) { $divisions = array_merge($divisions, $res); } $lists['divisions'] = $divisions; unset($divisions); $this->user = $user; $this->lists = $lists; $this->items = $items; $this->projectws = $projectws; $this->division = $division; $this->total = $total; $this->pagination = $pagination; $this->request_url = $uri; $this->addToolbar(); parent::display($tpl); }
/** * Method to get the radio button field input markup. * * @return string The field input markup. * * @since 1.0.1 */ public function getInput() { // Initialize variables. $html = array(); $attr = ''; // Initialize some field attributes. $attr .= $this->element['class'] ? ' class="' . (string) $this->element['class'] . '"' : ''; // To avoid user's confusion, readonly="true" should imply disabled="true". if ((string) $this->element['readonly'] == 'true' || (string) $this->element['disabled'] == 'true') { $attr .= ' disabled="disabled"'; } $attr .= $this->element['size'] ? ' size="' . (int) $this->element['size'] . '"' : ''; $attr .= $this->multiple ? ' multiple="multiple"' : ''; // Initialize JavaScript field attributes. $attr .= $this->element['onchange'] ? ' onchange="' . (string) $this->element['onchange'] . '"' : ''; $attr .= $this->element['ondblclick'] ? ' ondblclick="' . (string) $this->element['ondblclick'] . '"' : ''; // Get the field options. $options = (array) $this->getOptions(); // Create a read-only list (no name) with a hidden input to store the value. if ((string) $this->element['readonly'] == 'true') { $html[] = JHtmlSelect::genericlist($options, '', trim($attr), 'value', 'text', $this->value, $this->id); $html[] = '<input type="hidden" name="' . $this->name . '" value="' . htmlspecialchars($this->value, ENT_COMPAT, 'UTF-8') . '"/>'; } else { $html[] = JHtmlSelect::genericlist($options, $this->name, trim($attr), 'value', 'text', $this->value, $this->id); } return implode($html); }
/** * combobox với một danh mục đơn giản * @param string $table * @param string $field * @param string $where * @param string $order * @param string $text * @param string $code * @param string $name * @param string $selected * @param string $idname * @param string $class * @param string $attrArray */ public function getCbo($table, $field, $where = null, $order, $text, $code, $name, $selected = null, $idname = null, $class = null, $attrArray = null) { $db = JFactory::getDbo(); $query = $db->getQuery(true); $query->select(array($field))->from($table); if ($where != null || $where != "") { $query->where($where); } $query->order($order); $db->setQuery($query); $tmp = $db->loadObjectList(); $data = array(); array_push($data, array('value', 'text' => $text)); for ($i = 0; $i < count($tmp); $i++) { $attr = array(); if (isset($attrArray) && is_array($attrArray)) { foreach ($attrArray as $k => $v) { $attr += array($k => $tmp[$i]->{$v}); } } if (!isset($attr) && !is_array($attr)) { array_push($data, array('value' => $tmp[$i]->{$code}, 'text' => $tmp[$i]->{$name})); } else { array_push($data, array('value' => $tmp[$i]->{$code}, 'text' => $tmp[$i]->{$name}, 'attr' => $attr)); } } $options = array('id' => $idname, 'list.attr' => array('class' => $class), 'option.key' => 'value', 'option.text' => 'text', 'option.attr' => 'attr', 'list.select' => $selected); return $result = JHtmlSelect::genericlist($data, $idname, $options); }
function _displayModal($tpl) { JToolBarHelper::title(JText::_('COM_JOOMLEAGUE_ADMIN_PERSON_ASSIGN_DESCR')); // Do not allow cache JResponse::allowCache(false); $document = JFactory::getDocument(); $prjid = array(); $prjid = JRequest::getVar('prjid', array(0), 'post', 'array'); $proj_id = (int) $prjid[0]; //build the html select list for projects $projects[] = JHtml::_('select.option', '0', JText::_('COM_JOOMLEAGUE_GLOBAL_SELECT_PROJECT'), 'id', 'name'); if ($res = JoomleagueHelper::getProjects()) { $projects = array_merge($projects, $res); } $lists['projects'] = JHtmlSelect::genericlist($projects, 'prjid[]', 'class="inputbox" onChange="this.form.submit();" style="width:170px"', 'id', 'name', $proj_id); unset($projects); $projectteams[] = JHtmlSelect::option('0', JText::_('COM_JOOMLEAGUE_GLOBAL_SELECT_TEAM'), 'value', 'text'); // if a project is active we show the teams select list if ($proj_id > 0) { if ($res = JoomleagueHelper::getProjectteams($proj_id)) { $projectteams = array_merge($projectteams, $res); } $lists['projectteams'] = JHtmlSelect::genericlist($projectteams, 'xtid[]', 'class="inputbox" style="width:170px"', 'value', 'text'); unset($projectteams); } $this->lists = $lists; $this->project_id = $proj_id; parent::display($tpl); }
function getParentBox($select) { $options = array(); $db = JFactory::getDbo(); $query = $db->getQuery(true); $query->select('a.id as value, a.title as text, a.level'); $query->from('#__bookpro_dest AS a'); $query->join('LEFT', $db->quoteName('#__bookpro_dest') . ' AS b ON a.lft > b.lft AND a.rgt < b.rgt'); $query->where('a.state IN (0,1)'); $query->group('a.id, a.title, a.level, a.lft, a.rgt, a.parent_id'); $query->order('a.lft ASC'); // Get the options. $db->setQuery($query); $options = $db->loadObjectList(); // Check for a database error. if ($db->getErrorNum()) { JError::raiseWarning(500, $db->getErrorMsg()); } // Pad the option text with spaces using depth level as a multiplier. for ($i = 0, $n = count($options); $i < $n; $i++) { // Translate ROOT if ($options[$i]->level == 0) { $options[$i]->text = JText::_('JGLOBAL_ROOT_PARENT'); } $options[$i]->text = str_repeat('- ', $options[$i]->level) . $options[$i]->text; } array_unshift($options, JHtml::_('select.option', 1, JText::_('JGLOBAL_ROOT'))); return JHtmlSelect::genericlist($options, 'parent_id', '', 'value', 'text', $select); }
function _displayDefault($tpl) { $app = JFactory::getApplication(); $jinput = $app->input; $option = $jinput->getCmd('option'); $db = JFactory::getDbo(); $uri = JFactory::getURI(); $node = $this->get('Data'); $total = $this->get('Total'); $pagination = $this->get('Pagination'); $model = $this->getModel(); $projectws = $this->get('Data', 'project'); $treetows = $this->get('Data', 'treeto'); //build the html options for teams $team_id[] = JHtml::_('select.option', '0', JText::_('COM_JOOMLEAGUE_GLOBAL_SELECT_TEAM')); if ($projectteams = $model->getProjectTeamsOptions()) { $team_id = array_merge($team_id, $projectteams); } $lists['team'] = $team_id; unset($team_id); $style = 'style="background-color: #dddddd; '; $style .= 'border: 0px solid white;'; $style .= 'font-weight: normal; '; $style .= 'font-size: 8pt; '; $style .= 'width: 150px; '; $style .= 'font-family: verdana; '; $style .= 'text-align: center;"'; $path = 'media/com_joomleague/treebracket/onwhite/'; // build the html radio for adding into new round / exist round $createYesNo = array(0 => JText::_('COM_JOOMLEAGUE_GLOBAL_NO'), 1 => JText::_('COM_JOOMLEAGUE_GLOBAL_YES')); $createLeftRight = array(0 => JText::_('L'), 1 => JText::_('R')); $ynOptions = array(); $lrOptions = array(); foreach ($createYesNo as $key => $value) { $ynOptions[] = JHtmlSelect::option($key, $value); } foreach ($createLeftRight as $key => $value) { $lrOptions[] = JHtmlSelect::option($key, $value); } $lists['addToRound'] = JHtmlSelect::radiolist($ynOptions, 'addToRound', 'class="inputbox"', 'value', 'text', 1); // build the html radio for auto publish new matches $lists['autoPublish'] = JHtmlSelect::radiolist($ynOptions, 'autoPublish', 'class="inputbox"', 'value', 'text', 0); // build the html radio for Left or Right redepth $lists['LRreDepth'] = JHtmlSelect::radiolist($lrOptions, 'LRreDepth', 'class="inputbox"', 'value', 'text', 0); // build the html radio for create new treeto $lists['createNewTreeto'] = JHtmlSelect::radiolist($ynOptions, 'createNewTreeto', 'class="inputbox"', 'value', 'text', 1); $this->lists = $lists; $this->node = $node; // @todo fix! // $this->roundcode',$roundcode); $this->style = $style; $this->path = $path; $this->projectws = $projectws; $this->treetows = $treetows; $this->total = $total; $this->pagination = $pagination; $this->request_url = $uri->toString(); parent::display($tpl); }
protected function getTourList() { $tours = $this->tours; foreach ($tours as $tour) { $tour->title .= ' - ' . $tour->code; } return JHtmlSelect::genericlist($tours, 'filter_tour_id', '', 'id', 'title', $this->state->get('filter.tour_id')); }
protected function getInput() { $options = array(); $options[] = JHTML::_('select.option', '', JText::_('COM_BOOKPRO_SELECT_DURATION')); for ($i = 1; $i < 40; $i++) { $options[] = JHtmlSelect::option($i, $i, 'value', 'text'); } return JHTML::_('select.genericlist', $options, $this->name, ' class="inputbox" ', 'value', 'text', $this->value, $this->id); }
static function getFilterInteger($field, $noSelectText, $start, $end, $selected, $autoSubmit = false, $customParams = '') { $options = array(); $options[] = JHtmlSelect::option(0, $noSelectText); for ($i = $start; $i <= $end; $i++) { $options[] = JHtmlSelect::option($i, $i); } $customParams = array(trim($customParams)); if ($autoSubmit) { $customParams[] = 'onchange="this.form.submit()"'; } $customParams = implode(' ', $customParams); return JHTML::_('select.genericlist', $options, $field, $customParams, 'value', 'text', $selected); }
public function display($tpl = null) { $app = JFactory::getApplication(); $jinput = $app->input; $option = $jinput->getCmd('option'); $app = JFactory::getApplication(); $uri = JFactory::getURI(); $user = JFactory::getUser(); $model = $this->getModel(); $lists = array(); //get template data $template = $this->get('data'); $isNew = $template->id < 1; // fail if checked out not by 'me' if ($model->isCheckedOut($user->get('id'))) { $msg = JText::sprintf('DESCBEINGEDITTED', JText::_('COM_JOOMLEAGUE_ADMIN_TEMPLATE_THETEMPLATE'), $template->name); $app->redirect('index.php?option=' . $option, $msg); } $projectws = $this->get('Data', 'project'); $templatepath = JPATH_COMPONENT_SITE . '/settings'; $xmlfile = $templatepath . '/default/' . $template->template . '.xml'; $extensions = JoomleagueHelper::getExtensions(JRequest::getInt('p')); foreach ($extensions as $e => $extension) { $extensiontpath = JPATH_COMPONENT_SITE . '/extensions/' . $extension; if (is_dir($extensiontpath . '/settings/default')) { if (file_exists($extensiontpath . '/settings/default/' . $template->template . '.xml')) { $xmlfile = $extensiontpath . '/settings/default/' . $template->template . '.xml'; } } } $form = JForm::getInstance($template->template, $xmlfile, array('control' => 'params')); $form->bind($template->params); $master_id = $projectws->master_template ? $projectws->master_template : '-1'; $templates = array(); //$templates[]=JHtml::_('select.option','0',JText::_('COM_JOOMLEAGUE_ADMIN_TEMPLATE_OTHER_TEMPLATE' ),'value','text'); if ($res = $model->getAllTemplatesList($projectws->id, $master_id)) { $templates = array_merge($templates, $res); } $lists['templates'] = JHtmlSelect::genericlist($templates, 'select_id', 'class="inputbox" size="1" onchange="javascript: Joomla.submitbutton(\'template.apply\');"', 'value', 'text', $template->id); unset($res); unset($templates); $this->request_url = $uri->toString(); $this->template = $template; $this->form = $form; $this->project = $projectws; $this->lists = $lists; $this->user = $user; $this->addToolbar(); parent::display($tpl); }
public function getCboLoaitaisan($select = null) { $db = JFactory::getDbo(); $query = $db->getQuery(true); $query->select(array('id', 'tenloaitaisan'))->from($db->quoteName('kkts_taisan'))->where('status=1 and parent_id = 0'); $query->order('orders'); $db->setQuery($query); $arrChuyennganh = $db->loadObjectList(); $data = array(); array_push($data, array('value' => "0", 'text' => "--Chọn tài sản cha--")); for ($i = 0; $i < sizeof($arrChuyennganh); $i++) { array_push($data, array('value' => $arrChuyennganh[$i]->id, 'text' => $arrChuyennganh[$i]->tenloaitaisan)); } $options = array('id' => 'parent_id', 'option.key' => 'value', 'option.text' => 'text', 'option.attr' => 'attr', 'list.select' => $select); return $result = JHtmlSelect::genericlist($data, 'parent_id', $options); }
/** * Lấy thông tin Cán bộ theo donvi_id, đưa vào <select>, tự động selected option ứng với $select * @param int $donvi_id donvi_id * @param int $select id để selected * @return string */ public function getCanboById($donvi_id, $select = null) { // lấy danh sách cán bộ tại đơn vị theo inst_code -> từ tree, select = option đã chọn $db = JFactory::getDbo(); $query = $db->getQuery(true); $query->select('hosochinh_id as id, hoten as e_name')->from('hosochinh_quatrinhhientai ht')->where('( ' . $db->quoteName('ht.congtac_donvi_id') . '=' . $db->quote($donvi_id) . ' OR ' . $db->quoteName('ht.congtac_phong_id') . '=' . $db->quote($donvi_id) . ')')->where('ht.hoso_trangthai= "00"'); $donviloaitru = Core::getUnManageDonvi(JFactory::getUser()->id, 'com_hoso', 'treeview', 'treequyhoach'); if ($donviloaitru != '') { $query->where('ht.congtac_donvi_id NOT IN (' . $donviloaitru . ') and ht.congtac_phong_id NOT IN (' . $donviloaitru . ')'); } $db->setQuery($query); $arrCanbo = $db->loadObjectList(); $data = array(); array_push($data, array('value' => "", 'text' => "--Chọn CBCC--")); for ($i = 0; $i < sizeof($arrCanbo); $i++) { array_push($data, array('value' => $arrCanbo[$i]->id, 'text' => $arrCanbo[$i]->e_name)); } $options = array('id' => 'emp_id', 'option.key' => 'value', 'option.text' => 'text', 'option.attr' => 'attr', 'list.select' => $select); return $result = JHtmlSelect::genericlist($data, 'emp_id', $options); }
function getZoneList() { $app = JFactory::getApplication(); $post = $app->input->getArray($_POST); if ($post['country_id']) { $model = F0FModel::getTmpInstance('Zones', 'J2storeModel'); $model->setState('country_id', $post['country_id']); $zones = $model->getList(true); } $model->clearState(); $options = array(); if (!empty($zones)) { foreach ($zones as $zone) { $options[] = JHtml::_('select.option', $zone->j2store_zone_id, $zone->zone_name); } } $default = $post['zone_id']; echo JHtmlSelect::genericlist($options, $post['field_name'], '', 'value', 'text', $default, $post['field_id']); $app->close(); }
public static function getProductOptionValues($option_id, $default, $product_optionvalue_id) { //load option values for this option id from the general and pass the default value to it. $db = JFactory::getDbo(); $query = $db->getQuery(true); $query->select('ov.optionvalue_id,ov.optionvalue_name'); $query->from('#__k2store_optionvalues AS ov'); $query->where('ov.option_id=' . $option_id); $query->order('ov.ordering ASC'); $db->setQuery($query); $rows = $db->loadObjectList(); $list = array(); if (count($rows)) { foreach ($rows as $row) { $options[] = JHtmlSelect::option($row->optionvalue_id, $row->optionvalue_name); } $name = "optionvalue_id[{$product_optionvalue_id}]"; $attribs = array('class' => 'inputbox', 'size' => '1', 'title' => JText::_('K2STORE_SELECT_AN_OPTION')); $list = JHtmlSelect::genericlist($options, $name, $attribs, 'value', 'text', $default, 'optionvalue_id'); } return $list; }
function _displayDefault($tpl) { $option = JRequest::getCmd('option'); $uri = JFactory::getURI(); $url = $uri->toString(); $matchday = $this->get('Data'); $total = $this->get('Total'); $pagination = $this->get('Pagination'); $model = $this->getModel(); $projectws = $this->get('Data', 'project'); $teams = $this->get('projectteams'); $state = $this->get('state'); $filter_order = $state->get('filter_order'); $filter_order_Dir = $state->get('filter_order_Dir'); // table ordering $lists['order_Dir'] = $filter_order_Dir; $lists['order'] = $filter_order; $massadd = $this->input->get('massadd'); //build the html options for divisions $divisions[] = JHtmlSelect::option('0', JText::_('COM_JOOMLEAGUE_GLOBAL_SELECT_DIVISION')); $mdlDivisions = JModelLegacy::getInstance("divisions", "JoomLeagueModel"); if ($res = $mdlDivisions->getDivisions($projectws->id)) { $divisions = array_merge($divisions, $res); } $lists['divisions'] = $divisions; $this->massadd = $massadd; $this->countProjectTeams = count($teams); $this->lists = $lists; $this->matchday = $matchday; $this->projectws = $projectws; $this->pagination = $pagination; $this->request_url = $url; $populate = 0; $this->populate = $populate; $this->addToolbar(); parent::display($tpl); }
protected function getOptions() { $options = array(); $this->value = array(); // The selected values // Deduce table name from conventional names $input = new F0FInput(); $component_prefix = ucfirst(str_replace('com_', '', $input->getString('option'))); $view_prefix = ucfirst($input->getString('view')); // Deduce name of the relation $relation_name = @F0FInflector::pluralize($this->element['name']); // todo remove silence operator // Create a relation's model instance $relation_model = F0FModel::getTmpInstance(ucfirst($relation_name), $component_prefix . 'Model'); // Get the name of key and title field $table = $relation_model->getTable(); $key_field = $table->getKeyName(); $value_field = $table->getColumnAlias('title'); // List all items from the referred table foreach ($relation_model->getItemList(true) as $value) { $options[] = JHtmlSelect::option($value->{$key_field}, $value->{$value_field}); } // Don't load selected values if item is new if ($id = $input->getInt('id')) { // Create an instance of the correct table and load this item $table = F0FTable::getInstance($view_prefix, $component_prefix . 'Table'); // Load the instance of this item, based on ID query parameter $table->load($id); // Get the relation $relation = $table->getRelations()->getMultiple($relation_name); // Add existent relation as default selected values on list foreach ($relation as $item) { $this->value[] = $item->getId(); } } return $options; }
/** * Method to get the field input for module layouts. * * @return string The field input. * * @since 11.1 */ protected function getInput() { // Load Dependencies $doc = JFactory::getDocument(); $doc->addStyleSheet(JURI::root(TRUE) . '/libraries/xef/assets/css/image-picker.css'); $doc->addScript(JURI::root(TRUE) . '/libraries/xef/assets/js/image-picker.min.js'); $js = 'jQuery(document).ready(function(){ jQuery(".img-list").imagepicker({show_label: true}); });'; $doc->addScriptDeclaration($js); // Get the client id. $clientId = $this->element['client_id']; if (is_null($clientId) && $this->form instanceof JForm) { $clientId = $this->form->getValue('client_id'); } $clientId = (int) $clientId; $client = JApplicationHelper::getClientInfo($clientId); // Get the module. $module = (string) $this->element['module']; if (empty($module) && $this->form instanceof JForm) { $module = $this->form->getValue('module'); } $module = preg_replace('#\\W#', '', $module); // Get the template. $template = (string) $this->element['template']; $template = preg_replace('#\\W#', '', $template); // Get the style. if ($this->form instanceof JForm) { $template_style_id = $this->form->getValue('template_style_id'); } $template_style_id = preg_replace('#\\W#', '', $template_style_id); // If an extension and view are present build the options. if ($module && $client) { // Load language file $lang = JFactory::getLanguage(); $lang->load($module . '.sys', $client->path, null, false, false) || $lang->load($module . '.sys', $client->path . '/modules/' . $module, null, false, false) || $lang->load($module . '.sys', $client->path, $lang->getDefault(), false, false) || $lang->load($module . '.sys', $client->path . '/modules/' . $module, $lang->getDefault(), false, false); // Get the database object and a new query object. $db = JFactory::getDBO(); $query = $db->getQuery(true); // Build the query. $query->select('element, name'); $query->from('#__extensions as e'); $query->where('e.client_id = ' . (int) $clientId); $query->where('e.type = ' . $db->quote('template')); $query->where('e.enabled = 1'); if ($template) { $query->where('e.element = ' . $db->quote($template)); } if ($template_style_id) { $query->join('LEFT', '#__template_styles as s on s.template=e.element'); $query->where('s.id=' . (int) $template_style_id); } // Set the query and load the templates. $db->setQuery($query); $templates = $db->loadObjectList('element'); // Check for a database error. if ($db->getErrorNum()) { JError::raiseWarning(500, $db->getErrorMsg()); } // Build the search paths for module layouts. $module_path = JPath::clean($client->path . '/modules/' . $module . '/tmpl'); // Prepare array of component layouts $module_layouts = array(); // Prepare the grouped list $data = array(); // Add the layout options from the module path. if (is_dir($module_path) && ($module_layouts = JFolder::files($module_path, '^[^_]*\\.php$'))) { foreach ($module_layouts as $file) { // Add an option to the module group $value = JFile::stripExt($file); $text = $lang->hasKey($key = strtoupper($module . '_LAYOUT_' . $value)) ? JText::_($key) : $value; $image_path = JURI::root(TRUE) . '/modules/' . $module . '/tmpl/' . $value . '.png'; $data[] = array('value' => $value, 'text' => $text, 'attr' => array('data-img-src' => $image_path)); } } // Loop on all templates if ($templates) { foreach ($templates as $template) { // Load language file $lang->load('tpl_' . $template->element . '.sys', $client->path, null, false, false) || $lang->load('tpl_' . $template->element . '.sys', $client->path . '/templates/' . $template->element, null, false, false) || $lang->load('tpl_' . $template->element . '.sys', $client->path, $lang->getDefault(), false, false) || $lang->load('tpl_' . $template->element . '.sys', $client->path . '/templates/' . $template->element, $lang->getDefault(), false, false); $template_path = JPath::clean($client->path . '/templates/' . $template->element . '/html/' . $module); // Add the layout options from the template path. if (is_dir($template_path) && ($files = JFolder::files($template_path, '^[^_]*\\.php$'))) { foreach ($files as $i => $file) { // Remove layout that already exist in component ones if (in_array($file, $module_layouts)) { unset($files[$i]); } } if (count($files)) { foreach ($files as $file) { // Add an option to the template group $value = JFile::stripExt($file); $text = $lang->hasKey($key = strtoupper('TPL_' . $template->element . '_' . $module . '_LAYOUT_' . $value)) ? JText::_($key) : $value; $image_path = JURI::root(TRUE) . '/templates/' . $template->element . '/html/' . $module . '/' . $value . '.png'; if (!file_exists($image_path)) { $image_path = JURI::root(TRUE) . '/libraries/xef/assets/images/imagepicker_layout_not_found.png'; } $data[] = array('value' => $value, 'text' => $text, 'attr' => array('data-img-src' => $image_path)); } } } } } // Compute the current selected values $selected = array($this->value); // Pass all options $options = array('id' => $this->id, 'list.attr' => array('class' => 'img-list'), 'list.translate' => false, 'option.key' => 'value', 'option.text' => 'text', 'option.attr' => 'attr', 'list.select' => $selected); $html = JHtmlSelect::genericlist($data, $this->name, $options); return $html; } else { return ''; } }
function view() { $app = JFactory::getApplication(); require_once JPATH_ADMINISTRATOR . '/components/com_j2store/library/select.php'; J2StoreToolBar::_custom('save', 'save', 'save', 'JTOOLBAR_SAVE', false, 'shippingTask'); J2StoreToolBar::_custom('cancel', 'cancel', 'cancel', 'JTOOLBAR_CLOSE', false, 'shippingTask'); JToolBarHelper::title(JText::_('J2STORE_SHIPM_SHIPPING_METHODS'), 'j2store-logo'); $id = $app->input->getInt('id', '0'); $sid = $app->input->getInt('sid', '0'); $this->includeCustomModel('ShippingMethods'); $this->includeCustomTables(); $model = JModelLegacy::getInstance('ShippingMethods', 'J2StoreModel'); $model->setId((int) $sid); $item = $model->getItem(); if (!isset($item)) { $item = JTable::getInstance('ShippingMethods', 'Table'); } $data = array(); $data['published'] = JHTML::_('select.booleanlist', 'published', 'class=""', $item->published); $data['taxclass'] = J2StoreSelect::taxclass($item->tax_class_id, 'tax_class_id'); $data['shippingtype'] = J2StoreSelect::shippingtype($item->shipping_method_type, 'shipping_method_type', '', 'shipping_method_type', false); $options = array(); $options[] = JHtml::_('select.option', 'no', JText::_('JNO')); $options[] = JHtml::_('select.option', 'store', JText::_('J2STORE_SHIPPING_STORE_ADDRESS')); $data['address_override'] = JHtmlSelect::genericlist($options, 'address_override', array(), 'value', 'text', $item->address_override); // Form $form = array(); $form['action'] = $this->baseLink(); $form['shippingTask'] = 'save'; //We are calling a view from the ShippingMethods we isn't actually the same controller this has, however since all it does is extend the base view it is // all good, and we don't need to remake getView() $view = $this->getView('ShippingMethods', 'html'); $view->hidemenu = true; $view->hidestats = true; //$view->setTask(true); $view->setModel($model, true); $view->assign('item', $item); $view->assign('data', $data); $view->assign('form2', $form); $view->setLayout('view'); $view->display(); }
function display($tpl = null) { $option = JRequest::getCmd('option'); $mainframe = JFactory::getApplication(); $uri = JFactory::getURI(); $params = JComponentHelper::getParams($option); $filter_state = $mainframe->getUserStateFromRequest($option . 'mc_filter_state', 'filter_state', '', 'word'); $filter_order = $mainframe->getUserStateFromRequest($option . 'mc_filter_order', 'filter_order', 'mc.match_number', 'cmd'); $filter_order_Dir = $mainframe->getUserStateFromRequest($option . 'mc_filter_order_Dir', 'filter_order_Dir', '', 'word'); $search = $mainframe->getUserStateFromRequest($option . 'mc_search', 'search', '', 'string'); $search_mode = $mainframe->getUserStateFromRequest($option . 'mc_search_mode', 'search_mode', '', 'string'); $division = $mainframe->getUserStateFromRequest($option . 'mc_division', 'division', '', 'string'); $project_id = $mainframe->getUserState($option . 'project'); $search = JString::strtolower($search); $matches = $this->get('Data'); $total = $this->get('Total'); $pagination = $this->get('Pagination'); $model = $this->getModel(); $projectteams = $model->getProjectTeams(); // state filter $lists['state'] = JHtml::_('grid.state', $filter_state); // table ordering $lists['order_Dir'] = $filter_order_Dir; $lists['order'] = $filter_order; // search filter $lists['search'] = $search; $lists['search_mode'] = $search_mode; $projectws = $this->get('Data', 'project'); $roundws = $this->get('Data', 'round'); //build the html options for teams foreach ($matches as $row) { $teams[] = JHtml::_('select.option', '0', JText::_('COM_JOOMLEAGUE_GLOBAL_SELECT_TEAM')); $divhomeid = 0; //apply the filter only if both teams are from the same division //teams are not from the same division in tournament mode with divisions if ($row->divhomeid == $row->divawayid) { $divhomeid = $row->divhomeid; } else { $row->divhomeid = 0; $row->divawayid = 0; } if ($projectteams = $model->getProjectTeamsOptions($divhomeid)) { $teams = array_merge($teams, $projectteams); } $lists['teams_' + $divhomeid] = $teams; unset($teams); } //build the html selectlist for rounds $model = $this->getModel('project'); $ress = JoomleagueHelper::getRoundsOptions($model->_id, 'ASC', true); $project_roundslist = array(); foreach ($ress as $res) { $project_roundslist[] = JHtml::_('select.option', $res->id, $this->getRoundDescription($res)); } $lists['project_rounds'] = JHtml::_('select.genericList', $project_roundslist, 'rid[]', 'class="inputbox" ' . 'onChange="document.getElementById(\'short_act\').value=\'rounds\';' . 'document.roundForm.submit();" ', 'value', 'text', $roundws->id); $lists['project_rounds2'] = JHtml::_('select.genericList', $project_roundslist, 'rid', 'class="inputbox" ', 'value', 'text', $roundws->id); //build the html selectlist for matches $overall_config = $model->getTemplateConfig('overall'); if (isset($overall_config['use_jl_substitution']) && $overall_config['use_jl_substitution'] || isset($overall_config['use_jl_events']) && $overall_config['use_jl_events']) { $match_list = array(); $mdd[] = JHtml::_('select.option', '0', JText::_('COM_JOOMLEAGUE_GLOBAL_SELECT_MATCH')); foreach ($matches as $row) { $mdd[] = JHtml::_('select.option', 'index3.php?option=com_joomleague&task=match.editEvents&cid[0]=' . $row->id, $row->team1 . '-' . $row->team2); } $RosterEventMessage = isset($overall_config['use_jl_substitution']) && $overall_config['use_jl_substitution'] ? JText::_('COM_JOOMLEAGUE_ADMIN_MATCHES_LINEUP') : ''; if (isset($overall_config['use_jl_events']) && $overall_config['use_jl_events']) { if (isset($overall_config['use_jl_events']) && $overall_config['use_jl_substitution']) { $RosterEventMessage .= ' / '; } $RosterEventMessage .= JText::_('COM_JOOMLEAGUE_ADMIN_MATCHES_EVENTS'); } $RosterEventMessage .= $RosterEventMessage != '' ? ':' : ''; $lists['RosterEventMessage'] = $RosterEventMessage; $lists['round_matches'] = JHtml::_('select.genericList', $mdd, 'mdd', 'id="mdd" class="inputbox" onchange="jl_load_new_match_events(this,\'eventscontainer\')"', 'value', 'text', '0'); } //build the html options for extratime $match_result_type[] = JHtmlSelect::option('0', JText::_('COM_JOOMLEAGUE_ADMIN_MATCHES_RT')); $match_result_type[] = JHtmlSelect::option('1', JText::_('COM_JOOMLEAGUE_ADMIN_MATCHES_OT')); $match_result_type[] = JHtmlSelect::option('2', JText::_('COM_JOOMLEAGUE_ADMIN_MATCHES_SO')); $lists['match_result_type'] = $match_result_type; unset($match_result_type); //build the html options for massadd create type $createTypes = array(0 => JText::_('COM_JOOMLEAGUE_ADMIN_MATCHES_MASSADD'), 1 => JText::_('COM_JOOMLEAGUE_ADMIN_MATCHES_MASSADD_1'), 2 => JText::_('COM_JOOMLEAGUE_ADMIN_MATCHES_MASSADD_2')); $ctOptions = array(); foreach ($createTypes as $key => $value) { $ctOptions[] = JHtmlSelect::option($key, $value); } $lists['createTypes'] = JHtmlSelect::genericlist($ctOptions, 'ct[]', 'class="inputbox" onchange="javascript:displayTypeView();"', 'value', 'text', 1, 'ct'); unset($createTypes); // build the html radio for adding into one round / all rounds $createYesNo = array(0 => JText::_('COM_JOOMLEAGUE_GLOBAL_NO'), 1 => JText::_('COM_JOOMLEAGUE_GLOBAL_YES')); $ynOptions = array(); foreach ($createYesNo as $key => $value) { $ynOptions[] = JHtmlSelect::option($key, $value); } $lists['addToRound'] = JHtmlSelect::radiolist($ynOptions, 'addToRound', 'class="inputbox"', 'value', 'text', 0); // build the html radio for auto publish new matches $lists['autoPublish'] = JHtmlSelect::radiolist($ynOptions, 'autoPublish', 'class="inputbox"', 'value', 'text', 0); //build the html options for divisions $divisions[] = JHtmlSelect::option('0', JText::_('COM_JOOMLEAGUE_GLOBAL_SELECT_DIVISION')); $mdlDivisions = JModelLegacy::getInstance("divisions", "JoomLeagueModel"); if ($res = $mdlDivisions->getDivisions($project_id)) { $divisions = array_merge($divisions, $res); } $lists['divisions'] = $divisions; unset($divisions); $this->division = $division; $this->user = JFactory::getUser(); $this->lists = $lists; $this->matches = $matches; $this->ress = $ress; $this->projectws = $projectws; $this->roundws = $roundws; $this->pagination = $pagination; $this->teams = $projectteams; $this->request_url = $uri->toString(); $this->prefill = $params->get('use_prefilled_match_roster', 0); $this->addToolbar(); parent::display($tpl); }
public static function getLuggageBox($selected, $n = 59, $start = 0, $name = 'transport_luggage') { $options = array(); for ($i = $start; $i <= $n; $i++) { $otext = $i; $options[] = JHtmlSelect::option($i, $otext); } return JHtmlSelect::genericlist($options, $name, 'class="input-mini"', 'value', 'text', $selected); }
<td class="nowrap" class="center"> <?php $append = ''; if (empty($row->country)) { $append = ' background-color:#FFCCCC;'; } echo JHtmlSelect::genericlist($this->lists['nation'], 'country' . $row->id, $inputappend . ' class="inputbox" style="width:140px; ' . $append . '" onchange="document.getElementById(\'cb' . $i . '\').checked=true"', 'value', 'text', $row->country); ?> </td> <td class="nowrap" class="center"> <?php $append = ''; if (empty($row->position_id)) { $append = ' background-color:#FFCCCC;'; } echo JHtmlSelect::genericlist($this->lists['positions'], 'position' . $row->id, $inputappend . 'class="inputbox" style="width:140px; ' . $append . '" onchange="document.getElementById(\'cb' . $i . '\').checked=true"', 'value', 'text', $row->position_id); ?> </td> <td class="center"><?php echo $published; ?> </td> <td class="center"><?php echo $row->id; ?> </td> </tr> <?php } } ?>
/** * Tests the JHtmlMenu::menuitems method. * * @return void * * @since 3.1 */ public function testMenuitems() { $this->assertContains('<option value="mainmenu.435">- Home</option>', JHtmlSelect::options(JHtmlMenu::menuitems(), array('published' => '1'))); }
<div class="controls form-inline"> <?php echo $this->orderstatus; ?> <label for="notify_customer"> </div> </div> <div class="control-group"> <label class="control-label" for="notify_customer"><?php echo JText::_('COM_BOOKPRO_ORDER_NOTIFY_TO_CUSTOMER'); ?> </label> <div class="form-inline"> <?php echo JHtmlSelect::booleanlist('notify_customer'); ?> </div> </div> <div class="control-group"> <label class="control-label" for="total"><?php echo JText::_('COM_BOOKPRO_ORDER_TOTAL'); ?> </label> <div class="controls"> <input class="text_area required" type="text" name="total" id="total" size="60" maxlength="255" value="<?php echo $this->obj->total; ?> " /> </div>
public static function getSelectParent($id, $parent_id, $name, $attribs) { $db = JFactory::getDbo(); $node = false; if ((int) $id > 0) { $query = 'SELECT lft,rgt FROM ins_cap WHERE id = ' . $id; $db->setQuery($query); $node = $db->loadAssoc(); } //var_dump($node); $query = $db->getQuery(true); $query->select(array('id AS value', 'CONCAT(REPEAT(\'--\', level), name) AS text'))->from('ins_cap')->order('lft'); if ($node != false) { $query->where('id NOT IN (SELECT id FROM ins_cap WHERE lft >= ' . $node['lft'] . ' AND rgt <= ' . $node['rgt'] . ')'); } //echo $query->__toString(); $db->setQuery($query); $rows = $db->loadAssocList(); //array_merge(array('value'=>'','text'=>''),$rows); array_unshift($rows, array('value' => '', 'text' => '')); return JHtmlSelect::genericlist($rows, $name, $attribs, 'value', 'text', $parent_id); }
static function getHtmlList($name, $attribute, $select, $id = null) { self::init(); return JHtmlSelect::genericlist(self::$map, $name, $attribute, 'value', 'text', $select, $id); }
self::$videoHelpInit = true; } $unique_id = uniqid('chkbox_'); $output .= ' <div class="fld clearfix videojs_fld"> <h4 ' . ($option->description ? 'class="hasTip" title="' . $option->label . '::' . $option->description . '"' : '') . '>' . $option->label . '</h4> <input name="' . $name . '[' . $option->name . '][enabled][]" class="en_stat" type="hidden" value="' . ($values[$option->name]['enabled'] == 'enabled' ? 'enabled' : '') . '" /> <label class="iostoggle ' . ($values[$option->name]['enabled'] == 'enabled' ? 'video-enabled' : '') . '"></label> <div class="clearfix"></div> <div class="video_options"> <div class="inner-vo"> <p>The image above these settings is becoming the poster image.</p>'; // Video Type $vt_data = array(array('value' => 'self_hosted', 'text' => 'Self Hosted'), array('value' => 'youtube', 'text' => 'YouTube Video'), array('value' => 'vimeo', 'text' => 'Vimeo Video')); $vt_options = array('option.key' => 'value', 'option.text' => 'text', 'list.select' => isset($values[$option->name]['video_type']) ? $values[$option->name]['video_type'] : 'youtube'); $videotypelist = JHtmlSelect::genericlist($vt_data, $name . '[' . $option->name . '][video_type][]', $vt_options); $output .= ' <div class="field-row clearfix"> <div class="label">Video Type:</div> ' . $videotypelist . ' </div>'; // Source $output .= ' <div class="field-row clearfix"> <div class="label">Source ID <a href="#" class="open-videohelp">[ How to add source?! ]</a></div> <input type="text" name="' . $name . '[' . $option->name . '][sourceid][]' . '" value="' . ($values[$option->name]['sourceid'] ? $values[$option->name]['sourceid'] : '') . '" class="input-xlarge" /> </div>'; // Loop $output .= ' <div class="field-row clearfix">
?> " /></td> </tr> <tr> <td><?php echo JText::_('COM_BOOKPRO_SEAT'); ?> </td> <td colspan="2"><input class="input-small required" type="number" name="jform[seat][]" value="<?php echo $rate->seat; ?> " /></td> </tr> </table> </fieldset> <?php } ?> <?php echo JHtmlSelect::booleanlist('state', 'class="radio btn"', $rate->state, JText::_('COM_BOOKPRO_OPEN'), JText::_('COM_BOOKPRO_CLOSE')); ?> <input type="hidden" name="task" value="" /> <input type="hidden" name="option" value="com_bookpro" /> <?php echo JHtml::_('form.token'); ?> </form>
<div class="controls"> <?php $editor = JFactory::getEditor(); echo $editor->display('desc', $this->obj->desc, '100%', '400', '60', '20', false); ?> </div> </div> <div class="control-group"> <label class="control-label" for="state"><?php echo JText::_('COM_BOOKPRO_STATUS'); ?> </label> <div class="form-inline"> <?php echo JHtmlSelect::booleanlist('state', 'class="btn-group"', $this->obj->state, 'Publish', 'UnPublish', 'id_state'); ?> </div> </div> </div> <input type="hidden" name="option" value="<?php echo OPTION; ?> " /> <input type="hidden" name="controller" value="<?php
:</td> <td><input name="ordering" id="ordering" value="<?php echo $row->ordering; ?> " size="10" maxlength="250" type="text" /> </td> </tr> <tr> <td width="100" align="right" class="key"><label for="currency_enabled"> <?php echo JText::_('K2STORE_ENABLED'); ?> : </label> </td> <td><?php echo JHtmlSelect::booleanlist('enabled', '', $row->enabled); ?> </td> </tr> </table> <legend> <?php echo JText::_('K2STORE_PARAMETERS'); ?> </legend> <?php $path = JPATH_SITE . '/plugins/' . $row->folder . '/' . $row->element . '/jform/' . $row->element . '.xml'; if (file_exists($path)) { $form = JForm::getInstance($row->element, $path);