Skip to content

Commit

Permalink
Merge pull request #950 from SmoKE585/alpha
Browse files Browse the repository at this point in the history
Новый дизайн выбора свойств
  • Loading branch information
sergejey authored Apr 18, 2021
2 parents 1146c26 + 2e5f40d commit 8589003
Show file tree
Hide file tree
Showing 4 changed files with 220 additions and 203 deletions.
9 changes: 8 additions & 1 deletion 3rdparty/select2/css/select2.min.css

Large diffs are not rendered by default.

28 changes: 25 additions & 3 deletions modules/linkedobject/linkedobject.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -120,11 +120,12 @@ function run()
}

if ($this->width) {
$ifPX = explode('px', $this->width);
if(count($ifPX) == 1) $this->width = $this->width.'px';
$ifPX = substr($this->width, -1);
if($ifPX != 'x' && $ifPX != '%') $this->width = $this->width.'px';

$out['WIDTH'] = $this->width;
} else {
$out['WIDTH'] = '100%';
$out['WIDTH'] = '90%';
}

if ($uniq) {
Expand Down Expand Up @@ -236,7 +237,28 @@ function run()

if ($this->object_field) {
$objects = SQLSelect("SELECT * FROM objects ORDER BY CLASS_ID, TITLE");

foreach($objects as $key => $object) {
$className = SQLSelectOne("SELECT TITLE FROM classes WHERE ID = '".$object['CLASS_ID']."'");
if($object['CLASS_ID'] != $objects[$key-1]['CLASS_ID']) {
$objects[$key]['NEW_GROUP_START'] = 1;
} else {
$objects[$key]['NEW_GROUP_START'] = 0;
}
if($object['CLASS_ID'] != $objects[$key+1]['CLASS_ID']) {
$objects[$key]['NEW_GROUP_END'] = 1;
} else {
$objects[$key]['NEW_GROUP_END'] = 0;
}

$objects[$key]['CLASS_NAME'] = $className['TITLE'];

}

$objects[]=array('ID'=>'scripts','TITLE'=>'AllScripts','DESCRIPTION'=>LANG_SCRIPTS);
//echo '<pre>';
//var_dump($objects);
//die();
$out['OBJECTS'] = $objects;
$out['OBJECT_FIELD'] = $this->object_field;
}
Expand Down
Loading

0 comments on commit 8589003

Please sign in to comment.