You are here

adsense.search_options.inc in Google AdSense integration 5.3

Helper functions used by AdSense for Search configuration forms

File

includes/adsense.search_options.inc
View source
<?php

/**
 * @file
 * Helper functions used by AdSense for Search configuration forms
 */

/**
 * Helper function to supply the available encodings for the search configuration forms
 *
 * @return
 *   array of encoding options with the key used by Google and its description
 */
function _adsense_search_options_encoding() {
  return array(
    'ISO-8859-1' => t('West European Latin-1 (ISO-8859-1)'),
    'ISO-8859-15' => t('West European Latin-9 (ISO-8859-15)'),
    'windows-1252' => t('Western (Windows-1252)'),
    'ISO-8859-10' => t('Nordic Latin-6 (ISO-8859-10)'),
    'ISO-8859-7' => t('Greek (ISO-8859-7)'),
    'Shift_JIS' => t('Japanese (Shift_JIS)'),
    'EUC-JP' => t('Japanese (EUC-JP)'),
    'ISO-2022-JP' => t('Japanese (ISO-2022-JP)'),
    'GB2312' => t('Chinese Simplified (GB2312)'),
    'GB18030' => t('Chinese Simplified (GB18030)'),
    'big5' => t('Chinese Traditional (Big5)'),
    'EUC-KR' => t('Korean (EUC-KR)'),
    'windows-874' => t('Thai (Windows-874)'),
    'windows-1258' => t('Vietnamese (Windows-1258)'),
    'ISO-8859-2' => t('Central European Latin-2 (ISO-8859-2)'),
    'windows-1250' => t('Central European (Windows-1250)'),
    'cp852' => t('Central European (CP852)'),
    'ISO-8859-9' => t('Turkish Latin-5 (ISO-8859-9)'),
    'windows-1254' => t('Turkish (Windows-1254)'),
    'ISO-8859-3' => t('South European Latin-3 (ISO-8859-3)'),
    'ISO-8859-8-I' => t('Hebrew (ISO-8859-8-I)'),
    'windows-1255' => t('Hebrew (Windows-1255)'),
    'windows-1256' => t('Arabic (Windows-1256)'),
    'ISO-8859-5' => t('Cyrillic (ISO-8859-5)'),
    'KOI8-R' => t('Cyrillic (KOI8-R)'),
    'windows-1251' => t('Cyrillic (Windows-1251)'),
    'cp-866' => t('Cyrillic/Russian (CP-866)'),
    'UTF-8' => t('Unicode (UTF-8)'),
  );
}

/**
 * Helper function to supply the available countries for the search configuration forms
 *
 * @return
 *   array of countries with the key used by Google and its description
 */
function _adsense_search_options_country() {
  return array(
    'www.google.co.uk' => t('United Kingdom'),
    'www.google.ca' => t('Canada'),
    'www.google.de' => t('Germany'),
    'www.google.co.jp' => t('Japan'),
    'www.google.fr' => t('France'),
    'www.google.com.au' => t('Australia'),
    'www.google.it' => t('Italy'),
    'www.google.at' => t('Austria'),
    'www.google.ch' => t('Switzerland'),
    'www.google.es' => t('Spain'),
    'www.google.nl' => t('Netherlands'),
    'www.google.be' => t('Belgium'),
    'www.google.dk' => t('Denmark'),
    'www.google.se' => t('Sweden'),
    'www.google.no' => t('Norway'),
    'www.google.com.br' => t('Brazil'),
    'www.google.pt' => t('Portugal'),
    'www.google.fi' => t('Finland'),
    'www.google.co.kr' => t('South Korea'),
    'www.google.cn' => t('China'),
    'www.google.com.hk' => t('Hong Kong'),
    'www.google.com.tw' => t('Taiwan'),
    'www.google.com.sg' => t('Singapore'),
    'www.google.com.af' => t('Afghanistan'),
    'www.google.com' => t('Albania'),
    'www.google.com' => t('Algeria'),
    'www.google.as' => t('American Samoa'),
    'www.google.com' => t('Andorra'),
    'www.google.com' => t('Angola'),
    'www.google.off.ai' => t('Anguilla'),
    'www.google.com' => t('Antarctica'),
    'www.google.com.ag' => t('Antigua and Barbuda'),
    'www.google.com.ar' => t('Argentina'),
    'www.google.am' => t('Armenia'),
    'www.google.com' => t('Aruba'),
    'www.google.az' => t('Azerbaijan'),
    'www.google.bs' => t('Bahamas'),
    'www.google.com.bh' => t('Bahrain'),
    'www.google.com.bd' => t('Bangladesh'),
    'www.google.com' => t('Barbados'),
    'www.google.com' => t('Belarus'),
    'www.google.com.bz' => t('Belize'),
    'www.google.com' => t('Benin'),
    'www.google.com' => t('Bermuda'),
    'www.google.com' => t('Bhutan'),
    'www.google.com.bo' => t('Bolivia'),
    'www.google.ba' => t('Bosnia and Herzegovina'),
    'www.google.co.bw' => t('Botswana'),
    'www.google.com' => t('Bouvet Island'),
    'www.google.com' => t('British Indian Ocean Territory'),
    'www.google.com.bn' => t('Brunei Darussalam'),
    'www.google.bg' => t('Bulgaria'),
    'www.google.com' => t('Burkina Faso'),
    'www.google.bi' => t('Burundi'),
    'www.google.com.kh' => t('Cambodia'),
    'www.google.com' => t('Cameroon'),
    'www.google.com' => t('Cape Verde'),
    'www.google.com' => t('Cayman Islands'),
    'www.google.com' => t('Central African Republic'),
    'www.google.com' => t('Chad'),
    'www.google.cl' => t('Chile'),
    'www.google.com' => t('Christmas Island'),
    'www.google.com' => t('Cocos (Keeling) Islands'),
    'www.google.com.co' => t('Colombia'),
    'www.google.com' => t('Comoros'),
    'www.google.cg' => t('Congo'),
    'www.google.cd' => t('Congo,Democratic Republic'),
    'www.google.co.ck' => t('Cook Islands'),
    'www.google.co.cr' => t('Costa Rica'),
    'www.google.ci' => t('Cote d\'Ivoire'),
    'www.google.hr' => t('Croatia'),
    'www.google.com.cu' => t('Cuba'),
    'www.google.com' => t('Cyprus'),
    'www.google.cz' => t('Czech Republic'),
    'www.google.dj' => t('Djibouti'),
    'www.google.dm' => t('Dominica'),
    'www.google.com.do' => t('Dominican Republic'),
    'www.google.tl' => t('East Timor'),
    'www.google.com.ec' => t('Ecuador'),
    'www.google.com.eg' => t('Egypt'),
    'www.google.com.sv' => t('El Salvador'),
    'www.google.com' => t('Equatorial Guinea'),
    'www.google.com' => t('Eritrea'),
    'www.google.ee' => t('Estonia'),
    'www.google.com.et' => t('Ethiopia'),
    'www.google.com' => t('Falkland Islands (Malvinas)'),
    'www.google.com' => t('Faroe Islands'),
    'www.google.com.fj' => t('Fiji'),
    'www.google.com' => t('French Guiana'),
    'www.google.com' => t('French Polynesia'),
    'www.google.com' => t('French Southern Territories'),
    'www.google.com' => t('Gabon'),
    'www.google.gm' => t('Gambia'),
    'www.google.ge' => t('Georgia'),
    'www.google.com' => t('Ghana'),
    'www.google.com.gi' => t('Gibraltar'),
    'www.google.gr' => t('Greece'),
    'www.google.gl' => t('Greenland'),
    'www.google.com' => t('Grenada'),
    'www.google.gp' => t('Guadeloupe'),
    'www.google.com' => t('Guam'),
    'www.google.com.gt' => t('Guatemala'),
    'www.google.com' => t('Guinea'),
    'www.google.com' => t('Guinea-Bissau'),
    'www.google.gy' => t('Guyana'),
    'www.google.ht' => t('Haiti'),
    'www.google.com' => t('Heard and McDonald Islands'),
    'www.google.hn' => t('Honduras'),
    'www.google.hu' => t('Hungary'),
    'www.google.is' => t('Iceland'),
    'www.google.co.in' => t('India'),
    'www.google.co.id' => t('Indonesia'),
    'www.google.com' => t('Iran'),
    'www.google.com' => t('Iraq'),
    'www.google.ie' => t('Ireland'),
    'www.google.co.il' => t('Israel'),
    'www.google.com.jm' => t('Jamaica'),
    'www.google.jo' => t('Jordan'),
    'www.google.kz' => t('Kazakhstan'),
    'www.google.co.ke' => t('Kenya'),
    'www.google.ki' => t('Kiribati'),
    'www.google.com' => t('Kuwait'),
    'www.google.kg' => t('Kyrgyzstan'),
    'www.google.la' => t('Lao People\'s Democratic Republic'),
    'www.google.lv' => t('Latvia'),
    'www.google.com' => t('Lebanon'),
    'www.google.co.ls' => t('Lesotho'),
    'www.google.com' => t('Liberia'),
    'www.google.com.ly' => t('Libya'),
    'www.google.li' => t('Liechtenstein'),
    'www.google.lt' => t('Lithuania'),
    'www.google.lu' => t('Luxembourg'),
    'www.google.com' => t('Macau'),
    'www.google.com' => t('Macedonia'),
    'www.google.com' => t('Madagascar'),
    'www.google.mw' => t('Malawi'),
    'www.google.com.my' => t('Malaysia'),
    'www.google.mv' => t('Maldives'),
    'www.google.com' => t('Mali'),
    'www.google.com.mt' => t('Malta'),
    'www.google.com' => t('Marshall Islands'),
    'www.google.com' => t('Martinique'),
    'www.google.com' => t('Mauritania'),
    'www.google.mu' => t('Mauritius'),
    'www.google.com' => t('Mayotte'),
    'www.google.com.mx' => t('Mexico'),
    'www.google.fm' => t('Micronesia'),
    'www.google.md' => t('Moldova'),
    'www.google.com' => t('Monaco'),
    'www.google.mn' => t('Mongolia'),
    'www.google.ms' => t('Montserrat'),
    'www.google.co.ma' => t('Morocco'),
    'www.google.com' => t('Mozambique'),
    'www.google.com' => t('Myanmar'),
    'www.google.com.na' => t('Namibia'),
    'www.google.nr' => t('Nauru'),
    'www.google.com.np' => t('Nepal'),
    'www.google.com' => t('Netherlands Antilles'),
    'www.google.com' => t('New Caledonia'),
    'www.google.co.nz' => t('New Zealand'),
    'www.google.com.ni' => t('Nicaragua'),
    'www.google.com' => t('Niger'),
    'www.google.com.ng' => t('Nigeria'),
    'www.google.nu' => t('Niue'),
    'www.google.com.nf' => t('Norfolk Island'),
    'www.google.com' => t('Northern Mariana Islands'),
    'www.google.com' => t('North Korea'),
    'www.google.com.om' => t('Oman'),
    'www.google.com.pk' => t('Pakistan'),
    'www.google.com' => t('Palau'),
    'www.google.com' => t('Palestinian Territory'),
    'www.google.com.pa' => t('Panama'),
    'www.google.com' => t('Papua New Guinea'),
    'www.google.com.py' => t('Paraguay'),
    'www.google.com.pe' => t('Peru'),
    'www.google.com.ph' => t('Philippines'),
    'www.google.pn' => t('Pitcairn'),
    'www.google.pl' => t('Poland'),
    'www.google.com.pr' => t('Puerto Rico'),
    'www.google.com.qa' => t('Qatar'),
    'www.google.com' => t('Reunion'),
    'www.google.ro' => t('Romania'),
    'www.google.ru' => t('Russian Federation'),
    'www.google.rw' => t('Rwanda'),
    'www.google.com' => t('Saint Kitts and Nevis'),
    'www.google.com' => t('Saint Lucia'),
    'www.google.com.vc' => t('Saint Vincent and the Grenadines'),
    'www.google.ws' => t('Samoa'),
    'www.google.sm' => t('San Marino'),
    'www.google.st' => t('Sao Tome and Principe'),
    'www.google.com.sa' => t('Saudi Arabia'),
    'www.google.sn' => t('Senegal'),
    'www.google.com' => t('Serbia and Montenegro'),
    'www.google.sc' => t('Seychelles'),
    'www.google.com' => t('Sierra Leone'),
    'www.google.sk' => t('Slovakia'),
    'www.google.si' => t('Slovenia'),
    'www.google.com.sb' => t('Solomon Islands'),
    'www.google.com' => t('Somalia'),
    'www.google.co.za' => t('South Africa'),
    'www.google.com' => t('South Georgia and The South Sandwich Islands'),
    'www.google.lk' => t('Sri Lanka'),
    'www.google.sh' => t('St. Helena'),
    'www.google.com' => t('St. Pierre and Miquelon'),
    'www.google.com' => t('Sudan'),
    'www.google.com' => t('Suriname'),
    'www.google.com' => t('Svalbard and Jan Mayen Islands'),
    'www.google.com' => t('Swaziland'),
    'www.google.com' => t('Syria'),
    'www.google.com.tj' => t('Tajikistan'),
    'www.google.com' => t('Tanzania'),
    'www.google.co.th' => t('Thailand'),
    'www.google.com' => t('Togo'),
    'www.google.tk' => t('Tokelau'),
    'www.google.to' => t('Tonga'),
    'www.google.tt' => t('Trinidad and Tobago'),
    'www.google.com' => t('Tunisia'),
    'www.google.com.tr' => t('Turkey'),
    'www.google.tm' => t('Turkmenistan'),
    'www.google.com' => t('Turks and Caicos Islands'),
    'www.google.com' => t('Tuvalu'),
    'www.google.co.ug' => t('Uganda'),
    'www.google.com.ua' => t('Ukraine'),
    'www.google.ae' => t('United Arab Emirates'),
    'www.google.com' => t('United States Minor Outlying Islands'),
    'www.google.com.uy' => t('Uruguay'),
    'www.google.co.uz' => t('Uzbekistan'),
    'www.google.vu' => t('Vanuatu'),
    'www.google.com' => t('Vatican'),
    'www.google.co.ve' => t('Venezuela'),
    'www.google.com.vn' => t('Viet Nam'),
    'www.google.vg' => t('Virgin Islands (British)'),
    'www.google.co.vi' => t('Virgin Islands (U.S.)'),
    'www.google.com' => t('Wallis and Futuna Islands'),
    'www.google.com' => t('Western Sahara'),
    'www.google.com' => t('Yemen'),
    'www.google.co.zm' => t('Zambia'),
    'www.google.co.zw' => t('Zimbabwe'),
    'www.google.com' => t('United States'),
  );
}

/**
 * Helper function to supply the available languages for the search configuration forms
 *
 * @return
 *   array of language options with the key used by Google and its description
 */
function _adsense_search_options_language() {
  return array(
    'ar' => t('Arabic'),
    'bg' => t('Bulgarian'),
    'zh-CN' => t('Chinese (simplified)'),
    'zh-TW' => t('Chinese (traditional)'),
    'hr' => t('Croatian'),
    'cs' => t('Czech'),
    'da' => t('Danish'),
    'nl' => t('Dutch'),
    'en' => t('English'),
    'fi' => t('Finnish'),
    'fr' => t('French'),
    'de' => t('German'),
    'el' => t('Greek'),
    'iw' => t('Hebrew'),
    'hu' => t('Hungarian'),
    'in' => t('Indonesian'),
    'it' => t('Italian'),
    'ja' => t('Japanese'),
    'ko' => t('Korean'),
    'no' => t('Norwegian'),
    'pl' => t('Polish'),
    'pt' => t('Portuguese'),
    'ro' => t('Romanian'),
    'ru' => t('Russian'),
    'sr' => t('Serbian'),
    'sk' => t('Slovak'),
    'es' => t('Spanish'),
    'sv' => t('Swedish'),
    'th' => t('Thai'),
    'tr' => t('Turkish'),
    'vi' => t('Vietnamese'),
  );
}

Functions

Namesort descending Description
_adsense_search_options_country Helper function to supply the available countries for the search configuration forms
_adsense_search_options_encoding Helper function to supply the available encodings for the search configuration forms
_adsense_search_options_language Helper function to supply the available languages for the search configuration forms