Example #1
0
 public static function create_flash($type, $messages = "")
 {
     if (empty($messages)) {
         return;
     }
     if (is_string($messages)) {
         Yii::app()->user->setFlash($type, $messages);
     } else {
         if (is_array($messages)) {
             foreach ($messages as $key => $message) {
                 if (is_array($message)) {
                     $message = implode("<br/>", $message);
                 }
                 $message = StdLib::is_programmer() ? $key . ": " . $message : $message;
                 Yii::app()->user->setFlash($type, $message);
             }
         }
     }
 }
Example #2
0
<?php

# Force logout (unless programmer)
if (!Yii::app()->user->isGuest and !StdLib::is_programmer()) {
    Yii::app()->user->logout();
}
?>
<link rel="stylesheet" type="text/css" href="<?php 
echo WEB_LIBRARY_PATH;
?>
/jquery/modules/countdown/jquery.countdown.css" />
<script src="<?php 
echo WEB_LIBRARY_PATH;
?>
/jquery/modules/countdown/jquery.plugin.js" ></script>
<script src="<?php 
echo WEB_LIBRARY_PATH;
?>
/jquery/modules/countdown/jquery.countdown.js" ></script>
<script language="JavaScript">
jQuery(document).ready(function($){
	var austDay = new Date("<?php 
echo date("Y-m-d") . " 17:00:00";
?>
");
	$('#defaultCountdown').countdown({until: austDay, format: 'YOWDHMS'});
});
</script>

<style>
#defaultCountdown {
Example #3
0
 public function actionRunOnce()
 {
     if (!StdLib::is_programmer()) {
         Yii::app()->user->setFlash("error", "You do not have access to this page.");
         $this->redirect('index');
         exit;
     }
     $this->render("runonce");
 }