本文整理汇总了PHP中serendipity_plugin_api::remove_plugin_value方法的典型用法代码示例。如果您正苦于以下问题:PHP serendipity_plugin_api::remove_plugin_value方法的具体用法?PHP serendipity_plugin_api::remove_plugin_value怎么用?PHP serendipity_plugin_api::remove_plugin_value使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类serendipity_plugin_api
的用法示例。
在下文中一共展示了serendipity_plugin_api::remove_plugin_value方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: cleanup
function cleanup()
{
$err = false;
$bugp = $this->get_config('bugpath');
$path = $this->get_config('path');
// allow numeric client ID only
if ($err = preg_match("/^[^0-9]+\$/", $this->get_config('client_id'))) {
printf("%s%s%s", S9YPOT_ERR_START, S9YPOT_CID_ERROR, S9YPOT_ERR_END);
}
// webbug path must be absolute, no trailing slash
if (!empty($bugp) && ($err = !preg_match("/^http(.*)[^\\/]\$/", $bugp))) {
printf("%s%s%s", S9YPOT_ERR_START, S9YPOT_BUGURL_ERROR, S9YPOT_ERR_END);
}
// path must be absolute, no trailing slash
if (!empty($path) && ($err = !preg_match("/^[\\/].*[^\\/]\$/", $path))) {
printf("%s%s%s", S9YPOT_ERR_START, S9YPOT_PATH_ERROR, S9YPOT_ERR_END);
}
// check for an existing POT installation
$location = sprintf("%s/%s", $this->get_config('path'), $this->get_config('fname'));
if (!empty($path) && ($err = !file_exists($location))) {
printf("%s%s%s", S9YPOT_ERR_START, S9YPOT_FNAME_ERROR, S9YPOT_ERR_END);
}
// s9y plugin error messaging is quite sub-optimal, print explanation what happened
// reset all config values so nothing gets logged using a wrong client ID (logging will fail due to wrong path)
if ($err || empty($bugp) && empty($path)) {
$this->set_config('client_id', S9YPOT_DEFAULT_CID);
$this->set_config('path', S9YPOT_DEFAULT_PATH);
$this->set_config('fname', S9YPOT_DEFAULT_FNAME);
$this->set_config('bugpath', S9YPOT_BUGDEFAULT_FNAME);
printf("%s%s%s", S9YPOT_ERR_START, S9YPOT_ERR_RESET, S9YPOT_ERR_END);
}
serendipity_plugin_api::remove_plugin_value($this->instance, array('path', 'fname', 'client_id', 'bugpath'));
}
示例2: cleanup
/**
* serendipity_plugin::cleanup method
*
* @return boolean
*/
function cleanup()
{
global $serendipity;
// check possible config mismatch setting
if (serendipity_db_bool($this->get_config('showapp')) === true && serendipity_db_bool($this->get_config('automoderate')) === true) {
$this->set_config('automoderate', false);
echo '<div class="msg_error"><span class="icon-attention-circled"></span> ' . PLUGIN_GUESTBOOK_CONFIG_ERROR . '</div>';
return false;
}
// Cleanup. Remove all empty configs on SAVECONF-Submit.
serendipity_plugin_api::remove_plugin_value($this->instance, array('sessionlock', 'timelock', 'version', 'targetmail', 'pageurl', 'dynamic_fields', 'dynamic_fields_desc', 'formpopup', 'getdynfield', 'showdynfield'));
return true;
}
示例3: cleanup
function cleanup()
{
// Cleanup. Remove all empty configs on SAVECONF-Submit.
serendipity_plugin_api::remove_plugin_value($this->instance, array('title', 'description'));
return true;
}