Example #1
0
 /**
  * Generates and returns the ThinkUp options array. Caches the result after the first call to the function to speed
  *  up future calls.
  *
  * If the $force_update (first argument) is set to 'force-update', the function will update the cached options
  * array and return it.
  *
  * @return Array options array
  */
 public static function getOptionsArray($force_update = null)
 {
     if (!is_array(self::$options) || $force_update == 'force-update') {
         self::$options = array('thinkup_twitter_username' => array('key' => 'thinkup_twitter_username', 'label' => __('Default Twitter username:'******'thinkup-wp-plugin'), 'description' => __('(Required) Override this by using the "username" parameter in the shortcodes.', 'thinkup-wp-plugin'), 'type' => 'text', 'value' => get_option('thinkup_twitter_username')), 'thinkup_table_prefix' => array('key' => 'thinkup_table_prefix', 'label' => __('ThinkUp table prefix:', 'thinkup-wp-plugin'), 'description' => __('(Optional) The prefix on your ThinkUp database tables, e.g. <i>tu_</i>', 'thinkup-wp-plugin'), 'type' => 'text', 'value' => get_option('thinkup_table_prefix')), 'thinkup_server' => array('key' => 'thinkup_server', 'label' => __('ThinkUp database server:', 'thinkup-wp-plugin'), 'description' => __('Required only if the ThinkUp database tables are located in a different ' . 'databasethan the WordPress tables.', 'thinkup-wp-plugin'), 'type' => 'text', 'value' => get_option('thinkup_server')), 'thinkup_db' => array('key' => 'thinkup_db', 'label' => __('ThinkUp database name:', 'thinkup-wp-plugin'), 'description' => __('Required only if the ThinkUp database tables are located in a different ' . 'database than the WordPress tables.', 'thinkup-wp-plugin'), 'type' => 'text', 'value' => get_option('thinkup_db')), 'thinkup_dbusername' => array('key' => 'thinkup_dbusername', 'label' => __('ThinkUp database username:'******'thinkup-wp-plugin'), 'description' => __('Required only if the ThinkUp database tables are located in a different ' . 'database than the WordPress tables.', 'thinkup-wp-plugin'), 'type' => 'text', 'value' => get_option('thinkup_dbusername')), 'thinkup_dbpw' => array('key' => 'thinkup_dbpw', 'label' => __('ThinkUp database password:'******'thinkup-wp-plugin'), 'description' => __('Required only if the ThinkUp database tables are located in a different ' . 'database than the WordPress tables.', 'thinkup-wp-plugin'), 'type' => 'password', 'value' => ThinkUpWordPressPlugin::unscramblePassword(get_option('thinkup_dbpw'))));
     }
     return self::$options;
 }