Actualización

This commit is contained in:
Xes
2025-04-10 12:49:05 +02:00
parent 4aff98e77b
commit 1cdd00920f
9151 changed files with 1800913 additions and 0 deletions

View File

@@ -0,0 +1,15 @@
<?php
/* For licensing terms, see /license.txt */
/**
* Interface CheckLoginCredentialsHookEventInterface.
*/
interface CheckLoginCredentialsHookEventInterface extends HookEventInterface
{
/**
* Call to all observers.
*
* @return bool
*/
public function notifyLoginCredentials();
}

View File

@@ -0,0 +1,13 @@
<?php
/* For licensing terms, see /license.txt */
/**
* Interface CheckLoginCredentialsHookObserverInterface.
*/
interface CheckLoginCredentialsHookObserverInterface extends HookObserverInterface
{
/**
* @return bool
*/
public function checkLoginCredentials(CheckLoginCredentialsHookEventInterface $event);
}

View File

@@ -0,0 +1,21 @@
<?php
/* For licensing terms, see /license.txt */
/**
* This file contains all Hook interfaces and their relation.
* They are used for Hook classes.
*
* @package chamilo.library.hook
*/
/**
* Interface HookAdminBlockEventInterface.
*/
interface HookAdminBlockEventInterface extends HookEventInterface
{
/**
* @param int $type
*
* @return int
*/
public function notifyAdminBlock($type);
}

View File

@@ -0,0 +1,19 @@
<?php
/* For licensing terms, see /license.txt */
/**
* This file contains all Hook interfaces and their relation.
* They are used for Hook classes.
*
* @package chamilo.library.hook
*/
/**
* Interface HookAdminBlockObserverInterface.
*/
interface HookAdminBlockObserverInterface extends HookObserverInterface
{
/**
* @return int
*/
public function hookAdminBlock(HookAdminBlockEventInterface $hook);
}

View File

@@ -0,0 +1,15 @@
<?php
/* For licensing terms, see /license.txt */
/**
* Interface HookConditionalLoginEventInterface.
*/
interface HookConditionalLoginEventInterface extends HookEventInterface
{
/**
* Call Conditional Login hooks.
*
* @return array
*/
public function notifyConditionalLogin();
}

View File

@@ -0,0 +1,22 @@
<?php
/* For licensing terms, see /license.txt */
/**
* Interface HookConditionalLoginObserverInterface.
*/
interface HookConditionalLoginObserverInterface extends HookObserverInterface
{
/**
* Return an associative array (callable, url) needed for Conditional Login.
* <code>
* [
* 'conditional_function' => function (array $userInfo) {},
* 'url' => '',
* ]
* </code>
* conditional_function returns false to redirect to the url and returns true to continue with the classical login.
*
* @return array
*/
public function hookConditionalLogin(HookConditionalLoginEventInterface $hook);
}

View File

@@ -0,0 +1,23 @@
<?php
/* For licensing terms, see /license.txt */
/**
* This file contains all Hook interfaces and their relation.
* They are used for Hook classes.
*
* @package chamilo.library.hook
*/
/**
* Interface HookCreateUserEventInterface.
*/
interface HookCreateCourseEventInterface extends HookEventInterface
{
/**
* Update all the observers.
*
* @param int $type
*
* @return int
*/
public function notifyCreateCourse($type);
}

View File

@@ -0,0 +1,19 @@
<?php
/* For licensing terms, see /license.txt */
/**
* This file contains all Hook interfaces and their relation.
* They are used for Hook classes.
*
* @package chamilo.library.hook
*/
/**
* Interface CreateUserHookInterface.
*/
interface HookCreateCourseObserverInterface extends HookObserverInterface
{
/**
* @return int
*/
public function hookCreateCourse(HookCreateCourseEventInterface $hook);
}

View File

@@ -0,0 +1,23 @@
<?php
/* For licensing terms, see /license.txt */
/**
* This file contains all Hook interfaces and their relation.
* They are used for Hook classes.
*
* @package chamilo.library.hook
*/
/**
* Interface HookCreateUserEventInterface.
*/
interface HookCreateUserEventInterface extends HookEventInterface
{
/**
* Update all the observers.
*
* @param int $type
*
* @return int
*/
public function notifyCreateUser($type);
}

View File

@@ -0,0 +1,19 @@
<?php
/* For licensing terms, see /license.txt */
/**
* This file contains all Hook interfaces and their relation.
* They are used for Hook classes.
*
* @package chamilo.library.hook
*/
/**
* Interface CreateUserHookInterface.
*/
interface HookCreateUserObserverInterface extends HookObserverInterface
{
/**
* @return int
*/
public function hookCreateUser(HookCreateUserEventInterface $hook);
}

View File

@@ -0,0 +1,16 @@
<?php
/* For licensing terms, see /license.txt */
/**
* Interface HookDocumentActionEventInterface.
*/
interface HookDocumentActionEventInterface extends HookEventInterface
{
/**
* @param $type
*
* @return mixed
*/
public function notifyDocumentAction($type);
}

View File

@@ -0,0 +1,16 @@
<?php
/* For licensing terms, see /license.txt */
/**
* Interface HookDocumentActionObserverInterface.
*/
interface HookDocumentActionObserverInterface extends HookObserverInterface
{
/**
* @param \HookDocumentActionEventInterface $hookvent
*
* @return mixed
*/
public function notifyDocumentAction(HookDocumentActionEventInterface $hookvent);
}

View File

@@ -0,0 +1,16 @@
<?php
/* For licensing terms, see /license.txt */
/**
* Interface HookDocumentItemActionEventInterface.
*/
interface HookDocumentItemActionEventInterface extends HookEventInterface
{
/**
* @param $type
*
* @return mixed
*/
public function notifyDocumentItemAction($type);
}

View File

@@ -0,0 +1,16 @@
<?php
/* For licensing terms, see /license.txt */
/**
* Interface HookDocumentItemActionObserverInterface.
*/
interface HookDocumentItemActionObserverInterface extends HookObserverInterface
{
/**
* @param \HookDocumentItemActionEventInterface $hookvent
*
* @return mixed
*/
public function notifyDocumentItemAction(HookDocumentItemActionEventInterface $hookvent);
}

View File

@@ -0,0 +1,8 @@
<?php
/* For licensing terms, see /license.txt */
interface HookDocumentItemViewEventInterface extends HookEventInterface
{
public function notifyDocumentItemView(): array;
}

View File

@@ -0,0 +1,11 @@
<?php
/* For licensing terms, see /license.txt */
/**
* Interface HookDocumentItemViewObserverInterface.
*/
interface HookDocumentItemViewObserverInterface extends HookObserverInterface
{
public function notifyDocumentItemView(HookDocumentItemViewEventInterface $hookvent): string;
}

View File

@@ -0,0 +1,8 @@
<?php
/* For licensing terms, see /license.txt */
interface HookLearningPathCreatedEventInterface extends HookEventInterface
{
public function notifyCreated();
}

View File

@@ -0,0 +1,8 @@
<?php
/* For licensing terms, see /license.txt */
interface HookLearningPathCreatedObserverInterface extends HookObserverInterface
{
public function hookCreated(HookLearningPathCreatedEventInterface $hookEvent);
}

View File

@@ -0,0 +1,13 @@
<?php
/* For licensing terms, see /license.txt */
/**
* Interface HookLearningPathEndEventInterface.
*/
interface HookLearningPathEndEventInterface extends HookEventInterface
{
/**
* @return mixed
*/
public function hookLearningPathEnd();
}

View File

@@ -0,0 +1,10 @@
<?php
/* For licensing terms, see /license.txt */
/**
* Interface HookLearningPathEndObserverInterface.
*/
interface HookLearningPathEndObserverInterface extends HookObserverInterface
{
public function notifyLearningPathEnd(HookLearningPathEndEventInterface $event);
}

View File

@@ -0,0 +1,13 @@
<?php
/* For licensing terms, see /license.txt */
/**
* Interface HookLearningPathItemViewedEventInterface.
*/
interface HookLearningPathItemViewedEventInterface extends HookEventInterface
{
/**
* @return mixed
*/
public function notifyLearningPathItemViewed();
}

View File

@@ -0,0 +1,15 @@
<?php
/* For licensing terms, see /license.txt */
/**
* Interface HookLearningPathItemViewedObserverInterface.
*/
interface HookLearningPathItemViewedObserverInterface extends HookObserverInterface
{
/**
* @param \HookLearningPathItemViewedEventInterface $event
*
* @return mixed
*/
public function hookLearningPathItemViewed(HookLearningPathItemViewedEventInterface $event);
}

View File

@@ -0,0 +1,21 @@
<?php
/* For licensing terms, see /license.txt */
/**
* Interface HookMyStudentsLpTrackingEventInterface.
*/
interface HookMyStudentsLpTrackingEventInterface extends HookEventInterface
{
/**
* @return array
*/
public function notifyTrackingHeader();
/**
* @param int $lpId
* @param int $studentId
*
* @return array
*/
public function notifyTrackingContent($lpId, $studentId);
}

View File

@@ -0,0 +1,34 @@
<?php
/* For licensing terms, see /license.txt */
/**
* Interface HookMyStudentsLpTrackingObserverInterface.
*/
interface HookMyStudentsLpTrackingObserverInterface extends HookObserverInterface
{
/**
* Return an associative array this value and attributes.
* <code>
* [
* 'value' => 'Users online',
* 'attrs' => ['class' => 'text-center'],
* ]
* </code>.
*
* @return array
*/
public function trackingHeader(HookMyStudentsLpTrackingEventInterface $hook);
/**
* Return an associative array this value and attributes.
* <code>
* [
* 'value' => '5 connected users ',
* 'attrs' => ['class' => 'text-center text-success'],
* ]
* </code>.
*
* @return array
*/
public function trackingContent(HookMyStudentsLpTrackingEventInterface $hook);
}

View File

@@ -0,0 +1,21 @@
<?php
/* For licensing terms, see /license.txt */
/**
* Interface HookMyStudentsQuizTrackingEventInterface.
*/
interface HookMyStudentsQuizTrackingEventInterface extends HookEventInterface
{
/**
* @return array
*/
public function notifyTrackingHeader();
/**
* @param int $quizId
* @param int $studentId
*
* @return array
*/
public function notifyTrackingContent($quizId, $studentId);
}

View File

@@ -0,0 +1,34 @@
<?php
/* For licensing terms, see /license.txt */
/**
* Interface HookMyStudentsQuizTrackingObserverInterface.
*/
interface HookMyStudentsQuizTrackingObserverInterface extends HookObserverInterface
{
/**
* Return an associative array this value and attributes.
* <code>
* [
* 'value' => 'Users online',
* 'attrs' => ['class' => 'text-center'],
* ]
* </code>.
*
* @return array
*/
public function trackingHeader(HookMyStudentsQuizTrackingEventInterface $hook);
/**
* Return an associative array this value and attributes.
* <code>
* [
* 'value' => '5 connected users ',
* 'attrs' => ['class' => 'text-center text-success'],
* ]
* </code>.
*
* @return array
*/
public function trackingContent(HookMyStudentsQuizTrackingEventInterface $hook);
}

View File

@@ -0,0 +1,20 @@
<?php
/* For licensing terms, see /license.txt */
/**
* This file contains Hook event interface for notification content.
*
* @package chamilo.library.hook
*/
/**
* Interface HookNotificationContentEventInterface.
*/
interface HookNotificationContentEventInterface extends HookEventInterface
{
/**
* @param int $type
*
* @return array
*/
public function notifyNotificationContent($type);
}

View File

@@ -0,0 +1,18 @@
<?php
/* For licensing terms, see /license.txt */
/**
* This file contains Hook observer interface for notification content.
*
* @package chamilo.library.hook
*/
/**
* Interface HookNotificationContentObserverInterface.
*/
interface HookNotificationContentObserverInterface extends HookObserverInterface
{
/**
* @return array
*/
public function hookNotificationContent(HookNotificationContentEventInterface $hook);
}

View File

@@ -0,0 +1,20 @@
<?php
/* For licensing terms, see /license.txt */
/**
* This file contains Hook event interface for notification title.
*
* @package chamilo.library.hook
*/
/**
* Interface HookNotificationTitleEventInterface.
*/
interface HookNotificationTitleEventInterface extends HookEventInterface
{
/**
* @param int $type
*
* @return array
*/
public function notifyNotificationTitle($type);
}

View File

@@ -0,0 +1,18 @@
<?php
/* For licensing terms, see /license.txt */
/**
* This file contains Hook observer interface for notification title.
*
* @package chamilo.library.hook
*/
/**
* Interface HookNotificationTitleObserverInterface.
*/
interface HookNotificationTitleObserverInterface extends HookObserverInterface
{
/**
* @return array
*/
public function hookNotificationTitle(HookNotificationTitleEventInterface $hook);
}

View File

@@ -0,0 +1,8 @@
<?php
/* For licensing terms, see /license.txt */
interface HookPortfolioCommentEditedEventInterface extends HookEventInterface
{
public function notifyCommentEdited();
}

View File

@@ -0,0 +1,8 @@
<?php
/* For licensing terms, see /license.txt */
interface HookPortfolioCommentEditedObserverInterface extends HookObserverInterface
{
public function hookCommentEdited(HookPortfolioCommentEditedEventInterface $hookEvent);
}

View File

@@ -0,0 +1,8 @@
<?php
/* For licensing terms, see /license.txt */
interface HookPortfolioCommentScoredEventInterface extends HookEventInterface
{
public function notifyCommentScored();
}

View File

@@ -0,0 +1,8 @@
<?php
/* For licensing terms, see /license.txt */
interface HookPortfolioCommentScoredObserverInterface extends HookObserverInterface
{
public function hookCommentScored(HookPortfolioCommentScoredEventInterface $hookEvent);
}

View File

@@ -0,0 +1,8 @@
<?php
/* For licensing terms, see /license.txt */
interface HookPortfolioDownloadedEventInterface extends HookEventInterface
{
public function notifyPortfolioDownloaded();
}

View File

@@ -0,0 +1,8 @@
<?php
/* For licensing terms, see /license.txt */
interface HookPortfolioDownloadedObserverInterface extends HookObserverInterface
{
public function hookPortfolioDownloaded(HookPortfolioDownloadedEventInterface $hookEvent);
}

View File

@@ -0,0 +1,14 @@
<?php
/* For licensing terms, see /license.txt */
/**
* Interface HookPortfolioItemAddedEventInterface.
*/
interface HookPortfolioItemAddedEventInterface extends HookEventInterface
{
/**
* @return void
*/
public function notifyItemAdded();
}

View File

@@ -0,0 +1,16 @@
<?php
/* For licensing terms, see /license.txt */
/**
* Interface HookPortfolioItemAddedObserverInterface.
*/
interface HookPortfolioItemAddedObserverInterface extends HookObserverInterface
{
/**
* @param \HookPortfolioItemAddedEventInterface $hookEvent
*
* @return mixed
*/
public function hookItemAdded(HookPortfolioItemAddedEventInterface $hookEvent);
}

View File

@@ -0,0 +1,14 @@
<?php
/* For licensing terms, see /license.txt */
/**
* Interface HookPortfolioItemCommentedEventInterface.
*/
interface HookPortfolioItemCommentedEventInterface extends HookEventInterface
{
/**
* @return void
*/
public function notifyItemCommented();
}

View File

@@ -0,0 +1,16 @@
<?php
/* For licensing terms, see /license.txt */
/**
* Interface HookPortfolioItemCommentedObserverInterface.
*/
interface HookPortfolioItemCommentedObserverInterface extends HookObserverInterface
{
/**
* @param \HookPortfolioItemCommentedEventInterface $hookEvent
*
* @return mixed
*/
public function hookItemCommented(HookPortfolioItemCommentedEventInterface $hookEvent);
}

View File

@@ -0,0 +1,8 @@
<?php
/* For licensing terms, see /license.txt */
interface HookPortfolioItemDeletedEventInterface extends HookEventInterface
{
public function notifyItemDeleted();
}

View File

@@ -0,0 +1,8 @@
<?php
/* For licensing terms, see /license.txt */
interface HookPortfolioItemDeletedHookObserverInterface extends HookObserverInterface
{
public function hookItemDeleted(HookPortfolioItemDeletedEventInterface $hookEvent);
}

View File

@@ -0,0 +1,8 @@
<?php
/* For licensing terms, see /license.txt */
interface HookPortfolioItemEditedEventInterface extends HookEventInterface
{
public function notifyItemEdited();
}

View File

@@ -0,0 +1,8 @@
<?php
/* For licensing terms, see /license.txt */
interface HookPortfolioItemEditedObserverInterface extends HookObserverInterface
{
public function hookItemEdited(HookPortfolioItemEditedEventInterface $hookEvent);
}

View File

@@ -0,0 +1,8 @@
<?php
/* For licensing terms, see /license.txt */
interface HookPortfolioItemHighlightedEventInterface extends HookEventInterface
{
public function notifyItemHighlighted();
}

View File

@@ -0,0 +1,8 @@
<?php
/* For licensing terms, see /license.txt */
interface HookPortfolioItemHighlightedObserverInterface extends HookObserverInterface
{
public function hookItemHighlighted(HookPortfolioItemHighlightedEventInterface $hookEvent);
}

View File

@@ -0,0 +1,8 @@
<?php
/* For licensing terms, see /license.txt */
interface HookPortfolioItemScoredEventInterface extends HookEventInterface
{
public function notifyItemScored();
}

View File

@@ -0,0 +1,8 @@
<?php
/* For licensing terms, see /license.txt */
interface HookPortfolioItemScoredObserverInterface extends HookObserverInterface
{
public function hookItemScored(HookPortfolioItemScoredEventInterface $hookEvent);
}

View File

@@ -0,0 +1,8 @@
<?php
/* For licensing terms, see /license.txt */
interface HookPortfolioItemViewedEventInterface extends HookEventInterface
{
public function notifyItemViewed(): void;
}

View File

@@ -0,0 +1,8 @@
<?php
/* For licensing terms, see /license.txt */
interface HookPortfolioItemViewedObserverInterface extends HookObserverInterface
{
public function hookItemViewed(HookPortfolioItemViewedEventInterface $hookEvent);
}

View File

@@ -0,0 +1,11 @@
<?php
/* For licensing terms, see /license.txt */
interface HookPortfolioItemVisibilityEventInterface extends HookEventInterface
{
/**
* @return void
*/
public function notifyItemVisibility();
}

View File

@@ -0,0 +1,11 @@
<?php
/* For licensing terms, see /license.txt */
interface HookPortfolioItemVisibilityObserverInterface extends HookObserverInterface
{
/**
* @return void
*/
public function hookItemVisibility(HookPortfolioItemVisibilityEventInterface $event);
}

View File

@@ -0,0 +1,13 @@
<?php
/* For licensing terms, see /license.txt */
/**
* Interface HookQuizEndEventInterface.
*/
interface HookQuizEndEventInterface extends HookEventInterface
{
/**
* @return void
*/
public function notifyQuizEnd();
}

View File

@@ -0,0 +1,15 @@
<?php
/* For licensing terms, see /license.txt */
/**
* Interface HookQuizEndObserverInterface.
*/
interface HookQuizEndObserverInterface
{
/**
* @param \HookQuizEndEventInterface $hookEvent
*
* @return mixed
*/
public function hookQuizEnd(HookQuizEndEventInterface $hookEvent);
}

View File

@@ -0,0 +1,13 @@
<?php
/* For licensing terms, see /license.txt */
/**
* Interface HookQuizQuestionAnsweredEventInterface.
*/
interface HookQuizQuestionAnsweredEventInterface extends HookEventInterface
{
/**
* @return mixed
*/
public function notifyQuizQuestionAnswered();
}

View File

@@ -0,0 +1,15 @@
<?php
/* For licensing terms, see /license.txt */
/**
* Interface HookQuizQuestionAnsweredObserverInterface.
*/
interface HookQuizQuestionAnsweredObserverInterface extends HookObserverInterface
{
/**
* @param \HookQuizQuestionAnsweredEventInterface $event
*
* @return mixed
*/
public function hookQuizQuestionAnswered(HookQuizQuestionAnsweredEventInterface $event);
}

View File

@@ -0,0 +1,23 @@
<?php
/* For licensing terms, see /license.txt */
/**
* This file contains all Hook interfaces and their relation.
* They are used for Hook classes.
*
* @package chamilo.library.hook
*/
/**
* Interface HookResubscribeEventInterface.
*/
interface HookResubscribeEventInterface extends HookEventInterface
{
/**
* Update all the observers.
*
* @param int $type
*
* @return int
*/
public function notifyResubscribe($type);
}

View File

@@ -0,0 +1,19 @@
<?php
/* For licensing terms, see /license.txt */
/**
* This file contains all Hook interfaces and their relation.
* They are used for Hook classes.
*
* @package chamilo.library.hook
*/
/**
* Interface ResubscribeHookInterface.
*/
interface HookResubscribeObserverInterface extends HookObserverInterface
{
/**
* @return int
*/
public function hookResubscribe(HookResubscribeEventInterface $hook);
}

View File

@@ -0,0 +1,23 @@
<?php
/* For licensing terms, see /license.txt */
/**
* This file contains all Hook interfaces and their relation.
* They are used for Hook classes.
*
* @package chamilo.library.hook
*/
/**
* Interface HookSkypeEventInterface.
*/
interface HookSkypeEventInterface extends HookEventInterface
{
/**
* Update all the observers.
*
* @param int $type
*
* @return int
*/
public function notifySkype($type);
}

View File

@@ -0,0 +1,21 @@
<?php
/* For licensing terms, see /license.txt */
/**
* This file contains all Hook interfaces and their relation.
* They are used for Hook classes.
*
* @package chamilo.library.hook
*/
/**
* Interface SkypeHookInterface.
*/
interface HookSkypeObserverInterface extends HookObserverInterface
{
/**
* @param HookSkypeObserverInterface $hook
*
* @return int
*/
public function hookEventSkype(HookSkypeEventInterface $hook);
}

View File

@@ -0,0 +1,23 @@
<?php
/* For licensing terms, see /license.txt */
/**
* This file contains all Hook interfaces and their relation.
* They are used for Hook classes.
*
* @package chamilo.library.hook
*/
/**
* Interface HookUpdateUserEventInterface.
*/
interface HookUpdateUserEventInterface extends HookEventInterface
{
/**
* Update all the observers.
*
* @param int $type
*
* @return int
*/
public function notifyUpdateUser($type);
}

View File

@@ -0,0 +1,19 @@
<?php
/* For licensing terms, see /license.txt */
/**
* This file contains all Hook interfaces and their relation.
* They are used for Hook classes.
*
* @package chamilo.library.hook
*/
/**
* Interface UpdateUserHookInterface.
*/
interface HookUpdateUserObserverInterface extends HookObserverInterface
{
/**
* @return int
*/
public function hookUpdateUser(HookUpdateUserEventInterface $hook);
}

View File

@@ -0,0 +1,21 @@
<?php
/* For licensing terms, see /license.txt */
/**
* This file contains all Hook interfaces and their relation.
* They are used for Hook classes.
*
* @package chamilo.library.hook
*/
/**
* Interface HookWSRegistrationEventInterface.
*/
interface HookWSRegistrationEventInterface extends HookEventInterface
{
/**
* @param int $type
*
* @return int
*/
public function notifyWSRegistration($type);
}

View File

@@ -0,0 +1,19 @@
<?php
/* For licensing terms, see /license.txt */
/**
* This file contains all Hook interfaces and their relation.
* They are used for Hook classes.
*
* @package chamilo.library.hook
*/
/**
* Interface HookWSRegistrationObserverInterface.
*/
interface HookWSRegistrationObserverInterface extends HookObserverInterface
{
/**
* @return int
*/
public function hookWSRegistration(HookWSRegistrationEventInterface $hook);
}

View File

@@ -0,0 +1,76 @@
<?php
/* For licensing terms, see /license.txt */
/**
* This file contains all Hook interfaces and their relation.
* They are used for Hook classes.
*
* Interface HookEventInterface.
*/
interface HookEventInterface
{
/**
* Attach an HookObserver.
*
* @see http://php.net/manual/en/splsubject.attach.php
*
* @param \HookObserverInterface| $observer <p>
* The <b>HookObserver</b> to attach.
* </p>
*/
public function attach(HookObserverInterface $observer);
/**
* Detach an HookObserver.
*
* @see http://php.net/manual/en/splsubject.detach.php
*
* @param \HookObserverInterface| $observer <p>
* The <b>HookObserver</b> to detach.
* </p>
*/
public function detach(HookObserverInterface $observer);
/**
* Return the singleton instance of Hook event.
*
* @return static
*/
public static function create();
/**
* Return an array containing all data needed by the hook observer to update.
*
* @return array
*/
public function getEventData();
/**
* Set an array with data needed by hooks.
*
* @return $this
*/
public function setEventData(array $data);
/**
* Return the event name refer to where hook is used.
*
* @return string
*/
public function getEventName();
/**
* Clear all hookObservers without detach them.
*
* @return mixed
*/
public function clearAttachments();
/**
* Detach all hook observers.
*
* @return $this
*/
public function detachAll();
}

View File

@@ -0,0 +1,74 @@
<?php
/* For licensing terms, see /license.txt */
/**
* This file contains all Hook interfaces and their relation.
* They are used for Hook classes.
*
* @package chamilo.library.hook
*/
interface HookManagementInterface
{
/**
* Insert hook into Database. Return insert id.
*
* @param string $eventName
* @param string $observerClassName
* @param int $type
*
* @return int
*/
public function insertHook($eventName, $observerClassName, $type);
/**
* Delete hook from Database. Return deleted rows number.
*
* @param string $eventName
* @param string $observerClassName
* @param int $type
*
* @return int
*/
public function deleteHook($eventName, $observerClassName, $type);
/**
* Update hook observer order by hook event.
*
* @param $eventName
* @param $type
* @param $newOrder
*
* @return int
*/
public function orderHook($eventName, $type, $newOrder);
/**
* Return a list an associative array where keys are the hook observer class name.
*
* @param $eventName
*
* @return array
*/
public function listHookObservers($eventName);
/**
* Check if hooks (event, observer, call) exist in Database, if not,
* Will insert them into their respective table.
*
* @param string $eventName
* @param string $observerClassName
*
* @return int
*/
public function insertHookIfNotExist($eventName = null, $observerClassName = null);
/**
* Return the hook call id identified by hook event, hook observer and type.
*
* @param string $eventName
* @param string $observerClassName
* @param int $type
*
* @return mixed
*/
public function getHookCallId($eventName, $observerClassName, $type);
}

View File

@@ -0,0 +1,31 @@
<?php
/* For licensing terms, see /license.txt */
/**
* This file contains all Hook interfaces and their relation.
* They are used for Hook classes.
*
* @package chamilo.library.hook
*/
interface HookObserverInterface
{
/**
* Return the singleton instance of Hook observer.
*
* @return static
*/
public static function create();
/**
* Return the path from the class, needed to store location or autoload later.
*
* @return string
*/
public function getPath();
/**
* Return the plugin name where is the Hook Observer.
*
* @return string
*/
public function getPluginName();
}

View File

@@ -0,0 +1,29 @@
<?php
/* For licensing terms, see /license.txt */
/**
* This file contains all Hook interfaces and their relation.
* They are used for Hook classes.
*
* @package chamilo.library.hook
*/
/**
* Interface HookPluginInterface
* This interface should be implemented by plugins to implements Hook Observer.
*/
interface HookPluginInterface
{
/**
* This method will call the Hook management insertHook to add Hook observer from this plugin.
*
* @return int
*/
public function installHook();
/**
* This method will call the Hook management deleteHook to disable Hook observer from this plugin.
*
* @return int
*/
public function uninstallHook();
}