public static function process($fetch = false)
 {
     $config = Config::get('profiler');
     if ($config['useForensics'] != true) {
         return null;
     }
     // The QuickProfiller was enabled into Configuration.
     $profiler = new static();
     return $profiler->display($fetch);
 }
    /**
     * WP Hook, Instantiate UI
     */
    static function addMenu()
    {
        $url = get_bloginfo('url') . '/wp-admin/index.php?page=pb_catalog';
        $view_url = static::viewCatalogUrl();
        // Verifies $_REQUEST['user_id']
        $edit_url = $url . '&action=edit_profile';
        if (isset($_REQUEST['user_id'])) {
            $edit_url .= '&user_id=' . $_REQUEST['user_id'];
        }
        $list_table = new static();
        $list_table->prepare_items();
        ?>
		<div class="wrap">
			<div class="postbox">
				<div class="inside">
					<h4><?php 
        _e('Organize your public Catalog page.', 'pressbooks');
        ?>
</h4>
					<h5><span data-icon="a" class="show-hide-icon"></span><?php 
        _e('Show/Hide books', 'pressbooks');
        ?>
</h5>
					<p><?php 
        _e(sprintf('To display a book in your catalog choose "%s" under Catalog Status. ', '<strong>' . __('Show in Catalog', 'pressbooks') . '</strong>'), 'pressbooks');
        ?>
<br>
					<?php 
        _e(sprintf('To hide a book in your catalog choose "%s" under Catalog Status.', '<strong>' . __('Hide in Catalog', 'pressbooks') . '</strong>'), 'pressbooks');
        ?>
</p>

					<h5><span data-icon="g" class="sort-icon"></span><?php 
        _e('Catalog sorting', 'pressbooks');
        ?>
</h5>
					<p><?php 
        _e(sprintf('To add sorting ability, add your Tag names to your <a href="%s">Catalog Profile</a> page (ex: Authors, Book Genre), then add the appropriate tags to each individual book.', $edit_url), 'pressbooks');
        ?>
</p>

					<h5><span data-icon="f" class="share-icon"></span><?php 
        _e('Share your catalog', 'pressbooks');
        ?>
</h5>
					<p><?php 
        _e('The public link to your catalog page', 'pressbooks');
        ?>
: <a href="<?php 
        echo $view_url;
        ?>
"><?php 
        echo $view_url;
        ?>
</a></p>
				</div>
			</div><!-- end .postbox -->
			
			<h2><?php 
        echo isset($_REQUEST['user_id']) ? ucfirst(get_userdata(absint($_REQUEST['user_id']))->user_login) : __('My Catalog', 'pressbooks');
        ?>
				<a href="<?php 
        echo $edit_url;
        ?>
" class=" page-title-action"><?php 
        _e('Edit Profile', 'pressbooks');
        ?>
</a>
				<a href="<?php 
        echo $view_url;
        ?>
" class=" page-title-action"><?php 
        _e('Visit Catalog', 'pressbooks');
        ?>
</a>
			</h2>

			<form id="books-search" method="get" action="<?php 
        echo $url;
        ?>
" >
				<input type="hidden" name="page" value="<?php 
        echo esc_attr($_REQUEST['page']);
        ?>
" />
				<?php 
        if (@$_REQUEST['user_id']) {
            ?>
<input type="hidden" name="user_id" value="<?php 
            echo esc_attr($_REQUEST['user_id']);
            ?>
" /><?php 
        }
        ?>
				<?php 
        $list_table->search_box(__('Search', 'pressbooks'), 'search_id');
        ?>
			</form>

			<form id="books-filter" method="post" action="<?php 
        echo $url;
        ?>
" >
				<input type="hidden" name="page" value="<?php 
        echo esc_attr($_REQUEST['page']);
        ?>
" />
				<?php 
        if (@$_REQUEST['user_id']) {
            ?>
<input type="hidden" name="user_id" value="<?php 
            echo esc_attr($_REQUEST['user_id']);
            ?>
" /><?php 
        }
        ?>

				<div id="add-by-url">
					<input type="text" id="add_book_by_url" name="add_book_by_url" /><label for="add_book_by_url">
						<input type="submit" name="" id="search-submit" class="button" value="<?php 
        esc_attr_e('Add By URL', 'pressbooks');
        ?>
">
					</label>
					&nbsp;
				</div>

				<?php 
        $list_table->display();
        ?>
			</form>

		</div>
	<?php 
    }
Example #3
0
 public static function end()
 {
     $mtime = microtime();
     $mtime = explode(" ", $mtime);
     $end = $mtime[1] + $mtime[0];
     static::$display = number_format(round($end - static::$start_time, 18), 18);
 }