{@inheritDoc}
@see \MyArtJaub\Webtrees\Module\GeoDispersion\Views\AbstractGeoAnalysisTabGeneralView::htmlAnalysisData()
777399
protected function htmlAnalysisData() {
        $results = $this->data->get('results');
        $analysis_level = $this->data->get('analysis_level');
        
        $nb_found = $this->data->get('stats_gen_nb_found');
        $nb_other = $this->data->get('stats_gen_nb_other');
        
        $i=1;
        $previous_nb=0;        
        
        $html='<div class="maj-table center">';        
        foreach($results as $place => $nb){
            $perc = Functions::safeDivision($nb, $nb_found - $nb_other);
            if($nb!=$previous_nb){
                $j= I18N::number($i);
            }
            else{
                $j='&nbsp;';
            }
            	
            $levels = array_map('trim',explode(',', $place));
            $placename = $levels[$analysis_level-1];
            if($placename == '' && $analysis_level > 1) $placename = I18N::translate('Unknown (%s)', $levels[$analysis_level-2]);
            $html.=
            '<div class="maj-row">
                <div class="label"><strong>'.$j.'</strong></div>
                <div class="label">'.$placename.'</div>
                <div class="value">'.I18N::translate('%d',$nb).'</div>
                <div class="value">'.I18N::percentage($perc,1).'</div>
             </div>';
            $i++;
            $previous_nb=$nb;
        }
        
        $html.='</div>';
        
        return $html;
    }
656940
public function setHeadData($data)
	{
		if (empty($data) || !is_array($data))
		{
			return;
		}

		$this->title        = (isset($data['title']) && !empty($data['title'])) ? $data['title'] : $this->title;
		$this->description  = (isset($data['description']) && !empty($data['description'])) ? $data['description'] : $this->description;
		$this->link         = (isset($data['link']) && !empty($data['link'])) ? $data['link'] : $this->link;

		$this->_metaTags    = (isset($data['metaTags']) && !empty($data['metaTags'])) ? $data['metaTags'] : $this->_metaTags;
		$this->_links       = (isset($data['links']) && !empty($data['links'])) ? $data['links'] : $this->_links;
		$this->_styleSheets = (isset($data['styleSheets']) && !empty($data['styleSheets'])) ? $data['styleSheets'] : $this->_styleSheets;
		$this->_style       = (isset($data['style']) && !empty($data['style'])) ? $data['style'] : $this->_style;
		$this->_scripts     = (isset($data['scripts']) && !empty($data['scripts'])) ? $data['scripts'] : $this->_scripts;
		$this->_script      = (isset($data['script']) && !empty($data['script'])) ? $data['script'] : $this->_script;
		$this->_custom      = (isset($data['custom']) && !empty($data['custom'])) ? $data['custom'] : $this->_custom;

		return $this;
	}
870674
public function currSessData($nID, $tbl, $fld = '', $action = 'get', $newVal = null, $hasParManip = false, 
        $itemInd = -3, $itemID = -3)
    {
        if (trim($tbl) == '' || trim($fld) == '' || !$this->loaded) {
            return '';
        }
        if (in_array($nID, $this->checkboxNodes) && $GLOBALS["SL"]->isFldCheckboxHelper($fld)) {
            $tblFld = $tbl . '-' . $fld;
            $this->helpInfo[$tblFld] = $this->getCheckboxHelperInfo($tbl, $fld);
            if ($this->helpInfo[$tblFld]["link"] && isset($this->helpInfo[$tblFld]["link"]->DataHelpValueField)) {
                return $this->currSessDataCheckbox($nID, $tbl, $fld);
            }
        }
        if ($itemInd < 0 || $itemID <= 0) {
            list($itemInd, $itemID) = $this->currSessDataPos($tbl, $hasParManip);
        }
        if ($itemInd < 0 || $itemID <= 0) {
            return '';
        }
        if ($action == 'get') {
            if ($this->dataFieldExists($tbl, $itemInd, $fld)) {
                return $this->dataSets[$tbl][$itemInd]->{ $fld };
            }
        } elseif ($action == 'update' && $fld != ($GLOBALS["SL"]->tblAbbr[$tbl] . 'ID')) {
            $this->logDataSave($nID, $tbl, $itemID, $fld, $newVal);
            if (trim($newVal) == '' && in_array($GLOBALS["SL"]->fldTypes[$tbl][$fld], ['INT', 'DOUBLE'])) {
                $newVal = null;
            } elseif ($GLOBALS["SL"]->fldTypes[$tbl][$fld] == 'INT') {
                $newVal = intVal($newVal);
            } elseif ($GLOBALS["SL"]->fldTypes[$tbl][$fld] == 'DOUBLE') {
                $newVal = floatval($newVal);
            } else {
                $newVal = strip_tags($newVal);
            }
            if (isset($this->dataSets[$tbl]) && isset($this->dataSets[$tbl][$itemInd])) {
                $this->dataSets[$tbl][$itemInd]->{ $fld } = $newVal;
                $this->dataSets[$tbl][$itemInd]->save();
                return $newVal;
            } else {
              //$GLOBALS["errors"] .= 'Couldn\'t find dataSets[' . $tbl . '][' . $itemInd . '] for ' . $fld . '<br />';
            }
        }
        return $newVal;
    }
1085121
public function writeInHTMLOutput()
  {
    $image = $this->applyFilters();

    if ($this->extension == self::IMAGE_TYPE_JPG) {
      ob_start();
      imagejpeg($image, null, $this->jpgQuality);
      $contents = ob_get_contents();
      ob_end_clean();

      $base64 = "data:image/jpeg;base64," . base64_encode($contents);
      echo "<img src=$base64 />";
    } else if ($this->extension == self::IMAGE_TYPE_PNG) {
      ob_start();
      imagepng($image, null, $this->pngCompression);
      $contents = ob_get_contents();
      ob_end_clean();

      $base64 = "data:image/png;base64," . base64_encode($contents);
      echo "<img src=$base64 />";
    } else {
      throw new \Exception('Impossible de générer l\'image : extension non supportée');
    }
  }
939143
function createOriginalAttributeXMLData( $originalNode, $originalData )
    {
        $originalNode->setAttribute( 'attribute_id', $originalData['attribute_id'] );
        $originalNode->setAttribute( 'attribute_version', $originalData['attribute_version'] );
        $originalNode->setAttribute( 'attribute_language', $originalData['attribute_language'] );
    }
1308865
public function analytics($id)
    {
        return $this->getView()->getRequest()->is('localhost') ? null : $this->Html->scriptBlock(
            sprintf('!function(e,a,t,n,c,o,s){e.GoogleAnalyticsObject=c,e[c]=e[c]||function(){(e[c].q=e[c].q||[]).push(arguments)},e[c].l=1*new Date,o=a.createElement(t),s=a.getElementsByTagName(t)[0],o.async=1,o.src=n,s.parentNode.insertBefore(o,s)}(window,document,"script","//www.google-analytics.com/analytics.js","ga"),ga("create","%s","auto"),ga("send","pageview");', $id),
            ['block' => 'script_bottom']
        );
    }
638425
public function output_html($data, $query='') {
        global $CFG, $OUTPUT;

        $return = "";
        $brtag = html_writer::empty_tag('br');

        /// One system controlling Moodle with Token
        $return .= $OUTPUT->heading(get_string('onesystemcontrolling', 'webservice'), 3, 'main');
        $table = new html_table();
        $table->head = array(get_string('step', 'webservice'), get_string('status'),
            get_string('description'));
        $table->colclasses = array('leftalign step', 'leftalign status', 'leftalign description');
        $table->id = 'onesystemcontrol';
        $table->attributes['class'] = 'admintable wsoverview generaltable';
        $table->data = array();

        $return .= $brtag . get_string('onesystemcontrollingdescription', 'webservice')
                . $brtag . $brtag;

        /// 1. Enable Web Services
        $row = array();
        $url = new moodle_url("/admin/search.php?query=enablewebservices");
        $row[0] = "1. " . html_writer::tag('a', get_string('enablews', 'webservice'),
                        array('href' => $url));
        $status = html_writer::tag('span', get_string('no'), array('class' => 'statuscritical'));
        if ($CFG->enablewebservices) {
            $status = get_string('yes');
        }
        $row[1] = $status;
        $row[2] = get_string('enablewsdescription', 'webservice');
        $table->data[] = $row;

        /// 2. Enable protocols
        $row = array();
        $url = new moodle_url("/admin/settings.php?section=webserviceprotocols");
        $row[0] = "2. " . html_writer::tag('a', get_string('enableprotocols', 'webservice'),
                        array('href' => $url));
        $status = html_writer::tag('span', get_string('none'), array('class' => 'statuscritical'));
        //retrieve activated protocol
        $active_protocols = empty($CFG->webserviceprotocols) ?
                array() : explode(',', $CFG->webserviceprotocols);
        if (!empty($active_protocols)) {
            $status = "";
            foreach ($active_protocols as $protocol) {
                $status .= $protocol . $brtag;
            }
        }
        $row[1] = $status;
        $row[2] = get_string('enableprotocolsdescription', 'webservice');
        $table->data[] = $row;

        /// 3. Create user account
        $row = array();
        $url = new moodle_url("/user/editadvanced.php?id=-1");
        $row[0] = "3. " . html_writer::tag('a', get_string('createuser', 'webservice'),
                        array('href' => $url));
        $row[1] = "";
        $row[2] = get_string('createuserdescription', 'webservice');
        $table->data[] = $row;

        /// 4. Add capability to users
        $row = array();
        $url = new moodle_url("/admin/roles/check.php?contextid=1");
        $row[0] = "4. " . html_writer::tag('a', get_string('checkusercapability', 'webservice'),
                        array('href' => $url));
        $row[1] = "";
        $row[2] = get_string('checkusercapabilitydescription', 'webservice');
        $table->data[] = $row;

        /// 5. Select a web service
        $row = array();
        $url = new moodle_url("/admin/settings.php?section=externalservices");
        $row[0] = "5. " . html_writer::tag('a', get_string('selectservice', 'webservice'),
                        array('href' => $url));
        $row[1] = "";
        $row[2] = get_string('createservicedescription', 'webservice');
        $table->data[] = $row;

        /// 6. Add functions
        $row = array();
        $url = new moodle_url("/admin/settings.php?section=externalservices");
        $row[0] = "6. " . html_writer::tag('a', get_string('addfunctions', 'webservice'),
                        array('href' => $url));
        $row[1] = "";
        $row[2] = get_string('addfunctionsdescription', 'webservice');
        $table->data[] = $row;

        /// 7. Add the specific user
        $row = array();
        $url = new moodle_url("/admin/settings.php?section=externalservices");
        $row[0] = "7. " . html_writer::tag('a', get_string('selectspecificuser', 'webservice'),
                        array('href' => $url));
        $row[1] = "";
        $row[2] = get_string('selectspecificuserdescription', 'webservice');
        $table->data[] = $row;

        /// 8. Create token for the specific user
        $row = array();
        $url = new moodle_url("/admin/webservice/tokens.php?sesskey=" . sesskey() . "&action=create");
        $row[0] = "8. " . html_writer::tag('a', get_string('createtokenforuser', 'webservice'),
                        array('href' => $url));
        $row[1] = "";
        $row[2] = get_string('createtokenforuserdescription', 'webservice');
        $table->data[] = $row;

        /// 9. Enable the documentation
        $row = array();
        $url = new moodle_url("/admin/search.php?query=enablewsdocumentation");
        $row[0] = "9. " . html_writer::tag('a', get_string('enabledocumentation', 'webservice'),
                        array('href' => $url));
        $status = '<span class="warning">' . get_string('no') . '</span>';
        if ($CFG->enablewsdocumentation) {
            $status = get_string('yes');
        }
        $row[1] = $status;
        $row[2] = get_string('enabledocumentationdescription', 'webservice');
        $table->data[] = $row;

        /// 10. Test the service
        $row = array();
        $url = new moodle_url("/admin/webservice/testclient.php");
        $row[0] = "10. " . html_writer::tag('a', get_string('testwithtestclient', 'webservice'),
                        array('href' => $url));
        $row[1] = "";
        $row[2] = get_string('testwithtestclientdescription', 'webservice');
        $table->data[] = $row;

        $return .= html_writer::table($table);

        /// Users as clients with token
        $return .= $brtag . $brtag . $brtag;
        $return .= $OUTPUT->heading(get_string('userasclients', 'webservice'), 3, 'main');
        $table = new html_table();
        $table->head = array(get_string('step', 'webservice'), get_string('status'),
            get_string('description'));
        $table->colclasses = array('leftalign step', 'leftalign status', 'leftalign description');
        $table->id = 'userasclients';
        $table->attributes['class'] = 'admintable wsoverview generaltable';
        $table->data = array();

        $return .= $brtag . get_string('userasclientsdescription', 'webservice') .
                $brtag . $brtag;

        /// 1. Enable Web Services
        $row = array();
        $url = new moodle_url("/admin/search.php?query=enablewebservices");
        $row[0] = "1. " . html_writer::tag('a', get_string('enablews', 'webservice'),
                        array('href' => $url));
        $status = html_writer::tag('span', get_string('no'), array('class' => 'statuscritical'));
        if ($CFG->enablewebservices) {
            $status = get_string('yes');
        }
        $row[1] = $status;
        $row[2] = get_string('enablewsdescription', 'webservice');
        $table->data[] = $row;

        /// 2. Enable protocols
        $row = array();
        $url = new moodle_url("/admin/settings.php?section=webserviceprotocols");
        $row[0] = "2. " . html_writer::tag('a', get_string('enableprotocols', 'webservice'),
                        array('href' => $url));
        $status = html_writer::tag('span', get_string('none'), array('class' => 'statuscritical'));
        //retrieve activated protocol
        $active_protocols = empty($CFG->webserviceprotocols) ?
                array() : explode(',', $CFG->webserviceprotocols);
        if (!empty($active_protocols)) {
            $status = "";
            foreach ($active_protocols as $protocol) {
                $status .= $protocol . $brtag;
            }
        }
        $row[1] = $status;
        $row[2] = get_string('enableprotocolsdescription', 'webservice');
        $table->data[] = $row;


        /// 3. Select a web service
        $row = array();
        $url = new moodle_url("/admin/settings.php?section=externalservices");
        $row[0] = "3. " . html_writer::tag('a', get_string('selectservice', 'webservice'),
                        array('href' => $url));
        $row[1] = "";
        $row[2] = get_string('createserviceforusersdescription', 'webservice');
        $table->data[] = $row;

        /// 4. Add functions
        $row = array();
        $url = new moodle_url("/admin/settings.php?section=externalservices");
        $row[0] = "4. " . html_writer::tag('a', get_string('addfunctions', 'webservice'),
                        array('href' => $url));
        $row[1] = "";
        $row[2] = get_string('addfunctionsdescription', 'webservice');
        $table->data[] = $row;

        /// 5. Add capability to users
        $row = array();
        $url = new moodle_url("/admin/roles/check.php?contextid=1");
        $row[0] = "5. " . html_writer::tag('a', get_string('addcapabilitytousers', 'webservice'),
                        array('href' => $url));
        $row[1] = "";
        $row[2] = get_string('addcapabilitytousersdescription', 'webservice');
        $table->data[] = $row;

        /// 6. Test the service
        $row = array();
        $url = new moodle_url("/admin/webservice/testclient.php");
        $row[0] = "6. " . html_writer::tag('a', get_string('testwithtestclient', 'webservice'),
                        array('href' => $url));
        $row[1] = "";
        $row[2] = get_string('testauserwithtestclientdescription', 'webservice');
        $table->data[] = $row;

        $return .= html_writer::table($table);

        return highlight($query, $return);
    }
732726
function Analyze() {
		$info = &$this->getid3->info;

		$info['fileformat'] = 'ogg';

		// Warn about illegal tags - only vorbiscomments are allowed
		if (isset($info['id3v2'])) {
			$info['warning'][] = 'Illegal ID3v2 tag present.';
		}
		if (isset($info['id3v1'])) {
			$info['warning'][] = 'Illegal ID3v1 tag present.';
		}
		if (isset($info['ape'])) {
			$info['warning'][] = 'Illegal APE tag present.';
		}


		// Page 1 - Stream Header

		fseek($this->getid3->fp, $info['avdataoffset'], SEEK_SET);

		$oggpageinfo = $this->ParseOggPageHeader();
		$info['ogg']['pageheader'][$oggpageinfo['page_seqno']] = $oggpageinfo;

		if (ftell($this->getid3->fp) >= $this->getid3->fread_buffer_size()) {
			$info['error'][] = 'Could not find start of Ogg page in the first '.$this->getid3->fread_buffer_size().' bytes (this might not be an Ogg-Vorbis file?)';
			unset($info['fileformat']);
			unset($info['ogg']);
			return false;
		}

		$filedata = fread($this->getid3->fp, $oggpageinfo['page_length']);
		$filedataoffset = 0;

		if (substr($filedata, 0, 4) == 'fLaC') {

			$info['audio']['dataformat']   = 'flac';
			$info['audio']['bitrate_mode'] = 'vbr';
			$info['audio']['lossless']     = true;

		} elseif (substr($filedata, 1, 6) == 'vorbis') {

			$this->ParseVorbisPageHeader($filedata, $filedataoffset, $oggpageinfo);

		} elseif (substr($filedata, 0, 8) == 'Speex   ') {

			// http://www.speex.org/manual/node10.html

			$info['audio']['dataformat']   = 'speex';
			$info['mime_type']             = 'audio/speex';
			$info['audio']['bitrate_mode'] = 'abr';
			$info['audio']['lossless']     = false;

			$info['ogg']['pageheader'][$oggpageinfo['page_seqno']]['speex_string']           =                              substr($filedata, $filedataoffset, 8); // hard-coded to 'Speex   '
			$filedataoffset += 8;
			$info['ogg']['pageheader'][$oggpageinfo['page_seqno']]['speex_version']          =                              substr($filedata, $filedataoffset, 20);
			$filedataoffset += 20;
			$info['ogg']['pageheader'][$oggpageinfo['page_seqno']]['speex_version_id']       = getid3_lib::LittleEndian2Int(substr($filedata, $filedataoffset, 4));
			$filedataoffset += 4;
			$info['ogg']['pageheader'][$oggpageinfo['page_seqno']]['header_size']            = getid3_lib::LittleEndian2Int(substr($filedata, $filedataoffset, 4));
			$filedataoffset += 4;
			$info['ogg']['pageheader'][$oggpageinfo['page_seqno']]['rate']                   = getid3_lib::LittleEndian2Int(substr($filedata, $filedataoffset, 4));
			$filedataoffset += 4;
			$info['ogg']['pageheader'][$oggpageinfo['page_seqno']]['mode']                   = getid3_lib::LittleEndian2Int(substr($filedata, $filedataoffset, 4));
			$filedataoffset += 4;
			$info['ogg']['pageheader'][$oggpageinfo['page_seqno']]['mode_bitstream_version'] = getid3_lib::LittleEndian2Int(substr($filedata, $filedataoffset, 4));
			$filedataoffset += 4;
			$info['ogg']['pageheader'][$oggpageinfo['page_seqno']]['nb_channels']            = getid3_lib::LittleEndian2Int(substr($filedata, $filedataoffset, 4));
			$filedataoffset += 4;
			$info['ogg']['pageheader'][$oggpageinfo['page_seqno']]['bitrate']                = getid3_lib::LittleEndian2Int(substr($filedata, $filedataoffset, 4));
			$filedataoffset += 4;
			$info['ogg']['pageheader'][$oggpageinfo['page_seqno']]['framesize']              = getid3_lib::LittleEndian2Int(substr($filedata, $filedataoffset, 4));
			$filedataoffset += 4;
			$info['ogg']['pageheader'][$oggpageinfo['page_seqno']]['vbr']                    = getid3_lib::LittleEndian2Int(substr($filedata, $filedataoffset, 4));
			$filedataoffset += 4;
			$info['ogg']['pageheader'][$oggpageinfo['page_seqno']]['frames_per_packet']      = getid3_lib::LittleEndian2Int(substr($filedata, $filedataoffset, 4));
			$filedataoffset += 4;
			$info['ogg']['pageheader'][$oggpageinfo['page_seqno']]['extra_headers']          = getid3_lib::LittleEndian2Int(substr($filedata, $filedataoffset, 4));
			$filedataoffset += 4;
			$info['ogg']['pageheader'][$oggpageinfo['page_seqno']]['reserved1']              = getid3_lib::LittleEndian2Int(substr($filedata, $filedataoffset, 4));
			$filedataoffset += 4;
			$info['ogg']['pageheader'][$oggpageinfo['page_seqno']]['reserved2']              = getid3_lib::LittleEndian2Int(substr($filedata, $filedataoffset, 4));
			$filedataoffset += 4;

			$info['speex']['speex_version'] = trim($info['ogg']['pageheader'][$oggpageinfo['page_seqno']]['speex_version']);
			$info['speex']['sample_rate']   = $info['ogg']['pageheader'][$oggpageinfo['page_seqno']]['rate'];
			$info['speex']['channels']      = $info['ogg']['pageheader'][$oggpageinfo['page_seqno']]['nb_channels'];
			$info['speex']['vbr']           = (bool) $info['ogg']['pageheader'][$oggpageinfo['page_seqno']]['vbr'];
			$info['speex']['band_type']     = $this->SpeexBandModeLookup($info['ogg']['pageheader'][$oggpageinfo['page_seqno']]['mode']);

			$info['audio']['sample_rate']   = $info['speex']['sample_rate'];
			$info['audio']['channels']      = $info['speex']['channels'];
			if ($info['speex']['vbr']) {
				$info['audio']['bitrate_mode'] = 'vbr';
			}


		} elseif (substr($filedata, 0, 8) == "fishead\x00") {

			// Ogg Skeleton version 3.0 Format Specification
			// http://xiph.org/ogg/doc/skeleton.html
			$filedataoffset += 8;
			$info['ogg']['skeleton']['fishead']['raw']['version_major']                = getid3_lib::LittleEndian2Int(substr($filedata, $filedataoffset,  2));
			$filedataoffset += 2;
			$info['ogg']['skeleton']['fishead']['raw']['version_minor']                = getid3_lib::LittleEndian2Int(substr($filedata, $filedataoffset,  2));
			$filedataoffset += 2;
			$info['ogg']['skeleton']['fishead']['raw']['presentationtime_numerator']   = getid3_lib::LittleEndian2Int(substr($filedata, $filedataoffset,  8));
			$filedataoffset += 8;
			$info['ogg']['skeleton']['fishead']['raw']['presentationtime_denominator'] = getid3_lib::LittleEndian2Int(substr($filedata, $filedataoffset,  8));
			$filedataoffset += 8;
			$info['ogg']['skeleton']['fishead']['raw']['basetime_numerator']           = getid3_lib::LittleEndian2Int(substr($filedata, $filedataoffset,  8));
			$filedataoffset += 8;
			$info['ogg']['skeleton']['fishead']['raw']['basetime_denominator']         = getid3_lib::LittleEndian2Int(substr($filedata, $filedataoffset,  8));
			$filedataoffset += 8;
			$info['ogg']['skeleton']['fishead']['raw']['utc']                          = getid3_lib::LittleEndian2Int(substr($filedata, $filedataoffset, 20));
			$filedataoffset += 20;

			$info['ogg']['skeleton']['fishead']['version']          = $info['ogg']['skeleton']['fishead']['raw']['version_major'].'.'.$info['ogg']['skeleton']['fishead']['raw']['version_minor'];
			$info['ogg']['skeleton']['fishead']['presentationtime'] = $info['ogg']['skeleton']['fishead']['raw']['presentationtime_numerator'] / $info['ogg']['skeleton']['fishead']['raw']['presentationtime_denominator'];
			$info['ogg']['skeleton']['fishead']['basetime']         = $info['ogg']['skeleton']['fishead']['raw']['basetime_numerator']         / $info['ogg']['skeleton']['fishead']['raw']['basetime_denominator'];
			$info['ogg']['skeleton']['fishead']['utc']              = $info['ogg']['skeleton']['fishead']['raw']['utc'];


			$counter = 0;
			do {
				$oggpageinfo = $this->ParseOggPageHeader();
				$info['ogg']['pageheader'][$oggpageinfo['page_seqno'].'.'.$counter++] = $oggpageinfo;
				$filedata = fread($this->getid3->fp, $oggpageinfo['page_length']);
				fseek($this->getid3->fp, $oggpageinfo['page_end_offset'], SEEK_SET);

				if (substr($filedata, 0, 8) == "fisbone\x00") {

					$filedataoffset = 8;
					$info['ogg']['skeleton']['fisbone']['raw']['message_header_offset']   = getid3_lib::LittleEndian2Int(substr($filedata, $filedataoffset,  4));
					$filedataoffset += 4;
					$info['ogg']['skeleton']['fisbone']['raw']['serial_number']           = getid3_lib::LittleEndian2Int(substr($filedata, $filedataoffset,  4));
					$filedataoffset += 4;
					$info['ogg']['skeleton']['fisbone']['raw']['number_header_packets']   = getid3_lib::LittleEndian2Int(substr($filedata, $filedataoffset,  4));
					$filedataoffset += 4;
					$info['ogg']['skeleton']['fisbone']['raw']['granulerate_numerator']   = getid3_lib::LittleEndian2Int(substr($filedata, $filedataoffset,  8));
					$filedataoffset += 8;
					$info['ogg']['skeleton']['fisbone']['raw']['granulerate_denominator'] = getid3_lib::LittleEndian2Int(substr($filedata, $filedataoffset,  8));
					$filedataoffset += 8;
					$info['ogg']['skeleton']['fisbone']['raw']['basegranule']             = getid3_lib::LittleEndian2Int(substr($filedata, $filedataoffset,  8));
					$filedataoffset += 8;
					$info['ogg']['skeleton']['fisbone']['raw']['preroll']                 = getid3_lib::LittleEndian2Int(substr($filedata, $filedataoffset,  4));
					$filedataoffset += 4;
					$info['ogg']['skeleton']['fisbone']['raw']['granuleshift']            = getid3_lib::LittleEndian2Int(substr($filedata, $filedataoffset,  1));
					$filedataoffset += 1;
					$info['ogg']['skeleton']['fisbone']['raw']['padding']                 =                              substr($filedata, $filedataoffset,  3);
					$filedataoffset += 3;

				} elseif (substr($filedata, 1, 6) == 'theora') {

					$info['video']['dataformat'] = 'theora';
$info['error'][] = 'Ogg Theora not correctly handled in this version of getID3 ['.$this->getid3->version().']';
//break;

				} elseif (substr($filedata, 1, 6) == 'vorbis') {

					$this->ParseVorbisPageHeader($filedata, $filedataoffset, $oggpageinfo);

				} else {
$info['error'][] = 'unexpected';
//break;
				}
			//} while ($oggpageinfo['page_seqno'] == 0);
			} while (($oggpageinfo['page_seqno'] == 0) && (substr($filedata, 0, 8) != "fisbone\x00"));
			fseek($this->getid3->fp, $oggpageinfo['page_start_offset'], SEEK_SET);


$info['error'][] = 'Ogg Skeleton not correctly handled in this version of getID3 ['.$this->getid3->version().']';
//return false;


		} else {

			$info['error'][] = 'Expecting either "Speex   " or "vorbis" identifier strings, found "'.substr($filedata, 0, 8).'"';
			unset($info['ogg']);
			unset($info['mime_type']);
			return false;

		}

		// Page 2 - Comment Header
		$oggpageinfo = $this->ParseOggPageHeader();
		$info['ogg']['pageheader'][$oggpageinfo['page_seqno']] = $oggpageinfo;

		switch ($info['audio']['dataformat']) {
			case 'vorbis':
				$filedata = fread($this->getid3->fp, $info['ogg']['pageheader'][$oggpageinfo['page_seqno']]['page_length']);
				$info['ogg']['pageheader'][$oggpageinfo['page_seqno']]['packet_type'] = getid3_lib::LittleEndian2Int(substr($filedata, 0, 1));
				$info['ogg']['pageheader'][$oggpageinfo['page_seqno']]['stream_type'] =                              substr($filedata, 1, 6); // hard-coded to 'vorbis'

				$this->ParseVorbisCommentsFilepointer();
				break;

			case 'flac':
				$getid3_flac = new getid3_flac($this->getid3);
				if (!$getid3_flac->FLACparseMETAdata()) {
					$info['error'][] = 'Failed to parse FLAC headers';
					return false;
				}
				unset($getid3_flac);
				break;

			case 'speex':
				fseek($this->getid3->fp, $info['ogg']['pageheader'][$oggpageinfo['page_seqno']]['page_length'], SEEK_CUR);
				$this->ParseVorbisCommentsFilepointer();
				break;

		}



		// Last Page - Number of Samples

		if (!getid3_lib::intValueSupported($info['avdataend'])) {

			$info['warning'][] = 'Unable to parse Ogg end chunk file (PHP does not support file operations beyond '.round(PHP_INT_MAX / 1073741824).'GB)';

		} else {

			fseek($this->getid3->fp, max($info['avdataend'] - $this->getid3->fread_buffer_size(), 0), SEEK_SET);
			$LastChunkOfOgg = strrev(fread($this->getid3->fp, $this->getid3->fread_buffer_size()));
			if ($LastOggSpostion = strpos($LastChunkOfOgg, 'SggO')) {
				fseek($this->getid3->fp, $info['avdataend'] - ($LastOggSpostion + strlen('SggO')), SEEK_SET);
				$info['avdataend'] = ftell($this->getid3->fp);
				$info['ogg']['pageheader']['eos'] = $this->ParseOggPageHeader();
				$info['ogg']['samples']   = $info['ogg']['pageheader']['eos']['pcm_abs_position'];
				if ($info['ogg']['samples'] == 0) {
					$info['error'][] = 'Corrupt Ogg file: eos.number of samples == zero';
					return false;
				}
				if (!empty($info['audio']['sample_rate'])) {
					$info['ogg']['bitrate_average'] = (($info['avdataend'] - $info['avdataoffset']) * 8) / ($info['ogg']['samples'] / $info['audio']['sample_rate']);
				}
			}

		}

		if (!empty($info['ogg']['bitrate_average'])) {
			$info['audio']['bitrate'] = $info['ogg']['bitrate_average'];
		} elseif (!empty($info['ogg']['bitrate_nominal'])) {
			$info['audio']['bitrate'] = $info['ogg']['bitrate_nominal'];
		} elseif (!empty($info['ogg']['bitrate_min']) && !empty($info['ogg']['bitrate_max'])) {
			$info['audio']['bitrate'] = ($info['ogg']['bitrate_min'] + $info['ogg']['bitrate_max']) / 2;
		}
		if (isset($info['audio']['bitrate']) && !isset($info['playtime_seconds'])) {
			if ($info['audio']['bitrate'] == 0) {
				$info['error'][] = 'Corrupt Ogg file: bitrate_audio == zero';
				return false;
			}
			$info['playtime_seconds'] = (float) ((($info['avdataend'] - $info['avdataoffset']) * 8) / $info['audio']['bitrate']);
		}

		if (isset($info['ogg']['vendor'])) {
			$info['audio']['encoder'] = preg_replace('/^Encoded with /', '', $info['ogg']['vendor']);

			// Vorbis only
			if ($info['audio']['dataformat'] == 'vorbis') {

				// Vorbis 1.0 starts with Xiph.Org
				if  (preg_match('/^Xiph.Org/', $info['audio']['encoder'])) {

					if ($info['audio']['bitrate_mode'] == 'abr') {

						// Set -b 128 on abr files
						$info['audio']['encoder_options'] = '-b '.round($info['ogg']['bitrate_nominal'] / 1000);

					} elseif (($info['audio']['bitrate_mode'] == 'vbr') && ($info['audio']['channels'] == 2) && ($info['audio']['sample_rate'] >= 44100) && ($info['audio']['sample_rate'] <= 48000)) {
						// Set -q N on vbr files
						$info['audio']['encoder_options'] = '-q '.$this->get_quality_from_nominal_bitrate($info['ogg']['bitrate_nominal']);

					}
				}

				if (empty($info['audio']['encoder_options']) && !empty($info['ogg']['bitrate_nominal'])) {
					$info['audio']['encoder_options'] = 'Nominal bitrate: '.intval(round($info['ogg']['bitrate_nominal'] / 1000)).'kbps';
				}
			}
		}

		return true;
	}
707824
public function getHtmlOutput(\Zend_View_Abstract $view)
    {
        $tabs = $this->getTabs();

        $tabCount = count($tabs);

        if ($tabs && ($this->displaySingleTab || $tabCount > 1)) {
            // Is there a better helper to include JS?
            $view->headScript()->appendFile($this->basepath->getBasePath()  .  '/gems/js/jquery.horizontalScrollMenu.js');

            $script = '(function($) {$(".'.$this->class.'").horizontalScrollMenu();}(jQuery));';

            $view->inlineScript()->appendScript($script);

            // Set the correct parameters
            $this->getCurrentTab();


            $scrollContainer = \MUtil_Html::create()->div();

            if ($tabCount > $this->scrollFromSize) {
                $scrollContainer->a('#', $this->prevLabel, array('class' => 'prev'));
            } else {
                $scrollContainer->span(array('class' => 'prev disabled'))
                        ->raw(str_repeat('&nbsp', strlen($this->prevLabel)));
            }

            $tabRow = $scrollContainer->div(array('class' => 'container'))->ul();

            foreach ($tabs as $tabId => $content) {
                $li = $tabRow->li(array('class' => $this->tabClass));

                if (strlen($content) > $this->tabLabelLength) {
                    $content = substr($content, 0, $this->tabLabelLength) . $this->tabLabelCutOffString;
                }

                $li->a($this->getParameterKeysFor($tabId) + $this->href, $content);

                if ($tabId == $this->currentTab) {
                    $li->appendAttrib('class', $this->tabActiveClass);
                }
            }

            if ($tabCount > $this->scrollFromSize) {
                $scrollContainer->a('#', $this->nextLabel, array('class' => 'next'));
            } else {
                $scrollContainer->span(array('class' => 'next disabled'))
                        ->raw(str_repeat('&nbsp', strlen($this->nextLabel)));
            }

            return $scrollContainer;
        } else {
            return null;
        }
    }
221013
public static void writeAnalysisHTMLToFile(String outputPath, DataAnalysis dataAnalysis, JavaSparkContext sc) {
        try {
            String analysisAsHtml = HtmlAnalysis.createHtmlAnalysisString(dataAnalysis);
            writeStringToFile(outputPath, analysisAsHtml, sc);
        } catch (Exception e) {
            throw new RuntimeException("Error generating or writing HTML analysis file (normalized data)", e);
        }
    }
706151
public function output_html($data, $query='') {
        global $OUTPUT, $PAGE;

        $default = $this->get_defaultsetting();
        $context = (object) [
            'id' => $this->get_id(),
            'name' => $this->get_full_name(),
            'value' => $data,
            'descriptions' => $this->util->describe_file_types($data),
        ];
        $element = $OUTPUT->render_from_template('core_admin/setting_filetypes', $context);

        $PAGE->requires->js_call_amd('core_form/filetypes', 'init', [
            $this->get_id(),
            $this->visiblename->out(),
            $this->onlytypes,
            $this->allowall,
        ]);

        return format_admin_setting($this, $this->visiblename, $element, $this->description, true, '', $default, $query);
    }
889956
public function index() {
        
        $controller = new PageController();
        $controller->setPageTitle(I18N::translate('Sosa Geographical dispersion'));
        
        $data = new ViewBag();
        $data->set('title', $controller->getPageTitle());
        $data->set('has_analysis', false);
        
        $ga_id = Filter::getInteger('ga_id');        
        
        if($ga_id && $ga = $this->provider->getGeoAnalysis($ga_id)) {
            $data->set('has_analysis', true);
            $data->set('geoanalysis', $ga);
            
            $controller
                ->addExternalJavascript(Constants::WT_RAPHAEL_JS_URL())
                ->addInlineJavascript('
                jQuery("#geodispersion-tabs").tabs();
                jQuery("#geodispersion-tabs").css("visibility", "visible");
                
                jQuery.get(
					"module.php",
					{
                        "mod" : "'. $this->module->getName() .'",  
                        "mod_action": "GeoAnalysis@dataTabs",
                        "ga_id" : "'.$ga_id.'"
                    },
					function(data){
						if(data){	    
							jQuery("#geodisp-data-general").html(data.generaltab);
							jQuery("#geodisp-data-generations").html(data.generationstab);
					    }
					    jQuery(".loading-image").hide();				    		
					},
					"json"
				);
            ');
        }
        
        ViewFactory::make('GeoAnalysis', $this, $controller, $data)->render();
    }
280651
public function htmlReport($data=[])
    {
        // Forcefully remove headers that might have been set by some
        // templates, controllers or plugins when rendering pages.
        header_remove();
        $root = dirname(__DIR__);
        $data['styles'] = file_get_contents($root . '/assets/report.css');
        $data['script'] = file_get_contents($root . '/assets/report.js');
        $body = Tpl::load(__DIR__ . '/report.php', $data);
        return new Response($body, 'html', $data['error'] ? 500 : 200);
    }
114398
protected function renderContent() {
        
        /** @var GeoAnalysis $ga */
        $ga = $this->data->get('geo_analysis');
        $is_new = is_null($ga);
        
        $places_hierarchy = $this->data->get('places_hierarchy');
        ?>        
        <ol class="breadcrumb small">
        	<li><a href="admin.php"><?php echo I18N::translate('Control panel'); ?></a></li>
			<li><a href="admin_modules.php"><?php echo I18N::translate('Module administration'); ?></a></li>
			<li><a href="<?php echo $this->data->get('admin_config_url'); ?>"><?php echo $this->data->get('module_title'); ?></a></li>
			<li class="active"><?php echo $this->data->get('title'); ?></li>
		</ol>
		
		<h1><?php echo $this->data->get('title'); ?></h1>
		
		<form class="form-horizontal" name="newform" method="post" role="form" action="<?php echo $this->data->get('save_url'); ?>" autocomplete="off">
    		<?php echo Filter::getCsrf(); ?>
    		<?php if(!$is_new) { ?>
    		<input type="hidden" name="ga_id" value="<?php echo $ga->getId(); ?>">
    		<?php } ?>
    
    		<!-- DESCRIPTION -->
    		<div class="form-group">
    			<label class="control-label col-sm-3" for="description">
    				<?php echo I18N::translate('Description'); ?>
    			</label>
    			<div class="col-sm-9">
    				<input class="form-control" type="text" id="description" name="description" required maxlength="70" <?php if(!$is_new) echo 'value="' . Filter::escapeHtml($ga->getTitle()) .'"'; ?> dir="auto">
    				<p class="small text-muted">
    					<?php echo I18N::translate('Description to be given to the geographical dispersion analysis. It will be used as the page title for it.'); ?>
    				</p>
    			</div>
    		</div>
    		
    		<!-- ANALYSIS LEVEL -->
    		<div class="form-group">
    			<label class="control-label col-sm-3" for="analysislevel">
    				<?php echo I18N::translate('Analysis level'); ?>
    			</label>
    			<div class="col-sm-9">
    				<?php echo FunctionsEdit::selectEditControl('analysislevel', $places_hierarchy['hierarchy'], null, $is_new ? '' : $ga->getAnalysisLevel() - 1, 'class="form-control"'); ?>
				    <p class="small text-muted">
    					<?php echo I18N::translate('Subdivision level used for the analysis.'); ?>
    				</p>
    			</div>
    		</div>
    		
    		<h3><?php echo I18N::translate('Display options'); ?></h3>
    		
    		<!-- USE MAP -->
    		<div class="form-group">
    			<label class="control-label col-sm-3" for="use_map">
    				<?php echo I18N::translate('Use map'); ?>
    			</label>
    			<div class="col-sm-9">
    				<?php echo FunctionsEdit::editFieldYesNo('use_map', !$is_new && ($ga && $ga->hasMap()) ? 1 : 0, 'class="radio-inline"'); ?>
				    <p class="small text-muted">
    					<?php echo I18N::translate('Displays the results on a map.'); ?>
    				</p>
    			</div>
    		</div>
    		
    		<div id="map_options">
    		
    		    <!-- MAP -->
        		<div class="form-group">
        			<label class="control-label col-sm-3" for="map_file">
        				<?php echo I18N::translate('Map'); ?>
        			</label>
        			<div class="col-sm-9">
        				<?php echo FunctionsEdit::selectEditControl('map_file', $this->data->get('map_list') , null, ($is_new || ! $ga->hasMap()) ? '' : base64_encode($ga->getOptions()->getMap()->getFileName()), 'class="form-control"'); ?>
        				<p class="small text-muted">
        					<?php echo I18N::translate('Map outline to be used for the result display.'); ?>
        				</p>
        			</div>
        		</div>
        		
        		<!-- MAP TOP LEVEL -->
        		<div class="form-group">
        			<label class="control-label col-sm-3" for="map_top_level">
        				<?php echo I18N::translate('Map parent level'); ?>
        			</label>
        			<div class="col-sm-9">
        				<?php echo FunctionsEdit::selectEditControl('map_top_level', $places_hierarchy['hierarchy'], null, $is_new || ! $ga->hasMap() ? '' : $ga->getOptions()->getMapLevel() - 1, 'class="form-control"'); ?>
        				<p class="small text-muted">
        					<?php echo I18N::translate('Subdivision level of the parent subdivision(s) represented by the map.'); ?><br />
        					<?php echo I18N::translate('For instance, if the map is intended to represent a country by county analysis, then the map parent level would be “Country”, and the analysis level would be “County”.'); ?>
        				</p>
        			</div>
        		</div>
    		</div>
    		
    		<!-- USE FLAGS -->
    		<div class="form-group">
    			<label class="control-label col-sm-3" for="use_flags">
    				<?php echo I18N::translate('Use flags'); ?>
    			</label>
    			<div class="col-sm-9">
    				<?php echo FunctionsEdit::editFieldYesNo('use_flags', !$is_new && ($ga && $ga->getOptions()->isUsingFlags()) ? 1 : 0, 'class="radio-inline"'); ?>
				    <p class="small text-muted">
    					<?php echo I18N::translate('Display the place\'s flag, instead of or in addition to the place name.'); ?>
    				</p>
    			</div>
    		</div>
    		
    		<!-- GENERATION DETAILS -->
    		<div class="form-group">
    			<label class="control-label col-sm-3" for="gen_details">
    				<?php echo I18N::translate('Top places number'); ?>
    			</label>
    			<div class="col-sm-9">
    				<?php echo FunctionsEdit::selectEditControl('gen_details', $this->data->get('generation_details'), null, !$is_new && ($ga && $ga->getOptions()) ? $ga->getOptions()->getMaxDetailsInGen() : 0, 'class="form-control"'); ?>
				    <p class="small text-muted">
    					<?php echo I18N::translate('Set the number of top places to display in the generation breakdown view.'); ?>
    				</p>
    			</div>
    		</div>
    		
    		<div class="form-group">
    			<div class="col-sm-offset-3 col-sm-9">
    				<button type="submit" class="btn btn-primary">
    					<?php echo $is_new ? I18N::translate('Add') : I18N::translate('save'); ?>
    				</button>
    			</div>
    		</div>
    	</form>
		
		<?php        
    }
728161
function getReportHtml(oData) {
		return getResources().then(function () {
			var styles = [],
				scripts = [],
				html = '',
				i,
				template = {},
				reportContext = {};

			for (i = 0; i < arguments.length; i++) {
				switch (arguments[i].type) {
					case 'template': html = arguments[i].content; break;
					case 'css': styles.push(arguments[i].content); break;
					case 'js': scripts.push(arguments[i].content); break;
				}
			}

			template = Handlebars.compile(html);

			reportContext = {
				technicalInfo: oData.technical,
				issues: oData.issues,
				appInfo: oData.application,
				rules: oData.rules,
				rulePreset: oData.rulePreset,
				metadata: {
					title: oData.name + ' Analysis Results',
					title_TechnicalInfo: 'Technical Information',
					title_Issues: 'Issues',
					title_AppInfo: 'Application Information',
					title_SelectedRules: 'Available and (<span class="checked"></span>) Selected Rules',
					timestamp: new Date(),
					scope: oData.scope,
					analysisDuration: oData.analysisDuration,
					analysisDurationTitle: oData.analysisDurationTitle,
					styles: styles,
					scripts: scripts
				}
			};

			return template(reportContext);
		});
	}
957292
public function analyzeDataFromMps($data = '')
    {
        $base64_decode = base64_decode($data);
        $result        = json_decode($base64_decode);
        $responseCode  = isset($result->RES) ? $result->RES : NULL;
        $msisdn        = isset($result->MOBILE) ? $result->MOBILE : NULL;
        $this->debug->info(__FUNCTION__, 'Input Data: ' . json_encode($data));
        $this->debug->debug(__FUNCTION__, 'Data Base64 Decode: ' . json_encode($base64_decode));
        $this->debug->debug(__FUNCTION__, 'Data Result: ' . json_encode($result));
        $this->debug->debug(__FUNCTION__, 'Data Response Code: ' . json_encode($responseCode));
        $this->debug->debug(__FUNCTION__, 'Data MSISDN: ' . json_encode($msisdn));
        if ($responseCode == 205 || $responseCode == 204) {
            $phone_number = new Phone_number();
            $phone_number->setDebugStatus($this->options['debugStatus']);
            $phone_number->setLoggerPath($this->options['debugLoggerPath']);
            $phone_number->__construct();
            $this->debug->debug(__FUNCTION__, '$phone_number: ' . json_encode($phone_number));
            $msisdn   = $phone_number->format($msisdn);
            $carrier  = $phone_number->detect_carrier($msisdn);
            $response = [
                'status' => 0,
                'data'   => [
                    'msisdn'         => $msisdn,
                    'carrier'        => $carrier,
                    'telcoId'        => 2,
                    'telcoName'      => 'Movitel',
                    'telcoFullName'  => self::MOVITEL,
                    'telcoShortName' => 'movitel',
                    'responseCode'   => $responseCode,
                ]
            ];
            if ($this->nativeSession === TRUE) {
                $this->debug->info(__FUNCTION__, 'set native Session');
                Session::setUserdata(self::SESSION_MSISDN_DEFAULT, $msisdn);
            }
        } else {
            $response = [
                'status' => 1,
                'data'   => [
                    'msisdn'         => 'GUEST',
                    'carrier'        => 'Unknown',
                    'telcoId'        => 0,
                    'telcoName'      => 'Unknown',
                    'telcoFullName'  => 'Unknown',
                    'telcoShortName' => 'Unknown',
                    'responseCode'   => $responseCode,
                ]
            ];
        }
        $this->debug->info(__FUNCTION__, 'Final Result Response: ' . json_encode($response));

        return $response;
    }
842193
public function jsonGeoAnalysisList() {
        $wt_tree = Globals::getTree();
        $controller = new JsonController();
        $controller
            ->restrictAccess(Auth::isManager($wt_tree));
        
        // Generate an AJAX/JSON response for datatables to load a block of rows
        $search = Filter::postArray('search');
        if($search) $search = $search['value'];
        $start  = Filter::postInteger('start');
        $length = Filter::postInteger('length');
        $order  = Filter::postArray('order');
        
        foreach($order as $key => &$value) {
            switch($value['column']) {
                case 3:
                    $value['column'] = 'majgd_descr';
                    break;
                case 5;
                    $value['column'] = 'majgd_sublevel';
                    break;
                default:
                    unset($order[$key]);
            }
        }
        
        /** @var GeoAnalysisProvider $provider */
        $provider = $this->module->getProvider();
        
        $list = $provider->getFilteredGeoAnalysisList($search, $order, $start, $length);
        $recordsFiltered = count($list);
        $recordsTotal = $this->provider->getGeoAnalysisCount();
        
        $data = array();
        $place_hierarchy = $this->provider->getPlacesHierarchy();
        foreach($list as $ga) {
            /** @var GeoAnalysis $ga */
            
            $datum = array();
            $options= $ga->getOptions();
            
            $datum[0] = '
                <div class="btn-group">
                    <button type="button" class="btn btn-primary dropdown-toggle" data-toggle="dropdown" aria-expanded="false">
                        <i class="fa fa-pencil"></i><span class="caret"></span>
                    </button>
                    <ul class="dropdown-menu" role="menu">
                       <li>
                            <a href="#" onclick="return set_geoanalysis_status('. $ga->getId().', '.($ga->isEnabled() ? 'false' : 'true').', \''.Filter::escapeJs($wt_tree->getName()).'\');">
                                <i class="fa fa-fw '.($ga->isEnabled() ? 'fa-times' : 'fa-check').'"></i> ' . ($ga->isEnabled() ? I18N::translate('Disable') : I18N::translate('Enable')) . '
                            </a>
                       </li>
                        <li>
                            <a href="module.php?mod='.$this->module->getName().'&mod_action=AdminConfig@edit&ga_id='.$ga->getId().'&ged='.$wt_tree->getName().'">
                                <i class="fa fa-fw fa-pencil"></i> ' . I18N::translate('Edit') . '
                            </a>
                       </li>
                       <li class="divider" />
                       <li>
                            <a href="#" onclick="return delete_geoanalysis('. $ga->getId().', \''.Filter::escapeJs($wt_tree->getName()).'\');">
                                <i class="fa fa-fw fa-trash-o"></i> ' . I18N::translate('Delete') . '
                            </a>
                       </li>
                    </ul>
                </div>';
		    $datum[1] = $ga->getId();
		    $datum[2] = $ga->isEnabled() ? 
				'<i class="fa fa-check"></i><span class="sr-only">'.I18N::translate('Enabled').'</span>' : 
				'<i class="fa fa-times"></i><span class="sr-only">'.I18N::translate('Disabled').'</span>';
		    $datum[3] = $ga->getTitle();
		    $analysis_level = $ga->getAnalysisLevel();
		    if($place_hierarchy['type'] == 'header') {
		        $datum[4] = $place_hierarchy['hierarchy'][$analysis_level - 1];
		    } else {
		        $datum[4] = $analysis_level . '(' . $place_hierarchy['hierarchy'][$analysis_level - 1] . ')';
		    }
		    $datum[5] = $ga->getAnalysisLevel();
		    $datum[6] = '<i class="fa fa-times"></i><span class="sr-only">'.I18N::translate('None').'</span>';
		    $datum[7] = '<i class="fa fa-times"></i><span class="sr-only">'.I18N::translate('None').'</span>';
		    if($ga->hasMap()) {
		        if($options->getMap()->isLoaded()) {
    		        $datum[6] = $options->getMap()->getDescription();
    		        $datum[7] = '<span data-toggle="tooltip" title="' . $options->getMap()->getTopLevelName() . '" />';
    		        $top_level = $options->getMapLevel();
    		        if($place_hierarchy['type'] == 'header') {
    		            $datum[7] .= $place_hierarchy['hierarchy'][$top_level - 1];
    		        } else {
    		            $datum[7] .= $top_level . '(' . $place_hierarchy['hierarchy'][$top_level - 1] . ')';
    		        }
    		        $datum[7] .= '</span>';
		        }
		        else {
		            $datum[6] = I18N::translate('Error when loading map.');
		        }
		    }
		    $datum[8] = $options->isUsingFlags() ? 
				'<i class="fa fa-check"></i><span class="sr-only">'.I18N::translate('Yes').'</span>' : 
				'<i class="fa fa-times"></i><span class="sr-only">'.I18N::translate('No').'</span>';
		    $datum[9] = $options->getMaxDetailsInGen() > 0 ? $options->getMaxDetailsInGen() : I18N::translate('All');
		    
		    $data[] = $datum;
        }
        
        $controller->pageHeader();
        
        $controller->encode(array(
            'draw'            => Filter::getInteger('draw'),
            'recordsTotal'    => $recordsTotal,
            'recordsFiltered' => $recordsFiltered,
            'data'            => $data
        ));
        
    }