Skip to content

Commit

Permalink
Merge 304c104 into 6c5b6e2
Browse files Browse the repository at this point in the history
  • Loading branch information
sergey-galenko committed Oct 31, 2018
2 parents 6c5b6e2 + 304c104 commit d995343
Show file tree
Hide file tree
Showing 39 changed files with 98 additions and 52 deletions.
Expand Up @@ -10,7 +10,7 @@
/** */
namespace Applications\Factory\Form;

use \Zend\Form\Element\Select;
use \Core\Form\Element\Select;
use Interop\Container\ContainerInterface;
use Zend\ServiceManager\AbstractPluginManager;
use Zend\ServiceManager\FactoryInterface;
Expand Down
Expand Up @@ -12,7 +12,7 @@

use Core\Form\HeadscriptProviderInterface;
use Jobs\Entity\JobInterface;
use Zend\Form\Element\Select;
use Core\Form\Element\Select;

/**
* Select element for job titles
Expand Down
4 changes: 2 additions & 2 deletions module/Applications/src/Applications/Form/FactsFieldset.php
Expand Up @@ -39,7 +39,7 @@ public function init()
$this->add(
array(
'name' => 'willingnessToTravel',
'type' => '\Zend\Form\Element\Select',
'type' => '\Core\Form\Element\Select',
'options' => array(
'value_options' => array(
'' => '', // needed for jquery select2 to render the placeholder
Expand Down Expand Up @@ -96,7 +96,7 @@ public function init()
$this->add(
array(
'name' => 'drivingLicense',
'type' => '\Zend\Form\Element\Select',
'type' => '\Core\Form\Element\Select',
'options' => array(
'value_options' => array(
'' => '', // needed for jquery select2 to render the placeholder
Expand Down
Expand Up @@ -14,7 +14,7 @@
use Applications\Repository\Application as ApplicationsRepository;
use CoreTestUtils\TestCase\ServiceManagerMockTrait;
use CoreTestUtils\TestCase\TestInheritanceTrait;
use Zend\Form\Element\Select;
use Core\Form\Element\Select;
use Zend\ServiceManager\Factory\FactoryInterface;

/**
Expand Down
Expand Up @@ -15,7 +15,7 @@
use CoreTestUtils\TestCase\TestInheritanceTrait;
use CoreTestUtils\TestCase\TestSetterGetterTrait;
use Jobs\Entity\Job;
use Zend\Form\Element\Select;
use Core\Form\Element\Select;

/**
* Tests for \Applications\Form\Element\JobSelect
Expand Down
2 changes: 1 addition & 1 deletion module/Auth/src/Auth/Factory/Form/RoleSelectFactory.php
Expand Up @@ -11,7 +11,7 @@

use Interop\Container\ContainerInterface;
use Zend\ServiceManager\Factory\FactoryInterface;
use Zend\Form\Element\Select;
use Core\Form\Element\Select;
use Auth\Entity\User;

/**
Expand Down
2 changes: 1 addition & 1 deletion module/Auth/src/Auth/Form/UserInfoFieldset.php
Expand Up @@ -127,7 +127,7 @@ public function init()
$this->add(
array(
'name' => 'gender',
'type' => 'Zend\Form\Element\Select',
'type' => 'Core\Form\Element\Select',
'options' => [
'label' => /*@translate */ 'Salutation',
'value_options' => [
Expand Down
2 changes: 1 addition & 1 deletion module/Auth/src/Auth/Form/UserStatusFieldset.php
Expand Up @@ -79,7 +79,7 @@ public function init()
$this->add(
[
'name' => 'status',
'type' => 'Zend\Form\Element\Select',
'type' => 'Core\Form\Element\Select',
'options' => [
'label' => /*@translate */ 'Status',
'value_options' => $this->statusOptions
Expand Down
2 changes: 1 addition & 1 deletion module/Auth/test/AuthTest/Form/UserStatusFieldsetTest.php
Expand Up @@ -40,7 +40,7 @@ public function testInit()
$this->assertTrue($this->fieldset->has('status'));

$status = $this->fieldset->get('status');
$this->assertInstanceOf(\Zend\Form\Element\Select::class, $status);
$this->assertInstanceOf(\Core\Form\Element\Select::class, $status);
$this->assertSame([], $status->getValueOptions());
}

Expand Down
1 change: 1 addition & 0 deletions module/Core/config/module.config.php
Expand Up @@ -466,6 +466,7 @@
'SummaryFormButtonsFieldset' => 'Core\Form\SummaryFormButtonsFieldset',
'Checkbox' => 'Core\Form\Element\Checkbox',
'infoCheckBox' => 'Core\Form\Element\InfoCheckbox',
'Core/Select' => 'Core\Form\Element\Select',
'Core/ListFilterButtons' => '\Core\Form\ListFilterButtonsFieldset',
'Core/Datepicker' => 'Core\Form\Element\DatePicker',
'Core/FileUpload' => '\Core\Form\Element\FileUpload',
Expand Down
2 changes: 1 addition & 1 deletion module/Core/src/Core/Form/Element/Rating.php
Expand Up @@ -11,7 +11,7 @@
namespace Core\Form\Element;

use Zend\Form\Element;
use Zend\Form\Element\Select;
use Core\Form\Element\Select;
use Core\Entity\RatingInterface;

/**
Expand Down
44 changes: 44 additions & 0 deletions module/Core/src/Core/Form/Element/Select.php
@@ -0,0 +1,44 @@
<?php
/**
* YAWIK
*
* @filesource
* @copyright (c) 2013 - 2016 Cross Solution (http://cross-solution.de)
* @license MIT
*/

/** */
namespace Core\Form\Element;

use Zend\Form\Element\Select as ZfSelect;

/**
*
*
* @author Mathias Gelhausen <gelhausen@cross-solution.de>
*/
class Select extends ZfSelect implements ViewHelperProviderInterface
{
/**
* @var string
*/
protected $helper = 'formSelect';

/**
* @param string|\Zend\View\Helper\HelperInterface $helper
* @return $this|ViewHelperProviderInterface
*/
public function setViewHelper($helper)
{
$this->helper = $helper;
return $this;
}

/**
* @return string|\Zend\View\Helper\HelperInterface
*/
public function getViewHelper()
{
return $this->helper;
}
}
4 changes: 2 additions & 2 deletions module/Core/src/Core/Form/LocalizationSettingsFieldset.php
Expand Up @@ -27,7 +27,7 @@ public function init()

$this->add(
array(
'type' => 'Zend\Form\Element\Select',
'type' => 'Core\Form\Element\Select',
'name' => 'language',
'options' => array(
'label' => /* @translate */ 'choose your language',
Expand Down Expand Up @@ -59,7 +59,7 @@ public function init()

$this->add(
array(
'type' => 'Zend\Form\Element\Select',
'type' => 'Core\Form\Element\Select',
'name' => 'timezone',
'options' => array(
'label' => /* @translate */ 'choose your timzone',
Expand Down
2 changes: 1 addition & 1 deletion module/Core/src/Core/Form/Tree/Select.php
Expand Up @@ -13,7 +13,7 @@
use Core\Form\Hydrator\HydratorStrategyProviderInterface;
use Core\Form\Hydrator\HydratorStrategyProviderTrait;
use Traversable;
use Zend\Form\Element\Select as ZfSelect;
use Core\Form\Element\Select as ZfSelect;
use Zend\Form\Element;
use Zend\Form\ElementInterface;
use Zend\Form\Exception;
Expand Down
2 changes: 1 addition & 1 deletion module/Core/src/Core/Form/View/Helper/FormSimpleRow.php
Expand Up @@ -16,7 +16,7 @@
use Core\Form\ViewPartialProviderInterface;
use Core\Form\Element\ViewhelperProviderInterface;
use Zend\Form\Element\Button;
use Zend\Form\Element\Select;
use Core\Form\Element\Select;

class FormSimpleRow extends ZendFormRow
{
Expand Down
2 changes: 1 addition & 1 deletion module/Core/src/Core/Form/View/Helper/SummaryForm.php
Expand Up @@ -266,7 +266,7 @@ public function renderSummaryElement(ElementInterface $element)
? nl2br($element->getValue())
: $element->getValue();

if ('' != $elementValue && $element instanceof \Zend\Form\Element\Select) {
if ('' != $elementValue && $element instanceof \Core\Form\Element\Select) {
if ($summaryValue = $element->getOption('summary_value')) {
$elementValue = is_callable($summaryValue) ? $summaryValue() : $summaryValue;
} else {
Expand Down
1 change: 1 addition & 0 deletions module/Core/src/autoload_classmap.php
Expand Up @@ -148,6 +148,7 @@
'Core\Form\DisableCapableInterface' => __DIR__ . '/Core/Form/DisableCapableInterface.php',
'Core\Form\DisableElementsCapableInterface' => __DIR__ . '/Core/Form/DisableElementsCapableInterface.php',
'Core\Form\Element\Checkbox' => __DIR__ . '/Core/Form/Element/Checkbox.php',
'Core\Form\Element\Select' => __DIR__ . '/Core/Form/Element/Select.php',
'Core\Form\Element\DatePicker' => __DIR__ . '/Core/Form/Element/DatePicker.php',
'Core\Form\Element\DateRange' => __DIR__ . '/Core/Form/Element/DateRange.php',
'Core\Form\Element\Editor' => __DIR__ . '/Core/Form/Element/Editor.php',
Expand Down
2 changes: 1 addition & 1 deletion module/Core/test/CoreTest/Form/Tree/SelectTest.php
Expand Up @@ -13,7 +13,7 @@
use Core\Form\Hydrator\HydratorStrategyProviderInterface;
use Core\Form\Hydrator\HydratorStrategyProviderTrait;
use Core\Form\Tree\Select;
use Zend\Form\Element\Select as ZfSelect;
use Core\Form\Element\Select as ZfSelect;
use CoreTestUtils\TestCase\TestInheritanceTrait;
use CoreTestUtils\TestCase\TestUsesTraitsTrait;

Expand Down
12 changes: 6 additions & 6 deletions module/Cv/src/Cv/Form/LanguageSkillFieldset.php
Expand Up @@ -18,7 +18,7 @@ public function init()
$this->add(
array(
'name' => 'language',
'type' => 'Zend\Form\Element\Select',
'type' => 'Core\Form\Element\Select',
'options' => array(
'label' => 'Language',
'value_options' => NativeLanguageFieldset::$languagesOptions
Expand All @@ -34,7 +34,7 @@ public function init()
$this->add(
array(
'name' => 'levelListening',
'type' => 'Zend\Form\Element\Select',
'type' => 'Core\Form\Element\Select',
'options' => array(
'label' => /*@translate */ 'Listening',
'value_options' => array(
Expand All @@ -61,7 +61,7 @@ public function init()
$this->add(
array(
'name' => 'levelReading',
'type' => 'Zend\Form\Element\Select',
'type' => 'Core\Form\Element\Select',
'options' => [
'label' => /*@translate */ 'Reading',
'value_options' => [
Expand All @@ -88,7 +88,7 @@ public function init()
$this->add(
array(
'name' => 'levelSpokenInteraction',
'type' => 'Zend\Form\Element\Select',
'type' => 'Core\Form\Element\Select',
'options' => [
'label' => /*@translate */ 'Spoken Interaction',
'value_options' => [
Expand All @@ -114,7 +114,7 @@ public function init()
$this->add(
array(
'name' => 'levelSpokenProduction',
'type' => 'Zend\Form\Element\Select',
'type' => 'Core\Form\Element\Select',
'options' => array(
'label' => /*@translate */ 'Spoken Production',
'value_options' => array(
Expand All @@ -140,7 +140,7 @@ public function init()
$this->add(
array(
'name' => 'levelWriting',
'type' => 'Zend\Form\Element\Select',
'type' => 'Core\Form\Element\Select',
'options' => [
'label' => /*@translate */ 'Writing',
'value_options' => [
Expand Down
2 changes: 1 addition & 1 deletion module/Cv/src/Cv/Form/NativeLanguageFieldset.php
Expand Up @@ -139,7 +139,7 @@ public function init()
$this->add(
[
'name' => 'nativeLanguages',
'type' => 'Zend\Form\Element\Select',
'type' => 'Core\Form\Element\Select',
'options' => array(
'label' => 'Language',
'value_options' => self::$languagesOptions
Expand Down
2 changes: 1 addition & 1 deletion module/Cv/src/Cv/Form/SearchForm.php
Expand Up @@ -51,7 +51,7 @@ protected function addElements()
$this->add(
[
'name' => 'd',
'type' => 'Zend\Form\Element\Select',
'type' => 'Core\Form\Element\Select', //Zend\Form\Element\Select
'options' => [
'label' => /*@translate*/ 'Distance',
'value_options' => [
Expand Down
12 changes: 6 additions & 6 deletions module/Cv/test/CvTest/Form/LanguageSkillFieldsetTest.php
Expand Up @@ -55,22 +55,22 @@ public function testInitializesItself()
$add = [
[
'name' => 'language',
'type' => 'Zend\Form\Element\Select',
'type' => 'Core\Form\Element\Select',
'attributes' => [
'data-autoinit' => 'false',
],
],
[
'name' => 'levelListening',
'type' => 'Zend\Form\Element\Select',
'type' => 'Core\Form\Element\Select',
'attributes' => [
'data-allowclear' => 'true',
'data-searchbox' => -1,
]
],
[
'name' => 'levelReading',
'type' => 'Zend\Form\Element\Select',
'type' => 'Core\Form\Element\Select',
'attributes' => [
'data-allowclear' => 'true',
'data-searchbox' => -1,
Expand All @@ -79,23 +79,23 @@ public function testInitializesItself()
],
[
'name' => 'levelSpokenInteraction',
'type' => 'Zend\Form\Element\Select',
'type' => 'Core\Form\Element\Select',
'attributes' => [
'data-allowclear' => 'true',
'data-searchbox' => -1,
]
],
[
'name' => 'levelSpokenProduction',
'type' => 'Zend\Form\Element\Select',
'type' => 'Core\Form\Element\Select',
'attributes' => [
'data-allowclear' => 'true',
'data-searchbox' => -1,
]
],
[
'name' => 'levelWriting',
'type' => 'Zend\Form\Element\Select',
'type' => 'Core\Form\Element\Select',
'attributes' => [
'data-allowclear' => 'true',
'data-searchbox' => -1,
Expand Down
2 changes: 1 addition & 1 deletion module/Cv/test/CvTest/Form/NativeLanguageFieldsetTest.php
Expand Up @@ -177,7 +177,7 @@ public function testInitializesItself()
{
$add = [
'name' => 'nativeLanguages',
'type' => 'Zend\Form\Element\Select',
'type' => 'Core\Form\Element\Select',
'options' => [
'label' => 'Language',
'value_options' => self::$languagesOptions
Expand Down
2 changes: 1 addition & 1 deletion module/Cv/test/CvTest/Form/SearchFormTest.php
Expand Up @@ -79,7 +79,7 @@ public function testInitializesItself()

$add2 = [
'name' => 'd',
'type' => 'Zend\Form\Element\Select',
'type' => 'Core\Form\Element\Select',
'options' => [
'label' => /*@translate*/ 'Distance',
'value_options' => [
Expand Down
2 changes: 1 addition & 1 deletion module/Geo/src/Geo/Form/GeoSelect.php
Expand Up @@ -14,7 +14,7 @@
use Core\Form\Hydrator\HydratorStrategyProviderInterface;
use Core\Form\Hydrator\HydratorStrategyProviderTrait;
use Doctrine\Common\Collections\Collection;
use Zend\Form\Element\Select;
use Core\Form\Element\Select;
use Zend\Form\Element;
use Zend\Form\ElementInterface;
use Zend\Form\Exception\InvalidArgumentException;
Expand Down
2 changes: 1 addition & 1 deletion module/Geo/src/Geo/Form/GeoSelectSimple.php
Expand Up @@ -15,7 +15,7 @@
use Core\Form\Hydrator\HydratorStrategyProviderInterface;
use Core\Form\Hydrator\HydratorStrategyProviderTrait;
use Jobs\Entity\Location;
use Zend\Form\Element\Select;
use Core\Form\Element\Select;
use Zend\Hydrator\Strategy\ClosureStrategy;

/**
Expand Down
2 changes: 1 addition & 1 deletion module/Geo/test/GeoTest/Form/GeoSelectTest.php
Expand Up @@ -20,7 +20,7 @@
use Geo\Form\GeoSelect;
use Geo\Form\GeoSelectHydratorStrategy;
use Geo\Service\AbstractClient;
use Zend\Form\Element\Select;
use Core\Form\Element\Select;
use Zend\Json\Json;

/**
Expand Down
2 changes: 1 addition & 1 deletion module/Jobs/src/Jobs/Form/Element/ManagerSelect.php
Expand Up @@ -10,7 +10,7 @@
/** */
namespace Jobs\Form\Element;

use Zend\Form\Element\Select;
use Core\Form\Element\Select;
use Zend\Form\Element;
use Zend\Stdlib\ArrayUtils;

Expand Down

0 comments on commit d995343

Please sign in to comment.