예제 #1
0
 /**
  * Clears the Notices queue
  */
 public function action_clear()
 {
     Notices::clear(NULL, NULL, NULL);
     echo '<p>Number of notices in queue: ' . Notices::count() . '</p>';
 }
예제 #2
0
		<script type="text/javascript">
			$(function(){
				$('#add_notice').click(function(){
					var type = $('#type').val();
					var message = $('#message').val();
					var persist = $('#persist').val();
					persist = (persist == 'TRUE');
					$('#notices-container').add_notice(type, message, persist);
				});
			});
		</script>
	</head>
	<body>
		<h1>Notices Demo</h1>
		<p>Number of notices in queue <em>before</em> display: <?php 
echo Notices::count();
?>
</p>

		<div id="notices-container">
			<?php 
echo Notices::display();
?>
		</div>

		<br />

		<fieldset>
			<legend><h2>Add a Notice via AJAX</h2></legend>
			<p>
				<label for="type">Notice Type (can be anything):</label>