function js_notification($type, $message)
{
    $fadeout = js_bool($type != 'error');
    ob_start();
    ?>
	
	$('.notifications').notify({
		
	    message: { html: true, text: '${message}' },
	    closable: true,
	    type: '${type}',
	    fadeOut: {enabled: ${fadeout}, delay: 5000}
	    
	}).show();
	
<?php 
    return js_replace_vars(ob_get_clean(), get_defined_vars());
}
示例#2
0
文件: jsrt.php 项目: michaelprem/phc
 public static function sort_helper($a, $b)
 {
     if ($a == jsrt::$undefined) {
         if ($b == jsrt::$undefined) {
             return 0;
         } else {
             return 1;
         }
     } else {
         if ($b == jsrt::$undefined) {
             return -1;
         }
     }
     if (jsrt::$sortfn == NULL or jsrt::$sortfn == jsrt::$undefined) {
         $a = $a->toStr();
         $b = $b->toStr();
         if (js_bool(jsrt::expr_lt($a, $b))) {
             return -1;
         }
         if (js_bool(jsrt::expr_gt($a, $b))) {
             return 1;
         }
         return 0;
     } else {
         return jsrt::$sortfn->_call($a, $b)->toInteger()->value;
     }
 }