GetCountries() public static method

public static GetCountries ( integer $p_languageId = null, string $p_code = null, string $p_name = null, array $p_sqlOptions = null ) : array
$p_languageId integer
$p_code string
$p_name string
$p_sqlOptions array
return array
Example #1
0
 public function init()
 {
     camp_load_translation_strings('api');
     camp_load_translation_strings('users');
     camp_load_translation_strings('user_subscriptions');
     $this->repository = $this->_helper->entity->getRepository('Newscoop\\Entity\\User\\Subscriber');
     $this->form = new Admin_Form_Subscriber();
     $this->form->setAction('')->setMethod('post');
     // set form countries
     $countries = array('' => getGS('Select country'));
     foreach (Country::GetCountries(1) as $country) {
         $countries[$country->getCode()] = $country->getName();
     }
     //$this->form->getElement('country')->setMultioptions($countries);
 }
 /**
  * Init
  *
  * @return void
  */
 public function init()
 {
     $translator = \Zend_Registry::get('container')->getService('translator');
     $this->repository = $this->_helper->entity->getRepository('Newscoop\\Entity\\User\\Staff');
     $this->form = new Admin_Form_Staff($this->_helper->acl->isAllowed('user', 'manage'));
     $this->form->setAction('')->setMethod('post');
     if ($this->_helper->acl->isAllowed('user', 'manage')) {
         // set form user groups
         $groups = array();
         $groupRepository = $this->_helper->entity->getRepository('Newscoop\\Entity\\User\\Group');
         foreach ($groupRepository->findAll() as $group) {
             $groups[$group->getId()] = $group->getName();
         }
         $this->form->getElement('groups')->setMultioptions($groups);
     }
     // set form countries
     $countries = array('' => $translator->trans('Select country', array(), 'user_subscriptions'));
     foreach (Country::GetCountries(1) as $country) {
         $countries[$country->getCode()] = $country->getName();
     }
     $this->form->getElement('country')->setMultioptions($countries);
 }
Example #3
0
 /**
  * Init
  *
  * @return void
  */
 public function init()
 {
     camp_load_translation_strings('api');
     camp_load_translation_strings('users');
     $this->repository = $this->_helper->entity->getRepository('Newscoop\\Entity\\User\\Staff');
     $this->form = new Admin_Form_Staff($this->_helper->acl->isAllowed('user', 'manage'));
     $this->form->setAction('')->setMethod('post');
     if ($this->_helper->acl->isAllowed('user', 'manage')) {
         // set form user groups
         $groups = array();
         $groupRepository = $this->_helper->entity->getRepository('Newscoop\\Entity\\User\\Group');
         foreach ($groupRepository->findAll() as $group) {
             $groups[$group->getId()] = $group->getName();
         }
         $this->form->getElement('groups')->setMultioptions($groups);
     }
     // set form countries
     $countries = array('' => getGS('Select country'));
     foreach (Country::GetCountries(1) as $country) {
         $countries[$country->getCode()] = $country->getName();
     }
     $this->form->getElement('country')->setMultioptions($countries);
 }
Example #4
0
<?php

require_once $GLOBALS['g_campsiteDir'] . "/{$ADMIN_DIR}/country/country_common.php";
require_once $GLOBALS['g_campsiteDir'] . "/classes/SimplePager.php";
camp_load_translation_strings("api");
if (!$g_user->hasPermission('ManageCountries') && !$g_user->hasPermission('DeleteCountries')) {
    camp_html_goto_page("/{$ADMIN}/");
}
$f_country_language_selected = camp_session_get('f_country_language_selected', '');
$f_country_offset = camp_session_get('f_country_offset', 0);
if (empty($f_country_language_selected)) {
    $f_country_language_selected = null;
}
$ItemsPerPage = 20;
$languages = Language::GetLanguages(null, null, null, array(), array(), true);
$countries = Country::GetCountries($f_country_language_selected, null, null, array("LIMIT" => array("START" => $f_country_offset, "MAX_ROWS" => $ItemsPerPage)));
$numCountries = Country::GetNumCountries($f_country_language_selected);
$pager = new SimplePager($numCountries, $ItemsPerPage, "f_country_offset", "index.php?");
$crumbs = array();
$crumbs[] = array(getGS("Configure"), "");
$crumbs[] = array(getGS("Countries"), "");
echo camp_html_breadcrumbs($crumbs);
?>

<P>
<TABLE BORDER="0" CELLSPACING="0" CELLPADDING="3" class="action_buttons">
<?php 
if ($g_user->hasPermission("ManageCountries")) {
    ?>
<TR>
	<TD>
Example #5
0
<?php
require_once($GLOBALS['g_campsiteDir']. "/$ADMIN_DIR/country/country_common.php");

if (!$g_user->hasPermission('ManageCountries')) {
	camp_html_display_error(getGS("You do not have the right to change country names."));
	exit;
}

$f_country_code = Input::Get('f_country_code');
$f_country_language = Input::Get('f_country_language');

$country = new Country($f_country_code, $f_country_language);
$language = new Language($f_country_language);

$countryTranslations = Country::GetCountries(null, $f_country_code);

$crumbs = array();
$crumbs[] = array(getGS("Configure"), "");
$crumbs[] = array(getGS("Countries"), "/$ADMIN/country/");
$crumbs[] = array(getGS("Edit country name"), "");
echo camp_html_breadcrumbs($crumbs);

?>

<P>
<FORM NAME="dialog" METHOD="POST" ACTION="do_edit.php"  >
<?php echo SecurityToken::FormParameter(); ?>
<TABLE BORDER="0" CELLSPACING="0" CELLPADDING="0" CLASS="box_table">
<TR>
	<TD COLSPAN="2">
		<B><?php  putGS("Edit country name"); ?></B>
Example #6
0
$Pub = Input::Get('Pub', 'int');
$Language = Input::Get('Language', 'int', 1, true);

if (!Input::IsValid()) {
	camp_html_display_error(getGS('Invalid input: $1', Input::GetErrorString()), $_SERVER['REQUEST_URI']);
	exit;
}

$publicationObj = new Publication($Pub);
$pubTimeUnit = new TimeUnit($publicationObj->getTimeUnit(), $publicationObj->getLanguageId());
if (!$pubTimeUnit->exists()) {
	$pubTimeUnit = new TimeUnit($publicationObj->getTimeUnit(), 1);
}

$countries = Country::GetCountries($Language);

include_once($GLOBALS['g_campsiteDir']."/$ADMIN_DIR/javascript_common.php");

$crumbs = array(getGS("Subscriptions") => "deftime.php?Pub=$Pub&Language=$Language");
camp_html_content_top(getGS("Set subscription settings for a country"), array("Pub" => $publicationObj), true, false, $crumbs);
?>

<P>
<FORM METHOD="POST" ACTION="do_countryadd.php" onsubmit="return <?php camp_html_fvalidate(); ?>;">
<?php echo SecurityToken::FormParameter(); ?>
<TABLE BORDER="0" CELLSPACING="0" CELLPADDING="0" CLASS="box_table">
<INPUT TYPE="HIDDEN" NAME="cPub" VALUE="<?php p($Pub); ?>">
<TR>
	<TD ALIGN="RIGHT" ><?php  putGS("Country"); ?>:</TD>
	<TD>
Example #7
0
$fields = array('UName', 'Name', 'Title', 'Gender', 'Age', 'EMail', 'City', 'StrAddress',
	'State', 'CountryCode', 'Phone', 'Fax', 'Contact', 'Phone2', 'PostalCode', 'Employer',
	'EmployerType', 'Position');
if ($isNewUser) {
	$action = 'do_add.php';
	foreach ($fields as $index=>$field) {
		$$field = Input::Get($field, 'string', '');
	}
} else {
	$action = 'do_edit.php';
	foreach ($fields as $index=>$field) {
		$$field = $editUser->getProperty($field);
	}
}
$userTypes = UserType::GetUserTypes();
$countries = Country::GetCountries(1);
$my_user_type = $editUser->getUserType();

?>
<script type="text/javascript" src="<?php echo $Campsite['WEBSITE_URL']; ?>/js/campsite.js"></script>

<script type="text/javascript" src="<?php echo $Campsite['WEBSITE_URL']; ?>/js/pwd_meter/js/pwd_meter_min.js"></script>
<script type="text/javascript" src="<?php echo $Campsite['WEBSITE_URL']; ?>/js/pwd_meter/js/pwd_generator_min.js"></script>
<link href="<?php echo $Campsite['WEBSITE_URL']; ?>/js/pwd_meter/css/default.css" rel="stylesheet" type="text/css" />


<form name="user_add" method="POST" action="<?php echo $action; ?>" onsubmit="return <?php camp_html_fvalidate(); ?>;">
<?php echo SecurityToken::FormParameter(); ?>
<input type="hidden" name="uType" value="<?php echo $uType; ?>">
<?php
if (!$isNewUser) {