aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs/Module/Randprof.php
blob: c38b07ead52d81357024421a6d5e2530fba72aeb (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
<?php
namespace Zotlabs\Module;

use App;
use Zotlabs\Lib\Apps;

class Randprof extends \Zotlabs\Web\Controller {

	function init() {
		if(local_channel()) {
			if(! Apps::system_app_installed(local_channel(), 'Random Channel'))
				return;
		}

		$x = random_profile();
		if($x)
			goaway(chanlink_hash($x));
	
		/** FIXME this doesn't work at the moment as a fallback */
		goaway(z_root() . '/profile');
	}

	function get() {
		if(local_channel()) {
			if(! Apps::system_app_installed(local_channel(), 'Random Channel')) {
				//Do not display any associated widgets at this point
				App::$pdl = '';

				$o = '<b>' . t('Random Channel App') . ' (' . t('Not Installed') . '):</b><br>';
				$o .= t('Visit a random channel in the $Projectname network');
				return $o;
			}
		}

	}
	
}