* Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ // Load Dolibarr environment require '../../../../main.inc.php'; /** * @var DoliDB $db * @var HookManager $hookmanager * @var Translate $langs * @var User $user */ // Protection if external user if ($user->socid > 0) { accessforbidden(); } // Includes require_once DOL_DOCUMENT_ROOT . '/admin/tools/ui/class/documentation.class.php'; // Load documentation translations $langs->load('uxdocumentation'); // $documentation = new Documentation($db); $morejs = [ '/includes/ace/src/ace.js', '/includes/ace/src/ext-statusbar.js', '/includes/ace/src/ext-language_tools.js', ]; // Output html head + body - Param is Title $documentation->docHeader('Contributing', $morejs); // Set view for menu and breadcrumb // Menu must be set in constructor of documentation class $documentation->view = array('Resources', 'Contributing'); // Output sidebar $documentation->showSidebar(); ?>
showBreadCrumb(); ?>

trans('DocHowContribute'); ?>

trans('DocHowContributeDescription'); ?>

showSummary(); ?>

trans('DocContributeStep1'); ?>

trans('DocContributeStep1Description'); ?>

', ' * Copyright (C) 2024 Frédéric France ', ' *', ' * This program is free software; you can redistribute it and/or modify', ' * it under the terms of the GNU General Public License as published by', ' * the Free Software Foundation; either version 3 of the License, or', ' * (at your option) any later version.', ' *', ' * This program is distributed in the hope that it will be useful,', ' * but WITHOUT ANY WARRANTY; without even the implied warranty of', ' * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the', ' * GNU General Public License for more details.', ' *', ' * You should have received a copy of the GNU General Public License', ' * along with this program. If not, see .', ' */', '', '// Load Dolibarr environment', 'require \'../../../../main.inc.php\';', '', '/**', ' * @var DoliDB $db', ' * @var HookManager $hookmanager', ' * @var Translate $langs', ' * @var User $user', ' */', '', '// Protection if external user', 'if ($user->socid > 0) {', ' accessforbidden();', '}', '', '// Includes', 'require_once DOL_DOCUMENT_ROOT . \'/admin/tools/ui/class/documentation.class.php\';', '', '// Load documentation translations', '$langs->load(\'uxdocumentation\');', '', '// Hooks', '$hookmanager->initHooks(array(\'uidocumentation\'));', '', '//', '$documentation = new Documentation($db);', '', '// Add more js', '$morejs = [', ' \'/includes/ace/src/ace.js\',', ' \'/includes/ace/src/ext-statusbar.js\',', ' \'/includes/ace/src/ext-language_tools.js\',', '];', '// Output html head + body - First param is title', '$documentation->docHeader(\'DocMyPageTitle\', $morejs);', '', '// Set view for menu and breadcrumb', '// Menu must be set in constructor of documentation class', '$documentation->view = array(\'MyPageKey1\', \'MyPageKey2\');', '', '// Output sidebar', '$documentation->showSidebar(); ?>', '', '
', '', ' showBreadCrumb(); ?>', '
', ' ', '

trans(\'DocMyPageTitle\'); ?>

', '

trans(\'DocMyPageDescription\'); ?>

', ' ', ' ', ' showSummary(); ?>', ' ', ' ', '
', ' ', '

trans(\'DocMySectionTitle\'); ?>

', '

trans(\'DocMySectionText\'); ?>

', ' ', '
', '
', '

trans(\'DocMySectionExample\'); ?>

', '
', '
', ' \',', ' \'

Here you can put an example of your component

\',', ' \'
\',', ' );', ' print $documentation->showCode($lines, \'html\'); ?>', ' ', '

trans(\'DocMySectionText2\'); ?>

', '
', ' ', ' ', '
', ' ', '

trans(\'DocMySectionTitle\'); ?>

', '

trans(\'DocMySectionText\'); ?>

', ' ', ' ', '
trans(\'DocExampleWarning\'); ?>
', '
trans(\'DocExampleInfo\'); ?>
', '
trans(\'DocExampleError\'); ?>
', '
trans(\'DocExampleGreen\'); ?>
', '
', ' ', '
', '
', '', 'docFooter();', '?>', ); echo $documentation->showCode($lines, 'php'); ?>

trans('DocContributeStep2'); ?>

trans('DocContributeStep2Description'); ?>

trans('DocContributeAddMenuEntry'); ?>

menu[\'Components\'] = array(', ' // url,', ' // icon,', ' \'submenu\' => array(', ' ', ' // Others menu entries ...', ' ', ' // My new menu entry', ' \'MyComponent\' => array(', ' // Url to my documentation page', ' \'url\' => dol_buildpath($this->baseUrl.\'/components/mycomponenturl.php\', 1),', ' // My component icon, use fontawesome class', ' \'icon\' => \'fas fa-mouse\', // use fontawesome class here', ' // You can add another submenu into this array', ' \'submenu\' => array(),', ' // Here is for build summary (LangKeySection => nameOfYourDiv)', ' \'summary\' => array(', ' \'MyLangKey1\' => \'#my-component-section1-div\',', ' \'MyLangKey2\' => \'#my-component-section2-div\',', ' ),', ' ),', ' )', ');', ); echo $documentation->showCode($lines, 'php'); ?>

trans('DocContributeStep3'); ?>

trans('DocContributeStep3Description'); ?>

view = array(\'Components\', \'MyComponent\');', ); echo $documentation->showCode($lines, 'php'); ?>
docFooter(); ?>