Initial commit

This commit is contained in:
Felix Förtsch
2020-10-20 14:39:50 +02:00
commit 648ded8896
1225 changed files with 216511 additions and 0 deletions

View File

@@ -0,0 +1,129 @@
<?php
/**
*
*/
namespace WCFE\Services;
# Module Framework
use WPPFW\Services\ServiceModule;
# Wordpres Plugin Framework
use WPPFW\Plugin\PluginBase;
# Wordpress Services Framework
use WPPFW\Services\Dashboard\Menu\MenuService;
use WPPFW\Services\Dashboard\Ajax\AjaxService;
/**
*
*/
class EditorModule extends ServiceModule {
/**
*
*/
const EDITOR_SERVICE_KEY = 0;
/**
*
*/
const EDITOR_SERVICE_OBJECT_KEY = 0;
/**
*
*/
const RAW_EDITOR_SERVICE_OBJECT_KEY = 1;
/**
*
*/
const EDITOR_AJAX_SERVICE_KEY = 1;
/**
*
*/
const EDITOR_AJAX_SERVICE_OBJECT_KEY = 0;
/**
*
*/
const EDITOR_AJAX_VIEWS_SERVICE_OBJECT_KEY = 1;
/**
* put your comment there...
*
* @param PluginBase $plugin
* @param mixed $services
*/
protected function initializeServices(PluginBase & $plugin, & $services)
{
# Editor Form Dashboard page
$services[ self::EDITOR_SERVICE_KEY ] = new MenuService
(
$plugin, array
(
self::EDITOR_SERVICE_OBJECT_KEY => ( $editFormMenu = new Editor\MenuPages\Editor\Page() ),
self::RAW_EDITOR_SERVICE_OBJECT_KEY => new Editor\MenuPages\Editor\RawEdit( $editFormMenu )
)
);
# Add Network Dashboard menu in MULTISITES installation
# or add administrator menu page in normal installation
if ( is_multisite() )
{
$services[ self::EDITOR_SERVICE_KEY ]->setHook( 'network_admin_menu' );
}
# Ajax endpoint
$services[ self::EDITOR_AJAX_SERVICE_KEY ] = new AjaxService
(
$plugin,
array
(
self::EDITOR_AJAX_SERVICE_OBJECT_KEY => new Editor\Services\Editor\Ajax(),
self::EDITOR_AJAX_VIEWS_SERVICE_OBJECT_KEY => new Editor\Services\Editor\AjaxViews()
)
);
}
/**
* put your comment there...
*
*/
public function editor() {
return $this->getServiceObject( self::EDITOR_SERVICE_KEY, self::EDITOR_SERVICE_OBJECT_KEY );
}
/**
* put your comment there...
*
*/
public function editorService()
{
return $this->getServiceObject( self::EDITOR_AJAX_SERVICE_KEY, self::EDITOR_AJAX_SERVICE_OBJECT_KEY );
}
/**
* put your comment there...
*
*/
public function editorViews()
{
return $this->getServiceObject( self::EDITOR_AJAX_SERVICE_KEY, self::EDITOR_AJAX_VIEWS_SERVICE_OBJECT_KEY );
}
/**
* put your comment there...
*
*/
public function rawEditor() {
return $this->getServiceObject( self::EDITOR_SERVICE_KEY, self::RAW_EDITOR_SERVICE_OBJECT_KEY );
}
}

View File

@@ -0,0 +1,14 @@
<?php
/**
*
*/
namespace WCFE\Services\Editor\MenuPages\Editor;
# MVC Framework
use WPPFW\MVC\MVCViewDispatcher;
/**
*
*/
class Editor extends MVCViewDispatcher {}

View File

@@ -0,0 +1,46 @@
<?php
/**
*
*/
namespace WCFE\Services\Editor\MenuPages\Editor;
# Menu Page Service Framework
use WPPFW\Services\Dashboard\Menu\MenuPage;
use WPPFW\Http\Url;
/**
*
*/
class Page extends MenuPage {
/**
* put your comment there...
*
*/
public function __construct()
{
parent::__construct
(
'WPCF Editor',
'Wordpress Config File Editor',
( is_multisite() ? 'manage_network' : 'administrator' ),
WP_PLUGIN_URL . '/wp-config-file-editor/Modules/Editor/View/Editor/Media/Images/dashboard-menu-icon.png'
);
}
/**
* put your comment there...
*
*/
public function getUrl()
{
$urlMethod = is_multisite() ? 'network_admin_url' : 'admin_url';
return new Url( $urlMethod( 'admin.php' ) , $this->getRouteParams() );
}
}

View File

@@ -0,0 +1,49 @@
<?php
/**
*
*/
namespace WCFE\Services\Editor\MenuPages\Editor;
# Menu Page Service Framework
use WPPFW\Services\Dashboard\Menu\SubMenuPage;
use WPPFW\Http\Url;
/**
*
*/
class RawEdit extends SubMenuPage {
/**
* put your comment there...
*
* @param mixed $editFormMenu
* @return RawEdit
*/
public function __construct( $editFormMenu )
{
parent::__construct
(
'Raw Editing',
'Independently edit wp-config.php file',
( is_multisite() ? 'manage_network' : 'administrator' )
);
# Add under wcfe dashboard menu
$this->setParent( $editFormMenu );
}
/**
* put your comment there...
*
*/
public function getUrl()
{
$urlMethod = is_multisite() ? 'network_admin_url' : 'admin_url';
return new Url( $urlMethod( 'admin.php' ) , $this->getRouteParams() );
}
}

View File

@@ -0,0 +1,25 @@
<?php
/**
*
*/
namespace WCFE\Services\Editor\MultiSiteTools;
/**
*
*/
class MultiSiteNetworkPageTools
extends \WPPFW\Services\ServiceObject
implements \WPPFW\Services\IReachableServiceObject
{
/**
* put your comment there...
*
*/
public function getUrl()
{
return home_url( 'network.php' );
}
}

View File

@@ -0,0 +1,14 @@
<?php
/**
*
*/
namespace WCFE\Services\Editor\MultiSiteTools;
/**
*
*/
class Proxy extends \WPPFW\Services\ProxyBase
{
}

View File

@@ -0,0 +1,86 @@
<?php
/**
*
*/
namespace WCFE\Services\Editor\MultiSiteTools;
/**
*
*/
class Service extends \WPPFW\Services\ServiceBase {
/**
* put your comment there...
*
* @var mixed
*/
protected static $instance;
/**
* put your comment there...
*
*/
public function _checkIfNetworkSetupPage()
{
if ( defined( 'WP_INSTALLING_NETWORK' ) &&
WP_INSTALLING_NETWORK )
{
add_action( 'admin_print_footer_scripts', array( $this, '_printScripts' ) );
}
}
/**
* put your comment there...
*
*/
public function _printScripts( )
{
if ( network_domain_check() )
{
$this->hoohMap[ current_filter() ] = $this->serviceObjects[ 0 ];
$this->createServiceFront( new Proxy() );
$this->dispatch();
$this->response();
}
}
/**
* put your comment there...
*
*/
public static function & run()
{
if ( ! self::$instance )
{
self::$instance = new Service( \WCFE\Plugin::me(), array( new MultiSiteNetworkPageTools() ) );
self::$instance->start();
}
return self::$instance;
}
/**
* put your comment there...
*
*/
public function & start()
{
# Start service
add_action( 'admin_init', array( & $this, '_checkIfNetworkSetupPage' ) );
return $this;
}
}

View File

@@ -0,0 +1,14 @@
<?php
/**
*
*/
namespace WCFE\Services\Editor\MultiSiteTools;
/**
*
*/
class ServiceFront extends \WPPFW\MVC\MVCViewDispatcher
{
}

View File

@@ -0,0 +1,15 @@
<?php
/**
*
*/
# Define namespace
namespace WCFE\Services\Editor\Services\Editor;
# Ajax service Framework
use WPPFW\Services\Dashboard\Ajax\AjaxAccessPoint;
/**
*
*/
class Ajax extends AjaxAccessPoint {}

View File

@@ -0,0 +1,15 @@
<?php
/**
*
*/
# Define namespace
namespace WCFE\Services\Editor\Services\Editor;
# Ajax service Framework
use WPPFW\Services\Dashboard\Ajax\AjaxAccessPoint;
/**
*
*/
class AjaxViews extends AjaxAccessPoint {}

View File

@@ -0,0 +1,15 @@
<?php
/**
*
*/
# Define namespace
namespace WCFE\Services\Editor\Services\Editor;
# MVC Dispatcher framework
use WPPFW\MVC\MVCDispatcher;
/**
*
*/
class Service extends MVCDispatcher {}

View File

@@ -0,0 +1,76 @@
<?php
/**
*
*/
namespace WCFE\Services;
# Module Framework
use WPPFW\Services\ServiceModule;
# Wordpres Plugin Framework
use WPPFW\Plugin\PluginBase;
# Wordpress Services Framework
use WPPFW\Services\Dashboard\Ajax\AjaxService;
/**
*
*/
class ProfilesModule extends ServiceModule {
/**
*
*/
const PROFILES_AJAX_SERVICE_KEY = 2;
/**
*
*/
const PROFILES_AJAX_VIEW_SERVICE_OBJECT_KEY = 0;
/**
*
*/
const PROFILES_AJAX_SERVICE_OBJECT_KEY = 1;
/**
* put your comment there...
*
* @param PluginBase $plugin
* @param mixed $services
*/
protected function initializeServices(PluginBase & $plugin, & $services)
{
$services[ self::PROFILES_AJAX_SERVICE_KEY ] = new AjaxService
(
$plugin,
array
(
self::PROFILES_AJAX_VIEW_SERVICE_OBJECT_KEY => new Profiles\Services\Profiles\AjaxView(),
self::PROFILES_AJAX_SERVICE_OBJECT_KEY => new Profiles\Services\Profiles\Ajax()
)
);
}
/**
* put your comment there...
*
*/
public function profilesView() {
return $this->getServiceObject( self::PROFILES_AJAX_SERVICE_KEY, self::PROFILES_AJAX_VIEW_SERVICE_OBJECT_KEY );
}
/**
* put your comment there...
*
*/
public function profilesService()
{
return $this->getServiceObject( self::PROFILES_AJAX_SERVICE_KEY, self::PROFILES_AJAX_SERVICE_OBJECT_KEY );
}
}

View File

@@ -0,0 +1,15 @@
<?php
/**
*
*/
# Define namespace
namespace WCFE\Services\Profiles\Services\Profiles;
# Ajax service Framework
use WPPFW\Services\Dashboard\Ajax\AjaxAccessPoint;
/**
*
*/
class Ajax extends AjaxAccessPoint {}

View File

@@ -0,0 +1,15 @@
<?php
/**
*
*/
# Define namespace
namespace WCFE\Services\Profiles\Services\Profiles;
# Ajax service Framework
use WPPFW\Services\Dashboard\Ajax\AjaxAccessPoint;
/**
*
*/
class AjaxView extends AjaxAccessPoint {}

View File

@@ -0,0 +1,15 @@
<?php
/**
*
*/
# Define namespace
namespace WCFE\Services\Profiles\Services\Profiles;
# MVC Dispatcher framework
use WPPFW\MVC\MVCDispatcher;
/**
*
*/
class Service extends MVCDispatcher {}

View File

@@ -0,0 +1,112 @@
<?php
/**
*
*/
namespace WCFE\Services;
# Module Framework
use WPPFW\Services\ServiceModule;
# Wordpres Plugin Framework
use WPPFW\Plugin\PluginBase;
# Wordpress Services Framework
use WPPFW\Services\Dashboard\Menu\MenuService;
use WPPFW\Services\Dashboard\Ajax\AjaxService;
/**
*
*/
class SysFiltersModule extends ServiceModule {
/**
*
*/
const SERVICE_KEY = 3;
/**
*
*/
const SERVICE_OBJECT_KEY = 0;
/**
*
*/
const AJAX_SERVICE_KEY = 4;
/**
*
*/
const AJAX_SERVICE_OBJECT_KEY = 0;
/**
*
*/
const AJAX_VIEWS_SERVICE_OBJECT_KEY = 1;
/**
* put your comment there...
*
* @param PluginBase $plugin
* @param mixed $services
*/
protected function initializeServices(PluginBase & $plugin, & $services)
{
# Editor Form Dashboard page
$services[ self::SERVICE_KEY ] = new MenuService
(
$plugin, array
(
self::SERVICE_OBJECT_KEY => new SysFilters\Dashboard\Page()
)
);
# Add Network Dashboard menu in MULTISITES installation
# or add administrator menu page in normal installation
if ( is_multisite() )
{
$services[ self::SERVICE_KEY ]->setHook( 'network_admin_menu' );
}
# Ajax endpoint
$services[ self::AJAX_SERVICE_KEY ] = new AjaxService
(
$plugin,
array
(
self::AJAX_SERVICE_OBJECT_KEY => new SysFilters\Services\Dashboard\Ajax(),
self::AJAX_VIEWS_SERVICE_OBJECT_KEY => new SysFilters\Services\Dashboard\AjaxViews()
)
);
}
/**
* put your comment there...
*
*/
public function dashboard() {
return $this->getServiceObject( self::SERVICE_KEY, self::SERVICE_OBJECT_KEY );
}
/**
* put your comment there...
*
*/
public function dashboardService()
{
return $this->getServiceObject( self::AJAX_SERVICE_KEY, self::AJAX_SERVICE_OBJECT_KEY );
}
/**
* put your comment there...
*
*/
public function dashboardServiceViews()
{
return $this->getServiceObject( self::AJAX_SERVICE_KEY, self::AJAX_VIEWS_SERVICE_OBJECT_KEY );
}
}

View File

@@ -0,0 +1,14 @@
<?php
/**
*
*/
namespace WCFE\Services\SysFilters\Dashboard;
# MVC Framework
use WPPFW\MVC\MVCViewDispatcher;
/**
*
*/
class Dashboard extends MVCViewDispatcher {}

View File

@@ -0,0 +1,48 @@
<?php
/**
*
*/
namespace WCFE\Services\SysFilters\Dashboard;
# Menu Page Service Framework
use WPPFW\Services\Dashboard\Menu\SubMenuPage;
use WPPFW\Http\Url;
/**
*
*/
class Page extends SubMenuPage {
/**
* put your comment there...
*
*/
public function __construct()
{
parent::__construct
(
'System Parameters',
'Change System Wide configuration - Control how Wordpress platform bahave',
( is_multisite() ? 'manage_network' : 'administrator' )
);
# Add under editor menu
$editorModel =& \WCFE\Plugin::me()->getEditorModule();
$this->setParent( $editorModel->editor() );
}
/**
* put your comment there...
*
*/
public function getUrl()
{
$urlMethod = is_multisite() ? 'network_admin_url' : 'admin_url';
return new Url( $urlMethod( 'admin.php' ) , $this->getRouteParams() );
}
}

View File

@@ -0,0 +1,15 @@
<?php
/**
*
*/
# Define namespace
namespace WCFE\Services\SysFilters\Services\Dashboard;
# Ajax service Framework
use WPPFW\Services\Dashboard\Ajax\AjaxAccessPoint;
/**
*
*/
class Ajax extends AjaxAccessPoint {}

View File

@@ -0,0 +1,15 @@
<?php
/**
*
*/
# Define namespace
namespace WCFE\Services\SysFilters\Services\Dashboard;
# Ajax service Framework
use WPPFW\Services\Dashboard\Ajax\AjaxAccessPoint;
/**
*
*/
class AjaxViews extends AjaxAccessPoint {}

View File

@@ -0,0 +1,15 @@
<?php
/**
*
*/
# Define namespace
namespace WCFE\Services\SysFilters\Services\Dashboard;
# MVC Dispatcher framework
use WPPFW\MVC\MVCDispatcher;
/**
*
*/
class Service extends MVCDispatcher {}

View File

@@ -0,0 +1,62 @@
<?php
/**
*
*/
namespace WCFE\Services\SysFilters;
/**
*
*/
class SysFilters
{
/**
* put your comment there...
*
* @var mixed
*/
protected static $instance;
/**
* put your comment there...
*
*/
private function __construct() {}
/**
* put your comment there...
*
*/
public function _sysFilters()
{
}
/**
* put your comment there...
*
*/
protected function hook()
{
add_action( \WCFE\Hooks::ACTION_PLUGIN_LOADED, array( $this, '_sysFilters' ) );
}
/**
* put your comment there...
*
*/
public static function & run()
{
if ( ! self::$instance )
{
self::$instance = new SysFilters();
self::$instance->hook();
}
return self::$instance;
}
}