/** * Method to get the field options. * * @return array The field option objects. */ protected function getOptions() { // Initialize variables. $options = Countries::getCountryOptions(); // Merge any additional options in the XML definition. $options = array_merge(parent::getOptions(), $options); return $options; }
public function display($tpl = null) { if ($this->getLayout() == 'assignplayers') { $this->_displayAssignPlayers($tpl); return; } JHtml::_('behavior.calendar'); $app = JFactory::getApplication(); $jinput = $app->input; $option = $jinput->getCmd('option'); $params = JComponentHelper::getParams($option); $model = $this->getModel(); $filter_state = $app->getUserStateFromRequest($this->get('context') . '.filter_state', 'filter_state', '', 'word'); $filter_order = $app->getUserStateFromRequest($this->get('context') . '.filter_order', 'filter_order', 'pl.ordering', 'cmd'); $filter_order_Dir = $app->getUserStateFromRequest($this->get('context') . '.filter_order_Dir', 'filter_order_Dir', '', 'word'); $search = $app->getUserStateFromRequest($this->get('context') . '.search', 'search', '', 'string'); $search_mode = $app->getUserStateFromRequest($this->get('context') . '.search_mode', 'search_mode', '', 'string'); $items = $this->get('Data'); $total = $this->get('Total'); $pagination = $this->get('Pagination'); $app->setUserState($option . 'task', ''); // 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; //build the html select list for positions $positionsList[] = JHtml::_('select.option', '0', JText::_('COM_JOOMLEAGUE_GLOBAL_SELECT_POSITION')); $positions = JModelLegacy::getInstance('person', 'joomleaguemodel')->getPositions(); if ($positions) { $positions = array_merge($positionsList, $positions); } $lists['positions'] = $positions; unset($positionsList); //build the html options for nation $nation[] = JHtml::_('select.option', '0', JText::_('COM_JOOMLEAGUE_GLOBAL_SELECT_NATION')); if ($res = Countries::getCountryOptions()) { $nation = array_merge($nation, $res); } $lists['nation'] = $nation; unset($nation); $this->user = JFactory::getUser(); $this->config = JFactory::getConfig(); $this->lists = $lists; $this->items = $items; $this->pagination = $pagination; $this->request_url = JFactory::getURI()->toString(); $this->component_params = $params; $sideMenu = JoomleagueHelper::sideMenu(); $this->sidebar = $sideMenu; $this->addToolbar(); parent::display($tpl); }
function display($tpl = null) { if ($this->getLayout() == 'assignplayers') { $this->_displayAssignPlayers($tpl); return; } $option = JRequest::getCmd('option'); $mainframe = JFactory::getApplication(); $model = $this->getModel(); $filter_state = $mainframe->getUserStateFromRequest($option . 'pl_filter_state', 'filter_state', '', 'word'); $filter_order = $mainframe->getUserStateFromRequest($option . 'pl_filter_order', 'filter_order', 'pl.ordering', 'cmd'); $filter_order_Dir = $mainframe->getUserStateFromRequest($option . 'pl_filter_order_Dir', 'filter_order_Dir', '', 'word'); $search = $mainframe->getUserStateFromRequest($option . 'pl_search', 'search', '', 'string'); $search_mode = $mainframe->getUserStateFromRequest($option . 'pl_search_mode', 'search_mode', '', 'string'); $filter_info = $mainframe->getUserStateFromRequest($option . 'pl_filter_info', 'filter_info', '', 'string'); $items =& $this->get('Data'); $total =& $this->get('Total'); $pagination =& $this->get('Pagination'); $mainframe->setUserState($option . 'task', ''); // 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; //build the html select list for positions $positionsList[] = JHTML::_('select.option', '0', JText::_('COM_JOOMLEAGUE_GLOBAL_SELECT_POSITION')); $positions = JModel::getInstance('person', 'joomleaguemodel')->getPositions(); if ($positions) { $positions = array_merge($positionsList, $positions); } $lists['positions'] = $positions; unset($positionsList); //build the html options for nation $nation[] = JHTML::_('select.option', '0', JText::_('COM_JOOMLEAGUE_GLOBAL_SELECT_NATION')); if ($res =& Countries::getCountryOptions()) { $nation = array_merge($nation, $res); } $lists['nation'] = $nation; unset($nation); $this->assignRef('user', JFactory::getUser()); $this->assignRef('config', JFactory::getConfig()); $this->assignRef('lists', $lists); $this->assignRef('items', $items); $this->assignRef('pagination', $pagination); $this->assignRef('request_url', JFactory::getURI()->toString()); $this->addToolbar(); parent::display($tpl); }
function _displayForm($tpl) { $option = JRequest::getCmd('option'); $mainframe =& JFactory::getApplication(); $db =& JFactory::getDBO(); $uri =& JFactory::getURI(); $user =& JFactory::getUser(); $model =& $this->getModel(); $lists = array(); //get the project $object =& $this->get('data'); $isNew = $object->id < 1; // fail if checked out not by 'me' if ($model->isCheckedOut($user->get('id'))) { $msg = JText::sprintf('DESCBEINGEDITTED', JText::_('JL_ADMIN_ASSOCIATION'), $object->name); $mainframe->redirect('index.php?option=' . $option, $msg); } // Edit or Create? if (!$isNew) { $model->checkout($user->get('id')); } else { // initialise new record $object->order = 0; } if (empty($object->assocflag)) { $object->assocflag = 'images/com_joomleague/database/placeholders/placeholder_flags.png'; } $assocflags = $model->getAssocFlags(); $options = array(); foreach ($assocflags as $key => $value) { $options[] = JHTML::_('select.option', $value, $value); } $lists['assocflag'] = JHTML::_('select.genericlist', $options, 'assocflag', 'class="inputbox"', 'value', 'text', $object->assocflag); //build the html select list for countries $countries[] = JHTML::_('select.option', '', JText::_('JL_ADMIN_ASSOCIATION_SELECT_COUNTRY')); if ($res =& Countries::getCountryOptions()) { $countries = array_merge($countries, $res); } $lists['countries'] = JHTML::_('select.genericlist', $countries, 'country', 'class="inputbox" size="1"', 'value', 'text', $object->country); unset($countries); // build the html select list for ordering $query = 'SELECT ordering AS value,name AS text FROM #__joomleague_associations ORDER BY ordering '; $lists['ordering'] = JHTML::_('list.specificordering', $object, $object->id, $query, 1); $this->assignRef('lists', $lists); $this->assignRef('object', $object); $this->assignRef('form', $this->get('form')); $this->assign('cfg_which_media_tool', JComponentHelper::getParams('com_joomleague')->get('cfg_which_media_tool', 0)); parent::display($tpl); }
function display($tpl = null) { $option = JRequest::getCmd('option'); $mainframe = JFactory::getApplication(); $lang = JFactory::getLanguage(); $document =& JFactory::getDocument(); // if ($this->getLayout()=='form') // { // $this->_displayForm($tpl); // return; // } // if ($this->getLayout()=='info') // { // $this->_displayInfo($tpl); // return; // } // if ($this->getLayout()=='selectpage') // { // $this->_displaySelectpage($tpl); // return; // } $stylelink = '<link rel="stylesheet" href="' . JURI::root() . 'administrator/components/com_joomleague/assets/css/jlextusericons.css' . '" type="text/css" />' . "\n"; $document->addCustomTag($stylelink); // Set toolbar items for the page JToolBarHelper::title(JText::_('COM_JOOMLEAGUE_ADMIN_LMO_IMPORT_TITLE_1'), 'lmo-cpanel'); JLToolBarHelper::onlinehelp(); $uri = JFactory::getURI(); $config =& JComponentHelper::getParams('com_media'); $post = JRequest::get('post'); $files = JRequest::get('files'); $this->assignRef('request_url', $uri->toString()); $this->assignRef('config', $config); $teile = explode("-", $lang->getTag()); $country = Countries::convertIso2to3($teile[1]); $this->assignRef('country', $country); $countries = Countries::getCountryOptions(); $lists['countries'] = JHTML::_('select.genericlist', $countries, 'country', 'class="inputbox" size="1"', 'value', 'text', $country); $this->assignRef('countries', $lists['countries']); //$this->assignRef('form', $this->get('form')); parent::display($tpl); }
function _displayForm($tpl) { $option = JRequest::getCmd('option'); $mainframe =& JFactory::getApplication(); $db =& JFactory::getDBO(); $uri =& JFactory::getURI(); $user =& JFactory::getUser(); $model =& $this->getModel(); $lists = array(); //get the project $object =& $this->get('data'); $isNew = $object->id < 1; // fail if checked out not by 'me' if ($model->isCheckedOut($user->get('id'))) { $msg = JText::sprintf('DESCBEINGEDITTED', JText::_('JL_ADMIN_ASSOCIATION'), $object->name); $mainframe->redirect('index.php?option=' . $option, $msg); } // Edit or Create? if (!$isNew) { $model->checkout($user->get('id')); } else { // initialise new record $object->order = 0; } //build the html select list for countries $countries[] = JHTML::_('select.option', '', JText::_('JL_ADMIN_ASSOCIATION_SELECT_COUNTRY')); if ($res =& Countries::getCountryOptions()) { $countries = array_merge($countries, $res); } $lists['countries'] = JHTML::_('select.genericlist', $countries, 'country', 'class="inputbox" size="1"', 'value', 'text', $object->country); unset($countries); // build the html select list for ordering $query = 'SELECT ordering AS value,name AS text FROM #__joomleague_position_ringen ORDER BY ordering '; $lists['ordering'] = JHTML::_('list.specificordering', $object, $object->id, $query, 1); $this->assignRef('lists', $lists); $this->assignRef('object', $object); parent::display($tpl); }
/> </td> <td> <?php echo '<b>' . JText::_('JL_ADMIN_XML_IMPORT_CLUBCOUNTRY') . '</b>'; $dCountry = $clubCountry; echo ": " . $dCountry; if (preg_match('=^[0-9]+$=', $dCountry)) { $dCountry = $this->OldCountries[(int) $dCountry]; } ?> <br /> <?php //build the html select list for countries $countries[] = JHTML::_('select.option', '', '- ' . JText::_('Select country') . ' -'); if ($res =& Countries::getCountryOptions()) { $countries = array_merge($countries, $res); } $countrieslist = JHTML::_('select.genericlist', $countries, 'clubCountry_' . $key, 'class="inputbox" size="1" ' . $disabled, 'value', 'text', $dCountry); unset($countries); echo $countrieslist; ?> </td> </tr> </table> </td> <?php } ?> </tr> <?php
function _displayForm($tpl) { $option = JRequest::getCmd('option'); $mainframe =& JFactory::getApplication(); $document = JFactory::getDocument(); $db =& JFactory::getDBO(); $uri =& JFactory::getURI(); $user =& JFactory::getUser(); $model =& $this->getModel(); $edit = JRequest::getVar('edit', true); $addposition = JRequest::getVar('addposition'); $this->assignRef('edit', $edit); $lists = array(); //get the project $object =& $this->get('data'); $isNew = $object->id < 1; $bildpositionenhome = array(); $bildpositionenhome[HOME_POS][0][heim][oben] = 5; $bildpositionenhome[HOME_POS][0][heim][links] = 233; $bildpositionenhome[HOME_POS][1][heim][oben] = 113; $bildpositionenhome[HOME_POS][1][heim][links] = 69; $bildpositionenhome[HOME_POS][2][heim][oben] = 113; $bildpositionenhome[HOME_POS][2][heim][links] = 179; $bildpositionenhome[HOME_POS][3][heim][oben] = 113; $bildpositionenhome[HOME_POS][3][heim][links] = 288; $bildpositionenhome[HOME_POS][4][heim][oben] = 113; $bildpositionenhome[HOME_POS][4][heim][links] = 397; $bildpositionenhome[HOME_POS][5][heim][oben] = 236; $bildpositionenhome[HOME_POS][5][heim][links] = 179; $bildpositionenhome[HOME_POS][6][heim][oben] = 236; $bildpositionenhome[HOME_POS][6][heim][links] = 288; $bildpositionenhome[HOME_POS][7][heim][oben] = 318; $bildpositionenhome[HOME_POS][7][heim][links] = 69; $bildpositionenhome[HOME_POS][8][heim][oben] = 318; $bildpositionenhome[HOME_POS][8][heim][links] = 233; $bildpositionenhome[HOME_POS][9][heim][oben] = 318; $bildpositionenhome[HOME_POS][9][heim][links] = 397; $bildpositionenhome[HOME_POS][10][heim][oben] = 400; $bildpositionenhome[HOME_POS][10][heim][links] = 233; $bildpositionenaway = array(); $bildpositionenaway[AWAY_POS][0][heim][oben] = 970; $bildpositionenaway[AWAY_POS][0][heim][links] = 233; $bildpositionenaway[AWAY_POS][1][heim][oben] = 828; $bildpositionenaway[AWAY_POS][1][heim][links] = 69; $bildpositionenaway[AWAY_POS][2][heim][oben] = 828; $bildpositionenaway[AWAY_POS][2][heim][links] = 179; $bildpositionenaway[AWAY_POS][3][heim][oben] = 828; $bildpositionenaway[AWAY_POS][3][heim][links] = 288; $bildpositionenaway[AWAY_POS][4][heim][oben] = 828; $bildpositionenaway[AWAY_POS][4][heim][links] = 397; $bildpositionenaway[AWAY_POS][5][heim][oben] = 746; $bildpositionenaway[AWAY_POS][5][heim][links] = 179; $bildpositionenaway[AWAY_POS][6][heim][oben] = 746; $bildpositionenaway[AWAY_POS][6][heim][links] = 288; $bildpositionenaway[AWAY_POS][7][heim][oben] = 664; $bildpositionenaway[AWAY_POS][7][heim][links] = 69; $bildpositionenaway[AWAY_POS][8][heim][oben] = 664; $bildpositionenaway[AWAY_POS][8][heim][links] = 397; $bildpositionenaway[AWAY_POS][9][heim][oben] = 587; $bildpositionenaway[AWAY_POS][9][heim][links] = 179; $bildpositionenaway[AWAY_POS][10][heim][oben] = 587; $bildpositionenaway[AWAY_POS][10][heim][links] = 288; // fail if checked out not by 'me' if ($model->isCheckedOut($user->get('id'))) { $msg = JText::sprintf('DESCBEINGEDITTED', JText::_('COM_JOOMLEAGUE_ADMIN_ROSTERPOSITION'), $object->name); $mainframe->redirect('index.php?option=' . $option, $msg); } // Edit or Create? if (!$isNew) { $model->checkout($user->get('id')); } else { // initialise new record $object->order = 0; } //build the html select list for countries $countries[] = JHTML::_('select.option', '', JText::_('COM_JOOMLEAGUE_ADMIN_ROSTERPOSITIONS_SELECT_COUNTRY')); if ($res =& Countries::getCountryOptions()) { $countries = array_merge($countries, $res); } $lists['countries'] = JHTML::_('select.genericlist', $countries, 'country', 'class="inputbox" size="1"', 'value', 'text', $object->country); unset($countries); // build the html select list for ordering $query = 'SELECT ordering AS value,name AS text FROM #__joomleague_rosterposition ORDER BY ordering '; $lists['ordering'] = JHTML::_('list.specificordering', $object, $object->id, $query, 1); // $document->addScript( JURI::base(true).'/components/com_joomleague/assets/js/dragpull.js'); /* * extended data */ // echo JPATH_COMPONENT.'<br>'; // echo JPATH_COMPONENT_SITE.'<br>'; //$paramsdata=$object->extended; // $paramsdefs=JPATH_COMPONENT.DS.'assets'.DS.'extended'.DS.'rosterposition.xml'; // echo $paramsdefs.'<br>'; // $extended=new JLGExtraParams($paramsdata,$paramsdefs); $this->assignRef('form', $this->get('form')); $extended = $this->getExtended($object->extended, 'rosterposition'); $this->assignRef('extended', $extended); $this->assign('show_debug_info', JComponentHelper::getParams('com_joomleague')->get('show_debug_info', 0)); $this->assign('jquery_version', JComponentHelper::getParams('com_joomleague')->get('jqueryversionfrontend', 0)); $this->assign('jquery_sub_version', JComponentHelper::getParams('com_joomleague')->get('jquerysubversionfrontend', 0)); $this->assign('jquery_ui_version', JComponentHelper::getParams('com_joomleague')->get('jqueryuiversionfrontend', 0)); $this->assign('jquery_ui_sub_version', JComponentHelper::getParams('com_joomleague')->get('jqueryuisubversionfrontend', 0)); if (!$this->edit) { // neu $position = 1; $object->name = $addposition; $object->short_name = $addposition; $xmlfile = JPATH_COMPONENT_ADMINISTRATOR . DS . 'assets' . DS . 'extended' . DS . 'rosterposition.xml'; $extended = JForm::getInstance('extended', $xmlfile, array('control' => 'extended'), false, '/config'); $jRegistry = new JRegistry(); $jRegistry->loadString('', 'ini'); $extended->bind($jRegistry); switch ($addposition) { case 'HOME_POS': for ($a = 0; $a < 11; $a++) { $extended->setValue('COM_JOOMLEAGUE_EXT_ROSTERPOSITIONS_' . $position . '_TOP', null, $bildpositionenhome[$object->name][$a]['heim']['oben']); $extended->setValue('COM_JOOMLEAGUE_EXT_ROSTERPOSITIONS_' . $position . '_LEFT', null, $bildpositionenhome[$object->name][$a]['heim']['links']); $position++; } $this->assignRef('bildpositionen', $bildpositionenhome); break; case 'AWAY_POS': for ($a = 0; $a < 11; $a++) { $extended->setValue('COM_JOOMLEAGUE_EXT_ROSTERPOSITIONS_' . $position . '_TOP', null, $bildpositionenaway[$object->name][$a]['heim']['oben']); $extended->setValue('COM_JOOMLEAGUE_EXT_ROSTERPOSITIONS_' . $position . '_LEFT', null, $bildpositionenaway[$object->name][$a]['heim']['links']); $position++; } $this->assignRef('bildpositionen', $bildpositionenaway); break; } $object->extended = $extended; } else { // bearbeiten positionen übergeben $position = 1; //$xmlfile=JPATH_COMPONENT_ADMINISTRATOR.DS.'assets'.DS.'extended'.DS.'rosterposition.xml'; $jRegistry = new JRegistry(); $jRegistry->loadString($object->extended, 'ini'); for ($a = 0; $a < 11; $a++) { $bildpositionen[$object->name][$a]['heim']['oben'] = $jRegistry->get('COM_JOOMLEAGUE_EXT_ROSTERPOSITIONS_' . $position . '_TOP'); $bildpositionen[$object->name][$a]['heim']['links'] = $jRegistry->get('COM_JOOMLEAGUE_EXT_ROSTERPOSITIONS_' . $position . '_LEFT'); $position++; } $this->assignRef('bildpositionen', $bildpositionen); } $project_type = array(JHTMLSelect::option('HOME_POS', JText::_('HOME_POS'), 'id', 'name'), JHTMLSelect::option('AWAY_POS', JText::_('AWAY_POS'), 'id', 'name')); $lists['project_type'] = JHTMLSelect::genericlist($project_type, 'short_name', 'class="inputbox" size="1"', 'id', 'name', $object->short_name); unset($project_type); // Add Script //$document->addScript('https://ajax.googleapis.com/ajax/libs/jquery/'.$this->jquery_version.'/jquery.min.js'); //$document->addScript('https://ajax.googleapis.com/ajax/libs/jqueryui/'.$this->jquery_ui_version.'.'.$this->jquery_ui_sub_version.'/jquery-ui.min.js'); //$javascript .= "\n".'var $JoLe2 = jQuery.noConflict();' . "\n"; $javascript .= "\n"; $javascript .= 'jQuery(document).ready(function() {' . "\n"; $start = 1; $ende = 11; for ($a = $start; $a <= $ende; $a++) { $javascript .= ' jQuery("#draggable_' . $a . '").draggable({stop: function(event, ui) { // Show dropped position. var Stoppos = jQuery(this).position(); jQuery("div#stop").text("STOP: \\nLeft: "+ Stoppos.left + "\\nTop: " + Stoppos.top); jQuery("#extended_COM_JOOMLEAGUE_EXT_ROSTERPOSITIONS_' . $a . '_TOP").val(Stoppos.top); jQuery("#extended_COM_JOOMLEAGUE_EXT_ROSTERPOSITIONS_' . $a . '_LEFT").val(Stoppos.left); }});' . "\n"; } $javascript .= ' });' . "\n"; $javascript .= "\n"; $document->addScriptDeclaration($javascript); $this->assignRef('form', $this->get('form')); $this->assignRef('lists', $lists); $this->assignRef('object', $object); parent::display($tpl); }