Version Description
(17th June 2016) = * Last Version 2 release with beta notice
Download this release
Release Info
Developer | ResponsiveMenu |
Plugin | ![]() |
Version | 2.8.9 |
Comparing to | |
See all releases |
Code changes from version 3.0.9 to 2.8.9
- app/autoload.php +64 -0
- app/bootstrap.php +25 -0
- app/config.php +324 -0
- app/controllers/AdminController.php +168 -0
- app/controllers/BaseController.php +22 -0
- app/controllers/CSSController.php +74 -0
- app/controllers/FrontController.php +50 -0
- app/controllers/GlobalController.php +65 -0
- app/controllers/HTMLController.php +84 -0
- app/controllers/InstallController.php +40 -0
- app/controllers/JSController.php +76 -0
- app/controllers/UpgradeController.php +66 -0
- app/library/responsive-menu/Export.php +49 -0
- app/library/responsive-menu/Import.php +50 -0
- app/library/responsive-menu/Input.php +82 -0
- app/library/responsive-menu/MenuWalker.php +15 -0
- app/library/responsive-menu/Registry.php +51 -0
- app/library/responsive-menu/ResponsiveMenu.php +144 -0
- app/library/responsive-menu/Shortcode.php +24 -0
- app/library/responsive-menu/Status.php +48 -0
- app/library/responsive-menu/Transient.php +89 -0
- app/library/responsive-menu/View.php +96 -0
- app/models/AdminModel.php +386 -0
- app/models/BaseModel.php +70 -0
- app/models/CSSModel.php +542 -0
- app/models/FolderModel.php +38 -0
- app/models/JSModel.php +725 -0
- app/views/admin/page.phtml +2387 -0
- app/views/click-button.phtml +66 -0
- app/views/menu.phtml +75 -0
- autoload.php +0 -13
- public/export/export.xml +1 -0
- public/imgs/icon.png +0 -0
- public/js/touch.js +3 -0
- readme.txt +86 -181
- responsive-menu.php +36 -72
- src/app/Collections/OptionsCollection.php +0 -84
- src/app/Controllers/Admin.php +0 -58
- src/app/Controllers/Front.php +0 -81
- src/app/Database/Database.php +0 -10
- src/app/Database/Migration.php +0 -204
- src/app/Database/WpDatabase.php +0 -41
- src/app/Factories/AdminSaveFactory.php +0 -42
- src/app/Factories/CssFactory.php +0 -34
- src/app/Factories/FrontDisplayFactory.php +0 -41
- src/app/Factories/JsFactory.php +0 -23
- src/app/Factories/OptionFactory.php +0 -26
- src/app/Filesystem/FileCreator.php +0 -30
- src/app/Filters/Filter.php +0 -8
- src/app/Filters/HtmlFilter.php +0 -12
- src/app/Filters/JsonFilter.php +0 -12
- src/app/Filters/TextFilter.php +0 -12
- src/app/Form/Checkbox.php +0 -28
- src/app/Form/Colour.php +0 -19
- src/app/Form/Export.php +0 -13
- src/app/Form/FontIconPageList.php +0 -74
- src/app/Form/FormComponent.php +0 -8
- src/app/Form/HeaderBarOrdering.php +0 -49
- src/app/Form/Image.php +0 -25
- src/app/Form/Import.php +0 -14
- src/app/Form/MenuOrdering.php +0 -49
- src/app/Form/Reset.php +0 -13
- src/app/Form/Select.php +0 -24
- src/app/Form/Text.php +0 -20
- src/app/Form/TextArea.php +0 -17
- src/app/Formatters/Minify.php +0 -24
- src/app/Mappers/JsMapper.php +0 -192
- src/app/Mappers/ScssBaseMapper.php +0 -202
- src/app/Mappers/ScssButtonMapper.php +0 -63
- src/app/Mappers/ScssMapper.php +0 -19
- src/app/Mappers/ScssMenuMapper.php +0 -172
- src/app/Mappers/scssphp/.travis.yml +0 -7
- src/app/Mappers/scssphp/LICENSE.md +0 -660
- src/app/Mappers/scssphp/Makefile +0 -3
- src/app/Mappers/scssphp/README.md +0 -34
- src/app/Mappers/scssphp/composer.json +0 -28
- src/app/Mappers/scssphp/phpunit.xml.dist +0 -28
- src/app/Mappers/scssphp/pscss +0 -53
- src/app/Mappers/scssphp/scss.inc.php +0 -4577
- src/app/Mappers/scssphp/tests/ApiTest.php +0 -80
- src/app/Mappers/scssphp/tests/ExceptionTest.php +0 -86
- src/app/Mappers/scssphp/tests/InputTest.php +0 -83
- src/app/Mappers/scssphp/tests/compare-scss.sh +0 -25
- src/app/Mappers/scssphp/tests/inputs/builtins.scss +0 -171
- src/app/Mappers/scssphp/tests/inputs/comments.scss +0 -28
- src/app/Mappers/scssphp/tests/inputs/compass_extract.scss +0 -248
- src/app/Mappers/scssphp/tests/inputs/content.scss +0 -61
- src/app/Mappers/scssphp/tests/inputs/content_with_function.scss +0 -17
- src/app/Mappers/scssphp/tests/inputs/default_args.scss +0 -15
- src/app/Mappers/scssphp/tests/inputs/directives.scss +0 -108
- src/app/Mappers/scssphp/tests/inputs/extends.scss +0 -184
- src/app/Mappers/scssphp/tests/inputs/filter_effects.scss +0 -48
- src/app/Mappers/scssphp/tests/inputs/functions.scss +0 -81
- src/app/Mappers/scssphp/tests/inputs/ie7.scss +0 -12
- src/app/Mappers/scssphp/tests/inputs/if.scss +0 -76
- src/app/Mappers/scssphp/tests/inputs/if_on_null.scss +0 -8
- src/app/Mappers/scssphp/tests/inputs/import.scss +0 -23
- src/app/Mappers/scssphp/tests/inputs/imports/_partial.scss +0 -10
- src/app/Mappers/scssphp/tests/inputs/imports/simple.scss +0 -4
- src/app/Mappers/scssphp/tests/inputs/interpolation.scss +0 -86
- src/app/Mappers/scssphp/tests/inputs/keyword_args.scss +0 -24
- src/app/Mappers/scssphp/tests/inputs/list.scss +0 -15
- src/app/Mappers/scssphp/tests/inputs/looping.scss +0 -51
- src/app/Mappers/scssphp/tests/inputs/media.scss +0 -208
- src/app/Mappers/scssphp/tests/inputs/mixins.scss +0 -158
- src/app/Mappers/scssphp/tests/inputs/nesting.scss +0 -45
- src/app/Mappers/scssphp/tests/inputs/null.scss +0 -41
- src/app/Mappers/scssphp/tests/inputs/operators.scss +0 -143
- src/app/Mappers/scssphp/tests/inputs/placeholder_selector.scss +0 -18
- src/app/Mappers/scssphp/tests/inputs/scss_css.scss +0 -986
- src/app/Mappers/scssphp/tests/inputs/selectors.scss +0 -187
- src/app/Mappers/scssphp/tests/inputs/values.scss +0 -43
- src/app/Mappers/scssphp/tests/inputs/variables.scss +0 -56
- src/app/Mappers/scssphp/tests/outputs/builtins.css +0 -126
- src/app/Mappers/scssphp/tests/outputs/comments.css +0 -19
- src/app/Mappers/scssphp/tests/outputs/compass_extract.css +0 -28
- src/app/Mappers/scssphp/tests/outputs/content.css +0 -29
- src/app/Mappers/scssphp/tests/outputs/content_with_function.css +0 -2
- src/app/Mappers/scssphp/tests/outputs/default_args.css +0 -3
- src/app/Mappers/scssphp/tests/outputs/directives.css +0 -77
- src/app/Mappers/scssphp/tests/outputs/extends.css +0 -87
- src/app/Mappers/scssphp/tests/outputs/filter_effects.css +0 -20
- src/app/Mappers/scssphp/tests/outputs/functions.css +0 -22
- src/app/Mappers/scssphp/tests/outputs/ie7.css +0 -8
- src/app/Mappers/scssphp/tests/outputs/if.css +0 -21
- src/app/Mappers/scssphp/tests/outputs/if_on_null.css +0 -2
- src/app/Mappers/scssphp/tests/outputs/import.css +0 -27
- src/app/Mappers/scssphp/tests/outputs/interpolation.css +0 -54
- src/app/Mappers/scssphp/tests/outputs/keyword_args.css +0 -6
- src/app/Mappers/scssphp/tests/outputs/list.css +0 -7
- src/app/Mappers/scssphp/tests/outputs/looping.css +0 -45
- src/app/Mappers/scssphp/tests/outputs/media.css +0 -103
- src/app/Mappers/scssphp/tests/outputs/mixins.css +0 -83
- src/app/Mappers/scssphp/tests/outputs/nesting.css +0 -22
- src/app/Mappers/scssphp/tests/outputs/null.css +0 -21
- src/app/Mappers/scssphp/tests/outputs/operators.css +0 -105
- src/app/Mappers/scssphp/tests/outputs/placeholder_selector.css +0 -7
- src/app/Mappers/scssphp/tests/outputs/scss_css.css +0 -741
- src/app/Mappers/scssphp/tests/outputs/selectors.css +0 -335
- src/app/Mappers/scssphp/tests/outputs/values.css +0 -34
- src/app/Mappers/scssphp/tests/outputs/variables.css +0 -24
- src/app/Models/Option.php +0 -45
- src/app/Repositories/OptionRepository.php +0 -54
- src/app/Routing/Container.php +0 -241
- src/app/Routing/Routing.php +0 -8
- src/app/Routing/WpRouting.php +0 -65
- src/app/Services/OptionService.php +0 -63
- src/app/View/AdminView.php +0 -38
- src/app/View/FrontView.php +0 -24
- src/app/View/View.php +0 -8
- src/app/ViewModels/Button.php +0 -19
- src/app/ViewModels/Components/Admin/Boxes.php +0 -102
- src/app/ViewModels/Components/Admin/Tabs.php +0 -26
- src/app/ViewModels/Components/Button/Button.php +0 -39
- src/app/ViewModels/Components/Menu/AdditionalContent.php +0 -20
- src/app/ViewModels/Components/Menu/Menu.php +0 -35
- src/app/ViewModels/Components/Menu/Search.php +0 -21
- src/app/ViewModels/Components/Menu/Title.php +0 -49
- src/app/ViewModels/Components/ViewComponent.php +0 -11
- src/app/ViewModels/Menu.php +0 -32
- src/app/WPML/WPML.php +0 -22
- src/app/Walkers/WpWalker.php +0 -118
- src/config/admin_ordering.php +0 -1167
- src/config/default_options.php +0 -157
- src/config/option_helpers.php +0 -19
- src/config/route_dependencies.php +0 -84
- src/public/css/admin/main.css +0 -717
- src/public/js/admin/main.js +0 -65
- src/public/js/admin/postbox-edit.js +0 -4
- src/public/scss/hamburgers/_base.scss +0 -69
- src/public/scss/hamburgers/hamburgers.scss +0 -57
- src/public/scss/hamburgers/types/_boring.scss +0 -30
- src/views/admin/main.phtml +0 -108
- src/views/button.phtml +0 -1
- src/views/menu.phtml +0 -8
- src/views/preview.phtml +0 -16
- translations/responsive-menu-de_DE.mo +0 -0
- translations/responsive-menu-de_DE.po +958 -0
- translations/responsive-menu-es_ES.mo +0 -0
- translations/responsive-menu-es_ES.po +872 -488
- translations/responsive-menu-fr_FR.mo +0 -0
- translations/responsive-menu-fr_FR.po +1093 -0
- translations/responsive-menu-hr.mo +0 -0
- translations/responsive-menu-hr.po +1131 -0
- translations/responsive-menu-nl_NL.mo +0 -0
- translations/responsive-menu-nl_NL.po +1089 -0
- translations/responsive-menu.mo +0 -0
- translations/responsive-menu.po +958 -0
- wpml-config.xml +14 -0
app/autoload.php
ADDED
@@ -0,0 +1,64 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/*
|
4 |
+
|--------------------------------------------------------------------------
|
5 |
+
| Autoload our application
|
6 |
+
|--------------------------------------------------------------------------
|
7 |
+
|
|
8 |
+
| Here we include all our required files for the application to run correctly.
|
9 |
+
| At the moment this is a big mess of require_once calls and needs to be
|
10 |
+
| tidied up with an autoloader function
|
11 |
+
|
|
12 |
+
*/
|
13 |
+
|
14 |
+
define( 'RM_PLUGIN_DIR', plugin_dir_path( __FILE__ ) );
|
15 |
+
|
16 |
+
require_once RM_PLUGIN_DIR . 'library/responsive-menu/Registry.php';
|
17 |
+
|
18 |
+
require_once RM_PLUGIN_DIR . 'config.php';
|
19 |
+
|
20 |
+
require_once RM_PLUGIN_DIR . 'library/responsive-menu/ResponsiveMenu.php';
|
21 |
+
|
22 |
+
require_once RM_PLUGIN_DIR . 'library/responsive-menu/View.php';
|
23 |
+
|
24 |
+
require_once RM_PLUGIN_DIR . 'library/responsive-menu/Status.php';
|
25 |
+
|
26 |
+
require_once RM_PLUGIN_DIR . 'library/responsive-menu/Input.php';
|
27 |
+
|
28 |
+
require_once RM_PLUGIN_DIR . 'library/responsive-menu/Shortcode.php';
|
29 |
+
|
30 |
+
require_once RM_PLUGIN_DIR . 'library/responsive-menu/MenuWalker.php';
|
31 |
+
|
32 |
+
require_once RM_PLUGIN_DIR . 'library/responsive-menu/Import.php';
|
33 |
+
|
34 |
+
require_once RM_PLUGIN_DIR . 'library/responsive-menu/Export.php';
|
35 |
+
|
36 |
+
require_once RM_PLUGIN_DIR . 'library/responsive-menu/Transient.php';
|
37 |
+
|
38 |
+
require_once RM_PLUGIN_DIR . 'controllers/BaseController.php';
|
39 |
+
|
40 |
+
require_once RM_PLUGIN_DIR . 'controllers/AdminController.php';
|
41 |
+
|
42 |
+
require_once RM_PLUGIN_DIR . 'controllers/FrontController.php';
|
43 |
+
|
44 |
+
require_once RM_PLUGIN_DIR . 'controllers/GlobalController.php';
|
45 |
+
|
46 |
+
require_once RM_PLUGIN_DIR . 'controllers/InstallController.php';
|
47 |
+
|
48 |
+
require_once RM_PLUGIN_DIR . 'controllers/HTMLController.php';
|
49 |
+
|
50 |
+
require_once RM_PLUGIN_DIR . 'controllers/JSController.php';
|
51 |
+
|
52 |
+
require_once RM_PLUGIN_DIR . 'controllers/CSSController.php';
|
53 |
+
|
54 |
+
require_once RM_PLUGIN_DIR . 'controllers/UpgradeController.php';
|
55 |
+
|
56 |
+
require_once RM_PLUGIN_DIR . 'models/BaseModel.php';
|
57 |
+
|
58 |
+
require_once RM_PLUGIN_DIR . 'models/AdminModel.php';
|
59 |
+
|
60 |
+
require_once RM_PLUGIN_DIR . 'models/FolderModel.php';
|
61 |
+
|
62 |
+
require_once RM_PLUGIN_DIR . 'models/CSSModel.php';
|
63 |
+
|
64 |
+
require_once RM_PLUGIN_DIR . 'models/JSModel.php';
|
app/bootstrap.php
ADDED
@@ -0,0 +1,25 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/*
|
4 |
+
|--------------------------------------------------------------------------
|
5 |
+
| Autoload our application
|
6 |
+
|--------------------------------------------------------------------------
|
7 |
+
|
|
8 |
+
| Here we include our autoloader file that will deal with including all our
|
9 |
+
| required class files.
|
10 |
+
|
|
11 |
+
*/
|
12 |
+
|
13 |
+
require_once dirname( __FILE__ ) . '/autoload.php';
|
14 |
+
|
15 |
+
|
16 |
+
/*
|
17 |
+
|--------------------------------------------------------------------------
|
18 |
+
| Create The Application
|
19 |
+
|--------------------------------------------------------------------------
|
20 |
+
|
|
21 |
+
| The first real thing we will do is create a new Responsive Menu instance.
|
22 |
+
|
|
23 |
+
*/
|
24 |
+
|
25 |
+
$app = new ResponsiveMenu;
|
app/config.php
ADDED
@@ -0,0 +1,324 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
|
4 |
+
/*
|
5 |
+
|--------------------------------------------------------------------------
|
6 |
+
| Configuration Settings
|
7 |
+
|--------------------------------------------------------------------------
|
8 |
+
|
|
9 |
+
| Although some people aren't fans of array configurations, here we have one!
|
10 |
+
| This is where we set paths and our version number among other things.
|
11 |
+
|
|
12 |
+
*/
|
13 |
+
|
14 |
+
$config = array(
|
15 |
+
|
16 |
+
|
17 |
+
'current_version' => "2.8.9",
|
18 |
+
|
19 |
+
|
20 |
+
'plugins_dir' => plugin_dir_path( __FILE__ ),
|
21 |
+
|
22 |
+
|
23 |
+
'plugins_base_uri' => plugin_dir_url( dirname( __FILE__ ) ),
|
24 |
+
|
25 |
+
|
26 |
+
'plugin_base_dir' => dirname( plugin_dir_path( __FILE__ ) ),
|
27 |
+
|
28 |
+
|
29 |
+
'plugin_base_uri' => plugin_dir_url( dirname( __FILE__ ) ),
|
30 |
+
|
31 |
+
|
32 |
+
'plugin_data_uri' => plugin_dir_url( dirname( dirname( __FILE__ ) ) ) . 'responsive-menu-data/',
|
33 |
+
|
34 |
+
|
35 |
+
'plugin_data_dir' => dirname( dirname( plugin_dir_path( __FILE__ ) ) ) . '/responsive-menu-data/',
|
36 |
+
|
37 |
+
|
38 |
+
);
|
39 |
+
|
40 |
+
/*
|
41 |
+
|--------------------------------------------------------------------------
|
42 |
+
| Save Config to the Registry
|
43 |
+
|--------------------------------------------------------------------------
|
44 |
+
|
|
45 |
+
| Again, some people don't like Registry's in PHP Applications, but here we
|
46 |
+
| have one and it is very useful for retrieving our settings throughout the app
|
47 |
+
|
|
48 |
+
*/
|
49 |
+
|
50 |
+
RM_Registry::set( 'config', $config );
|
51 |
+
|
52 |
+
|
53 |
+
/*
|
54 |
+
|--------------------------------------------------------------------------
|
55 |
+
| Responsive Menu Defaults
|
56 |
+
|--------------------------------------------------------------------------
|
57 |
+
|
|
58 |
+
| Another configuration array of type, this time we hold all the application
|
59 |
+
| default options.
|
60 |
+
|
|
61 |
+
*/
|
62 |
+
|
63 |
+
$defaults = array(
|
64 |
+
|
65 |
+
|
66 |
+
'RM' => '',
|
67 |
+
|
68 |
+
|
69 |
+
'RMBreak' => 800,
|
70 |
+
|
71 |
+
|
72 |
+
'RMDepth' => 2,
|
73 |
+
|
74 |
+
|
75 |
+
'RMTop' => 10,
|
76 |
+
|
77 |
+
|
78 |
+
'RMRight' => 5,
|
79 |
+
|
80 |
+
|
81 |
+
'RMCss' => '',
|
82 |
+
|
83 |
+
|
84 |
+
'RMTitle' => __( 'Menu Title', 'responsive-menu' ),
|
85 |
+
|
86 |
+
|
87 |
+
'RMLineCol' => '#FFFFFF',
|
88 |
+
|
89 |
+
|
90 |
+
'RMClickBkg' => '#000000',
|
91 |
+
|
92 |
+
|
93 |
+
'RMClickTitle' => '',
|
94 |
+
|
95 |
+
|
96 |
+
'RMBkgTran' => false,
|
97 |
+
|
98 |
+
|
99 |
+
'RMFont' => '',
|
100 |
+
|
101 |
+
|
102 |
+
'RMPos' => '',
|
103 |
+
|
104 |
+
|
105 |
+
'RMImage' => '',
|
106 |
+
|
107 |
+
|
108 |
+
'RMWidth' => '75',
|
109 |
+
|
110 |
+
|
111 |
+
'RMBkg' => '#43494C',
|
112 |
+
|
113 |
+
|
114 |
+
'RMBkgHov' => '#3C3C3C',
|
115 |
+
|
116 |
+
|
117 |
+
'RMTitleCol' => '#FFFFFF',
|
118 |
+
|
119 |
+
|
120 |
+
'RMTextCol' => '#FFFFFF',
|
121 |
+
|
122 |
+
|
123 |
+
'RMBorCol' => '#3C3C3C',
|
124 |
+
|
125 |
+
|
126 |
+
'RMTextColHov' => '#FFFFFF',
|
127 |
+
|
128 |
+
|
129 |
+
'RMTitleColHov' => '#FFFFFF',
|
130 |
+
|
131 |
+
|
132 |
+
/* Added in 1.6 */
|
133 |
+
|
134 |
+
|
135 |
+
'RMAnim' => 'overlay',
|
136 |
+
|
137 |
+
|
138 |
+
'RMPushCSS' => '',
|
139 |
+
|
140 |
+
|
141 |
+
'RMTitleBkg' => '#43494C',
|
142 |
+
|
143 |
+
|
144 |
+
'RMFontSize' => 13,
|
145 |
+
|
146 |
+
|
147 |
+
'RMTitleSize' => 14,
|
148 |
+
|
149 |
+
|
150 |
+
'RMBtnSize' => 13,
|
151 |
+
|
152 |
+
|
153 |
+
'RMCurBkg' => '#43494C',
|
154 |
+
|
155 |
+
|
156 |
+
'RMCurCol' => '#FFFFFF',
|
157 |
+
|
158 |
+
|
159 |
+
'RMAnimSpd' => 0.5,
|
160 |
+
|
161 |
+
|
162 |
+
/* Added in 1.7 */
|
163 |
+
|
164 |
+
|
165 |
+
'RMTranSpd' => 1,
|
166 |
+
|
167 |
+
|
168 |
+
'RMTxtAlign' => 'left',
|
169 |
+
|
170 |
+
|
171 |
+
'RMSearch' => false,
|
172 |
+
|
173 |
+
|
174 |
+
'RMExpand' => false,
|
175 |
+
|
176 |
+
|
177 |
+
'RMLinkHeight' => 20,
|
178 |
+
|
179 |
+
|
180 |
+
/* Added in 1.8 */
|
181 |
+
|
182 |
+
|
183 |
+
'RMExternal' => false,
|
184 |
+
|
185 |
+
|
186 |
+
'RMSide' => 'left',
|
187 |
+
|
188 |
+
|
189 |
+
/* Added in 1.9 */
|
190 |
+
|
191 |
+
|
192 |
+
'RMFooter' => true,
|
193 |
+
|
194 |
+
|
195 |
+
'RMClickImg' => false,
|
196 |
+
|
197 |
+
|
198 |
+
'RMMinify' => true,
|
199 |
+
|
200 |
+
|
201 |
+
'RMClickClose' => false,
|
202 |
+
|
203 |
+
|
204 |
+
'RMRemImp' => false,
|
205 |
+
|
206 |
+
|
207 |
+
'RMX' => false,
|
208 |
+
|
209 |
+
|
210 |
+
'RMMinWidth' => null,
|
211 |
+
|
212 |
+
|
213 |
+
/* Added in 2.0 */
|
214 |
+
|
215 |
+
|
216 |
+
'RMMaxWidth' => null,
|
217 |
+
|
218 |
+
|
219 |
+
'RMExpandPar' => true,
|
220 |
+
|
221 |
+
|
222 |
+
'RMIgnParCli' => false,
|
223 |
+
|
224 |
+
|
225 |
+
'RMCliToClo' => false,
|
226 |
+
|
227 |
+
|
228 |
+
'RMSearchPos' => 'below',
|
229 |
+
|
230 |
+
|
231 |
+
'RMTitleLink' => null,
|
232 |
+
|
233 |
+
|
234 |
+
'RMTitleLoc' => '_self',
|
235 |
+
|
236 |
+
|
237 |
+
'RMHtml' => null,
|
238 |
+
|
239 |
+
|
240 |
+
'RMHtmlLoc' => 'bottom',
|
241 |
+
|
242 |
+
|
243 |
+
/* Added in 2.1 */
|
244 |
+
|
245 |
+
'RMShortcode' => false,
|
246 |
+
|
247 |
+
|
248 |
+
/* Added in 2.2 */
|
249 |
+
|
250 |
+
'RMLineHeight' => 5,
|
251 |
+
|
252 |
+
|
253 |
+
'RMLineWidth' => 33,
|
254 |
+
|
255 |
+
|
256 |
+
'RMLineMargin' => 6,
|
257 |
+
|
258 |
+
|
259 |
+
'RMClickImgClicked' => null,
|
260 |
+
|
261 |
+
|
262 |
+
'RMAccordion' => false,
|
263 |
+
|
264 |
+
|
265 |
+
'RMArShpA' => json_encode( '▲' ),
|
266 |
+
|
267 |
+
|
268 |
+
'RMArShpI' => json_encode( '▼' ),
|
269 |
+
|
270 |
+
|
271 |
+
'RMArImgA' => false,
|
272 |
+
|
273 |
+
|
274 |
+
'RMArImgI' => false,
|
275 |
+
|
276 |
+
|
277 |
+
/* Added in 2.3 */
|
278 |
+
|
279 |
+
'RMTrigger' => '#click-menu',
|
280 |
+
|
281 |
+
|
282 |
+
'RMPushBtn' => false,
|
283 |
+
|
284 |
+
|
285 |
+
'RMCurBkgHov' => '#43494C',
|
286 |
+
|
287 |
+
|
288 |
+
'RMCurColHov' => '#FFFFFF',
|
289 |
+
|
290 |
+
|
291 |
+
'RMWalker' => null,
|
292 |
+
|
293 |
+
/* Added in 2.4 */
|
294 |
+
|
295 |
+
'RMUseTran' => null,
|
296 |
+
|
297 |
+
|
298 |
+
'RMLoc' => 'right',
|
299 |
+
|
300 |
+
/* Added in 2.6 by Mkdgs*/
|
301 |
+
|
302 |
+
'RMThemeLocation' => null,
|
303 |
+
|
304 |
+
/* Added in 2.8.7 */
|
305 |
+
|
306 |
+
'RMClickTitlePos' => 'bottom',
|
307 |
+
|
308 |
+
'RMClickTitleHeight' => '14'
|
309 |
+
|
310 |
+
);
|
311 |
+
|
312 |
+
|
313 |
+
/*
|
314 |
+
|--------------------------------------------------------------------------
|
315 |
+
| Save Defaults to the Registry
|
316 |
+
|--------------------------------------------------------------------------
|
317 |
+
|
|
318 |
+
| Again, some people don't like Registry's in PHP Applications, but here we
|
319 |
+
| have it again and it is very useful for retrieving our default values
|
320 |
+
| throughout the app
|
321 |
+
|
|
322 |
+
*/
|
323 |
+
|
324 |
+
RM_Registry::set( 'defaults', $defaults );
|
app/controllers/AdminController.php
ADDED
@@ -0,0 +1,168 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
|
4 |
+
class RM_AdminController extends RM_BaseController {
|
5 |
+
|
6 |
+
|
7 |
+
/**
|
8 |
+
* Prepare our Admin Options
|
9 |
+
*
|
10 |
+
* @return null
|
11 |
+
* @added 2.0
|
12 |
+
*/
|
13 |
+
|
14 |
+
static function prepare() {
|
15 |
+
|
16 |
+
// Check that we are in the admin area
|
17 |
+
if( is_admin() ) :
|
18 |
+
|
19 |
+
add_filter( 'plugin_action_links', array( 'RM_AdminController', 'addSettingsLink' ), 10, 2 );
|
20 |
+
add_action( 'admin_menu', array( 'RM_AdminController', 'addMenus' ) );
|
21 |
+
|
22 |
+
// Clear Transients on Saving/Updating Menus/Posts
|
23 |
+
// Added 2.4
|
24 |
+
|
25 |
+
if( ResponsiveMenu::getOption( 'RMUseTran' ) ) :
|
26 |
+
add_action( 'wp_update_nav_menu', array( 'RM_Transient', 'clearTransientMenus' ) );
|
27 |
+
add_action( 'save_post', array( 'RM_Transient', 'clearTransientMenus' ) );
|
28 |
+
endif;
|
29 |
+
|
30 |
+
// Specifically for Responsive Menu Page
|
31 |
+
if( isset( $_GET['page'] ) && $_GET['page'] == 'responsive-menu' ) :
|
32 |
+
|
33 |
+
add_action( 'admin_enqueue_scripts', array( 'RM_AdminController', 'colorpicker' ) );
|
34 |
+
|
35 |
+
endif;
|
36 |
+
|
37 |
+
|
38 |
+
endif;
|
39 |
+
|
40 |
+
|
41 |
+
}
|
42 |
+
|
43 |
+
|
44 |
+
/**
|
45 |
+
* Create our admin menus.
|
46 |
+
*
|
47 |
+
* @return null
|
48 |
+
* @added 1.0
|
49 |
+
*/
|
50 |
+
|
51 |
+
static function addMenus() {
|
52 |
+
|
53 |
+
|
54 |
+
add_menu_page(
|
55 |
+
|
56 |
+
__( 'Responsive Menu', 'responsive-menu' ),
|
57 |
+
__( 'Responsive Menu', 'responsive-menu' ),
|
58 |
+
'manage_options',
|
59 |
+
'responsive-menu',
|
60 |
+
array( 'RM_AdminController', 'adminPage' ),
|
61 |
+
RM_Registry::get( 'config', 'plugins_base_uri' ) . 'public/imgs/icon.png'
|
62 |
+
|
63 |
+
);
|
64 |
+
|
65 |
+
|
66 |
+
}
|
67 |
+
|
68 |
+
/**
|
69 |
+
* Creates the main admin page and saves the data if submitted
|
70 |
+
*
|
71 |
+
* @return null
|
72 |
+
* @added 1.0
|
73 |
+
*/
|
74 |
+
|
75 |
+
static function adminPage() {
|
76 |
+
|
77 |
+
if( RM_Input::post( 'RMExport' ) ) :
|
78 |
+
|
79 |
+
RM_Export::export();
|
80 |
+
|
81 |
+
endif;
|
82 |
+
|
83 |
+
if( RM_Input::post( 'RMSubmit' )
|
84 |
+
|| RM_Input::post( 'RMImport' )
|
85 |
+
|| RM_Input::post( 'RMReset' ) ) :
|
86 |
+
|
87 |
+
$data = RM_Input::post( 'RMImport' ) ? RM_Import::getData( RM_Input::file( 'RMImportFile' ) ) : RM_Input::post();
|
88 |
+
|
89 |
+
/* Reset to defaults */
|
90 |
+
if( RM_Input::post( 'RMReset' ) ) :
|
91 |
+
$data = RM_Registry::get( 'defaults' );
|
92 |
+
$data['RMArShpA'] = json_decode( $data['RMArShpA'] );
|
93 |
+
$data['RMArShpI'] = json_decode( $data['RMArShpI'] );
|
94 |
+
endif;
|
95 |
+
|
96 |
+
RM_AdminModel::save( $data );
|
97 |
+
|
98 |
+
if( ResponsiveMenu::getOption( 'RMExternal' ) ) :
|
99 |
+
|
100 |
+
RM_FolderModel::create();
|
101 |
+
|
102 |
+
$js = RM_JSModel::getJs( ResponsiveMenu::getOptions() );
|
103 |
+
$js = ResponsiveMenu::getOption( 'RMMinify' ) == 'minify' ? RM_JSModel::Minify( $js ) : $js = $js;
|
104 |
+
RM_JSModel::createJSFile( $js );
|
105 |
+
|
106 |
+
|
107 |
+
$css = RM_CSSModel::getCSS( ResponsiveMenu::getOptions() );
|
108 |
+
$css = ResponsiveMenu::getOption( 'RMMinify' ) == 'minify' ? RM_JSModel::Minify( $css ) : $css = $css;
|
109 |
+
RM_CSSModel::createCSSFile( $css );
|
110 |
+
|
111 |
+
|
112 |
+
endif;
|
113 |
+
|
114 |
+
|
115 |
+
endif;
|
116 |
+
|
117 |
+
RM_View::make( 'admin.page', ResponsiveMenu::getOptions() );
|
118 |
+
|
119 |
+
|
120 |
+
}
|
121 |
+
|
122 |
+
/**
|
123 |
+
* Adds the WordPress Colour Picker to the admin options page
|
124 |
+
*
|
125 |
+
* @return null
|
126 |
+
* @added 1.0
|
127 |
+
*/
|
128 |
+
|
129 |
+
static function colorpicker(){
|
130 |
+
|
131 |
+
|
132 |
+
wp_enqueue_media();
|
133 |
+
wp_enqueue_style( 'wp-color-picker' );
|
134 |
+
wp_enqueue_script( 'wp-color-picker' );
|
135 |
+
|
136 |
+
|
137 |
+
}
|
138 |
+
|
139 |
+
|
140 |
+
/**
|
141 |
+
* Adds the settings link on the WordPress Plugins Page
|
142 |
+
*
|
143 |
+
* @param array $links
|
144 |
+
* @param string $file
|
145 |
+
* @return array
|
146 |
+
* @added 2.0
|
147 |
+
*/
|
148 |
+
|
149 |
+
static function addSettingsLink( $links, $file ) {
|
150 |
+
|
151 |
+
|
152 |
+
if ( $file == 'responsive-menu/responsive-menu.php' ) :
|
153 |
+
|
154 |
+
$settings_link = '<a href="' . get_bloginfo('wpurl') . '/wp-admin/admin.php?page=responsive-menu">';
|
155 |
+
$settings_link .= __( 'Settings', 'responsive-menu' );
|
156 |
+
$settings_link .= '</a>';
|
157 |
+
|
158 |
+
array_unshift( $links, $settings_link );
|
159 |
+
|
160 |
+
endif;
|
161 |
+
|
162 |
+
return $links;
|
163 |
+
|
164 |
+
|
165 |
+
}
|
166 |
+
|
167 |
+
|
168 |
+
}
|
app/controllers/BaseController.php
ADDED
@@ -0,0 +1,22 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class RM_BaseController {
|
4 |
+
|
5 |
+
|
6 |
+
/**
|
7 |
+
* Determines wether to display scripts in footer
|
8 |
+
*
|
9 |
+
* @return boolean
|
10 |
+
* @added 2.0
|
11 |
+
*/
|
12 |
+
|
13 |
+
static function inFooter() {
|
14 |
+
|
15 |
+
|
16 |
+
return ResponsiveMenu::getOption( 'RMFooter' ) && ResponsiveMenu::getOption( 'RMFooter' ) == 'footer' ? true : false;
|
17 |
+
|
18 |
+
|
19 |
+
}
|
20 |
+
|
21 |
+
|
22 |
+
}
|
app/controllers/CSSController.php
ADDED
@@ -0,0 +1,74 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
|
4 |
+
class RM_CSSController extends RM_BaseController {
|
5 |
+
|
6 |
+
|
7 |
+
/**
|
8 |
+
* Prepare our CSS Outputs
|
9 |
+
*
|
10 |
+
* @return null
|
11 |
+
* @added 2.0
|
12 |
+
*/
|
13 |
+
|
14 |
+
static function prepare() {
|
15 |
+
|
16 |
+
|
17 |
+
if( ResponsiveMenu::getOption( 'RMExternal' ) ) :
|
18 |
+
|
19 |
+
|
20 |
+
add_action( 'wp_enqueue_scripts', array( 'RM_CSSController', 'addExternal' ) );
|
21 |
+
|
22 |
+
|
23 |
+
else :
|
24 |
+
|
25 |
+
|
26 |
+
add_action( 'wp_head', array( 'RM_CSSController', 'addInline' ) );
|
27 |
+
|
28 |
+
|
29 |
+
endif;
|
30 |
+
|
31 |
+
|
32 |
+
}
|
33 |
+
|
34 |
+
|
35 |
+
/**
|
36 |
+
* Create and echos the Inline Styles
|
37 |
+
*
|
38 |
+
* @return string
|
39 |
+
* @added 2.0
|
40 |
+
*/
|
41 |
+
|
42 |
+
static function addInline() {
|
43 |
+
|
44 |
+
$opt = ResponsiveMenu::getOptions();
|
45 |
+
|
46 |
+
echo ResponsiveMenu::getOption( 'RMMinify' ) == 'minify' ? RM_CSSModel::Minify( RM_CSSModel::getCSS( $opt ) ) : RM_CSSModel::getCSS( $opt );
|
47 |
+
|
48 |
+
|
49 |
+
}
|
50 |
+
|
51 |
+
|
52 |
+
/**
|
53 |
+
* Adds External Styles to Header
|
54 |
+
*
|
55 |
+
* @return null
|
56 |
+
* @added 2.0
|
57 |
+
*/
|
58 |
+
|
59 |
+
static function addExternal() {
|
60 |
+
|
61 |
+
|
62 |
+
wp_enqueue_style(
|
63 |
+
'responsive-menu',
|
64 |
+
RM_Registry::get( 'config', 'plugin_data_uri' ) . 'css/responsive-menu-' . get_current_blog_id() . '.css',
|
65 |
+
array(),
|
66 |
+
'1.0',
|
67 |
+
'all'
|
68 |
+
);
|
69 |
+
|
70 |
+
|
71 |
+
}
|
72 |
+
|
73 |
+
|
74 |
+
}
|
app/controllers/FrontController.php
ADDED
@@ -0,0 +1,50 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class RM_FrontController extends RM_BaseController {
|
4 |
+
|
5 |
+
|
6 |
+
/**
|
7 |
+
* Prepare our Front End Options
|
8 |
+
*
|
9 |
+
* @return null
|
10 |
+
* @added 2.0
|
11 |
+
*/
|
12 |
+
|
13 |
+
static function prepare() {
|
14 |
+
|
15 |
+
// Check that we are in the admin area
|
16 |
+
if( !is_admin() ) :
|
17 |
+
|
18 |
+
|
19 |
+
if( ResponsiveMenu::getOption( 'RMCliToClo' ) ) :
|
20 |
+
|
21 |
+
add_action( 'wp_enqueue_scripts', array( 'RM_FrontController', 'jQueryMobile' ) );
|
22 |
+
|
23 |
+
endif;
|
24 |
+
|
25 |
+
|
26 |
+
endif;
|
27 |
+
|
28 |
+
|
29 |
+
}
|
30 |
+
|
31 |
+
|
32 |
+
/**
|
33 |
+
* Makes sure jQuery Mobile is added to all front pages if the specific option is selected
|
34 |
+
* as it is needed for some of the functions to work
|
35 |
+
*
|
36 |
+
* @return null
|
37 |
+
* @added 2.0
|
38 |
+
*/
|
39 |
+
|
40 |
+
static function jQueryMobile() {
|
41 |
+
|
42 |
+
|
43 |
+
wp_register_script( 'touch', RM_Registry::get( 'config', 'plugin_base_uri' ) . 'public/js/touch.js', 'jquery', '', false );
|
44 |
+
wp_enqueue_script( 'touch' );
|
45 |
+
|
46 |
+
|
47 |
+
}
|
48 |
+
|
49 |
+
|
50 |
+
}
|
app/controllers/GlobalController.php
ADDED
@@ -0,0 +1,65 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
|
4 |
+
class RM_GlobalController extends RM_BaseController {
|
5 |
+
|
6 |
+
|
7 |
+
/**
|
8 |
+
* Prepare our Global Options
|
9 |
+
*
|
10 |
+
* @return null
|
11 |
+
* @added 2.0
|
12 |
+
*/
|
13 |
+
|
14 |
+
static function prepare() {
|
15 |
+
|
16 |
+
|
17 |
+
add_action( 'plugins_loaded', array( 'RM_GlobalController', 'Internationalise' ) );
|
18 |
+
add_action( 'wp_enqueue_scripts', array( 'RM_GlobalController', 'jQuery' ) );
|
19 |
+
|
20 |
+
|
21 |
+
}
|
22 |
+
|
23 |
+
|
24 |
+
/**
|
25 |
+
* Makes sure jQuery is added to all pages as it is needed for the
|
26 |
+
* system to work
|
27 |
+
*
|
28 |
+
* @return null
|
29 |
+
* @added 1.0
|
30 |
+
*/
|
31 |
+
|
32 |
+
static function jQuery() {
|
33 |
+
|
34 |
+
|
35 |
+
wp_enqueue_script( 'jquery' );
|
36 |
+
|
37 |
+
|
38 |
+
}
|
39 |
+
|
40 |
+
|
41 |
+
/**
|
42 |
+
* Loads our Translations for use throughout the program
|
43 |
+
*
|
44 |
+
* Current Translations:
|
45 |
+
*
|
46 |
+
* hr_HR - Croatian - With thanks to Neverone Design - https://www.facebook.com/pages/Neverone-design/490262371018076
|
47 |
+
* es_ES - Spanish - With thanks to Andrew @ WebHostingHub - http://www.webhostinghub.com
|
48 |
+
*
|
49 |
+
* @return null
|
50 |
+
* @added 1.6
|
51 |
+
*/
|
52 |
+
|
53 |
+
|
54 |
+
static function Internationalise() {
|
55 |
+
|
56 |
+
|
57 |
+
__( 'Highly Customisable Responsive Menu Plugin for WordPress', 'responsive-menu' );
|
58 |
+
|
59 |
+
load_plugin_textdomain( 'responsive-menu', false, 'responsive-menu/translations/' );
|
60 |
+
|
61 |
+
|
62 |
+
}
|
63 |
+
|
64 |
+
|
65 |
+
}
|
app/controllers/HTMLController.php
ADDED
@@ -0,0 +1,84 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
|
4 |
+
class RM_HTMLController extends RM_BaseController {
|
5 |
+
|
6 |
+
|
7 |
+
/**
|
8 |
+
* Prepare the HTML for display on the front end
|
9 |
+
*
|
10 |
+
* @return null
|
11 |
+
* @added 1.0
|
12 |
+
*/
|
13 |
+
|
14 |
+
static function prepare() {
|
15 |
+
|
16 |
+
|
17 |
+
if( !ResponsiveMenu::getOption( 'RMShortcode' ) )
|
18 |
+
add_action( 'wp_footer', array( 'RM_HTMLController', 'display' ) );
|
19 |
+
|
20 |
+
|
21 |
+
}
|
22 |
+
|
23 |
+
|
24 |
+
/**
|
25 |
+
* Creates the view for the menu and echos it out
|
26 |
+
*
|
27 |
+
* @return string
|
28 |
+
* @added 1.0
|
29 |
+
*/
|
30 |
+
|
31 |
+
static function display( $args = null ) {
|
32 |
+
|
33 |
+
/* Unfortunately this messy section is due to shortcodes converting all args to lowercase */
|
34 |
+
|
35 |
+
if( $args ) :
|
36 |
+
|
37 |
+
if( isset( $args['rm'] ) )
|
38 |
+
$args['RM'] = $args['rm'];
|
39 |
+
|
40 |
+
if( isset( $args['menu'] ) )
|
41 |
+
$args['RM'] = $args['menu'];
|
42 |
+
|
43 |
+
if( isset( $args['title'] ) )
|
44 |
+
$args['RMTitle'] = $args['title'];
|
45 |
+
|
46 |
+
if( isset( $args['title_link'] ) )
|
47 |
+
$args['RMTitleLink'] = $args['title_link'];
|
48 |
+
|
49 |
+
if( isset( $args['title_open'] ) )
|
50 |
+
$args['RMTitleLoc'] = $args['title_open'];
|
51 |
+
|
52 |
+
if( isset( $args['html'] ) )
|
53 |
+
$args['RMHtml'] = $args['html'];
|
54 |
+
|
55 |
+
if( isset( $args['html_loc'] ) )
|
56 |
+
$args['RMHtmlLoc'] = $args['html_loc'];
|
57 |
+
|
58 |
+
if( isset( $args['title_img'] ) )
|
59 |
+
$args['RMImage'] = $args['title_img'];
|
60 |
+
|
61 |
+
if( isset( $args['search_loc'] ) )
|
62 |
+
$args['RMSearchPos'] = $args['search_loc'];
|
63 |
+
|
64 |
+
if( isset( $args['btn_img'] ) )
|
65 |
+
$args['RMClickImg'] = $args['btn_img'];
|
66 |
+
|
67 |
+
if( isset( $args['btn_img_clicked'] ) )
|
68 |
+
$args['RMClickImgClicked'] = $args['btn_img_clicked'];
|
69 |
+
|
70 |
+
if( isset( $args['btn_title'] ) )
|
71 |
+
$args['RMClickTitle'] = $args['btn_title'];
|
72 |
+
|
73 |
+
endif;
|
74 |
+
|
75 |
+
$options = ResponsiveMenu::getOptions();
|
76 |
+
|
77 |
+
RM_View::make( 'menu', $args ? array_merge( $options, $args ) : $options );
|
78 |
+
RM_View::make( 'click-button', $args ? array_merge( $options, $args ) : $options );
|
79 |
+
|
80 |
+
|
81 |
+
}
|
82 |
+
|
83 |
+
|
84 |
+
}
|
app/controllers/InstallController.php
ADDED
@@ -0,0 +1,40 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class RM_InstallController extends RM_BaseController {
|
4 |
+
|
5 |
+
|
6 |
+
/**
|
7 |
+
* Prepare our Installation Options
|
8 |
+
*
|
9 |
+
* @return null
|
10 |
+
* @added 2.0
|
11 |
+
*/
|
12 |
+
|
13 |
+
static function prepare() {
|
14 |
+
|
15 |
+
|
16 |
+
register_activation_hook( __FILE__, array( 'RM_InstallController', 'install' ) );
|
17 |
+
|
18 |
+
|
19 |
+
}
|
20 |
+
|
21 |
+
|
22 |
+
/**
|
23 |
+
* Sets our initial default options when menu
|
24 |
+
* is first installed
|
25 |
+
*
|
26 |
+
* @return null
|
27 |
+
* @added 1.0
|
28 |
+
*/
|
29 |
+
|
30 |
+
static function install() {
|
31 |
+
|
32 |
+
|
33 |
+
add_option( 'RMVer', RM_Registry::get( 'config', 'current_version' ) );
|
34 |
+
add_option( 'RMOptions', RM_Registry::get( 'defaults' ) );
|
35 |
+
|
36 |
+
|
37 |
+
}
|
38 |
+
|
39 |
+
|
40 |
+
}
|
app/controllers/JSController.php
ADDED
@@ -0,0 +1,76 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
|
4 |
+
class RM_JSController extends RM_BaseController {
|
5 |
+
|
6 |
+
|
7 |
+
/**
|
8 |
+
* Prepare our JavaScript for inclusion throughout the site
|
9 |
+
*
|
10 |
+
* @return null
|
11 |
+
* @added 1.0
|
12 |
+
*/
|
13 |
+
|
14 |
+
static function prepare() {
|
15 |
+
|
16 |
+
|
17 |
+
if( ResponsiveMenu::getOption( 'RMExternal' ) ) :
|
18 |
+
|
19 |
+
|
20 |
+
add_action( 'wp_enqueue_scripts', array( 'RM_JSController', 'addExternal' ) );
|
21 |
+
|
22 |
+
|
23 |
+
else :
|
24 |
+
|
25 |
+
|
26 |
+
add_action( self::inFooter() ? 'wp_footer' : 'wp_head', array( 'RM_JSController', 'addInline' ) );
|
27 |
+
|
28 |
+
|
29 |
+
endif;
|
30 |
+
|
31 |
+
|
32 |
+
}
|
33 |
+
|
34 |
+
|
35 |
+
/**
|
36 |
+
* Creates and echos the inline styles if used
|
37 |
+
*
|
38 |
+
* @return string
|
39 |
+
* @added 1.0
|
40 |
+
*/
|
41 |
+
|
42 |
+
static function addInline() {
|
43 |
+
|
44 |
+
$opt = ResponsiveMenu::getOptions();
|
45 |
+
|
46 |
+
echo ResponsiveMenu::getOption( 'RMMinify' ) == 'minify' ? RM_JSModel::Minify( RM_JSModel::getJs( $opt ) ) : RM_JSModel::getJs( $opt );
|
47 |
+
|
48 |
+
|
49 |
+
}
|
50 |
+
|
51 |
+
|
52 |
+
/**
|
53 |
+
* Adds the external scripts to the site if required
|
54 |
+
*
|
55 |
+
* @return null
|
56 |
+
* @added 1.4
|
57 |
+
*/
|
58 |
+
|
59 |
+
static function addExternal() {
|
60 |
+
|
61 |
+
|
62 |
+
wp_enqueue_script(
|
63 |
+
|
64 |
+
'responsive-menu',
|
65 |
+
RM_Registry::get( 'config', 'plugin_data_uri' ) . 'js/responsive-menu-' . get_current_blog_id() . '.js',
|
66 |
+
'jquery.mobile',
|
67 |
+
'1.0',
|
68 |
+
self::inFooter()
|
69 |
+
|
70 |
+
);
|
71 |
+
|
72 |
+
|
73 |
+
}
|
74 |
+
|
75 |
+
|
76 |
+
}
|
app/controllers/UpgradeController.php
ADDED
@@ -0,0 +1,66 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class RM_UpgradeController extends RM_BaseController {
|
4 |
+
|
5 |
+
|
6 |
+
/**
|
7 |
+
* Script that runs if the menu has been upgraded
|
8 |
+
*
|
9 |
+
* @return mixed
|
10 |
+
* @added 2.0
|
11 |
+
*/
|
12 |
+
|
13 |
+
static function upgrade() {
|
14 |
+
|
15 |
+
|
16 |
+
if( self::needsUpgrade() ) :
|
17 |
+
|
18 |
+
|
19 |
+
if( ResponsiveMenu::getOption( 'RMExternal' ) ) :
|
20 |
+
|
21 |
+
|
22 |
+
RM_FolderModel::create();
|
23 |
+
|
24 |
+
$js = RM_JSModel::getJs( ResponsiveMenu::getOptions() );
|
25 |
+
$js = ResponsiveMenu::getOption( 'RMMinify' ) == 'minify' ? RM_JSModel::Minify( $js ) : $js = $js;
|
26 |
+
|
27 |
+
RM_JSModel::createJSFile( $js );
|
28 |
+
|
29 |
+
$css = RM_CSSModel::getCSS( ResponsiveMenu::getOptions() );
|
30 |
+
$css = ResponsiveMenu::getOption( 'RMMinify' ) == 'minify' ? RM_CSSModel::Minify( $css ) : $css = $css;
|
31 |
+
|
32 |
+
RM_CSSModel::createCSSFile( $css );
|
33 |
+
|
34 |
+
|
35 |
+
endif;
|
36 |
+
|
37 |
+
/* Update Version */
|
38 |
+
update_option( 'RMVer', RM_Registry::get( 'config', 'current_version' ) );
|
39 |
+
|
40 |
+
/* Merge Changes */
|
41 |
+
update_option( 'RMOptions', array_merge( RM_Registry::get( 'defaults' ), ResponsiveMenu::getOptions() ) );
|
42 |
+
|
43 |
+
|
44 |
+
endif;
|
45 |
+
|
46 |
+
|
47 |
+
}
|
48 |
+
|
49 |
+
|
50 |
+
/**
|
51 |
+
* Determines whether or not the site needs upgrading
|
52 |
+
*
|
53 |
+
* @return boolean
|
54 |
+
* @added 2.0
|
55 |
+
*/
|
56 |
+
|
57 |
+
static function needsUpgrade() {
|
58 |
+
|
59 |
+
|
60 |
+
return version_compare( get_option( 'RMVer' ), RM_Registry::get( 'config', 'current_version' ), '<' );
|
61 |
+
|
62 |
+
|
63 |
+
}
|
64 |
+
|
65 |
+
|
66 |
+
}
|
app/library/responsive-menu/Export.php
ADDED
@@ -0,0 +1,49 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class RM_Export {
|
4 |
+
|
5 |
+
|
6 |
+
/**
|
7 |
+
* Function to create export XML file
|
8 |
+
*
|
9 |
+
* @return file xml
|
10 |
+
* @added 2.2
|
11 |
+
*/
|
12 |
+
|
13 |
+
static function export() {
|
14 |
+
|
15 |
+
if( !is_admin() ) exit();
|
16 |
+
|
17 |
+
$fileName = RM_Registry::get( 'config', 'plugin_base_dir' ) . '/public/export/export.xml';
|
18 |
+
|
19 |
+
$file = fopen( $fileName, 'w+' );
|
20 |
+
|
21 |
+
if( !$file ) :
|
22 |
+
|
23 |
+
return RM_Status::set( 'error', __( 'Could not create export file, please check plugin folder permissions', 'responsive-menu' ) );
|
24 |
+
|
25 |
+
endif;
|
26 |
+
|
27 |
+
$xml = '<?xml version="1.0" encoding="UTF-8"?>';
|
28 |
+
$xml .= '<RMOptions>';
|
29 |
+
|
30 |
+
foreach( ResponsiveMenu::getOptions() as $option_key => $option_val ) :
|
31 |
+
|
32 |
+
$xml .= '<' . $option_key . '>' . base64_encode( $option_val ) . '</' . $option_key . '>';
|
33 |
+
|
34 |
+
endforeach;
|
35 |
+
|
36 |
+
$xml .= '</RMOptions>';
|
37 |
+
|
38 |
+
fwrite( $file, $xml );
|
39 |
+
fclose( $file );
|
40 |
+
|
41 |
+
$link = RM_Registry::get( 'config', 'plugin_base_uri' ) . 'public/export/export.xml';
|
42 |
+
|
43 |
+
RM_Status::set( 'updated', '<a href="' . $link . '">' . __( 'You can download your exported file by clicking here', 'responsive-menu' ) . '</a>' );
|
44 |
+
|
45 |
+
|
46 |
+
}
|
47 |
+
|
48 |
+
|
49 |
+
}
|
app/library/responsive-menu/Import.php
ADDED
@@ -0,0 +1,50 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class RM_Import {
|
4 |
+
|
5 |
+
/**
|
6 |
+
* Function to get data from imported XML file
|
7 |
+
*
|
8 |
+
* @return file xml
|
9 |
+
* @added 2.2
|
10 |
+
*/
|
11 |
+
|
12 |
+
static function getData( $file ) {
|
13 |
+
|
14 |
+
if( !is_admin() ) exit();
|
15 |
+
|
16 |
+
if( !$file['tmp_name'] )
|
17 |
+
return RM_Status::set( 'error', __( 'No Import File Attached', 'responsive-menu' ) );
|
18 |
+
|
19 |
+
if( $file['type'] != 'text/xml' )
|
20 |
+
return RM_Status::set( 'error', __( 'Incorrect Import File Format', 'responsive-menu' ) );
|
21 |
+
|
22 |
+
if( $file['size'] > 500000 )
|
23 |
+
return RM_Status::set( 'error', __( 'Import File Too Large', 'responsive-menu' ) );
|
24 |
+
|
25 |
+
if( !is_uploaded_file( $file['tmp_name'] ) )
|
26 |
+
return RM_Status::set( 'error', __( 'Import File Not Valid', 'responsive-menu' ) );
|
27 |
+
|
28 |
+
$data = file_get_contents( $file['tmp_name'] );
|
29 |
+
|
30 |
+
$xml = simplexml_load_string( $data );
|
31 |
+
$json = json_encode( $xml );
|
32 |
+
$array = json_decode( $json, TRUE );
|
33 |
+
$decoded = array();
|
34 |
+
|
35 |
+
foreach( $array as $key => $val ) :
|
36 |
+
/* Need to JSON Decode HTML Shapes */
|
37 |
+
if( $key == 'RMArShpA' || $key == 'RMArShpI' ) :
|
38 |
+
$decoded[$key] = is_array( $val ) ? null : json_decode( base64_decode( $val ) );
|
39 |
+
else :
|
40 |
+
$decoded[$key] = is_array( $val ) ? null : base64_decode( $val );
|
41 |
+
endif;
|
42 |
+
endforeach;
|
43 |
+
|
44 |
+
return $decoded;
|
45 |
+
|
46 |
+
|
47 |
+
}
|
48 |
+
|
49 |
+
|
50 |
+
}
|
app/library/responsive-menu/Input.php
ADDED
@@ -0,0 +1,82 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class RM_Input {
|
4 |
+
|
5 |
+
|
6 |
+
/**
|
7 |
+
* Function to get all Input values
|
8 |
+
*
|
9 |
+
* @param string $name
|
10 |
+
* @return array
|
11 |
+
* @added 2.0
|
12 |
+
*/
|
13 |
+
|
14 |
+
static function all( $name = null ) {
|
15 |
+
|
16 |
+
|
17 |
+
$arrays = array_merge( $_POST, $_GET );
|
18 |
+
|
19 |
+
return $name ? $arrays[$name] : $arrays;
|
20 |
+
|
21 |
+
|
22 |
+
}
|
23 |
+
|
24 |
+
|
25 |
+
/**
|
26 |
+
* Function to get only post values
|
27 |
+
*
|
28 |
+
* @param string $name
|
29 |
+
* @return array
|
30 |
+
* @added 2.0
|
31 |
+
*/
|
32 |
+
|
33 |
+
static function post( $name = null ) {
|
34 |
+
|
35 |
+
if( $name )
|
36 |
+
return $name && isset( $_POST[$name] ) ? $_POST[$name] : false;
|
37 |
+
else
|
38 |
+
return $_POST;
|
39 |
+
|
40 |
+
|
41 |
+
}
|
42 |
+
|
43 |
+
/**
|
44 |
+
* Function to get only get values
|
45 |
+
*
|
46 |
+
* @param string $name
|
47 |
+
* @return array
|
48 |
+
* @added 2.0
|
49 |
+
*/
|
50 |
+
|
51 |
+
static function get( $name = null ) {
|
52 |
+
|
53 |
+
|
54 |
+
if( $name )
|
55 |
+
return $name && isset( $_GET[$name] ) ? $_GET[$name] : false;
|
56 |
+
else
|
57 |
+
return $_GET;
|
58 |
+
|
59 |
+
|
60 |
+
}
|
61 |
+
|
62 |
+
/**
|
63 |
+
* Function to get only file values
|
64 |
+
*
|
65 |
+
* @param string $name
|
66 |
+
* @return array
|
67 |
+
* @added 2.0
|
68 |
+
*/
|
69 |
+
|
70 |
+
static function file( $name = null ) {
|
71 |
+
|
72 |
+
|
73 |
+
if( $name )
|
74 |
+
return $name && isset( $_FILES[$name] ) ? $_FILES[$name] : false;
|
75 |
+
else
|
76 |
+
return $_FILES;
|
77 |
+
|
78 |
+
|
79 |
+
}
|
80 |
+
|
81 |
+
|
82 |
+
}
|
app/library/responsive-menu/MenuWalker.php
ADDED
@@ -0,0 +1,15 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class RM_MenuWalker extends Walker_Nav_Menu {
|
4 |
+
|
5 |
+
|
6 |
+
/**
|
7 |
+
* Added for potentially using a Menu Walker in future
|
8 |
+
* if needed.
|
9 |
+
*
|
10 |
+
* @return null
|
11 |
+
* @added 2.2
|
12 |
+
*/
|
13 |
+
|
14 |
+
|
15 |
+
}
|
app/library/responsive-menu/Registry.php
ADDED
@@ -0,0 +1,51 @@
|
|
|
|
|
|
|
|