핵심 확장자를 확장하려고 시도했습니다 felogin
"feloginextended"라는 추가 확장명을 사용했습니다.TYPO3 7.6.10 : felogin 확장을 확장하는 방법은 무엇입니까?
은 내가 first_name
내 로그 아웃 포뮬러로 현재 사용자의 last_name
속성을 추가 할 수 있습니다.
이 내 오버라이드 (override) 템플릿 (단지 로그 아웃 부분)입니다 :
<!--###TEMPLATE_LOGOUT###-->
<form class="login-form" action="###ACTION_URI###" target="_top" method="post">
<div>
<div class="user">###FIRSTNAME### ###LASTNAME###</div>
<a class="page-link-button" href="http://tf.lightblue.eu/index.php?id=14">Meine Siegel</a>
<a class="page-link-button" href="http://tf.lightblue.eu/index.php?id=15">Mein Account</a>
<input class="form-btn" type="submit" name="submit" value="Logout" />
</div>
<div class="felogin-hidden">
<input type="hidden" name="logintype" value="logout" />
<input type="hidden" name="pid" value="###STORAGE_PID###" />
<input type="hidden" name="###PREFIXID###[noredirect]" value="###NOREDIRECT###" />
</div>
</form>
<!--###TEMPLATE_LOGOUT###-->
가 그럼 난 내 연장 컨트롤러
Classes\Xclass\FrontendLoginController
을 추가했다.
내가 원본 파일을 복사하여 마커를 설정하려면 showLogout 기능에 약간의 변화를 추가 : 그럼이
ext_typoscript_setup.txt
파일 내 템플릿을 등록
<?php
namespace Typo3\feloginextended\Xclass;
use \TYPO3\CMS\Frontend\Plugin\AbstractPlugin;
/**
* Plugin 'Website User Login' for the 'felogin' extension.
*/
class FrontendLoginController extends AbstractPlugin
{
/**
* Shows logout form
*
* @return string The content.
*/
protected function showLogout()
{
$subpart = $this->cObj->getSubpart($this->template, '###TEMPLATE_LOGOUT###');
$subpartArray = ($linkpartArray = array());
$markerArray['###STATUS_HEADER###'] = $this->getDisplayText('status_header', $this->conf['logoutHeader_stdWrap.']);
$markerArray['###STATUS_MESSAGE###'] = $this->getDisplayText('status_message', $this->conf['logoutMessage_stdWrap.']);
$this->cObj->stdWrap($this->flexFormValue('message', 's_status'), $this->conf['logoutMessage_stdWrap.']);
$markerArray['###LEGEND###'] = $this->pi_getLL('logout', '', true);
$markerArray['###ACTION_URI###'] = $this->getPageLink('', array(), true);
$markerArray['###LOGOUT_LABEL###'] = $this->pi_getLL('logout', '', true);
$markerArray['###NAME###'] = htmlspecialchars($this->frontendController->fe_user->user['name']);
$markerArray['###STORAGE_PID###'] = $this->spid;
$markerArray['###USERNAME###'] = htmlspecialchars($this->frontendController->fe_user->user['username']);
$markerArray['###USERNAME_LABEL###'] = $this->pi_getLL('username', '', true);
$markerArray['###NOREDIRECT###'] = $this->noRedirect ? '1' : '0';
$markerArray['###PREFIXID###'] = $this->prefixId;
// my custom changes-----------------------------------
$markerArray['###FIRSTNAME###'] = htmlspecialchars($this->frontendController->fe_user->user['first_name']);
$markerArray['###LASTNAME###'] = htmlspecialchars($this->frontendController->fe_user->user['last_name']);
//------------------------------------------------------
$markerArray = array_merge($markerArray, $this->getUserFieldMarkers());
if ($this->redirectUrl) {
// Use redirectUrl for action tag because of possible access restricted pages
$markerArray['###ACTION_URI###'] = htmlspecialchars($this->redirectUrl);
$this->redirectUrl = '';
}
return $this->cObj->substituteMarkerArrayCached($subpart, $markerArray, $subpartArray, $linkpartArray);
}
}
을 :
plugin.tx_felogin_pi1 {
templateFile = EXT:feloginextended/Resources/Private/Templates/FrontendLogin.html
}
그리고 마지막 단계는 컨트롤러의 등록입니다. ext_localconf.php
:
<?php
if (!defined('TYPO3_MODE')) {
die('Access denied.');
}
$GLOBALS['TYPO3_CONF_VARS']['SYS']['Objects']['TYPO3\\CMS\\Felogin\\Controller\\FrontendLoginController'] = array(
'className' => 'Typo3\\Feloginextended\\Xclass\\FrontendLoginController',
);
$GLOBALS['TYPO3_CONF_VARS']['SYS']['Objects']['tx_felogin_pi1'] = $GLOBALS['TYPO3_CONF_VARS']['SYS']['Objects']['TYPO3\\CMS\\Felogin\\Controller\\FrontendLoginController'];
felogin 확장명의 원본 파일에이 변경 사항을 추가하면 해결책이 생깁니다.
하지만이 방법은 매우 더럽고 미래에는 쉽게 felogin 확장을 업데이트 할 수 없습니다.
이 "해결책"을 찾았습니다 : https://forum.typo3.org/index.php/t/202500/ 하지만 저에게는 효과가 없습니다.
현재 사용자의 성과 이름을 로그 아웃 할 수있는 아이디어가 있거나 다른 방법이 있습니까?
편집 : 매번 http 오류 500이 발생합니다.
감사 펠릭스
Omg 이것은 매우 쉽습니다. 고마워. – Felix