public function page_data()
    {
        $mdt = Matts_Developer_Tools::get_instance();
        ob_start();
        ?>
		<div id="welcome-panel" class="welcome-panel">
			<div class="welcome-panel-content">
				<h2>
					<?php 
        _e('Welcome to Matt\'s Developer Tools!', 'matts-developer-tools');
        ?>
				</h2>

				<p class="about-description">
					<?php 
        _e('Use the tabs on top to use the available functions:', 'matts-developer-tools');
        ?>
				</p>
				<?php 
        foreach ($mdt->pages_config as $page) {
            if ('home' == $page) {
                continue;
            }
            ?>
					<p>
					<h3>
						<a href="<?php 
            menu_page_url('mdt_' . $page);
            ?>
"><?php 
            echo $mdt->pages[$page]->title;
            ?>
</a>
					</h3>
					<?php 
            echo $mdt->pages[$page]->description;
            ?>
					</p>
					<?php 
        }
        ?>
			</div>
		</div>
		<?php 
        return ob_get_clean();
    }
Ejemplo n.º 2
0
        return plugin_dir_url(__FILE__) . 'assets' . DIRECTORY_SEPARATOR;
    }
    public static function num_convt($v)
    {
        $l = substr($v, -1);
        $ret = substr($v, 0, -1);
        switch (strtoupper($l)) {
            case 'P':
                // fall-through
            // fall-through
            case 'T':
                // fall-through
            // fall-through
            case 'G':
                // fall-through
            // fall-through
            case 'M':
                // fall-through
            // fall-through
            case 'K':
                // fall-through
                $ret *= 1024;
                break;
            default:
                break;
        }
        return $ret;
    }
}
$mdt = Matts_Developer_Tools::get_instance();
// EOF
Ejemplo n.º 3
0
    public function page_start($export_key = '')
    {
        $mdt = Matts_Developer_Tools::get_instance();
        wp_enqueue_style('mdt_common', $mdt::assets_path() . 'css/common.css');
        ?>
		<h2><?php 
        echo __('Matt\'s Developer Tools', 'wordpress-system-report');
        ?>
</h2>
		<div class="wrap mdt-wrap">
			<h3 class="nav-tab-wrapper wp-clearfix">
			<?php 
        foreach ($mdt->pages_config as $page) {
            $active = 'mdt_' . $page == $_GET['page'] ? 'nav-tab-active' : '';
            printf('<a href="%s" class="nav-tab %s">%s</a>', menu_page_url('mdt_' . $page, FALSE), $active, $mdt->pages[$page]->title);
        }
        ?>
			</h3>

				<?php 
        // Export Button
        $mdt_buttons = array();
        ob_start();
        ?>
				<form action="<?php 
        echo esc_url($_SERVER['REQUEST_URI']);
        ?>
" method="post">
					<input type="hidden" name="export_content" value="<?php 
        echo $export_key;
        ?>
">
					<input type="hidden" name="system_report_export" value="1">
					<input type="submit" value="<?php 
        echo __('&darr; Export', 'wordpress-system-report');
        ?>
"
						   class="button button-primary">
				</form>
				<?php 
        $mdt_buttons['export'] = ob_get_clean();
        // Reload button
        ob_start();
        ?>
				<form action="<?php 
        echo esc_url($_SERVER['REQUEST_URI']);
        ?>
" method="post">
					<input type="submit" value="<?php 
        echo __('&#8634; Refresh', 'wordpress-system-report');
        ?>
"
						   class="button button-secondary">
				</form>
				<?php 
        $mdt_buttons['reload'] = ob_get_clean();
        $mdt_buttons = apply_filters('mdt_buttons', $mdt_buttons);
        if (count($mdt_buttons)) {
            printf('<div class="mdt-action-buttons">%s</div>', implode(' ', $mdt_buttons));
        }
    }