| 1813 | | if ( isset($_wp_contextual_help[$screen->id]) ) { |
| 1814 | | $contextual_help .= '<div class="metabox-prefs">' . $_wp_contextual_help[$screen->id] . "</div>\n"; |
| | 1813 | if ( isset($_wp_contextual_help[$screen->id]) && is_array($_wp_contextual_help[$screen->id]) ) { |
| | 1814 | $contextual_help .= '<div class="metabox-prefs">'; |
| | 1815 | |
| | 1816 | /* |
| | 1817 | * Loop through ['contextual-help-tabs'] |
| | 1818 | * - It's a nested array where $key=>$value >> $title=>$content |
| | 1819 | * Has no output so can only loop the array once |
| | 1820 | */ |
| | 1821 | $contextual_help_tabs = ''; // store looped content for later |
| | 1822 | $contextual_help_panels = ''; // store looped content for later |
| | 1823 | foreach( $_wp_contextual_help[$screen->id]['contextual-help-tabs'] as $tab_title => $tab_content ) { |
| | 1824 | // Make sure title isn't blank, then generate title/content as pair |
| | 1825 | if ( isset($tab_title) ) { |
| | 1826 | // We use slug as the linkname, but don't check uniqueness |
| | 1827 | $tabname_slug = sanitize_title($tab_title, '', 'save'); |
| | 1828 | |
| | 1829 | $contextual_help_tabs .= '<li class="' . $tabname_slug . '">'; |
| | 1830 | $contextual_help_tabs .= '<a href="#' . $tabname_slug . '">'; |
| | 1831 | $contextual_help_tabs .= $tab_title; |
| | 1832 | $contextual_help_tabs .= '</a>'; |
| | 1833 | $contextual_help_tabs .= '</li>'; |
| | 1834 | |
| | 1835 | $contextual_help_panels .= '<div id="' . $tabname_slug . '">'; |
| | 1836 | // Prevent |
| | 1837 | if ( isset($tab_content) ) { |
| | 1838 | $contextual_help_panels .= $tab_content; |
| | 1839 | } |
| | 1840 | $contextual_help_panels .= '</div>'; |
| | 1841 | } |
| | 1842 | } |
| | 1843 | |
| | 1844 | // Start output from loop: Tabbed help content |
| | 1845 | $contextual_help .= '<div class="contextual-help-tabs-wrap">'; |
| | 1846 | $contextual_help .= '<ul class="contextual-help-tabs">'; |
| | 1847 | $contextual_help .= $contextual_help_tabs; |
| | 1848 | $contextual_help .= '</ul>'; |
| | 1849 | $contextual_help .= $contextual_help_panels; |
| | 1850 | $contextual_help .= '</div>'; |
| | 1851 | // End: Tabbed help content |
| | 1852 | |
| | 1853 | // Links to right of tabs |
| | 1854 | $contextual_help .= '<div class="contextual-help-links">'; |
| | 1855 | if ( isset($_wp_contextual_help[$screen->id]['contextual-help-links']) ) { |
| | 1856 | $contextual_help .= $_wp_contextual_help[$screen->id]['contextual-help-links']; |
| | 1857 | } |
| | 1858 | $contextual_help .= '</div>'; // end links |
| | 1859 | |
| | 1860 | $contextual_help .= '</div>'; // end metabox |
| | 1861 | |
| | 1862 | } elseif ( isset($_wp_contextual_help[$screen->id]) ) { |
| | 1863 | $contextual_help .= '<div class="metabox-prefs">Screen: ' . $screen->id . '.' . $_wp_contextual_help[$screen->id] . '</div>\n'; |
| | 1898 | // DEBUGGING |
| | 1899 | // !!! MUST REMOVE !!! |
| | 1900 | $tabbed = array('Dashboard tab' => '<p>Ma quande lingues coalesce, li grammatica del resultant lingue es plu simplic e regulari quam ti del coalescent lingues. Li nov lingua franca va esser plu simplic e regulari quam li existent Europan lingues. It va esser tam simplic quam Occidental: in fact, it va esser Occidental. A un Angleso it va semblar un simplificat Angles, quam un skeptic Cambridge amico dit me que Occidental es.</p>', |
| | 1901 | 'Tab 2' => '<p>Li Europan lingues es membres del sam familie. Lor separat existentie es un myth. Por scientie, musica, sport etc, li tot Europa usa li sam vocabularium. Li lingues differe solmen in li grammatica, li pronunciation e li plu commun vocabules. Omnicos directe al desirabilita; de un nov lingua franca: on refusa continuar payar custosi traductores. It solmen va esser necessi far uniform grammatica, pronunciation e plu sommun paroles.</p>'); |
| | 1902 | $help = array('contextual-help-tabs' => $tabbed); |
| | 1903 | $help['contextual-help-links'] = '<a href="http://codex.wordpress.org/" target="_blank">Documentation</a><br /><br /><a href="http://wordpress.org/support/" target="_blank">Support Forums</a>'; |
| | 1904 | // !!! /End REMOVE |