FEATURE: change directory structure

This commit is contained in:
Michal Kváček
2016-10-17 00:07:21 +02:00
parent 87f1920373
commit 2ded2924a1
242 changed files with 742 additions and 1171 deletions
@@ -0,0 +1,12 @@
<?php
namespace App\CMS\Contracts\Widgets;
interface AdminDashboardWidget extends PublicWidget
{
/**
* Getter for list of all roles which are allowed to display the widget
*
* @return array
*/
public static function renderForRoles();
}
@@ -0,0 +1,17 @@
<?php
namespace App\CMS\Contracts\Widgets;
interface InstallableWidget extends PublicWidget {
/**
* Function for installing given widget
*
* @return mixed
*/
public static function install();
/**
* Function for uninstalling widget
*/
public static function uninstall();
}
@@ -0,0 +1,15 @@
<?php
namespace App\CMS\Widgets\Contracts;
interface MenuExtensionHandler {
public function getName();
public function getDescription();
public function getId();
public function getPossibleValues();
public function getFormExtensionTemplate();
public function save();
}
@@ -0,0 +1,36 @@
<?php
namespace App\CMS\Contracts\Widgets;
use App\Models\Widgets\Widget;
interface PublicWidget
{
/**
* Name getter
*
* @return string
*/
public static function getName();
/**
* Getter for description
*
* @return string
*/
public static function getDescription();
/**
* Getter for presenter/renderer of this widget
*
* @return WidgetRenderer
*/
public static function getPresenter();
/**
* @param Widget $widget
* @param \stdClass $data
*
* @return mixed
*/
public static function save(Widget $widget, \stdClass $data);
}
@@ -0,0 +1,37 @@
<?php
namespace App\CMS\Contracts\Widgets;
use App\Models\Widgets\Widget;
use App\Models\Widgets\WidgetType;
interface WidgetRenderer
{
/**
* Method used for displaying widget.
*
* This method renders some HTML code for displaying.
*
* @param Widget $settings
*
* @return mixed
*/
public static function render(Widget $settings);
/**
* Display form for creating new instance of widget
*
* @param WidgetType $type
*
* @return mixed
*/
public static function renderAddForm(WidgetType $type);
/**
* Display form for editing already existing widget
*
* @param Widget $widget
*
* @return mixed
*/
public static function renderEditForm(Widget $widget);
}