use Friendica\Database\DBA;
use Friendica\DI;
use Friendica\Model\Contact;
-use Friendica\Model\FileTag;
use Friendica\Model\Group;
use Friendica\Model\Item;
+use Friendica\Model\Post;
use Friendica\Util\DateTimeFormat;
use Friendica\Util\Temporal;
return '';
}
- $saved = DI::pConfig()->get(local_user(), 'system', 'filetags');
- if (!strlen($saved)) {
- return;
- }
-
$terms = [];
- foreach (FileTag::fileToArray($saved) as $savedFolderName) {
+ foreach (Post\Category::getArray(local_user(), Post\Category::FILE) as $savedFolderName) {
$terms[] = ['ref' => $savedFolderName, 'name' => $savedFolderName];
}
-
- usort($terms, function ($a, $b) {
- return strcmp($a['name'], $b['name']);
- });
return self::filter(
'file',
return '';
}
- $saved = DI::pConfig()->get($uid, 'system', 'filetags');
- if (!strlen($saved)) {
- return;
- }
-
$terms = array();
- foreach (FileTag::fileToArray($saved, 'category') as $savedFolderName) {
+ foreach (Post\Category::getArray(local_user(), Post\Category::CATEGORY) as $savedFolderName) {
$terms[] = ['ref' => $savedFolderName, 'name' => $savedFolderName];
}
'$cutoff' => $cutoff,
'$url' => $url,
'$dates' => $ret,
+ '$showless' => DI::l10n()->t('show less'),
'$showmore' => DI::l10n()->t('show more')
]);
return self::filter('accounttype', DI::l10n()->t('Account Types'), '',
DI::l10n()->t('All'), $base, $accounts, $accounttype);
}
-
- /**
- * Display the accounts sidebar
- * The account type is added to the path
- *
- * @param string $base Basepath
- * @param string $accounttype Acount type (person, organisation, news, community)
- * @return string
- */
- public static function accounts(string $base, string $accounttype)
- {
- return Renderer::replaceMacros(Renderer::getMarkupTemplate('widget/accounts.tpl'), [
- '$title' => DI::l10n()->t('Account Types'),
- '$content' => $base,
- '$accounttype' => ($accounttype ?? ''),
- '$all' => DI::l10n()->t('All'),
- '$person' => DI::l10n()->t('Persons'),
- '$organisation' => DI::l10n()->t('Organisations'),
- '$news' => DI::l10n()->t('News'),
- '$community' => DI::l10n()->t('Forums'),
- ]);
- }
}