add('name', PLUGIN_LOGINFORM_NAME); $propbag->add('description', PLUGIN_LOGINFORM_DESC); $propbag->add('stackable', false); $propbag->add('author', 'Garvin Hicking, Neil Dudman'); $propbag->add('version', '1.09'); $propbag->add('requirements', array( 'serendipity' => '0.8', 'smarty' => '2.6.7', 'php' => '4.1.0' )); $propbag->add('configuration', array('title', 'login_url', 'logout_url')); $propbag->add('groups', array('FRONTEND_FEATURES')); // Register (multiple) dependencies. KEY is the name of the depending plugin. VALUE is a mode of either 'remove' or 'keep'. // If the mode 'remove' is set, removing the plugin results in a removal of the depending plugin. 'Keep' meens to // not touch the depending plugin. $this->dependencies = array('serendipity_event_loginform' => 'remove'); } function introspect_config_item($name, &$propbag) { switch($name) { case 'title': $propbag->add('type', 'string'); $propbag->add('name', TITLE); $propbag->add('description', TITLE); $propbag->add('default', ''); break; case 'login_url': $propbag->add('type', 'string'); $propbag->add('name', LOGINURL_NAME); $propbag->add('description', LOGINURL_DESC); $propbag->add('default', ''); break; case 'logout_url': $propbag->add('type', 'string'); $propbag->add('name', LOGOUTURL_NAME); $propbag->add('description', LOGOUTURL_DESC); $propbag->add('default', ''); break; default: return false; } return true; } function generate_content(&$title) { global $serendipity; $title = $this->get_config('title', $title); $login_url = $this->get_config('login_url'); $logout_url = $this->get_config('logout_url'); if ($login_url == "") { $login_url = serendipity_currentURL(); } if ($logout_url == "") { $logout_url = serendipity_currentURL(); } if (isset($serendipity['POST']['action']) && !isset($serendipity['POST']['logout']) && !serendipity_userLoggedIn()) { echo '