PageRenderTime 36ms CodeModel.GetById 10ms RepoModel.GetById 0ms app.codeStats 0ms

/wp-content/plugins/sitepress-multilingual-cms/menu/compatibility-packages.php

https://bitbucket.org/kenaku/karate
PHP | 98 lines | 88 code | 10 blank | 0 comment | 17 complexity | 98bdd74c9ab4e71745610def74ba7c43 MD5 | raw file
  1. <?php
  2. $icl_enabled_packages = $WPML_Packages->get_enabled_packages();
  3. ?>
  4. <div class="wrap">
  5. <div id="icon-wpml" class="icon32"><br /></div>
  6. <h2><?php echo __('Setup WPML', 'sitepress') ?></h2>
  7. <p class="error fade" style="padding:10px;"><?php _e('WPML compatibility packages will soon be obsolete and removed. Please use other means to make your site multilingual-ready.', 'sitepress')?></p>
  8. <h3><?php echo __('Compatibility packages', 'sitepress') ?></h3>
  9. <?php foreach($WPML_Packages->get_packages() as $package_type => $packages): ?>
  10. <h4><?php echo ucfirst($package_type) ?></h4>
  11. <form action="" method="post">
  12. <?php if(isset($_POST['icl_packages'][$package_type])): ?>
  13. <div class="icl_form_success">
  14. <?php _e('Packages list updated', 'sitepress'); ?>
  15. </div>
  16. <?php endif; ?>
  17. <?php if(!empty($packages)): ?>
  18. <table id="icl_packages_<?php echo $package_type ?>" class="widefat">
  19. <thead>
  20. <tr>
  21. <th class="manage-column column-cb check-column" scope="col">&nbsp;</th>
  22. <th><?php _e('Package name', 'sitepress') ?></th>
  23. <th><?php _e('Version', 'sitepress') ?></th>
  24. <th><?php _e('Description', 'sitepress') ?></th>
  25. <?php if($package_type=='themes'):?>
  26. <th><?php _e('Used for theme', 'sitepress') ?></th>
  27. <?php endif; ?>
  28. <?php if($package_type=='plugins'):?>
  29. <th><?php _e('Used for plugin', 'sitepress') ?></th>
  30. <?php endif; ?>
  31. <th><?php _e('Author', 'sitepress') ?></th>
  32. </tr>
  33. </thead>
  34. <tbody>
  35. <?php $incr = 0; ?>
  36. <?php foreach($packages as $package_id => $package):?>
  37. <?php
  38. $incr++;
  39. if($icl_enabled_packages[$package_type][$package_id]){
  40. $checked = ' checked="checked"';
  41. }else{
  42. $checked = '';
  43. }
  44. ?>
  45. <tr <?php if($incr%2==0): ?>class="alternate"<?php endif?>>
  46. <td>
  47. <input type="hidden" name="icl_packages[<?php echo $package_type ?>][<?php echo $package_id ?>]" value="0" />
  48. <input type="checkbox" name="icl_packages[<?php echo $package_type ?>][<?php echo $package_id ?>]" value="1"<?php echo $checked; ?> />
  49. </td>
  50. <td><?php if($package['URI']) echo '<a href="'.$package['URI'].'">'; echo $package['Name']; if($package['URI']) echo '</a>';?></td>
  51. <td><?php echo $package['Version'];?></td>
  52. <td><?php echo $package['Description'];?></td>
  53. <?php if($package_type=='themes'):?>
  54. <td><?php echo $package['Theme']; if($package['ThemeVersion']) echo ' ('.$package['ThemeVersion'].')'; ?></td>
  55. <?php endif; ?>
  56. <?php if($package_type=='plugins'):?>
  57. <td><?php echo $package['Plugin']; if($package['PluginVersion']) echo ' ('.$package['PluginVersion'].')'; ?></td>
  58. <?php endif; ?>
  59. <td><?php if($package['AuthorURI']) echo '<a href="'.$package['AuthorURI'].'">'; echo $package['Author']; if($package['AuthorURI']) echo '</a>';?></td>
  60. </tr>
  61. <?php endforeach; ?>
  62. </tbody>
  63. <tfoot>
  64. <tr>
  65. <th class="manage-column column-cb check-column" scope="col">&nbsp;</th>
  66. <th><?php _e('Package name', 'sitepress') ?></th>
  67. <th><?php _e('Version', 'sitepress') ?></th>
  68. <th><?php _e('Description', 'sitepress') ?></th>
  69. <?php if($package_type=='themes'):?>
  70. <th><?php _e('Used for theme', 'sitepress') ?></th>
  71. <?php endif; ?>
  72. <?php if($package_type=='plugins'):?>
  73. <th><?php _e('Used for plugin', 'sitepress') ?></th>
  74. <?php endif; ?>
  75. <th><?php _e('Author', 'sitepress') ?></th>
  76. </tr>
  77. </tfoot>
  78. </table>
  79. <?php else: ?>
  80. <div style="text-align:center"><?php _e('No packages found', 'sitepress'); ?></div>
  81. <?php endif; ?>
  82. <?php if(!empty($packages)): ?>
  83. <p class="submit alignright"><input type="submit" value="<?php _e('Update', 'sitepress'); ?>" /></p>
  84. <br clear="all" />
  85. <?php endif; ?>
  86. </form>
  87. <?php endforeach; ?>
  88. </div>