first
This commit is contained in:
@ -0,0 +1,14 @@
|
||||
<?php
|
||||
namespace ShortPixel;
|
||||
|
||||
// phpcs:ignore WordPress.Security.NonceVerification.Recommended -- This is not a form
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit; // Exit if accessed directly.
|
||||
}
|
||||
?>
|
||||
|
||||
<div class='pagination tablenav bottom'>
|
||||
<div class='tablenav-pages'>
|
||||
<?php echo $this->view->pagination; ?>
|
||||
</div>
|
||||
</div>
|
@ -0,0 +1,73 @@
|
||||
<?php
|
||||
namespace ShortPixel;
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit; // Exit if accessed directly.
|
||||
}
|
||||
?>
|
||||
<div class="wrap shortpixel-other-media">
|
||||
<h2>
|
||||
<?php esc_html_e($view->title);?>
|
||||
</h2>
|
||||
|
||||
<div class='toolbar'>
|
||||
|
||||
<hr class='wp-header-end' />
|
||||
|
||||
<?php if (property_exists($view, 'show_search') && true === $view->show_search): ?>
|
||||
<div class="searchbox">
|
||||
<form method="get">
|
||||
<input type="hidden" name="page" value="wp-short-pixel-custom" />
|
||||
<input type='hidden' name='order' value="<?php echo esc_attr($this->order) ?>" />
|
||||
<input type="hidden" name="orderby" value="<?php echo esc_attr($this->orderby) ?>" />
|
||||
|
||||
<p class="search-form">
|
||||
<label><?php esc_html_e('Search', 'shortpixel-image-optimiser'); ?></label>
|
||||
<input type="text" name="s" value="<?php echo esc_attr($this->search) ?>" />
|
||||
|
||||
</p>
|
||||
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<div class='pagination tablenav'>
|
||||
|
||||
<?php if ($this->view->pagination !== false): ?>
|
||||
<div class='tablenav-pages'>
|
||||
<?php echo $this->view->pagination; ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
$file_url = esc_url(add_query_arg('part', 'files', $this->url));
|
||||
$folder_url = esc_url(add_query_arg('part', 'folders', $this->url));
|
||||
$scan_url = esc_url(add_query_arg('part', 'scan', $this->url));
|
||||
|
||||
$current_part = isset($_GET['part']) ? sanitize_text_field($_GET['part']) : 'files';
|
||||
|
||||
$tabs = array(
|
||||
'files' => array('link' => $file_url,
|
||||
'text' => __('Files', 'shortpixel-image-optimiser'),
|
||||
),
|
||||
'folders' => array('link' => $folder_url,
|
||||
'text' => __('Folders', 'shortpixel-image-optimiser'),
|
||||
),
|
||||
'scan' => array('link' => $scan_url,
|
||||
'text' => __('Scan', 'shortpixel-image-optimiser'),
|
||||
|
||||
),
|
||||
);
|
||||
|
||||
?>
|
||||
|
||||
<div class="custom-media-tabs">
|
||||
<?php foreach($tabs as $tabName => $tab)
|
||||
{
|
||||
$class = ($current_part == $tabName) ? ' class="selected" ' : '';
|
||||
|
||||
echo '<a href="' . $tab['link'] . '" ' . $class . '>' . $tab['text'] . '</a>';
|
||||
} ?>
|
||||
</div>
|
@ -0,0 +1,116 @@
|
||||
<?php
|
||||
|
||||
namespace ShortPixel;
|
||||
use ShortPixel\ShortPixelLogger\ShortPixelLogger as Log;
|
||||
use ShortPixel\Notices\NoticeController as Notices;
|
||||
|
||||
use ShortPixel\Helper\UiHelper as UiHelper;
|
||||
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit; // Exit if accessed directly.
|
||||
}
|
||||
|
||||
$item = $this->view->current_item;
|
||||
|
||||
$folder_id = $item->get('id');
|
||||
|
||||
$type_display = ($item->get('is_nextgen') ) ? __('Nextgen', 'shortpixel-image-optimiser') : __('Custom Media', 'shortpixel-image-optimiser');
|
||||
$stat = $item->getStats();
|
||||
|
||||
|
||||
$fullstatus = esc_html__("Optimized",'shortpixel-image-optimiser') . ": " . $stat['optimized'] . "\n"
|
||||
. "" . esc_html__("Unoptimized",'shortpixel-image-optimiser') . ": " . $stat['waiting'] . "\n"
|
||||
;
|
||||
//$fullstatus .= ($item->get('is_nextgen') ) ? __('Nextgen', 'shortpixel-image-optimiser') : "";
|
||||
|
||||
|
||||
/*
|
||||
if ($stat['total'] == 0)
|
||||
{
|
||||
$optimize_status = __("Empty",'shortpixel-image-optimiser');
|
||||
$fullstatus = '';
|
||||
}
|
||||
elseif ($stat['total'] == $stat['optimized'])
|
||||
{
|
||||
$optimize_status = __("Optimized",'shortpixel-image-optimiser');
|
||||
}
|
||||
elseif ($stat['optimized'] > 0)
|
||||
{
|
||||
$optimize_status = __("Pending",'shortpixel-image-optimiser');
|
||||
}
|
||||
else
|
||||
{
|
||||
$optimize_status = __("Waiting",'shortpixel-image-optimiser');
|
||||
}
|
||||
*/
|
||||
|
||||
|
||||
// $action = __("Stop monitoring",'shortpixel-image-optimiser');
|
||||
|
||||
$err = ''; // unused since failed is gone.
|
||||
if (! $item->exists() && ! $err)
|
||||
$err = __('Directory does not exist', 'shortpixel-image-optimiser');
|
||||
|
||||
|
||||
if ($item->get('is_nextgen') && $view->settings->includeNextGen == 1)
|
||||
$action = false;
|
||||
|
||||
$refreshUrl = add_query_arg(array('sp-action' => 'action_refreshfolder', 'folder_id' => $folder_id, 'part' => 'adv-settings'), $this->url); // has url
|
||||
|
||||
$rowActions = $this->getRowActions($item);
|
||||
?>
|
||||
<div class='item item-<?php echo esc_attr($item->get('id')) ?>'>
|
||||
<span><input type="checkbox" /></span>
|
||||
|
||||
<span class='folder folder-<?php echo esc_attr($item->get('id')) ?>'>
|
||||
<?php echo esc_html($item->getPath()); ?>
|
||||
|
||||
<div class="row-actions">
|
||||
<span class='item-id'>#<?php echo esc_attr($item->get('id')); ?></span>
|
||||
<?php
|
||||
if (isset($rowActions)):
|
||||
$i = 0;
|
||||
foreach($rowActions as $actionName => $action):
|
||||
$classes = '';
|
||||
$link = ($action['type'] == 'js') ? 'javascript:' . $action['function'] : $action['function'];
|
||||
|
||||
if ($i > 0)
|
||||
echo "|";
|
||||
?>
|
||||
<a href="<?php echo $link ?>" class="<?php echo $classes ?>"><?php echo $action['text'] ?></a>
|
||||
<?php
|
||||
$i++;
|
||||
endforeach;
|
||||
|
||||
endif;
|
||||
?>
|
||||
</div>
|
||||
|
||||
|
||||
</span>
|
||||
<span>
|
||||
<?php echo $type_display; ?>
|
||||
</span>
|
||||
<span>
|
||||
|
||||
<span title="<?php echo esc_attr($fullstatus); ?>" class='info-icon'>
|
||||
<img alt='<?php esc_html_e('Info Icon', 'shortpixel-image-optimiser') ?>' src='<?php echo esc_url( wpSPIO()->plugin_url('res/img/info-icon.png' ));?>' style="margin-bottom: -2px;"/>
|
||||
</span> <?php
|
||||
//echo esc_html($type_display. ' ' );
|
||||
?>
|
||||
|
||||
<span class='files-number'><?php
|
||||
echo esc_html($stat['optimized']);
|
||||
echo '/';
|
||||
echo esc_html($stat['total']); ?>
|
||||
</span> <?php _e('Files', 'shortpixel-image-optimiser'); ?>
|
||||
</span>
|
||||
<span>
|
||||
<?php echo esc_html(UiHelper::formatTS($item->get('updated'))) ?>
|
||||
</span>
|
||||
<span class='status'>
|
||||
|
||||
</span>
|
||||
|
||||
</div>
|
Reference in New Issue
Block a user