Ejemplo n.º 1
0
 /**
  * Class constructor
  *
  * @param Log       $log
  * @param Image_API $image_api
  */
 public function __construct(Log $log, Image_API $image_api)
 {
     $this->image_api = $image_api;
     parent::__construct($log);
     $this->args = ['name' => 'theme', 'title' => __('Theme', 'wp-easy-mode'), 'page_title' => __('Choose a Theme', 'wp-easy-mode'), 'can_skip' => false];
     add_action('wpem_print_footer_scripts_' . $this->args['name'], [$this, 'print_footer_scripts']);
     $pointer = new Pointer();
     $pos = 1;
     $count = 2;
     if ('store' !== wpem_get_site_type()) {
         $count = 3;
         $pointer->register(['id' => 'wpem_theme_preview_1', 'target' => '#wpem-header-images-wrapper', 'cap' => 'manage_options', 'options' => ['content' => wp_kses_post(sprintf('<h3>%s</h3><p>%s</p>', sprintf(__('Step %1$s of %2$s', 'wp-easy-mode'), $pos++, $count), __('Choose a stylish header image for your website.', 'wp-easy-mode'))), 'position' => ['edge' => 'left', 'align' => 'right']], 'btn_primary' => __('Next', 'wp-easy-mode'), 'close_on_load' => true, 'next_pointer' => 'wpem_theme_preview_2']);
     }
     $pointer->register(['id' => 'wpem_theme_preview_2', 'target' => '.wp-full-overlay-header .next-theme', 'cap' => 'manage_options', 'options' => ['content' => wp_kses_post(sprintf('<h3>%s</h3><p>%s</p>', sprintf(__('Step %1$s of %2$s', 'wp-easy-mode'), $pos++, $count), __('Preview different website designs using the the left and right arrows.', 'wp-easy-mode'))), 'position' => ['at' => 'left bottom', 'my' => 'left-63 top']], 'btn_primary' => __('Next', 'wp-easy-mode'), 'close_on_load' => true, 'next_pointer' => 'wpem_theme_preview_3']);
     $pointer->register(['id' => 'wpem_theme_preview_3', 'target' => '.button-primary.theme-install', 'cap' => 'manage_options', 'options' => ['content' => wp_kses_post(sprintf('<h3>%s</h3><p>%s</p>', sprintf(__('Step %1$s of %2$s', 'wp-easy-mode'), $pos, $count), __("When you've found a design you like, click Select to install it.", 'wp-easy-mode'))), 'position' => ['at' => 'left bottom', 'my' => 'left-34 top+5']], 'btn_primary' => __('Close', 'wp-easy-mode'), 'btn_primary_close' => true, 'close_on_load' => true]);
     $pointer->register_scripts();
 }
Ejemplo n.º 2
0
        }
        if (empty($username)) {
            throw Exception("No USERNAME");
        }
        if (empty($password)) {
            throw Exception("No PASSWORD");
        }
        $header[] = "MARS-API-KEY: " . $api_key;
        $auth = [$username, $password];
        $options = array(CURLOPT_URL => $url, CURLOPT_RETURNTRANSFER => true, CURLOPT_HTTPAUTH => CURLAUTH_DIGEST, CURLOPT_USERPWD => implode(":", $auth), CURLOPT_HTTPHEADER => $header, CURLOPT_SSL_VERIFYPEER => false);
        if (!empty($post)) {
            $options[CURLOPT_POST] = true;
            $options[CURLOPT_POSTFIELDS] = $post;
        }
        $ch = curl_init();
        curl_setopt_array($ch, $options);
        $content = curl_exec($ch);
        curl_close($ch);
        return $content;
    }
}
Pointer::$API_KEY = "";
// API_KEY
Pointer::$USERNAME = "";
// EMAIL
Pointer::$PASSWORD = "";
// PASSWORD
Pointer::$FORMAT = Pointer::FORMAT_JSON;
// FORMAT_JSON or FORMAT_XML
$output = Pointer::FlightCheck(Pointer::SRIWIJAYA, "CGK", "DPS", "21/01/2016", 1);
echo $output;