function _chartLayoutDetails()
558775
private static function _chartDataSeries($chartDetail,$namespacesChartMeta,$plotType) {
		$multiSeriesType = NULL;
		$smoothLine = false;
		$seriesLabel = $seriesCategory = $seriesValues = $plotOrder = array();

		$seriesDetailSet = $chartDetail->children($namespacesChartMeta['c']);
		foreach($seriesDetailSet as $seriesDetailKey => $seriesDetails) {
			switch ($seriesDetailKey) {
				case "grouping":
					$multiSeriesType = self::_getAttribute($chartDetail->grouping, 'val', 'string');
					break;
				case "ser":
					$marker = NULL;
					foreach($seriesDetails as $seriesKey => $seriesDetail) {
						switch ($seriesKey) {
							case "idx":
								$seriesIndex = self::_getAttribute($seriesDetail, 'val', 'integer');
								break;
							case "order":
								$seriesOrder = self::_getAttribute($seriesDetail, 'val', 'integer');
								$plotOrder[$seriesIndex] = $seriesOrder;
								break;
							case "tx":
								$seriesLabel[$seriesIndex] = self::_chartDataSeriesValueSet($seriesDetail,$namespacesChartMeta);
								break;
							case "marker":
								$marker = self::_getAttribute($seriesDetail->symbol, 'val', 'string');
								break;
							case "smooth":
								$smoothLine = self::_getAttribute($seriesDetail, 'val', 'boolean');
								break;
							case "cat":
								$seriesCategory[$seriesIndex] = self::_chartDataSeriesValueSet($seriesDetail,$namespacesChartMeta);
								break;
							case "val":
								$seriesValues[$seriesIndex] = self::_chartDataSeriesValueSet($seriesDetail,$namespacesChartMeta,$marker);
								break;
							case "xVal":
								$seriesCategory[$seriesIndex] = self::_chartDataSeriesValueSet($seriesDetail,$namespacesChartMeta,$marker);
								break;
							case "yVal":
								$seriesValues[$seriesIndex] = self::_chartDataSeriesValueSet($seriesDetail,$namespacesChartMeta,$marker);
								break;
						}
					}
			}
		}
		return new PHPExcel_Chart_DataSeries($plotType,$multiSeriesType,$plotOrder,$seriesLabel,$seriesCategory,$seriesValues,$smoothLine);
	}
550113
public function detailsAction()
    {
        
        // Getting the Site config "MelisDemoCms.config.php"
        $siteConfig = $this->getServiceLocator()->get('config');
        $siteConfig = $siteConfig['site']['MelisDemoCms'];
        $siteDatas = $siteConfig['datas'];
        
        $dateMax = date("Y-m-d H:i:s", strtotime("now"));
		$listNewsPluginView = $this->MelisCmsNewsShowNewsPlugin();
		$listNewsParameters = array(
		    'id' => 'newsDetails',
		    'template_path' => 'MelisDemoCms/plugin/news-details',
		);
		// add generated view to children views for displaying it in the contact view
		$this->view->addChild($listNewsPluginView->render($listNewsParameters), 'newsDetails');
		
		/**
		 * Generating Homepage Latest News slider using MelisCmsNewsLatestNewsPlugin Plugin
		 */
		$latestNewsPluginView = $this->MelisCmsNewsLatestNewsPlugin();
		$latestNewsParameters = array(
		    'template_path' => 'MelisDemoCms/plugin/latest-news',
            'pageIdNews' => $siteDatas['news_details_page_id'],
		    'filter' => array(
		        'column' => 'cnews_publish_date',
		        'order' => 'DESC',
		        'limit' => 10,
		        'unpublish_filter' => true,
		        'date_max' => null,
		        'site_id' => $siteDatas['site_id'],
		    )
		);
		// add generated view to children views for displaying it in the contact view
		$this->view->addChild($latestNewsPluginView->render($latestNewsParameters), 'latestNews');
        
        $this->view->setVariable('renderMode', $this->renderMode);
        $this->view->setVariable('idPage', $this->idPage);
        return $this->view;
    }
163794
function () {
		var options = this.options,
			padding = this.padding,
			titleOptions = options.title,
			titleHeight = 0,
			bBox;
		
		if (titleOptions.text) {
			if (!this.title) {
				this.title = this.chart.renderer.label(titleOptions.text, padding - 3, padding - 4, null, null, null, null, null, 'legend-title')
					.attr({ zIndex: 1 })
					.css(titleOptions.style)
					.add(this.group);
			}
			bBox = this.title.getBBox();
			titleHeight = bBox.height;
			this.offsetWidth = bBox.width; // #1717
			this.contentGroup.attr({ translateY: titleHeight });
		}
		this.titleHeight = titleHeight;
	}
868575
function (item) {
		var legend = this,
			chart = legend.chart,
			renderer = chart.renderer,
			options = legend.options,
			horizontal = options.layout === 'horizontal',
			symbolWidth = options.symbolWidth,
			symbolPadding = options.symbolPadding,
			itemStyle = legend.itemStyle,
			itemHiddenStyle = legend.itemHiddenStyle,
			padding = legend.padding,
			itemDistance = horizontal ? pick(options.itemDistance, 8) : 0,
			ltr = !options.rtl,
			itemHeight,
			widthOption = options.width,
			itemMarginBottom = options.itemMarginBottom || 0,
			itemMarginTop = legend.itemMarginTop,
			initialItemX = legend.initialItemX,
			bBox,
			itemWidth,
			li = item.legendItem,
			series = item.series || item,
			itemOptions = series.options,
			showCheckbox = itemOptions.showCheckbox,
			useHTML = options.useHTML;

		if (!li) { // generate it once, later move it

			// Generate the group box
			// A group to hold the symbol and text. Text is to be appended in Legend class.
			item.legendGroup = renderer.g('legend-item')
				.attr({ zIndex: 1 })
				.add(legend.scrollGroup);

			// Draw the legend symbol inside the group box
			series.drawLegendSymbol(legend, item);

			// Generate the list item text and add it to the group
			item.legendItem = li = renderer.text(
					options.labelFormat ? format(options.labelFormat, item) : options.labelFormatter.call(item),
					ltr ? symbolWidth + symbolPadding : -symbolPadding,
					legend.baseline,
					useHTML
				)
				.css(merge(item.visible ? itemStyle : itemHiddenStyle)) // merge to prevent modifying original (#1021)
				.attr({
					align: ltr ? 'left' : 'right',
					zIndex: 2
				})
				.add(item.legendGroup);

			// Set the events on the item group, or in case of useHTML, the item itself (#1249)
			(useHTML ? li : item.legendGroup).on('mouseover', function () {
					item.setState(HOVER_STATE);
					li.css(legend.options.itemHoverStyle);
				})
				.on('mouseout', function () {
					li.css(item.visible ? itemStyle : itemHiddenStyle);
					item.setState();
				})
				.on('click', function (event) {
					var strLegendItemClick = 'legendItemClick',
						fnLegendItemClick = function () {
							item.setVisible();
						};
						
					// Pass over the click/touch event. #4.
					event = {
						browserEvent: event
					};

					// click the name or symbol
					if (item.firePointEvent) { // point
						item.firePointEvent(strLegendItemClick, event, fnLegendItemClick);
					} else {
						fireEvent(item, strLegendItemClick, event, fnLegendItemClick);
					}
				});

			// Colorize the items
			legend.colorizeItem(item, item.visible);

			// add the HTML checkbox on top
			if (itemOptions && showCheckbox) {
				item.checkbox = createElement('input', {
					type: 'checkbox',
					checked: item.selected,
					defaultChecked: item.selected // required by IE7
				}, options.itemCheckboxStyle, chart.container);

				addEvent(item.checkbox, 'click', function (event) {
					var target = event.target;
					fireEvent(item, 'checkboxClick', {
							checked: target.checked
						},
						function () {
							item.select();
						}
					);
				});
			}
		}

		// calculate the positions for the next line
		bBox = li.getBBox();

		itemWidth = item.legendItemWidth =
			options.itemWidth || symbolWidth + symbolPadding + bBox.width + itemDistance +
			(showCheckbox ? 20 : 0);
		legend.itemHeight = itemHeight = bBox.height;

		// if the item exceeds the width, start a new line
		if (horizontal && legend.itemX - initialItemX + itemWidth >
				(widthOption || (chart.chartWidth - 2 * padding - initialItemX))) {
			legend.itemX = initialItemX;
			legend.itemY += itemMarginTop + legend.lastLineHeight + itemMarginBottom;
			legend.lastLineHeight = 0; // reset for next line
		}

		// If the item exceeds the height, start a new column
		/*if (!horizontal && legend.itemY + options.y + itemHeight > chart.chartHeight - spacingTop - spacingBottom) {
			legend.itemY = legend.initialItemY;
			legend.itemX += legend.maxItemWidth;
			legend.maxItemWidth = 0;
		}*/

		// Set the edge positions
		legend.maxItemWidth = mathMax(legend.maxItemWidth, itemWidth);
		legend.lastItemY = itemMarginTop + legend.itemY + itemMarginBottom;
		legend.lastLineHeight = mathMax(itemHeight, legend.lastLineHeight); // #915

		// cache the position of the newly generated or reordered items
		item._legendItemPos = [legend.itemX, legend.itemY];

		// advance
		if (horizontal) {
			legend.itemX += itemWidth;

		} else {
			legend.itemY += itemMarginTop + itemHeight + itemMarginBottom;
			legend.lastLineHeight = itemHeight;
		}

		// the width of the widest item
		legend.offsetWidth = widthOption || mathMax(
			(horizontal ? legend.itemX - initialItemX - itemDistance : itemWidth) + padding,
			legend.offsetWidth
		);
	}
170626
function () {
		var chart = this,
			options = this.options,
			xAxisOptions = options.xAxis = splat(options.xAxis || {}),
			yAxisOptions = options.yAxis = splat(options.yAxis || {}),
			optionsArray,
			axis;

		// make sure the options are arrays and add some members
		each(xAxisOptions, function (axis, i) {
			axis.index = i;
			axis.isX = true;
		});

		each(yAxisOptions, function (axis, i) {
			axis.index = i;
		});

		// concatenate all axis options into one array
		optionsArray = xAxisOptions.concat(yAxisOptions);

		each(optionsArray, function (axisOptions) {
			axis = new Axis(chart, axisOptions);
		});

		chart.adjustTickAmounts();
	}
471910
def showDetails(self):
        
        msg = self.currentItem().data(QtCore.Qt.UserRole)
        desc = msg.description
        desc = desc.replace('\r\n', '\n').replace('\r', '\n')
        desc = desc.replace('\n', '<br/>')
        QtWidgets.QMessageBox.information(
            self, _('Message details'),
            _("""<p><b>Description:</b><br/>%s</p>
<p><b>File:</b><br/>%s</p>
<p><b>Line:</b><br/>%d</p>
            """) % (desc, msg.path, msg.line + 1, ))
779438
public function chartChildren(): string
    {
        $data = [
            [
                I18N::translate('Century'),
                I18N::translate('Average number')
            ]
        ];

        foreach ($this->queryRecords() as $record) {
            $data[] = [
                $this->century_service->centuryName((int) $record->century),
                (float) $record->num
            ];
        }

        $chart_title   = I18N::translate('Average number of children per family');
        $chart_options = [
            'title' => $chart_title,
            'subtitle' => '',
            'legend' => [
                'position'  => 'none',
            ],
            'vAxis' => [
                'title' => I18N::translate('Number of children'),
            ],
            'hAxis' => [
                'title' => I18N::translate('Century'),
            ],
            'colors' => [
                '#84beff'
            ],
        ];

        return view(
            'statistics/other/charts/column',
            [
                'data'          => $data,
                'chart_options' => $chart_options,
                'chart_title'   => $chart_title,
            ]
        );
    }
415249
private function _renderLegend() {
		$legend = $this->_chart->getLegend();
		if (!is_null($legend)) {
			$legendPosition = $legend->getPosition();
			$legendOverlay = $legend->getOverlay();
			switch ($legendPosition) {
				case 'r'	:
					$this->_graph->legend->SetPos(0.01,0.5,'right','center');	//	right
					$this->_graph->legend->SetColumns(1);
					break;
				case 'l'	:
					$this->_graph->legend->SetPos(0.01,0.5,'left','center');	//	left
					$this->_graph->legend->SetColumns(1);
					break;
				case 't'	:
					$this->_graph->legend->SetPos(0.5,0.01,'center','top');	//	top
					break;
				case 'b'	:
					$this->_graph->legend->SetPos(0.5,0.99,'center','bottom');	//	bottom
					break;
				default		:
					$this->_graph->legend->SetPos(0.01,0.01,'right','top');	//	top-right
					$this->_graph->legend->SetColumns(1);
					break;
			}
		} else {
			$this->_graph->legend->Hide();
		}
	}
550871
public function chartDistribution(
        string $chart_shows = 'world',
        string $chart_type = '',
        string $surname = ''
    ): string {
        I18N::init(WT_LOCALE);

        switch ($chart_type) {
            case 'surname_distribution_chart':
                $chart_title = I18N::translate('Surname distribution chart') . ': ' . $surname;
                $data        = $this->getSurnameChartData($surname);
                break;

            case 'birth_distribution_chart':
                $chart_title = I18N::translate('Birth by country');
                $data        = $this->getBirthChartData();
                break;

            case 'death_distribution_chart':
                $chart_title = I18N::translate('Death by country');
                $data        = $this->getDeathChartData();
                break;

            case 'marriage_distribution_chart':
                $chart_title = I18N::translate('Marriage by country');
                $data        = $this->getMarriageChartData();
                break;

            case 'indi_distribution_chart':
            default:
                $chart_title = I18N::translate('Individual distribution chart');
                $data        = $this->getIndivdualChartData();
                break;
        }

        $chart_color2 = $this->theme->parameter('distribution-chart-high-values');
        $chart_color3 = $this->theme->parameter('distribution-chart-low-values');

        return view(
            'statistics/other/charts/geo',
            [
                'chart_title'  => $chart_title,
                'chart_color2' => $chart_color2,
                'chart_color3' => $chart_color3,
                'region'       => $chart_shows,
                'data'         => $data,
            ]
        );
    }
249069
public function objectdetails() {
		$response = new stdClass;
		if (isset($_GET['ID'])) {
			$type = null;
			if (isset($_GET['type'])) {
				$type = $_GET['type'] == 'href' ? 'SiteTree' : 'File';
			} else {
				$type = 'SiteTree';
			}

			$object = DataObject::get_by_id($type, $_GET['ID']);

			$response->Title = $object->Title;
			$response->Link = $object->Link();

			if ($object instanceof Image) {
				$response->Name = $object->Name;
				$response->Filename = $object->Filename;
				$response->width = $object->getWidth();
				$response->height = $object->getHeight();
			}

			$response->error = 0;
		} else {
			$response->error = 1;
			$response->message = "Invalid image ID";
		}
		echo json_encode($response);
	}
1024467
function widgetsLayout(): array
    {
        if(!$this->layoutBuilt) {
            $this->buildWidgetsLayout();
            $this->layoutBuilt = true;
        }

        return [
            "rows" => collect($this->rows)->map(function(DashboardLayoutRow $row) {
                return $row->toArray();
            })->all()
        ];
    }
465235
function Chart(options) {

	this.__proto__ = new Control();

	this.init = function(options) {
		this.type = options.type = 'Chart';
		this.parent = options.parent;
		this.defaults = {
			x:48, y:48, w:288, h:144,
			text: '',
			script: undefined,
			onload: undefined,
			fill: this.parent.fill,
			fill_highlight: this.parent.lighter(this.parent.stroke), 	// ??
			stroke: this.parent.stroke,
			'stroke-width': this.parent.control_stroke,
			fontsize: this.parent.fontsize,
			repeat: 0,
			running: 0,
			corner: this.parent.button_corner,
			subtype: undefined,
			r: this.w/2,		//?? chart??
			autorun: undefined,
			interpolate: 'step-after',	// vs. 'basis'
			ticks: 5,
			target: undefined,
			refresh: 0,
			ymax: undefined,
			ymin: undefined
		};
		//console.log('Chart defaults:', this.defaults);
		this.setoptions(options);
		this.render();		// render D3 chart
		var self = this;
		if (this.refresh) setInterval(function() { self.redraw.call(self); }, this.refresh);
		return this;
	};

	this.attr = function(attrs) {
		this.__proto__.attr.call(this);
		this.svg.attr(attrs);
	};

	this.render = function() {

		var margin = {top: 0, right: 0, bottom: 0, left: 0};
		var width = this.w - margin.left - margin.right;
		var height = this.h - margin.top - margin.bottom;

		var x = d3.scale.linear().range([0, width]);
		var y = d3.scale.linear().range([height, 0]);
		var color = d3.scale.category10();
		var xAxis = d3.svg.axis().scale(x).ticks(this.ticks).orient('bottom');
		var yAxis = d3.svg.axis().scale(y).ticks(this.ticks).orient('left');

		var line = d3.svg.line().interpolate(this.interpolate)
				.x(function(d) { return x(d.time); })
				.y(function(d) { return y(d.value); });

		var self = this;
		this.outerrect = this.parent.paper.rect(this.x, this.y, this.w, this.h, this.parent.button_corner)
			.attr({fill: this.fill, stroke: this.stroke, 'stroke-width':this.parent.control_stroke});
		this.elts.push(this.outerrect);

		this.label = this.parent.paper.text(this.x + (this.w/2), this.y + this.h + this.fontsize*2, this.text)
			.attr({fill:this.stroke, stroke:this.stroke, 'font-size': this.fontsize});
		this.textelts.push(this.label);

		this.sethandlers();

		this.svg = d3.select(this.parent.paper.canvas).append('g')
				.attr('width', width + margin.left + margin.right)
				.attr('height', height + margin.top + margin.bottom)
			.append('g')
				//.attr('transform', 'translate(' + (this.x+margin.left) + ',' + (this.y+margin.top) + ')');
				.attr('transform', 'translate(' + (this.x) + ',' + (this.y) + ')');

		d3.json('/d3/' + this.target, function(data) {

			// console.log('d3:', typeof data, data);

			color.domain(d3.keys(data[0]).filter(function(key) { return key !== 'time'; }));
			var values = color.domain().map(function(name) {
				return {
					name: name,
					values: data.map(function(d) {
						return {time: d.time, value: +d[name]};
					})
				};
			});

			x.domain(d3.extent(data, function(d) { return d.time; }));
			if (self.ymax !== undefined) y.domain([self.ymin, self.ymax]);
			else y.domain([
				d3.min(values, function(c) { return d3.min(c.values, function(v) { return v.value; }); }),
				d3.max(values, function(c) { return d3.max(c.values, function(v) { return v.value; }); })
			]);

			self.svgx = self.svg.append('g')
					.attr('class', 'x axis')
					.attr('transform', 'translate(0,' + height + ')')
					.attr('stroke', self.stroke)
					.attr('fill', self.stroke)
					.call(xAxis);

			self.svgy = self.svg.append('g')
					.attr('class', 'y axis')
					.attr('stroke', self.stroke)
					.attr('fill', self.stroke)
					.call(yAxis);
/* y axis label
				.append('text')
					.attr('transform', 'rotate(-90)')
					.attr('y', 6)
					.attr('dy', '.71em')
					.style('text-anchor', 'end')
					.attr('stroke', self.stroke)
					.attr('fill', self.stroke)
					.text(' ');
*/
			self.svgvalue = self.svg.selectAll('.value')
					.data(values)
				.enter().append('g')
					.attr('class', 'value');

			self.svgvalue.append('path')
					.attr('class', 'line')
					.attr('d', function(d) { return line(d.values); })
					.style('stroke', function(d) { return color(d.name); })
					.style('fill', self.fill)
					.style('stroke-width', self['stroke-width']);

			self.svgvalue.append('text')
					.datum(function(d) { return {name: d.name, value: d.values[d.values.length - 1]}; })
					.attr('transform', function(d) { return 'translate(' + x(d.value.time) + ',' + y(d.value.value) + ')'; })
					.attr('x', 3)
					.attr('dy', '.35em')
					.attr('stroke', self.stroke)
					.attr('fill', self.stroke)
					.text(function(d) { return d.name; });
		});
	};

	this.redraw = function() {
		if (this.svg) {
			var doomed_svg = this.svg;
			delete this.svg;
			this.render();
			doomed_svg.remove();
		}
	};

	this.remove = function() {
		this.__proto__.remove.call(this);
		this.svg.remove();
	};

	this.move = function(x, y) {
		this.x = x;
		this.y = y;
		this.outerrect.attr({x:this.x, y:this.y, width:this.w, height:this.h});
		this.label.attr({x:this.x + this.w/2, y:this.y + this.h + this.fontsize*2});

		var translation = ['translate(', this.x, ',', this.y,')'].join('');
		//console.log('translation:', translation)
		this.svg.attr('transform', translation);
	};

	this.handleClick = function(e) {
		if (this.repeat) {
			if (this.running) {
				this.running = false;
				clearInterval(this.intervalid);
				delete this.intervalid;
			} else {
				this.running = true;
				this.exec();
			}
		}
		else this.redraw();

		if (e) {
			e.preventDefault();
			e.stopPropagation();
		}
		return false;
	};

	this.setValue = function(value) {
		this.value = value;
		//this.label.attr({text: this.text + ': ' + this.value});
		var update = {id: this.id, value: this.value};
		this.fire('update', update);
	};

	return this.init(options || {});
}
1047089
def layout(legend_info_array, vertical = false)
      if vertical
        longest = 0
        legend_info_array.each {|elem|
          cur_length = relative(50) * elem[:title].length
          longest = longest < cur_length ? cur_length : longest
        }
        y_positions = []
         (0..legend_info_array.length - 1).each {|y|
          y_positions << y * @line_height
        }
        [longest, y_positions]
      else
        legend_info_array.inject([0, []]) do |enum, elem|
          enum[0] += (relative(50) * 2) if enum.first != 0      # Add spacer between elements
          enum[1] << enum.first                                 # Add location to points
          enum[0] += relative(50)                               # Add room for color box
          enum[0] += (relative(50) * elem[:title].length)       # Add room for text
          
          [enum.first, enum.last]
        end        
      end
    end
894753
protected function chart(Individual $individual, int $chart_style, int $fan_width, int $generations, ChartService $chart_service): ResponseInterface
    {
        $ancestors = $chart_service->sosaStradonitzAncestors($individual, $generations);

        $gen  = $generations - 1;
        $sosa = 2 ** $generations - 1;

        // fan size
        $fanw = 640 * $fan_width / 100;
        $cx   = $fanw / 2 - 1; // center x
        $cy   = $cx; // center y
        $rx   = $fanw - 1;
        $rw   = $fanw / ($gen + 1);
        $fanh = $fanw; // fan height
        if ($chart_style === self::STYLE_HALF_CIRCLE) {
            $fanh = $fanh * ($gen + 1) / ($gen * 2);
        }
        if ($chart_style === self::STYLE_THREE_QUARTER_CIRCLE) {
            $fanh *= 0.86;
        }
        $scale = $fanw / 640;

        // Create the image
        $image = imagecreate((int) $fanw, (int) $fanh);

        // Create colors
        $transparent = imagecolorallocate($image, 0, 0, 0);
        imagecolortransparent($image, $transparent);

        $theme = app(ModuleThemeInterface::class);

        $foreground = $this->imageColor($image, $theme->parameter('chart-font-color'));

        $backgrounds = [
            'M' => $this->imageColor($image, $theme->parameter('chart-background-m')),
            'F' => $this->imageColor($image, $theme->parameter('chart-background-f')),
            'U' => $this->imageColor($image, $theme->parameter('chart-background-u')),
        ];

        imagefilledrectangle($image, 0, 0, (int) $fanw, (int) $fanh, $transparent);

        $fandeg = 90 * $chart_style;

        // Popup menus for each ancestor
        $html = '';

        // Areas for the imagemap
        $areas = '';

        // loop to create fan cells
        while ($gen >= 0) {
            // clean current generation area
            $deg2 = 360 + ($fandeg - 180) / 2;
            $deg1 = $deg2 - $fandeg;
            imagefilledarc($image, (int) $cx, (int) $cy, (int) $rx, (int) $rx, (int) $deg1, (int) $deg2, $backgrounds['U'], IMG_ARC_PIE);
            $rx -= 3;

            // calculate new angle
            $p2    = 2 ** $gen;
            $angle = $fandeg / $p2;
            $deg2  = 360 + ($fandeg - 180) / 2;
            $deg1  = $deg2 - $angle;
            // special case for rootid cell
            if ($gen == 0) {
                $deg1 = 90;
                $deg2 = 360 + $deg1;
            }

            // draw each cell
            while ($sosa >= $p2) {
                if ($ancestors->has($sosa)) {
                    $person  = $ancestors->get($sosa);
                    $name    = $person->fullName();
                    $addname = $person->alternateName();

                    $text = I18N::reverseText($name);
                    if ($addname) {
                        $text .= "\n" . I18N::reverseText($addname);
                    }

                    $text .= "\n" . I18N::reverseText($person->getLifeSpan());

                    $background = $backgrounds[$person->sex()];

                    imagefilledarc($image, (int) $cx, (int) $cy, (int) $rx, (int) $rx, (int) $deg1, (int) $deg2, $background, IMG_ARC_PIE);

                    // split and center text by lines
                    $wmax = (int) ($angle * 7 / 7 * $scale);
                    $wmax = min($wmax, 35 * $scale);
                    if ($gen == 0) {
                        $wmax = min($wmax, 17 * $scale);
                    }
                    $text = $this->splitAlignText($text, (int) $wmax);

                    // text angle
                    $tangle = 270 - ($deg1 + $angle / 2);
                    if ($gen == 0) {
                        $tangle = 0;
                    }

                    // calculate text position
                    $deg = $deg1 + 0.44;
                    if ($deg2 - $deg1 > 40) {
                        $deg = $deg1 + ($deg2 - $deg1) / 11;
                    }
                    if ($deg2 - $deg1 > 80) {
                        $deg = $deg1 + ($deg2 - $deg1) / 7;
                    }
                    if ($deg2 - $deg1 > 140) {
                        $deg = $deg1 + ($deg2 - $deg1) / 4;
                    }
                    if ($gen == 0) {
                        $deg = 180;
                    }
                    $rad = deg2rad($deg);
                    $mr  = ($rx - $rw / 4) / 2;
                    if ($gen > 0 && $deg2 - $deg1 > 80) {
                        $mr = $rx / 2;
                    }
                    $tx = $cx + $mr * cos($rad);
                    $ty = $cy + $mr * sin($rad);
                    if ($sosa == 1) {
                        $ty -= $mr / 2;
                    }

                    // print text
                    imagettftext(
                        $image,
                        7,
                        $tangle,
                        (int) $tx,
                        (int) $ty,
                        $foreground,
                        Webtrees::ROOT_DIR . 'resources/fonts/DejaVuSans.ttf',
                        $text
                    );

                    $areas .= '<area shape="poly" coords="';
                    // plot upper points
                    $mr  = $rx / 2;
                    $deg = $deg1;
                    while ($deg <= $deg2) {
                        $rad   = deg2rad($deg);
                        $tx    = round($cx + $mr * cos($rad));
                        $ty    = round($cy + $mr * sin($rad));
                        $areas .= "$tx,$ty,";
                        $deg   += ($deg2 - $deg1) / 6;
                    }
                    // plot lower points
                    $mr  = ($rx - $rw) / 2;
                    $deg = $deg2;
                    while ($deg >= $deg1) {
                        $rad   = deg2rad($deg);
                        $tx    = round($cx + $mr * cos($rad));
                        $ty    = round($cy + $mr * sin($rad));
                        $areas .= "$tx,$ty,";
                        $deg   -= ($deg2 - $deg1) / 6;
                    }
                    // join first point
                    $mr    = $rx / 2;
                    $deg   = $deg1;
                    $rad   = deg2rad($deg);
                    $tx    = round($cx + $mr * cos($rad));
                    $ty    = round($cy + $mr * sin($rad));
                    $areas .= "$tx,$ty";
                    // add action url
                    $areas .= '" href="#' . $person->xref() . '"';
                    $html  .= '<div id="' . $person->xref() . '" class="fan_chart_menu">';
                    $html  .= '<div class="person_box"><div class="details1">';
                    $html .= '<div class="charts">';
                    $html  .= '<a href="' . e($person->url()) . '" class="dropdown-item">' . $name . '</a>';
                    foreach ($theme->individualBoxMenu($person) as $menu) {
                        $html .= '<a href="' . e($menu->getLink()) . '" class="dropdown-item p-1 ' . e($menu->getClass()) . '">' . $menu->getLabel() . '</a>';
                    }
                    $html  .= '</div>';
                    $html  .= '</div></div>';
                    $html  .= '</div>';
                    $areas .= ' alt="' . strip_tags($person->fullName()) . '" title="' . strip_tags($person->fullName()) . '">';
                }
                $deg1 -= $angle;
                $deg2 -= $angle;
                $sosa--;
            }
            $rx -= $rw;
            $gen--;
        }

        ob_start();
        imagepng($image);
        imagedestroy($image);
        $png = ob_get_clean();

        return response(view('modules/fanchart/chart', [
            'fanh'  => $fanh,
            'fanw'  => $fanw,
            'html'  => $html,
            'areas' => $areas,
            'png'   => $png,
            'title' => $this->chartTitle($individual),
        ]));
    }
876530
function updateLayout() {
      var layout = generator.layoutTemplate(newpage);
      $layout.html(generator.renderLayout(newpage));
      $layout.attr('data-render-layout', layout);
      log('jqueryview updateLayout', path, query, hash);
      generator.emit('update-view', path, query, hash, window, $layout);
    }
74280
function listLayout(): array
    {
        if(!$this->layoutBuilt) {
            $this->buildListLayout();
            $this->layoutBuilt = true;
        }

        return collect($this->columns)->map(function(EntityListLayoutColumn $column) {
            return $column->toArray();
        })->all();
    }
518986
protected function generateLayout()
    {
        if ($this->group === null) {
            throw new Exception('Group is not set.');
        }
        
        $request = $this->framework->getRequest();
        
        $accessLevelSelectorItems = $this->accessLevelHelper->transformAccessLevels(
            $this->accessLevelManager->getAccessLevels(),
            $request->getSession()->getUser(),
            $this->group
        );
        
        $rawPermissionsForUuid = $this->accessControlManager->getPermissionsRawForUuid($this->group->getUuid());
        if ($rawPermissionsForUuid === false) {
            $rawPermissionsForUuid = array();
        }
        
        $page = new Page(
            array(
                new Form('edit-group', $request->getFullRoute(), 'post', array(
                    new ErrorBox(
                        'edit-group-errors'
                    ),
                    new Tabs(
                        array(
                            new Tab(
                                array(
                                    new Row(
                                        array(
                                            new Column(array(
                                                new Group(
                                                    'required-data',
                                                    $this->translate('Required data', '\\Zepi\\Web\\AccessControl'),
                                                    array(
                                                        new Text(
                                                            'groupname',
                                                            $this->translate('Group name', '\\Zepi\\Web\\AccessControl'),
                                                            true,
                                                            $this->group->getName(),
                                                            $this->translate('The group name must be unique. Only one group can use a group name.', '\\Zepi\\Web\\AccessControl')
                                                        ),
                                                    ),
                                                    1
                                                )
                                            ), array('col-md-6')),
                                            new Column(array(
                                                new Group(
                                                    'optional-data',
                                                    $this->translate('Optional data', '\\Zepi\\Web\\AccessControl'),
                                                    array(
                                                        new Textarea(
                                                            'description',
                                                            $this->translate('Description', '\\Zepi\\Web\\AccessControl'),
                                                            false,
                                                                $this->group->getMetaData('description')
                                                        ),
                                                    ),
                                                    2
                                                )
                                            ), array('col-md-6')),
                                        )
                                    ),
                                ),
                                array(),
                                'group-tab',
                                $this->translate('Group informations', '\\Zepi\\Web\\AccessControl')
                            ),
                            new Tab(
                                array(
                                    new Selector(
                                        'access-levels',
                                        $this->translate('Access Level Selector', '\\Zepi\\Web\\AccessControl'),
                                        false,
                                        $rawPermissionsForUuid,
                                        $accessLevelSelectorItems,
                                        $this->translate('Available Access Levels', '\\Zepi\\Web\\AccessControl'),
                                        $this->translate('Granted Access Levels', '\\Zepi\\Web\\AccessControl'),
                                        '\\Zepi\\Web\\AccessControl\\Templates\\Form\\Snippet\\AccessLevel'
                                    ),
                                ),
                                array(),
                                'access-tab',
                                $this->translate('Permissions', '\\Zepi\\Web\\AccessControl')
                            )
                        )        
                    ),
                    new Row(
                        array(
                            new Column(array(
                                new ButtonGroup(
                                    'buttons-left',
                                    array(
                                        new Button(
                                            'back',
                                            $this->translate('Back', '\\Zepi\\Web\\AccessControl'),
                                            array('btn-default'),
                                            '',
                                            'a',
                                            $request->getFullRoute('/administration/groups/')
                                        )
                                    ),
                                    1000,
                                    array('text-left')
                                )
                            ), array('col-md-4')),
                            new Column(array(
                                new ButtonGroup(
                                    'buttons',
                                    array(
                                        new Submit(
                                            'submit',
                                            $this->translate('Save', '\\Zepi\\Web\\AccessControl'), 
                                            array('btn-large', 'btn-primary'),
                                            'mdi mdi-save'
                                        )
                                    ),
                                    1000
                                )
                            ), array('col-md-4'))
                        )
                    )
                ))
            )
        );
        
        return $page;
    }