7
7
function __construct(array &$info, DBReader &$rdr, $flags = 0) {
8
8
parent::__construct($info);
10
9
if (preg_match("/^(.*)__BLOB__(.*)$/", $this->gid, $m)) {
12
11
$blob_group = $m[2];
14
$this->options = array(
12
$blob_opts = $rdr->GetGroupOption($this, "blob_groups");
14
$this->options = $blob_opts[$gid];
19
17
$blob_group = false;
19
$this->blob_group = $blob_group;
22
21
if (is_array($rdr->groups)) {
23
22
foreach($rdr->groups as $re => &$table) {
520
519
if ($flags&REQUEST::ONLY_AXISINFO) {
521
520
if ((!$this->item_info)&&(!$this->req->GetGroupOptions($grp, "axis"))) return array();
522
$grp = $this->CheckGroup($grp, $flags);
524
$grp = $this->CheckGroup($grp, $flags);
525
524
if (!$mask) $mask = $this->CreateMask($grp, $info = NULL, $flags);
527
525
if (!$mask->IsFull()) $flags |= REQUEST::LIST_CUSTOM;
529
$uid = $this->opts->Get('channel_uids', false);
531
$data_columns = $this->req->GetGroupOption('columns', $grp);
533
527
$items = array();
535
$resp = $this->db->ShowColumns($grp->table);
537
$pos = 0; $rpos = 0; $cpos = 0;
538
foreach ($resp as $row) {
541
// if (!preg_match($this->columns['data'], $name)) continue;
542
if ((!$data_columns['data'])||(!preg_match($data_columns['data'], $name))) {
543
if (($flags&REQUEST::LIST_CUSTOM)&&(isset($data_columns['custom']))&&(preg_match($data_columns['custom'], $name))) $custom = 1;
547
if ($custom) $id = "c" . ($cpos++);
550
if (!$mask->Check($id)) continue;
552
$items[$rpos] = array(
554
"name" => $this->db->RecodeMessage($name),
558
if ($custom) $items[$rpos]['custom'] = $custom;
560
if ($this->item_info) {
561
if ($this->item_info['__group_mode__']) {
562
$info = $this->item_info[$grp->gid][$name];
564
$info = $this->item_info[$name];
566
if (is_array($info)) {
568
unset($info['column']);
570
$items[$rpos] = array_merge($items[$rpos], $info);
574
if (($uid)&&(!isset($items[$rpos]["uid"]))) {
575
if (($uid === true)||(preg_match($uid, $name))) {
576
$items[$rpos]["uid"] = $name;
530
if(!empty($grp->options)) {
531
// Handles BLOB decoding
532
$end = $grp->options["item_count"];
533
for($i = 0; $i < $end; $i++) {
540
$uid = $this->opts->get('channel_uids', false);
541
$data_columns = $this->req->getgroupoption('columns', $grp);
542
$resp = $this->db->showcolumns($grp->table);
543
$pos = 0; $rpos = 0; $cpos = 0;
544
foreach ($resp as $row) {
546
// if (!preg_match($this->columns['data'], $name)) continue;
547
if ((!$data_columns['data'])||(!preg_match($data_columns['data'], $name))) {
548
if (($flags&request::list_custom)&&(isset($data_columns['custom']))&&(preg_match($data_columns['custom'], $name))) $custom = 1;
552
if ($custom) $id = "c" . ($cpos++);
555
if (!$mask->check($id)) continue;
557
$items[$rpos] = array(
559
"name" => $this->db->recodemessage($name),
563
if ($custom) $items[$rpos]['custom'] = $custom;
565
if ($this->item_info) {
566
if ($this->item_info['__group_mode__']) {
567
$info = $this->item_info[$grp->gid][$name];
569
$info = $this->item_info[$name];
571
if (is_array($info)) {
573
unset($info['column']);
575
$items[$rpos] = array_merge($items[$rpos], $info);
579
if (($uid)&&(!isset($items[$rpos]["uid"]))) {
580
if (($uid === true)||(preg_match($uid, $name))) {
581
$items[$rpos]["uid"] = $name;
584
$this->AppendExtractedItems($grp, $mask, $items, $flags);
588
$this->appendextracteditems($grp, $mask, $items, $flags);
588
throw new ADEIException(translate("DBReader can't find any column in table (%s)", $grp->table));
592
throw new adeiexception(translate("dbreader can't find any column in table (%s)", $grp->table));
591
595
throw new ADEIException(translate("DBReader is not able to find any column matching filter (%s) in table (%s)", $this->columns['data'], $grp->table));