Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master'
Browse files Browse the repository at this point in the history
# Conflicts:
#	admin/templates/default/layout.tpl
#	admin/templates/default/modules.tpl
#	js/admin/footer.js
  • Loading branch information
vbezruchkin committed May 17, 2017
2 parents 929b276 + be308b3 commit 35c0f8e
Show file tree
Hide file tree
Showing 50 changed files with 1,941 additions and 1,450 deletions.
9 changes: 8 additions & 1 deletion admin/fieldgroups.php
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ protected function _preSaveEntry(array &$entry, array $data, $action)
'collapsible' => iaUtil::checkPostParam('collapsible'),
'collapsed' => iaUtil::checkPostParam('collapsed'),
'tabview' => iaUtil::checkPostParam('tabview'),
'tabcontainer' => iaUtil::checkPostParam('tabcontainer')
'tabcontainer' => iaUtil::checkPostParam('tabcontainer'),
];

iaUtil::loadUTF8Functions('ascii', 'bad', 'validation');
Expand All @@ -177,8 +177,15 @@ protected function _preSaveEntry(array &$entry, array $data, $action)

if (empty($data['item'])) {
$this->addMessage('at_least_one_item_should_be_checked');
} else {
$stmt = '`name` = :name && `item` = :item';
$this->_iaDb->bind($stmt, ['name' => $entry['name'], 'item' => $entry['item']]);
if ($this->_iaDb->exists($stmt)) {
$this->addMessage('error_fieldgroup_duplicate');
}
}

$entry['module'] = $this->_iaCore->factory('item')->getPackageByItem($data['item']);
$entry['order'] = $this->_iaDb->getMaxOrder(iaField::getTableGroups()) + 1;
}

Expand Down
14 changes: 6 additions & 8 deletions admin/fields.php
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,7 @@ protected function _gridRead($params)
"`relation` != 'parent'" . (empty($_GET['item']) ? '' : " AND `item` = '" . iaSanitize::sql($_GET['item']) . "'"));

$output = [];
foreach ($rows as $row)
{
foreach ($rows as $row) {
$output[] = [
'id' => $row['name'],
'text' => iaField::getFieldTitle($row['item'], $row['name']),
Expand Down Expand Up @@ -501,7 +500,7 @@ protected function _assignValues(&$iaView, array &$entryData)
empty($imageTypes) && iaLanguage::set('no_image_types', iaLanguage::getf('no_image_types',
['url' => IA_ADMIN_URL . 'image-types/add/']));

list($parents, $children) = $this->_fetchRelations($entryData['item'], $entryData['values']);
list($parents, $children) = $this->_fetchRelations($entryData['item']);

$iaView->assign('children', $children);
$iaView->assign('parents', $parents);
Expand All @@ -514,7 +513,7 @@ protected function _assignValues(&$iaView, array &$entryData)
$iaView->assign('imageTypes', $imageTypes);
}

private function _fetchRelations($itemName, $values)
private function _fetchRelations($itemName)
{
$parents = $children = [];

Expand All @@ -540,15 +539,14 @@ private function _fetchRelations($itemName, $values)
$children[$row['element']][] = $row['child'];
$titles[$row['element']][] = iaField::getFieldTitle($itemName, $row['child']);
}
_d($values, 'VALUES');

foreach ($children as $element => $row) {
//$key = array_search($element, $values);
$children[/*$key*/$element] = [
$children[$element] = [
'values' => implode(',', $row),
'titles' => implode(', ', $titles[$element])
];
}
_d($parents, 'PARENTS'); _d($children, 'CHILDREN');

return [$parents, $children];
}

Expand Down
1 change: 0 additions & 1 deletion admin/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,6 @@ protected function _indexPage(&$iaView)
$line = trim($line);
if ($line) {
if ($line[0] == '>') {

$url = false !== stripos($line, '4.1.') ?
'https://github.com/intelliants/subrion/issues/$1' :
'https://dev.subrion.org/issues/$1';
Expand Down
4 changes: 3 additions & 1 deletion admin/languages.php
Original file line number Diff line number Diff line change
Expand Up @@ -404,9 +404,11 @@ protected function _indexPage(&$iaView)
break;

case 'rm':
$defaultLanguage = $this->_iaDb->row(['code'], iaDb::convertIds(1, 'default'), iaLanguage::getLanguagesTable());
$url = IA_CLEAR_URL . $defaultLanguage['code'] . IA_URL_DELIMITER . $this->_iaCore->get('admin_page') . IA_URL_DELIMITER . $this->_name . IA_URL_DELIMITER;
// TODO: set checkAccess
$this->_removeLanguage($iaView);
iaUtil::go_to($this->getPath());
iaUtil::go_to($url);

break;

Expand Down
39 changes: 25 additions & 14 deletions admin/templates/default/Gulpfile.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,20 @@
//
// Please don't forget to do `gulp build` before
// pushing to repo
// --------------------------------------------------


var pjson = require('./package.json'),
gulp = require("gulp"),
path = require('path'),
gutil = require('gulp-util'),
notify = require("gulp-notify"),
concat = require("gulp-concat"),
rename = require("gulp-rename"),
imagemin = require("gulp-imagemin"),
less = require("gulp-less"),
sourcemaps = require('gulp-sourcemaps'),
cleanCSS = require('gulp-clean-css');
//progeny = require('gulp-progeny'),
//cache = require('gulp-cached'),
//remember = require('gulp-remember'),

var config = {
paths: {
Expand Down Expand Up @@ -43,38 +49,43 @@ gulp.task("images", function(){

gulp.task("less", function(){
return gulp.src(config.paths.less.src)
//.pipe(cache('less'))
//.pipe(progeny())
.pipe(less().on('error', function(err) {
gutil.log(err);
this.emit('end');
}))
.pipe(cleanCSS({
advanced: false
}))
//.pipe(remember('less'))
.pipe(rename(function (path) {
path.basename = path.basename.replace('base', 'bootstrap');
}))
.pipe(gulp.dest(config.paths.less.dest));
.pipe(gulp.dest(config.paths.less.dest))
.pipe(notify({
sound: true,
title: "Build completed!",
message: "File: <%= file.relative %>. No errors. Images optimized",
icon: path.join(__dirname, "img/ico/apple-touch-icon.png")
}));
});

gulp.task("less-dev", function(){
return gulp.src(config.paths.less.srcDev)
//.pipe(cache('less'))
//.pipe(progeny())
.pipe(sourcemaps.init())
.pipe(less().on('error', function(err) {
gutil.log(err);
this.emit('end');
}))
.pipe(cleanCSS({
advanced: false
}))
//.pipe(remember('less'))
.pipe(sourcemaps.write())
.pipe(rename(function (path) {
path.basename = path.basename.replace('base', 'bootstrap');
}))
.pipe(gulp.dest(config.paths.less.dest));
.pipe(gulp.dest(config.paths.less.dest))
.pipe(notify({
sound: true,
title: "Compilation done! =)",
message: "File: <%= file.relative %>. No errors.",
icon: path.join(__dirname, "img/ico/apple-touch-icon.png")
}));
});

gulp.task("build", ["less", "images"]);
Expand Down
Binary file modified admin/templates/default/img/ico/apple-touch-icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified admin/templates/default/img/ico/favicon-16x16.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified admin/templates/default/img/ico/favicon-32x32.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 4 additions & 4 deletions admin/templates/default/languages.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -97,14 +97,14 @@
<td>{$language.direction}</td>
<td>
{if $language.master}
<span class="btn btn-xs disabled"><i class='i-checkmark'></i></span>
<span class="btn btn-xs disabled"><i class="i-checkmark"></i></span>
{/if}
</td>
<td>
{if $code == $core.config.lang}
<span class="btn btn-xs disabled"><i class='i-checkmark'></i></span>
<span class="btn btn-xs disabled"><i class="i-checkmark"></i></span>
{elseif iaCore::STATUS_ACTIVE == $language.status}
<a class="btn btn-success btn-xs" href="{$smarty.const.IA_ADMIN_URL}languages/default/{$code}/"><i class='i-checkmark'></i></a>
<a class="btn btn-success btn-xs" href="{$smarty.const.IA_ADMIN_URL}languages/default/{$code}/"><i class="i-checkmark"></i></a>
{/if}
</td>
<td>{$language.status}</td>
Expand All @@ -115,7 +115,7 @@
<a class="btn btn-default btn-xs" href="{$smarty.const.IA_ADMIN_URL}languages/edit/{$language.id}/"><i class="i-cog"></i> {lang key='settings'}</a>

{if count($core.languages) > 1 && $code != $core.config.lang}
<a class="btn btn-danger btn-xs js-remove-lang-cmd" href="{$smarty.const.IA_ADMIN_URL}languages/rm/{$code}/"><i class='i-close'></i> {lang key='delete'}</a>
<button class="btn btn-danger btn-xs js-remove-lang-cmd" data-href="{$smarty.const.IA_ADMIN_URL}languages/rm/{$code}/"><i class="i-close"></i> {lang key='delete'}</button>
{/if}
</td>
</tr>
Expand Down
Loading

0 comments on commit 35c0f8e

Please sign in to comment.