<?php

namespace FSPoster\App\Controller\Popups;


use FSPoster\App\Providers\DB;
use FSPoster\App\Providers\Helper;
use FSPoster\App\Providers\Request;

trait Share
{

	public function share_feeds()
	{
		$postId = Request::post('post_id' , '0' , 'num');
		if( !($postId > 0) )
		{
			exit();
		}

		$feeds = DB::fetchAll('feeds' , [
			'blog_id'       =>  Helper::getBlogId(),
			'post_id'       =>  $postId,
			'is_sended'     =>  0
		]);

		Helper::modalView('other.share_feeds' , [
			'feeds' =>  $feeds
		]);
	}

	public function share_saved_post()
	{
		$postId = Request::post('post_id' , '0' , 'num');

		if( !($postId > 0) )
		{
			exit();
		}

		Helper::modalView('other.share_saved_post' , [
			'postId'    =>  $postId
		]);
	}

}
