public function can_add_section_heading($pagenumber) {
        // There is a default section heading on this page,
        // do not show adding new section heading in the Add menu.
        if ($pagenumber == 1) {
            return false;
        }
        // Get an array of firstslots.
        $firstslots = array();
        foreach ($this->sections as $section) {
            $firstslots[] = $section->firstslot;
        }
        foreach ($this->slotsinorder as $slot) {
            if ($slot->page == $pagenumber) {
                if (in_array($slot->slot, $firstslots)) {
                    return false;
                }
            }
        }
        // Do not show the adding section heading on the last add menu.
        if ($pagenumber == 0) {
            return false;
        }
        return true;
    }
public function can_add_section_heading($pagenumber) {
        // There is a default section heading on this page,
        // do not show adding new section heading in the Add menu.
        if ($pagenumber == 1) {
            return false;
        }
        // Get an array of firstslots.
        $firstslots = array();
        foreach ($this->sections as $section) {
            $firstslots[] = $section->firstslot;
        }
        foreach ($this->slotsinorder as $slot) {
            if ($slot->page == $pagenumber) {
                if (in_array($slot->slot, $firstslots)) {
                    return false;
                }
            }
        }
        // Do not show the adding section heading on the last add menu.
        if ($pagenumber == 0) {
            return false;
        }
        return true;
    }
public function can_add_section_heading ( $ pagenumber ) { // There is a default section heading on this page, // do not show adding new section heading in the Add menu. if ( $ pagenumber == 1 ) { return false ; } // Get an array of firstslots. $ firstslots = array ( ) ; foreach ( $ this -> sections as $ section ) { $ firstslots [ ] = $ section -> firstslot ; } foreach ( $ this -> slotsinorder as $ slot ) { if ( $ slot -> page == $ pagenumber ) { if ( in_array ( $ slot -> slot , $ firstslots ) ) { return false ; } } } // Do not show the adding section heading on the last add menu. if ( $ pagenumber == 0 ) { return false ; } return true ; }
Check whether adding a section heading is possible
@param int $pagenumber the number of the page.
@return boolean
Check whether adding a section heading is possible