From 5bf66662a9bdd62c5bccab15e607cd95cfb8fcab Mon Sep 17 00:00:00 2001 From: Charles Cabergs Date: Mon, 27 Jul 2020 10:05:23 +0200 Subject: Removed wordpress and phpmyadmin, my server doesn't handle it well and it brings shame on my familly --- .../Plugins/Schema/Dia/RelationStatsDia.php | 228 --------------------- 1 file changed, 228 deletions(-) delete mode 100644 srcs/phpmyadmin/libraries/classes/Plugins/Schema/Dia/RelationStatsDia.php (limited to 'srcs/phpmyadmin/libraries/classes/Plugins/Schema/Dia/RelationStatsDia.php') diff --git a/srcs/phpmyadmin/libraries/classes/Plugins/Schema/Dia/RelationStatsDia.php b/srcs/phpmyadmin/libraries/classes/Plugins/Schema/Dia/RelationStatsDia.php deleted file mode 100644 index bd44532..0000000 --- a/srcs/phpmyadmin/libraries/classes/Plugins/Schema/Dia/RelationStatsDia.php +++ /dev/null @@ -1,228 +0,0 @@ -diagram = $diagram; - $src_pos = $this->_getXy($master_table, $master_field); - $dest_pos = $this->_getXy($foreign_table, $foreign_field); - $this->srcConnPointsLeft = $src_pos[0]; - $this->srcConnPointsRight = $src_pos[1]; - $this->destConnPointsLeft = $dest_pos[0]; - $this->destConnPointsRight = $dest_pos[1]; - $this->masterTablePos = $src_pos[2]; - $this->foreignTablePos = $dest_pos[2]; - $this->masterTableId = $master_table->tableId; - $this->foreignTableId = $foreign_table->tableId; - } - - /** - * Each Table object have connection points - * which is used to connect to other objects in Dia - * we detect the position of key in fields and - * then determines its left and right connection - * points. - * - * @param TableStatsDia $table The current table name - * @param string $column The relation column name - * - * @return array Table right,left connection points and key position - * - * @access private - */ - private function _getXy($table, $column) - { - $pos = array_search($column, $table->fields); - // left, right, position - $value = 12; - if ($pos != 0) { - return [ - $pos + $value + $pos, - $pos + $value + $pos + 1, - $pos, - ]; - } - return [ - $pos + $value, - $pos + $value + 1, - $pos, - ]; - } - - /** - * Draws relation references - * - * connects master table's master field to foreign table's - * foreign field using Dia object type Database - Reference - * Dia object is used to generate the XML of Dia Document. - * Database reference Object and their attributes are involved - * in the combination of displaying Database - reference on Dia Document. - * - * @param boolean $showColor Whether to use one color per relation or not - * if showColor is true then an array of $listOfColors - * will be used to choose the random colors for - * references lines. we can change/add more colors to - * this - * - * @return boolean|void - * - * @access public - * @see PDF - */ - public function relationDraw($showColor) - { - ++DiaRelationSchema::$objectId; - /* - * if source connection points and destination connection - * points are same then return it false and don't draw that - * relation - */ - if ($this->srcConnPointsRight == $this->destConnPointsRight) { - if ($this->srcConnPointsLeft == $this->destConnPointsLeft) { - return false; - } - } - - if ($showColor) { - $listOfColors = [ - 'FF0000', - '000099', - '00FF00', - ]; - shuffle($listOfColors); - $this->referenceColor = '#' . $listOfColors[0] . ''; - } else { - $this->referenceColor = '#000000'; - } - - $this->diagram->writeRaw( - ' - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - #1# - - - #n# - - - - - - - - - - - - ' - ); - } -} -- cgit