1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-01 20:30:39 +02:00

Some defaults for _blank plugin. An example for plugin development

This commit is contained in:
CaMer0n
2009-10-30 09:11:01 +00:00
parent d0111eec57
commit 91814acaf7
2 changed files with 98 additions and 0 deletions

View File

@@ -0,0 +1,74 @@
<?php
/*
* e107 website system
*
* Copyright ( c ) 2008-2009 e107 Inc (e107.org)
* Released under the terms and conditions of the
* GNU General Public License (http://www.gnu.org/licenses/gpl.txt)
*
* Custom install/uninstall/update routines
*
* $Source: /cvs_backup/e107_0.8/e107_plugins/_blank/_blank_setup.php,v $
* $Revision: 1.1 $
* $Date: 2009-10-30 09:11:01 $
* $Author: e107coders $
*
*/
class _blank_setup
{
function install_pre($var)
{
// print_a($var);
// echo "custom install 'pre' function<br /><br />";
}
function install_post($var)
{
$sql = e107::getDb();
$mes = e107::getMessage();
// $query = "INSERT INTO #_blank SQL insert query goes here;";
// if($sql->db_Select_gen($query))
{
$mes->add("Custom - Install Message.", E_MESSAGE_SUCCESS);
}
// else
{
$mes->add("Custom - Failed to add default table data.", E_MESSAGE_ERROR);
}
}
function uninstall_options()
{
$listoptions = array(0=>'option 1',1=>'option 2');
$options = array();
$options['mypref'] = array(
'label' => 'Custom Uninstall Label',
'preview' => 'Preview Area',
'helpText' => 'Custom Help Text',
'itemList' => $listoptions,
'itemDefault' => 1
);
return $options;
}
function uninstall_post($var)
{
// print_a($var);
}
function upgrade_post($var)
{
// $sql = e107::getDb();
}
}
?>

View File

@@ -0,0 +1,24 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- $Id: plugin.xml,v 1.1 2009-10-30 09:11:01 e107coders Exp $ -->
<e107Plugin name="Blank Plugin" version="2.0" compatibility="0.8" installRequired="true" xhtmlcompliant="true" >
<author name="e107 Inc." url="http://e107.org" />
<description>A Blank Plugin to help you get started in plugin development</description>
<category>misc</category>
<adminLinks>
<link url='admin_config.php' description='Configure Blank Plugin' icon='images/blank_32.png' iconSmall='images/blank_16.png' primary='true' >Configure Blank</link>
<link url="admin_config.php?mode=options" description="Configure Blank Prefs" icon="manage" >Blank Prefs</link>
</adminLinks>
<siteLinks>
<link url="{e_PLUGIN}_blank/_blank.php" perm='everyone'>Blank</link>
</siteLinks>
<pluginPrefs>
<pref name="blank_pref_1">1</pref>
<pref name="blank_pref_2">[more...]</pref>
</pluginPrefs>
<userClasses>
<class name="blank_userclass" description="Blank Userclass Description" />
</userClasses>
<extendedFields>
<field name="custom" type='EUF_TEXTAREA' default='0' active="true" />
</extendedFields>
</e107Plugin>