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

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
1 +name: Lint
2 +
3 +on:
4 + push:
5 + branches:
6 + - 3.0.x.x
7 + pull_request:
8 + types: [opened, synchronize]
9 +
10 +concurrency:
11 + group: ${{ github.workflow }}-${{ github.ref }}
12 + cancel-in-progress: true
13 +
14 +jobs:
15 + tests:
16 + runs-on: ubuntu-latest
17 + strategy:
18 + matrix:
19 + php: ['7.3', '7.4', '8.0', '8.1', '8.2', '8.3']
20 + steps:
21 + - name: Checkout
22 + uses: actions/checkout@v2
23 +
24 + - name: Setup PHP
25 + uses: shivammathur/setup-php@v2
26 + with:
27 + php-version: ${{ matrix.php }}
28 + tools: composer:v2, cs2pr
29 + extensions: mbstring
30 +
31 + - name: Lint
32 + run: |
33 + error=0
34 + for file in $(find upload -type f -name "*.php" ! -path 'upload/system/storage/vendor/*'); do
35 + php -l -n $file | grep -v "No syntax errors detected" && error=1
36 + done
37 + if [ $error -eq 1 ]; then
38 + echo "Syntax errors were found."
39 + exit 1
40 + else
41 + echo "No syntax errors were detected."
42 + fi
43 +
44 + - name: Cache dependencies
45 + uses: actions/cache@v3
46 + with:
47 + path: |
48 + ~/.cache/composer/files
49 + ./.cache
50 + ./.php-cs-fixer.cache
51 + key: OC3.0-PHP${{ matrix.php }}-${{ hashFiles('**/composer.lock') }}
52 + restore-keys: OC3.0-PHP${{ matrix.php }}-
53 +
54 + - name: PHPStan
55 + run: |
56 + composer require phpstan/phpstan 1.10.57
57 + ./upload/system/storage/vendor/bin/phpstan analyze --no-progress
58 +
59 + - name: Code style
60 + if: matrix.php == '8.3'
61 + run: |
62 + composer require --dev -w friendsofphp/php-cs-fixer v3.41.1
63 + ./upload/system/storage/vendor/bin/php-cs-fixer fix --dry-run --diff --ansi || true
64 + ./upload/system/storage/vendor/bin/php-cs-fixer fix --dry-run --format=checkstyle | cs2pr
1 +<?php
2 +/*
3 + * This document has been generated with
4 + * https://mlocati.github.io/php-cs-fixer-configurator/#version:3.46.0|configurator
5 + * you can change this configuration by importing this file.
6 + */
7 +$config = new PhpCsFixer\Config();
8 +return $config
9 + ->setRiskyAllowed(true)
10 + ->setIndent("\t")
11 + ->setRules([
12 + '@PER-CS2.0:risky' => true,
13 + '@PER-CS2.0' => true,
14 + '@DoctrineAnnotation' => true,
15 + '@PHPUnit100Migration:risky' => true,
16 + 'assign_null_coalescing_to_coalesce_equal' => true,
17 + 'attribute_empty_parentheses' => true,
18 + 'backtick_to_shell_exec' => true,
19 + 'binary_operator_spaces' => false,
20 + 'blank_line_after_namespace' => false,
21 + 'blank_line_after_opening_tag' => false,
22 + 'blank_lines_before_namespace' => false,
23 + 'braces_position' => false,
24 + 'cast_spaces' => false,
25 + 'class_definition' => false,
26 + 'clean_namespace' => true,
27 + 'comment_to_phpdoc' => true,
28 + 'concat_space' => false,
29 + 'constant_case' => false,
30 + 'control_structure_braces' => false,
31 + 'control_structure_continuation_position' => false,
32 + 'date_time_create_from_format_call' => true,
33 + 'declare_parentheses' => true,
34 + 'echo_tag_syntax' => true,
35 + 'elseif' => false,
36 + 'empty_loop_body' => true,
37 + 'empty_loop_condition' => true,
38 + 'ereg_to_preg' => true,
39 + 'error_suppression' => true,
40 + 'fopen_flag_order' => true,
41 + 'fopen_flags' => ['b_mode' => false],
42 + 'function_declaration' => false,
43 + 'general_phpdoc_annotation_remove' => true,
44 + 'general_phpdoc_tag_rename' => true,
45 + 'heredoc_indentation' => true,
46 + 'heredoc_to_nowdoc' => true,
47 + 'implode_call' => true,
48 + 'indentation_type' => false,
49 + 'integer_literal_case' => true,
50 + 'lambda_not_used_import' => true,
51 + 'magic_constant_casing' => true,
52 + 'magic_method_casing' => true,
53 + 'method_argument_space' => false,
54 + 'method_chaining_indentation' => true,
55 + 'multiline_comment_opening_closing' => true,
56 + 'native_function_casing' => true,
57 + 'native_type_declaration_casing' => true,
58 + 'new_with_parentheses' => false,
59 + 'no_alternative_syntax' => true,
60 + 'no_binary_string' => true,
61 + 'no_blank_lines_after_class_opening' => false,
62 + 'no_closing_tag' => false,
63 + 'no_empty_comment' => true,
64 + 'no_homoglyph_names' => true,
65 + 'no_leading_import_slash' => false,
66 + 'no_leading_namespace_whitespace' => true,
67 + 'no_mixed_echo_print' => true,
68 + 'no_multiline_whitespace_around_double_arrow' => true,
69 + 'no_multiple_statements_per_line' => false,
70 + 'no_php4_constructor' => true,
71 + 'no_short_bool_cast' => true,
72 + 'no_spaces_after_function_name' => false,
73 + 'no_spaces_around_offset' => true,
74 + 'no_trailing_comma_in_singleline' => true,
75 + 'no_trailing_whitespace' => false,
76 + 'no_trailing_whitespace_in_comment' => false,
77 + 'no_unneeded_braces' => true,
78 + 'no_unneeded_final_method' => true,
79 + 'no_unneeded_import_alias' => true,
80 + 'no_unset_cast' => true,
81 + 'no_unset_on_property' => true,
82 + 'no_useless_nullsafe_operator' => true,
83 + 'no_useless_return' => true,
84 + 'no_useless_sprintf' => true,
85 + 'no_whitespace_before_comma_in_array' => true,
86 + 'no_whitespace_in_blank_line' => false,
87 + 'normalize_index_brace' => true,
88 + 'nullable_type_declaration' => true,
89 + 'nullable_type_declaration_for_default_null_value' => true,
90 + 'object_operator_without_whitespace' => true,
91 + 'ordered_imports' => false,
92 + 'ordered_interfaces' => true,
93 + 'ordered_types' => true,
94 + 'php_unit_construct' => true,
95 + 'php_unit_data_provider_name' => true,
96 + 'php_unit_data_provider_return_type' => true,
97 + 'php_unit_set_up_tear_down_visibility' => true,
98 + 'php_unit_strict' => true,
99 + 'php_unit_test_annotation' => true,
100 + 'php_unit_test_case_static_method_calls' => true,
101 + 'phpdoc_inline_tag_normalizer' => true,
102 + 'phpdoc_line_span' => true,
103 + 'phpdoc_no_access' => true,
104 + 'phpdoc_no_useless_inheritdoc' => true,
105 + 'phpdoc_return_self_reference' => true,
106 + 'phpdoc_scalar' => true,
107 + 'phpdoc_single_line_var_spacing' => true,
108 + 'phpdoc_tag_casing' => true,
109 + 'phpdoc_tag_type' => true,
110 + 'phpdoc_types' => true,
111 + 'phpdoc_types_order' => ['null_adjustment' => 'always_last'],
112 + 'phpdoc_var_annotation_correct_order' => true,
113 + 'phpdoc_var_without_name' => true,
114 + 'return_to_yield_from' => true,
115 + 'self_static_accessor' => true,
116 + 'semicolon_after_instruction' => true,
117 + 'set_type_to_cast' => true,
118 + 'short_scalar_cast' => false,
119 + 'simple_to_complex_string_variable' => true,
120 + 'single_blank_line_at_eof' => false,
121 + 'single_line_empty_body' => false,
122 + 'single_line_throw' => true,
123 + 'spaces_inside_parentheses' => false,
124 + 'standardize_not_equals' => true,
125 + 'statement_indentation' => false,
126 + 'string_length_to_empty' => true,
127 + 'string_line_ending' => true,
128 + 'switch_case_semicolon_to_colon' => false,
129 + 'switch_case_space' => false,
130 + 'switch_continue_to_break' => true,
131 + 'ternary_operator_spaces' => false,
132 + 'trim_array_spaces' => true,
133 + 'type_declaration_spaces' => true,
134 + 'types_spaces' => true,
135 + 'unary_operator_spaces' => false,
136 + 'visibility_required' => false,
137 + 'yield_from_array_to_yields' => true,
138 + ])
139 + ->setFinder(PhpCsFixer\Finder::create()
140 + ->in(__DIR__ . '/upload/')
141 + ->exclude([
142 + __DIR__ . '/upload/system/storage/vendor/',
143 + ])
144 + // ->append([
145 + // 'file-to-include',
146 + // ])
147 + )
148 +;
This diff is collapsed. Click to expand it.
1 +# INSTALL
2 +
3 +* This is for __new installation only__
4 +* These instructions are for a manual installation using FTP, cPanel or other web hosting Control Panel.
5 +
6 +
7 +If you are __upgrading your existing cart__, be sure to read the [upgrade instructions](UPGRADE.md) instead
8 +
9 +
10 +## Linux Install
11 +
12 +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/.
13 +2. Make sure your web user has the permission to read, write and execute all directories under the web root.
14 +3. Rename config-dist.php to config.php and admin/config-dist.php to admin/config.php
15 +4. For Linux/Unix make sure the following folders and files are writable.
16 +
17 + chmod 0777 config.php
18 + chmod 0777 admin/config.php
19 +
20 +5. Make sure you have installed a MySQL Database which has a user assigned to it
21 + * do not use your `root` username and root password
22 +6. Visit the store homepage e.g. http://www.example.com or http://www.example.com/store/
23 +7. You should be taken to the installer page. Follow the on screen instructions.
24 +8. After successful install, delete the /install/ directory from ftp.
25 +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)
26 +
27 +## Windows Install
28 +
29 +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
30 +2. Rename config-dist.php to config.php and admin/config-dist.php to admin/config.php
31 +3. For Windows make sure the following folders and files permissions allow Read and Write.
32 +
33 + config.php
34 + admin/config.php
35 +
36 +4. Make sure you have installed a MySQL Database which has a user assigned to it
37 + * do not use your `root` username and root password
38 +5. You should be taken to the installer page. Follow the on screen instructions.
39 +6. After successful install, delete the /install/ directory.
40 +
41 +## Local Install
42 +
43 +There are many all-in-one web servers out there and most of them should work with OpenCart out of the box.
44 +
45 +Some examples...
46 +
47 +* http://www.apachefriends.org/en/xampp.html
48 +* http://www.ampps.com/
49 +* http://www.usbwebserver.net
50 +* http://www.wampserver.com/en/
51 +
52 + ## Notes
53 +
54 +Godaddy Issues
55 +
56 +If your hosting on godaddy you might need to rename the php.ini to user.ini
57 +
58 +It seems godaddy has started changing the industry standard names of files.
59 +
60 +----------------------------
61 +
62 +## Going live
63 +When your site is ready to go live open file system/config/default.php
64 +
65 +**Find:**
66 +
67 +`$_['error_display'] = true;`
68 +
69 +**Replace with:**
70 +
71 +`$_['error_display'] = false;`
72 +
73 +## COMPOSER OR NOT TO COMPOSER
74 +
75 +From __version 2.2 composer has been added__ to aid developers who want to use composer libraries. 2 versions of OpenCart
76 +will become available, one compiled and one non-compiled (composer.json only - no files in vendor folder).
77 +
78 +We STRONGLY __advise leaving the vendor folder outside of the webroot__ - so files cannot be accessed directly.
79 +
80 +### How to install Composer
81 +
82 +Installing is extremely simple, follow the instructions [HERE](https://getcomposer.org/download/)
This diff is collapsed. Click to expand it.
1 +# OpenCart
2 +
3 +## Overview
4 +
5 +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.
6 +
7 +## Reporting a bug
8 +
9 +Read the instructions below before you create a bug report.
10 +
11 + 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.
12 + 2. Check all open and closed issues on the [GitHub bug tracker](https://github.com/opencart/opencart/issues).
13 + 3. If your bug is related to the OpenCart core code then please create a bug report on GitHub.
14 + 4. READ the [changelog for the master branch](https://github.com/opencart/opencart/blob/master/changelog.md)
15 + 5. Use [Google](http://www.google.com) to search for your issue.
16 + 6. Make sure that your bug/issue is not related to your hosting environment.
17 +
18 +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)
19 +
20 +**Important!**
21 +- 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.
22 +- 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.
23 +
24 +## Making a suggestion
25 +
26 +Please do not create a bug report if you think something needs improving / adding (such as features or change to code standards etc).
27 +
28 +We welcome public suggestions on our [User Voice site](http://opencart.uservoice.com).
29 +
30 +## How to contribute
31 +
32 +Fork the repository, edit and [submit a pull request](https://github.com/opencart/opencart/wiki/Creating-a-pull-request).
33 +
34 +Please be very clear on your commit messages and pull request, empty pull request messages may be rejected without reason.
35 +
36 +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.
37 +
38 +## Versioning
39 +
40 +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.
41 +
42 +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.
43 +
44 +A MINOR is when there are significant changes that affect core structures. This increment would likely break some 3rd party modules.
45 +
46 +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.
47 +
48 +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
49 +
50 +## Releases
51 +
52 +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.
53 +
54 +The master branch will always contain an "_rc" postfix of the next intended version. The next "_rc" version may change at any time.
55 +
56 +Developer release source code will not change once tagged.
57 +
58 +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.
59 +
60 +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.
61 +
62 +## How to install
63 +
64 +Please read the installation instructions included in the repository or download file.
65 +
66 +## License
67 +
68 +[GNU General Public License version 3 (GPLv3)](https://github.com/opencart/opencart/blob/master/license.txt)
69 +
70 +## Links
71 +
72 +- [OpenCart homepage](http://www.opencart.com/)
73 +- [OpenCart forums](http://forum.opencart.com/)
74 +- [OpenCart blog](http://www.opencart.com/index.php?route=feature/blog)
75 +- [How to documents](http://docs.opencart.com/)
76 +- [Newsletter](http://newsletter.opencart.com/h/r/B660EBBE4980C85C)
77 +- [User Voice suggestions](http://opencart.uservoice.com)
1 +// * @source See SOURCE.txt for source and other copyright.
2 +// * @license GNU General Public License version 3; see LICENSE.txt
3 +
4 +ocStore був створений відповідно до GNU GPLv3 і включає або є похідним робіт ліцензуються відповідно до GNU General Public License або інших ліцензій на безкоштовне програмне забезпечення або Open Source. В ocStore використані такі джерела:
5 +
6 +- OpenCart (C) 2006-2015 Daniel Kerr, OpenCart Ltd.
7 +- Arastta (С) 2015 Arastta Association.
...\ No newline at end of file ...\ No newline at end of file
1 +# Upgrading from version 2.x.x
2 +
3 +* For existing installs only
4 +* Don't use with previous versions
5 +
6 +## For previous versions
7 +
8 +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/)
9 +
10 +
11 +## Step by step
12 +
13 +1. BACKUP YOUR EXISTING STORE FILES AND DATABASE!!
14 + * Backup your __database__ via your store
15 + `Admin -> System -> Backup`
16 + * Backup your __files__ using FTP file copy or use cPanel filemanager to create a zip of all the existing opencart files and folders
17 +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`.
18 + 1. Backup and Remove all of 2.x.x views files. Because OpenCart 3 is start to use TWIG to replace the TPL format.
19 + 2. Watch this video to understand how to properly upload folder using FTP: http://docs.opencart.com/en-gb/upgrading/
20 + 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.
21 + 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.
22 +
23 +3. Browse to `http://<yourstore.com>/install` Replacing `<yourstore.com>` with your actual site (and subdirectory if applicable).
24 +
25 +4. You should see the OpenCart Upgrade script.
26 + * 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.
27 +
28 +5. Click "Upgrade". After a few seconds you should see the upgrade success page.
29 + * If you see any errors, report them immediately in the forum before continuing.
30 +
31 +6. Clear any cookies in your browser
32 +
33 +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.
34 +
35 +8. Goto `Admin -> Users -> User Groups` and Edit the Top Administrator group. Check All boxes.
36 + * This will ensure you have permissions for all the new files
37 +
38 +9. Goto `Admin -> Extensions -> Extensions -> Theme` enabled and save the default theme again.
39 +
40 +10. Goto `Admin -> System Settings`
41 + * Update any blank fields and click save.
42 + * Even if you do not see any new fields, click save anyway to update the database with any new field names.
43 +
44 +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
45 +
46 +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.)
47 +
48 +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".
49 + 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:
50 +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.
51 +
52 +Note that some of your vQmod scripts may need to be updated for the new core changes.
53 +So run through your site catalog and admin areas and check in FTP for the vqmod/vqmod.log file.
54 +If you see errors, then you will need to address them.
55 +
56 +
57 +## Troubleshooting:
58 +
59 +1. If you have any upgrade script errors, post them in the forum
60 +2. If you have 3rd party addon errors, contact the mod author for an update.
61 +3. If you find bugs, check the "official" bug thread for this version of Opencart
62 +
63 +
64 +Many bugs may have already been reported and fixes will be offered in the first post of this thread.
65 +You should always visit this thread immediately after a fresh upgrade to see if there are any immediate bug fixes
66 +If nobody has reported your bug, then please report it.
67 +
68 +An online version of this file can be found here:
69 +http://www.opencart.com/index.php?route=documentation/documentation&path=98
1 +<?xml version="1.0" encoding="UTF-8"?>
2 +<project name="OpenCart" default="build" basedir=".">
3 + <property name="source" value="upload"/>
4 +
5 + <target name="clean" description="Cleanup build artifacts">
6 + <delete dir="${basedir}/tests/docs"/>
7 + <delete dir="${basedir}/tests/logs"/>
8 + <delete dir="${basedir}/tests/testresults"/>
9 + </target>
10 +
11 + <target name="prepare" depends="clean" description="Prepare for build">
12 + <mkdir dir="${basedir}/tests/docs"/>
13 + <mkdir dir="${basedir}/tests/logs"/>
14 + <mkdir dir="${basedir}/tests/testresults"/>
15 + </target>
16 +
17 + <target name="lint" description="Perform syntax check of source code files">
18 + <apply executable="php" failonerror="true">
19 + <arg value="-l"/>
20 + <fileset dir="${basedir}/upload">
21 + <include name="**/*.php"/>
22 + <modified/>
23 + </fileset>
24 + </apply>
25 + </target>
26 +
27 + <target name="csslint" description="Run the CSSLint tool on CSS files">
28 + <fileset dir="${basedir}/upload" id="cssfiles.raw">
29 + <include name="**/*.css" />
30 + </fileset>
31 + <pathconvert pathsep=" " property="cssfiles.clean" refid="cssfiles.raw" />
32 + <exec executable="csslint" output="${basedir}/tests/csslint.xml">
33 + <arg line="--warnings=box-model,floats --errors=ids,important --format=lint-xml ${cssfiles.clean}" />
34 + </exec>
35 + </target>
36 +
37 + <target name="phploc" description="Measure project size using PHPLOC">
38 + <exec executable="phploc">
39 + <arg value="--log-csv"/>
40 + <arg value="${basedir}/tests/logs/phploc.csv"/>
41 + <arg path="${basedir}/upload"/>
42 + </exec>
43 + </target>
44 +
45 + <target name="phpcs" description="Generate checkstyle.xml using PHP_CodeSniffer">
46 + <exec executable="phpcs">
47 + <arg line="--report=checkstyle --report-file=${basedir}/tests/checkstyle.xml --standard=tests/phpcs/OpenCart/ruleset.xml --extensions=php ${source}/"/>
48 + </exec>
49 + </target>
50 +
51 + <target name="build" depends="prepare,phpcs,lint,phploc,csslint"/>
52 +</project>
...\ No newline at end of file ...\ No newline at end of file
1 +{
2 + "name": "opencart/opencart",
3 + "type": "project",
4 + "description": "OpenCart",
5 + "keywords": ["opencart", "ecommerce", "framework", "opensource"],
6 + "homepage": "http://www.opencart.com",
7 + "license": "GPL-3.0+",
8 + "config": {
9 + "vendor-dir": "./upload/system/storage/vendor/"
10 + },
11 + "require": {
12 + "braintree/braintree_php" : "3.40.0",
13 + "cardinity/cardinity-sdk-php": "^v2.0",
14 + "divido/divido-php": ">=1.15",
15 + "php": ">=7.3.0",
16 + "scssphp/scssphp": "^1.11.0",
17 + "zoujingli/wechat-developer": "^1.2",
18 + "twig/twig": "^3.3",
19 + "zoujingli/wechat-php-sdk": "^1.3"
20 + },
21 + "autoload-dev": {
22 + "psr-4": {
23 + "Tools\\PHPStan\\": "tools/phpstan/"
24 + }
25 + }
26 +}
This diff is collapsed. Click to expand it.
1 +///////////////////////////////////
2 +/// ocStore V3.x ///
3 +/// Інструкція зі встановлення ///
4 +/// https://ocstore.com ///
5 +///////////////////////////////////
6 +
7 +
8 +ПРИМІТКА: ЦЕ ЛИШЕ ДЛЯ НОВОГО ВСТАНОВЛЕННЯ!
9 +ЯКЩО ОНОВЛЕННЯ В ІСНУЮЧИЙ МАГАЗИН, НЕ ЗАБУДЬТЕ ПРОЧИТАТИ UPGRADE.TXT
10 +
11 +
12 +-------
13 +Встановлення
14 +-------
15 +These instructions are for a manual installation using FTP, cPanel or other web hosting Control Panel.
16 +
17 +- Встановлення на Linux -
18 +
19 +1. Завантажте всі ваші файли та папки на ваш сервер з папки «Upload». Можна розархівувати в будь-яке місце на Ваш вибір.
20 + Наприклад: У cPanel має бути в папці public_html/ і Plesk має бути в httpdocs/.
21 +
22 +2. Перейменуйте config-dist.php на config.php і admin/config-dist.php на admin/config.php
23 +
24 +3. Для Linux/Unix переконайтеся, що папки та файли доступні для запису.
25 +
26 + chmod 0755 or 0777 system/storage/cache/
27 + chmod 0755 or 0777 system/storage/download/
28 + chmod 0755 or 0777 system/storage/logs/
29 + chmod 0755 or 0777 system/storage/modification/
30 + chmod 0755 or 0777 system/storage/session/
31 + chmod 0755 or 0777 system/storage/upload/
32 + chmod 0755 or 0777 system/storage/vendor/
33 + chmod 0755 or 0777 image/
34 + chmod 0755 or 0777 image/cache/
35 + chmod 0755 or 0777 image/catalog/
36 + chmod 0755 or 0777 config.php
37 + chmod 0755 or 0777 admin/config.php
38 +
39 + Якщо при правах 0755 не працює, спробуйте 0777.
40 +
41 +4. Упевніться, що у вас встановлено базу даних MySQL і ви маєте доступ до неї. НІ ЗА ЯКИХ ОБСТАВ НЕ ВИКОРИСТОВУЙТЕ ROOT ЛОГІН ТА ПАРОЛЬ.
42 +
43 +5. Завітайте на домашню сторінку свого магазину.
44 +Наприклад: http://www.example.com або http://www.examle.com/store/
45 +
46 +6. Дотримуйтесь інструкцій на екрані.
47 +
48 +7. Видаліть папку для встановлення.
49 +
50 +8. Якщо ви завантажили скомпільовану версію з папкою Vendor, то вона повинна бути завантажена вище кореневої директорії (у тій же папці, де public_html або httpdocs)
51 +
52 +Встановлення на Windows -
53 +
54 +1. Завантажте всі файли та папки на свій сервер із папки «Upload». Їх можна розпакувати у будь-яке місце на ваш вибір. Наприклад /wwwroot/store або /wwwroot
55 +
56 +2. Перейменуйте config-dist.php на config.php і admin/config-dist.php на admin/config.php
57 +
58 +3. Для Windows переконайтеся, що папки та файли доступні для запису.
59 +
60 + system/storage/cache/
61 + system/storage/download/
62 + system/storage/logs/
63 + system/storage/modification/
64 + system/storage/session/
65 + system/storage/upload/
66 + system/storage/vendor/
67 + image/
68 + image/cache/
69 + image/catalog/
70 + config.php
71 + admin/config.php
72 +
73 +4. Переконайтеся, що у Вас встановлена база даних MySQL і Ви маєте доступ до неї. НІ В ЯКОМУ РАЗІ НЕ ВИКОРИСТОВУЙТЕ ROOT ЛОГІН І ПАРОЛЬ.
74 +
75 +5. Завітайте на домашню сторінку Вашого магазину.
76 + Наприклад: http://www.example.com або http://www.examle.com/store/
77 +
78 +6. Виконуйте вказівки на екрані.
79 +
80 +7. Видаліть інсталяційну директорію.
81 +
82 +----------------------------
83 +COMPOSER OR NOT TO COMPOSER
84 +----------------------------
85 +From version 2.2 composer has been added to aid developers who want to use composer libraries. 2 versions of OpenCart
86 +will become available, one compiled and one non-compiled (composer.json only - no files in vendor folder).
87 +
88 +We STRONGLY advise leaving the vendor folder outside of the webroot - so files cannot be accessed directly.
89 +
90 +Composer installing is extremely simple - https://getcomposer.org
This diff is collapsed. Click to expand it.
1 +services:
2 + -
3 + class: \Tools\PHPStan\RegistryPropertyReflectionExtension
4 + tags:
5 + - phpstan.broker.propertiesClassReflectionExtension
6 +parameters:
7 + level: 1
8 + paths:
9 + - ./upload/
10 + excludePaths:
11 + - ./system/storage/vendor/
12 + - ./system/storage/cache/template/
13 + - ./upload/system/storage/vendor/
14 + - ./upload/system/storage/cache/template/
15 + tmpDir: .cache
16 + ignoreErrors:
17 + - '#Class Event constructor invoked with 1 parameter, 4-5 required\.#'
18 + - '#Constant [A-Z_]+ not found\.#'
19 + - '#might not be defined\.#'
20 + - '#invoked with \d+ parameters?, \d+ required\.#'
21 + reportUnmatchedIgnoredErrors: false
...\ No newline at end of file ...\ No newline at end of file
1 +<?php
2 +
3 +namespace Tools\PHPStan;
4 +
5 +use PHPStan\Reflection\ClassReflection;
6 +use PHPStan\Reflection\PropertyReflection;
7 +use PHPStan\TrinaryLogic;
8 +use PHPStan\Type\NeverType;
9 +use PHPStan\Type\Type;
10 +
11 +class LoadedProperty implements PropertyReflection {
12 + /**
13 + * @var ClassReflection
14 + */
15 + private $declaringClass;
16 + /**
17 + * @var Type
18 + */
19 + private $type;
20 +
21 + public function __construct(ClassReflection $declaringClass, Type $readableType) {
22 + $this->declaringClass = $declaringClass;
23 + $this->type = $readableType;
24 + }
25 +
26 + public function getDeclaringClass(): ClassReflection {
27 + return $this->declaringClass;
28 + }
29 +
30 + public function isStatic(): bool {
31 + return false;
32 + }
33 +
34 + public function isPrivate(): bool {
35 + return false;
36 + }
37 +
38 + public function isPublic(): bool {
39 + return true;
40 + }
41 +
42 + public function isReadable(): bool {
43 + return true;
44 + }
45 +
46 + public function isWritable(): bool {
47 + return false;
48 + }
49 +
50 + public function getDocComment(): ?string {
51 + return null;
52 + }
53 +
54 + public function getReadableType(): Type {
55 + return $this->type;
56 + }
57 +
58 + public function getWritableType(): Type {
59 + return new NeverType();
60 + }
61 +
62 + public function canChangeTypeAfterAssignment(): bool {
63 + return false;
64 + }
65 +
66 + public function isDeprecated(): TrinaryLogic {
67 + return TrinaryLogic::createNo();
68 + }
69 +
70 + public function getDeprecatedDescription(): ?string {
71 + return null;
72 + }
73 +
74 + public function isInternal(): TrinaryLogic {
75 + return TrinaryLogic::createNo();
76 + }
77 +}
1 +<?php
2 +
3 +namespace Tools\PHPStan;
4 +
5 +use Registry;
6 +use PHPStan\Broker\Broker;
7 +use PHPStan\Reflection\ClassReflection;
8 +use PHPStan\Reflection\PropertiesClassReflectionExtension;
9 +use PHPStan\Reflection\PropertyReflection;
10 +use PHPStan\Type\Generic\GenericObjectType;
11 +use PHPStan\Type\NullType;
12 +use PHPStan\Type\ObjectType;
13 +use PHPStan\Type\TypeCombinator;
14 +
15 +class RegistryPropertyReflectionExtension implements PropertiesClassReflectionExtension {
16 + public function hasProperty(ClassReflection $classReflection, string $propertyName): bool {
17 + if (!$classReflection->is(Registry::class)) {
18 + return false;
19 + }
20 +
21 + return preg_match('/^model_.+$/', $propertyName, $matches) === 1;
22 + }
23 +
24 + public function getProperty(ClassReflection $classReflection, string $propertyName): PropertyReflection {
25 + preg_match('/^(model_.+)$/', $propertyName, $matches);
26 + $className = $this->convertSnakeToStudly($matches[1]);
27 +
28 + $broker = Broker::getInstance();
29 +
30 + $type = new NullType();
31 + if ($broker->hasClass($className)) {
32 + $found = new ObjectType($className);
33 + $type = new GenericObjectType('\Proxy', [$found]);
34 + $type = TypeCombinator::addNull($type);
35 + }
36 +
37 + return new LoadedProperty($classReflection, $type);
38 + }
39 +
40 + private function convertSnakeToStudly(string $value): string {
41 + return str_replace(' ', '', ucwords(str_replace('_', ' ', $value)));
42 + }
43 +}
1 +///////////////////////////////////////
2 +/// OpenCart V1.5.x TO 3.0.x ///
3 +/// Upgrade Instructions ///
4 +/// http://www.opencart.com ///
5 +///////////////////////////////////////
6 +
7 +NOTE: THIS IS FOR UPGRADE ON EXISTING INSTALLS ONLY!
8 +IF INSTALLING NEW, BE SURE TO READ THE INSTALL.TXT FILE INSTEAD
9 +
10 +##########################################
11 +THIS IS FOR UPGRADING EXISTING OPENCART 1.5.x STORES ONLY
12 +THIS IS FOR UPGRADING EXISTING OPENCART 1.5.x STORES ONLY
13 +THIS IS FOR UPGRADING EXISTING OPENCART 1.5.x STORES ONLY
14 +##########################################
15 +
16 +##########################################
17 +DO NOT USE THIS UPGRADE TO CONVERT FROM 1.4.x to 1.5.x!!
18 +DO NOT USE THIS UPGRADE TO CONVERT FROM 1.4.x to 1.5.x!!
19 +DO NOT USE THIS UPGRADE TO CONVERT FROM 1.4.x to 1.5.x!!
20 +If you have 1.4.x and want to upgrade to 1.5.x, You need to use the script here:
21 + http://forum.opencart.com/viewtopic.php?f=2&t=50292
22 +##########################################
23 +
24 +
25 +1. BACKUP YOUR EXISTING STORE FILES AND DATABASE!!
26 +- Backup your database via your store Admin->System->Backup
27 +- Backup your files using FTP file copy or use cPanel filemanager to create a zip of all the existing opencart files and folders
28 +
29 +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.
30 +Watch this video to understand how to properly upload folder using FTP: http://forum.opencart.com/viewtopic.php?f=20&t=9645#p46371
31 +
32 +3. Browse to http://<yourstore.com>/install Replacing <yourstore.com> with your actual site (and subdirectory if applicable).
33 +
34 +4. You should see the OpenCart Upgrade script.
35 +- 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.
36 +
37 +5. Click "Upgrade". After a few seconds you should see the upgrade success page.
38 +- If you see any errors, report them immediately in the forum before continuing.
39 +
40 +6. Clear any cookies in your browser
41 +
42 +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.
43 +
44 +8. Goto Admin->Users->User Groups and Edit the Top Adminstrator group. Check All boxes.
45 +- This will ensure you have permissions for all the new files
46 +
47 +9. Goto Admin->System Settings
48 +- Update any blank fields and click save.
49 +Even if you do not see any new fields, click save anyway to update the database with any new field names.
50 +
51 +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
52 +
53 +##########################################
54 +OPTIONAL
55 +##########################################
56 +
57 +v151
58 + - Modules must all be reinstalled to update the database with the new serialized data method or you will see errors on the front end
59 +v151.3
60 + - 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.
61 +v152
62 + - New "Product Count" field added to the category module. You may need to edit that module to set the new field
63 +v153
64 + - UPS module gets a change for the unit select and is disabled by default to force you to resave the settings.
65 + - New Voucher Min/Max fields added to Admin->System->Settings. Default is 1 to 1000
66 + - 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.
67 + - 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.
68 +
69 +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.
70 +
71 +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".
72 +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:
73 +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.
74 +
75 +Note that some of your vQmod scripts may need to be updated for the new core changes.
76 +So run through your site catalog and admin areas and check in FTP for the vqmod/vqmod.log file.
77 +If you see errors, then you will need to address them.
78 +
79 +
80 +Troubleshooting:
81 +------------------------------
82 +1. If you have any upgrade script errors, post them in the forum
83 +2. If you have 3rd party addon errors, contact the mod author for an update.
84 +3. If you find bugs, check the "official" bug thread for this version of Opencart
85 +Many bugs may have already been reported and fixes will be offered in the first post of this thread.
86 +You should always visit this thread immediately after a fresh upgrade to see if there are any immediate bug fixes
87 +If nobody has reported your bug, then please report it.
88 +
89 +An online version of this file can be found here:
90 +http://www.opencart.com/index.php?route=documentation/documentation&path=98
91 +
92 +
93 +That's It!
94 +OpenCart Dev Team
...\ No newline at end of file ...\ No newline at end of file
1 +# 1.To use URL Alias you need to be running apache with mod_rewrite enabled.
2 +
3 +# 2. In your opencart directory rename htaccess.txt to .htaccess.
4 +
5 +# For any support issues please visit: http://www.opencart.com
6 +
7 +Options +FollowSymlinks
8 +
9 +# Prevent Directory listing
10 +Options -Indexes
11 +
12 +# Prevent Direct Access to files
13 +<FilesMatch "(?i)((\.tpl|\.twig|\.ini|\.log|(?<!robots)\.txt))">
14 + Require all denied
15 +## For apache 2.2 and older, replace "Require all denied" with these two lines :
16 +# Order deny,allow
17 +# Deny from all
18 +</FilesMatch>
19 +
20 +# SEO URL Settings
21 +RewriteEngine On
22 +# If your opencart installation does not run on the main web folder make sure you folder it does run in ie. / becomes /shop/
23 +
24 +RewriteBase /
25 +RewriteCond %{QUERY_STRING} ^(.*)&?page=1$
26 +RewriteRule ^(.*)/?$ /$1?%1%2 [R=301,L] #remove page=1 from url
27 +RewriteRule ^sitemap.xml$ index.php?route=extension/feed/google_sitemap [L]
28 +RewriteRule ^googlebase.xml$ index.php?route=extension/feed/google_base [L]
29 +RewriteRule ^system/storage/(.*) index.php?route=error/not_found [L]
30 +RewriteCond %{REQUEST_FILENAME} !-f
31 +RewriteCond %{REQUEST_FILENAME} !-d
32 +RewriteCond %{REQUEST_URI} !.*\.(ico|gif|jpg|jpeg|png|js|css)
33 +RewriteRule ^([^?]*) index.php?_route_=$1 [L,QSA]
34 +
35 +### Additional Settings that may need to be enabled for some servers
36 +### Uncomment the commands by removing the # sign in front of it.
37 +### 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.
38 +
39 +# 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:
40 +# php_flag register_globals off
41 +
42 +# 2. If your cart has magic quotes enabled, This may work to disable it:
43 +# php_flag magic_quotes_gpc Off
44 +
45 +# 3. Set max upload file size. Most hosts will limit this and not allow it to be overridden but you can try
46 +# php_value upload_max_filesize 999M
47 +
48 +# 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
49 +# php_value post_max_size 999M
50 +
51 +# 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
52 +# php_value max_execution_time 200
53 +
54 +# 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
55 +# php_value max_input_time 200
56 +
57 +# 7. disable open_basedir limitations
58 +# 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.
1 +<?php
2 +class ControllerCommonDashboard extends Controller {
3 + public function index() {
4 + $this->load->language('common/dashboard');
5 +
6 + $this->document->setTitle($this->language->get('heading_title'));
7 +
8 + $data['user_token'] = $this->session->data['user_token'];
9 +
10 + $data['breadcrumbs'] = array();
11 +
12 + $data['breadcrumbs'][] = array(
13 + 'text' => $this->language->get('text_home'),
14 + 'href' => $this->url->link('common/dashboard', 'user_token=' . $this->session->data['user_token'], true)
15 + );
16 +
17 + $data['breadcrumbs'][] = array(
18 + 'text' => $this->language->get('heading_title'),
19 + 'href' => $this->url->link('common/dashboard', 'user_token=' . $this->session->data['user_token'], true)
20 + );
21 +
22 + // Check install directory exists
23 + if (is_dir(DIR_CATALOG . '../install')) {
24 + $data['error_install'] = $this->language->get('error_install');
25 + } else {
26 + $data['error_install'] = '';
27 + }
28 +
29 + // Dashboard Extensions
30 + $dashboards = array();
31 +
32 + $this->load->model('setting/extension');
33 +
34 + // Get a list of installed modules
35 + $extensions = $this->model_setting_extension->getInstalled('dashboard');
36 +
37 + // Add all the modules which have multiple settings for each module
38 + foreach ($extensions as $code) {
39 + if ($this->config->get('dashboard_' . $code . '_status') && $this->user->hasPermission('access', 'extension/dashboard/' . $code)) {
40 + $output = $this->load->controller('extension/dashboard/' . $code . '/dashboard');
41 +
42 + if ($output) {
43 + $dashboards[] = array(
44 + 'code' => $code,
45 + 'width' => $this->config->get('dashboard_' . $code . '_width'),
46 + 'sort_order' => $this->config->get('dashboard_' . $code . '_sort_order'),
47 + 'output' => $output
48 + );
49 + }
50 + }
51 + }
52 +
53 + $sort_order = array();
54 +
55 + foreach ($dashboards as $key => $value) {
56 + $sort_order[$key] = $value['sort_order'];
57 + }
58 +
59 + array_multisort($sort_order, SORT_ASC, $dashboards);
60 +
61 + // Split the array so the columns width is not more than 12 on each row.
62 + $width = 0;
63 + $column = array();
64 + $data['rows'] = array();
65 +
66 + foreach ($dashboards as $dashboard) {
67 + $column[] = $dashboard;
68 +
69 + $width = ($width + $dashboard['width']);
70 +
71 + if ($width >= 12) {
72 + $data['rows'][] = $column;
73 +
74 + $width = 0;
75 + $column = array();
76 + }
77 + }
78 +
79 + if (!empty($column)) {
80 + $data['rows'][] = $column;
81 + }
82 +
83 + if (DIR_STORAGE == DIR_SYSTEM . 'storage/') {
84 + $data['security'] = $this->load->controller('common/security');
85 + } else {
86 + $data['security'] = '';
87 + }
88 +
89 + $data['header'] = $this->load->controller('common/header');
90 + $data['column_left'] = $this->load->controller('common/column_left');
91 + $data['footer'] = $this->load->controller('common/footer');
92 +
93 + // Run currency update
94 + if ($this->config->get('config_currency_auto')) {
95 + $this->load->model('localisation/currency');
96 + $this->load->controller('extension/currency/' . $this->config->get('config_currency_engine')."/currency" , $this->config->get('config_currency'));
97 + }
98 +
99 + $this->response->setOutput($this->load->view('common/dashboard', $data));
100 + }
101 +}
1 +<?php
2 +class ControllerCommonDeveloper extends Controller {
3 + public function index() {
4 + $this->load->language('common/developer');
5 +
6 + $data['user_token'] = $this->session->data['user_token'];
7 +
8 + $data['developer_theme'] = $this->config->get('developer_theme');
9 + $data['developer_sass'] = $this->config->get('developer_sass');
10 +
11 + $eval = false;
12 +
13 + $eval = '$eval = true;';
14 +
15 + eval($eval);
16 +
17 + if ($eval === true) {
18 + $data['eval'] = true;
19 + } else {
20 + $this->load->model('setting/setting');
21 +
22 + $this->model_setting_setting->editSetting('developer', array('developer_theme' => 1), 0);
23 +
24 + $data['eval'] = false;
25 + }
26 +
27 + $this->response->setOutput($this->load->view('common/developer', $data));
28 + }
29 +
30 + public function edit() {
31 + $this->load->language('common/developer');
32 +
33 + $json = array();
34 +
35 + if (!$this->user->hasPermission('modify', 'common/developer')) {
36 + $json['error'] = $this->language->get('error_permission');
37 + } else {
38 + $this->load->model('setting/setting');
39 +
40 + $this->model_setting_setting->editSetting('developer', $this->request->post, 0);
41 +
42 + $json['success'] = $this->language->get('text_success');
43 + }
44 +
45 + $this->response->addHeader('Content-Type: application/json');
46 + $this->response->setOutput(json_encode($json));
47 + }
48 +
49 + public function theme() {
50 + $this->load->language('common/developer');
51 +
52 + $json = array();
53 +
54 + if (!$this->user->hasPermission('modify', 'common/developer')) {
55 + $json['error'] = $this->language->get('error_permission');
56 + } else {
57 + $directories = glob(DIR_CACHE . '/template/*', GLOB_ONLYDIR);
58 +
59 + if ($directories) {
60 + foreach ($directories as $directory) {
61 + $files = glob($directory . '/*');
62 +
63 + foreach ($files as $file) {
64 + if (is_file($file)) {
65 + unlink($file);
66 + }
67 + }
68 +
69 + if (is_dir($directory)) {
70 + rmdir($directory);
71 + }
72 + }
73 + }
74 +
75 + $json['success'] = sprintf($this->language->get('text_cache'), $this->language->get('text_theme'));
76 + }
77 +
78 + $this->response->addHeader('Content-Type: application/json');
79 + $this->response->setOutput(json_encode($json));
80 + }
81 +
82 + public function sass() {
83 + $this->load->language('common/developer');
84 +
85 + $json = array();
86 +
87 + if (!$this->user->hasPermission('modify', 'common/developer')) {
88 + $json['error'] = $this->language->get('error_permission');
89 + } else {
90 + // Before we delete we need to make sure there is a sass file to regenerate the css
91 + $file = DIR_APPLICATION . 'view/stylesheet/bootstrap.css';
92 +
93 + if (is_file($file) && is_file(DIR_APPLICATION . 'view/stylesheet/sass/_bootstrap.scss')) {
94 + unlink($file);
95 + }
96 +
97 + $files = glob(DIR_CATALOG . 'view/theme/*/stylesheet/sass/_bootstrap.scss');
98 +
99 + foreach ($files as $file) {
100 + $file = substr($file, 0, -21) . '/bootstrap.css';
101 +
102 + if (is_file($file)) {
103 + unlink($file);
104 + }
105 + }
106 +
107 + $json['success'] = sprintf($this->language->get('text_cache'), $this->language->get('text_sass'));
108 + }
109 +
110 + $this->response->addHeader('Content-Type: application/json');
111 + $this->response->setOutput(json_encode($json));
112 + }
113 +
114 + public function systemcache() {
115 + $this->load->language('common/developer');
116 +
117 + $json = array();
118 +
119 + if (!$this->user->hasPermission('modify', 'common/developer')) {
120 + $json['error'] = $this->language->get('error_permission');
121 + } else {
122 + $files = glob(DIR_CACHE . 'cache.*');
123 +
124 + if (!empty($files)) {
125 + foreach($files as $file){
126 + $this->deldir($file);
127 + }
128 + }
129 +
130 + $json['success'] = sprintf($this->language->get('text_cache'), $this->language->get('text_systemcache'));
131 + }
132 +
133 + $this->response->addHeader('Content-Type: application/json');
134 + $this->response->setOutput(json_encode($json));
135 + }
136 +
137 + public function imgcache() {
138 + $this->load->language('common/developer');
139 +
140 + $json = array();
141 +
142 + if (!$this->user->hasPermission('modify', 'common/developer')) {
143 + $json['error'] = $this->language->get('error_permission');
144 + } else {
145 + $imgfiles = glob(DIR_IMAGE . 'cache/*');
146 +
147 + if (!empty($imgfiles)) {
148 + foreach($imgfiles as $imgfile){
149 + $this->deldir($imgfile);
150 + }
151 + }
152 +
153 + $json['success'] = sprintf($this->language->get('text_img_cache'), $this->language->get('text_imgcache'));
154 + }
155 +
156 + $this->response->addHeader('Content-Type: application/json');
157 + $this->response->setOutput(json_encode($json));
158 + }
159 +
160 + public function allcache() {
161 + $this->load->language('common/developer');
162 +
163 + $json = array();
164 +
165 + if (!$this->user->hasPermission('modify', 'common/developer')) {
166 + $json['error'] = $this->language->get('error_permission');
167 + } else {
168 + $files = glob(DIR_CACHE . 'cache.*');
169 +
170 + if (!empty($files)) {
171 + foreach($files as $file){
172 + $this->deldir($file);
173 + }
174 + }
175 +
176 + $imgfiles = glob(DIR_IMAGE . 'cache/*');
177 +
178 + if (!empty($imgfiles)) {
179 + foreach($imgfiles as $imgfile){
180 + $this->deldir($imgfile);
181 + }
182 + }
183 +
184 + // Before we delete we need to make sure there is a sass file to regenerate the css
185 + $file = DIR_APPLICATION . 'view/stylesheet/bootstrap.css';
186 +
187 + if (is_file($file) && is_file(DIR_APPLICATION . 'view/stylesheet/sass/_bootstrap.scss')) {
188 + unlink($file);
189 + }
190 +
191 + $files = glob(DIR_CATALOG . 'view/theme/*/stylesheet/sass/_bootstrap.scss');
192 +
193 + foreach ($files as $file) {
194 + $file = substr($file, 0, -21) . '/bootstrap.css';
195 +
196 + if (is_file($file)) {
197 + unlink($file);
198 + }
199 + }
200 +
201 + $directories = glob(DIR_CACHE . '*', GLOB_ONLYDIR);
202 +
203 + if ($directories) {
204 + foreach ($directories as $directory) {
205 + $files = glob($directory . '/*');
206 +
207 + foreach ($files as $file) {
208 + if (is_file($file)) {
209 + unlink($file);
210 + }
211 + }
212 +
213 + if (is_dir($directory)) {
214 + $this->deldir($directory);
215 + }
216 + }
217 + }
218 +
219 +
220 +
221 + $json['success'] = sprintf($this->language->get('text_cache'), $this->language->get('text_allcache'));
222 + }
223 +
224 + $this->response->addHeader('Content-Type: application/json');
225 + $this->response->setOutput(json_encode($json));
226 + }
227 +
228 + public function deldir($dirname){
229 + if(file_exists($dirname)) {
230 + if(is_dir($dirname)){
231 + $dir=opendir($dirname);
232 + while(($filename=readdir($dir)) !== false){
233 + if($filename!="." && $filename!=".."){
234 + $file=$dirname."/".$filename;
235 + $this->deldir($file);
236 + }
237 + }
238 + closedir($dir);
239 + rmdir($dirname);
240 + } else {
241 + @unlink($dirname);
242 + }
243 + }
244 + }
245 +}
This diff is collapsed. Click to expand it.
1 +<?php
2 +class ControllerCommonFooter extends Controller {
3 + public function index() {
4 + $this->load->language('common/footer');
5 +
6 + if ($this->user->isLogged() && isset($this->request->get['user_token']) && ($this->request->get['user_token'] == $this->session->data['user_token'])) {
7 + $data['text_version'] = sprintf($this->language->get('text_version'), VERSION);
8 + } else {
9 + $data['text_version'] = '';
10 + }
11 +
12 + return $this->load->view('common/footer', $data);
13 + }
14 +}
1 +<?php
2 +class ControllerCommonForgotten extends Controller {
3 + private $error = array();
4 +
5 + public function index() {
6 + if ($this->user->isLogged() && isset($this->request->get['user_token']) && ($this->request->get['user_token'] == $this->session->data['user_token'])) {
7 + $this->response->redirect($this->url->link('common/dashboard', '', true));
8 + }
9 +
10 + if (!$this->config->get('config_password')) {
11 + $this->response->redirect($this->url->link('common/login', '', true));
12 + }
13 +
14 + $this->load->language('common/forgotten');
15 +
16 + $this->document->setTitle($this->language->get('heading_title'));
17 +
18 + $this->load->model('user/user');
19 +
20 + if (($this->request->server['REQUEST_METHOD'] == 'POST') && $this->validate()) {
21 + $this->model_user_user->editCode($this->request->post['email'], token(40));
22 +
23 + $this->session->data['success'] = $this->language->get('text_success');
24 +
25 + $this->response->redirect($this->url->link('common/login', '', true));
26 + }
27 +
28 + if (isset($this->error['warning'])) {
29 + $data['error_warning'] = $this->error['warning'];
30 + } else {
31 + $data['error_warning'] = '';
32 + }
33 +
34 + $data['breadcrumbs'] = array();
35 +
36 + $data['breadcrumbs'][] = array(
37 + 'text' => $this->language->get('text_home'),
38 + 'href' => $this->url->link('common/dashboard', '', true)
39 + );
40 +
41 + $data['breadcrumbs'][] = array(
42 + 'text' => $this->language->get('heading_title'),
43 + 'href' => $this->url->link('common/forgotten', 'user_token=' . '', true)
44 + );
45 +
46 + $data['action'] = $this->url->link('common/forgotten', '', true);
47 +
48 + $data['cancel'] = $this->url->link('common/login', '', true);
49 +
50 + if (isset($this->request->post['email'])) {
51 + $data['email'] = $this->request->post['email'];
52 + } else {
53 + $data['email'] = '';
54 + }
55 +
56 + $data['header'] = $this->load->controller('common/header');
57 + $data['footer'] = $this->load->controller('common/footer');
58 +
59 + $this->response->setOutput($this->load->view('common/forgotten', $data));
60 + }
61 +
62 + protected function validate() {
63 + if (!isset($this->request->post['email'])) {
64 + $this->error['warning'] = $this->language->get('error_email');
65 + } elseif (!$this->model_user_user->getTotalUsersByEmail($this->request->post['email'])) {
66 + $this->error['warning'] = $this->language->get('error_email');
67 + }
68 +
69 + return !$this->error;
70 + }
71 +}
1 +<?php
2 +// * @source See SOURCE.txt for source and other copyright.
3 +// * @license GNU General Public License version 3; see LICENSE.txt
4 +
5 +class ControllerCommonHeader extends Controller {
6 + public function index() {
7 + $data['title'] = $this->document->getTitle();
8 +
9 + if ($this->request->server['HTTPS']) {
10 + $data['base'] = HTTPS_SERVER;
11 + } else {
12 + $data['base'] = HTTP_SERVER;
13 + }
14 +
15 + $data['description'] = $this->document->getDescription();
16 + $data['keywords'] = $this->document->getKeywords();
17 + $data['links'] = $this->document->getLinks();
18 + $data['styles'] = $this->document->getStyles();
19 + $data['scripts'] = $this->document->getScripts();
20 + $data['lang'] = $this->language->get('code');
21 + $data['direction'] = $this->language->get('direction');
22 +
23 + $this->load->language('common/header');
24 +
25 + $data['text_logged'] = sprintf($this->language->get('text_logged'), $this->user->getUserName());
26 +
27 + if (!isset($this->request->get['user_token']) || !isset($this->session->data['user_token']) || ($this->request->get['user_token'] != $this->session->data['user_token'])) {
28 + $data['logged'] = '';
29 +
30 + $data['home'] = $this->url->link('common/login', '', true);
31 + } else {
32 + $data['logged'] = true;
33 +
34 + $data['home'] = $this->url->link('common/dashboard', 'user_token=' . $this->session->data['user_token'], true);
35 + $data['logout'] = $this->url->link('common/logout', 'user_token=' . $this->session->data['user_token'], true);
36 + $data['profile'] = $this->url->link('common/profile', 'user_token=' . $this->session->data['user_token'], true);
37 + $data['new_category'] = $this->url->link('catalog/category/add', 'user_token=' . $this->session->data['user_token'], true);
38 + $data['new_customer'] = $this->url->link('user/user/add', 'user_token=' . $this->session->data['user_token'], true);
39 + $data['new_download'] = $this->url->link('catalog/download/add', 'user_token=' . $this->session->data['user_token'], true);
40 + $data['new_manufacturer'] = $this->url->link('catalog/manufacturer/add', 'user_token=' . $this->session->data['user_token'], true);
41 + $data['new_product'] = $this->url->link('catalog/product/add', 'user_token=' . $this->session->data['user_token'], true);
42 +
43 + $this->load->model('user/user');
44 +
45 + $this->load->model('tool/image');
46 +
47 + $user_info = $this->model_user_user->getUser($this->user->getId());
48 +
49 + if ($user_info) {
50 + $data['firstname'] = $user_info['firstname'];
51 + $data['lastname'] = $user_info['lastname'];
52 + $data['username'] = $user_info['username'];
53 + $data['user_group'] = $user_info['user_group'];
54 +
55 + if (is_file(DIR_IMAGE . $user_info['image'])) {
56 + $data['image'] = $this->model_tool_image->resize($user_info['image'], 45, 45);
57 + } else {
58 + $data['image'] = $this->model_tool_image->resize('profile.png', 45, 45);
59 + }
60 + } else {
61 + $data['firstname'] = '';
62 + $data['lastname'] = '';
63 + $data['user_group'] = '';
64 + $data['image'] = '';
65 + }
66 +
67 + // Online Stores
68 + $data['stores'] = array();
69 +
70 + $data['stores'][] = array(
71 + 'name' => $this->config->get('config_name'),
72 + 'href' => HTTP_CATALOG
73 + );
74 +
75 + $this->load->model('setting/store');
76 +
77 + $results = $this->model_setting_store->getStores();
78 +
79 + foreach ($results as $result) {
80 + $data['stores'][] = array(
81 + 'name' => $result['name'],
82 + 'href' => $result['url']
83 + );
84 + }
85 + }
86 +
87 + $data['search'] = $this->load->controller('search/search');
88 +
89 + return $this->load->view('common/header', $data);
90 + }
91 +}
1 +<?php
2 +class ControllerCommonLogin extends Controller {
3 + private $error = array();
4 +
5 + public function index() {
6 + $this->load->language('common/login');
7 +
8 + $this->document->setTitle($this->language->get('heading_title'));
9 +
10 + if ($this->user->isLogged() && isset($this->request->get['user_token']) && ($this->request->get['user_token'] == $this->session->data['user_token'])) {
11 + $this->response->redirect($this->url->link('common/dashboard', 'user_token=' . $this->session->data['user_token'], true));
12 + }
13 +
14 + if (($this->request->server['REQUEST_METHOD'] == 'POST') && $this->validate()) {
15 + $this->session->data['user_token'] = token(32);
16 +
17 + if (isset($this->request->post['redirect']) && (strpos($this->request->post['redirect'], HTTP_SERVER) === 0 || strpos($this->request->post['redirect'], HTTPS_SERVER) === 0)) {
18 + $this->response->redirect($this->request->post['redirect'] . '&user_token=' . $this->session->data['user_token']);
19 + } else {
20 + $this->response->redirect($this->url->link('common/dashboard', 'user_token=' . $this->session->data['user_token'], true));
21 + }
22 + }
23 +
24 + 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']))))) {
25 + $this->error['warning'] = $this->language->get('error_token');
26 + }
27 +
28 + if (isset($this->error['error_attempts'])) {
29 + $data['error_warning'] = $this->error['error_attempts'];
30 + } elseif (isset($this->error['warning'])) {
31 + $data['error_warning'] = $this->error['warning'];
32 + } else {
33 + $data['error_warning'] = '';
34 + }
35 +
36 + if (isset($this->session->data['success'])) {
37 + $data['success'] = $this->session->data['success'];
38 +
39 + unset($this->session->data['success']);
40 + } else {
41 + $data['success'] = '';
42 + }
43 +
44 + $data['action'] = $this->url->link('common/login', '', true);
45 +
46 + if (isset($this->request->post['username'])) {
47 + $data['username'] = $this->request->post['username'];
48 + } else {
49 + $data['username'] = '';
50 + }
51 +
52 + if (isset($this->request->post['password'])) {
53 + $data['password'] = $this->request->post['password'];
54 + } else {
55 + $data['password'] = '';
56 + }
57 +
58 + if (isset($this->request->get['route'])) {
59 + $route = $this->request->get['route'];
60 +
61 + unset($this->request->get['route']);
62 + unset($this->request->get['user_token']);
63 +
64 + $url = '';
65 +
66 + if ($this->request->get) {
67 + $url .= http_build_query($this->request->get);
68 + }
69 +
70 + $data['redirect'] = $this->url->link($route, $url, true);
71 + } else {
72 + $data['redirect'] = '';
73 + }
74 +
75 + if ($this->config->get('config_password')) {
76 + $data['forgotten'] = $this->url->link('common/forgotten', '', true);
77 + } else {
78 + $data['forgotten'] = '';
79 + }
80 +
81 + $data['header'] = $this->load->controller('common/header');
82 + $data['footer'] = $this->load->controller('common/footer');
83 +
84 + $this->response->setOutput($this->load->view('common/login', $data));
85 + }
86 +
87 + protected function validate() {
88 + if(!isset($this->request->post['username']) || !isset($this->request->post['password']) || !$this->request->post['username'] || !$this->request->post['password']) {
89 + $this->error['warning'] = $this->language->get('error_login');
90 + } else {
91 + $this->load->model('user/user');
92 +
93 + // Check how many login attempts have been made.
94 + $login_info = $this->model_user_user->getLoginAttempts($this->request->post['username']);
95 +
96 + if ($login_info && ($login_info['total'] >= $this->config->get('config_login_attempts')) && strtotime('-1 hour') < strtotime($login_info['date_modified'])) {
97 + $this->error['error_attempts'] = $this->language->get('error_attempts');
98 + }
99 + }
100 +
101 + if(!$this->error) {
102 + if (!$this->user->login($this->request->post['username'], html_entity_decode($this->request->post['password'], ENT_QUOTES, 'UTF-8'))) {
103 + $this->error['warning'] = $this->language->get('error_login');
104 +
105 + $this->model_user_user->addLoginAttempt($this->request->post['username']);
106 +
107 + unset($this->session->data['user_token']);
108 + } else {
109 + $this->model_user_user->deleteLoginAttempts($this->request->post['username']);
110 + }
111 + }
112 +
113 + return !$this->error;
114 + }
115 +}
1 +<?php
2 +class ControllerCommonLogout extends Controller {
3 + public function index() {
4 + $this->user->logout();
5 +
6 + unset($this->session->data['user_token']);
7 +
8 + $this->response->redirect($this->url->link('common/login', '', true));
9 + }
10 +}
...\ No newline at end of file ...\ No newline at end of file
1 +<?php
2 +class ControllerCommonProfile extends Controller {
3 + private $error = array();
4 +
5 + public function index() {
6 + $this->load->language('common/profile');
7 +
8 + $this->document->setTitle($this->language->get('heading_title'));
9 +
10 + $this->load->model('user/user');
11 +
12 + if (($this->request->server['REQUEST_METHOD'] == 'POST') && $this->validateForm()) {
13 + $user_data = array_merge($this->request->post, array(
14 + 'user_group_id' => $this->user->getGroupId(),
15 + 'status' => 1,
16 + ));
17 +
18 + $this->model_user_user->editUser($this->user->getId(), $user_data);
19 +
20 + $this->session->data['success'] = $this->language->get('text_success');
21 +
22 + $this->response->redirect($this->url->link('common/profile', 'user_token=' . $this->session->data['user_token'], true));
23 + }
24 +
25 + if (isset($this->session->data['success'])) {
26 + $data['success'] = $this->session->data['success'];
27 +
28 + unset($this->session->data['success']);
29 + } else {
30 + $data['success'] = '';
31 + }
32 +
33 + if (isset($this->error['warning'])) {
34 + $data['error_warning'] = $this->error['warning'];
35 + } else {
36 + $data['error_warning'] = '';
37 + }
38 +
39 + if (isset($this->error['username'])) {
40 + $data['error_username'] = $this->error['username'];
41 + } else {
42 + $data['error_username'] = '';
43 + }
44 +
45 + if (isset($this->error['password'])) {
46 + $data['error_password'] = $this->error['password'];
47 + } else {
48 + $data['error_password'] = '';
49 + }
50 +
51 + if (isset($this->error['confirm'])) {
52 + $data['error_confirm'] = $this->error['confirm'];
53 + } else {
54 + $data['error_confirm'] = '';
55 + }
56 +
57 + if (isset($this->error['firstname'])) {
58 + $data['error_firstname'] = $this->error['firstname'];
59 + } else {
60 + $data['error_firstname'] = '';
61 + }
62 +
63 + if (isset($this->error['lastname'])) {
64 + $data['error_lastname'] = $this->error['lastname'];
65 + } else {
66 + $data['error_lastname'] = '';
67 + }
68 +
69 + if (isset($this->error['email'])) {
70 + $data['error_email'] = $this->error['email'];
71 + } else {
72 + $data['error_email'] = '';
73 + }
74 +
75 + $data['breadcrumbs'] = array();
76 +
77 + $data['breadcrumbs'][] = array(
78 + 'text' => $this->language->get('text_home'),
79 + 'href' => $this->url->link('common/dashboard', 'user_token=' . $this->session->data['user_token'], true)
80 + );
81 +
82 + $data['breadcrumbs'][] = array(
83 + 'text' => $this->language->get('heading_title'),
84 + 'href' => $this->url->link('common/profile', 'user_token=' . $this->session->data['user_token'], true)
85 + );
86 +
87 + $data['action'] = $this->url->link('common/profile', 'user_token=' . $this->session->data['user_token'], true);
88 +
89 + $data['cancel'] = $this->url->link('common/dashboard', 'user_token=' . $this->session->data['user_token'], true);
90 +
91 + if ($this->request->server['REQUEST_METHOD'] != 'POST') {
92 + $user_info = $this->model_user_user->getUser($this->user->getId());
93 + }
94 +
95 + if (isset($this->request->post['username'])) {
96 + $data['username'] = $this->request->post['username'];
97 + } elseif (!empty($user_info)) {
98 + $data['username'] = $user_info['username'];
99 + } else {
100 + $data['username'] = '';
101 + }
102 +
103 + if (isset($this->request->post['password'])) {
104 + $data['password'] = $this->request->post['password'];
105 + } else {
106 + $data['password'] = '';
107 + }
108 +
109 + if (isset($this->request->post['confirm'])) {
110 + $data['confirm'] = $this->request->post['confirm'];
111 + } else {
112 + $data['confirm'] = '';
113 + }
114 +
115 + if (isset($this->request->post['firstname'])) {
116 + $data['firstname'] = $this->request->post['firstname'];
117 + } elseif (!empty($user_info)) {
118 + $data['firstname'] = $user_info['firstname'];
119 + } else {
120 + $data['firstname'] = '';
121 + }
122 +
123 + if (isset($this->request->post['lastname'])) {
124 + $data['lastname'] = $this->request->post['lastname'];
125 + } elseif (!empty($user_info)) {
126 + $data['lastname'] = $user_info['lastname'];
127 + } else {
128 + $data['lastname'] = '';
129 + }
130 +
131 + if (isset($this->request->post['email'])) {
132 + $data['email'] = $this->request->post['email'];
133 + } elseif (!empty($user_info)) {
134 + $data['email'] = $user_info['email'];
135 + } else {
136 + $data['email'] = '';
137 + }
138 +
139 + if (isset($this->request->post['image'])) {
140 + $data['image'] = $this->request->post['image'];
141 + } elseif (!empty($user_info)) {
142 + $data['image'] = $user_info['image'];
143 + } else {
144 + $data['image'] = '';
145 + }
146 +
147 + $this->load->model('tool/image');
148 +
149 + if (isset($this->request->post['image']) && is_file(DIR_IMAGE . $this->request->post['image'])) {
150 + $data['thumb'] = $this->model_tool_image->resize($this->request->post['image'], 100, 100);
151 + } elseif (!empty($user_info) && $user_info['image'] && is_file(DIR_IMAGE . $user_info['image'])) {
152 + $data['thumb'] = $this->model_tool_image->resize($user_info['image'], 100, 100);
153 + } else {
154 + $data['thumb'] = $this->model_tool_image->resize('no_image.png', 100, 100);
155 + }
156 +
157 + $data['placeholder'] = $this->model_tool_image->resize('no_image.png', 100, 100);
158 +
159 + $data['header'] = $this->load->controller('common/header');
160 + $data['column_left'] = $this->load->controller('common/column_left');
161 + $data['footer'] = $this->load->controller('common/footer');
162 +
163 + $this->response->setOutput($this->load->view('common/profile', $data));
164 + }
165 +
166 + protected function validateForm() {
167 + if (!$this->user->hasPermission('modify', 'common/profile')) {
168 + $this->error['warning'] = $this->language->get('error_permission');
169 + }
170 +
171 + if ((utf8_strlen($this->request->post['username']) < 3) || (utf8_strlen($this->request->post['username']) > 20)) {
172 + $this->error['username'] = $this->language->get('error_username');
173 + }
174 +
175 + $user_info = $this->model_user_user->getUserByUsername($this->request->post['username']);
176 +
177 + if ($user_info && ($this->user->getId() != $user_info['user_id'])) {
178 + $this->error['warning'] = $this->language->get('error_exists_username');
179 + }
180 +
181 + if ((utf8_strlen(trim($this->request->post['firstname'])) < 1) || (utf8_strlen(trim($this->request->post['firstname'])) > 32)) {
182 + $this->error['firstname'] = $this->language->get('error_firstname');
183 + }
184 +
185 + if ((utf8_strlen(trim($this->request->post['lastname'])) < 1) || (utf8_strlen(trim($this->request->post['lastname'])) > 32)) {
186 + $this->error['lastname'] = $this->language->get('error_lastname');
187 + }
188 +
189 + if ((utf8_strlen($this->request->post['email']) > 96) || !filter_var($this->request->post['email'], FILTER_VALIDATE_EMAIL)) {
190 + $this->error['email'] = $this->language->get('error_email');
191 + }
192 +
193 + $user_info = $this->model_user_user->getUserByEmail($this->request->post['email']);
194 +
195 + if ($user_info && ($this->user->getId() != $user_info['user_id'])) {
196 + $this->error['warning'] = $this->language->get('error_exists_email');
197 + }
198 +
199 + if ($this->request->post['password']) {
200 + 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)) {
201 + $this->error['password'] = $this->language->get('error_password');
202 + }
203 +
204 + if ($this->request->post['password'] != $this->request->post['confirm']) {
205 + $this->error['confirm'] = $this->language->get('error_confirm');
206 + }
207 + }
208 +
209 + return !$this->error;
210 + }
211 +}
1 +<?php
2 +class ControllerCommonReset extends Controller {
3 + private $error = array();
4 +
5 + public function index() {
6 + if ($this->user->isLogged() && isset($this->request->get['user_token']) && ($this->request->get['user_token'] == $this->session->data['user_token'])) {
7 + $this->response->redirect($this->url->link('common/dashboard', '', true));
8 + }
9 +
10 + if (!$this->config->get('config_password')) {
11 + $this->response->redirect($this->url->link('common/login', '', true));
12 + }
13 +
14 + if (isset($this->request->get['code'])) {
15 + $code = $this->request->get['code'];
16 + } else {
17 + $code = '';
18 + }
19 +
20 + $this->load->model('user/user');
21 +
22 + $user_info = $this->model_user_user->getUserByCode($code);
23 +
24 + if ($user_info) {
25 + $this->load->language('common/reset');
26 +
27 + $this->document->setTitle($this->language->get('heading_title'));
28 +
29 + if (($this->request->server['REQUEST_METHOD'] == 'POST') && $this->validate()) {
30 + $this->model_user_user->editPassword($user_info['user_id'], $this->request->post['password']);
31 +
32 + $this->model_user_user->deleteLoginAttempts($user_info['username']);
33 +
34 + $this->session->data['success'] = $this->language->get('text_success');
35 +
36 + $this->response->redirect($this->url->link('common/login', '', true));
37 + }
38 +
39 + $data['breadcrumbs'] = array();
40 +
41 + $data['breadcrumbs'][] = array(
42 + 'text' => $this->language->get('text_home'),
43 + 'href' => $this->url->link('common/dashboard', '', true)
44 + );
45 +
46 + $data['breadcrumbs'][] = array(
47 + 'text' => $this->language->get('heading_title'),
48 + 'href' => $this->url->link('common/reset', '', true)
49 + );
50 +
51 + if (isset($this->error['password'])) {
52 + $data['error_password'] = $this->error['password'];
53 + } else {
54 + $data['error_password'] = '';
55 + }
56 +
57 + if (isset($this->error['confirm'])) {
58 + $data['error_confirm'] = $this->error['confirm'];
59 + } else {
60 + $data['error_confirm'] = '';
61 + }
62 +
63 + $data['action'] = $this->url->link('common/reset', 'code=' . $code, true);
64 +
65 + $data['cancel'] = $this->url->link('common/login', '', true);
66 +
67 + if (isset($this->request->post['password'])) {
68 + $data['password'] = $this->request->post['password'];
69 + } else {
70 + $data['password'] = '';
71 + }
72 +
73 + if (isset($this->request->post['confirm'])) {
74 + $data['confirm'] = $this->request->post['confirm'];
75 + } else {
76 + $data['confirm'] = '';
77 + }
78 +
79 + $data['header'] = $this->load->controller('common/header');
80 + $data['footer'] = $this->load->controller('common/footer');
81 +
82 + $this->response->setOutput($this->load->view('common/reset', $data));
83 + } else {
84 + $this->load->model('setting/setting');
85 +
86 + $this->model_setting_setting->editSettingValue('config', 'config_password', '0');
87 +
88 + return new Action('common/login');
89 + }
90 + }
91 +
92 + protected function validate() {
93 + 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)) {
94 + $this->error['password'] = $this->language->get('error_password');
95 + }
96 +
97 + if ($this->request->post['confirm'] != $this->request->post['password']) {
98 + $this->error['confirm'] = $this->language->get('error_confirm');
99 + }
100 +
101 + return !$this->error;
102 + }
103 +}
...\ No newline at end of file ...\ No newline at end of file
1 +<?php
2 +class ControllerCommonSecurity extends Controller {
3 + public function index() {
4 + $this->load->language('common/security');
5 +
6 + $data['text_instruction'] = $this->language->get('text_instruction');
7 +
8 + $data['user_token'] = $this->session->data['user_token'];
9 +
10 + $data['storage'] = DIR_SYSTEM . 'storage/';
11 +
12 + $path = '';
13 +
14 + $data['paths'] = array();
15 +
16 + $parts = explode('/', str_replace('\\', '/', rtrim(DIR_SYSTEM, '/')));
17 +
18 + foreach ($parts as $part) {
19 + $path .= $part . '/';
20 +
21 + $data['paths'][] = $path;
22 + }
23 +
24 + rsort($data['paths']);
25 +
26 + $data['document_root'] = str_replace('\\', '/', realpath($this->request->server['DOCUMENT_ROOT'] . '/../') . '/');
27 +
28 + return $this->load->view('common/security', $data);
29 + }
30 +
31 + public function move() {
32 + $this->load->language('common/security');
33 +
34 + $json = array();
35 +
36 + if ($this->request->post['path']) {
37 + $path = $this->request->post['path'];
38 + } else {
39 + $path = '';
40 + }
41 +
42 + if ($this->request->post['directory']) {
43 + $directory = $this->request->post['directory'];
44 + } else {
45 + $directory = '';
46 + }
47 +
48 + if (!$this->user->hasPermission('modify', 'common/security')) {
49 + $json['error'] = $this->language->get('error_permission');
50 + } else {
51 + if (DIR_STORAGE != DIR_SYSTEM . 'storage/') {
52 + $data['error'] = $this->language->get('error_path');
53 + }
54 +
55 + if (!$path || str_replace('\\', '/', realpath($path)) . '/' != str_replace('\\', '/', substr(DIR_SYSTEM, 0, strlen($path)))) {
56 + $json['error'] = $this->language->get('error_path');
57 + }
58 +
59 + if (!$directory || !preg_match('/^[a-zA-Z0-9_-]+$/', $directory)) {
60 + $json['error'] = $this->language->get('error_directory');
61 + }
62 +
63 + if (is_dir($path . $directory)) {
64 + $json['error'] = $this->language->get('error_exists');
65 + }
66 +
67 + if (!is_writable(realpath(DIR_APPLICATION . '/../') . '/config.php') || !is_writable(DIR_APPLICATION . 'config.php')) {
68 + $json['error'] = $this->language->get('error_writable');
69 + }
70 +
71 + if (!$json) {
72 + $files = array();
73 +
74 + // Make path into an array
75 + $source = array(DIR_SYSTEM . 'storage/');
76 +
77 + // While the path array is still populated keep looping through
78 + while (count($source) != 0) {
79 + $next = array_shift($source);
80 +
81 + foreach (glob($next) as $file) {
82 + // If directory add to path array
83 + if (is_dir($file)) {
84 + $source[] = $file . '/*';
85 + }
86 +
87 + // Add the file to the files to be deleted array
88 + $files[] = $file;
89 + }
90 + }
91 +
92 + // Create the new storage folder
93 + if (!is_dir($path . $directory)) {
94 + mkdir($path . $directory, 0777);
95 + }
96 +
97 + // Copy the
98 + foreach ($files as $file) {
99 + $destination = $path . $directory . substr($file, strlen(DIR_SYSTEM . 'storage/'));
100 +
101 + if (is_dir($file) && !is_dir($destination)) {
102 + mkdir($destination, 0777);
103 + }
104 +
105 + if (is_file($file)) {
106 + copy($file, $destination);
107 + }
108 + }
109 +
110 + // Modify the config files
111 + $files = array(
112 + DIR_APPLICATION . 'config.php',
113 + realpath(DIR_APPLICATION . '/../') . '/config.php'
114 + );
115 +
116 + foreach ($files as $file) {
117 + $output = '';
118 +
119 + $lines = file($file);
120 +
121 + foreach ($lines as $line_id => $line) {
122 + if (strpos($line, 'define(\'DIR_STORAGE') !== false) {
123 + $output .= 'define(\'DIR_STORAGE\', \'' . $path . $directory . '/\');' . "\n";
124 + } else {
125 + $output .= $line;
126 + }
127 + }
128 +
129 + $file = fopen($file, 'w');
130 +
131 + fwrite($file, $output);
132 +
133 + fclose($file);
134 + }
135 +
136 + $json['success'] = $this->language->get('text_success');
137 + }
138 + }
139 +
140 + $this->response->addHeader('Content-Type: application/json');
141 + $this->response->setOutput(json_encode($json));
142 + }
143 +}
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
1 +<?php
2 +class ControllerCustomerCustomerApproval extends Controller {
3 + public function index() {
4 + $this->load->language('customer/customer_approval');
5 +
6 + $this->document->setTitle($this->language->get('heading_title'));
7 +
8 + if (isset($this->request->get['filter_name'])) {
9 + $filter_name = $this->request->get['filter_name'];
10 + } else {
11 + $filter_name = '';
12 + }
13 +
14 + if (isset($this->request->get['filter_email'])) {
15 + $filter_email = $this->request->get['filter_email'];
16 + } else {
17 + $filter_email = '';
18 + }
19 +
20 + if (isset($this->request->get['filter_customer_group_id'])) {
21 + $filter_customer_group_id = $this->request->get['filter_customer_group_id'];
22 + } else {
23 + $filter_customer_group_id = '';
24 + }
25 +
26 + if (isset($this->request->get['filter_type'])) {
27 + $filter_type = $this->request->get['filter_type'];
28 + } else {
29 + $filter_type = '';
30 + }
31 +
32 + if (isset($this->request->get['filter_date_added'])) {
33 + $filter_date_added = $this->request->get['filter_date_added'];
34 + } else {
35 + $filter_date_added = '';
36 + }
37 +
38 + $url = '';
39 +
40 + if (isset($this->request->get['filter_name'])) {
41 + $url .= '&filter_name=' . urlencode(html_entity_decode($this->request->get['filter_name'], ENT_QUOTES, 'UTF-8'));
42 + }
43 +
44 + if (isset($this->request->get['filter_email'])) {
45 + $url .= '&filter_email=' . urlencode(html_entity_decode($this->request->get['filter_email'], ENT_QUOTES, 'UTF-8'));
46 + }
47 +
48 + if (isset($this->request->get['filter_customer_group_id'])) {
49 + $url .= '&filter_customer_group_id=' . $this->request->get['filter_customer_group_id'];
50 + }
51 +
52 + if (isset($this->request->get['filter_type'])) {
53 + $url .= '&filter_type=' . $this->request->get['filter_type'];
54 + }
55 +
56 + if (isset($this->request->get['filter_date_added'])) {
57 + $url .= '&filter_date_added=' . $this->request->get['filter_date_added'];
58 + }
59 +
60 + if (isset($this->request->get['page'])) {
61 + $url .= '&page=' . $this->request->get['page'];
62 + }
63 +
64 + $data['breadcrumbs'] = array();
65 +
66 + $data['breadcrumbs'][] = array(
67 + 'text' => $this->language->get('text_home'),
68 + 'href' => $this->url->link('common/dashboard', 'user_token=' . $this->session->data['user_token'], true)
69 + );
70 +
71 + $data['breadcrumbs'][] = array(
72 + 'text' => $this->language->get('heading_title'),
73 + 'href' => $this->url->link('customer/customer_approval', 'user_token=' . $this->session->data['user_token'], true)
74 + );
75 +
76 + $data['filter_name'] = $filter_name;
77 + $data['filter_email'] = $filter_email;
78 + $data['filter_customer_group_id'] = $filter_customer_group_id;
79 + $data['filter_type'] = $filter_type;
80 + $data['filter_date_added'] = $filter_date_added;
81 +
82 + $data['user_token'] = $this->session->data['user_token'];
83 +
84 + $this->load->model('customer/customer_group');
85 +
86 + $data['customer_groups'] = $this->model_customer_customer_group->getCustomerGroups();
87 +
88 + $data['header'] = $this->load->controller('common/header');
89 + $data['column_left'] = $this->load->controller('common/column_left');
90 + $data['footer'] = $this->load->controller('common/footer');
91 +
92 + $this->response->setOutput($this->load->view('customer/customer_approval', $data));
93 + }
94 +
95 + public function customer_approval() {
96 + $this->load->language('customer/customer_approval');
97 +
98 + if (isset($this->request->get['filter_name'])) {
99 + $filter_name = $this->request->get['filter_name'];
100 + } else {
101 + $filter_name = '';
102 + }
103 +
104 + if (isset($this->request->get['filter_email'])) {
105 + $filter_email = $this->request->get['filter_email'];
106 + } else {
107 + $filter_email = '';
108 + }
109 +
110 + if (isset($this->request->get['filter_customer_group_id'])) {
111 + $filter_customer_group_id = $this->request->get['filter_customer_group_id'];
112 + } else {
113 + $filter_customer_group_id = '';
114 + }
115 +
116 + if (isset($this->request->get['filter_type'])) {
117 + $filter_type = $this->request->get['filter_type'];
118 + } else {
119 + $filter_type = '';
120 + }
121 +
122 + if (isset($this->request->get['filter_date_added'])) {
123 + $filter_date_added = $this->request->get['filter_date_added'];
124 + } else {
125 + $filter_date_added = '';
126 + }
127 +
128 + if (isset($this->request->get['page'])) {
129 + $page = (int)$this->request->get['page'];
130 + } else {
131 + $page = 1;
132 + }
133 +
134 + $data['customer_approvals'] = array();
135 +
136 + $filter_data = array(
137 + 'filter_name' => $filter_name,
138 + 'filter_email' => $filter_email,
139 + 'filter_customer_group_id' => $filter_customer_group_id,
140 + 'filter_type' => $filter_type,
141 + 'filter_date_added' => $filter_date_added,
142 + 'start' => ($page - 1) * $this->config->get('config_limit_admin'),
143 + 'limit' => $this->config->get('config_limit_admin')
144 + );
145 +
146 + $this->load->model('customer/customer_approval');
147 +
148 + $customer_approval_total = $this->model_customer_customer_approval->getTotalCustomerApprovals($filter_data);
149 +
150 + $results = $this->model_customer_customer_approval->getCustomerApprovals($filter_data);
151 +
152 + foreach ($results as $result) {
153 + $data['customer_approvals'][] = array(
154 + 'customer_id' => $result['customer_id'],
155 + 'name' => $result['name'],
156 + 'email' => $result['email'],
157 + 'customer_group' => $result['customer_group'],
158 + 'type' => $this->language->get('text_' . $result['type']),
159 + 'date_added' => date($this->language->get('date_format_short'), strtotime($result['date_added'])),
160 + 'approve' => $this->url->link('customer/customer_approval/approve', 'user_token=' . $this->session->data['user_token'] . '&customer_id=' . $result['customer_id'] . '&type=' . $result['type'], true),
161 + 'deny' => $this->url->link('customer/customer_approval/deny', 'user_token=' . $this->session->data['user_token'] . '&customer_id=' . $result['customer_id'] . '&type=' . $result['type'], true),
162 + 'edit' => $this->url->link('customer/customer/edit', 'user_token=' . $this->session->data['user_token'] . '&customer_id=' . $result['customer_id'], true)
163 + );
164 + }
165 +
166 + $url = '';
167 +
168 + if (isset($this->request->get['filter_name'])) {
169 + $url .= '&filter_name=' . urlencode(html_entity_decode($this->request->get['filter_name'], ENT_QUOTES, 'UTF-8'));
170 + }
171 +
172 + if (isset($this->request->get['filter_email'])) {
173 + $url .= '&filter_email=' . urlencode(html_entity_decode($this->request->get['filter_email'], ENT_QUOTES, 'UTF-8'));
174 + }
175 +
176 + if (isset($this->request->get['filter_customer_group_id'])) {
177 + $url .= '&filter_customer_group_id=' . $this->request->get['filter_customer_group_id'];
178 + }
179 +
180 + if (isset($this->request->get['filter_type'])) {
181 + $url .= '&filter_type=' . $this->request->get['filter_type'];
182 + }
183 +
184 + if (isset($this->request->get['filter_date_added'])) {
185 + $url .= '&filter_date_added=' . $this->request->get['filter_date_added'];
186 + }
187 +
188 + $pagination = new Pagination();
189 + $pagination->total = $customer_approval_total;
190 + $pagination->page = $page;
191 + $pagination->limit = $this->config->get('config_limit_admin');
192 + $pagination->url = $this->url->link('customer/customer_approval/customer_approval', 'user_token=' . $this->session->data['user_token'] . $url . '&page={page}', true);
193 +
194 + $data['pagination'] = $pagination->render();
195 +
196 + $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')));
197 +
198 + $this->response->setOutput($this->load->view('customer/customer_approval_list', $data));
199 + }
200 +
201 + public function approve() {
202 + $this->load->language('customer/customer_approval');
203 +
204 + $json = array();
205 +
206 + if (!$this->user->hasPermission('modify', 'customer/customer_approval')) {
207 + $json['error'] = $this->language->get('error_permission');
208 + } else {
209 + $this->load->model('customer/customer_approval');
210 +
211 + if ($this->request->get['type'] == 'customer') {
212 + $this->model_customer_customer_approval->approveCustomer($this->request->get['customer_id']);
213 + } elseif ($this->request->get['type'] == 'affiliate') {
214 + $this->model_customer_customer_approval->approveAffiliate($this->request->get['customer_id']);
215 + }
216 +
217 + $json['success'] = $this->language->get('text_success');
218 + }
219 +
220 + $this->response->addHeader('Content-Type: application/json');
221 + $this->response->setOutput(json_encode($json));
222 + }
223 +
224 + public function deny() {
225 + $this->load->language('customer/customer_approval');
226 +
227 + $json = array();
228 +
229 + if (!$this->user->hasPermission('modify', 'customer/customer_approval')) {
230 + $json['error'] = $this->language->get('error_permission');
231 + } else {
232 + $this->load->model('customer/customer_approval');
233 +
234 + if ($this->request->get['type'] == 'customer') {
235 + $this->model_customer_customer_approval->denyCustomer($this->request->get['customer_id']);
236 + } elseif ($this->request->get['type'] == 'affiliate') {
237 + $this->model_customer_customer_approval->denyAffiliate($this->request->get['customer_id']);
238 + }
239 +
240 + $json['success'] = $this->language->get('text_success');
241 + }
242 +
243 + $this->response->addHeader('Content-Type: application/json');
244 + $this->response->setOutput(json_encode($json));
245 + }
246 +}
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
1 +<?php
2 +class ControllerDesignTheme extends Controller {
3 + public function index() {
4 + $this->load->language('design/theme');
5 +
6 + $this->document->setTitle($this->language->get('heading_title'));
7 +
8 + $data['breadcrumbs'] = array();
9 +
10 + $data['breadcrumbs'][] = array(
11 + 'text' => $this->language->get('text_home'),
12 + 'href' => $this->url->link('common/dashboard', 'user_token=' . $this->session->data['user_token'], true)
13 + );
14 +
15 + $data['breadcrumbs'][] = array(
16 + 'text' => $this->language->get('heading_title'),
17 + 'href' => $this->url->link('design/theme', 'user_token=' . $this->session->data['user_token'], true)
18 + );
19 +
20 + $data['user_token'] = $this->session->data['user_token'];
21 +
22 + $data['stores'] = array();
23 +
24 + $this->load->model('setting/store');
25 +
26 + $results = $this->model_setting_store->getStores();
27 +
28 + foreach ($results as $result) {
29 + $data['stores'][] = array(
30 + 'store_id' => $result['store_id'],
31 + 'name' => $result['name']
32 + );
33 + }
34 +
35 + $data['header'] = $this->load->controller('common/header');
36 + $data['column_left'] = $this->load->controller('common/column_left');
37 + $data['footer'] = $this->load->controller('common/footer');
38 +
39 + $this->response->setOutput($this->load->view('design/theme', $data));
40 + }
41 +
42 + public function history() {
43 + $this->load->language('design/theme');
44 +
45 + if (isset($this->request->get['page'])) {
46 + $page = (int)$this->request->get['page'];
47 + } else {
48 + $page = 1;
49 + }
50 +
51 + $data['histories'] = array();
52 +
53 + $this->load->model('design/theme');
54 + $this->load->model('setting/store');
55 +
56 + $history_total = $this->model_design_theme->getTotalThemes();
57 +
58 + $results = $this->model_design_theme->getThemes(($page - 1) * 10, 10);
59 +
60 + foreach ($results as $result) {
61 + $store_info = $this->model_setting_store->getStore($result['store_id']);
62 +
63 + if ($store_info) {
64 + $store = $store_info['name'];
65 + } else {
66 + $store = '';
67 + }
68 +
69 + $data['histories'][] = array(
70 + 'store_id' => $result['store_id'],
71 + 'store' => ($result['store_id'] ? $store : $this->language->get('text_default')),
72 + 'route' => $result['route'],
73 + 'theme' => $result['theme'],
74 + 'date_added' => date($this->language->get('date_format_short'), strtotime($result['date_added'])),
75 + 'edit' => $this->url->link('design/theme/template', 'user_token=' . $this->session->data['user_token'], true),
76 + 'delete' => $this->url->link('design/theme/delete', 'user_token=' . $this->session->data['user_token'] . '&theme_id=' . $result['theme_id'], true)
77 + );
78 + }
79 +
80 + $pagination = new Pagination();
81 + $pagination->total = $history_total;
82 + $pagination->page = $page;
83 + $pagination->limit = 10;
84 + $pagination->url = $this->url->link('design/theme/history', 'user_token=' . $this->session->data['user_token'] . '&page={page}', true);
85 +
86 + $data['pagination'] = $pagination->render();
87 +
88 + $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));
89 +
90 + $this->response->setOutput($this->load->view('design/theme_history', $data));
91 + }
92 +
93 + public function path() {
94 + $this->load->language('design/theme');
95 +
96 + $json = array();
97 +
98 + if (isset($this->request->get['store_id'])) {
99 + $store_id = $this->request->get['store_id'];
100 + } else {
101 + $store_id = 0;
102 + }
103 +
104 + $this->load->model('setting/setting');
105 +
106 + $theme = $this->model_setting_setting->getSettingValue('config_theme', $store_id);
107 +
108 + // This is only here for compatibility with old themes.
109 + if ($theme == 'theme_default') {
110 + $theme = $this->model_setting_setting->getSettingValue('theme_default_directory', $store_id);
111 + }
112 +
113 + if (isset($this->request->get['path'])) {
114 + $path = $this->request->get['path'];
115 + } else {
116 + $path = '';
117 + }
118 +
119 + if (substr(str_replace('\\', '/', realpath(DIR_CATALOG . 'view/theme/default/template/' . $path)), 0, strlen(DIR_CATALOG . 'view')) == DIR_CATALOG . 'view') {
120 + $path_data = array();
121 +
122 + // 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.
123 + $files = glob(rtrim(DIR_CATALOG . 'view/theme/{default,' . $theme . '}/template/' . $path, '/') . '/*', GLOB_BRACE);
124 +
125 + if ($files) {
126 + foreach($files as $file) {
127 + if (!in_array(basename($file), $path_data)) {
128 + if (is_dir($file)) {
129 + $json['directory'][] = array(
130 + 'name' => basename($file),
131 + 'path' => trim($path . '/' . basename($file), '/')
132 + );
133 + }
134 +
135 + if (is_file($file)) {
136 + $json['file'][] = array(
137 + 'name' => basename($file),
138 + 'path' => trim($path . '/' . basename($file), '/')
139 + );
140 + }
141 +
142 + $path_data[] = basename($file);
143 + }
144 + }
145 + }
146 + }
147 +
148 + if (!empty($this->request->get['path'])) {
149 + $json['back'] = array(
150 + 'name' => $this->language->get('button_back'),
151 + 'path' => urlencode(substr($path, 0, strrpos($path, '/'))),
152 + );
153 + }
154 +
155 + $this->response->addHeader('Content-Type: application/json');
156 + $this->response->setOutput(json_encode($json));
157 + }
158 +
159 + public function template() {
160 + $this->load->language('design/theme');
161 +
162 + $json = array();
163 +
164 + if (isset($this->request->get['store_id'])) {
165 + $store_id = $this->request->get['store_id'];
166 + } else {
167 + $store_id = 0;
168 + }
169 +
170 + $this->load->model('setting/setting');
171 +
172 + $theme = $this->model_setting_setting->getSettingValue('config_theme', $store_id);
173 +
174 + // This is only here for compatibility with old themes.
175 + if ($theme == 'theme_default') {
176 + $theme = $this->model_setting_setting->getSettingValue('theme_default_directory', $store_id);
177 + }
178 +
179 + if (isset($this->request->get['path'])) {
180 + $path = $this->request->get['path'];
181 + } else {
182 + $path = '';
183 + }
184 +
185 + $this->load->model('design/theme');
186 +
187 + $theme_info = $this->model_design_theme->getTheme($store_id, $theme, $path);
188 +
189 + if ($theme_info) {
190 + $json['code'] = html_entity_decode($theme_info['code']);
191 + } 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')) {
192 + $json['code'] = file_get_contents(DIR_CATALOG . 'view/theme/' . $theme . '/template/' . $path);
193 + } 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')) {
194 + $json['code'] = file_get_contents(DIR_CATALOG . 'view/theme/default/template/' . $path);
195 + }
196 +
197 + $this->response->addHeader('Content-Type: application/json');
198 + $this->response->setOutput(json_encode($json));
199 + }
200 +
201 + public function save() {
202 + $this->load->language('design/theme');
203 +
204 + $json = array();
205 +
206 + if (isset($this->request->get['store_id'])) {
207 + $store_id = $this->request->get['store_id'];
208 + } else {
209 + $store_id = 0;
210 + }
211 +
212 + $this->load->model('setting/setting');
213 +
214 + $theme = $this->model_setting_setting->getSettingValue('config_theme', $store_id);
215 +
216 + // This is only here for compatibility with old themes.
217 + if ($theme == 'theme_default') {
218 + $theme = $this->model_setting_setting->getSettingValue('theme_default_directory', $store_id);
219 + }
220 +
221 + if (isset($this->request->get['path'])) {
222 + $path = $this->request->get['path'];
223 + } else {
224 + $path = '';
225 + }
226 +
227 + // Check user has permission
228 + if (!$this->user->hasPermission('modify', 'design/theme')) {
229 + $json['error'] = $this->language->get('error_permission');
230 + }
231 +
232 + if (substr($path, -5) != '.twig') {
233 + $json['error'] = $this->language->get('error_twig');
234 + }
235 +
236 + if (!$json) {
237 + $this->load->model('design/theme');
238 +
239 + $pos = strpos($path, '.');
240 +
241 + $this->model_design_theme->editTheme($store_id, $theme, ($pos !== false) ? substr($path, 0, $pos) : $path, $this->request->post['code']);
242 +
243 + $json['success'] = $this->language->get('text_success');
244 + }
245 +
246 + $this->response->addHeader('Content-Type: application/json');
247 + $this->response->setOutput(json_encode($json));
248 + }
249 +
250 + public function reset() {
251 + $this->load->language('design/theme');
252 +
253 + $json = array();
254 +
255 + if (isset($this->request->get['store_id'])) {
256 + $store_id = $this->request->get['store_id'];
257 + } else {
258 + $store_id = 0;
259 + }
260 +
261 + $this->load->model('setting/setting');
262 +
263 + $theme = $this->model_setting_setting->getSettingValue('config_theme', $store_id);
264 +
265 + // This is only here for compatibility with old themes.
266 + if ($theme == 'theme_default') {
267 + $theme = $this->model_setting_setting->getSettingValue('theme_default_directory', $store_id);
268 + }
269 +
270 + if (isset($this->request->get['path'])) {
271 + $path = $this->request->get['path'];
272 + } else {
273 + $path = '';
274 + }
275 +
276 + 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')) {
277 + $json['code'] = file_get_contents(DIR_CATALOG . 'view/theme/' . $theme . '/template/' . $path);
278 + }
279 +
280 + $this->response->addHeader('Content-Type: application/json');
281 + $this->response->setOutput(json_encode($json));
282 + }
283 +
284 + public function delete() {
285 + $this->load->language('design/theme');
286 +
287 + $json = array();
288 +
289 + if (isset($this->request->get['theme_id'])) {
290 + $theme_id = $this->request->get['theme_id'];
291 + } else {
292 + $theme_id = 0;
293 + }
294 +
295 + // Check user has permission
296 + if (!$this->user->hasPermission('modify', 'design/theme')) {
297 + $json['error'] = $this->language->get('error_permission');
298 + }
299 +
300 + if (!$json) {
301 + $this->load->model('design/theme');
302 +
303 + $this->model_design_theme->deleteTheme($theme_id);
304 +
305 + $json['success'] = $this->language->get('text_success');
306 + }
307 +
308 + $this->response->addHeader('Content-Type: application/json');
309 + $this->response->setOutput(json_encode($json));
310 + }
311 +}
This diff is collapsed. Click to expand it.
1 +<?php
2 +class ControllerErrorNotFound extends Controller {
3 + public function index() {
4 + $this->load->language('error/not_found');
5 +
6 + $this->document->setTitle($this->language->get('heading_title'));
7 +
8 + $data['breadcrumbs'] = array();
9 +
10 + $data['breadcrumbs'][] = array(
11 + 'text' => $this->language->get('text_home'),
12 + 'href' => $this->url->link('common/dashboard', 'user_token=' . $this->session->data['user_token'], true)
13 + );
14 +
15 + $data['breadcrumbs'][] = array(
16 + 'text' => $this->language->get('heading_title'),
17 + 'href' => $this->url->link('error/not_found', 'user_token=' . $this->session->data['user_token'], true)
18 + );
19 +
20 + $data['header'] = $this->load->controller('common/header');
21 + $data['column_left'] = $this->load->controller('common/column_left');
22 + $data['footer'] = $this->load->controller('common/footer');
23 +
24 + $this->response->setOutput($this->load->view('error/not_found', $data));
25 + }
26 +}
1 +<?php
2 +class ControllerErrorPermission extends Controller {
3 + public function index() {
4 + $this->load->language('error/permission');
5 +
6 + $this->document->setTitle($this->language->get('heading_title'));
7 +
8 + $data['breadcrumbs'] = array();
9 +
10 + $data['breadcrumbs'][] = array(
11 + 'text' => $this->language->get('text_home'),
12 + 'href' => $this->url->link('common/dashboard', 'user_token=' . $this->session->data['user_token'], true)
13 + );
14 +
15 + $data['breadcrumbs'][] = array(
16 + 'text' => $this->language->get('heading_title'),
17 + 'href' => $this->url->link($this->request->get['route'], 'user_token=' . $this->session->data['user_token'], true)
18 + );
19 +
20 + $data['header'] = $this->load->controller('common/header');
21 + $data['column_left'] = $this->load->controller('common/column_left');
22 + $data['footer'] = $this->load->controller('common/footer');
23 +
24 + $this->response->setOutput($this->load->view('error/permission', $data));
25 + }
26 +}
1 +<?php
2 +class ControllerEventLanguage extends Controller {
3 + public function index(&$route, &$args) {
4 + foreach ($this->language->all() as $key => $value) {
5 + if (!isset($args[$key])) {
6 + $args[$key] = $value;
7 + }
8 + }
9 + }
10 +
11 + // 1. Before controller load store all current loaded language data
12 + public function before(&$route, &$output) {
13 + $this->language->set('backup', $this->language->all());
14 + }
15 +
16 + // 2. After contoller load restore old language data
17 + public function after(&$route, &$args, &$output) {
18 + $data = $this->language->get('backup');
19 +
20 + if (is_array($data)) {
21 + foreach ($data as $key => $value) {
22 + $this->language->set($key, $value);
23 + }
24 + }
25 + }
26 +}
1 +<?php
2 +class ControllerEventStatistics extends Controller {
3 + // model/catalog/review/removeReview/after
4 + public function removeReview(&$route, &$args, &$output) {
5 + $this->load->model('setting/statistics');
6 +
7 + $this->model_report_statistics->addValue('review', 1);
8 + }
9 +
10 + // model/sale/return/removeReturn/after
11 + public function removeReturn(&$route, &$args, &$output) {
12 + $this->load->model('setting/statistics');
13 +
14 + $this->model_report_statistics->addValue('return', 1);
15 + }
16 +}
1 +<?php
2 +class ControllerEventTheme extends Controller {
3 + public function index(&$route, &$args) {
4 + // This is only here for compatibility with old templates
5 + if (substr($route, -3) == 'tpl') {
6 + $view = substr($route, 0, -3);
7 + }
8 +
9 + if (is_file(DIR_TEMPLATE . $route . '.twig')) {
10 + $this->config->set('template_engine', 'twig');
11 + } elseif (is_file(DIR_TEMPLATE . $route . '.tpl')) {
12 + $this->config->set('template_engine', 'template');
13 + }
14 + }
15 +}
This diff could not be displayed because it is too large.
1 +<?php
2 +class ControllerExtensionAnalyticsGoogle extends Controller {
3 + private $error = array();
4 +
5 + public function index() {
6 + $this->load->language('extension/analytics/google');
7 +
8 + $this->document->setTitle($this->language->get('heading_title'));
9 +
10 + $this->load->model('setting/setting');
11 +
12 + if (($this->request->server['REQUEST_METHOD'] == 'POST') && $this->validate()) {
13 + $this->model_setting_setting->editSetting('analytics_google', $this->request->post, $this->request->get['store_id']);
14 +
15 + $this->session->data['success'] = $this->language->get('text_success');
16 +
17 + $this->response->redirect($this->url->link('marketplace/extension', 'user_token=' . $this->session->data['user_token'] . '&type=analytics', true));
18 + }
19 +
20 + if (isset($this->error['warning'])) {
21 + $data['error_warning'] = $this->error['warning'];
22 + } else {
23 + $data['error_warning'] = '';
24 + }
25 +
26 + if (isset($this->error['code'])) {
27 + $data['error_code'] = $this->error['code'];
28 + } else {
29 + $data['error_code'] = '';
30 + }
31 +
32 + $data['breadcrumbs'] = array();
33 +
34 + $data['breadcrumbs'][] = array(
35 + 'text' => $this->language->get('text_home'),
36 + 'href' => $this->url->link('common/dashboard', 'user_token=' . $this->session->data['user_token'], true)
37 + );
38 +
39 + $data['breadcrumbs'][] = array(
40 + 'text' => $this->language->get('text_extension'),
41 + 'href' => $this->url->link('marketplace/extension', 'user_token=' . $this->session->data['user_token'] . '&type=analytics', true)
42 + );
43 +
44 + $data['breadcrumbs'][] = array(
45 + 'text' => $this->language->get('heading_title'),
46 + 'href' => $this->url->link('extension/analytics/google', 'user_token=' . $this->session->data['user_token'] . '&store_id=' . $this->request->get['store_id'], true)
47 + );
48 +
49 + $data['action'] = $this->url->link('extension/analytics/google', 'user_token=' . $this->session->data['user_token'] . '&store_id=' . $this->request->get['store_id'], true);
50 +
51 + $data['cancel'] = $this->url->link('marketplace/extension', 'user_token=' . $this->session->data['user_token'] . '&type=analytics', true);
52 +
53 + $data['user_token'] = $this->session->data['user_token'];
54 +
55 + if (isset($this->request->post['analytics_google_code'])) {
56 + $data['analytics_google_code'] = $this->request->post['analytics_google_code'];
57 + } else {
58 + $data['analytics_google_code'] = $this->model_setting_setting->getSettingValue('analytics_google_code', $this->request->get['store_id']);
59 + }
60 +
61 + if (isset($this->request->post['analytics_google_status'])) {
62 + $data['analytics_google_status'] = $this->request->post['analytics_google_status'];
63 + } else {
64 + $data['analytics_google_status'] = $this->model_setting_setting->getSettingValue('analytics_google_status', $this->request->get['store_id']);
65 + }
66 +
67 + $data['header'] = $this->load->controller('common/header');
68 + $data['column_left'] = $this->load->controller('common/column_left');
69 + $data['footer'] = $this->load->controller('common/footer');
70 +
71 + $this->response->setOutput($this->load->view('extension/analytics/google', $data));
72 + }
73 +
74 + protected function validate() {
75 + if (!$this->user->hasPermission('modify', 'extension/analytics/google')) {
76 + $this->error['warning'] = $this->language->get('error_permission');
77 + }
78 +
79 + if (!$this->request->post['analytics_google_code']) {
80 + $this->error['code'] = $this->language->get('error_code');
81 + }
82 +
83 + return !$this->error;
84 + }
85 +}
1 +<?php
2 +class ControllerExtensionCaptchaBasic extends Controller {
3 + private $error = array();
4 +
5 + public function index() {
6 + $this->load->language('extension/captcha/basic');
7 +
8 + $this->document->setTitle($this->language->get('heading_title'));
9 +
10 + $this->load->model('setting/setting');
11 +
12 + if (($this->request->server['REQUEST_METHOD'] == 'POST') && $this->validate()) {
13 + $this->model_setting_setting->editSetting('captcha_basic', $this->request->post);
14 +
15 + $this->session->data['success'] = $this->language->get('text_success');
16 +
17 + $this->response->redirect($this->url->link('marketplace/extension', 'user_token=' . $this->session->data['user_token'] . '&type=captcha', true));
18 + }
19 +
20 + if (isset($this->error['warning'])) {
21 + $data['error_warning'] = $this->error['warning'];
22 + } else {
23 + $data['error_warning'] = '';
24 + }
25 +
26 + $data['breadcrumbs'] = array();
27 +
28 + $data['breadcrumbs'][] = array(
29 + 'text' => $this->language->get('text_home'),
30 + 'href' => $this->url->link('common/dashboard', 'user_token=' . $this->session->data['user_token'], true)
31 + );
32 +
33 + $data['breadcrumbs'][] = array(
34 + 'text' => $this->language->get('text_extension'),
35 + 'href' => $this->url->link('marketplace/extension', 'user_token=' . $this->session->data['user_token'] . '&type=captcha', true)
36 + );
37 +
38 + $data['breadcrumbs'][] = array(
39 + 'text' => $this->language->get('heading_title'),
40 + 'href' => $this->url->link('extension/captcha/basic', 'user_token=' . $this->session->data['user_token'], true)
41 + );
42 +
43 + $data['action'] = $this->url->link('extension/captcha/basic', 'user_token=' . $this->session->data['user_token'], true);
44 +
45 + $data['cancel'] = $this->url->link('marketplace/extension', 'user_token=' . $this->session->data['user_token'] . '&type=captcha', true);
46 +
47 + if (isset($this->request->post['captcha_basic_status'])) {
48 + $data['captcha_basic_status'] = $this->request->post['captcha_basic_status'];
49 + } else {
50 + $data['captcha_basic_status'] = $this->config->get('captcha_basic_status');
51 + }
52 +
53 + $data['header'] = $this->load->controller('common/header');
54 + $data['column_left'] = $this->load->controller('common/column_left');
55 + $data['footer'] = $this->load->controller('common/footer');
56 +
57 + $this->response->setOutput($this->load->view('extension/captcha/basic', $data));
58 + }
59 +
60 + protected function validate() {
61 + if (!$this->user->hasPermission('modify', 'extension/captcha/basic')) {
62 + $this->error['warning'] = $this->language->get('error_permission');
63 + }
64 +
65 + return !$this->error;
66 + }
67 +}
1 +<?php
2 +class ControllerExtensionCaptchaGoogle extends Controller {
3 + private $error = array();
4 +
5 + public function index() {
6 + $this->load->language('extension/captcha/google');
7 +
8 + $this->document->setTitle($this->language->get('heading_title'));
9 +
10 + $this->load->model('setting/setting');
11 +
12 + if (($this->request->server['REQUEST_METHOD'] == 'POST') && $this->validate()) {
13 + $this->model_setting_setting->editSetting('captcha_google', $this->request->post);
14 +
15 + $this->session->data['success'] = $this->language->get('text_success');
16 +
17 + $this->response->redirect($this->url->link('marketplace/extension', 'user_token=' . $this->session->data['user_token'] . '&type=captcha', true));
18 + }
19 +
20 + if (isset($this->error['warning'])) {
21 + $data['error_warning'] = $this->error['warning'];
22 + } else {
23 + $data['error_warning'] = '';
24 + }
25 +
26 + if (isset($this->error['key'])) {
27 + $data['error_key'] = $this->error['key'];
28 + } else {
29 + $data['error_key'] = '';
30 + }
31 +
32 + if (isset($this->error['secret'])) {
33 + $data['error_secret'] = $this->error['secret'];
34 + } else {
35 + $data['error_secret'] = '';
36 + }
37 +
38 + $data['breadcrumbs'] = array();
39 +
40 + $data['breadcrumbs'][] = array(
41 + 'text' => $this->language->get('text_home'),
42 + 'href' => $this->url->link('common/dashboard', 'user_token=' . $this->session->data['user_token'], true)
43 + );
44 +
45 + $data['breadcrumbs'][] = array(
46 + 'text' => $this->language->get('text_extension'),
47 + 'href' => $this->url->link('marketplace/extension', 'user_token=' . $this->session->data['user_token'] . '&type=captcha', true)
48 + );
49 +
50 + $data['breadcrumbs'][] = array(
51 + 'text' => $this->language->get('heading_title'),
52 + 'href' => $this->url->link('extension/captcha/google', 'user_token=' . $this->session->data['user_token'], true)
53 + );
54 +
55 + $data['action'] = $this->url->link('extension/captcha/google', 'user_token=' . $this->session->data['user_token'], true);
56 +
57 + $data['cancel'] = $this->url->link('marketplace/extension', 'user_token=' . $this->session->data['user_token'] . '&type=captcha', true);
58 +
59 + if (isset($this->request->post['captcha_google_key'])) {
60 + $data['captcha_google_key'] = $this->request->post['captcha_google_key'];
61 + } else {
62 + $data['captcha_google_key'] = $this->config->get('captcha_google_key');
63 + }
64 +
65 + if (isset($this->request->post['captcha_google_secret'])) {
66 + $data['captcha_google_secret'] = $this->request->post['captcha_google_secret'];
67 + } else {
68 + $data['captcha_google_secret'] = $this->config->get('captcha_google_secret');
69 + }
70 +
71 + if (isset($this->request->post['captcha_google_status'])) {
72 + $data['captcha_google_status'] = $this->request->post['captcha_google_status'];
73 + } else {
74 + $data['captcha_google_status'] = $this->config->get('captcha_google_status');
75 + }
76 +
77 + $data['header'] = $this->load->controller('common/header');
78 + $data['column_left'] = $this->load->controller('common/column_left');
79 + $data['footer'] = $this->load->controller('common/footer');
80 +
81 + $this->response->setOutput($this->load->view('extension/captcha/google', $data));
82 + }
83 +
84 + protected function validate() {
85 + if (!$this->user->hasPermission('modify', 'extension/captcha/google')) {
86 + $this->error['warning'] = $this->language->get('error_permission');
87 + }
88 +
89 + if (!$this->request->post['captcha_google_key']) {
90 + $this->error['key'] = $this->language->get('error_key');
91 + }
92 +
93 + if (!$this->request->post['captcha_google_secret']) {
94 + $this->error['secret'] = $this->language->get('error_secret');
95 + }
96 +
97 + return !$this->error;
98 + }
99 +}
1 +<?php
2 +class ControllerExtensionCurrencyCbr extends Controller {
3 + private $error = array();
4 +
5 + public function index() {
6 + $this->load->language('extension/currency/cbr');
7 +
8 + $this->document->setTitle($this->language->get('heading_title'));
9 +
10 + $this->load->model('setting/setting');
11 +
12 + if (($this->request->server['REQUEST_METHOD'] == 'POST') && $this->validate()) {
13 + $this->model_setting_setting->editSetting('currency_cbr', $this->request->post);
14 +
15 + $this->session->data['success'] = $this->language->get('text_success');
16 +
17 + $this->response->redirect($this->url->link('marketplace/extension', 'user_token=' . $this->session->data['user_token'] . '&type=currency'));
18 + }
19 +
20 + $data['heading_title'] = $this->language->get('heading_title');
21 +
22 + $data['text_edit'] = $this->language->get('text_edit');
23 + $data['text_enabled'] = $this->language->get('text_enabled');
24 + $data['text_disabled'] = $this->language->get('text_disabled');
25 +
26 + $data['entry_status'] = $this->language->get('entry_status');
27 +
28 + $data['button_save'] = $this->language->get('button_save');
29 + $data['button_cancel'] = $this->language->get('button_cancel');
30 +
31 + if (isset($this->error['warning'])) {
32 + $data['error_warning'] = $this->error['warning'];
33 + } else {
34 + $data['error_warning'] = '';
35 + }
36 +
37 + $data['breadcrumbs'] = [];
38 +
39 + $data['breadcrumbs'][] = [
40 + 'text' => $this->language->get('text_home'),
41 + 'href' => $this->url->link('common/dashboard', 'user_token=' . $this->session->data['user_token'])
42 + ];
43 +
44 + $data['breadcrumbs'][] = [
45 + 'text' => $this->language->get('text_extension'),
46 + 'href' => $this->url->link('marketplace/extension', 'user_token=' . $this->session->data['user_token'] . '&type=currency')
47 + ];
48 +
49 + $data['breadcrumbs'][] = [
50 + 'text' => $this->language->get('heading_title'),
51 + 'href' => $this->url->link('extension/currency/cbr', 'user_token=' . $this->session->data['user_token'])
52 + ];
53 +
54 + $data['action'] = $this->url->link('extension/currency/cbr', 'user_token=' . $this->session->data['user_token']);
55 +
56 + $data['cancel'] = $this->url->link('marketplace/extension', 'user_token=' . $this->session->data['user_token'] . '&type=currency');
57 +
58 + if (isset($this->request->post['currency_cbr_status'])) {
59 + $data['currency_cbr_status'] = $this->request->post['currency_cbr_status'];
60 + } else {
61 + $data['currency_cbr_status'] = $this->config->get('currency_cbr_status');
62 + }
63 +
64 + $data['header'] = $this->load->controller('common/header');
65 + $data['column_left'] = $this->load->controller('common/column_left');
66 + $data['footer'] = $this->load->controller('common/footer');
67 +
68 + $this->response->setOutput($this->load->view('extension/currency/cbr', $data));
69 + }
70 +
71 + protected function validate() {
72 + if (!$this->user->hasPermission('modify', 'extension/currency/cbr')) {
73 + $this->error['warning'] = $this->language->get('error_permission');
74 + }
75 +
76 + return !$this->error;
77 + }
78 +
79 + public function currency($default = '') {
80 + if ($this->config->get('currency_cbr_status')) {
81 + $curl = curl_init();
82 +
83 + curl_setopt($curl, CURLOPT_URL, 'https://www.cbr.ru/scripts/XML_daily.asp');
84 + curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
85 + curl_setopt($curl, CURLOPT_HEADER, false);
86 + curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, 0);
87 + curl_setopt($curl, CURLOPT_CONNECTTIMEOUT, 30);
88 + curl_setopt($curl, CURLOPT_TIMEOUT, 30);
89 +
90 + $response = curl_exec($curl);
91 +
92 + curl_close($curl);
93 +
94 +
95 + if ($response) {
96 + $dom = new \DOMDocument('1.0', 'UTF-8');
97 + $dom->loadXml($response);
98 +
99 + $currencies = array();
100 +
101 + $currencies['RUB'] = 1.0000;
102 +
103 + $root = $dom->documentElement;
104 + $items = $root->getElementsByTagName('Valute');
105 +
106 +
107 + foreach ($items as $item)
108 + {
109 + $code = $item->getElementsByTagName('CharCode')->item(0)->nodeValue;
110 + $curs = str_replace(',', '.', $item->getElementsByTagName('Value')->item(0)->nodeValue);
111 + $nominal = $item->getElementsByTagName('Nominal')->item(0)->nodeValue;
112 + $currencies[$code] = floatval($curs/$nominal);
113 + }
114 +
115 +
116 + if ($currencies) {
117 + $this->load->model('localisation/currency');
118 +
119 + $results = $this->model_localisation_currency->getCurrencies();
120 +
121 + foreach ($results as $result) {
122 + if (isset($currencies[$result['code']])) {
123 + $from = $currencies['RUB'];
124 +
125 + $to = $currencies[$result['code']];
126 +
127 + $this->model_localisation_currency->editValueByCode($result['code'], ($currencies[$default] * ($from / $to)));
128 + }
129 + }
130 + }
131 +
132 + $this->model_localisation_currency->editValueByCode($default, '1.00000');
133 +
134 + $this->cache->delete('currency');
135 + }
136 + }
137 + }
138 +}
1 +<?php
2 +class ControllerExtensionCurrencyEcb extends Controller {
3 + private $error = array();
4 +
5 + public function index() {
6 + $this->load->language('extension/currency/ecb');
7 +
8 + $this->document->setTitle($this->language->get('heading_title'));
9 +
10 + $this->load->model('setting/setting');
11 +
12 + if (($this->request->server['REQUEST_METHOD'] == 'POST') && $this->validate()) {
13 + $this->model_setting_setting->editSetting('currency_ecb', $this->request->post);
14 +
15 + $this->session->data['success'] = $this->language->get('text_success');
16 +
17 + $this->response->redirect($this->url->link('marketplace/extension', 'user_token=' . $this->session->data['user_token'] . '&type=currency'));
18 + }
19 +
20 + $data['heading_title'] = $this->language->get('heading_title');
21 +
22 + $data['text_edit'] = $this->language->get('text_edit');
23 + $data['text_enabled'] = $this->language->get('text_enabled');
24 + $data['text_disabled'] = $this->language->get('text_disabled');
25 +
26 + $data['entry_status'] = $this->language->get('entry_status');
27 +
28 + $data['button_save'] = $this->language->get('button_save');
29 + $data['button_cancel'] = $this->language->get('button_cancel');
30 +
31 + if (isset($this->error['warning'])) {
32 + $data['error_warning'] = $this->error['warning'];
33 + } else {
34 + $data['error_warning'] = '';
35 + }
36 +
37 + $data['breadcrumbs'] = [];
38 +
39 + $data['breadcrumbs'][] = [
40 + 'text' => $this->language->get('text_home'),
41 + 'href' => $this->url->link('common/dashboard', 'user_token=' . $this->session->data['user_token'])
42 + ];
43 +
44 + $data['breadcrumbs'][] = [
45 + 'text' => $this->language->get('text_extension'),
46 + 'href' => $this->url->link('marketplace/extension', 'user_token=' . $this->session->data['user_token'] . '&type=currency')
47 + ];
48 +
49 + $data['breadcrumbs'][] = [
50 + 'text' => $this->language->get('heading_title'),
51 + 'href' => $this->url->link('extension/currency/ecb', 'user_token=' . $this->session->data['user_token'])
52 + ];
53 +
54 + $data['action'] = $this->url->link('extension/currency/ecb', 'user_token=' . $this->session->data['user_token']);
55 +
56 + $data['cancel'] = $this->url->link('marketplace/extension', 'user_token=' . $this->session->data['user_token'] . '&type=currency');
57 +
58 + if (isset($this->request->post['currency_ecb_status'])) {
59 + $data['currency_ecb_status'] = $this->request->post['currency_ecb_status'];
60 + } else {
61 + $data['currency_ecb_status'] = $this->config->get('currency_ecb_status');
62 + }
63 +
64 + $data['header'] = $this->load->controller('common/header');
65 + $data['column_left'] = $this->load->controller('common/column_left');
66 + $data['footer'] = $this->load->controller('common/footer');
67 +
68 + $this->response->setOutput($this->load->view('extension/currency/ecb', $data));
69 + }
70 +
71 + protected function validate() {
72 + if (!$this->user->hasPermission('modify', 'extension/currency/ecb')) {
73 + $this->error['warning'] = $this->language->get('error_permission');
74 + }
75 +
76 + return !$this->error;
77 + }
78 +
79 + public function currency($default = '') {
80 + if ($this->config->get('currency_ecb_status')) {
81 + $curl = curl_init();
82 +
83 + curl_setopt($curl, CURLOPT_URL, 'https://www.ecb.europa.eu/stats/eurofxref/eurofxref-daily.xml');
84 + curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
85 + curl_setopt($curl, CURLOPT_HEADER, false);
86 + curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, 0);
87 + curl_setopt($curl, CURLOPT_CONNECTTIMEOUT, 30);
88 + curl_setopt($curl, CURLOPT_TIMEOUT, 30);
89 +
90 + $response = curl_exec($curl);
91 +
92 + curl_close($curl);
93 +
94 + if ($response) {
95 + $dom = new \DOMDocument('1.0', 'UTF-8');
96 + $dom->loadXml($response);
97 +
98 + $cube = $dom->getElementsByTagName('Cube')->item(0);
99 +
100 + $currencies = [];
101 +
102 + $currencies['EUR'] = 1.0000;
103 +
104 + foreach ($cube->getElementsByTagName('Cube') as $currency) {
105 + if ($currency->getAttribute('currency')) {
106 + $currencies[$currency->getAttribute('currency')] = $currency->getAttribute('rate');
107 + }
108 + }
109 +
110 + if ($currencies) {
111 + $this->load->model('localisation/currency');
112 +
113 + $results = $this->model_localisation_currency->getCurrencies();
114 +
115 + foreach ($results as $result) {
116 + if (isset($currencies[$result['code']])) {
117 + $from = $currencies['EUR'];
118 +
119 + $to = $currencies[$result['code']];
120 +
121 + $this->model_localisation_currency->editValueByCode($result['code'], 1 / ($currencies[$default] * ($from / $to)));
122 + }
123 + }
124 + }
125 +
126 + $this->model_localisation_currency->editValueByCode($default, '1.00000');
127 +
128 + $this->cache->delete('currency');
129 + }
130 + }
131 + }
132 +}
...\ No newline at end of file ...\ No newline at end of file
1 +<?php
2 +class ControllerExtensionCurrencyFixer extends Controller {
3 + private $error = array();
4 +
5 + public function index() {
6 + $this->load->language('extension/currency/fixer');
7 +
8 + $this->document->setTitle($this->language->get('heading_title'));
9 +
10 + $this->load->model('setting/setting');
11 +
12 + if (($this->request->server['REQUEST_METHOD'] == 'POST') && $this->validate()) {
13 + $this->model_setting_setting->editSetting('currency_fixer', $this->request->post);
14 +
15 + $this->session->data['success'] = $this->language->get('text_success');
16 +
17 + $this->response->redirect($this->url->link('marketplace/extension', 'user_token=' . $this->session->data['user_token'] . '&type=currency'));
18 + }
19 +
20 + $data['heading_title'] = $this->language->get('heading_title');
21 +
22 + $data['text_edit'] = $this->language->get('text_edit');
23 + $data['text_enabled'] = $this->language->get('text_enabled');
24 + $data['text_disabled'] = $this->language->get('text_disabled');
25 + $data['text_support'] = $this->language->get('text_support');
26 + $data['text_signup'] = $this->language->get('text_signup');
27 +
28 + $data['entry_status'] = $this->language->get('entry_status');
29 + $data['entry_api'] = $this->language->get('entry_api');
30 +
31 + $data['button_save'] = $this->language->get('button_save');
32 + $data['button_cancel'] = $this->language->get('button_cancel');
33 +
34 + if (isset($this->error['warning'])) {
35 + $data['error_warning'] = $this->error['warning'];
36 + } else {
37 + $data['error_warning'] = '';
38 + }
39 +
40 + if (isset($this->error['api'])) {
41 + $data['error_api'] = $this->error['api'];
42 + } else {
43 + $data['error_api'] = '';
44 + }
45 +
46 + $data['breadcrumbs'] = array();
47 +
48 + $data['breadcrumbs'][] = [
49 + 'text' => $this->language->get('text_home'),
50 + 'href' => $this->url->link('common/dashboard', 'user_token=' . $this->session->data['user_token'])
51 + ];
52 +
53 + $data['breadcrumbs'][] = [
54 + 'text' => $this->language->get('text_extension'),
55 + 'href' => $this->url->link('marketplace/extension', 'user_token=' . $this->session->data['user_token'] . '&type=captcha')
56 + ];
57 +
58 + $data['breadcrumbs'][] = [
59 + 'text' => $this->language->get('heading_title'),
60 + 'href' => $this->url->link('extension/currency/fixer', 'user_token=' . $this->session->data['user_token'])
61 + ];
62 +
63 + $data['action'] = $this->url->link('extension/currency/fixer', 'user_token=' . $this->session->data['user_token']);
64 +
65 + $data['cancel'] = $this->url->link('marketplace/extension', 'user_token=' . $this->session->data['user_token'] . '&type=currency');
66 +
67 + if (isset($this->request->post['currency_fixer_api'])) {
68 + $data['currency_fixer_api'] = $this->request->post['currency_fixer_api'];
69 + } else {
70 + $data['currency_fixer_api'] = $this->config->get('currency_fixer_api');
71 + }
72 +
73 + if (isset($this->request->post['currency_fixer_status'])) {
74 + $data['currency_fixer_status'] = $this->request->post['currency_fixer_status'];
75 + } else {
76 + $data['currency_fixer_status'] = $this->config->get('currency_fixer_status');
77 + }
78 +
79 + $data['header'] = $this->load->controller('common/header');
80 + $data['column_left'] = $this->load->controller('common/column_left');
81 + $data['footer'] = $this->load->controller('common/footer');
82 +
83 + $this->response->setOutput($this->load->view('extension/currency/fixer', $data));
84 + }
85 +
86 + protected function validate() {
87 + if (!$this->user->hasPermission('modify', 'extension/currency/fixer')) {
88 + $this->error['warning'] = $this->language->get('error_permission');
89 + }
90 +
91 + if (!$this->request->post['currency_fixer_api']) {
92 + $this->error['api'] = $this->language->get('error_api');
93 + }
94 +
95 + return !$this->error;
96 + }
97 +
98 + public function currency($default = '') {
99 + if ($this->config->get('currency_fixer_status')) {
100 + $curl = curl_init();
101 +
102 + curl_setopt($curl, CURLOPT_URL, 'http://data.fixer.io/api/latest?access_key=' . $this->config->get('currency_fixer_api'));
103 + curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
104 + curl_setopt($curl, CURLOPT_HEADER, false);
105 + curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, 0);
106 + curl_setopt($curl, CURLOPT_CONNECTTIMEOUT, 30);
107 + curl_setopt($curl, CURLOPT_TIMEOUT, 30);
108 +
109 + $response = curl_exec($curl);
110 +
111 + curl_close($curl);
112 +
113 + $response_info = json_decode($response, true);
114 +
115 + if (is_array($response_info) && isset($response_info['rates'])) {
116 + // Compile all the rates into an array
117 + $currencies = [];
118 +
119 + $currencies['EUR'] = 1.0000;
120 +
121 + foreach ($response_info['rates'] as $key => $value) {
122 + $currencies[$key] = $value;
123 + }
124 +
125 + $this->load->model('localisation/currency');
126 +
127 + $results = $this->model_localisation_currency->getCurrencies();
128 +
129 + foreach ($results as $result) {
130 + if (isset($currencies[$result['code']])) {
131 + $from = $currencies['EUR'];
132 +
133 + $to = $currencies[$result['code']];
134 +
135 + $this->model_localisation_currency->editValueByCode($result['code'], 1 / ($currencies[$default] * ($from / $to)));
136 + }
137 + }
138 +
139 + $this->model_localisation_currency->editValueByCode($default, 1);
140 +
141 + $this->cache->delete('currency');
142 + }
143 + }
144 + }
145 +}
...\ No newline at end of file ...\ No newline at end of file
1 +<?php
2 +class ControllerExtensionCurrencyNbu extends Controller {
3 + private $error = array();
4 +
5 + public function index() {
6 + $this->load->language('extension/currency/nbu');
7 +
8 + $this->document->setTitle($this->language->get('heading_title'));
9 +
10 + $this->load->model('setting/setting');
11 +
12 + if (($this->request->server['REQUEST_METHOD'] == 'POST') && $this->validate()) {
13 + $this->model_setting_setting->editSetting('currency_nbu', $this->request->post);
14 +
15 + $this->session->data['success'] = $this->language->get('text_success');
16 +
17 + $this->response->redirect($this->url->link('marketplace/extension', 'user_token=' . $this->session->data['user_token'] . '&type=currency'));
18 + }
19 +
20 + $data['heading_title'] = $this->language->get('heading_title');
21 +
22 + $data['text_edit'] = $this->language->get('text_edit');
23 + $data['text_enabled'] = $this->language->get('text_enabled');
24 + $data['text_disabled'] = $this->language->get('text_disabled');
25 +
26 + $data['entry_status'] = $this->language->get('entry_status');
27 +
28 + $data['button_save'] = $this->language->get('button_save');
29 + $data['button_cancel'] = $this->language->get('button_cancel');
30 +
31 + if (isset($this->error['warning'])) {
32 + $data['error_warning'] = $this->error['warning'];
33 + } else {
34 + $data['error_warning'] = '';
35 + }
36 +
37 + $data['breadcrumbs'] = [];
38 +
39 + $data['breadcrumbs'][] = [
40 + 'text' => $this->language->get('text_home'),
41 + 'href' => $this->url->link('common/dashboard', 'user_token=' . $this->session->data['user_token'])
42 + ];
43 +
44 + $data['breadcrumbs'][] = [
45 + 'text' => $this->language->get('text_extension'),
46 + 'href' => $this->url->link('marketplace/extension', 'user_token=' . $this->session->data['user_token'] . '&type=currency')
47 + ];
48 +
49 + $data['breadcrumbs'][] = [
50 + 'text' => $this->language->get('heading_title'),
51 + 'href' => $this->url->link('extension/currency/nbu', 'user_token=' . $this->session->data['user_token'])
52 + ];
53 +
54 + $data['action'] = $this->url->link('extension/currency/nbu', 'user_token=' . $this->session->data['user_token']);
55 +
56 + $data['cancel'] = $this->url->link('marketplace/extension', 'user_token=' . $this->session->data['user_token'] . '&type=currency');
57 +
58 + if (isset($this->request->post['currency_nbu_status'])) {
59 + $data['currency_nbu_status'] = $this->request->post['currency_nbu_status'];
60 + } else {
61 + $data['currency_nbu_status'] = $this->config->get('currency_nbu_status');
62 + }
63 +
64 + $data['header'] = $this->load->controller('common/header');
65 + $data['column_left'] = $this->load->controller('common/column_left');
66 + $data['footer'] = $this->load->controller('common/footer');
67 +
68 + $this->response->setOutput($this->load->view('extension/currency/nbu', $data));
69 + }
70 +
71 + protected function validate() {
72 + if (!$this->user->hasPermission('modify', 'extension/currency/nbu')) {
73 + $this->error['warning'] = $this->language->get('error_permission');
74 + }
75 +
76 + return !$this->error;
77 + }
78 +
79 + public function currency($default = '') {
80 + if ($this->config->get('currency_nbu_status')) {
81 + $curl = curl_init();
82 +
83 + curl_setopt($curl, CURLOPT_URL, 'https://bank.gov.ua/NBUStatService/v1/statdirectory/exchange');
84 + curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
85 + curl_setopt($curl, CURLOPT_HEADER, false);
86 + curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, 0);
87 + curl_setopt($curl, CURLOPT_CONNECTTIMEOUT, 30);
88 + curl_setopt($curl, CURLOPT_TIMEOUT, 30);
89 +
90 + $response = curl_exec($curl);
91 +
92 + curl_close($curl);
93 +
94 +
95 + if ($response) {
96 + $dom = new \DOMDocument('1.0', 'UTF-8');
97 + $dom->loadXml($response);
98 +
99 + $currencies = array();
100 +
101 + $currencies['UAH'] = 1.0000;
102 +
103 + $root = $dom->documentElement;
104 + $items = $root->getElementsByTagName('currency');
105 +
106 +
107 + foreach ($items as $item)
108 + {
109 + $code = $item->getElementsByTagName('cc')->item(0)->nodeValue;
110 + $curs = $item->getElementsByTagName('rate')->item(0)->nodeValue;
111 + $currencies[$code] = floatval(str_replace(',', '.', $curs));
112 + }
113 +
114 +
115 + if ($currencies) {
116 + $this->load->model('localisation/currency');
117 +
118 + $results = $this->model_localisation_currency->getCurrencies();
119 +
120 + foreach ($results as $result) {
121 + if (isset($currencies[$result['code']])) {
122 + $from = $currencies['UAH'];
123 +
124 + $to = $currencies[$result['code']];
125 +
126 + $this->model_localisation_currency->editValueByCode($result['code'], ($currencies[$default] * ($from / $to)));
127 + }
128 + }
129 + }
130 +
131 + $this->model_localisation_currency->editValueByCode($default, '1.00000');
132 +
133 + $this->cache->delete('currency');
134 + }
135 + }
136 + }
137 +}
1 +<?php
2 +class ControllerExtensionDashboardActivity extends Controller {
3 + private $error = array();
4 +
5 + public function index() {
6 + $this->load->language('extension/dashboard/activity');
7 +
8 + $this->document->setTitle($this->language->get('heading_title'));
9 +
10 + $this->load->model('setting/setting');
11 +
12 + if (($this->request->server['REQUEST_METHOD'] == 'POST') && $this->validate()) {
13 + $this->model_setting_setting->editSetting('dashboard_activity', $this->request->post);
14 +
15 + $this->session->data['success'] = $this->language->get('text_success');
16 +
17 + $this->response->redirect($this->url->link('marketplace/extension', 'user_token=' . $this->session->data['user_token'] . '&type=dashboard', true));
18 + }
19 +
20 + if (isset($this->error['warning'])) {
21 + $data['error_warning'] = $this->error['warning'];
22 + } else {
23 + $data['error_warning'] = '';
24 + }
25 +
26 + $data['breadcrumbs'] = array();
27 +
28 + $data['breadcrumbs'][] = array(
29 + 'text' => $this->language->get('text_home'),
30 + 'href' => $this->url->link('common/dashboard', 'user_token=' . $this->session->data['user_token'], true)
31 + );
32 +
33 + $data['breadcrumbs'][] = array(
34 + 'text' => $this->language->get('text_extension'),
35 + 'href' => $this->url->link('marketplace/extension', 'user_token=' . $this->session->data['user_token'] . '&type=dashboard', true)
36 + );
37 +
38 + $data['breadcrumbs'][] = array(
39 + 'text' => $this->language->get('heading_title'),
40 + 'href' => $this->url->link('extension/dashboard/activity', 'user_token=' . $this->session->data['user_token'], true)
41 + );
42 +
43 + $data['action'] = $this->url->link('extension/dashboard/activity', 'user_token=' . $this->session->data['user_token'], true);
44 +
45 + $data['cancel'] = $this->url->link('marketplace/extension', 'user_token=' . $this->session->data['user_token'] . '&type=dashboard', true);
46 +
47 + if (isset($this->request->post['dashboard_activity_width'])) {
48 + $data['dashboard_activity_width'] = $this->request->post['dashboard_activity_width'];
49 + } else {
50 + $data['dashboard_activity_width'] = $this->config->get('dashboard_activity_width');
51 + }
52 +
53 + $data['columns'] = array();
54 +
55 + for ($i = 3; $i <= 12; $i++) {
56 + $data['columns'][] = $i;
57 + }
58 +
59 + if (isset($this->request->post['dashboard_activity_status'])) {
60 + $data['dashboard_activity_status'] = $this->request->post['dashboard_activity_status'];
61 + } else {
62 + $data['dashboard_activity_status'] = $this->config->get('dashboard_activity_status');
63 + }
64 +
65 + if (isset($this->request->post['dashboard_activity_sort_order'])) {
66 + $data['dashboard_activity_sort_order'] = $this->request->post['dashboard_activity_sort_order'];
67 + } else {
68 + $data['dashboard_activity_sort_order'] = $this->config->get('dashboard_activity_sort_order');
69 + }
70 +
71 + $data['header'] = $this->load->controller('common/header');
72 + $data['column_left'] = $this->load->controller('common/column_left');
73 + $data['footer'] = $this->load->controller('common/footer');
74 +
75 + $this->response->setOutput($this->load->view('extension/dashboard/activity_form', $data));
76 + }
77 +
78 + protected function validate() {
79 + if (!$this->user->hasPermission('modify', 'extension/dashboard/activity')) {
80 + $this->error['warning'] = $this->language->get('error_permission');
81 + }
82 +
83 + return !$this->error;
84 + }
85 +
86 + public function dashboard() {
87 + $this->load->language('extension/dashboard/activity');
88 +
89 + $data['user_token'] = $this->session->data['user_token'];
90 +
91 + $data['activities'] = array();
92 +
93 + $this->load->model('extension/dashboard/activity');
94 +
95 + $results = $this->model_extension_dashboard_activity->getActivities();
96 +
97 + foreach ($results as $result) {
98 + $comment = vsprintf($this->language->get('text_activity_' . $result['key']), json_decode($result['data'], true));
99 +
100 + $find = array(
101 + 'customer_id=',
102 + 'order_id=',
103 + 'return_id='
104 + );
105 +
106 + $replace = array(
107 + $this->url->link('customer/customer/edit', 'user_token=' . $this->session->data['user_token'] . '&customer_id=', true),
108 + $this->url->link('sale/order/info', 'user_token=' . $this->session->data['user_token'] . '&order_id=', true),
109 + $this->url->link('sale/return/edit', 'user_token=' . $this->session->data['user_token'] . '&return_id=', true)
110 + );
111 +
112 + $data['activities'][] = array(
113 + 'comment' => str_replace($find, $replace, $comment),
114 + 'date_added' => date($this->language->get('datetime_format'), strtotime($result['date_added']))
115 + );
116 + }
117 +
118 + return $this->load->view('extension/dashboard/activity_info', $data);
119 + }
120 +}
...\ No newline at end of file ...\ No newline at end of file
1 +<?php
2 +class ControllerExtensionDashboardChart extends Controller {
3 + private $error = array();
4 +
5 + public function index() {
6 + $this->load->language('extension/dashboard/chart');
7 +
8 + $this->document->setTitle($this->language->get('heading_title'));
9 +
10 + $this->load->model('setting/setting');
11 +
12 + if (($this->request->server['REQUEST_METHOD'] == 'POST') && $this->validate()) {
13 + $this->model_setting_setting->editSetting('dashboard_chart', $this->request->post);
14 +
15 + $this->session->data['success'] = $this->language->get('text_success');
16 +
17 + $this->response->redirect($this->url->link('marketplace/extension', 'user_token=' . $this->session->data['user_token'] . '&type=dashboard', true));
18 + }
19 +
20 + if (isset($this->error['warning'])) {
21 + $data['error_warning'] = $this->error['warning'];
22 + } else {
23 + $data['error_warning'] = '';
24 + }
25 +
26 + $data['breadcrumbs'] = array();
27 +
28 + $data['breadcrumbs'][] = array(
29 + 'text' => $this->language->get('text_home'),
30 + 'href' => $this->url->link('common/dashboard', 'user_token=' . $this->session->data['user_token'], true)
31 + );
32 +
33 + $data['breadcrumbs'][] = array(
34 + 'text' => $this->language->get('text_extension'),
35 + 'href' => $this->url->link('marketplace/extension', 'user_token=' . $this->session->data['user_token'] . '&type=dashboard', true)
36 + );
37 +
38 + $data['breadcrumbs'][] = array(
39 + 'text' => $this->language->get('heading_title'),
40 + 'href' => $this->url->link('extension/dashboard/chart', 'user_token=' . $this->session->data['user_token'], true)
41 + );
42 +
43 + $data['action'] = $this->url->link('extension/dashboard/chart', 'user_token=' . $this->session->data['user_token'], true);
44 +
45 + $data['cancel'] = $this->url->link('marketplace/extension', 'user_token=' . $this->session->data['user_token'] . '&type=dashboard', true);
46 +
47 + if (isset($this->request->post['dashboard_chart_width'])) {
48 + $data['dashboard_chart_width'] = $this->request->post['dashboard_chart_width'];
49 + } else {
50 + $data['dashboard_chart_width'] = $this->config->get('dashboard_chart_width');
51 + }
52 +
53 + $data['columns'] = array();
54 +
55 + for ($i = 3; $i <= 12; $i++) {
56 + $data['columns'][] = $i;
57 + }
58 +
59 + if (isset($this->request->post['dashboard_chart_status'])) {
60 + $data['dashboard_chart_status'] = $this->request->post['dashboard_chart_status'];
61 + } else {
62 + $data['dashboard_chart_status'] = $this->config->get('dashboard_chart_status');
63 + }
64 +
65 + if (isset($this->request->post['dashboard_chart_sort_order'])) {
66 + $data['dashboard_chart_sort_order'] = $this->request->post['dashboard_chart_sort_order'];
67 + } else {
68 + $data['dashboard_chart_sort_order'] = $this->config->get('dashboard_chart_sort_order');
69 + }
70 +
71 + $data['header'] = $this->load->controller('common/header');
72 + $data['column_left'] = $this->load->controller('common/column_left');
73 + $data['footer'] = $this->load->controller('common/footer');
74 +
75 + $this->response->setOutput($this->load->view('extension/dashboard/chart_form', $data));
76 + }
77 +
78 + protected function validate() {
79 + if (!$this->user->hasPermission('modify', 'extension/dashboard/chart')) {
80 + $this->error['warning'] = $this->language->get('error_permission');
81 + }
82 +
83 + return !$this->error;
84 + }
85 +
86 + public function dashboard() {
87 + $this->load->language('extension/dashboard/chart');
88 +
89 + $data['user_token'] = $this->session->data['user_token'];
90 +
91 + return $this->load->view('extension/dashboard/chart_info', $data);
92 + }
93 +
94 + public function chart() {
95 + $this->load->language('extension/dashboard/chart');
96 +
97 + $json = array();
98 +
99 + $this->load->model('extension/dashboard/chart');
100 +
101 + $json['order'] = array();
102 + $json['customer'] = array();
103 + $json['xaxis'] = array();
104 +
105 + $json['order']['label'] = $this->language->get('text_order');
106 + $json['customer']['label'] = $this->language->get('text_customer');
107 + $json['order']['data'] = array();
108 + $json['customer']['data'] = array();
109 +
110 + if (isset($this->request->get['range'])) {
111 + $range = $this->request->get['range'];
112 + } else {
113 + $range = 'day';
114 + }
115 +
116 + switch ($range) {
117 + default:
118 + case 'day':
119 + $results = $this->model_extension_dashboard_chart->getTotalOrdersByDay();
120 +
121 + foreach ($results as $key => $value) {
122 + $json['order']['data'][] = array($key, $value['total']);
123 + }
124 +
125 + $results = $this->model_extension_dashboard_chart->getTotalCustomersByDay();
126 +
127 + foreach ($results as $key => $value) {
128 + $json['customer']['data'][] = array($key, $value['total']);
129 + }
130 +
131 + for ($i = 0; $i < 24; $i++) {
132 + $json['xaxis'][] = array($i, $i);
133 + }
134 + break;
135 + case 'week':
136 + $results = $this->model_extension_dashboard_chart->getTotalOrdersByWeek();
137 +
138 + foreach ($results as $key => $value) {
139 + $json['order']['data'][] = array($key, $value['total']);
140 + }
141 +
142 + $results = $this->model_extension_dashboard_chart->getTotalCustomersByWeek();
143 +
144 + foreach ($results as $key => $value) {
145 + $json['customer']['data'][] = array($key, $value['total']);
146 + }
147 +
148 + $date_start = strtotime('-' . date('w') . ' days');
149 +
150 + for ($i = 0; $i < 7; $i++) {
151 + $date = date('Y-m-d', $date_start + ($i * 86400));
152 +
153 + $json['xaxis'][] = array(date('w', strtotime($date)), date('D', strtotime($date)));
154 + }
155 + break;
156 + case 'month':
157 + $results = $this->model_extension_dashboard_chart->getTotalOrdersByMonth();
158 +
159 + foreach ($results as $key => $value) {
160 + $json['order']['data'][] = array($key, $value['total']);
161 + }
162 +
163 + $results = $this->model_extension_dashboard_chart->getTotalCustomersByMonth();
164 +
165 + foreach ($results as $key => $value) {
166 + $json['customer']['data'][] = array($key, $value['total']);
167 + }
168 +
169 + for ($i = 1; $i <= date('t'); $i++) {
170 + $date = date('Y') . '-' . date('m') . '-' . $i;
171 +
172 + $json['xaxis'][] = array(date('j', strtotime($date)), date('d', strtotime($date)));
173 + }
174 + break;
175 + case 'year':
176 + $results = $this->model_extension_dashboard_chart->getTotalOrdersByYear();
177 +
178 + foreach ($results as $key => $value) {
179 + $json['order']['data'][] = array($key, $value['total']);
180 + }
181 +
182 + $results = $this->model_extension_dashboard_chart->getTotalCustomersByYear();
183 +
184 + foreach ($results as $key => $value) {
185 + $json['customer']['data'][] = array($key, $value['total']);
186 + }
187 +
188 + for ($i = 1; $i <= 12; $i++) {
189 + $json['xaxis'][] = array($i, date('M', mktime(0, 0, 0, $i)));
190 + }
191 + break;
192 + }
193 +
194 + $this->response->addHeader('Content-Type: application/json');
195 + $this->response->setOutput(json_encode($json));
196 + }
197 +}
...\ No newline at end of file ...\ No newline at end of file
1 +<?php
2 +class ControllerExtensionDashboardCustomer extends Controller {
3 + private $error = array();
4 +
5 + public function index() {
6 + $this->load->language('extension/dashboard/customer');
7 +
8 + $this->document->setTitle($this->language->get('heading_title'));
9 +
10 + $this->load->model('setting/setting');
11 +
12 + if (($this->request->server['REQUEST_METHOD'] == 'POST') && $this->validate()) {
13 + $this->model_setting_setting->editSetting('dashboard_customer', $this->request->post);
14 +
15 + $this->session->data['success'] = $this->language->get('text_success');
16 +
17 + $this->response->redirect($this->url->link('marketplace/extension', 'user_token=' . $this->session->data['user_token'] . '&type=dashboard', true));
18 + }
19 +
20 + if (isset($this->error['warning'])) {
21 + $data['error_warning'] = $this->error['warning'];
22 + } else {
23 + $data['error_warning'] = '';
24 + }
25 +
26 + $data['breadcrumbs'] = array();
27 +
28 + $data['breadcrumbs'][] = array(
29 + 'text' => $this->language->get('text_home'),
30 + 'href' => $this->url->link('common/dashboard', 'user_token=' . $this->session->data['user_token'], true)
31 + );
32 +
33 + $data['breadcrumbs'][] = array(
34 + 'text' => $this->language->get('text_extension'),
35 + 'href' => $this->url->link('marketplace/extension', 'user_token=' . $this->session->data['user_token'] . '&type=dashboard', true)
36 + );
37 +
38 + $data['breadcrumbs'][] = array(
39 + 'text' => $this->language->get('heading_title'),
40 + 'href' => $this->url->link('extension/dashboard/customer', 'user_token=' . $this->session->data['user_token'], true)
41 + );
42 +
43 + $data['action'] = $this->url->link('extension/dashboard/customer', 'user_token=' . $this->session->data['user_token'], true);
44 +
45 + $data['cancel'] = $this->url->link('marketplace/extension', 'user_token=' . $this->session->data['user_token'] . '&type=dashboard', true);
46 +
47 + if (isset($this->request->post['dashboard_customer_width'])) {
48 + $data['dashboard_customer_width'] = $this->request->post['dashboard_customer_width'];
49 + } else {
50 + $data['dashboard_customer_width'] = $this->config->get('dashboard_customer_width');
51 + }
52 +
53 + $data['columns'] = array();
54 +
55 + for ($i = 3; $i <= 12; $i++) {
56 + $data['columns'][] = $i;
57 + }
58 +
59 + if (isset($this->request->post['dashboard_customer_status'])) {
60 + $data['dashboard_customer_status'] = $this->request->post['dashboard_customer_status'];
61 + } else {
62 + $data['dashboard_customer_status'] = $this->config->get('dashboard_customer_status');
63 + }
64 +
65 + if (isset($this->request->post['dashboard_customer_sort_order'])) {
66 + $data['dashboard_customer_sort_order'] = $this->request->post['dashboard_customer_sort_order'];
67 + } else {
68 + $data['dashboard_customer_sort_order'] = $this->config->get('dashboard_customer_sort_order');
69 + }
70 +
71 + $data['header'] = $this->load->controller('common/header');
72 + $data['column_left'] = $this->load->controller('common/column_left');
73 + $data['footer'] = $this->load->controller('common/footer');
74 +
75 + $this->response->setOutput($this->load->view('extension/dashboard/customer_form', $data));
76 + }
77 +
78 + protected function validate() {
79 + if (!$this->user->hasPermission('modify', 'extension/dashboard/customer')) {
80 + $this->error['warning'] = $this->language->get('error_permission');
81 + }
82 +
83 + return !$this->error;
84 + }
85 +
86 + public function dashboard() {
87 + $this->load->language('extension/dashboard/customer');
88 +
89 + $data['user_token'] = $this->session->data['user_token'];
90 +
91 + // Total Orders
92 + $this->load->model('customer/customer');
93 +
94 + $today = $this->model_customer_customer->getTotalCustomers(array('filter_date_added' => date('Y-m-d', strtotime('-1 day'))));
95 +
96 + $yesterday = $this->model_customer_customer->getTotalCustomers(array('filter_date_added' => date('Y-m-d', strtotime('-2 day'))));
97 +
98 + $difference = $today - $yesterday;
99 +
100 + if ($difference && $today) {
101 + $data['percentage'] = round(($difference / $today) * 100);
102 + } else {
103 + $data['percentage'] = 0;
104 + }
105 +
106 + $customer_total = $this->model_customer_customer->getTotalCustomers();
107 +
108 + if ($customer_total > 1000000000000) {
109 + $data['total'] = round($customer_total / 1000000000000, 1) . 'T';
110 + } elseif ($customer_total > 1000000000) {
111 + $data['total'] = round($customer_total / 1000000000, 1) . 'B';
112 + } elseif ($customer_total > 1000000) {
113 + $data['total'] = round($customer_total / 1000000, 1) . 'M';
114 + } elseif ($customer_total > 1000) {
115 + $data['total'] = round($customer_total / 1000, 1) . 'K';
116 + } else {
117 + $data['total'] = $customer_total;
118 + }
119 +
120 + $data['customer'] = $this->url->link('customer/customer', 'user_token=' . $this->session->data['user_token'], true);
121 +
122 + return $this->load->view('extension/dashboard/customer_info', $data);
123 + }
124 +}
This diff is collapsed. Click to expand it.
1 +<?php
2 +class ControllerExtensionDashboardMap extends Controller {
3 + private $error = array();
4 +
5 + public function index() {
6 + $this->load->language('extension/dashboard/map');
7 +
8 + $this->document->setTitle($this->language->get('heading_title'));
9 +
10 + $this->load->model('setting/setting');
11 +
12 + if (($this->request->server['REQUEST_METHOD'] == 'POST') && $this->validate()) {
13 + $this->model_setting_setting->editSetting('dashboard_map', $this->request->post);
14 +
15 + $this->session->data['success'] = $this->language->get('text_success');
16 +
17 + $this->response->redirect($this->url->link('marketplace/extension', 'user_token=' . $this->session->data['user_token'] . '&type=dashboard', true));
18 + }
19 +
20 + if (isset($this->error['warning'])) {
21 + $data['error_warning'] = $this->error['warning'];
22 + } else {
23 + $data['error_warning'] = '';
24 + }
25 +
26 + $data['breadcrumbs'] = array();
27 +
28 + $data['breadcrumbs'][] = array(
29 + 'text' => $this->language->get('text_home'),
30 + 'href' => $this->url->link('common/dashboard', 'user_token=' . $this->session->data['user_token'], true)
31 + );
32 +
33 + $data['breadcrumbs'][] = array(
34 + 'text' => $this->language->get('text_extension'),
35 + 'href' => $this->url->link('marketplace/extension', 'user_token=' . $this->session->data['user_token'] . '&type=dashboard', true)
36 + );
37 +
38 + $data['breadcrumbs'][] = array(
39 + 'text' => $this->language->get('heading_title'),
40 + 'href' => $this->url->link('extension/dashboard/map', 'user_token=' . $this->session->data['user_token'], true)
41 + );
42 +
43 + $data['action'] = $this->url->link('extension/dashboard/map', 'user_token=' . $this->session->data['user_token'], true);
44 +
45 + $data['cancel'] = $this->url->link('marketplace/extension', 'user_token=' . $this->session->data['user_token'] . '&type=dashboard', true);
46 +
47 + if (isset($this->request->post['dashboard_map_width'])) {
48 + $data['dashboard_map_width'] = $this->request->post['dashboard_map_width'];
49 + } else {
50 + $data['dashboard_map_width'] = $this->config->get('dashboard_map_width');
51 + }
52 +
53 + $data['columns'] = array();
54 +
55 + for ($i = 3; $i <= 12; $i++) {
56 + $data['columns'][] = $i;
57 + }
58 +
59 + if (isset($this->request->post['dashboard_map_status'])) {
60 + $data['dashboard_map_status'] = $this->request->post['dashboard_map_status'];
61 + } else {
62 + $data['dashboard_map_status'] = $this->config->get('dashboard_map_status');
63 + }
64 +
65 + if (isset($this->request->post['dashboard_map_sort_order'])) {
66 + $data['dashboard_map_sort_order'] = $this->request->post['dashboard_map_sort_order'];
67 + } else {
68 + $data['dashboard_map_sort_order'] = $this->config->get('dashboard_map_sort_order');
69 + }
70 +
71 + $data['header'] = $this->load->controller('common/header');
72 + $data['column_left'] = $this->load->controller('common/column_left');
73 + $data['footer'] = $this->load->controller('common/footer');
74 +
75 + $this->response->setOutput($this->load->view('extension/dashboard/map_form', $data));
76 + }
77 +
78 + protected function validate() {
79 + if (!$this->user->hasPermission('modify', 'extension/dashboard/map')) {
80 + $this->error['warning'] = $this->language->get('error_permission');
81 + }
82 +
83 + return !$this->error;
84 + }
85 +
86 + public function dashboard() {
87 + $this->load->language('extension/dashboard/map');
88 +
89 + $data['user_token'] = $this->session->data['user_token'];
90 +
91 + return $this->load->view('extension/dashboard/map_info', $data);
92 + }
93 +
94 + public function map() {
95 + $json = array();
96 +
97 + $this->load->model('extension/dashboard/map');
98 +
99 + $results = $this->model_extension_dashboard_map->getTotalOrdersByCountry();
100 +
101 + foreach ($results as $result) {
102 + $json[strtolower($result['iso_code_2'])] = array(
103 + 'total' => $result['total'],
104 + 'amount' => $this->currency->format($result['amount'], $this->config->get('config_currency'))
105 + );
106 + }
107 +
108 + $this->response->addHeader('Content-Type: application/json');
109 + $this->response->setOutput(json_encode($json));
110 + }
111 +}
1 +<?php
2 +class ControllerExtensionDashboardOnline extends Controller {
3 + private $error = array();
4 +
5 + public function index() {
6 + $this->load->language('extension/dashboard/online');
7 +
8 + $this->document->setTitle($this->language->get('heading_title'));
9 +
10 + $this->load->model('setting/setting');
11 +
12 + if (($this->request->server['REQUEST_METHOD'] == 'POST') && $this->validate()) {
13 + $this->model_setting_setting->editSetting('dashboard_online', $this->request->post);
14 +
15 + $this->session->data['success'] = $this->language->get('text_success');
16 +
17 + $this->response->redirect($this->url->link('marketplace/extension', 'user_token=' . $this->session->data['user_token'] . '&type=dashboard', true));
18 + }
19 +
20 + if (isset($this->error['warning'])) {
21 + $data['error_warning'] = $this->error['warning'];
22 + } else {
23 + $data['error_warning'] = '';
24 + }
25 +
26 + $data['breadcrumbs'] = array();
27 +
28 + $data['breadcrumbs'][] = array(
29 + 'text' => $this->language->get('text_home'),
30 + 'href' => $this->url->link('common/dashboard', 'user_token=' . $this->session->data['user_token'], true)
31 + );
32 +
33 + $data['breadcrumbs'][] = array(
34 + 'text' => $this->language->get('text_extension'),
35 + 'href' => $this->url->link('marketplace/extension', 'user_token=' . $this->session->data['user_token'] . '&type=dashboard', true)
36 + );
37 +
38 + $data['breadcrumbs'][] = array(
39 + 'text' => $this->language->get('heading_title'),
40 + 'href' => $this->url->link('extension/dashboard/online', 'user_token=' . $this->session->data['user_token'], true)
41 + );
42 +
43 + $data['action'] = $this->url->link('extension/dashboard/online', 'user_token=' . $this->session->data['user_token'], true);
44 +
45 + $data['cancel'] = $this->url->link('marketplace/extension', 'user_token=' . $this->session->data['user_token'] . '&type=dashboard', true);
46 +
47 + if (isset($this->request->post['dashboard_online_width'])) {
48 + $data['dashboard_online_width'] = $this->request->post['dashboard_online_width'];
49 + } else {
50 + $data['dashboard_online_width'] = $this->config->get('dashboard_online_width');
51 + }
52 +
53 + $data['columns'] = array();
54 +
55 + for ($i = 3; $i <= 12; $i++) {
56 + $data['columns'][] = $i;
57 + }
58 +
59 + if (isset($this->request->post['dashboard_online_status'])) {
60 + $data['dashboard_online_status'] = $this->request->post['dashboard_online_status'];
61 + } else {
62 + $data['dashboard_online_status'] = $this->config->get('dashboard_online_status');
63 + }
64 +
65 + if (isset($this->request->post['dashboard_online_sort_order'])) {
66 + $data['dashboard_online_sort_order'] = $this->request->post['dashboard_online_sort_order'];
67 + } else {
68 + $data['dashboard_online_sort_order'] = $this->config->get('dashboard_online_sort_order');
69 + }
70 +
71 + $data['header'] = $this->load->controller('common/header');
72 + $data['column_left'] = $this->load->controller('common/column_left');
73 + $data['footer'] = $this->load->controller('common/footer');
74 +
75 + $this->response->setOutput($this->load->view('extension/dashboard/online_form', $data));
76 + }
77 +
78 + protected function validate() {
79 + if (!$this->user->hasPermission('modify', 'extension/dashboard/online')) {
80 + $this->error['warning'] = $this->language->get('error_permission');
81 + }
82 +
83 + return !$this->error;
84 + }
85 +
86 + public function dashboard() {
87 + $this->load->language('extension/dashboard/online');
88 +
89 + $data['user_token'] = $this->session->data['user_token'];
90 +
91 + // Total Orders
92 + $this->load->model('extension/dashboard/online');
93 +
94 + // Customers Online
95 + $online_total = $this->model_extension_dashboard_online->getTotalOnline();
96 +
97 + if ($online_total > 1000000000000) {
98 + $data['total'] = round($online_total / 1000000000000, 1) . 'T';
99 + } elseif ($online_total > 1000000000) {
100 + $data['total'] = round($online_total / 1000000000, 1) . 'B';
101 + } elseif ($online_total > 1000000) {
102 + $data['total'] = round($online_total / 1000000, 1) . 'M';
103 + } elseif ($online_total > 1000) {
104 + $data['total'] = round($online_total / 1000, 1) . 'K';
105 + } else {
106 + $data['total'] = $online_total;
107 + }
108 +
109 + $data['online'] = $this->url->link('report/online', 'user_token=' . $this->session->data['user_token'], true);
110 +
111 + return $this->load->view('extension/dashboard/online_info', $data);
112 + }
113 +}
1 +<?php
2 +class ControllerExtensionDashboardOrder extends Controller {
3 + private $error = array();
4 +
5 + public function index() {
6 + $this->load->language('extension/dashboard/order');
7 +
8 + $this->document->setTitle($this->language->get('heading_title'));
9 +
10 + $this->load->model('setting/setting');
11 +
12 + if (($this->request->server['REQUEST_METHOD'] == 'POST') && $this->validate()) {
13 + $this->model_setting_setting->editSetting('dashboard_order', $this->request->post);
14 +
15 + $this->session->data['success'] = $this->language->get('text_success');
16 +
17 + $this->response->redirect($this->url->link('marketplace/extension', 'user_token=' . $this->session->data['user_token'] . '&type=dashboard', true));
18 + }
19 +
20 + if (isset($this->error['warning'])) {
21 + $data['error_warning'] = $this->error['warning'];
22 + } else {
23 + $data['error_warning'] = '';
24 + }
25 +
26 + $data['breadcrumbs'] = array();
27 +
28 + $data['breadcrumbs'][] = array(
29 + 'text' => $this->language->get('text_home'),
30 + 'href' => $this->url->link('common/dashboard', 'user_token=' . $this->session->data['user_token'], true)
31 + );
32 +
33 + $data['breadcrumbs'][] = array(
34 + 'text' => $this->language->get('text_extension'),
35 + 'href' => $this->url->link('marketplace/extension', 'user_token=' . $this->session->data['user_token'] . '&type=dashboard', true)
36 + );
37 +
38 + $data['breadcrumbs'][] = array(
39 + 'text' => $this->language->get('heading_title'),
40 + 'href' => $this->url->link('extension/dashboard/order', 'user_token=' . $this->session->data['user_token'], true)
41 + );
42 +
43 + $data['action'] = $this->url->link('extension/dashboard/order', 'user_token=' . $this->session->data['user_token'], true);
44 +
45 + $data['cancel'] = $this->url->link('marketplace/extension', 'user_token=' . $this->session->data['user_token'] . '&type=dashboard', true);
46 +
47 + if (isset($this->request->post['dashboard_order_width'])) {
48 + $data['dashboard_order_width'] = $this->request->post['dashboard_order_width'];
49 + } else {
50 + $data['dashboard_order_width'] = $this->config->get('dashboard_order_width');
51 + }
52 +
53 + $data['columns'] = array();
54 +
55 + for ($i = 3; $i <= 12; $i++) {
56 + $data['columns'][] = $i;
57 + }
58 +
59 + if (isset($this->request->post['dashboard_order_status'])) {
60 + $data['dashboard_order_status'] = $this->request->post['dashboard_order_status'];
61 + } else {
62 + $data['dashboard_order_status'] = $this->config->get('dashboard_order_status');
63 + }
64 +
65 + if (isset($this->request->post['dashboard_order_sort_order'])) {
66 + $data['dashboard_order_sort_order'] = $this->request->post['dashboard_order_sort_order'];
67 + } else {
68 + $data['dashboard_order_sort_order'] = $this->config->get('dashboard_order_sort_order');
69 + }
70 +
71 + $data['header'] = $this->load->controller('common/header');
72 + $data['column_left'] = $this->load->controller('common/column_left');
73 + $data['footer'] = $this->load->controller('common/footer');
74 +
75 + $this->response->setOutput($this->load->view('extension/dashboard/order_form', $data));
76 + }
77 +
78 + protected function validate() {
79 + if (!$this->user->hasPermission('modify', 'extension/dashboard/order')) {
80 + $this->error['warning'] = $this->language->get('error_permission');
81 + }
82 +
83 + return !$this->error;
84 + }
85 +
86 + public function dashboard() {
87 + $this->load->language('extension/dashboard/order');
88 +
89 + $data['user_token'] = $this->session->data['user_token'];
90 +
91 + // Total Orders
92 + $this->load->model('sale/order');
93 +
94 + $today = $this->model_sale_order->getTotalOrders(array('filter_date_added' => date('Y-m-d', strtotime('-1 day'))));
95 +
96 + $yesterday = $this->model_sale_order->getTotalOrders(array('filter_date_added' => date('Y-m-d', strtotime('-2 day'))));
97 +
98 + $difference = $today - $yesterday;
99 +
100 + if ($difference && $today) {
101 + $data['percentage'] = round(($difference / $today) * 100);
102 + } else {
103 + $data['percentage'] = 0;
104 + }
105 +
106 + $order_total = $this->model_sale_order->getTotalOrders();
107 +
108 + if ($order_total > 1000000000000) {
109 + $data['total'] = round($order_total / 1000000000000, 1) . 'T';
110 + } elseif ($order_total > 1000000000) {
111 + $data['total'] = round($order_total / 1000000000, 1) . 'B';
112 + } elseif ($order_total > 1000000) {
113 + $data['total'] = round($order_total / 1000000, 1) . 'M';
114 + } elseif ($order_total > 1000) {
115 + $data['total'] = round($order_total / 1000, 1) . 'K';
116 + } else {
117 + $data['total'] = $order_total;
118 + }
119 +
120 + $data['order'] = $this->url->link('sale/order', 'user_token=' . $this->session->data['user_token'], true);
121 +
122 + return $this->load->view('extension/dashboard/order_info', $data);
123 + }
124 +}
1 +<?php
2 +class ControllerExtensionDashboardRecent extends Controller {
3 + private $error = array();
4 +
5 + public function index() {
6 + $this->load->language('extension/dashboard/recent');
7 +
8 + $this->document->setTitle($this->language->get('heading_title'));
9 +
10 + $this->load->model('setting/setting');
11 +
12 + if (($this->request->server['REQUEST_METHOD'] == 'POST') && $this->validate()) {
13 + $this->model_setting_setting->editSetting('dashboard_recent', $this->request->post);
14 +
15 + $this->session->data['success'] = $this->language->get('text_success');
16 +
17 + $this->response->redirect($this->url->link('marketplace/extension', 'user_token=' . $this->session->data['user_token'] . '&type=dashboard', true));
18 + }
19 +
20 + if (isset($this->error['warning'])) {
21 + $data['error_warning'] = $this->error['warning'];
22 + } else {
23 + $data['error_warning'] = '';
24 + }
25 +
26 + $data['breadcrumbs'] = array();
27 +
28 + $data['breadcrumbs'][] = array(
29 + 'text' => $this->language->get('text_home'),
30 + 'href' => $this->url->link('common/dashboard', 'user_token=' . $this->session->data['user_token'], true)
31 + );
32 +
33 + $data['breadcrumbs'][] = array(
34 + 'text' => $this->language->get('text_extension'),
35 + 'href' => $this->url->link('marketplace/extension', 'user_token=' . $this->session->data['user_token'] . '&type=dashboard', true)
36 + );
37 +
38 + $data['breadcrumbs'][] = array(
39 + 'text' => $this->language->get('heading_title'),
40 + 'href' => $this->url->link('extension/dashboard/recent', 'user_token=' . $this->session->data['user_token'], true)
41 + );
42 +
43 + $data['action'] = $this->url->link('extension/dashboard/recent', 'user_token=' . $this->session->data['user_token'], true);
44 +
45 + $data['cancel'] = $this->url->link('marketplace/extension', 'user_token=' . $this->session->data['user_token'] . '&type=dashboard', true);
46 +
47 + if (isset($this->request->post['dashboard_recent_width'])) {
48 + $data['dashboard_recent_width'] = $this->request->post['dashboard_recent_width'];
49 + } else {
50 + $data['dashboard_recent_width'] = $this->config->get('dashboard_recent_width');
51 + }
52 +
53 + $data['columns'] = array();
54 +
55 + for ($i = 3; $i <= 12; $i++) {
56 + $data['columns'][] = $i;
57 + }
58 +
59 + if (isset($this->request->post['dashboard_recent_status'])) {
60 + $data['dashboard_recent_status'] = $this->request->post['dashboard_recent_status'];
61 + } else {
62 + $data['dashboard_recent_status'] = $this->config->get('dashboard_recent_status');
63 + }
64 +
65 + if (isset($this->request->post['dashboard_recent_sort_order'])) {
66 + $data['dashboard_recent_sort_order'] = $this->request->post['dashboard_recent_sort_order'];
67 + } else {
68 + $data['dashboard_recent_sort_order'] = $this->config->get('dashboard_recent_sort_order');
69 + }
70 +
71 + $data['header'] = $this->load->controller('common/header');
72 + $data['column_left'] = $this->load->controller('common/column_left');
73 + $data['footer'] = $this->load->controller('common/footer');
74 +
75 + $this->response->setOutput($this->load->view('extension/dashboard/recent_form', $data));
76 + }
77 +
78 + protected function validate() {
79 + if (!$this->user->hasPermission('modify', 'extension/dashboard/recent')) {
80 + $this->error['warning'] = $this->language->get('error_permission');
81 + }
82 +
83 + return !$this->error;
84 + }
85 +
86 + public function dashboard() {
87 + $this->load->language('extension/dashboard/recent');
88 +
89 + $data['user_token'] = $this->session->data['user_token'];
90 +
91 + // Last 5 Orders
92 + $data['orders'] = array();
93 +
94 + $filter_data = array(
95 + 'sort' => 'o.date_added',
96 + 'order' => 'DESC',
97 + 'start' => 0,
98 + 'limit' => 5
99 + );
100 +
101 + $this->load->model('sale/order');
102 +
103 + $results = $this->model_sale_order->getOrders($filter_data);
104 +
105 + foreach ($results as $result) {
106 + $data['orders'][] = array(
107 + 'order_id' => $result['order_id'],
108 + 'customer' => $result['customer'],
109 + 'status' => $result['order_status'],
110 + 'date_added' => date($this->language->get('date_format_short'), strtotime($result['date_added'])),
111 + 'total' => $this->currency->format($result['total'], $result['currency_code'], $result['currency_value']),
112 + 'view' => $this->url->link('sale/order/info', 'user_token=' . $this->session->data['user_token'] . '&order_id=' . $result['order_id'], true),
113 + );
114 + }
115 +
116 + return $this->load->view('extension/dashboard/recent_info', $data);
117 + }
118 +}
1 +<?php
2 +class ControllerExtensionDashboardSale extends Controller {
3 + private $error = array();
4 +
5 + public function index() {
6 + $this->load->language('extension/dashboard/sale');
7 +
8 + $this->document->setTitle($this->language->get('heading_title'));
9 +
10 + $this->load->model('setting/setting');
11 +
12 + if (($this->request->server['REQUEST_METHOD'] == 'POST') && $this->validate()) {
13 + $this->model_setting_setting->editSetting('dashboard_sale', $this->request->post);
14 +
15 + $this->session->data['success'] = $this->language->get('text_success');
16 +
17 + $this->response->redirect($this->url->link('marketplace/extension', 'user_token=' . $this->session->data['user_token'] . '&type=dashboard', true));
18 + }
19 +
20 + if (isset($this->error['warning'])) {
21 + $data['error_warning'] = $this->error['warning'];
22 + } else {
23 + $data['error_warning'] = '';
24 + }
25 +
26 + $data['breadcrumbs'] = array();
27 +
28 + $data['breadcrumbs'][] = array(
29 + 'text' => $this->language->get('text_home'),
30 + 'href' => $this->url->link('common/dashboard', 'user_token=' . $this->session->data['user_token'], true)
31 + );
32 +
33 + $data['breadcrumbs'][] = array(
34 + 'text' => $this->language->get('text_extension'),
35 + 'href' => $this->url->link('marketplace/extension', 'user_token=' . $this->session->data['user_token'] . '&type=dashboard', true)
36 + );
37 +
38 + $data['breadcrumbs'][] = array(
39 + 'text' => $this->language->get('heading_title'),
40 + 'href' => $this->url->link('extension/dashboard/sale', 'user_token=' . $this->session->data['user_token'], true)
41 + );
42 +
43 + $data['action'] = $this->url->link('extension/dashboard/sale', 'user_token=' . $this->session->data['user_token'], true);
44 +
45 + $data['cancel'] = $this->url->link('marketplace/extension', 'user_token=' . $this->session->data['user_token'] . '&type=dashboard', true);
46 +
47 + if (isset($this->request->post['dashboard_sale_width'])) {
48 + $data['dashboard_sale_width'] = $this->request->post['dashboard_sale_width'];
49 + } else {
50 + $data['dashboard_sale_width'] = $this->config->get('dashboard_sale_width');
51 + }
52 +
53 + $data['columns'] = array();
54 +
55 + for ($i = 3; $i <= 12; $i++) {
56 + $data['columns'][] = $i;
57 + }
58 +
59 + if (isset($this->request->post['dashboard_sale_status'])) {
60 + $data['dashboard_sale_status'] = $this->request->post['dashboard_sale_status'];
61 + } else {
62 + $data['dashboard_sale_status'] = $this->config->get('dashboard_sale_status');
63 + }
64 +
65 + if (isset($this->request->post['dashboard_sale_sort_order'])) {
66 + $data['dashboard_sale_sort_order'] = $this->request->post['dashboard_sale_sort_order'];
67 + } else {
68 + $data['dashboard_sale_sort_order'] = $this->config->get('dashboard_sale_sort_order');
69 + }
70 +
71 + $data['header'] = $this->load->controller('common/header');
72 + $data['column_left'] = $this->load->controller('common/column_left');
73 + $data['footer'] = $this->load->controller('common/footer');
74 +
75 + $this->response->setOutput($this->load->view('extension/dashboard/sale_form', $data));
76 + }
77 +
78 + protected function validate() {
79 + if (!$this->user->hasPermission('modify', 'extension/dashboard/sale')) {
80 + $this->error['warning'] = $this->language->get('error_permission');
81 + }
82 +
83 + return !$this->error;
84 + }
85 +
86 + public function dashboard() {
87 + $this->load->language('extension/dashboard/sale');
88 +
89 + $data['user_token'] = $this->session->data['user_token'];
90 +
91 + $this->load->model('extension/dashboard/sale');
92 +
93 + $today = $this->model_extension_dashboard_sale->getTotalSales(array('filter_date_added' => date('Y-m-d', strtotime('-1 day'))));
94 +
95 + $yesterday = $this->model_extension_dashboard_sale->getTotalSales(array('filter_date_added' => date('Y-m-d', strtotime('-2 day'))));
96 +
97 + $difference = $today - $yesterday;
98 +
99 + if ($difference && (int)$today) {
100 + $data['percentage'] = round(($difference / $today) * 100);
101 + } else {
102 + $data['percentage'] = 0;
103 + }
104 +
105 + $sale_total = $this->model_extension_dashboard_sale->getTotalSales();
106 +
107 + if ($sale_total > 1000000000000) {
108 + $data['total'] = round($sale_total / 1000000000000, 1) . 'T';
109 + } elseif ($sale_total > 1000000000) {
110 + $data['total'] = round($sale_total / 1000000000, 1) . 'B';
111 + } elseif ($sale_total > 1000000) {
112 + $data['total'] = round($sale_total / 1000000, 1) . 'M';
113 + } elseif ($sale_total > 1000) {
114 + $data['total'] = round($sale_total / 1000, 1) . 'K';
115 + } else {
116 + $data['total'] = round($sale_total);
117 + }
118 +
119 + $data['sale'] = $this->url->link('sale/order', 'user_token=' . $this->session->data['user_token'], true);
120 +
121 + return $this->load->view('extension/dashboard/sale_info', $data);
122 + }
123 +}
1 +<?php
2 +class ControllerExtensionExtensionAdvertise extends Controller {
3 + private $error = array();
4 +
5 + public function index() {
6 + $this->load->language('extension/extension/advertise');
7 +
8 + $this->load->model('setting/extension');
9 +
10 + $this->getList();
11 + }
12 +
13 + public function install() {
14 + $this->load->language('extension/extension/advertise');
15 +
16 + $this->load->model('setting/extension');
17 +
18 + if ($this->validate()) {
19 + $this->model_setting_extension->install('advertise', $this->request->get['extension']);
20 +
21 + $this->load->model('user/user_group');
22 +
23 + $this->model_user_user_group->addPermission($this->user->getGroupId(), 'access', 'extension/advertise/' . $this->request->get['extension']);
24 + $this->model_user_user_group->addPermission($this->user->getGroupId(), 'modify', 'extension/advertise/' . $this->request->get['extension']);
25 +
26 + // Compatibility
27 + $this->model_user_user_group->addPermission($this->user->getGroupId(), 'access', 'advertise/' . $this->request->get['extension']);
28 + $this->model_user_user_group->addPermission($this->user->getGroupId(), 'modify', 'advertise/' . $this->request->get['extension']);
29 +
30 + // Call install method if it exsits
31 + $this->load->controller('extension/advertise/' . $this->request->get['extension'] . '/install');
32 +
33 + $this->session->data['success'] = $this->language->get('text_success');
34 + }
35 +
36 + $this->getList();
37 + }
38 +
39 + public function uninstall() {
40 + $this->load->language('extension/extension/advertise');
41 +
42 + $this->load->model('setting/extension');
43 +
44 + if ($this->validate()) {
45 + $this->model_setting_extension->uninstall('advertise', $this->request->get['extension']);
46 +
47 + // Call uninstall method if it exsits
48 + $this->load->controller('extension/advertise/' . $this->request->get['extension'] . '/uninstall');
49 +
50 + $this->session->data['success'] = $this->language->get('text_success');
51 + }
52 +
53 + $this->getList();
54 + }
55 +
56 + protected function getList() {
57 + if (isset($this->error['warning'])) {
58 + $data['error_warning'] = $this->error['warning'];
59 + } else {
60 + $data['error_warning'] = '';
61 + }
62 +
63 + if (isset($this->session->data['success'])) {
64 + $data['success'] = $this->session->data['success'];
65 +
66 + unset($this->session->data['success']);
67 + } else {
68 + $data['success'] = '';
69 + }
70 +
71 + $extensions = $this->model_setting_extension->getInstalled('advertise');
72 +
73 + foreach ($extensions as $key => $value) {
74 + if (!is_file(DIR_APPLICATION . 'controller/extension/advertise/' . $value . '.php') && !is_file(DIR_APPLICATION . 'controller/advertise/' . $value . '.php')) {
75 + $this->model_setting_extension->uninstall('advertise', $value);
76 +
77 + unset($extensions[$key]);
78 + }
79 + }
80 +
81 + $this->load->model('setting/store');
82 + $this->load->model('setting/setting');
83 +
84 + $stores = $this->model_setting_store->getStores();
85 +
86 + $data['extensions'] = array();
87 +
88 + // Compatibility code for old extension folders
89 + $files = glob(DIR_APPLICATION . 'controller/extension/advertise/*.php');
90 +
91 + if ($files) {
92 + foreach ($files as $file) {
93 + $extension = basename($file, '.php');
94 +
95 + // Compatibility code for old extension folders
96 + $this->load->language('extension/advertise/' . $extension, 'extension');
97 +
98 + $store_data = array();
99 +
100 + $store_data[] = array(
101 + 'name' => $this->config->get('config_name'),
102 + 'edit' => $this->url->link('extension/advertise/' . $extension, 'user_token=' . $this->session->data['user_token'] . '&store_id=0', true),
103 + 'status' => $this->config->get('advertise_' . $extension . '_status') ? $this->language->get('text_enabled') : $this->language->get('text_disabled')
104 + );
105 +
106 + foreach ($stores as $store) {
107 + $store_data[] = array(
108 + 'name' => $store['name'],
109 + 'edit' => $this->url->link('extension/advertise/' . $extension, 'user_token=' . $this->session->data['user_token'] . '&store_id=' . $store['store_id'], true),
110 + 'status' => $this->model_setting_setting->getSettingValue('advertise_' . $extension . '_status', $store['store_id']) ? $this->language->get('text_enabled') : $this->language->get('text_disabled')
111 + );
112 + }
113 +
114 + $data['extensions'][] = array(
115 + 'name' => $this->language->get('extension')->get('heading_title'),
116 + 'install' => $this->url->link('extension/extension/advertise/install', 'user_token=' . $this->session->data['user_token'] . '&extension=' . $extension, true),
117 + 'uninstall' => $this->url->link('extension/extension/advertise/uninstall', 'user_token=' . $this->session->data['user_token'] . '&extension=' . $extension, true),
118 + 'installed' => in_array($extension, $extensions),
119 + 'store' => $store_data
120 + );
121 + }
122 + }
123 +
124 + $this->response->setOutput($this->load->view('extension/extension/advertise', $data));
125 + }
126 +
127 + protected function validate() {
128 + if (!$this->user->hasPermission('modify', 'extension/extension/advertise')) {
129 + $this->error['warning'] = $this->language->get('error_permission');
130 + }
131 +
132 + return !$this->error;
133 + }
134 +}
1 +<?php
2 +class ControllerExtensionExtensionAnalytics extends Controller {
3 + private $error = array();
4 +
5 + public function index() {
6 + $this->load->language('extension/extension/analytics');
7 +
8 + $this->load->model('setting/extension');
9 +
10 + $this->getList();
11 + }
12 +
13 + public function install() {
14 + $this->load->language('extension/extension/analytics');
15 +
16 + $this->load->model('setting/extension');
17 +
18 + if ($this->validate()) {
19 + $this->model_setting_extension->install('analytics', $this->request->get['extension']);
20 +
21 + $this->load->model('user/user_group');
22 +
23 + $this->model_user_user_group->addPermission($this->user->getGroupId(), 'access', 'extension/analytics/' . $this->request->get['extension']);
24 + $this->model_user_user_group->addPermission($this->user->getGroupId(), 'modify', 'extension/analytics/' . $this->request->get['extension']);
25 +
26 + // Compatibility
27 + $this->model_user_user_group->addPermission($this->user->getGroupId(), 'access', 'analytics/' . $this->request->get['extension']);
28 + $this->model_user_user_group->addPermission($this->user->getGroupId(), 'modify', 'analytics/' . $this->request->get['extension']);
29 +
30 + // Call install method if it exsits
31 + $this->load->controller('extension/analytics/' . $this->request->get['extension'] . '/install');
32 +
33 + $this->session->data['success'] = $this->language->get('text_success');
34 + }
35 +
36 + $this->getList();
37 + }
38 +
39 + public function uninstall() {
40 + $this->load->language('extension/extension/analytics');
41 +
42 + $this->load->model('setting/extension');
43 +
44 + if ($this->validate()) {
45 + $this->model_setting_extension->uninstall('analytics', $this->request->get['extension']);
46 +
47 + // Call uninstall method if it exsits
48 + $this->load->controller('extension/analytics/' . $this->request->get['extension'] . '/uninstall');
49 +
50 + $this->session->data['success'] = $this->language->get('text_success');
51 + }
52 +
53 + $this->getList();
54 + }
55 +
56 + protected function getList() {
57 + if (isset($this->error['warning'])) {
58 + $data['error_warning'] = $this->error['warning'];
59 + } else {
60 + $data['error_warning'] = '';
61 + }
62 +
63 + if (isset($this->session->data['success'])) {
64 + $data['success'] = $this->session->data['success'];
65 +
66 + unset($this->session->data['success']);
67 + } else {
68 + $data['success'] = '';
69 + }
70 +
71 + $extensions = $this->model_setting_extension->getInstalled('analytics');
72 +
73 + foreach ($extensions as $key => $value) {
74 + if (!is_file(DIR_APPLICATION . 'controller/extension/analytics/' . $value . '.php') && !is_file(DIR_APPLICATION . 'controller/analytics/' . $value . '.php')) {
75 + $this->model_setting_extension->uninstall('analytics', $value);
76 +
77 + unset($extensions[$key]);
78 + }
79 + }
80 +
81 + $this->load->model('setting/store');
82 + $this->load->model('setting/setting');
83 +
84 + $stores = $this->model_setting_store->getStores();
85 +
86 + $data['extensions'] = array();
87 +
88 + // Compatibility code for old extension folders
89 + $files = glob(DIR_APPLICATION . 'controller/extension/analytics/*.php');
90 +
91 + if ($files) {
92 + foreach ($files as $file) {
93 + $extension = basename($file, '.php');
94 +
95 + // Compatibility code for old extension folders
96 + $this->load->language('extension/analytics/' . $extension, 'extension');
97 +
98 + $store_data = array();
99 +
100 + $store_data[] = array(
101 + 'name' => $this->config->get('config_name'),
102 + 'edit' => $this->url->link('extension/analytics/' . $extension, 'user_token=' . $this->session->data['user_token'] . '&store_id=0', true),
103 + 'status' => $this->config->get('analytics_' . $extension . '_status') ? $this->language->get('text_enabled') : $this->language->get('text_disabled')
104 + );
105 +
106 + foreach ($stores as $store) {
107 + $store_data[] = array(
108 + 'name' => $store['name'],
109 + 'edit' => $this->url->link('extension/analytics/' . $extension, 'user_token=' . $this->session->data['user_token'] . '&store_id=' . $store['store_id'], true),
110 + 'status' => $this->model_setting_setting->getSettingValue('analytics_' . $extension . '_status', $store['store_id']) ? $this->language->get('text_enabled') : $this->language->get('text_disabled')
111 + );
112 + }
113 +
114 + $data['extensions'][] = array(
115 + 'name' => $this->language->get('extension')->get('heading_title'),
116 + 'install' => $this->url->link('extension/extension/analytics/install', 'user_token=' . $this->session->data['user_token'] . '&extension=' . $extension, true),
117 + 'uninstall' => $this->url->link('extension/extension/analytics/uninstall', 'user_token=' . $this->session->data['user_token'] . '&extension=' . $extension, true),
118 + 'installed' => in_array($extension, $extensions),
119 + 'store' => $store_data
120 + );
121 + }
122 + }
123 +
124 + $data['promotion'] = $this->load->controller('marketplace/promotion');
125 +
126 + $this->response->setOutput($this->load->view('extension/extension/analytics', $data));
127 + }
128 +
129 + protected function validate() {
130 + if (!$this->user->hasPermission('modify', 'extension/extension/analytics')) {
131 + $this->error['warning'] = $this->language->get('error_permission');
132 + }
133 +
134 + return !$this->error;
135 + }
136 +}
1 +<?php
2 +class ControllerExtensionExtensionCaptcha extends Controller {
3 + private $error = array();
4 +
5 + public function index() {
6 + $this->load->language('extension/extension/captcha');
7 +
8 + $this->load->model('setting/extension');
9 +
10 + $this->getList();
11 + }
12 +
13 + public function install() {
14 + $this->load->language('extension/extension/captcha');
15 +
16 + $this->load->model('setting/extension');
17 +
18 + if ($this->validate()) {
19 + $this->model_setting_extension->install('captcha', $this->request->get['extension']);
20 +
21 + $this->load->model('user/user_group');
22 +
23 + $this->model_user_user_group->addPermission($this->user->getGroupId(), 'access', 'extension/captcha/' . $this->request->get['extension']);
24 + $this->model_user_user_group->addPermission($this->user->getGroupId(), 'modify', 'extension/captcha/' . $this->request->get['extension']);
25 +
26 + // Compatibility
27 + $this->model_user_user_group->addPermission($this->user->getGroupId(), 'access', 'captcha/' . $this->request->get['extension']);
28 + $this->model_user_user_group->addPermission($this->user->getGroupId(), 'modify', 'captcha/' . $this->request->get['extension']);
29 +
30 + // Call install method if it exsits
31 + $this->load->controller('extension/captcha/' . $this->request->get['extension'] . '/install');
32 +
33 + $this->session->data['success'] = $this->language->get('text_success');
34 + }
35 +
36 + $this->getList();
37 + }
38 +
39 + public function uninstall() {
40 + $this->load->language('extension/extension/captcha');
41 +
42 + $this->load->model('setting/extension');
43 +
44 + if ($this->validate()) {
45 + $this->model_setting_extension->uninstall('captcha', $this->request->get['extension']);
46 +
47 + // Call uninstall method if it exsits
48 + $this->load->controller('extension/captcha/' . $this->request->get['extension'] . '/uninstall');
49 +
50 + $this->session->data['success'] = $this->language->get('text_success');
51 + }
52 +
53 + $this->getList();
54 + }
55 +
56 + protected function getList() {
57 + if (isset($this->error['warning'])) {
58 + $data['error_warning'] = $this->error['warning'];
59 + } else {
60 + $data['error_warning'] = '';
61 + }
62 +
63 + if (isset($this->session->data['success'])) {
64 + $data['success'] = $this->session->data['success'];
65 +
66 + unset($this->session->data['success']);
67 + } else {
68 + $data['success'] = '';
69 + }
70 +
71 + $extensions = $this->model_setting_extension->getInstalled('captcha');
72 +
73 + foreach ($extensions as $key => $value) {
74 + if (!is_file(DIR_APPLICATION . 'controller/extension/captcha/' . $value . '.php') && !is_file(DIR_APPLICATION . 'controller/captcha/' . $value . '.php')) {
75 + $this->model_setting_extension->uninstall('captcha', $value);
76 +
77 + unset($extensions[$key]);
78 + }
79 + }
80 +
81 + $data['extensions'] = array();
82 +
83 + // Compatibility code for old extension folders
84 + $files = glob(DIR_APPLICATION . 'controller/extension/captcha/*.php');
85 +
86 + if ($files) {
87 + foreach ($files as $file) {
88 + $extension = basename($file, '.php');
89 +
90 + $this->load->language('extension/captcha/' . $extension, 'extension');
91 +
92 + $data['extensions'][] = array(
93 + 'name' => $this->language->get('extension')->get('heading_title') . (($extension == $this->config->get('config_captcha')) ? $this->language->get('text_default') : null),
94 + 'status' => $this->config->get('captcha_' . $extension . '_status') ? $this->language->get('text_enabled') : $this->language->get('text_disabled'),
95 + 'install' => $this->url->link('extension/extension/captcha/install', 'user_token=' . $this->session->data['user_token'] . '&extension=' . $extension, true),
96 + 'uninstall' => $this->url->link('extension/extension/captcha/uninstall', 'user_token=' . $this->session->data['user_token'] . '&extension=' . $extension, true),
97 + 'installed' => in_array($extension, $extensions),
98 + 'edit' => $this->url->link('extension/captcha/' . $extension, 'user_token=' . $this->session->data['user_token'], true)
99 + );
100 + }
101 + }
102 +
103 + $sort_order = array();
104 + foreach ($data['extensions'] as $key => $value) {
105 + if($value['installed']){
106 + $add = '0';
107 + }else{
108 + $add = '1';
109 + }
110 + $sort_order[$key] = $add.$value['name'];
111 + }
112 + array_multisort($sort_order, SORT_ASC, $data['extensions']);
113 +
114 + $data['promotion'] = $this->load->controller('marketplace/promotion');
115 +
116 + $this->response->setOutput($this->load->view('extension/extension/captcha', $data));
117 + }
118 +
119 + protected function validate() {
120 + if (!$this->user->hasPermission('modify', 'extension/extension/captcha')) {
121 + $this->error['warning'] = $this->language->get('error_permission');
122 + }
123 +
124 + return !$this->error;
125 + }
126 +}
...\ No newline at end of file ...\ 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.