HEX
Server: Apache
System: Linux webm004.cluster121.gra.hosting.ovh.net 5.15.167-ovh-vps-grsec-zfs-classid #1 SMP Tue Sep 17 08:14:20 UTC 2024 x86_64
User: grainesdfo (155059)
PHP: 5.4.45
Disabled: _dyuweyrj4,_dyuweyrj4r,dl
Upload Files
File: /home/grainesdfo/www/wp-content/plugins/easing-slider/src/Plugin/Admin/Panels/AllSliders.php
<?php

namespace EasingSlider\Plugin\Admin\Panels;

use EasingSlider\Foundation\Admin\Panels\Panel;
use EasingSlider\Foundation\Contracts\Repositories\Repository;
use EasingSlider\Foundation\Contracts\Shortcodes\Shortcode;
use EasingSlider\Plugin\Admin\Panels\EditSlider as EditSliderPanel;
use EasingSlider\Plugin\Admin\Panels\ListSliders as ListSlidersPanel;

/**
 * Exit if accessed directly
 */
if ( ! defined('ABSPATH')) {
	exit;
}

class AllSliders extends Panel
{
	/**
	 * Shortcode
	 *
	 * @var \EasingSlider\Foundation\Contracts\Shortcodes\Shortcode
	 */
	protected $shortcode;

	/**
	 * List table
	 *
	 * @var \EasingSlider\Foundation\Contracts\Repositories\Repository
	 */
	protected $sliders;

	/**
	 * Constructor
	 *
	 * @param  \EasingSlider\Foundation\Contracts\Repositories\Repository $sliders
	 * @param  \EasingSlider\Foundation\Contracts\Shortcodes\Shortcode    $shortcode
	 * @return void
	 */
	public function __construct(Repository $sliders, Shortcode $shortcode)
	{
		$this->sliders = $sliders;
		$this->shortcode = $shortcode;
	}

	/**
	 * Gets the appropriate page
	 *
	 * @return \EasingSlider\Panels\PanelContract
	 */
	protected function determinePanel()
	{
		$id = $this->getID();

		// Determine the appropriate 
		if ($id) {
			return new EditSliderPanel(
				$this->sliders
			);
		} else {
			return new ListSlidersPanel(
				$this->sliders,
				$this->shortcode
			);
		}
	}

	/**
	 * Displays the panel
	 *
	 * @return void
	 */
	public function display()
	{
		$panel = $this->determinePanel();

		return $panel->display();
	}
}