From: <jon...@us...> - 2010-12-10 18:49:28
|
Revision: 31355 http://tikiwiki.svn.sourceforge.net/tikiwiki/?rev=31355&view=rev Author: jonnybradley Date: 2010-12-10 18:49:20 +0000 (Fri, 10 Dec 2010) Log Message: ----------- [KIL] xajax removal: Part 2 - feature_wiki_save_draft Table tiki_page_drafts not removed to preserve existing data but removed from tiki.sql for new installs. Script in devtools started for manual removal. Modified Paths: -------------- branches/experimental/xajax_removal/db/tiki.sql branches/experimental/xajax_removal/lib/prefs/feature.php branches/experimental/xajax_removal/lib/setup/prefs.php branches/experimental/xajax_removal/lib/tikilib.php branches/experimental/xajax_removal/lib/userslib.php branches/experimental/xajax_removal/lib/wiki/wikilib.php branches/experimental/xajax_removal/templates/tiki-admin_include_features.tpl branches/experimental/xajax_removal/templates/tiki-admin_include_wiki.tpl branches/experimental/xajax_removal/templates/wiki_edit_actions.tpl Added Paths: ----------- branches/experimental/xajax_removal/doc/devtools/upto_7_drop_unused_6.x_tables.sql Removed Paths: ------------- branches/experimental/xajax_removal/lib/wiki/wiki-ajax.js branches/experimental/xajax_removal/lib/wiki/wiki-ajax.php Modified: branches/experimental/xajax_removal/db/tiki.sql =================================================================== --- branches/experimental/xajax_removal/db/tiki.sql 2010-12-10 18:25:58 UTC (rev 31354) +++ branches/experimental/xajax_removal/db/tiki.sql 2010-12-10 18:49:20 UTC (rev 31355) @@ -1631,17 +1631,6 @@ KEY `lastModif`(`lastModif`) ) ENGINE=MyISAM AUTO_INCREMENT=1; -DROP TABLE IF EXISTS `tiki_page_drafts`; -CREATE TABLE `tiki_page_drafts` ( - `user` varchar(200) default '', - `pageName` varchar(255) NOT NULL, - `data` mediumtext, - `description` varchar(200) default NULL, - `comment` varchar(200) default NULL, - `lastModif` int(14) default NULL, - PRIMARY KEY (`pageName`(120), `user`(120)) -) ENGINE=MyISAM; - DROP TABLE IF EXISTS `tiki_pageviews`; CREATE TABLE `tiki_pageviews` ( `day` int(14) NOT NULL default '0', Added: branches/experimental/xajax_removal/doc/devtools/upto_7_drop_unused_6.x_tables.sql =================================================================== --- branches/experimental/xajax_removal/doc/devtools/upto_7_drop_unused_6.x_tables.sql (rev 0) +++ branches/experimental/xajax_removal/doc/devtools/upto_7_drop_unused_6.x_tables.sql 2010-12-10 18:49:20 UTC (rev 31355) @@ -0,0 +1,2 @@ +-- jonnyb: remove tables no longer used in tiki 7 +DROP TABLE `tiki_page_drafts`; Modified: branches/experimental/xajax_removal/lib/prefs/feature.php =================================================================== --- branches/experimental/xajax_removal/lib/prefs/feature.php 2010-12-10 18:25:58 UTC (rev 31354) +++ branches/experimental/xajax_removal/lib/prefs/feature.php 2010-12-10 18:49:20 UTC (rev 31355) @@ -405,18 +405,6 @@ 'help' => 'Wysiwyg', 'type' => 'flag', ), - 'feature_wiki_save_draft' => array( - 'name' => tra('Save draft'), - 'warning' => tra('Experimental (Requires AJAX)'), - 'dependencies' => array( - 'feature_ajax', - ), - 'type' => 'flag', - 'dependencies' => array( - 'feature_ajax', - 'ajax_xajax', - ), - ), 'feature_kaltura' => array( 'name' => tra('Kaltura'), 'description' => tra('Collaborative video editing'), Modified: branches/experimental/xajax_removal/lib/setup/prefs.php =================================================================== --- branches/experimental/xajax_removal/lib/setup/prefs.php 2010-12-10 18:25:58 UTC (rev 31354) +++ branches/experimental/xajax_removal/lib/setup/prefs.php 2010-12-10 18:49:20 UTC (rev 31355) @@ -103,7 +103,6 @@ 'feature_wiki_userpage_prefix' => 'User:', 'feature_wiki_usrlock' => 'n', 'feature_wiki_feedback_polls' => array(), - 'feature_wiki_save_draft' => 'n', 'feature_wikiwords' => 'n', 'feature_wikiwords_usedash' => 'y', 'feature_wiki_pagealias' => 'y', Modified: branches/experimental/xajax_removal/lib/tikilib.php =================================================================== --- branches/experimental/xajax_removal/lib/tikilib.php 2010-12-10 18:25:58 UTC (rev 31354) +++ branches/experimental/xajax_removal/lib/tikilib.php 2010-12-10 18:49:20 UTC (rev 31355) @@ -4492,15 +4492,6 @@ } $this->cache_page_info[$pageNameEncode] = $row; - - global $user, $prefs; - if ( $user && $prefs['feature_wiki_save_draft'] == 'y' ) { - $query = "select * from `tiki_page_drafts` where `user`=? and `pageName`=?"; - $result = $this->query($query, array($user, $pageName)); - if ( $result->numRows() ) { - $this->cache_page_info[$pageNameEncode]['draft'] = $result->fetchRow(); - } - } return $this->cache_page_info[$pageNameEncode]; } } @@ -7412,9 +7403,6 @@ sendWikiEmailNotification('wiki_page_changed', $pageName, $edit_user, $edit_comment, $old_version, $edit_data, $machine, $diff, $edit_minor, $hash['contributions'], 0, 0, $lang); } - $query = "delete from `tiki_page_drafts` where `user`=? and `pageName`=?"; - $this->query($query, array($GLOBALS['user'], $pageName)); - if ($prefs['feature_score'] == 'y') { $this->score_event($user, 'wiki_edit'); } Modified: branches/experimental/xajax_removal/lib/userslib.php =================================================================== --- branches/experimental/xajax_removal/lib/userslib.php 2010-12-10 18:25:58 UTC (rev 31354) +++ branches/experimental/xajax_removal/lib/userslib.php 2010-12-10 18:49:20 UTC (rev 31355) @@ -1720,7 +1720,6 @@ $this->query("update `tiki_private_messages` set `toNickname`=? where `toNickname`=?", array($to,$from)); $this->query("update `tiki_pages` set `user`=? where `user`=?", array($to,$from)); $this->query("update `tiki_pages` set `creator`=? where `creator`=?", array($to,$from)); - $this->query("update `tiki_page_drafts` set `user`=? where `user`=?", array($to,$from)); $this->query("update `tiki_page_footnotes` set `user`=? where `user`=?", array($to,$from)); $this->query("update `tiki_newsletters` set `author`=? where `author`=?", array($to,$from)); $this->query("update `tiki_minical_events` set `user`=? where `user`=?", array($to,$from)); Deleted: branches/experimental/xajax_removal/lib/wiki/wiki-ajax.js =================================================================== --- branches/experimental/xajax_removal/lib/wiki/wiki-ajax.js 2010-12-10 18:25:58 UTC (rev 31354) +++ branches/experimental/xajax_removal/lib/wiki/wiki-ajax.js 2010-12-10 18:49:20 UTC (rev 31355) @@ -1,19 +0,0 @@ -function save_draft() { - var form = document.getElementById('editpageform'); - - var pageName = form.page.value; - - var pageDesc = ''; - if (form.description) { - pageDesc = form.description.value; - } - - var pageData = form.edit.value; - - var pageComment; - if (form.comment) { - pageComment = form.comment.value; - } - - return xajax_save_draft(pageName, pageDesc, pageData, pageComment); -} Deleted: branches/experimental/xajax_removal/lib/wiki/wiki-ajax.php =================================================================== --- branches/experimental/xajax_removal/lib/wiki/wiki-ajax.php 2010-12-10 18:25:58 UTC (rev 31354) +++ branches/experimental/xajax_removal/lib/wiki/wiki-ajax.php 2010-12-10 18:49:20 UTC (rev 31355) @@ -1,19 +0,0 @@ -<?php -// (c) Copyright 2002-2010 by authors of the Tiki Wiki/CMS/Groupware Project -// -// All Rights Reserved. See copyright.txt for details and a complete list of authors. -// Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See license.txt for details. -// $Id$ - -$access->check_script($_SERVER["SCRIPT_NAME"],basename(__FILE__)); - -$ajaxlib->registerFunction('save_draft'); - -function save_draft($pageId, $pageDesc, $pageData, $pageComment) { - global $wikilib; - require_once('lib/wiki/wikilib.php'); - - $wikilib->save_draft($pageId, $pageDesc, $pageData, $pageComment); - - return new xajaxResponse(); -} Modified: branches/experimental/xajax_removal/lib/wiki/wikilib.php =================================================================== --- branches/experimental/xajax_removal/lib/wiki/wikilib.php 2010-12-10 18:25:58 UTC (rev 31354) +++ branches/experimental/xajax_removal/lib/wiki/wikilib.php 2010-12-10 18:49:20 UTC (rev 31355) @@ -920,19 +920,6 @@ return $prefs['wikiHomePage']; } - function save_draft($pageName, $pageDesc, $pageData, $pageComment) { - global $user; - - if (!$user) return false; - - $query = "delete from `tiki_page_drafts` where `user`=? and `pageName`=?"; - $this->query($query, array($user, $pageName)); - - $query = "insert into `tiki_page_drafts` (`user`,`pageName`,`data`,`description`,`comment`,`lastModif`) values (?,?,?,?,?,?)"; - $bindvals = array($user, $pageName, $pageData, $pageDesc, $pageComment, time()); - - return $this->query($query, $bindvals) ? true : false; - } function sefurl($page, $with_next='', $all_langs='') { global $prefs, $smarty, $info; if( basename( $_SERVER['PHP_SELF'] ) == 'tiki-all_languages.php' ) { Modified: branches/experimental/xajax_removal/templates/tiki-admin_include_features.tpl =================================================================== --- branches/experimental/xajax_removal/templates/tiki-admin_include_features.tpl 2010-12-10 18:25:58 UTC (rev 31354) +++ branches/experimental/xajax_removal/templates/tiki-admin_include_features.tpl 2010-12-10 18:49:20 UTC (rev 31355) @@ -78,7 +78,6 @@ {preference name=feature_ajax} <div class="adminoptionboxchild half_width" id="feature_ajax_childcontainer"> {preference name=ajax_autosave} - {preference name=feature_wiki_save_draft} </div> </fieldset> <fieldset class="admin featurelist"> Modified: branches/experimental/xajax_removal/templates/tiki-admin_include_wiki.tpl =================================================================== --- branches/experimental/xajax_removal/templates/tiki-admin_include_wiki.tpl 2010-12-10 18:25:58 UTC (rev 31354) +++ branches/experimental/xajax_removal/templates/tiki-admin_include_wiki.tpl 2010-12-10 18:49:20 UTC (rev 31355) @@ -49,7 +49,6 @@ {preference name=feature_warn_on_edit} {preference name=warn_on_edit_time} {preference name=feature_wiki_undo} - {preference name=feature_wiki_save_draft} {preference name=feature_wiki_footnotes} {preference name=feature_wiki_allowhtml} {preference name=wiki_timeout_warning} Modified: branches/experimental/xajax_removal/templates/wiki_edit_actions.tpl =================================================================== --- branches/experimental/xajax_removal/templates/wiki_edit_actions.tpl 2010-12-10 18:25:58 UTC (rev 31354) +++ branches/experimental/xajax_removal/templates/wiki_edit_actions.tpl 2010-12-10 18:49:20 UTC (rev 31355) @@ -25,10 +25,6 @@ <input type="submit" class="wikiaction tips" name="minor" title="{tr}Edit wiki page{/tr}|{if $prefs.wiki_watch_minor}{tr}Save the page, but do not count it as new content to be translated.{/tr}{else}{tr}Save the page, but do not send notifications and do not count it as new content to be translated.{/tr}{/if}" value="{tr}Save Minor Edit{/tr}" onclick="needToConfirm=false;" /> {/if} <input type="submit" class="wikiaction tips" title="{tr}Edit wiki page{/tr}|{tr}Save the page.{/tr}" name="save" value="{tr}Save{/tr}" onclick="needToConfirm=false;" /> - - {if $prefs.feature_ajax eq 'y' && $prefs.feature_wiki_save_draft eq 'y'} - <input type="submit" class="wikiaction tips" title="{tr}Edit wiki page{/tr}|{tr}Save the page as a draft.{/tr}" value="{tr}Save Draft{/tr}" onclick="needToConfirm=false;save_draft();return false;" /> - {/if} {/if} {/if} {if $page|lower ne 'sandbox'} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |