PageRenderTime 49ms CodeModel.GetById 23ms RepoModel.GetById 0ms app.codeStats 0ms

/plugins/wp-table-reloaded/views/view-ajax_list.php

https://github.com/petergibbons/OpenCounterWP
PHP | 55 lines | 52 code | 2 blank | 1 comment | 4 complexity | 26cccf790375be8e82a2ab36286ed570 MD5 | raw file
  1. <?php if ( !defined( 'WP_TABLE_RELOADED_ABSPATH' ) ) exit; // no direct loading of this file ?>
  2. <div style="clear:both;"><p>
  3. <?php _e( 'This is a list of all available tables.', WP_TABLE_RELOADED_TEXTDOMAIN ); ?> <?php _e( 'You may insert a table into a post or page here.', WP_TABLE_RELOADED_TEXTDOMAIN ); ?><br />
  4. <?php printf( __( 'Click the &quot;%s&quot; link after the desired table and the corresponding shortcode will be inserted into the editor (<strong>[table id=&lt;ID&gt; /]</strong>).', WP_TABLE_RELOADED_TEXTDOMAIN ), __( 'Insert', WP_TABLE_RELOADED_TEXTDOMAIN ) ); ?>
  5. </p></div>
  6. <?php
  7. if ( 0 < count( $this->tables ) ) {
  8. ?>
  9. <div style="clear:both;">
  10. <table class="widefat">
  11. <thead>
  12. <tr>
  13. <th scope="col"><?php _e( 'ID', WP_TABLE_RELOADED_TEXTDOMAIN ); ?></th>
  14. <th scope="col"><?php _e( 'Table Name', WP_TABLE_RELOADED_TEXTDOMAIN ); ?></th>
  15. <th scope="col"><?php _e( 'Description', WP_TABLE_RELOADED_TEXTDOMAIN ); ?></th>
  16. <th scope="col"><?php _e( 'Action', WP_TABLE_RELOADED_TEXTDOMAIN ); ?></th>
  17. </tr>
  18. </thead>
  19. <tfoot>
  20. <tr>
  21. <th scope="col"><?php _e( 'ID', WP_TABLE_RELOADED_TEXTDOMAIN ); ?></th>
  22. <th scope="col"><?php _e( 'Table Name', WP_TABLE_RELOADED_TEXTDOMAIN ); ?></th>
  23. <th scope="col"><?php _e( 'Description', WP_TABLE_RELOADED_TEXTDOMAIN ); ?></th>
  24. <th scope="col"><?php _e( 'Action', WP_TABLE_RELOADED_TEXTDOMAIN ); ?></th>
  25. </tr>
  26. </tfoot>
  27. <tbody>
  28. <?php
  29. $bg_style_index = 0;
  30. foreach ( $this->tables as $id => $tableoptionname ) {
  31. $bg_style_index++;
  32. $bg_style = ( 1 == ($bg_style_index % 2) ) ? ' class="alternate"' : '';
  33. // get name and description to show in list
  34. $table = $this->load_table( $id );
  35. $name = $this->helper->safe_output( $table['name'] );
  36. $description = $this->helper->safe_output( $table['description'] );
  37. unset( $table );
  38. echo "<tr{$bg_style}>\n";
  39. echo "\t<th scope=\"row\">{$id}</th>";
  40. echo "<td style=\"vertical-align:inherit;\">{$name}</td>";
  41. echo "<td style=\"vertical-align:inherit;\">{$description}</td>";
  42. echo "<td style=\"vertical-align:inherit;\"><a class=\"send_table_to_editor\" title=\"{$id}\" href=\"#\" style=\"color:#21759B;\">" . __( 'Insert', WP_TABLE_RELOADED_TEXTDOMAIN ) . "</a></td>\n";
  43. echo "</tr>\n";
  44. }
  45. ?>
  46. </tbody>
  47. </table>
  48. </div>
  49. <?php
  50. } else { // end if $tables
  51. echo "<div style=\"clear:both;\"><p>" . __( 'No tables were found.', WP_TABLE_RELOADED_TEXTDOMAIN ) . "</p></div>";
  52. }
  53. ?>