<?php
/**
- * @copyright Copyright (C) 2010-2022, the Friendica project
+ * @copyright Copyright (C) 2010-2023, the Friendica project
*
* @license GNU AGPL version 3 or any later version
*
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*
* Name: frio
- * Description: Bootstrap V3 theme. The theme is currently under construction, so it is far from finished. For further information have a look at the <a href="https://github.com/friendica/friendica/tree/develop/view/theme/frio/README.md">ReadMe</a>.
- * Version: V.0.8.5
+ * Description: Responsive theme based on a modern HTML/CSS/JavaScript framework.
+ * Version: V.1.0
* Author: Rabuzarus <https://friendica.kommune4.de/profile/rabuzarus>
+ * Maintainer: Hypolite Petovan <https://friendica.mrpetovan.com/profile/hypolite>
*/
use Friendica\App;
use Friendica\Content\Text\Plaintext;
-use Friendica\Content\Widget;
use Friendica\Core\Hook;
use Friendica\Core\Logger;
use Friendica\Core\Renderer;
use Friendica\Database\DBA;
use Friendica\DI;
-use Friendica\Model;
-use Friendica\Model\Item;
use Friendica\Model\Contact;
+use Friendica\Model\Item;
use Friendica\Model\Profile;
-use Friendica\Module;
-use Friendica\Util\Strings;
const FRIO_SCHEME_ACCENT_BLUE = '#1e87c2';
const FRIO_SCHEME_ACCENT_RED = '#b50404';
* This function does replace the links to photos
* of other friendica users. Original the photos are
* linked to the photo page. Now they will linked directly
- * to the photo file. This function is nessesary to use colorbox
+ * to the photo file. This function is necessary to use colorbox
* in the network stream
*
- * @param App $a Unused but required by hook definition
* @param array $body_info The item and its html output
*/
-function frio_item_photo_links(App $a, &$body_info)
+function frio_item_photo_links(&$body_info)
{
$occurence = 0;
$p = Plaintext::getBoundariesPosition($body_info['html'], '<a', '>');
* to call the addToModal javascript function so this pages can
* be loaded in a bootstrap modal
*
- * @param App $a Unused but required by the hook definition
* @param array $arr Contains item data and the original photo_menu
*/
-function frio_item_photo_menu(App $a, &$arr)
+function frio_item_photo_menu(&$arr)
{
foreach ($arr['menu'] as $k => $v) {
if (strpos($v, 'message/new/') === 0) {
* Additionally the profile, status and photo page links will be changed
* to don't open in a new tab if the contact is a friendica contact.
*
- * @param App $a The app data
* @param array $args Contains contact data and the original photo_menu
*/
-function frio_contact_photo_menu(App $a, &$args)
+function frio_contact_photo_menu(&$args)
{
$cid = $args['contact']['id'];
$pmlink = '';
}
- // Set the the indicator for opening the status, profile and photo pages
+ // Set the indicator for opening the status, profile and photo pages
// in a new tab to false if the contact a dfrn (friendica) contact
- // We do this because we can go back on foreign friendica pages throuhg
- // friendicas "magic-link" which indicates a friendica user on froreign
+ // We do this because we can go back on foreign friendica pages through
+ // friendicas "magic-link" which indicates a friendica user on foreign
// friendica servers as remote user or visitor
//
// The value for opening in a new tab is e.g. when
* @param array $nav_info The original nav info array: nav, banner, userinfo, sitelocation
* @throws Exception
*/
-function frio_remote_nav(App $a, array &$nav_info)
+function frio_remote_nav(array &$nav_info)
{
if (DI::mode()->has(App\Mode::MAINTENANCEDISABLED)) {
// get the homelink from $_SESSION
// since $userinfo isn't available for the hook we write it to the nav array
// this isn't optimal because the contact query will be done now twice
$fields = ['id', 'url', 'avatar', 'micro', 'name', 'nick', 'baseurl', 'updated'];
- if ($a->isLoggedIn()) {
- $remoteUser = Contact::selectFirst($fields, ['uid' => $a->getLoggedInUserId(), 'self' => true]);
+ if (DI::userSession()->isAuthenticated()) {
+ $remoteUser = Contact::selectFirst($fields, ['uid' => DI::userSession()->getLocalUserId(), 'self' => true]);
} elseif (!DI::userSession()->getLocalUserId() && DI::userSession()->getRemoteUserId()) {
$remoteUser = Contact::getById(DI::userSession()->getRemoteUserId(), $fields);
$nav_info['nav']['remote'] = DI::l10n()->t('Guest');
}
}
-function frio_display_item(App $a, &$arr)
+function frio_display_item(&$arr)
{
// Add follow to the item menu
$followThread = [];