streams/Zotlabs/Widget/Photo_albums.php

30 lines
655 B
PHP
Raw Normal View History

2017-03-16 03:56:12 +00:00
<?php
namespace Zotlabs\Widget;
2020-03-04 02:00:20 +00:00
use App;
2017-03-16 03:56:12 +00:00
require_once('include/photos.php');
class Photo_albums {
function widget($arr) {
2020-03-04 02:00:20 +00:00
if (! App::$profile['profile_uid']) {
return EMPTY_STR;
}
2017-03-16 03:56:12 +00:00
2020-03-04 02:00:20 +00:00
$channel = channelx_by_n(App::$profile['profile_uid']);
2017-03-16 03:56:12 +00:00
2020-03-04 02:00:20 +00:00
if ((! $channel) || (! perm_is_allowed(App::$profile['profile_uid'], get_observer_hash(), 'view_storage'))) {
return EMPTY_STR;
}
2017-03-16 03:56:12 +00:00
2020-03-04 02:00:20 +00:00
$sortkey = ((array_key_exists('sortkey',$arr)) ? $arr['sortkey'] : 'display_path');
2017-03-16 03:56:12 +00:00
$direction = ((array_key_exists('direction',$arr)) ? $arr['direction'] : 'asc');
2020-03-04 02:00:20 +00:00
return photos_album_widget($channel, App::get_observer(),$sortkey,$direction);
2017-03-16 03:56:12 +00:00
}
}