function facebook_comments_block_block_configure in Facebook Comments Block 7.2
Same name and namespace in other branches
- 7 facebook_comments_block.module \facebook_comments_block_block_configure()
Implements hook_block_configure().
File
- ./
facebook_comments_block.module, line 54 - Code for the Facebook Comments Block module.
Code
function facebook_comments_block_block_configure($delta = '') {
$form = array();
switch ($delta) {
case 'fb_comments':
$form['facebook_comments_settings'] = array(
'#type' => 'fieldset',
'#title' => t('Facebook comments box settings'),
'#description' => t('Configure facebook comments box.'),
'#collapsible' => FALSE,
);
$form['facebook_comments_settings']['facebook_comments_block_settings_app_id'] = array(
'#type' => 'textfield',
'#title' => t('Facebook Application ID'),
'#default_value' => variable_get('facebook_comments_block_settings_app_id', ''),
'#maxlength' => 20,
'#description' => t('Optional: Enter Facebook App ID.'),
);
$form['facebook_comments_settings']['facebook_comments_block_settings_domain'] = array(
'#type' => 'textfield',
'#title' => t('Main domain'),
'#default_value' => variable_get('facebook_comments_block_settings_domain', ''),
'#maxlength' => 75,
'#description' => t('Optional: If you have more than one domain you can set the main domain for facebook comments box to use the same commenting widget across all other domains.<br />ex: <i>http://www.mysite.com</i>'),
'#element_validate' => array(
'facebook_comments_block_validate_absolute_url',
),
'#required' => FALSE,
);
$form['facebook_comments_settings']['facebook_comments_block_settings_lang'] = array(
'#type' => 'select',
'#title' => t('Language'),
'#options' => array(
'af_ZA' => t('Afrikaans'),
'ak_GH' => t('Akan'),
'am_ET' => t('Amharic'),
'ar_AR' => t('Arabic'),
'as_IN' => t('Assamese'),
'ay_BO' => t('Aymara'),
'az_AZ' => t('Azerbaijani'),
'be_BY' => t('Belarusian'),
'bg_BG' => t('Bulgarian'),
'bn_IN' => t('Bengali'),
'br_FR' => t('Breton'),
'bs_BA' => t('Bosnian'),
'ca_ES' => t('Catalan'),
'cb_IQ' => t('Sorani Kurdish'),
'ck_US' => t('Cherokee'),
'co_FR' => t('Corsican'),
'cs_CZ' => t('Czech'),
'cx_PH' => t('Cebuano'),
'cy_GB' => t('Welsh'),
'da_DK' => t('Danish'),
'de_DE' => t('German'),
'el_GR' => t('Greek'),
'en_GB' => t('English - UK'),
'en_IN' => t('English - India'),
'en_PI' => t('English - Pirate'),
'en_UD' => t('English - Upside Down'),
'en_US' => t('English - US'),
'eo_EO' => t('Esperanto'),
'es_CL' => t('Spanish - Chile'),
'es_CO' => t('Spanish - Colombia'),
'es_ES' => t('Spanish - Spain'),
'es_LA' => t('Spanish'),
'es_MX' => t('Spanish - Mexico'),
'es_VE' => t('Spanish - Venezuela'),
'et_EE' => t('Estonian'),
'eu_ES' => t('Basque'),
'fa_IR' => t('Persian'),
'fb_LT' => t('Leet Speak'),
'ff_NG' => t('Fulah'),
'fi_FI' => t('Finnish'),
'fo_FO' => t('Faroese'),
'fr_CA' => t('French - Canada'),
'fr_FR' => t('French - France'),
'fy_NL' => t('Frisian'),
'ga_IE' => t('Irish'),
'gl_ES' => t('Galician'),
'gn_PY' => t('Guarani'),
'gu_IN' => t('Gujarati'),
'gx_GR' => t('Classical Greek'),
'ha_NG' => t('Hausa'),
'he_IL' => t('Hebrew'),
'hi_IN' => t('Hindi'),
'hr_HR' => t('Croatian'),
'ht_HT' => t('Haitian Creole'),
'hu_HU' => t('Hungarian'),
'hy_AM' => t('Armenian'),
'id_ID' => t('Indonesian'),
'ig_NG' => t('Igbo'),
'is_IS' => t('Icelandic'),
'it_IT' => t('Italian'),
'ja_JP' => t('Japanese'),
'ja_KS' => t('Japanese - Kansai'),
'jv_ID' => t('Javanese'),
'ka_GE' => t('Georgian'),
'kk_KZ' => t('Kazakh'),
'km_KH' => t('Khmer'),
'kn_IN' => t('Kannada'),
'ko_KR' => t('Korean'),
'ku_TR' => t('Kurdish - Kurmanji'),
'ky_KG' => t('Kyrgyz'),
'la_VA' => t('Latin'),
'lg_UG' => t('Ganda'),
'li_NL' => t('Limburgish'),
'ln_CD' => t('Lingala'),
'lo_LA' => t('Lao'),
'lt_LT' => t('Lithuanian'),
'lv_LV' => t('Latvian'),
'mg_MG' => t('Malagasy'),
'mi_NZ' => t('Māori'),
'mk_MK' => t('Macedonian'),
'ml_IN' => t('Malayalam'),
'mn_MN' => t('Mongolian'),
'mr_IN' => t('Marathi'),
'ms_MY' => t('Malay'),
'mt_MT' => t('Maltese'),
'my_MM' => t('Burmese'),
'nb_NO' => t('Norwegian - bokmal'),
'nd_ZW' => t('Ndebele'),
'ne_NP' => t('Nepali'),
'nl_BE' => t('Dutch - België'),
'nl_NL' => t('Dutch'),
'nn_NO' => t('Norwegian - nynorsk'),
'ny_MW' => t('Chewa'),
'or_IN' => t('Oriya'),
'pa_IN' => t('Punjabi'),
'pl_PL' => t('Polish'),
'ps_AF' => t('Pashto'),
'pt_BR' => t('Portuguese - Brazil'),
'pt_PT' => t('Portuguese - Portugal'),
'qc_GT' => t('Quiché'),
'qu_PE' => t('Quechua'),
'rm_CH' => t('Romansh'),
'ro_RO' => t('Romanian'),
'ru_RU' => t('Russian'),
'rw_RW' => t('Kinyarwanda'),
'sa_IN' => t('Sanskrit'),
'sc_IT' => t('Sardinian'),
'se_NO' => t('Northern Sámi'),
'si_LK' => t('Sinhala'),
'sk_SK' => t('Slovak'),
'sl_SI' => t('Slovenian'),
'sn_ZW' => t('Shona'),
'so_SO' => t('Somali'),
'sq_AL' => t('Albanian'),
'sr_RS' => t('Serbian'),
'sv_SE' => t('Swedish'),
'sw_KE' => t('Swahili'),
'sy_SY' => t('Syriac'),
'sz_PL' => t('Silesian'),
'ta_IN' => t('Tamil'),
'te_IN' => t('Telugu'),
'tg_TJ' => t('Tajik'),
'th_TH' => t('Thai'),
'tk_TM' => t('Turkmen'),
'tl_PH' => t('Filipino'),
'tl_ST' => t('Klingon'),
'tr_TR' => t('Turkish'),
'tt_RU' => t('Tatar'),
'tz_MA' => t('Tamazight'),
'uk_UA' => t('Ukrainian'),
'ur_PK' => t('Urdu'),
'uz_UZ' => t('Uzbek'),
'vi_VN' => t('Vietnamese'),
'wo_SN' => t('Wolof'),
'xh_ZA' => t('Xhosa'),
'yi_DE' => t('Yiddish'),
'yo_NG' => t('Yoruba'),
'zh_CN' => t('Simplified Chinese - China'),
'zh_HK' => t('Traditional Chinese - Hong Kong'),
'zh_TW' => t('Traditional Chinese - Taiwan'),
'zu_ZA' => t('Zulu'),
'zz_TR' => t('Zazaki'),
),
'#default_value' => variable_get('facebook_comments_block_settings_lang', 'en_US'),
'#description' => t('Select the default language of the comments plugin.'),
'#required' => TRUE,
);
$form['facebook_comments_settings']['facebook_comments_block_settings_color_schema'] = array(
'#type' => 'select',
'#title' => t('Color scheme'),
'#options' => array(
'light' => t('Light'),
'dark' => t('Dark'),
),
'#default_value' => variable_get('facebook_comments_block_settings_color_schema', 'light'),
'#description' => t('Set the color schema of facebook comments box.'),
'#required' => TRUE,
);
$form['facebook_comments_settings']['facebook_comments_block_settings_order'] = array(
'#type' => 'select',
'#title' => t('Order of comments'),
'#options' => array(
'social' => t('Top'),
'reverse_time' => t('Newest'),
'time' => t('Oldest'),
),
'#default_value' => variable_get('facebook_comments_block_settings_order', 'social'),
'#description' => t('Set the order of comments.'),
'#required' => TRUE,
);
$form['facebook_comments_settings']['facebook_comments_block_settings_number_of_posts'] = array(
'#type' => 'textfield',
'#title' => t('Number of posts'),
'#default_value' => variable_get('facebook_comments_block_settings_number_of_posts', '5'),
'#maxlength' => 3,
'#description' => t('Select how many posts you want to display by default.'),
'#required' => TRUE,
);
$form['facebook_comments_settings']['facebook_comments_block_settings_width_unit'] = array(
'#type' => 'select',
'#title' => t('Width'),
'#options' => array(
'percentage' => t('100%'),
'pixel' => t('Pixels'),
),
'#default_value' => variable_get('facebook_comments_block_settings_width_unit', 'percentage'),
'#description' => t('Set width of facebook comments box.'),
'#required' => TRUE,
);
$form['facebook_comments_settings']['facebook_comments_block_settings_width'] = array(
'#type' => 'textfield',
'#default_value' => variable_get('facebook_comments_block_settings_width', '500'),
'#maxlength' => 4,
'#description' => t('Enter the with in <em>px</em>.'),
'#required' => TRUE,
'#states' => array(
'visible' => array(
':input[name="facebook_comments_block_settings_width_unit"]' => array(
'value' => 'pixel',
),
),
'required' => array(
':input[name="facebook_comments_block_settings_width_unit"]' => array(
'value' => 'pixel',
),
),
),
);
break;
}
return $form;
}