当前位置: 首页>>代码示例>>PHP>>正文


PHP Lookup::vat_countries方法代码示例

本文整理汇总了PHP中Lookup::vat_countries方法的典型用法代码示例。如果您正苦于以下问题:PHP Lookup::vat_countries方法的具体用法?PHP Lookup::vat_countries怎么用?PHP Lookup::vat_countries使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Lookup的用法示例。


在下文中一共展示了Lookup::vat_countries方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: general

	/**
	 * Displays the General Settings screen and processes updates
	 *	 
	 * @since 1.0
	 *
	 * @return void
	 **/
	function general () {
		global $Ecart;
		if ( !(current_user_can('manage_options') && current_user_can('ecart_settings')) )
			wp_die(__('You do not have sufficient permissions to access this page.'));

		$updatekey = $Ecart->Settings->get('updatekey');
		$activated = ($updatekey[0] == "1");
		$type = "text";
		$key = $updatekey[1];
		if (isset($updatekey[2]) && $updatekey[2] == "dev") {
			$type = "password";
			$key = preg_replace('/\w/','?',$key);
		}

		$country = (isset($_POST['settings']))?$_POST['settings']['base_operations']['country']:'';
		$countries = array();
		$countrydata = Lookup::countries();
		foreach ($countrydata as $iso => $c) {
			if (isset($_POST['settings']) && $_POST['settings']['base_operations']['country'] == $iso)
				$base_region = $c['region'];
			$countries[$iso] = $c['name'];
		}

		if (!empty($_POST['setup'])) {
			$_POST['settings']['display_welcome'] = "off";
			$this->settings_save();
		}

		if (!empty($_POST['save'])) {
			check_admin_referer('ecart-settings-general');
			$vat_countries = Lookup::vat_countries();
			$zone = $_POST['settings']['base_operations']['zone'];
			$_POST['settings']['base_operations'] = $countrydata[$_POST['settings']['base_operations']['country']];
			$_POST['settings']['base_operations']['country'] = $country;
			$_POST['settings']['base_operations']['zone'] = $zone;
			$_POST['settings']['base_operations']['currency']['format'] =
				scan_money_format($_POST['settings']['base_operations']['currency']['format']);
			if (in_array($_POST['settings']['base_operations']['country'],$vat_countries))
				$_POST['settings']['base_operations']['vat'] = true;
			else $_POST['settings']['base_operations']['vat'] = false;

			if (!isset($_POST['settings']['target_markets']))
				asort($_POST['settings']['target_markets']);

			$this->settings_save();
			$updated = __('Ecart settings saved.', 'Ecart');
		}

		$operations = $Ecart->Settings->get('base_operations');
		if (!empty($operations['zone'])) {
			$zones = Lookup::country_zones();
			$zones = $zones[$operations['country']];
		}

		$targets = $Ecart->Settings->get('target_markets');
		if (!$targets) $targets = array();

		$statusLabels = $Ecart->Settings->get('order_status');
		include(ECART_ADMIN_PATH."/settings/settings.php");
	}
开发者ID:robbiespire,项目名称:paQui,代码行数:67,代码来源:Setup.php


注:本文中的Lookup::vat_countries方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。