Refactor code structure for improved readability and maintainability

This commit is contained in:
2025-04-10 19:23:03 +07:00
parent e4705579f0
commit 0700a715e4
5693 changed files with 857475 additions and 0 deletions

View File

@ -0,0 +1,51 @@
<?php
/*
This software is allowed to use under GPL or you need to obtain Commercial or Enterise License
to use it in non-GPL project. Please contact sales@dhtmlx.com for details
*/
?><?php
/*
@author dhtmlx.com
@license GPL, see license.txt
*/
require_once("treegrid_connector.php");
class TreeGridGroupConnector extends TreeGridConnector{
public function __construct($res,$type=false,$item_type=false,$data_type=false,$render_type=false){
if (!$render_type) $render_type="GroupRenderStrategy";
parent::__construct($res,$type,$item_type,$data_type,$render_type);
}
/*! if not isset $_GET[id] then it's top level
*/
protected function set_relation() {
if (!isset($_GET[$this->parent_name])) $this->request->set_relation(false);
}
/*! if it's first level then distinct level
* else select by parent
*/
protected function get_resource() {
$resource = null;
if (isset($_GET[$this->parent_name]))
$resource = $this->sql->select($this->request);
else
$resource = $this->sql->get_variants($this->config->relation_id['name'], $this->request);
return $resource;
}
/*! renders self as xml, starting part
*/
protected function xml_start(){
if (isset($_GET[$this->parent_name])) {
return "<rows parent='".$_GET[$this->parent_name].$this->render->get_postfix()."'>";
} else {
return "<rows parent='0'>";
}
}
}
?>