PHP code example of melisplatform / melis-core

1. Go to this page and download the library: Download melisplatform/melis-core library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

melisplatform / melis-core example snippets


'interface_ordering' => array(
    // reordering le left pannel of Melis Platform
	'meliscore_leftmenu' => array(
		'meliscore_leftmenu_identity',  // identity zone first
		'meliscore_leftmenu_dashboard', // acces to dashboard second
		'meliscms_sitetree',		// site tree 3rd
		'meliscore_toolstree',		// tools tree 4th
		'meliscore_footer',		// footer last
	),

// Get the service
$melisCoreAuth = $this->getServiceManager()->get('MelisCoreAuth');  
// check identity
$logged = $melisCoreAuth->hasIdentity()  

// Get the services  
$melisCoreAuth = $this->getServiceManager()->get('MelisCoreAuth');
$melisCoreRights = $this->getServiceManager()->get('MelisCoreRights');
if($melisCoreAuth->hasIdentity())
{
	// Get the user's rights
	$xmlRights = $melisCoreAuth->getAuthRights();
	
	// Check if the user has an exclusion of access to /meliscore_dashboard
	$isAccessible = $melisCoreRights->isAccessible($xmlRights,
							MelisCoreRightsService::MELISCORE_PREFIX_INTERFACE,
							'/meliscore_dashboard');
}        
 
return array(
	'plugins' => array(
	
		// MelisCms array
		'meliscore' => array(
		
			// Form key
			'forms' => array(
			
				// MelisCore login form
				'meliscore_login' => array(
					'attributes' => array(
						'name' => 'meliscore_login',
						'id' => 'idformmeliscorelogin',
						'method' => 'POST',
					),
					'hydrator'  => 'Laminas\Hydrator\ArraySerializableHydrator',
					'elements' => array(  
						array(
							'spec' => array(
								...
							),
						),
					),
					'input_filter' => array(      
						'usr_login' => array(
							...
						),   
					),
				),
			),
		),
	),
),
 
return array(
	'plugins' => array(
		// MelisCms array
		'meliscore' => array(
			// Form key
			'forms' => array(
				// MelisCore login form
				'meliscore_login' => array(
					'elements' => array(  
					),
					'input_filter' => array(     
					),

return array(
	// key at the root for listing forms' order modifications
	'forms_ordering' => array(
   
		// change the order of the MelisCore email management form tool.
		'meliscore_emails_mngt_tool_general_properties_form' => array(
			'elements' => array(
				// Name will now be first
				array(
					'spec' => array(
						'name' => 'boe_code_name',
					),
				),
				// "From" email will be second
				array(
					'spec' => array(
						'name' => 'boe_from_email',
					),
				),
               
				// Rest of the form's field will come in order after
			),
		),
	),
);
  
public function attach(EventManagerInterface $events)
{
	$sharedEvents = $events->getSharedManager();

	$callBackHandler = $sharedEvents->attach(
		'MelisCore',
		array(
			'meliscore_tooluser_save_end', 
		),
		function($e){

			$sm = $e->getTarget()->getEvent()->getApplication()->getServiceManager();
    		
    		// custom code
    	},
    100);
    
    $this->listeners[] = $callBackHandler;
}
  
// Config Files  
'tinyMCE' => array(  
	'html' => 'MelisCore/public/js/tinyMCE/tool.php',  
),