Рамиз Мирзаев

Init commit

Showing 1000 changed files with 4907 additions and 0 deletions

Too many changes to show.

To preserve performance only 1000 of 1000+ files are displayed.

No preview for this file type
No preview for this file type
name: Lint
on:
push:
branches:
- 3.0.x.x
pull_request:
types: [opened, synchronize]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
tests:
runs-on: ubuntu-latest
strategy:
matrix:
php: ['7.3', '7.4', '8.0', '8.1', '8.2', '8.3']
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
tools: composer:v2, cs2pr
extensions: mbstring
- name: Lint
run: |
error=0
for file in $(find upload -type f -name "*.php" ! -path 'upload/system/storage/vendor/*'); do
php -l -n $file | grep -v "No syntax errors detected" && error=1
done
if [ $error -eq 1 ]; then
echo "Syntax errors were found."
exit 1
else
echo "No syntax errors were detected."
fi
- name: Cache dependencies
uses: actions/cache@v3
with:
path: |
~/.cache/composer/files
./.cache
./.php-cs-fixer.cache
key: OC3.0-PHP${{ matrix.php }}-${{ hashFiles('**/composer.lock') }}
restore-keys: OC3.0-PHP${{ matrix.php }}-
- name: PHPStan
run: |
composer require phpstan/phpstan 1.10.57
./upload/system/storage/vendor/bin/phpstan analyze --no-progress
- name: Code style
if: matrix.php == '8.3'
run: |
composer require --dev -w friendsofphp/php-cs-fixer v3.41.1
./upload/system/storage/vendor/bin/php-cs-fixer fix --dry-run --diff --ansi || true
./upload/system/storage/vendor/bin/php-cs-fixer fix --dry-run --format=checkstyle | cs2pr
<?php
/*
* This document has been generated with
* https://mlocati.github.io/php-cs-fixer-configurator/#version:3.46.0|configurator
* you can change this configuration by importing this file.
*/
$config = new PhpCsFixer\Config();
return $config
->setRiskyAllowed(true)
->setIndent("\t")
->setRules([
'@PER-CS2.0:risky' => true,
'@PER-CS2.0' => true,
'@DoctrineAnnotation' => true,
'@PHPUnit100Migration:risky' => true,
'assign_null_coalescing_to_coalesce_equal' => true,
'attribute_empty_parentheses' => true,
'backtick_to_shell_exec' => true,
'binary_operator_spaces' => false,
'blank_line_after_namespace' => false,
'blank_line_after_opening_tag' => false,
'blank_lines_before_namespace' => false,
'braces_position' => false,
'cast_spaces' => false,
'class_definition' => false,
'clean_namespace' => true,
'comment_to_phpdoc' => true,
'concat_space' => false,
'constant_case' => false,
'control_structure_braces' => false,
'control_structure_continuation_position' => false,
'date_time_create_from_format_call' => true,
'declare_parentheses' => true,
'echo_tag_syntax' => true,
'elseif' => false,
'empty_loop_body' => true,
'empty_loop_condition' => true,
'ereg_to_preg' => true,
'error_suppression' => true,
'fopen_flag_order' => true,
'fopen_flags' => ['b_mode' => false],
'function_declaration' => false,
'general_phpdoc_annotation_remove' => true,
'general_phpdoc_tag_rename' => true,
'heredoc_indentation' => true,
'heredoc_to_nowdoc' => true,
'implode_call' => true,
'indentation_type' => false,
'integer_literal_case' => true,
'lambda_not_used_import' => true,
'magic_constant_casing' => true,
'magic_method_casing' => true,
'method_argument_space' => false,
'method_chaining_indentation' => true,
'multiline_comment_opening_closing' => true,
'native_function_casing' => true,
'native_type_declaration_casing' => true,
'new_with_parentheses' => false,
'no_alternative_syntax' => true,
'no_binary_string' => true,
'no_blank_lines_after_class_opening' => false,
'no_closing_tag' => false,
'no_empty_comment' => true,
'no_homoglyph_names' => true,
'no_leading_import_slash' => false,
'no_leading_namespace_whitespace' => true,
'no_mixed_echo_print' => true,
'no_multiline_whitespace_around_double_arrow' => true,
'no_multiple_statements_per_line' => false,
'no_php4_constructor' => true,
'no_short_bool_cast' => true,
'no_spaces_after_function_name' => false,
'no_spaces_around_offset' => true,
'no_trailing_comma_in_singleline' => true,
'no_trailing_whitespace' => false,
'no_trailing_whitespace_in_comment' => false,
'no_unneeded_braces' => true,
'no_unneeded_final_method' => true,
'no_unneeded_import_alias' => true,
'no_unset_cast' => true,
'no_unset_on_property' => true,
'no_useless_nullsafe_operator' => true,
'no_useless_return' => true,
'no_useless_sprintf' => true,
'no_whitespace_before_comma_in_array' => true,
'no_whitespace_in_blank_line' => false,
'normalize_index_brace' => true,
'nullable_type_declaration' => true,
'nullable_type_declaration_for_default_null_value' => true,
'object_operator_without_whitespace' => true,
'ordered_imports' => false,
'ordered_interfaces' => true,
'ordered_types' => true,
'php_unit_construct' => true,
'php_unit_data_provider_name' => true,
'php_unit_data_provider_return_type' => true,
'php_unit_set_up_tear_down_visibility' => true,
'php_unit_strict' => true,
'php_unit_test_annotation' => true,
'php_unit_test_case_static_method_calls' => true,
'phpdoc_inline_tag_normalizer' => true,
'phpdoc_line_span' => true,
'phpdoc_no_access' => true,
'phpdoc_no_useless_inheritdoc' => true,
'phpdoc_return_self_reference' => true,
'phpdoc_scalar' => true,
'phpdoc_single_line_var_spacing' => true,
'phpdoc_tag_casing' => true,
'phpdoc_tag_type' => true,
'phpdoc_types' => true,
'phpdoc_types_order' => ['null_adjustment' => 'always_last'],
'phpdoc_var_annotation_correct_order' => true,
'phpdoc_var_without_name' => true,
'return_to_yield_from' => true,
'self_static_accessor' => true,
'semicolon_after_instruction' => true,
'set_type_to_cast' => true,
'short_scalar_cast' => false,
'simple_to_complex_string_variable' => true,
'single_blank_line_at_eof' => false,
'single_line_empty_body' => false,
'single_line_throw' => true,
'spaces_inside_parentheses' => false,
'standardize_not_equals' => true,
'statement_indentation' => false,
'string_length_to_empty' => true,
'string_line_ending' => true,
'switch_case_semicolon_to_colon' => false,
'switch_case_space' => false,
'switch_continue_to_break' => true,
'ternary_operator_spaces' => false,
'trim_array_spaces' => true,
'type_declaration_spaces' => true,
'types_spaces' => true,
'unary_operator_spaces' => false,
'visibility_required' => false,
'yield_from_array_to_yields' => true,
])
->setFinder(PhpCsFixer\Finder::create()
->in(__DIR__ . '/upload/')
->exclude([
__DIR__ . '/upload/system/storage/vendor/',
])
// ->append([
// 'file-to-include',
// ])
)
;
This diff is collapsed. Click to expand it.
# INSTALL
* This is for __new installation only__
* These instructions are for a manual installation using FTP, cPanel or other web hosting Control Panel.
If you are __upgrading your existing cart__, be sure to read the [upgrade instructions](UPGRADE.md) instead
## Linux Install
1. Upload all of the files and folders to your server from the "Upload" folder, place them in your web root. The web root is different on some servers, cPanel it should be public_html/ and on Plesk it should be httpdocs/.
2. Make sure your web user has the permission to read, write and execute all directories under the web root.
3. Rename config-dist.php to config.php and admin/config-dist.php to admin/config.php
4. For Linux/Unix make sure the following folders and files are writable.
chmod 0777 config.php
chmod 0777 admin/config.php
5. Make sure you have installed a MySQL Database which has a user assigned to it
* do not use your `root` username and root password
6. Visit the store homepage e.g. http://www.example.com or http://www.example.com/store/
7. You should be taken to the installer page. Follow the on screen instructions.
8. After successful install, delete the /install/ directory from ftp.
9. If you have downloaded the compiled version with a folder called "vendor" - this should be uploaded above the webroot (so the same folder where the public_html or httpdocs is)
## Windows Install
1. Upload all the files and folders to your server from the "Upload" folder. This can be to anywhere of your choice. e.g. /wwwroot/store or /wwwroot
2. Rename config-dist.php to config.php and admin/config-dist.php to admin/config.php
3. For Windows make sure the following folders and files permissions allow Read and Write.
config.php
admin/config.php
4. Make sure you have installed a MySQL Database which has a user assigned to it
* do not use your `root` username and root password
5. You should be taken to the installer page. Follow the on screen instructions.
6. After successful install, delete the /install/ directory.
## Local Install
There are many all-in-one web servers out there and most of them should work with OpenCart out of the box.
Some examples...
* http://www.apachefriends.org/en/xampp.html
* http://www.ampps.com/
* http://www.usbwebserver.net
* http://www.wampserver.com/en/
## Notes
Godaddy Issues
If your hosting on godaddy you might need to rename the php.ini to user.ini
It seems godaddy has started changing the industry standard names of files.
----------------------------
## Going live
When your site is ready to go live open file system/config/default.php
**Find:**
`$_['error_display'] = true;`
**Replace with:**
`$_['error_display'] = false;`
## COMPOSER OR NOT TO COMPOSER
From __version 2.2 composer has been added__ to aid developers who want to use composer libraries. 2 versions of OpenCart
will become available, one compiled and one non-compiled (composer.json only - no files in vendor folder).
We STRONGLY __advise leaving the vendor folder outside of the webroot__ - so files cannot be accessed directly.
### How to install Composer
Installing is extremely simple, follow the instructions [HERE](https://getcomposer.org/download/)
This diff is collapsed. Click to expand it.
# OpenCart
## Overview
OpenCart is a free open source ecommerce platform for online merchants. OpenCart provides a professional and reliable foundation from which to build a successful online store.
## Reporting a bug
Read the instructions below before you create a bug report.
1. Search the [OpenCart forum](http://forum.opencart.com/viewforum.php?f=191), ask the community if they have seen the bug or know how to fix it.
2. Check all open and closed issues on the [GitHub bug tracker](https://github.com/opencart/opencart/issues).
3. If your bug is related to the OpenCart core code then please create a bug report on GitHub.
4. READ the [changelog for the master branch](https://github.com/opencart/opencart/blob/master/changelog.md)
5. Use [Google](http://www.google.com) to search for your issue.
6. Make sure that your bug/issue is not related to your hosting environment.
If you are not sure about your issue, it is always best to ask the community on our [bug forum thread](http://forum.opencart.com/viewforum.php?f=191)
**Important!**
- If your bug report is not related to the core code (such as a 3rd party module or your server configuration) then the issue will be closed without a reason. You must contact the extension developer, use the forum or find a commercial partner to resolve a 3rd party code issue.
- If you would like to report a serious security bug please PM an OpenCart moderator/administrator on the forum. Please do not report concept/ideas/unproven security flaws - all security reports are taken seriously but you must include the EXACT details steps to reproduce it. Please DO NOT post security flaws in a public location.
## Making a suggestion
Please do not create a bug report if you think something needs improving / adding (such as features or change to code standards etc).
We welcome public suggestions on our [User Voice site](http://opencart.uservoice.com).
## How to contribute
Fork the repository, edit and [submit a pull request](https://github.com/opencart/opencart/wiki/Creating-a-pull-request).
Please be very clear on your commit messages and pull request, empty pull request messages may be rejected without reason.
Your code standards should match the [OpenCart coding standards](https://github.com/opencart/opencart/wiki/Coding-standards). We use an automated code scanner to check for most basic mistakes - if the test fails your pull request will be rejected.
## Versioning
The version is broken down into 4 points e.g 1.2.3.4 We use MAJOR.MINOR.FEATURE.PATCH to describe the version numbers.
A MAJOR is very rare, it would only be considered if the source was effectively re-written or a clean break was desired for other reasons. This increment would likely break most 3rd party modules.
A MINOR is when there are significant changes that affect core structures. This increment would likely break some 3rd party modules.
A FEATURE version is when new extensions or features are added (such as a payment gateway, shipping module etc). Updating a feature version is at a low risk of breaking 3rd party modules.
A PATCH version is when a fix is added, it should be considered safe to update patch versions e.g 1.2.3.4 to 1.2.3.5
## Releases
OpenCart will announce to developers 1 week prior to public release of FEATURE versions, this is to allow for testing of their own modules for compatibility. For bigger releases (ones that contain many core changes, features and fixes) an extended period will be considered following an announced release candidate (RC). Patch versions (which are considered safe to update with) may have a significantly reduced developer release period.
The master branch will always contain an "_rc" postfix of the next intended version. The next "_rc" version may change at any time.
Developer release source code will not change once tagged.
If a bug is found in an announced developer release that is significant (such as a major feature is broken) then the release will be pulled. A patch version will be issued to replace it, depending on the severity of the patch an extended testing period may be announced. If the developer release version was never made public then the preceding patch version tag will be removed.
To receive developer notifications about release information, sign up to the newsletter on the [OpenCart website](http://www.opencart.com) - located in the footer. Then choose the developer news option.
## How to install
Please read the installation instructions included in the repository or download file.
## License
[GNU General Public License version 3 (GPLv3)](https://github.com/opencart/opencart/blob/master/license.txt)
## Links
- [OpenCart homepage](http://www.opencart.com/)
- [OpenCart forums](http://forum.opencart.com/)
- [OpenCart blog](http://www.opencart.com/index.php?route=feature/blog)
- [How to documents](http://docs.opencart.com/)
- [Newsletter](http://newsletter.opencart.com/h/r/B660EBBE4980C85C)
- [User Voice suggestions](http://opencart.uservoice.com)
// * @source See SOURCE.txt for source and other copyright.
// * @license GNU General Public License version 3; see LICENSE.txt
ocStore був створений відповідно до GNU GPLv3 і включає або є похідним робіт ліцензуються відповідно до GNU General Public License або інших ліцензій на безкоштовне програмне забезпечення або Open Source. В ocStore використані такі джерела:
- OpenCart (C) 2006-2015 Daniel Kerr, OpenCart Ltd.
- Arastta (С) 2015 Arastta Association.
\ No newline at end of file
# Upgrading from version 2.x.x
* For existing installs only
* Don't use with previous versions
## For previous versions
If you have __1.5.x__ and want to upgrade __to 3.0.x__, You may try to [contact our dedicated support](https://dedicated.opencart.com/)
## Step by step
1. BACKUP YOUR EXISTING STORE FILES AND DATABASE!!
* Backup your __database__ via your store
`Admin -> System -> Backup`
* Backup your __files__ using FTP file copy or use cPanel filemanager to create a zip of all the existing opencart files and folders
2. Download the __latest version__ of OpenCart and __upload all__ new files on top of your current install __except__ your `config.php` and `admin/config.php`.
1. Backup and Remove all of 2.x.x views files. Because OpenCart 3 is start to use TWIG to replace the TPL format.
2. Watch this video to understand how to properly upload folder using FTP: http://docs.opencart.com/en-gb/upgrading/
3. Before upgrade the latest version, you should double check the existing extensions (in your store) are compatibility with latest version or not. Please contact the developer for enquiry before you upgrade.
4. Not only the extensions, all the themes in OpenCart 2 cannot use in OpenCart 3. You should set your store theme to default theme and disabled all of the extensions first.
3. Browse to `http://<yourstore.com>/install` Replacing `<yourstore.com>` with your actual site (and subdirectory if applicable).
4. You should see the OpenCart Upgrade script.
* If you see the OpenCart Install page, then that means you overwrote your `config.php` files. Restore them from your backup first. Then try again.
5. Click "Upgrade". After a few seconds you should see the upgrade success page.
* If you see any errors, report them immediately in the forum before continuing.
6. Clear any cookies in your browser
7. Goto the admin side of your store and press `Ctrl+F5` or `Ctrl+Shift+R` for several times to refresh your browser cache. That will prevent oddly shifted elements due to stylesheet changes. Login to your admin as the main administrator.
8. Goto `Admin -> Users -> User Groups` and Edit the Top Administrator group. Check All boxes.
* This will ensure you have permissions for all the new files
9. Goto `Admin -> Extensions -> Extensions -> Theme` enabled and save the default theme again.
10. Goto `Admin -> System Settings`
* Update any blank fields and click save.
* Even if you do not see any new fields, click save anyway to update the database with any new field names.
11. Other Adjustments that may need to be made, depending on which version you are upgrading from and to. These are broken down by which version they were added in. So if you are not currently at that version, you may need to make changes
12. Load the store front and again press CTRL+F5 3x times to refresh your browser cache. That will prevent oddly shifted elements due to stylesheet. (If you skip step 9, you will get the error message.)
13. If you use vQmod (by now everyone should be) you should first check for a new version at http://vQmod.com. Be sure to download the version that is marked for "opencart".
You will also need to re-run the vQmod installer, even if you have the latest version. You should already have the installer on your site as it isn't meant to be deleted from the first time you run it. Simply browse to:
http://yoursite.com/vqmod/install and you should see a success message. If you do not see a success message, follow the full install guide from the http://vQmod.com site.
Note that some of your vQmod scripts may need to be updated for the new core changes.
So run through your site catalog and admin areas and check in FTP for the vqmod/vqmod.log file.
If you see errors, then you will need to address them.
## Troubleshooting:
1. If you have any upgrade script errors, post them in the forum
2. If you have 3rd party addon errors, contact the mod author for an update.
3. If you find bugs, check the "official" bug thread for this version of Opencart
Many bugs may have already been reported and fixes will be offered in the first post of this thread.
You should always visit this thread immediately after a fresh upgrade to see if there are any immediate bug fixes
If nobody has reported your bug, then please report it.
An online version of this file can be found here:
http://www.opencart.com/index.php?route=documentation/documentation&path=98
<?xml version="1.0" encoding="UTF-8"?>
<project name="OpenCart" default="build" basedir=".">
<property name="source" value="upload"/>
<target name="clean" description="Cleanup build artifacts">
<delete dir="${basedir}/tests/docs"/>
<delete dir="${basedir}/tests/logs"/>
<delete dir="${basedir}/tests/testresults"/>
</target>
<target name="prepare" depends="clean" description="Prepare for build">
<mkdir dir="${basedir}/tests/docs"/>
<mkdir dir="${basedir}/tests/logs"/>
<mkdir dir="${basedir}/tests/testresults"/>
</target>
<target name="lint" description="Perform syntax check of source code files">
<apply executable="php" failonerror="true">
<arg value="-l"/>
<fileset dir="${basedir}/upload">
<include name="**/*.php"/>
<modified/>
</fileset>
</apply>
</target>
<target name="csslint" description="Run the CSSLint tool on CSS files">
<fileset dir="${basedir}/upload" id="cssfiles.raw">
<include name="**/*.css" />
</fileset>
<pathconvert pathsep=" " property="cssfiles.clean" refid="cssfiles.raw" />
<exec executable="csslint" output="${basedir}/tests/csslint.xml">
<arg line="--warnings=box-model,floats --errors=ids,important --format=lint-xml ${cssfiles.clean}" />
</exec>
</target>
<target name="phploc" description="Measure project size using PHPLOC">
<exec executable="phploc">
<arg value="--log-csv"/>
<arg value="${basedir}/tests/logs/phploc.csv"/>
<arg path="${basedir}/upload"/>
</exec>
</target>
<target name="phpcs" description="Generate checkstyle.xml using PHP_CodeSniffer">
<exec executable="phpcs">
<arg line="--report=checkstyle --report-file=${basedir}/tests/checkstyle.xml --standard=tests/phpcs/OpenCart/ruleset.xml --extensions=php ${source}/"/>
</exec>
</target>
<target name="build" depends="prepare,phpcs,lint,phploc,csslint"/>
</project>
\ No newline at end of file
{
"name": "opencart/opencart",
"type": "project",
"description": "OpenCart",
"keywords": ["opencart", "ecommerce", "framework", "opensource"],
"homepage": "http://www.opencart.com",
"license": "GPL-3.0+",
"config": {
"vendor-dir": "./upload/system/storage/vendor/"
},
"require": {
"braintree/braintree_php" : "3.40.0",
"cardinity/cardinity-sdk-php": "^v2.0",
"divido/divido-php": ">=1.15",
"php": ">=7.3.0",
"scssphp/scssphp": "^1.11.0",
"zoujingli/wechat-developer": "^1.2",
"twig/twig": "^3.3",
"zoujingli/wechat-php-sdk": "^1.3"
},
"autoload-dev": {
"psr-4": {
"Tools\\PHPStan\\": "tools/phpstan/"
}
}
}
This diff is collapsed. Click to expand it.
///////////////////////////////////
/// ocStore V3.x ///
/// Інструкція зі встановлення ///
/// https://ocstore.com ///
///////////////////////////////////
ПРИМІТКА: ЦЕ ЛИШЕ ДЛЯ НОВОГО ВСТАНОВЛЕННЯ!
ЯКЩО ОНОВЛЕННЯ В ІСНУЮЧИЙ МАГАЗИН, НЕ ЗАБУДЬТЕ ПРОЧИТАТИ UPGRADE.TXT
-------
Встановлення
-------
These instructions are for a manual installation using FTP, cPanel or other web hosting Control Panel.
- Встановлення на Linux -
1. Завантажте всі ваші файли та папки на ваш сервер з папки «Upload». Можна розархівувати в будь-яке місце на Ваш вибір.
Наприклад: У cPanel має бути в папці public_html/ і Plesk має бути в httpdocs/.
2. Перейменуйте config-dist.php на config.php і admin/config-dist.php на admin/config.php
3. Для Linux/Unix переконайтеся, що папки та файли доступні для запису.
chmod 0755 or 0777 system/storage/cache/
chmod 0755 or 0777 system/storage/download/
chmod 0755 or 0777 system/storage/logs/
chmod 0755 or 0777 system/storage/modification/
chmod 0755 or 0777 system/storage/session/
chmod 0755 or 0777 system/storage/upload/
chmod 0755 or 0777 system/storage/vendor/
chmod 0755 or 0777 image/
chmod 0755 or 0777 image/cache/
chmod 0755 or 0777 image/catalog/
chmod 0755 or 0777 config.php
chmod 0755 or 0777 admin/config.php
Якщо при правах 0755 не працює, спробуйте 0777.
4. Упевніться, що у вас встановлено базу даних MySQL і ви маєте доступ до неї. НІ ЗА ЯКИХ ОБСТАВ НЕ ВИКОРИСТОВУЙТЕ ROOT ЛОГІН ТА ПАРОЛЬ.
5. Завітайте на домашню сторінку свого магазину.
Наприклад: http://www.example.com або http://www.examle.com/store/
6. Дотримуйтесь інструкцій на екрані.
7. Видаліть папку для встановлення.
8. Якщо ви завантажили скомпільовану версію з папкою Vendor, то вона повинна бути завантажена вище кореневої директорії (у тій же папці, де public_html або httpdocs)
Встановлення на Windows -
1. Завантажте всі файли та папки на свій сервер із папки «Upload». Їх можна розпакувати у будь-яке місце на ваш вибір. Наприклад /wwwroot/store або /wwwroot
2. Перейменуйте config-dist.php на config.php і admin/config-dist.php на admin/config.php
3. Для Windows переконайтеся, що папки та файли доступні для запису.
system/storage/cache/
system/storage/download/
system/storage/logs/
system/storage/modification/
system/storage/session/
system/storage/upload/
system/storage/vendor/
image/
image/cache/
image/catalog/
config.php
admin/config.php
4. Переконайтеся, що у Вас встановлена база даних MySQL і Ви маєте доступ до неї. НІ В ЯКОМУ РАЗІ НЕ ВИКОРИСТОВУЙТЕ ROOT ЛОГІН І ПАРОЛЬ.
5. Завітайте на домашню сторінку Вашого магазину.
Наприклад: http://www.example.com або http://www.examle.com/store/
6. Виконуйте вказівки на екрані.
7. Видаліть інсталяційну директорію.
----------------------------
COMPOSER OR NOT TO COMPOSER
----------------------------
From version 2.2 composer has been added to aid developers who want to use composer libraries. 2 versions of OpenCart
will become available, one compiled and one non-compiled (composer.json only - no files in vendor folder).
We STRONGLY advise leaving the vendor folder outside of the webroot - so files cannot be accessed directly.
Composer installing is extremely simple - https://getcomposer.org
This diff is collapsed. Click to expand it.
services:
-
class: \Tools\PHPStan\RegistryPropertyReflectionExtension
tags:
- phpstan.broker.propertiesClassReflectionExtension
parameters:
level: 1
paths:
- ./upload/
excludePaths:
- ./system/storage/vendor/
- ./system/storage/cache/template/
- ./upload/system/storage/vendor/
- ./upload/system/storage/cache/template/
tmpDir: .cache
ignoreErrors:
- '#Class Event constructor invoked with 1 parameter, 4-5 required\.#'
- '#Constant [A-Z_]+ not found\.#'
- '#might not be defined\.#'
- '#invoked with \d+ parameters?, \d+ required\.#'
reportUnmatchedIgnoredErrors: false
\ No newline at end of file
<?php
namespace Tools\PHPStan;
use PHPStan\Reflection\ClassReflection;
use PHPStan\Reflection\PropertyReflection;
use PHPStan\TrinaryLogic;
use PHPStan\Type\NeverType;
use PHPStan\Type\Type;
class LoadedProperty implements PropertyReflection {
/**
* @var ClassReflection
*/
private $declaringClass;
/**
* @var Type
*/
private $type;
public function __construct(ClassReflection $declaringClass, Type $readableType) {
$this->declaringClass = $declaringClass;
$this->type = $readableType;
}
public function getDeclaringClass(): ClassReflection {
return $this->declaringClass;
}
public function isStatic(): bool {
return false;
}
public function isPrivate(): bool {
return false;
}
public function isPublic(): bool {
return true;
}
public function isReadable(): bool {
return true;
}
public function isWritable(): bool {
return false;
}
public function getDocComment(): ?string {
return null;
}
public function getReadableType(): Type {
return $this->type;
}
public function getWritableType(): Type {
return new NeverType();
}
public function canChangeTypeAfterAssignment(): bool {
return false;
}
public function isDeprecated(): TrinaryLogic {
return TrinaryLogic::createNo();
}
public function getDeprecatedDescription(): ?string {
return null;
}
public function isInternal(): TrinaryLogic {
return TrinaryLogic::createNo();
}
}
<?php
namespace Tools\PHPStan;
use Registry;
use PHPStan\Broker\Broker;
use PHPStan\Reflection\ClassReflection;
use PHPStan\Reflection\PropertiesClassReflectionExtension;
use PHPStan\Reflection\PropertyReflection;
use PHPStan\Type\Generic\GenericObjectType;
use PHPStan\Type\NullType;
use PHPStan\Type\ObjectType;
use PHPStan\Type\TypeCombinator;
class RegistryPropertyReflectionExtension implements PropertiesClassReflectionExtension {
public function hasProperty(ClassReflection $classReflection, string $propertyName): bool {
if (!$classReflection->is(Registry::class)) {
return false;
}
return preg_match('/^model_.+$/', $propertyName, $matches) === 1;
}
public function getProperty(ClassReflection $classReflection, string $propertyName): PropertyReflection {
preg_match('/^(model_.+)$/', $propertyName, $matches);
$className = $this->convertSnakeToStudly($matches[1]);
$broker = Broker::getInstance();
$type = new NullType();
if ($broker->hasClass($className)) {
$found = new ObjectType($className);
$type = new GenericObjectType('\Proxy', [$found]);
$type = TypeCombinator::addNull($type);
}
return new LoadedProperty($classReflection, $type);
}
private function convertSnakeToStudly(string $value): string {
return str_replace(' ', '', ucwords(str_replace('_', ' ', $value)));
}
}
///////////////////////////////////////
/// OpenCart V1.5.x TO 3.0.x ///
/// Upgrade Instructions ///
/// http://www.opencart.com ///
///////////////////////////////////////
NOTE: THIS IS FOR UPGRADE ON EXISTING INSTALLS ONLY!
IF INSTALLING NEW, BE SURE TO READ THE INSTALL.TXT FILE INSTEAD
##########################################
THIS IS FOR UPGRADING EXISTING OPENCART 1.5.x STORES ONLY
THIS IS FOR UPGRADING EXISTING OPENCART 1.5.x STORES ONLY
THIS IS FOR UPGRADING EXISTING OPENCART 1.5.x STORES ONLY
##########################################
##########################################
DO NOT USE THIS UPGRADE TO CONVERT FROM 1.4.x to 1.5.x!!
DO NOT USE THIS UPGRADE TO CONVERT FROM 1.4.x to 1.5.x!!
DO NOT USE THIS UPGRADE TO CONVERT FROM 1.4.x to 1.5.x!!
If you have 1.4.x and want to upgrade to 1.5.x, You need to use the script here:
http://forum.opencart.com/viewtopic.php?f=2&t=50292
##########################################
1. BACKUP YOUR EXISTING STORE FILES AND DATABASE!!
- Backup your database via your store Admin->System->Backup
- Backup your files using FTP file copy or use cPanel filemanager to create a zip of all the existing opencart files and folders
2. Download the latest version of OpenCart and upload ALL new files on top of your current install EXCEPT your config.php and admin/config.php. If you are up to date with the last recent version and want to find just the new files that have changed since the last version, you can follow this guide to create a smaller changes-only patch. But for most, the full opencart zip will suffice.
Watch this video to understand how to properly upload folder using FTP: http://forum.opencart.com/viewtopic.php?f=20&t=9645#p46371
3. Browse to http://<yourstore.com>/install Replacing <yourstore.com> with your actual site (and subdirectory if applicable).
4. You should see the OpenCart Upgrade script.
- If you see the OpenCart Install page, then that means you overwrote your config.php files. Restore them from your backup first. Then try again.
5. Click "Upgrade". After a few seconds you should see the upgrade success page.
- If you see any errors, report them immediately in the forum before continuing.
6. Clear any cookies in your browser
7. Goto the admin side of your store and press Ctrl+F5 3x times to refresh your browser cache. That will prevent oddly shifted elements due to stylesheet changes. Login to your admin as the main administrator.
8. Goto Admin->Users->User Groups and Edit the Top Adminstrator group. Check All boxes.
- This will ensure you have permissions for all the new files
9. Goto Admin->System Settings
- Update any blank fields and click save.
Even if you do not see any new fields, click save anyway to update the database with any new field names.
10. Other Adjustments that may need to be made, depending on which version you are upgrading from and to. These are broken down by which version they were added in. So if you are not currently at that version, you may need to make changes
##########################################
OPTIONAL
##########################################
v151
- Modules must all be reinstalled to update the database with the new serialized data method or you will see errors on the front end
v151.3
- System Settings have new "Use Store Tax Address" and "Use Customer Tax Address" fields that need to be set for taxes to work. By default they are updated to use "Shipping Address" which will be what 99% of stores will use anyway.
v152
- New "Product Count" field added to the category module. You may need to edit that module to set the new field
v153
- UPS module gets a change for the unit select and is disabled by default to force you to resave the settings.
- New Voucher Min/Max fields added to Admin->System->Settings. Default is 1 to 1000
- New Customer Group selection option for registration. You can choose which fields to show in the Admin->Sales->Customer Groups section. By default it is set to "Default" only in the Admin->System->Settings under the Option tab.
- New "Category Product Count" setting in the Admin->System->Settings under the Server tab. This is disabled by default and should only be used for small stores as it causes massive performance loss for larger stores with lots of categories.
11. Load the store front and again press CTRL+F5 3x times to refresh your browser cache. That will prevent oddly shifted elements due to stylesheet.
12. If you use vQmod (by now everyone should be) you should first check for a new version at http://vQmod.com. Be sure to download the version that is marked for "opencart".
You will also need to re-run the vQmod installer, even if you have the latest version. You should already have the installer on your site as it isn't meant to be deleted from the first time you run it. Simply browse to:
http://yoursite.com/vqmod/install and you should see a success message. If you do not see a success message, follow the full install guide from the http://vQmod.com site.
Note that some of your vQmod scripts may need to be updated for the new core changes.
So run through your site catalog and admin areas and check in FTP for the vqmod/vqmod.log file.
If you see errors, then you will need to address them.
Troubleshooting:
------------------------------
1. If you have any upgrade script errors, post them in the forum
2. If you have 3rd party addon errors, contact the mod author for an update.
3. If you find bugs, check the "official" bug thread for this version of Opencart
Many bugs may have already been reported and fixes will be offered in the first post of this thread.
You should always visit this thread immediately after a fresh upgrade to see if there are any immediate bug fixes
If nobody has reported your bug, then please report it.
An online version of this file can be found here:
http://www.opencart.com/index.php?route=documentation/documentation&path=98
That's It!
OpenCart Dev Team
\ No newline at end of file
# 1.To use URL Alias you need to be running apache with mod_rewrite enabled.
# 2. In your opencart directory rename htaccess.txt to .htaccess.
# For any support issues please visit: http://www.opencart.com
Options +FollowSymlinks
# Prevent Directory listing
Options -Indexes
# Prevent Direct Access to files
<FilesMatch "(?i)((\.tpl|\.twig|\.ini|\.log|(?<!robots)\.txt))">
Require all denied
## For apache 2.2 and older, replace "Require all denied" with these two lines :
# Order deny,allow
# Deny from all
</FilesMatch>
# SEO URL Settings
RewriteEngine On
# If your opencart installation does not run on the main web folder make sure you folder it does run in ie. / becomes /shop/
RewriteBase /
RewriteCond %{QUERY_STRING} ^(.*)&?page=1$
RewriteRule ^(.*)/?$ /$1?%1%2 [R=301,L] #remove page=1 from url
RewriteRule ^sitemap.xml$ index.php?route=extension/feed/google_sitemap [L]
RewriteRule ^googlebase.xml$ index.php?route=extension/feed/google_base [L]
RewriteRule ^system/storage/(.*) index.php?route=error/not_found [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !.*\.(ico|gif|jpg|jpeg|png|js|css)
RewriteRule ^([^?]*) index.php?_route_=$1 [L,QSA]
### Additional Settings that may need to be enabled for some servers
### Uncomment the commands by removing the # sign in front of it.
### If you get an "Internal Server Error 500" after enabling any of the following settings, restore the # as this means your host doesn't allow that.
# 1. If your cart only allows you to add one item at a time, it is possible register_globals is on. This may work to disable it:
# php_flag register_globals off
# 2. If your cart has magic quotes enabled, This may work to disable it:
# php_flag magic_quotes_gpc Off
# 3. Set max upload file size. Most hosts will limit this and not allow it to be overridden but you can try
# php_value upload_max_filesize 999M
# 4. set max post size. uncomment this line if you have a lot of product options or are getting errors where forms are not saving all fields
# php_value post_max_size 999M
# 5. set max time script can take. uncomment this line if you have a lot of product options or are getting errors where forms are not saving all fields
# php_value max_execution_time 200
# 6. set max time for input to be recieved. Uncomment this line if you have a lot of product options or are getting errors where forms are not saving all fields
# php_value max_input_time 200
# 7. disable open_basedir limitations
# php_admin_value open_basedir none
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
<?php
class ControllerCommonDashboard extends Controller {
public function index() {
$this->load->language('common/dashboard');
$this->document->setTitle($this->language->get('heading_title'));
$data['user_token'] = $this->session->data['user_token'];
$data['breadcrumbs'] = array();
$data['breadcrumbs'][] = array(
'text' => $this->language->get('text_home'),
'href' => $this->url->link('common/dashboard', 'user_token=' . $this->session->data['user_token'], true)
);
$data['breadcrumbs'][] = array(
'text' => $this->language->get('heading_title'),
'href' => $this->url->link('common/dashboard', 'user_token=' . $this->session->data['user_token'], true)
);
// Check install directory exists
if (is_dir(DIR_CATALOG . '../install')) {
$data['error_install'] = $this->language->get('error_install');
} else {
$data['error_install'] = '';
}
// Dashboard Extensions
$dashboards = array();
$this->load->model('setting/extension');
// Get a list of installed modules
$extensions = $this->model_setting_extension->getInstalled('dashboard');
// Add all the modules which have multiple settings for each module
foreach ($extensions as $code) {
if ($this->config->get('dashboard_' . $code . '_status') && $this->user->hasPermission('access', 'extension/dashboard/' . $code)) {
$output = $this->load->controller('extension/dashboard/' . $code . '/dashboard');
if ($output) {
$dashboards[] = array(
'code' => $code,
'width' => $this->config->get('dashboard_' . $code . '_width'),
'sort_order' => $this->config->get('dashboard_' . $code . '_sort_order'),
'output' => $output
);
}
}
}
$sort_order = array();
foreach ($dashboards as $key => $value) {
$sort_order[$key] = $value['sort_order'];
}
array_multisort($sort_order, SORT_ASC, $dashboards);
// Split the array so the columns width is not more than 12 on each row.
$width = 0;
$column = array();
$data['rows'] = array();
foreach ($dashboards as $dashboard) {
$column[] = $dashboard;
$width = ($width + $dashboard['width']);
if ($width >= 12) {
$data['rows'][] = $column;
$width = 0;
$column = array();
}
}
if (!empty($column)) {
$data['rows'][] = $column;
}
if (DIR_STORAGE == DIR_SYSTEM . 'storage/') {
$data['security'] = $this->load->controller('common/security');
} else {
$data['security'] = '';
}
$data['header'] = $this->load->controller('common/header');
$data['column_left'] = $this->load->controller('common/column_left');
$data['footer'] = $this->load->controller('common/footer');
// Run currency update
if ($this->config->get('config_currency_auto')) {
$this->load->model('localisation/currency');
$this->load->controller('extension/currency/' . $this->config->get('config_currency_engine')."/currency" , $this->config->get('config_currency'));
}
$this->response->setOutput($this->load->view('common/dashboard', $data));
}
}
<?php
class ControllerCommonDeveloper extends Controller {
public function index() {
$this->load->language('common/developer');
$data['user_token'] = $this->session->data['user_token'];
$data['developer_theme'] = $this->config->get('developer_theme');
$data['developer_sass'] = $this->config->get('developer_sass');
$eval = false;
$eval = '$eval = true;';
eval($eval);
if ($eval === true) {
$data['eval'] = true;
} else {
$this->load->model('setting/setting');
$this->model_setting_setting->editSetting('developer', array('developer_theme' => 1), 0);
$data['eval'] = false;
}
$this->response->setOutput($this->load->view('common/developer', $data));
}
public function edit() {
$this->load->language('common/developer');
$json = array();
if (!$this->user->hasPermission('modify', 'common/developer')) {
$json['error'] = $this->language->get('error_permission');
} else {
$this->load->model('setting/setting');
$this->model_setting_setting->editSetting('developer', $this->request->post, 0);
$json['success'] = $this->language->get('text_success');
}
$this->response->addHeader('Content-Type: application/json');
$this->response->setOutput(json_encode($json));
}
public function theme() {
$this->load->language('common/developer');
$json = array();
if (!$this->user->hasPermission('modify', 'common/developer')) {
$json['error'] = $this->language->get('error_permission');
} else {
$directories = glob(DIR_CACHE . '/template/*', GLOB_ONLYDIR);
if ($directories) {
foreach ($directories as $directory) {
$files = glob($directory . '/*');
foreach ($files as $file) {
if (is_file($file)) {
unlink($file);
}
}
if (is_dir($directory)) {
rmdir($directory);
}
}
}
$json['success'] = sprintf($this->language->get('text_cache'), $this->language->get('text_theme'));
}
$this->response->addHeader('Content-Type: application/json');
$this->response->setOutput(json_encode($json));
}
public function sass() {
$this->load->language('common/developer');
$json = array();
if (!$this->user->hasPermission('modify', 'common/developer')) {
$json['error'] = $this->language->get('error_permission');
} else {
// Before we delete we need to make sure there is a sass file to regenerate the css
$file = DIR_APPLICATION . 'view/stylesheet/bootstrap.css';
if (is_file($file) && is_file(DIR_APPLICATION . 'view/stylesheet/sass/_bootstrap.scss')) {
unlink($file);
}
$files = glob(DIR_CATALOG . 'view/theme/*/stylesheet/sass/_bootstrap.scss');
foreach ($files as $file) {
$file = substr($file, 0, -21) . '/bootstrap.css';
if (is_file($file)) {
unlink($file);
}
}
$json['success'] = sprintf($this->language->get('text_cache'), $this->language->get('text_sass'));
}
$this->response->addHeader('Content-Type: application/json');
$this->response->setOutput(json_encode($json));
}
public function systemcache() {
$this->load->language('common/developer');
$json = array();
if (!$this->user->hasPermission('modify', 'common/developer')) {
$json['error'] = $this->language->get('error_permission');
} else {
$files = glob(DIR_CACHE . 'cache.*');
if (!empty($files)) {
foreach($files as $file){
$this->deldir($file);
}
}
$json['success'] = sprintf($this->language->get('text_cache'), $this->language->get('text_systemcache'));
}
$this->response->addHeader('Content-Type: application/json');
$this->response->setOutput(json_encode($json));
}
public function imgcache() {
$this->load->language('common/developer');
$json = array();
if (!$this->user->hasPermission('modify', 'common/developer')) {
$json['error'] = $this->language->get('error_permission');
} else {
$imgfiles = glob(DIR_IMAGE . 'cache/*');
if (!empty($imgfiles)) {
foreach($imgfiles as $imgfile){
$this->deldir($imgfile);
}
}
$json['success'] = sprintf($this->language->get('text_img_cache'), $this->language->get('text_imgcache'));
}
$this->response->addHeader('Content-Type: application/json');
$this->response->setOutput(json_encode($json));
}
public function allcache() {
$this->load->language('common/developer');
$json = array();
if (!$this->user->hasPermission('modify', 'common/developer')) {
$json['error'] = $this->language->get('error_permission');
} else {
$files = glob(DIR_CACHE . 'cache.*');
if (!empty($files)) {
foreach($files as $file){
$this->deldir($file);
}
}
$imgfiles = glob(DIR_IMAGE . 'cache/*');
if (!empty($imgfiles)) {
foreach($imgfiles as $imgfile){
$this->deldir($imgfile);
}
}
// Before we delete we need to make sure there is a sass file to regenerate the css
$file = DIR_APPLICATION . 'view/stylesheet/bootstrap.css';
if (is_file($file) && is_file(DIR_APPLICATION . 'view/stylesheet/sass/_bootstrap.scss')) {
unlink($file);
}
$files = glob(DIR_CATALOG . 'view/theme/*/stylesheet/sass/_bootstrap.scss');
foreach ($files as $file) {
$file = substr($file, 0, -21) . '/bootstrap.css';
if (is_file($file)) {
unlink($file);
}
}
$directories = glob(DIR_CACHE . '*', GLOB_ONLYDIR);
if ($directories) {
foreach ($directories as $directory) {
$files = glob($directory . '/*');
foreach ($files as $file) {
if (is_file($file)) {
unlink($file);
}
}
if (is_dir($directory)) {
$this->deldir($directory);
}
}
}
$json['success'] = sprintf($this->language->get('text_cache'), $this->language->get('text_allcache'));
}
$this->response->addHeader('Content-Type: application/json');
$this->response->setOutput(json_encode($json));
}
public function deldir($dirname){
if(file_exists($dirname)) {
if(is_dir($dirname)){
$dir=opendir($dirname);
while(($filename=readdir($dir)) !== false){
if($filename!="." && $filename!=".."){
$file=$dirname."/".$filename;
$this->deldir($file);
}
}
closedir($dir);
rmdir($dirname);
} else {
@unlink($dirname);
}
}
}
}
This diff is collapsed. Click to expand it.
<?php
class ControllerCommonFooter extends Controller {
public function index() {
$this->load->language('common/footer');
if ($this->user->isLogged() && isset($this->request->get['user_token']) && ($this->request->get['user_token'] == $this->session->data['user_token'])) {
$data['text_version'] = sprintf($this->language->get('text_version'), VERSION);
} else {
$data['text_version'] = '';
}
return $this->load->view('common/footer', $data);
}
}
<?php
class ControllerCommonForgotten extends Controller {
private $error = array();
public function index() {
if ($this->user->isLogged() && isset($this->request->get['user_token']) && ($this->request->get['user_token'] == $this->session->data['user_token'])) {
$this->response->redirect($this->url->link('common/dashboard', '', true));
}
if (!$this->config->get('config_password')) {
$this->response->redirect($this->url->link('common/login', '', true));
}
$this->load->language('common/forgotten');
$this->document->setTitle($this->language->get('heading_title'));
$this->load->model('user/user');
if (($this->request->server['REQUEST_METHOD'] == 'POST') && $this->validate()) {
$this->model_user_user->editCode($this->request->post['email'], token(40));
$this->session->data['success'] = $this->language->get('text_success');
$this->response->redirect($this->url->link('common/login', '', true));
}
if (isset($this->error['warning'])) {
$data['error_warning'] = $this->error['warning'];
} else {
$data['error_warning'] = '';
}
$data['breadcrumbs'] = array();
$data['breadcrumbs'][] = array(
'text' => $this->language->get('text_home'),
'href' => $this->url->link('common/dashboard', '', true)
);
$data['breadcrumbs'][] = array(
'text' => $this->language->get('heading_title'),
'href' => $this->url->link('common/forgotten', 'user_token=' . '', true)
);
$data['action'] = $this->url->link('common/forgotten', '', true);
$data['cancel'] = $this->url->link('common/login', '', true);
if (isset($this->request->post['email'])) {
$data['email'] = $this->request->post['email'];
} else {
$data['email'] = '';
}
$data['header'] = $this->load->controller('common/header');
$data['footer'] = $this->load->controller('common/footer');
$this->response->setOutput($this->load->view('common/forgotten', $data));
}
protected function validate() {
if (!isset($this->request->post['email'])) {
$this->error['warning'] = $this->language->get('error_email');
} elseif (!$this->model_user_user->getTotalUsersByEmail($this->request->post['email'])) {
$this->error['warning'] = $this->language->get('error_email');
}
return !$this->error;
}
}
<?php
// * @source See SOURCE.txt for source and other copyright.
// * @license GNU General Public License version 3; see LICENSE.txt
class ControllerCommonHeader extends Controller {
public function index() {
$data['title'] = $this->document->getTitle();
if ($this->request->server['HTTPS']) {
$data['base'] = HTTPS_SERVER;
} else {
$data['base'] = HTTP_SERVER;
}
$data['description'] = $this->document->getDescription();
$data['keywords'] = $this->document->getKeywords();
$data['links'] = $this->document->getLinks();
$data['styles'] = $this->document->getStyles();
$data['scripts'] = $this->document->getScripts();
$data['lang'] = $this->language->get('code');
$data['direction'] = $this->language->get('direction');
$this->load->language('common/header');
$data['text_logged'] = sprintf($this->language->get('text_logged'), $this->user->getUserName());
if (!isset($this->request->get['user_token']) || !isset($this->session->data['user_token']) || ($this->request->get['user_token'] != $this->session->data['user_token'])) {
$data['logged'] = '';
$data['home'] = $this->url->link('common/login', '', true);
} else {
$data['logged'] = true;
$data['home'] = $this->url->link('common/dashboard', 'user_token=' . $this->session->data['user_token'], true);
$data['logout'] = $this->url->link('common/logout', 'user_token=' . $this->session->data['user_token'], true);
$data['profile'] = $this->url->link('common/profile', 'user_token=' . $this->session->data['user_token'], true);
$data['new_category'] = $this->url->link('catalog/category/add', 'user_token=' . $this->session->data['user_token'], true);
$data['new_customer'] = $this->url->link('user/user/add', 'user_token=' . $this->session->data['user_token'], true);
$data['new_download'] = $this->url->link('catalog/download/add', 'user_token=' . $this->session->data['user_token'], true);
$data['new_manufacturer'] = $this->url->link('catalog/manufacturer/add', 'user_token=' . $this->session->data['user_token'], true);
$data['new_product'] = $this->url->link('catalog/product/add', 'user_token=' . $this->session->data['user_token'], true);
$this->load->model('user/user');
$this->load->model('tool/image');
$user_info = $this->model_user_user->getUser($this->user->getId());
if ($user_info) {
$data['firstname'] = $user_info['firstname'];
$data['lastname'] = $user_info['lastname'];
$data['username'] = $user_info['username'];
$data['user_group'] = $user_info['user_group'];
if (is_file(DIR_IMAGE . $user_info['image'])) {
$data['image'] = $this->model_tool_image->resize($user_info['image'], 45, 45);
} else {
$data['image'] = $this->model_tool_image->resize('profile.png', 45, 45);
}
} else {
$data['firstname'] = '';
$data['lastname'] = '';
$data['user_group'] = '';
$data['image'] = '';
}
// Online Stores
$data['stores'] = array();
$data['stores'][] = array(
'name' => $this->config->get('config_name'),
'href' => HTTP_CATALOG
);
$this->load->model('setting/store');
$results = $this->model_setting_store->getStores();
foreach ($results as $result) {
$data['stores'][] = array(
'name' => $result['name'],
'href' => $result['url']
);
}
}
$data['search'] = $this->load->controller('search/search');
return $this->load->view('common/header', $data);
}
}
<?php
class ControllerCommonLogin extends Controller {
private $error = array();
public function index() {
$this->load->language('common/login');
$this->document->setTitle($this->language->get('heading_title'));
if ($this->user->isLogged() && isset($this->request->get['user_token']) && ($this->request->get['user_token'] == $this->session->data['user_token'])) {
$this->response->redirect($this->url->link('common/dashboard', 'user_token=' . $this->session->data['user_token'], true));
}
if (($this->request->server['REQUEST_METHOD'] == 'POST') && $this->validate()) {
$this->session->data['user_token'] = token(32);
if (isset($this->request->post['redirect']) && (strpos($this->request->post['redirect'], HTTP_SERVER) === 0 || strpos($this->request->post['redirect'], HTTPS_SERVER) === 0)) {
$this->response->redirect($this->request->post['redirect'] . '&user_token=' . $this->session->data['user_token']);
} else {
$this->response->redirect($this->url->link('common/dashboard', 'user_token=' . $this->session->data['user_token'], true));
}
}
if ((isset($this->session->data['user_token']) && !isset($this->request->get['user_token'])) || ((isset($this->request->get['user_token']) && (isset($this->session->data['user_token']) && ($this->request->get['user_token'] != $this->session->data['user_token']))))) {
$this->error['warning'] = $this->language->get('error_token');
}
if (isset($this->error['error_attempts'])) {
$data['error_warning'] = $this->error['error_attempts'];
} elseif (isset($this->error['warning'])) {
$data['error_warning'] = $this->error['warning'];
} else {
$data['error_warning'] = '';
}
if (isset($this->session->data['success'])) {
$data['success'] = $this->session->data['success'];
unset($this->session->data['success']);
} else {
$data['success'] = '';
}
$data['action'] = $this->url->link('common/login', '', true);
if (isset($this->request->post['username'])) {
$data['username'] = $this->request->post['username'];
} else {
$data['username'] = '';
}
if (isset($this->request->post['password'])) {
$data['password'] = $this->request->post['password'];
} else {
$data['password'] = '';
}
if (isset($this->request->get['route'])) {
$route = $this->request->get['route'];
unset($this->request->get['route']);
unset($this->request->get['user_token']);
$url = '';
if ($this->request->get) {
$url .= http_build_query($this->request->get);
}
$data['redirect'] = $this->url->link($route, $url, true);
} else {
$data['redirect'] = '';
}
if ($this->config->get('config_password')) {
$data['forgotten'] = $this->url->link('common/forgotten', '', true);
} else {
$data['forgotten'] = '';
}
$data['header'] = $this->load->controller('common/header');
$data['footer'] = $this->load->controller('common/footer');
$this->response->setOutput($this->load->view('common/login', $data));
}
protected function validate() {
if(!isset($this->request->post['username']) || !isset($this->request->post['password']) || !$this->request->post['username'] || !$this->request->post['password']) {
$this->error['warning'] = $this->language->get('error_login');
} else {
$this->load->model('user/user');
// Check how many login attempts have been made.
$login_info = $this->model_user_user->getLoginAttempts($this->request->post['username']);
if ($login_info && ($login_info['total'] >= $this->config->get('config_login_attempts')) && strtotime('-1 hour') < strtotime($login_info['date_modified'])) {
$this->error['error_attempts'] = $this->language->get('error_attempts');
}
}
if(!$this->error) {
if (!$this->user->login($this->request->post['username'], html_entity_decode($this->request->post['password'], ENT_QUOTES, 'UTF-8'))) {
$this->error['warning'] = $this->language->get('error_login');
$this->model_user_user->addLoginAttempt($this->request->post['username']);
unset($this->session->data['user_token']);
} else {
$this->model_user_user->deleteLoginAttempts($this->request->post['username']);
}
}
return !$this->error;
}
}
<?php
class ControllerCommonLogout extends Controller {
public function index() {
$this->user->logout();
unset($this->session->data['user_token']);
$this->response->redirect($this->url->link('common/login', '', true));
}
}
\ No newline at end of file
<?php
class ControllerCommonProfile extends Controller {
private $error = array();
public function index() {
$this->load->language('common/profile');
$this->document->setTitle($this->language->get('heading_title'));
$this->load->model('user/user');
if (($this->request->server['REQUEST_METHOD'] == 'POST') && $this->validateForm()) {
$user_data = array_merge($this->request->post, array(
'user_group_id' => $this->user->getGroupId(),
'status' => 1,
));
$this->model_user_user->editUser($this->user->getId(), $user_data);
$this->session->data['success'] = $this->language->get('text_success');
$this->response->redirect($this->url->link('common/profile', 'user_token=' . $this->session->data['user_token'], true));
}
if (isset($this->session->data['success'])) {
$data['success'] = $this->session->data['success'];
unset($this->session->data['success']);
} else {
$data['success'] = '';
}
if (isset($this->error['warning'])) {
$data['error_warning'] = $this->error['warning'];
} else {
$data['error_warning'] = '';
}
if (isset($this->error['username'])) {
$data['error_username'] = $this->error['username'];
} else {
$data['error_username'] = '';
}
if (isset($this->error['password'])) {
$data['error_password'] = $this->error['password'];
} else {
$data['error_password'] = '';
}
if (isset($this->error['confirm'])) {
$data['error_confirm'] = $this->error['confirm'];
} else {
$data['error_confirm'] = '';
}
if (isset($this->error['firstname'])) {
$data['error_firstname'] = $this->error['firstname'];
} else {
$data['error_firstname'] = '';
}
if (isset($this->error['lastname'])) {
$data['error_lastname'] = $this->error['lastname'];
} else {
$data['error_lastname'] = '';
}
if (isset($this->error['email'])) {
$data['error_email'] = $this->error['email'];
} else {
$data['error_email'] = '';
}
$data['breadcrumbs'] = array();
$data['breadcrumbs'][] = array(
'text' => $this->language->get('text_home'),
'href' => $this->url->link('common/dashboard', 'user_token=' . $this->session->data['user_token'], true)
);
$data['breadcrumbs'][] = array(
'text' => $this->language->get('heading_title'),
'href' => $this->url->link('common/profile', 'user_token=' . $this->session->data['user_token'], true)
);
$data['action'] = $this->url->link('common/profile', 'user_token=' . $this->session->data['user_token'], true);
$data['cancel'] = $this->url->link('common/dashboard', 'user_token=' . $this->session->data['user_token'], true);
if ($this->request->server['REQUEST_METHOD'] != 'POST') {
$user_info = $this->model_user_user->getUser($this->user->getId());
}
if (isset($this->request->post['username'])) {
$data['username'] = $this->request->post['username'];
} elseif (!empty($user_info)) {
$data['username'] = $user_info['username'];
} else {
$data['username'] = '';
}
if (isset($this->request->post['password'])) {
$data['password'] = $this->request->post['password'];
} else {
$data['password'] = '';
}
if (isset($this->request->post['confirm'])) {
$data['confirm'] = $this->request->post['confirm'];
} else {
$data['confirm'] = '';
}
if (isset($this->request->post['firstname'])) {
$data['firstname'] = $this->request->post['firstname'];
} elseif (!empty($user_info)) {
$data['firstname'] = $user_info['firstname'];
} else {
$data['firstname'] = '';
}
if (isset($this->request->post['lastname'])) {
$data['lastname'] = $this->request->post['lastname'];
} elseif (!empty($user_info)) {
$data['lastname'] = $user_info['lastname'];
} else {
$data['lastname'] = '';
}
if (isset($this->request->post['email'])) {
$data['email'] = $this->request->post['email'];
} elseif (!empty($user_info)) {
$data['email'] = $user_info['email'];
} else {
$data['email'] = '';
}
if (isset($this->request->post['image'])) {
$data['image'] = $this->request->post['image'];
} elseif (!empty($user_info)) {
$data['image'] = $user_info['image'];
} else {
$data['image'] = '';
}
$this->load->model('tool/image');
if (isset($this->request->post['image']) && is_file(DIR_IMAGE . $this->request->post['image'])) {
$data['thumb'] = $this->model_tool_image->resize($this->request->post['image'], 100, 100);
} elseif (!empty($user_info) && $user_info['image'] && is_file(DIR_IMAGE . $user_info['image'])) {
$data['thumb'] = $this->model_tool_image->resize($user_info['image'], 100, 100);
} else {
$data['thumb'] = $this->model_tool_image->resize('no_image.png', 100, 100);
}
$data['placeholder'] = $this->model_tool_image->resize('no_image.png', 100, 100);
$data['header'] = $this->load->controller('common/header');
$data['column_left'] = $this->load->controller('common/column_left');
$data['footer'] = $this->load->controller('common/footer');
$this->response->setOutput($this->load->view('common/profile', $data));
}
protected function validateForm() {
if (!$this->user->hasPermission('modify', 'common/profile')) {
$this->error['warning'] = $this->language->get('error_permission');
}
if ((utf8_strlen($this->request->post['username']) < 3) || (utf8_strlen($this->request->post['username']) > 20)) {
$this->error['username'] = $this->language->get('error_username');
}
$user_info = $this->model_user_user->getUserByUsername($this->request->post['username']);
if ($user_info && ($this->user->getId() != $user_info['user_id'])) {
$this->error['warning'] = $this->language->get('error_exists_username');
}
if ((utf8_strlen(trim($this->request->post['firstname'])) < 1) || (utf8_strlen(trim($this->request->post['firstname'])) > 32)) {
$this->error['firstname'] = $this->language->get('error_firstname');
}
if ((utf8_strlen(trim($this->request->post['lastname'])) < 1) || (utf8_strlen(trim($this->request->post['lastname'])) > 32)) {
$this->error['lastname'] = $this->language->get('error_lastname');
}
if ((utf8_strlen($this->request->post['email']) > 96) || !filter_var($this->request->post['email'], FILTER_VALIDATE_EMAIL)) {
$this->error['email'] = $this->language->get('error_email');
}
$user_info = $this->model_user_user->getUserByEmail($this->request->post['email']);
if ($user_info && ($this->user->getId() != $user_info['user_id'])) {
$this->error['warning'] = $this->language->get('error_exists_email');
}
if ($this->request->post['password']) {
if ((utf8_strlen(html_entity_decode($this->request->post['password'], ENT_QUOTES, 'UTF-8')) < 4) || (utf8_strlen(html_entity_decode($this->request->post['password'], ENT_QUOTES, 'UTF-8')) > 40)) {
$this->error['password'] = $this->language->get('error_password');
}
if ($this->request->post['password'] != $this->request->post['confirm']) {
$this->error['confirm'] = $this->language->get('error_confirm');
}
}
return !$this->error;
}
}
<?php
class ControllerCommonReset extends Controller {
private $error = array();
public function index() {
if ($this->user->isLogged() && isset($this->request->get['user_token']) && ($this->request->get['user_token'] == $this->session->data['user_token'])) {
$this->response->redirect($this->url->link('common/dashboard', '', true));
}
if (!$this->config->get('config_password')) {
$this->response->redirect($this->url->link('common/login', '', true));
}
if (isset($this->request->get['code'])) {
$code = $this->request->get['code'];
} else {
$code = '';
}
$this->load->model('user/user');
$user_info = $this->model_user_user->getUserByCode($code);
if ($user_info) {
$this->load->language('common/reset');
$this->document->setTitle($this->language->get('heading_title'));
if (($this->request->server['REQUEST_METHOD'] == 'POST') && $this->validate()) {
$this->model_user_user->editPassword($user_info['user_id'], $this->request->post['password']);
$this->model_user_user->deleteLoginAttempts($user_info['username']);
$this->session->data['success'] = $this->language->get('text_success');
$this->response->redirect($this->url->link('common/login', '', true));
}
$data['breadcrumbs'] = array();
$data['breadcrumbs'][] = array(
'text' => $this->language->get('text_home'),
'href' => $this->url->link('common/dashboard', '', true)
);
$data['breadcrumbs'][] = array(
'text' => $this->language->get('heading_title'),
'href' => $this->url->link('common/reset', '', true)
);
if (isset($this->error['password'])) {
$data['error_password'] = $this->error['password'];
} else {
$data['error_password'] = '';
}
if (isset($this->error['confirm'])) {
$data['error_confirm'] = $this->error['confirm'];
} else {
$data['error_confirm'] = '';
}
$data['action'] = $this->url->link('common/reset', 'code=' . $code, true);
$data['cancel'] = $this->url->link('common/login', '', true);
if (isset($this->request->post['password'])) {
$data['password'] = $this->request->post['password'];
} else {
$data['password'] = '';
}
if (isset($this->request->post['confirm'])) {
$data['confirm'] = $this->request->post['confirm'];
} else {
$data['confirm'] = '';
}
$data['header'] = $this->load->controller('common/header');
$data['footer'] = $this->load->controller('common/footer');
$this->response->setOutput($this->load->view('common/reset', $data));
} else {
$this->load->model('setting/setting');
$this->model_setting_setting->editSettingValue('config', 'config_password', '0');
return new Action('common/login');
}
}
protected function validate() {
if ((utf8_strlen(html_entity_decode($this->request->post['password'], ENT_QUOTES, 'UTF-8')) < 4) || (utf8_strlen(html_entity_decode($this->request->post['password'], ENT_QUOTES, 'UTF-8')) > 40)) {
$this->error['password'] = $this->language->get('error_password');
}
if ($this->request->post['confirm'] != $this->request->post['password']) {
$this->error['confirm'] = $this->language->get('error_confirm');
}
return !$this->error;
}
}
\ No newline at end of file
<?php
class ControllerCommonSecurity extends Controller {
public function index() {
$this->load->language('common/security');
$data['text_instruction'] = $this->language->get('text_instruction');
$data['user_token'] = $this->session->data['user_token'];
$data['storage'] = DIR_SYSTEM . 'storage/';
$path = '';
$data['paths'] = array();
$parts = explode('/', str_replace('\\', '/', rtrim(DIR_SYSTEM, '/')));
foreach ($parts as $part) {
$path .= $part . '/';
$data['paths'][] = $path;
}
rsort($data['paths']);
$data['document_root'] = str_replace('\\', '/', realpath($this->request->server['DOCUMENT_ROOT'] . '/../') . '/');
return $this->load->view('common/security', $data);
}
public function move() {
$this->load->language('common/security');
$json = array();
if ($this->request->post['path']) {
$path = $this->request->post['path'];
} else {
$path = '';
}
if ($this->request->post['directory']) {
$directory = $this->request->post['directory'];
} else {
$directory = '';
}
if (!$this->user->hasPermission('modify', 'common/security')) {
$json['error'] = $this->language->get('error_permission');
} else {
if (DIR_STORAGE != DIR_SYSTEM . 'storage/') {
$data['error'] = $this->language->get('error_path');
}
if (!$path || str_replace('\\', '/', realpath($path)) . '/' != str_replace('\\', '/', substr(DIR_SYSTEM, 0, strlen($path)))) {
$json['error'] = $this->language->get('error_path');
}
if (!$directory || !preg_match('/^[a-zA-Z0-9_-]+$/', $directory)) {
$json['error'] = $this->language->get('error_directory');
}
if (is_dir($path . $directory)) {
$json['error'] = $this->language->get('error_exists');
}
if (!is_writable(realpath(DIR_APPLICATION . '/../') . '/config.php') || !is_writable(DIR_APPLICATION . 'config.php')) {
$json['error'] = $this->language->get('error_writable');
}
if (!$json) {
$files = array();
// Make path into an array
$source = array(DIR_SYSTEM . 'storage/');
// While the path array is still populated keep looping through
while (count($source) != 0) {
$next = array_shift($source);
foreach (glob($next) as $file) {
// If directory add to path array
if (is_dir($file)) {
$source[] = $file . '/*';
}
// Add the file to the files to be deleted array
$files[] = $file;
}
}
// Create the new storage folder
if (!is_dir($path . $directory)) {
mkdir($path . $directory, 0777);
}
// Copy the
foreach ($files as $file) {
$destination = $path . $directory . substr($file, strlen(DIR_SYSTEM . 'storage/'));
if (is_dir($file) && !is_dir($destination)) {
mkdir($destination, 0777);
}
if (is_file($file)) {
copy($file, $destination);
}
}
// Modify the config files
$files = array(
DIR_APPLICATION . 'config.php',
realpath(DIR_APPLICATION . '/../') . '/config.php'
);
foreach ($files as $file) {
$output = '';
$lines = file($file);
foreach ($lines as $line_id => $line) {
if (strpos($line, 'define(\'DIR_STORAGE') !== false) {
$output .= 'define(\'DIR_STORAGE\', \'' . $path . $directory . '/\');' . "\n";
} else {
$output .= $line;
}
}
$file = fopen($file, 'w');
fwrite($file, $output);
fclose($file);
}
$json['success'] = $this->language->get('text_success');
}
}
$this->response->addHeader('Content-Type: application/json');
$this->response->setOutput(json_encode($json));
}
}
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
<?php
class ControllerCustomerCustomerApproval extends Controller {
public function index() {
$this->load->language('customer/customer_approval');
$this->document->setTitle($this->language->get('heading_title'));
if (isset($this->request->get['filter_name'])) {
$filter_name = $this->request->get['filter_name'];
} else {
$filter_name = '';
}
if (isset($this->request->get['filter_email'])) {
$filter_email = $this->request->get['filter_email'];
} else {
$filter_email = '';
}
if (isset($this->request->get['filter_customer_group_id'])) {
$filter_customer_group_id = $this->request->get['filter_customer_group_id'];
} else {
$filter_customer_group_id = '';
}
if (isset($this->request->get['filter_type'])) {
$filter_type = $this->request->get['filter_type'];
} else {
$filter_type = '';
}
if (isset($this->request->get['filter_date_added'])) {
$filter_date_added = $this->request->get['filter_date_added'];
} else {
$filter_date_added = '';
}
$url = '';
if (isset($this->request->get['filter_name'])) {
$url .= '&filter_name=' . urlencode(html_entity_decode($this->request->get['filter_name'], ENT_QUOTES, 'UTF-8'));
}
if (isset($this->request->get['filter_email'])) {
$url .= '&filter_email=' . urlencode(html_entity_decode($this->request->get['filter_email'], ENT_QUOTES, 'UTF-8'));
}
if (isset($this->request->get['filter_customer_group_id'])) {
$url .= '&filter_customer_group_id=' . $this->request->get['filter_customer_group_id'];
}
if (isset($this->request->get['filter_type'])) {
$url .= '&filter_type=' . $this->request->get['filter_type'];
}
if (isset($this->request->get['filter_date_added'])) {
$url .= '&filter_date_added=' . $this->request->get['filter_date_added'];
}
if (isset($this->request->get['page'])) {
$url .= '&page=' . $this->request->get['page'];
}
$data['breadcrumbs'] = array();
$data['breadcrumbs'][] = array(
'text' => $this->language->get('text_home'),
'href' => $this->url->link('common/dashboard', 'user_token=' . $this->session->data['user_token'], true)
);
$data['breadcrumbs'][] = array(
'text' => $this->language->get('heading_title'),
'href' => $this->url->link('customer/customer_approval', 'user_token=' . $this->session->data['user_token'], true)
);
$data['filter_name'] = $filter_name;
$data['filter_email'] = $filter_email;
$data['filter_customer_group_id'] = $filter_customer_group_id;
$data['filter_type'] = $filter_type;
$data['filter_date_added'] = $filter_date_added;
$data['user_token'] = $this->session->data['user_token'];
$this->load->model('customer/customer_group');
$data['customer_groups'] = $this->model_customer_customer_group->getCustomerGroups();
$data['header'] = $this->load->controller('common/header');
$data['column_left'] = $this->load->controller('common/column_left');
$data['footer'] = $this->load->controller('common/footer');
$this->response->setOutput($this->load->view('customer/customer_approval', $data));
}
public function customer_approval() {
$this->load->language('customer/customer_approval');
if (isset($this->request->get['filter_name'])) {
$filter_name = $this->request->get['filter_name'];
} else {
$filter_name = '';
}
if (isset($this->request->get['filter_email'])) {
$filter_email = $this->request->get['filter_email'];
} else {
$filter_email = '';
}
if (isset($this->request->get['filter_customer_group_id'])) {
$filter_customer_group_id = $this->request->get['filter_customer_group_id'];
} else {
$filter_customer_group_id = '';
}
if (isset($this->request->get['filter_type'])) {
$filter_type = $this->request->get['filter_type'];
} else {
$filter_type = '';
}
if (isset($this->request->get['filter_date_added'])) {
$filter_date_added = $this->request->get['filter_date_added'];
} else {
$filter_date_added = '';
}
if (isset($this->request->get['page'])) {
$page = (int)$this->request->get['page'];
} else {
$page = 1;
}
$data['customer_approvals'] = array();
$filter_data = array(
'filter_name' => $filter_name,
'filter_email' => $filter_email,
'filter_customer_group_id' => $filter_customer_group_id,
'filter_type' => $filter_type,
'filter_date_added' => $filter_date_added,
'start' => ($page - 1) * $this->config->get('config_limit_admin'),
'limit' => $this->config->get('config_limit_admin')
);
$this->load->model('customer/customer_approval');
$customer_approval_total = $this->model_customer_customer_approval->getTotalCustomerApprovals($filter_data);
$results = $this->model_customer_customer_approval->getCustomerApprovals($filter_data);
foreach ($results as $result) {
$data['customer_approvals'][] = array(
'customer_id' => $result['customer_id'],
'name' => $result['name'],
'email' => $result['email'],
'customer_group' => $result['customer_group'],
'type' => $this->language->get('text_' . $result['type']),
'date_added' => date($this->language->get('date_format_short'), strtotime($result['date_added'])),
'approve' => $this->url->link('customer/customer_approval/approve', 'user_token=' . $this->session->data['user_token'] . '&customer_id=' . $result['customer_id'] . '&type=' . $result['type'], true),
'deny' => $this->url->link('customer/customer_approval/deny', 'user_token=' . $this->session->data['user_token'] . '&customer_id=' . $result['customer_id'] . '&type=' . $result['type'], true),
'edit' => $this->url->link('customer/customer/edit', 'user_token=' . $this->session->data['user_token'] . '&customer_id=' . $result['customer_id'], true)
);
}
$url = '';
if (isset($this->request->get['filter_name'])) {
$url .= '&filter_name=' . urlencode(html_entity_decode($this->request->get['filter_name'], ENT_QUOTES, 'UTF-8'));
}
if (isset($this->request->get['filter_email'])) {
$url .= '&filter_email=' . urlencode(html_entity_decode($this->request->get['filter_email'], ENT_QUOTES, 'UTF-8'));
}
if (isset($this->request->get['filter_customer_group_id'])) {
$url .= '&filter_customer_group_id=' . $this->request->get['filter_customer_group_id'];
}
if (isset($this->request->get['filter_type'])) {
$url .= '&filter_type=' . $this->request->get['filter_type'];
}
if (isset($this->request->get['filter_date_added'])) {
$url .= '&filter_date_added=' . $this->request->get['filter_date_added'];
}
$pagination = new Pagination();
$pagination->total = $customer_approval_total;
$pagination->page = $page;
$pagination->limit = $this->config->get('config_limit_admin');
$pagination->url = $this->url->link('customer/customer_approval/customer_approval', 'user_token=' . $this->session->data['user_token'] . $url . '&page={page}', true);
$data['pagination'] = $pagination->render();
$data['results'] = sprintf($this->language->get('text_pagination'), ($customer_approval_total) ? (($page - 1) * $this->config->get('config_limit_admin')) + 1 : 0, ((($page - 1) * $this->config->get('config_limit_admin')) > ($customer_approval_total - $this->config->get('config_limit_admin'))) ? $customer_approval_total : ((($page - 1) * $this->config->get('config_limit_admin')) + $this->config->get('config_limit_admin')), $customer_approval_total, ceil($customer_approval_total / $this->config->get('config_limit_admin')));
$this->response->setOutput($this->load->view('customer/customer_approval_list', $data));
}
public function approve() {
$this->load->language('customer/customer_approval');
$json = array();
if (!$this->user->hasPermission('modify', 'customer/customer_approval')) {
$json['error'] = $this->language->get('error_permission');
} else {
$this->load->model('customer/customer_approval');
if ($this->request->get['type'] == 'customer') {
$this->model_customer_customer_approval->approveCustomer($this->request->get['customer_id']);
} elseif ($this->request->get['type'] == 'affiliate') {
$this->model_customer_customer_approval->approveAffiliate($this->request->get['customer_id']);
}
$json['success'] = $this->language->get('text_success');
}
$this->response->addHeader('Content-Type: application/json');
$this->response->setOutput(json_encode($json));
}
public function deny() {
$this->load->language('customer/customer_approval');
$json = array();
if (!$this->user->hasPermission('modify', 'customer/customer_approval')) {
$json['error'] = $this->language->get('error_permission');
} else {
$this->load->model('customer/customer_approval');
if ($this->request->get['type'] == 'customer') {
$this->model_customer_customer_approval->denyCustomer($this->request->get['customer_id']);
} elseif ($this->request->get['type'] == 'affiliate') {
$this->model_customer_customer_approval->denyAffiliate($this->request->get['customer_id']);
}
$json['success'] = $this->language->get('text_success');
}
$this->response->addHeader('Content-Type: application/json');
$this->response->setOutput(json_encode($json));
}
}
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
<?php
class ControllerDesignTheme extends Controller {
public function index() {
$this->load->language('design/theme');
$this->document->setTitle($this->language->get('heading_title'));
$data['breadcrumbs'] = array();
$data['breadcrumbs'][] = array(
'text' => $this->language->get('text_home'),
'href' => $this->url->link('common/dashboard', 'user_token=' . $this->session->data['user_token'], true)
);
$data['breadcrumbs'][] = array(
'text' => $this->language->get('heading_title'),
'href' => $this->url->link('design/theme', 'user_token=' . $this->session->data['user_token'], true)
);
$data['user_token'] = $this->session->data['user_token'];
$data['stores'] = array();
$this->load->model('setting/store');
$results = $this->model_setting_store->getStores();
foreach ($results as $result) {
$data['stores'][] = array(
'store_id' => $result['store_id'],
'name' => $result['name']
);
}
$data['header'] = $this->load->controller('common/header');
$data['column_left'] = $this->load->controller('common/column_left');
$data['footer'] = $this->load->controller('common/footer');
$this->response->setOutput($this->load->view('design/theme', $data));
}
public function history() {
$this->load->language('design/theme');
if (isset($this->request->get['page'])) {
$page = (int)$this->request->get['page'];
} else {
$page = 1;
}
$data['histories'] = array();
$this->load->model('design/theme');
$this->load->model('setting/store');
$history_total = $this->model_design_theme->getTotalThemes();
$results = $this->model_design_theme->getThemes(($page - 1) * 10, 10);
foreach ($results as $result) {
$store_info = $this->model_setting_store->getStore($result['store_id']);
if ($store_info) {
$store = $store_info['name'];
} else {
$store = '';
}
$data['histories'][] = array(
'store_id' => $result['store_id'],
'store' => ($result['store_id'] ? $store : $this->language->get('text_default')),
'route' => $result['route'],
'theme' => $result['theme'],
'date_added' => date($this->language->get('date_format_short'), strtotime($result['date_added'])),
'edit' => $this->url->link('design/theme/template', 'user_token=' . $this->session->data['user_token'], true),
'delete' => $this->url->link('design/theme/delete', 'user_token=' . $this->session->data['user_token'] . '&theme_id=' . $result['theme_id'], true)
);
}
$pagination = new Pagination();
$pagination->total = $history_total;
$pagination->page = $page;
$pagination->limit = 10;
$pagination->url = $this->url->link('design/theme/history', 'user_token=' . $this->session->data['user_token'] . '&page={page}', true);
$data['pagination'] = $pagination->render();
$data['results'] = sprintf($this->language->get('text_pagination'), ($history_total) ? (($page - 1) * 10) + 1 : 0, ((($page - 1) * 10) > ($history_total - 10)) ? $history_total : ((($page - 1) * 10) + 10), $history_total, ceil($history_total / 10));
$this->response->setOutput($this->load->view('design/theme_history', $data));
}
public function path() {
$this->load->language('design/theme');
$json = array();
if (isset($this->request->get['store_id'])) {
$store_id = $this->request->get['store_id'];
} else {
$store_id = 0;
}
$this->load->model('setting/setting');
$theme = $this->model_setting_setting->getSettingValue('config_theme', $store_id);
// This is only here for compatibility with old themes.
if ($theme == 'theme_default') {
$theme = $this->model_setting_setting->getSettingValue('theme_default_directory', $store_id);
}
if (isset($this->request->get['path'])) {
$path = $this->request->get['path'];
} else {
$path = '';
}
if (substr(str_replace('\\', '/', realpath(DIR_CATALOG . 'view/theme/default/template/' . $path)), 0, strlen(DIR_CATALOG . 'view')) == DIR_CATALOG . 'view') {
$path_data = array();
// We grab the files from the default theme directory first as the custom themes drops back to the default theme if selected theme files can not be found.
$files = glob(rtrim(DIR_CATALOG . 'view/theme/{default,' . $theme . '}/template/' . $path, '/') . '/*', GLOB_BRACE);
if ($files) {
foreach($files as $file) {
if (!in_array(basename($file), $path_data)) {
if (is_dir($file)) {
$json['directory'][] = array(
'name' => basename($file),
'path' => trim($path . '/' . basename($file), '/')
);
}
if (is_file($file)) {
$json['file'][] = array(
'name' => basename($file),
'path' => trim($path . '/' . basename($file), '/')
);
}
$path_data[] = basename($file);
}
}
}
}
if (!empty($this->request->get['path'])) {
$json['back'] = array(
'name' => $this->language->get('button_back'),
'path' => urlencode(substr($path, 0, strrpos($path, '/'))),
);
}
$this->response->addHeader('Content-Type: application/json');
$this->response->setOutput(json_encode($json));
}
public function template() {
$this->load->language('design/theme');
$json = array();
if (isset($this->request->get['store_id'])) {
$store_id = $this->request->get['store_id'];
} else {
$store_id = 0;
}
$this->load->model('setting/setting');
$theme = $this->model_setting_setting->getSettingValue('config_theme', $store_id);
// This is only here for compatibility with old themes.
if ($theme == 'theme_default') {
$theme = $this->model_setting_setting->getSettingValue('theme_default_directory', $store_id);
}
if (isset($this->request->get['path'])) {
$path = $this->request->get['path'];
} else {
$path = '';
}
$this->load->model('design/theme');
$theme_info = $this->model_design_theme->getTheme($store_id, $theme, $path);
if ($theme_info) {
$json['code'] = html_entity_decode($theme_info['code']);
} elseif (is_file(DIR_CATALOG . 'view/theme/' . $theme . '/template/' . $path) && (substr(str_replace('\\', '/', realpath(DIR_CATALOG . 'view/theme/' . $theme . '/template/' . $path)), 0, strlen(DIR_CATALOG . 'view')) == DIR_CATALOG . 'view')) {
$json['code'] = file_get_contents(DIR_CATALOG . 'view/theme/' . $theme . '/template/' . $path);
} elseif (is_file(DIR_CATALOG . 'view/theme/default/template/' . $path) && (substr(str_replace('\\', '/', realpath(DIR_CATALOG . 'view/theme/default/template/' . $path)), 0, strlen(DIR_CATALOG . 'view')) == DIR_CATALOG . 'view')) {
$json['code'] = file_get_contents(DIR_CATALOG . 'view/theme/default/template/' . $path);
}
$this->response->addHeader('Content-Type: application/json');
$this->response->setOutput(json_encode($json));
}
public function save() {
$this->load->language('design/theme');
$json = array();
if (isset($this->request->get['store_id'])) {
$store_id = $this->request->get['store_id'];
} else {
$store_id = 0;
}
$this->load->model('setting/setting');
$theme = $this->model_setting_setting->getSettingValue('config_theme', $store_id);
// This is only here for compatibility with old themes.
if ($theme == 'theme_default') {
$theme = $this->model_setting_setting->getSettingValue('theme_default_directory', $store_id);
}
if (isset($this->request->get['path'])) {
$path = $this->request->get['path'];
} else {
$path = '';
}
// Check user has permission
if (!$this->user->hasPermission('modify', 'design/theme')) {
$json['error'] = $this->language->get('error_permission');
}
if (substr($path, -5) != '.twig') {
$json['error'] = $this->language->get('error_twig');
}
if (!$json) {
$this->load->model('design/theme');
$pos = strpos($path, '.');
$this->model_design_theme->editTheme($store_id, $theme, ($pos !== false) ? substr($path, 0, $pos) : $path, $this->request->post['code']);
$json['success'] = $this->language->get('text_success');
}
$this->response->addHeader('Content-Type: application/json');
$this->response->setOutput(json_encode($json));
}
public function reset() {
$this->load->language('design/theme');
$json = array();
if (isset($this->request->get['store_id'])) {
$store_id = $this->request->get['store_id'];
} else {
$store_id = 0;
}
$this->load->model('setting/setting');
$theme = $this->model_setting_setting->getSettingValue('config_theme', $store_id);
// This is only here for compatibility with old themes.
if ($theme == 'theme_default') {
$theme = $this->model_setting_setting->getSettingValue('theme_default_directory', $store_id);
}
if (isset($this->request->get['path'])) {
$path = $this->request->get['path'];
} else {
$path = '';
}
if (is_file(DIR_CATALOG . 'view/theme/' . $theme . '/template/' . $path) && (substr(str_replace('\\', '/', realpath(DIR_CATALOG . 'view/theme/' . $theme . '/template/' . $path)), 0, strlen(DIR_CATALOG . 'view')) == DIR_CATALOG . 'view')) {
$json['code'] = file_get_contents(DIR_CATALOG . 'view/theme/' . $theme . '/template/' . $path);
}
$this->response->addHeader('Content-Type: application/json');
$this->response->setOutput(json_encode($json));
}
public function delete() {
$this->load->language('design/theme');
$json = array();
if (isset($this->request->get['theme_id'])) {
$theme_id = $this->request->get['theme_id'];
} else {
$theme_id = 0;
}
// Check user has permission
if (!$this->user->hasPermission('modify', 'design/theme')) {
$json['error'] = $this->language->get('error_permission');
}
if (!$json) {
$this->load->model('design/theme');
$this->model_design_theme->deleteTheme($theme_id);
$json['success'] = $this->language->get('text_success');
}
$this->response->addHeader('Content-Type: application/json');
$this->response->setOutput(json_encode($json));
}
}
This diff is collapsed. Click to expand it.
<?php
class ControllerErrorNotFound extends Controller {
public function index() {
$this->load->language('error/not_found');
$this->document->setTitle($this->language->get('heading_title'));
$data['breadcrumbs'] = array();
$data['breadcrumbs'][] = array(
'text' => $this->language->get('text_home'),
'href' => $this->url->link('common/dashboard', 'user_token=' . $this->session->data['user_token'], true)
);
$data['breadcrumbs'][] = array(
'text' => $this->language->get('heading_title'),
'href' => $this->url->link('error/not_found', 'user_token=' . $this->session->data['user_token'], true)
);
$data['header'] = $this->load->controller('common/header');
$data['column_left'] = $this->load->controller('common/column_left');
$data['footer'] = $this->load->controller('common/footer');
$this->response->setOutput($this->load->view('error/not_found', $data));
}
}
<?php
class ControllerErrorPermission extends Controller {
public function index() {
$this->load->language('error/permission');
$this->document->setTitle($this->language->get('heading_title'));
$data['breadcrumbs'] = array();
$data['breadcrumbs'][] = array(
'text' => $this->language->get('text_home'),
'href' => $this->url->link('common/dashboard', 'user_token=' . $this->session->data['user_token'], true)
);
$data['breadcrumbs'][] = array(
'text' => $this->language->get('heading_title'),
'href' => $this->url->link($this->request->get['route'], 'user_token=' . $this->session->data['user_token'], true)
);
$data['header'] = $this->load->controller('common/header');
$data['column_left'] = $this->load->controller('common/column_left');
$data['footer'] = $this->load->controller('common/footer');
$this->response->setOutput($this->load->view('error/permission', $data));
}
}
<?php
class ControllerEventLanguage extends Controller {
public function index(&$route, &$args) {
foreach ($this->language->all() as $key => $value) {
if (!isset($args[$key])) {
$args[$key] = $value;
}
}
}
// 1. Before controller load store all current loaded language data
public function before(&$route, &$output) {
$this->language->set('backup', $this->language->all());
}
// 2. After contoller load restore old language data
public function after(&$route, &$args, &$output) {
$data = $this->language->get('backup');
if (is_array($data)) {
foreach ($data as $key => $value) {
$this->language->set($key, $value);
}
}
}
}
<?php
class ControllerEventStatistics extends Controller {
// model/catalog/review/removeReview/after
public function removeReview(&$route, &$args, &$output) {
$this->load->model('setting/statistics');
$this->model_report_statistics->addValue('review', 1);
}
// model/sale/return/removeReturn/after
public function removeReturn(&$route, &$args, &$output) {
$this->load->model('setting/statistics');
$this->model_report_statistics->addValue('return', 1);
}
}
<?php
class ControllerEventTheme extends Controller {
public function index(&$route, &$args) {
// This is only here for compatibility with old templates
if (substr($route, -3) == 'tpl') {
$view = substr($route, 0, -3);
}
if (is_file(DIR_TEMPLATE . $route . '.twig')) {
$this->config->set('template_engine', 'twig');
} elseif (is_file(DIR_TEMPLATE . $route . '.tpl')) {
$this->config->set('template_engine', 'template');
}
}
}
This diff could not be displayed because it is too large.
<?php
class ControllerExtensionAnalyticsGoogle extends Controller {
private $error = array();
public function index() {
$this->load->language('extension/analytics/google');
$this->document->setTitle($this->language->get('heading_title'));
$this->load->model('setting/setting');
if (($this->request->server['REQUEST_METHOD'] == 'POST') && $this->validate()) {
$this->model_setting_setting->editSetting('analytics_google', $this->request->post, $this->request->get['store_id']);
$this->session->data['success'] = $this->language->get('text_success');
$this->response->redirect($this->url->link('marketplace/extension', 'user_token=' . $this->session->data['user_token'] . '&type=analytics', true));
}
if (isset($this->error['warning'])) {
$data['error_warning'] = $this->error['warning'];
} else {
$data['error_warning'] = '';
}
if (isset($this->error['code'])) {
$data['error_code'] = $this->error['code'];
} else {
$data['error_code'] = '';
}
$data['breadcrumbs'] = array();
$data['breadcrumbs'][] = array(
'text' => $this->language->get('text_home'),
'href' => $this->url->link('common/dashboard', 'user_token=' . $this->session->data['user_token'], true)
);
$data['breadcrumbs'][] = array(
'text' => $this->language->get('text_extension'),
'href' => $this->url->link('marketplace/extension', 'user_token=' . $this->session->data['user_token'] . '&type=analytics', true)
);
$data['breadcrumbs'][] = array(
'text' => $this->language->get('heading_title'),
'href' => $this->url->link('extension/analytics/google', 'user_token=' . $this->session->data['user_token'] . '&store_id=' . $this->request->get['store_id'], true)
);
$data['action'] = $this->url->link('extension/analytics/google', 'user_token=' . $this->session->data['user_token'] . '&store_id=' . $this->request->get['store_id'], true);
$data['cancel'] = $this->url->link('marketplace/extension', 'user_token=' . $this->session->data['user_token'] . '&type=analytics', true);
$data['user_token'] = $this->session->data['user_token'];
if (isset($this->request->post['analytics_google_code'])) {
$data['analytics_google_code'] = $this->request->post['analytics_google_code'];
} else {
$data['analytics_google_code'] = $this->model_setting_setting->getSettingValue('analytics_google_code', $this->request->get['store_id']);
}
if (isset($this->request->post['analytics_google_status'])) {
$data['analytics_google_status'] = $this->request->post['analytics_google_status'];
} else {
$data['analytics_google_status'] = $this->model_setting_setting->getSettingValue('analytics_google_status', $this->request->get['store_id']);
}
$data['header'] = $this->load->controller('common/header');
$data['column_left'] = $this->load->controller('common/column_left');
$data['footer'] = $this->load->controller('common/footer');
$this->response->setOutput($this->load->view('extension/analytics/google', $data));
}
protected function validate() {
if (!$this->user->hasPermission('modify', 'extension/analytics/google')) {
$this->error['warning'] = $this->language->get('error_permission');
}
if (!$this->request->post['analytics_google_code']) {
$this->error['code'] = $this->language->get('error_code');
}
return !$this->error;
}
}
<?php
class ControllerExtensionCaptchaBasic extends Controller {
private $error = array();
public function index() {
$this->load->language('extension/captcha/basic');
$this->document->setTitle($this->language->get('heading_title'));
$this->load->model('setting/setting');
if (($this->request->server['REQUEST_METHOD'] == 'POST') && $this->validate()) {
$this->model_setting_setting->editSetting('captcha_basic', $this->request->post);
$this->session->data['success'] = $this->language->get('text_success');
$this->response->redirect($this->url->link('marketplace/extension', 'user_token=' . $this->session->data['user_token'] . '&type=captcha', true));
}
if (isset($this->error['warning'])) {
$data['error_warning'] = $this->error['warning'];
} else {
$data['error_warning'] = '';
}
$data['breadcrumbs'] = array();
$data['breadcrumbs'][] = array(
'text' => $this->language->get('text_home'),
'href' => $this->url->link('common/dashboard', 'user_token=' . $this->session->data['user_token'], true)
);
$data['breadcrumbs'][] = array(
'text' => $this->language->get('text_extension'),
'href' => $this->url->link('marketplace/extension', 'user_token=' . $this->session->data['user_token'] . '&type=captcha', true)
);
$data['breadcrumbs'][] = array(
'text' => $this->language->get('heading_title'),
'href' => $this->url->link('extension/captcha/basic', 'user_token=' . $this->session->data['user_token'], true)
);
$data['action'] = $this->url->link('extension/captcha/basic', 'user_token=' . $this->session->data['user_token'], true);
$data['cancel'] = $this->url->link('marketplace/extension', 'user_token=' . $this->session->data['user_token'] . '&type=captcha', true);
if (isset($this->request->post['captcha_basic_status'])) {
$data['captcha_basic_status'] = $this->request->post['captcha_basic_status'];
} else {
$data['captcha_basic_status'] = $this->config->get('captcha_basic_status');
}
$data['header'] = $this->load->controller('common/header');
$data['column_left'] = $this->load->controller('common/column_left');
$data['footer'] = $this->load->controller('common/footer');
$this->response->setOutput($this->load->view('extension/captcha/basic', $data));
}
protected function validate() {
if (!$this->user->hasPermission('modify', 'extension/captcha/basic')) {
$this->error['warning'] = $this->language->get('error_permission');
}
return !$this->error;
}
}
<?php
class ControllerExtensionCaptchaGoogle extends Controller {
private $error = array();
public function index() {
$this->load->language('extension/captcha/google');
$this->document->setTitle($this->language->get('heading_title'));
$this->load->model('setting/setting');
if (($this->request->server['REQUEST_METHOD'] == 'POST') && $this->validate()) {
$this->model_setting_setting->editSetting('captcha_google', $this->request->post);
$this->session->data['success'] = $this->language->get('text_success');
$this->response->redirect($this->url->link('marketplace/extension', 'user_token=' . $this->session->data['user_token'] . '&type=captcha', true));
}
if (isset($this->error['warning'])) {
$data['error_warning'] = $this->error['warning'];
} else {
$data['error_warning'] = '';
}
if (isset($this->error['key'])) {
$data['error_key'] = $this->error['key'];
} else {
$data['error_key'] = '';
}
if (isset($this->error['secret'])) {
$data['error_secret'] = $this->error['secret'];
} else {
$data['error_secret'] = '';
}
$data['breadcrumbs'] = array();
$data['breadcrumbs'][] = array(
'text' => $this->language->get('text_home'),
'href' => $this->url->link('common/dashboard', 'user_token=' . $this->session->data['user_token'], true)
);
$data['breadcrumbs'][] = array(
'text' => $this->language->get('text_extension'),
'href' => $this->url->link('marketplace/extension', 'user_token=' . $this->session->data['user_token'] . '&type=captcha', true)
);
$data['breadcrumbs'][] = array(
'text' => $this->language->get('heading_title'),
'href' => $this->url->link('extension/captcha/google', 'user_token=' . $this->session->data['user_token'], true)
);
$data['action'] = $this->url->link('extension/captcha/google', 'user_token=' . $this->session->data['user_token'], true);
$data['cancel'] = $this->url->link('marketplace/extension', 'user_token=' . $this->session->data['user_token'] . '&type=captcha', true);
if (isset($this->request->post['captcha_google_key'])) {
$data['captcha_google_key'] = $this->request->post['captcha_google_key'];
} else {
$data['captcha_google_key'] = $this->config->get('captcha_google_key');
}
if (isset($this->request->post['captcha_google_secret'])) {
$data['captcha_google_secret'] = $this->request->post['captcha_google_secret'];
} else {
$data['captcha_google_secret'] = $this->config->get('captcha_google_secret');
}
if (isset($this->request->post['captcha_google_status'])) {
$data['captcha_google_status'] = $this->request->post['captcha_google_status'];
} else {
$data['captcha_google_status'] = $this->config->get('captcha_google_status');
}
$data['header'] = $this->load->controller('common/header');
$data['column_left'] = $this->load->controller('common/column_left');
$data['footer'] = $this->load->controller('common/footer');
$this->response->setOutput($this->load->view('extension/captcha/google', $data));
}
protected function validate() {
if (!$this->user->hasPermission('modify', 'extension/captcha/google')) {
$this->error['warning'] = $this->language->get('error_permission');
}
if (!$this->request->post['captcha_google_key']) {
$this->error['key'] = $this->language->get('error_key');
}
if (!$this->request->post['captcha_google_secret']) {
$this->error['secret'] = $this->language->get('error_secret');
}
return !$this->error;
}
}
<?php
class ControllerExtensionCurrencyCbr extends Controller {
private $error = array();
public function index() {
$this->load->language('extension/currency/cbr');
$this->document->setTitle($this->language->get('heading_title'));
$this->load->model('setting/setting');
if (($this->request->server['REQUEST_METHOD'] == 'POST') && $this->validate()) {
$this->model_setting_setting->editSetting('currency_cbr', $this->request->post);
$this->session->data['success'] = $this->language->get('text_success');
$this->response->redirect($this->url->link('marketplace/extension', 'user_token=' . $this->session->data['user_token'] . '&type=currency'));
}
$data['heading_title'] = $this->language->get('heading_title');
$data['text_edit'] = $this->language->get('text_edit');
$data['text_enabled'] = $this->language->get('text_enabled');
$data['text_disabled'] = $this->language->get('text_disabled');
$data['entry_status'] = $this->language->get('entry_status');
$data['button_save'] = $this->language->get('button_save');
$data['button_cancel'] = $this->language->get('button_cancel');
if (isset($this->error['warning'])) {
$data['error_warning'] = $this->error['warning'];
} else {
$data['error_warning'] = '';
}
$data['breadcrumbs'] = [];
$data['breadcrumbs'][] = [
'text' => $this->language->get('text_home'),
'href' => $this->url->link('common/dashboard', 'user_token=' . $this->session->data['user_token'])
];
$data['breadcrumbs'][] = [
'text' => $this->language->get('text_extension'),
'href' => $this->url->link('marketplace/extension', 'user_token=' . $this->session->data['user_token'] . '&type=currency')
];
$data['breadcrumbs'][] = [
'text' => $this->language->get('heading_title'),
'href' => $this->url->link('extension/currency/cbr', 'user_token=' . $this->session->data['user_token'])
];
$data['action'] = $this->url->link('extension/currency/cbr', 'user_token=' . $this->session->data['user_token']);
$data['cancel'] = $this->url->link('marketplace/extension', 'user_token=' . $this->session->data['user_token'] . '&type=currency');
if (isset($this->request->post['currency_cbr_status'])) {
$data['currency_cbr_status'] = $this->request->post['currency_cbr_status'];
} else {
$data['currency_cbr_status'] = $this->config->get('currency_cbr_status');
}
$data['header'] = $this->load->controller('common/header');
$data['column_left'] = $this->load->controller('common/column_left');
$data['footer'] = $this->load->controller('common/footer');
$this->response->setOutput($this->load->view('extension/currency/cbr', $data));
}
protected function validate() {
if (!$this->user->hasPermission('modify', 'extension/currency/cbr')) {
$this->error['warning'] = $this->language->get('error_permission');
}
return !$this->error;
}
public function currency($default = '') {
if ($this->config->get('currency_cbr_status')) {
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, 'https://www.cbr.ru/scripts/XML_daily.asp');
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($curl, CURLOPT_HEADER, false);
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($curl, CURLOPT_CONNECTTIMEOUT, 30);
curl_setopt($curl, CURLOPT_TIMEOUT, 30);
$response = curl_exec($curl);
curl_close($curl);
if ($response) {
$dom = new \DOMDocument('1.0', 'UTF-8');
$dom->loadXml($response);
$currencies = array();
$currencies['RUB'] = 1.0000;
$root = $dom->documentElement;
$items = $root->getElementsByTagName('Valute');
foreach ($items as $item)
{
$code = $item->getElementsByTagName('CharCode')->item(0)->nodeValue;
$curs = str_replace(',', '.', $item->getElementsByTagName('Value')->item(0)->nodeValue);
$nominal = $item->getElementsByTagName('Nominal')->item(0)->nodeValue;
$currencies[$code] = floatval($curs/$nominal);
}
if ($currencies) {
$this->load->model('localisation/currency');
$results = $this->model_localisation_currency->getCurrencies();
foreach ($results as $result) {
if (isset($currencies[$result['code']])) {
$from = $currencies['RUB'];
$to = $currencies[$result['code']];
$this->model_localisation_currency->editValueByCode($result['code'], ($currencies[$default] * ($from / $to)));
}
}
}
$this->model_localisation_currency->editValueByCode($default, '1.00000');
$this->cache->delete('currency');
}
}
}
}
<?php
class ControllerExtensionCurrencyEcb extends Controller {
private $error = array();
public function index() {
$this->load->language('extension/currency/ecb');
$this->document->setTitle($this->language->get('heading_title'));
$this->load->model('setting/setting');
if (($this->request->server['REQUEST_METHOD'] == 'POST') && $this->validate()) {
$this->model_setting_setting->editSetting('currency_ecb', $this->request->post);
$this->session->data['success'] = $this->language->get('text_success');
$this->response->redirect($this->url->link('marketplace/extension', 'user_token=' . $this->session->data['user_token'] . '&type=currency'));
}
$data['heading_title'] = $this->language->get('heading_title');
$data['text_edit'] = $this->language->get('text_edit');
$data['text_enabled'] = $this->language->get('text_enabled');
$data['text_disabled'] = $this->language->get('text_disabled');
$data['entry_status'] = $this->language->get('entry_status');
$data['button_save'] = $this->language->get('button_save');
$data['button_cancel'] = $this->language->get('button_cancel');
if (isset($this->error['warning'])) {
$data['error_warning'] = $this->error['warning'];
} else {
$data['error_warning'] = '';
}
$data['breadcrumbs'] = [];
$data['breadcrumbs'][] = [
'text' => $this->language->get('text_home'),
'href' => $this->url->link('common/dashboard', 'user_token=' . $this->session->data['user_token'])
];
$data['breadcrumbs'][] = [
'text' => $this->language->get('text_extension'),
'href' => $this->url->link('marketplace/extension', 'user_token=' . $this->session->data['user_token'] . '&type=currency')
];
$data['breadcrumbs'][] = [
'text' => $this->language->get('heading_title'),
'href' => $this->url->link('extension/currency/ecb', 'user_token=' . $this->session->data['user_token'])
];
$data['action'] = $this->url->link('extension/currency/ecb', 'user_token=' . $this->session->data['user_token']);
$data['cancel'] = $this->url->link('marketplace/extension', 'user_token=' . $this->session->data['user_token'] . '&type=currency');
if (isset($this->request->post['currency_ecb_status'])) {
$data['currency_ecb_status'] = $this->request->post['currency_ecb_status'];
} else {
$data['currency_ecb_status'] = $this->config->get('currency_ecb_status');
}
$data['header'] = $this->load->controller('common/header');
$data['column_left'] = $this->load->controller('common/column_left');
$data['footer'] = $this->load->controller('common/footer');
$this->response->setOutput($this->load->view('extension/currency/ecb', $data));
}
protected function validate() {
if (!$this->user->hasPermission('modify', 'extension/currency/ecb')) {
$this->error['warning'] = $this->language->get('error_permission');
}
return !$this->error;
}
public function currency($default = '') {
if ($this->config->get('currency_ecb_status')) {
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, 'https://www.ecb.europa.eu/stats/eurofxref/eurofxref-daily.xml');
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($curl, CURLOPT_HEADER, false);
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($curl, CURLOPT_CONNECTTIMEOUT, 30);
curl_setopt($curl, CURLOPT_TIMEOUT, 30);
$response = curl_exec($curl);
curl_close($curl);
if ($response) {
$dom = new \DOMDocument('1.0', 'UTF-8');
$dom->loadXml($response);
$cube = $dom->getElementsByTagName('Cube')->item(0);
$currencies = [];
$currencies['EUR'] = 1.0000;
foreach ($cube->getElementsByTagName('Cube') as $currency) {
if ($currency->getAttribute('currency')) {
$currencies[$currency->getAttribute('currency')] = $currency->getAttribute('rate');
}
}
if ($currencies) {
$this->load->model('localisation/currency');
$results = $this->model_localisation_currency->getCurrencies();
foreach ($results as $result) {
if (isset($currencies[$result['code']])) {
$from = $currencies['EUR'];
$to = $currencies[$result['code']];
$this->model_localisation_currency->editValueByCode($result['code'], 1 / ($currencies[$default] * ($from / $to)));
}
}
}
$this->model_localisation_currency->editValueByCode($default, '1.00000');
$this->cache->delete('currency');
}
}
}
}
\ No newline at end of file
<?php
class ControllerExtensionCurrencyFixer extends Controller {
private $error = array();
public function index() {
$this->load->language('extension/currency/fixer');
$this->document->setTitle($this->language->get('heading_title'));
$this->load->model('setting/setting');
if (($this->request->server['REQUEST_METHOD'] == 'POST') && $this->validate()) {
$this->model_setting_setting->editSetting('currency_fixer', $this->request->post);
$this->session->data['success'] = $this->language->get('text_success');
$this->response->redirect($this->url->link('marketplace/extension', 'user_token=' . $this->session->data['user_token'] . '&type=currency'));
}
$data['heading_title'] = $this->language->get('heading_title');
$data['text_edit'] = $this->language->get('text_edit');
$data['text_enabled'] = $this->language->get('text_enabled');
$data['text_disabled'] = $this->language->get('text_disabled');
$data['text_support'] = $this->language->get('text_support');
$data['text_signup'] = $this->language->get('text_signup');
$data['entry_status'] = $this->language->get('entry_status');
$data['entry_api'] = $this->language->get('entry_api');
$data['button_save'] = $this->language->get('button_save');
$data['button_cancel'] = $this->language->get('button_cancel');
if (isset($this->error['warning'])) {
$data['error_warning'] = $this->error['warning'];
} else {
$data['error_warning'] = '';
}
if (isset($this->error['api'])) {
$data['error_api'] = $this->error['api'];
} else {
$data['error_api'] = '';
}
$data['breadcrumbs'] = array();
$data['breadcrumbs'][] = [
'text' => $this->language->get('text_home'),
'href' => $this->url->link('common/dashboard', 'user_token=' . $this->session->data['user_token'])
];
$data['breadcrumbs'][] = [
'text' => $this->language->get('text_extension'),
'href' => $this->url->link('marketplace/extension', 'user_token=' . $this->session->data['user_token'] . '&type=captcha')
];
$data['breadcrumbs'][] = [
'text' => $this->language->get('heading_title'),
'href' => $this->url->link('extension/currency/fixer', 'user_token=' . $this->session->data['user_token'])
];
$data['action'] = $this->url->link('extension/currency/fixer', 'user_token=' . $this->session->data['user_token']);
$data['cancel'] = $this->url->link('marketplace/extension', 'user_token=' . $this->session->data['user_token'] . '&type=currency');
if (isset($this->request->post['currency_fixer_api'])) {
$data['currency_fixer_api'] = $this->request->post['currency_fixer_api'];
} else {
$data['currency_fixer_api'] = $this->config->get('currency_fixer_api');
}
if (isset($this->request->post['currency_fixer_status'])) {
$data['currency_fixer_status'] = $this->request->post['currency_fixer_status'];
} else {
$data['currency_fixer_status'] = $this->config->get('currency_fixer_status');
}
$data['header'] = $this->load->controller('common/header');
$data['column_left'] = $this->load->controller('common/column_left');
$data['footer'] = $this->load->controller('common/footer');
$this->response->setOutput($this->load->view('extension/currency/fixer', $data));
}
protected function validate() {
if (!$this->user->hasPermission('modify', 'extension/currency/fixer')) {
$this->error['warning'] = $this->language->get('error_permission');
}
if (!$this->request->post['currency_fixer_api']) {
$this->error['api'] = $this->language->get('error_api');
}
return !$this->error;
}
public function currency($default = '') {
if ($this->config->get('currency_fixer_status')) {
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, 'http://data.fixer.io/api/latest?access_key=' . $this->config->get('currency_fixer_api'));
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($curl, CURLOPT_HEADER, false);
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($curl, CURLOPT_CONNECTTIMEOUT, 30);
curl_setopt($curl, CURLOPT_TIMEOUT, 30);
$response = curl_exec($curl);
curl_close($curl);
$response_info = json_decode($response, true);
if (is_array($response_info) && isset($response_info['rates'])) {
// Compile all the rates into an array
$currencies = [];
$currencies['EUR'] = 1.0000;
foreach ($response_info['rates'] as $key => $value) {
$currencies[$key] = $value;
}
$this->load->model('localisation/currency');
$results = $this->model_localisation_currency->getCurrencies();
foreach ($results as $result) {
if (isset($currencies[$result['code']])) {
$from = $currencies['EUR'];
$to = $currencies[$result['code']];
$this->model_localisation_currency->editValueByCode($result['code'], 1 / ($currencies[$default] * ($from / $to)));
}
}
$this->model_localisation_currency->editValueByCode($default, 1);
$this->cache->delete('currency');
}
}
}
}
\ No newline at end of file
<?php
class ControllerExtensionCurrencyNbu extends Controller {
private $error = array();
public function index() {
$this->load->language('extension/currency/nbu');
$this->document->setTitle($this->language->get('heading_title'));
$this->load->model('setting/setting');
if (($this->request->server['REQUEST_METHOD'] == 'POST') && $this->validate()) {
$this->model_setting_setting->editSetting('currency_nbu', $this->request->post);
$this->session->data['success'] = $this->language->get('text_success');
$this->response->redirect($this->url->link('marketplace/extension', 'user_token=' . $this->session->data['user_token'] . '&type=currency'));
}
$data['heading_title'] = $this->language->get('heading_title');
$data['text_edit'] = $this->language->get('text_edit');
$data['text_enabled'] = $this->language->get('text_enabled');
$data['text_disabled'] = $this->language->get('text_disabled');
$data['entry_status'] = $this->language->get('entry_status');
$data['button_save'] = $this->language->get('button_save');
$data['button_cancel'] = $this->language->get('button_cancel');
if (isset($this->error['warning'])) {
$data['error_warning'] = $this->error['warning'];
} else {
$data['error_warning'] = '';
}
$data['breadcrumbs'] = [];
$data['breadcrumbs'][] = [
'text' => $this->language->get('text_home'),
'href' => $this->url->link('common/dashboard', 'user_token=' . $this->session->data['user_token'])
];
$data['breadcrumbs'][] = [
'text' => $this->language->get('text_extension'),
'href' => $this->url->link('marketplace/extension', 'user_token=' . $this->session->data['user_token'] . '&type=currency')
];
$data['breadcrumbs'][] = [
'text' => $this->language->get('heading_title'),
'href' => $this->url->link('extension/currency/nbu', 'user_token=' . $this->session->data['user_token'])
];
$data['action'] = $this->url->link('extension/currency/nbu', 'user_token=' . $this->session->data['user_token']);
$data['cancel'] = $this->url->link('marketplace/extension', 'user_token=' . $this->session->data['user_token'] . '&type=currency');
if (isset($this->request->post['currency_nbu_status'])) {
$data['currency_nbu_status'] = $this->request->post['currency_nbu_status'];
} else {
$data['currency_nbu_status'] = $this->config->get('currency_nbu_status');
}
$data['header'] = $this->load->controller('common/header');
$data['column_left'] = $this->load->controller('common/column_left');
$data['footer'] = $this->load->controller('common/footer');
$this->response->setOutput($this->load->view('extension/currency/nbu', $data));
}
protected function validate() {
if (!$this->user->hasPermission('modify', 'extension/currency/nbu')) {
$this->error['warning'] = $this->language->get('error_permission');
}
return !$this->error;
}
public function currency($default = '') {
if ($this->config->get('currency_nbu_status')) {
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, 'https://bank.gov.ua/NBUStatService/v1/statdirectory/exchange');
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($curl, CURLOPT_HEADER, false);
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($curl, CURLOPT_CONNECTTIMEOUT, 30);
curl_setopt($curl, CURLOPT_TIMEOUT, 30);
$response = curl_exec($curl);
curl_close($curl);
if ($response) {
$dom = new \DOMDocument('1.0', 'UTF-8');
$dom->loadXml($response);
$currencies = array();
$currencies['UAH'] = 1.0000;
$root = $dom->documentElement;
$items = $root->getElementsByTagName('currency');
foreach ($items as $item)
{
$code = $item->getElementsByTagName('cc')->item(0)->nodeValue;
$curs = $item->getElementsByTagName('rate')->item(0)->nodeValue;
$currencies[$code] = floatval(str_replace(',', '.', $curs));
}
if ($currencies) {
$this->load->model('localisation/currency');
$results = $this->model_localisation_currency->getCurrencies();
foreach ($results as $result) {
if (isset($currencies[$result['code']])) {
$from = $currencies['UAH'];
$to = $currencies[$result['code']];
$this->model_localisation_currency->editValueByCode($result['code'], ($currencies[$default] * ($from / $to)));
}
}
}
$this->model_localisation_currency->editValueByCode($default, '1.00000');
$this->cache->delete('currency');
}
}
}
}
<?php
class ControllerExtensionDashboardActivity extends Controller {
private $error = array();
public function index() {
$this->load->language('extension/dashboard/activity');
$this->document->setTitle($this->language->get('heading_title'));
$this->load->model('setting/setting');
if (($this->request->server['REQUEST_METHOD'] == 'POST') && $this->validate()) {
$this->model_setting_setting->editSetting('dashboard_activity', $this->request->post);
$this->session->data['success'] = $this->language->get('text_success');
$this->response->redirect($this->url->link('marketplace/extension', 'user_token=' . $this->session->data['user_token'] . '&type=dashboard', true));
}
if (isset($this->error['warning'])) {
$data['error_warning'] = $this->error['warning'];
} else {
$data['error_warning'] = '';
}
$data['breadcrumbs'] = array();
$data['breadcrumbs'][] = array(
'text' => $this->language->get('text_home'),
'href' => $this->url->link('common/dashboard', 'user_token=' . $this->session->data['user_token'], true)
);
$data['breadcrumbs'][] = array(
'text' => $this->language->get('text_extension'),
'href' => $this->url->link('marketplace/extension', 'user_token=' . $this->session->data['user_token'] . '&type=dashboard', true)
);
$data['breadcrumbs'][] = array(
'text' => $this->language->get('heading_title'),
'href' => $this->url->link('extension/dashboard/activity', 'user_token=' . $this->session->data['user_token'], true)
);
$data['action'] = $this->url->link('extension/dashboard/activity', 'user_token=' . $this->session->data['user_token'], true);
$data['cancel'] = $this->url->link('marketplace/extension', 'user_token=' . $this->session->data['user_token'] . '&type=dashboard', true);
if (isset($this->request->post['dashboard_activity_width'])) {
$data['dashboard_activity_width'] = $this->request->post['dashboard_activity_width'];
} else {
$data['dashboard_activity_width'] = $this->config->get('dashboard_activity_width');
}
$data['columns'] = array();
for ($i = 3; $i <= 12; $i++) {
$data['columns'][] = $i;
}
if (isset($this->request->post['dashboard_activity_status'])) {
$data['dashboard_activity_status'] = $this->request->post['dashboard_activity_status'];
} else {
$data['dashboard_activity_status'] = $this->config->get('dashboard_activity_status');
}
if (isset($this->request->post['dashboard_activity_sort_order'])) {
$data['dashboard_activity_sort_order'] = $this->request->post['dashboard_activity_sort_order'];
} else {
$data['dashboard_activity_sort_order'] = $this->config->get('dashboard_activity_sort_order');
}
$data['header'] = $this->load->controller('common/header');
$data['column_left'] = $this->load->controller('common/column_left');
$data['footer'] = $this->load->controller('common/footer');
$this->response->setOutput($this->load->view('extension/dashboard/activity_form', $data));
}
protected function validate() {
if (!$this->user->hasPermission('modify', 'extension/dashboard/activity')) {
$this->error['warning'] = $this->language->get('error_permission');
}
return !$this->error;
}
public function dashboard() {
$this->load->language('extension/dashboard/activity');
$data['user_token'] = $this->session->data['user_token'];
$data['activities'] = array();
$this->load->model('extension/dashboard/activity');
$results = $this->model_extension_dashboard_activity->getActivities();
foreach ($results as $result) {
$comment = vsprintf($this->language->get('text_activity_' . $result['key']), json_decode($result['data'], true));
$find = array(
'customer_id=',
'order_id=',
'return_id='
);
$replace = array(
$this->url->link('customer/customer/edit', 'user_token=' . $this->session->data['user_token'] . '&customer_id=', true),
$this->url->link('sale/order/info', 'user_token=' . $this->session->data['user_token'] . '&order_id=', true),
$this->url->link('sale/return/edit', 'user_token=' . $this->session->data['user_token'] . '&return_id=', true)
);
$data['activities'][] = array(
'comment' => str_replace($find, $replace, $comment),
'date_added' => date($this->language->get('datetime_format'), strtotime($result['date_added']))
);
}
return $this->load->view('extension/dashboard/activity_info', $data);
}
}
\ No newline at end of file
<?php
class ControllerExtensionDashboardChart extends Controller {
private $error = array();
public function index() {
$this->load->language('extension/dashboard/chart');
$this->document->setTitle($this->language->get('heading_title'));
$this->load->model('setting/setting');
if (($this->request->server['REQUEST_METHOD'] == 'POST') && $this->validate()) {
$this->model_setting_setting->editSetting('dashboard_chart', $this->request->post);
$this->session->data['success'] = $this->language->get('text_success');
$this->response->redirect($this->url->link('marketplace/extension', 'user_token=' . $this->session->data['user_token'] . '&type=dashboard', true));
}
if (isset($this->error['warning'])) {
$data['error_warning'] = $this->error['warning'];
} else {
$data['error_warning'] = '';
}
$data['breadcrumbs'] = array();
$data['breadcrumbs'][] = array(
'text' => $this->language->get('text_home'),
'href' => $this->url->link('common/dashboard', 'user_token=' . $this->session->data['user_token'], true)
);
$data['breadcrumbs'][] = array(
'text' => $this->language->get('text_extension'),
'href' => $this->url->link('marketplace/extension', 'user_token=' . $this->session->data['user_token'] . '&type=dashboard', true)
);
$data['breadcrumbs'][] = array(
'text' => $this->language->get('heading_title'),
'href' => $this->url->link('extension/dashboard/chart', 'user_token=' . $this->session->data['user_token'], true)
);
$data['action'] = $this->url->link('extension/dashboard/chart', 'user_token=' . $this->session->data['user_token'], true);
$data['cancel'] = $this->url->link('marketplace/extension', 'user_token=' . $this->session->data['user_token'] . '&type=dashboard', true);
if (isset($this->request->post['dashboard_chart_width'])) {
$data['dashboard_chart_width'] = $this->request->post['dashboard_chart_width'];
} else {
$data['dashboard_chart_width'] = $this->config->get('dashboard_chart_width');
}
$data['columns'] = array();
for ($i = 3; $i <= 12; $i++) {
$data['columns'][] = $i;
}
if (isset($this->request->post['dashboard_chart_status'])) {
$data['dashboard_chart_status'] = $this->request->post['dashboard_chart_status'];
} else {
$data['dashboard_chart_status'] = $this->config->get('dashboard_chart_status');
}
if (isset($this->request->post['dashboard_chart_sort_order'])) {
$data['dashboard_chart_sort_order'] = $this->request->post['dashboard_chart_sort_order'];
} else {
$data['dashboard_chart_sort_order'] = $this->config->get('dashboard_chart_sort_order');
}
$data['header'] = $this->load->controller('common/header');
$data['column_left'] = $this->load->controller('common/column_left');
$data['footer'] = $this->load->controller('common/footer');
$this->response->setOutput($this->load->view('extension/dashboard/chart_form', $data));
}
protected function validate() {
if (!$this->user->hasPermission('modify', 'extension/dashboard/chart')) {
$this->error['warning'] = $this->language->get('error_permission');
}
return !$this->error;
}
public function dashboard() {
$this->load->language('extension/dashboard/chart');
$data['user_token'] = $this->session->data['user_token'];
return $this->load->view('extension/dashboard/chart_info', $data);
}
public function chart() {
$this->load->language('extension/dashboard/chart');
$json = array();
$this->load->model('extension/dashboard/chart');
$json['order'] = array();
$json['customer'] = array();
$json['xaxis'] = array();
$json['order']['label'] = $this->language->get('text_order');
$json['customer']['label'] = $this->language->get('text_customer');
$json['order']['data'] = array();
$json['customer']['data'] = array();
if (isset($this->request->get['range'])) {
$range = $this->request->get['range'];
} else {
$range = 'day';
}
switch ($range) {
default:
case 'day':
$results = $this->model_extension_dashboard_chart->getTotalOrdersByDay();
foreach ($results as $key => $value) {
$json['order']['data'][] = array($key, $value['total']);
}
$results = $this->model_extension_dashboard_chart->getTotalCustomersByDay();
foreach ($results as $key => $value) {
$json['customer']['data'][] = array($key, $value['total']);
}
for ($i = 0; $i < 24; $i++) {
$json['xaxis'][] = array($i, $i);
}
break;
case 'week':
$results = $this->model_extension_dashboard_chart->getTotalOrdersByWeek();
foreach ($results as $key => $value) {
$json['order']['data'][] = array($key, $value['total']);
}
$results = $this->model_extension_dashboard_chart->getTotalCustomersByWeek();
foreach ($results as $key => $value) {
$json['customer']['data'][] = array($key, $value['total']);
}
$date_start = strtotime('-' . date('w') . ' days');
for ($i = 0; $i < 7; $i++) {
$date = date('Y-m-d', $date_start + ($i * 86400));
$json['xaxis'][] = array(date('w', strtotime($date)), date('D', strtotime($date)));
}
break;
case 'month':
$results = $this->model_extension_dashboard_chart->getTotalOrdersByMonth();
foreach ($results as $key => $value) {
$json['order']['data'][] = array($key, $value['total']);
}
$results = $this->model_extension_dashboard_chart->getTotalCustomersByMonth();
foreach ($results as $key => $value) {
$json['customer']['data'][] = array($key, $value['total']);
}
for ($i = 1; $i <= date('t'); $i++) {
$date = date('Y') . '-' . date('m') . '-' . $i;
$json['xaxis'][] = array(date('j', strtotime($date)), date('d', strtotime($date)));
}
break;
case 'year':
$results = $this->model_extension_dashboard_chart->getTotalOrdersByYear();
foreach ($results as $key => $value) {
$json['order']['data'][] = array($key, $value['total']);
}
$results = $this->model_extension_dashboard_chart->getTotalCustomersByYear();
foreach ($results as $key => $value) {
$json['customer']['data'][] = array($key, $value['total']);
}
for ($i = 1; $i <= 12; $i++) {
$json['xaxis'][] = array($i, date('M', mktime(0, 0, 0, $i)));
}
break;
}
$this->response->addHeader('Content-Type: application/json');
$this->response->setOutput(json_encode($json));
}
}
\ No newline at end of file
<?php
class ControllerExtensionDashboardCustomer extends Controller {
private $error = array();
public function index() {
$this->load->language('extension/dashboard/customer');
$this->document->setTitle($this->language->get('heading_title'));
$this->load->model('setting/setting');
if (($this->request->server['REQUEST_METHOD'] == 'POST') && $this->validate()) {
$this->model_setting_setting->editSetting('dashboard_customer', $this->request->post);
$this->session->data['success'] = $this->language->get('text_success');
$this->response->redirect($this->url->link('marketplace/extension', 'user_token=' . $this->session->data['user_token'] . '&type=dashboard', true));
}
if (isset($this->error['warning'])) {
$data['error_warning'] = $this->error['warning'];
} else {
$data['error_warning'] = '';
}
$data['breadcrumbs'] = array();
$data['breadcrumbs'][] = array(
'text' => $this->language->get('text_home'),
'href' => $this->url->link('common/dashboard', 'user_token=' . $this->session->data['user_token'], true)
);
$data['breadcrumbs'][] = array(
'text' => $this->language->get('text_extension'),
'href' => $this->url->link('marketplace/extension', 'user_token=' . $this->session->data['user_token'] . '&type=dashboard', true)
);
$data['breadcrumbs'][] = array(
'text' => $this->language->get('heading_title'),
'href' => $this->url->link('extension/dashboard/customer', 'user_token=' . $this->session->data['user_token'], true)
);
$data['action'] = $this->url->link('extension/dashboard/customer', 'user_token=' . $this->session->data['user_token'], true);
$data['cancel'] = $this->url->link('marketplace/extension', 'user_token=' . $this->session->data['user_token'] . '&type=dashboard', true);
if (isset($this->request->post['dashboard_customer_width'])) {
$data['dashboard_customer_width'] = $this->request->post['dashboard_customer_width'];
} else {
$data['dashboard_customer_width'] = $this->config->get('dashboard_customer_width');
}
$data['columns'] = array();
for ($i = 3; $i <= 12; $i++) {
$data['columns'][] = $i;
}
if (isset($this->request->post['dashboard_customer_status'])) {
$data['dashboard_customer_status'] = $this->request->post['dashboard_customer_status'];
} else {
$data['dashboard_customer_status'] = $this->config->get('dashboard_customer_status');
}
if (isset($this->request->post['dashboard_customer_sort_order'])) {
$data['dashboard_customer_sort_order'] = $this->request->post['dashboard_customer_sort_order'];
} else {
$data['dashboard_customer_sort_order'] = $this->config->get('dashboard_customer_sort_order');
}
$data['header'] = $this->load->controller('common/header');
$data['column_left'] = $this->load->controller('common/column_left');
$data['footer'] = $this->load->controller('common/footer');
$this->response->setOutput($this->load->view('extension/dashboard/customer_form', $data));
}
protected function validate() {
if (!$this->user->hasPermission('modify', 'extension/dashboard/customer')) {
$this->error['warning'] = $this->language->get('error_permission');
}
return !$this->error;
}
public function dashboard() {
$this->load->language('extension/dashboard/customer');
$data['user_token'] = $this->session->data['user_token'];
// Total Orders
$this->load->model('customer/customer');
$today = $this->model_customer_customer->getTotalCustomers(array('filter_date_added' => date('Y-m-d', strtotime('-1 day'))));
$yesterday = $this->model_customer_customer->getTotalCustomers(array('filter_date_added' => date('Y-m-d', strtotime('-2 day'))));
$difference = $today - $yesterday;
if ($difference && $today) {
$data['percentage'] = round(($difference / $today) * 100);
} else {
$data['percentage'] = 0;
}
$customer_total = $this->model_customer_customer->getTotalCustomers();
if ($customer_total > 1000000000000) {
$data['total'] = round($customer_total / 1000000000000, 1) . 'T';
} elseif ($customer_total > 1000000000) {
$data['total'] = round($customer_total / 1000000000, 1) . 'B';
} elseif ($customer_total > 1000000) {
$data['total'] = round($customer_total / 1000000, 1) . 'M';
} elseif ($customer_total > 1000) {
$data['total'] = round($customer_total / 1000, 1) . 'K';
} else {
$data['total'] = $customer_total;
}
$data['customer'] = $this->url->link('customer/customer', 'user_token=' . $this->session->data['user_token'], true);
return $this->load->view('extension/dashboard/customer_info', $data);
}
}
This diff is collapsed. Click to expand it.
<?php
class ControllerExtensionDashboardMap extends Controller {
private $error = array();
public function index() {
$this->load->language('extension/dashboard/map');
$this->document->setTitle($this->language->get('heading_title'));
$this->load->model('setting/setting');
if (($this->request->server['REQUEST_METHOD'] == 'POST') && $this->validate()) {
$this->model_setting_setting->editSetting('dashboard_map', $this->request->post);
$this->session->data['success'] = $this->language->get('text_success');
$this->response->redirect($this->url->link('marketplace/extension', 'user_token=' . $this->session->data['user_token'] . '&type=dashboard', true));
}
if (isset($this->error['warning'])) {
$data['error_warning'] = $this->error['warning'];
} else {
$data['error_warning'] = '';
}
$data['breadcrumbs'] = array();
$data['breadcrumbs'][] = array(
'text' => $this->language->get('text_home'),
'href' => $this->url->link('common/dashboard', 'user_token=' . $this->session->data['user_token'], true)
);
$data['breadcrumbs'][] = array(
'text' => $this->language->get('text_extension'),
'href' => $this->url->link('marketplace/extension', 'user_token=' . $this->session->data['user_token'] . '&type=dashboard', true)
);
$data['breadcrumbs'][] = array(
'text' => $this->language->get('heading_title'),
'href' => $this->url->link('extension/dashboard/map', 'user_token=' . $this->session->data['user_token'], true)
);
$data['action'] = $this->url->link('extension/dashboard/map', 'user_token=' . $this->session->data['user_token'], true);
$data['cancel'] = $this->url->link('marketplace/extension', 'user_token=' . $this->session->data['user_token'] . '&type=dashboard', true);
if (isset($this->request->post['dashboard_map_width'])) {
$data['dashboard_map_width'] = $this->request->post['dashboard_map_width'];
} else {
$data['dashboard_map_width'] = $this->config->get('dashboard_map_width');
}
$data['columns'] = array();
for ($i = 3; $i <= 12; $i++) {
$data['columns'][] = $i;
}
if (isset($this->request->post['dashboard_map_status'])) {
$data['dashboard_map_status'] = $this->request->post['dashboard_map_status'];
} else {
$data['dashboard_map_status'] = $this->config->get('dashboard_map_status');
}
if (isset($this->request->post['dashboard_map_sort_order'])) {
$data['dashboard_map_sort_order'] = $this->request->post['dashboard_map_sort_order'];
} else {
$data['dashboard_map_sort_order'] = $this->config->get('dashboard_map_sort_order');
}
$data['header'] = $this->load->controller('common/header');
$data['column_left'] = $this->load->controller('common/column_left');
$data['footer'] = $this->load->controller('common/footer');
$this->response->setOutput($this->load->view('extension/dashboard/map_form', $data));
}
protected function validate() {
if (!$this->user->hasPermission('modify', 'extension/dashboard/map')) {
$this->error['warning'] = $this->language->get('error_permission');
}
return !$this->error;
}
public function dashboard() {
$this->load->language('extension/dashboard/map');
$data['user_token'] = $this->session->data['user_token'];
return $this->load->view('extension/dashboard/map_info', $data);
}
public function map() {
$json = array();
$this->load->model('extension/dashboard/map');
$results = $this->model_extension_dashboard_map->getTotalOrdersByCountry();
foreach ($results as $result) {
$json[strtolower($result['iso_code_2'])] = array(
'total' => $result['total'],
'amount' => $this->currency->format($result['amount'], $this->config->get('config_currency'))
);
}
$this->response->addHeader('Content-Type: application/json');
$this->response->setOutput(json_encode($json));
}
}
<?php
class ControllerExtensionDashboardOnline extends Controller {
private $error = array();
public function index() {
$this->load->language('extension/dashboard/online');
$this->document->setTitle($this->language->get('heading_title'));
$this->load->model('setting/setting');
if (($this->request->server['REQUEST_METHOD'] == 'POST') && $this->validate()) {
$this->model_setting_setting->editSetting('dashboard_online', $this->request->post);
$this->session->data['success'] = $this->language->get('text_success');
$this->response->redirect($this->url->link('marketplace/extension', 'user_token=' . $this->session->data['user_token'] . '&type=dashboard', true));
}
if (isset($this->error['warning'])) {
$data['error_warning'] = $this->error['warning'];
} else {
$data['error_warning'] = '';
}
$data['breadcrumbs'] = array();
$data['breadcrumbs'][] = array(
'text' => $this->language->get('text_home'),
'href' => $this->url->link('common/dashboard', 'user_token=' . $this->session->data['user_token'], true)
);
$data['breadcrumbs'][] = array(
'text' => $this->language->get('text_extension'),
'href' => $this->url->link('marketplace/extension', 'user_token=' . $this->session->data['user_token'] . '&type=dashboard', true)
);
$data['breadcrumbs'][] = array(
'text' => $this->language->get('heading_title'),
'href' => $this->url->link('extension/dashboard/online', 'user_token=' . $this->session->data['user_token'], true)
);
$data['action'] = $this->url->link('extension/dashboard/online', 'user_token=' . $this->session->data['user_token'], true);
$data['cancel'] = $this->url->link('marketplace/extension', 'user_token=' . $this->session->data['user_token'] . '&type=dashboard', true);
if (isset($this->request->post['dashboard_online_width'])) {
$data['dashboard_online_width'] = $this->request->post['dashboard_online_width'];
} else {
$data['dashboard_online_width'] = $this->config->get('dashboard_online_width');
}
$data['columns'] = array();
for ($i = 3; $i <= 12; $i++) {
$data['columns'][] = $i;
}
if (isset($this->request->post['dashboard_online_status'])) {
$data['dashboard_online_status'] = $this->request->post['dashboard_online_status'];
} else {
$data['dashboard_online_status'] = $this->config->get('dashboard_online_status');
}
if (isset($this->request->post['dashboard_online_sort_order'])) {
$data['dashboard_online_sort_order'] = $this->request->post['dashboard_online_sort_order'];
} else {
$data['dashboard_online_sort_order'] = $this->config->get('dashboard_online_sort_order');
}
$data['header'] = $this->load->controller('common/header');
$data['column_left'] = $this->load->controller('common/column_left');
$data['footer'] = $this->load->controller('common/footer');
$this->response->setOutput($this->load->view('extension/dashboard/online_form', $data));
}
protected function validate() {
if (!$this->user->hasPermission('modify', 'extension/dashboard/online')) {
$this->error['warning'] = $this->language->get('error_permission');
}
return !$this->error;
}
public function dashboard() {
$this->load->language('extension/dashboard/online');
$data['user_token'] = $this->session->data['user_token'];
// Total Orders
$this->load->model('extension/dashboard/online');
// Customers Online
$online_total = $this->model_extension_dashboard_online->getTotalOnline();
if ($online_total > 1000000000000) {
$data['total'] = round($online_total / 1000000000000, 1) . 'T';
} elseif ($online_total > 1000000000) {
$data['total'] = round($online_total / 1000000000, 1) . 'B';
} elseif ($online_total > 1000000) {
$data['total'] = round($online_total / 1000000, 1) . 'M';
} elseif ($online_total > 1000) {
$data['total'] = round($online_total / 1000, 1) . 'K';
} else {
$data['total'] = $online_total;
}
$data['online'] = $this->url->link('report/online', 'user_token=' . $this->session->data['user_token'], true);
return $this->load->view('extension/dashboard/online_info', $data);
}
}
<?php
class ControllerExtensionDashboardOrder extends Controller {
private $error = array();
public function index() {
$this->load->language('extension/dashboard/order');
$this->document->setTitle($this->language->get('heading_title'));
$this->load->model('setting/setting');
if (($this->request->server['REQUEST_METHOD'] == 'POST') && $this->validate()) {
$this->model_setting_setting->editSetting('dashboard_order', $this->request->post);
$this->session->data['success'] = $this->language->get('text_success');
$this->response->redirect($this->url->link('marketplace/extension', 'user_token=' . $this->session->data['user_token'] . '&type=dashboard', true));
}
if (isset($this->error['warning'])) {
$data['error_warning'] = $this->error['warning'];
} else {
$data['error_warning'] = '';
}
$data['breadcrumbs'] = array();
$data['breadcrumbs'][] = array(
'text' => $this->language->get('text_home'),
'href' => $this->url->link('common/dashboard', 'user_token=' . $this->session->data['user_token'], true)
);
$data['breadcrumbs'][] = array(
'text' => $this->language->get('text_extension'),
'href' => $this->url->link('marketplace/extension', 'user_token=' . $this->session->data['user_token'] . '&type=dashboard', true)
);
$data['breadcrumbs'][] = array(
'text' => $this->language->get('heading_title'),
'href' => $this->url->link('extension/dashboard/order', 'user_token=' . $this->session->data['user_token'], true)
);
$data['action'] = $this->url->link('extension/dashboard/order', 'user_token=' . $this->session->data['user_token'], true);
$data['cancel'] = $this->url->link('marketplace/extension', 'user_token=' . $this->session->data['user_token'] . '&type=dashboard', true);
if (isset($this->request->post['dashboard_order_width'])) {
$data['dashboard_order_width'] = $this->request->post['dashboard_order_width'];
} else {
$data['dashboard_order_width'] = $this->config->get('dashboard_order_width');
}
$data['columns'] = array();
for ($i = 3; $i <= 12; $i++) {
$data['columns'][] = $i;
}
if (isset($this->request->post['dashboard_order_status'])) {
$data['dashboard_order_status'] = $this->request->post['dashboard_order_status'];
} else {
$data['dashboard_order_status'] = $this->config->get('dashboard_order_status');
}
if (isset($this->request->post['dashboard_order_sort_order'])) {
$data['dashboard_order_sort_order'] = $this->request->post['dashboard_order_sort_order'];
} else {
$data['dashboard_order_sort_order'] = $this->config->get('dashboard_order_sort_order');
}
$data['header'] = $this->load->controller('common/header');
$data['column_left'] = $this->load->controller('common/column_left');
$data['footer'] = $this->load->controller('common/footer');
$this->response->setOutput($this->load->view('extension/dashboard/order_form', $data));
}
protected function validate() {
if (!$this->user->hasPermission('modify', 'extension/dashboard/order')) {
$this->error['warning'] = $this->language->get('error_permission');
}
return !$this->error;
}
public function dashboard() {
$this->load->language('extension/dashboard/order');
$data['user_token'] = $this->session->data['user_token'];
// Total Orders
$this->load->model('sale/order');
$today = $this->model_sale_order->getTotalOrders(array('filter_date_added' => date('Y-m-d', strtotime('-1 day'))));
$yesterday = $this->model_sale_order->getTotalOrders(array('filter_date_added' => date('Y-m-d', strtotime('-2 day'))));
$difference = $today - $yesterday;
if ($difference && $today) {
$data['percentage'] = round(($difference / $today) * 100);
} else {
$data['percentage'] = 0;
}
$order_total = $this->model_sale_order->getTotalOrders();
if ($order_total > 1000000000000) {
$data['total'] = round($order_total / 1000000000000, 1) . 'T';
} elseif ($order_total > 1000000000) {
$data['total'] = round($order_total / 1000000000, 1) . 'B';
} elseif ($order_total > 1000000) {
$data['total'] = round($order_total / 1000000, 1) . 'M';
} elseif ($order_total > 1000) {
$data['total'] = round($order_total / 1000, 1) . 'K';
} else {
$data['total'] = $order_total;
}
$data['order'] = $this->url->link('sale/order', 'user_token=' . $this->session->data['user_token'], true);
return $this->load->view('extension/dashboard/order_info', $data);
}
}
<?php
class ControllerExtensionDashboardRecent extends Controller {
private $error = array();
public function index() {
$this->load->language('extension/dashboard/recent');
$this->document->setTitle($this->language->get('heading_title'));
$this->load->model('setting/setting');
if (($this->request->server['REQUEST_METHOD'] == 'POST') && $this->validate()) {
$this->model_setting_setting->editSetting('dashboard_recent', $this->request->post);
$this->session->data['success'] = $this->language->get('text_success');
$this->response->redirect($this->url->link('marketplace/extension', 'user_token=' . $this->session->data['user_token'] . '&type=dashboard', true));
}
if (isset($this->error['warning'])) {
$data['error_warning'] = $this->error['warning'];
} else {
$data['error_warning'] = '';
}
$data['breadcrumbs'] = array();
$data['breadcrumbs'][] = array(
'text' => $this->language->get('text_home'),
'href' => $this->url->link('common/dashboard', 'user_token=' . $this->session->data['user_token'], true)
);
$data['breadcrumbs'][] = array(
'text' => $this->language->get('text_extension'),
'href' => $this->url->link('marketplace/extension', 'user_token=' . $this->session->data['user_token'] . '&type=dashboard', true)
);
$data['breadcrumbs'][] = array(
'text' => $this->language->get('heading_title'),
'href' => $this->url->link('extension/dashboard/recent', 'user_token=' . $this->session->data['user_token'], true)
);
$data['action'] = $this->url->link('extension/dashboard/recent', 'user_token=' . $this->session->data['user_token'], true);
$data['cancel'] = $this->url->link('marketplace/extension', 'user_token=' . $this->session->data['user_token'] . '&type=dashboard', true);
if (isset($this->request->post['dashboard_recent_width'])) {
$data['dashboard_recent_width'] = $this->request->post['dashboard_recent_width'];
} else {
$data['dashboard_recent_width'] = $this->config->get('dashboard_recent_width');
}
$data['columns'] = array();
for ($i = 3; $i <= 12; $i++) {
$data['columns'][] = $i;
}
if (isset($this->request->post['dashboard_recent_status'])) {
$data['dashboard_recent_status'] = $this->request->post['dashboard_recent_status'];
} else {
$data['dashboard_recent_status'] = $this->config->get('dashboard_recent_status');
}
if (isset($this->request->post['dashboard_recent_sort_order'])) {
$data['dashboard_recent_sort_order'] = $this->request->post['dashboard_recent_sort_order'];
} else {
$data['dashboard_recent_sort_order'] = $this->config->get('dashboard_recent_sort_order');
}
$data['header'] = $this->load->controller('common/header');
$data['column_left'] = $this->load->controller('common/column_left');
$data['footer'] = $this->load->controller('common/footer');
$this->response->setOutput($this->load->view('extension/dashboard/recent_form', $data));
}
protected function validate() {
if (!$this->user->hasPermission('modify', 'extension/dashboard/recent')) {
$this->error['warning'] = $this->language->get('error_permission');
}
return !$this->error;
}
public function dashboard() {
$this->load->language('extension/dashboard/recent');
$data['user_token'] = $this->session->data['user_token'];
// Last 5 Orders
$data['orders'] = array();
$filter_data = array(
'sort' => 'o.date_added',
'order' => 'DESC',
'start' => 0,
'limit' => 5
);
$this->load->model('sale/order');
$results = $this->model_sale_order->getOrders($filter_data);
foreach ($results as $result) {
$data['orders'][] = array(
'order_id' => $result['order_id'],
'customer' => $result['customer'],
'status' => $result['order_status'],
'date_added' => date($this->language->get('date_format_short'), strtotime($result['date_added'])),
'total' => $this->currency->format($result['total'], $result['currency_code'], $result['currency_value']),
'view' => $this->url->link('sale/order/info', 'user_token=' . $this->session->data['user_token'] . '&order_id=' . $result['order_id'], true),
);
}
return $this->load->view('extension/dashboard/recent_info', $data);
}
}
<?php
class ControllerExtensionDashboardSale extends Controller {
private $error = array();
public function index() {
$this->load->language('extension/dashboard/sale');
$this->document->setTitle($this->language->get('heading_title'));
$this->load->model('setting/setting');
if (($this->request->server['REQUEST_METHOD'] == 'POST') && $this->validate()) {
$this->model_setting_setting->editSetting('dashboard_sale', $this->request->post);
$this->session->data['success'] = $this->language->get('text_success');
$this->response->redirect($this->url->link('marketplace/extension', 'user_token=' . $this->session->data['user_token'] . '&type=dashboard', true));
}
if (isset($this->error['warning'])) {
$data['error_warning'] = $this->error['warning'];
} else {
$data['error_warning'] = '';
}
$data['breadcrumbs'] = array();
$data['breadcrumbs'][] = array(
'text' => $this->language->get('text_home'),
'href' => $this->url->link('common/dashboard', 'user_token=' . $this->session->data['user_token'], true)
);
$data['breadcrumbs'][] = array(
'text' => $this->language->get('text_extension'),
'href' => $this->url->link('marketplace/extension', 'user_token=' . $this->session->data['user_token'] . '&type=dashboard', true)
);
$data['breadcrumbs'][] = array(
'text' => $this->language->get('heading_title'),
'href' => $this->url->link('extension/dashboard/sale', 'user_token=' . $this->session->data['user_token'], true)
);
$data['action'] = $this->url->link('extension/dashboard/sale', 'user_token=' . $this->session->data['user_token'], true);
$data['cancel'] = $this->url->link('marketplace/extension', 'user_token=' . $this->session->data['user_token'] . '&type=dashboard', true);
if (isset($this->request->post['dashboard_sale_width'])) {
$data['dashboard_sale_width'] = $this->request->post['dashboard_sale_width'];
} else {
$data['dashboard_sale_width'] = $this->config->get('dashboard_sale_width');
}
$data['columns'] = array();
for ($i = 3; $i <= 12; $i++) {
$data['columns'][] = $i;
}
if (isset($this->request->post['dashboard_sale_status'])) {
$data['dashboard_sale_status'] = $this->request->post['dashboard_sale_status'];
} else {
$data['dashboard_sale_status'] = $this->config->get('dashboard_sale_status');
}
if (isset($this->request->post['dashboard_sale_sort_order'])) {
$data['dashboard_sale_sort_order'] = $this->request->post['dashboard_sale_sort_order'];
} else {
$data['dashboard_sale_sort_order'] = $this->config->get('dashboard_sale_sort_order');
}
$data['header'] = $this->load->controller('common/header');
$data['column_left'] = $this->load->controller('common/column_left');
$data['footer'] = $this->load->controller('common/footer');
$this->response->setOutput($this->load->view('extension/dashboard/sale_form', $data));
}
protected function validate() {
if (!$this->user->hasPermission('modify', 'extension/dashboard/sale')) {
$this->error['warning'] = $this->language->get('error_permission');
}
return !$this->error;
}
public function dashboard() {
$this->load->language('extension/dashboard/sale');
$data['user_token'] = $this->session->data['user_token'];
$this->load->model('extension/dashboard/sale');
$today = $this->model_extension_dashboard_sale->getTotalSales(array('filter_date_added' => date('Y-m-d', strtotime('-1 day'))));
$yesterday = $this->model_extension_dashboard_sale->getTotalSales(array('filter_date_added' => date('Y-m-d', strtotime('-2 day'))));
$difference = $today - $yesterday;
if ($difference && (int)$today) {
$data['percentage'] = round(($difference / $today) * 100);
} else {
$data['percentage'] = 0;
}
$sale_total = $this->model_extension_dashboard_sale->getTotalSales();
if ($sale_total > 1000000000000) {
$data['total'] = round($sale_total / 1000000000000, 1) . 'T';
} elseif ($sale_total > 1000000000) {
$data['total'] = round($sale_total / 1000000000, 1) . 'B';
} elseif ($sale_total > 1000000) {
$data['total'] = round($sale_total / 1000000, 1) . 'M';
} elseif ($sale_total > 1000) {
$data['total'] = round($sale_total / 1000, 1) . 'K';
} else {
$data['total'] = round($sale_total);
}
$data['sale'] = $this->url->link('sale/order', 'user_token=' . $this->session->data['user_token'], true);
return $this->load->view('extension/dashboard/sale_info', $data);
}
}
<?php
class ControllerExtensionExtensionAdvertise extends Controller {
private $error = array();
public function index() {
$this->load->language('extension/extension/advertise');
$this->load->model('setting/extension');
$this->getList();
}
public function install() {
$this->load->language('extension/extension/advertise');
$this->load->model('setting/extension');
if ($this->validate()) {
$this->model_setting_extension->install('advertise', $this->request->get['extension']);
$this->load->model('user/user_group');
$this->model_user_user_group->addPermission($this->user->getGroupId(), 'access', 'extension/advertise/' . $this->request->get['extension']);
$this->model_user_user_group->addPermission($this->user->getGroupId(), 'modify', 'extension/advertise/' . $this->request->get['extension']);
// Compatibility
$this->model_user_user_group->addPermission($this->user->getGroupId(), 'access', 'advertise/' . $this->request->get['extension']);
$this->model_user_user_group->addPermission($this->user->getGroupId(), 'modify', 'advertise/' . $this->request->get['extension']);
// Call install method if it exsits
$this->load->controller('extension/advertise/' . $this->request->get['extension'] . '/install');
$this->session->data['success'] = $this->language->get('text_success');
}
$this->getList();
}
public function uninstall() {
$this->load->language('extension/extension/advertise');
$this->load->model('setting/extension');
if ($this->validate()) {
$this->model_setting_extension->uninstall('advertise', $this->request->get['extension']);
// Call uninstall method if it exsits
$this->load->controller('extension/advertise/' . $this->request->get['extension'] . '/uninstall');
$this->session->data['success'] = $this->language->get('text_success');
}
$this->getList();
}
protected function getList() {
if (isset($this->error['warning'])) {
$data['error_warning'] = $this->error['warning'];
} else {
$data['error_warning'] = '';
}
if (isset($this->session->data['success'])) {
$data['success'] = $this->session->data['success'];
unset($this->session->data['success']);
} else {
$data['success'] = '';
}
$extensions = $this->model_setting_extension->getInstalled('advertise');
foreach ($extensions as $key => $value) {
if (!is_file(DIR_APPLICATION . 'controller/extension/advertise/' . $value . '.php') && !is_file(DIR_APPLICATION . 'controller/advertise/' . $value . '.php')) {
$this->model_setting_extension->uninstall('advertise', $value);
unset($extensions[$key]);
}
}
$this->load->model('setting/store');
$this->load->model('setting/setting');
$stores = $this->model_setting_store->getStores();
$data['extensions'] = array();
// Compatibility code for old extension folders
$files = glob(DIR_APPLICATION . 'controller/extension/advertise/*.php');
if ($files) {
foreach ($files as $file) {
$extension = basename($file, '.php');
// Compatibility code for old extension folders
$this->load->language('extension/advertise/' . $extension, 'extension');
$store_data = array();
$store_data[] = array(
'name' => $this->config->get('config_name'),
'edit' => $this->url->link('extension/advertise/' . $extension, 'user_token=' . $this->session->data['user_token'] . '&store_id=0', true),
'status' => $this->config->get('advertise_' . $extension . '_status') ? $this->language->get('text_enabled') : $this->language->get('text_disabled')
);
foreach ($stores as $store) {
$store_data[] = array(
'name' => $store['name'],
'edit' => $this->url->link('extension/advertise/' . $extension, 'user_token=' . $this->session->data['user_token'] . '&store_id=' . $store['store_id'], true),
'status' => $this->model_setting_setting->getSettingValue('advertise_' . $extension . '_status', $store['store_id']) ? $this->language->get('text_enabled') : $this->language->get('text_disabled')
);
}
$data['extensions'][] = array(
'name' => $this->language->get('extension')->get('heading_title'),
'install' => $this->url->link('extension/extension/advertise/install', 'user_token=' . $this->session->data['user_token'] . '&extension=' . $extension, true),
'uninstall' => $this->url->link('extension/extension/advertise/uninstall', 'user_token=' . $this->session->data['user_token'] . '&extension=' . $extension, true),
'installed' => in_array($extension, $extensions),
'store' => $store_data
);
}
}
$this->response->setOutput($this->load->view('extension/extension/advertise', $data));
}
protected function validate() {
if (!$this->user->hasPermission('modify', 'extension/extension/advertise')) {
$this->error['warning'] = $this->language->get('error_permission');
}
return !$this->error;
}
}
<?php
class ControllerExtensionExtensionAnalytics extends Controller {
private $error = array();
public function index() {
$this->load->language('extension/extension/analytics');
$this->load->model('setting/extension');
$this->getList();
}
public function install() {
$this->load->language('extension/extension/analytics');
$this->load->model('setting/extension');
if ($this->validate()) {
$this->model_setting_extension->install('analytics', $this->request->get['extension']);
$this->load->model('user/user_group');
$this->model_user_user_group->addPermission($this->user->getGroupId(), 'access', 'extension/analytics/' . $this->request->get['extension']);
$this->model_user_user_group->addPermission($this->user->getGroupId(), 'modify', 'extension/analytics/' . $this->request->get['extension']);
// Compatibility
$this->model_user_user_group->addPermission($this->user->getGroupId(), 'access', 'analytics/' . $this->request->get['extension']);
$this->model_user_user_group->addPermission($this->user->getGroupId(), 'modify', 'analytics/' . $this->request->get['extension']);
// Call install method if it exsits
$this->load->controller('extension/analytics/' . $this->request->get['extension'] . '/install');
$this->session->data['success'] = $this->language->get('text_success');
}
$this->getList();
}
public function uninstall() {
$this->load->language('extension/extension/analytics');
$this->load->model('setting/extension');
if ($this->validate()) {
$this->model_setting_extension->uninstall('analytics', $this->request->get['extension']);
// Call uninstall method if it exsits
$this->load->controller('extension/analytics/' . $this->request->get['extension'] . '/uninstall');
$this->session->data['success'] = $this->language->get('text_success');
}
$this->getList();
}
protected function getList() {
if (isset($this->error['warning'])) {
$data['error_warning'] = $this->error['warning'];
} else {
$data['error_warning'] = '';
}
if (isset($this->session->data['success'])) {
$data['success'] = $this->session->data['success'];
unset($this->session->data['success']);
} else {
$data['success'] = '';
}
$extensions = $this->model_setting_extension->getInstalled('analytics');
foreach ($extensions as $key => $value) {
if (!is_file(DIR_APPLICATION . 'controller/extension/analytics/' . $value . '.php') && !is_file(DIR_APPLICATION . 'controller/analytics/' . $value . '.php')) {
$this->model_setting_extension->uninstall('analytics', $value);
unset($extensions[$key]);
}
}
$this->load->model('setting/store');
$this->load->model('setting/setting');
$stores = $this->model_setting_store->getStores();
$data['extensions'] = array();
// Compatibility code for old extension folders
$files = glob(DIR_APPLICATION . 'controller/extension/analytics/*.php');
if ($files) {
foreach ($files as $file) {
$extension = basename($file, '.php');
// Compatibility code for old extension folders
$this->load->language('extension/analytics/' . $extension, 'extension');
$store_data = array();
$store_data[] = array(
'name' => $this->config->get('config_name'),
'edit' => $this->url->link('extension/analytics/' . $extension, 'user_token=' . $this->session->data['user_token'] . '&store_id=0', true),
'status' => $this->config->get('analytics_' . $extension . '_status') ? $this->language->get('text_enabled') : $this->language->get('text_disabled')
);
foreach ($stores as $store) {
$store_data[] = array(
'name' => $store['name'],
'edit' => $this->url->link('extension/analytics/' . $extension, 'user_token=' . $this->session->data['user_token'] . '&store_id=' . $store['store_id'], true),
'status' => $this->model_setting_setting->getSettingValue('analytics_' . $extension . '_status', $store['store_id']) ? $this->language->get('text_enabled') : $this->language->get('text_disabled')
);
}
$data['extensions'][] = array(
'name' => $this->language->get('extension')->get('heading_title'),
'install' => $this->url->link('extension/extension/analytics/install', 'user_token=' . $this->session->data['user_token'] . '&extension=' . $extension, true),
'uninstall' => $this->url->link('extension/extension/analytics/uninstall', 'user_token=' . $this->session->data['user_token'] . '&extension=' . $extension, true),
'installed' => in_array($extension, $extensions),
'store' => $store_data
);
}
}
$data['promotion'] = $this->load->controller('marketplace/promotion');
$this->response->setOutput($this->load->view('extension/extension/analytics', $data));
}
protected function validate() {
if (!$this->user->hasPermission('modify', 'extension/extension/analytics')) {
$this->error['warning'] = $this->language->get('error_permission');
}
return !$this->error;
}
}
<?php
class ControllerExtensionExtensionCaptcha extends Controller {
private $error = array();
public function index() {
$this->load->language('extension/extension/captcha');
$this->load->model('setting/extension');
$this->getList();
}
public function install() {
$this->load->language('extension/extension/captcha');
$this->load->model('setting/extension');
if ($this->validate()) {
$this->model_setting_extension->install('captcha', $this->request->get['extension']);
$this->load->model('user/user_group');
$this->model_user_user_group->addPermission($this->user->getGroupId(), 'access', 'extension/captcha/' . $this->request->get['extension']);
$this->model_user_user_group->addPermission($this->user->getGroupId(), 'modify', 'extension/captcha/' . $this->request->get['extension']);
// Compatibility
$this->model_user_user_group->addPermission($this->user->getGroupId(), 'access', 'captcha/' . $this->request->get['extension']);
$this->model_user_user_group->addPermission($this->user->getGroupId(), 'modify', 'captcha/' . $this->request->get['extension']);
// Call install method if it exsits
$this->load->controller('extension/captcha/' . $this->request->get['extension'] . '/install');
$this->session->data['success'] = $this->language->get('text_success');
}
$this->getList();
}
public function uninstall() {
$this->load->language('extension/extension/captcha');
$this->load->model('setting/extension');
if ($this->validate()) {
$this->model_setting_extension->uninstall('captcha', $this->request->get['extension']);
// Call uninstall method if it exsits
$this->load->controller('extension/captcha/' . $this->request->get['extension'] . '/uninstall');
$this->session->data['success'] = $this->language->get('text_success');
}
$this->getList();
}
protected function getList() {
if (isset($this->error['warning'])) {
$data['error_warning'] = $this->error['warning'];
} else {
$data['error_warning'] = '';
}
if (isset($this->session->data['success'])) {
$data['success'] = $this->session->data['success'];
unset($this->session->data['success']);
} else {
$data['success'] = '';
}
$extensions = $this->model_setting_extension->getInstalled('captcha');
foreach ($extensions as $key => $value) {
if (!is_file(DIR_APPLICATION . 'controller/extension/captcha/' . $value . '.php') && !is_file(DIR_APPLICATION . 'controller/captcha/' . $value . '.php')) {
$this->model_setting_extension->uninstall('captcha', $value);
unset($extensions[$key]);
}
}
$data['extensions'] = array();
// Compatibility code for old extension folders
$files = glob(DIR_APPLICATION . 'controller/extension/captcha/*.php');
if ($files) {
foreach ($files as $file) {
$extension = basename($file, '.php');
$this->load->language('extension/captcha/' . $extension, 'extension');
$data['extensions'][] = array(
'name' => $this->language->get('extension')->get('heading_title') . (($extension == $this->config->get('config_captcha')) ? $this->language->get('text_default') : null),
'status' => $this->config->get('captcha_' . $extension . '_status') ? $this->language->get('text_enabled') : $this->language->get('text_disabled'),
'install' => $this->url->link('extension/extension/captcha/install', 'user_token=' . $this->session->data['user_token'] . '&extension=' . $extension, true),
'uninstall' => $this->url->link('extension/extension/captcha/uninstall', 'user_token=' . $this->session->data['user_token'] . '&extension=' . $extension, true),
'installed' => in_array($extension, $extensions),
'edit' => $this->url->link('extension/captcha/' . $extension, 'user_token=' . $this->session->data['user_token'], true)
);
}
}
$sort_order = array();
foreach ($data['extensions'] as $key => $value) {
if($value['installed']){
$add = '0';
}else{
$add = '1';
}
$sort_order[$key] = $add.$value['name'];
}
array_multisort($sort_order, SORT_ASC, $data['extensions']);
$data['promotion'] = $this->load->controller('marketplace/promotion');
$this->response->setOutput($this->load->view('extension/extension/captcha', $data));
}
protected function validate() {
if (!$this->user->hasPermission('modify', 'extension/extension/captcha')) {
$this->error['warning'] = $this->language->get('error_permission');
}
return !$this->error;
}
}
\ No newline at end of file
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff could not be displayed because it is too large.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff could not be displayed because it is too large.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff could not be displayed because it is too large.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff could not be displayed because it is too large.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff could not be displayed because it is too large.
This diff is collapsed. Click to expand it.
This diff could not be displayed because it is too large.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff could not be displayed because it is too large.
This diff is collapsed. Click to expand it.
This diff could not be displayed because it is too large.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.