Merge branch 'master' of https://github.com/thelia/thelia into yochima-branch

This commit is contained in:
Guillaume Barral
2014-06-19 13:59:16 +02:00
391 changed files with 8886 additions and 2126 deletions

View File

@@ -39,7 +39,7 @@
"symfony/finder": "~2.2"
},
"require-dev": {
"phpunit/phpunit": "3.7.*",
"phpunit/phpunit": "4.1.*",
"fzaninotto/faker": "dev-master",
"maximebf/debugbar": "dev-master"
},

401
composer.lock generated
View File

@@ -1,9 +1,10 @@
{
"_readme": [
"This file locks the dependencies of your project to a known state",
"Read more about it at http://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file"
"Read more about it at http://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
"This file is @generated automatically"
],
"hash": "d1e1c31ed8e38f2282ab431898cf8b08",
"hash": "73a6895063dd76bcb25eb14ef329e745",
"packages": [
{
"name": "doctrine/cache",
@@ -1959,40 +1960,44 @@
},
{
"name": "phpunit/php-code-coverage",
"version": "1.2.12",
"version": "2.0.8",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/php-code-coverage.git",
"reference": "1.2.12"
"reference": "58401826c8cfc8fd689b60026e91c337df374bca"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/1.2.12",
"reference": "1.2.12",
"url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/58401826c8cfc8fd689b60026e91c337df374bca",
"reference": "58401826c8cfc8fd689b60026e91c337df374bca",
"shasum": ""
},
"require": {
"php": ">=5.3.3",
"phpunit/php-file-iterator": ">=1.3.0@stable",
"phpunit/php-text-template": ">=1.1.1@stable",
"phpunit/php-token-stream": ">=1.1.3@stable"
"phpunit/php-file-iterator": "~1.3.1",
"phpunit/php-text-template": "~1.2.0",
"phpunit/php-token-stream": "~1.2.2",
"sebastian/environment": "~1.0.0",
"sebastian/version": "~1.0.3"
},
"require-dev": {
"phpunit/phpunit": "3.7.*@dev"
"ext-xdebug": ">=2.1.4",
"phpunit/phpunit": "~4.0.14"
},
"suggest": {
"ext-dom": "*",
"ext-xdebug": ">=2.0.5"
"ext-xdebug": ">=2.2.1",
"ext-xmlwriter": "*"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.2.x-dev"
"dev-master": "2.0.x-dev"
}
},
"autoload": {
"classmap": [
"PHP/"
"src/"
]
},
"notification-url": "https://packagist.org/downloads/",
@@ -2016,20 +2021,20 @@
"testing",
"xunit"
],
"time": "2013-07-06 06:26:16"
"time": "2014-05-26 14:55:24"
},
{
"name": "phpunit/php-file-iterator",
"version": "1.3.3",
"version": "1.3.4",
"source": {
"type": "git",
"url": "git://github.com/sebastianbergmann/php-file-iterator.git",
"reference": "1.3.3"
"url": "https://github.com/sebastianbergmann/php-file-iterator.git",
"reference": "acd690379117b042d1c8af1fafd61bde001bf6bb"
},
"dist": {
"type": "zip",
"url": "https://github.com/sebastianbergmann/php-file-iterator/zipball/1.3.3",
"reference": "1.3.3",
"url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/acd690379117b042d1c8af1fafd61bde001bf6bb",
"reference": "acd690379117b042d1c8af1fafd61bde001bf6bb",
"shasum": ""
},
"require": {
@@ -2056,25 +2061,25 @@
}
],
"description": "FilterIterator implementation that filters files based on a list of suffixes.",
"homepage": "http://www.phpunit.de/",
"homepage": "https://github.com/sebastianbergmann/php-file-iterator/",
"keywords": [
"filesystem",
"iterator"
],
"time": "2012-10-11 04:44:38"
"time": "2013-10-10 15:34:57"
},
{
"name": "phpunit/php-text-template",
"version": "1.1.4",
"version": "1.2.0",
"source": {
"type": "git",
"url": "git://github.com/sebastianbergmann/php-text-template.git",
"reference": "1.1.4"
"url": "https://github.com/sebastianbergmann/php-text-template.git",
"reference": "206dfefc0ffe9cebf65c413e3d0e809c82fbf00a"
},
"dist": {
"type": "zip",
"url": "https://github.com/sebastianbergmann/php-text-template/zipball/1.1.4",
"reference": "1.1.4",
"url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/206dfefc0ffe9cebf65c413e3d0e809c82fbf00a",
"reference": "206dfefc0ffe9cebf65c413e3d0e809c82fbf00a",
"shasum": ""
},
"require": {
@@ -2105,7 +2110,7 @@
"keywords": [
"template"
],
"time": "2012-10-31 11:15:28"
"time": "2014-01-30 17:20:04"
},
{
"name": "phpunit/php-timer",
@@ -2153,16 +2158,16 @@
},
{
"name": "phpunit/php-token-stream",
"version": "1.2.0",
"version": "1.2.2",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/php-token-stream.git",
"reference": "1.2.0"
"reference": "ad4e1e23ae01b483c16f600ff1bebec184588e32"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/1.2.0",
"reference": "1.2.0",
"url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/ad4e1e23ae01b483c16f600ff1bebec184588e32",
"reference": "ad4e1e23ae01b483c16f600ff1bebec184588e32",
"shasum": ""
},
"require": {
@@ -2199,56 +2204,56 @@
"keywords": [
"tokenizer"
],
"time": "2013-08-04 05:57:48"
"time": "2014-03-03 05:10:30"
},
{
"name": "phpunit/phpunit",
"version": "3.7.24",
"version": "4.1.3",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/phpunit.git",
"reference": "3.7.24"
"reference": "939cb801b3b2aa253aedd0b279f40bb8f35cec91"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/3.7.24",
"reference": "3.7.24",
"url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/939cb801b3b2aa253aedd0b279f40bb8f35cec91",
"reference": "939cb801b3b2aa253aedd0b279f40bb8f35cec91",
"shasum": ""
},
"require": {
"ext-dom": "*",
"ext-json": "*",
"ext-pcre": "*",
"ext-reflection": "*",
"ext-spl": "*",
"php": ">=5.3.3",
"phpunit/php-code-coverage": "~1.2.1",
"phpunit/php-file-iterator": ">=1.3.1",
"phpunit/php-text-template": ">=1.1.1",
"phpunit/php-timer": ">=1.0.4",
"phpunit/phpunit-mock-objects": "~1.2.0",
"phpunit/php-code-coverage": "~2.0",
"phpunit/php-file-iterator": "~1.3.1",
"phpunit/php-text-template": "~1.2",
"phpunit/php-timer": "~1.0.2",
"phpunit/phpunit-mock-objects": "~2.1",
"sebastian/comparator": "~1.0",
"sebastian/diff": "~1.1",
"sebastian/environment": "~1.0",
"sebastian/exporter": "~1.0",
"sebastian/version": "~1.0",
"symfony/yaml": "~2.0"
},
"require-dev": {
"pear-pear/pear": "1.9.4"
},
"suggest": {
"ext-json": "*",
"ext-simplexml": "*",
"ext-tokenizer": "*",
"phpunit/php-invoker": ">=1.1.0,<1.2.0"
"phpunit/php-invoker": "~1.1"
},
"bin": [
"composer/bin/phpunit"
"phpunit"
],
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "3.7.x-dev"
"dev-master": "4.1.x-dev"
}
},
"autoload": {
"classmap": [
"PHPUnit/"
"src/"
]
},
"notification-url": "https://packagist.org/downloads/",
@@ -2273,33 +2278,41 @@
"testing",
"xunit"
],
"time": "2013-08-09 06:58:24"
"time": "2014-06-11 14:15:47"
},
{
"name": "phpunit/phpunit-mock-objects",
"version": "1.2.3",
"version": "2.1.4",
"source": {
"type": "git",
"url": "git://github.com/sebastianbergmann/phpunit-mock-objects.git",
"reference": "1.2.3"
"url": "https://github.com/sebastianbergmann/phpunit-mock-objects.git",
"reference": "1a894a16b6c15fcdc5ef2b110f0e6233952c9b0f"
},
"dist": {
"type": "zip",
"url": "https://github.com/sebastianbergmann/phpunit-mock-objects/archive/1.2.3.zip",
"reference": "1.2.3",
"url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/1a894a16b6c15fcdc5ef2b110f0e6233952c9b0f",
"reference": "1a894a16b6c15fcdc5ef2b110f0e6233952c9b0f",
"shasum": ""
},
"require": {
"php": ">=5.3.3",
"phpunit/php-text-template": ">=1.1.1@stable"
"phpunit/php-text-template": "~1.2"
},
"require-dev": {
"phpunit/phpunit": "~4.1"
},
"suggest": {
"ext-soap": "*"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "2.1.x-dev"
}
},
"autoload": {
"classmap": [
"PHPUnit/"
"src/"
]
},
"notification-url": "https://packagist.org/downloads/",
@@ -2322,7 +2335,275 @@
"mock",
"xunit"
],
"time": "2013-01-13 10:24:48"
"time": "2014-06-07 16:22:57"
},
{
"name": "sebastian/comparator",
"version": "1.0.0",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/comparator.git",
"reference": "f7069ee51fa9fb6c038e16a9d0e3439f5449dcf2"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/f7069ee51fa9fb6c038e16a9d0e3439f5449dcf2",
"reference": "f7069ee51fa9fb6c038e16a9d0e3439f5449dcf2",
"shasum": ""
},
"require": {
"php": ">=5.3.3",
"sebastian/diff": "~1.1",
"sebastian/exporter": "~1.0"
},
"require-dev": {
"phpunit/phpunit": "~4.1"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.0.x-dev"
}
},
"autoload": {
"classmap": [
"src/"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"BSD-3-Clause"
],
"authors": [
{
"name": "Sebastian Bergmann",
"email": "sebastian@phpunit.de",
"role": "lead"
},
{
"name": "Jeff Welch",
"email": "whatthejeff@gmail.com"
},
{
"name": "Volker Dusch",
"email": "github@wallbash.com"
},
{
"name": "Bernhard Schussek",
"email": "bschussek@2bepublished.at"
}
],
"description": "Provides the functionality to compare PHP values for equality",
"homepage": "http://www.github.com/sebastianbergmann/comparator",
"keywords": [
"comparator",
"compare",
"equality"
],
"time": "2014-05-02 07:05:58"
},
{
"name": "sebastian/diff",
"version": "1.1.0",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/diff.git",
"reference": "1e091702a5a38e6b4c1ba9ca816e3dd343df2e2d"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/1e091702a5a38e6b4c1ba9ca816e3dd343df2e2d",
"reference": "1e091702a5a38e6b4c1ba9ca816e3dd343df2e2d",
"shasum": ""
},
"require": {
"php": ">=5.3.3"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.1-dev"
}
},
"autoload": {
"classmap": [
"src/"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"BSD-3-Clause"
],
"authors": [
{
"name": "Sebastian Bergmann",
"email": "sebastian@phpunit.de",
"role": "lead"
},
{
"name": "Kore Nordmann",
"email": "mail@kore-nordmann.de"
}
],
"description": "Diff implementation",
"homepage": "http://www.github.com/sebastianbergmann/diff",
"keywords": [
"diff"
],
"time": "2013-08-03 16:46:33"
},
{
"name": "sebastian/environment",
"version": "1.0.0",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/environment.git",
"reference": "79517609ec01139cd7e9fded0dd7ce08c952ef6a"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/79517609ec01139cd7e9fded0dd7ce08c952ef6a",
"reference": "79517609ec01139cd7e9fded0dd7ce08c952ef6a",
"shasum": ""
},
"require": {
"php": ">=5.3.3"
},
"require-dev": {
"phpunit/phpunit": "4.0.*@dev"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.0.x-dev"
}
},
"autoload": {
"classmap": [
"src/"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"BSD-3-Clause"
],
"authors": [
{
"name": "Sebastian Bergmann",
"email": "sebastian@phpunit.de",
"role": "lead"
}
],
"description": "Provides functionality to handle HHVM/PHP environments",
"homepage": "http://www.github.com/sebastianbergmann/environment",
"keywords": [
"Xdebug",
"environment",
"hhvm"
],
"time": "2014-02-18 16:17:19"
},
{
"name": "sebastian/exporter",
"version": "1.0.1",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/exporter.git",
"reference": "1f9a98e6f5dfe0524cb8c6166f7c82f3e9ae1529"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/1f9a98e6f5dfe0524cb8c6166f7c82f3e9ae1529",
"reference": "1f9a98e6f5dfe0524cb8c6166f7c82f3e9ae1529",
"shasum": ""
},
"require": {
"php": ">=5.3.3"
},
"require-dev": {
"phpunit/phpunit": "4.0.*@dev"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.0.x-dev"
}
},
"autoload": {
"classmap": [
"src/"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"BSD-3-Clause"
],
"authors": [
{
"name": "Sebastian Bergmann",
"email": "sebastian@phpunit.de",
"role": "lead"
},
{
"name": "Jeff Welch",
"email": "whatthejeff@gmail.com"
},
{
"name": "Volker Dusch",
"email": "github@wallbash.com"
},
{
"name": "Adam Harvey",
"email": "aharvey@php.net",
"role": "Lead"
},
{
"name": "Bernhard Schussek",
"email": "bschussek@2bepublished.at"
}
],
"description": "Provides the functionality to export PHP variables for visualization",
"homepage": "http://www.github.com/sebastianbergmann/exporter",
"keywords": [
"export",
"exporter"
],
"time": "2014-02-16 08:26:31"
},
{
"name": "sebastian/version",
"version": "1.0.3",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/version.git",
"reference": "b6e1f0cf6b9e1ec409a0d3e2f2a5fb0998e36b43"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/version/zipball/b6e1f0cf6b9e1ec409a0d3e2f2a5fb0998e36b43",
"reference": "b6e1f0cf6b9e1ec409a0d3e2f2a5fb0998e36b43",
"shasum": ""
},
"type": "library",
"autoload": {
"classmap": [
"src/"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"BSD-3-Clause"
],
"authors": [
{
"name": "Sebastian Bergmann",
"email": "sebastian@phpunit.de",
"role": "lead"
}
],
"description": "Library that helps with managing the version number of Git-hosted PHP projects",
"homepage": "https://github.com/sebastianbergmann/version",
"time": "2014-03-07 15:35:33"
}
],
"aliases": [

View File

@@ -21,30 +21,28 @@ namespace Thelia\Core;
* @author Manuel Raynaud <mraynaud@openstudio.fr>
*/
use Propel\Runtime\Connection\ConnectionManagerSingle;
use Propel\Runtime\Connection\ConnectionWrapper;
use Propel\Runtime\Propel;
use Symfony\Component\Config\FileLocator;
use Symfony\Component\Config\Loader\LoaderInterface;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Definition;
use Symfony\Component\DependencyInjection\ParameterBag\ParameterBag;
use Symfony\Component\DependencyInjection\Reference;
use Symfony\Component\Finder\Finder;
use Symfony\Component\HttpKernel\Kernel;
use Symfony\Component\Config\Loader\LoaderInterface;
use Symfony\Component\Yaml\Yaml;
use Symfony\Component\DependencyInjection\ParameterBag\ParameterBag;
use Thelia\Core\Event\TheliaEvents;
use Thelia\Config\DatabaseConfiguration;
use Thelia\Config\DefinePropel;
use Thelia\Core\DependencyInjection\Loader\XmlFileLoader;
use Thelia\Core\Event\TheliaEvents;
use Thelia\Core\Template\ParserInterface;
use Thelia\Core\Template\TemplateDefinition;
use Thelia\Core\DependencyInjection\Loader\XmlFileLoader;
use Symfony\Component\Config\FileLocator;
use Propel\Runtime\Propel;
use Propel\Runtime\Connection\ConnectionManagerSingle;
use Thelia\Core\Template\TemplateHelper;
use Thelia\Log\Tlog;
use Thelia\Model\Module;
use Thelia\Model\ModuleQuery;
class Thelia extends Kernel
{
@@ -162,12 +160,13 @@ class Thelia extends Kernel
->depth(0)
->in(THELIA_ROOT . "/core/lib/Thelia/Config/Resources");
/** @var \SplFileInfo $file */
foreach ($finder as $file) {
$loader->load($file->getBaseName());
}
if (defined("THELIA_INSTALL_MODE") === false) {
$modules = \Thelia\Model\ModuleQuery::getActivated();
$modules = ModuleQuery::getActivated();
$translationDirs = array();
@@ -233,12 +232,16 @@ class Thelia extends Kernel
$translationDirs[$module->getFrontOfficeTemplateTranslationDomain($template->getName())] =
$module->getAbsoluteFrontOfficeI18nTemplatePath($template->getName());
}
$this->addStandardModuleTemplatesToParserEnvironment($parser, $module);
} catch (\InvalidArgumentException $e) {
Tlog::getInstance()->addError(
sprintf("Failed to load module %s: %s", $module->getCode(), $e->getMessage()), $e
);
throw $e;
}
}

View File

@@ -73,6 +73,11 @@ class ConfigQuery extends BaseConfigQuery
return true;
}
public static function getConfiguredShopUrl()
{
return ConfigQuery::read("url_site", '');
}
public static function getDefaultLangWhenNoTranslationAvailable()
{
return ConfigQuery::read("default_lang_without_translation", 1);

View File

@@ -787,7 +787,7 @@ class FileManagerTest extends \PHPUnit_Framework_TestCase
->getMock();
$stubUploadedFile = $this->getMockBuilder('\Symfony\Component\HttpFoundation\File\UploadedFile')
->disableOriginalConstructor()
->setConstructorArgs([__DIR__ . '/fixtures/test.xml', 'test.xml'])
->getMock();
$stubUploadedFile->expects($this->any())
->method('getClientOriginalExtension')
@@ -814,8 +814,9 @@ class FileManagerTest extends \PHPUnit_Framework_TestCase
->getMock();
$stubUploadedFile = $this->getMockBuilder('\Symfony\Component\HttpFoundation\File\UploadedFile')
->disableOriginalConstructor()
->setConstructorArgs([__DIR__ . '/fixtures/test.xml', 'test.xml'])
->getMock();
$stubUploadedFile->expects($this->any())
->method('getClientOriginalExtension')
->will($this->returnValue(''));

View File

@@ -1 +0,0 @@
Resources/*

View File

@@ -1 +1 @@
{include file="include/tinymce_init.tpl"}
{include file="includes/tinymce_init.tpl"}

View File

@@ -1 +1 @@
{include file="include/tinymce_init.tpl"}
{include file="includes/tinymce_init.tpl"}

View File

@@ -1 +1 @@
{include file="include/tinymce_init.tpl"}
{include file="includes/tinymce_init.tpl"}

View File

@@ -1 +1 @@
{include file="include/tinymce_init.tpl"}
{include file="includes/tinymce_init.tpl"}

View File

@@ -1 +1 @@
{include file="include/tinymce_init.tpl"}
{include file="includes/tinymce_init.tpl"}

View File

@@ -1 +1 @@
{include file="include/tinymce_init.tpl"}
{include file="includes/tinymce_init.tpl"}

View File

@@ -1 +1 @@
{include file="include/tinymce_init.tpl"}
{include file="includes/tinymce_init.tpl"}

View File

@@ -1 +1 @@
{include file="include/tinymce_init.tpl"}
{include file="includes/tinymce_init.tpl"}

View File

@@ -4,33 +4,11 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://thelia.net/schema/dic/config http://thelia.net/schema/dic/config/thelia-1.0.xsd">
<loops>
<!-- sample definition
<loop name="MySuperLoop" class="MyModule\Loop\MySuperLoop" />
-->
</loops>
<forms>
<!--
<form name="MyFormName" class="MyModule\Form\MySuperForm" />
-->
</forms>
<commands>
<!--
<command class="MyModule\Command\MySuperCommand" />
-->
</commands>
<templateDirectives>
<!-- Sample definition
<templateDirectives class="MyModule\Directive\MyTemplateDirective" name="my_filter"/>
-->
</templateDirectives>
<services>
<service id="tinymce.listener" class="Tinymce\Listener\VerifyTinymceListener">
<tag name="kernel.event_subscriber"/>
<service id="smarty.plugin.tinymce_lang" class="Tinymce\Smarty\TinyMCELanguage" scope="request">
<tag name="thelia.parser.register_plugin"/>
<argument type="service" id="request"/>
</service>
</services>
</config>

View File

@@ -7,12 +7,12 @@
<descriptive locale="fr_FR">
<title>Editeur visuel TinyMCE</title>
</descriptive>
<version>0.1</version>
<version>0.5</version>
<author>
<name>Manuel Raynaud</name>
<email>manu@thelia.net</email>
</author>
<type>classic</type>
<thelia>2.0.0</thelia>
<stability>alpha</stability>
<stability>beta</stability>
</module>

View File

@@ -1,7 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<database defaultIdMethod="native" name="thelia" namespace="Tinymce\Model">
<!--
See propel documentation on http://propelorm.org for all information about schema file
-->
<external-schema filename="/home/manu/dev/www/thelia/local/config/schema.xml" referenceOnly="true" />
</database>

View File

@@ -0,0 +1,5 @@
<?php
return array(
'File manager' => 'Explorateur de fichiers',
);

View File

@@ -1,81 +0,0 @@
<?php
/*************************************************************************************/
/* This file is part of the Thelia package. */
/* */
/* Copyright (c) OpenStudio */
/* email : dev@thelia.net */
/* web : http://www.thelia.net */
/* */
/* For the full copyright and license information, please view the LICENSE.txt */
/* file that was distributed with this source code. */
/*************************************************************************************/
namespace Tinymce\Listener;
use Symfony\Component\EventDispatcher\Event;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
use Symfony\Component\Filesystem\Filesystem;
use Thelia\Core\Event\TheliaEvents;
use Thelia\Core\Event\Cache\CacheEvent;
use Thelia\Core\Thelia;
/**
* Class VerifyTinymceListener
* @package Tinymce\Listener
* @author Manuel Raynaud <mraynaud@openstudio.fr>
*/
class VerifyTinymceListener implements EventSubscriberInterface
{
public function verifyTinymce(Event $event)
{
$fs = new Filesystem();
if (false === file_exists(THELIA_WEB_DIR . '/tinymce')) {
$fs->mirror(__DIR__ . DS .'..'. DS .'Resources'.DS.'js'.DS.'tinymce', THELIA_WEB_DIR . 'tinymce');
}
if (false === file_exists(THELIA_WEB_DIR . '/media')) {
$fs->symlink(__DIR__ . DS .'..'.DS.'Resources'.DS.'media', THELIA_WEB_DIR . 'media');
}
}
public function clearCache(CacheEvent $event)
{
if (true === file_exists(THELIA_WEB_DIR . '/tinymce')) {
$fs = new Filesystem();
$directory = new \DirectoryIterator(THELIA_WEB_DIR . '/tinymce');
$fs->remove($directory);
}
}
/**
* Returns an array of event names this subscriber wants to listen to.
*
* The array keys are event names and the value can be:
*
* * The method name to call (priority defaults to 0)
* * An array composed of the method name to call and the priority
* * An array of arrays composed of the method names to call and respective
* priorities, or 0 if unset
*
* For instance:
*
* * array('eventName' => 'methodName')
* * array('eventName' => array('methodName', $priority))
* * array('eventName' => array(array('methodName1', $priority), array('methodName2'))
*
* @return array The event names to listen to
*
* @api
*/
public static function getSubscribedEvents()
{
return array(
TheliaEvents::BOOT => array('verifyTinymce', 128),
TheliaEvents::CACHE_CLEAR => array("clearCache", 0)
);
}
}

View File

@@ -0,0 +1,295 @@
<?php
include('config/config.php');
if($_SESSION['RF']["verify"] != "RESPONSIVEfilemanager") die('Access Denied!');
include('include/utils.php');
if (isset($_SESSION['RF']['language_file']) && file_exists($_SESSION['RF']['language_file'])){
include($_SESSION['RF']['language_file']);
}
else {
die('Language file is missing!');
}
if(isset($_GET['action']))
{
switch($_GET['action'])
{
case 'view':
if(isset($_GET['type'])) {
$_SESSION['RF']["view_type"] = $_GET['type'];
}
else {
die('view type number missing');
}
break;
case 'sort':
if(isset($_GET['sort_by'])) {
$_SESSION['RF']["sort_by"] = $_GET['sort_by'];
}
if(isset($_GET['descending'])) {
$_SESSION['RF']["descending"] = $_GET['descending'] === "TRUE";
}
break;
case 'image_size': // not used
$pos = strpos($_POST['path'],$upload_dir);
if ($pos !== FALSE)
{
$info=getimagesize(substr_replace($_POST['path'],$current_path,$pos,strlen($upload_dir)));
echo json_encode($info);
}
break;
case 'save_img':
$info=pathinfo($_POST['name']);
if (strpos($_POST['path'], '/') === 0
|| strpos($_POST['path'], '../') !== FALSE
|| strpos($_POST['path'], './') === 0
|| strpos($_POST['url'], 'http://featherfiles.aviary.com/') !== 0
|| $_POST['name'] != fix_filename($_POST['name'], $transliteration)
|| !in_array(strtolower($info['extension']), array('jpg','jpeg','png')))
{
die('wrong data');
}
$image_data = get_file_by_url($_POST['url']);
if ($image_data === FALSE)
{
die(lang_Aviary_No_Save);
}
file_put_contents($current_path.$_POST['path'].$_POST['name'],$image_data);
create_img_gd($current_path.$_POST['path'].$_POST['name'], $thumbs_base_path.$_POST['path'].$_POST['name'], 122, 91);
// TODO something with this function cause its blowing my mind
new_thumbnails_creation($current_path.$_POST['path'],$current_path.$_POST['path'].$_POST['name'],$_POST['name'],$current_path,$relative_image_creation,$relative_path_from_current_pos,$relative_image_creation_name_to_prepend,$relative_image_creation_name_to_append,$relative_image_creation_width,$relative_image_creation_height,$fixed_image_creation,$fixed_path_from_filemanager,$fixed_image_creation_name_to_prepend,$fixed_image_creation_to_append,$fixed_image_creation_width,$fixed_image_creation_height);
break;
case 'extract':
if(strpos($_POST['path'],'/')===0 || strpos($_POST['path'],'../')!==FALSE || strpos($_POST['path'],'./')===0) {
die('wrong path');
}
$path = $current_path.$_POST['path'];
$info = pathinfo($path);
$base_folder = $current_path.fix_dirname($_POST['path'])."/";
switch($info['extension'])
{
case "zip":
$zip = new ZipArchive;
if ($zip->open($path) === TRUE) {
//make all the folders
for($i = 0; $i < $zip->numFiles; $i++)
{
$OnlyFileName = $zip->getNameIndex($i);
$FullFileName = $zip->statIndex($i);
if (substr($FullFileName['name'], -1, 1) =="/")
{
create_folder($base_folder.$FullFileName['name']);
}
}
//unzip into the folders
for($i = 0; $i < $zip->numFiles; $i++)
{
$OnlyFileName = $zip->getNameIndex($i);
$FullFileName = $zip->statIndex($i);
if (!(substr($FullFileName['name'], -1, 1) =="/"))
{
$fileinfo = pathinfo($OnlyFileName);
if(in_array(strtolower($fileinfo['extension']),$ext))
{
copy('zip://'. $path .'#'. $OnlyFileName , $base_folder.$FullFileName['name'] );
}
}
}
$zip->close();
}
else {
die(lang_Zip_No_Extract);
}
break;
case "gz":
$p = new PharData($path);
$p->decompress(); // creates files.tar
break;
case "tar":
// unarchive from the tar
$phar = new PharData($path);
$phar->decompressFiles();
$files = array();
check_files_extensions_on_phar( $phar, $files, '', $ext );
$phar->extractTo( $current_path.fix_dirname( $_POST['path'] )."/", $files, TRUE );
break;
default:
die(lang_Zip_Invalid);
}
break;
case 'media_preview':
$preview_file = $_GET["file"];
$info = pathinfo($preview_file);
?>
<div id="jp_container_1" class="jp-video " style="margin:0 auto;">
<div class="jp-type-single">
<div id="jquery_jplayer_1" class="jp-jplayer"></div>
<div class="jp-gui">
<div class="jp-video-play">
<a href="javascript:;" class="jp-video-play-icon" tabindex="1">play</a>
</div>
<div class="jp-interface">
<div class="jp-progress">
<div class="jp-seek-bar">
<div class="jp-play-bar"></div>
</div>
</div>
<div class="jp-current-time"></div>
<div class="jp-duration"></div>
<div class="jp-controls-holder">
<ul class="jp-controls">
<li><a href="javascript:;" class="jp-play" tabindex="1">play</a></li>
<li><a href="javascript:;" class="jp-pause" tabindex="1">pause</a></li>
<li><a href="javascript:;" class="jp-stop" tabindex="1">stop</a></li>
<li><a href="javascript:;" class="jp-mute" tabindex="1" title="mute">mute</a></li>
<li><a href="javascript:;" class="jp-unmute" tabindex="1" title="unmute">unmute</a></li>
<li><a href="javascript:;" class="jp-volume-max" tabindex="1" title="max volume">max volume</a></li>
</ul>
<div class="jp-volume-bar">
<div class="jp-volume-bar-value"></div>
</div>
<ul class="jp-toggles">
<li><a href="javascript:;" class="jp-full-screen" tabindex="1" title="full screen">full screen</a></li>
<li><a href="javascript:;" class="jp-restore-screen" tabindex="1" title="restore screen">restore screen</a></li>
<li><a href="javascript:;" class="jp-repeat" tabindex="1" title="repeat">repeat</a></li>
<li><a href="javascript:;" class="jp-repeat-off" tabindex="1" title="repeat off">repeat off</a></li>
</ul>
</div>
<div class="jp-title" style="display:none;">
<ul>
<li></li>
</ul>
</div>
</div>
</div>
<div class="jp-no-solution">
<span>Update Required</span>
To play the media you will need to either update your browser to a recent version or update your <a href="http://get.adobe.com/flashplayer/" target="_blank">Flash plugin</a>.
</div>
</div>
</div>
<?php
if(in_array(strtolower($info['extension']), $ext_music)) {
?>
<script type="text/javascript">
$(document).ready(function(){
$("#jquery_jplayer_1").jPlayer({
ready: function () {
$(this).jPlayer("setMedia", {
title:"<?php $_GET['title']; ?>",
mp3: "<?php echo $preview_file; ?>",
m4a: "<?php echo $preview_file; ?>",
oga: "<?php echo $preview_file; ?>",
wav: "<?php echo $preview_file; ?>"
});
},
swfPath: "js",
solution:"html,flash",
supplied: "mp3, m4a, midi, mid, oga,webma, ogg, wav",
smoothPlayBar: true,
keyEnabled: false
});
});
</script>
<?php
} elseif(in_array(strtolower($info['extension']), $ext_video)) {
?>
<script type="text/javascript">
$(document).ready(function(){
$("#jquery_jplayer_1").jPlayer({
ready: function () {
$(this).jPlayer("setMedia", {
title:"<?php $_GET['title']; ?>",
m4v: "<?php echo $preview_file; ?>",
ogv: "<?php echo $preview_file; ?>"
});
},
swfPath: "js",
solution:"html,flash",
supplied: "mp4, m4v, ogv, flv, webmv, webm",
smoothPlayBar: true,
keyEnabled: false
});
});
</script>
<?php
}
break;
case 'copy_cut':
if ($_POST['sub_action'] != 'copy' && $_POST['sub_action'] != 'cut') {
die('wrong sub-action');
}
if (trim($_POST['path']) == '' || trim($_POST['path_thumb']) == '') {
die('no path');
}
$path = $current_path.$_POST['path'];
if (is_dir($path))
{
// can't copy/cut dirs
if ($copy_cut_dirs === FALSE){
die(sprintf(lang_Copy_Cut_Not_Allowed, ($_POST['sub_action'] == 'copy' ? lcfirst(lang_Copy) : lcfirst(lang_Cut)), lang_Folders));
}
// size over limit
if ($copy_cut_max_size !== FALSE && is_int($copy_cut_max_size)){
if (($copy_cut_max_size * 1024 * 1024) < foldersize($path)){
die(sprintf(lang_Copy_Cut_Size_Limit, ($_POST['sub_action'] == 'copy' ? lcfirst(lang_Copy) : lcfirst(lang_Cut)), $copy_cut_max_size));
}
}
// file count over limit
if ($copy_cut_max_count !== FALSE && is_int($copy_cut_max_count)){
if ($copy_cut_max_count < filescount($path)){
die(sprintf(lang_Copy_Cut_Count_Limit, ($_POST['sub_action'] == 'copy' ? lcfirst(lang_Copy) : lcfirst(lang_Cut)), $copy_cut_max_count));
}
}
}
else {
// can't copy/cut files
if ($copy_cut_files === FALSE){
die(sprintf(lang_Copy_Cut_Not_Allowed, ($_POST['sub_action'] == 'copy' ? lcfirst(lang_Copy) : lcfirst(lang_Cut)), lang_Files));
}
}
$_SESSION['RF']['clipboard']['path'] = $_POST['path'];
$_SESSION['RF']['clipboard']['path_thumb'] = $_POST['path_thumb'];
$_SESSION['RF']['clipboard_action'] = $_POST['sub_action'];
break;
case 'clear_clipboard':
$_SESSION['RF']['clipboard'] = NULL;
$_SESSION['RF']['clipboard_action'] = NULL;
break;
default: die('no action passed');
}
}
else
{
die('no action passed');
}
?>

View File

@@ -1,16 +1,16 @@
<?php
use Thelia\Core\HttpKernel\HttpCache\HttpCache;
use Thelia\Core\Thelia;
use Thelia\Core\HttpFoundation\Request;
//use Symfony\Component\DependencyInjection;
use Thelia\Core\Thelia;
use Thelia\Model\ConfigQuery;
$env = 'prod';
require __DIR__ . '/../../../../../core/bootstrap.php';
require __DIR__ . '/../../../../../../../../core/bootstrap.php';
$request = Request::createFromGlobals();
$thelia = new Thelia("prod", false);
$thelia = new Thelia($env, false);
$thelia->boot();
$httpKernel = $thelia->getContainer()->get('http_kernel');
@@ -18,64 +18,100 @@ $httpKernel = $thelia->getContainer()->get('http_kernel');
$httpKernel->getContainer()->enterScope('request');
$httpKernel->getContainer()->set('request', $request, 'request');
$httpKernel->initSession($request);
/** @var \Thelia\Core\Security\SecurityContext $securityContext */
$securityContext = $httpKernel->getContainer()->get('thelia.securityContext');
// We just check the current user has the ADMIN role.
$isGranted = $securityContext->isGranted(
array('ADMIN'),
array(
\Thelia\Core\Security\Resource\AdminResources::PRODUCT,
\Thelia\Core\Security\Resource\AdminResources::CATEGORY,
\Thelia\Core\Security\Resource\AdminResources::FOLDER,
\Thelia\Core\Security\Resource\AdminResources::CONTENT,
),
array(),
array(
\Thelia\Core\Security\AccessManager::UPDATE,
\Thelia\Core\Security\AccessManager::CREATE,
)
array('ADMIN'), array(), array(), array()
);
if (false === $isGranted) {
echo "Sorry, it seems that you're not allowed to use this function. ADMIN role is required.";
exit;
}
//------------------------------------------------------------------------------
// DON'T COPY THIS VARIABLES IN FOLDERS config.php FILES
// DO NOT COPY THESE VARIABLES IN FOLDERS config.php FILES
//------------------------------------------------------------------------------
//**********************
//Path configuration
//**********************
// In this configuration the folder tree is
// root
// |- source <- upload folder
// |- thumbs <- thumbnail folder [must have write permission (755)]
// |- filemanager
// |- js
// | |- tinymce
// | | |- plugins
// | | | |- responsivefilemanager
// | | | | |- plugin.min.js
$base_url=rtrim(\Thelia\Model\ConfigQuery::read('url_site'), '/'); // base url (only domain) of site (without final /). If you prefer relative urls leave empty
$upload_dir = '/media/'; // path from base_url to base of upload folder (with start and final /)
$current_path = '../../../media/'; // relative path from filemanager folder to upload folder (with final /)
//thumbs folder can't put inside upload folder
$thumbs_base_path = '../../../media/'; // relative path from filemanager folder to thumbs folder (with final /)
// In this configuration the media folder is located in the /web directory.
//------------------------------------------------------------------------------
// YOU CAN COPY AND CHANGE THESE VARIABLES IN FOLDERS config.php FILES
//------------------------------------------------------------------------------
// base url of site (without final /). if you prefer relative urls leave empty.
$base_url = rtrim(ConfigQuery::getConfiguredShopUrl(), '/');
$MaxSizeUpload=100; //Mb
// Argh, url_site is not defined ?!
if (empty($base_url)) {
// A we did not used the router to access this dialog, we cannot use the URL class. Use the good old method.
$base_url = $request->getSchemeAndHttpHost() . preg_replace('!/tinymce/filemanager/dialog.php.*$!', '', $_SERVER['REQUEST_URI']);
}
$default_language="en_EN"; //default language file name
// path from base_url to base of upload folder (with start and final /)
$upload_dir = '/media/upload/';
$show_folder_size=true; //Show or not show folder size in list view feature in filemanager (is possible, if there is a large folder, to greatly increase the calculations)
$show_sorting_bar=true; //Show or not show sorting feature in filemanager
$loading_bar=true; //Show or not show loading bar
// path to file manager folder to upload folder (with final /)
$current_path = THELIA_WEB_DIR . DS . 'media'. DS .'upload'. DS;
// path to file manager folder to thumbs folder (with final /)
// WARNING: thumbs folder should not be inside the upload folder
$thumbs_base_path = THELIA_WEB_DIR . DS . 'media'. DS .'thumbs'. DS;
// Set the language to the back-office current language, if it is available
$current_locale = $request->getSession()->getLang()->getLocale();
if (file_exists(__DIR__.DS.'..'.DS.'lang.'.DS.$current_locale.'.php')) {
$default_language = $current_locale;
}
else {
$default_language = 'en_EN';
}
// OPTIONAL SECURITY
// if set to true only those will access RF whose url contains the access key(akey) like:
// <input type="button" href="../filemanager/dialog.php?field_id=imgField&lang=en_EN&akey=myPrivateKey" value="Files">
// in tinymce a new parameter added: filemanager_access_key:"myPrivateKey"
// example tinymce config:
// tiny init ...
//
// external_filemanager_path:"../filemanager/",
// filemanager_title:"Filemanager" ,
// filemanager_access_key:"myPrivateKey" ,
// ...
define('USE_ACCESS_KEYS', FALSE); // TRUE or FALSE
// add access keys eg: array('myPrivateKey', 'someoneElseKey');
// keys should only containt (a-z A-Z 0-9 \ . _ -) characters
// if you are integrating lets say to a cms for admins, i recommend making keys randomized something like this:
// $username = 'Admin';
// $salt = 'dsflFWR9u2xQa' (a hard coded string)
// $akey = md5($username.$salt);
// DO NOT use 'key' as access key!
// Keys are CASE SENSITIVE!
$access_keys = array('myPrivateKey','someoneElseKey');
//--------------------------------------------------------------------------------------------------------
// YOU CAN COPY AND CHANGE THESE VARIABLES INTO FOLDERS config.php FILES TO CUSTOMIZE EACH FOLDER OPTIONS
//--------------------------------------------------------------------------------------------------------
$MaxSizeUpload = 100; //Mb
// SERVER OVERRIDE
if ((int)(ini_get('post_max_size')) < $MaxSizeUpload){
$MaxSizeUpload = (int)(ini_get('post_max_size'));
}
// $default_language = "en_EN"; //default language file name
$icon_theme = "ico"; //ico or ico_dark you can cusatomize just putting a folder inside filemanager/img
$show_folder_size = TRUE; //Show or not show folder size in list view feature in filemanager (is possible, if there is a large folder, to greatly increase the calculations)
$show_sorting_bar = TRUE; //Show or not show sorting feature in filemanager
$loading_bar = TRUE; //Show or not show loading bar
$transliteration = FALSE; //active or deactive the transliteration (mean convert all strange characters in A..Za..z0..9 characters)
//*******************************************
//Images limit and resizing configuration
@@ -84,16 +120,16 @@ $loading_bar=true; //Show or not show loading bar
// set maximum pixel width and/or maximum pixel height for all images
// If you set a maximum width or height, oversized images are converted to those limits. Images smaller than the limit(s) are unaffected
// if you don't need a limit set both to 0
$image_max_width=0;
$image_max_height=0;
$image_max_width = 0;
$image_max_height = 0;
//Automatic resizing //
// If you set $image_resizing to true the script converts all uploaded images exactly to image_resizing_width x image_resizing_height dimension
// If you set $image_resizing to TRUE the script converts all uploaded images exactly to image_resizing_width x image_resizing_height dimension
// If you set width or height to 0 the script automatically calculates the other dimension
// Is possible that if you upload very big images the script not work to overcome this increase the php configuration of memory and time limit
$image_resizing=false;
$image_resizing_width=0;
$image_resizing_height=0;
$image_resizing = FALSE;
$image_resizing_width = 0;
$image_resizing_height = 0;
//******************
// Default layout setting
@@ -101,23 +137,35 @@ $image_resizing_height=0;
// 0 => boxes
// 1 => detailed list (1 column)
// 2 => columns list (multiple columns depending on the width of the page)
// YOU CAN ALSO PASS THIS PARAMETERS USING SESSION VAR => $_SESSION["VIEW"]=
// YOU CAN ALSO PASS THIS PARAMETERS USING SESSION VAR => $_SESSION['RF']["VIEW"]=
//
//******************
$default_view=0;
$default_view = 0;
//set if the filename is truncated when overflow first row
$ellipsis_title_after_first_row=true;
$ellipsis_title_after_first_row = TRUE;
//*************************
//Permissions configuration
//******************
$delete_files=true;
$create_folders=true;
$delete_folders=true;
$upload_files=true;
$rename_files=true;
$rename_folders=true;
$delete_files = TRUE;
$create_folders = TRUE;
$delete_folders = TRUE;
$upload_files = TRUE;
$rename_files = TRUE;
$rename_folders = TRUE;
$duplicate_files = TRUE;
$copy_cut_files = TRUE; // for copy/cut files
$copy_cut_dirs = TRUE; // for copy/cut directories
// defines size limit for paste in MB / operation
// set 'FALSE' for no limit
$copy_cut_max_size = 100;
// defines file count limit for paste / operation
// set 'FALSE' for no limit
$copy_cut_max_count = 200;
//IF any of these limits reached, operation won't start and generate warning
//**********************
//Allowed extensions (lowercase insert)
@@ -128,22 +176,22 @@ $ext_video = array('mov', 'mpeg', 'mp4', 'avi', 'mpg','wma',"flv","webm"); //Vid
$ext_music = array('mp3', 'm4a', 'ac3', 'aiff', 'mid','ogg','wav'); //Audio
$ext_misc = array('zip', 'rar','gz','tar','iso','dmg'); //Archives
$ext=array_merge($ext_img, $ext_file, $ext_misc, $ext_video,$ext_music); //allowed extensions
$ext = array_merge($ext_img, $ext_file, $ext_misc, $ext_video,$ext_music); //allowed extensions
/******************
* AVIARY config
*******************/
$aviary_key="dvh8qudbp6yx2bnp";
$aviary_secret="m6xaym5q42rpw433";
$aviary_version=3;
$aviary_language='en';
*******************/
$aviary_active = FALSE;
$aviary_key = "dvh8qudbp6yx2bnp";
$aviary_secret = "m6xaym5q42rpw433";
$aviary_version = 3;
$aviary_language= 'en';
//The filter and sorter are managed through both javascript and php scripts because if you have a lot of
//file in a folder the javascript script can't sort all or filter all, so the filemanager switch to php script.
//The plugin automatic swich javascript to php when the current folder exceeds the below limit of files number
$file_number_limit_js=500;
$file_number_limit_js = 500;
//**********************
// Hidden files and folders
@@ -156,8 +204,8 @@ $hidden_files = array('config.php');
/*******************
* JAVA upload
*******************/
$java_upload=true;
$JAVAMaxSizeUpload=200; //Gb
$java_upload = TRUE;
$JAVAMaxSizeUpload = 200; //Gb
//************************************
@@ -171,7 +219,7 @@ $JAVAMaxSizeUpload=200; //Gb
// Remember than the image creation respect the folder hierarchy so if you are inside source/test/test1/ the new image will create at
// path_from_filemanager/test/test1/
// PS if there isn't write permission in your destination folder you must set it
$fixed_image_creation = false; //activate or not the creation of one or more image resized with fixed path from filemanager folder
$fixed_image_creation = FALSE; //activate or not the creation of one or more image resized with fixed path from filemanager folder
$fixed_path_from_filemanager = array('../test/','../test1/'); //fixed path of the image folder from the current position on upload folder
$fixed_image_creation_name_to_prepend = array('','test_'); //name to prepend on filename
$fixed_image_creation_to_append = array('_test',''); //name to appendon filename
@@ -183,7 +231,7 @@ $fixed_image_creation_height = array(200,''); //height of image (you
// With Responsive filemanager you can create automatically resized image inside the upload folder, also more than one at a time
// just simply add a value in the array
// The image creation path is always relative so if i'm inside source/test/test1 and I upload an image, the path start from here
$relative_image_creation = false; //activate or not the creation of one or more image resized with relative path from upload folder
$relative_image_creation = FALSE; //activate or not the creation of one or more image resized with relative path from upload folder
$relative_path_from_current_pos = array('thumb/','thumb/'); //relative path of the image folder from the current position on upload folder
$relative_image_creation_name_to_prepend= array('','test_'); //name to prepend on filename
$relative_image_creation_name_to_append = array('_test',''); //name to append on filename

View File

@@ -0,0 +1,8 @@
/*!
* Bootstrap Modal
*
* Copyright Jordan Schroter
* Licensed under the Apache License v2.0
* http://www.apache.org/licenses/LICENSE-2.0
*
*/.modal-open{overflow:hidden}.modal-open.page-overflow .page-container,.modal-open.page-overflow .page-container .navbar-fixed-top,.modal-open.page-overflow .page-container .navbar-fixed-bottom,.modal-open.page-overflow .modal-scrollable{overflow-y:scroll}@media (max-width:840px){.modal-open.page-overflow .page-container .navbar-fixed-top,.modal-open.page-overflow .page-container .navbar-fixed-bottom{overflow-y:visible}}.modal-scrollable{position:fixed;top:0;bottom:0;left:0;right:0;overflow:auto}.modal{outline:0;position:absolute;margin-top:0;top:50%;overflow:visible}.modal.fade{top:-100%;-webkit-transition:opacity .3s linear,top .3s ease-out,bottom .3s ease-out,margin-top .3s ease-out;-moz-transition:opacity .3s linear,top .3s ease-out,bottom .3s ease-out,margin-top .3s ease-out;-o-transition:opacity .3s linear,top .3s ease-out,bottom .3s ease-out,margin-top .3s ease-out;transition:opacity .3s linear,top .3s ease-out,bottom .3s ease-out,margin-top .3s ease-out}.modal.fade.in{top:50%}.modal-body{max-height:none;overflow:visible}.modal.modal-absolute{position:absolute;z-index:950}.modal .loading-mask{position:absolute;top:0;bottom:0;left:0;right:0;background:#fff;border-radius:6px}.modal-backdrop.modal-absolute{position:absolute;z-index:940}.modal-backdrop,.modal-backdrop.fade.in{opacity:.85;filter:alpha(opacity=85);background:#eee}.modal.container{width:940px;margin-left:-470px}.modal-overflow.modal{top:1%}.modal-overflow.modal.fade{top:-100%}.modal-overflow.modal.fade.in{top:1%}.modal-overflow .modal-body{overflow:auto;-webkit-overflow-scrolling:touch}@media (min-width:1200px){.modal.container{width:1170px;margin-left:-585px}}@media (max-width:840px){.modal,.modal.container,.modal.modal-overflow{top:1%;right:1%;left:1%;bottom:auto;width:auto!important;height:auto!important;margin:0!important;padding:0!important}.modal.fade.in,.modal.container.fade.in,.modal.modal-overflow.fade.in{top:1%;bottom:auto}.modal-body,.modal-overflow .modal-body{position:static;margin:0;height:auto!important;max-height:none!important;overflow:visible!important}.modal-footer,.modal-overflow .modal-footer{position:static}}.loading-spinner{position:absolute;top:50%;left:50%;margin:-12px 0 0 -12px}.animated{-webkit-animation-duration:1s;-moz-animation-duration:1s;-o-animation-duration:1s;animation-duration:1s;-webkit-animation-fill-mode:both;-moz-animation-fill-mode:both;-o-animation-fill-mode:both;animation-fill-mode:both}@-webkit-keyframes shake{0%,100%{-webkit-transform:translateX(0)}10%,30%,50%,70%,90%{-webkit-transform:translateX(-10px)}20%,40%,60%,80%{-webkit-transform:translateX(10px)}}@-moz-keyframes shake{0%,100%{-moz-transform:translateX(0)}10%,30%,50%,70%,90%{-moz-transform:translateX(-10px)}20%,40%,60%,80%{-moz-transform:translateX(10px)}}@-o-keyframes shake{0%,100%{-o-transform:translateX(0)}10%,30%,50%,70%,90%{-o-transform:translateX(-10px)}20%,40%,60%,80%{-o-transform:translateX(10px)}}@keyframes shake{0%,100%{transform:translateX(0)}10%,30%,50%,70%,90%{transform:translateX(-10px)}20%,40%,60%,80%{transform:translateX(10px)}}.shake{-webkit-animation-name:shake;-moz-animation-name:shake;-o-animation-name:shake;animation-name:shake}

View File

@@ -169,7 +169,7 @@
-o-transition: opacity 0.3s ease-in-out;
-ms-transition: opacity 0.3s ease-in-out;
transition: opacity 0.3s ease-in-out;
background-image: url("../img/spritemap.png");
/*background-image: url("../img/spritemap.png");*/
background-repeat: no-repeat;
background-position: 0 0;
position: absolute;
@@ -182,7 +182,7 @@
}
@media all and (-webkit-min-device-pixel-ratio:1.5),(min--moz-device-pixel-ratio:1.5),(-o-min-device-pixel-ratio:1.5/1),(min-device-pixel-ratio:1.5),(min-resolution:138dpi),(min-resolution:1.5dppx) {
.dropzone .dz-default.dz-message {
background-image: url("../img/spritemap@2x.png");
/*background-image: url("../img/spritemap@2x.png");*/
-webkit-background-size: 428px 406px;
-moz-background-size: 428px 406px;
background-size: 428px 406px;
@@ -251,7 +251,7 @@
-o-transition: opacity 0.4s ease-in-out;
-ms-transition: opacity 0.4s ease-in-out;
transition: opacity 0.4s ease-in-out;
background-image: url("../img/spritemap.png");
/*background-image: url("../img/spritemap.png");*/
background-repeat: no-repeat;
}
@media all and (-webkit-min-device-pixel-ratio:1.5),(min--moz-device-pixel-ratio:1.5),(-o-min-device-pixel-ratio:1.5/1),(min-device-pixel-ratio:1.5),(min-resolution:138dpi),(min-resolution:1.5dppx) {
@@ -259,7 +259,7 @@
.dropzone-previews .dz-preview .dz-error-mark,
.dropzone .dz-preview .dz-success-mark,
.dropzone-previews .dz-preview .dz-success-mark {
background-image: url("../img/spritemap@2x.png");
/*background-image: url("../img/spritemap@2x.png");*/
-webkit-background-size: 428px 406px;
-moz-background-size: 428px 406px;
background-size: 428px 406px;
@@ -298,14 +298,14 @@
left: 0;
width: 0%;
height: 100%;
background-image: url("../img/spritemap.png");
/*background-image: url("../img/spritemap.png");*/
background-repeat: repeat-x;
background-position: 0px -400px;
}
@media all and (-webkit-min-device-pixel-ratio:1.5),(min--moz-device-pixel-ratio:1.5),(-o-min-device-pixel-ratio:1.5/1),(min-device-pixel-ratio:1.5),(min-resolution:138dpi),(min-resolution:1.5dppx) {
.dropzone .dz-preview .dz-progress .dz-upload,
.dropzone-previews .dz-preview .dz-progress .dz-upload {
background-image: url("../img/spritemap@2x.png");
/*background-image: url("../img/spritemap@2x.png");*/
-webkit-background-size: 428px 406px;
-moz-background-size: 428px 406px;
background-size: 428px 406px;

View File

@@ -1,5 +1,5 @@
.context-menu-list{font-family:'Open Sans', sans-serif;width:200px;display:inline-block;position:absolute;list-style-type:none;border:1px solid #DDD;background:#fff;-webkit-box-shadow:0 2px 5px rgba(0,0,0,0.5);-moz-box-shadow:0 2px 5px rgba(0,0,0,0.5);-ms-box-shadow:0 2px 5px rgba(0,0,0,0.5);-o-box-shadow:0 2px 5px rgba(0,0,0,0.5);box-shadow:0 2px 5px rgba(0,0,0,0.5);font-size:12px;margin:0;padding:5px}
.context-menu-item{background-color:#fff;position:relative;border-bottom:1px solid #eee;height:auto;word-wrap:break-word;-webkit-user-select:none;-moz-user-select:0;-ms-user-select:none;user-select:none;padding:5px 5px 5px 30px}
.context-menu-list{font-family:'Open Sans', sans-serif;width:200px;display:inline-block;position:absolute;list-style-type:none;border:1px solid #DDD;background:#fff;font-size:12px;margin:0;padding:5px}
.context-menu-item{background-color:#fff;position:relative;height:auto;word-wrap:break-word;-webkit-user-select:none;-moz-user-select:0;-ms-user-select:none;user-select:none;padding:5px 5px 5px 30px}
.context-menu-item:last-child{border:none}
.context-menu-separator{padding-bottom:0;border-bottom:1px solid #DDD}
.context-menu-item > label > input,.context-menu-item > label > textarea{-webkit-user-select:text;-moz-user-select:text;-ms-user-select:text;user-select:text}
@@ -10,7 +10,7 @@
.context-menu-item.icon{min-height:18px;vertical-align:middle;background-repeat:no-repeat;background-position:4px 5px;width:auto;display:list-item}
.context-menu-item.icon-edit{background-image:url(../img/page_white_edit.png)}
.context-menu-item.icon-cut{background-image:url(../img/cut.png)}
.context-menu-item.icon-copy{background-image:url(../img/page_white_copy.png)}
.context-menu-item.icon-copy{background-image:url(../img/copy.png)}
.context-menu-item.icon-rename{background-image:url(../img/rename.png)}
.context-menu-item.icon-preview{background-image:url(../img/preview.png)}
.context-menu-item.icon-dimension{background-image:url(../img/dimension.png)}
@@ -19,6 +19,7 @@
.context-menu-item.icon-size{background-image:url(../img/size.png)}
.context-menu-item.icon-download{background-image:url(../img/download.png)}
.context-menu-item.icon-paste{background-image:url(../img/page_white_paste.png)}
.context-menu-item.icon-clipboard-apply {background-image:url(../img/clipboard_apply.png)}
.context-menu-item.icon-delete{background-image:url(../img/page_white_delete.png)}
.context-menu-item.icon-add{background-image:url(../img/page_white_add.png)}
.context-menu-item.icon-quit{background-image:url(../img/door.png)}
@@ -26,6 +27,7 @@
.context-menu-item.icon-extract{background-image:url(../img/zip.png)}
.context-menu-item.icon-url{background-image:url(../img/url.png)}
.context-menu-item.icon-edit_img{background-image:url(../img/edit_img.png)}
.context-menu-item.icon-duplicate{background-image:url(../img/duplicate.png)}
.context-menu-input > label > *{vertical-align:top}
.context-menu-input > label > input[type=checkbox],.context-menu-input > label > input[type=radio]{margin-left:-17px}
.context-menu-input > label > span{margin-left:5px}

File diff suppressed because one or more lines are too long

View File

@@ -5,7 +5,8 @@ body, html {
body{
padding-top: 32px;
font-weight:200;
background:#eeeeee;
background:#ececec;
overflow: -moz-scrollbars-vertical;
}
#qLpercentage{
@@ -33,10 +34,31 @@ body{
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#667a7a7a', endColorstr='#667a7a7a',GradientType=0 ); /* IE6-8 */
z-index:200;
margin-left: 10px;
margin:0px;
overflow: hidden;
}
[class^="rficon-"],[class*=" rficon-"] {
display:inline-block;
width:16px;
height:16px;
margin-top:1px;
*margin-right:.3em;
line-height:16px;
vertical-align:text-top;
background-position: 0 0;
background-repeat:no-repeat
}
.rficon-clipboard-apply {
background-image:url(../img/clipboard_apply.png);
}
.rficon-clipboard-clear {
background-image:url(../img/clipboard_clear.png);
}
.btn{
-webkit-border-radius: 0px;
border-radius: 0px;
@@ -154,7 +176,7 @@ input#filter-input{
.qq-uploader .span9{margin-left:14px !important;width:690px !important;}
.space10{ clear:both; height:10px; }
h4{ font-size:11px; font-weight:200; margin: 0px; text-align: center; padding: 0px; margin-top:6px; line-height: 18px; }
h4{ font-size:12px; font-weight:200; margin: 0px; text-align: center; padding: 0px; margin-top:6px; line-height: 18px; }
h3{ font-size:14px; font-weight:200;}
.boxes{ border:1px solid #CCCCCC; word-wrap: break-word; background:white;
-webkit-box-shadow: 1px 1px 2px 0px rgba(0, 0, 0, 0.2);box-shadow: 1px 1px 2px 0px rgba(0, 0, 0, 0.2); min-height:115px;
@@ -400,14 +422,20 @@ ul.sorting.dropdown-menu>li>a{
.navbar .navbar-inner{
padding-bottom: 4px;
}
.filters{
div.span3.half,div.half.span6{
float:none;
width:100%;
}
}
.container-fluid{
margin:0px !important;
padding: 0px;
}
#qLbar{
position: absolute;
top:8px !important;
height:50px !important;
}
}
@media(min-width:400px) and (max-width:839px){
@@ -437,9 +465,11 @@ ul.sorting.dropdown-menu>li>a{
.grid li {
display: inline-block;
width: 126px;
width: 124px;
border:none;
margin: 4px;
padding: 2px;
margin-bottom:8px;
padding: 0px;
vertical-align: top;
}
@@ -465,27 +495,27 @@ ul.sorting.dropdown-menu>li>a{
padding-top: 8px;
color: white;
height: 30px;
width: 118px;
margin-left:2px;
margin-right: 2px;
width: 122px;
margin-left:0px;
margin-right: 0px;
position: absolute;
top: auto;
bottom: 0;
-webkit-box-shadow: inset 0px 0px 8px 0px rgba(41, 41, 41, 0.5);
box-shadow: inset 0px 0px 8px 0px rgba(41, 41, 41, 0.5);
}
.grid figcaption a{
a{
margin: 0px;
padding: 3px;
}
.grid figcaption h3 {
}
h3 {
margin: 0;
padding: 0;
color: #fff;
}
}
.grid h4{
text-align: center;
color: black;
@@ -528,8 +558,10 @@ ul.sorting.dropdown-menu>li>a{
}
.selected{
-webkit-box-shadow: 0px 0px 10px 5px rgba(0, 0, 0, 0.6);
box-shadow: 0px 0px 10px 5px rgba(0, 0, 0, 0.6);
-webkit-box-shadow: 0px 0px 10px 5px rgba(0, 0, 0, 0.25);
box-shadow: 0px 0px 10px 5px rgba(0, 0, 0, 0.25);
//border: 1px solid #777777;
}
}
@@ -539,7 +571,9 @@ ul.sorting.dropdown-menu>li>a{
-moz-transition: -moz-transform 0.3s;
transition: transform 0.3s;
}
.ui-state-highlight{
border:1px solid red;
}
.no-touch .list-view0 figure:hover .box,
.no-touch .list-view0 figure.cs-hover .box {
@@ -564,6 +598,7 @@ ul.sorting.dropdown-menu>li>a{
.list-view0 .img-precontainer-mini{
display: none;
background: none;
}
a,a:hover{
color:black;
@@ -601,49 +636,44 @@ form{
.list-view0.grid{
.img-precontainer{
.img-container{
img{
img{
max-width:122px !important;
max-height:91px !important;
}
img.icon{
width: 122px;
border:1px solid #cccccc;
margin-top:0px;
}
}
.filetype{
position:absolute;
top:1px;
right:1px;
padding:2px 3px;
top:0px;
width:120px;
text-align:center;
color:white;
font-size: 16px;
line-height: 18px;
/* IE9 SVG, needs conditional override of 'filter' to 'none' */
background: url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiA/Pgo8c3ZnIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgd2lkdGg9IjEwMCUiIGhlaWdodD0iMTAwJSIgdmlld0JveD0iMCAwIDEgMSIgcHJlc2VydmVBc3BlY3RSYXRpbz0ibm9uZSI+CiAgPGxpbmVhckdyYWRpZW50IGlkPSJncmFkLXVjZ2ctZ2VuZXJhdGVkIiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSIgeDE9IjAlIiB5MT0iMCUiIHgyPSIwJSIgeTI9IjEwMCUiPgogICAgPHN0b3Agb2Zmc2V0PSIwJSIgc3RvcC1jb2xvcj0iIzAwMDAwMCIgc3RvcC1vcGFjaXR5PSIwLjYiLz4KICAgIDxzdG9wIG9mZnNldD0iMTAwJSIgc3RvcC1jb2xvcj0iIzAwMDAwMCIgc3RvcC1vcGFjaXR5PSIwLjYiLz4KICA8L2xpbmVhckdyYWRpZW50PgogIDxyZWN0IHg9IjAiIHk9IjAiIHdpZHRoPSIxIiBoZWlnaHQ9IjEiIGZpbGw9InVybCgjZ3JhZC11Y2dnLWdlbmVyYXRlZCkiIC8+Cjwvc3ZnPg==);
background: -moz-linear-gradient(top, rgba(0,0,0,0.6) 0%, rgba(0,0,0,0.6) 100%); /* FF3.6+ */
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,rgba(0,0,0,0.6)), color-stop(100%,rgba(0,0,0,0.6))); /* Chrome,Safari4+ */
background: -webkit-linear-gradient(top, rgba(0,0,0,0.6) 0%,rgba(0,0,0,0.6) 100%); /* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(top, rgba(0,0,0,0.6) 0%,rgba(0,0,0,0.6) 100%); /* Opera 11.10+ */
background: -ms-linear-gradient(top, rgba(0,0,0,0.6) 0%,rgba(0,0,0,0.6) 100%); /* IE10+ */
background: linear-gradient(to bottom, rgba(0,0,0,0.6) 0%,rgba(0,0,0,0.6) 100%); /* W3C */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#99000000', endColorstr='#99000000',GradientType=0 ); /* IE6-8 */
border-bottom: 1px solid #111111;
border-left: 1px solid #111111;
-webkit-border-radius: 0px 0px 0px 6px;
border-radius: 0px 0px 0px 6px;
font-size: 13px;
line-height: 22px;
}
}
.cover{
-webkit-box-shadow: inset 0px 0px 25px 0px rgba(0, 0, 0, 0.3);
/* IE9 SVG, needs conditional override of 'filter' to 'none' */
background: url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiA/Pgo8c3ZnIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgd2lkdGg9IjEwMCUiIGhlaWdodD0iMTAwJSIgdmlld0JveD0iMCAwIDEgMSIgcHJlc2VydmVBc3BlY3RSYXRpbz0ibm9uZSI+CiAgPGxpbmVhckdyYWRpZW50IGlkPSJncmFkLXVjZ2ctZ2VuZXJhdGVkIiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSIgeDE9IjAlIiB5MT0iMCUiIHgyPSIwJSIgeTI9IjEwMCUiPgogICAgPHN0b3Agb2Zmc2V0PSIwJSIgc3RvcC1jb2xvcj0iI2ZmZmZmZiIgc3RvcC1vcGFjaXR5PSIwLjI1Ii8+CiAgICA8c3RvcCBvZmZzZXQ9IjEwMCUiIHN0b3AtY29sb3I9IiNmZmZmZmYiIHN0b3Atb3BhY2l0eT0iMC4yNSIvPgogIDwvbGluZWFyR3JhZGllbnQ+CiAgPHJlY3QgeD0iMCIgeT0iMCIgd2lkdGg9IjEiIGhlaWdodD0iMSIgZmlsbD0idXJsKCNncmFkLXVjZ2ctZ2VuZXJhdGVkKSIgLz4KPC9zdmc+);
background: -moz-linear-gradient(top, rgba(255,255,255,0.25) 0%, rgba(255,255,255,0.25) 100%); /* FF3.6+ */
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,rgba(255,255,255,0.25)), color-stop(100%,rgba(255,255,255,0.25))); /* Chrome,Safari4+ */
background: -webkit-linear-gradient(top, rgba(255,255,255,0.25) 0%,rgba(255,255,255,0.25) 100%); /* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(top, rgba(255,255,255,0.25) 0%,rgba(255,255,255,0.25) 100%); /* Opera 11.10+ */
background: -ms-linear-gradient(top, rgba(255,255,255,0.25) 0%,rgba(255,255,255,0.25) 100%); /* IE10+ */
background: linear-gradient(to bottom, rgba(255,255,255,0.25) 0%,rgba(255,255,255,0.25) 100%); /* W3C */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#40ffffff', endColorstr='#40ffffff',GradientType=0 ); /* IE6-8 */
box-shadow: inset 0px 0px 25px 0px rgba(0, 0, 0, 0.3);
width: 122px;
position:absolute;
top:0px;
top:22px;
right:0px;
height: 91px;
height: 69px;
}
.box{
background: white;
@@ -656,6 +686,10 @@ filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#99000000', e
background: #bbbbbb;
}
}
figcaption{
background:#ffffff;
}
}
.list-view1.grid , .list-view2.grid {
@@ -667,8 +701,8 @@ filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#99000000', e
}
}
}
li:nth-child(odd) figure {background: #f6f6f6; }
li:nth-child(odd) figure.directory {background: #d2d2d2; }
li:nth-child(odd) figure {background: #f9f9f9; }
li:nth-child(odd) figure.directory {background: #eaeaea; }
li figure{
border-bottom: 1px solid #cccccc;
@@ -680,7 +714,7 @@ filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#99000000', e
}
}
&.directory{
background: #dddddd;
background: #efefef;
box{
padding: 0px;
min-height: 10px;
@@ -710,26 +744,20 @@ filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#99000000', e
}
.filetype{
position:absolute;
top:0px;
top:5px;
text-align: center;
left:0px;
left:5px;
padding:1px 2px;
font-size: 14px;
line-height: 32px;
width:45px;
height: 34px;
font-size: 13px;
line-height: 22px;
width:34px;
height: 24px;
color:white;
background: #333333;
}
}
.cover{
position:absolute;
top:0;
left:0;
width: 45px;
height: 34px;
-webkit-box-shadow: inset 0px 0px 10px 0px rgba(0, 0, 0, 0.4);
box-shadow: inset 0px 0px 10px 0px rgba(0, 0, 0, 0.4);
display: none;
}
.img-container-mini{
width: 45px;
@@ -762,6 +790,7 @@ filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#99000000', e
}
figcaption{
background:none;
width: 120px;
position: absolute;
right: 0px;
@@ -774,8 +803,8 @@ filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#99000000', e
}
.selected{
-webkit-box-shadow: 0px 0px 3px 2px rgba(0, 0, 0, 0.6);
box-shadow: 0px 0px 3px 2px rgba(0, 0, 0, 0.6);
-webkit-box-shadow: 0px 0px 3px 2px rgba(0, 0, 0, 0.2);
box-shadow: 0px 0px 3px 2px rgba(0, 0, 0, 0.2);
}
}

View File

@@ -1,8 +1,20 @@
<?php
include('config/config.php');
$_SESSION["verify"]= "RESPONSIVEfilemanager";
if (USE_ACCESS_KEYS == TRUE){
if (!isset($_GET['akey'], $access_keys) || empty($access_keys)){
die('Access Denied!');
}
$_GET['akey'] = strip_tags(preg_replace( "/[^a-zA-Z0-9\._-]/", '', $_GET['akey']));
if (!in_array($_GET['akey'], $access_keys)){
die('Access Denied!');
}
}
$_SESSION['RF']["verify"]= "RESPONSIVEfilemanager";
if(isset($_POST['submit'])){
@@ -15,21 +27,20 @@ include('include/utils.php');
if (isset($_GET['fldr'])
&& !empty($_GET['fldr'])
&& strpos($_GET['fldr'],'../')===FALSE
&& strpos($_GET['fldr'],'./')===FALSE
&& strpos($_GET['fldr'],'.')===FALSE)
$subdir = trim($_GET['fldr'],"/") ."/";
&& strpos($_GET['fldr'],'./')===FALSE)
$subdir = urldecode(trim(strip_tags($_GET['fldr']),"/") ."/");
else
$subdir = '';
//remember last position
setcookie('last_position',$subdir,time() + (86400 * 7));
if($subdir==""){
if(!empty($_COOKIE['last_position'])
&& strpos($_COOKIE['last_position'],'.')===FALSE)
$subdir= trim($_COOKIE['last_position'])."/";
$subdir= trim($_COOKIE['last_position']);
}
//remember last position
setcookie('last_position',$subdir,time() + (86400 * 7));
if($subdir=="/"){
$subdir="";
}
@@ -38,31 +49,31 @@ if($subdir=="/"){
/***
*SUB-DIR CODE
***/
if(!isset($_SESSION["subfolder"])) $_SESSION["subfolder"]='';
$subfolder = '';
if(!empty($_SESSION["subfolder"]) && strpos($_SESSION["subfolder"],'../')===FALSE
&& strpos($_SESSION["subfolder"],'./')===FALSE && strpos($_SESSION["subfolder"],"/")!==0
&& strpos($_SESSION["subfolder"],'.')===FALSE) $subfolder= $_SESSION['subfolder'];
if(!isset($_SESSION['RF']["subfolder"])) $_SESSION['RF']["subfolder"]='';
$rfm_subfolder = '';
if(!empty($_SESSION['RF']["subfolder"]) && strpos($_SESSION['RF']["subfolder"],'../')===FALSE
&& strpos($_SESSION['RF']["subfolder"],'./')===FALSE && strpos($_SESSION['RF']["subfolder"],"/")!==0
&& strpos($_SESSION['RF']["subfolder"],'.')===FALSE) $rfm_subfolder= $_SESSION['RF']['subfolder'];
if($subfolder!="" && $subfolder[strlen($subfolder)-1]!="/") $subfolder.="/";
if($rfm_subfolder!="" && $rfm_subfolder[strlen($rfm_subfolder)-1]!="/") $rfm_subfolder.="/";
if(!file_exists($current_path . $subfolder.$subdir)){
if(!file_exists($current_path . $rfm_subfolder.$subdir)){
$subdir='';
if(!file_exists($current_path . $subfolder.$subdir)){
$subfolder="";
if(!file_exists($current_path . $rfm_subfolder.$subdir)){
$rfm_subfolder="";
}
}
if(trim($subfolder)==""){
if(trim($rfm_subfolder)==""){
$cur_dir = $upload_dir . $subdir;
$cur_path = $current_path . $subdir;
$thumbs_path = $thumbs_base_path;
$parent=$subdir;
}else{
$cur_dir = $upload_dir . $subfolder.$subdir;
$cur_path = $current_path . $subfolder.$subdir;
$thumbs_path = $thumbs_base_path. $subfolder;
$parent=$subfolder.$subdir;
$cur_dir = $upload_dir . $rfm_subfolder.$subdir;
$cur_path = $current_path . $rfm_subfolder.$subdir;
$thumbs_path = $thumbs_base_path. $rfm_subfolder;
$parent=$rfm_subfolder.$subdir;
}
$cycle=true;
@@ -84,28 +95,32 @@ if(!is_dir($thumbs_path.$subdir)){
create_folder(false, $thumbs_path.$subdir);
}
if(isset($_GET['popup'])) $popup= $_GET['popup']; else $popup=0;
if(isset($_GET['popup'])) $popup= strip_tags($_GET['popup']); else $popup=0;
//Sanitize popup
$popup=!!$popup;
//view type
if(!isset($_SESSION["view_type"])){ $view=$default_view; $_SESSION["view_type"] = $view; }
if(isset($_GET['view'])){ $view=$_GET['view']; $_SESSION["view_type"] = $view; }
$view=$_SESSION["view_type"];
if(!isset($_SESSION['RF']["view_type"])){ $view=$default_view; $_SESSION['RF']["view_type"] = $view; }
if(isset($_GET['view'])){ $view=fix_get_params($_GET['view']); $_SESSION['RF']["view_type"] = $view; }
$view=$_SESSION['RF']["view_type"];
if(isset($_GET["filter"])) $filter=fix_filename($_GET["filter"]);
if(isset($_GET["filter"])) $filter=fix_get_params($_GET["filter"]);
else $filter='';
if(!isset($_SESSION['sort_by'])) $_SESSION['sort_by']='';
if(isset($_GET["sort_by"])) $sort_by=$_SESSION['sort_by']=fix_filename($_GET["sort_by"]);
else $sort_by=$_SESSION['sort_by'];
if(!isset($_SESSION['RF']['sort_by'])) $_SESSION['RF']['sort_by']='';
if(isset($_GET["sort_by"])) $sort_by=$_SESSION['RF']['sort_by']=fix_get_params($_GET["sort_by"]);
else $sort_by=$_SESSION['RF']['sort_by'];
if(!isset($_SESSION['descending'])) $_SESSION['descending']=false;
if(isset($_GET["descending"])) $descending=$_SESSION['descending']=fix_filename($_GET["descending"])==="true";
else $descending=$_SESSION['descending'];
if(!isset($_SESSION['RF']['descending'])) $_SESSION['RF']['descending']=false;
if(isset($_GET["descending"])) $descending=$_SESSION['RF']['descending']=fix_get_params($_GET["descending"])==="true";
else $descending=$_SESSION['RF']['descending'];
$lang=$default_language;
if(isset($_GET['lang']) && $_GET['lang'] != 'undefined' && $_GET['lang']!='')
$lang=$_GET['lang'];
if(isset($_GET['lang']) && $_GET['lang'] != 'undefined' && $_GET['lang']!='') {
$lang=fix_get_params($_GET['lang']);
$lang=trim($lang);
}
$language_file = 'lang/'.$default_language.'.php';
if ($lang!=$default_language) {
@@ -113,19 +128,27 @@ if ($lang!=$default_language) {
if(is_readable('lang/' .$path_parts['basename']. '.php')){
$language_file = 'lang/' .$path_parts['basename']. '.php';
}
else {
echo "<script>console.log('The ".$lang." language file is not readable! Falling back...');</script>";
}
}
// add lang file to session for easy include
$_SESSION['RF']['language_file'] = $language_file;
require_once $language_file;
if(!isset($_GET['type'])) $_GET['type']=0;
if(!isset($_GET['field_id'])) $_GET['field_id']='';
$field_id=isset($_GET['field_id']) ? fix_get_params($_GET['field_id']) : '';
$type_param=fix_get_params($_GET['type']);
$get_params = http_build_query(array(
'type' => $_GET['type'],
'type' => $type_param,
'lang' => $lang,
'popup' => $popup,
'field_id' => isset($_GET['field_id']) ? $_GET['field_id'] : '',
'field_id' => $field_id,
'akey' => (isset($_GET['akey']) && $_GET['akey'] != '' ? $_GET['akey'] : 'key'),
'fldr' => ''
));
?>
@@ -135,6 +158,7 @@ $get_params = http_build_query(array(
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" >
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<meta name="robots" content="noindex,nofollow">
<title>Responsive FileManager</title>
<link rel="shortcut icon" href="img/ico/favicon.ico">
@@ -143,6 +167,44 @@ $get_params = http_build_query(array(
<link href="css/bootstrap-lightbox.min.css" rel="stylesheet" type="text/css" />
<link href="css/style.css" rel="stylesheet" type="text/css" />
<link href="css/dropzone.min.css" type="text/css" rel="stylesheet" />
<?php
$sprite_lang_file = 'img/spritemap_'.$lang.'.png';
$sprite_lang_file2 = 'img/spritemap@2x_'.$lang.'.png';
if ( ! file_exists($sprite_lang_file) || ! file_exists($sprite_lang_file2)){
//fallback
$sprite_lang_file = 'img/spritemap_en_EN.png';
$sprite_lang_file2 = 'img/spritemap@2x_en_EN.png';
if ( ! file_exists($sprite_lang_file) || ! file_exists($sprite_lang_file2)){
// we are in deep ****
echo '<script>console.log("Error: Spritemap not found!");</script>';
// exit();
}
}
?>
<style>
.dropzone .dz-default.dz-message,
.dropzone .dz-preview .dz-error-mark,
.dropzone-previews .dz-preview .dz-error-mark,
.dropzone .dz-preview .dz-success-mark,
.dropzone-previews .dz-preview .dz-success-mark,
.dropzone .dz-preview .dz-progress .dz-upload,
.dropzone-previews .dz-preview .dz-progress .dz-upload {
background-image: url(<?php echo $sprite_lang_file; ?>);
}
@media all and (-webkit-min-device-pixel-ratio:1.5),(min--moz-device-pixel-ratio:1.5),(-o-min-device-pixel-ratio:1.5/1),(min-device-pixel-ratio:1.5),(min-resolution:138dpi),(min-resolution:1.5dppx) {
.dropzone .dz-default.dz-message,
.dropzone .dz-preview .dz-error-mark,
.dropzone-previews .dz-preview .dz-error-mark,
.dropzone .dz-preview .dz-success-mark,
.dropzone-previews .dz-preview .dz-success-mark,
.dropzone .dz-preview .dz-progress .dz-upload,
.dropzone-previews .dz-preview .dz-progress .dz-upload {
background-image: url(<?php echo $sprite_lang_file; ?>);
}
}
</style>
<link href="css/jquery.contextMenu.min.css" rel="stylesheet" type="text/css" />
<link href="css/bootstrap-modal.min.css" rel="stylesheet" type="text/css" />
<link href="jPlayer/skin/blue.monday/jplayer.blue.monday.css" rel="stylesheet" type="text/css">
@@ -152,7 +214,7 @@ $get_params = http_build_query(array(
height: 100%;
}
</style><![endif]-->
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<script type="text/javascript">
if (typeof jQuery === 'undefined')
{
@@ -170,18 +232,27 @@ $get_params = http_build_query(array(
<script type="text/javascript" src="jPlayer/jquery.jplayer.min.js"></script>
<script type="text/javascript" src="js/imagesloaded.pkgd.min.js"></script>
<script type="text/javascript" src="js/jquery.queryloader2.min.js"></script>
<?php
if($aviary_active){
if (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off' || $_SERVER['SERVER_PORT'] == 443) { ?>
<script type="text/javascript" src="https://dme0ih8comzn4.cloudfront.net/js/feather.js"></script>
<?php }else{ ?>
<script type="text/javascript" src="http://feather.aviary.com/js/feather.js "></script>
<?php }} ?>
<!-- Le HTML5 shim, for IE6-8 support of HTML5 elements -->
<!--[if lt IE 9]>
<script src="https://html5shim.googlecode.com/svn/trunk/html5.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/html5shiv/3.6.2/html5shiv.js"></script>
<![endif]-->
<script src="js/jquery.ui.position.min.js" type="text/javascript"></script>
<script src="js/jquery-ui-1.10.4.custom.js" type="text/javascript"></script>
<script src="js/jquery.contextMenu.min.js" type="text/javascript"></script>
<script>
var ext_img=new Array('<?php echo implode("','", $ext_img)?>');
var allowed_ext=new Array('<?php echo implode("','", $ext)?>');
var loading_bar=<?php echo $loading_bar?"true":"false"; ?>;
var image_editor=<?php echo $aviary_active?"true":"false"; ?>;
//dropzone config
Dropzone.options.myAwesomeDropzone = {
dictInvalidFileType: "<?php echo lang_Error_extension;?>",
@@ -196,10 +267,12 @@ $get_params = http_build_query(array(
if ($.inArray(extension, allowed_ext) > -1) {
done();
}
else { done("<?php echo lang_Error_extension;?>"); }
else {
done("<?php echo lang_Error_extension;?>");
}
}
};
if (image_editor) {
var featherEditor = new Aviary.Feather({
apiKey: "<?php echo $aviary_key; ?>",
apiVersion: <?php echo $aviary_version; ?>,
@@ -207,6 +280,7 @@ $get_params = http_build_query(array(
theme: 'light',
tools: 'all',
onSave: function(imageID, newURL) {
show_animation();
var img = document.getElementById(imageID);
img.src = newURL;
$.ajax({
@@ -222,13 +296,16 @@ $get_params = http_build_query(array(
$("figure[data-name='"+$('#aviary_img').data('name')+"']").find('figcaption a.preview').each(function(){
$(this).data('url',$(this).data('url')+"?"+d.getTime());
});
hide_animation();
});
return false;
},
onError: function(errorObj) {
bootbox.alert(errorObj.message);
}
});
}
</script>
<script type="text/javascript" src="js/include.min.js"></script>
</head>
@@ -242,26 +319,41 @@ $get_params = http_build_query(array(
<input type="hidden" id="ok" value="<?php echo lang_OK; ?>" />
<input type="hidden" id="cancel" value="<?php echo lang_Cancel; ?>" />
<input type="hidden" id="rename" value="<?php echo lang_Rename; ?>" />
<input type="hidden" id="lang_duplicate" value="<?php echo lang_Duplicate; ?>" />
<input type="hidden" id="duplicate" value="<?php if($duplicate_files) echo 1; else echo 0; ?>" />
<input type="hidden" id="base_url" value="<?php echo $base_url?>"/>
<input type="hidden" id="base_url_true" value="<?php echo base_url(); ?>"/>
<input type="hidden" id="fldr_value" value="<?php echo $subdir; ?>"/>
<input type="hidden" id="sub_folder" value="<?php echo $subfolder; ?>"/>
<input type="hidden" id="sub_folder" value="<?php echo $rfm_subfolder; ?>"/>
<input type="hidden" id="file_number_limit_js" value="<?php echo $file_number_limit_js; ?>" />
<input type="hidden" id="descending" value="<?php echo $descending?"true":"false"; ?>" />
<?php $protocol = strpos(mb_strtolower($_SERVER['SERVER_PROTOCOL']),'https') === FALSE ? 'http' : 'https'; ?>
<?php $protocol = 'http'; ?>
<input type="hidden" id="current_url" value="<?php echo str_replace(array('&filter='.$filter),array(''),$protocol."://".$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']); ?>" />
<input type="hidden" id="lang_show_url" value="<?php echo lang_Show_url; ?>" />
<input type="hidden" id="lang_extract" value="<?php echo lang_Extract; ?>" />
<input type="hidden" id="lang_file_info" value="<?php echo mb_strtoupper(lang_File_info); ?>" />
<input type="hidden" id="copy_cut_files_allowed" value="<?php if($copy_cut_files) echo 1; else echo 0; ?>" />
<input type="hidden" id="copy_cut_dirs_allowed" value="<?php if($copy_cut_dirs) echo 1; else echo 0; ?>" />
<input type="hidden" id="copy_cut_max_size" value="<?php echo $copy_cut_max_size; ?>" />
<input type="hidden" id="copy_cut_max_count" value="<?php echo $copy_cut_max_count; ?>" />
<input type="hidden" id="lang_copy" value="<?php echo lang_Copy; ?>" />
<input type="hidden" id="lang_cut" value="<?php echo lang_Cut; ?>" />
<input type="hidden" id="lang_paste" value="<?php echo lang_Paste; ?>" />
<input type="hidden" id="lang_paste_here" value="<?php echo lang_Paste_Here; ?>" />
<input type="hidden" id="lang_paste_confirm" value="<?php echo lang_Paste_Confirm; ?>" />
<input type="hidden" id="lang_files_on_clipboard" value="<?php echo lang_Files_ON_Clipboard; ?>" />
<input type="hidden" id="clipboard" value="<?php echo ((isset($_SESSION['RF']['clipboard']['path']) && trim($_SESSION['RF']['clipboard']['path']) != null) ? 1 : 0); ?>" />
<input type="hidden" id="lang_clear_clipboard_confirm" value="<?php echo lang_Clear_Clipboard_Confirm; ?>" />
<input type="hidden" id="lang_file_info" value="<?php echo fix_strtoupper(lang_File_info); ?>" />
<input type="hidden" id="lang_edit_image" value="<?php echo lang_Edit_image; ?>" />
<input type="hidden" id="lang_extract" value="<?php echo lang_Extract; ?>" />
<input type="hidden" id="transliteration" value="<?php echo $transliteration?"true":"false"; ?>" />
<?php if($upload_files){ ?>
<!----- uploader div start ------->
<!-- uploader div start -->
<div class="uploader">
<center><button class="btn btn-inverse close-uploader"><i class="icon-backward icon-white"></i> <?php echo lang_Return_Files_List?></button></center>
<div class="space10"></div><div class="space10"></div>
<?php if($java_upload){ ?>
<div class="tabbable upload-tabbable"> <!-- Only required for left/right tabs -->
<?php if($java_upload){ ?>
<ul class="nav nav-tabs">
<li class="active"><a href="#tab1" data-toggle="tab"><?php echo lang_Upload_base; ?></a></li>
<li><a href="#tab2" id="uploader-btn" data-toggle="tab"><?php echo lang_Upload_java; ?></a></li>
@@ -277,29 +369,27 @@ $get_params = http_build_query(array(
<input name="file" type="file" />
<input type="hidden" name="fldr" value="<?php echo $subdir; ?>"/>
<input type="hidden" name="view" value="<?php echo $view; ?>"/>
<input type="hidden" name="type" value="<?php echo $_GET['type']; ?>"/>
<input type="hidden" name="field_id" value="<?php echo $_GET['field_id']; ?>"/>
<input type="hidden" name="type" value="<?php echo $type_param; ?>"/>
<input type="hidden" name="field_id" value="<?php echo $field_id; ?>"/>
<input type="hidden" name="popup" value="<?php echo $popup; ?>"/>
<input type="hidden" name="lang" value="<?php echo $lang; ?>"/>
<input type="hidden" name="filter" value="<?php echo $filter; ?>"/>
<input type="submit" name="submit" value="<?php echo lang_OK?>" />
</div>
</form>
</div>
<div class="upload-help"><?php echo lang_Upload_base_help; ?></div>
<?php if($java_upload){ ?>
</div>
<div class="tab-pane" id="tab2">
<div id="iframe-container">
</div>
<div id="iframe-container"></div>
<div class="upload-help"><?php echo lang_Upload_java_help; ?></div>
</div>
<?php } ?>
</div>
</div>
</div>
</div>
<!----- uploader div start ------->
<!-- uploader div start -->
<?php } ?>
<div class="container-fluid">
@@ -309,14 +399,13 @@ $get_params = http_build_query(array(
$class_ext = '';
$src = '';
$dir = opendir($current_path.$subfolder.$subdir);
if ($_GET['type']==1) $apply = 'apply_img';
elseif($_GET['type']==2) $apply = 'apply_link';
elseif($_GET['type']==0 && $_GET['field_id']=='') $apply = 'apply_none';
elseif($_GET['type']==3) $apply = 'apply_video';
else $apply = 'apply';
$files = scandir($current_path.$subfolder.$subdir);
$files = scandir($current_path.$rfm_subfolder.$subdir);
$n_files=count($files);
//php sorting
@@ -326,13 +415,13 @@ $prev_folder=array();
foreach($files as $k=>$file){
if($file==".") $current_folder=array('file'=>$file);
elseif($file=="..") $prev_folder=array('file'=>$file);
elseif(is_dir($current_path.$subfolder.$subdir.$file)){
$date=filemtime($current_path.$subfolder.$subdir. $file);
$size=foldersize($current_path.$subfolder.$subdir. $file);
elseif(is_dir($current_path.$rfm_subfolder.$subdir.$file)){
$date=filemtime($current_path.$rfm_subfolder.$subdir. $file);
$size=foldersize($current_path.$rfm_subfolder.$subdir. $file);
$file_ext=lang_Type_dir;
$sorted[$k]=array('file'=>$file,'date'=>$date,'size'=>$size,'extension'=>$file_ext);
}else{
$file_path=$current_path.$subfolder.$subdir.$file;
$file_path=$current_path.$rfm_subfolder.$subdir.$file;
$date=filemtime($file_path);
$size=filesize($file_path);
$file_ext = substr(strrchr($file,'.'),1);
@@ -377,7 +466,7 @@ if($descending){
$files=array_merge(array($prev_folder),array($current_folder),$sorted);
?>
<!----- header div start ------->
<!-- header div start -->
<div class="navbar navbar-fixed-top">
<div class="navbar-inner">
<div class="container-fluid">
@@ -391,21 +480,25 @@ $files=array_merge(array($prev_folder),array($current_folder),$sorted);
<div class="filters">
<div class="row-fluid">
<div class="span3 half">
<span><?php echo lang_Actions; ?>:</span>
<?php if($upload_files){ ?>
<button class="tip btn upload-btn" title="<?php echo lang_Upload_file; ?>"><i class="icon-plus"></i><i class="icon-file"></i></button>
<?php } ?>
<?php if($create_folders){ ?>
<button class="tip btn new-folder" title="<?php echo lang_New_Folder?>"><i class="icon-plus"></i><i class="icon-folder-open"></i></button>
<?php } ?>
<?php if($copy_cut_files || $copy_cut_dirs){ ?>
<button class="tip btn paste-here-btn" title="<?php echo lang_Paste_Here; ?>"><i class="rficon-clipboard-apply"></i></button>
<button class="tip btn clear-clipboard-btn" title="<?php echo lang_Clear_Clipboard; ?>"><i class="rficon-clipboard-clear"></i></button>
<?php } ?>
</div>
<div class="span3 half view-controller">
<span><?php echo lang_View; ?>:</span>
<button class="btn tip<?php if($view==0) echo " btn-inverse"; ?>" id="view0" data-value="0" title="<?php echo lang_View_boxes; ?>"><i class="icon-th <?php if($view==0) echo "icon-white"; ?>"></i></button>
<button class="btn tip<?php if($view==1) echo " btn-inverse"; ?>" id="view1" data-value="1" title="<?php echo lang_View_list; ?>"><i class="icon-align-justify <?php if($view==1) echo "icon-white"; ?>"></i></button>
<button class="btn tip<?php if($view==2) echo " btn-inverse"; ?>" id="view2" data-value="2" title="<?php echo lang_View_columns_list; ?>"><i class="icon-fire <?php if($view==2) echo "icon-white"; ?>"></i></button>
</div>
<div class="span6 types">
<div class="span6 half types">
<span><?php echo lang_Filters; ?>:</span>
<?php if($_GET['type']!=1 && $_GET['type']!=3){ ?>
<input id="select-type-1" name="radio-sort" type="radio" data-item="ff-item-type-1" checked="checked" class="hide" />
@@ -419,7 +512,7 @@ $files=array_merge(array($prev_folder),array($current_folder),$sorted);
<input id="select-type-5" name="radio-sort" type="radio" data-item="ff-item-type-5" class="hide" />
<label id="ff-item-type-5" title="<?php echo lang_Music; ?>" for="select-type-5" class="tip btn ff-label-type-5"><i class="icon-music"></i></label>
<?php } ?>
<input accesskey="f" type="text" class="filter-input" id="filter-input" name="filter" placeholder="<?php echo mb_strtolower(lang_Text_filter); ?>..." value="<?php echo $filter; ?>"/><?php if($n_files>$file_number_limit_js){ ?><label id="filter" class="btn"><i class="icon-play"></i></label><?php } ?>
<input accesskey="f" type="text" class="filter-input <?php echo (($_GET['type']!=1 && $_GET['type']!=3) ? '' : 'filter-input-notype'); ?>" id="filter-input" name="filter" placeholder="<?php echo fix_strtolower(lang_Text_filter); ?>..." value="<?php echo $filter; ?>"/><?php if($n_files>$file_number_limit_js){ ?><label id="filter" class="btn"><i class="icon-play"></i></label><?php } ?>
<input id="select-type-all" name="radio-sort" type="radio" data-item="ff-item-type-all" class="hide" />
<label id="ff-item-type-all" title="<?php echo lang_All; ?>" <?php if($_GET['type']==1 || $_GET['type']==3){ ?>style="visibility: hidden;" <?php } ?> data-item="ff-item-type-all" for="select-type-all" style="margin-rigth:0px;" class="tip btn btn-inverse ff-label-type-all"><i class="icon-align-justify icon-white"></i></label>
@@ -432,9 +525,9 @@ $files=array_merge(array($prev_folder),array($current_folder),$sorted);
</div>
</div>
<!----- header div end ------->
<!-- header div end -->
<!----- breadcrumb div start ------->
<!-- breadcrumb div start -->
<div class="row-fluid">
<?php
@@ -476,10 +569,10 @@ $files=array_merge(array($prev_folder),array($current_folder),$sorted);
</li>
</ul>
</div>
<!----- breadcrumb div end ------->
<!-- breadcrumb div end -->
<div class="row-fluid ff-container">
<div class="span12">
<?php if(@opendir($current_path.$subfolder.$subdir)===FALSE){ ?>
<?php if(@opendir($current_path.$rfm_subfolder.$subdir)===FALSE){ ?>
<br/>
<div class="alert alert-error">There is an error! The upload folder there isn't. Check your config.php file. </div>
<?php }else{ ?>
@@ -501,7 +594,7 @@ $files=array_merge(array($prev_folder),array($current_folder),$sorted);
<input type="hidden" id="file_number" value="<?php echo $n_files; ?>" />
<!--ul class="thumbnails ff-items"-->
<ul class="grid cs-style-2 <?php echo "list-view".$view; ?>">
<ul class="grid cs-style-2 <?php echo "list-view".$view; ?>" id="main-item-container">
<?php
$jplayer_ext=array("mp4","flv","webmv","webma","webm","m4a","m4v","ogv","oga","mp3","midi","mid","ogg","wav");
@@ -509,6 +602,12 @@ $files=array_merge(array($prev_folder),array($current_folder),$sorted);
$file=$file_array['file'];
if($file == '.' || (isset($file_array['extension']) && $file_array['extension']!=lang_Type_dir) || ($file == '..' && $subdir == '') || in_array($file, $hidden_folders) || ($filter!='' && $file!=".." && strpos($file,$filter)===false))
continue;
$new_name=fix_filename($file,$transliteration);
if($file!='..' && $file!=$new_name){
//rename
rename_folder($current_path.$subdir.$new_name,$new_name,$transliteration);
$file=$new_name;
}
//add in thumbs folder if not exist
if (!file_exists($thumbs_path.$subdir.$file)) create_folder(false,$thumbs_path.$subdir.$file);
$class_ext = 3;
@@ -523,21 +622,26 @@ $files=array_merge(array($prev_folder),array($current_folder),$sorted);
}
?>
<li data-name="<?php echo $file ?>" <?php if($file=='..') echo 'class="back"'; else echo 'class="dir"'; ?>>
<figure data-name="<?php echo $file ?>" class="<?php if($file=="..") echo "back-"; ?>directory" data-type="<?php if($file!=".."){ echo "dir"; } ?>">
<a title="<?php echo lang_Open?>" class="folder-link" href="dialog.php?<?php echo $get_params.$src."&".uniqid() ?>">
<li data-name="<?php echo $file ?>" <?php if($file=='..') echo 'class="back"'; else echo 'class="dir"'; ?>><?php
$file_prevent_rename = false;
$file_prevent_delete = false;
if (isset($filePermissions[$file])) {
$file_prevent_rename = isset($filePermissions[$file]['prevent_rename']) && $filePermissions[$file]['prevent_rename'];
$file_prevent_delete = isset($filePermissions[$file]['prevent_delete']) && $filePermissions[$file]['prevent_delete'];
}
?> <figure data-name="<?php echo $file ?>" class="<?php if($file=="..") echo "back-"; ?>directory" data-type="<?php if($file!=".."){ echo "dir"; } ?>">
<a class="folder-link" href="dialog.php?<?php echo $get_params.rawurlencode($src)."&".uniqid() ?>">
<div class="img-precontainer">
<div class="img-container directory"><span></span>
<img class="directory-img" src="img/ico/folder<?php if($file==".."){ echo "_back"; }?>.jpg" alt="folder" />
<img class="directory-img" src="img/<?php echo $icon_theme; ?>/folder<?php if($file==".."){ echo "_back"; }?>.jpg" alt="folder" />
</div>
</div>
<div class="img-precontainer-mini directory">
<div class="img-container-mini">
<span></span>
<img class="directory-img" src="img/ico/folder<?php if($file==".."){ echo "_back"; }?>.jpg" alt="folder" />
<img class="directory-img" src="img/<?php echo $icon_theme; ?>/folder<?php if($file==".."){ echo "_back"; }?>.png" alt="folder" />
</div>
</div>
<div class="cover"></div>
<?php if($file==".."){ ?>
<div class="box no-effect">
<h4><?php echo lang_Back ?></h4>
@@ -547,7 +651,7 @@ $files=array_merge(array($prev_folder),array($current_folder),$sorted);
<?php }else{ ?>
</a>
<div class="box">
<h4 class="<?php if($ellipsis_title_after_first_row){ echo "ellipsis"; } ?>"><a title="<?php echo lang_Open?>" class="folder-link" data-file="<?php echo $file ?>" href="dialog.php?<?php echo $get_params.$src."&".uniqid() ?>"><?php echo $file; ?></a></h4>
<h4 class="<?php if($ellipsis_title_after_first_row){ echo "ellipsis"; } ?>"><a class="folder-link" data-file="<?php echo $file ?>" href="dialog.php?<?php echo $get_params.rawurlencode($src)."&".uniqid() ?>"><?php echo $file; ?></a></h4>
</div>
<input type="hidden" class="name" value=""/>
<input type="hidden" class="date" value="<?php echo $file_array['date']; ?>"/>
@@ -557,10 +661,10 @@ $files=array_merge(array($prev_folder),array($current_folder),$sorted);
<?php if($show_folder_size){ ?><div class="file-size"><?php echo makeSize($file_array['size'])?></div><?php } ?>
<div class='file-extension'><?php echo lang_Type_dir; ?></div>
<figcaption>
<a href="javascript:void('')" class="tip-left edit-button <?php if($rename_folders) echo "rename-folder"; ?>" title="<?php echo lang_Rename?>" data-path="<?php echo $subfolder.$subdir.$file; ?>" data-thumb="<?php echo $thumbs_path.$subdir.$file; ?>">
<i class="icon-pencil <?php if(!$rename_folders) echo 'icon-white'; ?>"></i></a>
<a href="javascript:void('')" class="tip-left erase-button <?php if($delete_folders) echo "delete-folder"; ?>" title="<?php echo lang_Erase?>" data-confirm="<?php echo lang_Confirm_Folder_del; ?>" data-path="<?php echo $subfolder.$subdir.$file; ?>" data-thumb="<?php echo $thumbs_path.$subdir .$file; ?>">
<i class="icon-trash <?php if(!$delete_folders) echo 'icon-white'; ?>"></i>
<a href="javascript:void('')" class="tip-left edit-button rename-file-paths <?php if($rename_folders && !$file_prevent_rename) echo "rename-folder"; ?>" title="<?php echo lang_Rename?>" data-path="<?php echo $rfm_subfolder.$subdir.$file; ?>" data-thumb="<?php echo $thumbs_path.$subdir.$file; ?>">
<i class="icon-pencil <?php if(!$rename_folders || $file_prevent_rename) echo 'icon-white'; ?>"></i></a>
<a href="javascript:void('')" class="tip-left erase-button <?php if($delete_folders && !$file_prevent_delete) echo "delete-folder"; ?>" title="<?php echo lang_Erase?>" data-confirm="<?php echo lang_Confirm_Folder_del; ?>" data-path="<?php echo $rfm_subfolder.$subdir.$file; ?>" data-thumb="<?php echo $thumbs_path.$subdir .$file; ?>">
<i class="icon-trash <?php if(!$delete_folders || $file_prevent_delete) echo 'icon-white'; ?>"></i>
</a>
</figcaption>
<?php } ?>
@@ -569,40 +673,35 @@ $files=array_merge(array($prev_folder),array($current_folder),$sorted);
<?php
}
$files_prevent_duplicate = array();
foreach ($files as $nu=>$file_array) {
$file=$file_array['file'];
if($file == '.' || $file == '..' || is_dir($current_path.$subfolder.$subdir.$file) || in_array($file, $hidden_files) || !in_array(mb_strtolower($file_array['extension']), $ext) || ($filter!='' && strpos($file,$filter)===false))
if($file == '.' || $file == '..' || is_dir($current_path.$rfm_subfolder.$subdir.$file) || in_array($file, $hidden_files) || !in_array(fix_strtolower($file_array['extension']), $ext) || ($filter!='' && strpos($file,$filter)===false))
continue;
$file_path=$current_path.$subfolder.$subdir.$file;
$file_path=$current_path.$rfm_subfolder.$subdir.$file;
//check if file have illegal caracter
if($file!=mb_strtolower($file_array['extension'])){
rename($current_path.$subfolder.$subdir.$file,$current_path.$subfolder.$subdir.mb_strtolower($file));
$file=mb_strtolower($file);
$file_path=$current_path.$subfolder.$subdir.$file;
$file_array['extension']=mb_strtolower($file_array['extension']);
}
$filename=substr($file, 0, '-' . (strlen($file_array['extension']) + 1));
if($file!=fix_filename($file)){
$file1=fix_filename($file);
$file_path1=($current_path.$subfolder.$subdir.$file1);
if($file!=fix_filename($file,$transliteration)){
$file1=fix_filename($file,$transliteration);
$file_path1=($current_path.$rfm_subfolder.$subdir.$file1);
if(file_exists($file_path1)){
$i = 1;
$info=pathinfo($file1);
while(file_exists($current_path.$subfolder.$subdir.$info['filename'].".[".$i."].".$info['extension'])) {
while(file_exists($current_path.$rfm_subfolder.$subdir.$info['filename'].".[".$i."].".$info['extension'])) {
$i++;
}
$file1=$info['filename'].".[".$i."].".$info['extension'];
$file_path1=($current_path.$subfolder.$subdir.$file1);
$file_path1=($current_path.$rfm_subfolder.$subdir.$file1);
}
$filename=substr($file1, 0, '-' . (strlen($file_array['extension']) + 1));
rename_file($file_path,fix_filename($filename));
rename_file($file_path,fix_filename($filename,$transliteration),$transliteration);
$file=$file1;
$file_array['extension']=fix_filename($file_array['extension']);
$file_array['extension']=fix_filename($file_array['extension'],$transliteration);
$file_path=$file_path1;
}
@@ -613,40 +712,42 @@ $files=array_merge(array($prev_folder),array($current_folder),$sorted);
$show_original_mini=false;
$mini_src="";
$src_thumb="";
if(in_array($file_array['extension'], $ext_img)){
$src = $base_url . $cur_dir . $file;
$extension_lower=fix_strtolower($file_array['extension']);
if(in_array($extension_lower, $ext_img)){
$src = $base_url . $cur_dir . rawurlencode($file);
$mini_src = $src_thumb = $thumbs_path.$subdir. $file;
//add in thumbs folder if not exist
if(!file_exists($src_thumb)){
try {
create_img_gd($file_path, $src_thumb, 122, 91);
new_thumbnails_creation($current_path.$subfolder.$subdir,$file_path,$file,$current_path,$relative_image_creation,$relative_path_from_current_pos,$relative_image_creation_name_to_prepend,$relative_image_creation_name_to_append,$relative_image_creation_width,$relative_image_creation_height,$fixed_image_creation,$fixed_path_from_filemanager,$fixed_image_creation_name_to_prepend,$fixed_image_creation_to_append,$fixed_image_creation_width,$fixed_image_creation_height);
new_thumbnails_creation($current_path.$rfm_subfolder.$subdir,$file_path,$file,$current_path,$relative_image_creation,$relative_path_from_current_pos,$relative_image_creation_name_to_prepend,$relative_image_creation_name_to_append,$relative_image_creation_width,$relative_image_creation_height,$fixed_image_creation,$fixed_path_from_filemanager,$fixed_image_creation_name_to_prepend,$fixed_image_creation_to_append,$fixed_image_creation_width,$fixed_image_creation_height);
} catch (Exception $e) {
$src_thumb=$mini_src="";
}
}
$is_img=true;
//check if is smaller tha thumb
//check if is smaller than thumb
list($img_width, $img_height, $img_type, $attr)=getimagesize($file_path);
if($img_width<122 && $img_height<91){
$src_thumb=$current_path.$subfolder.$subdir.$file;
$src_thumb=$current_path.$rfm_subfolder.$subdir.$file;
$show_original=true;
}
if($img_width<45 && $img_height<38){
$mini_src=$current_path.$subfolder.$subdir.$file;
$mini_src=$current_path.$rfm_subfolder.$subdir.$file;
$show_original_mini=true;
}
}
$is_icon_thumb=false;
$is_icon_thumb_mini=false;
$no_thumb=false;
if($src_thumb==""){
if(file_exists('img/ico/'.($file_array['extension']).".jpg")){
$src_thumb ='img/ico/'.($file_array['extension']).".jpg";
$no_thumb=true;
if(file_exists('img/'.$icon_theme.'/'.$extension_lower.".jpg")){
$src_thumb ='img/'.$icon_theme.'/'.$extension_lower.".jpg";
}else{
$src_thumb = "img/ico/default.jpg";
$src_thumb = "img/".$icon_theme."/default.jpg";
}
$is_icon_thumb=true;
}
@@ -655,33 +756,42 @@ $files=array_merge(array($prev_folder),array($current_folder),$sorted);
}
$class_ext=0;
if (in_array($file_array['extension'], $ext_video)) {
if (in_array($extension_lower, $ext_video)) {
$class_ext = 4;
$is_video=true;
}elseif (in_array($file_array['extension'], $ext_img)) {
}elseif (in_array($extension_lower, $ext_img)) {
$class_ext = 2;
}elseif (in_array($file_array['extension'], $ext_music)) {
}elseif (in_array($extension_lower, $ext_music)) {
$class_ext = 5;
$is_audio=true;
}elseif (in_array($file_array['extension'], $ext_misc)) {
}elseif (in_array($extension_lower, $ext_misc)) {
$class_ext = 3;
}else{
$class_ext = 1;
}
if((!($_GET['type']==1 && !$is_img) && !($_GET['type']==3 && !$is_video)) && $class_ext>0){
if((!($_GET['type']==1 && !$is_img) && !(($_GET['type']==3 && !$is_video) && ($_GET['type']==3 && !$is_audio))) && $class_ext>0){
?>
<li class="ff-item-type-<?php echo $class_ext; ?> file" data-name="<?php echo $file; ?>">
<figure data-name="<?php echo $file ?>" data-type="<?php if($is_img){ echo "img"; }else{ echo "file"; } ?>">
<a href="javascript:void('')" title="<?php echo lang_Select?>" class="link" data-file="<?php echo $file; ?>" data-field_id="<?php echo $_GET['field_id']; ?>" data-function="<?php echo $apply; ?>">
<li class="ff-item-type-<?php echo $class_ext; ?> file" data-name="<?php echo $file; ?>"><?php
$file_prevent_rename = false;
$file_prevent_delete = false;
if (isset($filePermissions[$file])) {
if (isset($filePermissions[$file]['prevent_duplicate']) && $filePermissions[$file]['prevent_duplicate']) {
$files_prevent_duplicate[] = $file;
}
$file_prevent_rename = isset($filePermissions[$file]['prevent_rename']) && $filePermissions[$file]['prevent_rename'];
$file_prevent_delete = isset($filePermissions[$file]['prevent_delete']) && $filePermissions[$file]['prevent_delete'];
}
?> <figure data-name="<?php echo $file ?>" data-type="<?php if($is_img){ echo "img"; }else{ echo "file"; } ?>">
<a href="javascript:void('')" class="link" data-file="<?php echo $file; ?>" data-field_id="<?php echo $field_id; ?>" data-function="<?php echo $apply; ?>">
<div class="img-precontainer">
<?php if($is_icon_thumb){ ?><div class="filetype"><?php echo $file_array['extension'] ?></div> <?php } ?>
<?php if($is_icon_thumb){ ?><div class="filetype"><?php echo $extension_lower ?></div><?php } ?>
<div class="img-container">
<span></span>
<img alt="<?php echo $filename." thumbnails";?>" class="<?php echo $show_original ? "original" : "" ?> <?php echo $is_icon_thumb ? "icon" : "" ?>" src="<?php echo $src_thumb; ?>">
</div>
</div>
<div class="img-precontainer-mini <?php if($is_img) echo 'original-thumb' ?>">
<div class="filetype <?php echo $file_array['extension'] ?> <?php if(!$is_icon_thumb){ echo "hide"; }?>"><?php echo $file_array['extension'] ?></div>
<div class="filetype <?php echo $extension_lower ?> <?php if(!$is_icon_thumb){ echo "hide"; }?>"><?php echo $extension_lower ?></div>
<div class="img-container-mini">
<span></span>
<?php if($mini_src!=""){ ?>
@@ -689,38 +799,42 @@ $files=array_merge(array($prev_folder),array($current_folder),$sorted);
<?php } ?>
</div>
</div>
<?php if($is_icon_thumb){ ?>
<div class="cover"></div>
<?php } ?>
</a>
<div class="box">
<h4 class="<?php if($ellipsis_title_after_first_row){ echo "ellipsis"; } ?>"><a href="javascript:void('')" title="<?php echo lang_Select?>" class="link" data-file="<?php echo $file; ?>" data-field_id="<?php echo $_GET['field_id']; ?>" data-function="<?php echo $apply; ?>">
<h4 class="<?php if($ellipsis_title_after_first_row){ echo "ellipsis"; } ?>"><a href="javascript:void('')" class="link" data-file="<?php echo $file; ?>" data-field_id="<?php echo $field_id; ?>" data-function="<?php echo $apply; ?>">
<?php echo $filename; ?></a> </h4>
</div>
<input type="hidden" class="date" value="<?php echo $file_array['date']; ?>"/>
<input type="hidden" class="size" value="<?php echo $file_array['size'] ?>"/>
<input type="hidden" class="extension" value="<?php echo $file_array['extension']; ?>"/>
<input type="hidden" class="extension" value="<?php echo $extension_lower; ?>"/>
<input type="hidden" class="name" value=""/>
<div class="file-date"><?php echo date(lang_Date_type,$file_array['date'])?></div>
<div class="file-size"><?php echo makeSize($file_array['size'])?></div>
<div class='img-dimension'><?php if($is_img){ echo $img_width."x".$img_height; } ?></div>
<div class='file-extension'><?php echo $file_array['extension']; ?></div>
<div class='file-extension'><?php echo $extension_lower; ?></div>
<figcaption>
<form action="force_download.php" method="post" class="download-form" id="form<?php echo $nu; ?>">
<input type="hidden" name="path" value="<?php echo $subfolder.$subdir?>"/>
<input type="hidden" name="path" value="<?php echo $rfm_subfolder.$subdir?>"/>
<input type="hidden" class="name_download" name="name" value="<?php echo $file?>"/>
<a title="<?php echo lang_Download?>" class="tip-right" href="javascript:void('')" onclick="$('#form<?php echo $nu; ?>').submit();"><i class="icon-download"></i></a>
<?php if($is_img){ ?>
<?php if($is_img && $src_thumb!=""){ ?>
<a class="tip-right preview" title="<?php echo lang_Preview?>" data-url="<?php echo $src;?>" data-toggle="lightbox" href="#previewLightbox"><i class=" icon-eye-open"></i></a>
<?php }elseif(($is_video || $is_audio) && in_array($file_array['extension'],$jplayer_ext)){ ?>
<a class="tip-right modalAV <?php if($is_audio){ echo "audio"; }else{ echo "video"; } ?>" title="<?php echo lang_Preview?>" data-url="ajax_calls.php?action=media_preview&title=<?php echo $filename; ?>&file=<?php echo $current_path.$subfolder.$subdir.$file;; ?>" href="javascript:void('');" ><i class=" icon-eye-open"></i></a>
<?php }elseif(($is_video || $is_audio) && in_array($extension_lower,$jplayer_ext)){ ?>
<a class="tip-right modalAV <?php if($is_audio){ echo "audio"; }else{ echo "video"; } ?>"
title="<?php echo lang_Preview?>" data-url="ajax_calls.php?action=media_preview&title=<?php echo $filename; ?>&file=<?php echo $current_path.$rfm_subfolder.$subdir.$file;; ?>"
href="javascript:void('');" ><i class=" icon-eye-open"></i></a>
<?php }else{ ?>
<a class="preview disabled"><i class="icon-eye-open icon-white"></i></a>
<?php } ?>
<a href="javascript:void('')" class="tip-left edit-button <?php if($rename_files) echo "rename-file"; ?>" title="<?php echo lang_Rename?>" data-path="<?php echo $subfolder.$subdir .$file; ?>" data-thumb="<?php echo $thumbs_path.$subdir .$file; ?>">
<i class="icon-pencil <?php if(!$rename_files) echo 'icon-white'; ?>"></i></a>
<a href="javascript:void('')" class="tip-left edit-button rename-file-paths <?php if($rename_files && !$file_prevent_rename) echo "rename-file"; ?>" title="<?php echo lang_Rename?>" data-path="<?php echo $rfm_subfolder.$subdir .$file; ?>" data-thumb="<?php echo $thumbs_path.$subdir .$file; ?>">
<i class="icon-pencil <?php if(!$rename_files || $file_prevent_rename) echo 'icon-white'; ?>"></i></a>
<a href="javascript:void('')" class="tip-left erase-button <?php if($delete_files) echo "delete-file"; ?>" title="<?php echo lang_Erase?>" data-confirm="<?php echo lang_Confirm_del; ?>" data-path="<?php echo $subfolder.$subdir.$file; ?>" data-thumb="<?php echo $thumbs_path.$subdir .$file; ?>">
<i class="icon-trash <?php if(!$delete_files) echo 'icon-white'; ?>"></i>
<a href="javascript:void('')" class="tip-left erase-button <?php if($delete_files && !$file_prevent_delete) echo "delete-file"; ?>" title="<?php echo lang_Erase?>" data-confirm="<?php echo lang_Confirm_del; ?>" data-path="<?php echo $rfm_subfolder.$subdir.$file; ?>" data-thumb="<?php echo $thumbs_path.$subdir .$file; ?>">
<i class="icon-trash <?php if(!$delete_files || $file_prevent_delete) echo 'icon-white'; ?>"></i>
</a>
</form>
</figcaption>
@@ -730,31 +844,36 @@ $files=array_merge(array($prev_folder),array($current_folder),$sorted);
}
}
?></div><?php
closedir($dir);
?>
?></div>
</ul>
<?php } ?>
</div>
</div>
</div>
<script>
var files_prevent_duplicate = new Array();
<?php
foreach ($files_prevent_duplicate as $key => $value): ?>
files_prevent_duplicate[<?php echo $key;?>] = '<?php echo $value; ?>';
<?php endforeach; ?>
</script>
<!----- lightbox div start ------->
<!-- lightbox div start -->
<div id="previewLightbox" class="lightbox hide fade" tabindex="-1" role="dialog" aria-hidden="true">
<div class='lightbox-content'>
<img id="full-img" src="">
</div>
</div>
<!----- lightbox div end ------->
<!-- lightbox div end -->
<!----- loading div start ------->
<!-- loading div start -->
<div id="loading_container" style="display:none;">
<div id="loading" style="background-color:#000; position:fixed; width:100%; height:100%; top:0px; left:0px;z-index:100000"></div>
<img id="loading_animation" src="img/storing_animation.gif" alt="loading" style="z-index:10001; margin-left:-32px; margin-top:-32px; position:fixed; left:50%; top:50%"/>
</div>
<!----- loading div end ------->
<!-- loading div end -->
<!----- player div start ------->
<!-- player div start -->
<div class="modal hide fade" id="previewAV">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
@@ -766,7 +885,7 @@ $files=array_merge(array($prev_folder),array($current_folder),$sorted);
</div>
</div>
<!----- player div end ------->
<!-- player div end -->
<img id='aviary_img' src='' class="hide"/>
</body>
</html>

View File

@@ -0,0 +1,280 @@
<?php
include('config/config.php');
if ($_SESSION['RF']["verify"] != "RESPONSIVEfilemanager") die('forbiden');
include('include/utils.php');
$thumb_pos = strpos($_POST['path_thumb'], $thumbs_base_path);
if ($thumb_pos !=0
|| strpos($_POST['path_thumb'],'../',strlen($thumbs_base_path)+$thumb_pos)!==FALSE
|| strpos($_POST['path'],'/')===0
|| strpos($_POST['path'],'../')!==FALSE
|| strpos($_POST['path'],'./')===0)
{
die('wrong path');
}
$language_file = 'lang/'.$default_language.'.php';
if (isset($_GET['lang']) && $_GET['lang'] != 'undefined' && $_GET['lang']!='')
{
$path_parts = pathinfo($_GET['lang']);
if (is_readable('lang/' .$path_parts['basename']. '.php'))
{
$language_file = 'lang/' .$path_parts['basename']. '.php';
}
}
require_once $language_file;
$base = $current_path;
$path = $current_path.$_POST['path'];
$cycle = TRUE;
$max_cycles = 50;
$i = 0;
while($cycle && $i<$max_cycles)
{
$i++;
if ($path == $base) $cycle=FALSE;
if (file_exists($path."config.php"))
{
require_once($path."config.php");
$cycle = FALSE;
}
$path = fix_dirname($path)."/";
$cycle = FALSE;
}
$path = $current_path.$_POST['path'];
$path_thumb = $_POST['path_thumb'];
if (isset($_POST['name']))
{
$name = $_POST['name'];
if (strpos($name,'../') !== FALSE) die('wrong name');
}
$info = pathinfo($path);
if (isset($info['extension']) && !(isset($_GET['action']) && $_GET['action']=='delete_folder') && !in_array(strtolower($info['extension']), $ext))
{
die('wrong extension');
}
if (isset($_GET['action']))
{
switch($_GET['action'])
{
case 'delete_file':
if ($delete_files){
unlink($path);
if (file_exists($path_thumb)) unlink($path_thumb);
$info=pathinfo($path);
if ($relative_image_creation){
foreach($relative_path_from_current_pos as $k=>$path)
{
if ($path!="" && $path[strlen($path)-1]!="/") $path.="/";
if (file_exists($info['dirname']."/".$path.$relative_image_creation_name_to_prepend[$k].$info['filename'].$relative_image_creation_name_to_append[$k].".".$info['extension']))
{
unlink($info['dirname']."/".$path.$relative_image_creation_name_to_prepend[$k].$info['filename'].$relative_image_creation_name_to_append[$k].".".$info['extension']);
}
}
}
if ($fixed_image_creation)
{
foreach($fixed_path_from_filemanager as $k=>$path)
{
if ($path!="" && $path[strlen($path)-1] != "/") $path.="/";
$base_dir=$path.substr_replace($info['dirname']."/", '', 0, strlen($current_path));
if (file_exists($base_dir.$fixed_image_creation_name_to_prepend[$k].$info['filename'].$fixed_image_creation_to_append[$k].".".$info['extension']))
{
unlink($base_dir.$fixed_image_creation_name_to_prepend[$k].$info['filename'].$fixed_image_creation_to_append[$k].".".$info['extension']);
}
}
}
}
break;
case 'delete_folder':
if ($delete_folders){
if (is_dir($path_thumb))
{
deleteDir($path_thumb);
}
if (is_dir($path))
{
deleteDir($path);
if ($fixed_image_creation)
{
foreach($fixed_path_from_filemanager as $k=>$paths){
if ($paths!="" && $paths[strlen($paths)-1] != "/") $paths.="/";
$base_dir=$paths.substr_replace($path, '', 0, strlen($current_path));
if (is_dir($base_dir)) deleteDir($base_dir);
}
}
}
}
break;
case 'create_folder':
if ($create_folders)
{
create_folder(fix_path($path,$transliteration),fix_path($path_thumb,$transliteration));
}
break;
case 'rename_folder':
if ($rename_folders){
$name=fix_filename($name,$transliteration);
$name=str_replace('.','',$name);
if (!empty($name)){
if (!rename_folder($path,$name,$transliteration)) die(lang_Rename_existing_folder);
rename_folder($path_thumb,$name,$transliteration);
if ($fixed_image_creation){
foreach($fixed_path_from_filemanager as $k=>$paths){
if ($paths!="" && $paths[strlen($paths)-1] != "/") $paths.="/";
$base_dir=$paths.substr_replace($path, '', 0, strlen($current_path));
rename_folder($base_dir,$name,$transliteration);
}
}
}
else {
die(lang_Empty_name);
}
}
break;
case 'rename_file':
if ($rename_files){
$name=fix_filename($name,$transliteration);
if (!empty($name))
{
if (!rename_file($path,$name,$transliteration)) die(lang_Rename_existing_file);
rename_file($path_thumb,$name,$transliteration);
if ($fixed_image_creation)
{
$info=pathinfo($path);
foreach($fixed_path_from_filemanager as $k=>$paths)
{
if ($paths!="" && $paths[strlen($paths)-1] != "/") $paths.="/";
$base_dir = $paths.substr_replace($info['dirname']."/", '', 0, strlen($current_path));
if (file_exists($base_dir.$fixed_image_creation_name_to_prepend[$k].$info['filename'].$fixed_image_creation_to_append[$k].".".$info['extension']))
{
rename_file($base_dir.$fixed_image_creation_name_to_prepend[$k].$info['filename'].$fixed_image_creation_to_append[$k].".".$info['extension'],$fixed_image_creation_name_to_prepend[$k].$name.$fixed_image_creation_to_append[$k],$transliteration);
}
}
}
}
else {
die(lang_Empty_name);
}
}
break;
case 'duplicate_file':
if ($duplicate_files)
{
$name = fix_filename($name,$transliteration);
if (!empty($name))
{
if (!duplicate_file($path,$name)) die(lang_Rename_existing_file);
duplicate_file($path_thumb,$name);
if ($fixed_image_creation)
{
$info=pathinfo($path);
foreach($fixed_path_from_filemanager as $k=>$paths)
{
if ($paths!="" && $paths[strlen($paths)-1] != "/") $paths.= "/";
$base_dir=$paths.substr_replace($info['dirname']."/", '', 0, strlen($current_path));
if (file_exists($base_dir.$fixed_image_creation_name_to_prepend[$k].$info['filename'].$fixed_image_creation_to_append[$k].".".$info['extension']))
{
duplicate_file($base_dir.$fixed_image_creation_name_to_prepend[$k].$info['filename'].$fixed_image_creation_to_append[$k].".".$info['extension'],$fixed_image_creation_name_to_prepend[$k].$name.$fixed_image_creation_to_append[$k]);
}
}
}
}
else
{
die(lang_Empty_name);
}
}
break;
case 'paste_clipboard':
if ( ! isset($_SESSION['RF']['clipboard_action'], $_SESSION['RF']['clipboard']['path'], $_SESSION['RF']['clipboard']['path_thumb'])
|| $_SESSION['RF']['clipboard_action'] == ''
|| $_SESSION['RF']['clipboard']['path'] == ''
|| $_SESSION['RF']['clipboard']['path_thumb'] == '')
{
die();
}
$action = $_SESSION['RF']['clipboard_action'];
$data = $_SESSION['RF']['clipboard'];
$data['path'] = $current_path.$data['path'];
$pinfo = pathinfo($data['path']);
// user wants to paste to the same dir. nothing to do here...
if ($pinfo['dirname'] == rtrim($path, '/')) {
die();
}
// user wants to paste folder to it's own sub folder.. baaaah.
if (is_dir($data['path']) && strpos($path, $data['path']) !== FALSE){
die();
}
// something terribly gone wrong
if ($action != 'copy' && $action != 'cut'){
die('no action');
}
// check for writability
if (is_really_writable($path) === FALSE || is_really_writable($path_thumb) === FALSE){
die($path.'--'.$path_thumb.'--'.lang_Dir_No_Write);
}
// check if server disables copy or rename
if (is_function_callable(($action == 'copy' ? 'copy' : 'rename')) === FALSE){
die(sprintf(lang_Function_Disabled, ($action == 'copy' ? lcfirst(lang_Copy) : lcfirst(lang_Cut))));
}
if ($action == 'copy')
{
rcopy($data['path'], $path);
rcopy($data['path_thumb'], $path_thumb);
}
elseif ($action == 'cut')
{
rrename($data['path'], $path);
rrename($data['path_thumb'], $path_thumb);
// cleanup
if (is_dir($data['path']) === TRUE){
rrename_after_cleaner($data['path']);
rrename_after_cleaner($data['path_thumb']);
}
}
// cleanup
$_SESSION['RF']['clipboard']['path'] = NULL;
$_SESSION['RF']['clipboard']['path_thumb'] = NULL;
$_SESSION['RF']['clipboard_action'] = NULL;
break;
default:
die('wrong action');
}
}
?>

View File

@@ -1,6 +1,7 @@
<?php
include('config/config.php');
if($_SESSION["verify"] != "RESPONSIVEfilemanager") die('forbiden');
if($_SESSION['RF']["verify"] != "RESPONSIVEfilemanager") die('forbiden');
include('include/utils.php');
if(strpos($_POST['path'],'/')===0
|| strpos($_POST['path'],'../')!==FALSE
@@ -14,7 +15,7 @@ $path=$current_path.$_POST['path'];
$name=$_POST['name'];
$info=pathinfo($name);
if(!in_array($info['extension'], $ext)){
if(!in_array(fix_strtolower($info['extension']), $ext)){
die('wrong extension');
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Some files were not shown because too many files have changed in this diff Show More