-
Notifications
You must be signed in to change notification settings - Fork 20
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
Timot Tarjani
committed
Mar 19, 2024
1 parent
1c35735
commit b1ff2c2
Showing
8 changed files
with
73 additions
and
50 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 @@ | ||
{"version":1,"defects":{"AbstractControllerTest::testControllerCreation":4,"AbstractControllerTest::testControllerRedirectMethods":4,"AbstractControllerTest::testIfVariablesSet":4,"AppTest::testAppCreation":4,"AppTest::testAppRootDir":4,"AppTest::testIsInstalled":4,"ExceptionHandler::testRenderAuthorizationException":4,"ExceptionHandler::testRenderAuthenticationException":4,"ExceptionHandler::testRenderAllExceptions":4,"AdminMiddlewareTest::testNonAdminsAreRedirected":4,"AdminMiddlewareTest::testAdminsAreNotRedirected":4,"AdminMiddlewareTest::testNonActiveAdminsAreRedirected":4,"InstallerMiddlewareTest::testNotRedirectIfInstalled":4,"InstallerMiddlewareTest::testInstallerIsNotAvailableAfterInstalled":4,"SettingsMiddlewareTest::testSettingsAreSet":4,"PluginModelTest::testPluginInitiation":4,"PluginModelTest::testInfoUsage":4,"PluginModelTest::testRootDirSetter":4,"PluginModelTest::testAllGetter":4,"PluginModelTest::testMethodsDependingOnRegister":4,"RouteResolverTest::testRoutingInitiation":4,"RouteResolverTest::testRoutingMethodExistance":4,"RouteResolverTest::testRouteNamespacing":4,"RouteResolverTest::testControllerResolving":4,"RouteResolverTest::testControllerNotExsistException":4,"RouteResolverTest::testRouteNotExsistsExceptionIsThrown":4,"SearchEngineTest::testSearchEngineInitiation":4,"SearchEngineTest::testRoutingMethodExistance":4,"SearchEngineTest::testGetterAndSetterModel":4,"SearchEngineTest::testExecuteSearch":4,"SearchEngineTest::testClearResults":4,"SearchEngineTest::testSearchKey":4,"ViewResolverTest::testDataArraysSet":4,"ViewResolverTest::testSetters":4,"ViewResolverTest::testRender":4,"WidgetResolverTest::testSetterAndGetter":4,"WidgetResolverTest::testWidgetResolving":4},"times":{"AbstractControllerTest::testControllerCreation":0.078,"AbstractControllerTest::testControllerRedirectMethods":0.004,"AbstractControllerTest::testIfVariablesSet":0.004,"AppTest::testAppCreation":0.004,"AppTest::testAppRootDir":0.005,"AppTest::testIsInstalled":0.004,"ExceptionHandler::testRenderAuthorizationException":0.011,"ExceptionHandler::testRenderAuthenticationException":0.004,"ExceptionHandler::testRenderAllExceptions":0.004,"AdminMiddlewareTest::testNonAdminsAreRedirected":0.004,"AdminMiddlewareTest::testAdminsAreNotRedirected":0.004,"AdminMiddlewareTest::testNonActiveAdminsAreRedirected":0.004,"InstallerMiddlewareTest::testNotRedirectIfInstalled":0.004,"InstallerMiddlewareTest::testInstallerIsNotAvailableAfterInstalled":0.004,"SettingsMiddlewareTest::testSettingsAreSet":0.004,"PluginModelTest::testPluginInitiation":0.004,"PluginModelTest::testInfoUsage":0.003,"PluginModelTest::testRootDirSetter":0.004,"PluginModelTest::testAllGetter":0.004,"PluginModelTest::testMethodsDependingOnRegister":0.004,"RouteResolverTest::testRoutingInitiation":0.005,"RouteResolverTest::testRoutingMethodExistance":0.006,"RouteResolverTest::testRouteNamespacing":0.004,"RouteResolverTest::testControllerResolving":0.004,"RouteResolverTest::testControllerNotExsistException":0.01,"RouteResolverTest::testRouteNotExsistsExceptionIsThrown":0.004,"SearchEngineTest::testSearchEngineInitiation":0.005,"SearchEngineTest::testRoutingMethodExistance":0.006,"SearchEngineTest::testGetterAndSetterModel":0.004,"SearchEngineTest::testExecuteSearch":0.004,"SearchEngineTest::testClearResults":0.006,"SearchEngineTest::testSearchKey":0.005,"ViewResolverTest::testDataArraysSet":0.003,"ViewResolverTest::testSetters":0.005,"ViewResolverTest::testRender":0.006,"WidgetResolverTest::testSetterAndGetter":0.004,"WidgetResolverTest::testWidgetResolving":0.003}} |
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 |
---|---|---|
@@ -1,49 +1,47 @@ | ||
<?php | ||
<?php | ||
|
||
namespace App\Libs; | ||
|
||
use \App\Model\Plugin as Plugin; | ||
|
||
class ShortCode{ | ||
class ShortCode | ||
{ | ||
|
||
private $widgets = array(); | ||
|
||
public function initalize($plugins){ | ||
public function initalize($plugins) | ||
{ | ||
|
||
foreach($plugins as $plugin){ | ||
foreach ($plugins as $plugin) { | ||
|
||
|
||
if( $plugin->hasRegister('widget') ){ | ||
if ($plugin->hasRegister('widget')) { | ||
|
||
\View::addNamespace('plugin', [ | ||
$plugin->getPath()."/app/View", | ||
$plugin->getPath()."/app/resources/views" | ||
]); | ||
$plugin->getPath() . "/app/View", | ||
$plugin->getPath() . "/app/resources/views" | ||
]); | ||
|
||
$this->addWidget($plugin->getShortCode(),$plugin->getRegister('widget')); | ||
$this->addWidget($plugin->getShortCode(), $plugin->getRegister('widget')); | ||
} | ||
|
||
|
||
} | ||
|
||
} | ||
|
||
public function addWidget($key,$value){ | ||
public function addWidget($key, $value) | ||
{ | ||
$this->widgets[$key] = $value; | ||
} | ||
|
||
public function getWidget($key){ | ||
public function getWidget($key) | ||
{ | ||
return $this->widgets[$key]; | ||
} | ||
|
||
public function getAll(){ | ||
public function getAll() | ||
{ | ||
return $this->widgets; | ||
} | ||
|
||
public function compile($page){ | ||
|
||
return count($this->widgets) === 0? $page : str_replace(array_keys($this->widgets), array_values($this->widgets), $page); | ||
public function compile($page) | ||
{ | ||
return count($this->widgets) === 0 ? $page : str_replace(array_keys($this->widgets), array_values($this->widgets), $page); | ||
} | ||
|
||
|
||
} | ||
} |
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