APF_Demo_BuiltinFieldTypes_File_Upload::__construct PHP Method

__construct() public method

Sets up a form section.
public __construct ( $oFactory )
    public function __construct($oFactory)
    {
        // Section
        $oFactory->addSettingSections($this->sPageSlug, array('section_id' => $this->sSectionID, 'tab_slug' => $this->sTabSlug, 'title' => __('File Uploads', 'admin-page-framework-loader'), 'tip' => __('The <code>file</code> field type lets your users uploade and submit their files.', 'admin-page-framework-loader'), 'description' => __('These are upload fields. Check the <code>$_FILES</code> variable in the validation callback method that indicates the temporary location of the uploaded files.', 'admin-page-framework-loader')));
        // Fields
        $oFactory->addSettingFields($this->sSectionID, array('field_id' => 'file_single', 'title' => __('File', 'admin-page-framework-loader'), 'type' => 'file', 'label' => __('Select the file', 'admin-page-framework-loader') . ": ", 'description' => array("<pre class='field-argument-example'>" . $oFactory->oWPRMParser->getSyntaxHighlightedPHPCode(<<<EOD
array(
    'type'  => 'file',
    'label' => 'Select the file',
)
EOD
) . "</pre>")), array('field_id' => 'file_multiple', 'title' => __('Multiple', 'admin-page-framework-loader'), 'type' => 'file', 'label' => __('First', 'admin-page-framework-loader'), 'delimiter' => '<br />', array('label' => __('Second', 'admin-page-framework-loader')), array('label' => __('Third', 'admin-page-framework-loader')), 'description' => array("<pre class='field-argument-example'>" . $oFactory->oWPRMParser->getSyntaxHighlightedPHPCode(<<<EOD
array(
    'type'                  => 'file',
    'label'                 => __( 'First', 'admin-page-framework-loader' ),
    'delimiter'             => '<br />',
    array(
        'label' => __( 'Second', 'admin-page-framework-loader' ),
    ),
    array(
        'label' => __( 'Third', 'admin-page-framework-loader' ),
    ),
)
EOD
) . "</pre>")), array('field_id' => 'file_repeatable', 'title' => __('Repeatable', 'admin-page-framework-loader'), 'type' => 'file', 'repeatable' => true, 'description' => array("<pre class='field-argument-example'>" . $oFactory->oWPRMParser->getSyntaxHighlightedPHPCode(<<<EOD
array(
    'type'                  => 'file',
    'repeatable'            => true,
)
EOD
) . "</pre>")));
        add_filter('validation_' . $oFactory->oProp->sClassName . '_' . $this->sSectionID, array($this, 'validateSectionForm'), 10, 4);
    }
APF_Demo_BuiltinFieldTypes_File_Upload