diff --git a/config/assets.php b/config/assets.php new file mode 100644 index 0000000..b4a9773 --- /dev/null +++ b/config/assets.php @@ -0,0 +1,58 @@ + [ + 'ht7-widgets/body-overlay' => [ + ['css', 'ht7-widgets/body-overlay'], + ['javascript', 'ht7-widgets/body-overlay'] + ], + 'ht7-tools/settings' => [ + ['css', 'ht7-tools/settings'], + ['javascript', 'ht7-tools/settings'] + ] + ], + 'single' => [ + [ + 'css', + 'ht7-tools/settings', + 'css/ht7.tools.settings.css', + ['version' => '0.0.1', 'minify' => true, 'combine' => true] + ], + [ + 'css', + 'ht7-widgets/status-toggle', + 'css/ht7.widgets.statustoggle.css', + ['version' => '0.0.1', 'minify' => true, 'combine' => true] + ], + [ + 'css', + 'ht7-widgets/body-overlay', + 'css/ht7.widgets.bodyoverlay.css', + ['version' => '0.0.1', 'minify' => true, 'combine' => true], + ], + [ + 'javascript', + 'ht7-extenders', + 'js/ht7.extenders.js', + ['version' => '0.0.1', 'minify' => true, 'combine' => true], + ], + [ + 'javascript', + 'ht7-tools/settings', + 'js/ht7.tools.settings.js', + ['version' => '0.0.1', 'minify' => true, 'combine' => true] + ], + [ + 'javascript', + 'ht7-widgets/body-overlay', + 'js/ht7.widgets.bodyoverlay.js', + ['version' => '0.0.1', 'minify' => true, 'combine' => true] + ], + [ + 'javascript', + 'ht7-widgets/concrete5', + 'js/ht7.widgets.c5.js', + ['version' => '0.0.1', 'minify' => true, 'combine' => true], + ] + ] +]; diff --git a/config/forms.php b/config/forms.php new file mode 100644 index 0000000..8717eb8 --- /dev/null +++ b/config/forms.php @@ -0,0 +1,84 @@ + [ +// 'fieldsets' => [ +// 'styles' => tc('ht7_c5_base', 'Styles'), +// 'rows' => tc('ht7_c5_base', 'Row Appearance'), +// ], +// 'libraryFilePathBase' => [ +// 'label' => tc('ht7_c5_library', 'File path base'), +// 'title' => tc('ht7_c5_library', 'Base file path of the library books which will be prepend to the file specific path.'), +// 'type' => 'text', +// ], + 'saveByAjax' => [ + 'label' => tc('ht7_c5_library', 'Save these settings by AJAX request'), + 'nsValue' => 'settings.general', + 'tabId' => 'pane-general', + 'title' => tc('ht7_c5_library', 'If active the saving of these settings will be done by AJAX. This will probably not show the latest changes.'), + 'type' => 'boolean', + ], + 'showBsTooltips' => [ + 'label' => tc('ht7_c5_library', 'Show bootstrap tooltips'), + 'nsValue' => 'settings.general', + 'tabId' => 'pane-general', + 'title' => tc('ht7_c5_library', 'If active the tooltips will be displayed with the l&f of the bootstrap framework.'), + 'type' => 'boolean', + ], + 'tableStyleBordered' => [ +// 'fieldset' => 'rows', + 'label' => tc('ht7_c5_library', 'Settings with bordered l&f'), + 'nsValue' => 'settings.styles', + 'tabId' => 'pane-styles', + 'title' => tc('ht7_c5_library', 'Display the settings with bordered look & feel.'), + 'type' => 'boolean', + ], + 'tableStyleStripped' => [ +// 'fieldset' => 'rows', + 'label' => tc('ht7_c5_library', 'Settings with stripped l&f'), + 'nsValue' => 'settings.styles', + 'tabId' => 'pane-styles', + 'title' => tc('ht7_c5_library', 'Display the settings with stripped look & feel.'), + 'type' => 'boolean', + ], + 'tableRowHeightMin' => [ + 'attributes' => [ + 'max' => 50, + 'min' => 20, + 'step' => 1, + ], +// 'fieldset' => 'styles', + 'label' => tc('ht7_c5_library', 'Min Height of these rows'), + 'nsValue' => 'settings.styles', + 'tabId' => 'pane-styles', + 'title' => tc('ht7_c5_library', 'This is the min height in pixels of these settings rows.'), + 'type' => 'number', + ], + 'tablePaddingTop' => [ + 'attributes' => [ + 'max' => 10, + 'min' => 0, + 'step' => 1, + ], +// 'fieldset' => 'styles', + 'label' => tc('ht7_c5_library', 'Padding top of these rows'), + 'nsValue' => 'settings.styles', + 'tabId' => 'pane-styles', + 'title' => tc('ht7_c5_library', 'This is the padding top in pixels of these settings rows.'), + 'type' => 'number', + ], + 'tablePaddingBottom' => [ + 'attributes' => [ + 'max' => 10, + 'min' => 0, + 'step' => 1, + ], +// 'fieldset' => 'styles', + 'label' => tc('ht7_c5_library', 'Padding bottom of these rows'), + 'nsValue' => 'settings.styles', + 'tabId' => 'pane-styles', + 'title' => tc('ht7_c5_library', 'This is the padding bottom in pixels of these settings rows.'), + 'type' => 'number', + ], + ], +]; diff --git a/config/header_items.php b/config/header_items.php new file mode 100644 index 0000000..6b21759 --- /dev/null +++ b/config/header_items.php @@ -0,0 +1,14 @@ + [ + [ + 'selector' => '.ht7-tools-settings .ht7-settings-list > li', + 'items' => [ + 'min-height' => ['settings.styles.tableRowHeightMin', 'px'], + 'padding-bottom' => ['settings.styles.tablePaddingBottom', 'px'], + 'padding-top' => ['settings.styles.tablePaddingTop', 'px'] + ] + ] + ] +]; diff --git a/config/ht7_settings.php b/config/ht7_settings.php new file mode 100644 index 0000000..7e1b7da --- /dev/null +++ b/config/ht7_settings.php @@ -0,0 +1,16 @@ + [ + 'saveByAjax' => true, + 'showBsTooltips' => true, + 'libraryFilePathBase' => '', + ], + 'styles' => [ + 'tableStyleBordered' => true, + 'tableStyleStripped' => true, + 'tablePaddingBottom' => 5, + 'tablePaddingTop' => 5, + 'tableRowHeightMin' => 30, + ], +]; diff --git a/config/ht7_tabs.php b/config/ht7_tabs.php new file mode 100644 index 0000000..b07ebf0 --- /dev/null +++ b/config/ht7_tabs.php @@ -0,0 +1,36 @@ + [ + 'items' => [ + [ + 'content' => [ + 'model_type' => 'settings-simple', + 'src' => 'settings.general', + ], + 'id' => 'pane-general', + 'name' => tc('ht7_c5_library', 'General'), + ], + [ + 'content' => [ + 'model_type' => 'settings-simple', + 'src' => 'settings.styles', + ], + 'id' => 'pane-styles', + 'name' => tc('ht7_c5_library', 'Look&Feel'), + 'selected' => true, + ], + ], + 'markup' => [ + 'content' => [ + 'container' => [ + 'attributes' => [ + 'class' => 'ccm-tab-content', + 'id' => 'ccm-tab-content' + ], + 'tag' => 'article', + ] + ] + ] + ], +]; diff --git a/config/settings.php b/config/settings.php new file mode 100644 index 0000000..f7149a0 --- /dev/null +++ b/config/settings.php @@ -0,0 +1,19 @@ + [ +// 'messageTypeError' => 'alert', +// 'messageTypeInfo' => 'notify', +// 'messageTypeSuccess' => 'notify', +// 'messageTypeWarning' => 'notify', + 'saveByAjax' => false, + 'showBsTooltips' => true, + ], + 'styles' => [ + 'tableStyleBordered' => true, + 'tableStyleStripped' => true, + 'tablePaddingBottom' => 5, + 'tablePaddingTop' => 5, + 'tableRowHeightMin' => 50, + ], +]; diff --git a/config/tabs.php b/config/tabs.php new file mode 100644 index 0000000..ec9a7d1 --- /dev/null +++ b/config/tabs.php @@ -0,0 +1,30 @@ + [ + 'items' => [ + [ + 'content' => 'settings.general', + 'id' => 'pane-general', + 'name' => tc('ht7_c5_library', 'General'), + ], + [ + 'content' => 'settings.styles', + 'id' => 'pane-styles', + 'name' => tc('ht7_c5_library', 'Look&Feel'), + 'selected' => true, + ], + ], + 'markup' => [ + 'content' => [ + 'container' => [ + 'attributes' => [ + 'class' => 'ccm-tab-content', + 'id' => 'ccm-tab-content' + ], + 'tag' => 'article', + ] + ] + ] + ], +]; diff --git a/controller.php b/controller.php index 6fec4f4..d3aa880 100644 --- a/controller.php +++ b/controller.php @@ -9,6 +9,7 @@ use \Concrete\Core\Package\PackageService; use \Concrete\Core\User\Group\Group; use \Concrete\Package\Ht7C5Base\ServiceProvider; +use \Concrete\Package\Ht7C5Base\Ht7Tools\Tabs\ServiceProvider as TabsToolServiceProvider; defined('C5_EXECUTE') or die('Access Denied.'); @@ -52,11 +53,13 @@ public function install() { // Install the current package and create the defined db entities. $this->pkg = parent::install(); - // Create all pages through the content XML. - $this->installContentFile('install.xml'); + + $this->setupAutoloader(); // Make sure the package helper can be accessed by later installation // process' of this package. $this->registerServices(); + // Create all pages through the content XML. + $this->installContentFile('install.xml'); // If the path uses "-" to separate words and the filename // uses "_", the cFilename on the Pages table is empty. // Therefor we need to update this field. @@ -138,6 +141,7 @@ private function registerServices() { $list = new ProviderList($this->app); $list->registerProvider(ServiceProvider::class); + $list->registerProvider(TabsToolServiceProvider::class); } private function setupAutoloader() diff --git a/controllers/single_page/dashboard/ht7/blocks.php b/controllers/single_page/dashboard/ht7/blocks.php index 1f9d788..3da6890 100644 --- a/controllers/single_page/dashboard/ht7/blocks.php +++ b/controllers/single_page/dashboard/ht7/blocks.php @@ -2,7 +2,7 @@ namespace Concrete\Package\Ht7C5Base\Controller\SinglePage\Dashboard\Ht7; -use \Concrete\Package\Ht7C5Base\Controller\SinglePage\AbstractRedirectToFirstChild; +use \Concrete\Package\Ht7C5Base\Ht7Tools\Controllers\AbstractRedirectToFirstChild; defined('C5_EXECUTE') or die('Access Denied.'); diff --git a/controllers/single_page/dashboard/ht7/tools.php b/controllers/single_page/dashboard/ht7/tools.php new file mode 100644 index 0000000..e953e94 --- /dev/null +++ b/controllers/single_page/dashboard/ht7/tools.php @@ -0,0 +1,12 @@ +app->make('helper/ht7/package/base'); + $pkgFileConfig = $pkgH->getPackageFileConfig($this); + $pkgHandle = $pkgH->getPackageHandle($this); + + $this->definitions = new PageDefinitions( + [ + 'definitions' => ['forms.settings', $pkgFileConfig], + 'elements' => [ + 'label' => ['tools/settings/label', $pkgHandle], + 'setting' => ['tools/settings/attributes', $pkgHandle] + ], + 'tabs' => ['ht7_tabs.settings', $pkgFileConfig], + 'urls' => [ + 'form_abort' => $this->action(), + 'form_save' => $this->action('save'), + ], + 'values' => ['settings', $pkgFileConfig], + ], + PageDefinitionTypes::SIMPLE + ); + } + +} diff --git a/css/ht7.tools.settings.css b/css/ht7.tools.settings.css new file mode 100644 index 0000000..f8413fe --- /dev/null +++ b/css/ht7.tools.settings.css @@ -0,0 +1,28 @@ +#ccm-dashboard-page .ht7-dashboard.ht7-tools-settings.bordered-settings ul.ht7-settings-list li { + border-bottom: 1px solid #ddd; +} +#ccm-dashboard-page .ht7-dashboard.ht7-tools-settings.stripped-settings ul.ht7-settings-list li:nth-child(even) { + position: relative; +} +#ccm-dashboard-page .ht7-dashboard.ht7-tools-settings.stripped-settings ul.ht7-settings-list li:nth-child(even) .styler { + background-color: #efefef; + bottom: 0; + left: 0; + opacity: 0.5; + position: absolute; + right: 0; + top: 0; +} +#ccm-dashboard-page .ht7-dashboard.ht7-tools-settings ul.ht7-settings-list { + list-style: none; + margin: 0; + padding: 0; +} +#ccm-dashboard-page .ht7-dashboard.ht7-tools-settings ul.ht7-settings-list li { + /* .styler { + + }*/ +} +#ccm-dashboard-page .ht7-dashboard.ht7-tools-settings ul.ht7-settings-list li .control-label { + margin-bottom: 0; +} diff --git a/elements/tools/settings/action_buttons.php b/elements/tools/settings/action_buttons.php new file mode 100644 index 0000000..ec28450 --- /dev/null +++ b/elements/tools/settings/action_buttons.php @@ -0,0 +1,21 @@ + +