Added a check to all plugins to see if they support the DBMS the site is running on
3 /* Reminder: always indent with 4 spaces (no tabs). */
4 // +---------------------------------------------------------------------------+
5 // | Static Pages Plugin 1.6 |
6 // +---------------------------------------------------------------------------+
9 // | This file provides helper functions for the automatic plugin install. |
10 // +---------------------------------------------------------------------------+
11 // | Copyright (C) 2008-2009 by the following authors: |
13 // | Authors: Dirk Haun - dirk AT haun-online DOT de |
14 // +---------------------------------------------------------------------------+
16 // | This program is free software; you can redistribute it and/or |
17 // | modify it under the terms of the GNU General Public License |
18 // | as published by the Free Software Foundation; either version 2 |
19 // | of the License, or (at your option) any later version. |
21 // | This program is distributed in the hope that it will be useful, |
22 // | but WITHOUT ANY WARRANTY; without even the implied warranty of |
23 // | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
24 // | GNU General Public License for more details. |
26 // | You should have received a copy of the GNU General Public License |
27 // | along with this program; if not, write to the Free Software Foundation, |
28 // | Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
30 // +---------------------------------------------------------------------------+
33 * Autoinstall API functions for the Static Pages plugin
35 * @package StaticPages
39 * Plugin autoinstall function
41 * @param string $pi_name Plugin name
42 * @return array Plugin information
45 function plugin_autoinstall_staticpages($pi_name)
47 $pi_name = 'staticpages';
48 $pi_display_name = 'Static Pages';
49 $pi_admin = $pi_display_name . ' Admin';
52 'pi_name' => $pi_name,
53 'pi_display_name' => $pi_display_name,
54 'pi_version' => '1.6.0',
55 'pi_gl_version' => '1.6.0',
56 'pi_homepage' => 'http://www.geeklog.net/'
60 $pi_admin => 'Users in this group can administer the '
61 . $pi_display_name . ' plugin'
65 $pi_name . '.edit' => 'Access to ' . $pi_display_name . ' editor',
66 $pi_name . '.delete' => 'Ability to delete static pages',
67 $pi_name . '.PHP' => 'Ability to use PHP in static pages'
71 $pi_name . '.edit' => array($pi_admin),
72 $pi_name . '.delete' => array($pi_admin)
73 // Note: 'staticpages.PHP' is not assigned to any group by default
83 'features' => $features,
84 'mappings' => $mappings,
92 * Load plugin configuration from database
94 * @param string $pi_name Plugin name
95 * @return boolean true on success, otherwise false
96 * @see plugin_initconfig_staticpages
99 function plugin_load_configuration_staticpages($pi_name)
103 $base_path = $_CONF['path'] . 'plugins/' . $pi_name . '/';
105 require_once $_CONF['path_system'] . 'classes/config.class.php';
106 require_once $base_path . 'install_defaults.php';
108 return plugin_initconfig_staticpages();
112 * Check if the plugin is compatible with this Geeklog version
114 * @param string $pi_name Plugin name
115 * @return boolean true: plugin compatible; false: not compatible
118 function plugin_compatible_with_this_version_staticpages($pi_name)
120 global $_CONF, $_DB_dbms;
122 // check if we support the DBMS the site is running on
123 $dbFile = $_CONF['path'] . 'plugins/' . $pi_name . '/sql/'
124 . $_DB_dbms . '_install.php';
125 if (! file_exists($dbFile)) {
129 if (! function_exists('SEC_getGroupDropdown')) {
133 if (! function_exists('SEC_createToken')) {
137 if (! function_exists('COM_showMessageText')) {
141 if (! function_exists('COM_setLangIdAndAttribute')) {