Пример #1
0
function plugin_load_configuration_calendar($pi_name)
{
    global $_CONF;
    $base_path = $_CONF['path'] . 'plugins/' . $pi_name . '/';
    require_once $_CONF['path_system'] . 'classes/config.class.php';
    require_once $base_path . 'install_defaults.php';
    return plugin_initconfig_calendar();
}
function upgrade_CalendarPlugin()
{
    global $_CONF, $_TABLES, $_STATES;
    require_once $_CONF['path_system'] . 'classes/config.class.php';
    $plugin_path = $_CONF['path'] . 'plugins/calendar/';
    require_once $plugin_path . 'install_defaults.php';
    if (file_exists($plugin_path . 'config.php')) {
        global $_DB_table_prefix, $_CA_CONF;
        require_once $plugin_path . 'config.php';
    }
    if (!plugin_initconfig_calendar()) {
        echo 'There was an error upgrading the Polls plugin';
        return false;
    }
    $P_SQL[] = "ALTER TABLE {$_TABLES['events']} CHANGE state state varchar(40) default NULL";
    $P_SQL[] = "ALTER TABLE {$_TABLES['eventsubmission']} CHANGE state state varchar(40) default NULL";
    $P_SQL[] = "ALTER TABLE {$_TABLES['personal_events']} CHANGE state state varchar(40) default NULL";
    $P_SQL[] = "UPDATE {$_TABLES['plugins']} SET pi_version = '1.0.2', pi_gl_version = '1.5.0' WHERE pi_name = 'calendar'";
    foreach ($P_SQL as $sql) {
        $rst = DB_query($sql);
        if (DB_error()) {
            echo "There was an error upgrading the calendar";
            return false;
        }
    }
    if (isset($_STATES) && is_array($_STATES)) {
        $tables = array($_TABLES['events'], $_TABLES['eventsubmission'], $_TABLES['personal_events']);
        foreach ($_STATES as $key => $state) {
            foreach ($tables as $table) {
                DB_change($table, 'state', addslashes($state), 'state', addslashes($key));
            }
        }
    }
    return true;
}
Пример #3
0
/**
* Loads the configuration records for the Online Config Manager
*
* @return   boolean     true = proceed with install, false = an error occured
*
*/
function plugin_load_configuration_calendar()
{
    global $_CONF;
    require_once $_CONF['path'] . 'plugins/calendar/install_defaults.php';
    return plugin_initconfig_calendar();
}
Пример #4
0
/**
* Loads the configuration records for the GL Online Config Manager
* 
* @return   boolean     true = proceed with install, false = an error occured
* 
*/
function plugin_load_configuration()
{
    global $_CONF, $base_path;
    require_once $_CONF['path_system'] . 'classes/config.class.php';
    require_once $base_path . 'install_defaults.php';
    return plugin_initconfig_calendar();
}