/**
  * Triggered when the tab is loaded.
  */
 public function replyToAddFormElements($oAdminPage)
 {
     // Section
     $oAdminPage->addSettingSections($this->sPageSlug, array('section_id' => $this->sSectionID, 'tab_slug' => $this->sTabSlug, 'title' => __('Autocomplete Custom Field Type', 'admin-page-framework-demo'), 'description' => __('This field will show predefined list when the user type something on the input field.', 'admin-page-framework-demo')));
     // Fields
     $oAdminPage->addSettingFields($this->sSectionID, array('type' => 'autocomplete', 'field_id' => 'autocomplete_field', 'title' => __('Default', 'admin-page-framework-demo'), 'description' => __('By default, all the post titles will be fetched in the background and will pop up.', 'admin-page-framework-demo')), array('type' => 'autocomplete', 'field_id' => 'autocomplete_local_data', 'title' => __('Local Data', 'admin-page-framework-demo'), 'settings' => array(array('id' => 7, 'name' => 'Ruby'), array('id' => 11, 'name' => 'Python'), array('id' => 13, 'name' => 'JavaScript'), array('id' => 17, 'name' => 'ActionScript'), array('id' => 19, 'name' => 'Scheme'), array('id' => 23, 'name' => 'Lisp'), array('id' => 29, 'name' => 'C#'), array('id' => 31, 'name' => 'Fortran'), array('id' => 37, 'name' => 'Visual Basic'), array('id' => 41, 'name' => 'C'), array('id' => 43, 'name' => 'C++'), array('id' => 47, 'name' => 'Java')), 'settings2' => array('theme' => 'mac', 'hintText' => __('Type a programming language.', 'admin-page-framework-demo'), 'prePopulate' => array(array('id' => 3, 'name' => 'PHP'), array('id' => 5, 'name' => 'APS'))), 'description' => __('Predefined items are Ruby, Python, JavaScript, ActionScript, Scheme, Lisp, C#, Fortran, Vidual Basic, C, C++, Java.', 'admin-page-framework-demo')), array('type' => 'autocomplete', 'field_id' => 'autocomplete_custom_post_type', 'title' => __('Custom Post Type', 'admin-page-framework-demo'), 'settings' => add_query_arg(array('request' => 'autocomplete', 'post_type' => 'apf_posts') + $_GET, admin_url(AdminPageFramework_WPUtility::getPageNow())), 'settings2' => array('tokenLimit' => 5, 'preventDuplicates' => true, 'theme' => 'facebook', 'searchDelay' => 50), 'description' => __('To set a custom post type, you need to construct the query url. This field is for the titles of this demo plugin\'s custom post type.', 'admin-page-framework-demo')), array('type' => 'autocomplete', 'field_id' => 'autocomplete_mixed_field_types', 'title' => __('Mixed Post Types', 'admin-page-framework-demo'), 'settings' => add_query_arg(array('request' => 'autocomplete', 'post_types' => 'post, page, apf_posts', 'post_status' => 'publish, private') + $_GET, admin_url(AdminPageFramework_WPUtility::getPageNow())), 'settings2' => array('theme' => 'admin_page_framework'), 'description' => __('To search from multiple post types use the <code>post_types</code> argument (not <code>post_type</code>) and pass comma delimited post type slugs.', 'admin-page-framework-demo')), array('type' => 'autocomplete', 'field_id' => 'autocomplete_repeatable_field', 'title' => __('Repeatable', 'admin-page-framework-demo'), 'repeatable' => true), array('type' => 'autocomplete', 'field_id' => 'autocomplete_users', 'title' => __('Search Users', 'admin-page-framework-demo'), 'settings' => add_query_arg(array('request' => 'autocomplete', 'type' => 'user') + $_GET, admin_url(AdminPageFramework_WPUtility::getPageNow())), 'settings2' => array('theme' => 'admin_page_framework', 'hintText' => __('Type a user name.', 'auto-post'), 'preventDuplicates' => true), 'description' => __('To search users, pass the <code>user</code> to the <code>type</code> argument.', 'admin-page-framework-demo')));
 }
 /**
  * Sets up necessary property values.
  */
 public function __construct($oCaller, $sCallerPath, $sClassName, $sCapability, $sTextDomain, $sFieldsType)
 {
     $this->oCaller = $oCaller;
     $this->sCallerPath = $sCallerPath ? $sCallerPath : null;
     $this->sClassName = $sClassName;
     $this->sClassHash = md5($sClassName);
     $this->sCapability = empty($sCapability) ? 'manage_options' : $sCapability;
     $this->sTextDomain = empty($sTextDomain) ? 'admin-page-framework' : $sTextDomain;
     $this->sFieldsType = $sFieldsType;
     $GLOBALS['aAdminPageFramework'] = isset($GLOBALS['aAdminPageFramework']) && is_array($GLOBALS['aAdminPageFramework']) ? $GLOBALS['aAdminPageFramework'] : array('aFieldFlags' => array());
     $this->sPageNow = AdminPageFramework_WPUtility::getPageNow();
     $this->bIsAdmin = is_admin();
     $this->bIsAdminAjax = in_array($this->sPageNow, array('admin-ajax.php'));
 }