tra('Page Tabs'), 'documentation' => tra('PluginPageTabs'), 'description' => tra('Display the content of a wiki page in a set of tabs.'), 'prefs' => [ 'wikiplugin_pagetabs' ], 'iconname' => 'copy', 'introduced' => 9, 'body' => null, 'params' => [ 'pages' => [ 'required' => false, 'name' => tra('Wiki page names'), 'description' => tr('The wiki pages you would like to use in this plugin, optional, separate with pipe %0|%1. Or a table with the class of "pagetabs" on the main page. On child pages use as a way to redirect to the parent.', '', ''), 'since' => '9.0', 'default' => '', 'separator' => '|', 'filter' => 'pagename', 'profile_reference' => 'wiki_page', ], ], ]; } function wikiplugin_pagetabs($data, $params) { global $user; $headerlib = TikiLib::lib('header'); $tikilib = TikiLib::lib('tiki'); $smarty = TikiLib::lib('smarty'); static $pagetabsindex = 0; ++$pagetabsindex; extract($params, EXTR_SKIP); $pages = json_encode($pages); $pageTabs = true; foreach ($tikilib->get_user_groups($user) as $group) { if ($group == "NoPageTabs") { $pageTabs = false; } } if ($pageTabs == true) { $headerlib ->add_jq_onready( ' var tabPages = ' . $pages . '; var tabsTable = $("table.pagetabs") .hide(); var tabParent = $("
") .insertAfter("#pagetabs' . $pagetabsindex . '"); var tabMenu = $("