/** * @param $path * @param $type * @param $szField */ public function show($path, $type, $szField) { $design = CMSDesign::getInstance(); // $path = stripslashes($path); $type = stripslashes($type); $szField = stripslashes($szField); $modelName = \Extasy\Model\Model::isModel($type); $fields = call_user_func($modelName, 'getFieldsInfo'); $aInfo = @getimagesize(\Extasy\CMS::getFilesPath() . ${$fields}[$szField]['base_dir'] . $path); $szFilename = \Extasy\CMS::getFilesHttpRoot() . $fields[$szField]['base_dir'] . $path; $x = '?' . rand(0, 1000000); if (isset($aInfo[2])) { $aParse['szFilename'] = $szFilename; } $design->popupBegin(); $design->popupHeader('Просмотр изображения'); $design->formBegin(); $design->br(); if (!empty($szFilename)) { print '<img src="' . $szFilename . $x . '">'; } $design->popupEnd(); $this->output(); }
<?php use Extasy\CMS; $path = dirname(__FILE__) . '/scripts/_lib/loader.php'; if (file_exists($path)) { require_once $path; } else { die('FileManager. Configure application path'); } $config = ['HttpPrefix' => \Extasy\CMS::getFilesHttpRoot()]; ?> <!DOCTYPE html> <html id="Document"> <head> <meta charset="utf-8" /> <title> </title> <link rel="stylesheet" type="text/css" href="style.css" /> <script type="text/javascript"> var fmCONSTANTS = <?php echo json_encode($config); ?> </script> <script type="text/javascript" src="/resources/extasy/js/vendors/jquery-1.10.2.min.js"></script> <script type="text/javascript" src="/resources/extasy/js/net.js"></script> <script type="text/javascript" src="/resources/extasy/js/cms/main.js"></script> <script type="text/javascript" src="/resources/extasy/js/cms/popup.js"></script> <script type="text/javascript" src="/resources/extasy/js/contentloader.js"></script> <script type="text/javascript" src="/resources/extasy/js/sysutils.js"></script> <script type="text/javascript" src="/resources/extasy/js/controller.js"></script> <script type="text/javascript" src="scripts/pathinfo.php"></script>
public function getViewValue() { if (file_exists($this->getValue())) { return '<img src="' . \Extasy\CMS::getFilesHttpRoot() . $this->szDir . $this->document->id->getValue() . '.' . $this->szExtension . '" alt="' . htmlspecialchars($this->aValue) . '"/>'; } }
public function ajaxCall($action, $params) { $result = array(); if ($action == 'upload') { // upload image $this->loadFromFiles(); // return image path $this->document->update(); $result['imagePath'] = imageHelper::getTimthumbUrl(\Extasy\CMS::getFilesHttpRoot() . $this->aValue, self::thumbWidth, self::thumbHeight); $result['resizes'] = $this->getAdminFormValue(true); $result['value'] = $this->aValue; } elseif ($action == 'clear') { $query = new \Extasy\ORM\QueryBuilder('delete'); $this->onDelete($query); } else { throw new Exception('Unknown action `' . $action . '`'); } return $result; }