Commit b113a6a1 authored by Laurent Lecluse's avatar Laurent Lecluse
Browse files

Module UnicaenKsup opérationnel

parent ca62b978
Loading
Loading
Loading
Loading
+20 −20
Original line number Diff line number Diff line
@@ -2,8 +2,8 @@

namespace UnicaenKsup;

use Zend\ModuleManager\Feature\AutoloaderProviderInterface;
use Zend\ModuleManager\Feature\ConfigProviderInterface;
use Zend\Mvc\MvcEvent;


/**
@@ -11,32 +11,32 @@ use Zend\Mvc\MvcEvent;
 *
 * @author Laurent LECLUSE <laurent.lecluse at unicaen.fr>
 */
class Module implements ConfigProviderInterface
class Module implements AutoloaderProviderInterface, ConfigProviderInterface
{
    public function onBootstrap(MvcEvent $e)

    /**
     *
     * @return array
     * @see AutoloaderProviderInterface
     */
    public function getAutoloaderConfig()
    {
       /* define("KPHPLIB_PATH", __DIR__ . "vendor/ksup_connecteur_php-5.1/kphplib5/");
// chemins des librairies
        define("KPHPLIB_PATH_CLASSE", KPHPLIB_PATH . "classe/");
        define("KPHPLIB_PATH_CLASSE_DATA", KPHPLIB_PATH . "classe/data/");
        define("KPHPLIB_PATH_CLASSE_SSO", KPHPLIB_PATH . "classe/sso/");
        define("KPHPLIB_PATH_CLASSE_UTIL_XML", KPHPLIB_PATH . "classe/util/xml/");
        define("KPHPLIB_PATH_CLASSE_UTIL_HTTP", KPHPLIB_PATH . "classe/util/http/");
        define("KPHPLIB_PATH_INCLUDE", KPHPLIB_PATH . "include/");*/
        return [
            'Zend\Loader\ClassMapAutoloader' => [
                __DIR__ . '/autoload_classmap.php',
            ],
            'Zend\Loader\StandardAutoloader' => [
                'namespaces' => [
                    __NAMESPACE__ => __DIR__ . '/src/' . __NAMESPACE__,
                ],
            ],
        ];
    }



    public function getConfig()
    {
        $config = include __DIR__ . '/config/module.config.php';

        /*$ksup = $config['unicaen-ksup'];

        define("SSO_URL_SERVER", $ksup['sso_url_server']);
        define("SSO_HOST_SERVER", $ksup['sso_host_server']);
        define("SSO_PORT_SERVER", $ksup['sso_port_server']);*/

        return $config;
        return include __DIR__ . '/config/module.config.php';
    }
}
 No newline at end of file
+12 −17
Original line number Diff line number Diff line
@@ -3,27 +3,22 @@ namespace UnicaenKsup;

return [
    'unicaen-ksup' => [
        'sso_url_server'  => 'http://www.unicaen.fr',
        'sso_host_server' => 'www.unicaen.fr',
        'sso_port_server' => '80',
        'connecteur_path' => __DIR__ . '/../vendor/ksup_connecteur_php-5.1/kphplib5/',
        'remplacement' => [
            'charset=iso-8859-1' => 'charset=utf-8'
        ],
    ],

    'view_manager' => [

        // TemplateMapResolver configuration
        // template/path pairs
        'template_map'        => [
            'layout/ksup' => __DIR__ . '/../view/layout/ksup.phtml',
        'strategies' => [
            'ViewKsupStrategy', // register ksup strategy
        ],
        // TemplatePathStack configuration
        'template_path_stack' => [
            'ksup' => __DIR__ . '/../view',
    ],
        // Layout template name
        'layout'              => 'layout/layout', // e.g., 'layout/layout'
        // Additional strategies to attach
        'strategies'          => [
            //'ViewKsupStrategy', // register JSON renderer strategy

    'service_manager' => [
        'factories' => [
            'ViewKsupStrategy' => Mvc\Service\ViewKsupStrategyFactory::class,
            'ksup'             => Service\KsupServiceFactory::class,
        ],
    ],
];
 No newline at end of file
+20 −2
Original line number Diff line number Diff line
<?php
namespace UnicaenKsup;

return [
    'unicaen-ksup' => [
$config = [
    'sso_url_server'  => 'http://www.unicaen.fr',
    'sso_host_server' => 'www.unicaen.fr',
    'sso_port_server' => '80',
    'langue'          => 'fr',
    'https'           => false,
    'remplacement' => [
        // sert à remplacer un texte par un autre dans le code KSUP de la page
        // format ancien texte => nouveau texte
        '"/images/' => '"http://www.unicaen.fr/images/'
    ],
    'scripts' => [
         // placez ici les URL de vos scripts JS souhaités
    ],
    'links' => [
         // placez ici les URL de vos feuilles de style souhaitées
    ],
];

return [
    'unicaen-ksup' => $config,
];
 No newline at end of file
+5 −3
Original line number Diff line number Diff line
<?php
namespace UnicaenKsup;

$config = [
];

return [
    'unicaen-ksup' => [
    ],
    'unicaen-ksup' => $config,
];
 No newline at end of file
+26 −0
Original line number Diff line number Diff line
<?php

namespace UnicaenKsup\Mvc\Service;

use Application\View\Renderer\PhpRenderer;
use UnicaenKsup\Service\KsupService;
use Zend\ServiceManager\FactoryInterface;
use Zend\ServiceManager\ServiceLocatorInterface;
use UnicaenKsup\View\Strategy\KsupStrategy;

class ViewKsupStrategyFactory implements FactoryInterface
{

    public function createService(ServiceLocatorInterface $serviceLocator)
    {
        /** @var PhpRenderer $renderer */
        $renderer = $serviceLocator->get('ViewRenderer');

        /** @var KsupService $service */
        $service = $serviceLocator->get('ksup');

        $strategy = new KsupStrategy($renderer);
        $strategy->setServiceKsup($service);
        return $strategy;
    }
}
Loading