Commit 99022085 authored by Dirk Wildt's avatar Dirk Wildt

0.0.6

parent 1b22cde9
......@@ -282,6 +282,9 @@ class CellController extends AbstractController
{
if( !$this->_setTicketForCellRangeRequirements() )
{
$cell->setTxTileTicket( SessionModuleUtility::getFormCellTicket() );
$cell->setGroupcss( SessionModuleUtility::getFormCellMode() );
$this->cellRepository->update( $cell );
return;
}
......@@ -305,6 +308,7 @@ class CellController extends AbstractController
{
$cell = $this->cellRepository->findByUid( $cellUid );
$cell->setTxTileTicket( SessionModuleUtility::getFormCellTicket() );
$cell->setGroupcss( SessionModuleUtility::getFormCellMode(), $xyRange, $cell );
$this->cellRepository->update( $cell );
}
......@@ -489,31 +493,6 @@ class CellController extends AbstractController
$this->view->assign( 'cell', $cell );
}
// /**
// * action grid: show tiles as a grid pattern
// *
// * @param \Netzmacher\Tile\Domain\Model\Area $area
// * @return void
// * @version 0.0.3
// * @since 0.0.1
// * @internal #t3728, #t3729
// */
// public function gridAction( \Netzmacher\Tile\Domain\Model\Area $area )
// {
//// $defaultOrderings = [
//// 'title' => \TYPO3\CMS\Extbase\Persistence\QueryInterface::ORDER_ASCENDING,
//// ];
//// $this->categoryRepository->setDefaultOrderings( $defaultOrderings );
//// $categories = $this->categoryRepository->findAll();
//
// $this->view->assign( 'cells', $this->_getAreaCells( $area ) );
// $this->view->assign( 'category', SessionModuleUtility::getTxTileCategory() );
// $this->view->assign( 'categories', $this->_getCategories() );
// $this->view->assign( 'size', '15' );
// $this->view->assign( 'grid-template-columns', $this->_getAutoElementsForGridCSS( $area ) );
// $this->view->assign( 'area', $area );
// }
/**
* initializeAction: is executed before any Action in the Controller.
*
......@@ -598,8 +577,6 @@ class CellController extends AbstractController
{
//$this->addFlashMessage( 'The object was updated. Please be aware that this action is publicly accessible unless you implement an access check. See https://docs.typo3.org/typo3cms/extensions/extension_builder/User/Index.html', '', \TYPO3\CMS\Core\Messaging\AbstractMessage::WARNING );
$this->_setTicketForCellRange( $cell );
$cell->setTxTileTicket( SessionModuleUtility::getFormCellTicket() );
$this->cellRepository->update( $cell );
$area = $this->request->getArgument( 'area' );
$arguments = [
'area' => $area
......
......@@ -2,6 +2,8 @@
namespace Netzmacher\Tile\Domain\Model;
use Netzmacher\Tile\Utility\Module\SessionModuleUtility;
/* * *
*
* This file is part of the "Book a tile!" Extension for TYPO3 CMS.
......@@ -80,6 +82,50 @@ class Cell extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity
*/
protected $y = 0;
/**
* Sets the groupcss
*
* @return string
*/
private function _groupCssCell(): string
{
return 'north east south west';
}
/**
* Sets the groupcss
*
* @param array $range: maxX, maxY, minX, minY
* @param \Netzmacher\Tile\Domain\Model\Cell $cell
* @return string
*/
private function _groupCssGroup( $range, \Netzmacher\Tile\Domain\Model\Cell $cell )
{
$cssClass = null;
$devider = null;
// var_dump(__METHOD__, __LINE__, $range, $cell->getX(), $cell->getY());
// die();
//
if($cell->getX() == $range['minX']){
$cssClass = $cssClass . $devider . 'west' ;
$devider = ' ';
}
if($cell->getX() == $range['maxX']){
$cssClass = $cssClass . $devider . 'east' ;
$devider = ' ';
}
if($cell->getY() == $range['minY']){
$cssClass = $cssClass . $devider . 'north' ;
$devider = ' ';
}
if($cell->getY() == $range['maxY']){
$cssClass = $cssClass . $devider . 'south' ;
$devider = ' ';
}
return $cssClass;
}
/**
* Returns the groupcss
*
......@@ -93,11 +139,31 @@ class Cell extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity
/**
* Sets the groupcss
*
* @param string $groupcss
* @return void
* @param string $mode: cell | group
* @param array $range: maxX, maxY, minX, minY
* @param \Netzmacher\Tile\Domain\Model\Cell $cell
* @return string
*/
public function setGroupcss( $groupcss )
public function setGroupcss( $mode, $range = array(), \Netzmacher\Tile\Domain\Model\Cell $cell = null )
{
if( SessionModuleUtility::getFormCellTicket() == 0 )
{
$this->groupcss = '';
return;
}
switch( $mode )
{
case('cell'):
$groupcss = $this->_groupCssCell();
break;
case('group'):
$groupcss = $this->_groupCssGroup( $range, $cell );
break;
default:
var_dump( __METHOD__, __LINE__, 'Error in switch! Unexpected value "' . $mode . '"' );
die();
}
$this->groupcss = $groupcss;
}
......
......@@ -67,7 +67,7 @@
<div class="{vh:Get.CssClass(uidGroup: cell.txTileTicket, uidCell: cell.uid, class: '{cssForGroup}', default: '')}">
<div class="{vh:Get.CssClass(uidTicket: cell.txTileTicket, uidCell: cell.uid, class: '{cssForTicket}', default: '')}">
<div class="{vh:Get.CssClass(uidCategory: cell.txTileCategory, uidCell: cell.uid, class: '{cssForCategory}', default: '{cssClassUndefinedCell}')}">
<f:link.action action="updateTicket" arguments="{cell : cell, area : area}" title="{cell.title}{vh:Get.CategoryField(uid: cell.txTileTicket, field: 'title', default: '', prefix: ', ')}">&nbsp;</f:link.action>
<f:link.action action="updateTicket" arguments="{cell : cell, area : area}" title="{cell.title}{vh:Get.TicketField(uid: cell.txTileTicket, field: 'title', default: '', prefix: ', ')}">&nbsp;</f:link.action>
<a href="#" title = "{cell.title}">&nbsp;</a>
</div>
</div>
......
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