403Webshell
Server IP : 85.158.181.41  /  Your IP : 216.73.217.12
Web Server : Apache
System : Linux cloud9-vm129 6.1.178+1-ph #ph SMP PREEMPT_DYNAMIC Wed Jul 29 09:00:54 UTC 2026 x86_64
User : moncbefd ( 1024)
PHP Version : 7.3.33
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /home/moncbefd/www.moneta.at/GXModules/Gambio/ContentZones/Shop/classes/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /home/moncbefd/www.moneta.at/GXModules/Gambio/ContentZones/Shop/classes//ContentZoneLoader.php
<?php
/* --------------------------------------------------------------
  ContentZoneLoader.php 2019-10-14
  Gambio GmbH
  http://www.gambio.de
  Copyright (c) 2019 Gambio GmbH
  Released under the GNU General Public License (Version 2)
  [http://www.gnu.org/licenses/gpl-2.0.html]
  --------------------------------------------------------------*/

/**
 * Class ContentZoneLoader
 */
class ContentZoneLoader
{
    /**
     * Does string contain smarty function call?
     */
    protected const SMARTY_FUNCTION_PATTERN = '/\{([\w]+)((?:\s[\w]+[\s]*=[\s]*(?:(?:[\w\s]+)|(?:[\'"][\w\s,-]*[\'"])))+)\}/';
    
    /**
     * @var null|string
     */
    protected $contentZoneFilename;
    /**
     * @var string
     */
    protected $id;
    /**
     * @var string absolute path /public/theme
     */
    protected $publishedThemePath;
    /**
     * @var Smarty_Internal_Template
     */
    protected $template;
    
    
    /**
     * ContentZoneLoader constructor.
     *
     * @param array                    $params
     * @param Smarty_Internal_Template $template
     *
     */
    public function __construct(array $params, Smarty_Internal_Template $template)
    {
        $this->id                 = $params['id'];
        $this->template           = $template;
        $this->publishedThemePath = DIR_FS_CATALOG . StaticGXCoreLoader::getThemeControl()->getPublishedThemePath();
        
        $this->findContentZoneFile();
    }
    
    
    /**
     * Detecting and saving the content zone html
     */
    protected function findContentZoneFile(): void
    {
        $htmlDirectory = $this->publishedThemePath . DIRECTORY_SEPARATOR . 'html' . DIRECTORY_SEPARATOR . 'system'
                         . DIRECTORY_SEPARATOR;
        
        $languageHelper = MainFactory::create('LanguageHelper', StaticGXCoreLoader::getDatabaseQueryBuilder());
        $languageCode   = strtolower($languageHelper->getLanguageCodeById(new IdType($_SESSION['languages_id'])));
        $filename       = 'content_zone_' . $this->id . '_' . $languageCode;
        
        if (file_exists($htmlDirectory . $filename . '.html')) {
            $contentZoneFilePath = $htmlDirectory . $filename . '.html';
        } else {
            $contentZoneFilePath = $htmlDirectory . $filename . 'default.html';
        }
        
        if (file_exists($contentZoneFilePath)) {
            $this->contentZoneFilename = $contentZoneFilePath;
        }
    }
    
    
    /**
     * @return string html of the content zone
     */
    public function __toString(): string
    {
        $html = "<div id=\"{$this->id}\" data-gx-content-zone=\"{$this->id}\" class=\"gx-content-zone row\">" . PHP_EOL;
        
        if ($this->contentZoneFilename !== null) {
            
            $htmlContent = file_get_contents($this->contentZoneFilename);
            $matches     = [];
            if (preg_match_all(self::SMARTY_FUNCTION_PATTERN, $htmlContent, $matches) !== 0) {
                
                for ($index = 0, $indexMax = count(current($matches)); $index < $indexMax; $index++) {
                    
                    $completeString   = $matches[0][$index];
                    $smartyFunction   = $matches[1][$index];
                    $parametersString = $matches[2][$index];
                    $functionName     = 'smarty_function_' . $smartyFunction;
                    $pattern          = '/([^,= ]+)=(([^,="\' ]+)|(?:["\']([^"\']*)["\']))/';
                    preg_match_all($pattern, $parametersString, $r);
                    $args = array_combine($r[1], $r[2]);
                    
                    try {
                        if (!function_exists($functionName)) {
                            $this->template->smarty->loadPlugin($functionName);
                        }
                        
                        if (function_exists($functionName)) {
                            $smartyFunctionContent = $functionName($args, $this->template);
                            $htmlContent           = str_replace($completeString,
                                                                 $smartyFunctionContent,
                                                                 $htmlContent);
                        }
                    } catch (Exception $exception) {
                        //suppress the exception
                    }
                }
            }
            $html .= $htmlContent . PHP_EOL;
        }
        
        return $html . PHP_EOL . '</div>';
    }
}

Youez - 2016 - github.com/yon3zu
LinuXploit