Version Description
- Enhance: Processing and Memory optimization for better performance.
- Enhance: Block Box Themes Support.
- Enhance: 32 Themes is now supported to be applied for the whole block box.
- Enhance: Applying theme per browser. Allow for assigning appropriate theme for different devices.
- Enhance: Assigned/All mode switchers for assignment panel list. You can show all items even not selected ones or show only assigned to the block.
- Enhance: Bullet-Proof Assignment Panel layout so it would always reserved even if another Plugin wrongly load jQuery TABS/ACCORDION Styles.
- Enahnce: General UI enhancements.
- Enahnce: Code editor updates.
- Enhance: Turns CJT Block into a tiny Project that host Multiple "Managed" Code-Files instead of just one.
- Enhance: No need to create a Block for each Language Type and assign them to the same Wordpress Page. One Block with Multiple Code Files solved that by creating only one Block for each assgined request.
- Enhance: Code Files Support Language Type, Code, Description and TAG fields.
- Enhance: Write Design-Time Organized Code by separating them into code-files (JS, CSS, PHP, HTML) and CJT will merge them all at run-time.
- Enhance: There is no need to write
Download this release
Release Info
Developer | xpointer |
Plugin | CSS & JavaScript Toolbox |
Version | 7.1 |
Comparing to | |
See all releases |
Code changes from version 6.1.5 to 7.1
- access.points/extensions.accesspoint.php +1 -1
- access.points/metabox.accesspoint.php +67 -0
- access.points/packages.accesspoint.php +71 -0
- access.points/tinymce.accesspoint.php +52 -0
- autoload.inc.php +2 -0
- controllers/auto-upgrade.php +15 -6
- controllers/block-ajax.php +51 -9
- controllers/block.php +61 -0
- controllers/blocks-ajax.php +21 -2
- controllers/blocks-coupling.php +163 -20
- controllers/blocks.php +6 -2
- controllers/code-files.php +128 -0
- controllers/coupling/html/load-footer-style.html.php +12 -0
- controllers/coupling/js/footer-stylesheet-loader.js +11 -0
- controllers/coupling/shortcode/block/block.php +29 -2
- controllers/metabox.php +192 -0
- controllers/package-file.php +66 -0
- controllers/package.php +68 -0
- controllers/packages.php +65 -0
- controllers/template.php +102 -0
- controllers/templates-lookup.php +120 -0
- controllers/templates-manager.php +168 -0
- controllers/tinymce-blocks.php +92 -1
- css-js-toolbox.php +6 -6
- docs/CJTV6CEUserManual.pdf +0 -0
- docs/CJT_V6_User_Manual.pdf +0 -0
- framework/css/toolbox.css +9 -5
- framework/db/mysql/driver/exception/invalidkey.php +9 -0
- framework/db/mysql/queue-driver.inc.php +1 -1
- framework/db/mysql/xtable.inc.php +58 -27
- framework/developer/developer.php +44 -0
- framework/developer/interface/block/parameters/parameters.php +38 -76
- framework/developer/interface/block/parameters/transform/json/json.php +0 -62
- framework/developer/interface/block/parameters/types/array.php +74 -0
- framework/developer/interface/block/parameters/types/base/abstract.php +103 -0
- framework/developer/interface/block/parameters/types/base/factory.php +30 -0
- framework/developer/interface/block/parameters/types/base/list.php +102 -0
- framework/developer/interface/block/parameters/types/base/scalar.php +38 -0
- framework/developer/interface/block/parameters/types/boolean.php +36 -0
- framework/developer/interface/block/parameters/types/interface/type.php +37 -0
- framework/developer/interface/block/parameters/types/list.php +51 -0
- framework/developer/interface/block/parameters/types/number.php +27 -0
- framework/developer/interface/block/parameters/types/raw.php +13 -0
- framework/developer/interface/block/parameters/types/structure.php +45 -0
- framework/developer/interface/block/parameters/types/text.php +27 -0
- framework/developer/interface/block/shortcode/parameters/base/abstract.php +121 -0
- framework/developer/interface/block/shortcode/parameters/base/list.php +31 -0
- framework/developer/interface/block/shortcode/parameters/base/scalar.php +41 -0
- framework/developer/interface/block/shortcode/parameters/factory.php +30 -0
- framework/developer/interface/block/shortcode/parameters/interface/type.php +17 -0
- framework/developer/interface/block/shortcode/parameters/parameters.php +154 -0
- framework/developer/interface/block/shortcode/parameters/types/array.php +44 -0
- framework/developer/interface/block/shortcode/parameters/types/boolean.php +26 -0
- framework/developer/interface/block/shortcode/parameters/types/list.php +40 -0
- framework/developer/interface/block/shortcode/parameters/types/number.php +23 -0
- framework/developer/interface/block/shortcode/parameters/types/raw.php +23 -0
- framework/developer/interface/block/shortcode/parameters/types/structure.php +35 -0
- framework/developer/interface/block/shortcode/parameters/types/text.php +23 -0
- framework/developer/interface/block/shortcode/segments/segments.php +2 -1
- framework/developer/interface/block/shortcode/shortcode.php +9 -8
- framework/developer/lib/template/template.php +55 -0
- framework/html/dom/element/script.php +65 -0
- framework/html/dom/elementbase.php +69 -0
- framework/js/ace/ChangeLog.txt +1 -26
- framework/js/ace/ext-searchbox.js +1 -0
- framework/js/ace/ext-settings_menu.js +1 -0
- framework/js/ace/ext-statusbar.js +1 -0
- framework/js/ace/keybinding-emacs.js +1 -0
- framework/js/ace/keybinding-vim.js +1 -0
- framework/js/ace/pluggable/pluggable.js +44 -0
- framework/js/ace/theme-ambiance.js +1 -0
- framework/js/ace/theme-chaos.js +1 -0
- framework/js/ace/theme-clouds.js +1 -0
- framework/js/ace/theme-clouds_midnight.js +1 -0
- framework/js/ace/theme-cobalt.js +1 -0
- framework/js/ace/theme-crimson_editor.js +1 -0
- framework/js/ace/theme-dawn.js +1 -0
- framework/js/ace/theme-dreamweaver.js +1 -0
- framework/js/ace/theme-eclipse.js +1 -0
- framework/js/ace/theme-github.js +1 -0
- framework/js/ace/theme-idle_fingers.js +1 -0
- framework/js/ace/theme-katzenmilch.js +1 -0
- framework/js/ace/theme-kr.js +1 -0
- framework/js/ace/theme-kuroir.js +1 -0
- framework/js/ace/theme-merbivore.js +1 -0
- framework/js/ace/theme-merbivore_soft.js +1 -0
- framework/js/ace/theme-mono_industrial.js +1 -0
- framework/js/ace/theme-monokai.js +1 -0
- framework/js/ace/theme-pastel_on_dark.js +1 -0
- framework/js/ace/theme-solarized_dark.js +1 -0
- framework/js/ace/theme-solarized_light.js +1 -0
- framework/js/ace/theme-terminal.js +1 -0
- framework/js/ace/theme-textmate.js +1 -0
- framework/js/ace/theme-tomorrow.js +1 -0
- framework/js/ace/theme-tomorrow_night.js +1 -0
- framework/js/ace/theme-tomorrow_night_blue.js +1 -0
- framework/js/ace/theme-tomorrow_night_bright.js +1 -0
- framework/js/ace/theme-tomorrow_night_eighties.js +1 -0
- framework/js/ace/theme-twilight.js +1 -0
- framework/js/ace/theme-vibrant_ink.js +1 -0
- framework/js/ace/theme-xcode.js +1 -0
- framework/js/ajax/cjt-server/cjt-server.js +13 -4
- framework/js/ajax/scripts-loader/scripts-loader.js +132 -0
- framework/js/ajax/styles-loader/styles-loader.js +30 -0
- framework/js/ui/jquery.link-progress/jquery.link-progress.js +18 -12
- framework/js/ui/jquery.toolbox/jquery.toolbox.js +6 -4
- framework/js/wordpress/script-localizer/script-localizer.js +43 -0
- framework/mvc/controller.inc.php +4 -4
- framework/mvc/view.inc.php +37 -4
- framework/packages/package.class.php +160 -0
- framework/third-party/easy-digital-download/auto-upgrade.class.php +31 -4
- framework/types/attributes.class.php +92 -0
- framework/view/block/parameter/base/abstract.php +128 -0
- framework/view/block/parameter/base/abstract/template/helpText.phtml +5 -0
- framework/view/block/parameter/base/list.php +63 -0
- framework/view/block/parameter/base/scalar.php +10 -0
- framework/view/block/parameter/grouper/factory.php +26 -0
- framework/view/block/parameter/grouper/tab/index.phtml +25 -0
- framework/view/block/parameter/grouper/tab/public/css/tab.css +1 -0
- framework/view/block/parameter/grouper/tab/tab.php +87 -0
- framework/view/block/parameter/interface/type.php +17 -0
- framework/view/block/parameter/parameters.php +20 -0
- framework/view/block/parameter/renderer/array/array.php +36 -0
- framework/view/block/parameter/renderer/array/index.phtml +14 -0
- framework/view/block/parameter/renderer/checkbox/checkbox.php +10 -0
- framework/view/block/parameter/renderer/checkbox/index.phtml +12 -0
- framework/view/block/parameter/renderer/dropdown/dropdown.php +10 -0
- framework/view/block/parameter/renderer/dropdown/index.phtml +22 -0
- framework/view/block/parameter/renderer/factory.php +39 -0
- framework/view/block/parameter/renderer/imageslist/imageslist.php +31 -0
- framework/view/block/parameter/renderer/imageslist/index.phtml +17 -0
- framework/view/block/parameter/renderer/imageslist/public/css/imageslist.css +34 -0
- framework/view/block/parameter/renderer/imageslist/public/js/imageslist/imageslist.js +219 -0
- framework/view/block/parameter/renderer/imageslist/public/js/imageslist/imageslist.localization.php +15 -0
- framework/view/block/parameter/renderer/input/index.phtml +10 -0
- framework/view/block/parameter/renderer/input/input.php +20 -0
- framework/view/block/parameter/renderer/input/public/css/input.css +2 -0
- framework/view/block/parameter/renderer/list/index.phtml +22 -0
- framework/view/block/parameter/renderer/list/list.php +10 -0
- framework/view/block/parameter/renderer/structure/index.phtml +15 -0
- framework/view/block/parameter/renderer/structure/public/css/structure.css +7 -0
- framework/view/block/parameter/renderer/structure/structure.php +20 -0
- framework/view/block/parameter/renderer/textarea/index.phtml +11 -0
- framework/view/block/parameter/renderer/textarea/textarea.php +10 -0
- framework/xml/fetchscalars.php +32 -0
- includes/installer/installer/db/mysql/structure.sql +184 -2
- includes/installer/installer/includes/templates/wordpress-queue.inc.php +100 -0
- includes/installer/installer/installer.class.php +71 -0
- includes/installer/upgrade/0.3/includes/block.class.php +19 -1
- includes/installer/upgrade/1.0-CE/db/mysql/structure.sql +9 -2
- includes/installer/upgrade/1.0-CE/upgrade.class.php +18 -15
- includes/installer/upgrade/1.0/db/mysql/structure.sql +128 -0
- includes/installer/upgrade/1.0/upgrade.class.php +39 -0
- includes/installer/upgrade/1.1-CE/db/mysql/structure.sql +6 -0
- includes/installer/upgrade/1.1-CE/upgrade.class.php +49 -0
- includes/installer/upgrade/1.1/db/mysql/structure.sql +109 -0
- includes/installer/upgrade/1.1/upgrade.class.php +39 -0
- includes/installer/upgrade/1.2/db/mysql/structure.sql +90 -0
- includes/installer/upgrade/1.2/upgrade.class.php +39 -0
- includes/installer/upgrade/1.3/db/mysql/structure.sql +28 -0
- includes/installer/upgrade/1.3/upgrade.class.php +39 -0
- includes/installer/upgrade/1.4/db/mysql/structure.sql +19 -0
- includes/installer/upgrade/1.4/upgrade.class.php +39 -0
- includes/installer/upgrade/1.5/upgrade.class.php +40 -0
- includes/installer/upgrade/template.class.php +57 -0
- includes/installer/upgrade/upgrade.class.php +25 -1
- includes/templates/templates.class.php +43 -0
- locals/languages/css-javascript-toolbox-en_US.mo +0 -0
- locals/languages/css-javascript-toolbox-en_US.po +1252 -230
- locals/strings.inc.php +12 -0
- models/block-templates.php +36 -0
- models/block/parameters/base/parameters.php +96 -0
- models/block/parameters/form/groups.php +42 -0
- models/block/parameters/form/parameter.php +168 -0
- models/block/parameters/form/parameters.php +68 -0
- models/block/parameters/form/value.php +52 -0
- models/block/parameters/parameter.php +182 -0
- models/block/parameters/parameters.php +33 -0
- models/blocks-backups.php +7 -0
- models/blocks.php +104 -9
- models/coupling.php +110 -0
- models/extensions.php +1 -2
- models/fields/template-authors.php +32 -0
- models/fields/template-creation-dates.php +31 -0
- models/fields/template-development-states.php +44 -0
- models/fields/template-last-modified-dates.php +36 -0
- models/fields/template-owners.php +28 -0
- models/fields/template-states.php +38 -0
- models/fields/template-types.php +39 -0
- models/fields/template-versions.php +36 -0
- models/formgroups.php +67 -0
- models/forms.php +33 -0
- models/installer.php +0 -1
- models/metabox.php +175 -0
- models/package-file.php +254 -0
- models/package.php +151 -0
- models/package/block.php +46 -0
- models/package/xml/definition/abstract.php +192 -0
- models/package/xml/definition/interface/element.php +37 -0
- models/package/xml/definition/objects/block.php +33 -0
- models/package/xml/definition/objects/block/files.php +10 -0
- models/package/xml/definition/objects/block/files/file.php +34 -0
- models/package/xml/definition/objects/block/params.php +10 -0
- models/package/xml/definition/objects/block/params/form.php +44 -0
- models/package/xml/definition/objects/block/params/form/groups.php +12 -0
- models/package/xml/definition/objects/block/params/form/groups/group.php +54 -0
- models/package/xml/definition/objects/block/params/form/groups/group/xfields.php +31 -0
- models/package/xml/definition/objects/block/params/list.php +12 -0
- models/package/xml/definition/objects/block/params/list/param.php +45 -0
- models/package/xml/definition/objects/block/params/list/param/group.php +52 -0
- models/package/xml/definition/objects/block/params/list/param/group/definition.php +10 -0
- models/package/xml/definition/objects/block/params/list/param/group/definition/type.php +32 -0
- models/package/xml/definition/objects/block/params/list/param/group/rendererParams.php +19 -0
- models/package/xml/definition/objects/block/params/list/param/params.php +19 -0
- models/package/xml/definition/objects/block/params/list/param/typeParams.php +10 -0
- models/package/xml/definition/objects/block/params/list/param/typeparams/param.php +32 -0
- models/package/xml/definition/objects/template.php +28 -0
- models/package/xml/factory.php +100 -0
- models/packages.php +68 -0
- models/parameters.php +43 -0
- models/setup.php +1 -1
- models/template.php +234 -0
- models/templates-lookup.php +113 -0
- models/templates-manager.php +179 -0
- models/tinymce-blocks.php +2 -2
- models/uninstall.php +24 -0
- models/uninstall/db/mysql/uninstall.sql +26 -2
- readme.txt +147 -53
- tables/author.php +49 -0
- tables/block-files.php +31 -0
- tables/block-template.php +28 -0
- tables/form-group-xfields.php +29 -0
- tables/form-group.php +29 -0
- tables/form.php +31 -0
- tables/group-parameter.php +29 -0
- tables/package-objects.php +28 -0
- tables/package.php +28 -0
- tables/parameter-typedef.php +29 -0
- tables/parameter-typeparams.php +29 -0
- tables/parameter.php +29 -0
- tables/pins-blocks-view.php +1 -2
- tables/template-revision.php +43 -0
- tables/template.php +63 -0
- views/backups/manager/tmpl/default.html.tmpl +5 -0
- views/backups/manager/view.php +0 -13
- views/blocks/block/public/css/block.css +133 -7
- views/blocks/block/public/css/codefile.css +95 -0
- views/blocks/block/public/css/menu.css +61 -0
- views/blocks/{manager/public/images/review.png → block/public/images/editor-toolbox/clear-block.png} +0 -0
- views/blocks/block/public/images/editor-toolbox/font-large.png +0 -0
- views/blocks/block/public/images/editor-toolbox/font-reset.png +0 -0
- views/blocks/block/public/images/editor-toolbox/font-small.png +0 -0
- views/blocks/block/public/images/editor-toolbox/maximise-editor.png +0 -0
- views/blocks/block/public/images/editor-toolbox/minimise-editor.png +0 -0
- views/blocks/block/public/images/editor-toolbox/theme.png +0 -0
- views/blocks/block/public/images/toolbox/link-external.png +0 -0
- views/blocks/block/public/images/toolbox/templates-lookup.png +0 -0
- views/blocks/block/public/js/block/block.js +53 -34
- views/blocks/block/public/js/blockproperty/blockproperty.js +16 -8
- views/blocks/block/public/js/codefile-manager/codefile-manager.js +494 -0
- views/blocks/block/public/js/codefile-manager/codefile-manager.localization.php +17 -0
- views/blocks/block/public/js/codefile/codefile.js +140 -0
- views/blocks/block/public/js/jquery.block/jquery.block.js +550 -71
- views/blocks/block/public/js/jquery.block/jquery.block.localization.php +38 -0
- views/blocks/block/public/js/menu/block.js +203 -0
- views/blocks/block/public/js/menu/menu.js +87 -0
- views/blocks/block/tmpl/codefile/codefile.html.tmpl +46 -0
- views/blocks/block/tmpl/content.html.tmpl +31 -0
- views/blocks/block/tmpl/edit.html.tmpl +6 -18
- views/blocks/block/tmpl/menu/menu.html.tmpl +51 -0
- views/blocks/block/tmpl/templates/editor-toolbox.html.tmpl +18 -0
- views/blocks/block/tmpl/templates/toolbox.html.tmpl +18 -7
- views/blocks/block/view.php +27 -4
- views/blocks/cjt-block/public/css/block.css +52 -21
- views/blocks/cjt-block/public/images/editor-toolbox/close-panel.png +0 -0
- views/blocks/cjt-block/public/images/editor-toolbox/open-panel.png +0 -0
- views/blocks/cjt-block/public/js/block/block.js +19 -23
- views/blocks/cjt-block/public/js/blockproperty/blockproperty.js +12 -1
- views/blocks/cjt-block/public/js/jquery.assignpanel/jquery.assignpanel.js +221 -2
- views/blocks/cjt-block/public/js/jquery.block/jquery.block.js +80 -9
- views/blocks/cjt-block/public/js/jquery.block/jquery.block.localization.php +5 -1
- views/blocks/cjt-block/public/js/optional/revision/revision.js +10 -15
- views/blocks/cjt-block/tmpl/default.html.tmpl +7 -4
- views/blocks/cjt-block/tmpl/templates/assign-panel/default.html.tmpl +4 -4
- views/blocks/cjt-block/tmpl/templates/assign-panel/templates/custom-posts.html.tmpl +13 -11
- views/blocks/cjt-block/tmpl/templates/assign-panel/templates/tab.html.tmpl +4 -0
- views/blocks/cjt-block/view.php +16 -0
- views/blocks/create-metabox/public/css/metabox.css +8 -0
- views/blocks/create-metabox/public/js/metabox/metabox.js +109 -0
- views/blocks/create-metabox/public/js/metabox/metabox.localization.php +14 -0
- views/blocks/create-metabox/tmpl/create.html.tmpl +33 -0
- views/blocks/create-metabox/view.php +176 -0
- views/blocks/manager/public/css/blocks.css +27 -10
- views/blocks/manager/public/images/CSS_JS_Toolbox_Icon.png +0 -0
- views/blocks/manager/public/images/toolbox/templates-manager.png +0 -0
- views/blocks/manager/public/js/blocks-page/blocks-page.js +301 -9
- views/blocks/manager/public/js/blocks-page/blocks-page.localization.php +2 -0
- views/blocks/manager/public/js/blocks/blocks.js +19 -11
- views/blocks/manager/tmpl/blocks.html.tmpl +12 -11
- views/blocks/manager/tmpl/help/intro.html.tmpl +14 -2
- views/blocks/manager/tmpl/toolbox.html.tmpl +34 -0
- views/blocks/metabox/public/css/metabox.css +12 -0
- views/blocks/metabox/public/images/editor-toolbox/preview.png +0 -0
- views/blocks/metabox/public/js/block/block.js +39 -0
- views/blocks/metabox/public/js/jquery.block/jquery.block.js +73 -0
- views/blocks/metabox/public/js/jquery.block/jquery.block.localization.php +13 -0
- views/blocks/metabox/public/js/metabox/metabox.js +203 -0
- views/blocks/metabox/public/js/metabox/metabox.localization.php +14 -0
- views/blocks/metabox/public/js/optional/revision/revision.js +47 -0
- views/blocks/metabox/tmpl/metabox.html.tmpl +32 -0
- views/blocks/metabox/view.php +186 -0
- views/blocks/new/public/css/add-new-block.css +0 -3
- views/blocks/new/public/js/add-new-block/add-new-block.js +1 -1
- views/blocks/new/tmpl/default.html.tmpl +41 -2
- views/blocks/new/view.php +1 -15
- views/blocks/revisions/tmpl/default.html.tmpl +5 -0
- views/blocks/revisions/view.php +0 -12
- views/installer/install/tmpl/default.html.tmpl +3 -0
- views/installer/install/tmpl/upgrade.html.tmpl +1 -1
- views/installer/install/tmpl/upgrades/02.operations +1 -0
- views/installer/install/tmpl/upgrades/03.operations +1 -0
- views/installer/install/tmpl/upgrades/10.operations +12 -0
- views/installer/install/tmpl/upgrades/11.operations +12 -0
- views/installer/install/tmpl/upgrades/11ce.operations +12 -0
- views/installer/install/tmpl/upgrades/12.operations +12 -0
- views/installer/install/tmpl/upgrades/13.operations +12 -0
- views/installer/install/tmpl/upgrades/14.operations +12 -0
- views/installer/install/tmpl/upgrades/15.operations +22 -0
- views/installer/install/tmpl/upgrades/upgrade.html.tmpl +8 -8
- views/packages/install/public/css/install.css +9 -0
- views/packages/install/public/js/install/install.js +81 -0
- views/packages/install/public/js/install/install.localization.php +14 -0
- views/packages/install/tmpl/default.html.tmpl +45 -0
- views/packages/install/view.php +57 -0
- views/packages/manager/helpers/wp-list-table.inc.php +107 -0
- views/packages/manager/public/css/default.css +20 -0
- views/packages/manager/public/js/manager/manager.js +160 -0
- views/packages/manager/public/js/manager/manager.localization.php +15 -0
- views/packages/manager/tmpl/default.html.tmpl +29 -0
- views/packages/manager/view.php +106 -0
- views/packages/raw-file/tmpl/default.html.tmpl +18 -0
- views/packages/raw-file/view.php +38 -0
- views/settings/manager/tmpl/pages/metabox.html.tmpl +20 -0
- views/settings/manager/tmpl/settings.html.tmpl +5 -0
- views/settings/manager/view.php +1 -3
- views/setup/activation-form/tmpl/default.html.tmpl +3 -2
- views/setup/activation-form/view.php +0 -14
- views/setup/setup/public/js/default/default.js +39 -0
- views/setup/setup/tmpl/default.html.tmpl +16 -0
- views/setup/setup/view.php +66 -0
- views/templates/info/tmpl/default.html.tmpl +22 -0
- views/templates/info/view.php +48 -0
- views/templates/lookup/public/css/lookup.css +52 -0
- views/templates/lookup/public/js/lookup/lookup.js +207 -0
- views/templates/lookup/public/js/lookup/lookup.localization.php +18 -0
- views/templates/lookup/tmpl/default.html.tmpl +80 -0
- views/templates/lookup/view.php +64 -0
- views/templates/manager/helpers/wp-list-table.inc.php +181 -0
- views/templates/manager/public/css/default.css +23 -0
- views/templates/manager/public/js/manager/manager.js +179 -0
- views/templates/manager/public/js/manager/manager.localization.php +16 -0
- views/templates/manager/tmpl/default.html.tmpl +52 -0
- views/templates/manager/view.php +68 -0
- views/templates/template/public/css/default.css +29 -0
- views/templates/template/public/js/template/template.js +186 -0
- views/templates/template/public/js/template/template.localization.php +18 -0
- views/templates/template/tmpl/default.html.tmpl +99 -0
- views/templates/template/view.php +104 -0
- views/tinymce/params/public/css/style.css +22 -0
- views/tinymce/params/public/js/form/form.js +86 -0
- views/tinymce/params/tmpl/default.html.tmpl +54 -0
- views/tinymce/params/view.php +112 -0
- views/tinymce/shortcodes/public/plugins/shortcode/css/shortcode.css +8 -9
- views/tinymce/shortcodes/public/plugins/shortcode/shortcode.js +81 -117
- views/tinymce/shortcodes/view.php +13 -3
- views/uploader/single/public/css/uploader.css +3 -0
- views/uploader/single/public/js/uploader/uploader.js +52 -0
- views/uploader/single/tmpl/default.html.tmpl +49 -0
- views/uploader/single/view.php +63 -0
access.points/extensions.accesspoint.php
CHANGED
@@ -14,7 +14,7 @@ class CJTExtensionsAccessPoint extends CJTAccessPoint {
|
|
14 |
/**
|
15 |
*
|
16 |
*/
|
17 |
-
const MENU_POSITION_INDEX =
|
18 |
|
19 |
/**
|
20 |
*
|
14 |
/**
|
15 |
*
|
16 |
*/
|
17 |
+
const MENU_POSITION_INDEX = 2;
|
18 |
|
19 |
/**
|
20 |
*
|
access.points/metabox.accesspoint.php
ADDED
@@ -0,0 +1,67 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
*
|
4 |
+
*/
|
5 |
+
|
6 |
+
// Disallow direct access.
|
7 |
+
defined('ABSPATH') or die("Access denied");
|
8 |
+
|
9 |
+
/**
|
10 |
+
*
|
11 |
+
*/
|
12 |
+
class CJTMetaboxAccessPoint extends CJTAccessPoint {
|
13 |
+
|
14 |
+
/**
|
15 |
+
* put your comment there...
|
16 |
+
*
|
17 |
+
*/
|
18 |
+
public function __construct() {
|
19 |
+
// Initialize Access Point base!
|
20 |
+
parent::__construct();
|
21 |
+
// Set access point name!
|
22 |
+
$this->name = 'metabox';
|
23 |
+
}
|
24 |
+
|
25 |
+
/**
|
26 |
+
* put your comment there...
|
27 |
+
*
|
28 |
+
*/
|
29 |
+
protected function doListen() {
|
30 |
+
// Only if permitted!
|
31 |
+
if ($this->hasAccess()) {
|
32 |
+
// Add CJT Block metabox!
|
33 |
+
add_action("add_meta_boxes", array(&$this, 'postsMetabox'), 10, 2);
|
34 |
+
}
|
35 |
+
}
|
36 |
+
|
37 |
+
/**
|
38 |
+
* put your comment there...
|
39 |
+
*
|
40 |
+
* @param mixed $postType
|
41 |
+
* @param mixed $post
|
42 |
+
*/
|
43 |
+
public function postsMetabox($postType, $post) {
|
44 |
+
// Initialize.
|
45 |
+
$controller = false;
|
46 |
+
// Veil access point unless CJT installed!
|
47 |
+
if (CJTPlugin::getInstance()->isInstalled()) {
|
48 |
+
// Only if permitted!
|
49 |
+
if ($this->hasAccess()) {
|
50 |
+
// Set as connected object!
|
51 |
+
$this->connected();
|
52 |
+
// Load metabox controller!
|
53 |
+
$this->controllerName = 'metabox';
|
54 |
+
// Standarize calling the controller with Ajax requests!
|
55 |
+
// Ajax uses 'post' parameter as postId!
|
56 |
+
$post = $post->ID;
|
57 |
+
// Dispatch controller!
|
58 |
+
$controller = $this->route(null, compact('postType', 'post'));
|
59 |
+
}
|
60 |
+
}
|
61 |
+
return $controller;
|
62 |
+
}
|
63 |
+
|
64 |
+
} // End class.
|
65 |
+
|
66 |
+
// Hookable!
|
67 |
+
CJTMetaboxAccessPoint::define('CJTMetaboxAccessPoint', array('hookType' => CJTWordpressEvents::HOOK_FILTER));
|
access.points/packages.accesspoint.php
ADDED
@@ -0,0 +1,71 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
*
|
4 |
+
*/
|
5 |
+
|
6 |
+
// Disallow direct access.
|
7 |
+
defined('ABSPATH') or die("Access denied");
|
8 |
+
|
9 |
+
/**
|
10 |
+
*
|
11 |
+
*/
|
12 |
+
class CJTPackagesAccessPoint extends CJTPageAccessPoint {
|
13 |
+
|
14 |
+
/**
|
15 |
+
* put your comment there...
|
16 |
+
*
|
17 |
+
*/
|
18 |
+
public function __construct() {
|
19 |
+
// Initialize Access Point base!
|
20 |
+
parent::__construct();
|
21 |
+
// Set access point name!
|
22 |
+
$this->name = 'packages-manager';
|
23 |
+
}
|
24 |
+
|
25 |
+
/**
|
26 |
+
* put your comment there...
|
27 |
+
*
|
28 |
+
*/
|
29 |
+
protected function doListen() {
|
30 |
+
// Only if permitted!
|
31 |
+
if ($this->hasAccess()) {
|
32 |
+
// Add menu page.
|
33 |
+
add_action('admin_menu', array(&$this, 'menu'), 11);
|
34 |
+
}
|
35 |
+
}
|
36 |
+
|
37 |
+
/**
|
38 |
+
* put your comment there...
|
39 |
+
*
|
40 |
+
*/
|
41 |
+
public function menu() {
|
42 |
+
// Setup Page.
|
43 |
+
$pageHookId = add_submenu_page(
|
44 |
+
CJTPlugin::PLUGIN_REQUEST_ID,
|
45 |
+
cssJSToolbox::getText('CJT Manage - Packages'),
|
46 |
+
cssJSToolbox::getText('Packages'),
|
47 |
+
'administrator',
|
48 |
+
CJTPlugin::PLUGIN_REQUEST_ID . '-packages',
|
49 |
+
array(&$this->controller, '_doAction')
|
50 |
+
);
|
51 |
+
// Process when its installed!!
|
52 |
+
add_action("load-{$pageHookId}", array($this, 'getPage'));
|
53 |
+
}
|
54 |
+
|
55 |
+
/**
|
56 |
+
* put your comment there...
|
57 |
+
*
|
58 |
+
*/
|
59 |
+
public function route($loadView = null, $request = array('view' => 'packages/manager')) {
|
60 |
+
// Load package manager view through the default controller.
|
61 |
+
$this->controllerName = 'default';
|
62 |
+
// Set MVC request parameters.
|
63 |
+
parent::route($loadView, $request)
|
64 |
+
// Fire 'display' action.
|
65 |
+
->setAction('display');
|
66 |
+
}
|
67 |
+
|
68 |
+
} // End class.
|
69 |
+
|
70 |
+
// Hookable!
|
71 |
+
CJTPackagesAccessPoint::define('CJTPackagesAccessPoint', array('hookType' => CJTWordpressEvents::HOOK_FILTER));
|
access.points/tinymce.accesspoint.php
ADDED
@@ -0,0 +1,52 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
*
|
4 |
+
*/
|
5 |
+
|
6 |
+
/**
|
7 |
+
*
|
8 |
+
*/
|
9 |
+
class CJTTinymceAccessPoint extends CJTAccessPoint {
|
10 |
+
|
11 |
+
/**
|
12 |
+
* put your comment there...
|
13 |
+
*
|
14 |
+
*/
|
15 |
+
public function __construct() {
|
16 |
+
// initialize base!
|
17 |
+
parent::__construct();
|
18 |
+
// Set name!
|
19 |
+
$this->name = 'tinymce';
|
20 |
+
}
|
21 |
+
|
22 |
+
/**
|
23 |
+
* put your comment there...
|
24 |
+
*
|
25 |
+
*/
|
26 |
+
protected function doListen() {
|
27 |
+
// Only if installed!
|
28 |
+
if (CJTPlugin::getInstance()->isInstalled()) {
|
29 |
+
// Don't bother doing this stuff if the current user lacks permissions
|
30 |
+
if ((current_user_can('edit_posts') || current_user_can('edit_pages')) && (get_user_option('rich_editing') == 'true')) {
|
31 |
+
add_filter('mce_external_plugins', array($this, 'registerButton'));
|
32 |
+
}
|
33 |
+
}
|
34 |
+
}
|
35 |
+
|
36 |
+
/**
|
37 |
+
* put your comment there...
|
38 |
+
*
|
39 |
+
* @param mixed $plugins
|
40 |
+
*/
|
41 |
+
public function registerButton($plugins) {
|
42 |
+
// Load tinymce/shortcodes view through default controller!
|
43 |
+
$this->controllerName = 'default';
|
44 |
+
$this->route(null, array('view' => 'tinymce/shortcodes'))
|
45 |
+
// Display
|
46 |
+
->setAction('display')
|
47 |
+
->_doAction();
|
48 |
+
// Don't register anything, we just use this filter as Action.
|
49 |
+
return $plugins;
|
50 |
+
}
|
51 |
+
|
52 |
+
} // End class
|
autoload.inc.php
CHANGED
@@ -17,5 +17,7 @@ $map = $CJTAutoLoad->map();
|
|
17 |
$map->offsetSet('CJTxTable', 'framework/db/mysql/xtable.inc.php');
|
18 |
$map->offsetSet('CJTTable', 'framework/db/mysql/table.inc.php');
|
19 |
$map->offsetSet('CJTBlockPinsTable', 'tables/block-pins.php');
|
|
|
|
|
20 |
$map->offsetSet('CJTBlockModel', 'models/block.php');
|
21 |
$map->offsetSet('CJTBlocksModel', 'models/blocks.php');
|
17 |
$map->offsetSet('CJTxTable', 'framework/db/mysql/xtable.inc.php');
|
18 |
$map->offsetSet('CJTTable', 'framework/db/mysql/table.inc.php');
|
19 |
$map->offsetSet('CJTBlockPinsTable', 'tables/block-pins.php');
|
20 |
+
$map->offsetSet('CJTBlocksTable', 'tables/blocks.php');
|
21 |
+
$map->offsetSet('CJTBlockFilesTable', 'tables/block-files.php');
|
22 |
$map->offsetSet('CJTBlockModel', 'models/block.php');
|
23 |
$map->offsetSet('CJTBlocksModel', 'models/blocks.php');
|
controllers/auto-upgrade.php
CHANGED
@@ -29,16 +29,25 @@ class CJTAutoUpgradeController extends CJTController {
|
|
29 |
// Get all CJT-Plugins (Include CJT Plugin itself + all its extensions) that has activate
|
30 |
// license key!
|
31 |
$activeLicenses = $model->getStatedLicenses();
|
32 |
-
//
|
33 |
-
|
34 |
-
|
|
|
|
|
|
|
|
|
|
|
35 |
}
|
|
|
|
|
36 |
// Activate Automatic upgrade for all activated licenses/components!
|
37 |
foreach ($activeLicenses as $name => $state) {
|
38 |
// Initializingn vars for a single state/component!
|
39 |
-
$
|
|
|
|
|
|
|
40 |
$license =& $state['license'];
|
41 |
-
$componentPluginPath = ABSPATH . PLUGINDIR . "/{$state['component']['pluginBase']}";
|
42 |
// Edd API parameter to be send along with he check!
|
43 |
$requestParams= array(
|
44 |
'version' => $plugin['Version'],
|
@@ -47,7 +56,7 @@ class CJTAutoUpgradeController extends CJTController {
|
|
47 |
'item_name' => $name,
|
48 |
);
|
49 |
// Set EDD Automatic Updater!
|
50 |
-
$updated = new
|
51 |
}
|
52 |
}
|
53 |
} // End class.
|
29 |
// Get all CJT-Plugins (Include CJT Plugin itself + all its extensions) that has activate
|
30 |
// license key!
|
31 |
$activeLicenses = $model->getStatedLicenses();
|
32 |
+
// Always REQUEST CJT server even if not key activated yet.
|
33 |
+
// FREE edition will just do normal check @Wordpress:reporioty
|
34 |
+
if (!isset($activeLicenses[CJTSetupModel::EDD_PRODUCT_NAME]) && (CJTPlugin::Edition != 'free')) {
|
35 |
+
$activeLicenses[CJTSetupModel::EDD_PRODUCT_NAME] = array(
|
36 |
+
'plugin' => array('Version' => CJTPlugin::VERSION, 'AuthorName' => 'CTK'),
|
37 |
+
'license' => array('key' => str_repeat('0', 32)),
|
38 |
+
'component' => array('pluginBase' => 'css-javascript-toolbox/css-js-toolbox.php')
|
39 |
+
);
|
40 |
}
|
41 |
+
// Import EDD updater Class!
|
42 |
+
cssJSToolbox::import('framework:third-party:easy-digital-download:auto-upgrade.class.php');
|
43 |
// Activate Automatic upgrade for all activated licenses/components!
|
44 |
foreach ($activeLicenses as $name => $state) {
|
45 |
// Initializingn vars for a single state/component!
|
46 |
+
$pluginFile = ABSPATH . PLUGINDIR . '/' . $state['component']['pluginBase'];
|
47 |
+
// Stop using Cached Data as it causes issue, always
|
48 |
+
// get fresh plugin data.
|
49 |
+
$plugin = get_plugin_data($pluginFile);
|
50 |
$license =& $state['license'];
|
|
|
51 |
// Edd API parameter to be send along with he check!
|
52 |
$requestParams= array(
|
53 |
'version' => $plugin['Version'],
|
56 |
'item_name' => $name,
|
57 |
);
|
58 |
// Set EDD Automatic Updater!
|
59 |
+
$updated = new CJT_EDD_SL_Plugin_Updater($cjtWebServer, $pluginFile, $requestParams);
|
60 |
}
|
61 |
}
|
62 |
} // End class.
|
controllers/block-ajax.php
CHANGED
@@ -35,9 +35,20 @@ class CJTBlockAjaxController extends CJTAjaxController {
|
|
35 |
$this->registryAction('getBlockBy');
|
36 |
$this->registryAction('getAPOP');
|
37 |
$this->registryAction('restoreRevision');
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
38 |
}
|
39 |
|
40 |
-
|
41 |
/**
|
42 |
* put your comment there...
|
43 |
*
|
@@ -85,10 +96,18 @@ class CJTBlockAjaxController extends CJTAjaxController {
|
|
85 |
public function getRevisionAction() {
|
86 |
// Initialize
|
87 |
$model = $this->getModel('blocks');
|
|
|
|
|
|
|
88 |
// Get request parameters.
|
89 |
-
$revision['id'] =
|
90 |
-
$revision['fields'] = array('id', '
|
91 |
$revision = $model->getBlock($revision['id'], array(), $revision['fields']);
|
|
|
|
|
|
|
|
|
|
|
92 |
// Discard Pins.
|
93 |
$revision->pages = false;
|
94 |
$revision->posts = false;
|
@@ -103,10 +122,12 @@ class CJTBlockAjaxController extends CJTAjaxController {
|
|
103 |
* @deprecated All will be moved to other controllers in the future versions.
|
104 |
*/
|
105 |
public function getRevisionsAction() {
|
|
|
106 |
$model = $this->getModel('blocks');
|
107 |
// Get request parameters.
|
108 |
$blockId = filter_input(INPUT_GET, 'id', FILTER_SANITIZE_NUMBER_INT);
|
109 |
// Get block revisions.
|
|
|
110 |
$revisions['filter']['parent'] = $blockId;
|
111 |
$revisions['filter']['type'] = 'revision';
|
112 |
// Its mandatory to select fields instead of using just .*.
|
@@ -124,7 +145,17 @@ class CJTBlockAjaxController extends CJTAjaxController {
|
|
124 |
// Return view content.
|
125 |
$this->response = $view->getTemplate('default');
|
126 |
}
|
127 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
128 |
/**
|
129 |
* put your comment there...
|
130 |
*
|
@@ -132,14 +163,25 @@ class CJTBlockAjaxController extends CJTAjaxController {
|
|
132 |
protected function restoreRevisionAction() {
|
133 |
// Initialize.
|
134 |
$mdlBlocks = new CJTBlocksModel();
|
|
|
135 |
// Get revision ID.
|
136 |
$rId = (int) $_GET['rid'];
|
137 |
$bId = (int) $_GET['bid'];
|
138 |
-
//
|
139 |
-
|
140 |
-
|
141 |
-
|
142 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
143 |
$revisionBlock->id = $bId;
|
144 |
$mdlBlocks->update($revisionBlock, true);
|
145 |
$mdlBlocks->save();
|
35 |
$this->registryAction('getBlockBy');
|
36 |
$this->registryAction('getAPOP');
|
37 |
$this->registryAction('restoreRevision');
|
38 |
+
$this->registryAction('loadUrl');
|
39 |
+
$this->registryAction('downloadCodeFile');
|
40 |
+
}
|
41 |
+
|
42 |
+
/**
|
43 |
+
* put your comment there...
|
44 |
+
*
|
45 |
+
* @deprecated this is just a redirect to the CJTBlockContoller::getAction().
|
46 |
+
*/
|
47 |
+
protected function downloadCodeFileAction() {
|
48 |
+
// Pass to CJTBlockController!
|
49 |
+
$this->redirect('block');
|
50 |
}
|
51 |
|
|
|
52 |
/**
|
53 |
* put your comment there...
|
54 |
*
|
96 |
public function getRevisionAction() {
|
97 |
// Initialize
|
98 |
$model = $this->getModel('blocks');
|
99 |
+
$tblCodeFile = new CJTBlockFilesTable(cssJSToolbox::getInstance()->getDBDriver());
|
100 |
+
// Inputs.
|
101 |
+
$revisionId = filter_input(INPUT_GET, 'id', FILTER_SANITIZE_NUMBER_INT);
|
102 |
// Get request parameters.
|
103 |
+
$revision['id'] = $revisionId;
|
104 |
+
$revision['fields'] = array('id', 'links', 'expressions', 'masterFile');
|
105 |
$revision = $model->getBlock($revision['id'], array(), $revision['fields']);
|
106 |
+
// Get revisioned code file.
|
107 |
+
$revision->code = $tblCodeFile->set('blockId', $revisionId)
|
108 |
+
->set('id', $revision->masterFile)
|
109 |
+
->load()
|
110 |
+
->getData()->code;
|
111 |
// Discard Pins.
|
112 |
$revision->pages = false;
|
113 |
$revision->posts = false;
|
122 |
* @deprecated All will be moved to other controllers in the future versions.
|
123 |
*/
|
124 |
public function getRevisionsAction() {
|
125 |
+
// initialize.
|
126 |
$model = $this->getModel('blocks');
|
127 |
// Get request parameters.
|
128 |
$blockId = filter_input(INPUT_GET, 'id', FILTER_SANITIZE_NUMBER_INT);
|
129 |
// Get block revisions.
|
130 |
+
$revisions['filter']['masterFile'] = $_GET['activeFileId'];
|
131 |
$revisions['filter']['parent'] = $blockId;
|
132 |
$revisions['filter']['type'] = 'revision';
|
133 |
// Its mandatory to select fields instead of using just .*.
|
145 |
// Return view content.
|
146 |
$this->response = $view->getTemplate('default');
|
147 |
}
|
148 |
+
|
149 |
+
/**
|
150 |
+
* put your comment there...
|
151 |
+
*
|
152 |
+
* @deprecated this is just a redirect to the CJTBlockContoller::getAction().
|
153 |
+
*/
|
154 |
+
protected function loadUrlAction() {
|
155 |
+
// Pass to CJTBlockController!
|
156 |
+
$this->redirect('block');
|
157 |
+
}
|
158 |
+
|
159 |
/**
|
160 |
* put your comment there...
|
161 |
*
|
163 |
protected function restoreRevisionAction() {
|
164 |
// Initialize.
|
165 |
$mdlBlocks = new CJTBlocksModel();
|
166 |
+
$tblCodeFile = new CJTBlockFilesTable(cssJSToolbox::getInstance()->getDBDriver());
|
167 |
// Get revision ID.
|
168 |
$rId = (int) $_GET['rid'];
|
169 |
$bId = (int) $_GET['bid'];
|
170 |
+
// Get Revision Block + Revision Code.
|
171 |
+
$revisionBlock = $mdlBlocks->getBlock($rId, array(), array('id', 'pinPoint', 'links', 'expressions', 'masterFile'));
|
172 |
+
$revisionBlock->code = $tblCodeFile->set('blockId', $rId)
|
173 |
+
->set('id', $revisionBlock->masterFile)
|
174 |
+
->load()
|
175 |
+
->getData()->code;
|
176 |
+
// If code === null set it to empoty string '' as null woulod
|
177 |
+
// prevent the field from being in the query, cause SQL error.
|
178 |
+
if ($revisionBlock->code === null) {
|
179 |
+
$revisionBlock->code = '';
|
180 |
+
}
|
181 |
+
// Code File Fields.
|
182 |
+
$revisionBlock->activeFileId = $revisionBlock->masterFile;
|
183 |
+
$revisionBlock->masterFile = null; // This is just for querying CodeFile. DONT UPDATE.
|
184 |
+
// Restore Block.
|
185 |
$revisionBlock->id = $bId;
|
186 |
$mdlBlocks->update($revisionBlock, true);
|
187 |
$mdlBlocks->save();
|
controllers/block.php
CHANGED
@@ -34,8 +34,47 @@ class CJTBlockController extends CJTAjaxController {
|
|
34 |
// Actions!
|
35 |
$this->registryAction('getBlockBy');
|
36 |
$this->registryAction('getAPOP');
|
|
|
|
|
|
|
37 |
}
|
38 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
39 |
/**
|
40 |
* Query single block based on the provided criteria!
|
41 |
*
|
@@ -88,5 +127,27 @@ class CJTBlockController extends CJTAjaxController {
|
|
88 |
$this->response['total'] = $typeObject->getTotalCount();
|
89 |
}
|
90 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
91 |
|
92 |
} // End class.
|
34 |
// Actions!
|
35 |
$this->registryAction('getBlockBy');
|
36 |
$this->registryAction('getAPOP');
|
37 |
+
$this->registryAction('loadUrl');
|
38 |
+
$this->registryAction('getCode');
|
39 |
+
$this->registryAction('downloadCodeFile');
|
40 |
}
|
41 |
|
42 |
+
/**
|
43 |
+
* put your comment there...
|
44 |
+
*
|
45 |
+
*/
|
46 |
+
public function downloadCodeFileAction() {
|
47 |
+
// BlockId, currentActiveFile.
|
48 |
+
$blockId = $_GET['blockId'];
|
49 |
+
$fileId = $_GET['fileId'];
|
50 |
+
$returnAs = $_GET['returnAs'];
|
51 |
+
// Get current File Code.
|
52 |
+
$tblCodeFile = new CJTBlockFilesTable(cssJSToolbox::getInstance()->getDBDriver());
|
53 |
+
$codeFile = $tblCodeFile->set('id', $fileId)
|
54 |
+
->set('blockId', $blockId)
|
55 |
+
->load()
|
56 |
+
->getData();
|
57 |
+
// Return as downloadable-file or JSON.
|
58 |
+
if ($returnAs == 'file') {
|
59 |
+
// Get Download File info.
|
60 |
+
$extension = $codeFile->type ? cssJSToolbox::$config->templates->types[$codeFile->type]->extension : 'txt';
|
61 |
+
$file = "{$codeFile->name}.{$extension}";
|
62 |
+
// Response Header parameters.
|
63 |
+
header('Content-Description: File Transfer');
|
64 |
+
header("Content-Disposition: attachment; filename=\"{$file}\""); //<<< Note the " " surrounding the file name
|
65 |
+
header('Content-Transfer-Encoding: binary');
|
66 |
+
header('Connection: Keep-Alive');
|
67 |
+
header('Expires: 0');
|
68 |
+
header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
|
69 |
+
header('Pragma: public');
|
70 |
+
header('Content-Length: ' . strlen($codeFile->code));
|
71 |
+
// AJAX Controller parameters.
|
72 |
+
$this->httpContentType = 'application/octet-stream';
|
73 |
+
}
|
74 |
+
// Output code.
|
75 |
+
$this->response = $codeFile->code;
|
76 |
+
}
|
77 |
+
|
78 |
/**
|
79 |
* Query single block based on the provided criteria!
|
80 |
*
|
127 |
$this->response['total'] = $typeObject->getTotalCount();
|
128 |
}
|
129 |
}
|
130 |
+
|
131 |
+
/**
|
132 |
+
* put your comment there...
|
133 |
+
*
|
134 |
+
* @deprecated this is just a redirect to the CJTBlockContoller::getAction().
|
135 |
+
*/
|
136 |
+
protected function loadUrlAction() {
|
137 |
+
// Read inputs.
|
138 |
+
$url = $_GET['url'];
|
139 |
+
// Read URL.
|
140 |
+
$response = wp_remote_get($url);
|
141 |
+
if ($error = $response instanceof WP_Error) {
|
142 |
+
// State an error!
|
143 |
+
$this->response['errorCode'] = $response->get_error_code();
|
144 |
+
$this->response['message'] = $response->get_error_message($response['code']);
|
145 |
+
break;
|
146 |
+
}
|
147 |
+
else {
|
148 |
+
// Read code content.
|
149 |
+
$this->response['content'] = wp_remote_retrieve_body($response);
|
150 |
+
}
|
151 |
+
}
|
152 |
|
153 |
} // End class.
|
controllers/blocks-ajax.php
CHANGED
@@ -42,6 +42,7 @@ class CJTBlocksAjaxController extends CJTAjaxController {
|
|
42 |
$this->registryAction('get_view');
|
43 |
$this->registryAction('save_blocks');
|
44 |
$this->registryAction('saveOrder');
|
|
|
45 |
}
|
46 |
|
47 |
/**
|
@@ -75,7 +76,7 @@ class CJTBlocksAjaxController extends CJTAjaxController {
|
|
75 |
$blockData = array(
|
76 |
'id' => $blockId,
|
77 |
'name' => $defaultBlockName,
|
78 |
-
'state' =>
|
79 |
'location' => null,
|
80 |
'owner' => get_current_user_id(),
|
81 |
'created' => $wordpressMYSQLTime,
|
@@ -98,7 +99,7 @@ class CJTBlocksAjaxController extends CJTAjaxController {
|
|
98 |
$blockId = $blocksModel->add($block->getValues());
|
99 |
$blocksModel->save();
|
100 |
// Read newly added block from database.
|
101 |
-
$newBlockData = $blocksModel->getBlock($blockId);
|
102 |
|
103 |
if ($newBlockData === null) {
|
104 |
throw new Exception('Could not add new block!!!');
|
@@ -165,6 +166,21 @@ class CJTBlocksAjaxController extends CJTAjaxController {
|
|
165 |
}
|
166 |
}
|
167 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
168 |
/**
|
169 |
* put your comment there...
|
170 |
*
|
@@ -174,6 +190,7 @@ class CJTBlocksAjaxController extends CJTAjaxController {
|
|
174 |
// Blocks are sent ins single array list.
|
175 |
$blocksToSave = filter_input(INPUT_POST, 'blocks', FILTER_UNSAFE_RAW, FILTER_REQUIRE_ARRAY);
|
176 |
$calculatePinPoint = (bool) filter_input(INPUT_POST, 'calculatePinPoint', FILTER_SANITIZE_NUMBER_INT);
|
|
|
177 |
// For any reason that cause Client/Javascript to send empty blocks,
|
178 |
// make sure we're save.
|
179 |
if (is_array($blocksToSave) && !empty($blocksToSave)) {
|
@@ -183,6 +200,8 @@ class CJTBlocksAjaxController extends CJTAjaxController {
|
|
183 |
$blockData->id = $id;
|
184 |
// Recalculate pinPoint field value.
|
185 |
!$calculatePinPoint or (CJTBlockModel::arrangePins($blockData) && CJTBlockModel::calculateBlockPinPoint($blockData));
|
|
|
|
|
186 |
// Set lastModified field to current time.
|
187 |
$blockData->lastModified = current_time('mysql');
|
188 |
// Update database.
|
42 |
$this->registryAction('get_view');
|
43 |
$this->registryAction('save_blocks');
|
44 |
$this->registryAction('saveOrder');
|
45 |
+
$this->registryAction('loadBlock');
|
46 |
}
|
47 |
|
48 |
/**
|
76 |
$blockData = array(
|
77 |
'id' => $blockId,
|
78 |
'name' => $defaultBlockName,
|
79 |
+
'state' => null,
|
80 |
'location' => null,
|
81 |
'owner' => get_current_user_id(),
|
82 |
'created' => $wordpressMYSQLTime,
|
99 |
$blockId = $blocksModel->add($block->getValues());
|
100 |
$blocksModel->save();
|
101 |
// Read newly added block from database.
|
102 |
+
$newBlockData = $blocksModel->getBlock($blockId, array('returnCodeFile' => true));
|
103 |
|
104 |
if ($newBlockData === null) {
|
105 |
throw new Exception('Could not add new block!!!');
|
166 |
}
|
167 |
}
|
168 |
|
169 |
+
/**
|
170 |
+
* put your comment there...
|
171 |
+
*
|
172 |
+
*/
|
173 |
+
public function loadBlockAction() {
|
174 |
+
// Block Id.
|
175 |
+
$blockId = (int) $_GET['blockId'];
|
176 |
+
// Get block content.
|
177 |
+
$view = CJTView::getInstance('blocks/cjt-block');
|
178 |
+
$view->setBlock(CJTModel::create('blocks')->getBlock($blockId, array('returnCodeFile' => true)));
|
179 |
+
// Return View content.
|
180 |
+
$view->getTemplate('default');
|
181 |
+
$this->response = $view->structuredContent;
|
182 |
+
}
|
183 |
+
|
184 |
/**
|
185 |
* put your comment there...
|
186 |
*
|
190 |
// Blocks are sent ins single array list.
|
191 |
$blocksToSave = filter_input(INPUT_POST, 'blocks', FILTER_UNSAFE_RAW, FILTER_REQUIRE_ARRAY);
|
192 |
$calculatePinPoint = (bool) filter_input(INPUT_POST, 'calculatePinPoint', FILTER_SANITIZE_NUMBER_INT);
|
193 |
+
$createRevision = (bool) filter_input(INPUT_POST, 'createRevision', FILTER_SANITIZE_NUMBER_INT);
|
194 |
// For any reason that cause Client/Javascript to send empty blocks,
|
195 |
// make sure we're save.
|
196 |
if (is_array($blocksToSave) && !empty($blocksToSave)) {
|
200 |
$blockData->id = $id;
|
201 |
// Recalculate pinPoint field value.
|
202 |
!$calculatePinPoint or (CJTBlockModel::arrangePins($blockData) && CJTBlockModel::calculateBlockPinPoint($blockData));
|
203 |
+
// Create block revision.
|
204 |
+
!$createRevision or $this->model->addRevision($id, $blockData->activeFileId);
|
205 |
// Set lastModified field to current time.
|
206 |
$blockData->lastModified = current_time('mysql');
|
207 |
// Update database.
|
controllers/blocks-coupling.php
CHANGED
@@ -43,13 +43,6 @@ class CJTBlocksCouplingController extends CJTController {
|
|
43 |
*/
|
44 |
protected $filters = null;
|
45 |
|
46 |
-
/**
|
47 |
-
* put your comment there...
|
48 |
-
*
|
49 |
-
* @var mixed
|
50 |
-
*/
|
51 |
-
protected $hasRun = false;
|
52 |
-
|
53 |
/**
|
54 |
* put your comment there...
|
55 |
*
|
@@ -126,6 +119,34 @@ class CJTBlocksCouplingController extends CJTController {
|
|
126 |
* @var mixed
|
127 |
*/
|
128 |
protected $ongetfilters = array('parameters' => array('filters'));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
129 |
|
130 |
/**
|
131 |
* put your comment there...
|
@@ -162,6 +183,20 @@ class CJTBlocksCouplingController extends CJTController {
|
|
162 |
*/
|
163 |
protected $onprocessblock = array('parameters' => array('block'));
|
164 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
165 |
/**
|
166 |
* put your comment there...
|
167 |
*
|
@@ -169,6 +204,13 @@ class CJTBlocksCouplingController extends CJTController {
|
|
169 |
*/
|
170 |
protected $onsetfilters = array('parameters' => array('filters'));
|
171 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
172 |
/**
|
173 |
* Initialize controller object.
|
174 |
*
|
@@ -223,6 +265,11 @@ class CJTBlocksCouplingController extends CJTController {
|
|
223 |
$metaBoxesOrder = $this->onblocksorder($this->model->getOrder());
|
224 |
// Get ORDER-INDEX <TO> BLOCK-ID mapping.
|
225 |
preg_match_all('/cjtoolbox-(\d+)/', $metaBoxesOrder['normal'], $blocksOrder, PREG_SET_ORDER);
|
|
|
|
|
|
|
|
|
|
|
226 |
// Prepare request URL to match against Links & Expressions.
|
227 |
$linksRequestURL = self::getRequestURL();
|
228 |
$expressionsRequestURL = "{$linksRequestURL}?{$_SERVER['QUERY_STRING']}";
|
@@ -281,6 +328,10 @@ class CJTBlocksCouplingController extends CJTController {
|
|
281 |
continue;
|
282 |
}
|
283 |
}
|
|
|
|
|
|
|
|
|
284 |
// For every location store blocks code into single string
|
285 |
$evaluatedCode = CJTPHPCodeEvaluator::getInstance($block)->exec()->getOutput();
|
286 |
/** @todo Include Debuging info only if we're in debuging mode! */
|
@@ -292,6 +343,13 @@ class CJTBlocksCouplingController extends CJTController {
|
|
292 |
$this->addOnActionIds($blockId);
|
293 |
}
|
294 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
295 |
// Return true if there is at least 1 block return within the set.
|
296 |
return true;
|
297 |
}
|
@@ -355,22 +413,92 @@ class CJTBlocksCouplingController extends CJTController {
|
|
355 |
// The wrong call won't has $wp_query object set,
|
356 |
// but this is only valid at Front end.
|
357 |
if (!is_admin() && !$GLOBALS['wp_query']) {
|
358 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
359 |
}
|
360 |
-
//
|
361 |
-
|
362 |
-
|
363 |
-
|
364 |
-
|
365 |
-
|
366 |
-
|
367 |
-
|
368 |
-
|
369 |
-
|
370 |
-
|
371 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
372 |
}
|
373 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
374 |
}
|
375 |
|
376 |
/**
|
@@ -400,6 +528,7 @@ class CJTBlocksCouplingController extends CJTController {
|
|
400 |
$filters = $this->ondefaultfilters((object) array(
|
401 |
'pinPoint' => 0x00000000,
|
402 |
'customPins' => array(),
|
|
|
403 |
));
|
404 |
if (is_admin()) {
|
405 |
// Include all backend blocks.
|
@@ -421,6 +550,13 @@ class CJTBlocksCouplingController extends CJTController {
|
|
421 |
if (is_front_page()) {
|
422 |
$filters->pinPoint |= CJTBlockModel::PINS_PAGES_FRONT_PAGE;
|
423 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
424 |
} // End is_page()
|
425 |
else if (is_attachment()) {
|
426 |
$filters->pinPoint |= CJTBlockModel::PINS_ATTACHMENT;
|
@@ -451,6 +587,13 @@ class CJTBlocksCouplingController extends CJTController {
|
|
451 |
'flag' => CJTBlockModel::PINS_CATEGORIES_CUSTOM_CATEGORY,
|
452 |
);
|
453 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
454 |
/**
|
455 |
* @TODO check for recent posts Based on user configuration.
|
456 |
* Recent posts should be detcted by comparing
|
43 |
*/
|
44 |
protected $filters = null;
|
45 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
46 |
/**
|
47 |
* put your comment there...
|
48 |
*
|
119 |
* @var mixed
|
120 |
*/
|
121 |
protected $ongetfilters = array('parameters' => array('filters'));
|
122 |
+
|
123 |
+
/**
|
124 |
+
* put your comment there...
|
125 |
+
*
|
126 |
+
* @var mixed
|
127 |
+
*/
|
128 |
+
protected $onlinkedtemplates = array('parameters' => array('templates'));
|
129 |
+
|
130 |
+
/**
|
131 |
+
* put your comment there...
|
132 |
+
*
|
133 |
+
* @var mixed
|
134 |
+
*/
|
135 |
+
protected $onlinkscripts = array('parameters' => array('templates'));
|
136 |
+
|
137 |
+
/**
|
138 |
+
* put your comment there...
|
139 |
+
*
|
140 |
+
* @var mixed
|
141 |
+
*/
|
142 |
+
protected $onlinkstyles = array('parameters' => array('templates'));
|
143 |
+
|
144 |
+
/**
|
145 |
+
* put your comment there...
|
146 |
+
*
|
147 |
+
* @var mixed
|
148 |
+
*/
|
149 |
+
protected $onlinktemplate = array('parameters' => array('template'));
|
150 |
|
151 |
/**
|
152 |
* put your comment there...
|
183 |
*/
|
184 |
protected $onprocessblock = array('parameters' => array('block'));
|
185 |
|
186 |
+
/**
|
187 |
+
* put your comment there...
|
188 |
+
*
|
189 |
+
* @var mixed
|
190 |
+
*/
|
191 |
+
protected $onqueuecss = array('parameters' => array('style'));
|
192 |
+
|
193 |
+
/**
|
194 |
+
* put your comment there...
|
195 |
+
*
|
196 |
+
* @var mixed
|
197 |
+
*/
|
198 |
+
protected $onqueuejavascript = array('parameters' => array('script'));
|
199 |
+
|
200 |
/**
|
201 |
* put your comment there...
|
202 |
*
|
204 |
*/
|
205 |
protected $onsetfilters = array('parameters' => array('filters'));
|
206 |
|
207 |
+
/**
|
208 |
+
* put your comment there...
|
209 |
+
*
|
210 |
+
* @var mixed
|
211 |
+
*/
|
212 |
+
protected $templates = array();
|
213 |
+
|
214 |
/**
|
215 |
* Initialize controller object.
|
216 |
*
|
265 |
$metaBoxesOrder = $this->onblocksorder($this->model->getOrder());
|
266 |
// Get ORDER-INDEX <TO> BLOCK-ID mapping.
|
267 |
preg_match_all('/cjtoolbox-(\d+)/', $metaBoxesOrder['normal'], $blocksOrder, PREG_SET_ORDER);
|
268 |
+
/**
|
269 |
+
* append more to orders produced by CJTBlocksCouplingController::setRequestFilter().
|
270 |
+
* More to orders may allow other blocks to bein the output (e.g metaboxe blocks).
|
271 |
+
*/
|
272 |
+
$blocksOrder = array_merge($blocksOrder, $this->getFilters()->moreToOrder);
|
273 |
// Prepare request URL to match against Links & Expressions.
|
274 |
$linksRequestURL = self::getRequestURL();
|
275 |
$expressionsRequestURL = "{$linksRequestURL}?{$_SERVER['QUERY_STRING']}";
|
328 |
continue;
|
329 |
}
|
330 |
}
|
331 |
+
// Retrieve block code-files.
|
332 |
+
$block->code = $this->model->getBlockCode($block->id);
|
333 |
+
// Import Executable (PHP and HTML) templates.
|
334 |
+
$block->code = $block->code . $this->model->getExecTemplatesCode($block->id);
|
335 |
// For every location store blocks code into single string
|
336 |
$evaluatedCode = CJTPHPCodeEvaluator::getInstance($block)->exec()->getOutput();
|
337 |
/** @todo Include Debuging info only if we're in debuging mode! */
|
343 |
$this->addOnActionIds($blockId);
|
344 |
}
|
345 |
}
|
346 |
+
$templates = $this->onActionIds ? $this->model->getLinkedTemplates($this->onActionIds) : array();
|
347 |
+
// Classisfy as we process Scripts and Styles separatly (different hooks!).
|
348 |
+
foreach ($this->onlinkedtemplates($templates) as $id => $template) {
|
349 |
+
// Filer template!
|
350 |
+
extract($this->onlinktemplate(compact('template', 'id')));
|
351 |
+
$this->templates[$template->type][$id] = $template;
|
352 |
+
}
|
353 |
// Return true if there is at least 1 block return within the set.
|
354 |
return true;
|
355 |
}
|
413 |
// The wrong call won't has $wp_query object set,
|
414 |
// but this is only valid at Front end.
|
415 |
if (!is_admin() && !$GLOBALS['wp_query']) {
|
416 |
+
return;
|
417 |
+
}
|
418 |
+
// Get current application hook prefix.
|
419 |
+
$actionsPrefix = is_admin() ? 'admin' : 'wp';
|
420 |
+
// Get cache or get blocks if not cached.
|
421 |
+
// If there is no cache or no blocks for output
|
422 |
+
// do nothing.
|
423 |
+
if ($this->getCached() || $this->getBlocks()) {
|
424 |
+
// Output blocks on various locations!
|
425 |
+
add_action("{$actionsPrefix}_head", array(&$this, 'outputBlocks'), 30);
|
426 |
+
add_action("{$actionsPrefix}_footer", array(&$this, 'outputBlocks'), 30);
|
427 |
+
// Links templates & styloes!
|
428 |
+
add_action("{$actionsPrefix}_enqueue_scripts", array(&$this, 'linkTemplates'), 30);
|
429 |
+
add_action("{$actionsPrefix}_print_styles", array(&$this, 'linkTemplates'), 30);
|
430 |
}
|
431 |
+
// Link style sheet in footer required custom implementation.
|
432 |
+
add_action("{$actionsPrefix}_print_footer_scripts", array(&$this, 'linkFooterStyleSheets'), 9);
|
433 |
+
// Make sure this is executed only once.
|
434 |
+
// Sometimes wp hook run on backend and sometimes its not.
|
435 |
+
// This method handle both front and backend requests.
|
436 |
+
// Simply remove all hooks to ensure its run only one time.
|
437 |
+
remove_action('wp', array(&$this, 'initCoupling'));
|
438 |
+
remove_action('admin_init', array(&$this, 'initCoupling'));
|
439 |
+
}
|
440 |
+
|
441 |
+
/**
|
442 |
+
* put your comment there...
|
443 |
+
*
|
444 |
+
*/
|
445 |
+
public function linkFooterStyleSheets() {
|
446 |
+
// Initialize.
|
447 |
+
$styles = array();
|
448 |
+
// Get queued style sheets!
|
449 |
+
global $wp_styles;
|
450 |
+
$queuedStyles =& $wp_styles->queue;
|
451 |
+
// Process only 'cjt' templates,
|
452 |
+
foreach ($queuedStyles as $index => $styleName) {
|
453 |
+
if (strpos($styleName, 'cjt-css-template-') === 0) {
|
454 |
+
// Get style name src file, prepend to Wordpress absolute path.
|
455 |
+
$style = $wp_styles->registered[$styleName];
|
456 |
+
$styles[] = home_url($style->src);
|
457 |
+
// Stop Wordpress from output <link> tag outside head tag
|
458 |
+
// as it has no effect.
|
459 |
+
unset($queuedStyles[$index]);
|
460 |
}
|
461 |
}
|
462 |
+
// Enqueue Style Sheet loader javascript if there is any
|
463 |
+
// styles need to be loaded.
|
464 |
+
if (!empty($styles)) {
|
465 |
+
// jQuery is dpendency object required by the loader.
|
466 |
+
wp_enqueue_script('jquery');
|
467 |
+
// Enqueue footer style sheet loader.
|
468 |
+
wp_enqueue_script('cjt-coupling-footer-css-loader', cssJSToolbox::getURI('controllers:coupling:js:footer-stylesheet-loader.js'));
|
469 |
+
// Output Javascript array to be filled with the styles!
|
470 |
+
$jsStyleSheetsList = json_encode($styles);
|
471 |
+
require cssJSToolbox::resolvePath('controllers:coupling:html:load-footer-style.html.php');
|
472 |
+
}
|
473 |
+
}
|
474 |
+
|
475 |
+
/**
|
476 |
+
* put your comment there...
|
477 |
+
*
|
478 |
+
*/
|
479 |
+
public function linkTemplates() {
|
480 |
+
$currentFilter = current_filter();
|
481 |
+
// Derived template Type from Wordpress filter.
|
482 |
+
$filterFor = explode('_', $currentFilter); $filterFor = array_pop($filterFor);
|
483 |
+
$type = CJTCouplingModel::$templateTypes[$filterFor];
|
484 |
+
// Following vars are referenced based on the current type.
|
485 |
+
$templates = isset($this->templates[$type]) ? $this->templates[$type] : array();
|
486 |
+
// Filering!
|
487 |
+
$templates = $this->{"onlink{$filterFor}"}($templates);
|
488 |
+
/**
|
489 |
+
* @var WP_Dependencies
|
490 |
+
*/
|
491 |
+
$queue = $this->model->getQueueObject($filterFor);
|
492 |
+
// Add templates to the queye.
|
493 |
+
foreach ($templates as $template) {
|
494 |
+
// Registery only if not yet registered.
|
495 |
+
$template = $this->{"onqueue{$type}"}($template);
|
496 |
+
if (!isset($queue->registered[$template->queueName])) {
|
497 |
+
$queue->add($template->queueName, "/{$template->file}", null, $template->version);
|
498 |
+
}
|
499 |
+
// Always make sure the template is queued.
|
500 |
+
$queue->enqueue($template->queueName);
|
501 |
+
}
|
502 |
}
|
503 |
|
504 |
/**
|
528 |
$filters = $this->ondefaultfilters((object) array(
|
529 |
'pinPoint' => 0x00000000,
|
530 |
'customPins' => array(),
|
531 |
+
'moreToOrder' => array(),
|
532 |
));
|
533 |
if (is_admin()) {
|
534 |
// Include all backend blocks.
|
550 |
if (is_front_page()) {
|
551 |
$filters->pinPoint |= CJTBlockModel::PINS_PAGES_FRONT_PAGE;
|
552 |
}
|
553 |
+
/**
|
554 |
+
* In order for metabox block to get in the output we need
|
555 |
+
* to add metabox order for it.
|
556 |
+
* @see CJTBlocksCouplingController::getBlocks.
|
557 |
+
*/
|
558 |
+
$metabox = CJTModel::create('metabox', array($GLOBALS['post']->ID));
|
559 |
+
$filters->moreToOrder[][1] = $metabox->getMetaboxId();
|
560 |
} // End is_page()
|
561 |
else if (is_attachment()) {
|
562 |
$filters->pinPoint |= CJTBlockModel::PINS_ATTACHMENT;
|
587 |
'flag' => CJTBlockModel::PINS_CATEGORIES_CUSTOM_CATEGORY,
|
588 |
);
|
589 |
}
|
590 |
+
/**
|
591 |
+
* In order for metabox block to get in the output we need
|
592 |
+
* to add metabox order for it.
|
593 |
+
* @see CJTBlocksCouplingController::getBlocks.
|
594 |
+
*/
|
595 |
+
$metabox = CJTModel::create('metabox', array($GLOBALS['post']->ID));
|
596 |
+
$filters->moreToOrder[][1] = $metabox->getMetaboxId();
|
597 |
/**
|
598 |
* @TODO check for recent posts Based on user configuration.
|
599 |
* Recent posts should be detcted by comparing
|
controllers/blocks.php
CHANGED
@@ -50,12 +50,16 @@ class CJTBlocksController extends CJTController {
|
|
50 |
* @return void
|
51 |
*/
|
52 |
public function indexAction() {
|
53 |
-
//
|
|
|
54 |
$blocks['filters']['type'] = 'block';
|
|
|
|
|
|
|
55 |
// Push data to the view.
|
56 |
$this->view->blocks = $this->model->getBlocks(null, $blocks['filters']);
|
57 |
$this->view->order = $this->model->getOrder();
|
58 |
-
$this->view->backupId =
|
59 |
$this->view->securityToken = $this->createSecurityToken();
|
60 |
// page hook is added later after this object is already created.
|
61 |
// Get page hook directrly from controllers.
|
50 |
* @return void
|
51 |
*/
|
52 |
public function indexAction() {
|
53 |
+
// Prepare backupId in case backup is restored.
|
54 |
+
$backupId = filter_input(INPUT_GET, 'backupId', FILTER_SANITIZE_NUMBER_INT);
|
55 |
$blocks['filters']['type'] = 'block';
|
56 |
+
// If backupId is not provided it must be NULL in the filter,
|
57 |
+
$blocks['filters']['backupId'] = $backupId ? $backupId : null;
|
58 |
+
$blocks['filters']['returnCodeFile'] = true;
|
59 |
// Push data to the view.
|
60 |
$this->view->blocks = $this->model->getBlocks(null, $blocks['filters']);
|
61 |
$this->view->order = $this->model->getOrder();
|
62 |
+
$this->view->backupId = $blocks['filters']['backupId'];
|
63 |
$this->view->securityToken = $this->createSecurityToken();
|
64 |
// page hook is added later after this object is already created.
|
65 |
// Get page hook directrly from controllers.
|
controllers/code-files.php
ADDED
@@ -0,0 +1,128 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
*
|
4 |
+
*/
|
5 |
+
|
6 |
+
// Disallow direct access.
|
7 |
+
defined('ABSPATH') or die("Access denied");
|
8 |
+
|
9 |
+
// import dependencies.
|
10 |
+
cssJSToolbox::import('framework:mvc:controller-ajax.inc.php');
|
11 |
+
|
12 |
+
/**
|
13 |
+
* This class should replace any other controllers that
|
14 |
+
* has methods for interacting with a single Block (e.g block-ajax!)
|
15 |
+
*
|
16 |
+
* All single Block actions (e.g edit, new and save) should be placed/moved here
|
17 |
+
* in the future!
|
18 |
+
*/
|
19 |
+
class CJTCodeFilesController extends CJTAjaxController {
|
20 |
+
|
21 |
+
/**
|
22 |
+
* put your comment there...
|
23 |
+
*
|
24 |
+
* @var mixed
|
25 |
+
*/
|
26 |
+
protected $controllerInfo = array();
|
27 |
+
|
28 |
+
/**
|
29 |
+
* put your comment there...
|
30 |
+
*
|
31 |
+
*/
|
32 |
+
public function __construct() {
|
33 |
+
parent::__construct();
|
34 |
+
// Actions!
|
35 |
+
$this->registryAction('getList');
|
36 |
+
$this->registryAction('delete');
|
37 |
+
$this->registryAction('save');
|
38 |
+
$this->registryAction('switch');
|
39 |
+
}
|
40 |
+
|
41 |
+
/**
|
42 |
+
* put your comment there...
|
43 |
+
*
|
44 |
+
*/
|
45 |
+
public function deleteAction() {
|
46 |
+
// Block id.
|
47 |
+
$blockId = (int) $_GET['blockId'];
|
48 |
+
$ids = $_GET['ids'];
|
49 |
+
// Fetch code Blocks list.
|
50 |
+
$tblCodeFiles = new CJTBlockFilesTable(cssJSToolbox::getInstance()->getDBDriver());
|
51 |
+
// Delete all
|
52 |
+
foreach ($ids as $id) {
|
53 |
+
$tblCodeFiles->set('blockId', $blockId)
|
54 |
+
->set('id', $id)
|
55 |
+
->delete();
|
56 |
+
}
|
57 |
+
// Response with list and codeFileIds.
|
58 |
+
$this->response['blockId'] = $blockId;
|
59 |
+
$this->response['ids'] = $ids;
|
60 |
+
}
|
61 |
+
|
62 |
+
/**
|
63 |
+
* put your comment there...
|
64 |
+
*
|
65 |
+
*/
|
66 |
+
public function getListAction() {
|
67 |
+
// Block id.
|
68 |
+
$blockId = (int) $_GET['blockId'];
|
69 |
+
//; Fetch code Blocks list.
|
70 |
+
$tblCodeFiles = new CJTBlockFilesTable(cssJSToolbox::getInstance()->getDBDriver());
|
71 |
+
$result = $tblCodeFiles->set('blockId', $blockId)->fetchAll();
|
72 |
+
foreach ($result as $codeFile) {
|
73 |
+
$codeFilesList[] = array(
|
74 |
+
'name' => $codeFile['name'],
|
75 |
+
'description' => $codeFile['description'],
|
76 |
+
'type' => $codeFile['type'],
|
77 |
+
'tag' => $codeFile['tag'],
|
78 |
+
'id' => $codeFile['id'],
|
79 |
+
'order' => $codeFile['order'],
|
80 |
+
);
|
81 |
+
}
|
82 |
+
// Response with list and blockId.
|
83 |
+
$this->response['blockId'] = $blockId;
|
84 |
+
$this->response['list'] = $codeFilesList;
|
85 |
+
}
|
86 |
+
|
87 |
+
/**
|
88 |
+
* put your comment there...
|
89 |
+
*
|
90 |
+
*/
|
91 |
+
public function saveAction() {
|
92 |
+
// Block id.
|
93 |
+
$blockId = (int) $_POST['blockId'];
|
94 |
+
$codeFile = filter_input(INPUT_POST, 'codeFile', FILTER_UNSAFE_RAW, FILTER_REQUIRE_ARRAY);
|
95 |
+
// Add blockId to codeFile record.
|
96 |
+
$codeFile['blockId'] = (int) $blockId;
|
97 |
+
// Get Code Files Table.
|
98 |
+
$tblCodeFiles = new CJTBlockFilesTable(cssJSToolbox::getInstance()->getDBDriver());
|
99 |
+
// Fill
|
100 |
+
$tblCodeFiles->setData($codeFile)
|
101 |
+
// Update or insert.
|
102 |
+
->save(false, true);
|
103 |
+
// Return New CodeFile Data.
|
104 |
+
$this->response = (array) $tblCodeFiles->getData();
|
105 |
+
}
|
106 |
+
|
107 |
+
/**
|
108 |
+
* put your comment there...
|
109 |
+
*
|
110 |
+
*/
|
111 |
+
public function switchAction() {
|
112 |
+
// Block id.
|
113 |
+
$blockId = (int) $_GET['blockId'];
|
114 |
+
$fileId =(int) $_GET['codeFileId'];
|
115 |
+
// Read Code File Record.
|
116 |
+
$tblCodeFiles = new CJTBlockFilesTable(cssJSToolbox::getInstance()->getDBDriver());
|
117 |
+
$codeFile = $tblCodeFiles->set('blockId', $blockId)
|
118 |
+
->set('id', $fileId)
|
119 |
+
->load()
|
120 |
+
->getData();
|
121 |
+
// Set author Active Code File Id.
|
122 |
+
// TODO: Setting Active File ID should be in the MODEL!
|
123 |
+
update_user_meta(get_current_user_id(), "cjt_block_active_file_{$blockId}", $fileId);
|
124 |
+
// Return code file.
|
125 |
+
$this->response = $codeFile;
|
126 |
+
}
|
127 |
+
|
128 |
+
} // End class.
|
controllers/coupling/html/load-footer-style.html.php
ADDED
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @version $ Id; blocks-coupling.php 21-03-2012 03:22:10 Ahmed Said $
|
4 |
+
*/
|
5 |
+
|
6 |
+
// Disallow direct access.
|
7 |
+
defined('ABSPATH') or die("Access denied");
|
8 |
+
|
9 |
+
?>
|
10 |
+
<script type="text/javascript">
|
11 |
+
var cjt_footer_linked_stylesheets = <?php echo $jsStyleSheetsList ?>;
|
12 |
+
</script>
|
controllers/coupling/js/footer-stylesheet-loader.js
ADDED
@@ -0,0 +1,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
|
2 |
+
/**
|
3 |
+
* Simply load all footer style sheets by directly adding them
|
4 |
+
* to the header tag using a 'link' element.
|
5 |
+
*/
|
6 |
+
jQuery.each(cjt_footer_linked_stylesheets,
|
7 |
+
jQuery.proxy(function(index, style) {
|
8 |
+
var link = '<link href="' + style + '" rel="stylesheet" type="text/css" />';
|
9 |
+
jQuery('head').append(link);
|
10 |
+
}, this)
|
11 |
+
);
|
controllers/coupling/shortcode/block/block.php
CHANGED
@@ -84,14 +84,41 @@ class CJT_Controllers_Coupling_Shortcode_Block extends CJTHookableClass {
|
|
84 |
if (($this->options['force'] == 'true') || !in_array($block->id, $coupling->getOnActionIds())) {
|
85 |
// Id is being used!
|
86 |
$coupling->addOnActionIds((int) $block->id);
|
|
|
|
|
|
|
|
|
87 |
// CJT Block Standard Parameters object.
|
88 |
-
|
89 |
-
$spi = new CJT_Framework_Developer_Interface_Block_Shortcode($block, $this->parameters, $this->content);
|
90 |
// Get block code, execute it as PHP!
|
91 |
$blockCode = CJTPHPCodeEvaluator::getInstance($block)->exec(array('cb' => $spi))->getOutput();
|
92 |
// CJT Shortcode markup interface (CSMI)!
|
93 |
// CSMI is HTML markup to identify the CJT block Shortcode replacement.
|
94 |
$replacement = "<{$this->options['tag']} id='{$spi->containerElementId()}' class='csmi csmi-bid-{$block->id} csmi-{$block->name}'>{$this->content}{$blockCode}</{$this->options['tag']}>";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
95 |
}
|
96 |
}
|
97 |
}
|
84 |
if (($this->options['force'] == 'true') || !in_array($block->id, $coupling->getOnActionIds())) {
|
85 |
// Id is being used!
|
86 |
$coupling->addOnActionIds((int) $block->id);
|
87 |
+
// Retrieve block code-files.
|
88 |
+
$block->code = $model->getBlockCode($block->id);
|
89 |
+
// Import Executable (PHP and HTML) templates.
|
90 |
+
$block->code = $block->code . $model->getExecTemplatesCode($block->id);
|
91 |
// CJT Block Standard Parameters object.
|
92 |
+
$spi = new CJT_Framework_Developer_Interface_Block_Shortcode_Shortcode($block, $this->parameters, $this->content);
|
|
|
93 |
// Get block code, execute it as PHP!
|
94 |
$blockCode = CJTPHPCodeEvaluator::getInstance($block)->exec(array('cb' => $spi))->getOutput();
|
95 |
// CJT Shortcode markup interface (CSMI)!
|
96 |
// CSMI is HTML markup to identify the CJT block Shortcode replacement.
|
97 |
$replacement = "<{$this->options['tag']} id='{$spi->containerElementId()}' class='csmi csmi-bid-{$block->id} csmi-{$block->name}'>{$this->content}{$blockCode}</{$this->options['tag']}>";
|
98 |
+
// Get linked templates.
|
99 |
+
$linkedStylesheets = '';
|
100 |
+
$templates = $model->getLinkedTemplates($block->id);
|
101 |
+
$reverseTypes = array_flip(CJTCouplingModel::$templateTypes);
|
102 |
+
// Enqueue all scripts & Direct Output for all Style Sheets!
|
103 |
+
foreach ($templates as $template) {
|
104 |
+
// Get Template type name.
|
105 |
+
$typeName = $reverseTypes[$template->type];
|
106 |
+
/**
|
107 |
+
* @var WP_Dependencies
|
108 |
+
*/
|
109 |
+
$queue = $model->getQueueObject($typeName);
|
110 |
+
if (!in_array($template->queueName, $queue->done)) {
|
111 |
+
if (!isset($queue->registered[$template->queueName])) {
|
112 |
+
$queue->add($template->queueName, "/{$template->file}", null, $template->version, 1);
|
113 |
+
}
|
114 |
+
// Enqueue template!
|
115 |
+
$queue->enqueue($template->queueName);
|
116 |
+
}
|
117 |
+
}
|
118 |
+
// Prepend linked Stylesheets to the replacement.
|
119 |
+
if (isset($linkedStylesheets)) {
|
120 |
+
$replacement = "<style type='text/css'>{$linkedStylesheets}</style>{$replacement}";
|
121 |
+
}
|
122 |
}
|
123 |
}
|
124 |
}
|
controllers/metabox.php
ADDED
@@ -0,0 +1,192 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @version post.php $ Id; 03-08-2012 00:51:00 Ahmed Said ;
|
4 |
+
*/
|
5 |
+
|
6 |
+
// Disallow direct access.
|
7 |
+
defined('ABSPATH') or die("Access denied");
|
8 |
+
|
9 |
+
// import dependencies.
|
10 |
+
cssJSToolbox::import('framework:mvc:controller-ajax.inc.php');
|
11 |
+
|
12 |
+
/**
|
13 |
+
* Controll Block metabox actions.
|
14 |
+
*
|
15 |
+
* @version 6.0
|
16 |
+
* @package CJT
|
17 |
+
* @subpackage Controllers
|
18 |
+
* @author Ahmed Said
|
19 |
+
*/
|
20 |
+
class CJTMetaboxController extends CJTAjaxController {
|
21 |
+
|
22 |
+
/**
|
23 |
+
* Initialize post controller.
|
24 |
+
*
|
25 |
+
* @return void
|
26 |
+
*/
|
27 |
+
public function __construct($_unused_hasView = null, $request = null) {
|
28 |
+
// Initialize parent.
|
29 |
+
parent::__construct(false, $request);
|
30 |
+
// Initialize.
|
31 |
+
$postId = $this->getRequestParameter('post');
|
32 |
+
// Instantiate model object.
|
33 |
+
$this->model = self::getModel('metabox', array($postId));
|
34 |
+
// Don't regiter Ajax actions unless AAP (Ajax Access Point) is loaded!
|
35 |
+
$connectedObject =& CJTAccessPoint::isConnected();
|
36 |
+
if ($connectedObject && ($connectedObject->getName() == 'ajax')) {
|
37 |
+
$this->registryAction('create');
|
38 |
+
$this->registryAction('delete');
|
39 |
+
}
|
40 |
+
else if ($this->model->doPost()) {
|
41 |
+
// Add metabox.
|
42 |
+
$this->showMetabox();
|
43 |
+
}
|
44 |
+
}
|
45 |
+
|
46 |
+
/**
|
47 |
+
* Create block metabox for specific post object.
|
48 |
+
*
|
49 |
+
* @param integer Post id.
|
50 |
+
* @return array New block object consist of block id and new block metabox view content.
|
51 |
+
*/
|
52 |
+
public function createAction() {
|
53 |
+
// Get reserved block id from post object.
|
54 |
+
$blockId = $this->model->getMetaboxId();
|
55 |
+
if ($blockId) {
|
56 |
+
// Set request paremeters for blocks-ajax controller::createBlockAction.
|
57 |
+
$_GET['name'] = cssJSToolbox::getText(sprintf(cssJSToolbox::getText('CJT Block - Post #%d'), $this->model->getPost()->ID));
|
58 |
+
$_GET['state'] = 'active';
|
59 |
+
// Create post metabox.
|
60 |
+
$this->model->create($pin)->save();
|
61 |
+
// Create new block.
|
62 |
+
$blocksController = CJTController::create('blocks-ajax');
|
63 |
+
$blocksController->createBlockAction($blockId, 'metabox', $pin->flag);
|
64 |
+
// Get metabox block view object.
|
65 |
+
$this->view = CJTView::create('blocks/metabox');
|
66 |
+
$this->view->setBlock(CJTModel::create('blocks')->getBlock($blockId, array('returnCodeFile' => true)));
|
67 |
+
$this->view->setSecurityToken($this->createSecurityToken());
|
68 |
+
// Send Javascript & CSS files needed for the metabox view to work.
|
69 |
+
$this->response['references'] = self::getReferencesQueue();
|
70 |
+
$this->response['view'] = $this->view->setOption('customizeMetabox', true)->getTemplate('metabox');
|
71 |
+
}
|
72 |
+
}
|
73 |
+
|
74 |
+
/**
|
75 |
+
* put your comment there...
|
76 |
+
*
|
77 |
+
*/
|
78 |
+
public function deleteAction() {
|
79 |
+
// Get input vars.
|
80 |
+
$metaboxBlockId = filter_input(INPUT_GET, 'id', FILTER_SANITIZE_NUMBER_INT);
|
81 |
+
// Delete metabox block.
|
82 |
+
$blocks = CJTModel::create('blocks');
|
83 |
+
$blocks->delete($metaboxBlockId)->save();
|
84 |
+
// Unassociate post -- Mark post as HAS-NO-BLOCK-ASSOCIATED.
|
85 |
+
$this->model->delete();
|
86 |
+
// Load create-metabox view.
|
87 |
+
$this->view = CJTView::create('blocks/create-metabox');
|
88 |
+
// Create DUMMY block object.
|
89 |
+
$block = (object) array();
|
90 |
+
$block->id = $metaboxBlockId;
|
91 |
+
$block->name = cssJSToolbox::getText('CJT Block');
|
92 |
+
// Push vars into the view.
|
93 |
+
$this->view->setBlock($block);
|
94 |
+
$this->view->setSecurityToken($this->createSecurityToken());
|
95 |
+
// Send Javascript & CSS files needed for the metabox view to work.
|
96 |
+
$this->response['references'] = self::getReferencesQueue();
|
97 |
+
// create-metabox view content.
|
98 |
+
$this->response['view'] = $this->view->setOption('customizeMetabox', true)->getTemplate('create');
|
99 |
+
}
|
100 |
+
|
101 |
+
/**
|
102 |
+
* put your comment there...
|
103 |
+
*
|
104 |
+
*/
|
105 |
+
protected static function getReferencesQueue() {
|
106 |
+
$result = array();
|
107 |
+
/**
|
108 |
+
Get all scripts needed to be loaded for block metabox to work.
|
109 |
+
--------------------------------------------------------------
|
110 |
+
* 1. Suppress the output we need the SRC URLs not the HTML tags.
|
111 |
+
* 2. Fire scripts & styles action so the view would enqueue all the files.
|
112 |
+
* 3. Merge script and styles into a single array.
|
113 |
+
* 4. Get only files start with absoult URI (e.g start by HTTP).
|
114 |
+
* files without HTTP may be already loaded (e.g jQuery, etc..)
|
115 |
+
*/
|
116 |
+
ob_start(); do_action('admin_print_scripts'); do_action('admin_print_styles'); ob_end_clean();
|
117 |
+
global $wp_scripts;
|
118 |
+
$references = array_merge($GLOBALS['wp_scripts']->registered, $GLOBALS['wp_styles']->registered);
|
119 |
+
$queue = array_merge($GLOBALS['wp_scripts']->queue, $GLOBALS['wp_styles']->queue);
|
120 |
+
foreach ($references as $script) {
|
121 |
+
// use only items on the queue!
|
122 |
+
if (in_array($script->handle, $queue)) {
|
123 |
+
// Scripts with absoult URL is only for the metabox block
|
124 |
+
// but not for Wordpress default scripts (e.g jquery, thickbox, etc...).
|
125 |
+
if (strpos($script->src, 'http') === 0) {
|
126 |
+
// For JS to work properly Always have cjt object set.
|
127 |
+
if (!isset($script->cjt)) {
|
128 |
+
$script->cjt = (object) array();
|
129 |
+
}
|
130 |
+
// Refine $script object and get only src, cjt and extra->data/localization properties!
|
131 |
+
$script = (object) array_intersect_key(((array) $script), array_flip(array('src', 'cjt' , 'extra')));
|
132 |
+
// Organize references into JS and CSS files lists.
|
133 |
+
if (preg_match('/\.js$/', $script->src)) {
|
134 |
+
$result['scripts'][] = $script;
|
135 |
+
}
|
136 |
+
else {
|
137 |
+
$result['styles'][] = $script;
|
138 |
+
}
|
139 |
+
}
|
140 |
+
}
|
141 |
+
}
|
142 |
+
// Return references.
|
143 |
+
return $result;
|
144 |
+
}
|
145 |
+
|
146 |
+
/**
|
147 |
+
* Select which metabox to load.
|
148 |
+
*
|
149 |
+
* create-metabox view will be loaded if user doesnt
|
150 |
+
* created a block for current post yet.
|
151 |
+
*
|
152 |
+
* metabox view will be loaded if there is a block
|
153 |
+
* already created for current post.
|
154 |
+
*
|
155 |
+
* Callback for add_meta_boxes action.
|
156 |
+
*/
|
157 |
+
public function showMetabox() {
|
158 |
+
// Import blocks view.
|
159 |
+
CJTView::import('blocks/manager');
|
160 |
+
/// Get block id.
|
161 |
+
$metaboxId = $this->model->reservedMetaboxBlockId();
|
162 |
+
// User didn't create block for this post yet.
|
163 |
+
// Show create-metabox view.
|
164 |
+
if (!$this->model->hasBlock()) {
|
165 |
+
// Set view template name.
|
166 |
+
$viewName = 'create-metabox';
|
167 |
+
// Create DUMMY block object.
|
168 |
+
$block = (object) array();
|
169 |
+
$block->id = $metaboxId;
|
170 |
+
$block->name = cssJSToolbox::getText('CJT Block');
|
171 |
+
}
|
172 |
+
/*
|
173 |
+
* Block post is already created.
|
174 |
+
* This condition is only when the page first loaded
|
175 |
+
* and has nothing to do with "create" action!
|
176 |
+
*/
|
177 |
+
else {
|
178 |
+
// Set view template name.
|
179 |
+
$viewName = 'metabox';
|
180 |
+
// Get real block data.
|
181 |
+
$block = CJTModel::create('blocks')->getBlock($metaboxId, array('returnCodeFile' => true));
|
182 |
+
}
|
183 |
+
// Get block meta box view object instance.
|
184 |
+
$this->view = CJTView::create("blocks/{$viewName}");
|
185 |
+
// Push view vars.
|
186 |
+
$this->view->setBlock($block);
|
187 |
+
$this->view->setSecurityToken($this->createSecurityToken());
|
188 |
+
// Add metabox.
|
189 |
+
add_meta_box($this->view->getMetaboxId(), $this->view->getMetaboxName(), array(&$this->view, 'display'), $this->model->getPost()->post_type, 'normal');
|
190 |
+
}
|
191 |
+
|
192 |
+
} // End class.
|
controllers/package-file.php
ADDED
@@ -0,0 +1,66 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @version $ Id; ?FILE_NAME ?DATE ?TIME ?AUTHOR $
|
4 |
+
*/
|
5 |
+
|
6 |
+
// Disallow direct access.
|
7 |
+
defined('ABSPATH') or die("Access denied");
|
8 |
+
|
9 |
+
// import dependencies.
|
10 |
+
cssJSToolbox::import('framework:mvc:controller-ajax.inc.php');
|
11 |
+
|
12 |
+
/**
|
13 |
+
*
|
14 |
+
* DESCRIPTION
|
15 |
+
*
|
16 |
+
* @author ??
|
17 |
+
* @version ??
|
18 |
+
*/
|
19 |
+
class CJTPackageFileController extends CJTAjaxController {
|
20 |
+
|
21 |
+
/**
|
22 |
+
* put your comment there...
|
23 |
+
*
|
24 |
+
* @var mixed
|
25 |
+
*/
|
26 |
+
protected $controllerInfo = array('model' => 'package-file');
|
27 |
+
|
28 |
+
/**
|
29 |
+
*
|
30 |
+
* Initialize new object.
|
31 |
+
*
|
32 |
+
* @return void
|
33 |
+
*/
|
34 |
+
public function __construct() {
|
35 |
+
// Initialize parent!
|
36 |
+
parent::__construct();
|
37 |
+
// Add actions.
|
38 |
+
$this->registryAction('install');
|
39 |
+
}
|
40 |
+
|
41 |
+
/**
|
42 |
+
* put your comment there...
|
43 |
+
*
|
44 |
+
*/
|
45 |
+
protected function installAction() {
|
46 |
+
// Initialize.
|
47 |
+
$model =& $this->model;
|
48 |
+
// Unzip and Parse package file when uploaded.
|
49 |
+
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
|
50 |
+
// Get uploaded file.
|
51 |
+
$file = $_FILES['fileToUpload'];
|
52 |
+
try {
|
53 |
+
// Parse/Unzip+Parse definition the package file.
|
54 |
+
$package = $model->parse($file['name'], $file['tmp_name']);
|
55 |
+
// Install package
|
56 |
+
$packageId = $model->install($package);
|
57 |
+
}
|
58 |
+
catch (Exception $exception) {
|
59 |
+
$this->model->setState('error', array('msg' => $exception->getMessage()));
|
60 |
+
}
|
61 |
+
}
|
62 |
+
// Display uploader!
|
63 |
+
parent::displayAction();
|
64 |
+
}
|
65 |
+
|
66 |
+
} // End class.
|
controllers/package.php
ADDED
@@ -0,0 +1,68 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @version $ Id; ?FILE_NAME ?DATE ?TIME ?AUTHOR $
|
4 |
+
*/
|
5 |
+
|
6 |
+
// Disallow direct access.
|
7 |
+
defined('ABSPATH') or die("Access denied");
|
8 |
+
|
9 |
+
// import dependencies.
|
10 |
+
cssJSToolbox::import('framework:mvc:controller-ajax.inc.php');
|
11 |
+
|
12 |
+
/**
|
13 |
+
*
|
14 |
+
* DESCRIPTION
|
15 |
+
*
|
16 |
+
* @author ??
|
17 |
+
* @version ??
|
18 |
+
*/
|
19 |
+
class CJTPackageController extends CJTAjaxController {
|
20 |
+
|
21 |
+
/**
|
22 |
+
* put your comment there...
|
23 |
+
*
|
24 |
+
* @var mixed
|
25 |
+
*/
|
26 |
+
protected $controllerInfo = array('model' => 'package');
|
27 |
+
|
28 |
+
/**
|
29 |
+
*
|
30 |
+
* Initialize new object.
|
31 |
+
*
|
32 |
+
* @return void
|
33 |
+
*/
|
34 |
+
public function __construct() {
|
35 |
+
// Initialize parent!
|
36 |
+
parent::__construct();
|
37 |
+
// Add actions.
|
38 |
+
$this->registryAction('getReadmeFile');
|
39 |
+
$this->registryAction('getLicenseFile');
|
40 |
+
}
|
41 |
+
|
42 |
+
/**
|
43 |
+
* put your comment there...
|
44 |
+
*
|
45 |
+
*/
|
46 |
+
protected function getReadmeFileAction() {
|
47 |
+
// Get package model.
|
48 |
+
$model =& $this->model;
|
49 |
+
// Set action parameter.
|
50 |
+
$model->setParam('file', 'readme');
|
51 |
+
// Load view.
|
52 |
+
parent::displayAction();
|
53 |
+
}
|
54 |
+
|
55 |
+
/**
|
56 |
+
* put your comment there...
|
57 |
+
*
|
58 |
+
*/
|
59 |
+
protected function getLicenseFileAction() {
|
60 |
+
// Get package model.
|
61 |
+
$model =& $this->model;
|
62 |
+
// Set action parameter.
|
63 |
+
$model->setParam('file', 'license');
|
64 |
+
// Load view.
|
65 |
+
parent::displayAction();
|
66 |
+
}
|
67 |
+
|
68 |
+
} // End class.
|
controllers/packages.php
ADDED
@@ -0,0 +1,65 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @version $ Id; ?FILE_NAME ?DATE ?TIME ?AUTHOR $
|
4 |
+
*/
|
5 |
+
|
6 |
+
// Disallow direct access.
|
7 |
+
defined('ABSPATH') or die("Access denied");
|
8 |
+
|
9 |
+
// import dependencies.
|
10 |
+
cssJSToolbox::import('framework:mvc:controller-ajax.inc.php');
|
11 |
+
|
12 |
+
/**
|
13 |
+
*
|
14 |
+
* DESCRIPTION
|
15 |
+
*
|
16 |
+
* @author ??
|
17 |
+
* @version ??
|
18 |
+
*/
|
19 |
+
class CJTPackagesController extends CJTAjaxController {
|
20 |
+
|
21 |
+
/**
|
22 |
+
* put your comment there...
|
23 |
+
*
|
24 |
+
* @var mixed
|
25 |
+
*/
|
26 |
+
protected $controllerInfo = array('model' => 'packages');
|
27 |
+
|
28 |
+
/**
|
29 |
+
*
|
30 |
+
* Initialize new object.
|
31 |
+
*
|
32 |
+
* @return void
|
33 |
+
*/
|
34 |
+
public function __construct() {
|
35 |
+
// Initialize parent!
|
36 |
+
parent::__construct();
|
37 |
+
// Add actions.
|
38 |
+
$this->registryAction('display');
|
39 |
+
$this->registryAction('delete');
|
40 |
+
}
|
41 |
+
|
42 |
+
/**
|
43 |
+
* put your comment there...
|
44 |
+
*
|
45 |
+
*/
|
46 |
+
protected function deleteAction() {
|
47 |
+
// Initialize.
|
48 |
+
$model = $this->getModel('package');
|
49 |
+
// Read inputs.
|
50 |
+
$ids = $this->getRequestParameter('ids');
|
51 |
+
// Process!
|
52 |
+
if (is_array($ids) && count($ids)) {
|
53 |
+
// Initialize response object.
|
54 |
+
$this->response = array();
|
55 |
+
// Delete all passed Ids!
|
56 |
+
foreach ($ids as $id) {
|
57 |
+
// Delete package.
|
58 |
+
$model->delete($id);
|
59 |
+
// List all the deleted packages!
|
60 |
+
$this->response[] = $id;
|
61 |
+
}
|
62 |
+
}
|
63 |
+
}
|
64 |
+
|
65 |
+
} // End class.
|
controllers/template.php
ADDED
@@ -0,0 +1,102 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @version $ Id; ?FILE_NAME ?DATE ?TIME ?AUTHOR $
|
4 |
+
*/
|
5 |
+
|
6 |
+
// Disallow direct access.
|
7 |
+
defined('ABSPATH') or die("Access denied");
|
8 |
+
|
9 |
+
// import dependencies.
|
10 |
+
cssJSToolbox::import('framework:mvc:controller-ajax.inc.php');
|
11 |
+
|
12 |
+
/**
|
13 |
+
*
|
14 |
+
* DESCRIPTION
|
15 |
+
*
|
16 |
+
* @author ??
|
17 |
+
* @version ??
|
18 |
+
*/
|
19 |
+
class CJTTemplateController extends CJTAjaxController {
|
20 |
+
|
21 |
+
/**
|
22 |
+
* put your comment there...
|
23 |
+
*
|
24 |
+
* @var mixed
|
25 |
+
*/
|
26 |
+
protected $controllerInfo = array('model' => 'template');
|
27 |
+
|
28 |
+
/**
|
29 |
+
* put your comment there...
|
30 |
+
*
|
31 |
+
* @var mixed
|
32 |
+
*/
|
33 |
+
protected $onsave = array('parameters' => array('data'));
|
34 |
+
|
35 |
+
/**
|
36 |
+
*
|
37 |
+
* Initialize new object.
|
38 |
+
*
|
39 |
+
* @return void
|
40 |
+
*/
|
41 |
+
public function __construct() {
|
42 |
+
// Initialize parent!
|
43 |
+
parent::__construct();
|
44 |
+
// Add actions.
|
45 |
+
$this->registryAction('edit');
|
46 |
+
$this->registryAction('save');
|
47 |
+
$this->registryAction('info');
|
48 |
+
$this->registryAction('getTemplateBy');
|
49 |
+
}
|
50 |
+
|
51 |
+
/**
|
52 |
+
* put your comment there...
|
53 |
+
*
|
54 |
+
*/
|
55 |
+
protected function editAction() {
|
56 |
+
$this->model->inputs['id'] = (int) $_REQUEST['id'];
|
57 |
+
// Display the view.
|
58 |
+
parent::displayAction();
|
59 |
+
}
|
60 |
+
|
61 |
+
/**
|
62 |
+
* put your comment there...
|
63 |
+
*
|
64 |
+
*/
|
65 |
+
protected function getTemplateByAction() {
|
66 |
+
// Initialize.
|
67 |
+
$returns = array_flip($_GET['returns']);
|
68 |
+
// Set inputs.
|
69 |
+
$inputs =& $this->model->inputs;
|
70 |
+
$inputs['filter'] = $_GET['filter'];
|
71 |
+
// Query Block.
|
72 |
+
$this->response = array_intersect_key((array) $this->model->getTemplateBy(), $returns);
|
73 |
+
}
|
74 |
+
|
75 |
+
/**
|
76 |
+
* put your comment there...
|
77 |
+
*
|
78 |
+
*/
|
79 |
+
protected function infoAction() {
|
80 |
+
$this->model->inputs['id'] = (int) $_REQUEST['id'];
|
81 |
+
// Display the view.
|
82 |
+
parent::displayAction();
|
83 |
+
}
|
84 |
+
|
85 |
+
/**
|
86 |
+
* put your comment there...
|
87 |
+
*
|
88 |
+
*/
|
89 |
+
protected function saveAction() {
|
90 |
+
// Read inputs
|
91 |
+
$item = filter_input(INPUT_POST, 'item', FILTER_UNSAFE_RAW, FILTER_REQUIRE_ARRAY);
|
92 |
+
// Posted template data is in the item array, the others is just for making the request!
|
93 |
+
$this->model->inputs['item'] = $this->onsave($item);
|
94 |
+
if ($revision = $this->model->save()) {
|
95 |
+
$this->response = array('revision' => $revision);
|
96 |
+
}
|
97 |
+
}
|
98 |
+
|
99 |
+
} // End class.
|
100 |
+
|
101 |
+
// Hookable!
|
102 |
+
CJTTemplateController::define('CJTTemplateController', array('hookType' => CJTWordpressEvents::HOOK_FILTER));
|
controllers/templates-lookup.php
ADDED
@@ -0,0 +1,120 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @version $ Id; ?FILE_NAME ?DATE ?TIME ?AUTHOR $
|
4 |
+
*/
|
5 |
+
|
6 |
+
// Disallow direct access.
|
7 |
+
defined('ABSPATH') or die("Access denied");
|
8 |
+
|
9 |
+
// import dependencies.
|
10 |
+
cssJSToolbox::import('framework:mvc:controller-ajax.inc.php');
|
11 |
+
|
12 |
+
/**
|
13 |
+
*
|
14 |
+
* DESCRIPTION
|
15 |
+
*
|
16 |
+
* @author ??
|
17 |
+
* @version ??
|
18 |
+
*/
|
19 |
+
class CJTTemplatesLookupController extends CJTAjaxController {
|
20 |
+
|
21 |
+
/**
|
22 |
+
* put your comment there...
|
23 |
+
*
|
24 |
+
* @var mixed
|
25 |
+
*/
|
26 |
+
protected $controllerInfo = array('model' => 'templates-lookup', 'view' => 'templates/lookup');
|
27 |
+
|
28 |
+
/**
|
29 |
+
*
|
30 |
+
* Initialize new object.
|
31 |
+
*
|
32 |
+
* @return void
|
33 |
+
*/
|
34 |
+
public function __construct() {
|
35 |
+
parent::__construct();
|
36 |
+
// Registry controller actions.
|
37 |
+
$this->registryAction('display');
|
38 |
+
$this->registryAction('embedded');
|
39 |
+
$this->registryAction('link');
|
40 |
+
$this->registryAction('unlink');
|
41 |
+
$this->registryAction('unlinkAll');
|
42 |
+
}
|
43 |
+
|
44 |
+
/**
|
45 |
+
* put your comment there...
|
46 |
+
*
|
47 |
+
* @param mixed $tpl
|
48 |
+
*/
|
49 |
+
protected function displayAction($tpl = null) {
|
50 |
+
// Prepare inputs
|
51 |
+
$this->model->inputs['blockId'] = $_REQUEST['blockId'];
|
52 |
+
// Display view!
|
53 |
+
parent::displayAction();
|
54 |
+
}
|
55 |
+
|
56 |
+
/**
|
57 |
+
* put your comment there...
|
58 |
+
*
|
59 |
+
*/
|
60 |
+
protected function embeddedAction() {
|
61 |
+
// Read inputs.
|
62 |
+
$this->model->inputs['templateId'] = $_REQUEST['templateId'];
|
63 |
+
$this->model->inputs['blockId'] = $_REQUEST['blockId'];
|
64 |
+
// Get embedded template code!
|
65 |
+
$this->response['code'] = $this->model->embedded();
|
66 |
+
}
|
67 |
+
|
68 |
+
/**
|
69 |
+
* put your comment there...
|
70 |
+
*
|
71 |
+
*/
|
72 |
+
protected function linkAction() {
|
73 |
+
// Read inputs.
|
74 |
+
$this->model->inputs['templateId'] = $_REQUEST['templateId'];
|
75 |
+
$this->model->inputs['blockId'] = $_REQUEST['blockId'];
|
76 |
+
// Link template!
|
77 |
+
$this->model->link();
|
78 |
+
// Response with new state!
|
79 |
+
$this->response['newState'] = array(
|
80 |
+
'action' => 'unlink',
|
81 |
+
'text' => cssJSToolbox::getText('Unlink'),
|
82 |
+
'className' => 'template-action unlink-template'
|
83 |
+
);
|
84 |
+
}
|
85 |
+
|
86 |
+
/**
|
87 |
+
* put your comment there...
|
88 |
+
*
|
89 |
+
*/
|
90 |
+
protected function unlinkAction() {
|
91 |
+
// Read inputs.
|
92 |
+
$this->model->inputs['templateId'] = $_REQUEST['templateId'];
|
93 |
+
$this->model->inputs['blockId'] = $_REQUEST['blockId'];
|
94 |
+
// Link template!
|
95 |
+
$this->model->unlink();
|
96 |
+
// Response with new state!
|
97 |
+
$this->response['newState'] = array(
|
98 |
+
'action' => 'link',
|
99 |
+
'text' => cssJSToolbox::getText('Link'),
|
100 |
+
'className' => 'template-action link-template'
|
101 |
+
);
|
102 |
+
}
|
103 |
+
|
104 |
+
/**
|
105 |
+
* put your comment there...
|
106 |
+
*
|
107 |
+
*/
|
108 |
+
protected function unlinkAllAction() {
|
109 |
+
// Read inputs!
|
110 |
+
$this->model->inputs['blockId'] = $_REQUEST['blockId'];
|
111 |
+
$this->model->unlinkAll();
|
112 |
+
// Response with new state!
|
113 |
+
$this->response['newState'] = array(
|
114 |
+
'action' => 'link',
|
115 |
+
'text' => cssJSToolbox::getText('Link'),
|
116 |
+
'className' => 'template-action link-template'
|
117 |
+
);
|
118 |
+
}
|
119 |
+
|
120 |
+
} // End class.
|
controllers/templates-manager.php
ADDED
@@ -0,0 +1,168 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @version $ Id; ?FILE_NAME ?DATE ?TIME ?AUTHOR $
|
4 |
+
*/
|
5 |
+
|
6 |
+
// Disallow direct access.
|
7 |
+
defined('ABSPATH') or die("Access denied");
|
8 |
+
|
9 |
+
// import dependencies.
|
10 |
+
cssJSToolbox::import('framework:mvc:controller-ajax.inc.php');
|
11 |
+
|
12 |
+
/**
|
13 |
+
*
|
14 |
+
* DESCRIPTION
|
15 |
+
*
|
16 |
+
* @author ??
|
17 |
+
* @version ??
|
18 |
+
*/
|
19 |
+
class CJTTemplatesManagerController extends CJTAjaxController {
|
20 |
+
|
21 |
+
/**
|
22 |
+
*
|
23 |
+
*/
|
24 |
+
const SESSIONED_FILTERS = 'cjt_templates__manager';
|
25 |
+
|
26 |
+
/**
|
27 |
+
* put your comment there...
|
28 |
+
*
|
29 |
+
* @var mixed
|
30 |
+
*/
|
31 |
+
protected $controllerInfo = array('model' => 'templates-manager', 'view' => 'templates/manager');
|
32 |
+
|
33 |
+
/**
|
34 |
+
*
|
35 |
+
* Initialize new object.
|
36 |
+
*
|
37 |
+
* @return void
|
38 |
+
*/
|
39 |
+
public function __construct() {
|
40 |
+
// Initialize parent!
|
41 |
+
parent::__construct();
|
42 |
+
// Add actions.
|
43 |
+
$this->registryAction('display');
|
44 |
+
$this->registryAction('delete');
|
45 |
+
$this->registryAction('changeState');
|
46 |
+
$this->registryAction('linkExternal');
|
47 |
+
}
|
48 |
+
|
49 |
+
/**
|
50 |
+
* put your comment there...
|
51 |
+
*
|
52 |
+
*/
|
53 |
+
protected function displayAction() {
|
54 |
+
// Set default filters.
|
55 |
+
if (!isset($_REQUEST['filter_states'])) {
|
56 |
+
$_REQUEST['filter_states'] = 'published';
|
57 |
+
}
|
58 |
+
// Save all filters!
|
59 |
+
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
|
60 |
+
$filters = array_intersect_key($_REQUEST, array_flip(explode(',', $_REQUEST['allFiltersName'])));
|
61 |
+
update_user_option(get_current_user_id(), self::SESSIONED_FILTERS, $filters);
|
62 |
+
}
|
63 |
+
else {
|
64 |
+
// Load sessioned filter from database options table!
|
65 |
+
$filters = (array) get_user_option(self::SESSIONED_FILTERS, get_current_user_id());
|
66 |
+
$_REQUEST = array_merge($_REQUEST, $filters);
|
67 |
+
}
|
68 |
+
// Push inputs into the model!
|
69 |
+
$this->model->inputs = $_REQUEST;
|
70 |
+
// Display view.
|
71 |
+
parent::displayAction();
|
72 |
+
}
|
73 |
+
|
74 |
+
/**
|
75 |
+
* put your comment there...
|
76 |
+
*
|
77 |
+
*/
|
78 |
+
protected function deleteAction() {
|
79 |
+
$this->model->inputs['ids'] = $_GET['ids'];
|
80 |
+
// Response with changed ids.
|
81 |
+
$this->response['changes'] = $this->model->delete();
|
82 |
+
}
|
83 |
+
|
84 |
+
/**
|
85 |
+
* put your comment there...
|
86 |
+
*
|
87 |
+
*/
|
88 |
+
protected function changeStateAction() {
|
89 |
+
$this->model->inputs['ids'] = $_GET['ids'];
|
90 |
+
$this->model->inputs['state'] = $_GET['params'];
|
91 |
+
$this->model->changeState();
|
92 |
+
// Response with changed ids.
|
93 |
+
$this->response['changes'] = $this->model->inputs['ids'];
|
94 |
+
}
|
95 |
+
|
96 |
+
/**
|
97 |
+
* Link external Resources (CSS, HTML, JS and PHP)
|
98 |
+
*
|
99 |
+
* The action is to create external link as CJT template
|
100 |
+
* and link it to the target block.
|
101 |
+
*/
|
102 |
+
protected function linkExternalAction() {
|
103 |
+
// Import dependencies.
|
104 |
+
cssJSToolbox::import('includes:templates:templates.class.php');
|
105 |
+
// Initialize response as successed until error occured!
|
106 |
+
$this->response = array('code' => 0, 'message' => '');
|
107 |
+
// List of all the external templates records to create!
|
108 |
+
$externalTemplates = array();
|
109 |
+
// Read inputs.
|
110 |
+
$externals = explode(',', $_REQUEST['externals']);
|
111 |
+
$blockId = (int) $_REQUEST['blockId'];
|
112 |
+
// Add as templates.
|
113 |
+
foreach ($externals as $externalResourceURI) {
|
114 |
+
// Use URI base name as Template Name and the extension as Template Type.
|
115 |
+
$externalPathInfo = pathinfo($externalResourceURI);
|
116 |
+
// Template Item.
|
117 |
+
$item = array();
|
118 |
+
$item['template']['name'] = $externalPathInfo['basename'];
|
119 |
+
$item['template']['type'] = CJTTemplates::getExtensionType($externalPathInfo['extension']);
|
120 |
+
$item['template']['state'] = 'published';
|
121 |
+
// Get external URI code!
|
122 |
+
$externalResponse = wp_remote_get($externalResourceURI);
|
123 |
+
if ($error = $externalResponse instanceof WP_Error) {
|
124 |
+
// State an error!
|
125 |
+
$this->response['code'] = $externalResponse->get_error_code();
|
126 |
+
$this->response['message'] = $externalResponse->get_error_message($this->response['code']);
|
127 |
+
break;
|
128 |
+
}
|
129 |
+
else {
|
130 |
+
// Read code content.
|
131 |
+
$item['revision']['code'] = wp_remote_retrieve_body($externalResponse);
|
132 |
+
// Add to the save list!
|
133 |
+
$externalTemplates[] = $item;
|
134 |
+
}
|
135 |
+
}
|
136 |
+
// Save all templates if no error occured
|
137 |
+
// Single error will halt all the linked externals! They all added as a single transaction.
|
138 |
+
if (!$this->response['code']) {
|
139 |
+
// Instantiate Template Models.
|
140 |
+
$modelLookup = CJTModel::getInstance('templates-lookup');
|
141 |
+
$modelTemplate = CJTModel::getInstance('template');
|
142 |
+
$modelBlockTemplates = CJTModel::getInstance('block-templates');
|
143 |
+
// Add all templates.
|
144 |
+
foreach ($externalTemplates as $item) {
|
145 |
+
// Check existance.
|
146 |
+
$modelTemplate->inputs['filter']['field'] = 'name';
|
147 |
+
$modelTemplate->inputs['filter']['value'] = $item['template']['name'];
|
148 |
+
if (!($existsItem = $modelTemplate->getTemplateBy()) || !property_exists($existsItem, 'id') || !$existsItem->id) {
|
149 |
+
// Create template.
|
150 |
+
$modelTemplate->inputs['item'] = $item;
|
151 |
+
$item = (array) $modelTemplate->save();
|
152 |
+
}
|
153 |
+
else {
|
154 |
+
// The returned item has 'id' field not 'templateId'!!
|
155 |
+
$item = array('templateId' => $existsItem->id);
|
156 |
+
}
|
157 |
+
// Link only if not already linked!
|
158 |
+
if (!$modelBlockTemplates->isLinked($blockId, $item['templateId'])) {
|
159 |
+
// Link template to the block.
|
160 |
+
$modelLookup->inputs['templateId'] = $item['templateId'];
|
161 |
+
$modelLookup->inputs['blockId'] = $blockId;
|
162 |
+
$modelLookup->link();
|
163 |
+
}
|
164 |
+
}
|
165 |
+
}
|
166 |
+
}
|
167 |
+
|
168 |
+
} // End class.
|
controllers/tinymce-blocks.php
CHANGED
@@ -30,6 +30,8 @@ class CJTTinymceBlocksController extends CJTAjaxController {
|
|
30 |
parent::__construct($hasView, $request);
|
31 |
// Register actions!
|
32 |
$this->registryAction('getBlocksList');
|
|
|
|
|
33 |
// @TODO: $this->defaultCapability is risky if there is any admin actions added later, please remove!
|
34 |
$this->defaultCapability = array('edit_posts', 'edit_pages');
|
35 |
}
|
@@ -38,7 +40,43 @@ class CJTTinymceBlocksController extends CJTAjaxController {
|
|
38 |
* put your comment there...
|
39 |
*
|
40 |
*/
|
41 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
42 |
// Read all blocks!
|
43 |
$blocks = $this->model->getItems();
|
44 |
// retreive owener name!
|
@@ -50,4 +88,57 @@ class CJTTinymceBlocksController extends CJTAjaxController {
|
|
50 |
$this->response['count'] = count($this->response['list']);
|
51 |
}
|
52 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
53 |
} // End class.
|
30 |
parent::__construct($hasView, $request);
|
31 |
// Register actions!
|
32 |
$this->registryAction('getBlocksList');
|
33 |
+
$this->registryAction('getShortcode');
|
34 |
+
$this->registryAction('getBlockParametersForm');
|
35 |
// @TODO: $this->defaultCapability is risky if there is any admin actions added later, please remove!
|
36 |
$this->defaultCapability = array('edit_posts', 'edit_pages');
|
37 |
}
|
40 |
* put your comment there...
|
41 |
*
|
42 |
*/
|
43 |
+
protected function getBlockParametersFormAction() {
|
44 |
+
// Get block id.
|
45 |
+
$blockId = (int) $_REQUEST['blockId'];
|
46 |
+
// Get block form!
|
47 |
+
$form = CJTxTable::getInstance('form')
|
48 |
+
->setTableKey(array('blockId'))
|
49 |
+
->setData(array('blockId' => $blockId))
|
50 |
+
->load();
|
51 |
+
// Set HTTP header
|
52 |
+
$this->httpContentType = 'text/html';
|
53 |
+
// Display form view.
|
54 |
+
if ($form->get('blockId')) {
|
55 |
+
// Load parameters form.
|
56 |
+
$groups = new CJT_Models_Block_Parameters_Form_Groups($blockId);
|
57 |
+
$params = new CJT_Models_Block_Parameters_Form_Parameters($blockId);
|
58 |
+
$blockParams = new CJT_Framework_View_Block_Parameter_Parameters($params);
|
59 |
+
// Return view content!
|
60 |
+
$paramsView = CJTView::getInstance('tinymce/params', array(
|
61 |
+
'groups' => $groups,
|
62 |
+
'params' => $blockParams->getParams(),
|
63 |
+
'form' => $form->getData(),
|
64 |
+
'blockId' => $blockId
|
65 |
+
)
|
66 |
+
);
|
67 |
+
// Return paramters form content!
|
68 |
+
$this->response = $paramsView->getTemplate('default');
|
69 |
+
}
|
70 |
+
else { // Error loading form!
|
71 |
+
$this->response = cssJSToolbox::getText('The requested Block doesnt has parameters form!');
|
72 |
+
}
|
73 |
+
}
|
74 |
+
|
75 |
+
/**
|
76 |
+
* put your comment there...
|
77 |
+
*
|
78 |
+
*/
|
79 |
+
protected function getBlocksListAction() {
|
80 |
// Read all blocks!
|
81 |
$blocks = $this->model->getItems();
|
82 |
// retreive owener name!
|
88 |
$this->response['count'] = count($this->response['list']);
|
89 |
}
|
90 |
|
91 |
+
/**
|
92 |
+
* put your comment there...
|
93 |
+
*
|
94 |
+
*/
|
95 |
+
protected function getShortcodeAction() {
|
96 |
+
// Get block id.
|
97 |
+
$blockId = $_REQUEST['blockId'];
|
98 |
+
// Load block
|
99 |
+
$block = CJTxTable::getInstance('block')
|
100 |
+
->setTableKey(array('id'))
|
101 |
+
->setData(array('id' => $blockId))
|
102 |
+
->load()
|
103 |
+
->getData();
|
104 |
+
$blockForm = (array) CJTxTable::getInstance('form')
|
105 |
+
->setTableKey(array('blockId'))
|
106 |
+
->setData(array('blockId' => $blockId))
|
107 |
+
->load()
|
108 |
+
->getData();
|
109 |
+
// Load block parameters.
|
110 |
+
$parameters = new CJT_Models_Block_Parameters_Parameters($blockId);
|
111 |
+
$blockParams = new CJT_Framework_Developer_Interface_Block_Shortcode_Parameters_Parameters($parameters);
|
112 |
+
// The the block has FORM associated
|
113 |
+
if (isset($blockForm['blockId'])) {
|
114 |
+
// If the data is submitted then load the parameters object with the post data!
|
115 |
+
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
|
116 |
+
// Get RAW data from the data submitted (avoid magic_quotes, Why called MAGIC!!!!)!
|
117 |
+
$rawPostData = filter_input(INPUT_POST, 'form-data', FILTER_UNSAFE_RAW, FILTER_REQUIRE_ARRAY);
|
118 |
+
// Fill the form by the posted data
|
119 |
+
$blockParams->setValue($rawPostData);
|
120 |
+
// Validate the submitted data against their parameters.
|
121 |
+
if ($blockParams->validate()) {
|
122 |
+
// Generate and Return Shortcode string!
|
123 |
+
$this->response['state'] = 'shortcode-notation';
|
124 |
+
$this->response['content'] = $blockParams->shortcode($block->name);
|
125 |
+
}
|
126 |
+
else {
|
127 |
+
$this->response['state'] = 'invalid';
|
128 |
+
$this->response['content'] = $blockParams->getMessages();
|
129 |
+
}
|
130 |
+
}
|
131 |
+
// Redirect to the parameters form view!
|
132 |
+
else {
|
133 |
+
$this->response['state'] = 'show-form';
|
134 |
+
}
|
135 |
+
}
|
136 |
+
else {
|
137 |
+
// If block doesn't has a parameters defined return
|
138 |
+
// the Shortcode code string from the parameters loader.
|
139 |
+
$this->response['state'] = 'shortcode-notation';
|
140 |
+
$this->response['content'] = $blockParams->shortcode($block->name);
|
141 |
+
}
|
142 |
+
}
|
143 |
+
|
144 |
} // End class.
|
css-js-toolbox.php
CHANGED
@@ -3,9 +3,9 @@
|
|
3 |
Plugin Name: CSS & JavaScript Toolbox
|
4 |
Plugin URI: http://css-javascript-toolbox.com/css-javascript-toolbox-free
|
5 |
Description: CJT Plugin for WordPress to easily add custom CSS and JavaScript to individual pages
|
6 |
-
Version:
|
7 |
Author: Wipeout Media
|
8 |
-
Author URI: http://css-javascript-toolbox.com
|
9 |
License:
|
10 |
|
11 |
Copyright (c) 2011, Wipeout Media.
|
@@ -90,8 +90,8 @@ class CJTPlugin extends CJTHookableClass {
|
|
90 |
/**
|
91 |
*
|
92 |
*/
|
93 |
-
const DB_VERSION = '1.
|
94 |
-
|
95 |
/**
|
96 |
*
|
97 |
*/
|
@@ -101,11 +101,11 @@ class CJTPlugin extends CJTHookableClass {
|
|
101 |
*
|
102 |
*/
|
103 |
const FW_Version = '2.0';
|
104 |
-
|
105 |
/**
|
106 |
*
|
107 |
*/
|
108 |
-
const VERSION = '
|
109 |
|
110 |
/**
|
111 |
*
|
3 |
Plugin Name: CSS & JavaScript Toolbox
|
4 |
Plugin URI: http://css-javascript-toolbox.com/css-javascript-toolbox-free
|
5 |
Description: CJT Plugin for WordPress to easily add custom CSS and JavaScript to individual pages
|
6 |
+
Version: 7.1
|
7 |
Author: Wipeout Media
|
8 |
+
Author URI: http://css-javascript-toolbox.com
|
9 |
License:
|
10 |
|
11 |
Copyright (c) 2011, Wipeout Media.
|
90 |
/**
|
91 |
*
|
92 |
*/
|
93 |
+
const DB_VERSION = '1.6';
|
94 |
+
|
95 |
/**
|
96 |
*
|
97 |
*/
|
101 |
*
|
102 |
*/
|
103 |
const FW_Version = '2.0';
|
104 |
+
|
105 |
/**
|
106 |
*
|
107 |
*/
|
108 |
+
const VERSION = '7.1-CE' ;
|
109 |
|
110 |
/**
|
111 |
*
|
docs/CJTV6CEUserManual.pdf
DELETED
Binary file
|
docs/CJT_V6_User_Manual.pdf
ADDED
Binary file
|
framework/css/toolbox.css
CHANGED
@@ -1,13 +1,17 @@
|
|
1 |
/* Toolboxes */
|
2 |
-
.cjt-toolbox .divider
|
3 |
-
|
4 |
-
background-repeat: no-repeat;
|
5 |
-
background-position: center;
|
6 |
margin: 0 20px;
|
7 |
width: 2px;
|
8 |
display: inline-block;
|
9 |
height: 25px;
|
10 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
11 |
.cjt-toolbox .icons-group {
|
12 |
display: inline-block;
|
13 |
}
|
@@ -32,7 +36,7 @@
|
|
32 |
z-index: 2;
|
33 |
background-color: white;
|
34 |
padding: 10px 10px;
|
35 |
-
border:
|
36 |
border-top-right-radius: 3px;
|
37 |
border-top-left-radius: 3px;
|
38 |
border-bottom-right-radius: 3px;
|
1 |
/* Toolboxes */
|
2 |
+
.cjt-toolbox .divider,
|
3 |
+
.cjt-toolbox .empty-divider {
|
|
|
|
|
4 |
margin: 0 20px;
|
5 |
width: 2px;
|
6 |
display: inline-block;
|
7 |
height: 25px;
|
8 |
}
|
9 |
+
|
10 |
+
.cjt-toolbox .divider {
|
11 |
+
background-image: url('images/divider.png');
|
12 |
+
background-repeat: no-repeat;
|
13 |
+
background-position: center;
|
14 |
+
}
|
15 |
.cjt-toolbox .icons-group {
|
16 |
display: inline-block;
|
17 |
}
|
36 |
z-index: 2;
|
37 |
background-color: white;
|
38 |
padding: 10px 10px;
|
39 |
+
border: 1px solid #bbb;
|
40 |
border-top-right-radius: 3px;
|
41 |
border-top-left-radius: 3px;
|
42 |
border-bottom-right-radius: 3px;
|
framework/db/mysql/driver/exception/invalidkey.php
ADDED
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
*
|
4 |
+
*/
|
5 |
+
|
6 |
+
/**
|
7 |
+
*
|
8 |
+
*/
|
9 |
+
class CJT_Framework_DB_Mysql_Driver_Exception_Invalidkey extends Exception {}
|
framework/db/mysql/queue-driver.inc.php
CHANGED
@@ -130,7 +130,7 @@ class CJTMYSQLQueueDriver extends CJTHookableClass {
|
|
130 |
public function escapeValue($data, $field) {
|
131 |
switch ($field->numeric) {
|
132 |
case 0:
|
133 |
-
$data =
|
134 |
$data = "'{$data}'";
|
135 |
break;
|
136 |
case 1:
|
130 |
public function escapeValue($data, $field) {
|
131 |
switch ($field->numeric) {
|
132 |
case 0:
|
133 |
+
$data = esc_sql($data);
|
134 |
$data = "'{$data}'";
|
135 |
break;
|
136 |
case 1:
|
framework/db/mysql/xtable.inc.php
CHANGED
@@ -167,6 +167,17 @@ abstract class CJTxTable extends CJTHookableClass {
|
|
167 |
return $this;
|
168 |
}
|
169 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
170 |
/**
|
171 |
* put your comment there...
|
172 |
*
|
@@ -210,6 +221,38 @@ abstract class CJTxTable extends CJTHookableClass {
|
|
210 |
return $table;
|
211 |
}
|
212 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
213 |
/**
|
214 |
* put your comment there...
|
215 |
*
|
@@ -262,36 +305,25 @@ abstract class CJTxTable extends CJTHookableClass {
|
|
262 |
return $isValid;
|
263 |
}
|
264 |
|
|
|
|
|
265 |
/**
|
266 |
* Load record into table!
|
267 |
*
|
268 |
* @param mixed
|
269 |
*/
|
270 |
public function load($query = null) {
|
271 |
-
|
272 |
-
|
273 |
-
|
274 |
-
|
275 |
-
$tableKey = $query;
|
276 |
-
$query = null;
|
277 |
-
}
|
278 |
-
if (!$query) {
|
279 |
-
$item = (array) $this->item;
|
280 |
-
$query['select'] = 'SELECT *';
|
281 |
-
$query['from'] = "FROM {$this->table()}";
|
282 |
-
// Load only if key is not NULL!
|
283 |
-
if ($key = $this->isValidKey($tableKey)) {
|
284 |
-
$query['where'] = 'WHERE ' . implode(' AND ', $this->prepareQueryParameters($key));
|
285 |
-
if ($query = $this->onconcatquery($query)) {
|
286 |
-
// Read DB record!
|
287 |
-
$query = "{$query['select']} {$query['from']} {$query['where']}";
|
288 |
-
$this->setItem($this->dbDriver->getRow($this->onloadquery($query)));
|
289 |
-
}
|
290 |
-
}
|
291 |
-
}
|
292 |
-
else {
|
293 |
$this->setItem($this->dbDriver->getRow($this->onloadquery($query)));
|
294 |
}
|
|
|
|
|
|
|
|
|
|
|
295 |
return $this;
|
296 |
}
|
297 |
|
@@ -324,18 +356,17 @@ abstract class CJTxTable extends CJTHookableClass {
|
|
324 |
}
|
325 |
|
326 |
/**
|
327 |
-
* UPDATE/INSERT
|
328 |
-
*
|
329 |
* THIS METHOD STILL DOESNT SUPPORT COMPOUND KEYS!!
|
330 |
*
|
331 |
* @param mixed $forceInsert
|
|
|
332 |
* @return CJTxTable
|
333 |
*/
|
334 |
-
public function save($forceInsert = false) {
|
335 |
$keyFieldName = $this->key[0];
|
336 |
$item = (array) $this->item;
|
337 |
-
// Don't update id field.
|
338 |
-
$fieldsList = array_diff_key($item, array_flip($this->key));
|
339 |
$fieldsList = implode(',', $this->prepareQueryParameters($fieldsList));
|
340 |
if (!$forceInsert && $this->get($keyFieldName)) { // Update
|
341 |
// Where clause.
|
167 |
return $this;
|
168 |
}
|
169 |
|
170 |
+
/**
|
171 |
+
* put your comment there...
|
172 |
+
*
|
173 |
+
*/
|
174 |
+
public function fetchAll() {
|
175 |
+
// Get query.
|
176 |
+
$query = $this->getLoadQuery();
|
177 |
+
// Return all result.
|
178 |
+
return $this->dbDriver->select($query, ARRAY_A);
|
179 |
+
}
|
180 |
+
|
181 |
/**
|
182 |
* put your comment there...
|
183 |
*
|
221 |
return $table;
|
222 |
}
|
223 |
|
224 |
+
/**
|
225 |
+
* put your comment there...
|
226 |
+
*
|
227 |
+
* @param mixed $query
|
228 |
+
*/
|
229 |
+
protected function getLoadQuery($query = null) {
|
230 |
+
$tableKey = null;
|
231 |
+
$key = null;
|
232 |
+
// Query might be an array of keys!
|
233 |
+
if (is_array($query)) {
|
234 |
+
$tableKey = $query;
|
235 |
+
$query = null;
|
236 |
+
}
|
237 |
+
if (!$query) {
|
238 |
+
$item = (array) $this->item;
|
239 |
+
$query['select'] = 'SELECT *';
|
240 |
+
$query['from'] = "FROM {$this->table()}";
|
241 |
+
// Load only if key is not NULL!
|
242 |
+
if ($key = $this->isValidKey($tableKey)) {
|
243 |
+
$query['where'] = 'WHERE ' . implode(' AND ', $this->prepareQueryParameters($key));
|
244 |
+
if ($query = $this->onconcatquery($query)) {
|
245 |
+
// Read DB record!
|
246 |
+
$query = "{$query['select']} {$query['from']} {$query['where']}";
|
247 |
+
}
|
248 |
+
}
|
249 |
+
else {
|
250 |
+
throw new CJT_Framework_DB_Mysql_Driver_Exception_Invalidkey($key);
|
251 |
+
}
|
252 |
+
}
|
253 |
+
return $query;
|
254 |
+
}
|
255 |
+
|
256 |
/**
|
257 |
* put your comment there...
|
258 |
*
|
305 |
return $isValid;
|
306 |
}
|
307 |
|
308 |
+
|
309 |
+
|
310 |
/**
|
311 |
* Load record into table!
|
312 |
*
|
313 |
* @param mixed
|
314 |
*/
|
315 |
public function load($query = null) {
|
316 |
+
try {
|
317 |
+
// Get query to load!
|
318 |
+
$query = $this->getLoadQuery($query);
|
319 |
+
// Set the returned item.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
320 |
$this->setItem($this->dbDriver->getRow($this->onloadquery($query)));
|
321 |
}
|
322 |
+
catch (CJT_Framework_DB_Mysql_Driver_Exception_Invalidkey $exception) {
|
323 |
+
// Backword compatibility to don't show any error.
|
324 |
+
// This is how the old code procedure was!
|
325 |
+
}
|
326 |
+
// Chaining.
|
327 |
return $this;
|
328 |
}
|
329 |
|
356 |
}
|
357 |
|
358 |
/**
|
|
|
|
|
359 |
* THIS METHOD STILL DOESNT SUPPORT COMPOUND KEYS!!
|
360 |
*
|
361 |
* @param mixed $forceInsert
|
362 |
+
* @param mixed $updateIdField
|
363 |
* @return CJTxTable
|
364 |
*/
|
365 |
+
public function save($forceInsert = false, $updateIdField = false) {
|
366 |
$keyFieldName = $this->key[0];
|
367 |
$item = (array) $this->item;
|
368 |
+
// Don't update id field unless $updateIdField is set to TRUE.
|
369 |
+
$fieldsList = !$updateIdField ? array_diff_key($item, array_flip($this->key)) : $item;
|
370 |
$fieldsList = implode(',', $this->prepareQueryParameters($fieldsList));
|
371 |
if (!$forceInsert && $this->get($keyFieldName)) { // Update
|
372 |
// Where clause.
|
framework/developer/developer.php
ADDED
@@ -0,0 +1,44 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
*
|
4 |
+
*/
|
5 |
+
|
6 |
+
// Disallow direct access.
|
7 |
+
defined('ABSPATH') or die("Access denied");
|
8 |
+
|
9 |
+
/**
|
10 |
+
*
|
11 |
+
*/
|
12 |
+
class CJT_Framework_Developer_Developer {
|
13 |
+
|
14 |
+
/**
|
15 |
+
* put your comment there...
|
16 |
+
*
|
17 |
+
* @var mixed
|
18 |
+
*/
|
19 |
+
protected $source;
|
20 |
+
|
21 |
+
/**
|
22 |
+
* put your comment there...
|
23 |
+
*
|
24 |
+
* @param mixed $source
|
25 |
+
*/
|
26 |
+
public function __construct($source) {
|
27 |
+
$this->source = $source;
|
28 |
+
}
|
29 |
+
|
30 |
+
/**
|
31 |
+
* put your comment there...
|
32 |
+
*
|
33 |
+
*/
|
34 |
+
public function template() {
|
35 |
+
static $template = null;
|
36 |
+
// Instantiate Template library only when used.
|
37 |
+
if (!$template) {
|
38 |
+
cssJSToolbox::import('framework:developer:lib:template:template.php');
|
39 |
+
$template = new CJT_Framework_Developer_Lib_Template($this->source);
|
40 |
+
}
|
41 |
+
return $template;
|
42 |
+
}
|
43 |
+
|
44 |
+
} // End class.
|
framework/developer/interface/block/parameters/parameters.php
CHANGED
@@ -9,135 +9,97 @@ defined('ABSPATH') or die("Access denied");
|
|
9 |
/**
|
10 |
*
|
11 |
*/
|
12 |
-
class
|
13 |
|
14 |
/**
|
15 |
* put your comment there...
|
16 |
*
|
17 |
* @var mixed
|
18 |
*/
|
19 |
-
protected $
|
20 |
|
21 |
/**
|
22 |
* put your comment there...
|
23 |
*
|
24 |
* @var mixed
|
25 |
*/
|
26 |
-
protected $
|
27 |
|
28 |
/**
|
29 |
* put your comment there...
|
30 |
*
|
31 |
-
* @param mixed $
|
32 |
-
* @
|
|
|
33 |
*/
|
34 |
-
public function __construct($
|
35 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
36 |
}
|
37 |
-
|
38 |
/**
|
39 |
* put your comment there...
|
40 |
*
|
41 |
-
* @param mixed $name
|
42 |
-
* @param mixed $type
|
43 |
-
* @param mixed $default
|
44 |
*/
|
45 |
-
public function
|
46 |
-
|
47 |
-
// Use lower case for ket as Wordpress shortcode parameters
|
48 |
-
// is always transformed to lowercase.
|
49 |
-
$this->params[strtolower($name)] = array('name' => $name, 'type' => $type, 'default' => $default);
|
50 |
-
// Chaining.
|
51 |
-
return $this;
|
52 |
}
|
53 |
|
54 |
/**
|
55 |
* put your comment there...
|
56 |
*
|
57 |
-
* @param mixed $name
|
58 |
*/
|
59 |
-
|
60 |
-
// Allow writing it in the original case inside the code
|
61 |
-
// however its only retrived by the lowercvase letter.
|
62 |
-
return $this->uParams[strtolower($name)];
|
63 |
-
}
|
64 |
|
65 |
/**
|
66 |
* put your comment there...
|
67 |
*
|
68 |
*/
|
69 |
-
public function
|
70 |
-
return $this->
|
71 |
}
|
72 |
-
|
73 |
/**
|
74 |
* put your comment there...
|
75 |
*
|
76 |
*/
|
77 |
-
public function
|
78 |
-
|
79 |
}
|
80 |
|
81 |
/**
|
82 |
* put your comment there...
|
83 |
*
|
84 |
-
* @param mixed $excludes
|
85 |
-
* @return CJT_Framework_Developer_Interface_Block_Parameters_Transform_Json
|
86 |
*/
|
87 |
-
public function
|
88 |
-
|
89 |
-
cssJSToolbox::import('framework:developer:interface:block:parameters:transform:json:json.php');
|
90 |
-
return new CJT_Framework_Developer_Interface_Block_Parameters_Transform_Json($this, $excludes);
|
91 |
}
|
92 |
|
93 |
/**
|
94 |
* put your comment there...
|
95 |
*
|
|
|
96 |
*/
|
97 |
-
public function
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
foreach ($this->uParams as $name => & $value) {
|
102 |
-
// Check parameter existance.
|
103 |
-
if (!isset($this->params[$name])) {
|
104 |
-
// Warn user that the parameter is not exists!
|
105 |
-
echo cssJSToolbox::getText("Invalid Block Shortcode parameters [{$name}]");
|
106 |
-
// Remove from list.
|
107 |
-
unset($this->uParams[$name]);
|
108 |
-
}
|
109 |
-
// Get parameter type.
|
110 |
-
$type = $dParams[$name]['type'];
|
111 |
-
// Cast to correct type.
|
112 |
-
switch ($type) {
|
113 |
-
case 'array':
|
114 |
-
case 'object':
|
115 |
-
// Convert CJT JSON Array and Object to JSON object.
|
116 |
-
$value = str_replace(array('{A', '{O', 'A}', 'O}'), array('[', '[', ']', ']'), $value);
|
117 |
-
// Get PHP var for JSON text!
|
118 |
-
$value = json_decode($value);
|
119 |
-
break;
|
120 |
-
case 'boolean':
|
121 |
-
// Case boolean from string.
|
122 |
-
$value = ($value == "true") ? true: false;
|
123 |
-
break;
|
124 |
-
default:
|
125 |
-
// PHP native cast.
|
126 |
-
settype($value, $type);
|
127 |
-
break;
|
128 |
-
}
|
129 |
-
// As the parameter is passed by user don't need the default.
|
130 |
-
unset($dParams[$name]);
|
131 |
-
}
|
132 |
-
// Get other parameters not passed by user!
|
133 |
-
// Get only parameters with default value !== null.
|
134 |
-
foreach ($dParams as $name => $param) {
|
135 |
-
if ($param['default'] !== null) {
|
136 |
-
$this->uParams[$name] = $param['default'];
|
137 |
}
|
138 |
}
|
139 |
-
// Chaining.
|
140 |
return $this;
|
141 |
}
|
142 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
143 |
} // End class.
|
9 |
/**
|
10 |
*
|
11 |
*/
|
12 |
+
abstract class CJT_Framework_Developer_Interface_Block_Parameters_Parameters {
|
13 |
|
14 |
/**
|
15 |
* put your comment there...
|
16 |
*
|
17 |
* @var mixed
|
18 |
*/
|
19 |
+
protected $contentParameter = null;
|
20 |
|
21 |
/**
|
22 |
* put your comment there...
|
23 |
*
|
24 |
* @var mixed
|
25 |
*/
|
26 |
+
protected $params = array();
|
27 |
|
28 |
/**
|
29 |
* put your comment there...
|
30 |
*
|
31 |
+
* @param mixed $parameters
|
32 |
+
* @param mixed $fatory
|
33 |
+
* @return CJT_Framework_Developer_Interface_Block_Parameters_Parameters
|
34 |
*/
|
35 |
+
public function __construct($parameters) {
|
36 |
+
// Validate parameters.
|
37 |
+
foreach ($parameters as $parameter) {
|
38 |
+
// Create type object.
|
39 |
+
$parameterModel = $this->params[$parameter->getName(true)] = $this->getFactory()->create($parameter->getType(), $parameter);
|
40 |
+
// Hold reference to the CONTENT PARAMETER.
|
41 |
+
$parameter->getContentParameter() && ($this->contentParameter = $parameterModel);
|
42 |
+
}
|
43 |
}
|
44 |
+
|
45 |
/**
|
46 |
* put your comment there...
|
47 |
*
|
|
|
|
|
|
|
48 |
*/
|
49 |
+
public function getContentParameter() {
|
50 |
+
return $this->contentParameter;
|
|
|
|
|
|
|
|
|
|
|
51 |
}
|
52 |
|
53 |
/**
|
54 |
* put your comment there...
|
55 |
*
|
|
|
56 |
*/
|
57 |
+
protected abstract function getFactory();
|
|
|
|
|
|
|
|
|
58 |
|
59 |
/**
|
60 |
* put your comment there...
|
61 |
*
|
62 |
*/
|
63 |
+
public function getParams() {
|
64 |
+
return $this->params;
|
65 |
}
|
66 |
+
|
67 |
/**
|
68 |
* put your comment there...
|
69 |
*
|
70 |
*/
|
71 |
+
public function getMessages() {
|
72 |
+
|
73 |
}
|
74 |
|
75 |
/**
|
76 |
* put your comment there...
|
77 |
*
|
|
|
|
|
78 |
*/
|
79 |
+
public function hasParams() {
|
80 |
+
return !empty($this->params);
|
|
|
|
|
81 |
}
|
82 |
|
83 |
/**
|
84 |
* put your comment there...
|
85 |
*
|
86 |
+
* @param mixed $values
|
87 |
*/
|
88 |
+
public function setValue($values) {
|
89 |
+
foreach ($this->getParams() as $name => $param) {
|
90 |
+
if (isset($values[$name])) {
|
91 |
+
$param->setValue($values[$name]);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
92 |
}
|
93 |
}
|
|
|
94 |
return $this;
|
95 |
}
|
96 |
|
97 |
+
/**
|
98 |
+
* put your comment there...
|
99 |
+
*
|
100 |
+
*/
|
101 |
+
public function validate() {
|
102 |
+
return true;
|
103 |
+
}
|
104 |
+
|
105 |
} // End class.
|
framework/developer/interface/block/parameters/transform/json/json.php
DELETED
@@ -1,62 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
*
|
4 |
-
*/
|
5 |
-
|
6 |
-
// Disallow direct access.
|
7 |
-
defined('ABSPATH') or die("Access denied");
|
8 |
-
|
9 |
-
/**
|
10 |
-
*
|
11 |
-
*/
|
12 |
-
class CJT_Framework_Developer_Interface_Block_Parameters_Transform_Json {
|
13 |
-
|
14 |
-
/**
|
15 |
-
* put your comment there...
|
16 |
-
*
|
17 |
-
* @var mixed
|
18 |
-
*/
|
19 |
-
protected $excludes = null;
|
20 |
-
|
21 |
-
/**
|
22 |
-
* put your comment there...
|
23 |
-
*
|
24 |
-
* @var CJT_Framework_Developer_Interface_Block_Parameters
|
25 |
-
*/
|
26 |
-
protected $params = null;
|
27 |
-
|
28 |
-
/**
|
29 |
-
* put your comment there...
|
30 |
-
*
|
31 |
-
* @param CJT_Framework_Developer_Interface_Block_Parameters $params
|
32 |
-
* @return CJT_Framework_Developer_Interface_Block_Parameters_Transform_Json
|
33 |
-
*/
|
34 |
-
public function __construct($params, $excludes) {
|
35 |
-
// Initialize.
|
36 |
-
$this->params = $params;
|
37 |
-
$this->excludes = explode(',', $excludes);
|
38 |
-
}
|
39 |
-
|
40 |
-
/**
|
41 |
-
* put your comment there...
|
42 |
-
*
|
43 |
-
*/
|
44 |
-
public function __toString() {
|
45 |
-
// Initialize.
|
46 |
-
$params = array();
|
47 |
-
// Get all passed parameters as array!
|
48 |
-
// Remove excluded list.
|
49 |
-
$uParams = array_diff_key($this->params->getArray(), array_flip($this->excludes));
|
50 |
-
$definition =& $this->params->getDefinition();
|
51 |
-
// Get values for all parameters required to be represented as json object.
|
52 |
-
foreach ($uParams as $name => & $value) {
|
53 |
-
// Use Character case as defined in the parameters
|
54 |
-
// definition other than the user passed parameter name.
|
55 |
-
// User parameter read in lowercase other than the original.
|
56 |
-
$params[$definition[$name]['name']] = $value;
|
57 |
-
}
|
58 |
-
// Javascript Object Notation.
|
59 |
-
return json_encode((object) $params);
|
60 |
-
}
|
61 |
-
|
62 |
-
} // End class.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
framework/developer/interface/block/parameters/types/array.php
ADDED
@@ -0,0 +1,74 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
*
|
4 |
+
*/
|
5 |
+
|
6 |
+
// Disallow direct access.
|
7 |
+
defined('ABSPATH') or die("Access denied");
|
8 |
+
|
9 |
+
/**
|
10 |
+
*
|
11 |
+
*/
|
12 |
+
class CJT_Framework_Developer_Interface_Block_Parameters_Types_Array extends
|
13 |
+
CJT_Framework_Developer_Interface_Block_Parameters_Types_Base_Scalar {
|
14 |
+
|
15 |
+
/**
|
16 |
+
* put your comment there...
|
17 |
+
*
|
18 |
+
*/
|
19 |
+
public function getValue() {
|
20 |
+
// Initialize.
|
21 |
+
$value = array();
|
22 |
+
// Get final value!
|
23 |
+
foreach ($this->getValues() as $param) {
|
24 |
+
$value[] = $param->getValue();
|
25 |
+
}
|
26 |
+
return $value;
|
27 |
+
}
|
28 |
+
|
29 |
+
/**
|
30 |
+
* put your comment there...
|
31 |
+
*
|
32 |
+
*/
|
33 |
+
public function getValues() {
|
34 |
+
return $this->value;
|
35 |
+
}
|
36 |
+
|
37 |
+
/**
|
38 |
+
* put your comment there...
|
39 |
+
*
|
40 |
+
*/
|
41 |
+
protected function setDefault() {
|
42 |
+
// First decode JSON to PHP array and then set the default.
|
43 |
+
return $this->setValue(json_decode($this->getDefinition()->getDefaultValue()));
|
44 |
+
}
|
45 |
+
|
46 |
+
/**
|
47 |
+
* put your comment there...
|
48 |
+
*
|
49 |
+
* @param mixed $value
|
50 |
+
*/
|
51 |
+
public function setValue($values) {
|
52 |
+
// E_ALL complain!
|
53 |
+
if (!$values) {
|
54 |
+
$values = array();
|
55 |
+
}
|
56 |
+
// Initialize empty array.
|
57 |
+
$this->value = array();
|
58 |
+
// Get prototype parameter.
|
59 |
+
$parameters = $this->getDefinition()->getChilds();
|
60 |
+
// Prototype parameter defined as the first parameter.
|
61 |
+
$prototype = reset($parameters);
|
62 |
+
foreach ($values as $value) {
|
63 |
+
// Create parameter prototype.
|
64 |
+
$param = $this->value[] = $this->getFactory()->create($prototype->getType(), $prototype);
|
65 |
+
// Set the value.
|
66 |
+
$param->setValue($value);
|
67 |
+
// Set parent.
|
68 |
+
$param->setParent($this);
|
69 |
+
}
|
70 |
+
// Chaining.
|
71 |
+
return $this;
|
72 |
+
}
|
73 |
+
|
74 |
+
} // End class.
|
framework/developer/interface/block/parameters/types/base/abstract.php
ADDED
@@ -0,0 +1,103 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
*
|
4 |
+
*/
|
5 |
+
|
6 |
+
// Disallow direct access.
|
7 |
+
defined('ABSPATH') or die("Access denied");
|
8 |
+
|
9 |
+
/**
|
10 |
+
*
|
11 |
+
*/
|
12 |
+
abstract class CJT_Framework_Developer_Interface_Block_Parameters_Types_Base_Abstract
|
13 |
+
implements CJT_Framework_Developer_Interface_Block_Parameters_Types_Interface_Type {
|
14 |
+
|
15 |
+
/**
|
16 |
+
* put your comment there...
|
17 |
+
*
|
18 |
+
* @var mixed
|
19 |
+
*/
|
20 |
+
protected $definition;
|
21 |
+
|
22 |
+
/**
|
23 |
+
* put your comment there...
|
24 |
+
*
|
25 |
+
* @var mixed
|
26 |
+
*/
|
27 |
+
protected $factory = null;
|
28 |
+
|
29 |
+
/**
|
30 |
+
* put your comment there...
|
31 |
+
*
|
32 |
+
* @var mixed
|
33 |
+
*/
|
34 |
+
protected $parent = null;
|
35 |
+
|
36 |
+
/**
|
37 |
+
* put your comment there...
|
38 |
+
*
|
39 |
+
* @param mixed $definition
|
40 |
+
* @param mixed $factory
|
41 |
+
* @return CJT_Framework_Developer_Interface_Block_Parameters_Types_Base_Abstract
|
42 |
+
*/
|
43 |
+
public function __construct($definition, $factory) {
|
44 |
+
// Initialize.
|
45 |
+
$this->definition = $definition;
|
46 |
+
$this->factory = $factory;
|
47 |
+
// Set Default value!
|
48 |
+
$this->setDefault();
|
49 |
+
}
|
50 |
+
|
51 |
+
/**
|
52 |
+
* put your comment there...
|
53 |
+
*
|
54 |
+
*/
|
55 |
+
public function getDefinition() {
|
56 |
+
return $this->definition;
|
57 |
+
}
|
58 |
+
|
59 |
+
/**
|
60 |
+
* put your comment there...
|
61 |
+
*
|
62 |
+
*/
|
63 |
+
public function getFactory() {
|
64 |
+
return $this->factory;
|
65 |
+
}
|
66 |
+
|
67 |
+
/**
|
68 |
+
* put your comment there...
|
69 |
+
*
|
70 |
+
*/
|
71 |
+
public function getParent() {
|
72 |
+
return $this->parent;
|
73 |
+
}
|
74 |
+
|
75 |
+
/**
|
76 |
+
* put your comment there...
|
77 |
+
*
|
78 |
+
*/
|
79 |
+
protected abstract function setDefault();
|
80 |
+
|
81 |
+
/**
|
82 |
+
* put your comment there...
|
83 |
+
*
|
84 |
+
* @param mixed $parent
|
85 |
+
*/
|
86 |
+
public function setParent($parent) {
|
87 |
+
// Set parent.
|
88 |
+
$this->parent = $parent;
|
89 |
+
// Chaining.
|
90 |
+
return $this;
|
91 |
+
}
|
92 |
+
/**
|
93 |
+
* put your comment there...
|
94 |
+
*
|
95 |
+
*/
|
96 |
+
public function validate() {
|
97 |
+
// Get final value!
|
98 |
+
$value = $this->getValue();
|
99 |
+
// Validate is required!
|
100 |
+
return (!$this->getDefinition()->getRequired() || !empty($value));
|
101 |
+
}
|
102 |
+
|
103 |
+
} // End class.
|
framework/developer/interface/block/parameters/types/base/factory.php
ADDED
@@ -0,0 +1,30 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
*
|
4 |
+
*/
|
5 |
+
|
6 |
+
/**
|
7 |
+
*
|
8 |
+
*/
|
9 |
+
class CJT_Framework_Developer_Interface_Block_Parameters_Types_Base_Factory {
|
10 |
+
|
11 |
+
/**
|
12 |
+
* put your comment there...
|
13 |
+
*
|
14 |
+
* @param mixed $name
|
15 |
+
* @param mixed $definition
|
16 |
+
* @param mixed $factory
|
17 |
+
* @return CJT_Framework_Developer_Interface_Block_Parameters_Types_Interface_Type
|
18 |
+
*/
|
19 |
+
public function create($name, $definition, $factory = null) {
|
20 |
+
// Default factory to this!
|
21 |
+
if ($factory === null) {
|
22 |
+
$factory = $this;
|
23 |
+
}
|
24 |
+
// Get type class name.
|
25 |
+
$className = 'CJT_Framework_Developer_Interface_Block_Parameters_Types_' . ucfirst($name);
|
26 |
+
// Instantiate!
|
27 |
+
return new $className($definition, $factory);
|
28 |
+
}
|
29 |
+
|
30 |
+
} // End class
|
framework/developer/interface/block/parameters/types/base/list.php
ADDED
@@ -0,0 +1,102 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
*
|
4 |
+
*/
|
5 |
+
|
6 |
+
// Disallow direct access.
|
7 |
+
defined('ABSPATH') or die("Access denied");
|
8 |
+
|
9 |
+
/**
|
10 |
+
*
|
11 |
+
*/
|
12 |
+
abstract class CJT_Framework_Developer_Interface_Block_Parameters_Types_Base_List
|
13 |
+
extends CJT_Framework_Developer_Interface_Block_Parameters_Types_Base_Abstract {
|
14 |
+
|
15 |
+
/**
|
16 |
+
* put your comment there...
|
17 |
+
*
|
18 |
+
* @var mixed
|
19 |
+
*/
|
20 |
+
protected $params = array();
|
21 |
+
|
22 |
+
/**
|
23 |
+
* put your comment there...
|
24 |
+
*
|
25 |
+
* @param mixed $definition
|
26 |
+
* @param mixed $factory
|
27 |
+
* @param mixed $parent
|
28 |
+
* @return CJT_Framework_Developer_Interface_Block_Parameters_Types_Base_List
|
29 |
+
*/
|
30 |
+
public function __construct($definition, $factory) {
|
31 |
+
// Initialize parent.
|
32 |
+
parent::__construct($definition, $factory);
|
33 |
+
// Create structure parameters.
|
34 |
+
foreach ($definition->getChilds() as $parameter) {
|
35 |
+
// Instantiate type object.
|
36 |
+
$typeObject = $this->getFactory()->create($parameter->getType(), $parameter);
|
37 |
+
// Set parent!
|
38 |
+
$typeObject->setParent($this);
|
39 |
+
// Add to the list.
|
40 |
+
$this->params[$parameter->getName(true)] = $typeObject;
|
41 |
+
}
|
42 |
+
}
|
43 |
+
|
44 |
+
/**
|
45 |
+
* put your comment there...
|
46 |
+
*
|
47 |
+
*/
|
48 |
+
public function getParams() {
|
49 |
+
return $this->params;
|
50 |
+
}
|
51 |
+
|
52 |
+
/**
|
53 |
+
* put your comment there...
|
54 |
+
*
|
55 |
+
*/
|
56 |
+
public function getValue($useRealNames = null) {
|
57 |
+
// Defaults.
|
58 |
+
if ($useRealNames === null) {
|
59 |
+
$useRealNames = false;
|
60 |
+
}
|
61 |
+
// Initialize value array.
|
62 |
+
$value = array();
|
63 |
+
// Get all values from all child parameters.
|
64 |
+
foreach ($this->params as $key => $param) {
|
65 |
+
// Get name.
|
66 |
+
$name = $useRealNames ? $param->getDefinition()->getName() : $key;
|
67 |
+
// Set Value!
|
68 |
+
$value[$name] = $param->getValue($useRealNames);
|
69 |
+
}
|
70 |
+
return $value;
|
71 |
+
}
|
72 |
+
|
73 |
+
/**
|
74 |
+
* put your comment there...
|
75 |
+
*
|
76 |
+
*/
|
77 |
+
protected function setDefault() {
|
78 |
+
// Set child defaults
|
79 |
+
foreach ($this->params as $param) {
|
80 |
+
$param->setDefault();
|
81 |
+
}
|
82 |
+
return $this;
|
83 |
+
}
|
84 |
+
|
85 |
+
/**
|
86 |
+
* put your comment there...
|
87 |
+
*
|
88 |
+
*/
|
89 |
+
public function validate() {
|
90 |
+
// Initialize.
|
91 |
+
if ($valid = parent::validate()) {
|
92 |
+
// Validate structure parameters!
|
93 |
+
foreach ($this->params as $param) {
|
94 |
+
if (!$valid = $param->validate()) {
|
95 |
+
break;
|
96 |
+
}
|
97 |
+
}
|
98 |
+
}
|
99 |
+
return $valid;
|
100 |
+
}
|
101 |
+
|
102 |
+
} // End class.
|
framework/developer/interface/block/parameters/types/base/scalar.php
ADDED
@@ -0,0 +1,38 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
*
|
4 |
+
*/
|
5 |
+
|
6 |
+
// Disallow direct access.
|
7 |
+
defined('ABSPATH') or die("Access denied");
|
8 |
+
|
9 |
+
/**
|
10 |
+
*
|
11 |
+
*/
|
12 |
+
abstract class CJT_Framework_Developer_Interface_Block_Parameters_Types_Base_Scalar
|
13 |
+
extends CJT_Framework_Developer_Interface_Block_Parameters_Types_Base_Abstract {
|
14 |
+
|
15 |
+
/**
|
16 |
+
* put your comment there...
|
17 |
+
*
|
18 |
+
* @var mixed
|
19 |
+
*/
|
20 |
+
protected $value = null;
|
21 |
+
|
22 |
+
/**
|
23 |
+
* put your comment there...
|
24 |
+
*
|
25 |
+
*/
|
26 |
+
public function getValue($useRealNames = null) {
|
27 |
+
return $this->value;
|
28 |
+
}
|
29 |
+
|
30 |
+
/**
|
31 |
+
* put your comment there...
|
32 |
+
*
|
33 |
+
*/
|
34 |
+
protected function setDefault() {
|
35 |
+
return $this->setValue($this->getDefinition()->getDefaultValue());
|
36 |
+
}
|
37 |
+
|
38 |
+
} // End class.
|
framework/developer/interface/block/parameters/types/boolean.php
ADDED
@@ -0,0 +1,36 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
*
|
4 |
+
*/
|
5 |
+
|
6 |
+
// Disallow direct access.
|
7 |
+
defined('ABSPATH') or die("Access denied");
|
8 |
+
|
9 |
+
/**
|
10 |
+
*
|
11 |
+
*/
|
12 |
+
class CJT_Framework_Developer_Interface_Block_Parameters_Types_Boolean
|
13 |
+
extends CJT_Framework_Developer_Interface_Block_Parameters_Types_Base_Scalar {
|
14 |
+
|
15 |
+
/**
|
16 |
+
* put your comment there...
|
17 |
+
*
|
18 |
+
* @param mixed $value
|
19 |
+
*/
|
20 |
+
public function setValue($value) {
|
21 |
+
// Support boolean string!
|
22 |
+
if (is_string($value)) {
|
23 |
+
if ($value == 'true') {
|
24 |
+
$value = true;
|
25 |
+
}
|
26 |
+
else if ($value == 'false') {
|
27 |
+
$value = false;
|
28 |
+
}
|
29 |
+
}
|
30 |
+
// Cast to boolean!
|
31 |
+
$this->value = (bool) $value;
|
32 |
+
// Chaining.
|
33 |
+
return $this;
|
34 |
+
}
|
35 |
+
|
36 |
+
} // End class.
|
framework/developer/interface/block/parameters/types/interface/type.php
ADDED
@@ -0,0 +1,37 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
*
|
4 |
+
*/
|
5 |
+
|
6 |
+
/**
|
7 |
+
*
|
8 |
+
*/
|
9 |
+
interface CJT_Framework_Developer_Interface_Block_Parameters_Types_Interface_Type {
|
10 |
+
|
11 |
+
/**
|
12 |
+
* put your comment there...
|
13 |
+
*
|
14 |
+
*/
|
15 |
+
public function getValue($useRealNames = null);
|
16 |
+
|
17 |
+
/**
|
18 |
+
* put your comment there...
|
19 |
+
*
|
20 |
+
* @param mixed $parent
|
21 |
+
*/
|
22 |
+
public function setParent($parent);
|
23 |
+
|
24 |
+
/**
|
25 |
+
* put your comment there...
|
26 |
+
*
|
27 |
+
* @param mixed $value
|
28 |
+
*/
|
29 |
+
public function setValue($value);
|
30 |
+
|
31 |
+
/**
|
32 |
+
* put your comment there...
|
33 |
+
*
|
34 |
+
*/
|
35 |
+
public function validate();
|
36 |
+
|
37 |
+
} // End class.
|
framework/developer/interface/block/parameters/types/list.php
ADDED
@@ -0,0 +1,51 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
*
|
4 |
+
*/
|
5 |
+
|
6 |
+
// Disallow direct access.
|
7 |
+
defined('ABSPATH') or die("Access denied");
|
8 |
+
|
9 |
+
/**
|
10 |
+
*
|
11 |
+
*/
|
12 |
+
class CJT_Framework_Developer_Interface_Block_Parameters_Types_List
|
13 |
+
extends CJT_Framework_Developer_Interface_Block_Parameters_Types_Base_List {
|
14 |
+
|
15 |
+
/**
|
16 |
+
* put your comment there...
|
17 |
+
*
|
18 |
+
*/
|
19 |
+
public function getValue($useRealNames = null) {
|
20 |
+
// Get associative array!
|
21 |
+
$assocArray = parent::getValue($useRealNames);
|
22 |
+
// As Wordpress Shortcode cannot understand [ and ] brackets
|
23 |
+
// being in the attribute value we need to use Javascript object instead of array
|
24 |
+
// by casting to object.
|
25 |
+
return (object) array_values($assocArray);;
|
26 |
+
}
|
27 |
+
|
28 |
+
/**
|
29 |
+
* put your comment there...
|
30 |
+
*
|
31 |
+
* @param mixed $value
|
32 |
+
*/
|
33 |
+
public function setValue($value) {
|
34 |
+
// Start from the begining.
|
35 |
+
reset($value);
|
36 |
+
// Pass to child params.
|
37 |
+
foreach ($this->params as $param) {
|
38 |
+
// Get child parameter value.
|
39 |
+
$paramValue = current($value);
|
40 |
+
// Set child parameter value.
|
41 |
+
$param->setValue($paramValue);
|
42 |
+
if (!$param->validate()) {
|
43 |
+
echo cssJSToolbox::getText('Invalid structure parameter passed!');
|
44 |
+
}
|
45 |
+
// Move forward!
|
46 |
+
next($value);
|
47 |
+
}
|
48 |
+
return $this;
|
49 |
+
}
|
50 |
+
|
51 |
+
} // End class.
|
framework/developer/interface/block/parameters/types/number.php
ADDED
@@ -0,0 +1,27 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
*
|
4 |
+
*/
|
5 |
+
|
6 |
+
// Disallow direct access.
|
7 |
+
defined('ABSPATH') or die("Access denied");
|
8 |
+
|
9 |
+
/**
|
10 |
+
*
|
11 |
+
*/
|
12 |
+
class CJT_Framework_Developer_Interface_Block_Parameters_Types_Number
|
13 |
+
extends CJT_Framework_Developer_Interface_Block_Parameters_Types_Base_Scalar {
|
14 |
+
|
15 |
+
/**
|
16 |
+
* put your comment there...
|
17 |
+
*
|
18 |
+
* @param mixed $value
|
19 |
+
*/
|
20 |
+
public function setValue($value) {
|
21 |
+
// Cast to double!
|
22 |
+
$this->value = (double) $value;
|
23 |
+
// Chaining.
|
24 |
+
return $this;
|
25 |
+
}
|
26 |
+
|
27 |
+
} // End class.
|
framework/developer/interface/block/parameters/types/raw.php
ADDED
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
*
|
4 |
+
*/
|
5 |
+
|
6 |
+
// Disallow direct access.
|
7 |
+
defined('ABSPATH') or die("Access denied");
|
8 |
+
|
9 |
+
/**
|
10 |
+
*
|
11 |
+
*/
|
12 |
+
class CJT_Framework_Developer_Interface_Block_Parameters_Types_Raw
|
13 |
+
extends CJT_Framework_Developer_Interface_Block_Parameters_Types_Text {} // End class.
|
framework/developer/interface/block/parameters/types/structure.php
ADDED
@@ -0,0 +1,45 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
*
|
4 |
+
*/
|
5 |
+
|
6 |
+
// Disallow direct access.
|
7 |
+
defined('ABSPATH') or die("Access denied");
|
8 |
+
|
9 |
+
/**
|
10 |
+
*
|
11 |
+
*/
|
12 |
+
class CJT_Framework_Developer_Interface_Block_Parameters_Types_Structure
|
13 |
+
extends CJT_Framework_Developer_Interface_Block_Parameters_Types_Base_List {
|
14 |
+
|
15 |
+
/**
|
16 |
+
* put your comment there...
|
17 |
+
*
|
18 |
+
*/
|
19 |
+
public function getValue($useRealNames = null) {
|
20 |
+
// Get associative array!
|
21 |
+
$assocArray = parent::getValue($useRealNames);
|
22 |
+
// Cast to stdClass object!
|
23 |
+
return (object) $assocArray;
|
24 |
+
}
|
25 |
+
|
26 |
+
/**
|
27 |
+
* put your comment there...
|
28 |
+
*
|
29 |
+
* @param mixed $value
|
30 |
+
*/
|
31 |
+
public function setValue($value) {
|
32 |
+
// Pass to child params.
|
33 |
+
foreach ($this->params as $name => $param) {
|
34 |
+
// Get child parameter value.
|
35 |
+
$paramValue = isset($value[$name]) ? $value[$name] : null;
|
36 |
+
// Set child parameter value.
|
37 |
+
$param->setValue($paramValue);
|
38 |
+
if (!$param->validate()) {
|
39 |
+
echo cssJSToolbox::getText('Invalid structure parameter passed!');
|
40 |
+
}
|
41 |
+
}
|
42 |
+
return $this;
|
43 |
+
}
|
44 |
+
|
45 |
+
} // End class.
|
framework/developer/interface/block/parameters/types/text.php
ADDED
@@ -0,0 +1,27 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
*
|
4 |
+
*/
|
5 |
+
|
6 |
+
// Disallow direct access.
|
7 |
+
defined('ABSPATH') or die("Access denied");
|
8 |
+
|
9 |
+
/**
|
10 |
+
*
|
11 |
+
*/
|
12 |
+
class CJT_Framework_Developer_Interface_Block_Parameters_Types_Text
|
13 |
+
extends CJT_Framework_Developer_Interface_Block_Parameters_Types_Base_Scalar {
|
14 |
+
|
15 |
+
/**
|
16 |
+
* put your comment there...
|
17 |
+
*
|
18 |
+
* @param mixed $value
|
19 |
+
*/
|
20 |
+
public function setValue($value) {
|
21 |
+
// Cast to double!
|
22 |
+
$this->value = (string) $value;
|
23 |
+
// Chaining.
|
24 |
+
return $this;
|
25 |
+
}
|
26 |
+
|
27 |
+
} // End class.
|
framework/developer/interface/block/shortcode/parameters/base/abstract.php
ADDED
@@ -0,0 +1,121 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
*
|
4 |
+
*/
|
5 |
+
|
6 |
+
/**
|
7 |
+
*
|
8 |
+
*/
|
9 |
+
abstract class CJT_Framework_Developer_Interface_Block_Shortcode_Parameters_Base_Abstract
|
10 |
+
implements CJT_Framework_Developer_Interface_Block_Parameters_Types_Interface_Type,
|
11 |
+
CJT_Framework_Developer_Interface_Block_Shortcode_Parameters_Interface_Type {
|
12 |
+
|
13 |
+
/**
|
14 |
+
* put your comment there...
|
15 |
+
*
|
16 |
+
* @var mixed
|
17 |
+
*/
|
18 |
+
protected $typeObject;
|
19 |
+
|
20 |
+
/**
|
21 |
+
* put your comment there...
|
22 |
+
*
|
23 |
+
* @param mixed $parameter
|
24 |
+
* @param mixed $factory
|
25 |
+
* @return CJT_Framework_Developer_Interface_Block_Shortcode_Parameters_Base_Abstract
|
26 |
+
*/
|
27 |
+
public function __construct($parameter, $factory) {
|
28 |
+
// Get base type factory.
|
29 |
+
$baseTypeFactory = $this->getBaseTypeFactory($parameter);
|
30 |
+
// Share the supplied factory!
|
31 |
+
$this->typeObject = $baseTypeFactory['factory']->create($baseTypeFactory['typeName'], $parameter, $factory);
|
32 |
+
}
|
33 |
+
|
34 |
+
/**
|
35 |
+
* put your comment there...
|
36 |
+
*
|
37 |
+
* @param mixed $parameter
|
38 |
+
*/
|
39 |
+
public function getBaseTypeFactory($parameter) {
|
40 |
+
// Hold local instance!
|
41 |
+
static $baseTypeFactory;
|
42 |
+
if (!$baseTypeFactory) {
|
43 |
+
$baseTypeFactory = new CJT_Framework_Developer_Interface_Block_Parameters_Types_Base_Factory();
|
44 |
+
}
|
45 |
+
// Base type name is mapped to this class name!
|
46 |
+
// boolean => boolean, texts => texts, etc....
|
47 |
+
$className = get_class($this);
|
48 |
+
$name = substr($className, strrpos($className, '_') + 1);
|
49 |
+
// Type factory
|
50 |
+
return array(
|
51 |
+
'factory' => $baseTypeFactory,
|
52 |
+
'typeName' => $name,
|
53 |
+
);
|
54 |
+
}
|
55 |
+
|
56 |
+
/**
|
57 |
+
* put your comment there...
|
58 |
+
*
|
59 |
+
*/
|
60 |
+
public function getDefinition() {
|
61 |
+
return $this->getTypeObject()->getDefinition();
|
62 |
+
}
|
63 |
+
|
64 |
+
/**
|
65 |
+
* put your comment there...
|
66 |
+
*
|
67 |
+
*/
|
68 |
+
protected function getFactory() {
|
69 |
+
return $this->getTypeObject()->getFactory();
|
70 |
+
}
|
71 |
+
|
72 |
+
/**
|
73 |
+
* put your comment there...
|
74 |
+
*
|
75 |
+
*/
|
76 |
+
public function getParent() {
|
77 |
+
return $this->getTypeObject()->getParent();
|
78 |
+
}
|
79 |
+
|
80 |
+
/**
|
81 |
+
* put your comment there...
|
82 |
+
*
|
83 |
+
*/
|
84 |
+
public function getTypeObject() {
|
85 |
+
return $this->typeObject;
|
86 |
+
}
|
87 |
+
|
88 |
+
/**
|
89 |
+
* put your comment there...
|
90 |
+
*
|
91 |
+
*/
|
92 |
+
public function getValue($useRealNames = null) {
|
93 |
+
return $this->getTypeObject()->getValue($useRealNames);
|
94 |
+
}
|
95 |
+
|
96 |
+
/**
|
97 |
+
* put your comment there...
|
98 |
+
*
|
99 |
+
* @param mixed $parent
|
100 |
+
*/
|
101 |
+
public function setParent($parent) {
|
102 |
+
return $this->getTypeObject()->setParent($parent);
|
103 |
+
}
|
104 |
+
/**
|
105 |
+
* put your comment there...
|
106 |
+
*
|
107 |
+
* @param mixed $value
|
108 |
+
*/
|
109 |
+
public function setValue($value) {
|
110 |
+
return $this->getTypeObject()->setValue($value);
|
111 |
+
}
|
112 |
+
|
113 |
+
/**
|
114 |
+
* put your comment there...
|
115 |
+
*
|
116 |
+
*/
|
117 |
+
public function validate() {
|
118 |
+
return $this->getTypeObject()->validate();
|
119 |
+
}
|
120 |
+
|
121 |
+
} // End class.
|
framework/developer/interface/block/shortcode/parameters/base/list.php
ADDED
@@ -0,0 +1,31 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
*
|
4 |
+
*/
|
5 |
+
|
6 |
+
/**
|
7 |
+
*
|
8 |
+
*/
|
9 |
+
abstract class CJT_Framework_Developer_Interface_Block_Shortcode_Parameters_Base_List
|
10 |
+
extends CJT_Framework_Developer_Interface_Block_Shortcode_Parameters_Base_Abstract {
|
11 |
+
/**
|
12 |
+
* put your comment there...
|
13 |
+
*
|
14 |
+
*/
|
15 |
+
public function shortcode() {
|
16 |
+
// Get value!
|
17 |
+
$value = $this->getValue();
|
18 |
+
$name = $this->getDefinition()->getName();
|
19 |
+
// Return json!
|
20 |
+
return "{$name}='" . json_encode($value) . "'";
|
21 |
+
}
|
22 |
+
|
23 |
+
/**
|
24 |
+
* put your comment there...
|
25 |
+
*
|
26 |
+
*/
|
27 |
+
public function getParams() {
|
28 |
+
return $this->getTypeObject()->getParams();
|
29 |
+
}
|
30 |
+
|
31 |
+
} // End class.
|
framework/developer/interface/block/shortcode/parameters/base/scalar.php
ADDED
@@ -0,0 +1,41 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
*
|
4 |
+
*/
|
5 |
+
|
6 |
+
/**
|
7 |
+
*
|
8 |
+
*/
|
9 |
+
abstract class CJT_Framework_Developer_Interface_Block_Shortcode_Parameters_Base_Scalar
|
10 |
+
extends CJT_Framework_Developer_Interface_Block_Shortcode_Parameters_Base_Abstract {
|
11 |
+
|
12 |
+
/**
|
13 |
+
* put your comment there...
|
14 |
+
*
|
15 |
+
*/
|
16 |
+
protected abstract function getShortcodeValue();
|
17 |
+
|
18 |
+
/**
|
19 |
+
* put your comment there...
|
20 |
+
*
|
21 |
+
* @param mixed $string
|
22 |
+
*/
|
23 |
+
public function loadString($string) {
|
24 |
+
return $this->setValue($string);
|
25 |
+
}
|
26 |
+
|
27 |
+
/**
|
28 |
+
* put your comment there...
|
29 |
+
*
|
30 |
+
*/
|
31 |
+
public function shortcode() {
|
32 |
+
// Initialize.
|
33 |
+
$shortcode = '';
|
34 |
+
$param = $this->getTypeObject()->getDefinition();
|
35 |
+
// Concat all.
|
36 |
+
$shortcode = $param->getName() . '=' . $this->getShortcodeValue();
|
37 |
+
// Returns!
|
38 |
+
return $shortcode;
|
39 |
+
}
|
40 |
+
|
41 |
+
} // End class.
|
framework/developer/interface/block/shortcode/parameters/factory.php
ADDED
@@ -0,0 +1,30 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
*
|
4 |
+
*/
|
5 |
+
|
6 |
+
/**
|
7 |
+
*
|
8 |
+
*/
|
9 |
+
class CJT_Framework_Developer_Interface_Block_Shortcode_Parameters_Factory {
|
10 |
+
|
11 |
+
/**
|
12 |
+
* put your comment there...
|
13 |
+
*
|
14 |
+
* @param mixed $name
|
15 |
+
* @param mixed $definition
|
16 |
+
* @param mixed $factory
|
17 |
+
* @return CJT_Framework_Developer_Interface_Block_Parameters_Types_Interface_Type
|
18 |
+
*/
|
19 |
+
public function create($name, $definition, $factory = null) {
|
20 |
+
// Default factory to this!
|
21 |
+
if ($factory === null) {
|
22 |
+
$factory = $this;
|
23 |
+
}
|
24 |
+
// Get type class name.
|
25 |
+
$className = 'CJT_Framework_Developer_Interface_Block_Shortcode_Parameters_Types_' . ucfirst($name);
|
26 |
+
// Instantiate!
|
27 |
+
return new $className($definition, $factory);
|
28 |
+
}
|
29 |
+
|
30 |
+
} // End class
|
framework/developer/interface/block/shortcode/parameters/interface/type.php
ADDED
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
*
|
4 |
+
*/
|
5 |
+
|
6 |
+
/**
|
7 |
+
*
|
8 |
+
*/
|
9 |
+
interface CJT_Framework_Developer_Interface_Block_Shortcode_Parameters_Interface_Type {
|
10 |
+
|
11 |
+
/**
|
12 |
+
* put your comment there...
|
13 |
+
*
|
14 |
+
*/
|
15 |
+
public function shortcode();
|
16 |
+
|
17 |
+
} // End class.
|
framework/developer/interface/block/shortcode/parameters/parameters.php
ADDED
@@ -0,0 +1,154 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
*
|
4 |
+
*/
|
5 |
+
|
6 |
+
/**
|
7 |
+
*
|
8 |
+
*/
|
9 |
+
class CJT_Framework_Developer_Interface_Block_Shortcode_Parameters_Parameters
|
10 |
+
extends CJT_Framework_Developer_Interface_Block_Parameters_Parameters {
|
11 |
+
|
12 |
+
/**
|
13 |
+
* Block programming interface (BPI).
|
14 |
+
*
|
15 |
+
* @param mixed $name
|
16 |
+
*/
|
17 |
+
public function get($name) {
|
18 |
+
// Initialize.
|
19 |
+
$value = NULL;
|
20 |
+
// Get param key from the given name.
|
21 |
+
$key = strtolower($name);
|
22 |
+
if (!isset($this->params[$key])) {
|
23 |
+
echo cssJSToolbox::getText("Parameter {$name} is not found!");
|
24 |
+
}
|
25 |
+
else {
|
26 |
+
$value = $this->params[$key]->getValue();
|
27 |
+
}
|
28 |
+
// Allow writing it in the original case inside the code
|
29 |
+
// however its only retrived by the lowercvase letter.
|
30 |
+
return $value;
|
31 |
+
}
|
32 |
+
|
33 |
+
/**
|
34 |
+
* put your comment there...
|
35 |
+
*
|
36 |
+
*/
|
37 |
+
protected function getFactory() {
|
38 |
+
return new CJT_Framework_Developer_Interface_Block_Shortcode_Parameters_Factory();
|
39 |
+
}
|
40 |
+
|
41 |
+
/**
|
42 |
+
* put your comment there...
|
43 |
+
*
|
44 |
+
* @param mixed $strings
|
45 |
+
* @param mixed $content
|
46 |
+
* @return CJT_Framework_Developer_Interface_Block_Shortcode_Parameters_Parameters
|
47 |
+
*/
|
48 |
+
public function loadString($strings, $content) {
|
49 |
+
// Get the name of the CONTENT PARAMETER -- If EXISTS!
|
50 |
+
// THEN PUSH IT AS ITS PASSED AS SHORTCODR ATTRIBUTE.
|
51 |
+
if ($contentParameter = $this->getContentParameter()) {
|
52 |
+
$strings[$contentParameter->getDefinition()->getName(true)] = $content;
|
53 |
+
}
|
54 |
+
// Load all parameters with shortcde parameters.
|
55 |
+
foreach ($this->getParams() as $name => $param) {
|
56 |
+
// Dont override default value unless parameter is passed!
|
57 |
+
if (isset($strings[$name])) {
|
58 |
+
$param->loadString($strings[$name]);
|
59 |
+
}
|
60 |
+
// Validate type!
|
61 |
+
if (!$param->validate()) {
|
62 |
+
echo cssJSToolbox::getText("Invalid Shortcode parameter: {$type->getMessage()}");
|
63 |
+
}
|
64 |
+
// Remove the value from the stringsValue allow validating if
|
65 |
+
// any invalid parameter name is passed!
|
66 |
+
// See after the loop.
|
67 |
+
unset($strings[$name]);
|
68 |
+
}
|
69 |
+
// If there is any string values still exists then invalid parameter is passed.
|
70 |
+
if (!empty($strings)) {
|
71 |
+
echo cssJSToolbox::getText("Invalid Shortcode parameter(s) has been passed! Please check parameters name.");
|
72 |
+
}
|
73 |
+
return $this;
|
74 |
+
}
|
75 |
+
|
76 |
+
/**
|
77 |
+
* put your comment there...
|
78 |
+
*
|
79 |
+
* @param mixed $excludes
|
80 |
+
* @param array Parameters to include (Will be merged to params)
|
81 |
+
* @return string JSON of the parameters list.
|
82 |
+
*/
|
83 |
+
public function json($excludes = null, $includes = null) {
|
84 |
+
// Initialize.
|
85 |
+
$params = array();
|
86 |
+
$json = '';
|
87 |
+
// Build exclude list.
|
88 |
+
$excludes = explode(',', $excludes);
|
89 |
+
// Get all parameters.
|
90 |
+
foreach ($this->getParams() as $name => $param) {
|
91 |
+
// Process only parameters not in the eexclude list.
|
92 |
+
if (!in_array($name, $excludes)) {
|
93 |
+
$definition = $param->getDefinition();
|
94 |
+
// Get parameter real name.
|
95 |
+
$realName = $definition->getName();
|
96 |
+
// Don't use optional parameters with no values passed.
|
97 |
+
$value = $param->getValue(true);
|
98 |
+
$isOptional = !$definition->getRequired();
|
99 |
+
if ($isOptional) {
|
100 |
+
$stack = array($value);
|
101 |
+
do {
|
102 |
+
// Get current value.
|
103 |
+
$current = array_shift($stack);
|
104 |
+
// Add to process later.
|
105 |
+
if (!is_scalar($current)) {
|
106 |
+
$stack += (array) $current;
|
107 |
+
}
|
108 |
+
// Once a non-empty value is found use it!
|
109 |
+
else if ($current) {
|
110 |
+
$params[$realName] = $value;
|
111 |
+
break; // Exit the loop!
|
112 |
+
}
|
113 |
+
} while (!empty($stack));
|
114 |
+
}
|
115 |
+
else {
|
116 |
+
$params[$realName] = $value;
|
117 |
+
}
|
118 |
+
}
|
119 |
+
}
|
120 |
+
// Merge INCLUDE List!
|
121 |
+
$includes && ($params = array_merge($params, $includes));
|
122 |
+
// Get JSON.
|
123 |
+
$json = json_encode($params);
|
124 |
+
// Returns.
|
125 |
+
return $json;
|
126 |
+
}
|
127 |
+
|
128 |
+
/**
|
129 |
+
* put your comment there...
|
130 |
+
*
|
131 |
+
* @param mixed $blockName
|
132 |
+
*/
|
133 |
+
public function shortcode($blockName) {
|
134 |
+
// Initialize.
|
135 |
+
$shortcode = "[cjtoolbox name='{$blockName}'\n\t\t%s]%s\n[/cjtoolbox]";
|
136 |
+
$shortcodeContent = '';
|
137 |
+
$params = $this->getParams();
|
138 |
+
$attributes = array();
|
139 |
+
// Process all parameters except of the Shortcode Content parameter.
|
140 |
+
if ($contentParameter = $this->getContentParameter()) {
|
141 |
+
// Remove it from the list as it will be added as content rather than attribute.
|
142 |
+
unset($params[$contentParameter->getDefinition()->getName(true)]);
|
143 |
+
// Get Content Parameter data.
|
144 |
+
$shortcodeContent = $contentParameter->getValue();
|
145 |
+
}
|
146 |
+
// Aggregate all parameters strings in one array!
|
147 |
+
foreach ($params as $param) {
|
148 |
+
$attributes[] = $param->shortcode();
|
149 |
+
}
|
150 |
+
// Join with a TAB character + Add Content Parameter!
|
151 |
+
return sprintf($shortcode, join("\t\t\n", $attributes), $shortcodeContent);
|
152 |
+
}
|
153 |
+
|
154 |
+
} // End class
|
framework/developer/interface/block/shortcode/parameters/types/array.php
ADDED
@@ -0,0 +1,44 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
*
|
4 |
+
*/
|
5 |
+
|
6 |
+
// Disallow direct access.
|
7 |
+
defined('ABSPATH') or die("Access denied");
|
8 |
+
|
9 |
+
/**
|
10 |
+
*
|
11 |
+
*/
|
12 |
+
class CJT_Framework_Developer_Interface_Block_Shortcode_Parameters_Types_Array
|
13 |
+
extends CJT_Framework_Developer_Interface_Block_Shortcode_Parameters_Base_Scalar {
|
14 |
+
|
15 |
+
/**
|
16 |
+
* put your comment there...
|
17 |
+
*
|
18 |
+
* @param mixed $string
|
19 |
+
* @return CJT_Framework_Developer_Interface_Block_Parameters_Types_Base_Scalar
|
20 |
+
*/
|
21 |
+
public function loadString($string) {
|
22 |
+
// Convert CJT JSON Array and Object to JSON object.
|
23 |
+
$string = str_replace(array('{A', 'A}'), array('[', ']'), $string);
|
24 |
+
// Get PHP var for JSON text!
|
25 |
+
return $this->setValue(json_decode($string, true));
|
26 |
+
}
|
27 |
+
|
28 |
+
/**
|
29 |
+
* put your comment there...
|
30 |
+
*
|
31 |
+
*/
|
32 |
+
protected function getShortcodeValue() {
|
33 |
+
return "'" . json_encode($this->getValue()) . "'";
|
34 |
+
}
|
35 |
+
|
36 |
+
/**
|
37 |
+
* put your comment there...
|
38 |
+
*
|
39 |
+
*/
|
40 |
+
public function getValues() {
|
41 |
+
return $this->getTypeObject()->getValues();
|
42 |
+
}
|
43 |
+
|
44 |
+
} // End class.
|
framework/developer/interface/block/shortcode/parameters/types/boolean.php
ADDED
@@ -0,0 +1,26 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
*
|
4 |
+
*/
|
5 |
+
|
6 |
+
// Disallow direct access.
|
7 |
+
defined('ABSPATH') or die("Access denied");
|
8 |
+
|
9 |
+
/**
|
10 |
+
*
|
11 |
+
*/
|
12 |
+
class CJT_Framework_Developer_Interface_Block_Shortcode_Parameters_Types_Boolean
|
13 |
+
extends CJT_Framework_Developer_Interface_Block_Shortcode_Parameters_Base_Scalar {
|
14 |
+
|
15 |
+
/**
|
16 |
+
* put your comment there...
|
17 |
+
*
|
18 |
+
*/
|
19 |
+
protected function getShortcodeValue() {
|
20 |
+
// Read value.
|
21 |
+
$value = $this->getValue();
|
22 |
+
// Return Shortcode parameter value.
|
23 |
+
return $value ? 'true' : 'false';
|
24 |
+
}
|
25 |
+
|
26 |
+
} // End class.
|
framework/developer/interface/block/shortcode/parameters/types/list.php
ADDED
@@ -0,0 +1,40 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
*
|
4 |
+
*/
|
5 |
+
|
6 |
+
// Disallow direct access.
|
7 |
+
defined('ABSPATH') or die("Access denied");
|
8 |
+
|
9 |
+
/**
|
10 |
+
*
|
11 |
+
*/
|
12 |
+
class CJT_Framework_Developer_Interface_Block_Shortcode_Parameters_Types_List
|
13 |
+
extends CJT_Framework_Developer_Interface_Block_Shortcode_Parameters_Base_List {
|
14 |
+
|
15 |
+
/**
|
16 |
+
* put your comment there...
|
17 |
+
*
|
18 |
+
* @param mixed $string
|
19 |
+
*/
|
20 |
+
public function loadString($string) {
|
21 |
+
// Initialize.
|
22 |
+
$indexToFetch = 0;
|
23 |
+
$params = $this->getTypeObject()->getParams();
|
24 |
+
// Convert CJT JSON Array and Object to JSON object.
|
25 |
+
$string = str_replace(array('{A', 'A}'), array('[', ']'), $string);
|
26 |
+
$values = json_decode($string, true);
|
27 |
+
// Load string for all parameters that has value passed.
|
28 |
+
foreach ($params as $param) {
|
29 |
+
$key = (string) $indexToFetch;
|
30 |
+
if (isset($values[$key])) {
|
31 |
+
$value = is_scalar($values[$key]) ? $values[$key] : json_encode($values[$key]);
|
32 |
+
$param->loadString($value);
|
33 |
+
}
|
34 |
+
// Move to next index.
|
35 |
+
$indexToFetch++;
|
36 |
+
}
|
37 |
+
return $this;
|
38 |
+
}
|
39 |
+
|
40 |
+
} // End class.
|
framework/developer/interface/block/shortcode/parameters/types/number.php
ADDED
@@ -0,0 +1,23 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
*
|
4 |
+
*/
|
5 |
+
|
6 |
+
// Disallow direct access.
|
7 |
+
defined('ABSPATH') or die("Access denied");
|
8 |
+
|
9 |
+
/**
|
10 |
+
*
|
11 |
+
*/
|
12 |
+
class CJT_Framework_Developer_Interface_Block_Shortcode_Parameters_Types_Number
|
13 |
+
extends CJT_Framework_Developer_Interface_Block_Shortcode_Parameters_Base_Scalar {
|
14 |
+
|
15 |
+
/**
|
16 |
+
* put your comment there...
|
17 |
+
*
|
18 |
+
*/
|
19 |
+
protected function getShortcodeValue() {
|
20 |
+
return $this->getValue();
|
21 |
+
}
|
22 |
+
|
23 |
+
} // End class.
|
framework/developer/interface/block/shortcode/parameters/types/raw.php
ADDED
@@ -0,0 +1,23 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
*
|
4 |
+
*/
|
5 |
+
|
6 |
+
// Disallow direct access.
|
7 |
+
defined('ABSPATH') or die("Access denied");
|
8 |
+
|
9 |
+
/**
|
10 |
+
*
|
11 |
+
*/
|
12 |
+
class CJT_Framework_Developer_Interface_Block_Shortcode_Parameters_Types_Raw
|
13 |
+
extends CJT_Framework_Developer_Interface_Block_Shortcode_Parameters_Base_Scalar {
|
14 |
+
|
15 |
+
/**
|
16 |
+
* put your comment there...
|
17 |
+
*
|
18 |
+
*/
|
19 |
+
public function getShortcodeValue() {
|
20 |
+
return $this->getValue();
|
21 |
+
}
|
22 |
+
|
23 |
+
} // End class.
|
framework/developer/interface/block/shortcode/parameters/types/structure.php
ADDED
@@ -0,0 +1,35 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
*
|
4 |
+
*/
|
5 |
+
|
6 |
+
// Disallow direct access.
|
7 |
+
defined('ABSPATH') or die("Access denied");
|
8 |
+
|
9 |
+
/**
|
10 |
+
*
|
11 |
+
*/
|
12 |
+
class CJT_Framework_Developer_Interface_Block_Shortcode_Parameters_Types_Structure
|
13 |
+
extends CJT_Framework_Developer_Interface_Block_Shortcode_Parameters_Base_List {
|
14 |
+
|
15 |
+
/**
|
16 |
+
* put your comment there...
|
17 |
+
*
|
18 |
+
* @param mixed $string
|
19 |
+
*/
|
20 |
+
public function loadString($string) {
|
21 |
+
// Convert CJT JSON Array and Object to JSON object.
|
22 |
+
$params = $this->getTypeObject()->getParams();
|
23 |
+
$string = str_replace(array('{A', 'A}'), array('[', ']'), $string);
|
24 |
+
$values = json_decode($string, true);
|
25 |
+
// Load string for all parameters that has value passed.
|
26 |
+
foreach ($params as $name => $param) {
|
27 |
+
if (isset($values[$name])) {
|
28 |
+
$value = is_scalar($values[$name]) ? $values[$name] : json_encode($values[$name]);
|
29 |
+
$param->loadString($value);
|
30 |
+
}
|
31 |
+
}
|
32 |
+
return $this;
|
33 |
+
}
|
34 |
+
|
35 |
+
} // End class.
|
framework/developer/interface/block/shortcode/parameters/types/text.php
ADDED
@@ -0,0 +1,23 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
*
|
4 |
+
*/
|
5 |
+
|
6 |
+
// Disallow direct access.
|
7 |
+
defined('ABSPATH') or die("Access denied");
|
8 |
+
|
9 |
+
/**
|
10 |
+
*
|
11 |
+
*/
|
12 |
+
class CJT_Framework_Developer_Interface_Block_Shortcode_Parameters_Types_Text
|
13 |
+
extends CJT_Framework_Developer_Interface_Block_Shortcode_Parameters_Base_Scalar {
|
14 |
+
|
15 |
+
/**
|
16 |
+
* put your comment there...
|
17 |
+
*
|
18 |
+
*/
|
19 |
+
protected function getShortcodeValue() {
|
20 |
+
return "'" . $this->getValue() . "'";
|
21 |
+
}
|
22 |
+
|
23 |
+
} // End class.
|
framework/developer/interface/block/shortcode/segments/segments.php
CHANGED
@@ -9,7 +9,8 @@ defined('ABSPATH') or die("Access denied");
|
|
9 |
/**
|
10 |
*
|
11 |
*/
|
12 |
-
class
|
|
|
13 |
|
14 |
/**
|
15 |
* put your comment there...
|
9 |
/**
|
10 |
*
|
11 |
*/
|
12 |
+
class CJT_Framework_Developer_Interface_Block_Shortcode_Segments_Segments
|
13 |
+
extends CJT_Framework_Developer_Interface_Block_Parameters_Parameters {
|
14 |
|
15 |
/**
|
16 |
* put your comment there...
|
framework/developer/interface/block/shortcode/shortcode.php
CHANGED
@@ -9,7 +9,7 @@ defined('ABSPATH') or die("Access denied");
|
|
9 |
/**
|
10 |
*
|
11 |
*/
|
12 |
-
class
|
13 |
|
14 |
/**
|
15 |
* put your comment there...
|
@@ -52,7 +52,7 @@ class CJT_Framework_Developer_Interface_Block_Shortcode {
|
|
52 |
* @var CJT_Framework_Developer_Interface_Block_Shortcode_Segments
|
53 |
*/
|
54 |
protected $segments = null;
|
55 |
-
|
56 |
/**
|
57 |
* put your comment there...
|
58 |
*
|
@@ -65,10 +65,12 @@ class CJT_Framework_Developer_Interface_Block_Shortcode {
|
|
65 |
// Initialize.
|
66 |
$this->block = $block;
|
67 |
$this->content =& $content;
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
|
|
|
|
72 |
// Generate Shortcode block container id.
|
73 |
$this->bcid = md5(microtime());
|
74 |
// Build block container element id.
|
@@ -137,8 +139,7 @@ class CJT_Framework_Developer_Interface_Block_Shortcode {
|
|
137 |
static $fw = null;
|
138 |
// Instantiate framework only when used.
|
139 |
if (!$fw) {
|
140 |
-
|
141 |
-
$fw = new CJT_Framework_Developer($this->block);
|
142 |
}
|
143 |
return $fw;
|
144 |
}
|
9 |
/**
|
10 |
*
|
11 |
*/
|
12 |
+
class CJT_Framework_Developer_Interface_Block_Shortcode_Shortcode {
|
13 |
|
14 |
/**
|
15 |
* put your comment there...
|
52 |
* @var CJT_Framework_Developer_Interface_Block_Shortcode_Segments
|
53 |
*/
|
54 |
protected $segments = null;
|
55 |
+
|
56 |
/**
|
57 |
* put your comment there...
|
58 |
*
|
65 |
// Initialize.
|
66 |
$this->block = $block;
|
67 |
$this->content =& $content;
|
68 |
+
$this->parameters = new CJT_Framework_Developer_Interface_Block_Shortcode_Parameters_Parameters(
|
69 |
+
new CJT_Models_Block_Parameters_Parameters($block->id)
|
70 |
+
);
|
71 |
+
// Load from shortcode parameters.
|
72 |
+
$this->parameters->loadString($parameters, $content);
|
73 |
+
//$this->segments = new CJT_Framework_Developer_Interface_Block_Shortcode_Segments_Segments($this->cleanContent());
|
74 |
// Generate Shortcode block container id.
|
75 |
$this->bcid = md5(microtime());
|
76 |
// Build block container element id.
|
139 |
static $fw = null;
|
140 |
// Instantiate framework only when used.
|
141 |
if (!$fw) {
|
142 |
+
$fw = new CJT_Framework_Developer_Developer($this->block);
|
|
|
143 |
}
|
144 |
return $fw;
|
145 |
}
|
framework/developer/lib/template/template.php
ADDED
@@ -0,0 +1,55 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
*
|
4 |
+
*/
|
5 |
+
|
6 |
+
// Disallow direct access.
|
7 |
+
defined('ABSPATH') or die("Access denied");
|
8 |
+
|
9 |
+
/**
|
10 |
+
*
|
11 |
+
*/
|
12 |
+
class CJT_Framework_Developer_Lib_Template {
|
13 |
+
|
14 |
+
/**
|
15 |
+
* put your comment there...
|
16 |
+
*
|
17 |
+
* @var mixed
|
18 |
+
*/
|
19 |
+
protected $source;
|
20 |
+
|
21 |
+
/**
|
22 |
+
* put your comment there...
|
23 |
+
*
|
24 |
+
* @param mixed $source
|
25 |
+
*/
|
26 |
+
public function __construct($source) {
|
27 |
+
$this->source = $source;
|
28 |
+
}
|
29 |
+
|
30 |
+
/**
|
31 |
+
* put your comment there...
|
32 |
+
*
|
33 |
+
* @param mixed $name
|
34 |
+
*/
|
35 |
+
public function useTheme($name) {
|
36 |
+
// Get template name from theme name.
|
37 |
+
// Template name is [BLOCKNAME-THEMENAME-theme].
|
38 |
+
$templateName = "{$this->source->name} - {$name} theme";
|
39 |
+
// Load template record from database.
|
40 |
+
$tblTemplate = CJTxTable::getInstance('template')
|
41 |
+
->setData(array('name' => $templateName))
|
42 |
+
->load(array('name'));
|
43 |
+
$mdlTemplate = CJTModel::getInstance('template');
|
44 |
+
$mdlTemplate->inputs['id'] = $tblTemplate->get('id');
|
45 |
+
$template = $mdlTemplate->getItem();
|
46 |
+
// Link Style sheet.
|
47 |
+
$queueObject = CJTModel::getInstance('coupling')
|
48 |
+
->getQueueObject('styles');
|
49 |
+
$queueObject->add($template->queueName, "/{$template->file}");
|
50 |
+
$queueObject->enqueue($template->queueName);
|
51 |
+
// Chaining.
|
52 |
+
return $this;
|
53 |
+
}
|
54 |
+
|
55 |
+
} // End class.
|
framework/html/dom/element/script.php
ADDED
@@ -0,0 +1,65 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
*
|
4 |
+
*/
|
5 |
+
|
6 |
+
class CJT_Framework_Html_Dom_Element_Script
|
7 |
+
extends CJT_Framework_Html_Dom_Elementbase {
|
8 |
+
|
9 |
+
/**
|
10 |
+
* put your comment there...
|
11 |
+
*
|
12 |
+
* @var mixed
|
13 |
+
*/
|
14 |
+
protected $vars;
|
15 |
+
|
16 |
+
/**
|
17 |
+
* put your comment there...
|
18 |
+
*
|
19 |
+
*/
|
20 |
+
public function __construct() {
|
21 |
+
// Create script element.
|
22 |
+
parent::__construct('script');
|
23 |
+
// INitialize vars.
|
24 |
+
$this->vars = new ArrayObject(array());
|
25 |
+
// INitialize with defauls.
|
26 |
+
$this->setType('text/javascript');
|
27 |
+
}
|
28 |
+
|
29 |
+
/**
|
30 |
+
* put your comment there...
|
31 |
+
*
|
32 |
+
*/
|
33 |
+
public function __toString() {
|
34 |
+
// Set vars.
|
35 |
+
$content = '';
|
36 |
+
$vars =& $this->vars();
|
37 |
+
foreach ($vars as $var => $value) {
|
38 |
+
$content .= "var {$var}={$value};";
|
39 |
+
}
|
40 |
+
$this->setContent($content);
|
41 |
+
// Get parent string.
|
42 |
+
return parent::__toString();
|
43 |
+
}
|
44 |
+
|
45 |
+
/**
|
46 |
+
* put your comment there...
|
47 |
+
*
|
48 |
+
* @param mixed $type
|
49 |
+
*/
|
50 |
+
public function & setType($type) {
|
51 |
+
// Set type.
|
52 |
+
$this->setAttribute('type', $type);
|
53 |
+
// chain.
|
54 |
+
return $this;
|
55 |
+
}
|
56 |
+
|
57 |
+
/**
|
58 |
+
* put your comment there...
|
59 |
+
*
|
60 |
+
*/
|
61 |
+
public function & vars() {
|
62 |
+
return $this->vars;
|
63 |
+
}
|
64 |
+
|
65 |
+
} // End class.
|
framework/html/dom/elementbase.php
ADDED
@@ -0,0 +1,69 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
*
|
4 |
+
*/
|
5 |
+
|
6 |
+
class CJT_Framework_Html_Dom_Elementbase {
|
7 |
+
|
8 |
+
/**
|
9 |
+
* put your comment there...
|
10 |
+
*
|
11 |
+
* @var SimpleXMLElement
|
12 |
+
*/
|
13 |
+
protected $simpleXML;
|
14 |
+
|
15 |
+
/**
|
16 |
+
* put your comment there...
|
17 |
+
*
|
18 |
+
* @param mixed $tag
|
19 |
+
* @return CJT_Framework_Html_Dom_Elementbase
|
20 |
+
*/
|
21 |
+
public function __construct($tag) {
|
22 |
+
// Build XML Content.
|
23 |
+
$xmlContent = "<root><{$tag}></{$tag}></root>";
|
24 |
+
// Create SIMPLEXMLElement.
|
25 |
+
$this->simpleXML = new SimpleXMLElement($xmlContent);
|
26 |
+
// Target the tag element.
|
27 |
+
$children = $this->getSimpleXML()->children();
|
28 |
+
$this->simpleXML = $children[0];
|
29 |
+
}
|
30 |
+
|
31 |
+
/**
|
32 |
+
* put your comment there...
|
33 |
+
*
|
34 |
+
*/
|
35 |
+
public function __toString() {
|
36 |
+
return $this->getSimpleXML()->asXML();
|
37 |
+
}
|
38 |
+
|
39 |
+
/**
|
40 |
+
* put your comment there...
|
41 |
+
*
|
42 |
+
*/
|
43 |
+
protected function & getSimpleXML() {
|
44 |
+
return $this->simpleXML;
|
45 |
+
}
|
46 |
+
|
47 |
+
/**
|
48 |
+
* put your comment there...
|
49 |
+
*
|
50 |
+
* @param mixed $name
|
51 |
+
* @param mixed $value
|
52 |
+
* @param mixed $ns
|
53 |
+
*/
|
54 |
+
public function setAttribute($name, $value, $ns = null) {
|
55 |
+
return $this->getSimpleXML()->addAttribute($name, $value, $ns);
|
56 |
+
}
|
57 |
+
|
58 |
+
/**
|
59 |
+
* put your comment there...
|
60 |
+
*
|
61 |
+
* @param mixed $content
|
62 |
+
*/
|
63 |
+
public function & setContent($content) {
|
64 |
+
// Set content.
|
65 |
+
$this->getSimpleXML()->{0} = $content;
|
66 |
+
// Chain.
|
67 |
+
return $this;
|
68 |
+
}
|
69 |
+
} // End class.
|
framework/js/ace/ChangeLog.txt
CHANGED
@@ -1,29 +1,4 @@
|
|
1 |
-
2013.
|
2 |
-
|
3 |
-
* New Features
|
4 |
-
- Accessibility Theme for Ace (Peter Xiao)
|
5 |
-
- use snipetManager for expanding emmet snippets
|
6 |
-
- update jshint to 2.1.4
|
7 |
-
- improve php syntax checker (jdalegonzalez)
|
8 |
-
- add option for autoresizing
|
9 |
-
- add option for autohiding vertical scrollbar
|
10 |
-
- improvements to highlighting of xml like languages (danyaPostfactum)
|
11 |
-
- add support for autocompletion and snippets (gjtorikyan danyaPostfactum and others)
|
12 |
-
- add option to merge similar changes in undo history
|
13 |
-
- add scrollPastEnd option
|
14 |
-
- 6a87d97 Merge pull request #1494 from danyaPostfactum/snippetcompleter
|
15 |
-
- use html5 dragndrop for text dragging (danyaPostfactum)
|
16 |
-
|
17 |
-
* API Changes
|
18 |
-
- fixed typo in HashHandler commmandManager
|
19 |
-
|
20 |
-
* new language modes
|
21 |
-
- Nix (Zef Hemel)
|
22 |
-
- Protobuf (Zef Hemel)
|
23 |
-
- Soy
|
24 |
-
- Handlebars
|
25 |
-
|
26 |
-
2013.06.04 Version 1.1.1
|
27 |
|
28 |
- Improved emacs keybindings (Robert Krahn)
|
29 |
- Added markClean, isClean methods to UndoManager (Joonsoo Jeon)
|
1 |
+
2013.06.04 Version 1.1.01
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2 |
|
3 |
- Improved emacs keybindings (Robert Krahn)
|
4 |
- Added markClean, isClean methods to UndoManager (Joonsoo Jeon)
|
framework/js/ace/ext-searchbox.js
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
ace.define("ace/ext/searchbox",["require","exports","module","ace/lib/dom","ace/lib/lang","ace/lib/event","ace/keyboard/hash_handler","ace/lib/keys"],function(e,t,n){var r=e("../lib/dom"),i=e("../lib/lang"),s=e("../lib/event"),o="/* ------------------------------------------------------------------------------------------* Editor Search Form* --------------------------------------------------------------------------------------- */.ace_search {background-color: #ddd;border: 1px solid #cbcbcb;border-top: 0 none;max-width: 297px;overflow: hidden;margin: 0;padding: 4px;padding-right: 6px;padding-bottom: 0;position: absolute;top: 0px;z-index: 99;white-space: normal;}.ace_search.left {border-left: 0 none;border-radius: 0px 0px 5px 0px;left: 0;}.ace_search.right {border-radius: 0px 0px 0px 5px;border-right: 0 none;right: 0;}.ace_search_form, .ace_replace_form {border-radius: 3px;border: 1px solid #cbcbcb;float: left;margin-bottom: 4px;overflow: hidden;}.ace_search_form.ace_nomatch {outline: 1px solid red;}.ace_search_field {background-color: white;border-right: 1px solid #cbcbcb;border: 0 none;-webkit-box-sizing: border-box;-moz-box-sizing: border-box;box-sizing: border-box;display: block;float: left;height: 22px;outline: 0;padding: 0 7px;width: 214px;margin: 0;}.ace_searchbtn,.ace_replacebtn {background: #fff;border: 0 none;border-left: 1px solid #dcdcdc;cursor: pointer;display: block;float: left;height: 22px;margin: 0;padding: 0;position: relative;}.ace_searchbtn:last-child,.ace_replacebtn:last-child {border-top-right-radius: 3px;border-bottom-right-radius: 3px;}.ace_searchbtn:disabled {background: none;cursor: default;}.ace_searchbtn {background-position: 50% 50%;background-repeat: no-repeat;width: 27px;}.ace_searchbtn.prev {background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAFCAYAAAB4ka1VAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAADFJREFUeNpiSU1NZUAC/6E0I0yACYskCpsJiySKIiY0SUZk40FyTEgCjGgKwTRAgAEAQJUIPCE+qfkAAAAASUVORK5CYII=); }.ace_searchbtn.next {background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAFCAYAAAB4ka1VAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAADRJREFUeNpiTE1NZQCC/0DMyIAKwGJMUAYDEo3M/s+EpvM/mkKwCQxYjIeLMaELoLMBAgwAU7UJObTKsvAAAAAASUVORK5CYII=); }.ace_searchbtn_close {background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAcCAYAAABRVo5BAAAAZ0lEQVR42u2SUQrAMAhDvazn8OjZBilCkYVVxiis8H4CT0VrAJb4WHT3C5xU2a2IQZXJjiQIRMdkEoJ5Q2yMqpfDIo+XY4k6h+YXOyKqTIj5REaxloNAd0xiKmAtsTHqW8sR2W5f7gCu5nWFUpVjZwAAAABJRU5ErkJggg==) no-repeat 50% 0;border-radius: 50%;border: 0 none;color: #656565;cursor: pointer;display: block;float: right;font-family: Arial;font-size: 16px;height: 14px;line-height: 16px;margin: 5px 1px 9px 5px;padding: 0;text-align: center;width: 14px;}.ace_searchbtn_close:hover {background-color: #656565;background-position: 50% 100%;color: white;}.ace_replacebtn.prev {width: 54px}.ace_replacebtn.next {width: 27px}.ace_button {margin-left: 2px;cursor: pointer;-webkit-user-select: none;-moz-user-select: none;-o-user-select: none;-ms-user-select: none;user-select: none;overflow: hidden;opacity: 0.7;border: 1px solid rgba(100,100,100,0.23);padding: 1px;-moz-box-sizing: border-box;box-sizing: border-box;color: black;}.ace_button:hover {background-color: #eee;opacity:1;}.ace_button:active {background-color: #ddd;}.ace_button.checked {border-color: #3399ff;opacity:1;}.ace_search_options{margin-bottom: 3px;text-align: right;-webkit-user-select: none;-moz-user-select: none;-o-user-select: none;-ms-user-select: none;user-select: none;}",u=e("../keyboard/hash_handler").HashHandler,a=e("../lib/keys");r.importCssString(o,"ace_searchbox");var f='<div class="ace_search right"> <button type="button" action="hide" class="ace_searchbtn_close"></button> <div class="ace_search_form"> <input class="ace_search_field" placeholder="Search for" spellcheck="false"></input> <button type="button" action="findNext" class="ace_searchbtn next"></button> <button type="button" action="findPrev" class="ace_searchbtn prev"></button> </div> <div class="ace_replace_form"> <input class="ace_search_field" placeholder="Replace with" spellcheck="false"></input> <button type="button" action="replaceAndFindNext" class="ace_replacebtn">Replace</button> <button type="button" action="replaceAll" class="ace_replacebtn">All</button> </div> <div class="ace_search_options"> <span action="toggleRegexpMode" class="ace_button" title="RegExp Search">.*</span> <span action="toggleCaseSensitive" class="ace_button" title="CaseSensitive Search">Aa</span> <span action="toggleWholeWords" class="ace_button" title="Whole Word Search">\\b</span> </div></div>'.replace(/>\s+/g,">"),l=function(e,t,n){var i=r.createElement("div");i.innerHTML=f,this.element=i.firstChild,this.$init(),this.setEditor(e)};(function(){this.setEditor=function(e){e.searchBox=this,e.container.appendChild(this.element),this.editor=e},this.$initElements=function(e){this.searchBox=e.querySelector(".ace_search_form"),this.replaceBox=e.querySelector(".ace_replace_form"),this.searchOptions=e.querySelector(".ace_search_options"),this.regExpOption=e.querySelector("[action=toggleRegexpMode]"),this.caseSensitiveOption=e.querySelector("[action=toggleCaseSensitive]"),this.wholeWordOption=e.querySelector("[action=toggleWholeWords]"),this.searchInput=this.searchBox.querySelector(".ace_search_field"),this.replaceInput=this.replaceBox.querySelector(".ace_search_field")},this.$init=function(){var e=this.element;this.$initElements(e);var t=this;s.addListener(e,"mousedown",function(e){setTimeout(function(){t.activeInput.focus()},0),s.stopPropagation(e)}),s.addListener(e,"click",function(e){var n=e.target||e.srcElement,r=n.getAttribute("action");r&&t[r]?t[r]():t.$searchBarKb.commands[r]&&t.$searchBarKb.commands[r].exec(t),s.stopPropagation(e)}),s.addCommandKeyListener(e,function(e,n,r){var i=a.keyCodeToString(r),o=t.$searchBarKb.findKeyCommand(n,i);o&&o.exec&&(o.exec(t),s.stopEvent(e))}),this.$onChange=i.delayedCall(function(){t.find(!1,!1)}),s.addListener(this.searchInput,"input",function(){t.$onChange.schedule(20)}),s.addListener(this.searchInput,"focus",function(){t.activeInput=t.searchInput,t.searchInput.value&&t.highlight()}),s.addListener(this.replaceInput,"focus",function(){t.activeInput=t.replaceInput,t.searchInput.value&&t.highlight()})},this.$closeSearchBarKb=new u([{bindKey:"Esc",name:"closeSearchBar",exec:function(e){e.searchBox.hide()}}]),this.$searchBarKb=new u,this.$searchBarKb.bindKeys({"Ctrl-f|Command-f|Ctrl-H|Command-Option-F":function(e){var t=e.isReplace=!e.isReplace;e.replaceBox.style.display=t?"":"none",e[t?"replaceInput":"searchInput"].focus()},"Ctrl-G|Command-G":function(e){e.findNext()},"Ctrl-Shift-G|Command-Shift-G":function(e){e.findPrev()},esc:function(e){setTimeout(function(){e.hide()})},Return:function(e){e.activeInput==e.replaceInput&&e.replace(),e.findNext()},"Shift-Return":function(e){e.activeInput==e.replaceInput&&e.replace(),e.findPrev()},Tab:function(e){(e.activeInput==e.replaceInput?e.searchInput:e.replaceInput).focus()}}),this.$searchBarKb.addCommands([{name:"toggleRegexpMode",bindKey:{win:"Alt-R|Alt-/",mac:"Ctrl-Alt-R|Ctrl-Alt-/"},exec:function(e){e.regExpOption.checked=!e.regExpOption.checked,e.$syncOptions()}},{name:"toggleCaseSensitive",bindKey:{win:"Alt-C|Alt-I",mac:"Ctrl-Alt-R|Ctrl-Alt-I"},exec:function(e){e.caseSensitiveOption.checked=!e.caseSensitiveOption.checked,e.$syncOptions()}},{name:"toggleWholeWords",bindKey:{win:"Alt-B|Alt-W",mac:"Ctrl-Alt-B|Ctrl-Alt-W"},exec:function(e){e.wholeWordOption.checked=!e.wholeWordOption.checked,e.$syncOptions()}}]),this.$syncOptions=function(){r.setCssClass(this.regExpOption,"checked",this.regExpOption.checked),r.setCssClass(this.wholeWordOption,"checked",this.wholeWordOption.checked),r.setCssClass(this.caseSensitiveOption,"checked",this.caseSensitiveOption.checked),this.find(!1,!1)},this.highlight=function(e){this.editor.session.highlight(e||this.editor.$search.$options.re),this.editor.renderer.updateBackMarkers()},this.find=function(e,t){var n=this.editor.find(this.searchInput.value,{skipCurrent:e,backwards:t,wrap:!0,regExp:this.regExpOption.checked,caseSensitive:this.caseSensitiveOption.checked,wholeWord:this.wholeWordOption.checked}),i=!n&&this.searchInput.value;r.setCssClass(this.searchBox,"ace_nomatch",i),this.editor._emit("findSearchBox",{match:!i}),this.highlight()},this.findNext=function(){this.find(!0,!1)},this.findPrev=function(){this.find(!0,!0)},this.replace=function(){this.editor.getReadOnly()||this.editor.replace(this.replaceInput.value)},this.replaceAndFindNext=function(){this.editor.getReadOnly()||(this.editor.replace(this.replaceInput.value),this.findNext())},this.replaceAll=function(){this.editor.getReadOnly()||this.editor.replaceAll(this.replaceInput.value)},this.hide=function(){this.element.style.display="none",this.editor.keyBinding.removeKeyboardHandler(this.$closeSearchBarKb),this.editor.focus()},this.show=function(e,t){this.element.style.display="",this.replaceBox.style.display=t?"":"none",this.isReplace=t,e&&(this.searchInput.value=e),this.searchInput.focus(),this.searchInput.select(),this.editor.keyBinding.addKeyboardHandler(this.$closeSearchBarKb)}}).call(l.prototype),t.SearchBox=l,t.Search=function(e,t){var n=e.searchBox||new l(e);n.show(e.session.getTextRange(),t)}})
|
framework/js/ace/ext-settings_menu.js
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
ace.define("ace/ext/settings_menu",["require","exports","module","ace/ext/menu_tools/generate_settings_menu","ace/ext/menu_tools/overlay_page","ace/editor"],function(e,t,n){function s(e){var t=document.getElementById("ace_settingsmenu");t||i(e,r(e),"0","0","0")}var r=e("./menu_tools/generate_settings_menu").generateSettingsMenu,i=e("./menu_tools/overlay_page").overlayPage;n.exports.init=function(t){var n=e("ace/editor").Editor;n.prototype.showSettingsMenu=function(){s(this)}}}),ace.define("ace/ext/menu_tools/generate_settings_menu",["require","exports","module","ace/ext/menu_tools/element_generator","ace/ext/menu_tools/add_editor_menu_options","ace/ext/menu_tools/get_set_functions"],function(e,t,n){var r=e("./element_generator"),i=e("./add_editor_menu_options").addEditorMenuOptions,s=e("./get_set_functions").getSetFunctions;n.exports.generateSettingsMenu=function(t){function o(){n.sort(function(e,t){var n=e.getAttribute("contains"),r=t.getAttribute("contains");return n.localeCompare(r)})}function u(){var e=document.createElement("div");return e.setAttribute("id","ace_settingsmenu"),n.forEach(function(t){e.appendChild(t)}),e}function a(e,n,i,s){var o,u=document.createElement("div");return u.setAttribute("contains",i),u.setAttribute("class","ace_optionsMenuEntry"),u.setAttribute("style","clear: both;"),u.appendChild(r.createLabel(i.replace(/^set/,"").replace(/([A-Z])/g," $1").trim(),i)),Array.isArray(s)?(o=r.createSelection(i,s,n),o.addEventListener("change",function(n){try{t.menuOptions[n.target.id].forEach(function(e){e.textContent!==n.target.textContent&&delete e.selected}),e[n.target.id](n.target.value)}catch(r){throw new Error(r)}})):typeof s=="boolean"?(o=r.createCheckbox(i,s,n),o.addEventListener("change",function(t){try{e[t.target.id](!!t.target.checked)}catch(n){throw new Error(n)}})):(o=r.createInput(i,s,n),o.addEventListener("change",function(t){try{t.target.value==="true"?e[t.target.id](!0):t.target.value==="false"?e[t.target.id](!1):e[t.target.id](t.target.value)}catch(n){throw new Error(n)}})),o.style.cssText="float:right;",u.appendChild(o),u}function f(e,n,r,i){var s=t.menuOptions[e],o=n[i]();return typeof o=="object"&&(o=o.$id),s.forEach(function(e){e.value===o&&(e.selected="selected")}),a(n,r,e,s)}function l(e){var r=e.functionName,i=e.parentObj,s=e.parentName,o,u=r.replace(/^set/,"get");if(t.menuOptions[r]!==undefined)n.push(f(r,i,s,u));else if(typeof i[u]=="function")try{o=i[u](),typeof o=="object"&&(o=o.$id),n.push(a(i,s,r,o))}catch(l){}}var n=[];return i(t),s(t).forEach(function(e){l(e)}),o(),u()}}),ace.define("ace/ext/menu_tools/element_generator",["require","exports","module"],function(e,t,n){n.exports.createOption=function(t){var n,r=document.createElement("option");for(n in t)t.hasOwnProperty(n)&&(n==="selected"?r.setAttribute(n,t[n]):r[n]=t[n]);return r},n.exports.createCheckbox=function(t,n,r){var i=document.createElement("input");return i.setAttribute("type","checkbox"),i.setAttribute("id",t),i.setAttribute("name",t),i.setAttribute("value",n),i.setAttribute("class",r),n&&i.setAttribute("checked","checked"),i},n.exports.createInput=function(t,n,r){var i=document.createElement("input");return i.setAttribute("type","text"),i.setAttribute("id",t),i.setAttribute("name",t),i.setAttribute("value",n),i.setAttribute("class",r),i},n.exports.createLabel=function(t,n){var r=document.createElement("label");return r.setAttribute("for",n),r.textContent=t,r},n.exports.createSelection=function(t,r,i){var s=document.createElement("select");return s.setAttribute("id",t),s.setAttribute("name",t),s.setAttribute("class",i),r.forEach(function(e){s.appendChild(n.exports.createOption(e))}),s}}),ace.define("ace/ext/menu_tools/add_editor_menu_options",["require","exports","module","ace/ext/modelist","ace/ext/themelist"],function(e,t,n){n.exports.addEditorMenuOptions=function(n){var r=e("../modelist"),i=e("../themelist");n.menuOptions={setNewLineMode:[{textContent:"unix",value:"unix"},{textContent:"windows",value:"windows"},{textContent:"auto",value:"auto"}],setTheme:[],setMode:[],setKeyboardHandler:[{textContent:"ace",value:""},{textContent:"vim",value:"ace/keyboard/vim"},{textContent:"emacs",value:"ace/keyboard/emacs"}]},n.menuOptions.setTheme=i.themes.map(function(e){return{textContent:e.caption,value:e.theme}}),n.menuOptions.setMode=r.modes.map(function(e){return{textContent:e.name,value:e.mode}})}}),ace.define("ace/ext/modelist",["require","exports","module"],function(e,t,n){function i(e){var t=a.text,n=e.split(/[\/\\]/).pop();for(var i=0;i<r.length;i++)if(r[i].supportsFile(n)){t=r[i];break}return t}var r=[],s=function(e,t,n){this.name=e,this.caption=t,this.mode="ace/mode/"+e,this.extensions=n;if(/\^/.test(n))var r=n.replace(/\|(\^)?/g,function(e,t){return"$|"+(t?"^":"^.*\\.")})+"$";else var r="^.*\\.("+n+")$";this.extRe=new RegExp(r,"gi")};s.prototype.supportsFile=function(e){return e.match(this.extRe)};var o={ABAP:["abap"],ActionScript:["as"],ADA:["ada|adb"],Apache_Conf:["^htaccess|^htgroups|^htpasswd|^conf|htaccess|htgroups|htpasswd"],AsciiDoc:["asciidoc"],Assembly_x86:["asm"],AutoHotKey:["ahk"],BatchFile:["bat|cmd"],C9Search:["c9search_results"],C_Cpp:["cpp|c|cc|cxx|h|hh|hpp"],Clojure:["clj"],Cobol:["CBL|COB"],coffee:["coffee|cf|cson|^Cakefile"],ColdFusion:["cfm"],CSharp:["cs"],CSS:["css"],Curly:["curly"],D:["d|di"],Dart:["dart"],Diff:["diff|patch"],Dot:["dot"],Erlang:["erl|hrl"],EJS:["ejs"],Forth:["frt|fs|ldr"],FTL:["ftl"],Glsl:["glsl|frag|vert"],golang:["go"],Groovy:["groovy"],HAML:["haml"],Handlebars:["hbs|handlebars|tpl|mustache"],Haskell:["hs"],haXe:["hx"],HTML:["html|htm|xhtml"],HTML_Ruby:["erb|rhtml|html.erb"],INI:["ini|conf|cfg|prefs"],Jack:["jack"],Jade:["jade"],Java:["java"],JavaScript:["js|jsm"],JSON:["json"],JSONiq:["jq"],JSP:["jsp"],JSX:["jsx"],Julia:["jl"],LaTeX:["tex|latex|ltx|bib"],LESS:["less"],Liquid:["liquid"],Lisp:["lisp"],LiveScript:["ls"],LogiQL:["logic|lql"],LSL:["lsl"],Lua:["lua"],LuaPage:["lp"],Lucene:["lucene"],Makefile:["^Makefile|^GNUmakefile|^makefile|^OCamlMakefile|make"],MATLAB:["matlab"],Markdown:["md|markdown"],MEL:["mel"],MySQL:["mysql"],MUSHCode:["mc|mush"],Nix:["nix"],ObjectiveC:["m|mm"],OCaml:["ml|mli"],Pascal:["pas|p"],Perl:["pl|pm"],pgSQL:["pgsql"],PHP:["php|phtml"],Powershell:["ps1"],Prolog:["plg|prolog"],Properties:["properties"],Protobuf:["proto"],Python:["py"],R:["r"],RDoc:["Rd"],RHTML:["Rhtml"],Ruby:["rb|ru|gemspec|rake|^Guardfile|^Rakefile|^Gemfile"],Rust:["rs"],SASS:["sass"],SCAD:["scad"],Scala:["scala"],Scheme:["scm|rkt"],SCSS:["scss"],SH:["sh|bash|^.bashrc"],SJS:["sjs"],Space:["space"],snippets:["snippets"],Soy_Template:["soy"],SQL:["sql"],Stylus:["styl|stylus"],SVG:["svg"],Tcl:["tcl"],Tex:["tex"],Text:["txt"],Textile:["textile"],Toml:["toml"],Twig:["twig"],Typescript:["ts|typescript|str"],VBScript:["vbs"],Velocity:["vm"],Verilog:["v|vh|sv|svh"],XML:["xml|rdf|rss|wsdl|xslt|atom|mathml|mml|xul|xbl"],XQuery:["xq"],YAML:["yaml|yml"]},u={ObjectiveC:"Objective-C",CSharp:"C#",golang:"Go",C_Cpp:"C/C++",coffee:"CoffeeScript",HTML_Ruby:"HTML (Ruby)",FTL:"FreeMarker"},a={};for(var f in o){var l=o[f],c=(u[f]||f).replace(/_/g," "),h=f.toLowerCase(),p=new s(h,c,l[0]);a[h]=p,r.push(p)}n.exports={getModeForPath:i,modes:r,modesByName:a}}),ace.define("ace/ext/themelist",["require","exports","module"],function(e,t,n){var r=[["Chrome"],["Clouds"],["Crimson Editor"],["Dawn"],["Dreamweaver"],["Eclipse"],["GitHub"],["Solarized Light"],["TextMate"],["Tomorrow"],["XCode"],["Kuroir"],["KatzenMilch"],["Ambiance","ambiance","dark"],["Chaos","chaos","dark"],["Clouds Midnight","clouds_midnight","dark"],["Cobalt","cobalt","dark"],["idle Fingers","idle_fingers","dark"],["krTheme","kr_theme","dark"],["Merbivore","merbivore","dark"],["Merbivore Soft","merbivore_soft","dark"],["Mono Industrial","mono_industrial","dark"],["Monokai","monokai","dark"],["Pastel on dark","pastel_on_dark","dark"],["Solarized Dark","solarized_dark","dark"],["Terminal","terminal","dark"],["Tomorrow Night","tomorrow_night","dark"],["Tomorrow Night Blue","tomorrow_night_blue","dark"],["Tomorrow Night Bright","tomorrow_night_bright","dark"],["Tomorrow Night 80s","tomorrow_night_eighties","dark"],["Twilight","twilight","dark"],["Vibrant Ink","vibrant_ink","dark"]];t.themesByName={},t.themes=r.map(function(e){var n=e[1]||e[0].replace(/ /g,"_").toLowerCase(),r={caption:e[0],theme:"ace/theme/"+n,isDark:e[2]=="dark",name:n};return t.themesByName[n]=r,r})}),ace.define("ace/ext/menu_tools/get_set_functions",["require","exports","module"],function(e,t,n){n.exports.getSetFunctions=function(t){var n=[],r={editor:t,session:t.session,renderer:t.renderer},i=[],s=["setOption","setUndoManager","setDocument","setValue","setBreakpoints","setScrollTop","setScrollLeft","setSelectionStyle","setWrapLimitRange"];return["renderer","session","editor"].forEach(function(e){var t=r[e],o=e;for(var u in t)s.indexOf(u)===-1&&/^set/.test(u)&&i.indexOf(u)===-1&&(i.push(u),n.push({functionName:u,parentObj:t,parentName:o}))}),n}}),ace.define("ace/ext/menu_tools/overlay_page",["require","exports","module","ace/lib/dom"],function(e,t,n){var r=e("../../lib/dom"),i="#ace_settingsmenu, #kbshortcutmenu {background-color: #F7F7F7;color: black;box-shadow: -5px 4px 5px rgba(126, 126, 126, 0.55);padding: 1em 0.5em 2em 1em;overflow: auto;position: absolute;margin: 0;bottom: 0;right: 0;top: 0;z-index: 9991;cursor: default;}.ace_dark #ace_settingsmenu, .ace_dark #kbshortcutmenu {box-shadow: -20px 10px 25px rgba(126, 126, 126, 0.25);background-color: rgba(255, 255, 255, 0.6);color: black;}.ace_optionsMenuEntry:hover {background-color: rgba(100, 100, 100, 0.1);-webkit-transition: all 0.5s;transition: all 0.3s}.ace_closeButton {background: rgba(245, 146, 146, 0.5);border: 1px solid #F48A8A;border-radius: 50%;padding: 7px;position: absolute;right: -8px;top: -8px;z-index: 1000;}.ace_closeButton{background: rgba(245, 146, 146, 0.9);}.ace_optionsMenuKey {color: darkslateblue;font-weight: bold;}.ace_optionsMenuCommand {color: darkcyan;font-weight: normal;}";r.importCssString(i),n.exports.overlayPage=function(t,n,i,s,o,u){function l(e){e.keyCode===27&&a.click()}i=i?"top: "+i+";":"",o=o?"bottom: "+o+";":"",s=s?"right: "+s+";":"",u=u?"left: "+u+";":"";var a=document.createElement("div"),f=document.createElement("div");a.style.cssText="margin: 0; padding: 0; position: fixed; top:0; bottom:0; left:0; right:0;z-index: 9990; background-color: rgba(0, 0, 0, 0.3);",a.addEventListener("click",function(){document.removeEventListener("keydown",l),a.parentNode.removeChild(a),t.focus(),a=null}),document.addEventListener("keydown",l),f.style.cssText=i+s+o+u,f.addEventListener("click",function(e){e.stopPropagation()});var c=r.createElement("div");c.style.position="relative";var h=r.createElement("div");h.className="ace_closeButton",h.addEventListener("click",function(){a.click()}),c.appendChild(h),f.appendChild(c),f.appendChild(n),a.appendChild(f),document.body.appendChild(a),t.blur()}})
|
framework/js/ace/ext-statusbar.js
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
ace.define("ace/ext/statusbar",["require","exports","module","ace/lib/dom","ace/lib/lang"],function(e,t,n){var r=e("ace/lib/dom"),i=e("ace/lib/lang"),s=function(e,t){this.element=r.createElement("div"),this.element.className="ace_status-indicator",this.element.style.cssText="display: inline-block;",t.appendChild(this.element);var n=i.delayedCall(function(){this.updateStatus(e)}.bind(this));e.on("changeStatus",function(){n.schedule(100)}),e.on("changeSelection",function(){n.schedule(100)})};(function(){this.updateStatus=function(e){function n(e,n){e&&t.push(e,n||"|")}var t=[];e.$vimModeHandler?n(e.$vimModeHandler.getStatusText()):e.commands.recording&&n("REC");var r=e.selection.lead;n(r.row+":"+r.column," ");if(!e.selection.isEmpty()){var i=e.getSelectionRange();n("("+(i.end.row-i.start.row)+":"+(i.end.column-i.start.column)+")")}t.pop(),this.element.textContent=t.join("")}}).call(s.prototype),t.StatusBar=s})
|
framework/js/ace/keybinding-emacs.js
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
ace.define("ace/keyboard/emacs",["require","exports","module","ace/lib/dom","ace/incremental_search","ace/commands/incremental_search_commands","ace/keyboard/hash_handler","ace/lib/keys"],function(e,t,n){var r=e("../lib/dom");e("../incremental_search");var i=e("../commands/incremental_search_commands"),s=function(e,t){var n=this.scroller.getBoundingClientRect(),r=Math.floor((e+this.scrollLeft-n.left-this.$padding)/this.characterWidth),i=Math.floor((t+this.scrollTop-n.top)/this.lineHeight);return this.session.screenToDocumentPosition(i,r)},o=e("./hash_handler").HashHandler;t.handler=new o,t.handler.isEmacs=!0,t.handler.$id="ace/keyboard/emacs";var u=!1,a,f;t.handler.attach=function(e){u||(u=!0,r.importCssString(" .emacs-mode .ace_cursor{ border: 2px rgba(50,250,50,0.8) solid!important; -moz-box-sizing: border-box!important; -webkit-box-sizing: border-box!important; box-sizing: border-box!important; background-color: rgba(0,250,0,0.9); opacity: 0.5; } .emacs-mode .ace_hidden-cursors .ace_cursor{ opacity: 1; background-color: transparent; } .emacs-mode .ace_overwrite-cursors .ace_cursor { opacity: 1; background-color: transparent; border-width: 0 0 2px 2px !important; } .emacs-mode .ace_text-layer { z-index: 4 } .emacs-mode .ace_cursor-layer { z-index: 2 }","emacsMode")),a=e.session.$selectLongWords,e.session.$selectLongWords=!0,f=e.session.$useEmacsStyleLineStart,e.session.$useEmacsStyleLineStart=!0,e.session.$emacsMark=null,e.session.$emacsMarkRing=e.session.$emacsMarkRing||[],e.emacsMark=function(){return this.session.$emacsMark},e.setEmacsMark=function(e){this.session.$emacsMark=e},e.pushEmacsMark=function(e,t){var n=this.session.$emacsMark;n&&this.session.$emacsMarkRing.push(n),!e||t?this.setEmacsMark(e):this.session.$emacsMarkRing.push(e)},e.popEmacsMark=function(){var e=this.emacsMark();return e?(this.setEmacsMark(null),e):this.session.$emacsMarkRing.pop()},e.getLastEmacsMark=function(e){return this.session.$emacsMark||this.session.$emacsMarkRing.slice(-1)[0]},e.on("click",c),e.on("changeSession",l),e.renderer.screenToTextCoordinates=s,e.setStyle("emacs-mode"),e.commands.addCommands(v),t.handler.platform=e.commands.platform,e.$emacsModeHandler=this,e.addEventListener("copy",this.onCopy),e.addEventListener("paste",this.onPaste)},t.handler.detach=function(e){delete e.renderer.screenToTextCoordinates,e.session.$selectLongWords=a,e.session.$useEmacsStyleLineStart=f,e.removeEventListener("click",c),e.removeEventListener("changeSession",l),e.unsetStyle("emacs-mode"),e.commands.removeCommands(v),e.removeEventListener("copy",this.onCopy),e.removeEventListener("paste",this.onPaste)};var l=function(e){e.oldSession&&(e.oldSession.$selectLongWords=a,e.oldSession.$useEmacsStyleLineStart=f),a=e.session.$selectLongWords,e.session.$selectLongWords=!0,f=e.session.$useEmacsStyleLineStart,e.session.$useEmacsStyleLineStart=!0,e.session.hasOwnProperty("$emacsMark")||(e.session.$emacsMark=null),e.session.hasOwnProperty("$emacsMarkRing")||(e.session.$emacsMarkRing=[])},c=function(e){e.editor.session.$emacsMark=null},h=e("../lib/keys").KEY_MODS,p={C:"ctrl",S:"shift",M:"alt",CMD:"command"},d=["C-S-M-CMD","S-M-CMD","C-M-CMD","C-S-CMD","C-S-M","M-CMD","S-CMD","S-M","C-CMD","C-M","C-S","CMD","M","S","C"];d.forEach(function(e){var t=0;e.split("-").forEach(function(e){t|=h[p[e]]}),p[t]=e.toLowerCase()+"-"}),t.handler.onCopy=function(e,n){if(n.$handlesEmacsOnCopy)return;n.$handlesEmacsOnCopy=!0,t.handler.commands.killRingSave.exec(n),delete n.$handlesEmacsOnCopy},t.handler.onPaste=function(e,t){t.pushEmacsMark(t.getCursorPosition())},t.handler.bindKey=function(e,t){if(!e)return;var n=this.commandKeyBinding;e.split("|").forEach(function(e){e=e.toLowerCase(),n[e]=t;var r=e.split(" ").slice(0,-1);r.reduce(function(e,t,n){var r=e[n-1]?e[n-1]+" ":"";return e.concat([r+t])},[]).forEach(function(e){n[e]||(n[e]="null")})},this)},t.handler.handleKeyboard=function(e,t,n,r){var i=e.editor;if(t==-1){i.pushEmacsMark();if(e.count){var s=Array(e.count+1).join(n);return e.count=null,{command:"insertstring",args:s}}}if(n=="\0")return undefined;var o=p[t];if(o=="c-"||e.universalArgument){var u=String(e.count||0),a=parseInt(n[n.length-1]);if(typeof a=="number"&&!isNaN(a))return e.count=parseInt(u+a),{command:"null"};e.universalArgument&&(e.count=4)}e.universalArgument=!1,o&&(n=o+n),e.keyChain&&(n=e.keyChain+=" "+n);var f=this.commandKeyBinding[n];e.keyChain=f=="null"?n:"";if(!f)return undefined;if(f==="null")return{command:"null"};if(f==="universalArgument")return e.universalArgument=!0,{command:"null"};var l;typeof f!="string"&&(l=f.args,f.command&&(f=f.command),f==="goorselect"&&(f=i.emacsMark()?l[1]:l[0],l=null));if(typeof f=="string"){(f==="insertstring"||f==="splitline"||f==="togglecomment")&&i.pushEmacsMark(),f=this.commands[f]||i.commands.commands[f];if(!f)return undefined}!f.readonly&&!f.isYank&&(e.lastCommand=null);if(e.count){var a=e.count;e.count=0;if(!f||!f.handlesCount)return{args:l,command:{exec:function(e,t){for(var n=0;n<a;n++)f.exec(e,t)}}};l||(l={}),typeof l=="object"&&(l.count=a)}return{command:f,args:l}},t.emacsKeys={"Up|C-p":{command:"goorselect",args:["golineup","selectup"]},"Down|C-n":{command:"goorselect",args:["golinedown","selectdown"]},"Left|C-b":{command:"goorselect",args:["gotoleft","selectleft"]},"Right|C-f":{command:"goorselect",args:["gotoright","selectright"]},"C-Left|M-b":{command:"goorselect",args:["gotowordleft","selectwordleft"]},"C-Right|M-f":{command:"goorselect",args:["gotowordright","selectwordright"]},"Home|C-a":{command:"goorselect",args:["gotolinestart","selecttolinestart"]},"End|C-e":{command:"goorselect",args:["gotolineend","selecttolineend"]},"C-Home|S-M-,":{command:"goorselect",args:["gotostart","selecttostart"]},"C-End|S-M-.":{command:"goorselect",args:["gotoend","selecttoend"]},"S-Up|S-C-p":"selectup","S-Down|S-C-n":"selectdown","S-Left|S-C-b":"selectleft","S-Right|S-C-f":"selectright","S-C-Left|S-M-b":"selectwordleft","S-C-Right|S-M-f":"selectwordright","S-Home|S-C-a":"selecttolinestart","S-End|S-C-e":"selecttolineend","S-C-Home":"selecttostart","S-C-End":"selecttoend","C-l":"recenterTopBottom","M-s":"centerselection","M-g":"gotoline","C-x C-p":"selectall","C-Down":{command:"goorselect",args:["gotopagedown","selectpagedown"]},"C-Up":{command:"goorselect",args:["gotopageup","selectpageup"]},"PageDown|C-v":{command:"goorselect",args:["gotopagedown","selectpagedown"]},"PageUp|M-v":{command:"goorselect",args:["gotopageup","selectpageup"]},"S-C-Down":"selectpagedown","S-C-Up":"selectpageup","C-s":"iSearch","C-r":"iSearchBackwards","M-C-s":"findnext","M-C-r":"findprevious","S-M-5":"replace",Backspace:"backspace","Delete|C-d":"del","Return|C-m":{command:"insertstring",args:"\n"},"C-o":"splitline","M-d|C-Delete":{command:"killWord",args:"right"},"C-Backspace|M-Backspace|M-Delete":{command:"killWord",args:"left"},"C-k":"killLine","C-y|S-Delete":"yank","M-y":"yankRotate","C-g":"keyboardQuit","C-w":"killRegion","M-w":"killRingSave","C-Space":"setMark","C-x C-x":"exchangePointAndMark","C-t":"transposeletters","M-u":"touppercase","M-l":"tolowercase","M-/":"autocomplete","C-u":"universalArgument","M-;":"togglecomment","C-/|C-x u|S-C--|C-z":"undo","S-C-/|S-C-x u|C--|S-C-z":"redo","C-x r":"selectRectangularRegion","M-x":{command:"focusCommandLine",args:"M-x "}},t.handler.bindKeys(t.emacsKeys),t.handler.addCommands({recenterTopBottom:function(e){var t=e.renderer,n=t.$cursorLayer.getPixelPosition(),r=t.$size.scrollerHeight-t.lineHeight,i=t.scrollTop;Math.abs(n.top-i)<2?i=n.top-r:Math.abs(n.top-i-r*.5)<2?i=n.top:i=n.top-r*.5,e.session.setScrollTop(i)},selectRectangularRegion:function(e){e.multiSelect.toggleBlockSelection()},setMark:{exec:function(e,t){if(t&&t.count){var n=e.popEmacsMark();n&&e.selection.moveCursorToPosition(n);return}var n=e.emacsMark(),r=!0;if(r&&(n||!e.selection.isEmpty())){e.pushEmacsMark(),e.clearSelection();return}if(n){var i=e.getCursorPosition();if(e.selection.isEmpty()&&n.row==i.row&&n.column==i.column){e.pushEmacsMark();return}}n=e.getCursorPosition(),e.setEmacsMark(n),e.selection.setSelectionAnchor(n.row,n.column)},readonly:!0,handlesCount:!0,multiSelectAction:"forEach"},exchangePointAndMark:{exec:function(e,t){var n=e.selection;if(t.count){var r=e.getCursorPosition();n.clearSelection(),n.moveCursorToPosition(e.popEmacsMark()),e.pushEmacsMark(r);return}var i=e.getLastEmacsMark(),s=n.getRange();if(s.isEmpty()){n.selectToPosition(i);return}n.setSelectionRange(s,!n.isBackwards())},readonly:!0,handlesCount:!0,multiSelectAction:"forEach"},killWord:{exec:function(e,n){e.clearSelection(),n=="left"?e.selection.selectWordLeft():e.selection.selectWordRight();var r=e.getSelectionRange(),i=e.session.getTextRange(r);t.killRing.add(i),e.session.remove(r),e.clearSelection()},multiSelectAction:"forEach"},killLine:function(e){e.pushEmacsMark(null);var n=e.getCursorPosition();n.column==0&&e.session.doc.getLine(n.row).length==0?e.selection.selectLine():(e.clearSelection(),e.selection.selectLineEnd());var r=e.getSelectionRange(),i=e.session.getTextRange(r);t.killRing.add(i),e.session.remove(r),e.clearSelection()},yank:function(e){e.onPaste(t.killRing.get()||""),e.keyBinding.$data.lastCommand="yank"},yankRotate:function(e){if(e.keyBinding.$data.lastCommand!="yank")return;e.undo(),e.onPaste(t.killRing.rotate()),e.keyBinding.$data.lastCommand="yank"},killRegion:{exec:function(e){t.killRing.add(e.getCopyText()),e.commands.byName.cut.exec(e)},readonly:!0,multiSelectAction:"forEach"},killRingSave:{exec:function(e){t.killRing.add(e.getCopyText()),setTimeout(function(){var t=e.selection,n=t.getRange();e.pushEmacsMark(t.isBackwards()?n.end:n.start),t.clearSelection()},0)},readonly:!0},keyboardQuit:function(e){e.selection.clearSelection(),e.setEmacsMark(null)},focusCommandLine:function(e,t){e.showCommandLine&&e.showCommandLine(t)}}),t.handler.addCommands(i.iSearchStartCommands);var v=t.handler.commands;v.yank.isYank=!0,v.yankRotate.isYank=!0,t.killRing={$data:[],add:function(e){e&&this.$data.push(e),this.$data.length>30&&this.$data.shift()},get:function(e){return e=e||1,this.$data.slice(this.$data.length-e,this.$data.length).reverse().join("\n")},pop:function(){return this.$data.length>1&&this.$data.pop(),this.get()},rotate:function(){return this.$data.unshift(this.$data.pop()),this.get()}}}),ace.define("ace/incremental_search",["require","exports","module","ace/lib/oop","ace/range","ace/search","ace/search_highlight","ace/commands/incremental_search_commands","ace/lib/dom","ace/commands/command_manager","ace/editor","ace/config"],function(e,t,n){function f(){this.$options={wrap:!1,skipCurrent:!1},this.$keyboardHandler=new a(this)}var r=e("./lib/oop"),i=e("./range").Range,s=e("./search").Search,o=e("./search_highlight").SearchHighlight,u=e("./commands/incremental_search_commands"),a=u.IncrementalSearchKeyboardHandler;r.inherits(f,s),function(){this.activate=function(e,t){this.$editor=e,this.$startPos=this.$currentPos=e.getCursorPosition(),this.$options.needle="",this.$options.backwards=t,e.keyBinding.addKeyboardHandler(this.$keyboardHandler),this.$mousedownHandler=e.addEventListener("mousedown",this.onMouseDown.bind(this)),this.selectionFix(e),this.statusMessage(!0)},this.deactivate=function(e){this.cancelSearch(e),this.$editor.keyBinding.removeKeyboardHandler(this.$keyboardHandler),this.$mousedownHandler&&(this.$editor.removeEventListener("mousedown",this.$mousedownHandler),delete this.$mousedownHandler),this.message("")},this.selectionFix=function(e){e.selection.isEmpty()&&!e.session.$emacsMark&&e.clearSelection()},this.highlight=function(e){var t=this.$editor.session,n=t.$isearchHighlight=t.$isearchHighlight||t.addDynamicMarker(new o(null,"ace_isearch-result","text"));n.setRegexp(e),t._emit("changeBackMarker")},this.cancelSearch=function(e){var t=this.$editor;return this.$prevNeedle=this.$options.needle,this.$options.needle="",e?(t.moveCursorToPosition(this.$startPos),this.$currentPos=this.$startPos):t.pushEmacsMark&&t.pushEmacsMark(this.$startPos,!1),this.highlight(null),i.fromPoints(this.$currentPos,this.$currentPos)},this.highlightAndFindWithNeedle=function(e,t){if(!this.$editor)return null;var n=this.$options;t&&(n.needle=t.call(this,n.needle||"")||"");if(n.needle.length===0)return this.statusMessage(!0),this.cancelSearch(!0);n.start=this.$currentPos;var r=this.$editor.session,s=this.find(r);return s&&(n.backwards&&(s=i.fromPoints(s.end,s.start)),this.$editor.moveCursorToPosition(s.end),e&&(this.$currentPos=s.end),this.highlight(n.re)),this.statusMessage(s),s},this.addChar=function(e){return this.highlightAndFindWithNeedle(!1,function(t){return t+e})},this.removeChar=function(e){return this.highlightAndFindWithNeedle(!1,function(e){return e.length>0?e.substring(0,e.length-1):e})},this.next=function(e){return e=e||{},this.$options.backwards=!!e.backwards,this.$currentPos=this.$editor.getCursorPosition(),this.highlightAndFindWithNeedle(!0,function(t){return e.useCurrentOrPrevSearch&&t.length===0?this.$prevNeedle||"":t})},this.onMouseDown=function(e){return this.deactivate(),!0},this.statusMessage=function(e){var t=this.$options,n="";n+=t.backwards?"reverse-":"",n+="isearch: "+t.needle,n+=e?"":" (not found)",this.message(n)},this.message=function(e){this.$editor.showCommandLine?(this.$editor.showCommandLine(e),this.$editor.focus()):console.log(e)}}.call(f.prototype),t.IncrementalSearch=f;var l=e("./lib/dom");l.importCssString&&l.importCssString(".ace_marker-layer .ace_isearch-result { position: absolute; z-index: 6; -moz-box-sizing: border-box; -webkit-box-sizing: border-box; box-sizing: border-box;}div.ace_isearch-result { border-radius: 4px; background-color: rgba(255, 200, 0, 0.5); box-shadow: 0 0 4px rgb(255, 200, 0);}.ace_dark div.ace_isearch-result { background-color: rgb(100, 110, 160); box-shadow: 0 0 4px rgb(80, 90, 140);}","incremental-search-highlighting");var c=e("./commands/command_manager");(function(){this.setupIncrementalSearch=function(e,t){if(this.usesIncrementalSearch==t)return;this.usesIncrementalSearch=t;var n=u.iSearchStartCommands,r=t?"addCommands":"removeCommands";this[r](n)}}).call(c.CommandManager.prototype);var h=e("./editor").Editor;e("./config").defineOptions(h.prototype,"editor",{useIncrementalSearch:{set:function(e){this.keyBinding.$handlers.forEach(function(t){t.setupIncrementalSearch&&t.setupIncrementalSearch(this,e)}),this._emit("incrementalSearchSettingChanged",{isEnabled:e})}}})}),ace.define("ace/commands/incremental_search_commands",["require","exports","module","ace/config","ace/lib/oop","ace/keyboard/hash_handler","ace/commands/occur_commands"],function(e,t,n){function u(e){this.$iSearch=e}var r=e("../config"),i=e("../lib/oop"),s=e("../keyboard/hash_handler").HashHandler,o=e("./occur_commands").occurStartCommand;t.iSearchStartCommands=[{name:"iSearch",bindKey:{win:"Ctrl-F",mac:"Command-F"},exec:function(e,t){r.loadModule(["core","ace/incremental_search"],function(n){var r=n.iSearch=n.iSearch||new n.IncrementalSearch;r.activate(e,t.backwards),t.jumpToFirstMatch&&r.next(t)})},readOnly:!0},{name:"iSearchBackwards",exec:function(e,t){e.execCommand("iSearch",{backwards:!0})},readOnly:!0},{name:"iSearchAndGo",bindKey:{win:"Ctrl-K",mac:"Command-G"},exec:function(e,t){e.execCommand("iSearch",{jumpToFirstMatch:!0,useCurrentOrPrevSearch:!0})},readOnly:!0},{name:"iSearchBackwardsAndGo",bindKey:{win:"Ctrl-Shift-K",mac:"Command-Shift-G"},exec:function(e){e.execCommand("iSearch",{jumpToFirstMatch:!0,backwards:!0,useCurrentOrPrevSearch:!0})},readOnly:!0}],t.iSearchCommands=[{name:"restartSearch",bindKey:{win:"Ctrl-F",mac:"Command-F"},exec:function(e){e.cancelSearch(!0)},readOnly:!0,isIncrementalSearchCommand:!0},{name:"searchForward",bindKey:{win:"Ctrl-S|Ctrl-K",mac:"Ctrl-S|Command-G"},exec:function(e,t){t.useCurrentOrPrevSearch=!0,e.next(t)},readOnly:!0,isIncrementalSearchCommand:!0},{name:"searchBackward",bindKey:{win:"Ctrl-R|Ctrl-Shift-K",mac:"Ctrl-R|Command-Shift-G"},exec:function(e,t){t.useCurrentOrPrevSearch=!0,t.backwards=!0,e.next(t)},readOnly:!0,isIncrementalSearchCommand:!0},{name:"extendSearchTerm",exec:function(e,t){e.addChar(t)},readOnly:!0,isIncrementalSearchCommand:!0},{name:"extendSearchTermSpace",bindKey:"space",exec:function(e){e.addChar(" ")},readOnly:!0,isIncrementalSearchCommand:!0},{name:"shrinkSearchTerm",bindKey:"backspace",exec:function(e){e.removeChar()},readOnly:!0,isIncrementalSearchCommand:!0},{name:"confirmSearch",bindKey:"return",exec:function(e){e.deactivate()},readOnly:!0,isIncrementalSearchCommand:!0},{name:"cancelSearch",bindKey:"esc|Ctrl-G",exec:function(e){e.deactivate(!0)},readOnly:!0,isIncrementalSearchCommand:!0},{name:"occurisearch",bindKey:"Ctrl-O",exec:function(e){var t=i.mixin({},e.$options);e.deactivate(),o.exec(e.$editor,t)},readOnly:!0,isIncrementalSearchCommand:!0}],i.inherits(u,s),function(){this.attach=function(e){var n=this.$iSearch;s.call(this,t.iSearchCommands,e.commands.platform),this.$commandExecHandler=e.commands.addEventListener("exec",function(e){return e.command.isIncrementalSearchCommand?(e.stopPropagation(),e.preventDefault(),e.command.exec(n,e.args||{})):undefined})},this.detach=function(e){if(!this.$commandExecHandler)return;e.commands.removeEventListener("exec",this.$commandExecHandler),delete this.$commandExecHandler};var e=this.handleKeyboard;this.handleKeyboard=function(t,n,r,i){var s=e.call(this,t,n,r,i);if(s.command)return s;if(n==-1){var o=this.commands.extendSearchTerm;if(o)return{command:o,args:r}}return{command:"null",passEvent:n==0||n==4}}}.call(u.prototype),t.IncrementalSearchKeyboardHandler=u}),ace.define("ace/commands/occur_commands",["require","exports","module","ace/config","ace/occur","ace/keyboard/hash_handler","ace/lib/oop"],function(e,t,n){function f(){}var r=e("../config"),i=e("../occur").Occur,s={name:"occur",exec:function(e,t){var n=!!e.session.$occur,r=(new i).enter(e,t);r&&!n&&f.installIn(e)},readOnly:!0},o=[{name:"occurexit",bindKey:"esc|Ctrl-G",exec:function(e){var t=e.session.$occur;if(!t)return;t.exit(e,{}),e.session.$occur||f.uninstallFrom(e)},readOnly:!0},{name:"occuraccept",bindKey:"enter",exec:function(e){var t=e.session.$occur;if(!t)return;t.exit(e,{translatePosition:!0}),e.session.$occur||f.uninstallFrom(e)},readOnly:!0}],u=e("../keyboard/hash_handler").HashHandler,a=e("../lib/oop");a.inherits(f,u),function(){this.isOccurHandler=!0,this.attach=function(e){u.call(this,o,e.commands.platform),this.$editor=e};var e=this.handleKeyboard;this.handleKeyboard=function(t,n,r,i){var s=e.call(this,t,n,r,i);return s&&s.command?s:undefined}}.call(f.prototype),f.installIn=function(e){var t=new this;e.keyBinding.addKeyboardHandler(t),e.commands.addCommands(o)},f.uninstallFrom=function(e){e.commands.removeCommands(o);var t=e.getKeyboardHandler();t.isOccurHandler&&e.keyBinding.removeKeyboardHandler(t)},t.occurStartCommand=s}),ace.define("ace/occur",["require","exports","module","ace/lib/oop","ace/range","ace/search","ace/edit_session","ace/search_highlight","ace/lib/dom"],function(e,t,n){function a(){}var r=e("./lib/oop"),i=e("./range").Range,s=e("./search").Search,o=e("./edit_session").EditSession,u=e("./search_highlight").SearchHighlight;r.inherits(a,s),function(){this.enter=function(e,t){if(!t.needle)return!1;var n=e.getCursorPosition();this.displayOccurContent(e,t);var r=this.originalToOccurPosition(e.session,n);return e.moveCursorToPosition(r),!0},this.exit=function(e,t){var n=t.translatePosition&&e.getCursorPosition(),r=n&&this.occurToOriginalPosition(e.session,n);return this.displayOriginalContent(e),r&&e.moveCursorToPosition(r),!0},this.highlight=function(e,t){var n=e.$occurHighlight=e.$occurHighlight||e.addDynamicMarker(new u(null,"ace_occur-highlight","text"));n.setRegexp(t),e._emit("changeBackMarker")},this.displayOccurContent=function(e,t){this.$originalSession=e.session;var n=this.matchingLines(e.session,t),r=n.map(function(e){return e.content}),i=new o(r.join("\n"));i.$occur=this,i.$occurMatchingLines=n,e.setSession(i),this.highlight(i,t.re),i._emit("changeBackMarker")},this.displayOriginalContent=function(e){e.setSession(this.$originalSession)},this.originalToOccurPosition=function(e,t){var n=e.$occurMatchingLines,r={row:0,column:0};if(!n)return r;for(var i=0;i<n.length;i++)if(n[i].row===t.row)return{row:i,column:t.column};return r},this.occurToOriginalPosition=function(e,t){var n=e.$occurMatchingLines;return!n||!n[t.row]?t:{row:n[t.row].row,column:t.column}},this.matchingLines=function(e,t){t=r.mixin({},t);if(!e||!t.needle)return[];var n=new s;return n.set(t),n.findAll(e).reduce(function(t,n){var r=n.start.row,i=t[t.length-1];return i&&i.row===r?t:t.concat({row:r,content:e.getLine(r)})},[])}}.call(a.prototype);var f=e("./lib/dom");f.importCssString(".ace_occur-highlight {\n border-radius: 4px;\n background-color: rgba(87, 255, 8, 0.25);\n position: absolute;\n z-index: 4;\n -moz-box-sizing: border-box;\n -webkit-box-sizing: border-box;\n box-sizing: border-box;\n box-shadow: 0 0 4px rgb(91, 255, 50);\n}\n.ace_dark .ace_occur-highlight {\n background-color: rgb(80, 140, 85);\n box-shadow: 0 0 4px rgb(60, 120, 70);\n}\n","incremental-occur-highlighting"),t.Occur=a})
|
framework/js/ace/keybinding-vim.js
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
ace.define("ace/keyboard/vim",["require","exports","module","ace/keyboard/vim/commands","ace/keyboard/vim/maps/util","ace/lib/useragent"],function(e,t,n){var r=e("./vim/commands"),i=r.coreCommands,s=e("./vim/maps/util"),o=e("../lib/useragent"),u={i:{command:i.start},I:{command:i.startBeginning},a:{command:i.append},A:{command:i.appendEnd},"ctrl-f":{command:"gotopagedown"},"ctrl-b":{command:"gotopageup"}};t.handler={$id:"ace/keyboard/vim",handleMacRepeat:function(e,t,n){if(t==-1)e.inputChar=n,e.lastEvent="input";else if(e.inputChar&&e.$lastHash==t&&e.$lastKey==n){if(e.lastEvent=="input")e.lastEvent="input1";else if(e.lastEvent=="input1")return!0}else e.$lastHash=t,e.$lastKey=n,e.lastEvent="keypress"},updateMacCompositionHandlers:function(e,t){var n=function(e){if(s.currentMode!=="insert"){var t=this.textInput.getElement();t.blur(),t.focus(),t.value=e}else this.onCompositionUpdateOrig(e)},r=function(e){s.currentMode==="insert"&&this.onCompositionStartOrig(e)};t?e.onCompositionUpdateOrig||(e.onCompositionUpdateOrig=e.onCompositionUpdate,e.onCompositionUpdate=n,e.onCompositionStartOrig=e.onCompositionStart,e.onCompositionStart=r):e.onCompositionUpdateOrig&&(e.onCompositionUpdate=e.onCompositionUpdateOrig,e.onCompositionUpdateOrig=null,e.onCompositionStart=e.onCompositionStartOrig,e.onCompositionStartOrig=null)},handleKeyboard:function(e,t,n,s,a){if(t!=0&&(n==""||n=="\0"))return null;var f=e.editor;t==1&&(n="ctrl-"+n);if(n=="ctrl-c")return!o.isMac&&f.getCopyText()?(f.once("copy",function(){e.state=="start"?i.stop.exec(f):f.selection.clearSelection()}),{command:"null",passEvent:!0}):{command:i.stop};if(n=="esc"&&t==0||n=="ctrl-[")return{command:i.stop};if(e.state=="start"){o.isMac&&this.handleMacRepeat(e,t,n)&&(t=-1,n=e.inputChar);if(t==-1||t==1||t==0&&n.length>1)return r.inputBuffer.idle&&u[n]?u[n]:(r.inputBuffer.push(f,n),{command:"null",passEvent:!1});if(n.length==1&&(t==0||t==4))return{command:"null",passEvent:!0};if(n=="esc"&&t==0)return{command:i.stop}}else if(n=="ctrl-w")return{command:"removewordleft"}},attach:function(e){e.on("click",t.onCursorMove),s.currentMode!=="insert"&&r.coreCommands.stop.exec(e),e.$vimModeHandler=this,this.updateMacCompositionHandlers(e,!0)},detach:function(e){e.removeListener("click",t.onCursorMove),s.noMode(e),s.currentMode="normal",this.updateMacCompositionHandlers(e,!1)},actions:r.actions,getStatusText:function(){return s.currentMode=="insert"?"INSERT":s.onVisualMode?(s.onVisualLineMode?"VISUAL LINE ":"VISUAL ")+r.inputBuffer.status:r.inputBuffer.status}},t.onCursorMove=function(e){r.onCursorMove(e.editor,e),t.onCursorMove.scheduled=!1}}),ace.define("ace/keyboard/vim/commands",["require","exports","module","ace/lib/lang","ace/keyboard/vim/maps/util","ace/keyboard/vim/maps/motions","ace/keyboard/vim/maps/operators","ace/keyboard/vim/maps/aliases","ace/keyboard/vim/registers"],function(e,t,n){"never use strict";function y(e){g.previous={action:{action:{fn:e}}}}var r=e("../../lib/lang"),i=e("./maps/util"),s=e("./maps/motions"),o=e("./maps/operators"),u=e("./maps/aliases"),a=e("./registers"),f=1,l=2,c=3,h=4,p=8,d=function(t,n,r){while(0<n--)t.apply(this,r)},v=function(e){var t=e.renderer,n=t.$cursorLayer.getPixelPosition(),r=n.top,i=p*t.layerConfig.lineHeight;2*i>t.$size.scrollerHeight&&(i=t.$size.scrollerHeight/2),t.scrollTop>r-i&&t.session.setScrollTop(r-i),t.scrollTop+t.$size.scrollerHeight<r+i+t.lineHeight&&t.session.setScrollTop(r+i+t.lineHeight-t.$size.scrollerHeight)},m=t.actions={z:{param:!0,fn:function(e,t,n,r){switch(r){case"z":e.renderer.alignCursor(null,.5);break;case"t":e.renderer.alignCursor(null,0);break;case"b":e.renderer.alignCursor(null,1);break;case"c":e.session.onFoldWidgetClick(t.start.row,{domEvent:{target:{}}});break;case"o":e.session.onFoldWidgetClick(t.start.row,{domEvent:{target:{}}});break;case"C":e.session.foldAll();break;case"O":e.session.unfold()}}},r:{param:!0,fn:function(e,t,n,r){r&&r.length&&(r.length>1&&(r=r=="return"?"\n":r=="tab"?" ":r),d(function(){e.insert(r)},n||1),e.navigateLeft())}},R:{fn:function(e,t,n,r){i.insertMode(e),e.setOverwrite(!0)}},"~":{fn:function(e,t,n){d(function(){var t=e.selection.getRange();t.isEmpty()&&t.end.column++;var n=e.session.getTextRange(t),r=n.toUpperCase();r==n?e.navigateRight():e.session.replace(t,r)},n||1)}},"*":{fn:function(e,t,n,r){e.selection.selectWord(),e.findNext(),v(e);var i=e.selection.getRange();e.selection.setSelectionRange(i,!0)}},"#":{fn:function(e,t,n,r){e.selection.selectWord(),e.findPrevious(),v(e);var i=e.selection.getRange();e.selection.setSelectionRange(i,!0)}},m:{param:!0,fn:function(e,t,n,r){var i=e.session,s=i.vimMarkers||(i.vimMarkers={}),o=e.getCursorPosition();s[r]||(s[r]=e.session.doc.createAnchor(o)),s[r].setPosition(o.row,o.column,!0)}},n:{fn:function(e,t,n,r){var i=e.getLastSearchOptions();i.backwards=!1,e.selection.moveCursorRight(),e.selection.clearSelection(),e.findNext(i),v(e);var s=e.selection.getRange();s.end.row=s.start.row,s.end.column=s.start.column,e.selection.setSelectionRange(s,!0)}},N:{fn:function(e,t,n,r){var i=e.getLastSearchOptions();i.backwards=!0,e.findPrevious(i),v(e);var s=e.selection.getRange();s.end.row=s.start.row,s.end.column=s.start.column,e.selection.setSelectionRange(s,!0)}},v:{fn:function(e,t,n,r){e.selection.selectRight(),i.visualMode(e,!1)},acceptsMotion:!0},V:{fn:function(e,t,n,r){var s=e.getCursorPosition().row;e.selection.clearSelection(),e.selection.moveCursorTo(s,0),e.selection.selectLineEnd(),e.selection.visualLineStart=s,i.visualMode(e,!0)},acceptsMotion:!0},Y:{fn:function(e,t,n,r){i.copyLine(e)}},p:{fn:function(e,t,n,i){var s=a._default;e.setOverwrite(!1);if(s.isLine){var o=e.getCursorPosition();o.column=e.session.getLine(o.row).length;var u=r.stringRepeat("\n"+s.text,n||1);e.session.insert(o,u),e.moveCursorTo(o.row+1,0)}else e.navigateRight(),e.insert(r.stringRepeat(s.text,n||1)),e.navigateLeft();e.setOverwrite(!0),e.selection.clearSelection()}},P:{fn:function(e,t,n,i){var s=a._default;e.setOverwrite(!1);if(s.isLine){var o=e.getCursorPosition();o.column=0;var u=r.stringRepeat(s.text+"\n",n||1);e.session.insert(o,u),e.moveCursorToPosition(o)}else e.insert(r.stringRepeat(s.text,n||1));e.setOverwrite(!0),e.selection.clearSelection()}},J:{fn:function(e,t,n,r){var i=e.session;t=e.getSelectionRange();var s={row:t.start.row,column:t.start.column};n=n||t.end.row-t.start.row;var o=Math.min(s.row+(n||1),i.getLength()-1);t.start.column=i.getLine(s.row).length,t.end.column=i.getLine(o).length,t.end.row=o;var u="";for(var a=s.row;a<o;a++){var f=i.getLine(a+1);u+=" "+/^\s*(.*)$/.exec(f)[1]||""}i.replace(t,u),e.moveCursorTo(s.row,s.column)}},u:{fn:function(e,t,n,r){n=parseInt(n||1,10);for(var i=0;i<n;i++)e.undo();e.selection.clearSelection()}},"ctrl-r":{fn:function(e,t,n,r){n=parseInt(n||1,10);for(var i=0;i<n;i++)e.redo();e.selection.clearSelection()}},":":{fn:function(e,t,n,r){var i=":";n>1&&(i=".,.+"+n+i),e.showCommandLine&&e.showCommandLine(i)}},"/":{fn:function(e,t,n,r){e.showCommandLine&&e.showCommandLine("/")}},"?":{fn:function(e,t,n,r){e.showCommandLine&&e.showCommandLine("?")}},".":{fn:function(e,t,n,r){i.onInsertReplaySequence=g.lastInsertCommands;var s=g.previous;s&&g.exec(e,s.action,s.param)}},"ctrl-x":{fn:function(e,t,n,r){e.modifyNumber(-(n||1))}},"ctrl-a":{fn:function(e,t,n,r){e.modifyNumber(n||1)}}},g=t.inputBuffer={accepting:[f,l,c,h],currentCmd:null,currentCount:"",status:"",operator:null,motion:null,lastInsertCommands:[],push:function(e,t,n){var r=this.status,i=!0;this.idle=!1;var a=this.waitingForParam;/^numpad\d+$/i.test(t)&&(t=t.substr(6));if(a)this.exec(e,a,t);else if(t==="0"&&!this.currentCount.length||!/^\d+$/.test(t)||!this.isAccepting(f))if(!this.operator&&this.isAccepting(l)&&o[t])this.operator={ch:t,count:this.getCount()},this.currentCmd=l,this.accepting=[f,c,h],this.exec(e,{operator:this.operator});else if(s[t]&&this.isAccepting(c)){this.currentCmd=c;var p={operator:this.operator,motion:{ch:t,count:this.getCount()}};s[t].param?this.waitForParam(p):this.exec(e,p)}else if(u[t]&&this.isAccepting(c))u[t].operator.count=this.getCount(),this.exec(e,u[t]);else if(m[t]&&this.isAccepting(h)){var d={action:{fn:m[t].fn,count:this.getCount()}};m[t].param?this.waitForParam(d):this.exec(e,d),m[t].acceptsMotion&&(this.idle=!1)}else this.operator?(this.operator.count=this.getCount(),this.exec(e,{operator:this.operator},t)):(i=t.length==1,this.reset());else this.currentCount+=t,this.currentCmd=f,this.accepting=[f,l,c,h];return this.waitingForParam||this.motion||this.operator?this.status+=t:this.currentCount?this.status=this.currentCount:this.status&&(this.status=""),this.status!=r&&e._emit("changeStatus"),i},waitForParam:function(e){this.waitingForParam=e},getCount:function(){var e=this.currentCount;return this.currentCount="",e&&parseInt(e,10)},exec:function(e,t,n){var r=t.motion,u=t.operator,a=t.action;n||(n=t.param),u&&(this.previous={action:t,param:n});if(u&&!e.selection.isEmpty()){o[u.ch].selFn&&(o[u.ch].selFn(e,e.getSelectionRange(),u.count,n),this.reset());return}if(!r&&!a&&u&&n)o[u.ch].fn(e,null,u.count,n),this.reset();else if(r){var f=function(t){t&&typeof t=="function"&&(r.count&&!l.handlesCount?d(t,r.count,[e,null,r.count,n]):t(e,null,r.count,n))},l=s[r.ch],c=l.sel;u?c&&d(function(){f(l.sel),o[u.ch].fn(e,e.getSelectionRange(),u.count,n)},u.count||1):(i.onVisualMode||i.onVisualLineMode)&&c?f(l.sel):f(l.nav),this.reset()}else a&&(a.fn(e,e.getSelectionRange(),a.count,n),this.reset());b(e)},isAccepting:function(e){return this.accepting.indexOf(e)!==-1},reset:function(){this.operator=null,this.motion=null,this.currentCount="",this.status="",this.accepting=[f,l,c,h],this.idle=!0,this.waitingForParam=null}};t.coreCommands={start:{exec:function w(e){i.insertMode(e),y(w)}},startBeginning:{exec:function E(e){e.navigateLineStart(),i.insertMode(e),y(E)}},stop:{exec:function(t){g.reset(),i.onVisualMode=!1,i.onVisualLineMode=!1,g.lastInsertCommands=i.normalMode(t)}},append:{exec:function S(e){var t=e.getCursorPosition(),n=e.session.getLine(t.row).length;n&&e.navigateRight(),i.insertMode(e),y(S)}},appendEnd:{exec:function x(e){e.navigateLineEnd(),i.insertMode(e),y(x)}}};var b=t.onCursorMove=function(e,t){if(i.currentMode==="insert"||b.running)return;if(!e.selection.isEmpty()){b.running=!0;if(i.onVisualLineMode){var n=e.selection.visualLineStart,r=e.getCursorPosition().row;if(n<=r){var s=e.session.getLine(r);e.selection.clearSelection(),e.selection.moveCursorTo(n,0),e.selection.selectTo(r,s.length)}else{var s=e.session.getLine(n);e.selection.clearSelection(),e.selection.moveCursorTo(n,s.length),e.selection.selectTo(r,0)}}b.running=!1;return}t&&(i.onVisualLineMode||i.onVisualMode)&&(e.selection.clearSelection(),i.normalMode(e)),b.running=!0;var o=e.getCursorPosition(),u=e.session.getLine(o.row).length;u&&o.column===u&&e.navigateLeft(),b.running=!1}}),ace.define("ace/keyboard/vim/maps/util",["require","exports","module","ace/keyboard/vim/registers","ace/lib/dom"],function(e,t,n){var r=e("../registers"),i=e("../../../lib/dom");i.importCssString(".insert-mode .ace_cursor{ border-left: 2px solid #333333;}.ace_dark.insert-mode .ace_cursor{ border-left: 2px solid #eeeeee;}.normal-mode .ace_cursor{ border: 0!important; background-color: red; opacity: 0.5;}","vimMode"),n.exports={onVisualMode:!1,onVisualLineMode:!1,currentMode:"normal",noMode:function(e){e.unsetStyle("insert-mode"),e.unsetStyle("normal-mode"),e.commands.recording&&e.commands.toggleRecording(e),e.setOverwrite(!1)},insertMode:function(e){this.currentMode="insert",e.setStyle("insert-mode"),e.unsetStyle("normal-mode"),e.setOverwrite(!1),e.keyBinding.$data.buffer="",e.keyBinding.$data.state="insertMode",this.onVisualMode=!1,this.onVisualLineMode=!1,this.onInsertReplaySequence?(e.commands.macro=this.onInsertReplaySequence,e.commands.replay(e),this.onInsertReplaySequence=null,this.normalMode(e)):(e._emit("changeStatus"),e.commands.recording||e.commands.toggleRecording(e))},normalMode:function(e){this.currentMode="normal",e.unsetStyle("insert-mode"),e.setStyle("normal-mode"),e.clearSelection();var t;return e.getOverwrite()||(t=e.getCursorPosition(),t.column>0&&e.navigateLeft()),e.setOverwrite(!0),e.keyBinding.$data.buffer="",e.keyBinding.$data.state="start",this.onVisualMode=!1,this.onVisualLineMode=!1,e._emit("changeStatus"),e.commands.recording?(e.commands.toggleRecording(e),e.commands.macro):[]},visualMode:function(e,t){if(this.onVisualLineMode&&t||this.onVisualMode&&!t){this.normalMode(e);return}e.setStyle("insert-mode"),e.unsetStyle("normal-mode"),e._emit("changeStatus"),t?this.onVisualLineMode=!0:(this.onVisualMode=!0,this.onVisualLineMode=!1)},getRightNthChar:function(e,t,n,r){var i=e.getSession().getLine(t.row),s=i.substr(t.column+1).split(n);return r<s.length?s.slice(0,r).join(n).length:null},getLeftNthChar:function(e,t,n,r){var i=e.getSession().getLine(t.row),s=i.substr(0,t.column).split(n);return r<s.length?s.slice(-1*r).join(n).length:null},toRealChar:function(e){return e.length===1?e:/^shift-./.test(e)?e[e.length-1].toUpperCase():""},copyLine:function(e){var t=e.getCursorPosition();e.selection.clearSelection(),e.moveCursorTo(t.row,t.column),e.selection.selectLine(),r._default.isLine=!0,r._default.text=e.getCopyText().replace(/\n$/,""),e.selection.clearSelection(),e.moveCursorTo(t.row,t.column)}}}),ace.define("ace/keyboard/vim/registers",["require","exports","module"],function(e,t,n){"never use strict";n.exports={_default:{text:"",isLine:!1}}}),ace.define("ace/keyboard/vim/maps/motions",["require","exports","module","ace/keyboard/vim/maps/util","ace/search","ace/range"],function(e,t,n){function s(e){if(typeof e=="function"){var t=e;e=this}else var t=e.getPos;return e.nav=function(e,n,r,i){var s=t(e,n,r,i,!1);if(!s)return;e.clearSelection(),e.moveCursorTo(s.row,s.column)},e.sel=function(e,n,r,i){var s=t(e,n,r,i,!0);if(!s)return;e.selection.selectTo(s.row,s.column)},e}function h(e,t,n){return c.$options.needle=t,c.$options.backwards=n==-1,c.find(e.session)}var r=e("./util"),i=function(e,t){var n=e.renderer.getScrollTopRow(),r=e.getCursorPosition().row,i=r-n;t&&t.call(e),e.renderer.scrollToRow(e.getCursorPosition().row-i)},o=/[\s.\/\\()\"'-:,.;<>~!@#$%^&*|+=\[\]{}`~?]/,u=/[.\/\\()\"'-:,.;<>~!@#$%^&*|+=\[\]{}`~?]/,a=/\s/,f=function(e,t){var n=e.selection;this.range=n.getRange(),t=t||n.selectionLead,this.row=t.row,this.col=t.column;var r=e.session.getLine(this.row),i=e.session.getLength();this.ch=r[this.col]||"\n",this.skippedLines=0,this.next=function(){return this.ch=r[++this.col]||this.handleNewLine(1),this.ch},this.prev=function(){return this.ch=r[--this.col]||this.handleNewLine(-1),this.ch},this.peek=function(t){var n=r[this.col+t];return n?n:t==-1?"\n":this.col==r.length-1?"\n":e.session.getLine(this.row+1)[0]||"\n"},this.handleNewLine=function(t){if(t==1)return this.col==r.length?"\n":this.row==i-1?"":(this.col=0,this.row++,r=e.session.getLine(this.row),this.skippedLines++,r[0]||"\n");if(t==-1)return this.row===0?"":(this.row--,r=e.session.getLine(this.row),this.col=r.length,this.skippedLines--,"\n")},this.debug=function(){console.log(r.substring(0,this.col)+"|"+this.ch+"'"+this.col+"'"+r.substr(this.col+1))}},l=e("../../../search").Search,c=new l,p=e("../../../range").Range,d={};n.exports={w:new s(function(e){var t=new f(e);if(t.ch&&u.test(t.ch))while(t.ch&&u.test(t.ch))t.next();else while(t.ch&&!o.test(t.ch))t.next();while(t.ch&&a.test(t.ch)&&t.skippedLines<2)t.next();return t.skippedLines==2&&t.prev(),{column:t.col,row:t.row}}),W:new s(function(e){var t=new f(e);while(t.ch&&(!a.test(t.ch)||!!a.test(t.peek(1)))&&t.skippedLines<2)t.next();return t.skippedLines==2?t.prev():t.next(),{column:t.col,row:t.row}}),b:new s(function(e){var t=new f(e);t.prev();while(t.ch&&a.test(t.ch)&&t.skippedLines>-2)t.prev();if(t.ch&&u.test(t.ch))while(t.ch&&u.test(t.ch))t.prev();else while(t.ch&&!o.test(t.ch))t.prev();return t.ch&&t.next(),{column:t.col,row:t.row}}),B:new s(function(e){var t=new f(e);t.prev();while(t.ch&&(!!a.test(t.ch)||!a.test(t.peek(-1)))&&t.skippedLines>-2)t.prev();return t.skippedLines==-2&&t.next(),{column:t.col,row:t.row}}),e:new s(function(e){var t=new f(e);t.next();while(t.ch&&a.test(t.ch))t.next();if(t.ch&&u.test(t.ch))while(t.ch&&u.test(t.ch))t.next();else while(t.ch&&!o.test(t.ch))t.next();return t.ch&&t.prev(),{column:t.col,row:t.row}}),E:new s(function(e){var t=new f(e);t.next();while(t.ch&&(!!a.test(t.ch)||!a.test(t.peek(1))))t.next();return{column:t.col,row:t.row}}),l:{nav:function(e){var t=e.getCursorPosition(),n=t.column,r=e.session.getLine(t.row).length;r&&n!==r&&e.navigateRight()},sel:function(e){var t=e.getCursorPosition(),n=t.column,r=e.session.getLine(t.row).length;r&&n!==r&&e.selection.selectRight()}},h:{nav:function(e){var t=e.getCursorPosition();t.column>0&&e.navigateLeft()},sel:function(e){var t=e.getCursorPosition();t.column>0&&e.selection.selectLeft()}},H:{nav:function(e){var t=e.renderer.getScrollTopRow();e.moveCursorTo(t)},sel:function(e){var t=e.renderer.getScrollTopRow();e.selection.selectTo(t)}},M:{nav:function(e){var t=e.renderer.getScrollTopRow(),n=e.renderer.getScrollBottomRow(),r=t+(n-t)/2;e.moveCursorTo(r)},sel:function(e){var t=e.renderer.getScrollTopRow(),n=e.renderer.getScrollBottomRow(),r=t+(n-t)/2;e.selection.selectTo(r)}},L:{nav:function(e){var t=e.renderer.getScrollBottomRow();e.moveCursorTo(t)},sel:function(e){var t=e.renderer.getScrollBottomRow();e.selection.selectTo(t)}},k:{nav:function(e){e.navigateUp()},sel:function(e){e.selection.selectUp()}},j:{nav:function(e){e.navigateDown()},sel:function(e){e.selection.selectDown()}},i:{param:!0,sel:function(e,t,n,r){switch(r){case"w":e.selection.selectWord();break;case"W":e.selection.selectAWord();break;case"(":case"{":case"[":var i=e.getCursorPosition(),s=e.session.$findClosingBracket(r,i,/paren/);if(!s)return;var o=e.session.$findOpeningBracket(e.session.$brackets[r],i,/paren/);if(!o)return;o.column++,e.selection.setSelectionRange(p.fromPoints(o,s));break;case"'":case'"':case"/":var s=h(e,r,1);if(!s)return;var o=h(e,r,-1);if(!o)return;e.selection.setSelectionRange(p.fromPoints(o.end,s.start))}}},a:{param:!0,sel:function(e,t,n,r){switch(r){case"w":e.selection.selectAWord();break;case"W":e.selection.selectAWord();break;case"(":case"{":case"[":var i=e.getCursorPosition(),s=e.session.$findClosingBracket(r,i,/paren/);if(!s)return;var o=e.session.$findOpeningBracket(e.session.$brackets[r],i,/paren/);if(!o)return;s.column++,e.selection.setSelectionRange(p.fromPoints(o,s));break;case"'":case'"':case"/":var s=h(e,r,1);if(!s)return;var o=h(e,r,-1);if(!o)return;s.column++,e.selection.setSelectionRange(p.fromPoints(o.start,s.end))}}},f:new s({param:!0,handlesCount:!0,getPos:function(e,t,n,i,s,o){o||(d={ch:"f",param:i});var u=e.getCursorPosition(),a=r.getRightNthChar(e,u,i,n||1);if(typeof a=="number")return u.column+=a+(s?2:1),u}}),F:new s({param:!0,handlesCount:!0,getPos:function(e,t,n,i,s,o){o||(d={ch:"F",param:i});var u=e.getCursorPosition(),a=r.getLeftNthChar(e,u,i,n||1);if(typeof a=="number")return u.column-=a+1,u}}),t:new s({param:!0,handlesCount:!0,getPos:function(e,t,n,i,s,o){o||(d={ch:"t",param:i});var u=e.getCursorPosition(),a=r.getRightNthChar(e,u,i,n||1);if(o&&a==0&&!(n>1))var a=r.getRightNthChar(e,u,i,2);if(typeof a=="number")return u.column+=a+(s?1:0),u}}),T:new s({param:!0,handlesCount:!0,getPos:function(e,t,n,i,s,o){o||(d={ch:"T",param:i});var u=e.getCursorPosition(),a=r.getLeftNthChar(e,u,i,n||1);if(o&&a==0&&!(n>1))var a=r.getLeftNthChar(e,u,i,2);if(typeof a=="number")return u.column-=a,u}}),";":new s({handlesCount:!0,getPos:function(e,t,r,i,s){var o=d.ch;if(!o)return;return n.exports[o].getPos(e,t,r,d.param,s,!0)}}),",":new s({handlesCount:!0,getPos:function(e,t,r,i,s){var o=d.ch;if(!o)return;var u=o.toUpperCase();return o=o===u?o.toLowerCase():u,n.exports[o].getPos(e,t,r,d.param,s,!0)}}),"^":{nav:function(e){e.navigateLineStart()},sel:function(e){e.selection.selectLineStart()}},$:{nav:function(e){e.navigateLineEnd()},sel:function(e){e.selection.selectLineEnd()}},0:new s(function(e){return{row:e.selection.lead.row,column:0}}),G:{nav:function(e,t,n,r){!n&&n!==0&&(n=e.session.getLength()),e.gotoLine(n)},sel:function(e,t,n,r){!n&&n!==0&&(n=e.session.getLength()),e.selection.selectTo(n,0)}},g:{param:!0,nav:function(e,t,n,r){switch(r){case"m":console.log("Middle line");break;case"e":console.log("End of prev word");break;case"g":e.gotoLine(n||0);case"u":e.gotoLine(n||0);case"U":e.gotoLine(n||0)}},sel:function(e,t,n,r){switch(r){case"m":console.log("Middle line");break;case"e":console.log("End of prev word");break;case"g":e.selection.selectTo(n||0,0)}}},o:{nav:function(e,t,n,i){n=n||1;var s="";while(0<n--)s+="\n";s.length&&(e.navigateLineEnd(),e.insert(s),r.insertMode(e))}},O:{nav:function(e,t,n,i){var s=e.getCursorPosition().row;n=n||1;var o="";while(0<n--)o+="\n";o.length&&(s>0?(e.navigateUp(),e.navigateLineEnd(),e.insert(o)):(e.session.insert({row:0,column:0},o),e.navigateUp()),r.insertMode(e))}},"%":new s(function(e){var t=/[\[\]{}()]/g,n=e.getCursorPosition(),r=e.session.getLine(n.row)[n.column];if(!t.test(r)){var i=h(e,t);if(!i)return;n=i.start}var s=e.session.findMatchingBracket({row:n.row,column:n.column+1});return s}),"{":new s(function(e){var t=e.session,n=t.selection.lead.row;while(n>0&&!/\S/.test(t.getLine(n)))n--;while(/\S/.test(t.getLine(n)))n--;return{column:0,row:n}}),"}":new s(function(e){var t=e.session,n=t.getLength(),r=t.selection.lead.row;while(r<n&&!/\S/.test(t.getLine(r)))r++;while(/\S/.test(t.getLine(r)))r++;return{column:0,row:r}}),"ctrl-d":{nav:function(e,t,n,r){e.selection.clearSelection(),i(e,e.gotoPageDown)},sel:function(e,t,n,r){i(e,e.selectPageDown)}},"ctrl-u":{nav:function(e,t,n,r){e.selection.clearSelection(),i(e,e.gotoPageUp)},sel:function(e,t,n,r){i(e,e.selectPageUp)}},"`":new s({param:!0,handlesCount:!0,getPos:function(e,t,n,r,i){var s=e.session,o=s.vimMarkers&&s.vimMarkers[r];if(o)return o.getPosition()}}),"'":new s({param:!0,handlesCount:!0,getPos:function(e,t,n,r,i){var s=e.session,o=s.vimMarkers&&s.vimMarkers[r];if(o){var u=o.getPosition(),a=e.session.getLine(u.row);return u.column=a.search(/\S/),u.column==-1&&(u.column=a.length),u}}})},n.exports.backspace=n.exports.left=n.exports.h,n.exports.space=n.exports["return"]=n.exports.right=n.exports.l,n.exports.up=n.exports.k,n.exports.down=n.exports.j,n.exports.pagedown=n.exports["ctrl-d"],n.exports.pageup=n.exports["ctrl-u"]}),ace.define("ace/keyboard/vim/maps/operators",["require","exports","module","ace/keyboard/vim/maps/util","ace/keyboard/vim/registers"],function(e,t,n){var r=e("./util"),i=e("../registers");n.exports={d:{selFn:function(e,t,n,s){i._default.text=e.getCopyText(),i._default.isLine=r.onVisualLineMode,r.onVisualLineMode?e.removeLines():e.session.remove(t),r.normalMode(e)},fn:function(e,t,n,r){n=n||1;switch(r){case"d":i._default.text="",i._default.isLine=!0;for(var s=0;s<n;s++){e.selection.selectLine(),i._default.text+=e.getCopyText();var o=e.getSelectionRange();if(!o.isMultiLine()){var u=o.start.row-1,a=e.session.getLine(u).length;o.setStart(u,a),e.session.remove(o),e.selection.clearSelection();break}e.session.remove(o),e.selection.clearSelection()}i._default.text=i._default.text.replace(/\n$/,"");break;default:t&&(e.selection.setSelectionRange(t),i._default.text=e.getCopyText(),i._default.isLine=!1,e.session.remove(t),e.selection.clearSelection())}}},c:{selFn:function(e,t,n,i){e.session.remove(t),r.insertMode(e)},fn:function(e,t,n,i){n=n||1;switch(i){case"c":for(var s=0;s<n;s++)e.removeLines(),r.insertMode(e);break;default:t&&(e.session.remove(t),r.insertMode(e))}}},y:{selFn:function(e,t,n,s){i._default.text=e.getCopyText(),i._default.isLine=r.onVisualLineMode,e.selection.clearSelection(),r.normalMode(e)},fn:function(e,t,n,r){n=n||1;switch(r){case"y":var s=e.getCursorPosition();e.selection.selectLine();for(var o=0;o<n-1;o++)e.selection.moveCursorDown();i._default.text=e.getCopyText().replace(/\n$/,""),e.selection.clearSelection(),i._default.isLine=!0,e.moveCursorToPosition(s);break;default:if(t){var s=e.getCursorPosition();e.selection.setSelectionRange(t),i._default.text=e.getCopyText(),i._default.isLine=!1,e.selection.clearSelection(),e.moveCursorTo(s.row,s.column)}}}},">":{selFn:function(e,t,n,i){n=n||1;for(var s=0;s<n;s++)e.indent();r.normalMode(e)},fn:function(e,t,n,r){n=parseInt(n||1,10);switch(r){case">":var i=e.getCursorPosition();e.selection.selectLine();for(var s=0;s<n-1;s++)e.selection.moveCursorDown();e.indent(),e.selection.clearSelection(),e.moveCursorToPosition(i),e.navigateLineEnd(),e.navigateLineStart()}}},"<":{selFn:function(e,t,n,i){n=n||1;for(var s=0;s<n;s++)e.blockOutdent();r.normalMode(e)},fn:function(e,t,n,r){n=n||1;switch(r){case"<":var i=e.getCursorPosition();e.selection.selectLine();for(var s=0;s<n-1;s++)e.selection.moveCursorDown();e.blockOutdent(),e.selection.clearSelection(),e.moveCursorToPosition(i),e.navigateLineEnd(),e.navigateLineStart()}}}}}),"use strict",ace.define("ace/keyboard/vim/maps/aliases",["require","exports","module"],function(e,t,n){n.exports={x:{operator:{ch:"d",count:1},motion:{ch:"l",count:1}},X:{operator:{ch:"d",count:1},motion:{ch:"h",count:1}},D:{operator:{ch:"d",count:1},motion:{ch:"$",count:1}},C:{operator:{ch:"c",count:1},motion:{ch:"$",count:1}},s:{operator:{ch:"c",count:1},motion:{ch:"l",count:1}},S:{operator:{ch:"c",count:1},param:"c"}}})
|
framework/js/ace/pluggable/pluggable.js
ADDED
@@ -0,0 +1,44 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
*
|
3 |
+
*/
|
4 |
+
|
5 |
+
/**
|
6 |
+
*
|
7 |
+
*/
|
8 |
+
(function($) {
|
9 |
+
|
10 |
+
/**
|
11 |
+
* put your comment there...
|
12 |
+
*
|
13 |
+
* @type Object
|
14 |
+
*/
|
15 |
+
var ACEPluggable = {
|
16 |
+
|
17 |
+
/**
|
18 |
+
* put your comment there...
|
19 |
+
*
|
20 |
+
* @type Object
|
21 |
+
*/
|
22 |
+
plugins : {},
|
23 |
+
|
24 |
+
/**
|
25 |
+
* Create ACE Plugins system.
|
26 |
+
*
|
27 |
+
* @returns void
|
28 |
+
*/
|
29 |
+
init : function() {
|
30 |
+
// Couldnt find ace object!
|
31 |
+
if (ace == undefined) {
|
32 |
+
throw {code : 0x0001, msg: "Error while initializing ACEPluggabel class. ACE is not defined!!\nPlease check your Javascript loading order"};
|
33 |
+
}
|
34 |
+
else { // ace found!
|
35 |
+
// For now just assign ACEPluggable object reference.
|
36 |
+
ace.pluggable = this;
|
37 |
+
}
|
38 |
+
}
|
39 |
+
|
40 |
+
}; // End pluggable prototype.
|
41 |
+
|
42 |
+
// Intialize!
|
43 |
+
ACEPluggable.init();
|
44 |
+
})(jQuery);
|
framework/js/ace/theme-ambiance.js
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
ace.define("ace/theme/ambiance",["require","exports","module","ace/lib/dom"],function(e,t,n){t.isDark=!0,t.cssClass="ace-ambiance",t.cssText=".ace-ambiance .ace_gutter {background-color: #3d3d3d;background-image: -moz-linear-gradient(left, #3D3D3D, #333);background-image: -ms-linear-gradient(left, #3D3D3D, #333);background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#3D3D3D), to(#333));background-image: -webkit-linear-gradient(left, #3D3D3D, #333);background-image: -o-linear-gradient(left, #3D3D3D, #333);background-image: linear-gradient(left, #3D3D3D, #333);background-repeat: repeat-x;border-right: 1px solid #4d4d4d;text-shadow: 0px 1px 1px #4d4d4d;color: #222;}.ace-ambiance .ace_gutter-layer {background: repeat left top;}.ace-ambiance .ace_fold-widget {text-align: center;}.ace-ambiance .ace_fold-widget:hover {color: #777;}.ace-ambiance .ace_fold-widget.ace_start,.ace-ambiance .ace_fold-widget.ace_end,.ace-ambiance .ace_fold-widget.ace_closed{background: none;border: none;box-shadow: none;}.ace-ambiance .ace_fold-widget.ace_start:after {content: '▾'}.ace-ambiance .ace_fold-widget.ace_end:after {content: '▴'}.ace-ambiance .ace_fold-widget.ace_closed:after {content: '‣'}.ace-ambiance .ace_print-margin {border-left: 1px dotted #2D2D2D;right: 0;background: #262626;}.ace-ambiance .ace_scroller {-webkit-box-shadow: inset 0 0 10px black;-moz-box-shadow: inset 0 0 10px black;-o-box-shadow: inset 0 0 10px black;box-shadow: inset 0 0 10px black;}.ace-ambiance {color: #E6E1DC;background-color: #202020;}.ace-ambiance .ace_cursor {border-left: 1px solid #7991E8;}.ace-ambiance .ace_overwrite-cursors .ace_cursor {border: 1px solid #FFE300;background: #766B13;}.ace-ambiance.normal-mode .ace_cursor-layer {z-index: 0;}.ace-ambiance .ace_marker-layer .ace_selection {background: rgba(221, 240, 255, 0.20);}.ace-ambiance .ace_marker-layer .ace_selected-word {border-radius: 4px;border: 8px solid #3f475d;box-shadow: 0 0 4px black;}.ace-ambiance .ace_marker-layer .ace_step {background: rgb(198, 219, 174);}.ace-ambiance .ace_marker-layer .ace_bracket {margin: -1px 0 0 -1px;border: 1px solid rgba(255, 255, 255, 0.25);}.ace-ambiance .ace_marker-layer .ace_active-line {background: rgba(255, 255, 255, 0.031);}.ace-ambiance .ace_invisible {color: #333;}.ace-ambiance .ace_paren {color: #24C2C7;}.ace-ambiance .ace_keyword {color: #cda869;}.ace-ambiance .ace_keyword.ace_operator {color: #fa8d6a;}.ace-ambiance .ace_punctuation.ace_operator {color: #fa8d6a;}.ace-ambiance .ace_identifier {}.ace-ambiance .ace-statement {color: #cda869;}.ace-ambiance .ace_constant {color: #CF7EA9;}.ace-ambiance .ace_constant.ace_language {color: #CF7EA9;}.ace-ambiance .ace_constant.ace_library {}.ace-ambiance .ace_constant.ace_numeric {color: #78CF8A;}.ace-ambiance .ace_invalid {text-decoration: underline;}.ace-ambiance .ace_invalid.ace_illegal {color:#F8F8F8;background-color: rgba(86, 45, 86, 0.75);}.ace-ambiance .ace_invalid,.ace-ambiance .ace_deprecated {text-decoration: underline;font-style: italic;color: #D2A8A1;}.ace-ambiance .ace_support {color: #9B859D;}.ace-ambiance .ace_support.ace_function {color: #DAD085;}.ace-ambiance .ace_function.ace_buildin {color: #9b859d;}.ace-ambiance .ace_string {color: #8f9d6a;}.ace-ambiance .ace_string.ace_regexp {color: #DAD085;}.ace-ambiance .ace_comment {font-style: italic;color: #555;}.ace-ambiance .ace_comment.ace_doc {}.ace-ambiance .ace_comment.ace_doc.ace_tag {color: #666;font-style: normal;}.ace-ambiance .ace_definition,.ace-ambiance .ace_type {color: #aac6e3;}.ace-ambiance .ace_variable {color: #9999cc;}.ace-ambiance .ace_variable.ace_language {color: #9b859d;}.ace-ambiance .ace_xml-pe {color: #494949;}.ace-ambiance .ace_gutter-layer,.ace-ambiance .ace_text-layer {background-image: url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMgAAADICAQAAAAHUWYVAABFFUlEQVQYGbzBCeDVU/74/6fj9HIcx/FRHx9JCFmzMyGRURhLZIkUsoeRfUjS2FNDtr6WkMhO9sm+S8maJfu+Jcsg+/o/c+Z4z/t97/vezy3z+z8ekGlnYICG/o7gdk+wmSHZ1z4pJItqapjoKXWahm8NmV6eOTbWUOp6/6a/XIg6GQqmenJ2lDHyvCFZ2cBDbmtHA043VFhHwXxClWmeYAdLhV00Bd85go8VmaFCkbVkzlQENzfBDZ5gtN7HwF0KDrTwJ0dypSOzpaKCMwQHKTIreYIxlmhXTzTWkVm+LTynZhiSBT3RZQ7aGfjGEd3qyXQ1FDymqbKxpspERQN2MiRjNZlFFQXfCNFm9nM1zpAsoYjmtRTc5ajwuaXc5xrWskT97RaKzAGe5ARHhVUsDbjKklziiX5WROcJwSNCNI+9w1Jwv4Zb2r7lCMZ4oq5C0EdTx+2GzNuKpJ+iFf38JEWkHJn9DNF7mmBDITrWEg0VWL3pHU20tSZnuqWu+R3BtYa8XxV1HO7GyD32UkOpL/yDloINFTmvtId+nmAjxRw40VMwVKiwrKLE4bK5UOVntYwhOcSSXKrJHKPJedocpGjVz/ZMIbnYUPB10/eKCrs5apqpgVmWzBYWpmtKHecJPjaUuEgRDDaU0oZghCJ6zNMQ5ZhDYx05r5v2muQdM0EILtXUsaKiQX9WMEUotagQzFbUNN6NUPC2nm5pxEWGCjMc3GdJHjSU2kORLK/JGSrkfGEIjncU/CYUnOipoYemwj8tST9NsJmB7TUVXtbUtXATJVZXBMvYeTXJfobgJUPmGMP/yFaWonaa6BcFO3nqcIqCozSZoZoSr1g4zJOzuyGnxTEX3lUEJ7WcZgme8ddaWvWJo2AJR9DZU3CUIbhCSG6ybSwN6qtJVnCU2svDTP2ZInOw2cBTrqtQahtNZn9NcJ4l2NaSmSkkP1noZWnVwkLmdUPOwLZEwy2Z3S3R+4rIG9hcbpPXHFVWcQdZkn2FOta3cKWQnNRC5g1LsJah4GCzSVsKnCOY5OAFRTBekyyryeyilhFKva75r4Mc0aWanGEaThcy31s439KKxTzJYY5WTHPU1FtIHjQU3Oip4xlNzj/lBw23dYZVliQa7WAXf4shetcQfatI+jWRDBPmyNeW6A1P5kdDgyYJlba0BIM8BZu1JfrFwItyjcAMR3K0BWOIrtMEXyhyrlVEx3ui5dUBjmB/Q3CXW85R4mBD0s7B+4q5tKUjOlb9qqmhi5AZ6GFIC5HXtOobdYGlVdMVbNJ8toNTFcHxnoL+muBagcctjWnbNMuR00uI7nQESwg5q2qqrKWIfrNUmeQocY6HuyxJV02wj36w00yhpmUFenv4p6fUkZYqLyuinx2RGOjhCXYyJF84oiU00YMOOhhquNdfbOB7gU88pY4xJO8LVdp6/q2voeB4R04vIdhSE40xZObx1HGGJ/ja0LBthFInKaLPPFzuCaYaoj8JjPME8yoyxo6zlBqkiUZYgq00OYMswbWO5NGmq+xhipxHLRW29ARjNKXO0wRnear8XSg4XFPLKEPUS1GqvyLwiuBUoa7zpZ0l5xxFwWmWZC1H5h5FwU8eQ7K+g8UcVY6TMQreVQT/8uQ8Z+ALIXnSEa2pYZQneE9RZbSBNYXfWYJzW/h/4j4Dp1tYVcFIC5019Vyi4ThPqSFCzjGWaHQTBU8q6vrVwgxP9Lkm840imWKpcLCjYTtrKuwvsKSnrvHCXGkSMk9p6lhckfRpIeis+N2PiszT+mFLspyGleUhDwcLrZqmyeylxwjBcKHEapqkmyangyLZRVOijwOtCY5SsG5zL0OwlCJ4y5KznF3EUNDDrinwiyLZRzOXtlBbK5ITHFGLp8Q0R6ab6mS7enI2cFrxOyHvOCFaT1HThS1krjCwqWeurCkk+willhCC+RSZnRXBiZaC5RXRIZYKp2lyfrHwiKPKR0JDzrdU2EFgpidawlFDR6FgXUMNa+g1FY3bUQh2cLCwosRdnuQTS/S+JVrGLeWIvtQUvONJxlqSQYYKpwoN2kaocLjdVsis4Mk80ESF2YpSkzwldjHkjFCUutI/r+EHDU8oCs6yzL3PhWiEooZdFMkymlas4AcI3KmoMMNSQ3tHzjGWCrcJJdYyZC7QFGwjRL9p+MrRkAGWzIaWCn9W0F3TsK01c2ZvQw0byvxuQU0r1lM0qJO7wW0kRIMdDTtXEdzi4VIh+EoIHm0mWtAtpCixlabgn83fKTI7anJe9ST7WIK1DMGpQmYeA58ImV6ezOGOzK2Kgq01pd60cKWiUi9Lievb/0vIDPHQ05Kzt4ddPckQBQtoaurjyHnek/nKzpQLrVgKPjIkh2v4uyezpv+Xoo7fPFXaGFp1vaLKxQ4uUpQQS5VuQs7BCq4xRJv7fwpVvvFEB3j+620haOuocqMhWd6TTPAEx+mdFNGHdranFe95WrWmIvlY4F1Dle2ECgc6cto7SryuqGGGha0tFQ5V53migUKmg6XKAo4qS3mik+0OZpAhOLeZKicacgaYcyx5hypYQE02ZA4xi/pNhOQxR4klNKyqacj+mpxnLTnnGSo85++3ZCZq6lrZkXlGEX3o+C9FieccJbZWVFjC0Yo1FZnJhoYMFoI1hEZ9r6hwg75HwzBNhbZCdJEfJwTPGzJvaKImw1yYX1HDAmpXR+ZJQ/SmgqMNVQb5vgamGwLtt7VwvP7Qk1xpiM5x5Cyv93E06MZmgs0Nya2azIKOYKCGBQQW97RmhKNKF02JZqHEJ4o58qp7X5EcZmc56trXEqzjCBZ1MFGR87Ql2tSTs6CGxS05PTzRQorkbw7aKoKXFDXsYW42VJih/q+FP2BdTzDTwVqOYB13liM50vG7wy28qagyuIXMeQI/Oqq8bcn5wJI50xH00CRntyfpL1T4hydYpoXgNiFzoIUTDZnLNRzh4TBHwbYGDvZkxmlyJloyr6tRihpeUG94GnKtIznREF0tzJG/OOr73JBcrSh1k6WuTprgLU+mnSGnv6Zge0NNz+kTDdH8nuAuTdJDCNb21LCiIuqlYbqGzT3RAoZofQfjFazkqeNWdYaGvYTM001EW2oKPvVk1ldUGSgUtHFwjKM1h9jnFcmy5lChoLNaQMGGDsYbKixlaMBmmsx1QjCfflwTfO/gckW0ruZ3jugKR3R5W9hGUWqCgxuFgsuaCHorotGKzGaeZB9DMsaTnKCpMtwTvOzhYk0rdrArKCqcaWmVk1+F372ur1YkKxgatI8Qfe1gIX9wE9FgS8ESmuABIXnRUbCapcKe+nO7slClSZFzpV/LkLncEb1qiO42fS3R855Su2mCLh62t1SYZZYVmKwIHjREF2uihTzB20JOkz7dkxzYQnK0UOU494wh+VWRc6Un2kpTaVgLDFEkJ/uhzRcI0YKGgpGWOlocBU/a4fKoJ/pEaNV6jip3+Es9VXY078rGnmAdf7t9ylPXS34RBSuYPs1UecZTU78WanhBCHpZ5sAoTz0LGZKjPf9TRypqWEiTvOFglL1fCEY3wY/++rbk7C8bWebA6p6om6PgOL2kp44TFJlVNBXae2rqqdZztOJpT87GQsE9jqCPIe9VReZuQ/CIgacsyZdCpIScSYqcZk8r+nsyCzhyfhOqHGOIvrLknC8wTpFcaYiGC/RU1NRbUeUpocQOnkRpGOrIOcNRx+1uA0UrzhSSt+VyS3SJpnFWkzNDqOFGIWcfR86DnmARTQ1HKIL33ExPiemeOhYSSjzlSUZZuE4TveoJLnBUOFof6KiysCbnAEcZgcUNTDOwkqWu3RWtmGpZwlHhJENdZ3miGz0lJlsKnjbwqSHQjpxnFDlTLLwqJPMZMjd7KrzkSG7VsxXBZE+F8YZkb01Oe00yyRK9psh5SYh29ySPKBo2ylNht7ZkZnsKenjKNJu9PNEyZpaCHv4Kt6RQsLvAVp7M9kIimmCUwGeWqLMmGuIotYMmWNpSahkhZw9FqZsVnKJhsjAHvtHMsTM9fCI06Dx/u3vfUXCqfsKRc4oFY2jMsoo/7DJDwZ1CsIKnJu+J9ldkpmiCxQx1rWjI+T9FwcWWzOuaYH0Hj7klNRVWEQpmaqosakiGNTFHdjS/qnUdmf0NJW5xsL0HhimCCZZSRzmSPTXJQ4aaztAwtZnoabebJ+htCaZ7Cm535ByoqXKbX1WRc4Eh2MkRXWzImVc96Cj4VdOKVxR84VdQsIUM8Psoou2byVHyZFuq7O8otbSQ2UAoeEWTudATLGSpZzVLlXVkPU2Jc+27lsw2jmg5T5VhbeE3BT083K9WsTTkFU/Osi0rC5lRlpwRHUiesNS0sOvmqGML1aRbPAxTJD9ZKtxuob+hhl8cwYGWpJ8nub7t5p6coYbMovZ1BTdaKn1jYD6h4GFDNFyT/Kqe1XCXphXHOKLZmuRSRdBPEfVUXQzJm5YGPGGJdvAEr7hHNdGZnuBvrpciGmopOLf5N0uVMy0FfYToJk90uUCbJupaVpO53UJXR2bVpoU00V2KOo4zMFrBd0Jtz2pa0clT5Q5L8IpQ177mWQejPMEJhuQjS10ref6HHjdEhy1P1EYR7GtO0uSsKJQYLiTnG1rVScj5lyazpqWGl5uBbRWl7m6ixGOOnEsMJR7z8J0n6KMnCdxhiNYQCoZ6CmYLnO8omC3MkW3bktlPmEt/VQQHejL3+dOE5FlPdK/Mq8hZxxJtLyRrepLThYKbLZxkSb5W52vYxNOaOxUF0yxMUPwBTYqCzy01XayYK0sJyWBLqX0MwU5CzoymRzV0EjjeUeLgDpTo6ij42ZAzvD01dHUUTPLU96MdLbBME8nFBn7zJCMtJcZokn8YoqU0FS5WFKyniHobguMcmW8N0XkWZjkyN3hqOMtS08r+/xTBwpZSZ3qiVRX8SzMHHjfUNFjgHEPmY9PL3ykEzxkSre/1ZD6z/NuznuB0RcE1TWTm9zRgfUWVJiG6yrzgmWPXC8EAR4Wxhlad0ZbgQyEz3pG5RVEwwDJH2mgKpjcTiCOzn1lfUWANFbZ2BA8balnEweJC9J0iuaeZoI+ippFCztEKVvckR2iice1JvhVytrQwUAZpgsubCPaU7xUe9vWnaOpaSBEspalykhC9bUlOMpT42ZHca6hyrqKmw/wMR8H5ZmdFoBVJb03O4UL0tSNnvIeRmkrLWqrs78gcrEn2tpcboh0UPOW3UUR9PMk4T4nnNKWmCjlrefhCwxRNztfmIQVdDElvS4m1/WuOujoZCs5XVOjtKPGokJzsYCtFYoWonSPT21DheU/wWhM19FcElwqNGOsp9Q8N/cwXaiND1MmeL1Q5XROtYYgGeFq1aTMsoMmcrKjQrOFQTQ1fmBYhmW6o8Jkjc7iDJRTBIo5kgJD5yMEYA3srCg7VFKwiVJkmRCc5ohGOKhsYMn/XBLdo5taZjlb9YAlGWRimqbCsoY7HFAXLa5I1HPRxMMsQDHFkWtRNniqT9UEeNjcE7RUlrCJ4R2CSJuqlKHWvJXjAUNcITYkenuBRB84TbeepcqTj3zZyFJzgYQdHnqfgI0ddUwS6GqWpsKWhjq9cV0vBAEMN2znq+EBfIWT+pClYw5xsTlJU6GeIBsjGmmANTzJZiIYpgrM0Oa8ZMjd7NP87jxhqGOhJlnQtjuQpB+8aEE00wZFznSJPyHxgH3HkPOsJFvYk8zqCHzTs1BYOa4J3PFU+UVRZxlHDM4YavlNUuMoRveiZA2d7grMNc2g+RbSCEKzmgYsUmWmazFJyoiOZ4KnyhKOGRzWJa0+moyV4TVHDzn51Awtqaphfk/lRQ08FX1iiqxTB/kLwd0VynKfEvI6cd4XMV5bMhZ7gZUWVzYQ6Nm2BYzxJbw3bGthEUUMfgbGeorae6DxHtJoZ6alhZ0+ytiVoK1R4z5PTrOECT/SugseEOlb1MMNR4VRNcJy+V1Hg9ONClSZFZjdHlc6W6FBLdJja2MC5hhpu0DBYEY1TFGwiFAxRRCsYkiM9JRb0JNMVkW6CZYT/2EiTGWmo8k+h4FhDNE7BvppoTSFnmCV5xZKzvcCdDo7VVPnIU+I+Rc68juApC90MwcFCsJ5hDqxgScYKreruyQwTqrzoqDCmhWi4IbhB0Yrt3RGa6GfDv52rKXWhh28dyZaWUvcZeMTBaZoSGyiCtRU5J8iviioHaErs7Jkj61syVzTTgOcUOQ8buFBTYWdL5g3T4qlpe0+wvD63heAXRfCCIed9RbCsp2CiI7raUOYOTU13N8PNHvpaGvayo4a3LLT1lDrVEPT2zLUlheB1R+ZTRfKWJ+dcocLJfi11vyJ51lLqJ0WD7tRwryezjiV5W28uJO9qykzX8JDe2lHl/9oyBwa2UMfOngpXCixvKdXTk3wrsKmiVYdZIqsoWEERjbcUNDuiaQomGoIbFdEHmsyWnuR+IeriKDVLnlawlyNHKwKlSU631PKep8J4Q+ayjkSLKYLhalNHlYvttb6fHm0p6OApsZ4l2VfdqZkjuysy6ysKLlckf1KUutCTs39bmCgEyyoasIWlVaMF7mgmWtBT8Kol5xpH9IGllo8cJdopcvZ2sImlDmMIbtDk3KIpeNiS08lQw11NFPTwVFlPP6pJ2gvRfI7gQUfmNAtf6Gs0wQxDsKGlVBdF8rCa3jzdwMaGHOsItrZk7hAyOzpK9VS06j5F49b0VNGOOfKs3lDToMsMBe9ZWtHFEgxTJLs7qrygKZjUnmCYoeAqeU6jqWuLJup4WghOdvCYJnrSkSzoyRkm5M2StQwVltPkfCAk58tET/CSg+8MUecmotMEnhBKfWBIZsg2ihruMJQaoIm+tkTLKEqspMh00w95gvFCQRtDwTT1gVDDSEVdlwqZfxoQRbK0g+tbiBZxzKlpnpypejdDwTaeOvorMk/IJE10h9CqRe28hhLbe0pMsdSwv4ZbhKivo2BjDWfL8UKJgeavwlwb5KlwhyE4u4XkGE2ytZCznKLCDZZq42VzT8HLCrpruFbIfOIINmh/qCdZ1ZBc65kLHR1Bkyf5zn6pN3SvGKIlFNGplhrO9QSXanLOMQTLCa0YJCRrCZm/CZmrLTm7WzCK4GJDiWUdFeYx1LCFg3NMd0XmCuF3Y5rITLDUsYS9zoHVzwnJoYpSTQoObyEzr4cFBNqYTopoaU/wkyLZ2lPhX/5Y95ulxGTV7KjhWrOZgl8MyUUafjYraNjNU1N3IWcjT5WzWqjwtoarHSUObGYO3GCJZpsBlnJGPd6ZYLyl1GdCA2625IwwJDP8GUKymbzuyPlZlvTUsaUh5zFDhRWFzPKKZLAlWdcQbObgF9tOqOsmB1dqcqYJmWstFbZRRI9poolmqiLnU0POvxScpah2iSL5UJNzgScY5+AuIbpO0YD3NCW+dLMszFSdFCWGqG6eVq2uYVNDdICGD6W7EPRWZEY5gpsE9rUkS3mijzzJnm6UpUFXG1hCUeVoS5WfNcFpblELL2qqrCvMvRfd45oalvKU2tiQ6ePJOVMRXase9iTtLJztPxJKLWpo2CRDcJwn2sWSLKIO1WQWNTCvpVUvOZhgSC40JD0dOctaSqzkCRbXsKlb11Oip6PCJ0IwSJM31j3akRxlP7Rwn6aGaUL0qiLnJkvB3xWZ2+Q1TfCwpQH3G0o92UzmX4o/oJNQMMSQc547wVHhdk+VCw01DFYEnTxzZKAm74QmeNNR1w6WzEhNK15VJzuCdxQ53dRUDws5KvwgBMOEgpcVNe0hZI6RXT1Jd0cyj5nsaEAHgVmGaJIlWdsc5Ui2ElrRR6jrRAttNMEAIWrTDFubkZaok7/AkzfIwfuWVq0jHzuCK4QabtLUMVPB3kJ0oyHTSVFlqMALilJf2Rf8k5aaHtMfayocLBS8L89oKoxpJvnAkDPa0qp5DAUTHKWmCcnthlou8iCKaFFLHWcINd1nyIwXqrSxMNmSs6KmoL2QrKuWtlQ5V0120xQ5vRyZS1rgFkWwhiOwiuQbR0OOVhQM9iS3tiXp4RawRPMp5tDletOOBL95MpM01dZTBM9pkn5qF010rIeHFcFZhmSGpYpTsI6nwhqe5C9ynhlpp5ophuRb6WcJFldkVnVEwwxVfrVkvnWUuNLCg5bgboFHPDlDPDmnK7hUrWiIbjadDclujlZcaokOFup4Ri1kacV6jmrrK1hN9bGwpKEBQ4Q6DvIUXOmo6U5LqQM6EPyiKNjVkPnJkDPNEaxhiFay5ExW1NXVUGqcpYYdPcGiCq7z/TSlbhL4pplWXKd7NZO5QQFrefhRQW/NHOsqcIglc4UhWklR8K0QzbAw08CBDnpbgqXdeD/QUsM4RZXDFBW6WJKe/mFPdH0LtBgiq57wFLzlyQzz82qYx5D5WJP5yVJDW01BfyHnS6HKO/reZqId1WGa4Hkh2kWodJ8i6KoIPlAj2hPt76CzXsVR6koPRzWTfKqIentatYpQw2me4AA3y1Kind3SwoOKZDcFXTwl9tWU6mfgRk9d71sKtlNwrjnYw5tC5n5LdKiGry3JKNlHEd3oaMCFHrazBPMp/uNJ+V7IudcSbeOIdjUEdwl0VHCOZo5t6YluEuaC9mQeMgSfOyKnYGFHcIeQ84yQWbuJYJpZw5CzglDH7gKnWqqM9ZTaXcN0TeYhR84eQtJT76JJ1lREe7WnnvsMmRc9FQ7SBBM9mV3lCUdmHk/S2RAMt0QjFNFqQpWjDPQ01DXWUdDBkXziKPjGEP3VP+zIWU2t7im41FOloyWzn/L6dkUy3VLDaZ6appgDLHPjJEsyvJngWEPUyVBiAaHCTEXwrLvSEbV1e1gKJniicWorC1MUrVjB3uDhJE/wgSOzk1DXpk0k73qCM8xw2UvD5kJmDUfOomqMpWCkJRlvKXGmoeBm18USjVIk04SClxTB6YrgLAPLWYK9HLUt5cmc0vYES8GnTeRc6skZbQkWdxRsIcyBRzx1DbTk9FbU0caTPOgJHhJKnOGIVhQqvKmo0llRw9sabrZkDtdg3PqaKi9oatjY8B+G371paMg6+mZFNNtQ04mWBq3rYLOmtWWQp8KJnpy9DdFensyjdqZ+yY40VJlH8wcdLzC8PZnvHMFUTZUrDTkLyQaGus5X5LzpYAf3i+e/ZlhqGqWhh6Ou6xTR9Z6oi5AZZtp7Mj2EEm8oSpxiYZCHU/1fbGdNNNRRoZMhmilEb2gqHOEJDtXkHK/JnG6IrvbPCwV3NhONVdS1thBMs1T4QOBcTWa2IzhMk2nW5Kyn9tXUtpv9RsG2msxk+ZsQzRQacJncpgke0+T8y5Fzj8BiGo7XlJjaTIlpQs7KFjpqGnKuoyEPeIKnFMkZHvopgh81ySxNFWvJWcKRs70j2FOT012IllEEO1n4pD1513Yg2ssQPOThOkvyrqHUdEXOSEsihmBbTbKX1kLBPWqWkLOqJbjB3GBIZmoa8qWl4CG/iZ7oiA72ZL7TJNeZUY7kFQftDcHHluBzRbCegzMtrRjVQpX2lgoPKKLJAkcbMl01XK2p7yhL8pCBbQ3BN2avJgKvttcrWDK3CiUOVxQ8ZP+pqXKyIxnmBymCg5vJjNfkPK4+c8cIfK8ocVt7kmfd/I5SR1hKvCzUtb+lhgc00ZaO6CyhIQP1Uv4yIZjload72PXX0OIJvnFU+0Zf6MhsJwTfW0r0UwQfW4LNLZl5HK261JCZ4qnBaAreVAS3WrjV0LBnNDUNNDToCEeFfwgcb4gOEqLRhirWkexrCEYKVV711DLYEE1XBEsp5tpTGjorkomKYF9FDXv7fR3BGwbettSxnyL53MBPjsxDZjMh+VUW9NRxq1DhVk+FSxQcaGjV9Pawv6eGByw5qzoy7xk4RsOShqjJwWKe/1pEEfzkobeD/dQJmpqedcyBTy2sr4nGNRH0c0SPWTLrqAc0OQcb/gemKgqucQT7ySWKCn2EUotoCvpZct7RO2sy/QW0IWcXd7pQRQyZVwT2USRO87uhjioTLKV2brpMUcMQRbKH/N2T+UlTpaMls6cmc6CCNy3JdYYSUzzJQ4oSD3oKLncULOiJvjBEC2oqnCJkJluCYy2ZQ5so9YYlZ1VLlQU1mXEW1jZERwj/MUSRc24TdexlqLKfQBtDTScJUV8FszXBEY5ktpD5Ur9hYB4Nb1iikw3JoYpkKX+RodRKFt53MMuRnKSpY31PwYaGaILh3wxJGz9TkTPEETxoCWZrgvOlmyMzxFEwVJE5xZKzvyJ4WxEc16Gd4Xe3Weq4XH2jKRikqOkGQ87hQnC7wBmGYLAnesX3M+S87eFATauuN+Qcrh7xIxXJbUIdMw3JGE3ylCWzrieaqCn4zhGM19TQ3z1oH1AX+pWEqIc7wNGAkULBo/ZxRaV9NNyh4Br3rCHZzbzmSfawBL0dNRwpW1kK9mxPXR9povcdrGSZK9c2k0xwFGzjuniCtRSZCZ6ccZ7gaktmgAOtKbG/JnOkJrjcQTdFMsxRQ2cLY3WTIrlCw1eWKn8R6pvt4GFDso3QoL4a3nLk3G6JrtME3dSenpx7PNFTmga0EaJTLQ061sEeQoWXhSo9LTXsaSjoJQRXeZLtDclbCrYzfzHHeaKjHCVOUkQHO3JeEepr56mhiyaYYKjjNU+Fed1wS5VlhWSqI/hYUdDOkaxiKehoyOnrCV5yBHtbWFqTHCCwtpDcYolesVR5yUzTZBb3RNMd0d6WP+SvhuBmRcGxnuQzT95IC285cr41cLGQ6aJJhmi4TMGempxeimBRQw1tFKV+8jd6KuzoSTqqDxzRtpZkurvKEHxlqXKRIjjfUNNXQsNOsRScoWFLT+YeRZVD3GRN0MdQcKqQjHDMrdGGVu3iYJpQx3WGUvfbmxwFfR20WBq0oYY7LMFhhgYtr8jpaEnaOzjawWWaTP8mMr0t/EPDPoqcnxTBI5o58L7uoWnMrpoqPwgVrlAUWE+V+TQl9rawoyP6QGAlQw2TPRX+YSkxyBC8Z6jhHkXBgQL7WII3DVFnRfCrBfxewv9D6xsyjys4VkhWb9pUU627JllV0YDNHMku/ldNMMXDEo4aFnAkk4U6frNEU4XgZUPmEKHUl44KrzmYamjAbh0JFvGnaTLPu1s9jPCwjFpYiN7z1DTOk/nc07CfDFzmCf7i+bfNHXhDtLeBXzTBT5rkMvWOIxpl4EMh2LGJBu2syDnAEx2naEhHDWMMzPZEhygyS1mS5RTJr5ZkoKbEUoYqr2kqdDUE8ztK7OaIntJkFrIECwv8LJTaVx5XJE86go8dFeZ3FN3rjabCAYpoYEeC9zzJVULBbmZhDyd7ko09ydpNZ3nm2Kee4FPPXHnYEF1nqOFEC08LUVcDvYXkJHW8gTaKCk9YGOeIJhqiE4ToPEepdp7IWFjdwnWaufGMwJJCMtUTTBBK9BGCOy2tGGrJTHIwyEOzp6aPzNMOtlZkDvcEWpP5SVNhfkvDxhmSazTJXYrM9U1E0xwFVwqZQwzJxw6+kGGGUj2FglGGmnb1/G51udRSMNlTw6GGnCcUwVcOpmsqTHa06o72sw1RL02p9z0VbnMLOaIX3QKaYKSCFQzBKEUNHTSc48k53RH9wxGMtpQa5KjjW0W0n6XCCCG4yxNNdhQ4R4l1Ff+2sSd6UFHiIEOyqqFgT01mEUMD+joy75jPhOA+oVVLm309FR4yVOlp4RhLiScNmSmaYF5Pw0STrOIoWMSR2UkRXOMp+M4SHW8o8Zoi6OZgjKOaFar8zZDzkWzvKOjkKBjmCXby8JahhjXULY4KlzgKLvAwxVGhvyd4zxB1d9T0piazmKLCVZY5sKiD0y2ZSYrkUEPUbIk+dlQ4SJHTR50k1DPaUWIdTZW9NJwnJMOECgd7ou/MnppMJ02O1VT4Wsh85MnZzcFTngpXGKo84qmwgKbCL/orR/SzJ2crA+t6Mp94KvxJUeIbT3CQu1uIdlQEOzlKfS3UMcrTiFmOuroocrZrT2AcmamOKg8YomeEKm/rlT2sociMaybaUlFhuqHCM2qIJ+rg4EcDFymiDSxzaHdPcpE62pD5kyM5SBMoA1PaUtfIthS85ig1VPiPPYXgYEMNk4Qq7TXBgo7oT57gPUdwgCHzhIVFPFU6OYJzHAX9m5oNrVjeE61miDrqQ4VSa1oiURTsKHC0IfjNwU2WzK6eqK8jWln4g15TVBnqmDteCJ501PGAocJhhqjZdtBEB6lnhLreFJKxmlKbeGrqLiSThVIbCdGzloasa6lpMQXHCME2boLpJgT7yWaemu6wBONbqGNVRS0PKIL7LckbjmQtR7K8I5qtqel+T/ChJTNIKLjdUMNIRyvOEko9YYl2cwQveBikCNawJKcLBbc7+JM92mysNvd/Fqp8a0k6CNEe7cnZrxlW0wQXaXjaktnRwNOGZKYiONwS7a1JVheq3WgJHlQUGKHKmp4KAxXR/ULURcNgoa4zhKSLpZR3kxRRb0NmD0OFn+UCS7CzI1nbP6+o4x47QZE5xRCt3ZagnYcvmpYQktXdk5YKXTzBC57kKEe0VVuiSYqapssMS3C9p2CKkHOg8B8Pa8p5atrIw3qezIWanMGa5HRDNF6RM9wcacl0N+Q8Z8hsIkSnaIIdHRUOEebAPy1zbCkhM062FCJtif7PU+UtoVXzWKqM1PxXO8cfdruhFQ/a6x3JKYagvVDhQEtNiyiiSQ7OsuRsZUku0CRNDs4Sog6KKjsZgk2bYJqijgsEenoKeniinRXBn/U3lgpPdyDZynQx8IiioMnCep5Ky8mjGs6Wty0l1hUQTcNWswS3WRp2kCNZwJG8omG8JphPUaFbC8lEfabwP7VtM9yoaNCAjpR41VNhrD9LkbN722v0CoZMByFzhaW+MyzRYEWFDQwN2M4/JiT76PuljT3VU/A36eaIThb+R9oZGOAJ9tewkgGvqOMNRWYjT/Cwu99Q8LqDE4TgbLWxJ1jaDDAERsFOFrobgjUsBScaguXU8kKm2RL19tRypSHnHNlHiIZqgufs4opgQdVdwxBNNFBR6kVFqb8ogimOzB6a6HTzrlDHEpYaxjiiA4TMQobkDg2vejjfwJGWmnbVFAw3H3hq2NyQfG7hz4aC+w3BbwbesG0swYayvpAs6++Ri1Vfzx93mFChvyN5xVHTS+0p9aqCAxyZ6ZacZyw5+7uuQkFPR9DDk9NOiE7X1PCYJVjVUqq7JlrHwWALF5nfHNGjApdpqgzx5OwilDhCiDYTgnc9waGW4BdLNNUQvOtpzDOWHDH8D7TR/A/85KljEQu3NREc4Pl/6B1Hhc8Umb5CsKMmGC9EPcxoT2amwHNCmeOEnOPbklnMkbOgIvO5UMOpQrS9UGVdt6iH/fURjhI/WOpaW9OKLYRod6HCUEdOX000wpDZQ6hwg6LgZfOqo1RfT/CrJzjekXOGhpc1VW71ZLbXyyp+93ILbC1kPtIEYx0FIx1VDrLoVzXRKRYWk809yYlC9ImcrinxtabKnzRJk3lAU1OLEN1j2zrYzr2myHRXJFf4h4QKT1qSTzTB5+ZNTzTRkAxX8FcLV2uS8eoQQ2aAkFzvCM72sJIcJET3WPjRk5wi32uSS9rfZajpWEvj9hW42F4o5NytSXYy8IKHay10VYdrcl4SkqscrXpMwyGOgtkajheSxdQqmpxP1L3t4R5PqasFnrQEjytq6qgp9Y09Qx9o4S1FzhUCn1kyHSzBWLemoSGvOqLNhZyBjmCaAUYpMgt4Ck7wBBMMwWKWgjsUwTaGVsxWC1mYoKiyqqeGKYqonSIRQ3KIkHO0pmAxTdBHkbOvfllfr+AA+7gnc50huVKYK393FOyg7rbPO/izI7hE4CnHHHnJ0ogNPRUGeUpsrZZTBJcrovUcJe51BPsr6GkJdhCCsZ6aTtMEb2pqWkqeVtDXE/QVggsU/Nl86d9RMF3DxvZTA58agu810RWawCiSzzXBeU3MMW9oyJUedvNEvQyNu1f10BSMddR1vaLCYpYa/mGocLSiYDcLbQz8aMn5iyF4xBNMs1P0QEOV7o5gaWGuzSeLue4tt3ro7y4Tgm4G/mopdZgl6q0o6KzJWE3mMksNr3r+a6CbT8g5wZNzT9O7fi/zpaOmnz3BRoqos+tv9zMbdpxsqDBOEewtJLt7cg5wtKKbvldpSzRRCD43VFheCI7yZLppggMVBS/KMAdHODJvOwq2NQSbKKKPLdFWQs7Fqo+mpl01JXYRgq8dnGLhTiFzqmWsUMdpllZdbKlyvSdYxhI9YghOtxR8LgSLWHK62mGGVoxzBE8LNWzqH9CUesQzFy5RQzTc56mhi6fgXEWwpKfE5Z7M05ZgZUPmo6auiv8YKzDYwWBLMErIbKHJvOwIrvEdhOBcQ9JdU1NHQ7CXn2XIDFBKU2WAgcX9UAUzDXWd5alwuyJ41Z9rjKLCL4aCp4WarhPm2rH+SaHUYE001JDZ2ZAzXPjdMpZWvC9wmqIB2lLhQ01D5jO06hghWMndbM7yRJMsoCj1vYbnFQVrW9jak3OlEJ3s/96+p33dEPRV5GxiqaGjIthUU6FFEZyqCa5qJrpBdzSw95IUnOPIrCUUjRZQFrbw5PR0R1qiYx3cb6nrWUMrBmmiBQxVHtTew5ICP/ip6g4hed/Akob/32wvBHsIOX83cI8hGeNeNPCIkPmXe8fPKx84OMSRM1MTdXSwjCZ4S30jVGhvqTRak/OVhgGazHuOCud5onEO1lJr6ecVyaOK6H7zqlBlIaHE0oroCgfvGJIdPcmfLNGLjpz7hZwZQpUbFME0A1cIJa7VNORkgfsMBatbKgwwJM9bSvQXeNOvbIjelg6WWvo5kvbKaJJNHexkKNHL9xRyFlH8Ti2riB5wVPhUk7nGkJnoCe428LR/wRGdYIlmWebCyxou1rCk4g/ShugBDX0V0ZQWkh0dOVsagkM0yV6OoLd5ye+pRlsCr0n+KiQrGuq5yJDzrTAXHtLUMduTDBVKrSm3eHL+6ijxhFDX9Z5gVU/wliHYTMiMFpKLNMEywu80wd3meoFmt6VbRMPenhrOc6DVe4pgXU8DnnHakLOIIrlF4FZPIw6R+zxBP0dyq6OOZ4Q5sLKCcz084ok+VsMMyQhNZmmBgX5xIXOEJTmi7VsGTvMTNdHHhpzdbE8Du2oKxgvBqQKdDDnTFOylCFaxR1syz2iqrOI/FEpNc3C6f11/7+ASS6l2inq2ciTrCCzgyemrCL5SVPjQkdPZUmGy2c9Sw9FtR1sS30RmsKPCS4rkIC/2U0MduwucYolGaPjKEyhzmiPYXagyWbYz8LWBDdzRimAXzxx4z8K9hpzlhLq+NiQ97HuKorMUfK/OVvC2JfiHUPCQI/q7J2gjK+tTDNxkCc4TMssqCs4TGtLVwQihyoAWgj9bosU80XGW6Ac9TJGziaUh5+hnFcHOnlaM1iRn29NaqGENTTTSUHCH2tWTeV0osUhH6psuVLjRUmGWhm6OZEshGeNowABHcJ2Bpy2ZszRcKkRXd2QuKVEeXnbfaEq825FguqfgfE2whlChSRMdron+LATTPQ2Z369t4B9C5gs/ylzv+CMmepIDPclFQl13W0rspPd1JOcbghGOEutqCv5qacURQl3dDKyvyJlqKXGPgcM9FfawJAMVmdcspcYKOZc4GjDYkFlK05olNMHyHn4zFNykyOxt99RkHlfwmiHo60l2EKI+mhreEKp080Tbug08BVPcgoqC5zWt+NLDTZ7oNSF51N1qie7Va3uCCwyZbkINf/NED6jzOsBdZjFN8oqG3wxVunqCSYYKf3EdhJyf9YWGf7tRU2oH3VHgPr1fe5J9hOgHd7xQ0y7qBwXr23aGErP0cm64JVjZwsOGqL+mhNgZmhJLW2oY4UhedsyBgzrCKrq7BmcpNVhR6jBPq64Vgi+kn6XE68pp8J5/+0wRHGOpsKenQn9DZntPzjRLZpDAdD2fnSgkG9tmIXnUwQ6WVighs7Yi2MxQ0N3CqYaCXkJ0oyOztMDJjmSSpcpvlrk0RMMOjmArQ04PRV1DO1FwhCVaUVPpKUM03JK5SxPsIWRu8/CGHi8UHChiqGFDTbSRJWeYUDDcH6vJWUxR4k1FXbMUwV6e4AJFXS8oMqsZKqzvYQ9DDQdZckY4aGsIhtlubbd2r3j4QBMoTamdPZk7O/Bf62lacZwneNjQoGcdVU7zJOd7ghsUHOkosagic6cnWc8+4gg285R6zZP5s1/LUbCKIznTwK36PkdwlOrl4U1LwfdCCa+IrvFkmgw1PCAUXKWo0sURXWcI2muKJlgyFzhynCY4RBOsqCjoI1R5zREco0n2Vt09BQtYSizgKNHfUmUrQ5UOCh51BFcLmY7umhYqXKQomOop8bUnWNNQcIiBcYaC6xzMNOS8JQQfeqKBmmglB+97ok/lfk3ygaHSyZaCRTzRxQo6GzLfa2jWBPepw+UmT7SQEJyiyRkhBLMVOfcoMjcK0eZChfUNzFAUzCsEN5vP/X1uP/n/aoMX+K+nw/Hjr/9xOo7j7Pju61tLcgvJpTWXNbfN5jLpi6VfCOviTktKlFusQixdEKWmEBUKNaIpjZRSSOXSgzaaKLdabrm1/9nZ+/f+vd/vz/v9+Xy+zZ7PRorYoZqyLrCwQdEAixxVOEXNNnjX2nUSRlkqGmWowk8lxR50JPy9Bo6qJXaXwNvREBvnThPEPrewryLhcAnj5WE15Fqi8W7R1sAuEu86S4ENikItFN4xkv9Af4nXSnUVcLiA9xzesFpivRRVeFKtsMRaKBhuSbjOELnAUtlSQUpXgdfB4Z1oSbnFEetbQ0IrAe+Y+pqnDcEJFj6S8LDZzZHwY4e3XONNlARraomNEt2bkvGsosA3ioyHm+6jCMbI59wqt4eeara28IzEmyPgoRaUOEDhTVdEJhmCoTWfC0p8aNkCp0oYqih2iqGi4yXeMkOsn4LdLLnmKfh/YogjNsPebeFGR4m9BJHLzB61XQ3BtpISfS2FugsK9FAtLWX1dCRcrCnUp44CNzuCowUZmxSRgYaE6Za0W2u/E7CVXCiI/UOR8aAm1+OSyE3mOUcwyc1zBBeoX1kiKy0Zfxck1Gsyulti11i83QTBF5Kg3pDQThFMVHiPSlK+0cSedng/VaS8bOZbtsBcTcZAR8JP5KeqQ1OYKAi20njdNNRpgnsU//K+JnaXJaGTomr7aYIphoRn9aeShJWKEq9LcozSF7QleEfDI5LYm5bgVkFkRwVDBCVu0DDIkGupo8TZBq+/pMQURYErJQmPKGKjNDkWOLx7Jd5QizdUweIaKrlP7SwJDhZvONjLkOsBBX9UpGxnydhXkfBLQ8IxgojQbLFnJf81JytSljclYYyEFyx0kVBvKWOFJmONpshGAcsduQY5giVNCV51eOdJYo/pLhbvM0uDHSevNKRcrKZIqnCtJeEsO95RoqcgGK4ocZcho1tTYtcZvH41pNQ7vA0WrhIfOSraIIntIAi+NXWCErdbkvrWwjRLrt0NKUdL6KSOscTOdMSOUtBHwL6OLA0vNSdynaWQEnCpIvKaIrJJEbvHkmuNhn6OjM8VkSGSqn1uYJCGHnq9I3aLhNME3t6GjIkO7xrNFumpyTNX/NrwX7CrIRiqqWijI9JO4d1iieykyfiposQIQ8YjjsjlBh6oHWbwRjgYJQn2NgSnNycmJAk3NiXhx44Sxykihxm8ybUwT1OVKySc7vi3OXVkdBJ4AyXBeksDXG0IhgtYY0lY5ahCD0ehborIk5aUWRJviMA7Xt5kyRjonrXENkm8yYqgs8VzgrJmClK20uMM3jRJ0FiQICQF9hdETlLQWRIb5ki6WDfWRPobvO6a4GP5mcOrNzDFELtTkONLh9dXE8xypEg7z8A9jkhrQ6Fhjlg/QVktJXxt4WXzT/03Q8IaQWSqIuEvloQ2mqC9Jfi7wRul4RX3pSPlzpoVlmCtI2jvKHCFhjcM3sN6lqF6HxnKelLjXWbwrpR4xzuCrTUZx2qq9oAh8p6ixCUGr78g8oyjRAtB5CZFwi80VerVpI0h+IeBxa6Zg6kWvpDHaioYYuEsRbDC3eOmC2JvGYLeioxGknL2UATNJN6hmtj1DlpLvDVmocYbrGCVJKOrg4X6DgddLA203BKMFngdJJFtFd7vJLm6KEpc5yjQrkk7M80SGe34X24nSex1Ra5Omgb71JKyg8SrU3i/kARKwWpH0kOGhKkObyfd0ZGjvyXlAkVZ4xRbYJ2irFMkFY1SwyWxr2oo4zlNiV+7zmaweFpT4kR3kaDAFW6xpSqzJay05FtYR4HmZhc9UxKbbfF2V8RG1MBmSaE+kmC6JnaRXK9gsiXhJHl/U0qM0WTcbyhwkYIvFGwjSbjfwhiJt8ZSQU+Bd5+marPMOkVkD0muxYLIfEuhh60x/J92itguihJSEMySVPQnTewnEm+620rTQEMsOfo4/kP/0ARvWjitlpSX7GxBgcMEsd3EEeYWvdytd+Saawi6aCIj1CkGb6Aj9rwhx16Cf3vAwFy5pyLhVonXzy51FDpdEblbkdJbUcEPDEFzQ8qNmhzzLTmmKWKbFCXeEuRabp6rxbvAtLF442QjQ+wEA9eL1xSR7Q0JXzlSHjJ4exq89yR0laScJ/FW6z4a73pFMEfDiRZvuvijIt86RaSFOl01riV2mD1UEvxGk/Geg5aWwGki1zgKPG9J2U8PEg8qYvMsZeytiTRXBMslCU8JSlxi8EabjwUldlDNLfzTUmCgxWsjqWCOHavYAqsknKFIO0yQ61VL5AVFxk6WhEaCAkdJgt9aSkzXlKNX2jEa79waYuc7gq0N3GDJGCBhoiTXUEPsdknCUE1CK0fwsiaylSF2uiDyO4XX3pFhNd7R4itFGc0k/ElBZwWvq+GC6szVeEoS/MZ+qylwpKNKv9Z469UOjqCjwlusicyTxG6VpNxcQ8IncoR4RhLbR+NdpGGmJWOcIzJGUuKPGpQg8rrG21dOMqQssJQ4RxH5jaUqnZuQ0F4Q+cjxLwPtpZbIAk3QTJHQWBE5S1BokoVtDd6lhqr9UpHSUxMcIYl9pojsb8h4SBOsMQcqvOWC2E8EVehqiJ1hrrAEbQxeK0NGZ0Gkq+guSRgniM23bIHVkqwx4hiHd7smaOyglyIyQuM978j4VS08J/A2G1KeMBRo4fBaSNhKUEZfQewVQ/C1I+MgfbEleEzCUw7mKXI0M3hd1EESVji8x5uQ41nxs1q4RMJCCXs7Iq9acpxn22oSDnQ/sJTxsCbHIYZiLyhY05TY0ZLIOQrGaSJDDN4t8pVaIrsqqFdEegtizc1iTew5Q4ayBDMUsQMkXocaYkc0hZua412siZ1rSXlR460zRJ5SlHGe5j801RLMlJTxtaOM3Q1pvxJ45zUlWFD7rsAbpfEm1JHxG0eh8w2R7QQVzBUw28FhFp5QZzq8t2rx2joqulYTWSuJdTYfWwqMFMcovFmSyJPNyLhE4E10pHzYjOC3huArRa571ZsGajQpQx38SBP5pyZB6lMU3khDnp0MBV51BE9o2E+TY5Ml2E8S7C0o6w1xvCZjf0HkVEHCzFoyNmqC+9wdcqN+Tp7jSDheE9ws8Y5V0NJCn2bk2tqSY4okdrEhx1iDN8cSudwepWmAGXKcJXK65H9to8jYQRH7SBF01ESUJdd0TayVInaWhLkOjlXE5irKGOnI6GSWGCJa482zBI9rCr0jyTVcEuzriC1vcr6mwFGSiqy5zMwxBH/TJHwjSPhL8+01kaaSUuMFKTcLEvaUePcrSmwn8DZrgikWb7CGPxkSjhQwrRk57tctmxLsb9sZvL9LSlyuSLlWkqOjwduo8b6Uv1DkmudIeFF2dHCgxVtk8dpIvHpBxhEOdhKk7OLIUSdJ+cSRY57B+0DgGUUlNfpthTfGkauzxrvTsUUaCVhlKeteTXCoJDCa2NOKhOmC4G1H8JBd4OBZReSRGkqcb/CO1PyLJTLB4j1q8JYaIutEjSLX8YKM+a6phdMsdLFUoV5RTm9JSkuDN8WcIon0NZMNZWh1q8C7SJEwV5HxrmnnTrf3KoJBlmCYI2ilSLlfEvlE4011NNgjgthzEua0oKK7JLE7HZHlEl60BLMVFewg4EWNt0ThrVNEVkkiTwpKXSWJzdRENgvKGq4IhjsiezgSFtsfCUq8qki5S1LRQeYQQ4nemmCkImWMw3tFUoUBZk4NOeZYEp4XRKTGa6wJjrWNHBVJR4m3FCnbuD6aak2WsMTh3SZImGCIPKNgsDpVwnsa70K31lCFJZYcwwSMFcQulGTsZuEaSdBXkPGZhu0FsdUO73RHjq8MPGGIfaGIbVTk6iuI3GFgucHrIQkmWSJdBd7BBu+uOryWAhY7+Lki9rK5wtEQzWwvtbqGhIMFwWRJsElsY4m9IIg9L6lCX0VklaPAYkfkZEGDnOWowlBJjtMUkcGK4Lg6EtoZInMUBVYLgn0UsdmCyCz7gIGHFfk+k1QwTh5We7A9x+IdJ6CvIkEagms0hR50eH9UnTQJ+2oiKyVlLFUE+8gBGu8MQ3CppUHesnjTHN4QB/UGPhCTHLFPHMFrCqa73gqObUJGa03wgbhHkrCfpEpzNLE7JDS25FMKhlhKKWKfCgqstLCPu1zBXy0J2ztwjtixBu8UTRn9LVtkmCN2iyFhtME70JHRQ1KVZXqKI/KNIKYMCYs1GUMEKbM1bKOI9LDXC7zbHS+bt+1MTWS9odA9DtrYtpbImQJ2VHh/lisEwaHqUk1kjKTAKknkBEXkbkdMGwq0dnhzLJF3NJH3JVwrqOB4Sca2hti75nmJN0WzxS6UxDYoEpxpa4htVlRjkYE7DZGzJVU72uC9IyhQL4i8YfGWSYLLNcHXloyz7QhNifmKSE9JgfGmuyLhc403Xm9vqcp6gXe3xuuv8F6VJNxkyTHEkHG2g0aKXL0MsXc1bGfgas2//dCONXiNLCX+5mB7eZIl1kHh7ajwpikyzlUUWOVOsjSQlsS+M0R+pPje/dzBXRZGO0rMtgQrLLG9VSu9n6CMXS3BhwYmSoIBhsjNBmZbgusE9BCPCP5triU4VhNbJfE+swSP27aayE8tuTpYYjtrYjMVGZdp2NpS1s6aBnKSHDsbKuplKbHM4a0wMFd/5/DmGyKrJSUaW4IBrqUhx0vyfzTBBLPIUcnZdrAkNsKR0sWRspumSns6Ch0v/qqIbBYUWKvPU/CFoyrDJGwSNFhbA/MlzKqjrO80hRbpKx0Jewsi/STftwGSlKc1JZyAzx05dhLEdnfQvhZOqiHWWEAHC7+30FuRcZUgaO5gpaIK+xsiHRUsqaPElTV40xQZQ107Q9BZE1nryDVGU9ZSQ47bmhBpLcYpUt7S+xuK/FiT8qKjwXYw5ypS2iuCv7q1gtgjhuBuB8LCFY5cUuCNtsQOFcT+4Ih9JX+k8Ea6v0iCIRZOtCT0Et00JW5UeC85Cg0ScK0k411HcG1zKtre3SeITBRk7WfwDhEvaYLTHP9le0m8By0JDwn4TlLW/aJOvGHxdjYUes+ScZigCkYQdNdEOhkiezgShqkx8ueKjI8lDfK2oNiOFvrZH1hS+tk7NV7nOmLHicGWEgubkXKdwdtZknCLJXaCpkrjZBtLZFsDP9CdxWsSr05Sxl6CMmoFbCOgryX40uDtamB7SVmXW4Ihlgpmq+00tBKUUa83WbjLUNkzDmY7cow1JDygyPGlhgGKYKz4vcV7QBNbJIgM11TUqZaMdwTeSguH6rOaw1JRKzaaGyxVm2EJ/uCIrVWUcZUkcp2grMsEjK+DMwS59jQk3Kd6SEq1d0S6uVmO4Bc1lDXTUcHjluCXEq+1OlBDj1pi9zgiXxnKuE0SqTXwhqbETW6RggMEnGl/q49UT2iCzgJvRwVXS2K/d6+ZkyUl7jawSVLit46EwxVljDZwoSQ20sDBihztHfk2yA8NVZghiXwrYHQdfKAOtzsayjhY9bY0yE2CWEeJ9xfzO423xhL5syS2TFJofO2pboHob0nY4GiAgRrvGQEDa/FWSsoaaYl0syRsEt3kWoH3B01shCXhTUWe9w3Bt44SC9QCh3eShQctwbaK2ApLroGCMlZrYqvlY3qYhM0aXpFkPOuoqJ3Dm6fxXrGwVF9gCWZagjPqznfkuMKQ8DPTQRO8ZqG1hPGKEm9IgpGW4DZDgTNriTxvFiq+Lz+0cKfp4wj6OCK9JSnzNSn9LFU7UhKZZMnYwcJ8s8yRsECScK4j5UOB95HFO0CzhY4xJxuCix0lDlEUeMdS6EZBkTsUkZ4K74dugyTXS7aNgL8aqjDfkCE0ZbwkCXpaWCKhl8P7VD5jxykivSyxyZrYERbe168LYu9ZYh86IkscgVLE7tWPKmJv11CgoyJltMEbrohtVAQfO4ImltiHEroYEs7RxAarVpY8AwXMcMReFOTYWe5iiLRQxJ5Q8DtJ8LQhWOhIeFESPGsILhbNDRljNbHzNRlTFbk2S3L0NOS6V1KFJYKUbSTcIIhM0wQ/s2TM0SRMNcQmSap3jCH4yhJZKSkwyRHpYYgsFeQ4U7xoCB7VVOExhXepo9ABBsYbvGWKXPME3lyH95YioZ0gssQRWWbI+FaSMkXijZXwgiTlYdPdkNLaETxlyDVIwqeaEus0aTcYcg0RVOkpR3CSJqIddK+90JCxzsDVloyrFd5ZAr4TBKfaWa6boEA7C7s6EpYaeFPjveooY72mjIccLHJ9HUwVlDhKkmutJDJBwnp1rvulJZggKDRfbXAkvC/4l3ozQOG9a8lxjx0i7nV4jSXc7vhe3OwIxjgSHjdEhhsif9YkPGlus3iLFDnWOFhtCZbJg0UbQcIaR67JjthoCyMEZRwhiXWyxO5QxI6w5NhT4U1WsJvDO60J34fW9hwzwlKij6ZAW9ne4L0s8C6XeBMEkd/LQy1VucBRot6QMlbivaBhoBgjqGiCJNhsqVp/S2SsG6DIONCR0dXhvWbJ+MRRZJkkuEjgDXJjFQW6SSL7GXK8Z2CZg7cVsbWGoKmEpzQ5elpiy8Ryg7dMkLLUEauzeO86CuwlSOlgYLojZWeJ9xM3S1PWfEfKl5ISLQ0MEKR8YOB2QfCxJBjrKPCN4f9MkaSsqoVXJBmP7EpFZ9UQfOoOFwSzBN4MQ8LsGrymlipcJQhmy0GaQjPqCHaXRwuCZwRbqK2Fg9wlClZqYicrIgMdZfxTQ0c7TBIbrChxmuzoKG8XRaSrIhhiyNFJkrC7oIAWMEOQa5aBekPCRknCo4IKPrYkvCDI8aYmY7WFtprgekcJZ3oLIqssCSMtFbQTJKwXYy3BY5oCh2iKPCpJOE+zRdpYgi6O2KmOAgvVCYaU4ySRek1sgyFhJ403QFHiVEmJHwtybO1gs8Hr5+BETQX3War0qZngYGgtVZtoqd6vFSk/UwdZElYqyjrF4HXUeFspIi9IGKf4j92pKGAdCYMVsbcV3kRF0N+R8LUd5PCsIGWoxDtBkCI0nKofdJQxT+LtZflvuc8Q3CjwWkq8KwUpHzkK/NmSsclCL0nseQdj5FRH5CNHSgtLiW80Of5HU9Hhlsga9bnBq3fEVltKfO5IaSTmGjjc4J0otcP7QsJUSQM8pEj5/wCuUuC2DWz8AAAAAElFTkSuQmCC\");}.ace-ambiance .ace_indent-guide {background: url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAEklEQVQImWNQUFD4z6Crq/sfAAuYAuYl+7lfAAAAAElFTkSuQmCC\") right repeat-y;}";var r=e("../lib/dom");r.importCssString(t.cssText,t.cssClass)})
|
framework/js/ace/theme-chaos.js
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
ace.define("ace/theme/chaos",["require","exports","module","ace/lib/dom"],function(e,t,n){t.isDark=!0,t.cssClass="ace-chaos",t.cssText=".ace-chaos .ace_gutter {background: #141414;color: #595959;border-right: 1px solid #282828;}.ace-chaos .ace_gutter-cell.ace_warning {background-image: none;background: #FC0;border-left: none;padding-left: 0;color: #000;}.ace-chaos .ace_gutter-cell.ace_error {background-position: -6px center;background-image: none;background: #F10;border-left: none;padding-left: 0;color: #000;}.ace-chaos .ace_print-margin {border-left: 1px solid #555;right: 0;background: #1D1D1D;}.ace-chaos {background-color: #161616;color: #E6E1DC;}.ace-chaos .ace_cursor {border-left: 2px solid #FFFFFF;}.ace-chaos .ace_cursor.ace_overwrite {border-left: 0px;border-bottom: 1px solid #FFFFFF;}.ace-chaos .ace_marker-layer .ace_selection {background: #494836;}.ace-chaos .ace_marker-layer .ace_step {background: rgb(198, 219, 174);}.ace-chaos .ace_marker-layer .ace_bracket {margin: -1px 0 0 -1px;border: 1px solid #FCE94F;}.ace-chaos .ace_marker-layer .ace_active-line {background: #333;}.ace-chaos .ace_gutter-active-line {background-color: #222;}.ace-chaos .ace_invisible {color: #404040;}.ace-chaos .ace_keyword {color:#00698F;}.ace-chaos .ace_keyword.ace_operator {color:#FF308F;}.ace-chaos .ace_constant {color:#1EDAFB;}.ace-chaos .ace_constant.ace_language {color:#FDC251;}.ace-chaos .ace_constant.ace_library {color:#8DFF0A;}.ace-chaos .ace_constant.ace_numeric {color:#58C554;}.ace-chaos .ace_invalid {color:#FFFFFF;background-color:#990000;}.ace-chaos .ace_invalid.ace_deprecated {color:#FFFFFF;background-color:#990000;}.ace-chaos .ace_support {color: #999;}.ace-chaos .ace_support.ace_function {color:#00AEEF;}.ace-chaos .ace_function {color:#00AEEF;}.ace-chaos .ace_string {color:#58C554;}.ace-chaos .ace_comment {color:#555;font-style:italic;padding-bottom: 0px;}.ace-chaos .ace_variable {color:#997744;}.ace-chaos .ace_meta.ace_tag {color:#BE53E6;}.ace-chaos .ace_entity.ace_other.ace_attribute-name {color:#FFFF89;}.ace-chaos .ace_markup.ace_underline {text-decoration: underline;}.ace-chaos .ace_fold-widget {text-align: center;}.ace-chaos .ace_fold-widget:hover {color: #777;}.ace-chaos .ace_fold-widget.ace_start,.ace-chaos .ace_fold-widget.ace_end,.ace-chaos .ace_fold-widget.ace_closed{background: none;border: none;box-shadow: none;}.ace-chaos .ace_fold-widget.ace_start:after {content: '▾'}.ace-chaos .ace_fold-widget.ace_end:after {content: '▴'}.ace-chaos .ace_fold-widget.ace_closed:after {content: '‣'}.ace-chaos .ace_indent-guide {border-right:1px dotted #333;margin-right:-1px;}.ace-chaos .ace_fold { background: #222; border-radius: 3px; color: #7AF; border: none; }.ace-chaos .ace_fold:hover {background: #CCC; color: #000;}";var r=e("../lib/dom");r.importCssString(t.cssText,t.cssClass)})
|
framework/js/ace/theme-clouds.js
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
ace.define("ace/theme/clouds",["require","exports","module","ace/lib/dom"],function(e,t,n){t.isDark=!1,t.cssClass="ace-clouds",t.cssText='.ace-clouds .ace_gutter {background: #ebebeb;color: #333}.ace-clouds .ace_print-margin {width: 1px;background: #e8e8e8}.ace-clouds {background-color: #FFFFFF;color: #000000}.ace-clouds .ace_cursor {color: #000000}.ace-clouds .ace_marker-layer .ace_selection {background: #BDD5FC}.ace-clouds.ace_multiselect .ace_selection.ace_start {box-shadow: 0 0 3px 0px #FFFFFF;border-radius: 2px}.ace-clouds .ace_marker-layer .ace_step {background: rgb(255, 255, 0)}.ace-clouds .ace_marker-layer .ace_bracket {margin: -1px 0 0 -1px;border: 1px solid #BFBFBF}.ace-clouds .ace_marker-layer .ace_active-line {background: #FFFBD1}.ace-clouds .ace_gutter-active-line {background-color : #dcdcdc}.ace-clouds .ace_marker-layer .ace_selected-word {border: 1px solid #BDD5FC}.ace-clouds .ace_invisible {color: #BFBFBF}.ace-clouds .ace_keyword,.ace-clouds .ace_meta,.ace-clouds .ace_support.ace_constant.ace_property-value {color: #AF956F}.ace-clouds .ace_keyword.ace_operator {color: #484848}.ace-clouds .ace_keyword.ace_other.ace_unit {color: #96DC5F}.ace-clouds .ace_constant.ace_language {color: #39946A}.ace-clouds .ace_constant.ace_numeric {color: #46A609}.ace-clouds .ace_constant.ace_character.ace_entity {color: #BF78CC}.ace-clouds .ace_invalid {background-color: #FF002A}.ace-clouds .ace_fold {background-color: #AF956F;border-color: #000000}.ace-clouds .ace_storage,.ace-clouds .ace_support.ace_class,.ace-clouds .ace_support.ace_function,.ace-clouds .ace_support.ace_other,.ace-clouds .ace_support.ace_type {color: #C52727}.ace-clouds .ace_string {color: #5D90CD}.ace-clouds .ace_comment {color: #BCC8BA}.ace-clouds .ace_entity.ace_name.ace_tag,.ace-clouds .ace_entity.ace_other.ace_attribute-name {color: #606060}.ace-clouds .ace_indent-guide {background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAE0lEQVQImWP4////f4bLly//BwAmVgd1/w11/gAAAABJRU5ErkJggg==") right repeat-y}';var r=e("../lib/dom");r.importCssString(t.cssText,t.cssClass)})
|
framework/js/ace/theme-clouds_midnight.js
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
ace.define("ace/theme/clouds_midnight",["require","exports","module","ace/lib/dom"],function(e,t,n){t.isDark=!0,t.cssClass="ace-clouds-midnight",t.cssText=".ace-clouds-midnight .ace_gutter {background: #232323;color: #929292}.ace-clouds-midnight .ace_print-margin {width: 1px;background: #232323}.ace-clouds-midnight {background-color: #191919;color: #929292}.ace-clouds-midnight .ace_cursor {color: #7DA5DC}.ace-clouds-midnight .ace_marker-layer .ace_selection {background: #000000}.ace-clouds-midnight.ace_multiselect .ace_selection.ace_start {box-shadow: 0 0 3px 0px #191919;border-radius: 2px}.ace-clouds-midnight .ace_marker-layer .ace_step {background: rgb(102, 82, 0)}.ace-clouds-midnight .ace_marker-layer .ace_bracket {margin: -1px 0 0 -1px;border: 1px solid #BFBFBF}.ace-clouds-midnight .ace_marker-layer .ace_active-line {background: rgba(215, 215, 215, 0.031)}.ace-clouds-midnight .ace_gutter-active-line {background-color: rgba(215, 215, 215, 0.031)}.ace-clouds-midnight .ace_marker-layer .ace_selected-word {border: 1px solid #000000}.ace-clouds-midnight .ace_invisible {color: #BFBFBF}.ace-clouds-midnight .ace_keyword,.ace-clouds-midnight .ace_meta,.ace-clouds-midnight .ace_support.ace_constant.ace_property-value {color: #927C5D}.ace-clouds-midnight .ace_keyword.ace_operator {color: #4B4B4B}.ace-clouds-midnight .ace_keyword.ace_other.ace_unit {color: #366F1A}.ace-clouds-midnight .ace_constant.ace_language {color: #39946A}.ace-clouds-midnight .ace_constant.ace_numeric {color: #46A609}.ace-clouds-midnight .ace_constant.ace_character.ace_entity {color: #A165AC}.ace-clouds-midnight .ace_invalid {color: #FFFFFF;background-color: #E92E2E}.ace-clouds-midnight .ace_fold {background-color: #927C5D;border-color: #929292}.ace-clouds-midnight .ace_storage,.ace-clouds-midnight .ace_support.ace_class,.ace-clouds-midnight .ace_support.ace_function,.ace-clouds-midnight .ace_support.ace_other,.ace-clouds-midnight .ace_support.ace_type {color: #E92E2E}.ace-clouds-midnight .ace_string {color: #5D90CD}.ace-clouds-midnight .ace_comment {color: #3C403B}.ace-clouds-midnight .ace_entity.ace_name.ace_tag,.ace-clouds-midnight .ace_entity.ace_other.ace_attribute-name {color: #606060}.ace-clouds-midnight .ace_indent-guide {background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAEklEQVQImWNgYGBgYHB3d/8PAAOIAdULw8qMAAAAAElFTkSuQmCC) right repeat-y}";var r=e("../lib/dom");r.importCssString(t.cssText,t.cssClass)})
|
framework/js/ace/theme-cobalt.js
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
ace.define("ace/theme/cobalt",["require","exports","module","ace/lib/dom"],function(e,t,n){t.isDark=!0,t.cssClass="ace-cobalt",t.cssText=".ace-cobalt .ace_gutter {background: #011e3a;color: #fff}.ace-cobalt .ace_print-margin {width: 1px;background: #011e3a}.ace-cobalt {background-color: #002240;color: #FFFFFF}.ace-cobalt .ace_cursor {color: #FFFFFF}.ace-cobalt .ace_marker-layer .ace_selection {background: rgba(179, 101, 57, 0.75)}.ace-cobalt.ace_multiselect .ace_selection.ace_start {box-shadow: 0 0 3px 0px #002240;border-radius: 2px}.ace-cobalt .ace_marker-layer .ace_step {background: rgb(127, 111, 19)}.ace-cobalt .ace_marker-layer .ace_bracket {margin: -1px 0 0 -1px;border: 1px solid rgba(255, 255, 255, 0.15)}.ace-cobalt .ace_marker-layer .ace_active-line {background: rgba(0, 0, 0, 0.35)}.ace-cobalt .ace_gutter-active-line {background-color: rgba(0, 0, 0, 0.35)}.ace-cobalt .ace_marker-layer .ace_selected-word {border: 1px solid rgba(179, 101, 57, 0.75)}.ace-cobalt .ace_invisible {color: rgba(255, 255, 255, 0.15)}.ace-cobalt .ace_keyword,.ace-cobalt .ace_meta {color: #FF9D00}.ace-cobalt .ace_constant,.ace-cobalt .ace_constant.ace_character,.ace-cobalt .ace_constant.ace_character.ace_escape,.ace-cobalt .ace_constant.ace_other {color: #FF628C}.ace-cobalt .ace_invalid {color: #F8F8F8;background-color: #800F00}.ace-cobalt .ace_support {color: #80FFBB}.ace-cobalt .ace_support.ace_constant {color: #EB939A}.ace-cobalt .ace_fold {background-color: #FF9D00;border-color: #FFFFFF}.ace-cobalt .ace_support.ace_function {color: #FFB054}.ace-cobalt .ace_storage {color: #FFEE80}.ace-cobalt .ace_entity {color: #FFDD00}.ace-cobalt .ace_string {color: #3AD900}.ace-cobalt .ace_string.ace_regexp {color: #80FFC2}.ace-cobalt .ace_comment {font-style: italic;color: #0088FF}.ace-cobalt .ace_heading,.ace-cobalt .ace_markup.ace_heading {color: #C8E4FD;background-color: #001221}.ace-cobalt .ace_list,.ace-cobalt .ace_markup.ace_list {background-color: #130D26}.ace-cobalt .ace_variable {color: #CCCCCC}.ace-cobalt .ace_variable.ace_language {color: #FF80E1}.ace-cobalt .ace_meta.ace_tag {color: #9EFFFF}.ace-cobalt .ace_indent-guide {background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAEklEQVQImWNgYGBgYHCLSvkPAAP3AgSDTRd4AAAAAElFTkSuQmCC) right repeat-y}";var r=e("../lib/dom");r.importCssString(t.cssText,t.cssClass)})
|
framework/js/ace/theme-crimson_editor.js
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
ace.define("ace/theme/crimson_editor",["require","exports","module","ace/lib/dom"],function(e,t,n){t.isDark=!1,t.cssText='.ace-crimson-editor .ace_gutter {background: #ebebeb;color: #333;overflow : hidden;}.ace-crimson-editor .ace_gutter-layer {width: 100%;text-align: right;}.ace-crimson-editor .ace_print-margin {width: 1px;background: #e8e8e8;}.ace-crimson-editor {background-color: #FFFFFF;color: rgb(64, 64, 64);}.ace-crimson-editor .ace_cursor {color: black;}.ace-crimson-editor .ace_invisible {color: rgb(191, 191, 191);}.ace-crimson-editor .ace_identifier {color: black;}.ace-crimson-editor .ace_keyword {color: blue;}.ace-crimson-editor .ace_constant.ace_buildin {color: rgb(88, 72, 246);}.ace-crimson-editor .ace_constant.ace_language {color: rgb(255, 156, 0);}.ace-crimson-editor .ace_constant.ace_library {color: rgb(6, 150, 14);}.ace-crimson-editor .ace_invalid {text-decoration: line-through;color: rgb(224, 0, 0);}.ace-crimson-editor .ace_fold {}.ace-crimson-editor .ace_support.ace_function {color: rgb(192, 0, 0);}.ace-crimson-editor .ace_support.ace_constant {color: rgb(6, 150, 14);}.ace-crimson-editor .ace_support.ace_type,.ace-crimson-editor .ace_support.ace_class {color: rgb(109, 121, 222);}.ace-crimson-editor .ace_keyword.ace_operator {color: rgb(49, 132, 149);}.ace-crimson-editor .ace_string {color: rgb(128, 0, 128);}.ace-crimson-editor .ace_comment {color: rgb(76, 136, 107);}.ace-crimson-editor .ace_comment.ace_doc {color: rgb(0, 102, 255);}.ace-crimson-editor .ace_comment.ace_doc.ace_tag {color: rgb(128, 159, 191);}.ace-crimson-editor .ace_constant.ace_numeric {color: rgb(0, 0, 64);}.ace-crimson-editor .ace_variable {color: rgb(0, 64, 128);}.ace-crimson-editor .ace_xml-pe {color: rgb(104, 104, 91);}.ace-crimson-editor .ace_marker-layer .ace_selection {background: rgb(181, 213, 255);}.ace-crimson-editor .ace_marker-layer .ace_step {background: rgb(252, 255, 0);}.ace-crimson-editor .ace_marker-layer .ace_stack {background: rgb(164, 229, 101);}.ace-crimson-editor .ace_marker-layer .ace_bracket {margin: -1px 0 0 -1px;border: 1px solid rgb(192, 192, 192);}.ace-crimson-editor .ace_marker-layer .ace_active-line {background: rgb(232, 242, 254);}.ace-crimson-editor .ace_gutter-active-line {background-color : #dcdcdc;}.ace-crimson-editor .ace_meta.ace_tag {color:rgb(28, 2, 255);}.ace-crimson-editor .ace_marker-layer .ace_selected-word {background: rgb(250, 250, 255);border: 1px solid rgb(200, 200, 250);}.ace-crimson-editor .ace_string.ace_regex {color: rgb(192, 0, 192);}.ace-crimson-editor .ace_indent-guide {background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAE0lEQVQImWP4////f4bLly//BwAmVgd1/w11/gAAAABJRU5ErkJggg==") right repeat-y;}',t.cssClass="ace-crimson-editor";var r=e("../lib/dom");r.importCssString(t.cssText,t.cssClass)})
|
framework/js/ace/theme-dawn.js
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
ace.define("ace/theme/dawn",["require","exports","module","ace/lib/dom"],function(e,t,n){t.isDark=!1,t.cssClass="ace-dawn",t.cssText=".ace-dawn .ace_gutter {background: #ebebeb;color: #333}.ace-dawn .ace_print-margin {width: 1px;background: #e8e8e8}.ace-dawn {background-color: #F9F9F9;color: #080808}.ace-dawn .ace_cursor {color: #000000}.ace-dawn .ace_marker-layer .ace_selection {background: rgba(39, 95, 255, 0.30)}.ace-dawn.ace_multiselect .ace_selection.ace_start {box-shadow: 0 0 3px 0px #F9F9F9;border-radius: 2px}.ace-dawn .ace_marker-layer .ace_step {background: rgb(255, 255, 0)}.ace-dawn .ace_marker-layer .ace_bracket {margin: -1px 0 0 -1px;border: 1px solid rgba(75, 75, 126, 0.50)}.ace-dawn .ace_marker-layer .ace_active-line {background: rgba(36, 99, 180, 0.12)}.ace-dawn .ace_gutter-active-line {background-color : #dcdcdc}.ace-dawn .ace_marker-layer .ace_selected-word {border: 1px solid rgba(39, 95, 255, 0.30)}.ace-dawn .ace_invisible {color: rgba(75, 75, 126, 0.50)}.ace-dawn .ace_keyword,.ace-dawn .ace_meta {color: #794938}.ace-dawn .ace_constant,.ace-dawn .ace_constant.ace_character,.ace-dawn .ace_constant.ace_character.ace_escape,.ace-dawn .ace_constant.ace_other {color: #811F24}.ace-dawn .ace_invalid.ace_illegal {text-decoration: underline;font-style: italic;color: #F8F8F8;background-color: #B52A1D}.ace-dawn .ace_invalid.ace_deprecated {text-decoration: underline;font-style: italic;color: #B52A1D}.ace-dawn .ace_support {color: #691C97}.ace-dawn .ace_support.ace_constant {color: #B4371F}.ace-dawn .ace_fold {background-color: #794938;border-color: #080808}.ace-dawn .ace_list,.ace-dawn .ace_markup.ace_list,.ace-dawn .ace_support.ace_function {color: #693A17}.ace-dawn .ace_storage {font-style: italic;color: #A71D5D}.ace-dawn .ace_string {color: #0B6125}.ace-dawn .ace_string.ace_regexp {color: #CF5628}.ace-dawn .ace_comment {font-style: italic;color: #5A525F}.ace-dawn .ace_heading,.ace-dawn .ace_markup.ace_heading {color: #19356D}.ace-dawn .ace_variable {color: #234A97}.ace-dawn .ace_indent-guide {background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAEklEQVQImWNgYGBgYLh/5+x/AAizA4hxNNsZAAAAAElFTkSuQmCC) right repeat-y}";var r=e("../lib/dom");r.importCssString(t.cssText,t.cssClass)})
|
framework/js/ace/theme-dreamweaver.js
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
ace.define("ace/theme/dreamweaver",["require","exports","module","ace/lib/dom"],function(e,t,n){t.isDark=!1,t.cssClass="ace-dreamweaver",t.cssText='.ace-dreamweaver .ace_gutter {background: #e8e8e8;color: #333;}.ace-dreamweaver .ace_print-margin {width: 1px;background: #e8e8e8;}.ace-dreamweaver {background-color: #FFFFFF;}.ace-dreamweaver .ace_fold {background-color: #757AD8;}.ace-dreamweaver .ace_cursor {color: black;}.ace-dreamweaver .ace_invisible {color: rgb(191, 191, 191);}.ace-dreamweaver .ace_storage,.ace-dreamweaver .ace_keyword {color: blue;}.ace-dreamweaver .ace_constant.ace_buildin {color: rgb(88, 72, 246);}.ace-dreamweaver .ace_constant.ace_language {color: rgb(88, 92, 246);}.ace-dreamweaver .ace_constant.ace_library {color: rgb(6, 150, 14);}.ace-dreamweaver .ace_invalid {background-color: rgb(153, 0, 0);color: white;}.ace-dreamweaver .ace_support.ace_function {color: rgb(60, 76, 114);}.ace-dreamweaver .ace_support.ace_constant {color: rgb(6, 150, 14);}.ace-dreamweaver .ace_support.ace_type,.ace-dreamweaver .ace_support.ace_class {color: #009;}.ace-dreamweaver .ace_support.ace_php_tag {color: #f00;}.ace-dreamweaver .ace_keyword.ace_operator {color: rgb(104, 118, 135);}.ace-dreamweaver .ace_string {color: #00F;}.ace-dreamweaver .ace_comment {color: rgb(76, 136, 107);}.ace-dreamweaver .ace_comment.ace_doc {color: rgb(0, 102, 255);}.ace-dreamweaver .ace_comment.ace_doc.ace_tag {color: rgb(128, 159, 191);}.ace-dreamweaver .ace_constant.ace_numeric {color: rgb(0, 0, 205);}.ace-dreamweaver .ace_variable {color: #06F}.ace-dreamweaver .ace_xml-pe {color: rgb(104, 104, 91);}.ace-dreamweaver .ace_entity.ace_name.ace_function {color: #00F;}.ace-dreamweaver .ace_heading {color: rgb(12, 7, 255);}.ace-dreamweaver .ace_list {color:rgb(185, 6, 144);}.ace-dreamweaver .ace_marker-layer .ace_selection {background: rgb(181, 213, 255);}.ace-dreamweaver .ace_marker-layer .ace_step {background: rgb(252, 255, 0);}.ace-dreamweaver .ace_marker-layer .ace_stack {background: rgb(164, 229, 101);}.ace-dreamweaver .ace_marker-layer .ace_bracket {margin: -1px 0 0 -1px;border: 1px solid rgb(192, 192, 192);}.ace-dreamweaver .ace_marker-layer .ace_active-line {background: rgba(0, 0, 0, 0.07);}.ace-dreamweaver .ace_marker-layer .ace_selected-word {background: rgb(250, 250, 255);border: 1px solid rgb(200, 200, 250);}.ace-dreamweaver .ace_meta.ace_tag {color:#009;}.ace-dreamweaver .ace_meta.ace_tag.ace_anchor {color:#060;}.ace-dreamweaver .ace_meta.ace_tag.ace_form {color:#F90;}.ace-dreamweaver .ace_meta.ace_tag.ace_image {color:#909;}.ace-dreamweaver .ace_meta.ace_tag.ace_script {color:#900;}.ace-dreamweaver .ace_meta.ace_tag.ace_style {color:#909;}.ace-dreamweaver .ace_meta.ace_tag.ace_table {color:#099;}.ace-dreamweaver .ace_string.ace_regex {color: rgb(255, 0, 0)}.ace-dreamweaver .ace_indent-guide {background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAE0lEQVQImWP4////f4bLly//BwAmVgd1/w11/gAAAABJRU5ErkJggg==") right repeat-y;}';var r=e("../lib/dom");r.importCssString(t.cssText,t.cssClass)})
|
framework/js/ace/theme-eclipse.js
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
ace.define("ace/theme/eclipse",["require","exports","module","ace/lib/dom"],function(e,t,n){t.isDark=!1,t.cssText='.ace-eclipse .ace_gutter {background: #ebebeb;border-right: 1px solid rgb(159, 159, 159);color: rgb(136, 136, 136);}.ace-eclipse .ace_print-margin {width: 1px;background: #ebebeb;}.ace-eclipse {background-color: #FFFFFF;}.ace-eclipse .ace_fold {background-color: rgb(60, 76, 114);}.ace-eclipse .ace_cursor {color: black;}.ace-eclipse .ace_storage,.ace-eclipse .ace_keyword,.ace-eclipse .ace_variable {color: rgb(127, 0, 85);}.ace-eclipse .ace_constant.ace_buildin {color: rgb(88, 72, 246);}.ace-eclipse .ace_constant.ace_library {color: rgb(6, 150, 14);}.ace-eclipse .ace_function {color: rgb(60, 76, 114);}.ace-eclipse .ace_string {color: rgb(42, 0, 255);}.ace-eclipse .ace_comment {color: rgb(113, 150, 130);}.ace-eclipse .ace_comment.ace_doc {color: rgb(63, 95, 191);}.ace-eclipse .ace_comment.ace_doc.ace_tag {color: rgb(127, 159, 191);}.ace-eclipse .ace_constant.ace_numeric {color: darkblue;}.ace-eclipse .ace_tag {color: rgb(25, 118, 116);}.ace-eclipse .ace_type {color: rgb(127, 0, 127);}.ace-eclipse .ace_xml-pe {color: rgb(104, 104, 91);}.ace-eclipse .ace_marker-layer .ace_selection {background: rgb(181, 213, 255);}.ace-eclipse .ace_marker-layer .ace_bracket {margin: -1px 0 0 -1px;border: 1px solid rgb(192, 192, 192);}.ace-eclipse .ace_meta.ace_tag {color:rgb(25, 118, 116);}.ace-eclipse .ace_invisible {color: #ddd;}.ace-eclipse .ace_entity.ace_other.ace_attribute-name {color:rgb(127, 0, 127);}.ace-eclipse .ace_marker-layer .ace_step {background: rgb(255, 255, 0);}.ace-eclipse .ace_marker-layer .ace_active-line {background: rgb(232, 242, 254);}.ace-eclipse .ace_marker-layer .ace_selected-word {border: 1px solid rgb(181, 213, 255);}.ace-eclipse .ace_indent-guide {background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAE0lEQVQImWP4////f4bLly//BwAmVgd1/w11/gAAAABJRU5ErkJggg==") right repeat-y;}',t.cssClass="ace-eclipse";var r=e("../lib/dom");r.importCssString(t.cssText,t.cssClass)})
|
framework/js/ace/theme-github.js
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
ace.define("ace/theme/github",["require","exports","module","ace/lib/dom"],function(e,t,n){t.isDark=!1,t.cssClass="ace-github",t.cssText='/* CSS style content from github\'s default pygments highlighter template.Cursor and selection styles from textmate.css. */.ace-github .ace_gutter {background: #e8e8e8;color: #AAA;}.ace-github {background: #fff;color: #000;}.ace-github .ace_keyword {font-weight: bold;}.ace-github .ace_string {color: #D14;}.ace-github .ace_variable.ace_class {color: teal;}.ace-github .ace_constant.ace_numeric {color: #099;}.ace-github .ace_constant.ace_buildin {color: #0086B3;}.ace-github .ace_support.ace_function {color: #0086B3;}.ace-github .ace_comment {color: #998;font-style: italic;}.ace-github .ace_variable.ace_language {color: #0086B3;}.ace-github .ace_paren {font-weight: bold;}.ace-github .ace_boolean {font-weight: bold;}.ace-github .ace_string.ace_regexp {color: #009926;font-weight: normal;}.ace-github .ace_variable.ace_instance {color: teal;}.ace-github .ace_constant.ace_language {font-weight: bold;}.ace-github .ace_cursor {color: black;}.ace-github .ace_marker-layer .ace_active-line {background: rgb(255, 255, 204);}.ace-github .ace_marker-layer .ace_selection {background: rgb(181, 213, 255);}.ace-github.ace_multiselect .ace_selection.ace_start {box-shadow: 0 0 3px 0px white;border-radius: 2px;}/* bold keywords cause cursor issues for some fonts *//* this disables bold style for editor and keeps for static highlighter */.ace-github.ace_nobold .ace_line > span {font-weight: normal !important;}.ace-github .ace_marker-layer .ace_step {background: rgb(252, 255, 0);}.ace-github .ace_marker-layer .ace_stack {background: rgb(164, 229, 101);}.ace-github .ace_marker-layer .ace_bracket {margin: -1px 0 0 -1px;border: 1px solid rgb(192, 192, 192);}.ace-github .ace_gutter-active-line {background-color : rgba(0, 0, 0, 0.07);}.ace-github .ace_marker-layer .ace_selected-word {background: rgb(250, 250, 255);border: 1px solid rgb(200, 200, 250);}.ace-github .ace_print-margin {width: 1px;background: #e8e8e8;}.ace-github .ace_indent-guide {background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAE0lEQVQImWP4////f4bLly//BwAmVgd1/w11/gAAAABJRU5ErkJggg==") right repeat-y;}';var r=e("../lib/dom");r.importCssString(t.cssText,t.cssClass)})
|
framework/js/ace/theme-idle_fingers.js
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
ace.define("ace/theme/idle_fingers",["require","exports","module","ace/lib/dom"],function(e,t,n){t.isDark=!0,t.cssClass="ace-idle-fingers",t.cssText=".ace-idle-fingers .ace_gutter {background: #3b3b3b;color: #fff}.ace-idle-fingers .ace_print-margin {width: 1px;background: #3b3b3b}.ace-idle-fingers {background-color: #323232;color: #FFFFFF}.ace-idle-fingers .ace_cursor {color: #91FF00}.ace-idle-fingers .ace_marker-layer .ace_selection {background: rgba(90, 100, 126, 0.88)}.ace-idle-fingers.ace_multiselect .ace_selection.ace_start {box-shadow: 0 0 3px 0px #323232;border-radius: 2px}.ace-idle-fingers .ace_marker-layer .ace_step {background: rgb(102, 82, 0)}.ace-idle-fingers .ace_marker-layer .ace_bracket {margin: -1px 0 0 -1px;border: 1px solid #404040}.ace-idle-fingers .ace_marker-layer .ace_active-line {background: #353637}.ace-idle-fingers .ace_gutter-active-line {background-color: #353637}.ace-idle-fingers .ace_marker-layer .ace_selected-word {border: 1px solid rgba(90, 100, 126, 0.88)}.ace-idle-fingers .ace_invisible {color: #404040}.ace-idle-fingers .ace_keyword,.ace-idle-fingers .ace_meta {color: #CC7833}.ace-idle-fingers .ace_constant,.ace-idle-fingers .ace_constant.ace_character,.ace-idle-fingers .ace_constant.ace_character.ace_escape,.ace-idle-fingers .ace_constant.ace_other,.ace-idle-fingers .ace_support.ace_constant {color: #6C99BB}.ace-idle-fingers .ace_invalid {color: #FFFFFF;background-color: #FF0000}.ace-idle-fingers .ace_fold {background-color: #CC7833;border-color: #FFFFFF}.ace-idle-fingers .ace_support.ace_function {color: #B83426}.ace-idle-fingers .ace_variable.ace_parameter {font-style: italic}.ace-idle-fingers .ace_string {color: #A5C261}.ace-idle-fingers .ace_string.ace_regexp {color: #CCCC33}.ace-idle-fingers .ace_comment {font-style: italic;color: #BC9458}.ace-idle-fingers .ace_meta.ace_tag {color: #FFE5BB}.ace-idle-fingers .ace_entity.ace_name {color: #FFC66D}.ace-idle-fingers .ace_collab.ace_user1 {color: #323232;background-color: #FFF980}.ace-idle-fingers .ace_indent-guide {background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAEklEQVQImWMwMjLyZYiPj/8PAAreAwAI1+g0AAAAAElFTkSuQmCC) right repeat-y}";var r=e("../lib/dom");r.importCssString(t.cssText,t.cssClass)})
|
framework/js/ace/theme-katzenmilch.js
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
ace.define("ace/theme/katzenmilch",["require","exports","module","ace/lib/dom"],function(e,t,n){t.isDark=!1,t.cssClass="ace-katzenmilch",t.cssText=".ace-katzenmilch .ace_gutter,/* THIS THEME WAS AUTOGENERATED BY Theme.tmpl.css (UUID: ) */.ace-katzenmilch .ace_gutter {background: #e8e8e8;color: #333}.ace-katzenmilch .ace_print-margin {width: 1px;background: #e8e8e8}.ace-katzenmilch {background-color: #f3f2f3;color: rgba(15, 0, 9, 1.0)}.ace-katzenmilch .ace_cursor {border-left: 2px solid #100011}.ace-katzenmilch .ace_overwrite-cursors .ace_cursor {border-left: 0px;border-bottom: 1px solid #100011}.ace-katzenmilch .ace_marker-layer .ace_selection {background: rgba(100, 5, 208, 0.27)}.ace-katzenmilch.ace_multiselect .ace_selection.ace_start {box-shadow: 0 0 3px 0px #f3f2f3;border-radius: 2px}.ace-katzenmilch .ace_marker-layer .ace_step {background: rgb(198, 219, 174)}.ace-katzenmilch .ace_marker-layer .ace_bracket {margin: -1px 0 0 -1px;border: 1px solid #000000}.ace-katzenmilch .ace_marker-layer .ace_active-line {background: rgb(232, 242, 254)}.ace-katzenmilch .ace_gutter-active-line {background-color: rgb(232, 242, 254)}.ace-katzenmilch .ace_marker-layer .ace_selected-word {border: 1px solid rgba(100, 5, 208, 0.27)}.ace-katzenmilch .ace_fold {background-color: rgba(2, 95, 73, 0.97);border-color: rgba(15, 0, 9, 1.0)}.ace-katzenmilch .ace_keyword {color: #674Aa8;rbackground-color: rgba(163, 170, 216, 0.055)}.ace-katzenmilch .ace_constant.ace_language {color: #7D7e52;rbackground-color: rgba(189, 190, 130, 0.059)}.ace-katzenmilch .ace_constant.ace_numeric {color: rgba(79, 130, 123, 0.93);rbackground-color: rgba(119, 194, 187, 0.059)}.ace-katzenmilch .ace_constant.ace_character,.ace-katzenmilch .ace_constant.ace_other {color: rgba(2, 95, 105, 1.0);rbackground-color: rgba(127, 34, 153, 0.063)}.ace-katzenmilch .ace_support.ace_function {color: #9D7e62;rbackground-color: rgba(189, 190, 130, 0.039)}.ace-katzenmilch .ace_support.ace_class {color: rgba(239, 106, 167, 1.0);rbackground-color: rgba(239, 106, 167, 0.063)}.ace-katzenmilch .ace_storage {color: rgba(123, 92, 191, 1.0);rbackground-color: rgba(139, 93, 223, 0.051)}.ace-katzenmilch .ace_invalid {color: #DFDFD5;rbackground-color: #CC1B27}.ace-katzenmilch .ace_string {color: #5a5f9b;rbackground-color: rgba(170, 175, 219, 0.035)}.ace-katzenmilch .ace_comment {font-style: italic;color: rgba(64, 79, 80, 0.67);rbackground-color: rgba(95, 15, 255, 0.0078)}.ace-katzenmilch .ace_entity.ace_name.ace_function,.ace-katzenmilch .ace_variable {color: rgba(2, 95, 73, 0.97);rbackground-color: rgba(34, 255, 73, 0.12)}.ace-katzenmilch .ace_variable.ace_language {color: #316fcf;rbackground-color: rgba(58, 175, 255, 0.039)}.ace-katzenmilch .ace_variable.ace_parameter {font-style: italic;color: rgba(51, 150, 159, 0.87);rbackground-color: rgba(5, 214, 249, 0.043)}.ace-katzenmilch .ace_entity.ace_other.ace_attribute-name {color: rgba(73, 70, 194, 0.93);rbackground-color: rgba(73, 134, 194, 0.035)}.ace-katzenmilch .ace_entity.ace_name.ace_tag {color: #3976a2;rbackground-color: rgba(73, 166, 210, 0.039)}";var r=e("../lib/dom");r.importCssString(t.cssText,t.cssClass)})
|
framework/js/ace/theme-kr.js
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
ace.define("ace/theme/kr",["require","exports","module","ace/lib/dom"],function(e,t,n){t.isDark=!0,t.cssClass="ace-kr-theme",t.cssText=".ace-kr-theme .ace_gutter {background: #1c1917;color: #FCFFE0}.ace-kr-theme .ace_print-margin {width: 1px;background: #1c1917}.ace-kr-theme {background-color: #0B0A09;color: #FCFFE0}.ace-kr-theme .ace_cursor {color: #FF9900}.ace-kr-theme .ace_marker-layer .ace_selection {background: rgba(170, 0, 255, 0.45)}.ace-kr-theme.ace_multiselect .ace_selection.ace_start {box-shadow: 0 0 3px 0px #0B0A09;border-radius: 2px}.ace-kr-theme .ace_marker-layer .ace_step {background: rgb(102, 82, 0)}.ace-kr-theme .ace_marker-layer .ace_bracket {margin: -1px 0 0 -1px;border: 1px solid rgba(255, 177, 111, 0.32)}.ace-kr-theme .ace_marker-layer .ace_active-line {background: #38403D}.ace-kr-theme .ace_gutter-active-line {background-color : #38403D}.ace-kr-theme .ace_marker-layer .ace_selected-word {border: 1px solid rgba(170, 0, 255, 0.45)}.ace-kr-theme .ace_invisible {color: rgba(255, 177, 111, 0.32)}.ace-kr-theme .ace_keyword,.ace-kr-theme .ace_meta {color: #949C8B}.ace-kr-theme .ace_constant,.ace-kr-theme .ace_constant.ace_character,.ace-kr-theme .ace_constant.ace_character.ace_escape,.ace-kr-theme .ace_constant.ace_other {color: rgba(210, 117, 24, 0.76)}.ace-kr-theme .ace_invalid {color: #F8F8F8;background-color: #A41300}.ace-kr-theme .ace_support {color: #9FC28A}.ace-kr-theme .ace_support.ace_constant {color: #C27E66}.ace-kr-theme .ace_fold {background-color: #949C8B;border-color: #FCFFE0}.ace-kr-theme .ace_support.ace_function {color: #85873A}.ace-kr-theme .ace_storage {color: #FFEE80}.ace-kr-theme .ace_string {color: rgba(164, 161, 181, 0.8)}.ace-kr-theme .ace_string.ace_regexp {color: rgba(125, 255, 192, 0.65)}.ace-kr-theme .ace_comment {font-style: italic;color: #706D5B}.ace-kr-theme .ace_variable {color: #D1A796}.ace-kr-theme .ace_list,.ace-kr-theme .ace_markup.ace_list {background-color: #0F0040}.ace-kr-theme .ace_variable.ace_language {color: #FF80E1}.ace-kr-theme .ace_meta.ace_tag {color: #BABD9C}.ace-kr-theme .ace_indent-guide {background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAEklEQVQImWNgYGBgYFBXV/8PAAJoAXX4kT2EAAAAAElFTkSuQmCC) right repeat-y}";var r=e("../lib/dom");r.importCssString(t.cssText,t.cssClass)})
|
framework/js/ace/theme-kuroir.js
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
ace.define("ace/theme/kuroir",["require","exports","module","ace/lib/dom"],function(e,t,n){t.isDark=!1,t.cssClass="ace-kuroir",t.cssText="/* THIS THEME WAS AUTOGENERATED BY Theme.tmpl.css (UUID: 467560D0-6ACE-4409-82FD-4791420837AC) */.ace-kuroir .ace_gutter {background: #e8e8e8;color: #333;}.ace-kuroir .ace_print-margin {width: 1px;background: #e8e8e8;}.ace-kuroir {background-color: #E8E9E8;color: #363636;}.ace-kuroir .ace_cursor {color: #202020;}.ace-kuroir .ace_marker-layer .ace_selection {background: rgba(245, 170, 0, 0.57);}.ace-kuroir.ace_multiselect .ace_selection.ace_start {box-shadow: 0 0 3px 0px #E8E9E8;border-radius: 2px;}.ace-kuroir .ace_marker-layer .ace_step {background: rgb(198, 219, 174);}.ace-kuroir .ace_marker-layer .ace_bracket {margin: -1px 0 0 -1px;border: 1px solid rgba(0, 0, 0, 0.29);}.ace-kuroir .ace_marker-layer .ace_active-line {background: rgba(203, 220, 47, 0.22);}.ace-kuroir .ace_gutter-active-line {background-color: rgba(203, 220, 47, 0.22);}.ace-kuroir .ace_marker-layer .ace_selected-word {border: 1px solid rgba(245, 170, 0, 0.57);}.ace-kuroir .ace_fold {background-color: ;border-color: #363636;}.ace-kuroir .ace_constant{color:#CD6839;}.ace-kuroir .ace_constant.ace_numeric{color:#9A5925;}.ace-kuroir .ace_support{color:#104E8B;}.ace-kuroir .ace_support.ace_function{color:#005273;}.ace-kuroir .ace_support.ace_constant{color:#CF6A4C;}.ace-kuroir .ace_storage{color:#A52A2A;}.ace-kuroir .ace_invalid.ace_illegal{color:#FD1224;background-color:rgba(255, 6, 0, 0.15);}.ace-kuroir .ace_invalid.ace_deprecated{text-decoration:underline;font-style:italic;color:#FD1732;background-color:#E8E9E8;}.ace-kuroir .ace_string{color:#639300;}.ace-kuroir .ace_string.ace_regexp{color:#417E00;background-color:#C9D4BE;}.ace-kuroir .ace_comment{color:rgba(148, 148, 148, 0.91);background-color:rgba(220, 220, 220, 0.56);}.ace-kuroir .ace_variable{color:#009ACD;}.ace-kuroir .ace_meta.ace_tag{color:#005273;}.ace-kuroir .ace_markup.ace_heading{color:#B8012D;background-color:rgba(191, 97, 51, 0.051);}.ace-kuroir .ace_markup.ace_list{color:#8F5B26;}";var r=e("../lib/dom");r.importCssString(t.cssText,t.cssClass)})
|
framework/js/ace/theme-merbivore.js
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
ace.define("ace/theme/merbivore",["require","exports","module","ace/lib/dom"],function(e,t,n){t.isDark=!0,t.cssClass="ace-merbivore",t.cssText=".ace-merbivore .ace_gutter {background: #202020;color: #E6E1DC}.ace-merbivore .ace_print-margin {width: 1px;background: #555651}.ace-merbivore {background-color: #161616;color: #E6E1DC}.ace-merbivore .ace_cursor {color: #FFFFFF}.ace-merbivore .ace_marker-layer .ace_selection {background: #454545}.ace-merbivore.ace_multiselect .ace_selection.ace_start {box-shadow: 0 0 3px 0px #161616;border-radius: 2px}.ace-merbivore .ace_marker-layer .ace_step {background: rgb(102, 82, 0)}.ace-merbivore .ace_marker-layer .ace_bracket {margin: -1px 0 0 -1px;border: 1px solid #404040}.ace-merbivore .ace_marker-layer .ace_active-line {background: #333435}.ace-merbivore .ace_gutter-active-line {background-color: #333435}.ace-merbivore .ace_marker-layer .ace_selected-word {border: 1px solid #454545}.ace-merbivore .ace_invisible {color: #404040}.ace-merbivore .ace_entity.ace_name.ace_tag,.ace-merbivore .ace_keyword,.ace-merbivore .ace_meta,.ace-merbivore .ace_meta.ace_tag,.ace-merbivore .ace_storage,.ace-merbivore .ace_support.ace_function {color: #FC6F09}.ace-merbivore .ace_constant,.ace-merbivore .ace_constant.ace_character,.ace-merbivore .ace_constant.ace_character.ace_escape,.ace-merbivore .ace_constant.ace_other,.ace-merbivore .ace_support.ace_type {color: #1EDAFB}.ace-merbivore .ace_constant.ace_character.ace_escape {color: #519F50}.ace-merbivore .ace_constant.ace_language {color: #FDC251}.ace-merbivore .ace_constant.ace_library,.ace-merbivore .ace_string,.ace-merbivore .ace_support.ace_constant {color: #8DFF0A}.ace-merbivore .ace_constant.ace_numeric {color: #58C554}.ace-merbivore .ace_invalid {color: #FFFFFF;background-color: #990000}.ace-merbivore .ace_fold {background-color: #FC6F09;border-color: #E6E1DC}.ace-merbivore .ace_comment {font-style: italic;color: #AD2EA4}.ace-merbivore .ace_entity.ace_other.ace_attribute-name {color: #FFFF89}.ace-merbivore .ace_indent-guide {background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAEklEQVQImWMQFxf3ZXB1df0PAAdsAmERTkEHAAAAAElFTkSuQmCC) right repeat-y}";var r=e("../lib/dom");r.importCssString(t.cssText,t.cssClass)})
|
framework/js/ace/theme-merbivore_soft.js
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
ace.define("ace/theme/merbivore_soft",["require","exports","module","ace/lib/dom"],function(e,t,n){t.isDark=!0,t.cssClass="ace-merbivore-soft",t.cssText=".ace-merbivore-soft .ace_gutter {background: #262424;color: #E6E1DC}.ace-merbivore-soft .ace_print-margin {width: 1px;background: #262424}.ace-merbivore-soft {background-color: #1C1C1C;color: #E6E1DC}.ace-merbivore-soft .ace_cursor {color: #FFFFFF}.ace-merbivore-soft .ace_marker-layer .ace_selection {background: #494949}.ace-merbivore-soft.ace_multiselect .ace_selection.ace_start {box-shadow: 0 0 3px 0px #1C1C1C;border-radius: 2px}.ace-merbivore-soft .ace_marker-layer .ace_step {background: rgb(102, 82, 0)}.ace-merbivore-soft .ace_marker-layer .ace_bracket {margin: -1px 0 0 -1px;border: 1px solid #404040}.ace-merbivore-soft .ace_marker-layer .ace_active-line {background: #333435}.ace-merbivore-soft .ace_gutter-active-line {background-color: #333435}.ace-merbivore-soft .ace_marker-layer .ace_selected-word {border: 1px solid #494949}.ace-merbivore-soft .ace_invisible {color: #404040}.ace-merbivore-soft .ace_entity.ace_name.ace_tag,.ace-merbivore-soft .ace_keyword,.ace-merbivore-soft .ace_meta,.ace-merbivore-soft .ace_meta.ace_tag,.ace-merbivore-soft .ace_storage {color: #FC803A}.ace-merbivore-soft .ace_constant,.ace-merbivore-soft .ace_constant.ace_character,.ace-merbivore-soft .ace_constant.ace_character.ace_escape,.ace-merbivore-soft .ace_constant.ace_other,.ace-merbivore-soft .ace_support.ace_type {color: #68C1D8}.ace-merbivore-soft .ace_constant.ace_character.ace_escape {color: #B3E5B4}.ace-merbivore-soft .ace_constant.ace_language {color: #E1C582}.ace-merbivore-soft .ace_constant.ace_library,.ace-merbivore-soft .ace_string,.ace-merbivore-soft .ace_support.ace_constant {color: #8EC65F}.ace-merbivore-soft .ace_constant.ace_numeric {color: #7FC578}.ace-merbivore-soft .ace_invalid,.ace-merbivore-soft .ace_invalid.ace_deprecated {color: #FFFFFF;background-color: #FE3838}.ace-merbivore-soft .ace_fold {background-color: #FC803A;border-color: #E6E1DC}.ace-merbivore-soft .ace_comment,.ace-merbivore-soft .ace_meta {font-style: italic;color: #AC4BB8}.ace-merbivore-soft .ace_entity.ace_other.ace_attribute-name {color: #EAF1A3}.ace-merbivore-soft .ace_indent-guide {background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAEklEQVQImWOQkpLyZfD09PwPAAfYAnaStpHRAAAAAElFTkSuQmCC) right repeat-y}";var r=e("../lib/dom");r.importCssString(t.cssText,t.cssClass)})
|
framework/js/ace/theme-mono_industrial.js
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
ace.define("ace/theme/mono_industrial",["require","exports","module","ace/lib/dom"],function(e,t,n){t.isDark=!0,t.cssClass="ace-mono-industrial",t.cssText=".ace-mono-industrial .ace_gutter {background: #1d2521;color: #C5C9C9}.ace-mono-industrial .ace_print-margin {width: 1px;background: #555651}.ace-mono-industrial {background-color: #222C28;color: #FFFFFF}.ace-mono-industrial .ace_cursor {color: #FFFFFF}.ace-mono-industrial .ace_marker-layer .ace_selection {background: rgba(145, 153, 148, 0.40)}.ace-mono-industrial.ace_multiselect .ace_selection.ace_start {box-shadow: 0 0 3px 0px #222C28;border-radius: 2px}.ace-mono-industrial .ace_marker-layer .ace_step {background: rgb(102, 82, 0)}.ace-mono-industrial .ace_marker-layer .ace_bracket {margin: -1px 0 0 -1px;border: 1px solid rgba(102, 108, 104, 0.50)}.ace-mono-industrial .ace_marker-layer .ace_active-line {background: rgba(12, 13, 12, 0.25)}.ace-mono-industrial .ace_gutter-active-line {background-color: rgba(12, 13, 12, 0.25)}.ace-mono-industrial .ace_marker-layer .ace_selected-word {border: 1px solid rgba(145, 153, 148, 0.40)}.ace-mono-industrial .ace_invisible {color: rgba(102, 108, 104, 0.50)}.ace-mono-industrial .ace_string {background-color: #151C19;color: #FFFFFF}.ace-mono-industrial .ace_keyword,.ace-mono-industrial .ace_meta {color: #A39E64}.ace-mono-industrial .ace_constant,.ace-mono-industrial .ace_constant.ace_character,.ace-mono-industrial .ace_constant.ace_character.ace_escape,.ace-mono-industrial .ace_constant.ace_numeric,.ace-mono-industrial .ace_constant.ace_other {color: #E98800}.ace-mono-industrial .ace_entity.ace_name.ace_function,.ace-mono-industrial .ace_keyword.ace_operator,.ace-mono-industrial .ace_variable {color: #A8B3AB}.ace-mono-industrial .ace_invalid {color: #FFFFFF;background-color: rgba(153, 0, 0, 0.68)}.ace-mono-industrial .ace_support.ace_constant {color: #C87500}.ace-mono-industrial .ace_fold {background-color: #A8B3AB;border-color: #FFFFFF}.ace-mono-industrial .ace_support.ace_function {color: #588E60}.ace-mono-industrial .ace_entity.ace_name,.ace-mono-industrial .ace_support.ace_class,.ace-mono-industrial .ace_support.ace_type {color: #5778B6}.ace-mono-industrial .ace_storage {color: #C23B00}.ace-mono-industrial .ace_variable.ace_language,.ace-mono-industrial .ace_variable.ace_parameter {color: #648BD2}.ace-mono-industrial .ace_comment {color: #666C68;background-color: #151C19}.ace-mono-industrial .ace_entity.ace_other.ace_attribute-name {color: #909993}.ace-mono-industrial .ace_entity.ace_name.ace_tag {color: #A65EFF}.ace-mono-industrial .ace_indent-guide {background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAEklEQVQImWNQ1NbwZfALD/4PAAlTArlEC4r/AAAAAElFTkSuQmCC) right repeat-y}";var r=e("../lib/dom");r.importCssString(t.cssText,t.cssClass)})
|
framework/js/ace/theme-monokai.js
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
ace.define("ace/theme/monokai",["require","exports","module","ace/lib/dom"],function(e,t,n){t.isDark=!0,t.cssClass="ace-monokai",t.cssText=".ace-monokai .ace_gutter {background: #2F3129;color: #8F908A}.ace-monokai .ace_print-margin {width: 1px;background: #555651}.ace-monokai {background-color: #272822;color: #F8F8F2}.ace-monokai .ace_cursor {color: #F8F8F0}.ace-monokai .ace_marker-layer .ace_selection {background: #49483E}.ace-monokai.ace_multiselect .ace_selection.ace_start {box-shadow: 0 0 3px 0px #272822;border-radius: 2px}.ace-monokai .ace_marker-layer .ace_step {background: rgb(102, 82, 0)}.ace-monokai .ace_marker-layer .ace_bracket {margin: -1px 0 0 -1px;border: 1px solid #49483E}.ace-monokai .ace_marker-layer .ace_active-line {background: #202020}.ace-monokai .ace_gutter-active-line {background-color: #272727}.ace-monokai .ace_marker-layer .ace_selected-word {border: 1px solid #49483E}.ace-monokai .ace_invisible {color: #52524d}.ace-monokai .ace_entity.ace_name.ace_tag,.ace-monokai .ace_keyword,.ace-monokai .ace_meta.ace_tag,.ace-monokai .ace_storage {color: #F92672}.ace-monokai .ace_punctuation,.ace-monokai .ace_punctuation.ace_tag {color: #fff}.ace-monokai .ace_constant.ace_character,.ace-monokai .ace_constant.ace_language,.ace-monokai .ace_constant.ace_numeric,.ace-monokai .ace_constant.ace_other {color: #AE81FF}.ace-monokai .ace_invalid {color: #F8F8F0;background-color: #F92672}.ace-monokai .ace_invalid.ace_deprecated {color: #F8F8F0;background-color: #AE81FF}.ace-monokai .ace_support.ace_constant,.ace-monokai .ace_support.ace_function {color: #66D9EF}.ace-monokai .ace_fold {background-color: #A6E22E;border-color: #F8F8F2}.ace-monokai .ace_storage.ace_type,.ace-monokai .ace_support.ace_class,.ace-monokai .ace_support.ace_type {font-style: italic;color: #66D9EF}.ace-monokai .ace_entity.ace_name.ace_function,.ace-monokai .ace_entity.ace_other,.ace-monokai .ace_entity.ace_other.ace_attribute-name,.ace-monokai .ace_variable {color: #A6E22E}.ace-monokai .ace_variable.ace_parameter {font-style: italic;color: #FD971F}.ace-monokai .ace_string {color: #E6DB74}.ace-monokai .ace_comment {color: #75715E}.ace-monokai .ace_indent-guide {background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAEklEQVQImWPQ0FD0ZXBzd/wPAAjVAoxeSgNeAAAAAElFTkSuQmCC) right repeat-y}";var r=e("../lib/dom");r.importCssString(t.cssText,t.cssClass)})
|
framework/js/ace/theme-pastel_on_dark.js
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
ace.define("ace/theme/pastel_on_dark",["require","exports","module","ace/lib/dom"],function(e,t,n){t.isDark=!0,t.cssClass="ace-pastel-on-dark",t.cssText=".ace-pastel-on-dark .ace_gutter {background: #353030;color: #8F938F}.ace-pastel-on-dark .ace_print-margin {width: 1px;background: #353030}.ace-pastel-on-dark {background-color: #2C2828;color: #8F938F}.ace-pastel-on-dark .ace_cursor {color: #A7A7A7}.ace-pastel-on-dark .ace_marker-layer .ace_selection {background: rgba(221, 240, 255, 0.20)}.ace-pastel-on-dark.ace_multiselect .ace_selection.ace_start {box-shadow: 0 0 3px 0px #2C2828;border-radius: 2px}.ace-pastel-on-dark .ace_marker-layer .ace_step {background: rgb(102, 82, 0)}.ace-pastel-on-dark .ace_marker-layer .ace_bracket {margin: -1px 0 0 -1px;border: 1px solid rgba(255, 255, 255, 0.25)}.ace-pastel-on-dark .ace_marker-layer .ace_active-line {background: rgba(255, 255, 255, 0.031)}.ace-pastel-on-dark .ace_gutter-active-line {background-color: rgba(255, 255, 255, 0.031)}.ace-pastel-on-dark .ace_marker-layer .ace_selected-word {border: 1px solid rgba(221, 240, 255, 0.20)}.ace-pastel-on-dark .ace_invisible {color: rgba(255, 255, 255, 0.25)}.ace-pastel-on-dark .ace_keyword,.ace-pastel-on-dark .ace_meta {color: #757aD8}.ace-pastel-on-dark .ace_constant,.ace-pastel-on-dark .ace_constant.ace_character,.ace-pastel-on-dark .ace_constant.ace_character.ace_escape,.ace-pastel-on-dark .ace_constant.ace_other {color: #4FB7C5}.ace-pastel-on-dark .ace_keyword.ace_operator {color: #797878}.ace-pastel-on-dark .ace_constant.ace_character {color: #AFA472}.ace-pastel-on-dark .ace_constant.ace_language {color: #DE8E30}.ace-pastel-on-dark .ace_constant.ace_numeric {color: #CCCCCC}.ace-pastel-on-dark .ace_invalid,.ace-pastel-on-dark .ace_invalid.ace_illegal {color: #F8F8F8;background-color: rgba(86, 45, 86, 0.75)}.ace-pastel-on-dark .ace_invalid.ace_deprecated {text-decoration: underline;font-style: italic;color: #D2A8A1}.ace-pastel-on-dark .ace_fold {background-color: #757aD8;border-color: #8F938F}.ace-pastel-on-dark .ace_support.ace_function {color: #AEB2F8}.ace-pastel-on-dark .ace_string {color: #66A968}.ace-pastel-on-dark .ace_string.ace_regexp {color: #E9C062}.ace-pastel-on-dark .ace_comment {color: #A6C6FF}.ace-pastel-on-dark .ace_variable {color: #BEBF55}.ace-pastel-on-dark .ace_variable.ace_language {color: #C1C144}.ace-pastel-on-dark .ace_xml-pe {color: #494949}.ace-pastel-on-dark .ace_indent-guide {background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAEklEQVQImWNgYGBgYIiPj/8PAARgAh2NTMh8AAAAAElFTkSuQmCC) right repeat-y}";var r=e("../lib/dom");r.importCssString(t.cssText,t.cssClass)})
|
framework/js/ace/theme-solarized_dark.js
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
ace.define("ace/theme/solarized_dark",["require","exports","module","ace/lib/dom"],function(e,t,n){t.isDark=!0,t.cssClass="ace-solarized-dark",t.cssText=".ace-solarized-dark .ace_gutter {background: #01313f;color: #d0edf7}.ace-solarized-dark .ace_print-margin {width: 1px;background: #33555E}.ace-solarized-dark {background-color: #002B36;color: #93A1A1}.ace-solarized-dark .ace_entity.ace_other.ace_attribute-name,.ace-solarized-dark .ace_storage {color: #93A1A1}.ace-solarized-dark .ace_cursor,.ace-solarized-dark .ace_string.ace_regexp {color: #D30102}.ace-solarized-dark .ace_marker-layer .ace_active-line,.ace-solarized-dark .ace_marker-layer .ace_selection {background: rgba(255, 255, 255, 0.1)}.ace-solarized-dark.ace_multiselect .ace_selection.ace_start {box-shadow: 0 0 3px 0px #002B36;border-radius: 2px}.ace-solarized-dark .ace_marker-layer .ace_step {background: rgb(102, 82, 0)}.ace-solarized-dark .ace_marker-layer .ace_bracket {margin: -1px 0 0 -1px;border: 1px solid rgba(147, 161, 161, 0.50)}.ace-solarized-dark .ace_gutter-active-line {background-color: #0d3440}.ace-solarized-dark .ace_marker-layer .ace_selected-word {border: 1px solid #073642}.ace-solarized-dark .ace_invisible {color: rgba(147, 161, 161, 0.50)}.ace-solarized-dark .ace_keyword,.ace-solarized-dark .ace_meta,.ace-solarized-dark .ace_support.ace_class,.ace-solarized-dark .ace_support.ace_type {color: #859900}.ace-solarized-dark .ace_constant.ace_character,.ace-solarized-dark .ace_constant.ace_other {color: #CB4B16}.ace-solarized-dark .ace_constant.ace_language {color: #B58900}.ace-solarized-dark .ace_constant.ace_numeric {color: #D33682}.ace-solarized-dark .ace_fold {background-color: #268BD2;border-color: #93A1A1}.ace-solarized-dark .ace_entity.ace_name.ace_function,.ace-solarized-dark .ace_entity.ace_name.ace_tag,.ace-solarized-dark .ace_support.ace_function,.ace-solarized-dark .ace_variable,.ace-solarized-dark .ace_variable.ace_language {color: #268BD2}.ace-solarized-dark .ace_string {color: #2AA198}.ace-solarized-dark .ace_comment {font-style: italic;color: #657B83}.ace-solarized-dark .ace_indent-guide {background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAEklEQVQImWNg0Db1ZVCxc/sPAAd4AlUHlLenAAAAAElFTkSuQmCC) right repeat-y}";var r=e("../lib/dom");r.importCssString(t.cssText,t.cssClass)})
|
framework/js/ace/theme-solarized_light.js
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
ace.define("ace/theme/solarized_light",["require","exports","module","ace/lib/dom"],function(e,t,n){t.isDark=!1,t.cssClass="ace-solarized-light",t.cssText=".ace-solarized-light .ace_gutter {background: #fbf1d3;color: #333}.ace-solarized-light .ace_print-margin {width: 1px;background: #e8e8e8}.ace-solarized-light {background-color: #FDF6E3;color: #586E75}.ace-solarized-light .ace_cursor {color: #000000}.ace-solarized-light .ace_marker-layer .ace_selection {background: rgba(7, 54, 67, 0.09)}.ace-solarized-light.ace_multiselect .ace_selection.ace_start {box-shadow: 0 0 3px 0px #FDF6E3;border-radius: 2px}.ace-solarized-light .ace_marker-layer .ace_step {background: rgb(255, 255, 0)}.ace-solarized-light .ace_marker-layer .ace_bracket {margin: -1px 0 0 -1px;border: 1px solid rgba(147, 161, 161, 0.50)}.ace-solarized-light .ace_marker-layer .ace_active-line {background: #EEE8D5}.ace-solarized-light .ace_gutter-active-line {background-color : #EDE5C1}.ace-solarized-light .ace_marker-layer .ace_selected-word {border: 1px solid #073642}.ace-solarized-light .ace_invisible {color: rgba(147, 161, 161, 0.50)}.ace-solarized-light .ace_keyword,.ace-solarized-light .ace_meta,.ace-solarized-light .ace_support.ace_class,.ace-solarized-light .ace_support.ace_type {color: #859900}.ace-solarized-light .ace_constant.ace_character,.ace-solarized-light .ace_constant.ace_other {color: #CB4B16}.ace-solarized-light .ace_constant.ace_language {color: #B58900}.ace-solarized-light .ace_constant.ace_numeric {color: #D33682}.ace-solarized-light .ace_fold {background-color: #268BD2;border-color: #586E75}.ace-solarized-light .ace_entity.ace_name.ace_function,.ace-solarized-light .ace_entity.ace_name.ace_tag,.ace-solarized-light .ace_support.ace_function,.ace-solarized-light .ace_variable,.ace-solarized-light .ace_variable.ace_language {color: #268BD2}.ace-solarized-light .ace_storage {color: #073642}.ace-solarized-light .ace_string {color: #2AA198}.ace-solarized-light .ace_string.ace_regexp {color: #D30102}.ace-solarized-light .ace_comment,.ace-solarized-light .ace_entity.ace_other.ace_attribute-name {color: #93A1A1}.ace-solarized-light .ace_indent-guide {background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAEklEQVQImWNgYGBgYHjy8NJ/AAjgA5fzQUmBAAAAAElFTkSuQmCC) right repeat-y}";var r=e("../lib/dom");r.importCssString(t.cssText,t.cssClass)})
|
framework/js/ace/theme-terminal.js
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
ace.define("ace/theme/terminal",["require","exports","module","ace/lib/dom"],function(e,t,n){t.isDark=!0,t.cssClass="ace-terminal-theme",t.cssText=".ace-terminal-theme .ace_gutter {background: #1a0005;color: steelblue}.ace-terminal-theme .ace_print-margin {width: 1px;background: #1a1a1a}.ace-terminal-theme {background-color: black;color: #DEDEDE}.ace-terminal-theme .ace_cursor {color: #9F9F9F}.ace-terminal-theme .ace_marker-layer .ace_selection {background: #424242}.ace-terminal-theme.ace_multiselect .ace_selection.ace_start {box-shadow: 0 0 3px 0px black;border-radius: 2px}.ace-terminal-theme .ace_marker-layer .ace_step {background: rgb(0, 0, 0)}.ace-terminal-theme .ace_marker-layer .ace_bracket {background: #090;}.ace-terminal-theme .ace_marker-layer .ace_bracket-start {background: #090;}.ace-terminal-theme .ace_marker-layer .ace_bracket-unmatched {margin: -1px 0 0 -1px;border: 1px solid #900}.ace-terminal-theme .ace_marker-layer .ace_active-line {background: #2A2A2A}.ace-terminal-theme .ace_gutter-active-line {background-color: #2A112A}.ace-terminal-theme .ace_marker-layer .ace_selected-word {border: 1px solid #424242}.ace-terminal-theme .ace_invisible {color: #343434}.ace-terminal-theme .ace_keyword,.ace-terminal-theme .ace_meta,.ace-terminal-theme .ace_storage,.ace-terminal-theme .ace_storage.ace_type,.ace-terminal-theme .ace_support.ace_type {color: tomato}.ace-terminal-theme .ace_keyword.ace_operator {color: deeppink}.ace-terminal-theme .ace_constant.ace_character,.ace-terminal-theme .ace_constant.ace_language,.ace-terminal-theme .ace_constant.ace_numeric,.ace-terminal-theme .ace_keyword.ace_other.ace_unit,.ace-terminal-theme .ace_support.ace_constant,.ace-terminal-theme .ace_variable.ace_parameter {color: #E78C45}.ace-terminal-theme .ace_constant.ace_other {color: gold}.ace-terminal-theme .ace_invalid {color: yellow;background-color: red}.ace-terminal-theme .ace_invalid.ace_deprecated {color: #CED2CF;background-color: #B798BF}.ace-terminal-theme .ace_fold {background-color: #7AA6DA;border-color: #DEDEDE}.ace-terminal-theme .ace_entity.ace_name.ace_function,.ace-terminal-theme .ace_support.ace_function,.ace-terminal-theme .ace_variable {color: #7AA6DA}.ace-terminal-theme .ace_support.ace_class,.ace-terminal-theme .ace_support.ace_type {color: #E7C547}.ace-terminal-theme .ace_heading,.ace-terminal-theme .ace_string {color: #B9CA4A}.ace-terminal-theme .ace_entity.ace_name.ace_tag,.ace-terminal-theme .ace_entity.ace_other.ace_attribute-name,.ace-terminal-theme .ace_meta.ace_tag,.ace-terminal-theme .ace_string.ace_regexp,.ace-terminal-theme .ace_variable {color: #D54E53}.ace-terminal-theme .ace_comment {color: orangered}.ace-terminal-theme .ace_indent-guide {background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAEklEQVQImWNgYGBgYLBWV/8PAAK4AYnhiq+xAAAAAElFTkSuQmCC) right repeat-y;}";var r=e("../lib/dom");r.importCssString(t.cssText,t.cssClass)})
|
framework/js/ace/theme-textmate.js
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
ace.define("ace/theme/textmate",["require","exports","module","ace/lib/dom"],function(e,t,n){t.isDark=!1,t.cssClass="ace-tm",t.cssText='.ace-tm .ace_gutter {background: #f0f0f0;color: #333;}.ace-tm .ace_print-margin {width: 1px;background: #e8e8e8;}.ace-tm .ace_fold {background-color: #6B72E6;}.ace-tm {background-color: #FFFFFF;}.ace-tm .ace_cursor {color: black;}.ace-tm .ace_invisible {color: rgb(191, 191, 191);}.ace-tm .ace_storage,.ace-tm .ace_keyword {color: blue;}.ace-tm .ace_constant {color: rgb(197, 6, 11);}.ace-tm .ace_constant.ace_buildin {color: rgb(88, 72, 246);}.ace-tm .ace_constant.ace_language {color: rgb(88, 92, 246);}.ace-tm .ace_constant.ace_library {color: rgb(6, 150, 14);}.ace-tm .ace_invalid {background-color: rgba(255, 0, 0, 0.1);color: red;}.ace-tm .ace_support.ace_function {color: rgb(60, 76, 114);}.ace-tm .ace_support.ace_constant {color: rgb(6, 150, 14);}.ace-tm .ace_support.ace_type,.ace-tm .ace_support.ace_class {color: rgb(109, 121, 222);}.ace-tm .ace_keyword.ace_operator {color: rgb(104, 118, 135);}.ace-tm .ace_string {color: rgb(3, 106, 7);}.ace-tm .ace_comment {color: rgb(76, 136, 107);}.ace-tm .ace_comment.ace_doc {color: rgb(0, 102, 255);}.ace-tm .ace_comment.ace_doc.ace_tag {color: rgb(128, 159, 191);}.ace-tm .ace_constant.ace_numeric {color: rgb(0, 0, 205);}.ace-tm .ace_variable {color: rgb(49, 132, 149);}.ace-tm .ace_xml-pe {color: rgb(104, 104, 91);}.ace-tm .ace_entity.ace_name.ace_function {color: #0000A2;}.ace-tm .ace_heading {color: rgb(12, 7, 255);}.ace-tm .ace_list {color:rgb(185, 6, 144);}.ace-tm .ace_meta.ace_tag {color:rgb(0, 22, 142);}.ace-tm .ace_string.ace_regex {color: rgb(255, 0, 0)}.ace-tm .ace_marker-layer .ace_selection {background: rgb(181, 213, 255);}.ace-tm.ace_multiselect .ace_selection.ace_start {box-shadow: 0 0 3px 0px white;border-radius: 2px;}.ace-tm .ace_marker-layer .ace_step {background: rgb(252, 255, 0);}.ace-tm .ace_marker-layer .ace_stack {background: rgb(164, 229, 101);}.ace-tm .ace_marker-layer .ace_bracket {margin: -1px 0 0 -1px;border: 1px solid rgb(192, 192, 192);}.ace-tm .ace_marker-layer .ace_active-line {background: rgba(0, 0, 0, 0.07);}.ace-tm .ace_gutter-active-line {background-color : #dcdcdc;}.ace-tm .ace_marker-layer .ace_selected-word {background: rgb(250, 250, 255);border: 1px solid rgb(200, 200, 250);}.ace-tm .ace_indent-guide {background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAE0lEQVQImWP4////f4bLly//BwAmVgd1/w11/gAAAABJRU5ErkJggg==") right repeat-y;}';var r=e("../lib/dom");r.importCssString(t.cssText,t.cssClass)})
|
framework/js/ace/theme-tomorrow.js
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
ace.define("ace/theme/tomorrow",["require","exports","module","ace/lib/dom"],function(e,t,n){t.isDark=!1,t.cssClass="ace-tomorrow",t.cssText=".ace-tomorrow .ace_gutter {background: #f6f6f6;color: #4D4D4C}.ace-tomorrow .ace_print-margin {width: 1px;background: #f6f6f6}.ace-tomorrow {background-color: #FFFFFF;color: #4D4D4C}.ace-tomorrow .ace_cursor {color: #AEAFAD}.ace-tomorrow .ace_marker-layer .ace_selection {background: #D6D6D6}.ace-tomorrow.ace_multiselect .ace_selection.ace_start {box-shadow: 0 0 3px 0px #FFFFFF;border-radius: 2px}.ace-tomorrow .ace_marker-layer .ace_step {background: rgb(255, 255, 0)}.ace-tomorrow .ace_marker-layer .ace_bracket {margin: -1px 0 0 -1px;border: 1px solid #D1D1D1}.ace-tomorrow .ace_marker-layer .ace_active-line {background: #EFEFEF}.ace-tomorrow .ace_gutter-active-line {background-color : #dcdcdc}.ace-tomorrow .ace_marker-layer .ace_selected-word {border: 1px solid #D6D6D6}.ace-tomorrow .ace_invisible {color: #D1D1D1}.ace-tomorrow .ace_keyword,.ace-tomorrow .ace_meta,.ace-tomorrow .ace_storage,.ace-tomorrow .ace_storage.ace_type,.ace-tomorrow .ace_support.ace_type {color: #8959A8}.ace-tomorrow .ace_keyword.ace_operator {color: #3E999F}.ace-tomorrow .ace_constant.ace_character,.ace-tomorrow .ace_constant.ace_language,.ace-tomorrow .ace_constant.ace_numeric,.ace-tomorrow .ace_keyword.ace_other.ace_unit,.ace-tomorrow .ace_support.ace_constant,.ace-tomorrow .ace_variable.ace_parameter {color: #F5871F}.ace-tomorrow .ace_constant.ace_other {color: #666969}.ace-tomorrow .ace_invalid {color: #FFFFFF;background-color: #C82829}.ace-tomorrow .ace_invalid.ace_deprecated {color: #FFFFFF;background-color: #8959A8}.ace-tomorrow .ace_fold {background-color: #4271AE;border-color: #4D4D4C}.ace-tomorrow .ace_entity.ace_name.ace_function,.ace-tomorrow .ace_support.ace_function,.ace-tomorrow .ace_variable {color: #4271AE}.ace-tomorrow .ace_support.ace_class,.ace-tomorrow .ace_support.ace_type {color: #C99E00}.ace-tomorrow .ace_heading,.ace-tomorrow .ace_markup.ace_heading,.ace-tomorrow .ace_string {color: #718C00}.ace-tomorrow .ace_entity.ace_name.ace_tag,.ace-tomorrow .ace_entity.ace_other.ace_attribute-name,.ace-tomorrow .ace_meta.ace_tag,.ace-tomorrow .ace_string.ace_regexp,.ace-tomorrow .ace_variable {color: #C82829}.ace-tomorrow .ace_comment {color: #8E908C}.ace-tomorrow .ace_indent-guide {background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAE0lEQVQImWP4////f4bdu3f/BwAlfgctduB85QAAAABJRU5ErkJggg==) right repeat-y}";var r=e("../lib/dom");r.importCssString(t.cssText,t.cssClass)})
|
framework/js/ace/theme-tomorrow_night.js
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
ace.define("ace/theme/tomorrow_night",["require","exports","module","ace/lib/dom"],function(e,t,n){t.isDark=!0,t.cssClass="ace-tomorrow-night",t.cssText=".ace-tomorrow-night .ace_gutter {background: #25282c;color: #C5C8C6}.ace-tomorrow-night .ace_print-margin {width: 1px;background: #25282c}.ace-tomorrow-night {background-color: #1D1F21;color: #C5C8C6}.ace-tomorrow-night .ace_cursor {color: #AEAFAD}.ace-tomorrow-night .ace_marker-layer .ace_selection {background: #373B41}.ace-tomorrow-night.ace_multiselect .ace_selection.ace_start {box-shadow: 0 0 3px 0px #1D1F21;border-radius: 2px}.ace-tomorrow-night .ace_marker-layer .ace_step {background: rgb(102, 82, 0)}.ace-tomorrow-night .ace_marker-layer .ace_bracket {margin: -1px 0 0 -1px;border: 1px solid #4B4E55}.ace-tomorrow-night .ace_marker-layer .ace_active-line {background: #282A2E}.ace-tomorrow-night .ace_gutter-active-line {background-color: #282A2E}.ace-tomorrow-night .ace_marker-layer .ace_selected-word {border: 1px solid #373B41}.ace-tomorrow-night .ace_invisible {color: #4B4E55}.ace-tomorrow-night .ace_keyword,.ace-tomorrow-night .ace_meta,.ace-tomorrow-night .ace_storage,.ace-tomorrow-night .ace_storage.ace_type,.ace-tomorrow-night .ace_support.ace_type {color: #B294BB}.ace-tomorrow-night .ace_keyword.ace_operator {color: #8ABEB7}.ace-tomorrow-night .ace_constant.ace_character,.ace-tomorrow-night .ace_constant.ace_language,.ace-tomorrow-night .ace_constant.ace_numeric,.ace-tomorrow-night .ace_keyword.ace_other.ace_unit,.ace-tomorrow-night .ace_support.ace_constant,.ace-tomorrow-night .ace_variable.ace_parameter {color: #DE935F}.ace-tomorrow-night .ace_constant.ace_other {color: #CED1CF}.ace-tomorrow-night .ace_invalid {color: #CED2CF;background-color: #DF5F5F}.ace-tomorrow-night .ace_invalid.ace_deprecated {color: #CED2CF;background-color: #B798BF}.ace-tomorrow-night .ace_fold {background-color: #81A2BE;border-color: #C5C8C6}.ace-tomorrow-night .ace_entity.ace_name.ace_function,.ace-tomorrow-night .ace_support.ace_function,.ace-tomorrow-night .ace_variable {color: #81A2BE}.ace-tomorrow-night .ace_support.ace_class,.ace-tomorrow-night .ace_support.ace_type {color: #F0C674}.ace-tomorrow-night .ace_heading,.ace-tomorrow-night .ace_markup.ace_heading,.ace-tomorrow-night .ace_string {color: #B5BD68}.ace-tomorrow-night .ace_entity.ace_name.ace_tag,.ace-tomorrow-night .ace_entity.ace_other.ace_attribute-name,.ace-tomorrow-night .ace_meta.ace_tag,.ace-tomorrow-night .ace_string.ace_regexp,.ace-tomorrow-night .ace_variable {color: #CC6666}.ace-tomorrow-night .ace_comment {color: #969896}.ace-tomorrow-night .ace_indent-guide {background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAEklEQVQImWNgYGBgYHB3d/8PAAOIAdULw8qMAAAAAElFTkSuQmCC) right repeat-y}";var r=e("../lib/dom");r.importCssString(t.cssText,t.cssClass)})
|
framework/js/ace/theme-tomorrow_night_blue.js
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
ace.define("ace/theme/tomorrow_night_blue",["require","exports","module","ace/lib/dom"],function(e,t,n){t.isDark=!0,t.cssClass="ace-tomorrow-night-blue",t.cssText=".ace-tomorrow-night-blue .ace_gutter {background: #00204b;color: #7388b5}.ace-tomorrow-night-blue .ace_print-margin {width: 1px;background: #00204b}.ace-tomorrow-night-blue {background-color: #002451;color: #FFFFFF}.ace-tomorrow-night-blue .ace_constant.ace_other,.ace-tomorrow-night-blue .ace_cursor {color: #FFFFFF}.ace-tomorrow-night-blue .ace_marker-layer .ace_selection {background: #003F8E}.ace-tomorrow-night-blue.ace_multiselect .ace_selection.ace_start {box-shadow: 0 0 3px 0px #002451;border-radius: 2px}.ace-tomorrow-night-blue .ace_marker-layer .ace_step {background: rgb(127, 111, 19)}.ace-tomorrow-night-blue .ace_marker-layer .ace_bracket {margin: -1px 0 0 -1px;border: 1px solid #404F7D}.ace-tomorrow-night-blue .ace_marker-layer .ace_active-line {background: #00346E}.ace-tomorrow-night-blue .ace_gutter-active-line {background-color: #022040}.ace-tomorrow-night-blue .ace_marker-layer .ace_selected-word {border: 1px solid #003F8E}.ace-tomorrow-night-blue .ace_invisible {color: #404F7D}.ace-tomorrow-night-blue .ace_keyword,.ace-tomorrow-night-blue .ace_meta,.ace-tomorrow-night-blue .ace_storage,.ace-tomorrow-night-blue .ace_storage.ace_type,.ace-tomorrow-night-blue .ace_support.ace_type {color: #EBBBFF}.ace-tomorrow-night-blue .ace_keyword.ace_operator {color: #99FFFF}.ace-tomorrow-night-blue .ace_constant.ace_character,.ace-tomorrow-night-blue .ace_constant.ace_language,.ace-tomorrow-night-blue .ace_constant.ace_numeric,.ace-tomorrow-night-blue .ace_keyword.ace_other.ace_unit,.ace-tomorrow-night-blue .ace_support.ace_constant,.ace-tomorrow-night-blue .ace_variable.ace_parameter {color: #FFC58F}.ace-tomorrow-night-blue .ace_invalid {color: #FFFFFF;background-color: #F99DA5}.ace-tomorrow-night-blue .ace_invalid.ace_deprecated {color: #FFFFFF;background-color: #EBBBFF}.ace-tomorrow-night-blue .ace_fold {background-color: #BBDAFF;border-color: #FFFFFF}.ace-tomorrow-night-blue .ace_entity.ace_name.ace_function,.ace-tomorrow-night-blue .ace_support.ace_function,.ace-tomorrow-night-blue .ace_variable {color: #BBDAFF}.ace-tomorrow-night-blue .ace_support.ace_class,.ace-tomorrow-night-blue .ace_support.ace_type {color: #FFEEAD}.ace-tomorrow-night-blue .ace_heading,.ace-tomorrow-night-blue .ace_markup.ace_heading,.ace-tomorrow-night-blue .ace_string {color: #D1F1A9}.ace-tomorrow-night-blue .ace_entity.ace_name.ace_tag,.ace-tomorrow-night-blue .ace_entity.ace_other.ace_attribute-name,.ace-tomorrow-night-blue .ace_meta.ace_tag,.ace-tomorrow-night-blue .ace_string.ace_regexp,.ace-tomorrow-night-blue .ace_variable {color: #FF9DA4}.ace-tomorrow-night-blue .ace_comment {color: #7285B7}.ace-tomorrow-night-blue .ace_indent-guide {background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAEklEQVQImWNgYGBgYJDzqfwPAANXAeNsiA+ZAAAAAElFTkSuQmCC) right repeat-y}";var r=e("../lib/dom");r.importCssString(t.cssText,t.cssClass)})
|
framework/js/ace/theme-tomorrow_night_bright.js
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
ace.define("ace/theme/tomorrow_night_bright",["require","exports","module","ace/lib/dom"],function(e,t,n){t.isDark=!0,t.cssClass="ace-tomorrow-night-bright",t.cssText=".ace-tomorrow-night-bright .ace_gutter {background: #1a1a1a;color: #DEDEDE}.ace-tomorrow-night-bright .ace_print-margin {width: 1px;background: #1a1a1a}.ace-tomorrow-night-bright {background-color: #000000;color: #DEDEDE}.ace-tomorrow-night-bright .ace_cursor {color: #9F9F9F}.ace-tomorrow-night-bright .ace_marker-layer .ace_selection {background: #424242}.ace-tomorrow-night-bright.ace_multiselect .ace_selection.ace_start {box-shadow: 0 0 3px 0px #000000;border-radius: 2px}.ace-tomorrow-night-bright .ace_marker-layer .ace_step {background: rgb(102, 82, 0)}.ace-tomorrow-night-bright .ace_marker-layer .ace_bracket {margin: -1px 0 0 -1px;border: 1px solid #888888}.ace-tomorrow-night-bright .ace_marker-layer .ace_highlight {border: 1px solid rgb(110, 119, 0);border-bottom: 0;box-shadow: inset 0 -1px rgb(110, 119, 0);margin: -1px 0 0 -1px;background: rgba(255, 235, 0, 0.1);}.ace-tomorrow-night-bright .ace_marker-layer .ace_active-line {background: #2A2A2A}.ace-tomorrow-night-bright .ace_gutter-active-line {background-color: #2A2A2A}.ace-tomorrow-night-bright .ace_stack {background-color: rgb(66, 90, 44)}.ace-tomorrow-night-bright .ace_marker-layer .ace_selected-word {border: 1px solid #888888}.ace-tomorrow-night-bright .ace_invisible {color: #343434}.ace-tomorrow-night-bright .ace_keyword,.ace-tomorrow-night-bright .ace_meta,.ace-tomorrow-night-bright .ace_storage,.ace-tomorrow-night-bright .ace_storage.ace_type,.ace-tomorrow-night-bright .ace_support.ace_type {color: #C397D8}.ace-tomorrow-night-bright .ace_keyword.ace_operator {color: #70C0B1}.ace-tomorrow-night-bright .ace_constant.ace_character,.ace-tomorrow-night-bright .ace_constant.ace_language,.ace-tomorrow-night-bright .ace_constant.ace_numeric,.ace-tomorrow-night-bright .ace_keyword.ace_other.ace_unit,.ace-tomorrow-night-bright .ace_support.ace_constant,.ace-tomorrow-night-bright .ace_variable.ace_parameter {color: #E78C45}.ace-tomorrow-night-bright .ace_constant.ace_other {color: #EEEEEE}.ace-tomorrow-night-bright .ace_invalid {color: #CED2CF;background-color: #DF5F5F}.ace-tomorrow-night-bright .ace_invalid.ace_deprecated {color: #CED2CF;background-color: #B798BF}.ace-tomorrow-night-bright .ace_fold {background-color: #7AA6DA;border-color: #DEDEDE}.ace-tomorrow-night-bright .ace_entity.ace_name.ace_function,.ace-tomorrow-night-bright .ace_support.ace_function,.ace-tomorrow-night-bright .ace_variable {color: #7AA6DA}.ace-tomorrow-night-bright .ace_support.ace_class,.ace-tomorrow-night-bright .ace_support.ace_type {color: #E7C547}.ace-tomorrow-night-bright .ace_heading,.ace-tomorrow-night-bright .ace_markup.ace_heading,.ace-tomorrow-night-bright .ace_string {color: #B9CA4A}.ace-tomorrow-night-bright .ace_entity.ace_name.ace_tag,.ace-tomorrow-night-bright .ace_entity.ace_other.ace_attribute-name,.ace-tomorrow-night-bright .ace_meta.ace_tag,.ace-tomorrow-night-bright .ace_string.ace_regexp,.ace-tomorrow-night-bright .ace_variable {color: #D54E53}.ace-tomorrow-night-bright .ace_comment {color: #969896}.ace-tomorrow-night-bright .ace_c9searchresults.ace_keyword {color: #C2C280;}.ace-tomorrow-night-bright .ace_indent-guide {background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAEklEQVQImWNgYGBgYFBXV/8PAAJoAXX4kT2EAAAAAElFTkSuQmCC) right repeat-y}";var r=e("../lib/dom");r.importCssString(t.cssText,t.cssClass)})
|
framework/js/ace/theme-tomorrow_night_eighties.js
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
ace.define("ace/theme/tomorrow_night_eighties",["require","exports","module","ace/lib/dom"],function(e,t,n){t.isDark=!0,t.cssClass="ace-tomorrow-night-eighties",t.cssText=".ace-tomorrow-night-eighties .ace_gutter {background: #272727;color: #CCC}.ace-tomorrow-night-eighties .ace_print-margin {width: 1px;background: #272727}.ace-tomorrow-night-eighties {background-color: #2D2D2D;color: #CCCCCC}.ace-tomorrow-night-eighties .ace_constant.ace_other,.ace-tomorrow-night-eighties .ace_cursor {color: #CCCCCC}.ace-tomorrow-night-eighties .ace_marker-layer .ace_selection {background: #515151}.ace-tomorrow-night-eighties.ace_multiselect .ace_selection.ace_start {box-shadow: 0 0 3px 0px #2D2D2D;border-radius: 2px}.ace-tomorrow-night-eighties .ace_marker-layer .ace_step {background: rgb(102, 82, 0)}.ace-tomorrow-night-eighties .ace_marker-layer .ace_bracket {margin: -1px 0 0 -1px;border: 1px solid #6A6A6A}.ace-tomorrow-night-bright .ace_stack {background: rgb(66, 90, 44)}.ace-tomorrow-night-eighties .ace_marker-layer .ace_active-line {background: #393939}.ace-tomorrow-night-eighties .ace_gutter-active-line {background-color: #393939}.ace-tomorrow-night-eighties .ace_marker-layer .ace_selected-word {border: 1px solid #515151}.ace-tomorrow-night-eighties .ace_invisible {color: #6A6A6A}.ace-tomorrow-night-eighties .ace_keyword,.ace-tomorrow-night-eighties .ace_meta,.ace-tomorrow-night-eighties .ace_storage,.ace-tomorrow-night-eighties .ace_storage.ace_type,.ace-tomorrow-night-eighties .ace_support.ace_type {color: #CC99CC}.ace-tomorrow-night-eighties .ace_keyword.ace_operator {color: #66CCCC}.ace-tomorrow-night-eighties .ace_constant.ace_character,.ace-tomorrow-night-eighties .ace_constant.ace_language,.ace-tomorrow-night-eighties .ace_constant.ace_numeric,.ace-tomorrow-night-eighties .ace_keyword.ace_other.ace_unit,.ace-tomorrow-night-eighties .ace_support.ace_constant,.ace-tomorrow-night-eighties .ace_variable.ace_parameter {color: #F99157}.ace-tomorrow-night-eighties .ace_invalid {color: #CDCDCD;background-color: #F2777A}.ace-tomorrow-night-eighties .ace_invalid.ace_deprecated {color: #CDCDCD;background-color: #CC99CC}.ace-tomorrow-night-eighties .ace_fold {background-color: #6699CC;border-color: #CCCCCC}.ace-tomorrow-night-eighties .ace_entity.ace_name.ace_function,.ace-tomorrow-night-eighties .ace_support.ace_function,.ace-tomorrow-night-eighties .ace_variable {color: #6699CC}.ace-tomorrow-night-eighties .ace_support.ace_class,.ace-tomorrow-night-eighties .ace_support.ace_type {color: #FFCC66}.ace-tomorrow-night-eighties .ace_heading,.ace-tomorrow-night-eighties .ace_markup.ace_heading,.ace-tomorrow-night-eighties .ace_string {color: #99CC99}.ace-tomorrow-night-eighties .ace_comment {color: #999999}.ace-tomorrow-night-eighties .ace_entity.ace_name.ace_tag,.ace-tomorrow-night-eighties .ace_entity.ace_other.ace_attribute-name,.ace-tomorrow-night-eighties .ace_meta.ace_tag,.ace-tomorrow-night-eighties .ace_variable {color: #F2777A}.ace-tomorrow-night-eighties .ace_indent-guide {background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAEklEQVQImWPQ09NrYAgMjP4PAAtGAwchHMyAAAAAAElFTkSuQmCC) right repeat-y}";var r=e("../lib/dom");r.importCssString(t.cssText,t.cssClass)})
|
framework/js/ace/theme-twilight.js
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
ace.define("ace/theme/twilight",["require","exports","module","ace/lib/dom"],function(e,t,n){t.isDark=!0,t.cssClass="ace-twilight",t.cssText=".ace-twilight .ace_gutter {background: #232323;color: #E2E2E2}.ace-twilight .ace_print-margin {width: 1px;background: #232323}.ace-twilight {background-color: #141414;color: #F8F8F8}.ace-twilight .ace_cursor {color: #A7A7A7}.ace-twilight .ace_marker-layer .ace_selection {background: rgba(221, 240, 255, 0.20)}.ace-twilight.ace_multiselect .ace_selection.ace_start {box-shadow: 0 0 3px 0px #141414;border-radius: 2px}.ace-twilight .ace_marker-layer .ace_step {background: rgb(102, 82, 0)}.ace-twilight .ace_marker-layer .ace_bracket {margin: -1px 0 0 -1px;border: 1px solid rgba(255, 255, 255, 0.25)}.ace-twilight .ace_marker-layer .ace_active-line {background: rgba(255, 255, 255, 0.031)}.ace-twilight .ace_gutter-active-line {background-color: rgba(255, 255, 255, 0.031)}.ace-twilight .ace_marker-layer .ace_selected-word {border: 1px solid rgba(221, 240, 255, 0.20)}.ace-twilight .ace_invisible {color: rgba(255, 255, 255, 0.25)}.ace-twilight .ace_keyword,.ace-twilight .ace_meta {color: #CDA869}.ace-twilight .ace_constant,.ace-twilight .ace_constant.ace_character,.ace-twilight .ace_constant.ace_character.ace_escape,.ace-twilight .ace_constant.ace_other,.ace-twilight .ace_heading,.ace-twilight .ace_markup.ace_heading,.ace-twilight .ace_support.ace_constant {color: #CF6A4C}.ace-twilight .ace_invalid.ace_illegal {color: #F8F8F8;background-color: rgba(86, 45, 86, 0.75)}.ace-twilight .ace_invalid.ace_deprecated {text-decoration: underline;font-style: italic;color: #D2A8A1}.ace-twilight .ace_support {color: #9B859D}.ace-twilight .ace_fold {background-color: #AC885B;border-color: #F8F8F8}.ace-twilight .ace_support.ace_function {color: #DAD085}.ace-twilight .ace_list,.ace-twilight .ace_markup.ace_list,.ace-twilight .ace_storage {color: #F9EE98}.ace-twilight .ace_entity.ace_name.ace_function,.ace-twilight .ace_meta.ace_tag,.ace-twilight .ace_variable {color: #AC885B}.ace-twilight .ace_string {color: #8F9D6A}.ace-twilight .ace_string.ace_regexp {color: #E9C062}.ace-twilight .ace_comment {font-style: italic;color: #5F5A60}.ace-twilight .ace_variable {color: #7587A6}.ace-twilight .ace_xml-pe {color: #494949}.ace-twilight .ace_indent-guide {background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAEklEQVQImWMQERFpYLC1tf0PAAgOAnPnhxyiAAAAAElFTkSuQmCC) right repeat-y}";var r=e("../lib/dom");r.importCssString(t.cssText,t.cssClass)})
|
framework/js/ace/theme-vibrant_ink.js
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
ace.define("ace/theme/vibrant_ink",["require","exports","module","ace/lib/dom"],function(e,t,n){t.isDark=!0,t.cssClass="ace-vibrant-ink",t.cssText=".ace-vibrant-ink .ace_gutter {background: #1a1a1a;color: #BEBEBE}.ace-vibrant-ink .ace_print-margin {width: 1px;background: #1a1a1a}.ace-vibrant-ink {background-color: #0F0F0F;color: #FFFFFF}.ace-vibrant-ink .ace_cursor {color: #FFFFFF}.ace-vibrant-ink .ace_marker-layer .ace_selection {background: #6699CC}.ace-vibrant-ink.ace_multiselect .ace_selection.ace_start {box-shadow: 0 0 3px 0px #0F0F0F;border-radius: 2px}.ace-vibrant-ink .ace_marker-layer .ace_step {background: rgb(102, 82, 0)}.ace-vibrant-ink .ace_marker-layer .ace_bracket {margin: -1px 0 0 -1px;border: 1px solid #404040}.ace-vibrant-ink .ace_marker-layer .ace_active-line {background: #333333}.ace-vibrant-ink .ace_gutter-active-line {background-color: #333333}.ace-vibrant-ink .ace_marker-layer .ace_selected-word {border: 1px solid #6699CC}.ace-vibrant-ink .ace_invisible {color: #404040}.ace-vibrant-ink .ace_keyword,.ace-vibrant-ink .ace_meta {color: #FF6600}.ace-vibrant-ink .ace_constant,.ace-vibrant-ink .ace_constant.ace_character,.ace-vibrant-ink .ace_constant.ace_character.ace_escape,.ace-vibrant-ink .ace_constant.ace_other {color: #339999}.ace-vibrant-ink .ace_constant.ace_numeric {color: #99CC99}.ace-vibrant-ink .ace_invalid,.ace-vibrant-ink .ace_invalid.ace_deprecated {color: #CCFF33;background-color: #000000}.ace-vibrant-ink .ace_fold {background-color: #FFCC00;border-color: #FFFFFF}.ace-vibrant-ink .ace_entity.ace_name.ace_function,.ace-vibrant-ink .ace_support.ace_function,.ace-vibrant-ink .ace_variable {color: #FFCC00}.ace-vibrant-ink .ace_variable.ace_parameter {font-style: italic}.ace-vibrant-ink .ace_string {color: #66FF00}.ace-vibrant-ink .ace_string.ace_regexp {color: #44B4CC}.ace-vibrant-ink .ace_comment {color: #9933CC}.ace-vibrant-ink .ace_entity.ace_other.ace_attribute-name {font-style: italic;color: #99CC99}.ace-vibrant-ink .ace_indent-guide {background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAEklEQVQImWNgYGBgYNDTc/oPAALPAZ7hxlbYAAAAAElFTkSuQmCC) right repeat-y}";var r=e("../lib/dom");r.importCssString(t.cssText,t.cssClass)})
|
framework/js/ace/theme-xcode.js
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
ace.define("ace/theme/xcode",["require","exports","module","ace/lib/dom"],function(e,t,n){t.isDark=!1,t.cssClass="ace-xcode",t.cssText=".ace-xcode .ace_gutter,/* THIS THEME WAS AUTOGENERATED BY Theme.tmpl.css (UUID: EE3AD170-2B7F-4DE1-B724-C75F13FE0085) */.ace-xcode .ace_gutter {background: #e8e8e8;color: #333}.ace-xcode .ace_print-margin {width: 1px;background: #e8e8e8}.ace-xcode {background-color: #FFFFFF;color: #000000}.ace-xcode .ace_cursor {color: #000000}.ace-xcode .ace_marker-layer .ace_selection {background: #B5D5FF}.ace-xcode.ace_multiselect .ace_selection.ace_start {box-shadow: 0 0 3px 0px #FFFFFF;border-radius: 2px}.ace-xcode .ace_marker-layer .ace_step {background: rgb(198, 219, 174)}.ace-xcode .ace_marker-layer .ace_bracket {margin: -1px 0 0 -1px;border: 1px solid #BFBFBF}.ace-xcode .ace_marker-layer .ace_active-line {background: rgba(0, 0, 0, 0.071)}.ace-xcode .ace_gutter-active-line {background-color: rgba(0, 0, 0, 0.071)}.ace-xcode .ace_marker-layer .ace_selected-word {border: 1px solid #B5D5FF}.ace-xcode .ace_constant.ace_language,.ace-xcode .ace_keyword,.ace-xcode .ace_meta,.ace-xcode .ace_variable.ace_language {color: #C800A4}.ace-xcode .ace_invisible {color: #BFBFBF}.ace-xcode .ace_constant.ace_character,.ace-xcode .ace_constant.ace_other {color: #275A5E}.ace-xcode .ace_constant.ace_numeric {color: #3A00DC}.ace-xcode .ace_entity.ace_other.ace_attribute-name,.ace-xcode .ace_support.ace_constant,.ace-xcode .ace_support.ace_function {color: #450084}.ace-xcode .ace_fold {background-color: #C800A4;border-color: #000000}.ace-xcode .ace_entity.ace_name.ace_tag,.ace-xcode .ace_support.ace_class,.ace-xcode .ace_support.ace_type {color: #790EAD}.ace-xcode .ace_storage {color: #C900A4}.ace-xcode .ace_string {color: #DF0002}.ace-xcode .ace_comment {color: #008E00}.ace-xcode .ace_indent-guide {background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAE0lEQVQImWP4////f4bLly//BwAmVgd1/w11/gAAAABJRU5ErkJggg==) right repeat-y}";var r=e("../lib/dom");r.importCssString(t.cssText,t.cssClass)})
|
framework/js/ajax/cjt-server/cjt-server.js
CHANGED
@@ -40,6 +40,7 @@ var CJTServer;
|
|
40 |
*/
|
41 |
controllers : {
|
42 |
block : 'block-ajax',
|
|
|
43 |
blocksPage : 'blocks-ajax',
|
44 |
blocksBackups : 'blocks-backups',
|
45 |
templatesLookup : 'templates-lookup',
|
@@ -50,7 +51,10 @@ var CJTServer;
|
|
50 |
metabox : 'metabox',
|
51 |
installer : 'installer',
|
52 |
setup : 'setup',
|
53 |
-
tinymceBlocks : 'tinymce-blocks'
|
|
|
|
|
|
|
54 |
},
|
55 |
|
56 |
/*
|
@@ -242,16 +246,21 @@ var CJTServer;
|
|
242 |
* @param string Any valid http request methods.
|
243 |
* @return jqxhr
|
244 |
*/
|
245 |
-
send : function(controller, action, data, requestMethod, returnType) {
|
246 |
var request = null;
|
247 |
var promising = null;
|
248 |
// Set default request method.
|
249 |
requestMethod = (requestMethod == undefined) ? 'get' : requestMethod;
|
250 |
// Set default return type to JSON.
|
251 |
returnType = (returnType == undefined) ? 'json' : returnType;
|
252 |
-
//
|
253 |
request = CJTServer.getRequestObject(controller, action, data);
|
254 |
-
|
|
|
|
|
|
|
|
|
|
|
255 |
/* @TODO: This is a temporary solution for version 6.0 to be releases! Later we'll have a full error handling system! */
|
256 |
// --- Start temporary Error handling Block ---
|
257 |
.error($.proxy(
|
40 |
*/
|
41 |
controllers : {
|
42 |
block : 'block-ajax',
|
43 |
+
codeFiles : 'code-files',
|
44 |
blocksPage : 'blocks-ajax',
|
45 |
blocksBackups : 'blocks-backups',
|
46 |
templatesLookup : 'templates-lookup',
|
51 |
metabox : 'metabox',
|
52 |
installer : 'installer',
|
53 |
setup : 'setup',
|
54 |
+
tinymceBlocks : 'tinymce-blocks',
|
55 |
+
packages : 'packages',
|
56 |
+
packageFile : 'package-file',
|
57 |
+
'package' : 'package',
|
58 |
},
|
59 |
|
60 |
/*
|
246 |
* @param string Any valid http request methods.
|
247 |
* @return jqxhr
|
248 |
*/
|
249 |
+
send : function(controller, action, data, requestMethod, returnType, inSettings) {
|
250 |
var request = null;
|
251 |
var promising = null;
|
252 |
// Set default request method.
|
253 |
requestMethod = (requestMethod == undefined) ? 'get' : requestMethod;
|
254 |
// Set default return type to JSON.
|
255 |
returnType = (returnType == undefined) ? 'json' : returnType;
|
256 |
+
// Build Request URL and Data.
|
257 |
request = CJTServer.getRequestObject(controller, action, data);
|
258 |
+
// Ajax Request Settings.
|
259 |
+
var settings = $.extend({type : requestMethod, data : request.data, dataType : returnType},
|
260 |
+
inSettings ? inSettings : {});
|
261 |
+
// Merge settings with passed settings.
|
262 |
+
// Request!
|
263 |
+
promising = $.ajax(request.url, settings)
|
264 |
/* @TODO: This is a temporary solution for version 6.0 to be releases! Later we'll have a full error handling system! */
|
265 |
// --- Start temporary Error handling Block ---
|
266 |
.error($.proxy(
|
framework/js/ajax/scripts-loader/scripts-loader.js
ADDED
@@ -0,0 +1,132 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
*
|
3 |
+
*/
|
4 |
+
|
5 |
+
var ScriptsLoader;
|
6 |
+
/**
|
7 |
+
*
|
8 |
+
*/
|
9 |
+
(function($) {
|
10 |
+
|
11 |
+
/**
|
12 |
+
*
|
13 |
+
*/
|
14 |
+
ScriptsLoader = function(scripts) {
|
15 |
+
// Clone scripts array.
|
16 |
+
scripts = $.merge([], scripts);
|
17 |
+
|
18 |
+
/**
|
19 |
+
*
|
20 |
+
*/
|
21 |
+
this.callback = $.Deferred();
|
22 |
+
|
23 |
+
/**
|
24 |
+
*
|
25 |
+
*/
|
26 |
+
this.loaded = [];
|
27 |
+
|
28 |
+
/**
|
29 |
+
*
|
30 |
+
*/
|
31 |
+
this._loaded = function(script) {
|
32 |
+
// Add script into loaded list.
|
33 |
+
this.loaded.push(script);
|
34 |
+
// Wait until all scripts is loaded.
|
35 |
+
if (this.loaded.length == scripts.length) {
|
36 |
+
console.log('All is done');
|
37 |
+
// Notify success.
|
38 |
+
this.callback.resolveWith(this);
|
39 |
+
}
|
40 |
+
}
|
41 |
+
|
42 |
+
/**
|
43 |
+
*
|
44 |
+
*/
|
45 |
+
this.loadAll = function() {
|
46 |
+
this.loadNext();
|
47 |
+
return this.callback;
|
48 |
+
}
|
49 |
+
|
50 |
+
/**
|
51 |
+
*
|
52 |
+
*/
|
53 |
+
this.load = function(script) {
|
54 |
+
// Load script using Ajax!
|
55 |
+
return $.getScript(script.src);
|
56 |
+
}
|
57 |
+
|
58 |
+
/**
|
59 |
+
*
|
60 |
+
*/
|
61 |
+
this.loadNext = function() {
|
62 |
+
// If there is more script to load.
|
63 |
+
if (scripts.length) {
|
64 |
+
// Current Script!
|
65 |
+
var script = scripts.shift();
|
66 |
+
// Get load method name to use for loading script file.
|
67 |
+
var loadingMethod = 'load';
|
68 |
+
if (script.cjt.loadMethod != undefined) {
|
69 |
+
loadingMethod += script.cjt.loadMethod;
|
70 |
+
}
|
71 |
+
this[loadingMethod](script).done($.proxy(
|
72 |
+
function() {
|
73 |
+
// Push script object into the queue.
|
74 |
+
this.loaded.push(script);
|
75 |
+
// Load next script!
|
76 |
+
this.loadNext();
|
77 |
+
}, this)
|
78 |
+
)
|
79 |
+
.fail($.proxy(
|
80 |
+
function() {
|
81 |
+
// Report failure!
|
82 |
+
this.callback.rejectWith(this, [loadingMethod, script]);
|
83 |
+
}, this)
|
84 |
+
)
|
85 |
+
}
|
86 |
+
else {
|
87 |
+
// All scripts has been loaded!!
|
88 |
+
this.callback.resolveWith(this);
|
89 |
+
}
|
90 |
+
}
|
91 |
+
|
92 |
+
/**
|
93 |
+
*
|
94 |
+
*/
|
95 |
+
this.loadTag = function(script) {
|
96 |
+
var deferred = $.Deferred();
|
97 |
+
// Create script tag.
|
98 |
+
var scriptTag = document.createElement('script');
|
99 |
+
// Set script properties.
|
100 |
+
scriptTag.type = 'text/javascript';
|
101 |
+
scriptTag.src = script.src;
|
102 |
+
// using jQuery for appending Script tag still load it using $.getScript!!
|
103 |
+
// Use raw method to add HTML script tag.
|
104 |
+
document.getElementsByTagName('head')[0].appendChild(scriptTag);
|
105 |
+
// Check if script loaded every 50 milli seconds!
|
106 |
+
var timeout = 4000; // 4 seconds.
|
107 |
+
var interval = 50; // Milisecs
|
108 |
+
var secondsElapsed = 0;
|
109 |
+
var checker = setInterval($.proxy(
|
110 |
+
function() {
|
111 |
+
if (window[script.cjt.lookFor] != undefined) {
|
112 |
+
// No more check for this script.
|
113 |
+
clearInterval(checker);
|
114 |
+
// Report success!
|
115 |
+
deferred.resolve();
|
116 |
+
}
|
117 |
+
else if (secondsElapsed == timeout) {
|
118 |
+
// No more check for this script.
|
119 |
+
clearInterval(checker);
|
120 |
+
// Notify that script load is failure.
|
121 |
+
deferred.reject();
|
122 |
+
}
|
123 |
+
secondsElapsed += interval;
|
124 |
+
}, this)
|
125 |
+
, interval);
|
126 |
+
// Promising!
|
127 |
+
return deferred;
|
128 |
+
}
|
129 |
+
|
130 |
+
} // End class.
|
131 |
+
|
132 |
+
})(jQuery);
|
framework/js/ajax/styles-loader/styles-loader.js
ADDED
@@ -0,0 +1,30 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
*
|
3 |
+
*/
|
4 |
+
|
5 |
+
var StylesLoader;
|
6 |
+
/**
|
7 |
+
*
|
8 |
+
*/
|
9 |
+
(function($) {
|
10 |
+
|
11 |
+
/**
|
12 |
+
*
|
13 |
+
*/
|
14 |
+
StylesLoader = function(styles) {
|
15 |
+
|
16 |
+
/**
|
17 |
+
*
|
18 |
+
*/
|
19 |
+
this.load = function() {
|
20 |
+
$.each(styles,
|
21 |
+
$.proxy(function(index, style) {
|
22 |
+
var link = '<link href="' + style.src + '" rel="stylesheet" type="text/css" />';
|
23 |
+
$('head').append(link);
|
24 |
+
}, this)
|
25 |
+
);
|
26 |
+
}
|
27 |
+
|
28 |
+
} // End class.
|
29 |
+
|
30 |
+
})(jQuery);
|
framework/js/ui/jquery.link-progress/jquery.link-progress.js
CHANGED
@@ -14,7 +14,8 @@
|
|
14 |
*/
|
15 |
var defaultConfig = {
|
16 |
loading : true,
|
17 |
-
cssClass : 'link-loading'
|
|
|
18 |
};
|
19 |
|
20 |
/**
|
@@ -55,19 +56,22 @@
|
|
55 |
* @type Object
|
56 |
*/
|
57 |
stack : {},
|
58 |
-
|
59 |
/**
|
60 |
* put your comment there...
|
61 |
*
|
|
|
62 |
*/
|
63 |
-
changeState : function() {
|
64 |
// Get reference to HTML node for the link element.
|
65 |
var node = this.jNode.get(0);
|
66 |
var stack = this.stack;
|
67 |
// Change configs.
|
68 |
-
this.setConfig();
|
69 |
-
// Enable loading.
|
70 |
-
if (this.config.loading) {
|
|
|
|
|
71 |
// Store link text & Remove link text.
|
72 |
stack.originalWidth = this.jNode.css('width');
|
73 |
stack.text = this.jNode.text();
|
@@ -85,9 +89,9 @@
|
|
85 |
}
|
86 |
);
|
87 |
}
|
88 |
-
else { // Disable loading and destroy object.
|
89 |
// Remove loading class.
|
90 |
-
this.
|
91 |
// Set text back.
|
92 |
this.jNode.text(stack.text);
|
93 |
// Remove custom width.
|
@@ -96,22 +100,24 @@
|
|
96 |
this.jNode.bind('click', this.config.ceHandler)
|
97 |
// Unbind prevent default handler defined by this class
|
98 |
.unbind('click.CJTLoading');
|
99 |
-
//
|
100 |
-
|
101 |
}
|
102 |
},
|
103 |
|
104 |
/**
|
|
|
105 |
*
|
|
|
106 |
*/
|
107 |
-
setConfig : function() {
|
108 |
this.config = $.extend(defaultConfig, params);
|
109 |
}
|
110 |
|
111 |
};
|
112 |
}
|
113 |
// Initialize Plugin for first time.
|
114 |
-
this.CJTLoader.changeState();
|
115 |
}
|
116 |
)
|
117 |
} // End JPlugin.
|
14 |
*/
|
15 |
var defaultConfig = {
|
16 |
loading : true,
|
17 |
+
cssClass : 'link-loading',
|
18 |
+
ceHandler : null
|
19 |
};
|
20 |
|
21 |
/**
|
56 |
* @type Object
|
57 |
*/
|
58 |
stack : {},
|
59 |
+
|
60 |
/**
|
61 |
* put your comment there...
|
62 |
*
|
63 |
+
* @param params
|
64 |
*/
|
65 |
+
changeState : function(params) {
|
66 |
// Get reference to HTML node for the link element.
|
67 |
var node = this.jNode.get(0);
|
68 |
var stack = this.stack;
|
69 |
// Change configs.
|
70 |
+
this.setConfig(params);
|
71 |
+
// Enable loading only if not already in loading state.
|
72 |
+
if (!stack.loading && this.config.loading) {
|
73 |
+
// SET as in LOADING state.
|
74 |
+
stack.loading = true;
|
75 |
// Store link text & Remove link text.
|
76 |
stack.originalWidth = this.jNode.css('width');
|
77 |
stack.text = this.jNode.text();
|
89 |
}
|
90 |
);
|
91 |
}
|
92 |
+
else if (stack.loading && !this.config.loading) { // Disable loading and destroy object.
|
93 |
// Remove loading class.
|
94 |
+
this.jNode.removeClass(this.config.cssClass);
|
95 |
// Set text back.
|
96 |
this.jNode.text(stack.text);
|
97 |
// Remove custom width.
|
100 |
this.jNode.bind('click', this.config.ceHandler)
|
101 |
// Unbind prevent default handler defined by this class
|
102 |
.unbind('click.CJTLoading');
|
103 |
+
// RESET STACK!
|
104 |
+
this.stack = {};
|
105 |
}
|
106 |
},
|
107 |
|
108 |
/**
|
109 |
+
* put your comment there...
|
110 |
*
|
111 |
+
* @param params
|
112 |
*/
|
113 |
+
setConfig : function(params) {
|
114 |
this.config = $.extend(defaultConfig, params);
|
115 |
}
|
116 |
|
117 |
};
|
118 |
}
|
119 |
// Initialize Plugin for first time.
|
120 |
+
this.CJTLoader.changeState(params);
|
121 |
}
|
122 |
)
|
123 |
} // End JPlugin.
|
framework/js/ui/jquery.toolbox/jquery.toolbox.js
CHANGED
@@ -244,7 +244,7 @@ var CJTToolBoxNS = new (function ($) {
|
|
244 |
// Don't show the popup immediately when the mouse come over the button.
|
245 |
// As our move the mouse and didnt decide yest which popup to open.
|
246 |
// Stay for a while to make sure that this popup is desirable.
|
247 |
-
this.popupTimer = setTimeout($.proxy(this.showPopup, this),
|
248 |
cbMouseOut = $.proxy(this._onmouseout, this);
|
249 |
// Hide Popup if mouse out from button or the popup form!
|
250 |
this.jButton.bind('mouseout.CJTButtonTouchMouseOut', cbMouseOut);
|
@@ -293,7 +293,9 @@ var CJTToolBoxNS = new (function ($) {
|
|
293 |
.mouseenter($.proxy(this._onmouseenter, this))
|
294 |
.click(function() {return false;}); // Behave inactive.
|
295 |
// Prepare popup elements.
|
296 |
-
this.targetElement =
|
|
|
|
|
297 |
// Be intelegant and don't close for just if the mouse got out
|
298 |
// Please give User a break!!
|
299 |
.mouseenter($.proxy(this._onmouseenter, this));
|
@@ -305,7 +307,7 @@ var CJTToolBoxNS = new (function ($) {
|
|
305 |
*/
|
306 |
this.close = function() {
|
307 |
this.jButton.unbind('mouseout.CJTButtonTouchMouseOut');
|
308 |
-
this.targetElement.unbind('mouseout.CJTButtonTouchMouseOut').hide(
|
309 |
}
|
310 |
|
311 |
/**
|
@@ -329,7 +331,7 @@ var CJTToolBoxNS = new (function ($) {
|
|
329 |
this.targetElement.css ({left : (this.jButton.position().left + 'px')})
|
330 |
}
|
331 |
// Show popup form.
|
332 |
-
this.targetElement.show(
|
333 |
}
|
334 |
|
335 |
} // End class.
|
244 |
// Don't show the popup immediately when the mouse come over the button.
|
245 |
// As our move the mouse and didnt decide yest which popup to open.
|
246 |
// Stay for a while to make sure that this popup is desirable.
|
247 |
+
this.popupTimer = setTimeout($.proxy(this.showPopup, this), 100);
|
248 |
cbMouseOut = $.proxy(this._onmouseout, this);
|
249 |
// Hide Popup if mouse out from button or the popup form!
|
250 |
this.jButton.bind('mouseout.CJTButtonTouchMouseOut', cbMouseOut);
|
293 |
.mouseenter($.proxy(this._onmouseenter, this))
|
294 |
.click(function() {return false;}); // Behave inactive.
|
295 |
// Prepare popup elements.
|
296 |
+
this.targetElement = params._type.targetElementObject ?
|
297 |
+
params._type.targetElement :
|
298 |
+
this.toolbox.jToolbox.find(params._type.targetElement)
|
299 |
// Be intelegant and don't close for just if the mouse got out
|
300 |
// Please give User a break!!
|
301 |
.mouseenter($.proxy(this._onmouseenter, this));
|
307 |
*/
|
308 |
this.close = function() {
|
309 |
this.jButton.unbind('mouseout.CJTButtonTouchMouseOut');
|
310 |
+
this.targetElement.unbind('mouseout.CJTButtonTouchMouseOut').hide();
|
311 |
}
|
312 |
|
313 |
/**
|
331 |
this.targetElement.css ({left : (this.jButton.position().left + 'px')})
|
332 |
}
|
333 |
// Show popup form.
|
334 |
+
this.targetElement.show();
|
335 |
}
|
336 |
|
337 |
} // End class.
|
framework/js/wordpress/script-localizer/script-localizer.js
ADDED
@@ -0,0 +1,43 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
*
|
3 |
+
*/
|
4 |
+
|
5 |
+
var CJTWPScriptLocalizer;
|
6 |
+
|
7 |
+
/**
|
8 |
+
*
|
9 |
+
*/
|
10 |
+
(function($) {
|
11 |
+
|
12 |
+
/**
|
13 |
+
* put your comment there...
|
14 |
+
*
|
15 |
+
*/
|
16 |
+
CJTWPScriptLocalizer = function(scripts) {
|
17 |
+
|
18 |
+
/**
|
19 |
+
*
|
20 |
+
*/
|
21 |
+
this.localize = function() {
|
22 |
+
var localization = '';
|
23 |
+
// For every script file get JS localization array.
|
24 |
+
$.each(scripts, $.proxy(
|
25 |
+
function(index, script) {
|
26 |
+
// Is the Script localized?
|
27 |
+
if (script.extra.data != undefined) {
|
28 |
+
// Merge all localization vars into single string!
|
29 |
+
localization += script.extra.data + ";\n";
|
30 |
+
}
|
31 |
+
}, this)
|
32 |
+
);
|
33 |
+
// Add single script tag for all the localization variables.
|
34 |
+
var scriptTag = document.createElement('script');
|
35 |
+
scriptTag.type = "text/javascript";
|
36 |
+
scriptTag.innerHTML = localization;
|
37 |
+
// Evaluation!
|
38 |
+
document.getElementsByTagName('head')[0].appendChild(scriptTag);
|
39 |
+
}
|
40 |
+
|
41 |
+
} // End class.
|
42 |
+
|
43 |
+
})(jQuery);
|
framework/mvc/controller.inc.php
CHANGED
@@ -111,7 +111,7 @@ abstract class CJTController extends CJTHookableClass {
|
|
111 |
if (!isset($this->controllerInfo['model_file'])) {
|
112 |
$this->controllerInfo['model_file'] = null;
|
113 |
}
|
114 |
-
$this->model = CJTModel::create($this->controllerInfo['model'],
|
115 |
}
|
116 |
// Create default view.
|
117 |
if ($hasView === null) { // Default value for $hasView = true
|
@@ -243,7 +243,7 @@ abstract class CJTController extends CJTHookableClass {
|
|
243 |
* @param mixed $name
|
244 |
*/
|
245 |
public function getRequestParameter($name) {
|
246 |
-
return $this->request;
|
247 |
}
|
248 |
|
249 |
/**
|
@@ -252,7 +252,7 @@ abstract class CJTController extends CJTHookableClass {
|
|
252 |
*
|
253 |
* @deprecated
|
254 |
*/
|
255 |
-
public static function getView($path) {
|
256 |
$view = null;
|
257 |
// Import view file.
|
258 |
$viewInfo = self::getViewInfo($path);
|
@@ -260,7 +260,7 @@ abstract class CJTController extends CJTHookableClass {
|
|
260 |
// Create view object.
|
261 |
$name = str_replace(' ', '', ucwords(str_replace('/', ' ',$path)));
|
262 |
$viewClass = self::getClassName($name, 'view');
|
263 |
-
$view = new $viewClass($viewInfo);
|
264 |
return $view;
|
265 |
}
|
266 |
|
111 |
if (!isset($this->controllerInfo['model_file'])) {
|
112 |
$this->controllerInfo['model_file'] = null;
|
113 |
}
|
114 |
+
$this->model = CJTModel::create($this->controllerInfo['model'], $this->request, $this->controllerInfo['model_file']);
|
115 |
}
|
116 |
// Create default view.
|
117 |
if ($hasView === null) { // Default value for $hasView = true
|
243 |
* @param mixed $name
|
244 |
*/
|
245 |
public function getRequestParameter($name) {
|
246 |
+
return isset($this->request[$name]) ? $this->request[$name] : null;
|
247 |
}
|
248 |
|
249 |
/**
|
252 |
*
|
253 |
* @deprecated
|
254 |
*/
|
255 |
+
public static function getView($path, $params = null) {
|
256 |
$view = null;
|
257 |
// Import view file.
|
258 |
$viewInfo = self::getViewInfo($path);
|
260 |
// Create view object.
|
261 |
$name = str_replace(' ', '', ucwords(str_replace('/', ' ',$path)));
|
262 |
$viewClass = self::getClassName($name, 'view');
|
263 |
+
$view = new $viewClass($viewInfo, $params);
|
264 |
return $view;
|
265 |
}
|
266 |
|
framework/mvc/view.inc.php
CHANGED
@@ -111,6 +111,13 @@ abstract class CJTView extends CJTHookableClass {
|
|
111 |
'parameters' => array('styles'),
|
112 |
);
|
113 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
114 |
/**
|
115 |
* put your comment there...
|
116 |
*
|
@@ -135,10 +142,14 @@ abstract class CJTView extends CJTHookableClass {
|
|
135 |
/**
|
136 |
* put your comment there...
|
137 |
*
|
|
|
|
|
|
|
138 |
*/
|
139 |
-
public function __construct($info) {
|
140 |
// Initialize vars!
|
141 |
$this->viewInfo = $info;
|
|
|
142 |
// Initialize events engine!
|
143 |
parent::__construct();
|
144 |
// Fire created event!
|
@@ -158,9 +169,10 @@ abstract class CJTView extends CJTHookableClass {
|
|
158 |
* put your comment there...
|
159 |
*
|
160 |
* @param mixed $view
|
|
|
161 |
*/
|
162 |
-
public static function getInstance($view) {
|
163 |
-
return self::trigger('CJTView.createview', CJTController::getView($view));
|
164 |
}
|
165 |
|
166 |
/**
|
@@ -176,6 +188,15 @@ abstract class CJTView extends CJTHookableClass {
|
|
176 |
return $this->ongetmodel($this->model);
|
177 |
}
|
178 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
179 |
/**
|
180 |
* put your comment there...
|
181 |
*
|
@@ -200,7 +221,7 @@ abstract class CJTView extends CJTHookableClass {
|
|
200 |
* @param mixed $value
|
201 |
*/
|
202 |
public function getRequestParameter($name) {
|
203 |
-
return $this->request[$name];
|
204 |
}
|
205 |
|
206 |
/**
|
@@ -317,6 +338,18 @@ abstract class CJTView extends CJTHookableClass {
|
|
317 |
return $this;
|
318 |
}
|
319 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
320 |
/**
|
321 |
* put your comment there...
|
322 |
*
|
111 |
'parameters' => array('styles'),
|
112 |
);
|
113 |
|
114 |
+
/**
|
115 |
+
* put your comment there...
|
116 |
+
*
|
117 |
+
* @var mixed
|
118 |
+
*/
|
119 |
+
protected $params = null;
|
120 |
+
|
121 |
/**
|
122 |
* put your comment there...
|
123 |
*
|
142 |
/**
|
143 |
* put your comment there...
|
144 |
*
|
145 |
+
* @param mixed $info
|
146 |
+
* @param mixed $params
|
147 |
+
* @return CJTView
|
148 |
*/
|
149 |
+
public function __construct($info, $params = null) {
|
150 |
// Initialize vars!
|
151 |
$this->viewInfo = $info;
|
152 |
+
$this->params = $params ? $params : array();
|
153 |
// Initialize events engine!
|
154 |
parent::__construct();
|
155 |
// Fire created event!
|
169 |
* put your comment there...
|
170 |
*
|
171 |
* @param mixed $view
|
172 |
+
* @param mixed $params
|
173 |
*/
|
174 |
+
public static function getInstance($view, $params = null) {
|
175 |
+
return self::trigger('CJTView.createview', CJTController::getView($view, $params));
|
176 |
}
|
177 |
|
178 |
/**
|
188 |
return $this->ongetmodel($this->model);
|
189 |
}
|
190 |
|
191 |
+
/**
|
192 |
+
* put your comment there...
|
193 |
+
*
|
194 |
+
* @param mixed $name
|
195 |
+
*/
|
196 |
+
public function getParam($name) {
|
197 |
+
return isset($this->params[$name]) ? $this->params[$name] : null;
|
198 |
+
}
|
199 |
+
|
200 |
/**
|
201 |
* put your comment there...
|
202 |
*
|
221 |
* @param mixed $value
|
222 |
*/
|
223 |
public function getRequestParameter($name) {
|
224 |
+
return isset($this->request[$name]) ? $this->request[$name] : null;
|
225 |
}
|
226 |
|
227 |
/**
|
338 |
return $this;
|
339 |
}
|
340 |
|
341 |
+
/**
|
342 |
+
* put your comment there...
|
343 |
+
*
|
344 |
+
*/
|
345 |
+
protected function & suppressPrintScriptsHook() {
|
346 |
+
// Access Global.
|
347 |
+
global $wp_actions;
|
348 |
+
// Mark as triggered.
|
349 |
+
$wp_actions['wp_print_scripts'] = true;
|
350 |
+
// Chain.
|
351 |
+
return $this;
|
352 |
+
}
|
353 |
/**
|
354 |
* put your comment there...
|
355 |
*
|
framework/packages/package.class.php
ADDED
@@ -0,0 +1,160 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
*
|
4 |
+
*/
|
5 |
+
|
6 |
+
// Disllow direct access.
|
7 |
+
defined('ABSPATH') or die('Access denied');
|
8 |
+
|
9 |
+
|
10 |
+
/**
|
11 |
+
*
|
12 |
+
*/
|
13 |
+
class CJTPackageFile {
|
14 |
+
|
15 |
+
/**
|
16 |
+
*
|
17 |
+
*/
|
18 |
+
const DEFINITION_FILE_NAME = 'definition.xml';
|
19 |
+
|
20 |
+
/**
|
21 |
+
* put your comment there...
|
22 |
+
*
|
23 |
+
* @var mixed
|
24 |
+
*/
|
25 |
+
protected $definition = null;
|
26 |
+
|
27 |
+
/**
|
28 |
+
* put your comment there...
|
29 |
+
*
|
30 |
+
* @var mixed
|
31 |
+
*/
|
32 |
+
protected $packageDirectory;
|
33 |
+
|
34 |
+
/**
|
35 |
+
* put your comment there...
|
36 |
+
*
|
37 |
+
* @param mixed $packageDirectory
|
38 |
+
* @return CJTPackageFile
|
39 |
+
*/
|
40 |
+
public function __construct($packageDirectory) {
|
41 |
+
// Initialize.
|
42 |
+
$this->packageDirectory = $packageDirectory;
|
43 |
+
// Load XML definition.
|
44 |
+
$this->loadDefinitionFile();
|
45 |
+
}
|
46 |
+
|
47 |
+
/**
|
48 |
+
* put your comment there...
|
49 |
+
*
|
50 |
+
*/
|
51 |
+
public function document() {
|
52 |
+
return $this->definition;
|
53 |
+
}
|
54 |
+
|
55 |
+
/**
|
56 |
+
* Fetch specific object property that might required
|
57 |
+
* specific wrapper (read file, read from external resources,
|
58 |
+
* decode embedded content) for reading them.
|
59 |
+
*
|
60 |
+
* This method now is only supporting read content from
|
61 |
+
* local file laying under the package directory.
|
62 |
+
*
|
63 |
+
* @param SimpleXMLElement Object to fetch the property from.
|
64 |
+
* @param String Property name.
|
65 |
+
* @param Array TRansporter info array
|
66 |
+
* @return CJTPackageFile Returning $this.
|
67 |
+
*/
|
68 |
+
public function fetchProperty($object, $propertyName, $transportersInfo = array()) {
|
69 |
+
// Initialize.
|
70 |
+
$attributes = $object->$propertyName->attributes();
|
71 |
+
// Tarnsporter.
|
72 |
+
$transporter = (string) $attributes->locate;
|
73 |
+
// Do transport only if one specified!
|
74 |
+
if ($transporter) {
|
75 |
+
// Get value to be transported.
|
76 |
+
$oldValue = (string) $object->$propertyName;
|
77 |
+
// TRansporters.
|
78 |
+
switch ($transporter) {
|
79 |
+
// Read from file.
|
80 |
+
case 'file':
|
81 |
+
// If no file name (old value) is given use transporters Info parameter
|
82 |
+
// for getting the file name.
|
83 |
+
$fileName = $oldValue ? $oldValue : $transportersInfo[$propertyName];
|
84 |
+
$content = file_get_contents("{$this->packageDirectory}/{$fileName}");
|
85 |
+
// Save locatted file path in 'locatted' attribute.
|
86 |
+
$object->$propertyName->addAttribute('locatted', $fileName);
|
87 |
+
break;
|
88 |
+
default:
|
89 |
+
throw new Exception('Transported is not being supported!');
|
90 |
+
break;
|
91 |
+
}
|
92 |
+
// Replace placeholder with real content so it can be read
|
93 |
+
// by the caller!
|
94 |
+
$object->$propertyName = $content;
|
95 |
+
}
|
96 |
+
// Chaining!
|
97 |
+
return $this;
|
98 |
+
}
|
99 |
+
|
100 |
+
/**
|
101 |
+
* put your comment there...
|
102 |
+
*
|
103 |
+
*/
|
104 |
+
public function getDirectory() {
|
105 |
+
return $this->packageDirectory;
|
106 |
+
}
|
107 |
+
|
108 |
+
/**
|
109 |
+
* put your comment there...
|
110 |
+
*
|
111 |
+
* @param SimpleXMLElement $object
|
112 |
+
* @param mixed $transportersInfo
|
113 |
+
*/
|
114 |
+
public function getItem($object = null, $transportersInfo = array()) {
|
115 |
+
// Initialize.
|
116 |
+
$item = array();
|
117 |
+
// Defaut object is the package object.
|
118 |
+
if (!$object) {
|
119 |
+
$object = $this->document();
|
120 |
+
}
|
121 |
+
// Package info is all the child elements except 'objects' element.
|
122 |
+
$childs = $object->children();
|
123 |
+
foreach ($childs as $field => $childObject) {
|
124 |
+
// Discard child elements that has childs!
|
125 |
+
if (!count($childObject->children())) {
|
126 |
+
// Fetch item properties that need to be transported from
|
127 |
+
// other resource (e.g file).
|
128 |
+
// Items that need to have transported would have
|
129 |
+
// 'locate' attributes in its XML element.
|
130 |
+
if (((string) $childObject->attributes()->locate)) {
|
131 |
+
$this->fetchProperty($object, $field, $transportersInfo);
|
132 |
+
}
|
133 |
+
// Add item name to list.
|
134 |
+
$item[$field] = (string) $childObject;
|
135 |
+
}
|
136 |
+
}
|
137 |
+
// This is it!
|
138 |
+
return $item;
|
139 |
+
}
|
140 |
+
|
141 |
+
/**
|
142 |
+
* put your comment there...
|
143 |
+
*
|
144 |
+
*/
|
145 |
+
public function getPackageName() {
|
146 |
+
return basename($this->packageDirectory);
|
147 |
+
}
|
148 |
+
|
149 |
+
/**
|
150 |
+
* put your comment there...
|
151 |
+
*
|
152 |
+
*/
|
153 |
+
protected function loadDefinitionFile() {
|
154 |
+
// Get full path to package definition file.
|
155 |
+
$defnitionFile = "{$this->packageDirectory}/" . self::DEFINITION_FILE_NAME;
|
156 |
+
// Load Definition file into SimpleXMLElement object.
|
157 |
+
$this->definition = new SimpleXMLElement(file_get_contents($defnitionFile));
|
158 |
+
}
|
159 |
+
|
160 |
+
} // End class.
|
framework/third-party/easy-digital-download/auto-upgrade.class.php
CHANGED
@@ -6,10 +6,16 @@
|
|
6 |
/**
|
7 |
* Allows plugins to use their own update API.
|
8 |
*
|
|
|
|
|
|
|
|
|
|
|
|
|
9 |
* @author Pippin Williamson
|
10 |
* @version 1.0
|
11 |
*/
|
12 |
-
class
|
13 |
private $api_url = '';
|
14 |
private $api_data = array();
|
15 |
private $name = '';
|
@@ -32,7 +38,7 @@ class EDD_SL_Plugin_Updater {
|
|
32 |
$this->name = plugin_basename( $_plugin_file );
|
33 |
$this->slug = basename( $_plugin_file, '.php');
|
34 |
$this->version = $_api_data['version'];
|
35 |
-
|
36 |
// Set up hooks.
|
37 |
$this->hook();
|
38 |
}
|
@@ -72,9 +78,30 @@ class EDD_SL_Plugin_Updater {
|
|
72 |
$api_response = $this->api_request( 'plugin_latest_version', $to_send );
|
73 |
|
74 |
if( false !== $api_response && is_object( $api_response ) ) {
|
75 |
-
if( version_compare( $this->version, $api_response->new_version, '<' ) )
|
76 |
$_transient_data->response[$this->name] = $api_response;
|
77 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
78 |
return $_transient_data;
|
79 |
}
|
80 |
|
6 |
/**
|
7 |
* Allows plugins to use their own update API.
|
8 |
*
|
9 |
+
* Class below has been modified by CJT.
|
10 |
+
*
|
11 |
+
* The name of the class is also changed
|
12 |
+
* as CJT cannot use another non-modified copy.
|
13 |
+
* CJT Must use THIS class and not the original one.
|
14 |
+
*
|
15 |
* @author Pippin Williamson
|
16 |
* @version 1.0
|
17 |
*/
|
18 |
+
class CJT_EDD_SL_Plugin_Updater {
|
19 |
private $api_url = '';
|
20 |
private $api_data = array();
|
21 |
private $name = '';
|
38 |
$this->name = plugin_basename( $_plugin_file );
|
39 |
$this->slug = basename( $_plugin_file, '.php');
|
40 |
$this->version = $_api_data['version'];
|
41 |
+
|
42 |
// Set up hooks.
|
43 |
$this->hook();
|
44 |
}
|
78 |
$api_response = $this->api_request( 'plugin_latest_version', $to_send );
|
79 |
|
80 |
if( false !== $api_response && is_object( $api_response ) ) {
|
81 |
+
if( version_compare( $this->version, $api_response->new_version, '<' ) ) {
|
82 |
$_transient_data->response[$this->name] = $api_response;
|
83 |
+
}
|
84 |
+
else {
|
85 |
+
/**
|
86 |
+
* Remove FREE edition update that cached by
|
87 |
+
* Wordpress plugins update.
|
88 |
+
*
|
89 |
+
* @author CJT
|
90 |
+
*/
|
91 |
+
unset( $_transient_data->response[$this->name] );
|
92 |
+
}
|
93 |
+
}
|
94 |
+
else {
|
95 |
+
/**
|
96 |
+
* Remove FREE edition update that cached by
|
97 |
+
* Wordpress plugins update. Is must do if the
|
98 |
+
* HTTP reqeust fail as it will allo user to get a FREE
|
99 |
+
* copy!
|
100 |
+
*
|
101 |
+
* @author CJT
|
102 |
+
*/
|
103 |
+
unset( $_transient_data->response[$this->name] );
|
104 |
+
}
|
105 |
return $_transient_data;
|
106 |
}
|
107 |
|
framework/types/attributes.class.php
ADDED
@@ -0,0 +1,92 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
*
|
4 |
+
*/
|
5 |
+
|
6 |
+
/**
|
7 |
+
*
|
8 |
+
*/
|
9 |
+
class CJTAttributes {
|
10 |
+
|
11 |
+
/**
|
12 |
+
* put your comment there...
|
13 |
+
*
|
14 |
+
* @var mixed
|
15 |
+
*/
|
16 |
+
protected $flags;
|
17 |
+
|
18 |
+
/**
|
19 |
+
* put your comment there...
|
20 |
+
*
|
21 |
+
* @var mixed
|
22 |
+
*/
|
23 |
+
protected $resetDefault;
|
24 |
+
|
25 |
+
/**
|
26 |
+
* put your comment there...
|
27 |
+
*
|
28 |
+
* @param mixed $init
|
29 |
+
*/
|
30 |
+
public function __construct($initFlags = 0, $resetDefault = 0) {
|
31 |
+
$this->flags = $initFlags;
|
32 |
+
$this->resetDefault = $resetDefault;
|
33 |
+
}
|
34 |
+
|
35 |
+
/**
|
36 |
+
* put your comment there...
|
37 |
+
*
|
38 |
+
* @param mixed $flag
|
39 |
+
*/
|
40 |
+
public function isOff($flag) {
|
41 |
+
return !$this->isOn($flag);
|
42 |
+
}
|
43 |
+
|
44 |
+
/**
|
45 |
+
* put your comment there...
|
46 |
+
*
|
47 |
+
* @param mixed $flag
|
48 |
+
*/
|
49 |
+
public function isOn($flag) {
|
50 |
+
return $this->flags & $flag;
|
51 |
+
}
|
52 |
+
|
53 |
+
/**
|
54 |
+
* put your comment there...
|
55 |
+
*
|
56 |
+
* @param mixed $flag
|
57 |
+
*/
|
58 |
+
public function off($flag) {
|
59 |
+
$this->flags &= (~$flag); // All other flags are ON except our!
|
60 |
+
return $this;
|
61 |
+
}
|
62 |
+
|
63 |
+
/**
|
64 |
+
* put your comment there...
|
65 |
+
*
|
66 |
+
* @param mixed $flag
|
67 |
+
*/
|
68 |
+
public function on($flag) {
|
69 |
+
$this->flags &= $flag; // All other flag are OFF except our!
|
70 |
+
return $this;
|
71 |
+
}
|
72 |
+
|
73 |
+
/**
|
74 |
+
* put your comment there...
|
75 |
+
*
|
76 |
+
*/
|
77 |
+
public function reset() {
|
78 |
+
$this->flags = $this->resetDefault;
|
79 |
+
return $this;
|
80 |
+
}
|
81 |
+
|
82 |
+
/**
|
83 |
+
* put your comment there...
|
84 |
+
*
|
85 |
+
* @param mixed $flag
|
86 |
+
*/
|
87 |
+
public function revert($flag) {
|
88 |
+
$this->flags ^= $flag; // XOR
|
89 |
+
return $this;
|
90 |
+
}
|
91 |
+
|
92 |
+
} // End class.
|
framework/view/block/parameter/base/abstract.php
ADDED
@@ -0,0 +1,128 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
*
|
4 |
+
*/
|
5 |
+
|
6 |
+
/**
|
7 |
+
*
|
8 |
+
*/
|
9 |
+
abstract class CJT_Framework_View_Block_Parameter_Base_Abstract
|
10 |
+
extends CJT_Framework_Developer_Interface_Block_Shortcode_Parameters_Base_Abstract
|
11 |
+
implements CJT_Framework_Developer_Interface_Block_Shortcode_Parameters_Interface_Type,
|
12 |
+
CJT_Framework_View_Block_Parameter_Interface_Type {
|
13 |
+
|
14 |
+
/**
|
15 |
+
* put your comment there...
|
16 |
+
*
|
17 |
+
*/
|
18 |
+
public function __toString() {
|
19 |
+
// Get class file name.
|
20 |
+
$content = $this->getTypeObject()->getFactory()->getClassFile(get_class($this), 'index.phtml');
|
21 |
+
// Get content on output buffer.
|
22 |
+
ob_start();
|
23 |
+
include $content;
|
24 |
+
return ob_get_clean();
|
25 |
+
}
|
26 |
+
|
27 |
+
/**
|
28 |
+
* put your comment there...
|
29 |
+
*
|
30 |
+
*/
|
31 |
+
public function enqueueScripts() {return array();}
|
32 |
+
|
33 |
+
/**
|
34 |
+
* put your comment there...
|
35 |
+
*
|
36 |
+
*/
|
37 |
+
public function enqueueStyles() {return array();}
|
38 |
+
|
39 |
+
/**
|
40 |
+
* put your comment there...
|
41 |
+
*
|
42 |
+
* @param mixed $parameter
|
43 |
+
*/
|
44 |
+
public function getBaseTypeFactory($parameter) {
|
45 |
+
// Hold local instance!
|
46 |
+
static $baseTypeFactory;
|
47 |
+
if (!$baseTypeFactory) {
|
48 |
+
$baseTypeFactory = new CJT_Framework_Developer_Interface_Block_Shortcode_Parameters_Factory();
|
49 |
+
}
|
50 |
+
// Type factory
|
51 |
+
return array(
|
52 |
+
'factory' => $baseTypeFactory,
|
53 |
+
'typeName' => $parameter->getOriginalType(),
|
54 |
+
);
|
55 |
+
}
|
56 |
+
|
57 |
+
/**
|
58 |
+
* put your comment there...
|
59 |
+
*
|
60 |
+
*/
|
61 |
+
protected function getControlName() {
|
62 |
+
return $this->getDefinition()->getName(true);
|
63 |
+
}
|
64 |
+
|
65 |
+
/**
|
66 |
+
* put your comment there...
|
67 |
+
*
|
68 |
+
*/
|
69 |
+
protected function getElementId() {
|
70 |
+
// Get element name.
|
71 |
+
$name = $this->getName();
|
72 |
+
// Replace all [ and ] to dashes!
|
73 |
+
$id = str_replace(array('[', ']'), '-', $name);
|
74 |
+
return $id;
|
75 |
+
}
|
76 |
+
|
77 |
+
/**
|
78 |
+
* put your comment there...
|
79 |
+
*
|
80 |
+
*/
|
81 |
+
public function getName() {
|
82 |
+
// Initialize.
|
83 |
+
$name = '';
|
84 |
+
$names = array();
|
85 |
+
// Add current parameter name as first.
|
86 |
+
$names[] = $this->getControlName();
|
87 |
+
// Unshift all the parent names at the begning of the names list!
|
88 |
+
$parent = $this;
|
89 |
+
while ($parent = $parent->getParent()) {
|
90 |
+
array_unshift($names, $parent->getControlName());
|
91 |
+
}
|
92 |
+
// Use first item as the name and everything else as array.
|
93 |
+
$name = 'form-data';
|
94 |
+
// Get everything else as array.
|
95 |
+
if (!empty($names)) {
|
96 |
+
$name .= '[' . implode('][', $names) . ']';
|
97 |
+
}
|
98 |
+
// Return string name
|
99 |
+
return $name;
|
100 |
+
}
|
101 |
+
|
102 |
+
/**
|
103 |
+
* put your comment there...
|
104 |
+
*
|
105 |
+
* @param mixed $name
|
106 |
+
*/
|
107 |
+
protected function getTemplate($name) {
|
108 |
+
// Get RENDERER class name.
|
109 |
+
$path = explode('_', get_class($this));
|
110 |
+
$rendererName = array_pop($path);
|
111 |
+
// For now it only support getting standard templates
|
112 |
+
// from the abstract class.
|
113 |
+
// In the future it might used to get template overrided in the
|
114 |
+
// $this object class.
|
115 |
+
ob_start();
|
116 |
+
include "abstract/template/{$name}.phtml";
|
117 |
+
return ob_get_clean();
|
118 |
+
}
|
119 |
+
|
120 |
+
/**
|
121 |
+
* put your comment there...
|
122 |
+
*
|
123 |
+
*/
|
124 |
+
public function shortcode() {
|
125 |
+
return $this->getTypeObject()->shortcode();
|
126 |
+
}
|
127 |
+
|
128 |
+
} // End class.
|
framework/view/block/parameter/base/abstract/template/helpText.phtml
ADDED
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php if ($helpText = $this->getDefinition()->getHelpText()) : ?>
|
2 |
+
<div class="cjt-shortcode-parameters-form-helpText renderer-<?php echo $rendererName ?>">
|
3 |
+
<div class="helpText"><?php echo $helpText ?></div>
|
4 |
+
</div>
|
5 |
+
<?php endif; ?>
|
framework/view/block/parameter/base/list.php
ADDED
@@ -0,0 +1,63 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
*
|
4 |
+
*/
|
5 |
+
|
6 |
+
/**
|
7 |
+
*
|
8 |
+
*/
|
9 |
+
abstract class CJT_Framework_View_Block_Parameter_Base_List
|
10 |
+
extends CJT_Framework_View_Block_Parameter_Base_Abstract {
|
11 |
+
|
12 |
+
/**
|
13 |
+
* put your comment there...
|
14 |
+
*
|
15 |
+
* @param mixed $parameter
|
16 |
+
* @param mixed $factory
|
17 |
+
* @return CJT_Framework_Developer_Interface_Block_Shortcode_Parameters_Base_Abstract
|
18 |
+
*/
|
19 |
+
public function __construct($parameter, $factory) {
|
20 |
+
// Parent procedure!
|
21 |
+
parent::__construct($parameter, $factory);
|
22 |
+
// Set parent reference for all child parameters.
|
23 |
+
foreach ($this->getParams() as $param) {
|
24 |
+
$param->setParent($this);
|
25 |
+
}
|
26 |
+
}
|
27 |
+
|
28 |
+
/**
|
29 |
+
* put your comment there...
|
30 |
+
*
|
31 |
+
*/
|
32 |
+
public function enqueueScripts() {
|
33 |
+
// @TODO: Enqueue all childs!!
|
34 |
+
return array();
|
35 |
+
}
|
36 |
+
|
37 |
+
/**
|
38 |
+
* put your comment there...
|
39 |
+
*
|
40 |
+
*/
|
41 |
+
public function enqueueStyles() {
|
42 |
+
// @TODO: Enqueue all childs!!
|
43 |
+
return array();
|
44 |
+
}
|
45 |
+
|
46 |
+
/**
|
47 |
+
* put your comment there...
|
48 |
+
*
|
49 |
+
*/
|
50 |
+
public function getParams() {
|
51 |
+
// Initialize.
|
52 |
+
$params = array();
|
53 |
+
$typeObject = $this->getTypeObject();
|
54 |
+
// As the form objects might handle types that doesn't support
|
55 |
+
// child parameters (Example: List type might handle Boolean type!).
|
56 |
+
// We need to check the existance of the method.
|
57 |
+
if (method_exists($typeObject, 'getParams')) {
|
58 |
+
$params = $typeObject->getParams();
|
59 |
+
}
|
60 |
+
return $params;
|
61 |
+
}
|
62 |
+
|
63 |
+
} // End class.
|
framework/view/block/parameter/base/scalar.php
ADDED
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
*
|
4 |
+
*/
|
5 |
+
|
6 |
+
/**
|
7 |
+
*
|
8 |
+
*/
|
9 |
+
abstract class CJT_Framework_View_Block_Parameter_Base_Scalar
|
10 |
+
extends CJT_Framework_View_Block_Parameter_Base_Abstract {} // End class.
|
framework/view/block/parameter/grouper/factory.php
ADDED
@@ -0,0 +1,26 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
*
|
4 |
+
*/
|
5 |
+
|
6 |
+
/**
|
7 |
+
*
|
8 |
+
*/
|
9 |
+
class CJT_Framework_View_Block_Parameter_Grouper_Factory {
|
10 |
+
|
11 |
+
/**
|
12 |
+
* put your comment there...
|
13 |
+
*
|
14 |
+
* @param mixed $name
|
15 |
+
* @param mixed $params
|
16 |
+
*/
|
17 |
+
public function create($name, $params) {
|
18 |
+
// Upper case first letter.
|
19 |
+
$name = ucfirst($name);
|
20 |
+
// Build class name.
|
21 |
+
$className = "CJT_Framework_View_Block_Parameter_Grouper_{$name}_{$name}";
|
22 |
+
// Inistntiate grouper object.
|
23 |
+
return new $className($params);
|
24 |
+
}
|
25 |
+
|
26 |
+
} // End class.
|
framework/view/block/parameter/grouper/tab/index.phtml
ADDED
@@ -0,0 +1,25 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
*
|
4 |
+
*/
|
5 |
+
|
6 |
+
// Display TAB navigator.
|
7 |
+
?>
|
8 |
+
<div id="cjt-grouper-tab-navigator">
|
9 |
+
<ul class="navigator">
|
10 |
+
<?php foreach ($this->getParams() as $group) : ?>
|
11 |
+
<li><a title="<?php echo $group['description'] ?>" href="#<?php echo $group['key']; ?>"><?php echo $group['name'] ?></a></li>
|
12 |
+
<?php endforeach; ?>
|
13 |
+
</ul>
|
14 |
+
<?php // Display TABS ?>
|
15 |
+
<?php foreach ($this->getParams() as $group) : ?>
|
16 |
+
<div id="<?php echo $group['key']; ?>">
|
17 |
+
<?php echo $group['text']; // Display Group XFields TOP TEXT ?>
|
18 |
+
<ul class="params-list">
|
19 |
+
<?php foreach ($group['params'] as $param) : ?>
|
20 |
+
<li><?php echo $param; ?></li>
|
21 |
+
<?php endforeach; ?>
|
22 |
+
</ul>
|
23 |
+
</div>
|
24 |
+
<?php endforeach; ?>
|
25 |
+
</div>
|
framework/view/block/parameter/grouper/tab/public/css/tab.css
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
.ui-tabs {overflow: auto;}
|
framework/view/block/parameter/grouper/tab/tab.php
ADDED
@@ -0,0 +1,87 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
*
|
4 |
+
*/
|
5 |
+
|
6 |
+
/**
|
7 |
+
*
|
8 |
+
*/
|
9 |
+
class CJT_Framework_View_Block_Parameter_Grouper_Tab_Tab {
|
10 |
+
|
11 |
+
/**
|
12 |
+
* put your comment there...
|
13 |
+
*
|
14 |
+
* @var mixed
|
15 |
+
*/
|
16 |
+
protected $params = null;
|
17 |
+
|
18 |
+
/**
|
19 |
+
* put your comment there...
|
20 |
+
*
|
21 |
+
* @var mixed
|
22 |
+
*/
|
23 |
+
protected $paramsView = array('enqueue' =>
|
24 |
+
array('scripts' => array(), 'styles' => array())
|
25 |
+
);
|
26 |
+
|
27 |
+
/**
|
28 |
+
* put your comment there...
|
29 |
+
*
|
30 |
+
* @param mixed $parameters
|
31 |
+
* @return CJT_Framework_View_Block_Parameter_Grouper_Tab
|
32 |
+
*/
|
33 |
+
public function __construct($params) {
|
34 |
+
// Cache params list reference.
|
35 |
+
$this->params = $params;
|
36 |
+
// Cache styles and scripts to be enqueued.
|
37 |
+
foreach ($this->params as $groupKey => $group) {
|
38 |
+
foreach ($group['params'] as $param) {
|
39 |
+
$this->paramsView['enqueue']['scripts'] = array_merge($this->paramsView['enqueue']['scripts'], $param->enqueueScripts());
|
40 |
+
$this->paramsView['enqueue']['styles'] = array_merge($this->paramsView['enqueue']['styles'], $param->enqueueStyles());
|
41 |
+
}
|
42 |
+
}
|
43 |
+
}
|
44 |
+
|
45 |
+
/**
|
46 |
+
* put your comment there...
|
47 |
+
*
|
48 |
+
*/
|
49 |
+
public function __toString() {
|
50 |
+
ob_start();
|
51 |
+
include 'index.phtml';
|
52 |
+
return ob_get_clean();
|
53 |
+
}
|
54 |
+
|
55 |
+
/**
|
56 |
+
* put your comment there...
|
57 |
+
*
|
58 |
+
*/
|
59 |
+
public function enqueueScripts() {
|
60 |
+
return array_merge(array(
|
61 |
+
'jquery',
|
62 |
+
'jquery-ui-tabs'
|
63 |
+
),
|
64 |
+
$this->paramsView['enqueue']['scripts']);
|
65 |
+
}
|
66 |
+
|
67 |
+
/**
|
68 |
+
* put your comment there...
|
69 |
+
*
|
70 |
+
*/
|
71 |
+
public function enqueueStyles() {
|
72 |
+
return array_merge(array(
|
73 |
+
'framework:view:block:parameter:grouper:tab:public:css:tab',
|
74 |
+
'framework:css:jquery-ui-1.8.21.custom',
|
75 |
+
),
|
76 |
+
$this->paramsView['enqueue']['styles']);
|
77 |
+
}
|
78 |
+
|
79 |
+
/**
|
80 |
+
* put your comment there...
|
81 |
+
*
|
82 |
+
*/
|
83 |
+
public function getParams() {
|
84 |
+
return $this->params;
|
85 |
+
}
|
86 |
+
|
87 |
+
} // End class.
|
framework/view/block/parameter/interface/type.php
ADDED
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
*
|
4 |
+
*/
|
5 |
+
|
6 |
+
/**
|
7 |
+
*
|
8 |
+
*/
|
9 |
+
interface CJT_Framework_View_Block_Parameter_Interface_Type {
|
10 |
+
|
11 |
+
/**
|
12 |
+
* put your comment there...
|
13 |
+
*
|
14 |
+
*/
|
15 |
+
public function __toString();
|
16 |
+
|
17 |
+
} // End class.
|
framework/view/block/parameter/parameters.php
ADDED
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
*
|
4 |
+
*/
|
5 |
+
|
6 |
+
/**
|
7 |
+
*
|
8 |
+
*/
|
9 |
+
class CJT_Framework_View_Block_Parameter_Parameters
|
10 |
+
extends CJT_Framework_Developer_Interface_Block_Shortcode_Parameters_Parameters {
|
11 |
+
|
12 |
+
/**
|
13 |
+
* put your comment there...
|
14 |
+
*
|
15 |
+
*/
|
16 |
+
protected function getFactory() {
|
17 |
+
return new CJT_Framework_View_Block_Parameter_Renderer_Factory();
|
18 |
+
}
|
19 |
+
|
20 |
+
} // End class
|
framework/view/block/parameter/renderer/array/array.php
ADDED
@@ -0,0 +1,36 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
*
|
4 |
+
*/
|
5 |
+
|
6 |
+
/**
|
7 |
+
*
|
8 |
+
*/
|
9 |
+
class CJT_Framework_View_Block_Parameter_Renderer_Array_Array
|
10 |
+
extends CJT_Framework_View_Block_Parameter_Base_List {
|
11 |
+
|
12 |
+
/**
|
13 |
+
* put your comment there...
|
14 |
+
*
|
15 |
+
* @param mixed $parameter
|
16 |
+
* @param mixed $factory
|
17 |
+
* @return CJT_Framework_Developer_Interface_Block_Shortcode_Parameters_Base_Abstract
|
18 |
+
*/
|
19 |
+
public function __construct($parameter, $factory) {
|
20 |
+
// Parent procedure!
|
21 |
+
parent::__construct($parameter, $factory);
|
22 |
+
// Set parent reference for all child parameters.
|
23 |
+
foreach ($this->getValues() as $param) {
|
24 |
+
$param->setParent($this);
|
25 |
+
}
|
26 |
+
}
|
27 |
+
|
28 |
+
/**
|
29 |
+
* put your comment there...
|
30 |
+
*
|
31 |
+
*/
|
32 |
+
public function getValues() {
|
33 |
+
return $this->getTypeObject()->getValues();
|
34 |
+
}
|
35 |
+
|
36 |
+
} // End class.
|
framework/view/block/parameter/renderer/array/index.phtml
ADDED
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
*
|
4 |
+
*/
|
5 |
+
$definition = $this->getDefinition();
|
6 |
+
?>
|
7 |
+
<fieldset class="cjt-param-structure">
|
8 |
+
<strong><?php echo $definition->getName() ?></strong>
|
9 |
+
<ul>
|
10 |
+
<?php foreach ($this->getValues() as $param) : ?>
|
11 |
+
<li><?php echo $param ?></li>
|
12 |
+
<?php endforeach; ?>
|
13 |
+
</ul>
|
14 |
+
</fieldset>
|
framework/view/block/parameter/renderer/checkbox/checkbox.php
ADDED
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
*
|
4 |
+
*/
|
5 |
+
|
6 |
+
/**
|
7 |
+
*
|
8 |
+
*/
|
9 |
+
class CJT_Framework_View_Block_Parameter_Renderer_Checkbox_Checkbox
|
10 |
+
extends CJT_Framework_View_Block_Parameter_Base_Scalar {} // End class.
|
framework/view/block/parameter/renderer/checkbox/index.phtml
ADDED
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
*
|
4 |
+
*/
|
5 |
+
$definition = $this->getDefinition();
|
6 |
+
$checked = $this->getValue() ? ' checked="checked"' : '';
|
7 |
+
// Element id.
|
8 |
+
$elementId = $this->getElementId();
|
9 |
+
?>
|
10 |
+
<label for="<?php echo $elementId; ?>" title="<?php echo $definition->getDescription() ?>"><?php echo $definition->getName() ?></label>
|
11 |
+
<input type="checkbox" id="<?php echo $elementId; ?>" name="<?php echo $this->getName() ?>" value="1" <?php echo $checked; ?> />
|
12 |
+
<?php echo $this->getTemplate('helpText') ?>
|
framework/view/block/parameter/renderer/dropdown/dropdown.php
ADDED
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
*
|
4 |
+
*/
|
5 |
+
|
6 |
+
/**
|
7 |
+
*
|
8 |
+
*/
|
9 |
+
class CJT_Framework_View_Block_Parameter_Renderer_Dropdown_Dropdown
|
10 |
+
extends CJT_Framework_View_Block_Parameter_Base_List {} // End class.
|
framework/view/block/parameter/renderer/dropdown/index.phtml
ADDED
@@ -0,0 +1,22 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
*
|
4 |
+
*/
|
5 |
+
|
6 |
+
// Get parameter definition.
|
7 |
+
$definition = $this->getDefinition();
|
8 |
+
|
9 |
+
// All values to be displayed in the list.
|
10 |
+
$values = $definition->getValues();
|
11 |
+
$elementId = $this->getElementId();
|
12 |
+
?>
|
13 |
+
<label for="<?php echo $elementId; ?>" title="<?php echo $definition->getDescription() ?>"><?php echo $definition->getName() ?></label>
|
14 |
+
<select id="<?php echo $elementId; ?>" name="<?php echo $this->getName() ?>">
|
15 |
+
<?php
|
16 |
+
foreach ($values as $value) :
|
17 |
+
$selected = ($this->getValue() == $value->getValue()) ? ' selected="selected"' : '';
|
18 |
+
?>
|
19 |
+
<option value="<?php echo $value->getValue() ?>"<?php echo $selected ?>><?php echo $value->getText() ?></option>
|
20 |
+
<?php endforeach; ?>
|
21 |
+
</select>
|
22 |
+
<?php echo $this->getTemplate('helpText') ?>
|
framework/view/block/parameter/renderer/factory.php
ADDED
@@ -0,0 +1,39 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
*
|
4 |
+
*/
|
5 |
+
|
6 |
+
/**
|
7 |
+
*
|
8 |
+
*/
|
9 |
+
class CJT_Framework_View_Block_Parameter_Renderer_Factory {
|
10 |
+
|
11 |
+
/**
|
12 |
+
* put your comment there...
|
13 |
+
*
|
14 |
+
* @param mixed $name
|
15 |
+
* @param mixed $definition
|
16 |
+
* @param mixed $factory
|
17 |
+
* @return CJT_Framework_Developer_Interface_Block_Parameters_Types_Interface_Type
|
18 |
+
*/
|
19 |
+
public function create($name, $definition) {
|
20 |
+
$name = ucfirst($name);
|
21 |
+
// Get type class name.
|
22 |
+
$className = "CJT_Framework_View_Block_Parameter_Renderer_{$name}_{$name}" ;
|
23 |
+
// Instantiate!
|
24 |
+
return new $className($definition, $this);
|
25 |
+
}
|
26 |
+
|
27 |
+
/**
|
28 |
+
* put your comment there...
|
29 |
+
*
|
30 |
+
* @param mixed $class
|
31 |
+
* @param mixed $file
|
32 |
+
*/
|
33 |
+
public function getClassFile($class, $file) {
|
34 |
+
// Get absolute path to the class.
|
35 |
+
$loader = CJT_Framework_Autoload_Loader::autoLoad('CJT');
|
36 |
+
return $loader->getClassFile($class, $file);
|
37 |
+
}
|
38 |
+
|
39 |
+
} // End class
|
framework/view/block/parameter/renderer/imageslist/imageslist.php
ADDED
@@ -0,0 +1,31 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
*
|
4 |
+
*/
|
5 |
+
|
6 |
+
/**
|
7 |
+
*
|
8 |
+
*/
|
9 |
+
class CJT_Framework_View_Block_Parameter_Renderer_Imageslist_Imageslist
|
10 |
+
extends CJT_Framework_View_Block_Parameter_Base_Abstract {
|
11 |
+
|
12 |
+
/**
|
13 |
+
* put your comment there...
|
14 |
+
*
|
15 |
+
*/
|
16 |
+
public function enqueueScripts() {
|
17 |
+
return array(
|
18 |
+
'framework:js:ui:{CJT-}jquery.link-progress',
|
19 |
+
'framework:view:block:parameter:renderer:imageslist:public:js:imageslist'
|
20 |
+
);
|
21 |
+
}
|
22 |
+
|
23 |
+
/**
|
24 |
+
* put your comment there...
|
25 |
+
*
|
26 |
+
*/
|
27 |
+
public function enqueueStyles() {
|
28 |
+
return array('framework:view:block:parameter:renderer:imageslist:public:css:imageslist');
|
29 |
+
}
|
30 |
+
|
31 |
+
} // End class.
|
framework/view/block/parameter/renderer/imageslist/index.phtml
ADDED
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
*
|
4 |
+
*/
|
5 |
+
|
6 |
+
// Parameter definition reference.
|
7 |
+
$definition = $this->getDefinition();
|
8 |
+
// Element id.
|
9 |
+
$elementId = $this->getElementId();
|
10 |
+
?>
|
11 |
+
<div class="images-list">
|
12 |
+
<label title="<?php echo $definition->getDescription() ?>"><?php echo $definition->getName() ?></label>
|
13 |
+
<a id="<?php echo $elementId ?>" href="#" class="cjt-shortcodeparameter-type-field-imageslist"><?php echo cssJSToolbox::getText('Select') ?></a>
|
14 |
+
<input type="hidden" id="<?php echo $elementId ?>input" name="<?php echo $this->getName() ?>" value="" />
|
15 |
+
<ul id="<?php echo $elementId ?>imageslist" class="cjt-shortcodeparameter-type-field-imageslist-list"></ul>
|
16 |
+
<?php echo $this->getTemplate('helpText') ?>
|
17 |
+
</div>
|
framework/view/block/parameter/renderer/imageslist/public/css/imageslist.css
ADDED
@@ -0,0 +1,34 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
a.cjt-shortcodeparameter-type-field-imageslist {
|
2 |
+
font: bold 11px Arial;
|
3 |
+
text-decoration: none;
|
4 |
+
background-color: #EEEEEE;
|
5 |
+
color: #333333;
|
6 |
+
padding: 1px 6px 1px 6px;
|
7 |
+
border-top: 1px solid #CCCCCC;
|
8 |
+
border-right: 1px solid #333333;
|
9 |
+
border-bottom: 1px solid #333333;
|
10 |
+
border-left: 1px solid #CCCCCC;
|
11 |
+
position: relative;
|
12 |
+
top: 1px;
|
13 |
+
}
|
14 |
+
.cjt-shortcode-parameters-form-helpText.renderer-Imageslist .helpText {
|
15 |
+
margin-right: 20px;
|
16 |
+
margin-top: 9px;
|
17 |
+
}
|
18 |
+
ul.cjt-shortcodeparameter-type-field-imageslist-list li {
|
19 |
+
padding: 10px;
|
20 |
+
padding-left: 64px;
|
21 |
+
margin-top: 10px;
|
22 |
+
text-align: center;
|
23 |
+
background-color: #EFEFEF;
|
24 |
+
}
|
25 |
+
.images-list {
|
26 |
+
min-height: 31px;
|
27 |
+
padding: 2px;
|
28 |
+
margin-left: -1px;
|
29 |
+
padding-bottom: 40px;
|
30 |
+
}
|
31 |
+
.imageslist-remove-image-button {
|
32 |
+
margin-left: 20px;
|
33 |
+
vertical-align: text-bottom;
|
34 |
+
}
|
framework/view/block/parameter/renderer/imageslist/public/js/imageslist/imageslist.js
ADDED
@@ -0,0 +1,219 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
*
|
3 |
+
*/
|
4 |
+
|
5 |
+
/**
|
6 |
+
*
|
7 |
+
*/
|
8 |
+
(function($){
|
9 |
+
|
10 |
+
/**
|
11 |
+
* put your comment there...
|
12 |
+
*
|
13 |
+
*/
|
14 |
+
var wp = window.parent.wp;
|
15 |
+
|
16 |
+
/**
|
17 |
+
* put your comment there...
|
18 |
+
*
|
19 |
+
* @type Object
|
20 |
+
*/
|
21 |
+
var wpHacks = {
|
22 |
+
attachmentCallback : null,
|
23 |
+
tbRemove : null,
|
24 |
+
inserting : false
|
25 |
+
};
|
26 |
+
|
27 |
+
/**
|
28 |
+
* Image List button prootype
|
29 |
+
*
|
30 |
+
*/
|
31 |
+
$.fn.CJTImagesListParameterRenderer = function() {
|
32 |
+
|
33 |
+
// Process all buttons.
|
34 |
+
return $.each(this, function() {
|
35 |
+
|
36 |
+
/**
|
37 |
+
* Button Link NODE reference.
|
38 |
+
*
|
39 |
+
*/
|
40 |
+
var link = $(this);
|
41 |
+
|
42 |
+
/**
|
43 |
+
* put your comment there...
|
44 |
+
*
|
45 |
+
*/
|
46 |
+
var imagesList;
|
47 |
+
|
48 |
+
/**
|
49 |
+
* put your comment there...
|
50 |
+
*
|
51 |
+
*/
|
52 |
+
var inputField;
|
53 |
+
|
54 |
+
/**
|
55 |
+
* put your comment there...
|
56 |
+
*
|
57 |
+
*/
|
58 |
+
var _oninsert = function(props, attachment) {
|
59 |
+
// SET INSERTING FLAG ON to tell tb_remove function
|
60 |
+
// to talk no action when insert into post button is clicked.
|
61 |
+
wpHacks.inserting = true;
|
62 |
+
// PROGRESS.
|
63 |
+
link.CJTLoading({loading : true});
|
64 |
+
// Get user-selected attachment HTML.
|
65 |
+
wpHacks.attachmentCallback(props, attachment).done($.proxy(
|
66 |
+
function(userSelectedImageSrc) {
|
67 |
+
// Get THUMBNAIL attachment HTML.
|
68 |
+
props.size = 'thumbnail';
|
69 |
+
wpHacks.attachmentCallback(props, attachment).done($.proxy(
|
70 |
+
function(thumbnailImageSrc) {
|
71 |
+
// Add image to preview-images-list
|
72 |
+
var listItem = $('<li>' + thumbnailImageSrc + '</li>').appendTo(imagesList)
|
73 |
+
// Cahce the original source.
|
74 |
+
.data('userSelectedImageSrc', userSelectedImageSrc);
|
75 |
+
// Add a remove button to the new listItem.
|
76 |
+
$('<input type="button" class="imageslist-remove-image-button" value="' + ImageslistI18N.removeButtonText + '" />').appendTo(listItem)
|
77 |
+
.data('listItem', listItem)
|
78 |
+
.click($.proxy(_onremoveimage, this));
|
79 |
+
// Append the new iumage HTML source to the exists sources
|
80 |
+
// for submission.
|
81 |
+
addImage(userSelectedImageSrc);
|
82 |
+
// Stop PROGRESS
|
83 |
+
link.CJTLoading({loading : false, ceHandler : _onclick});
|
84 |
+
}, this)
|
85 |
+
);
|
86 |
+
}, this)
|
87 |
+
);
|
88 |
+
};
|
89 |
+
|
90 |
+
/**
|
91 |
+
* put your comment there...
|
92 |
+
*
|
93 |
+
* @param event
|
94 |
+
*
|
95 |
+
* @returns {Boolean}
|
96 |
+
*/
|
97 |
+
var _onclick = function(event) {
|
98 |
+
// Close Media Editor Form without closing the thickbox
|
99 |
+
// as it'll remove the Shortcode parameters form as well.
|
100 |
+
// NOTE: Its intensionally hacked later when the button is clicked
|
101 |
+
// for the first time as Wordpress is almost hacked it when the document is just loaded!!!
|
102 |
+
if (!wpHacks.tbRemove) {
|
103 |
+
wpHacks.tbRemove = parent.tb_remove;
|
104 |
+
// Define new tbRemove.
|
105 |
+
parent.tb_remove = _ontbremove;
|
106 |
+
// Bind to close button click as it doesn't call the tb_remove
|
107 |
+
// function after hacking the thickbox tb_remove function.
|
108 |
+
parent.jQuery('#TB_closeWindowButton, #TB_overlay').bind('click.cjtimageslistthickboxform', _onclose);
|
109 |
+
}
|
110 |
+
// Get called when the images is inserted!
|
111 |
+
wp.media.editor.send.attachment = _oninsert;
|
112 |
+
// Open media form.
|
113 |
+
wp.media.editor.open(link);
|
114 |
+
return false;
|
115 |
+
};
|
116 |
+
|
117 |
+
/**
|
118 |
+
* Called when:
|
119 |
+
* - Click he close button.
|
120 |
+
* - Click the overlay.
|
121 |
+
*
|
122 |
+
*/
|
123 |
+
var _onclose = function() {
|
124 |
+
hackFree();
|
125 |
+
};
|
126 |
+
|
127 |
+
/**
|
128 |
+
* Called when:
|
129 |
+
* - Press Shortcode parameters form close button
|
130 |
+
* - Press Shortcode parameters form done button.
|
131 |
+
* - Press Media Form 'Insert Into Post' button. (This is why we created this function
|
132 |
+
* We simply avoid calling tb_remove when insert into post button clicked!).
|
133 |
+
*
|
134 |
+
*/
|
135 |
+
var _ontbremove = function() {
|
136 |
+
// Reset if the form is currently closed is the Shortcode parameters form.
|
137 |
+
// When the media insert button is clicked this function is get called as well.
|
138 |
+
if (!wpHacks.inserting) {
|
139 |
+
// Hack FREE thickbox.
|
140 |
+
hackFree();
|
141 |
+
// Close the form.
|
142 |
+
parent.tb_remove();
|
143 |
+
}
|
144 |
+
// RESET INSERTING FLAG OFF.
|
145 |
+
wpHacks.inserting = false;
|
146 |
+
};
|
147 |
+
|
148 |
+
/**
|
149 |
+
* put your comment there...
|
150 |
+
*
|
151 |
+
* @param event
|
152 |
+
*/
|
153 |
+
var _onremoveimage = function(event) {
|
154 |
+
// Initialize.
|
155 |
+
var jButton = $(event.target);
|
156 |
+
// Confirm
|
157 |
+
if (confirm(ImageslistI18N.confirmRemove)) {
|
158 |
+
// Remove list item that holds the image.
|
159 |
+
jButton.data('listItem').remove();
|
160 |
+
// Re-generate the input-field HTML.
|
161 |
+
inputField.val('');
|
162 |
+
imagesList.children('li').each($.proxy(
|
163 |
+
function(index, listItem) {
|
164 |
+
// Get original source.
|
165 |
+
addImage($(listItem).data('userSelectedImageSrc'));
|
166 |
+
}, this)
|
167 |
+
)
|
168 |
+
}
|
169 |
+
};
|
170 |
+
|
171 |
+
/**
|
172 |
+
* Add image to the input field as string
|
173 |
+
*
|
174 |
+
* @param src
|
175 |
+
*/
|
176 |
+
var addImage = function(src) {
|
177 |
+
inputField.val(inputField.val() + src);
|
178 |
+
};
|
179 |
+
|
180 |
+
/**
|
181 |
+
* put your comment there...
|
182 |
+
*
|
183 |
+
*/
|
184 |
+
var hackFree = function() {
|
185 |
+
// RESET THE HACKS WHEN THE PARAMETERS FORM IS CLOSED.
|
186 |
+
parent.tb_remove = wpHacks.tbRemove;
|
187 |
+
// The Shortcode parameters form is currently closed!
|
188 |
+
wp.media.editor.send.attachment = wpHacks.attachmentCallback;
|
189 |
+
// Unbind close button event.
|
190 |
+
parent.jQuery('#TB_closeWindowButton, #TB_overlay').unbind('click.cjtimageslistthickboxform');
|
191 |
+
};
|
192 |
+
|
193 |
+
// Initialize.
|
194 |
+
imagesList = $('#' + link.prop('id') + 'imageslist');
|
195 |
+
inputField = $('#' + link.prop('id') + 'input');
|
196 |
+
|
197 |
+
// Bind events.
|
198 |
+
link.click($.proxy(_onclick, this));
|
199 |
+
});
|
200 |
+
|
201 |
+
}; // End ImagesListButton.
|
202 |
+
|
203 |
+
/**
|
204 |
+
* Find all ImagesList link buttons
|
205 |
+
* in the document. Create ImagesListButton
|
206 |
+
* for every link.
|
207 |
+
*
|
208 |
+
*/
|
209 |
+
var initialize = function() {
|
210 |
+
// Original attachment callback.
|
211 |
+
wpHacks.attachmentCallback = wp.media.editor.send.attachment;
|
212 |
+
// Initialize buttons.
|
213 |
+
$('.cjt-shortcodeparameter-type-field-imageslist').CJTImagesListParameterRenderer();
|
214 |
+
};
|
215 |
+
|
216 |
+
// RUN.
|
217 |
+
$(document).ready(initialize);
|
218 |
+
|
219 |
+
})(jQuery);
|
framework/view/block/parameter/renderer/imageslist/public/js/imageslist/imageslist.localization.php
ADDED
@@ -0,0 +1,15 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @version FILE_VERSION
|
4 |
+
* Localization file for jquery.block.js script.
|
5 |
+
*/
|
6 |
+
|
7 |
+
/**
|
8 |
+
* Localization for Javascript ??? variable.
|
9 |
+
*
|
10 |
+
* Localization text for backups script.
|
11 |
+
*/
|
12 |
+
return array(
|
13 |
+
'removeButtonText' => cssJSToolbox::getText('Remove'),
|
14 |
+
'confirmRemove' => cssJSToolbox::getText('Remove image?'),
|
15 |
+
);
|
framework/view/block/parameter/renderer/input/index.phtml
ADDED
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
*
|
4 |
+
*/
|
5 |
+
$definition = $this->getDefinition();
|
6 |
+
$elementId = $this->getElementId();
|
7 |
+
?>
|
8 |
+
<label for="<?php echo $elementId ?>" title="<?php echo $definition->getDescription() ?>"><?php echo $definition->getName() ?></label>
|
9 |
+
<input type="text" id="<?php echo $elementId ?>" name="<?php echo $this->getName() ?>" value="<?php echo $this->getValue() ?>" class="cjt-shortcode-parameters-form-type-<?php echo $definition->getOriginalType() ?>-parameter">
|
10 |
+
<?php echo $this->getTemplate('helpText') ?>
|
framework/view/block/parameter/renderer/input/input.php
ADDED
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
*
|
4 |
+
*/
|
5 |
+
|
6 |
+
/**
|
7 |
+
*
|
8 |
+
*/
|
9 |
+
class CJT_Framework_View_Block_Parameter_Renderer_Input_Input
|
10 |
+
extends CJT_Framework_View_Block_Parameter_Base_Scalar {
|
11 |
+
|
12 |
+
/**
|
13 |
+
* put your comment there...
|
14 |
+
*
|
15 |
+
*/
|
16 |
+
public function enqueueStyles() {
|
17 |
+
return array('framework:view:block:parameter:renderer:input:public:css:input');
|
18 |
+
}
|
19 |
+
|
20 |
+
} // End class.
|
framework/view/block/parameter/renderer/input/public/css/input.css
ADDED
@@ -0,0 +1,2 @@
|
|
|
|
|
1 |
+
.cjt-shortcode-parameters-form-type-text-parameter {}
|
2 |
+
.cjt-shortcode-parameters-form-type-number-parameter {width: 60px; min-width: 60px !important;}
|
framework/view/block/parameter/renderer/list/index.phtml
ADDED
@@ -0,0 +1,22 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
*
|
4 |
+
*/
|
5 |
+
|
6 |
+
// Get parameter definition.
|
7 |
+
$definition = $this->getDefinition();
|
8 |
+
|
9 |
+
// All values to be displayed in the list.
|
10 |
+
$values = $definition->getValues();
|
11 |
+
$elementId = $this->getElementId();
|
12 |
+
?>
|
13 |
+
<label for="<?php echo $elementId ?>" title="<?php echo $definition->getDescription() ?>"><?php echo $definition->getName() ?></label>
|
14 |
+
<select id="<?php echo $elementId ?>" name="<?php echo $this->getName() ?>" size="2">
|
15 |
+
<?php
|
16 |
+
foreach ($values as $value) :
|
17 |
+
$selected = ($this->getValue() == $value->getValue()) ? ' selected="selected"' : '';
|
18 |
+
?>
|
19 |
+
<option value="<?php echo $value->getValue() ?>"<?php echo $selected ?>><?php echo $value->getText() ?></option>
|
20 |
+
<?php endforeach; ?>
|
21 |
+
</select>
|
22 |
+
<?php echo $this->getTemplate('helpText') ?>
|
framework/view/block/parameter/renderer/list/list.php
ADDED
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
*
|
4 |
+
*/
|
5 |
+
|
6 |
+
/**
|
7 |
+
*
|
8 |
+
*/
|
9 |
+
class CJT_Framework_View_Block_Parameter_Renderer_List_List
|
10 |
+
extends CJT_Framework_View_Block_Parameter_Base_List {} // End class.
|
framework/view/block/parameter/renderer/structure/index.phtml
ADDED
@@ -0,0 +1,15 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
*
|
4 |
+
*/
|
5 |
+
$definition = $this->getDefinition();
|
6 |
+
?>
|
7 |
+
<fieldset class="cjt-param-structure">
|
8 |
+
<strong><?php echo $definition->getName() ?></strong>
|
9 |
+
<ul>
|
10 |
+
<?php foreach ($this->getParams() as $param) : ?>
|
11 |
+
<li><?php echo $param ?></li>
|
12 |
+
<?php endforeach; ?>
|
13 |
+
</ul>
|
14 |
+
<?php echo $this->getTemplate('helpText') ?>
|
15 |
+
</fieldset>
|
framework/view/block/parameter/renderer/structure/public/css/structure.css
ADDED
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
.cjt-param-structure {padding-bottom: 0px;}
|
2 |
+
.renderer-structure {
|
3 |
+
margin-top: -6px;
|
4 |
+
margin-left: 32px;
|
5 |
+
position: relative;
|
6 |
+
height: auto !important;
|
7 |
+
}
|
framework/view/block/parameter/renderer/structure/structure.php
ADDED
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
*
|
4 |
+
*/
|
5 |
+
|
6 |
+
/**
|
7 |
+
*
|
8 |
+
*/
|
9 |
+
class CJT_Framework_View_Block_Parameter_Renderer_Structure_Structure
|
10 |
+
extends CJT_Framework_View_Block_Parameter_Base_List {
|
11 |
+
|
12 |
+
/**
|
13 |
+
* put your comment there...
|
14 |
+
*
|
15 |
+
*/
|
16 |
+
public function enqueueStyles() {
|
17 |
+
return array('framework:view:block:parameter:renderer:structure:public:css:structure');
|
18 |
+
}
|
19 |
+
|
20 |
+
} // End class.
|
framework/view/block/parameter/renderer/textarea/index.phtml
ADDED
@@ -0,0 +1,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
*
|
4 |
+
*/
|
5 |
+
$definition = $this->getDefinition();
|
6 |
+
// Element id.
|
7 |
+
$elementId = $this->getElementId();
|
8 |
+
?>
|
9 |
+
<label for="<?php echo $elementId ?>" title="<?php echo $definition->getDescription() ?>"><?php echo $definition->getName() ?></label>
|
10 |
+
<?php echo $this->getTemplate('helpText') ?>
|
11 |
+
<textarea style="width: 610px;height: 55px; margin-top: 16px;" id="<?php echo $elementId ?>" name="<?php echo $this->getName() ?>"><?php echo htmlentities($this->getValue(), null, 'UTF-8') ?></textarea>
|
framework/view/block/parameter/renderer/textarea/textarea.php
ADDED
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
*
|
4 |
+
*/
|
5 |
+
|
6 |
+
/**
|
7 |
+
*
|
8 |
+
*/
|
9 |
+
class CJT_Framework_View_Block_Parameter_Renderer_Textarea_Textarea
|
10 |
+
extends CJT_Framework_View_Block_Parameter_Base_Scalar {} // End class.
|
framework/xml/fetchscalars.php
ADDED
@@ -0,0 +1,32 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
*
|
4 |
+
*/
|
5 |
+
|
6 |
+
/**
|
7 |
+
*
|
8 |
+
*/
|
9 |
+
class CJT_Framework_Xml_Fetchscalars extends ArrayIterator {
|
10 |
+
|
11 |
+
/**
|
12 |
+
* put your comment there...
|
13 |
+
*
|
14 |
+
* @param SimpleXMLElement $element
|
15 |
+
* @return CJT_Framework_Xml_Fetchscalars
|
16 |
+
*/
|
17 |
+
public function __construct(SimpleXMLElement $element) {
|
18 |
+
$data = array();
|
19 |
+
// Read all Child elements with no childs inside.
|
20 |
+
foreach ($element->children() as $field => $child) {
|
21 |
+
// Read all elements with no childs inside!
|
22 |
+
// Only with text data!
|
23 |
+
if (!count($child->children())) {
|
24 |
+
$data[$field] = (string) $child;
|
25 |
+
}
|
26 |
+
}
|
27 |
+
// Load array iterator with fetched data.
|
28 |
+
parent::__construct($data);
|
29 |
+
}
|
30 |
+
|
31 |
+
|
32 |
+
} // End class.
|
includes/installer/installer/db/mysql/structure.sql
CHANGED
@@ -1,5 +1,5 @@
|
|
1 |
/*
|
2 |
-
* CJT Database Version 2
|
3 |
*
|
4 |
* Owner: css-javascript-toolbox.com
|
5 |
* Author: Ahmed Said
|
@@ -7,6 +7,22 @@
|
|
7 |
* Description:
|
8 |
*/
|
9 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
10 |
/*
|
11 |
* CJT Backups Header Table Structure.
|
12 |
* Since: 2.0
|
@@ -34,19 +50,36 @@ CREATE TABLE IF NOT EXISTS `#__cjtoolbox_blocks` (
|
|
34 |
`pinPoint` int(4) NOT NULL DEFAULT '0',
|
35 |
`state` enum('active','inactive') DEFAULT 'inactive',
|
36 |
`location` enum('header','footer') DEFAULT 'header',
|
37 |
-
`code` text,
|
38 |
`links` text,
|
39 |
`expressions` text,
|
40 |
`type` enum('block','revision','metabox') DEFAULT 'block',
|
41 |
`backupId` int(11) DEFAULT NULL,
|
42 |
`parent` int(11) DEFAULT NULL,
|
43 |
`flag` int(4) NOT NULL DEFAULT '0',
|
|
|
44 |
`id` int(11) NOT NULL AUTO_INCREMENT,
|
45 |
PRIMARY KEY (`id`),
|
46 |
UNIQUE KEY `name` (`name`,`backupId`),
|
47 |
KEY `pinPoint` (`pinPoint`,`state`,`location`,`type`,`parent`)
|
48 |
) CHARACTER SET = utf8, COLLATE=utf8_general_ci;
|
49 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
50 |
/*
|
51 |
* Blocks Pins table Structure!
|
52 |
* Since: 2.0
|
@@ -57,4 +90,153 @@ CREATE TABLE IF NOT EXISTS `#__cjtoolbox_block_pins` (
|
|
57 |
`value` int(11) NOT NULL,
|
58 |
`attributes` int(4) NOT NULL DEFAULT '0',
|
59 |
PRIMARY KEY (`blockId`,`pin`,`value`)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
60 |
) CHARACTER SET = utf8, COLLATE=utf8_general_ci
|
|
1 |
/*
|
2 |
+
* CJT Database Version 1.2 structure.
|
3 |
*
|
4 |
* Owner: css-javascript-toolbox.com
|
5 |
* Author: Ahmed Said
|
7 |
* Description:
|
8 |
*/
|
9 |
|
10 |
+
/*
|
11 |
+
* Template Authors Table Structure
|
12 |
+
* Since: 2.0
|
13 |
+
*/
|
14 |
+
CREATE TABLE IF NOT EXISTS `#__cjtoolbox_authors` (
|
15 |
+
`name` varchar(80) NOT NULL,
|
16 |
+
`email` varchar(100) DEFAULT NULL,
|
17 |
+
`url` varchar(200) DEFAULT NULL,
|
18 |
+
`attributes` int(4) NOT NULL DEFAULT '0',
|
19 |
+
`guid` varchar(16) DEFAULT NULL,
|
20 |
+
`id` int(10) NOT NULL AUTO_INCREMENT,
|
21 |
+
PRIMARY KEY (`id`),
|
22 |
+
UNIQUE KEY `guid` (`guid`),
|
23 |
+
KEY `name` (`name`)
|
24 |
+
) CHARACTER SET = utf8, COLLATE=utf8_general_ci;
|
25 |
+
|
26 |
/*
|
27 |
* CJT Backups Header Table Structure.
|
28 |
* Since: 2.0
|
50 |
`pinPoint` int(4) NOT NULL DEFAULT '0',
|
51 |
`state` enum('active','inactive') DEFAULT 'inactive',
|
52 |
`location` enum('header','footer') DEFAULT 'header',
|
|
|
53 |
`links` text,
|
54 |
`expressions` text,
|
55 |
`type` enum('block','revision','metabox') DEFAULT 'block',
|
56 |
`backupId` int(11) DEFAULT NULL,
|
57 |
`parent` int(11) DEFAULT NULL,
|
58 |
`flag` int(4) NOT NULL DEFAULT '0',
|
59 |
+
`masterFile` INT(4) NOT NULL DEFAULT '1',
|
60 |
`id` int(11) NOT NULL AUTO_INCREMENT,
|
61 |
PRIMARY KEY (`id`),
|
62 |
UNIQUE KEY `name` (`name`,`backupId`),
|
63 |
KEY `pinPoint` (`pinPoint`,`state`,`location`,`type`,`parent`)
|
64 |
) CHARACTER SET = utf8, COLLATE=utf8_general_ci;
|
65 |
|
66 |
+
/*
|
67 |
+
* Blocks Table Structure!
|
68 |
+
* Since: 1.5
|
69 |
+
*/
|
70 |
+
CREATE TABLE IF NOT EXISTS `#__cjtoolbox_block_files` (
|
71 |
+
`id` INT(11) NOT NULL AUTO_INCREMENT,
|
72 |
+
`blockId` INT(11) NOT NULL,
|
73 |
+
`name` VARCHAR(100) NOT NULL,
|
74 |
+
`type` ENUM('css','javascript','php','html') NULL DEFAULT NULL,
|
75 |
+
`description` VARCHAR(400) NULL DEFAULT NULL,
|
76 |
+
`code` TEXT NULL,
|
77 |
+
`order` SMALLINT(6) NULL DEFAULT '0',
|
78 |
+
`tag` TEXT NULL,
|
79 |
+
PRIMARY KEY (`id`, `blockId`)
|
80 |
+
) CHARACTER SET = utf8, COLLATE=utf8_general_ci;
|
81 |
+
|
82 |
+
|
83 |
/*
|
84 |
* Blocks Pins table Structure!
|
85 |
* Since: 2.0
|
90 |
`value` int(11) NOT NULL,
|
91 |
`attributes` int(4) NOT NULL DEFAULT '0',
|
92 |
PRIMARY KEY (`blockId`,`pin`,`value`)
|
93 |
+
) CHARACTER SET = utf8, COLLATE=utf8_general_ci;
|
94 |
+
|
95 |
+
/*
|
96 |
+
* Block Associated/Linked templates table structure!
|
97 |
+
* Since: 2.0
|
98 |
+
*/
|
99 |
+
CREATE TABLE IF NOT EXISTS `#__cjtoolbox_block_templates` (
|
100 |
+
`blockId` int(11) NOT NULL,
|
101 |
+
`templateId` int(11) NOT NULL,
|
102 |
+
PRIMARY KEY (`blockId`,`templateId`)
|
103 |
+
) CHARACTER SET = utf8, COLLATE=utf8_general_ci;
|
104 |
+
|
105 |
+
/*
|
106 |
+
* Templates Table structure!
|
107 |
+
* Since: 2.0
|
108 |
+
*/
|
109 |
+
CREATE TABLE IF NOT EXISTS `#__cjtoolbox_templates` (
|
110 |
+
`name` varchar(80) NOT NULL,
|
111 |
+
`queueName` varchar(80) NOT NULL,
|
112 |
+
`description` text,
|
113 |
+
`keywords` varchar(300) DEFAULT NULL,
|
114 |
+
`license` text,
|
115 |
+
`type` enum('css','javascript','php','html') NOT NULL,
|
116 |
+
`email` varchar(90) DEFAULT NULL,
|
117 |
+
`url` varchar(200) DEFAULT NULL,
|
118 |
+
`creationDate` datetime NOT NULL,
|
119 |
+
`ownerId` int(11) NOT NULL,
|
120 |
+
`authorId` int(11) NOT NULL,
|
121 |
+
`state` enum('published','draft','trash') NOT NULL DEFAULT 'published',
|
122 |
+
`attributes` int(4) NOT NULL DEFAULT '0',
|
123 |
+
`guid` varchar(16) DEFAULT NULL,
|
124 |
+
`id` int(11) NOT NULL AUTO_INCREMENT,
|
125 |
+
PRIMARY KEY (`id`),
|
126 |
+
UNIQUE KEY `name` (`name`, `type`),
|
127 |
+
UNIQUE KEY `guid` (`guid`),
|
128 |
+
KEY `keywords` (`keywords`),
|
129 |
+
KEY `owner` (`ownerId`),
|
130 |
+
KEY `author` (`authorId`),
|
131 |
+
KEY `type` (`type`),
|
132 |
+
KEY `attributes` (`attributes`)
|
133 |
+
) CHARACTER SET = utf8, COLLATE=utf8_general_ci;
|
134 |
+
|
135 |
+
/*
|
136 |
+
* Template revisions table!
|
137 |
+
* Since: 2.0
|
138 |
+
*/
|
139 |
+
CREATE TABLE IF NOT EXISTS `#__cjtoolbox_template_revisions` (
|
140 |
+
`templateId` int(11) NOT NULL,
|
141 |
+
`revisionNo` int(11) NOT NULL DEFAULT '0',
|
142 |
+
`version` varchar(15) DEFAULT NULL,
|
143 |
+
`changeLog` varchar(600) DEFAULT NULL,
|
144 |
+
`state` enum('release','beta','release-candidate','alpha','revision') NOT NULL,
|
145 |
+
`attributes` int(4) unsigned NOT NULL DEFAULT '1',
|
146 |
+
`dateCreated` datetime NOT NULL,
|
147 |
+
`file` varchar(400) DEFAULT NULL,
|
148 |
+
`id` int(11) NOT NULL AUTO_INCREMENT,
|
149 |
+
PRIMARY KEY (`id`),
|
150 |
+
UNIQUE KEY `templateid-revisionNo` (`revisionNo`,`templateId`)
|
151 |
+
) CHARACTER SET = utf8, COLLATE=utf8_general_ci;
|
152 |
+
|
153 |
+
/* Packages holder table */
|
154 |
+
CREATE TABLE IF NOT EXISTS`#__cjtoolbox_packages` (
|
155 |
+
`name` VARCHAR(100) NOT NULL,
|
156 |
+
`author` VARCHAR(150) NOT NULL,
|
157 |
+
`webSite` VARCHAR(300) NOT NULL,
|
158 |
+
`description` TEXT NOT NULL,
|
159 |
+
`license` TEXT NOT NULL,
|
160 |
+
`readme` TEXT NOT NULL,
|
161 |
+
`id` INT(11) NOT NULL AUTO_INCREMENT,
|
162 |
+
PRIMARY KEY (`id`)
|
163 |
+
) CHARACTER SET = utf8, COLLATE=utf8_general_ci;
|
164 |
+
|
165 |
+
/* Package objects map */
|
166 |
+
CREATE TABLE IF NOT EXISTS `#__cjtoolbox_package_objects` (
|
167 |
+
`packageId` INT UNSIGNED NOT NULL,
|
168 |
+
`objectId` INT UNSIGNED NOT NULL,
|
169 |
+
`objectType` ENUM('block','template') NOT NULL,
|
170 |
+
`relType` ENUM('add','link') NOT NULL DEFAULT 'add',
|
171 |
+
PRIMARY KEY (`packageId`, `objectId`, `objectType`)
|
172 |
+
) CHARACTER SET = utf8, COLLATE=utf8_general_ci;
|
173 |
+
|
174 |
+
/* DB Version 1.3 */
|
175 |
+
/* <Shortcode Parameters Tables> */
|
176 |
+
CREATE TABLE IF NOT EXISTS `#__cjtoolbox_forms` (
|
177 |
+
`blockId` int(11) NOT NULL COMMENT 'block to be associated with the form',
|
178 |
+
`name` varchar(100) NOT NULL COMMENT 'Form name/title',
|
179 |
+
`groupType` varchar(20) NOT NULL COMMENT 'parameters gooup type (tab, accordion, etc...)',
|
180 |
+
PRIMARY KEY (`blockId`)
|
181 |
+
) CHARACTER SET = utf8, COLLATE=utf8_general_ci;
|
182 |
+
|
183 |
+
CREATE TABLE IF NOT EXISTS `#__cjtoolbox_form_groups` (
|
184 |
+
`id` int(11) NOT NULL AUTO_INCREMENT,
|
185 |
+
`formId` int(11) NOT NULL COMMENT 'block to be associated with the form',
|
186 |
+
`name` varchar(100) NOT NULL COMMENT 'group name/title',
|
187 |
+
`description` text NULL COMMENT 'Parameters group description',
|
188 |
+
PRIMARY KEY (`id`),
|
189 |
+
UNIQUE KEY `Index 3` (`formId`,`name`),
|
190 |
+
KEY `formId` (`formId`)
|
191 |
+
) CHARACTER SET = utf8, COLLATE=utf8_general_ci;
|
192 |
+
|
193 |
+
CREATE TABLE IF NOT EXISTS `#__cjtoolbox_form_group_parameters` (
|
194 |
+
`groupId` int(11) NOT NULL AUTO_INCREMENT,
|
195 |
+
`parameterId` int(11) NOT NULL COMMENT 'block to be associated with the form',
|
196 |
+
`renderer` varchar(30) DEFAULT NULL,
|
197 |
+
`description` text NULL,
|
198 |
+
`helpText` VARCHAR(200) NULL DEFAULT NULL,
|
199 |
+
PRIMARY KEY (`parameterId`),
|
200 |
+
KEY `Index 2` (`groupId`)
|
201 |
+
) CHARACTER SET = utf8, COLLATE=utf8_general_ci;
|
202 |
+
|
203 |
+
CREATE TABLE IF NOT EXISTS `#__cjtoolbox_parameters` (
|
204 |
+
`id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT 'paramter unique identifier',
|
205 |
+
`blockId` int(11) unsigned NOT NULL,
|
206 |
+
`parent` int(11) unsigned DEFAULT NULL,
|
207 |
+
`name` varchar(60) NOT NULL,
|
208 |
+
`type` varchar(20) NOT NULL,
|
209 |
+
`defaultValue` text,
|
210 |
+
`required` tinyint(1) unsigned NOT NULL DEFAULT '0',
|
211 |
+
`contentParam` TINYINT(1) UNSIGNED NOT NULL DEFAULT '0',
|
212 |
+
PRIMARY KEY (`id`),
|
213 |
+
UNIQUE INDEX `name` (`name`, `parent`, `blockId`),
|
214 |
+
KEY `parent` (`parent`),
|
215 |
+
KEY `blockId` (`blockId`)
|
216 |
+
) CHARACTER SET = utf8, COLLATE=utf8_general_ci;
|
217 |
+
|
218 |
+
CREATE TABLE IF NOT EXISTS `#__cjtoolbox_parameter_typedef` (
|
219 |
+
`id` int(11) NOT NULL AUTO_INCREMENT,
|
220 |
+
`parameterId` int(11) NOT NULL,
|
221 |
+
`text` text NOT NULL,
|
222 |
+
`value` text NOT NULL,
|
223 |
+
PRIMARY KEY (`id`),
|
224 |
+
KEY `parameterId` (`parameterId`)
|
225 |
+
) CHARACTER SET = utf8, COLLATE=utf8_general_ci;
|
226 |
+
|
227 |
+
CREATE TABLE `#__cjtoolbox_parameter_typeparams` (
|
228 |
+
`id` INT(11) NOT NULL AUTO_INCREMENT,
|
229 |
+
`parameterId` INT(11) NOT NULL,
|
230 |
+
`name` TEXT NOT NULL,
|
231 |
+
`value` TEXT NOT NULL,
|
232 |
+
PRIMARY KEY (`id`),
|
233 |
+
INDEX `parameterId` (`parameterId`)
|
234 |
+
) CHARACTER SET = utf8, COLLATE=utf8_general_ci;
|
235 |
+
|
236 |
+
/* 1.4 */
|
237 |
+
CREATE TABLE `#__cjtoolbox_form_group_xfields` (
|
238 |
+
`groupId` INT(11) NOT NULL,
|
239 |
+
`text` TEXT NULL,
|
240 |
+
UNIQUE INDEX `groupId` (`groupId`)
|
241 |
) CHARACTER SET = utf8, COLLATE=utf8_general_ci
|
242 |
+
/* </Shortcode Parameters Tables> */
|
includes/installer/installer/includes/templates/wordpress-queue.inc.php
ADDED
@@ -0,0 +1,100 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
*
|
4 |
+
*/
|
5 |
+
|
6 |
+
// Disallow direct access.
|
7 |
+
defined('ABSPATH') or die("Access denied");
|
8 |
+
|
9 |
+
/**
|
10 |
+
*
|
11 |
+
*/
|
12 |
+
class CJTInstallerWordpressQueueTemplates extends ArrayIterator {
|
13 |
+
|
14 |
+
/**
|
15 |
+
*
|
16 |
+
*/
|
17 |
+
const TYPE_SCRIPTS = 'javascript';
|
18 |
+
|
19 |
+
/**
|
20 |
+
*
|
21 |
+
*/
|
22 |
+
const TYPE_STYLE_SHEETS = 'css';
|
23 |
+
|
24 |
+
/**
|
25 |
+
* put your comment there...
|
26 |
+
*
|
27 |
+
* @var mixed
|
28 |
+
*/
|
29 |
+
protected $type;
|
30 |
+
|
31 |
+
/**
|
32 |
+
* put your comment there...
|
33 |
+
*
|
34 |
+
* @var mixed
|
35 |
+
*/
|
36 |
+
protected static $typesMap = array(self::TYPE_SCRIPTS => 'scripts', self::TYPE_STYLE_SHEETS => 'styles');
|
37 |
+
|
38 |
+
/**
|
39 |
+
* put your comment there...
|
40 |
+
*
|
41 |
+
*/
|
42 |
+
public function __construct($type) {
|
43 |
+
// Save type data for later use!
|
44 |
+
$this->type = cssJSToolbox::$config->templates->types[$type];
|
45 |
+
$this->type->name = $type;
|
46 |
+
// Get which Wordpress queue (wp_script, wp_styles) object to fetch data from.
|
47 |
+
$wpQueueName = self::$typesMap[$type];
|
48 |
+
/**
|
49 |
+
* @var CJTCouplingModel
|
50 |
+
*/
|
51 |
+
$coupling = CJTModel::getInstance('coupling');
|
52 |
+
// Initialize ArrayIterator with templates list!
|
53 |
+
parent::__construct($coupling->getQueueObject($wpQueueName)->registered);
|
54 |
+
// Import dependencies!
|
55 |
+
cssJSToolbox::import('framework:db:mysql:xtable.inc.php');
|
56 |
+
CJTxTable::import('template');
|
57 |
+
CJTxTable::import('author');
|
58 |
+
}
|
59 |
+
|
60 |
+
/**
|
61 |
+
* put your comment there...
|
62 |
+
*
|
63 |
+
*/
|
64 |
+
public function install() {
|
65 |
+
// Get template and key refernces!
|
66 |
+
$wpTemplate = $this->current();
|
67 |
+
$handle = $this->key();
|
68 |
+
// Use only templates defined with the internal file systems!!
|
69 |
+
$devFile = str_replace(".{$this->type->extension}", ".dev.{$this->type->extension}", $wpTemplate->src);
|
70 |
+
// Get display name from Queue name!
|
71 |
+
$displayName = ucfirst(str_replace(array('-', '_'), ' ', $handle));
|
72 |
+
// Prepare periodically used vars!
|
73 |
+
$time = current_time('mysql');
|
74 |
+
// Add queue object as CJT template!
|
75 |
+
$template = CJTxTable::getInstance('template')
|
76 |
+
->set('name', $displayName)
|
77 |
+
->set('queueName', $handle)
|
78 |
+
->set('type', $this->type->name)
|
79 |
+
->set('creationDate', $time)
|
80 |
+
->set('ownerId', get_current_user_id())
|
81 |
+
->set('authorId', CJTAuthorTable::WORDPRESS_AUTHOR_ID)
|
82 |
+
->set('state', 'published')
|
83 |
+
->set('attributes', CJTTemplateTable::ATTRIBUTES_SYSTEM_FLAG)
|
84 |
+
->save();
|
85 |
+
// Add revision for that template.
|
86 |
+
$revision = CJTxTable::getInstance('template-revision')
|
87 |
+
->set('templateId', $template->get('id'))
|
88 |
+
->set('revisionNo', 1)
|
89 |
+
->set('version', $wpTemplate->ver)
|
90 |
+
->set('changeLog', 'Cached by CJT installer!')
|
91 |
+
->set('state', 'release')
|
92 |
+
->set('dateCreated', $time)
|
93 |
+
// Use .dev file once its exists, otherwise use the original file
|
94 |
+
// even if its empty! Its the Wordpress repositibility to load the built-in
|
95 |
+
// scripts not our. @See controllers/blocks-coupling.php where the templates/scripts is linked.
|
96 |
+
->set('file', ((is_file(ABSPATH . "/{$devFile}" ) ? $devFile : $wpTemplate->src)))
|
97 |
+
->save();
|
98 |
+
}
|
99 |
+
|
100 |
+
} // End class.
|
includes/installer/installer/installer.class.php
CHANGED
@@ -11,6 +11,28 @@ defined('ABSPATH') or die("Access denied");
|
|
11 |
*/
|
12 |
class CJTInstaller extends CJTHookableClass {
|
13 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
14 |
/**
|
15 |
* put your comment there...
|
16 |
*
|
@@ -22,6 +44,34 @@ class CJTInstaller extends CJTHookableClass {
|
|
22 |
return $this;
|
23 |
}
|
24 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
25 |
/**
|
26 |
* put your comment there...
|
27 |
*
|
@@ -39,5 +89,26 @@ class CJTInstaller extends CJTHookableClass {
|
|
39 |
public static function getInstance() {
|
40 |
return new CJTInstaller();
|
41 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
42 |
|
43 |
} // End class.
|
11 |
*/
|
12 |
class CJTInstaller extends CJTHookableClass {
|
13 |
|
14 |
+
/**
|
15 |
+
* put your comment there...
|
16 |
+
*
|
17 |
+
*/
|
18 |
+
public function builtinAuthors() {
|
19 |
+
// Dependencies!
|
20 |
+
cssJSToolbox::import('framework:db:mysql:xtable.inc.php');
|
21 |
+
// Add Wordpress author if its not already added!
|
22 |
+
$wpAuthor = CJTxTable::getInstance('author')
|
23 |
+
->set('id', CJTAuthorTable::WORDPRESS_AUTHOR_ID)
|
24 |
+
->load();
|
25 |
+
// Make sure built-in (attributes = 1) Wordpress author (id = 1) is there!
|
26 |
+
if (!$wpAuthor->get('id') || ($wpAuthor->get('attributes') != 1)) {
|
27 |
+
$wpAuthor->setData(array(
|
28 |
+
'id' => CJTAuthorTable::WORDPRESS_AUTHOR_ID,
|
29 |
+
'name' => 'Wordpress',
|
30 |
+
'attributes' => CJTAuthorTable::FLAG_SYS_AUTHOR)
|
31 |
+
)->save(true);
|
32 |
+
}
|
33 |
+
return $this;
|
34 |
+
}
|
35 |
+
|
36 |
/**
|
37 |
* put your comment there...
|
38 |
*
|
44 |
return $this;
|
45 |
}
|
46 |
|
47 |
+
/**
|
48 |
+
* put your comment there...
|
49 |
+
*
|
50 |
+
*/
|
51 |
+
public function fileSystem() {
|
52 |
+
// Initializing!
|
53 |
+
$wpContentDir = 'wp-content';
|
54 |
+
$fSConfig = cssJSToolbox::$config->fileSystem;
|
55 |
+
// Directories to create!
|
56 |
+
$directories = array(
|
57 |
+
"{$wpContentDir}/{$fSConfig->contentDir}",
|
58 |
+
"{$wpContentDir}/{$fSConfig->contentDir}/{$fSConfig->templatesDir}",
|
59 |
+
);
|
60 |
+
foreach ($directories as $dir) {
|
61 |
+
// Create directory only if not exists!
|
62 |
+
$dirPath = ABSPATH . "/{$dir}";
|
63 |
+
if (!file_exists($dirPath)) {
|
64 |
+
// Make sure we've permission to do!
|
65 |
+
if (is_writeable(dirname($dirPath))) {
|
66 |
+
if (!mkdir($dirPath, 0775, true)) {
|
67 |
+
throw new Exception('Could not create filesystem directory!! CJT Installation halted!');
|
68 |
+
}
|
69 |
+
}
|
70 |
+
}
|
71 |
+
}
|
72 |
+
return $this;
|
73 |
+
}
|
74 |
+
|
75 |
/**
|
76 |
* put your comment there...
|
77 |
*
|
89 |
public static function getInstance() {
|
90 |
return new CJTInstaller();
|
91 |
}
|
92 |
+
|
93 |
+
/**
|
94 |
+
* put your comment there...
|
95 |
+
*
|
96 |
+
*/
|
97 |
+
public function wordpressTemplates() {
|
98 |
+
// Dependencies!
|
99 |
+
cssJSToolbox::import(
|
100 |
+
'framework:db:mysql:xtable.inc.php',
|
101 |
+
'includes:installer:installer::includes:templates:wordpress-queue.inc.php'
|
102 |
+
);
|
103 |
+
// Install Wordpress build-in templates (scripts shipped out with Wordpress installation)!
|
104 |
+
foreach (array('javascript', 'css') as $type) {
|
105 |
+
$wpTemplates = new CJTInstallerWordpressQueueTemplates($type);
|
106 |
+
foreach ($wpTemplates as $wpTemplate) {
|
107 |
+
// Just install not custom updates needed!
|
108 |
+
$wpTemplates->install();
|
109 |
+
}
|
110 |
+
}
|
111 |
+
return $this;
|
112 |
+
}
|
113 |
|
114 |
} // End class.
|
includes/installer/upgrade/0.3/includes/block.class.php
CHANGED
@@ -79,10 +79,28 @@ class CJTInstallerBlocks03 extends CJTInstallerBlock {
|
|
79 |
$block['name'] = $block['block_name'];
|
80 |
$block['state'] = 'active'; // Defautt to active!
|
81 |
$block['location'] = ($block['location'] == 'wp_head') ? 'header' : 'footer'; // Re-map location name!
|
|
|
|
|
82 |
// Remove deprecated field!
|
83 |
$this[$key] = array_diff_key($block, array_flip(array('block_name', 'scripts', 'meta')));
|
84 |
// Upgrade block (save into db, etc...)
|
85 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
86 |
}
|
87 |
|
88 |
} // End class.
|
79 |
$block['name'] = $block['block_name'];
|
80 |
$block['state'] = 'active'; // Defautt to active!
|
81 |
$block['location'] = ($block['location'] == 'wp_head') ? 'header' : 'footer'; // Re-map location name!
|
82 |
+
// Cache other fields before clening up deprecated block data!
|
83 |
+
$scripts = explode(',', $block['scripts']);
|
84 |
// Remove deprecated field!
|
85 |
$this[$key] = array_diff_key($block, array_flip(array('block_name', 'scripts', 'meta')));
|
86 |
// Upgrade block (save into db, etc...)
|
87 |
+
parent::upgrade();
|
88 |
+
// Associate block templates!
|
89 |
+
if (!empty($scripts)) {
|
90 |
+
$blockTemplates = CJTxTable::getInstance('block-template')->set('blockId', $id);
|
91 |
+
$template = CJTxTable::getInstance('template')->setTableKey(array('queueName'));
|
92 |
+
// For every script/template name find the id of the template and associate it to the block!
|
93 |
+
foreach ($scripts as $scriptName) {
|
94 |
+
// Get template id from name!
|
95 |
+
$templateId = $template->setData(array('queueName' => $scriptName))->load()->get('id');
|
96 |
+
if ($templateId) { // Template found!
|
97 |
+
// Add template!
|
98 |
+
$blockTemplates->set('templateId', $templateId)->save(true);
|
99 |
+
}
|
100 |
+
}
|
101 |
+
}
|
102 |
+
// Return parent::blocks() returned value!
|
103 |
+
return $this;
|
104 |
}
|
105 |
|
106 |
} // End class.
|
includes/installer/upgrade/1.0-CE/db/mysql/structure.sql
CHANGED
@@ -1,4 +1,11 @@
|
|
1 |
-
/* Upgrade database collation to
|
2 |
ALTER TABLE #__cjtoolbox_backups CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;
|
3 |
ALTER TABLE #__cjtoolbox_blocks CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;
|
4 |
-
ALTER TABLE #__cjtoolbox_block_pins CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/* Upgrade database collation to utf8_general_ci */
|
2 |
ALTER TABLE #__cjtoolbox_backups CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;
|
3 |
ALTER TABLE #__cjtoolbox_blocks CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;
|
4 |
+
ALTER TABLE #__cjtoolbox_block_pins CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;
|
5 |
+
|
6 |
+
/* Move Old code field to thew code files */
|
7 |
+
INSERT INTO #__cjtoolbox_block_files (blockId, id, name, description, code) SELECT id, 1, 'Master', "Block MASTER code file, this file doesn't has type and cannot be deleted however fields might be updated", code FROM #__cjtoolbox_blocks;
|
8 |
+
|
9 |
+
/* Delete old 'code' field and add new masterFile field */
|
10 |
+
ALTER TABLE #__cjtoolbox_blocks DROP COLUMN `code`;
|
11 |
+
ALTER TABLE #__cjtoolbox_blocks ADD COLUMN `masterFile` INT(4) NOT NULL DEFAULT '1' AFTER flag
|
includes/installer/upgrade/1.0-CE/upgrade.class.php
CHANGED
@@ -9,7 +9,12 @@ defined('ABSPATH') or die("Access denied");
|
|
9 |
/**
|
10 |
*
|
11 |
*/
|
12 |
-
class CJTV10CEUpgrade
|
|
|
|
|
|
|
|
|
|
|
13 |
|
14 |
/**
|
15 |
* put your comment there...
|
@@ -22,26 +27,24 @@ class CJTV10CEUpgrade {
|
|
22 |
// Chaining.
|
23 |
return $this;
|
24 |
}
|
25 |
-
|
26 |
/**
|
27 |
* put your comment there...
|
28 |
*
|
|
|
29 |
*/
|
30 |
public function finalize() {
|
31 |
-
//
|
32 |
-
//
|
33 |
-
|
34 |
-
|
35 |
-
//
|
|
|
|
|
|
|
|
|
|
|
36 |
return $this;
|
37 |
}
|
38 |
|
39 |
-
/**
|
40 |
-
* put your comment there...
|
41 |
-
*
|
42 |
-
*/
|
43 |
-
public static function getInstance() {
|
44 |
-
return new CJTV10CEUpgrade();
|
45 |
-
}
|
46 |
-
|
47 |
} // End class.
|
9 |
/**
|
10 |
*
|
11 |
*/
|
12 |
+
class CJTV10CEUpgrade {
|
13 |
+
|
14 |
+
/**
|
15 |
+
*
|
16 |
+
*/
|
17 |
+
const ACCESS_POINTS_CACHE_POINTER = 'settings.CJTAccessPointsDirectorySpider.cache';
|
18 |
|
19 |
/**
|
20 |
* put your comment there...
|
27 |
// Chaining.
|
28 |
return $this;
|
29 |
}
|
30 |
+
|
31 |
/**
|
32 |
* put your comment there...
|
33 |
*
|
34 |
+
* @return CJTV10CEUpgrade Return $this
|
35 |
*/
|
36 |
public function finalize() {
|
37 |
+
// Temporary for a period of time we need to clean up
|
38 |
+
// users database as the access points cache wordpress option
|
39 |
+
// will not be used any more!
|
40 |
+
delete_option(self::ACCESS_POINTS_CACHE_POINTER);
|
41 |
+
// Delete all install operations for versions other than 'current' version!
|
42 |
+
CJTModel::import('installer');
|
43 |
+
$operationsState = get_option(CJTInstallerModel::INSTALLATION_STATE);
|
44 |
+
// Remove all and leave only 'current' versions operations!
|
45 |
+
update_option(CJTInstallerModel::INSTALLATION_STATE, array(CJTPlugin::DB_VERSION => $operationsState[CJTPlugin::DB_VERSION]));
|
46 |
+
// Chaining!
|
47 |
return $this;
|
48 |
}
|
49 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
50 |
} // End class.
|
includes/installer/upgrade/1.0/db/mysql/structure.sql
ADDED
@@ -0,0 +1,128 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/*
|
2 |
+
* CJT Database Version 1.1 Upgrade structure.
|
3 |
+
*
|
4 |
+
* Owner: css-javascript-toolbox.com
|
5 |
+
* Author: Ahmed Said
|
6 |
+
* Date:
|
7 |
+
* Description:
|
8 |
+
*/
|
9 |
+
|
10 |
+
/* Upgrade database collation to utf8_general_ci */
|
11 |
+
ALTER TABLE #__cjtoolbox_backups CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;
|
12 |
+
ALTER TABLE #__cjtoolbox_blocks CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;
|
13 |
+
ALTER TABLE #__cjtoolbox_block_pins CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;
|
14 |
+
ALTER TABLE #__cjtoolbox_authors CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;
|
15 |
+
ALTER TABLE #__cjtoolbox_block_templates CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;
|
16 |
+
ALTER TABLE #__cjtoolbox_templates CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;
|
17 |
+
ALTER TABLE #__cjtoolbox_template_revisions CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;
|
18 |
+
|
19 |
+
/* Packages holder table */
|
20 |
+
CREATE TABLE IF NOT EXISTS`#__cjtoolbox_packages` (
|
21 |
+
`name` VARCHAR(100) NOT NULL,
|
22 |
+
`author` VARCHAR(150) NOT NULL,
|
23 |
+
`webSite` VARCHAR(300) NOT NULL,
|
24 |
+
`description` TEXT NOT NULL,
|
25 |
+
`license` TEXT NOT NULL,
|
26 |
+
`readme` TEXT NOT NULL,
|
27 |
+
`id` INT(11) NOT NULL AUTO_INCREMENT,
|
28 |
+
PRIMARY KEY (`id`)
|
29 |
+
) CHARACTER SET = utf8, COLLATE=utf8_general_ci;
|
30 |
+
|
31 |
+
/* Package objects map */
|
32 |
+
CREATE TABLE IF NOT EXISTS `#__cjtoolbox_package_objects` (
|
33 |
+
`packageId` INT UNSIGNED NOT NULL,
|
34 |
+
`objectId` INT UNSIGNED NOT NULL,
|
35 |
+
`objectType` ENUM('block','template') NOT NULL,
|
36 |
+
`relType` ENUM('add','link') NOT NULL DEFAULT 'add',
|
37 |
+
PRIMARY KEY (`packageId`, `objectId`, `objectType`)
|
38 |
+
) CHARACTER SET = utf8, COLLATE=utf8_general_ci;
|
39 |
+
|
40 |
+
/* DB Version 1.3 */
|
41 |
+
/* <Shortcode Parameters Tables> */
|
42 |
+
CREATE TABLE IF NOT EXISTS `#__cjtoolbox_forms` (
|
43 |
+
`blockId` int(11) NOT NULL COMMENT 'block to be associated with the form',
|
44 |
+
`name` varchar(100) NOT NULL COMMENT 'Form name/title',
|
45 |
+
`groupType` varchar(20) NOT NULL COMMENT 'parameters gooup type (tab, accordion, etc...)',
|
46 |
+
PRIMARY KEY (`blockId`)
|
47 |
+
) CHARACTER SET = utf8, COLLATE=utf8_general_ci;
|
48 |
+
|
49 |
+
CREATE TABLE IF NOT EXISTS `#__cjtoolbox_form_groups` (
|
50 |
+
`id` int(11) NOT NULL AUTO_INCREMENT,
|
51 |
+
`formId` int(11) NOT NULL COMMENT 'block to be associated with the form',
|
52 |
+
`name` varchar(100) NOT NULL COMMENT 'group name/title',
|
53 |
+
`description` text NULL COMMENT 'Parameters group description',
|
54 |
+
PRIMARY KEY (`id`),
|
55 |
+
UNIQUE KEY `Index 3` (`formId`,`name`),
|
56 |
+
KEY `formId` (`formId`)
|
57 |
+
) CHARACTER SET = utf8, COLLATE=utf8_general_ci;
|
58 |
+
|
59 |
+
CREATE TABLE IF NOT EXISTS `#__cjtoolbox_form_group_parameters` (
|
60 |
+
`groupId` int(11) NOT NULL AUTO_INCREMENT,
|
61 |
+
`parameterId` int(11) NOT NULL COMMENT 'block to be associated with the form',
|
62 |
+
`renderer` varchar(30) DEFAULT NULL,
|
63 |
+
`description` text NULL,
|
64 |
+
`helpText` VARCHAR(200) NULL DEFAULT NULL,
|
65 |
+
PRIMARY KEY (`parameterId`),
|
66 |
+
KEY `Index 2` (`groupId`)
|
67 |
+
) CHARACTER SET = utf8, COLLATE=utf8_general_ci;
|
68 |
+
|
69 |
+
CREATE TABLE IF NOT EXISTS `#__cjtoolbox_parameters` (
|
70 |
+
`id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT 'paramter unique identifier',
|
71 |
+
`blockId` int(11) unsigned NOT NULL,
|
72 |
+
`parent` int(11) unsigned DEFAULT NULL,
|
73 |
+
`name` varchar(60) NOT NULL,
|
74 |
+
`type` varchar(20) NOT NULL,
|
75 |
+
`defaultValue` text,
|
76 |
+
`required` tinyint(1) unsigned NOT NULL DEFAULT '0',
|
77 |
+
`contentParam` TINYINT(1) UNSIGNED NOT NULL DEFAULT '0',
|
78 |
+
PRIMARY KEY (`id`),
|
79 |
+
UNIQUE INDEX `name` (`name`, `parent`, `blockId`),
|
80 |
+
KEY `parent` (`parent`),
|
81 |
+
KEY `blockId` (`blockId`)
|
82 |
+
) CHARACTER SET = utf8, COLLATE=utf8_general_ci;
|
83 |
+
|
84 |
+
CREATE TABLE IF NOT EXISTS `#__cjtoolbox_parameter_typedef` (
|
85 |
+
`id` int(11) NOT NULL AUTO_INCREMENT,
|
86 |
+
`parameterId` int(11) NOT NULL,
|
87 |
+
`text` text NOT NULL,
|
88 |
+
`value` text NOT NULL,
|
89 |
+
PRIMARY KEY (`id`),
|
90 |
+
KEY `parameterId` (`parameterId`)
|
91 |
+
) CHARACTER SET = utf8, COLLATE=utf8_general_ci;
|
92 |
+
|
93 |
+
CREATE TABLE IF NOT EXISTS `#__cjtoolbox_parameter_typeparams` (
|
94 |
+
`id` INT(11) NOT NULL AUTO_INCREMENT,
|
95 |
+
`parameterId` INT(11) NOT NULL,
|
96 |
+
`name` TEXT NOT NULL,
|
97 |
+
`value` TEXT NOT NULL,
|
98 |
+
PRIMARY KEY (`id`),
|
99 |
+
INDEX `parameterId` (`parameterId`)
|
100 |
+
) CHARACTER SET = utf8, COLLATE=utf8_general_ci;
|
101 |
+
|
102 |
+
/* 1.4 */
|
103 |
+
CREATE TABLE IF NOT EXISTS `#__cjtoolbox_form_group_xfields` (
|
104 |
+
`groupId` INT(11) NOT NULL,
|
105 |
+
`text` TEXT NULL,
|
106 |
+
UNIQUE INDEX `groupId` (`groupId`)
|
107 |
+
) CHARACTER SET = utf8, COLLATE=utf8_general_ci;
|
108 |
+
/* </Shortcode Parameters Tables> */
|
109 |
+
|
110 |
+
/* Block Files Table */
|
111 |
+
CREATE TABLE IF NOT EXISTS `#__cjtoolbox_block_files` (
|
112 |
+
`id` INT(11) NOT NULL AUTO_INCREMENT,
|
113 |
+
`blockId` INT(11) NOT NULL,
|
114 |
+
`name` VARCHAR(100) NOT NULL,
|
115 |
+
`type` ENUM('css','javascript','php','html') NULL DEFAULT NULL,
|
116 |
+
`description` VARCHAR(400) NULL DEFAULT NULL,
|
117 |
+
`code` TEXT NULL,
|
118 |
+
`order` SMALLINT(6) NULL DEFAULT '0',
|
119 |
+
`tag` TEXT NULL,
|
120 |
+
PRIMARY KEY (`id`, `blockId`)
|
121 |
+
) CHARACTER SET = utf8, COLLATE=utf8_general_ci;
|
122 |
+
|
123 |
+
/* Move Old code field to thew code files */
|
124 |
+
INSERT INTO #__cjtoolbox_block_files (blockId, id, name, description, code) SELECT id, 1, 'Master', "Block MASTER code file, this file doesn't has type and cannot be deleted however fields might be updated", code FROM #__cjtoolbox_blocks;
|
125 |
+
|
126 |
+
/* Delete old 'code' field and add new masterFile field */
|
127 |
+
ALTER TABLE #__cjtoolbox_blocks DROP COLUMN `code`;
|
128 |
+
ALTER TABLE #__cjtoolbox_blocks ADD COLUMN `masterFile` INT(4) NOT NULL DEFAULT '1' AFTER flag
|
includes/installer/upgrade/1.0/upgrade.class.php
ADDED
@@ -0,0 +1,39 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
*
|
4 |
+
*/
|
5 |
+
|
6 |
+
// Disallow direct access.
|
7 |
+
defined('ABSPATH') or die("Access denied");
|
8 |
+
|
9 |
+
/**
|
10 |
+
*
|
11 |
+
*/
|
12 |
+
class CJTV10Upgrade {
|
13 |
+
|
14 |
+
/**
|
15 |
+
* put your comment there...
|
16 |
+
*
|
17 |
+
*/
|
18 |
+
public function database() {
|
19 |
+
// Upgrade database tables.
|
20 |
+
cssJSToolbox::import('framework:installer:dbfile.class.php');
|
21 |
+
CJTDBFileInstaller::getInstance(cssJSToolbox::resolvePath('includes:installer:upgrade:1.0:db:mysql:structure.sql'))->exec();
|
22 |
+
// Chaining.
|
23 |
+
return $this;
|
24 |
+
}
|
25 |
+
|
26 |
+
/**
|
27 |
+
* put your comment there...
|
28 |
+
*
|
29 |
+
*/
|
30 |
+
public function finalize() {
|
31 |
+
// Upgrade database internal version number using
|
32 |
+
// installer class.
|
33 |
+
cssJSToolbox::import('includes:installer:installer:installer.class.php');
|
34 |
+
CJTInstaller::getInstance()->finalize();
|
35 |
+
// Chaining.
|
36 |
+
return $this;
|
37 |
+
}
|
38 |
+
|
39 |
+
} // End class.
|
includes/installer/upgrade/1.1-CE/db/mysql/structure.sql
ADDED
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/* Move Old code field to thew code files */
|
2 |
+
INSERT INTO #__cjtoolbox_block_files (blockId, id, name, description, code) SELECT id, 1, 'Master', "Block MASTER code file, this file doesn't has type and cannot be deleted however fields might be updated", code FROM #__cjtoolbox_blocks;
|
3 |
+
|
4 |
+
/* Delete old 'code' field and add new masterFile field */
|
5 |
+
ALTER TABLE #__cjtoolbox_blocks DROP COLUMN `code`;
|
6 |
+
ALTER TABLE #__cjtoolbox_blocks ADD COLUMN `masterFile` INT(4) NOT NULL DEFAULT '1' AFTER flag
|
includes/installer/upgrade/1.1-CE/upgrade.class.php
ADDED
@@ -0,0 +1,49 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
*
|
4 |
+
*/
|
5 |
+
|
6 |
+
// Disallow direct access.
|
7 |
+
defined('ABSPATH') or die("Access denied");
|
8 |
+
|
9 |
+
/**
|
10 |
+
*
|
11 |
+
*/
|
12 |
+
class CJTV11CEUpgrade {
|
13 |
+
|
14 |
+
/**
|
15 |
+
*
|
16 |
+
*/
|
17 |
+
const ACCESS_POINTS_CACHE_POINTER = 'settings.CJTAccessPointsDirectorySpider.cache';
|
18 |
+
|
19 |
+
/**
|
20 |
+
* put your comment there...
|
21 |
+
*
|
22 |
+
*/
|
23 |
+
public function database() {
|
24 |
+
// Upgrade database tables.
|
25 |
+
cssJSToolbox::import('framework:installer:dbfile.class.php');
|
26 |
+
CJTDBFileInstaller::getInstance(cssJSToolbox::resolvePath('includes:installer:upgrade:1.1-CE:db:mysql:structure.sql'))->exec();
|
27 |
+
// Chaining.
|
28 |
+
return $this;
|
29 |
+
}
|
30 |
+
|
31 |
+
/**
|
32 |
+
* put your comment there...
|
33 |
+
*
|
34 |
+
* @return CJTV10CEUpgrade Return $this
|
35 |
+
*/
|
36 |
+
public function finalize() {
|
37 |
+
// Temporary for a period of time we need to clean up
|
38 |
+
// users database as the access points cache wordpress option
|
39 |
+
// will not be used any more!
|
40 |
+
delete_option(self::ACCESS_POINTS_CACHE_POINTER);
|
41 |
+
// Delete all install operations for versions other than 'current' version!
|
42 |
+
CJTModel::import('installer');
|
43 |
+
$operationsState = get_option(CJTInstallerModel::INSTALLATION_STATE);
|
44 |
+
update_option(CJTInstallerModel::INSTALLATION_STATE, array(CJTPlugin::DB_VERSION => $operationsState[CJTPlugin::DB_VERSION]));
|
45 |
+
// Chaining!
|
46 |
+
return $this;
|
47 |
+
}
|
48 |
+
|
49 |
+
} // End class.
|
includes/installer/upgrade/1.1/db/mysql/structure.sql
ADDED
@@ -0,0 +1,109 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/*
|
2 |
+
* CJT Database Version 1.2 Upgrade structure.
|
3 |
+
*
|
4 |
+
* Owner: css-javascript-toolbox.com
|
5 |
+
* Author: Ahmed Said
|
6 |
+
* Date:
|
7 |
+
* Description:
|
8 |
+
*/
|
9 |
+
|
10 |
+
/* Upgrade database collation to utf8_general_ci */
|
11 |
+
ALTER TABLE #__cjtoolbox_backups CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;
|
12 |
+
ALTER TABLE #__cjtoolbox_blocks CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;
|
13 |
+
ALTER TABLE #__cjtoolbox_block_pins CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;
|
14 |
+
ALTER TABLE #__cjtoolbox_authors CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;
|
15 |
+
ALTER TABLE #__cjtoolbox_block_templates CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;
|
16 |
+
ALTER TABLE #__cjtoolbox_templates CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;
|
17 |
+
ALTER TABLE #__cjtoolbox_template_revisions CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;
|
18 |
+
ALTER TABLE #__cjtoolbox_packages CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;
|
19 |
+
ALTER TABLE #__cjtoolbox_package_objects CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;
|
20 |
+
|
21 |
+
/* DB Version 1.3 */
|
22 |
+
/* <Shortcode Parameters Tables> */
|
23 |
+
CREATE TABLE IF NOT EXISTS `#__cjtoolbox_forms` (
|
24 |
+
`blockId` int(11) NOT NULL COMMENT 'block to be associated with the form',
|
25 |
+
`name` varchar(100) NOT NULL COMMENT 'Form name/title',
|
26 |
+
`groupType` varchar(20) NOT NULL COMMENT 'parameters gooup type (tab, accordion, etc...)',
|
27 |
+
PRIMARY KEY (`blockId`)
|
28 |
+
) CHARACTER SET = utf8, COLLATE=utf8_general_ci;
|
29 |
+
|
30 |
+
CREATE TABLE IF NOT EXISTS `#__cjtoolbox_form_groups` (
|
31 |
+
`id` int(11) NOT NULL AUTO_INCREMENT,
|
32 |
+
`formId` int(11) NOT NULL COMMENT 'block to be associated with the form',
|
33 |
+
`name` varchar(100) NOT NULL COMMENT 'group name/title',
|
34 |
+
`description` text NULL COMMENT 'Parameters group description',
|
35 |
+
PRIMARY KEY (`id`),
|
36 |
+
UNIQUE KEY `Index 3` (`formId`,`name`),
|
37 |
+
KEY `formId` (`formId`)
|
38 |
+
) CHARACTER SET = utf8, COLLATE=utf8_general_ci;
|
39 |
+
|
40 |
+
CREATE TABLE IF NOT EXISTS `#__cjtoolbox_form_group_parameters` (
|
41 |
+
`groupId` int(11) NOT NULL AUTO_INCREMENT,
|
42 |
+
`parameterId` int(11) NOT NULL COMMENT 'block to be associated with the form',
|
43 |
+
`renderer` varchar(30) DEFAULT NULL,
|
44 |
+
`description` text NULL,
|
45 |
+
`helpText` VARCHAR(200) NULL DEFAULT NULL,
|
46 |
+
PRIMARY KEY (`parameterId`),
|
47 |
+
KEY `Index 2` (`groupId`)
|
48 |
+
) CHARACTER SET = utf8, COLLATE=utf8_general_ci;
|
49 |
+
|
50 |
+
CREATE TABLE IF NOT EXISTS `#__cjtoolbox_parameters` (
|
51 |
+
`id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT 'paramter unique identifier',
|
52 |
+
`blockId` int(11) unsigned NOT NULL,
|
53 |
+
`parent` int(11) unsigned DEFAULT NULL,
|
54 |
+
`name` varchar(60) NOT NULL,
|
55 |
+
`type` varchar(20) NOT NULL,
|
56 |
+
`defaultValue` text,
|
57 |
+
`required` tinyint(1) unsigned NOT NULL DEFAULT '0',
|
58 |
+
`contentParam` TINYINT(1) UNSIGNED NOT NULL DEFAULT '0',
|
59 |
+
PRIMARY KEY (`id`),
|
60 |
+
UNIQUE INDEX `name` (`name`, `parent`, `blockId`),
|
61 |
+
KEY `parent` (`parent`),
|
62 |
+
KEY `blockId` (`blockId`)
|
63 |
+
) CHARACTER SET = utf8, COLLATE=utf8_general_ci;
|
64 |
+
|
65 |
+
CREATE TABLE IF NOT EXISTS `#__cjtoolbox_parameter_typedef` (
|
66 |
+
`id` int(11) NOT NULL AUTO_INCREMENT,
|
67 |
+
`parameterId` int(11) NOT NULL,
|
68 |
+
`text` text NOT NULL,
|
69 |
+
`value` text NOT NULL,
|
70 |
+
PRIMARY KEY (`id`),
|
71 |
+
KEY `parameterId` (`parameterId`)
|
72 |
+
) CHARACTER SET = utf8, COLLATE=utf8_general_ci;
|
73 |
+
|
74 |
+
CREATE TABLE IF NOT EXISTS `#__cjtoolbox_parameter_typeparams` (
|
75 |
+
`id` INT(11) NOT NULL AUTO_INCREMENT,
|
76 |
+
`parameterId` INT(11) NOT NULL,
|
77 |
+
`name` TEXT NOT NULL,
|
78 |
+
`value` TEXT NOT NULL,
|
79 |
+
PRIMARY KEY (`id`),
|
80 |
+
INDEX `parameterId` (`parameterId`)
|
81 |
+
) CHARACTER SET = utf8, COLLATE=utf8_general_ci;
|
82 |
+
|
83 |
+
/* 1.4 */
|
84 |
+
CREATE TABLE IF NOT EXISTS `#__cjtoolbox_form_group_xfields` (
|
85 |
+
`groupId` INT(11) NOT NULL,
|
86 |
+
`text` TEXT NULL,
|
87 |
+
UNIQUE INDEX `groupId` (`groupId`)
|
88 |
+
) CHARACTER SET = utf8, COLLATE=utf8_general_ci;
|
89 |
+
/* </Shortcode Parameters Tables> */
|
90 |
+
|
91 |
+
/* Block Files Table */
|
92 |
+
CREATE TABLE IF NOT EXISTS `#__cjtoolbox_block_files` (
|
93 |
+
`id` INT(11) NOT NULL AUTO_INCREMENT,
|
94 |
+
`blockId` INT(11) NOT NULL,
|
95 |
+
`name` VARCHAR(100) NOT NULL,
|
96 |
+
`type` ENUM('css','javascript','php','html') NULL DEFAULT NULL,
|
97 |
+
`description` VARCHAR(400) NULL DEFAULT NULL,
|
98 |
+
`code` TEXT NULL,
|
99 |
+
`order` SMALLINT(6) NULL DEFAULT '0',
|
100 |
+
`tag` TEXT NULL,
|
101 |
+
PRIMARY KEY (`id`, `blockId`)
|
102 |
+
) CHARACTER SET = utf8, COLLATE=utf8_general_ci;
|
103 |
+
|
104 |
+
/* Move Old code field to thew code files */
|
105 |
+
INSERT INTO #__cjtoolbox_block_files (blockId, id, name, description, code) SELECT id, 1, 'Master', "Block MASTER code file, this file doesn't has type and cannot be deleted however fields might be updated", code FROM #__cjtoolbox_blocks;
|
106 |
+
|
107 |
+
/* Delete old 'code' field and add new masterFile field */
|
108 |
+
ALTER TABLE #__cjtoolbox_blocks DROP COLUMN `code`;
|
109 |
+
ALTER TABLE #__cjtoolbox_blocks ADD COLUMN `masterFile` INT(4) NOT NULL DEFAULT '1' AFTER flag
|
includes/installer/upgrade/1.1/upgrade.class.php
ADDED
@@ -0,0 +1,39 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
*
|
4 |
+
*/
|
5 |
+
|
6 |
+
// Disallow direct access.
|
7 |
+
defined('ABSPATH') or die("Access denied");
|
8 |
+
|
9 |
+
/**
|
10 |
+
*
|
11 |
+
*/
|
12 |
+
class CJTV11Upgrade {
|
13 |
+
|
14 |
+
/**
|
15 |
+
* put your comment there...
|
16 |
+
*
|
17 |
+
*/
|
18 |
+
public function database() {
|
19 |
+
// Upgrade database tables.
|
20 |
+
cssJSToolbox::import('framework:installer:dbfile.class.php');
|
21 |
+
CJTDBFileInstaller::getInstance(cssJSToolbox::resolvePath('includes:installer:upgrade:1.1:db:mysql:structure.sql'))->exec();
|
22 |
+
// Chaining.
|
23 |
+
return $this;
|
24 |
+
}
|
25 |
+
|
26 |
+
/**
|
27 |
+
* put your comment there...
|
28 |
+
*
|
29 |
+
*/
|
30 |
+
public function finalize() {
|
31 |
+
// Upgrade database internal version number using
|
32 |
+
// installer class.
|
33 |
+
cssJSToolbox::import('includes:installer:installer:installer.class.php');
|
34 |
+
CJTInstaller::getInstance()->finalize();
|
35 |
+
// Chaining.
|
36 |
+
return $this;
|
37 |
+
}
|
38 |
+
|
39 |
+
} // End class.
|
includes/installer/upgrade/1.2/db/mysql/structure.sql
ADDED
@@ -0,0 +1,90 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/* DB Version 1.3 */
|
2 |
+
/* <Shortcode Parameters Tables> */
|
3 |
+
CREATE TABLE IF NOT EXISTS `#__cjtoolbox_forms` (
|
4 |
+
`blockId` int(11) NOT NULL COMMENT 'block to be associated with the form',
|
5 |
+
`name` varchar(100) NOT NULL COMMENT 'Form name/title',
|
6 |
+
`groupType` varchar(20) NOT NULL COMMENT 'parameters gooup type (tab, accordion, etc...)',
|
7 |
+
PRIMARY KEY (`blockId`)
|
8 |
+
) CHARACTER SET = utf8, COLLATE=utf8_general_ci;
|
9 |
+
|
10 |
+
CREATE TABLE IF NOT EXISTS `#__cjtoolbox_form_groups` (
|
11 |
+
`id` int(11) NOT NULL AUTO_INCREMENT,
|
12 |
+
`formId` int(11) NOT NULL COMMENT 'block to be associated with the form',
|
13 |
+
`name` varchar(100) NOT NULL COMMENT 'group name/title',
|
14 |
+
`description` text NULL COMMENT 'Parameters group description',
|
15 |
+
PRIMARY KEY (`id`),
|
16 |
+
UNIQUE KEY `Index 3` (`formId`,`name`),
|
17 |
+
KEY `formId` (`formId`)
|
18 |
+
) CHARACTER SET = utf8, COLLATE=utf8_general_ci;
|
19 |
+
|
20 |
+
CREATE TABLE IF NOT EXISTS `#__cjtoolbox_form_group_parameters` (
|
21 |
+
`groupId` int(11) NOT NULL AUTO_INCREMENT,
|
22 |
+
`parameterId` int(11) NOT NULL COMMENT 'block to be associated with the form',
|
23 |
+
`renderer` varchar(30) DEFAULT NULL,
|
24 |
+
`description` text NULL,
|
25 |
+
`helpText` VARCHAR(200) NULL DEFAULT NULL,
|
26 |
+
PRIMARY KEY (`parameterId`),
|
27 |
+
KEY `Index 2` (`groupId`)
|
28 |
+
) CHARACTER SET = utf8, COLLATE=utf8_general_ci;
|
29 |
+
|
30 |
+
CREATE TABLE IF NOT EXISTS `#__cjtoolbox_parameters` (
|
31 |
+
`id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT 'paramter unique identifier',
|
32 |
+
`blockId` int(11) unsigned NOT NULL,
|
33 |
+
`parent` int(11) unsigned DEFAULT NULL,
|
34 |
+
`name` varchar(60) NOT NULL,
|
35 |
+
`type` varchar(20) NOT NULL,
|
36 |
+
`defaultValue` text,
|
37 |
+
`required` tinyint(1) unsigned NOT NULL DEFAULT '0',
|
38 |
+
`contentParam` TINYINT(1) UNSIGNED NOT NULL DEFAULT '0',
|
39 |
+
PRIMARY KEY (`id`),
|
40 |
+
UNIQUE INDEX `name` (`name`, `parent`, `blockId`),
|
41 |
+
KEY `parent` (`parent`),
|
42 |
+
KEY `blockId` (`blockId`)
|
43 |
+
) CHARACTER SET = utf8, COLLATE=utf8_general_ci;
|
44 |
+
|
45 |
+
CREATE TABLE IF NOT EXISTS `#__cjtoolbox_parameter_typedef` (
|
46 |
+
`id` int(11) NOT NULL AUTO_INCREMENT,
|
47 |
+
`parameterId` int(11) NOT NULL,
|
48 |
+
`text` text NOT NULL,
|
49 |
+
`value` text NOT NULL,
|
50 |
+
PRIMARY KEY (`id`),
|
51 |
+
KEY `parameterId` (`parameterId`)
|
52 |
+
) CHARACTER SET = utf8, COLLATE=utf8_general_ci;
|
53 |
+
|
54 |
+
CREATE TABLE IF NOT EXISTS `#__cjtoolbox_parameter_typeparams` (
|
55 |
+
`id` INT(11) NOT NULL AUTO_INCREMENT,
|
56 |
+
`parameterId` INT(11) NOT NULL,
|
57 |
+
`name` TEXT NOT NULL,
|
58 |
+
`value` TEXT NOT NULL,
|
59 |
+
PRIMARY KEY (`id`),
|
60 |
+
INDEX `parameterId` (`parameterId`)
|
61 |
+
) CHARACTER SET = utf8, COLLATE=utf8_general_ci;
|
62 |
+
|
63 |
+
/* 1.4 */
|
64 |
+
CREATE TABLE IF NOT EXISTS `#__cjtoolbox_form_group_xfields` (
|
65 |
+
`groupId` INT(11) NOT NULL,
|
66 |
+
`text` TEXT NULL,
|
67 |
+
UNIQUE INDEX `groupId` (`groupId`)
|
68 |
+
) CHARACTER SET = utf8, COLLATE=utf8_general_ci;
|
69 |
+
/* </Shortcode Parameters Tables> */
|
70 |
+
|
71 |
+
/* 1.5 */
|
72 |
+
/* Block Files Table */
|
73 |
+
CREATE TABLE IF NOT EXISTS `#__cjtoolbox_block_files` (
|
74 |
+
`id` INT(11) NOT NULL AUTO_INCREMENT,
|
75 |
+
`blockId` INT(11) NOT NULL,
|
76 |
+
`name` VARCHAR(100) NOT NULL,
|
77 |
+
`type` ENUM('css','javascript','php','html') NULL DEFAULT NULL,
|
78 |
+
`description` VARCHAR(400) NULL DEFAULT NULL,
|
79 |
+
`code` TEXT NULL,
|
80 |
+
`order` SMALLINT(6) NULL DEFAULT '0',
|
81 |
+
`tag` TEXT NULL,
|
82 |
+
PRIMARY KEY (`id`, `blockId`)
|
83 |
+
) CHARACTER SET = utf8, COLLATE=utf8_general_ci;
|
84 |
+
|
85 |
+
/* Move Old code field to thew code files */
|
86 |
+
INSERT INTO #__cjtoolbox_block_files (blockId, id, name, description, code) SELECT id, 1, 'Master', "Block MASTER code file, this file doesn't has type and cannot be deleted however fields might be updated", code FROM #__cjtoolbox_blocks;
|
87 |
+
|
88 |
+
/* Delete old 'code' field and add new masterFile field */
|
89 |
+
ALTER TABLE #__cjtoolbox_blocks DROP COLUMN `code`;
|
90 |
+
ALTER TABLE #__cjtoolbox_blocks ADD COLUMN `masterFile` INT(4) NOT NULL DEFAULT '1' AFTER flag
|
includes/installer/upgrade/1.2/upgrade.class.php
ADDED
@@ -0,0 +1,39 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
*
|
4 |
+
*/
|
5 |
+
|
6 |
+
// Disallow direct access.
|
7 |
+
defined('ABSPATH') or die("Access denied");
|
8 |
+
|
9 |
+
/**
|
10 |
+
*
|
11 |
+
*/
|
12 |
+
class CJTV12Upgrade {
|
13 |
+
|
14 |
+
/**
|
15 |
+
* put your comment there...
|
16 |
+
*
|
17 |
+
*/
|
18 |
+
public function database() {
|
19 |
+
// Upgrade database tables.
|
20 |
+
cssJSToolbox::import('framework:installer:dbfile.class.php');
|
21 |
+
CJTDBFileInstaller::getInstance(cssJSToolbox::resolvePath('includes:installer:upgrade:1.2:db:mysql:structure.sql'))->exec();
|
22 |
+
// Chaining.
|
23 |
+
return $this;
|
24 |
+
}
|
25 |
+
|
26 |
+
/**
|
27 |
+
* put your comment there...
|
28 |
+
*
|
29 |
+
*/
|
30 |
+
public function finalize() {
|
31 |
+
// Upgrade database internal version number using
|
32 |
+
// installer class.
|
33 |
+
cssJSToolbox::import('includes:installer:installer:installer.class.php');
|
34 |
+
CJTInstaller::getInstance()->finalize();
|
35 |
+
// Chaining.
|
36 |
+
return $this;
|
37 |
+
}
|
38 |
+
|
39 |
+
} // End class.
|
includes/installer/upgrade/1.3/db/mysql/structure.sql
ADDED
@@ -0,0 +1,28 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/* DB Version 1.4 */
|
2 |
+
/* <Shortcode Parameters Tables UPDATES> */
|
3 |
+
CREATE TABLE IF NOT EXISTS `#__cjtoolbox_form_group_xfields` (
|
4 |
+
`groupId` INT(11) NOT NULL,
|
5 |
+
`text` TEXT NULL,
|
6 |
+
UNIQUE INDEX `groupId` (`groupId`)
|
7 |
+
) CHARACTER SET = utf8, COLLATE=utf8_general_ci;
|
8 |
+
/* </Shortcode Parameters Tables UPDATES> */
|
9 |
+
|
10 |
+
/* Block Files Table */
|
11 |
+
CREATE TABLE IF NOT EXISTS `#__cjtoolbox_block_files` (
|
12 |
+
`id` INT(11) NOT NULL AUTO_INCREMENT,
|
13 |
+
`blockId` INT(11) NOT NULL,
|
14 |
+
`name` VARCHAR(100) NOT NULL,
|
15 |
+
`type` ENUM('css','javascript','php','html') NULL DEFAULT NULL,
|
16 |
+
`description` VARCHAR(400) NULL DEFAULT NULL,
|
17 |
+
`code` TEXT NULL,
|
18 |
+
`order` SMALLINT(6) NULL DEFAULT '0',
|
19 |
+
`tag` TEXT NULL,
|
20 |
+
PRIMARY KEY (`id`, `blockId`)
|
21 |
+
) CHARACTER SET = utf8, COLLATE=utf8_general_ci;
|
22 |
+
|
23 |
+
/* Move Old code field to thew code files */
|
24 |
+
INSERT INTO #__cjtoolbox_block_files (blockId, id, name, description, code) SELECT id, 1, 'Master', "Block MASTER code file, this file doesn't has type and cannot be deleted however fields might be updated", code FROM #__cjtoolbox_blocks;
|
25 |
+
|
26 |
+
/* Delete old 'code' field and add new masterFile field */
|
27 |
+
ALTER TABLE #__cjtoolbox_blocks DROP COLUMN `code`;
|
28 |
+
ALTER TABLE #__cjtoolbox_blocks ADD COLUMN `masterFile` INT(4) NOT NULL DEFAULT '1' AFTER flag
|
includes/installer/upgrade/1.3/upgrade.class.php
ADDED
@@ -0,0 +1,39 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
*
|
4 |
+
*/
|
5 |
+
|
6 |
+
// Disallow direct access.
|
7 |
+
defined('ABSPATH') or die("Access denied");
|
8 |
+
|
9 |
+
/**
|
10 |
+
*
|
11 |
+
*/
|
12 |
+
class CJTV13Upgrade {
|
13 |
+
|
14 |
+
/**
|
15 |
+
* put your comment there...
|
16 |
+
*
|
17 |
+
*/
|
18 |
+
public function database() {
|
19 |
+
// Upgrade database tables.
|
20 |
+
cssJSToolbox::import('framework:installer:dbfile.class.php');
|
21 |
+
CJTDBFileInstaller::getInstance(cssJSToolbox::resolvePath('includes:installer:upgrade:1.3:db:mysql:structure.sql'))->exec();
|
22 |
+
// Chaining.
|
23 |
+
return $this;
|
24 |
+
}
|
25 |
+
|
26 |
+
/**
|
27 |
+
* put your comment there...
|
28 |
+
*
|
29 |
+
*/
|
30 |
+
public function finalize() {
|
31 |
+
// Upgrade database internal version number using
|
32 |
+
// installer class.
|
33 |
+
cssJSToolbox::import('includes:installer:installer:installer.class.php');
|
34 |
+
CJTInstaller::getInstance()->finalize();
|
35 |
+
// Chaining.
|
36 |
+
return $this;
|
37 |
+
}
|
38 |
+
|
39 |
+
} // End class.
|
includes/installer/upgrade/1.4/db/mysql/structure.sql
ADDED
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/* Block Files Table */
|
2 |
+
CREATE TABLE IF NOT EXISTS `#__cjtoolbox_block_files` (
|
3 |
+
`id` INT(11) NOT NULL AUTO_INCREMENT,
|
4 |
+
`blockId` INT(11) NOT NULL,
|
5 |
+
`name` VARCHAR(100) NOT NULL,
|
6 |
+
`type` ENUM('css','javascript','php','html') NULL DEFAULT NULL,
|
7 |
+
`description` VARCHAR(400) NULL DEFAULT NULL,
|
8 |
+
`code` TEXT NULL,
|
9 |
+
`order` SMALLINT(6) NULL DEFAULT '0',
|
10 |
+
`tag` TEXT NULL,
|
11 |
+
PRIMARY KEY (`id`, `blockId`)
|
12 |
+
) CHARACTER SET = utf8, COLLATE=utf8_general_ci;
|
13 |
+
|
14 |
+
/* Move Old code field to thew code files */
|
15 |
+
INSERT INTO #__cjtoolbox_block_files (blockId, id, name, description, code) SELECT id, 1, 'Master', "Block MASTER code file, this file doesn't has type and cannot be deleted however fields might be updated", code FROM #__cjtoolbox_blocks;
|
16 |
+
|
17 |
+
/* Delete old 'code' field and add new masterFile field */
|
18 |
+
ALTER TABLE #__cjtoolbox_blocks DROP COLUMN `code`;
|
19 |
+
ALTER TABLE #__cjtoolbox_blocks ADD COLUMN `masterFile` INT(4) NOT NULL DEFAULT '1' AFTER flag
|
includes/installer/upgrade/1.4/upgrade.class.php
ADDED
@@ -0,0 +1,39 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
*
|
4 |
+
*/
|
5 |
+
|
6 |
+
// Disallow direct access.
|
7 |
+
defined('ABSPATH') or die("Access denied");
|
8 |
+
|
9 |
+
/**
|
10 |
+
*
|
11 |
+
*/
|
12 |
+
class CJTV14Upgrade {
|
13 |
+
|
14 |
+
/**
|
15 |
+
* put your comment there...
|
16 |
+
*
|
17 |
+
*/
|
18 |
+
public function database() {
|
19 |
+
// Upgrade database tables.
|
20 |
+
cssJSToolbox::import('framework:installer:dbfile.class.php');
|
21 |
+
CJTDBFileInstaller::getInstance(cssJSToolbox::resolvePath('includes:installer:upgrade:1.4:db:mysql:structure.sql'))->exec();
|
22 |
+
// Chaining.
|
23 |
+
return $this;
|
24 |
+
}
|
25 |
+
|
26 |
+
/**
|
27 |
+
* put your comment there...
|
28 |
+
*
|
29 |
+
*/
|
30 |
+
public function finalize() {
|
31 |
+
// Upgrade database internal version number using
|
32 |
+
// installer class.
|
33 |
+
cssJSToolbox::import('includes:installer:installer:installer.class.php');
|
34 |
+
CJTInstaller::getInstance()->finalize();
|
35 |
+
// Chaining.
|
36 |
+
return $this;
|
37 |
+
}
|
38 |
+
|
39 |
+
} // End class.
|
includes/installer/upgrade/1.5/upgrade.class.php
ADDED
@@ -0,0 +1,40 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
*
|
4 |
+
*/
|
5 |
+
|
6 |
+
// Disallow direct access.
|
7 |
+
defined('ABSPATH') or die("Access denied");
|
8 |
+
|
9 |
+
/**
|
10 |
+
*
|
11 |
+
*/
|
12 |
+
class CJTV15Upgrade {
|
13 |
+
|
14 |
+
/**
|
15 |
+
* put your comment there...
|
16 |
+
*
|
17 |
+
*/
|
18 |
+
public function database() {
|
19 |
+
// This operation runs only if required.
|
20 |
+
// @see 15 view operations file.
|
21 |
+
cssJSToolbox::import('framework:installer:dbfile.class.php');
|
22 |
+
CJTDBFileInstaller::getInstance(cssJSToolbox::resolvePath('includes:installer:upgrade:1.1-CE:db:mysql:structure.sql'))->exec();
|
23 |
+
// Chaining.
|
24 |
+
return $this;
|
25 |
+
}
|
26 |
+
|
27 |
+
/**
|
28 |
+
* put your comment there...
|
29 |
+
*
|
30 |
+
*/
|
31 |
+
public function finalize() {
|
32 |
+
// Upgrade database internal version number using
|
33 |
+
// installer class.
|
34 |
+
cssJSToolbox::import('includes:installer:installer:installer.class.php');
|
35 |
+
CJTInstaller::getInstance()->finalize();
|
36 |
+
// Chaining.
|
37 |
+
return $this;
|
38 |
+
}
|
39 |
+
|
40 |
+
} // End class.
|
includes/installer/upgrade/template.class.php
ADDED
@@ -0,0 +1,57 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
*
|
4 |
+
*/
|
5 |
+
|
6 |
+
/**
|
7 |
+
*
|
8 |
+
*/
|
9 |
+
class CJTInstallerTemplate extends ArrayIterator {
|
10 |
+
|
11 |
+
/**
|
12 |
+
* put your comment there...
|
13 |
+
*
|
14 |
+
* @var mixed
|
15 |
+
*/
|
16 |
+
protected $model;
|
17 |
+
|
18 |
+
/**
|
19 |
+
* put your comment there...
|
20 |
+
*
|
21 |
+
* @param mixed $templates
|
22 |
+
* @return CJTInstallerTemplate
|
23 |
+
*/
|
24 |
+
public function __construct($templates) {
|
25 |
+
// Initialize!
|
26 |
+
$this->model = CJTModel::getInstance('template');
|
27 |
+
// Initialize Iterator!
|
28 |
+
parent::__construct(is_array($templates) ? $templates : array());
|
29 |
+
}
|
30 |
+
|
31 |
+
/**
|
32 |
+
* put your comment there...
|
33 |
+
*
|
34 |
+
*/
|
35 |
+
public function upgrade() {
|
36 |
+
// Initiaize!
|
37 |
+
$template = $this->current();
|
38 |
+
$item = array();
|
39 |
+
// Revision data!
|
40 |
+
$revision['code'] = $template['code'];
|
41 |
+
$revision['changeLog'] = 'Just created...';
|
42 |
+
$revision['state'] = 'release';
|
43 |
+
// Template data!
|
44 |
+
unset($template['code']);
|
45 |
+
// js type name changed to javascript!
|
46 |
+
if ($template['type'] == 'js') {
|
47 |
+
$template['type'] = 'javascript';
|
48 |
+
}
|
49 |
+
// Build template-model template item sturture!
|
50 |
+
$item['template'] = $template;
|
51 |
+
$item['revision'] = $revision;
|
52 |
+
// Save template into db!
|
53 |
+
$this->model->inputs['item'] = $item;
|
54 |
+
$this->model->save();
|
55 |
+
}
|
56 |
+
|
57 |
+
} // End class.
|
includes/installer/upgrade/upgrade.class.php
CHANGED
@@ -28,15 +28,26 @@ abstract class CJTUpgradeNonTabledVersions extends CJTHookableClass {
|
|
28 |
*/
|
29 |
protected $blocks;
|
30 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
31 |
/**
|
32 |
* put your comment there...
|
33 |
*
|
34 |
*/
|
35 |
public function __construct() {
|
36 |
// Import dependencies!
|
37 |
-
cssJSToolbox::import('includes:installer:upgrade:block.class.php');
|
38 |
// Load blocks into installer iterator!
|
39 |
$this->blocks = $this->getBlocksIterator(get_option(self::BLOCKS_POINTER));
|
|
|
|
|
|
|
|
|
40 |
}
|
41 |
|
42 |
/**
|
@@ -99,4 +110,17 @@ abstract class CJTUpgradeNonTabledVersions extends CJTHookableClass {
|
|
99 |
*/
|
100 |
protected abstract function getBlocksIterator($blocks);
|
101 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
102 |
} // End class.
|
28 |
*/
|
29 |
protected $blocks;
|
30 |
|
31 |
+
/**
|
32 |
+
* put your comment there...
|
33 |
+
*
|
34 |
+
* @var mixed
|
35 |
+
*/
|
36 |
+
protected $templates;
|
37 |
+
|
38 |
/**
|
39 |
* put your comment there...
|
40 |
*
|
41 |
*/
|
42 |
public function __construct() {
|
43 |
// Import dependencies!
|
44 |
+
cssJSToolbox::import('includes:installer:upgrade:block.class.php', 'includes:installer:upgrade:template.class.php');
|
45 |
// Load blocks into installer iterator!
|
46 |
$this->blocks = $this->getBlocksIterator(get_option(self::BLOCKS_POINTER));
|
47 |
+
// Load templates into templates iterator!
|
48 |
+
$driver = cssJSToolbox::getInstance()->getDBDriver();
|
49 |
+
$templates = $driver->select('SELECT title as `name`, type, `code` FROM ' . self::TEMPLATES_TABLE . ';', ARRAY_A);
|
50 |
+
$this->templates = new CJTInstallerTemplate($templates);
|
51 |
}
|
52 |
|
53 |
/**
|
110 |
*/
|
111 |
protected abstract function getBlocksIterator($blocks);
|
112 |
|
113 |
+
/**
|
114 |
+
* put your comment there...
|
115 |
+
*
|
116 |
+
*/
|
117 |
+
public function templates() {
|
118 |
+
// Tranform templates to the new table!
|
119 |
+
foreach ($this->templates as $template) {
|
120 |
+
$this->templates->upgrade();
|
121 |
+
}
|
122 |
+
// Chaining!
|
123 |
+
return $this;
|
124 |
+
}
|
125 |
+
|
126 |
} // End class.
|
includes/templates/templates.class.php
ADDED
@@ -0,0 +1,43 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @version $ Id; ?FILE_NAME ?DATE ?TIME ?AUTHOR $
|
4 |
+
*/
|
5 |
+
|
6 |
+
// Disallow direct access.
|
7 |
+
defined('ABSPATH') or die("Access denied");
|
8 |
+
|
9 |
+
/**
|
10 |
+
*
|
11 |
+
*/
|
12 |
+
abstract class CJTTemplates {
|
13 |
+
|
14 |
+
/**
|
15 |
+
* Get templates types mapped by extensions of the type file.
|
16 |
+
*
|
17 |
+
* @return array
|
18 |
+
*/
|
19 |
+
public static function getExtensionTypeMap() {
|
20 |
+
// Initialize!
|
21 |
+
static $map = null;
|
22 |
+
if (!$map) {
|
23 |
+
// Us extension as key and type-name as value.
|
24 |
+
foreach (cssJSToolbox::$config->templates->types as $type => $data) {
|
25 |
+
$map[$data->extension] = $type;
|
26 |
+
}
|
27 |
+
}
|
28 |
+
return $map;
|
29 |
+
}
|
30 |
+
|
31 |
+
/**
|
32 |
+
* Get template type extension name.
|
33 |
+
*
|
34 |
+
* @param mixed $typeName
|
35 |
+
*/
|
36 |
+
public static function getExtensionType($extension) {
|
37 |
+
// Get extensions->types map.
|
38 |
+
$map = self::getExtensionTypeMap();
|
39 |
+
// Return Type if Extension exists or FALSE otherwise.
|
40 |
+
return isset($map[$extension]) ? $map[$extension] : FALSE;
|
41 |
+
}
|
42 |
+
|
43 |
+
} // End class.
|
locals/languages/css-javascript-toolbox-en_US.mo
CHANGED
Binary file
|
locals/languages/css-javascript-toolbox-en_US.po
CHANGED
@@ -1,8 +1,8 @@
|
|
1 |
msgid ""
|
2 |
msgstr ""
|
3 |
-
"Project-Id-Version: CSS & Javascript Toolbox
|
4 |
-
"POT-Creation-Date: 2014-
|
5 |
-
"PO-Revision-Date: 2014-
|
6 |
"Last-Translator: \n"
|
7 |
"Language-Team: CJT <development@css-javascript-toolbox.com>\n"
|
8 |
"Language: English\n"
|
@@ -13,24 +13,77 @@ msgstr ""
|
|
13 |
"X-Poedit-KeywordsList: getText\n"
|
14 |
"X-Poedit-Basepath: .\n"
|
15 |
"X-Poedit-SourceCharset: UTF-8\n"
|
16 |
-
"X-Poedit-SearchPath-0:"
|
17 |
|
18 |
-
#: access.points/extensions.accesspoint.php:53
|
19 |
msgid "Extensions"
|
20 |
msgstr ""
|
21 |
|
22 |
-
#: access.points/manage.accesspoint.php:44
|
23 |
-
#: access.points/manage.accesspoint.php:45
|
24 |
-
#: views/setup/activation-form/tmpl/default.html.tmpl:28
|
25 |
msgid "CSS & Javascript Toolbox"
|
26 |
msgstr ""
|
27 |
|
28 |
-
#:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
29 |
msgid ""
|
30 |
"Could not find block specified! Please check out the Shortcode parameters."
|
31 |
msgstr ""
|
32 |
|
33 |
-
#: framework/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
34 |
msgid ""
|
35 |
"CJT detects incompatible installed extensions and must be updated. "
|
36 |
"Extensions are listed below.\n"
|
@@ -42,7 +95,7 @@ msgid ""
|
|
42 |
"please visit CJT website by clicking extension links below."
|
43 |
msgstr ""
|
44 |
|
45 |
-
#: framework/js/ajax/cjt-server/cjt-server.localization.php:13
|
46 |
msgid ""
|
47 |
"Unhandled error has been detected while processing the background request! \n"
|
48 |
"\tas the error is not handled we cannot tell if the previous operation is "
|
@@ -54,7 +107,7 @@ msgid ""
|
|
54 |
"\tWould you like to check the error details?"
|
55 |
msgstr ""
|
56 |
|
57 |
-
#: framework/js/ajax/cjt-server/cjt-server.localization.php:17
|
58 |
msgid ""
|
59 |
"Its heighly recomended to send us the error details so we can enahce CJT "
|
60 |
"products!\n"
|
@@ -63,209 +116,552 @@ msgid ""
|
|
63 |
"\tWould you like to close the form?"
|
64 |
msgstr ""
|
65 |
|
66 |
-
#: framework/js/misc/simple-error-dialog/simple-error-dialog.localization.php:13
|
67 |
msgid "Submission Error!"
|
68 |
msgstr ""
|
69 |
|
70 |
-
#:
|
71 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
72 |
msgid "javascript"
|
73 |
msgstr "Javascript"
|
74 |
|
75 |
-
#: locals/strings.inc.php:
|
|
|
76 |
msgid "css"
|
77 |
msgstr "CSS"
|
78 |
|
79 |
-
#: locals/strings.inc.php:
|
|
|
80 |
msgid "html"
|
81 |
msgstr "HTML"
|
82 |
|
83 |
-
#: locals/strings.inc.php:
|
|
|
84 |
msgid "php"
|
85 |
msgstr "PHP"
|
86 |
|
87 |
-
#: models/
|
|
|
|
|
|
|
|
|
88 |
msgid "Blog Index"
|
89 |
msgstr ""
|
90 |
|
91 |
-
#: models/block/assignmentpanel/helpers/auxiliary.php:26
|
92 |
msgid "All Posts"
|
93 |
msgstr ""
|
94 |
|
95 |
-
#: models/block/assignmentpanel/helpers/auxiliary.php:27
|
96 |
msgid "All Pages"
|
97 |
msgstr ""
|
98 |
|
99 |
-
#: models/block/assignmentpanel/helpers/auxiliary.php:28
|
100 |
msgid "All Categories"
|
101 |
msgstr ""
|
102 |
|
103 |
-
#: models/block/assignmentpanel/helpers/auxiliary.php:29
|
104 |
msgid "Recent Posts"
|
105 |
msgstr ""
|
106 |
|
107 |
-
#: models/block/assignmentpanel/helpers/auxiliary.php:30
|
108 |
msgid "Entire Website"
|
109 |
msgstr ""
|
110 |
|
111 |
-
#: models/block/assignmentpanel/helpers/auxiliary.php:31
|
112 |
msgid "Website Backend"
|
113 |
msgstr ""
|
114 |
|
115 |
-
#: models/block/assignmentpanel/helpers/auxiliary.php:32
|
116 |
msgid "Search Pages"
|
117 |
msgstr ""
|
118 |
|
119 |
-
#: models/block/assignmentpanel/helpers/auxiliary.php:33
|
120 |
msgid "All Archives"
|
121 |
msgstr ""
|
122 |
|
123 |
-
#: models/block/assignmentpanel/helpers/auxiliary.php:34
|
124 |
msgid "Tag Archives"
|
125 |
msgstr ""
|
126 |
|
127 |
-
#: models/block/assignmentpanel/helpers/auxiliary.php:35
|
128 |
msgid "Author Archives"
|
129 |
msgstr ""
|
130 |
|
131 |
-
#: models/block/assignmentpanel/helpers/auxiliary.php:36
|
132 |
msgid "Attachment Pages"
|
133 |
msgstr ""
|
134 |
|
135 |
-
#: models/block/assignmentpanel/helpers/auxiliary.php:37
|
136 |
msgid "404 Error"
|
137 |
msgstr ""
|
138 |
|
139 |
-
#: views/backups/manager/public/js/backups/backups.localization.php:11
|
140 |
msgid "Backup name cannot be null!"
|
141 |
msgstr ""
|
142 |
|
143 |
-
#: views/backups/manager/public/js/backups/backups.localization.php:12
|
144 |
msgid "Would you like to delete \"{BACKUP-NAME}\" backup?"
|
145 |
msgstr ""
|
146 |
|
147 |
-
#: views/blocks/block/view.php:
|
148 |
msgid "Click to update Block name"
|
149 |
msgstr ""
|
150 |
|
151 |
-
#: views/blocks/block/public/js/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
152 |
msgid "Block revisions"
|
153 |
msgstr ""
|
154 |
|
155 |
-
#: views/blocks/block/public/js/jquery.block/jquery.block.localization.php:14
|
156 |
msgid "CJT-Block Info"
|
157 |
msgstr ""
|
158 |
|
159 |
-
#: views/blocks/block/public/js/jquery.block/jquery.block.localization.php:15
|
160 |
#, php-format
|
161 |
msgid "Are you sure you want to delete this (%s) code block?"
|
162 |
msgstr ""
|
163 |
|
164 |
-
#: views/blocks/block/public/js/jquery.block/jquery.block.localization.php:16
|
165 |
msgid "Deactivate (turn off) code block"
|
166 |
msgstr ""
|
167 |
|
168 |
-
#: views/blocks/block/public/js/jquery.block/jquery.block.localization.php:17
|
169 |
msgid "Activate (turn on) code block"
|
170 |
msgstr ""
|
171 |
|
172 |
-
#: views/blocks/block/public/js/jquery.block/jquery.block.localization.php:18
|
173 |
msgid "Set output location hook to footer"
|
174 |
msgstr ""
|
175 |
|
176 |
-
#: views/blocks/block/public/js/jquery.block/jquery.block.localization.php:19
|
177 |
msgid "Set output location hook to header"
|
178 |
msgstr ""
|
179 |
|
180 |
-
#: views/blocks/block/public/js/jquery.block/jquery.block.localization.php:20
|
181 |
msgid "Invalid block name"
|
182 |
msgstr ""
|
183 |
|
184 |
-
#: views/blocks/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
185 |
msgid "Create New Code Block"
|
186 |
msgstr ""
|
187 |
|
188 |
-
#: views/blocks/manager/public/js/blocks-page/blocks-page.localization.php:14
|
|
|
|
|
|
|
|
|
|
|
189 |
msgid "Backups"
|
190 |
msgstr ""
|
191 |
|
192 |
-
#: views/blocks/manager/public/js/blocks-page/blocks-page.localization.php:
|
193 |
msgid "Restoring blocks backup will result in losing all the current blocks."
|
194 |
msgstr ""
|
195 |
|
196 |
-
#: views/blocks/manager/public/js/blocks-page/blocks-page.localization.php:
|
197 |
msgid "Are you sure, you'd like to continue?"
|
198 |
msgstr ""
|
199 |
|
200 |
-
#: views/blocks/manager/public/js/blocks-page/blocks-page.localization.php:
|
201 |
msgid "Backup could not be restored"
|
202 |
msgstr ""
|
203 |
|
204 |
-
#: views/blocks/manager/public/js/blocks-page/blocks-page.localization.php:
|
|
|
|
|
|
|
|
|
205 |
#, php-format
|
206 |
msgid "You're about to delete %d code block(s)."
|
207 |
msgstr ""
|
208 |
|
209 |
-
#: views/blocks/manager/public/js/blocks-page/blocks-page.localization.php:
|
210 |
msgid "Are you sure you want to delete all code blocks?"
|
211 |
msgstr ""
|
212 |
|
213 |
-
#: views/blocks/manager/public/js/blocks-page/blocks-page.localization.php:
|
214 |
msgid "Are you sure you want to delete all the empty code blocks?"
|
215 |
msgstr ""
|
216 |
|
217 |
-
#: views/blocks/manager/public/js/blocks-page/blocks-page.localization.php:
|
218 |
msgid "The changes you made will be lost if you navigate away from this page."
|
219 |
msgstr ""
|
220 |
|
221 |
-
#: views/blocks/manager/public/js/blocks-page/blocks-page.localization.php:
|
222 |
msgid "There is no blocks to delete!"
|
223 |
msgstr ""
|
224 |
|
225 |
-
#: views/blocks/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
226 |
msgid "block"
|
227 |
msgstr ""
|
228 |
|
229 |
-
#: views/blocks/new/public/js/add-new-block/add-new-block.localization.php:14
|
230 |
msgid "code block"
|
231 |
msgstr ""
|
232 |
|
233 |
-
#: views/extensions/plugins-list/public/js/default/default.localization.php:13
|
234 |
msgid "CJT Extension License Activation Form"
|
235 |
msgstr ""
|
236 |
|
237 |
-
#: views/extensions/plugins-list/public/js/extensions/extensions.localization.php:13
|
238 |
-
#: views/extensions/plugins-list/public/js/plugins/plugins.localization.php:13
|
239 |
msgid "CJT Extensions"
|
240 |
msgstr ""
|
241 |
|
242 |
-
#: views/installer/install/public/js/default/default.localization.php:13
|
243 |
msgid "Start"
|
244 |
msgstr ""
|
245 |
|
246 |
-
#: views/installer/install/public/js/default/default.localization.php:14
|
247 |
msgid "Installation Completed ... Click Start button and have fun!!!"
|
248 |
msgstr ""
|
249 |
|
250 |
-
#: views/installer/install/public/js/default/default.localization.php:15
|
251 |
msgid ""
|
252 |
"The installation process would just take several minutes!\n"
|
253 |
"\n"
|
254 |
"\tWould you like to start the installation process?"
|
255 |
msgstr ""
|
256 |
|
257 |
-
#: views/installer/notice/public/js/default/default.localization.php:13
|
258 |
msgid ""
|
259 |
"The notice message wont displayed again! You still can install/upgrade the "
|
260 |
"Plugin by going to the manage blocks page. Would you really like to dismis "
|
261 |
"this notice?"
|
262 |
msgstr ""
|
263 |
|
264 |
-
#: views/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
265 |
msgid "Uninstall"
|
266 |
msgstr ""
|
267 |
|
268 |
-
#: views/
|
|
|
|
|
|
|
|
|
269 |
msgid ""
|
270 |
"External request need to be made to to css-javascript-toolbox offical web "
|
271 |
"site! The operation will take an effect once its successed! You can always "
|
@@ -275,7 +671,7 @@ msgid ""
|
|
275 |
"\t\t\t\t\t\t\tAre you sure would you like to process?"
|
276 |
msgstr ""
|
277 |
|
278 |
-
#: views/setup/activation-form/public/js/default/default.localization.php:15
|
279 |
msgid ""
|
280 |
"External request need to be made to to css-javascript-toolbox offical web "
|
281 |
"site! The operation will take an effect once its successed! You can always "
|
@@ -285,7 +681,7 @@ msgid ""
|
|
285 |
"\t\t\t\t\t\t\tAre you sure would you like to process?"
|
286 |
msgstr ""
|
287 |
|
288 |
-
#: views/setup/activation-form/public/js/default/default.localization.php:17
|
289 |
msgid ""
|
290 |
"The reset operation will clear the license fields and clear component "
|
291 |
"license cache! This is really great once you need to stop using a previously "
|
@@ -294,296 +690,595 @@ msgid ""
|
|
294 |
"anytime later!"
|
295 |
msgstr ""
|
296 |
|
297 |
-
#: views/setup/activation-form/public/js/default/default.localization.php:19
|
|
|
298 |
msgid "Activate"
|
299 |
msgstr ""
|
300 |
|
301 |
-
#: views/setup/activation-form/public/js/default/default.localization.php:20
|
302 |
msgid "Deactivate"
|
303 |
msgstr ""
|
304 |
|
305 |
-
#: views/setup/activation-form/public/js/default/default.localization.php:22
|
306 |
msgid "Activating Key"
|
307 |
msgstr ""
|
308 |
|
309 |
-
#: views/setup/activation-form/public/js/default/default.localization.php:23
|
310 |
msgid "Deactivating key"
|
311 |
msgstr ""
|
312 |
|
313 |
-
#: views/setup/activation-form/public/js/default/default.localization.php:24
|
314 |
msgid "Checking Key"
|
315 |
msgstr ""
|
316 |
|
317 |
-
#: views/setup/activation-form/public/js/default/default.localization.php:25
|
318 |
msgid "Key is not activated/used yet"
|
319 |
msgstr ""
|
320 |
|
321 |
-
#: views/setup/activation-form/public/js/default/default.localization.php:26
|
322 |
msgid "Key is inactive"
|
323 |
msgstr ""
|
324 |
|
325 |
-
#: views/setup/activation-form/public/js/default/default.localization.php:27
|
326 |
msgid "Reseting License Information"
|
327 |
msgstr ""
|
328 |
|
329 |
-
#: views/setup/activation-form/public/js/default/default.localization.php:29
|
330 |
msgid "Invalid"
|
331 |
msgstr ""
|
332 |
|
333 |
-
#: views/setup/activation-form/public/js/default/default.localization.php:30
|
334 |
msgid "Valid"
|
335 |
msgstr ""
|
336 |
|
337 |
-
#: views/setup/activation-form/public/js/default/default.localization.php:31
|
338 |
msgid "Error"
|
339 |
msgstr ""
|
340 |
|
341 |
-
#: views/setup/activation-form/public/js/default/default.localization.php:32
|
342 |
msgid "Activated"
|
343 |
msgstr ""
|
344 |
|
345 |
-
#: views/setup/activation-form/public/js/default/default.localization.php:33
|
346 |
msgid "Deactivated"
|
347 |
msgstr ""
|
348 |
|
349 |
-
#: views/setup/activation-form/public/js/default/default.localization.php:34
|
350 |
msgid "Reseted"
|
351 |
msgstr ""
|
352 |
|
353 |
-
#: views/setup/activation-form/public/js/default/default.localization.php:37
|
354 |
msgid "License key is activate! Thank you!"
|
355 |
msgstr ""
|
356 |
|
357 |
-
#: views/setup/activation-form/public/js/default/default.localization.php:38
|
358 |
msgid "License Cache has been reseted!"
|
359 |
msgstr ""
|
360 |
|
361 |
-
#: views/setup/activation-form/public/js/default/default.localization.php:40
|
362 |
msgid "License key is activated!"
|
363 |
msgstr ""
|
364 |
|
365 |
-
#: views/setup/activation-form/public/js/default/default.localization.php:41
|
366 |
msgid "Could not activate the provided license key!"
|
367 |
msgstr ""
|
368 |
|
369 |
-
#: views/setup/activation-form/public/js/default/default.localization.php:42
|
370 |
msgid "Could not activate License Key due to the server error!"
|
371 |
msgstr ""
|
372 |
|
373 |
-
#: views/setup/activation-form/public/js/default/default.localization.php:44
|
374 |
msgid "The license key is deactivated!"
|
375 |
msgstr ""
|
376 |
|
377 |
-
#: views/setup/activation-form/public/js/default/default.localization.php:45
|
378 |
msgid "Could not deactivate the provided license key!"
|
379 |
msgstr ""
|
380 |
|
381 |
-
#: views/setup/activation-form/public/js/default/default.localization.php:46
|
382 |
msgid "Could not deactivate License Key due to the server error!"
|
383 |
msgstr ""
|
384 |
|
385 |
-
#: views/setup/activation-form/public/js/default/default.localization.php:48
|
386 |
msgid "The ckeck operation detects that the provided key is a valid key!"
|
387 |
msgstr ""
|
388 |
|
389 |
-
#: views/setup/activation-form/public/js/default/default.localization.php:49
|
390 |
msgid "The check operation detects that the provided key is an invalid key!"
|
391 |
msgstr ""
|
392 |
|
393 |
-
#: views/setup/activation-form/public/js/default/default.localization.php:50
|
394 |
msgid "Could not check License Key due to the server error!"
|
395 |
msgstr ""
|
396 |
|
397 |
-
#: views/setup/activation-form/public/js/default/default.localization.php:51
|
398 |
msgid ""
|
399 |
"The ckeck operation detects that the provided key is a valid key! The key is "
|
400 |
"not being activated yet."
|
401 |
msgstr ""
|
402 |
|
403 |
-
#: views/setup/activation-form/public/js/default/default.localization.php:52
|
404 |
msgid ""
|
405 |
"The ckeck operation detects that the provided key is a valid key! The "
|
406 |
"license key need to be activated from the CJT Website."
|
407 |
msgstr ""
|
408 |
|
409 |
-
#: views/setup/activation-form/public/js/default/default.localization.php:54
|
410 |
msgid "Reset"
|
411 |
msgstr ""
|
412 |
|
413 |
-
#: views/setup/activation-form/public/js/default/default.localization.php:56
|
414 |
msgid "Invalid License name!"
|
415 |
msgstr ""
|
416 |
|
417 |
-
#: views/setup/activation-form/public/js/default/default.localization.php:57
|
418 |
msgid "Invalid License key!"
|
419 |
msgstr ""
|
420 |
|
421 |
-
#: views/setup/activation-form/public/js/default/default.localization.php:58
|
422 |
msgid "Component name is absolute!!! Invalid Request Specified!!!"
|
423 |
msgstr ""
|
424 |
|
425 |
-
#: views/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
426 |
msgid ""
|
427 |
"Write backup name and click Backup button to create backup from current "
|
428 |
"blocks"
|
429 |
msgstr ""
|
430 |
|
431 |
-
#: views/backups/manager/tmpl/list.html.tmpl:3
|
432 |
msgid ""
|
433 |
"There is no backups available! You can start creating new backups from the "
|
434 |
"form above."
|
435 |
msgstr ""
|
436 |
|
437 |
-
#: views/backups/manager/tmpl/single-backup.html.tmpl:16
|
|
|
438 |
msgid "By"
|
439 |
msgstr ""
|
440 |
|
441 |
-
#: views/blocks/block/tmpl/edit.html.tmpl:12
|
442 |
msgid "Cancel editing code block title"
|
443 |
msgstr ""
|
444 |
|
445 |
-
#: views/blocks/block/tmpl/edit.html.tmpl:13
|
446 |
msgid "Save code block title"
|
447 |
msgstr ""
|
448 |
|
449 |
-
#: views/blocks/block/tmpl/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
450 |
msgid "Show code block information"
|
451 |
msgstr ""
|
452 |
|
453 |
-
#: views/blocks/block/tmpl/templates/toolbox.html.tmpl:
|
454 |
msgid "Set editing language for syntax highlighting"
|
455 |
msgstr ""
|
456 |
|
457 |
-
#: views/blocks/block/tmpl/templates/toolbox.html.tmpl:
|
458 |
msgid "Set editing language to CSS"
|
459 |
msgstr ""
|
460 |
|
461 |
-
#: views/blocks/block/tmpl/templates/toolbox.html.tmpl:
|
462 |
msgid "Cascading Style Sheets"
|
463 |
msgstr ""
|
464 |
|
465 |
-
#: views/blocks/block/tmpl/templates/toolbox.html.tmpl:
|
466 |
msgid "Set editing language to HTML"
|
467 |
msgstr ""
|
468 |
|
469 |
-
#: views/blocks/block/tmpl/templates/toolbox.html.tmpl:
|
470 |
msgid "Hyper Text Markup Language"
|
471 |
msgstr ""
|
472 |
|
473 |
-
#: views/blocks/block/tmpl/templates/toolbox.html.tmpl:
|
474 |
msgid "Set editing language to JavaScript"
|
475 |
msgstr ""
|
476 |
|
477 |
-
#: views/blocks/block/tmpl/templates/toolbox.html.tmpl:
|
478 |
msgid "Set editing language to PHP"
|
479 |
msgstr ""
|
480 |
|
481 |
-
#: views/blocks/block/tmpl/templates/toolbox.html.tmpl:
|
482 |
msgid "PHP: Hypertext Preprocessor"
|
483 |
msgstr ""
|
484 |
|
485 |
-
#: views/blocks/block/tmpl/templates/toolbox.html.tmpl:
|
486 |
msgid "Edit code block title. Click Save to take affect"
|
487 |
msgstr ""
|
488 |
|
489 |
-
#: views/blocks/block/tmpl/templates/toolbox.html.tmpl:
|
490 |
-
msgid "
|
491 |
msgstr ""
|
492 |
|
493 |
-
#: views/blocks/block/tmpl/templates/toolbox.html.tmpl:
|
494 |
-
msgid "
|
495 |
msgstr ""
|
496 |
|
497 |
-
#: views/blocks/block/tmpl/templates/toolbox.html.tmpl:
|
498 |
-
msgid "Save"
|
499 |
msgstr ""
|
500 |
|
501 |
-
#: views/blocks/cjt-block/tmpl/templates/assign-panel/default.html.tmpl:7
|
502 |
msgid "Pages"
|
503 |
msgstr ""
|
504 |
|
505 |
-
#: views/blocks/cjt-block/tmpl/templates/assign-panel/default.html.tmpl:14
|
506 |
msgid "Posts"
|
507 |
msgstr ""
|
508 |
|
509 |
-
#: views/blocks/cjt-block/tmpl/templates/assign-panel/default.html.tmpl:21
|
510 |
-
msgid "
|
511 |
msgstr ""
|
512 |
|
513 |
-
#: views/blocks/cjt-block/tmpl/templates/assign-panel/default.html.tmpl:
|
514 |
-
msgid "
|
515 |
msgstr ""
|
516 |
|
517 |
-
#: views/blocks/cjt-block/tmpl/templates/assign-panel/default.html.tmpl:32
|
518 |
msgid "Auxiliary"
|
519 |
msgstr ""
|
520 |
|
521 |
-
#: views/blocks/cjt-block/tmpl/templates/assign-panel/default.html.tmpl:39
|
522 |
msgid "Advanced"
|
523 |
msgstr ""
|
524 |
|
525 |
-
#: views/blocks/cjt-block/tmpl/templates/assign-panel/templates/advanced.html.tmpl:2
|
526 |
msgid "One URL per line"
|
527 |
msgstr ""
|
528 |
|
529 |
-
#: views/blocks/cjt-block/tmpl/templates/assign-panel/templates/advanced.html.tmpl:2
|
530 |
msgid "URLs"
|
531 |
msgstr ""
|
532 |
|
533 |
-
#: views/blocks/cjt-block/tmpl/templates/assign-panel/templates/advanced.html.tmpl:6
|
534 |
msgid "One Expression per line"
|
535 |
msgstr ""
|
536 |
|
537 |
-
#: views/blocks/cjt-block/tmpl/templates/assign-panel/templates/advanced.html.tmpl:6
|
538 |
msgid "Expressions"
|
539 |
msgstr ""
|
540 |
|
541 |
-
#: views/blocks/cjt-block/tmpl/templates/assign-panel/templates/auxiliarity.html.tmpl:6
|
542 |
msgid "Front Page"
|
543 |
msgstr ""
|
544 |
|
545 |
-
#: views/blocks/cjt-block/tmpl/templates/assign-panel/templates/custom-posts.html.tmpl:
|
546 |
msgid "There are no Custom Posts Defined yet!"
|
547 |
msgstr ""
|
548 |
|
549 |
-
#: views/blocks/
|
550 |
-
msgid "
|
551 |
msgstr ""
|
552 |
|
553 |
-
#: views/blocks/
|
554 |
-
#: views/
|
555 |
-
msgid "
|
556 |
msgstr ""
|
557 |
|
558 |
-
#: views/blocks/
|
559 |
-
msgid "
|
560 |
msgstr ""
|
561 |
|
562 |
-
#: views/blocks/
|
563 |
-
msgid "
|
|
|
|
|
|
|
564 |
msgstr ""
|
565 |
|
566 |
-
#: views/blocks/
|
567 |
-
msgid "
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
568 |
msgstr ""
|
569 |
|
570 |
-
#: views/blocks/info/tmpl/default.html.tmpl:8
|
571 |
msgid "Shortcode"
|
572 |
msgstr ""
|
573 |
|
574 |
-
#: views/blocks/manager/tmpl/blocks.html.tmpl:
|
575 |
-
msgid "CSS & Javascript Toolbox
|
576 |
msgstr ""
|
577 |
|
578 |
-
#: views/blocks/manager/tmpl/blocks.html.tmpl:
|
579 |
-
msgid "
|
580 |
msgstr ""
|
581 |
|
582 |
-
#: views/blocks/manager/tmpl/blocks.html.tmpl:
|
583 |
-
msgid "
|
584 |
msgstr ""
|
585 |
|
586 |
-
#: views/blocks/manager/tmpl/blocks.html.tmpl:
|
587 |
msgid ""
|
588 |
"You have now restored the code blocks from the current backup. Nothing is "
|
589 |
"saved until you click \"Restore\" button. To revert back to the previous "
|
@@ -591,51 +1286,142 @@ msgid ""
|
|
591 |
"button."
|
592 |
msgstr ""
|
593 |
|
594 |
-
#: views/blocks/manager/tmpl/
|
595 |
-
msgid "Warning!"
|
596 |
-
msgstr ""
|
597 |
-
|
598 |
-
#: views/blocks/manager/tmpl/blocks.html.tmpl:38
|
599 |
-
msgid ""
|
600 |
-
"Please make sure to validate added CSS & JavaScript codes, the plugin "
|
601 |
-
"doesn't do that for you!"
|
602 |
-
msgstr ""
|
603 |
-
|
604 |
-
#: views/blocks/manager/tmpl/toolbox.html.tmpl:3
|
605 |
msgid "Add new code block"
|
606 |
msgstr ""
|
607 |
|
608 |
-
#: views/blocks/manager/tmpl/toolbox.html.tmpl:3
|
609 |
msgid "New Code Block"
|
610 |
msgstr ""
|
611 |
|
612 |
-
#: views/blocks/manager/tmpl/toolbox.html.tmpl:4
|
613 |
msgid "Save changes to all code blocks"
|
614 |
msgstr ""
|
615 |
|
616 |
-
#: views/blocks/manager/tmpl/toolbox.html.tmpl:4
|
617 |
msgid "Save All Changes"
|
618 |
msgstr ""
|
619 |
|
620 |
-
#: views/blocks/manager/tmpl/toolbox.html.tmpl:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
621 |
msgid "General plugin settings"
|
622 |
msgstr ""
|
623 |
|
624 |
-
#: views/blocks/manager/tmpl/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
625 |
msgid "Welcome to the CSS & JavaScript Toolbox dashboard"
|
626 |
msgstr ""
|
627 |
|
628 |
-
#: views/blocks/manager/tmpl/help/intro.html.tmpl:11
|
629 |
msgid ""
|
630 |
-
"Since you do not have any code blocks active, you can create a new
|
631 |
-
"block."
|
632 |
msgstr ""
|
633 |
|
634 |
-
#: views/blocks/manager/tmpl/help/intro.html.tmpl:12
|
635 |
msgid "Create a new Code Block"
|
636 |
msgstr ""
|
637 |
|
638 |
-
#: views/blocks/manager/tmpl/help/intro.html.tmpl:13
|
639 |
msgid ""
|
640 |
"You can add a new code block by clicking the New Code Block button. Once "
|
641 |
"your code block has been added, simply choose the editor you wish to work "
|
@@ -649,107 +1435,221 @@ msgid ""
|
|
649 |
"assigned webpage."
|
650 |
msgstr ""
|
651 |
|
652 |
-
#: views/blocks/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
653 |
msgid "Name or title of code block (must be unique and cannot be left blank)"
|
654 |
msgstr ""
|
655 |
|
656 |
-
#: views/blocks/new/tmpl/default.html.tmpl:28
|
657 |
-
msgid "
|
658 |
msgstr ""
|
659 |
|
660 |
-
#: views/blocks/new/tmpl/default.html.tmpl:
|
661 |
-
msgid "
|
662 |
msgstr ""
|
663 |
|
664 |
-
#: views/blocks/
|
665 |
-
msgid "
|
666 |
msgstr ""
|
667 |
|
668 |
-
#: views/blocks/
|
669 |
-
msgid "
|
670 |
msgstr ""
|
671 |
|
672 |
-
#: views/blocks/
|
673 |
-
msgid "
|
674 |
msgstr ""
|
675 |
|
676 |
-
#: views/
|
677 |
-
msgid "
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
678 |
msgstr ""
|
679 |
|
680 |
-
#: views/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
681 |
msgid ""
|
682 |
"In order to start using CJT Plugin you need first to install the Plugin."
|
683 |
msgstr ""
|
684 |
|
685 |
-
#: views/installer/install/tmpl/default.html.tmpl:25
|
686 |
msgid ""
|
687 |
"The installation process will create CJT database tables, build-it Database "
|
688 |
"records."
|
689 |
msgstr ""
|
690 |
|
691 |
-
#: views/installer/install/tmpl/default.html.tmpl:26
|
692 |
msgid "Check for previous version and if the upgrade process is needed."
|
693 |
msgstr ""
|
694 |
|
695 |
-
#: views/installer/install/tmpl/default.html.tmpl:27
|
696 |
msgid ""
|
697 |
"The Plugin is in disable state untill the installation process took place!"
|
698 |
msgstr ""
|
699 |
|
700 |
-
#: views/installer/install/tmpl/default.html.tmpl:28
|
701 |
msgid ""
|
702 |
"To utilize from the CJT functionality you must install the Plugin first!!"
|
703 |
msgstr ""
|
704 |
|
705 |
-
#: views/installer/install/tmpl/default.html.tmpl:30
|
706 |
msgid "Installing Version "
|
707 |
msgstr ""
|
708 |
|
709 |
-
#: views/installer/install/tmpl/default.html.tmpl:31
|
710 |
msgid ""
|
711 |
"When you install a new version of CJT for the first time or even upgrading "
|
712 |
"from old versions, a number of processes will happen, which will take "
|
713 |
"approximately 1 to 2 minutes. These processes include"
|
714 |
msgstr ""
|
715 |
|
716 |
-
#: views/installer/install/tmpl/default.html.tmpl:38
|
717 |
msgid "Create database tables."
|
718 |
msgstr ""
|
719 |
|
720 |
-
#: views/installer/install/tmpl/default.html.tmpl:39
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
721 |
msgid "Finalize Installation."
|
722 |
msgstr ""
|
723 |
|
724 |
-
#: views/installer/install/tmpl/upgrade.html.tmpl:13
|
725 |
msgid "Upgrading CJT Plugin"
|
726 |
msgstr ""
|
727 |
|
728 |
-
#: views/installer/install/tmpl/upgrade.html.tmpl:14
|
729 |
msgid ""
|
730 |
"Please wait while we upgrading CJT Plugin installation! This process would "
|
731 |
"take only a few seconds!"
|
732 |
msgstr ""
|
733 |
|
734 |
-
#: views/installer/install/tmpl/upgrade.html.tmpl:15
|
735 |
-
msgid "
|
|
|
736 |
msgstr ""
|
737 |
|
738 |
-
#: views/installer/install/tmpl/upgrade.html.tmpl:17
|
739 |
msgid "Upgrade"
|
740 |
msgstr ""
|
741 |
|
742 |
-
#: views/installer/install/tmpl/upgrades/upgrade.html.tmpl:10
|
743 |
msgid "Upgrading Plugin"
|
744 |
msgstr ""
|
745 |
|
746 |
-
#: views/installer/install/tmpl/upgrades/upgrade.html.tmpl:11
|
747 |
msgid ""
|
748 |
"The upgrade process time estimation cannot be preditected because its based "
|
749 |
"on the amount of data (blocks + other data) you've created."
|
750 |
msgstr ""
|
751 |
|
752 |
-
#: views/installer/install/tmpl/upgrades/upgrade.html.tmpl:12
|
753 |
msgid ""
|
754 |
"Important Note: It is highly recommended to upgrade the plugin using the "
|
755 |
"same administrator or user that was used to manage the code blocks. This "
|
@@ -757,82 +1657,204 @@ msgid ""
|
|
757 |
"logged in administrators or users' meta data."
|
758 |
msgstr ""
|
759 |
|
760 |
-
#: views/installer/install/tmpl/upgrades/upgrade.html.tmpl:
|
761 |
msgid "Finalize Upgrade."
|
762 |
msgstr ""
|
763 |
|
764 |
-
#: views/installer/notice/tmpl/default.html.tmpl:12
|
765 |
msgid ""
|
766 |
"CJT Plugin has been installed throught Wordpress Plugins manager page. In "
|
767 |
"order for CJT Plugin to work correctly you must install it throught"
|
768 |
msgstr ""
|
769 |
|
770 |
-
#: views/installer/notice/tmpl/default.html.tmpl:13
|
771 |
msgid "CJT-Instalaltion page."
|
772 |
msgstr ""
|
773 |
|
774 |
-
#: views/installer/notice/tmpl/default.html.tmpl:16
|
775 |
msgid "Please or you can go to the installation page directly through the"
|
776 |
msgstr ""
|
777 |
|
778 |
-
#: views/installer/notice/tmpl/default.html.tmpl:17
|
779 |
msgid "CSS & Javascript Toolbox page."
|
780 |
msgstr ""
|
781 |
|
782 |
-
#: views/installer/notice/tmpl/default.html.tmpl:19
|
783 |
msgid "Dismiss"
|
784 |
msgstr ""
|
785 |
|
786 |
-
#: views/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
787 |
msgid "Wipe out data!"
|
788 |
msgstr ""
|
789 |
|
790 |
-
#: views/setup/activation-form/tmpl/default.html.tmpl:25
|
791 |
msgid "License Key"
|
792 |
msgstr ""
|
793 |
|
794 |
-
#: views/setup/activation-form/tmpl/default.html.tmpl:27
|
795 |
msgid ""
|
796 |
"In order to get the benefits from the premium services we provide you've to "
|
797 |
"obtain your license key from"
|
798 |
msgstr ""
|
799 |
|
800 |
-
#: views/setup/activation-form/tmpl/default.html.tmpl:28
|
801 |
msgid "web site"
|
802 |
msgstr ""
|
803 |
|
804 |
-
#: views/setup/activation-form/tmpl/default.html.tmpl:32
|
805 |
msgid "Your Name"
|
806 |
msgstr ""
|
807 |
|
808 |
-
#: views/setup/activation-form/tmpl/default.html.tmpl:37
|
809 |
msgid "Key"
|
810 |
msgstr ""
|
811 |
|
812 |
-
#: views/setup/activation-form/tmpl/default.html.tmpl:46
|
813 |
msgid "Check"
|
814 |
msgstr ""
|
815 |
|
816 |
-
|
817 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
818 |
|
819 |
-
|
820 |
-
|
|
|
821 |
|
822 |
-
|
823 |
-
|
|
|
824 |
|
825 |
-
|
826 |
-
|
|
|
827 |
|
828 |
-
|
829 |
-
|
|
|
830 |
|
831 |
-
|
832 |
-
|
|
|
|
|
|
|
833 |
|
834 |
-
|
835 |
-
|
|
|
836 |
|
837 |
-
|
838 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
msgid ""
|
2 |
msgstr ""
|
3 |
+
"Project-Id-Version: CSS & Javascript Toolbox V6\n"
|
4 |
+
"POT-Creation-Date: 2014-03-07 21:20+0200\n"
|
5 |
+
"PO-Revision-Date: 2014-03-07 21:21+0200\n"
|
6 |
"Last-Translator: \n"
|
7 |
"Language-Team: CJT <development@css-javascript-toolbox.com>\n"
|
8 |
"Language: English\n"
|
13 |
"X-Poedit-KeywordsList: getText\n"
|
14 |
"X-Poedit-Basepath: .\n"
|
15 |
"X-Poedit-SourceCharset: UTF-8\n"
|
16 |
+
"X-Poedit-SearchPath-0: "
|
17 |
|
18 |
+
#: /access.points/extensions.accesspoint.php:53
|
19 |
msgid "Extensions"
|
20 |
msgstr ""
|
21 |
|
22 |
+
#: /access.points/manage.accesspoint.php:44
|
23 |
+
#: /access.points/manage.accesspoint.php:45
|
24 |
+
#: /views/setup/activation-form/tmpl/default.html.tmpl:28
|
25 |
msgid "CSS & Javascript Toolbox"
|
26 |
msgstr ""
|
27 |
|
28 |
+
#: /access.points/packages.accesspoint.php:45
|
29 |
+
msgid "CJT Manage - Packages"
|
30 |
+
msgstr ""
|
31 |
+
|
32 |
+
#: /access.points/packages.accesspoint.php:46
|
33 |
+
msgid "Packages"
|
34 |
+
msgstr ""
|
35 |
+
|
36 |
+
#: /access.points/setup.accesspoint.php:45
|
37 |
+
msgid "CSS & Javascript Toolbox - Setup"
|
38 |
+
msgstr ""
|
39 |
+
|
40 |
+
#: /access.points/setup.accesspoint.php:46
|
41 |
+
#: /views/extensions/plugins-list/tmpl/default_setup_action.html.tmpl:10
|
42 |
+
msgid "Setup"
|
43 |
+
msgstr ""
|
44 |
+
|
45 |
+
#: /controllers/metabox.php:57
|
46 |
+
#, php-format
|
47 |
+
msgid "CJT Block - Post #%d"
|
48 |
+
msgstr ""
|
49 |
+
|
50 |
+
#: /controllers/metabox.php:91
|
51 |
+
#: /controllers/metabox.php:170
|
52 |
+
msgid "CJT Block"
|
53 |
+
msgstr ""
|
54 |
+
|
55 |
+
#: /controllers/templates-lookup.php:81
|
56 |
+
#: /views/templates/lookup/tmpl/default.html.tmpl:40
|
57 |
+
msgid "Unlink"
|
58 |
+
msgstr ""
|
59 |
+
|
60 |
+
#: /controllers/templates-lookup.php:99
|
61 |
+
#: /controllers/templates-lookup.php:115
|
62 |
+
#: /views/blocks/manager/tmpl/help/intro.html.tmpl:25
|
63 |
+
#: /views/templates/lookup/tmpl/default.html.tmpl:42
|
64 |
+
msgid "Link"
|
65 |
+
msgstr ""
|
66 |
+
|
67 |
+
#: /controllers/tinymce-blocks.php:71
|
68 |
+
msgid "The requested Block doesnt has parameters form!"
|
69 |
+
msgstr ""
|
70 |
+
|
71 |
+
#: /controllers/coupling/shortcode/block/block.php:126
|
72 |
msgid ""
|
73 |
"Could not find block specified! Please check out the Shortcode parameters."
|
74 |
msgstr ""
|
75 |
|
76 |
+
#: /framework/developer/interface/block/parameters/types/list.php:43
|
77 |
+
#: /framework/developer/interface/block/parameters/types/structure.php:39
|
78 |
+
msgid "Invalid structure parameter passed!"
|
79 |
+
msgstr ""
|
80 |
+
|
81 |
+
#: /framework/developer/interface/block/shortcode/parameters/parameters.php:71
|
82 |
+
msgid ""
|
83 |
+
"Invalid Shortcode parameter(s) has been passed! Please check parameters name."
|
84 |
+
msgstr ""
|
85 |
+
|
86 |
+
#: /framework/extensions/extensions.class.php:305
|
87 |
msgid ""
|
88 |
"CJT detects incompatible installed extensions and must be updated. "
|
89 |
"Extensions are listed below.\n"
|
95 |
"please visit CJT website by clicking extension links below."
|
96 |
msgstr ""
|
97 |
|
98 |
+
#: /framework/js/ajax/cjt-server/cjt-server.localization.php:13
|
99 |
msgid ""
|
100 |
"Unhandled error has been detected while processing the background request! \n"
|
101 |
"\tas the error is not handled we cannot tell if the previous operation is "
|
107 |
"\tWould you like to check the error details?"
|
108 |
msgstr ""
|
109 |
|
110 |
+
#: /framework/js/ajax/cjt-server/cjt-server.localization.php:17
|
111 |
msgid ""
|
112 |
"Its heighly recomended to send us the error details so we can enahce CJT "
|
113 |
"products!\n"
|
116 |
"\tWould you like to close the form?"
|
117 |
msgstr ""
|
118 |
|
119 |
+
#: /framework/js/misc/simple-error-dialog/simple-error-dialog.localization.php:13
|
120 |
msgid "Submission Error!"
|
121 |
msgstr ""
|
122 |
|
123 |
+
#: /framework/view/block/parameter/renderer/imageslist/public/js/imageslist/imageslist.localization.php:13
|
124 |
+
msgid "Remove"
|
125 |
+
msgstr ""
|
126 |
+
|
127 |
+
#: /framework/view/block/parameter/renderer/imageslist/public/js/imageslist/imageslist.localization.php:14
|
128 |
+
msgid "Remove image?"
|
129 |
+
msgstr ""
|
130 |
+
|
131 |
+
#: /locals/strings.inc.php:9
|
132 |
+
#: /models/fields/template-states.php:22
|
133 |
+
#: /tables/template.php:62
|
134 |
+
#: /views/templates/manager/helpers/wp-list-table.inc.php:133
|
135 |
+
msgid "trash"
|
136 |
+
msgstr "Trash"
|
137 |
+
|
138 |
+
#: /locals/strings.inc.php:10
|
139 |
+
#: /models/fields/template-states.php:21
|
140 |
+
#: /tables/template.php:60
|
141 |
+
#: /views/templates/manager/helpers/wp-list-table.inc.php:134
|
142 |
+
msgid "draft"
|
143 |
+
msgstr "Draft"
|
144 |
+
|
145 |
+
#: /locals/strings.inc.php:11
|
146 |
+
#: /models/fields/template-states.php:20
|
147 |
+
#: /tables/template.php:61
|
148 |
+
#: /views/templates/manager/helpers/wp-list-table.inc.php:132
|
149 |
+
msgid "published"
|
150 |
+
msgstr "Published"
|
151 |
+
|
152 |
+
#: /locals/strings.inc.php:14
|
153 |
+
#: /models/fields/template-development-states.php:20
|
154 |
+
msgid "release"
|
155 |
+
msgstr "Release"
|
156 |
+
|
157 |
+
#: /locals/strings.inc.php:15
|
158 |
+
#: /models/fields/template-development-states.php:21
|
159 |
+
msgid "beta"
|
160 |
+
msgstr "Beta"
|
161 |
+
|
162 |
+
#: /locals/strings.inc.php:16
|
163 |
+
#: /models/fields/template-development-states.php:23
|
164 |
+
msgid "release-candidate"
|
165 |
+
msgstr "Release candidate"
|
166 |
+
|
167 |
+
#: /locals/strings.inc.php:17
|
168 |
+
#: /models/fields/template-development-states.php:22
|
169 |
+
msgid "alpha"
|
170 |
+
msgstr "Alpha"
|
171 |
+
|
172 |
+
#: /locals/strings.inc.php:18
|
173 |
+
#: /models/fields/template-development-states.php:24
|
174 |
+
msgid "revision"
|
175 |
+
msgstr "Revision"
|
176 |
+
|
177 |
+
#: /locals/strings.inc.php:21
|
178 |
+
#: /models/fields/template-types.php:21
|
179 |
+
#: /views/blocks/block/tmpl/templates/toolbox.html.tmpl:23
|
180 |
msgid "javascript"
|
181 |
msgstr "Javascript"
|
182 |
|
183 |
+
#: /locals/strings.inc.php:22
|
184 |
+
#: /models/fields/template-types.php:20
|
185 |
msgid "css"
|
186 |
msgstr "CSS"
|
187 |
|
188 |
+
#: /locals/strings.inc.php:23
|
189 |
+
#: /models/fields/template-types.php:22
|
190 |
msgid "html"
|
191 |
msgstr "HTML"
|
192 |
|
193 |
+
#: /locals/strings.inc.php:24
|
194 |
+
#: /models/fields/template-types.php:23
|
195 |
msgid "php"
|
196 |
msgstr "PHP"
|
197 |
|
198 |
+
#: /models/package-file.php:47
|
199 |
+
msgid "The uploaded package is already installed!"
|
200 |
+
msgstr ""
|
201 |
+
|
202 |
+
#: /models/block/assignmentpanel/helpers/auxiliary.php:25
|
203 |
msgid "Blog Index"
|
204 |
msgstr ""
|
205 |
|
206 |
+
#: /models/block/assignmentpanel/helpers/auxiliary.php:26
|
207 |
msgid "All Posts"
|
208 |
msgstr ""
|
209 |
|
210 |
+
#: /models/block/assignmentpanel/helpers/auxiliary.php:27
|
211 |
msgid "All Pages"
|
212 |
msgstr ""
|
213 |
|
214 |
+
#: /models/block/assignmentpanel/helpers/auxiliary.php:28
|
215 |
msgid "All Categories"
|
216 |
msgstr ""
|
217 |
|
218 |
+
#: /models/block/assignmentpanel/helpers/auxiliary.php:29
|
219 |
msgid "Recent Posts"
|
220 |
msgstr ""
|
221 |
|
222 |
+
#: /models/block/assignmentpanel/helpers/auxiliary.php:30
|
223 |
msgid "Entire Website"
|
224 |
msgstr ""
|
225 |
|
226 |
+
#: /models/block/assignmentpanel/helpers/auxiliary.php:31
|
227 |
msgid "Website Backend"
|
228 |
msgstr ""
|
229 |
|
230 |
+
#: /models/block/assignmentpanel/helpers/auxiliary.php:32
|
231 |
msgid "Search Pages"
|
232 |
msgstr ""
|
233 |
|
234 |
+
#: /models/block/assignmentpanel/helpers/auxiliary.php:33
|
235 |
msgid "All Archives"
|
236 |
msgstr ""
|
237 |
|
238 |
+
#: /models/block/assignmentpanel/helpers/auxiliary.php:34
|
239 |
msgid "Tag Archives"
|
240 |
msgstr ""
|
241 |
|
242 |
+
#: /models/block/assignmentpanel/helpers/auxiliary.php:35
|
243 |
msgid "Author Archives"
|
244 |
msgstr ""
|
245 |
|
246 |
+
#: /models/block/assignmentpanel/helpers/auxiliary.php:36
|
247 |
msgid "Attachment Pages"
|
248 |
msgstr ""
|
249 |
|
250 |
+
#: /models/block/assignmentpanel/helpers/auxiliary.php:37
|
251 |
msgid "404 Error"
|
252 |
msgstr ""
|
253 |
|
254 |
+
#: /views/backups/manager/public/js/backups/backups.localization.php:11
|
255 |
msgid "Backup name cannot be null!"
|
256 |
msgstr ""
|
257 |
|
258 |
+
#: /views/backups/manager/public/js/backups/backups.localization.php:12
|
259 |
msgid "Would you like to delete \"{BACKUP-NAME}\" backup?"
|
260 |
msgstr ""
|
261 |
|
262 |
+
#: /views/blocks/block/view.php:142
|
263 |
msgid "Click to update Block name"
|
264 |
msgstr ""
|
265 |
|
266 |
+
#: /views/blocks/block/public/js/codefile-manager/codefile-manager.localization.php:13
|
267 |
+
msgid ""
|
268 |
+
"{count} Code Files about to be deleted. Are you sure delete those Files?"
|
269 |
+
msgstr ""
|
270 |
+
|
271 |
+
#: /views/blocks/block/public/js/codefile-manager/codefile-manager.localization.php:14
|
272 |
+
msgid "Nothing selected!"
|
273 |
+
msgstr ""
|
274 |
+
|
275 |
+
#: /views/blocks/block/public/js/codefile-manager/codefile-manager.localization.php:15
|
276 |
+
msgid "Name cannot be null. Code File must has a unique name for each Block."
|
277 |
+
msgstr ""
|
278 |
+
|
279 |
+
#: /views/blocks/block/public/js/codefile-manager/codefile-manager.localization.php:16
|
280 |
+
msgid "Code File name is currently taken. Please choose another name."
|
281 |
+
msgstr ""
|
282 |
+
|
283 |
+
#: /views/blocks/block/public/js/jquery.block/jquery.block.localization.php:13
|
284 |
msgid "Block revisions"
|
285 |
msgstr ""
|
286 |
|
287 |
+
#: /views/blocks/block/public/js/jquery.block/jquery.block.localization.php:14
|
288 |
msgid "CJT-Block Info"
|
289 |
msgstr ""
|
290 |
|
291 |
+
#: /views/blocks/block/public/js/jquery.block/jquery.block.localization.php:15
|
292 |
#, php-format
|
293 |
msgid "Are you sure you want to delete this (%s) code block?"
|
294 |
msgstr ""
|
295 |
|
296 |
+
#: /views/blocks/block/public/js/jquery.block/jquery.block.localization.php:16
|
297 |
msgid "Deactivate (turn off) code block"
|
298 |
msgstr ""
|
299 |
|
300 |
+
#: /views/blocks/block/public/js/jquery.block/jquery.block.localization.php:17
|
301 |
msgid "Activate (turn on) code block"
|
302 |
msgstr ""
|
303 |
|
304 |
+
#: /views/blocks/block/public/js/jquery.block/jquery.block.localization.php:18
|
305 |
msgid "Set output location hook to footer"
|
306 |
msgstr ""
|
307 |
|
308 |
+
#: /views/blocks/block/public/js/jquery.block/jquery.block.localization.php:19
|
309 |
msgid "Set output location hook to header"
|
310 |
msgstr ""
|
311 |
|
312 |
+
#: /views/blocks/block/public/js/jquery.block/jquery.block.localization.php:20
|
313 |
msgid "Invalid block name"
|
314 |
msgstr ""
|
315 |
|
316 |
+
#: /views/blocks/block/public/js/jquery.block/jquery.block.localization.php:21
|
317 |
+
msgid "Revert code editor to default mode"
|
318 |
+
msgstr ""
|
319 |
+
|
320 |
+
#: /views/blocks/block/public/js/jquery.block/jquery.block.localization.php:22
|
321 |
+
msgid "Switch code editor to fullscreen mode"
|
322 |
+
msgstr ""
|
323 |
+
|
324 |
+
#: /views/blocks/block/public/js/jquery.block/jquery.block.localization.php:23
|
325 |
+
msgid ""
|
326 |
+
"Please enter a list of the external URLs you want to link separated by comma!"
|
327 |
+
msgstr ""
|
328 |
+
|
329 |
+
#: /views/blocks/block/public/js/jquery.block/jquery.block.localization.php:24
|
330 |
+
msgid "Couldn't link the externals URI you requested!! Reason:"
|
331 |
+
msgstr ""
|
332 |
+
|
333 |
+
#: /views/blocks/block/public/js/jquery.block/jquery.block.localization.php:25
|
334 |
+
msgid "Loading"
|
335 |
+
msgstr ""
|
336 |
+
|
337 |
+
#: /views/blocks/block/public/js/jquery.block/jquery.block.localization.php:27
|
338 |
+
msgid "Ambiance"
|
339 |
+
msgstr ""
|
340 |
+
|
341 |
+
#: /views/blocks/block/public/js/jquery.block/jquery.block.localization.php:28
|
342 |
+
msgid "Chaos"
|
343 |
+
msgstr ""
|
344 |
+
|
345 |
+
#: /views/blocks/block/public/js/jquery.block/jquery.block.localization.php:29
|
346 |
+
msgid "Chrome"
|
347 |
+
msgstr ""
|
348 |
+
|
349 |
+
#: /views/blocks/block/public/js/jquery.block/jquery.block.localization.php:30
|
350 |
+
msgid "Clouds"
|
351 |
+
msgstr ""
|
352 |
+
|
353 |
+
#: /views/blocks/block/public/js/jquery.block/jquery.block.localization.php:31
|
354 |
+
msgid "Clouds Midnight"
|
355 |
+
msgstr ""
|
356 |
+
|
357 |
+
#: /views/blocks/block/public/js/jquery.block/jquery.block.localization.php:32
|
358 |
+
msgid "Cobalt"
|
359 |
+
msgstr ""
|
360 |
+
|
361 |
+
#: /views/blocks/block/public/js/jquery.block/jquery.block.localization.php:33
|
362 |
+
msgid "Crimson Editor"
|
363 |
+
msgstr ""
|
364 |
+
|
365 |
+
#: /views/blocks/block/public/js/jquery.block/jquery.block.localization.php:34
|
366 |
+
msgid "Dawn"
|
367 |
+
msgstr ""
|
368 |
+
|
369 |
+
#: /views/blocks/block/public/js/jquery.block/jquery.block.localization.php:35
|
370 |
+
msgid "Dreamweaver"
|
371 |
+
msgstr ""
|
372 |
+
|
373 |
+
#: /views/blocks/block/public/js/jquery.block/jquery.block.localization.php:36
|
374 |
+
msgid "Eclipse"
|
375 |
+
msgstr ""
|
376 |
+
|
377 |
+
#: /views/blocks/block/public/js/jquery.block/jquery.block.localization.php:37
|
378 |
+
msgid "Github"
|
379 |
+
msgstr ""
|
380 |
+
|
381 |
+
#: /views/blocks/block/public/js/jquery.block/jquery.block.localization.php:38
|
382 |
+
msgid "Idle Fingers"
|
383 |
+
msgstr ""
|
384 |
+
|
385 |
+
#: /views/blocks/block/public/js/jquery.block/jquery.block.localization.php:39
|
386 |
+
msgid "Katzenmilch"
|
387 |
+
msgstr ""
|
388 |
+
|
389 |
+
#: /views/blocks/block/public/js/jquery.block/jquery.block.localization.php:40
|
390 |
+
msgid "Kr"
|
391 |
+
msgstr ""
|
392 |
+
|
393 |
+
#: /views/blocks/block/public/js/jquery.block/jquery.block.localization.php:41
|
394 |
+
msgid "Kuroir"
|
395 |
+
msgstr ""
|
396 |
+
|
397 |
+
#: /views/blocks/block/public/js/jquery.block/jquery.block.localization.php:42
|
398 |
+
msgid "Merbivore"
|
399 |
+
msgstr ""
|
400 |
+
|
401 |
+
#: /views/blocks/block/public/js/jquery.block/jquery.block.localization.php:43
|
402 |
+
msgid "Merbivore Soft"
|
403 |
+
msgstr ""
|
404 |
+
|
405 |
+
#: /views/blocks/block/public/js/jquery.block/jquery.block.localization.php:44
|
406 |
+
msgid "Mono Industrial"
|
407 |
+
msgstr ""
|
408 |
+
|
409 |
+
#: /views/blocks/block/public/js/jquery.block/jquery.block.localization.php:45
|
410 |
+
msgid "Monokai"
|
411 |
+
msgstr ""
|
412 |
+
|
413 |
+
#: /views/blocks/block/public/js/jquery.block/jquery.block.localization.php:46
|
414 |
+
msgid "Pastel On Dark"
|
415 |
+
msgstr ""
|
416 |
+
|
417 |
+
#: /views/blocks/block/public/js/jquery.block/jquery.block.localization.php:47
|
418 |
+
msgid "Solarized dark"
|
419 |
+
msgstr ""
|
420 |
+
|
421 |
+
#: /views/blocks/block/public/js/jquery.block/jquery.block.localization.php:48
|
422 |
+
msgid "Solarized Light"
|
423 |
+
msgstr ""
|
424 |
+
|
425 |
+
#: /views/blocks/block/public/js/jquery.block/jquery.block.localization.php:49
|
426 |
+
msgid "Terminal"
|
427 |
+
msgstr ""
|
428 |
+
|
429 |
+
#: /views/blocks/block/public/js/jquery.block/jquery.block.localization.php:50
|
430 |
+
msgid "Textmate"
|
431 |
+
msgstr ""
|
432 |
+
|
433 |
+
#: /views/blocks/block/public/js/jquery.block/jquery.block.localization.php:51
|
434 |
+
msgid "Tomorrow"
|
435 |
+
msgstr ""
|
436 |
+
|
437 |
+
#: /views/blocks/block/public/js/jquery.block/jquery.block.localization.php:52
|
438 |
+
msgid "Tomorrow Night"
|
439 |
+
msgstr ""
|
440 |
+
|
441 |
+
#: /views/blocks/block/public/js/jquery.block/jquery.block.localization.php:53
|
442 |
+
msgid "Tomorrow Night Blue"
|
443 |
+
msgstr ""
|
444 |
+
|
445 |
+
#: /views/blocks/block/public/js/jquery.block/jquery.block.localization.php:54
|
446 |
+
msgid "Tomorrow Night Bright"
|
447 |
+
msgstr ""
|
448 |
+
|
449 |
+
#: /views/blocks/block/public/js/jquery.block/jquery.block.localization.php:55
|
450 |
+
msgid "Tomorrow Night Eighties"
|
451 |
+
msgstr ""
|
452 |
+
|
453 |
+
#: /views/blocks/block/public/js/jquery.block/jquery.block.localization.php:56
|
454 |
+
msgid "Twilight"
|
455 |
+
msgstr ""
|
456 |
+
|
457 |
+
#: /views/blocks/block/public/js/jquery.block/jquery.block.localization.php:57
|
458 |
+
msgid "Vibrant Ink"
|
459 |
+
msgstr ""
|
460 |
+
|
461 |
+
#: /views/blocks/block/public/js/jquery.block/jquery.block.localization.php:58
|
462 |
+
msgid "XCode"
|
463 |
+
msgstr ""
|
464 |
+
|
465 |
+
#: /views/blocks/cjt-block/public/js/jquery.block/jquery.block.localization.php:13
|
466 |
+
msgid "Switch code editor to fullwidth mode (hides assignment panel)"
|
467 |
+
msgstr ""
|
468 |
+
|
469 |
+
#: /views/blocks/cjt-block/public/js/jquery.block/jquery.block.localization.php:14
|
470 |
+
msgid "Revert code editor to default mode (show assignment panel)"
|
471 |
+
msgstr ""
|
472 |
+
|
473 |
+
#: /views/blocks/cjt-block/public/js/jquery.block/jquery.block.localization.php:15
|
474 |
+
msgid ""
|
475 |
+
"Changes has been made to the assignment objects. Switching display mode "
|
476 |
+
"would reset all those changes as it never made. Would you like to discard "
|
477 |
+
"those changes"
|
478 |
+
msgstr ""
|
479 |
+
|
480 |
+
#: /views/blocks/create-metabox/public/js/metabox/metabox.localization.php:13
|
481 |
+
msgid "Would you like to create CJT block Metabox for this post?"
|
482 |
+
msgstr ""
|
483 |
+
|
484 |
+
#: /views/blocks/manager/public/js/blocks-page/blocks-page.localization.php:13
|
485 |
msgid "Create New Code Block"
|
486 |
msgstr ""
|
487 |
|
488 |
+
#: /views/blocks/manager/public/js/blocks-page/blocks-page.localization.php:14
|
489 |
+
msgid "General settings"
|
490 |
+
msgstr ""
|
491 |
+
|
492 |
+
#: /views/blocks/manager/public/js/blocks-page/blocks-page.localization.php:15
|
493 |
+
#: /views/blocks/manager/tmpl/toolbox.html.tmpl:35
|
494 |
msgid "Backups"
|
495 |
msgstr ""
|
496 |
|
497 |
+
#: /views/blocks/manager/public/js/blocks-page/blocks-page.localization.php:16
|
498 |
msgid "Restoring blocks backup will result in losing all the current blocks."
|
499 |
msgstr ""
|
500 |
|
501 |
+
#: /views/blocks/manager/public/js/blocks-page/blocks-page.localization.php:16
|
502 |
msgid "Are you sure, you'd like to continue?"
|
503 |
msgstr ""
|
504 |
|
505 |
+
#: /views/blocks/manager/public/js/blocks-page/blocks-page.localization.php:17
|
506 |
msgid "Backup could not be restored"
|
507 |
msgstr ""
|
508 |
|
509 |
+
#: /views/blocks/manager/public/js/blocks-page/blocks-page.localization.php:18
|
510 |
+
msgid "Templates Manager"
|
511 |
+
msgstr ""
|
512 |
+
|
513 |
+
#: /views/blocks/manager/public/js/blocks-page/blocks-page.localization.php:19
|
514 |
#, php-format
|
515 |
msgid "You're about to delete %d code block(s)."
|
516 |
msgstr ""
|
517 |
|
518 |
+
#: /views/blocks/manager/public/js/blocks-page/blocks-page.localization.php:20
|
519 |
msgid "Are you sure you want to delete all code blocks?"
|
520 |
msgstr ""
|
521 |
|
522 |
+
#: /views/blocks/manager/public/js/blocks-page/blocks-page.localization.php:21
|
523 |
msgid "Are you sure you want to delete all the empty code blocks?"
|
524 |
msgstr ""
|
525 |
|
526 |
+
#: /views/blocks/manager/public/js/blocks-page/blocks-page.localization.php:22
|
527 |
msgid "The changes you made will be lost if you navigate away from this page."
|
528 |
msgstr ""
|
529 |
|
530 |
+
#: /views/blocks/manager/public/js/blocks-page/blocks-page.localization.php:23
|
531 |
msgid "There is no blocks to delete!"
|
532 |
msgstr ""
|
533 |
|
534 |
+
#: /views/blocks/metabox/public/js/jquery.block/jquery.block.localization.php:12
|
535 |
+
msgid "Preview Post/Page in a new window"
|
536 |
+
msgstr ""
|
537 |
+
|
538 |
+
#: /views/blocks/metabox/public/js/metabox/metabox.localization.php:13
|
539 |
+
msgid "You've changed CJT block content but you didn' save this changes yet!"
|
540 |
+
msgstr ""
|
541 |
+
|
542 |
+
#: /views/blocks/metabox/public/js/metabox/metabox.localization.php:13
|
543 |
+
msgid "Would you really like to leave the page without saving this chnages"
|
544 |
+
msgstr ""
|
545 |
+
|
546 |
+
#: /views/blocks/new/public/js/add-new-block/add-new-block.localization.php:13
|
547 |
msgid "block"
|
548 |
msgstr ""
|
549 |
|
550 |
+
#: /views/blocks/new/public/js/add-new-block/add-new-block.localization.php:14
|
551 |
msgid "code block"
|
552 |
msgstr ""
|
553 |
|
554 |
+
#: /views/extensions/plugins-list/public/js/default/default.localization.php:13
|
555 |
msgid "CJT Extension License Activation Form"
|
556 |
msgstr ""
|
557 |
|
558 |
+
#: /views/extensions/plugins-list/public/js/extensions/extensions.localization.php:13
|
559 |
+
#: /views/extensions/plugins-list/public/js/plugins/plugins.localization.php:13
|
560 |
msgid "CJT Extensions"
|
561 |
msgstr ""
|
562 |
|
563 |
+
#: /views/installer/install/public/js/default/default.localization.php:13
|
564 |
msgid "Start"
|
565 |
msgstr ""
|
566 |
|
567 |
+
#: /views/installer/install/public/js/default/default.localization.php:14
|
568 |
msgid "Installation Completed ... Click Start button and have fun!!!"
|
569 |
msgstr ""
|
570 |
|
571 |
+
#: /views/installer/install/public/js/default/default.localization.php:15
|
572 |
msgid ""
|
573 |
"The installation process would just take several minutes!\n"
|
574 |
"\n"
|
575 |
"\tWould you like to start the installation process?"
|
576 |
msgstr ""
|
577 |
|
578 |
+
#: /views/installer/notice/public/js/default/default.localization.php:13
|
579 |
msgid ""
|
580 |
"The notice message wont displayed again! You still can install/upgrade the "
|
581 |
"Plugin by going to the manage blocks page. Would you really like to dismis "
|
582 |
"this notice?"
|
583 |
msgstr ""
|
584 |
|
585 |
+
#: /views/packages/install/public/js/install/install.localization.php:13
|
586 |
+
msgid "Package successfuly installed!"
|
587 |
+
msgstr ""
|
588 |
+
|
589 |
+
#: /views/packages/manager/helpers/wp-list-table.inc.php:46
|
590 |
+
#: /views/packages/manager/helpers/wp-list-table.inc.php:79
|
591 |
+
#: /views/templates/manager/helpers/wp-list-table.inc.php:59
|
592 |
+
#: /views/templates/manager/helpers/wp-list-table.inc.php:131
|
593 |
+
#: /views/blocks/block/tmpl/codefile/codefile.html.tmpl:3
|
594 |
+
#: /views/blocks/block/tmpl/menu/menu.html.tmpl:12
|
595 |
+
msgid "Delete"
|
596 |
+
msgstr ""
|
597 |
+
|
598 |
+
#: /views/packages/manager/helpers/wp-list-table.inc.php:59
|
599 |
+
#: /views/blocks/block/tmpl/menu/menu.html.tmpl:46
|
600 |
+
msgid "View"
|
601 |
+
msgstr ""
|
602 |
+
|
603 |
+
#: /views/packages/manager/helpers/wp-list-table.inc.php:62
|
604 |
+
#: /views/templates/info/view.php:39
|
605 |
+
msgid "N/A"
|
606 |
+
msgstr ""
|
607 |
+
|
608 |
+
#: /views/packages/manager/helpers/wp-list-table.inc.php:98
|
609 |
+
#: /views/templates/manager/helpers/wp-list-table.inc.php:153
|
610 |
+
#: /views/blocks/block/tmpl/codefile/codefile.html.tmpl:11
|
611 |
+
#: /views/blocks/info/tmpl/default.html.tmpl:4
|
612 |
+
#: /views/blocks/new/tmpl/default.html.tmpl:24
|
613 |
+
#: /views/templates/info/tmpl/default.html.tmpl:6
|
614 |
+
#: /views/templates/template/tmpl/default.html.tmpl:44
|
615 |
+
msgid "Name"
|
616 |
+
msgstr ""
|
617 |
+
|
618 |
+
#: /views/packages/manager/helpers/wp-list-table.inc.php:99
|
619 |
+
#: /views/templates/manager/helpers/wp-list-table.inc.php:157
|
620 |
+
#: /views/blocks/info/tmpl/default.html.tmpl:5
|
621 |
+
#: /views/templates/info/tmpl/default.html.tmpl:17
|
622 |
+
msgid "Author"
|
623 |
+
msgstr ""
|
624 |
+
|
625 |
+
#: /views/packages/manager/helpers/wp-list-table.inc.php:100
|
626 |
+
msgid "Website"
|
627 |
+
msgstr ""
|
628 |
+
|
629 |
+
#: /views/packages/manager/helpers/wp-list-table.inc.php:101
|
630 |
+
msgid "License"
|
631 |
+
msgstr ""
|
632 |
+
|
633 |
+
#: /views/packages/manager/helpers/wp-list-table.inc.php:102
|
634 |
+
msgid "Readme"
|
635 |
+
msgstr ""
|
636 |
+
|
637 |
+
#: /views/packages/manager/helpers/wp-list-table.inc.php:103
|
638 |
+
#: /views/blocks/info/tmpl/default.html.tmpl:3
|
639 |
+
#: /views/templates/info/tmpl/default.html.tmpl:5
|
640 |
+
msgid "ID"
|
641 |
+
msgstr ""
|
642 |
+
|
643 |
+
#: /views/packages/manager/public/js/manager/manager.localization.php:13
|
644 |
+
#: /views/templates/lookup/public/js/lookup/lookup.localization.php:13
|
645 |
+
msgid "This operation is permanent and cannot be reverted!"
|
646 |
+
msgstr ""
|
647 |
+
|
648 |
+
#: /views/packages/manager/public/js/manager/manager.localization.php:13
|
649 |
+
msgid "Would you like to delete the selected packages?"
|
650 |
+
msgstr ""
|
651 |
+
|
652 |
+
#: /views/packages/manager/public/js/manager/manager.localization.php:14
|
653 |
+
msgid "Install Package File"
|
654 |
+
msgstr ""
|
655 |
+
|
656 |
+
#: /views/settings/manager/view.php:36
|
657 |
msgid "Uninstall"
|
658 |
msgstr ""
|
659 |
|
660 |
+
#: /views/settings/manager/view.php:37
|
661 |
+
msgid "MetaBox"
|
662 |
+
msgstr ""
|
663 |
+
|
664 |
+
#: /views/setup/activation-form/public/js/default/default.localization.php:13
|
665 |
msgid ""
|
666 |
"External request need to be made to to css-javascript-toolbox offical web "
|
667 |
"site! The operation will take an effect once its successed! You can always "
|
671 |
"\t\t\t\t\t\t\tAre you sure would you like to process?"
|
672 |
msgstr ""
|
673 |
|
674 |
+
#: /views/setup/activation-form/public/js/default/default.localization.php:15
|
675 |
msgid ""
|
676 |
"External request need to be made to to css-javascript-toolbox offical web "
|
677 |
"site! The operation will take an effect once its successed! You can always "
|
681 |
"\t\t\t\t\t\t\tAre you sure would you like to process?"
|
682 |
msgstr ""
|
683 |
|
684 |
+
#: /views/setup/activation-form/public/js/default/default.localization.php:17
|
685 |
msgid ""
|
686 |
"The reset operation will clear the license fields and clear component "
|
687 |
"license cache! This is really great once you need to stop using a previously "
|
690 |
"anytime later!"
|
691 |
msgstr ""
|
692 |
|
693 |
+
#: /views/setup/activation-form/public/js/default/default.localization.php:19
|
694 |
+
#: /views/blocks/new/tmpl/default.html.tmpl:28
|
695 |
msgid "Activate"
|
696 |
msgstr ""
|
697 |
|
698 |
+
#: /views/setup/activation-form/public/js/default/default.localization.php:20
|
699 |
msgid "Deactivate"
|
700 |
msgstr ""
|
701 |
|
702 |
+
#: /views/setup/activation-form/public/js/default/default.localization.php:22
|
703 |
msgid "Activating Key"
|
704 |
msgstr ""
|
705 |
|
706 |
+
#: /views/setup/activation-form/public/js/default/default.localization.php:23
|
707 |
msgid "Deactivating key"
|
708 |
msgstr ""
|
709 |
|
710 |
+
#: /views/setup/activation-form/public/js/default/default.localization.php:24
|
711 |
msgid "Checking Key"
|
712 |
msgstr ""
|
713 |
|
714 |
+
#: /views/setup/activation-form/public/js/default/default.localization.php:25
|
715 |
msgid "Key is not activated/used yet"
|
716 |
msgstr ""
|
717 |
|
718 |
+
#: /views/setup/activation-form/public/js/default/default.localization.php:26
|
719 |
msgid "Key is inactive"
|
720 |
msgstr ""
|
721 |
|
722 |
+
#: /views/setup/activation-form/public/js/default/default.localization.php:27
|
723 |
msgid "Reseting License Information"
|
724 |
msgstr ""
|
725 |
|
726 |
+
#: /views/setup/activation-form/public/js/default/default.localization.php:29
|
727 |
msgid "Invalid"
|
728 |
msgstr ""
|
729 |
|
730 |
+
#: /views/setup/activation-form/public/js/default/default.localization.php:30
|
731 |
msgid "Valid"
|
732 |
msgstr ""
|
733 |
|
734 |
+
#: /views/setup/activation-form/public/js/default/default.localization.php:31
|
735 |
msgid "Error"
|
736 |
msgstr ""
|
737 |
|
738 |
+
#: /views/setup/activation-form/public/js/default/default.localization.php:32
|
739 |
msgid "Activated"
|
740 |
msgstr ""
|
741 |
|
742 |
+
#: /views/setup/activation-form/public/js/default/default.localization.php:33
|
743 |
msgid "Deactivated"
|
744 |
msgstr ""
|
745 |
|
746 |
+
#: /views/setup/activation-form/public/js/default/default.localization.php:34
|
747 |
msgid "Reseted"
|
748 |
msgstr ""
|
749 |
|
750 |
+
#: /views/setup/activation-form/public/js/default/default.localization.php:37
|
751 |
msgid "License key is activate! Thank you!"
|
752 |
msgstr ""
|
753 |
|
754 |
+
#: /views/setup/activation-form/public/js/default/default.localization.php:38
|
755 |
msgid "License Cache has been reseted!"
|
756 |
msgstr ""
|
757 |
|
758 |
+
#: /views/setup/activation-form/public/js/default/default.localization.php:40
|
759 |
msgid "License key is activated!"
|
760 |
msgstr ""
|
761 |
|
762 |
+
#: /views/setup/activation-form/public/js/default/default.localization.php:41
|
763 |
msgid "Could not activate the provided license key!"
|
764 |
msgstr ""
|
765 |
|
766 |
+
#: /views/setup/activation-form/public/js/default/default.localization.php:42
|
767 |
msgid "Could not activate License Key due to the server error!"
|
768 |
msgstr ""
|
769 |
|
770 |
+
#: /views/setup/activation-form/public/js/default/default.localization.php:44
|
771 |
msgid "The license key is deactivated!"
|
772 |
msgstr ""
|
773 |
|
774 |
+
#: /views/setup/activation-form/public/js/default/default.localization.php:45
|
775 |
msgid "Could not deactivate the provided license key!"
|
776 |
msgstr ""
|
777 |
|
778 |
+
#: /views/setup/activation-form/public/js/default/default.localization.php:46
|
779 |
msgid "Could not deactivate License Key due to the server error!"
|
780 |
msgstr ""
|
781 |
|
782 |
+
#: /views/setup/activation-form/public/js/default/default.localization.php:48
|
783 |
msgid "The ckeck operation detects that the provided key is a valid key!"
|
784 |
msgstr ""
|
785 |
|
786 |
+
#: /views/setup/activation-form/public/js/default/default.localization.php:49
|
787 |
msgid "The check operation detects that the provided key is an invalid key!"
|
788 |
msgstr ""
|
789 |
|
790 |
+
#: /views/setup/activation-form/public/js/default/default.localization.php:50
|
791 |
msgid "Could not check License Key due to the server error!"
|
792 |
msgstr ""
|
793 |
|
794 |
+
#: /views/setup/activation-form/public/js/default/default.localization.php:51
|
795 |
msgid ""
|
796 |
"The ckeck operation detects that the provided key is a valid key! The key is "
|
797 |
"not being activated yet."
|
798 |
msgstr ""
|
799 |
|
800 |
+
#: /views/setup/activation-form/public/js/default/default.localization.php:52
|
801 |
msgid ""
|
802 |
"The ckeck operation detects that the provided key is a valid key! The "
|
803 |
"license key need to be activated from the CJT Website."
|
804 |
msgstr ""
|
805 |
|
806 |
+
#: /views/setup/activation-form/public/js/default/default.localization.php:54
|
807 |
msgid "Reset"
|
808 |
msgstr ""
|
809 |
|
810 |
+
#: /views/setup/activation-form/public/js/default/default.localization.php:56
|
811 |
msgid "Invalid License name!"
|
812 |
msgstr ""
|
813 |
|
814 |
+
#: /views/setup/activation-form/public/js/default/default.localization.php:57
|
815 |
msgid "Invalid License key!"
|
816 |
msgstr ""
|
817 |
|
818 |
+
#: /views/setup/activation-form/public/js/default/default.localization.php:58
|
819 |
msgid "Component name is absolute!!! Invalid Request Specified!!!"
|
820 |
msgstr ""
|
821 |
|
822 |
+
#: /views/templates/lookup/public/js/lookup/lookup.localization.php:15
|
823 |
+
msgid "Would you like to UNLINK all linked templates?"
|
824 |
+
msgstr ""
|
825 |
+
|
826 |
+
#: /views/templates/lookup/public/js/lookup/lookup.localization.php:16
|
827 |
+
msgid "All Templates has been unlinked sucessfully!"
|
828 |
+
msgstr ""
|
829 |
+
|
830 |
+
#: /views/templates/lookup/public/js/lookup/lookup.localization.php:17
|
831 |
+
msgid "Lookup Quick Template Edit Form"
|
832 |
+
msgstr ""
|
833 |
+
|
834 |
+
#: /views/templates/manager/helpers/wp-list-table.inc.php:55
|
835 |
+
#: /views/templates/info/tmpl/default.html.tmpl:3
|
836 |
+
msgid "Info"
|
837 |
+
msgstr ""
|
838 |
+
|
839 |
+
#: /views/templates/manager/helpers/wp-list-table.inc.php:56
|
840 |
+
#: /views/blocks/block/tmpl/codefile/codefile.html.tmpl:44
|
841 |
+
#: /views/blocks/block/tmpl/menu/menu.html.tmpl:16
|
842 |
+
#: /views/templates/lookup/tmpl/default.html.tmpl:45
|
843 |
+
msgid "Edit"
|
844 |
+
msgstr ""
|
845 |
+
|
846 |
+
#: /views/templates/manager/helpers/wp-list-table.inc.php:154
|
847 |
+
#: /views/blocks/block/tmpl/codefile/codefile.html.tmpl:13
|
848 |
+
#: /views/templates/info/tmpl/default.html.tmpl:7
|
849 |
+
msgid "Type"
|
850 |
+
msgstr ""
|
851 |
+
|
852 |
+
#: /views/templates/manager/helpers/wp-list-table.inc.php:155
|
853 |
+
#: /views/templates/info/tmpl/default.html.tmpl:16
|
854 |
+
#: /views/templates/template/tmpl/default.html.tmpl:39
|
855 |
+
#: /views/templates/template/tmpl/default.html.tmpl:73
|
856 |
+
msgid "Version"
|
857 |
+
msgstr ""
|
858 |
+
|
859 |
+
#: /views/templates/manager/helpers/wp-list-table.inc.php:156
|
860 |
+
msgid "Release"
|
861 |
+
msgstr ""
|
862 |
+
|
863 |
+
#: /views/templates/manager/helpers/wp-list-table.inc.php:158
|
864 |
+
#: /views/blocks/info/tmpl/default.html.tmpl:6
|
865 |
+
msgid "Date Created"
|
866 |
+
msgstr ""
|
867 |
+
|
868 |
+
#: /views/templates/manager/helpers/wp-list-table.inc.php:159
|
869 |
+
#: /views/blocks/info/tmpl/default.html.tmpl:7
|
870 |
+
#: /views/templates/info/tmpl/default.html.tmpl:9
|
871 |
+
msgid "Last Modified"
|
872 |
+
msgstr ""
|
873 |
+
|
874 |
+
#: /views/templates/manager/helpers/wp-list-table.inc.php:160
|
875 |
+
#: /views/templates/template/tmpl/default.html.tmpl:75
|
876 |
+
msgid "State"
|
877 |
+
msgstr ""
|
878 |
+
|
879 |
+
#: /views/templates/manager/public/js/manager/manager.localization.php:13
|
880 |
+
msgid "Create New Template"
|
881 |
+
msgstr ""
|
882 |
+
|
883 |
+
#: /views/templates/manager/public/js/manager/manager.localization.php:14
|
884 |
+
msgid "Edit Template"
|
885 |
+
msgstr ""
|
886 |
+
|
887 |
+
#: /views/templates/manager/public/js/manager/manager.localization.php:15
|
888 |
+
msgid "Are you sure you want to delete all the selected templates?"
|
889 |
+
msgstr ""
|
890 |
+
|
891 |
+
#: /views/templates/template/public/js/template/template.localization.php:13
|
892 |
+
#: /views/templates/template/public/js/template/template.localization.php:14
|
893 |
+
msgid "template"
|
894 |
+
msgstr ""
|
895 |
+
|
896 |
+
#: /views/templates/template/public/js/template/template.localization.php:15
|
897 |
+
msgid "language type"
|
898 |
+
msgstr ""
|
899 |
+
|
900 |
+
#: /views/templates/template/public/js/template/template.localization.php:15
|
901 |
+
msgid "CSS, JavaScript, HTML, or PHP"
|
902 |
+
msgstr ""
|
903 |
+
|
904 |
+
#: /views/templates/template/public/js/template/template.localization.php:16
|
905 |
+
msgid "template state"
|
906 |
+
msgstr ""
|
907 |
+
|
908 |
+
#: /views/templates/template/public/js/template/template.localization.php:16
|
909 |
+
msgid "Published, Draft, or Trash"
|
910 |
+
msgstr ""
|
911 |
+
|
912 |
+
#: /views/templates/template/public/js/template/template.localization.php:17
|
913 |
+
msgid ""
|
914 |
+
"You won't be able to revert the type name once its set! Are you sure would "
|
915 |
+
"you like to use the selected type?"
|
916 |
+
msgstr ""
|
917 |
+
|
918 |
+
#: /views/backups/manager/tmpl/form.html.tmpl:6
|
919 |
msgid ""
|
920 |
"Write backup name and click Backup button to create backup from current "
|
921 |
"blocks"
|
922 |
msgstr ""
|
923 |
|
924 |
+
#: /views/backups/manager/tmpl/list.html.tmpl:3
|
925 |
msgid ""
|
926 |
"There is no backups available! You can start creating new backups from the "
|
927 |
"form above."
|
928 |
msgstr ""
|
929 |
|
930 |
+
#: /views/backups/manager/tmpl/single-backup.html.tmpl:16
|
931 |
+
#: /views/tinymce/params/tmpl/default.html.tmpl:34
|
932 |
msgid "By"
|
933 |
msgstr ""
|
934 |
|
935 |
+
#: /views/blocks/block/tmpl/edit.html.tmpl:12
|
936 |
msgid "Cancel editing code block title"
|
937 |
msgstr ""
|
938 |
|
939 |
+
#: /views/blocks/block/tmpl/edit.html.tmpl:13
|
940 |
msgid "Save code block title"
|
941 |
msgstr ""
|
942 |
|
943 |
+
#: /views/blocks/block/tmpl/codefile/codefile.html.tmpl:3
|
944 |
+
msgid "Delete all selected Code Files"
|
945 |
+
msgstr ""
|
946 |
+
|
947 |
+
#: /views/blocks/block/tmpl/codefile/codefile.html.tmpl:4
|
948 |
+
msgid "Close Code Files Manager Dialog"
|
949 |
+
msgstr ""
|
950 |
+
|
951 |
+
#: /views/blocks/block/tmpl/codefile/codefile.html.tmpl:4
|
952 |
+
#: /views/blocks/block/tmpl/codefile/codefile.html.tmpl:35
|
953 |
+
#: /views/templates/template/tmpl/default.html.tmpl:11
|
954 |
+
#: /views/tinymce/params/tmpl/default.html.tmpl:29
|
955 |
+
msgid "Close"
|
956 |
+
msgstr ""
|
957 |
+
|
958 |
+
#: /views/blocks/block/tmpl/codefile/codefile.html.tmpl:11
|
959 |
+
msgid ""
|
960 |
+
"Code File Name should be unique for each Block. Use simple names that "
|
961 |
+
"describe fow what Code File is used for."
|
962 |
+
msgstr ""
|
963 |
+
|
964 |
+
#: /views/blocks/block/tmpl/codefile/codefile.html.tmpl:13
|
965 |
+
msgid ""
|
966 |
+
"Type tells CJT how to handle applying the Code File to the Associated "
|
967 |
+
"Request. It also automatically switch Code Editor language for you."
|
968 |
+
msgstr ""
|
969 |
+
|
970 |
+
#: /views/blocks/block/tmpl/codefile/codefile.html.tmpl:26
|
971 |
+
msgid ""
|
972 |
+
"Its automatically generated when the Type is changed. In most cases you "
|
973 |
+
"won't need to modify it manually, only change it when you know how to works. "
|
974 |
+
"Please point out to CJT Web site documentation for more details about TAG "
|
975 |
+
"field."
|
976 |
+
msgstr ""
|
977 |
+
|
978 |
+
#: /views/blocks/block/tmpl/codefile/codefile.html.tmpl:26
|
979 |
+
msgid "Tag"
|
980 |
+
msgstr ""
|
981 |
+
|
982 |
+
#: /views/blocks/block/tmpl/codefile/codefile.html.tmpl:30
|
983 |
+
msgid "Optionally Code File notes."
|
984 |
+
msgstr ""
|
985 |
+
|
986 |
+
#: /views/blocks/block/tmpl/codefile/codefile.html.tmpl:30
|
987 |
+
#: /views/templates/info/tmpl/default.html.tmpl:15
|
988 |
+
#: /views/templates/template/tmpl/default.html.tmpl:38
|
989 |
+
#: /views/templates/template/tmpl/default.html.tmpl:65
|
990 |
+
msgid "Description"
|
991 |
+
msgstr ""
|
992 |
+
|
993 |
+
#: /views/blocks/block/tmpl/codefile/codefile.html.tmpl:34
|
994 |
+
#: /views/blocks/block/tmpl/menu/menu.html.tmpl:9
|
995 |
+
#: /views/blocks/block/tmpl/templates/toolbox.html.tmpl:35
|
996 |
+
#: /views/templates/template/tmpl/default.html.tmpl:12
|
997 |
+
msgid "Save"
|
998 |
+
msgstr ""
|
999 |
+
|
1000 |
+
#: /views/blocks/block/tmpl/codefile/codefile.html.tmpl:40
|
1001 |
+
msgid "Create File"
|
1002 |
+
msgstr ""
|
1003 |
+
|
1004 |
+
#: /views/blocks/block/tmpl/menu/menu.html.tmpl:3
|
1005 |
+
msgid "File"
|
1006 |
+
msgstr ""
|
1007 |
+
|
1008 |
+
#: /views/blocks/block/tmpl/menu/menu.html.tmpl:5
|
1009 |
+
msgid "ReLoad"
|
1010 |
+
msgstr ""
|
1011 |
+
|
1012 |
+
#: /views/blocks/block/tmpl/menu/menu.html.tmpl:6
|
1013 |
+
msgid "Load Local"
|
1014 |
+
msgstr ""
|
1015 |
+
|
1016 |
+
#: /views/blocks/block/tmpl/menu/menu.html.tmpl:7
|
1017 |
+
msgid "Load Url"
|
1018 |
+
msgstr ""
|
1019 |
+
|
1020 |
+
#: /views/blocks/block/tmpl/menu/menu.html.tmpl:10
|
1021 |
+
msgid "Save File"
|
1022 |
+
msgstr ""
|
1023 |
+
|
1024 |
+
#: /views/blocks/block/tmpl/menu/menu.html.tmpl:18
|
1025 |
+
msgid "Undo"
|
1026 |
+
msgstr ""
|
1027 |
+
|
1028 |
+
#: /views/blocks/block/tmpl/menu/menu.html.tmpl:19
|
1029 |
+
msgid "Redo"
|
1030 |
+
msgstr ""
|
1031 |
+
|
1032 |
+
#: /views/blocks/block/tmpl/menu/menu.html.tmpl:21
|
1033 |
+
msgid "Find"
|
1034 |
+
msgstr ""
|
1035 |
+
|
1036 |
+
#: /views/blocks/block/tmpl/menu/menu.html.tmpl:22
|
1037 |
+
msgid "Find Next"
|
1038 |
+
msgstr ""
|
1039 |
+
|
1040 |
+
#: /views/blocks/block/tmpl/menu/menu.html.tmpl:23
|
1041 |
+
msgid "Find Previous"
|
1042 |
+
msgstr ""
|
1043 |
+
|
1044 |
+
#: /views/blocks/block/tmpl/menu/menu.html.tmpl:25
|
1045 |
+
msgid "Replace"
|
1046 |
+
msgstr ""
|
1047 |
+
|
1048 |
+
#: /views/blocks/block/tmpl/menu/menu.html.tmpl:27
|
1049 |
+
msgid "Go To Line"
|
1050 |
+
msgstr ""
|
1051 |
+
|
1052 |
+
#: /views/blocks/block/tmpl/menu/menu.html.tmpl:28
|
1053 |
+
msgid "Go Line Up"
|
1054 |
+
msgstr ""
|
1055 |
+
|
1056 |
+
#: /views/blocks/block/tmpl/menu/menu.html.tmpl:29
|
1057 |
+
msgid "Go Line down"
|
1058 |
+
msgstr ""
|
1059 |
+
|
1060 |
+
#: /views/blocks/block/tmpl/menu/menu.html.tmpl:31
|
1061 |
+
msgid "Go To Next Error"
|
1062 |
+
msgstr ""
|
1063 |
+
|
1064 |
+
#: /views/blocks/block/tmpl/menu/menu.html.tmpl:32
|
1065 |
+
msgid "Go To Previous Error"
|
1066 |
+
msgstr ""
|
1067 |
+
|
1068 |
+
#: /views/blocks/block/tmpl/menu/menu.html.tmpl:34
|
1069 |
+
msgid "Fold"
|
1070 |
+
msgstr ""
|
1071 |
+
|
1072 |
+
#: /views/blocks/block/tmpl/menu/menu.html.tmpl:35
|
1073 |
+
msgid "Fold All"
|
1074 |
+
msgstr ""
|
1075 |
+
|
1076 |
+
#: /views/blocks/block/tmpl/menu/menu.html.tmpl:36
|
1077 |
+
msgid "UnFold"
|
1078 |
+
msgstr ""
|
1079 |
+
|
1080 |
+
#: /views/blocks/block/tmpl/menu/menu.html.tmpl:37
|
1081 |
+
msgid "UnFold All"
|
1082 |
+
msgstr ""
|
1083 |
+
|
1084 |
+
#: /views/blocks/block/tmpl/menu/menu.html.tmpl:39
|
1085 |
+
msgid "To Lower Case"
|
1086 |
+
msgstr ""
|
1087 |
+
|
1088 |
+
#: /views/blocks/block/tmpl/menu/menu.html.tmpl:40
|
1089 |
+
msgid "To Upper Case"
|
1090 |
+
msgstr ""
|
1091 |
+
|
1092 |
+
#: /views/blocks/block/tmpl/menu/menu.html.tmpl:42
|
1093 |
+
msgid "Settings"
|
1094 |
+
msgstr ""
|
1095 |
+
|
1096 |
+
#: /views/blocks/block/tmpl/menu/menu.html.tmpl:48
|
1097 |
+
msgid "Status Bar"
|
1098 |
+
msgstr ""
|
1099 |
+
|
1100 |
+
#: /views/blocks/block/tmpl/templates/editor-toolbox.html.tmpl:12
|
1101 |
+
msgid "Switch Editor Theme"
|
1102 |
+
msgstr ""
|
1103 |
+
|
1104 |
+
#: /views/blocks/block/tmpl/templates/editor-toolbox.html.tmpl:13
|
1105 |
+
msgid "Increase font size in code editor"
|
1106 |
+
msgstr ""
|
1107 |
+
|
1108 |
+
#: /views/blocks/block/tmpl/templates/editor-toolbox.html.tmpl:14
|
1109 |
+
msgid "Decrease font size in code editor"
|
1110 |
+
msgstr ""
|
1111 |
+
|
1112 |
+
#: /views/blocks/block/tmpl/templates/editor-toolbox.html.tmpl:15
|
1113 |
+
msgid "Reset font size in code editor"
|
1114 |
+
msgstr ""
|
1115 |
+
|
1116 |
+
#: /views/blocks/block/tmpl/templates/editor-toolbox.html.tmpl:16
|
1117 |
+
msgid ""
|
1118 |
+
"Clear all text in code editor. To undo, click Command-Z for Mac or Ctrl-Z "
|
1119 |
+
"for Windows. Click Save to permanently take affect"
|
1120 |
+
msgstr ""
|
1121 |
+
|
1122 |
+
#: /views/blocks/block/tmpl/templates/toolbox.html.tmpl:12
|
1123 |
+
msgid "Template Lookup - Embed or link templates to code blocks"
|
1124 |
+
msgstr ""
|
1125 |
+
|
1126 |
+
#: /views/blocks/block/tmpl/templates/toolbox.html.tmpl:15
|
1127 |
+
msgid "Link external"
|
1128 |
+
msgstr ""
|
1129 |
+
|
1130 |
+
#: /views/blocks/block/tmpl/templates/toolbox.html.tmpl:17
|
1131 |
msgid "Show code block information"
|
1132 |
msgstr ""
|
1133 |
|
1134 |
+
#: /views/blocks/block/tmpl/templates/toolbox.html.tmpl:19
|
1135 |
msgid "Set editing language for syntax highlighting"
|
1136 |
msgstr ""
|
1137 |
|
1138 |
+
#: /views/blocks/block/tmpl/templates/toolbox.html.tmpl:21
|
1139 |
msgid "Set editing language to CSS"
|
1140 |
msgstr ""
|
1141 |
|
1142 |
+
#: /views/blocks/block/tmpl/templates/toolbox.html.tmpl:21
|
1143 |
msgid "Cascading Style Sheets"
|
1144 |
msgstr ""
|
1145 |
|
1146 |
+
#: /views/blocks/block/tmpl/templates/toolbox.html.tmpl:22
|
1147 |
msgid "Set editing language to HTML"
|
1148 |
msgstr ""
|
1149 |
|
1150 |
+
#: /views/blocks/block/tmpl/templates/toolbox.html.tmpl:22
|
1151 |
msgid "Hyper Text Markup Language"
|
1152 |
msgstr ""
|
1153 |
|
1154 |
+
#: /views/blocks/block/tmpl/templates/toolbox.html.tmpl:23
|
1155 |
msgid "Set editing language to JavaScript"
|
1156 |
msgstr ""
|
1157 |
|
1158 |
+
#: /views/blocks/block/tmpl/templates/toolbox.html.tmpl:24
|
1159 |
msgid "Set editing language to PHP"
|
1160 |
msgstr ""
|
1161 |
|
1162 |
+
#: /views/blocks/block/tmpl/templates/toolbox.html.tmpl:24
|
1163 |
msgid "PHP: Hypertext Preprocessor"
|
1164 |
msgstr ""
|
1165 |
|
1166 |
+
#: /views/blocks/block/tmpl/templates/toolbox.html.tmpl:27
|
1167 |
msgid "Edit code block title. Click Save to take affect"
|
1168 |
msgstr ""
|
1169 |
|
1170 |
+
#: /views/blocks/block/tmpl/templates/toolbox.html.tmpl:28
|
1171 |
+
msgid "View and restore code block revisions"
|
1172 |
msgstr ""
|
1173 |
|
1174 |
+
#: /views/blocks/block/tmpl/templates/toolbox.html.tmpl:29
|
1175 |
+
msgid "Delete code block"
|
1176 |
msgstr ""
|
1177 |
|
1178 |
+
#: /views/blocks/block/tmpl/templates/toolbox.html.tmpl:35
|
1179 |
+
msgid "Save changes to code block"
|
1180 |
msgstr ""
|
1181 |
|
1182 |
+
#: /views/blocks/cjt-block/tmpl/templates/assign-panel/default.html.tmpl:7
|
1183 |
msgid "Pages"
|
1184 |
msgstr ""
|
1185 |
|
1186 |
+
#: /views/blocks/cjt-block/tmpl/templates/assign-panel/default.html.tmpl:14
|
1187 |
msgid "Posts"
|
1188 |
msgstr ""
|
1189 |
|
1190 |
+
#: /views/blocks/cjt-block/tmpl/templates/assign-panel/default.html.tmpl:21
|
1191 |
+
msgid "Custom Posts"
|
1192 |
msgstr ""
|
1193 |
|
1194 |
+
#: /views/blocks/cjt-block/tmpl/templates/assign-panel/default.html.tmpl:25
|
1195 |
+
msgid "Categories"
|
1196 |
msgstr ""
|
1197 |
|
1198 |
+
#: /views/blocks/cjt-block/tmpl/templates/assign-panel/default.html.tmpl:32
|
1199 |
msgid "Auxiliary"
|
1200 |
msgstr ""
|
1201 |
|
1202 |
+
#: /views/blocks/cjt-block/tmpl/templates/assign-panel/default.html.tmpl:39
|
1203 |
msgid "Advanced"
|
1204 |
msgstr ""
|
1205 |
|
1206 |
+
#: /views/blocks/cjt-block/tmpl/templates/assign-panel/templates/advanced.html.tmpl:2
|
1207 |
msgid "One URL per line"
|
1208 |
msgstr ""
|
1209 |
|
1210 |
+
#: /views/blocks/cjt-block/tmpl/templates/assign-panel/templates/advanced.html.tmpl:2
|
1211 |
msgid "URLs"
|
1212 |
msgstr ""
|
1213 |
|
1214 |
+
#: /views/blocks/cjt-block/tmpl/templates/assign-panel/templates/advanced.html.tmpl:6
|
1215 |
msgid "One Expression per line"
|
1216 |
msgstr ""
|
1217 |
|
1218 |
+
#: /views/blocks/cjt-block/tmpl/templates/assign-panel/templates/advanced.html.tmpl:6
|
1219 |
msgid "Expressions"
|
1220 |
msgstr ""
|
1221 |
|
1222 |
+
#: /views/blocks/cjt-block/tmpl/templates/assign-panel/templates/auxiliarity.html.tmpl:6
|
1223 |
msgid "Front Page"
|
1224 |
msgstr ""
|
1225 |
|
1226 |
+
#: /views/blocks/cjt-block/tmpl/templates/assign-panel/templates/custom-posts.html.tmpl:49
|
1227 |
msgid "There are no Custom Posts Defined yet!"
|
1228 |
msgstr ""
|
1229 |
|
1230 |
+
#: /views/blocks/cjt-block/tmpl/templates/assign-panel/templates/tab.html.tmpl:34
|
1231 |
+
msgid "Assigned"
|
1232 |
msgstr ""
|
1233 |
|
1234 |
+
#: /views/blocks/cjt-block/tmpl/templates/assign-panel/templates/tab.html.tmpl:35
|
1235 |
+
#: /views/templates/lookup/tmpl/default.html.tmpl:65
|
1236 |
+
msgid "All"
|
1237 |
msgstr ""
|
1238 |
|
1239 |
+
#: /views/blocks/create-metabox/tmpl/create.html.tmpl:22
|
1240 |
+
msgid "Would you like to create a new CJT block for this post?"
|
1241 |
msgstr ""
|
1242 |
|
1243 |
+
#: /views/blocks/create-metabox/tmpl/create.html.tmpl:23
|
1244 |
+
msgid ""
|
1245 |
+
"In order to increase performance while navigating the post pages and for "
|
1246 |
+
"saving database records we're not creating CJT code block for any post until "
|
1247 |
+
"you really need to do!"
|
1248 |
msgstr ""
|
1249 |
|
1250 |
+
#: /views/blocks/create-metabox/tmpl/create.html.tmpl:24
|
1251 |
+
msgid "Click"
|
1252 |
+
msgstr ""
|
1253 |
+
|
1254 |
+
#: /views/blocks/create-metabox/tmpl/create.html.tmpl:24
|
1255 |
+
#: /views/blocks/new/tmpl/default.html.tmpl:67
|
1256 |
+
msgid "Create"
|
1257 |
+
msgstr ""
|
1258 |
+
|
1259 |
+
#: /views/blocks/create-metabox/tmpl/create.html.tmpl:24
|
1260 |
+
msgid ""
|
1261 |
+
"to create CJT code block for current post and utilize from all features "
|
1262 |
+
"found in the CJT management page!"
|
1263 |
msgstr ""
|
1264 |
|
1265 |
+
#: /views/blocks/info/tmpl/default.html.tmpl:8
|
1266 |
msgid "Shortcode"
|
1267 |
msgstr ""
|
1268 |
|
1269 |
+
#: /views/blocks/manager/tmpl/blocks.html.tmpl:13
|
1270 |
+
msgid "CSS & Javascript Toolbox Pro"
|
1271 |
msgstr ""
|
1272 |
|
1273 |
+
#: /views/blocks/manager/tmpl/blocks.html.tmpl:16
|
1274 |
+
msgid "Support Forum"
|
1275 |
msgstr ""
|
1276 |
|
1277 |
+
#: /views/blocks/manager/tmpl/blocks.html.tmpl:17
|
1278 |
+
msgid "Online Documentation"
|
1279 |
msgstr ""
|
1280 |
|
1281 |
+
#: /views/blocks/manager/tmpl/blocks.html.tmpl:29
|
1282 |
msgid ""
|
1283 |
"You have now restored the code blocks from the current backup. Nothing is "
|
1284 |
"saved until you click \"Restore\" button. To revert back to the previous "
|
1286 |
"button."
|
1287 |
msgstr ""
|
1288 |
|
1289 |
+
#: /views/blocks/manager/tmpl/toolbox.html.tmpl:3
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1290 |
msgid "Add new code block"
|
1291 |
msgstr ""
|
1292 |
|
1293 |
+
#: /views/blocks/manager/tmpl/toolbox.html.tmpl:3
|
1294 |
msgid "New Code Block"
|
1295 |
msgstr ""
|
1296 |
|
1297 |
+
#: /views/blocks/manager/tmpl/toolbox.html.tmpl:4
|
1298 |
msgid "Save changes to all code blocks"
|
1299 |
msgstr ""
|
1300 |
|
1301 |
+
#: /views/blocks/manager/tmpl/toolbox.html.tmpl:4
|
1302 |
msgid "Save All Changes"
|
1303 |
msgstr ""
|
1304 |
|
1305 |
+
#: /views/blocks/manager/tmpl/toolbox.html.tmpl:5
|
1306 |
+
msgid "Cancel backup restoring"
|
1307 |
+
msgstr ""
|
1308 |
+
|
1309 |
+
#: /views/blocks/manager/tmpl/toolbox.html.tmpl:5
|
1310 |
+
msgid "Cancel Restore"
|
1311 |
+
msgstr ""
|
1312 |
+
|
1313 |
+
#: /views/blocks/manager/tmpl/toolbox.html.tmpl:6
|
1314 |
+
msgid "Save restored Backup"
|
1315 |
+
msgstr ""
|
1316 |
+
|
1317 |
+
#: /views/blocks/manager/tmpl/toolbox.html.tmpl:6
|
1318 |
+
#: /views/blocks/revisions/tmpl/default.html.tmpl:27
|
1319 |
+
msgid "Restore"
|
1320 |
+
msgstr ""
|
1321 |
+
|
1322 |
+
#: /views/blocks/manager/tmpl/toolbox.html.tmpl:9
|
1323 |
+
msgid "Tools for block state (batch)"
|
1324 |
+
msgstr ""
|
1325 |
+
|
1326 |
+
#: /views/blocks/manager/tmpl/toolbox.html.tmpl:11
|
1327 |
+
msgid "Activate (turn on) all code blocks"
|
1328 |
+
msgstr ""
|
1329 |
+
|
1330 |
+
#: /views/blocks/manager/tmpl/toolbox.html.tmpl:11
|
1331 |
+
msgid "Activate All"
|
1332 |
+
msgstr ""
|
1333 |
+
|
1334 |
+
#: /views/blocks/manager/tmpl/toolbox.html.tmpl:13
|
1335 |
+
msgid "Deactivate (turn off) all code blocks"
|
1336 |
+
msgstr ""
|
1337 |
+
|
1338 |
+
#: /views/blocks/manager/tmpl/toolbox.html.tmpl:13
|
1339 |
+
msgid "Deactivate All"
|
1340 |
+
msgstr ""
|
1341 |
+
|
1342 |
+
#: /views/blocks/manager/tmpl/toolbox.html.tmpl:15
|
1343 |
+
msgid "Switch current state for all code blocks"
|
1344 |
+
msgstr ""
|
1345 |
+
|
1346 |
+
#: /views/blocks/manager/tmpl/toolbox.html.tmpl:15
|
1347 |
+
msgid "Revert State"
|
1348 |
+
msgstr ""
|
1349 |
+
|
1350 |
+
#: /views/blocks/manager/tmpl/toolbox.html.tmpl:18
|
1351 |
+
msgid "Tools for location hook (batch)"
|
1352 |
+
msgstr ""
|
1353 |
+
|
1354 |
+
#: /views/blocks/manager/tmpl/toolbox.html.tmpl:20
|
1355 |
+
msgid "Set output location hook to footer for all code blocks"
|
1356 |
+
msgstr ""
|
1357 |
+
|
1358 |
+
#: /views/blocks/manager/tmpl/toolbox.html.tmpl:20
|
1359 |
+
msgid "Footer all"
|
1360 |
+
msgstr ""
|
1361 |
+
|
1362 |
+
#: /views/blocks/manager/tmpl/toolbox.html.tmpl:22
|
1363 |
+
msgid "Set output location hook to header for all code blocks"
|
1364 |
+
msgstr ""
|
1365 |
+
|
1366 |
+
#: /views/blocks/manager/tmpl/toolbox.html.tmpl:22
|
1367 |
+
msgid "Header all"
|
1368 |
+
msgstr ""
|
1369 |
+
|
1370 |
+
#: /views/blocks/manager/tmpl/toolbox.html.tmpl:26
|
1371 |
+
msgid "Code Template Manager"
|
1372 |
+
msgstr ""
|
1373 |
+
|
1374 |
+
#: /views/blocks/manager/tmpl/toolbox.html.tmpl:29
|
1375 |
+
msgid "Tools for block cleanup and backup"
|
1376 |
+
msgstr ""
|
1377 |
+
|
1378 |
+
#: /views/blocks/manager/tmpl/toolbox.html.tmpl:31
|
1379 |
+
msgid "Delete all code blocks"
|
1380 |
+
msgstr ""
|
1381 |
+
|
1382 |
+
#: /views/blocks/manager/tmpl/toolbox.html.tmpl:31
|
1383 |
+
msgid "Delete all"
|
1384 |
+
msgstr ""
|
1385 |
+
|
1386 |
+
#: /views/blocks/manager/tmpl/toolbox.html.tmpl:33
|
1387 |
+
msgid "Delete only empty code blocks"
|
1388 |
+
msgstr ""
|
1389 |
+
|
1390 |
+
#: /views/blocks/manager/tmpl/toolbox.html.tmpl:33
|
1391 |
+
msgid "Delete Empty"
|
1392 |
+
msgstr ""
|
1393 |
+
|
1394 |
+
#: /views/blocks/manager/tmpl/toolbox.html.tmpl:35
|
1395 |
+
msgid "Backup Manager - Create, restore, or delete backups"
|
1396 |
+
msgstr ""
|
1397 |
+
|
1398 |
+
#: /views/blocks/manager/tmpl/toolbox.html.tmpl:38
|
1399 |
msgid "General plugin settings"
|
1400 |
msgstr ""
|
1401 |
|
1402 |
+
#: /views/blocks/manager/tmpl/toolbox.html.tmpl:40
|
1403 |
+
msgid "Maximise all code blocks"
|
1404 |
+
msgstr ""
|
1405 |
+
|
1406 |
+
#: /views/blocks/manager/tmpl/toolbox.html.tmpl:41
|
1407 |
+
msgid "Minimise all code blocks"
|
1408 |
+
msgstr ""
|
1409 |
+
|
1410 |
+
#: /views/blocks/manager/tmpl/help/intro.html.tmpl:10
|
1411 |
msgid "Welcome to the CSS & JavaScript Toolbox dashboard"
|
1412 |
msgstr ""
|
1413 |
|
1414 |
+
#: /views/blocks/manager/tmpl/help/intro.html.tmpl:11
|
1415 |
msgid ""
|
1416 |
+
"Since you do not have any code blocks active, you can either: create a new "
|
1417 |
+
"code block or create a new code template."
|
1418 |
msgstr ""
|
1419 |
|
1420 |
+
#: /views/blocks/manager/tmpl/help/intro.html.tmpl:12
|
1421 |
msgid "Create a new Code Block"
|
1422 |
msgstr ""
|
1423 |
|
1424 |
+
#: /views/blocks/manager/tmpl/help/intro.html.tmpl:13
|
1425 |
msgid ""
|
1426 |
"You can add a new code block by clicking the New Code Block button. Once "
|
1427 |
"your code block has been added, simply choose the editor you wish to work "
|
1435 |
"assigned webpage."
|
1436 |
msgstr ""
|
1437 |
|
1438 |
+
#: /views/blocks/manager/tmpl/help/intro.html.tmpl:14
|
1439 |
+
msgid "Create a new Code Template"
|
1440 |
+
msgstr ""
|
1441 |
+
|
1442 |
+
#: /views/blocks/manager/tmpl/help/intro.html.tmpl:15
|
1443 |
+
msgid ""
|
1444 |
+
"You can create code templates when you click into the Code Template "
|
1445 |
+
"Manager. To find this, hover over the icon showing a small cog over pages, "
|
1446 |
+
"and a tooltip should say Code Template Manager. Press this and if you have "
|
1447 |
+
"chosen to install the Template Samples, you will notice them sitting in "
|
1448 |
+
"there ready to be used. If you want to create a code template from scratch, "
|
1449 |
+
"click the Create Template button. Here you can choose a name for your code "
|
1450 |
+
"template, select a code language type (i.e. CSS, JavaScript, HTML, PHP), "
|
1451 |
+
"choose whether the template is in Draft or Published state, and then write "
|
1452 |
+
"your code. You have other tabs that allow you to write a Description, add "
|
1453 |
+
"Keywords and Version number, etc. Once you are happy with your code "
|
1454 |
+
"template, you can click the Save button"
|
1455 |
+
msgstr ""
|
1456 |
+
|
1457 |
+
#: /views/blocks/manager/tmpl/help/intro.html.tmpl:16
|
1458 |
+
msgid "Embedding or Linking a Code Templates"
|
1459 |
+
msgstr ""
|
1460 |
+
|
1461 |
+
#: /views/blocks/manager/tmpl/help/intro.html.tmpl:17
|
1462 |
+
msgid ""
|
1463 |
+
"Code Templates can be either embedded or linked into your code blocks. To "
|
1464 |
+
"see all your code templates, you have to click the Template Lookup icon by "
|
1465 |
+
"hovering over the icon with the open/closed angled brackets. A popup will "
|
1466 |
+
"appear showing you code templates in the form of users and they are:"
|
1467 |
+
msgstr ""
|
1468 |
+
|
1469 |
+
#: /views/blocks/manager/tmpl/help/intro.html.tmpl:19
|
1470 |
+
msgid "WordPress: default code templates that are packaged with WordPress"
|
1471 |
+
msgstr ""
|
1472 |
+
|
1473 |
+
#: /views/blocks/manager/tmpl/help/intro.html.tmpl:20
|
1474 |
+
msgid ""
|
1475 |
+
"Sample Templates: CJT Sample Templates (depending if Sample Templates were "
|
1476 |
+
"selected during install)"
|
1477 |
+
msgstr ""
|
1478 |
+
|
1479 |
+
#: /views/blocks/manager/tmpl/help/intro.html.tmpl:21
|
1480 |
+
msgid ""
|
1481 |
+
"Users: code templates created by actual WordPress users and administrators"
|
1482 |
+
msgstr ""
|
1483 |
+
|
1484 |
+
#: /views/blocks/manager/tmpl/help/intro.html.tmpl:23
|
1485 |
+
msgid ""
|
1486 |
+
"You can click on any of the 3 types of users to see all of their code "
|
1487 |
+
"templates, and you can either embed or link these to code blocks."
|
1488 |
+
msgstr ""
|
1489 |
+
|
1490 |
+
#: /views/blocks/manager/tmpl/help/intro.html.tmpl:24
|
1491 |
+
#: /views/templates/lookup/tmpl/default.html.tmpl:38
|
1492 |
+
msgid "Embed"
|
1493 |
+
msgstr ""
|
1494 |
+
|
1495 |
+
#: /views/blocks/manager/tmpl/help/intro.html.tmpl:24
|
1496 |
+
msgid ""
|
1497 |
+
"embedding a code template will paste the entire template contents into the "
|
1498 |
+
"code block editor. This can be ideal if you want to do further enhancements "
|
1499 |
+
"and customisations to the code without permanently changing the base "
|
1500 |
+
"template."
|
1501 |
+
msgstr ""
|
1502 |
+
|
1503 |
+
#: /views/blocks/manager/tmpl/help/intro.html.tmpl:25
|
1504 |
+
msgid ""
|
1505 |
+
"linking the code template does not actually paste the template into the code "
|
1506 |
+
"block editor but instead links to it. This is more ideal if you want to "
|
1507 |
+
"link many code templates to the one code block. There is no need to create "
|
1508 |
+
"individual code blocks for each."
|
1509 |
+
msgstr ""
|
1510 |
+
|
1511 |
+
#: /views/blocks/new/tmpl/default.html.tmpl:24
|
1512 |
msgid "Name or title of code block (must be unique and cannot be left blank)"
|
1513 |
msgstr ""
|
1514 |
|
1515 |
+
#: /views/blocks/new/tmpl/default.html.tmpl:28
|
1516 |
+
msgid "Tick the checkbox to Activate (turn on) code block"
|
1517 |
msgstr ""
|
1518 |
|
1519 |
+
#: /views/blocks/new/tmpl/default.html.tmpl:32
|
1520 |
+
msgid "Set location hook for code block output to: Header or Footer"
|
1521 |
msgstr ""
|
1522 |
|
1523 |
+
#: /views/blocks/new/tmpl/default.html.tmpl:32
|
1524 |
+
msgid "Location Hook"
|
1525 |
msgstr ""
|
1526 |
|
1527 |
+
#: /views/blocks/new/tmpl/default.html.tmpl:36
|
1528 |
+
msgid "Header"
|
1529 |
msgstr ""
|
1530 |
|
1531 |
+
#: /views/blocks/new/tmpl/default.html.tmpl:37
|
1532 |
+
msgid "Footer"
|
1533 |
msgstr ""
|
1534 |
|
1535 |
+
#: /views/blocks/new/tmpl/default.html.tmpl:48
|
1536 |
+
msgid "Set initial code block position to: First Block or Last Block"
|
1537 |
+
msgstr ""
|
1538 |
+
|
1539 |
+
#: /views/blocks/new/tmpl/default.html.tmpl:48
|
1540 |
+
msgid "Initial Block Position"
|
1541 |
+
msgstr ""
|
1542 |
+
|
1543 |
+
#: /views/blocks/new/tmpl/default.html.tmpl:53
|
1544 |
+
msgid "First Block"
|
1545 |
+
msgstr ""
|
1546 |
+
|
1547 |
+
#: /views/blocks/new/tmpl/default.html.tmpl:54
|
1548 |
+
msgid "Last Block"
|
1549 |
+
msgstr ""
|
1550 |
+
|
1551 |
+
#: /views/blocks/new/tmpl/default.html.tmpl:66
|
1552 |
+
#: /views/templates/template/tmpl/default.html.tmpl:15
|
1553 |
+
msgid "Cancel"
|
1554 |
msgstr ""
|
1555 |
|
1556 |
+
#: /views/blocks/revisions/tmpl/default.html.tmpl:19
|
1557 |
+
msgid "No revisions!"
|
1558 |
+
msgstr ""
|
1559 |
+
|
1560 |
+
#: /views/blocks/revisions/tmpl/default.html.tmpl:26
|
1561 |
+
msgid "by"
|
1562 |
+
msgstr ""
|
1563 |
+
|
1564 |
+
#: /views/installer/install/tmpl/default.html.tmpl:24
|
1565 |
msgid ""
|
1566 |
"In order to start using CJT Plugin you need first to install the Plugin."
|
1567 |
msgstr ""
|
1568 |
|
1569 |
+
#: /views/installer/install/tmpl/default.html.tmpl:25
|
1570 |
msgid ""
|
1571 |
"The installation process will create CJT database tables, build-it Database "
|
1572 |
"records."
|
1573 |
msgstr ""
|
1574 |
|
1575 |
+
#: /views/installer/install/tmpl/default.html.tmpl:26
|
1576 |
msgid "Check for previous version and if the upgrade process is needed."
|
1577 |
msgstr ""
|
1578 |
|
1579 |
+
#: /views/installer/install/tmpl/default.html.tmpl:27
|
1580 |
msgid ""
|
1581 |
"The Plugin is in disable state untill the installation process took place!"
|
1582 |
msgstr ""
|
1583 |
|
1584 |
+
#: /views/installer/install/tmpl/default.html.tmpl:28
|
1585 |
msgid ""
|
1586 |
"To utilize from the CJT functionality you must install the Plugin first!!"
|
1587 |
msgstr ""
|
1588 |
|
1589 |
+
#: /views/installer/install/tmpl/default.html.tmpl:30
|
1590 |
msgid "Installing Version "
|
1591 |
msgstr ""
|
1592 |
|
1593 |
+
#: /views/installer/install/tmpl/default.html.tmpl:31
|
1594 |
msgid ""
|
1595 |
"When you install a new version of CJT for the first time or even upgrading "
|
1596 |
"from old versions, a number of processes will happen, which will take "
|
1597 |
"approximately 1 to 2 minutes. These processes include"
|
1598 |
msgstr ""
|
1599 |
|
1600 |
+
#: /views/installer/install/tmpl/default.html.tmpl:38
|
1601 |
msgid "Create database tables."
|
1602 |
msgstr ""
|
1603 |
|
1604 |
+
#: /views/installer/install/tmpl/default.html.tmpl:39
|
1605 |
+
msgid ""
|
1606 |
+
"Creating file system directories (e.g wp-content/cjt-content/templates)."
|
1607 |
+
msgstr ""
|
1608 |
+
|
1609 |
+
#: /views/installer/install/tmpl/default.html.tmpl:40
|
1610 |
+
msgid "Add CJT built-in authors used by templates system."
|
1611 |
+
msgstr ""
|
1612 |
+
|
1613 |
+
#: /views/installer/install/tmpl/default.html.tmpl:41
|
1614 |
+
msgid ""
|
1615 |
+
"Add Wordpress built-in scripts and styles as CJT Templates so it can be used "
|
1616 |
+
"throught Templates Lookup form."
|
1617 |
+
msgstr ""
|
1618 |
+
|
1619 |
+
#: /views/installer/install/tmpl/default.html.tmpl:42
|
1620 |
msgid "Finalize Installation."
|
1621 |
msgstr ""
|
1622 |
|
1623 |
+
#: /views/installer/install/tmpl/upgrade.html.tmpl:13
|
1624 |
msgid "Upgrading CJT Plugin"
|
1625 |
msgstr ""
|
1626 |
|
1627 |
+
#: /views/installer/install/tmpl/upgrade.html.tmpl:14
|
1628 |
msgid ""
|
1629 |
"Please wait while we upgrading CJT Plugin installation! This process would "
|
1630 |
"take only a few seconds!"
|
1631 |
msgstr ""
|
1632 |
|
1633 |
+
#: /views/installer/install/tmpl/upgrade.html.tmpl:15
|
1634 |
+
msgid ""
|
1635 |
+
"Its highly recommended to Backup your database before processing upgrade."
|
1636 |
msgstr ""
|
1637 |
|
1638 |
+
#: /views/installer/install/tmpl/upgrade.html.tmpl:17
|
1639 |
msgid "Upgrade"
|
1640 |
msgstr ""
|
1641 |
|
1642 |
+
#: /views/installer/install/tmpl/upgrades/upgrade.html.tmpl:10
|
1643 |
msgid "Upgrading Plugin"
|
1644 |
msgstr ""
|
1645 |
|
1646 |
+
#: /views/installer/install/tmpl/upgrades/upgrade.html.tmpl:11
|
1647 |
msgid ""
|
1648 |
"The upgrade process time estimation cannot be preditected because its based "
|
1649 |
"on the amount of data (blocks + other data) you've created."
|
1650 |
msgstr ""
|
1651 |
|
1652 |
+
#: /views/installer/install/tmpl/upgrades/upgrade.html.tmpl:12
|
1653 |
msgid ""
|
1654 |
"Important Note: It is highly recommended to upgrade the plugin using the "
|
1655 |
"same administrator or user that was used to manage the code blocks. This "
|
1657 |
"logged in administrators or users' meta data."
|
1658 |
msgstr ""
|
1659 |
|
1660 |
+
#: /views/installer/install/tmpl/upgrades/upgrade.html.tmpl:20
|
1661 |
msgid "Finalize Upgrade."
|
1662 |
msgstr ""
|
1663 |
|
1664 |
+
#: /views/installer/notice/tmpl/default.html.tmpl:12
|
1665 |
msgid ""
|
1666 |
"CJT Plugin has been installed throught Wordpress Plugins manager page. In "
|
1667 |
"order for CJT Plugin to work correctly you must install it throught"
|
1668 |
msgstr ""
|
1669 |
|
1670 |
+
#: /views/installer/notice/tmpl/default.html.tmpl:13
|
1671 |
msgid "CJT-Instalaltion page."
|
1672 |
msgstr ""
|
1673 |
|
1674 |
+
#: /views/installer/notice/tmpl/default.html.tmpl:16
|
1675 |
msgid "Please or you can go to the installation page directly through the"
|
1676 |
msgstr ""
|
1677 |
|
1678 |
+
#: /views/installer/notice/tmpl/default.html.tmpl:17
|
1679 |
msgid "CSS & Javascript Toolbox page."
|
1680 |
msgstr ""
|
1681 |
|
1682 |
+
#: /views/installer/notice/tmpl/default.html.tmpl:19
|
1683 |
msgid "Dismiss"
|
1684 |
msgstr ""
|
1685 |
|
1686 |
+
#: /views/packages/install/tmpl/default.html.tmpl:24
|
1687 |
+
msgid "Package File"
|
1688 |
+
msgstr ""
|
1689 |
+
|
1690 |
+
#: /views/packages/install/tmpl/default.html.tmpl:28
|
1691 |
+
msgid "Install"
|
1692 |
+
msgstr ""
|
1693 |
+
|
1694 |
+
#: /views/packages/manager/tmpl/default.html.tmpl:15
|
1695 |
+
msgid "Install Package"
|
1696 |
+
msgstr ""
|
1697 |
+
|
1698 |
+
#: /views/packages/raw-file/tmpl/default.html.tmpl:11
|
1699 |
+
msgid "Package file - Raw Viewer"
|
1700 |
+
msgstr ""
|
1701 |
+
|
1702 |
+
#: /views/settings/manager/tmpl/pages/metabox.html.tmpl:12
|
1703 |
+
msgid "Registered Post Types"
|
1704 |
+
msgstr ""
|
1705 |
+
|
1706 |
+
#: /views/settings/manager/tmpl/pages/uninstall.html.tmpl:7
|
1707 |
msgid "Wipe out data!"
|
1708 |
msgstr ""
|
1709 |
|
1710 |
+
#: /views/setup/activation-form/tmpl/default.html.tmpl:25
|
1711 |
msgid "License Key"
|
1712 |
msgstr ""
|
1713 |
|
1714 |
+
#: /views/setup/activation-form/tmpl/default.html.tmpl:27
|
1715 |
msgid ""
|
1716 |
"In order to get the benefits from the premium services we provide you've to "
|
1717 |
"obtain your license key from"
|
1718 |
msgstr ""
|
1719 |
|
1720 |
+
#: /views/setup/activation-form/tmpl/default.html.tmpl:28
|
1721 |
msgid "web site"
|
1722 |
msgstr ""
|
1723 |
|
1724 |
+
#: /views/setup/activation-form/tmpl/default.html.tmpl:32
|
1725 |
msgid "Your Name"
|
1726 |
msgstr ""
|
1727 |
|
1728 |
+
#: /views/setup/activation-form/tmpl/default.html.tmpl:37
|
1729 |
msgid "Key"
|
1730 |
msgstr ""
|
1731 |
|
1732 |
+
#: /views/setup/activation-form/tmpl/default.html.tmpl:46
|
1733 |
msgid "Check"
|
1734 |
msgstr ""
|
1735 |
|
1736 |
+
#: /views/templates/info/tmpl/default.html.tmpl:8
|
1737 |
+
msgid "Creation Date"
|
1738 |
+
msgstr ""
|
1739 |
+
|
1740 |
+
#: /views/templates/info/tmpl/default.html.tmpl:10
|
1741 |
+
msgid "Last Revision Comment"
|
1742 |
+
msgstr ""
|
1743 |
+
|
1744 |
+
#: /views/templates/info/tmpl/default.html.tmpl:13
|
1745 |
+
msgid "About"
|
1746 |
+
msgstr ""
|
1747 |
+
|
1748 |
+
#: /views/templates/info/tmpl/default.html.tmpl:18
|
1749 |
+
#: /views/templates/template/tmpl/default.html.tmpl:66
|
1750 |
+
msgid "Keywords"
|
1751 |
+
msgstr ""
|
1752 |
+
|
1753 |
+
#: /views/templates/lookup/tmpl/default.html.tmpl:32
|
1754 |
+
msgid "User"
|
1755 |
+
msgstr ""
|
1756 |
+
|
1757 |
+
#: /views/templates/lookup/tmpl/default.html.tmpl:61
|
1758 |
+
msgid "Show"
|
1759 |
+
msgstr ""
|
1760 |
+
|
1761 |
+
#: /views/templates/lookup/tmpl/default.html.tmpl:63
|
1762 |
+
msgid "Linked"
|
1763 |
+
msgstr ""
|
1764 |
+
|
1765 |
+
#: /views/templates/lookup/tmpl/default.html.tmpl:64
|
1766 |
+
msgid "Unlinked"
|
1767 |
+
msgstr ""
|
1768 |
+
|
1769 |
+
#: /views/templates/lookup/tmpl/default.html.tmpl:69
|
1770 |
+
msgid "Unlink All"
|
1771 |
+
msgstr ""
|
1772 |
|
1773 |
+
#: /views/templates/manager/tmpl/default.html.tmpl:25
|
1774 |
+
msgid "Create Template"
|
1775 |
+
msgstr ""
|
1776 |
|
1777 |
+
#: /views/templates/template/tmpl/default.html.tmpl:16
|
1778 |
+
msgid "Update"
|
1779 |
+
msgstr ""
|
1780 |
|
1781 |
+
#: /views/templates/template/tmpl/default.html.tmpl:37
|
1782 |
+
msgid "Main"
|
1783 |
+
msgstr ""
|
1784 |
|
1785 |
+
#: /views/templates/template/tmpl/default.html.tmpl:44
|
1786 |
+
msgid "Name or title of template (must be unique and cannot be left blank)"
|
1787 |
+
msgstr ""
|
1788 |
|
1789 |
+
#: /views/templates/template/tmpl/default.html.tmpl:46
|
1790 |
+
msgid ""
|
1791 |
+
"Set the code language to: CSS, JavaScript, HTML, or PHP (selection must be "
|
1792 |
+
"made)"
|
1793 |
+
msgstr ""
|
1794 |
|
1795 |
+
#: /views/templates/template/tmpl/default.html.tmpl:46
|
1796 |
+
msgid "Language"
|
1797 |
+
msgstr ""
|
1798 |
|
1799 |
+
#: /views/templates/template/tmpl/default.html.tmpl:47
|
1800 |
+
msgid "< Select Type >"
|
1801 |
+
msgstr ""
|
1802 |
+
|
1803 |
+
#: /views/templates/template/tmpl/default.html.tmpl:50
|
1804 |
+
msgid ""
|
1805 |
+
"Set the template state to: Published, Draft, or Trash (selection must be "
|
1806 |
+
"made)"
|
1807 |
+
msgstr ""
|
1808 |
+
|
1809 |
+
#: /views/templates/template/tmpl/default.html.tmpl:50
|
1810 |
+
msgid "Template State"
|
1811 |
+
msgstr ""
|
1812 |
+
|
1813 |
+
#: /views/templates/template/tmpl/default.html.tmpl:51
|
1814 |
+
#: /views/templates/template/tmpl/default.html.tmpl:76
|
1815 |
+
msgid "< Select State >"
|
1816 |
+
msgstr ""
|
1817 |
+
|
1818 |
+
#: /views/templates/template/tmpl/default.html.tmpl:54
|
1819 |
+
msgid ""
|
1820 |
+
"Enter code for the template in the large text field and click Save when done"
|
1821 |
+
msgstr ""
|
1822 |
+
|
1823 |
+
#: /views/templates/template/tmpl/default.html.tmpl:54
|
1824 |
+
msgid "Code"
|
1825 |
+
msgstr ""
|
1826 |
+
|
1827 |
+
#: /views/templates/template/tmpl/default.html.tmpl:65
|
1828 |
+
msgid ""
|
1829 |
+
"Enter a descriptive write-up for the template describing what it is, and how "
|
1830 |
+
"it works, etc "
|
1831 |
+
msgstr ""
|
1832 |
+
|
1833 |
+
#: /views/templates/template/tmpl/default.html.tmpl:66
|
1834 |
+
msgid ""
|
1835 |
+
"Enter strong keywords for the template - each being separated by a comma"
|
1836 |
+
msgstr ""
|
1837 |
+
|
1838 |
+
#: /views/templates/template/tmpl/default.html.tmpl:73
|
1839 |
+
msgid "Enter the specific version for the template (e.g. 1.0)"
|
1840 |
+
msgstr ""
|
1841 |
+
|
1842 |
+
#: /views/templates/template/tmpl/default.html.tmpl:75
|
1843 |
+
msgid ""
|
1844 |
+
"Set the release state to: Release, Beta, Alpha, Release Candidate, or "
|
1845 |
+
"Revision"
|
1846 |
+
msgstr ""
|
1847 |
+
|
1848 |
+
#: /views/templates/template/tmpl/default.html.tmpl:78
|
1849 |
+
msgid ""
|
1850 |
+
"Add any notes such as stability issues, bug fixes, or anything that can be "
|
1851 |
+
"useful for future development"
|
1852 |
+
msgstr ""
|
1853 |
+
|
1854 |
+
#: /views/templates/template/tmpl/default.html.tmpl:78
|
1855 |
+
msgid "Revision note"
|
1856 |
+
msgstr ""
|
1857 |
+
|
1858 |
+
#: /views/tinymce/params/tmpl/default.html.tmpl:30
|
1859 |
+
msgid "Done"
|
1860 |
+
msgstr ""
|
locals/strings.inc.php
CHANGED
@@ -5,6 +5,18 @@
|
|
5 |
* and comes from the database!
|
6 |
*/
|
7 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
8 |
/** Supported Languages */
|
9 |
cssJSToolbox::getText('javascript');
|
10 |
cssJSToolbox::getText('css');
|
5 |
* and comes from the database!
|
6 |
*/
|
7 |
|
8 |
+
/** Template States */
|
9 |
+
cssJSToolbox::getText('trash');
|
10 |
+
cssJSToolbox::getText('draft');
|
11 |
+
cssJSToolbox::getText('published');
|
12 |
+
|
13 |
+
/** Template Revision States */
|
14 |
+
cssJSToolbox::getText('release');
|
15 |
+
cssJSToolbox::getText('beta');
|
16 |
+
cssJSToolbox::getText('release-candidate');
|
17 |
+
cssJSToolbox::getText('alpha');
|
18 |
+
cssJSToolbox::getText('revision');
|
19 |
+
|
20 |
/** Supported Languages */
|
21 |
cssJSToolbox::getText('javascript');
|
22 |
cssJSToolbox::getText('css');
|
models/block-templates.php
ADDED
@@ -0,0 +1,36 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
*
|
4 |
+
*/
|
5 |
+
|
6 |
+
// Disllow direct access.
|
7 |
+
defined('ABSPATH') or die('Access denied');
|
8 |
+
|
9 |
+
/**
|
10 |
+
*
|
11 |
+
*/
|
12 |
+
class CJTBlockTemplatesModel extends CJTHookableClass {
|
13 |
+
|
14 |
+
/**
|
15 |
+
* Check weather a template is linked to specific block.
|
16 |
+
*
|
17 |
+
* Check database block_templates table for record with the given ids.
|
18 |
+
*
|
19 |
+
* @param Integer Block Id.
|
20 |
+
* @param Integer Template Id.
|
21 |
+
* @return boolean TRUE if linked, FALSE if not.
|
22 |
+
*/
|
23 |
+
public function isLinked($blockId, $templateId) {
|
24 |
+
// Try to load block template table with the requested Ids.
|
25 |
+
$tableBlockTemplate = CJTxTable::getInstance('block-template');
|
26 |
+
$tableBlockTemplate->set('blockId', $blockId)
|
27 |
+
->set('templateId', $templateId)
|
28 |
+
->load(array('blockId', 'templateId'));
|
29 |
+
// Return TRUE if the blockId and the TemplateId returned from the load process!
|
30 |
+
return ($tableBlockTemplate->get('blockId') && $tableBlockTemplate->get('templateId'));
|
31 |
+
}
|
32 |
+
|
33 |
+
} // End class.
|
34 |
+
|
35 |
+
// Hookable!
|
36 |
+
CJTBlockTemplatesModel::define('CJTBlockTemplatesModel');
|
models/block/parameters/base/parameters.php
ADDED
@@ -0,0 +1,96 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
*
|
4 |
+
*/
|
5 |
+
|
6 |
+
/**
|
7 |
+
*
|
8 |
+
*/
|
9 |
+
abstract class CJT_Models_Block_Parameters_Base_Parameters
|
10 |
+
extends ArrayIterator {
|
11 |
+
|
12 |
+
/**
|
13 |
+
* put your comment there...
|
14 |
+
*
|
15 |
+
* @var mixed
|
16 |
+
*/
|
17 |
+
protected $params = array();
|
18 |
+
|
19 |
+
/**
|
20 |
+
* put your comment there...
|
21 |
+
*
|
22 |
+
* @var mixed
|
23 |
+
*/
|
24 |
+
protected $blockId = null;
|
25 |
+
|
26 |
+
/**
|
27 |
+
* put your comment there...
|
28 |
+
*
|
29 |
+
* @param mixed $blockId
|
30 |
+
* @return CJT_Models_Block_Parameters
|
31 |
+
*/
|
32 |
+
public function __construct($blockId) {
|
33 |
+
$this->blockId = $blockId;
|
34 |
+
// Query all block parameters, pass it to the ArrayIterator object.
|
35 |
+
parent::__construct($this->queryParameters());
|
36 |
+
}
|
37 |
+
|
38 |
+
/**
|
39 |
+
* put your comment there...
|
40 |
+
*
|
41 |
+
* @param mixed $row
|
42 |
+
*/
|
43 |
+
public abstract function createModelObject($row);
|
44 |
+
|
45 |
+
/**
|
46 |
+
* put your comment there...
|
47 |
+
*
|
48 |
+
*/
|
49 |
+
public function getBlockId() {
|
50 |
+
return $this->blockId;
|
51 |
+
}
|
52 |
+
|
53 |
+
/**
|
54 |
+
* put your comment there...
|
55 |
+
*
|
56 |
+
*/
|
57 |
+
protected function getParams() {
|
58 |
+
return $this->params;
|
59 |
+
}
|
60 |
+
|
61 |
+
/**
|
62 |
+
* put your comment there...
|
63 |
+
*
|
64 |
+
*/
|
65 |
+
protected abstract function getQuery();
|
66 |
+
|
67 |
+
/**
|
68 |
+
* put your comment there...
|
69 |
+
*
|
70 |
+
*/
|
71 |
+
protected function queryParameters() {
|
72 |
+
// Initialize.
|
73 |
+
$parameters = array();
|
74 |
+
$query = $this->getQuery();
|
75 |
+
$recset = cssJSToolbox::getInstance()->getDBDriver()->select($query, ARRAY_A);
|
76 |
+
// Prototype to parameter model.
|
77 |
+
foreach (new ArrayIterator($recset) as $row) {
|
78 |
+
// Instantiate parameter model object.
|
79 |
+
$param = $this->createModelObject($row);
|
80 |
+
// Add as child if it has a parent or add in the root if not.
|
81 |
+
if (!$param->getParent()) {
|
82 |
+
// Add to list.
|
83 |
+
$parameters[$param->getId()] = $param;
|
84 |
+
}
|
85 |
+
else {
|
86 |
+
// Add as child parameter!
|
87 |
+
$parameters[$param->getParent()]->addChild($param);
|
88 |
+
}
|
89 |
+
// Flat parameters list.
|
90 |
+
$this->params[] = $param;
|
91 |
+
}
|
92 |
+
// Return only root parameters.
|
93 |
+
return $parameters;
|
94 |
+
}
|
95 |
+
|
96 |
+
} // End class.
|
models/block/parameters/form/groups.php
ADDED
@@ -0,0 +1,42 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
*
|
4 |
+
*/
|
5 |
+
|
6 |
+
/**
|
7 |
+
*
|
8 |
+
*/
|
9 |
+
class CJT_Models_Block_Parameters_Form_Groups
|
10 |
+
extends ArrayObject {
|
11 |
+
|
12 |
+
/**
|
13 |
+
* put your comment there...
|
14 |
+
*
|
15 |
+
* @var mixed
|
16 |
+
*/
|
17 |
+
protected $formId;
|
18 |
+
|
19 |
+
/**
|
20 |
+
* put your comment there...
|
21 |
+
*
|
22 |
+
* @param mixed $formId
|
23 |
+
* @return CJT_Models_Block_Parameters_Form_Groups
|
24 |
+
*/
|
25 |
+
public function __construct($formId) {
|
26 |
+
// Initialize.
|
27 |
+
$this->formId = $formId;
|
28 |
+
$dbDriver = cssJSToolbox::getInstance()->getDBDriver();
|
29 |
+
// Query groups.
|
30 |
+
$groups = $dbDriver->select("SELECT * FROM #__cjtoolbox_form_groups g LEFT JOIN #__cjtoolbox_form_group_xfields xf ON g.id = xf.groupId WHERE g.formId = {$this->formId};", ARRAY_A);
|
31 |
+
parent::__construct($groups);
|
32 |
+
}
|
33 |
+
|
34 |
+
/**
|
35 |
+
* put your comment there...
|
36 |
+
*
|
37 |
+
*/
|
38 |
+
public function getFormId() {
|
39 |
+
return $this->formId;
|
40 |
+
}
|
41 |
+
|
42 |
+
} // End class.
|
models/block/parameters/form/parameter.php
ADDED
@@ -0,0 +1,168 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
*
|
4 |
+
*/
|
5 |
+
|
6 |
+
/**
|
7 |
+
*
|
8 |
+
*/
|
9 |
+
class CJT_Models_Block_Parameters_Form_Parameter
|
10 |
+
extends CJT_Models_Block_Parameters_Parameter {
|
11 |
+
|
12 |
+
/**
|
13 |
+
* put your comment there...
|
14 |
+
*
|
15 |
+
* @var mixed
|
16 |
+
*/
|
17 |
+
protected $description;
|
18 |
+
|
19 |
+
/**
|
20 |
+
* put your comment there...
|
21 |
+
*
|
22 |
+
* @var mixed
|
23 |
+
*/
|
24 |
+
protected $groupDescription;
|
25 |
+
|
26 |
+
/**
|
27 |
+
* put your comment there...
|
28 |
+
*
|
29 |
+
* @var mixed
|
30 |
+
*/
|
31 |
+
protected $groupId;
|
32 |
+
|
33 |
+
/**
|
34 |
+
* put your comment there...
|
35 |
+
*
|
36 |
+
* @var mixed
|
37 |
+
*/
|
38 |
+
protected $groupName;
|
39 |
+
|
40 |
+
/**
|
41 |
+
* put your comment there...
|
42 |
+
*
|
43 |
+
* @var mixed
|
44 |
+
*/
|
45 |
+
protected $helpText;
|
46 |
+
|
47 |
+
/**
|
48 |
+
* put your comment there...
|
49 |
+
*
|
50 |
+
* @var mixed
|
51 |
+
*/
|
52 |
+
protected $renderer;
|
53 |
+
|
54 |
+
/**
|
55 |
+
* put your comment there...
|
56 |
+
*
|
57 |
+
* @var mixed
|
58 |
+
*/
|
59 |
+
protected $values;
|
60 |
+
|
61 |
+
/**
|
62 |
+
* put your comment there...
|
63 |
+
*
|
64 |
+
* @param mixed $name
|
65 |
+
* @param mixed $type
|
66 |
+
* @param mixed $required
|
67 |
+
* @param mixed $defaultValue
|
68 |
+
* @param mixed $parent
|
69 |
+
* @param mixed $id
|
70 |
+
* @return CJT_Models_Block_Parameters_Parameter
|
71 |
+
*/
|
72 |
+
public function __construct($parameter) {
|
73 |
+
// Initialize parent model.
|
74 |
+
parent::__construct($parameter);
|
75 |
+
// Initialize.
|
76 |
+
$this->groupName = isset($parameter['groupName']) ? $parameter['groupName'] : null;
|
77 |
+
$this->groupId = isset($parameter['groupId']) ? $parameter['groupId'] : null;
|
78 |
+
$this->groupDescription = isset($parameter['groupDescription']) ? $parameter['groupDescription'] : null;
|
79 |
+
$this->renderer = isset($parameter['renderer']) ? $parameter['renderer'] : null;
|
80 |
+
$this->description = isset($parameter['description']) ? $parameter['description'] : null;
|
81 |
+
$this->helpText = isset($parameter['helpText']) ? $parameter['helpText'] : null;
|
82 |
+
}
|
83 |
+
|
84 |
+
/**
|
85 |
+
* put your comment there...
|
86 |
+
*
|
87 |
+
* @param mixed $value
|
88 |
+
*/
|
89 |
+
public function addValue($value) {
|
90 |
+
// Add value model to the values list.
|
91 |
+
$this->values[] = $value;
|
92 |
+
// Chaining.
|
93 |
+
return $this;
|
94 |
+
}
|
95 |
+
|
96 |
+
/**
|
97 |
+
* put your comment there...
|
98 |
+
*
|
99 |
+
*/
|
100 |
+
public function getDescription() {
|
101 |
+
return $this->description;
|
102 |
+
}
|
103 |
+
|
104 |
+
/**
|
105 |
+
* put your comment there...
|
106 |
+
*
|
107 |
+
*/
|
108 |
+
public function getGroupDescription() {
|
109 |
+
return $this->groupDescription;
|
110 |
+
}
|
111 |
+
|
112 |
+
/**
|
113 |
+
* put your comment there...
|
114 |
+
*
|
115 |
+
*/
|
116 |
+
public function getGroupId() {
|
117 |
+
return $this->groupId;
|
118 |
+
}
|
119 |
+
|
120 |
+
/**
|
121 |
+
* put your comment there...
|
122 |
+
*
|
123 |
+
*/
|
124 |
+
public function getGroupName() {
|
125 |
+
return $this->groupName;
|
126 |
+
}
|
127 |
+
|
128 |
+
/**
|
129 |
+
* put your comment there...
|
130 |
+
*
|
131 |
+
*/
|
132 |
+
public function getHelpText() {
|
133 |
+
return $this->helpText;
|
134 |
+
}
|
135 |
+
|
136 |
+
/**
|
137 |
+
* put your comment there...
|
138 |
+
*
|
139 |
+
*/
|
140 |
+
public function getOriginalType() {
|
141 |
+
return parent::getType();
|
142 |
+
}
|
143 |
+
|
144 |
+
/**
|
145 |
+
* put your comment there...
|
146 |
+
*
|
147 |
+
*/
|
148 |
+
public function getRenderer() {
|
149 |
+
return $this->renderer;
|
150 |
+
}
|
151 |
+
|
152 |
+
/**
|
153 |
+
* put your comment there...
|
154 |
+
*
|
155 |
+
*/
|
156 |
+
public function getType() {
|
157 |
+
return $this->getRenderer();
|
158 |
+
}
|
159 |
+
|
160 |
+
/**
|
161 |
+
* put your comment there...
|
162 |
+
*
|
163 |
+
*/
|
164 |
+
public function getValues() {
|
165 |
+
return $this->values;
|
166 |
+
}
|
167 |
+
|
168 |
+
} // End class.
|
models/block/parameters/form/parameters.php
ADDED
@@ -0,0 +1,68 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
*
|
4 |
+
*/
|
5 |
+
|
6 |
+
/**
|
7 |
+
*
|
8 |
+
*/
|
9 |
+
class CJT_Models_Block_Parameters_Form_Parameters
|
10 |
+
extends CJT_Models_Block_Parameters_Base_Parameters {
|
11 |
+
|
12 |
+
/**
|
13 |
+
* put your comment there...
|
14 |
+
*
|
15 |
+
* @param mixed $blockId
|
16 |
+
* @return CJT_Models_Block_Parameters_Form_Parameters
|
17 |
+
*/
|
18 |
+
public function __construct($blockId) {
|
19 |
+
// Parent procedure!
|
20 |
+
parent::__construct($blockId);
|
21 |
+
// Read all values.
|
22 |
+
$this->assignValues();
|
23 |
+
}
|
24 |
+
|
25 |
+
/**
|
26 |
+
* put your comment there...
|
27 |
+
*
|
28 |
+
*/
|
29 |
+
protected function assignValues() {
|
30 |
+
// Initialize.
|
31 |
+
$driver = cssJSToolbox::getInstance()->getDBDriver();
|
32 |
+
// For every parameter assign the values.
|
33 |
+
foreach ($this->getParams() as $param) {
|
34 |
+
// Query all values.
|
35 |
+
$recset = $driver->select("SELECT *
|
36 |
+
FROM #__cjtoolbox_parameter_typedef
|
37 |
+
WHERE parameterId = {$param->getId()}", ARRAY_A);
|
38 |
+
foreach ($recset as $valueRow) {
|
39 |
+
$param->addValue(new CJT_Models_Block_Parameters_Form_Value($valueRow));
|
40 |
+
}
|
41 |
+
}
|
42 |
+
return $this;
|
43 |
+
}
|
44 |
+
|
45 |
+
/**
|
46 |
+
* put your comment there...
|
47 |
+
*
|
48 |
+
* @param mixed $row
|
49 |
+
*/
|
50 |
+
public function createModelObject($row) {
|
51 |
+
return new CJT_Models_Block_Parameters_Form_Parameter($row);
|
52 |
+
}
|
53 |
+
|
54 |
+
/**
|
55 |
+
* put your comment there...
|
56 |
+
*
|
57 |
+
*/
|
58 |
+
protected function getQuery() {
|
59 |
+
$query = "SELECT p.*, pe.renderer, pe.description, pe.helpText, g.id groupId, g.name groupName, g.description groupDescription
|
60 |
+
FROM #__cjtoolbox_parameters p LEFT JOIN #__cjtoolbox_blocks b ON p.blockId = b.id
|
61 |
+
LEFT JOIN #__cjtoolbox_form_group_parameters pe ON pe.parameterId = p.id
|
62 |
+
LEFT JOIN #__cjtoolbox_form_groups g ON pe.groupId = g.id
|
63 |
+
WHERE b.id = {$this->blockId}
|
64 |
+
ORDER by id ASC;";
|
65 |
+
return $query;
|
66 |
+
}
|
67 |
+
|
68 |
+
} // End class.
|
models/block/parameters/form/value.php
ADDED
@@ -0,0 +1,52 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
*
|
4 |
+
*/
|
5 |
+
|
6 |
+
/**
|
7 |
+
*
|
8 |
+
*/
|
9 |
+
class CJT_Models_Block_Parameters_Form_Value {
|
10 |
+
|
11 |
+
/**
|
12 |
+
* put your comment there...
|
13 |
+
*
|
14 |
+
* @var mixed
|
15 |
+
*/
|
16 |
+
protected $text;
|
17 |
+
|
18 |
+
/**
|
19 |
+
* put your comment there...
|
20 |
+
*
|
21 |
+
* @var mixed
|
22 |
+
*/
|
23 |
+
protected $value;
|
24 |
+
|
25 |
+
/**
|
26 |
+
* put your comment there...
|
27 |
+
*
|
28 |
+
* @param mixed $data
|
29 |
+
* @return CJT_Models_Block_Parameters_Form_Value
|
30 |
+
*/
|
31 |
+
public function __construct($data) {
|
32 |
+
$this->text = isset($data['text']) ? $data['text'] : null;
|
33 |
+
$this->value = isset($data['value']) ? $data['value'] : null;
|
34 |
+
}
|
35 |
+
|
36 |
+
/**
|
37 |
+
* put your comment there...
|
38 |
+
*
|
39 |
+
*/
|
40 |
+
public function getText() {
|
41 |
+
return $this->text;
|
42 |
+
}
|
43 |
+
|
44 |
+
/**
|
45 |
+
* put your comment there...
|
46 |
+
*
|
47 |
+
*/
|
48 |
+
public function getValue() {
|
49 |
+
return $this->value;
|
50 |
+
}
|
51 |
+
|
52 |
+
} // End class
|
models/block/parameters/parameter.php
ADDED
@@ -0,0 +1,182 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
*
|
4 |
+
*/
|
5 |
+
|
6 |
+
/**
|
7 |
+
*
|
8 |
+
*/
|
9 |
+
class CJT_Models_Block_Parameters_Parameter {
|
10 |
+
|
11 |
+
/**
|
12 |
+
* put your comment there...
|
13 |
+
*
|
14 |
+
* @var mixed
|
15 |
+
*/
|
16 |
+
protected $contentParameter;
|
17 |
+
|
18 |
+
/**
|
19 |
+
* put your comment there...
|
20 |
+
*
|
21 |
+
* @var mixed
|
22 |
+
*/
|
23 |
+
protected $defaultValue;
|
24 |
+
|
25 |
+
/**
|
26 |
+
* put your comment there...
|
27 |
+
*
|
28 |
+
* @var mixed
|
29 |
+
*/
|
30 |
+
protected $id;
|
31 |
+
|
32 |
+
/**
|
33 |
+
* put your comment there...
|
34 |
+
*
|
35 |
+
* @var mixed
|
36 |
+
*/
|
37 |
+
protected $name;
|
38 |
+
|
39 |
+
/**
|
40 |
+
* put your comment there...
|
41 |
+
*
|
42 |
+
* @var mixed
|
43 |
+
*/
|
44 |
+
protected $order;
|
45 |
+
|
46 |
+
/**
|
47 |
+
* put your comment there...
|
48 |
+
*
|
49 |
+
* @var mixed
|
50 |
+
*/
|
51 |
+
protected $parent;
|
52 |
+
|
53 |
+
/**
|
54 |
+
* put your comment there...
|
55 |
+
*
|
56 |
+
* @var mixed
|
57 |
+
*/
|
58 |
+
protected $required = null;
|
59 |
+
|
60 |
+
/**
|
61 |
+
* put your comment there...
|
62 |
+
*
|
63 |
+
* @var mixed
|
64 |
+
*/
|
65 |
+
protected $type;
|
66 |
+
|
67 |
+
/**
|
68 |
+
* put your comment there...
|
69 |
+
*
|
70 |
+
* @var mixed
|
71 |
+
*/
|
72 |
+
protected $childs = array();
|
73 |
+
|
74 |
+
/**
|
75 |
+
* put your comment there...
|
76 |
+
*
|
77 |
+
* @param mixed $name
|
78 |
+
* @param mixed $type
|
79 |
+
* @param mixed $required
|
80 |
+
* @param mixed $defaultValue
|
81 |
+
* @param mixed $parent
|
82 |
+
* @param mixed $id
|
83 |
+
* @return CJT_Models_Block_Parameters_Parameter
|
84 |
+
*/
|
85 |
+
public function __construct($parameter) {
|
86 |
+
$this->contentParameter = isset($parameter['contentParam']) ? $parameter['contentParam'] : null;
|
87 |
+
$this->defaultValue = isset($parameter['defaultValue']) ? $parameter['defaultValue'] : null;
|
88 |
+
$this->id = isset($parameter['id']) ? $parameter['id'] : null;
|
89 |
+
$this->name = isset($parameter['name']) ? $parameter['name'] : null;
|
90 |
+
$this->parent = isset($parameter['parent']) ? $parameter['parent'] : null;
|
91 |
+
$this->required = isset($parameter['required']) ? $parameter['required'] : null;
|
92 |
+
$this->type = isset($parameter['type']) ? $parameter['type'] : null;
|
93 |
+
$this->order = isset($parameter['order']) ? $parameter['order'] : null;
|
94 |
+
}
|
95 |
+
|
96 |
+
/**
|
97 |
+
* put your comment there...
|
98 |
+
*
|
99 |
+
* @param mixed $childs
|
100 |
+
* @return CJT_Models_Block_Parameters_Parameter
|
101 |
+
*/
|
102 |
+
public function addChild($child) {
|
103 |
+
// Add child paramter!
|
104 |
+
$this->childs[$child->getId()] = $child;
|
105 |
+
// Chaining.
|
106 |
+
return $this;
|
107 |
+
}
|
108 |
+
|
109 |
+
/**
|
110 |
+
* put your comment there...
|
111 |
+
*
|
112 |
+
*/
|
113 |
+
public function getChilds() {
|
114 |
+
return $this->childs;
|
115 |
+
}
|
116 |
+
|
117 |
+
/**
|
118 |
+
* put your comment there...
|
119 |
+
*
|
120 |
+
*/
|
121 |
+
public function getContentParameter() {
|
122 |
+
return $this->contentParameter;
|
123 |
+
}
|
124 |
+
|
125 |
+
/**
|
126 |
+
* put your comment there...
|
127 |
+
*
|
128 |
+
*/
|
129 |
+
public function getDefaultValue() {
|
130 |
+
return $this->defaultValue;
|
131 |
+
}
|
132 |
+
|
133 |
+
/**
|
134 |
+
* put your comment there...
|
135 |
+
*
|
136 |
+
*/
|
137 |
+
public function getId() {
|
138 |
+
return $this->id;
|
139 |
+
}
|
140 |
+
|
141 |
+
/**
|
142 |
+
* put your comment there...
|
143 |
+
*
|
144 |
+
*/
|
145 |
+
public function getOrder() {
|
146 |
+
return $this->order;
|
147 |
+
}
|
148 |
+
|
149 |
+
/**
|
150 |
+
* put your comment there...
|
151 |
+
*
|
152 |
+
* @param mixed $slugIt
|
153 |
+
*/
|
154 |
+
public function getName($slugIt = false) {
|
155 |
+
return $slugIt ? strtolower($this->name) : $this->name;
|
156 |
+
}
|
157 |
+
|
158 |
+
/**
|
159 |
+
* put your comment there...
|
160 |
+
*
|
161 |
+
*/
|
162 |
+
public function getParent() {
|
163 |
+
return $this->parent;
|
164 |
+
}
|
165 |
+
|
166 |
+
/**
|
167 |
+
* put your comment there...
|
168 |
+
*
|
169 |
+
*/
|
170 |
+
public function getRequired() {
|
171 |
+
return $this->required;
|
172 |
+
}
|
173 |
+
|
174 |
+
/**
|
175 |
+
* put your comment there...
|
176 |
+
*
|
177 |
+
*/
|
178 |
+
public function getType() {
|
179 |
+
return $this->type;
|
180 |
+
}
|
181 |
+
|
182 |
+
} // End class.
|
models/block/parameters/parameters.php
ADDED
@@ -0,0 +1,33 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
*
|
4 |
+
*/
|
5 |
+
|
6 |
+
/**
|
7 |
+
*
|
8 |
+
*/
|
9 |
+
class CJT_Models_Block_Parameters_Parameters
|
10 |
+
extends CJT_Models_Block_Parameters_Base_Parameters {
|
11 |
+
|
12 |
+
/**
|
13 |
+
* put your comment there...
|
14 |
+
*
|
15 |
+
* @param mixed $row
|
16 |
+
*/
|
17 |
+
public function createModelObject($row) {
|
18 |
+
return new CJT_Models_Block_Parameters_Parameter($row);
|
19 |
+
}
|
20 |
+
|
21 |
+
/**
|
22 |
+
* put your comment there...
|
23 |
+
*
|
24 |
+
*/
|
25 |
+
protected function getQuery() {
|
26 |
+
$query = "SELECT p.*
|
27 |
+
FROM #__cjtoolbox_parameters p LEFT JOIN #__cjtoolbox_blocks b ON p.blockId = b.id
|
28 |
+
WHERE b.id = {$this->blockId}
|
29 |
+
ORDER by id ASC;";
|
30 |
+
return $query;
|
31 |
+
}
|
32 |
+
|
33 |
+
} // End class.
|
models/blocks-backups.php
CHANGED
@@ -48,6 +48,9 @@ class CJTBlocksBackupsModel {
|
|
48 |
* @param mixed $desBackupId
|
49 |
*/
|
50 |
public function copyBackupBlocks($srcBackupId, $desBackupId) {
|
|
|
|
|
|
|
51 |
// Blocks Table & Model..
|
52 |
require_once CJTOOLBOX_TABLES_PATH . '/blocks.php';
|
53 |
require_once CJTOOLBOX_TABLES_PATH . '/block-pins.php';
|
@@ -98,6 +101,8 @@ class CJTBlocksBackupsModel {
|
|
98 |
// Insert block Pins.
|
99 |
$pinsData = array_intersect_key($block, array_flip(array('pages', 'posts', 'categories')));
|
100 |
$blockPinsTable->insert($block['id'], $pinsData);
|
|
|
|
|
101 |
}
|
102 |
}
|
103 |
|
@@ -166,6 +171,8 @@ class CJTBlocksBackupsModel {
|
|
166 |
// Delete blocks using its Id.
|
167 |
$ids = array_keys($blocks);
|
168 |
$blocksModel->delete($ids);
|
|
|
|
|
169 |
// In order for $this->processQueue to work
|
170 |
// we need to Merge db driver queues into the current
|
171 |
// local queue.
|
48 |
* @param mixed $desBackupId
|
49 |
*/
|
50 |
public function copyBackupBlocks($srcBackupId, $desBackupId) {
|
51 |
+
// Initialie.
|
52 |
+
$codeFilesQuery = 'INSERT INTO #__cjtoolbox_block_files (blockId, id, name, description, `type`, code, `order`)
|
53 |
+
SELECT %d, id, name, description, `type`, code, `order` FROM #__cjtoolbox_block_files WHERE blockId = %d;';
|
54 |
// Blocks Table & Model..
|
55 |
require_once CJTOOLBOX_TABLES_PATH . '/blocks.php';
|
56 |
require_once CJTOOLBOX_TABLES_PATH . '/block-pins.php';
|
101 |
// Insert block Pins.
|
102 |
$pinsData = array_intersect_key($block, array_flip(array('pages', 'posts', 'categories')));
|
103 |
$blockPinsTable->insert($block['id'], $pinsData);
|
104 |
+
// Copy code files.
|
105 |
+
$this->dbDriver->insert(sprintf($codeFilesQuery, $block['id'], $id))->processQueue();
|
106 |
}
|
107 |
}
|
108 |
|
171 |
// Delete blocks using its Id.
|
172 |
$ids = array_keys($blocks);
|
173 |
$blocksModel->delete($ids);
|
174 |
+
// Delete code files.
|
175 |
+
$this->dbDriver->delete('DELETE FROM #__cjtoolbox_block_files where blockId IN (' . implode(',', $ids) . ');');
|
176 |
// In order for $this->processQueue to work
|
177 |
// we need to Merge db driver queues into the current
|
178 |
// local queue.
|
models/blocks.php
CHANGED
@@ -55,33 +55,48 @@ class CJTBlocksModel {
|
|
55 |
$block = (array) $block;
|
56 |
// Create Tables objects.
|
57 |
$blocks = new CJTBlocksTable($this->dbDriver);
|
|
|
58 |
// Get new id if not specified.
|
59 |
-
if (!$block['id']) {
|
60 |
$block['id'] = $blocks->getNextId();
|
61 |
}
|
|
|
|
|
|
|
|
|
62 |
$blocks->insert($block);
|
|
|
|
|
|
|
|
|
|
|
|
|
63 |
return $block['id'];
|
64 |
}
|
65 |
|
66 |
/**
|
67 |
* put your comment there...
|
68 |
*
|
69 |
-
* @param mixed $
|
|
|
70 |
*/
|
71 |
-
public function addRevision($blockId) {
|
72 |
// Create Tables objects.
|
73 |
$blocks = new CJTBlocksTable($this->dbDriver);
|
74 |
$pins = new CJTBlockPinsTable($this->dbDriver);
|
75 |
-
|
|
|
|
|
|
|
76 |
$revisions['fields'] = array('id');
|
77 |
-
$revisions['filters'] = array('type' => 'revision', 'parent' => $blockId);
|
78 |
$revisions = $blocks->get(null, $revisions['fields'], $revisions['filters']);
|
79 |
// If revisions reached self::MAX_REVISIONS_PER_BLOCK delete first one.
|
80 |
if (count($revisions) == self::MAX_REVISIONS_PER_BLOCK) {
|
81 |
$this->delete(array_shift($revisions)->id);
|
82 |
}
|
83 |
// Get block data.
|
84 |
-
$block['fields'] = array('id', 'lastModified', 'pinPoint', '
|
85 |
// get() developed to return multiple blocks, fetch the first.
|
86 |
$result = $blocks->get($blockId, $block['fields']);
|
87 |
$block = reset($result);
|
@@ -91,6 +106,8 @@ class CJTBlocksModel {
|
|
91 |
$block->type = 'revision';
|
92 |
$block->created = current_time('mysql');
|
93 |
$block->owner = get_current_user_id();
|
|
|
|
|
94 |
$block->id = $blocks->getNextId(); // Get new id for revision rrecord.
|
95 |
// Add block data.
|
96 |
$blocks->insert($block);
|
@@ -99,6 +116,14 @@ class CJTBlocksModel {
|
|
99 |
if (!empty($blockPins)) {
|
100 |
$pins->insertRaw($block->id, $blockPins);
|
101 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
102 |
}
|
103 |
|
104 |
/**
|
@@ -124,6 +149,7 @@ class CJTBlocksModel {
|
|
124 |
// Create Tables objects.
|
125 |
$blocks = new CJTBlocksTable($this->dbDriver);
|
126 |
$pins = new CJTBlockPinsTable($this->dbDriver);
|
|
|
127 |
// Get blocks revisions.
|
128 |
$revisions['fields'] = array('id');
|
129 |
$revisions['filters']['parent'] = $ids;
|
@@ -136,10 +162,23 @@ class CJTBlocksModel {
|
|
136 |
if (!empty($revisions)) {
|
137 |
$blocks->delete($revisions);
|
138 |
$pins->delete($revisions);
|
|
|
|
|
139 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
140 |
// Delete blocks.
|
141 |
$blocks->delete($ids);
|
142 |
$pins->delete($ids);
|
|
|
|
|
143 |
// Chaining!
|
144 |
return $this;
|
145 |
}
|
@@ -162,10 +201,14 @@ class CJTBlocksModel {
|
|
162 |
* @param mixed $ids
|
163 |
*/
|
164 |
public function getBlocks($ids = array(), $filters = array(), $fields = array('*'), $returnType = OBJECT_K, $orderBy = array(), $useDefaultBackupFltr = true) {
|
|
|
165 |
$blocks = array();
|
|
|
|
|
166 |
// Create Tables objects.
|
167 |
$blocksTable = new CJTBlocksTable($this->dbDriver);
|
168 |
$pinsTable = new CJTBlockPinsTable($this->dbDriver);
|
|
|
169 |
// Read blocks.
|
170 |
$blocks = $blocksTable->get($ids, $fields, $filters, $returnType, $orderBy, $useDefaultBackupFltr);
|
171 |
// Get only pins for retrieved blocks.
|
@@ -178,9 +221,52 @@ class CJTBlocksModel {
|
|
178 |
// e.g blocks[ID]->pages[] = PAGE-ID.
|
179 |
$blocks[$pin->blockId]->{$pin->pin}[] = $pin->value;
|
180 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
181 |
return $blocks;
|
182 |
}
|
183 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
184 |
/**
|
185 |
* put your comment there...
|
186 |
*
|
@@ -235,7 +321,8 @@ class CJTBlocksModel {
|
|
235 |
* @param mixed $block
|
236 |
*/
|
237 |
public function update($block, $updatePins) {
|
238 |
-
|
|
|
239 |
// Create Tables objects.
|
240 |
$blocks = new CJTBlocksTable($this->dbDriver);
|
241 |
$pins = new CJTBlockPinsTable($this->dbDriver);
|
@@ -245,9 +332,17 @@ class CJTBlocksModel {
|
|
245 |
$pinsData = array_intersect_key($block, array_flip(array('pages', 'posts', 'categories')));
|
246 |
$pins->update($block['id'], $pinsData);
|
247 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
248 |
// Isolate block fields.
|
249 |
-
$
|
250 |
-
$blocks->update($
|
251 |
}
|
252 |
|
253 |
} // End class.
|
55 |
$block = (array) $block;
|
56 |
// Create Tables objects.
|
57 |
$blocks = new CJTBlocksTable($this->dbDriver);
|
58 |
+
$codeFile = new CJTBlockFilesTable($this->dbDriver);
|
59 |
// Get new id if not specified.
|
60 |
+
if (!isset($block['id']) || !$block['id']) {
|
61 |
$block['id'] = $blocks->getNextId();
|
62 |
}
|
63 |
+
// Cache code for MASTER file.
|
64 |
+
$codeFile->set('code', (isset($block['code']) ? $block['code'] : null));
|
65 |
+
unset($block['code']); // If it passed it mist be removed from blocks data(avoid field not found)
|
66 |
+
// Add new block.
|
67 |
$blocks->insert($block);
|
68 |
+
// Add code files.
|
69 |
+
$codeFile->set('blockId', $block['id'])
|
70 |
+
->set('id', 1)
|
71 |
+
->set('name', 'Master')
|
72 |
+
->save(true, true);
|
73 |
+
// Return Newly added block id.
|
74 |
return $block['id'];
|
75 |
}
|
76 |
|
77 |
/**
|
78 |
* put your comment there...
|
79 |
*
|
80 |
+
* @param mixed $blockId
|
81 |
+
* @param mixed $activeFileId
|
82 |
*/
|
83 |
+
public function addRevision($blockId, $activeFileId) {
|
84 |
// Create Tables objects.
|
85 |
$blocks = new CJTBlocksTable($this->dbDriver);
|
86 |
$pins = new CJTBlockPinsTable($this->dbDriver);
|
87 |
+
$codeFile = new CJTBlockFilesTable($this->dbDriver);
|
88 |
+
// We allow only up to self::MAX_REVISIONS_PER_BLOCK revisions per
|
89 |
+
// block code files So that a single block may has up to
|
90 |
+
// self::MAX_REVISIONS_PER_BLOCK * count(codeFiles)
|
91 |
$revisions['fields'] = array('id');
|
92 |
+
$revisions['filters'] = array('type' => 'revision', 'parent' => $blockId, 'masterFile' => $activeFileId);
|
93 |
$revisions = $blocks->get(null, $revisions['fields'], $revisions['filters']);
|
94 |
// If revisions reached self::MAX_REVISIONS_PER_BLOCK delete first one.
|
95 |
if (count($revisions) == self::MAX_REVISIONS_PER_BLOCK) {
|
96 |
$this->delete(array_shift($revisions)->id);
|
97 |
}
|
98 |
// Get block data.
|
99 |
+
$block['fields'] = array('id', 'lastModified', 'pinPoint', 'links', 'expressions');
|
100 |
// get() developed to return multiple blocks, fetch the first.
|
101 |
$result = $blocks->get($blockId, $block['fields']);
|
102 |
$block = reset($result);
|
106 |
$block->type = 'revision';
|
107 |
$block->created = current_time('mysql');
|
108 |
$block->owner = get_current_user_id();
|
109 |
+
$block->masterFile = $activeFileId; // Only the revisioned code file would be exists and must be
|
110 |
+
// used as the masterFile!
|
111 |
$block->id = $blocks->getNextId(); // Get new id for revision rrecord.
|
112 |
// Add block data.
|
113 |
$blocks->insert($block);
|
116 |
if (!empty($blockPins)) {
|
117 |
$pins->insertRaw($block->id, $blockPins);
|
118 |
}
|
119 |
+
// Revision current ActiveFileId code record.
|
120 |
+
// Simply, get a copy of it from the target block
|
121 |
+
// and assign the copy to the new created block revision.
|
122 |
+
$codeFile->set('id', $activeFileId)
|
123 |
+
->set('blockId', $blockId)
|
124 |
+
->load()
|
125 |
+
->set('blockId', $block->id)
|
126 |
+
->save(true, true);
|
127 |
}
|
128 |
|
129 |
/**
|
149 |
// Create Tables objects.
|
150 |
$blocks = new CJTBlocksTable($this->dbDriver);
|
151 |
$pins = new CJTBlockPinsTable($this->dbDriver);
|
152 |
+
$codeFile = new CJTBlockFilesTable($this->dbDriver);
|
153 |
// Get blocks revisions.
|
154 |
$revisions['fields'] = array('id');
|
155 |
$revisions['filters']['parent'] = $ids;
|
162 |
if (!empty($revisions)) {
|
163 |
$blocks->delete($revisions);
|
164 |
$pins->delete($revisions);
|
165 |
+
// Delete code files.
|
166 |
+
$this->dbDriver->delete(sprintf('DELETE FROM #__cjtoolbox_block_files WHERE blockId IN(%s)', implode(',', $revisions)));
|
167 |
}
|
168 |
+
// Delete linked templates.
|
169 |
+
$linkedOnlyTemplatesQuery = 'DELETE FROM #__cjtoolbox_block_templates WHERE blockId IN(%s)';
|
170 |
+
$this->dbDriver->delete(sprintf($linkedOnlyTemplatesQuery, implode(',', $ids)));
|
171 |
+
// Delete associated parameters.
|
172 |
+
$mdlParams = new CJT_Models_Parameters();
|
173 |
+
$mdlParams->delete($ids);
|
174 |
+
// Delete form.
|
175 |
+
$mdlForm = new CJT_Models_Forms();
|
176 |
+
$mdlForm->delete($ids);
|
177 |
// Delete blocks.
|
178 |
$blocks->delete($ids);
|
179 |
$pins->delete($ids);
|
180 |
+
// Delete code files.
|
181 |
+
$this->dbDriver->delete(sprintf('DELETE FROM #__cjtoolbox_block_files WHERE blockId IN(%s)', implode(',', $ids)));
|
182 |
// Chaining!
|
183 |
return $this;
|
184 |
}
|
201 |
* @param mixed $ids
|
202 |
*/
|
203 |
public function getBlocks($ids = array(), $filters = array(), $fields = array('*'), $returnType = OBJECT_K, $orderBy = array(), $useDefaultBackupFltr = true) {
|
204 |
+
// initialize.
|
205 |
$blocks = array();
|
206 |
+
$returnCodeFile = isset($filters['returnCodeFile']) && ($filters['returnCodeFile'] == true);
|
207 |
+
unset($filters['returnCodeFile']);
|
208 |
// Create Tables objects.
|
209 |
$blocksTable = new CJTBlocksTable($this->dbDriver);
|
210 |
$pinsTable = new CJTBlockPinsTable($this->dbDriver);
|
211 |
+
$blockFiles = new CJTBlockFilesTable($this->dbDriver);
|
212 |
// Read blocks.
|
213 |
$blocks = $blocksTable->get($ids, $fields, $filters, $returnType, $orderBy, $useDefaultBackupFltr);
|
214 |
// Get only pins for retrieved blocks.
|
221 |
// e.g blocks[ID]->pages[] = PAGE-ID.
|
222 |
$blocks[$pin->blockId]->{$pin->pin}[] = $pin->value;
|
223 |
}
|
224 |
+
// Get active file code.
|
225 |
+
// There always should be active file unless that the
|
226 |
+
// requested block is never switched by current author before.
|
227 |
+
// However we'll do that only if filters['returnCodeFile'] set to TRUE.
|
228 |
+
if ($returnCodeFile) {
|
229 |
+
foreach ($ids as $id) {
|
230 |
+
if(!$activeFileId = $this->getCurrentAuthorBlockActiveFileId($id)) {
|
231 |
+
// If first time use masterFile ID as he default.
|
232 |
+
$activeFileId = $blocks[$id]->masterFile;
|
233 |
+
}
|
234 |
+
// Retreive code for block code file.
|
235 |
+
$codeFile = (array) $blockFiles->setData(array('blockId' => $id, 'id' => $activeFileId))
|
236 |
+
->load()
|
237 |
+
->getData();
|
238 |
+
unset($codeFile['description']);
|
239 |
+
$blocks[$id]->file = (object) $codeFile;
|
240 |
+
// Also return the active file id withing the set.
|
241 |
+
$blocks[$id]->activeFileId = $activeFileId;
|
242 |
+
}
|
243 |
+
}
|
244 |
return $blocks;
|
245 |
}
|
246 |
|
247 |
+
/**
|
248 |
+
* put your comment there...
|
249 |
+
*
|
250 |
+
* @param mixed $blockId
|
251 |
+
* @param mixed $authorId
|
252 |
+
*/
|
253 |
+
public function getAuthorBlockActiveFileId($blockId, $authorId = null) {
|
254 |
+
// Get author active file for the requested block.
|
255 |
+
$activeFileId = (int) get_user_meta($authorId, "cjt_block_active_file_{$blockId}", true);
|
256 |
+
// Query block active file.
|
257 |
+
return $activeFileId;
|
258 |
+
}
|
259 |
+
|
260 |
+
/**
|
261 |
+
* put your comment there...
|
262 |
+
*
|
263 |
+
* @param mixed $blockId
|
264 |
+
* @param mixed $authorId
|
265 |
+
*/
|
266 |
+
public function getCurrentAuthorBlockActiveFileId($blockId) {
|
267 |
+
return $this->getAuthorBlockActiveFileId($blockId, get_current_user_id());
|
268 |
+
}
|
269 |
+
|
270 |
/**
|
271 |
* put your comment there...
|
272 |
*
|
321 |
* @param mixed $block
|
322 |
*/
|
323 |
public function update($block, $updatePins) {
|
324 |
+
// To be used by array_intersect_key.
|
325 |
+
$block = (array) $block;
|
326 |
// Create Tables objects.
|
327 |
$blocks = new CJTBlocksTable($this->dbDriver);
|
328 |
$pins = new CJTBlockPinsTable($this->dbDriver);
|
332 |
$pinsData = array_intersect_key($block, array_flip(array('pages', 'posts', 'categories')));
|
333 |
$pins->update($block['id'], $pinsData);
|
334 |
}
|
335 |
+
// Update code file
|
336 |
+
if (isset($block['activeFileId'])) {
|
337 |
+
$codeFile = new CJTBlockFilesTable($this->dbDriver);
|
338 |
+
$codeFile->set('blockId', $block['id'])
|
339 |
+
->set('id', $block['activeFileId'])
|
340 |
+
->set('code', $block['code'])
|
341 |
+
->save();
|
342 |
+
}
|
343 |
// Isolate block fields.
|
344 |
+
$blockData = array_intersect_key($block, $blocks->getFields());
|
345 |
+
$blocks->update($blockData);
|
346 |
}
|
347 |
|
348 |
} // End class.
|
models/coupling.php
CHANGED
@@ -28,6 +28,13 @@ class CJTCouplingModel extends CJTHookableClass {
|
|
28 |
*/
|
29 |
protected $ongetorder = array('parameters' => array('order'));
|
30 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
31 |
/**
|
32 |
* put your comment there...
|
33 |
*
|
@@ -45,6 +52,60 @@ class CJTCouplingModel extends CJTHookableClass {
|
|
45 |
*/
|
46 |
protected $onrequestblocks = array('parameters' => array('blocks'));
|
47 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
48 |
/**
|
49 |
* put your comment there...
|
50 |
*
|
@@ -80,6 +141,55 @@ class CJTCouplingModel extends CJTHookableClass {
|
|
80 |
return $blocks;
|
81 |
}
|
82 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
83 |
} // End class.
|
84 |
|
85 |
|
28 |
*/
|
29 |
protected $ongetorder = array('parameters' => array('order'));
|
30 |
|
31 |
+
/**
|
32 |
+
* put your comment there...
|
33 |
+
*
|
34 |
+
* @var mixed
|
35 |
+
*/
|
36 |
+
protected $onquerylinkedtemplates = array('parameters' => array('query'));
|
37 |
+
|
38 |
/**
|
39 |
* put your comment there...
|
40 |
*
|
52 |
*/
|
53 |
protected $onrequestblocks = array('parameters' => array('blocks'));
|
54 |
|
55 |
+
/**
|
56 |
+
* put your comment there...
|
57 |
+
*
|
58 |
+
* @var mixed
|
59 |
+
*/
|
60 |
+
public static $templateTypes = array('scripts' => 'javascript', 'styles' => 'css');
|
61 |
+
|
62 |
+
/**
|
63 |
+
* put your comment there...
|
64 |
+
*
|
65 |
+
* @param mixed $id
|
66 |
+
*/
|
67 |
+
public function getBlockCode($id) {
|
68 |
+
// Initialize.
|
69 |
+
$code = '';
|
70 |
+
// Initialize.
|
71 |
+
$tblCodeFiles = new CJTBlockFilesTable(cssJSToolbox::getInstance()->getDBDriver());
|
72 |
+
// Query Block Code Files.
|
73 |
+
$codeFiles = $tblCodeFiles->set('blockId', $id)
|
74 |
+
->fetchAll();
|
75 |
+
// Merge all code files.
|
76 |
+
foreach ($codeFiles as $codeFile) {
|
77 |
+
// Wrap by Tag + Merge files.
|
78 |
+
$code .= $codeFile['tag'] ? sprintf($codeFile['tag'], " {$codeFile['code']} ") : $codeFile['code'];
|
79 |
+
}
|
80 |
+
// Return final code text.
|
81 |
+
return $code;
|
82 |
+
}
|
83 |
+
|
84 |
+
/**
|
85 |
+
* put your comment there...
|
86 |
+
*
|
87 |
+
* @param mixed $blockId
|
88 |
+
*/
|
89 |
+
public function getExecTemplatesCode($blockId) {
|
90 |
+
// Initialize.
|
91 |
+
$code = '';
|
92 |
+
// Get all HTML and PHP templates linked to the block.
|
93 |
+
$templates = $this->getLinkedTemplates($blockId, array('php', 'html'));
|
94 |
+
if (!empty($templates)) {
|
95 |
+
// Instantiate template model.
|
96 |
+
$templateModel = CJTModel::getInstance('template');
|
97 |
+
// Concat their codes.
|
98 |
+
foreach ($templates as $template) {
|
99 |
+
// Fetch template record with code loaded from file and decrypted if PHP!
|
100 |
+
$templateModel->inputs['id'] = $template->id;
|
101 |
+
$template = $templateModel->getItem();
|
102 |
+
// Concat
|
103 |
+
$code .= $template->code;
|
104 |
+
}
|
105 |
+
}
|
106 |
+
return $code;
|
107 |
+
}
|
108 |
+
|
109 |
/**
|
110 |
* put your comment there...
|
111 |
*
|
141 |
return $blocks;
|
142 |
}
|
143 |
|
144 |
+
/**
|
145 |
+
* put your comment there...
|
146 |
+
*
|
147 |
+
* @param mixed $blocks
|
148 |
+
* @param mixed $types
|
149 |
+
*/
|
150 |
+
public function getLinkedTemplates($blocks, $types = array('javascript', 'css')) {
|
151 |
+
// Accept single id too!
|
152 |
+
$blocks = (array) $blocks;
|
153 |
+
// Import dependencies!
|
154 |
+
cssJSToolbox::import('framework:db:mysql:xtable.inc.php', 'tables:template-revision.php');
|
155 |
+
// Initialize vars.
|
156 |
+
$templates = array();
|
157 |
+
$query['select'] = 'SELECT t.id, t.type, t.queueName, r.version, r.file, bt.blockId';
|
158 |
+
$query['from'] = 'FROM #__cjtoolbox_block_templates bt LEFT JOIN #__cjtoolbox_templates t
|
159 |
+
ON bt.templateId = t.id
|
160 |
+
LEFT JOIN #__cjtoolbox_template_revisions r
|
161 |
+
ON bt.templateId = r.templateId';
|
162 |
+
// Filter by blocks ids and getting the last revision of the template!
|
163 |
+
$query['where']['blocks'] = implode(',', $blocks);
|
164 |
+
$query['where']['attributes'] = CJTTemplateRevisionTable::FLAG_LAST_REVISION;
|
165 |
+
// Filter by type.
|
166 |
+
$query['where']['types'] = '"' . implode('","', $types) . '"';
|
167 |
+
// Where clause.
|
168 |
+
$query['where'] = "WHERE bt.blockId IN ({$query['where']['blocks']}) AND
|
169 |
+
(r.attributes & {$query['where']['attributes']}) AND
|
170 |
+
t.type IN ({$query['where']['types']})";
|
171 |
+
// Filering!
|
172 |
+
$query = $this->onquerylinkedtemplates($query);
|
173 |
+
$query = "{$query['select']} {$query['from']} {$query['where']}";
|
174 |
+
$templates = cssJSToolbox::getInstance()->getDBDriver()->select($query);
|
175 |
+
return $templates;
|
176 |
+
}
|
177 |
+
|
178 |
+
/**
|
179 |
+
* put your comment there...
|
180 |
+
*
|
181 |
+
* @param mixed $type
|
182 |
+
*/
|
183 |
+
public function getQueueObject($type) {
|
184 |
+
// Make sure Queue Object is ready/instantiated!
|
185 |
+
$globalQueueObjectName = "wp_{$type}";
|
186 |
+
if (!isset($GLOBALS[$globalQueueObjectName])) {
|
187 |
+
$queueClass = 'WP_' . ucfirst($type);
|
188 |
+
$GLOBALS[$globalQueueObjectName] = new $queueClass();
|
189 |
+
}
|
190 |
+
return $GLOBALS[$globalQueueObjectName];
|
191 |
+
}
|
192 |
+
|
193 |
} // End class.
|
194 |
|
195 |
|
models/extensions.php
CHANGED
@@ -17,8 +17,7 @@ class CJTExtensionsModel {
|
|
17 |
*/
|
18 |
public function getListTypeName() {
|
19 |
// if the search term is for CJT extensions return 'extensions' otherwise return 'plugins'
|
20 |
-
|
21 |
-
return $type;
|
22 |
}
|
23 |
|
24 |
} // End class.
|
17 |
*/
|
18 |
public function getListTypeName() {
|
19 |
// if the search term is for CJT extensions return 'extensions' otherwise return 'plugins'
|
20 |
+
return ((isset($_REQUEST['s']) && ($_REQUEST['s'] == CJTExtensionsAccessPoint::PLUGINS_PAGE_SEARCH_TERM)) ? 'extensions' : 'plugins');
|
|
|
21 |
}
|
22 |
|
23 |
} // End class.
|
models/fields/template-authors.php
ADDED
@@ -0,0 +1,32 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
*
|
4 |
+
*/
|
5 |
+
|
6 |
+
// Import dependencies.
|
7 |
+
cssJSToolbox::import('framework:html:list.php', 'framework:db:mysql:xtable.inc.php');
|
8 |
+
|
9 |
+
/**
|
10 |
+
*
|
11 |
+
*/
|
12 |
+
class CJTTemplateAuthorsField extends CJTListField {
|
13 |
+
|
14 |
+
/**
|
15 |
+
* put your comment there...
|
16 |
+
*
|
17 |
+
*/
|
18 |
+
protected function prepareItems() {
|
19 |
+
CJTxTable::import('author');
|
20 |
+
$internalAuthorsFlag = CJTAuthorTable::FLAG_SYS_AUTHOR;
|
21 |
+
// Query CJT Authors + Wordpress build-in local users.
|
22 |
+
$query = " SELECT a.id, a.name `text`
|
23 |
+
FROM #__cjtoolbox_authors a
|
24 |
+
RIGHT JOIN #__cjtoolbox_templates t
|
25 |
+
ON a.id = t.authorId
|
26 |
+
WHERE (a.attributes & {$internalAuthorsFlag}) = 0
|
27 |
+
ORDER BY `text`";
|
28 |
+
// Get all exists authors
|
29 |
+
$this->items = cssJSToolbox::getInstance()->getDBDriver()->select($query);
|
30 |
+
}
|
31 |
+
|
32 |
+
} // End class.
|
models/fields/template-creation-dates.php
ADDED
@@ -0,0 +1,31 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
*
|
4 |
+
*/
|
5 |
+
|
6 |
+
// Import dependencies.
|
7 |
+
cssJSToolbox::import('framework:html:list.php', 'framework:db:mysql:xtable.inc.php');
|
8 |
+
|
9 |
+
/**
|
10 |
+
*
|
11 |
+
*/
|
12 |
+
class CJTTemplateCreationDatesField extends CJTListField {
|
13 |
+
|
14 |
+
/**
|
15 |
+
* put your comment there...
|
16 |
+
*
|
17 |
+
*/
|
18 |
+
protected function prepareItems() {
|
19 |
+
CJTxTable::import('author');
|
20 |
+
$internalAuthorsFlag = CJTAuthorTable::FLAG_SYS_AUTHOR;
|
21 |
+
// Query all dates (without time!) or internal authors.
|
22 |
+
$query = " SELECT DISTINCT(DATE(t.creationDate)) `text`
|
23 |
+
FROM #__cjtoolbox_templates t
|
24 |
+
LEFT JOIN #__cjtoolbox_authors a
|
25 |
+
ON t.authorId = a.id
|
26 |
+
WHERE (a.attributes & {$internalAuthorsFlag}) = 0
|
27 |
+
ORDER BY `text`;";
|
28 |
+
$this->items = cssJSToolbox::getInstance()->getDBDriver()->select($query);
|
29 |
+
}
|
30 |
+
|
31 |
+
} // End class.
|
models/fields/template-development-states.php
ADDED
@@ -0,0 +1,44 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
*
|
4 |
+
*/
|
5 |
+
|
6 |
+
// Import dependencies.
|
7 |
+
cssJSToolbox::import('framework:html:list.php', 'framework:db:mysql:xtable.inc.php');
|
8 |
+
|
9 |
+
/**
|
10 |
+
*
|
11 |
+
*/
|
12 |
+
class CJTTemplateDevelopmentStatesField extends CJTListField {
|
13 |
+
|
14 |
+
/**
|
15 |
+
* put your comment there...
|
16 |
+
*
|
17 |
+
*/
|
18 |
+
protected function prepareItems() {
|
19 |
+
if ((isset($this->options['result'])) && ($this->options['result'] == 'fullList')) {
|
20 |
+
$this->items['release']['text'] = cssJSToolbox::getText('release');
|
21 |
+
$this->items['beta']['text'] = cssJSToolbox::getText('beta');
|
22 |
+
$this->items['alpha']['text'] = cssJSToolbox::getText('alpha');
|
23 |
+
$this->items['release-candidate']['text'] = cssJSToolbox::getText('release-candidate');
|
24 |
+
$this->items['revision']['text'] = cssJSToolbox::getText('revision');
|
25 |
+
}
|
26 |
+
else {
|
27 |
+
// Import dependencies.
|
28 |
+
CJTxTable::import('template-revision');
|
29 |
+
CJTxTable::import('author');
|
30 |
+
$lastVersionFlag = CJTTemplateRevisionTable::FLAG_LAST_REVISION;
|
31 |
+
$internalAuthorsFlag = CJTAuthorTable::FLAG_SYS_AUTHOR;
|
32 |
+
$query = "SELECT DISTINCT(r.state) `text`
|
33 |
+
FROM #__cjtoolbox_template_revisions r
|
34 |
+
LEFT JOIN #__cjtoolbox_templates t
|
35 |
+
ON r.templateId = t.id
|
36 |
+
LEFT JOIN #__cjtoolbox_authors a
|
37 |
+
ON t.authorId = a.id
|
38 |
+
WHERE (r.attributes & {$lastVersionFlag}) AND (a.attributes & {$internalAuthorsFlag}) = 0
|
39 |
+
ORDER BY `text`";
|
40 |
+
$this->items = cssJSToolbox::getInstance()->getDBDriver()->select($query);
|
41 |
+
}
|
42 |
+
}
|
43 |
+
|
44 |
+
} // End class.
|
models/fields/template-last-modified-dates.php
ADDED
@@ -0,0 +1,36 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
*
|
4 |
+
*/
|
5 |
+
|
6 |
+
// Import dependencies.
|
7 |
+
cssJSToolbox::import('framework:html:list.php', 'framework:db:mysql:xtable.inc.php');
|
8 |
+
|
9 |
+
/**
|
10 |
+
*
|
11 |
+
*/
|
12 |
+
class CJTTemplateLastModifiedDatesField extends CJTListField {
|
13 |
+
|
14 |
+
/**
|
15 |
+
* put your comment there...
|
16 |
+
*
|
17 |
+
*/
|
18 |
+
protected function prepareItems() {
|
19 |
+
// Import dependencies.
|
20 |
+
CJTxTable::import('template-revision');
|
21 |
+
CJTxTable::import('author');
|
22 |
+
$lastVersionFlag = CJTTemplateRevisionTable::FLAG_LAST_REVISION;
|
23 |
+
$internalAuthorsFlag = CJTAuthorTable::FLAG_SYS_AUTHOR;
|
24 |
+
// Query all dates (without time!).
|
25 |
+
$query = " SELECT DISTINCT(DATE(r.dateCreated)) `text`
|
26 |
+
FROM #__cjtoolbox_template_revisions r
|
27 |
+
LEFT JOIN #__cjtoolbox_templates t
|
28 |
+
ON r.templateId = t.id
|
29 |
+
LEFT JOIN #__cjtoolbox_authors a
|
30 |
+
ON t.authorId = a.id
|
31 |
+
WHERE (r.attributes & {$lastVersionFlag}) AND (a.attributes & {$internalAuthorsFlag}) = 0
|
32 |
+
ORDER BY `text`";
|
33 |
+
$this->items = cssJSToolbox::getInstance()->getDBDriver()->select($query);
|
34 |
+
}
|
35 |
+
|
36 |
+
} // End class.
|
models/fields/template-owners.php
ADDED
@@ -0,0 +1,28 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
*
|
4 |
+
*/
|
5 |
+
|
6 |
+
// Import dependencies.
|
7 |
+
cssJSToolbox::import('framework:html:list.php', 'framework:db:mysql:xtable.inc.php');
|
8 |
+
|
9 |
+
/**
|
10 |
+
*
|
11 |
+
*/
|
12 |
+
class CJTTemplateOwnersField extends CJTListField {
|
13 |
+
|
14 |
+
/**
|
15 |
+
* put your comment there...
|
16 |
+
*
|
17 |
+
*/
|
18 |
+
protected function prepareItems() {
|
19 |
+
// Query CJT Authors + Wordpress build-in local users.
|
20 |
+
$query = ' SELECT o.ID id, o.user_login `text`
|
21 |
+
FROM #__wordpress_users o
|
22 |
+
RIGHT JOIN #__cjtoolbox_templates t
|
23 |
+
ON o.ID = t.ownerId ORDER BY `text`';
|
24 |
+
// Get all exists authors
|
25 |
+
$this->items = cssJSToolbox::getInstance()->getDBDriver()->select($query);
|
26 |
+
}
|
27 |
+
|
28 |
+
} // End class.
|
models/fields/template-states.php
ADDED
@@ -0,0 +1,38 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
*
|
4 |
+
*/
|
5 |
+
|
6 |
+
// Import dependencies.
|
7 |
+
cssJSToolbox::import('framework:html:list.php', 'framework:db:mysql:xtable.inc.php');
|
8 |
+
|
9 |
+
/**
|
10 |
+
*
|
11 |
+
*/
|
12 |
+
class CJTTemplateStatesField extends CJTListField {
|
13 |
+
|
14 |
+
/**
|
15 |
+
* put your comment there...
|
16 |
+
*
|
17 |
+
*/
|
18 |
+
protected function prepareItems() {
|
19 |
+
if (isset($this->options['result']) && ($this->options['result'] == 'fullList')) {
|
20 |
+
$this->items['published']['text'] = cssJSToolbox::getText('published');
|
21 |
+
$this->items['draft']['text'] = cssJSToolbox::getText('draft');
|
22 |
+
$this->items['trash']['text'] = cssJSToolbox::getText('trash');
|
23 |
+
}
|
24 |
+
else {
|
25 |
+
CJTxTable::import('author');
|
26 |
+
$internalAuthorsFlag = CJTAuthorTable::FLAG_SYS_AUTHOR;
|
27 |
+
// Query all template state exluding Internal authors.
|
28 |
+
$query = "SELECT DISTINCT(state) `text`
|
29 |
+
FROM #__cjtoolbox_templates t
|
30 |
+
LEFT JOIN #__cjtoolbox_authors a
|
31 |
+
ON t.authorId = a.id
|
32 |
+
WHERE (a.attributes & {$internalAuthorsFlag}) = 0
|
33 |
+
ORDER BY `text`";
|
34 |
+
$this->items = cssJSToolbox::getInstance()->getDBDriver()->select($query);
|
35 |
+
}
|
36 |
+
}
|
37 |
+
|
38 |
+
} // End class.
|
models/fields/template-types.php
ADDED
@@ -0,0 +1,39 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
*
|
4 |
+
*/
|
5 |
+
|
6 |
+
// Import dependencies.
|
7 |
+
cssJSToolbox::import('framework:html:list.php', 'framework:db:mysql:xtable.inc.php');
|
8 |
+
|
9 |
+
/**
|
10 |
+
*
|
11 |
+
*/
|
12 |
+
class CJTTemplateTypesField extends CJTListField {
|
13 |
+
|
14 |
+
/**
|
15 |
+
* put your comment there...
|
16 |
+
*
|
17 |
+
*/
|
18 |
+
protected function prepareItems() {
|
19 |
+
if ((isset($this->options['result'])) && ($this->options['result'] == 'fullList')) {
|
20 |
+
$this->items['css']['text'] = cssJSToolbox::getText('css');
|
21 |
+
$this->items['javascript']['text'] = cssJSToolbox::getText('javascript');
|
22 |
+
$this->items['html']['text'] = cssJSToolbox::getText('html');
|
23 |
+
$this->items['php']['text'] = cssJSToolbox::getText('php');
|
24 |
+
}
|
25 |
+
else {
|
26 |
+
CJTxTable::import('author');
|
27 |
+
$internalAuthorsFlag = CJTAuthorTable::FLAG_SYS_AUTHOR;
|
28 |
+
// Query all types ezcluding internal authors!
|
29 |
+
$query = "SELECT DISTINCT(type) `text`
|
30 |
+
FROM #__cjtoolbox_templates t
|
31 |
+
LEFT JOIN #__cjtoolbox_authors a
|
32 |
+
ON t.authorId = a.id
|
33 |
+
WHERE (a.attributes & {$internalAuthorsFlag}) = 0
|
34 |
+
ORDER BY `text`";
|
35 |
+
$this->items = cssJSToolbox::getInstance()->getDBDriver()->select($query);
|
36 |
+
}
|
37 |
+
}
|
38 |
+
|
39 |
+
} // End class.
|
models/fields/template-versions.php
ADDED
@@ -0,0 +1,36 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
*
|
4 |
+
*/
|
5 |
+
|
6 |
+
// Import dependencies.
|
7 |
+
cssJSToolbox::import('framework:html:list.php', 'framework:db:mysql:xtable.inc.php');
|
8 |
+
|
9 |
+
/**
|
10 |
+
*
|
11 |
+
*/
|
12 |
+
class CJTTemplateVersionsField extends CJTListField {
|
13 |
+
|
14 |
+
/**
|
15 |
+
* put your comment there...
|
16 |
+
*
|
17 |
+
*/
|
18 |
+
protected function prepareItems() {
|
19 |
+
// Import dependencies.
|
20 |
+
CJTxTable::import('template-revision');
|
21 |
+
CJTxTable::import('author');
|
22 |
+
$lastVersionFlag = CJTTemplateRevisionTable::FLAG_LAST_REVISION;
|
23 |
+
$internalAuthorsFlag = CJTAuthorTable::FLAG_SYS_AUTHOR;
|
24 |
+
// Query CJT Authors + Wordpress build-in local users.
|
25 |
+
$query = "SELECT DISTINCT(r.version) `text`
|
26 |
+
FROM #__cjtoolbox_template_revisions r
|
27 |
+
LEFT JOIN #__cjtoolbox_templates t
|
28 |
+
ON r.templateId = t.id
|
29 |
+
LEFT JOIN #__cjtoolbox_authors a
|
30 |
+
ON t.authorId = a.id
|
31 |
+
WHERE (r.attributes & {$lastVersionFlag}) AND (a.attributes & {$internalAuthorsFlag}) = 0
|
32 |
+
ORDER BY `text`;";
|
33 |
+
$this->items = cssJSToolbox::getInstance()->getDBDriver()->select($query);
|
34 |
+
}
|
35 |
+
|
36 |
+
} // End class.
|
models/formgroups.php
ADDED
@@ -0,0 +1,67 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
*
|
4 |
+
*/
|
5 |
+
|
6 |
+
/**
|
7 |
+
*
|
8 |
+
*/
|
9 |
+
class CJT_Models_Formgroups {
|
10 |
+
|
11 |
+
/**
|
12 |
+
* Delete parameter or group or parameters
|
13 |
+
* or all parameters associasted to specific block.
|
14 |
+
*
|
15 |
+
* Each Key might has only the parameterId or blockId or both of them.
|
16 |
+
*
|
17 |
+
* @param array array('formId' => ID, 'groupId' => 'ID).
|
18 |
+
* @return
|
19 |
+
*/
|
20 |
+
public function delete($keys) {
|
21 |
+
// Initialize.
|
22 |
+
$tblFormGroup = CJTxTable::getInstance('form-group')
|
23 |
+
->setTableKey(array('formId', 'groupId'));
|
24 |
+
$tblGroupXFields= CJTxTable::getInstance('form-group-xfields')
|
25 |
+
->setTableKey(array('groupId'));
|
26 |
+
$tblGroupParam = CJTxTable::getInstance('group-parameter')
|
27 |
+
->setTableKey(array('groupId'));
|
28 |
+
$tblParamTypedef = CJTxTable::getInstance('parameter-typedef')
|
29 |
+
->setTableKey(array('parameterId'));
|
30 |
+
// Delete groups..
|
31 |
+
foreach ($keys as $key) {
|
32 |
+
// Allow only blockId to be passed as scalar!
|
33 |
+
if (!is_array($key)) {
|
34 |
+
$key = array($key);
|
35 |
+
}
|
36 |
+
// Blolckid passed @index 0 while parameters id @index 1
|
37 |
+
$key = array(
|
38 |
+
'formId' => $key[0],
|
39 |
+
'groupId' => isset($key[1]) ? $key[1] : null,
|
40 |
+
);
|
41 |
+
// Get all exists ids
|
42 |
+
$groups = $tblFormGroup->setData($key)
|
43 |
+
->fetchAll();
|
44 |
+
// For each group get all assocuated parameters.
|
45 |
+
foreach ($groups as $group) {
|
46 |
+
// Delete GROUP XFields record associated with the group.
|
47 |
+
$tblGroupXFields->set('groupId', $group['id'])
|
48 |
+
->delete();
|
49 |
+
// Get all params.
|
50 |
+
$params = $tblGroupParam->set('groupId', $group['id'])
|
51 |
+
->fetchAll();
|
52 |
+
// Delete parameters typedef!
|
53 |
+
foreach ($params as $param) {
|
54 |
+
$tblParamTypedef->set('parameterId', $param['parameterId'])
|
55 |
+
->delete();
|
56 |
+
}
|
57 |
+
// Delete group parameters.
|
58 |
+
$tblGroupParam->delete();
|
59 |
+
}
|
60 |
+
// Delete groups.
|
61 |
+
$tblFormGroup->delete();
|
62 |
+
}
|
63 |
+
// Chaining.
|
64 |
+
return $this;
|
65 |
+
}
|
66 |
+
|
67 |
+
} // End class.
|
models/forms.php
ADDED
@@ -0,0 +1,33 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
*
|
4 |
+
*/
|
5 |
+
|
6 |
+
/**
|
7 |
+
*
|
8 |
+
*/
|
9 |
+
class CJT_Models_Forms {
|
10 |
+
|
11 |
+
/**
|
12 |
+
* put your comment there...
|
13 |
+
*
|
14 |
+
* @param mixed $blockId
|
15 |
+
*/
|
16 |
+
public function delete($blockIds) {
|
17 |
+
// Initialize.
|
18 |
+
$tblForm = CJTxTable::getInstance('form')
|
19 |
+
->setTableKey(array('blockId'));
|
20 |
+
// Delete all forms.
|
21 |
+
foreach ($blockIds as $blockId) {
|
22 |
+
// Delete the form!
|
23 |
+
$tblForm->setData(array('blockId' => $blockId))
|
24 |
+
->delete();
|
25 |
+
}
|
26 |
+
// Delete form groups.
|
27 |
+
$mdlGroups = new CJT_Models_Formgroups();
|
28 |
+
$mdlGroups->delete($blockIds);
|
29 |
+
// Chaining.
|
30 |
+
return $this;
|
31 |
+
}
|
32 |
+
|
33 |
+
} // End class.
|
models/installer.php
CHANGED
@@ -169,7 +169,6 @@ class CJTInstallerModel {
|
|
169 |
}
|
170 |
}
|
171 |
}
|
172 |
-
// Returns.
|
173 |
return $result;
|
174 |
}
|
175 |
|
169 |
}
|
170 |
}
|
171 |
}
|
|
|
172 |
return $result;
|
173 |
}
|
174 |
|
models/metabox.php
ADDED
@@ -0,0 +1,175 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
*
|
4 |
+
*/
|
5 |
+
|
6 |
+
// No direct access allowed.
|
7 |
+
defined('ABSPATH') or die("Access denied");
|
8 |
+
|
9 |
+
// Import dependencies.
|
10 |
+
cssJSToolbox::import('tables:blocks.php');
|
11 |
+
|
12 |
+
/**
|
13 |
+
*
|
14 |
+
*/
|
15 |
+
class CJTMetaboxModel {
|
16 |
+
|
17 |
+
/** */
|
18 |
+
const STATE_CREATED = 'created';
|
19 |
+
|
20 |
+
/** */
|
21 |
+
const STATE_DELETED = 'deleted';
|
22 |
+
|
23 |
+
/**
|
24 |
+
* put your comment there...
|
25 |
+
*
|
26 |
+
* @var mixed
|
27 |
+
*/
|
28 |
+
private $dbDriver = null;
|
29 |
+
|
30 |
+
/**
|
31 |
+
* put your comment there...
|
32 |
+
*
|
33 |
+
* @var mixed
|
34 |
+
*/
|
35 |
+
protected $post = null;
|
36 |
+
|
37 |
+
/**
|
38 |
+
* put your comment there...
|
39 |
+
*
|
40 |
+
* @param mixed $post
|
41 |
+
* @return CJTPostModel
|
42 |
+
*/
|
43 |
+
public function __construct($params) {
|
44 |
+
// Get post object from post Id.
|
45 |
+
$this->post = get_post($params[0]);
|
46 |
+
// Import dependencies.
|
47 |
+
cssJSToolbox::import('framework:db:mysql:queue-driver.inc.php', 'framework:db:mysql:table.inc.php');
|
48 |
+
// Instantiate MYSQL DB Driver object.
|
49 |
+
$this->dbDriver = new CJTMYSQLQueueDriver($GLOBALS['wpdb']);
|
50 |
+
}
|
51 |
+
|
52 |
+
/**
|
53 |
+
* put your comment there...
|
54 |
+
*
|
55 |
+
* @param mixed $blockId
|
56 |
+
*/
|
57 |
+
public function create(& $pin = null) {
|
58 |
+
// Import dependecnes.
|
59 |
+
cssJSToolbox::import('tables:block-pins.php');
|
60 |
+
// Change metabox status to be created.
|
61 |
+
$this->setState(self::STATE_CREATED);
|
62 |
+
// Add post pin to pins table.
|
63 |
+
$blockPinsTable = new CJTBlockPinsTable($this->dbDriver);
|
64 |
+
// Pin data.
|
65 |
+
$pin = (object) array();
|
66 |
+
// Import CJTBlockModel class.
|
67 |
+
CJTModel::import('block');
|
68 |
+
/** @todo Only temporary in version 6.0. Later versions should group all post types by post type name! */
|
69 |
+
switch ($this->getPost()->post_type) {
|
70 |
+
case 'page':
|
71 |
+
$pin->pin = 'pages';
|
72 |
+
$pin->flag = CJTBlockModel::PINS_PAGES_CUSTOM_PAGE;
|
73 |
+
break;
|
74 |
+
default:
|
75 |
+
$pin->pin = 'posts';
|
76 |
+
$pin->flag = CJTBlockModel::PINS_POSTS_CUSTOM_POST;
|
77 |
+
break;
|
78 |
+
}
|
79 |
+
$pin->value = $this->getPost()->ID;
|
80 |
+
// Add pin record.
|
81 |
+
$blockPinsTable->insertRaw($this->getMetaboxId(), array($pin));
|
82 |
+
// Chains!
|
83 |
+
return $this;
|
84 |
+
}
|
85 |
+
|
86 |
+
/**
|
87 |
+
* put your comment there...
|
88 |
+
*
|
89 |
+
*/
|
90 |
+
public function delete() {
|
91 |
+
return $this->setState(self::STATE_DELETED);
|
92 |
+
}
|
93 |
+
|
94 |
+
/**
|
95 |
+
* Check whether is the current post type
|
96 |
+
* can has CJT Block metabox?
|
97 |
+
*
|
98 |
+
*/
|
99 |
+
public function doPost() {
|
100 |
+
// Get all post types selected by user.
|
101 |
+
$metaboxSettings = CJTModel::create('settings')->loadPage('metabox');
|
102 |
+
// Return true is post types selected, otherwise return false.
|
103 |
+
$allowedPostTypes = $metaboxSettings->postTypes;
|
104 |
+
return in_array($this->getPost()->post_type, $allowedPostTypes);
|
105 |
+
}
|
106 |
+
|
107 |
+
/**
|
108 |
+
* put your comment there...
|
109 |
+
*
|
110 |
+
*/
|
111 |
+
public function getMetaboxId() {
|
112 |
+
$metaboxId = get_post_meta($this->getPost()->ID, CJTBlocksTable::BLOCK_META_BOX_ID_META_NAME, true);
|
113 |
+
// Cast Metabox to integer.
|
114 |
+
$metaboxId = (int) $metaboxId;
|
115 |
+
return $metaboxId;
|
116 |
+
}
|
117 |
+
|
118 |
+
/**
|
119 |
+
* put your comment there...
|
120 |
+
*
|
121 |
+
*/
|
122 |
+
public function getPost() {
|
123 |
+
return $this->post;
|
124 |
+
}
|
125 |
+
|
126 |
+
/**
|
127 |
+
* put your comment there...
|
128 |
+
*
|
129 |
+
*/
|
130 |
+
public function hasBlock() {
|
131 |
+
// If $postMeta seto to a blockId then it has block otherwise(0) it hasn't.
|
132 |
+
$metaboxStatus = get_post_meta($this->getPost()->ID, CJTBlocksTable::BLOCK_META_BOX_STATUS_META_NAME, true);
|
133 |
+
return ($metaboxStatus == self::STATE_CREATED);
|
134 |
+
}
|
135 |
+
|
136 |
+
/**
|
137 |
+
* put your comment there...
|
138 |
+
*
|
139 |
+
*/
|
140 |
+
public function reservedMetaboxBlockId() {
|
141 |
+
// Reserved if only if not already taken!
|
142 |
+
if (!$reservedId = $this->getMetaboxId()) {
|
143 |
+
// Get Blocks table instance.
|
144 |
+
$BlocksTable = new CJTBlocksTable($this->dbDriver);
|
145 |
+
// Get next Id.
|
146 |
+
$reservedId = $BlocksTable->getNextId();
|
147 |
+
// Set metabox reserved id.
|
148 |
+
update_post_meta($this->getPost()->ID, CJTBlocksTable::BLOCK_META_BOX_ID_META_NAME, $reservedId);
|
149 |
+
}
|
150 |
+
return $reservedId;
|
151 |
+
}
|
152 |
+
|
153 |
+
/**
|
154 |
+
* put your comment there...
|
155 |
+
*
|
156 |
+
*/
|
157 |
+
public function save() {
|
158 |
+
$this->dbDriver->processQueue();
|
159 |
+
// Chains
|
160 |
+
return $this;
|
161 |
+
}
|
162 |
+
|
163 |
+
/**
|
164 |
+
* put your comment there...
|
165 |
+
*
|
166 |
+
* @param mixed $state
|
167 |
+
*/
|
168 |
+
public function setState($state) {
|
169 |
+
// Update state post meta var.
|
170 |
+
update_post_meta($this->getPost()->ID, CJTBlocksTable::BLOCK_META_BOX_STATUS_META_NAME, $state);
|
171 |
+
// Chaining!
|
172 |
+
return $this;
|
173 |
+
}
|
174 |
+
|
175 |
+
} // End class.
|
models/package-file.php
ADDED
@@ -0,0 +1,254 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
*
|
4 |
+
*/
|
5 |
+
|
6 |
+
// Disllow direct access.
|
7 |
+
defined('ABSPATH') or die('Access denied');
|
8 |
+
|
9 |
+
/**
|
10 |
+
*
|
11 |
+
*/
|
12 |
+
class CJTPackageFileModel extends CJTHookableClass {
|
13 |
+
|
14 |
+
/**
|
15 |
+
* put your comment there...
|
16 |
+
*
|
17 |
+
* @var mixed
|
18 |
+
*/
|
19 |
+
protected $state = array();
|
20 |
+
|
21 |
+
/**
|
22 |
+
* put your comment there...
|
23 |
+
*
|
24 |
+
* @param mixed $property
|
25 |
+
*/
|
26 |
+
public function getState($property) {
|
27 |
+
return isset($this->state[$property]) ? $this->state[$property] : null;
|
28 |
+
}
|
29 |
+
|
30 |
+
/**
|
31 |
+
* put your comment there...
|
32 |
+
*
|
33 |
+
* @param CJTPackageFile
|
34 |
+
*/
|
35 |
+
public function install($package) {
|
36 |
+
// Initialize.
|
37 |
+
$model = null; // Current model for the element under the loop!
|
38 |
+
$item = array(); // Object Item array to be inserted in the database.
|
39 |
+
$addedObjects = array('template' => array(), 'block' => array()); // All the added objects mapped by object 'TYPE'.
|
40 |
+
// Fetch package information with all readme and license tags locatted if
|
41 |
+
// bundled with external files!
|
42 |
+
$packageInfo = $package->getItem(null, array('readme' => 'readme.txt', 'license' => 'license.txt'));
|
43 |
+
// Install only if the package record if not exists.
|
44 |
+
$modelPackage = CJTModel::getInstance('package');
|
45 |
+
if ($modelPackage->exists($packageInfo['name'])) {
|
46 |
+
// State error!
|
47 |
+
$this->state['error']['msg'] = cssJSToolbox::getText('The uploaded package is already installed!');
|
48 |
+
// Terminate!
|
49 |
+
return $this;
|
50 |
+
}
|
51 |
+
// Map definition xml TYPE attribute to CJT Model object to handle addding
|
52 |
+
// objecs types.
|
53 |
+
$objectModels = array('template' => 'template', 'block' => 'blocks');
|
54 |
+
// Initialize Wordpress file system object.
|
55 |
+
WP_Filesystem();
|
56 |
+
$fileSystem =& $GLOBALS['wp_filesystem'];
|
57 |
+
// Read all objects defined by the package.
|
58 |
+
foreach ($package->document()->objects->object as $object) {
|
59 |
+
// Prepare object + getting item to be saved into database.
|
60 |
+
$item = $package->getItem($object);
|
61 |
+
// Get current object type name.
|
62 |
+
$objectType = (string) $object->attributes()->type;
|
63 |
+
// Instantiate template model if not previously instantiated.
|
64 |
+
if (!is_object($objectModels[$objectType])) {
|
65 |
+
$objectModels[$objectType] = CJTModel::getInstance($objectModels[$objectType]);
|
66 |
+
}
|
67 |
+
// Referencing the model for current object type.
|
68 |
+
$model = $objectModels[$objectType];
|
69 |
+
$objectId = 0; // Always reset -- to don't map to package if nothing added!
|
70 |
+
// Handle different object types.
|
71 |
+
switch ($objectType) {
|
72 |
+
case 'template':
|
73 |
+
// Insert template only if not exists.
|
74 |
+
if (!$model->exists($item['name'])) {
|
75 |
+
// Import template(s) helper.
|
76 |
+
cssJSToolbox::import('includes:templates:templates.class.php');
|
77 |
+
// Set template revision.
|
78 |
+
$model->inputs['item']['revision']['code'] = $item['code'];
|
79 |
+
unset($item['code']);
|
80 |
+
// Set template main data.
|
81 |
+
$model->inputs['item']['template'] = $item;
|
82 |
+
/** Get template Type!
|
83 |
+
* Get type from external file extension if
|
84 |
+
* the template code was linked to file.
|
85 |
+
* If the template code were inline
|
86 |
+
* then the type must be provided under
|
87 |
+
* TYPE element!
|
88 |
+
*/
|
89 |
+
// If no type specified get it from the external file extension
|
90 |
+
if (!isset($model->inputs['item']['template']['type'])) {
|
91 |
+
// @WARNING: Get locatted file!
|
92 |
+
$codeFileName = (string) $object->code->attributes()->locatted;
|
93 |
+
if ($codeFileName) {
|
94 |
+
// Get type from extension.
|
95 |
+
$fileComponent = pathinfo($codeFileName);
|
96 |
+
$model->inputs['item']['template']['type'] = CJTTemplates::getExtensionType($fileComponent['extension']);
|
97 |
+
}
|
98 |
+
}
|
99 |
+
// Add template.
|
100 |
+
$addedTemplate = $model->save();
|
101 |
+
// Expose Object ID to be added to the addedObjects List.
|
102 |
+
$objectId = $addedTemplate->templateId;
|
103 |
+
// Copy template folders.
|
104 |
+
if ($foldersCollection = $object->folders) {
|
105 |
+
// Get absolute path to template directory!
|
106 |
+
$templateDirectory = ABSPATH . dirname($addedTemplate->file);
|
107 |
+
// Process all <folders> tags!
|
108 |
+
foreach ($foldersCollection as $folders) {
|
109 |
+
// Get <folders> tag common path.
|
110 |
+
$foldersPath = (string) $folders->attributes()->path;
|
111 |
+
// Process <folder> tag.
|
112 |
+
foreach ($folders as $folder) {
|
113 |
+
// Folder absolute path.
|
114 |
+
if ($detinationName = (string) $folder->attributes()->destination) {
|
115 |
+
$folderPath = $detinationName;
|
116 |
+
}
|
117 |
+
else {
|
118 |
+
$folderPath = $folder->attributes()->path;
|
119 |
+
}
|
120 |
+
$folderAbsPath = $package->getDirectory() . "/{$foldersPath}/{$folderPath}";
|
121 |
+
// Create destination path.
|
122 |
+
$folderDestinationPath = "{$templateDirectory}/{$folderPath}";
|
123 |
+
if (!file_exists($folderDestinationPath)) {
|
124 |
+
mkdir($folderDestinationPath, 0775);
|
125 |
+
}
|
126 |
+
// Copy files (FLAT)!!.
|
127 |
+
foreach (new DirectoryIterator($folderAbsPath) as $file) {
|
128 |
+
if (!$file->isDot() && $file->isFile()) {
|
129 |
+
$fileSystem->copy($file->getPathName(), "{$folderDestinationPath}/{$file->getFileName()}");
|
130 |
+
}
|
131 |
+
}
|
132 |
+
}
|
133 |
+
}
|
134 |
+
}
|
135 |
+
}
|
136 |
+
break;
|
137 |
+
case 'block';
|
138 |
+
// Set other block internal data.
|
139 |
+
$item['created'] = $item['lastModified'] = current_time('mysql');
|
140 |
+
$item['owner'] = get_current_user_id();
|
141 |
+
// Insert block into database.
|
142 |
+
$objectId = $model->add($item);
|
143 |
+
$model->save();
|
144 |
+
// Initialize for linking templates.
|
145 |
+
$modelTemplate = $objectModels['template'];
|
146 |
+
// Link block templates.
|
147 |
+
$links = $object->links->link ? $object->links->link : array();
|
148 |
+
foreach ($links as $link) {
|
149 |
+
// Get template object to link.
|
150 |
+
$templateToLinkAttributes = (array) $link->attributes();
|
151 |
+
$templateToLinkAttributes = $templateToLinkAttributes['@attributes'];
|
152 |
+
$tblTemplate = CJTxTable::getInstance('template')
|
153 |
+
->setData($templateToLinkAttributes) // Query by the given attributes.
|
154 |
+
->load(array_keys($templateToLinkAttributes));
|
155 |
+
if ($tblTemplate->get('id')) {
|
156 |
+
// Cache template id.
|
157 |
+
$templateId = $tblTemplate->get('id');
|
158 |
+
// Always link as the block should be newely added
|
159 |
+
// and in the normal cases its impossible to be alread linked!
|
160 |
+
$tableBlockTemplate = CJTxTable::getInstance('block-template');
|
161 |
+
$tableBlockTemplate->set('blockId', $objectId)
|
162 |
+
->set('templateId', $templateId)
|
163 |
+
->save();
|
164 |
+
// Add only LINKED objects to the package objects map table!
|
165 |
+
if (!key_exists($templateId, $addedObjects['template'])) {
|
166 |
+
$addedObjects['template'][$templateId] = array('objectId' => $templateId, 'relType' => 'link');
|
167 |
+
}
|
168 |
+
}
|
169 |
+
}
|
170 |
+
break;
|
171 |
+
default:
|
172 |
+
//throw new Exception('Invalid object type specified!');
|
173 |
+
break;
|
174 |
+
}
|
175 |
+
// Support pluggable nodes that will parsed only when it really used.
|
176 |
+
$this->pluggables($object, $objectId, $package);
|
177 |
+
// Add (associate with the package) last objectId only if the object is added
|
178 |
+
// as a part of the package.
|
179 |
+
if ($objectId) {
|
180 |
+
$addedObjects[$objectType][$objectId] = array('objectId' => $objectId);
|
181 |
+
}
|
182 |
+
}
|
183 |
+
// Add package to database!
|
184 |
+
$modelPackage->save($packageInfo, $addedObjects);
|
185 |
+
// Chaining.
|
186 |
+
return $this;
|
187 |
+
}
|
188 |
+
|
189 |
+
/**
|
190 |
+
* put your comment there...
|
191 |
+
*
|
192 |
+
* @param mixed $packageFile
|
193 |
+
*/
|
194 |
+
public function parse($name, $file) {
|
195 |
+
// Initialize.
|
196 |
+
$package = FALSE;
|
197 |
+
// Use a tmp dir with the same name as package without the extension.
|
198 |
+
$packageFileComponent = explode('.', $name);
|
199 |
+
$destinationDir = get_temp_dir() . $packageFileComponent[0];
|
200 |
+
// Import WP_FileSystem and unzip_file functions required to unzip the file.
|
201 |
+
require_once ABSPATH . 'wp-admin/includes/file.php';
|
202 |
+
// Initialize Wordpress file systems.
|
203 |
+
WP_Filesystem();
|
204 |
+
// Extract package archive in temporary location.
|
205 |
+
if (($result = unzip_file($file, $destinationDir)) === true) {
|
206 |
+
// Import package definition class.
|
207 |
+
cssJSToolbox::import('framework:packages:package.class.php');
|
208 |
+
$package = new CJTPackageFile($destinationDir);
|
209 |
+
}
|
210 |
+
return $package;
|
211 |
+
}
|
212 |
+
|
213 |
+
/**
|
214 |
+
* put your comment there...
|
215 |
+
*
|
216 |
+
* @param mixed $node
|
217 |
+
* @param mixed $objectId
|
218 |
+
* @param mixed $package
|
219 |
+
* @return CJTPackageFileModel
|
220 |
+
*/
|
221 |
+
public function pluggables($node, $objectId, & $package) {
|
222 |
+
// Get packages definition xml factory.
|
223 |
+
$factory = new CJT_Models_Package_Xml_Factory('models/package/xml/definition/objects');
|
224 |
+
// Based on the object type get instance of the object
|
225 |
+
// parser with the object node passed.
|
226 |
+
// call plug method so the object would start parsing the
|
227 |
+
// and plug the child elements.
|
228 |
+
$object = $factory->create(null, (string) $node->attributes()->type, $node); // OBJECT CONSTR&UCTED HERE!
|
229 |
+
// Set object id!
|
230 |
+
$object->register()->offsetSet('id', $objectId);
|
231 |
+
$object->register()->offsetSet('packageParser', $package);
|
232 |
+
// Plug it!
|
233 |
+
$object->transit()
|
234 |
+
->processInners();
|
235 |
+
// Chaining.
|
236 |
+
return $this;
|
237 |
+
}
|
238 |
+
|
239 |
+
/**
|
240 |
+
* put your comment there...
|
241 |
+
*
|
242 |
+
* @param mixed $property
|
243 |
+
* @param mixed $state
|
244 |
+
*/
|
245 |
+
public function setState($property, $state) {
|
246 |
+
// Set State!
|
247 |
+
$this->state[$property] = $state;
|
248 |
+
// Chaining.
|
249 |
+
return $this;
|
250 |
+
}
|
251 |
+
} // End class.
|
252 |
+
|
253 |
+
// Hookable!
|
254 |
+
CJTPackageFileModel::define('CJTPackageFileModel', array('hookType' => CJTWordpressEvents::HOOK_FILTER));
|
models/package.php
ADDED
@@ -0,0 +1,151 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
*
|
4 |
+
*/
|
5 |
+
|
6 |
+
// Disllow direct access.
|
7 |
+
defined('ABSPATH') or die('Access denied');
|
8 |
+
|
9 |
+
// Import dependencies.
|
10 |
+
cssJSToolbox::import('framework:db:mysql:xtable.inc.php');
|
11 |
+
|
12 |
+
/**
|
13 |
+
*
|
14 |
+
*/
|
15 |
+
class CJTPackageModel extends CJTHookableClass {
|
16 |
+
|
17 |
+
/**
|
18 |
+
* put your comment there...
|
19 |
+
*
|
20 |
+
* @var mixed
|
21 |
+
*/
|
22 |
+
protected $params = array();
|
23 |
+
|
24 |
+
/**
|
25 |
+
* Delete single package.
|
26 |
+
*
|
27 |
+
* This method is going to delete the package
|
28 |
+
* and all the templates and blocks associated to it,
|
29 |
+
* therefor it'll unlink/break-down the relationship
|
30 |
+
* between those templates and blocks.
|
31 |
+
*
|
32 |
+
* @param Integer Package Id.
|
33 |
+
* @return CJTPackageModel Return $this.
|
34 |
+
*/
|
35 |
+
public function delete($id) {
|
36 |
+
// Initialize.
|
37 |
+
$modelTemplates = CJTModel::getInstance('templates-manager');
|
38 |
+
$dbd = cssJSToolbox::getInstance()->getDBDriver();
|
39 |
+
$assoObjectsQueryTmp = 'SELECT objectId
|
40 |
+
FROM #__cjtoolbox_package_objects
|
41 |
+
WHERE packageId = %d AND objectType = "%s" AND relType = "%s";';
|
42 |
+
// Delete the package.
|
43 |
+
CJTxTable::getInstance('package')
|
44 |
+
->set('id', $id)
|
45 |
+
->delete();
|
46 |
+
// Delete blocks.
|
47 |
+
$blockIds = array_keys($dbd->select(sprintf($assoObjectsQueryTmp, $id, 'block', 'add')));
|
48 |
+
if (!empty($blockIds)) {
|
49 |
+
// Delete blocks!
|
50 |
+
CJTModel::getInstance('blocks')
|
51 |
+
->delete($blockIds)
|
52 |
+
->save();
|
53 |
+
}
|
54 |
+
// Delete templates.
|
55 |
+
$modelTemplates->inputs['ids'] = array_keys($dbd->select(sprintf($assoObjectsQueryTmp, $id, 'template', 'add')));
|
56 |
+
// Templates muct be in trash state before deleted!
|
57 |
+
$modelTemplates->inputs['state'] = 'trash';
|
58 |
+
// Move to Trash + Delete only if there is at least one Id!
|
59 |
+
empty($modelTemplates->inputs['ids']) OR ($modelTemplates->changeState() AND $modelTemplates->delete());
|
60 |
+
// Delete package objects map.
|
61 |
+
CJTxTable::getInstance('package-objects')
|
62 |
+
->set('packageId', $id)
|
63 |
+
->delete(array('packageId'));
|
64 |
+
}
|
65 |
+
|
66 |
+
/**
|
67 |
+
* put your comment there...
|
68 |
+
*
|
69 |
+
* @param mixed $packageName
|
70 |
+
*/
|
71 |
+
public function exists($packageName) {
|
72 |
+
// Load by name.
|
73 |
+
$tablePackage = CJTxTable::getInstance('package')
|
74 |
+
->set('name', $packageName)
|
75 |
+
->load(array('name'));
|
76 |
+
// The object table if exists FALSE otherwise.
|
77 |
+
return ($tablePackage->get('id') ? $tablePackage : FALSE);
|
78 |
+
}
|
79 |
+
|
80 |
+
/**
|
81 |
+
* put your comment there...
|
82 |
+
*
|
83 |
+
*/
|
84 |
+
public function getFileContent() {
|
85 |
+
// Get package ID.
|
86 |
+
$packageId = $_REQUEST['packageId'];
|
87 |
+
// Get Field/File to read.
|
88 |
+
$file = $this->getParam('file');
|
89 |
+
// LOAD file content from database.
|
90 |
+
$tblPackage = CJTxTable::getInstance('package');
|
91 |
+
$content = $tblPackage->set('id', $packageId)
|
92 |
+
->load(array('id'))
|
93 |
+
->get($file);
|
94 |
+
// Return file content.
|
95 |
+
return $content;
|
96 |
+
}
|
97 |
+
|
98 |
+
/**
|
99 |
+
* put your comment there...
|
100 |
+
*
|
101 |
+
* @param mixed $name
|
102 |
+
*/
|
103 |
+
public function getParam($name) {
|
104 |
+
return isset($this->params[$name]) ? $this->params[$name] : null;
|
105 |
+
}
|
106 |
+
|
107 |
+
/**
|
108 |
+
* put your comment there...
|
109 |
+
*
|
110 |
+
* @param mixed $package
|
111 |
+
* @param mixed $objects
|
112 |
+
* @return CJTxTable
|
113 |
+
*/
|
114 |
+
public function save($package, $types) {
|
115 |
+
// Add package.
|
116 |
+
$tablePackage = CJTxTable::getInstance('package')
|
117 |
+
->setData($package)
|
118 |
+
->save();
|
119 |
+
// Add package objects map.
|
120 |
+
$tablePackageObjects = CJTxTable::getInstance('package-objects');
|
121 |
+
// Fetch objects under each type (block ,template).
|
122 |
+
foreach ($types as $type => $objects) {
|
123 |
+
// For each types get all object IDs!
|
124 |
+
foreach ($objects as $object) {
|
125 |
+
$tablePackageObjects->setItem() // Reset is needed as the object used accross multiple records
|
126 |
+
// and might cause interfering between records!
|
127 |
+
->setData($object)
|
128 |
+
->set('packageId', $tablePackage->get('id'))
|
129 |
+
->set('objectType', $type)
|
130 |
+
->save();
|
131 |
+
}
|
132 |
+
}
|
133 |
+
}
|
134 |
+
|
135 |
+
/**
|
136 |
+
* put your comment there...
|
137 |
+
*
|
138 |
+
* @param mixed $name
|
139 |
+
* @param mixed $value
|
140 |
+
*/
|
141 |
+
public function setParam($name, $value) {
|
142 |
+
// Set internal parameter value.
|
143 |
+
$this->params[$name] = $value;
|
144 |
+
// Chaining.
|
145 |
+
return $this;
|
146 |
+
}
|
147 |
+
|
148 |
+
} // End class.
|
149 |
+
|
150 |
+
// Hookable!
|
151 |
+
CJTPackageModel::define('CJTPackageModel', array('hookType' => CJTWordpressEvents::HOOK_FILTER));
|
models/package/block.php
ADDED
@@ -0,0 +1,46 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
*
|
4 |
+
*/
|
5 |
+
|
6 |
+
/**
|
7 |
+
*
|
8 |
+
*/
|
9 |
+
class CJT_Models_Package_Block {
|
10 |
+
|
11 |
+
/**
|
12 |
+
* put your comment there...
|
13 |
+
*
|
14 |
+
* @var mixed
|
15 |
+
*/
|
16 |
+
protected $id = null;
|
17 |
+
|
18 |
+
/**
|
19 |
+
* put your comment there...
|
20 |
+
*
|
21 |
+
* @param mixed $blockId
|
22 |
+
* @return CJT_Models_Package_Block
|
23 |
+
*/
|
24 |
+
public function __construct($id) {
|
25 |
+
// Initialize.
|
26 |
+
$this->id = $id;
|
27 |
+
}
|
28 |
+
|
29 |
+
/**
|
30 |
+
* put your comment there...
|
31 |
+
*
|
32 |
+
*/
|
33 |
+
public function getPackageInfo() {
|
34 |
+
// Initialize.
|
35 |
+
$driver = cssJSToolbox::getInstance()->getDBDriver();
|
36 |
+
// Query package info for the current block.
|
37 |
+
$query = "SELECT p.id, p.author, p.webSite
|
38 |
+
FROM #__cjtoolbox_packages p RIGHT JOIN #__cjtoolbox_package_objects o
|
39 |
+
ON p.id = o.packageId AND o.objectType = 'block'
|
40 |
+
WHERE o.objectId = {$this->id};";
|
41 |
+
// Exec!
|
42 |
+
$packageInfo = $driver->getRow($query, ARRAY_A);
|
43 |
+
return $packageInfo;
|
44 |
+
}
|
45 |
+
|
46 |
+
} // End class.
|
models/package/xml/definition/abstract.php
ADDED
@@ -0,0 +1,192 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
*
|
4 |
+
*/
|
5 |
+
|
6 |
+
/**
|
7 |
+
*
|
8 |
+
*/
|
9 |
+
abstract class CJT_Models_Package_Xml_Definition_Abstract
|
10 |
+
implements CJT_Models_Package_Xml_Definition_Interface_Element {
|
11 |
+
|
12 |
+
/**
|
13 |
+
* put your comment there...
|
14 |
+
*
|
15 |
+
* @var mixed
|
16 |
+
*/
|
17 |
+
protected $childs = array();
|
18 |
+
|
19 |
+
/**
|
20 |
+
* put your comment there...
|
21 |
+
*
|
22 |
+
* @var mixed
|
23 |
+
*/
|
24 |
+
protected $defaultRule = true;
|
25 |
+
|
26 |
+
/**
|
27 |
+
* put your comment there...
|
28 |
+
*
|
29 |
+
* @var mixed
|
30 |
+
*/
|
31 |
+
protected $factory = null;
|
32 |
+
|
33 |
+
/**
|
34 |
+
* put your comment there...
|
35 |
+
*
|
36 |
+
* @var mixed
|
37 |
+
*/
|
38 |
+
protected $map = array();
|
39 |
+
|
40 |
+
/**
|
41 |
+
* put your comment there...
|
42 |
+
*
|
43 |
+
* @var mixed
|
44 |
+
*/
|
45 |
+
protected $node = null;
|
46 |
+
|
47 |
+
/**
|
48 |
+
* put your comment there...
|
49 |
+
*
|
50 |
+
* @var mixed
|
51 |
+
*/
|
52 |
+
protected $parent = null;
|
53 |
+
|
54 |
+
/**
|
55 |
+
* put your comment there...
|
56 |
+
*
|
57 |
+
* @var mixed
|
58 |
+
*/
|
59 |
+
protected $register;
|
60 |
+
|
61 |
+
/**
|
62 |
+
* put your comment there...
|
63 |
+
*
|
64 |
+
* @var mixed
|
65 |
+
*/
|
66 |
+
protected $rules = array();
|
67 |
+
|
68 |
+
/**
|
69 |
+
* put your comment there...
|
70 |
+
*
|
71 |
+
* @param SimpleXMLElement $node
|
72 |
+
* @param mixed $factory
|
73 |
+
* @return CJT_Models_Package_Xml_Definition_Abstract
|
74 |
+
*/
|
75 |
+
public function __construct(SimpleXMLElement $node, $parent, $factory) {
|
76 |
+
// Initialize.
|
77 |
+
$this->node = $node;
|
78 |
+
$this->parent = $parent;
|
79 |
+
$this->factory = $factory;
|
80 |
+
$this->register = new ArrayObject(array());
|
81 |
+
}
|
82 |
+
|
83 |
+
/**
|
84 |
+
* put your comment there...
|
85 |
+
*
|
86 |
+
*/
|
87 |
+
public function getChilds() {
|
88 |
+
return $this->childs;
|
89 |
+
}
|
90 |
+
|
91 |
+
/**
|
92 |
+
* put your comment there...
|
93 |
+
*
|
94 |
+
* @param mixed $child
|
95 |
+
*/
|
96 |
+
protected function getDefaultMap($child) {
|
97 |
+
// Initiaize.
|
98 |
+
$path = '';
|
99 |
+
$factory = $this->getFactory();
|
100 |
+
// Get default object path.
|
101 |
+
$path = $factory->obtainRelativePath(get_class($this), $child);
|
102 |
+
return $path;
|
103 |
+
}
|
104 |
+
|
105 |
+
/**
|
106 |
+
* put your comment there...
|
107 |
+
*
|
108 |
+
*/
|
109 |
+
protected function getDefaultRule() {
|
110 |
+
return $this->defaultRule;
|
111 |
+
}
|
112 |
+
|
113 |
+
/**
|
114 |
+
* put your comment there...
|
115 |
+
*
|
116 |
+
*/
|
117 |
+
public function getFactory() {
|
118 |
+
return $this->factory;
|
119 |
+
}
|
120 |
+
|
121 |
+
/***
|
122 |
+
* put your comment there...
|
123 |
+
*
|
124 |
+
*/
|
125 |
+
protected function getNode() {
|
126 |
+
return $this->node;
|
127 |
+
}
|
128 |
+
|
129 |
+
/**
|
130 |
+
* put your comment there...
|
131 |
+
*
|
132 |
+
*/
|
133 |
+
public function getParent() {
|
134 |
+
return $this->parent;
|
135 |
+
}
|
136 |
+
|
137 |
+
/**
|
138 |
+
* put your comment there...
|
139 |
+
*
|
140 |
+
*/
|
141 |
+
public function processInners() {
|
142 |
+
// Initialize.
|
143 |
+
$factory = $this->getFactory();
|
144 |
+
$childs = $this->getNode()->children();
|
145 |
+
// For every child node that has childs create an object!
|
146 |
+
foreach ($childs as $childNode) {
|
147 |
+
// Process only childs with childs nexted!
|
148 |
+
// Don't process scalars!
|
149 |
+
if (count($childNode->children())) {
|
150 |
+
// Get node name.
|
151 |
+
$nodeName = $childNode->getName();
|
152 |
+
// Initialize object factory details.
|
153 |
+
$objectInfo = array();
|
154 |
+
// Get rule.
|
155 |
+
$objectInfo['rule'] = isset($this->rules[$nodeName]) ? $this->rules[$nodeName] : $this->getDefaultRule();
|
156 |
+
// Only process if rule is set to TRUE!
|
157 |
+
if ($objectInfo['rule']) {
|
158 |
+
// Get object class map.
|
159 |
+
$objectInfo['map'] = isset($this->map[$nodeName]) ? $this->map[$nodeName] : $this->getDefaultMap($nodeName);
|
160 |
+
// Instantiate object!
|
161 |
+
$childObject = $factory->create($this, $objectInfo['map'], $childNode);
|
162 |
+
// Share parameters.
|
163 |
+
$childObject->register()->exchangeArray($this->register()->getArrayCopy());
|
164 |
+
// Transit.
|
165 |
+
$childObject->transit()
|
166 |
+
// Process inners.
|
167 |
+
->processInners();
|
168 |
+
// Cache!
|
169 |
+
$this->childs[] = $childObject;
|
170 |
+
}
|
171 |
+
}
|
172 |
+
}
|
173 |
+
return $this;
|
174 |
+
}
|
175 |
+
|
176 |
+
/**
|
177 |
+
* put your comment there...
|
178 |
+
*
|
179 |
+
*/
|
180 |
+
public function register() {
|
181 |
+
return $this->register;
|
182 |
+
}
|
183 |
+
|
184 |
+
/**
|
185 |
+
* put your comment there...
|
186 |
+
*
|
187 |
+
*/
|
188 |
+
public function transit() {
|
189 |
+
return $this;
|
190 |
+
}
|
191 |
+
|
192 |
+
} // End class.
|
models/package/xml/definition/interface/element.php
ADDED
@@ -0,0 +1,37 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
*
|
4 |
+
*/
|
5 |
+
|
6 |
+
/**
|
7 |
+
*
|
8 |
+
*/
|
9 |
+
interface CJT_Models_Package_Xml_Definition_Interface_Element {
|
10 |
+
|
11 |
+
/**
|
12 |
+
* put your comment there...
|
13 |
+
*
|
14 |
+
* @param SimpleXMLElement $node
|
15 |
+
* @return CJT_Models_Package_Xml_Definition_Interface_Element
|
16 |
+
*/
|
17 |
+
public function __construct(SimpleXMLElement $node, $parent, $factory);
|
18 |
+
|
19 |
+
/**
|
20 |
+
* put your comment there...
|
21 |
+
*
|
22 |
+
*/
|
23 |
+
public function processInners();
|
24 |
+
|
25 |
+
/**
|
26 |
+
* put your comment there...
|
27 |
+
*
|
28 |
+
*/
|
29 |
+
public function register();
|
30 |
+
|
31 |
+
/**
|
32 |
+
* put your comment there...
|
33 |
+
*
|
34 |
+
*/
|
35 |
+
public function transit();
|
36 |
+
|
37 |
+
} // End class.
|
models/package/xml/definition/objects/block.php
ADDED
@@ -0,0 +1,33 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
*
|
4 |
+
*/
|
5 |
+
|
6 |
+
/**
|
7 |
+
*
|
8 |
+
*/
|
9 |
+
class CJT_Models_Package_Xml_Definition_Objects_Block
|
10 |
+
extends CJT_Models_Package_Xml_Definition_Abstract {
|
11 |
+
|
12 |
+
/**
|
13 |
+
* put your comment there...
|
14 |
+
*
|
15 |
+
* @var mixed
|
16 |
+
*/
|
17 |
+
protected $rules = array('links' => false);
|
18 |
+
|
19 |
+
/**
|
20 |
+
* put your comment there...
|
21 |
+
*
|
22 |
+
*/
|
23 |
+
public function transit() {
|
24 |
+
// Do transit.
|
25 |
+
parent::transit();
|
26 |
+
// Use blockId key instead of 'id' key.
|
27 |
+
$register = $this->register();
|
28 |
+
$register['blockId'] = $register['id'];
|
29 |
+
unset($register['id']);
|
30 |
+
// Chaining.
|
31 |
+
return $this;
|
32 |
+
}
|
33 |
+
} // End class
|
models/package/xml/definition/objects/block/files.php
ADDED
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
*
|
4 |
+
*/
|
5 |
+
|
6 |
+
/**
|
7 |
+
*
|
8 |
+
*/
|
9 |
+
class CJT_Models_Package_Xml_Definition_Objects_Block_Files
|
10 |
+
extends CJT_Models_Package_Xml_Definition_Abstract {} // End class
|
models/package/xml/definition/objects/block/files/file.php
ADDED
@@ -0,0 +1,34 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
*
|
4 |
+
*/
|
5 |
+
|
6 |
+
/**
|
7 |
+
*
|
8 |
+
*/
|
9 |
+
class CJT_Models_Package_Xml_Definition_Objects_Block_Files_File
|
10 |
+
extends CJT_Models_Package_Xml_Definition_Abstract {
|
11 |
+
|
12 |
+
/**
|
13 |
+
* put your comment there...
|
14 |
+
*
|
15 |
+
*/
|
16 |
+
public function transit() {
|
17 |
+
// Get block element.
|
18 |
+
$register = $this->register();
|
19 |
+
$blockId = $register['blockId'];
|
20 |
+
// CodeFiles table.
|
21 |
+
$tblCodeFile = new CJTBlockFilesTable(cssJSToolbox::getInstance()->getDBDriver());
|
22 |
+
// Load Code Files if required.
|
23 |
+
$register['packageParser']->fetchProperty($this->getNode(), 'code');
|
24 |
+
// Fetch form data / All scalar elements!
|
25 |
+
$codeFileData = new CJT_Framework_Xml_Fetchscalars($this->getNode());
|
26 |
+
// Insert Code File.
|
27 |
+
$tblCodeFile->setData($codeFileData)
|
28 |
+
->set('blockId', $blockId)
|
29 |
+
->save(true, true);
|
30 |
+
// Chaining.
|
31 |
+
return $this;
|
32 |
+
}
|
33 |
+
|
34 |
+
} // End class
|
models/package/xml/definition/objects/block/params.php
ADDED
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
*
|
4 |
+
*/
|
5 |
+
|
6 |
+
/**
|
7 |
+
*
|
8 |
+
*/
|
9 |
+
class CJT_Models_Package_Xml_Definition_Objects_Block_Params
|
10 |
+
extends CJT_Models_Package_Xml_Definition_Abstract {} // End class
|
models/package/xml/definition/objects/block/params/form.php
ADDED
@@ -0,0 +1,44 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
*
|
4 |
+
*/
|
5 |
+
|
6 |
+
/**
|
7 |
+
*
|
8 |
+
*/
|
9 |
+
class CJT_Models_Package_Xml_Definition_Objects_Block_Params_Form
|
10 |
+
extends CJT_Models_Package_Xml_Definition_Abstract {
|
11 |
+
|
12 |
+
/**
|
13 |
+
* put your comment there...
|
14 |
+
*
|
15 |
+
*/
|
16 |
+
public function transit() {
|
17 |
+
// Get block element.
|
18 |
+
$register = $this->register();
|
19 |
+
$blockId = $register['blockId'];
|
20 |
+
// Try to load the form
|
21 |
+
$tblForm = CJTxTable::getInstance('form');
|
22 |
+
$tblForm->set('blockId', $blockId)
|
23 |
+
->load();
|
24 |
+
// Add form is not exists.
|
25 |
+
if (!$tblForm->get('name')) {
|
26 |
+
// Fetch form data / All scalar elements!
|
27 |
+
$formData = new CJT_Framework_Xml_Fetchscalars($this->getNode());
|
28 |
+
// Use blockId as formId.
|
29 |
+
$formData['blockId'] = $blockId;
|
30 |
+
// Set form data.
|
31 |
+
$tblForm->setData($formData)
|
32 |
+
// Unofruntatly xTable doesn't support adding the key
|
33 |
+
// We need to get around by changing the key name to a dummy one!
|
34 |
+
->setTableKey(array('id'))
|
35 |
+
// Save into database!
|
36 |
+
->save(true);
|
37 |
+
}
|
38 |
+
// Save form id for the chain!
|
39 |
+
$this->register()->offsetSet('formId', $blockId);
|
40 |
+
// Chaining.
|
41 |
+
return $this;
|
42 |
+
}
|
43 |
+
|
44 |
+
} // End class
|
models/package/xml/definition/objects/block/params/form/groups.php
ADDED
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
*
|
4 |
+
*/
|
5 |
+
|
6 |
+
/**
|
7 |
+
*
|
8 |
+
*/
|
9 |
+
class CJT_Models_Package_Xml_Definition_Objects_Block_Params_Form_Groups
|
10 |
+
extends CJT_Models_Package_Xml_Definition_Abstract {
|
11 |
+
|
12 |
+
} // End class
|
models/package/xml/definition/objects/block/params/form/groups/group.php
ADDED
@@ -0,0 +1,54 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
*
|
4 |
+
*/
|
5 |
+
|
6 |
+
/**
|
7 |
+
*
|
8 |
+
*/
|
9 |
+
class CJT_Models_Package_Xml_Definition_Objects_Block_Params_Form_Groups_Group
|
10 |
+
extends CJT_Models_Package_Xml_Definition_Abstract {
|
11 |
+
|
12 |
+
/**
|
13 |
+
* Required by block/params/list/param/params/group object
|
14 |
+
* to search for the associated group!
|
15 |
+
*
|
16 |
+
*/
|
17 |
+
public function getName() {
|
18 |
+
return (string) $this->getNode()->name;
|
19 |
+
}
|
20 |
+
|
21 |
+
/**
|
22 |
+
* put your comment there...
|
23 |
+
*
|
24 |
+
*/
|
25 |
+
public function transit() {
|
26 |
+
// Initialize.
|
27 |
+
$register = $this->register();
|
28 |
+
$formId = $register['formId'];
|
29 |
+
// Fetch form data / All scalar elements!
|
30 |
+
$groupData = new CJT_Framework_Xml_Fetchscalars($this->getNode());
|
31 |
+
// Try to load the form
|
32 |
+
$tblGroup = CJTxTable::getInstance('form-group');
|
33 |
+
// Each form has a unique group names!
|
34 |
+
$tblGroup->setTableKey(array('formId', 'name'))
|
35 |
+
->set('formId', $formId)
|
36 |
+
->set('name', $groupData['name'])
|
37 |
+
->load();
|
38 |
+
// Add form is not exists.
|
39 |
+
if (!$tblGroup->get('id')) {
|
40 |
+
// Use blockId as formId.
|
41 |
+
$groupData['formId'] = $formId;
|
42 |
+
// Set form data.
|
43 |
+
$tblGroup->setTableKey(array('id'))
|
44 |
+
->setData($groupData)
|
45 |
+
// Save into database!
|
46 |
+
->save();
|
47 |
+
}
|
48 |
+
// Save form id for the chain!
|
49 |
+
$register['groupId'] = $tblGroup->get('id');
|
50 |
+
// Chaining.
|
51 |
+
return $this;
|
52 |
+
}
|
53 |
+
|
54 |
+
} // End class
|
models/package/xml/definition/objects/block/params/form/groups/group/xfields.php
ADDED
@@ -0,0 +1,31 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
*
|
4 |
+
*/
|
5 |
+
|
6 |
+
/**
|
7 |
+
*
|
8 |
+
*/
|
9 |
+
class CJT_Models_Package_Xml_Definition_Objects_Block_Params_Form_Groups_Group_xFields
|
10 |
+
extends CJT_Models_Package_Xml_Definition_Abstract {
|
11 |
+
|
12 |
+
/**
|
13 |
+
* put your comment there...
|
14 |
+
*
|
15 |
+
*/
|
16 |
+
public function transit() {
|
17 |
+
// Initialize.
|
18 |
+
$register = $this->register();
|
19 |
+
$groupId = $register['groupId'];
|
20 |
+
// Fetch form data / All scalar elements!
|
21 |
+
$groupXFieldsData = new CJT_Framework_Xml_Fetchscalars($this->getNode());
|
22 |
+
$groupXFieldsData['groupId'] = $groupId;
|
23 |
+
// Save Group XFIELDS data.
|
24 |
+
CJTxTable::getInstance('form-group-xfields')
|
25 |
+
->setData($groupXFieldsData)
|
26 |
+
->save();
|
27 |
+
// Chaining.
|
28 |
+
return $this;
|
29 |
+
}
|
30 |
+
|
31 |
+
} // End class
|
models/package/xml/definition/objects/block/params/list.php
ADDED
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
*
|
4 |
+
*/
|
5 |
+
|
6 |
+
/**
|
7 |
+
*
|
8 |
+
*/
|
9 |
+
class CJT_Models_Package_Xml_Definition_Objects_Block_Params_List
|
10 |
+
extends CJT_Models_Package_Xml_Definition_Abstract {
|
11 |
+
|
12 |
+
} // End class
|
models/package/xml/definition/objects/block/params/list/param.php
ADDED
@@ -0,0 +1,45 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
*
|
4 |
+
*/
|
5 |
+
|
6 |
+
/**
|
7 |
+
*
|
8 |
+
*/
|
9 |
+
class CJT_Models_Package_Xml_Definition_Objects_Block_Params_List_Param
|
10 |
+
extends CJT_Models_Package_Xml_Definition_Abstract {
|
11 |
+
|
12 |
+
/**
|
13 |
+
* put your comment there...
|
14 |
+
*
|
15 |
+
*/
|
16 |
+
public function transit() {
|
17 |
+
// Initialize.
|
18 |
+
$register = $this->register();
|
19 |
+
$blockId = $register['blockId'];
|
20 |
+
$parent = isset($register['paramId']) ? $register['paramId'] : null;
|
21 |
+
$paramData = new CJT_Framework_Xml_Fetchscalars($this->getNode());
|
22 |
+
// Block root parameter and child parameter names is unique
|
23 |
+
$tblParam = CJTxTable::getInstance('parameter')
|
24 |
+
->setTableKey(array('blockId', 'parent', 'name'))
|
25 |
+
->set('blockId', $blockId)
|
26 |
+
->set('parent', $parent)
|
27 |
+
->set('name', $paramData['name'])
|
28 |
+
->load();
|
29 |
+
// Add if doesn't exists!
|
30 |
+
if (!$tblParam->get('id')) {
|
31 |
+
// Set relation data.
|
32 |
+
$paramData['blockId'] = $blockId;
|
33 |
+
$paramData['parent'] = $parent;
|
34 |
+
// Save into database.
|
35 |
+
$tblParam->setTableKey(array('id'))
|
36 |
+
->setData($paramData)
|
37 |
+
->save();
|
38 |
+
}
|
39 |
+
// Add (Or Override parent parameter id on the chain!)
|
40 |
+
$register['paramId'] = $tblParam->get('id');
|
41 |
+
// Chaining.
|
42 |
+
return $this;
|
43 |
+
}
|
44 |
+
|
45 |
+
} // End class
|
models/package/xml/definition/objects/block/params/list/param/group.php
ADDED
@@ -0,0 +1,52 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
*
|
4 |
+
*/
|
5 |
+
|
6 |
+
/**
|
7 |
+
*
|
8 |
+
*/
|
9 |
+
class CJT_Models_Package_Xml_Definition_Objects_Block_Params_List_Param_Group
|
10 |
+
extends CJT_Models_Package_Xml_Definition_Abstract {
|
11 |
+
|
12 |
+
/**
|
13 |
+
* put your comment there...
|
14 |
+
*
|
15 |
+
*/
|
16 |
+
public function transit() {
|
17 |
+
// Initialize.
|
18 |
+
$register = $this->register();
|
19 |
+
$paramId = $register['paramId'];
|
20 |
+
$groupParamData = new CJT_Framework_Xml_Fetchscalars($this->getNode());
|
21 |
+
// Find group!
|
22 |
+
$factory = $this->getFactory();
|
23 |
+
$groups = $factory->getCreatedObjects('block/params/form/groups/group');
|
24 |
+
$paramGroupName = (string) $this->getNode()->attributes()->name;
|
25 |
+
// Find the group to be associated with the parameter.
|
26 |
+
foreach ($groups as $group) {
|
27 |
+
// Find the group by the given name.
|
28 |
+
if ($group->getName() == $paramGroupName) {
|
29 |
+
// Check existntance!
|
30 |
+
$tblGroupParam = CJTxTable::getInstance('group-parameter')
|
31 |
+
->setTableKey(array('parameterId'))
|
32 |
+
->set('parameterId', $paramId)
|
33 |
+
->load();
|
34 |
+
// Add if not exists!
|
35 |
+
if (!$tblGroupParam->get('groupId')) {
|
36 |
+
// Get group id.
|
37 |
+
$groupId = $group->register()->offsetGet('groupId');
|
38 |
+
// Prepare data.
|
39 |
+
$groupParamData['parameterId'] = $paramId;
|
40 |
+
$groupParamData['groupId'] = $groupId;
|
41 |
+
// Save to database.
|
42 |
+
$tblGroupParam->setTableKey(array('id'))
|
43 |
+
->setData($groupParamData)
|
44 |
+
->save();
|
45 |
+
}
|
46 |
+
break;
|
47 |
+
}
|
48 |
+
}
|
49 |
+
return $this;
|
50 |
+
}
|
51 |
+
|
52 |
+
} // End class
|
models/package/xml/definition/objects/block/params/list/param/group/definition.php
ADDED
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
*
|
4 |
+
*/
|
5 |
+
|
6 |
+
/**
|
7 |
+
*
|
8 |
+
*/
|
9 |
+
class CJT_Models_Package_Xml_Definition_Objects_Block_Params_List_Param_Group_Definition
|
10 |
+
extends CJT_Models_Package_Xml_Definition_Abstract {} // End class
|
models/package/xml/definition/objects/block/params/list/param/group/definition/type.php
ADDED
@@ -0,0 +1,32 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
*
|
4 |
+
*/
|
5 |
+
|
6 |
+
/**
|
7 |
+
*
|
8 |
+
*/
|
9 |
+
class CJT_Models_Package_Xml_Definition_Objects_Block_Params_List_Param_Group_Definition_Type
|
10 |
+
extends CJT_Models_Package_Xml_Definition_Abstract {
|
11 |
+
|
12 |
+
/**
|
13 |
+
* put your comment there...
|
14 |
+
*
|
15 |
+
*/
|
16 |
+
public function transit() {
|
17 |
+
// Initialize.
|
18 |
+
$register = $this->register();
|
19 |
+
$paramId = $register['paramId'];
|
20 |
+
$typedefData = new CJT_Framework_Xml_Fetchscalars($this->getNode());
|
21 |
+
// Prepare data.
|
22 |
+
$typedefData['parameterId'] = $paramId;
|
23 |
+
// Save to database.
|
24 |
+
$tblTypedef = CJTxTable::getInstance('parameter-typedef')
|
25 |
+
->setData($typedefData)
|
26 |
+
->save();
|
27 |
+
|
28 |
+
// Chaining.
|
29 |
+
return $this;
|
30 |
+
}
|
31 |
+
|
32 |
+
} // End class
|
models/package/xml/definition/objects/block/params/list/param/group/rendererParams.php
ADDED
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
*
|
4 |
+
*/
|
5 |
+
|
6 |
+
/**
|
7 |
+
*
|
8 |
+
*/
|
9 |
+
class CJT_Models_Package_Xml_Definition_Objects_Block_Params_List_Param_Group_RendererParams
|
10 |
+
extends CJT_Models_Package_Xml_Definition_Abstract {
|
11 |
+
|
12 |
+
/**
|
13 |
+
* put your comment there...
|
14 |
+
*
|
15 |
+
* @var mixed
|
16 |
+
*/
|
17 |
+
protected $map = array('param' => 'block/params/list/param/typeParams/param');
|
18 |
+
|
19 |
+
} // End class
|
models/package/xml/definition/objects/block/params/list/param/params.php
ADDED
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
*
|
4 |
+
*/
|
5 |
+
|
6 |
+
/**
|
7 |
+
*
|
8 |
+
*/
|
9 |
+
class CJT_Models_Package_Xml_Definition_Objects_Block_Params_List_Param_Params
|
10 |
+
extends CJT_Models_Package_Xml_Definition_Abstract {
|
11 |
+
|
12 |
+
/**
|
13 |
+
* put your comment there...
|
14 |
+
*
|
15 |
+
* @var mixed
|
16 |
+
*/
|
17 |
+
protected $map = array('param' => 'block/params/list/param');
|
18 |
+
|
19 |
+
} // End class
|
models/package/xml/definition/objects/block/params/list/param/typeParams.php
ADDED
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
*
|
4 |
+
*/
|
5 |
+
|
6 |
+
/**
|
7 |
+
*
|
8 |
+
*/
|
9 |
+
class CJT_Models_Package_Xml_Definition_Objects_Block_Params_List_Param_TypeParams
|
10 |
+
extends CJT_Models_Package_Xml_Definition_Abstract {} // End class
|
models/package/xml/definition/objects/block/params/list/param/typeparams/param.php
ADDED
@@ -0,0 +1,32 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
*
|
4 |
+
*/
|
5 |
+
|
6 |
+
/**
|
7 |
+
*
|
8 |
+
*/
|
9 |
+
class CJT_Models_Package_Xml_Definition_Objects_Block_Params_List_Param_TypeParams_Param
|
10 |
+
extends CJT_Models_Package_Xml_Definition_Abstract {
|
11 |
+
|
12 |
+
/**
|
13 |
+
* put your comment there...
|
14 |
+
*
|
15 |
+
*/
|
16 |
+
public function transit() {
|
17 |
+
// Initialize.
|
18 |
+
$register = $this->register();
|
19 |
+
$paramId = $register['paramId'];
|
20 |
+
$typeparamsData = new CJT_Framework_Xml_Fetchscalars($this->getNode());
|
21 |
+
// Prepare data.
|
22 |
+
$typeparamsData['parameterId'] = $paramId;
|
23 |
+
// Save to database.
|
24 |
+
$tblTypedef = CJTxTable::getInstance('parameter-typeparams')
|
25 |
+
->setData($typeparamsData)
|
26 |
+
->save();
|
27 |
+
|
28 |
+
// Chaining.
|
29 |
+
return $this;
|
30 |
+
}
|
31 |
+
|
32 |
+
} // End class
|
models/package/xml/definition/objects/template.php
ADDED
@@ -0,0 +1,28 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
*
|
4 |
+
*/
|
5 |
+
|
6 |
+
/**
|
7 |
+
*
|
8 |
+
*/
|
9 |
+
class CJT_Models_Package_Xml_Definition_Objects_Template
|
10 |
+
extends CJT_Models_Package_Xml_Definition_Abstract {
|
11 |
+
|
12 |
+
/**
|
13 |
+
* Do nothing!
|
14 |
+
*
|
15 |
+
*/
|
16 |
+
public function processInners() {
|
17 |
+
return $this;
|
18 |
+
}
|
19 |
+
|
20 |
+
/**
|
21 |
+
* Do nothing!
|
22 |
+
*
|
23 |
+
*/
|
24 |
+
public function transit() {
|
25 |
+
return $this;
|
26 |
+
}
|
27 |
+
|
28 |
+
} // End class
|
models/package/xml/factory.php
ADDED
@@ -0,0 +1,100 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
*
|
4 |
+
*/
|
5 |
+
|
6 |
+
/**
|
7 |
+
*
|
8 |
+
*/
|
9 |
+
|
10 |
+
class CJT_Models_Package_Xml_Factory {
|
11 |
+
|
12 |
+
/**
|
13 |
+
* put your comment there...
|
14 |
+
*
|
15 |
+
* @var mixed
|
16 |
+
*/
|
17 |
+
protected $basePath = '';
|
18 |
+
|
19 |
+
/**
|
20 |
+
* put your comment there...
|
21 |
+
*
|
22 |
+
* @var mixed
|
23 |
+
*/
|
24 |
+
protected $yields = array();
|
25 |
+
|
26 |
+
/**
|
27 |
+
* put your comment there...
|
28 |
+
*
|
29 |
+
* @param mixed $basePath
|
30 |
+
* @return CJT_Models_Package_Xml_Factory
|
31 |
+
*/
|
32 |
+
public function __construct($basePath) {
|
33 |
+
$this->basePath = $basePath;
|
34 |
+
}
|
35 |
+
|
36 |
+
/**
|
37 |
+
* put your comment there...
|
38 |
+
*
|
39 |
+
* @param mixed $current
|
40 |
+
* @param mixed $path
|
41 |
+
* @param mixed $node
|
42 |
+
*/
|
43 |
+
public function create($current, $path, $node) {
|
44 |
+
// Get loader.
|
45 |
+
$loader = CJT_Framework_Autoload_Loader::autoLoad('CJT');
|
46 |
+
// Get object element class name
|
47 |
+
$classPath = "{$this->basePath}/{$path}";
|
48 |
+
$className = 'CJT_' . str_replace(' ', '_', ucwords(str_replace('/', ' ', $classPath)));
|
49 |
+
// Instantiate class.
|
50 |
+
$object = new $className($node, $current, $this);
|
51 |
+
// Cache all instantiated objects so it can be accessed
|
52 |
+
// anywhere inside!
|
53 |
+
if (!isset($this->yields[$path])) {
|
54 |
+
$this->yields[$path] = array();
|
55 |
+
}
|
56 |
+
$this->yields[$path][] = $object;
|
57 |
+
// Return new object.
|
58 |
+
return $object;
|
59 |
+
}
|
60 |
+
|
61 |
+
/**
|
62 |
+
* put your comment there...
|
63 |
+
*
|
64 |
+
*/
|
65 |
+
public function getBasePath() {
|
66 |
+
return $this->basePath;
|
67 |
+
}
|
68 |
+
|
69 |
+
/**
|
70 |
+
* put your comment there...
|
71 |
+
*
|
72 |
+
* @param mixed $path
|
73 |
+
*/
|
74 |
+
public function getCreatedObjects($path) {
|
75 |
+
// Initialize.
|
76 |
+
$objects = array();
|
77 |
+
/// E_ALL complans
|
78 |
+
if (isset($this->yields[$path])) {
|
79 |
+
$objects = $this->yields[$path];
|
80 |
+
}
|
81 |
+
// Return objects.
|
82 |
+
return $objects;
|
83 |
+
}
|
84 |
+
/**
|
85 |
+
* put your comment there...
|
86 |
+
*
|
87 |
+
* @param mixed $class
|
88 |
+
* @param mixed $path
|
89 |
+
*/
|
90 |
+
public function obtainRelativePath($class, $innerPath) {
|
91 |
+
// Get class path.
|
92 |
+
$classPath = strtolower(str_replace('_', '/', $class));
|
93 |
+
// Remove base path from the class path.
|
94 |
+
$classRelativePath = str_replace("cjt/{$this->basePath}/", '', $classPath);
|
95 |
+
// Build child relatoive path.
|
96 |
+
$path = "{$classRelativePath}/{$innerPath}";
|
97 |
+
return $path;
|
98 |
+
}
|
99 |
+
|
100 |
+
} // End class.
|
models/packages.php
ADDED
@@ -0,0 +1,68 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
*
|
4 |
+
*/
|
5 |
+
|
6 |
+
// Disllow direct access.
|
7 |
+
defined('ABSPATH') or die('Access denied');
|
8 |
+
|
9 |
+
/**
|
10 |
+
*
|
11 |
+
*/
|
12 |
+
class CJTPackagesModel {
|
13 |
+
|
14 |
+
/**
|
15 |
+
* put your comment there...
|
16 |
+
*
|
17 |
+
*/
|
18 |
+
public function getItems() {
|
19 |
+
// Build query.
|
20 |
+
$select = 'SELECT p.id, p.name, p.description, p.author, p.webSite, p.license, p.readme';
|
21 |
+
$queryBase = $this->getItemsQuery();
|
22 |
+
// Paging.
|
23 |
+
$itemsPerPage = $this->getItemsPerPage();
|
24 |
+
// Get page no#.
|
25 |
+
$page = !isset($_REQUEST['paged']) ? 1 : $_REQUEST['paged'];
|
26 |
+
// Calculate start offset.
|
27 |
+
$start = ($page - 1) * $itemsPerPage;
|
28 |
+
$limit = " LIMIT {$start},{$itemsPerPage}";
|
29 |
+
// final query.
|
30 |
+
$query = "{$select}{$queryBase['from']}{$limit}";
|
31 |
+
// Execute our query using MYSQL queue driver.
|
32 |
+
$result = cssJSToolbox::getInstance()->getDBDriver()->select($query);
|
33 |
+
return $result;
|
34 |
+
}
|
35 |
+
|
36 |
+
/**
|
37 |
+
* put your comment there...
|
38 |
+
*
|
39 |
+
*/
|
40 |
+
public function getItemsPerPage() {
|
41 |
+
return 20;
|
42 |
+
}
|
43 |
+
|
44 |
+
/**
|
45 |
+
* put your comment there...
|
46 |
+
*
|
47 |
+
*/
|
48 |
+
public function getItemsQuery() {
|
49 |
+
// From clause.
|
50 |
+
$query['from'] = ' FROM #__cjtoolbox_packages p';
|
51 |
+
return $query;
|
52 |
+
}
|
53 |
+
|
54 |
+
/**
|
55 |
+
* put your comment there...
|
56 |
+
*
|
57 |
+
*/
|
58 |
+
public function getItemsTotal() {
|
59 |
+
$queryBase = $this->getItemsQuery();
|
60 |
+
$select = 'SELECT count(*) Total';
|
61 |
+
$query = "{$select}{$queryBase['from']}";
|
62 |
+
// Get items total.
|
63 |
+
$dbDriver = new CJTMYSQLQueueDriver($GLOBALS['wpdb']);
|
64 |
+
$result = $dbDriver->select($query);
|
65 |
+
return reset($result)->Total;
|
66 |
+
}
|
67 |
+
|
68 |
+
} // End class.
|
models/parameters.php
ADDED
@@ -0,0 +1,43 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
*
|
4 |
+
*/
|
5 |
+
|
6 |
+
/**
|
7 |
+
*
|
8 |
+
*/
|
9 |
+
class CJT_Models_Parameters {
|
10 |
+
|
11 |
+
/**
|
12 |
+
* Delete parameter or group or parameters
|
13 |
+
* or all parameters associasted to specific block.
|
14 |
+
*
|
15 |
+
* Each Key might has only the parameterId or blockId or both of them.
|
16 |
+
*
|
17 |
+
* @param array array('blockId' => ID, 'parameterId' => 'ID).
|
18 |
+
* @return
|
19 |
+
*/
|
20 |
+
public function delete($keys) {
|
21 |
+
// Initialize.
|
22 |
+
$tblParams = CJTxTable::getInstance('parameter')
|
23 |
+
->setTableKey(array('blockId', 'parameterId'));
|
24 |
+
// Delete parameters.
|
25 |
+
foreach ($keys as $key) {
|
26 |
+
// Allow only blockId to be passed as scalar!
|
27 |
+
if (!is_array($key)) {
|
28 |
+
$key = array($key);
|
29 |
+
}
|
30 |
+
// Blolckid passed @index 0 while parameters id @index 1
|
31 |
+
$key = array(
|
32 |
+
'blockId' => $key[0],
|
33 |
+
'parameterId' => isset($key[1]) ? $key[1] : null,
|
34 |
+
);
|
35 |
+
// Delete record.
|
36 |
+
$tblParams->setData($key)
|
37 |
+
->delete();
|
38 |
+
}
|
39 |
+
// Chaining.
|
40 |
+
return $this;
|
41 |
+
}
|
42 |
+
|
43 |
+
} // End class.
|
models/setup.php
CHANGED
@@ -14,7 +14,7 @@ class CJTSetupModel {
|
|
14 |
/**
|
15 |
*
|
16 |
*/
|
17 |
-
const EDD_PRODUCT_NAME = 'CJT
|
18 |
|
19 |
/**
|
20 |
*
|
14 |
/**
|
15 |
*
|
16 |
*/
|
17 |
+
const EDD_PRODUCT_NAME = 'CJT Free';
|
18 |
|
19 |
/**
|
20 |
*
|
models/template.php
ADDED
@@ -0,0 +1,234 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
*
|
4 |
+
*/
|
5 |
+
|
6 |
+
// Disllow direct access.
|
7 |
+
defined('ABSPATH') or die('Access denied');
|
8 |
+
|
9 |
+
/**
|
10 |
+
*
|
11 |
+
*/
|
12 |
+
class CJTTemplateModel extends CJTHookableClass {
|
13 |
+
|
14 |
+
/**
|
15 |
+
* put your comment there...
|
16 |
+
*
|
17 |
+
* @var mixed
|
18 |
+
*/
|
19 |
+
public $inputs;
|
20 |
+
|
21 |
+
/**
|
22 |
+
* put your comment there...
|
23 |
+
*
|
24 |
+
* @var mixed
|
25 |
+
*/
|
26 |
+
protected $onloadcodefile = array('parameters' => array('code', 'item'));
|
27 |
+
|
28 |
+
/**
|
29 |
+
* put your comment there...
|
30 |
+
*
|
31 |
+
* @var mixed
|
32 |
+
*/
|
33 |
+
protected $onqueryitem = array('parameters' => array('query'));
|
34 |
+
|
35 |
+
/**
|
36 |
+
* put your comment there...
|
37 |
+
*
|
38 |
+
* @param mixed $code
|
39 |
+
*/
|
40 |
+
public function decryptCode($encodedCode) {
|
41 |
+
/// base 64 code!
|
42 |
+
$code64 = str_replace(array('<?php defined("ABS_PATH") or die("Access Denied"); \'', '\' ?>'), '', $encodedCode);
|
43 |
+
// Decode!
|
44 |
+
$code = base64_decode($code64);
|
45 |
+
return $code;
|
46 |
+
}
|
47 |
+
|
48 |
+
/**
|
49 |
+
* put your comment there...
|
50 |
+
*
|
51 |
+
* @param mixed $code
|
52 |
+
*/
|
53 |
+
public function encryptCode($code) {
|
54 |
+
// Base 64 Encode!
|
55 |
+
$code64 = base64_encode($code);
|
56 |
+
// Hide inside PHP tags!
|
57 |
+
$encodedCode = "<?php defined(\"ABS_PATH\") or die(\"Access Denied\"); '{$code64}'; ?>";
|
58 |
+
return $encodedCode;
|
59 |
+
}
|
60 |
+
|
61 |
+
/**
|
62 |
+
* put your comment there...
|
63 |
+
*
|
64 |
+
* @param mixed $name
|
65 |
+
*/
|
66 |
+
public function exists($name) {
|
67 |
+
// Find by name.
|
68 |
+
$this->inputs['filter']['field'] = 'name';
|
69 |
+
$this->inputs['filter']['value'] = $name;
|
70 |
+
// Template object if exists with E_ALL complain!
|
71 |
+
return (($existsItem = $this->getTemplateBy()) && property_exists($existsItem, 'id') && $existsItem->id) ?
|
72 |
+
$existsItem : FALSE;
|
73 |
+
}
|
74 |
+
|
75 |
+
/**
|
76 |
+
* put your comment there...
|
77 |
+
*
|
78 |
+
*/
|
79 |
+
public function getItem() {
|
80 |
+
$tManager = CJTModel::create('templates-manager');
|
81 |
+
$query = $tManager->getItemsQuery();
|
82 |
+
$query['select'] = 'SELECT t.id,
|
83 |
+
t.queueName,
|
84 |
+
t.name,
|
85 |
+
t.type,
|
86 |
+
t.description,
|
87 |
+
t.creationDate,
|
88 |
+
t.keywords,
|
89 |
+
r.dateCreated lastModified,
|
90 |
+
t.state,
|
91 |
+
a.name author,
|
92 |
+
r.changeLog,
|
93 |
+
r.version,
|
94 |
+
r.file,
|
95 |
+
r.state developmentState';
|
96 |
+
$query['where'] .= " AND t.id = {$this->inputs['id']}";
|
97 |
+
// Filering!
|
98 |
+
$query = $this->onqueryitem($query);
|
99 |
+
// Build and query!
|
100 |
+
$query = "{$query['select']} {$query['from']} {$query['where']}";
|
101 |
+
$item = cssJSToolbox::getInstance()->getDBDriver()->getRow($query);
|
102 |
+
// Get code.
|
103 |
+
$code = file_get_contents(ABSPATH . "/{$item->file}");
|
104 |
+
// Decode if its a PHP template!
|
105 |
+
if ($item->type == 'php') {
|
106 |
+
$code = $this->decryptCode($code);
|
107 |
+
}
|
108 |
+
$item->code = $this->onloadcodefile($code, $item);
|
109 |
+
// Return PHP StdClass object.
|
110 |
+
return $item;
|
111 |
+
}
|
112 |
+
|
113 |
+
/**
|
114 |
+
* Query Block based on the passed paramaters.
|
115 |
+
*
|
116 |
+
*/
|
117 |
+
public function getTemplateBy() {
|
118 |
+
// import dependencies.
|
119 |
+
cssJSToolbox::import('framework:db:mysql:xtable.inc.php');
|
120 |
+
return CJTxTable::getInstance('template')
|
121 |
+
->set($this->inputs['filter']['field'], $this->inputs['filter']['value'])
|
122 |
+
->load(array($this->inputs['filter']['field']))
|
123 |
+
->getData();
|
124 |
+
}
|
125 |
+
|
126 |
+
/**
|
127 |
+
* put your comment there...
|
128 |
+
*
|
129 |
+
*/
|
130 |
+
public function save() {
|
131 |
+
// import libraries.
|
132 |
+
cssJSToolbox::import('framework:db:mysql:xtable.inc.php');
|
133 |
+
// Initialize vars.
|
134 |
+
$fSConfig = cssJSToolbox::$config->fileSystem;
|
135 |
+
$currentUser = get_userdata(get_current_user_id());
|
136 |
+
$dbDriver = cssJSToolbox::getInstance()->getDBDriver();
|
137 |
+
$saveId = isset($this->inputs['item']['template']['id']) ? $this->inputs['item']['template']['id'] : null;
|
138 |
+
// Load template data is exists (load), change values (setData).
|
139 |
+
$template = CJTxTable::getInstance('template')->set('id', $saveId)
|
140 |
+
->load()
|
141 |
+
->setData($this->inputs['item']['template'])
|
142 |
+
->setQueueName();
|
143 |
+
$templateDirName = $template->get('queueName');
|
144 |
+
$templateDir = "wp-content/{$fSConfig->contentDir}/{$fSConfig->templatesDir}/{$templateDirName}";
|
145 |
+
if (!$template->get('id')) { // Add new Template
|
146 |
+
// Search for author for the current local Wordpress user.
|
147 |
+
// If not created in the Authors table create one! If created get the ID!
|
148 |
+
$author = CJTxTable::getInstance('author', null, "SELECT * FROM #__cjtoolbox_authors
|
149 |
+
WHERE name = '{$currentUser->user_login}'
|
150 |
+
AND (attributes & 2);");
|
151 |
+
// Create Wordpress user in Authors table.
|
152 |
+
if (!$author->get('id')) {
|
153 |
+
$author->setData(array(
|
154 |
+
'name' => $currentUser->user_login,
|
155 |
+
'email' => $currentUser->user_email,
|
156 |
+
'url' => $currentUser->user_url,
|
157 |
+
'attributes' => 2 // 2 For LOCAL AUTHORS!!
|
158 |
+
))->save();
|
159 |
+
}
|
160 |
+
// Set template data
|
161 |
+
$template->set('ownerId', $currentUser->ID)
|
162 |
+
->set('creationDate', current_time('mysql'))
|
163 |
+
->set('authorId', $author->get('id'));
|
164 |
+
}
|
165 |
+
// Make sure directory created even if updating templats.
|
166 |
+
// This case is needed when revisioned built-in templates (e.g jquery)!!
|
167 |
+
if (!file_exists(ABSPATH . "/{$templateDir}")) {
|
168 |
+
mkdir(ABSPATH . "/{$templateDir}", 0755);
|
169 |
+
}
|
170 |
+
// Save template.
|
171 |
+
if (!$template->save()->get('id')) {
|
172 |
+
throw new Exception('Error saving template into database!!!');
|
173 |
+
}
|
174 |
+
/// Always create new revision. ///
|
175 |
+
// Get last used Revision Number!
|
176 |
+
$lastRevisionNo = ((int) ($dbDriver->getRow("SELECT max(revisionNo) revisionNo
|
177 |
+
FROM #__cjtoolbox_template_revisions
|
178 |
+
WHERE templateId = {$template->get('id')}")->revisionNo));
|
179 |
+
// Checki if there is a previous revision and if there is changes!!
|
180 |
+
$lastRevision = CJTxTable::getInstance('template-revision', null,
|
181 |
+
"SELECT *
|
182 |
+
FROM #__cjtoolbox_template_revisions
|
183 |
+
WHERE templateId = {$template->get('id')} AND revisionNo = {$lastRevisionNo}"
|
184 |
+
);
|
185 |
+
// Only add Revision if it has any field changed!
|
186 |
+
$revisionData = $this->inputs['item']['revision'];
|
187 |
+
$lastRevisionCode = $lastRevision->get('id') ? file_get_contents(ABSPATH . "/{$lastRevision->get('file')}") : null;
|
188 |
+
$revisionHasChanges = $lastRevisionCode !== $revisionData['code']
|
189 |
+
|| $lastRevision->get('state') !== $revisionData['state']
|
190 |
+
|| $lastRevision->get('version') !== $revisionData['version']
|
191 |
+
|| $lastRevision->get('changeLog') !== $revisionData['changeLog'];
|
192 |
+
if ($revisionHasChanges) {
|
193 |
+
$templateType = $template->get('type');
|
194 |
+
// New added revision number!
|
195 |
+
$revisionNo = $lastRevisionNo + 1;
|
196 |
+
// Get template revision extension.
|
197 |
+
$extension = cssJSToolbox::$config->templates->types[$templateType]->extension;
|
198 |
+
// Remove fields that not part of the revision table!
|
199 |
+
$code = $this->inputs['item']['revision']['code'];
|
200 |
+
unset($this->inputs['item']['revision']['code']);
|
201 |
+
// Creae revision object.
|
202 |
+
$revision = CJTxTable::getInstance('template-revision')
|
203 |
+
->setData($this->inputs['item']['revision'])
|
204 |
+
->set('templateId', $template->get('id'))
|
205 |
+
->set('revisionNo', $revisionNo)
|
206 |
+
->set('dateCreated', current_time('mysql'))
|
207 |
+
->set('attributes', CJTTemplateRevisionTable::FLAG_LAST_REVISION) // Mark as last revision.
|
208 |
+
->set('file', "{$templateDir}/{$revisionNo}.{$extension}")
|
209 |
+
->save();
|
210 |
+
// Encrypt PHP codes!
|
211 |
+
if ($templateType == 'php') {
|
212 |
+
$code = $this->encryptCode($code);
|
213 |
+
}
|
214 |
+
// Write revision content into Disk File!
|
215 |
+
file_put_contents(ABSPATH . "/{$revision->get('file')}", $code);
|
216 |
+
// Remove FLAG_LAST_REVISION flag from last revision so
|
217 |
+
// our new revision will be the last one!!
|
218 |
+
if ($lastRevision->get('id')) {
|
219 |
+
$flagsOff = $lastRevision->get('attributes') & (~CJTTemplateRevisionTable::FLAG_LAST_REVISION);
|
220 |
+
$lastRevision->set('attributes', $flagsOff)->save();
|
221 |
+
}
|
222 |
+
}
|
223 |
+
else {
|
224 |
+
// Return last Revision!
|
225 |
+
$revision = $lastRevision;
|
226 |
+
}
|
227 |
+
// Return revision object.
|
228 |
+
return $revision->getData();
|
229 |
+
}
|
230 |
+
|
231 |
+
} // End class.
|
232 |
+
|
233 |
+
// Hookable!
|
234 |
+
CJTTemplateModel::define('CJTTemplateModel', array('hookType' => CJTWordpressEvents::HOOK_FILTER));
|
models/templates-lookup.php
ADDED
@@ -0,0 +1,113 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
*
|
4 |
+
*/
|
5 |
+
|
6 |
+
// Import dependencies
|
7 |
+
cssJSToolbox::import('framework:db:mysql:xtable.inc.php');
|
8 |
+
|
9 |
+
/**
|
10 |
+
*
|
11 |
+
*/
|
12 |
+
class CJTTemplatesLookupModel {
|
13 |
+
|
14 |
+
/**
|
15 |
+
* put your comment there...
|
16 |
+
*
|
17 |
+
* @var mixed
|
18 |
+
*/
|
19 |
+
public $inputs;
|
20 |
+
|
21 |
+
/**
|
22 |
+
* put your comment there...
|
23 |
+
*
|
24 |
+
*/
|
25 |
+
public function embedded() {
|
26 |
+
// Read template revision.
|
27 |
+
$revision = CJTxTable::getInstance('template-revision')
|
28 |
+
->fetchLastRevision($this->inputs['templateId']);
|
29 |
+
// Revision could not be queried!!
|
30 |
+
if (!$revision->get('id')) {
|
31 |
+
throw new Exception('Revision could not be found!!');
|
32 |
+
}
|
33 |
+
$revisionFile = $revision->get('file');
|
34 |
+
// Read revision code.
|
35 |
+
$code = file_get_contents(ABSPATH . "/{$revisionFile}");
|
36 |
+
// Decrypt PHP codes!
|
37 |
+
if (preg_match('/\.php$/', $revisionFile)) {
|
38 |
+
$code = CJTModel::getInstance('template')->decryptCode($code);
|
39 |
+
}
|
40 |
+
return $code;
|
41 |
+
}
|
42 |
+
|
43 |
+
/**
|
44 |
+
* put your comment there...
|
45 |
+
*
|
46 |
+
*/
|
47 |
+
public function getItems() {
|
48 |
+
// Initialize variables.
|
49 |
+
foreach (cssJSToolbox::$config->templates->types as $typeId => $object) {
|
50 |
+
$arrangedItems[$typeId] = array();
|
51 |
+
}
|
52 |
+
$query = "SELECT t.id, t.type, t.name, t.description, (t.attributes & 1) systemTemplate,
|
53 |
+
a.name author,
|
54 |
+
bt.blockId linked
|
55 |
+
FROM #__cjtoolbox_templates t
|
56 |
+
LEFT JOIN #__cjtoolbox_authors a
|
57 |
+
ON t.authorId = a.id
|
58 |
+
LEFT JOIN
|
59 |
+
(SELECT *
|
60 |
+
FROM #__cjtoolbox_block_templates
|
61 |
+
WHERE blockId = {$this->inputs['blockId']}
|
62 |
+
) bt
|
63 |
+
ON t.id = bt.templateId
|
64 |
+
WHERE t.state = 'published'";
|
65 |
+
$items = cssJSToolbox::getInstance()->getDBDriver()->select($query);
|
66 |
+
// First we need to group the templates by its type.
|
67 |
+
$templatesGrouped = array();
|
68 |
+
foreach ($items as $id => $template) {
|
69 |
+
// [TEMPLATE-TYPE][AUTHOR-NAME][TEMPLATE-ID] = TEMPLATE.
|
70 |
+
$arrangedItems[$template->type][$template->author][$id] = $template;
|
71 |
+
}
|
72 |
+
return $arrangedItems;
|
73 |
+
}
|
74 |
+
|
75 |
+
/**
|
76 |
+
* put your comment there...
|
77 |
+
*
|
78 |
+
*/
|
79 |
+
public function link() {
|
80 |
+
// Add db record!
|
81 |
+
$map = CJTxTable::getInstance('block-template')
|
82 |
+
->setData($this->inputs) // Load with data
|
83 |
+
->save();
|
84 |
+
// There will be an id when successed!
|
85 |
+
return $map->get('id');
|
86 |
+
}
|
87 |
+
|
88 |
+
/**
|
89 |
+
* put your comment there...
|
90 |
+
*
|
91 |
+
*/
|
92 |
+
public function unlink() {
|
93 |
+
// Delete record!
|
94 |
+
$map = CJTxTable::getInstance('block-template')
|
95 |
+
->setData($this->inputs) // Load with data
|
96 |
+
->delete(array_keys($this->inputs)); // Delete using compound key!
|
97 |
+
// Fields will be cleared when deleted!
|
98 |
+
return $map->getKey();
|
99 |
+
}
|
100 |
+
|
101 |
+
/**
|
102 |
+
* put your comment there...
|
103 |
+
*
|
104 |
+
*/
|
105 |
+
public function unlinkAll() {
|
106 |
+
$query = "DELETE FROM #__cjtoolbox_block_templates
|
107 |
+
WHERE blockId = {$this->inputs['blockId']}";
|
108 |
+
cssJSToolbox::getInstance()->getDBDriver()
|
109 |
+
->delete($query)
|
110 |
+
->processQueue();
|
111 |
+
}
|
112 |
+
|
113 |
+
} // End class.
|
models/templates-manager.php
ADDED
@@ -0,0 +1,179 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
*
|
4 |
+
*/
|
5 |
+
|
6 |
+
// Disllow direct access.
|
7 |
+
defined('ABSPATH') or die('Access denied');
|
8 |
+
|
9 |
+
/**
|
10 |
+
*
|
11 |
+
*/
|
12 |
+
class CJTTemplatesManagerModel {
|
13 |
+
|
14 |
+
/**
|
15 |
+
* put your comment there...
|
16 |
+
*
|
17 |
+
* @var mixed
|
18 |
+
*/
|
19 |
+
public $inputs;
|
20 |
+
|
21 |
+
/**
|
22 |
+
* put your comment there...
|
23 |
+
*
|
24 |
+
*/
|
25 |
+
public function changeState() {
|
26 |
+
$ids = implode(',', $this->inputs['ids']);
|
27 |
+
// initialize vars.
|
28 |
+
cssJSToolbox::getInstance()->getDBDriver()
|
29 |
+
->update("UPDATE #__cjtoolbox_templates
|
30 |
+
SET `state` = '{$this->inputs['state']}'
|
31 |
+
WHERE id IN ({$ids})")
|
32 |
+
->processQueue();
|
33 |
+
return $this;
|
34 |
+
}
|
35 |
+
|
36 |
+
/**
|
37 |
+
* put your comment there...
|
38 |
+
*
|
39 |
+
*/
|
40 |
+
public function delete() {
|
41 |
+
// Initialize.
|
42 |
+
WP_Filesystem();
|
43 |
+
// initialize vars.
|
44 |
+
$wpFileSystem =& $GLOBALS['wp_filesystem'];
|
45 |
+
$ids = array();
|
46 |
+
$dbDriver = cssJSToolbox::getInstance()->getDBDriver();
|
47 |
+
$fsConfig = cssJSToolbox::$config->fileSystem;
|
48 |
+
// Import dependencies.
|
49 |
+
cssJSToolbox::import('framework:db:mysql:xtable.inc.php');
|
50 |
+
CJTxTable::import('template');
|
51 |
+
// Delete only templates in "trash" state!
|
52 |
+
// For more security don't even delete templates with SYSTEM Attribute flag
|
53 |
+
// is turned ON!
|
54 |
+
$sysFlag = CJTTemplateTable::ATTRIBUTES_SYSTEM_FLAG;
|
55 |
+
$idsQueryList = implode(',', $this->inputs['ids']);
|
56 |
+
$templates = $dbDriver->select("SELECT id, queueName `directory`
|
57 |
+
FROM #__cjtoolbox_templates
|
58 |
+
WHERE ID IN ({$idsQueryList}) AND ((attributes & {$sysFlag}) = 0) AND (`state` = 'trash')");
|
59 |
+
if (!empty($templates)) {
|
60 |
+
// Deleing template directory files.
|
61 |
+
foreach ($templates as $template) {
|
62 |
+
// Absolute path to template directory!
|
63 |
+
$templateDirectoryAbsPath = WP_CONTENT_DIR . "/{$fsConfig->contentDir}/{$fsConfig->templatesDir}/{$template->directory}";
|
64 |
+
// Delete template directory RECUSIVLY!
|
65 |
+
$wpFileSystem->rmdir($templateDirectoryAbsPath, true);
|
66 |
+
}
|
67 |
+
// Get templates IDs to delete.
|
68 |
+
$ids = implode(', ', array_keys($templates));
|
69 |
+
// Permenantly delete all templates data from
|
70 |
+
// templates table and all refernced tables.
|
71 |
+
$dbDriver->startTransaction()
|
72 |
+
->delete("DELETE FROM #__cjtoolbox_block_templates WHERE templateId IN ({$ids})")
|
73 |
+
->delete("DELETE FROM #__cjtoolbox_template_revisions WHERE templateId IN ({$ids})")
|
74 |
+
->delete("DELETE FROM #__cjtoolbox_templates WHERE id IN ({$ids})")
|
75 |
+
->commit()
|
76 |
+
->processQueue();
|
77 |
+
}
|
78 |
+
return $ids;
|
79 |
+
}
|
80 |
+
|
81 |
+
/**
|
82 |
+
* put your comment there...
|
83 |
+
*
|
84 |
+
*/
|
85 |
+
public function getItems() {
|
86 |
+
// Build query.
|
87 |
+
$select = 'SELECT t.id,
|
88 |
+
t.name,
|
89 |
+
t.type,
|
90 |
+
t.description,
|
91 |
+
t.creationDate,
|
92 |
+
t.state,
|
93 |
+
a.name author,
|
94 |
+
r.dateCreated lastModified,
|
95 |
+
r.version,
|
96 |
+
r.state developmentState';
|
97 |
+
$queryBase = $this->getItemsQuery();
|
98 |
+
// Paging.
|
99 |
+
$itemsPerPage = $this->getItemsPerPage();
|
100 |
+
// Get page no#.
|
101 |
+
$page = !isset($this->inputs['paged']) ? 1 : $this->inputs['paged'];
|
102 |
+
// Calculate start offset.
|
103 |
+
$start = ($page - 1) * $itemsPerPage;
|
104 |
+
$limit = " LIMIT {$start},{$itemsPerPage}";
|
105 |
+
// Order.
|
106 |
+
$orderBy = isset($this->inputs['orderby']) ? " ORDER BY {$this->inputs['orderby']} {$this->inputs['order']}" : '';
|
107 |
+
// final query.
|
108 |
+
$query = "{$select}{$queryBase['from']}{$queryBase['where']}{$orderBy}{$limit}";
|
109 |
+
// Execute our query using MYSQL queue driver.
|
110 |
+
$result = cssJSToolbox::getInstance()->getDBDriver()->select($query);
|
111 |
+
return $result;
|
112 |
+
}
|
113 |
+
|
114 |
+
/**
|
115 |
+
* put your comment there...
|
116 |
+
*
|
117 |
+
*/
|
118 |
+
public function getItemsPerPage() {
|
119 |
+
return 20;
|
120 |
+
}
|
121 |
+
|
122 |
+
/**
|
123 |
+
* put your comment there...
|
124 |
+
*
|
125 |
+
*/
|
126 |
+
public function getItemsQuery() {
|
127 |
+
// Import dependencies.
|
128 |
+
cssJSToolbox::import('framework:db:mysql:xtable.inc.php');
|
129 |
+
CJTxTable::import('template-revision');
|
130 |
+
CJTxTable::import('author');
|
131 |
+
// From clause.
|
132 |
+
$query['from'] = ' FROM #__cjtoolbox_templates t
|
133 |
+
LEFT JOIN #__cjtoolbox_template_revisions r ON t.id = r.templateId
|
134 |
+
LEFT JOIN #__cjtoolbox_authors a ON t.authorId = a.id';
|
135 |
+
// Always get only the last revision.
|
136 |
+
$where[] = '(r.attributes & ' . CJTTemplateRevisionTable::FLAG_LAST_REVISION . ')';
|
137 |
+
// For version 6 don't display Internal/System (e.g Wordpress, ) Authors templates
|
138 |
+
$where[] = '((a.attributes & ' . CJTAuthorTable::FLAG_SYS_AUTHOR . ') = 0)';
|
139 |
+
// Build where clause based on the given filters!
|
140 |
+
$filters = array(
|
141 |
+
'types' => array('table' => 't', 'name' =>'type'),
|
142 |
+
'authors' => array('table' => 't', 'name' => 'authorId'),
|
143 |
+
'version' => array('table' => 'r', 'name' => 'version'),
|
144 |
+
'creation-dates' => array( 'name' => 'DATE(creationDate)'),
|
145 |
+
'last-modified-dates' => array('name' => 'DATE(dateCreated)'),
|
146 |
+
'states' => array('table' => 't', 'name' => 'state'),
|
147 |
+
'development-state' => array('table' => 'r', 'name' => 'state'),
|
148 |
+
);
|
149 |
+
foreach ($filters as $name => $field) {
|
150 |
+
$filterName = "filter_{$name}";
|
151 |
+
// Add filter only if there is a value specified.
|
152 |
+
if (!empty($this->inputs[$filterName])) {
|
153 |
+
$value = $this->inputs[$filterName];
|
154 |
+
if (!is_numeric($value)) {
|
155 |
+
$value = "'{$value}'";
|
156 |
+
}
|
157 |
+
$field['table'] = isset($field['table']) ? "{$field['table']}." : '';
|
158 |
+
$where[] = "{$field['table']}{$field['name']} = {$value} ";
|
159 |
+
}
|
160 |
+
}
|
161 |
+
$query['where'] = ' WHERE ' . implode(' AND ', $where);
|
162 |
+
return $query;
|
163 |
+
}
|
164 |
+
|
165 |
+
/**
|
166 |
+
* put your comment there...
|
167 |
+
*
|
168 |
+
*/
|
169 |
+
public function getItemsTotal() {
|
170 |
+
$queryBase = $this->getItemsQuery();
|
171 |
+
$select = 'SELECT count(*) Total';
|
172 |
+
$query = "{$select}{$queryBase['from']}{$queryBase['where']}";
|
173 |
+
// Get items total.
|
174 |
+
$dbDriver = new CJTMYSQLQueueDriver($GLOBALS['wpdb']);
|
175 |
+
$result = $dbDriver->select($query);
|
176 |
+
return array_shift($result)->Total;
|
177 |
+
}
|
178 |
+
|
179 |
+
} // End class.
|
models/tinymce-blocks.php
CHANGED
@@ -21,7 +21,7 @@ class CJTTinymceBlocksModel {
|
|
21 |
// Get common quiery parts!@
|
22 |
$query = $this->getItemsQuery();
|
23 |
// Add fields list!
|
24 |
-
$query['select'] = 'id, name title, owner';
|
25 |
$query = "SELECT {$query['select']} FROM {$query['from']} WHERE {$query['where']};";
|
26 |
// Retrieve blocks!
|
27 |
return $driver->select($query);
|
@@ -33,7 +33,7 @@ class CJTTinymceBlocksModel {
|
|
33 |
*/
|
34 |
public function getItemsQuery() {
|
35 |
// Build query parts!
|
36 |
-
$query['from'] = '#__cjtoolbox_blocks';
|
37 |
$query['where'] = 'type = "block" and backupId IS null';
|
38 |
return $query;
|
39 |
}
|
21 |
// Get common quiery parts!@
|
22 |
$query = $this->getItemsQuery();
|
23 |
// Add fields list!
|
24 |
+
$query['select'] = 'b.id, b.name title, b.owner, f.name formTitle';
|
25 |
$query = "SELECT {$query['select']} FROM {$query['from']} WHERE {$query['where']};";
|
26 |
// Retrieve blocks!
|
27 |
return $driver->select($query);
|
33 |
*/
|
34 |
public function getItemsQuery() {
|
35 |
// Build query parts!
|
36 |
+
$query['from'] = '#__cjtoolbox_blocks b LEFT JOIN #__cjtoolbox_forms f ON b.id = f.blockId';
|
37 |
$query['where'] = 'type = "block" and backupId IS null';
|
38 |
return $query;
|
39 |
}
|
models/uninstall.php
CHANGED
@@ -37,6 +37,30 @@ class CJTUninstallModel {
|
|
37 |
public function expressUninstall() {
|
38 |
// Clean up database
|
39 |
$this->database();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
40 |
// Chaining!
|
41 |
return $this;
|
42 |
}
|
37 |
public function expressUninstall() {
|
38 |
// Clean up database
|
39 |
$this->database();
|
40 |
+
// Clean up file system!
|
41 |
+
$this->fileSystem();
|
42 |
+
// Chaining!
|
43 |
+
return $this;
|
44 |
+
}
|
45 |
+
|
46 |
+
/**
|
47 |
+
* put your comment there...
|
48 |
+
*
|
49 |
+
*/
|
50 |
+
public function fileSystem() {
|
51 |
+
global $wp_filesystem;
|
52 |
+
// Getting directory list!
|
53 |
+
$wpContentDir = 'wp-content';
|
54 |
+
$fSConfig = cssJSToolbox::$config->fileSystem;
|
55 |
+
// Directories to create!
|
56 |
+
$directories = array(
|
57 |
+
"{$wpContentDir}/{$fSConfig->contentDir}",
|
58 |
+
"{$wpContentDir}/{$fSConfig->contentDir}/{$fSConfig->templatesDir}",
|
59 |
+
);
|
60 |
+
// Delete all directories!
|
61 |
+
foreach ($directories as $dir) {
|
62 |
+
$wp_filesystem->delete(ABSPATH . "/{$dir}", true);
|
63 |
+
}
|
64 |
// Chaining!
|
65 |
return $this;
|
66 |
}
|
models/uninstall/db/mysql/uninstall.sql
CHANGED
@@ -1,12 +1,32 @@
|
|
1 |
/*
|
2 |
* Delete CJT Tables
|
3 |
*/
|
|
|
4 |
DROP TABLE IF EXISTS #__cjtoolbox_backups;
|
5 |
DROP TABLE IF EXISTS #__cjtoolbox_blocks;
|
6 |
DROP TABLE IF EXISTS #__cjtoolbox_block_pins;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
7 |
|
8 |
/* Database version number (By this option CJT Plugin detect installation state!) */
|
9 |
-
DELETE FROM
|
10 |
|
11 |
/* Clean up installer state */
|
12 |
DELETE FROM #__wordpress_options WHERE option_name = 'state.CJTInstallerModel.operations';
|
@@ -23,5 +43,9 @@ DELETE FROM #__wordpress_options where option_name = 'meta-box-order_cjtoolbox';
|
|
23 |
DELETE FROM #__wordpress_usermeta where meta_key = 'closedpostboxes_cjtoolbox';
|
24 |
|
25 |
/* User Settings */
|
|
|
26 |
DELETE FROM #__wordpress_options where option_name = 'cjt-settings.CJTSettingsUninstallPage';
|
27 |
-
|
|
|
|
|
|
1 |
/*
|
2 |
* Delete CJT Tables
|
3 |
*/
|
4 |
+
DROP TABLE IF EXISTS #__cjtoolbox_authors;
|
5 |
DROP TABLE IF EXISTS #__cjtoolbox_backups;
|
6 |
DROP TABLE IF EXISTS #__cjtoolbox_blocks;
|
7 |
DROP TABLE IF EXISTS #__cjtoolbox_block_pins;
|
8 |
+
DROP TABLE IF EXISTS #__cjtoolbox_block_templates;
|
9 |
+
DROP TABLE IF EXISTS #__cjtoolbox_templates;
|
10 |
+
DROP TABLE IF EXISTS #__cjtoolbox_template_revisions;
|
11 |
+
/* Added Version 1.1 */
|
12 |
+
DROP TABLE IF EXISTS #__cjtoolbox_packages;
|
13 |
+
DROP TABLE IF EXISTS #__cjtoolbox_package_objects;
|
14 |
+
/* Added Version 1.3 */
|
15 |
+
DROP TABLE IF EXISTS #__cjtoolbox_parameters;
|
16 |
+
DROP TABLE IF EXISTS #__cjtoolbox_parameter_typedef;
|
17 |
+
DROP TABLE IF EXISTS #__cjtoolbox_forms;
|
18 |
+
DROP TABLE IF EXISTS #__cjtoolbox_form_groups;
|
19 |
+
DROP TABLE IF EXISTS #__cjtoolbox_form_group_parameters;
|
20 |
+
DROP TABLE IF EXISTS #__cjtoolbox_parameter_typeparams;
|
21 |
+
/* Added Version 1.4 */
|
22 |
+
DROP TABLE IF EXISTS #__cjtoolbox_form_group_xfields;
|
23 |
+
/* TABLE: Added Version 1.5 */
|
24 |
+
DROP TABLE IF EXISTS #__cjtoolbox_block_files;
|
25 |
+
/* CLEANUP MASTER FILE MET: Added Version 1.5 */
|
26 |
+
DELETE FROM #__wordpress_usermeta where meta_key like 'cjt_block_active_file_%';
|
27 |
|
28 |
/* Database version number (By this option CJT Plugin detect installation state!) */
|
29 |
+
DELETE FROM #__wordpress_options where option_name = 'cjtoolbox_db_version';
|
30 |
|
31 |
/* Clean up installer state */
|
32 |
DELETE FROM #__wordpress_options WHERE option_name = 'state.CJTInstallerModel.operations';
|
43 |
DELETE FROM #__wordpress_usermeta where meta_key = 'closedpostboxes_cjtoolbox';
|
44 |
|
45 |
/* User Settings */
|
46 |
+
DELETE FROM #__wordpress_options where option_name = 'cjt-settings.CJTSettingsMetaboxPage';
|
47 |
DELETE FROM #__wordpress_options where option_name = 'cjt-settings.CJTSettingsUninstallPage';
|
48 |
+
|
49 |
+
/* Posts Metabox blocks */
|
50 |
+
DELETE FROM #__wordpress_postmeta where meta_key = '__CJT-BLOCK-ID';
|
51 |
+
DELETE FROM #__wordpress_postmeta where meta_key = '__CJT-BLOCK-STATUS'
|
readme.txt
CHANGED
@@ -5,68 +5,106 @@ Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_i
|
|
5 |
Tags: Post, posts, admin, sidebar, page, pages, image, plug, plugin, customise, style, scripts, hack, Wordpress, HTML, CSS, JavaScript, HTML5, jQuery, PHP, code, script, scripts, manage, management, display, output, header, footer, apply, requests, match, hook, execute, run
|
6 |
License: GPLv2 or later
|
7 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
8 |
-
Requires at least: 3.
|
9 |
-
Tested up to: 3.
|
10 |
-
Stable tag:
|
11 |
|
12 |
Easily add custom CSS, JavaScript, HTML and PHP code to unique CJT code blocks and assign them wherever you want.
|
13 |
|
14 |
== Description ==
|
15 |
-
CSS & JavaScript Toolbox is a code management plugin that gives you the tools to easily and safely modify or extend the functionality and appearance of your WordPress-powered website. You do this by adding custom code directly into unique code blocks and assign them to pages, posts, custom posts, categories, URLs, expressions, and loads more!
|
16 |
|
17 |
-
|
|
|
18 |
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
- Suspend Code Block from being involved by Deactivating Blocks. Its also great for debugging
|
28 |
-
- Quickly Auto-Complete code you writing by using Code Auto Complete Extension.
|
29 |
-
- Code Auto Complete is not just completing Keywords its filled with Code Snippets.
|
30 |
-
- Able to loads Thousands of Pages/Posts/Categories/Custom Posts without refreshing the page, its using AJAX.
|
31 |
-
- Edit Multiple Code Blocks at the same time without navigating the browsers
|
32 |
-
- Delegate Block Code using Shortcode
|
33 |
-
- Ordering Global Blocks by Drag-Drop allow Block to has priority over others
|
34 |
-
- Create Multiple named Blocks Backups.
|
35 |
-
- Block changes are revisioned. Restore Block to specific revision if wrongly lost your Block Code
|
36 |
-
|
37 |
-
= PRO Features =
|
38 |
-
- About 30 Editor and Block Themes to pick from, Pick up a Theme for each Device/Browser you use to write CJT Code
|
39 |
-
- Organize Blocks by create Metabox Block at Edit Post level
|
40 |
-
- Fullscreen mode Editor
|
41 |
-
- Auto load assignment objects when list scrolled.
|
42 |
-
- Centralize your Library/Third-Party code by linking Templates
|
43 |
-
- Load WordPress Built-In Scripts/Styles (jQuery, Thickbox, jQuery TABS, and all scripts that bundled with WordPress) with Blocks via Templates lookup form by linking them
|
44 |
-
- Linked Templates is using WordPress Scripts/Styles Queue to avoid conflicts
|
45 |
-
- Insert Block Shortcode by single click via Shortcodes list.
|
46 |
-
- Give webmaster the control to allow/deny creating Post/Page Metabox at Edit Post Level
|
47 |
-
- Download Third-Party Code file, add it as Template and Link to a block by a single click via Link External Button!
|
48 |
-
- Ability to import Blocks + Templates by creating Packages
|
49 |
-
- Packages make it possible to work in external Editors, save all Blocks and Templates into file and then Import them into CJT by writing a simple definition.xml file.
|
50 |
-
- Package can be shared between multiple CJT Installation therefore allow developers to create single package and use it whenever needed!
|
51 |
-
- Package allows defining Block Parameters therefore its possible to pass Block Parameters via Shortcode Parameters Form.
|
52 |
-
- Shortcode parameters form is an internal feature that allows Block to prompt for parameters when inserted as Shortcode
|
53 |
-
- Toggle Assignment Panel On/Off to get more/less Editor width
|
54 |
-
- Enjoy PRO Users responsive support
|
55 |
-
|
56 |
-
= Would like to know more? =
|
57 |
-
If you would like to learn more, please click to [CJT Documentation](http://css-javascript-toolbox.com/learn/).
|
58 |
|
59 |
= Who is this plugin for? =
|
60 |
-
This plugin is primarily intended for WordPress website developers and designers. But that is not to say that others would not be able to get use out of it. CJT can be used for a lot of things from teachers
|
61 |
|
62 |
= Have you ever thought? =
|
63 |
-
- Wouldn't it be great to have an easy way to plug
|
64 |
-
- How nice it would be if you could simply add code that works with WordPress internal code without hacking away at core files
|
65 |
-
- How about a nice simple way to change the appearance of a page or post in your Wordpress website
|
66 |
-
- What about a means to organise your scripts and blocks of code in
|
67 |
|
68 |
-
=
|
69 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
70 |
|
71 |
= Follow the Developments =
|
72 |
If you like to know more about the development state, issues and to track future versions code please follow us on [GitHub Plugin repository](https://github.com/css-javascript-toolbox/css-javascript-toolbox-plugin).
|
@@ -142,11 +180,67 @@ Sometimes a bug decides to rear its ugly head and when this happens, this is whe
|
|
142 |
|
143 |
== Screenshots ==
|
144 |
|
145 |
-
1.
|
146 |
-
2.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
147 |
|
148 |
== Changelog ==
|
149 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
150 |
= 6.1.5 =
|
151 |
* Enhance: Editor enhancements and updates.
|
152 |
* Enhance: Framework updates (Allow installing New CAC extension).
|
5 |
Tags: Post, posts, admin, sidebar, page, pages, image, plug, plugin, customise, style, scripts, hack, Wordpress, HTML, CSS, JavaScript, HTML5, jQuery, PHP, code, script, scripts, manage, management, display, output, header, footer, apply, requests, match, hook, execute, run
|
6 |
License: GPLv2 or later
|
7 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
8 |
+
Requires at least: 3.9
|
9 |
+
Tested up to: 3.9
|
10 |
+
Stable tag: 7.1
|
11 |
|
12 |
Easily add custom CSS, JavaScript, HTML and PHP code to unique CJT code blocks and assign them wherever you want.
|
13 |
|
14 |
== Description ==
|
15 |
+
CSS & JavaScript Toolbox is a powerful code management plugin that gives you the tools to easily and safely modify or extend the functionality and appearance of your WordPress-powered website. You do this by adding custom code directly into unique code blocks and assign them to pages, posts, custom posts, categories, URLs, expressions, and loads more!
|
16 |
|
17 |
+
= CJT Free – Now Full-Featured!!! =
|
18 |
+
We want you to try out all the features of CJT Pro/Dev so we have now included them in the community edition of CJT Free on WordPress.org. It’s also a way of giving back to the community that have supported us from the very beginning.
|
19 |
|
20 |
+
When you get a chance, please click into the CJT website and learn about the [benefits of upgrading to CJT Pro/Dev](http://css-javascript-toolbox.com).
|
21 |
+
|
22 |
+
[youtube http://www.youtube.com/watch?v=iyjq7IXBC5E]
|
23 |
+
|
24 |
+
= So what exactly is CJT? =
|
25 |
+
Just like plugins, scripts can modify or extend the functionality and appearance of your website. Unlike plugins, adding and configuring script code files can be frustrating. CJT makes this process pleasant and easy. In fact, adding scripts and styles with CJT can be done in as little as two steps:
|
26 |
+
1) Add your code
|
27 |
+
2) Assign where it goes
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
28 |
|
29 |
= Who is this plugin for? =
|
30 |
+
This plugin is primarily intended for WordPress website developers and designers. But that is not to say that others would not be able to get use out of it. CJT can be used for a lot of things from; teachers teaching and students learning to code, to mum and dad bloggers wanting to add Google Analytics or other scripts to their website. So whether it be adding free/premium scripts, creating and testing new scripts, streamlining development work, making front-end customisations, or even teaching and learning WordPress – CJT is extremely flexible and versatile.
|
31 |
|
32 |
= Have you ever thought? =
|
33 |
+
- Wouldn't it be great to have an easy way to plug code into your Wordpress installation without having to know how to create a Wordpress plugin OR having to modify files through FTP, etc
|
34 |
+
- How nice it would be if you could simply add code that works with WordPress internal code without hacking away at core files
|
35 |
+
- How about a nice simple way to change the appearance of a page or post in your Wordpress website
|
36 |
+
- What about a means to organise your scripts and blocks of code in an easy-to-use graphical web interface
|
37 |
|
38 |
+
= Features =
|
39 |
+
Check out the HUGE list of features for CJT Free below.
|
40 |
+
|
41 |
+
= Global Code Blocks =
|
42 |
+
Add as many CJT code blocks as you need
|
43 |
+
Assign a code block to multiple Pages/Posts/Categories/etc
|
44 |
+
Edit multiple code blocks at the same time without navigating browsers
|
45 |
+
Reorder code blocks via drag and drop to allow block priority over others
|
46 |
+
|
47 |
+
Assign code blocks to:
|
48 |
+
- Pages (including Child/Sub Pages)
|
49 |
+
- Posts (including Custom Posts)
|
50 |
+
- Categories (including Child/Sub Categories)
|
51 |
+
- Auxiliary Assignments (including Entire Website, Website Backend, All Pages, All Posts, Recent Posts, Blog Index, All Categories, Search Pages, All Archives, Tag Archives, Author Archives, Attachment Pages, and 404 Error Pages)
|
52 |
+
- URLs and Regular Expressions
|
53 |
+
Select to output the code block to the Header/Footer of the assignment
|
54 |
+
|
55 |
+
= Metabox Code Block & Shortcodes =
|
56 |
+
Add CJT metabox code block at the Page/Post level
|
57 |
+
Security setting in Options to enable/disable metabox code block
|
58 |
+
Use CJT shortcodes to output the code block at the Page/Post level (for pinpoint output)
|
59 |
+
TinyMCE button provides a popup, which lists all CJT shortcodes for easy insertion via a single click
|
60 |
+
|
61 |
+
= Code Files =
|
62 |
+
Each code block now supports code files:
|
63 |
+
- Create as many code files as needed
|
64 |
+
- Add a name, language type (i.e. HTML, PHP, CSS and JavaScript), and description for your code file. Editor language will automatically be switched for you
|
65 |
+
- All code files will share the same assignments (e.g. the same Posts/Pages/Categories/etc)
|
66 |
+
- You can turn your code block into a mini project. For example, you can assign a single block with multiple code files to a Page or Post, instead of creating multiple blocks to a single Page or Post
|
67 |
+
- Switch between code files using AJAX
|
68 |
+
- Multiple authors can work on the same block at the same time by editing different code files
|
69 |
+
- When executed all block code files will be merged together and involved as a single file
|
70 |
+
|
71 |
+
= Templates & Packages =
|
72 |
+
External Link function seamlessly download a third-party script (e.g. from CDN), add it as a template and link it to the current code block
|
73 |
+
|
74 |
+
Code Template Manager allows you to:
|
75 |
+
- Create HTML, PHP, CSS and JavaScript code templates so you can link or embed them to your code blocks
|
76 |
+
- Centralise your library/third-party codes by linking templates, which is using WordPress scripts/styles queue to avoid conflicts
|
77 |
+
|
78 |
+
Template Lookup System allows you to:
|
79 |
+
- Link/embed BOTH Templates and even WordPress built-in scripts/styles (such as jQuery, Thickbox, etc) that are bundled with WordPress
|
80 |
+
|
81 |
+
Package System allows you to:
|
82 |
+
- Install packages from the CJT website
|
83 |
+
- Create your own packages (zip package made up of code blocks and templates)
|
84 |
+
- Work in external editors, save all code blocks and templates into files, and then import them into CJT via a simple definition.xml file
|
85 |
+
- Share packages with other CJT developers
|
86 |
+
- Define block parameters, making it possible to utilise shortcode parameters form, which allows block to prompt for parameters when inserted as a shortcode
|
87 |
+
|
88 |
+
= Cool Tools =
|
89 |
+
Write HTML, PHP, CSS and JavaScript using the Advanced Code Editor
|
90 |
+
Powerful editor coding tools like: Undo, Redo, Find, Replace, Go To Line, Fold, UnFold, Collapse and Expand, and much more!
|
91 |
+
Code Auto Completion is a powerful helper tool to quickly auto-complete HTML, PHP, CSS and JavaScript code syntax and code snippets
|
92 |
+
Syntax highlighting and error checking
|
93 |
+
Around 30 editor and code block themes to choose from
|
94 |
+
|
95 |
+
Many batch operations including:
|
96 |
+
- Activate/Deactivate/Revert state for all code blocks (great for debugging)
|
97 |
+
- Switch all code blocks to either the Header or Footer
|
98 |
+
- Delete all or delete only the empty code blocks
|
99 |
+
Create multiple backups for all your code blocks, allowing them all to be restored
|
100 |
+
Create multiple code block revisions, allowing the single block to be restored
|
101 |
+
Tools allow for font-size adjustment, full-width and full-screen editing
|
102 |
+
Minimise or maximise all code blocks with a single click
|
103 |
+
|
104 |
+
= Performance =
|
105 |
+
Have you ever noticed how your website can start slowing down when you add more and more WordPress plugins into the mix. Unfortunately plugins can bloat your website and use unnecessary resources if they are used when not needed. CJT only reserves memory resources and usage processes when it needs to, otherwise it will not get involved. Additionally, by adding scripts that emulate an existing plugin, YOU get to decide exactly where the script will run.
|
106 |
+
|
107 |
+
CJT has been fully tested using over 100 code blocks and 1000′s of assignments (e.g. Posts/Pages/Categories/etc). This was made possible using a combination of AJAX scrolling and pagination. In fact, 99% of CJT utilises AJAX technology, which means there is no need to refresh/reload the webpage
|
108 |
|
109 |
= Follow the Developments =
|
110 |
If you like to know more about the development state, issues and to track future versions code please follow us on [GitHub Plugin repository](https://github.com/css-javascript-toolbox/css-javascript-toolbox-plugin).
|
180 |
|
181 |
== Screenshots ==
|
182 |
|
183 |
+
1. Code Block
|
184 |
+
2. Create code blocks
|
185 |
+
3. Blocks List
|
186 |
+
4. Editor Syntax Highlights and Error Checker
|
187 |
+
5. Code Auto Completion and Code Snippets Extension
|
188 |
+
6. Editing Tools
|
189 |
+
7. Save Load Code Tools
|
190 |
+
8. Assigning Wordpress Pages
|
191 |
+
9. Assigning Wordpress Posts
|
192 |
+
10. Assigning Custom Posts
|
193 |
+
11. Assigning Categories
|
194 |
+
12. Auxiliary Assignments
|
195 |
+
13. Advanced Assignment (URLs and Regular Expressions)
|
196 |
+
14. Change State Batch Tools
|
197 |
+
15. Change Location/Hook Batch Tools
|
198 |
+
16. Delete and Backup Tools
|
199 |
+
17. Block Code-Files Manager Form
|
200 |
+
18. Hide/Show Assignment Panel window
|
201 |
+
19. Single Window Full Screen Mode
|
202 |
+
20. Change Editor Theme
|
203 |
+
21. Templates Manager Form
|
204 |
+
22. Templates Lookup Form
|
205 |
+
23. Insert Block Shortcode via TinyMCE Button
|
206 |
+
24. Create Metabox Block At Edit post Level
|
207 |
+
25. Blocks Screenshor by creating Backup from all existing Code Blocks
|
208 |
+
26. Block Revisions Dialog
|
209 |
+
27. Block Info Dialog
|
210 |
|
211 |
== Changelog ==
|
212 |
|
213 |
+
= 7.1 =
|
214 |
+
* Enhance: Processing and Memory optimization for better performance.
|
215 |
+
* Enhance: Block Box Themes Support.
|
216 |
+
* Enhance: 32 Themes is now supported to be applied for the whole block box.
|
217 |
+
* Enhance: Applying theme per browser. Allow for assigning appropriate theme for different devices.
|
218 |
+
* Enhance: Assigned/All mode switchers for assignment panel list. You can show all items even not selected ones or show only assigned to the block.
|
219 |
+
* Enhance: Bullet-Proof Assignment Panel layout so it would always reserved even if another Plugin wrongly load jQuery TABS/ACCORDION Styles.
|
220 |
+
* Enahnce: General UI enhancements.
|
221 |
+
* Enahnce: Code editor updates.
|
222 |
+
* Enhance: Turns CJT Block into a tiny Project that host Multiple "Managed" Code-Files instead of just one.
|
223 |
+
* Enhance: No need to create a Block for each Language Type and assign them to the same Wordpress Page. One Block with Multiple Code Files solved that by creating only one Block for each assgined request.
|
224 |
+
* Enhance: Code Files Support Language Type, Code, Description and TAG fields.
|
225 |
+
* Enhance: Write Design-Time Organized Code by separating them into code-files (JS, CSS, PHP, HTML) and CJT will merge them all at run-time.
|
226 |
+
* Enhance: There is no need to write <script>, <style> or <?php ?> tags when writing Javascript, CSS or PHP Codes. Code File assigned language would take care of that.
|
227 |
+
* Enhance: Control/Modify auto-added <script>, <style> or <?php ?> TAGS by modifying Code File TAG field.
|
228 |
+
* Enhance: Automatically Change Code Editor language to currently active Code File language.
|
229 |
+
* Enhance: Manage Code Files without leaving the Block Page.
|
230 |
+
* Enhance: Block revision is now created based on the Current Active Code File. Therefore each Code File has its owen revisions.
|
231 |
+
* Enhance: Its now possible for multiple Authors to work on the same Block by creating Multiple Code-Files.
|
232 |
+
* Enhance: Add Multiple Code Files to CJT Packages.
|
233 |
+
* Enhance: Block File, Edit and View Menus.
|
234 |
+
* Enhance: 'Load Local', 'Load Url' and 'Reload' to load Block Code from Local File, Url and Reload From Server respectively.
|
235 |
+
* Enhance: Save/Download Block Current Active Code File.
|
236 |
+
* Enhance: Undo, Redo, Find, Find Next, Find Previous, Replace, Goto Line, Goto Line Up, GoTo Line Down, GoTo Next Error, GoTo Previous Error, Fold, Fold All, UnFold, UnFold All, To Lower Case and To Upper Case Edit Menu functions added.
|
237 |
+
* Enhance: 'Settings' Edit Menu item for Fully Customize Code Editor Fonts, Show/Hide Print Margine, Keybinding Methods, Show/Hide Scroll, Scroll Speed, Readonly, Show/Hide Gutter, TAB Size, New Line Mode and much more!
|
238 |
+
* Enhance: Show/Hide StatusBar via View StatusBar Menu.
|
239 |
+
* Enhance: CJT Website is now support Full documentation Tutorials that expose many internal features/possibilities that can be achived by CJT.
|
240 |
+
* Enhance: Code Blocks disappeared after upgrading to Wordpress 3.9 and sever running PHP >= 5.5.
|
241 |
+
* Enhance: Packages Management System (BETA)
|
242 |
+
* Enhance: Define Shortcode Parameters by creating package and input their values from the CJT Shortcode Parameters form.
|
243 |
+
|
244 |
= 6.1.5 =
|
245 |
* Enhance: Editor enhancements and updates.
|
246 |
* Enhance: Framework updates (Allow installing New CAC extension).
|
tables/author.php
ADDED
@@ -0,0 +1,49 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @version $ Id; ?FILE_NAME ?DATE ?TIME ?AUTHOR $
|
4 |
+
*/
|
5 |
+
|
6 |
+
// Disallow direct access.
|
7 |
+
defined('ABSPATH') or die("Access denied");
|
8 |
+
|
9 |
+
/**
|
10 |
+
*
|
11 |
+
* DESCRIPTION
|
12 |
+
*
|
13 |
+
* @author ??
|
14 |
+
* @version ??
|
15 |
+
*/
|
16 |
+
class CJTAuthorTable extends CJTxTable {
|
17 |
+
|
18 |
+
/**
|
19 |
+
*
|
20 |
+
*
|
21 |
+
*/
|
22 |
+
const FLAG_SYS_AUTHOR = 1;
|
23 |
+
|
24 |
+
/**
|
25 |
+
*
|
26 |
+
*
|
27 |
+
*/
|
28 |
+
const FLAG_LOCAL_AUTHOR = 2;
|
29 |
+
|
30 |
+
/**
|
31 |
+
*
|
32 |
+
*
|
33 |
+
*/
|
34 |
+
const FLAG_GLOBAL_AUTHOR = 4;
|
35 |
+
|
36 |
+
/**
|
37 |
+
*
|
38 |
+
*/
|
39 |
+
const WORDPRESS_AUTHOR_ID = 1;
|
40 |
+
|
41 |
+
/**
|
42 |
+
* put your comment there...
|
43 |
+
*
|
44 |
+
*/
|
45 |
+
public function __construct($dbDriver) {
|
46 |
+
parent::__construct($dbDriver, 'authors');
|
47 |
+
}
|
48 |
+
|
49 |
+
} // End class.
|
tables/block-files.php
ADDED
@@ -0,0 +1,31 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @version $ Id; ?FILE_NAME ?DATE ?TIME ?AUTHOR $
|
4 |
+
*/
|
5 |
+
|
6 |
+
// Disallow direct access.
|
7 |
+
defined('ABSPATH') or die("Access denied");
|
8 |
+
|
9 |
+
/**
|
10 |
+
*
|
11 |
+
* DESCRIPTION
|
12 |
+
*
|
13 |
+
* @author ??
|
14 |
+
* @version ??
|
15 |
+
*/
|
16 |
+
class CJTBlockFilesTable extends CJTxTable {
|
17 |
+
|
18 |
+
/**
|
19 |
+
* put your comment there...
|
20 |
+
*
|
21 |
+
* @param mixed $dbDriver
|
22 |
+
* @return CJTPackageTable
|
23 |
+
*/
|
24 |
+
public function __construct($dbDriver) {
|
25 |
+
// Initialize parent.
|
26 |
+
parent::__construct($dbDriver, 'block_files');
|
27 |
+
// Table key.
|
28 |
+
$this->setTableKey(array('id', 'blockId'));
|
29 |
+
}
|
30 |
+
|
31 |
+
} // End class.
|
tables/block-template.php
ADDED
@@ -0,0 +1,28 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @version $ Id; ?FILE_NAME ?DATE ?TIME ?AUTHOR $
|
4 |
+
*/
|
5 |
+
|
6 |
+
// Disallow direct access.
|
7 |
+
defined('ABSPATH') or die("Access denied");
|
8 |
+
|
9 |
+
/**
|
10 |
+
*
|
11 |
+
* DESCRIPTION
|
12 |
+
*
|
13 |
+
* @author ??
|
14 |
+
* @version ??
|
15 |
+
*/
|
16 |
+
class CJTBlockTemplateTable extends CJTxTable {
|
17 |
+
|
18 |
+
/**
|
19 |
+
* put your comment there...
|
20 |
+
*
|
21 |
+
* @param mixed $dbDriver
|
22 |
+
* @return CJTTemplatesTable
|
23 |
+
*/
|
24 |
+
public function __construct($dbDriver) {
|
25 |
+
parent::__construct($dbDriver, 'block_templates');
|
26 |
+
}
|
27 |
+
|
28 |
+
} // End class.
|
tables/form-group-xfields.php
ADDED
@@ -0,0 +1,29 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @version $ Id; ?FILE_NAME ?DATE ?TIME ?AUTHOR $
|
4 |
+
*/
|
5 |
+
|
6 |
+
// Disallow direct access.
|
7 |
+
defined('ABSPATH') or die("Access denied");
|
8 |
+
|
9 |
+
/**
|
10 |
+
*
|
11 |
+
* DESCRIPTION
|
12 |
+
*
|
13 |
+
* @author ??
|
14 |
+
* @version ??
|
15 |
+
*/
|
16 |
+
class CJTFormGroupXFieldsTable extends CJTxTable {
|
17 |
+
|
18 |
+
/**
|
19 |
+
* put your comment there...
|
20 |
+
*
|
21 |
+
* @param mixed $dbDriver
|
22 |
+
* @return CJTPackageTable
|
23 |
+
*/
|
24 |
+
public function __construct($dbDriver) {
|
25 |
+
// Initialize parent.
|
26 |
+
parent::__construct($dbDriver, 'form_group_xfields');
|
27 |
+
}
|
28 |
+
|
29 |
+
} // End class.
|
tables/form-group.php
ADDED
@@ -0,0 +1,29 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @version $ Id; ?FILE_NAME ?DATE ?TIME ?AUTHOR $
|
4 |
+
*/
|
5 |
+
|
6 |
+
// Disallow direct access.
|
7 |
+
defined('ABSPATH') or die("Access denied");
|
8 |
+
|
9 |
+
/**
|
10 |
+
*
|
11 |
+
* DESCRIPTION
|
12 |
+
*
|
13 |
+
* @author ??
|
14 |
+
* @version ??
|
15 |
+
*/
|
16 |
+
class CJTFormGroupTable extends CJTxTable {
|
17 |
+
|
18 |
+
/**
|
19 |
+
* put your comment there...
|
20 |
+
*
|
21 |
+
* @param mixed $dbDriver
|
22 |
+
* @return CJTPackageTable
|
23 |
+
*/
|
24 |
+
public function __construct($dbDriver) {
|
25 |
+
// Initialize parent.
|
26 |
+
parent::__construct($dbDriver, 'form_groups');
|
27 |
+
}
|
28 |
+
|
29 |
+
} // End class.
|
tables/form.php
ADDED
@@ -0,0 +1,31 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @version $ Id; ?FILE_NAME ?DATE ?TIME ?AUTHOR $
|
4 |
+
*/
|
5 |
+
|
6 |
+
// Disallow direct access.
|
7 |
+
defined('ABSPATH') or die("Access denied");
|
8 |
+
|
9 |
+
/**
|
10 |
+
*
|
11 |
+
* DESCRIPTION
|
12 |
+
*
|
13 |
+
* @author ??
|
14 |
+
* @version ??
|
15 |
+
*/
|
16 |
+
class CJTFormTable extends CJTxTable {
|
17 |
+
|
18 |
+
/**
|
19 |
+
* put your comment there...
|
20 |
+
*
|
21 |
+
* @param mixed $dbDriver
|
22 |
+
* @return CJTPackageTable
|
23 |
+
*/
|
24 |
+
public function __construct($dbDriver) {
|
25 |
+
// Initialize parent.
|
26 |
+
parent::__construct($dbDriver, 'forms');
|
27 |
+
// Set table key.
|
28 |
+
$this->setTableKey(array('blockId'));
|
29 |
+
}
|
30 |
+
|
31 |
+
} // End class.
|
tables/group-parameter.php
ADDED
@@ -0,0 +1,29 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @version $ Id; ?FILE_NAME ?DATE ?TIME ?AUTHOR $
|
4 |
+
*/
|
5 |
+
|
6 |
+
// Disallow direct access.
|
7 |
+
defined('ABSPATH') or die("Access denied");
|
8 |
+
|
9 |
+
/**
|
10 |
+
*
|
11 |
+
* DESCRIPTION
|
12 |
+
*
|
13 |
+
* @author ??
|
14 |
+
* @version ??
|
15 |
+
*/
|
16 |
+
class CJTGroupParameterTable extends CJTxTable {
|
17 |
+
|
18 |
+
/**
|
19 |
+
* put your comment there...
|
20 |
+
*
|
21 |
+
* @param mixed $dbDriver
|
22 |
+
* @return CJTPackageTable
|
23 |
+
*/
|
24 |
+
public function __construct($dbDriver) {
|
25 |
+
// Initialize parent.
|
26 |
+
parent::__construct($dbDriver, 'form_group_parameters');
|
27 |
+
}
|
28 |
+
|
29 |
+
} // End class.
|
tables/package-objects.php
ADDED
@@ -0,0 +1,28 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @version $ Id; ?FILE_NAME ?DATE ?TIME ?AUTHOR $
|
4 |
+
*/
|
5 |
+
|
6 |
+
// Disallow direct access.
|
7 |
+
defined('ABSPATH') or die("Access denied");
|
8 |
+
|
9 |
+
/**
|
10 |
+
*
|
11 |
+
* DESCRIPTION
|
12 |
+
*
|
13 |
+
* @author ??
|
14 |
+
* @version ??
|
15 |
+
*/
|
16 |
+
class CJTPackageObjectsTable extends CJTxTable {
|
17 |
+
|
18 |
+
/**
|
19 |
+
* put your comment there...
|
20 |
+
*
|
21 |
+
* @param mixed $dbDriver
|
22 |
+
* @return CJTPackageTable
|
23 |
+
*/
|
24 |
+
public function __construct($dbDriver) {
|
25 |
+
parent::__construct($dbDriver, 'package_objects');
|
26 |
+
}
|
27 |
+
|
28 |
+
} // End class.
|
tables/package.php
ADDED
@@ -0,0 +1,28 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @version $ Id; ?FILE_NAME ?DATE ?TIME ?AUTHOR $
|
4 |
+
*/
|
5 |
+
|
6 |
+
// Disallow direct access.
|
7 |
+
defined('ABSPATH') or die("Access denied");
|
8 |
+
|
9 |
+
/**
|
10 |
+
*
|
11 |
+
* DESCRIPTION
|
12 |
+
*
|
13 |
+
* @author ??
|
14 |
+
* @version ??
|
15 |
+
*/
|
16 |
+
class CJTPackageTable extends CJTxTable {
|
17 |
+
|
18 |
+
/**
|
19 |
+
* put your comment there...
|
20 |
+
*
|
21 |
+
* @param mixed $dbDriver
|
22 |
+
* @return CJTPackageTable
|
23 |
+
*/
|
24 |
+
public function __construct($dbDriver) {
|
25 |
+
parent::__construct($dbDriver, 'packages');
|
26 |
+
}
|
27 |
+
|
28 |
+
} // End class.
|
tables/parameter-typedef.php
ADDED
@@ -0,0 +1,29 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @version $ Id; ?FILE_NAME ?DATE ?TIME ?AUTHOR $
|
4 |
+
*/
|
5 |
+
|
6 |
+
// Disallow direct access.
|
7 |
+
defined('ABSPATH') or die("Access denied");
|
8 |
+
|
9 |
+
/**
|
10 |
+
*
|
11 |
+
* DESCRIPTION
|
12 |
+
*
|
13 |
+
* @author ??
|
14 |
+
* @version ??
|
15 |
+
*/
|
16 |
+
class CJTParameterTypedefTable extends CJTxTable {
|
17 |
+
|
18 |
+
/**
|
19 |
+
* put your comment there...
|
20 |
+
*
|
21 |
+
* @param mixed $dbDriver
|
22 |
+
* @return CJTPackageTable
|
23 |
+
*/
|
24 |
+
public function __construct($dbDriver) {
|
25 |
+
// Initialize parent.
|
26 |
+
parent::__construct($dbDriver, 'parameter_typedef');
|
27 |
+
}
|
28 |
+
|
29 |
+
} // End class.
|
tables/parameter-typeparams.php
ADDED
@@ -0,0 +1,29 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @version $ Id; ?FILE_NAME ?DATE ?TIME ?AUTHOR $
|
4 |
+
*/
|
5 |
+
|
6 |
+
// Disallow direct access.
|
7 |
+
defined('ABSPATH') or die("Access denied");
|
8 |
+
|
9 |
+
/**
|
10 |
+
*
|
11 |
+
* DESCRIPTION
|
12 |
+
*
|
13 |
+
* @author ??
|
14 |
+
* @version ??
|
15 |
+
*/
|
16 |
+
class CJTParameterTypeparamsTable extends CJTxTable {
|
17 |
+
|
18 |
+
/**
|
19 |
+
* put your comment there...
|
20 |
+
*
|
21 |
+
* @param mixed $dbDriver
|
22 |
+
* @return CJTPackageTable
|
23 |
+
*/
|
24 |
+
public function __construct($dbDriver) {
|
25 |
+
// Initialize parent.
|
26 |
+
parent::__construct($dbDriver, 'parameter_typeparams');
|
27 |
+
}
|
28 |
+
|
29 |
+
} // End class.
|
tables/parameter.php
ADDED
@@ -0,0 +1,29 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @version $ Id; ?FILE_NAME ?DATE ?TIME ?AUTHOR $
|
4 |
+
*/
|
5 |
+
|
6 |
+
// Disallow direct access.
|
7 |
+
defined('ABSPATH') or die("Access denied");
|
8 |
+
|
9 |
+
/**
|
10 |
+
*
|
11 |
+
* DESCRIPTION
|
12 |
+
*
|
13 |
+
* @author ??
|
14 |
+
* @version ??
|
15 |
+
*/
|
16 |
+
class CJTParameterTable extends CJTxTable {
|
17 |
+
|
18 |
+
/**
|
19 |
+
* put your comment there...
|
20 |
+
*
|
21 |
+
* @param mixed $dbDriver
|
22 |
+
* @return CJTPackageTable
|
23 |
+
*/
|
24 |
+
public function __construct($dbDriver) {
|
25 |
+
// Initialize parent.
|
26 |
+
parent::__construct($dbDriver, 'parameters');
|
27 |
+
}
|
28 |
+
|
29 |
+
} // End class.
|
tables/pins-blocks-view.php
CHANGED
@@ -32,7 +32,6 @@ class CJTPinsBlockSQLView extends CJTSQLView {
|
|
32 |
'blocks.id',
|
33 |
'blocks.name',
|
34 |
'blocks.pinPoint',
|
35 |
-
'blocks.code',
|
36 |
'blocks.location',
|
37 |
'blocks.links',
|
38 |
'blocks.expressions'
|
@@ -72,7 +71,7 @@ class CJTPinsBlockSQLView extends CJTSQLView {
|
|
72 |
$query['from'] = "`{$blocksTable}` blocks
|
73 |
LEFT JOIN `{$pinsTable}` pins
|
74 |
ON blocks.`id` = pins.`blockId`";
|
75 |
-
$query['where'] = "(((`backupId` IS NULL) AND (
|
76 |
((blocks.`pinPoint` & {$filters->pinPoint}){$customPins}))";
|
77 |
// Combine all into one statement.
|
78 |
$query = $this->buildQuery($query['from'], $query['where']);
|
32 |
'blocks.id',
|
33 |
'blocks.name',
|
34 |
'blocks.pinPoint',
|
|
|
35 |
'blocks.location',
|
36 |
'blocks.links',
|
37 |
'blocks.expressions'
|
71 |
$query['from'] = "`{$blocksTable}` blocks
|
72 |
LEFT JOIN `{$pinsTable}` pins
|
73 |
ON blocks.`id` = pins.`blockId`";
|
74 |
+
$query['where'] = "(((`backupId` IS NULL) AND (`state` = '{$filters->state}'){$excludes}) AND
|
75 |
((blocks.`pinPoint` & {$filters->pinPoint}){$customPins}))";
|
76 |
// Combine all into one statement.
|
77 |
$query = $this->buildQuery($query['from'], $query['where']);
|
tables/template-revision.php
ADDED
@@ -0,0 +1,43 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @version $ Id; ?FILE_NAME ?DATE ?TIME ?AUTHOR $
|
4 |
+
*/
|
5 |
+
|
6 |
+
// Disallow direct access.
|
7 |
+
defined('ABSPATH') or die("Access denied");
|
8 |
+
|
9 |
+
/**
|
10 |
+
*
|
11 |
+
* DESCRIPTION
|
12 |
+
*
|
13 |
+
* @author ??
|
14 |
+
* @version ??
|
15 |
+
*/
|
16 |
+
class CJTTemplateRevisionTable extends CJTxTable {
|
17 |
+
|
18 |
+
/** */
|
19 |
+
const FLAG_LAST_REVISION = 0x01;
|
20 |
+
|
21 |
+
/**
|
22 |
+
* put your comment there...
|
23 |
+
*
|
24 |
+
*/
|
25 |
+
public function __construct($dbDriver) {
|
26 |
+
parent::__construct($dbDriver, 'template_revisions');
|
27 |
+
}
|
28 |
+
|
29 |
+
/**
|
30 |
+
* put your comment there...
|
31 |
+
*
|
32 |
+
* @param mixed $templateId
|
33 |
+
*/
|
34 |
+
public function fetchLastRevision($templateId) {
|
35 |
+
$attributes = self::FLAG_LAST_REVISION;
|
36 |
+
$query = "SELECT *
|
37 |
+
FROM #__cjtoolbox_template_revisions
|
38 |
+
WHERE templateId = {$templateId} AND (attributes & {$attributes})";
|
39 |
+
$this->load($query);
|
40 |
+
return $this;
|
41 |
+
}
|
42 |
+
|
43 |
+
} // End class.
|
tables/template.php
ADDED
@@ -0,0 +1,63 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @version $ Id; ?FILE_NAME ?DATE ?TIME ?AUTHOR $
|
4 |
+
*/
|
5 |
+
|
6 |
+
// Disallow direct access.
|
7 |
+
defined('ABSPATH') or die("Access denied");
|
8 |
+
|
9 |
+
/**
|
10 |
+
*
|
11 |
+
* DESCRIPTION
|
12 |
+
*
|
13 |
+
* @author ??
|
14 |
+
* @version ??
|
15 |
+
*/
|
16 |
+
class CJTTemplateTable extends CJTxTable {
|
17 |
+
|
18 |
+
/**
|
19 |
+
*
|
20 |
+
*/
|
21 |
+
const ATTRIBUTES_SYSTEM_FLAG = 0x01;
|
22 |
+
|
23 |
+
/**
|
24 |
+
* put your comment there...
|
25 |
+
*
|
26 |
+
* @var mixed
|
27 |
+
*/
|
28 |
+
public static $states;
|
29 |
+
|
30 |
+
/**
|
31 |
+
* put your comment there...
|
32 |
+
*
|
33 |
+
* @param mixed $dbDriver
|
34 |
+
* @param bool Is to enable Build In Queue name Generator.
|
35 |
+
* @return CJTTemplatesTable
|
36 |
+
*/
|
37 |
+
public function __construct($dbDriver) {
|
38 |
+
parent::__construct($dbDriver, 'templates');
|
39 |
+
}
|
40 |
+
|
41 |
+
/**
|
42 |
+
* put your comment there...
|
43 |
+
*
|
44 |
+
*/
|
45 |
+
public function setQueueName() {
|
46 |
+
$type = $this->get('type');
|
47 |
+
// Santiize the template name!
|
48 |
+
$sanitizedName = strtolower(sanitize_file_name($this->get('name')));
|
49 |
+
// Prefix all user templates so it woule be unique when added
|
50 |
+
// to Wordpress queue!
|
51 |
+
$queueName = "cjt-{$type}-template-{$sanitizedName}";
|
52 |
+
$this->set('queueName', $queueName);
|
53 |
+
return $this;
|
54 |
+
}
|
55 |
+
|
56 |
+
} // End class.
|
57 |
+
|
58 |
+
// Initialize static's!
|
59 |
+
CJTTemplateTable::$states = array(
|
60 |
+
'draft' => cssJSToolbox::getText('draft'),
|
61 |
+
'published' => cssJSToolbox::getText('published'),
|
62 |
+
'trash' => cssJSToolbox::getText('trash'),
|
63 |
+
);
|
views/backups/manager/tmpl/default.html.tmpl
CHANGED
@@ -7,6 +7,11 @@
|
|
7 |
* No direct access.
|
8 |
*/
|
9 |
defined('ABSPATH') or die("Access denied");
|
|
|
|
|
|
|
|
|
|
|
10 |
?>
|
11 |
<html xmlns="http://www.w3.org/1999/xhtml">
|
12 |
<head>
|
7 |
* No direct access.
|
8 |
*/
|
9 |
defined('ABSPATH') or die("Access denied");
|
10 |
+
|
11 |
+
// Allow view to enqueue scripts and styles.
|
12 |
+
$this->enququeScripts();
|
13 |
+
$this->enququeStyles();
|
14 |
+
$this->suppressPrintScriptsHook();
|
15 |
?>
|
16 |
<html xmlns="http://www.w3.org/1999/xhtml">
|
17 |
<head>
|
views/backups/manager/view.php
CHANGED
@@ -38,19 +38,6 @@ class CJTBackupsManagerView extends CJTView {
|
|
38 |
*/
|
39 |
public $currentBackup = null;
|
40 |
|
41 |
-
/**
|
42 |
-
* Initialize view object.
|
43 |
-
*
|
44 |
-
* @see CJTView for more details
|
45 |
-
* @return void
|
46 |
-
*/
|
47 |
-
public function __construct($parameters) {
|
48 |
-
parent::__construct($parameters);
|
49 |
-
// Enqueue Styles & Scripts.
|
50 |
-
$this->enququeScripts();
|
51 |
-
$this->enququeStyles();
|
52 |
-
}
|
53 |
-
|
54 |
/**
|
55 |
* Output Add New Block markups.
|
56 |
*
|
38 |
*/
|
39 |
public $currentBackup = null;
|
40 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
41 |
/**
|
42 |
* Output Add New Block markups.
|
43 |
*
|
views/blocks/block/public/css/block.css
CHANGED
@@ -3,11 +3,26 @@
|
|
3 |
sometimes we need to use it instead of postbox class
|
4 |
like affecting only block box while running as Metabox inside edit post page!
|
5 |
*/
|
6 |
-
.cjt-block {min-width:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
7 |
|
8 |
#cjtoolbox-admin {font-size: 12px !important;}
|
9 |
#cjtoolbox-admin div.postbox {
|
10 |
-
display:none
|
11 |
-moz-border-radius: 6px;
|
12 |
-webkit-border-radius: 6px;
|
13 |
border-radius: 6px;
|
@@ -21,7 +36,7 @@
|
|
21 |
-webkit-border-top-right-radius: 6px;
|
22 |
border-top-left-radius: 6px;
|
23 |
border-top-right-radius: 6px;
|
24 |
-
border-bottom-color: #
|
25 |
font-size: 12px;
|
26 |
}
|
27 |
#cjtoolbox-admin #poststuff h3, .metabox-holder h3 {padding: 8px 10px;}
|
@@ -69,11 +84,10 @@
|
|
69 |
height: 23px;
|
70 |
}
|
71 |
.cjt-toolbox .icons-group .popup-menu.templates-lookup { /* Override default for Templates Lookup*/
|
72 |
-
|
73 |
-
border: 1px solid #bbb;
|
74 |
width: 346px;
|
75 |
height: 357px;
|
76 |
-
left:
|
77 |
top: 31px;
|
78 |
margin-top: 2px;
|
79 |
margin-left: 1px;
|
@@ -122,6 +136,24 @@
|
|
122 |
top: -2px;
|
123 |
background-position: center center;
|
124 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
125 |
|
126 |
.block-toolbox a.cjttbl-save.cjttbs-disabled {background: url(../images/toolbox/save-inactive.png); }
|
127 |
.block-toolbox a.cjttbl-revisions { background-image: url(../images/toolbox/revisions.png); }
|
@@ -131,6 +163,32 @@
|
|
131 |
.block-toolbox a.cjttbl-get-shortcode { background-image: url(../images/toolbox/shortcode.png); }
|
132 |
.block-toolbox a.cjttbl-edit-name { background-image: url(../images/toolbox/edit-name.png); }
|
133 |
.block-toolbox a.cjttbl-info { background-image: url(../images/toolbox/info.png); }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
134 |
|
135 |
/* Edit block name */
|
136 |
.edit-block-name {
|
@@ -140,6 +198,20 @@
|
|
140 |
display: none;
|
141 |
font-size: 15px;
|
142 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
143 |
.edit-block-name .icons-group {
|
144 |
display: inline-block;
|
145 |
margin-left: 0px;
|
@@ -154,7 +226,7 @@
|
|
154 |
top: -3px;
|
155 |
margin-left: -4px;
|
156 |
}
|
157 |
-
span.block-name {cursor: pointer; font-size: 15px;}
|
158 |
.edit-block-name .cancel { background-image: url(../images/edit-block-name/cancel.png); }
|
159 |
.edit-block-name .save { background-image: url(../images/edit-block-name/save.png); }
|
160 |
|
@@ -170,3 +242,57 @@ span.block-name {cursor: pointer; font-size: 15px;}
|
|
170 |
.cjbutton { width:116px; height:24px; float:left; }
|
171 |
.cjbutton a { height:24px; width:24px; text-indent:-999em; display:block; float:left; }
|
172 |
.cjexample { clear:left; float:left; padding:5px 0 0; }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
sometimes we need to use it instead of postbox class
|
4 |
like affecting only block box while running as Metabox inside edit post page!
|
5 |
*/
|
6 |
+
.cjt-block {min-width: 1000px;}
|
7 |
+
|
8 |
+
.waitingToLoad{display: none !important;}
|
9 |
+
|
10 |
+
.postbox.cjt-block a,
|
11 |
+
.postbox.cjt-block a:hover,
|
12 |
+
.postbox.cjt-block a:visited {text-decoration: none;}
|
13 |
+
|
14 |
+
.postbox.cjt-block a,
|
15 |
+
.postbox.cjt-block a:visited {color: #a0a0a0 !important;}
|
16 |
+
|
17 |
+
.postbox.cjt-block a.active {color: #a5581b !important;}
|
18 |
+
|
19 |
+
.postbox.cjt-block a:hover {color: #c8671b !important;}
|
20 |
+
|
21 |
+
.inside {color: #7c7c7c;}
|
22 |
|
23 |
#cjtoolbox-admin {font-size: 12px !important;}
|
24 |
#cjtoolbox-admin div.postbox {
|
25 |
+
display:none;
|
26 |
-moz-border-radius: 6px;
|
27 |
-webkit-border-radius: 6px;
|
28 |
border-radius: 6px;
|
36 |
-webkit-border-top-right-radius: 6px;
|
37 |
border-top-left-radius: 6px;
|
38 |
border-top-right-radius: 6px;
|
39 |
+
border-bottom-color: #bbb;
|
40 |
font-size: 12px;
|
41 |
}
|
42 |
#cjtoolbox-admin #poststuff h3, .metabox-holder h3 {padding: 8px 10px;}
|
84 |
height: 23px;
|
85 |
}
|
86 |
.cjt-toolbox .icons-group .popup-menu.templates-lookup { /* Override default for Templates Lookup*/
|
87 |
+
border: 1px solid #ccc;
|
|
|
88 |
width: 346px;
|
89 |
height: 357px;
|
90 |
+
left: 154px;
|
91 |
top: 31px;
|
92 |
margin-top: 2px;
|
93 |
margin-left: 1px;
|
136 |
top: -2px;
|
137 |
background-position: center center;
|
138 |
}
|
139 |
+
.popup-menu.editor-themes-list {
|
140 |
+
left: 10px !important;
|
141 |
+
background-color: transparent !important;
|
142 |
+
border: none !important;
|
143 |
+
display: block;
|
144 |
+
width: 196px;
|
145 |
+
height: 220px;
|
146 |
+
overflow: auto;
|
147 |
+
padding: 20px !important;
|
148 |
+
margin-left: -202px;
|
149 |
+
margin-top: -25px !important;
|
150 |
+
}
|
151 |
+
.popup-menu.editor-themes-list ul {margin: 0px; overflow: auto; height: 182px; border: 1px solid #bbb; padding: 13px;}
|
152 |
+
.popup-menu.editor-themes-list a {
|
153 |
+
padding-top: 0px !important;
|
154 |
+
margin: 0px !important;
|
155 |
+
}
|
156 |
+
.popup-menu.editor-themes-list a.selected {color: #0074a2 !important;}
|
157 |
|
158 |
.block-toolbox a.cjttbl-save.cjttbs-disabled {background: url(../images/toolbox/save-inactive.png); }
|
159 |
.block-toolbox a.cjttbl-revisions { background-image: url(../images/toolbox/revisions.png); }
|
163 |
.block-toolbox a.cjttbl-get-shortcode { background-image: url(../images/toolbox/shortcode.png); }
|
164 |
.block-toolbox a.cjttbl-edit-name { background-image: url(../images/toolbox/edit-name.png); }
|
165 |
.block-toolbox a.cjttbl-info { background-image: url(../images/toolbox/info.png); }
|
166 |
+
.block-toolbox a.cjttbl-templates-lookup { background-image: url(../images/toolbox/templates-lookup.png); }
|
167 |
+
.block-toolbox a.cjttbl-link-external { background-image: url(../images/toolbox/link-external.png); }
|
168 |
+
|
169 |
+
/** Editor Toolbox */
|
170 |
+
.cjt-toolbox.editor-toolbox {
|
171 |
+
position: relative;
|
172 |
+
float: right;
|
173 |
+
width: 40px;
|
174 |
+
height: 350px;
|
175 |
+
top: 5px;
|
176 |
+
margin-left: 10px;
|
177 |
+
}
|
178 |
+
.cjt-toolbox.editor-toolbox .icons-group a.cjt-tb-link {margin: 6px 0 0 6px;}
|
179 |
+
.cjt-toolbox.editor-toolbox a.cjttbl-fullscreen {background-image: url(../images/editor-toolbox/maximise-editor.png);}
|
180 |
+
.cjt-toolbox.editor-toolbox a.cjttbl-fullscreen.maximized {background-image: url(../images/editor-toolbox/minimise-editor.png);}
|
181 |
+
.cjt-toolbox.editor-toolbox a.cjttbl-font-large {background-image: url(../images/editor-toolbox/font-large.png);}
|
182 |
+
.cjt-toolbox.editor-toolbox a.cjttbl-font-small {background-image: url(../images/editor-toolbox/font-small.png);}
|
183 |
+
.cjt-toolbox.editor-toolbox a.cjttbl-reset-font {background-image: url(../images/editor-toolbox/font-reset.png);}
|
184 |
+
.cjt-toolbox.editor-toolbox a.cjttbl-clear-block {background-image: url(../images/editor-toolbox/clear-block.png);}
|
185 |
+
.cjt-toolbox.editor-toolbox a.cjttbl-editor-theme {background-image: url(../images/editor-toolbox/theme.png);}
|
186 |
+
|
187 |
+
.loading-block{
|
188 |
+
font-weight: bold;
|
189 |
+
font-size: 13px;
|
190 |
+
color: brown;
|
191 |
+
}
|
192 |
|
193 |
/* Edit block name */
|
194 |
.edit-block-name {
|
198 |
display: none;
|
199 |
font-size: 15px;
|
200 |
}
|
201 |
+
.hndle .file {
|
202 |
+
font-size: 15px;
|
203 |
+
position: absolute;
|
204 |
+
top: 8px;
|
205 |
+
margin-left: 18px;
|
206 |
+
cursor: pointer;
|
207 |
+
}
|
208 |
+
.hndle .name-file-separator {
|
209 |
+
font-size: 19px;
|
210 |
+
position: absolute;
|
211 |
+
top: 6px;
|
212 |
+
margin-left: 5px;
|
213 |
+
cursor: pointer;
|
214 |
+
}
|
215 |
.edit-block-name .icons-group {
|
216 |
display: inline-block;
|
217 |
margin-left: 0px;
|
226 |
top: -3px;
|
227 |
margin-left: -4px;
|
228 |
}
|
229 |
+
span.block-name {cursor: pointer; font-size: 15px;font-weight: normal;}
|
230 |
.edit-block-name .cancel { background-image: url(../images/edit-block-name/cancel.png); }
|
231 |
.edit-block-name .save { background-image: url(../images/edit-block-name/save.png); }
|
232 |
|
242 |
.cjbutton { width:116px; height:24px; float:left; }
|
243 |
.cjbutton a { height:24px; width:24px; text-indent:-999em; display:block; float:left; }
|
244 |
.cjexample { clear:left; float:left; padding:5px 0 0; }
|
245 |
+
|
246 |
+
/** Editor Full Screen mode */
|
247 |
+
body.fullscreen {overflow: hidden;} /** No scroll-bars */
|
248 |
+
body.fullscreen #wpadminbar {display: none;} /** No admin menu */
|
249 |
+
.postbox.fullscreen {
|
250 |
+
position: fixed;
|
251 |
+
z-index: 10000;
|
252 |
+
top: 0px;
|
253 |
+
left: 0px;
|
254 |
+
width: 100%;
|
255 |
+
height: 100%;
|
256 |
+
}
|
257 |
+
.postbox.fullscreen .inside {padding: 0 !important;margin: 0 !important;}
|
258 |
+
.postbox.fullscreen .inside,
|
259 |
+
.postbox.fullscreen .cjcontainer,
|
260 |
+
.postbox.fullscreen .cjcontainer .cjcodeblock,
|
261 |
+
.postbox.fullscreen .cjcontainer .datablock,
|
262 |
+
.postbox.fullscreen .cjcontainer .code-editor {height: 100%;}
|
263 |
+
.postbox.fullscreen .cjcontainer .datablock {padding-top: 0;}
|
264 |
+
.postbox.fullscreen .cjcontainer .cjcodeblock {margin-right:328px;}
|
265 |
+
/* Lookup form */
|
266 |
+
.postbox.fullscreen .cjt-toolbox .icons-group .popup-menu.templates-lookup ,
|
267 |
+
.popup-menu {z-index: 32 !important;}
|
268 |
+
|
269 |
+
.ace_status-indicator {
|
270 |
+
position: relative;
|
271 |
+
left: 2px;
|
272 |
+
top: 5px;
|
273 |
+
/* z-index: 168; */
|
274 |
+
}
|
275 |
+
|
276 |
+
#cjt-inline-popup {display: none;}
|
277 |
+
|
278 |
+
#cjtoolbox > div.inside > div.cjcontainer > div > div.ace-statusbar {
|
279 |
+
float: right;
|
280 |
+
position: absolute;
|
281 |
+
top: -10px;
|
282 |
+
margin-left: 7px;
|
283 |
+
font-weight: bold;
|
284 |
+
font-size: 14px;
|
285 |
+
}
|
286 |
+
|
287 |
+
.ace_closeButton {
|
288 |
+
top: 35px;
|
289 |
+
left: 6px;
|
290 |
+
width: 62px;
|
291 |
+
height: 62px;
|
292 |
+
}
|
293 |
+
|
294 |
+
div[contains=setMode],
|
295 |
+
div[contains=setOptions],
|
296 |
+
div[contains=setMode],
|
297 |
+
div[contains=setTheme]
|
298 |
+
{display: none}
|
views/blocks/block/public/css/codefile.css
ADDED
@@ -0,0 +1,95 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
#code-files-manager {
|
2 |
+
cursor: default;
|
3 |
+
display: none;
|
4 |
+
position: absolute;
|
5 |
+
margin-left: 38px;
|
6 |
+
margin-top: 8px;
|
7 |
+
width: 400px;
|
8 |
+
z-index: 5;
|
9 |
+
border: 1px solid #bbb;
|
10 |
+
overflow: auto;
|
11 |
+
max-height: 348px;
|
12 |
+
padding-bottom: 3px;
|
13 |
+
}
|
14 |
+
#code-files-manager > li.code-file-item {padding: 9px 9px 0px;}
|
15 |
+
#code-files-manager > li.code-file-item a {font-size: 15px;text-decoration: none;cursor: pointer;}
|
16 |
+
#code-files-manager > li.code-file-item a.active {font-weight: bold; cursor: default;}
|
17 |
+
#code-files-manager > li.code-file-item a:hover.active {color: #a5581b !important;}
|
18 |
+
|
19 |
+
#code-files-manager > li.quick-toolbar {
|
20 |
+
position:absolute;
|
21 |
+
background:transparent;
|
22 |
+
margin-top: -25px;
|
23 |
+
margin-left: 121px;
|
24 |
+
margin-top: -19px;
|
25 |
+
right: 24px;
|
26 |
+
display:none;
|
27 |
+
}
|
28 |
+
|
29 |
+
#code-files-manager > li.dialog-tool-buttons {
|
30 |
+
position: absolute;
|
31 |
+
width: 89px;
|
32 |
+
height: 19px;
|
33 |
+
right: 0px;
|
34 |
+
top: 13px;
|
35 |
+
}
|
36 |
+
#code-files-manager > li.quick-toolbar > input {
|
37 |
+
background-color: transparent;
|
38 |
+
}
|
39 |
+
#code-files-manager > li.quick-toolbar > a {
|
40 |
+
margin-top: -1px;
|
41 |
+
position: relative;
|
42 |
+
top: -1px;
|
43 |
+
}
|
44 |
+
{
|
45 |
+
/* margin-left: 2px; */
|
46 |
+
}
|
47 |
+
|
48 |
+
input.show-selection {
|
49 |
+
margin-top: -6px;
|
50 |
+
}
|
51 |
+
|
52 |
+
#code-files-manager > li.edit-code-file fieldset > ul > li textarea {
|
53 |
+
margin: 2px;
|
54 |
+
width: 234px;
|
55 |
+
height: 53px;
|
56 |
+
margin-left: -1px;
|
57 |
+
}
|
58 |
+
|
59 |
+
#code-files-manager > li.edit-code-file {
|
60 |
+
position: relative;
|
61 |
+
padding: 5px;
|
62 |
+
display: none;
|
63 |
+
}
|
64 |
+
|
65 |
+
#code-files-manager > li.edit-code-file fieldset {
|
66 |
+
padding: 5px;
|
67 |
+
border: 1px solid #bbb;
|
68 |
+
}
|
69 |
+
|
70 |
+
#code-files-manager > li.edit-code-file fieldset input,
|
71 |
+
#code-files-manager > li.edit-code-file fieldset select,
|
72 |
+
#code-files-manager > li.edit-code-file fieldset textarea {
|
73 |
+
background-color: transparent;
|
74 |
+
color: #a0a0a0;
|
75 |
+
}
|
76 |
+
|
77 |
+
#code-files-manager > li.edit-code-file fieldset select {margin-left: -2px}
|
78 |
+
|
79 |
+
#code-files-manager > li.edit-code-file fieldset > ul > li > label {
|
80 |
+
width: 110px;
|
81 |
+
display: inline-block;
|
82 |
+
vertical-align: top;
|
83 |
+
}
|
84 |
+
|
85 |
+
#code-files-manager > li.overlay {
|
86 |
+
position: absolute; width: 100%;
|
87 |
+
background-color: transparent;
|
88 |
+
height: 97%;
|
89 |
+
top: 0;
|
90 |
+
display: none;
|
91 |
+
}
|
92 |
+
|
93 |
+
li.code-file-item.create-file-row {padding-bottom: 3px;}
|
94 |
+
#code-files-manager > li.codeFile {padding-top: 0px;margin-bottom: 1px;}
|
95 |
+
li.code-file-item.create-file-row > a {font-size: 16px !important;}
|
views/blocks/block/public/css/menu.css
ADDED
@@ -0,0 +1,61 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
#block-menu {
|
2 |
+
display: none;
|
3 |
+
position: absolute;
|
4 |
+
top: 2px;
|
5 |
+
left: 358px;
|
6 |
+
padding: 10px;
|
7 |
+
margin: 0px 0 0 0;
|
8 |
+
z-index: 10;
|
9 |
+
border: none;
|
10 |
+
background-color: transparent;
|
11 |
+
}
|
12 |
+
|
13 |
+
#block-menu>li {
|
14 |
+
display: inline-block;
|
15 |
+
margin: 0px;
|
16 |
+
float: none;
|
17 |
+
clear: none;
|
18 |
+
width: initial;
|
19 |
+
}
|
20 |
+
#block-menu>li li {
|
21 |
+
margin: 4px 0px 3px 0px;
|
22 |
+
float: none;
|
23 |
+
}
|
24 |
+
|
25 |
+
#block-menu a {
|
26 |
+
padding: 0px 7px 0px 5px !important;
|
27 |
+
font-size: 13px;
|
28 |
+
text-decoration: none;
|
29 |
+
font-family: sans-serif;
|
30 |
+
display: inline-block;
|
31 |
+
border: none;
|
32 |
+
background-color: transparent !important;
|
33 |
+
line-height: 0;
|
34 |
+
}
|
35 |
+
#block-menu li ul {
|
36 |
+
position: absolute !important;
|
37 |
+
width: 206px;
|
38 |
+
margin-bottom: 0px;
|
39 |
+
border: 1px solid #bbb;
|
40 |
+
margin-top: 12px;
|
41 |
+
padding: 2px 0px 6px 0px;
|
42 |
+
}
|
43 |
+
|
44 |
+
.ui-menu-divider {
|
45 |
+
/* background-color: #bbb !important; */
|
46 |
+
height: 1px;
|
47 |
+
width: 70px;
|
48 |
+
margin: 7px 0px 0px 5px !important;
|
49 |
+
border: none;
|
50 |
+
}
|
51 |
+
|
52 |
+
#block-menu>li a span {
|
53 |
+
width: initial;
|
54 |
+
height: initial;
|
55 |
+
background-image: none;
|
56 |
+
}
|
57 |
+
|
58 |
+
#block-menu a:hover {
|
59 |
+
background-image: none;
|
60 |
+
background-color: transparent !important;
|
61 |
+
}
|
views/blocks/{manager/public/images/review.png → block/public/images/editor-toolbox/clear-block.png}
RENAMED
Binary file
|
views/blocks/block/public/images/editor-toolbox/font-large.png
ADDED
Binary file
|
views/blocks/block/public/images/editor-toolbox/font-reset.png
ADDED
Binary file
|
views/blocks/block/public/images/editor-toolbox/font-small.png
ADDED
Binary file
|
views/blocks/block/public/images/editor-toolbox/maximise-editor.png
ADDED
Binary file
|
views/blocks/block/public/images/editor-toolbox/minimise-editor.png
ADDED
Binary file
|
views/blocks/block/public/images/editor-toolbox/theme.png
ADDED
Binary file
|
views/blocks/block/public/images/toolbox/link-external.png
ADDED
Binary file
|
views/blocks/block/public/images/toolbox/templates-lookup.png
ADDED
Binary file
|
views/blocks/block/public/js/block/block.js
CHANGED
@@ -71,36 +71,12 @@ var CJTBlockBase;
|
|
71 |
* @var object
|
72 |
*/
|
73 |
this.properties = {};
|
74 |
-
|
75 |
/**
|
76 |
-
* put your comment there...
|
77 |
*
|
78 |
-
* @param element
|
79 |
*/
|
80 |
-
this.
|
81 |
-
//
|
82 |
-
this.blockPlugin = blockPlugin;
|
83 |
-
this.box = $(element);
|
84 |
-
this.id = parseInt(this.box.find('input:hidden[name="blocks[]"]').val())
|
85 |
-
this.properties = {};
|
86 |
-
this.aceEditor = ace.edit('editor-' + this.id);
|
87 |
-
// Define base properties.
|
88 |
-
properties.name = {om : new CJTBlockPropertyHTMLNodeOM(),
|
89 |
-
flags: 'rw',
|
90 |
-
selector : 'input:hidden[name="cjtoolbox[{blockId}][name]"]'};
|
91 |
-
properties.location = {om : new CJTBlockPropertyHTMLNodeOM(),
|
92 |
-
flags: 'rw',
|
93 |
-
selector : 'input:hidden[name="cjtoolbox[{blockId}][location]"]'};
|
94 |
-
properties.state = {om : new CJTBlockPropertyHTMLNodeOM(),
|
95 |
-
flags: 'rw',
|
96 |
-
selector : 'input:hidden[name="cjtoolbox[{blockId}][state]"]'};
|
97 |
-
properties.code = {om : new CJTBlockPropertyACEEditor(),
|
98 |
-
flags: 'rws',
|
99 |
-
selector : 'div#editor-{blockId}'};
|
100 |
-
properties.editorLang = {flags: 'rwc'};
|
101 |
-
properties.pagesPanelToggleState = {flags: 'rwc'};
|
102 |
-
properties.editorTheme = {flags: 'rwc'};
|
103 |
-
// Initialize ALL (BASE, DERIVDED) properties.
|
104 |
$.each(properties, $.proxy(
|
105 |
function(name, propertyDefinition) {
|
106 |
// Add flag checker method to property object.
|
@@ -122,13 +98,25 @@ var CJTBlockBase;
|
|
122 |
this.properties[name] = propertyDefinition;
|
123 |
}, this)
|
124 |
);
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
-
|
131 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
132 |
}
|
133 |
|
134 |
/**
|
@@ -220,6 +208,37 @@ var CJTBlockBase;
|
|
220 |
return queue;
|
221 |
}
|
222 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
223 |
/**
|
224 |
* @internal
|
225 |
*
|
71 |
* @var object
|
72 |
*/
|
73 |
this.properties = {};
|
74 |
+
|
75 |
/**
|
|
|
76 |
*
|
|
|
77 |
*/
|
78 |
+
this.addProperties = function(properties) {
|
79 |
+
// Prepare properties, add them to model list.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
80 |
$.each(properties, $.proxy(
|
81 |
function(name, propertyDefinition) {
|
82 |
// Add flag checker method to property object.
|
98 |
this.properties[name] = propertyDefinition;
|
99 |
}, this)
|
100 |
);
|
101 |
+
};
|
102 |
+
|
103 |
+
/**
|
104 |
+
* put your comment there...
|
105 |
+
*
|
106 |
+
* @param element
|
107 |
+
*/
|
108 |
+
this.CJTBlockBase = function(blockPlugin, element, properties) {
|
109 |
+
// Initialize.
|
110 |
+
this.blockPlugin = blockPlugin;
|
111 |
+
this.box = $(element);
|
112 |
+
this.id = parseInt(this.box.find('input:hidden[name="blocks[]"]').val())
|
113 |
+
this.properties = {};
|
114 |
+
// Define base properties.
|
115 |
+
properties.name = {om : new CJTBlockPropertyHTMLNodeOM(), flags: 'rw', selector : 'input:hidden[name="cjtoolbox[{blockId}][name]"]'};
|
116 |
+
properties.location = {om : new CJTBlockPropertyHTMLNodeOM(), flags: 'rw', selector : 'input:hidden[name="cjtoolbox[{blockId}][location]"]'};
|
117 |
+
properties.state = {om : new CJTBlockPropertyHTMLNodeOM(), flags: 'rw', selector : 'input:hidden[name="cjtoolbox[{blockId}][state]"]'};
|
118 |
+
// Initialize ALL (BASE, DERIVDED) properties.
|
119 |
+
this.addProperties(properties);
|
120 |
}
|
121 |
|
122 |
/**
|
208 |
return queue;
|
209 |
}
|
210 |
|
211 |
+
/**
|
212 |
+
*
|
213 |
+
*/
|
214 |
+
this.loadBase = function(properties) {
|
215 |
+
// Enable ACE Editor.
|
216 |
+
this.aceEditor = ace.edit('editor-' + this.id);
|
217 |
+
// Add ACE Editor Propety definition.
|
218 |
+
properties.code = {om : new CJTBlockPropertyACEEditor(), flags: 'rws', selector : 'div#editor-{blockId}'};
|
219 |
+
properties.editorLang = {flags: 'rwc'};
|
220 |
+
properties.editorTheme = {flags: 'rwc'};
|
221 |
+
properties.aceEditorMenuSettings = {flags: 'rwc'};
|
222 |
+
// Initialize ALL (BASE, DERIVDED) properties.
|
223 |
+
this.addProperties(properties);
|
224 |
+
// Create bridge through "code" field
|
225 |
+
// so that div element can set/get aceEditor real object.
|
226 |
+
var codeDiv = $(this.property('code').selector).get(0);
|
227 |
+
codeDiv.getValue = function() {
|
228 |
+
return this.aceEditor.getSession().getValue();
|
229 |
+
};
|
230 |
+
// Define aceEditor extension method for setting Editor Text with the possibility
|
231 |
+
// of UNDO.
|
232 |
+
this.aceEditor.setValuePossibleUndo = function(value) {
|
233 |
+
// Directly clear using setValue('') prevent 'undo' action!
|
234 |
+
// Select all text.
|
235 |
+
this.selectAll();
|
236 |
+
// Replace content with empty string!
|
237 |
+
this.getSession().replace(this.getSelectionRange(), value);
|
238 |
+
this.focus();
|
239 |
+
};
|
240 |
+
};
|
241 |
+
|
242 |
/**
|
243 |
* @internal
|
244 |
*
|
views/blocks/block/public/js/blockproperty/blockproperty.js
CHANGED
@@ -35,7 +35,7 @@ var CJTBlockPropertyACEEditor;
|
|
35 |
// Bind to property object.
|
36 |
block = blk;
|
37 |
property = prprty;
|
38 |
-
}
|
39 |
|
40 |
/**
|
41 |
*
|
@@ -55,7 +55,7 @@ var CJTBlockPropertyACEEditor;
|
|
55 |
*/
|
56 |
this.getValueCache = function() {
|
57 |
return this.get();
|
58 |
-
}
|
59 |
|
60 |
/**
|
61 |
*
|
@@ -66,7 +66,15 @@ var CJTBlockPropertyACEEditor;
|
|
66 |
// Get the value.
|
67 |
var element = mdlBlock.box.find(property.selector);
|
68 |
element.val(value);
|
69 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
70 |
|
71 |
}
|
72 |
|
@@ -96,28 +104,28 @@ var CJTBlockPropertyACEEditor;
|
|
96 |
// Bind to property object.
|
97 |
block = blk;
|
98 |
property = prprty;
|
99 |
-
}
|
100 |
|
101 |
/**
|
102 |
*
|
103 |
*/
|
104 |
this.get = function() {
|
105 |
return block.block.aceEditor.getSession().getValue();
|
106 |
-
}
|
107 |
-
|
108 |
/**
|
109 |
*
|
110 |
*/
|
111 |
this.getValueCache = function() {
|
112 |
return this.get();
|
113 |
-
}
|
114 |
|
115 |
/**
|
116 |
*
|
117 |
*/
|
118 |
this.setValue = function(value) {
|
119 |
block.block.aceEditor.getSession().setValue(value);
|
120 |
-
}
|
121 |
|
122 |
}
|
123 |
|
35 |
// Bind to property object.
|
36 |
block = blk;
|
37 |
property = prprty;
|
38 |
+
};
|
39 |
|
40 |
/**
|
41 |
*
|
55 |
*/
|
56 |
this.getValueCache = function() {
|
57 |
return this.get();
|
58 |
+
};
|
59 |
|
60 |
/**
|
61 |
*
|
66 |
// Get the value.
|
67 |
var element = mdlBlock.box.find(property.selector);
|
68 |
element.val(value);
|
69 |
+
};
|
70 |
+
|
71 |
+
/**
|
72 |
+
*
|
73 |
+
*/
|
74 |
+
this.reset = function() {
|
75 |
+
var element = block.block.box.find(property.selector)[0];
|
76 |
+
return element.cjtBlockSyncValue;
|
77 |
+
};
|
78 |
|
79 |
}
|
80 |
|
104 |
// Bind to property object.
|
105 |
block = blk;
|
106 |
property = prprty;
|
107 |
+
};
|
108 |
|
109 |
/**
|
110 |
*
|
111 |
*/
|
112 |
this.get = function() {
|
113 |
return block.block.aceEditor.getSession().getValue();
|
114 |
+
};
|
115 |
+
|
116 |
/**
|
117 |
*
|
118 |
*/
|
119 |
this.getValueCache = function() {
|
120 |
return this.get();
|
121 |
+
};
|
122 |
|
123 |
/**
|
124 |
*
|
125 |
*/
|
126 |
this.setValue = function(value) {
|
127 |
block.block.aceEditor.getSession().setValue(value);
|
128 |
+
};
|
129 |
|
130 |
}
|
131 |
|
views/blocks/block/public/js/codefile-manager/codefile-manager.js
ADDED
@@ -0,0 +1,494 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
*
|
3 |
+
*
|
4 |
+
*
|
5 |
+
*/
|
6 |
+
|
7 |
+
(function($) {
|
8 |
+
|
9 |
+
/**
|
10 |
+
*
|
11 |
+
*
|
12 |
+
*
|
13 |
+
*/
|
14 |
+
CJTBlockCodeFileView = new function() {
|
15 |
+
|
16 |
+
/**
|
17 |
+
*
|
18 |
+
*/
|
19 |
+
this.block;
|
20 |
+
|
21 |
+
/**
|
22 |
+
*
|
23 |
+
*/
|
24 |
+
this.filesManager;
|
25 |
+
|
26 |
+
/**
|
27 |
+
*
|
28 |
+
*/
|
29 |
+
this.quickToolbar;
|
30 |
+
|
31 |
+
/**
|
32 |
+
*
|
33 |
+
*/
|
34 |
+
var _changequicktoolbarstate = function(event) {
|
35 |
+
switch (event.type) {
|
36 |
+
case 'mouseenter':
|
37 |
+
// Initialize.
|
38 |
+
var liElement = $(event.currentTarget);
|
39 |
+
var toolbarNode = this.quickToolbar.get(0);
|
40 |
+
// Associate with Li.
|
41 |
+
toolbarNode.codeFileLi = liElement;
|
42 |
+
var toolbarNode = this.quickToolbar.get(0);
|
43 |
+
// Don' allow active/master selection.
|
44 |
+
var link = liElement.find('a');
|
45 |
+
toolbarNode.selectCheckbox.prop('disabled', ((link.data('codeFile').id == 1) || link.hasClass('active')));
|
46 |
+
// Get Select-Checkbox check state.
|
47 |
+
toolbarNode.selectCheckbox.prop('checked', liElement.data('checkbox-selected') ? true : false);
|
48 |
+
// Add directly after the current li.
|
49 |
+
liElement.after(this.quickToolbar);
|
50 |
+
// Show over the current li element.
|
51 |
+
this.quickToolbar.show();
|
52 |
+
break;
|
53 |
+
case 'mouseleave':
|
54 |
+
// Hide when mouse leaved.
|
55 |
+
this.quickToolbar.hide();
|
56 |
+
break;
|
57 |
+
}
|
58 |
+
};
|
59 |
+
|
60 |
+
/**
|
61 |
+
*
|
62 |
+
*
|
63 |
+
*/
|
64 |
+
var _onswitchfile = function(event) {
|
65 |
+
// Initialize.
|
66 |
+
var link = $(event.target);
|
67 |
+
var codeFile = link.data('codeFile');
|
68 |
+
// Disable Form.
|
69 |
+
var overlay = this.filesManager.find('.overlay').show();
|
70 |
+
// Switch.
|
71 |
+
this.block.codeFile.switchFile(codeFile).done($.proxy(
|
72 |
+
function(blockId, codeFileId) {
|
73 |
+
// Process only if it still the current active block
|
74 |
+
// otehrwise discard.
|
75 |
+
if (blockId == this.block.block.get('id')) {
|
76 |
+
// Switch editor language.
|
77 |
+
this.block._onswitcheditorlang(undefined, {
|
78 |
+
lang : codeFile.type ?
|
79 |
+
codeFile.type :
|
80 |
+
this.block.block.get('editorLang', 'css')
|
81 |
+
});
|
82 |
+
// Close.
|
83 |
+
this.deattach();
|
84 |
+
// Activate new switched code file.
|
85 |
+
//===this.filesManager.find('li.codeFile a').removeClass('active');
|
86 |
+
//===link.addClass('active');
|
87 |
+
// Enable Form
|
88 |
+
overlay.hide();
|
89 |
+
}
|
90 |
+
}, this)
|
91 |
+
);
|
92 |
+
};
|
93 |
+
|
94 |
+
/**
|
95 |
+
*
|
96 |
+
*
|
97 |
+
*/
|
98 |
+
var dialogToolButtons = function() {
|
99 |
+
// Initialize Tool Buttons.
|
100 |
+
this.dialogToolButtons = this.filesManager.find('.dialog-tool-buttons');
|
101 |
+
// Close Dialog
|
102 |
+
this.dialogToolButtons.find('.close').click($.proxy(
|
103 |
+
function() {
|
104 |
+
// Deattach from current block, free resources.
|
105 |
+
this.deattach();
|
106 |
+
// Inactive
|
107 |
+
return false;
|
108 |
+
}, this )
|
109 |
+
);
|
110 |
+
// Delete Seletced Files.
|
111 |
+
this.dialogToolButtons.find('.delete').click($.proxy(
|
112 |
+
function() {
|
113 |
+
// Get all selected codeFiles ids.
|
114 |
+
var ids = [];
|
115 |
+
var checkboxes = this.filesManager.find('.code-file-item input[type="checkbox"]');
|
116 |
+
// My select at least one code file.
|
117 |
+
if (!checkboxes.length) {
|
118 |
+
alert(CJTCodefileManagerI18N.noSelection);
|
119 |
+
}
|
120 |
+
else {
|
121 |
+
// Confirm Delete
|
122 |
+
if (confirm(CJTCodefileManagerI18N.confirmDelete.replace('{count}', checkboxes.length))) {
|
123 |
+
checkboxes.each($.proxy(
|
124 |
+
function(index, checkbox) {
|
125 |
+
ids.push(checkbox.value);
|
126 |
+
}, this)
|
127 |
+
);
|
128 |
+
// Disable Form.
|
129 |
+
var overlay = this.filesManager.find('.overlay').show();
|
130 |
+
// Once collected process deletion.
|
131 |
+
this.block.codeFile.deleteCodeFile(ids).done($.proxy(
|
132 |
+
function(response) {
|
133 |
+
// Delete those codeFiles from Files Manager.
|
134 |
+
checkboxes.parent().remove();
|
135 |
+
// Enable Form.
|
136 |
+
overlay.hide();
|
137 |
+
}, this)
|
138 |
+
);
|
139 |
+
}
|
140 |
+
}
|
141 |
+
// Inactive
|
142 |
+
return false;
|
143 |
+
}, this )
|
144 |
+
);
|
145 |
+
// Create File.
|
146 |
+
this.filesManager.find('.create-file').click($.proxy(
|
147 |
+
function(event) {
|
148 |
+
// New Code file default data.
|
149 |
+
var newCodeFile = {name : '', type : '', tag : '', description : '', id : 0};
|
150 |
+
// Display form.
|
151 |
+
this.editCodeFileDialog.display($(event.target).parent(), newCodeFile).done($.proxy(
|
152 |
+
function(rCodeFile) {
|
153 |
+
// Add newly added code file.
|
154 |
+
this.listCodeFile(rCodeFile);;
|
155 |
+
// Close the form.
|
156 |
+
this.editCodeFileDialog.close();
|
157 |
+
}, this)
|
158 |
+
);
|
159 |
+
return false;
|
160 |
+
}, this )
|
161 |
+
);
|
162 |
+
};
|
163 |
+
|
164 |
+
/**
|
165 |
+
*
|
166 |
+
*
|
167 |
+
*/
|
168 |
+
var editCodeFile = function() {
|
169 |
+
// Edit Code File Dial object/
|
170 |
+
this.editCodeFileDialog = new (function(codeFilesView) {
|
171 |
+
|
172 |
+
/**
|
173 |
+
*
|
174 |
+
*
|
175 |
+
*/
|
176 |
+
var jDialog = codeFilesView.filesManager.find('.edit-code-file');
|
177 |
+
|
178 |
+
/**
|
179 |
+
*
|
180 |
+
*
|
181 |
+
*/
|
182 |
+
var jOverlay = codeFilesView.filesManager.find('.overlay');
|
183 |
+
|
184 |
+
/**
|
185 |
+
*
|
186 |
+
*
|
187 |
+
*/
|
188 |
+
var promise;
|
189 |
+
|
190 |
+
/**
|
191 |
+
*
|
192 |
+
*
|
193 |
+
*/
|
194 |
+
var _oncancel = function() {
|
195 |
+
// Destroy dialog.
|
196 |
+
this.close();
|
197 |
+
};
|
198 |
+
|
199 |
+
/**
|
200 |
+
*
|
201 |
+
*
|
202 |
+
*/
|
203 |
+
var _onsave = function() {
|
204 |
+
// Initialize vars.
|
205 |
+
var fields = ['name', 'description', 'tag', 'type', 'id'];
|
206 |
+
var data = {};
|
207 |
+
// Collect data.
|
208 |
+
$.each(fields, $.proxy(
|
209 |
+
function(index, fieldName) {
|
210 |
+
data[fieldName] = jDialog.find('#code-file-' + fieldName).val();
|
211 |
+
}, this)
|
212 |
+
);
|
213 |
+
// Validate.
|
214 |
+
// Name must be specified.
|
215 |
+
if (!data.name) {
|
216 |
+
alert(CJTCodefileManagerI18N.nameIsNull);
|
217 |
+
}
|
218 |
+
else {
|
219 |
+
// Initialize as available.
|
220 |
+
var isNameExists = false;
|
221 |
+
// Name must be unique!
|
222 |
+
codeFilesView.filesManager.find('.codeFile a').each($.proxy(
|
223 |
+
function(index, link) {
|
224 |
+
// Get CodeFile structure associated with the link.
|
225 |
+
var codeFile = $(link).data('codeFile');
|
226 |
+
// Check the name exists. DONT CHECK WITH SELF!
|
227 |
+
if ((codeFile.id != data.id) && (codeFile.name == data.name)) {
|
228 |
+
// Mark as not available.
|
229 |
+
isNameExists = true;
|
230 |
+
// Exists loop.
|
231 |
+
return false;
|
232 |
+
}
|
233 |
+
}, this));
|
234 |
+
if (isNameExists) {
|
235 |
+
alert(CJTCodefileManagerI18N.nameAlreadyExists);
|
236 |
+
}
|
237 |
+
else { // Success
|
238 |
+
codeFilesView.block.codeFile.save(data).done($.proxy(
|
239 |
+
function(response) {
|
240 |
+
// Response to caller (create/edit)
|
241 |
+
promise.resolve(response);
|
242 |
+
}, this)
|
243 |
+
);
|
244 |
+
}
|
245 |
+
}
|
246 |
+
};
|
247 |
+
|
248 |
+
/**
|
249 |
+
* Display
|
250 |
+
*
|
251 |
+
*/
|
252 |
+
this.close = function() {
|
253 |
+
// Hide the form.
|
254 |
+
jDialog.hide();
|
255 |
+
// Hide Overlay.
|
256 |
+
jOverlay.hide();
|
257 |
+
};
|
258 |
+
|
259 |
+
/**
|
260 |
+
* Display
|
261 |
+
*
|
262 |
+
*/
|
263 |
+
this.display = function(li, formData) {
|
264 |
+
// Fill the form.
|
265 |
+
$.each(formData, $.proxy(
|
266 |
+
function(name, value) {
|
267 |
+
// Find element corresponding to the field.
|
268 |
+
jDialog.find('#code-file-' + name).val(value);
|
269 |
+
}, this)
|
270 |
+
);
|
271 |
+
// Add after current LI.
|
272 |
+
li.after(jDialog)
|
273 |
+
// Add the overlay immediately before the form.
|
274 |
+
.after(jOverlay);
|
275 |
+
// Display dialog and overlay.
|
276 |
+
jOverlay.show();
|
277 |
+
jDialog.show();
|
278 |
+
// Return a promise object to be used when form
|
279 |
+
//is being saved.
|
280 |
+
promise = $.Deferred();
|
281 |
+
return promise;
|
282 |
+
};
|
283 |
+
|
284 |
+
// Prepare dialog.
|
285 |
+
jDialog.find('#code-file-save-button').click($.proxy(_onsave, this));
|
286 |
+
jDialog.find('#code-file-cancel-button').click($.proxy(_oncancel, this));
|
287 |
+
var typesList = jDialog.find('#code-file-type').change($.proxy(
|
288 |
+
function() {
|
289 |
+
// Tag text.
|
290 |
+
var tagInput = jDialog.find('#code-file-tag');
|
291 |
+
var tag = '';
|
292 |
+
// Based on the selected type specifiy TAG.
|
293 |
+
switch (typesList.val()) {
|
294 |
+
case 'php':
|
295 |
+
tag = '<?php%s?>';
|
296 |
+
break;
|
297 |
+
case 'javascript':
|
298 |
+
tag = '<script type="text/javascript">%s</script>';
|
299 |
+
break;
|
300 |
+
case 'css':
|
301 |
+
tag = '<style type="text/css">%s</style>';
|
302 |
+
break;
|
303 |
+
}
|
304 |
+
// Set.
|
305 |
+
tagInput.val(tag);
|
306 |
+
}, this)
|
307 |
+
);
|
308 |
+
})(this);
|
309 |
+
};
|
310 |
+
|
311 |
+
/**
|
312 |
+
*
|
313 |
+
*
|
314 |
+
*/
|
315 |
+
var filesManagerDialog = function() {
|
316 |
+
// File Manager.
|
317 |
+
this.filesManager = $('#code-files-manager')
|
318 |
+
// Prevent Closing Metabox when interacting with the Code Files Manager.
|
319 |
+
.click(function(event) {event.stopPropagation()});
|
320 |
+
};
|
321 |
+
|
322 |
+
/**
|
323 |
+
*
|
324 |
+
*
|
325 |
+
*/
|
326 |
+
this.applyTheme = function(themeBlock) {
|
327 |
+
// Switch only if displayed for the current block that changing the theme.
|
328 |
+
if (this.block === themeBlock) {
|
329 |
+
this.filesManager.css({
|
330 |
+
'background-color': this.block.theme.backgroundColor,
|
331 |
+
'color': this.block.theme.color
|
332 |
+
});
|
333 |
+
}
|
334 |
+
};
|
335 |
+
|
336 |
+
this.listCodeFile = function(codeFile) {
|
337 |
+
// Create new LI element for the code file and all the related comopnents.
|
338 |
+
var liElement = $('<li>').addClass('codeFile').addClass('code-file-item').appendTo(this.filesManager)
|
339 |
+
// Show quick toolbox when Li ELement is hovered.
|
340 |
+
.mouseenter($.proxy(_changequicktoolbarstate, this));
|
341 |
+
$('<a>').text(codeFile.name)
|
342 |
+
.prop('title', codeFile.description)
|
343 |
+
.appendTo(liElement)
|
344 |
+
// Store Code File Data.
|
345 |
+
.data('codeFile', codeFile)
|
346 |
+
// Switch when clicked.
|
347 |
+
.click($.proxy(_onswitchfile, this));
|
348 |
+
return liElement;
|
349 |
+
};
|
350 |
+
|
351 |
+
/**
|
352 |
+
*
|
353 |
+
*
|
354 |
+
*/
|
355 |
+
var quickToolbar = function() {
|
356 |
+
// Initialize Quick Toolbar
|
357 |
+
this.quickToolbar = this.filesManager.find('.quick-toolbar').detach();
|
358 |
+
// Hide Quicktoolbar when mouse leave.
|
359 |
+
this.filesManager.mouseleave($.proxy(_changequicktoolbarstate, this));
|
360 |
+
// Select File Checkbox.
|
361 |
+
this.quickToolbar.get(0).selectCheckbox = this.quickToolbar.find('.select-code-file').change($.proxy(
|
362 |
+
function() {
|
363 |
+
var isChecked = this.quickToolbar.get(0).selectCheckbox.prop('checked');
|
364 |
+
var codeFileLi = this.quickToolbar.prev()
|
365 |
+
// Mark current QuickToolbar Code File as Selected.
|
366 |
+
.data('checkbox-selected', isChecked);
|
367 |
+
// Get CodeFile.
|
368 |
+
var codeFile = codeFileLi.find('a').data('codeFile');
|
369 |
+
// Add Checkbox for current Code File is chcked.
|
370 |
+
// Delete it otherwise.
|
371 |
+
switch(isChecked) {
|
372 |
+
case true:
|
373 |
+
// Add checkbox and mark it checked.
|
374 |
+
codeFileLi.data('mySelectCheckbox', $('<input class="show-selection" type="checkbox" checked="checked" />').val(codeFile.id)
|
375 |
+
.prop('disabled', 'disabled')
|
376 |
+
.prependTo(codeFileLi));
|
377 |
+
break;
|
378 |
+
case false:
|
379 |
+
// Delete chekbox
|
380 |
+
var mySelectCheckbox;
|
381 |
+
if (mySelectCheckbox = codeFileLi.data('mySelectCheckbox')) {
|
382 |
+
mySelectCheckbox.remove();
|
383 |
+
}
|
384 |
+
break;
|
385 |
+
}
|
386 |
+
}, this)
|
387 |
+
);
|
388 |
+
// Edit Code File.
|
389 |
+
this.quickToolbar.find('a.edit').click($.proxy(
|
390 |
+
function(event) {
|
391 |
+
// Get Code File data from the Code FileLi the Quicktoolbar is currenty activated for.
|
392 |
+
var codeFileLi = this.quickToolbar.get(0).codeFileLi;
|
393 |
+
var codeFileLink = codeFileLi.find('a');
|
394 |
+
// Display form.
|
395 |
+
this.editCodeFileDialog.display($(event.target).parent(), codeFileLink.data('codeFile')).done($.proxy(
|
396 |
+
function(rCodeFile) {
|
397 |
+
// Update codeFile record cache.
|
398 |
+
codeFileLink.data('codeFile', rCodeFile);
|
399 |
+
// Edit View Code File.
|
400 |
+
codeFileLink.text(rCodeFile.name);
|
401 |
+
// If is the active file.
|
402 |
+
if (codeFileLink.hasClass('active')) {
|
403 |
+
// Change Block Active File Name.
|
404 |
+
this.block.block.box.find('.hndle a.file').text(rCodeFile.name);
|
405 |
+
}
|
406 |
+
// Close the form.
|
407 |
+
this.editCodeFileDialog.close();
|
408 |
+
}, this)
|
409 |
+
);
|
410 |
+
return false;
|
411 |
+
}, this )
|
412 |
+
);
|
413 |
+
};
|
414 |
+
|
415 |
+
/**
|
416 |
+
*
|
417 |
+
*
|
418 |
+
*/
|
419 |
+
this.deattach = function() {
|
420 |
+
// Hide Manager.
|
421 |
+
this.filesManager.css({'display' : 'none'}).detach();
|
422 |
+
// Clear any previously added list
|
423 |
+
this.filesManager.find('li.codeFile').remove();
|
424 |
+
// Make sure edit/create form to be destructed.
|
425 |
+
this.editCodeFileDialog.close();
|
426 |
+
// Hide Quicktoolbar.
|
427 |
+
this.quickToolbar.hide();
|
428 |
+
// Reset Block
|
429 |
+
var oldBlock = this.block;
|
430 |
+
this.block = null;
|
431 |
+
// Returns Old block
|
432 |
+
return oldBlock;
|
433 |
+
};
|
434 |
+
|
435 |
+
/**
|
436 |
+
* put your comment there...
|
437 |
+
*
|
438 |
+
*/
|
439 |
+
this.initialize = function() {
|
440 |
+
// Files Manager dialog.
|
441 |
+
filesManagerDialog.apply(this);
|
442 |
+
// Edit Code File Dialog.
|
443 |
+
editCodeFile.apply(this);
|
444 |
+
// Prepare Quick Toolbar
|
445 |
+
quickToolbar.apply(this);
|
446 |
+
// Dialog tool buttons
|
447 |
+
dialogToolButtons.apply(this);
|
448 |
+
};
|
449 |
+
|
450 |
+
/**
|
451 |
+
*
|
452 |
+
*/
|
453 |
+
this.switchTo = function(block) {
|
454 |
+
// If not in revision mode submit to server.
|
455 |
+
if (block.revisionControl && (block.revisionControl.state == 'revision')) {
|
456 |
+
return;
|
457 |
+
}
|
458 |
+
// Enter Deattached state.
|
459 |
+
var oldBlock = this.deattach();
|
460 |
+
// Display if not displayed.
|
461 |
+
if (oldBlock !== block) {
|
462 |
+
// Switch to block.
|
463 |
+
this.block = block;
|
464 |
+
// Fetch List
|
465 |
+
block.codeFile.getList().done($.proxy(
|
466 |
+
function(codeFiles) {
|
467 |
+
// - Don't process is entered deattach state.
|
468 |
+
// - Process only last switched block.
|
469 |
+
if (this.block.block.get('id') == codeFiles.blockId) {
|
470 |
+
// Append list.
|
471 |
+
$.each(codeFiles.list, $.proxy(
|
472 |
+
function(index, codeFile) {
|
473 |
+
// List codeFile.
|
474 |
+
var codeFileLink = this.listCodeFile(codeFile).find('a');
|
475 |
+
// Check if current codeFile.
|
476 |
+
if (this.block.codeFile.file.activeFileId == codeFile.id) {
|
477 |
+
codeFileLink.addClass('active');
|
478 |
+
}
|
479 |
+
}, this)
|
480 |
+
);
|
481 |
+
// Set Location.
|
482 |
+
this.block.block.box.find('.file').after(this.filesManager);
|
483 |
+
// Aply theme
|
484 |
+
this.applyTheme(this.block);
|
485 |
+
// Display
|
486 |
+
this.filesManager.css({'display' : 'block'});
|
487 |
+
}
|
488 |
+
}, this)
|
489 |
+
);
|
490 |
+
}
|
491 |
+
};
|
492 |
+
};
|
493 |
+
|
494 |
+
})(jQuery)
|
views/blocks/block/public/js/codefile-manager/codefile-manager.localization.php
ADDED
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @version FILE_VERSION
|
4 |
+
* Localization file for jquery.block.js script.
|
5 |
+
*/
|
6 |
+
|
7 |
+
/**
|
8 |
+
* Localization for Javascript cjtJQueryBlockI18N variable.
|
9 |
+
*
|
10 |
+
* Localization text for backups script.
|
11 |
+
*/
|
12 |
+
return array(
|
13 |
+
'confirmDelete' => cssJSToolbox::getText('{count} Code Files about to be deleted. Are you sure delete those Files?'),
|
14 |
+
'noSelection' => cssJSToolbox::getText('Nothing selected!'),
|
15 |
+
'nameIsNull' => cssJSToolbox::getText('Name cannot be null. Code File must has a unique name for each Block.'),
|
16 |
+
'nameAlreadyExists' => cssJSToolbox::getText('Code File name is currently taken. Please choose another name.'),
|
17 |
+
);
|
views/blocks/block/public/js/codefile/codefile.js
ADDED
@@ -0,0 +1,140 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
*
|
3 |
+
*
|
4 |
+
*
|
5 |
+
*
|
6 |
+
*/
|
7 |
+
|
8 |
+
/**
|
9 |
+
*
|
10 |
+
*
|
11 |
+
*
|
12 |
+
*/
|
13 |
+
(function($) {
|
14 |
+
|
15 |
+
/**
|
16 |
+
* put your comment there...
|
17 |
+
*
|
18 |
+
* @param block
|
19 |
+
*/
|
20 |
+
CJTBlockFile = function(block) {
|
21 |
+
|
22 |
+
/**
|
23 |
+
* put your comment there...
|
24 |
+
*
|
25 |
+
* @type Object
|
26 |
+
*/
|
27 |
+
this.file = {};
|
28 |
+
|
29 |
+
/**
|
30 |
+
* put your comment there...
|
31 |
+
*
|
32 |
+
*
|
33 |
+
*/
|
34 |
+
var _onclickfilename = function(event) {
|
35 |
+
// Switch Code Files Managed to current block.
|
36 |
+
CJTBlockCodeFileView.switchTo(block);
|
37 |
+
// Don't close or show Menu.
|
38 |
+
event.stopPropagation();
|
39 |
+
};
|
40 |
+
|
41 |
+
/**
|
42 |
+
*
|
43 |
+
*
|
44 |
+
*/
|
45 |
+
this.deleteCodeFile = function(ids) {
|
46 |
+
// Request data.
|
47 |
+
var requestData = {blockId : block.block.get('id'), ids : ids};
|
48 |
+
// Query server / return promise object to caller.
|
49 |
+
return CJTBlocksPage.server.send('codeFiles', 'delete', requestData);
|
50 |
+
};
|
51 |
+
|
52 |
+
/**
|
53 |
+
*
|
54 |
+
*
|
55 |
+
*
|
56 |
+
*/
|
57 |
+
this.getList = function() {
|
58 |
+
// Request data.
|
59 |
+
var requestData = {blockId :block.block.get('id')};
|
60 |
+
// Query server / return promise object to caller.
|
61 |
+
return CJTBlocksPage.server.send('codeFiles', 'getList', requestData);
|
62 |
+
};
|
63 |
+
|
64 |
+
this.ondeleteblock = function() {
|
65 |
+
// Don't delete MENU if it being appended under current block.
|
66 |
+
if (CJTBlockCodeFileView.block === block) {
|
67 |
+
CJTBlockCodeFileView.deattach();
|
68 |
+
}
|
69 |
+
};
|
70 |
+
/**
|
71 |
+
*
|
72 |
+
*
|
73 |
+
*
|
74 |
+
*/
|
75 |
+
this.save = function(data) {
|
76 |
+
// Buold request params.
|
77 |
+
var requestData = {blockId : block.block.get('id'), codeFile : data};
|
78 |
+
// Send request.
|
79 |
+
return CJTBlocksPage.server.send('codeFiles', 'save', requestData, 'post');
|
80 |
+
};
|
81 |
+
|
82 |
+
/**
|
83 |
+
*
|
84 |
+
*
|
85 |
+
*
|
86 |
+
*/
|
87 |
+
this.switchFile = function(codeFile) {
|
88 |
+
// INitialize.
|
89 |
+
var model = block.block;
|
90 |
+
var blockId = model.get('id');
|
91 |
+
// Request data.
|
92 |
+
var requestData = {blockId : blockId, codeFileId : codeFile.id};
|
93 |
+
var promise = $.Deferred();
|
94 |
+
// Query server / return promise object to caller.
|
95 |
+
CJTBlocksPage.server.send('codeFiles', 'switch', requestData).done($.proxy(
|
96 |
+
function(rCodeFile) {
|
97 |
+
// Switch Code File.
|
98 |
+
this.file.activeFileId = rCodeFile.id;
|
99 |
+
this.file.name = rCodeFile.name;
|
100 |
+
this.file.type = rCodeFile.type;
|
101 |
+
// Re-Initialize ACE Code Editor.
|
102 |
+
model.aceEditor.getSession().setValue(rCodeFile.code);
|
103 |
+
model.aceEditor.cjtSyncInputField();
|
104 |
+
// Make sure to recalculate changes after force ace editor to be unchanged.
|
105 |
+
var isChanged = CJTBlocksPage.blocks.calculateChanges(block.changes, model.aceEditor.cjtBlockFieldId, false);
|
106 |
+
CJTBlocksPage.blockContentChanged(blockId, isChanged);
|
107 |
+
block.toolbox.buttons.save.enable(isChanged);
|
108 |
+
// Chage Current File Name.
|
109 |
+
this.currentFileName.text(this.file.name);
|
110 |
+
// Reflect View State.
|
111 |
+
promise.resolve(blockId, rCodeFile.id);
|
112 |
+
}, this)
|
113 |
+
);
|
114 |
+
return promise;
|
115 |
+
};
|
116 |
+
|
117 |
+
// Get All input file elements.
|
118 |
+
// sent from server, get the values.
|
119 |
+
// remove them.
|
120 |
+
var fileInputs = block.block.box.find("input[name^='cjtoolbox[" + block.block.get('id') + "][file]']");
|
121 |
+
$.each(fileInputs, $.proxy(
|
122 |
+
function(index, fileInput) {
|
123 |
+
var propertyName = fileInput.name.match(/cjtoolbox\[\d+\]\[file\]\[(\w+)\]/)[1];
|
124 |
+
this.file[propertyName] = fileInput.value;
|
125 |
+
}, this)
|
126 |
+
);
|
127 |
+
// Remove all file inputs sent from server.
|
128 |
+
fileInputs.remove();
|
129 |
+
|
130 |
+
// Switch editor language.
|
131 |
+
block._onswitcheditorlang(undefined, {lang : this.file.type ? this.file.type : block.block.get('editorLang', 'css')});
|
132 |
+
/// Load block file related features ///
|
133 |
+
// File name and files list.
|
134 |
+
this.currentFileName = $('<a>').addClass('file').text(this.file.name)
|
135 |
+
.insertAfter(block.elements.blockName)
|
136 |
+
.before($('<span class="name-file-separator">/</span>'))
|
137 |
+
.click($.proxy(_onclickfilename, this));
|
138 |
+
};
|
139 |
+
|
140 |
+
})(jQuery);
|
views/blocks/block/public/js/jquery.block/jquery.block.js
CHANGED
@@ -93,7 +93,8 @@
|
|
93 |
*/
|
94 |
var defaultOptions = {
|
95 |
showObjectsPanel : true,
|
96 |
-
calculatePinPoint : 1
|
|
|
97 |
};
|
98 |
|
99 |
/**
|
@@ -105,11 +106,226 @@
|
|
105 |
* @var object
|
106 |
*/
|
107 |
var autoLoadElements = {
|
108 |
-
codeEditor : 'textarea.code-editor',
|
109 |
editBlockName : 'div.edit-block-name',
|
110 |
blockName : 'span.block-name',
|
111 |
insideMetabox : 'div.inside'
|
112 |
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
113 |
|
114 |
/**
|
115 |
* Block jQuery Plugin.
|
@@ -133,7 +349,17 @@
|
|
133 |
*
|
134 |
*/
|
135 |
this.changes;
|
136 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
137 |
/**
|
138 |
* Commonly accessed elements stored here.
|
139 |
*
|
@@ -141,6 +367,11 @@
|
|
141 |
*/
|
142 |
this.elements;
|
143 |
|
|
|
|
|
|
|
|
|
|
|
144 |
/**
|
145 |
* Block features and options.
|
146 |
*
|
@@ -173,6 +404,21 @@
|
|
173 |
editName.css('display', 'none')
|
174 |
// Unbind events that binded when the edit block name form is displayed.
|
175 |
.find('input.block-name').unbind('keydown.editName');
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
176 |
}
|
177 |
|
178 |
/**
|
@@ -230,10 +476,34 @@
|
|
230 |
// Confirm deletion!
|
231 |
if (confirm(confirmMessage)) {
|
232 |
// Delete block.
|
233 |
-
|
234 |
}
|
235 |
}
|
236 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
237 |
/**
|
238 |
* Event handler for start editing block name.
|
239 |
*
|
@@ -264,7 +534,12 @@
|
|
264 |
}, this)
|
265 |
);
|
266 |
// Put it exactly above the block name - padding.
|
267 |
-
editName.css(
|
|
|
|
|
|
|
|
|
|
|
268 |
// Set input styles
|
269 |
var styles = {
|
270 |
'font-size' : this.elements.blockName.css('font-size'),
|
@@ -287,6 +562,71 @@
|
|
287 |
inputText.focus();
|
288 |
}
|
289 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
290 |
|
291 |
/**
|
292 |
*
|
@@ -307,6 +647,68 @@
|
|
307 |
tb_show(CJTJqueryBlockI18N.blockInfoTitle, url);
|
308 |
}
|
309 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
310 |
/**
|
311 |
* Don't show popup menus if Block is minimized!
|
312 |
*/
|
@@ -315,6 +717,12 @@
|
|
315 |
if (this.block.box.hasClass('closed')) {
|
316 |
show = false;
|
317 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
318 |
return show;
|
319 |
}
|
320 |
|
@@ -322,39 +730,15 @@
|
|
322 |
*
|
323 |
*/
|
324 |
this._onpostboxopened = function() {
|
325 |
-
//
|
326 |
-
|
327 |
-
//
|
328 |
-
this.block.aceEditor
|
329 |
-
|
330 |
-
|
331 |
-
|
332 |
-
|
333 |
-
|
334 |
-
this.internalChanging = true;
|
335 |
-
// Show loading state.
|
336 |
-
aceEditor.getSession().setValue('Loading...');
|
337 |
-
this.block.aceEditor.setReadOnly(true);
|
338 |
-
// Load code.
|
339 |
-
var request = {filter : {
|
340 |
-
field : 'id',
|
341 |
-
value : blockId},
|
342 |
-
returns : ['code']
|
343 |
-
};
|
344 |
-
CJTBlocksPage.server.send('block', 'getBlockBy', request)
|
345 |
-
.success($.proxy(
|
346 |
-
function(response) {
|
347 |
-
// Load code.
|
348 |
-
aceEditor.getSession().setValue(response.code);
|
349 |
-
this.internalChanging = false;
|
350 |
-
// Notification save changes SYNC.
|
351 |
-
aceEditor.cjtSyncInputField();
|
352 |
-
// Remove loading state.
|
353 |
-
this.block.aceEditor.setReadOnly(false);
|
354 |
-
// Mark as loaded.
|
355 |
-
jEditor.addClass('initially-loaded');
|
356 |
-
}, this)
|
357 |
-
);
|
358 |
}
|
359 |
}
|
360 |
|
@@ -376,6 +760,9 @@
|
|
376 |
var data = {calculatePinPoint : this.features.calculatePinPoint, createRevision : 1};
|
377 |
// Push DiFields inside Ajax queue.
|
378 |
this.block.queueDIFields();
|
|
|
|
|
|
|
379 |
// But save button into load state (Inactive and Showing loading icon).
|
380 |
saveButton.loading(true);
|
381 |
this.enable(false);
|
@@ -508,6 +895,19 @@
|
|
508 |
);
|
509 |
}
|
510 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
511 |
/**
|
512 |
*
|
513 |
*
|
@@ -545,7 +945,7 @@
|
|
545 |
*/
|
546 |
this.initCJTPluginBase = function(node, args) {
|
547 |
// Initialize object properties!
|
548 |
-
this.block = new CJTBlock(this, node)
|
549 |
this.features = $.extend(defaultOptions, args);
|
550 |
// Initialize Events.
|
551 |
this.onBlockSaved = function() {};
|
@@ -556,25 +956,6 @@
|
|
556 |
this.elements[name] = this.block.box.find(selector);
|
557 |
}, this)
|
558 |
);
|
559 |
-
// Initialize User Interface.
|
560 |
-
this.initUI();
|
561 |
-
// Prepare input elements for notifying user changes.
|
562 |
-
this.notifySaveChanges = (new notifySaveChangesProto(this)).initDIFields();
|
563 |
-
// Set Plugin options.
|
564 |
-
this.setOptions();
|
565 |
-
// Load
|
566 |
-
this.load();
|
567 |
-
}
|
568 |
-
|
569 |
-
/**
|
570 |
-
* @internal
|
571 |
-
*
|
572 |
-
* Initialize User Interface for block.
|
573 |
-
*
|
574 |
-
* @return void
|
575 |
-
*/
|
576 |
-
this.initUI = function() {
|
577 |
-
var model = this.block;
|
578 |
// Move edit-block-name edit area and tasks-bar outside Wordpress metabox "inside div".
|
579 |
this.elements.insideMetabox.before(model.box.find('.edit-block-name, .block-toolbox'));
|
580 |
var events = { // In-Place edit block name events.
|
@@ -587,13 +968,22 @@
|
|
587 |
model.box.find(selector).click(handler);
|
588 |
}, this)
|
589 |
);
|
590 |
-
// Initialize ACE Editor.
|
591 |
-
model.aceEditor.setTheme('ace/theme/chrome');
|
592 |
-
model.aceEditor.setShowPrintMargin(false);
|
593 |
// Activate toolbox.
|
594 |
this.toolbox = model.box.find('.block-toolbox').CJTToolBox({
|
595 |
context : this,
|
596 |
handlers : {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
597 |
'switch-editor-language' : {
|
598 |
type : 'Popup',
|
599 |
params : {
|
@@ -605,33 +995,100 @@
|
|
605 |
}
|
606 |
}
|
607 |
},
|
|
|
608 |
'editor-language-css' : {callback : this._onswitcheditorlang, params : {lang : 'css'}},
|
609 |
'editor-language-html' : {callback : this._onswitcheditorlang, params : {lang : 'html'}},
|
610 |
'editor-language-javascript' : {callback : this._onswitcheditorlang, params : {lang : 'javascript'}},
|
611 |
'editor-language-php' : {callback : this._onswitcheditorlang, params : {lang : 'php'}},
|
612 |
'state-switch' : {callback : this._onswitchflag, params : {flag : 'state'}},
|
613 |
'save' : {callback : this._onsavechanges, params : {enable : false}},
|
|
|
614 |
'delete' : {callback : this._ondelete},
|
615 |
'location-switch' : {callback : this._onswitchflag, params : {flag : 'location'}},
|
|
|
616 |
'edit-name' : {callback : this._oneditname},
|
617 |
'info' : {callback : this._ongetinfo},
|
618 |
}
|
619 |
}).get(0).CJTToolBox;
|
620 |
-
//
|
621 |
-
|
622 |
-
|
623 |
-
|
|
|
624 |
// Display block.
|
625 |
// !important: Blocks come from server response doesn't need this but the newly added blocks does.
|
626 |
// need sometime to be ready for display.
|
627 |
model.box.css({display : 'block'}).addClass('cjt-block');
|
628 |
}
|
629 |
-
|
630 |
/**
|
631 |
*
|
632 |
*/
|
633 |
-
this.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
634 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
635 |
/**
|
636 |
*
|
637 |
*/
|
@@ -650,14 +1107,36 @@
|
|
650 |
/** Add Our Ace Save, Full screen and Code-Auto-Completion commands */
|
651 |
editorCommands.addCommands(commands);
|
652 |
}
|
653 |
-
|
654 |
/**
|
655 |
-
*
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
656 |
*
|
657 |
-
* NOT IMPLEMENTED YET.
|
658 |
*
|
659 |
*/
|
660 |
-
this.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
661 |
|
662 |
} // End class.
|
663 |
|
93 |
*/
|
94 |
var defaultOptions = {
|
95 |
showObjectsPanel : true,
|
96 |
+
calculatePinPoint : 1,
|
97 |
+
restoreRevision : {fields : ['code']}
|
98 |
};
|
99 |
|
100 |
/**
|
106 |
* @var object
|
107 |
*/
|
108 |
var autoLoadElements = {
|
|
|
109 |
editBlockName : 'div.edit-block-name',
|
110 |
blockName : 'span.block-name',
|
111 |
insideMetabox : 'div.inside'
|
112 |
};
|
113 |
+
|
114 |
+
/**
|
115 |
+
* put your comment there...
|
116 |
+
*
|
117 |
+
* @type Object
|
118 |
+
*/
|
119 |
+
var Buttons = new function() {
|
120 |
+
|
121 |
+
/**
|
122 |
+
* put your comment there...
|
123 |
+
*
|
124 |
+
* @type T_JS_FUNCTION
|
125 |
+
*/
|
126 |
+
this.EditorToolbox = new function() {
|
127 |
+
|
128 |
+
/**
|
129 |
+
*
|
130 |
+
*/
|
131 |
+
this.EditorThemes = new function() {
|
132 |
+
// Initialize.
|
133 |
+
this.block = null;
|
134 |
+
// Create Unattached Themes list
|
135 |
+
// to be used accross all the blocks.
|
136 |
+
var theme = null;
|
137 |
+
var themesUIListContainer = $('<div class="popup-menu editor-themes-list"></div>').css({display: 'none'});
|
138 |
+
var themesUIList = $('<ul></ul>').appendTo(themesUIListContainer);
|
139 |
+
var themesAnchorsMap = {}, themes = [
|
140 |
+
'ambiance',
|
141 |
+
'chaos',
|
142 |
+
'chrome',
|
143 |
+
'clouds',
|
144 |
+
'clouds_midnight',
|
145 |
+
'cobalt',
|
146 |
+
'crimson_editor',
|
147 |
+
'dawn',
|
148 |
+
'dreamweaver',
|
149 |
+
'eclipse',
|
150 |
+
'github',
|
151 |
+
'idle_fingers',
|
152 |
+
'katzenmilch',
|
153 |
+
'kr',
|
154 |
+
'kuroir',
|
155 |
+
'merbivore',
|
156 |
+
'merbivore_soft',
|
157 |
+
'mono_industrial',
|
158 |
+
'monokai',
|
159 |
+
'pastel_on_dark',
|
160 |
+
'solarized_dark',
|
161 |
+
'solarized_light',
|
162 |
+
'terminal',
|
163 |
+
'textmate',
|
164 |
+
'tomorrow',
|
165 |
+
'tomorrow_night',
|
166 |
+
'tomorrow_night_blue',
|
167 |
+
'tomorrow_night_bright',
|
168 |
+
'tomorrow_night_eighties',
|
169 |
+
'twilight',
|
170 |
+
'vibrant_ink',
|
171 |
+
'xcode'
|
172 |
+
];
|
173 |
+
|
174 |
+
/**
|
175 |
+
* put your comment there...
|
176 |
+
*
|
177 |
+
* @param event
|
178 |
+
*/
|
179 |
+
var _onswitchtheme = function(event) {
|
180 |
+
// Get theme name associated with the link.
|
181 |
+
var editorTheme = $(event.target).data('ace-theme-key');
|
182 |
+
var $this = Buttons.EditorToolbox.EditorThemes;
|
183 |
+
// Save theme.
|
184 |
+
$this.block.block.set('editorTheme', editorTheme);
|
185 |
+
// Select menu theme.
|
186 |
+
$this.selectMenuTheme();
|
187 |
+
// Set editor theme.
|
188 |
+
$this.setEditorTheme();
|
189 |
+
// Link Inactive.
|
190 |
+
return false;
|
191 |
+
};
|
192 |
+
|
193 |
+
/**
|
194 |
+
* put your comment there...
|
195 |
+
*
|
196 |
+
* @param button
|
197 |
+
*/
|
198 |
+
var _oncallback = function(targetList, button) {
|
199 |
+
// Init.
|
200 |
+
var cObject = Buttons.EditorToolbox.EditorThemes;
|
201 |
+
// Associate list to current activate block.
|
202 |
+
cObject.block = this;
|
203 |
+
// Select default.
|
204 |
+
cObject.selectMenuTheme();
|
205 |
+
// ACE Themes list style.
|
206 |
+
cObject.applyTheme(this);
|
207 |
+
// Add the list just after the button.
|
208 |
+
button.jButton.after(targetList);
|
209 |
+
}
|
210 |
+
|
211 |
+
/**
|
212 |
+
*
|
213 |
+
*/
|
214 |
+
this.applyTheme = function(block) {
|
215 |
+
// Apply theme to Themes list.
|
216 |
+
themesUIList.css('background-color', block.theme.backgroundColor);
|
217 |
+
// Apply to block components
|
218 |
+
CJTBlockCodeFileView.applyTheme(block);
|
219 |
+
CJTBlockMenuView.applyTheme(block);
|
220 |
+
};
|
221 |
+
|
222 |
+
/**
|
223 |
+
*
|
224 |
+
*/
|
225 |
+
this.getEditorTheme = function() {
|
226 |
+
return this.block.block.get('editorTheme', 'chrome');
|
227 |
+
};
|
228 |
+
|
229 |
+
/**
|
230 |
+
*
|
231 |
+
*/
|
232 |
+
this.getType = function(block) {
|
233 |
+
// Associate block for initialize.
|
234 |
+
// block would be changed again everytime
|
235 |
+
// a block is initialized
|
236 |
+
// or menu is selected.
|
237 |
+
this.block = block;
|
238 |
+
// Bind to themeLoaded event.
|
239 |
+
var model = block.block;
|
240 |
+
var editor = model.aceEditor;
|
241 |
+
editor.renderer.addEventListener('themeLoaded', $.proxy(
|
242 |
+
function() {
|
243 |
+
var jEditor = $(editor.container);
|
244 |
+
// Set theme colors.
|
245 |
+
block.theme = {};
|
246 |
+
block.theme.backgroundColor = jEditor.css('background-color');
|
247 |
+
block.theme.color = jEditor.css('color');
|
248 |
+
// Apply Theme to block element.
|
249 |
+
model.box.css('background-color', block.theme.backgroundColor);
|
250 |
+
block.block.box.find('.hndle').css('color', block.theme.color);
|
251 |
+
// ACE Themes list theme.
|
252 |
+
this.applyTheme(block);
|
253 |
+
}, this)
|
254 |
+
);
|
255 |
+
// Set default theme.
|
256 |
+
this.setEditorTheme();
|
257 |
+
// Type object.
|
258 |
+
return {
|
259 |
+
|
260 |
+
// Callback
|
261 |
+
callback : _oncallback,
|
262 |
+
|
263 |
+
/**
|
264 |
+
* put your comment there...
|
265 |
+
*
|
266 |
+
* @type String
|
267 |
+
*/
|
268 |
+
type : 'Popup',
|
269 |
+
|
270 |
+
/**
|
271 |
+
*
|
272 |
+
*/
|
273 |
+
params : {
|
274 |
+
// Parameters for PopupList type button.
|
275 |
+
_type : {
|
276 |
+
targetElement : themesUIListContainer,
|
277 |
+
targetElementObject : true
|
278 |
+
}
|
279 |
+
}
|
280 |
+
}
|
281 |
+
};
|
282 |
+
|
283 |
+
/**
|
284 |
+
*
|
285 |
+
*/
|
286 |
+
this.selectMenuTheme = function() {
|
287 |
+
// Get editor theme.
|
288 |
+
var editorTheme = this.getEditorTheme();
|
289 |
+
// Clear any previously selected item.
|
290 |
+
themesUIList.find('a').removeClass('active');
|
291 |
+
// Select default.
|
292 |
+
themesAnchorsMap[editorTheme].addClass('active');
|
293 |
+
};
|
294 |
+
|
295 |
+
/**
|
296 |
+
*
|
297 |
+
*/
|
298 |
+
this.setEditorTheme = function() {
|
299 |
+
// INitialize.
|
300 |
+
var model = this.block.block;
|
301 |
+
var editor = model.aceEditor;
|
302 |
+
// Set editor theme.
|
303 |
+
// TODO: Full theme name might be saved somewhere!
|
304 |
+
var themePath = 'ace/theme/' + this.getEditorTheme();
|
305 |
+
// Change theme.
|
306 |
+
editor.setTheme(themePath);
|
307 |
+
};
|
308 |
+
|
309 |
+
// Build list.
|
310 |
+
$.each(themes, $.proxy(
|
311 |
+
function(index, themeName) {
|
312 |
+
// Add item to list.
|
313 |
+
var listItem = $('<li></li>').appendTo(themesUIList);
|
314 |
+
// Create link + replace name with the anchor.
|
315 |
+
themesAnchorsMap[themeName] = $('<a href="#">' + CJTJqueryBlockI18N['ace_theme-' + themeName] + '</a>').appendTo(listItem)
|
316 |
+
// Class.
|
317 |
+
.addClass('cjt-link')
|
318 |
+
// Store theme key.
|
319 |
+
.data('ace-theme-key', themeName)
|
320 |
+
// Handle item click.
|
321 |
+
.click(_onswitchtheme);
|
322 |
+
}, this)
|
323 |
+
);
|
324 |
+
|
325 |
+
};
|
326 |
+
|
327 |
+
}
|
328 |
+
};
|
329 |
|
330 |
/**
|
331 |
* Block jQuery Plugin.
|
349 |
*
|
350 |
*/
|
351 |
this.changes;
|
352 |
+
|
353 |
+
/**
|
354 |
+
*
|
355 |
+
*/
|
356 |
+
this.defaultDocks;
|
357 |
+
|
358 |
+
/**
|
359 |
+
*
|
360 |
+
*/
|
361 |
+
this.editorToolbox;
|
362 |
+
|
363 |
/**
|
364 |
* Commonly accessed elements stored here.
|
365 |
*
|
367 |
*/
|
368 |
this.elements;
|
369 |
|
370 |
+
/**
|
371 |
+
*
|
372 |
+
*/
|
373 |
+
this.extraDocks = [];
|
374 |
+
|
375 |
/**
|
376 |
* Block features and options.
|
377 |
*
|
404 |
editName.css('display', 'none')
|
405 |
// Unbind events that binded when the edit block name form is displayed.
|
406 |
.find('input.block-name').unbind('keydown.editName');
|
407 |
+
// Hide CodeFile Name.
|
408 |
+
this.block.box.find('.file').css({visibility : 'visible'});
|
409 |
+
}
|
410 |
+
|
411 |
+
/**
|
412 |
+
*
|
413 |
+
*/
|
414 |
+
this._onclearblock = function() {
|
415 |
+
var aceEditor = this.block.aceEditor;
|
416 |
+
//Directly clear using setValue('') won't save the history!
|
417 |
+
// Select all text.
|
418 |
+
aceEditor.selectAll();
|
419 |
+
// Replace content with empty string!
|
420 |
+
aceEditor.getSession().replace(aceEditor.getSelectionRange(), '');
|
421 |
+
aceEditor.focus();
|
422 |
}
|
423 |
|
424 |
/**
|
476 |
// Confirm deletion!
|
477 |
if (confirm(confirmMessage)) {
|
478 |
// Delete block.
|
479 |
+
CJTBlocksPage.deleteBlocks(this.block.box);
|
480 |
}
|
481 |
}
|
482 |
|
483 |
+
/**
|
484 |
+
*
|
485 |
+
*
|
486 |
+
*
|
487 |
+
*
|
488 |
+
*/
|
489 |
+
this._ondisplayrevisions = function() {
|
490 |
+
// Restore revision only when block is opened.
|
491 |
+
if (this.block.box.hasClass('closed')) {
|
492 |
+
return false;
|
493 |
+
}
|
494 |
+
// Initialize form request.
|
495 |
+
var revisionsFormParams = {
|
496 |
+
id : this.block.get('id'),
|
497 |
+
activeFileId : this.codeFile.file.activeFileId,
|
498 |
+
width : 300,
|
499 |
+
height : 250,
|
500 |
+
TB_iframe : true
|
501 |
+
};
|
502 |
+
var url = CJTBlocksPage.server.getRequestURL('block', 'get_revisions', revisionsFormParams);
|
503 |
+
tb_show(CJTJqueryBlockI18N.blockRevisionsDialogTitle, url);
|
504 |
+
return false;
|
505 |
+
}
|
506 |
+
|
507 |
/**
|
508 |
* Event handler for start editing block name.
|
509 |
*
|
534 |
}, this)
|
535 |
);
|
536 |
// Put it exactly above the block name - padding.
|
537 |
+
editName.css({
|
538 |
+
'left' : ((this.elements.blockName.position().left - 2) + 'px'),
|
539 |
+
'background-color' : this.theme.backgroundColor
|
540 |
+
});
|
541 |
+
// Hide CodeFile Name.
|
542 |
+
this.block.box.find('.file').css({visibility : 'hidden'});
|
543 |
// Set input styles
|
544 |
var styles = {
|
545 |
'font-size' : this.elements.blockName.css('font-size'),
|
562 |
inputText.focus();
|
563 |
}
|
564 |
}
|
565 |
+
|
566 |
+
/**
|
567 |
+
*
|
568 |
+
*/
|
569 |
+
this._onfontsize = function(event, params) {
|
570 |
+
var editor = $(this.block.aceEditor.container);
|
571 |
+
// Reset font size to default.
|
572 |
+
if (params.reset) {
|
573 |
+
// Remove fontSize and Line-Height rules!
|
574 |
+
fontSize = '';
|
575 |
+
}
|
576 |
+
else {
|
577 |
+
var tick = 2;
|
578 |
+
// Get current font-size.
|
579 |
+
var fontSize = editor.css('font-size'); // Font size in pixels!
|
580 |
+
fontSize = (parseInt(fontSize) + (params.direction * tick)) + 'px';
|
581 |
+
}
|
582 |
+
// Reset Or Increase (+) Or decrease (-) font size based on the given parameter.
|
583 |
+
editor.css({'font-size' : fontSize, 'line-height' : fontSize});
|
584 |
+
}
|
585 |
+
|
586 |
+
/**
|
587 |
+
*
|
588 |
+
*/
|
589 |
+
this._onfullscreen = function(event) {
|
590 |
+
// Initialize vars!
|
591 |
+
var block = this.block;
|
592 |
+
var elementsToDock = $.merge($.merge([], this.extraDocks), this.defaultDocks);
|
593 |
+
var newMode = '';
|
594 |
+
// Document body.
|
595 |
+
$('body').toggleClass('fullscreen').hasClass('fullscreen');
|
596 |
+
// Enter/Exit Full Screen mode!
|
597 |
+
if (block.box.toggleClass('fullscreen').hasClass('fullscreen')) {
|
598 |
+
newMode = 'fullscreen';
|
599 |
+
// Defined resize handler.
|
600 |
+
var resizer = $.proxy(
|
601 |
+
function() {
|
602 |
+
$.each(elementsToDock, $.proxy(
|
603 |
+
function(index, item) {
|
604 |
+
// Dock all defined elements!
|
605 |
+
this.dock(item.element, item.pixels);
|
606 |
+
}, this)
|
607 |
+
);
|
608 |
+
}, this);
|
609 |
+
// Bind to handler.
|
610 |
+
$(window).bind('resize.cjtfullscreen', resizer);
|
611 |
+
// Call it.
|
612 |
+
resizer();
|
613 |
+
}
|
614 |
+
else {
|
615 |
+
// Reset to normal height.
|
616 |
+
$.each(elementsToDock, $.proxy(
|
617 |
+
function(index, item) {
|
618 |
+
$(item.element).css('height', '');
|
619 |
+
}, this)
|
620 |
+
);
|
621 |
+
$(window).unbind('resize.cjtfullscreen');
|
622 |
+
}
|
623 |
+
// Screen mode title.
|
624 |
+
$(event.target).attr('title', CJTJqueryBlockI18N['screenmode_' + newMode + 'Title']);
|
625 |
+
// Refresh/Redraw editor.
|
626 |
+
block.aceEditor.resize();
|
627 |
+
// Toggle Toolbox fullscreen button icon.
|
628 |
+
this.editorToolbox.buttons['fullscreen'].jButton.toggleClass('maximized');
|
629 |
+
}
|
630 |
|
631 |
/**
|
632 |
*
|
647 |
tb_show(CJTJqueryBlockI18N.blockInfoTitle, url);
|
648 |
}
|
649 |
|
650 |
+
/**
|
651 |
+
* Quickely link external resource (CSS, JS, HTML or PHP)!
|
652 |
+
*
|
653 |
+
* The method is to fetch external content and add it as CJT template.
|
654 |
+
*/
|
655 |
+
this._onlinkexternal = function() {
|
656 |
+
// Read URLs from user inputs.
|
657 |
+
var externals = prompt(CJTJqueryBlockI18N.linkExternalMessage);
|
658 |
+
var linkExternalButton = this.toolbox.buttons['link-external'];
|
659 |
+
if (externals) {
|
660 |
+
// Show progress.
|
661 |
+
linkExternalButton.loading(true);
|
662 |
+
// Request server to link the external resources.
|
663 |
+
var request = {externals : externals, blockId : this.block.get('id')};
|
664 |
+
CJTBlocksPage.server.send('templatesManager', 'linkExternal', request)
|
665 |
+
.success($.proxy(
|
666 |
+
function(state) {
|
667 |
+
if (state.code) {
|
668 |
+
alert(CJTJqueryBlockI18N.couldNotLinkExternals + state.message);
|
669 |
+
}
|
670 |
+
}, this)
|
671 |
+
).complete($.proxy(
|
672 |
+
function() {
|
673 |
+
// Stop progress.
|
674 |
+
linkExternalButton.loading(false);
|
675 |
+
}, this)
|
676 |
+
);
|
677 |
+
}
|
678 |
+
}
|
679 |
+
|
680 |
+
/**
|
681 |
+
*
|
682 |
+
*/
|
683 |
+
this._onlookuptemplates = function(targetElement, tbButton) {
|
684 |
+
// Initialize.
|
685 |
+
var frameHeight = parseInt(targetElement.css('height'));
|
686 |
+
var blockId = this.block.get('id');
|
687 |
+
if (!CJTToolBox.forms.templatesLookupForm[blockId]) {
|
688 |
+
CJTToolBox.forms.templatesLookupForm[blockId] = {};
|
689 |
+
}
|
690 |
+
var lookupForm = CJTToolBox.forms.templatesLookupForm[blockId];
|
691 |
+
// This method will fired only once when the
|
692 |
+
// Templates popup button is hovered for the first time.
|
693 |
+
if (!targetElement.get(0).__cjt_loaded) {
|
694 |
+
var request = {blockId : blockId};
|
695 |
+
// Pass block object to the form when loaded.
|
696 |
+
lookupForm.inputs = {block : this.block, button : tbButton, height : frameHeight};
|
697 |
+
// Set frame Source to templates lookup view URL.
|
698 |
+
var templatesLookupViewURL = CJTBlocksPage.server.getRequestURL('templatesLookup', 'display', request);
|
699 |
+
targetElement.prop('src', templatesLookupViewURL);
|
700 |
+
// Mark loaded.
|
701 |
+
targetElement.get(0).__cjt_loaded = true;
|
702 |
+
}
|
703 |
+
else {
|
704 |
+
// Pass frame height when refreshed.
|
705 |
+
lookupForm.inputs.height = frameHeight;
|
706 |
+
lookupForm.form.refresh();
|
707 |
+
}
|
708 |
+
/** @TODO Tell Block toolbox to deatach/unbind popup callback */
|
709 |
+
return true; // Tell CJTToolBox to Show Popup menu as normal.
|
710 |
+
}
|
711 |
+
|
712 |
/**
|
713 |
* Don't show popup menus if Block is minimized!
|
714 |
*/
|
717 |
if (this.block.box.hasClass('closed')) {
|
718 |
show = false;
|
719 |
}
|
720 |
+
else {
|
721 |
+
// Some Popup forms need to be re-sized if fullscree is On!
|
722 |
+
if (button.params.fitToScreen == true) {
|
723 |
+
this.dock(targetElement, 25);
|
724 |
+
}
|
725 |
+
}
|
726 |
return show;
|
727 |
}
|
728 |
|
730 |
*
|
731 |
*/
|
732 |
this._onpostboxopened = function() {
|
733 |
+
// If aceEditor is undefined then the
|
734 |
+
// block is no loaded yet,
|
735 |
+
// loads it.
|
736 |
+
if (this.block.aceEditor == undefined) {
|
737 |
+
this._onload();
|
738 |
+
}
|
739 |
+
else {
|
740 |
+
// Update ACE Editor region.
|
741 |
+
this.block.aceEditor.resize();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
742 |
}
|
743 |
}
|
744 |
|
760 |
var data = {calculatePinPoint : this.features.calculatePinPoint, createRevision : 1};
|
761 |
// Push DiFields inside Ajax queue.
|
762 |
this.block.queueDIFields();
|
763 |
+
// Add code file flags to the queue.
|
764 |
+
var queue = this.block.getOperationQueue('saveDIFields');
|
765 |
+
queue.add({id : this.block.get('id'), property : 'activeFileId', value : this.codeFile.file.activeFileId});
|
766 |
// But save button into load state (Inactive and Showing loading icon).
|
767 |
saveButton.loading(true);
|
768 |
this.enable(false);
|
895 |
);
|
896 |
}
|
897 |
|
898 |
+
/**
|
899 |
+
*
|
900 |
+
*/
|
901 |
+
this.dock = function(elements, pixelsToRemove) {
|
902 |
+
// Initialize.
|
903 |
+
var alwaysRemove = 33;
|
904 |
+
pixelsToRemove = (pixelsToRemove != undefined) ? (pixelsToRemove + alwaysRemove) : alwaysRemove;
|
905 |
+
// There're always 33 pixels need to be removed from the Code area
|
906 |
+
var fixedHeight = this.block.box.height() - pixelsToRemove;
|
907 |
+
var heightInPixels = fixedHeight + 'px';
|
908 |
+
$(elements).css('height', heightInPixels);
|
909 |
+
}
|
910 |
+
|
911 |
/**
|
912 |
*
|
913 |
*
|
945 |
*/
|
946 |
this.initCJTPluginBase = function(node, args) {
|
947 |
// Initialize object properties!
|
948 |
+
var model = this.block = new CJTBlock(this, node)
|
949 |
this.features = $.extend(defaultOptions, args);
|
950 |
// Initialize Events.
|
951 |
this.onBlockSaved = function() {};
|
956 |
this.elements[name] = this.block.box.find(selector);
|
957 |
}, this)
|
958 |
);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
959 |
// Move edit-block-name edit area and tasks-bar outside Wordpress metabox "inside div".
|
960 |
this.elements.insideMetabox.before(model.box.find('.edit-block-name, .block-toolbox'));
|
961 |
var events = { // In-Place edit block name events.
|
968 |
model.box.find(selector).click(handler);
|
969 |
}, this)
|
970 |
);
|
|
|
|
|
|
|
971 |
// Activate toolbox.
|
972 |
this.toolbox = model.box.find('.block-toolbox').CJTToolBox({
|
973 |
context : this,
|
974 |
handlers : {
|
975 |
+
'templates-lookup' : {
|
976 |
+
type : 'Popup',
|
977 |
+
callback : this._onlookuptemplates,
|
978 |
+
params : {
|
979 |
+
fitToScreen : true, /* Custom to be used inside this._onpopupmenu() method */
|
980 |
+
_type : {
|
981 |
+
onPopup : this._onpopupmenu,
|
982 |
+
targetElement : '.templates-lookup',
|
983 |
+
setTargetPosition : false
|
984 |
+
}
|
985 |
+
}
|
986 |
+
},
|
987 |
'switch-editor-language' : {
|
988 |
type : 'Popup',
|
989 |
params : {
|
995 |
}
|
996 |
}
|
997 |
},
|
998 |
+
'link-external' : {callback : this._onlinkexternal},
|
999 |
'editor-language-css' : {callback : this._onswitcheditorlang, params : {lang : 'css'}},
|
1000 |
'editor-language-html' : {callback : this._onswitcheditorlang, params : {lang : 'html'}},
|
1001 |
'editor-language-javascript' : {callback : this._onswitcheditorlang, params : {lang : 'javascript'}},
|
1002 |
'editor-language-php' : {callback : this._onswitcheditorlang, params : {lang : 'php'}},
|
1003 |
'state-switch' : {callback : this._onswitchflag, params : {flag : 'state'}},
|
1004 |
'save' : {callback : this._onsavechanges, params : {enable : false}},
|
1005 |
+
'revisions' : {callback : this._ondisplayrevisions},
|
1006 |
'delete' : {callback : this._ondelete},
|
1007 |
'location-switch' : {callback : this._onswitchflag, params : {flag : 'location'}},
|
1008 |
+
'get-shortcode' : {callback : this._ongetshortcode},
|
1009 |
'edit-name' : {callback : this._oneditname},
|
1010 |
'info' : {callback : this._ongetinfo},
|
1011 |
}
|
1012 |
}).get(0).CJTToolBox;
|
1013 |
+
// If the code editor element is presented then
|
1014 |
+
// the block is already opened and no need to load later.
|
1015 |
+
if (model.box.find('.code-editor').length) {
|
1016 |
+
this.load();
|
1017 |
+
}
|
1018 |
// Display block.
|
1019 |
// !important: Blocks come from server response doesn't need this but the newly added blocks does.
|
1020 |
// need sometime to be ready for display.
|
1021 |
model.box.css({display : 'block'}).addClass('cjt-block');
|
1022 |
}
|
1023 |
+
|
1024 |
/**
|
1025 |
*
|
1026 |
*/
|
1027 |
+
this._onload = function() {
|
1028 |
+
// Initialize.
|
1029 |
+
var model = this.block;
|
1030 |
+
// Show loading block progress.
|
1031 |
+
var loadingPro = $('<div class="loading-block">' + CJTJqueryBlockI18N.loadingBlock + ' . . .</div>').prependTo(this.elements.insideMetabox.prepend());
|
1032 |
+
// Retrieve Block HTML content.
|
1033 |
+
CJTBlocksPage.server.send('blocksPage', 'loadBlock', {blockId : model.get('id'), isLoading : true})
|
1034 |
+
.success($.proxy(
|
1035 |
+
function(blockContent) {
|
1036 |
+
// Remove loading bloc progress.
|
1037 |
+
loadingPro.remove();
|
1038 |
+
// Add assignment panel at the most begning of the block.
|
1039 |
+
this.elements.insideMetabox.prepend(blockContent.assignPanel);
|
1040 |
+
// Add block content at the end.
|
1041 |
+
this.elements.insideMetabox.append(blockContent.content);
|
1042 |
+
// Load block.
|
1043 |
+
this.load();
|
1044 |
+
}, this)
|
1045 |
+
);
|
1046 |
+
};
|
1047 |
|
1048 |
+
/**
|
1049 |
+
*
|
1050 |
+
*/
|
1051 |
+
this.load = function() {
|
1052 |
+
// Initialize.
|
1053 |
+
var model = this.block;
|
1054 |
+
// LOAD MODEL.
|
1055 |
+
model.load();
|
1056 |
+
// Load ACE Editor Settings.
|
1057 |
+
model.aceEditor.setOptions(model.get('aceEditorMenuSettings', {showPrintMargin : false}));
|
1058 |
+
// Initialize editor toolbox.
|
1059 |
+
this.editorToolbox = model.box.find('.editor-toolbox').CJTToolBox({
|
1060 |
+
context : this,
|
1061 |
+
handlers : {
|
1062 |
+
'fullscreen' : {callback : this._onfullscreen},
|
1063 |
+
'font-large' : {callback : this._onfontsize, params : {direction: 1}},
|
1064 |
+
'font-small' : {callback : this._onfontsize, params : {direction: -1}},
|
1065 |
+
'reset-font' : {callback : this._onfontsize, params : {reset : true}},
|
1066 |
+
'clear-block' : {callback : this._onclearblock},
|
1067 |
+
'editor-theme' : Buttons.EditorToolbox.EditorThemes.getType(this)
|
1068 |
+
}
|
1069 |
+
}).get(0).CJTToolBox;
|
1070 |
+
// Default to DOCK!!
|
1071 |
+
this.defaultDocks = [{element : this.block.aceEditor.container, pixels : 7}];
|
1072 |
+
// Show hidden toolbox buttons.
|
1073 |
+
this.toolbox.buttons['revisions'].jButton.removeClass('waitingToLoad');
|
1074 |
+
this.toolbox.buttons['switch-editor-language'].jButton.removeClass('waitingToLoad');
|
1075 |
+
this.toolbox.buttons['link-external'].jButton.removeClass('waitingToLoad');
|
1076 |
+
this.toolbox.buttons['templates-lookup'].jButton.removeClass('waitingToLoad');
|
1077 |
+
this.toolbox.buttons['save'].jButton.removeClass('waitingToLoad');
|
1078 |
+
// Register COMMAND-KEYS.
|
1079 |
+
this.registerCommands();
|
1080 |
+
// Switch Block state if required, if state is empty nothing will happen.
|
1081 |
+
// Until now only 'restore' state is supported to prevent saving restored block.
|
1082 |
+
this.switchState(this.features.state);
|
1083 |
+
// Prepare input elements for notifying user changes.
|
1084 |
+
this.notifySaveChanges = (new notifySaveChangesProto(this)).initDIFields();
|
1085 |
+
// LOAD EVENT.
|
1086 |
+
this.onLoad();
|
1087 |
+
// Block Code File.
|
1088 |
+
this.menu = new CJTBlockMenu(this);
|
1089 |
+
this.codeFile = new CJTBlockFile(this);
|
1090 |
+
}
|
1091 |
+
|
1092 |
/**
|
1093 |
*
|
1094 |
*/
|
1107 |
/** Add Our Ace Save, Full screen and Code-Auto-Completion commands */
|
1108 |
editorCommands.addCommands(commands);
|
1109 |
}
|
1110 |
+
|
1111 |
/**
|
1112 |
+
*
|
1113 |
+
*/
|
1114 |
+
this.restoreRevision = function(revisionId, data) {
|
1115 |
+
// Create new revision control action.
|
1116 |
+
this.revisionControl = new CJTBlockOptionalRevision(this, data, revisionId);
|
1117 |
+
// Display the revision + enter revision mode.
|
1118 |
+
this.revisionControl.display();
|
1119 |
+
}
|
1120 |
+
|
1121 |
+
/*
|
1122 |
+
*
|
1123 |
*
|
|
|
1124 |
*
|
1125 |
*/
|
1126 |
+
this.switchState = function(state) {
|
1127 |
+
switch (state) {
|
1128 |
+
case 'restore':
|
1129 |
+
// Hide block toolbox.
|
1130 |
+
this.toolbox.jToolbox.hide();
|
1131 |
+
// Disable all fields.
|
1132 |
+
this.enable(false);
|
1133 |
+
// Change state
|
1134 |
+
this.state = 'restore';
|
1135 |
+
default:
|
1136 |
+
// Nothing for now
|
1137 |
+
break;
|
1138 |
+
}
|
1139 |
+
}
|
1140 |
|
1141 |
} // End class.
|
1142 |
|
views/blocks/block/public/js/jquery.block/jquery.block.localization.php
CHANGED
@@ -18,4 +18,42 @@ return array(
|
|
18 |
'location_headerTitle' => cssJSToolbox::getText('Set output location hook to footer'),
|
19 |
'location_footerTitle' => cssJSToolbox::getText('Set output location hook to header'),
|
20 |
'invalidBlockName' => cssJSToolbox::getText('Invalid block name'),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
21 |
);
|
18 |
'location_headerTitle' => cssJSToolbox::getText('Set output location hook to footer'),
|
19 |
'location_footerTitle' => cssJSToolbox::getText('Set output location hook to header'),
|
20 |
'invalidBlockName' => cssJSToolbox::getText('Invalid block name'),
|
21 |
+
'screenmode_fullscreenTitle' => cssJSToolbox::getText('Revert code editor to default mode'),
|
22 |
+
'screenmode_Title' => cssJSToolbox::getText('Switch code editor to fullscreen mode'),
|
23 |
+
'linkExternalMessage' => cssJSToolbox::getText('Please enter a list of the external URLs you want to link separated by comma!'),
|
24 |
+
'couldNotLinkExternals' => cssJSToolbox::getText('Couldn\'t link the externals URI you requested!! Reason:'),
|
25 |
+
'loadingBlock' => cssJSToolbox::getText('Loading'),
|
26 |
+
// ACE Themes.
|
27 |
+
'ace_theme-ambiance' => cssJSToolbox::getText('Ambiance'),
|
28 |
+
'ace_theme-chaos' => cssJSToolbox::getText('Chaos'),
|
29 |
+
'ace_theme-chrome' => cssJSToolbox::getText('Chrome'),
|
30 |
+
'ace_theme-clouds' => cssJSToolbox::getText('Clouds'),
|
31 |
+
'ace_theme-clouds_midnight' => cssJSToolbox::getText('Clouds Midnight'),
|
32 |
+
'ace_theme-cobalt' => cssJSToolbox::getText('Cobalt'),
|
33 |
+
'ace_theme-crimson_editor' => cssJSToolbox::getText('Crimson Editor'),
|
34 |
+
'ace_theme-dawn' => cssJSToolbox::getText('Dawn'),
|
35 |
+
'ace_theme-dreamweaver' => cssJSToolbox::getText('Dreamweaver'),
|
36 |
+
'ace_theme-eclipse' => cssJSToolbox::getText('Eclipse'),
|
37 |
+
'ace_theme-github' => cssJSToolbox::getText('Github'),
|
38 |
+
'ace_theme-idle_fingers' => cssJSToolbox::getText('Idle Fingers'),
|
39 |
+
'ace_theme-katzenmilch' => cssJSToolbox::getText('Katzenmilch'),
|
40 |
+
'ace_theme-kr' => cssJSToolbox::getText('Kr'),
|
41 |
+
'ace_theme-kuroir' => cssJSToolbox::getText('Kuroir'),
|
42 |
+
'ace_theme-merbivore' => cssJSToolbox::getText('Merbivore'),
|
43 |
+
'ace_theme-merbivore_soft' => cssJSToolbox::getText('Merbivore Soft'),
|
44 |
+
'ace_theme-mono_industrial' => cssJSToolbox::getText('Mono Industrial'),
|
45 |
+
'ace_theme-monokai' => cssJSToolbox::getText('Monokai'),
|
46 |
+
'ace_theme-pastel_on_dark' => cssJSToolbox::getText('Pastel On Dark'),
|
47 |
+
'ace_theme-solarized_dark' => cssJSToolbox::getText('Solarized dark'),
|
48 |
+
'ace_theme-solarized_light' => cssJSToolbox::getText('Solarized Light'),
|
49 |
+
'ace_theme-terminal' => cssJSToolbox::getText('Terminal'),
|
50 |
+
'ace_theme-textmate' => cssJSToolbox::getText('Textmate'),
|
51 |
+
'ace_theme-tomorrow' => cssJSToolbox::getText('Tomorrow'),
|
52 |
+
'ace_theme-tomorrow_night' => cssJSToolbox::getText('Tomorrow Night'),
|
53 |
+
'ace_theme-tomorrow_night_blue' => cssJSToolbox::getText('Tomorrow Night Blue'),
|
54 |
+
'ace_theme-tomorrow_night_bright' => cssJSToolbox::getText('Tomorrow Night Bright'),
|
55 |
+
'ace_theme-tomorrow_night_eighties' => cssJSToolbox::getText('Tomorrow Night Eighties'),
|
56 |
+
'ace_theme-twilight' => cssJSToolbox::getText('Twilight'),
|
57 |
+
'ace_theme-vibrant_ink' => cssJSToolbox::getText('Vibrant Ink'),
|
58 |
+
'ace_theme-xcode' => cssJSToolbox::getText('XCode'),
|
59 |
);
|
views/blocks/block/public/js/menu/block.js
ADDED
@@ -0,0 +1,203 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
*
|
3 |
+
*
|
4 |
+
*
|
5 |
+
*/
|
6 |
+
|
7 |
+
(function($) {
|
8 |
+
|
9 |
+
/**
|
10 |
+
*
|
11 |
+
*
|
12 |
+
*
|
13 |
+
*/
|
14 |
+
CJTBlockMenu = function(block) {
|
15 |
+
|
16 |
+
/**
|
17 |
+
*
|
18 |
+
*/
|
19 |
+
this.block = block;
|
20 |
+
|
21 |
+
/**
|
22 |
+
* put your comment there...
|
23 |
+
*
|
24 |
+
*/
|
25 |
+
var _onclicked = function() {
|
26 |
+
// Initialize.
|
27 |
+
var blockBox = this.block.block.box;
|
28 |
+
// Switch only if not closed.
|
29 |
+
if (!blockBox.hasClass('closed')) {
|
30 |
+
CJTBlockMenuView.switchTo(blockBox.get(0));
|
31 |
+
}
|
32 |
+
};
|
33 |
+
|
34 |
+
this.ondeleteblock = function() {
|
35 |
+
// Don't delete MENU if it being appended under current block.
|
36 |
+
if (CJTBlockMenuView.block === this.block) {
|
37 |
+
CJTBlockMenuView.deattach();
|
38 |
+
}
|
39 |
+
};
|
40 |
+
|
41 |
+
/**
|
42 |
+
* File Menu
|
43 |
+
*/
|
44 |
+
this.file = new (function(menu) {
|
45 |
+
|
46 |
+
/**
|
47 |
+
*
|
48 |
+
*
|
49 |
+
*/
|
50 |
+
this.delete = function() {
|
51 |
+
// Delete Block.
|
52 |
+
block._ondelete();
|
53 |
+
};
|
54 |
+
|
55 |
+
/**
|
56 |
+
*
|
57 |
+
*/
|
58 |
+
this.load = function(method) {
|
59 |
+
// Initialize.
|
60 |
+
var model = menu.block.block;
|
61 |
+
var aceEditor = model.aceEditor;
|
62 |
+
var editSession = aceEditor.getSession();
|
63 |
+
// Process related file actions.
|
64 |
+
switch (method) {
|
65 |
+
case 'file': // Load file into block.
|
66 |
+
// Find popup element and clean it up.
|
67 |
+
var popup = $('#cjt-inline-popup').empty();
|
68 |
+
var file = $('<input type="file" id="block-file" />').appendTo(popup).change($.proxy(
|
69 |
+
function() {
|
70 |
+
if (window.FileReader) {
|
71 |
+
var reader = new window.FileReader();
|
72 |
+
var loaded = $.proxy(function(event) {
|
73 |
+
// Set value.
|
74 |
+
aceEditor.setValuePossibleUndo(event.target.result);
|
75 |
+
// Close popup.
|
76 |
+
tb_remove();
|
77 |
+
}, this);
|
78 |
+
reader.addEventListener('loadend', loaded);
|
79 |
+
reader.addEventListener('load', loaded);
|
80 |
+
// Read file x
|
81 |
+
reader.readAsText(file.get(0).files[0]);
|
82 |
+
}
|
83 |
+
}, this)
|
84 |
+
);
|
85 |
+
tb_show('Load Block From File', '?TB_inline&width=300&height=40&inlineId=cjt-inline-popup');
|
86 |
+
break;
|
87 |
+
case 'url':
|
88 |
+
var inUrl = prompt('Please enter Url to load code from');
|
89 |
+
if (inUrl) {
|
90 |
+
CJTBlocksPage.server.send('block', 'loadUrl', {url : inUrl}).done($.proxy(
|
91 |
+
function(url) {
|
92 |
+
aceEditor.setValuePossibleUndo(url.content);
|
93 |
+
}, this)
|
94 |
+
);
|
95 |
+
}
|
96 |
+
break;
|
97 |
+
default: // Load from server
|
98 |
+
var requestData = {
|
99 |
+
blockId : model.get('id'),
|
100 |
+
fileId : menu.block.codeFile.file.activeFileId,
|
101 |
+
returnAs : 'json'
|
102 |
+
};
|
103 |
+
CJTBlocksPage.server.send('block', 'downloadCodeFile', requestData)
|
104 |
+
.success($.proxy(
|
105 |
+
function(code) {
|
106 |
+
// Set value.
|
107 |
+
aceEditor.setValuePossibleUndo(code);
|
108 |
+
}, this)
|
109 |
+
);
|
110 |
+
break;
|
111 |
+
}
|
112 |
+
}
|
113 |
+
|
114 |
+
/**
|
115 |
+
*
|
116 |
+
*/
|
117 |
+
this.save = function(method) {
|
118 |
+
// initialize.
|
119 |
+
var block = menu.block;
|
120 |
+
// Process different save actions.
|
121 |
+
switch (method) {
|
122 |
+
case 'file': // Download Code File from server.
|
123 |
+
var model = block.block;
|
124 |
+
var requestData = {
|
125 |
+
blockId : model.get('id'),
|
126 |
+
fileId : block.codeFile.file.activeFileId,
|
127 |
+
returnAs : 'file'
|
128 |
+
};
|
129 |
+
// Get Download URL.
|
130 |
+
var codeFileURL = CJTBlocksPage.server.getRequestURL('block', 'downloadCodeFile', requestData);
|
131 |
+
// Download via new Window.
|
132 |
+
window.open(codeFileURL);
|
133 |
+
break;
|
134 |
+
default: // Save block
|
135 |
+
block._onsavechanges();
|
136 |
+
break;
|
137 |
+
}
|
138 |
+
};
|
139 |
+
|
140 |
+
})(this);
|
141 |
+
|
142 |
+
/**
|
143 |
+
*
|
144 |
+
*/
|
145 |
+
this.edit = new (function(menu) {
|
146 |
+
|
147 |
+
/**
|
148 |
+
* Directly execute ACE Command
|
149 |
+
*/
|
150 |
+
this.ace = function(command) {
|
151 |
+
// Ace Editor.
|
152 |
+
var model = menu.block.block;
|
153 |
+
var aceEditor = model.aceEditor;
|
154 |
+
// Exec command.
|
155 |
+
aceEditor.execCommand(command);
|
156 |
+
// Save ACE Settings
|
157 |
+
switch (command) {
|
158 |
+
case 'showSettingsMenu':
|
159 |
+
$('#ace_settingsmenu').parent().parent().click($.proxy(
|
160 |
+
function(event) {
|
161 |
+
if (event.shiftKey) { // Save with Shift!
|
162 |
+
model.set('aceEditorMenuSettings', aceEditor.getOptions());
|
163 |
+
}
|
164 |
+
}, this)
|
165 |
+
);
|
166 |
+
break;
|
167 |
+
}
|
168 |
+
}
|
169 |
+
|
170 |
+
})(this);
|
171 |
+
|
172 |
+
/**
|
173 |
+
*
|
174 |
+
*/
|
175 |
+
this.view = new (function(menu) {
|
176 |
+
|
177 |
+
/**
|
178 |
+
*
|
179 |
+
*/
|
180 |
+
this.statusVisible = false;
|
181 |
+
|
182 |
+
/**
|
183 |
+
* Directly execute ACE Command
|
184 |
+
*/
|
185 |
+
this.statusBar = function() {
|
186 |
+
if (!this.statusVisible) {
|
187 |
+
ace.config.loadModule(['ext', 'statusbar'], $.proxy(
|
188 |
+
function() {
|
189 |
+
var StatusBar = ace.require('ace/ext/statusbar').StatusBar;
|
190 |
+
var statusBar = new StatusBar(menu.block.block.aceEditor, menu.block.block.box.find('.inside').get(0));
|
191 |
+
}, this)
|
192 |
+
);
|
193 |
+
this.statusVisible = true;
|
194 |
+
}
|
195 |
+
}
|
196 |
+
|
197 |
+
})(this);
|
198 |
+
|
199 |
+
// Switch Menu item when block is clicked.
|
200 |
+
this.block.block.box.click($.proxy(_onclicked, this));
|
201 |
+
};
|
202 |
+
|
203 |
+
})(jQuery)
|
views/blocks/block/public/js/menu/menu.js
ADDED
@@ -0,0 +1,87 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
*
|
3 |
+
*
|
4 |
+
*
|
5 |
+
*/
|
6 |
+
|
7 |
+
(function($) {
|
8 |
+
|
9 |
+
/**
|
10 |
+
*
|
11 |
+
*
|
12 |
+
*
|
13 |
+
*/
|
14 |
+
CJTBlockMenuView = new function() {
|
15 |
+
|
16 |
+
/**
|
17 |
+
*
|
18 |
+
*/
|
19 |
+
this.block;
|
20 |
+
|
21 |
+
/**
|
22 |
+
*
|
23 |
+
*/
|
24 |
+
this.menu;
|
25 |
+
|
26 |
+
/**
|
27 |
+
*
|
28 |
+
*/
|
29 |
+
this.applyTheme = function(themeBlock) {
|
30 |
+
// Switch only if displayed for the current block that changing the theme.
|
31 |
+
if(themeBlock == this.block) {
|
32 |
+
this.menu.find('li>ul').css({'background-color' : this.block.theme.backgroundColor});
|
33 |
+
}
|
34 |
+
};
|
35 |
+
|
36 |
+
|
37 |
+
this.deattach = function() {
|
38 |
+
// Daettach.
|
39 |
+
this.block = null;
|
40 |
+
this.menu.css({'display' : 'none'}).detach();
|
41 |
+
};
|
42 |
+
|
43 |
+
/**
|
44 |
+
* put your comment there...
|
45 |
+
*
|
46 |
+
*/
|
47 |
+
this.initialize = function() {
|
48 |
+
// Menu Id.
|
49 |
+
var id = 'block-menu';
|
50 |
+
// Apply jQueryMenu.
|
51 |
+
this.menu = $('#' + id).menu({
|
52 |
+
'position' : {'my' : 'left top', 'at' : 'left bottom'},
|
53 |
+
'select' : $.proxy(
|
54 |
+
function (event, ui) {
|
55 |
+
// Get all parents menu.
|
56 |
+
var parents = $(ui.item).parentsUntil('div.cjt-block').filter('ul').prev('a').get().reverse();
|
57 |
+
var menuObject = this.block.menu;
|
58 |
+
// Reach menu object.
|
59 |
+
$.each(parents, function(index, parent) {
|
60 |
+
menuObject = menuObject[parent.href.split('#')[1]];
|
61 |
+
});
|
62 |
+
// Fire block event.
|
63 |
+
var itemKeyStruct = ui.item.find('a').prop('href').split('#')[1].split('-');
|
64 |
+
// Dipatch event handler.
|
65 |
+
menuObject[itemKeyStruct[0]](itemKeyStruct[1], event, ui);
|
66 |
+
return false;
|
67 |
+
}, this)
|
68 |
+
});
|
69 |
+
// chain.
|
70 |
+
return this;
|
71 |
+
};
|
72 |
+
|
73 |
+
/**
|
74 |
+
*
|
75 |
+
*/
|
76 |
+
this.switchTo = function(element) {
|
77 |
+
// Initialize.
|
78 |
+
this.block = element.CJTBlock;
|
79 |
+
// Display menu for that block.
|
80 |
+
this.block.elements.editBlockName.after(this.menu);
|
81 |
+
this.applyTheme(this.block);
|
82 |
+
this.menu.css({'display' : 'block'});
|
83 |
+
};
|
84 |
+
|
85 |
+
};
|
86 |
+
|
87 |
+
})(jQuery)
|
views/blocks/block/tmpl/codefile/codefile.html.tmpl
ADDED
@@ -0,0 +1,46 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<ul id="code-files-manager">
|
2 |
+
<li class="dialog-tool-buttons">
|
3 |
+
<a class="delete" href="#" title="<?php echo cssJSToolbox::getText('Delete all selected Code Files') ?>"><?php echo cssJSToolbox::getText('Delete') ?></a> |
|
4 |
+
<a class="close" href="#" title="<?php echo cssJSToolbox::getText('Close Code Files Manager Dialog') ?>"><?php echo cssJSToolbox::getText('Close') ?></a>
|
5 |
+
</li>
|
6 |
+
<li class="overlay"></li>
|
7 |
+
<li class="edit-code-file">
|
8 |
+
<input type="hidden" id="code-file-id" value="0" />
|
9 |
+
<fieldset>
|
10 |
+
<ul>
|
11 |
+
<li><label title="<?php echo cssJSToolbox::getText('Code File Name should be unique for each Block. Use simple names that describe fow what Code File is used for.') ?>" for="codef-file-name"><?php echo cssJSToolbox::getText('Name') ?></label><input id="code-file-name" type="text" /></li>
|
12 |
+
<li>
|
13 |
+
<label for="code-file-type" title="<?php echo cssJSToolbox::getText('Type tells CJT how to handle applying the Code File to the Associated Request. It also automatically switch Code Editor language for you.') ?>"><?php echo cssJSToolbox::getText('Type') ?></label>
|
14 |
+
<select id="code-file-type">
|
15 |
+
<option value=""></option>
|
16 |
+
<?php
|
17 |
+
// List template types.
|
18 |
+
$templateTypes =& cssJSToolbox::$config->templates->types;
|
19 |
+
foreach ($templateTypes as $typeName => $type) :
|
20 |
+
?>
|
21 |
+
<option value="<?php echo $typeName ?>"><?php echo $typeName ?></option>
|
22 |
+
<?php endforeach; ?>
|
23 |
+
</select>
|
24 |
+
</li>
|
25 |
+
<li>
|
26 |
+
<label for="code-file-tag" title="<?php echo cssJSToolbox::getText('Its automatically generated when the Type is changed. In most cases you won\'t need to modify it manually, only change it when you know how to works. Please point out to CJT Web site documentation for more details about TAG field.') ?>"><?php echo cssJSToolbox::getText('Tag') ?></label>
|
27 |
+
<textarea id="code-file-tag"></textarea>
|
28 |
+
</li>
|
29 |
+
<li>
|
30 |
+
<label for="code-file-description" title="<?php echo cssJSToolbox::getText('Optionally Code File notes.') ?>"><?php echo cssJSToolbox::getText('Description') ?></label>
|
31 |
+
<textarea id="code-file-description"></textarea>
|
32 |
+
</li>
|
33 |
+
<li>
|
34 |
+
<input type="button" id="code-file-save-button" value="<?php echo cssJSToolbox::getText('Save') ?>" />
|
35 |
+
<input type="button" id="code-file-cancel-button" value="<?php echo cssJSToolbox::getText('Close') ?>" />
|
36 |
+
</li>
|
37 |
+
</ul>
|
38 |
+
</fieldset>
|
39 |
+
</li>
|
40 |
+
<li class="code-file-item create-file-row"><a class="create-file" href="#"><?php echo cssJSToolbox::getText('Create File') ?> ...</a></li>
|
41 |
+
<li class="separator"></li>
|
42 |
+
<li class="quick-toolbar">
|
43 |
+
<input type="checkbox" class="select-code-file"> |
|
44 |
+
<a class="edit" href="#"><?php echo cssJSToolbox::getText('Edit') ?></a>
|
45 |
+
</li>
|
46 |
+
</ul>
|
views/blocks/block/tmpl/content.html.tmpl
ADDED
@@ -0,0 +1,31 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
*
|
4 |
+
*/
|
5 |
+
|
6 |
+
// Disallow direct access.
|
7 |
+
defined('ABSPATH') or die("Access denied");
|
8 |
+
?>
|
9 |
+
<?php
|
10 |
+
// Add activeFileId into codeFile object.
|
11 |
+
$this->block->file->activeFileId = $this->block->activeFileId;
|
12 |
+
// Hidden fields.
|
13 |
+
$fields = array('name', 'type', 'activeFileId');
|
14 |
+
foreach ($fields as $field) :
|
15 |
+
// Don't output until it has a value
|
16 |
+
// It better for traffic, client side
|
17 |
+
// should take care of this.
|
18 |
+
if (!$fieldValue = $this->block->file->$field) {
|
19 |
+
continue;
|
20 |
+
}
|
21 |
+
?>
|
22 |
+
<input type="hidden" name="cjtoolbox[<?php echo $this->block->id; ?>][file][<?php echo $field ?>]" value="<?php echo $fieldValue ?>" />
|
23 |
+
<?php endforeach; ?>
|
24 |
+
<div class="cjcontainer">
|
25 |
+
<div class="cjcodeblock">
|
26 |
+
<?php echo $this->getTemplate('editor-toolbox', array(), 'tmpl/templates'); ?>
|
27 |
+
<div class="datablock">
|
28 |
+
<div id="editor-<?php echo $this->block->id ?>" class="code-editor"><?php echo htmlentities($this->block->file->code, null, 'UTF-8') ?></div>
|
29 |
+
</div>
|
30 |
+
</div>
|
31 |
+
</div>
|
views/blocks/block/tmpl/edit.html.tmpl
CHANGED
@@ -17,25 +17,13 @@ defined('ABSPATH') or die("Access denied");
|
|
17 |
<input type="hidden" name="blocks[]" value="<?php echo $this->block->id ?>" />
|
18 |
<?php
|
19 |
// Hidden fields.
|
20 |
-
$fields = array('name', 'state','location');
|
21 |
foreach ($fields as $field) :
|
22 |
?>
|
23 |
<input type="hidden" name="cjtoolbox[<?php echo $this->block->id; ?>][<?php echo $field ?>]" value="<?php echo $this->block->$field ?>" />
|
24 |
<?php endforeach; ?>
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
$codeLoadedSignClass = '';
|
31 |
-
$blockId = "cjtoolbox-{$this->block->id}";
|
32 |
-
$closedMetaboxes = get_user_meta(get_current_user_id(), 'closedpostboxes_cjtoolbox', true);
|
33 |
-
if (!in_array($blockId, ((array) $closedMetaboxes))) {
|
34 |
-
$code = htmlentities($this->block->code, null, 'UTF-8');
|
35 |
-
$codeLoadedSignClass = ' initially-loaded';
|
36 |
-
}
|
37 |
-
?>
|
38 |
-
<div id="editor-<?php echo $this->block->id ?>" class="code-editor<?php echo $codeLoadedSignClass ?>"><?php echo $code ?></div>
|
39 |
-
</div>
|
40 |
-
</div>
|
41 |
-
</div>
|
17 |
<input type="hidden" name="blocks[]" value="<?php echo $this->block->id ?>" />
|
18 |
<?php
|
19 |
// Hidden fields.
|
20 |
+
$fields = array('name', 'state', 'location');
|
21 |
foreach ($fields as $field) :
|
22 |
?>
|
23 |
<input type="hidden" name="cjtoolbox[<?php echo $this->block->id; ?>][<?php echo $field ?>]" value="<?php echo $this->block->$field ?>" />
|
24 |
<?php endforeach; ?>
|
25 |
+
<?php
|
26 |
+
if (!$this->isClosed) {
|
27 |
+
echo $this->getTemplate('content');
|
28 |
+
}
|
29 |
+
?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
views/blocks/block/tmpl/menu/menu.html.tmpl
ADDED
@@ -0,0 +1,51 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<ul id="block-menu">
|
2 |
+
<li>
|
3 |
+
<a href="#file"><?php echo cssJSToolbox::getText('File') ?></a>
|
4 |
+
<ul>
|
5 |
+
<li><a href="#load"><?php echo cssJSToolbox::getText('ReLoad') ?></a></li>
|
6 |
+
<li><a href="#load-file"><?php echo cssJSToolbox::getText('Load Local') ?></a></li>
|
7 |
+
<li><a href="#load-url"><?php echo cssJSToolbox::getText('Load Url') ?></a></li>
|
8 |
+
<li></li>
|
9 |
+
<li><a href="#save"><?php echo cssJSToolbox::getText('Save') ?></a></li>
|
10 |
+
<li><a href="#save-file"><?php echo cssJSToolbox::getText('Save File') ?></a></li>
|
11 |
+
<li></li>
|
12 |
+
<li><a href="#delete"><?php echo cssJSToolbox::getText('Delete') ?></a></li>
|
13 |
+
</ul>
|
14 |
+
</li>
|
15 |
+
<li>
|
16 |
+
<a href="#edit"><?php echo cssJSToolbox::getText('Edit') ?></a>
|
17 |
+
<ul>
|
18 |
+
<li><a href="#ace-undo"><?php echo cssJSToolbox::getText('Undo') ?></a></li>
|
19 |
+
<li><a href="#ace-redo"><?php echo cssJSToolbox::getText('Redo') ?></a></li>
|
20 |
+
<li></li>
|
21 |
+
<li><a href="#ace-find"><?php echo cssJSToolbox::getText('Find') ?></a></li>
|
22 |
+
<li><a href="#ace-findnext"><?php echo cssJSToolbox::getText('Find Next') ?></a></li>
|
23 |
+
<li><a href="#ace-findprevious"><?php echo cssJSToolbox::getText('Find Previous') ?></a></li>
|
24 |
+
<li></li>
|
25 |
+
<li><a href="#ace-replace"><?php echo cssJSToolbox::getText('Replace') ?></a></li>
|
26 |
+
<li></li>
|
27 |
+
<li><a href="#ace-gotoline"><?php echo cssJSToolbox::getText('Go To Line') ?></a></li>
|
28 |
+
<li><a href="#ace-golineup"><?php echo cssJSToolbox::getText('Go Line Up') ?></a></li>
|
29 |
+
<li><a href="#ace-golinedown"><?php echo cssJSToolbox::getText('Go Line down') ?></a></li>
|
30 |
+
<li></li>
|
31 |
+
<li><a href="#ace-goToNextError"><?php echo cssJSToolbox::getText('Go To Next Error') ?></a></li>
|
32 |
+
<li><a href="#ace-goToPreviousError"><?php echo cssJSToolbox::getText('Go To Previous Error') ?></a></li>
|
33 |
+
<li></li>
|
34 |
+
<li><a href="#ace-fold"><?php echo cssJSToolbox::getText('Fold') ?></a></li>
|
35 |
+
<li><a href="#ace-foldall"><?php echo cssJSToolbox::getText('Fold All') ?></a></li>
|
36 |
+
<li><a href="#ace-unfold"><?php echo cssJSToolbox::getText('UnFold') ?></a></li>
|
37 |
+
<li><a href="#ace-unfoldall"><?php echo cssJSToolbox::getText('UnFold All') ?></a></li>
|
38 |
+
<li></li>
|
39 |
+
<li><a href="#ace-tolowercase"><?php echo cssJSToolbox::getText('To Lower Case') ?></a></li>
|
40 |
+
<li><a href="#ace-touppercase"><?php echo cssJSToolbox::getText('To Upper Case') ?></a></li>
|
41 |
+
<li></li>
|
42 |
+
<li><a href="#ace-showSettingsMenu"><?php echo cssJSToolbox::getText('Settings') ?></a></li>
|
43 |
+
</ul>
|
44 |
+
</li>
|
45 |
+
<li>
|
46 |
+
<a href="#view"><?php echo cssJSToolbox::getText('View') ?></a>
|
47 |
+
<ul>
|
48 |
+
<li><a href="#statusBar"><?php echo cssJSToolbox::getText('Status Bar') ?></a></li>
|
49 |
+
</ul>
|
50 |
+
</li>
|
51 |
+
</ul>
|
views/blocks/block/tmpl/templates/editor-toolbox.html.tmpl
ADDED
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
*
|
4 |
+
*/
|
5 |
+
|
6 |
+
// Disallow direct access.
|
7 |
+
defined('ABSPATH') or die('Restricted Access');
|
8 |
+
?>
|
9 |
+
<div class="cjt-toolbox editor-toolbox">
|
10 |
+
<div class="icons-group">
|
11 |
+
<a href="#" class="cjt-tb-link cjttbl-fullscreen" title="<?php echo $this->localization['screenmode_Title'] ?>"></a>
|
12 |
+
<a href="#" class="cjt-tb-link cjttbl-editor-theme" title="<?php echo cssJSToolbox::getText('Switch Editor Theme') ?>"></a>
|
13 |
+
<a href="#" class="cjt-tb-link cjttbl-font-large" title="<?php echo cssJSToolbox::getText('Increase font size in code editor') ?>"></a>
|
14 |
+
<a href="#" class="cjt-tb-link cjttbl-font-small" title="<?php echo cssJSToolbox::getText('Decrease font size in code editor') ?>"></a>
|
15 |
+
<a href="#" class="cjt-tb-link cjttbl-reset-font" title="<?php echo cssJSToolbox::getText('Reset font size in code editor') ?>"></a>
|
16 |
+
<a href="#" class="cjt-tb-link cjttbl-clear-block" title="<?php echo cssJSToolbox::getText('Clear all text in code editor. To undo, click Command-Z for Mac or Ctrl-Z for Windows. Click Save to permanently take affect') ?>"></a>
|
17 |
+
</div>
|
18 |
+
</div>
|
views/blocks/block/tmpl/templates/toolbox.html.tmpl
CHANGED
@@ -1,26 +1,37 @@
|
|
1 |
<div class="cjt-toolbox block-toolbox">
|
|
|
|
|
2 |
<div class="icons-group">
|
3 |
<a href="#" class="cjt-tb-link cjttbl-state-switch state-<?php echo $this->block->state ?>" title="<?php echo $this->localization["state_{$this->block->state}Title"] ?>"></a>
|
4 |
<a href="#" class="cjt-tb-link cjttbl-location-switch location-<?php echo $this->block->location ?>" title="<?php echo $this->localization["location_{$this->block->location}Title"] ?>"></a>
|
5 |
</div>
|
6 |
-
|
|
|
|
|
7 |
<div class="icons-group big-bar">
|
8 |
-
|
|
|
|
|
|
|
|
|
9 |
<a href="#" class="cjt-tb-link cjttbl-info" title="<?php echo cssJSToolbox::getText('Show code block information') ?>"></a>
|
10 |
-
|
11 |
-
<a href="#" class="cjt-tb-link cjttbl-switch-editor-language" title="<?php echo cssJSToolbox::getText('Set editing language for syntax highlighting') ?>"></a>
|
12 |
<div class="popup-menu editor-langs" style="display:none">
|
13 |
<a href="#" class="cjt-tb-link cjt-tb-text-link cjttbl-editor-language-css" title="<?php echo cssJSToolbox::getText('Set editing language to CSS') ?>"><?php echo cssJSToolbox::getText('Cascading Style Sheets') ?></a>
|
14 |
<a href="#" class="cjt-tb-link cjt-tb-text-link cjttbl-editor-language-html" title="<?php echo cssJSToolbox::getText('Set editing language to HTML') ?>"><?php echo cssJSToolbox::getText('Hyper Text Markup Language') ?></a>
|
15 |
<a href="#" class="cjt-tb-link cjt-tb-text-link cjttbl-editor-language-javascript" title="<?php echo cssJSToolbox::getText('Set editing language to JavaScript') ?>"><?php echo cssJSToolbox::getText('javascript') ?></a>
|
16 |
<a href="#" class="cjt-tb-link cjt-tb-text-link cjttbl-editor-language-php" title="<?php echo cssJSToolbox::getText('Set editing language to PHP') ?>"><?php echo cssJSToolbox::getText('PHP: Hypertext Preprocessor') ?></a>
|
17 |
</div>
|
18 |
-
|
19 |
<a href="#" class="cjt-tb-link cjttbl-edit-name" title="<?php echo cssJSToolbox::getText('Edit code block title. Click Save to take affect') ?>"></a>
|
|
|
20 |
<a href="#" class="cjt-tb-link cjttbl-delete" title="<?php echo cssJSToolbox::getText('Delete code block') ?>"></a>
|
21 |
</div>
|
22 |
-
|
|
|
|
|
23 |
<div class="icons-group">
|
24 |
-
<a href="#" class="cjt-tb-link cjttbl-save il-60x23" title="<?php echo cssJSToolbox::getText('Save changes to code block') ?>"><?php echo cssJSToolbox::getText('Save') ?></a>
|
25 |
</div>
|
26 |
</div>
|
1 |
<div class="cjt-toolbox block-toolbox">
|
2 |
+
<div class="empty-divider"></div>
|
3 |
+
|
4 |
<div class="icons-group">
|
5 |
<a href="#" class="cjt-tb-link cjttbl-state-switch state-<?php echo $this->block->state ?>" title="<?php echo $this->localization["state_{$this->block->state}Title"] ?>"></a>
|
6 |
<a href="#" class="cjt-tb-link cjttbl-location-switch location-<?php echo $this->block->location ?>" title="<?php echo $this->localization["location_{$this->block->location}Title"] ?>"></a>
|
7 |
</div>
|
8 |
+
|
9 |
+
<div class="empty-divider"></div>
|
10 |
+
|
11 |
<div class="icons-group big-bar">
|
12 |
+
<a href="#" class="cjt-tb-link waitingToLoad cjttbl-templates-lookup" title="<?php echo cssJSToolbox::getText('Template Lookup - Embed or link templates to code blocks') ?>"></a>
|
13 |
+
<iframe src="" class="popup-menu templates-lookup" NOBORDER="1" style="display:none"></iframe>
|
14 |
+
|
15 |
+
<a href="#" class="cjt-tb-link waitingToLoad cjttbl-link-external" title="<?php echo cssJSToolbox::getText('Link external') ?>"></a>
|
16 |
+
|
17 |
<a href="#" class="cjt-tb-link cjttbl-info" title="<?php echo cssJSToolbox::getText('Show code block information') ?>"></a>
|
18 |
+
|
19 |
+
<a href="#" class="cjt-tb-link waitingToLoad cjttbl-switch-editor-language" title="<?php echo cssJSToolbox::getText('Set editing language for syntax highlighting') ?>"></a>
|
20 |
<div class="popup-menu editor-langs" style="display:none">
|
21 |
<a href="#" class="cjt-tb-link cjt-tb-text-link cjttbl-editor-language-css" title="<?php echo cssJSToolbox::getText('Set editing language to CSS') ?>"><?php echo cssJSToolbox::getText('Cascading Style Sheets') ?></a>
|
22 |
<a href="#" class="cjt-tb-link cjt-tb-text-link cjttbl-editor-language-html" title="<?php echo cssJSToolbox::getText('Set editing language to HTML') ?>"><?php echo cssJSToolbox::getText('Hyper Text Markup Language') ?></a>
|
23 |
<a href="#" class="cjt-tb-link cjt-tb-text-link cjttbl-editor-language-javascript" title="<?php echo cssJSToolbox::getText('Set editing language to JavaScript') ?>"><?php echo cssJSToolbox::getText('javascript') ?></a>
|
24 |
<a href="#" class="cjt-tb-link cjt-tb-text-link cjttbl-editor-language-php" title="<?php echo cssJSToolbox::getText('Set editing language to PHP') ?>"><?php echo cssJSToolbox::getText('PHP: Hypertext Preprocessor') ?></a>
|
25 |
</div>
|
26 |
+
|
27 |
<a href="#" class="cjt-tb-link cjttbl-edit-name" title="<?php echo cssJSToolbox::getText('Edit code block title. Click Save to take affect') ?>"></a>
|
28 |
+
<a href="#" class="cjt-tb-link waitingToLoad cjttbl-revisions" title="<?php echo cssJSToolbox::getText('View and restore code block revisions') ?>"></a>
|
29 |
<a href="#" class="cjt-tb-link cjttbl-delete" title="<?php echo cssJSToolbox::getText('Delete code block') ?>"></a>
|
30 |
</div>
|
31 |
+
|
32 |
+
<div class="empty-divider"></div>
|
33 |
+
|
34 |
<div class="icons-group">
|
35 |
+
<a href="#" class="cjt-tb-link waitingToLoad cjttbl-save il-60x23" title="<?php echo cssJSToolbox::getText('Save changes to code block') ?>"><?php echo cssJSToolbox::getText('Save') ?></a>
|
36 |
</div>
|
37 |
</div>
|
views/blocks/block/view.php
CHANGED
@@ -21,6 +21,13 @@ class CJTBlocksBlockView extends CJTView {
|
|
21 |
*/
|
22 |
public $block = null;
|
23 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
24 |
/**
|
25 |
* put your comment there...
|
26 |
*
|
@@ -61,9 +68,9 @@ class CJTBlocksBlockView extends CJTView {
|
|
61 |
* put your comment there...
|
62 |
*
|
63 |
*/
|
64 |
-
public function display() {
|
65 |
// Import template.
|
66 |
-
echo $this->getTemplate($this->templateName);
|
67 |
}
|
68 |
|
69 |
/**
|
@@ -73,7 +80,8 @@ class CJTBlocksBlockView extends CJTView {
|
|
73 |
public static function enqueueScripts() {
|
74 |
// Use related scripts.
|
75 |
self::useScripts(__CLASS__,
|
76 |
-
'jquery',
|
|
|
77 |
'common',
|
78 |
'wp-lists',
|
79 |
'postbox',
|
@@ -84,9 +92,14 @@ class CJTBlocksBlockView extends CJTView {
|
|
84 |
'framework:js:ajax:{CJT-}cjt-server-queue',
|
85 |
'framework:js:ui:{CJT-}jquery.toolbox',
|
86 |
'framework:js:ace(loadMethod=Tag, lookFor=ace)',
|
|
|
87 |
'views:blocks:block:public:js:{CJT-}ajax',
|
88 |
'views:blocks:block:public:js:{CJT-}blockproperty',
|
89 |
'views:blocks:block:public:js:optional:{CJT-}revision',
|
|
|
|
|
|
|
|
|
90 |
'views:blocks:block:public:js:{CJT-}block',
|
91 |
'views:blocks:block:public:js:{CJT-}jquery.block'
|
92 |
);
|
@@ -98,7 +111,12 @@ class CJTBlocksBlockView extends CJTView {
|
|
98 |
*/
|
99 |
public static function enqueueStyles() {
|
100 |
// Initialize style.
|
101 |
-
$styles = array(
|
|
|
|
|
|
|
|
|
|
|
102 |
// IF WP < 3.8 add compatibility CSS file.
|
103 |
$wpVersion = new CJT_Framework_Wordpress_Currentversion();
|
104 |
if ($wpVersion->isLess('3.8')) {
|
@@ -148,7 +166,12 @@ class CJTBlocksBlockView extends CJTView {
|
|
148 |
*
|
149 |
*/
|
150 |
public function setBlock($block) {
|
|
|
151 |
$this->block = $block;
|
|
|
|
|
|
|
|
|
152 |
}
|
153 |
|
154 |
/**
|
21 |
*/
|
22 |
public $block = null;
|
23 |
|
24 |
+
/**
|
25 |
+
* put your comment there...
|
26 |
+
*
|
27 |
+
* @var mixed
|
28 |
+
*/
|
29 |
+
public $isClosed;
|
30 |
+
|
31 |
/**
|
32 |
* put your comment there...
|
33 |
*
|
68 |
* put your comment there...
|
69 |
*
|
70 |
*/
|
71 |
+
public function display($template = null) {
|
72 |
// Import template.
|
73 |
+
echo $this->getTemplate($template ? $template : $this->templateName);
|
74 |
}
|
75 |
|
76 |
/**
|
80 |
public static function enqueueScripts() {
|
81 |
// Use related scripts.
|
82 |
self::useScripts(__CLASS__,
|
83 |
+
'jquery',
|
84 |
+
'jquery-ui-menu',
|
85 |
'common',
|
86 |
'wp-lists',
|
87 |
'postbox',
|
92 |
'framework:js:ajax:{CJT-}cjt-server-queue',
|
93 |
'framework:js:ui:{CJT-}jquery.toolbox',
|
94 |
'framework:js:ace(loadMethod=Tag, lookFor=ace)',
|
95 |
+
'framework:js:ace:{CJT-}pluggable',
|
96 |
'views:blocks:block:public:js:{CJT-}ajax',
|
97 |
'views:blocks:block:public:js:{CJT-}blockproperty',
|
98 |
'views:blocks:block:public:js:optional:{CJT-}revision',
|
99 |
+
'views:blocks:block:public:js:{CJT-}menu',
|
100 |
+
'views:blocks:block:public:js:menu:{CJT-}_block',
|
101 |
+
'views:blocks:block:public:js:{CJT-}codefile-manager',
|
102 |
+
'views:blocks:block:public:js:{CJT-}codefile',
|
103 |
'views:blocks:block:public:js:{CJT-}block',
|
104 |
'views:blocks:block:public:js:{CJT-}jquery.block'
|
105 |
);
|
111 |
*/
|
112 |
public static function enqueueStyles() {
|
113 |
// Initialize style.
|
114 |
+
$styles = array(
|
115 |
+
'thickbox',
|
116 |
+
'views:blocks:block:public:css:{CJT-}block',
|
117 |
+
'views:blocks:block:public:css:{CJT-}menu',
|
118 |
+
'views:blocks:block:public:css:{CJT-}codefile'
|
119 |
+
);
|
120 |
// IF WP < 3.8 add compatibility CSS file.
|
121 |
$wpVersion = new CJT_Framework_Wordpress_Currentversion();
|
122 |
if ($wpVersion->isLess('3.8')) {
|
166 |
*
|
167 |
*/
|
168 |
public function setBlock($block) {
|
169 |
+
// Set block.
|
170 |
$this->block = $block;
|
171 |
+
// Get block state (opened/closes)
|
172 |
+
$closedBlockId = "cjtoolbox-{$this->block->id}";
|
173 |
+
$closedMetaboxes = get_user_meta(get_current_user_id(), 'closedpostboxes_cjtoolbox', true);
|
174 |
+
$this->isClosed = in_array($closedBlockId, ((array) $closedMetaboxes));
|
175 |
}
|
176 |
|
177 |
/**
|
views/blocks/cjt-block/public/css/block.css
CHANGED
@@ -1,19 +1,23 @@
|
|
1 |
.postbox .inside { margin-right: 6px !important; }
|
2 |
/** reserve Objects Panel space */
|
3 |
-
.cjcodeblock {margin-right:
|
|
|
|
|
|
|
4 |
/* Pages Panel */
|
5 |
.cjpageblock {width: 315px; height: 100%; position: absolute; right: 3px;}
|
|
|
|
|
|
|
6 |
.pagelist {
|
7 |
padding:10px;
|
8 |
-
height:
|
9 |
overflow:auto;
|
10 |
-
|
11 |
-
border:1px solid #ccc;
|
12 |
margin-bottom: 0px;
|
13 |
margin-top: 8px;
|
14 |
}
|
15 |
/* Wrap long text */
|
16 |
-
.pagelist a{color: black; text-decoration: none;}
|
17 |
.select-childs {
|
18 |
position: relative;
|
19 |
left: -1px;
|
@@ -36,7 +40,7 @@
|
|
36 |
}
|
37 |
.select-childs-checkbox-overlay:hover {opacity: 0.5; filter: alpha(opacity = 50);}
|
38 |
|
39 |
-
.pagelist
|
40 |
.pagelist>li>span {width: 203px;overflow: hidden; display: inline-block; height: 21px; vertical-align: middle;}
|
41 |
.pagelist li span>a {margin-left: 4px;}
|
42 |
.pagelist li { line-height:19px; word-wrap:break-word; margin:0; padding:0; }
|
@@ -44,8 +48,11 @@
|
|
44 |
.list-error {font-size: 12px;text-align: center;margin-top: 41px;text-decoration: underline;}
|
45 |
.list-error .message{font-weight: bold;}
|
46 |
.pagelist ul { margin-left:15px; }
|
|
|
|
|
|
|
47 |
|
48 |
-
|
49 |
|
50 |
.info-panel {
|
51 |
display: none;
|
@@ -95,19 +102,21 @@ a.acc-header:visited,
|
|
95 |
color: #A5581B;
|
96 |
font-weight: bold;
|
97 |
}
|
|
|
|
|
98 |
/**
|
99 |
* Custom Posts jQuery Accordion
|
100 |
*/
|
101 |
.custom-posts-container {
|
102 |
-
|
103 |
margin-top: 9px;
|
104 |
-
height:
|
105 |
padding: 6px;
|
106 |
overflow: auto;
|
107 |
}
|
108 |
.custom-posts-container .custom-post-list {display: none; padding-bottom: 8px;}
|
109 |
.custom-posts-container .ui-accordion-content {height: 258px;}
|
110 |
-
.custom-posts-container .pagelist {height:
|
111 |
.custom-posts-container a.custom-post-item-header {
|
112 |
text-decoration: underline;
|
113 |
margin-bottom: 2px;
|
@@ -116,18 +125,29 @@ a.acc-header:visited,
|
|
116 |
/**
|
117 |
* Advanced Tab jQuery Accordion
|
118 |
*/
|
119 |
-
.advanced-accordion
|
|
|
120 |
.advanced-accordion .ui-accordion-header-active {color: #a5581b !important;}
|
121 |
.advanced-accordion textarea {
|
122 |
-
height:
|
123 |
width: 282px;
|
124 |
max-width: 282px;
|
125 |
margin-top: 4px;
|
126 |
overflow: auto;
|
127 |
white-space: nowrap;
|
128 |
text-decoration: underline;
|
|
|
|
|
|
|
129 |
}
|
130 |
-
.advanced-accordion a.acc-header {padding: 7px 4px;}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
131 |
/*
|
132 |
* jQuery UI Tabs 1.8.16
|
133 |
*
|
@@ -137,14 +157,25 @@ a.acc-header:visited,
|
|
137 |
*
|
138 |
* http://docs.jquery.com/UI/Tabs#theming
|
139 |
*/
|
140 |
-
|
141 |
-
.cjpageblock .ui-tabs-
|
142 |
-
|
143 |
-
.cjpageblock .ui-tabs .ui-tabs-nav li
|
144 |
-
|
145 |
-
.cjpageblock .ui-tabs
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
146 |
.cjpageblock .ui-tabs .ui-tabs-nav li.ui-tabs-selected { margin-bottom: 0; padding-bottom: 1px; }
|
147 |
.cjpageblock .ui-tabs .ui-tabs-nav li.ui-tabs-selected a, .ui-tabs .ui-tabs-nav li.ui-state-disabled a, .ui-tabs .ui-tabs-nav li.ui-state-processing a { cursor: text; background:#E9E9E9; border-color:#CCCCCC #CCCCCC #E9E9E9; color:#333333; }
|
148 |
-
|
149 |
-
.cjpageblock .ui-tabs .ui-tabs-panel {height:
|
150 |
.cjpageblock .ui-tabs .ui-tabs-hide { display: none !important; }
|
1 |
.postbox .inside { margin-right: 6px !important; }
|
2 |
/** reserve Objects Panel space */
|
3 |
+
.cjcodeblock {margin-right:310px;}
|
4 |
+
/** Editor toolbox **/
|
5 |
+
.editor-toolbox a.cjttbl-toggle-objects-panel {background-image: url(../images/editor-toolbox/close-panel.png);}
|
6 |
+
.editor-toolbox a.cjttbl-toggle-objects-panel.closed {background-image: url(../images/editor-toolbox/open-panel.png);}
|
7 |
/* Pages Panel */
|
8 |
.cjpageblock {width: 315px; height: 100%; position: absolute; right: 3px;}
|
9 |
+
|
10 |
+
.cjpageblock .ui-tabs-panel {color: #7c7c7c !important;}
|
11 |
+
|
12 |
.pagelist {
|
13 |
padding:10px;
|
14 |
+
height: 248px;
|
15 |
overflow:auto;
|
16 |
+
border:1px solid #bbb;
|
|
|
17 |
margin-bottom: 0px;
|
18 |
margin-top: 8px;
|
19 |
}
|
20 |
/* Wrap long text */
|
|
|
21 |
.select-childs {
|
22 |
position: relative;
|
23 |
left: -1px;
|
40 |
}
|
41 |
.select-childs-checkbox-overlay:hover {opacity: 0.5; filter: alpha(opacity = 50);}
|
42 |
|
43 |
+
.pagelist input[type=checkbox] {background-color: transparent;}
|
44 |
.pagelist>li>span {width: 203px;overflow: hidden; display: inline-block; height: 21px; vertical-align: middle;}
|
45 |
.pagelist li span>a {margin-left: 4px;}
|
46 |
.pagelist li { line-height:19px; word-wrap:break-word; margin:0; padding:0; }
|
48 |
.list-error {font-size: 12px;text-align: center;margin-top: 41px;text-decoration: underline;}
|
49 |
.list-error .message{font-weight: bold;}
|
50 |
.pagelist ul { margin-left:15px; }
|
51 |
+
a.l_ext { position: relative; top: 3px; background:url(../images/pages-panel/external_link.png) no-repeat; width:18px; height:13px; display:inline-block; }
|
52 |
+
/** Fullscreen mode */
|
53 |
+
.postbox.fullscreen .cjpageblock {z-index: 31; right: 10px;}
|
54 |
|
55 |
+
.listing-options {top: -28px; left: 1px; position: relative;}
|
56 |
|
57 |
.info-panel {
|
58 |
display: none;
|
102 |
color: #A5581B;
|
103 |
font-weight: bold;
|
104 |
}
|
105 |
+
a.acc-header.ui-accordion-header-active {color: #652200 !important;}
|
106 |
+
|
107 |
/**
|
108 |
* Custom Posts jQuery Accordion
|
109 |
*/
|
110 |
.custom-posts-container {
|
111 |
+
border: 1px solid #bbb;
|
112 |
margin-top: 9px;
|
113 |
+
height: 256px;
|
114 |
padding: 6px;
|
115 |
overflow: auto;
|
116 |
}
|
117 |
.custom-posts-container .custom-post-list {display: none; padding-bottom: 8px;}
|
118 |
.custom-posts-container .ui-accordion-content {height: 258px;}
|
119 |
+
.custom-posts-container .pagelist {height: 191px; margin-top: 2px; margin-left: 5px; border: none; padding-top: 0px;}
|
120 |
.custom-posts-container a.custom-post-item-header {
|
121 |
text-decoration: underline;
|
122 |
margin-bottom: 2px;
|
125 |
/**
|
126 |
* Advanced Tab jQuery Accordion
|
127 |
*/
|
128 |
+
.advanced-accordion {border: 1px solid #ccc}
|
129 |
+
.advanced-accordion .ui-accordion-content {height: 204px; padding: 0px !important; background: none !important; border: none !important}}
|
130 |
.advanced-accordion .ui-accordion-header-active {color: #a5581b !important;}
|
131 |
.advanced-accordion textarea {
|
132 |
+
height: 196px;
|
133 |
width: 282px;
|
134 |
max-width: 282px;
|
135 |
margin-top: 4px;
|
136 |
overflow: auto;
|
137 |
white-space: nowrap;
|
138 |
text-decoration: underline;
|
139 |
+
margin-left: 7px;
|
140 |
+
background-color: transparent;
|
141 |
+
color: #7c7c7c;
|
142 |
}
|
143 |
+
.advanced-accordion a.acc-header {padding: 7px 4px; background: none !important; border: none !important}
|
144 |
+
|
145 |
+
.advanced-accordion a.acc-header {color: #a5581b !important;}
|
146 |
+
|
147 |
+
.advanced-accordion a.acc-header:hover {color: #c8671b !important;}
|
148 |
+
|
149 |
+
.ui-accordion .ui-accordion-header .ui-icon {background: none !important;}
|
150 |
+
|
151 |
/*
|
152 |
* jQuery UI Tabs 1.8.16
|
153 |
*
|
157 |
*
|
158 |
* http://docs.jquery.com/UI/Tabs#theming
|
159 |
*/
|
160 |
+
|
161 |
+
.cjpageblock .ui-tabs .ui-tabs-nav li.ui-tabs-active a {color: #a5581b !important; border-color: #a5581b;}
|
162 |
+
|
163 |
+
.cjpageblock .ui-tabs .ui-tabs-nav li.ui-tabs-active a.prog-colored {color: transparent !important;}
|
164 |
+
|
165 |
+
.cjpageblock .ui-tabs { background: none !important; border: none !important; padding: 0px !important; position: relative; zoom: 1; height: 100%; } /* position: relative prevents IE scroll bug (element with position: relative inside container with overflow: auto appear as "fixed") */
|
166 |
+
|
167 |
+
.ui-helper-clearfix:after {content: initial !important;}
|
168 |
+
|
169 |
+
.cjpageblock .ui-tabs .ui-tabs-nav { background: none !important; border: none !important; padding: 0px !important; max-width: 315px; max-height: 80px; margin: 11px 0 0 0;}
|
170 |
+
|
171 |
+
.cjpageblock .ui-tabs .ui-tabs-nav li { border: none !important; position: static !important; float: none !important; list-style: none; top: 1px; margin: 0 .2em 1px 0; padding: 0; white-space: nowrap; }
|
172 |
+
|
173 |
+
/*-moz-border-radius:3px 3px 0 0;-webkit-border-top-right-radius:3px;-webkit-border-top-left-radius:3px;-khtml-border-top-right-radius:3px;-khtml-border-top-left-radius:3px;border-top-right-radius:3px;border-top-left-radius:3px;*/
|
174 |
+
.cjpageblock .ui-tabs .ui-tabs-nav li a {font-family: "Open Sans",sans-serif; height:18px;margin:1px 1px 0 0;float:right;cursor:pointer;border: 1px solid #bbb;border-bottom: 0 !important; font-size: 12px; float: left; padding: 6px 17px; text-decoration: none;}
|
175 |
+
.cjpageblock .ui-tabs .ui-tabs-nav li a, .ui-tabs.ui-tabs-collapsible .ui-tabs-nav li.ui-tabs-selected a { cursor: pointer; } /* first selector in group seems obsolete, but required to overcome bug in Opera applying cursor: text overall if defined elsewhere... */
|
176 |
+
|
177 |
.cjpageblock .ui-tabs .ui-tabs-nav li.ui-tabs-selected { margin-bottom: 0; padding-bottom: 1px; }
|
178 |
.cjpageblock .ui-tabs .ui-tabs-nav li.ui-tabs-selected a, .ui-tabs .ui-tabs-nav li.ui-state-disabled a, .ui-tabs .ui-tabs-nav li.ui-state-processing a { cursor: text; background:#E9E9E9; border-color:#CCCCCC #CCCCCC #E9E9E9; color:#333333; }
|
179 |
+
|
180 |
+
.cjpageblock .ui-tabs .ui-tabs-panel {height: 300px; display: block; clear:both; padding: 0px !important;}
|
181 |
.cjpageblock .ui-tabs .ui-tabs-hide { display: none !important; }
|
views/blocks/cjt-block/public/images/editor-toolbox/close-panel.png
ADDED
Binary file
|
views/blocks/cjt-block/public/images/editor-toolbox/open-panel.png
ADDED
Binary file
|
views/blocks/cjt-block/public/js/block/block.js
CHANGED
@@ -14,33 +14,29 @@ var CJTBlock;
|
|
14 |
* @param element
|
15 |
*/
|
16 |
CJTBlock = function(blockPlugin, element) {
|
17 |
-
|
18 |
// Constructor.
|
19 |
-
this.CJTBlock = function() {
|
|
|
|
|
|
|
|
|
|
|
|
|
20 |
var properties = {};
|
21 |
// Define CJTBlock properties for assignment panel.
|
22 |
-
properties.links = {om : new CJTBlockPropertyHTMLNodeOM(),
|
23 |
-
|
24 |
-
|
25 |
-
properties.
|
26 |
-
|
27 |
-
|
28 |
-
properties.
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
flags: 'rws',
|
33 |
-
selector : 'input:checkbox[name="cjtoolbox[{blockId}][pages][]"]'},
|
34 |
-
properties.posts = {om : new CJTBlockPropertyAPItemsList(),
|
35 |
-
flags: 'rws',
|
36 |
-
selector : 'input:checkbox[name="cjtoolbox[{blockId}][posts][]"]'},
|
37 |
-
properties.categories = {om : new CJTBlockPropertyAPItemsList(),
|
38 |
-
flags: 'rws',
|
39 |
-
selector : 'input:checkbox[name="cjtoolbox[{blockId}][categories][]"]'}
|
40 |
-
// Initialize parent.
|
41 |
-
this.CJTBlockBase(blockPlugin, element, properties);
|
42 |
}
|
43 |
-
|
44 |
// Construct!
|
45 |
this.CJTBlock();
|
46 |
}
|
14 |
* @param element
|
15 |
*/
|
16 |
CJTBlock = function(blockPlugin, element) {
|
17 |
+
|
18 |
// Constructor.
|
19 |
+
this.CJTBlock = function() { this.CJTBlockBase(blockPlugin, element, {}); }
|
20 |
+
|
21 |
+
/**
|
22 |
+
*
|
23 |
+
*/
|
24 |
+
this.load = function() {
|
25 |
+
// Initialize.
|
26 |
var properties = {};
|
27 |
// Define CJTBlock properties for assignment panel.
|
28 |
+
properties.links = {om : new CJTBlockPropertyHTMLNodeOM(), flags: 'rws', selector : 'textarea[name="cjtoolbox[{blockId}][links]"]'};
|
29 |
+
properties.expressions = {om : new CJTBlockPropertyHTMLNodeOM(), flags: 'rws', selector : 'textarea[name="cjtoolbox[{blockId}][expressions]"]'};
|
30 |
+
properties.pinPoint = {om : new CJTBlockPropertyAPItemsList(), flags: 'rws', selector : 'input:checkbox[name="cjtoolbox[{blockId}][pinPoint][]"]'};
|
31 |
+
properties.pages = {om : new CJTBlockPropertyAPItemsList(), flags: 'rws', selector : 'input:checkbox[name="cjtoolbox[{blockId}][pages][]"]'};
|
32 |
+
properties.posts = {om : new CJTBlockPropertyAPItemsList(), flags: 'rws', selector : 'input:checkbox[name="cjtoolbox[{blockId}][posts][]"]'};
|
33 |
+
properties.categories = {om : new CJTBlockPropertyAPItemsList(), flags: 'rws', selector : 'input:checkbox[name="cjtoolbox[{blockId}][categories][]"]'};
|
34 |
+
properties.pagesPanelToggleState = {flags: 'rwc'};
|
35 |
+
properties.assignOnlyModeSwitcher = {flags: 'rwc'};
|
36 |
+
// Load Base Model.
|
37 |
+
this.loadBase(properties);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
38 |
}
|
39 |
+
|
40 |
// Construct!
|
41 |
this.CJTBlock();
|
42 |
}
|
views/blocks/cjt-block/public/js/blockproperty/blockproperty.js
CHANGED
@@ -91,6 +91,16 @@ var CJTBlockPropertyAPItemsList;
|
|
91 |
return value;
|
92 |
}
|
93 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
94 |
/**
|
95 |
*
|
96 |
*/
|
@@ -138,7 +148,8 @@ var CJTBlockPropertyAPItemsList;
|
|
138 |
);
|
139 |
// Set the map.
|
140 |
pagesPanel.setMapGroup(property.name, value.map);
|
141 |
-
}
|
|
|
142 |
}
|
143 |
|
144 |
})(jQuery);
|
91 |
return value;
|
92 |
}
|
93 |
|
94 |
+
/**
|
95 |
+
*
|
96 |
+
*/
|
97 |
+
this.reset = function() {
|
98 |
+
// Should reset all fields to Server Synched value.
|
99 |
+
// For now its developed as standard iunterface.
|
100 |
+
// so that AssignOnly mode switcher don't fail
|
101 |
+
// or to need to filter what properties to process.
|
102 |
+
};
|
103 |
+
|
104 |
/**
|
105 |
*
|
106 |
*/
|
148 |
);
|
149 |
// Set the map.
|
150 |
pagesPanel.setMapGroup(property.name, value.map);
|
151 |
+
};
|
152 |
+
|
153 |
}
|
154 |
|
155 |
})(jQuery);
|
views/blocks/cjt-block/public/js/jquery.assignpanel/jquery.assignpanel.js
CHANGED
@@ -6,6 +6,148 @@
|
|
6 |
*
|
7 |
*/
|
8 |
(function($) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
9 |
|
10 |
/**
|
11 |
* Hold the items per page to load
|
@@ -46,7 +188,12 @@
|
|
46 |
/**
|
47 |
*
|
48 |
*/
|
49 |
-
this.
|
|
|
|
|
|
|
|
|
|
|
50 |
|
51 |
/**
|
52 |
*
|
@@ -82,6 +229,32 @@
|
|
82 |
ui.newContent.find('textarea').focus();
|
83 |
};
|
84 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
85 |
/**
|
86 |
*
|
87 |
*
|
@@ -146,6 +319,31 @@
|
|
146 |
}
|
147 |
}
|
148 |
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
149 |
|
150 |
/**
|
151 |
* put your comment there...
|
@@ -191,6 +389,15 @@
|
|
191 |
return promise;
|
192 |
};
|
193 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
194 |
/**
|
195 |
* Get items count to load per
|
196 |
* page.
|
@@ -259,7 +466,7 @@
|
|
259 |
.prop('checked', item.assigned)
|
260 |
.appendTo($('<label></label>').appendTo(itemLi))
|
261 |
// If load-assigned-only-mode is activated then disable checkboxes.
|
262 |
-
.prop('disabled', assignPanel.
|
263 |
// Add the Checkbox to notification save chnages elements.
|
264 |
assignPanel.block.notifySaveChanges.initElement(checkbox.get(0));
|
265 |
// Checkbox title container.
|
@@ -276,6 +483,12 @@
|
|
276 |
}
|
277 |
// Create Child Components IF: NOT-IN-REVISION-MODE AND THE ITEM-HAS-CHILD.
|
278 |
if (!assignPanel.loadAssignedOnlyMode && item.hasChilds) {
|
|
|
|
|
|
|
|
|
|
|
|
|
279 |
// Add child items list below the title container.
|
280 |
$('<ul class="children"></ul>')
|
281 |
.prop('id', ('objects-list-' + typeParams.type + '-' + mdlBlock.get('id') + '-' + item.id))
|
@@ -463,11 +676,17 @@
|
|
463 |
// List items.
|
464 |
return assignPanel.list_GetAPOP.apply(this, [initialize, 1]);
|
465 |
};
|
|
|
|
|
|
|
466 |
// Cache object-list-element reference for later use.
|
467 |
this.buttons[listParams['group']].push(objectListEle);
|
468 |
}, this)
|
469 |
);
|
470 |
|
|
|
|
|
|
|
471 |
// Initialize Assigment Panel tab.
|
472 |
this.jElement.tabs({
|
473 |
activate : function(event, ui) {
|
6 |
*
|
7 |
*/
|
8 |
(function($) {
|
9 |
+
|
10 |
+
/**
|
11 |
+
* put your comment there...
|
12 |
+
*
|
13 |
+
* @type T_JS_FUNCTION
|
14 |
+
*/
|
15 |
+
var Buttons = new function() {
|
16 |
+
|
17 |
+
/**
|
18 |
+
*
|
19 |
+
*/
|
20 |
+
this.AssignOnlySwitcher = function(assignPanel) {
|
21 |
+
// initialize.
|
22 |
+
var isRunning = false;
|
23 |
+
var anchors = {};
|
24 |
+
var switchers = [{name : 'assignOnly', state : true, 'otherSwitcher' : 'all'}, {name : 'all', state : false, 'otherSwitcher' : 'assignOnly'}];
|
25 |
+
var model = assignPanel.block.block;
|
26 |
+
var jElement = $(model.box.find('.listing-options'));
|
27 |
+
|
28 |
+
/**
|
29 |
+
* put your comment there...
|
30 |
+
*
|
31 |
+
* @param event
|
32 |
+
*/
|
33 |
+
var _onswitch = function(event) {
|
34 |
+
// Don't run while in process.
|
35 |
+
if (isRunning) {
|
36 |
+
return false;
|
37 |
+
}
|
38 |
+
// Get switcher associated to the anchor.
|
39 |
+
var switcher = $(event.target).data('switcher');
|
40 |
+
// Check for changes.
|
41 |
+
// If would be treated as changed when
|
42 |
+
// there is a changed detected and the
|
43 |
+
// the change is really made to the assign panel fields.
|
44 |
+
// Get changes copy and remove CODE field.
|
45 |
+
var changes = $.extend({}, assignPanel.block.changes);
|
46 |
+
var codeFieldID = model.aceEditor.cjtBlockFieldId;
|
47 |
+
delete changes[codeFieldID];
|
48 |
+
// CHeck if there is any changes regardless the CODE field.
|
49 |
+
if (CJTBlocksPage.blocks.hasChanges(changes)) {
|
50 |
+
var confirmed = confirm(CJT_CJT_BLOCKJqueryBlockI18N.changesDetectedConfirmMessage);
|
51 |
+
// If not confirmed returns.
|
52 |
+
if (!confirmed) {
|
53 |
+
return false;
|
54 |
+
}
|
55 |
+
else {
|
56 |
+
// Reset all changes except code.
|
57 |
+
assignPanel.block.changes = {codeFieldID : assignPanel.block.changes[assignPanel.block.changes]};
|
58 |
+
// HasChanges!
|
59 |
+
var hasChanges = CJTBlocksPage.blocks.hasChanges(assignPanel.block.changes);
|
60 |
+
// Based on the hasChanges value reflect user interface
|
61 |
+
// components for CJTPages and the Block unit.
|
62 |
+
CJTBlocksPage.blockContentChanged(model.get('id'), hasChanges);
|
63 |
+
assignPanel.block.toolbox.buttons['save'].enable(hasChanges);
|
64 |
+
}
|
65 |
+
}
|
66 |
+
// Enter running mode.
|
67 |
+
isRunning = true;
|
68 |
+
// Reset assignment panel
|
69 |
+
// Process all LISTING properties.
|
70 |
+
var properties = $.merge([], assignPanel.block.features.restoreRevision.fields);
|
71 |
+
delete properties[properties.indexOf('code')];
|
72 |
+
delete properties[properties.indexOf('links')];
|
73 |
+
delete properties[properties.indexOf('expressions')];
|
74 |
+
$.each(properties, $.proxy(
|
75 |
+
function(index, propertyName) {
|
76 |
+
if (propertyName) {
|
77 |
+
// Get property om
|
78 |
+
pom = model.property(propertyName).om;
|
79 |
+
// Reset values.
|
80 |
+
pom.setValue(null);
|
81 |
+
pom.reset();
|
82 |
+
}
|
83 |
+
}, this)
|
84 |
+
);
|
85 |
+
// Save property.
|
86 |
+
model.set('assignOnlyModeSwitcher', switcher.name);
|
87 |
+
// Switch state.
|
88 |
+
this.switchState();
|
89 |
+
// Activate ADVANCED TAB.
|
90 |
+
// Activate previously activated tab.
|
91 |
+
var currentActiveTAB = assignPanel.jElement.tabs('option', 'active');
|
92 |
+
assignPanel.activateTab('advanced');
|
93 |
+
assignPanel.jElement.tabs('option', 'active', currentActiveTAB);
|
94 |
+
// Exsit running mode.
|
95 |
+
isRunning = false;
|
96 |
+
// Inactive
|
97 |
+
return false;
|
98 |
+
};
|
99 |
+
|
100 |
+
/**
|
101 |
+
* put your comment there...
|
102 |
+
*
|
103 |
+
*/
|
104 |
+
var getBlockSwitcherName = function() {
|
105 |
+
return model.get('assignOnlyModeSwitcher', 'all');
|
106 |
+
};
|
107 |
+
|
108 |
+
/**
|
109 |
+
* put your comment there...
|
110 |
+
*
|
111 |
+
*/
|
112 |
+
this.jElement = function() {
|
113 |
+
return jElement;
|
114 |
+
};
|
115 |
+
|
116 |
+
/**
|
117 |
+
* put your comment there...
|
118 |
+
*
|
119 |
+
*/
|
120 |
+
this.switchState = function() {
|
121 |
+
// Get block switcher.
|
122 |
+
var anchor = anchors[getBlockSwitcherName()];
|
123 |
+
var switcher = anchor.data('switcher');
|
124 |
+
// Change anchor state.
|
125 |
+
anchor.addClass('active');
|
126 |
+
// Reset the other anchor state.
|
127 |
+
anchors[switcher.otherSwitcher].removeClass('active');
|
128 |
+
// Change state.
|
129 |
+
assignPanel.loadAssignedOnlyMode = switcher.state;
|
130 |
+
assignPanel.checkboxDisabled = false;
|
131 |
+
};
|
132 |
+
|
133 |
+
// Initialize null p
|
134 |
+
// Find links, bind events.
|
135 |
+
$.each(switchers, $.proxy(
|
136 |
+
function(index, switcher) {
|
137 |
+
// Find Anchor
|
138 |
+
anchors[switcher.name] = model.box.find('.listing-options-' + switcher.name)
|
139 |
+
// Handle click
|
140 |
+
.click($.proxy(_onswitch, this))
|
141 |
+
// Store switcher name.
|
142 |
+
.data('switcher', switcher);
|
143 |
+
}, this)
|
144 |
+
);
|
145 |
+
|
146 |
+
// Switch to default state.
|
147 |
+
this.switchState();
|
148 |
+
};
|
149 |
+
|
150 |
+
};
|
151 |
|
152 |
/**
|
153 |
* Hold the items per page to load
|
188 |
/**
|
189 |
*
|
190 |
*/
|
191 |
+
this.checkboxDisabled = (this.block.state == 'restore')
|
192 |
+
|
193 |
+
/**
|
194 |
+
*
|
195 |
+
*/
|
196 |
+
this.loadAssignedOnlyMode = this.checkboxDisabled;
|
197 |
|
198 |
/**
|
199 |
*
|
229 |
ui.newContent.find('textarea').focus();
|
230 |
};
|
231 |
|
232 |
+
/**
|
233 |
+
* put your comment there...
|
234 |
+
*
|
235 |
+
* @param event
|
236 |
+
*/
|
237 |
+
var _ondetectlistscroll = function(event) {
|
238 |
+
// Initialize.
|
239 |
+
var list = this;
|
240 |
+
var jList = $(list);
|
241 |
+
// Don't load unless not all items has been loaded.
|
242 |
+
if (jList.data('itemsLoaded') === true) {
|
243 |
+
return;
|
244 |
+
}
|
245 |
+
// Prevent multiple requests at the same time.
|
246 |
+
var isLoading = jList.data('cjt_isObjectListLoading');
|
247 |
+
// Scroll value.
|
248 |
+
var scrollValue = list.scrollTop;
|
249 |
+
// The hidden zone!
|
250 |
+
var scrollZone = list.scrollHeight - jList.innerHeight();
|
251 |
+
// If the ScrollValue = ScrollZone
|
252 |
+
// then we need to load a new page.
|
253 |
+
if ((scrollValue == scrollZone) && (isLoading === false)) {
|
254 |
+
list.getCJTBlockAPOP(false);
|
255 |
+
}
|
256 |
+
};
|
257 |
+
|
258 |
/**
|
259 |
*
|
260 |
*
|
319 |
}
|
320 |
}
|
321 |
};
|
322 |
+
|
323 |
+
/**
|
324 |
+
* put your comment there...
|
325 |
+
*
|
326 |
+
* @param event
|
327 |
+
*
|
328 |
+
* @returns {Boolean}
|
329 |
+
*/
|
330 |
+
var _onselectchilds = function(event) {
|
331 |
+
// Initialize vars.
|
332 |
+
var overlay = $(event.target);
|
333 |
+
var checkbox = overlay.parent().find('.select-childs');
|
334 |
+
var state = checkbox.prop('checked') ? '' : 'checked';
|
335 |
+
// Work only if select-child checkbox is interactive!
|
336 |
+
if (checkbox.attr('disabled') != 'disabled') {
|
337 |
+
// Revert checkbox state.
|
338 |
+
checkbox.prop('checked', state);
|
339 |
+
// Clone state to parent checkbox.
|
340 |
+
checkbox.parent().find('label>input:checkbox').prop('checked', state).trigger('change');
|
341 |
+
//Clone state to all child checkboxes
|
342 |
+
checkbox.parent().find('.children input:checkbox').prop('checked', state).trigger('change');
|
343 |
+
}
|
344 |
+
// For link to behave inactive.
|
345 |
+
return false;
|
346 |
+
};
|
347 |
|
348 |
/**
|
349 |
* put your comment there...
|
389 |
return promise;
|
390 |
};
|
391 |
|
392 |
+
/**
|
393 |
+
*
|
394 |
+
*/
|
395 |
+
this.activateTab = function(type) {
|
396 |
+
// Activate the AUX tab by default.
|
397 |
+
assignPanel.jElement.find('li.type-' + type + '>a').trigger('click');
|
398 |
+
assignPanel.jElement.tabs({collapsible : false});
|
399 |
+
};
|
400 |
+
|
401 |
/**
|
402 |
* Get items count to load per
|
403 |
* page.
|
466 |
.prop('checked', item.assigned)
|
467 |
.appendTo($('<label></label>').appendTo(itemLi))
|
468 |
// If load-assigned-only-mode is activated then disable checkboxes.
|
469 |
+
.prop('disabled', assignPanel.checkboxDisabled);
|
470 |
// Add the Checkbox to notification save chnages elements.
|
471 |
assignPanel.block.notifySaveChanges.initElement(checkbox.get(0));
|
472 |
// Checkbox title container.
|
483 |
}
|
484 |
// Create Child Components IF: NOT-IN-REVISION-MODE AND THE ITEM-HAS-CHILD.
|
485 |
if (!assignPanel.loadAssignedOnlyMode && item.hasChilds) {
|
486 |
+
// Add 'select childs' checkbox just before te title container element.
|
487 |
+
var link = $('<a href="#" class="select-childs-checkbox-overlay"></a>')
|
488 |
+
.click($.proxy(_onselectchilds, this))
|
489 |
+
.insertBefore(title);
|
490 |
+
// Overlay checkbox.
|
491 |
+
link.after('<input type="checkbox" class="select-childs">');
|
492 |
// Add child items list below the title container.
|
493 |
$('<ul class="children"></ul>')
|
494 |
.prop('id', ('objects-list-' + typeParams.type + '-' + mdlBlock.get('id') + '-' + item.id))
|
676 |
// List items.
|
677 |
return assignPanel.list_GetAPOP.apply(this, [initialize, 1]);
|
678 |
};
|
679 |
+
listElementNode._ondetectlistscroll = _ondetectlistscroll;
|
680 |
+
// Fetch objects from server with list scrolls event.
|
681 |
+
listElement.bind('scroll.cjt', listElementNode._ondetectlistscroll);
|
682 |
// Cache object-list-element reference for later use.
|
683 |
this.buttons[listParams['group']].push(objectListEle);
|
684 |
}, this)
|
685 |
);
|
686 |
|
687 |
+
// Buttons.
|
688 |
+
this.assignedOnlySwitcher = new Buttons.AssignOnlySwitcher(this);
|
689 |
+
|
690 |
// Initialize Assigment Panel tab.
|
691 |
this.jElement.tabs({
|
692 |
activate : function(event, ui) {
|
views/blocks/cjt-block/public/js/jquery.block/jquery.block.js
CHANGED
@@ -21,25 +21,96 @@
|
|
21 |
this.pagesPanel = null;
|
22 |
|
23 |
/**
|
|
|
24 |
*
|
25 |
*/
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
31 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
32 |
}
|
33 |
|
|
|
|
|
|
|
34 |
/// Initialize parent class.
|
35 |
// Add assigment panel fields to the restoreRevision args.
|
36 |
args.restoreRevision = {fields : ['code', 'pages', 'posts', 'categories', 'pinPoint', 'links', 'expressions']};
|
37 |
this.initCJTPluginBase(node, args);
|
38 |
|
39 |
-
// Plug the assigment panel, get the jQuery ELement for it
|
40 |
-
var assigmentPanelElement = this.block.box.find('#tabs-' + this.block.get('id'));
|
41 |
-
this.pagesPanel = assigmentPanelElement.CJTBlockAssignmentPanel({block : this}).get(0).CJTBlockAssignmentPanel;
|
42 |
-
|
43 |
} // End class.
|
44 |
|
45 |
// Extend CJTBLockPluginBase.
|
21 |
this.pagesPanel = null;
|
22 |
|
23 |
/**
|
24 |
+
* put your comment there...
|
25 |
*
|
26 |
*/
|
27 |
+
var _onload = function() {
|
28 |
+
// Plug the assigment panel, get the jQuery ELement for it
|
29 |
+
var assigmentPanelElement = this.block.box.find('#tabs-' + this.block.get('id'));
|
30 |
+
this.pagesPanel = assigmentPanelElement.CJTBlockAssignmentPanel({block : this}).get(0).CJTBlockAssignmentPanel;
|
31 |
+
// Add toolbox button.
|
32 |
+
var tbIconsGroup = this.block.box.find('.editor-toolbox .icons-group')
|
33 |
+
tbIconsGroup.children().first().after('<a href="#" class="cjt-tb-link cjttbl-toggle-objects-panel"></a>')
|
34 |
+
var toggler = this.editorToolbox.add('toggle-objects-panel', {callback : this._ontogglepagespanel});
|
35 |
+
// Close it if it were closed.
|
36 |
+
this._ontogglepagespanel({target : toggler.jButton}, this.block.get('pagesPanelToggleState', ''));
|
37 |
+
// More to Dock with Fullscreen mode!
|
38 |
+
this.extraDocks = [
|
39 |
+
{element : assigmentPanelElement.find('.ui-tabs-panel'), pixels : 78},
|
40 |
+
{element : assigmentPanelElement.find('.ui-tabs-panel .pagelist'), pixels : 132},
|
41 |
+
|
42 |
+
{element : assigmentPanelElement.find('.custom-posts-container'), pixels : 124},
|
43 |
+
{element : assigmentPanelElement.find('.custom-posts-container .custom-post-list'), pixels : 156},
|
44 |
+
{element : assigmentPanelElement.find('.custom-posts-container .custom-post-list .pagelist'), pixels : 178},
|
45 |
+
|
46 |
+
{element : assigmentPanelElement.find('.advanced-accordion .ui-accordion-content'), pixels : 172},
|
47 |
+
{element : assigmentPanelElement.find('.advanced-accordion .ui-accordion-content textarea'), pixels : 182}
|
48 |
+
];
|
49 |
+
};
|
50 |
+
|
51 |
+
/**
|
52 |
+
*
|
53 |
+
*
|
54 |
+
*
|
55 |
+
*
|
56 |
+
*/
|
57 |
+
this._ontogglepagespanel = function(event, initialState) {
|
58 |
+
var toggler = $(event.target);
|
59 |
+
var block = this.block;
|
60 |
+
var tabs = block.box.find('.cjt-pages-tab');
|
61 |
+
var pagesBlock = block.box.find('.cjpageblock');
|
62 |
+
var codeBlock = block.box.find('.cjcodeblock');
|
63 |
+
var aceEditor = block.aceEditor;
|
64 |
+
var newState = '';
|
65 |
+
// Hide pages panel when:
|
66 |
+
if (tabs.css('display') != 'none') {
|
67 |
+
// Hide if initial value == undefined or initial value == closed.
|
68 |
+
if ((initialState != '') && (initialState != 'undefined')) {
|
69 |
+
// Hide elements.
|
70 |
+
tabs.hide();
|
71 |
+
pagesBlock.css('width', '0px');
|
72 |
+
codeBlock.animate({'margin-right' : 0}, undefined, undefined,
|
73 |
+
function() {
|
74 |
+
toggler.addClass('closed');
|
75 |
+
// Refresh editor.
|
76 |
+
aceEditor.resize();
|
77 |
+
}
|
78 |
+
);
|
79 |
+
// Save state.
|
80 |
+
newState = 'closed';
|
81 |
+
}
|
82 |
+
}
|
83 |
+
else {
|
84 |
+
// Show elements.
|
85 |
+
codeBlock.animate({'margin-right' : 320}, undefined, undefined,
|
86 |
+
function() {
|
87 |
+
// Use CSS class margin not inline style!
|
88 |
+
codeBlock.css('margin-right', '');
|
89 |
+
// Show panel!
|
90 |
+
pagesBlock.css('width', '');
|
91 |
+
tabs.show();
|
92 |
+
toggler.removeClass('closed');
|
93 |
+
// Refresh editor.
|
94 |
+
aceEditor.resize();
|
95 |
+
}
|
96 |
+
);
|
97 |
}
|
98 |
+
// Set title based on the new STATE!
|
99 |
+
toggler.attr('title', CJT_CJT_BLOCKJqueryBlockI18N['assigmentPanel_' + newState + 'Title']);
|
100 |
+
// Save state.
|
101 |
+
block.set('pagesPanelToggleState', newState);
|
102 |
+
// For link to behave inactive.
|
103 |
+
return false;
|
104 |
}
|
105 |
|
106 |
+
// Load block only when loaded by parent model.
|
107 |
+
this.onLoad = _onload;
|
108 |
+
|
109 |
/// Initialize parent class.
|
110 |
// Add assigment panel fields to the restoreRevision args.
|
111 |
args.restoreRevision = {fields : ['code', 'pages', 'posts', 'categories', 'pinPoint', 'links', 'expressions']};
|
112 |
this.initCJTPluginBase(node, args);
|
113 |
|
|
|
|
|
|
|
|
|
114 |
} // End class.
|
115 |
|
116 |
// Extend CJTBLockPluginBase.
|
views/blocks/cjt-block/public/js/jquery.block/jquery.block.localization.php
CHANGED
@@ -9,4 +9,8 @@
|
|
9 |
*
|
10 |
* Localization text for backups script.
|
11 |
*/
|
12 |
-
return array(
|
|
|
|
|
|
|
|
9 |
*
|
10 |
* Localization text for backups script.
|
11 |
*/
|
12 |
+
return array(
|
13 |
+
'assigmentPanel_Title' => cssJSToolbox::getText('Switch code editor to fullwidth mode (hides assignment panel)'),
|
14 |
+
'assigmentPanel_closedTitle' => cssJSToolbox::getText('Revert code editor to default mode (show assignment panel)'),
|
15 |
+
'changesDetectedConfirmMessage' => cssJSToolbox::getText('Changes has been made to the assignment objects. Switching display mode would reset all those changes as it never made. Would you like to discard those changes'),
|
16 |
+
);
|
views/blocks/cjt-block/public/js/optional/revision/revision.js
CHANGED
@@ -19,18 +19,6 @@ var CJTBlockOptionalRevision = null;
|
|
19 |
*
|
20 |
*/
|
21 |
this.assignPanel = null;
|
22 |
-
|
23 |
-
/**
|
24 |
-
* put your comment there...
|
25 |
-
*
|
26 |
-
*/
|
27 |
-
var activateTab = function(type) {
|
28 |
-
// Initialize.
|
29 |
-
var assignPanel = block.pagesPanel.jElement;
|
30 |
-
// Activate the AUX tab by default.
|
31 |
-
assignPanel.find('li.type-' + type + '>a').trigger('click');
|
32 |
-
assignPanel.tabs({collapsible : false});
|
33 |
-
};
|
34 |
|
35 |
/**
|
36 |
* put your comment there...
|
@@ -69,20 +57,27 @@ var CJTBlockOptionalRevision = null;
|
|
69 |
*
|
70 |
*/
|
71 |
this._onswitchstate = function() {
|
72 |
-
// Whenever we're in revision mode enter the load-assigned-only-mode.
|
73 |
-
this.assignPanel.loadAssignedOnlyMode = (this.state == 'revision');
|
74 |
switch (this.state) {
|
75 |
case 'revision':
|
76 |
// If we're in revision mode set modeBlockId
|
77 |
this.assignPanel.modeBlockId = revision['id'];
|
|
|
|
|
|
|
|
|
|
|
78 |
break;
|
79 |
default : // Revert back to normal state.
|
80 |
// Reset alternate block Id.
|
81 |
this.assignPanel.modeBlockId = null;
|
|
|
|
|
|
|
|
|
82 |
break;
|
83 |
}
|
84 |
// Reset assignpanel selected TAB.
|
85 |
-
activateTab('advanced');
|
86 |
}
|
87 |
|
88 |
// Construct parent.
|
19 |
*
|
20 |
*/
|
21 |
this.assignPanel = null;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
22 |
|
23 |
/**
|
24 |
* put your comment there...
|
57 |
*
|
58 |
*/
|
59 |
this._onswitchstate = function() {
|
|
|
|
|
60 |
switch (this.state) {
|
61 |
case 'revision':
|
62 |
// If we're in revision mode set modeBlockId
|
63 |
this.assignPanel.modeBlockId = revision['id'];
|
64 |
+
// Force assignment panel revision mode.
|
65 |
+
this.assignPanel.loadAssignedOnlyMode = true;
|
66 |
+
this.assignPanel.checkboxDisabled = true;
|
67 |
+
// Hide AssignedOnly switcher.
|
68 |
+
this.assignPanel.assignedOnlySwitcher.jElement().css({visibility : 'hidden'});
|
69 |
break;
|
70 |
default : // Revert back to normal state.
|
71 |
// Reset alternate block Id.
|
72 |
this.assignPanel.modeBlockId = null;
|
73 |
+
// Switch
|
74 |
+
this.assignPanel.assignedOnlySwitcher.switchState();
|
75 |
+
// Show assigned only switcher.
|
76 |
+
this.assignPanel.assignedOnlySwitcher.jElement().css({visibility : 'visible'});
|
77 |
break;
|
78 |
}
|
79 |
// Reset assignpanel selected TAB.
|
80 |
+
this.assignPanel.activateTab('advanced');
|
81 |
}
|
82 |
|
83 |
// Construct parent.
|
views/blocks/cjt-block/tmpl/default.html.tmpl
CHANGED
@@ -6,10 +6,13 @@
|
|
6 |
// Disallow direct access.
|
7 |
defined('ABSPATH') or die('Restricted Access');
|
8 |
|
9 |
-
//
|
10 |
$blockView = $this->getBlockView();
|
11 |
-
|
|
|
|
|
|
|
|
|
12 |
|
13 |
// Put the Objects Panel at the begning of the block content.
|
14 |
-
echo $this->
|
15 |
-
echo $blockContent;
|
6 |
// Disallow direct access.
|
7 |
defined('ABSPATH') or die('Restricted Access');
|
8 |
|
9 |
+
// Block viee object.
|
10 |
$blockView = $this->getBlockView();
|
11 |
+
|
12 |
+
if ($this->isLoading || !$blockView->isClosed) {
|
13 |
+
// Get assignment panel template
|
14 |
+
echo $this->structuredContent['assignPanel'] = $this->getTemplate('default', array('block' => $blockView->getBlock()), 'tmpl/templates/assign-panel');
|
15 |
+
}
|
16 |
|
17 |
// Put the Objects Panel at the begning of the block content.
|
18 |
+
echo $this->structuredContent['content'] = $blockView->getTemplate($this->isLoading ? 'content' : $blockView->templateName);
|
|
views/blocks/cjt-block/tmpl/templates/assign-panel/default.html.tmpl
CHANGED
@@ -17,6 +17,10 @@ $tabs = array(
|
|
17 |
'group' => 'posts',
|
18 |
'targetType' => 'post')
|
19 |
),
|
|
|
|
|
|
|
|
|
20 |
'categories' => array(
|
21 |
'title' => cssJSToolbox::getText('Categories'),
|
22 |
'renderer' => 'objects-list',
|
@@ -24,10 +28,6 @@ $tabs = array(
|
|
24 |
'group' => 'categories',
|
25 |
'targetType' => 'taxonomy')
|
26 |
),
|
27 |
-
'custom-posts' => array(
|
28 |
-
'title' => cssJSToolbox::getText('Custom Posts'),
|
29 |
-
'renderer' => 'custom-posts'
|
30 |
-
),
|
31 |
'other' => array(
|
32 |
'title' => cssJSToolbox::getText('Auxiliary'),
|
33 |
'renderer' => 'objects-list',
|
17 |
'group' => 'posts',
|
18 |
'targetType' => 'post')
|
19 |
),
|
20 |
+
'custom-posts' => array(
|
21 |
+
'title' => cssJSToolbox::getText('Custom Posts'),
|
22 |
+
'renderer' => 'custom-posts'
|
23 |
+
),
|
24 |
'categories' => array(
|
25 |
'title' => cssJSToolbox::getText('Categories'),
|
26 |
'renderer' => 'objects-list',
|
28 |
'group' => 'categories',
|
29 |
'targetType' => 'taxonomy')
|
30 |
),
|
|
|
|
|
|
|
|
|
31 |
'other' => array(
|
32 |
'title' => cssJSToolbox::getText('Auxiliary'),
|
33 |
'renderer' => 'objects-list',
|
views/blocks/cjt-block/tmpl/templates/assign-panel/templates/custom-posts.html.tmpl
CHANGED
@@ -20,11 +20,13 @@ foreach ($customPosts as $typeName => $customPost) {
|
|
20 |
);
|
21 |
}
|
22 |
}
|
23 |
-
// If there is no custom posts registered show message
|
24 |
-
//, otherwise create the custom-posts accordion
|
25 |
-
if (!empty($items)) :
|
26 |
?>
|
27 |
<div id="custom-posts-container-<?php echo $block->id ?>" class="custom-posts-container">
|
|
|
|
|
|
|
|
|
|
|
28 |
<?php foreach ($items as $item) : ?>
|
29 |
<div class="objects-list-button">
|
30 |
<?php echo $this->getTemplate('inputs-list', array('item' => $item), 'tmpl/templates/assign-panel/templates') ?>
|
@@ -42,12 +44,12 @@ if (!empty($items)) :
|
|
42 |
?>
|
43 |
</div>
|
44 |
<?php endforeach; ?>
|
45 |
-
</div>
|
46 |
<?php else : ?>
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
<?php endif; ?>
|
|
20 |
);
|
21 |
}
|
22 |
}
|
|
|
|
|
|
|
23 |
?>
|
24 |
<div id="custom-posts-container-<?php echo $block->id ?>" class="custom-posts-container">
|
25 |
+
<?php
|
26 |
+
// If there is no custom posts registered show message
|
27 |
+
//, otherwise create the custom-posts accordion
|
28 |
+
if (!empty($items)) :
|
29 |
+
?>
|
30 |
<?php foreach ($items as $item) : ?>
|
31 |
<div class="objects-list-button">
|
32 |
<?php echo $this->getTemplate('inputs-list', array('item' => $item), 'tmpl/templates/assign-panel/templates') ?>
|
44 |
?>
|
45 |
</div>
|
46 |
<?php endforeach; ?>
|
|
|
47 |
<?php else : ?>
|
48 |
+
<div class="list-error">
|
49 |
+
<span class="message"><?php echo cssJSToolbox::getText('There are no Custom Posts Defined yet!') ?></span>
|
50 |
+
<br />
|
51 |
+
<br />
|
52 |
+
<span class="desc">This message is displayed if there is no Custom Post types defined or there is no Posts Added under Custom Post types!</span>
|
53 |
+
</div>
|
54 |
+
<?php endif; ?>
|
55 |
+
</div>
|
views/blocks/cjt-block/tmpl/templates/assign-panel/templates/tab.html.tmpl
CHANGED
@@ -30,4 +30,8 @@
|
|
30 |
?>
|
31 |
</div>
|
32 |
<?php endforeach; ?>
|
|
|
|
|
|
|
|
|
33 |
</div>
|
30 |
?>
|
31 |
</div>
|
32 |
<?php endforeach; ?>
|
33 |
+
<span class="listing-options">
|
34 |
+
<a href="#" class="cjt-link listing-options-assignOnly"><?php echo cssJSToolbox::getText('Assigned') ?></a> |
|
35 |
+
<a href="#" class="cjt-link listing-options-all"><?php echo cssJSToolbox::getText('All') ?></a>
|
36 |
+
</span>
|
37 |
</div>
|
views/blocks/cjt-block/view.php
CHANGED
@@ -18,6 +18,20 @@ class CJTBlocksCjtBlockView extends CJTView {
|
|
18 |
*/
|
19 |
protected $blockView = null;
|
20 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
21 |
/**
|
22 |
* put your comment there...
|
23 |
*
|
@@ -38,6 +52,8 @@ class CJTBlocksCjtBlockView extends CJTView {
|
|
38 |
// Register actions.
|
39 |
add_action('admin_print_scripts', array(__CLASS__, 'enqueueScripts'));
|
40 |
add_action('admin_print_styles', array(__CLASS__, 'enqueueStyles'));
|
|
|
|
|
41 |
}
|
42 |
|
43 |
/**
|
18 |
*/
|
19 |
protected $blockView = null;
|
20 |
|
21 |
+
/**
|
22 |
+
* put your comment there...
|
23 |
+
*
|
24 |
+
* @var mixed
|
25 |
+
*/
|
26 |
+
protected $isLoading;
|
27 |
+
|
28 |
+
/**
|
29 |
+
* put your comment there...
|
30 |
+
*
|
31 |
+
* @var mixed
|
32 |
+
*/
|
33 |
+
public $structuredContent = array();
|
34 |
+
|
35 |
/**
|
36 |
* put your comment there...
|
37 |
*
|
52 |
// Register actions.
|
53 |
add_action('admin_print_scripts', array(__CLASS__, 'enqueueScripts'));
|
54 |
add_action('admin_print_styles', array(__CLASS__, 'enqueueStyles'));
|
55 |
+
// Read input params.
|
56 |
+
$this->isLoading = isset($_REQUEST['isLoading']) ? true : false;
|
57 |
}
|
58 |
|
59 |
/**
|
views/blocks/create-metabox/public/css/metabox.css
ADDED
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
.cjt-create-metabox-metabox-form .notice {
|
2 |
+
font-weight: bold;
|
3 |
+
}
|
4 |
+
.link-loading {
|
5 |
+
display: inline-block;
|
6 |
+
height: 11px;
|
7 |
+
background : url('../../../../../framework/css/images/loading.gif') center no-repeat;
|
8 |
+
}
|
views/blocks/create-metabox/public/js/metabox/metabox.js
ADDED
@@ -0,0 +1,109 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
*
|
3 |
+
*/
|
4 |
+
|
5 |
+
/**
|
6 |
+
* put your comment there...
|
7 |
+
*
|
8 |
+
*/
|
9 |
+
var CJTBlocksPage;
|
10 |
+
|
11 |
+
/**
|
12 |
+
*
|
13 |
+
*/
|
14 |
+
(function($) {
|
15 |
+
|
16 |
+
/**
|
17 |
+
* put your comment there...
|
18 |
+
*
|
19 |
+
* @type Object
|
20 |
+
*/
|
21 |
+
CJTBlocksPage = {
|
22 |
+
|
23 |
+
/**
|
24 |
+
* put your comment there...
|
25 |
+
*
|
26 |
+
*/
|
27 |
+
blocks : null,
|
28 |
+
|
29 |
+
/**
|
30 |
+
* put your comment there...
|
31 |
+
*
|
32 |
+
*/
|
33 |
+
blocksForm : null,
|
34 |
+
|
35 |
+
/**
|
36 |
+
* put your comment there...
|
37 |
+
*
|
38 |
+
*/
|
39 |
+
createLink : null,
|
40 |
+
|
41 |
+
/**
|
42 |
+
* put your comment there...
|
43 |
+
*
|
44 |
+
*/
|
45 |
+
tb_position : window.tb_position,
|
46 |
+
|
47 |
+
/**
|
48 |
+
* put your comment there...
|
49 |
+
*
|
50 |
+
*/
|
51 |
+
_oncreate : function() {
|
52 |
+
// Confirm metabox creation!
|
53 |
+
var confirmed = confirm(CJTMetaboxI18N.confirmCreateBlockMetabox);
|
54 |
+
if (confirmed) {
|
55 |
+
var metabox = {post : $('#post_ID').val()};
|
56 |
+
this.server.send('metabox', 'create', metabox)
|
57 |
+
.success($.proxy(
|
58 |
+
function(blockView) {
|
59 |
+
// Get metabox object just before the CJTBlocksPage take place.
|
60 |
+
// If the CJTBlocksPage take place then we wont be able to get metabox object.
|
61 |
+
var metabox = CJTBlocksPage.blocks.getBlock(CJTBlocksPage.blocks.getExistsIds()[0]);
|
62 |
+
// Show Ajax loading progress.
|
63 |
+
this.createLink.CJTLoading({ceHandler : this._oncreate});
|
64 |
+
// Load CSS files required for metabox-block to work.
|
65 |
+
(new StylesLoader(blockView.references.styles)).load();
|
66 |
+
// Set tb_position to thickbox original so that metabox CJTBlocksPage can get it.
|
67 |
+
var mediaHandlerTBPosition = window.tb_position;
|
68 |
+
window.tb_position = this.tb_position;
|
69 |
+
// Localize loaded scripts
|
70 |
+
(new CJTWPScriptLocalizer(blockView.references.scripts)).localize();
|
71 |
+
// Load Javascript files required for metabox-block to work.
|
72 |
+
// After all metabox scripts are loaded display the view.
|
73 |
+
(new ScriptsLoader(blockView.references.scripts)).loadAll().done($.proxy(
|
74 |
+
function() {
|
75 |
+
// Make the new poxtbox toggle-able!
|
76 |
+
// Dont apply toggler twice for the extsis metaboxes.
|
77 |
+
var metaboxes = $('#normal-sortables .postbox').removeClass('postbox');
|
78 |
+
// Replace post metabox with the recevied metabox content.
|
79 |
+
metabox.replaceWith(blockView.view);
|
80 |
+
// Apply toggler on the new metabox.
|
81 |
+
postboxes.add_postbox_toggles(pagenow);
|
82 |
+
// Reset things back so the other metaboxes has the correct CSS class.
|
83 |
+
metaboxes.addClass('postbox');
|
84 |
+
// Reset tb_position to the one created by media-handler script.
|
85 |
+
window.tb_position = mediaHandlerTBPosition;
|
86 |
+
}, this)
|
87 |
+
);
|
88 |
+
}, this)
|
89 |
+
);
|
90 |
+
}
|
91 |
+
// For link to behave inactive.
|
92 |
+
return false;
|
93 |
+
},
|
94 |
+
|
95 |
+
/**
|
96 |
+
* put your comment there...
|
97 |
+
*
|
98 |
+
*/
|
99 |
+
init : function() {
|
100 |
+
// Initialize vars.
|
101 |
+
this.blocksForm = $('form[name="post"]');
|
102 |
+
this.blocks = new CJTBlocks();
|
103 |
+
this.server = CJTServer;
|
104 |
+
// Bind events.
|
105 |
+
this.createLink = this.blocksForm.find('a#create-cjt-block').click($.proxy(this._oncreate, this));
|
106 |
+
}
|
107 |
+
|
108 |
+
};
|
109 |
+
})(jQuery);
|
views/blocks/create-metabox/public/js/metabox/metabox.localization.php
ADDED
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @version FILE_VERSION
|
4 |
+
* Localization file for backups.js script.
|
5 |
+
*/
|
6 |
+
|
7 |
+
/**
|
8 |
+
* Localization for Javascript cjtMetaboxI18N variable.
|
9 |
+
*
|
10 |
+
* Localization text for backups script.
|
11 |
+
*/
|
12 |
+
return array(
|
13 |
+
'confirmCreateBlockMetabox' => cssJSToolbox::getText('Would you like to create CJT block Metabox for this post?'),
|
14 |
+
);
|
views/blocks/create-metabox/tmpl/create.html.tmpl
ADDED
@@ -0,0 +1,33 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
*
|
4 |
+
*/
|
5 |
+
|
6 |
+
// Disallow direct access.
|
7 |
+
defined('ABSPATH') or die("Access denied");
|
8 |
+
|
9 |
+
// Display as metabox without using Wordpress Metabox APIs.
|
10 |
+
if ($this->getOption('customizeMetabox')) : ?>
|
11 |
+
<div id="cjtoolbox-<?php echo $this->block->id; ?>" class="postbox">
|
12 |
+
<div class="handlediv" title="Click to toggle"><br /></div>
|
13 |
+
<h3 class='hndle'>
|
14 |
+
<span><span class="block-name"><?php echo $this->block->name ?></span></span>
|
15 |
+
</h3>
|
16 |
+
<div class="inside">
|
17 |
+
<?php endif; ?>
|
18 |
+
<input type="hidden" name="blocks[]" value="<?php echo $this->getBlock()->id ?>" />
|
19 |
+
<input type="hidden" id="cjt-securityToken" value="<?php echo $this->getSecurityToken() ?>" />
|
20 |
+
|
21 |
+
<div class="cjt-create-metabox-metabox-form">
|
22 |
+
<p class="notice"><?php echo cssJSToolbox::getText('Would you like to create a new CJT block for this post?') ?></p>
|
23 |
+
<p><?php echo cssJSToolbox::getText('In order to increase performance while navigating the post pages and for saving database records we\'re not creating CJT code block for any post until you really need to do!') ?></p>
|
24 |
+
<p><?php echo cssJSToolbox::getText('Click') ?> <a id="create-cjt-block" href=""><?php echo cssJSToolbox::getText('Create') ?></a> <?php echo cssJSToolbox::getText('to create CJT code block for current post and utilize from all features found in the CJT management page!') ?></p>
|
25 |
+
</div>
|
26 |
+
<script type="text/javascript">
|
27 |
+
// Initialize metabox.
|
28 |
+
jQuery(jQuery.proxy(CJTBlocksPage.init, CJTBlocksPage));
|
29 |
+
</script>
|
30 |
+
<?php if ($this->getOption('customizeMetabox')) : ?>
|
31 |
+
</div>
|
32 |
+
</div>
|
33 |
+
<?php endif; ?>
|
views/blocks/create-metabox/view.php
ADDED
@@ -0,0 +1,176 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
*
|
4 |
+
*/
|
5 |
+
|
6 |
+
/**
|
7 |
+
*
|
8 |
+
*/
|
9 |
+
class CJTBlocksCreateMetaBoxView extends CJTView {
|
10 |
+
|
11 |
+
/**
|
12 |
+
* put your comment there...
|
13 |
+
*
|
14 |
+
* @var mixed
|
15 |
+
*/
|
16 |
+
protected $block = null;
|
17 |
+
|
18 |
+
/**
|
19 |
+
* put your comment there...
|
20 |
+
*
|
21 |
+
* @var mixed
|
22 |
+
*/
|
23 |
+
protected $options = null;
|
24 |
+
|
25 |
+
/**
|
26 |
+
* put your comment there...
|
27 |
+
*
|
28 |
+
* @var mixed
|
29 |
+
*/
|
30 |
+
protected $securityToken = null;
|
31 |
+
|
32 |
+
/**
|
33 |
+
* put your comment there...
|
34 |
+
*
|
35 |
+
* @param mixed $viewInfo
|
36 |
+
* @return CJTBlockMetaBoxView
|
37 |
+
*/
|
38 |
+
public function __construct($viewInfo) {
|
39 |
+
parent::__construct($viewInfo);
|
40 |
+
// Initialize vars.
|
41 |
+
$this->options = (object) array();
|
42 |
+
// Add scripts ands styles actions.
|
43 |
+
add_action('admin_print_scripts', array(__CLASS__, 'enqueueScripts'));
|
44 |
+
add_action('admin_print_styles', array(__CLASS__, 'enqueueStyles'));
|
45 |
+
}
|
46 |
+
|
47 |
+
/**
|
48 |
+
* put your comment there...
|
49 |
+
*
|
50 |
+
*/
|
51 |
+
public function display() {
|
52 |
+
echo $this->getTemplate('create');
|
53 |
+
}
|
54 |
+
|
55 |
+
/**
|
56 |
+
* put your comment there...
|
57 |
+
*
|
58 |
+
*/
|
59 |
+
public static function enqueueScripts() {
|
60 |
+
// Use related scripts.
|
61 |
+
self::useScripts(__CLASS__,
|
62 |
+
'jquery-ui-menu',
|
63 |
+
'views:blocks:create-metabox:public:js:{CJT-}metabox',
|
64 |
+
'views:blocks:manager:public:js:{CJT-}blocks',
|
65 |
+
'framework:js:ajax:{CJT-}cjt-server',
|
66 |
+
'framework:js:ui:{CJT-}jquery.link-progress',
|
67 |
+
'framework:js:ajax:{CJT-}scripts-loader',
|
68 |
+
'framework:js:ajax:{CJT-}styles-loader',
|
69 |
+
'framework:js:wordpress:{CJT-}script-localizer'
|
70 |
+
);
|
71 |
+
/*
|
72 |
+
* Link Thickbox to header instead of footer.
|
73 |
+
* media-upload script linked directly after thickbox script.
|
74 |
+
* media-upload script override tb_position() function to show
|
75 |
+
* thickbox popup forms in fixed position and size!
|
76 |
+
*
|
77 |
+
* To overcome this problem we need to get a copy from original tb_position()
|
78 |
+
* just after thickbox is loaded and just before media-upload is
|
79 |
+
* not override tb_position yet.
|
80 |
+
* metabox.js now is between thickbox and media-upload, have fun!
|
81 |
+
*/
|
82 |
+
$GLOBALS['wp_scripts']->registered['thickbox']->args = 0;
|
83 |
+
}
|
84 |
+
|
85 |
+
/**
|
86 |
+
* put your comment there...
|
87 |
+
*
|
88 |
+
*/
|
89 |
+
public static function enqueueStyles() {
|
90 |
+
// Use related styles.
|
91 |
+
self::useStyles(__CLASS__,
|
92 |
+
'views:blocks:create-metabox:public:css:{CJT-}metabox'
|
93 |
+
);
|
94 |
+
}
|
95 |
+
|
96 |
+
/**
|
97 |
+
* put your comment there...
|
98 |
+
*
|
99 |
+
*/
|
100 |
+
public function getBlock() {
|
101 |
+
return $this->block;
|
102 |
+
}
|
103 |
+
|
104 |
+
/**
|
105 |
+
* put your comment there...
|
106 |
+
*
|
107 |
+
*/
|
108 |
+
public function getMetaboxName() {
|
109 |
+
return $this->getBlock()->name;
|
110 |
+
}
|
111 |
+
|
112 |
+
/**
|
113 |
+
* put your comment there...
|
114 |
+
*
|
115 |
+
* @param mixed $id
|
116 |
+
*/
|
117 |
+
public function getMetaboxId() {
|
118 |
+
// Use the same id as regular CJT block.
|
119 |
+
$blockView = CJTView::create('blocks/block');
|
120 |
+
// To avoid outputing script and styles for block box Remove scripts and styles actions!
|
121 |
+
remove_action('admin_print_scripts', array('CJTBlocksBlockView', 'enqueueScripts'));
|
122 |
+
remove_action('admin_print_styles', array('CJTBlocksBlockView', 'enqueueStyles'));
|
123 |
+
// Get metabox id.
|
124 |
+
$blockView->setBlock($this->getBlock());
|
125 |
+
return $blockView->getMetaboxId();
|
126 |
+
}
|
127 |
+
|
128 |
+
/**
|
129 |
+
* put your comment there...
|
130 |
+
*
|
131 |
+
*/
|
132 |
+
public function getOption($name) {
|
133 |
+
return isset($this->options->{$name}) ? $this->options->{$name} : null;
|
134 |
+
}
|
135 |
+
|
136 |
+
/**
|
137 |
+
* put your comment there...
|
138 |
+
*
|
139 |
+
*/
|
140 |
+
public function getSecurityToken() {
|
141 |
+
return $this->securityToken;
|
142 |
+
}
|
143 |
+
/**
|
144 |
+
* put your comment there...
|
145 |
+
*
|
146 |
+
* @param mixed $block
|
147 |
+
*/
|
148 |
+
public function setBlock($block) {
|
149 |
+
$this->block = $block;
|
150 |
+
}
|
151 |
+
|
152 |
+
/**
|
153 |
+
* put your comment there...
|
154 |
+
*
|
155 |
+
* @param mixed $name
|
156 |
+
* @param mixed $value
|
157 |
+
*/
|
158 |
+
public function setOption($name, $value) {
|
159 |
+
$this->options->{$name} = $value;
|
160 |
+
// Chaining!
|
161 |
+
return $this;
|
162 |
+
}
|
163 |
+
|
164 |
+
/**
|
165 |
+
* put your comment there...
|
166 |
+
*
|
167 |
+
* @param mixed $token
|
168 |
+
*/
|
169 |
+
public function setSecurityToken($token) {
|
170 |
+
$this->securityToken = $token;
|
171 |
+
}
|
172 |
+
|
173 |
+
} // End class.
|
174 |
+
|
175 |
+
// Hookable!!
|
176 |
+
CJTBlocksCreateMetaBoxView::define('CJTBlocksCreateMetaBoxView');
|
views/blocks/manager/public/css/blocks.css
CHANGED
@@ -1,17 +1,12 @@
|
|
1 |
/** CSS & Javascript Toolkit - blocks page CSS **/
|
2 |
/* Wordpress Page */
|
3 |
.wrap { position: relative; }
|
4 |
-
a
|
5 |
-
|
|
|
6 |
|
7 |
-
#cjt-banner-bar-right {right: 0px;position: absolute;top: 2px;}
|
8 |
-
#cjt-banner-bar-right .cjt-banner-link {margin-bottom: 6px;}
|
9 |
-
|
10 |
-
#get-packages {margin-left: 5px;}
|
11 |
#get-packages-icon {display: inline-block; width: 13px; height: 15px; background-image: url('../images/get-packages.png'); margin-left: 3px;margin-bottom: -4px; margin-right: 5px;}
|
12 |
|
13 |
-
#review-icon {display: inline-block; width: 75px; height: 14px; background-image: url('../images/review.png');margin-bottom: -2px; margin-left: 12px;}
|
14 |
-
|
15 |
.blocks-icon32 { background: transparent url('../images/CSS_JS_Toolbox_Icon.png') no-repeat; }
|
16 |
#post-body{ display: none; min-width:700px; }
|
17 |
/* Give extra space for the last Block Code-Auto-Completion dialog */
|
@@ -27,6 +22,7 @@ h2#cjt-title {display: inline-block;}
|
|
27 |
line-height: 1.3;
|
28 |
padding: 14px 0px;
|
29 |
}
|
|
|
30 |
/* Blocks loader */
|
31 |
#cjt-blocks-loader { width: 100%; text-align: center; vertical-align: middle; }
|
32 |
#cjt-blocks-loader p.loading-text{ padding-left: 20px; font-weight: bold; font-size: 14px;}
|
@@ -39,6 +35,7 @@ h2#cjt-title {display: inline-block;}
|
|
39 |
margin-bottom: 20px;
|
40 |
padding: 4px 4px 4px 0px !important;
|
41 |
clear: both;
|
|
|
42 |
border: solid #ccc;
|
43 |
border-width: 1px;
|
44 |
-moz-border-radius: 6px;
|
@@ -65,9 +62,10 @@ h2#cjt-title {display: inline-block;}
|
|
65 |
.cjt-toolbox-blocks a.cjttbl-state-tools {width: 28px !important; background: url(../images/toolbox/activate-all.png) no-repeat;}
|
66 |
.cjt-toolbox-blocks a.cjttbl-location-tools { background: url(../images/toolbox/header-all.png) no-repeat; }
|
67 |
.cjt-toolbox-blocks a.cjttbl-admin-tools { background: url(../images/toolbox/admin-tools.png) no-repeat; }
|
|
|
|
|
68 |
.cjt-toolbox-blocks a.cjttbl-save-changes { background: url(../images/toolbox/save-changes.png) no-repeat; }
|
69 |
.cjt-toolbox-blocks a.cjttbl-save-changes.cjttbs-disabled {background: url(../images/toolbox/save-changes-inactive.png) no-repeat;}
|
70 |
-
.cjt-toolbox-blocks a.cjttbl-global-settings { background: url(../images/toolbox/settings.png) no-repeat; }
|
71 |
.cjt-toolbox-blocks a.cjttbl-add-block { background: url(../images/toolbox/add-new.png) no-repeat; }
|
72 |
.cjt-toolbox-blocks a.cjttbl-cancel-restore {
|
73 |
background: url(../images/toolbox/cancel-restore.png) no-repeat;
|
@@ -102,4 +100,23 @@ h2#cjt-title {display: inline-block;}
|
|
102 |
|
103 |
/* No Blocks Intro Help text */
|
104 |
cjt-noblocks-intro h2 {font-weight: bold; margin: 4px 0px;}
|
105 |
-
cjt-noblocks-intro h4 {font-weight: bold; font-size: 15px;}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
/** CSS & Javascript Toolkit - blocks page CSS **/
|
2 |
/* Wordpress Page */
|
3 |
.wrap { position: relative; }
|
4 |
+
.cjt-banner-bar .cjt-banner-link a, .cjt-banner-bar a:hover, .cjt-banner-bar a:visited{color: #A5581B;}
|
5 |
+
#cjt-banner-bar-right {right: 0px;position: absolute;top: 2px;text-align: right;}
|
6 |
+
#cjt-banner-bar-right .cjt-banner-link {float: right; margin-bottom: 6px;}
|
7 |
|
|
|
|
|
|
|
|
|
8 |
#get-packages-icon {display: inline-block; width: 13px; height: 15px; background-image: url('../images/get-packages.png'); margin-left: 3px;margin-bottom: -4px; margin-right: 5px;}
|
9 |
|
|
|
|
|
10 |
.blocks-icon32 { background: transparent url('../images/CSS_JS_Toolbox_Icon.png') no-repeat; }
|
11 |
#post-body{ display: none; min-width:700px; }
|
12 |
/* Give extra space for the last Block Code-Auto-Completion dialog */
|
22 |
line-height: 1.3;
|
23 |
padding: 14px 0px;
|
24 |
}
|
25 |
+
|
26 |
/* Blocks loader */
|
27 |
#cjt-blocks-loader { width: 100%; text-align: center; vertical-align: middle; }
|
28 |
#cjt-blocks-loader p.loading-text{ padding-left: 20px; font-weight: bold; font-size: 14px;}
|
35 |
margin-bottom: 20px;
|
36 |
padding: 4px 4px 4px 0px !important;
|
37 |
clear: both;
|
38 |
+
visibility: hidden;
|
39 |
border: solid #ccc;
|
40 |
border-width: 1px;
|
41 |
-moz-border-radius: 6px;
|
62 |
.cjt-toolbox-blocks a.cjttbl-state-tools {width: 28px !important; background: url(../images/toolbox/activate-all.png) no-repeat;}
|
63 |
.cjt-toolbox-blocks a.cjttbl-location-tools { background: url(../images/toolbox/header-all.png) no-repeat; }
|
64 |
.cjt-toolbox-blocks a.cjttbl-admin-tools { background: url(../images/toolbox/admin-tools.png) no-repeat; }
|
65 |
+
.cjt-toolbox-blocks a.cjttbl-templates-manager { background: url(../images/toolbox/templates-manager.png) no-repeat; }
|
66 |
+
.cjt-toolbox-blocks a.cjttbl-global-settings { background: url(../images/toolbox/settings.png) no-repeat; }
|
67 |
.cjt-toolbox-blocks a.cjttbl-save-changes { background: url(../images/toolbox/save-changes.png) no-repeat; }
|
68 |
.cjt-toolbox-blocks a.cjttbl-save-changes.cjttbs-disabled {background: url(../images/toolbox/save-changes-inactive.png) no-repeat;}
|
|
|
69 |
.cjt-toolbox-blocks a.cjttbl-add-block { background: url(../images/toolbox/add-new.png) no-repeat; }
|
70 |
.cjt-toolbox-blocks a.cjttbl-cancel-restore {
|
71 |
background: url(../images/toolbox/cancel-restore.png) no-repeat;
|
100 |
|
101 |
/* No Blocks Intro Help text */
|
102 |
cjt-noblocks-intro h2 {font-weight: bold; margin: 4px 0px;}
|
103 |
+
cjt-noblocks-intro h4 {font-weight: bold; font-size: 15px;}
|
104 |
+
|
105 |
+
h2 {}
|
106 |
+
#cjtoolbox-admin h2 {
|
107 |
+
display: inline-block;
|
108 |
+
}
|
109 |
+
div#cjtoolbox-admin {}
|
110 |
+
a#docs-link {
|
111 |
+
position: relative;
|
112 |
+
top: -2px;
|
113 |
+
font-size: 16px;
|
114 |
+
}
|
115 |
+
span.cjt-banner-link {
|
116 |
+
}
|
117 |
+
span#dicount-code {
|
118 |
+
font-weight: bold;
|
119 |
+
font-size: 14px;
|
120 |
+
background-color: #DFDFDF;
|
121 |
+
padding: 1px 8px;
|
122 |
+
}
|
views/blocks/manager/public/images/CSS_JS_Toolbox_Icon.png
CHANGED
Binary file
|
views/blocks/manager/public/images/toolbox/templates-manager.png
ADDED
Binary file
|
views/blocks/manager/public/js/blocks-page/blocks-page.js
CHANGED
@@ -174,8 +174,41 @@ var CJTBlocksPage;
|
|
174 |
}
|
175 |
);
|
176 |
return isEnabled;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
177 |
}
|
178 |
-
|
179 |
},
|
180 |
|
181 |
/**
|
@@ -191,6 +224,7 @@ var CJTBlocksPage;
|
|
191 |
// Thick box parameters.
|
192 |
width : 450,
|
193 |
height: 230,
|
|
|
194 |
TB_iframe : true // Must be last one Thickbox removes this and later params.
|
195 |
};
|
196 |
var url = CJTBlocksPage.server.getRequestURL('blocksPage', 'get_view', requestData);
|
@@ -198,6 +232,71 @@ var CJTBlocksPage;
|
|
198 |
tb_show(CJTBlocksPageI18N.addNewBlockDialogTitle, url);
|
199 |
},
|
200 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
201 |
/**
|
202 |
* put your comment there...
|
203 |
*
|
@@ -207,7 +306,86 @@ var CJTBlocksPage;
|
|
207 |
var settingsFormURL = CJTBlocksPage.server.getRequestURL('settings', 'manageForm', params);
|
208 |
tb_show(CJTBlocksPageI18N.settingsFormTitle, settingsFormURL);
|
209 |
},
|
210 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
211 |
/**
|
212 |
*
|
213 |
*
|
@@ -236,6 +414,46 @@ var CJTBlocksPage;
|
|
236 |
)
|
237 |
},
|
238 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
239 |
/**
|
240 |
* put your comment there...
|
241 |
*
|
@@ -273,8 +491,11 @@ var CJTBlocksPage;
|
|
273 |
*
|
274 |
*
|
275 |
*/
|
276 |
-
addBlock : function(content) {
|
277 |
var sortable = CJTBlocksPage.blocksContainer;
|
|
|
|
|
|
|
278 |
// Apply toggling: The only way to apply postboxes it via postboxes.add_postbox_toggles method.
|
279 |
// Method finding all .postbox elements and bind to click.
|
280 |
// Exists .postbox(s) will bind to click event twice and the result is
|
@@ -282,8 +503,8 @@ var CJTBlocksPage;
|
|
282 |
// to the newly added one.
|
283 |
var currentBlocks = CJTBlocksPage.blocks.getBlocks();
|
284 |
currentBlocks.removeClass('postbox').addClass('applying-postbox-to-new-block');
|
285 |
-
//
|
286 |
-
sortable
|
287 |
// Note: Only new block will be returned because its the only one with .postbox class.
|
288 |
var newAddedBlock = CJTBlocksPage.blocks.getBlocks().eq(0);
|
289 |
// Add block element.
|
@@ -292,7 +513,7 @@ var CJTBlocksPage;
|
|
292 |
// JUST USE THE CURRENT HASHED (SAVED ON SERVER) + ADDING THE NEW BLOCK!
|
293 |
var newBlockOrderName = CJTBlocksPage.blocks.getSortableName(blockId);
|
294 |
var order = $.merge([], sortable.data('cjtOrders'));
|
295 |
-
order.push(newBlockOrderName);
|
296 |
CJTBlocksPage.saveCustomOrder(order);
|
297 |
// If this is the first block hide the intro and show normal sortable.
|
298 |
if (!CJTBlocksPage.blocks.hasBlocks()) {
|
@@ -332,8 +553,13 @@ var CJTBlocksPage;
|
|
332 |
// Delete block.
|
333 |
$.each(blocks,
|
334 |
function(index, block) {
|
335 |
-
var
|
|
|
336 |
CJTBlocksPage.deletedBlocks.push(blockId);
|
|
|
|
|
|
|
|
|
337 |
$(block).remove();
|
338 |
// Notify save change.
|
339 |
CJTBlocksPage.blockContentChanged(blockId, true);
|
@@ -349,6 +575,16 @@ var CJTBlocksPage;
|
|
349 |
}
|
350 |
},
|
351 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
352 |
/*
|
353 |
*
|
354 |
*
|
@@ -356,7 +592,7 @@ var CJTBlocksPage;
|
|
356 |
*/
|
357 |
init : function() {
|
358 |
// Initialize object vars.
|
359 |
-
CJTBlocksPage.blocksForm = $('
|
360 |
// Prevent form submission, ALL is done through AJAX.
|
361 |
// Pressing Enter in text fields might caused the whole page to be refreshed.
|
362 |
CJTBlocksPage.blocksForm.get(0).onsubmit = function() {return false;}
|
@@ -364,18 +600,47 @@ var CJTBlocksPage;
|
|
364 |
CJTBlocksPage.intro = CJTBlocksPage.blocksForm.find('#cjt-noblocks-intro');
|
365 |
CJTBlocksPage.server = CJTServer;
|
366 |
CJTBlocksPage.server.multiOperation = new CJTBlocksAjaxMultiOperations('blocksPage', 'save_blocks');
|
|
|
|
|
|
|
367 |
// Make sure CJTBlocks is ready.
|
368 |
CJTBlocksPage.blocks = new CJTBlocks();
|
369 |
// Initialize Toolboxes.
|
370 |
CJTBlocksPage.toolboxes.toolboxes = CJTBlocksPage.blocksForm.find('.cjt-toolbox-blocks').CJTToolBox({
|
371 |
handlers : {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
372 |
'save-changes' : {callback : CJTBlocksPage._onsavechanges, params : {enable : false}},
|
373 |
'add-block' : {callback : CJTBlocksPage._onaddnew},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
374 |
'global-settings' : {callback : CJTBlocksPage._onmanagesettings},
|
|
|
|
|
375 |
}
|
376 |
});
|
377 |
// Activate blocks.
|
378 |
-
CJTBlocksPage.blocks.getBlocks().CJTBlock({});
|
379 |
// Hide loading image. #cjt-blocks-loader will be used for other loading later.
|
380 |
CJTBlocksPage.loadingImage = CJTBlocksPage.blocksForm.find('#cjt-blocks-loader');
|
381 |
CJTBlocksPage.loadingImage.find('.loading-text').remove();
|
@@ -405,6 +670,23 @@ var CJTBlocksPage;
|
|
405 |
};
|
406 |
// When navigating away notify saving changes.
|
407 |
window.onbeforeunload = CJTBlocksPage._onunload;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
408 |
},
|
409 |
|
410 |
/*
|
@@ -481,6 +763,16 @@ var CJTBlocksPage;
|
|
481 |
CJTBlocksPage.blocksContainer.data('cjtOrders', ordersArray);
|
482 |
}, this)
|
483 |
);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
484 |
}
|
485 |
|
486 |
} // End class.
|
174 |
}
|
175 |
);
|
176 |
return isEnabled;
|
177 |
+
},
|
178 |
+
|
179 |
+
/*
|
180 |
+
*
|
181 |
+
*
|
182 |
+
*
|
183 |
+
*/
|
184 |
+
switchState : function(state) {
|
185 |
+
var buttonsToHide;
|
186 |
+
switch (state) {
|
187 |
+
case 'restore':
|
188 |
+
// Hide Add New Block, Save all changes, location tools and state tools buttons.
|
189 |
+
buttonsToHide = ['save-changes', 'add-block', 'state-tools', 'location-tools'];
|
190 |
+
break;
|
191 |
+
default:
|
192 |
+
// Hide Restore & Cancel Restore buttons.
|
193 |
+
buttonsToHide = ['restore', 'cancel-restore'];
|
194 |
+
break;
|
195 |
+
}
|
196 |
+
// Hide buttons.
|
197 |
+
this.toolboxes.each(
|
198 |
+
// Get all toolboxes.
|
199 |
+
function(tbIndex, toolbox) {
|
200 |
+
// Hide all buttons for each toolbox.
|
201 |
+
$.each(buttonsToHide,
|
202 |
+
function(btnIndex, buttonName) {
|
203 |
+
var button = toolbox.CJTToolBox.buttons[buttonName];
|
204 |
+
button.jButton.css('display', 'none');
|
205 |
+
}
|
206 |
+
);
|
207 |
+
}
|
208 |
+
);
|
209 |
+
// Display Toolboxes.
|
210 |
+
this.css('visibility', 'visible');
|
211 |
}
|
|
|
212 |
},
|
213 |
|
214 |
/**
|
224 |
// Thick box parameters.
|
225 |
width : 450,
|
226 |
height: 230,
|
227 |
+
position : params.toolbox.position,
|
228 |
TB_iframe : true // Must be last one Thickbox removes this and later params.
|
229 |
};
|
230 |
var url = CJTBlocksPage.server.getRequestURL('blocksPage', 'get_view', requestData);
|
232 |
tb_show(CJTBlocksPageI18N.addNewBlockDialogTitle, url);
|
233 |
},
|
234 |
|
235 |
+
/**
|
236 |
+
* put your comment there...
|
237 |
+
*
|
238 |
+
*/
|
239 |
+
_oncancelrestore : function() {
|
240 |
+
window.location.href = window.location.href.replace(/&backupId=\d+/, '');
|
241 |
+
},
|
242 |
+
|
243 |
+
/**
|
244 |
+
*
|
245 |
+
*
|
246 |
+
*
|
247 |
+
*
|
248 |
+
*/
|
249 |
+
_ondeleteall : function() {
|
250 |
+
// Confimation message!
|
251 |
+
var blocksCount = CJTBlocksPage.blocks.getBlocks().length;
|
252 |
+
var confirmMessage = CJTBlocksPageI18N.commonDeleteMessage.replace('%d', blocksCount)
|
253 |
+
+ "\n\n"
|
254 |
+
+ CJTBlocksPage.blocks.toArray('name').join("\n")
|
255 |
+
+ "\n\n"
|
256 |
+
+ CJTBlocksPageI18N.confirmDeleteAll;
|
257 |
+
// Confirm deletion.
|
258 |
+
if (confirm(confirmMessage)) {
|
259 |
+
CJTBlocksPage.deleteBlocks(CJTBlocksPage.blocks.getBlocks());
|
260 |
+
}
|
261 |
+
},
|
262 |
+
|
263 |
+
/**
|
264 |
+
*
|
265 |
+
*
|
266 |
+
*
|
267 |
+
*
|
268 |
+
*/
|
269 |
+
_ondeleteempty : function() {
|
270 |
+
// initialize blocks.
|
271 |
+
var blocks = CJTBlocksPage.blocks.getBlocks();
|
272 |
+
var emptyBlocks = [];
|
273 |
+
// For every block check if there is code content.
|
274 |
+
blocks.each(
|
275 |
+
function(index, block) {
|
276 |
+
var code = block.CJTBlock.block.get('code');
|
277 |
+
if (code == '') {
|
278 |
+
emptyBlocks.push(this);
|
279 |
+
}
|
280 |
+
}
|
281 |
+
);
|
282 |
+
// If there is at least one empty block to delete just confirm
|
283 |
+
// otherwise show error!
|
284 |
+
if (emptyBlocks.length) {
|
285 |
+
// Confimation message!
|
286 |
+
var confirmMessage = CJTBlocksPageI18N.commonDeleteMessage.replace('%d', emptyBlocks.length)
|
287 |
+
+ "\n\n"
|
288 |
+
+ CJTBlocksPage.blocks.toArray('name', emptyBlocks).join("\n")
|
289 |
+
+ "\n\n"
|
290 |
+
+ CJTBlocksPageI18N.confirmDeleteEmpty;
|
291 |
+
if (confirm(confirmMessage)) {
|
292 |
+
CJTBlocksPage.deleteBlocks(emptyBlocks);
|
293 |
+
}
|
294 |
+
}
|
295 |
+
else {
|
296 |
+
alert(CJTBlocksPageI18N.noBlocksToDelete)
|
297 |
+
}
|
298 |
+
},
|
299 |
+
|
300 |
/**
|
301 |
* put your comment there...
|
302 |
*
|
306 |
var settingsFormURL = CJTBlocksPage.server.getRequestURL('settings', 'manageForm', params);
|
307 |
tb_show(CJTBlocksPageI18N.settingsFormTitle, settingsFormURL);
|
308 |
},
|
309 |
+
|
310 |
+
/**
|
311 |
+
* put your comment there...
|
312 |
+
*
|
313 |
+
*/
|
314 |
+
_onmanagetemplates : function() {
|
315 |
+
var params = {width: '100%', height: '100%', TB_iframe : true};
|
316 |
+
var url = CJTBlocksPage.server.getRequestURL('templatesManager', 'display', params);
|
317 |
+
tb_show(CJTBlocksPageI18N.manageTemplatesFormTitle, url);
|
318 |
+
// Get thickbox form element.
|
319 |
+
var thickboxForm = $('#TB_window');
|
320 |
+
// Style thickbox.
|
321 |
+
thickboxForm.css({
|
322 |
+
'position' : 'fixed',
|
323 |
+
'left' : '0px',
|
324 |
+
'top' : '4px',
|
325 |
+
'margin-left' : '5px',
|
326 |
+
'margin-top': '0px',
|
327 |
+
'width' : '99%',
|
328 |
+
'height' : ((jQuery(window).height() - 40) + 'px'),
|
329 |
+
'z-index' : 1000000
|
330 |
+
});
|
331 |
+
// Set Iframe style.
|
332 |
+
thickboxForm.find('iframe').css({
|
333 |
+
width : '100%',
|
334 |
+
height : '100%'
|
335 |
+
});
|
336 |
+
},
|
337 |
+
|
338 |
+
/**
|
339 |
+
*
|
340 |
+
*
|
341 |
+
*
|
342 |
+
*
|
343 |
+
*/
|
344 |
+
_onmanagebackups : function() {
|
345 |
+
// Server request.
|
346 |
+
var requestData = {
|
347 |
+
// Thick box parameters.
|
348 |
+
width : 480,
|
349 |
+
height: 400,
|
350 |
+
TB_iframe : true // Must be last one Thickbox removes this and later params.
|
351 |
+
};
|
352 |
+
var url = CJTBlocksPage.server.getRequestURL('blocksBackups', 'list', requestData);
|
353 |
+
tb_show(CJTBlocksPageI18N.manageBackupsDialogTitle, url);
|
354 |
+
},
|
355 |
+
|
356 |
+
/**
|
357 |
+
* put your comment there...
|
358 |
+
*
|
359 |
+
*/
|
360 |
+
_onrestore : function() {
|
361 |
+
// Confirm restore.
|
362 |
+
var doRestore = confirm(CJTBlocksPageI18N.confirmRestoreBlocks);
|
363 |
+
if (doRestore) {
|
364 |
+
// Disable restore button for all toolboxes.
|
365 |
+
var ibCancelRestore = CJTBlocksPage.toolboxes.getIButton('cancel-restore', 'enable', [false]);
|
366 |
+
// SHow loading for restore buttons.
|
367 |
+
var ibRestoreLoader = CJTBlocksPage.toolboxes.getIButton('restore', 'loading', [true, false]);
|
368 |
+
// Send request to server.
|
369 |
+
var requestData = {backupId : CJTBlocksPage.isRestore()};
|
370 |
+
CJTBlocksPage.server.send('blocksBackups', 'restore', requestData)
|
371 |
+
.success(
|
372 |
+
function() {
|
373 |
+
// Refresh the page without backupId parameter.
|
374 |
+
CJTBlocksPage._oncancelrestore();
|
375 |
+
}
|
376 |
+
)
|
377 |
+
.error(
|
378 |
+
function() {
|
379 |
+
// Notify user error.
|
380 |
+
alert(CJTBlocksPageI18N.unableToRestoreBackup);
|
381 |
+
// Stop loading progress.
|
382 |
+
ibCancelRestore.dispatch([true]);
|
383 |
+
ibRestoreLoader.dispatch([false, true]);
|
384 |
+
}
|
385 |
+
);
|
386 |
+
}
|
387 |
+
},
|
388 |
+
|
389 |
/**
|
390 |
*
|
391 |
*
|
414 |
)
|
415 |
},
|
416 |
|
417 |
+
/**
|
418 |
+
*
|
419 |
+
*
|
420 |
+
*
|
421 |
+
*
|
422 |
+
*/
|
423 |
+
_onswitchflag : function(event, params) {
|
424 |
+
var multiOperationServer = CJTBlocksPage.server.multiOperation;
|
425 |
+
var eventName = 'switch' + params.flag.ucFirst();
|
426 |
+
// First queue blocks flag.
|
427 |
+
multiOperationServer.trigger(eventName, params)
|
428 |
+
// Second send all queued stack to sgerver.
|
429 |
+
.send('post');
|
430 |
+
},
|
431 |
+
|
432 |
+
/**
|
433 |
+
*
|
434 |
+
*
|
435 |
+
*
|
436 |
+
*
|
437 |
+
*/
|
438 |
+
_ontoggle : function(event, params) {
|
439 |
+
// Show or Hide blocks.
|
440 |
+
var blocks = CJTBlocksPage.blocks.getBlocks();
|
441 |
+
switch (params.state) {
|
442 |
+
case false:
|
443 |
+
// Close postboxes.
|
444 |
+
blocks.addClass('closed');
|
445 |
+
break;
|
446 |
+
case true:
|
447 |
+
// Open postboxes.
|
448 |
+
blocks.removeClass('closed');
|
449 |
+
// Notify postbox opened.
|
450 |
+
blocks.each(function() {this.CJTBlock._onpostboxopened();});
|
451 |
+
break;
|
452 |
+
}
|
453 |
+
// Save (batch) state.
|
454 |
+
postboxes.save_state('cjtoolbox');
|
455 |
+
},
|
456 |
+
|
457 |
/**
|
458 |
* put your comment there...
|
459 |
*
|
491 |
*
|
492 |
*
|
493 |
*/
|
494 |
+
addBlock : function(position, content) {
|
495 |
var sortable = CJTBlocksPage.blocksContainer;
|
496 |
+
// New Block positions to jQuery methods mapping.
|
497 |
+
var positions = {top : 'prepend', bottom : 'append'};
|
498 |
+
var positionMethod = positions[position];
|
499 |
// Apply toggling: The only way to apply postboxes it via postboxes.add_postbox_toggles method.
|
500 |
// Method finding all .postbox elements and bind to click.
|
501 |
// Exists .postbox(s) will bind to click event twice and the result is
|
503 |
// to the newly added one.
|
504 |
var currentBlocks = CJTBlocksPage.blocks.getBlocks();
|
505 |
currentBlocks.removeClass('postbox').addClass('applying-postbox-to-new-block');
|
506 |
+
// Add block to the selected position.
|
507 |
+
sortable[positionMethod](content);
|
508 |
// Note: Only new block will be returned because its the only one with .postbox class.
|
509 |
var newAddedBlock = CJTBlocksPage.blocks.getBlocks().eq(0);
|
510 |
// Add block element.
|
513 |
// JUST USE THE CURRENT HASHED (SAVED ON SERVER) + ADDING THE NEW BLOCK!
|
514 |
var newBlockOrderName = CJTBlocksPage.blocks.getSortableName(blockId);
|
515 |
var order = $.merge([], sortable.data('cjtOrders'));
|
516 |
+
(position == 'top') ? order.unshift(newBlockOrderName) : order.push(newBlockOrderName);
|
517 |
CJTBlocksPage.saveCustomOrder(order);
|
518 |
// If this is the first block hide the intro and show normal sortable.
|
519 |
if (!CJTBlocksPage.blocks.hasBlocks()) {
|
553 |
// Delete block.
|
554 |
$.each(blocks,
|
555 |
function(index, block) {
|
556 |
+
var blockPlg = block.CJTBlock;
|
557 |
+
var blockId = blockPlg.block.get('id');
|
558 |
CJTBlocksPage.deletedBlocks.push(blockId);
|
559 |
+
// Notify Menu and Code Files Manager.
|
560 |
+
// Only for Loaded Blocks.
|
561 |
+
blockPlg.menu && blockPlg.menu.ondeleteblock();
|
562 |
+
blockPlg.codeFile && blockPlg.codeFile.ondeleteblock();
|
563 |
$(block).remove();
|
564 |
// Notify save change.
|
565 |
CJTBlocksPage.blockContentChanged(blockId, true);
|
575 |
}
|
576 |
},
|
577 |
|
578 |
+
/*
|
579 |
+
*
|
580 |
+
*
|
581 |
+
*
|
582 |
+
*/
|
583 |
+
getStateName : function() {
|
584 |
+
var stateName = this.isRestore() ? 'restore' : '';
|
585 |
+
return stateName;
|
586 |
+
},
|
587 |
+
|
588 |
/*
|
589 |
*
|
590 |
*
|
592 |
*/
|
593 |
init : function() {
|
594 |
// Initialize object vars.
|
595 |
+
CJTBlocksPage.blocksForm = $('#cjtoolbox-blocks-page-form');
|
596 |
// Prevent form submission, ALL is done through AJAX.
|
597 |
// Pressing Enter in text fields might caused the whole page to be refreshed.
|
598 |
CJTBlocksPage.blocksForm.get(0).onsubmit = function() {return false;}
|
600 |
CJTBlocksPage.intro = CJTBlocksPage.blocksForm.find('#cjt-noblocks-intro');
|
601 |
CJTBlocksPage.server = CJTServer;
|
602 |
CJTBlocksPage.server.multiOperation = new CJTBlocksAjaxMultiOperations('blocksPage', 'save_blocks');
|
603 |
+
// Initilize Global-Blocks Conponents.
|
604 |
+
CJTBlockMenuView.initialize();
|
605 |
+
CJTBlockCodeFileView.initialize();
|
606 |
// Make sure CJTBlocks is ready.
|
607 |
CJTBlocksPage.blocks = new CJTBlocks();
|
608 |
// Initialize Toolboxes.
|
609 |
CJTBlocksPage.toolboxes.toolboxes = CJTBlocksPage.blocksForm.find('.cjt-toolbox-blocks').CJTToolBox({
|
610 |
handlers : {
|
611 |
+
'state-tools' : {
|
612 |
+
type : 'Popup',
|
613 |
+
params : {_type : {targetElement : '.state-tools'}}
|
614 |
+
},
|
615 |
+
'location-tools' : {
|
616 |
+
type : 'Popup',
|
617 |
+
params : {_type : {targetElement : '.location-tools'}}
|
618 |
+
},
|
619 |
+
'admin-tools' : {
|
620 |
+
type : 'Popup',
|
621 |
+
params : {_type : {targetElement : '.admin-tools'}}
|
622 |
+
},
|
623 |
'save-changes' : {callback : CJTBlocksPage._onsavechanges, params : {enable : false}},
|
624 |
'add-block' : {callback : CJTBlocksPage._onaddnew},
|
625 |
+
'restore' : {callback : CJTBlocksPage._onrestore},
|
626 |
+
'cancel-restore' : {callback : CJTBlocksPage._oncancelrestore},
|
627 |
+
'delete-all' : {callback : CJTBlocksPage._ondeleteall},
|
628 |
+
'delete-empty' : {callback : CJTBlocksPage._ondeleteempty},
|
629 |
+
'reset-order' : {callback : CJTBlocksPage._onresetorder},
|
630 |
+
'manage-backups' : {callback : CJTBlocksPage._onmanagebackups},
|
631 |
+
'footer-all' : {callback : CJTBlocksPage._onswitchflag, params : {flag : 'location', newValue : 'footer'}},
|
632 |
+
'header-all' : {callback : CJTBlocksPage._onswitchflag, params : {flag : 'location', newValue : 'header'}},
|
633 |
+
'activate-all' : {callback : CJTBlocksPage._onswitchflag, params : {flag : 'state', newValue : 'active'}},
|
634 |
+
'deactivate-all' : {callback : CJTBlocksPage._onswitchflag, params : {flag : 'state', newValue : 'inactive'}},
|
635 |
+
'revert-state' : {callback : CJTBlocksPage._onswitchflag, params : {flag : 'state'}},
|
636 |
+
'templates-manager' : {callback : CJTBlocksPage._onmanagetemplates},
|
637 |
'global-settings' : {callback : CJTBlocksPage._onmanagesettings},
|
638 |
+
'close-all' : {callback : CJTBlocksPage._ontoggle, params : {state: false}},
|
639 |
+
'open-all' : {callback : CJTBlocksPage._ontoggle, params : {state : true}}
|
640 |
}
|
641 |
});
|
642 |
// Activate blocks.
|
643 |
+
CJTBlocksPage.blocks.getBlocks().CJTBlock({state : CJTBlocksPage.getStateName()});
|
644 |
// Hide loading image. #cjt-blocks-loader will be used for other loading later.
|
645 |
CJTBlocksPage.loadingImage = CJTBlocksPage.blocksForm.find('#cjt-blocks-loader');
|
646 |
CJTBlocksPage.loadingImage.find('.loading-text').remove();
|
670 |
};
|
671 |
// When navigating away notify saving changes.
|
672 |
window.onbeforeunload = CJTBlocksPage._onunload;
|
673 |
+
// Switch blocks page state.
|
674 |
+
CJTBlocksPage.switchState(CJTBlocksPage.getStateName());
|
675 |
+
},
|
676 |
+
|
677 |
+
/*
|
678 |
+
*
|
679 |
+
*
|
680 |
+
*
|
681 |
+
*/
|
682 |
+
isRestore : function() {
|
683 |
+
// If there is backupId parameter then this is a restore state.
|
684 |
+
var regEx = /backupId=(\d+)/;
|
685 |
+
var backupId = false;
|
686 |
+
if (regEx.test(window.location.href)) {
|
687 |
+
backupId = parseInt(window.location.href.match(regEx)[1]);
|
688 |
+
}
|
689 |
+
return backupId;
|
690 |
},
|
691 |
|
692 |
/*
|
763 |
CJTBlocksPage.blocksContainer.data('cjtOrders', ordersArray);
|
764 |
}, this)
|
765 |
);
|
766 |
+
},
|
767 |
+
|
768 |
+
/*
|
769 |
+
*
|
770 |
+
*
|
771 |
+
*
|
772 |
+
*/
|
773 |
+
switchState : function(state) {
|
774 |
+
// For now only toolboxes need to switch state.
|
775 |
+
CJTBlocksPage.toolboxes.switchState(state);
|
776 |
}
|
777 |
|
778 |
} // End class.
|
views/blocks/manager/public/js/blocks-page/blocks-page.localization.php
CHANGED
@@ -11,9 +11,11 @@
|
|
11 |
*/
|
12 |
return array(
|
13 |
'addNewBlockDialogTitle' => cssJSToolbox::getText('Create New Code Block'),
|
|
|
14 |
'manageBackupsDialogTitle' => cssJSToolbox::getText('Backups'),
|
15 |
'confirmRestoreBlocks' => cssJSToolbox::getText('Restoring blocks backup will result in losing all the current blocks.')."\n\n".cssJSToolbox::getText('Are you sure, you\'d like to continue?'),
|
16 |
'unableToRestoreBackup' => cssJSToolbox::getText('Backup could not be restored'),
|
|
|
17 |
'commonDeleteMessage' => cssJSToolbox::getText('You\'re about to delete %d code block(s).'),
|
18 |
'confirmDeleteAll' => cssJSToolbox::getText('Are you sure you want to delete all code blocks?'),
|
19 |
'confirmDeleteEmpty' => cssJSToolbox::getText('Are you sure you want to delete all the empty code blocks?'),
|
11 |
*/
|
12 |
return array(
|
13 |
'addNewBlockDialogTitle' => cssJSToolbox::getText('Create New Code Block'),
|
14 |
+
'settingsFormTitle' => cssJSToolbox::getText('General settings'),
|
15 |
'manageBackupsDialogTitle' => cssJSToolbox::getText('Backups'),
|
16 |
'confirmRestoreBlocks' => cssJSToolbox::getText('Restoring blocks backup will result in losing all the current blocks.')."\n\n".cssJSToolbox::getText('Are you sure, you\'d like to continue?'),
|
17 |
'unableToRestoreBackup' => cssJSToolbox::getText('Backup could not be restored'),
|
18 |
+
'manageTemplatesFormTitle' => cssJSToolbox::getText('Templates Manager'),
|
19 |
'commonDeleteMessage' => cssJSToolbox::getText('You\'re about to delete %d code block(s).'),
|
20 |
'confirmDeleteAll' => cssJSToolbox::getText('Are you sure you want to delete all code blocks?'),
|
21 |
'confirmDeleteEmpty' => cssJSToolbox::getText('Are you sure you want to delete all the empty code blocks?'),
|
views/blocks/manager/public/js/blocks/blocks.js
CHANGED
@@ -41,7 +41,6 @@ var CJTBlocks;
|
|
41 |
*
|
42 |
*/
|
43 |
this.calculateChanges = function(changes, id, change) {
|
44 |
-
var isChanged = false;
|
45 |
// If field value changed add it to changes list.
|
46 |
if (change) {
|
47 |
changes[id] = true;
|
@@ -50,16 +49,7 @@ var CJTBlocks;
|
|
50 |
// Remove unchanged element.
|
51 |
delete changes[id];
|
52 |
}
|
53 |
-
|
54 |
-
$.each(changes,
|
55 |
-
function() {
|
56 |
-
if (this == true) {
|
57 |
-
isChanged = true;
|
58 |
-
return;
|
59 |
-
}
|
60 |
-
}
|
61 |
-
);
|
62 |
-
return isChanged;
|
63 |
}
|
64 |
|
65 |
/**
|
@@ -127,6 +117,24 @@ var CJTBlocks;
|
|
127 |
return ((hasBlocks == 'true') ? true : false);
|
128 |
}
|
129 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
130 |
/**
|
131 |
*
|
132 |
*/
|
41 |
*
|
42 |
*/
|
43 |
this.calculateChanges = function(changes, id, change) {
|
|
|
44 |
// If field value changed add it to changes list.
|
45 |
if (change) {
|
46 |
changes[id] = true;
|
49 |
// Remove unchanged element.
|
50 |
delete changes[id];
|
51 |
}
|
52 |
+
return this.hasChanges(changes);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
53 |
}
|
54 |
|
55 |
/**
|
117 |
return ((hasBlocks == 'true') ? true : false);
|
118 |
}
|
119 |
|
120 |
+
/**
|
121 |
+
*
|
122 |
+
*/
|
123 |
+
this.hasChanges = function(changes) {
|
124 |
+
// Initially to no changes.
|
125 |
+
var isChanged = false;
|
126 |
+
// Change is detected if there is at least one element found.
|
127 |
+
$.each(changes,
|
128 |
+
function() {
|
129 |
+
if (this == true) {
|
130 |
+
isChanged = true;
|
131 |
+
return;
|
132 |
+
}
|
133 |
+
}
|
134 |
+
);
|
135 |
+
return isChanged;
|
136 |
+
};
|
137 |
+
|
138 |
/**
|
139 |
*
|
140 |
*/
|
views/blocks/manager/tmpl/blocks.html.tmpl
CHANGED
@@ -7,13 +7,18 @@
|
|
7 |
defined('ABSPATH') or die("Access denied");
|
8 |
?>
|
9 |
<div id="cjtoolbox-admin" class="wrap">
|
10 |
-
|
11 |
-
|
12 |
-
<
|
13 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
14 |
</div>
|
15 |
-
|
16 |
-
<form id="cjtoolbox-blocks-page-form" method="post">
|
17 |
<?php wp_nonce_field('cjtoolbox'); ?>
|
18 |
<?php wp_nonce_field('closedpostboxes', 'closedpostboxesnonce', false); ?>
|
19 |
<?php wp_nonce_field('meta-box-order', 'meta-box-order-nonce', false); ?>
|
@@ -32,10 +37,6 @@ defined('ABSPATH') or die("Access denied");
|
|
32 |
<?php echo $this->getTemplate('toolbox', array('location' => 'bottom')); ?>
|
33 |
</div>
|
34 |
</div>
|
35 |
-
</form>
|
36 |
-
<div id="cjtoolbox-tips">
|
37 |
-
<ul>
|
38 |
-
<li><span style="font-weight:bold"><?php echo cssJSToolbox::getText('Warning!') ?></span> <?php echo cssJSToolbox::getText('Please make sure to validate added CSS & JavaScript codes, the plugin doesn\'t do that for you!') ?></li>
|
39 |
-
</ul>
|
40 |
</div>
|
|
|
41 |
</div>
|
7 |
defined('ABSPATH') or die("Access denied");
|
8 |
?>
|
9 |
<div id="cjtoolbox-admin" class="wrap">
|
10 |
+
<?php require CJTOOLBOX_VIEWS_PATH . '/blocks/block/tmpl/menu/menu.html.tmpl' ?>
|
11 |
+
<?php require CJTOOLBOX_VIEWS_PATH . '/blocks/block/tmpl/codefile/codefile.html.tmpl' ?>
|
12 |
+
<h2><?php echo cssJSToolbox::getText('CSS & Javascript Toolbox Free') ?></h2>
|
13 |
+
<a id="docs-link" target="_blank" href="http://<?php echo cssJSToolbox::CJT_WEB_SITE_DOMAIN ?>/documentation/"><?php echo cssJSToolbox::getText('Online Documentation') ?></a>
|
14 |
+
<div id="cjt-banner-bar-right">
|
15 |
+
<span class="cjt-banner-link">
|
16 |
+
Like CSS & JS Toolbox Free? <a target="_blank" href="http://<?php echo cssJSToolbox::CJT_WEB_SITE_DOMAIN ?>/pricing/"><?php echo cssJSToolbox::getText('Upgrade CJT-Free') ?></a>
|
17 |
+
</span>
|
18 |
+
<br />
|
19 |
+
<span>Enter <span id="dicount-code">CJT-DISCOUNT</span> and Save 50% Now!!!!</span>
|
20 |
</div>
|
21 |
+
<div id="cjtoolbox-blocks-page-form" method="post">
|
|
|
22 |
<?php wp_nonce_field('cjtoolbox'); ?>
|
23 |
<?php wp_nonce_field('closedpostboxes', 'closedpostboxesnonce', false); ?>
|
24 |
<?php wp_nonce_field('meta-box-order', 'meta-box-order-nonce', false); ?>
|
37 |
<?php echo $this->getTemplate('toolbox', array('location' => 'bottom')); ?>
|
38 |
</div>
|
39 |
</div>
|
|
|
|
|
|
|
|
|
|
|
40 |
</div>
|
41 |
+
<div id="cjt-inline-popup"></div>
|
42 |
</div>
|
views/blocks/manager/tmpl/help/intro.html.tmpl
CHANGED
@@ -8,6 +8,18 @@ defined('ABSPATH') or die("Access denied");
|
|
8 |
?>
|
9 |
|
10 |
<h2><?php echo cssJSToolbox::getText('Welcome to the CSS & JavaScript Toolbox dashboard') ?></h2>
|
11 |
-
<p><?php echo cssJSToolbox::getText('Since you do not have any code blocks active, you can create a new code block.') ?></p>
|
12 |
<h4><?php echo cssJSToolbox::getText('Create a new Code Block') ?></h4>
|
13 |
-
<p><?php echo cssJSToolbox::getText('You can add a new code block by clicking the New Code Block button. Once your code block has been added, simply choose the editor you wish to work with and write your code. You can then select if you want your code to run in the header or the footer of the webpage. Now it\'s just a matter of selecting the webpage where you want the code to run on, by using the Assignment Panel. This panel lets you assign your code block to Pages, Posts, Categories, URLs, and much more, and you can select as many as you need. Once you have saved your code block by clicking the Save button (or Save All Changes button), you can see it in action by refreshing the assigned webpage.') ?></p>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
8 |
?>
|
9 |
|
10 |
<h2><?php echo cssJSToolbox::getText('Welcome to the CSS & JavaScript Toolbox dashboard') ?></h2>
|
11 |
+
<p><?php echo cssJSToolbox::getText('Since you do not have any code blocks active, you can either: create a new code block or create a new code template.') ?></p>
|
12 |
<h4><?php echo cssJSToolbox::getText('Create a new Code Block') ?></h4>
|
13 |
+
<p><?php echo cssJSToolbox::getText('You can add a new code block by clicking the New Code Block button. Once your code block has been added, simply choose the editor you wish to work with and write your code. You can then select if you want your code to run in the header or the footer of the webpage. Now it\'s just a matter of selecting the webpage where you want the code to run on, by using the Assignment Panel. This panel lets you assign your code block to Pages, Posts, Categories, URLs, and much more, and you can select as many as you need. Once you have saved your code block by clicking the Save button (or Save All Changes button), you can see it in action by refreshing the assigned webpage.') ?></p>
|
14 |
+
<h4><?php echo cssJSToolbox::getText('Create a new Code Template') ?></h4>
|
15 |
+
<p><?php echo cssJSToolbox::getText('You can create code templates when you click into the Code Template Manager. To find this, hover over the icon showing a small cog over pages, and a tooltip should say Code Template Manager. Press this and if you have chosen to install the Template Samples, you will notice them sitting in there ready to be used. If you want to create a code template from scratch, click the Create Template button. Here you can choose a name for your code template, select a code language type (i.e. CSS, JavaScript, HTML, PHP), choose whether the template is in Draft or Published state, and then write your code. You have other tabs that allow you to write a Description, add Keywords and Version number, etc. Once you are happy with your code template, you can click the Save button') ?></p>
|
16 |
+
<h4><?php echo cssJSToolbox::getText('Embedding or Linking a Code Templates') ?></h4>
|
17 |
+
<p> <?php echo cssJSToolbox::getText('Code Templates can be either embedded or linked into your code blocks. To see all your code templates, you have to click the Template Lookup icon by hovering over the icon with the open/closed angled brackets. A popup will appear showing you code templates in the form of users and they are:') ?></p>
|
18 |
+
<ol>
|
19 |
+
<li><?php echo cssJSToolbox::getText('WordPress: default code templates that are packaged with WordPress') ?></li>
|
20 |
+
<li><?php echo cssJSToolbox::getText('Sample Templates: CJT Sample Templates (depending if Sample Templates were selected during install)') ?></li>
|
21 |
+
<li><?php echo cssJSToolbox::getText('Users: code templates created by actual WordPress users and administrators') ?> </li>
|
22 |
+
</ol>
|
23 |
+
<p><?php echo cssJSToolbox::getText('You can click on any of the 3 types of users to see all of their code templates, and you can either embed or link these to code blocks.') ?></p>
|
24 |
+
<p><strong><?php echo cssJSToolbox::getText('Embed') ?></strong>: <?php echo cssJSToolbox::getText('embedding a code template will paste the entire template contents into the code block editor. This can be ideal if you want to do further enhancements and customisations to the code without permanently changing the base template.') ?></p>
|
25 |
+
<p><strong><?php echo cssJSToolbox::getText('Link') ?></strong>: <?php echo cssJSToolbox::getText('linking the code template does not actually paste the template into the code block editor but instead links to it. This is more ideal if you want to link many code templates to the one code block. There is no need to create individual code blocks for each.') ?></p>
|
views/blocks/manager/tmpl/toolbox.html.tmpl
CHANGED
@@ -2,8 +2,42 @@
|
|
2 |
<div class="icons-group left-bar">
|
3 |
<a class="cjt-tb-link l-127x23 textButton cjttbl-add-block" title="<?php echo cssJSToolbox::getText('Add new code block') ?>"><?php echo cssJSToolbox::getText('New Code Block') ?></a>
|
4 |
<a class="cjt-tb-link l-127x23 textButton cjttbl-save-changes" title="<?php echo cssJSToolbox::getText('Save changes to all code blocks') ?>"><?php echo cssJSToolbox::getText('Save All Changes') ?></a>
|
|
|
|
|
5 |
</div>
|
6 |
<div class="icons-group tools-menu">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
7 |
<a class="cjt-tb-link cjttbl-global-settings" title="<?php echo cssJSToolbox::getText('General plugin settings') ?>"></a>
|
|
|
|
|
|
|
8 |
</div>
|
9 |
</div>
|
2 |
<div class="icons-group left-bar">
|
3 |
<a class="cjt-tb-link l-127x23 textButton cjttbl-add-block" title="<?php echo cssJSToolbox::getText('Add new code block') ?>"><?php echo cssJSToolbox::getText('New Code Block') ?></a>
|
4 |
<a class="cjt-tb-link l-127x23 textButton cjttbl-save-changes" title="<?php echo cssJSToolbox::getText('Save changes to all code blocks') ?>"><?php echo cssJSToolbox::getText('Save All Changes') ?></a>
|
5 |
+
<a class="cjt-tb-link l-127x23 textButton cjttbl-cancel-restore" title="<?php echo cssJSToolbox::getText('Cancel backup restoring') ?>"><?php echo cssJSToolbox::getText('Cancel Restore') ?></a>
|
6 |
+
<a class="cjt-tb-link l-127x23 textButton cjttbl-restore" title="<?php echo cssJSToolbox::getText('Save restored Backup') ?>"><?php echo cssJSToolbox::getText('Restore') ?></a>
|
7 |
</div>
|
8 |
<div class="icons-group tools-menu">
|
9 |
+
<a class="cjt-tb-link cjttbl-state-tools" title="<?php echo cssJSToolbox::getText('Tools for block state (batch)') ?>"></a>
|
10 |
+
<div class="popup-menu state-tools" style="display:none">
|
11 |
+
<a class="cjt-tb-link cjt-tb-text-link cjttbl-activate-all" title="<?php echo cssJSToolbox::getText('Activate (turn on) all code blocks') ?>"><?php echo cssJSToolbox::getText('Activate All') ?></a>
|
12 |
+
<br />
|
13 |
+
<a class="cjt-tb-link cjt-tb-text-link cjttbl-deactivate-all" title="<?php echo cssJSToolbox::getText('Deactivate (turn off) all code blocks') ?>"><?php echo cssJSToolbox::getText('Deactivate All') ?></a>
|
14 |
+
<br />
|
15 |
+
<a class="cjt-tb-link cjt-tb-text-link cjttbl-revert-state" title="<?php echo cssJSToolbox::getText('Switch current state for all code blocks') ?>"><?php echo cssJSToolbox::getText('Revert State') ?></a>
|
16 |
+
</div>
|
17 |
+
|
18 |
+
<a class="cjt-tb-link cjttbl-location-tools" title="<?php echo cssJSToolbox::getText('Tools for location hook (batch)') ?>"></a>
|
19 |
+
<div class="popup-menu location-tools" style="display:none">
|
20 |
+
<a class="cjt-tb-link cjt-tb-text-link cjttbl-footer-all" title="<?php echo cssJSToolbox::getText('Set output location hook to footer for all code blocks') ?>"><?php echo cssJSToolbox::getText('Footer all') ?></a>
|
21 |
+
<br />
|
22 |
+
<a class="cjt-tb-link cjt-tb-text-link cjttbl-header-all" title="<?php echo cssJSToolbox::getText('Set output location hook to header for all code blocks') ?>"><?php echo cssJSToolbox::getText('Header all') ?></a>
|
23 |
+
</div>
|
24 |
+
|
25 |
+
<div class="divider"></div>
|
26 |
+
<a class="cjt-tb-link cjttbl-templates-manager" title="<?php echo cssJSToolbox::getText('Code Template Manager') ?>"></a>
|
27 |
+
|
28 |
+
<div class="divider"></div>
|
29 |
+
<a class="cjt-tb-link cjttbl-admin-tools" title="<?php echo cssJSToolbox::getText('Tools for block cleanup and backup') ?>"></a>
|
30 |
+
<div class="popup-menu admin-tools" style="display:none">
|
31 |
+
<a class="cjt-tb-link cjt-tb-text-link cjttbl-delete-all" title="<?php echo cssJSToolbox::getText('Delete all code blocks') ?>"><?php echo cssJSToolbox::getText('Delete all') ?></a>
|
32 |
+
<br />
|
33 |
+
<a class="cjt-tb-link cjt-tb-text-link cjttbl-delete-empty" title="<?php echo cssJSToolbox::getText('Delete only empty code blocks') ?>"><?php echo cssJSToolbox::getText('Delete Empty') ?></a>
|
34 |
+
<br />
|
35 |
+
<a class="cjt-tb-link cjt-tb-text-link cjttbl-manage-backups" title="<?php echo cssJSToolbox::getText('Backup Manager - Create, restore, or delete backups') ?>"><?php echo cssJSToolbox::getText('Backups') ?></a>
|
36 |
+
</div>
|
37 |
+
|
38 |
<a class="cjt-tb-link cjttbl-global-settings" title="<?php echo cssJSToolbox::getText('General plugin settings') ?>"></a>
|
39 |
+
<div class="divider"></div>
|
40 |
+
<a class="cjt-tb-link cjttbl-open-all" title="<?php echo cssJSToolbox::getText('Maximise all code blocks') ?>"></a>
|
41 |
+
<a class="cjt-tb-link cjttbl-close-all" title="<?php echo cssJSToolbox::getText('Minimise all code blocks') ?>"></a>
|
42 |
</div>
|
43 |
</div>
|
views/blocks/metabox/public/css/metabox.css
ADDED
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/* Give extra space for the last Block Code-Auto-Completion dialog */
|
2 |
+
#wpbody-content {margin-bottom: 270px; overflow: visible !important;}
|
3 |
+
|
4 |
+
.cjt-create-metabox-metabox-form .notice {
|
5 |
+
font-weight: bold;
|
6 |
+
}
|
7 |
+
.cjcodeblock {
|
8 |
+
margin-right: 0px !important; /* Override block.css style */
|
9 |
+
}
|
10 |
+
|
11 |
+
/** Editor toolbox */
|
12 |
+
.editor-toolbox a.cjttbl-preview {background-image: url(../images/editor-toolbox/preview.png);}
|
views/blocks/metabox/public/images/editor-toolbox/preview.png
ADDED
Binary file
|
views/blocks/metabox/public/js/block/block.js
ADDED
@@ -0,0 +1,39 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
*
|
3 |
+
*/
|
4 |
+
var CJTBlock;
|
5 |
+
|
6 |
+
/**
|
7 |
+
*
|
8 |
+
*/
|
9 |
+
(function($) {
|
10 |
+
|
11 |
+
/**
|
12 |
+
* put your comment there...
|
13 |
+
*
|
14 |
+
* @param element
|
15 |
+
*/
|
16 |
+
CJTBlock = function(blockPlugin, element) {
|
17 |
+
|
18 |
+
// Constructor.
|
19 |
+
this.CJTBlock = function() {
|
20 |
+
// Initialize parent.
|
21 |
+
this.CJTBlockBase(blockPlugin, element, {});
|
22 |
+
}
|
23 |
+
|
24 |
+
/**
|
25 |
+
*
|
26 |
+
*/
|
27 |
+
this.load = function() {
|
28 |
+
// Load base model.
|
29 |
+
this.loadBase({});
|
30 |
+
}
|
31 |
+
|
32 |
+
// Construct!
|
33 |
+
this.CJTBlock();
|
34 |
+
}
|
35 |
+
|
36 |
+
// Extend CJTBlockBase class.
|
37 |
+
CJTBlock.prototype = new CJTBlockBase();
|
38 |
+
|
39 |
+
})(jQuery)
|
views/blocks/metabox/public/js/jquery.block/jquery.block.js
ADDED
@@ -0,0 +1,73 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
*
|
3 |
+
*/
|
4 |
+
|
5 |
+
/**
|
6 |
+
*
|
7 |
+
*/
|
8 |
+
(function($) {
|
9 |
+
|
10 |
+
/**
|
11 |
+
* Override CJTBlockPlugin class.
|
12 |
+
*
|
13 |
+
* @param node
|
14 |
+
* @param args
|
15 |
+
*/
|
16 |
+
CJTBlockPlugin = function(node, args) {
|
17 |
+
|
18 |
+
|
19 |
+
/**
|
20 |
+
* put your comment there...
|
21 |
+
*
|
22 |
+
*/
|
23 |
+
var _onload = function() {
|
24 |
+
// Add toolbox button.
|
25 |
+
var tbIconsGroup = this.block.box.find('.editor-toolbox .icons-group')
|
26 |
+
tbIconsGroup.children().first().after('<a href="#" class="cjt-tb-link cjttbl-preview"></a>');
|
27 |
+
this.editorToolbox.add('preview', {callback : this._onpreviewchanges})
|
28 |
+
// Set Title.
|
29 |
+
.jButton.attr('title', CJT_METABOX_BLOCKJqueryBlockI18N.previewLinkTitle);
|
30 |
+
// Register COMMAND-KEYS.
|
31 |
+
this.registerMetaboxCommands();
|
32 |
+
};
|
33 |
+
|
34 |
+
/**
|
35 |
+
*
|
36 |
+
*/
|
37 |
+
this._onpreviewchanges = function() {
|
38 |
+
// Save changes and preview changes when successed!
|
39 |
+
this._onsavechanges().success(
|
40 |
+
function() {
|
41 |
+
$('#post-preview').click();
|
42 |
+
}
|
43 |
+
);
|
44 |
+
}
|
45 |
+
|
46 |
+
/**
|
47 |
+
*
|
48 |
+
*/
|
49 |
+
this.registerMetaboxCommands = function() {
|
50 |
+
// Preview Changes!
|
51 |
+
this.block.aceEditor.commands.addCommand({
|
52 |
+
name: 'Preview Changes',
|
53 |
+
bindKey: {
|
54 |
+
win : 'Ctrl-I',
|
55 |
+
mac : 'Command-I'
|
56 |
+
},
|
57 |
+
exec: $.proxy(this._onpreviewchanges, this)
|
58 |
+
});
|
59 |
+
}
|
60 |
+
|
61 |
+
/**
|
62 |
+
*
|
63 |
+
*/
|
64 |
+
this.onLoad = _onload;
|
65 |
+
|
66 |
+
// Initialize base class.
|
67 |
+
this.initCJTPluginBase(node, args);
|
68 |
+
|
69 |
+
} // End class.
|
70 |
+
|
71 |
+
// Extend CJTBlockPlugin class.
|
72 |
+
CJTBlockPlugin.prototype = new CJTBlockPluginBase();
|
73 |
+
})(jQuery);
|
views/blocks/metabox/public/js/jquery.block/jquery.block.localization.php
ADDED
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @version FILE_VERSION
|
4 |
+
* Localization file for jquery.block.js script.
|
5 |
+
*/
|
6 |
+
|
7 |
+
/**
|
8 |
+
* Localization for Javascript CJT_METABOX_BLOCKJqueryBlockI18N variable.
|
9 |
+
*
|
10 |
+
*/
|
11 |
+
return array(
|
12 |
+
'previewLinkTitle' => cssJSToolbox::getText('Preview Post/Page in a new window'),
|
13 |
+
);
|
views/blocks/metabox/public/js/metabox/metabox.js
ADDED
@@ -0,0 +1,203 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
*
|
3 |
+
*/
|
4 |
+
|
5 |
+
var CJTToolBox = {
|
6 |
+
forms : {templatesLookupForm : []}
|
7 |
+
}; // Application name spaces structure.
|
8 |
+
|
9 |
+
/**
|
10 |
+
* put your comment there...
|
11 |
+
*
|
12 |
+
*/
|
13 |
+
var CJTBlocksPage;
|
14 |
+
|
15 |
+
/**
|
16 |
+
*
|
17 |
+
*/
|
18 |
+
(function($) {
|
19 |
+
|
20 |
+
/**
|
21 |
+
* put your comment there...
|
22 |
+
*
|
23 |
+
* @type Object
|
24 |
+
*/
|
25 |
+
CJTBlocksPage = {
|
26 |
+
|
27 |
+
/**
|
28 |
+
* put your comment there...
|
29 |
+
*
|
30 |
+
*/
|
31 |
+
blocks : null,
|
32 |
+
|
33 |
+
/**
|
34 |
+
* put your comment there...
|
35 |
+
*
|
36 |
+
*/
|
37 |
+
blocksForm : null,
|
38 |
+
|
39 |
+
/**
|
40 |
+
* put your comment there...
|
41 |
+
*
|
42 |
+
* @type Boolean
|
43 |
+
*/
|
44 |
+
isContentChanged : false,
|
45 |
+
|
46 |
+
/**
|
47 |
+
* put your comment there...
|
48 |
+
*
|
49 |
+
*/
|
50 |
+
metaboxBlockToolbox : null,
|
51 |
+
|
52 |
+
/**
|
53 |
+
* put your comment there...
|
54 |
+
*
|
55 |
+
*/
|
56 |
+
server : null,
|
57 |
+
|
58 |
+
/**
|
59 |
+
* Reference to original Thickbox tb_position function.
|
60 |
+
*
|
61 |
+
*
|
62 |
+
*/
|
63 |
+
tb_position : window.tb_position,
|
64 |
+
|
65 |
+
/**
|
66 |
+
*
|
67 |
+
*/
|
68 |
+
wpAutoSave : {timer : null, wpHandler : null},
|
69 |
+
|
70 |
+
/**
|
71 |
+
* put your comment there...
|
72 |
+
*
|
73 |
+
*/
|
74 |
+
_onbeforeunload : function() {
|
75 |
+
var msg = '';
|
76 |
+
// If autosave detect no changes on the post content check if CJT block has changed.
|
77 |
+
if (!(msg = this.wpAutoSave.wpHandler())) {
|
78 |
+
if (this.isContentChanged) {
|
79 |
+
msg = CJTMetaboxI18N.notifySaveChanges;
|
80 |
+
}
|
81 |
+
}
|
82 |
+
return msg;
|
83 |
+
},
|
84 |
+
|
85 |
+
/**
|
86 |
+
* put your comment there...
|
87 |
+
*
|
88 |
+
*/
|
89 |
+
_onshowthickbox : function(event) {
|
90 |
+
var mediaUploadTbPosition = window.tb_position;
|
91 |
+
// Use our custom method for positioning the Thickbox.
|
92 |
+
window.tb_position = function() {
|
93 |
+
// Call Thickbox original tb_position!
|
94 |
+
CJTBlocksPage.tb_position();
|
95 |
+
// Restore to media-upload tb_position.
|
96 |
+
window.tb_position = mediaUploadTbPosition;
|
97 |
+
};
|
98 |
+
// Call target function.
|
99 |
+
CJTBlocksPage.blocks.getBlocks().get(0).CJTBlock[this.event](event);
|
100 |
+
},
|
101 |
+
|
102 |
+
/**
|
103 |
+
* Dummy method in order for block-metabox to work.
|
104 |
+
*/
|
105 |
+
blockContentChanged : function(id, isChanged) {
|
106 |
+
this.isContentChanged = isChanged;
|
107 |
+
},
|
108 |
+
|
109 |
+
/**
|
110 |
+
* put your comment there...
|
111 |
+
*
|
112 |
+
* @param block
|
113 |
+
*/
|
114 |
+
deleteBlocks : function(block) {
|
115 |
+
// Pack request data.
|
116 |
+
var requestData = {
|
117 |
+
id : block.get(0).CJTBlock.block.get('id'),
|
118 |
+
post : $('#post_ID').val()
|
119 |
+
};
|
120 |
+
// Disable block while deleting and show Ajax loading progress.
|
121 |
+
this.metaboxBlockToolbox.buttons['delete'].loading(true);
|
122 |
+
this.metaboxBlockToolbox.enable(false);
|
123 |
+
block.get(0).CJTBlock.enable(false);
|
124 |
+
// Delete block.
|
125 |
+
this.server.send('metabox', 'delete', requestData)
|
126 |
+
.success($.proxy(
|
127 |
+
function(createMetaboxView) {
|
128 |
+
// Get metabox object just before the CJTBlocksPage take place.
|
129 |
+
// If the CJTBlocksPage take place then we wont be able to get metabox object.
|
130 |
+
var metabox = this.blocks.getBlock(this.blocks.getExistsIds()[0]);
|
131 |
+
// Load CSS files required for metabox-block to work.
|
132 |
+
(new StylesLoader(createMetaboxView.references.styles)).load();
|
133 |
+
// Set tb_position to thickbox original so that metabox CJTBlocksPage can get it.
|
134 |
+
var mediaHandlerTBPosition = window.tb_position;
|
135 |
+
window.tb_position = this.tb_position;
|
136 |
+
// Load Javascript files required for metabox-block to work.
|
137 |
+
// After all metabox scripts are loaded place the view.
|
138 |
+
(new ScriptsLoader(createMetaboxView.references.scripts)).loadAll().done($.proxy(
|
139 |
+
function() {
|
140 |
+
// Localize loaded scripts
|
141 |
+
(new CJTWPScriptLocalizer(createMetaboxView.references.scripts)).localize();
|
142 |
+
// Make the new poxtbox toggle-able!
|
143 |
+
// Dont apply toggler twice for the exiss metaboxes.
|
144 |
+
var metaboxes = $('#normal-sortables .postbox').removeClass('postbox');
|
145 |
+
// Replace post metabox with the recevied metabox content.
|
146 |
+
metabox.replaceWith(createMetaboxView.view);
|
147 |
+
// Apply toggler on the new metabox.
|
148 |
+
postboxes.add_postbox_toggles(pagenow);
|
149 |
+
// Reset things back so the other metaboxes has the correct CSS class.
|
150 |
+
metaboxes.addClass('postbox');
|
151 |
+
// Reset tb_position to the one created by media-handler script.
|
152 |
+
window.tb_position = mediaHandlerTBPosition;
|
153 |
+
// Reset wordpress Autosave handler.
|
154 |
+
if (this.wpAutoSave.wpHandler != undefined) {
|
155 |
+
window.onbeforeunload = this.wpAutoSave.wpHandler;
|
156 |
+
}
|
157 |
+
}, this)
|
158 |
+
);
|
159 |
+
}, this)
|
160 |
+
);
|
161 |
+
},
|
162 |
+
|
163 |
+
/**
|
164 |
+
*
|
165 |
+
*/
|
166 |
+
detectWordpressAutoSaveAlertEvent : function() {
|
167 |
+
// Wordpress event detected! Or the autosave file has been processed!
|
168 |
+
if (window.onbeforeunload != undefined) {
|
169 |
+
// No more check!
|
170 |
+
clearInterval(this.wpAutoSave.timer);
|
171 |
+
// Get reference from Wordpress unlaod event handler.
|
172 |
+
this.wpAutoSave.wpHandler = window.onbeforeunload;
|
173 |
+
// Take the control
|
174 |
+
window.onbeforeunload = $.proxy(this._onbeforeunload, this);
|
175 |
+
}
|
176 |
+
},
|
177 |
+
|
178 |
+
/**
|
179 |
+
* put your comment there...
|
180 |
+
*
|
181 |
+
*/
|
182 |
+
init : function() {
|
183 |
+
// Initialize vars.
|
184 |
+
this.blocksForm = $('form[name="post"]');
|
185 |
+
// Use plural getBlocks() and dont worry, we've only one block metabox.
|
186 |
+
this.blocks = new CJTBlocks();
|
187 |
+
this.server = CJTServer;
|
188 |
+
// Initilize Global-Blocks Conponents.
|
189 |
+
CJTBlockMenuView.initialize();
|
190 |
+
CJTBlockCodeFileView.initialize();
|
191 |
+
// Put CJT code block into actions!
|
192 |
+
var blocks = this.blocks.getBlocks().CJTBlock({calculatePinPoint : 0});
|
193 |
+
// Fix thickbox issue caused by media-upload.js script.
|
194 |
+
this.metaboxBlockToolbox = blocks.get(0).CJTBlock.toolbox;
|
195 |
+
this.metaboxBlockToolbox.buttons['info'].callback = $.proxy(this._onshowthickbox, {event : '_ongetinfo'});
|
196 |
+
this.metaboxBlockToolbox.buttons['revisions'].callback = $.proxy(this._onshowthickbox, {event : '_ondisplayrevisions'});
|
197 |
+
// Notify saving changes.
|
198 |
+
this.wpAutoSave.timer = window.setInterval($.proxy(this.detectWordpressAutoSaveAlertEvent, this), 100);
|
199 |
+
}
|
200 |
+
|
201 |
+
};
|
202 |
+
|
203 |
+
})(jQuery);
|
views/blocks/metabox/public/js/metabox/metabox.localization.php
ADDED
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @version FILE_VERSION
|
4 |
+
* Localization file for backups.js script.
|
5 |
+
*/
|
6 |
+
|
7 |
+
/**
|
8 |
+
* Localization for Javascript cjtMetaboxI18N variable.
|
9 |
+
*
|
10 |
+
* Localization text for backups script.
|
11 |
+
*/
|
12 |
+
return array(
|
13 |
+
'notifySaveChanges' => cssJSToolbox::getText('You\'ve changed CJT block content but you didn\' save this changes yet!')."\n".cssJSToolbox::getText('Would you really like to leave the page without saving this chnages'),
|
14 |
+
);
|
views/blocks/metabox/public/js/optional/revision/revision.js
ADDED
@@ -0,0 +1,47 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
*
|
3 |
+
*/
|
4 |
+
|
5 |
+
var CJTBlockOptionalRevision = null;
|
6 |
+
|
7 |
+
/**
|
8 |
+
*
|
9 |
+
*/
|
10 |
+
(function($) {
|
11 |
+
|
12 |
+
/**
|
13 |
+
* put your comment there...
|
14 |
+
*
|
15 |
+
*/
|
16 |
+
CJTBlockOptionalRevision = function(block, revision) {
|
17 |
+
|
18 |
+
/**
|
19 |
+
*
|
20 |
+
*/
|
21 |
+
this._onrestoredone = function() {
|
22 |
+
// Clear original cache except of 'code' property.
|
23 |
+
this.original = {code : this.revision.code};
|
24 |
+
}
|
25 |
+
|
26 |
+
/**
|
27 |
+
* put your comment there...
|
28 |
+
*
|
29 |
+
* @param block
|
30 |
+
* @param Revision
|
31 |
+
*/
|
32 |
+
this.CJTBlockOptionalRevision = function() {
|
33 |
+
// Initialize parent.
|
34 |
+
this.CJTBlockOptionalRevisionBase(block, revision);
|
35 |
+
// Hook2Events
|
36 |
+
this.onRestoreDone = this._onrestoredone;
|
37 |
+
}
|
38 |
+
|
39 |
+
// Construct parent.
|
40 |
+
this.CJTBlockOptionalRevision(block, revision);
|
41 |
+
|
42 |
+
} // End Prototype.
|
43 |
+
|
44 |
+
// Extend CJTBlockOptionalRevisionBase prototype.
|
45 |
+
CJTBlockOptionalRevision.prototype = new CJTBlockOptionalRevisionBase();
|
46 |
+
|
47 |
+
})(jQuery);
|
views/blocks/metabox/tmpl/metabox.html.tmpl
ADDED
@@ -0,0 +1,32 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
*
|
4 |
+
*/
|
5 |
+
|
6 |
+
// Disallow direct access.
|
7 |
+
defined('ABSPATH') or die("Access denied");
|
8 |
+
|
9 |
+
// Block Templates.
|
10 |
+
require CJTOOLBOX_VIEWS_PATH . '/blocks/block/tmpl/menu/menu.html.tmpl';
|
11 |
+
require CJTOOLBOX_VIEWS_PATH . '/blocks/block/tmpl/codefile/codefile.html.tmpl';
|
12 |
+
|
13 |
+
// Display as metabox without using Wordpress Metabox APIs.
|
14 |
+
if ($this->getOption('customizeMetabox')) : ?>
|
15 |
+
<div id="cjtoolbox-<?php echo $this->getBlock()->id; ?>" class="postbox">
|
16 |
+
<div class="handlediv" title="Click to toggle"><br /></div>
|
17 |
+
<h3 class='hndle'>
|
18 |
+
<span><?php echo $this->getMetaboxName(); ?></span>
|
19 |
+
</h3>
|
20 |
+
<div class="inside">
|
21 |
+
<?php endif; ?>
|
22 |
+
<input type="hidden" id="cjt-securityToken" value="<?php echo $this->getSecurityToken() ?>" />
|
23 |
+
<?php $this->blockView->display();
|
24 |
+
if ($this->getOption('customizeMetabox')) : ?>
|
25 |
+
</div>
|
26 |
+
</div>
|
27 |
+
<?php endif; ?>
|
28 |
+
<div id="cjt-inline-popup"></div>
|
29 |
+
<script type="text/javascript">
|
30 |
+
// Initialize metabox.
|
31 |
+
jQuery(jQuery.proxy(CJTBlocksPage.init, CJTBlocksPage));
|
32 |
+
</script>
|
views/blocks/metabox/view.php
ADDED
@@ -0,0 +1,186 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
*
|
4 |
+
*/
|
5 |
+
|
6 |
+
/**
|
7 |
+
*
|
8 |
+
*/
|
9 |
+
class CJTBlocksMetaBoxView extends CJTView {
|
10 |
+
|
11 |
+
/**
|
12 |
+
* put your comment there...
|
13 |
+
*
|
14 |
+
* @var mixed
|
15 |
+
*/
|
16 |
+
protected $blockView = null;
|
17 |
+
|
18 |
+
/**
|
19 |
+
* put your comment there...
|
20 |
+
*
|
21 |
+
* @var mixed
|
22 |
+
*/
|
23 |
+
protected $options = null;
|
24 |
+
|
25 |
+
/**
|
26 |
+
* put your comment there...
|
27 |
+
*
|
28 |
+
* @var mixed
|
29 |
+
*/
|
30 |
+
protected $securityToken = null;
|
31 |
+
|
32 |
+
/**
|
33 |
+
* put your comment there...
|
34 |
+
*
|
35 |
+
* @param mixed $viewInfo
|
36 |
+
* @return CJTBlockMetaBoxView
|
37 |
+
*/
|
38 |
+
public function __construct($viewInfo) {
|
39 |
+
parent::__construct($viewInfo);
|
40 |
+
// Initialize vars.
|
41 |
+
$this->options = (object) array();
|
42 |
+
// Add scripts ands styles actions.
|
43 |
+
add_action('admin_print_scripts', array(__CLASS__, 'enqueueScripts'));
|
44 |
+
add_action('admin_print_styles', array(__CLASS__, 'enqueueStyles'));
|
45 |
+
// Create block view.
|
46 |
+
$this->blockView = self::create('blocks/block');
|
47 |
+
}
|
48 |
+
|
49 |
+
/**
|
50 |
+
* put your comment there...
|
51 |
+
*
|
52 |
+
*/
|
53 |
+
public function display() {
|
54 |
+
// Display content.
|
55 |
+
echo $this->getTemplate('metabox');
|
56 |
+
}
|
57 |
+
|
58 |
+
/**
|
59 |
+
* put your comment there...
|
60 |
+
*
|
61 |
+
*/
|
62 |
+
public static function enqueueScripts() {
|
63 |
+
// Regular block scripts.
|
64 |
+
CJTBlocksBlockView::enqueueScripts();
|
65 |
+
// Use related scripts.
|
66 |
+
self::useScripts(__CLASS__,
|
67 |
+
'views:blocks:metabox:public:js:{CJT-}metabox',
|
68 |
+
'views:blocks:manager:public:js:{CJT-}blocks',
|
69 |
+
'views:blocks:metabox:public:js:optional:{CJT_CJT_BLOCK-}revision',
|
70 |
+
'views:blocks:metabox:public:js:{CJT_METABOX_BLOCK-}block',
|
71 |
+
'views:blocks:metabox:public:js:{CJT_METABOX_BLOCK-}jquery.block',
|
72 |
+
'framework:js:ajax:{CJT-}cjt-server',
|
73 |
+
'framework:js:ajax:{CJT-}scripts-loader',
|
74 |
+
'framework:js:ajax:{CJT-}styles-loader',
|
75 |
+
'framework:js:wordpress:{CJT-}script-localizer'
|
76 |
+
);
|
77 |
+
/*
|
78 |
+
* Link Thickbox to header instead of footer.
|
79 |
+
* media-upload script linked directly after thickbox script.
|
80 |
+
* media-upload script override tb_position function to show
|
81 |
+
* thickbox popup forms in fixed position and size!
|
82 |
+
* To overcome this problem we need to get a copy from original tb_position
|
83 |
+
* just after thickbox is loaded and just before media-upload is
|
84 |
+
* not override tb_position yet.
|
85 |
+
* metabox.js now is between thickbox and media-upload, have fun!
|
86 |
+
*/
|
87 |
+
$GLOBALS['wp_scripts']->registered['thickbox']->args = 0;
|
88 |
+
}
|
89 |
+
|
90 |
+
/**
|
91 |
+
* put your comment there...
|
92 |
+
*
|
93 |
+
*/
|
94 |
+
public static function enqueueStyles() {
|
95 |
+
// Regular block styles.
|
96 |
+
CJTBlocksBlockView::enqueueStyles();
|
97 |
+
// Import related styles.
|
98 |
+
self::useStyles(__CLASS__,
|
99 |
+
'framework:css:{CJT-}toolbox',
|
100 |
+
'views:blocks:metabox:public:css:{CJT-}metabox'
|
101 |
+
);
|
102 |
+
}
|
103 |
+
|
104 |
+
/**
|
105 |
+
* put your comment there...
|
106 |
+
*
|
107 |
+
*/
|
108 |
+
public function getBlock() {
|
109 |
+
return $this->blockView->block;
|
110 |
+
}
|
111 |
+
|
112 |
+
/**
|
113 |
+
* put your comment there...
|
114 |
+
*
|
115 |
+
*/
|
116 |
+
public function getBlockView() {
|
117 |
+
return $this->blockView;
|
118 |
+
}
|
119 |
+
|
120 |
+
/**
|
121 |
+
* put your comment there...
|
122 |
+
*
|
123 |
+
*/
|
124 |
+
public function getMetaboxName() {
|
125 |
+
return $this->blockView->getMetaboxName();
|
126 |
+
}
|
127 |
+
|
128 |
+
/**
|
129 |
+
* put your comment there...
|
130 |
+
*
|
131 |
+
* @param mixed $id
|
132 |
+
*/
|
133 |
+
public function getMetaboxId() {
|
134 |
+
return $this->blockView->getMetaboxId();
|
135 |
+
}
|
136 |
+
|
137 |
+
/**
|
138 |
+
* put your comment there...
|
139 |
+
*
|
140 |
+
*/
|
141 |
+
public function getOption($name) {
|
142 |
+
return isset($this->options->{$name}) ? $this->options->{$name} : null;
|
143 |
+
}
|
144 |
+
|
145 |
+
/**
|
146 |
+
* put your comment there...
|
147 |
+
*
|
148 |
+
* @param mixed $name
|
149 |
+
* @param mixed $value
|
150 |
+
*/
|
151 |
+
public function setOption($name, $value) {
|
152 |
+
$this->options->{$name} = $value;
|
153 |
+
// Chaining!
|
154 |
+
return $this;
|
155 |
+
}
|
156 |
+
|
157 |
+
/**
|
158 |
+
* put your comment there...
|
159 |
+
*
|
160 |
+
*/
|
161 |
+
public function getSecurityToken() {
|
162 |
+
return $this->securityToken;
|
163 |
+
}
|
164 |
+
|
165 |
+
/**
|
166 |
+
* put your comment there...
|
167 |
+
*
|
168 |
+
* @param mixed $block
|
169 |
+
*/
|
170 |
+
public function setBlock($block) {
|
171 |
+
$this->blockView->block = $block;
|
172 |
+
}
|
173 |
+
|
174 |
+
/**
|
175 |
+
* put your comment there...
|
176 |
+
*
|
177 |
+
* @param mixed $token
|
178 |
+
*/
|
179 |
+
public function setSecurityToken($token) {
|
180 |
+
$this->securityToken = $token;
|
181 |
+
}
|
182 |
+
|
183 |
+
} // End class.
|
184 |
+
|
185 |
+
// Hookable!!
|
186 |
+
CJTBlocksMetaBoxView::define('CJTBlocksMetaBoxView');
|
views/blocks/new/public/css/add-new-block.css
CHANGED
@@ -1,3 +0,0 @@
|
|
1 |
-
.cjt-form ul li.last {
|
2 |
-
margin-top: 140px;
|
3 |
-
}
|
|
|
|
|
|
views/blocks/new/public/js/add-new-block/add-new-block.js
CHANGED
@@ -77,7 +77,7 @@
|
|
77 |
.success($.proxy(
|
78 |
function(response) {
|
79 |
// Add new block to blocks page.
|
80 |
-
newAddedBlock = CJTBlocksPage.addBlock(response.view)
|
81 |
// Close window.
|
82 |
window.parent.tb_remove();
|
83 |
}, this)
|
77 |
.success($.proxy(
|
78 |
function(response) {
|
79 |
// Add new block to blocks page.
|
80 |
+
newAddedBlock = CJTBlocksPage.addBlock(formData.position, response.view)
|
81 |
// Close window.
|
82 |
window.parent.tb_remove();
|
83 |
}, this)
|
views/blocks/new/tmpl/default.html.tmpl
CHANGED
@@ -7,8 +7,9 @@
|
|
7 |
defined('ABSPATH') or die("Access denied");
|
8 |
|
9 |
// Allow view to enqueue scripts and styles.
|
10 |
-
|
11 |
-
|
|
|
12 |
?>
|
13 |
<html xmlns="http://www.w3.org/1999/xhtml">
|
14 |
<head>
|
@@ -24,6 +25,44 @@ do_action('admin_print_styles');
|
|
24 |
<label for="cjt-new-block-name" title="<?php echo cssJSToolbox::getText('Name or title of code block (must be unique and cannot be left blank)') ?>"><?php echo cssJSToolbox::getText('Name') ?>*</label>
|
25 |
<input type="text" id="cjt-new-block-name" name="name" maxlength="50" value="" />
|
26 |
</li>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
27 |
<li class="last">
|
28 |
<input class="cjt-button cancel" type="button" value="<?php echo cssJSToolbox::getText('Cancel') ?>" />
|
29 |
<input class="cjt-button save" type="submit" name="submit" value="<?php echo cssJSToolbox::getText('Create') ?>" />
|
7 |
defined('ABSPATH') or die("Access denied");
|
8 |
|
9 |
// Allow view to enqueue scripts and styles.
|
10 |
+
CJTBlocksNewView::enququeScripts();
|
11 |
+
CJTBlocksNewView::enququeStyles();
|
12 |
+
$this->suppressPrintScriptsHook();
|
13 |
?>
|
14 |
<html xmlns="http://www.w3.org/1999/xhtml">
|
15 |
<head>
|
25 |
<label for="cjt-new-block-name" title="<?php echo cssJSToolbox::getText('Name or title of code block (must be unique and cannot be left blank)') ?>"><?php echo cssJSToolbox::getText('Name') ?>*</label>
|
26 |
<input type="text" id="cjt-new-block-name" name="name" maxlength="50" value="" />
|
27 |
</li>
|
28 |
+
<li>
|
29 |
+
<label for="cjt-new-block-state" title="<?php echo cssJSToolbox::getText('Tick the checkbox to Activate (turn on) code block') ?>"><?php echo cssJSToolbox::getText('Activate') ?></label>
|
30 |
+
<input type="checkbox" id="cjt-new-block-state" name="state" value="active" checked="checked" />
|
31 |
+
</li>
|
32 |
+
<li>
|
33 |
+
<label for="cjt-new-block-hook" title="<?php echo cssJSToolbox::getText('Set location hook for code block output to: Header or Footer') ?>"><?php echo cssJSToolbox::getText('Location Hook') ?></label>
|
34 |
+
<select name="location" id="cjt-new-block-hook">
|
35 |
+
<?php
|
36 |
+
$locations = array(
|
37 |
+
'header' => cssJSToolbox::getText('Header'),
|
38 |
+
'footer' => cssJSToolbox::getText('Footer'),
|
39 |
+
);
|
40 |
+
foreach ($locations as $key => $displayName) :
|
41 |
+
?>
|
42 |
+
<option value="<?php echo $key ?>"><?php echo $displayName ?></option>
|
43 |
+
<?php
|
44 |
+
endforeach;
|
45 |
+
?>
|
46 |
+
</select>
|
47 |
+
</li>
|
48 |
+
<li>
|
49 |
+
<label for="cjt-new-block-position" title="<?php echo cssJSToolbox::getText('Set initial code block position to: First Block or Last Block') ?>"><?php echo cssJSToolbox::getText('Initial Block Position') ?></label>
|
50 |
+
<select name="position" id="cjt-new-block-position">
|
51 |
+
<?php
|
52 |
+
// Static locations.
|
53 |
+
$positions = array(
|
54 |
+
'top' => cssJSToolbox::getText('First Block'),
|
55 |
+
'bottom' => cssJSToolbox::getText('Last Block'),
|
56 |
+
);
|
57 |
+
// Display locations list.
|
58 |
+
foreach ($positions as $position => $displayName) :
|
59 |
+
?>
|
60 |
+
<option value="<?php echo $position ?>"<?php if ($this->position == $position) : ?> selected="selected"<?php endif; ?>><?php echo $displayName ?></option>
|
61 |
+
<?php
|
62 |
+
endforeach;
|
63 |
+
?>
|
64 |
+
</select>
|
65 |
+
</li>
|
66 |
<li class="last">
|
67 |
<input class="cjt-button cancel" type="button" value="<?php echo cssJSToolbox::getText('Cancel') ?>" />
|
68 |
<input class="cjt-button save" type="submit" name="submit" value="<?php echo cssJSToolbox::getText('Create') ?>" />
|
views/blocks/new/view.php
CHANGED
@@ -24,19 +24,6 @@ class CJTBlocksNewView extends CJTView {
|
|
24 |
*/
|
25 |
public $position;
|
26 |
|
27 |
-
/**
|
28 |
-
* Initialize view object.
|
29 |
-
*
|
30 |
-
* @see CJTView for more details
|
31 |
-
* @return void
|
32 |
-
*/
|
33 |
-
public function __construct($parameters) {
|
34 |
-
parent::__construct($parameters);
|
35 |
-
// Enqueue Styles & Scripts.
|
36 |
-
add_action('admin_print_styles', array(__CLASS__, 'enququeStyles'));
|
37 |
-
add_action('admin_print_scripts', array(__CLASS__, 'enququeScripts'));
|
38 |
-
}
|
39 |
-
|
40 |
/**
|
41 |
* Output Add New Block markups.
|
42 |
*
|
@@ -79,8 +66,7 @@ class CJTBlocksNewView extends CJTView {
|
|
79 |
self::useStyles(__CLASS__,
|
80 |
'thickbox',
|
81 |
'framework:css:{CJT-}error-dialog',
|
82 |
-
'framework:css:{CJT-}forms'
|
83 |
-
'views:blocks:new:public:css:{CJT-}add-new-block'
|
84 |
);
|
85 |
}
|
86 |
|
24 |
*/
|
25 |
public $position;
|
26 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
27 |
/**
|
28 |
* Output Add New Block markups.
|
29 |
*
|
66 |
self::useStyles(__CLASS__,
|
67 |
'thickbox',
|
68 |
'framework:css:{CJT-}error-dialog',
|
69 |
+
'framework:css:{CJT-}forms'
|
|
|
70 |
);
|
71 |
}
|
72 |
|
views/blocks/revisions/tmpl/default.html.tmpl
CHANGED
@@ -5,6 +5,11 @@
|
|
5 |
|
6 |
// Disallow direct access.
|
7 |
defined('ABSPATH') or die("Access denied");
|
|
|
|
|
|
|
|
|
|
|
8 |
?>
|
9 |
<html xmlns="http://www.w3.org/1999/xhtml">
|
10 |
<head>
|
5 |
|
6 |
// Disallow direct access.
|
7 |
defined('ABSPATH') or die("Access denied");
|
8 |
+
|
9 |
+
// Allow view to enqueue scripts and styles.
|
10 |
+
$this->enququeScripts();
|
11 |
+
$this->enququeStyles();
|
12 |
+
$this->suppressPrintScriptsHook();
|
13 |
?>
|
14 |
<html xmlns="http://www.w3.org/1999/xhtml">
|
15 |
<head>
|
views/blocks/revisions/view.php
CHANGED
@@ -27,18 +27,6 @@ class CJTBlocksRevisionsView extends CJTView {
|
|
27 |
*/
|
28 |
public $revisions = array();
|
29 |
|
30 |
-
/**
|
31 |
-
* put your comment there...
|
32 |
-
*
|
33 |
-
*/
|
34 |
-
public function __construct($info) {
|
35 |
-
// Initialize CJTView base class.
|
36 |
-
parent::__construct($info);
|
37 |
-
// Initialize.
|
38 |
-
$this->enququeScripts();
|
39 |
-
$this->enququeStyles();
|
40 |
-
}
|
41 |
-
|
42 |
/**
|
43 |
* Output Javascript files requirred to Add-New-Block view to run.
|
44 |
*
|
27 |
*/
|
28 |
public $revisions = array();
|
29 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
30 |
/**
|
31 |
* Output Javascript files requirred to Add-New-Block view to run.
|
32 |
*
|
views/installer/install/tmpl/default.html.tmpl
CHANGED
@@ -36,6 +36,9 @@ else {
|
|
36 |
'type' => 'install',
|
37 |
'operations' => array(
|
38 |
'database' => array('text' => cssJSToolbox::getText('Create database tables.')),
|
|
|
|
|
|
|
39 |
'finalize' => array('text' => cssJSToolbox::getText('Finalize Installation.')),
|
40 |
))
|
41 |
);
|
36 |
'type' => 'install',
|
37 |
'operations' => array(
|
38 |
'database' => array('text' => cssJSToolbox::getText('Create database tables.')),
|
39 |
+
'fileSystem' => array('text' => cssJSToolbox::getText('Creating file system directories (e.g wp-content/cjt-content/templates).')),
|
40 |
+
'builtinAuthors' => array('text' => cssJSToolbox::getText('Add CJT built-in authors used by templates system.')),
|
41 |
+
'wordpressTemplates' => array('text' => cssJSToolbox::getText('Add Wordpress built-in scripts and styles as CJT Templates so it can be used throught Templates Lookup form.')),
|
42 |
'finalize' => array('text' => cssJSToolbox::getText('Finalize Installation.')),
|
43 |
))
|
44 |
);
|
views/installer/install/tmpl/upgrade.html.tmpl
CHANGED
@@ -12,7 +12,7 @@ defined('ABSPATH') or die("Access denied");
|
|
12 |
<input type="hidden" id="cjt-securityToken" value="<?php echo $this->securityToken ?>" />
|
13 |
<h1><?php echo cssJSToolbox::getText('Upgrading CJT Plugin') ?></h1>
|
14 |
<p><?php echo cssJSToolbox::getText('Please wait while we upgrading CJT Plugin installation! This process would take only a few seconds!') ?></p>
|
15 |
-
<p
|
16 |
<?php echo $this->getTemplate('upgrade', array('noHeaderMessage' => true), 'tmpl/upgrades'); ?>
|
17 |
<input type="button" name="install" value="<?php echo cssJSToolbox::getText('Upgrade') ?>" />
|
18 |
<?php else : ?>
|
12 |
<input type="hidden" id="cjt-securityToken" value="<?php echo $this->securityToken ?>" />
|
13 |
<h1><?php echo cssJSToolbox::getText('Upgrading CJT Plugin') ?></h1>
|
14 |
<p><?php echo cssJSToolbox::getText('Please wait while we upgrading CJT Plugin installation! This process would take only a few seconds!') ?></p>
|
15 |
+
<p><?php echo cssJSToolbox::getText('Its highly recommended to Backup your database before processing upgrade.') ?></p>
|
16 |
<?php echo $this->getTemplate('upgrade', array('noHeaderMessage' => true), 'tmpl/upgrades'); ?>
|
17 |
<input type="button" name="install" value="<?php echo cssJSToolbox::getText('Upgrade') ?>" />
|
18 |
<?php else : ?>
|
views/installer/install/tmpl/upgrades/02.operations
CHANGED
@@ -9,4 +9,5 @@ defined('ABSPATH') or die("Access denied");
|
|
9 |
// Return operatrions!
|
10 |
return array(
|
11 |
'blocks' => array('text' => cssJSToolbox::getText('Transfer blocks to the new blocks table. Old versions doesn\'t use a specific blocks table!')),
|
|
|
12 |
);
|
9 |
// Return operatrions!
|
10 |
return array(
|
11 |
'blocks' => array('text' => cssJSToolbox::getText('Transfer blocks to the new blocks table. Old versions doesn\'t use a specific blocks table!')),
|
12 |
+
'templates' => array('text' => cssJSToolbox::getText('Transfer templates to the new database table. New template is enhanced and support revisioning and other development attributes.')),
|
13 |
);
|
views/installer/install/tmpl/upgrades/03.operations
CHANGED
@@ -9,5 +9,6 @@ defined('ABSPATH') or die("Access denied");
|
|
9 |
// Return operatrions!
|
10 |
return array(
|
11 |
'blocks' => array('text' => cssJSToolbox::getText('Transfer blocks to the new blocks table. Old versions doesn\'t use a specific blocks table!')),
|
|
|
12 |
'backups' => array('text' => cssJSToolbox::getText('Transfer backup blocks.')),
|
13 |
);
|
9 |
// Return operatrions!
|
10 |
return array(
|
11 |
'blocks' => array('text' => cssJSToolbox::getText('Transfer blocks to the new blocks table. Old versions doesn\'t use a specific blocks table!')),
|
12 |
+
'templates' => array('text' => cssJSToolbox::getText('Transfer templates to the new database table. New template is enhanced and support revisioning and other development attributes.')),
|
13 |
'backups' => array('text' => cssJSToolbox::getText('Transfer backup blocks.')),
|
14 |
);
|
views/installer/install/tmpl/upgrades/10.operations
ADDED
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
*
|
4 |
+
*/
|
5 |
+
|
6 |
+
// Disallow direct access.
|
7 |
+
defined('ABSPATH') or die("Access denied");
|
8 |
+
|
9 |
+
// Return operatrions!
|
10 |
+
return array(
|
11 |
+
'database' => array('text' => cssJSToolbox::getText('Upgrading database')),
|
12 |
+
);
|
views/installer/install/tmpl/upgrades/11.operations
ADDED
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
*
|
4 |
+
*/
|
5 |
+
|
6 |
+
// Disallow direct access.
|
7 |
+
defined('ABSPATH') or die("Access denied");
|
8 |
+
|
9 |
+
// Return operatrions!
|
10 |
+
return array(
|
11 |
+
'database' => array('text' => cssJSToolbox::getText('Upgrading database')),
|
12 |
+
);
|
views/installer/install/tmpl/upgrades/11ce.operations
ADDED
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
*
|
4 |
+
*/
|
5 |
+
|
6 |
+
// Disallow direct access.
|
7 |
+
defined('ABSPATH') or die("Access denied");
|
8 |
+
|
9 |
+
// Return operatrions!
|
10 |
+
return array(
|
11 |
+
'database' => array('text' => cssJSToolbox::getText('Upgrading database')),
|
12 |
+
);
|
views/installer/install/tmpl/upgrades/12.operations
ADDED
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
*
|
4 |
+
*/
|
5 |
+
|
6 |
+
// Disallow direct access.
|
7 |
+
defined('ABSPATH') or die("Access denied");
|
8 |
+
|
9 |
+
// Return operatrions!
|
10 |
+
return array(
|
11 |
+
'database' => array('text' => cssJSToolbox::getText('Upgrading database')),
|
12 |
+
);
|
views/installer/install/tmpl/upgrades/13.operations
ADDED
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
*
|
4 |
+
*/
|
5 |
+
|
6 |
+
// Disallow direct access.
|
7 |
+
defined('ABSPATH') or die("Access denied");
|
8 |
+
|
9 |
+
// Return operatrions!
|
10 |
+
return array(
|
11 |
+
'database' => array('text' => cssJSToolbox::getText('Upgrading database')),
|
12 |
+
);
|
views/installer/install/tmpl/upgrades/14.operations
ADDED
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
*
|
4 |
+
*/
|
5 |
+
|
6 |
+
// Disallow direct access.
|
7 |
+
defined('ABSPATH') or die("Access denied");
|
8 |
+
|
9 |
+
// Return operatrions!
|
10 |
+
return array(
|
11 |
+
'database' => array('text' => cssJSToolbox::getText('Upgrading database')),
|
12 |
+
);
|
views/installer/install/tmpl/upgrades/15.operations
ADDED
@@ -0,0 +1,22 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
*
|
4 |
+
*/
|
5 |
+
|
6 |
+
// Disallow direct access.
|
7 |
+
defined('ABSPATH') or die("Access denied");
|
8 |
+
|
9 |
+
$operations = array();
|
10 |
+
|
11 |
+
// Upgrade database tables only if the upgrade issue detected.
|
12 |
+
// There was an issue in case-sensitive file servers.
|
13 |
+
// If the masterFile field is not exists then upgrade the Database.
|
14 |
+
// otherwise then do nothing
|
15 |
+
$blockTbl = new CJTBlocksTable(cssJSToolbox::getInstance()->getDBDriver());
|
16 |
+
$fields = $blockTbl->getFields();
|
17 |
+
if (!isset($fields['masterFile'])) {
|
18 |
+
$operations['database'] = array('text' => cssJSToolbox::getText('Fixing database'));
|
19 |
+
}
|
20 |
+
|
21 |
+
// Return operatrions!
|
22 |
+
return $operations;
|
views/installer/install/tmpl/upgrades/upgrade.html.tmpl
CHANGED
@@ -13,13 +13,13 @@ defined('ABSPATH') or die("Access denied");
|
|
13 |
<?php endif; ?>
|
14 |
<ul class="installation-list upgrade">
|
15 |
<?php
|
16 |
-
// Get version operations
|
17 |
-
$
|
18 |
-
$
|
19 |
-
$operations =
|
20 |
-
// Add last operations.
|
21 |
-
$operations['finalize'] = array('text' => cssJSToolbox::getText('Finalize Upgrade.'));
|
22 |
-
// Print upgrade operations.
|
23 |
-
echo $this->getTemplate('default_operations_list', array('type' => 'upgrade', 'operations' => $operations));
|
24 |
?>
|
25 |
</ul>
|
13 |
<?php endif; ?>
|
14 |
<ul class="installation-list upgrade">
|
15 |
<?php
|
16 |
+
// Get version operations.
|
17 |
+
$upgradeOperationsFileName = strtolower($this->installedDbVersionId) . '.operations';
|
18 |
+
$operations = @include ($upgradeOperationsFileName);
|
19 |
+
$operations = $operations ? $operations : array();
|
20 |
+
// Add last operations.
|
21 |
+
$operations['finalize'] = array('text' => cssJSToolbox::getText('Finalize Upgrade.'));
|
22 |
+
// Print upgrade operations.
|
23 |
+
echo $this->getTemplate('default_operations_list', array('type' => 'upgrade', 'operations' => $operations));
|
24 |
?>
|
25 |
</ul>
|
views/packages/install/public/css/install.css
ADDED
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
form {margin: 0;}
|
2 |
+
input[type="button"]{padding: 2px 24px 2px 24px;}
|
3 |
+
#item-form label {vertical-align: top;}
|
4 |
+
|
5 |
+
.buttons {text-align: right; margin-top: 37px; padding-right: 12px;}
|
6 |
+
|
7 |
+
#fileUploader {height: 26px; width: 237px; background-color: #EFEFEF}
|
8 |
+
|
9 |
+
.cjt-form ul li {margin-bottom: -5px;}
|
views/packages/install/public/js/install/install.js
ADDED
@@ -0,0 +1,81 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
*
|
3 |
+
*/
|
4 |
+
|
5 |
+
/**
|
6 |
+
*
|
7 |
+
*/
|
8 |
+
(function($) {
|
9 |
+
|
10 |
+
/**
|
11 |
+
*
|
12 |
+
*/
|
13 |
+
window.CJTPackageInstallationForm = {
|
14 |
+
|
15 |
+
/**
|
16 |
+
* put your comment there...
|
17 |
+
*
|
18 |
+
*/
|
19 |
+
fileUploader : null,
|
20 |
+
|
21 |
+
/**
|
22 |
+
* put your comment there...
|
23 |
+
*
|
24 |
+
*/
|
25 |
+
_oncomplete : function() {
|
26 |
+
$('#install').prop('disabled', '');
|
27 |
+
},
|
28 |
+
|
29 |
+
/**
|
30 |
+
* put your comment there...
|
31 |
+
*
|
32 |
+
*/
|
33 |
+
_onfail : function(error) {
|
34 |
+
alert(error.msg);
|
35 |
+
},
|
36 |
+
|
37 |
+
/**
|
38 |
+
* put your comment there...
|
39 |
+
*
|
40 |
+
*/
|
41 |
+
_onsuccess : function() {
|
42 |
+
// Notify!
|
43 |
+
alert(CJTInstallI18N.installationSuccessed);
|
44 |
+
// Parent refresh.
|
45 |
+
parent.parent.location.reload();
|
46 |
+
},
|
47 |
+
|
48 |
+
/**
|
49 |
+
* put your comment there...
|
50 |
+
*
|
51 |
+
*/
|
52 |
+
init : function() {
|
53 |
+
// Initialize vars.
|
54 |
+
this.fileUploader = $('#fileUploader')[0];
|
55 |
+
// Set file uploaded src, load uploaded view!
|
56 |
+
this.fileUploader.src = parent.CJTServer.getRequestURL('packageFile', 'install', {view : 'uploader/single'});
|
57 |
+
// Install package!
|
58 |
+
$('#install').click($.proxy(this.install, this));
|
59 |
+
},
|
60 |
+
|
61 |
+
/**
|
62 |
+
* put your comment there...
|
63 |
+
*
|
64 |
+
*/
|
65 |
+
install : function() {
|
66 |
+
// Initialize.
|
67 |
+
var fileUploader = this.fileUploader.contentWindow.CJTUploader;
|
68 |
+
// Submit the uploader form.
|
69 |
+
fileUploader.upload('CJTPackageInstallationForm', function() {
|
70 |
+
// File being send to the server!
|
71 |
+
// Show progress.
|
72 |
+
$('#install').prop('disabled', 'disabled');
|
73 |
+
});
|
74 |
+
|
75 |
+
}
|
76 |
+
|
77 |
+
} // End class.
|
78 |
+
|
79 |
+
// Initialize form.
|
80 |
+
$($.proxy(window.CJTPackageInstallationForm.init, window.CJTPackageInstallationForm));
|
81 |
+
})(jQuery);
|
views/packages/install/public/js/install/install.localization.php
ADDED
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @version FILE_VERSION
|
4 |
+
* Localization file for jquery.block.js script.
|
5 |
+
*/
|
6 |
+
|
7 |
+
/**
|
8 |
+
* Localization for Javascript $VAR$ variable.
|
9 |
+
*
|
10 |
+
* Localization text for backups script.
|
11 |
+
*/
|
12 |
+
return array(
|
13 |
+
'installationSuccessed' => cssJSToolbox::getText('Package successfuly installed!'),
|
14 |
+
);
|
views/packages/install/tmpl/default.html.tmpl
ADDED
@@ -0,0 +1,45 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
*
|
4 |
+
*/
|
5 |
+
|
6 |
+
// Disallow direct access.
|
7 |
+
defined('ABSPATH') or die("Access denied");
|
8 |
+
|
9 |
+
// Allow view to enqueue scripts and styles.
|
10 |
+
$this->enququeScripts();
|
11 |
+
$this->enququeStyles();
|
12 |
+
$this->suppressPrintScriptsHook();
|
13 |
+
?>
|
14 |
+
<html xmlns="http://www.w3.org/1999/xhtml">
|
15 |
+
<head>
|
16 |
+
<?php wp_print_head_scripts() ?>
|
17 |
+
<?php wp_print_styles() ?>
|
18 |
+
</head>
|
19 |
+
<body>
|
20 |
+
<div id="wpwrap">
|
21 |
+
<div id="wpcontent">
|
22 |
+
<div id="wpbody">
|
23 |
+
<div id="wpbody-content">
|
24 |
+
<div class="wrap">
|
25 |
+
<form class="cjt-form">
|
26 |
+
<fieldset>
|
27 |
+
<ul>
|
28 |
+
<li>
|
29 |
+
<label for="fileUploader"><?php echo cssJSToolbox::getText('Package File') ?>:</label>
|
30 |
+
<iframe id="fileUploader" frameborder="0"></iframe>
|
31 |
+
</li>
|
32 |
+
<li class="buttons">
|
33 |
+
<input type="button" id="install" class="button-secondary" value="<?php echo cssJSToolbox::getText('Install') ?>">
|
34 |
+
</li>
|
35 |
+
</ul>
|
36 |
+
</fieldset>
|
37 |
+
</form>
|
38 |
+
</div>
|
39 |
+
</div>
|
40 |
+
</div>
|
41 |
+
</div>
|
42 |
+
</div>
|
43 |
+
<?php wp_print_footer_scripts() ?>
|
44 |
+
</body>
|
45 |
+
</html>
|
views/packages/install/view.php
ADDED
@@ -0,0 +1,57 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
*
|
4 |
+
*/
|
5 |
+
|
6 |
+
// No direct access.
|
7 |
+
defined('ABSPATH') or die('Access denied');
|
8 |
+
|
9 |
+
/**
|
10 |
+
*
|
11 |
+
*/
|
12 |
+
class CJTPackagesInstallView extends CJTView {
|
13 |
+
|
14 |
+
/**
|
15 |
+
* put your comment there...
|
16 |
+
*
|
17 |
+
* @param mixed $tpl
|
18 |
+
*/
|
19 |
+
public function display($tpl = null) {
|
20 |
+
echo $this->getTemplate($tpl);
|
21 |
+
}
|
22 |
+
|
23 |
+
/**
|
24 |
+
* Output Javascript files requirred to Add-New-Block view to run.
|
25 |
+
*
|
26 |
+
* @return void
|
27 |
+
*/
|
28 |
+
public function enququeScripts() {
|
29 |
+
// Use related scripts.
|
30 |
+
self::useScripts(__CLASS__,
|
31 |
+
'jquery',
|
32 |
+
'thickbox',
|
33 |
+
'jquery-serialize-object',
|
34 |
+
'framework:js:misc:{CJT-}simple-error-dialog',
|
35 |
+
'views:packages:install:public:js:{CJT-}install'
|
36 |
+
);
|
37 |
+
}
|
38 |
+
|
39 |
+
/**
|
40 |
+
* Output CSS files required to Add-New-Block view.
|
41 |
+
*
|
42 |
+
* @return void
|
43 |
+
*/
|
44 |
+
public function enququeStyles() {
|
45 |
+
// Use related styles.
|
46 |
+
self::useStyles(__CLASS__,
|
47 |
+
'thickbox',
|
48 |
+
'framework:css:{CJT-}forms',
|
49 |
+
'framework:css:{CJT-}error-dialog',
|
50 |
+
'views:packages:install:public:css:{CJT-}install'
|
51 |
+
);
|
52 |
+
}
|
53 |
+
|
54 |
+
} // End class.
|
55 |
+
|
56 |
+
// Hookable!!
|
57 |
+
CJTPackagesInstallView::define('CJTPackagesInstallView', array('hookType' => CJTWordpressEvents::HOOK_FILTER));
|
views/packages/manager/helpers/wp-list-table.inc.php
ADDED
@@ -0,0 +1,107 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
*
|
4 |
+
*/
|
5 |
+
|
6 |
+
// Disallow direct access.
|
7 |
+
defined('ABSPATH') or die("Access denied");
|
8 |
+
|
9 |
+
// Import WP_List_Table class.
|
10 |
+
require_once ABSPATH . 'wp-admin/includes/class-wp-list-table.php';
|
11 |
+
|
12 |
+
/**
|
13 |
+
*
|
14 |
+
*/
|
15 |
+
class CJTPackagesManagerListTable extends WP_List_Table {
|
16 |
+
|
17 |
+
/**
|
18 |
+
* put your comment there...
|
19 |
+
*
|
20 |
+
*/
|
21 |
+
public function __construct() {
|
22 |
+
// Set hook suffix (E_ALL complain)!
|
23 |
+
$GLOBALS['hook_suffix'] = 'cjt';
|
24 |
+
// Table list arguments.
|
25 |
+
$args = array();
|
26 |
+
parent::__construct($args);
|
27 |
+
}
|
28 |
+
|
29 |
+
/**
|
30 |
+
*
|
31 |
+
*/
|
32 |
+
protected function column_default($item, $name) {
|
33 |
+
$value = null;
|
34 |
+
switch ($name) {
|
35 |
+
case '_selection_':
|
36 |
+
echo "<input type='checkbox' name='id[]' value='{$item->id}' />";
|
37 |
+
break;
|
38 |
+
case 'name':
|
39 |
+
// Package name!
|
40 |
+
$value = "<span class='package-name'>{$item->{$name}}</span>";
|
41 |
+
// Description underneath the name!
|
42 |
+
$value .= "<br /><div class='description'><span>{$item->description}</span></div>";
|
43 |
+
// Display row actions underneath template name column.
|
44 |
+
$actions = array();
|
45 |
+
// ----$actions['info'] = "<a href='#info({$item->id})'>" . cssJSToolbox::getText('Info') . '</a>';
|
46 |
+
$actions['delete'] = "<a href='#delete({$item->id})'>" . cssJSToolbox::getText('Delete') . '</a>';
|
47 |
+
// Show actions row underneath template name!!
|
48 |
+
$value .= $this->row_actions($actions, false);
|
49 |
+
break;
|
50 |
+
case 'webSite':
|
51 |
+
$value = "<a target='_blank' href='{$item->$name}'>{$item->$name}</a>";
|
52 |
+
break;
|
53 |
+
case 'license':
|
54 |
+
case 'readme':
|
55 |
+
if ($item->$name) {
|
56 |
+
// Upper casxe first letter.
|
57 |
+
$fileName = ucfirst($name);
|
58 |
+
// Generate view file link for each file name (readmem license)!
|
59 |
+
$value = "<a class='view-package-file' href='#get{$fileName}File({$item->id})'>" . cssJSToolbox::getText('View') . "</a>";
|
60 |
+
}
|
61 |
+
else {
|
62 |
+
$value = cssJSToolbox::getText('N/A');
|
63 |
+
}
|
64 |
+
break;
|
65 |
+
default;
|
66 |
+
$value = $item->{$name};
|
67 |
+
break;
|
68 |
+
}
|
69 |
+
return $value;
|
70 |
+
}
|
71 |
+
|
72 |
+
/**
|
73 |
+
* put your comment there...
|
74 |
+
*
|
75 |
+
*/
|
76 |
+
public function get_bulk_actions() {
|
77 |
+
// Bulk ations.
|
78 |
+
$actions = array(
|
79 |
+
'delete' => cssJSToolbox::getText('Delete'),
|
80 |
+
);
|
81 |
+
// Return actions!
|
82 |
+
return $actions;
|
83 |
+
}
|
84 |
+
|
85 |
+
/**
|
86 |
+
* Get a list of columns. The format is:
|
87 |
+
* 'internal-name' => 'Title'
|
88 |
+
*
|
89 |
+
* @since 3.1.0
|
90 |
+
* @access protected
|
91 |
+
* @abstract
|
92 |
+
*
|
93 |
+
* @return array
|
94 |
+
*/
|
95 |
+
public function get_columns() {
|
96 |
+
return array(
|
97 |
+
'_selection_' => '<input type="checkbox" class="select-all" />',
|
98 |
+
'name' => cssJSToolbox::getText('Name'),
|
99 |
+
'author' => cssJSToolbox::getText('Author'),
|
100 |
+
'webSite' => cssJSToolbox::getText('Website'),
|
101 |
+
'license' => cssJSToolbox::getText('License'),
|
102 |
+
'readme' => cssJSToolbox::getText('Readme'),
|
103 |
+
'id' => cssJSToolbox::getText('ID'),
|
104 |
+
);
|
105 |
+
}
|
106 |
+
|
107 |
+
} // End class.
|
views/packages/manager/public/css/default.css
ADDED
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
table.wp-list-table tbody tr td input[type="checkbox"] {margin-left: 8px;}
|
2 |
+
table tr th {text-align: center;}
|
3 |
+
|
4 |
+
td.name.column-name .description{
|
5 |
+
margin-left: 6px;
|
6 |
+
font-weight: bold;
|
7 |
+
font-size: 11px;
|
8 |
+
font-family: sans-serif;
|
9 |
+
margin-top: 6px;
|
10 |
+
min-width: 280px;
|
11 |
+
}
|
12 |
+
th#_selection_ {width: 19px;}
|
13 |
+
th#webSite {width: 250px;}
|
14 |
+
th#readme,
|
15 |
+
th#license {width: 66px;}
|
16 |
+
th#id {width: 40px;}
|
17 |
+
|
18 |
+
#packages-manager {padding-top: 10px;}
|
19 |
+
|
20 |
+
.widefat {width: 99%;}
|
views/packages/manager/public/js/manager/manager.js
ADDED
@@ -0,0 +1,160 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
*
|
3 |
+
*/
|
4 |
+
(function($) {
|
5 |
+
|
6 |
+
/**
|
7 |
+
*
|
8 |
+
*/
|
9 |
+
CJTPackagesManagerForm = {
|
10 |
+
|
11 |
+
/**
|
12 |
+
* put your comment there...
|
13 |
+
*
|
14 |
+
*/
|
15 |
+
_onbulkaction : function(event) {
|
16 |
+
// Get bulk action list element.
|
17 |
+
var actionListId = event.target.id.replace('do', '');
|
18 |
+
var actionList = $('form#packages-manager select#'+ actionListId);
|
19 |
+
// Get selected action name.
|
20 |
+
var actionInfo = actionList.val().match(/^(\w+)(::(\w+))?$/);
|
21 |
+
if (actionInfo) { // Only if action selected.
|
22 |
+
var selectedPackagesId = $('input:checkbox[name="id[]"]').serializeObject();
|
23 |
+
this.bulkAction(actionInfo[1], selectedPackagesId['id[]']);
|
24 |
+
}
|
25 |
+
// Dont do the regular submission!
|
26 |
+
event.preventDefault();
|
27 |
+
},
|
28 |
+
|
29 |
+
/**
|
30 |
+
* put your comment there...
|
31 |
+
*
|
32 |
+
* @param event
|
33 |
+
*/
|
34 |
+
_onrowaction : function(event) {
|
35 |
+
var actionInfo = event.target.href.match(/#(\w+)\((\d+)\)/);
|
36 |
+
var action = actionInfo[1];
|
37 |
+
var packageId = actionInfo[2];
|
38 |
+
switch (action) {
|
39 |
+
case 'delete':
|
40 |
+
this.deletePackages(action, packageId);
|
41 |
+
break;
|
42 |
+
// View package file in new window.
|
43 |
+
case 'getLicenseFile':
|
44 |
+
case 'getReadmeFile':
|
45 |
+
// Initialize request params!
|
46 |
+
var requestParams = {packageId : packageId, view : 'packages/raw-file'};
|
47 |
+
// Get file content from server.
|
48 |
+
CJTServer.send('package', action, requestParams, 'get', 'html')
|
49 |
+
.success($.proxy(
|
50 |
+
function(content) {
|
51 |
+
// Open in new window.
|
52 |
+
var wndFile = window.open('', '', 'width=700, height=550, left=160');
|
53 |
+
wndFile.document.write(content);
|
54 |
+
}, this)
|
55 |
+
)
|
56 |
+
break;
|
57 |
+
}
|
58 |
+
},
|
59 |
+
|
60 |
+
/**
|
61 |
+
* put your comment there...
|
62 |
+
*
|
63 |
+
*/
|
64 |
+
_onselectrows : function(event) {
|
65 |
+
var newState = $(event.target).prop('checked');
|
66 |
+
// Check/Uncheck all rows.
|
67 |
+
$('form#packages-manager input[name="id[]"]').prop('checked', newState);
|
68 |
+
// Check/Uncheck the other select-all checkbox.
|
69 |
+
$('input:checkbox.select-all').each($.proxy(
|
70 |
+
function(index, item) {
|
71 |
+
if (item !== event.target) {
|
72 |
+
$(item).prop('checked', newState);
|
73 |
+
}
|
74 |
+
}
|
75 |
+
, this )
|
76 |
+
);
|
77 |
+
},
|
78 |
+
|
79 |
+
/**
|
80 |
+
* put your comment there...
|
81 |
+
*
|
82 |
+
* @param actionName
|
83 |
+
* @param id
|
84 |
+
*/
|
85 |
+
deletePackages : function(actionName, ids) {
|
86 |
+
// Fake Ajax object in case deletion is not confirmed.
|
87 |
+
var promised = CJTServer.getDeferredObject();
|
88 |
+
var confirmed = confirm(CJT_PACKAGESManagerI18N.confirmDelete);
|
89 |
+
if (confirmed) {
|
90 |
+
promised = this.bulkAction(actionName, ids);
|
91 |
+
}
|
92 |
+
return promised;
|
93 |
+
},
|
94 |
+
|
95 |
+
/**
|
96 |
+
* put your comment there...
|
97 |
+
*
|
98 |
+
*/
|
99 |
+
installPackage : function (templateId) {
|
100 |
+
var query = {
|
101 |
+
view : 'packages/install',
|
102 |
+
width : 470,
|
103 |
+
height: 115,
|
104 |
+
TB_iframe : true
|
105 |
+
};
|
106 |
+
var uri = CJTServer.getRequestURL('packages', 'display', query);
|
107 |
+
tb_show(CJT_PACKAGESManagerI18N.installPackageFormTitle, uri);
|
108 |
+
},
|
109 |
+
|
110 |
+
/**
|
111 |
+
* put your comment there...
|
112 |
+
*
|
113 |
+
* @param action
|
114 |
+
* @param ids
|
115 |
+
*/
|
116 |
+
bulkAction : function(action, ids) {
|
117 |
+
// Action and Ids must be valid!
|
118 |
+
if (action && ids) {
|
119 |
+
// Allow passing single id!
|
120 |
+
if (!$.isArray(ids)) {
|
121 |
+
ids = [ids];
|
122 |
+
}
|
123 |
+
return CJTServer.send('packages', action, {ids : ids})
|
124 |
+
.success($.proxy(function() {
|
125 |
+
// Refresh the list!
|
126 |
+
window.location.reload();
|
127 |
+
}, this)
|
128 |
+
);
|
129 |
+
}
|
130 |
+
},
|
131 |
+
|
132 |
+
/**
|
133 |
+
* put your comment there...
|
134 |
+
*
|
135 |
+
*/
|
136 |
+
init : function() {
|
137 |
+
// Create new Template.
|
138 |
+
$('#install-package').click($.proxy(function() {
|
139 |
+
this.installPackage();
|
140 |
+
}, this)
|
141 |
+
);
|
142 |
+
// Single row actions mixed with regular actions
|
143 |
+
// plus view packages file action!
|
144 |
+
$('.row-actions span a, .view-package-file').click($.proxy(this._onrowaction, this));
|
145 |
+
// Because we're using 'action' query variable for Controller Request purposes
|
146 |
+
// bulk actions lists should use name='action' name!
|
147 |
+
// Set Id instead of name so value can be retrieved too!
|
148 |
+
$('select[name=action]').removeAttr('name').prop('id', 'action');
|
149 |
+
$('select[name=action2]').removeAttr('name').prop('id', 'action2');
|
150 |
+
// Bulk actions.
|
151 |
+
$('#doaction, #doaction2').click($.proxy(this._onbulkaction, this));
|
152 |
+
// Chech/Uncheck rows.
|
153 |
+
$('input:checkbox.select-all').change($.proxy(this._onselectrows, this));
|
154 |
+
}
|
155 |
+
|
156 |
+
} // End form class.
|
157 |
+
|
158 |
+
// Initialize Templates Manager form when document loaded!
|
159 |
+
$($.proxy(CJTPackagesManagerForm.init, CJTPackagesManagerForm));
|
160 |
+
})(jQuery);
|
views/packages/manager/public/js/manager/manager.localization.php
ADDED
@@ -0,0 +1,15 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @version FILE_VERSION
|
4 |
+
* Localization file for jquery.block.js script.
|
5 |
+
*/
|
6 |
+
|
7 |
+
/**
|
8 |
+
* Localization for Javascript cjtJQueryBlockI18N variable.
|
9 |
+
*
|
10 |
+
* Localization text for backups script.
|
11 |
+
*/
|
12 |
+
return array(
|
13 |
+
'confirmDelete' => (cssJSToolbox::getText('This operation is permanent and cannot be reverted!') . "\n" . cssJSToolbox::getText('Would you like to delete the selected packages?')),
|
14 |
+
'installPackageFormTitle' => cssJSToolbox::getText('Install Package File'),
|
15 |
+
);
|
views/packages/manager/tmpl/default.html.tmpl
ADDED
@@ -0,0 +1,29 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
*
|
4 |
+
*/
|
5 |
+
|
6 |
+
// Disallow direct access.
|
7 |
+
defined('ABSPATH') or die("Access denied");
|
8 |
+
|
9 |
+
// Import list table class used for displaying templates list.
|
10 |
+
$this->importHelper('wp-list-table');
|
11 |
+
?>
|
12 |
+
<form id="packages-manager" class="cjt-form" method="post">
|
13 |
+
<input type="hidden" id="cjt-securityToken" value="<?php echo $this->securityToken ?>">
|
14 |
+
<div class="toolbar">
|
15 |
+
<input type="button" id="install-package" class="button-secondary action" value="<?php echo cssJSToolbox::getText('Install Package') ?>">
|
16 |
+
</div>
|
17 |
+
<?php
|
18 |
+
$listTable = new CJTPackagesManagerListTable();
|
19 |
+
// Push items into table list.
|
20 |
+
$listTable->items = $this->items;
|
21 |
+
// Pagintion.
|
22 |
+
$listTable->set_pagination_args(array(
|
23 |
+
'per_page' => $this->itemsPerPage,
|
24 |
+
'total_items' => $this->itemsTotal,
|
25 |
+
));
|
26 |
+
// Output list table
|
27 |
+
$listTable->display();
|
28 |
+
?>
|
29 |
+
</form>
|
views/packages/manager/view.php
ADDED
@@ -0,0 +1,106 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
*
|
4 |
+
*/
|
5 |
+
|
6 |
+
// Disallow direct access.
|
7 |
+
defined('ABSPATH') or die("Access denied");
|
8 |
+
|
9 |
+
/**
|
10 |
+
*
|
11 |
+
*/
|
12 |
+
class CJTPackagesManagerView extends CJTView {
|
13 |
+
|
14 |
+
/**
|
15 |
+
* put your comment there...
|
16 |
+
*
|
17 |
+
* @var mixed
|
18 |
+
*/
|
19 |
+
protected $items;
|
20 |
+
|
21 |
+
/**
|
22 |
+
* put your comment there...
|
23 |
+
*
|
24 |
+
* @var mixed
|
25 |
+
*/
|
26 |
+
protected $itemsPerPage;
|
27 |
+
|
28 |
+
/**
|
29 |
+
* put your comment there...
|
30 |
+
*
|
31 |
+
* @var mixed
|
32 |
+
*/
|
33 |
+
protected $itemsTotal;
|
34 |
+
|
35 |
+
/**
|
36 |
+
* put your comment there...
|
37 |
+
*
|
38 |
+
* @var mixed
|
39 |
+
*/
|
40 |
+
protected $securityToken;
|
41 |
+
|
42 |
+
/**
|
43 |
+
* put your comment there...
|
44 |
+
*
|
45 |
+
* @param mixed $info
|
46 |
+
* @return CJTInstallerNoticeView
|
47 |
+
*/
|
48 |
+
public function __construct($info) {
|
49 |
+
// CJTView class!
|
50 |
+
parent::__construct($info);
|
51 |
+
// register callback to show styles needed for the admin page
|
52 |
+
add_action('admin_print_styles', array(__CLASS__, 'enqueueStyles'));
|
53 |
+
// Load scripts for admin panel working
|
54 |
+
add_action('admin_print_scripts', array(__CLASS__, 'enqueueScripts'));
|
55 |
+
}
|
56 |
+
|
57 |
+
/**
|
58 |
+
* put your comment there...
|
59 |
+
*
|
60 |
+
* @param mixed $tpl
|
61 |
+
*/
|
62 |
+
public function display($tpl = null) {
|
63 |
+
// Initialize.
|
64 |
+
$model = $this->getModel('packages');
|
65 |
+
// Cache view vars.
|
66 |
+
$this->itemsTotal = $model->getItemsTotal();
|
67 |
+
$this->itemsPerPage = $model->getItemsPerPage();
|
68 |
+
$this->items = $model->getItems();
|
69 |
+
$this->securityToken = cssJSToolbox::getSecurityToken();
|
70 |
+
// Display view.
|
71 |
+
echo $this->getTemplate($tpl);
|
72 |
+
}
|
73 |
+
|
74 |
+
/**
|
75 |
+
* put your comment there...
|
76 |
+
*
|
77 |
+
*/
|
78 |
+
public static function enqueueScripts() {
|
79 |
+
// Import dependencies scripts!
|
80 |
+
self::useScripts(__CLASS__,
|
81 |
+
'jquery',
|
82 |
+
'jquery-serialize-object',
|
83 |
+
'framework:js:ajax:{CJT-}cjt-server',
|
84 |
+
'thickbox',
|
85 |
+
'views:packages:manager:public:js:{CJT_PACKAGES-}manager'
|
86 |
+
);
|
87 |
+
}
|
88 |
+
|
89 |
+
/**
|
90 |
+
* put your comment there...
|
91 |
+
*
|
92 |
+
*/
|
93 |
+
public static function enqueueStyles() {
|
94 |
+
// Import dependencies styles!
|
95 |
+
self::useStyles(__CLASS__,
|
96 |
+
'wp-admin',
|
97 |
+
'colors-fresh',
|
98 |
+
'thickbox',
|
99 |
+
'views:packages:manager:public:css:{CJT-}default'
|
100 |
+
);
|
101 |
+
}
|
102 |
+
|
103 |
+
} // End class.
|
104 |
+
|
105 |
+
// Hookable!!
|
106 |
+
CJTPackagesManagerView::define('CJTPackagesManagerView');
|
views/packages/raw-file/tmpl/default.html.tmpl
ADDED
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
*
|
4 |
+
*/
|
5 |
+
|
6 |
+
// Disallow direct access.
|
7 |
+
defined('ABSPATH') or die("Access denied");
|
8 |
+
?>
|
9 |
+
<html>
|
10 |
+
<head>
|
11 |
+
<title><?php echo cssJSToolbox::getText('Package file - Raw Viewer') ?></title>
|
12 |
+
</head>
|
13 |
+
<body>
|
14 |
+
<div style="text-align: left;">
|
15 |
+
<?php echo $this->rawContent; ?>
|
16 |
+
</div>
|
17 |
+
</body>
|
18 |
+
</html>
|
views/packages/raw-file/view.php
ADDED
@@ -0,0 +1,38 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
*
|
4 |
+
*/
|
5 |
+
|
6 |
+
// No direct access.
|
7 |
+
defined('ABSPATH') or die('Access denied');
|
8 |
+
|
9 |
+
/**
|
10 |
+
*
|
11 |
+
*/
|
12 |
+
class CJTPackagesRawFileView extends CJTView {
|
13 |
+
|
14 |
+
/**
|
15 |
+
* put your comment there...
|
16 |
+
*
|
17 |
+
* @var mixed
|
18 |
+
*/
|
19 |
+
protected $rawContent;
|
20 |
+
|
21 |
+
/**
|
22 |
+
* put your comment there...
|
23 |
+
*
|
24 |
+
* @param mixed $tpl
|
25 |
+
*/
|
26 |
+
public function display($tpl = null) {
|
27 |
+
// Get model.
|
28 |
+
$model =& $this->model;
|
29 |
+
// Get raw content for the requested file.
|
30 |
+
$this->rawContent = nl2br(htmlentities($model->getFileContent()));
|
31 |
+
// Display!
|
32 |
+
echo $this->getTemplate($tpl);
|
33 |
+
}
|
34 |
+
|
35 |
+
} // End class.
|
36 |
+
|
37 |
+
// Hookable!!
|
38 |
+
CJTPackagesRawFileView::define('CJTPackagesRawFileView', array('hookType' => CJTWordpressEvents::HOOK_FILTER));
|
views/settings/manager/tmpl/pages/metabox.html.tmpl
ADDED
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
*
|
4 |
+
*/
|
5 |
+
|
6 |
+
// No direct access allowed.
|
7 |
+
defined('ABSPATH') or die("Access denied");
|
8 |
+
|
9 |
+
// HTML Components.
|
10 |
+
require CJTOOLBOX_FRAMEWORK . '/html/components/checkbox-list/checkbox-list.class.php';
|
11 |
+
// Create checkbox list from registered post types.
|
12 |
+
$checkboxList = HTMLCheckboxList::getInstance('post-types', "settings[{$page['name']}][postTypes]", cssJSToolbox::getText('Registered Post Types'));
|
13 |
+
$postTypes = get_post_types(array('public' => 1, 'show_ui' => 1, 'show_in_nav_menus' => 1), 'objects');
|
14 |
+
foreach ($postTypes as $name => $pTObject) {
|
15 |
+
// Get checked value from saved settings
|
16 |
+
$checked = in_array($name, $settings->postTypes);
|
17 |
+
// Add checkbox for every type.
|
18 |
+
$checkboxList->add($pTObject->labels->name, $name, $checked, '[]');
|
19 |
+
}
|
20 |
+
echo $checkboxList;
|
views/settings/manager/tmpl/settings.html.tmpl
CHANGED
@@ -5,6 +5,11 @@
|
|
5 |
|
6 |
// No direct access allowed.
|
7 |
defined('ABSPATH') or die("Access denied");
|
|
|
|
|
|
|
|
|
|
|
8 |
?>
|
9 |
<html xmlns="http://www.w3.org/1999/xhtml">
|
10 |
<head>
|
5 |
|
6 |
// No direct access allowed.
|
7 |
defined('ABSPATH') or die("Access denied");
|
8 |
+
|
9 |
+
// Allow view to enqueue scripts and styles.
|
10 |
+
$this->enqueueScripts();
|
11 |
+
$this->enqueueStyles();
|
12 |
+
$this->suppressPrintScriptsHook();
|
13 |
?>
|
14 |
<html xmlns="http://www.w3.org/1999/xhtml">
|
15 |
<head>
|
views/settings/manager/view.php
CHANGED
@@ -34,10 +34,8 @@ class CJTSettingsManagerView extends CJTView {
|
|
34 |
// Define setting pages.
|
35 |
$this->pages = array(
|
36 |
array('name' => 'uninstall', 'displayName' => cssJSToolbox::getText('Uninstall')),
|
|
|
37 |
);
|
38 |
-
// Enqueue external resources.
|
39 |
-
$this->enqueueScripts();
|
40 |
-
$this->enqueueStyles();
|
41 |
}
|
42 |
|
43 |
/**
|
34 |
// Define setting pages.
|
35 |
$this->pages = array(
|
36 |
array('name' => 'uninstall', 'displayName' => cssJSToolbox::getText('Uninstall')),
|
37 |
+
array('name' => 'metabox', 'displayName' => cssJSToolbox::getText('MetaBox')),
|
38 |
);
|
|
|
|
|
|
|
39 |
}
|
40 |
|
41 |
/**
|
views/setup/activation-form/tmpl/default.html.tmpl
CHANGED
@@ -7,8 +7,9 @@
|
|
7 |
defined('ABSPATH') or die("Access denied");
|
8 |
|
9 |
// Allow view to enqueue scripts and styles.
|
10 |
-
|
11 |
-
|
|
|
12 |
?>
|
13 |
<html xmlns="http://www.w3.org/1999/xhtml">
|
14 |
<head>
|
7 |
defined('ABSPATH') or die("Access denied");
|
8 |
|
9 |
// Allow view to enqueue scripts and styles.
|
10 |
+
CJTSetupActivationFormView::enqueueScripts();
|
11 |
+
CJTSetupActivationFormView::enququeStyles();
|
12 |
+
$this->suppressPrintScriptsHook();
|
13 |
?>
|
14 |
<html xmlns="http://www.w3.org/1999/xhtml">
|
15 |
<head>
|
views/setup/activation-form/view.php
CHANGED
@@ -39,20 +39,6 @@ class CJTSetupActivationFormView extends CJTView {
|
|
39 |
*/
|
40 |
protected $securityToken;
|
41 |
|
42 |
-
/**
|
43 |
-
* put your comment there...
|
44 |
-
*
|
45 |
-
* @param mixed $info
|
46 |
-
* @return CJTInstallerNoticeView
|
47 |
-
*/
|
48 |
-
public function __construct($info) {
|
49 |
-
// CJTView class!
|
50 |
-
parent::__construct($info);
|
51 |
-
// Enqueue Styles & Scripts.
|
52 |
-
add_action('admin_print_styles', array(__CLASS__, 'enququeStyles'));
|
53 |
-
add_action('admin_print_scripts', array(__CLASS__, 'enqueueScripts'));
|
54 |
-
}
|
55 |
-
|
56 |
/**
|
57 |
* put your comment there...
|
58 |
*
|
39 |
*/
|
40 |
protected $securityToken;
|
41 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
42 |
/**
|
43 |
* put your comment there...
|
44 |
*
|
views/setup/setup/public/js/default/default.js
ADDED
@@ -0,0 +1,39 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
*
|
3 |
+
*/
|
4 |
+
|
5 |
+
/**
|
6 |
+
*
|
7 |
+
*/
|
8 |
+
(function($) {
|
9 |
+
|
10 |
+
/**
|
11 |
+
*
|
12 |
+
*/
|
13 |
+
var CJTSetupSetupForm = {
|
14 |
+
|
15 |
+
/**
|
16 |
+
*
|
17 |
+
*/
|
18 |
+
server : CJTServer,
|
19 |
+
|
20 |
+
/**
|
21 |
+
* put your comment there...
|
22 |
+
*
|
23 |
+
*/
|
24 |
+
init : function() {
|
25 |
+
// Initialize vars!
|
26 |
+
this.activationForm = $('#activation-form');
|
27 |
+
// Load activation form.
|
28 |
+
var request = $.extend({view : 'setup/activation-form'}, $('#setup-form').serializeObject());
|
29 |
+
this.activationForm.prop('src', this.server.getRequestURL('setup', 'activationFormView', request))
|
30 |
+
// Load/Show frame!
|
31 |
+
.css({display : 'block'});
|
32 |
+
}
|
33 |
+
|
34 |
+
} // End CJTInstallerNotice.
|
35 |
+
|
36 |
+
// Initioalize form when document ready!
|
37 |
+
$($.proxy(CJTSetupSetupForm.init, CJTSetupSetupForm));
|
38 |
+
|
39 |
+
})(jQuery);
|
views/setup/setup/tmpl/default.html.tmpl
ADDED
@@ -0,0 +1,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
*
|
4 |
+
*/
|
5 |
+
|
6 |
+
// Disallow direct access.
|
7 |
+
defined('ABSPATH') or die("Access denied");
|
8 |
+
?>
|
9 |
+
<div class="cjt-setup-page"><br>
|
10 |
+
<form id="setup-form">
|
11 |
+
<input type="hidden" name="component[name]" value="<?php echo $this->component['name'] ?>" />
|
12 |
+
<input type="hidden" name="component[pluginBase]" value="<?php echo $this->component['pluginBase'] ?>" />
|
13 |
+
<input type="hidden" id="cjt-securityToken" value="<?php echo $this->securityToken ?>" />
|
14 |
+
<iframe id="activation-form" NOBORDER="true" style="width:100%;height:250px; display:none"></iframe>
|
15 |
+
</form>
|
16 |
+
</div>
|
views/setup/setup/view.php
ADDED
@@ -0,0 +1,66 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
*
|
4 |
+
*/
|
5 |
+
|
6 |
+
// Disallow direct access.
|
7 |
+
defined('ABSPATH') or die("Access denied");
|
8 |
+
|
9 |
+
/**
|
10 |
+
*
|
11 |
+
*/
|
12 |
+
class CJTSetupSetupView extends CJTView {
|
13 |
+
|
14 |
+
/**
|
15 |
+
* put your comment there...
|
16 |
+
*
|
17 |
+
* @var mixed
|
18 |
+
*/
|
19 |
+
protected $component;
|
20 |
+
|
21 |
+
/**
|
22 |
+
* put your comment there...
|
23 |
+
*
|
24 |
+
* @var mixed
|
25 |
+
*/
|
26 |
+
protected $securityToken;
|
27 |
+
|
28 |
+
/**
|
29 |
+
* put your comment there...
|
30 |
+
*
|
31 |
+
* @param mixed $info
|
32 |
+
* @return CJTInstallerNoticeView
|
33 |
+
*/
|
34 |
+
public function __construct($info) {
|
35 |
+
// CJTView class!
|
36 |
+
parent::__construct($info);
|
37 |
+
// Enqueue scripts.
|
38 |
+
add_action('admin_print_scripts', array(__CLASS__, 'enqueueScripts'));
|
39 |
+
}
|
40 |
+
|
41 |
+
/**
|
42 |
+
* put your comment there...
|
43 |
+
*
|
44 |
+
* @param mixed $tpl
|
45 |
+
*/
|
46 |
+
public function display($tpl = null) {
|
47 |
+
$this->component= $this->getModel('setup')->getCJTComponentData();
|
48 |
+
$this->securityToken = cssJSToolbox::getSecurityToken();
|
49 |
+
// Display view.
|
50 |
+
echo $this->getTemplate($tpl);
|
51 |
+
}
|
52 |
+
|
53 |
+
/**
|
54 |
+
* put your comment there...
|
55 |
+
*
|
56 |
+
*/
|
57 |
+
public static function enqueueScripts() {
|
58 |
+
// Use related scripts.
|
59 |
+
self::useScripts(__CLASS__,
|
60 |
+
'jquery-serialize-object',
|
61 |
+
'framework:js:ajax:{CJT-}cjt-server',
|
62 |
+
'views:setup:setup:public:js:{CJTSetupSetupView-}default'
|
63 |
+
);
|
64 |
+
}
|
65 |
+
|
66 |
+
} // End class.
|
views/templates/info/tmpl/default.html.tmpl
ADDED
@@ -0,0 +1,22 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<div class="template-info">
|
2 |
+
<ul>
|
3 |
+
<li><span class="section"><?php cssJSToolbox::getText('Info') ?></span>
|
4 |
+
<ul>
|
5 |
+
<li class="id"><span class="label"><?php echo cssJSToolbox::getText('ID') ?>:</span> #<?php echo $this->item->id ?></li>
|
6 |
+
<li><span class="label"><?php echo cssJSToolbox::getText('Name') ?>:</span> <?php echo $this->item->name ?></li>
|
7 |
+
<li><span class="label"><?php echo cssJSToolbox::getText('Type') ?>:</span> <?php echo cssJSToolbox::getText($this->item->type) ?></li>
|
8 |
+
<li><span class="label"><?php echo cssJSToolbox::getText('Creation Date') ?>:</span> <?php echo $this->item->creationDate ?></li>
|
9 |
+
<li><span class="label"><?php echo cssJSToolbox::getText('Last Modified') ?>:</span> <?php echo $this->item->lastModified ?></li>
|
10 |
+
<li><span class="label"><?php echo cssJSToolbox::getText('Last Revision Comment') ?>:</span><p class="content large"><?php echo $this->item->changeLog ?></p></li>
|
11 |
+
</ul>
|
12 |
+
</li>
|
13 |
+
<li><span class="section"><?php cssJSToolbox::getText('About') ?></span>
|
14 |
+
<ul>
|
15 |
+
<li><span class="label"><?php echo cssJSToolbox::getText('Description') ?>:</span><p class="content large"> <?php echo $this->item->description ?></p></li>
|
16 |
+
<li><span class="label"><?php echo cssJSToolbox::getText('Version') ?>:</span> <?php echo $this->item->version ?></li>
|
17 |
+
<li><span class="label"><?php echo cssJSToolbox::getText('Author') ?>:</span> <?php echo $this->item->author ?></li>
|
18 |
+
<li><span class="label"><?php echo cssJSToolbox::getText('Keywords') ?>:</span> <?php echo $this->item->keywords ?></li>
|
19 |
+
</ul>
|
20 |
+
</li>
|
21 |
+
</ul>
|
22 |
+
</div>
|
views/templates/info/view.php
ADDED
@@ -0,0 +1,48 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
*
|
4 |
+
*/
|
5 |
+
|
6 |
+
/**
|
7 |
+
*
|
8 |
+
*/
|
9 |
+
class CJTTemplatesInfoView extends CJTView {
|
10 |
+
|
11 |
+
/**
|
12 |
+
* put your comment there...
|
13 |
+
*
|
14 |
+
* @var mixed
|
15 |
+
*/
|
16 |
+
public $item;
|
17 |
+
|
18 |
+
/**
|
19 |
+
* put your comment there...
|
20 |
+
*
|
21 |
+
* @param mixed $vInfo
|
22 |
+
* @return CJTTemplatesInfoView
|
23 |
+
*/
|
24 |
+
public function __construct($vInfo) {
|
25 |
+
parent::__construct($vInfo) ;
|
26 |
+
}
|
27 |
+
|
28 |
+
/**
|
29 |
+
* put your comment there...
|
30 |
+
*
|
31 |
+
* @param mixed $tpl
|
32 |
+
*/
|
33 |
+
public function display($tpl = null) {
|
34 |
+
// Get item.
|
35 |
+
$this->item = $this->model->getItem();
|
36 |
+
// For all items that has no value show "Not Available"
|
37 |
+
foreach ((array)$this->item as $prop => $value) {
|
38 |
+
if (!$this->item->{$prop}) {
|
39 |
+
$this->item->{$prop} = cssJSToolbox::getText('N/A');
|
40 |
+
}
|
41 |
+
}
|
42 |
+
echo $this->getTemplate($tpl);
|
43 |
+
}
|
44 |
+
|
45 |
+
} // End class.
|
46 |
+
|
47 |
+
// Hookable!!
|
48 |
+
CJTTemplatesInfoView::define('CJTTemplatesInfoView');
|
views/templates/lookup/public/css/lookup.css
ADDED
@@ -0,0 +1,52 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/* Globals */
|
2 |
+
body {margin: 0;padding: 0; font-size: 12px;font-family: Helvetica; overflow: hidden; color: #7c7c7c;}
|
3 |
+
|
4 |
+
a,
|
5 |
+
a:hover,
|
6 |
+
a:visited {text-decoration: none;}
|
7 |
+
|
8 |
+
a,
|
9 |
+
a:visited {color: #a0a0a0 !important;}
|
10 |
+
|
11 |
+
a:hover {color: #c8671b !important;}
|
12 |
+
|
13 |
+
a.active {color: #a5581b !important;}
|
14 |
+
|
15 |
+
ul {width: 100%;}
|
16 |
+
ul li {margin-bottom: 0;}
|
17 |
+
|
18 |
+
form#templates-lookup {height: 100%;}
|
19 |
+
#cjtoolbox_popup {height: 100%;}
|
20 |
+
|
21 |
+
/* Templates List */
|
22 |
+
#templates-list {border-bottom: 1px solid #cccccc;height: 100%;}
|
23 |
+
.templates-list {overflow: auto;}
|
24 |
+
.templates-list ul.templates {padding-left: 33px; display: none; width: 255px; margin-top: 3px;}
|
25 |
+
.templates-list ul.templates li {padding-bottom: 1px;}
|
26 |
+
.templates-list ul.templates li .title {font-weight: bold; margin-bottom: 3px;}
|
27 |
+
.templates-list ul li .options {display: inline-block; margin-left: 33px; padding-top: 1px;}
|
28 |
+
.templates-list ul li .options .unlink-template {font-style: italic;}
|
29 |
+
.sweep .actions {float: right; text-decoration: underline; margin-top: 1px;}
|
30 |
+
.sweep {margin-top: -8px;}
|
31 |
+
|
32 |
+
/* Authors */
|
33 |
+
.author-name a.name,
|
34 |
+
.author-name a.name:hover
|
35 |
+
.author-name a.name:visited {font-weight: bold;}
|
36 |
+
.ui-accordion-header {
|
37 |
+
height: 26px;
|
38 |
+
font-weight: bold;
|
39 |
+
font-size: 18px;
|
40 |
+
padding: 4px 0 0 11px;
|
41 |
+
border-left: 1px solid #bbb;
|
42 |
+
border-right: 1px solid #bbb;
|
43 |
+
border-top: 1px solid #bbb;
|
44 |
+
margin: 0;
|
45 |
+
}
|
46 |
+
.ui-accordion-content {
|
47 |
+
border-left: 1px solid #bbb;
|
48 |
+
border-right: 1px solid #bbb;
|
49 |
+
border-top: 1px solid #bbb;
|
50 |
+
padding: 9px;
|
51 |
+
}
|
52 |
+
.ui-accordion-header.ui-accordion-header-active a {color: #a5581b !important;}
|
views/templates/lookup/public/js/lookup/lookup.js
ADDED
@@ -0,0 +1,207 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
*
|
3 |
+
*/
|
4 |
+
|
5 |
+
/**
|
6 |
+
*
|
7 |
+
*/
|
8 |
+
(function($) {
|
9 |
+
|
10 |
+
/**
|
11 |
+
* put your comment there...
|
12 |
+
*
|
13 |
+
*/
|
14 |
+
var blockId = parseInt(window.location.href.match(/\&blockId\=(\d+)/)[1]);
|
15 |
+
|
16 |
+
/**
|
17 |
+
* put your comment there...
|
18 |
+
*
|
19 |
+
*/
|
20 |
+
var templatesLookupFormNS = window.parent.CJTToolBox.forms.templatesLookupForm[blockId];
|
21 |
+
|
22 |
+
/**
|
23 |
+
* put your comment there...
|
24 |
+
*
|
25 |
+
* @type Object
|
26 |
+
*/
|
27 |
+
templatesLookupFormNS.form = {
|
28 |
+
|
29 |
+
/**
|
30 |
+
* put your comment there...
|
31 |
+
*
|
32 |
+
*/
|
33 |
+
server : window.parent.CJTBlocksPage.server,
|
34 |
+
|
35 |
+
/**
|
36 |
+
* put your comment there...
|
37 |
+
*
|
38 |
+
*/
|
39 |
+
_onsweepactions : function(event) {
|
40 |
+
var action = event.target.href.match(/#([\w\-]+)/)[1];
|
41 |
+
var block = templatesLookupFormNS.inputs.block;
|
42 |
+
switch (action) {
|
43 |
+
case 'unlink-all':
|
44 |
+
var confirmed = confirm(CJT_TEMPLATESLookupI18N.confirmUnlinkAll);
|
45 |
+
if (confirmed) {
|
46 |
+
this.server.send('templatesLookup', 'unlinkAll', {blockId : block.get('id')})
|
47 |
+
.success(
|
48 |
+
function(response) {
|
49 |
+
var newState = response.newState;
|
50 |
+
// Update links to reflect new state!
|
51 |
+
$('.templates .unlink-template').text(newState.text)
|
52 |
+
.prop('href', '#' + newState.action)
|
53 |
+
.removeClass().addClass(newState.className);
|
54 |
+
// Notify user!
|
55 |
+
alert(CJT_TEMPLATESLookupI18N.allTemplatesHasBeenUnlinkedSuccessful);
|
56 |
+
}
|
57 |
+
)
|
58 |
+
}
|
59 |
+
break;
|
60 |
+
}
|
61 |
+
},
|
62 |
+
|
63 |
+
/**
|
64 |
+
* put your comment there...
|
65 |
+
*
|
66 |
+
*/
|
67 |
+
_onsweepfilters : function(event) {
|
68 |
+
// Get author name from the clicked link.
|
69 |
+
var filter = event.target.href.match(/#(\w+)/)[1];
|
70 |
+
var classes = {show : '', hide : ''};
|
71 |
+
switch (filter) {
|
72 |
+
case 'linked':
|
73 |
+
classes.show = '.unlink-template';
|
74 |
+
classes.hide = '.link-template';
|
75 |
+
break;
|
76 |
+
case 'unlinked':
|
77 |
+
classes.show = '.link-template';
|
78 |
+
classes.hide = '.unlink-template';
|
79 |
+
break;
|
80 |
+
case 'all':
|
81 |
+
classes.show = '.link-template, .unlink-template';
|
82 |
+
break;
|
83 |
+
}
|
84 |
+
// Show AND Hide Templates!
|
85 |
+
$(classes.show).parents('.template-item').show();
|
86 |
+
$(classes.hide).parents('.template-item').hide();
|
87 |
+
// Mark as active.
|
88 |
+
$('.filters a').removeClass('active');
|
89 |
+
$(event.target).addClass('active');
|
90 |
+
return false;
|
91 |
+
},
|
92 |
+
|
93 |
+
/**
|
94 |
+
* put your comment there...
|
95 |
+
*
|
96 |
+
* @param event
|
97 |
+
*/
|
98 |
+
_ontemplateaction : function(event) {
|
99 |
+
// Get author name from the clicked link.
|
100 |
+
var actionInfo = event.target.href.match(/#(\w+)\((\d+)\)/);
|
101 |
+
var request;
|
102 |
+
// Do specific actions.!
|
103 |
+
switch (actionInfo[1]) {
|
104 |
+
case 'edit': // Allow editing template.
|
105 |
+
// Template edit form parameters.
|
106 |
+
request = {
|
107 |
+
id : actionInfo[2],
|
108 |
+
view : 'templates/template',
|
109 |
+
width : 800,
|
110 |
+
height : 571,
|
111 |
+
TB_iframe : true
|
112 |
+
};
|
113 |
+
var uri = parent.CJTBlocksPage.server.getRequestURL('template', actionInfo[1], request);
|
114 |
+
parent.tb_show(CJT_TEMPLATESLookupI18N.editTemplateFormTitle, uri);
|
115 |
+
break;
|
116 |
+
default : // Template-Block relation actions (TBRA)!
|
117 |
+
// Get block object model instance refernce!
|
118 |
+
var block = templatesLookupFormNS.inputs.block;
|
119 |
+
// Initialize request parameters.
|
120 |
+
request = {templateId : actionInfo[2], blockId : block.get('id')};
|
121 |
+
// Do action!
|
122 |
+
this.server.send('templatesLookup', actionInfo[1], request)
|
123 |
+
.success(
|
124 |
+
function(response) {
|
125 |
+
// Special actions
|
126 |
+
switch (actionInfo[1]) {
|
127 |
+
case 'embedded':
|
128 |
+
// Insert template at cursor.
|
129 |
+
block.aceEditor.getSession().replace(block.aceEditor.getSelectionRange(), response.code);
|
130 |
+
break;
|
131 |
+
}
|
132 |
+
// If the changes required reflect a state.
|
133 |
+
var newState = response.newState;
|
134 |
+
if (newState) {
|
135 |
+
$(event.target).text(newState.text)
|
136 |
+
.prop('href', '#' + newState.action + '(' + request.templateId + ')')
|
137 |
+
.get(0).className = newState.className;
|
138 |
+
}
|
139 |
+
// Close the Popup after completing!
|
140 |
+
//popupButton.close();
|
141 |
+
// Set focus to ace editor.
|
142 |
+
//block.aceEditor.focus();
|
143 |
+
}
|
144 |
+
);
|
145 |
+
break;
|
146 |
+
}
|
147 |
+
},
|
148 |
+
|
149 |
+
/**
|
150 |
+
* put your comment there...
|
151 |
+
*
|
152 |
+
*/
|
153 |
+
_ontoggletemplates : function(event) {
|
154 |
+
// Get author name from the clicked link.
|
155 |
+
var authorIdentified = event.target.href.match(/#(\w+)/)[1];
|
156 |
+
// Get list id.
|
157 |
+
var templatesListId = '#' + authorIdentified + '-author-templates';
|
158 |
+
// Toggle the list.
|
159 |
+
$(templatesListId).toggle();
|
160 |
+
},
|
161 |
+
|
162 |
+
/**
|
163 |
+
* put your comment there...
|
164 |
+
*
|
165 |
+
*/
|
166 |
+
init : function() {
|
167 |
+
// Initialize accordion Plugin.
|
168 |
+
$('#templates-list').accordion({fillSpace : true, heightStyle : "fill"})
|
169 |
+
// Make author templates list toggle-able.
|
170 |
+
.find('.author-name .name').click($.proxy(this._ontoggletemplates, this));
|
171 |
+
// Actions!!
|
172 |
+
$('.templates .template-action').click($.proxy(this._ontemplateaction, this));
|
173 |
+
// Sweep filters.
|
174 |
+
$('.sweep .actions a').click($.proxy(this._onsweepactions, this));
|
175 |
+
// Sweep Actions.
|
176 |
+
$('.sweep .filters a').click($.proxy(this._onsweepfilters, this));
|
177 |
+
// Apply other elements when the form is loaded.
|
178 |
+
this.refresh();
|
179 |
+
},
|
180 |
+
|
181 |
+
/**
|
182 |
+
* Refresh state when iframe is already loaded.
|
183 |
+
*
|
184 |
+
*/
|
185 |
+
refresh : function() {
|
186 |
+
// Set THEME color.
|
187 |
+
var block = window.parent.CJTBlocksPage.blocks.getBlock(blockId).get(0).CJTBlock;
|
188 |
+
var theme = block.theme;
|
189 |
+
var blockElement = block.block.box;
|
190 |
+
blockElement.find('iframe.templates-lookup').css('background-color', theme.backgroundColor);
|
191 |
+
// Set the size of the Accordion Tab based on the Frame height!
|
192 |
+
// Frame height might be changed by the Parent window.
|
193 |
+
var accordionHeight = templatesLookupFormNS.inputs.height - ($('.sweep').height() + 5);
|
194 |
+
$('#templates-lookup').css('height', (accordionHeight + 'px'));
|
195 |
+
// Use accordion menu for templates types list.
|
196 |
+
// @TODO: Select type corresponding to editor language type
|
197 |
+
// (e.g if editor-lang = 'css' then select 'CSS', etc...).
|
198 |
+
// var activeTypeSelector = '#templates-type-header-' + templatesLookupFormNS.inputs.block.get('editorLang');
|
199 |
+
$('#templates-list').accordion('refresh');
|
200 |
+
}
|
201 |
+
|
202 |
+
} // End class.
|
203 |
+
|
204 |
+
// Initialize form.
|
205 |
+
$($.proxy(templatesLookupFormNS.form.init, templatesLookupFormNS.form));
|
206 |
+
|
207 |
+
})(jQuery);
|
views/templates/lookup/public/js/lookup/lookup.localization.php
ADDED
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @version FILE_VERSION
|
4 |
+
* Localization file for jquery.block.js script.
|
5 |
+
*/
|
6 |
+
|
7 |
+
/**
|
8 |
+
* Localization for Javascript cjtJQueryBlockI18N variable.
|
9 |
+
*
|
10 |
+
* Localization text for backups script.
|
11 |
+
*/
|
12 |
+
return array(
|
13 |
+
'confirmUnlinkAll' => cssJSToolbox::getText('This operation is permanent and cannot be reverted!') .
|
14 |
+
"\n" .
|
15 |
+
cssJSToolbox::getText('Would you like to UNLINK all linked templates?'),
|
16 |
+
'allTemplatesHasBeenUnlinkedSuccessful' => cssJSToolbox::getText('All Templates has been unlinked sucessfully!'),
|
17 |
+
'editTemplateFormTitle' => cssJSToolbox::getText('Lookup Quick Template Edit Form'),
|
18 |
+
);
|
views/templates/lookup/tmpl/default.html.tmpl
ADDED
@@ -0,0 +1,80 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
*
|
4 |
+
*/
|
5 |
+
|
6 |
+
/**
|
7 |
+
* No direct access.
|
8 |
+
*/
|
9 |
+
defined('ABSPATH') or die("Access denied");
|
10 |
+
|
11 |
+
// Allow view to enqueue scripts and styles.
|
12 |
+
$this->enqueueScripts();
|
13 |
+
$this->enqueueStyles();
|
14 |
+
$this->suppressPrintScriptsHook();
|
15 |
+
?>
|
16 |
+
<html xmlns="http://www.w3.org/1999/xhtml">
|
17 |
+
<head>
|
18 |
+
<?php wp_print_head_scripts() ?>
|
19 |
+
<?php wp_print_styles() ?>
|
20 |
+
</head>
|
21 |
+
<body>
|
22 |
+
<div id="cjtoolbox_popup">
|
23 |
+
<form id="templates-lookup" class="cjt-form">
|
24 |
+
<?php if (empty($this->items)) : ?>
|
25 |
+
|
26 |
+
<?php else : ?>
|
27 |
+
<div id="templates-list">
|
28 |
+
<?php foreach ($this->items as $type => $authors) : ?>
|
29 |
+
<h3 id="#templates-type-header-<?php echo $type ?>"><a href="#"><?php echo cssJSToolbox::getText($type) ?></a></h3>
|
30 |
+
<div id="#templates-type-content-<?php echo $type ?>" class="templates-list">
|
31 |
+
<ul class="authors-list">
|
32 |
+
<?php
|
33 |
+
foreach ($authors as $author => $templates) :
|
34 |
+
$authorIdentifier ="{$type}_" . str_replace(array(' ', '-', '_'), '', $author);
|
35 |
+
?>
|
36 |
+
<li>
|
37 |
+
<span class="author-name"><?php echo cssJSToolbox::getText('User') ?>: <a class="name" href="#<?php echo "{$authorIdentifier}" ?>"><?php echo $author ?></a></span>
|
38 |
+
<ul id="<?php echo "{$authorIdentifier}" ?>-author-templates" class="templates">
|
39 |
+
<?php foreach ($templates as $id => $template) : ?>
|
40 |
+
<li class="template-item">
|
41 |
+
<div class="title" title="<?php echo $template->description ?>"><?php echo $template->name ?></div>
|
42 |
+
<span class="options">
|
43 |
+
<a href="#embedded(<?php echo $id ?>)" class="template-action"><?php echo cssJSToolbox::getText('Embed') ?></a>
|
44 |
+
<?php if ($template->linked) : ?>
|
45 |
+
| <a href="#unlink(<?php echo $id ?>)" class="template-action unlink-template"><?php echo cssJSToolbox::getText('Unlink') ?></a>
|
46 |
+
<?php else : ?>
|
47 |
+
| <a href="#link(<?php echo $id ?>)" class="template-action link-template"><?php echo cssJSToolbox::getText('Link') ?></a>
|
48 |
+
<?php endif; ?>
|
49 |
+
<?php if (!$template->systemTemplate) : // Allow editing noo-system templates only ?>
|
50 |
+
| <a href="#edit(<?php echo $id ?>)" class="template-action edit-template"><?php echo cssJSToolbox::getText('Edit') ?></a>
|
51 |
+
<?php endif; ?>
|
52 |
+
</span>
|
53 |
+
</li>
|
54 |
+
<?php endforeach; ?>
|
55 |
+
</ul>
|
56 |
+
</li>
|
57 |
+
<?php endforeach; ?>
|
58 |
+
</ul>
|
59 |
+
</div>
|
60 |
+
<?php endforeach; ?>
|
61 |
+
</div>
|
62 |
+
<?php endif; ?>
|
63 |
+
</form>
|
64 |
+
<div class="sweep">
|
65 |
+
<span class="wrap">
|
66 |
+
<span class="filters-title"><?php echo cssJSToolbox::getText('Show') ?>: </span>
|
67 |
+
<span class="filters">
|
68 |
+
<a href="#linked"><?php echo cssJSToolbox::getText('Linked') ?></a> |
|
69 |
+
<a href="#unlinked"><?php echo cssJSToolbox::getText('Unlinked') ?></a> |
|
70 |
+
<a href="#all" class="active"><?php echo cssJSToolbox::getText('All') ?></a>
|
71 |
+
</span>
|
72 |
+
</span>
|
73 |
+
<span class="actions">
|
74 |
+
<a href="#unlink-all"><?php echo cssJSToolbox::getText('Unlink All') ?></a>
|
75 |
+
</span>
|
76 |
+
</div>
|
77 |
+
</div>
|
78 |
+
<?php wp_print_footer_scripts() ?>
|
79 |
+
</body>
|
80 |
+
</html>
|
views/templates/lookup/view.php
ADDED
@@ -0,0 +1,64 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @version $ Id; ?FILE_NAME ?DATE ?TIME ?AUTHOR $
|
4 |
+
*/
|
5 |
+
|
6 |
+
/**
|
7 |
+
* No direct access.
|
8 |
+
*/
|
9 |
+
// No Direct Accesss code
|
10 |
+
|
11 |
+
/**
|
12 |
+
*
|
13 |
+
* DESCRIPTION
|
14 |
+
*
|
15 |
+
* @author ??
|
16 |
+
* @version ??
|
17 |
+
*/
|
18 |
+
class CJTTemplatesLookupView extends CJTView {
|
19 |
+
|
20 |
+
/**
|
21 |
+
* put your comment there...
|
22 |
+
*
|
23 |
+
* @var mixed
|
24 |
+
*/
|
25 |
+
public $items;
|
26 |
+
|
27 |
+
/**
|
28 |
+
* put your comment there...
|
29 |
+
*
|
30 |
+
*/
|
31 |
+
public function display($tpl = null) {
|
32 |
+
// Query templates list.
|
33 |
+
$this->items = $this->getModel()->getItems();
|
34 |
+
// Display the view.
|
35 |
+
echo $this->getTemplate($tpl);
|
36 |
+
}
|
37 |
+
|
38 |
+
/**
|
39 |
+
* put your comment there...
|
40 |
+
*
|
41 |
+
*/
|
42 |
+
protected function enqueueScripts() {
|
43 |
+
// Get JQuery.
|
44 |
+
self::useScripts(__CLASS__,
|
45 |
+
'jquery-ui-accordion',
|
46 |
+
'views:templates:lookup:public:js:{CJT_TEMPLATES-}lookup'
|
47 |
+
);
|
48 |
+
}
|
49 |
+
|
50 |
+
/**
|
51 |
+
* put your comment there...
|
52 |
+
*
|
53 |
+
*/
|
54 |
+
protected function enqueueStyles() {
|
55 |
+
self::useStyles(__CLASS__,
|
56 |
+
'framework:css:{CJT-}forms',
|
57 |
+
'views:templates:lookup:public:css:{CJT-}lookup'
|
58 |
+
);
|
59 |
+
}
|
60 |
+
|
61 |
+
} // End class.
|
62 |
+
|
63 |
+
// Hookable!!
|
64 |
+
CJTTemplatesLookupView::define('CJTTemplatesLookupView');
|
views/templates/manager/helpers/wp-list-table.inc.php
ADDED
@@ -0,0 +1,181 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
*
|
4 |
+
*/
|
5 |
+
|
6 |
+
// Disallow direct access.
|
7 |
+
defined('ABSPATH') or die("Access denied");
|
8 |
+
|
9 |
+
// Import WP_List_Table class.
|
10 |
+
require_once ABSPATH . 'wp-admin/includes/class-wp-list-table.php';
|
11 |
+
cssJSToolbox::import('tables:template.php');
|
12 |
+
|
13 |
+
/**
|
14 |
+
*
|
15 |
+
*/
|
16 |
+
class CJTTemplatesManagerListTable extends WP_List_Table {
|
17 |
+
|
18 |
+
/**
|
19 |
+
* put your comment there...
|
20 |
+
*
|
21 |
+
*/
|
22 |
+
public function __construct() {
|
23 |
+
// Set hook suffix (E_ALL complain)!
|
24 |
+
$GLOBALS['hook_suffix'] = 'cjt';
|
25 |
+
// Table list arguments.
|
26 |
+
$args = array();
|
27 |
+
parent::__construct($args);
|
28 |
+
}
|
29 |
+
|
30 |
+
/**
|
31 |
+
*
|
32 |
+
*/
|
33 |
+
protected function column_default($item, $name) {
|
34 |
+
$value = null;
|
35 |
+
switch ($name) {
|
36 |
+
case 'state':
|
37 |
+
case 'type':
|
38 |
+
$value = cssJSToolbox::getText($item->{$name});
|
39 |
+
break;
|
40 |
+
case 'name':
|
41 |
+
// Display cell value as regular.
|
42 |
+
$value = "<span class='template-name'>{$item->{$name}}</span>";
|
43 |
+
// Show description. Truncate description/display breif desc.
|
44 |
+
$tweentyChunks = array_chunk(explode(' ', $item->description), 20);
|
45 |
+
$brief = implode(' ', array_shift($tweentyChunks));
|
46 |
+
// Final text!
|
47 |
+
$value .= '<br />';
|
48 |
+
$value .= "<div class='description'><span>{$brief}</span>";
|
49 |
+
if (strlen($brief) < strlen($item->description)) {
|
50 |
+
$value .= '.... ';
|
51 |
+
}
|
52 |
+
$value .= '</div>';
|
53 |
+
// Display row actions underneath template name column.
|
54 |
+
$actions = array();
|
55 |
+
$actions['info'] = "<a href='#info({$item->id})'>" . cssJSToolbox::getText('Info') . '</a>';
|
56 |
+
$actions['edit'] = "<a href='#edit({$item->id})'>" . cssJSToolbox::getText('Edit') . '</a>';
|
57 |
+
// Allow Deletion Only if state = trash!
|
58 |
+
if ($item->state == 'trash') {
|
59 |
+
$actions['delete'] = "<a href='#delete({$item->id})'>" . cssJSToolbox::getText('Delete') . '</a>';
|
60 |
+
}
|
61 |
+
// Show only states that the Template s not in!
|
62 |
+
$states = CJTTemplateTable::$states;
|
63 |
+
unset($states[$item->state]);
|
64 |
+
foreach ($states as $name => $text) {
|
65 |
+
$actions[$name] = "<a href='#changeState({$item->id})'>{$text}</a>";
|
66 |
+
}
|
67 |
+
// Show actions row underneath template name!!
|
68 |
+
$value .= $this->row_actions($actions, false);
|
69 |
+
break;
|
70 |
+
case '_selection_':
|
71 |
+
echo "<input type='checkbox' name='id[]' value='{$item->id}' />";
|
72 |
+
break;
|
73 |
+
default;
|
74 |
+
$value = $item->{$name};
|
75 |
+
break;
|
76 |
+
}
|
77 |
+
return $value;
|
78 |
+
}
|
79 |
+
|
80 |
+
/**
|
81 |
+
* put your comment there...
|
82 |
+
*
|
83 |
+
* @param mixed $which
|
84 |
+
*/
|
85 |
+
function extra_tablenav($which) {
|
86 |
+
// Import dependencies.
|
87 |
+
cssJSToolbox::import('framework:html:list.php');
|
88 |
+
// Define filters.
|
89 |
+
$filters = array();
|
90 |
+
$filters['states'] = 'State';
|
91 |
+
$filters['types'] = 'Type';
|
92 |
+
$filters['authors'] = 'Author';
|
93 |
+
$filters['versions'] = 'Version';
|
94 |
+
$filters['creation-dates'] = 'Date Created';
|
95 |
+
$filters['development-states'] = 'Release';
|
96 |
+
$filters['last-modified-dates'] = 'Last Modified';
|
97 |
+
// Get the HTML field for each filter antput the result.
|
98 |
+
$filtersName = array();
|
99 |
+
foreach ($filters as $name => $text) {
|
100 |
+
// Output field markup.
|
101 |
+
$fieldName = "filter_{$name}";
|
102 |
+
$classes = "filter filter_{$name}";
|
103 |
+
echo CJTListField::getInstance("template-{$name}",
|
104 |
+
'templates-manager',
|
105 |
+
$fieldName,
|
106 |
+
isset($_REQUEST[$fieldName]) ? $_REQUEST[$fieldName] : null,
|
107 |
+
null,
|
108 |
+
$classes,
|
109 |
+
null,
|
110 |
+
null,
|
111 |
+
null,
|
112 |
+
cssJSToolbox::getText($text)
|
113 |
+
)->getInput();
|
114 |
+
// Complete list of filters names!
|
115 |
+
$filtersName[] = $fieldName;
|
116 |
+
}
|
117 |
+
if ($which == 'top') {
|
118 |
+
// Output all filter names list!
|
119 |
+
$filtersName = implode(',', $filtersName);
|
120 |
+
echo "<input type='hidden' name='allFiltersName' value='{$filtersName}' />";
|
121 |
+
}
|
122 |
+
}
|
123 |
+
|
124 |
+
/**
|
125 |
+
* put your comment there...
|
126 |
+
*
|
127 |
+
*/
|
128 |
+
public function get_bulk_actions() {
|
129 |
+
// Bulk ations.
|
130 |
+
$actions = array(
|
131 |
+
'delete' => cssJSToolbox::getText('Delete'),
|
132 |
+
'changeState::published' => cssJSToolbox::getText('published'),
|
133 |
+
'changeState::trash' => cssJSToolbox::getText('trash'),
|
134 |
+
'changeState::draft' => cssJSToolbox::getText('draft'),
|
135 |
+
);
|
136 |
+
// Return actions!
|
137 |
+
return $actions;
|
138 |
+
}
|
139 |
+
|
140 |
+
/**
|
141 |
+
* Get a list of columns. The format is:
|
142 |
+
* 'internal-name' => 'Title'
|
143 |
+
*
|
144 |
+
* @since 3.1.0
|
145 |
+
* @access protected
|
146 |
+
* @abstract
|
147 |
+
*
|
148 |
+
* @return array
|
149 |
+
*/
|
150 |
+
public function get_columns() {
|
151 |
+
return array(
|
152 |
+
'_selection_' => '<input type="checkbox" class="select-all" />',
|
153 |
+
'name' => cssJSToolbox::getText('Name'),
|
154 |
+
'type' => cssJSToolbox::getText('Type'),
|
155 |
+
'version' => cssJSToolbox::getText('Version'),
|
156 |
+
'developmentState' => cssJSToolbox::getText('Release'),
|
157 |
+
'author' => cssJSToolbox::getText('Author'),
|
158 |
+
'creationDate' => cssJSToolbox::getText('Date Created'),
|
159 |
+
'lastModified' => cssJSToolbox::getText('Last Modified'),
|
160 |
+
'state' => cssJSToolbox::getText('State'),
|
161 |
+
);
|
162 |
+
}
|
163 |
+
|
164 |
+
/**
|
165 |
+
* put your comment there...
|
166 |
+
*
|
167 |
+
*/
|
168 |
+
public function get_sortable_columns() {
|
169 |
+
$sortables = array();
|
170 |
+
$sortables['name'] = 'name';
|
171 |
+
$sortables['type'] = 'type';
|
172 |
+
$sortables['creationDate'] = 'creationDate';
|
173 |
+
$sortables['lastModified'] = 'lastModified';
|
174 |
+
$sortables['state'] = 'state';
|
175 |
+
$sortables['version'] = 'version';
|
176 |
+
$sortables['developmentState'] = 'developmentState';
|
177 |
+
$sortables['author'] = 'author';
|
178 |
+
return $sortables;
|
179 |
+
}
|
180 |
+
|
181 |
+
} // End class.
|
views/templates/manager/public/css/default.css
ADDED
@@ -0,0 +1,23 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
#wpcontent, #footer {margin-left: 7px;}
|
2 |
+
#wpbody-content {padding-bottom: 65px}
|
3 |
+
table.wp-list-table {min-width: 900px;}
|
4 |
+
table.wp-list-table tbody tr td input[type="checkbox"] {margin-left: 8px;}
|
5 |
+
.filter {margin-top: 2px;}
|
6 |
+
table tr th {text-align: center;}
|
7 |
+
|
8 |
+
th#_selection_ {width: 40px;}
|
9 |
+
th#developmentState, th#state, th#version, th#type {width: 80px;}
|
10 |
+
th#author, th#creationDate, th#lastModified{width: 120px;}
|
11 |
+
td.name.column-name .description{
|
12 |
+
margin-left: 6px;
|
13 |
+
font-weight: bold;
|
14 |
+
font-size: 11px;
|
15 |
+
font-family: sans-serif;
|
16 |
+
margin-top: 6px;
|
17 |
+
min-width: 280px;
|
18 |
+
}
|
19 |
+
th.sortable a, th.sorted a {padding-top: 0px; padding-bottom: 0px;}
|
20 |
+
select option.optional {color: #AAAAAA;}
|
21 |
+
.template-info span.label{font-weight: bold;}
|
22 |
+
.template-info .content.large {height: 60px; background-color: #EFEFEF; margin: 0 0 0 3px;overflow: auto}
|
23 |
+
.template-info .id{text-align: center;background-color: navajoWhite;}
|
views/templates/manager/public/js/manager/manager.js
ADDED
@@ -0,0 +1,179 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
*
|
3 |
+
*/
|
4 |
+
(function($) {
|
5 |
+
|
6 |
+
/**
|
7 |
+
*
|
8 |
+
*/
|
9 |
+
CJTTemplatesManagerForm = {
|
10 |
+
|
11 |
+
/**
|
12 |
+
* put your comment there...
|
13 |
+
*
|
14 |
+
*/
|
15 |
+
_onbulkaction : function(event) {
|
16 |
+
// Get bulk action list element.
|
17 |
+
var actionListId = event.target.id.replace('do', '');
|
18 |
+
var actionList = $('form#templates-manager select#'+ actionListId);
|
19 |
+
// Get selected action name.
|
20 |
+
var actionInfo = actionList.val().match(/^(\w+)(::(\w+))?$/);
|
21 |
+
if (actionInfo) { // Only if action selected.
|
22 |
+
var selectedTemplatesId = $('input:checkbox[name="id[]"]').serializeObject();
|
23 |
+
this.bulkAction(actionInfo[1], selectedTemplatesId['id[]'], actionInfo[3]);
|
24 |
+
}
|
25 |
+
// Dont do the regular submission!
|
26 |
+
event.preventDefault();
|
27 |
+
},
|
28 |
+
|
29 |
+
/**
|
30 |
+
* put your comment there...
|
31 |
+
*
|
32 |
+
*/
|
33 |
+
_onfilter : function(event) {
|
34 |
+
var filterElement = event.target;
|
35 |
+
// Get form input field for the filter field.
|
36 |
+
var inputFieldName = filterElement.id;
|
37 |
+
var inputField = $('form#templates-manager input:hidden[name="' + inputFieldName + '"]');
|
38 |
+
// Set the value for the form field to the filter field.
|
39 |
+
inputField.val(filterElement.value);
|
40 |
+
// Submit the form.
|
41 |
+
filterElement.form.submit();
|
42 |
+
},
|
43 |
+
|
44 |
+
/**
|
45 |
+
* put your comment there...
|
46 |
+
*
|
47 |
+
* @param event
|
48 |
+
*/
|
49 |
+
_onrowaction : function(event) {
|
50 |
+
var actionInfo = event.target.href.match(/#(\w+)\((\d+)\)/);
|
51 |
+
var action = actionInfo[1];
|
52 |
+
var templateId = actionInfo[2];
|
53 |
+
switch (action) {
|
54 |
+
case 'info':
|
55 |
+
var query = {
|
56 |
+
view : 'templates/info',
|
57 |
+
id : templateId,
|
58 |
+
width : '528px',
|
59 |
+
height: '385px'
|
60 |
+
};
|
61 |
+
var uri = parent.CJTBlocksPage.server.getRequestURL('template', 'info', query);
|
62 |
+
tb_show(CJT_TEMPLATESManagerI18N.InfoFormTitle, uri);
|
63 |
+
break;
|
64 |
+
case 'edit':
|
65 |
+
this.createNewTemplate(templateId);
|
66 |
+
break;
|
67 |
+
case 'delete':
|
68 |
+
this.deleteTemplates(action, templateId);
|
69 |
+
break;
|
70 |
+
case 'changeState':
|
71 |
+
this.bulkAction(action, templateId, event.target.parentNode.className);
|
72 |
+
break;
|
73 |
+
}
|
74 |
+
},
|
75 |
+
|
76 |
+
/**
|
77 |
+
* put your comment there...
|
78 |
+
*
|
79 |
+
*/
|
80 |
+
_onselectrows : function(event) {
|
81 |
+
var newState = $(event.target).prop('checked');
|
82 |
+
// Check/Uncheck all rows.
|
83 |
+
$('form#templates-manager input[name="id[]"]').prop('checked', newState);
|
84 |
+
// Check/Uncheck the other select-all checkbox.
|
85 |
+
$('input:checkbox.select-all').each($.proxy(
|
86 |
+
function(index, item) {
|
87 |
+
if (item !== event.target) {
|
88 |
+
$(item).prop('checked', newState);
|
89 |
+
}
|
90 |
+
}
|
91 |
+
, this )
|
92 |
+
);
|
93 |
+
},
|
94 |
+
|
95 |
+
/**
|
96 |
+
* put your comment there...
|
97 |
+
*
|
98 |
+
*/
|
99 |
+
createNewTemplate : function (templateId) {
|
100 |
+
var templateId = (templateId === undefined) ? 0 : templateId;
|
101 |
+
var operation = templateId ? 'edit' : 'create';
|
102 |
+
var query = {
|
103 |
+
view : 'templates/template',
|
104 |
+
id : templateId,
|
105 |
+
width : 800,
|
106 |
+
height: 571,
|
107 |
+
TB_iframe : true
|
108 |
+
};
|
109 |
+
var uri = parent.CJTBlocksPage.server.getRequestURL('template', 'edit', query);
|
110 |
+
tb_show(CJT_TEMPLATESManagerI18N[operation + 'TemplateDialogTitle'], uri);
|
111 |
+
},
|
112 |
+
|
113 |
+
/**
|
114 |
+
* put your comment there...
|
115 |
+
*
|
116 |
+
* @param action
|
117 |
+
* @param ids
|
118 |
+
*/
|
119 |
+
bulkAction : function(action, ids, params) {
|
120 |
+
// Action and Ids must be valid!
|
121 |
+
if (action && ids) {
|
122 |
+
// Allow passing single id!
|
123 |
+
if (!$.isArray(ids)) {
|
124 |
+
ids = [ids];
|
125 |
+
}
|
126 |
+
return parent.CJTBlocksPage.server.send('templatesManager', action, {ids : ids, params: params})
|
127 |
+
.success($.proxy(function() {
|
128 |
+
// Refresh the list!
|
129 |
+
window.location.reload();
|
130 |
+
}, this)
|
131 |
+
);
|
132 |
+
}
|
133 |
+
},
|
134 |
+
|
135 |
+
/**
|
136 |
+
* put your comment there...
|
137 |
+
*
|
138 |
+
* @param ids
|
139 |
+
*/
|
140 |
+
deleteTemplates : function(action, ids) {
|
141 |
+
// Fake Ajax object in case deletion is not confirmed.
|
142 |
+
var promised = window.parent.CJTBlocksPage.server.getDeferredObject();
|
143 |
+
var confirmed = confirm(CJT_TEMPLATESManagerI18N.confirmDeleteTemplates);
|
144 |
+
if (confirmed) {
|
145 |
+
promised = this.bulkAction(action, ids);
|
146 |
+
}
|
147 |
+
return promised;
|
148 |
+
},
|
149 |
+
|
150 |
+
/**
|
151 |
+
* put your comment there...
|
152 |
+
*
|
153 |
+
*/
|
154 |
+
init : function() {
|
155 |
+
// Create new Template.
|
156 |
+
$('#create-new-template').click($.proxy(function() {
|
157 |
+
this.createNewTemplate();
|
158 |
+
}, this)
|
159 |
+
);
|
160 |
+
// Single row actions.
|
161 |
+
$('.row-actions span a').click($.proxy(this._onrowaction, this));
|
162 |
+
// Because we're using 'action' query variable for Controller Request purposes
|
163 |
+
// bulk actions lists should use name='action' name!
|
164 |
+
// Set Id instead of name so value can be retrieved too!
|
165 |
+
$('select[name=action]').removeAttr('name').prop('id', 'action');
|
166 |
+
$('select[name=action2]').removeAttr('name').prop('id', 'action2');
|
167 |
+
// Bulk actions.
|
168 |
+
$('#doaction, #doaction2').click($.proxy(this._onbulkaction, this));
|
169 |
+
// Chech/Uncheck rows.
|
170 |
+
$('input:checkbox.select-all').change($.proxy(this._onselectrows, this));
|
171 |
+
// Filters.
|
172 |
+
$('form#templates-manager select.filter').change($.proxy(this._onfilter, this));
|
173 |
+
}
|
174 |
+
|
175 |
+
} // End form class.
|
176 |
+
|
177 |
+
// Initialize Templates Manager form when document loaded!
|
178 |
+
$($.proxy(CJTTemplatesManagerForm.init, CJTTemplatesManagerForm));
|
179 |
+
})(jQuery);
|
views/templates/manager/public/js/manager/manager.localization.php
ADDED
@@ -0,0 +1,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @version FILE_VERSION
|
4 |
+
* Localization file for jquery.block.js script.
|
5 |
+
*/
|
6 |
+
|
7 |
+
/**
|
8 |
+
* Localization for Javascript cjtJQueryBlockI18N variable.
|
9 |
+
*
|
10 |
+
* Localization text for backups script.
|
11 |
+
*/
|
12 |
+
return array(
|
13 |
+
'createTemplateDialogTitle' => cssJSToolbox::getText('Create New Template'),
|
14 |
+
'editTemplateDialogTitle' => cssJSToolbox::getText('Edit Template'),
|
15 |
+
'confirmDeleteTemplates' => cssJSToolbox::getText('Are you sure you want to delete all the selected templates?')
|
16 |
+
);
|
views/templates/manager/tmpl/default.html.tmpl
ADDED
@@ -0,0 +1,52 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
*
|
4 |
+
*/
|
5 |
+
|
6 |
+
// Disallow direct access.
|
7 |
+
defined('ABSPATH') or die("Access denied");
|
8 |
+
|
9 |
+
// Import list table class used for displaying templates list.
|
10 |
+
$this->importHelper('wp-list-table');
|
11 |
+
|
12 |
+
// Allow view to enqueue scripts and styles.
|
13 |
+
$this->enqueueScripts();
|
14 |
+
$this->enqueueStyles();
|
15 |
+
$this->suppressPrintScriptsHook();
|
16 |
+
?>
|
17 |
+
<!DOCTYPE html>
|
18 |
+
<head>
|
19 |
+
<?php wp_print_head_scripts() ?>
|
20 |
+
<?php wp_print_styles() ?>
|
21 |
+
</head>
|
22 |
+
<body>
|
23 |
+
<div id="wpwrap">
|
24 |
+
<div id="wpcontent">
|
25 |
+
<div id="wpbody">
|
26 |
+
<div id="wpbody-content">
|
27 |
+
<div class="wrap">
|
28 |
+
<form id="templates-manager" class="cjt-form" method="post">
|
29 |
+
<div class="toolbar">
|
30 |
+
<input type="button" id="create-new-template" class="button-secondary action" value="<?php echo cssJSToolbox::getText('Create Template') ?>">
|
31 |
+
</div>
|
32 |
+
<?php
|
33 |
+
$listTable = new CJTTemplatesManagerListTable();
|
34 |
+
// Push items into table list.
|
35 |
+
$listTable->items = $this->items;
|
36 |
+
// Pagintion.
|
37 |
+
$listTable->set_pagination_args(array(
|
38 |
+
'per_page' => $this->getModel()->getItemsPerPage(),
|
39 |
+
'total_items' => $this->getModel()->getItemsTotal()
|
40 |
+
));
|
41 |
+
// Output list table
|
42 |
+
$listTable->display();
|
43 |
+
?>
|
44 |
+
</form>
|
45 |
+
</div>
|
46 |
+
</div>
|
47 |
+
</div>
|
48 |
+
</div>
|
49 |
+
</div>
|
50 |
+
<?php wp_print_footer_scripts() ?>
|
51 |
+
</body>
|
52 |
+
</html>
|
views/templates/manager/view.php
ADDED
@@ -0,0 +1,68 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @version $ Id; ?FILE_NAME ?DATE ?TIME ?AUTHOR $
|
4 |
+
*/
|
5 |
+
|
6 |
+
// Disallow direct access.
|
7 |
+
defined('ABSPATH') or die("Access denied");
|
8 |
+
|
9 |
+
/**
|
10 |
+
*
|
11 |
+
* DESCRIPTION
|
12 |
+
*
|
13 |
+
* @author ??
|
14 |
+
* @version ??
|
15 |
+
*/
|
16 |
+
class CJTTemplatesManagerView extends CJTView {
|
17 |
+
|
18 |
+
/**
|
19 |
+
* put your comment there...
|
20 |
+
*
|
21 |
+
* @var mixed
|
22 |
+
*/
|
23 |
+
protected $items = null;
|
24 |
+
|
25 |
+
/**
|
26 |
+
* put your comment there...
|
27 |
+
*
|
28 |
+
*/
|
29 |
+
public function display($tpl = null) {
|
30 |
+
// Query templates list.
|
31 |
+
$this->items = $this->getModel()->getItems();
|
32 |
+
// Display the view.
|
33 |
+
echo $this->getTemplate($tpl);
|
34 |
+
}
|
35 |
+
|
36 |
+
/**
|
37 |
+
* put your comment there...
|
38 |
+
*
|
39 |
+
*/
|
40 |
+
protected function enqueueScripts() {
|
41 |
+
// Import dependencies scripts!
|
42 |
+
self::useScripts(__CLASS__,
|
43 |
+
'jquery',
|
44 |
+
'jquery-serialize-object',
|
45 |
+
'thickbox',
|
46 |
+
'views:templates:manager:public:js:{CJT_TEMPLATES-}manager'
|
47 |
+
);
|
48 |
+
}
|
49 |
+
|
50 |
+
/**
|
51 |
+
* put your comment there...
|
52 |
+
*
|
53 |
+
*/
|
54 |
+
protected function enqueueStyles() {
|
55 |
+
// Import dependencies styles!
|
56 |
+
self::useStyles(__CLASS__,
|
57 |
+
'wp-admin',
|
58 |
+
'colors-fresh',
|
59 |
+
'thickbox',
|
60 |
+
'framework:css:{CJT-}forms',
|
61 |
+
'views:templates:manager:public:css:{CJT-}default'
|
62 |
+
);
|
63 |
+
}
|
64 |
+
|
65 |
+
} // End class.
|
66 |
+
|
67 |
+
// Hookable!!
|
68 |
+
CJTTemplatesManagerView::define('CJTTemplatesManagerView');
|
views/templates/template/public/css/default.css
ADDED
@@ -0,0 +1,29 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
form {margin: 0;}
|
2 |
+
input[type="button"]{padding: 2px 24px 2px 24px;}
|
3 |
+
#item-form label {vertical-align: top;}
|
4 |
+
#item-form textarea#description,
|
5 |
+
#item-form textarea#license {
|
6 |
+
width: 727px; height: 188px;
|
7 |
+
}
|
8 |
+
#item-form textarea#keywords {width: 727px; height: 34px;}
|
9 |
+
#item-form #code {
|
10 |
+
margin-top: 15px;
|
11 |
+
width: 746px;
|
12 |
+
height: 348px;
|
13 |
+
}
|
14 |
+
#item-form textarea#changeLog {
|
15 |
+
height: 247px;
|
16 |
+
width: 523px;
|
17 |
+
margin-left: 2px;
|
18 |
+
}
|
19 |
+
#item-form #form-tabs .ui-tabs-panel {height: 474px; overflow: auto;}
|
20 |
+
#item-form select{margin-left: -2px;}
|
21 |
+
#item-form input#email,
|
22 |
+
#item-form input#url{
|
23 |
+
width: 384px;
|
24 |
+
}
|
25 |
+
#item-form sub {
|
26 |
+
color: red;
|
27 |
+
position: relative;
|
28 |
+
top: -7px;
|
29 |
+
}
|
views/templates/template/public/js/template/template.js
ADDED
@@ -0,0 +1,186 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
*
|
3 |
+
*/
|
4 |
+
|
5 |
+
/**
|
6 |
+
*
|
7 |
+
*/
|
8 |
+
(function($) {
|
9 |
+
|
10 |
+
/**
|
11 |
+
*
|
12 |
+
*/
|
13 |
+
CJTTemplateForm = {
|
14 |
+
|
15 |
+
/**
|
16 |
+
*
|
17 |
+
*/
|
18 |
+
aceEditor : null,
|
19 |
+
|
20 |
+
/**
|
21 |
+
* put your comment there...
|
22 |
+
*
|
23 |
+
*/
|
24 |
+
errors : null,
|
25 |
+
|
26 |
+
/**
|
27 |
+
* put your comment there...
|
28 |
+
*
|
29 |
+
*/
|
30 |
+
form : null,
|
31 |
+
|
32 |
+
/**
|
33 |
+
* put your comment there...
|
34 |
+
*
|
35 |
+
* @param event
|
36 |
+
*/
|
37 |
+
_ontypechanged : function(event) {
|
38 |
+
// Read vars!
|
39 |
+
var list = event.target;
|
40 |
+
var typeName = list.value;
|
41 |
+
// Type name once set cannot be changed again unless the dialog is cl0sed and re-opened!
|
42 |
+
// It was better to ask user for the type before showing the form like 'creating javascript template,
|
43 |
+
// or creating 'css template' or any specific type! doesn't make sense to allow changing the type more than one time!
|
44 |
+
if (typeName) {
|
45 |
+
// Ask for confirmation only when creating new template only!
|
46 |
+
if (this.form.prop('item[template][id]').value || confirm(CJTTemplateI18N.confirmSetType)) {
|
47 |
+
// Set mode name.
|
48 |
+
var modePath = 'ace/mode/' + typeName;
|
49 |
+
this.aceEditor.getSession().setMode(modePath);
|
50 |
+
// Disable the list.
|
51 |
+
$(list).prop('disabled', 'disabled');
|
52 |
+
// Disable fields doesn't be in the submission!
|
53 |
+
// Add hidden field with the selected value
|
54 |
+
$(list).after('<input type="hidden" name="' + list.name + '" value="' + list.value + '" />');
|
55 |
+
// Don't leave two items with the same names!
|
56 |
+
list.name = '';
|
57 |
+
}
|
58 |
+
else {
|
59 |
+
// Clear selection and allow changing it!
|
60 |
+
typeName = event.target.value = '';
|
61 |
+
}
|
62 |
+
}
|
63 |
+
// Enable editor if there is a type selected or disable it if non types is selected!
|
64 |
+
this.aceEditor.setReadOnly(typeName ? false : true);
|
65 |
+
},
|
66 |
+
|
67 |
+
/**
|
68 |
+
* put your comment there...
|
69 |
+
*
|
70 |
+
*/
|
71 |
+
close : function() {
|
72 |
+
window.parent.tb_remove();
|
73 |
+
},
|
74 |
+
|
75 |
+
/**
|
76 |
+
* put your comment there...
|
77 |
+
*
|
78 |
+
*/
|
79 |
+
init : function() {
|
80 |
+
// Initialize vars.
|
81 |
+
this.form = $('form#item-form');
|
82 |
+
this.errors = new CJTSimpleErrorDialog(this.form)
|
83 |
+
.onSet('item[template]') // Avoid writing set/array/group name multipe times!
|
84 |
+
.add('[name]', /^.+$/, CJTTemplateI18N.invalidName)
|
85 |
+
.add('[type]', /^.+$/, CJTTemplateI18N.languageIsNotSelected)
|
86 |
+
.add('[state]', /^.+$/, CJTTemplateI18N.stateIsNotSelected)
|
87 |
+
.onSet('');
|
88 |
+
// for TABS!!
|
89 |
+
this.form.find('#form-tabs').tabs();
|
90 |
+
// ACE Editor.
|
91 |
+
this.aceEditor = ace.edit('code');
|
92 |
+
this.aceEditor.setTheme('ace/theme/chrome');
|
93 |
+
this.aceEditor.setShowPrintMargin(false);
|
94 |
+
// Update button.
|
95 |
+
$('#save').click($.proxy(this.save, this));
|
96 |
+
// Close button.
|
97 |
+
$('#cancel').click($.proxy(this.close, this));
|
98 |
+
// Change AceEditor Language when type changed!
|
99 |
+
$('select#type').change($.proxy(this._ontypechanged, this))
|
100 |
+
// Set mode when page startup!
|
101 |
+
.trigger('change');
|
102 |
+
},
|
103 |
+
|
104 |
+
/**
|
105 |
+
* put your comment there...
|
106 |
+
*
|
107 |
+
*/
|
108 |
+
save : function() {
|
109 |
+
// initialize!
|
110 |
+
var data = $('#item-form').serializeObject();
|
111 |
+
// Only SAVE if the form is valid!
|
112 |
+
this.isValid(data).done($.proxy(
|
113 |
+
function() {
|
114 |
+
var server = window.top.CJTBlocksPage.server;
|
115 |
+
data['item[revision][code]'] = this.aceEditor.getSession().getValue();
|
116 |
+
server.send('template', 'save', data, 'post')
|
117 |
+
.success($.proxy(
|
118 |
+
function(response) {
|
119 |
+
// Refresh only if not running on the main CJT manager page!
|
120 |
+
if (window.parent.CJTBlocksPage === undefined) {
|
121 |
+
window.parent.location.reload();
|
122 |
+
}
|
123 |
+
this.close();
|
124 |
+
}, this)
|
125 |
+
);
|
126 |
+
}, this)
|
127 |
+
).fail($.proxy(
|
128 |
+
function() {
|
129 |
+
this.errors.show('width=380&height=170');
|
130 |
+
}, this)
|
131 |
+
);
|
132 |
+
},
|
133 |
+
|
134 |
+
/**
|
135 |
+
* put your comment there...
|
136 |
+
*
|
137 |
+
* @param data
|
138 |
+
*/
|
139 |
+
isValid : function(data) {
|
140 |
+
var promising = $.Deferred();
|
141 |
+
// Client side validation
|
142 |
+
if (!this.errors.validate().hasError()) {
|
143 |
+
// If we're editing the template dont check name uniquness!
|
144 |
+
if (data['item[template][id]']) {
|
145 |
+
promising.resolve();
|
146 |
+
return promising;
|
147 |
+
}
|
148 |
+
// Otherwise check nane uniqueness!
|
149 |
+
var server = window.top.CJTBlocksPage.server;
|
150 |
+
// Make sure that the Block name is not taked by antoher Block!
|
151 |
+
var request = {
|
152 |
+
returns : ['id'],
|
153 |
+
filter : {field : 'name', value : this.form.prop('name').value}
|
154 |
+
};
|
155 |
+
// Make sure that the name is not being used!
|
156 |
+
server.send('template', 'getTemplateBy', request)
|
157 |
+
.success($.proxy(
|
158 |
+
function(response) {
|
159 |
+
// FAIL -- Name is being used by antoher Block!!!
|
160 |
+
if (response.id) {
|
161 |
+
var error = {
|
162 |
+
name : this.errors.fetchFieldInfo('item[template][name]').text,
|
163 |
+
message: CJTTemplateI18N.AlreadyInUse
|
164 |
+
};
|
165 |
+
this.errors.errors.push(error);
|
166 |
+
promising.reject();
|
167 |
+
}
|
168 |
+
else {
|
169 |
+
// Successed -- Name is not taken yet!
|
170 |
+
promising.resolve();
|
171 |
+
}
|
172 |
+
}, this)
|
173 |
+
);
|
174 |
+
}
|
175 |
+
else {
|
176 |
+
// Client side validatiom faild!
|
177 |
+
promising.reject();
|
178 |
+
}
|
179 |
+
return promising;
|
180 |
+
}
|
181 |
+
|
182 |
+
} // End class.
|
183 |
+
|
184 |
+
// Initialize form.
|
185 |
+
$($.proxy(CJTTemplateForm.init, CJTTemplateForm));
|
186 |
+
})(jQuery);
|
views/templates/template/public/js/template/template.localization.php
ADDED
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @version FILE_VERSION
|
4 |
+
* Localization file for jquery.block.js script.
|
5 |
+
*/
|
6 |
+
|
7 |
+
/**
|
8 |
+
* Localization for Javascript $VAR$ variable.
|
9 |
+
*
|
10 |
+
* Localization text for backups script.
|
11 |
+
*/
|
12 |
+
return array(
|
13 |
+
'invalidName' => cssJSToolbox::getText(sprintf('The %s name cannot be left blank. Please choose a unique name using characters: A-Z, 0-9, -, _ and space characters only', cssJSToolbox::getText('template'))),
|
14 |
+
'AlreadyInUse' => cssJSToolbox::getText(sprintf('Sorry, but the %s name you entered is already in use. Please choose another name!', cssJSToolbox::getText('template'))),
|
15 |
+
'languageIsNotSelected' => cssJSToolbox::getText(sprintf('Please set the %s to be one of these selections: %s', cssJSToolbox::getText('language type'), cssJSToolbox::getText('CSS, JavaScript, HTML, or PHP', 'language type'))),
|
16 |
+
'stateIsNotSelected' => cssJSToolbox::getText(sprintf('Please set the %s to be one of these selections: %s', cssJSToolbox::getText('template state'), cssJSToolbox::getText('Published, Draft, or Trash'))),
|
17 |
+
'confirmSetType' => cssJSToolbox::getText('You won\'t be able to revert the type name once its set! Are you sure would you like to use the selected type?'),
|
18 |
+
);
|
views/templates/template/tmpl/default.html.tmpl
ADDED
@@ -0,0 +1,99 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
*
|
4 |
+
*/
|
5 |
+
|
6 |
+
// Disallow direct access.
|
7 |
+
defined('ABSPATH') or die("Access denied");
|
8 |
+
|
9 |
+
// Set buttons text.
|
10 |
+
if ($this->isNew) {
|
11 |
+
$closeButtonText = cssJSToolbox::getText('Close');
|
12 |
+
$updateButtonText = cssJSToolbox::getText('Save');
|
13 |
+
}
|
14 |
+
else {
|
15 |
+
$closeButtonText = cssJSToolbox::getText('Cancel');
|
16 |
+
$updateButtonText = cssJSToolbox::getText('Update');
|
17 |
+
}
|
18 |
+
// Import dependencies.
|
19 |
+
cssJSToolbox::import('framework:html:list.php');
|
20 |
+
// If NEW enable core fields, if edit disable core fields!
|
21 |
+
$coreFieldsState = $this->isNew ? '' : 'disabled="disabled"';
|
22 |
+
|
23 |
+
// Allow view to enqueue scripts and styles.
|
24 |
+
$this->enququeScripts();
|
25 |
+
$this->enququeStyles();
|
26 |
+
$this->suppressPrintScriptsHook();
|
27 |
+
?>
|
28 |
+
<html xmlns="http://www.w3.org/1999/xhtml">
|
29 |
+
<head>
|
30 |
+
<?php wp_print_head_scripts() ?>
|
31 |
+
<?php wp_print_styles() ?>
|
32 |
+
</head>
|
33 |
+
<body>
|
34 |
+
<div id="wpwrap">
|
35 |
+
<div id="wpcontent">
|
36 |
+
<div id="wpbody">
|
37 |
+
<div id="wpbody-content">
|
38 |
+
<div class="wrap">
|
39 |
+
<form id="item-form" class="cjt-form" method="post">
|
40 |
+
<div id="form-tabs">
|
41 |
+
<ul>
|
42 |
+
<li><a href="#main-tab"><?php echo cssJSToolbox::getText('Main') ?></a></li>
|
43 |
+
<li><a href="#description-tab"><?php echo cssJSToolbox::getText('Description') ?></a></li>
|
44 |
+
<li><a href="#version-tab"><?php echo cssJSToolbox::getText('Version') ?></a></li>
|
45 |
+
</ul>
|
46 |
+
<div id="main-tab">
|
47 |
+
<fieldset>
|
48 |
+
<ul>
|
49 |
+
<li><label for="name" title="<?php echo cssJSToolbox::getText('Name or title of template (must be unique and cannot be left blank)') ?>"><?php echo cssJSToolbox::getText('Name') ?><sub>*</sub></label><input type="text" maxlength="80" id="name" name="item[template][name]" value="<?php echo $this->item->name ?>" <?php echo $coreFieldsState ?>></li>
|
50 |
+
<li>
|
51 |
+
<label for="type" title="<?php echo cssJSToolbox::getText('Set the code language to: CSS, JavaScript, HTML, or PHP (selection must be made)') ?>"><?php echo cssJSToolbox::getText('Language') ?><sub>*</sub></label>
|
52 |
+
<?php echo CJTListField::getInstance('template-types', 'item-form', 'item[template][type]', $this->item->type, 'type', null, null, null, $coreFieldsState, cssJSToolbox::getText('< Select Type >'))->getInput(array('standard' => true, 'result' => 'fullList')) ?>
|
53 |
+
</li>
|
54 |
+
<li>
|
55 |
+
<label for="state" title="<?php echo cssJSToolbox::getText('Set the template state to: Published, Draft, or Trash (selection must be made)') ?>"><?php echo cssJSToolbox::getText('Template State') ?><sub>*</sub></label>
|
56 |
+
<?php echo CJTListField::getInstance('template-states', 'item-form', 'item[template][state]', $this->item->state, 'state', null, null, null, null, cssJSToolbox::getText('< Select State >'))->getInput(array('standard' => true, 'result' => 'fullList')) ?>
|
57 |
+
</li>
|
58 |
+
<li>
|
59 |
+
<label for="code" title="<?php echo cssJSToolbox::getText('Enter code for the template in the large text field and click Save when done') ?>"><?php echo cssJSToolbox::getText('Code') ?></label>
|
60 |
+
<div class="ace-wrap">
|
61 |
+
<div id="code" name="item[revision][code]"><?php echo htmlentities($this->item->code, null, 'UTF-8') ?></div>
|
62 |
+
</div>
|
63 |
+
</li>
|
64 |
+
</ul>
|
65 |
+
</fieldset>
|
66 |
+
</div>
|
67 |
+
<div id="description-tab">
|
68 |
+
<fieldset>
|
69 |
+
<ul>
|
70 |
+
<li><label for="description" title="<?php echo cssJSToolbox::getText('Enter a descriptive write-up for the template describing what it is, and how it works, etc ') ?>"><?php echo cssJSToolbox::getText('Description') ?></label><textarea id="description" name="item[template][description]"><?php echo $this->item->description ?></textarea></li>
|
71 |
+
<li><label for="keywords" title="<?php echo cssJSToolbox::getText('Enter strong keywords for the template - each being separated by a comma') ?>"><?php echo cssJSToolbox::getText('Keywords') ?></label><textarea id="keywords" cols="60" rows="5" name="item[template][keywords]"><?php echo $this->item->keywords ?></textarea></li>
|
72 |
+
</ul>
|
73 |
+
</fieldset>
|
74 |
+
</div>
|
75 |
+
<div id="version-tab">
|
76 |
+
<fieldset>
|
77 |
+
<ul>
|
78 |
+
<li><label for="version" title="<?php echo cssJSToolbox::getText('Enter the specific version for the template (e.g. 1.0)') ?>"><?php echo cssJSToolbox::getText('Version') ?></label><input type="text" maxlength="15" id="version" name="item[revision][version]" value="<?php echo $this->item->version ?>"></li>
|
79 |
+
<li>
|
80 |
+
<label for="developmentState" title="<?php echo cssJSToolbox::getText('Set the release state to: Release, Beta, Alpha, Release Candidate, or Revision') ?>"><?php echo cssJSToolbox::getText('State') ?></label>
|
81 |
+
<?php echo CJTListField::getInstance('template-development-states', 'item-form', 'item[revision][state]', $this->item->developmentState, 'developmentState', null, null, null, null, cssJSToolbox::getText('< Select State >'))->getInput(array('standard' => true, 'result' => 'fullList')) ?>
|
82 |
+
</li>
|
83 |
+
<li><label for="changeLog" title="<?php echo cssJSToolbox::getText('Add any notes such as stability issues, bug fixes, or anything that can be useful for future development') ?>"><?php echo cssJSToolbox::getText('Revision note') ?></label><textarea id="changeLog" name="item[revision][changeLog]"><?php echo $this->item->changeLog ?></textarea></li>
|
84 |
+
</ul>
|
85 |
+
</fieldset>
|
86 |
+
</div>
|
87 |
+
</div>
|
88 |
+
<input type="button" id="cancel" class="button-secondary" value="<?php echo $closeButtonText ?>">
|
89 |
+
<input type="button" id="save" class="button-secondary" value="<?php echo $updateButtonText ?>">
|
90 |
+
<input type="hidden" name="item[template][id]" value="<?php echo $this->item->id ?>" />
|
91 |
+
</form>
|
92 |
+
</div>
|
93 |
+
</div>
|
94 |
+
</div>
|
95 |
+
</div>
|
96 |
+
</div>
|
97 |
+
<?php wp_print_footer_scripts() ?>
|
98 |
+
</body>
|
99 |
+
</html>
|
views/templates/template/view.php
ADDED
@@ -0,0 +1,104 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
*
|
4 |
+
*/
|
5 |
+
|
6 |
+
// No direct access.
|
7 |
+
defined('ABSPATH') or die('Access denied');
|
8 |
+
|
9 |
+
/**
|
10 |
+
*
|
11 |
+
*/
|
12 |
+
class CJTTemplatesTemplateView extends CJTView {
|
13 |
+
|
14 |
+
/**
|
15 |
+
* put your comment there...
|
16 |
+
*
|
17 |
+
* @var mixed
|
18 |
+
*/
|
19 |
+
protected $isNew;
|
20 |
+
|
21 |
+
/**
|
22 |
+
* put your comment there...
|
23 |
+
*
|
24 |
+
* @var mixed
|
25 |
+
*/
|
26 |
+
public $item;
|
27 |
+
|
28 |
+
/**
|
29 |
+
* put your comment there...
|
30 |
+
*
|
31 |
+
* @var mixed
|
32 |
+
*/
|
33 |
+
protected $onprepareitem = array('parameters' => array('item', 'isNew'));
|
34 |
+
|
35 |
+
/**
|
36 |
+
* put your comment there...
|
37 |
+
*
|
38 |
+
* @param mixed $tpl
|
39 |
+
*/
|
40 |
+
public function display($tpl = null) {
|
41 |
+
// Is it a new template or just editing exists one?
|
42 |
+
$this->isNew = empty($_REQUEST['id']);
|
43 |
+
// If editing exists on read it from database.
|
44 |
+
if (!$this->isNew) {
|
45 |
+
$this->item = $this->getModel()->getItem();
|
46 |
+
}
|
47 |
+
else {
|
48 |
+
// E_ALL complain/Default values for new record if needed!
|
49 |
+
$this->item = (object) array(
|
50 |
+
'name' => '',
|
51 |
+
'type' => '',
|
52 |
+
'state' => '',
|
53 |
+
'code' => '',
|
54 |
+
'description' => '',
|
55 |
+
'keywords' => '',
|
56 |
+
'version' => '',
|
57 |
+
'developmentState' => '',
|
58 |
+
'changeLog' => '',
|
59 |
+
'id' => '',
|
60 |
+
);
|
61 |
+
}
|
62 |
+
$this->item = $this->onprepareitem($this->item, $this->isNew);
|
63 |
+
echo $this->getTemplate($tpl) ;
|
64 |
+
}
|
65 |
+
|
66 |
+
/**
|
67 |
+
* Output Javascript files requirred to Add-New-Block view to run.
|
68 |
+
*
|
69 |
+
* @return void
|
70 |
+
*/
|
71 |
+
public function enququeScripts() {
|
72 |
+
// Use related scripts.
|
73 |
+
self::useScripts(__CLASS__,
|
74 |
+
'jquery',
|
75 |
+
'thickbox',
|
76 |
+
'jquery-serialize-object',
|
77 |
+
'jquery-ui-tabs',
|
78 |
+
'framework:js:misc:{CJT-}simple-error-dialog',
|
79 |
+
'framework:js:ace(loadMethod=Tag, lookFor=ace)',
|
80 |
+
'framework:js:ace:{CJT-}pluggable',
|
81 |
+
'views:templates:template:public:js:{CJT-}template'
|
82 |
+
);
|
83 |
+
}
|
84 |
+
|
85 |
+
/**
|
86 |
+
* Output CSS files required to Add-New-Block view.
|
87 |
+
*
|
88 |
+
* @return void
|
89 |
+
*/
|
90 |
+
public function enququeStyles() {
|
91 |
+
// Use related styles.
|
92 |
+
self::useStyles(__CLASS__,
|
93 |
+
'thickbox',
|
94 |
+
'framework:css:jquery-ui-1.8.21.custom',
|
95 |
+
'framework:css:{CJT-}forms',
|
96 |
+
'framework:css:{CJT-}error-dialog',
|
97 |
+
'views:templates:template:public:css:{CJT-}default'
|
98 |
+
);
|
99 |
+
}
|
100 |
+
|
101 |
+
} // End class.
|
102 |
+
|
103 |
+
// Hookable!!
|
104 |
+
CJTTemplatesTemplateView::define('CJTTemplatesTemplateView', array('hookType' => CJTWordpressEvents::HOOK_FILTER));
|
views/tinymce/params/public/css/style.css
ADDED
@@ -0,0 +1,22 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
body {font-size: 11px;}
|
2 |
+
ul {list-style-type: none; padding: 0; margin: 0;}
|
3 |
+
fieldset {border: 1px solid #EFEFEF !important; position: relative;}
|
4 |
+
.cjt-form ul li {margin-bottom: 9px;}
|
5 |
+
|
6 |
+
.cjt-shortcode-parameters-form-helpText {
|
7 |
+
font-size: 10px;
|
8 |
+
font-family: arial;
|
9 |
+
color: gray;
|
10 |
+
position: absolute;
|
11 |
+
height: 30px;
|
12 |
+
margin: 2px 8px 0px 10px;
|
13 |
+
display: inline-block;
|
14 |
+
}
|
15 |
+
.cjt-shortcode-parameters-form-helpText .helpText {
|
16 |
+
overflow: auto;
|
17 |
+
max-height: 26px;
|
18 |
+
}
|
19 |
+
|
20 |
+
#shortcode-params-form fieldset {margin-left: -10px;}
|
21 |
+
#shortcode-params-form label {width: 200px; color: #505050 !important;}
|
22 |
+
#shortcode-params-form input {margin-left: 0px;}
|
views/tinymce/params/public/js/form/form.js
ADDED
@@ -0,0 +1,86 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
*
|
3 |
+
*/
|
4 |
+
|
5 |
+
/**
|
6 |
+
*
|
7 |
+
*/
|
8 |
+
(function($) {
|
9 |
+
/**
|
10 |
+
*
|
11 |
+
*/
|
12 |
+
var CJTTinymceParamsView = {
|
13 |
+
|
14 |
+
/**
|
15 |
+
* put your comment there...
|
16 |
+
*
|
17 |
+
*/
|
18 |
+
tb_position : parent.tb_position,
|
19 |
+
|
20 |
+
/**
|
21 |
+
*
|
22 |
+
*/
|
23 |
+
_onclose : function() {
|
24 |
+
// Close Thickbox!
|
25 |
+
parent.tb_remove();
|
26 |
+
},
|
27 |
+
|
28 |
+
/**
|
29 |
+
*
|
30 |
+
*/
|
31 |
+
_ondone : function() {
|
32 |
+
parent.CJTServer.send('tinymceBlocks', 'getShortcode', this.form.serializeObject(), 'post')
|
33 |
+
.success($.proxy(
|
34 |
+
function(response) {
|
35 |
+
switch (response.state) {
|
36 |
+
case 'invalid':
|
37 |
+
// Show invalid messages
|
38 |
+
// @TODO Use Simple Error dialog.
|
39 |
+
alert(response.content);
|
40 |
+
break;
|
41 |
+
case 'shortcode-notation':
|
42 |
+
// @TODO :Wrap Shortcode content string with a span element for later references when updating is in need. Generate dynamic ID for the span too.
|
43 |
+
var shortcodeInstance = response.content;
|
44 |
+
// Get CJT editor instance.
|
45 |
+
var editor = parent.CJT.codeEditor;
|
46 |
+
// Place Shortcode string.
|
47 |
+
editor.selection.setContent(shortcodeInstance);
|
48 |
+
editor.focus();
|
49 |
+
// End me!
|
50 |
+
this._onclose();
|
51 |
+
break;
|
52 |
+
}
|
53 |
+
}, this)
|
54 |
+
);
|
55 |
+
},
|
56 |
+
|
57 |
+
/**
|
58 |
+
* put your comment there...
|
59 |
+
*
|
60 |
+
*/
|
61 |
+
_onunload : function() {
|
62 |
+
// Restore tb_position.
|
63 |
+
parent.tb_position = this.tb_position;
|
64 |
+
},
|
65 |
+
|
66 |
+
/**
|
67 |
+
* put your comment there...
|
68 |
+
*
|
69 |
+
*/
|
70 |
+
init : function() {
|
71 |
+
// Initialize.
|
72 |
+
this.form = $('#shortcode-params-form');
|
73 |
+
// Bind events!
|
74 |
+
$('#btn-close').click($.proxy(this._onclose, this));
|
75 |
+
$('#btn-done').click($.proxy(this._ondone, this));
|
76 |
+
// Don't allow form resizing!
|
77 |
+
parent.tb_position = function() {};
|
78 |
+
// Restore tb_position whe unload
|
79 |
+
window.addEventListener('unload', $.proxy(this._onunload, this));
|
80 |
+
}
|
81 |
+
|
82 |
+
} // End view class.
|
83 |
+
|
84 |
+
// Load.
|
85 |
+
$($.proxy(CJTTinymceParamsView.init, CJTTinymceParamsView));
|
86 |
+
})(jQuery);
|
views/tinymce/params/tmpl/default.html.tmpl
ADDED
@@ -0,0 +1,54 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
*
|
4 |
+
*/
|
5 |
+
|
6 |
+
// Disallow direct access.
|
7 |
+
defined('ABSPATH') or die("Access denied");
|
8 |
+
|
9 |
+
// Allow view to enqueue scripts and styles.
|
10 |
+
CJTTinymceParamsView::enqueueScripts();
|
11 |
+
CJTTinymceParamsView::enqueueStyles();
|
12 |
+
$this->suppressPrintScriptsHook();
|
13 |
+
|
14 |
+
// Initialize.
|
15 |
+
$blockId = $this->getParam('blockId');
|
16 |
+
|
17 |
+
// Block Package info.
|
18 |
+
$packageInfo = new CJT_Models_Package_Block($blockId);
|
19 |
+
$packageInfo = $packageInfo->getPackageInfo();
|
20 |
+
?>
|
21 |
+
<html xmlns="http://www.w3.org/1999/xhtml">
|
22 |
+
<head>
|
23 |
+
<?php wp_print_head_scripts() ?>
|
24 |
+
<?php wp_print_styles() ?>
|
25 |
+
</head>
|
26 |
+
<body>
|
27 |
+
<div id="cjtoolbox_popup">
|
28 |
+
<form id="shortcode-params-form" class="cjt-form">
|
29 |
+
<?php echo $this->grouper ?>
|
30 |
+
<input type="button" id="btn-close" value="<?php echo cssJSToolbox::getText('Close') ?>">
|
31 |
+
<input type="button" id="btn-done" value="<?php echo cssJSToolbox::getText('Done') ?>">
|
32 |
+
<input type="hidden" name="blockId" value="<?php echo $blockId ?>">
|
33 |
+
<?php if ($packageInfo) : ?>
|
34 |
+
<span class="packag-info">
|
35 |
+
<?php echo cssJSToolbox::getText('By') ?>: <a target="_blank" href="<?php echo $packageInfo['webSite'] ?>"><?php echo $packageInfo['author'] ?></a>
|
36 |
+
</span>
|
37 |
+
<?php endif; ?>
|
38 |
+
</form>
|
39 |
+
<?php print_footer_scripts() ?>
|
40 |
+
</div>
|
41 |
+
<script type="text/javascript">
|
42 |
+
// Apply TABs Plugin!
|
43 |
+
jQuery(function($) {
|
44 |
+
// Force form size.
|
45 |
+
var size = {'width' : '670px', 'height' : '600px'};
|
46 |
+
parent.jQuery('#TB_window').css(size);
|
47 |
+
size.height -= 10;
|
48 |
+
parent.jQuery('#TB_iframeContent').css(size);
|
49 |
+
// Tab size.
|
50 |
+
$('#cjt-grouper-tab-navigator').tabs().css({height: '527px'});
|
51 |
+
});
|
52 |
+
</script>
|
53 |
+
</body>
|
54 |
+
</html>
|
views/tinymce/params/view.php
ADDED
@@ -0,0 +1,112 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
*
|
4 |
+
*/
|
5 |
+
|
6 |
+
/**
|
7 |
+
*
|
8 |
+
*/
|
9 |
+
class CJTTinymceParamsView extends CJTView {
|
10 |
+
|
11 |
+
/**
|
12 |
+
* put your comment there...
|
13 |
+
*
|
14 |
+
* @var mixed
|
15 |
+
*/
|
16 |
+
protected $grouper = null;
|
17 |
+
|
18 |
+
/**
|
19 |
+
* put your comment there...
|
20 |
+
*
|
21 |
+
* @var mixed
|
22 |
+
*/
|
23 |
+
protected $groups = null;
|
24 |
+
|
25 |
+
/**
|
26 |
+
* put your comment there...
|
27 |
+
*
|
28 |
+
* @var mixed
|
29 |
+
*/
|
30 |
+
protected $packageInfo = null;
|
31 |
+
|
32 |
+
/**
|
33 |
+
* put your comment there...
|
34 |
+
*
|
35 |
+
* @param mixed $viewInfo
|
36 |
+
* @return CJTTinymceParamsView
|
37 |
+
*/
|
38 |
+
public function __construct($viewInfo, $params) {
|
39 |
+
// Parent procedure!
|
40 |
+
parent::__construct($viewInfo, $params);
|
41 |
+
// Prepare groups array.
|
42 |
+
foreach ($params['groups'] as $group) {
|
43 |
+
// Initialize group info array.
|
44 |
+
$group['params'] = array();
|
45 |
+
// Group Key.
|
46 |
+
$group['key'] = strtolower(str_replace(array(' '), '-', $group['name']));
|
47 |
+
// Get group data cxopy.
|
48 |
+
$this->groups[$group['id']] = $group;
|
49 |
+
}
|
50 |
+
// Put the Group woth the loest ID first,
|
51 |
+
// Display in the same order they're added!
|
52 |
+
ksort($this->groups);
|
53 |
+
// Prepare groups from the passed parameters.
|
54 |
+
foreach ($params['params'] as $param) {
|
55 |
+
// Add parameter under its group!
|
56 |
+
$this->groups[$param->getDefinition()->getGroupId()]['params'][] = $param;
|
57 |
+
}
|
58 |
+
// Instantiate grouper.
|
59 |
+
// Only tab grouper is supported for now!
|
60 |
+
$grouperFactory = new CJT_Framework_View_Block_Parameter_Grouper_Factory();
|
61 |
+
$this->grouper = $grouperFactory->create(
|
62 |
+
$params['form']->groupType,
|
63 |
+
$this->groups
|
64 |
+
);
|
65 |
+
}
|
66 |
+
|
67 |
+
/**
|
68 |
+
* Output Javascript files requirred to Add-New-Block view to run.
|
69 |
+
*
|
70 |
+
* @return void
|
71 |
+
*/
|
72 |
+
public function enqueueScripts() {
|
73 |
+
// Scripts required by the form to run.
|
74 |
+
$scripts = array(
|
75 |
+
'jquery',
|
76 |
+
'jquery-serialize-object',
|
77 |
+
'views:tinymce:params:public:js:{CJT_TINYMCE_PARAMS-}form',
|
78 |
+
'framework:js:misc:{CJT-}simple-error-dialog'
|
79 |
+
);
|
80 |
+
// Scripts required by the grouper.
|
81 |
+
$scripts = array_merge($scripts, $this->getGrouper()->enqueueScripts());
|
82 |
+
// Use related scripts.
|
83 |
+
self::useScripts(__CLASS__, $scripts);
|
84 |
+
}
|
85 |
+
|
86 |
+
/**
|
87 |
+
* Output CSS files required to Add-New-Block view.
|
88 |
+
*
|
89 |
+
* @return void
|
90 |
+
*/
|
91 |
+
public function enqueueStyles() {
|
92 |
+
// Styles required by the params form.
|
93 |
+
$styles = array(
|
94 |
+
'framework:css:{CJT-}forms',
|
95 |
+
'framework:css:{CJT-}error-dialog',
|
96 |
+
'views:tinymce:params:public:css:{CJT_TINY_MCE_PARAMS_FORM-}style'
|
97 |
+
);
|
98 |
+
// Groupe styles.
|
99 |
+
$styles = array_merge($styles, $this->getGrouper()->enqueueStyles());
|
100 |
+
// Use related styles.
|
101 |
+
self::useStyles(__CLASS__, $styles);
|
102 |
+
}
|
103 |
+
|
104 |
+
/**
|
105 |
+
* put your comment there...
|
106 |
+
*
|
107 |
+
*/
|
108 |
+
public function getGrouper() {
|
109 |
+
return $this->grouper;
|
110 |
+
}
|
111 |
+
|
112 |
+
} // End class.
|
views/tinymce/shortcodes/public/plugins/shortcode/css/shortcode.css
CHANGED
@@ -1,9 +1,8 @@
|
|
1 |
-
|
2 |
-
|
3 |
-
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
a#content_blocksList:hover {opacity: 1; filter:alpha(opacity = 100%)}
|
1 |
+
.mce-i-cjt-blocks-list-tinymce-button {
|
2 |
+
background-image: url('../images/blocks.png') !important;
|
3 |
+
opacity: 0.6; filter:alpha(opacity = 60%)
|
4 |
+
}
|
5 |
+
.mce-i-cjt-blocks-list-tinymce-button.cjt-loading {
|
6 |
+
background-image: url('../../../../../../../framework/css/images/loading.gif') !important;
|
7 |
+
}
|
8 |
+
.mce-i-cjt-blocks-list-tinymce-button:hover {opacity: 1; filter:alpha(opacity = 100%)}
|
|
views/tinymce/shortcodes/public/plugins/shortcode/shortcode.js
CHANGED
@@ -2,138 +2,102 @@
|
|
2 |
*
|
3 |
*/
|
4 |
|
|
|
|
|
|
|
|
|
5 |
/**
|
6 |
* TinyMCE Plugin for inserting CJT Block Shortcode
|
7 |
* into Wordpress TinyMCE Editor!
|
8 |
*
|
9 |
*/
|
10 |
(function($) {
|
11 |
-
// === Define statics ===
|
12 |
-
|
13 |
-
/**
|
14 |
-
* put your comment there...
|
15 |
-
*
|
16 |
-
*/
|
17 |
-
var editor = null;
|
18 |
-
|
19 |
-
/**
|
20 |
-
* put your comment there...
|
21 |
-
*
|
22 |
-
*/
|
23 |
-
var pluginURL = null;
|
24 |
|
25 |
-
//
|
26 |
-
|
|
|
|
|
|
|
27 |
|
|
|
|
|
|
|
28 |
/**
|
29 |
* put your comment there...
|
30 |
*
|
31 |
*/
|
32 |
-
_onselectblock
|
33 |
// Read selected block!
|
34 |
var block = this;
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
41 |
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
// Add item!
|
85 |
-
menu.add(block);
|
86 |
-
}, this)
|
87 |
-
)
|
88 |
-
}, this)
|
89 |
-
).complete($.proxy(
|
90 |
-
function() {
|
91 |
-
// Stop progress/loading image!
|
92 |
-
tinyMCEButtonImage.prop('src', realImage)
|
93 |
-
.css({width : '', height : '', 'margin-left' : ''});
|
94 |
-
}, this)
|
95 |
-
);
|
96 |
-
}, this)
|
97 |
-
);
|
98 |
-
// Return list!
|
99 |
-
control = bList;
|
100 |
-
break;
|
101 |
}
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
/**
|
106 |
-
* put your comment there...
|
107 |
-
*
|
108 |
-
* @returns {Object}
|
109 |
-
*/
|
110 |
-
getInfo : function() {
|
111 |
-
return {
|
112 |
-
longname : 'CJT Blocks Shortcode',
|
113 |
-
author : 'CJT',
|
114 |
-
authorurl : 'http://css-javascript-toolbox.com',
|
115 |
-
infourl : 'http://css-javascript-toolbox.com/css-javascript-toolbox-v6/',
|
116 |
-
version : '1.0'
|
117 |
-
};
|
118 |
-
},
|
119 |
-
|
120 |
-
/**
|
121 |
-
* Initializing CJT TinyMCE Plugins.
|
122 |
-
*
|
123 |
-
* @param ed
|
124 |
-
* @param url
|
125 |
-
*/
|
126 |
-
init : function(ed, url) {
|
127 |
-
// Initialize!
|
128 |
-
pluginURL = url;
|
129 |
-
editor = ed;
|
130 |
-
// Load CSS!
|
131 |
-
tinymce.DOM.loadCSS(pluginURL + '/css/shortcode.css');
|
132 |
-
}
|
133 |
-
|
134 |
-
}); // End TinyMCE Plugin!
|
135 |
-
|
136 |
-
// Add Plugin
|
137 |
-
tinymce.PluginManager.add('CJTShortcodes', tinymce.plugins.CJTShortcodes);
|
138 |
|
139 |
})(jQuery); // End TinyMCE Plugin namespace!
|
2 |
*
|
3 |
*/
|
4 |
|
5 |
+
if (CJT === undefined) {
|
6 |
+
var CJT = {};
|
7 |
+
}
|
8 |
+
|
9 |
/**
|
10 |
* TinyMCE Plugin for inserting CJT Block Shortcode
|
11 |
* into Wordpress TinyMCE Editor!
|
12 |
*
|
13 |
*/
|
14 |
(function($) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
15 |
|
16 |
+
// Create Plugin.
|
17 |
+
tinyMCE.PluginManager.add('CJTShortcodes', function(editor, url) {
|
18 |
+
|
19 |
+
// Load CSS!
|
20 |
+
tinymce.DOM.loadCSS(url + '/css/shortcode.css');
|
21 |
|
22 |
+
// Cache Editor
|
23 |
+
CJT.codeEditor = editor;
|
24 |
+
|
25 |
/**
|
26 |
* put your comment there...
|
27 |
*
|
28 |
*/
|
29 |
+
var _onselectblock = function() {
|
30 |
// Read selected block!
|
31 |
var block = this;
|
32 |
+
var requestStruct = {blockId : block._id};
|
33 |
+
// Request Shortcode from server!
|
34 |
+
CJTServer.send('tinymceBlocks', 'getShortcode', requestStruct)
|
35 |
+
.success($.proxy(
|
36 |
+
function(response) {
|
37 |
+
switch (response.state) {
|
38 |
+
case 'shortcode-notation':
|
39 |
+
// Insert shortcode at current cursor position.
|
40 |
+
editor.selection.setContent(response.content);
|
41 |
+
editor.focus();
|
42 |
+
break;
|
43 |
+
case 'show-form':
|
44 |
+
// Show in IFRAME window!
|
45 |
+
requestStruct.width = 700;
|
46 |
+
requestStruct.height = 600;
|
47 |
+
requestStruct.TB_iframe = true;
|
48 |
+
// @TODO: Localize Form Title!
|
49 |
+
tb_show(block.formTitle, CJTServer.getRequestURL('tinymceBlocks', 'getBlockParametersForm', requestStruct))
|
50 |
+
break;
|
51 |
+
}
|
52 |
+
}, this)
|
53 |
+
);
|
54 |
+
};
|
55 |
|
56 |
+
// Create Shortcodes list button
|
57 |
+
editor.addButton('CJTBlockShortcode', {
|
58 |
+
type : 'menubutton',
|
59 |
+
title : CJTBlockShortcode.title,
|
60 |
+
icon : 'cjt-blocks-list-tinymce-button',
|
61 |
+
menu : {style : 'overflow:true;max-height:356px'},
|
62 |
+
onCreateMenu : function() {
|
63 |
+
// Get Menu Object created by tinyMCE behind the sense.
|
64 |
+
var menu = editor.controlManager.buttons.CJTBlockShortcode.menu;
|
65 |
+
// Start progress/loading image!
|
66 |
+
var tinyMCEButton = $('.mce-i-cjt-blocks-list-tinymce-button')
|
67 |
+
.addClass('cjt-loading');
|
68 |
+
// Read blocks from server!
|
69 |
+
CJTServer.send('tinymceBlocks', 'getBlocksList')
|
70 |
+
.success($.proxy(
|
71 |
+
function(blocks) {
|
72 |
+
// If not blocks do nothing!
|
73 |
+
if (!blocks.count) {
|
74 |
+
blocks.list = [];
|
75 |
+
}
|
76 |
+
// Add blocks as menu item!
|
77 |
+
$.each(blocks.list, $.proxy(
|
78 |
+
function(id, block) {
|
79 |
+
// Bind to select event!
|
80 |
+
block.onclick = _onselectblock;
|
81 |
+
// Get a copy of block original name.
|
82 |
+
block.name = block.title;
|
83 |
+
// Prepend ID to block title!
|
84 |
+
block.text = '#' + id + ': ' + block.title;
|
85 |
+
// Add item!
|
86 |
+
menu.add(block);
|
87 |
+
}, this)
|
88 |
+
)
|
89 |
+
}, this)
|
90 |
+
).complete($.proxy(
|
91 |
+
function() {
|
92 |
+
// Refresh / Render new added items.
|
93 |
+
menu.renderNew();
|
94 |
+
// Stop progress/loading image!
|
95 |
+
tinyMCEButton.removeClass('cjt-loading');
|
96 |
+
}, this)
|
97 |
+
);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
98 |
}
|
99 |
+
});
|
100 |
+
|
101 |
+
}); // End TinyMCE Plugin!
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
102 |
|
103 |
})(jQuery); // End TinyMCE Plugin namespace!
|
views/tinymce/shortcodes/view.php
CHANGED
@@ -26,6 +26,7 @@ class CJTTinymceShortcodesView extends CJTView {
|
|
26 |
add_filter('mce_buttons', array($this, 'addButton'));
|
27 |
// Enqueue dependencies scripts.
|
28 |
self::enqueueScripts();
|
|
|
29 |
}
|
30 |
|
31 |
/**
|
@@ -45,8 +46,6 @@ class CJTTinymceShortcodesView extends CJTView {
|
|
45 |
* @param mixed $tpl
|
46 |
*/
|
47 |
public function display($tpl = null) {
|
48 |
-
// Push vars into view!
|
49 |
-
|
50 |
// Output view!
|
51 |
echo $this->getTemplate($tpl);
|
52 |
}
|
@@ -59,9 +58,20 @@ class CJTTinymceShortcodesView extends CJTView {
|
|
59 |
// Please thos scripts below should be already loaded
|
60 |
// by the metabox views If the tinymce is loaded inside the editbox
|
61 |
// IN OTHER CASES!!! what is the other cases! we load it!
|
62 |
-
self::useScripts(__CLASS__,
|
|
|
|
|
|
|
63 |
}
|
64 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
65 |
/**
|
66 |
* put your comment there...
|
67 |
*
|
26 |
add_filter('mce_buttons', array($this, 'addButton'));
|
27 |
// Enqueue dependencies scripts.
|
28 |
self::enqueueScripts();
|
29 |
+
self::enqueueStyles();
|
30 |
}
|
31 |
|
32 |
/**
|
46 |
* @param mixed $tpl
|
47 |
*/
|
48 |
public function display($tpl = null) {
|
|
|
|
|
49 |
// Output view!
|
50 |
echo $this->getTemplate($tpl);
|
51 |
}
|
58 |
// Please thos scripts below should be already loaded
|
59 |
// by the metabox views If the tinymce is loaded inside the editbox
|
60 |
// IN OTHER CASES!!! what is the other cases! we load it!
|
61 |
+
self::useScripts(__CLASS__,
|
62 |
+
'thickbox',
|
63 |
+
'framework:js:ajax:{CJT-}cjt-server'
|
64 |
+
);
|
65 |
}
|
66 |
|
67 |
+
/**
|
68 |
+
* put your comment there...
|
69 |
+
*
|
70 |
+
*/
|
71 |
+
public function enqueueStyles() {
|
72 |
+
self::useStyles(__CLASS__, 'thickbox');
|
73 |
+
}
|
74 |
+
|
75 |
/**
|
76 |
* put your comment there...
|
77 |
*
|
views/uploader/single/public/css/uploader.css
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
1 |
+
body {overflow: hidden;}
|
2 |
+
body, form {margin: 0; padding: 0;}
|
3 |
+
input[type=file] {background-color: gray; width: 236px;}
|
views/uploader/single/public/js/uploader/uploader.js
ADDED
@@ -0,0 +1,52 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
*
|
3 |
+
*/
|
4 |
+
|
5 |
+
/**
|
6 |
+
*
|
7 |
+
*/
|
8 |
+
(function($) {
|
9 |
+
|
10 |
+
/**
|
11 |
+
*
|
12 |
+
*/
|
13 |
+
window.CJTUploader = {
|
14 |
+
|
15 |
+
/**
|
16 |
+
* put your comment there...
|
17 |
+
*
|
18 |
+
*/
|
19 |
+
form : null,
|
20 |
+
|
21 |
+
/**
|
22 |
+
* put your comment there...
|
23 |
+
*
|
24 |
+
*/
|
25 |
+
init : function() {
|
26 |
+
// Initialize vars.
|
27 |
+
this.form = document.forms[0];
|
28 |
+
},
|
29 |
+
|
30 |
+
/**
|
31 |
+
* put your comment there...
|
32 |
+
*
|
33 |
+
* @param Promise Object Name
|
34 |
+
* @param callback
|
35 |
+
*/
|
36 |
+
upload : function(pon, callback) {
|
37 |
+
// Don't submit unless a file is selected.
|
38 |
+
if (this.form.fileToUpload.value != '') {
|
39 |
+
// Hold pon object along with the request.
|
40 |
+
this.form.pon.value = pon;
|
41 |
+
// Notify requesting server.
|
42 |
+
callback(true);
|
43 |
+
// Submit the form.
|
44 |
+
this.form.submit();
|
45 |
+
}
|
46 |
+
}
|
47 |
+
|
48 |
+
} // End class.
|
49 |
+
|
50 |
+
// Initialize form.
|
51 |
+
$($.proxy(window.CJTUploader.init, window.CJTUploader));
|
52 |
+
})(jQuery);
|
views/uploader/single/tmpl/default.html.tmpl
ADDED
@@ -0,0 +1,49 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
*
|
4 |
+
*/
|
5 |
+
|
6 |
+
// Disallow direct access.
|
7 |
+
defined('ABSPATH') or die("Access denied");
|
8 |
+
|
9 |
+
// Allow view to enqueue scripts and styles.
|
10 |
+
$this->enququeScripts();
|
11 |
+
$this->enququeStyles();
|
12 |
+
$this->suppressPrintScriptsHook();
|
13 |
+
?>
|
14 |
+
<html xmlns="http://www.w3.org/1999/xhtml">
|
15 |
+
<head>
|
16 |
+
<?php wp_print_head_scripts() ?>
|
17 |
+
<?php wp_print_styles() ?>
|
18 |
+
</head>
|
19 |
+
<body>
|
20 |
+
<div id="wpwrap">
|
21 |
+
<div id="wpcontent">
|
22 |
+
<div id="wpbody">
|
23 |
+
<div id="wpbody-content">
|
24 |
+
<div class="wrap">
|
25 |
+
<form method="post" enctype="multipart/form-data">
|
26 |
+
<input type="hidden" name="pon" value="" />
|
27 |
+
<input type="file" id="fileToUpload" name="fileToUpload" />
|
28 |
+
<?php if ($this->pon) : ?>
|
29 |
+
<script type="text/javascript">
|
30 |
+
// Initialize.
|
31 |
+
var cbo = parent.window['<?php echo $this->pon ?>']; // callback object.
|
32 |
+
// Complete callback.
|
33 |
+
cbo._oncomplete();
|
34 |
+
// Based on the state callback or fallback!
|
35 |
+
var state = <?php echo $this->state ? json_encode($this->state) : 'null' ?>;
|
36 |
+
var callbackName = '_on' + (!state ? 'success' : 'fail');
|
37 |
+
// Callback/Fallback.
|
38 |
+
cbo[callbackName](state);
|
39 |
+
</script>
|
40 |
+
<?php endif; ?>
|
41 |
+
</form>
|
42 |
+
</div>
|
43 |
+
</div>
|
44 |
+
</div>
|
45 |
+
</div>
|
46 |
+
</div>
|
47 |
+
<?php wp_print_footer_scripts() ?>
|
48 |
+
</body>
|
49 |
+
</html>
|
views/uploader/single/view.php
ADDED
@@ -0,0 +1,63 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
*
|
4 |
+
*/
|
5 |
+
|
6 |
+
// No direct access.
|
7 |
+
defined('ABSPATH') or die('Access denied');
|
8 |
+
|
9 |
+
/**
|
10 |
+
*
|
11 |
+
*/
|
12 |
+
class CJTUploaderSingleView extends CJTView {
|
13 |
+
|
14 |
+
/**
|
15 |
+
* put your comment there...
|
16 |
+
*
|
17 |
+
* @var mixed
|
18 |
+
*/
|
19 |
+
protected $pon;
|
20 |
+
|
21 |
+
/**
|
22 |
+
* put your comment there...
|
23 |
+
*
|
24 |
+
* @var mixed
|
25 |
+
*/
|
26 |
+
protected $state;
|
27 |
+
/**
|
28 |
+
* put your comment there...
|
29 |
+
*
|
30 |
+
* @param mixed $tpl
|
31 |
+
*/
|
32 |
+
public function display($tpl = null) {
|
33 |
+
// Push vars.
|
34 |
+
$this->pon = $this->getRequestParameter('pon');
|
35 |
+
$this->state = $this->model->getState('error');
|
36 |
+
// Output.
|
37 |
+
echo $this->getTemplate($tpl);
|
38 |
+
}
|
39 |
+
|
40 |
+
/**
|
41 |
+
* Output Javascript files requirred to Add-New-Block view to run.
|
42 |
+
*
|
43 |
+
* @return void
|
44 |
+
*/
|
45 |
+
public function enququeScripts() {
|
46 |
+
// Use related scripts.
|
47 |
+
self::useScripts(__CLASS__, 'jquery', 'views:uploader:single:public:js:{CJT-}uploader');
|
48 |
+
}
|
49 |
+
|
50 |
+
/**
|
51 |
+
* Output CSS files required to Add-New-Block view.
|
52 |
+
*
|
53 |
+
* @return void
|
54 |
+
*/
|
55 |
+
public function enququeStyles() {
|
56 |
+
// Use related styles.
|
57 |
+
self::useStyles(__CLASS__, 'views:uploader:single:public:css:{CJT-}uploader');
|
58 |
+
}
|
59 |
+
|
60 |
+
} // End class.
|
61 |
+
|
62 |
+
// Hookable!!
|
63 |
+
CJTUploaderSingleView::define('CJTUploaderSingleView', array('hookType' => CJTWordpressEvents::HOOK_FILTER));
|