-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Добавлен альтернытивный вариант настройки виджетов на страницах
- Loading branch information
1 parent
593e49b
commit cbe493f
Showing
9 changed files
with
362 additions
and
243 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
<?php | ||
|
||
namespace KodiCMS\Widgets\Contracts; | ||
|
||
use KodiCMS\Widgets\Exceptions\WidgetException; | ||
|
||
interface Model | ||
{ | ||
|
||
/** | ||
* @return string | ||
*/ | ||
public function getWidgetClass(); | ||
|
||
/** | ||
* @return string | ||
*/ | ||
public function getType(); | ||
|
||
/** | ||
* @return \KodiCMS\Widgets\Contracts\Widget|null | ||
* @throws WidgetException | ||
*/ | ||
public function toWidget(); | ||
|
||
/** | ||
* @return bool | ||
*/ | ||
public function isWidgetable(); | ||
|
||
/** | ||
* @return bool | ||
*/ | ||
public function isHandler(); | ||
|
||
/** | ||
* @return bool | ||
*/ | ||
public function isRenderable(); | ||
|
||
/** | ||
* @return bool | ||
*/ | ||
public function isCacheable(); | ||
|
||
/** | ||
* @return bool | ||
*/ | ||
public function isClassExists(); | ||
|
||
/** | ||
* @return bool | ||
*/ | ||
public function isCorrupt(); | ||
|
||
/** | ||
* @return array | ||
*/ | ||
public function getLocations(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
<?php | ||
|
||
namespace KodiCMS\Widgets\Traits; | ||
|
||
|
||
trait WidgetStates | ||
{ | ||
/** | ||
* @return bool | ||
*/ | ||
public function isWidgetable() | ||
{ | ||
return ($this->exists and $this->manager->isWidgetable($this->getWidgetClass())); | ||
} | ||
|
||
/** | ||
* @return bool | ||
*/ | ||
public function isHandler() | ||
{ | ||
return $this->manager->isHandler($this->getWidgetClass()); | ||
} | ||
|
||
/** | ||
* @return bool | ||
*/ | ||
public function isRenderable() | ||
{ | ||
return $this->manager->isRenderable($this->getWidgetClass()); | ||
} | ||
|
||
/** | ||
* @return bool | ||
*/ | ||
public function isCacheable() | ||
{ | ||
return $this->manager->isCacheable($this->getWidgetClass()); | ||
} | ||
|
||
/** | ||
* @return bool | ||
*/ | ||
public function isClassExists() | ||
{ | ||
return $this->manager->isClassExists($this->getWidgetClass()); | ||
} | ||
|
||
/** | ||
* @return bool | ||
*/ | ||
public function isCorrupt() | ||
{ | ||
return $this->manager->isCorrupt($this->getWidgetClass()); | ||
} | ||
} |
Oops, something went wrong.