mirror of
https://github.com/e107inc/e107.git
synced 2025-08-06 14:46:56 +02:00
Linkwords plugin update.
Fixes issue with admin preferences not being respected or no linking occurring. Prefs now moved out of core and into plugin prefs. Test page added to admin area. Relationship field added. e_tohtml.php deprecated in favor of e_parse.php Tests updated.
This commit is contained in:
82
e107_plugins/linkwords/linkwords_setup.php
Normal file
82
e107_plugins/linkwords/linkwords_setup.php
Normal file
@@ -0,0 +1,82 @@
|
||||
<?php
|
||||
/*
|
||||
* e107 website system
|
||||
*
|
||||
* Copyright (C) 2008-2013 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 for blank plugin
|
||||
**
|
||||
*/
|
||||
|
||||
|
||||
if(!class_exists("linkwords_setup"))
|
||||
{
|
||||
class linkwords_setup
|
||||
{
|
||||
/*
|
||||
function install_pre($var)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
|
||||
function install_post($var)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
function uninstall_options()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
|
||||
function uninstall_post($var)
|
||||
{
|
||||
|
||||
}
|
||||
*/
|
||||
|
||||
/*
|
||||
* Call During Upgrade Check.
|
||||
*
|
||||
* @return bool true = upgrade required; false = upgrade not required
|
||||
*/
|
||||
function upgrade_required()
|
||||
{
|
||||
|
||||
$pref = e107::pref();
|
||||
|
||||
if(isset($pref['lw_page_visibility']) || isset($pref['lw_ajax_enable']))
|
||||
{
|
||||
e107::getMessage()->addDebug("Prefs need to be migrated out of core prefs and into linkwords prefs.");
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
function upgrade_post($var)
|
||||
{
|
||||
|
||||
$plugPrefs = array(
|
||||
'lw_context_visibility' => 'lw_context_visibility',
|
||||
'lw_ajax_enable' => 'lw_ajax_enable',
|
||||
'lw_notsamepage' => 'lw_notsamepage',
|
||||
'linkword_omit_pages' => 'linkword_omit_pages',
|
||||
'lw_custom_class' => 'lw_custom_class',
|
||||
);
|
||||
|
||||
if($saveData = e107::getConfig()->migrateData($plugPrefs, true))
|
||||
{
|
||||
e107::getPlugConfig('linkwords')->setPref($saveData)->save(true,true,true);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user