?> <p> <strong><?php echo $lang['modules']['message']; ?> </strong> </p> <?php run_hook('admin_modules_before'); ?> <div class="smallmenu"> <span class="smallmenu_button"> <a href="?action=module_addtosite" style="background: url('data/image/add_small.png') no-repeat;"><?php echo $lang['modules_manage']['add']; ?> </a> </span> </div> <?php foreach ($module_list as $module) { //Load module admin pages. if (file_exists('data/modules/' . $module . '/' . $module . '.admin.php')) { require_once 'data/modules/' . $module . '/' . $module . '.admin.php'; } //Only show the button if there are admincenter pages for the module, and if the modules is compatible. if (module_is_compatible($module) && function_exists($module . '_pages_admin')) { $module_info = call_user_func($module . '_info'); showmenudiv($module_info['name'], $module_info['intro'], 'data/modules/' . $module . '/' . $module_info['icon'], '?module=' . $module); } } unset($module);
if (!defined('CURRENT_PAGE_SEONAME')) { header('Location: ' . HOME_PAGE, true, 302); exit; } //If a module has been specified... if (defined('CURRENT_MODULE_DIR')) { //Check if the module exists. if (file_exists('data/modules/' . CURRENT_MODULE_DIR)) { //And check if we also specified a module page (if not, fail). if (!defined('CURRENT_MODULE_PAGE')) { header('HTTP/1.0 404 Not Found'); if (!defined('CURRENT_NOTFOUND')) { define('CURRENT_NOTFOUND', true); } } elseif (defined('CURRENT_MODULE_PAGE')) { if (!function_exists(CURRENT_MODULE_DIR . '_page_site_' . CURRENT_MODULE_PAGE) || !module_is_included_in_page(CURRENT_MODULE_DIR, CURRENT_PAGE_SEONAME) || !module_is_compatible(CURRENT_MODULE_DIR)) { header('HTTP/1.0 404 Not Found'); if (!defined('CURRENT_NOTFOUND')) { define('CURRENT_NOTFOUND', true); } } } } else { header('HTTP/1.0 404 Not Found'); if (!defined('CURRENT_NOTFOUND')) { define('CURRENT_NOTFOUND', true); } } } //If a page has been requested that does not exist, return 404 header. if (defined('CURRENT_PAGE_SEONAME') && !defined('CURRENT_PAGE_FILENAME')) {
/** * Defines area in which modules can be inserted through the administration center. For use in themes. * * @since 4.7 * @package site * @param string $place Name of the area. For example "footer", or "header". */ function theme_area($place) { //Include info of theme (to see which modules we should include etc), but only if file exists. if (file_exists('data/settings/themes/' . THEME . '/moduleconf.php')) { include 'data/settings/themes/' . THEME . '/moduleconf.php'; //Get the array and sort it. foreach ($space as $area => $number) { //Sort the array, so that the modules will be displayed in correct order. natcasesort($number); foreach ($number as $module => $order) { //If the area where the module should be displayed is the same as the area we're currently... //...processing: include the module. if ($area == $place) { //Check if module is compatible, and the function exists. if (module_is_compatible($module) && function_exists($module . '_theme_main')) { call_user_func_array($module . '_theme_main', array($place, null)); } } } } unset($area); } }
*/ //Make sure the file isn't accessed directly. defined('IN_PLUCK') or exit('Access denied!'); //----------------- //Lets start including the pages of the modules. //----------------- //Load module admin pages. if (file_exists('data/modules/' . $_GET['module'] . '/' . $_GET['module'] . '.admin.php')) { require_once 'data/modules/' . $_GET['module'] . '/' . $_GET['module'] . '.admin.php'; //Make sure the settings folder for the module is there. if (!is_dir('data/settings/modules/' . $_GET['module'])) { mkdir('data/settings/modules/' . $_GET['module']); chmod('data/settings/modules/' . $_GET['module'], 0777); } //Check if module is compatible, otherwise don't include pages. if (module_is_compatible($_GET['module']) && function_exists($_GET['module'] . '_pages_admin')) { $module_info = call_user_func($_GET['module'] . '_info'); $module_pages = call_user_func($_GET['module'] . '_pages_admin'); //Include startpage of module. if (!isset($_GET['page']) && isset($module_pages[0])) { $titelkop = $module_pages[0]['title']; include_once 'data/inc/header.php'; call_user_func($_GET['module'] . '_page_admin_' . $module_pages[0]['func']); } elseif (isset($module_pages) && isset($_GET['page'])) { foreach ($module_pages as $module_page) { if ($_GET['page'] == $module_page['func'] && function_exists($_GET['module'] . '_page_admin_' . $module_page['func'])) { $titelkop = $module_page['title']; include_once 'data/inc/header.php'; call_user_func($_GET['module'] . '_page_admin_' . $module_page['func']); $module_page_found = true; }
/** * Shows a menu for inserting module inclusion code in TinyMCE. * * @since 4.7 * @package admin */ function show_module_insert_box() { global $lang, $module_list; //Load module info and site-functions. foreach ($module_list as $module) { if (file_exists('data/modules/' . $module . '/' . $module . '.site.php')) { require_once 'data/modules/' . $module . '/' . $module . '.site.php'; } } unset($module); $module_data = null; foreach ($module_list as $module) { if (module_is_compatible($module) && function_exists($module . '_theme_main')) { $module_data .= '<option value="' . $module . '">' . $module . '</option>'; //Check if we need to display categories for the module $module_info = call_user_func($module . '_info'); if (isset($module_info['categories']) && is_array($module_info['categories'])) { foreach ($module_info['categories'] as $category) { $module_data .= '<option value="' . $module . ',' . $category . '"> ' . $category . '</option>'; } } } } if (isset($module_data)) { ?> <div class="menudiv"> <span> <img src="data/image/modules.png" alt="" /> </span> <span> <select id="insert_modules"> <?php echo $module_data; ?> </select> <br /> <a href="#" onclick="insert_module();return false;"><?php echo $lang['general']['insert_module']; ?> </a> </span> </div> <?php } }
echo $module; ?> /<?php echo $module_info['icon']; ?> " alt="" /> </span> <span> <span class="title-module"><?php echo $module_info['name']; ?> </span> <br /> <?php //If module has been disabled, show warning if (!module_is_compatible($module)) { ?> <span style="color: red;"><?php echo $lang['modules_manage']['not_compatible']; ?> </span> <?php } ?> </span> <span> <a href="#" onclick="return kadabra('<?php echo $module; ?> ');"> <img src="data/image/credits.png" alt="<?php
/** * Returns the current value of a module setting. If no setting has been saved, the default value will be returned. * * @since 4.7 * @package all * @param string $module The module. * @param string $setting The setting from which to obtain the value. */ function module_get_setting($module, $setting) { if (module_is_compatible($module)) { //First retrieve default module settings. $default_settings = call_user_func($module . '_settings_default'); if (isset($default_settings[$setting])) { //Load default setting ${$setting} = $default_settings[$setting]; //Check if a saved setting is available if (file_exists('data/settings/' . $module . '.settings.php')) { include 'data/settings/' . $module . '.settings.php'; } return ${$setting}; } else { trigger_error('Module setting ' . $setting . ' does not exist in module ' . $module . '.', E_USER_WARNING); } } }
?> </strong> <table> <?php //First count how many modules we have, and exclude disabled modules. $number_modules = count($module_list); foreach ($module_list as $module) { if (!module_is_compatible($module) || !function_exists($module . '_theme_main')) { $number_modules--; } } unset($module); //Loop through dirs, and display the modules. foreach ($module_list as $module) { //Only show if module is compatible. if (module_is_compatible($module) && function_exists($module . '_theme_main')) { $module_info = call_user_func($module . '_info'); ?> <tr> <td><?php echo $module_info['name']; ?> </td> <td> <select name="<?php echo $position . '|' . $module; ?> "> <option value="0"><?php echo $lang['general']['dont_display']; ?>