当前位置: 首页>>代码示例>>PHP>>正文


PHP Notification::get方法代码示例

本文整理汇总了PHP中Notification::get方法的典型用法代码示例。如果您正苦于以下问题:PHP Notification::get方法的具体用法?PHP Notification::get怎么用?PHP Notification::get使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Notification的用法示例。


在下文中一共展示了Notification::get方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: testGet

 /**
  * @covers ::get
  */
 public function testGet()
 {
     $mockdb = new \TMT\MockDB();
     $mockdb->expectPrepare("SELECT * FROM notifications WHERE guid=:guid");
     $mockdb->expectExecute(array(':guid' => "guid1"));
     $mockdb->setReturnData(array((object) array("guid" => "guid1", "timestamp" => "2000-01-01 00:00:00", "message" => "message", "area" => "areaguid", "type" => "type1")));
     $expected = new \TMT\model\Notification(array("guid" => "guid1", "timestamp" => "2000-01-01 00:00:00", "message" => "message", "area" => "areaguid", "type" => "type1"));
     $accessor = new Notification($mockdb);
     $actual = $accessor->get("guid1");
     $this->assertEquals($expected, $actual);
     $mockdb->verify();
 }
开发者ID:byu-oit-ssengineering,项目名称:team-managment-tool,代码行数:15,代码来源:NotificationTest.php

示例2: testNotification

 public function testNotification()
 {
     $event = new WelcomeEvent("Welcome!", $this->player);
     $this->notification = Notification::newNotification($this->player->getId(), Events::WELCOME, $event);
     $this->assertEquals($event, $this->notification->getEvent());
     $this->assertEquals(Events::WELCOME, $this->notification->getCategory());
     $this->assertEquals($this->player->getId(), $this->notification->getReceiver()->getId());
     $this->assertFalse($this->notification->isRead());
     $this->notification->markAsRead();
     $this->assertTrue($this->notification->isRead());
     // Refresh the notification from the database
     $this->notification = Notification::get($this->notification->getId());
     $this->assertTrue($this->notification->isRead());
 }
开发者ID:blast007,项目名称:bzion,代码行数:14,代码来源:NotificationTest.php

示例3: view

 /**
  * Replace the default $this->load->view() method
  * with our own, so we can use Smarty!
  *
  * This method works identically to CI's default method,
  * in that you should pass parameters to it in the same way.
  *
  * @access  public
  * @param   string  The template path name.
  * @param   array   An array of data to convert to variables.
  * @param   bool    Set to TRUE to return the loaded template as a string.
  * @return  mixed   If $return is TRUE, returns string. If not, returns void.
  */
 public function view($template, $data = array(), $return = false)
 {
     //Assign notifications to view data aswell
     $data["notification"] = Notification::get();
     // Get the CI super object, load related library.
     $CI =& get_instance();
     $CI->load->library('smartytpl');
     // Add extension to the filename if it's not there.
     $ext = '.' . $CI->config->item('smarty_template_ext');
     if (substr($template, -strlen($ext)) !== $ext) {
         $template .= $ext;
     }
     // Make sure the file exists first.
     if (!$CI->smartytpl->templateExists($template)) {
         show_error('Unable to load the template file: ' . $template);
     }
     // Assign any variables from the $data array.
     $CI->smartytpl->assign_variables($data);
     // Assign CI instance to be available in templates as $ci
     $CI->smartytpl->assignByRef('ci', $CI);
     /*
         Smarty has two built-in functions to rendering templates: display()
         and fetch(). We're going to use only fetch(), since we want to take
         the template contents and either return them or add them to
         CodeIgniter's output class. This lets us optionally take advantage
         of some of CI's built-in output features.
     */
     $output = $CI->smartytpl->fetch($template);
     /*
         Reset notification class
     */
     Notification::reset();
     // Return the output if the return value is TRUE.
     if ($return === true) {
         return $output;
     }
     // Otherwise append to output just like a view.
     $CI->output->append_output($output);
 }
开发者ID:kukua,项目名称:kukua-dashboard,代码行数:52,代码来源:MyLoader.php

示例4:

?tag=<?php 
        echo Notification::get('tag');
    }
    ?>
"><?php 
    echo $parent_page['title'];
    ?>
</a>&nbsp;<span>&rarr;</span>&nbsp;<a href="<?php 
    echo Site::url() . $page['parent'] . '/' . $page['slug'];
    ?>
"><?php 
    echo $page['title'];
    ?>
</a>
<?php 
} else {
    ?>
    <a href="<?php 
    echo Site::url() . "/" . $page['slug'];
    if (Notification::get('tag')) {
        ?>
?tag=<?php 
        echo Notification::get('tag');
    }
    ?>
"><?php 
    echo $page['title'];
    ?>
</a>
<?php 
}
开发者ID:cmroanirgo,项目名称:monstra,代码行数:31,代码来源:breadcrumbs.view.php

示例5: foreach

        </div>

        <div class="install-block <?php 
if (Request::get('action') && Request::get('action') == 'install') {
} else {
    ?>
 hide <?php 
}
?>
">

            <ul class="list-unstyled">
            <?php 
// Monstra Notifications
if (Notification::get('errors') && count(Notification::get('errors') > 0)) {
    foreach (Notification::get('errors') as $error) {
        ?>
                 <li class="error alert alert-danger"><?php 
        echo $error;
        ?>
</li>
            <?php 
    }
}
?>
            </ul>

        <div class="well">
            <form action="install.php?action=install" method="post">
                <input type="hidden" name="php" value="<?php 
echo $errors['php'];
开发者ID:Repkit,项目名称:monstra,代码行数:31,代码来源:install.php

示例6: foreach

 */
require_once "init.inc.php";
if (defined("NOTIFICATIONS_ACTIVE") && NOTIFICATIONS_ACTIVE) {
    require_once "Models/notifications/NotificationUser.class.php";
    require_once "Models/notifications/Notification.class.php";
    $query = "SELECT `nuser_id` FROM `notification_users` \n\t\t\t\tWHERE `next_notification_date` <> 0 \n\t\t\t\tAND `next_notification_date` < " . $db->qstr(time()) . "\n\t\t\t\tAND `notify_active` = 1";
    $nuser_ids = $db->GetAll($query);
    if ($nuser_ids) {
        foreach ($nuser_ids as $nuser_id) {
            $nuser_id = $nuser_id["nuser_id"];
            $notification_user = NotificationUser::getByID($nuser_id);
            if ($notification_user) {
                $query = "SELECT `notification_id` FROM `notifications` \n\t\t\t\t\t\t\tWHERE `nuser_id` = " . $db->qstr($nuser_id) . "\n\t\t\t\t\t\t\tAND `sent` = 0";
                $notification_ids = $db->GetAll($query);
                if ($notification_ids) {
                    if ($notification_user->getDigestMode()) {
                        $notification = Notification::addDigest($nuser_id);
                        $notification->send();
                    } else {
                        foreach ($notification_ids as $notification_id) {
                            $notification_id = $notification_id["notification_id"];
                            $notification = Notification::get($notification_id);
                            $notification->send();
                        }
                    }
                }
                $notification_user->clearNextNotificationDate();
            }
        }
    }
}
开发者ID:nadeemshafique,项目名称:entrada-1x,代码行数:31,代码来源:send-queued-notifications.php

示例7: onNotificationServerEvent

 /**
  * Pushes or emails a new notification to the user
  *
  * @param array $event The event data we received from the web server
  */
 private function onNotificationServerEvent($event)
 {
     $notification = \Notification::get($event->data->notification);
     // Whether we've notified that player in real time - if he isn't online
     // at the moment, we'll send an e-mail to him
     $active = false;
     foreach ($this->clients as $client) {
         if ($client->Player->getId() == $event->data->receiver) {
             $this->send($client, $event);
             $active = true;
         }
     }
     if (!$active) {
         $player = $notification->getReceiver();
         $this->log("<fg=green>E-mailing player {$player->getId()} ({$player->getUsername()})</>");
         $this->subscriber->emailNotification($notification);
     }
 }
开发者ID:blast007,项目名称:bzion,代码行数:23,代码来源:EventPusher.php

示例8: __

echo Form::label('page_keywords', __('Keywords', 'pages')) . Form::input('page_keywords', $keywords_to_edit, array('class' => 'form-control'));
?>
        </div>
        <div class="form-group">
        <?php 
echo Form::label('page_description', __('Description', 'pages')) . Form::textarea('page_description', $description_to_edit, array('class' => 'form-control'));
?>
        </div>
        <div class="form-group">
        <?php 
echo Form::label('robots', __('Search Engines Robots', 'pages')) . Html::br(1) . 'no Index' . Html::nbsp() . Form::checkbox('robots_index', 'index', $post_robots_index) . Html::nbsp(2) . 'no Follow' . Html::nbsp() . Form::checkbox('robots_follow', 'follow', $post_robots_follow);
?>
        </div>
    </div>
    <div class="tab-pane <?php 
if (Notification::get('settings')) {
    ?>
active<?php 
}
?>
" id="settings">        
            <?php 
if (Request::get('name') == 'error404') {
    echo Form::hidden('pages', $parent_page);
} else {
    ?>
            <div class="form-group">
            <?php 
    echo Form::label('pages', __('Parent', 'pages')) . Form::select('pages', $pages_array, $parent_page, array('class' => 'form-control'));
    ?>
            </div>
开发者ID:rowena-altastratus,项目名称:altastratus,代码行数:31,代码来源:edit.view.php

示例9:

Action::run('admin_header');
?>

    <!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
    <!--[if lt IE 9]>
      <script src="//cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7/html5shiv.js"></script>
      <script src="//cdnjs.cloudflare.com/ajax/libs/respond.js/1.4.2/respond.js"></script>
    <![endif]-->
    </head>
    <body class="login-body">

        <?php 
// Monstra Notifications
Notification::get('success') and Alert::success(Notification::get('success'));
Notification::get('warning') and Alert::warning(Notification::get('warning'));
Notification::get('error') and Alert::error(Notification::get('error'));
?>

        <div class="container form-signin">

            <div class="text-center"><a class="brand" href="<?php 
echo Option::get('siteurl');
?>
/admin"><img src="<?php 
echo Option::get('siteurl');
?>
/public/assets/img/monstra-logo-256px.png" alt="monstra" /></a></div>
            <div class="administration-area well">
                <div>
                    <form method="post">
                        <div class="form-group">
开发者ID:rowena-altastratus,项目名称:altastratus,代码行数:31,代码来源:login.template.php

示例10: foreach

<?php

require_once "../initialize.php";
$html = "";
if ($session->is_logged_in()) {
    if (isset($_GET['touserid'])) {
        $notifications = Notification::get($session->user_id);
        if (count($notifications) > 0) {
            foreach ($notifications as $notification) {
                $user = User::get_by_id($notification->fromuserid);
                if ($user) {
                    $html .= "<tr>";
                    $html .= "  <td style='width:50px;'>";
                    $html .= "  \t<img style='height:50px;' src='data:image/jpeg;base64, " . $user->picture . "' />";
                    $html .= "  </td>";
                    $html .= "  <td>";
                    $title = "";
                    $done = false;
                    if ($notification->itemtype == "friend") {
                        $title = "Friend Request";
                        $friendobject = Friend::get_by_id($notification->itemid);
                        if (!$friendobject) {
                            $notification->delete();
                            continue;
                        } else {
                            if ($friendobject->pending == 0) {
                                $done = true;
                            }
                        }
                    } else {
                        if ($notification->itemtype == "schooluser" && $notification->pending == 1) {
开发者ID:NemOry,项目名称:Skoolyf,代码行数:31,代码来源:getnotifications.php

示例11: Notification

				<div id="sidebar" class="left">
					<ul>
						<li class="selected-option"><a href="./">Recent Activity</a></li>
						<li><a href="friend-requests.php">Friend Requests</a></li>
						<li><a href="my-friends.php">Friends</a></li>
						<li><a href="search.php">Search</a></li>
					</ul>
				</div>
				<div id="main-container" class="page">
					<h2 class="title">Recent Activity</h2>
					<?php 
    include 'includes/alerts.php';
    ?>
					<?php 
    $activity = new Notification();
    if ($activity->get($user->data()->id)) {
        $notifications = $activity->notifications();
        ?>
						<?php 
        foreach ($notifications as $notification) {
            ?>
							<div class="notification">
								<div class="picture">
									<a href="profile.php?user=<?php 
            echo $notification['username'];
            ?>
"><img src="<?php 
            echo $notification['profilePicture'];
            ?>
"></a>
								</div>
开发者ID:shh4,项目名称:social-network,代码行数:31,代码来源:index.php

示例12: __

<div class="row">	
	<div class="col-md-12">		
	    <?php 
// Monstra Notifications
$error = Notification::get('error') ?: '';
$error != '' and print '<div class="error margin-bottom-1">' . $error . '</div>';
?>
    </div>
</div>
<div class="row">	
	<div class="col-md-3">
		<form method="post">
		    <?php 
echo Form::hidden('csrf', Security::token());
?>
		    <div class="form-group">
		    	<label><?php 
echo __('Username', 'users');
?>
</label>
		    	<input name="username" type="text" class="form-control">
		    </div>    
		    <div class="form-group">
			    <label><?php 
echo __('Password', 'users');
?>
</label>
			    <input name="password" type="password" class="form-control">
			</div>
			<div class="form-group">
				<input name="login_submit" class="btn btn-primary" type="submit" value="<?php 
开发者ID:rowena-altastratus,项目名称:altastratus,代码行数:31,代码来源:login.view.php

示例13: __

<div class="row">	
	<div class="col-md-12">		
	    <?php 
// Monstra Notifications
$success = Notification::get('success') ?: '';
$success != '' and print '<div class="success margin-bottom-1">' . $success . '</div>';
?>
    </div>
</div>
<div class="row">
	<div class="col-md-3">
		<form method="post">

		<?php 
echo Form::hidden('csrf', Security::token());
?>

		<div class="form-group">
			<label><?php 
echo __('Username', 'users');
?>
</label>
			<input type="text" value="<?php 
echo $user_login;
?>
" name="login" class="form-control">
			<?php 
if (isset($errors['users_user_doesnt_exists'])) {
    echo Html::nbsp(3) . '<span class="error">' . $errors['users_user_doesnt_exists'] . '</span>';
}
if (isset($errors['users_empty_field'])) {
开发者ID:rowena-altastratus,项目名称:altastratus,代码行数:31,代码来源:password_reset.view.php

示例14: if

			if(empty($error_msg)){
				goBack();
			}

		}else{
			$error_msg .= "Error adding Notification!\n";
			debug_message($notification->getLastError());
		}
	}
}else if($_REQUEST['mode'] == 'edit'){
	$title = "Edit Notification";
	if(empty($_REQUEST['id'])){
		$error_msg .= "Error: No ID specified!\n";
	}else{
		if(!$notification->get($_REQUEST['id'])){
			$error_msg .= "Error retrieving notification information!\n";
			debug_message($notification->getLastError());
		}
	}

	if($_POST['save']){
		$notification->updateFromAssocArray($_POST);
		if($notification->update()){
			if(!empty($_POST['new_address'])){
				if($notification->addAddress($_POST['new_address']) === FALSE){
					$error_msg .= "Error adding new address to notification!";
					debug_message($notification->getLastError());
				}
			}
开发者ID:nanoprime,项目名称:sureinvoice,代码行数:29,代码来源:notification.php


注:本文中的Notification::get方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。