mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-06-01 20:29:29 +00:00
add Dashboard to HMVC
This commit is contained in:
@@ -37,6 +37,7 @@ class CisHmvc extends FHC_Controller
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
// TODO(chris): CI can't handle empty ("//") parameters
|
||||
$path = explode('/', uri_string());
|
||||
array_shift($path); // NOTE(chris): remove cis4/
|
||||
|
||||
@@ -63,62 +64,90 @@ class CisHmvc extends FHC_Controller
|
||||
if (!$current) {
|
||||
return $this->notfound();
|
||||
}
|
||||
switch ($current['orig']->template_kurzbz) {
|
||||
case 'redirect': {
|
||||
list ($url, $target) = $this->getRedirectUrlAndTarget($current['orig']->content);
|
||||
if (substr($url, 0, 1) == '#')
|
||||
{
|
||||
$controller = 'CisHmvc';
|
||||
$action = 'notfound';
|
||||
break;
|
||||
}
|
||||
if ($target)
|
||||
{
|
||||
$controller = 'CisHmvc';
|
||||
$action = 'redirect';
|
||||
array_unshift($params, $url);
|
||||
break;
|
||||
}
|
||||
if (preg_match('/^(\.\.\/|\.\/)*index\.ci\.php\/(.*)$/', $url, $matches))
|
||||
{
|
||||
list ($controller, $action, $p) = $this->getControllerMethodAndParamsFromUrl($matches[2]);
|
||||
if (!$controller)
|
||||
if (!$path)
|
||||
{
|
||||
$controller = 'CisHmvc/Dashboard';
|
||||
$action = 'index';
|
||||
}
|
||||
else
|
||||
{
|
||||
switch ($current['orig']->template_kurzbz) {
|
||||
case 'redirect': {
|
||||
list ($url, $target) = $this->getRedirectUrlAndTarget($current['orig']->content);
|
||||
if (substr($url, 0, 1) == '#')
|
||||
{
|
||||
$controller = 'CisHmvc';
|
||||
$action = 'notfound';
|
||||
break;
|
||||
}
|
||||
else
|
||||
if ($target)
|
||||
{
|
||||
while (count($p))
|
||||
array_unshift($params, array_pop($p));
|
||||
$controller = 'CisHmvc';
|
||||
$action = 'redirect';
|
||||
array_unshift($params, $url);
|
||||
break;
|
||||
}
|
||||
if (preg_match('/^(\.\.\/|\.\/)*index\.ci\.php\/(.*)$/', $url, $matches))
|
||||
{
|
||||
list ($controller, $action, $p) = $this->getControllerMethodAndParamsFromUrl($matches[2]);
|
||||
if (!$controller)
|
||||
{
|
||||
$controller = 'CisHmvc';
|
||||
$action = 'notfound';
|
||||
}
|
||||
else
|
||||
{
|
||||
while (count($p))
|
||||
array_unshift($params, array_pop($p));
|
||||
}
|
||||
break;
|
||||
}
|
||||
if (preg_match('/^(\.\.\/|\.\/)*cms\/news\.php(.*)$/', $url, $matches))
|
||||
{
|
||||
$controller = 'CisHmvc/Cms';
|
||||
$action = 'news';
|
||||
$p = parse_url($url . '?infoscreen=0', PHP_URL_QUERY);
|
||||
if ($p)
|
||||
{
|
||||
parse_str($p, $p);
|
||||
$params += array_values(array_merge([
|
||||
'infoscreen' => false,
|
||||
'studiengang_kz' => null,
|
||||
'semester' => null,
|
||||
'mischen' => true,
|
||||
'titel' => '',
|
||||
'edit' => false,
|
||||
'sichtbar' => true
|
||||
], $p));
|
||||
}
|
||||
break;
|
||||
}
|
||||
if (preg_match('/^(\.\.\/|\.\/)*(addons|cms|cis)\/(.*)$/', $url, $matches))
|
||||
{
|
||||
$controller = 'CisHmvc/Cms';
|
||||
$action = 'legacy';
|
||||
array_unshift($params, $matches[2] . "/" . $matches[3]);
|
||||
break;
|
||||
}
|
||||
|
||||
$controller = 'CisHmvc/cms';
|
||||
$action = 'debug';
|
||||
array_unshift($params, $current['orig']);
|
||||
break;
|
||||
}
|
||||
if (preg_match('/^(\.\.\/|\.\/)*(addons|cms|cis)\/(.*)$/', $url, $matches))
|
||||
{
|
||||
case 'contentohnetitel':
|
||||
case 'contentmittitel': {
|
||||
$controller = 'CisHmvc/Cms';
|
||||
$action = 'legacy';
|
||||
array_unshift($params, $matches[2] . "/" . $matches[3]);
|
||||
$action = 'content';
|
||||
array_unshift($params, $current['orig']->content_id);
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
$controller = 'CisHmvc/Cms';
|
||||
$action = 'debug';
|
||||
array_unshift($params, $current['orig']);
|
||||
break;
|
||||
}
|
||||
|
||||
$controller = 'CisHmvc/cms';
|
||||
$action = 'debug';
|
||||
array_unshift($params, $current['orig']);
|
||||
break;
|
||||
}
|
||||
case 'contentohnetitel':
|
||||
case 'contentmittitel': {
|
||||
$controller = 'CisHmvc/cms';
|
||||
$action = 'content';
|
||||
array_unshift($params, $current['orig']->content_id);
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
$controller = 'CisHmvc/cms';
|
||||
$action = 'debug';
|
||||
array_unshift($params, $current['orig']);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
class Dashboard extends Auth_Controller
|
||||
{
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct(
|
||||
array(
|
||||
'index' => 'user:r'
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------------------------------------------
|
||||
// Public methods
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
$this->load->view('CisHmvc/Dashboard.php');
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
$includesArray = array(
|
||||
'title' => 'FH-Complete',
|
||||
'customJSModules' => ['public/js/apps/Dashboard/Fhc.js'],
|
||||
'customCSSs' => [
|
||||
'public/css/components/dashboard.css'
|
||||
],
|
||||
);
|
||||
|
||||
$this->load->view('templates/FHC-Header', $includesArray);
|
||||
?>
|
||||
|
||||
<div id="content">
|
||||
<h2>Dashboard</h2>
|
||||
<hr>
|
||||
<fhc-dashboard dashboard="CIS"/>
|
||||
</div>
|
||||
|
||||
<?php $this->load->view('templates/FHC-Footer', $includesArray); ?>
|
||||
|
||||
Reference in New Issue
Block a user