Skip to content

Commit d52c008

Browse files
committedDec 13, 2011
[CHORE] Tweaks in the extension builder
1 parent 5e4e167 commit d52c008

File tree

17 files changed

+575
-1
lines changed

17 files changed

+575
-1
lines changed
 
+132
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,132 @@
1+
<?php
2+
3+
/***************************************************************
4+
* Copyright notice
5+
*
6+
* (c) 2011 Zachary Davis <zach@castironcoding.com>, Cast Iron Coding, Inc
7+
*
8+
* All rights reserved
9+
*
10+
* This script is part of the TYPO3 project. The TYPO3 project is
11+
* free software; you can redistribute it and/or modify
12+
* it under the terms of the GNU General Public License as published by
13+
* the Free Software Foundation; either version 3 of the License, or
14+
* (at your option) any later version.
15+
*
16+
* The GNU General Public License can be found at
17+
* http://www.gnu.org/copyleft/gpl.html.
18+
*
19+
* This script is distributed in the hope that it will be useful,
20+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
21+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22+
* GNU General Public License for more details.
23+
*
24+
* This copyright notice MUST APPEAR in all copies of the script!
25+
***************************************************************/
26+
27+
28+
/**
29+
*
30+
*
31+
* @package cicregister
32+
* @license http://www.gnu.org/licenses/lgpl.html GNU Lesser General Public License, version 3 or later
33+
*
34+
*/
35+
class Tx_Cicregister_Controller_FEUserController extends Tx_Extbase_MVC_Controller_ActionController {
36+
37+
/**
38+
* fEUserRepository
39+
*
40+
* @var Tx_Cicregister_Domain_Repository_FEUserRepository
41+
*/
42+
protected $fEUserRepository;
43+
44+
/**
45+
* injectFEUserRepository
46+
*
47+
* @param Tx_Cicregister_Domain_Repository_FEUserRepository $fEUserRepository
48+
* @return void
49+
*/
50+
public function injectFEUserRepository(Tx_Cicregister_Domain_Repository_FEUserRepository $fEUserRepository) {
51+
$this->fEUserRepository = $fEUserRepository;
52+
}
53+
54+
/**
55+
* action list
56+
*
57+
* @return void
58+
*/
59+
public function listAction() {
60+
$fEUsers = $this->fEUserRepository->findAll();
61+
$this->view->assign('fEUsers', $fEUsers);
62+
}
63+
64+
/**
65+
* action show
66+
*
67+
* @param $fEUser
68+
* @return void
69+
*/
70+
public function showAction(Tx_Cicregister_Domain_Model_FEUser $fEUser) {
71+
$this->view->assign('fEUser', $fEUser);
72+
}
73+
74+
/**
75+
* action new
76+
*
77+
* @param $newFEUser
78+
* @dontvalidate $newFEUser
79+
* @return void
80+
*/
81+
public function newAction(Tx_Cicregister_Domain_Model_FEUser $newFEUser = NULL) {
82+
$this->view->assign('newFEUser', $newFEUser);
83+
}
84+
85+
/**
86+
* action create
87+
*
88+
* @param $newFEUser
89+
* @return void
90+
*/
91+
public function createAction(Tx_Cicregister_Domain_Model_FEUser $newFEUser) {
92+
$this->fEUserRepository->add($newFEUser);
93+
$this->flashMessageContainer->add('Your new FEUser was created.');
94+
$this->redirect('list');
95+
}
96+
97+
/**
98+
* action edit
99+
*
100+
* @param $fEUser
101+
* @return void
102+
*/
103+
public function editAction(Tx_Cicregister_Domain_Model_FEUser $fEUser) {
104+
$this->view->assign('fEUser', $fEUser);
105+
}
106+
107+
/**
108+
* action update
109+
*
110+
* @param $fEUser
111+
* @return void
112+
*/
113+
public function updateAction(Tx_Cicregister_Domain_Model_FEUser $fEUser) {
114+
$this->fEUserRepository->update($fEUser);
115+
$this->flashMessageContainer->add('Your FEUser was updated.');
116+
$this->redirect('list');
117+
}
118+
119+
/**
120+
* action delete
121+
*
122+
* @param $fEUser
123+
* @return void
124+
*/
125+
public function deleteAction(Tx_Cicregister_Domain_Model_FEUser $fEUser) {
126+
$this->fEUserRepository->remove($fEUser);
127+
$this->flashMessageContainer->add('Your FEUser was removed.');
128+
$this->redirect('list');
129+
}
130+
131+
}
132+
?>

‎Classes/Domain/Model/FEUser.php

+47
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
<?php
2+
3+
/***************************************************************
4+
* Copyright notice
5+
*
6+
* (c) 2011 Zachary Davis <zach@castironcoding.com>, Cast Iron Coding, Inc
7+
*
8+
* All rights reserved
9+
*
10+
* This script is part of the TYPO3 project. The TYPO3 project is
11+
* free software; you can redistribute it and/or modify
12+
* it under the terms of the GNU General Public License as published by
13+
* the Free Software Foundation; either version 3 of the License, or
14+
* (at your option) any later version.
15+
*
16+
* The GNU General Public License can be found at
17+
* http://www.gnu.org/copyleft/gpl.html.
18+
*
19+
* This script is distributed in the hope that it will be useful,
20+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
21+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22+
* GNU General Public License for more details.
23+
*
24+
* This copyright notice MUST APPEAR in all copies of the script!
25+
***************************************************************/
26+
27+
28+
/**
29+
*
30+
*
31+
* @package cicregister
32+
* @license http://www.gnu.org/licenses/lgpl.html GNU Lesser General Public License, version 3 or later
33+
*
34+
*/
35+
class Tx_Cicregister_Domain_Model_FEUser extends Tx_Extbase_DomainObject_AbstractEntity {
36+
37+
/**
38+
* __construct
39+
*
40+
* @return void
41+
*/
42+
public function __construct() {
43+
44+
}
45+
46+
}
47+
?>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
<?php
2+
3+
/***************************************************************
4+
* Copyright notice
5+
*
6+
* (c) 2011 Zachary Davis <zach@castironcoding.com>, Cast Iron Coding, Inc
7+
*
8+
* All rights reserved
9+
*
10+
* This script is part of the TYPO3 project. The TYPO3 project is
11+
* free software; you can redistribute it and/or modify
12+
* it under the terms of the GNU General Public License as published by
13+
* the Free Software Foundation; either version 3 of the License, or
14+
* (at your option) any later version.
15+
*
16+
* The GNU General Public License can be found at
17+
* http://www.gnu.org/copyleft/gpl.html.
18+
*
19+
* This script is distributed in the hope that it will be useful,
20+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
21+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22+
* GNU General Public License for more details.
23+
*
24+
* This copyright notice MUST APPEAR in all copies of the script!
25+
***************************************************************/
26+
27+
28+
/**
29+
*
30+
*
31+
* @package cicregister
32+
* @license http://www.gnu.org/licenses/lgpl.html GNU Lesser General Public License, version 3 or later
33+
*
34+
*/
35+
class Tx_Cicregister_Domain_Repository_FEUserRepository extends Tx_Extbase_Persistence_Repository {
36+
37+
}
38+
?>

‎Configuration/TCA/FEUser.php

+98
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
<?php
2+
if (!defined ('TYPO3_MODE')) {
3+
die ('Access denied.');
4+
}
5+
6+
$TCA['tx_cicregister_domain_model_feuser'] = array(
7+
'ctrl' => $TCA['tx_cicregister_domain_model_feuser']['ctrl'],
8+
'interface' => array(
9+
'showRecordFieldList' => 'sys_language_uid, l10n_parent, l10n_diffsource, hidden',
10+
),
11+
'types' => array(
12+
'1' => array('showitem' => 'sys_language_uid;;;;1-1-1, l10n_parent, l10n_diffsource, hidden;;1,--div--;LLL:EXT:cms/locallang_ttc.xml:tabs.access,starttime, endtime'),
13+
),
14+
'palettes' => array(
15+
'1' => array('showitem' => ''),
16+
),
17+
'columns' => array(
18+
'sys_language_uid' => array(
19+
'exclude' => 1,
20+
'label' => 'LLL:EXT:lang/locallang_general.xml:LGL.language',
21+
'config' => array(
22+
'type' => 'select',
23+
'foreign_table' => 'sys_language',
24+
'foreign_table_where' => 'ORDER BY sys_language.title',
25+
'items' => array(
26+
array('LLL:EXT:lang/locallang_general.xml:LGL.allLanguages', -1),
27+
array('LLL:EXT:lang/locallang_general.xml:LGL.default_value', 0)
28+
),
29+
),
30+
),
31+
'l10n_parent' => array(
32+
'displayCond' => 'FIELD:sys_language_uid:>:0',
33+
'exclude' => 1,
34+
'label' => 'LLL:EXT:lang/locallang_general.xml:LGL.l18n_parent',
35+
'config' => array(
36+
'type' => 'select',
37+
'items' => array(
38+
array('', 0),
39+
),
40+
'foreign_table' => 'tx_cicregister_domain_model_feuser',
41+
'foreign_table_where' => 'AND tx_cicregister_domain_model_feuser.pid=###CURRENT_PID### AND tx_cicregister_domain_model_feuser.sys_language_uid IN (-1,0)',
42+
),
43+
),
44+
'l10n_diffsource' => array(
45+
'config' => array(
46+
'type' => 'passthrough',
47+
),
48+
),
49+
't3ver_label' => array(
50+
'label' => 'LLL:EXT:lang/locallang_general.xml:LGL.versionLabel',
51+
'config' => array(
52+
'type' => 'input',
53+
'size' => 30,
54+
'max' => 255,
55+
)
56+
),
57+
'hidden' => array(
58+
'exclude' => 1,
59+
'label' => 'LLL:EXT:lang/locallang_general.xml:LGL.hidden',
60+
'config' => array(
61+
'type' => 'check',
62+
),
63+
),
64+
'starttime' => array(
65+
'exclude' => 1,
66+
'l10n_mode' => 'mergeIfNotBlank',
67+
'label' => 'LLL:EXT:lang/locallang_general.xml:LGL.starttime',
68+
'config' => array(
69+
'type' => 'input',
70+
'size' => 13,
71+
'max' => 20,
72+
'eval' => 'datetime',
73+
'checkbox' => 0,
74+
'default' => 0,
75+
'range' => array(
76+
'lower' => mktime(0, 0, 0, date('m'), date('d'), date('Y'))
77+
),
78+
),
79+
),
80+
'endtime' => array(
81+
'exclude' => 1,
82+
'l10n_mode' => 'mergeIfNotBlank',
83+
'label' => 'LLL:EXT:lang/locallang_general.xml:LGL.endtime',
84+
'config' => array(
85+
'type' => 'input',
86+
'size' => 13,
87+
'max' => 20,
88+
'eval' => 'datetime',
89+
'checkbox' => 0,
90+
'default' => 0,
91+
'range' => array(
92+
'lower' => mktime(0, 0, 0, date('m'), date('d'), date('Y'))
93+
),
94+
),
95+
),
96+
),
97+
);
98+
?>

‎ExtensionBuilder.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"modules":[],"properties":{"backendModules":[],"description":"CIC User Registration is a flexible, extensible, extension for the creation of front-end user accounts that is built on top of ExtBase anf Fluid","emConf":{"category":"plugin","custom_category":"","priority":"","shy":false,"state":"alpha","version":""},"extensionKey":"cicregister","name":"CIC User Registration","originalExtensionKey":"","persons":[{"company":"Cast Iron Coding, Inc","email":"zach@castironcoding.com","name":"Zachary Davis","role":"Developer"}],"plugins":[{"key":"create","name":"Account Creation Interface"},{"key":"edit","name":"Account Edit Interface"},{"key":"login","name":"Login Interface"},{"key":"recoverPass","name":"Recover Password Interface"}]},"wires":[],"log":{"last_modified":"2011-12-13 10:42","extension_builder_version":"2.0.5","be_user":" (1)"}}
1+
{"modules":[],"properties":{"backendModules":[],"description":"CIC User Registration is a flexible, extensible, extension for the creation of front-end user accounts that is built on top of ExtBase anf Fluid","emConf":{"category":"plugin","custom_category":"","priority":"","shy":false,"state":"alpha","version":""},"extensionKey":"cicregister","name":"CIC User Registration","originalExtensionKey":"cicregister","persons":[{"company":"Cast Iron Coding, Inc","email":"zach@castironcoding.com","name":"Zachary Davis","role":"Developer"}],"plugins":[{"key":"create","name":"Account Creation Interface"},{"key":"edit","name":"Account Edit Interface"},{"key":"login","name":"Login Interface"},{"key":"recoverPass","name":"Recover Password Interface"}]},"wires":[],"log":{"last_modified":"2011-12-13 11:11","extension_builder_version":"2.0.5","be_user":" (1)"}}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
2+
<T3locallang>
3+
<meta type="array">
4+
<description>Context Sensitive Help (CSH) for table tx_cicregister_domain_model_feuser</description>
5+
<type>CSH</type>
6+
<csh_table>tx_cicregister_domain_model_feuser</csh_table>
7+
</meta>
8+
<data type="array">
9+
<languageKey index="default" type="array">
10+
</languageKey>
11+
</data>
12+
</T3locallang>
+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
<div class="tx-cicregister">
2+
<f:render section="main" />
3+
</div>

‎Resources/Private/Partials/FEUser/FormFields.html

Whitespace-only changes.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
<table class="tx-cicregister" >
2+
3+
</table>
+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<f:form.errors>
2+
<div class="error">
3+
{error.message}
4+
<f:if condition="{error.propertyName}">
5+
<p>
6+
<strong>{error.propertyName}</strong>:
7+
<f:for each="{error.errors}" as="errorDetail">
8+
{errorDetail.message}
9+
</f:for>
10+
</p>
11+
</f:if>
12+
</div>
13+
</f:form.errors>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<f:layout name="Default" />
2+
3+
This template displays a EDIT form for the current domain object.
4+
5+
If you modify this template, do not forget to change the overwrite settings
6+
in /Configuration/ExtensionBuilder/settings.yaml:
7+
Resources:
8+
Private:
9+
Templates:
10+
Edit.html: keep
11+
12+
Otherwise your changes will be overwritten the next time you save the extension in the extension builder
13+
14+
<f:section name="main">
15+
<h1>Edit FEUser</h1>
16+
17+
<f:flashMessages />
18+
19+
<f:render partial="FormErrors" />
20+
21+
<f:form method="post" action="update" name="fEUser" object="{fEUser}" >
22+
<f:render partial="FEUser/FormFields" arguments="{fEUser:fEUser}" />
23+
<f:form.submit value="Save" />
24+
</f:form>
25+
</f:section>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
<f:layout name="Default" />
2+
3+
This Template is responsible for creating a table of domain objects.
4+
5+
6+
If you modify this template, do not forget to change the overwrite settings
7+
in /Configuration/ExtensionBuilder/settings.yaml:
8+
Resources:
9+
Private:
10+
Templates:
11+
List.html: keep
12+
13+
Otherwise your changes will be overwritten the next time you save the extension in the extension builder
14+
15+
<f:section name="main">
16+
<h1>Listing for FEUser</h1>
17+
18+
<f:flashMessages />
19+
20+
<table class="tx_cicregister" >
21+
<tr>
22+
<th> </th>
23+
<th> </th>
24+
</tr>
25+
26+
<f:for each="{fEUsers}" as="fEUser">
27+
<tr>
28+
<td><f:link.action action="edit" arguments="{fEUser : fEUser}">Edit</f:link.action></td>
29+
<td><f:link.action action="delete" arguments="{fEUser : fEUser}">Delete</f:link.action></td>
30+
</tr>
31+
</f:for>
32+
</table>
33+
34+
<f:link.action action="new">New FEUser</f:link.action>
35+
</f:section>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<f:layout name="Default" />
2+
3+
This template displays a NEW form for the current domain object.
4+
5+
If you modify this template, do not forget to change the overwrite settings
6+
in /Configuration/ExtensionBuilder/settings.yaml:
7+
Resources:
8+
Private:
9+
Templates:
10+
New.html: keep
11+
12+
Otherwise your changes will be overwritten the next time you save the extension in the extension builder
13+
14+
<f:section name="main">
15+
<h1>New FEUser</h1>
16+
17+
<f:flashMessages />
18+
19+
<f:render partial="FormErrors" />
20+
21+
<f:form method="post" action="create" name="newFEUser" object="{newFEUser}">
22+
<f:render partial="FEUser/FormFields" />
23+
<f:form.submit value="Create new" />
24+
</f:form>
25+
</f:section>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<f:layout name="Default" />
2+
3+
This Template is responsible for displaying a single view for a domain object
4+
5+
If you modify this template, do not forget to change the overwrite settings
6+
in /Configuration/ExtensionBuilder/settings.yaml:
7+
Resources:
8+
Private:
9+
Templates:
10+
Show.html: keep
11+
12+
Otherwise your changes will be overwritten the next time you save the extension in the extension builder
13+
14+
<f:section name="main">
15+
<h1>Single View for FEUser</h1>
16+
17+
<f:flashMessages />
18+
<f:render partial="FEUser/Properties" arguments="{fEUser:fEUser}" />
19+
<f:link.action action="list">Back to list</f:link.action><br />
20+
<f:link.action action="new">New FEUser</f:link.action>
21+
</f:section>
Loading
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
<?php
2+
3+
/***************************************************************
4+
* Copyright notice
5+
*
6+
* (c) 2011 Zachary Davis <zach@castironcoding.com>, Cast Iron Coding, Inc
7+
*
8+
* All rights reserved
9+
*
10+
* This script is part of the TYPO3 project. The TYPO3 project is
11+
* free software; you can redistribute it and/or modify
12+
* it under the terms of the GNU General Public License as published by
13+
* the Free Software Foundation; either version 2 of the License, or
14+
* (at your option) any later version.
15+
*
16+
* The GNU General Public License can be found at
17+
* http://www.gnu.org/copyleft/gpl.html.
18+
*
19+
* This script is distributed in the hope that it will be useful,
20+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
21+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22+
* GNU General Public License for more details.
23+
*
24+
* This copyright notice MUST APPEAR in all copies of the script!
25+
***************************************************************/
26+
27+
/**
28+
* Test case for class Tx_Cicregister_Controller_FEUserController.
29+
*
30+
* @version $Id$
31+
* @copyright Copyright belongs to the respective authors
32+
* @license http://www.gnu.org/licenses/gpl.html GNU General Public License, version 3 or later
33+
*
34+
* @package TYPO3
35+
* @subpackage CIC User Registration
36+
*
37+
* @author Zachary Davis <zach@castironcoding.com>
38+
*/
39+
class Tx_Cicregister_Controller_FEUserControllerTest extends Tx_Extbase_Tests_Unit_BaseTestCase {
40+
/**
41+
* @var Tx_Cicregister_Domain_Model_FEUser
42+
*/
43+
protected $fixture;
44+
45+
public function setUp() {
46+
$this->fixture = new Tx_Cicregister_Domain_Model_FEUser();
47+
}
48+
49+
public function tearDown() {
50+
unset($this->fixture);
51+
}
52+
53+
/**
54+
* @test
55+
*/
56+
public function dummyMethod() {
57+
$this->markTestIncomplete();
58+
}
59+
60+
}
61+
?>
+61
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
<?php
2+
3+
/***************************************************************
4+
* Copyright notice
5+
*
6+
* (c) 2011 Zachary Davis <zach@castironcoding.com>, Cast Iron Coding, Inc
7+
*
8+
* All rights reserved
9+
*
10+
* This script is part of the TYPO3 project. The TYPO3 project is
11+
* free software; you can redistribute it and/or modify
12+
* it under the terms of the GNU General Public License as published by
13+
* the Free Software Foundation; either version 2 of the License, or
14+
* (at your option) any later version.
15+
*
16+
* The GNU General Public License can be found at
17+
* http://www.gnu.org/copyleft/gpl.html.
18+
*
19+
* This script is distributed in the hope that it will be useful,
20+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
21+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22+
* GNU General Public License for more details.
23+
*
24+
* This copyright notice MUST APPEAR in all copies of the script!
25+
***************************************************************/
26+
27+
/**
28+
* Test case for class Tx_Cicregister_Domain_Model_FEUser.
29+
*
30+
* @version $Id$
31+
* @copyright Copyright belongs to the respective authors
32+
* @license http://www.gnu.org/licenses/gpl.html GNU General Public License, version 3 or later
33+
*
34+
* @package TYPO3
35+
* @subpackage CIC User Registration
36+
*
37+
* @author Zachary Davis <zach@castironcoding.com>
38+
*/
39+
class Tx_Cicregister_Domain_Model_FEUserTest extends Tx_Extbase_Tests_Unit_BaseTestCase {
40+
/**
41+
* @var Tx_Cicregister_Domain_Model_FEUser
42+
*/
43+
protected $fixture;
44+
45+
public function setUp() {
46+
$this->fixture = new Tx_Cicregister_Domain_Model_FEUser();
47+
}
48+
49+
public function tearDown() {
50+
unset($this->fixture);
51+
}
52+
53+
/**
54+
* @test
55+
*/
56+
public function dummyTestToNotLeaveThisFileEmpty() {
57+
$this->markTestIncomplete();
58+
}
59+
60+
}
61+
?>

0 commit comments

Comments
 (0)
Please sign in to comment.