see http://phpdocu.sourceforge.net/ // +----------------------------------------------------------------------+ // | Author: StarRider // +----------------------------------------------------------------------+ // $Id$ /** * definitions */ define( 'PLUGIN_GUID_DATAADDTABS', 'dataaddtabs' ); global $gLibertySystem; global $gContent; $pluginParams = [ 'tag' => 'ADDTABS', 'auto_activate' => false, 'requires_pair' => false, 'load_function' => '\data_addtabs', 'title' => 'AddTabs', 'help_page' => 'DataPluginAddTabs', 'description' => KernelTools::tra("Will join the contents from several sources in a Tabbed Interface."), 'help_function' => '\data_addtabs_help', 'syntax' => "{ADDTABS tab1= tab2= tab3= . . . tab99= }", 'plugin_type' => DATA_PLUGIN, ]; $gLibertySystem->registerPlugin( PLUGIN_GUID_DATAADDTABS, $pluginParams ); $gLibertySystem->registerDataTag( $pluginParams['tag'], PLUGIN_GUID_DATAADDTABS ); /** * Help Function */ function data_addtabs_help() { $help = '' .'' .'' .'' .'' .'' .'' .'' .'' .'") .'' .'
' . KernelTools::tra( "Key" ) . '' . KernelTools::tra( "Type" ) . '' . KernelTools::tra( "Comments" ) . '
tab1 - tab99' . KernelTools::tra( "numeric") . '
' . KernelTools::tra("(optional)") . '
' . KernelTools::tra( "Will create a Tab interface on a page. The name on each tab is the name given to the imported page.The value sent with the TabX parameter is a Numeric Content Id. This allows blog posts, images, wiki pages . . . (and more) to be added.") . KernelTools::tra("
Note 1: A listing of Content Id's can be found ") . '' . KernelTools::tra( "Here" ) . '' . KernelTools::tra("
Note 2: The order used when the tabs are specified does not matter. The Tabname does - Tab1 is always first and Tab99 will always be last.
' . KernelTools::tra("Example: ") . '{ADDTABS tab1=15 tab2=12 tab3=11}'; return $help; } function data_addtabs($data, $params) { extract ($params, EXTR_SKIP); $id = 1000000 * microtime(); $ret = '
'; $good = false; for ($i = 1; $i <= 99; $i++) { if( isset( ${'tab'.$i} ) ) { if (is_numeric( ${'tab'.$i} ) ) { if( $obj = LibertyBase::getLibertyObject( ${'tab'.$i} ) ) { $ret .= '

'.$obj->getTitle().'

'.$obj->mInfo['parsed_data'].'
'; $good=True; } } else { $good=false; } } } $ret .= "
"; if( !$good ) { $ret = KernelTools::tra("The plugin AddTabs requires valid parameters. Numeric content id numbers can use the parameter names 'tab1' thru 'tab99'"); } return $ret; }