class-wp-terms-list-table.php 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686
  1. <?php
  2. /**
  3. * List Table API: WP_Terms_List_Table class
  4. *
  5. * @package WordPress
  6. * @subpackage Administration
  7. * @since 3.1.0
  8. */
  9. /**
  10. * Core class used to implement displaying terms in a list table.
  11. *
  12. * @since 3.1.0
  13. * @access private
  14. *
  15. * @see WP_List_Table
  16. */
  17. class WP_Terms_List_Table extends WP_List_Table {
  18. public $callback_args;
  19. private $level;
  20. /**
  21. * Constructor.
  22. *
  23. * @since 3.1.0
  24. *
  25. * @see WP_List_Table::__construct() for more information on default arguments.
  26. *
  27. * @global string $post_type
  28. * @global string $taxonomy
  29. * @global string $action
  30. * @global object $tax
  31. *
  32. * @param array $args An associative array of arguments.
  33. */
  34. public function __construct( $args = array() ) {
  35. global $post_type, $taxonomy, $action, $tax;
  36. parent::__construct(
  37. array(
  38. 'plural' => 'tags',
  39. 'singular' => 'tag',
  40. 'screen' => isset( $args['screen'] ) ? $args['screen'] : null,
  41. )
  42. );
  43. $action = $this->screen->action;
  44. $post_type = $this->screen->post_type;
  45. $taxonomy = $this->screen->taxonomy;
  46. if ( empty( $taxonomy ) ) {
  47. $taxonomy = 'post_tag';
  48. }
  49. if ( ! taxonomy_exists( $taxonomy ) ) {
  50. wp_die( __( 'Invalid taxonomy.' ) );
  51. }
  52. $tax = get_taxonomy( $taxonomy );
  53. // @todo Still needed? Maybe just the show_ui part.
  54. if ( empty( $post_type ) || ! in_array( $post_type, get_post_types( array( 'show_ui' => true ) ) ) ) {
  55. $post_type = 'post';
  56. }
  57. }
  58. /**
  59. * @return bool
  60. */
  61. public function ajax_user_can() {
  62. return current_user_can( get_taxonomy( $this->screen->taxonomy )->cap->manage_terms );
  63. }
  64. /**
  65. */
  66. public function prepare_items() {
  67. $tags_per_page = $this->get_items_per_page( 'edit_' . $this->screen->taxonomy . '_per_page' );
  68. if ( 'post_tag' === $this->screen->taxonomy ) {
  69. /**
  70. * Filters the number of terms displayed per page for the Tags list table.
  71. *
  72. * @since 2.8.0
  73. *
  74. * @param int $tags_per_page Number of tags to be displayed. Default 20.
  75. */
  76. $tags_per_page = apply_filters( 'edit_tags_per_page', $tags_per_page );
  77. /**
  78. * Filters the number of terms displayed per page for the Tags list table.
  79. *
  80. * @since 2.7.0
  81. * @deprecated 2.8.0 Use edit_tags_per_page instead.
  82. *
  83. * @param int $tags_per_page Number of tags to be displayed. Default 20.
  84. */
  85. $tags_per_page = apply_filters( 'tagsperpage', $tags_per_page );
  86. } elseif ( 'category' === $this->screen->taxonomy ) {
  87. /**
  88. * Filters the number of terms displayed per page for the Categories list table.
  89. *
  90. * @since 2.8.0
  91. *
  92. * @param int $tags_per_page Number of categories to be displayed. Default 20.
  93. */
  94. $tags_per_page = apply_filters( 'edit_categories_per_page', $tags_per_page );
  95. }
  96. $search = ! empty( $_REQUEST['s'] ) ? trim( wp_unslash( $_REQUEST['s'] ) ) : '';
  97. $args = array(
  98. 'search' => $search,
  99. 'page' => $this->get_pagenum(),
  100. 'number' => $tags_per_page,
  101. );
  102. if ( ! empty( $_REQUEST['orderby'] ) ) {
  103. $args['orderby'] = trim( wp_unslash( $_REQUEST['orderby'] ) );
  104. }
  105. if ( ! empty( $_REQUEST['order'] ) ) {
  106. $args['order'] = trim( wp_unslash( $_REQUEST['order'] ) );
  107. }
  108. $this->callback_args = $args;
  109. $this->set_pagination_args(
  110. array(
  111. 'total_items' => wp_count_terms( $this->screen->taxonomy, compact( 'search' ) ),
  112. 'per_page' => $tags_per_page,
  113. )
  114. );
  115. }
  116. /**
  117. * @return bool
  118. */
  119. public function has_items() {
  120. // todo: populate $this->items in prepare_items()
  121. return true;
  122. }
  123. /**
  124. */
  125. public function no_items() {
  126. echo get_taxonomy( $this->screen->taxonomy )->labels->not_found;
  127. }
  128. /**
  129. * @return array
  130. */
  131. protected function get_bulk_actions() {
  132. $actions = array();
  133. if ( current_user_can( get_taxonomy( $this->screen->taxonomy )->cap->delete_terms ) ) {
  134. $actions['delete'] = __( 'Delete' );
  135. }
  136. return $actions;
  137. }
  138. /**
  139. * @return string
  140. */
  141. public function current_action() {
  142. if ( isset( $_REQUEST['action'] ) && isset( $_REQUEST['delete_tags'] ) && ( 'delete' === $_REQUEST['action'] || 'delete' === $_REQUEST['action2'] ) ) {
  143. return 'bulk-delete';
  144. }
  145. return parent::current_action();
  146. }
  147. /**
  148. * @return array
  149. */
  150. public function get_columns() {
  151. $columns = array(
  152. 'cb' => '<input type="checkbox" />',
  153. 'name' => _x( 'Name', 'term name' ),
  154. 'description' => __( 'Description' ),
  155. 'slug' => __( 'Slug' ),
  156. );
  157. if ( 'link_category' === $this->screen->taxonomy ) {
  158. $columns['links'] = __( 'Links' );
  159. } else {
  160. $columns['posts'] = _x( 'Count', 'Number/count of items' );
  161. }
  162. return $columns;
  163. }
  164. /**
  165. * @return array
  166. */
  167. protected function get_sortable_columns() {
  168. return array(
  169. 'name' => 'name',
  170. 'description' => 'description',
  171. 'slug' => 'slug',
  172. 'posts' => 'count',
  173. 'links' => 'count',
  174. );
  175. }
  176. /**
  177. */
  178. public function display_rows_or_placeholder() {
  179. $taxonomy = $this->screen->taxonomy;
  180. $args = wp_parse_args(
  181. $this->callback_args,
  182. array(
  183. 'taxonomy' => $taxonomy,
  184. 'page' => 1,
  185. 'number' => 20,
  186. 'search' => '',
  187. 'hide_empty' => 0,
  188. )
  189. );
  190. $page = $args['page'];
  191. // Set variable because $args['number'] can be subsequently overridden.
  192. $number = $args['number'];
  193. $offset = ( $page - 1 ) * $number;
  194. $args['offset'] = $offset;
  195. // Convert it to table rows.
  196. $count = 0;
  197. if ( is_taxonomy_hierarchical( $taxonomy ) && ! isset( $args['orderby'] ) ) {
  198. // We'll need the full set of terms then.
  199. $args['number'] = 0;
  200. $args['offset'] = $args['number'];
  201. }
  202. $terms = get_terms( $args );
  203. if ( empty( $terms ) || ! is_array( $terms ) ) {
  204. echo '<tr class="no-items"><td class="colspanchange" colspan="' . $this->get_column_count() . '">';
  205. $this->no_items();
  206. echo '</td></tr>';
  207. return;
  208. }
  209. if ( is_taxonomy_hierarchical( $taxonomy ) && ! isset( $args['orderby'] ) ) {
  210. if ( ! empty( $args['search'] ) ) {// Ignore children on searches.
  211. $children = array();
  212. } else {
  213. $children = _get_term_hierarchy( $taxonomy );
  214. }
  215. // Some funky recursion to get the job done( Paging & parents mainly ) is contained within, Skip it for non-hierarchical taxonomies for performance sake
  216. $this->_rows( $taxonomy, $terms, $children, $offset, $number, $count );
  217. } else {
  218. foreach ( $terms as $term ) {
  219. $this->single_row( $term );
  220. }
  221. }
  222. }
  223. /**
  224. * @param string $taxonomy
  225. * @param array $terms
  226. * @param array $children
  227. * @param int $start
  228. * @param int $per_page
  229. * @param int $count
  230. * @param int $parent
  231. * @param int $level
  232. */
  233. private function _rows( $taxonomy, $terms, &$children, $start, $per_page, &$count, $parent = 0, $level = 0 ) {
  234. $end = $start + $per_page;
  235. foreach ( $terms as $key => $term ) {
  236. if ( $count >= $end ) {
  237. break;
  238. }
  239. if ( $term->parent != $parent && empty( $_REQUEST['s'] ) ) {
  240. continue;
  241. }
  242. // If the page starts in a subtree, print the parents.
  243. if ( $count == $start && $term->parent > 0 && empty( $_REQUEST['s'] ) ) {
  244. $my_parents = array();
  245. $parent_ids = array();
  246. $p = $term->parent;
  247. while ( $p ) {
  248. $my_parent = get_term( $p, $taxonomy );
  249. $my_parents[] = $my_parent;
  250. $p = $my_parent->parent;
  251. if ( in_array( $p, $parent_ids ) ) { // Prevent parent loops.
  252. break;
  253. }
  254. $parent_ids[] = $p;
  255. }
  256. unset( $parent_ids );
  257. $num_parents = count( $my_parents );
  258. while ( $my_parent = array_pop( $my_parents ) ) {
  259. echo "\t";
  260. $this->single_row( $my_parent, $level - $num_parents );
  261. $num_parents--;
  262. }
  263. }
  264. if ( $count >= $start ) {
  265. echo "\t";
  266. $this->single_row( $term, $level );
  267. }
  268. ++$count;
  269. unset( $terms[ $key ] );
  270. if ( isset( $children[ $term->term_id ] ) && empty( $_REQUEST['s'] ) ) {
  271. $this->_rows( $taxonomy, $terms, $children, $start, $per_page, $count, $term->term_id, $level + 1 );
  272. }
  273. }
  274. }
  275. /**
  276. * @global string $taxonomy
  277. * @param WP_Term $tag Term object.
  278. * @param int $level
  279. */
  280. public function single_row( $tag, $level = 0 ) {
  281. global $taxonomy;
  282. $tag = sanitize_term( $tag, $taxonomy );
  283. $this->level = $level;
  284. if ( $tag->parent ) {
  285. $count = count( get_ancestors( $tag->term_id, $taxonomy, 'taxonomy' ) );
  286. $level = 'level-' . $count;
  287. } else {
  288. $level = 'level-0';
  289. }
  290. echo '<tr id="tag-' . $tag->term_id . '" class="' . $level . '">';
  291. $this->single_row_columns( $tag );
  292. echo '</tr>';
  293. }
  294. /**
  295. * @param WP_Term $tag Term object.
  296. * @return string
  297. */
  298. public function column_cb( $tag ) {
  299. if ( current_user_can( 'delete_term', $tag->term_id ) ) {
  300. return sprintf(
  301. '<label class="screen-reader-text" for="cb-select-%1$s">%2$s</label>' .
  302. '<input type="checkbox" name="delete_tags[]" value="%1$s" id="cb-select-%1$s" />',
  303. $tag->term_id,
  304. /* translators: %s: Taxonomy term name. */
  305. sprintf( __( 'Select %s' ), $tag->name )
  306. );
  307. }
  308. return '&nbsp;';
  309. }
  310. /**
  311. * @param WP_Term $tag Term object.
  312. * @return string
  313. */
  314. public function column_name( $tag ) {
  315. $taxonomy = $this->screen->taxonomy;
  316. $pad = str_repeat( '&#8212; ', max( 0, $this->level ) );
  317. /**
  318. * Filters display of the term name in the terms list table.
  319. *
  320. * The default output may include padding due to the term's
  321. * current level in the term hierarchy.
  322. *
  323. * @since 2.5.0
  324. *
  325. * @see WP_Terms_List_Table::column_name()
  326. *
  327. * @param string $pad_tag_name The term name, padded if not top-level.
  328. * @param WP_Term $tag Term object.
  329. */
  330. $name = apply_filters( 'term_name', $pad . ' ' . $tag->name, $tag );
  331. $qe_data = get_term( $tag->term_id, $taxonomy, OBJECT, 'edit' );
  332. $uri = wp_doing_ajax() ? wp_get_referer() : $_SERVER['REQUEST_URI'];
  333. $edit_link = get_edit_term_link( $tag->term_id, $taxonomy, $this->screen->post_type );
  334. if ( $edit_link ) {
  335. $edit_link = add_query_arg(
  336. 'wp_http_referer',
  337. urlencode( wp_unslash( $uri ) ),
  338. $edit_link
  339. );
  340. $name = sprintf(
  341. '<a class="row-title" href="%s" aria-label="%s">%s</a>',
  342. esc_url( $edit_link ),
  343. /* translators: %s: Taxonomy term name. */
  344. esc_attr( sprintf( __( '&#8220;%s&#8221; (Edit)' ), $tag->name ) ),
  345. $name
  346. );
  347. }
  348. $out = sprintf(
  349. '<strong>%s</strong><br />',
  350. $name
  351. );
  352. $out .= '<div class="hidden" id="inline_' . $qe_data->term_id . '">';
  353. $out .= '<div class="name">' . $qe_data->name . '</div>';
  354. /** This filter is documented in wp-admin/edit-tag-form.php */
  355. $out .= '<div class="slug">' . apply_filters( 'editable_slug', $qe_data->slug, $qe_data ) . '</div>';
  356. $out .= '<div class="parent">' . $qe_data->parent . '</div></div>';
  357. return $out;
  358. }
  359. /**
  360. * Gets the name of the default primary column.
  361. *
  362. * @since 4.3.0
  363. *
  364. * @return string Name of the default primary column, in this case, 'name'.
  365. */
  366. protected function get_default_primary_column_name() {
  367. return 'name';
  368. }
  369. /**
  370. * Generates and displays row action links.
  371. *
  372. * @since 4.3.0
  373. *
  374. * @param WP_Term $tag Tag being acted upon.
  375. * @param string $column_name Current column name.
  376. * @param string $primary Primary column name.
  377. * @return string Row actions output for terms.
  378. */
  379. protected function handle_row_actions( $tag, $column_name, $primary ) {
  380. if ( $primary !== $column_name ) {
  381. return '';
  382. }
  383. $taxonomy = $this->screen->taxonomy;
  384. $tax = get_taxonomy( $taxonomy );
  385. $uri = wp_doing_ajax() ? wp_get_referer() : $_SERVER['REQUEST_URI'];
  386. $edit_link = add_query_arg(
  387. 'wp_http_referer',
  388. urlencode( wp_unslash( $uri ) ),
  389. get_edit_term_link( $tag->term_id, $taxonomy, $this->screen->post_type )
  390. );
  391. $actions = array();
  392. if ( current_user_can( 'edit_term', $tag->term_id ) ) {
  393. $actions['edit'] = sprintf(
  394. '<a href="%s" aria-label="%s">%s</a>',
  395. esc_url( $edit_link ),
  396. /* translators: %s: Taxonomy term name. */
  397. esc_attr( sprintf( __( 'Edit &#8220;%s&#8221;' ), $tag->name ) ),
  398. __( 'Edit' )
  399. );
  400. $actions['inline hide-if-no-js'] = sprintf(
  401. '<button type="button" class="button-link editinline" aria-label="%s" aria-expanded="false">%s</button>',
  402. /* translators: %s: Taxonomy term name. */
  403. esc_attr( sprintf( __( 'Quick edit &#8220;%s&#8221; inline' ), $tag->name ) ),
  404. __( 'Quick&nbsp;Edit' )
  405. );
  406. }
  407. if ( current_user_can( 'delete_term', $tag->term_id ) ) {
  408. $actions['delete'] = sprintf(
  409. '<a href="%s" class="delete-tag aria-button-if-js" aria-label="%s">%s</a>',
  410. wp_nonce_url( "edit-tags.php?action=delete&amp;taxonomy=$taxonomy&amp;tag_ID=$tag->term_id", 'delete-tag_' . $tag->term_id ),
  411. /* translators: %s: Taxonomy term name. */
  412. esc_attr( sprintf( __( 'Delete &#8220;%s&#8221;' ), $tag->name ) ),
  413. __( 'Delete' )
  414. );
  415. }
  416. if ( is_taxonomy_viewable( $tax ) ) {
  417. $actions['view'] = sprintf(
  418. '<a href="%s" aria-label="%s">%s</a>',
  419. get_term_link( $tag ),
  420. /* translators: %s: Taxonomy term name. */
  421. esc_attr( sprintf( __( 'View &#8220;%s&#8221; archive' ), $tag->name ) ),
  422. __( 'View' )
  423. );
  424. }
  425. /**
  426. * Filters the action links displayed for each term in the Tags list table.
  427. *
  428. * @since 2.8.0
  429. * @deprecated 3.0.0 Use {$taxonomy}_row_actions instead.
  430. *
  431. * @param string[] $actions An array of action links to be displayed. Default
  432. * 'Edit', 'Quick Edit', 'Delete', and 'View'.
  433. * @param WP_Term $tag Term object.
  434. */
  435. $actions = apply_filters( 'tag_row_actions', $actions, $tag );
  436. /**
  437. * Filters the action links displayed for each term in the terms list table.
  438. *
  439. * The dynamic portion of the hook name, `$taxonomy`, refers to the taxonomy slug.
  440. *
  441. * @since 3.0.0
  442. *
  443. * @param string[] $actions An array of action links to be displayed. Default
  444. * 'Edit', 'Quick Edit', 'Delete', and 'View'.
  445. * @param WP_Term $tag Term object.
  446. */
  447. $actions = apply_filters( "{$taxonomy}_row_actions", $actions, $tag );
  448. return $this->row_actions( $actions );
  449. }
  450. /**
  451. * @param WP_Term $tag Term object.
  452. * @return string
  453. */
  454. public function column_description( $tag ) {
  455. if ( $tag->description ) {
  456. return $tag->description;
  457. } else {
  458. return '<span aria-hidden="true">&#8212;</span><span class="screen-reader-text">' . __( 'No description' ) . '</span>';
  459. }
  460. }
  461. /**
  462. * @param WP_Term $tag Term object.
  463. * @return string
  464. */
  465. public function column_slug( $tag ) {
  466. /** This filter is documented in wp-admin/edit-tag-form.php */
  467. return apply_filters( 'editable_slug', $tag->slug, $tag );
  468. }
  469. /**
  470. * @param WP_Term $tag Term object.
  471. * @return string
  472. */
  473. public function column_posts( $tag ) {
  474. $count = number_format_i18n( $tag->count );
  475. $tax = get_taxonomy( $this->screen->taxonomy );
  476. $ptype_object = get_post_type_object( $this->screen->post_type );
  477. if ( ! $ptype_object->show_ui ) {
  478. return $count;
  479. }
  480. if ( $tax->query_var ) {
  481. $args = array( $tax->query_var => $tag->slug );
  482. } else {
  483. $args = array(
  484. 'taxonomy' => $tax->name,
  485. 'term' => $tag->slug,
  486. );
  487. }
  488. if ( 'post' != $this->screen->post_type ) {
  489. $args['post_type'] = $this->screen->post_type;
  490. }
  491. if ( 'attachment' === $this->screen->post_type ) {
  492. return "<a href='" . esc_url( add_query_arg( $args, 'upload.php' ) ) . "'>$count</a>";
  493. }
  494. return "<a href='" . esc_url( add_query_arg( $args, 'edit.php' ) ) . "'>$count</a>";
  495. }
  496. /**
  497. * @param WP_Term $tag Term object.
  498. * @return string
  499. */
  500. public function column_links( $tag ) {
  501. $count = number_format_i18n( $tag->count );
  502. if ( $count ) {
  503. $count = "<a href='link-manager.php?cat_id=$tag->term_id'>$count</a>";
  504. }
  505. return $count;
  506. }
  507. /**
  508. * @param WP_Term $tag Term object.
  509. * @param string $column_name
  510. * @return string
  511. */
  512. public function column_default( $tag, $column_name ) {
  513. /**
  514. * Filters the displayed columns in the terms list table.
  515. *
  516. * The dynamic portion of the hook name, `$this->screen->taxonomy`,
  517. * refers to the slug of the current taxonomy.
  518. *
  519. * @since 2.8.0
  520. *
  521. * @param string $string Blank string.
  522. * @param string $column_name Name of the column.
  523. * @param int $term_id Term ID.
  524. */
  525. return apply_filters( "manage_{$this->screen->taxonomy}_custom_column", '', $column_name, $tag->term_id );
  526. }
  527. /**
  528. * Outputs the hidden row displayed when inline editing
  529. *
  530. * @since 3.1.0
  531. */
  532. public function inline_edit() {
  533. $tax = get_taxonomy( $this->screen->taxonomy );
  534. if ( ! current_user_can( $tax->cap->edit_terms ) ) {
  535. return;
  536. }
  537. ?>
  538. <form method="get"><table style="display: none"><tbody id="inlineedit">
  539. <tr id="inline-edit" class="inline-edit-row" style="display: none"><td colspan="<?php echo $this->get_column_count(); ?>" class="colspanchange">
  540. <fieldset>
  541. <legend class="inline-edit-legend"><?php _e( 'Quick Edit' ); ?></legend>
  542. <div class="inline-edit-col">
  543. <label>
  544. <span class="title"><?php _ex( 'Name', 'term name' ); ?></span>
  545. <span class="input-text-wrap"><input type="text" name="name" class="ptitle" value="" /></span>
  546. </label>
  547. <?php if ( ! global_terms_enabled() ) { ?>
  548. <label>
  549. <span class="title"><?php _e( 'Slug' ); ?></span>
  550. <span class="input-text-wrap"><input type="text" name="slug" class="ptitle" value="" /></span>
  551. </label>
  552. <?php } ?>
  553. </div></fieldset>
  554. <?php
  555. $core_columns = array(
  556. 'cb' => true,
  557. 'description' => true,
  558. 'name' => true,
  559. 'slug' => true,
  560. 'posts' => true,
  561. );
  562. list( $columns ) = $this->get_column_info();
  563. foreach ( $columns as $column_name => $column_display_name ) {
  564. if ( isset( $core_columns[ $column_name ] ) ) {
  565. continue;
  566. }
  567. /** This action is documented in wp-admin/includes/class-wp-posts-list-table.php */
  568. do_action( 'quick_edit_custom_box', $column_name, 'edit-tags', $this->screen->taxonomy );
  569. }
  570. ?>
  571. <div class="inline-edit-save submit">
  572. <button type="button" class="cancel button alignleft"><?php _e( 'Cancel' ); ?></button>
  573. <button type="button" class="save button button-primary alignright"><?php echo $tax->labels->update_item; ?></button>
  574. <span class="spinner"></span>
  575. <?php wp_nonce_field( 'taxinlineeditnonce', '_inline_edit', false ); ?>
  576. <input type="hidden" name="taxonomy" value="<?php echo esc_attr( $this->screen->taxonomy ); ?>" />
  577. <input type="hidden" name="post_type" value="<?php echo esc_attr( $this->screen->post_type ); ?>" />
  578. <br class="clear" />
  579. <div class="notice notice-error notice-alt inline hidden">
  580. <p class="error"></p>
  581. </div>
  582. </div>
  583. </td></tr>
  584. </tbody></table></form>
  585. <?php
  586. }
  587. }