<?php

use Rvsitebuilder\Wysiwyg\Http\Controllers\Backend\SettingController;

Route::group ( [
        'prefix' => 'admin',
        'middleware' => 'web'
], function () {
    Route::group ( [
            'prefix' => 'wysiwyg',
            'namespace' => 'Rvsitebuilder\Wysiwyg\Http\Controllers\Backend',
            'middleware' => 'admin'
    ], function () {
        Route::group ( [
                'prefix' => 'update',
        ], function () {
            Route::post('/savesite','SaveController@saveSite');
        //  Footer
            Route::post('/footer','FooterController@saveFooter');
            Route::post('/info','FooterController@saveInfomation');

            Route::post('/sidebarSetting','PageController@sidebarSetting');
            Route::post('/pageOption','PageController@savePageOption');

            Route::post('/pageMata','PageController@saveMetaTag');
            Route::post('/pageJs','PageController@saveCssJs');

            Route::post('/resetSidebar','SidebarController@resetSidebar');

            Route::post('/addPage','PageController@addPage');

            Route::post('/saveBrand','SettingController@saveBrand');
            Route::post('/saveBacktotop','SettingController@saveBacktotop');

            //Site property
            Route::post('siteproperty','SitePropertyController@siteProperty');
            Route::post('pageproperty','SitePropertyController@pageProperty');
            Route::post('postproperty','SitePropertyController@postProperty');

            Route::get('getpageactive','SitePropertyController@getActivePageinfo');
            Route::get('getpostactive','SitePropertyController@getActivePostinfo');
            Route::get('getsystemactive','SitePropertyController@getActiveSysteminfo');

            // Header Action
            Route::post('/saveHeaderStyle','HeaderController@saveHeaderStyle');
            Route::post('/saveTopMenuStyle','HeaderController@saveTopMenuStyle');
            Route::post('/saveMenuStyle','HeaderController@saveMenuStyle');
            Route::post('/saveHeaderContent','HeaderController@saveHeaderContent');

            Route::post('/resetHeader','HeaderController@resetHeader');
            Route::post('/resetFooter','FooterController@resetFooter');

            Route::post('/hideLoginMenu','SettingController@setHideMenu');

            Route::post('/saveGlobalPost','SaveController@saveGlobalPost');

            //PageOption
            Route::post('/setDraft','PageOptionController@setDraft');
            Route::post('/delete','PageOptionController@delete');
            Route::post('/setHomepage','PageOptionController@setHomepage');
            Route::post('/duplicate','PageOptionController@duplicate');
            Route::post('/rename','PageOptionController@rename');

            // Menu

            Route::group ( [
                    'prefix' => 'menu'
            ], function () {
                Route::post ( '/new', 'MenuController@newMenu' );
                Route::post ( '/rename', 'MenuController@renameMenu' );
                Route::post ( '/icon', 'MenuController@changeIcon' );
                Route::post ( '/badge', 'MenuController@changeBadge' );
                Route::post ( '/target', 'MenuController@changeTarget' );
                Route::post ( '/url', 'MenuController@changeUrl' );
                Route::post ( '/savemenu', 'MenuController@saveMenu' );
                Route::post ( '/delete', 'MenuController@delMenu' );

            } );

            // Theme
            Route::group ( [
                    'prefix' => 'sitetheme'
            ], function () {
                Route::get ( '/getthemestyle', 'SiteThemeController@getThemeStyle' );
                Route::post ( '/setthemestyle', 'SiteThemeController@updateTheme' );

            } );

        });
        Route::group ( [
                'prefix' => 'service',
        ], function () {
            Route::get('/header','HeaderController@myHeader');
            Route::post('/menu','MenuController@menuData');

            Route::get('/canvasHeader/{header_id}','HeaderController@canvasHeader');
            Route::get('/page','PageController@pageData');
            Route::post('/checkSlug','PageController@checkSlugExist');
            Route::get('/getPageData/{page_id}','PageController@getPageData');
            Route::get('/sidebar','SidebarController@sidebarData');
            Route::get('/makethumbnail/{header_id}','HeaderController@makethumbnail');
            Route::post('/savethumbnail','HeaderController@savethumbnail');
            Route::get('/system','SystempageController@systemData');

            Route::post('/seoContent','SeoController@returnContentSeo');
        });

    });
});
