function _displayDefaultEdit($tpl) { //global $mainframe, $option; $mainframe =& JFactory::getApplication(); $option = JRequest::getCmd('option'); $db =& JFactory::getDBO(); $uri =& JFactory::getURI(); $user =& JFactory::getUser(); $model =& $this->getModel(); $project = $mainframe->getUserState($option . 'project'); $this->assignRef('project', $project); $config =& JComponentHelper::getParams('com_media'); $uploadArray = $mainframe->getUserState($option . 'uploadArray', array()); $lmoimportuseteams = $mainframe->getUserState($option . 'lmoimportuseteams'); $whichfile = $mainframe->getUserState($option . 'whichfile'); $delimiter = $mainframe->getUserState($option . 'delimiter'); $countries = new Countries(); $this->assignRef('uploadArray', $uploadArray); $this->assignRef('countries', $countries->getCountries()); $this->assignRef('request_url', $uri->toString()); $this->assignRef('xml', $model->getData()); $this->assignRef('leagues', $model->getLeagueList()); $this->assignRef('seasons', $model->getSeasonList()); $this->assignRef('sportstypes', $model->getSportsTypeList()); $this->assignRef('admins', $model->getUserList(true)); $this->assignRef('editors', $model->getUserList(false)); $this->assignRef('templates', $model->getTemplateList()); $this->assignRef('teams', $model->getTeamList()); $this->assignRef('clubs', $model->getClubList()); $this->assignRef('persons', $model->getPersonList()); $this->assignRef('positions', $model->getPositionList()); $this->assignRef('parentpositions', $model->getParentPositionList()); if ($whichfile == 'playerfile') { $this->xml['project']->name = ''; $this->xml['team'] = ''; $this->style = ' style="visibility: hidden;" '; $this->insert_task = 'insertplayer'; } else { $this->style = ''; $this->insert_task = 'insertmatch'; } $this->assignRef('playgrounds', $model->getPlaygroundList()); $this->assignRef('projects', $model->getProjectList()); // } $this->assignRef('config', $config); // LOCALE SETTINGS $timezones = array(JHTML::_('select.option', -12, JText::_('(UTC -12:00) International Date Line West')), JHTML::_('select.option', -11, JText::_('(UTC -11:00) Midway Island, Samoa')), JHTML::_('select.option', -10, JText::_('(UTC -10:00) Hawaii')), JHTML::_('select.option', -9.5, JText::_('(UTC -09:30) Taiohae, Marquesas Islands')), JHTML::_('select.option', -9, JText::_('(UTC -09:00) Alaska')), JHTML::_('select.option', -8, JText::_('(UTC -08:00) Pacific Time (US & Canada)')), JHTML::_('select.option', -7, JText::_('(UTC -07:00) Mountain Time (US & Canada)')), JHTML::_('select.option', -6, JText::_('(UTC -06:00) Central Time (US & Canada), Mexico City')), JHTML::_('select.option', -5, JText::_('(UTC -05:00) Eastern Time (US & Canada), Bogota, Lima')), JHTML::_('select.option', -4, JText::_('(UTC -04:00) Atlantic Time (Canada), Caracas, La Paz')), JHTML::_('select.option', -4.5, JText::_('(UTC -04:30) Venezuela')), JHTML::_('select.option', -3.5, JText::_('(UTC -03:30) St. John\'s, Newfoundland, Labrador')), JHTML::_('select.option', -3, JText::_('(UTC -03:00) Brazil, Buenos Aires, Georgetown')), JHTML::_('select.option', -2, JText::_('(UTC -02:00) Mid-Atlantic')), JHTML::_('select.option', -1, JText::_('(UTC -01:00) Azores, Cape Verde Islands')), JHTML::_('select.option', 0, JText::_('(UTC 00:00) Western Europe Time, London, Lisbon, Casablanca')), JHTML::_('select.option', 1, JText::_('(UTC +01:00) Amsterdam, Berlin, Brussels, Copenhagen, Madrid, Paris')), JHTML::_('select.option', 2, JText::_('(UTC +02:00) Istanbul, Jerusalem, Kaliningrad, South Africa')), JHTML::_('select.option', 3, JText::_('(UTC +03:00) Baghdad, Riyadh, Moscow, St. Petersburg')), JHTML::_('select.option', 3.5, JText::_('(UTC +03:30) Tehran')), JHTML::_('select.option', 4, JText::_('(UTC +04:00) Abu Dhabi, Muscat, Baku, Tbilisi')), JHTML::_('select.option', 4.5, JText::_('(UTC +04:30) Kabul')), JHTML::_('select.option', 5, JText::_('(UTC +05:00) Ekaterinburg, Islamabad, Karachi, Tashkent')), JHTML::_('select.option', 5.5, JText::_('(UTC +05:30) Bombay, Calcutta, Madras, New Delhi, Colombo')), JHTML::_('select.option', 5.75, JText::_('(UTC +05:45) Kathmandu')), JHTML::_('select.option', 6, JText::_('(UTC +06:00) Almaty, Dhaka')), JHTML::_('select.option', 6.5, JText::_('(UTC +06:30) Yagoon')), JHTML::_('select.option', 7, JText::_('(UTC +07:00) Bangkok, Hanoi, Jakarta')), JHTML::_('select.option', 8, JText::_('(UTC +08:00) Beijing, Perth, Singapore, Hong Kong')), JHTML::_('select.option', 8.75, JText::_('(UTC +08:00) Ulaanbaatar, Western Australia')), JHTML::_('select.option', 9, JText::_('(UTC +09:00) Tokyo, Seoul, Osaka, Sapporo, Yakutsk')), JHTML::_('select.option', 9.5, JText::_('(UTC +09:30) Adelaide, Darwin, Yakutsk')), JHTML::_('select.option', 10, JText::_('(UTC +10:00) Eastern Australia, Guam, Vladivostok')), JHTML::_('select.option', 10.5, JText::_('(UTC +10:30) Lord Howe Island (Australia)')), JHTML::_('select.option', 11, JText::_('(UTC +11:00) Magadan, Solomon Islands, New Caledonia')), JHTML::_('select.option', 11.5, JText::_('(UTC +11:30) Norfolk Island')), JHTML::_('select.option', 12, JText::_('(UTC +12:00) Auckland, Wellington, Fiji, Kamchatka')), JHTML::_('select.option', 12.75, JText::_('(UTC +12:45) Chatham Island')), JHTML::_('select.option', 13, JText::_('(UTC +13:00) Tonga')), JHTML::_('select.option', 14, JText::_('(UTC +14:00) Kiribati'))); JToolBarHelper::custom($this->insert_task, 'upload', 'upload', Jtext::_('COM_JOOMLEAGUE_ADMIN_XML_IMPORT_START_BUTTON'), false); $conf =& JFactory::getConfig(); $value = $conf->getValue('config.offset'); $lists['serveroffset'] = JHTML::_('select.genericlist', $timezones, 'serveroffset', ' class="inputbox"', 'value', 'text', $value); $this->assignRef('lists', $lists); $revisionDate = '2011-04-28 - 12:00'; $import_version = 'NEW'; $this->assignRef('revisionDate', $revisionDate); $this->assignRef('import_version', $import_version); parent::display($tpl); }
private function _displayForm($tpl) { $app = JFactory::getApplication(); $jinput = $app->input; $mtime = microtime(); $mtime = explode(" ", $mtime); $mtime = $mtime[1] + $mtime[0]; $starttime = $mtime; $option = 'com_joomleague'; $document = JFactory::getDocument(); $db = JFactory::getDbo(); $uri = JFactory::getURI(); $model = JModelLegacy::getInstance('jlxmlimport', 'joomleaguemodel'); $data = $model->getData(); $uploadArray = $app->getUserState($option . 'uploadArray', array()); $tzValue = isset($data['project']->timezone) ? $data['project']->timezone : null; $zones = DateTimeZone::listIdentifiers(); $options = array(); $options[] = JHTML::_('select.option', '', '- ' . JText::_('SELECT_TIMEZONE') . ' -'); foreach ($zones as $zone) { if (strpos($zone, "/") === false && strpos($zone, "UTC") === false) { continue; } if (strpos($zone, "Etc") === 0) { continue; } $options[] = JHTML::_('select.option', $zone, $zone); } $lists['timezone'] = JHtml::_('select.genericlist', $options, 'timezone', ' class="inputbox"', 'value', 'text', $tzValue); // build the html select booleanlist for published $publishedValue = isset($data['project']->published) ? $data['project']->published : null; $lists['published'] = JHtml::_('select.booleanlist', 'published', ' ', $publishedValue); $countries = new Countries(); $this->uploadArray = $uploadArray; $this->starttime = $starttime; $this->countries = $countries->getCountries(); $this->request_url = $uri->toString(); $this->xml = $data; $this->leagues = $model->getLeagueList(); $this->seasons = $model->getSeasonList(); $this->sportstypes = $model->getSportsTypeList(); $this->admins = $model->getUserList(true); $this->editors = $model->getUserList(false); $this->templates = $model->getTemplateList(); $this->teams = $model->getTeamList(); $this->clubs = $model->getClubList(); $this->events = $model->getEventList(); $this->positions = $model->getPositionList(); $this->parentpositions = $model->getParentPositionList(); $this->playgrounds = $model->getPlaygroundList(); $this->persons = $model->getPersonList(); $this->statistics = $model->getStatisticList(); $this->OldCountries = $model->getCountryByOldid(); $this->import_version = $model->import_version; $this->lists = $lists; // Set toolbar items for the page JToolBarHelper::title(JText::_('COM_JOOMLEAGUE_ADMIN_XML_IMPORT_TITLE_2_3'), 'generic.png'); // task image mouseover_img alt_text_for_image check_that_standard_list_item_is_checked JLToolBarHelper::custom('jlxmlimport.insert', 'upload', 'upload', Jtext::_('COM_JOOMLEAGUE_ADMIN_XML_IMPORT_START_BUTTON'), false); // --> bij clicken op import wordt de insert view geactiveerd JToolBarHelper::back(); JToolBarHelper::help('screen.joomleague', true); parent::display($tpl); }
/** * @param string: an iso3 country code, e.g AUT * @return string: a country name */ public static function getCountryName($iso3) { self::includeLanguageFile(); $countries = Countries::getCountries(); if (isset($countries[$iso3]['name'])) { return JText::_($countries[$iso3]['name']); } }
public function __construct() { $this->countries = Countries::getCountries(); }
<?php /** * Outputs a country name with a flag * * @uses $vars['value'] Country code or country name */ namespace hypeJunction\Geo; $countriesByIso = Countries::getCountries('iso', 'name'); $countriesByName = Countries::getCountries('name', 'iso'); $value = elgg_extract('value', $vars); if (!$value) { return; } if (array_key_exists(strtoupper($value), $countriesByIso)) { $value = strtoupper($value); $value_lower = strtolower($value); echo '<div>'; echo '<span>' . $countriesByIso[$value] . '</span>'; echo elgg_view_icon("flag-{$value_lower}"); echo '</div>'; } else { if (array_key_exists($value, $countriesByName)) { $code = $countriesByName[$value]; $code_lower = strtolower($code); echo '<div>'; echo '<span>' . $value . '</span>'; echo elgg_view_icon("flag-{$code_lower}"); echo '</div>'; } else {
/** * @param string: an iso3 country code, e.g AUT * @return string: a country name */ public static function getCountryName($iso3) { $lang = JFactory::getLanguage(); $extension = "com_joomleague_countries"; $source = JPATH_ADMINISTRATOR . '/components/' . $extension; $lang->load("{$extension}", JPATH_ADMINISTRATOR, null, false, false) || $lang->load($extension, $source, null, false, false) || $lang->load($extension, JPATH_ADMINISTRATOR, $lang->getDefault(), false, false) || $lang->load($extension, $source, $lang->getDefault(), false, false); $countries = Countries::getCountries(); if (isset($countries[$iso3]['name'])) { return JText::_($countries[$iso3]['name']); } }
private function _displayForm($tpl) { $mtime = microtime(); $mtime = explode(" ", $mtime); $mtime = $mtime[1] + $mtime[0]; $starttime = $mtime; $option = JRequest::getCmd('option'); $mainframe = JFactory::getApplication(); $document = JFactory::getDocument(); $db = JFactory::getDBO(); $uri = JFactory::getURI(); $model =& JModel::getInstance('jlxmlimport', 'joomleaguemodel'); $data = $model->getData(); $uploadArray = $mainframe->getUserState($option . 'uploadArray', array()); // TODO: import timezone $value = isset($data['project']->timezone) ? $data['project']->timezone : null; $lists['timezone'] = JHTML::_('select.genericlist', array(), 'timezone', ' class="inputbox"', 'value', 'text', $value); $whichfile = $mainframe->getUserState($option . 'whichfile'); $this->assignRef('whichfile', $whichfile); $projectidimport = $mainframe->getUserState($option . 'projectidimport'); $this->assignRef('projectidimport', $projectidimport); $countries = new Countries(); $this->assignRef('uploadArray', $uploadArray); $this->assignRef('starttime', $starttime); $this->assignRef('countries', $countries->getCountries()); $this->assignRef('request_url', $uri->toString()); $this->assignRef('xml', $data); $this->assignRef('leagues', $model->getLeagueList()); $this->assignRef('seasons', $model->getSeasonList()); $this->assignRef('sportstypes', $model->getSportsTypeList()); $this->assignRef('admins', $model->getUserList(false)); $this->assignRef('editors', $model->getUserList(false)); $this->assignRef('templates', $model->getTemplateList()); $this->assignRef('teams', $model->getTeamList()); $this->assignRef('clubs', $model->getClubList()); $this->assignRef('events', $model->getEventList()); $this->assignRef('positions', $model->getPositionList()); $this->assignRef('parentpositions', $model->getParentPositionList()); $this->assignRef('playgrounds', $model->getPlaygroundList()); $this->assignRef('persons', $model->getPersonList()); $this->assignRef('statistics', $model->getStatisticList()); $this->assignRef('OldCountries', $model->getCountryByOldid()); $this->assignRef('import_version', $model->import_version); $this->assignRef('lists', $lists); $this->assign('show_debug_info', JComponentHelper::getParams('com_joomleague')->get('show_debug_info', 0)); // Set toolbar items for the page JToolBarHelper::title(JText::_('COM_JOOMLEAGUE_ADMIN_XML_IMPORT_TITLE_2_3'), 'generic.png'); // task image mouseover_img alt_text_for_image check_that_standard_list_item_is_checked JLToolBarHelper::custom('jlxmlimport.insert', 'upload', 'upload', Jtext::_('COM_JOOMLEAGUE_ADMIN_XML_IMPORT_START_BUTTON'), false); // --> bij clicken op import wordt de insert view geactiveerd JToolBarHelper::back(); JLToolBarHelper::onlinehelp(); parent::display($tpl); }