コード例 #1
0
 public static function get_plugin_information($path)
 {
     require_once $GLOBALS['ithemes_updater_path'] . '/packages.php';
     $details = Ithemes_Updater_Packages::get_full_details();
     if (!isset($details['packages'][$path])) {
         return false;
     }
     $package = $details['packages'][$path];
     require_once $GLOBALS['ithemes_updater_path'] . '/functions.php';
     require_once $GLOBALS['ithemes_updater_path'] . '/information.php';
     $changelog = Ithemes_Updater_API::get_package_changelog($package['package'], $details['packages'][$path]['installed']);
     $info = array('name' => Ithemes_Updater_Functions::get_package_name($package['package']), 'slug' => dirname($path), 'version' => $package['available'], 'author' => '<a href="http://ithemes.com/">iThemes</a>', 'download_link' => $package['package-url'], 'sections' => array('changelog' => $changelog));
     return (object) $info;
 }
コード例 #2
0
ファイル: information.php プロジェクト: khuonggau/pixel
 public static function get_plugin_information($path)
 {
     require_once $GLOBALS['ithemes_updater_path'] . '/packages.php';
     $details = Ithemes_Updater_Packages::get_full_details();
     if (!isset($details['packages'][$path])) {
         return false;
     }
     $package = $details['packages'][$path];
     $url = "http://package-info.ithemes.com/{$package['package']}/information.json";
     $response = wp_remote_get($url);
     if (!is_wp_error($response) && isset($response['body'])) {
         $info = json_decode($response['body']);
         if (is_object($info) && !empty($info->name) && !empty($info->version)) {
             $info->slug = dirname($path);
             $info->download_link = $package['package-url'];
             return $info;
         }
     }
     require_once $GLOBALS['ithemes_updater_path'] . '/functions.php';
     require_once $GLOBALS['ithemes_updater_path'] . '/information.php';
     $changelog = Ithemes_Updater_API::get_package_changelog($package['package'], $details['packages'][$path]['installed']);
     $info = array('name' => Ithemes_Updater_Functions::get_package_name($package['package']), 'slug' => dirname($path), 'version' => $package['available'], 'author' => '<a href="http://ithemes.com/">iThemes</a>', 'download_link' => $package['package-url'], 'sections' => array('changelog' => $changelog));
     return (object) $info;
 }
コード例 #3
0
ファイル: admin.php プロジェクト: jimrucinski/Vine
 public function show_activation_message()
 {
     $new_packages = $GLOBALS['ithemes-updater-settings']->get_new_packages();
     if (empty($new_packages)) {
         return;
     }
     natcasesort($new_packages);
     require_once $GLOBALS['ithemes_updater_path'] . '/functions.php';
     $names = array();
     foreach ($new_packages as $package) {
         $names = Ithemes_Updater_Functions::get_package_name($package);
     }
     if (is_multisite() && is_network_admin()) {
         $url = network_admin_url('settings.php') . "?page={$this->page_name}";
     } else {
         $url = admin_url('options-general.php') . "?page={$this->page_name}";
     }
     echo '<div class="updated fade"><p>' . wp_sprintf(__('To receive automatic updates for %l, use the <a href="%s">iThemes Licensing</a> page found in the Settings menu.', 'it-l10n-Builder-Madison'), $names, $url) . '</p></div>';
     $GLOBALS['ithemes-updater-settings']->update_packages();
 }
コード例 #4
0
ファイル: settings-page.php プロジェクト: jimlongo56/rdiv
    public function list_packages($action, $post_data)
    {
        require_once $GLOBALS['ithemes_updater_path'] . '/packages.php';
        $details = Ithemes_Updater_Packages::get_full_details();
        $packages = $details['packages'];
        $licensed = array();
        $unlicensed = array();
        $unrecognized = array();
        foreach ($packages as $path => $data) {
            $name = Ithemes_Updater_Functions::get_package_name($data['package']);
            $data['path'] = $path;
            if ('unlicensed' == $data['status']) {
                $unlicensed[$name] = $data;
            } else {
                if (in_array($data['status'], array('active', 'expired'))) {
                    $licensed[$name] = $data;
                } else {
                    $unrecognized[$name] = $data;
                }
            }
        }
        if (!empty($this->messages)) {
            foreach ($this->messages as $message) {
                echo "<div class=\"updated fade\"><p><strong>{$message}</strong></p></div>\n";
            }
        }
        if (!empty($this->errors)) {
            foreach ($this->errors as $error) {
                echo "<div class=\"error\"><p><strong>{$error}</strong></p></div>\n";
            }
        }
        if (!empty($this->soft_errors)) {
            foreach ($this->soft_errors as $error) {
                echo "<div class=\"error\"><p><strong>{$error}</strong></p></div>\n";
            }
        }
        ?>
	<div class="wrap">
		<?php 
        if (version_compare($GLOBALS['wp_version'], '3.7.10', '<=')) {
            screen_icon();
        }
        ?>
		
		<h2><?php 
        _e('iThemes Licensing', 'it-l10n-ithemes-sync');
        ?>
</h2>
		
		<?php 
        $this->list_licensed_products($licensed, $post_data, $action);
        ?>
		
		<?php 
        $this->list_unlicensed_products($unlicensed, $post_data, $action);
        ?>
		
		<?php 
        $this->list_unrecognized_products($unrecognized);
        ?>
		
		<?php 
        $this->show_settings();
        ?>
	</div>
<?php 
    }