public function __toString() {
		return array(
			'html' => wpi_message_table_row($this->get_array()),
			'auto_open' => $this->auto_open
		);
	}	
Example #2
0
	/**
	 * Our Janky Output
	 * Only outputs if there's something to display
	 *
	 * @return void
	 */
	function wpi_deprecated_footer_output() {
		global $wpi_deprecated_log, $wpi_messages_log, $wpi_auto_expand;
	
		echo '
		<div id="wpi-banner">
			<div id="wpi-output" class="wpi-shaded" style="display: none;">
				<div id="wpi-output-wrap">

					<h2>'.__('Messages', 'wp-dev-notices').'</h2>
					<table id="wpi-message-table">
						<thead>
							<tr>
								<th class="wpi-col-lvl">'.__('Level', 'wp-dev-notices').'</th>
								<th class="wpi-col-loc">'.__('Location', 'wp-dev-notices').'</th>
								<th class="wpi-col-messg">'.__('Message', 'wp-dev-notices').'</th>
							</tr>
						</thead>
						<tbody>';
		if (count($wpi_messages_log)) {
			foreach ($wpi_messages_log as $item) {
				echo wpi_message_table_row($item);
			}
		}
		echo '
						</tbody>
					</table>';			
		
		if (count($wpi_deprecated_log)) {
			echo '
					<h2>'.__('Deprecated Items', 'wp-dev-notices').'</h2>
					<table id="wpi-deprecated-table">
						<thead>
							<tr>
								<th class="wpi-col-type">'.__('Type', 'wp-dev-notices').'</th>
								<th class="wpi-col-loc">'.__('Location', 'wp-dev-notices').'</th>
								<th class="wpi-col-repl">'.__('Replacement', 'wp-dev-notices').'</th>
								<th class="wpi-col-vers">'.__('Version', 'wp-dev-notices').'</th>
							</tr>
						</thead>
						<tbody>';
			foreach ($wpi_deprecated_log as $item) {
				if (!empty($item['function']) && !preg_match('|\(\)$|m', $item['function'])) {
					$item['function'] .= '()';
				}
				echo '
							<tr>
								<td>'.__($item['type'], 'wp-dev-notices').'</td>
								<td>'.(!empty($item['function']) ? __('Function:', 'wp-dev-notices').' '.$item['function'] : __('File:', 'wp-dev-notices').' '.$item['file']).'<br />
									'.__('In file:', 'wp-dev-notices').' '.$item['_file'].'<br />
									'.__('On line:', 'wp-dev-notices').' '.$item['_line'].'</td>
								<td>'.(!empty($item['replacement']) ? $item['replacement'] : '').(!empty($item['message']) && !empty($item['replacement']) ? '<br />' : '').(!empty($item['message']) ? $item['message'] : '').'</td>
								<td>'.(!empty($item['version']) ? $item['version'] : '').'</td>
							</tr>';
			}
			echo '
						</tbody>
					</table>';
		}
		
		echo '
				</div>
			</div>
			<div class="wpi-notice wpi-shaded">
				<p><img class="wpi-warning-icon" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAkRJREFUeNqMU01rE1EUPW9m0tgk/TTRlrS0RRFxp0ixqCvdqOBK6D+oWPo3dONWWuq6m4IrF24siFAUC7pQ0CwiSls1NqZJbfPVZOZ67swrRqTigzMz795zbs6798V8xF+ri5ghbhFTNvaSeEQ8JPY7ySb3p3gGDhaTZxz0jwsSGQmDjaLBzmeD3fcBJMBtWygq8Pa3+I5JYH70qkHjh4P2hoNYyQ3tSDqAGfHhZQKsrwB+VWYZXggLrB3YdtCcuGZQpnAv52LQGPQRCaImgh3CPe0jOeoj/4TOAsT1OE5DLdJ67IRBsWCw/sFhDmjbw6p43+6/M7ddcNB90oQa1To1JQHTPcOCLxsGraggqhTu2l/Wt+41XiAnNRxpVOvVaZFrMp5ksgycWl2NGmfRuWJa4PJFjCcA6iY15tVsskWf2vNsNot/rTxZzWboIBynV43ir8tlTCVTwMrYGNRTks5c7TKiwr49VqoXqFT4DbxToVPng1jeZAMHBqK563PPnr9i37rXuHKUq5p6RxMXcgVBPCE4PiSH2teccpSrGtW6l2iVI/LZ/a2vFdyYGDI4wgmLcCKtSJhgg4+mBd09wIs8HfuYpeaVjta9wAJ3yX4OvDkbmK1P27jeFTMY7AdGOK50msV4Hb/x0GubHKePuXsii+RDtZ79Z2i/MvdFnvUKzt0sYbqvhCvUnQ8nxOLs29PHIss/Ac4Ax4gitW3Pujy4fEJCa0lkid9Lh7RCLDdQrZmLLhIeiHj2rvzPalGnRfBLgAEAS44AhDycvGwAAAAASUVORK5CYII=" alt="Danger!" /><b class="warning">'.__('Warning', 'wp-dev-notices').'</b> <a href="#wpi-toggle" class="wpi-toggle-output">&raquo; <span>'.__('Show', 'wp-dev-notices').'</span> '.__('Notices', 'wp-dev-notices').'</a></p>
			</div>
		</div>
		<script type="text/javascript">
			show_text = "'.__('Show', 'wp-dev-notices').'";
			hide_text = "'.__('Hide', 'wp-dev-notices').'";
			auto_expand = '.($wpi_auto_expand ? 'true' : 'false').';
			'.file_get_contents(WPI_PLUGIN_DIR.'js/notices.js').'
		</script>
		<style type="text/css">
			'.file_get_contents(WPI_PLUGIN_DIR.'css/notices.css').'
		</style>';
	}