XCL Web Application Platform 2.5.0
The XoopsCube Legacy Project
Loading...
Searching...
No Matches
AssetPreload.class.php
1<?php
10
11if (!defined('XOOPS_ROOT_PATH')) {
12 exit();
13}
14
15require_once XOOPS_MODULE_PATH.'/profile/class/FieldType.class.php';
16
18{
22 public function preBlockFilter()
23 {
24 if (!$this->mRoot->mContext->hasAttribute('module.profile.HasSetAssetManager')) {
25 $delegate =new XCube_Delegate();
26 $delegate->register('Module.profile.Event.GetAssetManager');
27 $delegate->add([&$this, 'getManager']);
28 $this->mRoot->mContext->setAttribute('module.profile.HasSetAssetManager', true);
29 }
30 $file = XOOPS_MODULE_PATH.'/profile/class/DelegateFunctions.class.php';
31 $this->mRoot->mDelegateManager->add('Legacy_Profile.SaveProfile', 'Profile_Delegate::saveProfile', $file);
32 $this->mRoot->mDelegateManager->add('Legacy_Profile.GetDefinition', 'Profile_Delegate::getDefinition', $file);
33 $this->mRoot->mDelegateManager->add('Legacy_Profile.GetProfile', 'Profile_Delegate::getProfile', $file);
34 $this->mRoot->mDelegateManager->add('Legacy_Profile.SetupActionForm', 'Profile_Delegate::setupActionForm', $file);
35 $this->mRoot->mDelegateManager->add('Legacy_Profile.LoadActionForm', 'Profile_Delegate::loadActionForm', $file);
36 $this->mRoot->mDelegateManager->add('Legacy.Event.UserDelete', 'Profile_AssetPreload::deleteProfile');
37 $this->mRoot->mDelegateManager->add('Legacy.Admin.Event.UserDelete', 'Profile_AssetPreload::deleteProfile');
38 }
39
44 public function getManager(&$obj)
45 {
46 require_once XOOPS_MODULE_PATH . '/profile/class/AssetManager.class.php';
47 $obj = Profile_AssetManager::getSingleton();
48 }
49
54 public function deleteProfile(&$user)
55 {
56 $handler = Legacy_Utils::getModuleHandler('data', 'profile');
57 $handler->deleteAll(new Criteria('uid', $user->get('uid')), true);
58 }
59}
static getModuleHandler( $name, $dirname)
preBlockFilter()
[Abstract] Executes the logic, when the controller executes preBlockFilter().
[Final] Used for the simple mechanism for common delegation in XCube.