indexing.php 20.2 KB
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598
<?php
// namespace administrator\components\com_jmap\models;
/**
 *
 * @package JMAP::INDEXING::administrator::components::com_jmap
 * @subpackage models
 * @author Joomla! Extensions Store
 * @copyright (C) 2015 - Joomla! Extensions Store
 * @license GNU/GPLv2 http://www.gnu.org/licenses/gpl-2.0.html
 */
defined ( '_JEXEC' ) or die ( 'Restricted access' );

/**
 * Indexing links model concrete implementation <<testable_behavior>>
 *
 * @package JMAP::INDEXING::administrator::components::com_jmap
 * @subpackage models
 * @since 3.3
 */
class JMapModelIndexing extends JMapModel {
	/**
	 * Main get data method, retrieve model data using the Google API
	 * Search results are based on parsing of automated queries
	 *
	 * @access public
	 * @return Object[]
	 */
	public function getData() {
		// Check if it's a search by keyword
		$keyword = $this->getState ( 'searchword', null );
		$siteQuery = $this->getComponentParams()->get('seostats_site_query', 1) ? 'site:' : null;
		$serpSearch = $keyword ? $keyword : $siteQuery . $this->getComponentParams ()->get ( 'seostats_custom_link', JUri::root ( false ) );
		$customHeaders = array('countrytld'=>$this->getState('countriestld', null), 'acceptlanguage'=>$this->getState('acceptlanguage', null));
		try {
			if (! function_exists ( 'curl_init' )) {
				throw new JMapException ( JText::_ ( 'COM_JMAP_CURL_NOT_SUPPORTED' ), 'error' );
			}
			
			$result = JMapSeostatsServicesGoogle::getSerps ( $serpSearch, $this->getState ( 'limitstart', 0 ), $customHeaders);
			if (! $result) {
				throw new JMapException ( JText::_ ( 'COM_JMAP_ERROR_RETRIEVING_INDEXING' ) . $this->_db->getErrorMsg (), 'notice' );
			}
			
			// If a specific keyword has been requested, determine the average position within 10 pages = 100 results for this domain
			if($keyword) {
				$siteDomainForKeyword = $this->getComponentParams ()->get ( 'seostats_custom_link', JUri::root ( false ) );
				$rankedPageKeyword = JMapSeostatsServicesGoogle::getRankedPageKeyword($keyword, $siteDomainForKeyword, $this->getState ( 'limitstart', 0 ), 100, $customHeaders);
				$this->setState('rankedpagekeyword', $rankedPageKeyword);
			}
			
			$this->setState('serpsearch', $serpSearch);
		} catch ( JMapException $e ) {
			$this->app->enqueueMessage ( $e->getMessage (), $e->getErrorLevel () );
			$result = array ();
		} catch ( Exception $e ) {
			$jmapException = new JMapException ( $e->getMessage (), 'error' );
			$this->app->enqueueMessage ( $jmapException->getMessage (), $jmapException->getErrorLevel () );
			$result = array ();
		}
		return $result;
	}
	
	/**
	 * Return select lists used as filter for listEntities
	 *
	 * @access public
	 * @return array
	 */
	public function getFilters() {
		// Number of Google page for SERPS
		$incrementOptions = array ();
		$incrementOptions [] = JHtml::_ ( 'select.option', 10, JText::_ ( 'COM_JMAP_10PAGES' ) );
		$incrementOptions [] = JHtml::_ ( 'select.option', 100, JText::_ ( 'COM_JMAP_100PAGES' ) );
		$incrementOptions [] = JHtml::_ ( 'select.option', 200, JText::_ ( 'COM_JMAP_200PAGES' ) );
		$incrementOptions [] = JHtml::_ ( 'select.option', 500, JText::_ ( 'COM_JMAP_500PAGES' ) );
		$incrementOptions [] = JHtml::_ ( 'select.option', 1000, JText::_ ( 'COM_JMAP_1000PAGES' ) );
		$incrementOptions [] = JHtml::_ ( 'select.option', 5000, JText::_ ( 'COM_JMAP_5000PAGES' ) );
		$incrementOptions [] = JHtml::_ ( 'select.option', 10000, JText::_ ( 'COM_JMAP_10000PAGES' ) );
		$lists ['numpages'] = JHtml::_ ( 'select.genericlist', $incrementOptions, 'numpages', 'onchange="Joomla.submitform();" class="inputbox input-medium"', 'value', 'text', $this->getState ( 'numpages' ) );
		
		// Languages
		$languagesHttpAcceptHeaders = array (
				"af-NA"=>"Afrikaans (Namibia)",
				"af-ZA"=>"Afrikaans (South Africa)",
				"ak-GH"=>"Akan (Ghana)",
				"sq-AL"=>"Albanian (Albania)",
				"am-ET"=>"Amharic (Ethiopia)",
				"ar-DZ"=>"Arabic (Algeria)",
				"ar-BH"=>"Arabic (Bahrain)",
				"ar-EG"=>"Arabic (Egypt)",
				"ar-IQ"=>"Arabic (Iraq)",
				"ar-JO"=>"Arabic (Jordan)",
				"ar-KW"=>"Arabic (Kuwait)",
				"ar-LB"=>"Arabic (Lebanon)",
				"ar-LY"=>"Arabic (Libya)",
				"ar-MA"=>"Arabic (Morocco)",
				"ar-OM"=>"Arabic (Oman)",
				"ar-QA"=>"Arabic (Qatar)",
				"ar-SA"=>"Arabic (Saudi Arabia)",
				"ar-SD"=>"Arabic (Sudan)",
				"ar-SY"=>"Arabic (Syria)",
				"ar-TN"=>"Arabic (Tunisia)",
				"ar-AE"=>"Arabic (United Arab Emirates)",
				"ar-YE"=>"Arabic (Yemen)",
				"hy-AM"=>"Armenian (Armenia)",
				"as-IN"=>"Assamese (India)",
				"asa-TZ"=>"Asu (Tanzania)",
				"az-Cyrl"=>"Azerbaijani (Cyrillic)",
				"az-Cyrl-AZ"=>"Azerbaijani (Cyrillic, Azerbaijan)",
				"az-Latn"=>"Azerbaijani (Latin)",
				"az-Latn-AZ"=>"Azerbaijani (Latin, Azerbaijan)",
				"bm-ML"=>"Bambara (Mali)",
				"eu-ES"=>"Basque (Spain)",
				"be-BY"=>"Belarusian (Belarus)",
				"bem-ZM"=>"Bemba (Zambia)",
				"bez-TZ"=>"Bena (Tanzania)",
				"bn-BD"=>"Bengali (Bangladesh)",
				"bn-IN"=>"Bengali (India)",
				"bs-BA"=>"Bosnian (Bosnia and Herzegovina)",
				"bg-BG"=>"Bulgarian (Bulgaria)",
				"my-MM"=>"Burmese (Myanmar [Burma])",
				"ca-ES"=>"Catalan (Spain)",
				"tzm-Latn"=>"Central Morocco Tamazight (Latin)",
				"tzm-Latn-MA"=>"Central Morocco Tamazight (Latin, Morocco)",
				"tzm"=>"Central Morocco Tamazight",
				"chr-US"=>"Cherokee (United States)",
				"cgg-UG"=>"Chiga (Uganda)",
				"zh-Hans"=>"Chinese (Simplified Han)",
				"zh-Hans-CN"=>"Chinese (Simplified Han, China)",
				"zh-Hans-HK"=>"Chinese (Simplified Han, Hong Kong SAR China)",
				"zh-Hans-MO"=>"Chinese (Simplified Han, Macau SAR China)",
				"zh-Hans-SG"=>"Chinese (Simplified Han, Singapore)",
				"zh-Hant"=>"Chinese (Traditional Han)",
				"zh-Hant-HK"=>"Chinese (Traditional Han, Hong Kong SAR China)",
				"zh-Hant-MO"=>"Chinese (Traditional Han, Macau SAR China)",
				"zh-Hant-TW"=>"Chinese (Traditional Han, Taiwan)",
				"kw-GB"=>"Cornish (United Kingdom)",
				"hr-HR"=>"Croatian (Croatia)",
				"cs-CZ"=>"Czech (Czech Republic)",
				"da-DK"=>"Danish (Denmark)",
				"nl-BE"=>"Dutch (Belgium)",
				"nl-NL"=>"Dutch (Netherlands)",
				"ebu-KE"=>"Embu (Kenya)",
				"en-AS"=>"English (American Samoa)",
				"en-AU"=>"English (Australia)",
				"en-BE"=>"English (Belgium)",
				"en-BZ"=>"English (Belize)",
				"en-BW"=>"English (Botswana)",
				"en-CA"=>"English (Canada)",
				"en-GU"=>"English (Guam)",
				"en-HK"=>"English (Hong Kong SAR China)",
				"en-IN"=>"English (India)",
				"en-IE"=>"English (Ireland)",
				"en-JM"=>"English (Jamaica)",
				"en-MT"=>"English (Malta)",
				"en-MH"=>"English (Marshall Islands)",
				"en-MU"=>"English (Mauritius)",
				"en-NA"=>"English (Namibia)",
				"en-NZ"=>"English (New Zealand)",
				"en-MP"=>"English (Northern Mariana Islands)",
				"en-PK"=>"English (Pakistan)",
				"en-PH"=>"English (Philippines)",
				"en-SG"=>"English (Singapore)",
				"en-ZA"=>"English (South Africa)",
				"en-TT"=>"English (Trinidad and Tobago)",
				"en-UM"=>"English (U.S. Minor Outlying Islands)",
				"en-VI"=>"English (U.S. Virgin Islands)",
				"en-GB"=>"English (United Kingdom)",
				"en-US"=>"English (United States)",
				"en-ZW"=>"English (Zimbabwe)",
				"et-EE"=>"Estonian (Estonia)",
				"ee-GH"=>"Ewe (Ghana)",
				"ee-TG"=>"Ewe (Togo)",
				"fo-FO"=>"Faroese (Faroe Islands)",
				"fil-PH"=>"Filipino (Philippines)",
				"fi-FI"=>"Finnish (Finland)",
				"fr-BE"=>"French (Belgium)",
				"fr-BJ"=>"French (Benin)",
				"fr-BF"=>"French (Burkina Faso)",
				"fr-BI"=>"French (Burundi)",
				"fr-CM"=>"French (Cameroon)",
				"fr-CA"=>"French (Canada)",
				"fr-CF"=>"French (Central African Republic)",
				"fr-TD"=>"French (Chad)",
				"fr-KM"=>"French (Comoros)",
				"fr-CG"=>"French (Congo - Brazzaville)",
				"fr-CD"=>"French (Congo - Kinshasa)",
				"fr-CI"=>"French (Cote Ivoire)",
				"fr-DJ"=>"French (Djibouti)",
				"fr-GQ"=>"French (Equatorial Guinea)",
				"fr-FR"=>"French (France)",
				"fr-GA"=>"French (Gabon)",
				"fr-GP"=>"French (Guadeloupe)",
				"fr-GN"=>"French (Guinea)",
				"fr-LU"=>"French (Luxembourg)",
				"fr-MG"=>"French (Madagascar)",
				"fr-ML"=>"French (Mali)",
				"fr-MQ"=>"French (Martinique)",
				"fr-MC"=>"French (Monaco)",
				"fr-NE"=>"French (Niger)",
				"fr-RW"=>"French (Rwanda)",
				"fr-RE"=>"French (Reunion)",
				"fr-BL"=>"French (Saint Barthelemy)",
				"fr-MF"=>"French (Saint Martin)",
				"fr-SN"=>"French (Senegal)",
				"fr-CH"=>"French (Switzerland)",
				"fr-TG"=>"French (Togo)",
				"ff-SN"=>"Fulah (Senegal)",
				"gl-ES"=>"Galician (Spain)",
				"lg-UG"=>"Ganda (Uganda)",
				"ka-GE"=>"Georgian (Georgia)",
				"de-AT"=>"German (Austria)",
				"de-BE"=>"German (Belgium)",
				"de-DE"=>"German (Germany)",
				"de-LI"=>"German (Liechtenstein)",
				"de-LU"=>"German (Luxembourg)",
				"de-CH"=>"German (Switzerland)",
				"el-CY"=>"Greek (Cyprus)",
				"el-GR"=>"Greek (Greece)",
				"gu-IN"=>"Gujarati (India)",
				"guz-KE"=>"Gusii (Kenya)",
				"ha-Latn"=>"Hausa (Latin)",
				"ha-Latn-GH"=>"Hausa (Latin, Ghana)",
				"ha-Latn-NE"=>"Hausa (Latin, Niger)",
				"ha-Latn-NG"=>"Hausa (Latin, Nigeria)",
				"haw-US"=>"Hawaiian (United States)",
				"he-IL"=>"Hebrew (Israel)",
				"hi-IN"=>"Hindi (India)",
				"hu-HU"=>"Hungarian (Hungary)",
				"is-IS"=>"Icelandic (Iceland)",
				"ig-NG"=>"Igbo (Nigeria)",
				"id-ID"=>"Indonesian (Indonesia)",
				"ga-IE"=>"Irish (Ireland)",
				"it-IT"=>"Italian (Italy)",
				"it-CH"=>"Italian (Switzerland)",
				"ja-JP"=>"Japanese (Japan)",
				"kea-CV"=>"Kabuverdianu (Cape Verde)",
				"kab-DZ"=>"Kabyle (Algeria)",
				"kl-GL"=>"Kalaallisut (Greenland)",
				"kln-KE"=>"Kalenjin (Kenya)",
				"kam-KE"=>"Kamba (Kenya)",
				"kn-IN"=>"Kannada (India)",
				"kk-Cyrl"=>"Kazakh (Cyrillic)",
				"kk-Cyrl-KZ"=>"Kazakh (Cyrillic, Kazakhstan)",
				"km-KH"=>"Khmer (Cambodia)",
				"ki-KE"=>"Kikuyu (Kenya)",
				"rw-RW"=>"Kinyarwanda (Rwanda)",
				"kok-IN"=>"Konkani (India)",
				"ko-KR"=>"Korean (South Korea)",
				"khq-ML"=>"Koyra Chiini (Mali)",
				"ses-ML"=>"Koyraboro Senni (Mali)",
				"lag-TZ"=>"Langi (Tanzania)",
				"lv-LV"=>"Latvian (Latvia)",
				"lt-LT"=>"Lithuanian (Lithuania)",
				"luo-KE"=>"Luo (Kenya)",
				"luy-KE"=>"Luyia (Kenya)",
				"mk-MK"=>"Macedonian (Macedonia)",
				"jmc-TZ"=>"Machame (Tanzania)",
				"kde-TZ"=>"Makonde (Tanzania)",
				"mg-MG"=>"Malagasy (Madagascar)",
				"ms-BN"=>"Malay (Brunei)",
				"ms-MY"=>"Malay (Malaysia)",
				"ml-IN"=>"Malayalam (India)",
				"mt-MT"=>"Maltese (Malta)",
				"gv-GB"=>"Manx (United Kingdom)",
				"mr-IN"=>"Marathi (India)",
				"mas-KE"=>"Masai (Kenya)",
				"mas-TZ"=>"Masai (Tanzania)",
				"mer-KE"=>"Meru (Kenya)",
				"mfe-MU"=>"Morisyen (Mauritius)",
				"naq-NA"=>"Nama (Namibia)",
				"ne-IN"=>"Nepali (India)",
				"ne-NP"=>"Nepali (Nepal)",
				"nd-ZW"=>"North Ndebele (Zimbabwe)",
				"nb-NO"=>"Norwegian Bokmal (Norway)",
				"nn-NO"=>"Norwegian Nynorsk (Norway)",
				"nyn-UG"=>"Nyankole (Uganda)",
				"or-IN"=>"Oriya (India)",
				"om-ET"=>"Oromo (Ethiopia)",
				"m-KE"=>"Oromo (Kenya)",
				"ps-AF"=>"Pashto (Afghanistan)",
				"fa-AF"=>"Persian (Afghanistan)",
				"fa-IR"=>"Persian (Iran)",
				"pl-PL"=>"Polish (Poland)",
				"pt-BR"=>"Portuguese (Brazil)",
				"pt-GW"=>"Portuguese (Guinea-Bissau)",
				"pt-MZ"=>"Portuguese (Mozambique)",
				"pt-PT"=>"Portuguese (Portugal)",
				"pa-Arab"=>"Punjabi (Arabic)",
				"pa-Arab-PK"=>"Punjabi (Arabic, Pakistan)",
				"pa-Guru"=>"Punjabi (Gurmukhi)",
				"pa-Guru-IN"=>"Punjabi (Gurmukhi, India)",
				"ro-MD"=>"Romanian (Moldova)",
				"ro-RO"=>"Romanian (Romania)",
				"rm-CH"=>"Romansh (Switzerland)",
				"rof-TZ"=>"Rombo (Tanzania)",
				"ru-MD"=>"Russian (Moldova)",
				"ru-RU"=>"Russian (Russia)",
				"ru-UA"=>"Russian (Ukraine)",
				"rwk-TZ"=>"Rwa (Tanzania)",
				"saq-KE"=>"Samburu (Kenya)",
				"sg-CF"=>"Sango (Central African Republic)",
				"seh-MZ"=>"Sena (Mozambique)",
				"sr-Cyrl"=>"Serbian (Cyrillic)",
				"sr-Cyrl-BA"=>"Serbian (Cyrillic, Bosnia and Herzegovina)",
				"sr-Cyrl-ME"=>"Serbian (Cyrillic, Montenegro)",
				"sr-Cyrl-RS"=>"Serbian (Cyrillic, Serbia)",
				"sr-Latn"=>"Serbian (Latin)",
				"sr-Latn-BA"=>"Serbian (Latin, Bosnia and Herzegovina)",
				"sr-Latn-ME"=>"Serbian (Latin, Montenegro)",
				"sr-Latn-RS"=>"Serbian (Latin, Serbia)",
				"sn-ZW"=>"Shona (Zimbabwe)",
				"ii-CN"=>"Sichuan Yi (China)",
				"si-LK"=>"Sinhala (Sri Lanka)",
				"sk-SK"=>"Slovak (Slovakia)",
				"sl-SI"=>"Slovenian (Slovenia)",
				"xog-UG"=>"Soga (Uganda)",
				"so-DJ"=>"Somali (Djibouti)",
				"so-ET"=>"Somali (Ethiopia)",
				"so-KE"=>"Somali (Kenya)",
				"so-SO"=>"Somali (Somalia)",
				"es-AR"=>"Spanish (Argentina)",
				"es-BO"=>"Spanish (Bolivia)",
				"es-CL"=>"Spanish (Chile)",
				"es-CO"=>"Spanish (Colombia)",
				"es-CR"=>"Spanish (Costa Rica)",
				"es-DO"=>"Spanish (Dominican Republic)",
				"es-EC"=>"Spanish (Ecuador)",
				"es-SV"=>"Spanish (El Salvador)",
				"es-GQ"=>"Spanish (Equatorial Guinea)",
				"es-GT"=>"Spanish (Guatemala)",
				"es-HN"=>"Spanish (Honduras)",
				"es-419"=>"Spanish (Latin America)",
				"es-MX"=>"Spanish (Mexico)",
				"es-NI"=>"Spanish (Nicaragua)",
				"es-PA"=>"Spanish (Panama)",
				"es-PY"=>"Spanish (Paraguay)",
				"es-PE"=>"Spanish (Peru)",
				"es-PR"=>"Spanish (Puerto Rico)",
				"es-ES"=>"Spanish (Spain)",
				"es-US"=>"Spanish (United States)",
				"es-UY"=>"Spanish (Uruguay)",
				"es-VE"=>"Spanish (Venezuela)",
				"sw-KE"=>"Swahili (Kenya)",
				"sw-TZ"=>"Swahili (Tanzania)",
				"sv-FI"=>"Swedish (Finland)",
				"sv-SE"=>"Swedish (Sweden)",
				"gsw-CH"=>"Swiss German (Switzerland)",
				"shi-Latn"=>"Tachelhit (Latin)",
				"shi-Latn-MA"=>"Tachelhit (Latin, Morocco)",
				"shi-Tfng"=>"Tachelhit (Tifinagh)",
				"shi-Tfng-MA"=>"Tachelhit (Tifinagh, Morocco)",
				"dav-KE"=>"Taita (Kenya)",
				"ta-IN"=>"Tamil (India)",
				"ta-LK"=>"Tamil (Sri Lanka)",
				"te-IN"=>"Telugu (India)",
				"teo-KE"=>"Teso (Kenya)",
				"teo-UG"=>"Teso (Uganda)",
				"th-TH"=>"Thai (Thailand)",
				"bo-CN"=>"Tibetan (China)",
				"bo-IN"=>"Tibetan (India)",
				"ti-ER"=>"Tigrinya (Eritrea)",
				"ti-ET"=>"Tigrinya (Ethiopia)",
				"to-TO"=>"Tonga (Tonga)",
				"tr-TR"=>"Turkish (Turkey)",
				"uk-UA"=>"Ukrainian (Ukraine)",
				"ur-IN"=>"Urdu (India)",
				"ur-PK"=>"Urdu (Pakistan)",
				"uz-Arab"=>"Uzbek (Arabic)",
				"uz-Arab-AF"=>"Uzbek (Arabic, Afghanistan)",
				"uz-Cyrl"=>"Uzbek (Cyrillic)",
				"uz-Cyrl-UZ"=>"Uzbek (Cyrillic, Uzbekistan)",
				"uz-Latn"=>"Uzbek (Latin)",
				"uz-Latn-UZ"=>"Uzbek (Latin, Uzbekistan)",
				"vi-VN"=>"Vietnamese (Vietnam)",
				"vun-TZ"=>"Vunjo (Tanzania)",
				"cy-GB"=>"Welsh (United Kingdom)",
				"yo-NG"=>"Yoruba (Nigeria)",
				"zu-ZA"=>"Zulu (South Africa)" 
		);
		
		$languagesHttpAcceptHeadersOptions = array ();
		$languagesHttpAcceptHeadersOptions [] = JHtml::_ ( 'select.option', null, JText::_('COM_JMAP_INDEXING_SELECT_DEFAULT') );
		foreach ($languagesHttpAcceptHeaders as $value=>$text) {
			$languagesHttpAcceptHeadersOptions [] = JHtml::_ ( 'select.option', $value, $text );
		}
		$lists ['acceptlanguages'] = JHtml::_ ( 'select.genericlist', $languagesHttpAcceptHeadersOptions, 'acceptlanguage', 'class="inputbox input-medium serpcontrol"', 'value', 'text', $this->getState ( 'acceptlanguage' ) );
		
		$countriedTopLevelDomains = array (
				'Algeria'=>'dz',
				'Ascension Island'=>'ac',
				'Andorra'=>'ad',
				'Afghanistan'=>'com.af',
				'Antigua and Barbuda'=>'com.ag',
				'Anguilla'=>'com.ai',
				'Albania'=>'al',
				'Armenia'=>'am',
				'Angola'=>'co.ao',
				'Argentina'=>'com.ar',
				'American Samoa'=>'as',
				'Austria'=>'at',
				'Australia'=>'com.au',
				'Azerbaijan'=>'az',
				'Bosnia and Herzegovina'=>'ba',
				'Bangladesh'=>'com.bd',
				'Belgium'=>'be',
				'Burkina Faso'=>'bf',
				'Bulgaria'=>'bg',
				'Bahrain'=>'com.bh',
				'Burma'=>'com.mm',
				'Burundi'=>'bi',
				'Benin'=>'bj',
				'Brunei'=>'com.bn',
				'Bolivia'=>'com.bo',
				'Brazil'=>'com.br',
				'Bahamas'=>'bs',
				'Bhutan'=>'bt',
				'Botswana'=>'co.bw',
				'Belarus'=>'by',
				'Belize'=>'com.bz',
				'British Indian Ocean Territory'=>'io',
				'British Virgin Islands'=>'vg',
				'Canada'=>'ca',
				'Cambodia'=>'com.kh',
				'Cocos (Keeling) Islands'=>'cc',
				'Central African Republic'=>'cf',
				'Catalonia Catalan Countries'=>'cat',
				'Cook Islands'=>'co.ck',
				'Chile'=>'cl',
				'Cameroon'=>'cm',
				'Chad'=>'td',
				'China'=>'cn',
				'Colombia'=>'com.co',
				'Costa Rica'=>'co.cr',
				'Croatia'=>'hr',
				'Cuba'=>'com.cu',
				'Cape Verde'=>'cv',
				'Cyprus'=>'com.cy',
				'Czech Republic'=>'cz',
				'Democratic Republic of the Congo'=>'cd',
				'Denmark'=>'dk',
				'Djibouti'=>'dj',
				'Dominica'=>'dm',
				'Dominican Republic'=>'com.do',
				'Ecuador'=>'com.ec',
				'Estonia'=>'ee',
				'Egypt'=>'com.eg',
				'El Salvador'=>'com.sv',
				'Ethiopia'=>'com.et',
				'Finland'=>'fi',
				'Fiji'=>'com.fj',
				'Federated States of Micronesia'=>'fm',
				'France'=>'fr',
				'French Guiana'=>'gf',
				'Gabon'=>'ga',
				'Georgia'=>'ge',
				'Germany'=>'de',
				'Guernsey'=>'gg',
				'Ghana'=>'com.gh',
				'Gibraltar'=>'com.gi',
				'Greenland'=>'gl',
				'Gambia'=>'gm',
				'Guadeloupe'=>'gp',
				'Greece'=>'gr',
				'Guatemala'=>'com.gt',
				'Guyana'=>'gy',
				'Hong Kong'=>'com.hk',
				'Honduras'=>'hn',
				'Haiti'=>'ht',
				'Hungary'=>'hu',
				'Indonesia'=>'co.id',
				'Iran'=>'ir',
				'Iraq'=>'iq',
				'Ireland'=>'ie',
				'Israel'=>'co.il',
				'India'=>'co.in',
				'Iceland'=>'is',
				'Italy'=>'it',
				'Ivory Coast'=>'ci',
				'Jersey'=>'je',
				'Jamaica'=>'com.jm',
				'Jordan'=>'jo',
				'Japan'=>'co.jp',
				'Kenya'=>'co.ke',
				'Kiribati'=>'ki',
				'Kyrgyzstan'=>'kg',
				'Kuwait'=>'com.kw',
				'Kazakhstan'=>'kz',
				'Laos'=>'la',
				'Lebanon'=>'com.lb',
				'Liechtenstein'=>'li',
				'Lesotho'=>'co.ls',
				'Lithuania'=>'lt',
				'Luxembourg'=>'u',
				'Latvia'=>'lv',
				'Libya'=>'ly',
				'Morocco'=>'co.ma',
				'Moldova'=>'md',
				'Montenegro'=>'me',
				'Madagascar'=>'mg',
				'Macedonia'=>'mk',
				'Mali'=>'ml',
				'Mongolia'=>'mn',
				'Montserrat'=>'ms',
				'Malta'=>'com.mt',
				'Mauritius'=>'mu',
				'Maldives'=>'mv',
				'Malawi'=>'mw',
				'Mexico'=>'com.mx',
				'Malaysia'=>'com.my',
				'Mozambique'=>'co.mz',
				'Namibia'=>'com.na',
				'Niger'=>'ne',
				'Norfolk Island'=>'com.nf',
				'Nigeria'=>'com.ng',
				'Nicaragua'=>'com.ni',
				'Netherlands'=>'nl',
				'Norway'=>'no',
				'Nepal'=>'com.np',
				'Nauru'=>'nr',
				'Niue'=>'nu',
				'New Zealand'=>'co.nz',
				'Oman'=>'com.om',
				'Panama'=>'com.pa',
				'Peru'=>'com.pe',
				'Philippines'=>'com.ph',
				'Pakistan'=>'com.pk',
				'Poland'=>'pl',
				'Papua New Guinea'=>'com.pg',
				'Pitcairn Islands'=>'pn',
				'Puerto Rico'=>'com.pr',
				'Palestine'=>'ps',
				'Portugal'=>'pt',
				'Paraguay'=>'com.py',
				'Qatar'=>'com.qa',
				'Romania'=>'ro',
				'Republic of the Congo'=>'cg',
				'Russia'=>'ru',
				'Rwanda'=>'rw',
				'Saint Vincent and the Grenadines'=>'com.vc',
				'Sao Tome and Principe'=>'st',
				'Saudi Arabia'=>'com.sa',
				'Serbia'=>'rs',
				'Solomon Islands'=>'com.sb',
				'Seychelles'=>'sc',
				'Sweden'=>'se',
				'Singapore'=>'com.sg',
				'Saint Helena'=>'sh',
				'Saint Lucia'=>'com.lc',
				'Samoa'=>'ws',
				'Slovenia'=>'si',
				'Slovakia'=>'sk',
				'Sierra Leone'=>'com.sl',
				'Senegal'=>'sn',
				'San Marino'=>'sm',
				'Somalia'=>'so',
				'South Africa'=>'co.za',
				'South Korea'=>'co.kr',
				'Spain'=>'es',
				'Sri Lanka'=>'lk',
				'Switzerland'=>'ch',
				'Togo'=>'tg',
				'Thailand'=>'co.th',
				'Tajikistan'=>'com.tj',
				'Tokelau'=>'tk',
				'Timor-Leste'=>'tl',
				'Turkmenistan'=>'tm',
				'Tonga'=>'to',
				'Tunisia'=>'tn',
				'Tunisia com.tn',
				'Turkey'=>'com.tr',
				'Trinidad and Tobago'=>'tt',
				'Taiwan'=>'com.tw',
				'Tanzania'=>'co.tz',
				'Ukraine'=>'com.ua',
				'Uganda'=>'co.ug',
				'United Kingdom'=>'co.uk',
				'United Arab Emirates'=>'ae',
				'United States'=>'com',
				'Uruguay'=>'com.uy',
				'Uzbekistan'=>'co.uz',
				'Venezuela'=>'co.ve',
				'United States Virgin Islands'=>'co.vi',
				'Vietnam'=>'com.vn',
				'Vanuatu'=>'vu',
				'Zambia'=>'co.zm',
				'Zimbabwe'=>'co.zw' 
		);
		$countriesOptions = array ();
		$countriesOptions [] = JHtml::_ ( 'select.option', null, JText::_('COM_JMAP_INDEXING_SELECT_DEFAULT') );
		foreach ($countriedTopLevelDomains as $text=>$value) {
			$countriesOptions [] = JHtml::_ ( 'select.option', $value, $text );
		}
		$lists ['countriestld'] = JHtml::_ ( 'select.genericlist', $countriesOptions, 'countriestld', 'class="inputbox input-medium serpcontrol"', 'value', 'text', $this->getState ( 'countriestld' ) );
		
		return $lists;
	}
}