mirror of
https://github.com/friendica/friendica
synced 2025-09-09 01:26:46 +02:00
Replace deprecated string-bases Model\FileTag calls with array-based ones
This commit is contained in:
parent
6de3449cae
commit
0fadc7730c
4 changed files with 30 additions and 56 deletions
|
@ -256,7 +256,7 @@ class Widget
|
|||
* @param string $baseurl baseurl
|
||||
* @param string $selected optional, default empty
|
||||
* @return string|void
|
||||
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
|
||||
* @throws \Exception
|
||||
*/
|
||||
public static function fileAs($baseurl, $selected = '')
|
||||
{
|
||||
|
@ -269,15 +269,9 @@ class Widget
|
|||
return;
|
||||
}
|
||||
|
||||
$matches = [];
|
||||
$terms = array();
|
||||
$cnt = preg_match_all('/\[(.*?)\]/', $saved, $matches, PREG_SET_ORDER);
|
||||
if ($cnt) {
|
||||
foreach ($matches as $mtch)
|
||||
{
|
||||
$unescaped = XML::escape(FileTag::decode($mtch[1]));
|
||||
$terms[] = ['ref' => $unescaped, 'name' => $unescaped];
|
||||
}
|
||||
$terms = [];
|
||||
foreach (FileTag::fileToArray($saved) as $savedFolderName) {
|
||||
$terms[] = ['ref' => $savedFolderName, 'name' => $savedFolderName];
|
||||
}
|
||||
|
||||
return self::filter(
|
||||
|
@ -312,15 +306,9 @@ class Widget
|
|||
return;
|
||||
}
|
||||
|
||||
$matches = [];
|
||||
$terms = array();
|
||||
$cnt = preg_match_all('/<(.*?)>/', $saved, $matches, PREG_SET_ORDER);
|
||||
|
||||
if ($cnt) {
|
||||
foreach ($matches as $mtch) {
|
||||
$unescaped = XML::escape(FileTag::decode($mtch[1]));
|
||||
$terms[] = ['ref' => $unescaped, 'name' => $unescaped];
|
||||
}
|
||||
foreach (FileTag::fileToArray($saved, 'category') as $savedFolderName) {
|
||||
$terms[] = ['ref' => $savedFolderName, 'name' => $savedFolderName];
|
||||
}
|
||||
|
||||
return self::filter(
|
||||
|
|
|
@ -41,8 +41,7 @@ class SaveTag extends BaseModule
|
|||
|
||||
// return filer dialog
|
||||
$filetags = PConfig::get(local_user(), 'system', 'filetags');
|
||||
$filetags = Model\FileTag::fileToList($filetags, 'file');
|
||||
$filetags = explode(",", $filetags);
|
||||
$filetags = Model\FileTag::fileToArray($filetags);
|
||||
|
||||
$tpl = Renderer::getMarkupTemplate("filer_dialog.tpl");
|
||||
echo Renderer::replaceMacros($tpl, [
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue