| @@ -8,8 +8,13 @@ | ||
| 8 | 8 | */ |
| 9 | 9 | |
| 10 | 10 | namespace MainWP\Dashboard; |
| 11 | 11 | |
| 12 | +// Exit if accessed directly. | |
| 13 | +if ( ! defined( 'ABSPATH' ) ) { | |
| 14 | + exit; | |
| 15 | +} | |
| 16 | + | |
| 12 | 17 | /** |
| 13 | 18 | * Class MainWP_Recent_Posts |
| 14 | 19 | * |
| 15 | 20 | * Displays the Child Sites most recent published draft, pending, trash & future posts. |
| @@ -89,14 +94,23 @@ | ||
| 89 | 94 | } |
| 90 | 95 | } else { |
| 91 | 96 | if ( $current_wpid ) { |
| 92 | 97 | $sql = MainWP_DB::instance()->get_sql_website_by_id( $current_wpid ); |
| 98 | + $websites = MainWP_DB::instance()->query( $sql ); | |
| 93 | 99 | $individual = true; |
| 94 | 100 | } else { |
| 95 | - $sql = MainWP_DB::instance()->get_sql_websites_for_current_user(); | |
| 96 | - $individual = false; | |
| 101 | + $wpsite_fields = array( 'id', 'name', 'url' ); | |
| 102 | + $websites = MainWP_DB::instance()->query( | |
| 103 | + MainWP_DB::instance()->get_sql_websites_for_current_user_by_params( | |
| 104 | + array( | |
| 105 | + 'view' => 'custom_view', | |
| 106 | + 'others_fields' => array( 'recent_posts' ), | |
| 107 | + 'select_wp_fields' => $wpsite_fields, | |
| 108 | + ) | |
| 109 | + ) | |
| 110 | + ); | |
| 111 | + $individual = false; | |
| 97 | 112 | } |
| 98 | - $websites = MainWP_DB::instance()->query( $sql ); | |
| 99 | 113 | |
| 100 | 114 | if ( $websites ) { |
| 101 | 115 | while ( $websites && ( $website = MainWP_DB::fetch_object( $websites ) ) ) { |
| 102 | 116 | if ( empty( $website->recent_posts ) ) { |
| @@ -151,13 +165,13 @@ | ||
| 151 | 165 | do_action( 'mainwp_recent_posts_after_lists' ); |
| 152 | 166 | ?> |
| 153 | 167 | |
| 154 | 168 | <div class="ui stackable grid mainwp-widget-footer"> |
| 155 | - <div class="eight wide column"> | |
| 156 | - <a href="<?php echo esc_url( admin_url( 'admin.php?page=PostBulkManage' ) ); ?>" title="" class="ui button fluid mini green basic"><?php esc_html_e( 'Manage Posts', 'mainwp' ); ?></a> | |
| 169 | + <div class="eight wide left aligned middle aligned column"> | |
| 170 | + <a href="<?php echo esc_url( admin_url( 'admin.php?page=PostBulkAdd' ) ); ?>" class="ui mini basic button"><?php esc_html_e( 'Create a New Post', 'mainwp' ); ?></a> | |
| 157 | 171 | </div> |
| 158 | - <div class="eight wide column right aligned"> | |
| 159 | - <a href="<?php echo esc_url( admin_url( 'admin.php?page=PostBulkAdd' ) ); ?>" title="" class="ui button fluid mini green"><?php esc_html_e( 'New Post', 'mainwp' ); ?></a> | |
| 172 | + <div class="eight wide right aligned middle aligned column"> | |
| 173 | + <a href="<?php echo esc_url( admin_url( 'admin.php?page=PostBulkManage' ) ); ?>" class="ui mini basic button"><?php esc_html_e( 'Manage Posts', 'mainwp' ); ?></a> | |
| 160 | 174 | </div> |
| 161 | 175 | </div> |
| 162 | 176 | <?php |
| 163 | 177 | /** |
| @@ -176,9 +190,9 @@ | ||
| 176 | 190 | public static function render_top_grid() { |
| 177 | 191 | ?> |
| 178 | 192 | <div class="ui grid mainwp-widget-header"> |
| 179 | 193 | <div class="twelve wide column"> |
| 180 | - <h3 class="ui header handle-drag"> | |
| 194 | + <h2 class="ui header handle-drag"> | |
| 181 | 195 | <?php |
| 182 | 196 | /** |
| 183 | 197 | * Filter: mainwp_recent_posts_widget_title |
| 184 | 198 | * |
| @@ -192,21 +206,20 @@ | ||
| 192 | 206 | <div class="sub header"><?php esc_html_e( 'The most recent posts from the Client websites', 'mainwp' ); ?></div> |
| 193 | 207 | <?php else : ?> |
| 194 | 208 | <div class="sub header"><?php esc_html_e( 'The most recent posts from your websites', 'mainwp' ); ?></div> |
| 195 | 209 | <?php endif; ?> |
| 196 | - </h3> | |
| 210 | + </h2> | |
| 197 | 211 | </div> |
| 198 | 212 | <div class="four wide column right aligned"> |
| 199 | - <div class="ui dropdown right pointing mainwp-dropdown-tab"> | |
| 200 | - <div class="text"><?php esc_html_e( 'Published', 'mainwp' ); ?></div> | |
| 201 | - <i class="dropdown icon"></i> | |
| 202 | - <div class="menu"> | |
| 213 | + <div class="ui dropdown right tiny pointing mainwp-dropdown-tab"> | |
| 214 | + <i class="vertical ellipsis icon"></i> | |
| 215 | + <div class="menu"> | |
| 203 | 216 | <a class="item recent_posts_published_lnk" data-tab="published" data-value="published" title="<?php esc_attr_e( 'Published', 'mainwp' ); ?>" href="#"><?php esc_html_e( 'Published', 'mainwp' ); ?></a> |
| 204 | 217 | <a class="item recent_posts_draft_lnk" data-tab="draft" data-value="draft" title="<?php esc_attr_e( 'Draft', 'mainwp' ); ?>" href="#"><?php esc_html_e( 'Draft', 'mainwp' ); ?></a> |
| 205 | 218 | <a class="item recent_posts_pending_lnk" data-tab="pending" data-value="pending" title="<?php esc_attr_e( 'Pending', 'mainwp' ); ?>" href="#"><?php esc_html_e( 'Pending', 'mainwp' ); ?></a> |
| 206 | 219 | <a class="item recent_posts_future_lnk" data-tab="future" data-value="future" title="<?php esc_attr_e( 'Scheduled', 'mainwp' ); ?>" href="#"><?php esc_html_e( 'Scheduled', 'mainwp' ); ?></a> |
| 207 | 220 | <a class="item recent_posts_trash_lnk" data-tab="trash" data-value="trash" title="<?php esc_attr_e( 'Trash', 'mainwp' ); ?>" href="#"><?php esc_html_e( 'Trash', 'mainwp' ); ?></a> |
| 208 | - </div> | |
| 221 | + </div> | |
| 209 | 222 | </div> |
| 210 | 223 | </div> |
| 211 | 224 | </div> |
| 212 | 225 | <?php |
| @@ -216,9 +229,9 @@ | ||
| 216 | 229 | * Render Published Posts. |
| 217 | 230 | * |
| 218 | 231 | * @param array $allPosts All posts data. |
| 219 | 232 | * @param int $recent_number Number of posts. |
| 220 | - * @param bool $individual Determins if it's individual site dashbaord. | |
| 233 | + * @param bool $individual Determins if it's individual site dashboard. | |
| 221 | 234 | * |
| 222 | 235 | * @uses \MainWP\Dashboard\MainWP_Utility::get_sub_array_having() |
| 223 | 236 | * @uses \MainWP\Dashboard\MainWP_Utility::sortmulti() |
| 224 | 237 | * @uses \MainWP\Dashboard\MainWP_Utility::format_timestamp() |
| @@ -242,12 +255,12 @@ | ||
| 242 | 255 | * @since 4.1 |
| 243 | 256 | */ |
| 244 | 257 | do_action( 'mainwp_recent_posts_before_publised_list', $allPosts, $recent_number ); |
| 245 | 258 | if ( empty( $recent_posts_published ) ) { |
| 246 | - MainWP_UI::render_empty_element_placeholder(); | |
| 259 | + MainWP_UI::render_empty_element_placeholder( __( 'No Recent Posts Found', 'mainwp' ), __( 'Recent post changes will appear here once activity is detected.', 'mainwp' ), '<em data-emoji=":pencil:" class="medium"></em>' ); | |
| 247 | 260 | } |
| 248 | 261 | ?> |
| 249 | - <div class="ui middle aligned divided selection list"> | |
| 262 | + <div class="ui middle aligned divided list"> | |
| 250 | 263 | <?php |
| 251 | 264 | $_count = count( $recent_posts_published ); |
| 252 | 265 | for ( $i = 0; $i < $_count && $i < $recent_number; $i++ ) { |
| 253 | 266 | if ( ! isset( $recent_posts_published[ $i ]['title'] ) || empty( $recent_posts_published[ $i ]['title'] ) ) { |
| @@ -260,9 +273,9 @@ | ||
| 260 | 273 | $name = wp_strip_all_tags( $recent_posts_published[ $i ]['website']->name ); |
| 261 | 274 | |
| 262 | 275 | ?> |
| 263 | 276 | <div class="item"> |
| 264 | - <div class="ui stackable grid"> | |
| 277 | + <div class="ui grid"> | |
| 265 | 278 | <input class="postId" type="hidden" name="id" value="<?php echo esc_attr( $recent_posts_published[ $i ]['id'] ); ?>"/> |
| 266 | 279 | <input class="websiteId" type="hidden" name="id" value="<?php echo esc_attr( $recent_posts_published[ $i ]['website']->id ); ?>"/> |
| 267 | 280 | <div class="fourteen wide column middle aligned"> |
| 268 | 281 | <div> |
| @@ -273,13 +286,13 @@ | ||
| 273 | 286 | </div> |
| 274 | 287 | <span class="ui small text"><?php echo esc_html( $recent_posts_published[ $i ]['dts'] ); ?></span> |
| 275 | 288 | </div> |
| 276 | 289 | <div class="two wide column right aligned"> |
| 277 | - <div class="ui right pointing dropdown icon mini basic green button" style="z-index:999"> | |
| 278 | - <i class="ellipsis horizontal icon"></i> | |
| 290 | + <div class="ui right pointing dropdown" style="z-index:999"> | |
| 291 | + <i class="ellipsis vertical icon"></i> | |
| 279 | 292 | <div class="menu"> |
| 280 | 293 | <a class="<?php echo $is_demo ? 'disabled' : ''; ?> item mainwp-post-unpublish" href="#"><?php esc_html_e( 'Unpublish', 'mainwp' ); ?></a> |
| 281 | - <a class="<?php echo $is_demo ? 'disabled' : ''; ?> item" href="admin.php?page=SiteOpen&newWindow=yes&websiteid=<?php echo intval( $recent_posts_published[ $i ]['website']->id ); ?>&location=<?php echo esc_attr( base64_encode( 'post.php?action=editpost&post=' . $recent_posts_published[ $i ]['id'] . '&action=edit' ) ); // phpcs:ignore WordPress.PHP.DiscouragedPHPFunctions -- base64_encode used for http encoding compatible. ?>&_opennonce=<?php echo esc_html( wp_create_nonce( 'mainwp-admin-nonce' ) ); ?>" target="_blank"><?php esc_html_e( 'Edit', 'mainwp' ); ?></a> | |
| 294 | + <a class="<?php echo $is_demo ? 'disabled' : ''; ?> item" href="<?php MainWP_Site_Open::get_open_site_admin_link( $recent_posts_published[ $i ]['website']->id, true ); ?>&location=<?php echo esc_attr( base64_encode( 'post.php?action=editpost&post=' . $recent_posts_published[ $i ]['id'] . '&action=edit' ) ); // phpcs:ignore WordPress.PHP.DiscouragedPHPFunctions -- base64_encode used for http encoding compatible. ?>" target="_blank"><?php esc_html_e( 'Edit', 'mainwp' ); ?></a> | |
| 282 | 295 | <a class="<?php echo $is_demo ? 'disabled' : ''; ?> item mainwp-post-trash" href="#"><?php esc_html_e( 'Trash', 'mainwp' ); ?></a> |
| 283 | 296 | <a class="<?php echo $is_demo ? 'disabled' : ''; ?> item" href="<?php echo esc_url( $recent_posts_published[ $i ]['website']->url ) . ( '/' !== substr( $recent_posts_published[ $i ]['website']->url, - 1 ) ? '/' : '' ) . '?p=' . esc_attr( $recent_posts_published[ $i ]['id'] ); ?>" target="_blank"><?php esc_html_e( 'View', 'mainwp' ); ?></a> |
| 284 | 297 | </div> |
| 285 | 298 | </div> |
| @@ -310,9 +323,9 @@ | ||
| 310 | 323 | * Render all draft posts. |
| 311 | 324 | * |
| 312 | 325 | * @param array $allPosts All posts data. |
| 313 | 326 | * @param int $recent_number Number of posts. |
| 314 | - * @param bool $individual Determins if it's individual site dashbaord. | |
| 327 | + * @param bool $individual Determins if it's individual site dashboard. | |
| 315 | 328 | * |
| 316 | 329 | * @uses \MainWP\Dashboard\MainWP_Utility::get_sub_array_having() |
| 317 | 330 | * @uses \MainWP\Dashboard\MainWP_Utility::sortmulti() |
| 318 | 331 | * @uses \MainWP\Dashboard\MainWP_Utility::format_timestamp() |
| @@ -336,12 +349,12 @@ | ||
| 336 | 349 | * @since 4.1 |
| 337 | 350 | */ |
| 338 | 351 | do_action( 'mainwp_recent_posts_before_draft_list', $allPosts, $recent_number ); |
| 339 | 352 | if ( empty( $recent_posts_draft ) ) { |
| 340 | - MainWP_UI::render_empty_element_placeholder(); | |
| 353 | + MainWP_UI::render_empty_element_placeholder( __( 'No Recent Posts Found', 'mainwp' ), __( 'Recent post changes will appear here once activity is detected.', 'mainwp' ), '<em data-emoji=":pencil:" class="medium"></em>' ); | |
| 341 | 354 | } |
| 342 | 355 | ?> |
| 343 | - <div class="ui middle aligned divided selection list"> | |
| 356 | + <div class="ui middle aligned divided list"> | |
| 344 | 357 | <?php |
| 345 | 358 | $_count = count( $recent_posts_draft ); |
| 346 | 359 | for ( $i = 0; $i < $_count && $i < $recent_number; $i++ ) { |
| 347 | 360 | if ( ! isset( $recent_posts_draft[ $i ]['title'] ) || empty( $recent_posts_draft[ $i ]['title'] ) ) { |
| @@ -352,9 +365,9 @@ | ||
| 352 | 365 | } |
| 353 | 366 | $name = wp_strip_all_tags( $recent_posts_draft[ $i ]['website']->name ); |
| 354 | 367 | ?> |
| 355 | 368 | <div class="item"> |
| 356 | - <div class="ui stackable grid"> | |
| 369 | + <div class="ui grid"> | |
| 357 | 370 | <input class="postId" type="hidden" name="id" value="<?php echo esc_attr( $recent_posts_draft[ $i ]['id'] ); ?>"/> |
| 358 | 371 | <input class="websiteId" type="hidden" name="id" value="<?php echo esc_attr( $recent_posts_draft[ $i ]['website']->id ); ?>"/> |
| 359 | 372 | <div class="fourteen wide column middle aligned"> |
| 360 | 373 | <div> |
| @@ -365,13 +378,13 @@ | ||
| 365 | 378 | </div> |
| 366 | 379 | <span class="ui small text"><?php echo esc_html( $recent_posts_draft[ $i ]['dts'] ); ?></span> |
| 367 | 380 | </div> |
| 368 | 381 | <div class="two wide column right aligned"> |
| 369 | - <div class="ui right pointing dropdown icon mini basic green button" style="z-index:999"> | |
| 370 | - <i class="ellipsis horizontal icon"></i> | |
| 382 | + <div class="ui right pointing dropdown" style="z-index:999"> | |
| 383 | + <i class="ellipsis vertical icon"></i> | |
| 371 | 384 | <div class="menu"> |
| 372 | 385 | <a class="<?php echo $is_demo ? 'disabled' : ''; ?> item mainwp-post-publish" href="#"><?php esc_html_e( 'Publish', 'mainwp' ); ?></a> |
| 373 | - <a class="<?php echo $is_demo ? 'disabled' : ''; ?> item" href="admin.php?page=SiteOpen&newWindow=yes&websiteid=<?php echo esc_attr( $recent_posts_draft[ $i ]['website']->id ); ?>&location=<?php echo esc_attr( base64_encode( 'post.php?action=editpost&post=' . $recent_posts_draft[ $i ]['id'] . '&action=edit' ) ); // phpcs:ignore WordPress.PHP.DiscouragedPHPFunctions -- base64_encode used for http encoding compatible. ?>&_opennonce=<?php echo esc_html( wp_create_nonce( 'mainwp-admin-nonce' ) ); ?>" target="_blank"><?php esc_html_e( 'Edit', 'mainwp' ); ?></a> | |
| 386 | + <a class="<?php echo $is_demo ? 'disabled' : ''; ?> item" href="<?php MainWP_Site_Open::get_open_site_admin_link( $recent_posts_draft[ $i ]['website']->id, true ); ?>&location=<?php echo esc_attr( base64_encode( 'post.php?action=editpost&post=' . $recent_posts_draft[ $i ]['id'] . '&action=edit' ) ); // phpcs:ignore WordPress.PHP.DiscouragedPHPFunctions -- base64_encode used for http encoding compatible. ?>" target="_blank"><?php esc_html_e( 'Edit', 'mainwp' ); ?></a> | |
| 374 | 387 | <a class="<?php echo $is_demo ? 'disabled' : ''; ?> item mainwp-post-trash" href="#"><?php esc_html_e( 'Trash', 'mainwp' ); ?></a> |
| 375 | 388 | </div> |
| 376 | 389 | </div> |
| 377 | 390 | </div> |
| @@ -401,9 +414,9 @@ | ||
| 401 | 414 | * Render all pending posts. |
| 402 | 415 | * |
| 403 | 416 | * @param array $allPosts All posts data. |
| 404 | 417 | * @param int $recent_number Number of posts. |
| 405 | - * @param bool $individual Determins if it's individual site dashbaord. | |
| 418 | + * @param bool $individual Determins if it's individual site dashboard. | |
| 406 | 419 | * |
| 407 | 420 | * @uses \MainWP\Dashboard\MainWP_Utility::get_sub_array_having() |
| 408 | 421 | * @uses \MainWP\Dashboard\MainWP_Utility::sortmulti() |
| 409 | 422 | * @uses \MainWP\Dashboard\MainWP_Utility::format_timestamp() |
| @@ -427,12 +440,12 @@ | ||
| 427 | 440 | * @since 4.1 |
| 428 | 441 | */ |
| 429 | 442 | do_action( 'mainwp_recent_posts_before_pending_list', $allPosts, $recent_number ); |
| 430 | 443 | if ( empty( $recent_posts_pending ) ) { |
| 431 | - MainWP_UI::render_empty_element_placeholder(); | |
| 444 | + MainWP_UI::render_empty_element_placeholder( __( 'No Recent Posts Found', 'mainwp' ), __( 'Recent post changes will appear here once activity is detected.', 'mainwp' ), '<em data-emoji=":pencil:" class="medium"></em>' ); | |
| 432 | 445 | } |
| 433 | 446 | ?> |
| 434 | - <div class="ui middle aligned divided selection list"> | |
| 447 | + <div class="ui middle aligned divided list"> | |
| 435 | 448 | <?php |
| 436 | 449 | $_count = count( $recent_posts_pending ); |
| 437 | 450 | for ( $i = 0; $i < $_count && $i < $recent_number; $i++ ) { |
| 438 | 451 | if ( ! isset( $recent_posts_pending[ $i ]['title'] ) || empty( $recent_posts_pending[ $i ]['title'] ) ) { |
| @@ -443,9 +456,9 @@ | ||
| 443 | 456 | } |
| 444 | 457 | $name = wp_strip_all_tags( $recent_posts_pending[ $i ]['website']->name ); |
| 445 | 458 | ?> |
| 446 | 459 | <div class="item"> |
| 447 | - <div class="ui stackable grid"> | |
| 460 | + <div class="ui grid"> | |
| 448 | 461 | <input class="postId" type="hidden" name="id" value="<?php echo esc_attr( $recent_posts_pending[ $i ]['id'] ); ?>"/> |
| 449 | 462 | <input class="websiteId" type="hidden" name="id" value="<?php echo esc_attr( $recent_posts_pending[ $i ]['website']->id ); ?>"/> |
| 450 | 463 | <div class="fourteen wide column middle aligned"> |
| 451 | 464 | <div> |
| @@ -456,13 +469,13 @@ | ||
| 456 | 469 | </div> |
| 457 | 470 | <span class="ui small text"><?php echo esc_html( $recent_posts_pending[ $i ]['dts'] ); ?></span> |
| 458 | 471 | </div> |
| 459 | 472 | <div class="two wide column right aligned"> |
| 460 | - <div class="ui right pointing dropdown icon mini basic green button" style="z-index:999"> | |
| 461 | - <i class="ellipsis horizontal icon"></i> | |
| 473 | + <div class="ui right pointing dropdown" style="z-index:999"> | |
| 474 | + <i class="ellipsis vertical icon"></i> | |
| 462 | 475 | <div class="menu"> |
| 463 | 476 | <a class="<?php echo $is_demo ? 'disabled' : ''; ?> item mainwp-post-publish" href="#"><?php esc_html_e( 'Publish', 'mainwp' ); ?></a> |
| 464 | - <a class="<?php echo $is_demo ? 'disabled' : ''; ?> item" href="admin.php?page=SiteOpen&newWindow=yes&websiteid=<?php echo esc_attr( $recent_posts_pending[ $i ]['website']->id ); ?>&location=<?php echo esc_attr( base64_encode( 'post.php?action=editpost&post=' . $recent_posts_pending[ $i ]['id'] . '&action=edit' ) ); // phpcs:ignore WordPress.PHP.DiscouragedPHPFunctions -- base64_encode used for http encoding compatible. ?>&_opennonce=<?php echo esc_html( wp_create_nonce( 'mainwp-admin-nonce' ) ); ?>" target="_blank"><?php esc_html_e( 'Edit', 'mainwp' ); ?></a> | |
| 477 | + <a class="<?php echo $is_demo ? 'disabled' : ''; ?> item" href="<?php MainWP_Site_Open::get_open_site_admin_link( $recent_posts_pending[ $i ]['website']->id, true ); ?>&location=<?php echo esc_attr( base64_encode( 'post.php?action=editpost&post=' . $recent_posts_pending[ $i ]['id'] . '&action=edit' ) ); // phpcs:ignore WordPress.PHP.DiscouragedPHPFunctions -- base64_encode used for http encoding compatible. ?>" target="_blank"><?php esc_html_e( 'Edit', 'mainwp' ); ?></a> | |
| 465 | 478 | <a class="<?php echo $is_demo ? 'disabled' : ''; ?> item mainwp-post-trash" href="#"><?php esc_html_e( 'Trash', 'mainwp' ); ?></a> |
| 466 | 479 | </div> |
| 467 | 480 | </div> |
| 468 | 481 | </div> |
| @@ -492,9 +505,9 @@ | ||
| 492 | 505 | * Render all future posts. |
| 493 | 506 | * |
| 494 | 507 | * @param array $allPosts All posts data. |
| 495 | 508 | * @param int $recent_number Number of posts. |
| 496 | - * @param bool $individual Determins if it's individual site dashbaord . | |
| 509 | + * @param bool $individual Determins if it's individual site dashboard . | |
| 497 | 510 | * |
| 498 | 511 | * @uses \MainWP\Dashboard\MainWP_Utility::get_sub_array_having() |
| 499 | 512 | * @uses \MainWP\Dashboard\MainWP_Utility::sortmulti() |
| 500 | 513 | * @uses \MainWP\Dashboard\MainWP_Utility::format_timestamp() |
| @@ -518,12 +531,12 @@ | ||
| 518 | 531 | * @since 4.1 |
| 519 | 532 | */ |
| 520 | 533 | do_action( 'mainwp_recent_posts_before_future_list', $allPosts, $recent_number ); |
| 521 | 534 | if ( empty( $recent_posts_future ) ) { |
| 522 | - MainWP_UI::render_empty_element_placeholder(); | |
| 535 | + MainWP_UI::render_empty_element_placeholder( __( 'No Recent Posts Found', 'mainwp' ), __( 'Recent post changes will appear here once activity is detected.', 'mainwp' ), '<em data-emoji=":pencil:" class="medium"></em>' ); | |
| 523 | 536 | } |
| 524 | 537 | ?> |
| 525 | - <div class="ui middle aligned divided selection list"> | |
| 538 | + <div class="ui middle aligned divided list"> | |
| 526 | 539 | <?php |
| 527 | 540 | $_count = count( $recent_posts_future ); |
| 528 | 541 | for ( $i = 0; $i < $_count && $i < $recent_number; $i++ ) { |
| 529 | 542 | if ( ! isset( $recent_posts_future[ $i ]['title'] ) || empty( $recent_posts_future[ $i ]['title'] ) ) { |
| @@ -534,9 +547,9 @@ | ||
| 534 | 547 | } |
| 535 | 548 | $name = wp_strip_all_tags( $recent_posts_future[ $i ]['website']->name ); |
| 536 | 549 | ?> |
| 537 | 550 | <div class="item"> |
| 538 | - <div class="ui stackable grid"> | |
| 551 | + <div class="ui grid"> | |
| 539 | 552 | <input class="postId" type="hidden" name="id" value="<?php echo esc_attr( $recent_posts_future[ $i ]['id'] ); ?>"/> |
| 540 | 553 | <input class="websiteId" type="hidden" name="id" value="<?php echo esc_attr( $recent_posts_future[ $i ]['website']->id ); ?>"/> |
| 541 | 554 | <div class="fourteen wide column middle aligned"> |
| 542 | 555 | <div> |
| @@ -547,15 +560,15 @@ | ||
| 547 | 560 | </div> |
| 548 | 561 | <span class="ui small text"><?php echo esc_html( $recent_posts_future[ $i ]['dts'] ); ?></span> |
| 549 | 562 | </div> |
| 550 | 563 | <div class="two wide column right aligned"> |
| 551 | - <div class="ui right pointing dropdown icon mini basic green button" style="z-index:999"> | |
| 552 | - <i class="ellipsis horizontal icon"></i> | |
| 564 | + <div class="ui right pointing dropdown" style="z-index:999"> | |
| 565 | + <i class="ellipsis vertical icon"></i> | |
| 553 | 566 | <div class="menu"> |
| 554 | 567 | <a class="<?php echo $is_demo ? 'disabled' : ''; ?> item mainwp-post-publish" href="#"><?php esc_html_e( 'Publish', 'mainwp' ); ?></a> |
| 555 | - <a class="<?php echo $is_demo ? 'disabled' : ''; ?> item" href="admin.php?page=SiteOpen&newWindow=yes&websiteid=<?php echo esc_attr( $recent_posts_future[ $i ]['website']->id ); ?>&location=<?php echo esc_attr( base64_encode( 'post.php?action=editpost&post=' . $recent_posts_future[ $i ]['id'] . '&action=edit' ) ); // phpcs:ignore WordPress.PHP.DiscouragedPHPFunctions -- base64_encode used for http encoding compatible. ?>&_opennonce=<?php echo esc_html( wp_create_nonce( 'mainwp-admin-nonce' ) ); ?>" target="_blank"><?php esc_html_e( 'Edit', 'mainwp' ); ?></a> | |
| 568 | + <a class="<?php echo $is_demo ? 'disabled' : ''; ?> item" href="<?php MainWP_Site_Open::get_open_site_admin_link( $recent_posts_future[ $i ]['website']->id, true ); ?>&location=<?php echo esc_attr( base64_encode( 'post.php?action=editpost&post=' . $recent_posts_future[ $i ]['id'] . '&action=edit' ) ); // phpcs:ignore WordPress.PHP.DiscouragedPHPFunctions -- base64_encode used for http encoding compatible. ?>" target="_blank"><?php esc_html_e( 'Edit', 'mainwp' ); ?></a> | |
| 556 | 569 | <a class="<?php echo $is_demo ? 'disabled' : ''; ?> item mainwp-post-trash" href="#"><?php esc_html_e( 'Trash', 'mainwp' ); ?></a> |
| 557 | - <a class="<?php echo $is_demo ? 'disabled' : ''; ?> item" href="admin.php?page=SiteOpen&newWindow=yes&websiteid=<?php echo esc_attr( $recent_posts_future[ $i ]['website']->id ); ?>&openUrl=yes&location=<?php echo esc_attr( base64_encode( '?p=' . $recent_posts_future[ $i ]['id'] . '&preview=true' ) ); // phpcs:ignore WordPress.PHP.DiscouragedPHPFunctions -- base64_encode used for http encoding compatible. ?>&_opennonce=<?php echo esc_html( wp_create_nonce( 'mainwp-admin-nonce' ) ); ?>" target="_blank"><?php esc_html_e( 'Preview', 'mainwp' ); ?></a> | |
| 570 | + <a class="<?php echo $is_demo ? 'disabled' : ''; ?> item" href="<?php MainWP_Site_Open::get_open_site_admin_link( $recent_posts_future[ $i ]['website']->id, true ); ?>&openUrl=yes&location=<?php echo esc_attr( base64_encode( '?p=' . $recent_posts_future[ $i ]['id'] . '&preview=true' ) ); // phpcs:ignore WordPress.PHP.DiscouragedPHPFunctions -- base64_encode used for http encoding compatible. ?>" target="_blank"><?php esc_html_e( 'Preview', 'mainwp' ); ?></a> | |
| 558 | 571 | </div> |
| 559 | 572 | </div> |
| 560 | 573 | </div> |
| 561 | 574 | </div> |
| @@ -584,9 +597,9 @@ | ||
| 584 | 597 | * Render all trashed posts. |
| 585 | 598 | * |
| 586 | 599 | * @param array $allPosts All posts data. |
| 587 | 600 | * @param int $recent_number Number of posts. |
| 588 | - * @param bool $individual Determins if it's individual site dashbaord . | |
| 601 | + * @param bool $individual Determins if it's individual site dashboard . | |
| 589 | 602 | * |
| 590 | 603 | * @uses \MainWP\Dashboard\MainWP_Utility::get_sub_array_having() |
| 591 | 604 | * @uses \MainWP\Dashboard\MainWP_Utility::sortmulti() |
| 592 | 605 | * @uses \MainWP\Dashboard\MainWP_Utility::format_timestamp() |
| @@ -610,12 +623,12 @@ | ||
| 610 | 623 | * @since 4.1 |
| 611 | 624 | */ |
| 612 | 625 | do_action( 'mainwp_recent_posts_before_trash_list', $allPosts, $recent_number ); |
| 613 | 626 | if ( empty( $recent_posts_trash ) ) { |
| 614 | - MainWP_UI::render_empty_element_placeholder(); | |
| 627 | + MainWP_UI::render_empty_element_placeholder( __( 'No Recent Posts Found', 'mainwp' ), __( 'Recent post changes will appear here once activity is detected.', 'mainwp' ), '<em data-emoji=":pencil:" class="medium"></em>' ); | |
| 615 | 628 | } |
| 616 | 629 | ?> |
| 617 | - <div class="ui middle aligned divided selection list"> | |
| 630 | + <div class="ui middle aligned divided list"> | |
| 618 | 631 | <?php |
| 619 | 632 | $_count = count( $recent_posts_trash ); |
| 620 | 633 | for ( $i = 0; $i < $_count && $i < $recent_number; $i++ ) { |
| 621 | 634 | if ( ! isset( $recent_posts_trash[ $i ]['title'] ) || empty( $recent_posts_trash[ $i ]['title'] ) ) { |
| @@ -626,9 +639,9 @@ | ||
| 626 | 639 | } |
| 627 | 640 | $name = wp_strip_all_tags( $recent_posts_trash[ $i ]['website']->name ); |
| 628 | 641 | ?> |
| 629 | 642 | <div class="item"> |
| 630 | - <div class="ui stackable grid"> | |
| 643 | + <div class="ui grid"> | |
| 631 | 644 | <input class="postId" type="hidden" name="id" value="<?php echo esc_attr( $recent_posts_trash[ $i ]['id'] ); ?>"/> |
| 632 | 645 | <input class="websiteId" type="hidden" name="id" value="<?php echo esc_attr( $recent_posts_trash[ $i ]['website']->id ); ?>"/> |
| 633 | 646 | <div class="fourteen wide column middle aligned"> |
| 634 | 647 | <div> |
| @@ -639,10 +652,10 @@ | ||
| 639 | 652 | </div> |
| 640 | 653 | <span class="ui small text"><?php echo esc_html( $recent_posts_trash[ $i ]['dts'] ); ?></span> |
| 641 | 654 | </div> |
| 642 | 655 | <div class="two wide column right aligned"> |
| 643 | - <div class="ui right pointing dropdown icon mini basic green button" style="z-index:999"> | |
| 644 | - <i class="ellipsis horizontal icon"></i> | |
| 656 | + <div class="ui right pointing dropdown" style="z-index:999"> | |
| 657 | + <i class="ellipsis vertical icon"></i> | |
| 645 | 658 | <div class="menu"> |
| 646 | 659 | <a href="#" class="<?php echo $is_demo ? 'disabled' : ''; ?> item mainwp-post-restore" ><?php esc_html_e( 'Restore', 'mainwp' ); ?></a> |
| 647 | 660 | <a href="#" class="<?php echo $is_demo ? 'disabled' : ''; ?> item mainwp-post-delete"><?php esc_html_e( 'Delete permanently', 'mainwp' ); ?></a> |
| 648 | 661 | </div> |