[Phphtmllib-devel] SF.net SVN: phphtmllib:[3137] branches/BRANCH_2_X/phphtmllib/phphtmllib.php
Status: Beta
Brought to you by:
hemna
From: <mpw...@us...> - 2008-08-13 03:22:04
|
Revision: 3137 http://phphtmllib.svn.sourceforge.net/phphtmllib/?rev=3137&view=rev Author: mpwalsh8 Date: 2008-08-13 03:22:13 +0000 (Wed, 13 Aug 2008) Log Message: ----------- WordPress plugin activation - binds phpHtmlLib as a WordPress plugin. Added Paths: ----------- branches/BRANCH_2_X/phphtmllib/phphtmllib.php Added: branches/BRANCH_2_X/phphtmllib/phphtmllib.php =================================================================== --- branches/BRANCH_2_X/phphtmllib/phphtmllib.php (rev 0) +++ branches/BRANCH_2_X/phphtmllib/phphtmllib.php 2008-08-13 03:22:13 UTC (rev 3137) @@ -0,0 +1,108 @@ +<?php +/* vim: set expandtab tabstop=4 shiftwidth=4: */ +/** + * Plugin Name: phpHtmlLib + * Plugin URI: http://phphtmllib.newsblob.com + * Description: WordPress plugin to bind the phpHtmlLib library to WordPress. The phpHtmlLib library contains a set of PHP classes and library functions to help facilitate building, debugging, and rendering of XML, HTML, XHTML, WAP/WML Documents, and SVG (Scalable Vector Graphics) images as well as complex html Widgets. These classes, library functions and widgets can be used to build other WordPress plugins. + * + * + * Version: 2.6.0 + * Author: Mike Walsh + * Author URI: http://mpwalsh8.wordpress.com/ + * License: GPL + * + * + * $Id$ + * + * (c) 2008 by Mike Walsh + * + * @author Mike Walsh <mik...@mi...> + * @package phpHtmlLib + * @subpackage WordPress + * @version $Rev$ + * @lastmodified $Date$ + * @lastmodifiedby $LastChangedBy$ + * @since 2.6.0 + * + */ + +// Initialize the library + +define("PHPHTMLLIB_ABSPATH", dirname(__FILE__)) ; +define("PHPHTMLLIB_RELPATH", "/" . PLUGINDIR . "/" . basename(dirname(__FILE__))) ; + +require_once(PHPHTMLLIB_ABSPATH . "/version.inc") ; + +/** + * Add wp_head action + * + * This function adds the CSS link and Javascript + * references required by the phpHtmlLib plugin. + * + */ +function phphtmllib_wp_head() +{ + phphtmllib_head_css() ; +} + +/** + * Add admin_head action + * + * This function adds the CSS link and Javascript + * references required by the phpHtmlLib plugin. + * + */ +function phphtmllib_admin_head() +{ + phphtmllib_head_css() ; +} + +/** + * phphtmllib_plugin_installed() + * + * @return - boolean + */ +function phphtmllib_plugin_installed() +{ + return true ; +} + +/** + * phphtmllib_install - set up when the plugin is activated + * + * Store the absolute and relative paths to phpHtmlLib + * in the options table so other plugins can use them. + * + */ +function phphtmllib_install() +{ + update_option('PHPHTMLLIB_ABSPATH', PHPHTMLLIB_ABSPATH) ; + update_option('PHPHTMLLIB_RELPATH', PHPHTMLLIB_RELPATH) ; + update_option('PHPHTMLLIB_VERSION', PHPHTMLLIB_VERSION) ; +} + +/** + * phphtmllib_uninstall - clean up when the plugin is deactivated + * + */ +function phphtmllib_uninstall() +{ + delete_option('PHPHTMLLIB_ABSPATH') ; + delete_option('PHPHTMLLIB_RELPATH') ; + delete_option('PHPHTMLLIB_VERSION') ; +} + +/** + * Hook for adding CSS links and other HEAD stuff + */ +//add_action('wp_head', 'phphtmllib_wp_head'); +//add_action('admin_head', 'phphtmllib_admin_head'); + + +/** + * Activate the plugin initialization function + */ +register_activation_hook(plugin_basename(__FILE__), 'phphtmllib_install') ; +register_deactivation_hook(plugin_basename(__FILE__), 'phphtmllib_uninstall') ; + +?> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |