Commit 54396121 authored by tomalo.stuttgart's avatar tomalo.stuttgart

Changed edit extensions and build adding tags.

git-svn-id: https://svn.typo3.org/TYPO3v4/Extensions/terfe/branches/ter_fe2@45826 735d13b6-9817-0410-8766-e36946ffe9aa
parent ebe329cc
......@@ -206,7 +206,7 @@
public function updateAction(Tx_TerFe2_Domain_Model_Extension $extension) {
$this->extensionRepository->update($extension);
$this->flashMessageContainer->add($this->translate('msg.extension_updated'));
$this->redirect('index');
$this->redirect('show', NULL, NULL, array('extension' => $extension->getUid()));
}
......
......@@ -38,6 +38,12 @@
protected $tagRepository;
/**
* @var Tx_TerFe2_Domain_Repository_ExtensionRepository
*/
protected $extensionRepository;
/**
* Initializes the current action
*
......@@ -45,6 +51,7 @@
*/
protected function initializeAction() {
$this->tagRepository = t3lib_div::makeInstance('Tx_TerFe2_Domain_Repository_TagRepository');
$this->extensionRepository = t3lib_div::makeInstance('Tx_TerFe2_Domain_Repository_ExtensionRepository');
// Pre-parse TypoScript setup
$this->settings = Tx_TerFe2_Utility_TypoScript::parse($this->settings);
......@@ -65,11 +72,13 @@
* Displays a form for creating a new Tag
*
* @param Tx_TerFe2_Domain_Model_Tag $newTag A fresh Tag object taken as a basis for the rendering
* @param Tx_TerFe2_Domain_Model_Extension $extension The extension to add this new tag
* @return void
* @dontvalidate $newTag
*/
public function newAction(Tx_TerFe2_Domain_Model_Tag $newTag = NULL) {
public function newAction(Tx_TerFe2_Domain_Model_Tag $newTag = NULL, Tx_TerFe2_Domain_Model_Extension $extension) {
$this->view->assign('newTag', $newTag);
$this->view->assign('extension', $extension);
}
......@@ -80,6 +89,9 @@
* @return void
*/
public function createAction(Tx_TerFe2_Domain_Model_Tag $newTag) {
if ($tag = $this->tagRepository->findByTitle($newTag->getTitle())) {
}
$this->tagRepository->add($newTag);
$this->flashMessageContainer->add($this->translate('msg.tag_created'));
$this->redirect('index');
......
......@@ -111,7 +111,7 @@
<label index="edit_category">Edit Category</label>
<label index="create_category">Create new Category</label>
<label index="new_tag">Create new Tag</label>
<label index="new_tag">Create new Tag for extension</label>
<label index="edit_tag">Edit Tag</label>
<label index="create_tag">Create new Tag</label>
......
......@@ -3,15 +3,19 @@
<f:section name="main">
<h2><f:translate key="edit_extension"/></h2>
<f:form method="post" action="update" name="extension" object="{extension}">
<label for="extKey"><f:translate key="tx_terfe2_domain_model_extension.ext_key" /></label><br />
<f:form.textbox property="extKey" /><br />
<f:form method="post" action="update" controller="Extension" name="extension" object="{extension}">
<label for="title"><f:translate key="tx_terfe2_domain_model_version.title" /></label><br />
<f:form.textbox size="40" property="lastVersion.title" /><br /><br />
<label for="description"><f:translate key="tx_terfe2_domain_model_version.description" /></label><br />
<f:form.textarea rows="5" cols="40" property="lastVersion.description" /><br /><br />
<label for="forgeLink"><f:translate key="tx_terfe2_domain_model_extension.forge_link" /></label><br />
<f:form.textbox property="forgeLink" /><br />
<f:form.textbox size="40" property="forgeLink" /><br />
<label for="hudsonLink"><f:translate key="tx_terfe2_domain_model_extension.hudson_link" /></label><br />
<f:form.textbox property="hudsonLink" /><br /><br />
<f:form.textbox size="40" property="hudsonLink" /><br /><br />
<f:form.submit value="{f:translate(key:'edit')}" />
</f:form>
......
......@@ -3,21 +3,18 @@
<f:section name="main">
<h2><f:translate key="single_extension"/></h2>
<table cellpadding="4">
<tr>
<td><f:translate key="tx_terfe2_domain_model_extension.ext_key" />:</td>
<td>{extension.extKey}</td>
</tr>
<tr>
<td><f:translate key="tx_terfe2_domain_model_extension.forge_link" />:</td>
<td>{extension.forgeLink}</td>
</tr>
<tr>
<td><f:translate key="tx_terfe2_domain_model_extension.hudson_link" />:</td>
<td>{extension.hudsonLink}</td>
</tr>
</table>
<br />
<div class="extension">
<h3>
<span class="icon"><terfe2:extIcon extension="{extension}" version="{extension.lastVersion}" alt="{extension.lastVersion.title}"></terfe2:extIcon></span>
{extension.lastVersion.title} ({extension.extKey})
</h3>
<p class="description">{extension.lastVersion.description}</p>
<p class="categories"><f:for each="{extension.categories}" as="{category}">{category.title}</f:for></p>
<p class="tags"><f:for each="{extension.tags}" as="tag" iteration="tagIterator">{tag.title}{f:if(condition: tagIterator.isLast, then:'', else, then: ', ')}</f:for><f:link.action action="new" controller="Tag" arguments="{extension : extension}"><f:translate key="create_tag" /></f:link.action> </p>
<p class="download"><f:link.action action="download" arguments="{extension : extension, version : extension.lastVersion}"><f:translate key="download"/></f:link.action></p>
<f:if condition="{extension.forgeLink}"><p class="forgeLink"><f:link.action absolute="{extension.forgeLink}"><f:translate key="tx_terfe2_domain_model_extension.forge_link" /></f:link.action></p></f:if>
<f:if condition="{extension.hudsonLink}"><p class="hudsonLink"><f:link.action absolute="{extension.hudsonLink}"><f:translate key="tx_terfe2_domain_model_extension.hudson_link" /></f:link.action></p></f:if>
</div>
<ul>
<li><f:link.action controller="Extension" action="download" arguments="{version : extension.lastVersion}"><f:translate key="download_t3x"/></f:link.action></li>
......
<f:layout name="Default" />
\ No newline at end of file
<f:layout name="Default" />
<f:section name="main">
<h2><f:translate key="new_tag"/></h2>
<h2><f:translate key="new_tag"/> {extension.title}</h2>
<f:form method="post" action="create" name="newTag" object="{newTag}">
<f:form method="post" action="create" name="tag" arguments="{extension : extension.uid}" object="{newTag}">
<label for="title"><f:translate key="tx_terfe2_domain_model_tag.title" /></label><br />
<f:form.textbox property="title" /><br /><br />
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment