Файловый менеджер - Редактировать - /home/wuectly/www/03cbe/media.php.tar
Назад
home/wuectly/www/plugins/fields/media/media.php 0000604 00000002014 15245535616 0015617 0 ustar 00 <?php /** * @package Joomla.Plugin * @subpackage Fields.Media * * @copyright (C) 2017 Open Source Matters, Inc. <https://www.joomla.org> * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; JLoader::import('components.com_fields.libraries.fieldsplugin', JPATH_ADMINISTRATOR); /** * Fields Media Plugin * * @since 3.7.0 */ class PlgFieldsMedia extends FieldsPlugin { /** * Transforms the field into a DOM XML element and appends it as a child on the given parent. * * @param stdClass $field The field. * @param DOMElement $parent The field node parent. * @param JForm $form The form. * * @return DOMElement * * @since 3.7.0 */ public function onCustomFieldsPrepareDom($field, DOMElement $parent, JForm $form) { $fieldNode = parent::onCustomFieldsPrepareDom($field, $parent, $form); if (!$fieldNode) { return $fieldNode; } $fieldNode->setAttribute('hide_default', 'true'); return $fieldNode; } } home/wuectly/www/plugins/fields/media/tmpl/media.php 0000604 00000001230 15245556140 0016565 0 ustar 00 <?php /** * @package Joomla.Plugin * @subpackage Fields.Media * * @copyright (C) 2016 Open Source Matters, Inc. <https://www.joomla.org> * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; if ($field->value == '') { return; } $class = $fieldParams->get('image_class'); if ($class) { $class = ' class="' . htmlentities($class, ENT_COMPAT, 'UTF-8', true) . '"'; } $value = (array) $field->value; $buffer = ''; foreach ($value as $path) { if (!$path) { continue; } $buffer .= sprintf('<img src="%s"%s>', htmlentities($path, ENT_COMPAT, 'UTF-8', true), $class ); } echo $buffer; home/wuectly/www/components/com_media/media.php 0000604 00000001160 15245561125 0015706 0 ustar 00 <?php /** * @package Joomla.Site * @subpackage com_media * * @copyright (C) 2006 Open Source Matters, Inc. <https://www.joomla.org> * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; // Load the com_media language files, default to the admin file and fall back to site if one isn't found $lang = JFactory::getLanguage(); $lang->load('com_media', JPATH_ADMINISTRATOR, null, false, true) || $lang->load('com_media', JPATH_SITE, null, false, true); // Hand processing over to the admin base file require_once JPATH_COMPONENT_ADMINISTRATOR . '/media.php'; home/wuectly/www/administrator/components/com_media/media.php 0000604 00000003240 15245571353 0020573 0 ustar 00 <?php /** * @package Joomla.Administrator * @subpackage com_media * * @copyright (C) 2005 Open Source Matters, Inc. <https://www.joomla.org> * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; $input = JFactory::getApplication()->input; $user = JFactory::getUser(); $asset = $input->get('asset'); $author = $input->get('author'); // Access check. if (!$user->authorise('core.manage', 'com_media') && (!$asset || (!$user->authorise('core.edit', $asset) && !$user->authorise('core.create', $asset) && count($user->getAuthorisedCategories($asset, 'core.create')) == 0) && !($user->id == $author && $user->authorise('core.edit.own', $asset)))) { throw new JAccessExceptionNotallowed(JText::_('JERROR_ALERTNOAUTHOR'), 403); } $params = JComponentHelper::getParams('com_media'); // Load the helper class JLoader::register('MediaHelper', JPATH_ADMINISTRATOR . '/components/com_media/helpers/media.php'); // Set the path definitions $popup_upload = $input->get('pop_up', null); $path = 'file_path'; $view = $input->get('view'); if (substr(strtolower($view), 0, 6) == 'images' || $popup_upload == 1) { $path = 'image_path'; } $mediaBaseDir = JPATH_ROOT . '/' . $params->get($path, 'images'); if (!is_dir($mediaBaseDir)) { throw new \InvalidArgumentException(JText::_('JERROR_AN_ERROR_HAS_OCCURRED'), 500); } define('COM_MEDIA_BASE', $mediaBaseDir); define('COM_MEDIA_BASEURL', JUri::root() . $params->get($path, 'images')); $controller = JControllerLegacy::getInstance('Media', array('base_path' => JPATH_COMPONENT_ADMINISTRATOR)); $controller->execute($input->get('task')); $controller->redirect(); home/wuectly/www/libraries/fof/form/field/media.php 0000604 00000006131 15245607132 0016362 0 ustar 00 <?php /** * @package FrameworkOnFramework * @subpackage form * @copyright Copyright (C) 2010-2016 Nicholas K. Dionysopoulos / Akeeba Ltd. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt * @note This file has been modified by the Joomla! Project and no longer reflects the original work of its author. */ // Protect from unauthorized access defined('FOF_INCLUDED') or die; JFormHelper::loadFieldClass('media'); /** * Form Field class for the FOF framework * Media selection field. * * @package FrameworkOnFramework * @since 2.0 */ class FOFFormFieldMedia extends JFormFieldMedia implements FOFFormField { protected $static; protected $repeatable; /** @var FOFTable The item being rendered in a repeatable form field */ public $item; /** @var int A monotonically increasing number, denoting the row number in a repeatable view */ public $rowid; /** * Method to get certain otherwise inaccessible properties from the form field object. * * @param string $name The property name for which to the the value. * * @return mixed The property value or null. * * @since 2.0 */ public function __get($name) { switch ($name) { case 'static': if (empty($this->static)) { $this->static = $this->getStatic(); } return $this->static; break; case 'repeatable': if (empty($this->repeatable)) { $this->repeatable = $this->getRepeatable(); } return $this->repeatable; break; default: return parent::__get($name); } } /** * Get the rendering of this field type for static display, e.g. in a single * item view (typically a "read" task). * * @since 2.0 * * @return string The field HTML */ public function getStatic() { $imgattr = array( 'id' => $this->id ); if ($this->element['class']) { $imgattr['class'] = (string) $this->element['class']; } if ($this->element['style']) { $imgattr['style'] = (string) $this->element['style']; } if ($this->element['width']) { $imgattr['width'] = (string) $this->element['width']; } if ($this->element['height']) { $imgattr['height'] = (string) $this->element['height']; } if ($this->element['align']) { $imgattr['align'] = (string) $this->element['align']; } if ($this->element['rel']) { $imgattr['rel'] = (string) $this->element['rel']; } if ($this->element['alt']) { $alt = JText::_((string) $this->element['alt']); } else { $alt = null; } if ($this->element['title']) { $imgattr['title'] = JText::_((string) $this->element['title']); } if ($this->value && file_exists(JPATH_ROOT . '/' . $this->value)) { $src = FOFPlatform::getInstance()->URIroot() . $this->value; } else { $src = ''; } return JHtml::_('image', $src, $alt, $imgattr); } /** * Get the rendering of this field type for a repeatable (grid) display, * e.g. in a view listing many item (typically a "browse" task) * * @since 2.0 * * @return string The field HTML */ public function getRepeatable() { return $this->getStatic(); } } home/wuectly/www/administrator/components/com_media/helpers/media.php 0000604 00000011733 15245654257 0022250 0 ustar 00 <?php /** * @package Joomla.Administrator * @subpackage com_media * * @copyright (C) 2006 Open Source Matters, Inc. <https://www.joomla.org> * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; use Joomla\CMS\Object\CMSObject; /** * Media helper class. * * @since 1.6 * @deprecated 4.0 Use JHelperMedia instead */ abstract class MediaHelper { /** * Checks if the file is an image * * @param string $fileName The filename * * @return boolean * * @since 1.5 * @deprecated 4.0 Use JHelperMedia::isImage instead */ public static function isImage($fileName) { try { JLog::add( sprintf('%s() is deprecated. Use JHelperMedia::isImage() instead.', __METHOD__), JLog::WARNING, 'deprecated' ); } catch (RuntimeException $exception) { // Informational log only } $mediaHelper = new JHelperMedia; return $mediaHelper->isImage($fileName); } /** * Gets the file extension for the purpose of using an icon. * * @param string $fileName The filename * * @return string File extension * * @since 1.5 * @deprecated 4.0 Use JHelperMedia::getTypeIcon instead */ public static function getTypeIcon($fileName) { try { JLog::add( sprintf('%s() is deprecated. Use JHelperMedia::getTypeIcon() instead.', __METHOD__), JLog::WARNING, 'deprecated' ); } catch (RuntimeException $exception) { // Informational log only } $mediaHelper = new JHelperMedia; return $mediaHelper->getTypeIcon($fileName); } /** * Checks if the file can be uploaded * * @param array $file File information * @param string $error An error message to be returned * * @return boolean * * @since 1.5 * @deprecated 4.0 Use JHelperMedia::canUpload instead */ public static function canUpload($file, $error = '') { try { JLog::add( sprintf('%s() is deprecated. Use JHelperMedia::canUpload() instead.', __METHOD__), JLog::WARNING, 'deprecated' ); } catch (RuntimeException $exception) { // Informational log only } $mediaHelper = new JHelperMedia; return $mediaHelper->canUpload($file, 'com_media'); } /** * Method to parse a file size * * @param integer $size The file size in bytes * * @return string The converted file size * * @since 1.6 * @deprecated 4.0 Use JHtml::_('number.bytes') instead */ public static function parseSize($size) { try { JLog::add( sprintf("%s() is deprecated. Use JHtml::_('number.bytes') instead.", __METHOD__), JLog::WARNING, 'deprecated' ); } catch (RuntimeException $exception) { // Informational log only } return JHtml::_('number.bytes', $size); } /** * Calculate the size of a resized image * * @param integer $width Image width * @param integer $height Image height * @param integer $target Target size * * @return array The new width and height * * @since 3.2 * @deprecated 4.0 Use JHelperMedia::imageResize instead */ public static function imageResize($width, $height, $target) { try { JLog::add( sprintf('%s() is deprecated. Use JHelperMedia::imageResize() instead.', __METHOD__), JLog::WARNING, 'deprecated' ); } catch (RuntimeException $exception) { // Informational log only } $mediaHelper = new JHelperMedia; return $mediaHelper->imageResize($width, $height, $target); } /** * Counts the files and directories in a directory that are not php or html files. * * @param string $dir Directory name * * @return array The number of files and directories in the given directory * * @since 1.5 * @deprecated 4.0 Use JHelperMedia::countFiles instead */ public static function countFiles($dir) { try { JLog::add( sprintf('%s() is deprecated. Use JHelperMedia::countFiles() instead.', __METHOD__), JLog::WARNING, 'deprecated' ); } catch (RuntimeException $exception) { // Informational log only } $mediaHelper = new JHelperMedia; return $mediaHelper->countFiles($dir); } /** * Generates the URL to the object in the action logs component * * @param string $contentType The content type * @param integer $id The integer id * @param CMSObject $mediaObject The media object being uploaded * * @return string The link for the action log * * @since 3.9.27 */ public static function getContentTypeLink($contentType, $id, CMSObject $mediaObject) { if ($contentType === 'com_media.file') { return ''; } $link = 'index.php?option=com_media&view=media'; $uploadedPath = substr($mediaObject->get('filepath'), strlen(COM_MEDIA_BASE) + 1); // Now remove the filename $uploadedBasePath = substr_replace( $uploadedPath, '', (strlen(DIRECTORY_SEPARATOR . $mediaObject->get('name')) * -1) ); if (!empty($uploadedBasePath)) { $link = $link . '&folder=' . $uploadedBasePath; } return $link; } }
| ver. 1.4 |
Github
|
.
| PHP 8.1.34 | Генерация страницы: 0 |
proxy
|
phpinfo
|
Настройка