modelPath = $modelPath; $this->name = $name; $this->class = $class; $this->label = $label; $this->adapterName = $adapterName; $this->filter = $filter; $this->orderBy = $orderBy; $this->isActive = $isActive; $this->options = array_merge( $options, [ "setObjectTypeName" => "'{$this->name}'", "setAccess" => "data.permissions.{$this->name} ? data.permissions.{$this->name} : {}", "setDataPipe" => 'new IceDataPipe(modJsList.tab' . $this->name . ')', "setRemoteTable" => true, ] ); } public function getHTML() { $active = ($this->isActive)?"active":""; if (!$this->isInsideGroup) { return '
  • ' . t($this->label) . '
  • '; } else { return '
  • ' . t($this->label) . '
  • '; } } public function getPageHTML() { $active = ($this->isActive)?" active":""; $html = '
    '. '
    '. '
    '. '
    '. '
    '; return $html; } public function getJSObjectCode() { $js = ""; if (empty($this->filter)) { $js.= "modJsList['tab" . $this->name . "'] = new " . $this->adapterName . "('" . $this->class . "','" . $this->name . "','','".$this->orderBy. "');\r\n"; } else { $js.= "modJsList['tab" . $this->name . "'] = new " . $this->adapterName . "('" . $this->class . "','" . $this->name . "'," . $this->filter . ",'".$this->orderBy. "');\r\n"; } foreach ($this->options as $key => $val) { $js.= "modJsList['tab" . $this->name . "'].".$key."(".$val. ");\r\n"; } return $js; } }