1<?php 2// (c) Copyright by authors of the Tiki Wiki CMS Groupware Project 3// 4// All Rights Reserved. See copyright.txt for details and a complete list of authors. 5// Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See license.txt for details. 6// $Id$ 7 8if (strpos($_SERVER["SCRIPT_NAME"], basename(__FILE__)) !== false) { 9 header("location: index.php"); 10 exit; 11} 12 13/** 14 * default for wysiwyg_htmltowiki changed between tiki 10 and 11 in r45440 - this maintains previous default setting 15 * 16 * @param $installer 17 */ 18function upgrade_20130410_keep_wysiwyg_htmltowiki_setting_tiki($installer) 19{ 20 $value = $installer->getOne("SELECT `value` FROM `tiki_preferences` WHERE `name` = 'wysiwyg_htmltowiki'"); 21 22 if ($value !== 'y') { // default values can be empty 23 $preferences = $installer->table('tiki_preferences'); 24 $preferences->insertOrUpdate(['value' => 'n'], ['name' => 'wysiwyg_htmltowiki']); 25 } 26} 27