Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/.idea/
/app/config/config.ini
vendor
public/content
vendor
11 changes: 8 additions & 3 deletions app/controllers/Admin/BannersController.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@
use App\Models\Views;
use App\Models\Zones;

if(phpversion() < 5.5)
require '../vendor/ramsey/array_column/src/array_column.php';

class BannersController extends ControllerBase {
public function indexAction() {
if($this->request->getQuery('zone')) {
Expand All @@ -30,7 +33,8 @@ public function addAction() {
$this->assets->collection('bottom-js')
->addJs('js/moment/moment.min.js')
->addJs('js/moment/ru.js')
->addJs('js/datetimepicker/js/bootstrap-datetimepicker.js');
->addJs('js/datetimepicker/js/bootstrap-datetimepicker.js')
->addJs('js/banners_edit_sizes.js');
$this->assets->collection('css')
->addCss('js/datetimepicker/css/bootstrap-datetimepicker.min.css');
$banner = new Banners();
Expand Down Expand Up @@ -126,7 +130,8 @@ public function editAction() {
$this->assets->collection('bottom-js')
->addJs('js/moment/moment.min.js')
->addJs('js/moment/ru.js')
->addJs('js/datetimepicker/js/bootstrap-datetimepicker.js');
->addJs('js/datetimepicker/js/bootstrap-datetimepicker.js')
->addJs('js/banners_edit_sizes.js');
$this->assets->collection('css')
->addCss('js/datetimepicker/css/bootstrap-datetimepicker.min.css');
$id = $this->dispatcher->getParam('id');
Expand Down Expand Up @@ -213,7 +218,7 @@ public function editAction() {

}
}
$this->view->checked_zones = $this->request->getPost('zones') ? $this->request->getPost('zones') : array_column($banner->getZones(array('columns'=>array('id')))->toArray(), 'id');
$this->view->checked_zones = $this->request->getPost('zones') ? $this->request->getPost('zones') : \array_column($banner->getZones(array('columns'=>array('id')))->toArray(), 'id');
$this->view->banner = $banner;
$this->view->pick("banners/edit");
$this->view->title = "Редактирование баннера";
Expand Down
63 changes: 63 additions & 0 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 10 additions & 0 deletions vendor/composer/autoload_files.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?php

// autoload_files.php @generated by Composer

$vendorDir = dirname(dirname(__FILE__));
$baseDir = dirname($vendorDir);

return array(
$vendorDir . '/ramsey/array_column/src/array_column.php',
);
49 changes: 49 additions & 0 deletions vendor/composer/installed.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
[
{
"name": "ramsey/array_column",
"version": "1.1.3",
"version_normalized": "1.1.3.0",
"source": {
"type": "git",
"url": "https://github.com/ramsey/array_column.git",
"reference": "f8e52eb28e67eb50e613b451dd916abcf783c1db"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/ramsey/array_column/zipball/f8e52eb28e67eb50e613b451dd916abcf783c1db",
"reference": "f8e52eb28e67eb50e613b451dd916abcf783c1db",
"shasum": ""
},
"require-dev": {
"jakub-onderka/php-parallel-lint": "0.8.*",
"phpunit/phpunit": "~4.5",
"satooshi/php-coveralls": "0.6.*",
"squizlabs/php_codesniffer": "~2.2"
},
"time": "2015-03-20 22:07:39",
"type": "library",
"installation-source": "dist",
"autoload": {
"files": [
"src/array_column.php"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Ben Ramsey",
"homepage": "http://benramsey.com"
}
],
"description": "Provides functionality for array_column() to projects using PHP earlier than version 5.5.",
"homepage": "https://github.com/ramsey/array_column",
"keywords": [
"array",
"array_column",
"column"
]
}
]
6 changes: 6 additions & 0 deletions vendor/ramsey/array_column/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
.DS_Store
phpunit.xml
composer.lock
build
vendor/
*.phar
26 changes: 26 additions & 0 deletions vendor/ramsey/array_column/.travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
language: php

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

before_script:
- travis_retry composer self-update
- travis_retry composer install --no-interaction --prefer-source

script:
- mkdir -p build/logs
- ./vendor/bin/parallel-lint src tests
- ./vendor/bin/phpunit --coverage-text
- ./vendor/bin/phpcs src --standard=psr2 -sp

after_script:
- php vendor/bin/coveralls

matrix:
allow_failures:
- php: hhvm
37 changes: 37 additions & 0 deletions vendor/ramsey/array_column/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# array_column() Changelog

## 1.1.3

_Released 2015-03-20_

* Changing package name from "rhumsaa/array_column" to "ramsey/array_column"
* Updated Travis CI build config to test more versions of PHP
* Updated Travis CI config to lint and check PSR-2 coding standards
* Added project badges
* Added CHANGELOG

## 1.1.2

_Released 2013-07-22_

* Remove unnecessary conditionals
* Whitespace changes

## 1.1.1

_Released 2013-07-06_

* Documentation updates

## 1.1.0

_Released 2013-07-06_

* Catching up array_column() library functionality and tests with PHP 5.5.0
* Set Travis CI to run tests on PHP 5.5

## 1.0.0

_Released 2013-03-22_

* Initial release of userland library
19 changes: 19 additions & 0 deletions vendor/ramsey/array_column/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
Copyright (c) 2013-2015 Ben Ramsey (http://benramsey.com)

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
91 changes: 91 additions & 0 deletions vendor/ramsey/array_column/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
# array_column() for PHP

[![Build Status](https://travis-ci.org/ramsey/array_column.svg?branch=master)](https://travis-ci.org/ramsey/array_column)
[![Coverage Status](https://coveralls.io/repos/ramsey/array_column/badge.svg?branch=master)](https://coveralls.io/r/ramsey/array_column)
[![Latest Stable Version](https://poser.pugx.org/ramsey/array_column/v/stable.svg)](https://packagist.org/packages/ramsey/array_column)
[![Total Downloads](https://poser.pugx.org/ramsey/array_column/downloads.svg)](https://packagist.org/packages/ramsey/array_column)
[![Latest Unstable Version](https://poser.pugx.org/ramsey/array_column/v/unstable.svg)](https://packagist.org/packages/ramsey/array_column)
[![License](https://poser.pugx.org/ramsey/array_column/license.svg)](https://packagist.org/packages/ramsey/array_column)

This simple library provides functionality for [`array_column()`](http://php.net/array_column)
to versions of PHP earlier than 5.5. It mimics the functionality of the built-in
function in every way.


## Usage

```
array array_column(array $input, mixed $columnKey[, mixed $indexKey])
```

Given a multi-dimensional array of data, `array_column()` returns the values
from a single column of the input array, identified by the `$columnKey`.
Optionally, you may provide an `$indexKey` to index the values in the returned
array by the values from the `$indexKey` column in the input array.

For example, using the following array of data, we tell `array_column()` to
return an array of just the last names, indexed by their record IDs.

``` php
<?php
$records = array(
array(
'id' => 2135,
'first_name' => 'John',
'last_name' => 'Doe'
),
array(
'id' => 3245,
'first_name' => 'Sally',
'last_name' => 'Smith'
),
array(
'id' => 5342,
'first_name' => 'Jane',
'last_name' => 'Jones'
),
array(
'id' => 5623,
'first_name' => 'Peter',
'last_name' => 'Doe'
)
);

$lastNames = array_column($records, 'last_name', 'id');
```

If we call `print_r()` on `$lastNames`, you'll see a resulting array that looks
a bit like this:

``` text
Array
(
[2135] => Doe
[3245] => Smith
[5342] => Jones
[5623] => Doe
)
```


## Installation

The easiest way to install this library is to use [Composer](https://getcomposer.org/):

```
php composer.phar require ramsey/array_column
```

Then, when you run `composer install`, everything will fall magically into place,
and the `array_column()` function will be available to your project, as long as
you are including Composer's autoloader.

_However, you do not need Composer to use this library._

This library has no dependencies and should work on older versions of PHP.
Download the code and include `src/array_column.php` in your project, and all
should work fine.

When you are ready to run your project on PHP 5.5, everything should
continue to run well without conflicts, even if this library remains included
in your project.
27 changes: 27 additions & 0 deletions vendor/ramsey/array_column/composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"name": "ramsey/array_column",
"description": "Provides functionality for array_column() to projects using PHP earlier than version 5.5.",
"type": "library",
"keywords": ["array", "column", "array_column"],
"homepage": "https://github.com/ramsey/array_column",
"license": "MIT",
"authors": [
{
"name": "Ben Ramsey",
"homepage": "http://benramsey.com"
}
],
"support": {
"issues": "https://github.com/ramsey/array_column/issues",
"source": "https://github.com/ramsey/array_column"
},
"require-dev": {
"phpunit/phpunit": "~4.5",
"squizlabs/php_codesniffer": "~2.2",
"jakub-onderka/php-parallel-lint": "0.8.*",
"satooshi/php-coveralls": "0.6.*"
},
"autoload": {
"files": ["src/array_column.php"]
}
}
Loading