PHP Classes

File: htdocs/xoops_lib/modules/protector/notification.php

Recommend this page to a friend!
  Packages of Michael Beck   Xoops 2.5   htdocs/xoops_lib/modules/protector/notification.php   Download  
File: htdocs/xoops_lib/modules/protector/notification.php
Role: Example script
Content type: text/plain
Description: Example script
Class: Xoops 2.5
Modular content management publication system
Author: By
Last change: Merge pull request #1239 from Andrew-Staves-Activ/notificationhandler_subscribe_success

Merge xswatch4
Date: 10 months ago
Size: 1,196 bytes
 

Contents

Class file image Download
<?php
// start hack by Trabis
if (!class_exists('ProtectorRegistry')) {
    exit('Registry not found');
}

$registry  = ProtectorRegistry::getInstance();
$mydirname = $registry->getEntry('mydirname');
$mydirpath = $registry->getEntry('mydirpath');
$language  = $registry->getEntry('language');
// end hack by Trabis

eval('
function ' . $mydirname . '_notify_iteminfo( $category, $item_id )
{
    return protector_notify_base( "' . $mydirname . '" , $category , $item_id ) ;
}
');

if (!function_exists('protector_notify_base')) {

    /**
     * @param $mydirname
     * @param $category
     * @param $item_id
     *
     * @return mixed
     */
    function protector_notify_base($mydirname, $category, $item_id)
    {
        include_once __DIR__ . '/include/common_functions.php';

        $db = XoopsDatabaseFactory::getDatabaseConnection();

        /** @var XoopsModuleHandler $module_handler */
        $module_handler = xoops_getHandler('module');
        $module         = $module_handler->getByDirname($mydirname);

        if ($category === 'global') {
            $item['name'] = '';
            $item['url']  = '';

            return $item;
        }
        return null;
    }
}