Example #1
0
<?php

/**
 * @copyright Copyright (C) 1999-2012 eZ Systems AS. All rights reserved.
 * @license http://www.gnu.org/licenses/gpl-2.0.txt GNU General Public License v2
 * @version  2012.6
 * @package kernel
 */
$http = eZHTTPTool::instance();
$Module = $Params['Module'];
$tpl = eZTemplate::factory();
$tpl->setVariable('filter_proccessed', false);
$tpl->setVariable('time_event_created', false);
if ($http->hasPostVariable('RunFilterButton')) {
    eZNotificationEventFilter::process();
    $tpl->setVariable('filter_proccessed', true);
} else {
    if ($http->hasPostVariable('SpawnTimeEventButton')) {
        $event = eZNotificationEvent::create('ezcurrenttime', array());
        $event->store();
        $tpl->setVariable('time_event_created', true);
    }
}
$Result = array();
$Result['content'] = $tpl->fetch('design:notification/runfilter.tpl');
$Result['path'] = array(array('url' => false, 'text' => ezpI18n::tr('kernel/notification', 'Notification settings')));
if ( $clean['collaboration'] )
{
    $cli->output( "Removing all collaboration elements" );
    eZCollaborationItem::cleanup();
}

if ( $clean['collectedinformation'] )
{
    $cli->output( "Removing all collected information" );
    eZInformationCollection::cleanup();
}

if ( $clean['notification'] )
{
    $cli->output( "Removing all notifications events" );
    eZNotificationEvent::cleanup();
    eZNotificationCollection::cleanup();
    eZNotificationEventFilter::cleanup();
}

if ( $clean['searchstats'] )
{
    $cli->output( "Removing all search statistics" );
    eZSearchLog::removeStatistics();
}


$script->shutdown();

?>
 function handlerList()
 {
     $availableHandlers = eZNotificationEventFilter::availableHandlers();
     return array('result' => $availableHandlers);
 }
 static function cleanup()
 {
     $availableHandlers = eZNotificationEventFilter::availableHandlers();
     $db = eZDB::instance();
     $db->begin();
     foreach ($availableHandlers as $handler) {
         if ($handler !== false) {
             $handler->cleanup();
         }
     }
     $db->commit();
 }
 static function fetchHandlersForUser($time, $address)
 {
     $db = eZDB::instance();
     $time = (int) $time;
     $address = $db->escapeString($address);
     $query = "select distinct handler\n                  from eznotificationcollection,\n                       eznotificationcollection_item\n                  where eznotificationcollection_item.collection_id = eznotificationcollection.id and\n                        address='{$address}' and\n                        send_date != 0 and\n                        send_date < {$time}";
     $handlerResult = $db->arrayQuery($query);
     $handlers = array();
     $availableHandlers = eZNotificationEventFilter::availableHandlers();
     foreach ($handlerResult as $handlerName) {
         $handlers[$handlerName['handler']] = $availableHandlers[$handlerName['handler']];
     }
     return $handlers;
 }
Example #6
0
<?php
/**
 * @copyright Copyright (C) 1999-2011 eZ Systems AS. All rights reserved.
 * @license http://www.gnu.org/licenses/gpl-2.0.txt GNU General Public License v2
 * @version //autogentag//
 * @package kernel
 */

$http = eZHTTPTool::instance();

$Module = $Params['Module'];

$user = eZUser::currentUser();

$availableHandlers = eZNotificationEventFilter::availableHandlers();


$db = eZDB::instance();
$db->begin();
if ( $http->hasPostVariable( 'Store' ) )
{
    foreach ( $availableHandlers as $handler )
    {
        $handler->storeSettings( $http, $Module );
    }

}

foreach ( $availableHandlers as $handler )
{
    $handler->fetchHttpInput( $http, $Module );