Project

General

Profile

Actions

Feature #19113

closed

Enable USER object to become USER_INT on the fly

Added by Dmitry Dulepov almost 16 years ago. Updated almost 13 years ago.

Status:
Closed
Priority:
Should have
Category:
Communication
Target version:
-
Start date:
2008-07-16
Due date:
% Done:

0%

Estimated time:
PHP Version:
5.2
Tags:
Complexity:
Sprint Focus:

Description

Sometimes USER objects need to become USER_INT. The attached patch makes it possible.

USER object now can call a method of tslib_cObj to convert themselves from USER to USER_INT. Any existing output will be discarded and they will be called again as a USER_INT object. Here is code example:

        if ($this->cObj->getUserObjType() == tslib_cObj::OT_USER) {
            $content = 'I am running as USER object now.';
            if (!$this->conf['allowCaching']) {
                $this->cObj->convertToUSER_INT();
                return '';
            }
        }
        else {
            $content .= 'I am running as USER_INT right now';
        }

Extension can (and should!) check if it is running as USER or USER_INT. Additionally extensions must have "includeLibs" just like any other USER_INT in their TS setup. But they must be declared as USER.

Patch and test extension are attached.

(issue imported from #M8985)


Files

T3X_user_user2int-0_0_0-z-200807161348.t3x (29.4 KB) T3X_user_user2int-0_0_0-z-200807161348.t3x Administrator Admin, 2008-07-16 12:44
8985_user2int.diff (3.81 KB) 8985_user2int.diff Administrator Admin, 2008-07-16 12:46
8985_user2int_v3.diff (4.02 KB) 8985_user2int_v3.diff Administrator Admin, 2008-09-12 09:10
Actions #1

Updated by Clemens Riccabona almost 13 years ago

  • Target version deleted (-1)

I just stumbled over this, and although it is quite old I feel that I have to post: THIS IS GREAT! :-)

For future visitors:

Read the last diff and do not copy the code from the example 'cause function name and constant name changed with integration due to CGL I think:

$this->cObj->getUserObjectType()
and
tslib_cObj::OBJECTTYPE_USER

For me this works great as a switch in connection with pageRenderer
(usual USER_INT plugins can't add headercode (JS/CSS) through the new pagerenderer ATM).

Actions

Also available in: Atom PDF