public function setUp()
 {
     $oSearchOptionFields = new AmazonAutoLinks_Form_Search();
     foreach ($oSearchOptionFields->getFieldsOfAdvanced('', '') as $arrField) {
         if (!isset($arrField['strFieldID']) || $arrField['strFieldID'] == 'title') {
             continue;
         }
         // remove the section key because meta box don't use it. ( it is only necessary for Settings API for admin pages. )
         unset($arrField['strSectionID']);
         $this->addSettingField($arrField);
     }
 }
 public function setUp()
 {
     $oSearchOptionFields = new AmazonAutoLinks_Form_Search();
     foreach ($oSearchOptionFields->getFieldOfSimilarityLookUp('', '') as $arrField) {
         if (!isset($arrField['strFieldID']) || $arrField['strFieldID'] == 'unit_title') {
             continue;
         }
         // remove the section key because meta box don't use it. ( it is only necessary for Settings API for admin pages. )
         unset($arrField['strSectionID']);
         $this->addSettingField($arrField);
     }
     // Additional fields.
     $this->addSettingFields(array('strFieldID' => 'unit_type', 'strType' => 'hidden', 'vValue' => 'search'), array('strFieldID' => 'cache_duration', 'strTitle' => __('Cache Duration', 'amazon-auto-links'), 'strDescription' => __('The cache lifespan in seconds. For no cache, set 0.', 'amazon-auto-links') . ' ' . __('Default:', 'amazon-auto-links') . ': 1200', 'strType' => 'number', 'vDefault' => 60 * 20), array());
 }
 protected function _setUpForms()
 {
     /*
      * Form elements - Sections
      */
     // Form Elements - Add Unit by Category
     $oCategoryFormElements = new AmazonAutoLinks_Form_Category('aal_add_category_unit');
     call_user_func_array(array($this, "addSettingSections"), $oCategoryFormElements->getSections());
     call_user_func_array(array($this, "addSettingFields"), $oCategoryFormElements->getFields('category'));
     call_user_func_array(array($this, "addSettingFields"), $oCategoryFormElements->getFields('category_auto_insert'));
     call_user_func_array(array($this, "addSettingFields"), $oCategoryFormElements->getFields('category_template'));
     // Form Elements - Add Unit by Tag and Customer ID
     $oTagFormElements = new AmazonAutoLinks_Form_Tag('aal_add_tag_unit');
     call_user_func_array(array($this, "addSettingSections"), $oTagFormElements->getSections());
     call_user_func_array(array($this, "addSettingFields"), $oTagFormElements->getFields('tag'));
     call_user_func_array(array($this, "addSettingFields"), $oTagFormElements->getFields('tag_auto_insert'));
     call_user_func_array(array($this, "addSettingFields"), $oTagFormElements->getFields('tag_template'));
     // Form Elements - Add Unit by Search
     $oSearchFormElements = new AmazonAutoLinks_Form_Search('aal_add_search_unit');
     call_user_func_array(array($this, "addSettingSections"), $oSearchFormElements->getSections());
     call_user_func_array(array($this, "addSettingFields"), $oSearchFormElements->getFields('search'));
     call_user_func_array(array($this, "addSettingFields"), $oSearchFormElements->getFields('search_second', 'search2_'));
     call_user_func_array(array($this, "addSettingFields"), $oSearchFormElements->getFields('search_advanced', 'search2_'));
     call_user_func_array(array($this, "addSettingFields"), $oSearchFormElements->getFields('search_auto_insert', 'search2_'));
     call_user_func_array(array($this, "addSettingFields"), $oSearchFormElements->getFields('search_template', 'search2_'));
     call_user_func_array(array($this, "addSettingFields"), $oSearchFormElements->getFields('search_item_lookup', 'search3_'));
     call_user_func_array(array($this, "addSettingFields"), $oSearchFormElements->getFields('search_item_lookup_advanced', 'search3_'));
     call_user_func_array(array($this, "addSettingFields"), $oSearchFormElements->getFields('search_auto_insert2', 'search3_'));
     call_user_func_array(array($this, "addSettingFields"), $oSearchFormElements->getFields('search_template2', 'search3_'));
     call_user_func_array(array($this, "addSettingFields"), $oSearchFormElements->getFields('similarity_lookup', 'search4_'));
     call_user_func_array(array($this, "addSettingFields"), $oSearchFormElements->getFields('similarity_lookup_advanced', 'search4_'));
     call_user_func_array(array($this, "addSettingFields"), $oSearchFormElements->getFields('search_auto_insert3', 'search4_'));
     call_user_func_array(array($this, "addSettingFields"), $oSearchFormElements->getFields('search_template3', 'search4_'));
     // Form elements - Add / Edit Auto Insert
     $oAutoInsertFormElements = new AmazonAutoLinks_Form_AutoInsert('aal_define_auto_insert');
     call_user_func_array(array($this, "addSettingSections"), $oAutoInsertFormElements->getSections());
     call_user_func_array(array($this, "addSettingFields"), $oAutoInsertFormElements->getFields('autoinsert_status'));
     call_user_func_array(array($this, "addSettingFields"), $oAutoInsertFormElements->getFields('autoinsert_area'));
     call_user_func_array(array($this, "addSettingFields"), $oAutoInsertFormElements->getFields('autoinsert_static_insertion'));
     call_user_func_array(array($this, "addSettingFields"), $oAutoInsertFormElements->getFields('autoinsert_enable'));
     call_user_func_array(array($this, "addSettingFields"), $oAutoInsertFormElements->getFields('autoinsert_disable'));
     // Form elements - Settings
     $oSettingsFormElements = new AmazonAutoLinks_Form_Settings('aal_settings');
     call_user_func_array(array($this, "addSettingSections"), $oSettingsFormElements->getSections());
     call_user_func_array(array($this, "addSettingFields"), $oSettingsFormElements->getFields());
 }