streams/Zotlabs/Widget/Photo_albums.php

32 lines
760 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;
2022-01-25 01:26:12 +00:00
use Zotlabs\Lib\Channel;
2020-03-04 02:00:20 +00:00
2017-03-16 03:56:12 +00:00
require_once('include/photos.php');
2021-12-02 23:02:31 +00:00
class Photo_albums
{
2017-03-16 03:56:12 +00:00
2021-12-02 23:02:31 +00:00
public function widget($arr)
{
2017-03-16 03:56:12 +00:00
2021-12-02 23:02:31 +00:00
if (!App::$profile['profile_uid']) {
return EMPTY_STR;
}
2017-03-16 03:56:12 +00:00
2022-01-25 01:26:12 +00:00
$channel = Channel::from_id(App::$profile['profile_uid']);
2017-03-16 03:56:12 +00:00
2021-12-02 23:02:31 +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
2021-12-02 23:02:31 +00:00
$sortkey = ((array_key_exists('sortkey', $arr)) ? $arr['sortkey'] : 'display_path');
$direction = ((array_key_exists('direction', $arr)) ? $arr['direction'] : 'asc');
2017-03-16 03:56:12 +00:00
2021-12-02 23:02:31 +00:00
return photos_album_widget($channel, App::get_observer(), $sortkey, $direction);
}
2017-03-16 03:56:12 +00:00
}