Skip to content
This repository has been archived by the owner on Feb 10, 2021. It is now read-only.

Commit

Permalink
initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
dittertp committed Aug 20, 2015
0 parents commit 9d650d8
Show file tree
Hide file tree
Showing 18 changed files with 1,008 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
.idea/
vendor/
target/
Packages/
composer.lock
19 changes: 19 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
language: php

php:
- 5.4
- 5.5
- 5.6
- 7.0
- hhvm

matrix:
allow_failures:
- php: hhvm

script:
- composer update
- ./vendor/bin/phing run-all-tests

notifications:
email: false
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?php
namespace TechDivision\ModuleBase\Controller\Module;

/**
* NOTICE OF LICENSE
*
* This source file is subject to version 3 of the GPL license,
* that is bundled with this package in the file LICENSE, and is
* available online at http://www.gnu.org/licenses/gpl.txt
* @author Philipp Dittert <[email protected]>
* @copyright 2015 TechDivision GmbH <[email protected]>
* @license http://www.gnu.org/licenses/gpl.txt GNU General Public License, version 3 (GPL-3.0)
* @link https://github.com/techdivision/TechDivision.ModuleBase
*/

use TYPO3\Flow\Annotations as Flow;

/**
* @Flow\Scope("singleton")
*/
class TechDivisionController extends \TYPO3\Neos\Controller\Module\AbstractModuleController
{
}
8 changes: 8 additions & 0 deletions Configuration/Policy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
resources:
methods:
TechDivision_ModuleBase_Controller_Module_TechDivision: 'method(TechDivision\ModuleBase\Controller\Module\TechDivisionController->indexAction())'

acls:
Everybody:
methods:
TechDivision_ModuleBase_Controller_Module_TechDivision: GRANT
11 changes: 11 additions & 0 deletions Configuration/Settings.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
TYPO3:
Neos:
moduleConfiguration:
widgetTemplatePathAndFileName: 'resource://TechDivision.ModuleBase/Private/Templates/Module/Widget.html'
modules:
techdivision:
label: 'TechDivision'
controller: '\TechDivision\ModuleBase\Controller\Module\TechDivisionController'
description: 'TechDivision Backend Section'
icon: 'icon-thumbs-up'
resource: 'TechDivision_ModuleBase_Controller_Module_TechDivision'
674 changes: 674 additions & 0 deletions LICENSE

Large diffs are not rendered by default.

23 changes: 23 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@

# Introduction

This Package provides the TechDivision backend module section.


# Installation

you need to add the package to your `composer.json`

``` bash
{
"require": {
"techdivision/modulebase": "1.0.*"
},
}
```

Install the package:

``` bash
composer update techdivision/modulebase
```
17 changes: 17 additions & 0 deletions Resources/Private/Layouts/BackendModule.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<div class="neos-content neos-indented neos-fluid-container">
<f:render section="subtitle" optional="1" />

<f:render partial="Module/FlashMessages" />

<f:form.validationResults>
<f:if condition="{validationResults.flattenedErrors}">
<ul class="neos-error">
<f:for each="{validationResults.flattenedErrors}" key="propertyPath" as="errors">
<li>{propertyPath}: <f:for each="{errors}" as="error">{error}</f:for></li>
</f:for>
</ul>
</f:if>
</f:form.validationResults>

<f:render section="content" />
</div>
14 changes: 14 additions & 0 deletions Resources/Private/Layouts/Default.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title><f:render section="Title" /></title>
<f:base />
</head>
<body>
<f:flashMessages class="flashmessages" />

<h1><f:render section="Title" /></h1>
<f:render section="Content" />
</body>
</html>
9 changes: 9 additions & 0 deletions Resources/Private/Partials/Module/FlashMessages.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<f:flashMessages as="flashMessages">
<f:if condition="{flashMessages -> f:count()} > 0">
<ul id="neos-notifications-inline">
<f:for each="{flashMessages}" as="flashMessage">
<li data-type="{flashMessage.severity -> f:format.case(mode: 'lower')}">{flashMessage}</li>
</f:for>
</ul>
</f:if>
</f:flashMessages>
32 changes: 32 additions & 0 deletions Resources/Private/Partials/Module/SubmoduleOverview.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{namespace neos=TYPO3\Neos\ViewHelpers}
<f:if condition="{moduleConfiguration.submodules}">
<div class="neos-row-fluid">
<f:for each="{moduleConfiguration.submodules}" key="submoduleIdentifier" as="submoduleConfiguration" iteration="iterator">
<f:if condition="{submoduleConfiguration.resource}">
<f:then>
<f:security.ifAccess resource="{submoduleConfiguration.resource}">
<f:render section="submodule" arguments="{_all}" />
</f:security.ifAccess>
</f:then>
<f:else>
<f:render section="submodule" arguments="{_all}" />
</f:else>
</f:if>
</f:for>
</div>
</f:if>

<f:section name="submodule">
<div class="neos-span4">
<neos:standaloneView templatePathAndFilename="resource://TechDivision.ModuleBase/Private/Templates/Module/Widget.html" arguments="{moduleConfiguration: moduleConfiguration, submoduleIdentifier: submoduleIdentifier, submoduleConfiguration: submoduleConfiguration}" />
</div>
<f:if condition="{iterator.cycle} % 3">
<f:else>
<f:if condition="{iterator.isLast}">
<f:else>
</div><div class="neos-row-fluid">
</f:else>
</f:if>
</f:else>
</f:if>
</f:section>
5 changes: 5 additions & 0 deletions Resources/Private/Templates/Module/TechDivision/Index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<f:layout name="BackendModule" />

<f:section name="content">
<f:render partial="Module/SubmoduleOverview" arguments="{_all}" />
</f:section>
25 changes: 25 additions & 0 deletions Resources/Private/Templates/Module/Widget.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{namespace neos=TYPO3\Neos\ViewHelpers}
<div class="widget {f:if(condition: submoduleConfiguration.actions, then: 'has-footer')}">
<div class="widget-header">
<f:if condition="{submoduleConfiguration.icon}">
<i class="{submoduleConfiguration.icon} neos-pull-left"></i>
</f:if>
<h3>
<neos:link.module path="{moduleConfiguration.path}/{submoduleIdentifier}">
{submoduleConfiguration.label}
</neos:link.module>
</h3>
</div>
<f:if condition="{submoduleConfiguration.description}">
<div class="widget-body">
<p>{submoduleConfiguration.description}</p>
</div>
</f:if>
<f:if condition="{submoduleConfiguration.actions}">
<div class="widget-footer">
<f:for each="{submoduleConfiguration.actions}" as="actionConfiguration" key="submoduleAction">
<neos:link.module title="{actionConfiguration.title}" class="neos-button neos-button-primary" path="{f:if(condition: actionConfiguration.path, then: actionConfiguration.path, else: '{moduleConfiguration.path}/{submoduleIdentifier}/{submoduleAction -> f:format.case(mode: \'lower\')}')}">{actionConfiguration.label}</neos:link.module>
</f:for>
</div>
</f:if>
</div>
15 changes: 15 additions & 0 deletions Resources/Private/Templates/Standard/Index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<f:layout name="Default" />

<f:section name="Title">Index view of Standard controller</f:section>

<f:section name="Content">
<h1>A freshly created Fluid template!</h1>
<p>Some data set by the controller:</p>
<ul>

<f:for each="{foos}" as="foo">
<li>{foo}</li>
</f:for>

</ul>
</f:section>
67 changes: 67 additions & 0 deletions build.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
<?xml version="1.0"?>
<project name="TechDivision.ModuleBase" default="run-all-tests">
<property environment="env" />
<property name="basedir" value="." />
<property name="php-src.dir" value="${basedir}/Classes"/>
<property name="php-target.dir" value="${basedir}/target"/>
<property name="codepool" value="vendor"/>
<property name="vendor.dir" value="${basedir}/${codepool}" />
<property name="phpmd.file" value="${basedir}/phpmd.xml" />

<target name="phplint">
<apply executable="php" failonerror="true">
<arg value="-l" />
<fileset dir="${php-src.dir}">
<include name="**/*.php" />
<exclude name="vendor/**" />
</fileset>
</apply>
</target>

<target name="prepare">
<mkdir dir="${php-target.dir}/reports" />
</target>

<target name="phpcs">
<exec executable="${vendor.dir}/bin/phpcs" dir="${basedir}" passthru="true" checkreturn="true">
<arg line="-n --extensions=php --standard=phpcs.xml ${php-src.dir}"/>
</exec>
</target>

<target name="phpcpd">
<exec executable="${vendor.dir}/bin/phpcpd" dir="${basedir}" passthru="true" checkreturn="true">
<arg line="--log-pmd ${php-target.dir}/reports/pmd-cpd.xml --exclude vendor ${php-src.dir}"/>
</exec>
</target>

<target name="phploc">
<exec executable="${vendor.dir}/bin/phploc" dir="${basedir}" passthru="true" checkreturn="true">
<arg line="--log-xml ${php-target.dir}/reports/phploc.xml ${php-src.dir}"/>
</exec>
</target>

<target name="phplint">
<apply executable="php" failonerror="true">
<arg value="-l" />
<fileset dir="${php-src.dir}">
<include name="**/*.php" />
<exclude name="vendor/**" />
</fileset>
</apply>
</target>

<target name="phpmd">
<exec executable="${vendor.dir}/bin/phpmd" dir="${basedir}" passthru="true">
<arg line="${php-src.dir} xml ${phpmd.file} --reportfile ${php-target.dir}/reports/pmd.xml" />
</exec>
</target>

<target name="run-all-tests" description="runs all tests">
<phingcall target="prepare" />
<phingcall target="phpcs" />
<phingcall target="phpcpd" />
<phingcall target="phplint" />
<phingcall target="phpmd" />
<phingcall target="phploc" />
</target>
</project>
33 changes: 33 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
"name": "techdivision/modulebase",
"type": "typo3-flow-package",
"description": "Provides the TechDivision backend module section",
"homepage" : "https://github.com/techdivision/TechDivision.ModuleBase",
"authors" : [{
"name" : "Philipp Dittert",
"email" : "[email protected]",
"homepage" : "https://www.techdivision.com"
}],
"require": {
"typo3/neos": "1.2.*"
},
"require-dev" : {
"phing/phing": "*",
"mikey179/vfsStream" : "*",
"php" : ">=5.4.0",
"phpmd/phpmd" : "2.1.*",
"phploc/phploc" : "2.0.*",
"pdepend/pdepend" : "2.0.*",
"sebastian/phpcpd" : "2.0.*",
"squizlabs/php_codesniffer": "2.*"
},
"autoload": {
"psr-0": {
"TechDivision\\ModuleBase": "Classes"
}
},
"support" : {
"issues" : "https://github.com/techdivision/TechDivision.ModuleBase/issues",
"source" : "https://github.com/techdivision/TechDivision.ModuleBase"
}
}
11 changes: 11 additions & 0 deletions phpcs.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?xml version="1.0"?>
<ruleset name="default rules">

<rule ref="PSR2"/>

<rule ref="PEAR.Commenting.FunctionComment"/>
<rule ref="PEAR.Commenting.InlineComment"/>
<rule ref="Generic.Commenting.Fixme"/>
<rule ref="Generic.Commenting.Todo"/>

</ruleset>
16 changes: 16 additions & 0 deletions phpmd.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<ruleset name="PHPMD rule set"
xmlns="http://pmd.sf.net/ruleset/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://pmd.sf.net/ruleset/1.0.0
http://pmd.sf.net/ruleset_xml_schema.xsd"
xsi:noNamespaceSchemaLocation="
http://pmd.sf.net/ruleset_xml_schema.xsd">
<description>
default ruleset
</description>

<rule ref="rulesets/unusedcode.xml" />
<rule ref="rulesets/codesize.xml" />

</ruleset>

0 comments on commit 9d650d8

Please sign in to comment.