Beispiel #1
0
 function column_filename($file)
 {
     $path = esc_html(dirname($file->GetLocalPathRel()));
     $icons = '';
     if ($file->file_rescan_pending) {
         $icons .= WPFB_Admin::Icon('schedule', 16, '#95a5a6');
     }
     if ($file->IsScanLocked()) {
         $icons .= WPFB_Admin::Icon('lock', 16, '#95a5a6');
     }
     return "<code>{$path}/</code><br />" . '<a href="' . esc_attr($file->GetUrl()) . '">' . esc_html($file->file_name) . '</a> ' . $icons;
 }
Beispiel #2
0
?>
" />
	<input type="hidden" name="file_id" id="file_id" value="<?php 
echo $update ? $multi_edit ? $item_ids : $file->file_id : "";
?>
" />
	<?php 
wp_nonce_field($nonce_action, 'wpfb-file-nonce');
?>

	<div class="wpfb-upload-box">
		<?php 
if ($update && ($file->IsScanLocked() || $file->GetRemoteSyncMeta())) {
    ?>
			<div class="overlay-locked"><?php 
    echo WPFB_Admin::Icon('lock', 70);
    ?>
				<span><?php 
    $file->IsScanLocked() && printf(__('This file is locked for %s or until the scan process completes.', 'wp-filebase'), human_time_diff(time(), $file->file_scan_lock));
    echo ' ' . __('You can edit meta data only.', 'wp-filebase');
    ?>
</span>
			</div>
		<?php 
}
?>

		<div id="wpfilebase-upload-menu" class="admin-scheme-bgcolor-0">
			<a href="#" <?php 
echo $file->IsRemote() ? '' : 'class="admin-scheme-bgcolor-2 current"';
?>
Beispiel #3
0
    static function WidgetTools()
    {
        $cron_sync_desc = '';
        if (WPFB_Core::$settings->cron_sync) {
            $cron_sync_desc .= __('Automatic sync is enabled. Cronjob scheduled hourly.');
            $sync_stats = get_option('wpfilebase_cron_sync_stats');
            $cron_sync_desc .= (!empty($sync_stats) ? " (" . sprintf(__('Last cron sync %s ago took %s and used %s of RAM.', 'wp-filebase'), human_time_diff($sync_stats['t_start']), human_time_diff($sync_stats['t_start'], $sync_stats['t_end']), WPFB_Output::FormatFilesize($sync_stats['mem_peak'])) . ")" : '') . " " . (($next = wp_next_scheduled(WPFB . '_cron')) ? sprintf(__('Next cron sync scheduled in %s.', 'wp-filebase'), human_time_diff(time(), $next)) : "");
        } else {
            $cron_sync_desc .= __('Cron sync is disabled.', 'wp-filebase');
        }
        $tools = array(array('url' => add_query_arg(array('action' => 'sync', 'no-ob' => 1)), 'icon' => 'cached', 'label' => __('Sync Filebase', 'wp-filebase'), 'desc' => __('Synchronises the database with the file system. Use this to add FTP-uploaded files.', 'wp-filebase') . '<br />' . $cron_sync_desc));
        if (current_user_can('install_plugins')) {
            // is admin?
            $new_tag = WPFB_AdminGuiManage::NewExtensionsAvailable() ? '<span class="wp-ui-notification new-exts">new</span>' : '';
            $tools[] = array('url' => add_query_arg(array('action' => 'install-extensions')), 'icon' => 'extension', 'label' => __('Extensions', 'wp-filebase') . $new_tag, 'desc' => __('Install Extensions to extend functionality of WP-Filebase', 'wp-filebase'));
        }
        ?>
		<ul>
		<?php 
        foreach ($tools as $id => $tool) {
            ?>
				<li id="wpfb-tool-<?php 
            echo $id;
            ?>
"><a href="<?php 
            echo $tool['url'];
            ?>
" <?php 
            if (!empty($tool['confirm'])) {
                ?>
 onclick="return confirm('<?php 
                echo $tool['confirm'];
                ?>
')" <?php 
            }
            ?>
 class="button admin-scheme-fill-2-hover"><?php 
            echo WPFB_Admin::Icon($tool['icon'], 32);
            echo $tool['label'];
            ?>
</a></li>
			<?php 
        }
        ?>
		</ul>
			<?php 
        foreach ($tools as $id => $tool) {
            ?>
	
			<div id="wpfb-tool-desc-<?php 
            echo $id;
            ?>
" class="tool-desc">
			<?php 
            echo $tool['desc'];
            ?>
			</div>
			<?php 
        }
        ?>
		<script>
			if (!jQuery(document.body).hasClass('mobile')) {
				jQuery('#wpfb-tools li').mouseenter(function (e) {
					jQuery('#wpfb-tools .tool-desc').hide();
					jQuery('#wpfb-tool-desc-' + this.id.substr(10)).show();
				});
				jQuery('#wpfb-tools .tool-desc').first().show();
			}
		</script>

		<?php 
        if (!empty(WPFB_Core::$settings->tag_conv_req)) {
            ?>
<p><a href="<?php 
            echo add_query_arg('action', 'convert-tags');
            ?>
" class="button"><?php 
            _e('Convert old Tags', 'wp-filebase');
            ?>
</a> &nbsp; <?php 
            printf(__('Convert tags from versions earlier than %s.', 'wp-filebase'), '0.2.0');
            ?>
</p> <?php 
        }
        ?>
		<!--  <p><a href="<?php 
        echo add_query_arg('action', 'add-urls');
        ?>
" class="button"><?php 
        _e('Add multiple URLs', 'wp-filebase');
        ?>
</a> &nbsp; <?php 
        _e('Add multiple remote files at once.', 'wp-filebase');
        ?>
</p>
		-->
		<?php 
    }