-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Release: develop into main for v6 release See merge request 2pisoftware/cosine/core!407
- Loading branch information
Showing
208 changed files
with
9,616 additions
and
5,937 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
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
Large diffs are not rendered by default.
Oops, something went wrong.
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,46 @@ | ||
<?php | ||
|
||
interface InjectableModuleInterface | ||
{ | ||
/** | ||
* This function should return a fake Config array that will be used to inject the module into the top menu. | ||
* The injected_by key should be the name of the module that is injecting this module and is required for | ||
* ensuring that the autoloader can find the right folder for autoloaded classes | ||
* | ||
* E.g. | ||
* ```php | ||
* return [ | ||
* 'path' => 'modules', | ||
* 'active' => true, | ||
* 'topmenu' => 'Injected Module', | ||
* 'injected_by' => 'my_parent_module', | ||
* ]; | ||
* ``` | ||
* @return array | ||
*/ | ||
public static function serviceConfig(): array; | ||
|
||
/** | ||
* This function should inspect the parsed Web path and determine if the current request is in the injected top level module. | ||
* This is primarily used to ensure that the correct top level menu item is highlighted correctly. | ||
* | ||
* E.g. | ||
* ```php | ||
* return $w->_module == "parent_module" && in_array($w->_submodule, ['injected_submodule1', 'injected_submodule2']); | ||
* ``` | ||
* @param Web $w | ||
* @return bool | ||
*/ | ||
public static function isInInjectedTopLevelModule(Web $w): bool; | ||
|
||
/** | ||
* MenuLink is needed as the Web version of the menuLink function makes checks to Auth allowed functions that interfere with display | ||
* | ||
* E.g. | ||
* ```php | ||
* return HtmlBootstrap5::a("/my-module/target_action", "My Injected Module", null, 'nav-link'); | ||
* ``` | ||
* @return string | ||
*/ | ||
public function menuLink(): string; | ||
} |
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,13 +1,14 @@ | ||
<?php | ||
|
||
class MenuLinkStruct { | ||
class MenuLinkStruct | ||
{ | ||
public function __construct( | ||
public string $title, | ||
public string $url, | ||
public MenuLinkType $type = MenuLinkType::Link, | ||
) { | ||
if ($url[0] !== '/') { | ||
$this->url = '/' . $url; | ||
$this->url = '/'.$url; | ||
} | ||
} | ||
} |
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,46 @@ | ||
<?php | ||
|
||
namespace Html\Cmfive; | ||
|
||
use HtmlBootstrap5; | ||
|
||
/** | ||
* UI helper for enabling multiple pagination controls on a page, all dynamic | ||
* interaction handled by templates/base/src/js/components/TabbedPagination.ts | ||
*/ | ||
class TabbedPagination extends \Html\Element | ||
{ | ||
private array $_pages = []; | ||
private string $_tab = ''; | ||
|
||
public function setPages(array $pages): self | ||
{ | ||
$this->_pages = $pages; | ||
return $this; | ||
} | ||
|
||
public function setTab(string $tab): self | ||
{ | ||
$this->_tab = $tab; | ||
return $this; | ||
} | ||
|
||
public function __toString(): string | ||
{ | ||
$pages = ''; | ||
$page_number = 1; | ||
foreach ($this->_pages as $page) { | ||
$hidden = $page_number > 1 ? 'd-none' : ''; | ||
$pages .= "<div class='$hidden' data-page-number='$page_number'>$page</div>"; | ||
|
||
$page_number++; | ||
} | ||
|
||
$controls = HtmlBootstrap5::pagination(1, count($this->_pages), null, null, null, tab: $this->_tab); | ||
|
||
return "<div id='$this->_tab-tabbed-pagination'> | ||
$pages | ||
$controls | ||
</div>"; | ||
} | ||
} |
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
Oops, something went wrong.