aboutsummaryrefslogblamecommitdiffstats
path: root/Zotlabs/Widget/Pubtagcloud.php
blob: 8119d0c7340af4cb02d1e04bde006b6bb1e1b96c (plain) (tree)
1
2
3
4
5
6
7
8
9

     




                                                         

                         

                       








                                                                                                 
                                                                




                                       
                                                                                                   
 


                                    
 
                                                                                                    
 
                                                                                      
 
                                                                                          
 
                                                                                                



                          
<?php

/**
 *   * Name: Public stream tags
 *   * Description: Display public stream tags in a cloud
 */

namespace Zotlabs\Widget;

use Zotlabs\Lib\Config;

class Pubtagcloud {

	function widget($arr) {

		$trending = ((array_key_exists('trending',$arr)) ? intval($arr['trending']) : 0);
	    if((observer_prohibited(true))) {
            return EMPTY_STR;
        }

        if(! intval(Config::Get('system','open_pubstream',1))) {
            if(! get_observer_hash()) {
                return EMPTY_STR;
            }
        }

		$net_firehose  = ((Config::Get('system','disable_discover_tab',1)) ? false : true);

		if(!$net_firehose) {
			return '';
		}

		$site_firehose = ((intval(Config::Get('system','site_firehose',0))) ? true : false);

		$safemode = get_xconfig(get_observer_hash(),'directory','safemode',1);

		$limit = ((array_key_exists('limit', $arr)) ? intval($arr['limit']) : 75);

		return pubtagblock($net_firehose, $site_firehose, $limit, $trending, $safemode);

		return '';
	}
}