本文整理汇总了PHP中Countries::getCountryOptions方法的典型用法代码示例。如果您正苦于以下问题:PHP Countries::getCountryOptions方法的具体用法?PHP Countries::getCountryOptions怎么用?PHP Countries::getCountryOptions使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Countries
的用法示例。
在下文中一共展示了Countries::getCountryOptions方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getOptions
/**
* 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;
}
示例2: display
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);
}
示例3: display
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);
}
示例4: _displayForm
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);
}
示例5: unset
/>
</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