]> git.mxchange.org Git - friendica.git/commitdiff
Redo some changes
authorMichael <heluecht@pirati.ca>
Tue, 5 Nov 2019 20:28:35 +0000 (20:28 +0000)
committerMichael <heluecht@pirati.ca>
Tue, 5 Nov 2019 20:28:35 +0000 (20:28 +0000)
src/Module/Pinned.php [deleted file]
static/dbstructure.config.php
static/routes.config.php

diff --git a/src/Module/Pinned.php b/src/Module/Pinned.php
deleted file mode 100644 (file)
index 590bda1..0000000
+++ /dev/null
@@ -1,60 +0,0 @@
-<?php
-
-namespace Friendica\Module;
-
-use Friendica\BaseModule;
-use Friendica\Model\Item;
-
-/**
- * Toggle pinned items
- */
-class Pinned extends BaseModule
-{
-       public static function rawContent($parameters)
-       {
-               $a = self::getApp();
-               $pinned = 0;
-               $itemId = null;
-
-               if (!local_user()) {
-                       exit();
-               }
-
-               // @TODO: Replace with parameter from router
-               if ($a->argc > 1) {
-                       $itemId = intval($a->argv[1]);
-               }
-
-               if (!$itemId) {
-                       exit();
-               }
-
-               $item = Item::selectFirstForUser(local_user(), ['pinned'], ['uid' => local_user(), 'id' => $itemId]);
-               if (empty($item)) {
-                       exit();
-               }
-
-               if (!intval($item['pinned'])) {
-                       $pinned = 1;
-               }
-
-               Item::update(['pinned' => $pinned], ['id' => $itemId]);
-
-               // See if we've been passed a return path to redirect to
-               $returnPath = $_REQUEST['return'] ?? '';
-               if ($returnPath) {
-                       $rand = '_=' . time();
-                       if (strpos($returnPath, '?')) {
-                               $rand = "&$rand";
-                       } else {
-                               $rand = "?$rand";
-                       }
-
-                       $a->internalRedirect($returnPath . $rand);
-               }
-
-               // the json doesn't really matter, it will either be 0 or 1
-               echo json_encode($pinned);
-               exit();
-       }
-}
index 65e0b26a6a4bafb1951015f275d50bc450b41cbb..53f8a8ed44b8b1a3a36b8e057ec5bfcadedb5b7a 100755 (executable)
@@ -34,7 +34,7 @@
 use Friendica\Database\DBA;
 
 if (!defined('DB_UPDATE_VERSION')) {
-       define('DB_UPDATE_VERSION', 1324);
+       define('DB_UPDATE_VERSION', 1323);
 }
 
 return [
@@ -1384,8 +1384,7 @@ return [
                        "iid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "primary" => "1", "relation" => ["item" => "id"], "comment" => "Item id"],
                        "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "primary" => "1", "relation" => ["user" => "uid"], "comment" => "User id"],
                        "hidden" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Marker to hide an item from the user"],
-                       "ignored" => ["type" => "boolean", "comment" => "Ignore this thread if set"],
-                       "pinned" => ["type" => "boolean", "comment" => "The item is pinned on the profile page"]
+                       "ignored" => ["type" => "boolean", "comment" => "Ignore this thread if set"]
                ],
                "indexes" => [
                        "PRIMARY" => ["uid", "iid"]
index 339860afe636588723491aca074d94b0fa5dea39..1f2fe0ad1b98727e4bf1a58d5e8e2656b2cf38ef 100644 (file)
@@ -179,9 +179,8 @@ return [
                '/{type}/{customize}/{name}' => [Module\Photo::class, [R::GET]],
        ],
 
-       '/pinned/{item:\d+}' => [Module\Pinned::class,       [R::GET]],
-       '/pretheme'          => [Module\ThemeDetails::class, [R::GET]],
-       '/probe'             => [Module\Debug\Probe::class,  [R::GET]],
+       '/pretheme' => [Module\ThemeDetails::class, [R::GET]],
+       '/probe'    => [Module\Debug\Probe::class,  [R::GET]],
 
        '/profile' => [
                '/{nickname}'                                                 => [Module\Profile::class,          [R::GET]],