HEX
Server: Apache
System: Linux scp1.abinfocom.com 5.4.0-216-generic #236-Ubuntu SMP Fri Apr 11 19:53:21 UTC 2025 x86_64
User: confeduphaar (1010)
PHP: 8.1.33
Disabled: exec,passthru,shell_exec,system
Upload Files
File: /home/confeduphaar/backip-old-files/libraries/astroid/framework/fields/astroidpresets.php
<?php

/**
 * @package   Astroid Framework
 * @author    JoomDev https://www.joomdev.com
 * @copyright Copyright (C) 2009 - 2020 JoomDev.
 * @license https://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 or Later
 */
defined('JPATH_PLATFORM') or die;

/**
 * Form Field class for the Joomla Platform.
 * Supports a generic list of options.
 *
 * @since  11.1
 */
class JFormFieldAstroidpresets extends JFormField
{

   /**
    * The form field type.
    *
    * @var    string
    * @since  11.1
    */
   protected $type = 'astroidpresets';

   /**
    * Method to get the field input markup for a generic list.
    * Use the multiple attribute to enable multiselect.
    *
    * @return  string  The field input markup.
    *
    * @since   3.7.0
    */
   public function __get($name)
   {
      return parent::__get($name);
   }

   public function __set($name, $value)
   {
      parent::__set($name, $value);
   }

   protected function getInput()
   {
      $temp = Astroid\Framework::getTemplate();
      $presets = $temp->getPresets();
      if (!count($presets)) {
         return false;
      }
      $html = [];
      $html[] = '<div astroidpresets class="astroid-presets">';
      foreach ($presets as $preset) {
         $html[] = '<div class="astroid-presets-option astroid-presets-option-' . $preset['name'] . '" ng-click="chosePreset(\'' . $preset['name'] . '\')">';
         if (empty($preset['thumbnail'])) {
            $html[] = '<div>';
            foreach ($preset['colors'] as $color) {
               $html[] = '<span style="background-color: ' . $color . '"></span>';
            }
            $html[] = '</div>';
         } else {
            $html[] = '<img src="' . $preset['thumbnail'] . '" width="100%" />';
         }
         $html[] = '<span>' . $preset['title'] . '</span></div>';
      }
      $html[] = '</div>';
      return implode('', $html);
   }
}