AdminPageFramework_Form_View___Script_SortableSection::getEnabler PHP Method

getEnabler() public static method

public static getEnabler ( $sContainerTagID, $aSettings, $oMsg )
    public static function getEnabler($sContainerTagID, $aSettings, $oMsg)
    {
        if (empty($aSettings)) {
            return '';
        }
        if (in_array($sContainerTagID, self::$_aSetContainerIDsForSortableSections)) {
            return '';
        }
        self::$_aSetContainerIDsForSortableSections[$sContainerTagID] = $sContainerTagID;
        new self($oMsg);
        $_sScript = <<<JAVASCRIPTS
jQuery( document ).ready( function() {    
    jQuery( '#{$sContainerTagID}' ).enableAdminPageFrameworkSortableSections( '{$sContainerTagID}' ); 
});            
JAVASCRIPTS;
        return "<script type='text/javascript' class='admin-page-framework-section-sortable-script'>" . '/* <![CDATA[ */' . $_sScript . '/* ]]> */' . "</script>";
    }

Usage Example

 private function _getSubSections($_aOutputs, $_sSectionsID, $_aSection, $_aSubSections)
 {
     if (!empty($_aSection['repeatable'])) {
         $_aOutputs['section_contents'][] = AdminPageFramework_Form_View___Script_RepeatableSection::getEnabler($_sSectionsID, $_aOutputs['count_subsections'], $_aSection['repeatable'], $this->oMsg);
         $_aOutputs['section_contents'][] = $this->_getRepeatableSectionFlagTag($_aSection);
     }
     if (!empty($_aSection['sortable'])) {
         $_aOutputs['section_contents'][] = AdminPageFramework_Form_View___Script_SortableSection::getEnabler($_sSectionsID, $_aSection['sortable'], $this->oMsg);
         $_aOutputs['section_contents'][] = $this->_getSortableSectionFlagTag($_aSection);
     }
     $_aSubSections = $this->numerizeElements($_aSubSections);
     foreach ($_aSubSections as $_iIndex => $_aFields) {
         $_oEachSectionArguments = new AdminPageFramework_Form_Model___Format_EachSection($_aSection, $_iIndex, $_aSubSections, $_sSectionsID);
         $_aOutputs = $this->_getSectionTableWithTabList($_aOutputs, $_oEachSectionArguments->get(), $_aFields);
     }
     return $_aOutputs;
 }
AdminPageFramework_Form_View___Script_SortableSection