src/Controller/ModulesController.php
public function saveModuleChangesAction()
    {
        $translator = $this->getServiceLocator()->get('translator');
        $request = $this->getRequest();
        $success = 0;
        $textTitle = 'tr_meliscore_module_management_modules';
        $textMessage = 'tr_meliscore_module_management_prompt_failed';

        if($request->isPost()) {
            $modules = $this->params()->fromPost();
            $moduleLists = '';
            $enabledModules = array();
            $disabledModules = array();

            foreach($modules as $moduleName => $moduleValue) {
                if((int) $moduleValue == 1) {
                    $enabledModules[] = $moduleName;
                }
            }

            $modules = $enabledModules;
            $success = $this->createModuleLoaderFile($modules) === true ? 1 : 0;

            if($success == 1) {
                $textMessage = 'tr_meliscore_module_management_prompt_success';
            }
        }
        $response = array(
            'success' => $success,
            'textTitle' => $translator->translate($textTitle),
            'textMessage' => $translator->translate($textMessage),
        );

        $this->getEventManager()->trigger('meliscore_module_management_save_end', $this, $response);

        return new JsonModel($response);
    }
public function saveModuleChangesAction()
    {
        $translator = $this->getServiceLocator()->get('translator');
        $request = $this->getRequest();
        $success = 0;
        $textTitle = 'tr_meliscore_module_management_modules';
        $textMessage = 'tr_meliscore_module_management_prompt_failed';

        if($request->isPost()) {
            $modules = $this->params()->fromPost();
            $moduleLists = '';
            $enabledModules = array();
            $disabledModules = array();

            foreach($modules as $moduleName => $moduleValue) {
                if((int) $moduleValue == 1) {
                    $enabledModules[] = $moduleName;
                }
            }

            $modules = $enabledModules;
            $success = $this->createModuleLoaderFile($modules) === true ? 1 : 0;

            if($success == 1) {
                $textMessage = 'tr_meliscore_module_management_prompt_success';
            }
        }
        $response = array(
            'success' => $success,
            'textTitle' => $translator->translate($textTitle),
            'textMessage' => $translator->translate($textMessage),
        );

        $this->getEventManager()->trigger('meliscore_module_management_save_end', $this, $response);

        return new JsonModel($response);
    }
public function saveModuleChangesAction ( ) { $ translator = $ this -> getServiceLocator ( ) -> get ( 'translator' ) ; $ request = $ this -> getRequest ( ) ; $ success = 0 ; $ textTitle = 'tr_meliscore_module_management_modules' ; $ textMessage = 'tr_meliscore_module_management_prompt_failed' ; if ( $ request -> isPost ( ) ) { $ modules = $ this -> params ( ) -> fromPost ( ) ; $ moduleLists = '' ; $ enabledModules = array ( ) ; $ disabledModules = array ( ) ; foreach ( $ modules as $ moduleName => $ moduleValue ) { if ( ( int ) $ moduleValue == 1 ) { $ enabledModules [ ] = $ moduleName ; } } $ modules = $ enabledModules ; $ success = $ this -> createModuleLoaderFile ( $ modules ) === true ? 1 : 0 ; if ( $ success == 1 ) { $ textMessage = 'tr_meliscore_module_management_prompt_success' ; } } $ response = array ( 'success' => $ success , 'textTitle' => $ translator -> translate ( $ textTitle ) , 'textMessage' => $ translator -> translate ( $ textMessage ) , ) ; $ this -> getEventManager ( ) -> trigger ( 'meliscore_module_management_save_end' , $ this , $ response ) ; return new JsonModel ( $ response ) ; }
Saves the changes of the module modifications
@return JsonModel
Saves the changes of the module modifications