Esempio n. 1
0
function updatePluginConfig($name, $setVal)
{
    $context = Model_Context::getInstance();
    if (!in_array($name, $context->getProperty("plugin.activePlugins"))) {
        return false;
    }
    $pluginName = $name;
    $name = Utils_Unicode::lessenAsEncoding($name, 255);
    $setting = serialize(fetchConfigXML($setVal));
    $pool = DBModel::getInstance();
    $pool->reset('Plugins');
    $pool->setQualifier('blogid', 'eq', getBlogId());
    $pool->setQualifier('name', 'eq', $name, true);
    $pool->setAttribute('settings', $setting, true);
    if ($pool->update()) {
        $result = '0';
    } else {
        $result = '1';
    }
    clearPluginSettingCache();
    CacheControl::flushItemsByPlugin($pluginName);
    return $result;
}
Esempio n. 2
0
function updatePluginConfig($name, $setVal)
{
    global $activePlugins;
    if (!in_array($name, $activePlugins)) {
        return false;
    }
    $pluginName = $name;
    $name = POD::escapeString(UTF8::lessenAsEncoding($name, 255));
    $setting = serialize(Setting::fetchConfigXML($setVal));
    $pool = DBModel::getInstance();
    $pool->reset('Plugins');
    $pool->setQualifier('blogid', 'eq', getBlogId());
    $pool->setQualifier('name', 'eq', $name, true);
    $pool->setAttribute('settings', $setting, true);
    if ($pool->update()) {
        $result = '0';
    } else {
        $result = '1';
    }
    clearPluginSettingCache();
    CacheControl::flushItemsByPlugin($pluginName);
    return $result;
}