/** * Returns the version object the process is linked to * @return eZContentObjectVersion */ public function version() { if ($this->versionObject === null) { $this->versionObject = eZContentObjectVersion::fetch($this->attribute('ezcontentobject_version_id')); } return $this->versionObject; }
$user = eZUser::currentUser(); if ( !$user->isLoggedIn() ) return $Module->handleError( eZError::KERNEL_ACCESS_DENIED, 'kernel' ); $userID = $user->id(); if ( $http->hasPostVariable( 'RemoveButton' ) ) { if ( $http->hasPostVariable( 'DeleteIDArray' ) ) { $deleteIDArray = $http->postVariable( 'DeleteIDArray' ); $db = eZDB::instance(); $db->begin(); foreach ( $deleteIDArray as $deleteID ) { $version = eZContentObjectVersion::fetch( $deleteID ); if ( $version instanceof eZContentObjectVersion ) { eZDebug::writeNotice( $deleteID, "deleteID" ); $version->removeThis(); } } $db->commit(); } } if ( $http->hasPostVariable( 'EmptyButton' ) ) { $versions = eZContentObjectVersion::fetchForUser( $userID ); $db = eZDB::instance(); $db->begin();
} else { $domain = getenv('HTTP_HOST'); $protocol = eZSys::serverProtocol(); $preFix = $protocol . "://" . $domain; $preFix .= eZSys::wwwDir(); $link = preg_replace("/^\\//e", "", $link); $link = $preFix . "/" . $link; } $viewParameters = array('offset' => $offset, 'limit' => $limit); $http = eZHTTPTool::instance(); $objectList = eZURLObjectLink::fetchObjectVersionList($urlID, $viewParameters); $urlViewCount = eZURLObjectLink::fetchObjectVersionCount($urlID); if ($Module->isCurrentAction('EditObject')) { if ($http->hasPostVariable('ObjectList')) { $versionID = $http->postVariable('ObjectList'); $version = eZContentObjectVersion::fetch($versionID); $contentObjectID = $version->attribute('contentobject_id'); $versionNr = $version->attribute('version'); $Module->redirect('content', 'edit', array($contentObjectID, $versionNr)); } } $tpl = eZTemplate::factory(); $tpl->setVariable('Module', $Module); $tpl->setVariable('url_object', $url); $tpl->setVariable('full_url', $link); $tpl->setVariable('object_list', $objectList); $tpl->setVariable('view_parameters', $viewParameters); $tpl->setVariable('url_view_count', $urlViewCount); $Result = array(); $Result['content'] = $tpl->fetch('design:url/view.tpl'); $Result['path'] = array(array('url' => false, 'text' => ezpI18n::tr('kernel/url', 'URL')), array('url' => false, 'text' => ezpI18n::tr('kernel/url', 'View')));