Beispiel #1
0
						<span class="b-blog-entry_b-info_b-control">
							<a href="http://<?php 
    echo TemplateHelper::getSiteUrl();
    ?>
/fav/toggle/<?php 
    echo $post['board_id'];
    ?>
/<?php 
    echo $post['id'];
    ?>
/" class="js-favorite-button">
								<img src="http://<?php 
    echo TemplateHelper::getSiteUrl();
    ?>
/ico/favorites<?php 
    if (!Board_FavoritesModel::IsFavoritePost($post['board_id'], $post['id'])) {
        ?>
-false<?php 
    }
    ?>
.png" width="16" height="16" alt="" id="post_<?php 
    echo $post['board_id'];
    ?>
_<?php 
    echo $post['id'];
    ?>
_favorite" />
							</a>
							<a href="http://<?php 
    echo TemplateHelper::getSiteUrl();
    ?>
Beispiel #2
0
 /**
  * Действие: добавление/удаление из избранного (ajax):
  */
 public function toggleFavoriteAjaxAction(Application $application)
 {
     $state = Board_FavoritesModel::ToggleFavoritePost($_GET['board'], $_GET['id']);
     $key = Session::getInstance()->getKey();
     if (Board_FavoritesModel::IsFavoritePost($_GET['board'], $_GET['id'])) {
         Board_BoardModel::subscribeThread($key, $_GET['board'] . '_' . $_GET['id']);
     } else {
         Board_BoardModel::unsubscribeThread($key, $_GET['board'] . '_' . $_GET['id']);
     }
     return array('favorite' => $state);
 }