本文整理汇总了PHP中XoopsLists::getCountryList方法的典型用法代码示例。如果您正苦于以下问题:PHP XoopsLists::getCountryList方法的具体用法?PHP XoopsLists::getCountryList怎么用?PHP XoopsLists::getCountryList使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类XoopsLists
的用法示例。
在下文中一共展示了XoopsLists::getCountryList方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: subscribers_add_show
function subscribers_add_show($options)
{
global $xoopsUser;
include_once XOOPS_ROOT_PATH . '/modules/subscribers/include/functions.php';
subscribers_sendEmails();
$config =& subscribers_getModuleConfig();
$block = array();
include_once XOOPS_ROOT_PATH . '/class/xoopslists.php';
$block['countries'] = XoopsLists::getCountryList();
$block['selected'] = $config['country'];
array_shift($block['countries']);
$sub_captcha = $config['captcha'];
if (is_object($xoopsUser)) {
$block['captcha'] = $sub_captcha == 2 ? 0 : 1;
} else {
$block['captcha'] = $sub_captcha == 3 ? 0 : 1;
}
return $block;
}
示例2: toArray
/**
* Retourne les éléments du produits formatés pour affichage
*
* @param string $format
* @return array
*/
function toArray($format = 's')
{
$ret = array();
$ret = parent::toArray($format);
include_once XOOPS_ROOT_PATH . '/class/xoopslists.php';
$countries = array();
$countries = XoopsLists::getCountryList();
$myshop_Currency = myshop_Currency::getInstance();
$ret['cmd_total_fordisplay'] = $myshop_Currency->amountForDisplay($this->getVar('cmd_total'));
// Montant TTC de la commande
$ret['cmd_shipping_fordisplay'] = $myshop_Currency->amountForDisplay($this->getVar('cmd_shipping'));
// Montant TTC des frais de port
$ret['cmd_text_fordisplay'] = nl2br($this->getVar('cmd_text'));
// Liste des réductions accordées
if (isset($countries[$this->getVar('cmd_country')])) {
// Libellé du pays de l'acheteur
$ret['cmd_country_label'] = $countries[$this->getVar('cmd_country')];
}
return $ret;
}
示例3: waiting_index
function waiting_index($start = 0)
{
global $xoopsTpl, $xoopsUser, $xoopsConfig, $limit;
include_once XOOPS_ROOT_PATH . '/class/xoopsformloader.php';
include_once XOOPS_ROOT_PATH . '/modules/subscribers/include/functions.php';
subscribers_sendEmails();
$this_handler =& xoops_getModuleHandler('waiting', 'subscribers');
$count = $this_handler->getCount();
$xoopsTpl->assign('count', $count);
$criteria = new CriteriaCompo();
$criteria->setSort('wt_priority DESC, wt_created');
$criteria->setOrder('ASC');
$criteria->setStart($start);
$criteria->setLimit($limit);
$objs = $this_handler->getObjects($criteria);
if ($count > 0) {
if ($count > $limit) {
include_once XOOPS_ROOT_PATH . '/class/pagenav.php';
$nav = new XoopsPageNav($count, $limit, $start, 'start', 'op=list');
$xoopsTpl->assign('pag', '<div style="float:left; padding-top:2px;" align="center">' . $nav->renderNav() . '</div>');
} else {
$xoopsTpl->assign('pag', '');
}
} else {
$xoopsTpl->assign('pag', '');
}
include_once XOOPS_ROOT_PATH . '/class/xoopslists.php';
$countries = XoopsLists::getCountryList();
foreach ($objs as $obj) {
$objArray = $obj->toArray();
$objArray['wt_created'] = formatTimestamp($objArray['wt_created']);
$xoopsTpl->append('objs', $objArray);
unset($objArray);
}
return $xoopsTpl->fetch(XOOPS_ROOT_PATH . '/modules/subscribers/templates/static/subscribers_admin_waiting.html');
}
示例4: XoopsFormSelectCountry
/**
* Constructor
*
* @param string $caption Caption
* @param string $name "name" attribute
* @param mixed $value Pre-selected value (or array of them).
* Legal are all 2-letter country codes (in capitals).
* @param int $size Number or rows. "1" makes a drop-down-list
*/
function XoopsFormSelectCountry($caption, $name, $value = null, $size = 1)
{
$this->XoopsFormSelect($caption, $name, $value, $size);
$this->addOptionArray(XoopsLists::getCountryList());
}
示例5: getCountriesList
/**
* Retourne la liste des pays à utiliser dans le formulaire de saisie des informations client (checkout.php)
*
* @return array
*/
function getCountriesList()
{
require_once XOOPS_ROOT_PATH . '/class/xoopslists.php';
return XoopsLists::getCountryList();
}
示例6: toArray
/**
* Retourne les éléments du produits formatés pour affichage
*
* @param string $format Le format à utiliser
* @return array Les informations formatées
*/
public function toArray($format = 's')
{
$ret = array();
$ret = parent::toArray($format);
include_once XOOPS_ROOT_PATH . '/class/xoopslists.php';
$countries = array();
$countries = XoopsLists::getCountryList();
$oledrion_Currency = oledrion_Currency::getInstance();
$ret['cmd_total_fordisplay'] = $oledrion_Currency->amountForDisplay($this->getVar('cmd_total'));
// Montant TTC de la commande
$ret['cmd_shipping_fordisplay'] = $oledrion_Currency->amountForDisplay($this->getVar('cmd_shipping'));
// Montant TTC des frais de port
$ret['cmd_packing_price_fordisplay'] = $oledrion_Currency->amountForDisplay($this->getVar('cmd_packing_price'));
$ret['cmd_text_fordisplay'] = nl2br($this->getVar('cmd_text'));
// Liste des réductions accordées
if (isset($countries[$this->getVar('cmd_country')])) {
// Libellé du pays de l'acheteur
$ret['cmd_country_label'] = $countries[$this->getVar('cmd_country')];
}
if ($this->getVar('cmd_uid') > 0) {
$ret['cmd_uname'] = XoopsUser::getUnameFromId($this->getVar('cmd_uid'));
}
$ret['cmd_create_date'] = formatTimestamp($this->getVar('cmd_create'), _MEDIUMDATESTRING);
return $ret;
}
示例7: __construct
/**
* Constructor
*
* @param string $caption Caption
* @param string $name "name" attribute
* @param mixed $value Pre-selected value (or array of them).
* Legal are all 2-letter country codes (in capitals).
* @param int $size Number or rows. "1" makes a drop-down-list
*/
public function __construct($caption, $name, $value = null, $size = 1)
{
parent::__construct($caption, $name, $value, $size);
// $this->XoopsFormSelect($caption, $name, $value, $size);
$this->addOptionArray(XoopsLists::getCountryList());
}
示例8: user_form
function user_form($id = null)
{
global $xoopsUser, $xoopsConfig, $xoopsModuleConfig;
include_once XOOPS_ROOT_PATH . '/class/xoopsformloader.php';
$this_handler =& xoops_getModuleHandler('user', 'subscribers');
if (isset($id)) {
$obj = $this_handler->get($id);
}
if (@is_object($obj)) {
$title = _EDIT;
$name = $obj->getVar('user_name', 'e');
$email = $obj->getVar('user_email', 'e');
$country = $obj->getVar('user_country', 'e');
$phone = $obj->getVar('user_phone', 'e');
} else {
$title = _ADD;
$name = '';
$email = '';
$phone = '';
$country = $xoopsModuleConfig['country'];
}
$form = new XoopsThemeForm($title, 'user_form', 'admin_user.php', "post", true);
include_once XOOPS_ROOT_PATH . '/class/xoopslists.php';
$countries = XoopsLists::getCountryList();
unset($countries[""]);
$element = new XoopsFormSelect(_AM_SUBSCRIBERS_COUNTRY, 'user_country', $country);
$element->addOptionArray($countries);
$form->addElement($element);
unset($element);
$form->addElement(new XoopsFormText(_AM_SUBSCRIBERS_NAME, 'user_name', 50, 50, $name));
$form->addElement(new XoopsFormText(_AM_SUBSCRIBERS_EMAIL, 'user_email', 50, 50, $email));
$form->addElement(new XoopsFormText(_AM_SUBSCRIBERS_PHONE, 'user_phone', 50, 50, $phone));
$tray = new XoopsFormElementTray('', '');
$tray->addElement(new XoopsFormButton('', 'submit_button', _SUBMIT, 'submit'));
$btn = new XoopsFormButton('', 'reset', _CANCEL, 'button');
if (@is_object($obj)) {
$btn->setExtra('onclick="document.location.href=\'admin_user.php?op=list\'"');
} else {
$btn->setExtra('onclick="document.getElementById(\'user_form\').style.display = \'none\'; return false;"');
}
$tray->addElement($btn);
$form->addElement($tray);
if (@is_object($obj)) {
$form->addElement(new XoopsFormHidden('op', 'editok'));
$form->addElement(new XoopsFormHidden('id', $id));
} else {
$form->addElement(new XoopsFormHidden('op', 'add'));
}
return $form->render();
}
示例9: send_form
function send_form()
{
global $xoopsModuleConfig;
include_once XOOPS_ROOT_PATH . '/class/xoopsformloader.php';
$this_handler =& xoops_getModuleHandler('user', 'subscribers');
$form = new XoopsThemeForm(_AM_SUBSCRIBERS_SEND, 'send_form', 'admin_send.php', "post");
$element = new XoopsFormLabel(_MI_SUBSCRIBERS_CONF_FROMNAME, $xoopsModuleConfig['fromname']);
$form->addElement($element);
unset($element);
$element = new XoopsFormLabel(_MI_SUBSCRIBERS_CONF_FROMEMAIL, $xoopsModuleConfig['fromemail']);
$form->addElement($element);
unset($element);
// Country
include_once XOOPS_ROOT_PATH . '/class/xoopslists.php';
$countries = array("ALL" => _AM_SUBSCRIBERS_ALL_COUNTRIES);
$countries2 = XoopsLists::getCountryList();
array_shift($countries2);
$countries += $countries2;
$element = new XoopsFormSelect(_AM_SUBSCRIBERS_COUNTRY, 'country', 'ALL');
$element->addOptionArray($countries);
$form->addElement($element);
unset($element, $countries);
// Subject
$form->addElement(new XoopsFormText(_AM_SUBSCRIBERS_EMAIL_SUBJECT, 'subject', 75, 150, ''), true);
// Body
$editor_configs = array();
$editor_configs['rows'] = 35;
$editor_configs['cols'] = 60;
$editor_configs['width'] = '100%';
$editor_configs['height'] = '400px';
$editor_configs['name'] = 'body';
$editor_configs['value'] = '';
$element = new XoopsFormEditor(_AM_SUBSCRIBERS_EMAIL_BODY, $xoopsModuleConfig['editor'], $editor_configs, $nohtml = false, $onfailure = null);
$element->setDescription(_AM_SUBSCRIBERS_EMAIL_BODY_DSC);
$form->addElement($element);
unset($element);
// Priority
$priorities = array(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10);
unset($priorities[0]);
$element = new XoopsFormSelect(_AM_SUBSCRIBERS_EMAIL_PRIORITY, 'priority', 5);
$element->setDescription(_AM_SUBSCRIBERS_EMAIL_PRIORITY_DSC);
$element->addOptionArray($priorities);
$form->addElement($element);
unset($element, $priorities);
// Groups
$groups = array(_AM_SUBSCRIBERS_SUBSCRIBERS, _AM_SUBSCRIBERS_USERS, _AM_SUBSCRIBERS_BOTH);
$element = new XoopsFormSelect(_AM_SUBSCRIBERS_EMAIL_GROUPS, 'groups', 0);
$element->setDescription(_AM_SUBSCRIBERS_EMAIL_GROUPS_DSC);
$element->addOptionArray($groups);
$form->addElement($element);
unset($element, $groups);
// Buttons
$tray = new XoopsFormElementTray('', '');
$tray->addElement(new XoopsFormButton('', 'submit_button', _SUBMIT, 'submit'));
$btn = new XoopsFormButton('', 'reset', _CANCEL, 'button');
$btn->setExtra('onclick="document.location.href=\'admin_send.php\'"');
$tray->addElement($btn);
$form->addElement($tray);
$form->addElement(new XoopsFormHidden('op', 'email'));
return $form->render();
}
示例10: xoops_load
// Configs
$i = 0;
//default value for Xoops editor
xoops_load('XoopsEditorHandler');
$editor_handler = XoopsEditorHandler::getInstance();
$i++;
$modversion['config'][$i]['name'] = 'editor';
$modversion['config'][$i]['title'] = '_MI_SUBSCRIBERS_CONF_EDITOR';
$modversion['config'][$i]['description'] = '_MI_SUBSCRIBERS_CONF_EDITOR_DSC';
$modversion['config'][$i]['formtype'] = 'select';
$modversion['config'][$i]['valuetype'] = 'text';
$modversion['config'][$i]['options'] = array_flip($editor_handler->getList());
$modversion['config'][$i]['default'] = 'dhtmltextarea';
//default value for country
include_once XOOPS_ROOT_PATH . '/class/xoopslists.php';
$countries = XoopsLists::getCountryList();
unset($countries[""]);
$i++;
$modversion['config'][$i]['name'] = 'country';
$modversion['config'][$i]['title'] = '_MI_SUBSCRIBERS_CONF_COUNTRY';
$modversion['config'][$i]['description'] = '_MI_SUBSCRIBERS_CONF_COUNTRY_DSC';
$modversion['config'][$i]['formtype'] = 'select';
$modversion['config'][$i]['valuetype'] = 'text';
$modversion['config'][$i]['options'] = array_flip($countries);
$modversion['config'][$i]['default'] = 'PT';
$i++;
$modversion['config'][$i]['name'] = 'fromname';
$modversion['config'][$i]['title'] = '_MI_SUBSCRIBERS_CONF_FROMNAME';
$modversion['config'][$i]['description'] = '_MI_SUBSCRIBERS_CONF_FROMNAME_DSC';
$modversion['config'][$i]['formtype'] = 'textbox';
$modversion['config'][$i]['valuetype'] = 'text';