Exemplo n.º 1
0
 /**
  * Recalculate the total for all time logs
  */
 public function recalculate_total_time()
 {
     $total = 0.0;
     foreach (static::$log['steps'] as $step => $data) {
         if (!isset($data['took'])) {
             continue;
         }
         $total = wpem_round($total + $data['took']);
     }
     $this->add('took', $total);
 }
Exemplo n.º 2
0
?>
">

	<title><?php 
wpem_template_title();
?>
</title>

	<?php 
wp_print_styles('wpem-fullscreen');
?>

	<style type="text/css">
	.wpem-steps-list li {
		width: <?php 
echo wpem_round(100 / count(wp_easy_mode()->admin->get_steps()), 2);
?>
%;
	}
	</style>

	<?php 
wp_print_scripts('jquery');
?>

	<!--[if lte IE 9]>
		<script src="//cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7.3/html5shiv.min.js"></script>
		<script src="//cdnjs.cloudflare.com/ajax/libs/webshim/1.15.10/dev/polyfiller.js"></script>
		<script type="text/javascript">
			jQuery.webshim.setOptions( 'extendNative', true );
			jQuery.webshim.polyfill( 'forms' );
Exemplo n.º 3
0
 /**
  * Normalize geodata between multiple API sources
  *
  * @param  array $geodata
  *
  * @return array
  */
 private function normalize($geodata)
 {
     if (isset($geodata['city']['names']['en'])) {
         $geodata['city'] = $geodata['city']['names']['en'];
     }
     if (isset($geodata['country']['iso_code'])) {
         $geodata['country_code'] = $geodata['country']['iso_code'];
     }
     if (isset($geodata['country'])) {
         $geodata['country_name'] = $geodata['country'];
     }
     if (isset($geodata['country']['names']['en'])) {
         $geodata['country_name'] = $geodata['country']['names']['en'];
     }
     if (isset($geodata['latitude'])) {
         $geodata['latitude'] = wpem_round($geodata['latitude']);
     }
     if (isset($geodata['location']['latitude'])) {
         $geodata['latitude'] = wpem_round($geodata['location']['latitude']);
     }
     if (isset($geodata['longitude'])) {
         $geodata['longitude'] = wpem_round($geodata['longitude']);
     }
     if (isset($geodata['location']['longitude'])) {
         $geodata['longitude'] = wpem_round($geodata['location']['longitude']);
     }
     if (isset($geodata['zip_code'])) {
         $geodata['postal_code'] = $geodata['zip_code'];
     }
     if (isset($geodata['postal']['code'])) {
         $geodata['postal_code'] = $geodata['postal']['code'];
     }
     if (isset($geodata['subdivisions'][0]['iso_code'])) {
         $geodata['region_code'] = $geodata['subdivisions'][0]['iso_code'];
     }
     if (isset($geodata['region'])) {
         $geodata['region_name'] = $geodata['region'];
     }
     if (isset($geodata['subdivisions'][0]['names']['en'])) {
         $geodata['region_name'] = $geodata['subdivisions'][0]['names']['en'];
     }
     if (isset($geodata['time_zone'])) {
         $geodata['timezone'] = $geodata['time_zone'];
     }
     if (isset($geodata['location']['time_zone'])) {
         $geodata['timezone'] = $geodata['location']['time_zone'];
     }
     $whitelist = array('city', 'country_code', 'country_name', 'ip', 'latitude', 'longitude', 'postal_code', 'region_code', 'region_name', 'timezone');
     $geodata = array_intersect_key($geodata, array_flip($whitelist));
     ksort($geodata);
     return $geodata;
 }
Exemplo n.º 4
0
?>
">

	<title><?php 
wpem_template_title();
?>
</title>

	<?php 
wpem_template_head();
?>

	<style type="text/css">
	.wpem-steps-list li {
		width: <?php 
echo wpem_round(100 / count(\WPEM\wpem()->admin->get_steps()), 2);
?>
%;
	}
	</style>

	<?php 
wp_print_scripts('jquery');
?>

	<!--[if lte IE 9]>
		<script src="//cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7.3/html5shiv.min.js"></script>
		<script src="//cdnjs.cloudflare.com/ajax/libs/webshim/1.15.10/dev/polyfiller.js"></script>
		<script type="text/javascript">
			jQuery.webshim.setOptions( 'extendNative', true );
			jQuery.webshim.polyfill( 'forms' );