melisplatform / melis-cms
Melis Platform CMS module
Installs: 4 993
Dependents: 15
Suggesters: 0
Security: 1
Stars: 10
Watchers: 9
Forks: 3
Open Issues: 0
Type:melisplatform-module
Requires
- php: ^8.1|^8.3
- melisplatform/melis-core: ^5.2
- melisplatform/melis-engine: ^5.2
- melisplatform/melis-front: ^5.2
- dev-master
- v5.3.3
- v5.3.2
- v5.3.1
- v5.3.0
- v5.2.2
- v5.2.1
- v5.2.0
- v5.1.1
- v5.1.0
- v5.0.1
- v5.0.0
- v4.1.2
- v4.1.1
- v4.1.0
- v4.0.11
- v4.0.10
- v4.0.9
- v4.0.8
- v4.0.7
- v4.0.6
- v4.0.5
- v4.0.4
- v4.0.3
- v4.0.2
- v4.0.1
- v4.0.0
- v3.2.14
- v3.2.13
- v3.2.12
- v3.2.11
- v3.2.10
- v3.2.9
- v3.2.8
- v3.2.7
- v3.2.6
- v3.2.5
- v3.2.4
- v3.2.3
- v3.2.2
- v3.2.1
- v3.2.0
- v3.1.13
- v3.1.12
- v3.1.11
- v3.1.10
- v3.1.9
- v3.1.8
- v3.1.7
- v3.1.6
- v3.1.5
- v3.1.4
- v3.1.3
- v3.1.2
- v3.1.1
- v3.1.0
- v3.0.10
- v3.0.9
- v3.0.8
- v3.0.7
- v3.0.6
- v3.0.5
- v3.0.4
- v3.0.3
- v3.0.2
- v3.0.1
- v3.0.0
- v2.5.0
- v2.4.0
- v2.3.1
- v2.3.0
- v2.2.1
- v2.2.0
- v2.1.1
- v2.1
- dev-fix/7395
- dev-update/jquery3.7.1
- dev-develop
- dev-update/minitemplate-upload-dir
- dev-evo/cms-docu-5.3
- dev-evo/cms-docu
- dev-evo/platform-perf
- dev-update/tinymce6.7.0
- dev-update/php83
- dev-common/fixes
- dev-fix/vulnerability
- dev-update/php-8-upgrade
- dev-zend-old-version
- dev-update/duplicate-page-trigger-event
- dev-update/plugin-modal-form-switch-btn
- dev-update/public-module-case
- dev-feature/grouping-tabs-v2
- dev-update/404-multilingual-site
- dev-fix/page-edition-properties
- dev-feature/delete-plugin-confirm
- dev-fix/dnd-plugin-smashed
- dev-feature/page-treeview-checkboxes
- dev-fix/mini-template-plugins-thumbnails
- dev-fix/perf
- dev-fix/page-edition
- dev-feature/tinymce-custom
- dev-fix/mini-template-plugins
- dev-feature/melis-cms-page-loading-layer
- dev-laminas/mini-template-manager
- dev-fix/edition-languages
- dev-php7.4
- dev-update/fancytree-v2.37.0
- dev-migrate/laminas
- dev-feature/page-treeview-default-lock
- dev-update/mini-template-manager
- dev-feature/dragndrop_resize_margins
- dev-cache-sys
This package is auto-updated.
Last update: 2024-10-31 05:27:00 UTC
README
MelisCms provides a full CMS for Melis Platform, including templating system, drag'n'drop of plugins, SEO and many administration tools.
Getting Started
These instructions will get you a copy of the project up and running on your machine.
This Melis Platform module is made to work with the MelisCore.
Prerequisites
You will need to install melisplatform/melis-core and melisplatform/melis-engine in order to have this module running.
This will automatically be done when using composer.
Installing
Run the composer command:
composer require melisplatform/melis-cms
Tools & Elements provided
- Page Edition System (Edition, Properties, SEO, Languages)
- Site Tool
- Template Tool
- Platform Ids Tool
- Site Redirect Tool
- Styles Tool
- Page's Languages Tool
- Dashboard Indicators
- Site Tree View
- Site Tree Explorer & Search
- Melis Templating Plugins Components for back-office
Running the code
MelisCms Services
MelisCms provides many services to be used in other modules:
- MelisCmsPageService
Services to save a page and to save its different parts (SEO, styles, languages, etc).
File: /melis-cms/src/Service/MelisCmsPageService.php
// Get the service
$pageSrv = $this->getServiceManager()->get('MelisCmsPageService');
// Save a page and get its id back
$pageId = $pageSrv->savePage($pageTree, $pagePublished, $pageSaved, $pageSeo, $pageLang, $pageStyle);
- MelisCmsSiteService
Save a site, get the list of pages of a site and many more.
File: /melis-cms/src/Service/MelisCmsSiteService.php
// Get the service
$cmsSiteSrv = $this->getServiceManager()->get('MelisCmsSiteService');
// Get list of pages of this site
$sitePages = $cmsSiteSrv->getSitePages($siteId);
- MelisCmsPageGetterService
Get the full HTML of a page. This service works with the cache system. A page must have been generated at least one, so that the cache is generated and available to be used by the service.
Cache is generated in this folder: /cache
File: /melis-cms/src/Service/MelisCmsPageGetterService.php
// Get the service
$pageGetterService = $this->getServiceManager()->get('MelisCmsPageGetterService');
// Get list of pages of this site
$pageContent = $cmsSiteSrv->getPageContent($pageId);
- MelisCmsRightsService
Get the rights defined for the user and adapt access to the different elements of the interface:
File: /melis-cms/src/Service/MelisCmsRightsService.php
// Get the service
$melisCmsRights = $this->getServiceManager()->get('MelisCmsRights');
// Get the user's rights
$xmlRights = $melisCoreAuth->getAuthRights();
// find if a user has access to it
// Example: find if a user has access to a specific page id
$isAccessible = $melisCmsRights->isAccessible($xmlRights, MelisCmsRightsService::MELISCMS_PREFIX_PAGES, $idPage);
MelisCms Forms
Forms factories
All Melis CMS forms are built using Form Factories.
All form configuration are available in the file: /melis-cms/config/app.forms.php
Any module can override or add items in this form by building the keys in an array and marge it in the Module.php config creation part.
return array(
'plugins' => array(
// MelisCms array
'meliscms' => array(
// Form key
'forms' => array(
// MelisCms Page Properties form
'meliscms_page_properties' => array(
'attributes' => array(
'name' => 'pageproperties',
'id' => 'idformpageproperties',
'method' => 'POST',
'action' => '/melis/MelisCms/Page/saveProperties',
),
'hydrator' => 'Laminas\Hydrator\ArraySerializable',
'elements' => array(
array(
'spec' => array(
...
),
),
),
'input_filter' => array(
'page_id' => array(
...
),
),
),
),
),
),
),
Forms elements
MelisCms provides many form elements to be used in forms:
- MelisCmsTemplateSelect: a dropdown to select a template
- MelisCmsPlatformSelect: a dropdown to select a platform
- MelisCmsStyleSelect: a dropdown to select a style
- MelisSwitch: an on-off button designed for Melis Platform
- MelisCmsLanguageSelect: a dropdown to select the language
- MelisCmsPageLanguagesSelect: a dropdown to select the page language
- MelisMultiValInput: multiple input selection
- MelisCmsPlatformIDsSelect: a dropdown to select the platform id
- MelisCmsPluginSiteSelect: a dropdown to select the site
- MelisCmsPluginSiteModuleSelect: a dropdown to select the module
Listening to services and update behavior with custom code
Most services trigger events so that the behavior can be modified.
public function attach(EventManagerInterface $events)
{
$sharedEvents = $events->getSharedManager();
$callBackHandler = $sharedEvents->attach(
'MelisCms',
array(
'meliscms_page_save_start',
'meliscms_page_publish_start',
),
function($e){
$sm = $e->getTarget()->getEvent()->getApplication()->getServiceManager();
// Custom Code here
},
100);
$this->listeners[] = $callBackHandler;
}
TinyMCE configurations
MelisCms brings 3 defaults configuration when editing a template within a "MelisTag" editable area:
- html: full sets of buttons for the editor
- textarea: buttons limited to text and links
- media: buttons limited to media object insertion such as images and videos
Creating other config is possible. Add the config in a file then declare the file in the module.config.php file of the module:
// Config Files
'tinyMCE' => array(
'html' => 'MelisCms/public/js/tinyMCE/html.php',
'textarea' => 'MelisCms/public/js/tinyMCE/textarea.php',
'media' => 'MelisCms/public/js/tinyMCE/media.php',
),
- mini templates will automatically turned into plugins if places in their folder.
Javascript helpers provided with MelisCms
- melisLinkTree: Shows a modal with the treeview to search and make a page selection
melisLinkTree.createInputTreeModal('#sourcePageId');
Authors
- Melis Technology - www.melistechnology.com
See also the list of contributors who participated in this project.
License
This project is licensed under the OSL-3.0 License - see the LICENSE.md file for details