CEC Hook Requests

Fragen zur Installation von CONTENIDO 4.9? Probleme bei der Konfiguration? Hinweise oder Fragen zur Entwicklung des Systemes oder zur Sicherheit?
Antworten
dominik.ziegler
Beiträge: 437
Registriert: Do 19. Jun 2008, 09:09

CEC Hook Requests

Beitrag von dominik.ziegler » Mi 5. Sep 2012, 12:41

Liebe Community,
in diesem Thread könnt ihr nun Hooks für die künftigen CONTENIDO-Versionen vorschlagen.

Aus eurem Vorschlag sollte hervor gehen, an welcher Stelle der Hook platziert und welche Parameter/Werte durch ihn beeinflusst werden können sollen.

Wir werden euch dann ebenfalls in diesem Thread mitteilen, ob der entsprechende Hook in der nächsten Version eingebaut wird.

Diesen Prozess möchten wir fest etablieren, sodass auch künftig Hooks von euch vorgeschlagen werden können, die dann in der nächsten Version zur Verfügung stehen.
Viele Grüße
Dominik

bbdrummer
Beiträge: 18
Registriert: Fr 2. Mär 2007, 16:49
Wohnort: Hürth, Germany
Kontaktdaten:

Re: CEC Hook Requests

Beitrag von bbdrummer » Mi 5. Sep 2012, 13:31

tolle Sache... gibt es denn eine Liste mit bereits verfügbaren, bzw den schon neu hinzugekommenen Hooks? :oops:

Dodger77
Beiträge: 3626
Registriert: Di 12. Okt 2004, 20:00
Wohnort: Voerde (Niederrhein)
Kontaktdaten:

Re: CEC Hook Requests

Beitrag von Dodger77 » Mi 5. Sep 2012, 14:06

Eine Liste (wenn auch nicht aktuell) gibt es hier. Ich kopier die schon mal zur Vereinfachung hier rein:
  • Chain: Contenido.Content.CreateCategoryLink
    This chain is called when a frontend link to a category should be created.
  • Chain: Contenido.Content.CreateArticleLink
    This chain is called when a frontend link to an article should be created.
  • Chain: Contenido.Content.SaveContentEntry
    This chain is called everytime when content is saved
  • Chain: Contenido.Upload.UploadPreprocess
    This chain is called everytime a file is uploaded
  • Chain: Contenido.Upload.UploadPostprocess
    This chain is called everytime after a file is uploaded and stored in its final position
  • Chain: Contenido.Frontend.CategoryAccess
    This chain is called everytime the user tries to access a protected category
  • Chain: Contenido.ArticleCategoryList.ListItems
    This chain is called when the category list in Content -> Articles should be build
  • Chain: Contenido.ArticleList.Columns
    This chain is used to process the columns of the article list.
  • Chain: Contenido.ArticleList.Actions
    This chain is used to process the actions for articles
  • Chain: Contenido.ArticleList.RenderColumn
    This chain is used to render a single column for a specific article
  • Chain: Contenido.ArticleList.RenderAction
    This chain is used to render a single action for a specific article
  • Chain: Contenido.CategoryList.Columns
    This chain is used to process the columns of the category list.
  • Chain: Contenido.CategoryList.RenderColumn
    This chain is used to render a single column for a specific category
  • Chain: Contenido.Content.CopyArticle
    This chain is called everytime when an article is duplicated
  • Chain: Contenido.Content.CreateMetatags
    This chain is used to build up an user defined metatag array
  • Chain: Contenido.Frontend.AllowEdit
    This chain is used when an article is about to be edited. This chain can be used to prevent users to edit certain articles, e.g. for workflows or for special types of articles.
  • Chain: Contenido.Permissions.User.Areas
    This chain returns all areas which should appear in the user rights management.
  • Chain: Contenido.Permissions.User.GetAreaName
    This chain returns the localized area name for a technical area name.
  • Chain: Contenido.Permissions.User.GetAreaEditFilename
    This chain returns the filename required for the permission editor.
  • Chain: Contenido.Permissions.FrontendUser.AfterDeletion
    This chain function is called after a frontend user has been deleted from the database
  • Chain: Contenido.Permissions.Group.Areas
    This chain returns all areas which should appear in the group rights management.
  • Chain: Contenido.Permissions.Group.GetAreaName
    This chain returns the localized area name for a technical area name.
  • Chain: Contenido.Permissions.Group.GetAreaEditFilename
    This chain returns the filename required for the permission editor.
  • Chain: Contenido.Article.RegisterCustomTab
    This chain registers a custom tab into the main article subnavigation (Overview/Properties/Configuration/Editor/Preview/***)
  • Chain: Contenido.Article.GetCustomTabProperties
    This chain is called when the properties of a custom tabs need to be aquired. It is used to build the final URL for the editor.
  • Chain: Contenido.Frontend.BaseHrefGeneration
    This chain is called everytime the BASE HREF Tag is generated
  • Chain: Contenido.Upl_edit.Delete
    This chain function is called after a upl-file has been deleted
  • Chain: Contenido.Upl_edit.Rows
    This chain is used to process the rows of the upl-details list.
  • Chain: Contenido.Upl_edit.RenderRows
    This chain is used to render a single column for a specific article
  • Chain: Contenido.Upl_edit.SaveRows
    This chain is called everytime when upl-details is saved
  • Chain: Contenido.Action.str_newtree.AfterCall
    This chain is called while executing code for action "str_newtree", see table con_action
  • Chain: Contenido.Action.str_newcat.AfterCall
    This chain is called while executing code for action "str_newcat", see table con_action
  • Chain: Contenido.Action.str_renamecat.AfterCall
    This chain is called while executing code for action "str_renamecat", see table con_action
  • Chain: Contenido.Action.str_moveupcat.AfterCall
    This chain is called while executing code for action "str_moveupcat", see table con_action
  • Chain: Contenido.Action.str_movedowncat.AfterCall
    This chain is called while executing code for action "str_movedowncat", see table con_action
  • Chain Contenido.Action.str_movesubtree.AfterCall
    This chain is called while executing code for action str_movesubtree, see table con_action
  • Chain Contenido.Action.con_saveart.AfterCall
    This chain is called while executing code for action con_saveart, see table con_action
  • Chain Contenido.Article.conMoveArticles_Loop
    This chain is called while looping articles which should be moved for the time management function, see conMoveArticles()
  • Chain Contenido.Article.conCopyArtLang_AfterInsert
    This chain is called after execution of the insert statement during duplication of an article, see conCopyArtLang()
  • Chain Contenido.Article.conSyncArticle_AfterInsert
    This chain is called after execution of the insert statement during a article sync, see conSyncArticle()
  • Chain Contenido.Category.strSyncCategory_Loop
    This chain is called while looping categories which should be synchronized, see strSyncCategory()
  • Chain Contenido.Category.strCopyCategory
    This chain is called after a old category was copied to new category
  • Chain Contenido.Frontend.AfterLoadPlugins
    This chain is called in front_content.php and provides a possibility to execute userdefined functions after plugins are loaded.
  • Chain Contenido.Frontend.HTMLCodeOutput
    This chain is called in front_content.php after the output of the page was buffered.
  • Chain Contenido.Frontend.PreprocessUrlBuilding
    This chain is called by Contenido_Url->build() method an provides a way to modifiy the parameter which will be passed to the configured Url Builder
  • Chain Contenido.Frontend.PostprocessUrlBuilding
    This chain is called by Contenido_Url->build() method an provides a opportunity to modifiy a url created by configured Url Builder.
  • Chain Contenido.Content.conGenerateCode
    This chain is called in function conGenerateCode after code is created.

Dodger77
Beiträge: 3626
Registriert: Di 12. Okt 2004, 20:00
Wohnort: Voerde (Niederrhein)
Kontaktdaten:

Re: CEC Hook Requests

Beitrag von Dodger77 » Mi 5. Sep 2012, 14:07

In Anlehnung an Contenido.Upl_edit.Rows und Contenido.Upl_edit.RenderRows könnte man ggf. auch die Spalten der Übersichten in der Dateiverwaltung ergänzen.

xmurrix
Beiträge: 3143
Registriert: Do 21. Okt 2004, 11:08
Wohnort: Augsburg
Kontaktdaten:

Re: CEC Hook Requests

Beitrag von xmurrix » Fr 7. Sep 2012, 11:07

Auch eine Möglichkeit: Für jede "area" & "action" einen pre- und post-Hook definieren.

Es wäre generisch und man könnte eigene Funktionen für jede "area" & "action" definieren. Die Frage ist, ob es dadurch einen Mehrwert gibt, das können wir gerne hier diskutieren.

Als Nachteil sehe ich:
* Nicht alle Hooks sind brauchbar, vor allem für new-Aktionen, da die neue ID nicht bekannt ist
* Die View lässt sich schlecht anpassen.

Zur der View habe ich auch noch eine Anmerkung:
Während man eigene Funktionen in Aktionen in der Regel einfach über Hooks ausführen kann, ist die Anpassung der View doch nicht sehr einfach. Hier gibt es wenig Möglichkeiten und das Ausführen von Hooks an bestimmten Stellen, macht den Code unleserlicher und schwerer wartbar.

Seht ihr eine Möglichkeit, in Templates einfach Platzhalter (z. B. HTML Kommentar ähnlich wie in der Template Klasse) zu definieren, die dann gegen benutzerdefinierte Ausgaben erweitert werden können?
Die Ausgabe der Seite müsste dann in den Ausgabepuffer, um die Ersetzung vor der entgültigen Ausgabe zu machen.
Man kann allgemeine fixe Bereiche für den head (für zusätzliche css-/js-Dateien oder Meta Tags) und für body (vor uind nach dem Content) definieren. Für Tabellen/Listen müsste man sich eine Lösung überlegen.
CONTENIDO Downloads: CONTENIDO 4.10.1
CONTENIDO Links: Dokumentationsportal, FAQ, API-Dokumentation
CONTENIDO @ Github: CONTENIDO 4.10 - Mit einem Entwicklungszweig (develop-branch), das viele Verbesserungen/Optimierungen erhalten hat und auf Stabilität und Kompatibilität mit PHP 8.0 bis 8.2 getrimmt wurde.

josh
Beiträge: 156
Registriert: Do 24. Jun 2004, 09:25
Wohnort: Ahlen
Kontaktdaten:

Re: CEC Hook Requests

Beitrag von josh » Sa 31. Aug 2013, 17:36

Hallo,

wie funktioniert Chain in Contenido 4.9?

Früher konnte ich eine Chain in den Ordner plugins hochladen und im Unterordner inludes/config.plugin.php registrieren.

Code: Alles auswählen

 function tidy($htmlCode) 
{

...
				
    return $htmlCode;
}


// get cec registry instance
$_cecRegistry = cApiCECRegistry::getInstance();

// add a function to Contenido Extension Chainer
$_cecRegistry->addChainFunction('Contenido.Frontend.HTMLCodeOutput', 'tidy');
Verfügbare Chains wurden früher in der Chain-Konfigurationsdatei "/contenido/includes/config.chains.php" definiert.
Die Datei gibt es nicht mehr. Ein gibt einen neuen ordner /web/contenido/includes/chains.
In den Chains dort stehen aber nur functionen.

Unter /docs/techref/plugins/Contenido Extension Chainer.pdf steht noch die alte Anleitung (Updated: 2004-10-21) in der neuen Version.

Viele Grüße ans Team

josh

dominik.ziegler
Beiträge: 437
Registriert: Do 19. Jun 2008, 09:09

Re: CEC Hook Requests

Beitrag von dominik.ziegler » Sa 31. Aug 2013, 17:44

Die Dateien wurden als Teil der Konfiguration verschoben in den Ordner der jeweiligen Laufzeitumgebung in data/config/ und heißen config.chains.php und config.chains.load.php. Von der Logik hat sich am Chain System in der 4.9 nichts geändert.
Viele Grüße
Dominik

josh
Beiträge: 156
Registriert: Do 24. Jun 2004, 09:25
Wohnort: Ahlen
Kontaktdaten:

Re: CEC Hook Requests

Beitrag von josh » Sa 31. Aug 2013, 18:16

Danke für die schnelle Antwort,

das hatte ich übersehen. Ich denke das ich damit klar komme.

Ich baue meine Chains mal ein und berichte darüber.

Danke

josh

josh
Beiträge: 156
Registriert: Do 24. Jun 2004, 09:25
Wohnort: Ahlen
Kontaktdaten:

Re: CEC Hook Requests

Beitrag von josh » Sa 14. Sep 2013, 14:32

Hallo,

mit den Chains funktioniert alles problemlos.

Es gibt aber eine Änderung.
Früher konnte ich außerhalb der Funktion Session Variablen speichern.
Also oberhalb der Function in der die Chain abgearbeitet wird.

Das geht jetzt nicht mehr, was eigentlich auch logisch ist.


Viele Grüße

josh

Antworten