Getting more work done on custom navigation
parent
8db64d903d
commit
3df5324732
@ -0,0 +1,24 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace BusinessLogic\Navigation;
|
||||||
|
|
||||||
|
|
||||||
|
class CustomNavElement {
|
||||||
|
/* @var $id int*/
|
||||||
|
public $id;
|
||||||
|
|
||||||
|
/* @var $text string[string] */
|
||||||
|
public $text;
|
||||||
|
|
||||||
|
/* @var $subtext string[string]|null */
|
||||||
|
public $subtext;
|
||||||
|
|
||||||
|
/* @var $imageUrl string|null */
|
||||||
|
public $imageUrl;
|
||||||
|
|
||||||
|
/* @var $fontIcon string|null */
|
||||||
|
public $fontIcon;
|
||||||
|
|
||||||
|
/* @var $place int */
|
||||||
|
public $place;
|
||||||
|
}
|
@ -0,0 +1,32 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace BusinessLogic\Navigation;
|
||||||
|
|
||||||
|
// TODO Test!
|
||||||
|
use DataAccess\Navigation\CustomNavElementGateway;
|
||||||
|
|
||||||
|
class CustomNavElementHandler {
|
||||||
|
/* @var $customNavElementGateway CustomNavElementGateway */
|
||||||
|
private $customNavElementGateway;
|
||||||
|
|
||||||
|
function __construct($customNavElementGateway) {
|
||||||
|
$this->customNavElementGateway = $customNavElementGateway;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function getAllCustomNavElements($heskSettings) {
|
||||||
|
return $this->customNavElementGateway->getAllCustomNavElements($heskSettings);
|
||||||
|
}
|
||||||
|
|
||||||
|
function deleteCustomNavElement() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
function saveCustomNavElement() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
function createCustomNavElement() {
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,10 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace BusinessLogic\Navigation;
|
||||||
|
|
||||||
|
|
||||||
|
class CustomNavElementPlace {
|
||||||
|
const HOMEPAGE_BLOCK = 1;
|
||||||
|
const CUSTOMER_NAVIGATION = 2;
|
||||||
|
const ADMIN_NAVIGATION = 3;
|
||||||
|
}
|
@ -0,0 +1,17 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace Controllers\Navigation;
|
||||||
|
|
||||||
|
|
||||||
|
use BusinessLogic\Navigation\CustomNavElementHandler;
|
||||||
|
|
||||||
|
class CustomNavElementController {
|
||||||
|
static function getAll() {
|
||||||
|
global $applicationContext, $hesk_settings;
|
||||||
|
|
||||||
|
/* @var $handler CustomNavElementHandler */
|
||||||
|
$handler = $applicationContext->get[CustomNavElementHandler::class];
|
||||||
|
|
||||||
|
output($handler->getAllCustomNavElements($hesk_settings));
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,22 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace DataAccess\Navigation;
|
||||||
|
|
||||||
|
|
||||||
|
use DataAccess\CommonDao;
|
||||||
|
|
||||||
|
class CustomNavElementGateway extends CommonDao {
|
||||||
|
function getAllCustomNavElements($heskSettings) {
|
||||||
|
$this->init();
|
||||||
|
|
||||||
|
$rs = hesk_dbQuery("SELECT `t2`.`id` AS `xref_id`, `t2`.*, `t1`.* FROM `" . hesk_dbEscape($heskSettings['db_pfix']) . "custom_nav_element` AS `t1`
|
||||||
|
INNER JOIN `" . hesk_dbEscape($heskSettings['db_pfix']) . "custom_nav_element_to_text` AS `t2`
|
||||||
|
ON `t1`.`id` = `t2`.`nav_element_id`");
|
||||||
|
|
||||||
|
while ($row = hesk_dbFetchAssoc($rs)) {
|
||||||
|
var_dump($row);
|
||||||
|
}
|
||||||
|
|
||||||
|
$this->close();
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue