APF_Demo_BuiltinFieldTypes_File_Media::__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' => __('Media Uploader', 'admin-page-framework-loader'), 'tip' => __('If <code>repeatable</code> is set to <code>true</code>, you can select multiple items in the pop up media uploader.', 'admin-page-framework-loader'), 'description' => __('Upload binary files in addition to images.', 'admin-page-framework-loader')));
        // Fields
        $oFactory->addSettingFields($this->sSectionID, array('field_id' => 'media_field', 'title' => __('Media File', 'admin-page-framework-loader'), 'type' => 'media', 'allow_external_source' => false, 'description' => array("<pre class='field-argument-example'>" . $oFactory->oWPRMParser->getSyntaxHighlightedPHPCode(<<<EOD
array(
    'type'                  => 'media',
    'allow_external_source' => false,
)
EOD
) . "</pre>")), array('field_id' => 'media_with_attributes', 'title' => __('Media File with Attributes', 'admin-page-framework-loader'), 'type' => 'media', 'attributes_to_store' => array('id', 'caption', 'description'), 'attributes' => array('button' => array('data-label' => __('Select File', 'admin-page-framework-loader')), 'remove_button' => array('data-label' => __('Remove', 'admin-page-framework-loader'))), 'description' => array("<pre class='field-argument-example'>" . $oFactory->oWPRMParser->getSyntaxHighlightedPHPCode(<<<EOD
array(
    'type'                  => 'media',
    'attributes_to_store'   => array( 'id', 'caption', 'description' ),
    'attributes'            => array(
        'button'        => array(
            'data-label' => 'Select File', 'admin-page-framework-loader',
        ),
        'remove_button' => array(
            'data-label' => 'Remove',
        ),
    ),
)
EOD
) . "</pre>")), array('field_id' => 'media_repeatable_fields', 'title' => __('Repeatable', 'admin-page-framework-loader'), 'type' => 'media', 'repeatable' => true, 'description' => array("<pre class='field-argument-example'>" . $oFactory->oWPRMParser->getSyntaxHighlightedPHPCode(<<<EOD
array(
    'type'                  => 'media',
    'repeatable'            => true,
)
EOD
) . "</pre>")), array('field_id' => 'media_sortable_fields', 'title' => __('Sortable', 'admin-page-framework-loader'), 'type' => 'media', 'sortable' => true, array(), array(), 'description' => array("<pre class='field-argument-example'>" . $oFactory->oWPRMParser->getSyntaxHighlightedPHPCode(<<<EOD
array(
    'type'                  => 'media',
    'sortable'              => true,
)
EOD
) . "</pre>")));
    }
APF_Demo_BuiltinFieldTypes_File_Media