@@ -1,9 +1,9 @@ |
||
1 | -<?php if ( !defined( 'ABSPATH' ) ) exit; ?> |
|
1 | +<?php if (!defined('ABSPATH')) exit; ?> |
|
2 | 2 | |
3 | -<br /><h3><?php _e( 'Chart', 'wpeolog-i18n' ); ?></h3> |
|
3 | +<br /><h3><?php _e('Chart', 'wpeolog-i18n'); ?></h3> |
|
4 | 4 | |
5 | -<?php if( empty( $count_error ) && empty( $count_info ) && empty( $count_warning ) ): ?> |
|
6 | - <?php _e( 'No data for chart', 'wpeolog-i18n'); ?> |
|
5 | +<?php if (empty($count_error) && empty($count_info) && empty($count_warning)): ?> |
|
6 | + <?php _e('No data for chart', 'wpeolog-i18n'); ?> |
|
7 | 7 | <?php else: ?> |
8 | 8 | <canvas class="alignleft" id="myChart" width="200" height="200"></canvas> |
9 | 9 | <?php endif; ?> |
@@ -1,12 +1,18 @@ |
||
1 | -<?php if ( !defined( 'ABSPATH' ) ) exit; ?> |
|
1 | +<?php if ( !defined( 'ABSPATH' ) ) { |
|
2 | + exit; |
|
3 | +} |
|
4 | +?> |
|
2 | 5 | |
3 | 6 | <br /><h3><?php _e( 'Chart', 'wpeolog-i18n' ); ?></h3> |
4 | 7 | |
5 | 8 | <?php if( empty( $count_error ) && empty( $count_info ) && empty( $count_warning ) ): ?> |
6 | 9 | <?php _e( 'No data for chart', 'wpeolog-i18n'); ?> |
7 | -<?php else: ?> |
|
10 | +<?php else { |
|
11 | + : ?> |
|
8 | 12 | <canvas class="alignleft" id="myChart" width="200" height="200"></canvas> |
9 | -<?php endif; ?> |
|
13 | +<?php endif; |
|
14 | +} |
|
15 | +?> |
|
10 | 16 | |
11 | 17 | <script type="text/javascript"> |
12 | 18 | jQuery( document ).ready( function() { |
@@ -1,90 +1,90 @@ |
||
1 | -<?php if ( !defined( 'ABSPATH' ) ) exit; ?> |
|
1 | +<?php if (!defined('ABSPATH')) exit; ?> |
|
2 | 2 | |
3 | 3 | <div class="tablenav top"> |
4 | 4 | <div class="tablenav-pages"> |
5 | - <span class="displaying-num"><?php echo !empty( $array_service ) ? count( $array_service ) : 0; _e( ' item(s)', 'wpeolog-i18n' ); ?></span> |
|
5 | + <span class="displaying-num"><?php echo !empty($array_service) ? count($array_service) : 0; _e(' item(s)', 'wpeolog-i18n'); ?></span> |
|
6 | 6 | </div> |
7 | 7 | </div> |
8 | 8 | |
9 | 9 | |
10 | -<form action="<?php echo admin_url( 'admin-post.php' ); ?>" method="post"> |
|
10 | +<form action="<?php echo admin_url('admin-post.php'); ?>" method="post"> |
|
11 | 11 | <input type="hidden" name="action" value="edit_service" /> |
12 | 12 | |
13 | 13 | <table class="wp-list-table widefat fixed striped posts"> |
14 | 14 | <thead> |
15 | 15 | <tr> |
16 | - <th scope="col" id="id" class="manage-column"><?php _e( 'ID', 'wpeolog-i18n' ); ?></th> |
|
17 | - <th scope="col" id="active" class="manage-column"><?php _e( 'Active', 'wpeolog-i18n' ); ?></th> |
|
16 | + <th scope="col" id="id" class="manage-column"><?php _e('ID', 'wpeolog-i18n'); ?></th> |
|
17 | + <th scope="col" id="active" class="manage-column"><?php _e('Active', 'wpeolog-i18n'); ?></th> |
|
18 | 18 | <th scope="col" id="title" class="manage-column column-title column-primary sortable desc"> |
19 | - <?php _e( 'Name', 'wpeolog-i18n' ); ?></th> |
|
20 | - <th scope="col" id="size" class="manage-column"><?php _e( 'Size', 'wpeolog-i18n' ); ?></th> |
|
21 | - <th scope="col" id="size-format" class="manage-column"><?php _e( 'File size', 'wpeolog-i18n' ); ?></th> |
|
22 | - <th scope="col" id="rotate" class="manage-column"><?php _e( 'File rotate', 'wpeolog-i18n' ); ?></th> |
|
23 | - <th scope="col" id="number-file" class="manage-column"><?php _e( 'Number file', 'wpeolog-i18n' ); ?></th> |
|
19 | + <?php _e('Name', 'wpeolog-i18n'); ?></th> |
|
20 | + <th scope="col" id="size" class="manage-column"><?php _e('Size', 'wpeolog-i18n'); ?></th> |
|
21 | + <th scope="col" id="size-format" class="manage-column"><?php _e('File size', 'wpeolog-i18n'); ?></th> |
|
22 | + <th scope="col" id="rotate" class="manage-column"><?php _e('File rotate', 'wpeolog-i18n'); ?></th> |
|
23 | + <th scope="col" id="number-file" class="manage-column"><?php _e('Number file', 'wpeolog-i18n'); ?></th> |
|
24 | 24 | </tr> |
25 | 25 | </thead> |
26 | 26 | |
27 | 27 | <tbody id="the-list"> |
28 | - <?php if ( !empty( $array_service ) ): ?> |
|
29 | - <?php foreach ( $array_service as $key => $service ): ?> |
|
28 | + <?php if (!empty($array_service)): ?> |
|
29 | + <?php foreach ($array_service as $key => $service): ?> |
|
30 | 30 | <tr> |
31 | 31 | <td><?php echo $key; ?></td> |
32 | 32 | <th scope="row"> |
33 | - <input type="hidden" name="service[<?php echo $key; ?>][created_date]" value="<?php echo !empty( $service['created_date'] ) ? $service['created_date'] : ''; ?>" /> |
|
34 | - <input type="checkbox" name="service[<?php echo $key; ?>][active]" <?php echo !empty( $service['active'] ) ? 'checked="checked"' : ''; ?> /> |
|
33 | + <input type="hidden" name="service[<?php echo $key; ?>][created_date]" value="<?php echo !empty($service['created_date']) ? $service['created_date'] : ''; ?>" /> |
|
34 | + <input type="checkbox" name="service[<?php echo $key; ?>][active]" <?php echo !empty($service['active']) ? 'checked="checked"' : ''; ?> /> |
|
35 | 35 | </th> |
36 | 36 | <td> |
37 | - <input type="text" name="service[<?php echo $key; ?>][name]" value="<?php echo !empty( $service['name'] ) ? $service['name'] : ''; ?>" /> |
|
37 | + <input type="text" name="service[<?php echo $key; ?>][name]" value="<?php echo !empty($service['name']) ? $service['name'] : ''; ?>" /> |
|
38 | 38 | <div class="row-actions"> |
39 | - <span class="trash"><a class="submitdelete" title="<?php _e( 'Move this item to the Trash', 'wpeolog-i18n' ); ?>" href="<?php echo wp_nonce_url( admin_url( 'admin-post.php?service_id=' . $key . '&action=to_trash' ), 'to_trash_' . $key ); ?>"><?php _e( 'Trash', 'wpeolog-i18n' ); ?></a> </span> |
|
39 | + <span class="trash"><a class="submitdelete" title="<?php _e('Move this item to the Trash', 'wpeolog-i18n'); ?>" href="<?php echo wp_nonce_url(admin_url('admin-post.php?service_id=' . $key . '&action=to_trash'), 'to_trash_' . $key); ?>"><?php _e('Trash', 'wpeolog-i18n'); ?></a> </span> |
|
40 | 40 | </div> |
41 | 41 | </td> |
42 | - <td><input type="text" name="service[<?php echo $key; ?>][size]" value="<?php echo !empty( $service['size'] ) ? $this->convert_to( $service['size'], $service['format'] , false ) : ''; ?>" /></td> |
|
42 | + <td><input type="text" name="service[<?php echo $key; ?>][size]" value="<?php echo !empty($service['size']) ? $this->convert_to($service['size'], $service['format'], false) : ''; ?>" /></td> |
|
43 | 43 | <td> |
44 | 44 | <select name="service[<?php echo $key; ?>][format]"> |
45 | - <?php if ( !empty( $array_size_format ) ): ?> |
|
46 | - <?php foreach ( $array_size_format as $key_format => $value ): ?> |
|
47 | - <option <?php echo selected( !empty( $service['format'] ) ? $service['format'] : 'oc', $key_format ); ?> value='<?php echo $key_format; ?>'><?php echo $value; ?></option> |
|
45 | + <?php if (!empty($array_size_format)): ?> |
|
46 | + <?php foreach ($array_size_format as $key_format => $value): ?> |
|
47 | + <option <?php echo selected(!empty($service['format']) ? $service['format'] : 'oc', $key_format); ?> value='<?php echo $key_format; ?>'><?php echo $value; ?></option> |
|
48 | 48 | <?php endforeach; ?> |
49 | 49 | <?php endif; ?> |
50 | 50 | </select> |
51 | 51 | </td> |
52 | 52 | <td> |
53 | 53 | <select name="service[<?php echo $key; ?>][rotate]"> |
54 | - <?php if ( !empty( $array_file_rotate_dropdown ) ): ?> |
|
55 | - <?php foreach ( $array_file_rotate_dropdown as $key_rotate => $value ): ?> |
|
56 | - <option <?php echo selected( !empty( $service['rotate'] ) ? $service['rotate'] : 'on', $key_rotate ); ?> value='<?php echo $key_rotate; ?>'><?php echo $value; ?></option> |
|
54 | + <?php if (!empty($array_file_rotate_dropdown)): ?> |
|
55 | + <?php foreach ($array_file_rotate_dropdown as $key_rotate => $value): ?> |
|
56 | + <option <?php echo selected(!empty($service['rotate']) ? $service['rotate'] : 'on', $key_rotate); ?> value='<?php echo $key_rotate; ?>'><?php echo $value; ?></option> |
|
57 | 57 | <?php endforeach; ?> |
58 | 58 | <?php endif; ?> |
59 | 59 | </select> |
60 | 60 | </td> |
61 | - <td><input type="text" name="service[<?php echo $key; ?>][number]" value="<?php echo !empty( $service['number'] ) ? $service['number'] : 0; ?>" /></td> |
|
61 | + <td><input type="text" name="service[<?php echo $key; ?>][number]" value="<?php echo !empty($service['number']) ? $service['number'] : 0; ?>" /></td> |
|
62 | 62 | </tr> |
63 | 63 | <?php endforeach; ?> |
64 | 64 | <?php else: ?> |
65 | 65 | <tr> |
66 | - <td><?php _e( 'No services found.', 'wpeolog-i18n' ); ?></td> |
|
66 | + <td><?php _e('No services found.', 'wpeolog-i18n'); ?></td> |
|
67 | 67 | </tr> |
68 | 68 | <?php endif; ?> |
69 | 69 | </tbody> |
70 | 70 | |
71 | 71 | <tfoot> |
72 | 72 | <tr> |
73 | - <th scope="col" id="id" class="manage-column"><?php _e( 'ID', 'wpeolog-i18n' ); ?></th> |
|
74 | - <th scope="col" id="active" class="manage-column"><?php _e( 'Active', 'wpeolog-i18n' ); ?></th> |
|
75 | - <th scope="col" id="title" class="manage-column column-title column-primary sortable desc"><?php _e( 'Name', 'wpeolog-i18n' ); ?></th> |
|
76 | - <th scope="col" id="size" class="manage-column"><?php _e( 'Size', 'wpeolog-i18n' ); ?></th> |
|
77 | - <th scope="col" id="size-format" class="manage-column"><?php _e( 'File size', 'wpeolog-i18n' ); ?></th> |
|
78 | - <th scope="col" id="rotate" class="manage-column"><?php _e( 'File rotate', 'wpeolog-i18n' ); ?></th> |
|
79 | - <th scope="col" id="number-file" class="manage-column"><?php _e( 'Number file', 'wpeolog-i18n' ); ?></th> |
|
73 | + <th scope="col" id="id" class="manage-column"><?php _e('ID', 'wpeolog-i18n'); ?></th> |
|
74 | + <th scope="col" id="active" class="manage-column"><?php _e('Active', 'wpeolog-i18n'); ?></th> |
|
75 | + <th scope="col" id="title" class="manage-column column-title column-primary sortable desc"><?php _e('Name', 'wpeolog-i18n'); ?></th> |
|
76 | + <th scope="col" id="size" class="manage-column"><?php _e('Size', 'wpeolog-i18n'); ?></th> |
|
77 | + <th scope="col" id="size-format" class="manage-column"><?php _e('File size', 'wpeolog-i18n'); ?></th> |
|
78 | + <th scope="col" id="rotate" class="manage-column"><?php _e('File rotate', 'wpeolog-i18n'); ?></th> |
|
79 | + <th scope="col" id="number-file" class="manage-column"><?php _e('Number file', 'wpeolog-i18n'); ?></th> |
|
80 | 80 | </tr> |
81 | 81 | </tfoot> |
82 | 82 | </table> |
83 | 83 | |
84 | 84 | <div class="tablenav bottom"> |
85 | 85 | <div class="alignleft actions bulkactions"> |
86 | - <input type="submit" name="submit" id="submit" class="button button-primary" value="<?php _e( 'Save Changes', 'wpeolog-i18n'); ?>" /> |
|
87 | - <a href="<?php echo admin_url( 'tools.php?page=wpeo-log-page' ); ?>" class="button"><?php _e( 'Back', 'wpeolog-i18n'); ?></a> |
|
86 | + <input type="submit" name="submit" id="submit" class="button button-primary" value="<?php _e('Save Changes', 'wpeolog-i18n'); ?>" /> |
|
87 | + <a href="<?php echo admin_url('tools.php?page=wpeo-log-page'); ?>" class="button"><?php _e('Back', 'wpeolog-i18n'); ?></a> |
|
88 | 88 | </div> |
89 | 89 | </div> |
90 | 90 |
@@ -1,4 +1,7 @@ discard block |
||
1 | -<?php if ( !defined( 'ABSPATH' ) ) exit; ?> |
|
1 | +<?php if ( !defined( 'ABSPATH' ) ) { |
|
2 | + exit; |
|
3 | +} |
|
4 | +?> |
|
2 | 5 | |
3 | 6 | <div class="tablenav top"> |
4 | 7 | <div class="tablenav-pages"> |
@@ -61,9 +64,12 @@ discard block |
||
61 | 64 | <td><input type="text" name="service[<?php echo $key; ?>][number]" value="<?php echo !empty( $service['number'] ) ? $service['number'] : 0; ?>" /></td> |
62 | 65 | </tr> |
63 | 66 | <?php endforeach; ?> |
64 | - <?php else: ?> |
|
67 | + <?php else { |
|
68 | + : ?> |
|
65 | 69 | <tr> |
66 | - <td><?php _e( 'No services found.', 'wpeolog-i18n' ); ?></td> |
|
70 | + <td><?php _e( 'No services found.', 'wpeolog-i18n' ); |
|
71 | +} |
|
72 | +?></td> |
|
67 | 73 | </tr> |
68 | 74 | <?php endif; ?> |
69 | 75 | </tbody> |
@@ -1,23 +1,23 @@ |
||
1 | -<?php if ( !defined( 'ABSPATH' ) ) exit; ?> |
|
1 | +<?php if (!defined('ABSPATH')) exit; ?> |
|
2 | 2 | |
3 | 3 | <div class="wrap wpeo-logs-wrap"> |
4 | - <h2><?php _e('Logs', 'wpeolog-i18n'); ?> <a class="add-new-h2" href="<?php echo admin_url( 'admin-post.php?action=add' ); ?>"><?php _e( 'Add New', 'wpeolog-i18n' ); ?></a></h2> |
|
4 | + <h2><?php _e('Logs', 'wpeolog-i18n'); ?> <a class="add-new-h2" href="<?php echo admin_url('admin-post.php?action=add'); ?>"><?php _e('Add New', 'wpeolog-i18n'); ?></a></h2> |
|
5 | 5 | |
6 | - <?php if ( !empty( $page_transient ) ): ?> |
|
6 | + <?php if (!empty($page_transient)): ?> |
|
7 | 7 | <div class="<?php echo $page_transient['type']; ?> notice"> |
8 | 8 | <p><?php echo $page_transient['message']; ?></p> |
9 | 9 | </div> |
10 | 10 | <?php endif; ?> |
11 | 11 | |
12 | 12 | <?php |
13 | - $action = sanitize_text_field( $_GET['action'] ); |
|
14 | - if ( !empty( $action ) && 'edit' == $action ): |
|
15 | - require_once( wpeo_template_01::get_template_part( WPEO_LOGS_DIR, WPEO_LOGS_TEMPLATES_MAIN_DIR, 'backend', 'list', 'service-edit' ) ); |
|
16 | - elseif ( !empty( $action ) && 'view' == $action ): |
|
17 | - require_once( wpeo_template_01::get_template_part( WPEO_LOGS_DIR, WPEO_LOGS_TEMPLATES_MAIN_DIR, 'backend', 'view', 'service' ) ); |
|
18 | - require_once( wpeo_template_01::get_template_part( WPEO_LOGS_DIR, WPEO_LOGS_TEMPLATES_MAIN_DIR, 'backend', 'chart' ) ); |
|
13 | + $action = sanitize_text_field($_GET['action']); |
|
14 | + if (!empty($action) && 'edit' == $action): |
|
15 | + require_once(wpeo_template_01::get_template_part(WPEO_LOGS_DIR, WPEO_LOGS_TEMPLATES_MAIN_DIR, 'backend', 'list', 'service-edit')); |
|
16 | + elseif (!empty($action) && 'view' == $action): |
|
17 | + require_once(wpeo_template_01::get_template_part(WPEO_LOGS_DIR, WPEO_LOGS_TEMPLATES_MAIN_DIR, 'backend', 'view', 'service')); |
|
18 | + require_once(wpeo_template_01::get_template_part(WPEO_LOGS_DIR, WPEO_LOGS_TEMPLATES_MAIN_DIR, 'backend', 'chart')); |
|
19 | 19 | else: |
20 | - require_once( wpeo_template_01::get_template_part( WPEO_LOGS_DIR, WPEO_LOGS_TEMPLATES_MAIN_DIR, 'backend', 'list', 'service' ) ); |
|
20 | + require_once(wpeo_template_01::get_template_part(WPEO_LOGS_DIR, WPEO_LOGS_TEMPLATES_MAIN_DIR, 'backend', 'list', 'service')); |
|
21 | 21 | endif; |
22 | 22 | ?> |
23 | 23 | </div> |
@@ -1,4 +1,7 @@ discard block |
||
1 | -<?php if ( !defined( 'ABSPATH' ) ) exit; ?> |
|
1 | +<?php if ( !defined( 'ABSPATH' ) ) { |
|
2 | + exit; |
|
3 | +} |
|
4 | +?> |
|
2 | 5 | |
3 | 6 | <div class="wrap wpeo-logs-wrap"> |
4 | 7 | <h2><?php _e('Logs', 'wpeolog-i18n'); ?> <a class="add-new-h2" href="<?php echo admin_url( 'admin-post.php?action=add' ); ?>"><?php _e( 'Add New', 'wpeolog-i18n' ); ?></a></h2> |
@@ -16,8 +19,10 @@ discard block |
||
16 | 19 | elseif ( !empty( $action ) && 'view' == $action ): |
17 | 20 | require_once( wpeo_template_01::get_template_part( WPEO_LOGS_DIR, WPEO_LOGS_TEMPLATES_MAIN_DIR, 'backend', 'view', 'service' ) ); |
18 | 21 | require_once( wpeo_template_01::get_template_part( WPEO_LOGS_DIR, WPEO_LOGS_TEMPLATES_MAIN_DIR, 'backend', 'chart' ) ); |
19 | - else: |
|
22 | + else { |
|
23 | + : |
|
20 | 24 | require_once( wpeo_template_01::get_template_part( WPEO_LOGS_DIR, WPEO_LOGS_TEMPLATES_MAIN_DIR, 'backend', 'list', 'service' ) ); |
25 | + } |
|
21 | 26 | endif; |
22 | 27 | ?> |
23 | 28 | </div> |
@@ -1,65 +1,65 @@ |
||
1 | -<?php if ( !defined( 'ABSPATH' ) ) exit; ?> |
|
1 | +<?php if (!defined('ABSPATH')) exit; ?> |
|
2 | 2 | |
3 | 3 | <div class="tablenav top"> |
4 | 4 | <div class="tablenav-pages"> |
5 | - <span class="displaying-num"><?php echo !empty( $array_service ) ? count( $array_service ) : 0; _e( ' item(s)', 'wpeolog-i18n' ); ?></span> |
|
5 | + <span class="displaying-num"><?php echo !empty($array_service) ? count($array_service) : 0; _e(' item(s)', 'wpeolog-i18n'); ?></span> |
|
6 | 6 | </div> |
7 | 7 | </div> |
8 | 8 | |
9 | 9 | <table class="wp-list-table widefat fixed striped posts"> |
10 | 10 | <thead> |
11 | 11 | <tr> |
12 | - <th scope="col" id="active" class="manage-column"><?php _e( 'Active', 'wpeolog-i18n' ); ?></th> |
|
13 | - <th scope="col" id="title" class="manage-column"><?php _e( 'Title', 'wpeolog-i18n' ); ?></th> |
|
14 | - <th scope="col" id="errors" class="manage-column"><?php _e( 'Errors', 'wpeolog-i18n' ); ?></th> |
|
15 | - <th scope="col" id="warnings" class="manage-column"><?php _e( 'Warnings', 'wpeolog-i18n' ); ?></th> |
|
16 | - <th scope="col" id="size" class="manage-column"><?php _e( 'Size', 'wpeolog-i18n' ); ?></th> |
|
17 | - <th scope="col" id="date" class="manage-column"><?php _e( 'Date', 'wpeolog-i18n' ); ?></th> |
|
12 | + <th scope="col" id="active" class="manage-column"><?php _e('Active', 'wpeolog-i18n'); ?></th> |
|
13 | + <th scope="col" id="title" class="manage-column"><?php _e('Title', 'wpeolog-i18n'); ?></th> |
|
14 | + <th scope="col" id="errors" class="manage-column"><?php _e('Errors', 'wpeolog-i18n'); ?></th> |
|
15 | + <th scope="col" id="warnings" class="manage-column"><?php _e('Warnings', 'wpeolog-i18n'); ?></th> |
|
16 | + <th scope="col" id="size" class="manage-column"><?php _e('Size', 'wpeolog-i18n'); ?></th> |
|
17 | + <th scope="col" id="date" class="manage-column"><?php _e('Date', 'wpeolog-i18n'); ?></th> |
|
18 | 18 | </tr> |
19 | 19 | </thead> |
20 | 20 | <tbody> |
21 | - <?php if ( !empty( $array_service ) ): ?> |
|
22 | - <?php foreach ( $array_service as $key => $service ): ?> |
|
21 | + <?php if (!empty($array_service)): ?> |
|
22 | + <?php foreach ($array_service as $key => $service): ?> |
|
23 | 23 | <tr> |
24 | - <th scope="row"><input disabled type="checkbox" name="service[<?php echo $key; ?>][active]" <?php echo !empty( $service['active'] ) ? 'checked="checked"' : ''; ?> ></th> |
|
24 | + <th scope="row"><input disabled type="checkbox" name="service[<?php echo $key; ?>][active]" <?php echo !empty($service['active']) ? 'checked="checked"' : ''; ?> ></th> |
|
25 | 25 | <td> |
26 | - <a class="view" title="<?php _e( 'View this service', 'wpeolog-i18n' ); ?>" href="<?php echo wp_nonce_url( admin_url( 'tools.php?page=wpeo-log-page&service_id=' . $key . '&action=view&type=info' ), 'view_' . $key ); ?>"><?php echo !empty( $service['name'] ) ? $service['name'] : ''; ?></a> |
|
26 | + <a class="view" title="<?php _e('View this service', 'wpeolog-i18n'); ?>" href="<?php echo wp_nonce_url(admin_url('tools.php?page=wpeo-log-page&service_id=' . $key . '&action=view&type=info'), 'view_' . $key); ?>"><?php echo !empty($service['name']) ? $service['name'] : ''; ?></a> |
|
27 | 27 | <div class="row-actions"> |
28 | - <span class="view"><a class="view" title="<?php _e( 'View this service', 'wpeolog-i18n' ); ?>" href="<?php echo admin_url( 'tools.php?page=wpeo-log-page&service_id=' . $key . '&action=view&type=info' ); ?>"><?php _e( 'View', 'wpeolog-i18n' ); ?></a> </span> |
|
29 | - <span class="trash"><a class="submitdelete" title="<?php _e( 'Move this service to the Trash', 'wpeolog-i18n' ); ?>" href="<?php echo wp_nonce_url( admin_url( 'admin-post.php?service_id=' . $key . '&action=to_trash' ), 'to_trash_' . $key ); ?>"><?php _e( 'Trash', 'wpeolog-i18n' ); ?></a> </span> |
|
28 | + <span class="view"><a class="view" title="<?php _e('View this service', 'wpeolog-i18n'); ?>" href="<?php echo admin_url('tools.php?page=wpeo-log-page&service_id=' . $key . '&action=view&type=info'); ?>"><?php _e('View', 'wpeolog-i18n'); ?></a> </span> |
|
29 | + <span class="trash"><a class="submitdelete" title="<?php _e('Move this service to the Trash', 'wpeolog-i18n'); ?>" href="<?php echo wp_nonce_url(admin_url('admin-post.php?service_id=' . $key . '&action=to_trash'), 'to_trash_' . $key); ?>"><?php _e('Trash', 'wpeolog-i18n'); ?></a> </span> |
|
30 | 30 | </div> |
31 | 31 | </td> |
32 | - <td><a href="<?php echo admin_url( 'tools.php?page=wpeo-log-page&service_id=' . $key . '&action=view&type=error' ); ?>"><?php echo $service['error']['count']; ?></a></td> |
|
33 | - <td><a href="<?php echo admin_url( 'tools.php?page=wpeo-log-page&service_id=' . $key . '&action=view&type=warning' ); ?>"><?php echo $service['warning']['count']; ?></a></td> |
|
32 | + <td><a href="<?php echo admin_url('tools.php?page=wpeo-log-page&service_id=' . $key . '&action=view&type=error'); ?>"><?php echo $service['error']['count']; ?></a></td> |
|
33 | + <td><a href="<?php echo admin_url('tools.php?page=wpeo-log-page&service_id=' . $key . '&action=view&type=warning'); ?>"><?php echo $service['warning']['count']; ?></a></td> |
|
34 | 34 | <td> |
35 | 35 | <?php |
36 | - echo !empty( $service['size'] ) ? $this->convert_to( $service['size'], $service['format'] , false ) : ''; |
|
37 | - echo !empty( $service['format'] ) ? $service['format'] : 'oc' |
|
36 | + echo !empty($service['size']) ? $this->convert_to($service['size'], $service['format'], false) : ''; |
|
37 | + echo !empty($service['format']) ? $service['format'] : 'oc' |
|
38 | 38 | ?> |
39 | 39 | </td> |
40 | - <td><?php echo mysql2date( get_option( 'date_format' ) . ' ' . get_option( 'time_format' ), $service['created_date'], true ); ?></td> |
|
40 | + <td><?php echo mysql2date(get_option('date_format') . ' ' . get_option('time_format'), $service['created_date'], true); ?></td> |
|
41 | 41 | </tr> |
42 | 42 | <?php endforeach; ?> |
43 | 43 | <?php else: ?> |
44 | 44 | <tr> |
45 | - <td><?php _e( 'No services found.', 'wpeolog-i18n' ); ?></td> |
|
45 | + <td><?php _e('No services found.', 'wpeolog-i18n'); ?></td> |
|
46 | 46 | </tr> |
47 | 47 | <?php endif; ?> |
48 | 48 | </tbody> |
49 | 49 | <tfoot> |
50 | 50 | <tr> |
51 | - <th scope="col" id="id" class="manage-column"><?php _e( 'Active', 'wpeolog-i18n' ); ?></th> |
|
52 | - <th scope="col" id="active" class="manage-column"><?php _e( 'Title', 'wpeolog-i18n' ); ?></th> |
|
53 | - <th scope="col" id="size" class="manage-column"><?php _e( 'Errors', 'wpeolog-i18n' ); ?></th> |
|
54 | - <th scope="col" id="size-format" class="manage-column"><?php _e( 'Warnings', 'wpeolog-i18n' ); ?></th> |
|
55 | - <th scope="col" id="number-file" class="manage-column"><?php _e( 'Size', 'wpeolog-i18n' ); ?></th> |
|
56 | - <th scope="col" id="number-file" class="manage-column"><?php _e( 'Date', 'wpeolog-i18n' ); ?></th> |
|
51 | + <th scope="col" id="id" class="manage-column"><?php _e('Active', 'wpeolog-i18n'); ?></th> |
|
52 | + <th scope="col" id="active" class="manage-column"><?php _e('Title', 'wpeolog-i18n'); ?></th> |
|
53 | + <th scope="col" id="size" class="manage-column"><?php _e('Errors', 'wpeolog-i18n'); ?></th> |
|
54 | + <th scope="col" id="size-format" class="manage-column"><?php _e('Warnings', 'wpeolog-i18n'); ?></th> |
|
55 | + <th scope="col" id="number-file" class="manage-column"><?php _e('Size', 'wpeolog-i18n'); ?></th> |
|
56 | + <th scope="col" id="number-file" class="manage-column"><?php _e('Date', 'wpeolog-i18n'); ?></th> |
|
57 | 57 | </tr> |
58 | 58 | </tfoot> |
59 | 59 | </table> |
60 | 60 | |
61 | 61 | <div class="tablenav bottom"> |
62 | 62 | <div class="alignleft actions bulkactions"> |
63 | - <a href="<?php echo admin_url( 'tools.php?page=wpeo-log-page&action=edit' ); ?>" class="button button-primary"><?php _e( 'Quick edit', 'wpeolog-i18n'); ?></a> |
|
63 | + <a href="<?php echo admin_url('tools.php?page=wpeo-log-page&action=edit'); ?>" class="button button-primary"><?php _e('Quick edit', 'wpeolog-i18n'); ?></a> |
|
64 | 64 | </div> |
65 | 65 | </div> |
66 | 66 | \ No newline at end of file |
@@ -1,4 +1,7 @@ discard block |
||
1 | -<?php if ( !defined( 'ABSPATH' ) ) exit; ?> |
|
1 | +<?php if ( !defined( 'ABSPATH' ) ) { |
|
2 | + exit; |
|
3 | +} |
|
4 | +?> |
|
2 | 5 | |
3 | 6 | <div class="tablenav top"> |
4 | 7 | <div class="tablenav-pages"> |
@@ -40,9 +43,12 @@ discard block |
||
40 | 43 | <td><?php echo mysql2date( get_option( 'date_format' ) . ' ' . get_option( 'time_format' ), $service['created_date'], true ); ?></td> |
41 | 44 | </tr> |
42 | 45 | <?php endforeach; ?> |
43 | - <?php else: ?> |
|
46 | + <?php else { |
|
47 | + : ?> |
|
44 | 48 | <tr> |
45 | - <td><?php _e( 'No services found.', 'wpeolog-i18n' ); ?></td> |
|
49 | + <td><?php _e( 'No services found.', 'wpeolog-i18n' ); |
|
50 | +} |
|
51 | +?></td> |
|
46 | 52 | </tr> |
47 | 53 | <?php endif; ?> |
48 | 54 | </tbody> |
@@ -1,56 +1,56 @@ discard block |
||
1 | -<?php if ( !defined( 'ABSPATH' ) ) exit; |
|
2 | -$service_id = (int) $_GET['service_id']; |
|
3 | -$sanitize_type = sanitize_text_field( $_GET['type'] ); |
|
4 | -$sanitize_key = (int) $_GET['key']; |
|
1 | +<?php if (!defined('ABSPATH')) exit; |
|
2 | +$service_id = (int)$_GET['service_id']; |
|
3 | +$sanitize_type = sanitize_text_field($_GET['type']); |
|
4 | +$sanitize_key = (int)$_GET['key']; |
|
5 | 5 | |
6 | 6 | ?> |
7 | 7 | |
8 | 8 | <div class="tablenav bottom"> |
9 | 9 | <div class="alignleft actions bulkactions"> |
10 | - <a href="<?php echo admin_url( 'tools.php?page=wpeo-log-page' ); ?>" class="button"><?php _e( 'Back', 'wpeolog-i18n'); ?></a> |
|
10 | + <a href="<?php echo admin_url('tools.php?page=wpeo-log-page'); ?>" class="button"><?php _e('Back', 'wpeolog-i18n'); ?></a> |
|
11 | 11 | </div> |
12 | 12 | </div> |
13 | 13 | |
14 | -<h3><?php _e( 'Archive', 'wpeolog-i18n' ); ?></h3> |
|
14 | +<h3><?php _e('Archive', 'wpeolog-i18n'); ?></h3> |
|
15 | 15 | <table class="wp-list-table widefat fixed striped posts"> |
16 | 16 | <thead> |
17 | 17 | <tr> |
18 | - <th scope="col" id="active" class="manage-column"><?php _e( 'Title', 'wpeolog-i18n' ); ?></th> |
|
19 | - <th scope="col" id="title" class="manage-column"><?php _e( 'Size', 'wpeolog-i18n' ); ?></th> |
|
18 | + <th scope="col" id="active" class="manage-column"><?php _e('Title', 'wpeolog-i18n'); ?></th> |
|
19 | + <th scope="col" id="title" class="manage-column"><?php _e('Size', 'wpeolog-i18n'); ?></th> |
|
20 | 20 | </tr> |
21 | 21 | </thead> |
22 | 22 | <tbody> |
23 | - <?php if ( !empty( $list_archive_file ) ): ?> |
|
24 | - <?php foreach ( $list_archive_file as $key => $archive_file ): ?> |
|
23 | + <?php if (!empty($list_archive_file)): ?> |
|
24 | + <?php foreach ($list_archive_file as $key => $archive_file): ?> |
|
25 | 25 | <tr> |
26 | 26 | <td> |
27 | - <?php if ( isset( $sanitize_key ) && $sanitize_key == $key ): ?> |
|
28 | - <?php echo substr( $archive_file, 0, -4 ); ?> |
|
27 | + <?php if (isset($sanitize_key) && $sanitize_key == $key): ?> |
|
28 | + <?php echo substr($archive_file, 0, -4); ?> |
|
29 | 29 | <?php else: ?> |
30 | - <a href="<?php echo admin_url( 'tools.php?page=wpeo-log-page&service_id=' . $service_id . '&action=view&type=' .$sanitize_type . '&key=' . $key ); ?>"><?php echo substr( $archive_file, 0, -4 ); ?></a> |
|
30 | + <a href="<?php echo admin_url('tools.php?page=wpeo-log-page&service_id=' . $service_id . '&action=view&type=' . $sanitize_type . '&key=' . $key); ?>"><?php echo substr($archive_file, 0, -4); ?></a> |
|
31 | 31 | <?php endif; ?> |
32 | 32 | <div class="row-actions"> |
33 | - <span class="trash"><a class="submitdelete" title="<?php _e( 'Move this item to the Trash', 'wpeolog-i18n' ); ?>" href="<?php echo wp_nonce_url( admin_url( 'admin-post.php?file_name=' . $archive_file . '&action=file_to_trash' ), 'to_trash_' . $key ); ?>"><?php _e( 'Trash', 'wpeolog-i18n' ); ?></a> </span> |
|
33 | + <span class="trash"><a class="submitdelete" title="<?php _e('Move this item to the Trash', 'wpeolog-i18n'); ?>" href="<?php echo wp_nonce_url(admin_url('admin-post.php?file_name=' . $archive_file . '&action=file_to_trash'), 'to_trash_' . $key); ?>"><?php _e('Trash', 'wpeolog-i18n'); ?></a> </span> |
|
34 | 34 | </div> |
35 | 35 | </td> |
36 | - <td><?php echo filesize( $dir_file . $archive_file ); ?>oc</td> |
|
36 | + <td><?php echo filesize($dir_file . $archive_file); ?>oc</td> |
|
37 | 37 | </tr> |
38 | 38 | <?php endforeach; ?> |
39 | 39 | <?php else: ?> |
40 | - <tr><td><?php _e( 'No archive file', 'wpeolog-i18n' ); ?></td></tr> |
|
40 | + <tr><td><?php _e('No archive file', 'wpeolog-i18n'); ?></td></tr> |
|
41 | 41 | <?php endif; ?> |
42 | 42 | </tbody> |
43 | 43 | <tfoot> |
44 | 44 | <tr> |
45 | - <th scope="col" id="active" class="manage-column"><?php _e( 'Title', 'wpeolog-i18n' ); ?></th> |
|
46 | - <th scope="col" id="size" class="manage-column"><?php _e( 'Size', 'wpeolog-i18n' ); ?></th> |
|
45 | + <th scope="col" id="active" class="manage-column"><?php _e('Title', 'wpeolog-i18n'); ?></th> |
|
46 | + <th scope="col" id="size" class="manage-column"><?php _e('Size', 'wpeolog-i18n'); ?></th> |
|
47 | 47 | </tr> |
48 | 48 | </tfoot> |
49 | 49 | </table> |
50 | 50 | |
51 | 51 | <br /> |
52 | 52 | |
53 | -<h3><?php _e( 'Data', 'wpeolog-i18n' ); ?></h3> |
|
53 | +<h3><?php _e('Data', 'wpeolog-i18n'); ?></h3> |
|
54 | 54 | <table id='wpeo-table-data-csv' class="tablesorter wp-list-table widefat fixed posts"> |
55 | 55 | <thead> |
56 | 56 | <tr> |
@@ -65,20 +65,20 @@ discard block |
||
65 | 65 | </thead> |
66 | 66 | |
67 | 67 | <tbody> |
68 | - <?php if ( !empty( $file ) ): ?> |
|
69 | - <?php foreach ( $file as $key => $value ): |
|
70 | - $user_email = !empty( $value[1] ) ? get_userdata( $value[1] ) : __( 'Empty', 'wpeolog-i18n' ); |
|
71 | - if ( gettype( $user_email ) == 'object' ) { |
|
68 | + <?php if (!empty($file)): ?> |
|
69 | + <?php foreach ($file as $key => $value): |
|
70 | + $user_email = !empty($value[1]) ? get_userdata($value[1]) : __('Empty', 'wpeolog-i18n'); |
|
71 | + if (gettype($user_email) == 'object') { |
|
72 | 72 | $user_email = $user_email->user_email; |
73 | 73 | } |
74 | 74 | |
75 | 75 | ?> |
76 | 76 | <tr> |
77 | - <td><?php echo esc_html( $user_email ); ?></td> |
|
78 | - <td><?php echo !empty( $value[5] ) ? esc_html( $value[5] ) : 0; ?></td> |
|
79 | - <td><?php echo !empty( $value[3] ) ? esc_html( $value[3] ) : __( 'Empty', 'wpeolog-i18n' ); ?></td> |
|
80 | - <td><?php echo !(empty($value[4])) ? trim(esc_html( $value[4] ), "\"" ) : __('Empty', 'wpeolog-i18n'); ?></td> |
|
81 | - <td><?php echo !(empty($value[0])) ? mysql2date( get_option( 'date_format' ) . ' ' . get_option( 'time_format' ), esc_html( $value[0] ), true ) : __('Empty', 'wpeolog-i18n'); ?></td> |
|
77 | + <td><?php echo esc_html($user_email); ?></td> |
|
78 | + <td><?php echo !empty($value[5]) ? esc_html($value[5]) : 0; ?></td> |
|
79 | + <td><?php echo !empty($value[3]) ? esc_html($value[3]) : __('Empty', 'wpeolog-i18n'); ?></td> |
|
80 | + <td><?php echo !(empty($value[4])) ? trim(esc_html($value[4]), "\"") : __('Empty', 'wpeolog-i18n'); ?></td> |
|
81 | + <td><?php echo !(empty($value[0])) ? mysql2date(get_option('date_format') . ' ' . get_option('time_format'), esc_html($value[0]), true) : __('Empty', 'wpeolog-i18n'); ?></td> |
|
82 | 82 | </tr> |
83 | 83 | <?php endforeach; ?> |
84 | 84 | <?php else: ?> |
@@ -1,4 +1,6 @@ discard block |
||
1 | -<?php if ( !defined( 'ABSPATH' ) ) exit; |
|
1 | +<?php if ( !defined( 'ABSPATH' ) ) { |
|
2 | + exit; |
|
3 | +} |
|
2 | 4 | $service_id = (int) $_GET['service_id']; |
3 | 5 | $sanitize_type = sanitize_text_field( $_GET['type'] ); |
4 | 6 | $sanitize_key = (int) $_GET['key']; |
@@ -26,8 +28,11 @@ discard block |
||
26 | 28 | <td> |
27 | 29 | <?php if ( isset( $sanitize_key ) && $sanitize_key == $key ): ?> |
28 | 30 | <?php echo substr( $archive_file, 0, -4 ); ?> |
29 | - <?php else: ?> |
|
30 | - <a href="<?php echo admin_url( 'tools.php?page=wpeo-log-page&service_id=' . $service_id . '&action=view&type=' .$sanitize_type . '&key=' . $key ); ?>"><?php echo substr( $archive_file, 0, -4 ); ?></a> |
|
31 | + <?php else { |
|
32 | + : ?> |
|
33 | + <a href="<?php echo admin_url( 'tools.php?page=wpeo-log-page&service_id=' . $service_id . '&action=view&type=' .$sanitize_type . '&key=' . $key ); |
|
34 | +} |
|
35 | +?>"><?php echo substr( $archive_file, 0, -4 ); ?></a> |
|
31 | 36 | <?php endif; ?> |
32 | 37 | <div class="row-actions"> |
33 | 38 | <span class="trash"><a class="submitdelete" title="<?php _e( 'Move this item to the Trash', 'wpeolog-i18n' ); ?>" href="<?php echo wp_nonce_url( admin_url( 'admin-post.php?file_name=' . $archive_file . '&action=file_to_trash' ), 'to_trash_' . $key ); ?>"><?php _e( 'Trash', 'wpeolog-i18n' ); ?></a> </span> |
@@ -36,8 +41,11 @@ discard block |
||
36 | 41 | <td><?php echo filesize( $dir_file . $archive_file ); ?>oc</td> |
37 | 42 | </tr> |
38 | 43 | <?php endforeach; ?> |
39 | - <?php else: ?> |
|
40 | - <tr><td><?php _e( 'No archive file', 'wpeolog-i18n' ); ?></td></tr> |
|
44 | + <?php else { |
|
45 | + : ?> |
|
46 | + <tr><td><?php _e( 'No archive file', 'wpeolog-i18n' ); |
|
47 | +} |
|
48 | +?></td></tr> |
|
41 | 49 | <?php endif; ?> |
42 | 50 | </tbody> |
43 | 51 | <tfoot> |
@@ -81,9 +89,12 @@ discard block |
||
81 | 89 | <td><?php echo !(empty($value[0])) ? mysql2date( get_option( 'date_format' ) . ' ' . get_option( 'time_format' ), esc_html( $value[0] ), true ) : __('Empty', 'wpeolog-i18n'); ?></td> |
82 | 90 | </tr> |
83 | 91 | <?php endforeach; ?> |
84 | - <?php else: ?> |
|
92 | + <?php else { |
|
93 | + : ?> |
|
85 | 94 | <tr> |
86 | - <td><?php _e('Nothing to display, select your log of file', 'wpeolog-i18n'); ?></td> |
|
95 | + <td><?php _e('Nothing to display, select your log of file', 'wpeolog-i18n'); |
|
96 | +} |
|
97 | +?></td> |
|
87 | 98 | </tr> |
88 | 99 | <?php endif; ?> |
89 | 100 |
@@ -1,4 +1,4 @@ discard block |
||
1 | -<?php if ( !defined( 'ABSPATH' ) ) exit; |
|
1 | +<?php if (!defined('ABSPATH')) exit; |
|
2 | 2 | /** |
3 | 3 | * wpeo_template_01 file definition for project plugin |
4 | 4 | * |
@@ -13,9 +13,9 @@ discard block |
||
13 | 13 | * @version 1.0 |
14 | 14 | */ |
15 | 15 | |
16 | -if ( ! defined( 'ABSPATH' ) ) exit; |
|
16 | +if (!defined('ABSPATH')) exit; |
|
17 | 17 | |
18 | -if ( !class_exists( 'wpeo_template_01' ) ) { |
|
18 | +if (!class_exists('wpeo_template_01')) { |
|
19 | 19 | class wpeo_template_01 { |
20 | 20 | /** |
21 | 21 | * INTERNAL LIB - Check and get the template file path to use for a given display part |
@@ -28,42 +28,42 @@ discard block |
||
28 | 28 | * @param string $name The name of the specialised template. |
29 | 29 | * @return string The template file path to use |
30 | 30 | */ |
31 | - static function get_template_part( $plugin_dir_name, $main_template_dir, $side, $slug, $name=null, $debug = null ) { |
|
31 | + static function get_template_part($plugin_dir_name, $main_template_dir, $side, $slug, $name = null, $debug = null) { |
|
32 | 32 | $path = ''; |
33 | 33 | |
34 | 34 | $templates = array(); |
35 | 35 | $name = (string)$name; |
36 | - if ( '' !== $name ) |
|
36 | + if ('' !== $name) |
|
37 | 37 | $templates[] = "{$side}/{$slug}-{$name}.php"; |
38 | 38 | $templates[] = "{$side}/{$slug}.php"; |
39 | 39 | |
40 | 40 | /** Check if required template exists into current theme */ |
41 | 41 | $check_theme_template = array(); |
42 | - foreach ( $templates as $template ) { |
|
42 | + foreach ($templates as $template) { |
|
43 | 43 | $check_theme_template = $plugin_dir_name . "/" . $template; |
44 | - $path = locate_template( $check_theme_template, false ); |
|
45 | - if ( !empty( $path ) ) { |
|
44 | + $path = locate_template($check_theme_template, false); |
|
45 | + if (!empty($path)) { |
|
46 | 46 | break; |
47 | 47 | } |
48 | 48 | } |
49 | 49 | |
50 | 50 | /** Allow debugging */ |
51 | - if ( !empty( $debug ) ) { |
|
51 | + if (!empty($debug)) { |
|
52 | 52 | echo '--- Debug mode ON - Start ---<br/>'; |
53 | 53 | echo __FILE__ . '<br/>'; |
54 | 54 | echo 'Debug for display method<br/>'; |
55 | 55 | } |
56 | 56 | |
57 | - if ( empty( $path ) ) { |
|
58 | - foreach ( (array) $templates as $template_name ) { |
|
59 | - if ( !$template_name ) |
|
57 | + if (empty($path)) { |
|
58 | + foreach ((array)$templates as $template_name) { |
|
59 | + if (!$template_name) |
|
60 | 60 | continue; |
61 | 61 | |
62 | - if ( !empty( $debug ) ) { |
|
62 | + if (!empty($debug)) { |
|
63 | 63 | echo __LINE__ . ' - ' . $main_template_dir . $template_name . '<hr/>'; |
64 | 64 | } |
65 | 65 | |
66 | - if ( file_exists( $main_template_dir . $template_name ) ) { |
|
66 | + if (file_exists($main_template_dir . $template_name)) { |
|
67 | 67 | $path = $main_template_dir . $template_name; |
68 | 68 | break; |
69 | 69 | } |
@@ -74,7 +74,7 @@ discard block |
||
74 | 74 | } |
75 | 75 | |
76 | 76 | /** Allow debugging */ |
77 | - if ( !empty( $debug ) ) { |
|
77 | + if (!empty($debug)) { |
|
78 | 78 | echo '--- Debug mode ON - END ---<br/><br/>'; |
79 | 79 | } |
80 | 80 |
@@ -1,4 +1,6 @@ discard block |
||
1 | -<?php if ( !defined( 'ABSPATH' ) ) exit; |
|
1 | +<?php if ( !defined( 'ABSPATH' ) ) { |
|
2 | + exit; |
|
3 | +} |
|
2 | 4 | /** |
3 | 5 | * wpeo_template_01 file definition for project plugin |
4 | 6 | * |
@@ -13,7 +15,9 @@ discard block |
||
13 | 15 | * @version 1.0 |
14 | 16 | */ |
15 | 17 | |
16 | -if ( ! defined( 'ABSPATH' ) ) exit; |
|
18 | +if ( ! defined( 'ABSPATH' ) ) { |
|
19 | + exit; |
|
20 | +} |
|
17 | 21 | |
18 | 22 | if ( !class_exists( 'wpeo_template_01' ) ) { |
19 | 23 | class wpeo_template_01 { |
@@ -33,8 +37,9 @@ discard block |
||
33 | 37 | |
34 | 38 | $templates = array(); |
35 | 39 | $name = (string)$name; |
36 | - if ( '' !== $name ) |
|
37 | - $templates[] = "{$side}/{$slug}-{$name}.php"; |
|
40 | + if ( '' !== $name ) { |
|
41 | + $templates[] = "{$side}/{$slug}-{$name}.php"; |
|
42 | + } |
|
38 | 43 | $templates[] = "{$side}/{$slug}.php"; |
39 | 44 | |
40 | 45 | /** Check if required template exists into current theme */ |
@@ -56,8 +61,9 @@ discard block |
||
56 | 61 | |
57 | 62 | if ( empty( $path ) ) { |
58 | 63 | foreach ( (array) $templates as $template_name ) { |
59 | - if ( !$template_name ) |
|
60 | - continue; |
|
64 | + if ( !$template_name ) { |
|
65 | + continue; |
|
66 | + } |
|
61 | 67 | |
62 | 68 | if ( !empty( $debug ) ) { |
63 | 69 | echo __LINE__ . ' - ' . $main_template_dir . $template_name . '<hr/>'; |
@@ -68,8 +74,7 @@ discard block |
||
68 | 74 | break; |
69 | 75 | } |
70 | 76 | } |
71 | - } |
|
72 | - else { |
|
77 | + } else { |
|
73 | 78 | echo ''; |
74 | 79 | } |
75 | 80 |
@@ -1,27 +1,27 @@ |
||
1 | -<?php if ( !defined( 'ABSPATH' ) ) exit; |
|
1 | +<?php if (!defined('ABSPATH')) exit; |
|
2 | 2 | |
3 | -if ( !class_exists( 'wpeo_util' ) ) { |
|
3 | +if (!class_exists('wpeo_util')) { |
|
4 | 4 | class wpeo_util { |
5 | - public static $array_exclude_module = array( 'wpeo_timeline', 'wpeo_files', 'wpeo_project_data_transfert', 'wpeo_calendar' ); |
|
5 | + public static $array_exclude_module = array('wpeo_timeline', 'wpeo_files', 'wpeo_project_data_transfert', 'wpeo_calendar'); |
|
6 | 6 | |
7 | 7 | /** |
8 | 8 | * CORE - Install all extra-modules in "Core/Module" folder |
9 | 9 | */ |
10 | - public static function install_in( $folder ) { |
|
10 | + public static function install_in($folder) { |
|
11 | 11 | /** Define the directory containing all exrta-modules for current plugin */ |
12 | 12 | $module_folder = WPEOMTM_TASK_PATH . '/' . $folder . '/'; |
13 | 13 | |
14 | 14 | /** Check if the defined directory exists for reading and including the different modules */ |
15 | - if( is_dir( $module_folder ) ) { |
|
16 | - $parent_folder_content = scandir( $module_folder ); |
|
17 | - foreach ( $parent_folder_content as $folder ) { |
|
18 | - if ( $folder && substr( $folder, 0, 1) != '.' && !in_array( $folder, self::$array_exclude_module ) ) { |
|
19 | - if( is_dir ( $module_folder . $folder ) ) |
|
20 | - $child_folder_content = scandir( $module_folder . $folder ); |
|
15 | + if (is_dir($module_folder)) { |
|
16 | + $parent_folder_content = scandir($module_folder); |
|
17 | + foreach ($parent_folder_content as $folder) { |
|
18 | + if ($folder && substr($folder, 0, 1) != '.' && !in_array($folder, self::$array_exclude_module)) { |
|
19 | + if (is_dir($module_folder . $folder)) |
|
20 | + $child_folder_content = scandir($module_folder . $folder); |
|
21 | 21 | |
22 | - if ( file_exists( $module_folder . $folder . '/' . $folder . '.php') ) { |
|
23 | - $f = $module_folder . $folder . '/' . $folder . '.php'; |
|
24 | - include( $f ); |
|
22 | + if (file_exists($module_folder . $folder . '/' . $folder . '.php')) { |
|
23 | + $f = $module_folder . $folder . '/' . $folder . '.php'; |
|
24 | + include($f); |
|
25 | 25 | } |
26 | 26 | } |
27 | 27 | } |
@@ -1,4 +1,6 @@ discard block |
||
1 | -<?php if ( !defined( 'ABSPATH' ) ) exit; |
|
1 | +<?php if ( !defined( 'ABSPATH' ) ) { |
|
2 | + exit; |
|
3 | +} |
|
2 | 4 | |
3 | 5 | if ( !class_exists( 'wpeo_util' ) ) { |
4 | 6 | class wpeo_util { |
@@ -16,8 +18,9 @@ discard block |
||
16 | 18 | $parent_folder_content = scandir( $module_folder ); |
17 | 19 | foreach ( $parent_folder_content as $folder ) { |
18 | 20 | if ( $folder && substr( $folder, 0, 1) != '.' && !in_array( $folder, self::$array_exclude_module ) ) { |
19 | - if( is_dir ( $module_folder . $folder ) ) |
|
20 | - $child_folder_content = scandir( $module_folder . $folder ); |
|
21 | + if( is_dir ( $module_folder . $folder ) ) { |
|
22 | + $child_folder_content = scandir( $module_folder . $folder ); |
|
23 | + } |
|
21 | 24 | |
22 | 25 | if ( file_exists( $module_folder . $folder . '/' . $folder . '.php') ) { |
23 | 26 | $f = $module_folder . $folder . '/' . $folder . '.php'; |
@@ -1,4 +1,4 @@ discard block |
||
1 | -<?php if ( !defined( 'ABSPATH' ) ) exit; |
|
1 | +<?php if (!defined('ABSPATH')) exit; |
|
2 | 2 | /** |
3 | 3 | * Plugin Name: Gestion des modules internes / Internal module management |
4 | 4 | * Description: Permet d'activer ou de désactiver les différents modules internes présents dans le dossier modules / Allow to activate or deactivate internal modules present into modules directory |
@@ -14,32 +14,32 @@ discard block |
||
14 | 14 | */ |
15 | 15 | |
16 | 16 | /* Check if file is include. No direct access possible with file url */ |
17 | -if ( !defined( 'WPSHOP_VERSION' ) ) { |
|
18 | - die( __('Access is not allowed by this way', 'wpshop') ); |
|
17 | +if (!defined('WPSHOP_VERSION')) { |
|
18 | + die(__('Access is not allowed by this way', 'wpshop')); |
|
19 | 19 | } |
20 | 20 | |
21 | -if ( !defined( 'EOMODMAN_VERSION' ) ) { |
|
21 | +if (!defined('EOMODMAN_VERSION')) { |
|
22 | 22 | |
23 | 23 | /** |
24 | 24 | * Define the current version for the plugin. Interresting for clear cache for plugin style and script |
25 | 25 | * @var string Plugin current version number |
26 | 26 | */ |
27 | - DEFINE( 'EOMODMAN_VERSION', '1.0'); |
|
27 | + DEFINE('EOMODMAN_VERSION', '1.0'); |
|
28 | 28 | |
29 | 29 | /** Définition des constantes pour le module / Define constant for module */ |
30 | - DEFINE( 'EOMODMAN_DIR', basename(dirname(__FILE__))); |
|
31 | - DEFINE( 'EOMODMAN_PATH_TO_MODULE', str_replace( str_replace( "\\", "/", WP_PLUGIN_DIR ), "", str_replace( "\\", "/", plugin_dir_path( __FILE__ ) ) ) ); |
|
32 | - DEFINE( 'EOMODMAN_PATH', str_replace( "\\", "/", plugin_dir_path( __FILE__ ) ) ); |
|
33 | - DEFINE( 'EOMODMAN_URL', str_replace( str_replace( "\\", "/", ABSPATH), site_url() . '/', EOMODMAN_PATH ) ); |
|
30 | + DEFINE('EOMODMAN_DIR', basename(dirname(__FILE__))); |
|
31 | + DEFINE('EOMODMAN_PATH_TO_MODULE', str_replace(str_replace("\\", "/", WP_PLUGIN_DIR), "", str_replace("\\", "/", plugin_dir_path(__FILE__)))); |
|
32 | + DEFINE('EOMODMAN_PATH', str_replace("\\", "/", plugin_dir_path(__FILE__))); |
|
33 | + DEFINE('EOMODMAN_URL', str_replace(str_replace("\\", "/", ABSPATH), site_url() . '/', EOMODMAN_PATH)); |
|
34 | 34 | |
35 | 35 | /** Appel des traductions pour le module / Call translation for module */ |
36 | - load_plugin_textdomain( 'eo-modmanager-i18n', false, dirname( plugin_basename( __FILE__ ) ) . '/languages/' ); |
|
36 | + load_plugin_textdomain('eo-modmanager-i18n', false, dirname(plugin_basename(__FILE__)) . '/languages/'); |
|
37 | 37 | |
38 | 38 | /** Définition du chemin absolu vers les templates / Define the templates absolute directories */ |
39 | - DEFINE( 'EOMODMAN_TEMPLATES_MAIN_DIR', EOMODMAN_PATH . '/templates/'); |
|
39 | + DEFINE('EOMODMAN_TEMPLATES_MAIN_DIR', EOMODMAN_PATH . '/templates/'); |
|
40 | 40 | |
41 | - include( EOMODMAN_PATH . '/controller/module_management.ctr.php' ); |
|
42 | - $eo_module_management = new eo_module_management(); |
|
41 | + include(EOMODMAN_PATH . '/controller/module_management.ctr.php'); |
|
42 | + $eo_module_management = new eo_module_management(); |
|
43 | 43 | |
44 | 44 | eo_module_management::core_util(); |
45 | 45 |
@@ -1,4 +1,6 @@ |
||
1 | -<?php if ( !defined( 'ABSPATH' ) ) exit; |
|
1 | +<?php if ( !defined( 'ABSPATH' ) ) { |
|
2 | + exit; |
|
3 | +} |
|
2 | 4 | /** |
3 | 5 | * Fichier de définition du modèle des taxinomies / File for term model definition |
4 | 6 | * |
@@ -1,72 +1,72 @@ |
||
1 | -<?php if ( !defined( 'ABSPATH' ) ) exit; |
|
1 | +<?php if (!defined('ABSPATH')) exit; |
|
2 | 2 | ?> |
3 | 3 | <ul class="module-list" > |
4 | 4 | <li class="module-list-header" > |
5 | 5 | <!-- |
6 | - <span class="module-cb" ><?php _e( 'Activ', 'eo-modmanager-i18n' ); ?></span> |
|
6 | + <span class="module-cb" ><?php _e('Activ', 'eo-modmanager-i18n'); ?></span> |
|
7 | 7 | --> |
8 | - <span class="module-name" ><?php _e( 'Module name', 'eo-modmanager-i18n' ); ?></span> |
|
9 | - <span class="module-name" ><?php _e( 'Module description', 'eo-modmanager-i18n' ); ?></span> |
|
10 | - <span class="module-info" ><?php _e( 'Module info', 'eo-modmanager-i18n' ); ?></span> |
|
8 | + <span class="module-name" ><?php _e('Module name', 'eo-modmanager-i18n'); ?></span> |
|
9 | + <span class="module-name" ><?php _e('Module description', 'eo-modmanager-i18n'); ?></span> |
|
10 | + <span class="module-info" ><?php _e('Module info', 'eo-modmanager-i18n'); ?></span> |
|
11 | 11 | </li> |
12 | 12 | |
13 | 13 | <?php $i = 0; ?> |
14 | -<?php foreach ( $parent_folder_content as $folder ) : ?> |
|
15 | - <?php if ( $folder && ( substr( $folder, 0, 1) != '.' ) && file_exists( $module_folder . $folder . '/' . $folder . '.php') ) : ?> |
|
14 | +<?php foreach ($parent_folder_content as $folder) : ?> |
|
15 | + <?php if ($folder && (substr($folder, 0, 1) != '.') && file_exists($module_folder . $folder . '/' . $folder . '.php')) : ?> |
|
16 | 16 | <?php |
17 | 17 | $is_activ = false; |
18 | - if ( !empty( $module_option ) && ( array_key_exists( $folder, $module_option ) && ( 'on' == $module_option[ $folder ][ 'activated' ] ) ) ) { |
|
18 | + if (!empty($module_option) && (array_key_exists($folder, $module_option) && ('on' == $module_option[$folder]['activated']))) { |
|
19 | 19 | $is_activ = true; |
20 | 20 | } |
21 | - $module_datas = get_plugin_data( $module_folder . $folder . '/' . $folder . '.php' ); |
|
21 | + $module_datas = get_plugin_data($module_folder . $folder . '/' . $folder . '.php'); |
|
22 | 22 | |
23 | 23 | $module_id = 'module' . $folder; |
24 | 24 | ?> |
25 | - <li class="<?php echo ( $i == 0 ? "odd" : "even" ); ?>" > |
|
25 | + <li class="<?php echo ($i == 0 ? "odd" : "even"); ?>" > |
|
26 | 26 | <!-- |
27 | 27 | <span class="module-cb module-cb-<?php echo $folder; ?>" > |
28 | 28 | <input type="hidden" name="wpshop_modules[<?php echo $folder; ?>][old_activated]" value="<?php echo $is_activ ? 'on' : 'off'; ?>" /> |
29 | - <input id="<?php echo $module_id; ?>" type="checkbox" name="wpshop_modules[<?php echo $folder; ?>][activated]" value="on" <?php checked( true, $is_activ, true); ?> /> |
|
29 | + <input id="<?php echo $module_id; ?>" type="checkbox" name="wpshop_modules[<?php echo $folder; ?>][activated]" value="on" <?php checked(true, $is_activ, true); ?> /> |
|
30 | 30 | </span> |
31 | 31 | --> |
32 | 32 | <span class="module-name module-name-<?php echo $folder; ?>" > |
33 | - <label for="<?php echo $module_id; ?>" ><?php echo !empty( $module_datas ) && !empty( $module_datas[ 'Name' ] ) ? $module_datas[ 'Name' ] : $folder; ?></label> |
|
33 | + <label for="<?php echo $module_id; ?>" ><?php echo !empty($module_datas) && !empty($module_datas['Name']) ? $module_datas['Name'] : $folder; ?></label> |
|
34 | 34 | </span> |
35 | 35 | <span class="module-description" > |
36 | - <?php echo !empty( $module_datas ) && !empty( $module_datas[ 'Description' ] ) ? $module_datas[ 'Description' ] : ''; ?><br/> |
|
36 | + <?php echo !empty($module_datas) && !empty($module_datas['Description']) ? $module_datas['Description'] : ''; ?><br/> |
|
37 | 37 | |
38 | - <?php echo !empty( $module_datas ) && !empty( $module_datas[ 'Version' ] ) ? $module_datas[ 'Version' ] : __( 'Unknown version', 'eo-modmanager-i18n' ); ?> | |
|
39 | - <?php echo !empty( $module_datas ) && !empty( $module_datas[ 'Author' ] ) ? $module_datas[ 'Author' ] : __( 'Unknown author', 'eo-modmanager-i18n' ); ?> |
|
40 | - <?php if ( !empty( $module_datas ) && !empty( $module_datas[ 'PluginURI' ] ) ) : ?> | |
|
41 | - <?php echo $module_datas[ 'Title' ]; ?> |
|
38 | + <?php echo !empty($module_datas) && !empty($module_datas['Version']) ? $module_datas['Version'] : __('Unknown version', 'eo-modmanager-i18n'); ?> | |
|
39 | + <?php echo !empty($module_datas) && !empty($module_datas['Author']) ? $module_datas['Author'] : __('Unknown author', 'eo-modmanager-i18n'); ?> |
|
40 | + <?php if (!empty($module_datas) && !empty($module_datas['PluginURI'])) : ?> | |
|
41 | + <?php echo $module_datas['Title']; ?> |
|
42 | 42 | <?php endif; ?> |
43 | 43 | </span> |
44 | 44 | <span class="module-info module-info-<?php echo $folder; ?>" > |
45 | 45 | <?php |
46 | - if ( 'auto' != $module_option[ $folder ][ 'author_on' ] ) : |
|
47 | - $user = get_userdata( $module_option[ $folder ][ 'author_on' ] ); |
|
46 | + if ('auto' != $module_option[$folder]['author_on']) : |
|
47 | + $user = get_userdata($module_option[$folder]['author_on']); |
|
48 | 48 | $author = $user->display_name; |
49 | 49 | else : |
50 | - $author = __( 'automatic activation', 'eo-modmanager-i18n' ); |
|
50 | + $author = __('automatic activation', 'eo-modmanager-i18n'); |
|
51 | 51 | endif; |
52 | - printf( __( 'Last activation made on %1$s by %2$s', 'eo-modmanager-i18n' ), mysql2date( get_option( 'date_format' ) . ' ' . get_option( 'time_format' ), $module_option[ $folder ][ 'date_on' ], true ), $author); |
|
52 | + printf(__('Last activation made on %1$s by %2$s', 'eo-modmanager-i18n'), mysql2date(get_option('date_format') . ' ' . get_option('time_format'), $module_option[$folder]['date_on'], true), $author); |
|
53 | 53 | ?> |
54 | - <?php if ( !empty( $module_option[ $folder ][ 'date_off' ] ) ) : ?> |
|
54 | + <?php if (!empty($module_option[$folder]['date_off'])) : ?> |
|
55 | 55 | <br/> |
56 | 56 | <?php |
57 | - $user = get_userdata( $module_option[ $folder ][ 'author_off' ] ); |
|
57 | + $user = get_userdata($module_option[$folder]['author_off']); |
|
58 | 58 | $author = $user->display_name; |
59 | - printf( __( 'Last deactivation made on %1$s by %2$s', 'eo-modmanager-i18n' ), mysql2date( get_option( 'date_format' ) . ' ' . get_option( 'time_format' ), $module_option[ $folder ][ 'date_off' ], true ), $author); |
|
59 | + printf(__('Last deactivation made on %1$s by %2$s', 'eo-modmanager-i18n'), mysql2date(get_option('date_format') . ' ' . get_option('time_format'), $module_option[$folder]['date_off'], true), $author); |
|
60 | 60 | ?> |
61 | 61 | <?php endif; ?> |
62 | 62 | |
63 | - <?php apply_filters( 'wps-addon-extra-info', $folder ); ?> |
|
63 | + <?php apply_filters('wps-addon-extra-info', $folder); ?> |
|
64 | 64 | </span> |
65 | 65 | </li> |
66 | 66 | <?php endif; ?> |
67 | 67 | <?php |
68 | 68 | $i++; |
69 | - if ( $i > 1 ) : |
|
69 | + if ($i > 1) : |
|
70 | 70 | $i = 0; |
71 | 71 | endif; |
72 | 72 | ?> |
@@ -1,4 +1,6 @@ discard block |
||
1 | -<?php if ( !defined( 'ABSPATH' ) ) exit; |
|
1 | +<?php if ( !defined( 'ABSPATH' ) ) { |
|
2 | + exit; |
|
3 | +} |
|
2 | 4 | ?> |
3 | 5 | <ul class="module-list" > |
4 | 6 | <li class="module-list-header" > |
@@ -46,8 +48,10 @@ discard block |
||
46 | 48 | if ( 'auto' != $module_option[ $folder ][ 'author_on' ] ) : |
47 | 49 | $user = get_userdata( $module_option[ $folder ][ 'author_on' ] ); |
48 | 50 | $author = $user->display_name; |
49 | - else : |
|
51 | + else { |
|
52 | + : |
|
50 | 53 | $author = __( 'automatic activation', 'eo-modmanager-i18n' ); |
54 | + } |
|
51 | 55 | endif; |
52 | 56 | printf( __( 'Last activation made on %1$s by %2$s', 'eo-modmanager-i18n' ), mysql2date( get_option( 'date_format' ) . ' ' . get_option( 'time_format' ), $module_option[ $folder ][ 'date_on' ], true ), $author); |
53 | 57 | ?> |