APF_Demo_CustomFieldType_Path::replyToLoadTab PHP Метод

replyToLoadTab() публичный Метод

Triggered when the tab starts loading.
public replyToLoadTab ( $oAdminPage )
    public function replyToLoadTab($oAdminPage)
    {
        // $this->registerFieldTypes( $this->sClassName );
        add_action('do_' . $this->sPageSlug . '_' . $this->sTabSlug, array($this, 'replyToDoTab'));
        // Section
        $oAdminPage->addSettingSections($this->sPageSlug, array('section_id' => $this->sSectionID, 'tab_slug' => $this->sTabSlug, 'title' => __('File Path Selector', 'admin-page-framework-loader'), 'description' => array(__('This field type lets the user select a file path.', 'admin-page-framework-loader') . ' ' . __('The relative path to the value of <code>$_SERVER[ "DOCUMENT_ROOT" ]</code> (the document root set by the web server) will be set.', 'admin-page-framework-loader'))));
        // Fields
        $oAdminPage->addSettingFields($this->sSectionID, array('field_id' => 'path_field', 'type' => 'path', 'title' => __('Path', 'admin-page-framework-loader'), 'options' => array('root' => ABSPATH, 'fileExtensions' => 'php,txt'), 'description' => array(__('With the <code>fileExtensions</code> option, listed file types can be specified.', 'admin-page-framework-loader'), "<pre>" . $oAdminPage->oWPRMParser->getSyntaxHighlightedPHPCode(<<<EOD
array(
    'type'          => 'path',
    'options'       => array(
        'root'              => ABSPATH,
        'fileExtensions'    => 'php,txt',
    ),     
)
EOD
) . "</pre>")), array('field_id' => 'path_field_repeatable_sortable', 'type' => 'path', 'title' => __('Repeatable & Sortable', 'admin-page-framework-loader'), 'repeatable' => true, 'sortable' => true, 'description' => array("<pre>" . $oAdminPage->oWPRMParser->getSyntaxHighlightedPHPCode(<<<EOD
array(
    'type'          => 'path',
    'repeatable'    => true,
    'sortable'      => true,
)
EOD
) . "</pre>")));
    }