3 /* Reminder: always indent with 4 spaces (no tabs). */
4 // +---------------------------------------------------------------------------+
5 // | Polls Plugin 2.1 |
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 Polls plugin
39 * Plugin autoinstall function
41 * @param string $pi_name Plugin name
42 * @return array Plugin information
45 function plugin_autoinstall_polls($pi_name)
48 $pi_display_name = 'Polls';
49 $pi_admin = $pi_display_name . ' Admin';
52 'pi_name' => $pi_name,
53 'pi_display_name' => $pi_display_name,
54 'pi_version' => '2.1.1',
55 'pi_gl_version' => '1.6.1',
56 'pi_homepage' => 'http://www.geeklog.net/'
60 $pi_admin => 'Has full access to ' . $pi_display_name . ' features'
64 $pi_name . '.edit' => 'Access to ' . $pi_name . ' editor'
68 $pi_name . '.edit' => array($pi_admin)
81 'features' => $features,
82 'mappings' => $mappings,
90 * Load plugin configuration from database
92 * @param string $pi_name Plugin name
93 * @return boolean true on success, otherwise false
94 * @see plugin_initconfig_polls
97 function plugin_load_configuration_polls($pi_name)
101 $base_path = $_CONF['path'] . 'plugins/' . $pi_name . '/';
103 require_once $_CONF['path_system'] . 'classes/config.class.php';
104 require_once $base_path . 'install_defaults.php';
106 return plugin_initconfig_polls();
110 * Check if the plugin is compatible with this Geeklog version
112 * @param string $pi_name Plugin name
113 * @return boolean true: plugin compatible; false: not compatible
116 function plugin_compatible_with_this_version_polls($pi_name)
118 global $_CONF, $_DB_dbms;
120 // check if we support the DBMS the site is running on
121 $dbFile = $_CONF['path'] . 'plugins/' . $pi_name . '/sql/'
122 . $_DB_dbms . '_install.php';
123 if (! file_exists($dbFile)) {
127 if (function_exists('COM_showPoll') || function_exists('COM_pollVote')) {
128 // if these functions exist, then someone's trying to install the
129 // plugin on Geeklog 1.3.11 or older - sorry, but that won't work
133 if (! function_exists('SEC_getGroupDropdown')) {
137 if (! function_exists('SEC_createToken')) {
141 if (! function_exists('COM_showMessageText')) {
145 if (! isset($_CONF['meta_tags'])) {