Beispiel #1
0
 function custom_column_content($column)
 {
     global $post;
     switch ($column) {
         case FOOLIC_CPT_LICENSE . '_version':
             $license = new foolic_license();
             $license->load($post);
             echo $license->update_version;
             break;
         case FOOLIC_CPT_LICENSE . '_domains':
             $license = new foolic_license();
             $license->load($post);
             $limit = $license->domain_limit;
             if ($limit == '' || $limit == '0') {
                 echo 'Unlimited';
             } else {
                 echo $limit;
             }
             break;
         case FOOLIC_CPT_LICENSE . '_expires':
             $license = new foolic_license();
             $license->load($post);
             $days = $license->expires_in_days;
             if ($days == '' || $days == '0') {
                 echo 'Never';
             } else {
                 echo sprintf(__('%s days', 'foolic'), $days);
             }
             break;
         case FOOLIC_CPT_LICENSE_KEY . '_issued':
             echo date('d M Y', strtotime($post->post_date));
             break;
         case FOOLIC_CPT_LICENSE_KEY . '_status':
             $licensekey = new foolic_licensekey();
             $licensekey->load($post);
             $valid = foolic_licensekey_checker::validate_license_key($licensekey);
             echo '<span title="' . $valid['message'] . '" style="color:' . $valid['color'] . '">' . $valid['status'] . '</span>';
             if ($licensekey->has_exceeded_domain_limit()) {
                 echo ' ' . __('Usage:', 'foolic') . ' (' . $licensekey->usage_html() . ')';
             }
             if ($licensekey->has_expired()) {
                 echo ' ' . __('Expires:', 'foolic') . ' ' . $licensekey->expires;
             }
             break;
     }
 }
 public static function get($post)
 {
     $license_key = new foolic_licensekey();
     $license_key->load($post);
     return $license_key;
 }