AnonSec Shell
Server IP : 46.105.57.169  /  Your IP : 216.73.216.144
Web Server : Apache
System : Linux webd003.cluster120.gra.hosting.ovh.net 5.15.206-ovh-vps-grsec-zfs-classid #1 SMP Fri May 15 02:41:25 UTC 2026 x86_64
User : maitricfuz ( 93378)
PHP Version : 8.4.10
Disable Function : _dyuweyrj4,_dyuweyrj4r,dl
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /home/maitricfuz/www/maitric/administrator/components/com_redirect/src/Service/HTML/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ HOME ]     

Current File : /home/maitricfuz/www/maitric/administrator/components/com_redirect/src/Service/HTML/Redirect.php
<?php

/**
 * @package     Joomla.Administrator
 * @subpackage  com_redirect
 *
 * @copyright   (C) 2009 Open Source Matters, Inc. <https://www.joomla.org>
 * @license     GNU General Public License version 2 or later; see LICENSE.txt
 */

namespace Joomla\Component\Redirect\Administrator\Service\HTML;

use Joomla\CMS\Factory;
use Joomla\CMS\Language\Text;
use Joomla\Utilities\ArrayHelper;

// phpcs:disable PSR1.Files.SideEffects
\defined('_JEXEC') or die;
// phpcs:enable PSR1.Files.SideEffects

/**
 * Utility class for creating HTML Grids.
 *
 * @since  1.6
 */
class Redirect
{
    /**
     * Display the published or unpublished state of an item.
     *
     * @param   int      $value      The state value.
     * @param   int      $i          The ID of the item.
     * @param   boolean  $canChange  An optional prefix for the task.
     *
     * @return  string
     *
     * @since   1.6
     *
     * @throws  \InvalidArgumentException
     */
    public function published($value = 0, $i = null, $canChange = true)
    {
        Factory::getDocument()->getWebAssetManager()->useScript('list-view');

        // Note: $i is required but has to be an optional argument in the function call due to argument order
        if (null === $i) {
            throw new \InvalidArgumentException('$i is a required argument in JHtmlRedirect::published');
        }

        // Array of image, task, title, action
        $states = [
            1  => ['publish', 'links.unpublish', 'JENABLED', 'COM_REDIRECT_DISABLE_LINK'],
            0  => ['unpublish', 'links.publish', 'JDISABLED', 'COM_REDIRECT_ENABLE_LINK'],
            2  => ['archive', 'links.unpublish', 'JARCHIVED', 'JUNARCHIVE'],
            -2 => ['trash', 'links.publish', 'JTRASHED', 'COM_REDIRECT_ENABLE_LINK'],
        ];

        $state = ArrayHelper::getValue($states, (int) $value, $states[0]);
        $icon  = $state[0];

        if ($canChange) {
            $html = '<a href="#" class="js-grid-item-action tbody-icon' . ($value == 1 ? ' active' : '')
                . '" aria-labelledby="cb' . $state[0] . $i . '-desc"'
                . ' data-item-id="cb' . $i . '" data-item-task="' . $state[1] . '"'
                . '><span class="icon-' . $icon . '" aria-hidden="true"></span></a>'
                . '<div role="tooltip" id="cb' . $state[0] . $i . '-desc">' . Text::_($state[3]) . '</div>';
        }

        return $html;
    }
}

Anon7 - 2022
AnonSec Team