You are not logged in.

Announcement

 Téléchargez la dernière version stable de GLPI      -     Et vous, que pouvez vous faire pour le projet GLPI ? :  Contribuer
 Download last stable version of GLPI                      -     What can you do for GLPI ? :  Contribute

#1 2023-04-17 16:39:39

Bruceqq
Member
Registered: 2022-10-11
Posts: 2

GLPI 10.0.6 - how can i remove the "read more" button

Good afternoon people.

I would really like to remove this button, since it doesn't help at all here internally, and some users lose ticket information due to this button, does anyone have any idea how I can remove this button?

FluxBB bbcode test

Offline

#2 2023-04-17 19:29:31

NickeSG
Member
Registered: 2023-04-17
Posts: 1

Re: GLPI 10.0.6 - how can i remove the "read more" button

Hi friend, welcome to the community.
You can disable this feature by "commenting out" the snippet below in the src/RichText/RichText.php file just like the one below.


/**
     * Get enhanced HTML string based on user input content.
     *
     * @since 10.0.0
     *
     * @param null|string   $content HTML string to enahnce
     * @param array         $params  Enhancement parameters
     *
     * @return string
     */
    public static function getEnhancedHtml(?string $content, array $params = []): string
    {
        $p = [
            'images_gallery' => false,
            'user_mentions'  => true,
            'images_lazy'    => true,
            /**'text_maxsize'   => 2000,**/
        ];
        $p = array_replace($p, $params);

        $content_size = strlen($content);

       // Sanitize content first (security and to decode HTML entities)
        $content = self::getSafeHtml($content);

        if ($p['user_mentions']) {
            $content = UserMention::refreshUserMentionsHtmlToDisplay($content);
        }

        if ($p['images_lazy']) {
            $content = self::loadImagesLazy($content);
        }

        if ($p['images_gallery']) {
            $content = self::replaceImagesByGallery($content);
        }

        /**if ($p['text_maxsize'] > 0 && $content_size > $p['text_maxsize']) {
            $content = <<<HTML
<div class="long_text">$content
    <p class='read_more'>
        <span class='read_more_button'>...</span>
    </p>
</div>
HTML;
            $content .= HTML::scriptBlock('$(function() { read_more(); });');
        }**/

        return $content;
    }

Hope this helps.

Offline

#3 2023-04-17 21:11:38

Bruceqq
Member
Registered: 2022-10-11
Posts: 2

Re: GLPI 10.0.6 - how can i remove the "read more" button

Thanks for the response, this work it, moderation please this topic is solved.

Offline

Board footer

Powered by FluxBB