]> git.mxchange.org Git - friendica.git/blobdiff - src/Model/FileTag.php
Merge remote-tracking branch 'upstream/develop' into issue-8546
[friendica.git] / src / Model / FileTag.php
index ffcea7e281dc34b83665dde33fbd463c4ed3a522..3539f2b96d9b0f019fc48444b7516cc285c7de45 100644 (file)
@@ -1,16 +1,32 @@
 <?php
 /**
- * @file src/Model/FileTag.php
+ * @copyright Copyright (C) 2020, Friendica
+ *
+ * @license GNU AGPL version 3 or any later version
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
+ *
  */
 
 namespace Friendica\Model;
 
-use Friendica\Core\L10n;
 use Friendica\Database\DBA;
 use Friendica\DI;
+use Friendica\Model\Term;
 
 /**
- * @brief This class handles FileTag related functions
+ * This class handles FileTag related functions
  *
  * post categories and "save to file" use the same item.file table for storage.
  * We will differentiate the different uses by wrapping categories in angle brackets
@@ -20,7 +36,7 @@ use Friendica\DI;
 class FileTag
 {
        /**
-        * @brief URL encode <, >, left and right brackets
+        * URL encode <, >, left and right brackets
         *
         * @param string $s String to be URL encoded.
         *
@@ -32,7 +48,7 @@ class FileTag
        }
 
        /**
-        * @brief URL decode <, >, left and right brackets
+        * URL decode <, >, left and right brackets
         *
         * @param string $s The URL encoded string to be decoded
         *
@@ -44,7 +60,7 @@ class FileTag
        }
 
        /**
-        * @brief Query files for tag
+        * Query files for tag
         *
         * @param string $table The table to be queired.
         * @param string $s     The search term
@@ -124,7 +140,7 @@ class FileTag
        }
 
        /**
-        * @brief      Get file tags from list
+        * Get file tags from list
         *
         * ex. given music,video return <music><video> or [music][video]
         * @param string $list A comma delimited list of tags.
@@ -141,7 +157,7 @@ class FileTag
        }
 
        /**
-        * @brief      Get list from file tags
+        * Get list from file tags
         *
         * ex. given <music><video>[friends], return music,video or friends
         * @param string $file File tags
@@ -156,7 +172,7 @@ class FileTag
        }
 
        /**
-        * @brief Update file tags in PConfig
+        * Update file tags in PConfig
         *
         * @param int    $uid      Unique Identity.
         * @param string $file_old Categories previously associated with an item
@@ -180,11 +196,11 @@ class FileTag
                        if ($type == 'file') {
                                $lbracket = '[';
                                $rbracket = ']';
-                               $termtype = TERM_FILE;
+                               $termtype = Term::FILE;
                        } else {
                                $lbracket = '<';
                                $rbracket = '>';
-                               $termtype = TERM_CATEGORY;
+                               $termtype = Term::CATEGORY;
                        }
 
                        $filetags_updated = $saved;
@@ -234,7 +250,7 @@ class FileTag
        }
 
        /**
-        * @brief Add tag to file
+        * Add tag to file
         *
         * @param int    $uid     Unique identity.
         * @param int    $item_id Item identity.
@@ -262,14 +278,14 @@ class FileTag
                                DI::pConfig()->set($uid, 'system', 'filetags', $saved . '[' . self::encode($file) . ']');
                        }
 
-                       info(L10n::t('Item filed'));
+                       info(DI::l10n()->t('Item filed'));
                }
 
                return true;
        }
 
        /**
-        * @brief Remove tag from file
+        * Remove tag from file
         *
         * @param int     $uid     Unique identity.
         * @param int     $item_id Item identity.