facebook_likebox_slider_settings

The Facebook Likebox Slider facebook likebox slider settings class.

Defined (1)

The class is defined in the following location(s).

/settings.php  
  1. class facebook_likebox_slider_settings extends facebook_likebox_slider 
  2. /** 
  3. * Construct the plugin object 
  4. **/ 
  5. public function __construct() 
  6. /** 
  7. * include required files 
  8. **/ 
  9. require_once(ABSPATH.'wp-admin/includes/upgrade.php'); 
  10. require_once(ABSPATH.'wp-includes/pluggable.php'); 
  11. /** 
  12. * register actions, hook into WP's admin_init action hook 
  13. **/ 
  14. add_action('admin_init', array(&$this, 'admin_init')); 
  15. add_action('admin_menu', array(&$this, 'add_menu')); 
  16. /** 
  17. * include custom scripts and style to the admin page 
  18. **/ 
  19. function enqueue_admin_custom_scripts_and_styles() { 
  20. wp_enqueue_style('facebook_likebox_slider_style', plugins_url( '/templates/assets/css/facebook_likebox_slider_settings.css' , __FILE__ )); 
  21. wp_enqueue_style('jquery_ui_style', plugins_url( '/templates/assets/css/jquery-ui.css' , __FILE__ )); 
  22. wp_enqueue_script('jquery'); 
  23. wp_enqueue_script('jquery-ui-core', array('jquery')); 
  24. wp_enqueue_script('jquery-ui-tabs', array('jquery-ui-core')); 
  25. wp_enqueue_script('fbcs_admin', plugins_url( '/templates/assets/js/fbcs_admin.js' , __FILE__ ) , array('jquery', 'jquery-ui-core'), '100017', true); 
  26. /** 
  27. * initialize datas on wp admin 
  28. **/ 
  29. public function admin_init() 
  30. $settings_page = ''; 
  31. if (isset($_REQUEST['page'])) $settings_page = $_REQUEST['page']; 
  32. if ($settings_page=='facebook_likebox_slider') add_action('admin_head', array(&$this, 'enqueue_admin_custom_scripts_and_styles')); 
  33.  
  34. // register your custom settings - general settings 
  35. register_setting('facebook_likebox_slider-group', 'setting_appid'); 
  36. register_setting('facebook_likebox_slider-group', 'setting_fbsitename'); 
  37. register_setting('facebook_likebox_slider-group', 'setting_hide_icon'); 
  38. register_setting('facebook_likebox_slider-group', 'setting_lock_screen'); 
  39. register_setting('facebook_likebox_slider-group', 'setting_closeable'); 
  40. register_setting('facebook_likebox_slider-group', 'setting_timer'); 
  41. register_setting('facebook_likebox_slider-group', 'setting_transparency'); 
  42. register_setting('facebook_likebox_slider-group', 'setting_display_once_for_same_user'); 
  43. register_setting('facebook_likebox_slider-group', 'setting_localization'); 
  44. register_setting('facebook_likebox_slider-group', 'setting_scheme'); 
  45. register_setting('facebook_likebox_slider-group', 'setting_skin'); 
  46. register_setting('facebook_likebox_slider-group', 'setting_hide_alreadyliked'); 
  47. register_setting('facebook_likebox_slider-group', 'setting_disable_on_mobile'); 
  48. register_setting('facebook_likebox_slider-group', 'setting_keep_settings'); 
  49. // add your settings section 
  50. add_settings_section('facebook_likebox_slider-section', '', array(&$this, 'settings_section_facebook_likebox_slider'), 'facebook_likebox_slider'); 
  51. // add your setting's fields 
  52. add_settings_field('facebook_likebox_slider-setting_appid', 'Facebook App ID (required)', array(&$this, 'settings_field_input_text'), 'facebook_likebox_slider', 'facebook_likebox_slider-section', array('field' => 'setting_appid', 'field_value' => '', 'other' => 'MAXLENGTH="70" size="70"')); 
  53. add_settings_field('facebook_likebox_slider-setting_fbsitename', 'Facebook Page Name (required)', array(&$this, 'settings_field_input_text'), 'facebook_likebox_slider', 'facebook_likebox_slider-section', array('field' => 'setting_fbsitename', 'field_value' => '', 'other' => 'MAXLENGTH="70" size="48" placeholder="eg.: sympies"')); 
  54. add_settings_field('facebook_likebox_slider-setting_hide_icon', 'Hide icon', array(&$this, 'settings_field_input_radio'), 'facebook_likebox_slider', 'facebook_likebox_slider-section', array('field' => 'setting_hide_icon', 'field_value' => '', 'options' => array("On"=>"on", "Off"=>"off"), 'other' => '')); 
  55. add_settings_field('facebook_likebox_slider-setting_lock_screen', 'Lock screen', array(&$this, 'settings_field_input_radio'), 'facebook_likebox_slider', 'facebook_likebox_slider-section', array('field' => 'setting_lock_screen', 'field_value' => '', 'options' => array("On"=>"on", "Off"=>"off"), 'other' => '')); 
  56. add_settings_field('facebook_likebox_slider-setting_closeable', 'User can close the slider', array(&$this, 'settings_field_input_radio'), 'facebook_likebox_slider', 'facebook_likebox_slider-section', array('field' => 'setting_closeable', 'field_value' => '', 'options' => array("On"=>"on", "Off"=>"off"), 'other' => '')); 
  57. add_settings_field('facebook_likebox_slider-setting_timer', 'Timer (in seconds)', array(&$this, 'settings_field_input_text'), 'facebook_likebox_slider', 'facebook_likebox_slider-section', array('field' => 'setting_timer', 'field_value' => '', 'other' => 'onkeyup="this.value = this.value.replace(/[^0-9\s]/g, \'\');" MAXLENGTH="3" size="3"')); 
  58. add_settings_field('facebook_likebox_slider-setting_transparency', 'Transparency (percentage)', array(&$this, 'settings_field_input_text'), 'facebook_likebox_slider', 'facebook_likebox_slider-section', array('field' => 'setting_transparency', 'field_value' => '', 'other' => 'onkeyup="this.value = this.value.replace(/[^0-9\s]/g, \'\');" MAXLENGTH="3" size="3"')); 
  59. add_settings_field('facebook_likebox_slider-setting_display_once_for_same_user', 'Display once per user', array(&$this, 'settings_field_input_radio'), 'facebook_likebox_slider', 'facebook_likebox_slider-section', array('field' => 'setting_display_once_for_same_user', 'field_value' => '', 'options' => array("On"=>"on", "Off"=>"off"), 'other' => '')); 
  60. add_settings_field('facebook_likebox_slider-setting_localization', 'Language', array(&$this, 'settings_field_input_select'), 'facebook_likebox_slider', 'facebook_likebox_slider-section', array('field' => 'setting_localization', 'field_value' => '', 'other' => 'localization')); 
  61. add_settings_field('facebook_likebox_slider-setting_scheme', 'Style', array(&$this, 'settings_field_input_select'), 'facebook_likebox_slider', 'facebook_likebox_slider-section', array('field' => 'setting_scheme', 'field_value' => '', 'other' => 'scheme')); 
  62. add_settings_field('facebook_likebox_slider-setting_skin', 'Skin', array(&$this, 'settings_field_input_select'), 'facebook_likebox_slider', 'facebook_likebox_slider-section', array('field' => 'setting_skin', 'field_value' => '', 'other' => 'skin')); 
  63. add_settings_field('facebook_likebox_slider-setting_disable_on_mobile', 'Disable on mobile', array(&$this, 'settings_field_input_radio'), 'facebook_likebox_slider', 'facebook_likebox_slider-section', array('field' => 'setting_disable_on_mobile', 'field_value' => '', 'options' => array("On"=>"on", "Off"=>"off"), 'other' => '')); 
  64. add_settings_field('facebook_likebox_slider-setting_hide_alreadyliked', 'Hide Likebox for already Liked', array(&$this, 'settings_field_input_radio'), 'facebook_likebox_slider', 'facebook_likebox_slider-section', array('field' => 'setting_hide_alreadyliked', 'field_value' => '', 'options' => array("On"=>"on", "Off"=>"off"), 'other' => '')); 
  65. add_settings_field('facebook_likebox_slider-setting_keep_settings', 'Keep Settings', array(&$this, 'settings_field_input_radio'), 'facebook_likebox_slider', 'facebook_likebox_slider-section', array('field' => 'setting_keep_settings', 'field_value' => '', 'options' => array("On"=>"on", "Off"=>"off"), 'other' => '')); 
  66.  
  67. // register your custom settings - comment box settings 
  68. register_setting('facebook_likebox_slider_comment_box-group', 'setting_vertical_distance1'); 
  69. register_setting('facebook_likebox_slider_comment_box-group', 'setting_icon_size1'); 
  70. register_setting('facebook_likebox_slider_comment_box-group', 'setting_auto_open1'); 
  71. register_setting('facebook_likebox_slider_comment_box-group', 'setting_message'); 
  72. register_setting('facebook_likebox_slider_comment_box-group', 'setting_direction1'); 
  73. register_setting('facebook_likebox_slider_comment_box-group', 'setting_specified_page1'); 
  74. register_setting('facebook_likebox_slider_comment_box-group', 'setting_no_post_to_show'); 
  75. register_setting('facebook_likebox_slider_comment_box-group', 'setting_icon_url1'); 
  76. register_setting('facebook_likebox_slider_comment_box-group', 'setting_shake1'); 
  77. // add your settings section 
  78. add_settings_section('facebook_likebox_slider_comment_box-section', '', array(&$this, 'settings_section_facebook_likebox_slider'), 'facebook_likebox_slider_comment_box'); 
  79. add_settings_field('facebook_likebox_slider-setting_vertical_distance1', 'Icon Vertical Distance (5-95 / in percentage)', array(&$this, 'settings_field_input_text'), 'facebook_likebox_slider_comment_box', 'facebook_likebox_slider_comment_box-section', array('field' => 'setting_vertical_distance1', 'field_value' => '', 'other' => 'onkeyup="this.value = this.value.replace(/[^0-9\s]/g, \'\'); MAXLENGTH="2" size="5"')); 
  80. add_settings_field('facebook_likebox_slider-setting_icon_size1', 'Icon size', array(&$this, 'settings_field_input_radio'), 'facebook_likebox_slider_comment_box', 'facebook_likebox_slider_comment_box-section', array('field' => 'setting_icon_size1', 'field_value' => '', 'options' => array("Small"=>"small", "Medium"=>"medium", "Large"=>"large"), 'other' => '')); 
  81. add_settings_field('facebook_likebox_slider-setting_auto_open1', 'Auto open at bottom of the page', array(&$this, 'settings_field_input_radio'), 'facebook_likebox_slider_comment_box', 'facebook_likebox_slider_comment_box-section', array('field' => 'setting_auto_open1', 'field_value' => '', 'options' => array("On"=>"on", "Off"=>"off"), 'other' => '')); 
  82. add_settings_field('facebook_likebox_slider-setting_message', 'Message for Comment Box', array(&$this, 'settings_field_input_text'), 'facebook_likebox_slider_comment_box', 'facebook_likebox_slider_comment_box-section', array('field' => 'setting_message', 'field_value' => '', 'other' => 'MAXLENGTH="70" size="70"')); 
  83. add_settings_field('facebook_likebox_slider-setting_icon_url1', 'Icon url (optional - leave empty for default)', array(&$this, 'settings_field_input_text'), 'facebook_likebox_slider_comment_box', 'facebook_likebox_slider_comment_box-section', array('field' => 'setting_icon_url1', 'field_value' => '', 'other' => 'MAXLENGTH="200" size="70"')); 
  84. add_settings_field('facebook_likebox_slider-setting_direction1', 'Direction', array(&$this, 'settings_field_input_radio'), 'facebook_likebox_slider_comment_box', 'facebook_likebox_slider_comment_box-section', array('field' => 'setting_direction1', 'field_value' => '', 'options' => array("Left"=>"left", "Right"=>"right"), 'other' => '')); 
  85. add_settings_field('facebook_likebox_slider-setting_specified_page1', 'Display on', array(&$this, 'settings_field_input_radio'), 'facebook_likebox_slider_comment_box', 'facebook_likebox_slider_comment_box-section', array('field' => 'setting_specified_page1', 'field_value' => '', 'options' => array("All"=>"all", "Posts"=>"posts", "Pages"=>"pages", "Both"=>"both"), 'other' => '')); 
  86. add_settings_field('facebook_likebox_slider-setting_no_post_to_show', 'Number of posts to display', array(&$this, 'settings_field_input_select'), 'facebook_likebox_slider_comment_box', 'facebook_likebox_slider_comment_box-section', array('field' => 'setting_no_post_to_show', 'field_value' => '', 'min' => 1, 'max' => 6, 'default' => 5, 'other' => '')); 
  87. add_settings_field('facebook_likebox_slider-setting_shake1', 'Icon animation', array(&$this, 'settings_field_input_select'), 'facebook_likebox_slider_comment_box', 'facebook_likebox_slider_comment_box-section', array('field' => 'setting_shake1', 'field_value' => '', 'other' => 'shake')); 
  88.  
  89. // register your custom settings - like box settings 
  90. register_setting('facebook_likebox_slider_like_box-group', 'setting_vertical_distance2'); 
  91. register_setting('facebook_likebox_slider_like_box-group', 'setting_icon_size2'); 
  92. register_setting('facebook_likebox_slider_like_box-group', 'setting_auto_open2'); 
  93. register_setting('facebook_likebox_slider_like_box-group', 'setting_likebox_message'); 
  94. register_setting('facebook_likebox_slider_like_box-group', 'setting_direction2'); 
  95. register_setting('facebook_likebox_slider_like_box-group', 'setting_icon_url2'); 
  96. register_setting('facebook_likebox_slider_like_box-group', 'setting_shake2'); 
  97. // add your settings section 
  98. add_settings_section('facebook_likebox_slider_like_box-section', '', array(&$this, 'settings_section_facebook_likebox_slider'), 'facebook_likebox_slider_like_box'); 
  99. add_settings_field('facebook_likebox_slider-setting_vertical_distance2', 'Icon Vertical Distance (5-95 / in percentage)', array(&$this, 'settings_field_input_text'), 'facebook_likebox_slider_like_box', 'facebook_likebox_slider_like_box-section', array('field' => 'setting_vertical_distance2', 'field_value' => '', 'other' => 'onkeyup="this.value = this.value.replace(/[^0-9\s]/g, \'\'); MAXLENGTH="2" size="5"')); 
  100. add_settings_field('facebook_likebox_slider-setting_icon_size2', 'Icon size', array(&$this, 'settings_field_input_radio'), 'facebook_likebox_slider_like_box', 'facebook_likebox_slider_like_box-section', array('field' => 'setting_icon_size2', 'field_value' => '', 'options' => array("Small"=>"small", "Medium"=>"medium", "Large"=>"large"), 'other' => '')); 
  101. add_settings_field('facebook_likebox_slider-setting_auto_open2', 'Auto open at bottom of the page', array(&$this, 'settings_field_input_radio'), 'facebook_likebox_slider_like_box', 'facebook_likebox_slider_like_box-section', array('field' => 'setting_auto_open2', 'field_value' => '', 'options' => array("On"=>"on", "Off"=>"off"), 'other' => '')); 
  102. add_settings_field('facebook_likebox_slider-setting_likebox_message', 'Message for Like Box', array(&$this, 'settings_field_input_text'), 'facebook_likebox_slider_like_box', 'facebook_likebox_slider_like_box-section', array('field' => 'setting_likebox_message', 'field_value' => '', 'other' => 'MAXLENGTH="70" size="70"')); 
  103. add_settings_field('facebook_likebox_slider-setting_icon_url2', 'Icon url (optional - leave empty for default)', array(&$this, 'settings_field_input_text'), 'facebook_likebox_slider_like_box', 'facebook_likebox_slider_like_box-section', array('field' => 'setting_icon_url2', 'field_value' => '', 'other' => 'MAXLENGTH="200" size="70"')); 
  104. add_settings_field('facebook_likebox_slider-setting_direction2', 'Direction', array(&$this, 'settings_field_input_radio'), 'facebook_likebox_slider_like_box', 'facebook_likebox_slider_like_box-section', array('field' => 'setting_direction2', 'field_value' => '', 'options' => array("Left"=>"left", "Right"=>"right"), 'other' => '')); 
  105. add_settings_field('facebook_likebox_slider-setting_shake2', 'Icon animation', array(&$this, 'settings_field_input_select'), 'facebook_likebox_slider_like_box', 'facebook_likebox_slider_like_box-section', array('field' => 'setting_shake2', 'field_value' => '', 'other' => 'shake')); 
  106. // register your custom settings - post box settings 
  107. register_setting('facebook_likebox_slider_post_box-group', 'setting_vertical_distance3'); 
  108. register_setting('facebook_likebox_slider_post_box-group', 'setting_icon_size3'); 
  109. register_setting('facebook_likebox_slider_post_box-group', 'setting_auto_open3'); 
  110. register_setting('facebook_likebox_slider_post_box-group', 'setting_postbox_message'); 
  111. register_setting('facebook_likebox_slider_post_box-group', 'setting_direction3'); 
  112. register_setting('facebook_likebox_slider_post_box-group', 'setting_icon_url3'); 
  113. register_setting('facebook_likebox_slider_post_box-group', 'setting_shake3'); 
  114. // add your settings section 
  115. add_settings_section('facebook_likebox_slider_post_box-section', '', array(&$this, 'settings_section_facebook_likebox_slider'), 'facebook_likebox_slider_post_box'); 
  116. add_settings_field('facebook_likebox_slider-setting_vertical_distance3', 'Icon Vertical Distance (5-95 / in percentage)', array(&$this, 'settings_field_input_text'), 'facebook_likebox_slider_post_box', 'facebook_likebox_slider_post_box-section', array('field' => 'setting_vertical_distance3', 'field_value' => '', 'other' => 'onkeyup="this.value = this.value.replace(/[^0-9\s]/g, \'\'); MAXLENGTH="2" size="5"')); 
  117. add_settings_field('facebook_likebox_slider-setting_icon_size3', 'Icon size', array(&$this, 'settings_field_input_radio'), 'facebook_likebox_slider_post_box', 'facebook_likebox_slider_post_box-section', array('field' => 'setting_icon_size3', 'field_value' => '', 'options' => array("Small"=>"small", "Medium"=>"medium", "Large"=>"large"), 'other' => '')); 
  118. add_settings_field('facebook_likebox_slider-setting_auto_open3', 'Auto open at bottom of the page', array(&$this, 'settings_field_input_radio'), 'facebook_likebox_slider_post_box', 'facebook_likebox_slider_post_box-section', array('field' => 'setting_auto_open3', 'field_value' => '', 'options' => array("On"=>"on", "Off"=>"off"), 'other' => '')); 
  119. add_settings_field('facebook_likebox_slider-setting_postbox_message', 'Message for Wall', array(&$this, 'settings_field_input_text'), 'facebook_likebox_slider_post_box', 'facebook_likebox_slider_post_box-section', array('field' => 'setting_postbox_message', 'field_value' => '', 'other' => 'MAXLENGTH="70" size="70"')); 
  120. add_settings_field('facebook_likebox_slider-setting_icon_url3', 'Icon url (optional - leave empty for default)', array(&$this, 'settings_field_input_text'), 'facebook_likebox_slider_post_box', 'facebook_likebox_slider_post_box-section', array('field' => 'setting_icon_url3', 'field_value' => '', 'other' => 'MAXLENGTH="200" size="70"')); 
  121. add_settings_field('facebook_likebox_slider-setting_direction3', 'Direction', array(&$this, 'settings_field_input_radio'), 'facebook_likebox_slider_post_box', 'facebook_likebox_slider_post_box-section', array('field' => 'setting_direction3', 'field_value' => '', 'options' => array("Left"=>"left", "Right"=>"right"), 'other' => '')); 
  122. add_settings_field('facebook_likebox_slider-setting_shake3', 'Icon animation', array(&$this, 'settings_field_input_select'), 'facebook_likebox_slider_post_box', 'facebook_likebox_slider_post_box-section', array('field' => 'setting_shake3', 'field_value' => '', 'other' => 'shake')); 
  123. // Possibly do additional admin_init tasks 
  124. /** 
  125. * This function provides special inputs for settings fields 
  126. **/ 
  127. public function settings_field_input_special($args) 
  128. {  
  129. $other = $args['other']; 
  130. $options = $args['options']; 
  131. $key = '';  
  132. // Get the field name from the $args array or get the value of this setting 
  133. $field = $args['field']; 
  134. if ($args['field_value']) $value = $args['field_value']; 
  135. else $value = get_option($field); 
  136. foreach($options as $key=>$opt) { 
  137. if ($value==$opt OR (!$value AND $opt=="3")) $selected = 'checked="true"'; 
  138. else $selected = ""; 
  139. if ($key=="Custom") { 
  140. echo sprintf('<input type="radio" name="%s" id="%s%s" '.$selected.' value="%s" /><label for="%s%s"> '.$key.'</label><br />', $field, $field, $opt, $opt, $field, $opt); 
  141. $custom = get_option('setting_style_notification_custom'); 
  142. if (!$custom) $custom = '[div onclick="document.location=\'{permalink}\'" id="wpusertracker_notification" class="wpusertracker_notification_{position}" style="color:#FC0303;padding: 10px;"]someone had just start to read: [br /][center][a href="{permalink}"]{post_title}[/a][/center][/div]'; 
  143. echo sprintf('<textarea rows="7" cols="60" name="%s_custom" id="%s_custom" />%s</textarea>', $field, $field, $custom); 
  144. else { 
  145. echo sprintf('<input type="radio" name="%s" id="%s%s" '.$selected.' value="%s" /><label for="%s%s"> '.$key.'</label><br />', $field, $field, $opt, $opt, $field, $opt); 
  146. /** 
  147. * This function provides radio inputs for settings fields 
  148. **/ 
  149. public function settings_field_input_radio($args) 
  150. $key = ''; 
  151. $other = $args['other']; 
  152. $options = $args['options']; 
  153. // Get the field name from the $args array or get the value of this setting 
  154. $field = $args['field']; 
  155. if ($args['field_value']) $value = $args['field_value']; 
  156. else $value = get_option($field); 
  157. // echo a proper input type="radio" 
  158. foreach($options as $key=>$opt)  
  159. if ($value==$opt OR (!$value AND $opt=="off")) $selected = 'checked="true"'; 
  160. else $selected = ""; 
  161. echo sprintf('<input type="radio" name="%s" id="%s%s" '.$selected.' value="%s" /> <label for="%s%s"> '.$key.'</label> ', $field, $field, $opt, $opt, $field, $opt); 
  162. /** 
  163. * This function provides text inputs for settings fields 
  164. **/ 
  165. public function settings_field_input_text($args) 
  166. $other = $args['other']; 
  167. // Get the field name from the $args array or get the value of this setting 
  168. $field = $args['field']; 
  169. if ($args['field_value']) $value = $args['field_value']; 
  170. else $value = get_option($field); 
  171. // echo a proper input type="text" 
  172. if ($field == 'setting_fbsitename') print('<span style="margin-top:5px;">http://facebook.com/</span>'); 
  173. if (!empty($other)) echo sprintf('<input type="text" name="%s" id="%s" value="%s" %s />', $field, $field, $value, $other); 
  174. else echo sprintf('<input type="text" name="%s" id="%s" value="%s" />', $field, $field, $value); 
  175. /** 
  176. * This function provides textarea inputs for settings fields 
  177. **/ 
  178. public function settings_field_input_textarea($args) 
  179. $other = $args['other']; 
  180. // Get the field name from the $args array or get the value of this setting 
  181. $field = $args['field']; 
  182. if ($args['field_value']) $value = $args['field_value']; 
  183. else $value = get_option($field); 
  184. // echo a proper input type="textarea" 
  185. if (!empty($other)) echo sprintf('<textarea name="%s" id="%s" %s />%s</textarea>', $field, $field, $other, $value); 
  186. else echo sprintf('<textarea name="%s" id="%s" />%s</textarea>', $field, $field, $value); 
  187. /** 
  188. * This function provides select inputs for settings fields 
  189. **/ 
  190. public function settings_field_input_select($args) 
  191. // Get the field name from the $args array or get the value of this setting 
  192. $field = $args['field']; 
  193. if ($args['field_value']) $value = $args['field_value']; 
  194. else $value = get_option($field); 
  195. if (!$value) $value = 'en_US'; 
  196. if ($args['other']=='localization') 
  197. $languages = Array 
  198. ("Afrikaans" => af_ZA,  
  199. "Albanian" => sq_AL,  
  200. "Arabic" => ar_AR,  
  201. "Armenian" => hy_AM,  
  202. "Azerbaijani" => az_AZ,  
  203. "Basque" => eu_ES,  
  204. "Belarusian" => be_BY,  
  205. "Bengali" => bn_IN,  
  206. "Bosnian" => bs_BA,  
  207. "Bulgarian" => bg_BG,  
  208. "Catalan" => ca_ES,  
  209. "Cebuano" => cx_PH,  
  210. "Croatian" => hr_HR,  
  211. "Czech" => cs_CZ,  
  212. "Danish" => da_DK,  
  213. "Dutch" => nl_NL,  
  214. "English (Pirate)" => en_PI,  
  215. "English (UK)" => en_GB,  
  216. "English (US)" => en_US,  
  217. "English (Upside Down)" => en_UD,  
  218. "Esperanto" => eo_EO,  
  219. "Estonian" => et_EE,  
  220. "Faroese" => fo_FO,  
  221. "Filipino" => tl_PH,  
  222. "Finnish" => fi_FI,  
  223. "French (Canada)" => fr_CA,  
  224. "French (France)" => fr_FR,  
  225. "Frisian" => fy_NL,  
  226. "Galician" => gl_ES,  
  227. "Georgian" => ka_GE,  
  228. "German" => de_DE,  
  229. "Greek" => el_GR,  
  230. "Guarani" => gn_PY,  
  231. "Hebrew" => he_IL,  
  232. "Hindi" => hi_IN,  
  233. "Hungarian" => hu_HU,  
  234. "Icelandic" => is_IS,  
  235. "Indonesian" => id_ID,  
  236. "Irish" => ga_IE,  
  237. "Italian" => it_IT,  
  238. "Japanese" => ja_JP,  
  239. "Javanese" => jv_ID,  
  240. "Kannada" => kn_IN,  
  241. "Khmer" => km_KH,  
  242. "Korean" => ko_KR,  
  243. "Kurdish" => ku_TR,  
  244. "Latin" => la_VA,  
  245. "Latvian" => lv_LV,  
  246. "Leet Speak" => fb_LT,  
  247. "Lithuanian" => lt_LT,  
  248. "Macedonian" => mk_MK,  
  249. "Malay" => ms_MY,  
  250. "Malayalam" => ml_IN,  
  251. "Nepali" => ne_NP,  
  252. "Norwegian (bokmal)" => nb_NO,  
  253. "Norwegian (nynorsk)" => nn_NO,  
  254. "Pashto" => ps_AF,  
  255. "Persian" => fa_IR,  
  256. "Polish" => pl_PL,  
  257. "Portuguese (Brazil)" => pt_BR,  
  258. "Portuguese (Portugal)" => pt_PT,  
  259. "Punjabi" => pa_IN,  
  260. "Romanian" => ro_RO,  
  261. "Russian" => ru_RU,  
  262. "Serbian" => sr_RS,  
  263. "Simplified Chinese (China)" => zh_CN,  
  264. "Sinhala" => si_LK,  
  265. "Slovak" => sk_SK,  
  266. "Slovenian" => sl_SI,  
  267. "Spanish" => es_LA,  
  268. "Spanish (Spain)" => es_ES,  
  269. "Swahili" => sw_KE,  
  270. "Swedish" => sv_SE,  
  271. "Tamil" => ta_IN,  
  272. "Telugu" => te_IN,  
  273. "Thai" => th_TH,  
  274. "Traditional Chinese (Hong Kong)" => zh_HK,  
  275. "Traditional Chinese (Taiwan)" => zh_TW,  
  276. "Turkish" => tr_TR,  
  277. "Ukrainian" => uk_UA,  
  278. "Urdu" => ur_PK,  
  279. "Vietnamese" => vi_VN,  
  280. "Welsh" => cy_GB 
  281. ); 
  282. echo sprintf('<select name="%s" id="%s">', $field, $field); 
  283. foreach($languages as $key=>$lng) 
  284. $selected = ''; 
  285. echo('<option value="'.$lng.'" '.selected($value, $lng, false).'>'.$key.'</option>'); 
  286. echo('</select>'); 
  287. elseif ($args['other']=='scheme') 
  288. echo sprintf('<select name="%s" id="%s" style="width: 200px;">', $field, $field); 
  289. echo('<option value="light" '.selected($value, 'light', false).'>Light</option>'); 
  290. echo('<option value="dark" '.selected($value, 'dark', false).'>Dark</option>'); 
  291. echo('</select>'); 
  292. elseif ($args['other']=='skin') 
  293. echo sprintf('<select name="%s" id="%s" style="width: 200px;">', $field, $field); 
  294. echo('<option value="default" '.selected($value, 'default', false).'>Default</option>'); 
  295. echo('<option value="minimal" '.selected($value, 'minimal', false).'>Minimal</option>'); 
  296. echo('</select>'); 
  297. elseif ($args['other']=='shake') 
  298. echo sprintf('<select name="%s" id="%s" style="width: 200px;">', $field, $field); 
  299. echo('<option value="0" '.selected($value, '0', false).'>Disabled</option>'); 
  300. echo('<option value="heartbeat" '.selected($value, 'heartbeat', false).'>Heartbeat</option>'); 
  301. echo('<option value="5000" '.selected($value, '5000', false).'>Shake 5sec</option>'); 
  302. echo('<option value="10000" '.selected($value, '10000', false).'>Shake 10sec</option>'); 
  303. echo('<option value="15000" '.selected($value, '15000', false).'>Shake 15sec</option>'); 
  304. echo('<option value="20000" '.selected($value, '20000', false).'>Shake 20sec</option>'); 
  305. echo('<option value="25000" '.selected($value, '25000', false).'>Shake 25sec</option>'); 
  306. echo('<option value="30000" '.selected($value, '30000', false).'>Shake 30sec</option>'); 
  307. echo('<option value="35000" '.selected($value, '35000', false).'>Shake 35sec</option>'); 
  308. echo('<option value="40000" '.selected($value, '40000', false).'>Shake 40sec</option>'); 
  309. echo('<option value="45000" '.selected($value, '45000', false).'>Shake 45sec</option>'); 
  310. echo('<option value="50000" '.selected($value, '50000', false).'>Shake 50sec</option>'); 
  311. echo('<option value="55000" '.selected($value, '55000', false).'>Shake 55sec</option>'); 
  312. echo('<option value="60000" '.selected($value, '60000', false).'>Shake 1min</option>'); 
  313. echo('<option value="120000" '.selected($value, '120000', false).'>Shake 2min</option>'); 
  314. echo('<option value="180000" '.selected($value, '180000', false).'>Shake 3min</option>'); 
  315. echo('<option value="240000" '.selected($value, '240000', false).'>Shake 4min</option>'); 
  316. echo('<option value="300000" '.selected($value, '300000', false).'>Shake 5min</option>'); 
  317. echo('</select>'); 
  318. else 
  319. if (isset($args['min'])) $field_min = $args['min']; 
  320. if (isset($args['max'])) $field_max = $args['max']; 
  321. if (isset($args['default'])) $field_default = $args['default']; 
  322. if (!isset($field_min)) $field_min = 1; 
  323. if (!isset($field_max)) $field_max = 10; 
  324. if (!isset($field_default)) $field_default = 5; 
  325. // echo a proper select element 
  326. echo sprintf('<select name="%s" id="%s">', $field, $field); 
  327. for($i=$field_min;$i<=$field_max;$i++) { 
  328. $selected = ''; 
  329. if ($value==$i) $selected = 'selected = "true"'; 
  330. if (!$value AND $i==$field_default) $selected = 'selected = "true"'; 
  331. echo('<option value="'.$i.'" '.$selected.'>'.$i.'</option>'); 
  332. echo('</select>'); 
  333. /** 
  334. * add a menu 
  335. **/  
  336. public function add_menu() 
  337. // Add a page to manage this plugin's settings 
  338. add_options_page('FB Likebox Slider', 'FB Likebox Slider', 'manage_options', 'facebook_likebox_slider', array(&$this, 'plugin_settings_page')); 
  339. /** 
  340. * Menu Callback 
  341. **/  
  342. public function plugin_settings_page() 
  343. if(!current_user_can('manage_options')) 
  344. wp_die(__('You do not have sufficient permissions to access this page.')); 
  345. // Render the settings template 
  346. include(sprintf("%s/templates/settings.php", dirname(__FILE__))); 
  347. public function settings_section_facebook_likebox_slider() 
  348.