本文整理汇总了PHP中eZUser::isUserObject方法的典型用法代码示例。如果您正苦于以下问题:PHP eZUser::isUserObject方法的具体用法?PHP eZUser::isUserObject怎么用?PHP eZUser::isUserObject使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类eZUser
的用法示例。
在下文中一共展示了eZUser::isUserObject方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: isUser
/**
* Check if the object that contains the ezpaex attribute is an user
*
* @return bool if the contentobject is a user or not
*/
function isUser()
{
$ezpo = eZPersistentObject::fetchObject(eZContentObject::definition(), null, array('id' => $this->attribute('contentobject_id')), true);
return eZUser::isUserObject($ezpo);
}
示例2: fetchHTTPInput
function fetchHTTPInput( $http, $base, $event )
{
$sectionsVar = $base . "_event_ezapprove_section_" . $event->attribute( "id" );
if ( $http->hasPostVariable( $sectionsVar ) )
{
$sectionsArray = $http->postVariable( $sectionsVar );
if ( in_array( '-1', $sectionsArray ) )
{
$sectionsArray = array( -1 );
}
$sectionsString = implode( ',', $sectionsArray );
$event->setAttribute( "data_text1", $sectionsString );
}
$languageVar = $base . "_event_ezapprove_languages_" . $event->attribute( "id" );
if ( $http->hasPostVariable( $languageVar ) )
{
$languageArray = $http->postVariable( $languageVar );
if ( in_array( '-1', $languageArray ) )
{
$languageArray = array();
}
$languageMask = 0;
foreach ( $languageArray as $languageID )
{
$languageMask |= $languageID;
}
$event->setAttribute( "data_int2", $languageMask );
}
$versionOptionVar = $base . "_event_ezapprove_version_option_" . $event->attribute( "id" );
if ( $http->hasPostVariable( $versionOptionVar ) )
{
$versionOptionArray = $http->postVariable( $versionOptionVar );
$versionOption = 0;
if ( is_array( $versionOptionArray ) )
{
foreach ( $versionOptionArray as $vv )
{
$versionOption = $versionOption | $vv;
}
}
$versionOption = $versionOption & eZApproveType::VERSION_OPTION_ALL;
$event->setAttribute( 'data_int3', $versionOption );
}
if ( $http->hasSessionVariable( 'BrowseParameters' ) )
{
$browseParameters = $http->sessionVariable( 'BrowseParameters' );
if ( isset( $browseParameters['custom_action_data'] ) )
{
$customData = $browseParameters['custom_action_data'];
if ( isset( $customData['event_id'] ) &&
$customData['event_id'] == $event->attribute( 'id' ) )
{
if ( !$http->hasPostVariable( 'BrowseCancelButton' ) and
$http->hasPostVariable( 'SelectedObjectIDArray' ) )
{
$objectIDArray = $http->postVariable( 'SelectedObjectIDArray' );
if ( is_array( $objectIDArray ) and
count( $objectIDArray ) > 0 )
{
switch( $customData['browse_action'] )
{
case 'AddApproveUsers':
{
foreach( $objectIDArray as $key => $userID )
{
if ( !eZUser::isUserObject( eZContentObject::fetch( $userID ) ) )
{
unset( $objectIDArray[$key] );
}
}
$event->setAttribute( 'data_text3', implode( ',',
array_unique( array_merge( $this->attributeDecoder( $event, 'approve_users' ),
$objectIDArray ) ) ) );
} break;
case 'AddApproveGroups':
{
$event->setAttribute( 'data_text4', implode( ',',
array_unique( array_merge( $this->attributeDecoder( $event, 'approve_groups' ),
$objectIDArray ) ) ) );
} break;
case 'AddExcludeUser':
{
$event->setAttribute( 'data_text2', implode( ',',
array_unique( array_merge( $this->attributeDecoder( $event, 'selected_usergroups' ),
$objectIDArray ) ) ) );
} break;
case 'AddExcludedGroups':
{
// TODO:
// .....
} break;
}
}
//.........这里部分代码省略.........
示例3: fetchHTTPInput
function fetchHTTPInput($http, $base, $event)
{
$eventData = eZApprove2Event::fetch($event->attribute('id'), $event->attribute('version'));
$sectionsVar = $base . "_event_ezapprove_section_" . $event->attribute("id");
if ($http->hasPostVariable($sectionsVar)) {
$sectionsArray = $http->postVariable($sectionsVar);
if (in_array('-1', $sectionsArray)) {
$sectionsArray = array(-1);
}
$sectionsString = implode(',', $sectionsArray);
$eventData->setAttribute("selected_sections", $sectionsString);
}
if ($http->hasPostVariable('ApproveType_' . $event->attribute('id'))) {
$eventData->setAttribute('approve_type', $http->postVariable('ApproveType_' . $event->attribute('id')));
}
if ($http->hasPostVariable('RequiredNumberApproves_' . $event->attribute('id'))) {
$eventData->setAttribute('num_approve_users', $http->postVariable('RequiredNumberApproves_' . $event->attribute('id')));
}
if ($http->hasPostVariable('ApproveOneAll_' . $event->attribute('id'))) {
$eventData->setAttribute('require_all_approve', $http->postVariable('ApproveOneAll_' . $event->attribute('id')));
}
if ($http->hasPostVariable('ApproveAllowAddApprover_' . $event->attribute('id'))) {
$eventData->setAttribute('allow_add_approver', $http->postVariable('ApproveAllowAddApprover_' . $event->attribute('id')));
}
if ($http->hasSessionVariable('BrowseParameters')) {
$browseParameters = $http->sessionVariable('BrowseParameters');
if (isset($browseParameters['custom_action_data'])) {
$customData = $browseParameters['custom_action_data'];
if (isset($customData['event_id']) && $customData['event_id'] == $event->attribute('id')) {
switch ($customData['browse_action']) {
case 'AddApproveUsers':
if ($http->hasPostVariable('SelectedObjectIDArray') and !$http->hasPostVariable('BrowseCancelButton')) {
$userIDArray = $http->postVariable('SelectedObjectIDArray');
foreach ($userIDArray as $key => $userID) {
if (!eZUser::isUserObject(eZContentObject::fetch($userID))) {
unset($userIDArray[$key]);
}
}
$eventData->setAttribute('approve_users', implode(',', array_unique(array_merge((array) $eventData->attribute('approve_user_list'), (array) $userIDArray))));
}
break;
case 'AddApproveGroups':
if ($http->hasPostVariable('SelectedObjectIDArray')) {
$userIDArray = $http->postVariable('SelectedObjectIDArray');
$eventData->setAttribute('approve_groups', implode(',', array_unique(array_merge((array) $eventData->attribute('approve_group_list'), (array) $userIDArray))));
}
break;
case 'AddExcludeUser':
if ($http->hasPostVariable('SelectedObjectIDArray') and !$http->hasPostVariable('BrowseCancelButton')) {
$userIDArray = $http->postVariable('SelectedObjectIDArray');
$eventData->setAttribute('selected_usergroups', implode(',', array_unique(array_merge((array) $eventData->attribute('selected_usergroup_list'), (array) $userIDArray))));
}
break;
}
$http->removeSessionVariable('BrowseParameters');
}
}
}
}