Initial commit

This commit is contained in:
2021-03-23 13:54:38 +01:00
commit 82b142ff95
16941 changed files with 2617212 additions and 0 deletions

8
.idea/.gitignore generated vendored Normal file
View File

@@ -0,0 +1,8 @@
# Default ignored files
/shelf/
/workspace.xml
# Datasource local storage ignored files
/dataSources/
/dataSources.local.xml
# Editor-based HTTP Client requests
/httpRequests/

View File

@@ -0,0 +1,6 @@
<component name="InspectionProjectProfileManager">
<profile version="1.0">
<option name="myName" value="Project Default" />
<inspection_tool class="Eslint" enabled="true" level="WARNING" enabled_by_default="true" />
</profile>
</component>

8
.idea/modules.xml generated Normal file
View File

@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/.idea/site_web.iml" filepath="$PROJECT_DIR$/.idea/site_web.iml" />
</modules>
</component>
</project>

91
.idea/php.xml generated Normal file
View File

@@ -0,0 +1,91 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="PhpIncludePathManager">
<include_path>
<path value="$PROJECT_DIR$/core/vendor/thelia/currency-converter" />
<path value="$PROJECT_DIR$/core/vendor/thelia/installer" />
<path value="$PROJECT_DIR$/core/vendor/oyejorge/less.php" />
<path value="$PROJECT_DIR$/core/vendor/thelia/math-tools" />
<path value="$PROJECT_DIR$/core/vendor/propel/propel" />
<path value="$PROJECT_DIR$/core/vendor/sebastian/diff" />
<path value="$PROJECT_DIR$/core/vendor/sebastian/recursion-context" />
<path value="$PROJECT_DIR$/core/vendor/sebastian/comparator" />
<path value="$PROJECT_DIR$/core/vendor/sebastian/global-state" />
<path value="$PROJECT_DIR$/core/vendor/michelf/php-markdown" />
<path value="$PROJECT_DIR$/core/vendor/ensepar/html2pdf" />
<path value="$PROJECT_DIR$/core/vendor/phpspec/prophecy" />
<path value="$PROJECT_DIR$/core/vendor/sebastian/exporter" />
<path value="$PROJECT_DIR$/core/vendor/sebastian/environment" />
<path value="$PROJECT_DIR$/core/vendor/sebastian/version" />
<path value="$PROJECT_DIR$/core/vendor/commerceguys/enum" />
<path value="$PROJECT_DIR$/core/vendor/commerceguys/addressing" />
<path value="$PROJECT_DIR$/core/vendor/simplepie/simplepie" />
<path value="$PROJECT_DIR$/core/vendor/psr/log" />
<path value="$PROJECT_DIR$/core/vendor/swiftmailer/swiftmailer" />
<path value="$PROJECT_DIR$/core/vendor/psr/cache" />
<path value="$PROJECT_DIR$/core/vendor/symfony/finder" />
<path value="$PROJECT_DIR$/core/vendor/symfony/polyfill-mbstring" />
<path value="$PROJECT_DIR$/core/vendor/symfony/polyfill-php56" />
<path value="$PROJECT_DIR$/core/vendor/symfony/routing" />
<path value="$PROJECT_DIR$/core/vendor/symfony/class-loader" />
<path value="$PROJECT_DIR$/core/vendor/symfony/polyfill-util" />
<path value="$PROJECT_DIR$/core/vendor/symfony/dependency-injection" />
<path value="$PROJECT_DIR$/core/vendor/stack/builder" />
<path value="$PROJECT_DIR$/core/vendor/symfony/property-access" />
<path value="$PROJECT_DIR$/core/vendor/symfony/config" />
<path value="$PROJECT_DIR$/core/vendor/symfony/form" />
<path value="$PROJECT_DIR$/core/vendor/symfony/intl" />
<path value="$PROJECT_DIR$/core/vendor/symfony/cache" />
<path value="$PROJECT_DIR$/core/vendor/symfony/security" />
<path value="$PROJECT_DIR$/core/vendor/symfony/options-resolver" />
<path value="$PROJECT_DIR$/core/vendor/symfony/polyfill-php54" />
<path value="$PROJECT_DIR$/core/vendor/symfony/http-foundation" />
<path value="$PROJECT_DIR$/core/vendor/symfony/event-dispatcher" />
<path value="$PROJECT_DIR$/core/vendor/composer" />
<path value="$PROJECT_DIR$/core/vendor/symfony/filesystem" />
<path value="$PROJECT_DIR$/core/vendor/symfony/polyfill-php70" />
<path value="$PROJECT_DIR$/core/vendor/symfony/console" />
<path value="$PROJECT_DIR$/core/vendor/symfony/icu" />
<path value="$PROJECT_DIR$/core/vendor/phpunit/phpunit" />
<path value="$PROJECT_DIR$/core/vendor/symfony/polyfill-intl-icu" />
<path value="$PROJECT_DIR$/core/vendor/phpunit/phpunit-mock-objects" />
<path value="$PROJECT_DIR$/core/vendor/symfony/yaml" />
<path value="$PROJECT_DIR$/core/vendor/phpdocumentor/reflection-docblock" />
<path value="$PROJECT_DIR$/core/vendor/phpunit/php-file-iterator" />
<path value="$PROJECT_DIR$/core/vendor/symfony/security-acl" />
<path value="$PROJECT_DIR$/core/vendor/phpunit/php-text-template" />
<path value="$PROJECT_DIR$/core/vendor/symfony/polyfill-php55" />
<path value="$PROJECT_DIR$/core/vendor/symfony/browser-kit" />
<path value="$PROJECT_DIR$/core/vendor/symfony/http-kernel" />
<path value="$PROJECT_DIR$/core/vendor/kriswallsmith/assetic" />
<path value="$PROJECT_DIR$/core/vendor/ramsey/array_column" />
<path value="$PROJECT_DIR$/core/vendor/phpunit/php-code-coverage" />
<path value="$PROJECT_DIR$/core/vendor/symfony/validator" />
<path value="$PROJECT_DIR$/core/vendor/symfony/dom-crawler" />
<path value="$PROJECT_DIR$/core/vendor/symfony-cmf/routing" />
<path value="$PROJECT_DIR$/core/vendor/symfony/expression-language" />
<path value="$PROJECT_DIR$/core/vendor/paragonie/random_compat" />
<path value="$PROJECT_DIR$/core/vendor/phpunit/php-timer" />
<path value="$PROJECT_DIR$/core/vendor/symfony/debug" />
<path value="$PROJECT_DIR$/core/vendor/phpunit/php-token-stream" />
<path value="$PROJECT_DIR$/core/vendor/symfony/serializer" />
<path value="$PROJECT_DIR$/core/vendor/ircmaxell/password-compat" />
<path value="$PROJECT_DIR$/core/vendor/symfony/process" />
<path value="$PROJECT_DIR$/core/vendor/symfony/translation" />
<path value="$PROJECT_DIR$/core/vendor/fzaninotto/faker" />
<path value="$PROJECT_DIR$/core/vendor/smarty/smarty" />
<path value="$PROJECT_DIR$/core/vendor/doctrine/collections" />
<path value="$PROJECT_DIR$/core/vendor/ptachoire/cssembed" />
<path value="$PROJECT_DIR$/core/vendor/doctrine/instantiator" />
<path value="$PROJECT_DIR$/core/vendor/doctrine/cache" />
<path value="$PROJECT_DIR$/core/vendor/imagine/imagine" />
<path value="$PROJECT_DIR$/core/vendor/ensepar/tcpdf" />
</include_path>
</component>
<component name="PhpProjectSharedConfiguration" php_language_level="5.5.0" />
<component name="PhpUnit">
<phpunit_settings>
<PhpUnitSettings configuration_file_path="$PROJECT_DIR$/phpunit.xml" custom_loader_path="$PROJECT_DIR$/core/vendor/autoload.php" use_configuration_file="true" />
</phpunit_settings>
</component>
</project>

11
.idea/phpunit.xml generated Normal file
View File

@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="PHPUnit">
<option name="directories">
<list>
<option value="$PROJECT_DIR$/tests" />
<option value="$PROJECT_DIR$/local/modules/TheliaSmarty/Tests" />
</list>
</option>
</component>
</project>

93
.idea/site_web.iml generated Normal file
View File

@@ -0,0 +1,93 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="WEB_MODULE" version="4">
<component name="NewModuleRootManager">
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/core/lib/Thelia" isTestSource="false" packagePrefix="Thelia\" />
<sourceFolder url="file://$MODULE_DIR$/local/modules" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/local/modules/TheliaSmarty/Tests" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/spec" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/tests" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/tests/phpunit/Thelia/Tests" isTestSource="true" packagePrefix="Thelia\Tests\" />
<excludeFolder url="file://$MODULE_DIR$/core/vendor/thelia/currency-converter" />
<excludeFolder url="file://$MODULE_DIR$/core/vendor/thelia/installer" />
<excludeFolder url="file://$MODULE_DIR$/core/vendor/oyejorge/less.php" />
<excludeFolder url="file://$MODULE_DIR$/core/vendor/thelia/math-tools" />
<excludeFolder url="file://$MODULE_DIR$/core/vendor/propel/propel" />
<excludeFolder url="file://$MODULE_DIR$/core/vendor/sebastian/diff" />
<excludeFolder url="file://$MODULE_DIR$/core/vendor/sebastian/recursion-context" />
<excludeFolder url="file://$MODULE_DIR$/core/vendor/sebastian/comparator" />
<excludeFolder url="file://$MODULE_DIR$/core/vendor/sebastian/global-state" />
<excludeFolder url="file://$MODULE_DIR$/core/vendor/michelf/php-markdown" />
<excludeFolder url="file://$MODULE_DIR$/core/vendor/ensepar/html2pdf" />
<excludeFolder url="file://$MODULE_DIR$/core/vendor/phpspec/prophecy" />
<excludeFolder url="file://$MODULE_DIR$/core/vendor/sebastian/exporter" />
<excludeFolder url="file://$MODULE_DIR$/core/vendor/sebastian/environment" />
<excludeFolder url="file://$MODULE_DIR$/core/vendor/sebastian/version" />
<excludeFolder url="file://$MODULE_DIR$/core/vendor/commerceguys/enum" />
<excludeFolder url="file://$MODULE_DIR$/core/vendor/commerceguys/addressing" />
<excludeFolder url="file://$MODULE_DIR$/core/vendor/simplepie/simplepie" />
<excludeFolder url="file://$MODULE_DIR$/core/vendor/psr/log" />
<excludeFolder url="file://$MODULE_DIR$/core/vendor/swiftmailer/swiftmailer" />
<excludeFolder url="file://$MODULE_DIR$/core/vendor/psr/cache" />
<excludeFolder url="file://$MODULE_DIR$/core/vendor/symfony/finder" />
<excludeFolder url="file://$MODULE_DIR$/core/vendor/symfony/polyfill-mbstring" />
<excludeFolder url="file://$MODULE_DIR$/core/vendor/symfony/polyfill-php56" />
<excludeFolder url="file://$MODULE_DIR$/core/vendor/symfony/routing" />
<excludeFolder url="file://$MODULE_DIR$/core/vendor/symfony/class-loader" />
<excludeFolder url="file://$MODULE_DIR$/core/vendor/symfony/polyfill-util" />
<excludeFolder url="file://$MODULE_DIR$/core/vendor/symfony/dependency-injection" />
<excludeFolder url="file://$MODULE_DIR$/core/vendor/stack/builder" />
<excludeFolder url="file://$MODULE_DIR$/core/vendor/symfony/property-access" />
<excludeFolder url="file://$MODULE_DIR$/core/vendor/symfony/config" />
<excludeFolder url="file://$MODULE_DIR$/core/vendor/symfony/form" />
<excludeFolder url="file://$MODULE_DIR$/core/vendor/symfony/intl" />
<excludeFolder url="file://$MODULE_DIR$/core/vendor/symfony/cache" />
<excludeFolder url="file://$MODULE_DIR$/core/vendor/symfony/security" />
<excludeFolder url="file://$MODULE_DIR$/core/vendor/symfony/options-resolver" />
<excludeFolder url="file://$MODULE_DIR$/core/vendor/symfony/polyfill-php54" />
<excludeFolder url="file://$MODULE_DIR$/core/vendor/symfony/http-foundation" />
<excludeFolder url="file://$MODULE_DIR$/core/vendor/symfony/event-dispatcher" />
<excludeFolder url="file://$MODULE_DIR$/core/vendor/composer" />
<excludeFolder url="file://$MODULE_DIR$/core/vendor/symfony/filesystem" />
<excludeFolder url="file://$MODULE_DIR$/core/vendor/symfony/polyfill-php70" />
<excludeFolder url="file://$MODULE_DIR$/core/vendor/symfony/console" />
<excludeFolder url="file://$MODULE_DIR$/core/vendor/symfony/icu" />
<excludeFolder url="file://$MODULE_DIR$/core/vendor/phpunit/phpunit" />
<excludeFolder url="file://$MODULE_DIR$/core/vendor/symfony/polyfill-intl-icu" />
<excludeFolder url="file://$MODULE_DIR$/core/vendor/phpunit/phpunit-mock-objects" />
<excludeFolder url="file://$MODULE_DIR$/core/vendor/symfony/yaml" />
<excludeFolder url="file://$MODULE_DIR$/core/vendor/phpdocumentor/reflection-docblock" />
<excludeFolder url="file://$MODULE_DIR$/core/vendor/phpunit/php-file-iterator" />
<excludeFolder url="file://$MODULE_DIR$/core/vendor/symfony/security-acl" />
<excludeFolder url="file://$MODULE_DIR$/core/vendor/phpunit/php-text-template" />
<excludeFolder url="file://$MODULE_DIR$/core/vendor/symfony/polyfill-php55" />
<excludeFolder url="file://$MODULE_DIR$/core/vendor/symfony/browser-kit" />
<excludeFolder url="file://$MODULE_DIR$/core/vendor/symfony/http-kernel" />
<excludeFolder url="file://$MODULE_DIR$/core/vendor/kriswallsmith/assetic" />
<excludeFolder url="file://$MODULE_DIR$/core/vendor/ramsey/array_column" />
<excludeFolder url="file://$MODULE_DIR$/core/vendor/phpunit/php-code-coverage" />
<excludeFolder url="file://$MODULE_DIR$/core/vendor/symfony/validator" />
<excludeFolder url="file://$MODULE_DIR$/core/vendor/symfony/dom-crawler" />
<excludeFolder url="file://$MODULE_DIR$/core/vendor/symfony-cmf/routing" />
<excludeFolder url="file://$MODULE_DIR$/core/vendor/symfony/expression-language" />
<excludeFolder url="file://$MODULE_DIR$/core/vendor/paragonie/random_compat" />
<excludeFolder url="file://$MODULE_DIR$/core/vendor/phpunit/php-timer" />
<excludeFolder url="file://$MODULE_DIR$/core/vendor/symfony/debug" />
<excludeFolder url="file://$MODULE_DIR$/core/vendor/phpunit/php-token-stream" />
<excludeFolder url="file://$MODULE_DIR$/core/vendor/symfony/serializer" />
<excludeFolder url="file://$MODULE_DIR$/core/vendor/ircmaxell/password-compat" />
<excludeFolder url="file://$MODULE_DIR$/core/vendor/symfony/process" />
<excludeFolder url="file://$MODULE_DIR$/core/vendor/symfony/translation" />
<excludeFolder url="file://$MODULE_DIR$/core/vendor/fzaninotto/faker" />
<excludeFolder url="file://$MODULE_DIR$/core/vendor/smarty/smarty" />
<excludeFolder url="file://$MODULE_DIR$/core/vendor/doctrine/collections" />
<excludeFolder url="file://$MODULE_DIR$/core/vendor/ptachoire/cssembed" />
<excludeFolder url="file://$MODULE_DIR$/core/vendor/doctrine/instantiator" />
<excludeFolder url="file://$MODULE_DIR$/core/vendor/doctrine/cache" />
<excludeFolder url="file://$MODULE_DIR$/core/vendor/imagine/imagine" />
<excludeFolder url="file://$MODULE_DIR$/core/vendor/ensepar/tcpdf" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>

6
.idea/vcs.xml generated Normal file
View File

@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$" vcs="Git" />
</component>
</project>

0
APPART Normal file
View File

4657
ApartMoment.sql Normal file

File diff suppressed because one or more lines are too long

1148
CHANGELOG.md Normal file

File diff suppressed because it is too large Load Diff

51
CONTRIBUTORS.md Normal file
View File

@@ -0,0 +1,51 @@
CONTRIBUTORS
============
If you contributes or contributed to this project and do not appear in this list below,
please email us (info@thelia.net) or fork this file on GitHub and send a pull-request.
- Manuel Raynaud (lunika)
- Franck Allimant (roadster31)
- Etienne Roudeix (etienneroudeix)
- Benjamin Perche (lovenunu)
- Julien Chanseaume (bibich)
- Christophe Laffont (touffies)
- Michaël Espeche (mespeche)
- Gilles Bourgeat (gillesbourgeat)
- Guillaume Morel (gmorel)
- Yochima (Yochima)
- Goleo Bruno (badsuricate)
- (zzuutt)
- Jérôme Billiras (bilhackmac)
- Emmanuel Nurit (enurit)
- (Asturyan)
- Etienne Perriere (Mertiozys)
- (griotteau)
- Alban Baixas (Alban-io)
- Christophe (InformatiqueProg)
- (jodeq)
- (nicolasleon)
- Chevrier (AnthonyMeedle)
- Romain Ducher (air-dex)
- Antony Penalver (Soldras)
- David Rimbault (Id4v)
- Stéphanie Pinet (stephaniepinet)
- Damien Foulhoux (Lucanis)
- Vincent Lopes-Vicente (lopes-vincent)
- (alex63530)
- Arnault Pachot (apachot)
- Cédric Sibaud (csibaud)
- Stéphane Calisti (csteph85)
- Alex Rock Ancelet (Pierstoval)
- Baptiste Cabarrou (bcabarrou)
- Adrien Bourroux (driou)
- (AdeDidou)
- DirtyF (DirtyF)
- (xockduo)
- Michaël Marinetti (Asenar)
- Mickaël (Kira-kyuukyoku)
- Quentin Dufour (superboum)
- Lespes (knjeurope)
- Tarun Garg (tarun1793)
- poum (poum)
- Luis Cordova (cordoval)

4
COPYRIGHT.txt Normal file
View File

@@ -0,0 +1,4 @@
THELIA
Copyright (C) 2005-2015 OpenStudio
THELIA application uses externals components and libraries which are released under their own LGPL compatible license terms.

165
LICENSE.txt Normal file
View File

@@ -0,0 +1,165 @@
GNU LESSER GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
This version of the GNU Lesser General Public License incorporates
the terms and conditions of version 3 of the GNU General Public
License, supplemented by the additional permissions listed below.
0. Additional Definitions.
As used herein, "this License" refers to version 3 of the GNU Lesser
General Public License, and the "GNU GPL" refers to version 3 of the GNU
General Public License.
"The Library" refers to a covered work governed by this License,
other than an Application or a Combined Work as defined below.
An "Application" is any work that makes use of an interface provided
by the Library, but which is not otherwise based on the Library.
Defining a subclass of a class defined by the Library is deemed a mode
of using an interface provided by the Library.
A "Combined Work" is a work produced by combining or linking an
Application with the Library. The particular version of the Library
with which the Combined Work was made is also called the "Linked
Version".
The "Minimal Corresponding Source" for a Combined Work means the
Corresponding Source for the Combined Work, excluding any source code
for portions of the Combined Work that, considered in isolation, are
based on the Application, and not on the Linked Version.
The "Corresponding Application Code" for a Combined Work means the
object code and/or source code for the Application, including any data
and utility programs needed for reproducing the Combined Work from the
Application, but excluding the System Libraries of the Combined Work.
1. Exception to Section 3 of the GNU GPL.
You may convey a covered work under sections 3 and 4 of this License
without being bound by section 3 of the GNU GPL.
2. Conveying Modified Versions.
If you modify a copy of the Library, and, in your modifications, a
facility refers to a function or data to be supplied by an Application
that uses the facility (other than as an argument passed when the
facility is invoked), then you may convey a copy of the modified
version:
a) under this License, provided that you make a good faith effort to
ensure that, in the event an Application does not supply the
function or data, the facility still operates, and performs
whatever part of its purpose remains meaningful, or
b) under the GNU GPL, with none of the additional permissions of
this License applicable to that copy.
3. Object Code Incorporating Material from Library Header Files.
The object code form of an Application may incorporate material from
a header file that is part of the Library. You may convey such object
code under terms of your choice, provided that, if the incorporated
material is not limited to numerical parameters, data structure
layouts and accessors, or small macros, inline functions and templates
(ten or fewer lines in length), you do both of the following:
a) Give prominent notice with each copy of the object code that the
Library is used in it and that the Library and its use are
covered by this License.
b) Accompany the object code with a copy of the GNU GPL and this license
document.
4. Combined Works.
You may convey a Combined Work under terms of your choice that,
taken together, effectively do not restrict modification of the
portions of the Library contained in the Combined Work and reverse
engineering for debugging such modifications, if you also do each of
the following:
a) Give prominent notice with each copy of the Combined Work that
the Library is used in it and that the Library and its use are
covered by this License.
b) Accompany the Combined Work with a copy of the GNU GPL and this license
document.
c) For a Combined Work that displays copyright notices during
execution, include the copyright notice for the Library among
these notices, as well as a reference directing the user to the
copies of the GNU GPL and this license document.
d) Do one of the following:
0) Convey the Minimal Corresponding Source under the terms of this
License, and the Corresponding Application Code in a form
suitable for, and under terms that permit, the user to
recombine or relink the Application with a modified version of
the Linked Version to produce a modified Combined Work, in the
manner specified by section 6 of the GNU GPL for conveying
Corresponding Source.
1) Use a suitable shared library mechanism for linking with the
Library. A suitable mechanism is one that (a) uses at run time
a copy of the Library already present on the user's computer
system, and (b) will operate properly with a modified version
of the Library that is interface-compatible with the Linked
Version.
e) Provide Installation Information, but only if you would otherwise
be required to provide such information under section 6 of the
GNU GPL, and only to the extent that such information is
necessary to install and execute a modified version of the
Combined Work produced by recombining or relinking the
Application with a modified version of the Linked Version. (If
you use option 4d0, the Installation Information must accompany
the Minimal Corresponding Source and Corresponding Application
Code. If you use option 4d1, you must provide the Installation
Information in the manner specified by section 6 of the GNU GPL
for conveying Corresponding Source.)
5. Combined Libraries.
You may place library facilities that are a work based on the
Library side by side in a single library together with other library
facilities that are not Applications and are not covered by this
License, and convey such a combined library under terms of your
choice, if you do both of the following:
a) Accompany the combined library with a copy of the same work based
on the Library, uncombined with any other library facilities,
conveyed under the terms of this License.
b) Give prominent notice with the combined library that part of it
is a work based on the Library, and explaining where to find the
accompanying uncombined form of the same work.
6. Revised Versions of the GNU Lesser General Public License.
The Free Software Foundation may publish revised and/or new versions
of the GNU Lesser General Public License from time to time. Such new
versions will be similar in spirit to the present version, but may
differ in detail to address new problems or concerns.
Each version is given a distinguishing version number. If the
Library as you received it specifies that a certain numbered version
of the GNU Lesser General Public License "or any later version"
applies to it, you have the option of following the terms and
conditions either of that published version or of any later version
published by the Free Software Foundation. If the Library as you
received it does not specify a version number of the GNU Lesser
General Public License, you may choose any version of the GNU Lesser
General Public License ever published by the Free Software Foundation.
If the Library as you received it specifies that a proxy can decide
whether future versions of the GNU Lesser General Public License shall
apply, that proxy's public statement of acceptance of any version is
permanent authorization for you to choose that version for the
Library.

217
Readme.md Normal file
View File

@@ -0,0 +1,217 @@
Readme
======
## Warning
### This is the development repository of Thelia. If you want to create a project, please take a look at [thelia/thelia-project](https://github.com/thelia/thelia-project)
Thelia
------
[![Build Status](https://travis-ci.org/thelia/thelia.png?branch=master)](https://travis-ci.org/thelia/thelia)
[![License](https://poser.pugx.org/thelia/thelia/license.png)](https://packagist.org/packages/thelia/thelia)
[![Scrutinizer Quality Score](https://scrutinizer-ci.com/g/thelia/thelia/badges/quality-score.png?s=61e3e04a69bffd71c29b08e5392080317a546716)](https://scrutinizer-ci.com/g/thelia/thelia/)
[Thelia](https://thelia.net/) is an open source tool for creating e-business websites and managing online content. This software is published under LGPL.
This is the new major version of Thelia.
A repository containing all thelia modules is available at this address : https://github.com/thelia-modules
Requirements
------------
* PHP 5.5
* Required extensions :
* PDO_Mysql
* openssl
* intl
* gd
* curl
* calendar
* dom
* fileinfo
* safe_mode off
* memory_limit at least 128M, preferably 256.
* post\_max\_size 20M
* upload\_max\_filesize 2M
* date.timezone must be defined
* Web Server Apache 2 or Nginx
* MySQL 5
### MySQL 5.6
As of MySQL 5.6, default configuration sets the sql_mode value to
```
STRICT_TRANS_TABLES,NO_ENGINE_SUBSTITUTION
```
This 'STRICT_TRANS_TABLES' configuration results in SQL errors when no default value is defined on NOT NULL columns and the value is empty or invalid.
You can edit this default config in ` /etc/my.cnf ` and change the sql_mode to remove the STRICT_TRANS_TABLES part
```
[mysqld]
sql_mode=NO_ENGINE_SUBSTITUTION
```
Assuming your sql_mode is the default one, you can change the value directly on the run by running the following SQL Command
```sql
SET @@GLOBAL.sql_mode='NO_ENGINE_SUBSTITUTION', @@SESSION.sql_mode='NO_ENGINE_SUBSTITUTION'
```
For more information on sql_mode you can consult the [MySQL doc](http://dev.mysql.com/doc/refman/5.0/fr/server-sql-mode.html "sql Mode")
## Archive builders
Thelia's archive builder's needs external libraries.
For zip archives, you need PECL zip. See [PHP Doc](http://php.net/manual/en/zip.installation.php)
For tar archives, you need PECL phar. Moreover, you need to deactivate php.ini option "phar.readonly":
```ini
phar.readonly = Off
```
For tar.bz2 archives, you need tar's dependencies and the extension "bzip2". See [PHP Doc](http://php.net/manual/fr/book.bzip2.php)
For tar.gz archives, you need tar's dependencies and the extension "zlib". See [PHP Doc](http://fr2.php.net/manual/fr/book.zlib.php)
## Download Thelia 2 and install its dependencies
You can get the sources from git and then let composer install dependencies, or use composer to install the whole thelia project into a specific directory
### Using git for download and composer for dependencies
``` bash
$ git clone --recursive https://github.com/thelia/thelia path
$ cd path
$ git checkout 2.3.5 (2.2.6 or 2.1.11)
$ curl -sS https://getcomposer.org/installer | php
$ php composer.phar install
```
### Using composer for both download and dependencies
``` bash
$ curl -sS https://getcomposer.org/installer | php
$ php composer.phar create-project thelia/thelia path/ 2.3.5 (2.2.6 or 2.1.11)
```
If something goes wrong during the install process, you can restart Thelia install wizard with
the following command : `php composer.phar run-script post-create-project-cmd`
## Install it
You can install Thelia by two different way
### Using install wizard
Installing thelia with the web install wizard allow to create an administrator, add some informations about your shop, etc
First of all, you have to configure a vhost as describe in [configuration](http://doc.thelia.net/en/documentation/configuration.html) section.
The install wizard in accessible with your favorite browser :
``` bash
http://yourdomain.tld/[/subdomain_if_needed]/install
```
For example, I have thelia downloaded at https://thelia.net and my vhost is correctly configured, I have to reach this address :
``` bash
https://thelia.net/install
```
### Using cli tools
``` bash
$ php Thelia thelia:install
```
or if you use a Thelia project :
``` bash
$ php composer.phar run-script post-create-project-cmd
```
You just have to follow all instructions.
### Docker and docker compose
This repo contains all the configuration needed to run Thelia with docker and docker-compose.
It requires obviously [docker](https://docker.com/) and [docker-compose](http://docs.docker.com/compose/)
To install Thelia within Docker, run :
```
docker-compose up -d
docker-compose exec web composer install
docker-compose exec web php Thelia thelia:install
```
This will prompt you for database information. Enter the following :
* host : mariaDB
* port : 3306 (default)
* name : thelia
* login : root
* password : toor
tip : create an alias for docker-compose, it's boring to write it all the time
All the scripts can be launched through docker (or the corresponding `docker-compose exec web ...` command. For example :
```
docker exec -it thelia_web_1 composer install
docker exec -it thelia_web_1 php Thelia cache:clear
docker exec -it thelia_web_1 php setup/faker.php
docker exec -it thelia_web_1 unit-tests.sh
```
Once started, you can open your local Thelia website at [127.0.0.1:8080](http://127.0.0.1:8080) and your phpMyAdmin installation at [127.0.0.1:8081](http://127.0.0.1:8081).
What is missing :
* confguration for export compression (zip, gzip, etc)
Obviously you can modify all the configuration for your own case, for example the php version or add environment variable for the database configuration. Each time you modify the configuration, you have to rebuild it :
```
docker-compose build --no-cache
```
Documentation
-------------
Thelia documentation is available at http://doc.thelia.net
Roadmap
-------
The Roadmap is available at https://thelia.net/community/roadmap
Contribute
----------
see the documentation : http://doc.thelia.net/en/documentation/contribute.html
If you submit modifications that adds new data or change the structure of the database, take a look to http://doc.thelia.net/en/documentation/contribute.html#sql-scripts-modification
Usage
-----
Consult the page : http://localhost/thelia/web/index_dev.php
You can create a virtual host and choose web folder for root directory.
To run tests (phpunit required) :
``` bash
$ phpunit
```
We still have lot of work to achieve but enjoy this part.

5
Thelia Normal file
View File

@@ -0,0 +1,5 @@
#!/usr/bin/env php
<?php
$bootstrapFile = __DIR__ . "/core/vendor/autoload.php";
include __DIR__ . "/core/Thelia";

68
UPDATE.md Normal file
View File

@@ -0,0 +1,68 @@
# How to update your Thelia ?
If you have already installed Thelia but a new version is available, you can update easily.
Before proceeding to the update, it's strongly recommended to backup your website (files and database).
You can backup your database with tools such as [phpmyadmin](http://www.phpmyadmin.net)
or [mysqldump](dev.mysql.com/doc/refman/5.6/en/mysqldump.html).
## 1. Update files
- Download the latest version of Thelia : <http://thelia.net/download/thelia.zip>
- Extract the zip in a temporary directory
- Then you should replace (not only copy) all the files from the new Thelia version :
- all files from root directory
- bin (*optional*)
- core (**mandatory**)
- setup (**mandatory**)
- Then, you have to merge (copy in your existent directories) these other directories. Normally,
you haven't modify files inside these directories (just created new ones - like your frontOffice template).
But If you have modified files, you should proceed carefully and try to report all your changes.
- local/config
- local/modules
- templates
- web
## 2. Update database
Then you have 2 different ways to proceed. In each method, a backup of your database can be automatically
performed if you want to. If an error is encountered, then your database will be restored.
But if your database is quite large, it's better to make a backup manually.
### 2.1. use the update script
In a command shell, go to the root directory of your installation, run and follow instructions :
```bash
php setup/update.php
```
### 2.2. use the update wizard
An update wizard is available in the ```web/install``` directory. It's the same directory used by the install wizard.
**You have to protect the web folder if your site is public (htaccess, List of allowed IP, ...).**
The update wizard in accessible with your favorite browser :
```bash
http://yourdomain.tld/[/subdomain_if_needed]/install
```
Note:
- the wizard is available only if your Thelia is not already in the latest version.
- at the end of the process, the install directory will be removed.
## 3. Clear cache
Once the update is done successfully, you have to clear all caches :
- clear all caches in all environment :
- ```php Thelia cache:clear```
- ```php Thelia cache:clear --env=prod```
If the command fails, you can do it manually. Just delete the content of
the ```cache``` and ```web/cache``` directories.

131
UPGRADE-2.3.md Normal file
View File

@@ -0,0 +1,131 @@
UPGRADE FROM 2.2 to 2.3
=======================
EventDispatcher
----------------
* The `getDispatcher()` and `getName()` methods from `Symfony\Component\EventDispatcher\Event`
are deprecated, the event dispatcher instance and event name can be received in the listener call instead.
Before:
```php
use Symfony\Component\EventDispatcher\Event;
class Foo
{
public function myFooListener(Event $event)
{
$dispatcher = $event->getDispatcher();
$eventName = $event->getName();
$dispatcher->dispatch('log', $event);
// ... more code
}
}
```
After:
```php
use Symfony\Component\EventDispatcher\Event;
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
class MyListenerClass
{
public function myListenerMethod(Event $event, $eventName, EventDispatcherInterface $dispatcher)
{
$dispatcher->dispatch('log', $event);
// ... more code
}
}
```
While this above is sufficient for most uses, **if your module must be compatible with versions less than 2.3, or if your module uses multiple EventDispatcher instances,** you might need to specifically inject a known instance of the `EventDispatcher` into your listeners. This could be done using constructor or setter injection as follows:
```php
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
class MyListenerClass
{
protected $dispatcher = null;
public function __construct(EventDispatcherInterface $dispatcher)
{
$this->dispatcher = $dispatcher;
}
}
```
Request and RequestStack
----------------
* The `Request` service are deprecated, you must now use the `RequestStack` service.
##### In your loops
The way to recover the request does not change.
To get the current request
```php
class MyLoopClass extends BaseLoop implements PropelSearchLoopInterface
{
public function buildModelCriteria()
{
// Get the current request
$request = $this->getCurrentRequest();
// Or
$request = $this->requestStack->getCurrentRequest();
// ... more code
}
}
```
##### In your controllers
It's not recommended to use `getRequest()` and `getSession()`, the Request instance can be received in the action method parameters.
However, the `getRequest()` method returns the current request.
**Warning !!** This is not compatible with Thelia 2.0, because it uses Symfony 2.2
To get the current request
```php
use Thelia\Core\HttpFoundation\Request;
class MyControllerClass extends ...
{
public function MyActionMethod(Request $request, $query_parameters ...)
{
$session = $request->getSession();
// ... more code
}
}
```
Container Scopes
----------------
* The "container scopes" concept no longer exists in Thelia 2.3.
For backward compatibility, the attributes `scope` is automatically removed of the xml configuration files.
**Warning !!** The attributes `scope` are always needed for your modules compatible with Thelia < 2.3.
[See the Symfony documentation for more information](http://symfony.com/doc/2.8/cookbook/service_container/scopes.html)
Unit Test
----------------
* The `SecurityContext`, `ParserContext`, `TokenProvider`, `TheliaFormFactory`, `TaxEngine` services are no longer dependent on "Request", but "RequestSTack".
This may break your unit tests.
For more information about the upgrade from Symfony 2.3 to Symfony 2.8
----------------
[Upgrade from Symfony 2.3 to 2.4](https://github.com/symfony/symfony/blob/2.8/UPGRADE-2.4.md)
[Upgrade from Symfony 2.4 to 2.5](https://github.com/symfony/symfony/blob/2.8/UPGRADE-2.5.md)
[Upgrade from Symfony 2.5 to 2.6](https://github.com/symfony/symfony/blob/2.8/UPGRADE-2.6.md)
[Upgrade from Symfony 2.6 to 2.7](https://github.com/symfony/symfony/blob/2.8/UPGRADE-2.7.md)
[Upgrade from Symfony 2.7 to 2.8](https://github.com/symfony/symfony/blob/2.8/UPGRADE-2.8.md)
[Upgrade from Symfony 2.8 to 3.0](https://github.com/symfony/symfony/blob/2.8/UPGRADE-3.0.md)

1
bin/lessc Normal file
View File

@@ -0,0 +1 @@
../core/vendor/oyejorge/less.php/bin/lessc

1
bin/phpunit Normal file
View File

@@ -0,0 +1 @@
../core/vendor/phpunit/phpunit/phpunit

1
bin/propel Normal file
View File

@@ -0,0 +1 @@
../core/vendor/propel/propel/bin/propel

2862
cache/prod/CoreProdProjectContainer.php vendored Normal file

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

63
cache/prod/ProjectUrlMatcherBeds24.php vendored Normal file
View File

@@ -0,0 +1,63 @@
<?php
use Symfony\Component\Routing\Exception\MethodNotAllowedException;
use Symfony\Component\Routing\Exception\ResourceNotFoundException;
use Symfony\Component\Routing\RequestContext;
/**
* ProjectUrlMatcherBeds24.
*
* This class has been auto-generated
* by the Symfony Routing Component.
*/
class ProjectUrlMatcherBeds24 extends Symfony\Component\Routing\Matcher\UrlMatcher
{
/**
* Constructor.
*/
public function __construct(RequestContext $context)
{
$this->context = $context;
}
public function match($pathinfo)
{
$allow = array();
$pathinfo = rawurldecode($pathinfo);
$context = $this->context;
$request = $this->request;
if (0 === strpos($pathinfo, '/admin/beds24/c')) {
// beds24.configure
if ($pathinfo === '/admin/beds24/configure') {
return array ( '_controller' => 'Beds24\\Controller\\Back\\ConfigurationController::configure', '_route' => 'beds24.configure',);
}
// beds24.clear_cache
if ($pathinfo === '/admin/beds24/clear-cache') {
return array ( '_controller' => 'Beds24\\Controller\\Back\\ConfigurationController::clearCache', '_route' => 'beds24.clear_cache',);
}
}
// beds24.notification
if ($pathinfo === '/beds24/notify') {
return array ( '_controller' => 'Beds24\\Controller\\Front\\NotificationController::notify', '_route' => 'beds24.notification',);
}
if (0 === strpos($pathinfo, '/search-availabilit')) {
// beds24.search
if ($pathinfo === '/search-availabilities') {
return array ( '_controller' => 'Beds24\\Controller\\Front\\SearchController::searchAll', '_route' => 'beds24.search',);
}
// beds24.search_product
if (0 === strpos($pathinfo, '/search-availability') && preg_match('#^/search\\-availability/(?P<productId>\\d+)$#s', $pathinfo, $matches)) {
return $this->mergeDefaults(array_replace($matches, array('_route' => 'beds24.search_product')), array ( '_controller' => 'Beds24\\Controller\\Front\\SearchController::searchProduct',));
}
}
throw 0 < count($allow) ? new MethodNotAllowedException(array_unique($allow)) : new ResourceNotFoundException();
}
}

View File

@@ -0,0 +1 @@
a:1:{i:0;C:46:"Symfony\Component\Config\Resource\FileResource":97:{s:89:"/Volumes/Dev/Sources/Clients/apartmoment/site_web/local/modules/Beds24/Config/routing.xml";}}

View File

@@ -0,0 +1,71 @@
<?php
use Symfony\Component\Routing\Exception\MethodNotAllowedException;
use Symfony\Component\Routing\Exception\ResourceNotFoundException;
use Symfony\Component\Routing\RequestContext;
/**
* ProjectUrlMatcherCarousel.
*
* This class has been auto-generated
* by the Symfony Routing Component.
*/
class ProjectUrlMatcherCarousel extends Symfony\Component\Routing\Matcher\UrlMatcher
{
/**
* Constructor.
*/
public function __construct(RequestContext $context)
{
$this->context = $context;
}
public function match($pathinfo)
{
$allow = array();
$pathinfo = rawurldecode($pathinfo);
$context = $this->context;
$request = $this->request;
if (0 === strpos($pathinfo, '/admin/module/carousel')) {
if (0 === strpos($pathinfo, '/admin/module/carousel/up')) {
// carousel.upload.image
if ($pathinfo === '/admin/module/carousel/upload') {
if ($this->context->getMethod() != 'POST') {
$allow[] = 'POST';
goto not_carouseluploadimage;
}
return array ( '_controller' => 'Carousel\\Controller\\ConfigurationController::uploadImage', '_route' => 'carousel.upload.image',);
}
not_carouseluploadimage:
// carousel.update
if ($pathinfo === '/admin/module/carousel/update') {
if ($this->context->getMethod() != 'POST') {
$allow[] = 'POST';
goto not_carouselupdate;
}
return array ( '_controller' => 'Carousel\\Controller\\ConfigurationController::updateAction', '_route' => 'carousel.update',);
}
not_carouselupdate:
}
// carousel.delete
if ($pathinfo === '/admin/module/carousel/delete') {
if ($this->context->getMethod() != 'POST') {
$allow[] = 'POST';
goto not_carouseldelete;
}
return array ( '_controller' => 'Carousel\\Controller\\ConfigurationController::deleteAction', '_route' => 'carousel.delete',);
}
not_carouseldelete:
}
throw 0 < count($allow) ? new MethodNotAllowedException(array_unique($allow)) : new ResourceNotFoundException();
}
}

View File

@@ -0,0 +1 @@
a:1:{i:0;C:46:"Symfony\Component\Config\Resource\FileResource":99:{s:91:"/Volumes/Dev/Sources/Clients/apartmoment/site_web/local/modules/Carousel/Config/routing.xml";}}

43
cache/prod/ProjectUrlMatcherCheque.php vendored Normal file
View File

@@ -0,0 +1,43 @@
<?php
use Symfony\Component\Routing\Exception\MethodNotAllowedException;
use Symfony\Component\Routing\Exception\ResourceNotFoundException;
use Symfony\Component\Routing\RequestContext;
/**
* ProjectUrlMatcherCheque.
*
* This class has been auto-generated
* by the Symfony Routing Component.
*/
class ProjectUrlMatcherCheque extends Symfony\Component\Routing\Matcher\UrlMatcher
{
/**
* Constructor.
*/
public function __construct(RequestContext $context)
{
$this->context = $context;
}
public function match($pathinfo)
{
$allow = array();
$pathinfo = rawurldecode($pathinfo);
$context = $this->context;
$request = $this->request;
// cheque.configure
if ($pathinfo === '/admin/cheque/configure') {
if ($this->context->getMethod() != 'POST') {
$allow[] = 'POST';
goto not_chequeconfigure;
}
return array ( '_controller' => 'Cheque\\Controller\\ConfigureController::configure', '_route' => 'cheque.configure',);
}
not_chequeconfigure:
throw 0 < count($allow) ? new MethodNotAllowedException(array_unique($allow)) : new ResourceNotFoundException();
}
}

View File

@@ -0,0 +1 @@
a:1:{i:0;C:46:"Symfony\Component\Config\Resource\FileResource":97:{s:89:"/Volumes/Dev/Sources/Clients/apartmoment/site_web/local/modules/Cheque/Config/routing.xml";}}

90
cache/prod/ProjectUrlMatcherCmCIC.php vendored Normal file
View File

@@ -0,0 +1,90 @@
<?php
use Symfony\Component\Routing\Exception\MethodNotAllowedException;
use Symfony\Component\Routing\Exception\ResourceNotFoundException;
use Symfony\Component\Routing\RequestContext;
/**
* ProjectUrlMatcherCmCIC.
*
* This class has been auto-generated
* by the Symfony Routing Component.
*/
class ProjectUrlMatcherCmCIC extends Symfony\Component\Routing\Matcher\UrlMatcher
{
/**
* Constructor.
*/
public function __construct(RequestContext $context)
{
$this->context = $context;
}
public function match($pathinfo)
{
$allow = array();
$pathinfo = rawurldecode($pathinfo);
$context = $this->context;
$request = $this->request;
if (0 === strpos($pathinfo, '/cmcic')) {
if (0 === strpos($pathinfo, '/cmcic/payfail')) {
// cmcic.payfail
if (preg_match('#^/cmcic/payfail/(?P<order_id>\\d+)$#s', $pathinfo, $matches)) {
if (!in_array($this->context->getMethod(), array('GET', 'HEAD'))) {
$allow = array_merge($allow, array('GET', 'HEAD'));
goto not_cmcicpayfail;
}
return $this->mergeDefaults(array_replace($matches, array('_route' => 'cmcic.payfail')), array ( '_controller' => 'CmCIC\\Controller\\CmcicPayResponse::payfail',));
}
not_cmcicpayfail:
// cmcic.payfail.with.message
if (preg_match('#^/cmcic/payfail/(?P<order_id>\\d+)/(?P<message>[^/]++)$#s', $pathinfo, $matches)) {
if (!in_array($this->context->getMethod(), array('GET', 'HEAD'))) {
$allow = array_merge($allow, array('GET', 'HEAD'));
goto not_cmcicpayfailwithmessage;
}
return $this->mergeDefaults(array_replace($matches, array('_route' => 'cmcic.payfail.with.message')), array ( '_controller' => 'CmCIC\\Controller\\CmcicPayResponse::payfail',));
}
not_cmcicpayfailwithmessage:
}
// cmcic.receive
if ($pathinfo === '/cmcic/validation') {
if ($this->context->getMethod() != 'POST') {
$allow[] = 'POST';
goto not_cmcicreceive;
}
return array ( '_controller' => 'CmCIC\\Controller\\CmcicPayResponse::receiveResponse', '_route' => 'cmcic.receive',);
}
not_cmcicreceive:
}
if (0 === strpos($pathinfo, '/admin/module/cmcic')) {
// cmcic.saveconfig
if ($pathinfo === '/admin/module/cmcic/saveconfig') {
if ($this->context->getMethod() != 'POST') {
$allow[] = 'POST';
goto not_cmcicsaveconfig;
}
return array ( '_controller' => 'CmCIC\\Controller\\CmcicSaveConfig::save', '_route' => 'cmcic.saveconfig',);
}
not_cmcicsaveconfig:
// cmcic.download.log
if ($pathinfo === '/admin/module/cmcic/log') {
return array ( '_controller' => 'CmCIC\\Controller\\CmcicSaveConfig::downloadLog', '_route' => 'cmcic.download.log',);
}
}
throw 0 < count($allow) ? new MethodNotAllowedException(array_unique($allow)) : new ResourceNotFoundException();
}
}

View File

@@ -0,0 +1 @@
a:1:{i:0;C:46:"Symfony\Component\Config\Resource\FileResource":96:{s:88:"/Volumes/Dev/Sources/Clients/apartmoment/site_web/local/modules/CmCIC/Config/routing.xml";}}

View File

@@ -0,0 +1,53 @@
<?php
use Symfony\Component\Routing\Exception\MethodNotAllowedException;
use Symfony\Component\Routing\Exception\ResourceNotFoundException;
use Symfony\Component\Routing\RequestContext;
/**
* ProjectUrlMatcherHookAdminHome.
*
* This class has been auto-generated
* by the Symfony Routing Component.
*/
class ProjectUrlMatcherHookAdminHome extends Symfony\Component\Routing\Matcher\UrlMatcher
{
/**
* Constructor.
*/
public function __construct(RequestContext $context)
{
$this->context = $context;
}
public function match($pathinfo)
{
$allow = array();
$pathinfo = rawurldecode($pathinfo);
$context = $this->context;
$request = $this->request;
if (0 === strpos($pathinfo, '/admin')) {
if (0 === strpos($pathinfo, '/admin/home')) {
// admin.home.stats
if ($pathinfo === '/admin/home/stats') {
return array ( '_controller' => 'HookAdminHome\\Controller\\HomeController::loadStatsAjaxAction', '_route' => 'admin.home.stats',);
}
// admin.home.month.sales.block
if (0 === strpos($pathinfo, '/admin/home/month-sales-block') && preg_match('#^/admin/home/month\\-sales\\-block/(?P<month>\\d+)/(?P<year>\\d+)$#s', $pathinfo, $matches)) {
return $this->mergeDefaults(array_replace($matches, array('_route' => 'admin.home.month.sales.block')), array ( '_controller' => 'HookAdminHome\\Controller\\HomeController::blockMonthSalesStatistics',));
}
}
// admin.news-feed
if ($pathinfo === '/admin/ajax/thelia_news_feed') {
return array ( '_controller' => 'HookAdminHome\\Controller\\HomeController::processTemplateAction', 'template' => 'ajax/thelia_news_feed', 'not-logged' => '1', '_route' => 'admin.news-feed',);
}
}
throw 0 < count($allow) ? new MethodNotAllowedException(array_unique($allow)) : new ResourceNotFoundException();
}
}

View File

@@ -0,0 +1 @@
a:1:{i:0;C:46:"Symfony\Component\Config\Resource\FileResource":104:{s:96:"/Volumes/Dev/Sources/Clients/apartmoment/site_web/local/modules/HookAdminHome/Config/routing.xml";}}

View File

@@ -0,0 +1,43 @@
<?php
use Symfony\Component\Routing\Exception\MethodNotAllowedException;
use Symfony\Component\Routing\Exception\ResourceNotFoundException;
use Symfony\Component\Routing\RequestContext;
/**
* ProjectUrlMatcherHookAnalytics.
*
* This class has been auto-generated
* by the Symfony Routing Component.
*/
class ProjectUrlMatcherHookAnalytics extends Symfony\Component\Routing\Matcher\UrlMatcher
{
/**
* Constructor.
*/
public function __construct(RequestContext $context)
{
$this->context = $context;
}
public function match($pathinfo)
{
$allow = array();
$pathinfo = rawurldecode($pathinfo);
$context = $this->context;
$request = $this->request;
// hookanalytics.configuration
if ($pathinfo === '/admin/module/hookanalytics/save') {
if ($this->context->getMethod() != 'POST') {
$allow[] = 'POST';
goto not_hookanalyticsconfiguration;
}
return array ( '_controller' => 'HookAnalytics\\Controller\\Configuration::saveAction', '_route' => 'hookanalytics.configuration',);
}
not_hookanalyticsconfiguration:
throw 0 < count($allow) ? new MethodNotAllowedException(array_unique($allow)) : new ResourceNotFoundException();
}
}

View File

@@ -0,0 +1 @@
a:1:{i:0;C:46:"Symfony\Component\Config\Resource\FileResource":104:{s:96:"/Volumes/Dev/Sources/Clients/apartmoment/site_web/local/modules/HookAnalytics/Config/routing.xml";}}

View File

@@ -0,0 +1,57 @@
<?php
use Symfony\Component\Routing\Exception\MethodNotAllowedException;
use Symfony\Component\Routing\Exception\ResourceNotFoundException;
use Symfony\Component\Routing\RequestContext;
/**
* ProjectUrlMatcherHookNavigation.
*
* This class has been auto-generated
* by the Symfony Routing Component.
*/
class ProjectUrlMatcherHookNavigation extends Symfony\Component\Routing\Matcher\UrlMatcher
{
/**
* Constructor.
*/
public function __construct(RequestContext $context)
{
$this->context = $context;
}
public function match($pathinfo)
{
$allow = array();
$pathinfo = rawurldecode($pathinfo);
$context = $this->context;
$request = $this->request;
if (0 === strpos($pathinfo, '/admin/module/HookNavigation')) {
// hooknavigation.configuration.default
if ($pathinfo === '/admin/module/HookNavigation') {
if (!in_array($this->context->getMethod(), array('GET', 'HEAD'))) {
$allow = array_merge($allow, array('GET', 'HEAD'));
goto not_hooknavigationconfigurationdefault;
}
return array ( '_controller' => 'HookNavigation:HookNavigationConfig:default', '_route' => 'hooknavigation.configuration.default',);
}
not_hooknavigationconfigurationdefault:
// hooknavigation.configuration.save
if ($pathinfo === '/admin/module/HookNavigation') {
if ($this->context->getMethod() != 'POST') {
$allow[] = 'POST';
goto not_hooknavigationconfigurationsave;
}
return array ( '_controller' => 'HookNavigation:HookNavigationConfig:save', '_route' => 'hooknavigation.configuration.save',);
}
not_hooknavigationconfigurationsave:
}
throw 0 < count($allow) ? new MethodNotAllowedException(array_unique($allow)) : new ResourceNotFoundException();
}
}

View File

@@ -0,0 +1 @@
a:1:{i:0;C:46:"Symfony\Component\Config\Resource\FileResource":105:{s:97:"/Volumes/Dev/Sources/Clients/apartmoment/site_web/local/modules/HookNavigation/Config/routing.xml";}}

View File

@@ -0,0 +1,50 @@
<?php
use Symfony\Component\Routing\Exception\MethodNotAllowedException;
use Symfony\Component\Routing\Exception\ResourceNotFoundException;
use Symfony\Component\Routing\RequestContext;
/**
* ProjectUrlMatcherShortcuts.
*
* This class has been auto-generated
* by the Symfony Routing Component.
*/
class ProjectUrlMatcherShortcuts extends Symfony\Component\Routing\Matcher\UrlMatcher
{
/**
* Constructor.
*/
public function __construct(RequestContext $context)
{
$this->context = $context;
}
public function match($pathinfo)
{
$allow = array();
$pathinfo = rawurldecode($pathinfo);
$context = $this->context;
$request = $this->request;
if (0 === strpos($pathinfo, '/admin/module/Shortcuts')) {
// shortcuts-settings
if ($pathinfo === '/admin/module/Shortcuts') {
return array ( '_controller' => 'Shortcuts:Shortcuts:index', '_route' => 'shortcuts-settings',);
}
// shortcuts.create-shortcut
if ($pathinfo === '/admin/module/Shortcuts/create') {
return array ( '_controller' => 'Shortcuts:Shortcuts:create', '_route' => 'shortcuts.create-shortcut',);
}
// shortcuts.delete-shortcut
if ($pathinfo === '/admin/module/Shortcuts/delete') {
return array ( '_controller' => 'Shortcuts:Shortcuts:delete', '_route' => 'shortcuts.delete-shortcut',);
}
}
throw 0 < count($allow) ? new MethodNotAllowedException(array_unique($allow)) : new ResourceNotFoundException();
}
}

View File

@@ -0,0 +1 @@
a:1:{i:0;C:46:"Symfony\Component\Config\Resource\FileResource":100:{s:92:"/Volumes/Dev/Sources/Clients/apartmoment/site_web/local/modules/Shortcuts/Config/routing.xml";}}

43
cache/prod/ProjectUrlMatcherTinymce.php vendored Normal file
View File

@@ -0,0 +1,43 @@
<?php
use Symfony\Component\Routing\Exception\MethodNotAllowedException;
use Symfony\Component\Routing\Exception\ResourceNotFoundException;
use Symfony\Component\Routing\RequestContext;
/**
* ProjectUrlMatcherTinymce.
*
* This class has been auto-generated
* by the Symfony Routing Component.
*/
class ProjectUrlMatcherTinymce extends Symfony\Component\Routing\Matcher\UrlMatcher
{
/**
* Constructor.
*/
public function __construct(RequestContext $context)
{
$this->context = $context;
}
public function match($pathinfo)
{
$allow = array();
$pathinfo = rawurldecode($pathinfo);
$context = $this->context;
$request = $this->request;
// tinymce.configure
if ($pathinfo === '/admin/tinymce/configure') {
if ($this->context->getMethod() != 'POST') {
$allow[] = 'POST';
goto not_tinymceconfigure;
}
return array ( '_controller' => 'Tinymce\\Controller\\ConfigureController::configure', '_route' => 'tinymce.configure',);
}
not_tinymceconfigure:
throw 0 < count($allow) ? new MethodNotAllowedException(array_unique($allow)) : new ResourceNotFoundException();
}
}

View File

@@ -0,0 +1 @@
a:1:{i:0;C:46:"Symfony\Component\Config\Resource\FileResource":98:{s:90:"/Volumes/Dev/Sources/Clients/apartmoment/site_web/local/modules/Tinymce/Config/routing.xml";}}

43
cache/prod/ProjectUrlMatcherView.php vendored Normal file
View File

@@ -0,0 +1,43 @@
<?php
use Symfony\Component\Routing\Exception\MethodNotAllowedException;
use Symfony\Component\Routing\Exception\ResourceNotFoundException;
use Symfony\Component\Routing\RequestContext;
/**
* ProjectUrlMatcherView.
*
* This class has been auto-generated
* by the Symfony Routing Component.
*/
class ProjectUrlMatcherView extends Symfony\Component\Routing\Matcher\UrlMatcher
{
/**
* Constructor.
*/
public function __construct(RequestContext $context)
{
$this->context = $context;
}
public function match($pathinfo)
{
$allow = array();
$pathinfo = rawurldecode($pathinfo);
$context = $this->context;
$request = $this->request;
// view.add
if (0 === strpos($pathinfo, '/admin/view/add') && preg_match('#^/admin/view/add/(?P<source_id>\\d+)$#s', $pathinfo, $matches)) {
if ($this->context->getMethod() != 'POST') {
$allow[] = 'POST';
goto not_viewadd;
}
return $this->mergeDefaults(array_replace($matches, array('_route' => 'view.add')), array ( '_controller' => 'View\\Controller\\ViewController::createAction',));
}
not_viewadd:
throw 0 < count($allow) ? new MethodNotAllowedException(array_unique($allow)) : new ResourceNotFoundException();
}
}

View File

@@ -0,0 +1 @@
a:1:{i:0;C:46:"Symfony\Component\Config\Resource\FileResource":95:{s:87:"/Volumes/Dev/Sources/Clients/apartmoment/site_web/local/modules/View/Config/routing.xml";}}

View File

@@ -0,0 +1,472 @@
<?php
use Symfony\Component\Routing\Exception\MethodNotAllowedException;
use Symfony\Component\Routing\Exception\ResourceNotFoundException;
use Symfony\Component\Routing\RequestContext;
/**
* ProjectUrlMatcherrouter_Front.
*
* This class has been auto-generated
* by the Symfony Routing Component.
*/
class ProjectUrlMatcherrouter_Front extends Symfony\Component\Routing\Matcher\UrlMatcher
{
/**
* Constructor.
*/
public function __construct(RequestContext $context)
{
$this->context = $context;
}
public function match($pathinfo)
{
$allow = array();
$pathinfo = rawurldecode($pathinfo);
$context = $this->context;
$request = $this->request;
if (0 === strpos($pathinfo, '/ajax')) {
// ajax.mini-cart
if ($pathinfo === '/ajax/mini-cart') {
return array ( '_controller' => 'Thelia\\Controller\\Front\\DefaultController::noAction', '_view' => 'includes/mini-cart', '_route' => 'ajax.mini-cart',);
}
// ajax.addCartMessage
if ($pathinfo === '/ajax/addCartMessage') {
return array ( '_controller' => 'Thelia\\Controller\\Front\\DefaultController::noAction', '_view' => 'includes/addedToCart', '_route' => 'ajax.addCartMessage',);
}
}
if (0 === strpos($pathinfo, '/register')) {
// customer.create.view
if ($pathinfo === '/register') {
if (!in_array($this->context->getMethod(), array('GET', 'HEAD'))) {
$allow = array_merge($allow, array('GET', 'HEAD'));
goto not_customercreateview;
}
return array ( '_controller' => 'Front\\Controller\\CustomerController::viewRegisterAction', '_route' => 'customer.create.view',);
}
not_customercreateview:
// customer.create.process
if ($pathinfo === '/register') {
if ($this->context->getMethod() != 'POST') {
$allow[] = 'POST';
goto not_customercreateprocess;
}
return array ( '_controller' => 'Front\\Controller\\CustomerController::createAction', '_view' => 'register', '_route' => 'customer.create.process',);
}
not_customercreateprocess:
}
if (0 === strpos($pathinfo, '/login')) {
// customer.login.view
if ($pathinfo === '/login') {
if (!in_array($this->context->getMethod(), array('GET', 'HEAD'))) {
$allow = array_merge($allow, array('GET', 'HEAD'));
goto not_customerloginview;
}
return array ( '_controller' => 'Front\\Controller\\CustomerController::viewLoginAction', '_route' => 'customer.login.view',);
}
not_customerloginview:
// customer.login.process
if ($pathinfo === '/login') {
if ($this->context->getMethod() != 'POST') {
$allow[] = 'POST';
goto not_customerloginprocess;
}
return array ( '_controller' => 'Front\\Controller\\CustomerController::loginAction', '_view' => 'login', '_route' => 'customer.login.process',);
}
not_customerloginprocess:
}
if (0 === strpos($pathinfo, '/password')) {
// customer.password.retrieve.process
if ($pathinfo === '/password') {
if ($this->context->getMethod() != 'POST') {
$allow[] = 'POST';
goto not_customerpasswordretrieveprocess;
}
return array ( '_controller' => 'Front\\Controller\\CustomerController::newPasswordAction', '_view' => 'password', '_route' => 'customer.password.retrieve.process',);
}
not_customerpasswordretrieveprocess:
// customer.password.retrieve.sent
if ($pathinfo === '/password-sent') {
return array ( '_controller' => 'Front\\Controller\\CustomerController::newPasswordSentAction', '_view' => 'password', '_route' => 'customer.password.retrieve.sent',);
}
}
// customer.logout.process
if ($pathinfo === '/logout') {
return array ( '_controller' => 'Front\\Controller\\CustomerController::logoutAction', '_route' => 'customer.logout.process',);
}
// customer.confirm.token
if (0 === strpos($pathinfo, '/customer/confirm') && preg_match('#^/customer/confirm/(?P<token>[^/]++)$#s', $pathinfo, $matches)) {
return $this->mergeDefaults(array_replace($matches, array('_route' => 'customer.confirm.token')), array ( '_controller' => 'Front\\Controller\\CustomerController::confirmCustomerAction',));
}
if (0 === strpos($pathinfo, '/a')) {
if (0 === strpos($pathinfo, '/account')) {
// customer.home
if ($pathinfo === '/account') {
if (!in_array($this->context->getMethod(), array('GET', 'HEAD'))) {
$allow = array_merge($allow, array('GET', 'HEAD'));
goto not_customerhome;
}
return array ( '_controller' => 'Thelia\\Controller\\Front\\DefaultController::noAction', '_view' => 'account', '_route' => 'customer.home',);
}
not_customerhome:
if (0 === strpos($pathinfo, '/account/update')) {
// customer.update.view
if ($pathinfo === '/account/update') {
if (!in_array($this->context->getMethod(), array('GET', 'HEAD'))) {
$allow = array_merge($allow, array('GET', 'HEAD'));
goto not_customerupdateview;
}
return array ( '_controller' => 'Front\\Controller\\CustomerController::viewAction', '_view' => 'account-update', '_route' => 'customer.update.view',);
}
not_customerupdateview:
// customer.update.process
if ($pathinfo === '/account/update') {
if ($this->context->getMethod() != 'POST') {
$allow[] = 'POST';
goto not_customerupdateprocess;
}
return array ( '_controller' => 'Front\\Controller\\CustomerController::updateAction', '_view' => 'account-update', '_route' => 'customer.update.process',);
}
not_customerupdateprocess:
}
if (0 === strpos($pathinfo, '/account/password')) {
// customer.password.change.process
if ($pathinfo === '/account/password') {
if ($this->context->getMethod() != 'POST') {
$allow[] = 'POST';
goto not_customerpasswordchangeprocess;
}
return array ( '_controller' => 'Front\\Controller\\CustomerController::updatePasswordAction', '_view' => 'account-password', '_route' => 'customer.password.change.process',);
}
not_customerpasswordchangeprocess:
// customer.password.change.view
if ($pathinfo === '/account/password') {
if (!in_array($this->context->getMethod(), array('GET', 'HEAD'))) {
$allow = array_merge($allow, array('GET', 'HEAD'));
goto not_customerpasswordchangeview;
}
return array ( '_controller' => 'Thelia\\Controller\\Front\\DefaultController::noAction', '_view' => 'account-password', '_route' => 'customer.password.change.view',);
}
not_customerpasswordchangeview:
}
if (0 === strpos($pathinfo, '/account/order')) {
// customer.order
if (preg_match('#^/account/order/(?P<order_id>\\d+)$#s', $pathinfo, $matches)) {
return $this->mergeDefaults(array_replace($matches, array('_route' => 'customer.order')), array ( '_controller' => 'Front\\Controller\\OrderController::viewAction',));
}
if (0 === strpos($pathinfo, '/account/order/pdf')) {
// customer.order.pdf.delivery
if (0 === strpos($pathinfo, '/account/order/pdf/delivery') && preg_match('#^/account/order/pdf/delivery/(?P<order_id>\\d+)$#s', $pathinfo, $matches)) {
return $this->mergeDefaults(array_replace($matches, array('_route' => 'customer.order.pdf.delivery')), array ( '_controller' => 'Front\\Controller\\OrderController::generateDeliveryPdf',));
}
// customer.order.pdf.invoice
if (0 === strpos($pathinfo, '/account/order/pdf/invoice') && preg_match('#^/account/order/pdf/invoice/(?P<order_id>\\d+)$#s', $pathinfo, $matches)) {
return $this->mergeDefaults(array_replace($matches, array('_route' => 'customer.order.pdf.invoice')), array ( '_controller' => 'Front\\Controller\\OrderController::generateInvoicePdf',));
}
}
}
// customer.order.product.download
if (0 === strpos($pathinfo, '/account/download') && preg_match('#^/account/download/(?P<order_product_id>\\d+)$#s', $pathinfo, $matches)) {
return $this->mergeDefaults(array_replace($matches, array('_route' => 'customer.order.product.download')), array ( '_controller' => 'Front\\Controller\\OrderController::downloadVirtualProduct',));
}
}
if (0 === strpos($pathinfo, '/address')) {
if (0 === strpos($pathinfo, '/address/create')) {
// address.create.view
if ($pathinfo === '/address/create') {
if (!in_array($this->context->getMethod(), array('GET', 'HEAD'))) {
$allow = array_merge($allow, array('GET', 'HEAD'));
goto not_addresscreateview;
}
return array ( '_controller' => 'Thelia\\Controller\\Front\\DefaultController::noAction', '_view' => 'address', '_route' => 'address.create.view',);
}
not_addresscreateview:
// address.create
if ($pathinfo === '/address/create') {
if ($this->context->getMethod() != 'POST') {
$allow[] = 'POST';
goto not_addresscreate;
}
return array ( '_controller' => 'Front\\Controller\\AddressController::createAction', '_view' => 'address', '_route' => 'address.create',);
}
not_addresscreate:
}
if (0 === strpos($pathinfo, '/address/update')) {
// address.edit
if (preg_match('#^/address/update/(?P<address_id>[^/]++)$#s', $pathinfo, $matches)) {
if (!in_array($this->context->getMethod(), array('GET', 'HEAD'))) {
$allow = array_merge($allow, array('GET', 'HEAD'));
goto not_addressedit;
}
return $this->mergeDefaults(array_replace($matches, array('_route' => 'address.edit')), array ( '_controller' => 'Front\\Controller\\AddressController::updateViewAction', '_view' => 'address-update',));
}
not_addressedit:
// address.update
if (preg_match('#^/address/update/(?P<address_id>[^/]++)$#s', $pathinfo, $matches)) {
if ($this->context->getMethod() != 'POST') {
$allow[] = 'POST';
goto not_addressupdate;
}
return $this->mergeDefaults(array_replace($matches, array('_route' => 'address.update')), array ( '_controller' => 'Front\\Controller\\AddressController::processUpdateAction', '_view' => 'address-update',));
}
not_addressupdate:
}
// address.delete
if (0 === strpos($pathinfo, '/address/delete') && preg_match('#^/address/delete/(?P<address_id>[^/]++)$#s', $pathinfo, $matches)) {
return $this->mergeDefaults(array_replace($matches, array('_route' => 'address.delete')), array ( '_controller' => 'Front\\Controller\\AddressController::deleteAction', '_view' => 'account',));
}
// address.generateModal
if (0 === strpos($pathinfo, '/address/modal') && preg_match('#^/address/modal/(?P<address_id>\\d+)$#s', $pathinfo, $matches)) {
if (!in_array($this->context->getMethod(), array('GET', 'HEAD'))) {
$allow = array_merge($allow, array('GET', 'HEAD'));
goto not_addressgenerateModal;
}
return $this->mergeDefaults(array_replace($matches, array('_route' => 'address.generateModal')), array ( '_controller' => 'Front\\Controller\\AddressController::generateModalAction', '_view' => 'modal-address',));
}
not_addressgenerateModal:
// address.make.default
if (0 === strpos($pathinfo, '/address/default') && preg_match('#^/address/default/(?P<addressId>\\d+)$#s', $pathinfo, $matches)) {
if (!in_array($this->context->getMethod(), array('GET', 'HEAD'))) {
$allow = array_merge($allow, array('GET', 'HEAD'));
goto not_addressmakedefault;
}
return $this->mergeDefaults(array_replace($matches, array('_route' => 'address.make.default')), array ( '_controller' => 'Front:Address:makeAddressDefault',));
}
not_addressmakedefault:
}
}
if (0 === strpos($pathinfo, '/cart')) {
// cart.view
if ($pathinfo === '/cart') {
return array ( '_controller' => 'Thelia\\Controller\\Front\\DefaultController::noAction', '_view' => 'cart', '_route' => 'cart.view',);
}
// cart.add.process
if ($pathinfo === '/cart/add') {
return array ( '_controller' => 'Front\\Controller\\CartController::addItem', '_route' => 'cart.add.process',);
}
// cart.delete.process
if (0 === strpos($pathinfo, '/cart/delete') && preg_match('#^/cart/delete/(?P<cart_item>[^/]++)$#s', $pathinfo, $matches)) {
return $this->mergeDefaults(array_replace($matches, array('_route' => 'cart.delete.process')), array ( '_controller' => 'Front\\Controller\\CartController::deleteItem', '_view' => 'cart',));
}
// cart.update.quantity
if ($pathinfo === '/cart/update') {
return array ( '_controller' => 'Front\\Controller\\CartController::changeItem', '_view' => 'cart', '_route' => 'cart.update.quantity',);
}
// cart.update.country
if ($pathinfo === '/cart/country') {
return array ( '_controller' => 'Front\\Controller\\CartController::changeCountry', '_view' => 'cart', '_route' => 'cart.update.country',);
}
}
if (0 === strpos($pathinfo, '/order')) {
if (0 === strpos($pathinfo, '/order/delivery')) {
// order.delivery.process
if ($pathinfo === '/order/delivery') {
if ($this->context->getMethod() != 'POST') {
$allow[] = 'POST';
goto not_orderdeliveryprocess;
}
return array ( '_controller' => 'Front\\Controller\\OrderController::deliver', '_view' => 'order-delivery', '_route' => 'order.delivery.process',);
}
not_orderdeliveryprocess:
// order.delivery
if ($pathinfo === '/order/delivery') {
return array ( '_controller' => 'Front\\Controller\\OrderController::deliverView', '_view' => 'order-delivery', '_route' => 'order.delivery',);
}
// admin.delivery.ajax-module-list
if ($pathinfo === '/order/deliveryModuleList') {
return array ( '_controller' => 'Front\\Controller\\OrderController::getDeliveryModuleListAjaxAction', '_route' => 'admin.delivery.ajax-module-list',);
}
}
if (0 === strpos($pathinfo, '/order/invoice')) {
// order.invoice.process
if ($pathinfo === '/order/invoice') {
if ($this->context->getMethod() != 'POST') {
$allow[] = 'POST';
goto not_orderinvoiceprocess;
}
return array ( '_controller' => 'Front\\Controller\\OrderController::invoice', '_view' => 'order-invoice', '_route' => 'order.invoice.process',);
}
not_orderinvoiceprocess:
// order.invoice
if ($pathinfo === '/order/invoice') {
return array ( '_controller' => 'Thelia\\Controller\\Front\\DefaultController::noAction', '_view' => 'order-invoice', '_route' => 'order.invoice',);
}
}
if (0 === strpos($pathinfo, '/order/c')) {
// order.coupon.process
if ($pathinfo === '/order/coupon') {
if ($this->context->getMethod() != 'POST') {
$allow[] = 'POST';
goto not_ordercouponprocess;
}
return array ( '_controller' => 'Front\\Controller\\CouponController::consumeAction', '_view' => 'order-invoice', '_route' => 'order.coupon.process',);
}
not_ordercouponprocess:
// order.coupon.clear
if ($pathinfo === '/order/clear-coupons') {
return array ( '_controller' => 'Front\\Controller\\CouponController::clearAllCouponsAction', '_view' => 'order-invoice', '_route' => 'order.coupon.clear',);
}
}
if (0 === strpos($pathinfo, '/order/p')) {
// order.payment.process
if ($pathinfo === '/order/pay') {
return array ( '_controller' => 'Front\\Controller\\OrderController::pay', '_route' => 'order.payment.process',);
}
// order.placed
if (0 === strpos($pathinfo, '/order/placed') && preg_match('#^/order/placed/(?P<order_id>[^/]++)$#s', $pathinfo, $matches)) {
return $this->mergeDefaults(array_replace($matches, array('_route' => 'order.placed')), array ( '_controller' => 'Front\\Controller\\OrderController::orderPlaced', '_view' => 'order-placed',));
}
}
// order.failed
if (0 === strpos($pathinfo, '/order/failed') && preg_match('#^/order/failed/(?P<order_id>[^/]++)/(?P<message>[^/]++)$#s', $pathinfo, $matches)) {
return $this->mergeDefaults(array_replace($matches, array('_route' => 'order.failed')), array ( '_controller' => 'Front\\Controller\\OrderController::orderFailed', '_view' => 'order-failed',));
}
}
if (0 === strpos($pathinfo, '/contact')) {
// contact.send
if ($pathinfo === '/contact') {
if ($this->context->getMethod() != 'POST') {
$allow[] = 'POST';
goto not_contactsend;
}
return array ( '_controller' => 'Front\\Controller\\ContactController::sendAction', '_view' => 'contact', '_route' => 'contact.send',);
}
not_contactsend:
// contact.success
if ($pathinfo === '/contact/success') {
return array ( '_controller' => 'Thelia\\Controller\\Front\\DefaultController::noAction', '_view' => 'contact-success', '_route' => 'contact.success',);
}
}
if (0 === strpos($pathinfo, '/newsletter')) {
// newsletter.process
if ($pathinfo === '/newsletter') {
if ($this->context->getMethod() != 'POST') {
$allow[] = 'POST';
goto not_newsletterprocess;
}
return array ( '_controller' => 'Front\\Controller\\NewsletterController::subscribeAction', '_view' => 'newsletter', '_route' => 'newsletter.process',);
}
not_newsletterprocess:
// newsletter.unsubscribe
if ($pathinfo === '/newsletter-unsubscribe') {
if ($this->context->getMethod() != 'POST') {
$allow[] = 'POST';
goto not_newsletterunsubscribe;
}
return array ( '_controller' => 'Front\\Controller\\NewsletterController::unsubscribeAction', '_view' => 'newsletter-unsubscribe', '_route' => 'newsletter.unsubscribe',);
}
not_newsletterunsubscribe:
}
// sitemap.process
if ($pathinfo === '/sitemap') {
return array ( '_controller' => 'Front\\Controller\\SitemapController::generateAction', '_route' => 'sitemap.process',);
}
// feed.process
if (0 === strpos($pathinfo, '/feed') && preg_match('#^/feed(?:/(?P<context>[^/]++)(?:/(?P<lang>[^/]++)(?:/(?P<id>[^/]++))?)?)?$#s', $pathinfo, $matches)) {
return $this->mergeDefaults(array_replace($matches, array('_route' => 'feed.process')), array ( '_controller' => 'Front\\Controller\\FeedController::generateAction', 'context' => 'catalog', 'lang' => '', 'id' => '',));
}
// empty
if ($pathinfo === '/empty') {
return array ( '_controller' => 'Thelia\\Controller\\Front\\DefaultController::emptyRoute', '_route' => 'empty',);
}
// default
if (preg_match('#^/(?P<_view>(?!admin|api)[^/]+)?$#s', $pathinfo, $matches)) {
return $this->mergeDefaults(array_replace($matches, array('_route' => 'default')), array ( '_controller' => 'Thelia\\Controller\\Front\\DefaultController::noAction', '_view' => 'index',));
}
throw 0 < count($allow) ? new MethodNotAllowedException(array_unique($allow)) : new ResourceNotFoundException();
}
}

View File

@@ -0,0 +1 @@
a:1:{i:0;C:46:"Symfony\Component\Config\Resource\FileResource":94:{s:86:"/Volumes/Dev/Sources/Clients/apartmoment/site_web/local/modules/Front/Config/front.xml";}}

13
cache/prod/PropelConfig.php vendored Normal file
View File

@@ -0,0 +1,13 @@
<?php return array (
'dsn' => 'mysql:host=localhost;dbname=clients2_thel810;port=3306',
'user' => 'clients2_thel810',
'password' => '79SF)1RK(p',
'classname' => '\\Propel\\Runtime\\Connection\\ConnectionWrapper',
'options' =>
array (
1002 =>
array (
'value' => 'SET NAMES \'UTF8\'',
),
),
);

1
cache/prod/PropelConfig.php.meta vendored Normal file
View File

@@ -0,0 +1 @@
a:1:{i:0;C:46:"Symfony\Component\Config\Resource\FileResource":83:{s:75:"/Volumes/Dev/Sources/Clients/apartmoment/site_web/local/config/database.yml";}}

2
cache/prod/classes.map vendored Normal file
View File

@@ -0,0 +1,2 @@
<?php return array (
);

View File

@@ -0,0 +1,118 @@
<?php /* Smarty version Smarty-3.1.20, created on 2021-03-23 12:37:18
compiled from "/Volumes/Dev/Sources/Clients/apartmoment/site_web/templates/frontOffice/am/modules/HookContact/main-footer-body.html" */ ?>
<?php /*%%SmartyHeaderCode:20975014116059d2ee88e662-28733999%%*/if(!defined('SMARTY_DIR')) exit('no direct access allowed');
$_valid = $_smarty_tpl->decodeProperties(array (
'file_dependency' =>
array (
'279d01396e3f910791d96b17e1d3ab000683e306' =>
array (
0 => '/Volumes/Dev/Sources/Clients/apartmoment/site_web/templates/frontOffice/am/modules/HookContact/main-footer-body.html',
1 => 1613761751,
2 => 'file',
),
),
'nocache_hash' => '20975014116059d2ee88e662-28733999',
'function' =>
array (
),
'variables' =>
array (
'store_name' => 0,
'MEDIA_URL' => 0,
'TITLE' => 0,
'label_attr' => 0,
'name' => 0,
'required' => 0,
),
'has_nocache_code' => false,
'version' => 'Smarty-3.1.20',
'unifunc' => 'content_6059d2ee8fcd09_99227362',
),false); /*/%%SmartyHeaderCode%%*/?>
<?php if ($_valid && !is_callable('content_6059d2ee8fcd09_99227362')) {function content_6059d2ee8fcd09_99227362($_smarty_tpl) {?><div itemscope itemtype="http://schema.org/Organization">
<meta itemprop="name" content="<?php echo TheliaSmarty\Template\SmartyParser::theliaEscape($_smarty_tpl->tpl_vars['store_name']->value,$_smarty_tpl);?>
">
<ul>
<li id="logo-menu-footer">
<?php $_smarty_tpl->smarty->_tag_stack[] = array('local_media', array('type'=>"logo")); $_block_repeat=true; echo $_smarty_tpl->smarty->registered_plugins['block']['local_media'][0][0]->storeMediaDataAccess(array('type'=>"logo"), null, $_smarty_tpl, $_block_repeat);while ($_block_repeat) { ob_start();?>
<a href="<?php echo $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['navigate'][0][0]->navigateToUrlFunction(array('to'=>"index"),$_smarty_tpl);?>
">
<img src="<?php echo TheliaSmarty\Template\SmartyParser::theliaEscape($_smarty_tpl->tpl_vars['MEDIA_URL']->value,$_smarty_tpl);?>
" alt="<?php echo TheliaSmarty\Template\SmartyParser::theliaEscape($_smarty_tpl->tpl_vars['TITLE']->value,$_smarty_tpl);?>
" class="img-responsive" itemprop="image" data-toggle="magnify">
</a>
<?php $_block_content = ob_get_clean(); $_block_repeat=false; echo $_smarty_tpl->smarty->registered_plugins['block']['local_media'][0][0]->storeMediaDataAccess(array('type'=>"logo"), $_block_content, $_smarty_tpl, $_block_repeat); } array_pop($_smarty_tpl->smarty->_tag_stack);?>
</li>
<li class="contact-address">
<address class="adr" itemprop="address" itemscope itemtype="http://schema.org/PostalAddress">
<span class="street-address" itemprop="streetAddress"><?php echo $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['config'][0][0]->configDataAccess(array('key'=>"store_address1"),$_smarty_tpl);?>
<?php echo $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['config'][0][0]->configDataAccess(array('key'=>"store_address2"),$_smarty_tpl);?>
<?php echo $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['config'][0][0]->configDataAccess(array('key'=>"store_address3"),$_smarty_tpl);?>
</span><br>
<span class="postal-code" itemprop="postalCode"><?php echo $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['config'][0][0]->configDataAccess(array('key'=>"store_zipcode"),$_smarty_tpl);?>
</span>
<span class="locality" itemprop="addressLocality">
<?php echo $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['config'][0][0]->configDataAccess(array('key'=>"store_city"),$_smarty_tpl);?>
<?php ob_start();?><?php echo $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['config'][0][0]->configDataAccess(array('key'=>"store_country"),$_smarty_tpl);?>
<?php $_tmp14=ob_get_clean();?><?php if ($_tmp14) {?>
<?php ob_start();?><?php echo $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['config'][0][0]->configDataAccess(array('key'=>"store_country"),$_smarty_tpl);?>
<?php $_tmp15=ob_get_clean();?><?php $_smarty_tpl->smarty->_tag_stack[] = array('loop', array('type'=>"country",'name'=>"address.country.title",'id'=>$_tmp15)); $_block_repeat=true; echo $_smarty_tpl->smarty->registered_plugins['block']['loop'][0][0]->theliaLoop(array('type'=>"country",'name'=>"address.country.title",'id'=>$_tmp15), null, $_smarty_tpl, $_block_repeat);while ($_block_repeat) { ob_start();?>
, <span class="country-name"><?php echo TheliaSmarty\Template\SmartyParser::theliaEscape($_smarty_tpl->tpl_vars['TITLE']->value,$_smarty_tpl);?>
</span><?php $_block_content = ob_get_clean(); $_block_repeat=false; echo $_smarty_tpl->smarty->registered_plugins['block']['loop'][0][0]->theliaLoop(array('type'=>"country",'name'=>"address.country.title",'id'=>$_tmp15), $_block_content, $_smarty_tpl, $_block_repeat); } array_pop($_smarty_tpl->smarty->_tag_stack);?>
<?php }?>
</span>
</address>
</li>
<?php ob_start();?><?php echo $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['config'][0][0]->configDataAccess(array('key'=>"store_phone"),$_smarty_tpl);?>
<?php $_tmp16=ob_get_clean();?><?php if ($_tmp16) {?>
<li class="contact-phone">
<a href="tel:<?php echo $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['config'][0][0]->configDataAccess(array('key'=>"store_phone"),$_smarty_tpl);?>
" class="tel" itemprop="telephone"><?php echo $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['config'][0][0]->configDataAccess(array('key'=>"store_phone"),$_smarty_tpl);?>
</a>
</li>
<?php }?>
<li class="contact-contact">
<a href="<?php echo $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['url'][0][0]->generateUrlFunction(array('path'=>'/contact'),$_smarty_tpl);?>
"><?php echo $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['intl'][0][0]->translate(array('l'=>"Find us, Contact us",'d'=>"hookcontact.fo.default"),$_smarty_tpl);?>
</a>
</li>
</ul>
<br>
<section class="block block-newsletter">
<div class="block-heading">
<h3 class="block-title">Newsletter</h3>
</div>
<div class="block-content">
<p id="newsletter-describe"><?php echo $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['intl'][0][0]->translate(array('l'=>"Abonnez-vous pour recevoir notre newletter"),$_smarty_tpl);?>
</p>
<?php $_smarty_tpl->smarty->_tag_stack[] = array('form', array('name'=>"thelia.front.newsletter")); $_block_repeat=true; echo $_smarty_tpl->smarty->registered_plugins['block']['form'][0][0]->generateForm(array('name'=>"thelia.front.newsletter"), null, $_smarty_tpl, $_block_repeat);while ($_block_repeat) { ob_start();?>
<form id="form-newsletter-mini" class="form-inline" action="<?php echo $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['url'][0][0]->generateUrlFunction(array('path'=>"/newsletter"),$_smarty_tpl);?>
" method="post">
<?php echo $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['form_hidden_fields'][0][0]->renderHiddenFormField(array(),$_smarty_tpl);?>
<?php $_smarty_tpl->smarty->_tag_stack[] = array('form_field', array('field'=>"email")); $_block_repeat=true; echo $_smarty_tpl->smarty->registered_plugins['block']['form_field'][0][0]->renderFormField(array('field'=>"email"), null, $_smarty_tpl, $_block_repeat);while ($_block_repeat) { ob_start();?>
<div class="form-group">
<label for="<?php echo TheliaSmarty\Template\SmartyParser::theliaEscape($_smarty_tpl->tpl_vars['label_attr']->value['for'],$_smarty_tpl);?>
-mini" class="sr-only"><?php echo $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['intl'][0][0]->translate(array('l'=>"Adresse e-mail"),$_smarty_tpl);?>
</label>
<input type="email" name="<?php echo TheliaSmarty\Template\SmartyParser::theliaEscape($_smarty_tpl->tpl_vars['name']->value,$_smarty_tpl);?>
" id="<?php echo TheliaSmarty\Template\SmartyParser::theliaEscape($_smarty_tpl->tpl_vars['label_attr']->value['for'],$_smarty_tpl);?>
-mini" class="form-control" maxlength="255" placeholder="<?php echo $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['intl'][0][0]->translate(array('l'=>"Votre adresse e-mail"),$_smarty_tpl);?>
" aria-describedby="newsletter-describe" <?php if ($_smarty_tpl->tpl_vars['required']->value) {?> aria-required="true" required<?php }?> autocomplete="off">
</div>
<?php $_block_content = ob_get_clean(); $_block_repeat=false; echo $_smarty_tpl->smarty->registered_plugins['block']['form_field'][0][0]->renderFormField(array('field'=>"email"), $_block_content, $_smarty_tpl, $_block_repeat); } array_pop($_smarty_tpl->smarty->_tag_stack);?>
<button type="submit" class="btn btn-subscribe btn-primary"><?php echo $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['intl'][0][0]->translate(array('l'=>"S'inscrire",'d'=>"hooknewsletter.fo.default"),$_smarty_tpl);?>
</button>
</form>
<?php $_block_content = ob_get_clean(); $_block_repeat=false; echo $_smarty_tpl->smarty->registered_plugins['block']['form'][0][0]->generateForm(array('name'=>"thelia.front.newsletter"), $_block_content, $_smarty_tpl, $_block_repeat); } array_pop($_smarty_tpl->smarty->_tag_stack);?>
</div>
</section>
</div>
<?php }} ?>

View File

@@ -0,0 +1,25 @@
<?php /* Smarty version Smarty-3.1.20, created on 2021-03-23 12:37:10
compiled from "/Volumes/Dev/Sources/Clients/apartmoment/site_web/local/modules/HookCart/templates/frontOffice/default/main-navbar-secondary.html" */ ?>
<?php /*%%SmartyHeaderCode:11021621496059d2e61b7821-99310529%%*/if(!defined('SMARTY_DIR')) exit('no direct access allowed');
$_valid = $_smarty_tpl->decodeProperties(array (
'file_dependency' =>
array (
'28f1b504f59f0e5086c473a5c27e2da41a51eb57' =>
array (
0 => '/Volumes/Dev/Sources/Clients/apartmoment/site_web/local/modules/HookCart/templates/frontOffice/default/main-navbar-secondary.html',
1 => 1613761617,
2 => 'file',
),
),
'nocache_hash' => '11021621496059d2e61b7821-99310529',
'function' =>
array (
),
'has_nocache_code' => false,
'version' => 'Smarty-3.1.20',
'unifunc' => 'content_6059d2e61bde59_88366333',
),false); /*/%%SmartyHeaderCode%%*/?>
<?php if ($_valid && !is_callable('content_6059d2e61bde59_88366333')) {function content_6059d2e61bde59_88366333($_smarty_tpl) {?><ul class="nav navbar-nav navbar-cart navbar-right">
<?php echo $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['hook'][0][0]->processHookFunction(array('name'=>"mini-cart"),$_smarty_tpl);?>
</ul><?php }} ?>

View File

@@ -0,0 +1,289 @@
<?php /* Smarty version Smarty-3.1.20, created on 2021-03-23 12:37:13
compiled from "/Volumes/Dev/Sources/Clients/apartmoment/site_web/templates/frontOffice/am/includes/single-product.html" */ ?>
<?php /*%%SmartyHeaderCode:6962105306059d2e9e7a289-97887630%%*/if(!defined('SMARTY_DIR')) exit('no direct access allowed');
$_valid = $_smarty_tpl->decodeProperties(array (
'file_dependency' =>
array (
'4353f24310e666e962b9244c5312f771bb036b3e' =>
array (
0 => '/Volumes/Dev/Sources/Clients/apartmoment/site_web/templates/frontOffice/am/includes/single-product.html',
1 => 1613762500,
2 => 'file',
),
),
'nocache_hash' => '6962105306059d2e9e7a289-97887630',
'function' =>
array (
),
'variables' =>
array (
'colClass' => 0,
'PSE_COUNT' => 0,
'TITLE' => 0,
'product_id' => 0,
'ID' => 0,
'URL' => 0,
'hasQuickView' => 0,
'width' => 0,
'height' => 0,
'IMAGE_URL' => 0,
'productTitle' => 0,
'hasDescription' => 0,
'DESCRIPTION' => 0,
'VIRTUAL' => 0,
'QUANTITY' => 0,
'current_stock_href' => 0,
'current_stock_content' => 0,
'ROOM_ID' => 0,
'PRICE' => 0,
'CHECK_IN' => 0,
'CHECK_OUT' => 0,
'NUM_ADULTS' => 0,
'NUM_CHILDREN' => 0,
'MIN_PRICE' => 0,
'IS_PROMO' => 0,
'combination_count' => 0,
'BEST_TAXED_PRICE' => 0,
'SHOW_ORIGINAL_PRICE' => 0,
'TAXED_PRICE' => 0,
'hasBtn' => 0,
'hasSubmit' => 0,
'name' => 0,
'form_error' => 0,
'form_error_message' => 0,
'PRODUCT_SALE_ELEMENT' => 0,
'attr' => 0,
'label_attr' => 0,
'error' => 0,
'value' => 0,
'label' => 0,
'message' => 0,
),
'has_nocache_code' => false,
'version' => 'Smarty-3.1.20',
'unifunc' => 'content_6059d2ea0dff60_55247550',
),false); /*/%%SmartyHeaderCode%%*/?>
<?php if ($_valid && !is_callable('content_6059d2ea0dff60_55247550')) {function content_6059d2ea0dff60_55247550($_smarty_tpl) {?><li class="item <?php echo TheliaSmarty\Template\SmartyParser::theliaEscape((($tmp = @$_smarty_tpl->tpl_vars['colClass']->value)===null||$tmp==='' ? "col-md-4" : $tmp),$_smarty_tpl);?>
">
<?php if ($_smarty_tpl->tpl_vars['PSE_COUNT']->value>1) {?>
<?php $_smarty_tpl->tpl_vars["hasSubmit"] = new Smarty_variable(false, null, 0);?>
<?php } else { ?>
<?php $_smarty_tpl->tpl_vars["hasSubmit"] = new Smarty_variable(true, null, 0);?>
<?php }?>
<?php $_smarty_tpl->tpl_vars["productTitle"] = new Smarty_variable(((string)$_smarty_tpl->tpl_vars['TITLE']->value), null, 0);?>
<?php if (!$_smarty_tpl->tpl_vars['product_id']->value) {?>
<?php $_smarty_tpl->tpl_vars["product_id"] = new Smarty_variable($_smarty_tpl->tpl_vars['ID']->value, null, 0);?>
<?php }?>
<article class="row" itemscope itemtype="http://schema.org/Product">
<?php echo $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['hook'][0][0]->processHookFunction(array('name'=>"singleproduct.top",'product'=>((string)$_smarty_tpl->tpl_vars['product_id']->value)),$_smarty_tpl);?>
<a href="<?php echo $_smarty_tpl->tpl_vars['URL']->value;?>
" itemprop="url" tabindex="-1" class="product-image<?php if ($_smarty_tpl->tpl_vars['hasQuickView']->value==true) {?> product-quickview<?php }?> overlay col-sm-3">
<?php $_smarty_tpl->smarty->_tag_stack[] = array('loop', array('name'=>"product_thumbnail",'type'=>"image",'product'=>$_smarty_tpl->tpl_vars['product_id']->value,'width'=>((string)$_smarty_tpl->tpl_vars['width']->value),'height'=>((string)$_smarty_tpl->tpl_vars['height']->value),'resize_mode'=>"crop",'limit'=>"1")); $_block_repeat=true; echo $_smarty_tpl->smarty->registered_plugins['block']['loop'][0][0]->theliaLoop(array('name'=>"product_thumbnail",'type'=>"image",'product'=>$_smarty_tpl->tpl_vars['product_id']->value,'width'=>((string)$_smarty_tpl->tpl_vars['width']->value),'height'=>((string)$_smarty_tpl->tpl_vars['height']->value),'resize_mode'=>"crop",'limit'=>"1"), null, $_smarty_tpl, $_block_repeat);while ($_block_repeat) { ob_start();?>
<img itemprop="image" src="<?php echo $_smarty_tpl->tpl_vars['IMAGE_URL']->value;?>
" class="img-responsive" alt="<?php echo TheliaSmarty\Template\SmartyParser::theliaEscape($_smarty_tpl->tpl_vars['productTitle']->value,$_smarty_tpl);?>
">
<?php $_block_content = ob_get_clean(); $_block_repeat=false; echo $_smarty_tpl->smarty->registered_plugins['block']['loop'][0][0]->theliaLoop(array('name'=>"product_thumbnail",'type'=>"image",'product'=>$_smarty_tpl->tpl_vars['product_id']->value,'width'=>((string)$_smarty_tpl->tpl_vars['width']->value),'height'=>((string)$_smarty_tpl->tpl_vars['height']->value),'resize_mode'=>"crop",'limit'=>"1"), $_block_content, $_smarty_tpl, $_block_repeat); } array_pop($_smarty_tpl->smarty->_tag_stack);?>
<?php $_smarty_tpl->smarty->_tag_stack[] = array('elseloop', array('rel'=>"product_thumbnail")); $_block_repeat=true; echo $_smarty_tpl->smarty->registered_plugins['block']['elseloop'][0][0]->theliaElseloop(array('rel'=>"product_thumbnail"), null, $_smarty_tpl, $_block_repeat);while ($_block_repeat) { ob_start();?>
<img itemprop="image" src="<?php echo $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['image'][0][0]->functionImage(array('file'=>'assets/dist/img/218x146.png'),$_smarty_tpl);?>
" class="img-responsive" alt="<?php echo TheliaSmarty\Template\SmartyParser::theliaEscape($_smarty_tpl->tpl_vars['productTitle']->value,$_smarty_tpl);?>
">
<?php $_block_content = ob_get_clean(); $_block_repeat=false; echo $_smarty_tpl->smarty->registered_plugins['block']['elseloop'][0][0]->theliaElseloop(array('rel'=>"product_thumbnail"), $_block_content, $_smarty_tpl, $_block_repeat); } array_pop($_smarty_tpl->smarty->_tag_stack);?>
</a>
<div class="product-info col-sm-6">
<h2 class="name"><a href="<?php echo $_smarty_tpl->tpl_vars['URL']->value;?>
"><span itemprop="name"><?php echo TheliaSmarty\Template\SmartyParser::theliaEscape($_smarty_tpl->tpl_vars['productTitle']->value,$_smarty_tpl);?>
</span></a></h2>
<?php if ($_smarty_tpl->tpl_vars['hasDescription']->value) {?>
<div class="description" itemprop="description">
<p><?php echo $_smarty_tpl->tpl_vars['DESCRIPTION']->value;?>
</p>
</div>
<?php }?>
</div>
<?php $_smarty_tpl->tpl_vars["current_stock_content"] = new Smarty_variable("in_stock", null, 0);?>
<?php $_smarty_tpl->tpl_vars["current_stock_href"] = new Smarty_variable("http://schema.org/InStock", null, 0);?>
<?php ob_start();?><?php echo $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['config'][0][0]->configDataAccess(array('key'=>"check-available-stock"),$_smarty_tpl);?>
<?php $_tmp8=ob_get_clean();?><?php if ($_tmp8!=0) {?>
<?php if ($_smarty_tpl->tpl_vars['VIRTUAL']->value==0&&$_smarty_tpl->tpl_vars['QUANTITY']->value<=0) {?>
<?php $_smarty_tpl->tpl_vars["current_stock_content"] = new Smarty_variable("out_stock", null, 0);?>
<?php $_smarty_tpl->tpl_vars["current_stock_href"] = new Smarty_variable("http://schema.org/OutOfStock", null, 0);?>
<?php }?>
<?php }?>
<div class="product-price col-sm-3">
<div class="price-container row" itemprop="offers" itemscope itemtype="http://schema.org/Offer">
<meta itemprop="category" content="<?php echo $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['category'][0][0]->categoryDataAccess(array('attr'=>"title"),$_smarty_tpl);?>
">
<meta itemprop="itemCondition" itemscope itemtype="http://schema.org/NewCondition">
<meta itemprop="priceCurrency" content="<?php echo $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['currency'][0][0]->currencyDataAccess(array('attr'=>"symbol"),$_smarty_tpl);?>
">
<link itemprop="availability" href="<?php echo TheliaSmarty\Template\SmartyParser::theliaEscape($_smarty_tpl->tpl_vars['current_stock_href']->value,$_smarty_tpl);?>
" content="<?php echo TheliaSmarty\Template\SmartyParser::theliaEscape($_smarty_tpl->tpl_vars['current_stock_content']->value,$_smarty_tpl);?>
" />
<?php if (!empty($_smarty_tpl->tpl_vars['ROOM_ID']->value)) {?>
<?php $_smarty_tpl->tpl_vars['price'] = new Smarty_variable('', null, 0);?>
<?php $_smarty_tpl->smarty->_tag_stack[] = array('loop', array('type'=>"beds24.availability",'name'=>"disponibilites",'product_id'=>$_smarty_tpl->tpl_vars['ID']->value,'use_saved_search_criteria'=>true)); $_block_repeat=true; echo $_smarty_tpl->smarty->registered_plugins['block']['loop'][0][0]->theliaLoop(array('type'=>"beds24.availability",'name'=>"disponibilites",'product_id'=>$_smarty_tpl->tpl_vars['ID']->value,'use_saved_search_criteria'=>true), null, $_smarty_tpl, $_block_repeat);while ($_block_repeat) { ob_start();?>
<span class="regular-price col-xs-12">
<span itemprop="price" class="price">
<?php echo $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['format_money'][0][0]->formatMoney(array('number'=>$_smarty_tpl->tpl_vars['PRICE']->value),$_smarty_tpl);?>
<br>
<?php ob_start();?><?php echo $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['format_date'][0][0]->formatDate(array('date'=>$_smarty_tpl->tpl_vars['CHECK_IN']->value,'output'=>"date"),$_smarty_tpl);?>
<?php $_tmp9=ob_get_clean();?><?php ob_start();?><?php echo $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['format_date'][0][0]->formatDate(array('date'=>$_smarty_tpl->tpl_vars['CHECK_OUT']->value,'output'=>"date"),$_smarty_tpl);?>
<?php $_tmp10=ob_get_clean();?><?php echo $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['intl'][0][0]->translate(array('l'=>"du %debut au %fin pour %adults adulte%s",'debut'=>$_tmp9,'fin'=>$_tmp10,'adults'=>$_smarty_tpl->tpl_vars['NUM_ADULTS']->value,'s'=>$_smarty_tpl->tpl_vars['NUM_ADULTS']->value>1 ? 's' : ''),$_smarty_tpl);?>
<?php if ($_smarty_tpl->tpl_vars['NUM_CHILDREN']->value>0) {?>
<?php echo $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['intl'][0][0]->translate(array('l'=>" et %enfant enfant%s",'enfant'=>$_smarty_tpl->tpl_vars['NUM_CHILDREN']->value,'s'=>$_smarty_tpl->tpl_vars['NUM_CHILDREN']->value>1 ? 's' : ''),$_smarty_tpl);?>
<?php }?>
</span>
</span>
<?php $_block_content = ob_get_clean(); $_block_repeat=false; echo $_smarty_tpl->smarty->registered_plugins['block']['loop'][0][0]->theliaLoop(array('type'=>"beds24.availability",'name'=>"disponibilites",'product_id'=>$_smarty_tpl->tpl_vars['ID']->value,'use_saved_search_criteria'=>true), $_block_content, $_smarty_tpl, $_block_repeat); } array_pop($_smarty_tpl->smarty->_tag_stack);?>
<?php $_smarty_tpl->smarty->_tag_stack[] = array('elseloop', array('rel'=>'disponibilites')); $_block_repeat=true; echo $_smarty_tpl->smarty->registered_plugins['block']['elseloop'][0][0]->theliaElseloop(array('rel'=>'disponibilites'), null, $_smarty_tpl, $_block_repeat);while ($_block_repeat) { ob_start();?>
<?php $_smarty_tpl->smarty->_tag_stack[] = array('loop', array('type'=>"beds24.description",'name'=>"description",'product_id'=>$_smarty_tpl->tpl_vars['ID']->value)); $_block_repeat=true; echo $_smarty_tpl->smarty->registered_plugins['block']['loop'][0][0]->theliaLoop(array('type'=>"beds24.description",'name'=>"description",'product_id'=>$_smarty_tpl->tpl_vars['ID']->value), null, $_smarty_tpl, $_block_repeat);while ($_block_repeat) { ob_start();?>
<?php if (!empty($_smarty_tpl->tpl_vars['MIN_PRICE']->value)) {?>
<span class="regular-price col-xs-12"><span itemprop="price" class="price"><?php echo $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['format_money'][0][0]->formatMoney(array('number'=>$_smarty_tpl->tpl_vars['MIN_PRICE']->value),$_smarty_tpl);?>
</span></span>
<?php }?>
<?php $_block_content = ob_get_clean(); $_block_repeat=false; echo $_smarty_tpl->smarty->registered_plugins['block']['loop'][0][0]->theliaLoop(array('type'=>"beds24.description",'name'=>"description",'product_id'=>$_smarty_tpl->tpl_vars['ID']->value), $_block_content, $_smarty_tpl, $_block_repeat); } array_pop($_smarty_tpl->smarty->_tag_stack);?>
<?php $_block_content = ob_get_clean(); $_block_repeat=false; echo $_smarty_tpl->smarty->registered_plugins['block']['elseloop'][0][0]->theliaElseloop(array('rel'=>'disponibilites'), $_block_content, $_smarty_tpl, $_block_repeat); } array_pop($_smarty_tpl->smarty->_tag_stack);?>
<?php } else { ?>
<?php if ($_smarty_tpl->tpl_vars['IS_PROMO']->value) {?>
<?php ob_start();?><?php echo $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['count'][0][0]->theliaCount(array('type'=>"product_sale_elements",'promo'=>"1",'product'=>$_smarty_tpl->tpl_vars['ID']->value),$_smarty_tpl);?>
<?php $_tmp11=ob_get_clean();?><?php $_smarty_tpl->tpl_vars["combination_count"] = new Smarty_variable($_tmp11, null, 0);?>
<span class="special-price col-xs-6"><span itemprop="price" class="price-label"><?php echo $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['intl'][0][0]->translate(array('l'=>"Special Price:"),$_smarty_tpl);?>
</span><span class="price">
<?php if ($_smarty_tpl->tpl_vars['combination_count']->value>1) {?>
<?php ob_start();?><?php echo $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['format_money'][0][0]->formatMoney(array('number'=>$_smarty_tpl->tpl_vars['BEST_TAXED_PRICE']->value),$_smarty_tpl);?>
<?php $_tmp12=ob_get_clean();?><?php echo $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['intl'][0][0]->translate(array('l'=>"From %price",'price'=>$_tmp12),$_smarty_tpl);?>
<?php } else { ?>
<?php echo $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['format_money'][0][0]->formatMoney(array('number'=>$_smarty_tpl->tpl_vars['BEST_TAXED_PRICE']->value),$_smarty_tpl);?>
<?php }?>
</span></span>
<?php if ($_smarty_tpl->tpl_vars['SHOW_ORIGINAL_PRICE']->value) {?>
<span class="old-price col-xs-6"><span class="price-label"><?php echo $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['intl'][0][0]->translate(array('l'=>"Regular Price:"),$_smarty_tpl);?>
</span><span class="price"><?php echo $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['format_money'][0][0]->formatMoney(array('number'=>$_smarty_tpl->tpl_vars['TAXED_PRICE']->value),$_smarty_tpl);?>
</span></span>
<?php }?>
<?php } else { ?>
<span class="regular-price col-xs-12"><span itemprop="price" class="price"><?php echo $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['format_money'][0][0]->formatMoney(array('number'=>$_smarty_tpl->tpl_vars['BEST_TAXED_PRICE']->value),$_smarty_tpl);?>
</span></span>
<?php }?>
<?php }?>
</div>
<?php if ($_smarty_tpl->tpl_vars['hasBtn']->value==true) {?>
<?php if (false&&$_smarty_tpl->tpl_vars['hasSubmit']->value==true&&$_smarty_tpl->tpl_vars['current_stock_content']->value=="in_stock") {?>
<?php $_smarty_tpl->smarty->_tag_stack[] = array('form', array('name'=>"thelia.cart.add")); $_block_repeat=true; echo $_smarty_tpl->smarty->registered_plugins['block']['form'][0][0]->generateForm(array('name'=>"thelia.cart.add"), null, $_smarty_tpl, $_block_repeat);while ($_block_repeat) { ob_start();?>
<form id="form-product-details<?php echo TheliaSmarty\Template\SmartyParser::theliaEscape($_smarty_tpl->tpl_vars['product_id']->value,$_smarty_tpl);?>
" action="<?php echo $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['url'][0][0]->generateUrlFunction(array('path'=>"/cart/add"),$_smarty_tpl);?>
" method="post" class="form-product">
<?php echo $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['form_hidden_fields'][0][0]->renderHiddenFormField(array(),$_smarty_tpl);?>
<input type="hidden" name="view" value="product">
<input type="hidden" name="product_id" value="<?php echo TheliaSmarty\Template\SmartyParser::theliaEscape($_smarty_tpl->tpl_vars['product_id']->value,$_smarty_tpl);?>
">
<?php $_smarty_tpl->smarty->_tag_stack[] = array('form_field', array('field'=>"append")); $_block_repeat=true; echo $_smarty_tpl->smarty->registered_plugins['block']['form_field'][0][0]->renderFormField(array('field'=>"append"), null, $_smarty_tpl, $_block_repeat);while ($_block_repeat) { ob_start();?>
<input type="hidden" name="<?php echo TheliaSmarty\Template\SmartyParser::theliaEscape($_smarty_tpl->tpl_vars['name']->value,$_smarty_tpl);?>
" value="1">
<?php $_block_content = ob_get_clean(); $_block_repeat=false; echo $_smarty_tpl->smarty->registered_plugins['block']['form_field'][0][0]->renderFormField(array('field'=>"append"), $_block_content, $_smarty_tpl, $_block_repeat); } array_pop($_smarty_tpl->smarty->_tag_stack);?>
<?php if ($_smarty_tpl->tpl_vars['form_error']->value) {?><div class="alert alert-error"><?php echo TheliaSmarty\Template\SmartyParser::theliaEscape($_smarty_tpl->tpl_vars['form_error_message']->value,$_smarty_tpl);?>
</div><?php }?>
<?php $_smarty_tpl->smarty->_tag_stack[] = array('form_field', array('field'=>'product_sale_elements_id')); $_block_repeat=true; echo $_smarty_tpl->smarty->registered_plugins['block']['form_field'][0][0]->renderFormField(array('field'=>'product_sale_elements_id'), null, $_smarty_tpl, $_block_repeat);while ($_block_repeat) { ob_start();?>
<input type="hidden" class="pse-id" name="<?php echo TheliaSmarty\Template\SmartyParser::theliaEscape($_smarty_tpl->tpl_vars['name']->value,$_smarty_tpl);?>
" value="<?php echo TheliaSmarty\Template\SmartyParser::theliaEscape($_smarty_tpl->tpl_vars['PRODUCT_SALE_ELEMENT']->value,$_smarty_tpl);?>
" <?php echo TheliaSmarty\Template\SmartyParser::theliaEscape($_smarty_tpl->tpl_vars['attr']->value,$_smarty_tpl);?>
>
<?php $_block_content = ob_get_clean(); $_block_repeat=false; echo $_smarty_tpl->smarty->registered_plugins['block']['form_field'][0][0]->renderFormField(array('field'=>'product_sale_elements_id'), $_block_content, $_smarty_tpl, $_block_repeat); } array_pop($_smarty_tpl->smarty->_tag_stack);?>
<?php $_smarty_tpl->smarty->_tag_stack[] = array('form_field', array('field'=>"product")); $_block_repeat=true; echo $_smarty_tpl->smarty->registered_plugins['block']['form_field'][0][0]->renderFormField(array('field'=>"product"), null, $_smarty_tpl, $_block_repeat);while ($_block_repeat) { ob_start();?>
<input id="<?php echo TheliaSmarty\Template\SmartyParser::theliaEscape($_smarty_tpl->tpl_vars['label_attr']->value['for'],$_smarty_tpl);?>
" type="hidden" name="<?php echo TheliaSmarty\Template\SmartyParser::theliaEscape($_smarty_tpl->tpl_vars['name']->value,$_smarty_tpl);?>
" value="<?php echo TheliaSmarty\Template\SmartyParser::theliaEscape($_smarty_tpl->tpl_vars['product_id']->value,$_smarty_tpl);?>
" <?php echo TheliaSmarty\Template\SmartyParser::theliaEscape($_smarty_tpl->tpl_vars['attr']->value,$_smarty_tpl);?>
>
<?php $_block_content = ob_get_clean(); $_block_repeat=false; echo $_smarty_tpl->smarty->registered_plugins['block']['form_field'][0][0]->renderFormField(array('field'=>"product"), $_block_content, $_smarty_tpl, $_block_repeat); } array_pop($_smarty_tpl->smarty->_tag_stack);?>
<fieldset class="product-cart form-inline">
<?php $_smarty_tpl->smarty->_tag_stack[] = array('form_field', array('field'=>'quantity')); $_block_repeat=true; echo $_smarty_tpl->smarty->registered_plugins['block']['form_field'][0][0]->renderFormField(array('field'=>'quantity'), null, $_smarty_tpl, $_block_repeat);while ($_block_repeat) { ob_start();?>
<div class="form-group group-qty hide <?php if ($_smarty_tpl->tpl_vars['error']->value) {?>has-error<?php } elseif ($_smarty_tpl->tpl_vars['value']->value!=''&&!$_smarty_tpl->tpl_vars['error']->value) {?>has-success<?php }?>">
<label for="<?php echo TheliaSmarty\Template\SmartyParser::theliaEscape($_smarty_tpl->tpl_vars['label_attr']->value['for'],$_smarty_tpl);?>
"><?php echo TheliaSmarty\Template\SmartyParser::theliaEscape($_smarty_tpl->tpl_vars['label']->value,$_smarty_tpl);?>
</label>
<input type="number" name="<?php echo TheliaSmarty\Template\SmartyParser::theliaEscape($_smarty_tpl->tpl_vars['name']->value,$_smarty_tpl);?>
" id="<?php echo TheliaSmarty\Template\SmartyParser::theliaEscape($_smarty_tpl->tpl_vars['label_attr']->value['for'],$_smarty_tpl);?>
" class="form-control" value="<?php echo TheliaSmarty\Template\SmartyParser::theliaEscape((($tmp = @$_smarty_tpl->tpl_vars['value']->value)===null||$tmp==='' ? 1 : $tmp),$_smarty_tpl);?>
" min="0" required>
<?php if ($_smarty_tpl->tpl_vars['error']->value) {?>
<span class="help-block"><i class="fa fa-remove"></i> <?php echo TheliaSmarty\Template\SmartyParser::theliaEscape($_smarty_tpl->tpl_vars['message']->value,$_smarty_tpl);?>
</span>
<?php } elseif ($_smarty_tpl->tpl_vars['value']->value!=''&&!$_smarty_tpl->tpl_vars['error']->value) {?>
<span class="help-block"><i class="fa fa"></i></span>
<?php }?>
</div>
<?php $_block_content = ob_get_clean(); $_block_repeat=false; echo $_smarty_tpl->smarty->registered_plugins['block']['form_field'][0][0]->renderFormField(array('field'=>'quantity'), $_block_content, $_smarty_tpl, $_block_repeat); } array_pop($_smarty_tpl->smarty->_tag_stack);?>
<div>
<div class="product-btn">
<button type="submit" class="btn btn-primary btn-block"><i class="fa fa-shopping-cart"></i> <?php echo $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['intl'][0][0]->translate(array('l'=>"Add to cart"),$_smarty_tpl);?>
</button>
</div>
</div>
</fieldset>
</form>
<?php $_block_content = ob_get_clean(); $_block_repeat=false; echo $_smarty_tpl->smarty->registered_plugins['block']['form'][0][0]->generateForm(array('name'=>"thelia.cart.add"), $_block_content, $_smarty_tpl, $_block_repeat); } array_pop($_smarty_tpl->smarty->_tag_stack);?>
<?php } else { ?>
<div>
<div class="product-btn">
<a href="<?php echo $_smarty_tpl->tpl_vars['URL']->value;?>
" class="btn btn-primary btn-block"><i class="fa fa-calendar"></i> <?php echo $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['intl'][0][0]->translate(array('l'=>"Voir le détail et réserver"),$_smarty_tpl);?>
</a>
</div>
</div>
<?php }?>
<?php }?>
</div>
<?php ob_start();?><?php echo TheliaSmarty\Template\SmartyParser::theliaEscape($_smarty_tpl->tpl_vars['product_id']->value,$_smarty_tpl);?>
<?php $_tmp13=ob_get_clean();?><?php echo $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['hook'][0][0]->processHookFunction(array('name'=>"singleproduct.bottom",'product'=>$_tmp13),$_smarty_tpl);?>
</article><!-- /product -->
</li>
<?php }} ?>

View File

@@ -0,0 +1,19 @@
<?php $_config_vars = array (
'sections' =>
array (
),
'vars' =>
array (
'category_display_detail' => true,
'category_display_subcategories' => false,
'folder_display_detail' => true,
'folder_display_subfolders' => false,
'max_displayed_orders' => 20,
'max_displayed_customers' => 20,
'order_not_paid' => 'warning',
'order_paid' => 'success',
'order_processing' => 'primary',
'order_sent' => 'info',
'order_canceled' => 'danger',
),
); ?>

View File

@@ -0,0 +1,544 @@
<?php /* Smarty version Smarty-3.1.20, created on 2021-03-23 12:37:09
compiled from "/Volumes/Dev/Sources/Clients/apartmoment/site_web/templates/frontOffice/am/index.html" */ ?>
<?php /*%%SmartyHeaderCode:3806603956059d2e56ff294-20925637%%*/if(!defined('SMARTY_DIR')) exit('no direct access allowed');
$_valid = $_smarty_tpl->decodeProperties(array (
'file_dependency' =>
array (
'4e8c0a15e3933970db9852988a33f3f2f8be902a' =>
array (
0 => '/Volumes/Dev/Sources/Clients/apartmoment/site_web/templates/frontOffice/am/index.html',
1 => 1613761737,
2 => 'file',
),
'25406e7fabe47de1269cedbc3605e3d4e0e5c925' =>
array (
0 => '/Volumes/Dev/Sources/Clients/apartmoment/site_web/templates/frontOffice/am/layout.tpl',
1 => 1613761737,
2 => 'file',
),
),
'nocache_hash' => '3806603956059d2e56ff294-20925637',
'function' =>
array (
),
'variables' =>
array (
'store_name' => 0,
'store_description' => 0,
'lang_code' => 0,
'page_title' => 0,
'breadcrumbs' => 0,
'breadcrumb' => 0,
'page_description' => 0,
'asset_url' => 0,
'MEDIA_MIME_TYPE' => 0,
'MEDIA_URL' => 0,
'lang_locale' => 0,
'TITLE' => 0,
'id' => 0,
'class' => 0,
'title' => 0,
'content' => 0,
),
'has_nocache_code' => false,
'version' => 'Smarty-3.1.20',
'unifunc' => 'content_6059d2e59ea992_15331422',
),false); /*/%%SmartyHeaderCode%%*/?>
<?php if ($_valid && !is_callable('content_6059d2e59ea992_15331422')) {function content_6059d2e59ea992_15331422($_smarty_tpl) {?><?php if (!is_callable('smarty_modifier_truncate')) include '/Volumes/Dev/Sources/Clients/apartmoment/site_web/core/vendor/smarty/smarty/libs/plugins/modifier.truncate.php';
?><!doctype html>
<!--
______ __ __ ______ __ __ ______
/\__ _\ /\ \_\ \ /\ ___\ /\ \ /\ \ /\ __ \
\/_/\ \/ \ \ __ \ \ \ __\ \ \ \____ \ \ \ \ \ __ \
\ \_\ \ \_\ \_\ \ \_____\ \ \_____\ \ \_\ \ \_\ \_\
\/_/ \/_/\/_/ \/_____/ \/_____/ \/_/ \/_/\/_/
Copyright (c) OpenStudio
email : info@thelia.net
web : http://www.thelia.net
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the
GNU General Public License : http://www.gnu.org/licenses/
-->
<?php echo $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['declare_assets'][0][0]->declareAssets(array('directory'=>'assets/dist'),$_smarty_tpl);?>
<?php echo $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['default_translation_domain'][0][0]->setDefaultTranslationDomain(array('domain'=>'fo.am'),$_smarty_tpl);?>
<?php $_config = new Smarty_Internal_Config('variables.conf', $_smarty_tpl->smarty, $_smarty_tpl);$_config->loadConfigVars(null, 'local'); ?>
<?php ob_start();?><?php echo $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['config'][0][0]->configDataAccess(array('key'=>"store_name"),$_smarty_tpl);?>
<?php $_tmp1=ob_get_clean();?><?php $_smarty_tpl->tpl_vars['page_title'] = new Smarty_variable($_tmp1, null, 0);?>
<?php ob_start();?><?php echo $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['config'][0][0]->configDataAccess(array('key'=>"store_name"),$_smarty_tpl);?>
<?php $_tmp2=ob_get_clean();?><?php $_smarty_tpl->tpl_vars["store_name"] = new Smarty_variable($_tmp2, null, 0);?>
<?php ob_start();?><?php echo $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['config'][0][0]->configDataAccess(array('key'=>"store_description"),$_smarty_tpl);?>
<?php $_tmp3=ob_get_clean();?><?php $_smarty_tpl->tpl_vars["store_description"] = new Smarty_variable($_tmp3, null, 0);?>
<?php ob_start();?><?php echo $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['lang'][0][0]->langDataAccess(array('attr'=>"code"),$_smarty_tpl);?>
<?php $_tmp4=ob_get_clean();?><?php $_smarty_tpl->tpl_vars["lang_code"] = new Smarty_variable($_tmp4, null, 0);?>
<?php ob_start();?><?php echo $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['lang'][0][0]->langDataAccess(array('attr'=>"locale"),$_smarty_tpl);?>
<?php $_tmp5=ob_get_clean();?><?php $_smarty_tpl->tpl_vars["lang_locale"] = new Smarty_variable($_tmp5, null, 0);?>
<?php if (!$_smarty_tpl->tpl_vars['store_name']->value) {?><?php ob_start();?><?php echo $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['intl'][0][0]->translate(array('l'=>'Thelia V2'),$_smarty_tpl);?>
<?php $_tmp6=ob_get_clean();?><?php $_smarty_tpl->tpl_vars["store_name"] = new Smarty_variable($_tmp6, null, 0);?><?php }?>
<?php if (!$_smarty_tpl->tpl_vars['store_description']->value) {?><?php ob_start();?><?php echo TheliaSmarty\Template\SmartyParser::theliaEscape($_smarty_tpl->tpl_vars['store_name']->value,$_smarty_tpl);?>
<?php $_tmp7=ob_get_clean();?><?php $_smarty_tpl->tpl_vars["store_description"] = new Smarty_variable($_tmp7, null, 0);?><?php }?>
<!--[if lt IE 7 ]><html class="no-js oldie ie6" lang="<?php echo TheliaSmarty\Template\SmartyParser::theliaEscape($_smarty_tpl->tpl_vars['lang_code']->value,$_smarty_tpl);?>
"> <![endif]-->
<!--[if IE 7 ]><html class="no-js oldie ie7" lang="<?php echo TheliaSmarty\Template\SmartyParser::theliaEscape($_smarty_tpl->tpl_vars['lang_code']->value,$_smarty_tpl);?>
"> <![endif]-->
<!--[if IE 8 ]><html class="no-js oldie ie8" lang="<?php echo TheliaSmarty\Template\SmartyParser::theliaEscape($_smarty_tpl->tpl_vars['lang_code']->value,$_smarty_tpl);?>
"> <![endif]-->
<!--[if (gte IE 9)|!(IE)]><!--><html lang="<?php echo TheliaSmarty\Template\SmartyParser::theliaEscape($_smarty_tpl->tpl_vars['lang_code']->value,$_smarty_tpl);?>
" class="no-js"> <!--<![endif]-->
<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-167113330-1"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'UA-167113330-1');
</script>
<head>
<?php echo $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['hook'][0][0]->processHookFunction(array('name'=>"main.head-top"),$_smarty_tpl);?>
<script>(function(H) { H.className=H.className.replace(/\bno-js\b/,'js') } )(document.documentElement);</script>
<meta charset="utf-8">
<title><?php if ($_smarty_tpl->tpl_vars['page_title']->value) {?><?php echo TheliaSmarty\Template\SmartyParser::theliaEscape($_smarty_tpl->tpl_vars['page_title']->value,$_smarty_tpl);?>
<?php } elseif ($_smarty_tpl->tpl_vars['breadcrumbs']->value) {?><?php $_smarty_tpl->tpl_vars['breadcrumb'] = new Smarty_Variable; $_smarty_tpl->tpl_vars['breadcrumb']->_loop = false;
$_from = array_reverse($_smarty_tpl->tpl_vars['breadcrumbs']->value); if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array');}
foreach ($_from as $_smarty_tpl->tpl_vars['breadcrumb']->key => $_smarty_tpl->tpl_vars['breadcrumb']->value) {
$_smarty_tpl->tpl_vars['breadcrumb']->_loop = true;
?><?php echo TheliaSmarty\Template\SmartyParser::theliaEscape(htmlspecialchars_decode($_smarty_tpl->tpl_vars['breadcrumb']->value['title'], ENT_QUOTES),$_smarty_tpl);?>
- <?php } ?><?php echo TheliaSmarty\Template\SmartyParser::theliaEscape($_smarty_tpl->tpl_vars['store_name']->value,$_smarty_tpl);?>
<?php } else { ?><?php echo TheliaSmarty\Template\SmartyParser::theliaEscape($_smarty_tpl->tpl_vars['store_name']->value,$_smarty_tpl);?>
<?php }?></title>
<meta name="generator" content="<?php echo $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['intl'][0][0]->translate(array('l'=>'Thelia V2'),$_smarty_tpl);?>
">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<meta name="description" content="<?php if ($_smarty_tpl->tpl_vars['page_description']->value) {?><?php echo TheliaSmarty\Template\SmartyParser::theliaEscape($_smarty_tpl->tpl_vars['page_description']->value,$_smarty_tpl);?>
<?php } else { ?><?php echo TheliaSmarty\Template\SmartyParser::theliaEscape(smarty_modifier_truncate(preg_replace('!\s+!u', ' ',$_smarty_tpl->tpl_vars['store_description']->value),120),$_smarty_tpl);?>
<?php }?>">
<?php $_smarty_tpl->smarty->_tag_stack[] = array('stylesheets', array('file'=>'assets/dist/css/thelia.min.css')); $_block_repeat=true; echo $_smarty_tpl->smarty->registered_plugins['block']['stylesheets'][0][0]->blockStylesheets(array('file'=>'assets/dist/css/thelia.min.css'), null, $_smarty_tpl, $_block_repeat);while ($_block_repeat) { ob_start();?>
<link rel="stylesheet" href="<?php echo TheliaSmarty\Template\SmartyParser::theliaEscape($_smarty_tpl->tpl_vars['asset_url']->value,$_smarty_tpl);?>
">
<?php $_block_content = ob_get_clean(); $_block_repeat=false; echo $_smarty_tpl->smarty->registered_plugins['block']['stylesheets'][0][0]->blockStylesheets(array('file'=>'assets/dist/css/thelia.min.css'), $_block_content, $_smarty_tpl, $_block_repeat); } array_pop($_smarty_tpl->smarty->_tag_stack);?>
<?php echo $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['hook'][0][0]->processHookFunction(array('name'=>"main.stylesheet"),$_smarty_tpl);?>
<?php echo $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['hook'][0][0]->processHookFunction(array('name'=>"home.stylesheet"),$_smarty_tpl);?>
<!--[if lt IE 11]>
<link rel="shortcut icon" type="image/x-icon" href="<?php echo $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['image'][0][0]->functionImage(array('file'=>'assets/dist/img/favicon.ico'),$_smarty_tpl);?>
" />
<![endif]-->
<?php $_smarty_tpl->smarty->_tag_stack[] = array('local_media', array('type'=>"favicon",'width'=>32,'height'=>32)); $_block_repeat=true; echo $_smarty_tpl->smarty->registered_plugins['block']['local_media'][0][0]->storeMediaDataAccess(array('type'=>"favicon",'width'=>32,'height'=>32), null, $_smarty_tpl, $_block_repeat);while ($_block_repeat) { ob_start();?>
<link rel="icon" type="<?php echo TheliaSmarty\Template\SmartyParser::theliaEscape($_smarty_tpl->tpl_vars['MEDIA_MIME_TYPE']->value,$_smarty_tpl);?>
" href="<?php echo TheliaSmarty\Template\SmartyParser::theliaEscape($_smarty_tpl->tpl_vars['MEDIA_URL']->value,$_smarty_tpl);?>
" />
<?php $_block_content = ob_get_clean(); $_block_repeat=false; echo $_smarty_tpl->smarty->registered_plugins['block']['local_media'][0][0]->storeMediaDataAccess(array('type'=>"favicon",'width'=>32,'height'=>32), $_block_content, $_smarty_tpl, $_block_repeat); } array_pop($_smarty_tpl->smarty->_tag_stack);?>
<link rel="alternate" type="application/rss+xml" title="<?php echo $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['intl'][0][0]->translate(array('l'=>'All products'),$_smarty_tpl);?>
" href="<?php echo $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['url'][0][0]->generateUrlFunction(array('path'=>"/feed/catalog/%lang",'lang'=>$_smarty_tpl->tpl_vars['lang_locale']->value),$_smarty_tpl);?>
" />
<link rel="alternate" type="application/rss+xml" title="<?php echo $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['intl'][0][0]->translate(array('l'=>'All contents'),$_smarty_tpl);?>
" href="<?php echo $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['url'][0][0]->generateUrlFunction(array('path'=>"/feed/content/%lang",'lang'=>$_smarty_tpl->tpl_vars['lang_locale']->value),$_smarty_tpl);?>
" />
<link rel="alternate" type="application/rss+xml" title="<?php echo $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['intl'][0][0]->translate(array('l'=>'All brands'),$_smarty_tpl);?>
" href="<?php echo $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['url'][0][0]->generateUrlFunction(array('path'=>"/feed/brand/%lang",'lang'=>$_smarty_tpl->tpl_vars['lang_locale']->value),$_smarty_tpl);?>
" />
<!--[if lt IE 9]>
<script src="//cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7.3/html5shiv.js"></script>
<?php $_smarty_tpl->smarty->_tag_stack[] = array('javascripts', array('file'=>"assets/dist/js/vendors/html5shiv.min.js")); $_block_repeat=true; echo $_smarty_tpl->smarty->registered_plugins['block']['javascripts'][0][0]->blockJavascripts(array('file'=>"assets/dist/js/vendors/html5shiv.min.js"), null, $_smarty_tpl, $_block_repeat);while ($_block_repeat) { ob_start();?>
<script>window.html5 || document.write('<script src="<?php echo TheliaSmarty\Template\SmartyParser::theliaEscape($_smarty_tpl->tpl_vars['asset_url']->value,$_smarty_tpl);?>
"><\/script>');</script>
<?php $_block_content = ob_get_clean(); $_block_repeat=false; echo $_smarty_tpl->smarty->registered_plugins['block']['javascripts'][0][0]->blockJavascripts(array('file'=>"assets/dist/js/vendors/html5shiv.min.js"), $_block_content, $_smarty_tpl, $_block_repeat); } array_pop($_smarty_tpl->smarty->_tag_stack);?>
<script src="//cdnjs.cloudflare.com/ajax/libs/respond.js/1.4.2/respond.js"></script>
<?php $_smarty_tpl->smarty->_tag_stack[] = array('javascripts', array('file'=>"assets/dist/js/vendors/respond.min.js")); $_block_repeat=true; echo $_smarty_tpl->smarty->registered_plugins['block']['javascripts'][0][0]->blockJavascripts(array('file'=>"assets/dist/js/vendors/respond.min.js"), null, $_smarty_tpl, $_block_repeat);while ($_block_repeat) { ob_start();?>
<script>window.respond || document.write('<script src="<?php echo TheliaSmarty\Template\SmartyParser::theliaEscape($_smarty_tpl->tpl_vars['asset_url']->value,$_smarty_tpl);?>
"><\/script>');</script>
<?php $_block_content = ob_get_clean(); $_block_repeat=false; echo $_smarty_tpl->smarty->registered_plugins['block']['javascripts'][0][0]->blockJavascripts(array('file'=>"assets/dist/js/vendors/respond.min.js"), $_block_content, $_smarty_tpl, $_block_repeat); } array_pop($_smarty_tpl->smarty->_tag_stack);?>
<![endif]-->
<?php echo $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['hook'][0][0]->processHookFunction(array('name'=>"main.head-bottom"),$_smarty_tpl);?>
<link href="<?php echo $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['stylesheet'][0][0]->functionStylesheet(array('file'=>'assets/node_modules/flatpickr/dist/flatpickr.min.css'),$_smarty_tpl);?>
" rel="stylesheet">
<script src="<?php echo $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['javascript'][0][0]->functionJavascript(array('file'=>"assets/node_modules/flatpickr/dist/flatpickr.min.js"),$_smarty_tpl);?>
"></script>
<?php if ($_smarty_tpl->tpl_vars['lang_code']->value!=='en') {?>
<script src="<?php echo $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['javascript'][0][0]->functionJavascript(array('file'=>"assets/node_modules/flatpickr/dist/l10n/".((string)$_smarty_tpl->tpl_vars['lang_code']->value).".js"),$_smarty_tpl);?>
"></script>
<?php }?>
</head>
<body class="page-home" itemscope itemtype="http://schema.org/WebPage">
<div id="fb-root"></div>
<script async defer crossorigin="anonymous" src="https://connect.facebook.net/fr_FR/sdk.js#xfbml=1&version=v6.0"></script>
<?php echo $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['hook'][0][0]->processHookFunction(array('name'=>"main.body-top"),$_smarty_tpl);?>
<!-- Accessibility -->
<a class="sr-only" href="#content"><?php echo $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['intl'][0][0]->translate(array('l'=>"Skip to content"),$_smarty_tpl);?>
</a>
<div class="page" role="document">
<div class="header-container" itemscope itemtype="http://schema.org/WPHeader">
<?php echo $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['hook'][0][0]->processHookFunction(array('name'=>"main.header-top"),$_smarty_tpl);?>
<div class="navbar navbar-default navbar-secondary" id="navbar-secondary" itemscope itemtype="http://schema.org/SiteNavigationElement">
<div>
<div class="navbar-header">
<!-- .navbar-toggle is used as the toggle for collapsed navbar content -->
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".nav-secondary">
<span class="sr-only"><?php echo $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['intl'][0][0]->translate(array('l'=>"Toggle navigation"),$_smarty_tpl);?>
</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<?php $_smarty_tpl->smarty->_tag_stack[] = array('local_media', array('type'=>"logo")); $_block_repeat=true; echo $_smarty_tpl->smarty->registered_plugins['block']['local_media'][0][0]->storeMediaDataAccess(array('type'=>"logo"), null, $_smarty_tpl, $_block_repeat);while ($_block_repeat) { ob_start();?>
<a class="responsive-logo" href="<?php echo $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['navigate'][0][0]->navigateToUrlFunction(array('to'=>"index"),$_smarty_tpl);?>
" id="logo-menu">
<img src="<?php echo TheliaSmarty\Template\SmartyParser::theliaEscape($_smarty_tpl->tpl_vars['MEDIA_URL']->value,$_smarty_tpl);?>
" alt="<?php echo TheliaSmarty\Template\SmartyParser::theliaEscape($_smarty_tpl->tpl_vars['TITLE']->value,$_smarty_tpl);?>
" class="img-responsive" itemprop="image" data-toggle="magnify">
</a>
<?php $_block_content = ob_get_clean(); $_block_repeat=false; echo $_smarty_tpl->smarty->registered_plugins['block']['local_media'][0][0]->storeMediaDataAccess(array('type'=>"logo"), $_block_content, $_smarty_tpl, $_block_repeat); } array_pop($_smarty_tpl->smarty->_tag_stack);?>
</div>
<?php $_smarty_tpl->smarty->_tag_stack[] = array('ifhook', array('rel'=>"main.navbar-secondary")); $_block_repeat=true; echo $_smarty_tpl->smarty->registered_plugins['block']['ifhook'][0][0]->ifHook(array('rel'=>"main.navbar-secondary"), null, $_smarty_tpl, $_block_repeat);while ($_block_repeat) { ob_start();?>
<nav class="navbar-collapse collapse nav-secondary" role="navigation" aria-label="<?php echo $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['intl'][0][0]->translate(array('l'=>"Secondary Navigation"),$_smarty_tpl);?>
">
<?php echo $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['hook'][0][0]->processHookFunction(array('name'=>"main.navbar-secondary"),$_smarty_tpl);?>
</nav>
<?php $_block_content = ob_get_clean(); $_block_repeat=false; echo $_smarty_tpl->smarty->registered_plugins['block']['ifhook'][0][0]->ifHook(array('rel'=>"main.navbar-secondary"), $_block_content, $_smarty_tpl, $_block_repeat); } array_pop($_smarty_tpl->smarty->_tag_stack);?>
</div>
</div>
<?php echo $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['hook'][0][0]->processHookFunction(array('name'=>"main.header-bottom"),$_smarty_tpl);?>
</div><!-- /.header-container -->
<section id="lead">
<div class="container">
<div class="row">
<div class="col-lg-3">
<?php if (basename($_smarty_tpl->source->filepath)!="index.html") {?>
<h1 id="main-label" class="page-header">
<?php echo $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['category'][0][0]->categoryDataAccess(array('attr'=>"title"),$_smarty_tpl);?>
<?php if (basename($_smarty_tpl->source->filepath)==="folder.html") {?><?php echo $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['folder'][0][0]->folderDataAccess(array('attr'=>"title"),$_smarty_tpl);?>
<?php }?>
<?php if (basename($_smarty_tpl->source->filepath)==="content.html") {?><?php echo $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['content'][0][0]->contentDataAccess(array('attr'=>"title"),$_smarty_tpl);?>
<?php }?>
<?php if (basename($_smarty_tpl->source->filepath)==="contact.html") {?><?php echo $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['intl'][0][0]->translate(array('l'=>"Contactez-nous"),$_smarty_tpl);?>
<?php }?>
<?php if (basename($_smarty_tpl->source->filepath)==="contact-success.html") {?><?php echo $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['intl'][0][0]->translate(array('l'=>"Contactez-nous"),$_smarty_tpl);?>
<?php }?>
</h1>
<?php } else { ?>
<h1 id="main-label" class="page-header logo-menu">Apart'Moment</h1>
<?php }?>
</div>
<?php if (basename($_smarty_tpl->source->filepath)==="category.html"||basename($_smarty_tpl->source->filepath)==="product.html"||basename($_smarty_tpl->source->filepath)==="index.html") {?>
<div class="col-lg-6 logo-menu">
<p><?php echo $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['intl'][0][0]->translate(array('l'=>"<em>5 à 10% moins cher</em> que sur les plateformes de réservation."),$_smarty_tpl);?>
</p>
</div>
<?php } else { ?>
<div class="col-lg-6">
&nbsp;
</div>
<?php }?>
<div class="col-lg-3 telephone">
<a href="tel:<?php echo $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['intl'][0][0]->translate(array('l'=>"contact_tel"),$_smarty_tpl);?>
"><?php echo $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['intl'][0][0]->translate(array('l'=>"contact_tel"),$_smarty_tpl);?>
<br><em>&nbsp;<?php echo $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['intl'][0][0]->translate(array('l'=>"Prix d'un appel local"),$_smarty_tpl);?>
</em></a><small><p><?php echo $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['intl'][0][0]->translate(array('l'=>"7/7 jours de 8h à 22h"),$_smarty_tpl);?>
<br><?php echo $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['intl'][0][0]->translate(array('l'=>"Heure de Paris"),$_smarty_tpl);?>
</p></small>
</div>
</div>
</div>
</section>
<main class="main-container" role="main">
<div class="container">
<?php echo $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['hook'][0][0]->processHookFunction(array('name'=>"main.content-top"),$_smarty_tpl);?>
<div id="content">
<?php echo $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['hook'][0][0]->processHookFunction(array('name'=>"home.body"),$_smarty_tpl);?>
</div>
<?php echo $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['hook'][0][0]->processHookFunction(array('name'=>"main.content-bottom"),$_smarty_tpl);?>
</div><!-- /.container -->
</main><!-- /.main-container -->
<section class="footer-container" itemscope itemtype="http://schema.org/WPFooter">
<?php $_smarty_tpl->smarty->_tag_stack[] = array('ifhook', array('rel'=>"main.footer-top")); $_block_repeat=true; echo $_smarty_tpl->smarty->registered_plugins['block']['ifhook'][0][0]->ifHook(array('rel'=>"main.footer-top"), null, $_smarty_tpl, $_block_repeat);while ($_block_repeat) { ob_start();?>
<section class="footer-block">
<div class="container">
<div class="blocks row">
<?php echo $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['hook'][0][0]->processHookFunction(array('name'=>"main.footer-top"),$_smarty_tpl);?>
</div>
</div>
</section>
<?php $_block_content = ob_get_clean(); $_block_repeat=false; echo $_smarty_tpl->smarty->registered_plugins['block']['ifhook'][0][0]->ifHook(array('rel'=>"main.footer-top"), $_block_content, $_smarty_tpl, $_block_repeat); } array_pop($_smarty_tpl->smarty->_tag_stack);?>
<?php $_smarty_tpl->smarty->_tag_stack[] = array('elsehook', array('rel'=>"main.footer-top")); $_block_repeat=true; echo $_smarty_tpl->smarty->registered_plugins['block']['elsehook'][0][0]->elseHook(array('rel'=>"main.footer-top"), null, $_smarty_tpl, $_block_repeat);while ($_block_repeat) { ob_start();?>
<section class="footer-banner">
<div class="container">
<div class="banner row banner-col-6">
<div class="col-xs-12 col-sm-6 col-md-4 col-lg-2">
<span class="fa fa-key"></span>
<?php echo $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['intl'][0][0]->translate(array('l'=>"Entrée autonome"),$_smarty_tpl);?>
<small><?php echo $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['intl'][0][0]->translate(array('l'=>"Pas de contrainte horaire à l'arrivée."),$_smarty_tpl);?>
</small>
</div>
<div class="col-xs-12 col-sm-6 col-md-4 col-lg-2">
<span class="fa fa-group"></span>
<?php echo $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['intl'][0][0]->translate(array('l'=>"Jusqu'à 5 pers."),$_smarty_tpl);?>
<small><?php echo $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['intl'][0][0]->translate(array('l'=>"par appartement."),$_smarty_tpl);?>
</small>
</div>
<div class="col-xs-12 col-sm-6 col-md-4 col-lg-2">
<span class="fa fa-cutlery"></span>
<?php echo $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['intl'][0][0]->translate(array('l'=>"Cuisine équipée"),$_smarty_tpl);?>
<small><?php echo $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['intl'][0][0]->translate(array('l'=>"Des cuisines entièrement équipées !"),$_smarty_tpl);?>
</small>
</div>
<div class="col-xs-12 col-sm-6 col-md-4 col-lg-2">
<span class="fa fa-car"></span>
<?php echo $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['intl'][0][0]->translate(array('l'=>"Parking"),$_smarty_tpl);?>
<small><?php echo $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['intl'][0][0]->translate(array('l'=>"Place de parking interne et privé."),$_smarty_tpl);?>
</small>
</div>
<div class="col-xs-12 col-sm-6 col-md-4 col-lg-2" id="last-box">
<span class="fa fa-sun-o"></span>
<?php echo $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['intl'][0][0]->translate(array('l'=>"Terrasse"),$_smarty_tpl);?>
<small><?php echo $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['intl'][0][0]->translate(array('l'=>"Profitez des beaux jours en terrasse !"),$_smarty_tpl);?>
</small>
</div>
<div class="col-xs-12 col-sm-6 col-md-4 col-lg-2" id="last-box">
<span class="fa fa-wifi"></span>
<?php echo $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['intl'][0][0]->translate(array('l'=>"Wi-Fi"),$_smarty_tpl);?>
<small><?php echo $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['intl'][0][0]->translate(array('l'=>"Wi-Fi gratuit et sécurisé."),$_smarty_tpl);?>
</small>
</div>
</div>
</div>
</section><!-- /.footer-banner -->
<?php $_block_content = ob_get_clean(); $_block_repeat=false; echo $_smarty_tpl->smarty->registered_plugins['block']['elsehook'][0][0]->elseHook(array('rel'=>"main.footer-top"), $_block_content, $_smarty_tpl, $_block_repeat); } array_pop($_smarty_tpl->smarty->_tag_stack);?>
<?php $_smarty_tpl->smarty->_tag_stack[] = array('ifhook', array('rel'=>"main.footer-body")); $_block_repeat=true; echo $_smarty_tpl->smarty->registered_plugins['block']['ifhook'][0][0]->ifHook(array('rel'=>"main.footer-body"), null, $_smarty_tpl, $_block_repeat);while ($_block_repeat) { ob_start();?>
<section class="footer-block">
<div class="container">
<div class="blocks row">
<?php $_smarty_tpl->smarty->_tag_stack[] = array('hookblock', array('name'=>"main.footer-body",'fields'=>"id,class,title,content")); $_block_repeat=true; echo $_smarty_tpl->smarty->registered_plugins['block']['hookblock'][0][0]->processHookBlock(array('name'=>"main.footer-body",'fields'=>"id,class,title,content"), null, $_smarty_tpl, $_block_repeat);while ($_block_repeat) { ob_start();?>
<?php $_smarty_tpl->smarty->_tag_stack[] = array('forhook', array('rel'=>"main.footer-body")); $_block_repeat=true; echo $_smarty_tpl->smarty->registered_plugins['block']['forhook'][0][0]->processForHookBlock(array('rel'=>"main.footer-body"), null, $_smarty_tpl, $_block_repeat);while ($_block_repeat) { ob_start();?>
<div class="col col-sm-3">
<section <?php if ($_smarty_tpl->tpl_vars['id']->value) {?> id="<?php echo TheliaSmarty\Template\SmartyParser::theliaEscape($_smarty_tpl->tpl_vars['id']->value,$_smarty_tpl);?>
"<?php }?> class="block <?php if ($_smarty_tpl->tpl_vars['class']->value) {?> block-<?php echo TheliaSmarty\Template\SmartyParser::theliaEscape($_smarty_tpl->tpl_vars['class']->value,$_smarty_tpl);?>
<?php }?>">
<?php if ($_smarty_tpl->tpl_vars['class']->value=="default"||$_smarty_tpl->tpl_vars['class']->value=="newsletter") {?>
<div class="block-heading"><h3 class="block-title"><?php echo TheliaSmarty\Template\SmartyParser::theliaEscape($_smarty_tpl->tpl_vars['title']->value,$_smarty_tpl);?>
</h3></div>
<?php }?>
<div class="block-content">
<?php echo $_smarty_tpl->tpl_vars['content']->value;?>
</div>
</section>
</div>
<?php $_block_content = ob_get_clean(); $_block_repeat=false; echo $_smarty_tpl->smarty->registered_plugins['block']['forhook'][0][0]->processForHookBlock(array('rel'=>"main.footer-body"), $_block_content, $_smarty_tpl, $_block_repeat); } array_pop($_smarty_tpl->smarty->_tag_stack);?>
<?php $_block_content = ob_get_clean(); $_block_repeat=false; echo $_smarty_tpl->smarty->registered_plugins['block']['hookblock'][0][0]->processHookBlock(array('name'=>"main.footer-body",'fields'=>"id,class,title,content"), $_block_content, $_smarty_tpl, $_block_repeat); } array_pop($_smarty_tpl->smarty->_tag_stack);?>
</div>
</div>
</section>
<?php $_block_content = ob_get_clean(); $_block_repeat=false; echo $_smarty_tpl->smarty->registered_plugins['block']['ifhook'][0][0]->ifHook(array('rel'=>"main.footer-body"), $_block_content, $_smarty_tpl, $_block_repeat); } array_pop($_smarty_tpl->smarty->_tag_stack);?>
<?php $_smarty_tpl->smarty->_tag_stack[] = array('ifhook', array('rel'=>"main.footer-bottom")); $_block_repeat=true; echo $_smarty_tpl->smarty->registered_plugins['block']['ifhook'][0][0]->ifHook(array('rel'=>"main.footer-bottom"), null, $_smarty_tpl, $_block_repeat);while ($_block_repeat) { ob_start();?>
<footer class="footer-info" role="contentinfo">
<div class="container">
<div class="info row">
<div class="col-lg-9">
<?php echo $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['hook'][0][0]->processHookFunction(array('name'=>"main.footer-bottom"),$_smarty_tpl);?>
</div>
<div class="col-lg-3">
<section class="copyright"><?php echo $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['intl'][0][0]->translate(array('l'=>"Copyright"),$_smarty_tpl);?>
&copy; <time datetime="<?php echo TheliaSmarty\Template\SmartyParser::theliaEscape(date('Y-m-d'),$_smarty_tpl);?>
"><?php echo TheliaSmarty\Template\SmartyParser::theliaEscape(date('Y'),$_smarty_tpl);?>
</time> <a href="http://www.id-media.fr" rel="external">ID Média</a></section>
</div>
</div>
</div>
</footer>
<?php $_block_content = ob_get_clean(); $_block_repeat=false; echo $_smarty_tpl->smarty->registered_plugins['block']['ifhook'][0][0]->ifHook(array('rel'=>"main.footer-bottom"), $_block_content, $_smarty_tpl, $_block_repeat); } array_pop($_smarty_tpl->smarty->_tag_stack);?>
<?php $_smarty_tpl->smarty->_tag_stack[] = array('elsehook', array('rel'=>"main.footer-bottom")); $_block_repeat=true; echo $_smarty_tpl->smarty->registered_plugins['block']['elsehook'][0][0]->elseHook(array('rel'=>"main.footer-bottom"), null, $_smarty_tpl, $_block_repeat);while ($_block_repeat) { ob_start();?>
<footer class="footer-info" role="contentinfo">
<div class="container">
<div class="info row">
<div class="col-lg-9">
<div class="appart-moment-copy"><strong>Apart'Moment</strong> <span>&reg;</span></div>
</div>
<div class="col-lg-3">
<section class="copyright"><?php echo $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['intl'][0][0]->translate(array('l'=>"Copyright"),$_smarty_tpl);?>
&copy; <time datetime="<?php echo TheliaSmarty\Template\SmartyParser::theliaEscape(date('Y-m-d'),$_smarty_tpl);?>
"><?php echo TheliaSmarty\Template\SmartyParser::theliaEscape(date('Y'),$_smarty_tpl);?>
</time> <a href="http://www.id-media.fr" target="_blanck" rel="external">ID Média</a></section>
</div>
</div>
</div>
</footer><!-- /.footer-info -->
<?php $_block_content = ob_get_clean(); $_block_repeat=false; echo $_smarty_tpl->smarty->registered_plugins['block']['elsehook'][0][0]->elseHook(array('rel'=>"main.footer-bottom"), $_block_content, $_smarty_tpl, $_block_repeat); } array_pop($_smarty_tpl->smarty->_tag_stack);?>
</section><!-- /.footer-container -->
</div><!-- /.page -->
<!-- JavaScript -->
<!-- Jquery -->
<!--[if lt IE 9]><script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script> <![endif]-->
<!--[if (gte IE 9)|!(IE)]><!--><script src="//ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js"></script><!--<![endif]-->
<?php $_smarty_tpl->smarty->_tag_stack[] = array('javascripts', array('file'=>"assets/dist/js/vendors/jquery.min.js")); $_block_repeat=true; echo $_smarty_tpl->smarty->registered_plugins['block']['javascripts'][0][0]->blockJavascripts(array('file'=>"assets/dist/js/vendors/jquery.min.js"), null, $_smarty_tpl, $_block_repeat);while ($_block_repeat) { ob_start();?>
<script>window.jQuery || document.write('<script src="<?php echo TheliaSmarty\Template\SmartyParser::theliaEscape($_smarty_tpl->tpl_vars['asset_url']->value,$_smarty_tpl);?>
"><\/script>');</script>
<?php $_block_content = ob_get_clean(); $_block_repeat=false; echo $_smarty_tpl->smarty->registered_plugins['block']['javascripts'][0][0]->blockJavascripts(array('file'=>"assets/dist/js/vendors/jquery.min.js"), $_block_content, $_smarty_tpl, $_block_repeat); } array_pop($_smarty_tpl->smarty->_tag_stack);?>
<script src="//ajax.aspnetcdn.com/ajax/jquery.validate/1.13.1/jquery.validate.min.js"></script>
<?php if ($_smarty_tpl->tpl_vars['lang_code']->value!='en') {?>
<script src="//ajax.aspnetcdn.com/ajax/jquery.validate/1.13.1/localization/messages_<?php echo TheliaSmarty\Template\SmartyParser::theliaEscape($_smarty_tpl->tpl_vars['lang_code']->value,$_smarty_tpl);?>
.js"></script>
<?php }?>
<script src="//maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script>
<?php $_smarty_tpl->smarty->_tag_stack[] = array('javascripts', array('file'=>"assets/dist/js/vendors/bootstrap.min.js")); $_block_repeat=true; echo $_smarty_tpl->smarty->registered_plugins['block']['javascripts'][0][0]->blockJavascripts(array('file'=>"assets/dist/js/vendors/bootstrap.min.js"), null, $_smarty_tpl, $_block_repeat);while ($_block_repeat) { ob_start();?>
<script>if(typeof($.fn.modal) === 'undefined') { document.write('<script src="<?php echo TheliaSmarty\Template\SmartyParser::theliaEscape($_smarty_tpl->tpl_vars['asset_url']->value,$_smarty_tpl);?>
"><\/script>'); }</script>
<?php $_block_content = ob_get_clean(); $_block_repeat=false; echo $_smarty_tpl->smarty->registered_plugins['block']['javascripts'][0][0]->blockJavascripts(array('file'=>"assets/dist/js/vendors/bootstrap.min.js"), $_block_content, $_smarty_tpl, $_block_repeat); } array_pop($_smarty_tpl->smarty->_tag_stack);?>
<?php $_smarty_tpl->smarty->_tag_stack[] = array('javascripts', array('file'=>"assets/dist/js/vendors/bootbox.js")); $_block_repeat=true; echo $_smarty_tpl->smarty->registered_plugins['block']['javascripts'][0][0]->blockJavascripts(array('file'=>"assets/dist/js/vendors/bootbox.js"), null, $_smarty_tpl, $_block_repeat);while ($_block_repeat) { ob_start();?>
<script src="<?php echo TheliaSmarty\Template\SmartyParser::theliaEscape($_smarty_tpl->tpl_vars['asset_url']->value,$_smarty_tpl);?>
"></script>
<?php $_block_content = ob_get_clean(); $_block_repeat=false; echo $_smarty_tpl->smarty->registered_plugins['block']['javascripts'][0][0]->blockJavascripts(array('file'=>"assets/dist/js/vendors/bootbox.js"), $_block_content, $_smarty_tpl, $_block_repeat); } array_pop($_smarty_tpl->smarty->_tag_stack);?>
<?php echo $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['hook'][0][0]->processHookFunction(array('name'=>"main.after-javascript-include"),$_smarty_tpl);?>
<?php echo $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['hook'][0][0]->processHookFunction(array('name'=>"home.after-javascript-include"),$_smarty_tpl);?>
<?php echo $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['hook'][0][0]->processHookFunction(array('name'=>"main.javascript-initialization"),$_smarty_tpl);?>
<script>
// fix path for addCartMessage
// if you use '/' in your URL rewriting, the cart message is not displayed
// addCartMessageUrl is used in thelia.js to update the mini-cart content
var addCartMessageUrl = "<?php echo $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['url'][0][0]->generateUrlFunction(array('path'=>'ajax/addCartMessage'),$_smarty_tpl);?>
";
</script>
<?php echo $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['hook'][0][0]->processHookFunction(array('name'=>"home.javascript-initialization"),$_smarty_tpl);?>
<!-- Custom scripts -->
<script src="<?php echo $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['javascript'][0][0]->functionJavascript(array('file'=>'assets/dist/js/thelia.min.js'),$_smarty_tpl);?>
?v=3"></script>
<?php echo $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['hook'][0][0]->processHookFunction(array('name'=>"main.body-bottom"),$_smarty_tpl);?>
</body>
</html>
<?php }} ?>

View File

@@ -0,0 +1,27 @@
<?php /* Smarty version Smarty-3.1.20, created on 2021-03-23 12:37:18
compiled from "/Volumes/Dev/Sources/Clients/apartmoment/site_web/templates/frontOffice/am/modules/HookNavigation/main-footer-body.html" */ ?>
<?php /*%%SmartyHeaderCode:17633048416059d2eeac8366-34265876%%*/if(!defined('SMARTY_DIR')) exit('no direct access allowed');
$_valid = $_smarty_tpl->decodeProperties(array (
'file_dependency' =>
array (
'67819c2d150b00f4ab6df2f9caffa6aff01c8542' =>
array (
0 => '/Volumes/Dev/Sources/Clients/apartmoment/site_web/templates/frontOffice/am/modules/HookNavigation/main-footer-body.html',
1 => 1613761751,
2 => 'file',
),
),
'nocache_hash' => '17633048416059d2eeac8366-34265876',
'function' =>
array (
),
'has_nocache_code' => false,
'version' => 'Smarty-3.1.20',
'unifunc' => 'content_6059d2eeacb862_51675235',
),false); /*/%%SmartyHeaderCode%%*/?>
<?php if ($_valid && !is_callable('content_6059d2eeacb862_51675235')) {function content_6059d2eeacb862_51675235($_smarty_tpl) {?><ul>
<li>
<div class="fb-page" data-href="https://www.facebook.com/ApartMomentSaintOmerCentre" data-tabs="timeline" data-width="320" data-height="300" data-small-header="true" data-adapt-container-width="true" data-hide-cover="false" data-show-facepile="true"><blockquote cite="https://www.facebook.com/ApartMomentSaintOmerCentre" class="fb-xfbml-parse-ignore"><a href="https://www.facebook.com/ApartMomentSaintOmerCentre">Apart Moment Saint-Omer Centre</a></blockquote></div>
</li>
</ul>
<?php }} ?>

View File

@@ -0,0 +1,36 @@
<?php /* Smarty version Smarty-3.1.20, created on 2021-03-23 12:37:18
compiled from "/Volumes/Dev/Sources/Clients/apartmoment/site_web/local/modules/HookLiensProduits/templates/frontOffice/default/main-footer-body.html" */ ?>
<?php /*%%SmartyHeaderCode:18420191666059d2eea2fa56-46727414%%*/if(!defined('SMARTY_DIR')) exit('no direct access allowed');
$_valid = $_smarty_tpl->decodeProperties(array (
'file_dependency' =>
array (
'6e2896db3f5e61df70f2fede5ea61229eef33687' =>
array (
0 => '/Volumes/Dev/Sources/Clients/apartmoment/site_web/local/modules/HookLiensProduits/templates/frontOffice/default/main-footer-body.html',
1 => 1613761652,
2 => 'file',
),
),
'nocache_hash' => '18420191666059d2eea2fa56-46727414',
'function' =>
array (
),
'variables' =>
array (
'URL' => 0,
'TITLE' => 0,
),
'has_nocache_code' => false,
'version' => 'Smarty-3.1.20',
'unifunc' => 'content_6059d2eea3f9a2_36724990',
),false); /*/%%SmartyHeaderCode%%*/?>
<?php if ($_valid && !is_callable('content_6059d2eea3f9a2_36724990')) {function content_6059d2eea3f9a2_36724990($_smarty_tpl) {?><ul>
<?php $_smarty_tpl->smarty->_tag_stack[] = array('loop', array('type'=>"product",'name'=>"liens.produits",'category'=>2)); $_block_repeat=true; echo $_smarty_tpl->smarty->registered_plugins['block']['loop'][0][0]->theliaLoop(array('type'=>"product",'name'=>"liens.produits",'category'=>2), null, $_smarty_tpl, $_block_repeat);while ($_block_repeat) { ob_start();?>
<li><a href="<?php echo TheliaSmarty\Template\SmartyParser::theliaEscape($_smarty_tpl->tpl_vars['URL']->value,$_smarty_tpl);?>
"><?php echo TheliaSmarty\Template\SmartyParser::theliaEscape($_smarty_tpl->tpl_vars['TITLE']->value,$_smarty_tpl);?>
</a></li>
<?php $_block_content = ob_get_clean(); $_block_repeat=false; echo $_smarty_tpl->smarty->registered_plugins['block']['loop'][0][0]->theliaLoop(array('type'=>"product",'name'=>"liens.produits",'category'=>2), $_block_content, $_smarty_tpl, $_block_repeat); } array_pop($_smarty_tpl->smarty->_tag_stack);?>
</ul>
<?php }} ?>

View File

@@ -0,0 +1,89 @@
<?php /* Smarty version Smarty-3.1.20, created on 2021-03-23 12:37:13
compiled from "/Volumes/Dev/Sources/Clients/apartmoment/site_web/local/modules/HookProductsOffer/templates/frontOffice/default/home-body.html" */ ?>
<?php /*%%SmartyHeaderCode:18786416366059d2e9d93f82-41621812%%*/if(!defined('SMARTY_DIR')) exit('no direct access allowed');
$_valid = $_smarty_tpl->decodeProperties(array (
'file_dependency' =>
array (
'7d46e1881108b70f523197464c37663463ebf1e2' =>
array (
0 => '/Volumes/Dev/Sources/Clients/apartmoment/site_web/local/modules/HookProductsOffer/templates/frontOffice/default/home-body.html',
1 => 1613761640,
2 => 'file',
),
),
'nocache_hash' => '18786416366059d2e9d93f82-41621812',
'function' =>
array (
),
'variables' =>
array (
'ID' => 0,
'SALE_LABEL' => 0,
'CHAPO' => 0,
),
'has_nocache_code' => false,
'version' => 'Smarty-3.1.20',
'unifunc' => 'content_6059d2e9df85d2_01427947',
),false); /*/%%SmartyHeaderCode%%*/?>
<?php if ($_valid && !is_callable('content_6059d2e9df85d2_01427947')) {function content_6059d2e9df85d2_01427947($_smarty_tpl) {?><?php $_smarty_tpl->smarty->_tag_stack[] = array('ifloop', array('rel'=>"current-sales")); $_block_repeat=true; echo $_smarty_tpl->smarty->registered_plugins['block']['ifloop'][0][0]->theliaIfLoop(array('rel'=>"current-sales"), null, $_smarty_tpl, $_block_repeat);while ($_block_repeat) { ob_start();?>
<section id="products-offer" class="grid">
<?php $_smarty_tpl->smarty->_tag_stack[] = array('loop', array('name'=>"current-sales",'type'=>"sale",'limit'=>"2")); $_block_repeat=true; echo $_smarty_tpl->smarty->registered_plugins['block']['loop'][0][0]->theliaLoop(array('name'=>"current-sales",'type'=>"sale",'limit'=>"2"), null, $_smarty_tpl, $_block_repeat);while ($_block_repeat) { ob_start();?>
<section id="product-sale-<?php echo TheliaSmarty\Template\SmartyParser::theliaEscape($_smarty_tpl->tpl_vars['ID']->value,$_smarty_tpl);?>
">
<div class="products-heading">
<h2><?php echo TheliaSmarty\Template\SmartyParser::theliaEscape($_smarty_tpl->tpl_vars['SALE_LABEL']->value,$_smarty_tpl);?>
<a href="<?php echo $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['url'][0][0]->generateUrlFunction(array('path'=>"/sale",'sale'=>$_smarty_tpl->tpl_vars['ID']->value),$_smarty_tpl);?>
" class="btn-all"><?php echo $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['intl'][0][0]->translate(array('l'=>"+ View All",'d'=>"hookproductsoffer.fo.default"),$_smarty_tpl);?>
</a></h2>
<div class="short-description" itemprop="description"><?php echo TheliaSmarty\Template\SmartyParser::theliaEscape($_smarty_tpl->tpl_vars['CHAPO']->value,$_smarty_tpl);?>
</div>
</div>
<div class="products-content">
<ul class="products-grid list-unstyled row">
<?php $_smarty_tpl->smarty->_tag_stack[] = array('loop', array('name'=>"products_in_sale",'type'=>"product",'limit'=>"4",'sale'=>$_smarty_tpl->tpl_vars['ID']->value)); $_block_repeat=true; echo $_smarty_tpl->smarty->registered_plugins['block']['loop'][0][0]->theliaLoop(array('name'=>"products_in_sale",'type'=>"product",'limit'=>"4",'sale'=>$_smarty_tpl->tpl_vars['ID']->value), null, $_smarty_tpl, $_block_repeat);while ($_block_repeat) { ob_start();?>
<?php echo $_smarty_tpl->getSubTemplate ("includes/single-product.html", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('colClass'=>"col-md-3 col-sm-4",'product_id'=>$_smarty_tpl->tpl_vars['ID']->value,'hasBtn'=>false,'hasDescription'=>false,'width'=>"218",'height'=>"146"), 0);?>
<?php $_block_content = ob_get_clean(); $_block_repeat=false; echo $_smarty_tpl->smarty->registered_plugins['block']['loop'][0][0]->theliaLoop(array('name'=>"products_in_sale",'type'=>"product",'limit'=>"4",'sale'=>$_smarty_tpl->tpl_vars['ID']->value), $_block_content, $_smarty_tpl, $_block_repeat); } array_pop($_smarty_tpl->smarty->_tag_stack);?>
</ul>
</div>
</section><!-- #products-sale-XX -->
<?php $_block_content = ob_get_clean(); $_block_repeat=false; echo $_smarty_tpl->smarty->registered_plugins['block']['loop'][0][0]->theliaLoop(array('name'=>"current-sales",'type'=>"sale",'limit'=>"2"), $_block_content, $_smarty_tpl, $_block_repeat); } array_pop($_smarty_tpl->smarty->_tag_stack);?>
</section>
<?php $_block_content = ob_get_clean(); $_block_repeat=false; echo $_smarty_tpl->smarty->registered_plugins['block']['ifloop'][0][0]->theliaIfLoop(array('rel'=>"current-sales"), $_block_content, $_smarty_tpl, $_block_repeat); } array_pop($_smarty_tpl->smarty->_tag_stack);?>
<?php $_smarty_tpl->smarty->_tag_stack[] = array('elseloop', array('rel'=>"current-sales")); $_block_repeat=true; echo $_smarty_tpl->smarty->registered_plugins['block']['elseloop'][0][0]->theliaElseloop(array('rel'=>"current-sales"), null, $_smarty_tpl, $_block_repeat);while ($_block_repeat) { ob_start();?>
<?php $_smarty_tpl->smarty->_tag_stack[] = array('ifloop', array('rel'=>"product_promo")); $_block_repeat=true; echo $_smarty_tpl->smarty->registered_plugins['block']['ifloop'][0][0]->theliaIfLoop(array('rel'=>"product_promo"), null, $_smarty_tpl, $_block_repeat);while ($_block_repeat) { ob_start();?>
<section id="products-offer" class="grid">
<div class="products-heading">
<h2><?php echo $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['intl'][0][0]->translate(array('l'=>"Offers",'d'=>"hookproductsoffer.fo.default"),$_smarty_tpl);?>
<a href="<?php echo $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['url'][0][0]->generateUrlFunction(array('path'=>"/view_all",'type'=>"offers"),$_smarty_tpl);?>
" class="btn-all"><?php echo $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['intl'][0][0]->translate(array('l'=>"+ View All",'d'=>"hookproductsoffer.fo.default"),$_smarty_tpl);?>
</a></h2>
</div>
<div class="products-content">
<ul class="products-grid list-unstyled row">
<?php $_smarty_tpl->smarty->_tag_stack[] = array('loop', array('name'=>"product_promo",'type'=>"product",'limit'=>"4",'promo'=>"yes")); $_block_repeat=true; echo $_smarty_tpl->smarty->registered_plugins['block']['loop'][0][0]->theliaLoop(array('name'=>"product_promo",'type'=>"product",'limit'=>"4",'promo'=>"yes"), null, $_smarty_tpl, $_block_repeat);while ($_block_repeat) { ob_start();?>
<?php echo $_smarty_tpl->getSubTemplate ("includes/single-product.html", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('colClass'=>"col-md-3 col-sm-4",'product_id'=>$_smarty_tpl->tpl_vars['ID']->value,'hasBtn'=>false,'hasDescription'=>false,'width'=>"218",'height'=>"146"), 0);?>
<?php $_block_content = ob_get_clean(); $_block_repeat=false; echo $_smarty_tpl->smarty->registered_plugins['block']['loop'][0][0]->theliaLoop(array('name'=>"product_promo",'type'=>"product",'limit'=>"4",'promo'=>"yes"), $_block_content, $_smarty_tpl, $_block_repeat); } array_pop($_smarty_tpl->smarty->_tag_stack);?>
</ul>
</div>
</section><!-- #products-offer -->
<?php $_block_content = ob_get_clean(); $_block_repeat=false; echo $_smarty_tpl->smarty->registered_plugins['block']['ifloop'][0][0]->theliaIfLoop(array('rel'=>"product_promo"), $_block_content, $_smarty_tpl, $_block_repeat); } array_pop($_smarty_tpl->smarty->_tag_stack);?>
<?php $_block_content = ob_get_clean(); $_block_repeat=false; echo $_smarty_tpl->smarty->registered_plugins['block']['elseloop'][0][0]->theliaElseloop(array('rel'=>"current-sales"), $_block_content, $_smarty_tpl, $_block_repeat); } array_pop($_smarty_tpl->smarty->_tag_stack);?>
<?php }} ?>

View File

@@ -0,0 +1,157 @@
<?php /* Smarty version Smarty-3.1.20, created on 2021-03-23 12:37:10
compiled from "/Volumes/Dev/Sources/Clients/apartmoment/site_web/templates/frontOffice/am/modules/HookCart/mini-cart.html" */ ?>
<?php /*%%SmartyHeaderCode:12687335546059d2e61c4856-17582937%%*/if(!defined('SMARTY_DIR')) exit('no direct access allowed');
$_valid = $_smarty_tpl->decodeProperties(array (
'file_dependency' =>
array (
'80c2cafc962af84ec42df268dff09a5ac3859c1d' =>
array (
0 => '/Volumes/Dev/Sources/Clients/apartmoment/site_web/templates/frontOffice/am/modules/HookCart/mini-cart.html',
1 => 1613761751,
2 => 'file',
),
),
'nocache_hash' => '12687335546059d2e61c4856-17582937',
'function' =>
array (
),
'variables' =>
array (
'PRODUCT_SALE_ELEMENTS_ID' => 0,
'PRODUCT_IMAGE_ID' => 0,
'PRODUCT_ID' => 0,
'IMAGE_URL' => 0,
'TITLE' => 0,
'IS_PROMO' => 0,
'PROMO_TAXED_PRICE' => 0,
'TOTAL_PROMO_TAXED_PRICE' => 0,
'TAXED_PRICE' => 0,
'TOTAL_TAXED_PRICE' => 0,
'QUANTITY' => 0,
'real_price' => 0,
'total_price' => 0,
'real_total_price' => 0,
),
'has_nocache_code' => false,
'version' => 'Smarty-3.1.20',
'unifunc' => 'content_6059d2e627b690_55440656',
),false); /*/%%SmartyHeaderCode%%*/?>
<?php if ($_valid && !is_callable('content_6059d2e627b690_55440656')) {function content_6059d2e627b690_55440656($_smarty_tpl) {?><?php $_smarty_tpl->smarty->_tag_stack[] = array('ifloop', array('rel'=>"cartloop")); $_block_repeat=true; echo $_smarty_tpl->smarty->registered_plugins['block']['ifloop'][0][0]->theliaIfLoop(array('rel'=>"cartloop"), null, $_smarty_tpl, $_block_repeat);while ($_block_repeat) { ob_start();?>
<li class="dropdown pull-right cart-not-empty cart-container">
<a href="<?php echo $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['url'][0][0]->generateUrlFunction(array('path'=>"/cart"),$_smarty_tpl);?>
" rel="nofollow" class="cart">
<?php echo $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['intl'][0][0]->translate(array('l'=>"Cart",'d'=>"hookcart.fo.default"),$_smarty_tpl);?>
<span class="badge"><?php echo $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['cart'][0][0]->cartDataAccess(array('attr'=>"count_item"),$_smarty_tpl);?>
</span>
</a>
<div class="dropdown-menu cart-content">
<form id="form-cart-mini" action="<?php echo $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['url'][0][0]->generateUrlFunction(array('path'=>"/order/delivery"),$_smarty_tpl);?>
" method="post">
<table class="table table-cart-mini">
<colgroup>
<col width="70">
<col>
<col width="100">
</colgroup>
<tbody>
<?php $_smarty_tpl->tpl_vars["total_price"] = new Smarty_variable(0, null, 0);?>
<?php $_smarty_tpl->smarty->_tag_stack[] = array('loop', array('type'=>"cart",'name'=>"cartloop")); $_block_repeat=true; echo $_smarty_tpl->smarty->registered_plugins['block']['loop'][0][0]->theliaLoop(array('type'=>"cart",'name'=>"cartloop"), null, $_smarty_tpl, $_block_repeat);while ($_block_repeat) { ob_start();?>
<tr>
<td class="image">
<?php $_smarty_tpl->smarty->_tag_stack[] = array('ifloop', array('rel'=>"pse-first-image")); $_block_repeat=true; echo $_smarty_tpl->smarty->registered_plugins['block']['ifloop'][0][0]->theliaIfLoop(array('rel'=>"pse-first-image"), null, $_smarty_tpl, $_block_repeat);while ($_block_repeat) { ob_start();?>
<?php $_smarty_tpl->smarty->_tag_stack[] = array('loop', array('type'=>"product-sale-elements-image",'name'=>"pse-first-image",'product_sale_elements_id'=>$_smarty_tpl->tpl_vars['PRODUCT_SALE_ELEMENTS_ID']->value,'limit'=>"1")); $_block_repeat=true; echo $_smarty_tpl->smarty->registered_plugins['block']['loop'][0][0]->theliaLoop(array('type'=>"product-sale-elements-image",'name'=>"pse-first-image",'product_sale_elements_id'=>$_smarty_tpl->tpl_vars['PRODUCT_SALE_ELEMENTS_ID']->value,'limit'=>"1"), null, $_smarty_tpl, $_block_repeat);while ($_block_repeat) { ob_start();?>
<?php $_smarty_tpl->smarty->_tag_stack[] = array('loop', array('type'=>"image",'name'=>"product-image",'id'=>$_smarty_tpl->tpl_vars['PRODUCT_IMAGE_ID']->value,'product'=>$_smarty_tpl->tpl_vars['PRODUCT_ID']->value,'limit'=>"1",'width'=>"236",'height'=>"120",'resize_mode'=>"crop")); $_block_repeat=true; echo $_smarty_tpl->smarty->registered_plugins['block']['loop'][0][0]->theliaLoop(array('type'=>"image",'name'=>"product-image",'id'=>$_smarty_tpl->tpl_vars['PRODUCT_IMAGE_ID']->value,'product'=>$_smarty_tpl->tpl_vars['PRODUCT_ID']->value,'limit'=>"1",'width'=>"236",'height'=>"120",'resize_mode'=>"crop"), null, $_smarty_tpl, $_block_repeat);while ($_block_repeat) { ob_start();?>
<?php $_smarty_tpl->tpl_vars["product_image_url"] = new Smarty_variable($_smarty_tpl->tpl_vars['IMAGE_URL']->value, null, 0);?>
<img src="<?php echo $_smarty_tpl->tpl_vars['IMAGE_URL']->value;?>
" alt="<?php echo TheliaSmarty\Template\SmartyParser::theliaEscape($_smarty_tpl->tpl_vars['TITLE']->value,$_smarty_tpl);?>
">
<?php $_block_content = ob_get_clean(); $_block_repeat=false; echo $_smarty_tpl->smarty->registered_plugins['block']['loop'][0][0]->theliaLoop(array('type'=>"image",'name'=>"product-image",'id'=>$_smarty_tpl->tpl_vars['PRODUCT_IMAGE_ID']->value,'product'=>$_smarty_tpl->tpl_vars['PRODUCT_ID']->value,'limit'=>"1",'width'=>"236",'height'=>"120",'resize_mode'=>"crop"), $_block_content, $_smarty_tpl, $_block_repeat); } array_pop($_smarty_tpl->smarty->_tag_stack);?>
<?php $_block_content = ob_get_clean(); $_block_repeat=false; echo $_smarty_tpl->smarty->registered_plugins['block']['loop'][0][0]->theliaLoop(array('type'=>"product-sale-elements-image",'name'=>"pse-first-image",'product_sale_elements_id'=>$_smarty_tpl->tpl_vars['PRODUCT_SALE_ELEMENTS_ID']->value,'limit'=>"1"), $_block_content, $_smarty_tpl, $_block_repeat); } array_pop($_smarty_tpl->smarty->_tag_stack);?>
<?php $_block_content = ob_get_clean(); $_block_repeat=false; echo $_smarty_tpl->smarty->registered_plugins['block']['ifloop'][0][0]->theliaIfLoop(array('rel'=>"pse-first-image"), $_block_content, $_smarty_tpl, $_block_repeat); } array_pop($_smarty_tpl->smarty->_tag_stack);?>
<?php $_smarty_tpl->smarty->_tag_stack[] = array('elseloop', array('rel'=>"pse-first-image")); $_block_repeat=true; echo $_smarty_tpl->smarty->registered_plugins['block']['elseloop'][0][0]->theliaElseloop(array('rel'=>"pse-first-image"), null, $_smarty_tpl, $_block_repeat);while ($_block_repeat) { ob_start();?>
<?php $_smarty_tpl->smarty->_tag_stack[] = array('loop', array('type'=>"image",'name'=>"product-image",'product'=>$_smarty_tpl->tpl_vars['PRODUCT_ID']->value,'limit'=>"1",'width'=>"236",'height'=>"120",'resize_mode'=>"crop")); $_block_repeat=true; echo $_smarty_tpl->smarty->registered_plugins['block']['loop'][0][0]->theliaLoop(array('type'=>"image",'name'=>"product-image",'product'=>$_smarty_tpl->tpl_vars['PRODUCT_ID']->value,'limit'=>"1",'width'=>"236",'height'=>"120",'resize_mode'=>"crop"), null, $_smarty_tpl, $_block_repeat);while ($_block_repeat) { ob_start();?>
<img src="<?php echo $_smarty_tpl->tpl_vars['IMAGE_URL']->value;?>
" alt="<?php echo TheliaSmarty\Template\SmartyParser::theliaEscape($_smarty_tpl->tpl_vars['TITLE']->value,$_smarty_tpl);?>
">
<?php $_block_content = ob_get_clean(); $_block_repeat=false; echo $_smarty_tpl->smarty->registered_plugins['block']['loop'][0][0]->theliaLoop(array('type'=>"image",'name'=>"product-image",'product'=>$_smarty_tpl->tpl_vars['PRODUCT_ID']->value,'limit'=>"1",'width'=>"236",'height'=>"120",'resize_mode'=>"crop"), $_block_content, $_smarty_tpl, $_block_repeat); } array_pop($_smarty_tpl->smarty->_tag_stack);?>
<?php $_block_content = ob_get_clean(); $_block_repeat=false; echo $_smarty_tpl->smarty->registered_plugins['block']['elseloop'][0][0]->theliaElseloop(array('rel'=>"pse-first-image"), $_block_content, $_smarty_tpl, $_block_repeat); } array_pop($_smarty_tpl->smarty->_tag_stack);?>
</td>
<td class="product">
<h3 class="name" style="margin:0">
<?php echo TheliaSmarty\Template\SmartyParser::theliaEscape($_smarty_tpl->tpl_vars['TITLE']->value,$_smarty_tpl);?>
</h3>
<a href="<?php echo $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['token_url'][0][0]->generateUrlWithToken(array('path'=>"/cart/delete/".((string)$_smarty_tpl->tpl_vars['ITEM_ID']->value)),$_smarty_tpl);?>
" class="btn btn-remove" data-tip="tooltip" data-title="Delete" data-original-title=""><i class="fa fa-trash"></i> <span><?php echo $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['intl'][0][0]->translate(array('l'=>"Remove",'d'=>"hookcart.fo.default"),$_smarty_tpl);?>
</span></a>
</td>
<td class="unitprice text-center">
<?php if ($_smarty_tpl->tpl_vars['IS_PROMO']->value==1) {?>
<?php $_smarty_tpl->tpl_vars["real_price"] = new Smarty_variable($_smarty_tpl->tpl_vars['PROMO_TAXED_PRICE']->value, null, 0);?>
<?php $_smarty_tpl->tpl_vars["real_total_price"] = new Smarty_variable($_smarty_tpl->tpl_vars['TOTAL_PROMO_TAXED_PRICE']->value, null, 0);?>
<?php } else { ?>
<?php $_smarty_tpl->tpl_vars["real_price"] = new Smarty_variable($_smarty_tpl->tpl_vars['TAXED_PRICE']->value, null, 0);?>
<?php $_smarty_tpl->tpl_vars["real_total_price"] = new Smarty_variable($_smarty_tpl->tpl_vars['TOTAL_TAXED_PRICE']->value, null, 0);?>
<?php }?>
<span class="qty"><?php echo TheliaSmarty\Template\SmartyParser::theliaEscape($_smarty_tpl->tpl_vars['QUANTITY']->value,$_smarty_tpl);?>
</span> X <span class="price" style="font-size:1em;"><?php echo $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['format_money'][0][0]->formatMoney(array('number'=>$_smarty_tpl->tpl_vars['real_price']->value),$_smarty_tpl);?>
</span>
<?php $_smarty_tpl->tpl_vars["total_price"] = new Smarty_variable($_smarty_tpl->tpl_vars['total_price']->value+$_smarty_tpl->tpl_vars['real_total_price']->value, null, 0);?>
</td>
</tr>
<?php $_block_content = ob_get_clean(); $_block_repeat=false; echo $_smarty_tpl->smarty->registered_plugins['block']['loop'][0][0]->theliaLoop(array('type'=>"cart",'name'=>"cartloop"), $_block_content, $_smarty_tpl, $_block_repeat); } array_pop($_smarty_tpl->smarty->_tag_stack);?>
</tbody>
<tfoot>
<tr>
<td colspan="2" class="empty">
<a href="<?php echo $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['url'][0][0]->generateUrlFunction(array('path'=>"/cart"),$_smarty_tpl);?>
" role="button" class="btn btn-primary btn-sm""><i class="fa fa-eye"></i> <?php echo $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['intl'][0][0]->translate(array('l'=>"View Cart",'d'=>"hookcart.fo.default"),$_smarty_tpl);?>
</a>
<a href="<?php echo $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['url'][0][0]->generateUrlFunction(array('path'=>"/order/delivery"),$_smarty_tpl);?>
" role="button" class="btn btn-primary btn-sm"><i class="fa fa-chevron-right"></i> <?php echo $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['intl'][0][0]->translate(array('l'=>"Checkout",'d'=>"hookcart.fo.default"),$_smarty_tpl);?>
</a>
</td>
<td class="total">
<div class="total-price">
<span class="price"><?php echo $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['format_money'][0][0]->formatMoney(array('number'=>$_smarty_tpl->tpl_vars['total_price']->value),$_smarty_tpl);?>
</span>
</div>
</td>
</tr>
</tfoot>
</table>
</form>
</div>
</li>
<?php $_block_content = ob_get_clean(); $_block_repeat=false; echo $_smarty_tpl->smarty->registered_plugins['block']['ifloop'][0][0]->theliaIfLoop(array('rel'=>"cartloop"), $_block_content, $_smarty_tpl, $_block_repeat); } array_pop($_smarty_tpl->smarty->_tag_stack);?>
<?php $_smarty_tpl->smarty->_tag_stack[] = array('elseloop', array('rel'=>"cartloop")); $_block_repeat=true; echo $_smarty_tpl->smarty->registered_plugins['block']['elseloop'][0][0]->theliaElseloop(array('rel'=>"cartloop"), null, $_smarty_tpl, $_block_repeat);while ($_block_repeat) { ob_start();?>
<li class="dropdown pull-right cart-container">
<a href="<?php echo $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['url'][0][0]->generateUrlFunction(array('path'=>"/cart"),$_smarty_tpl);?>
" rel="nofollow" class="cart">
<?php echo $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['intl'][0][0]->translate(array('l'=>"Cart",'d'=>"hookcart.fo.default"),$_smarty_tpl);?>
<span class="badge">0</span>
</a>
<div class="dropdown-menu cart-content">
<p><?php echo $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['intl'][0][0]->translate(array('l'=>"You have no items in your shopping cart.",'d'=>"hookcart.fo.default"),$_smarty_tpl);?>
</p>
</div>
</li>
<?php $_block_content = ob_get_clean(); $_block_repeat=false; echo $_smarty_tpl->smarty->registered_plugins['block']['elseloop'][0][0]->theliaElseloop(array('rel'=>"cartloop"), $_block_content, $_smarty_tpl, $_block_repeat); } array_pop($_smarty_tpl->smarty->_tag_stack);?>
<?php }} ?>

View File

@@ -0,0 +1,71 @@
<?php /* Smarty version Smarty-3.1.20, created on 2021-03-23 12:37:18
compiled from "/Volumes/Dev/Sources/Clients/apartmoment/site_web/local/modules/Beds24/templates/frontOffice/default/hook/search.js.html" */ ?>
<?php /*%%SmartyHeaderCode:15226385866059d2eead92e0-25680659%%*/if(!defined('SMARTY_DIR')) exit('no direct access allowed');
$_valid = $_smarty_tpl->decodeProperties(array (
'file_dependency' =>
array (
'abe1b471791ff0dc845cc98780130aeb143c4270' =>
array (
0 => '/Volumes/Dev/Sources/Clients/apartmoment/site_web/local/modules/Beds24/templates/frontOffice/default/hook/search.js.html',
1 => 1613761613,
2 => 'file',
),
),
'nocache_hash' => '15226385866059d2eead92e0-25680659',
'function' =>
array (
),
'has_nocache_code' => false,
'version' => 'Smarty-3.1.20',
'unifunc' => 'content_6059d2eeaec5f9_02703684',
),false); /*/%%SmartyHeaderCode%%*/?>
<?php if ($_valid && !is_callable('content_6059d2eeaec5f9_02703684')) {function content_6059d2eeaec5f9_02703684($_smarty_tpl) {?><script>
$(function() {
flatpickr.localize(flatpickr.l10ns.<?php echo $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['lang'][0][0]->langDataAccess(array('attr'=>"code"),$_smarty_tpl);?>
);
var startPicker, endPicker, flatpickrOptions = {
enableTime: false,
dateFormat: "Y-m-d",
minDate: "today",
allowInput: true,
altFormat: "l j F Y",
altInput: true
};
endPicker = flatpickr(".date-fin", flatpickrOptions);
flatpickrOptions.onChange = function(selectedDates) {
endPicker.set('minDate', selectedDates[0]);
};
startPicker = flatpickr(".date-debut", flatpickrOptions);
$('#beds24-search-form').submit(function(ev) {
var $zeForm = $(this);
ev.preventDefault();
setSearchResultHtml('<div class="well well-sm"><?php echo $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['intl'][0][0]->translate(array('l'=>'Nous recherchons les disponibilités...','js'=>1),$_smarty_tpl);?>
</div>');
$.ajax({
url: $zeForm.attr('action'),
data: $zeForm.serialize(),
method: $zeForm.attr('method'),
success: function (htmlData) {
setSearchResultHtml(htmlData);
},
error: function () {
setSearchResultHtml('<div class="alert alert-danger"><?php echo $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['intl'][0][0]->translate(array('l'=>'Désolé, quelque chose n\'a pas fonctionné. Merci de ré-essayer.','js'=>1),$_smarty_tpl);?>
</div>');
}
});
});
function setSearchResultHtml(htmlText) {
$('#beds24-search-results').html(htmlText);
}
});
</script>
<?php }} ?>

View File

@@ -0,0 +1,105 @@
<?php /* Smarty version Smarty-3.1.20, created on 2021-03-23 12:37:09
compiled from "/Volumes/Dev/Sources/Clients/apartmoment/site_web/templates/frontOffice/am/modules/MainMenuHook/main-navbar-secondary.html" */ ?>
<?php /*%%SmartyHeaderCode:18652243526059d2e5bb3120-69319978%%*/if(!defined('SMARTY_DIR')) exit('no direct access allowed');
$_valid = $_smarty_tpl->decodeProperties(array (
'file_dependency' =>
array (
'b0014f3f5670de8646ccff98e68c78974227c234' =>
array (
0 => '/Volumes/Dev/Sources/Clients/apartmoment/site_web/templates/frontOffice/am/modules/MainMenuHook/main-navbar-secondary.html',
1 => 1613761751,
2 => 'file',
),
),
'nocache_hash' => '18652243526059d2e5bb3120-69319978',
'function' =>
array (
),
'variables' =>
array (
'MEDIA_URL' => 0,
'TITLE' => 0,
'URL' => 0,
),
'has_nocache_code' => false,
'version' => 'Smarty-3.1.20',
'unifunc' => 'content_6059d2e5c20903_30105783',
),false); /*/%%SmartyHeaderCode%%*/?>
<?php if ($_valid && !is_callable('content_6059d2e5c20903_30105783')) {function content_6059d2e5c20903_30105783($_smarty_tpl) {?><ul class="nav navbar-nav navbar-categories">
<?php $_smarty_tpl->smarty->_tag_stack[] = array('local_media', array('type'=>"logo")); $_block_repeat=true; echo $_smarty_tpl->smarty->registered_plugins['block']['local_media'][0][0]->storeMediaDataAccess(array('type'=>"logo"), null, $_smarty_tpl, $_block_repeat);while ($_block_repeat) { ob_start();?>
<li class="logo-menu"><a href="<?php echo $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['navigate'][0][0]->navigateToUrlFunction(array('to'=>"index"),$_smarty_tpl);?>
" id="logo-menu">
<img src="<?php echo TheliaSmarty\Template\SmartyParser::theliaEscape($_smarty_tpl->tpl_vars['MEDIA_URL']->value,$_smarty_tpl);?>
" alt="<?php echo TheliaSmarty\Template\SmartyParser::theliaEscape($_smarty_tpl->tpl_vars['TITLE']->value,$_smarty_tpl);?>
" class="img-responsive" itemprop="image" data-toggle="magnify">
</a>
<?php $_block_content = ob_get_clean(); $_block_repeat=false; echo $_smarty_tpl->smarty->registered_plugins['block']['local_media'][0][0]->storeMediaDataAccess(array('type'=>"logo"), $_block_content, $_smarty_tpl, $_block_repeat); } array_pop($_smarty_tpl->smarty->_tag_stack);?>
</li>
<?php $_smarty_tpl->smarty->_tag_stack[] = array('loop', array('type'=>"category",'name'=>"navigation.apparts",'id'=>2)); $_block_repeat=true; echo $_smarty_tpl->smarty->registered_plugins['block']['loop'][0][0]->theliaLoop(array('type'=>"category",'name'=>"navigation.apparts",'id'=>2), null, $_smarty_tpl, $_block_repeat);while ($_block_repeat) { ob_start();?>
<li>
<a href="<?php echo TheliaSmarty\Template\SmartyParser::theliaEscape($_smarty_tpl->tpl_vars['URL']->value,$_smarty_tpl);?>
"><?php echo TheliaSmarty\Template\SmartyParser::theliaEscape($_smarty_tpl->tpl_vars['TITLE']->value,$_smarty_tpl);?>
</a>
</li>
<?php $_block_content = ob_get_clean(); $_block_repeat=false; echo $_smarty_tpl->smarty->registered_plugins['block']['loop'][0][0]->theliaLoop(array('type'=>"category",'name'=>"navigation.apparts",'id'=>2), $_block_content, $_smarty_tpl, $_block_repeat); } array_pop($_smarty_tpl->smarty->_tag_stack);?>
<?php $_smarty_tpl->smarty->_tag_stack[] = array('loop', array('type'=>"content",'name'=>"menu",'id'=>23)); $_block_repeat=true; echo $_smarty_tpl->smarty->registered_plugins['block']['loop'][0][0]->theliaLoop(array('type'=>"content",'name'=>"menu",'id'=>23), null, $_smarty_tpl, $_block_repeat);while ($_block_repeat) { ob_start();?>
<li class="nav-item">
<a class="nav-link" href="<?php echo TheliaSmarty\Template\SmartyParser::theliaEscape($_smarty_tpl->tpl_vars['URL']->value,$_smarty_tpl);?>
">
<?php echo TheliaSmarty\Template\SmartyParser::theliaEscape($_smarty_tpl->tpl_vars['TITLE']->value,$_smarty_tpl);?>
</a>
</li>
<?php $_block_content = ob_get_clean(); $_block_repeat=false; echo $_smarty_tpl->smarty->registered_plugins['block']['loop'][0][0]->theliaLoop(array('type'=>"content",'name'=>"menu",'id'=>23), $_block_content, $_smarty_tpl, $_block_repeat); } array_pop($_smarty_tpl->smarty->_tag_stack);?>
<?php $_smarty_tpl->smarty->_tag_stack[] = array('loop', array('type'=>"category",'name'=>"navigation.extras",'id'=>8)); $_block_repeat=true; echo $_smarty_tpl->smarty->registered_plugins['block']['loop'][0][0]->theliaLoop(array('type'=>"category",'name'=>"navigation.extras",'id'=>8), null, $_smarty_tpl, $_block_repeat);while ($_block_repeat) { ob_start();?>
<li>
<a href="<?php echo TheliaSmarty\Template\SmartyParser::theliaEscape($_smarty_tpl->tpl_vars['URL']->value,$_smarty_tpl);?>
"><?php echo TheliaSmarty\Template\SmartyParser::theliaEscape($_smarty_tpl->tpl_vars['TITLE']->value,$_smarty_tpl);?>
</a>
</li>
<?php $_block_content = ob_get_clean(); $_block_repeat=false; echo $_smarty_tpl->smarty->registered_plugins['block']['loop'][0][0]->theliaLoop(array('type'=>"category",'name'=>"navigation.extras",'id'=>8), $_block_content, $_smarty_tpl, $_block_repeat); } array_pop($_smarty_tpl->smarty->_tag_stack);?>
<?php $_smarty_tpl->smarty->_tag_stack[] = array('loop', array('type'=>"category",'name'=>"navigation.cadeau",'id'=>9)); $_block_repeat=true; echo $_smarty_tpl->smarty->registered_plugins['block']['loop'][0][0]->theliaLoop(array('type'=>"category",'name'=>"navigation.cadeau",'id'=>9), null, $_smarty_tpl, $_block_repeat);while ($_block_repeat) { ob_start();?>
<li>
<a href="<?php echo TheliaSmarty\Template\SmartyParser::theliaEscape($_smarty_tpl->tpl_vars['URL']->value,$_smarty_tpl);?>
"><?php echo TheliaSmarty\Template\SmartyParser::theliaEscape($_smarty_tpl->tpl_vars['TITLE']->value,$_smarty_tpl);?>
</a>
</li>
<?php $_block_content = ob_get_clean(); $_block_repeat=false; echo $_smarty_tpl->smarty->registered_plugins['block']['loop'][0][0]->theliaLoop(array('type'=>"category",'name'=>"navigation.cadeau",'id'=>9), $_block_content, $_smarty_tpl, $_block_repeat); } array_pop($_smarty_tpl->smarty->_tag_stack);?>
<?php $_smarty_tpl->smarty->_tag_stack[] = array('loop', array('type'=>"folder",'name'=>"menu",'id'=>9)); $_block_repeat=true; echo $_smarty_tpl->smarty->registered_plugins['block']['loop'][0][0]->theliaLoop(array('type'=>"folder",'name'=>"menu",'id'=>9), null, $_smarty_tpl, $_block_repeat);while ($_block_repeat) { ob_start();?>
<li class="nav-item">
<a class="nav-link" href="<?php echo TheliaSmarty\Template\SmartyParser::theliaEscape($_smarty_tpl->tpl_vars['URL']->value,$_smarty_tpl);?>
">
<?php echo TheliaSmarty\Template\SmartyParser::theliaEscape($_smarty_tpl->tpl_vars['TITLE']->value,$_smarty_tpl);?>
</a>
</li>
<?php $_block_content = ob_get_clean(); $_block_repeat=false; echo $_smarty_tpl->smarty->registered_plugins['block']['loop'][0][0]->theliaLoop(array('type'=>"folder",'name'=>"menu",'id'=>9), $_block_content, $_smarty_tpl, $_block_repeat); } array_pop($_smarty_tpl->smarty->_tag_stack);?>
<?php $_smarty_tpl->smarty->_tag_stack[] = array('loop', array('type'=>"content",'name'=>"menu",'id'=>22,'exclude'=>"24")); $_block_repeat=true; echo $_smarty_tpl->smarty->registered_plugins['block']['loop'][0][0]->theliaLoop(array('type'=>"content",'name'=>"menu",'id'=>22,'exclude'=>"24"), null, $_smarty_tpl, $_block_repeat);while ($_block_repeat) { ob_start();?>
<li class="nav-item">
<a class="nav-link" href="<?php echo TheliaSmarty\Template\SmartyParser::theliaEscape($_smarty_tpl->tpl_vars['URL']->value,$_smarty_tpl);?>
">
<?php echo TheliaSmarty\Template\SmartyParser::theliaEscape($_smarty_tpl->tpl_vars['TITLE']->value,$_smarty_tpl);?>
</a>
</li>
<?php $_block_content = ob_get_clean(); $_block_repeat=false; echo $_smarty_tpl->smarty->registered_plugins['block']['loop'][0][0]->theliaLoop(array('type'=>"content",'name'=>"menu",'id'=>22,'exclude'=>"24"), $_block_content, $_smarty_tpl, $_block_repeat); } array_pop($_smarty_tpl->smarty->_tag_stack);?>
<li<?php if (strpos($_SERVER['REQUEST_URI'],"contact")) {?> class="active"<?php }?> id="<?php echo TheliaSmarty\Template\SmartyParser::theliaEscape($_SERVER['REQUEST_URI'],$_smarty_tpl);?>
"><a href="<?php echo $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['url'][0][0]->generateUrlFunction(array('path'=>"/contact"),$_smarty_tpl);?>
"><?php echo $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['intl'][0][0]->translate(array('l'=>"Contact"),$_smarty_tpl);?>
</a></li>
</ul>
<?php }} ?>

View File

@@ -0,0 +1,110 @@
<?php /* Smarty version Smarty-3.1.20, created on 2021-03-23 12:37:09
compiled from "/Volumes/Dev/Sources/Clients/apartmoment/site_web/local/modules/HookCustomer/templates/frontOffice/default/main-navbar-secondary.html" */ ?>
<?php /*%%SmartyHeaderCode:18304891306059d2e5e54526-31942051%%*/if(!defined('SMARTY_DIR')) exit('no direct access allowed');
$_valid = $_smarty_tpl->decodeProperties(array (
'file_dependency' =>
array (
'b8d1298c430bcdb34dc779ed812b6ae36f57b069' =>
array (
0 => '/Volumes/Dev/Sources/Clients/apartmoment/site_web/local/modules/HookCustomer/templates/frontOffice/default/main-navbar-secondary.html',
1 => 1613761614,
2 => 'file',
),
),
'nocache_hash' => '18304891306059d2e5e54526-31942051',
'function' =>
array (
),
'variables' =>
array (
'name' => 0,
'label_attr' => 0,
),
'has_nocache_code' => false,
'version' => 'Smarty-3.1.20',
'unifunc' => 'content_6059d2e5ed42d9_33812134',
),false); /*/%%SmartyHeaderCode%%*/?>
<?php if ($_valid && !is_callable('content_6059d2e5ed42d9_33812134')) {function content_6059d2e5ed42d9_33812134($_smarty_tpl) {?><ul class="nav navbar-nav navbar-customer navbar-right">
<?php $_smarty_tpl->smarty->_tag_stack[] = array('loop', array('type'=>"auth",'name'=>"customer_info_block",'role'=>"CUSTOMER")); $_block_repeat=true; echo $_smarty_tpl->smarty->registered_plugins['block']['loop'][0][0]->theliaLoop(array('type'=>"auth",'name'=>"customer_info_block",'role'=>"CUSTOMER"), null, $_smarty_tpl, $_block_repeat);while ($_block_repeat) { ob_start();?>
<li><a href="<?php echo $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['url'][0][0]->generateUrlFunction(array('path'=>"/logout"),$_smarty_tpl);?>
" class="logout"><?php echo $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['intl'][0][0]->translate(array('l'=>"Log out!",'d'=>"hookcustomer.fo.default"),$_smarty_tpl);?>
</a></li>
<li><a href="<?php echo $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['url'][0][0]->generateUrlFunction(array('path'=>"/account"),$_smarty_tpl);?>
" class="account"><?php echo $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['intl'][0][0]->translate(array('l'=>"My Account",'d'=>"hookcustomer.fo.default"),$_smarty_tpl);?>
</a></li>
<?php $_block_content = ob_get_clean(); $_block_repeat=false; echo $_smarty_tpl->smarty->registered_plugins['block']['loop'][0][0]->theliaLoop(array('type'=>"auth",'name'=>"customer_info_block",'role'=>"CUSTOMER"), $_block_content, $_smarty_tpl, $_block_repeat); } array_pop($_smarty_tpl->smarty->_tag_stack);?>
<?php $_smarty_tpl->smarty->_tag_stack[] = array('elseloop', array('rel'=>"customer_info_block")); $_block_repeat=true; echo $_smarty_tpl->smarty->registered_plugins['block']['elseloop'][0][0]->theliaElseloop(array('rel'=>"customer_info_block"), null, $_smarty_tpl, $_block_repeat);while ($_block_repeat) { ob_start();?>
<li><a href="<?php echo $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['url'][0][0]->generateUrlFunction(array('path'=>"/register"),$_smarty_tpl);?>
" class="register"><?php echo $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['intl'][0][0]->translate(array('l'=>"Register!",'d'=>"hookcustomer.fo.default"),$_smarty_tpl);?>
</a></li>
<li class="dropdown">
<a href="<?php echo $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['url'][0][0]->generateUrlFunction(array('path'=>"/login"),$_smarty_tpl);?>
" class="login dropdown-toggle"><?php echo $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['intl'][0][0]->translate(array('l'=>"Log In!",'d'=>"hookcustomer.fo.default"),$_smarty_tpl);?>
</a>
<div class="dropdown-menu">
<?php $_smarty_tpl->smarty->_tag_stack[] = array('form', array('name'=>"thelia.front.customer.login")); $_block_repeat=true; echo $_smarty_tpl->smarty->registered_plugins['block']['form'][0][0]->generateForm(array('name'=>"thelia.front.customer.login"), null, $_smarty_tpl, $_block_repeat);while ($_block_repeat) { ob_start();?>
<form id="form-login-mini" action="<?php echo $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['url'][0][0]->generateUrlFunction(array('path'=>"/login"),$_smarty_tpl);?>
" method="post" <?php echo $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['form_enctype'][0][0]->formEnctype(array(),$_smarty_tpl);?>
>
<?php echo $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['form_hidden_fields'][0][0]->renderHiddenFormField(array(),$_smarty_tpl);?>
<?php $_smarty_tpl->smarty->_tag_stack[] = array('form_field', array('field'=>"success_url")); $_block_repeat=true; echo $_smarty_tpl->smarty->registered_plugins['block']['form_field'][0][0]->renderFormField(array('field'=>"success_url"), null, $_smarty_tpl, $_block_repeat);while ($_block_repeat) { ob_start();?>
<input type="hidden" name="<?php echo TheliaSmarty\Template\SmartyParser::theliaEscape($_smarty_tpl->tpl_vars['name']->value,$_smarty_tpl);?>
" value="<?php echo $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['navigate'][0][0]->navigateToUrlFunction(array('to'=>"current"),$_smarty_tpl);?>
">
<?php $_block_content = ob_get_clean(); $_block_repeat=false; echo $_smarty_tpl->smarty->registered_plugins['block']['form_field'][0][0]->renderFormField(array('field'=>"success_url"), $_block_content, $_smarty_tpl, $_block_repeat); } array_pop($_smarty_tpl->smarty->_tag_stack);?>
<?php $_smarty_tpl->smarty->_tag_stack[] = array('form_field', array('field'=>"email")); $_block_repeat=true; echo $_smarty_tpl->smarty->registered_plugins['block']['form_field'][0][0]->renderFormField(array('field'=>"email"), null, $_smarty_tpl, $_block_repeat);while ($_block_repeat) { ob_start();?>
<div class="form-group group-email">
<label for="<?php echo TheliaSmarty\Template\SmartyParser::theliaEscape($_smarty_tpl->tpl_vars['label_attr']->value['for'],$_smarty_tpl);?>
-mini"><?php echo $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['intl'][0][0]->translate(array('l'=>"Email address",'d'=>"hookcustomer.fo.default"),$_smarty_tpl);?>
</label>
<input type="email" name="<?php echo TheliaSmarty\Template\SmartyParser::theliaEscape($_smarty_tpl->tpl_vars['name']->value,$_smarty_tpl);?>
" id="<?php echo TheliaSmarty\Template\SmartyParser::theliaEscape($_smarty_tpl->tpl_vars['label_attr']->value['for'],$_smarty_tpl);?>
-mini" class="form-control input-sm" maxlength="255" aria-required="true" required>
</div>
<?php $_block_content = ob_get_clean(); $_block_repeat=false; echo $_smarty_tpl->smarty->registered_plugins['block']['form_field'][0][0]->renderFormField(array('field'=>"email"), $_block_content, $_smarty_tpl, $_block_repeat); } array_pop($_smarty_tpl->smarty->_tag_stack);?>
<?php $_smarty_tpl->smarty->_tag_stack[] = array('form_field', array('field'=>"password")); $_block_repeat=true; echo $_smarty_tpl->smarty->registered_plugins['block']['form_field'][0][0]->renderFormField(array('field'=>"password"), null, $_smarty_tpl, $_block_repeat);while ($_block_repeat) { ob_start();?>
<div class="form-group group-password">
<label for="<?php echo TheliaSmarty\Template\SmartyParser::theliaEscape($_smarty_tpl->tpl_vars['label_attr']->value['for'],$_smarty_tpl);?>
-mini"><?php echo $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['intl'][0][0]->translate(array('l'=>"Password",'d'=>"hookcustomer.fo.default"),$_smarty_tpl);?>
</label>
<input type="password" name="<?php echo TheliaSmarty\Template\SmartyParser::theliaEscape($_smarty_tpl->tpl_vars['name']->value,$_smarty_tpl);?>
" id="<?php echo TheliaSmarty\Template\SmartyParser::theliaEscape($_smarty_tpl->tpl_vars['label_attr']->value['for'],$_smarty_tpl);?>
-mini" class="form-control input-sm" maxlength="255" aria-required="true" required>
</div>
<?php $_block_content = ob_get_clean(); $_block_repeat=false; echo $_smarty_tpl->smarty->registered_plugins['block']['form_field'][0][0]->renderFormField(array('field'=>"password"), $_block_content, $_smarty_tpl, $_block_repeat); } array_pop($_smarty_tpl->smarty->_tag_stack);?>
<?php $_smarty_tpl->smarty->_tag_stack[] = array('form_field', array('field'=>"account")); $_block_repeat=true; echo $_smarty_tpl->smarty->registered_plugins['block']['form_field'][0][0]->renderFormField(array('field'=>"account"), null, $_smarty_tpl, $_block_repeat);while ($_block_repeat) { ob_start();?>
<input type="hidden" name="<?php echo TheliaSmarty\Template\SmartyParser::theliaEscape($_smarty_tpl->tpl_vars['name']->value,$_smarty_tpl);?>
" value="1">
<?php $_block_content = ob_get_clean(); $_block_repeat=false; echo $_smarty_tpl->smarty->registered_plugins['block']['form_field'][0][0]->renderFormField(array('field'=>"account"), $_block_content, $_smarty_tpl, $_block_repeat); } array_pop($_smarty_tpl->smarty->_tag_stack);?>
<div class="form-group group-btn">
<button type="submit" class="btn btn-login-mini btn-sm btn-primary"><i class="fa fa-sign-in"></i> <?php echo $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['intl'][0][0]->translate(array('l'=>"Sign In",'d'=>"hookcustomer.fo.default"),$_smarty_tpl);?>
</button>
<a href="<?php echo $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['url'][0][0]->generateUrlFunction(array('path'=>"/register"),$_smarty_tpl);?>
" class="btn btn-register-mini btn-default btn-sm"><i class="fa fa-user-plus"></i> <?php echo $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['intl'][0][0]->translate(array('l'=>"Register",'d'=>"hookcustomer.fo.default"),$_smarty_tpl);?>
</a>
</div>
<a href="<?php echo $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['url'][0][0]->generateUrlFunction(array('path'=>"/password"),$_smarty_tpl);?>
" class="mini-forgot-password"><?php echo $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['intl'][0][0]->translate(array('l'=>"Forgot your Password?",'d'=>"hookcustomer.fo.default"),$_smarty_tpl);?>
</a>
</form>
<?php $_block_content = ob_get_clean(); $_block_repeat=false; echo $_smarty_tpl->smarty->registered_plugins['block']['form'][0][0]->generateForm(array('name'=>"thelia.front.customer.login"), $_block_content, $_smarty_tpl, $_block_repeat); } array_pop($_smarty_tpl->smarty->_tag_stack);?>
</div>
</li>
<?php $_block_content = ob_get_clean(); $_block_repeat=false; echo $_smarty_tpl->smarty->registered_plugins['block']['elseloop'][0][0]->theliaElseloop(array('rel'=>"customer_info_block"), $_block_content, $_smarty_tpl, $_block_repeat); } array_pop($_smarty_tpl->smarty->_tag_stack);?>
</ul><?php }} ?>

View File

@@ -0,0 +1,66 @@
<?php /* Smarty version Smarty-3.1.20, created on 2021-03-23 12:37:10
compiled from "/Volumes/Dev/Sources/Clients/apartmoment/site_web/templates/frontOffice/am/modules/Carousel/carousel.html" */ ?>
<?php /*%%SmartyHeaderCode:269258686059d2e64775f0-78460258%%*/if(!defined('SMARTY_DIR')) exit('no direct access allowed');
$_valid = $_smarty_tpl->decodeProperties(array (
'file_dependency' =>
array (
'bd5abb5137e72d123a729a3e13d870e8ecebfeca' =>
array (
0 => '/Volumes/Dev/Sources/Clients/apartmoment/site_web/templates/frontOffice/am/modules/Carousel/carousel.html',
1 => 1613761751,
2 => 'file',
),
),
'nocache_hash' => '269258686059d2e64775f0-78460258',
'function' =>
array (
),
'variables' =>
array (
'LOOP_COUNT' => 0,
'URL' => 0,
'IMAGE_URL' => 0,
'ALT' => 0,
'TITLE' => 0,
'DESCRIPTION' => 0,
),
'has_nocache_code' => false,
'version' => 'Smarty-3.1.20',
'unifunc' => 'content_6059d2e64b23d8_84718879',
),false); /*/%%SmartyHeaderCode%%*/?>
<?php if ($_valid && !is_callable('content_6059d2e64b23d8_84718879')) {function content_6059d2e64b23d8_84718879($_smarty_tpl) {?>
<?php $_smarty_tpl->smarty->_tag_stack[] = array('ifloop', array('rel'=>"carousel.front")); $_block_repeat=true; echo $_smarty_tpl->smarty->registered_plugins['block']['ifloop'][0][0]->theliaIfLoop(array('rel'=>"carousel.front"), null, $_smarty_tpl, $_block_repeat);while ($_block_repeat) { ob_start();?>
<section class="carousel-container">
<div id="carousel" class="carousel slide" data-ride="carousel">
<div class="carousel-wrapper">
<div class="carousel-inner">
<?php $_smarty_tpl->smarty->_tag_stack[] = array('loop', array('type'=>"carousel",'name'=>"carousel.front",'resize_mode'=>"borders")); $_block_repeat=true; echo $_smarty_tpl->smarty->registered_plugins['block']['loop'][0][0]->theliaLoop(array('type'=>"carousel",'name'=>"carousel.front",'resize_mode'=>"borders"), null, $_smarty_tpl, $_block_repeat);while ($_block_repeat) { ob_start();?>
<figure class="item <?php if ($_smarty_tpl->tpl_vars['LOOP_COUNT']->value==1) {?>active<?php }?>">
<?php if ($_smarty_tpl->tpl_vars['URL']->value) {?><a href="<?php echo TheliaSmarty\Template\SmartyParser::theliaEscape((($tmp = @$_smarty_tpl->tpl_vars['URL']->value)===null||$tmp==='' ? '#' : $tmp),$_smarty_tpl);?>
"><?php }?>
<img width="100%" src="<?php echo TheliaSmarty\Template\SmartyParser::theliaEscape($_smarty_tpl->tpl_vars['IMAGE_URL']->value,$_smarty_tpl);?>
" alt="<?php echo TheliaSmarty\Template\SmartyParser::theliaEscape($_smarty_tpl->tpl_vars['ALT']->value,$_smarty_tpl);?>
" height="300">
<?php if ($_smarty_tpl->tpl_vars['URL']->value) {?></a><?php }?>
<div class="carousel-caption">
<?php if ($_smarty_tpl->tpl_vars['TITLE']->value) {?><h3><?php echo TheliaSmarty\Template\SmartyParser::theliaEscape($_smarty_tpl->tpl_vars['TITLE']->value,$_smarty_tpl);?>
</h3><?php }?>
<?php if ($_smarty_tpl->tpl_vars['DESCRIPTION']->value) {?><?php echo $_smarty_tpl->tpl_vars['DESCRIPTION']->value;?>
<?php }?>
</div>
</figure>
<?php $_block_content = ob_get_clean(); $_block_repeat=false; echo $_smarty_tpl->smarty->registered_plugins['block']['loop'][0][0]->theliaLoop(array('type'=>"carousel",'name'=>"carousel.front",'resize_mode'=>"borders"), $_block_content, $_smarty_tpl, $_block_repeat); } array_pop($_smarty_tpl->smarty->_tag_stack);?>
</div>
</div>
<a class="left carousel-control" href="#carousel" data-slide="prev"><span class="fa fa-arrow-circle-o-left"></span></a>
<a class="right carousel-control" href="#carousel" data-slide="next"><span class="fa fa-arrow-circle-o-right"></span></a>
</div>
</section><!-- #carousel -->
<?php $_block_content = ob_get_clean(); $_block_repeat=false; echo $_smarty_tpl->smarty->registered_plugins['block']['ifloop'][0][0]->theliaIfLoop(array('rel'=>"carousel.front"), $_block_content, $_smarty_tpl, $_block_repeat); } array_pop($_smarty_tpl->smarty->_tag_stack);?>
<?php }} ?>

View File

@@ -0,0 +1,160 @@
<?php /* Smarty version Smarty-3.1.20, created on 2021-03-23 12:37:10
compiled from "/Volumes/Dev/Sources/Clients/apartmoment/site_web/templates/frontOffice/am/modules/Beds24/hook/home-body.html" */ ?>
<?php /*%%SmartyHeaderCode:18323710066059d2e63259b4-13215836%%*/if(!defined('SMARTY_DIR')) exit('no direct access allowed');
$_valid = $_smarty_tpl->decodeProperties(array (
'file_dependency' =>
array (
'c067b68470d23265e081e3634b0246482cf94589' =>
array (
0 => '/Volumes/Dev/Sources/Clients/apartmoment/site_web/templates/frontOffice/am/modules/Beds24/hook/home-body.html',
1 => 1613761751,
2 => 'file',
),
),
'nocache_hash' => '18323710066059d2e63259b4-13215836',
'function' =>
array (
),
'variables' =>
array (
'error' => 0,
'label_attr' => 0,
'label' => 0,
'required' => 0,
'name' => 0,
'value' => 0,
'error_focus' => 0,
'message' => 0,
'idx' => 0,
),
'has_nocache_code' => false,
'version' => 'Smarty-3.1.20',
'unifunc' => 'content_6059d2e64324b7_51778906',
),false); /*/%%SmartyHeaderCode%%*/?>
<?php if ($_valid && !is_callable('content_6059d2e64324b7_51778906')) {function content_6059d2e64324b7_51778906($_smarty_tpl) {?><div class="reservations">
<?php $_smarty_tpl->smarty->_tag_stack[] = array('form', array('name'=>"beds24.form.search")); $_block_repeat=true; echo $_smarty_tpl->smarty->registered_plugins['block']['form'][0][0]->generateForm(array('name'=>"beds24.form.search"), null, $_smarty_tpl, $_block_repeat);while ($_block_repeat) { ob_start();?>
<form id="beds24-search-form" method="post" action="<?php echo $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['url'][0][0]->generateUrlFunction(array('path'=>"/search-availabilities"),$_smarty_tpl);?>
">
<?php echo $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['form_hidden_fields'][0][0]->renderHiddenFormField(array(),$_smarty_tpl);?>
<div class="row">
<?php $_smarty_tpl->smarty->_tag_stack[] = array('form_field', array('field'=>"start_date")); $_block_repeat=true; echo $_smarty_tpl->smarty->registered_plugins['block']['form_field'][0][0]->renderFormField(array('field'=>"start_date"), null, $_smarty_tpl, $_block_repeat);while ($_block_repeat) { ob_start();?>
<div class="form-group col-md-3<?php if ($_smarty_tpl->tpl_vars['error']->value) {?> has-error<?php }?>">
<label class="control-label" for="<?php echo TheliaSmarty\Template\SmartyParser::theliaEscape($_smarty_tpl->tpl_vars['label_attr']->value['for'],$_smarty_tpl);?>
"><i class="fa fa-calendar"></i> <?php echo TheliaSmarty\Template\SmartyParser::theliaEscape($_smarty_tpl->tpl_vars['label']->value,$_smarty_tpl);?>
<?php if ($_smarty_tpl->tpl_vars['required']->value) {?> <span class="required">*</span><?php }?></label>
<div class="control-input">
<input type="text" name="<?php echo TheliaSmarty\Template\SmartyParser::theliaEscape($_smarty_tpl->tpl_vars['name']->value,$_smarty_tpl);?>
" id="<?php echo TheliaSmarty\Template\SmartyParser::theliaEscape($_smarty_tpl->tpl_vars['label_attr']->value['for'],$_smarty_tpl);?>
" class="date-debut form-control" maxlength="255" placeholder="<?php echo TheliaSmarty\Template\SmartyParser::theliaEscape($_smarty_tpl->tpl_vars['label_attr']->value['placeholder'],$_smarty_tpl);?>
" value="<?php echo TheliaSmarty\Template\SmartyParser::theliaEscape($_smarty_tpl->tpl_vars['value']->value,$_smarty_tpl);?>
" <?php if ($_smarty_tpl->tpl_vars['required']->value) {?> aria-required="true" required<?php }?><?php if (!$_smarty_tpl->tpl_vars['error_focus']->value&&$_smarty_tpl->tpl_vars['error']->value) {?> autofocus<?php }?>>
<?php if ($_smarty_tpl->tpl_vars['error']->value) {?>
<span class="help-block"><?php echo TheliaSmarty\Template\SmartyParser::theliaEscape($_smarty_tpl->tpl_vars['message']->value,$_smarty_tpl);?>
</span>
<?php $_smarty_tpl->tpl_vars['error_focus'] = new Smarty_variable(true, null, 0);?>
<?php }?>
</div>
</div>
<?php $_block_content = ob_get_clean(); $_block_repeat=false; echo $_smarty_tpl->smarty->registered_plugins['block']['form_field'][0][0]->renderFormField(array('field'=>"start_date"), $_block_content, $_smarty_tpl, $_block_repeat); } array_pop($_smarty_tpl->smarty->_tag_stack);?>
<?php $_smarty_tpl->smarty->_tag_stack[] = array('form_field', array('field'=>"end_date")); $_block_repeat=true; echo $_smarty_tpl->smarty->registered_plugins['block']['form_field'][0][0]->renderFormField(array('field'=>"end_date"), null, $_smarty_tpl, $_block_repeat);while ($_block_repeat) { ob_start();?>
<div class="form-group col-md-3<?php if ($_smarty_tpl->tpl_vars['error']->value) {?> has-error<?php }?>">
<label class="control-label" for="<?php echo TheliaSmarty\Template\SmartyParser::theliaEscape($_smarty_tpl->tpl_vars['label_attr']->value['for'],$_smarty_tpl);?>
"><i class="fa fa-calendar"></i> <?php echo TheliaSmarty\Template\SmartyParser::theliaEscape($_smarty_tpl->tpl_vars['label']->value,$_smarty_tpl);?>
<?php if ($_smarty_tpl->tpl_vars['required']->value) {?> <span class="required">*</span><?php }?></label>
<div class="control-input">
<input type="text" name="<?php echo TheliaSmarty\Template\SmartyParser::theliaEscape($_smarty_tpl->tpl_vars['name']->value,$_smarty_tpl);?>
" id="<?php echo TheliaSmarty\Template\SmartyParser::theliaEscape($_smarty_tpl->tpl_vars['label_attr']->value['for'],$_smarty_tpl);?>
" class="date-fin form-control" maxlength="255" placeholder="<?php echo TheliaSmarty\Template\SmartyParser::theliaEscape($_smarty_tpl->tpl_vars['label_attr']->value['placeholder'],$_smarty_tpl);?>
" value="<?php echo TheliaSmarty\Template\SmartyParser::theliaEscape($_smarty_tpl->tpl_vars['value']->value,$_smarty_tpl);?>
" <?php if ($_smarty_tpl->tpl_vars['required']->value) {?> aria-required="true" required<?php }?><?php if (!$_smarty_tpl->tpl_vars['error_focus']->value&&$_smarty_tpl->tpl_vars['error']->value) {?> autofocus<?php }?>>
<?php if ($_smarty_tpl->tpl_vars['error']->value) {?>
<span class="help-block"><?php echo TheliaSmarty\Template\SmartyParser::theliaEscape($_smarty_tpl->tpl_vars['message']->value,$_smarty_tpl);?>
</span>
<?php $_smarty_tpl->tpl_vars['error_focus'] = new Smarty_variable(true, null, 0);?>
<?php }?>
</div>
</div>
<?php $_block_content = ob_get_clean(); $_block_repeat=false; echo $_smarty_tpl->smarty->registered_plugins['block']['form_field'][0][0]->renderFormField(array('field'=>"end_date"), $_block_content, $_smarty_tpl, $_block_repeat); } array_pop($_smarty_tpl->smarty->_tag_stack);?>
<?php $_smarty_tpl->smarty->_tag_stack[] = array('form_field', array('field'=>"adults")); $_block_repeat=true; echo $_smarty_tpl->smarty->registered_plugins['block']['form_field'][0][0]->renderFormField(array('field'=>"adults"), null, $_smarty_tpl, $_block_repeat);while ($_block_repeat) { ob_start();?>
<div class="form-group col-md-2<?php if ($_smarty_tpl->tpl_vars['error']->value) {?> has-error<?php }?>">
<label class="control-label" for="<?php echo TheliaSmarty\Template\SmartyParser::theliaEscape($_smarty_tpl->tpl_vars['label_attr']->value['for'],$_smarty_tpl);?>
"><i class="fa fa-male"></i> <?php echo TheliaSmarty\Template\SmartyParser::theliaEscape($_smarty_tpl->tpl_vars['label']->value,$_smarty_tpl);?>
<?php if ($_smarty_tpl->tpl_vars['required']->value) {?> <span class="required">*</span><?php }?></label>
<div class="control-input">
<select name="<?php echo TheliaSmarty\Template\SmartyParser::theliaEscape($_smarty_tpl->tpl_vars['name']->value,$_smarty_tpl);?>
" id="<?php echo TheliaSmarty\Template\SmartyParser::theliaEscape($_smarty_tpl->tpl_vars['label_attr']->value['for'],$_smarty_tpl);?>
" class=" form-control" <?php if ($_smarty_tpl->tpl_vars['required']->value) {?> aria-required="true" required<?php }?><?php if (!$_smarty_tpl->tpl_vars['error_focus']->value&&$_smarty_tpl->tpl_vars['error']->value) {?> autofocus<?php }?>>
<?php $_smarty_tpl->tpl_vars['idx'] = new Smarty_Variable;$_smarty_tpl->tpl_vars['idx']->step = 1;$_smarty_tpl->tpl_vars['idx']->total = (int) ceil(($_smarty_tpl->tpl_vars['idx']->step > 0 ? 5+1 - (1) : 1-(5)+1)/abs($_smarty_tpl->tpl_vars['idx']->step));
if ($_smarty_tpl->tpl_vars['idx']->total > 0) {
for ($_smarty_tpl->tpl_vars['idx']->value = 1, $_smarty_tpl->tpl_vars['idx']->iteration = 1;$_smarty_tpl->tpl_vars['idx']->iteration <= $_smarty_tpl->tpl_vars['idx']->total;$_smarty_tpl->tpl_vars['idx']->value += $_smarty_tpl->tpl_vars['idx']->step, $_smarty_tpl->tpl_vars['idx']->iteration++) {
$_smarty_tpl->tpl_vars['idx']->first = $_smarty_tpl->tpl_vars['idx']->iteration == 1;$_smarty_tpl->tpl_vars['idx']->last = $_smarty_tpl->tpl_vars['idx']->iteration == $_smarty_tpl->tpl_vars['idx']->total;?>
<option value="<?php echo TheliaSmarty\Template\SmartyParser::theliaEscape($_smarty_tpl->tpl_vars['idx']->value,$_smarty_tpl);?>
"<?php if ($_smarty_tpl->tpl_vars['value']->value==$_smarty_tpl->tpl_vars['idx']->value) {?> selected<?php }?>><?php echo TheliaSmarty\Template\SmartyParser::theliaEscape($_smarty_tpl->tpl_vars['idx']->value,$_smarty_tpl);?>
</option>
<?php }} ?>
</select>
<?php if ($_smarty_tpl->tpl_vars['error']->value) {?>
<span class="help-block"><?php echo TheliaSmarty\Template\SmartyParser::theliaEscape($_smarty_tpl->tpl_vars['message']->value,$_smarty_tpl);?>
</span>
<?php $_smarty_tpl->tpl_vars['error_focus'] = new Smarty_variable(true, null, 0);?>
<?php }?>
</div>
</div>
<?php $_block_content = ob_get_clean(); $_block_repeat=false; echo $_smarty_tpl->smarty->registered_plugins['block']['form_field'][0][0]->renderFormField(array('field'=>"adults"), $_block_content, $_smarty_tpl, $_block_repeat); } array_pop($_smarty_tpl->smarty->_tag_stack);?>
<?php $_smarty_tpl->smarty->_tag_stack[] = array('form_field', array('field'=>"children")); $_block_repeat=true; echo $_smarty_tpl->smarty->registered_plugins['block']['form_field'][0][0]->renderFormField(array('field'=>"children"), null, $_smarty_tpl, $_block_repeat);while ($_block_repeat) { ob_start();?>
<div class="form-group col-md-2<?php if ($_smarty_tpl->tpl_vars['error']->value) {?> has-error<?php }?>">
<label class="control-label" for="<?php echo TheliaSmarty\Template\SmartyParser::theliaEscape($_smarty_tpl->tpl_vars['label_attr']->value['for'],$_smarty_tpl);?>
"><i class="fa fa-child"></i> <?php echo TheliaSmarty\Template\SmartyParser::theliaEscape($_smarty_tpl->tpl_vars['label']->value,$_smarty_tpl);?>
<?php if ($_smarty_tpl->tpl_vars['required']->value) {?> <span class="required">*</span><?php }?></label>
<div class="control-input">
<select name="<?php echo TheliaSmarty\Template\SmartyParser::theliaEscape($_smarty_tpl->tpl_vars['name']->value,$_smarty_tpl);?>
" id="<?php echo TheliaSmarty\Template\SmartyParser::theliaEscape($_smarty_tpl->tpl_vars['label_attr']->value['for'],$_smarty_tpl);?>
" class=" form-control" <?php if ($_smarty_tpl->tpl_vars['required']->value) {?> aria-required="true" required<?php }?><?php if (!$_smarty_tpl->tpl_vars['error_focus']->value&&$_smarty_tpl->tpl_vars['error']->value) {?> autofocus<?php }?>>
<?php $_smarty_tpl->tpl_vars['idx'] = new Smarty_Variable;$_smarty_tpl->tpl_vars['idx']->step = 1;$_smarty_tpl->tpl_vars['idx']->total = (int) ceil(($_smarty_tpl->tpl_vars['idx']->step > 0 ? 5+1 - (0) : 0-(5)+1)/abs($_smarty_tpl->tpl_vars['idx']->step));
if ($_smarty_tpl->tpl_vars['idx']->total > 0) {
for ($_smarty_tpl->tpl_vars['idx']->value = 0, $_smarty_tpl->tpl_vars['idx']->iteration = 1;$_smarty_tpl->tpl_vars['idx']->iteration <= $_smarty_tpl->tpl_vars['idx']->total;$_smarty_tpl->tpl_vars['idx']->value += $_smarty_tpl->tpl_vars['idx']->step, $_smarty_tpl->tpl_vars['idx']->iteration++) {
$_smarty_tpl->tpl_vars['idx']->first = $_smarty_tpl->tpl_vars['idx']->iteration == 1;$_smarty_tpl->tpl_vars['idx']->last = $_smarty_tpl->tpl_vars['idx']->iteration == $_smarty_tpl->tpl_vars['idx']->total;?>
<option value="<?php echo TheliaSmarty\Template\SmartyParser::theliaEscape($_smarty_tpl->tpl_vars['idx']->value,$_smarty_tpl);?>
"<?php if ($_smarty_tpl->tpl_vars['value']->value==$_smarty_tpl->tpl_vars['idx']->value) {?> selected<?php }?>><?php if ($_smarty_tpl->tpl_vars['idx']->value==0) {?><?php echo $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['intl'][0][0]->translate(array('l'=>"Aucun"),$_smarty_tpl);?>
<?php } else { ?><?php echo TheliaSmarty\Template\SmartyParser::theliaEscape($_smarty_tpl->tpl_vars['idx']->value,$_smarty_tpl);?>
<?php }?></option>
<?php }} ?>
</select>
<?php if ($_smarty_tpl->tpl_vars['error']->value) {?>
<span class="help-block"><?php echo TheliaSmarty\Template\SmartyParser::theliaEscape($_smarty_tpl->tpl_vars['message']->value,$_smarty_tpl);?>
</span>
<?php $_smarty_tpl->tpl_vars['error_focus'] = new Smarty_variable(true, null, 0);?>
<?php }?>
</div>
</div>
<?php $_block_content = ob_get_clean(); $_block_repeat=false; echo $_smarty_tpl->smarty->registered_plugins['block']['form_field'][0][0]->renderFormField(array('field'=>"children"), $_block_content, $_smarty_tpl, $_block_repeat); } array_pop($_smarty_tpl->smarty->_tag_stack);?>
<div class="col-md-2">
<button type="submit" class="btn btn-primary" id="book-now"><?php echo $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['intl'][0][0]->translate(array('l'=>"Réserver maintenant"),$_smarty_tpl);?>
</button>
</div>
</div>
</form>
<?php $_block_content = ob_get_clean(); $_block_repeat=false; echo $_smarty_tpl->smarty->registered_plugins['block']['form'][0][0]->generateForm(array('name'=>"beds24.form.search"), $_block_content, $_smarty_tpl, $_block_repeat); } array_pop($_smarty_tpl->smarty->_tag_stack);?>
<div id="beds24-search-results">
</div>
</div>
<?php }} ?>

View File

@@ -0,0 +1,83 @@
<?php /* Smarty version Smarty-3.1.20, created on 2021-03-23 12:37:18
compiled from "/Volumes/Dev/Sources/Clients/apartmoment/site_web/templates/frontOffice/am/modules/HookLinks/main-footer-body.html" */ ?>
<?php /*%%SmartyHeaderCode:4847434136059d2ee963554-02461313%%*/if(!defined('SMARTY_DIR')) exit('no direct access allowed');
$_valid = $_smarty_tpl->decodeProperties(array (
'file_dependency' =>
array (
'cc1bb70f9a8e2a79af433614228a2aace5ea9b94' =>
array (
0 => '/Volumes/Dev/Sources/Clients/apartmoment/site_web/templates/frontOffice/am/modules/HookLinks/main-footer-body.html',
1 => 1613761751,
2 => 'file',
),
),
'nocache_hash' => '4847434136059d2ee963554-02461313',
'function' =>
array (
),
'variables' =>
array (
'URL' => 0,
'TITLE' => 0,
),
'has_nocache_code' => false,
'version' => 'Smarty-3.1.20',
'unifunc' => 'content_6059d2ee9cf4a9_97205891',
),false); /*/%%SmartyHeaderCode%%*/?>
<?php if ($_valid && !is_callable('content_6059d2ee9cf4a9_97205891')) {function content_6059d2ee9cf4a9_97205891($_smarty_tpl) {?><ul>
<?php $_smarty_tpl->smarty->_tag_stack[] = array('loop', array('type'=>"content",'name'=>"cgv",'id'=>20)); $_block_repeat=true; echo $_smarty_tpl->smarty->registered_plugins['block']['loop'][0][0]->theliaLoop(array('type'=>"content",'name'=>"cgv",'id'=>20), null, $_smarty_tpl, $_block_repeat);while ($_block_repeat) { ob_start();?>
<li><a href="<?php echo TheliaSmarty\Template\SmartyParser::theliaEscape($_smarty_tpl->tpl_vars['URL']->value,$_smarty_tpl);?>
"><?php echo $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['intl'][0][0]->translate(array('l'=>"Conditions Générales de Vente"),$_smarty_tpl);?>
</a></li>
<?php $_block_content = ob_get_clean(); $_block_repeat=false; echo $_smarty_tpl->smarty->registered_plugins['block']['loop'][0][0]->theliaLoop(array('type'=>"content",'name'=>"cgv",'id'=>20), $_block_content, $_smarty_tpl, $_block_repeat); } array_pop($_smarty_tpl->smarty->_tag_stack);?>
<?php $_smarty_tpl->smarty->_tag_stack[] = array('loop', array('type'=>"content",'name'=>"groupe",'id'=>21)); $_block_repeat=true; echo $_smarty_tpl->smarty->registered_plugins['block']['loop'][0][0]->theliaLoop(array('type'=>"content",'name'=>"groupe",'id'=>21), null, $_smarty_tpl, $_block_repeat);while ($_block_repeat) { ob_start();?>
<li><a href="<?php echo TheliaSmarty\Template\SmartyParser::theliaEscape($_smarty_tpl->tpl_vars['URL']->value,$_smarty_tpl);?>
"><?php echo $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['intl'][0][0]->translate(array('l'=>"Groupe"),$_smarty_tpl);?>
</a></li>
<?php $_block_content = ob_get_clean(); $_block_repeat=false; echo $_smarty_tpl->smarty->registered_plugins['block']['loop'][0][0]->theliaLoop(array('type'=>"content",'name'=>"groupe",'id'=>21), $_block_content, $_smarty_tpl, $_block_repeat); } array_pop($_smarty_tpl->smarty->_tag_stack);?>
<?php $_smarty_tpl->smarty->_tag_stack[] = array('loop', array('type'=>"content",'name'=>"pro",'id'=>22)); $_block_repeat=true; echo $_smarty_tpl->smarty->registered_plugins['block']['loop'][0][0]->theliaLoop(array('type'=>"content",'name'=>"pro",'id'=>22), null, $_smarty_tpl, $_block_repeat);while ($_block_repeat) { ob_start();?>
<li><a href="<?php echo TheliaSmarty\Template\SmartyParser::theliaEscape($_smarty_tpl->tpl_vars['URL']->value,$_smarty_tpl);?>
"><?php echo $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['intl'][0][0]->translate(array('l'=>"Pro"),$_smarty_tpl);?>
</a></li>
<?php $_block_content = ob_get_clean(); $_block_repeat=false; echo $_smarty_tpl->smarty->registered_plugins['block']['loop'][0][0]->theliaLoop(array('type'=>"content",'name'=>"pro",'id'=>22), $_block_content, $_smarty_tpl, $_block_repeat); } array_pop($_smarty_tpl->smarty->_tag_stack);?>
<?php $_smarty_tpl->smarty->_tag_stack[] = array('loop', array('name'=>"footer_links",'type'=>"content",'folder'=>"2")); $_block_repeat=true; echo $_smarty_tpl->smarty->registered_plugins['block']['loop'][0][0]->theliaLoop(array('name'=>"footer_links",'type'=>"content",'folder'=>"2"), null, $_smarty_tpl, $_block_repeat);while ($_block_repeat) { ob_start();?>
<li><a href="<?php echo TheliaSmarty\Template\SmartyParser::theliaEscape($_smarty_tpl->tpl_vars['URL']->value,$_smarty_tpl);?>
"><?php echo TheliaSmarty\Template\SmartyParser::theliaEscape($_smarty_tpl->tpl_vars['TITLE']->value,$_smarty_tpl);?>
</a></li>
<?php $_block_content = ob_get_clean(); $_block_repeat=false; echo $_smarty_tpl->smarty->registered_plugins['block']['loop'][0][0]->theliaLoop(array('name'=>"footer_links",'type'=>"content",'folder'=>"2"), $_block_content, $_smarty_tpl, $_block_repeat); } array_pop($_smarty_tpl->smarty->_tag_stack);?>
<?php $_smarty_tpl->smarty->_tag_stack[] = array('loop', array('type'=>"auth",'name'=>"customer_is_logged",'role'=>"CUSTOMER")); $_block_repeat=true; echo $_smarty_tpl->smarty->registered_plugins['block']['loop'][0][0]->theliaLoop(array('type'=>"auth",'name'=>"customer_is_logged",'role'=>"CUSTOMER"), null, $_smarty_tpl, $_block_repeat);while ($_block_repeat) { ob_start();?>
<li><a href="<?php echo $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['url'][0][0]->generateUrlFunction(array('path'=>"/logout"),$_smarty_tpl);?>
" class="logout"><?php echo $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['intl'][0][0]->translate(array('l'=>"Log out!",'d'=>"hooklinks.fo.default"),$_smarty_tpl);?>
</a></li>
<li><a href="<?php echo $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['url'][0][0]->generateUrlFunction(array('path'=>"/account"),$_smarty_tpl);?>
" class="account"><?php echo $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['intl'][0][0]->translate(array('l'=>"My Account",'d'=>"hooklinks.fo.default"),$_smarty_tpl);?>
</a></li>
<?php $_block_content = ob_get_clean(); $_block_repeat=false; echo $_smarty_tpl->smarty->registered_plugins['block']['loop'][0][0]->theliaLoop(array('type'=>"auth",'name'=>"customer_is_logged",'role'=>"CUSTOMER"), $_block_content, $_smarty_tpl, $_block_repeat); } array_pop($_smarty_tpl->smarty->_tag_stack);?>
<?php $_smarty_tpl->smarty->_tag_stack[] = array('elseloop', array('rel'=>"customer_is_logged")); $_block_repeat=true; echo $_smarty_tpl->smarty->registered_plugins['block']['elseloop'][0][0]->theliaElseloop(array('rel'=>"customer_is_logged"), null, $_smarty_tpl, $_block_repeat);while ($_block_repeat) { ob_start();?>
<li><a href="<?php echo $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['url'][0][0]->generateUrlFunction(array('path'=>"/login"),$_smarty_tpl);?>
"><?php echo $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['intl'][0][0]->translate(array('l'=>"Login",'d'=>"hooklinks.fo.default"),$_smarty_tpl);?>
</a></li>
<li><a href="<?php echo $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['url'][0][0]->generateUrlFunction(array('path'=>"/register"),$_smarty_tpl);?>
"><?php echo $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['intl'][0][0]->translate(array('l'=>"Register",'d'=>"hooklinks.fo.default"),$_smarty_tpl);?>
</a></li>
<?php $_block_content = ob_get_clean(); $_block_repeat=false; echo $_smarty_tpl->smarty->registered_plugins['block']['elseloop'][0][0]->theliaElseloop(array('rel'=>"customer_is_logged"), $_block_content, $_smarty_tpl, $_block_repeat); } array_pop($_smarty_tpl->smarty->_tag_stack);?>
<li><a href="<?php echo $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['url'][0][0]->generateUrlFunction(array('path'=>"/cart"),$_smarty_tpl);?>
"><?php echo $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['intl'][0][0]->translate(array('l'=>"Cart",'d'=>"hooklinks.fo.default"),$_smarty_tpl);?>
</a></li>
<li><a href="<?php echo $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['url'][0][0]->generateUrlFunction(array('path'=>"/order/delivery"),$_smarty_tpl);?>
"><?php echo $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['intl'][0][0]->translate(array('l'=>"Checkout",'d'=>"hooklinks.fo.default"),$_smarty_tpl);?>
</a></li>
</ul>
<?php }} ?>

View File

@@ -0,0 +1,129 @@
<?php /* Smarty version Smarty-3.1.20, created on 2021-03-23 12:37:10
compiled from "/Volumes/Dev/Sources/Clients/apartmoment/site_web/templates/frontOffice/am/modules/HookProductsNew/home-body.html" */ ?>
<?php /*%%SmartyHeaderCode:17687942736059d2e653dee4-96763937%%*/if(!defined('SMARTY_DIR')) exit('no direct access allowed');
$_valid = $_smarty_tpl->decodeProperties(array (
'file_dependency' =>
array (
'd81c328f6d9667c0257263a599e0717f3e65366d' =>
array (
0 => '/Volumes/Dev/Sources/Clients/apartmoment/site_web/templates/frontOffice/am/modules/HookProductsNew/home-body.html',
1 => 1613761751,
2 => 'file',
),
),
'nocache_hash' => '17687942736059d2e653dee4-96763937',
'function' =>
array (
),
'variables' =>
array (
'ID' => 0,
'TITLE' => 0,
'product_id' => 0,
'URL' => 0,
'IMAGE_URL' => 0,
'LOOP_COUNT' => 0,
'CHAPO' => 0,
'DEFAULT_CATEGORY' => 0,
'BEST_TAXED_PRICE' => 0,
),
'has_nocache_code' => false,
'version' => 'Smarty-3.1.20',
'unifunc' => 'content_6059d2e65c72a6_28957512',
),false); /*/%%SmartyHeaderCode%%*/?>
<?php if ($_valid && !is_callable('content_6059d2e65c72a6_28957512')) {function content_6059d2e65c72a6_28957512($_smarty_tpl) {?><?php $_smarty_tpl->smarty->_tag_stack[] = array('ifloop', array('rel'=>"product_new")); $_block_repeat=true; echo $_smarty_tpl->smarty->registered_plugins['block']['ifloop'][0][0]->theliaIfLoop(array('rel'=>"product_new"), null, $_smarty_tpl, $_block_repeat);while ($_block_repeat) { ob_start();?>
<section id="products-new">
<div class="products-heading">
<!--<h2><?php echo $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['intl'][0][0]->translate(array('l'=>"Latest",'d'=>"hookproductsnew.fo.default"),$_smarty_tpl);?>
<a href="<?php echo $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['url'][0][0]->generateUrlFunction(array('path'=>"/view_all",'type'=>"new"),$_smarty_tpl);?>
" class="btn-all"><?php echo $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['intl'][0][0]->translate(array('l'=>"+ View All",'d'=>"hookproductsnew.fo.default"),$_smarty_tpl);?>
</a></h2>-->
</div>
<div class="products-content">
<ul class="list-unstyled products-grid row">
<?php $_smarty_tpl->smarty->_tag_stack[] = array('loop', array('name'=>"product_new",'type'=>"product",'limit'=>"6",'new'=>"yes")); $_block_repeat=true; echo $_smarty_tpl->smarty->registered_plugins['block']['loop'][0][0]->theliaLoop(array('name'=>"product_new",'type'=>"product",'limit'=>"6",'new'=>"yes"), null, $_smarty_tpl, $_block_repeat);while ($_block_repeat) { ob_start();?>
<li class="item col-md-4 col-sm-4">
<article itemscope itemtype="http://schema.org/Product">
<!-- Use the meta tag to specify content that is not visible on the page in any way -->
<?php $_smarty_tpl->tpl_vars['product_id'] = new Smarty_variable($_smarty_tpl->tpl_vars['ID']->value, null, 0);?>
<?php $_smarty_tpl->smarty->_tag_stack[] = array('loop', array('name'=>"brand.feature",'type'=>"feature",'product'=>((string)$_smarty_tpl->tpl_vars['ID']->value),'title'=>"brand")); $_block_repeat=true; echo $_smarty_tpl->smarty->registered_plugins['block']['loop'][0][0]->theliaLoop(array('name'=>"brand.feature",'type'=>"feature",'product'=>((string)$_smarty_tpl->tpl_vars['ID']->value),'title'=>"brand"), null, $_smarty_tpl, $_block_repeat);while ($_block_repeat) { ob_start();?>
<?php $_smarty_tpl->smarty->_tag_stack[] = array('loop', array('name'=>"brand.value",'type'=>"feature_value",'feature'=>((string)$_smarty_tpl->tpl_vars['ID']->value),'product'=>((string)$_smarty_tpl->tpl_vars['product_id']->value))); $_block_repeat=true; echo $_smarty_tpl->smarty->registered_plugins['block']['loop'][0][0]->theliaLoop(array('name'=>"brand.value",'type'=>"feature_value",'feature'=>((string)$_smarty_tpl->tpl_vars['ID']->value),'product'=>((string)$_smarty_tpl->tpl_vars['product_id']->value)), null, $_smarty_tpl, $_block_repeat);while ($_block_repeat) { ob_start();?>
<meta itemprop="brand" content="<?php echo TheliaSmarty\Template\SmartyParser::theliaEscape($_smarty_tpl->tpl_vars['TITLE']->value,$_smarty_tpl);?>
">
<?php $_block_content = ob_get_clean(); $_block_repeat=false; echo $_smarty_tpl->smarty->registered_plugins['block']['loop'][0][0]->theliaLoop(array('name'=>"brand.value",'type'=>"feature_value",'feature'=>((string)$_smarty_tpl->tpl_vars['ID']->value),'product'=>((string)$_smarty_tpl->tpl_vars['product_id']->value)), $_block_content, $_smarty_tpl, $_block_repeat); } array_pop($_smarty_tpl->smarty->_tag_stack);?>
<?php $_block_content = ob_get_clean(); $_block_repeat=false; echo $_smarty_tpl->smarty->registered_plugins['block']['loop'][0][0]->theliaLoop(array('name'=>"brand.feature",'type'=>"feature",'product'=>((string)$_smarty_tpl->tpl_vars['ID']->value),'title'=>"brand"), $_block_content, $_smarty_tpl, $_block_repeat); } array_pop($_smarty_tpl->smarty->_tag_stack);?>
<?php $_smarty_tpl->smarty->_tag_stack[] = array('loop', array('name'=>"brand.feature",'type'=>"feature",'product'=>$_smarty_tpl->tpl_vars['ID']->value,'title'=>"isbn")); $_block_repeat=true; echo $_smarty_tpl->smarty->registered_plugins['block']['loop'][0][0]->theliaLoop(array('name'=>"brand.feature",'type'=>"feature",'product'=>$_smarty_tpl->tpl_vars['ID']->value,'title'=>"isbn"), null, $_smarty_tpl, $_block_repeat);while ($_block_repeat) { ob_start();?>
<?php $_smarty_tpl->smarty->_tag_stack[] = array('loop', array('name'=>"brand.value",'type'=>"feature_value",'feature'=>$_smarty_tpl->tpl_vars['ID']->value,'product'=>$_smarty_tpl->tpl_vars['product_id']->value)); $_block_repeat=true; echo $_smarty_tpl->smarty->registered_plugins['block']['loop'][0][0]->theliaLoop(array('name'=>"brand.value",'type'=>"feature_value",'feature'=>$_smarty_tpl->tpl_vars['ID']->value,'product'=>$_smarty_tpl->tpl_vars['product_id']->value), null, $_smarty_tpl, $_block_repeat);while ($_block_repeat) { ob_start();?>
<meta itemprop="productID" content="isbn:<?php echo TheliaSmarty\Template\SmartyParser::theliaEscape($_smarty_tpl->tpl_vars['TITLE']->value,$_smarty_tpl);?>
">
<?php $_block_content = ob_get_clean(); $_block_repeat=false; echo $_smarty_tpl->smarty->registered_plugins['block']['loop'][0][0]->theliaLoop(array('name'=>"brand.value",'type'=>"feature_value",'feature'=>$_smarty_tpl->tpl_vars['ID']->value,'product'=>$_smarty_tpl->tpl_vars['product_id']->value), $_block_content, $_smarty_tpl, $_block_repeat); } array_pop($_smarty_tpl->smarty->_tag_stack);?>
<?php $_block_content = ob_get_clean(); $_block_repeat=false; echo $_smarty_tpl->smarty->registered_plugins['block']['loop'][0][0]->theliaLoop(array('name'=>"brand.feature",'type'=>"feature",'product'=>$_smarty_tpl->tpl_vars['ID']->value,'title'=>"isbn"), $_block_content, $_smarty_tpl, $_block_repeat); } array_pop($_smarty_tpl->smarty->_tag_stack);?>
<a href="<?php echo TheliaSmarty\Template\SmartyParser::theliaEscape($_smarty_tpl->tpl_vars['URL']->value,$_smarty_tpl);?>
" itemprop="url" tabindex="-1" class="product-image overlay">
<?php $_smarty_tpl->smarty->_tag_stack[] = array('ifloop', array('rel'=>"image_product_new")); $_block_repeat=true; echo $_smarty_tpl->smarty->registered_plugins['block']['ifloop'][0][0]->theliaIfLoop(array('rel'=>"image_product_new"), null, $_smarty_tpl, $_block_repeat);while ($_block_repeat) { ob_start();?>
<img itemprop="image" class="img-responsive center-block"
<?php $_smarty_tpl->smarty->_tag_stack[] = array('loop', array('name'=>"image_product_new",'type'=>"image",'limit'=>"1",'product'=>((string)$_smarty_tpl->tpl_vars['ID']->value),'force_return'=>"true",'width'=>"478",'height'=>"290",'resize_mode'=>"crop")); $_block_repeat=true; echo $_smarty_tpl->smarty->registered_plugins['block']['loop'][0][0]->theliaLoop(array('name'=>"image_product_new",'type'=>"image",'limit'=>"1",'product'=>((string)$_smarty_tpl->tpl_vars['ID']->value),'force_return'=>"true",'width'=>"478",'height'=>"290",'resize_mode'=>"crop"), null, $_smarty_tpl, $_block_repeat);while ($_block_repeat) { ob_start();?>
src="<?php echo TheliaSmarty\Template\SmartyParser::theliaEscape($_smarty_tpl->tpl_vars['IMAGE_URL']->value,$_smarty_tpl);?>
"
<?php $_block_content = ob_get_clean(); $_block_repeat=false; echo $_smarty_tpl->smarty->registered_plugins['block']['loop'][0][0]->theliaLoop(array('name'=>"image_product_new",'type'=>"image",'limit'=>"1",'product'=>((string)$_smarty_tpl->tpl_vars['ID']->value),'force_return'=>"true",'width'=>"478",'height'=>"290",'resize_mode'=>"crop"), $_block_content, $_smarty_tpl, $_block_repeat); } array_pop($_smarty_tpl->smarty->_tag_stack);?>
alt="Product #<?php echo TheliaSmarty\Template\SmartyParser::theliaEscape($_smarty_tpl->tpl_vars['LOOP_COUNT']->value,$_smarty_tpl);?>
" >
<?php $_block_content = ob_get_clean(); $_block_repeat=false; echo $_smarty_tpl->smarty->registered_plugins['block']['ifloop'][0][0]->theliaIfLoop(array('rel'=>"image_product_new"), $_block_content, $_smarty_tpl, $_block_repeat); } array_pop($_smarty_tpl->smarty->_tag_stack);?>
<?php $_smarty_tpl->smarty->_tag_stack[] = array('elseloop', array('rel'=>"image_product_new")); $_block_repeat=true; echo $_smarty_tpl->smarty->registered_plugins['block']['elseloop'][0][0]->theliaElseloop(array('rel'=>"image_product_new"), null, $_smarty_tpl, $_block_repeat);while ($_block_repeat) { ob_start();?>
<img itemprop="image" class="img-responsive center-block" src="<?php echo $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['image'][0][0]->functionImage(array('file'=>'assets/dist/img/280x196.png'),$_smarty_tpl);?>
" alt="Product #<?php echo TheliaSmarty\Template\SmartyParser::theliaEscape($_smarty_tpl->tpl_vars['LOOP_COUNT']->value,$_smarty_tpl);?>
">
<?php $_block_content = ob_get_clean(); $_block_repeat=false; echo $_smarty_tpl->smarty->registered_plugins['block']['elseloop'][0][0]->theliaElseloop(array('rel'=>"image_product_new"), $_block_content, $_smarty_tpl, $_block_repeat); } array_pop($_smarty_tpl->smarty->_tag_stack);?>
</a>
<a href="<?php echo TheliaSmarty\Template\SmartyParser::theliaEscape($_smarty_tpl->tpl_vars['URL']->value,$_smarty_tpl);?>
" class="product-info">
<h3 class="name"><span itemprop="name"><?php echo TheliaSmarty\Template\SmartyParser::theliaEscape($_smarty_tpl->tpl_vars['TITLE']->value,$_smarty_tpl);?>
</span></h3>
<div class="short-description" itemprop="description"><?php echo TheliaSmarty\Template\SmartyParser::theliaEscape($_smarty_tpl->tpl_vars['CHAPO']->value,$_smarty_tpl);?>
</div>
<div class="product-price">
<div class="price-container" itemprop="offers" itemscope itemtype="http://schema.org/Offer">
<?php $_smarty_tpl->smarty->_tag_stack[] = array('loop', array('type'=>"category",'name'=>"category_tag",'id'=>$_smarty_tpl->tpl_vars['DEFAULT_CATEGORY']->value)); $_block_repeat=true; echo $_smarty_tpl->smarty->registered_plugins['block']['loop'][0][0]->theliaLoop(array('type'=>"category",'name'=>"category_tag",'id'=>$_smarty_tpl->tpl_vars['DEFAULT_CATEGORY']->value), null, $_smarty_tpl, $_block_repeat);while ($_block_repeat) { ob_start();?>
<meta itemprop="category" content="<?php echo TheliaSmarty\Template\SmartyParser::theliaEscape($_smarty_tpl->tpl_vars['TITLE']->value,$_smarty_tpl);?>
">
<?php $_block_content = ob_get_clean(); $_block_repeat=false; echo $_smarty_tpl->smarty->registered_plugins['block']['loop'][0][0]->theliaLoop(array('type'=>"category",'name'=>"category_tag",'id'=>$_smarty_tpl->tpl_vars['DEFAULT_CATEGORY']->value), $_block_content, $_smarty_tpl, $_block_repeat); } array_pop($_smarty_tpl->smarty->_tag_stack);?>
<meta itemprop="itemCondition" itemscope itemtype="http://schema.org/NewCondition">
<meta itemprop="priceCurrency" content="<?php echo $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['currency'][0][0]->currencyDataAccess(array('attr'=>"code"),$_smarty_tpl);?>
">
<link itemprop="availability" href="http://schema.org/InStock" content="in_stock" />
<span class="regular-price"><span itemprop="price" class="price"><?php echo $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['format_money'][0][0]->formatMoney(array('number'=>$_smarty_tpl->tpl_vars['BEST_TAXED_PRICE']->value),$_smarty_tpl);?>
</span></span>
</div>
</div>
</a>
</article><!-- /product -->
</li>
<?php $_block_content = ob_get_clean(); $_block_repeat=false; echo $_smarty_tpl->smarty->registered_plugins['block']['loop'][0][0]->theliaLoop(array('name'=>"product_new",'type'=>"product",'limit'=>"6",'new'=>"yes"), $_block_content, $_smarty_tpl, $_block_repeat); } array_pop($_smarty_tpl->smarty->_tag_stack);?>
</ul>
</div>
</section><!-- #products-new -->
<?php $_block_content = ob_get_clean(); $_block_repeat=false; echo $_smarty_tpl->smarty->registered_plugins['block']['ifloop'][0][0]->theliaIfLoop(array('rel'=>"product_new"), $_block_content, $_smarty_tpl, $_block_repeat); } array_pop($_smarty_tpl->smarty->_tag_stack);?>
<?php }} ?>

View File

@@ -0,0 +1,36 @@
<?php /* Smarty version Smarty-3.1.20, created on 2021-03-23 12:37:13
compiled from "/Volumes/Dev/Sources/Clients/apartmoment/site_web/local/modules/HookComments/templates/frontOffice/default/home-body.html" */ ?>
<?php /*%%SmartyHeaderCode:18426931226059d2e9d2cbd6-69160335%%*/if(!defined('SMARTY_DIR')) exit('no direct access allowed');
$_valid = $_smarty_tpl->decodeProperties(array (
'file_dependency' =>
array (
'e45fd464fcc383da259cdbb01636e39836a0fcc1' =>
array (
0 => '/Volumes/Dev/Sources/Clients/apartmoment/site_web/local/modules/HookComments/templates/frontOffice/default/home-body.html',
1 => 1613761621,
2 => 'file',
),
),
'nocache_hash' => '18426931226059d2e9d2cbd6-69160335',
'function' =>
array (
),
'variables' =>
array (
'IMAGE_URL' => 0,
),
'has_nocache_code' => false,
'version' => 'Smarty-3.1.20',
'unifunc' => 'content_6059d2e9d3bc94_25727620',
),false); /*/%%SmartyHeaderCode%%*/?>
<?php if ($_valid && !is_callable('content_6059d2e9d3bc94_25727620')) {function content_6059d2e9d3bc94_25727620($_smarty_tpl) {?><section>
<div style="margin-bottom: 2rem;">
<?php $_smarty_tpl->smarty->_tag_stack[] = array('loop', array('type'=>"image",'name'=>"comments",'source'=>"module",'source_id'=>35)); $_block_repeat=true; echo $_smarty_tpl->smarty->registered_plugins['block']['loop'][0][0]->theliaLoop(array('type'=>"image",'name'=>"comments",'source'=>"module",'source_id'=>35), null, $_smarty_tpl, $_block_repeat);while ($_block_repeat) { ob_start();?>
<img class="img-responsive" src="<?php echo TheliaSmarty\Template\SmartyParser::theliaEscape($_smarty_tpl->tpl_vars['IMAGE_URL']->value,$_smarty_tpl);?>
" alt="Apart'Moment - satisfaction clients - avis positifs"/>
<?php $_block_content = ob_get_clean(); $_block_repeat=false; echo $_smarty_tpl->smarty->registered_plugins['block']['loop'][0][0]->theliaLoop(array('type'=>"image",'name'=>"comments",'source'=>"module",'source_id'=>35), $_block_content, $_smarty_tpl, $_block_repeat); } array_pop($_smarty_tpl->smarty->_tag_stack);?>
</div>
</section>
<?php }} ?>

BIN
commits-2.3.3.ods Normal file

Binary file not shown.

99
composer.json Normal file
View File

@@ -0,0 +1,99 @@
{
"name": "thelia/thelia",
"description": "Thelia is an ecommerce CMS.",
"license": "LGPL-3.0+",
"homepage": "http://thelia.net/",
"keywords": [
"ecommerce",
"cms",
"cms ecommerce",
"ecommerce cms"
],
"support": {
"forum": "http://thelia.net/forum",
"wiki": "http://doc.thelia.net"
},
"repositories": [
{
"type": "vcs",
"url": "https://github.com/thelia/Propel2"
}
],
"require": {
"php": ">=5.5",
"ircmaxell/password-compat": "1.0.*",
"psr/log": "1.0",
"symfony/config": "2.8.*",
"symfony/console": "2.8.*",
"symfony/dependency-injection": "2.8.*",
"symfony/event-dispatcher": "2.8.*",
"symfony/http-kernel": "2.8.*",
"symfony/routing": "2.8.*",
"symfony/filesystem": "2.8.*",
"symfony/yaml": "2.8.*",
"symfony/translation": "2.8.*",
"symfony-cmf/routing": "1.3.*",
"symfony/validator": "2.8.*",
"symfony/options-resolver": "2.8.*",
"symfony/security": "2.8.*",
"symfony/expression-language": "2.8.*",
"symfony/process": "2.8.*",
"symfony/dom-crawler": "2.8.*",
"symfony/property-access": "2.8.*",
"symfony/serializer": "2.8.*",
"ensepar/html2pdf": "1.0.1",
"symfony/finder": "2.8.*",
"symfony/browser-kit": "2.8.*",
"symfony/http-foundation": "2.8.*",
"symfony/form": "2.8.*",
"symfony/class-loader": "2.8.*",
"symfony/icu": "1.0",
"stack/builder": "1.0.*",
"thelia/currency-converter": "~1.0",
"doctrine/cache": "1.5.*",
"kriswallsmith/assetic": "1.3.*",
"ptachoire/cssembed": "1.0.*",
"simplepie/simplepie": "1.3.*",
"imagine/imagine": "0.6.*",
"swiftmailer/swiftmailer": "5.4.*",
"oyejorge/less.php": "1.7.*",
"michelf/php-markdown": "1.6.*",
"smarty/smarty": "3.1.20",
"ramsey/array_column": "~1.1",
"propel/propel": "dev-thelia-2.3",
"commerceguys/addressing": "0.8.*",
"symfony/cache": "~3.1.0"
},
"require-dev": {
"fzaninotto/faker": "1.5.*",
"thelia/hooktest-module": "~1.1",
"thelia/hooktest-template": "~1.1",
"phpunit/phpunit": "4.8.*"
},
"minimum-stability": "stable",
"config": {
"vendor-dir": "core/vendor",
"bin-dir": "bin"
},
"autoload": {
"psr-4": {
"Thelia\\": "core/lib/Thelia"
},
"psr-0": {
"": "local/modules/"
},
"files": [
"core/bootstrap.php"
]
},
"autoload-dev": {
"psr-4": {
"Thelia\\Tests\\" : "tests/phpunit/Thelia/Tests"
}
},
"extra": {
"branch-alias": {
"dev-master": "2.3-dev"
}
}
}

4364
composer.lock generated Normal file

File diff suppressed because it is too large Load Diff

BIN
composer.phar Normal file

Binary file not shown.

165
core/LICENSE.txt Normal file
View File

@@ -0,0 +1,165 @@
GNU LESSER GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
This version of the GNU Lesser General Public License incorporates
the terms and conditions of version 3 of the GNU General Public
License, supplemented by the additional permissions listed below.
0. Additional Definitions.
As used herein, "this License" refers to version 3 of the GNU Lesser
General Public License, and the "GNU GPL" refers to version 3 of the GNU
General Public License.
"The Library" refers to a covered work governed by this License,
other than an Application or a Combined Work as defined below.
An "Application" is any work that makes use of an interface provided
by the Library, but which is not otherwise based on the Library.
Defining a subclass of a class defined by the Library is deemed a mode
of using an interface provided by the Library.
A "Combined Work" is a work produced by combining or linking an
Application with the Library. The particular version of the Library
with which the Combined Work was made is also called the "Linked
Version".
The "Minimal Corresponding Source" for a Combined Work means the
Corresponding Source for the Combined Work, excluding any source code
for portions of the Combined Work that, considered in isolation, are
based on the Application, and not on the Linked Version.
The "Corresponding Application Code" for a Combined Work means the
object code and/or source code for the Application, including any data
and utility programs needed for reproducing the Combined Work from the
Application, but excluding the System Libraries of the Combined Work.
1. Exception to Section 3 of the GNU GPL.
You may convey a covered work under sections 3 and 4 of this License
without being bound by section 3 of the GNU GPL.
2. Conveying Modified Versions.
If you modify a copy of the Library, and, in your modifications, a
facility refers to a function or data to be supplied by an Application
that uses the facility (other than as an argument passed when the
facility is invoked), then you may convey a copy of the modified
version:
a) under this License, provided that you make a good faith effort to
ensure that, in the event an Application does not supply the
function or data, the facility still operates, and performs
whatever part of its purpose remains meaningful, or
b) under the GNU GPL, with none of the additional permissions of
this License applicable to that copy.
3. Object Code Incorporating Material from Library Header Files.
The object code form of an Application may incorporate material from
a header file that is part of the Library. You may convey such object
code under terms of your choice, provided that, if the incorporated
material is not limited to numerical parameters, data structure
layouts and accessors, or small macros, inline functions and templates
(ten or fewer lines in length), you do both of the following:
a) Give prominent notice with each copy of the object code that the
Library is used in it and that the Library and its use are
covered by this License.
b) Accompany the object code with a copy of the GNU GPL and this license
document.
4. Combined Works.
You may convey a Combined Work under terms of your choice that,
taken together, effectively do not restrict modification of the
portions of the Library contained in the Combined Work and reverse
engineering for debugging such modifications, if you also do each of
the following:
a) Give prominent notice with each copy of the Combined Work that
the Library is used in it and that the Library and its use are
covered by this License.
b) Accompany the Combined Work with a copy of the GNU GPL and this license
document.
c) For a Combined Work that displays copyright notices during
execution, include the copyright notice for the Library among
these notices, as well as a reference directing the user to the
copies of the GNU GPL and this license document.
d) Do one of the following:
0) Convey the Minimal Corresponding Source under the terms of this
License, and the Corresponding Application Code in a form
suitable for, and under terms that permit, the user to
recombine or relink the Application with a modified version of
the Linked Version to produce a modified Combined Work, in the
manner specified by section 6 of the GNU GPL for conveying
Corresponding Source.
1) Use a suitable shared library mechanism for linking with the
Library. A suitable mechanism is one that (a) uses at run time
a copy of the Library already present on the user's computer
system, and (b) will operate properly with a modified version
of the Library that is interface-compatible with the Linked
Version.
e) Provide Installation Information, but only if you would otherwise
be required to provide such information under section 6 of the
GNU GPL, and only to the extent that such information is
necessary to install and execute a modified version of the
Combined Work produced by recombining or relinking the
Application with a modified version of the Linked Version. (If
you use option 4d0, the Installation Information must accompany
the Minimal Corresponding Source and Corresponding Application
Code. If you use option 4d1, you must provide the Installation
Information in the manner specified by section 6 of the GNU GPL
for conveying Corresponding Source.)
5. Combined Libraries.
You may place library facilities that are a work based on the
Library side by side in a single library together with other library
facilities that are not Applications and are not covered by this
License, and convey such a combined library under terms of your
choice, if you do both of the following:
a) Accompany the combined library with a copy of the same work based
on the Library, uncombined with any other library facilities,
conveyed under the terms of this License.
b) Give prominent notice with the combined library that part of it
is a work based on the Library, and explaining where to find the
accompanying uncombined form of the same work.
6. Revised Versions of the GNU Lesser General Public License.
The Free Software Foundation may publish revised and/or new versions
of the GNU Lesser General Public License from time to time. Such new
versions will be similar in spirit to the present version, but may
differ in detail to address new problems or concerns.
Each version is given a distinguishing version number. If the
Library as you received it specifies that a certain numbered version
of the GNU Lesser General Public License "or any later version"
applies to it, you have the option of following the terms and
conditions either of that published version or of any later version
published by the Free Software Foundation. If the Library as you
received it does not specify a version number of the GNU Lesser
General Public License, you may choose any version of the GNU Lesser
General Public License ever published by the Free Software Foundation.
If the Library as you received it specifies that a proxy can decide
whether future versions of the GNU Lesser General Public License shall
apply, that proxy's public statement of acceptance of any version is
permanent authorization for you to choose that version for the
Library.

38
core/Readme.md Normal file
View File

@@ -0,0 +1,38 @@
Readme
======
## This is the repository of Thelia core. All the pull requests on this repo will be ignored.
### If you want to create a project, please take a look at [thelia/thelia-project](https://github.com/thelia/thelia-project)
### If you want to contribute to Thelia, please take a look at [thelia/thelia](https://github.com/thelia/thelia)
Thelia
------
[![Build Status](https://travis-ci.org/thelia/thelia.png?branch=master)](https://travis-ci.org/thelia/thelia) [![License](https://poser.pugx.org/thelia/thelia/license.png)](https://packagist.org/packages/thelia/thelia) [![Scrutinizer Quality Score](https://scrutinizer-ci.com/g/thelia/thelia/badges/quality-score.png?s=61e3e04a69bffd71c29b08e5392080317a546716)](https://scrutinizer-ci.com/g/thelia/thelia/)
[Thelia](http://thelia.net/) is an open source tool for creating e-business websites and managing online content. This software is published under LGPL.
This is the new major version of Thelia.
You can download this version and have a try or take a look at the source code (or anything you wish, respecting LGPL). See http://thelia.net/ web site for more information.
A repository containing all thelia modules is available at this address : https://github.com/thelia-modules
Requirements
------------
* php 5.5
* Required extensions :
* PDO_Mysql
* openssl
* intl
* gd
* curl
* calendar
* dom
* fileinfo
* safe_mode off
* memory_limit at least 128M, preferably 256.
* post_max_size 20M
* upload_max_filesize 2M
* apache 2
* mysql

53
core/Thelia Normal file
View File

@@ -0,0 +1,53 @@
<?php
if (php_sapi_name() != 'cli') {
throw new \Exception('this script can only be launched with cli sapi');
}
set_time_limit(0);
// allow cache to be cleared by php client or web
umask(0002);
$bootstrapToggle = false;
$bootstraped = false;
// Autoload bootstrap
foreach ($argv as $arg) {
if ($arg === '-b') {
$bootstrapToggle = true;
continue;
}
if ($bootstrapToggle) {
require __DIR__ . DIRECTORY_SEPARATOR . $arg;
$bootstraped = true;
}
}
if (!$bootstraped) {
if (isset($bootstrapFile)) {
require $bootstrapFile;
} elseif (is_file($file = __DIR__ . '/vendor/autoload.php')) {
require $file;
} else {
echo "No autoload file found. Please use the -b argument to include yours";
exit(1);
}
}
use Thelia\Core\Thelia;
use Thelia\Core\Application;
use Thelia\Command\Output\TheliaConsoleOutput;
use Symfony\Component\Console\Input\ArgvInput;
$input = new ArgvInput();
$env = $input->getParameterOption(array('--env', '-e'), getenv('THELIA_ENV') ?: 'dev');
$debug = getenv('THELIA_DEBUG') !== '0' && !$input->hasParameterOption(array('--no-debug', '')) && $env !== 'prod';
$thelia = new Thelia($env, $debug);
$application = new Application($thelia);
$application->getContainer()->get('thelia.translator');
$application->run($input, new TheliaConsoleOutput());

92
core/bootstrap.php Normal file
View File

@@ -0,0 +1,92 @@
<?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. */
/*************************************************************************************/
// Check php version
if (version_compare(phpversion(), "5.4", "<")) {
die(sprintf(
"Thelia needs at least php 5.4, but you are using php %s. Please upgrade before using Thelia.\n",
phpversion()
));
}
/**
* Thelia essential definitions
*/
if (!defined('DS')) {
define('DS', DIRECTORY_SEPARATOR);
}
if (!defined('THELIA_ROOT')) {
define('THELIA_ROOT', rtrim(realpath(dirname(__DIR__)), DS) . DS);
}
if (!defined('THELIA_LIB')) {
define('THELIA_LIB', THELIA_ROOT . 'core' . DS . 'lib' . DS . 'Thelia' . DS);
}
if (!defined('THELIA_VENDOR')) {
define('THELIA_VENDOR', THELIA_ROOT . 'core' . DS . 'vendor' . DS);
}
if (!defined('THELIA_LOCAL_DIR')) {
define('THELIA_LOCAL_DIR', THELIA_ROOT . 'local' . DS);
}
if (!defined('THELIA_CONF_DIR')) {
define('THELIA_CONF_DIR', THELIA_LOCAL_DIR . 'config' . DS);
}
if (!defined('THELIA_MODULE_DIR')) {
define('THELIA_MODULE_DIR', THELIA_LOCAL_DIR . 'modules' . DS);
}
if (!defined('THELIA_WEB_DIR')) {
define('THELIA_WEB_DIR', THELIA_ROOT . 'web' . DS);
}
if (!defined('THELIA_CACHE_DIR')) {
define('THELIA_CACHE_DIR', THELIA_ROOT . 'cache' . DS);
}
if (!defined('THELIA_LOG_DIR')) {
define('THELIA_LOG_DIR', THELIA_ROOT . 'log' . DS);
}
if (!defined('THELIA_TEMPLATE_DIR')) {
define('THELIA_TEMPLATE_DIR', THELIA_ROOT . 'templates' . DS);
}
if (!defined('THELIA_SETUP_DIRECTORY')) {
define('THELIA_SETUP_DIRECTORY', THELIA_ROOT . 'setup' . DS);
}
if (!defined('THELIA_SETUP_WIZARD_DIRECTORY')) {
define('THELIA_SETUP_WIZARD_DIRECTORY', THELIA_ROOT . 'web' . DS . 'install' . DS);
}
if (!file_exists(THELIA_CONF_DIR . 'database.yml') && !defined('THELIA_INSTALL_MODE')) {
$sapi = php_sapi_name();
if (substr($sapi, 0, 3) == 'cli') {
define('THELIA_INSTALL_MODE', true);
} elseif (file_exists(THELIA_ROOT . DS . 'web' . DS . 'install')) {
$request = \Thelia\Core\HttpFoundation\Request::createFromGlobals();
header('Location: '.$request->getUriForPath('/install'));
} else {
header($_SERVER['SERVER_PROTOCOL'] . ' 500 Thelia is not installed', true, 500);
die(sprintf(
"Thelia is not installed. <a href=\"%s\" target=\"_blank\">More information</a>\n",
"http://doc.thelia.net/en/documentation/installation/index.html#using-cli-tools"
));
}
}

79
core/composer.json Normal file
View File

@@ -0,0 +1,79 @@
{
"name": "thelia/core",
"description": "Core of Thelia ecommerce CMS.",
"license": "LGPL-3.0+",
"homepage": "http://thelia.net/",
"support": {
"forum": "http://thelia.net/forum",
"wiki": "http://doc.thelia.net"
},
"repositories": [
{
"type": "vcs",
"url": "https://github.com/thelia/Propel2"
}
],
"require": {
"php": ">=5.4",
"ircmaxell/password-compat": "1.0.*",
"psr/log": "1.0",
"symfony/config": "2.8.*",
"symfony/console": "2.8.*",
"symfony/dependency-injection": "2.8.*",
"symfony/event-dispatcher": "2.8.*",
"symfony/http-kernel": "2.8.*",
"symfony/routing": "2.8.*",
"symfony/filesystem": "2.8.*",
"symfony/yaml": "2.8.*",
"symfony/translation": "2.8.*",
"symfony-cmf/routing": "1.3.*",
"symfony/validator": "2.8.*",
"symfony/options-resolver": "2.8.*",
"symfony/security": "2.8.*",
"symfony/expression-language": "2.8.*",
"symfony/process": "2.8.*",
"symfony/dom-crawler": "2.8.*",
"symfony/property-access": "2.8.*",
"symfony/serializer": "2.8.*",
"ensepar/html2pdf": "1.0.1",
"symfony/finder": "2.8.*",
"symfony/browser-kit": "2.8.*",
"symfony/http-foundation": "2.8.*",
"symfony/form": "2.8.*",
"symfony/class-loader": "2.8.*",
"symfony/icu": "1.0",
"stack/builder": "1.0.*",
"thelia/currency-converter": "~1.0",
"doctrine/cache": "1.5.*",
"kriswallsmith/assetic": "1.3.*",
"ptachoire/cssembed": "1.0.*",
"simplepie/simplepie": "1.3.*",
"imagine/imagine": "0.6.*",
"swiftmailer/swiftmailer": "5.4.*",
"oyejorge/less.php": "1.7.*",
"michelf/php-markdown": "1.6.*",
"smarty/smarty": "3.1.20",
"ramsey/array_column": "~1.1",
"propel/propel": "dev-thelia-2.3",
"commerceguys/addressing": "0.8.*",
"symfony/cache": "~3.1.0"
},
"require-dev": {
"fzaninotto/faker": "1.5.*",
"thelia/hooktest-module": "~1.1",
"thelia/hooktest-template": "~1.1",
"phpunit/phpunit": "4.8.*"
},
"bin": [
"Thelia"
],
"minimum-stability": "stable",
"autoload": {
"psr-4": {
"Thelia\\": "lib/Thelia/"
},
"files": [
"bootstrap.php"
]
}
}

View File

@@ -0,0 +1,108 @@
<?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 Thelia\Action;
use Propel\Runtime\Exception\PropelException;
use Propel\Runtime\Propel;
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
use Thelia\Core\Event\Address\AddressCreateOrUpdateEvent;
use Thelia\Core\Event\Address\AddressEvent;
use Thelia\Core\Event\TheliaEvents;
use Thelia\Model\Address as AddressModel;
use Thelia\Model\Map\AddressTableMap;
/**
* Class Address
* @package Thelia\Action
* @author Manuel Raynaud <manu@raynaud.io>
*/
class Address extends BaseAction implements EventSubscriberInterface
{
public function create(AddressCreateOrUpdateEvent $event, $eventName, EventDispatcherInterface $dispatcher)
{
$address = new AddressModel();
$address->setCustomer($event->getCustomer());
$this->createOrUpdate($address, $event, $dispatcher);
}
public function update(AddressCreateOrUpdateEvent $event, $eventName, EventDispatcherInterface $dispatcher)
{
$addressModel = $event->getAddress();
$this->createOrUpdate($addressModel, $event, $dispatcher);
}
public function delete(AddressEvent $event)
{
$address = $event->getAddress();
$address->delete();
}
public function useDefault(AddressEvent $event)
{
$address = $event->getAddress();
$address->makeItDefault();
}
protected function createOrUpdate(AddressModel $addressModel, AddressCreateOrUpdateEvent $event, $dispatcher)
{
$addressModel->setDispatcher($dispatcher);
$con = Propel::getWriteConnection(AddressTableMap::DATABASE_NAME);
$con->beginTransaction();
try {
$addressModel
->setLabel($event->getLabel())
->setTitleId($event->getTitle())
->setFirstname($event->getFirstname())
->setLastname($event->getLastname())
->setAddress1($event->getAddress1())
->setAddress2($event->getAddress2())
->setAddress3($event->getAddress3())
->setZipcode($event->getZipcode())
->setCity($event->getCity())
->setCountryId($event->getCountry())
->setStateId($event->getState())
->setCellphone($event->getCellphone())
->setPhone($event->getPhone())
->setCompany($event->getCompany())
->save()
;
if ($event->getIsDefault() && !$addressModel->getIsDefault()) {
$addressModel->makeItDefault();
}
$event->setAddress($addressModel);
$con->commit();
} catch (PropelException $e) {
$con->rollback();
throw $e;
}
}
/**
* {@inheritdoc}
*/
public static function getSubscribedEvents()
{
return array(
TheliaEvents::ADDRESS_CREATE => array("create", 128),
TheliaEvents::ADDRESS_UPDATE => array("update", 128),
TheliaEvents::ADDRESS_DELETE => array("delete", 128),
TheliaEvents::ADDRESS_DEFAULT => array('useDefault', 128),
);
}
}

View File

@@ -0,0 +1,155 @@
<?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 Thelia\Action;
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
use Thelia\Core\Event\Administrator\AdministratorEvent;
use Thelia\Core\Event\Administrator\AdministratorUpdatePasswordEvent;
use Thelia\Core\Event\TheliaEvents;
use Thelia\Mailer\MailerFactory;
use Thelia\Model\Admin as AdminModel;
use Thelia\Model\AdminQuery;
use Thelia\Model\ConfigQuery;
use Thelia\Tools\TokenProvider;
class Administrator extends BaseAction implements EventSubscriberInterface
{
/** @var MailerFactory */
protected $mailer;
/** @var TokenProvider */
protected $tokenProvider;
public function __construct(MailerFactory $mailer, TokenProvider $tokenProvider)
{
$this->mailer = $mailer;
$this->tokenProvider = $tokenProvider;
}
/**
* @param AdministratorEvent $event
* @param $eventName
* @param EventDispatcherInterface $dispatcher
*/
public function create(AdministratorEvent $event, $eventName, EventDispatcherInterface $dispatcher)
{
$administrator = new AdminModel();
$administrator
->setDispatcher($dispatcher)
->setFirstname($event->getFirstname())
->setLastname($event->getLastname())
->setEmail($event->getEmail())
->setLogin($event->getLogin())
->setPassword($event->getPassword())
->setProfileId($event->getProfile())
->setLocale($event->getLocale())
;
$administrator->save();
$event->setAdministrator($administrator);
}
/**
* @param AdministratorEvent $event
* @param $eventName
* @param EventDispatcherInterface $dispatcher
*/
public function update(AdministratorEvent $event, $eventName, EventDispatcherInterface $dispatcher)
{
if (null !== $administrator = AdminQuery::create()->findPk($event->getId())) {
$administrator
->setDispatcher($dispatcher)
->setFirstname($event->getFirstname())
->setLastname($event->getLastname())
->setLogin($event->getLogin())
->setEmail($event->getEmail())
->setProfileId($event->getProfile())
->setLocale($event->getLocale())
;
if ('' !== $event->getPassword()) {
$administrator->setPassword($event->getPassword());
}
$administrator->save();
$event->setAdministrator($administrator);
}
}
/**
* @param AdministratorEvent $event
*/
public function delete(AdministratorEvent $event)
{
if (null !== $administrator = AdminQuery::create()->findPk($event->getId())) {
$administrator
->delete()
;
$event->setAdministrator($administrator);
}
}
public function updatePassword(AdministratorUpdatePasswordEvent $event)
{
$admin = $event->getAdmin();
$admin
->setPassword($event->getPassword())
->setPasswordRenewToken(null)
->save();
}
public function createPassword(AdministratorEvent $event)
{
$admin = $event->getAdministrator();
$email = $admin->getEmail();
if (! empty($email)) {
$renewToken = $this->tokenProvider->getToken();
$admin
->setPasswordRenewToken($renewToken)
->save();
$this->mailer->sendEmailMessage(
'new_admin_password',
[ ConfigQuery::getStoreEmail() => ConfigQuery::getStoreName() ],
[ $email => $admin->getFirstname() . ' ' . $admin->getLastname() ],
[
'token' => $renewToken,
'admin' => $admin
]
);
}
}
/**
* {@inheritdoc}
*/
public static function getSubscribedEvents()
{
return array(
TheliaEvents::ADMINISTRATOR_CREATE => array('create', 128),
TheliaEvents::ADMINISTRATOR_UPDATE => array('update', 128),
TheliaEvents::ADMINISTRATOR_DELETE => array('delete', 128),
TheliaEvents::ADMINISTRATOR_UPDATEPASSWORD => array('updatePassword', 128),
TheliaEvents::ADMINISTRATOR_CREATEPASSWORD => array('createPassword', 128)
);
}
}

View File

@@ -0,0 +1,65 @@
<?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 Thelia\Action;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
use Thelia\Core\Event\Api\ApiCreateEvent;
use Thelia\Core\Event\Api\ApiDeleteEvent;
use Thelia\Core\Event\Api\ApiUpdateEvent;
use Thelia\Core\Event\TheliaEvents;
use Thelia\Model\Api as ApiModel;
/**
* Class Api
* @package Thelia\Action
* @author Manuel Raynaud <manu@raynaud.io>
*/
class Api extends BaseAction implements EventSubscriberInterface
{
public function createApi(ApiCreateEvent $event)
{
$api = new ApiModel();
$api->setLabel($event->getLabel())
->setProfileId($event->getProfile())
->save()
;
}
public function deleteApi(ApiDeleteEvent $event)
{
$api = $event->getApi();
$api->delete();
}
public function updateApi(ApiUpdateEvent $event)
{
$api = $event->getApi();
$api->setProfileId($event->getProfile())
->save();
}
/**
* {@inheritdoc}
*/
public static function getSubscribedEvents()
{
return [
TheliaEvents::API_CREATE => ['createApi', 128],
TheliaEvents::API_DELETE => ['deleteApi', 128],
TheliaEvents::API_UPDATE => ['updateApi', 128],
];
}
}

View File

@@ -0,0 +1,137 @@
<?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 Thelia\Action;
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
use Thelia\Core\Event\Area\AreaAddCountryEvent;
use Thelia\Core\Event\Area\AreaCreateEvent;
use Thelia\Core\Event\Area\AreaDeleteEvent;
use Thelia\Core\Event\Area\AreaRemoveCountryEvent;
use Thelia\Core\Event\Area\AreaUpdateEvent;
use Thelia\Core\Event\Area\AreaUpdatePostageEvent;
use Thelia\Core\Event\TheliaEvents;
use Thelia\Model\Area as AreaModel;
use Thelia\Model\AreaQuery;
use Thelia\Model\CountryArea;
use Thelia\Model\CountryAreaQuery;
/**
* Class Area
* @package Thelia\Action
* @author Manuel Raynaud <manu@raynaud.io>
*/
class Area extends BaseAction implements EventSubscriberInterface
{
public function addCountry(AreaAddCountryEvent $event)
{
$countryIds = $event->getCountryId();
$areaId = $event->getAreaId();
foreach ($countryIds as $countryId) {
$countryArea = new CountryArea();
$country = explode('-', $countryId);
if (count($country) === 1) {
$country[1] = null;
}
if ($country[1] == 0) {
$country[1] = null;
}
$countryArea
->setAreaId($areaId)
->setCountryId($country[0])
->setStateId($country[1])
->save()
;
}
$event->setArea(AreaQuery::create()->findPk($areaId));
}
public function removeCountry(AreaRemoveCountryEvent $event)
{
CountryAreaQuery::create()
->filterByCountryId($event->getCountryId())
->filterByStateId($event->getStateId())
->filterByAreaId($event->getAreaId())
->delete();
if (null !== $area = AreaQuery::create()->findPk($event->getAreaId())) {
$event->setArea($area);
}
}
public function updatePostage(AreaUpdatePostageEvent $event, $eventName, EventDispatcherInterface $dispatcher)
{
if (null !== $area = AreaQuery::create()->findPk($event->getAreaId())) {
$area->setDispatcher($dispatcher);
$area
->setPostage($event->getPostage())
->save();
$event->setArea($area);
}
}
public function delete(AreaDeleteEvent $event, $eventName, EventDispatcherInterface $dispatcher)
{
if (null !== $area = AreaQuery::create()->findPk($event->getAreaId())) {
$area->setDispatcher($dispatcher);
$area->delete();
$event->setArea($area);
}
}
public function create(AreaCreateEvent $event, $eventName, EventDispatcherInterface $dispatcher)
{
$area = new AreaModel();
$area
->setDispatcher($dispatcher)
->setName($event->getAreaName())
->save();
$event->setArea($area);
}
public function update(AreaUpdateEvent $event, $eventName, EventDispatcherInterface $dispatcher)
{
if (null !== $area = AreaQuery::create()->findPk($event->getAreaId())) {
$area
->setDispatcher($dispatcher)
->setName($event->getAreaName())
->save();
$event->setArea($area);
}
}
/**
* {@inheritdoc}
*/
public static function getSubscribedEvents()
{
return array(
TheliaEvents::AREA_ADD_COUNTRY => array('addCountry', 128),
TheliaEvents::AREA_REMOVE_COUNTRY => array('removeCountry', 128),
TheliaEvents::AREA_POSTAGE_UPDATE => array('updatePostage', 128),
TheliaEvents::AREA_DELETE => array('delete', 128),
TheliaEvents::AREA_CREATE => array('create', 128),
TheliaEvents::AREA_UPDATE => array('update', 128)
);
}
}

View File

@@ -0,0 +1,157 @@
<?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 Thelia\Action;
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
use Thelia\Model\AttributeQuery;
use Thelia\Model\Attribute as AttributeModel;
use Thelia\Core\Event\TheliaEvents;
use Thelia\Core\Event\Attribute\AttributeUpdateEvent;
use Thelia\Core\Event\Attribute\AttributeCreateEvent;
use Thelia\Core\Event\Attribute\AttributeDeleteEvent;
use Thelia\Core\Event\UpdatePositionEvent;
use Thelia\Core\Event\Attribute\AttributeEvent;
use Thelia\Model\AttributeTemplate;
use Thelia\Model\AttributeTemplateQuery;
use Thelia\Model\TemplateQuery;
class Attribute extends BaseAction implements EventSubscriberInterface
{
/**
* Create a new attribute entry
*
* @param AttributeCreateEvent $event
* @param $eventName
* @param EventDispatcherInterface $dispatcher
*/
public function create(AttributeCreateEvent $event, $eventName, EventDispatcherInterface $dispatcher)
{
$attribute = new AttributeModel();
$attribute
->setDispatcher($dispatcher)
->setLocale($event->getLocale())
->setTitle($event->getTitle())
->save()
;
$event->setAttribute($attribute);
// Add atribute to all product templates if required
if ($event->getAddToAllTemplates() != 0) {
$this->doAddToAllTemplates($attribute);
}
}
/**
* Change a product attribute
*
* @param AttributeUpdateEvent $event
* @param $eventName
* @param EventDispatcherInterface $dispatcher
*/
public function update(AttributeUpdateEvent $event, $eventName, EventDispatcherInterface $dispatcher)
{
if (null !== $attribute = AttributeQuery::create()->findPk($event->getAttributeId())) {
$attribute
->setDispatcher($dispatcher)
->setLocale($event->getLocale())
->setTitle($event->getTitle())
->setDescription($event->getDescription())
->setChapo($event->getChapo())
->setPostscriptum($event->getPostscriptum())
->save();
$event->setAttribute($attribute);
}
}
/**
* Delete a product attribute entry
*
* @param AttributeDeleteEvent $event
* @param $eventName
* @param EventDispatcherInterface $dispatcher
*/
public function delete(AttributeDeleteEvent $event, $eventName, EventDispatcherInterface $dispatcher)
{
if (null !== ($attribute = AttributeQuery::create()->findPk($event->getAttributeId()))) {
$attribute
->setDispatcher($dispatcher)
->delete()
;
$event->setAttribute($attribute);
}
}
/**
* Changes position, selecting absolute ou relative change.
*
* @param UpdatePositionEvent $event
* @param $eventName
* @param EventDispatcherInterface $dispatcher
*/
public function updatePosition(UpdatePositionEvent $event, $eventName, EventDispatcherInterface $dispatcher)
{
$this->genericUpdatePosition(AttributeQuery::create(), $event, $dispatcher);
}
protected function doAddToAllTemplates(AttributeModel $attribute)
{
$templates = TemplateQuery::create()->find();
foreach ($templates as $template) {
$attribute_template = new AttributeTemplate();
if (null === AttributeTemplateQuery::create()->filterByAttribute($attribute)->filterByTemplate($template)->findOne()) {
$attribute_template
->setAttribute($attribute)
->setTemplate($template)
->save()
;
}
}
}
public function addToAllTemplates(AttributeEvent $event)
{
$this->doAddToAllTemplates($event->getAttribute());
}
public function removeFromAllTemplates(AttributeEvent $event)
{
// Delete this attribute from all product templates
AttributeTemplateQuery::create()->filterByAttribute($event->getAttribute())->delete();
}
/**
* {@inheritdoc}
*/
public static function getSubscribedEvents()
{
return array(
TheliaEvents::ATTRIBUTE_CREATE => array("create", 128),
TheliaEvents::ATTRIBUTE_UPDATE => array("update", 128),
TheliaEvents::ATTRIBUTE_DELETE => array("delete", 128),
TheliaEvents::ATTRIBUTE_UPDATE_POSITION => array("updatePosition", 128),
TheliaEvents::ATTRIBUTE_REMOVE_FROM_ALL_TEMPLATES => array("removeFromAllTemplates", 128),
TheliaEvents::ATTRIBUTE_ADD_TO_ALL_TEMPLATES => array("addToAllTemplates", 128),
);
}
}

View File

@@ -0,0 +1,119 @@
<?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 Thelia\Action;
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
use Thelia\Model\AttributeAvQuery;
use Thelia\Model\AttributeAv as AttributeAvModel;
use Thelia\Core\Event\TheliaEvents;
use Thelia\Core\Event\Attribute\AttributeAvUpdateEvent;
use Thelia\Core\Event\Attribute\AttributeAvCreateEvent;
use Thelia\Core\Event\Attribute\AttributeAvDeleteEvent;
use Thelia\Core\Event\UpdatePositionEvent;
class AttributeAv extends BaseAction implements EventSubscriberInterface
{
/**
* Create a new attribute entry
*
* @param AttributeAvCreateEvent $event
* @param $eventName
* @param EventDispatcherInterface $dispatcher
*/
public function create(AttributeAvCreateEvent $event, $eventName, EventDispatcherInterface $dispatcher)
{
$attribute = new AttributeAvModel();
$attribute
->setDispatcher($dispatcher)
->setAttributeId($event->getAttributeId())
->setLocale($event->getLocale())
->setTitle($event->getTitle())
->save()
;
$event->setAttributeAv($attribute);
}
/**
* Change a product attribute
*
* @param AttributeAvUpdateEvent $event
* @param $eventName
* @param EventDispatcherInterface $dispatcher
*/
public function update(AttributeAvUpdateEvent $event, $eventName, EventDispatcherInterface $dispatcher)
{
if (null !== $attribute = AttributeAvQuery::create()->findPk($event->getAttributeAvId())) {
$attribute
->setDispatcher($dispatcher)
->setLocale($event->getLocale())
->setTitle($event->getTitle())
->setDescription($event->getDescription())
->setChapo($event->getChapo())
->setPostscriptum($event->getPostscriptum())
->save();
$event->setAttributeAv($attribute);
}
}
/**
* Delete a product attribute entry
*
* @param AttributeAvDeleteEvent $event
* @param $eventName
* @param EventDispatcherInterface $dispatcher
*/
public function delete(AttributeAvDeleteEvent $event, $eventName, EventDispatcherInterface $dispatcher)
{
if (null !== ($attribute = AttributeAvQuery::create()->findPk($event->getAttributeAvId()))) {
$attribute
->setDispatcher($dispatcher)
->delete()
;
$event->setAttributeAv($attribute);
}
}
/**
* Changes position, selecting absolute ou relative change.
*
* @param UpdatePositionEvent $event
* @param $eventName
* @param EventDispatcherInterface $dispatcher
*/
public function updatePosition(UpdatePositionEvent $event, $eventName, EventDispatcherInterface $dispatcher)
{
$this->genericUpdatePosition(AttributeAvQuery::create(), $event);
}
/**
* {@inheritdoc}
*/
public static function getSubscribedEvents()
{
return array(
TheliaEvents::ATTRIBUTE_AV_CREATE => array("create", 128),
TheliaEvents::ATTRIBUTE_AV_UPDATE => array("update", 128),
TheliaEvents::ATTRIBUTE_AV_DELETE => array("delete", 128),
TheliaEvents::ATTRIBUTE_AV_UPDATE_POSITION => array("updatePosition", 128),
);
}
}

View File

@@ -0,0 +1,146 @@
<?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 Thelia\Action;
use Propel\Runtime\ActiveQuery\ModelCriteria;
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
use Thelia\Core\Event\ToggleVisibilityEvent;
use Thelia\Core\Event\UpdatePositionEvent;
use Thelia\Core\Event\UpdateSeoEvent;
use Thelia\Exception\UrlRewritingException;
use Thelia\Form\Exception\FormValidationException;
use Thelia\Model\ProductCategory;
class BaseAction
{
/**
* Changes object position, selecting absolute ou relative change.
*
* @param ModelCriteria $query
* @param UpdatePositionEvent $event
* @param EventDispatcherInterface $dispatcher
*
* @return null
*/
protected function genericUpdatePosition(ModelCriteria $query, UpdatePositionEvent $event, EventDispatcherInterface $dispatcher = null)
{
if (null !== $object = $query->findPk($event->getObjectId())) {
if (!isset(class_uses($object)['Thelia\Model\Tools\PositionManagementTrait'])) {
throw new \InvalidArgumentException("Your model does not implement the PositionManagementTrait trait");
}
$object->setDispatcher($dispatcher !== null ? $dispatcher : $event->getDispatcher());
$mode = $event->getMode();
if ($mode == UpdatePositionEvent::POSITION_ABSOLUTE) {
$object->changeAbsolutePosition($event->getPosition());
} elseif ($mode == UpdatePositionEvent::POSITION_UP) {
$object->movePositionUp();
} elseif ($mode == UpdatePositionEvent::POSITION_DOWN) {
$object->movePositionDown();
}
}
}
/**
* @param ModelCriteria $query
* @param UpdatePositionEvent $event
* @param EventDispatcherInterface|null $dispatcher
*
* @since 2.3
*/
protected function genericUpdateDelegatePosition(ModelCriteria $query, UpdatePositionEvent $event, EventDispatcherInterface $dispatcher = null)
{
if (null !== $object = $query->findOne()) {
if (!isset(class_uses($object)['Thelia\Model\Tools\PositionManagementTrait'])) {
throw new \InvalidArgumentException("Your model does not implement the PositionManagementTrait trait");
}
//$object->setDispatcher($dispatcher !== null ? $dispatcher : $event->getDispatcher());
$mode = $event->getMode();
if ($mode == UpdatePositionEvent::POSITION_ABSOLUTE) {
$object->changeAbsolutePosition($event->getPosition());
} elseif ($mode == UpdatePositionEvent::POSITION_UP) {
$object->movePositionUp();
} elseif ($mode == UpdatePositionEvent::POSITION_DOWN) {
$object->movePositionDown();
}
}
}
/**
* Changes SEO Fields for an object.
*
* @param ModelCriteria $query
* @param UpdateSeoEvent $event
* @param EventDispatcherInterface $dispatcher
*
* @return mixed an SEOxxx object
* @throws FormValidationException if a rewritten URL cannot be created
*/
protected function genericUpdateSeo(ModelCriteria $query, UpdateSeoEvent $event, EventDispatcherInterface $dispatcher = null)
{
if (null !== $object = $query->findPk($event->getObjectId())) {
$object
//for backward compatibility
->setDispatcher($dispatcher !== null ? $dispatcher : $event->getDispatcher())
->setLocale($event->getLocale())
->setMetaTitle($event->getMetaTitle())
->setMetaDescription($event->getMetaDescription())
->setMetaKeywords($event->getMetaKeywords())
->save()
;
// Update the rewritten URL, if required
try {
$object->setRewrittenUrl($event->getLocale(), $event->getUrl());
} catch (UrlRewritingException $e) {
throw new FormValidationException($e->getMessage(), $e->getCode());
}
$event->setObject($object);
}
return $object;
}
/**
* Toggle visibility for an object
*
* @param ModelCriteria $query
* @param ToggleVisibilityEvent $event
* @param EventDispatcherInterface $dispatcher
*
* @return mixed
*/
public function genericToggleVisibility(ModelCriteria $query, ToggleVisibilityEvent $event, EventDispatcherInterface $dispatcher = null)
{
if (null !== $object = $query->findPk($event->getObjectId())) {
$newVisibility = !$object->getVisible();
$object
//for backward compatibility
->setDispatcher($dispatcher !== null ? $dispatcher : $event->getDispatcher())
->setVisible($newVisibility)
->save()
;
$event->setObject($object);
}
return $object;
}
}

View File

@@ -0,0 +1,276 @@
<?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 Thelia\Action;
use Propel\Runtime\Propel;
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
use Thelia\Core\Event\CachedFileEvent;
use Thelia\Core\Event\File\FileCreateOrUpdateEvent;
use Thelia\Core\Event\File\FileDeleteEvent;
use Thelia\Core\Event\File\FileToggleVisibilityEvent;
use Thelia\Core\Event\UpdateFilePositionEvent;
use Thelia\Exception\FileException;
use Thelia\Files\FileManager;
use Thelia\Model\Map\ProductImageTableMap;
use Thelia\Tools\URL;
/**
*
* Cached file management actions. This class handles file caching in the web space
*
* Basically, files are stored outside the web space (by default in local/media/<dirname>),
* and cached in the web space (by default in web/local/<dirname>).
*
* In the file cache directory, a subdirectory for files categories (eg. product, category, folder, etc.) is
* automatically created, and the cached file is created here. Plugin may use their own subdirectory as required.
*
* A copy (or symbolic link, by default) of the original file is created in the cache.
*
* @package Thelia\Action
* @author Franck Allimant <franck@cqfdev.fr>
*
*/
abstract class BaseCachedFile extends BaseAction
{
/**
* @var FileManager
*/
protected $fileManager;
public function __construct(FileManager $fileManager)
{
$this->fileManager = $fileManager;
}
/**
* @return string root of the file cache directory in web space
*/
abstract protected function getCacheDirFromWebRoot();
/**
* Clear the file cache. Is a subdirectory is specified, only this directory is cleared.
* If no directory is specified, the whole cache is cleared.
* Only files are deleted, directories will remain.
*
* @param CachedFileEvent $event
*/
public function clearCache(CachedFileEvent $event)
{
$path = $this->getCachePath($event->getCacheSubdirectory(), false);
$this->clearDirectory($path);
}
/**
* Recursively clears the specified directory.
*
* @param string $path the directory path
*/
protected function clearDirectory($path)
{
$iterator = new \DirectoryIterator($path);
/** @var \DirectoryIterator $fileinfo */
foreach ($iterator as $fileinfo) {
if ($fileinfo->isDot()) {
continue;
}
if ($fileinfo->isFile() || $fileinfo->isLink()) {
@unlink($fileinfo->getPathname());
} elseif ($fileinfo->isDir()) {
$this->clearDirectory($fileinfo->getPathname());
}
}
}
/**
* Return the absolute URL to the cached file
*
* @param string $subdir the subdirectory related to cache base
* @param string $safe_filename the safe filename, as returned by getCacheFilePath()
* @return string the absolute URL to the cached file
*/
protected function getCacheFileURL($subdir, $safe_filename)
{
$path = $this->getCachePathFromWebRoot($subdir);
return URL::getInstance()->absoluteUrl(sprintf("%s/%s", $path, $safe_filename), null, URL::PATH_TO_FILE);
}
/**
* Return the full path of the cached file
*
* @param string $subdir the subdirectory related to cache base
* @param string $filename the filename
* @param boolean $forceOriginalFile if true, the original file path in the cache dir is returned.
* @param string $hashed_options a hash of transformation options, or null if no transformations have been applied
* @return string the cache directory path relative to Web Root
*/
protected function getCacheFilePath($subdir, $filename, $forceOriginalFile = false, $hashed_options = null)
{
$path = $this->getCachePath($subdir);
$safe_filename = preg_replace("[^:alnum:\-\._]", "-", strtolower(basename($filename)));
// Keep original safe name if no tranformations are applied
if ($forceOriginalFile || $hashed_options == null) {
return sprintf("%s/%s", $path, $safe_filename);
} else {
return sprintf("%s/%s-%s", $path, $hashed_options, $safe_filename);
}
}
/**
* Return the cache directory path relative to Web Root
*
* @param string $subdir the subdirectory related to cache base, or null to get the cache directory only.
* @return string the cache directory path relative to Web Root
*/
protected function getCachePathFromWebRoot($subdir = null)
{
$cache_dir_from_web_root = $this->getCacheDirFromWebRoot();
if ($subdir != null) {
$safe_subdir = basename($subdir);
$path = sprintf("%s/%s", $cache_dir_from_web_root, $safe_subdir);
} else {
$path = $cache_dir_from_web_root;
}
// Check if path is valid, e.g. in the cache dir
return $path;
}
/**
* Return the absolute cache directory path
*
* @param string $subdir the subdirectory related to cache base, or null to get the cache base directory.
* @param bool $create_if_not_exists create the directory if it is not found
*
* @throws \RuntimeException if cache directory cannot be created
* @throws \InvalidArgumentException ii path is invalid, e.g. not in the cache dir
*
* @return string the absolute cache directory path
*/
protected function getCachePath($subdir = null, $create_if_not_exists = true)
{
$cache_base = $this->getCachePathFromWebRoot($subdir);
$web_root = rtrim(THELIA_WEB_DIR, '/');
$path = sprintf("%s/%s", $web_root, $cache_base);
// Create directory (recursively) if it does not exists.
if ($create_if_not_exists && !is_dir($path)) {
if (!@mkdir($path, 0777, true)) {
throw new \RuntimeException(sprintf("Failed to create %s file in cache directory", $path));
}
}
// Check if path is valid, e.g. in the cache dir
$cache_base = realpath(sprintf("%s/%s", $web_root, $this->getCachePathFromWebRoot()));
if (strpos(realpath($path), $cache_base) !== 0) {
throw new \InvalidArgumentException(sprintf("Invalid cache path %s, with subdirectory %s", $path, $subdir));
}
return $path;
}
/**
* Take care of saving a file in the database and file storage
*
* @param FileCreateOrUpdateEvent $event Image event
*
* @throws \Thelia\Exception\FileException|\Exception
*
*/
public function saveFile(FileCreateOrUpdateEvent $event)
{
$model = $event->getModel();
$model->setFile(sprintf("tmp/%s", $event->getUploadedFile()->getFilename()));
$con = Propel::getWriteConnection(ProductImageTableMap::DATABASE_NAME);
$con->beginTransaction();
try {
$nbModifiedLines = $model->save($con);
$event->setModel($model);
if (!$nbModifiedLines) {
throw new FileException(
sprintf(
'File "%s" (type %s) with parent id %s failed to be saved',
$event->getParentName(),
get_class($model),
$event->getParentId()
)
);
}
$newUploadedFile = $this->fileManager->copyUploadedFile($event->getModel(), $event->getUploadedFile());
$event->setUploadedFile($newUploadedFile);
$con->commit();
} catch (\Exception $e) {
$con->rollBack();
throw $e;
}
}
/**
* Take care of updating file in the database and file storage
*
* @param FileCreateOrUpdateEvent $event Image event
*
* @throws \Thelia\Exception\FileException
*/
public function updateFile(FileCreateOrUpdateEvent $event)
{
// Copy and save file
if ($event->getUploadedFile()) {
// Remove old picture file from file storage
$url = $event->getModel()->getUploadDir() . '/' . $event->getOldModel()->getFile();
unlink(str_replace('..', '', $url));
$newUploadedFile = $this->fileManager->copyUploadedFile($event->getModel(), $event->getUploadedFile());
$event->setUploadedFile($newUploadedFile);
}
// Update image modifications
$event->getModel()->save();
$event->setModel($event->getModel());
}
/**
* Deleting file in the database and in storage
*
* @param FileDeleteEvent $event Image event
*/
public function deleteFile(FileDeleteEvent $event)
{
$this->fileManager->deleteFile($event->getFileToDelete());
}
public function updatePosition(UpdateFilePositionEvent $event, $eventName, EventDispatcherInterface $dispatcher)
{
$this->genericUpdatePosition($event->getQuery(), $event, $dispatcher);
}
public function toggleVisibility(FileToggleVisibilityEvent $event, $eventName, EventDispatcherInterface $dispatcher)
{
$this->genericToggleVisibility($event->getQuery(), $event, $dispatcher);
}
}

View File

@@ -0,0 +1,175 @@
<?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 Thelia\Action;
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
use Thelia\Core\Event\Brand\BrandCreateEvent;
use Thelia\Core\Event\Brand\BrandDeleteEvent;
use Thelia\Core\Event\Brand\BrandToggleVisibilityEvent;
use Thelia\Core\Event\Brand\BrandUpdateEvent;
use Thelia\Core\Event\TheliaEvents;
use Thelia\Core\Event\UpdatePositionEvent;
use Thelia\Core\Event\UpdateSeoEvent;
use Thelia\Core\Event\ViewCheckEvent;
use Thelia\Model\Brand as BrandModel;
use Thelia\Model\BrandQuery;
/**
* Class Brand
*
* @package Thelia\Action
* @author Franck Allimant <franck@cqfdev.fr>
*/
class Brand extends BaseAction implements EventSubscriberInterface
{
public function create(BrandCreateEvent $event)
{
$brand = new BrandModel();
$brand
->setVisible($event->getVisible())
->setLocale($event->getLocale())
->setTitle($event->getTitle())
->save()
;
$event->setBrand($brand);
}
/**
* process update brand
*
* @param BrandUpdateEvent $event
* @param $eventName
* @param EventDispatcherInterface $dispatcher
*/
public function update(BrandUpdateEvent $event, $eventName, EventDispatcherInterface $dispatcher)
{
if (null !== $brand = BrandQuery::create()->findPk($event->getBrandId())) {
$brand->setDispatcher($dispatcher);
$brand
->setVisible($event->getVisible())
->setLogoImageId(intval($event->getLogoImageId()) == 0 ? null : $event->getLogoImageId())
->setLocale($event->getLocale())
->setTitle($event->getTitle())
->setDescription($event->getDescription())
->setChapo($event->getChapo())
->setPostscriptum($event->getPostscriptum())
->save()
;
$event->setBrand($brand);
}
}
/**
* Toggle Brand visibility
*
* @param BrandToggleVisibilityEvent $event
* @param string $eventName
* @param EventDispatcherInterface $dispatcher
* @throws \Exception
* @throws \Propel\Runtime\Exception\PropelException
*/
public function toggleVisibility(BrandToggleVisibilityEvent $event, $eventName, EventDispatcherInterface $dispatcher)
{
$brand = $event->getBrand();
$brand
->setDispatcher($dispatcher)
->setVisible(!$brand->getVisible())
->save();
$event->setBrand($brand);
}
/**
* Change Brand SEO
*
* @param UpdateSeoEvent $event
* @param $eventName
* @param EventDispatcherInterface $dispatcher
* @return Object
*/
public function updateSeo(UpdateSeoEvent $event, $eventName, EventDispatcherInterface $dispatcher)
{
return $this->genericUpdateSeo(BrandQuery::create(), $event, $dispatcher);
}
public function delete(BrandDeleteEvent $event, $eventName, EventDispatcherInterface $dispatcher)
{
if (null !== $brand = BrandQuery::create()->findPk($event->getBrandId())) {
$brand->setDispatcher($dispatcher)->delete();
$event->setBrand($brand);
}
}
public function updatePosition(UpdatePositionEvent $event, $eventName, EventDispatcherInterface $dispatcher)
{
$this->genericUpdatePosition(BrandQuery::create(), $event, $dispatcher);
}
/**
* Check if is a brand view and if brand_id is visible
*
* @param ViewCheckEvent $event
* @param string $eventName
* @param EventDispatcherInterface $dispatcher
*/
public function viewCheck(ViewCheckEvent $event, $eventName, EventDispatcherInterface $dispatcher)
{
if ($event->getView() == 'brand') {
$brand = BrandQuery::create()
->filterById($event->getViewId())
->filterByVisible(1)
->count();
if ($brand == 0) {
$dispatcher->dispatch(TheliaEvents::VIEW_BRAND_ID_NOT_VISIBLE, $event);
}
}
}
/**
* @param ViewCheckEvent $event
* @throws NotFoundHttpException
*/
public function viewBrandIdNotVisible(ViewCheckEvent $event)
{
throw new NotFoundHttpException();
}
/**
* {@inheritdoc}
*/
public static function getSubscribedEvents()
{
return array(
TheliaEvents::BRAND_CREATE => array('create', 128),
TheliaEvents::BRAND_UPDATE => array('update', 128),
TheliaEvents::BRAND_DELETE => array('delete', 128),
TheliaEvents::BRAND_UPDATE_SEO => array('updateSeo', 128),
TheliaEvents::BRAND_UPDATE_POSITION => array('updatePosition', 128),
TheliaEvents::BRAND_TOGGLE_VISIBILITY => array('toggleVisibility', 128),
TheliaEvents::VIEW_CHECK => array('viewCheck', 128),
TheliaEvents::VIEW_BRAND_ID_NOT_VISIBLE => array('viewBrandIdNotVisible', 128),
);
}
}

View File

@@ -0,0 +1,60 @@
<?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 Thelia\Action;
use Symfony\Component\Cache\Adapter\AdapterInterface;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
use Symfony\Component\Filesystem\Filesystem;
use Thelia\Core\Event\Cache\CacheEvent;
use Thelia\Core\Event\TheliaEvents;
/**
* Class Cache
* @package Thelia\Action
* @author Manuel Raynaud <manu@raynaud.io>
*/
class Cache extends BaseAction implements EventSubscriberInterface
{
/** @var AdapterInterface */
protected $adapter;
/**
* CacheListener constructor.
* @param AdapterInterface $adapter
*/
public function __construct(AdapterInterface $adapter)
{
$this->adapter = $adapter;
}
public function cacheClear(CacheEvent $event)
{
// clear cache on thelia.cache service
$this->adapter->clear();
$dir = $event->getDir();
$fs = new Filesystem();
$fs->remove($dir);
}
/**
* {@inheritdoc}
*/
public static function getSubscribedEvents()
{
return array(
TheliaEvents::CACHE_CLEAR => array('cacheClear', 128)
);
}
}

View File

@@ -0,0 +1,550 @@
<?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 Thelia\Action;
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
use Symfony\Component\HttpFoundation\RequestStack;
use Thelia\Core\Event\Cart\CartCreateEvent;
use Thelia\Core\Event\Cart\CartDuplicationEvent;
use Thelia\Core\Event\Cart\CartPersistEvent;
use Thelia\Core\Event\Cart\CartRestoreEvent;
use Thelia\Core\Event\Cart\CartEvent;
use Thelia\Core\Event\Currency\CurrencyChangeEvent;
use Thelia\Core\Event\TheliaEvents;
use Thelia\Exception\TheliaProcessException;
use Thelia\Model\Base\CustomerQuery;
use Thelia\Model\Base\ProductSaleElementsQuery;
use Thelia\Model\Currency as CurrencyModel;
use Thelia\Model\CartItem;
use Thelia\Model\Cart as CartModel;
use Thelia\Model\CartItemQuery;
use Thelia\Model\CartQuery;
use Thelia\Model\ConfigQuery;
use Thelia\Model\Customer as CustomerModel;
use Thelia\Model\ProductSaleElements;
use Thelia\Model\Tools\ProductPriceTools;
use Thelia\Tools\TokenProvider;
/**
*
* Class Cart where all actions are manage like adding, modifying or delete items.
*
* Class Cart
* @package Thelia\Action
* @author Manuel Raynaud <manu@raynaud.io>
*/
class Cart extends BaseAction implements EventSubscriberInterface
{
/** @var RequestStack */
protected $requestStack;
/** @var TokenProvider */
protected $tokenProvider;
public function __construct(RequestStack $requestStack, TokenProvider $tokenProvider)
{
$this->requestStack = $requestStack;
$this->tokenProvider = $tokenProvider;
}
public function persistCart(CartPersistEvent $event)
{
$cart = $event->getCart();
if ($cart->isNew()) {
$cart
->setToken($this->generateCartCookieIdentifier())
->save();
$this->getSession()->setSessionCart($cart);
}
}
/**
* add an article in the current cart
*
* @param \Thelia\Core\Event\Cart\CartEvent $event
* @param $eventName
* @param EventDispatcherInterface $dispatcher
*/
public function addItem(CartEvent $event, $eventName, EventDispatcherInterface $dispatcher)
{
$cart = $event->getCart();
$newness = $event->getNewness();
$append = $event->getAppend();
$quantity = $event->getQuantity();
$currency = $cart->getCurrency();
$customer = $cart->getCustomer();
$discount = 0;
if ($cart->isNew()) {
$persistEvent = new CartPersistEvent($cart);
$dispatcher->dispatch(TheliaEvents::CART_PERSIST, $persistEvent);
}
if (null !== $customer && $customer->getDiscount() > 0) {
$discount = $customer->getDiscount();
}
$productSaleElementsId = $event->getProductSaleElementsId();
$productId = $event->getProduct();
// Search for an identical item in the cart
$findItemEvent = clone $event;
$dispatcher->dispatch(TheliaEvents::CART_FINDITEM, $findItemEvent);
$cartItem = $findItemEvent->getCartItem();
if ($cartItem === null || $newness) {
$productSaleElements = ProductSaleElementsQuery::create()->findPk($productSaleElementsId);
if (null !== $productSaleElements) {
$productPrices = $productSaleElements->getPricesByCurrency($currency, $discount);
$cartItem = $this->doAddItem($dispatcher, $cart, $productId, $productSaleElements, $quantity, $productPrices);
} else {
// We did no find any PSE... Something is wrong with the DB, just throw an exception.
throw new TheliaProcessException("This item cannot be added to the cart: no matching product sale element was found.");
}
} elseif ($append && $cartItem !== null) {
$cartItem->addQuantity($quantity)->save();
}
$event->setCartItem($cartItem);
}
/**
*
* Delete specify article present into cart
*
* @param \Thelia\Core\Event\Cart\CartEvent $event
*/
public function deleteItem(CartEvent $event)
{
if (null !== $cartItemId = $event->getCartItemId()) {
$cart = $event->getCart();
CartItemQuery::create()
->filterByCartId($cart->getId())
->filterById($cartItemId)
->delete();
// Force an update of the Cart object to provide
// to other listeners an updated CartItem collection.
$cart->clearCartItems();
}
}
/**
* Clear the cart
* @param CartEvent $event
*/
public function clear(CartEvent $event)
{
if (null !== $cart = $event->getCart()) {
$cart->delete();
}
}
/**
*
* Modify article's quantity
*
* don't use Form here just test the Request.
*
* @param \Thelia\Core\Event\Cart\CartEvent $event
* @param $eventName
* @param EventDispatcherInterface $dispatcher
*/
public function changeItem(CartEvent $event, $eventName, EventDispatcherInterface $dispatcher)
{
if ((null !== $cartItemId = $event->getCartItemId()) && (null !== $quantity = $event->getQuantity())) {
$cart = $event->getCart();
$cartItem = CartItemQuery::create()
->filterByCartId($cart->getId())
->filterById($cartItemId)
->findOne();
if ($cartItem) {
$event->setCartItem(
$this->updateQuantity($dispatcher, $cartItem, $quantity)
);
}
}
}
public function updateCart(CurrencyChangeEvent $event, $eventName, EventDispatcherInterface $dispatcher)
{
$cart = $event->getRequest()->getSession()->getSessionCart($dispatcher);
if (null !== $cart) {
$this->updateCartPrices($cart, $event->getCurrency());
}
}
/**
*
* Refresh article's price
*
* @param \Thelia\Model\Cart $cart
* @param \Thelia\Model\Currency $currency
*/
public function updateCartPrices(CartModel $cart, CurrencyModel $currency)
{
$customer = $cart->getCustomer();
$discount = 0;
if (null !== $customer && $customer->getDiscount() > 0) {
$discount = $customer->getDiscount();
}
// cart item
foreach ($cart->getCartItems() as $cartItem) {
$productSaleElements = $cartItem->getProductSaleElements();
$productPrice = $productSaleElements->getPricesByCurrency($currency, $discount);
$cartItem
->setPrice($productPrice->getPrice())
->setPromoPrice($productPrice->getPromoPrice());
$cartItem->save();
}
// update the currency cart
$cart->setCurrencyId($currency->getId());
$cart->save();
}
/**
* increase the quantity for an existing cartItem
*
* @param EventDispatcherInterface $dispatcher
* @param CartItem $cartItem
* @param float $quantity
*
* @throws \Exception
* @throws \Propel\Runtime\Exception\PropelException
* @return CartItem
*/
protected function updateQuantity(EventDispatcherInterface $dispatcher, CartItem $cartItem, $quantity)
{
$cartItem->setDisptacher($dispatcher);
$cartItem->updateQuantity($quantity)
->save();
return $cartItem;
}
/**
* try to attach a new item to an existing cart
*
* @param EventDispatcherInterface $dispatcher
* @param \Thelia\Model\Cart $cart
* @param int $productId
* @param ProductSaleElements $productSaleElements
* @param float $quantity
* @param ProductPriceTools $productPrices
*
* @return CartItem
*/
protected function doAddItem(
EventDispatcherInterface $dispatcher,
CartModel $cart,
$productId,
ProductSaleElements $productSaleElements,
$quantity,
ProductPriceTools $productPrices
) {
$cartItem = new CartItem();
$cartItem->setDisptacher($dispatcher);
$cartItem
->setCart($cart)
->setProductId($productId)
->setProductSaleElementsId($productSaleElements->getId())
->setQuantity($quantity)
->setPrice($productPrices->getPrice())
->setPromoPrice($productPrices->getPromoPrice())
->setPromo($productSaleElements->getPromo())
->setPriceEndOfLife(time() + ConfigQuery::read("cart.priceEOF", 60*60*24*30))
->save();
return $cartItem;
}
/**
* find a specific record in CartItem table using the Cart id, the product id
* and the product_sale_elements id
*
* @param int $cartId
* @param int $productId
* @param int $productSaleElementsId
* @return CartItem
*
* @deprecated this method is deprecated. Dispatch a TheliaEvents::CART_FINDITEM instead
*/
protected function findItem($cartId, $productId, $productSaleElementsId)
{
return CartItemQuery::create()
->filterByCartId($cartId)
->filterByProductId($productId)
->filterByProductSaleElementsId($productSaleElementsId)
->findOne();
}
/**
* Find a specific record in CartItem table using the current CartEvent
*
* @param CartEvent $event the cart event
*/
public function findCartItem(CartEvent $event)
{
// Do not try to find a cartItem if one exists in the event, as previous event handlers
// mays have put it in th event.
if (null === $event->getCartItem() && null !== $foundItem = CartItemQuery::create()
->filterByCartId($event->getCart()->getId())
->filterByProductId($event->getProduct())
->filterByProductSaleElementsId($event->getProductSaleElementsId())
->findOne()) {
$event->setCartItem($foundItem);
}
}
/**
* Search if cart already exists in session. If not try to restore it from the cart cookie,
* or duplicate an old one.
*
* @param CartRestoreEvent $cartRestoreEvent
* @param $eventName
* @param EventDispatcherInterface $dispatcher
*/
public function restoreCurrentCart(CartRestoreEvent $cartRestoreEvent, $eventName, EventDispatcherInterface $dispatcher)
{
$cookieName = ConfigQuery::read("cart.cookie_name", 'thelia_cart');
$persistentCookie = ConfigQuery::read("cart.use_persistent_cookie", 1);
$cart = null;
if ($this->requestStack->getCurrentRequest()->cookies->has($cookieName) && $persistentCookie) {
$cart = $this->managePersistentCart($cartRestoreEvent, $cookieName, $dispatcher);
} elseif (!$persistentCookie) {
$cart = $this->manageNonPersistentCookie($cartRestoreEvent, $dispatcher);
}
// Still no cart ? Create a new one.
if (null === $cart) {
$cart = $this->dispatchNewCart($dispatcher);
}
$cartRestoreEvent->setCart($cart);
}
/**
* The cart token is not saved in a cookie, if the cart is present in session, we just change the customer id
* if needed or create duplicate the current cart if the customer is not the same as customer already present in
* the cart.
*
* @param CartRestoreEvent $cartRestoreEvent
* @param EventDispatcherInterface $dispatcher
* @return CartModel
* @throws \Exception
* @throws \Propel\Runtime\Exception\PropelException
*/
protected function manageNonPersistentCookie(CartRestoreEvent $cartRestoreEvent, EventDispatcherInterface $dispatcher)
{
$cart = $cartRestoreEvent->getCart();
if (null === $cart) {
$cart = $this->dispatchNewCart($dispatcher);
} else {
$cart = $this->manageCartDuplicationAtCustomerLogin($cart, $dispatcher);
}
return $cart;
}
/**
*
* The cart token is saved in a cookie so we try to retrieve it. Then the customer is checked.
*
* @param CartRestoreEvent $cartRestoreEvent
* @param $cookieName
* @param EventDispatcherInterface $dispatcher
* @return CartModel
* @throws \Exception
* @throws \Propel\Runtime\Exception\PropelException
*/
protected function managePersistentCart(CartRestoreEvent $cartRestoreEvent, $cookieName, EventDispatcherInterface $dispatcher)
{
// The cart cookie exists -> get the cart token
$token = $this->requestStack->getCurrentRequest()->cookies->get($cookieName);
// Check if a cart exists for this token
if (null !== $cart = CartQuery::create()->findOneByToken($token)) {
$cart = $this->manageCartDuplicationAtCustomerLogin($cart, $dispatcher);
}
return $cart;
}
protected function manageCartDuplicationAtCustomerLogin(CartModel $cart, EventDispatcherInterface $dispatcher)
{
/** @var CustomerModel $customer */
if (null !== $customer = $this->getSession()->getCustomerUser()) {
// Check if we have to duplicate the existing cart.
$duplicateCart = true;
// A customer is logged in.
if (null === $cart->getCustomerId()) {
// If the customer has a discount, whe have to duplicate the cart,
// so that the discount will be applied to the products in cart.
if (0 === $customer->getDiscount() || 0 === $cart->countCartItems()) {
// If no discount, or an empty cart, there's no need to duplicate.
$duplicateCart = false;
}
}
if ($duplicateCart) {
// Duplicate the cart
$cart = $this->duplicateCart($dispatcher, $cart, $customer);
} else {
// No duplication required, just assign the cart to the customer
$cart->setCustomerId($customer->getId())->save();
}
} elseif ($cart->getCustomerId() != null) {
// The cart belongs to another user
if (0 === $cart->countCartItems()) {
// No items in cart, assign it to nobody.
$cart->setCustomerId(null)->save();
} else {
// Some itemls in cart, duplicate it without assigning a customer ID.
$cart = $this->duplicateCart($dispatcher, $cart);
}
}
return $cart;
}
/**
* @param EventDispatcherInterface $dispatcher
* @return CartModel
*/
protected function dispatchNewCart(EventDispatcherInterface $dispatcher)
{
$cartCreateEvent = new CartCreateEvent();
$dispatcher->dispatch(TheliaEvents::CART_CREATE_NEW, $cartCreateEvent);
return $cartCreateEvent->getCart();
}
/**
* Create a new, empty cart object, and assign it to the current customer, if any.
*
* @param CartCreateEvent $cartCreateEvent
*/
public function createEmptyCart(CartCreateEvent $cartCreateEvent)
{
$cart = new CartModel();
$cart->setCurrency($this->getSession()->getCurrency(true));
/** @var CustomerModel $customer */
if (null !== $customer = $this->getSession()->getCustomerUser()) {
$cart->setCustomer(CustomerQuery::create()->findPk($customer->getId()));
}
$this->getSession()->setSessionCart($cart);
if (ConfigQuery::read("cart.use_persistent_cookie", 1) == 1) {
// set cart_use_cookie to "" to remove the cart cookie
// see Thelia\Core\EventListener\ResponseListener
$this->getSession()->set("cart_use_cookie", "");
}
$cartCreateEvent->setCart($cart);
}
/**
* Duplicate an existing Cart. If a customer ID is provided the created cart will be attached to this customer.
*
* @param EventDispatcherInterface $dispatcher
* @param CartModel $cart
* @param CustomerModel $customer
* @return CartModel
*/
protected function duplicateCart(EventDispatcherInterface $dispatcher, CartModel $cart, CustomerModel $customer = null)
{
$newCart = $cart->duplicate(
$this->generateCartCookieIdentifier(),
$customer,
$this->getSession()->getCurrency(),
$dispatcher
);
$cartEvent = new CartDuplicationEvent($newCart, $cart);
$dispatcher->dispatch(TheliaEvents::CART_DUPLICATE, $cartEvent);
return $cartEvent->getDuplicatedCart();
}
/**
* Generate the cart cookie identifier, or return null if the cart is only managed in the session object,
* not in a client cookie.
*
* @return string
*/
protected function generateCartCookieIdentifier()
{
$id = null;
if (ConfigQuery::read("cart.use_persistent_cookie", 1) == 1) {
$id = $this->tokenProvider->getToken();
$this->getSession()->set('cart_use_cookie', $id);
}
return $id;
}
/**
* {@inheritdoc}
*/
public static function getSubscribedEvents()
{
return array(
TheliaEvents::CART_PERSIST => array("persistCart", 128),
TheliaEvents::CART_RESTORE_CURRENT => array("restoreCurrentCart", 128),
TheliaEvents::CART_CREATE_NEW => array("createEmptyCart", 128),
TheliaEvents::CART_ADDITEM => array("addItem", 128),
TheliaEvents::CART_FINDITEM => array("findCartItem", 128),
TheliaEvents::CART_DELETEITEM => array("deleteItem", 128),
TheliaEvents::CART_UPDATEITEM => array("changeItem", 128),
TheliaEvents::CART_CLEAR => array("clear", 128),
TheliaEvents::CHANGE_DEFAULT_CURRENCY => array("updateCart", 128),
);
}
/**
* Returns the session from the current request
*
* @return \Thelia\Core\HttpFoundation\Session\Session
*/
protected function getSession()
{
return $this->requestStack->getCurrentRequest()->getSession();
}
}

View File

@@ -0,0 +1,268 @@
<?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 Thelia\Action;
use Propel\Runtime\Propel;
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
use Thelia\Core\Event\File\FileDeleteEvent;
use Thelia\Core\Event\UpdateSeoEvent;
use Thelia\Model\CategoryDocumentQuery;
use Thelia\Model\CategoryImageQuery;
use Thelia\Model\CategoryQuery;
use Thelia\Model\Category as CategoryModel;
use Thelia\Core\Event\TheliaEvents;
use Thelia\Core\Event\Category\CategoryUpdateEvent;
use Thelia\Core\Event\Category\CategoryCreateEvent;
use Thelia\Core\Event\Category\CategoryDeleteEvent;
use Thelia\Core\Event\UpdatePositionEvent;
use Thelia\Core\Event\Category\CategoryToggleVisibilityEvent;
use Thelia\Core\Event\Category\CategoryAddContentEvent;
use Thelia\Core\Event\Category\CategoryDeleteContentEvent;
use Thelia\Core\Event\ViewCheckEvent;
use Thelia\Model\CategoryAssociatedContent;
use Thelia\Model\CategoryAssociatedContentQuery;
use Thelia\Model\Map\CategoryTableMap;
class Category extends BaseAction implements EventSubscriberInterface
{
/**
* Create a new category entry
*
* @param \Thelia\Core\Event\Category\CategoryCreateEvent $event
* @param $eventName
* @param EventDispatcherInterface $dispatcher
*/
public function create(CategoryCreateEvent $event, $eventName, EventDispatcherInterface $dispatcher)
{
$category = new CategoryModel();
$category
->setDispatcher($dispatcher)
->setLocale($event->getLocale())
->setParent($event->getParent())
->setVisible($event->getVisible())
->setTitle($event->getTitle())
->save()
;
$event->setCategory($category);
}
/**
* Change a category
*
* @param \Thelia\Core\Event\Category\CategoryUpdateEvent $event
* @param $eventName
* @param EventDispatcherInterface $dispatcher
*/
public function update(CategoryUpdateEvent $event, $eventName, EventDispatcherInterface $dispatcher)
{
if (null !== $category = CategoryQuery::create()->findPk($event->getCategoryId())) {
$category
->setDispatcher($dispatcher)
->setDefaultTemplateId($event->getDefaultTemplateId() == 0 ? null : $event->getDefaultTemplateId())
->setLocale($event->getLocale())
->setTitle($event->getTitle())
->setDescription($event->getDescription())
->setChapo($event->getChapo())
->setPostscriptum($event->getPostscriptum())
->setParent($event->getParent())
->setVisible($event->getVisible())
->save();
$event->setCategory($category);
}
}
/**
* Change a Category SEO
*
* @param UpdateSeoEvent $event
* @param $eventName
* @param EventDispatcherInterface $dispatcher
* @return Object
*/
public function updateSeo(UpdateSeoEvent $event, $eventName, EventDispatcherInterface $dispatcher)
{
return $this->genericUpdateSeo(CategoryQuery::create(), $event, $dispatcher);
}
/**
* Delete a category entry
*
* @param \Thelia\Core\Event\Category\CategoryDeleteEvent $event
* @param $eventName
* @param EventDispatcherInterface $dispatcher
* @throws \Exception
*/
public function delete(CategoryDeleteEvent $event, $eventName, EventDispatcherInterface $dispatcher)
{
if (null !== $category = CategoryQuery::create()->findPk($event->getCategoryId())) {
$con = Propel::getWriteConnection(CategoryTableMap::DATABASE_NAME);
$con->beginTransaction();
try {
$fileList = ['images' => [], 'documentList' => []];
// Get category's files to delete after category deletion
$fileList['images']['list'] = CategoryImageQuery::create()
->findByCategoryId($event->getCategoryId());
$fileList['images']['type'] = TheliaEvents::IMAGE_DELETE;
$fileList['documentList']['list'] = CategoryDocumentQuery::create()
->findByCategoryId($event->getCategoryId());
$fileList['documentList']['type'] = TheliaEvents::DOCUMENT_DELETE;
// Delete category
$category
->setDispatcher($dispatcher)
->delete($con);
$event->setCategory($category);
// Dispatch delete category's files event
foreach ($fileList as $fileTypeList) {
foreach ($fileTypeList['list'] as $fileToDelete) {
$fileDeleteEvent = new FileDeleteEvent($fileToDelete);
$dispatcher->dispatch($fileTypeList['type'], $fileDeleteEvent);
}
}
$con->commit();
} catch (\Exception $e) {
$con->rollback();
throw $e;
}
}
}
/**
* Toggle category visibility. No form used here
*
* @param CategoryToggleVisibilityEvent $event
* @param $eventName
* @param EventDispatcherInterface $dispatcher
*/
public function toggleVisibility(CategoryToggleVisibilityEvent $event, $eventName, EventDispatcherInterface $dispatcher)
{
$category = $event->getCategory();
$category
->setDispatcher($dispatcher)
->setVisible($category->getVisible() ? false : true)
->save()
;
$event->setCategory($category);
}
/**
* Changes position, selecting absolute ou relative change.
*
* @param UpdatePositionEvent $event
* @param $eventName
* @param EventDispatcherInterface $dispatcher
*/
public function updatePosition(UpdatePositionEvent $event, $eventName, EventDispatcherInterface $dispatcher)
{
$this->genericUpdatePosition(CategoryQuery::create(), $event, $dispatcher);
}
public function addContent(CategoryAddContentEvent $event, $eventName, EventDispatcherInterface $dispatcher)
{
if (CategoryAssociatedContentQuery::create()
->filterByContentId($event->getContentId())
->filterByCategory($event->getCategory())->count() <= 0) {
$content = new CategoryAssociatedContent();
$content
->setDispatcher($dispatcher)
->setCategory($event->getCategory())
->setContentId($event->getContentId())
->save()
;
}
}
public function removeContent(CategoryDeleteContentEvent $event, $eventName, EventDispatcherInterface $dispatcher)
{
$content = CategoryAssociatedContentQuery::create()
->filterByContentId($event->getContentId())
->filterByCategory($event->getCategory())->findOne()
;
if ($content !== null) {
$content
->setDispatcher($dispatcher)
->delete();
}
}
/**
* Check if is a category view and if category_id is visible
*
* @param ViewCheckEvent $event
* @param string $eventName
* @param EventDispatcherInterface $dispatcher
*/
public function viewCheck(ViewCheckEvent $event, $eventName, EventDispatcherInterface $dispatcher)
{
if ($event->getView() == 'category') {
$category = CategoryQuery::create()
->filterById($event->getViewId())
->filterByVisible(1)
->count();
if ($category == 0) {
$dispatcher->dispatch(TheliaEvents::VIEW_CATEGORY_ID_NOT_VISIBLE, $event);
}
}
}
/**
* @param ViewCheckEvent $event
* @throws NotFoundHttpException
*/
public function viewcategoryIdNotVisible(ViewCheckEvent $event)
{
throw new NotFoundHttpException();
}
/**
* {@inheritDoc}
*/
public static function getSubscribedEvents()
{
return array(
TheliaEvents::CATEGORY_CREATE => array("create", 128),
TheliaEvents::CATEGORY_UPDATE => array("update", 128),
TheliaEvents::CATEGORY_DELETE => array("delete", 128),
TheliaEvents::CATEGORY_TOGGLE_VISIBILITY => array("toggleVisibility", 128),
TheliaEvents::CATEGORY_UPDATE_POSITION => array("updatePosition", 128),
TheliaEvents::CATEGORY_UPDATE_SEO => array("updateSeo", 128),
TheliaEvents::CATEGORY_ADD_CONTENT => array("addContent", 128),
TheliaEvents::CATEGORY_REMOVE_CONTENT => array("removeContent", 128),
TheliaEvents::VIEW_CHECK => array('viewCheck', 128),
TheliaEvents::VIEW_CATEGORY_ID_NOT_VISIBLE => array('viewcategoryIdNotVisible', 128),
);
}
}

View File

@@ -0,0 +1,128 @@
<?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 Thelia\Action;
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
use Thelia\Core\Event\Config\ConfigCreateEvent;
use Thelia\Core\Event\Config\ConfigDeleteEvent;
use Thelia\Core\Event\Config\ConfigUpdateEvent;
use Thelia\Core\Event\TheliaEvents;
use Thelia\Model\Config as ConfigModel;
use Thelia\Model\ConfigQuery;
class Config extends BaseAction implements EventSubscriberInterface
{
/**
* Create a new configuration entry
*
* @param \Thelia\Core\Event\Config\ConfigCreateEvent $event
* @param $eventName
* @param EventDispatcherInterface $dispatcher
*/
public function create(ConfigCreateEvent $event, $eventName, EventDispatcherInterface $dispatcher)
{
$config = new ConfigModel();
$config->setDispatcher($dispatcher)
->setName($event->getEventName())
->setValue($event->getValue())
->setLocale($event->getLocale())
->setTitle($event->getTitle())
->setHidden($event->getHidden())
->setSecured($event->getSecured())
->save();
$event->setConfig($config);
}
/**
* Change a configuration entry value
*
* @param \Thelia\Core\Event\Config\ConfigUpdateEvent $event
* @param $eventName
* @param EventDispatcherInterface $dispatcher
*/
public function setValue(ConfigUpdateEvent $event, $eventName, EventDispatcherInterface $dispatcher)
{
if (null !== $config = ConfigQuery::create()->findPk($event->getConfigId())) {
if ($event->getValue() !== $config->getValue()) {
$config->setDispatcher($dispatcher)->setValue($event->getValue())->save();
$event->setConfig($config);
}
}
}
/**
* Change a configuration entry
*
* @param \Thelia\Core\Event\Config\ConfigUpdateEvent $event
* @param $eventName
* @param EventDispatcherInterface $dispatcher
*/
public function modify(ConfigUpdateEvent $event, $eventName, EventDispatcherInterface $dispatcher)
{
if (null !== $config = ConfigQuery::create()->findPk($event->getConfigId())) {
$config->setDispatcher($dispatcher)
->setName($event->getEventName())
->setValue($event->getValue())
->setHidden($event->getHidden())
->setSecured($event->getSecured())
->setLocale($event->getLocale())
->setTitle($event->getTitle())
->setDescription($event->getDescription())
->setChapo($event->getChapo())
->setPostscriptum($event->getPostscriptum())
->save();
$event->setConfig($config);
}
}
/**
* Delete a configuration entry
*
* @param \Thelia\Core\Event\Config\ConfigDeleteEvent $event
* @param $eventName
* @param EventDispatcherInterface $dispatcher
*/
public function delete(ConfigDeleteEvent $event, $eventName, EventDispatcherInterface $dispatcher)
{
if (null !== ($config = ConfigQuery::create()->findPk($event->getConfigId()))) {
if (!$config->getSecured()) {
$config->setDispatcher($dispatcher)->delete();
$event->setConfig($config);
}
}
}
/**
* {@inheritDoc}
*/
public static function getSubscribedEvents()
{
return array(
TheliaEvents::CONFIG_CREATE => array(
"create", 128
), TheliaEvents::CONFIG_SETVALUE => array(
"setValue", 128
), TheliaEvents::CONFIG_UPDATE => array(
"modify", 128
), TheliaEvents::CONFIG_DELETE => array(
"delete", 128
),
);
}
}

View File

@@ -0,0 +1,263 @@
<?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 Thelia\Action;
use Propel\Runtime\Exception\PropelException;
use Propel\Runtime\Propel;
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
use Thelia\Core\Event\Content\ContentAddFolderEvent;
use Thelia\Core\Event\Content\ContentCreateEvent;
use Thelia\Core\Event\Content\ContentDeleteEvent;
use Thelia\Core\Event\Content\ContentRemoveFolderEvent;
use Thelia\Core\Event\Content\ContentToggleVisibilityEvent;
use Thelia\Core\Event\Content\ContentUpdateEvent;
use Thelia\Core\Event\File\FileDeleteEvent;
use Thelia\Core\Event\TheliaEvents;
use Thelia\Core\Event\UpdatePositionEvent;
use Thelia\Core\Event\UpdateSeoEvent;
use Thelia\Core\Event\ViewCheckEvent;
use Thelia\Model\ContentDocumentQuery;
use Thelia\Model\ContentFolder;
use Thelia\Model\ContentFolderQuery;
use Thelia\Model\ContentImageQuery;
use Thelia\Model\ContentQuery;
use Thelia\Model\Content as ContentModel;
use Thelia\Model\Map\ContentTableMap;
/**
* Class Content
* @package Thelia\Action
* @author manuel raynaud <manu@raynaud.io>
*/
class Content extends BaseAction implements EventSubscriberInterface
{
public function create(ContentCreateEvent $event, $eventName, EventDispatcherInterface $dispatcher)
{
$content = (new ContentModel)
->setDispatcher($dispatcher)
->setVisible($event->getVisible())
->setLocale($event->getLocale())
->setTitle($event->getTitle())
->create($event->getDefaultFolder())
;
$event->setContent($content);
}
/**
* process update content
*
* @param ContentUpdateEvent $event
* @param $eventName
* @param EventDispatcherInterface $dispatcher
* @throws PropelException
* @throws \Exception
*/
public function update(ContentUpdateEvent $event, $eventName, EventDispatcherInterface $dispatcher)
{
if (null !== $content = ContentQuery::create()->findPk($event->getContentId())) {
$con = Propel::getWriteConnection(ContentTableMap::DATABASE_NAME);
$con->beginTransaction();
$content->setDispatcher($dispatcher);
try {
$content
->setVisible($event->getVisible())
->setLocale($event->getLocale())
->setTitle($event->getTitle())
->setDescription($event->getDescription())
->setChapo($event->getChapo())
->setPostscriptum($event->getPostscriptum())
->save($con)
;
$content->setDefaultFolder($event->getDefaultFolder());
$event->setContent($content);
$con->commit();
} catch (PropelException $e) {
$con->rollBack();
throw $e;
}
}
}
/**
* Change Content SEO
*
* @param UpdateSeoEvent $event
* @param $eventName
* @param EventDispatcherInterface $dispatcher
* @return Object
*/
public function updateSeo(UpdateSeoEvent $event, $eventName, EventDispatcherInterface $dispatcher)
{
return $this->genericUpdateSeo(ContentQuery::create(), $event, $dispatcher);
}
public function updatePosition(UpdatePositionEvent $event, $eventName, EventDispatcherInterface $dispatcher)
{
$this->genericUpdateDelegatePosition(
ContentFolderQuery::create()
->filterByContentId($event->getObjectId())
->filterByFolderId($event->getReferrerId()),
$event,
$dispatcher
);
}
public function toggleVisibility(ContentToggleVisibilityEvent $event, $eventName, EventDispatcherInterface $dispatcher)
{
$content = $event->getContent();
$content
->setDispatcher($dispatcher)
->setVisible(!$content->getVisible())
->save();
$event->setContent($content);
}
public function delete(ContentDeleteEvent $event, $eventName, EventDispatcherInterface $dispatcher)
{
if (null !== $content = ContentQuery::create()->findPk($event->getContentId())) {
$con = Propel::getWriteConnection(ContentTableMap::DATABASE_NAME);
$con->beginTransaction();
try {
$fileList = ['images' => [], 'documentList' => []];
$defaultFolderId = $content->getDefaultFolderId();
// Get content's files to delete after content deletion
$fileList['images']['list'] = ContentImageQuery::create()
->findByContentId($event->getContentId());
$fileList['images']['type'] = TheliaEvents::IMAGE_DELETE;
$fileList['documentList']['list'] = ContentDocumentQuery::create()
->findByContentId($event->getContentId());
$fileList['documentList']['type'] = TheliaEvents::DOCUMENT_DELETE;
// Delete content
$content->setDispatcher($dispatcher)
->delete($con);
$event->setDefaultFolderId($defaultFolderId);
$event->setContent($content);
// Dispatch delete content's files event
foreach ($fileList as $fileTypeList) {
foreach ($fileTypeList['list'] as $fileToDelete) {
$fileDeleteEvent = new FileDeleteEvent($fileToDelete);
$dispatcher->dispatch($fileTypeList['type'], $fileDeleteEvent);
}
}
$con->commit();
} catch (\Exception $e) {
$con->rollback();
throw $e;
}
}
}
/**
*
* associate a folder to a content if the association already does not exists
*
* @param ContentAddFolderEvent $event
*/
public function addFolder(ContentAddFolderEvent $event)
{
if (ContentFolderQuery::create()
->filterByContent($event->getContent())
->filterByFolderId($event->getFolderId())
->count() <= 0
) {
$contentFolder = (new ContentFolder())
->setFolderId($event->getFolderId())
->setContent($event->getContent())
->setDefaultFolder(false);
$contentFolder
->setPosition($contentFolder->getNextPosition())
->save();
}
}
public function removeFolder(ContentRemoveFolderEvent $event)
{
$contentFolder = ContentFolderQuery::create()
->filterByContent($event->getContent())
->filterByFolderId($event->getFolderId())
->findOne();
if (null !== $contentFolder) {
$contentFolder->delete();
}
}
/**
* Check if is a content view and if content_id is visible
*
* @param ViewCheckEvent $event
* @param string $eventName
* @param EventDispatcherInterface $dispatcher
*/
public function viewCheck(ViewCheckEvent $event, $eventName, EventDispatcherInterface $dispatcher)
{
if ($event->getView() == 'content') {
$content = ContentQuery::create()
->filterById($event->getViewId())
->filterByVisible(1)
->count();
if ($content == 0) {
$dispatcher->dispatch(TheliaEvents::VIEW_CONTENT_ID_NOT_VISIBLE, $event);
}
}
}
/**
* @param ViewCheckEvent $event
* @throws NotFoundHttpException
*/
public function viewContentIdNotVisible(ViewCheckEvent $event)
{
throw new NotFoundHttpException();
}
/**
* {@inheritdoc}
*/
public static function getSubscribedEvents()
{
return array(
TheliaEvents::CONTENT_CREATE => array('create', 128),
TheliaEvents::CONTENT_UPDATE => array('update', 128),
TheliaEvents::CONTENT_DELETE => array('delete', 128),
TheliaEvents::CONTENT_TOGGLE_VISIBILITY => array('toggleVisibility', 128),
TheliaEvents::CONTENT_UPDATE_POSITION => array('updatePosition', 128),
TheliaEvents::CONTENT_UPDATE_SEO => array('updateSeo', 128),
TheliaEvents::CONTENT_ADD_FOLDER => array('addFolder', 128),
TheliaEvents::CONTENT_REMOVE_FOLDER => array('removeFolder', 128),
TheliaEvents::VIEW_CHECK => array('viewCheck', 128),
TheliaEvents::VIEW_CONTENT_ID_NOT_VISIBLE => array('viewContentIdNotVisible', 128),
);
}
}

View File

@@ -0,0 +1,121 @@
<?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 Thelia\Action;
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
use Thelia\Core\Event\Country\CountryCreateEvent;
use Thelia\Core\Event\Country\CountryDeleteEvent;
use Thelia\Core\Event\Country\CountryToggleDefaultEvent;
use Thelia\Core\Event\Country\CountryToggleVisibilityEvent;
use Thelia\Core\Event\Country\CountryUpdateEvent;
use Thelia\Core\Event\TheliaEvents;
use Thelia\Model\Country as CountryModel;
use Thelia\Model\CountryQuery;
/**
* Class Country
* @package Thelia\Action
* @author Manuel Raynaud <manu@raynaud.io>
*/
class Country extends BaseAction implements EventSubscriberInterface
{
public function create(CountryCreateEvent $event)
{
$country = new CountryModel();
$country
->setVisible($event->isVisible())
->setIsocode($event->getIsocode())
->setIsoalpha2($event->getIsoAlpha2())
->setIsoalpha3($event->getIsoAlpha3())
->setHasStates($event->isHasStates())
->setLocale($event->getLocale())
->setTitle($event->getTitle())
->save();
$event->setCountry($country);
}
public function update(CountryUpdateEvent $event)
{
if (null !== $country = CountryQuery::create()->findPk($event->getCountryId())) {
$country
->setVisible($event->isVisible())
->setIsocode($event->getIsocode())
->setIsoalpha2($event->getIsoAlpha2())
->setIsoalpha3($event->getIsoAlpha3())
->setHasStates($event->isHasStates())
->setNeedZipCode($event->isNeedZipCode())
->setZipCodeFormat($event->getZipCodeFormat())
->setLocale($event->getLocale())
->setTitle($event->getTitle())
->setChapo($event->getChapo())
->setDescription($event->getDescription())
->save();
$event->setCountry($country);
}
}
public function delete(CountryDeleteEvent $event)
{
if (null !== $country = CountryQuery::create()->findPk($event->getCountryId())) {
$country->delete();
$event->setCountry($country);
}
}
public function toggleDefault(CountryToggleDefaultEvent $event)
{
if (null !== $country = CountryQuery::create()->findPk($event->getCountryId())) {
$country->toggleDefault();
$event->setCountry($country);
}
}
/**
* Toggle Country visibility
*
* @param CountryToggleVisibilityEvent $event
* @param $eventName
* @param EventDispatcherInterface $dispatcher
*/
public function toggleVisibility(CountryToggleVisibilityEvent $event, $eventName, EventDispatcherInterface $dispatcher)
{
$country = $event->getCountry();
$country
->setDispatcher($dispatcher)
->setVisible(!$country->getVisible())
->save();
$event->setCountry($country);
}
/**
* {@inheritdoc}
*/
public static function getSubscribedEvents()
{
return array(
TheliaEvents::COUNTRY_CREATE => array('create', 128),
TheliaEvents::COUNTRY_UPDATE => array('update', 128),
TheliaEvents::COUNTRY_DELETE => array('delete', 128),
TheliaEvents::COUNTRY_TOGGLE_DEFAULT => array('toggleDefault', 128),
TheliaEvents::COUNTRY_TOGGLE_VISIBILITY => array('toggleVisibility', 128)
);
}
}

View File

@@ -0,0 +1,466 @@
<?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 Thelia\Action;
use Propel\Runtime\Propel;
use Symfony\Component\EventDispatcher\Event;
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
use Symfony\Component\HttpFoundation\RequestStack;
use Thelia\Condition\ConditionCollection;
use Thelia\Condition\ConditionFactory;
use Thelia\Condition\Implementation\ConditionInterface;
use Thelia\Core\Event\Coupon\CouponConsumeEvent;
use Thelia\Core\Event\Coupon\CouponCreateOrUpdateEvent;
use Thelia\Core\Event\Coupon\CouponDeleteEvent;
use Thelia\Core\Event\Order\OrderEvent;
use Thelia\Core\Event\TheliaEvents;
use Thelia\Coupon\CouponFactory;
use Thelia\Coupon\CouponManager;
use Thelia\Coupon\Type\CouponInterface;
use Thelia\Model\Coupon as CouponModel;
use Thelia\Model\CouponCountry;
use Thelia\Model\CouponCountryQuery;
use Thelia\Model\CouponModule;
use Thelia\Model\CouponModuleQuery;
use Thelia\Model\CouponQuery;
use Thelia\Model\Map\OrderCouponTableMap;
use Thelia\Model\OrderCoupon;
use Thelia\Model\OrderCouponCountry;
use Thelia\Model\OrderCouponModule;
use Thelia\Model\OrderCouponQuery;
use Thelia\Model\OrderStatusQuery;
/**
* Process Coupon Events
*
* @package Coupon
* @author Guillaume MOREL <gmorel@openstudio.fr>, Franck Allimant <franck@cqfdev.fr>
*
*/
class Coupon extends BaseAction implements EventSubscriberInterface
{
/** @var RequestStack */
protected $requestStack;
/** @var CouponFactory $couponFactory */
protected $couponFactory;
/** @var CouponManager $couponManager */
protected $couponManager;
/** @var ConditionInterface $noConditionRule */
protected $noConditionRule;
/** @var ConditionFactory $conditionFactory */
protected $conditionFactory;
public function __construct(
RequestStack $requestStack,
CouponFactory $couponFactory,
CouponManager $couponManager,
ConditionInterface $noConditionRule,
ConditionFactory $conditionFactory
) {
$this->requestStack = $requestStack;
$this->couponFactory = $couponFactory;
$this->couponManager = $couponManager;
$this->noConditionRule = $noConditionRule;
$this->conditionFactory = $conditionFactory;
}
/**
* Occurring when a Coupon is about to be created
*
* @param CouponCreateOrUpdateEvent $event Event creation or update Coupon
* @param $eventName
* @param EventDispatcherInterface $dispatcher
*/
public function create(CouponCreateOrUpdateEvent $event, $eventName, EventDispatcherInterface $dispatcher)
{
$coupon = new CouponModel();
$this->createOrUpdate($coupon, $event, $dispatcher);
}
/**
* Occurring when a Coupon is about to be updated
*
* @param CouponCreateOrUpdateEvent $event Event creation or update Coupon
* @param $eventName
* @param EventDispatcherInterface $dispatcher
*/
public function update(CouponCreateOrUpdateEvent $event, $eventName, EventDispatcherInterface $dispatcher)
{
$coupon = $event->getCouponModel();
$this->createOrUpdate($coupon, $event, $dispatcher);
}
public function delete(CouponDeleteEvent $event)
{
$coupon = $event->getCoupon();
if (null === $coupon) {
throw new \InvalidArgumentException(
sprintf(
"The coupon id '%d' doesn't exist",
$event->getCouponId()
)
);
}
$coupon->delete();
$event->setCoupon(null);
}
/**
* Occurring when a Coupon condition is about to be updated
*
* @param CouponCreateOrUpdateEvent $event Event creation or update Coupon condition
* @param $eventName
* @param EventDispatcherInterface $dispatcher
*/
public function updateCondition(CouponCreateOrUpdateEvent $event, $eventName, EventDispatcherInterface $dispatcher)
{
$modelCoupon = $event->getCouponModel();
$this->createOrUpdateCondition($modelCoupon, $event, $dispatcher);
}
/**
* Clear all coupons in session.
*
* @param Event $event
* @param $eventName
* @param EventDispatcherInterface $dispatcher
*/
public function clearAllCoupons(Event $event, $eventName, EventDispatcherInterface $dispatcher)
{
// Tell coupons to clear any data they may have stored
$this->couponManager->clear();
$this->getSession()->setConsumedCoupons(array());
$this->updateOrderDiscount($event, $eventName, $dispatcher);
}
/**
* Occurring when a Coupon condition is about to be consumed
*
* @param CouponConsumeEvent $event Event consuming Coupon
* @param $eventName
* @param EventDispatcherInterface $dispatcher
*/
public function consume(CouponConsumeEvent $event, $eventName, EventDispatcherInterface $dispatcher)
{
$totalDiscount = 0;
$isValid = false;
/** @var CouponInterface $coupon */
$coupon = $this->couponFactory->buildCouponFromCode($event->getCode());
if ($coupon) {
$isValid = $coupon->isMatching();
if ($isValid) {
$this->couponManager->pushCouponInSession($event->getCode());
$totalDiscount = $this->couponManager->getDiscount();
$this->getSession()
->getSessionCart($dispatcher)
->setDiscount($totalDiscount)
->save();
$this->getSession()
->getOrder()
->setDiscount($totalDiscount)
;
}
}
$event->setIsValid($isValid);
$event->setDiscount($totalDiscount);
}
public function updateOrderDiscount(Event $event, $eventName, EventDispatcherInterface $dispatcher)
{
$discount = $this->couponManager->getDiscount();
$this->getSession()
->getSessionCart($dispatcher)
->setDiscount($discount)
->save();
$this->getSession()
->getOrder()
->setDiscount($discount);
}
/**
* Call the Model and delegate the create or delete action
* Feed the Event with the updated model
*
* @param CouponModel $coupon Model to save
* @param CouponCreateOrUpdateEvent $event Event containing data
* @param EventDispatcherInterface $dispatcher
*/
protected function createOrUpdate(CouponModel $coupon, CouponCreateOrUpdateEvent $event, EventDispatcherInterface $dispatcher)
{
$coupon->setDispatcher($dispatcher);
// Set default condition if none found
/** @var ConditionInterface $noConditionRule */
$noConditionRule = $this->noConditionRule;
/** @var ConditionFactory $conditionFactory */
$conditionFactory = $this->conditionFactory;
$couponRuleCollection = new ConditionCollection();
$couponRuleCollection[] = $noConditionRule;
$defaultSerializedRule = $conditionFactory->serializeConditionCollection(
$couponRuleCollection
);
$coupon->createOrUpdate(
$event->getCode(),
$event->getTitle(),
$event->getEffects(),
$event->getServiceId(),
$event->isRemovingPostage(),
$event->getShortDescription(),
$event->getDescription(),
$event->isEnabled(),
$event->getExpirationDate(),
$event->isAvailableOnSpecialOffers(),
$event->isCumulative(),
$event->getMaxUsage(),
$defaultSerializedRule,
$event->getLocale(),
$event->getFreeShippingForCountries(),
$event->getFreeShippingForMethods(),
$event->getPerCustomerUsageCount(),
$event->getStartDate()
);
$event->setCouponModel($coupon);
}
/**
* Call the Model and delegate the create or delete action
* Feed the Event with the updated model
*
* @param CouponModel $coupon Model to save
* @param CouponCreateOrUpdateEvent $event Event containing data
* @param EventDispatcherInterface $dispatcher
*/
protected function createOrUpdateCondition(CouponModel $coupon, CouponCreateOrUpdateEvent $event, EventDispatcherInterface $dispatcher)
{
$coupon->setDispatcher($dispatcher);
/** @var ConditionFactory $conditionFactory */
$conditionFactory = $this->conditionFactory;
$coupon->createOrUpdateConditions(
$conditionFactory->serializeConditionCollection($event->getConditions()),
$event->getLocale()
);
$event->setCouponModel($coupon);
}
/**
* @param \Thelia\Core\Event\Order\OrderEvent $event
*/
public function testFreePostage(OrderEvent $event)
{
$order = $event->getOrder();
if ($this->couponManager->isCouponRemovingPostage($order)) {
$order->setPostage(0);
$event->setOrder($order);
$event->stopPropagation();
}
}
/**
* @param \Thelia\Core\Event\Order\OrderEvent $event
*
* @throws \Exception if something goes wrong.
* @param $eventName
* @param EventDispatcherInterface $dispatcher
*/
public function afterOrder(OrderEvent $event, $eventName, EventDispatcherInterface $dispatcher)
{
/** @var CouponInterface[] $consumedCoupons */
$consumedCoupons = $this->couponManager->getCouponsKept();
if (is_array($consumedCoupons) && count($consumedCoupons) > 0) {
$con = Propel::getWriteConnection(OrderCouponTableMap::DATABASE_NAME);
$con->beginTransaction();
try {
foreach ($consumedCoupons as $couponCode) {
$couponQuery = CouponQuery::create();
$couponModel = $couponQuery->findOneByCode($couponCode->getCode());
$couponModel->setLocale($this->getSession()->getLang()->getLocale());
/* decrease coupon quantity */
$this->couponManager->decrementQuantity($couponModel, $event->getOrder()->getCustomerId());
/* memorize coupon */
$orderCoupon = new OrderCoupon();
$orderCoupon->setOrder($event->getOrder())
->setCode($couponModel->getCode())
->setType($couponModel->getType())
->setAmount($couponCode->exec())
->setTitle($couponModel->getTitle())
->setShortDescription($couponModel->getShortDescription())
->setDescription($couponModel->getDescription())
->setStartDate($couponModel->getStartDate())
->setExpirationDate($couponModel->getExpirationDate())
->setIsCumulative($couponModel->getIsCumulative())
->setIsRemovingPostage($couponModel->getIsRemovingPostage())
->setIsAvailableOnSpecialOffers($couponModel->getIsAvailableOnSpecialOffers())
->setSerializedConditions($couponModel->getSerializedConditions())
->setPerCustomerUsageCount($couponModel->getPerCustomerUsageCount())
;
$orderCoupon->save();
// Copy order coupon free shipping data for countries and modules
$couponCountries = CouponCountryQuery::create()->filterByCouponId($couponModel->getId())->find();
/** @var CouponCountry $couponCountry */
foreach ($couponCountries as $couponCountry) {
$occ = new OrderCouponCountry();
$occ
->setCouponId($orderCoupon->getId())
->setCountryId($couponCountry->getCountryId())
->save();
;
}
$couponModules = CouponModuleQuery::create()->filterByCouponId($couponModel->getId())->find();
/** @var CouponModule $couponModule */
foreach ($couponModules as $couponModule) {
$ocm = new OrderCouponModule();
$ocm
->setCouponId($orderCoupon->getId())
->setModuleId($couponModule->getModuleId())
->save();
;
}
}
$con->commit();
} catch (\Exception $ex) {
$con->rollBack();
throw($ex);
}
}
// Clear all coupons.
$dispatcher->dispatch(TheliaEvents::COUPON_CLEAR_ALL);
}
/**
* Cancels order coupons usage when order is canceled or refunded,
* or use canceled coupons again if the order is no longer canceled or refunded
*
* @param OrderEvent $event
* @param string $eventName
* @param EventDispatcherInterface $dispatcher
* @throws \Exception
* @throws \Propel\Runtime\Exception\PropelException
*/
public function orderStatusChange(OrderEvent $event, $eventName, EventDispatcherInterface $dispatcher)
{
// The order has been canceled or refunded ?
if ($event->getOrder()->isCancelled() || $event->getOrder()->isRefunded()) {
// Cancel usage of all coupons for this order
$usedCoupons = OrderCouponQuery::create()
->filterByUsageCanceled(false)
->findByOrderId($event->getOrder()->getId());
$customerId = $event->getOrder()->getCustomerId();
/** @var OrderCoupon $usedCoupon */
foreach ($usedCoupons as $usedCoupon) {
if (null !== $couponModel = CouponQuery::create()->findOneByCode($usedCoupon->getCode())) {
// If the coupon still exists, restore one usage to the usage count.
$this->couponManager->incrementQuantity($couponModel, $customerId);
}
// Mark coupon usage as canceled in the OrderCoupon table
$usedCoupon->setUsageCanceled(true)->save();
}
} else {
// Mark canceled coupons for this order as used again
$usedCoupons = OrderCouponQuery::create()
->filterByUsageCanceled(true)
->findByOrderId($event->getOrder()->getId());
$customerId = $event->getOrder()->getCustomerId();
/** @var OrderCoupon $usedCoupon */
foreach ($usedCoupons as $usedCoupon) {
if (null !== $couponModel = CouponQuery::create()->findOneByCode($usedCoupon->getCode())) {
// If the coupon still exists, mark the coupon as used
$this->couponManager->decrementQuantity($couponModel, $customerId);
}
// The coupon is no longer canceled
$usedCoupon->setUsageCanceled(false)->save();
}
}
}
/**
* {@inheritdoc}
*/
public static function getSubscribedEvents()
{
return array(
TheliaEvents::COUPON_CREATE => array("create", 128),
TheliaEvents::COUPON_UPDATE => array("update", 128),
TheliaEvents::COUPON_DELETE => array("delete", 128),
TheliaEvents::COUPON_CONSUME => array("consume", 128),
TheliaEvents::COUPON_CLEAR_ALL => array("clearAllCoupons", 128),
TheliaEvents::COUPON_CONDITION_UPDATE => array("updateCondition", 128),
TheliaEvents::ORDER_SET_POSTAGE => array("testFreePostage", 132),
TheliaEvents::ORDER_BEFORE_PAYMENT => array("afterOrder", 128),
TheliaEvents::ORDER_UPDATE_STATUS => array("orderStatusChange", 10),
TheliaEvents::CART_ADDITEM => array("updateOrderDiscount", 10),
TheliaEvents::CART_UPDATEITEM => array("updateOrderDiscount", 10),
TheliaEvents::CART_DELETEITEM => array("updateOrderDiscount", 10),
TheliaEvents::CUSTOMER_LOGIN => array("updateOrderDiscount", 10)
);
}
/**
* Returns the session from the current request
*
* @return \Thelia\Core\HttpFoundation\Session\Session
*/
protected function getSession()
{
return $this->requestStack->getCurrentRequest()->getSession();
}
}

View File

@@ -0,0 +1,219 @@
<?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 Thelia\Action;
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
use Thelia\Core\Event\Currency\CurrencyCreateEvent;
use Thelia\Core\Event\Currency\CurrencyDeleteEvent;
use Thelia\Core\Event\Currency\CurrencyUpdateEvent;
use Thelia\Core\Event\Currency\CurrencyUpdateRateEvent;
use Thelia\Core\Event\TheliaEvents;
use Thelia\Core\Event\UpdatePositionEvent;
use Thelia\Core\Translation\Translator;
use Thelia\CurrencyConverter\CurrencyConverter;
use Thelia\CurrencyConverter\Exception\CurrencyNotFoundException;
use Thelia\Log\Tlog;
use Thelia\Math\Number;
use Thelia\Model\Currency as CurrencyModel;
use Thelia\Model\CurrencyQuery;
class Currency extends BaseAction implements EventSubscriberInterface
{
/** @var CurrencyConverter */
protected $currencyConverter;
public function __construct(CurrencyConverter $currencyConverter)
{
$this->currencyConverter = $currencyConverter;
}
/**
* Create a new currencyuration entry
*
* @param \Thelia\Core\Event\Currency\CurrencyCreateEvent $event
* @param $eventName
* @param EventDispatcherInterface $dispatcher
*/
public function create(CurrencyCreateEvent $event, $eventName, EventDispatcherInterface $dispatcher)
{
$currency = new CurrencyModel();
$isDefault = CurrencyQuery::create()->count() === 0;
$currency
->setDispatcher($dispatcher)
->setLocale($event->getLocale())
->setName($event->getCurrencyName())
->setSymbol($event->getSymbol())
->setFormat($event->getFormat())
->setRate($event->getRate())
->setCode(strtoupper($event->getCode()))
->setByDefault($isDefault)
->save()
;
$event->setCurrency($currency);
}
/**
* Change a currency
*
* @param \Thelia\Core\Event\Currency\CurrencyUpdateEvent $event
* @param $eventName
* @param EventDispatcherInterface $dispatcher
*/
public function update(CurrencyUpdateEvent $event, $eventName, EventDispatcherInterface $dispatcher)
{
if (null !== $currency = CurrencyQuery::create()->findPk($event->getCurrencyId())) {
$currency
->setDispatcher($dispatcher)
->setLocale($event->getLocale())
->setName($event->getCurrencyName())
->setSymbol($event->getSymbol())
->setFormat($event->getFormat())
->setRate($event->getRate())
->setCode(strtoupper($event->getCode()))
->save();
$event->setCurrency($currency);
}
}
/**
* Set the default currency
*
* @param CurrencyUpdateEvent $event
* @param $eventName
* @param EventDispatcherInterface $dispatcher
*/
public function setDefault(CurrencyUpdateEvent $event, $eventName, EventDispatcherInterface $dispatcher)
{
if (null !== $currency = CurrencyQuery::create()->findPk($event->getCurrencyId())) {
// Reset default status
CurrencyQuery::create()->filterByByDefault(true)->update(array('ByDefault' => false));
$currency
->setDispatcher($dispatcher)
->setVisible($event->getVisible())
->setByDefault($event->getIsDefault())
->save()
;
// Update rates when setting a new default currency
if ($event->getIsDefault()) {
$updateRateEvent = new CurrencyUpdateRateEvent();
$dispatcher->dispatch(TheliaEvents::CURRENCY_UPDATE_RATES, $updateRateEvent);
}
$event->setCurrency($currency);
}
}
/**
* @param CurrencyUpdateEvent $event
*/
public function setVisible(CurrencyUpdateEvent $event)
{
if (null !== $currency = CurrencyQuery::create()->findPk($event->getCurrencyId())) {
if (!$currency->getByDefault()) {
$currency->setVisible($event->getVisible())->save();
}
}
}
/**
* Delete a currencyuration entry
*
* @param \Thelia\Core\Event\Currency\CurrencyDeleteEvent $event
* @param $eventName
* @param EventDispatcherInterface $dispatcher
*/
public function delete(CurrencyDeleteEvent $event, $eventName, EventDispatcherInterface $dispatcher)
{
if (null !== ($currency = CurrencyQuery::create()->findPk($event->getCurrencyId()))) {
if ($currency->getByDefault()) {
throw new \RuntimeException(
Translator::getInstance()->trans('It is not allowed to delete the default currency')
);
}
$currency
->setDispatcher($dispatcher)
->delete()
;
$event->setCurrency($currency);
}
}
public function updateRates(CurrencyUpdateRateEvent $event)
{
if (null === $defaultCurrency = CurrencyQuery::create()->findOneByByDefault(true)) {
throw new \RuntimeException('Unable to find a default currency, please define a default currency.');
}
$defaultCurrency->setRate(1)->save();
$currencies = CurrencyQuery::create()->filterByByDefault(false);
$baseValue = new Number('1');
/** @var \Thelia\Model\Currency $currency */
foreach ($currencies as $currency) {
try {
$rate = $this->currencyConverter
->from($defaultCurrency->getCode())
->to($currency->getCode())
->convert($baseValue);
$currency->setRate($rate->getNumber(-1))->save();
} catch (CurrencyNotFoundException $ex) {
Tlog::getInstance()->addError(
sprintf("Unable to find exchange rate for currency %s, ID %d", $currency->getCode(), $currency->getId())
);
$event->addUndefinedRate($currency->getId());
}
}
}
/**
* Changes position, selecting absolute ou relative change.
*
* @param UpdatePositionEvent $event
* @param string $eventName
* @param EventDispatcherInterface $dispatcher
*/
public function updatePosition(UpdatePositionEvent $event, $eventName, EventDispatcherInterface $dispatcher)
{
$this->genericUpdatePosition(CurrencyQuery::create(), $event, $dispatcher);
}
/**
* {@inheritDoc}
*/
public static function getSubscribedEvents()
{
return array(
TheliaEvents::CURRENCY_CREATE => array("create", 128),
TheliaEvents::CURRENCY_UPDATE => array("update", 128),
TheliaEvents::CURRENCY_DELETE => array("delete", 128),
TheliaEvents::CURRENCY_SET_DEFAULT => array("setDefault", 128),
TheliaEvents::CURRENCY_SET_VISIBLE => array("setVisible", 128),
TheliaEvents::CURRENCY_UPDATE_RATES => array("updateRates", 128),
TheliaEvents::CURRENCY_UPDATE_POSITION => array("updatePosition", 128)
);
}
}

View File

@@ -0,0 +1,239 @@
<?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 Thelia\Action;
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
use Thelia\Core\Event\ActionEvent;
use Thelia\Core\Event\Customer\CustomerCreateOrUpdateEvent;
use Thelia\Core\Event\Customer\CustomerEvent;
use Thelia\Core\Event\Customer\CustomerLoginEvent;
use Thelia\Core\Event\LostPasswordEvent;
use Thelia\Core\Event\TheliaEvents;
use Thelia\Core\Security\SecurityContext;
use Thelia\Core\Translation\Translator;
use Thelia\Exception\CustomerException;
use Thelia\Mailer\MailerFactory;
use Thelia\Model\ConfigQuery;
use Thelia\Model\Customer as CustomerModel;
use Thelia\Model\CustomerQuery;
use Thelia\Tools\Password;
/**
*
* customer class where all actions are managed
*
* Class Customer
* @package Thelia\Action
* @author Manuel Raynaud <manu@raynaud.io>
*/
class Customer extends BaseAction implements EventSubscriberInterface
{
/** @var SecurityContext */
protected $securityContext;
/** @var MailerFactory */
protected $mailer;
public function __construct(SecurityContext $securityContext, MailerFactory $mailer)
{
$this->securityContext = $securityContext;
$this->mailer = $mailer;
}
public function create(CustomerCreateOrUpdateEvent $event, $eventName, EventDispatcherInterface $dispatcher)
{
$customer = new CustomerModel();
$plainPassword = $event->getPassword();
$this->createOrUpdateCustomer($customer, $event, $dispatcher);
if ($event->getNotifyCustomerOfAccountCreation()) {
$this->mailer->sendEmailToCustomer(
'customer_account_created',
$customer,
[ 'password' => $plainPassword ]
);
}
$dispatcher->dispatch(
TheliaEvents::SEND_ACCOUNT_CONFIRMATION_EMAIL,
new CustomerEvent($customer)
);
}
public function customerConfirmationEmail(CustomerEvent $event, $eventName, EventDispatcherInterface $dispatcher)
{
$customer = $event->getCustomer();
if (ConfigQuery::isCustomerEmailConfirmationEnable() && $customer->getConfirmationToken() !== null && $customer !== null) {
$this->mailer->sendEmailToCustomer(
'customer_confirmation',
$customer,
['customer_id' => $customer->getId()]
);
}
}
public function modify(CustomerCreateOrUpdateEvent $event, $eventName, EventDispatcherInterface $dispatcher)
{
$plainPassword = $event->getPassword();
$customer = $event->getCustomer();
$emailChanged = $customer->getEmail() !== $event->getEmail();
$this->createOrUpdateCustomer($customer, $event, $dispatcher);
if (! empty($plainPassword) || $emailChanged) {
$this->mailer->sendEmailToCustomer('customer_account_changed', $customer, ['password' => $plainPassword]);
}
}
public function updateProfile(CustomerCreateOrUpdateEvent $event, $eventName, EventDispatcherInterface $dispatcher)
{
$customer = $event->getCustomer();
$customer->setDispatcher($dispatcher);
if ($event->getTitle() !== null) {
$customer->setTitleId($event->getTitle());
}
if ($event->getFirstname() !== null) {
$customer->setFirstname($event->getFirstname());
}
if ($event->getLastname() !== null) {
$customer->setLastname($event->getLastname());
}
if ($event->getEmail() !== null) {
$customer->setEmail($event->getEmail(), $event->getEmailUpdateAllowed());
}
if ($event->getPassword() !== null) {
$customer->setPassword($event->getPassword());
}
if ($event->getReseller() !== null) {
$customer->setReseller($event->getReseller());
}
if ($event->getSponsor() !== null) {
$customer->setSponsor($event->getSponsor());
}
if ($event->getDiscount() !== null) {
$customer->setDiscount($event->getDiscount());
}
$customer->save();
$event->setCustomer($customer);
}
public function delete(CustomerEvent $event)
{
if (null !== $customer = $event->getCustomer()) {
if (true === $customer->hasOrder()) {
throw new CustomerException(Translator::getInstance()->trans("Impossible to delete a customer who already have orders"));
}
$customer->delete();
}
}
private function createOrUpdateCustomer(CustomerModel $customer, CustomerCreateOrUpdateEvent $event, EventDispatcherInterface $dispatcher)
{
$customer->setDispatcher($dispatcher);
$customer->createOrUpdate(
$event->getTitle(),
$event->getFirstname(),
$event->getLastname(),
$event->getAddress1(),
$event->getAddress2(),
$event->getAddress3(),
$event->getPhone(),
$event->getCellphone(),
$event->getZipcode(),
$event->getCity(),
$event->getCountry(),
$event->getEmail(),
$event->getPassword(),
$event->getLangId(),
$event->getReseller(),
$event->getSponsor(),
$event->getDiscount(),
$event->getCompany(),
$event->getRef(),
$event->getEmailUpdateAllowed(),
$event->getState()
);
$event->setCustomer($customer);
}
public function login(CustomerLoginEvent $event)
{
$customer = $event->getCustomer();
if (method_exists($customer, 'clearDispatcher')) {
$customer->clearDispatcher();
}
$this->securityContext->setCustomerUser($event->getCustomer());
}
/**
* Perform user logout. The user is redirected to the provided view, if any.
*
* @param ActionEvent $event
*/
public function logout(/** @noinspection PhpUnusedParameterInspection */ ActionEvent $event)
{
$this->securityContext->clearCustomerUser();
}
public function lostPassword(LostPasswordEvent $event)
{
if (null !== $customer = CustomerQuery::create()->filterByEmail($event->getEmail())->findOne()) {
$password = Password::generateRandom(8);
$customer
->setPassword($password)
->save()
;
$this->mailer->sendEmailToCustomer('lost_password', $customer, ['password' => $password]);
}
}
/**
* {@inheritdoc}
*/
public static function getSubscribedEvents()
{
return array(
TheliaEvents::CUSTOMER_CREATEACCOUNT => array('create', 128),
TheliaEvents::CUSTOMER_UPDATEACCOUNT => array('modify', 128),
TheliaEvents::CUSTOMER_UPDATEPROFILE => array('updateProfile', 128),
TheliaEvents::CUSTOMER_LOGOUT => array('logout', 128),
TheliaEvents::CUSTOMER_LOGIN => array('login', 128),
TheliaEvents::CUSTOMER_DELETEACCOUNT => array('delete', 128),
TheliaEvents::LOST_PASSWORD => array('lostPassword', 128),
TheliaEvents::SEND_ACCOUNT_CONFIRMATION_EMAIL => array('customerConfirmationEmail', 128)
);
}
}

View File

@@ -0,0 +1,111 @@
<?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 Thelia\Action;
use Propel\Runtime\Propel;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
use Thelia\Core\Event\CustomerTitle\CustomerTitleEvent;
use Thelia\Core\Event\TheliaEvents;
use Thelia\Model\CustomerTitle as CustomerTitleModel;
use Thelia\Model\Map\CustomerTitleTableMap;
/**
* Class CustomerTitle
* @package Thelia\Action
* @author Benjamin Perche <bperche@openstudio.fr>
*/
class CustomerTitle extends BaseAction implements EventSubscriberInterface
{
public function create(CustomerTitleEvent $event)
{
$this->createOrUpdate($event, new CustomerTitleModel());
}
public function update(CustomerTitleEvent $event)
{
$this->checkCustomerTitle($event);
$this->createOrUpdate($event, $event->getCustomerTitle());
}
public function delete(CustomerTitleEvent $event)
{
$this->checkCustomerTitle($event);
$con = Propel::getConnection(CustomerTitleTableMap::DATABASE_NAME);
$con->beginTransaction();
try {
$event->getCustomerTitle()->delete();
$con->commit();
} catch (\Exception $e) {
$con->rollBack();
throw $e;
}
$event->setCustomerTitle(null);
}
protected function checkCustomerTitle(CustomerTitleEvent $event)
{
if (null === $event->getCustomerTitle()) {
throw new \LogicException(
"You must set the customer title before its update"
);
}
}
protected function createOrUpdate(CustomerTitleEvent $event, CustomerTitleModel $customerTitle)
{
$con = Propel::getConnection(CustomerTitleTableMap::DATABASE_NAME);
$con->beginTransaction();
$i18n = $customerTitle->getTranslation($event->getLocale(), $con);
try {
$i18n
->setShort($event->getShort())
->setLong($event->getLong())
;
$customerTitle->save($con);
if ($event->isDefault()) {
$customerTitle->toggleDefault($con);
$event->setDefault(false);
}
$con->commit();
} catch (\Exception $e) {
$con->rollBack();
throw $e;
}
$event->setCustomerTitle($customerTitle);
}
/**
* {@inheritdoc}
*/
public static function getSubscribedEvents()
{
return array(
TheliaEvents::CUSTOMER_TITLE_CREATE => array("create"),
TheliaEvents::CUSTOMER_TITLE_UPDATE => array("update"),
TheliaEvents::CUSTOMER_TITLE_DELETE => array("delete"),
);
}
}

View File

@@ -0,0 +1,66 @@
<?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 Thelia\Action;
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
use Thelia\Core\Event\Delivery\DeliveryPostageEvent;
use Thelia\Core\Event\TheliaEvents;
/**
* Class Delivery
* @package Thelia\Action
* @author Julien Chanséaume <julien@thelia.net>
*/
class Delivery implements EventSubscriberInterface
{
/**
* Get postage from module using the classical module functions
*
* @param DeliveryPostageEvent $event
*/
public function getPostage(DeliveryPostageEvent $event, $eventName, EventDispatcherInterface $dispatcher)
{
$module = $event->getModule();
// dispatch event to target specific module
$dispatcher->dispatch(
TheliaEvents::getModuleEvent(
TheliaEvents::MODULE_DELIVERY_GET_POSTAGE,
$module->getCode()
),
$event
);
if ($event->isPropagationStopped()) {
return;
}
// call legacy module method
$event->setValidModule($module->isValidDelivery($event->getCountry()));
if ($event->isValidModule()) {
$event->setPostage($module->getPostage($event->getCountry()));
}
}
/**
* @inheritdoc
*/
public static function getSubscribedEvents()
{
return [
TheliaEvents::MODULE_DELIVERY_GET_POSTAGE => ['getPostage', 128]
];
}
}

View File

@@ -0,0 +1,125 @@
<?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 Thelia\Action;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
use Thelia\Core\Event\Document\DocumentEvent;
use Thelia\Core\Event\TheliaEvents;
use Thelia\Exception\DocumentException;
use Thelia\Model\ConfigQuery;
use Thelia\Tools\URL;
/**
*
* Document management actions. This class handles document processing an caching.
*
* Basically, documents are stored outside the web space (by default in local/media/documents),
* and cached in the web space (by default in web/local/documents).
*
* In the documents caches directory, a subdirectory for documents categories (eg. product, category, folder, etc.) is
* automatically created, and the cached document is created here. Plugin may use their own subdirectory as required.
*
* The cached document name contains a hash of the processing options, and the original (normalized) name of the document.
*
* A copy (or symbolic link, by default) of the original document is always created in the cache, so that the full
* resolution document is always available.
*
* If a problem occurs, an DocumentException may be thrown.
*
* @package Thelia\Action
* @author Franck Allimant <franck@cqfdev.fr>
*
*/
class Document extends BaseCachedFile implements EventSubscriberInterface
{
/**
* @var string Config key for document delivery mode
*/
const CONFIG_DELIVERY_MODE = 'original_document_delivery_mode';
/**
* @return string root of the document cache directory in web space
*/
protected function getCacheDirFromWebRoot()
{
return ConfigQuery::read('document_cache_dir_from_web_root', 'cache' . DS . 'documents');
}
/**
* Process document and write the result in the document cache.
*
* When the original document is required, create either a symbolic link with the
* original document in the cache dir, or copy it in the cache dir if it's not already done.
*
* This method updates the cache_file_path and file_url attributes of the event
*
* @param DocumentEvent $event Event
*
* @throws \Thelia\Exception\DocumentException
* @throws \InvalidArgumentException , DocumentException
*/
public function processDocument(DocumentEvent $event)
{
$subdir = $event->getCacheSubdirectory();
$sourceFile = $event->getSourceFilepath();
if (null == $subdir || null == $sourceFile) {
throw new \InvalidArgumentException("Cache sub-directory and source file path cannot be null");
}
$originalDocumentPathInCache = $this->getCacheFilePath($subdir, $sourceFile, true);
if (! file_exists($originalDocumentPathInCache)) {
if (! file_exists($sourceFile)) {
throw new DocumentException(sprintf("Source document file %s does not exists.", $sourceFile));
}
$mode = ConfigQuery::read(self::CONFIG_DELIVERY_MODE, 'symlink');
if ($mode == 'symlink') {
if (false === symlink($sourceFile, $originalDocumentPathInCache)) {
throw new DocumentException(sprintf("Failed to create symbolic link for %s in %s document cache directory", basename($sourceFile), $subdir));
}
} else {
// mode = 'copy'
if (false === @copy($sourceFile, $originalDocumentPathInCache)) {
throw new DocumentException(sprintf("Failed to copy %s in %s document cache directory", basename($sourceFile), $subdir));
}
}
}
// Compute the document URL
$documentUrl = $this->getCacheFileURL($subdir, basename($originalDocumentPathInCache));
// Update the event with file path and file URL
$event->setDocumentPath($documentUrl);
$event->setDocumentUrl(URL::getInstance()->absoluteUrl($documentUrl, null, URL::PATH_TO_FILE));
}
/**
* {@inheritdoc}
*/
public static function getSubscribedEvents()
{
return array(
TheliaEvents::DOCUMENT_PROCESS => array("processDocument", 128),
// Implemented in parent class BaseCachedFile
TheliaEvents::DOCUMENT_CLEAR_CACHE => array("clearCache", 128),
TheliaEvents::DOCUMENT_DELETE => array("deleteFile", 128),
TheliaEvents::DOCUMENT_SAVE => array("saveFile", 128),
TheliaEvents::DOCUMENT_UPDATE => array("updateFile", 128),
TheliaEvents::DOCUMENT_UPDATE_POSITION => array("updatePosition", 128),
TheliaEvents::DOCUMENT_TOGGLE_VISIBILITY => array("toggleVisibility", 128),
);
}
}

View File

@@ -0,0 +1,79 @@
<?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 Thelia\Action;
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
use Thelia\Core\Event\TheliaEvents;
use Thelia\Core\Event\UpdatePositionEvent;
use Thelia\Handler\ExportHandler;
use Thelia\Model\ExportCategoryQuery;
use Thelia\Model\ExportQuery;
/**
* Class Export
* @author Jérôme Billiras <jbilliras@openstudio.fr>
*/
class Export extends BaseAction implements EventSubscriberInterface
{
/**
* @var \Thelia\Handler\ExportHandler The export handler
*/
protected $handler;
/**
* @param \Thelia\Handler\ExportHandler $exportHandler The export handler
*/
public function __construct(ExportHandler $exportHandler)
{
$this->handler = $exportHandler;
}
public static function getSubscribedEvents()
{
return [
TheliaEvents::EXPORT_CHANGE_POSITION => [
['exportChangePosition', 128]
],
TheliaEvents::EXPORT_CATEGORY_CHANGE_POSITION => [
['exportCategoryChangePosition', 128]
]
];
}
/**
* Handle export change position event
*
* @param UpdatePositionEvent $updatePositionEvent
* @param $eventName
* @param EventDispatcherInterface $dispatcher
*/
public function exportChangePosition(UpdatePositionEvent $updatePositionEvent, $eventName, EventDispatcherInterface $dispatcher)
{
$this->handler->getExport($updatePositionEvent->getObjectId(), true);
$this->genericUpdatePosition(new ExportQuery, $updatePositionEvent, $dispatcher);
}
/**
* Handle export category change position event
*
* @param UpdatePositionEvent $updatePositionEvent
* @param $eventName
* @param EventDispatcherInterface $dispatcher
*/
public function exportCategoryChangePosition(UpdatePositionEvent $updatePositionEvent, $eventName, EventDispatcherInterface $dispatcher)
{
$this->handler->getCategory($updatePositionEvent->getObjectId(), true);
$this->genericUpdatePosition(new ExportCategoryQuery, $updatePositionEvent, $dispatcher);
}
}

View File

@@ -0,0 +1,159 @@
<?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 Thelia\Action;
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
use Thelia\Model\FeatureQuery;
use Thelia\Model\Feature as FeatureModel;
use Thelia\Core\Event\TheliaEvents;
use Thelia\Core\Event\Feature\FeatureUpdateEvent;
use Thelia\Core\Event\Feature\FeatureCreateEvent;
use Thelia\Core\Event\Feature\FeatureDeleteEvent;
use Thelia\Core\Event\UpdatePositionEvent;
use Thelia\Core\Event\Feature\FeatureEvent;
use Thelia\Model\FeatureTemplate;
use Thelia\Model\FeatureTemplateQuery;
use Thelia\Model\TemplateQuery;
class Feature extends BaseAction implements EventSubscriberInterface
{
/**
* Create a new feature entry
*
* @param \Thelia\Core\Event\Feature\FeatureCreateEvent $event
* @param $eventName
* @param EventDispatcherInterface $dispatcher
*/
public function create(FeatureCreateEvent $event, $eventName, EventDispatcherInterface $dispatcher)
{
$feature = new FeatureModel();
$feature
->setDispatcher($dispatcher)
->setLocale($event->getLocale())
->setTitle($event->getTitle())
->save()
;
$event->setFeature($feature);
// Add atribute to all product templates if required
if ($event->getAddToAllTemplates() != 0) {
$this->doAddToAllTemplates($feature);
}
}
/**
* Change a product feature
*
* @param \Thelia\Core\Event\Feature\FeatureUpdateEvent $event
* @param $eventName
* @param EventDispatcherInterface $dispatcher
*/
public function update(FeatureUpdateEvent $event, $eventName, EventDispatcherInterface $dispatcher)
{
if (null !== $feature = FeatureQuery::create()->findPk($event->getFeatureId())) {
$feature
->setDispatcher($dispatcher)
->setLocale($event->getLocale())
->setTitle($event->getTitle())
->setDescription($event->getDescription())
->setChapo($event->getChapo())
->setPostscriptum($event->getPostscriptum())
->save();
$event->setFeature($feature);
}
}
/**
* Delete a product feature entry
*
* @param FeatureDeleteEvent $event
* @param $eventName
* @param EventDispatcherInterface $dispatcher
*/
public function delete(FeatureDeleteEvent $event, $eventName, EventDispatcherInterface $dispatcher)
{
if (null !== ($feature = FeatureQuery::create()->findPk($event->getFeatureId()))) {
$feature
->setDispatcher($dispatcher)
->delete()
;
$event->setFeature($feature);
}
}
/**
* Changes position, selecting absolute ou relative change.
*
* @param UpdatePositionEvent $event
* @param $eventName
* @param EventDispatcherInterface $dispatcher
*/
public function updatePosition(UpdatePositionEvent $event, $eventName, EventDispatcherInterface $dispatcher)
{
$this->genericUpdatePosition(FeatureQuery::create(), $event, $dispatcher);
}
protected function doAddToAllTemplates(FeatureModel $feature)
{
$templates = TemplateQuery::create()->find();
foreach ($templates as $template) {
$feature_template = new FeatureTemplate();
if (null === FeatureTemplateQuery::create()->filterByFeature($feature)->filterByTemplate($template)->findOne()) {
$feature_template
->setFeature($feature)
->setTemplate($template)
->save()
;
}
}
}
public function addToAllTemplates(FeatureEvent $event)
{
$this->doAddToAllTemplates($event->getFeature());
}
public function removeFromAllTemplates(FeatureEvent $event)
{
// Delete this feature from all product templates
FeatureTemplateQuery::create()->filterByFeature($event->getFeature())->delete();
}
/**
* {@inheritDoc}
*/
public static function getSubscribedEvents()
{
return array(
TheliaEvents::FEATURE_CREATE => array("create", 128),
TheliaEvents::FEATURE_UPDATE => array("update", 128),
TheliaEvents::FEATURE_DELETE => array("delete", 128),
TheliaEvents::FEATURE_UPDATE_POSITION => array("updatePosition", 128),
TheliaEvents::FEATURE_REMOVE_FROM_ALL_TEMPLATES => array("removeFromAllTemplates", 128),
TheliaEvents::FEATURE_ADD_TO_ALL_TEMPLATES => array("addToAllTemplates", 128),
);
}
}

View File

@@ -0,0 +1,119 @@
<?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 Thelia\Action;
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
use Thelia\Model\FeatureAvQuery;
use Thelia\Model\FeatureAv as FeatureAvModel;
use Thelia\Core\Event\TheliaEvents;
use Thelia\Core\Event\Feature\FeatureAvUpdateEvent;
use Thelia\Core\Event\Feature\FeatureAvCreateEvent;
use Thelia\Core\Event\Feature\FeatureAvDeleteEvent;
use Thelia\Core\Event\UpdatePositionEvent;
class FeatureAv extends BaseAction implements EventSubscriberInterface
{
/**
* Create a new feature entry
*
* @param FeatureAvCreateEvent $event
* @param $eventName
* @param EventDispatcherInterface $dispatcher
*/
public function create(FeatureAvCreateEvent $event, $eventName, EventDispatcherInterface $dispatcher)
{
$feature = new FeatureAvModel();
$feature
->setDispatcher($dispatcher)
->setFeatureId($event->getFeatureId())
->setLocale($event->getLocale())
->setTitle($event->getTitle())
->save()
;
$event->setFeatureAv($feature);
}
/**
* Change a product feature
*
* @param FeatureAvUpdateEvent $event
* @param $eventName
* @param EventDispatcherInterface $dispatcher
*/
public function update(FeatureAvUpdateEvent $event, $eventName, EventDispatcherInterface $dispatcher)
{
if (null !== $feature = FeatureAvQuery::create()->findPk($event->getFeatureAvId())) {
$feature
->setDispatcher($dispatcher)
->setLocale($event->getLocale())
->setTitle($event->getTitle())
->setDescription($event->getDescription())
->setChapo($event->getChapo())
->setPostscriptum($event->getPostscriptum())
->save();
$event->setFeatureAv($feature);
}
}
/**
* Delete a product feature entry
*
* @param FeatureAvDeleteEvent $event
* @param $eventName
* @param EventDispatcherInterface $dispatcher
*/
public function delete(FeatureAvDeleteEvent $event, $eventName, EventDispatcherInterface $dispatcher)
{
if (null !== ($feature = FeatureAvQuery::create()->findPk($event->getFeatureAvId()))) {
$feature
->setDispatcher($dispatcher)
->delete()
;
$event->setFeatureAv($feature);
}
}
/**
* Changes position, selecting absolute ou relative change.
*
* @param UpdatePositionEvent $event
* @param $eventName
* @param EventDispatcherInterface $dispatcher
*/
public function updatePosition(UpdatePositionEvent $event, $eventName, EventDispatcherInterface $dispatcher)
{
$this->genericUpdatePosition(FeatureAvQuery::create(), $event, $dispatcher);
}
/**
* {@inheritDoc}
*/
public static function getSubscribedEvents()
{
return array(
TheliaEvents::FEATURE_AV_CREATE => array("create", 128),
TheliaEvents::FEATURE_AV_UPDATE => array("update", 128),
TheliaEvents::FEATURE_AV_DELETE => array("delete", 128),
TheliaEvents::FEATURE_AV_UPDATE_POSITION => array("updatePosition", 128),
);
}
}

View File

@@ -0,0 +1,175 @@
<?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 Thelia\Action;
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
use Symfony\Component\HttpFoundation\File\UploadedFile;
use Thelia\Core\Event\File\FileCreateOrUpdateEvent;
use Thelia\Core\Event\Product\ProductCloneEvent;
use Thelia\Core\Event\TheliaEvents;
use Thelia\Log\Tlog;
use Thelia\Model\ProductDocument;
use Thelia\Model\ProductDocumentI18n;
use Thelia\Model\ProductDocumentI18nQuery;
use Thelia\Model\ProductDocumentQuery;
use Thelia\Model\ProductImage;
use Thelia\Model\ProductImageI18nQuery;
use Thelia\Model\ProductImageQuery;
/**
* Class File
*
* @package Thelia\Action
* @author Etienne Perriere <eperriere@openstudio.fr>
*/
class File extends BaseAction implements EventSubscriberInterface
{
public function cloneFile(ProductCloneEvent $event, $eventName, EventDispatcherInterface $dispatcher)
{
$originalProductId = $event->getOriginalProduct()->getId();
$clonedProduct = $event->getClonedProduct();
foreach ($event->getTypes() as $type) {
$originalProductFiles = [];
switch ($type) {
case 'images':
$originalProductFiles = ProductImageQuery::create()
->findByProductId($originalProductId);
break;
case 'documents':
$originalProductFiles = ProductDocumentQuery::create()
->findByProductId($originalProductId);
break;
}
// Set clone's files
/** @var ProductDocument|ProductImage $originalProductFile */
foreach ($originalProductFiles as $originalProductFile) {
$srcPath = $originalProductFile->getUploadDir() . DS . $originalProductFile->getFile();
if (file_exists($srcPath)) {
$ext = pathinfo($srcPath, PATHINFO_EXTENSION);
$clonedProductFile = [];
switch ($type) {
case 'images':
$fileName = $clonedProduct->getRef().'.'.$ext;
$clonedProductFile = new ProductImage();
break;
case 'documents':
$fileName = pathinfo($originalProductFile->getFile(), PATHINFO_FILENAME).'-'.$clonedProduct->getRef().'.'.$ext;
$clonedProductFile = new ProductDocument();
break;
}
// Copy a temporary file of the source file as it will be deleted by IMAGE_SAVE or DOCUMENT_SAVE event
$srcTmp = $srcPath.'.tmp';
copy($srcPath, $srcTmp);
// Get file mimeType
$finfo = new \finfo();
$fileMimeType = $finfo->file($srcPath, FILEINFO_MIME_TYPE);
// Get file event's parameters
$clonedProductFile
->setProductId($clonedProduct->getId())
->setVisible($originalProductFile->getVisible())
->setPosition($originalProductFile->getPosition())
->setLocale($clonedProduct->getLocale())
->setTitle($clonedProduct->getTitle());
$clonedProductCopiedFile = new UploadedFile($srcPath, $fileName, $fileMimeType, filesize($srcPath), null, true);
// Create and dispatch event
$clonedProductCreateFileEvent = new FileCreateOrUpdateEvent($clonedProduct->getId());
$clonedProductCreateFileEvent
->setModel($clonedProductFile)
->setUploadedFile($clonedProductCopiedFile)
->setParentName($clonedProduct->getTitle());
$originalProductFileI18ns = [];
switch ($type) {
case 'images':
$dispatcher->dispatch(TheliaEvents::IMAGE_SAVE, $clonedProductCreateFileEvent);
// Get original product image I18n
$originalProductFileI18ns = ProductImageI18nQuery::create()
->findById($originalProductFile->getId());
break;
case 'documents':
$dispatcher->dispatch(TheliaEvents::DOCUMENT_SAVE, $clonedProductCreateFileEvent);
// Get original product document I18n
$originalProductFileI18ns = ProductDocumentI18nQuery::create()
->findById($originalProductFile->getId());
break;
}
// Set temporary source file as original one
rename($srcTmp, $srcPath);
// Clone file's I18n
$this->cloneFileI18n($originalProductFileI18ns, $clonedProductFile, $type, $event, $dispatcher);
} else {
Tlog::getInstance()->addWarning("Failed to find media file $srcPath");
}
}
}
}
public function cloneFileI18n($originalProductFileI18ns, $clonedProductFile, $type, ProductCloneEvent $event, EventDispatcherInterface $dispatcher)
{
// Set clone files I18n
/** @var ProductDocumentI18n $originalProductFileI18n */
foreach ($originalProductFileI18ns as $originalProductFileI18n) {
// Update file with current I18n info. Update or create I18n according to existing or absent Locale in DB
$clonedProductFile
->setLocale($originalProductFileI18n->getLocale())
->setTitle($originalProductFileI18n->getTitle())
->setDescription($originalProductFileI18n->getDescription())
->setChapo($originalProductFileI18n->getChapo())
->setPostscriptum($originalProductFileI18n->getPostscriptum());
// Create and dispatch event
$clonedProductUpdateFileEvent = new FileCreateOrUpdateEvent($event->getClonedProduct()->getId());
$clonedProductUpdateFileEvent->setModel($clonedProductFile);
switch ($type) {
case 'images':
$dispatcher->dispatch(TheliaEvents::IMAGE_UPDATE, $clonedProductUpdateFileEvent);
break;
case 'documents':
$dispatcher->dispatch(TheliaEvents::DOCUMENT_UPDATE, $clonedProductUpdateFileEvent);
break;
}
}
}
/**
* {@inheritdoc}
*/
public static function getSubscribedEvents()
{
return array(
TheliaEvents::FILE_CLONE => array("cloneFile", 128)
);
}
}

View File

@@ -0,0 +1,208 @@
<?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 Thelia\Action;
use Propel\Runtime\Propel;
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
use Thelia\Core\Event\File\FileDeleteEvent;
use Thelia\Core\Event\Folder\FolderCreateEvent;
use Thelia\Core\Event\Folder\FolderDeleteEvent;
use Thelia\Core\Event\Folder\FolderToggleVisibilityEvent;
use Thelia\Core\Event\Folder\FolderUpdateEvent;
use Thelia\Core\Event\TheliaEvents;
use Thelia\Core\Event\UpdatePositionEvent;
use Thelia\Core\Event\UpdateSeoEvent;
use Thelia\Core\Event\ViewCheckEvent;
use Thelia\Model\FolderDocumentQuery;
use Thelia\Model\FolderImageQuery;
use Thelia\Model\FolderQuery;
use Thelia\Model\Folder as FolderModel;
use Thelia\Model\Map\FolderTableMap;
/**
* Class Folder
* @package Thelia\Action
* @author Manuel Raynaud <manu@raynaud.io>
*/
class Folder extends BaseAction implements EventSubscriberInterface
{
public function update(FolderUpdateEvent $event, $eventName, EventDispatcherInterface $dispatcher)
{
if (null !== $folder = FolderQuery::create()->findPk($event->getFolderId())) {
$folder->setDispatcher($dispatcher);
$folder
->setParent($event->getParent())
->setVisible($event->getVisible())
->setLocale($event->getLocale())
->setTitle($event->getTitle())
->setDescription($event->getDescription())
->setChapo($event->getChapo())
->setPostscriptum($event->getPostscriptum())
->save();
;
$event->setFolder($folder);
}
}
/**
* Change Folder SEO
*
* @param UpdateSeoEvent $event
* @param $eventName
* @param EventDispatcherInterface $dispatcher
* @return Object
*/
public function updateSeo(UpdateSeoEvent $event, $eventName, EventDispatcherInterface $dispatcher)
{
return $this->genericUpdateSeo(FolderQuery::create(), $event, $dispatcher);
}
public function delete(FolderDeleteEvent $event, $eventName, EventDispatcherInterface $dispatcher)
{
if (null !== $folder = FolderQuery::create()->findPk($event->getFolderId())) {
$con = Propel::getWriteConnection(FolderTableMap::DATABASE_NAME);
$con->beginTransaction();
try {
$fileList = ['images' => [], 'documentList' => []];
// Get folder's files to delete after folder deletion
$fileList['images']['list'] = FolderImageQuery::create()
->findByFolderId($event->getFolderId());
$fileList['images']['type'] = TheliaEvents::IMAGE_DELETE;
$fileList['documentList']['list'] = FolderDocumentQuery::create()
->findByFolderId($event->getFolderId());
$fileList['documentList']['type'] = TheliaEvents::DOCUMENT_DELETE;
// Delete folder
$folder->setDispatcher($dispatcher)
->delete($con);
$event->setFolder($folder);
// Dispatch delete folder's files event
foreach ($fileList as $fileTypeList) {
foreach ($fileTypeList['list'] as $fileToDelete) {
$fileDeleteEvent = new FileDeleteEvent($fileToDelete);
$dispatcher->dispatch($fileTypeList['type'], $fileDeleteEvent);
}
}
$con->commit();
} catch (\Exception $e) {
$con->rollback();
throw $e;
}
}
}
public function create(FolderCreateEvent $event, $eventName, EventDispatcherInterface $dispatcher)
{
$folder = new FolderModel();
$folder->setDispatcher($dispatcher);
$folder
->setParent($event->getParent())
->setVisible($event->getVisible())
->setLocale($event->getLocale())
->setTitle($event->getTitle())
->save();
$event->setFolder($folder);
}
public function toggleVisibility(FolderToggleVisibilityEvent $event, $eventName, EventDispatcherInterface $dispatcher)
{
$folder = $event->getFolder();
$folder
->setDispatcher($dispatcher)
->setVisible(!$folder->getVisible())
->save();
$event->setFolder($folder);
}
public function updatePosition(UpdatePositionEvent $event, $eventName, EventDispatcherInterface $dispatcher)
{
if (null !== $folder = FolderQuery::create()->findPk($event->getObjectId())) {
$folder->setDispatcher($dispatcher);
switch ($event->getMode()) {
case UpdatePositionEvent::POSITION_ABSOLUTE:
$folder->changeAbsolutePosition($event->getPosition());
break;
case UpdatePositionEvent::POSITION_DOWN:
$folder->movePositionDown();
break;
case UpdatePositionEvent::POSITION_UP:
$folder->movePositionUp();
break;
}
}
}
/**
* Check if is a folder view and if folder_id is visible
*
* @param ViewCheckEvent $event
* @param string $eventName
* @param EventDispatcherInterface $dispatcher
*/
public function viewCheck(ViewCheckEvent $event, $eventName, EventDispatcherInterface $dispatcher)
{
if ($event->getView() == 'folder') {
$folder = FolderQuery::create()
->filterById($event->getViewId())
->filterByVisible(1)
->count();
if ($folder == 0) {
$dispatcher->dispatch(TheliaEvents::VIEW_FOLDER_ID_NOT_VISIBLE, $event);
}
}
}
/**
* @param ViewCheckEvent $event
* @throws NotFoundHttpException
*/
public function viewFolderIdNotVisible(ViewCheckEvent $event)
{
throw new NotFoundHttpException();
}
/**
* {@inheritdoc}
*/
public static function getSubscribedEvents()
{
return array(
TheliaEvents::FOLDER_CREATE => array("create", 128),
TheliaEvents::FOLDER_UPDATE => array("update", 128),
TheliaEvents::FOLDER_DELETE => array("delete", 128),
TheliaEvents::FOLDER_TOGGLE_VISIBILITY => array("toggleVisibility", 128),
TheliaEvents::FOLDER_UPDATE_POSITION => array("updatePosition", 128),
TheliaEvents::FOLDER_UPDATE_SEO => array('updateSeo', 128),
TheliaEvents::VIEW_CHECK => array('viewCheck', 128),
TheliaEvents::VIEW_FOLDER_ID_NOT_VISIBLE => array('viewFolderIdNotVisible', 128),
);
}
}

View File

@@ -0,0 +1,168 @@
<?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 Thelia\Action;
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
use Thelia\Core\Event\Cache\CacheEvent;
use Thelia\Core\Event\Hook\HookCreateAllEvent;
use Thelia\Core\Event\Hook\HookCreateEvent;
use Thelia\Core\Event\Hook\HookDeactivationEvent;
use Thelia\Core\Event\Hook\HookDeleteEvent;
use Thelia\Core\Event\Hook\HookToggleActivationEvent;
use Thelia\Core\Event\Hook\HookToggleNativeEvent;
use Thelia\Core\Event\Hook\HookUpdateEvent;
use Thelia\Core\Event\TheliaEvents;
use Thelia\Model\Hook as HookModel;
use Thelia\Model\HookQuery;
/**
* Class HookAction
* @package Thelia\Action
* @author Julien Chanséaume <jchanseaume@openstudio.fr>
*/
class Hook extends BaseAction implements EventSubscriberInterface
{
/** @var string */
protected $cacheDir;
public function __construct($cacheDir)
{
$this->cacheDir = $cacheDir;
}
public function create(HookCreateEvent $event, $eventName, EventDispatcherInterface $dispatcher)
{
$hook = new HookModel();
$hook
->setLocale($event->getLocale())
->setCode($event->getCode())
->setType($event->getType())
->setNative($event->getNative())
->setActivate($event->getActive())
->setTitle($event->getTitle())
->save();
$event->setHook($hook);
$this->cacheClear($dispatcher);
}
public function update(HookUpdateEvent $event, $eventName, EventDispatcherInterface $dispatcher)
{
if (null !== $hook = HookQuery::create()->findPk($event->getHookId())) {
$hook
->setLocale($event->getLocale())
->setCode($event->getCode())
->setType($event->getType())
->setNative($event->getNative())
->setActivate($event->getActive())
->setBlock($event->getBlock())
->setByModule($event->getByModule())
->setTitle($event->getTitle())
->setChapo($event->getChapo())
->setDescription($event->getDescription())
->save();
$event->setHook($hook);
$this->cacheClear($dispatcher);
}
}
public function delete(HookDeleteEvent $event, $eventName, EventDispatcherInterface $dispatcher)
{
if (null !== $hook = HookQuery::create()->findPk($event->getHookId())) {
$hook->delete();
$event->setHook($hook);
$this->cacheClear($dispatcher);
}
}
public function createAll(HookCreateAllEvent $event)
{
$hook = new HookModel();
$hook
->setLocale($event->getLocale())
->setCode($event->getCode())
->setType($event->getType())
->setNative($event->getNative())
->setActivate($event->getActive())
->setBlock($event->getBlock())
->setByModule($event->getByModule())
->setTitle($event->getTitle())
->setChapo($event->getChapo())
->setDescription($event->getDescription())
->save();
$event->setHook($hook);
}
public function deactivation(HookDeactivationEvent $event)
{
if (null !== $hook = HookQuery::create()->findPk($event->getHookId())) {
$hook
->setActivate(false)
->save();
$event->setHook($hook);
}
}
public function toggleNative(HookToggleNativeEvent $event)
{
if (null !== $hook = HookQuery::create()->findPk($event->getHookId())) {
$hook
->setNative(!$hook->getNative())
->save();
$event->setHook($hook);
}
}
public function toggleActivation(HookToggleActivationEvent $event, $eventName, EventDispatcherInterface $dispatcher)
{
if (null !== $hook = HookQuery::create()->findPk($event->getHookId())) {
$hook
->setActivate(!$hook->getActivate())
->save();
$event->setHook($hook);
$this->cacheClear($dispatcher);
}
}
protected function cacheClear(EventDispatcherInterface $dispatcher)
{
$cacheEvent = new CacheEvent($this->cacheDir);
$dispatcher->dispatch(TheliaEvents::CACHE_CLEAR, $cacheEvent);
}
/**
* {@inheritdoc}
*/
public static function getSubscribedEvents()
{
return array(
TheliaEvents::HOOK_CREATE => array('create', 128),
TheliaEvents::HOOK_UPDATE => array('update', 128),
TheliaEvents::HOOK_DELETE => array('delete', 128),
TheliaEvents::HOOK_TOGGLE_ACTIVATION => array('toggleActivation', 128),
TheliaEvents::HOOK_TOGGLE_NATIVE => array('toggleNative', 128),
TheliaEvents::HOOK_CREATE_ALL => array('createAll', 128),
TheliaEvents::HOOK_DEACTIVATION => array('deactivation', 128),
);
}
}

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