Skip to content
Code-Schnipsel Gruppen Projekte
Commit 6032dfd5 erstellt von Henning Leutz's avatar Henning Leutz :martial_arts_uniform:
Dateien durchsuchen

psr2

Übergeordneter 9d50525d
No related branches found
No related tags found
Keine zugehörigen Merge Requests gefunden
......@@ -2,7 +2,8 @@
FAQ Module
========
Frequently Asked Questions
Mit den FAQ Seitentypen ist es einfach FAQ für Ihre Benutzer anzulegen.
Paketname:
......@@ -12,6 +13,8 @@ Paketname:
Features (Funktionen)
--------
- FAQ Seitentypen
Installation
------------
......
......@@ -23,7 +23,7 @@
"autoload": {
"psr-0" : {
"QUI" : "lib/"
"QUI" : "src/"
}
}
}
......
<?xml version="1.0" encoding="UTF-8"?>
<events>
<event on="onSiteCreateChild" fire="\QUI\FAQ\Events::onChildCreate" />
<event on="onSiteCreateChild" fire="\QUI\FAQ\EventsHandler::onChildCreate" />
</events>
......@@ -6,13 +6,14 @@
namespace QUI\FAQ;
use QUI\Projects\Site\Edit;
/**
* FAQ Events
*
* @author www.pcsg.de (Henning Leutz)
*/
class Events
class EventsHandler
{
/**
* event on child create
......@@ -20,23 +21,25 @@ class Events
* @param integer $newId
* @param \QUI\Projects\Site\Edit $Parent
*/
static function onChildCreate($newId, $Parent)
public static function onChildCreate($newId, $Parent)
{
$type = $Parent->getAttribute( 'type' );
$type = $Parent->getAttribute('type');
if ( $type != 'quiqqer/faq:types/list' && $type != 'quiqqer/faq:types/category' ) {
if ($type != 'quiqqer/faq:types/list'
&& $type != 'quiqqer/faq:types/category'
) {
return;
}
$Project = $Parent->getProject();
$Site = new \QUI\Projects\Site\Edit( $Project, $newId );
$Site = new Edit($Project, $newId);
if ( $type == 'quiqqer/faq:types/list' ) {
$Site->setAttribute( 'type', 'quiqqer/faq:types/category' );
if ($type == 'quiqqer/faq:types/list') {
$Site->setAttribute('type', 'quiqqer/faq:types/category');
}
if ( $type == 'quiqqer/faq:types/category' ) {
$Site->setAttribute( 'type', 'quiqqer/faq:types/entry' );
if ($type == 'quiqqer/faq:types/category') {
$Site->setAttribute('type', 'quiqqer/faq:types/entry');
}
$Site->save();
......
......@@ -4,7 +4,7 @@
* FAQ Entry
*/
$Parent = $Site->getParent();
$Parent = $Site->getParent();
$parentType = $Parent->getAttribute('type');
if ($parentType == 'quiqqer/faq:types/list'
......@@ -12,7 +12,7 @@ if ($parentType == 'quiqqer/faq:types/list'
) {
QUI::getRewrite()->showErrorHeader(
303,
$Parent->getUrlRewritten().'#faq'.$Site->getId()
$Parent->getUrlRewritten() . '#faq' . $Site->getId()
);
exit;
......
0% oder .
You are about to add 0 people to the discussion. Proceed with caution.
Bearbeitung dieser Nachricht zuerst beenden!
Bitte registrieren oder zum Kommentieren