Author: dgoette
Date: Mon Mar 9 19:55:04 2009
New Revision: 39916
URL:
http://svn.reactos.org/svn/reactos?rev=39916&view=rev
Log:
* convert templates, instead of just change type
* load backends of current instance instead of roscms master
* show language selection in user interface again
* minor adjustments
Modified:
branches/danny-web/reactos.org/htdocs/roscms/convert3to4.sql
branches/danny-web/reactos.org/htdocs/roscms/js/cms_maintain.js
branches/danny-web/reactos.org/htdocs/roscms/js/cms_website.js
branches/danny-web/reactos.org/htdocs/roscms/lib/HTML_User.class.php
branches/danny-web/reactos.org/htdocs/roscms/lib/RosCMS.class.php
branches/danny-web/reactos.org/htdocs/roscms/lib/view/HTML_CMS_Maintain.cla…
branches/danny-web/reactos.org/htdocs/roscms/lib/view/HTML_CMS_Website.clas…
branches/danny-web/reactos.org/htdocs/roscms/roscms_instance_example.php
Modified:
branches/danny-web/reactos.org/htdocs/roscms/convert3to4.sql
URL:
http://svn.reactos.org/svn/reactos/branches/danny-web/reactos.org/htdocs/ro…
==============================================================================
---
branches/danny-web/reactos.org/htdocs/roscms/convert3to4.sql [iso-8859-1] (original)
+++
branches/danny-web/reactos.org/htdocs/roscms/convert3to4.sql [iso-8859-1] Mon Mar 9
19:55:04 2009
@@ -323,7 +323,7 @@
-- --------------------------------------------------------
CREATE TABLE roscms_entries (
id bigint(20) unsigned NOT NULL auto_increment,
- type
enum('page','content','dynamic','script','system')
collate utf8_unicode_ci NOT NULL,
+ type
enum('page','content','dynamic','script','system',
'template') collate utf8_unicode_ci NOT NULL,
name varchar(64) collate utf8_unicode_ci NOT NULL,
access_id bigint(20) unsigned COMMENT '->access(id)',
old_id int(11) NOT NULL,
@@ -343,16 +343,7 @@
s.id,
d.data_id,
TRUE
-FROM data_a d JOIN roscms_entries_access s ON d.data_acl=s.name_short WHERE data_type !=
'template'
-UNION
-SELECT
- NULL,
- 'content',
- d.data_name,
- s.id,
- d.data_id,
- TRUE
-FROM data_a d JOIN roscms_entries_access s ON d.data_acl=s.name_short WHERE data_type =
'template'
+FROM data_a d JOIN roscms_entries_access s ON d.data_acl=s.name_short
UNION
SELECT
NULL,
@@ -361,16 +352,7 @@
s.id,
d.data_id,
FALSE
-FROM data_ d JOIN roscms_entries_access s ON d.data_acl=s.name_short WHERE data_type !=
'template'
-UNION
-SELECT
- NULL,
- 'template',
- d.data_name,
- s.id,
- d.data_id,
- FALSE
-FROM data_ d JOIN roscms_entries_access s ON d.data_acl=s.name_short WHERE data_type =
'template';
+FROM data_ d JOIN roscms_entries_access s ON d.data_acl=s.name_short;
@@ -725,12 +707,37 @@
-- --------------------------------------------------------
+-- convert templates
+-- --------------------------------------------------------
+INSERT INTO roscms_entries_tags
+SELECT
+ NULL,
+ r.id,
+ -1,
+ 'kind',
+ 'template'
+FROM roscms_entries d
+JOIN roscms_entries_revisions r ON r.data_id=d.id
+WHERE d.type = 'template';
+
+-- remove from texts
+UPDATE roscms_entries_text
+SET content = REPLACE(content, '[#templ_', '[#cont_');
+
+-- update entries
+UPDATE roscms_entries
+SET type = 'content' WHERE type ='template';
+
+
+
+-- --------------------------------------------------------
-- remove converter specific fields
-- --------------------------------------------------------
ALTER TABLE roscms_entries
DROP old_id,
DROP old_archive,
- ADD UNIQUE KEY type_name ( type , name );
+ ADD UNIQUE KEY type_name ( type , name ),
+ CHANGE `type` `type` ENUM( 'page', 'content', 'dynamic',
'script', 'system' ) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL;
ALTER TABLE roscms_entries_revisions DROP old_id;
ALTER TABLE roscms_entries_access DROP name_short;
Modified:
branches/danny-web/reactos.org/htdocs/roscms/js/cms_maintain.js
URL:
http://svn.reactos.org/svn/reactos/branches/danny-web/reactos.org/htdocs/ro…
==============================================================================
---
branches/danny-web/reactos.org/htdocs/roscms/js/cms_maintain.js [iso-8859-1]
(original)
+++
branches/danny-web/reactos.org/htdocs/roscms/js/cms_maintain.js [iso-8859-1] Mon Mar
9 19:55:04 2009
@@ -1053,7 +1053,7 @@
if (kind === 'POST') {
var parameters = getFormData();
- http_request.open('POST', url, true);
+ http_request.open('POST', roscms_intern_link+url, true);
http_request.setRequestHeader("Content-type",
"application/x-www-form-urlencoded");
http_request.setRequestHeader("Content-length", parameters.length);
http_request.setRequestHeader("If-Modified-Since", "Sat, 1 Jan 2000
00:00:00 GMT"); // Bypass the IE Cache
@@ -1061,7 +1061,7 @@
http_request.send(parameters);
}
else {
- http_request.open('GET', url, true);
+ http_request.open('GET', roscms_intern_link+url, true);
http_request.setRequestHeader("If-Modified-Since", "Sat, 1 Jan 2000
00:00:00 GMT"); // Bypass the IE Cache
http_request.send(null);
}
Modified:
branches/danny-web/reactos.org/htdocs/roscms/js/cms_website.js
URL:
http://svn.reactos.org/svn/reactos/branches/danny-web/reactos.org/htdocs/ro…
==============================================================================
---
branches/danny-web/reactos.org/htdocs/roscms/js/cms_website.js [iso-8859-1]
(original)
+++
branches/danny-web/reactos.org/htdocs/roscms/js/cms_website.js [iso-8859-1] Mon Mar 9
19:55:04 2009
@@ -1510,7 +1510,7 @@
}; // internal function end
if (kind === 'POST') {
- http_request.open('POST', roscms_intern_webserver_roscms+url, true);
+ http_request.open('POST', roscms_intern_link+url, true);
http_request.setRequestHeader("Content-type",
"application/x-www-form-urlencoded");
http_request.setRequestHeader("Content-length", parameters.length);
http_request.setRequestHeader("If-Modified-Since", "Sat, 1 Jan 2000
00:00:00 GMT"); // Bypass the IE Cache
@@ -1518,7 +1518,7 @@
http_request.send(parameters);
}
else {
- http_request.open('GET', roscms_intern_webserver_roscms+url, true);
+ http_request.open('GET', roscms_intern_link+url, true);
http_request.setRequestHeader("If-Modified-Since", "Sat, 1 Jan 2000
00:00:00 GMT"); // Bypass the IE Cache
http_request.send(null);
}
Modified:
branches/danny-web/reactos.org/htdocs/roscms/lib/HTML_User.class.php
URL:
http://svn.reactos.org/svn/reactos/branches/danny-web/reactos.org/htdocs/ro…
==============================================================================
---
branches/danny-web/reactos.org/htdocs/roscms/lib/HTML_User.class.php [iso-8859-1]
(original)
+++
branches/danny-web/reactos.org/htdocs/roscms/lib/HTML_User.class.php [iso-8859-1] Mon
Mar 9 19:55:04 2009
@@ -133,7 +133,7 @@
// print current language
$stmt=&DBConnection::getInstance()->prepare("SELECT id, name FROM
".ROSCMST_LANGUAGES." WHERE id = :lang_id");
- $stmt->bindParam('lang_id',$_GET['lang'],PDO::PARAM_INT);
+ $stmt->bindParam('lang_id',$thisuser->language(),PDO::PARAM_INT);
$stmt->execute();
$current_lang = $stmt->fetchOnce(PDO::FETCH_ASSOC);
Modified:
branches/danny-web/reactos.org/htdocs/roscms/lib/RosCMS.class.php
URL:
http://svn.reactos.org/svn/reactos/branches/danny-web/reactos.org/htdocs/ro…
==============================================================================
---
branches/danny-web/reactos.org/htdocs/roscms/lib/RosCMS.class.php [iso-8859-1]
(original)
+++
branches/danny-web/reactos.org/htdocs/roscms/lib/RosCMS.class.php [iso-8859-1] Mon Mar
9 19:55:04 2009
@@ -55,7 +55,7 @@
private $limit_password_max = 50;
private $system_brand = 'RosCMS 4';
- private $system_version = '4.0.0 alpha';
+ private $system_version = '4.0.0 beta';
private $applied = false;
Modified:
branches/danny-web/reactos.org/htdocs/roscms/lib/view/HTML_CMS_Maintain.cla…
URL:
http://svn.reactos.org/svn/reactos/branches/danny-web/reactos.org/htdocs/ro…
==============================================================================
---
branches/danny-web/reactos.org/htdocs/roscms/lib/view/HTML_CMS_Maintain.cla…
[iso-8859-1] (original)
+++
branches/danny-web/reactos.org/htdocs/roscms/lib/view/HTML_CMS_Maintain.cla…
[iso-8859-1] Mon Mar 9 19:55:04 2009
@@ -69,6 +69,7 @@
<script type="text/javascript">
<!--'."
var roscms_intern_webserver_roscms =
'".RosCMS::getInstance()->pathRosCMS()."';
+ var roscms_intern_link =
'".RosCMS::getInstance()->pathInstance()."';
// access restrictions
var roscms_access = new Object();
Modified:
branches/danny-web/reactos.org/htdocs/roscms/lib/view/HTML_CMS_Website.clas…
URL:
http://svn.reactos.org/svn/reactos/branches/danny-web/reactos.org/htdocs/ro…
==============================================================================
---
branches/danny-web/reactos.org/htdocs/roscms/lib/view/HTML_CMS_Website.clas…
[iso-8859-1] (original)
+++
branches/danny-web/reactos.org/htdocs/roscms/lib/view/HTML_CMS_Website.clas…
[iso-8859-1] Mon Mar 9 19:55:04 2009
@@ -95,7 +95,7 @@
var roscms_standard_language =
'".Language::getStandardId()."';
var roscms_intern_login_check_username =
'".$thisuser->name()."';
var roscms_intern_webserver_roscms =
'".RosCMS::getInstance()->pathRosCMS()."';
- var roscms_intern_page_link =
'".RosCMS::getInstance()->pathInstance()."?page=';
+ var roscms_intern_link =
'".RosCMS::getInstance()->pathInstance()."';
var roscms_get_edit = '".(isset($_GET['edit']) ?
$_GET['edit'] : '')."';
// access restrictions
Modified:
branches/danny-web/reactos.org/htdocs/roscms/roscms_instance_example.php
URL:
http://svn.reactos.org/svn/reactos/branches/danny-web/reactos.org/htdocs/ro…
==============================================================================
---
branches/danny-web/reactos.org/htdocs/roscms/roscms_instance_example.php [iso-8859-1]
(original)
+++
branches/danny-web/reactos.org/htdocs/roscms/roscms_instance_example.php [iso-8859-1]
Mon Mar 9 19:55:04 2009
@@ -40,7 +40,8 @@
///////////////////////////////////////////////////////
// Config start ///////////////////////////////////////
-
+
+// use this settings to force that the user has to login seperatly from original roscms
$config->setCookieUserKey('roscmsusrkey'); // session key
$config->setCookieUserName('roscmsusrname'); // user_name
$config->setCookiePassword('rospassword'); // user_password (used for keep
login function)
@@ -55,11 +56,14 @@
// RosCMS Table Names
-$config->setTable('ROSCMST_ENTRIES' , 'roscms_entries');
-$config->setTable('ROSCMST_REVISIONS' , 'roscms_entries_revisions');
-$config->setTable('ROSCMST_STEXT' , 'roscms_entries_stext');
-$config->setTable('ROSCMST_TAGS' , 'roscms_entries_tags');
-$config->setTable('ROSCMST_TEXT' , 'roscms_entries_text');
+$config->setTable('ROSCMST_ENTRIES' , 'other_entries');
+$config->setTable('ROSCMST_DEPENDENCIES' ,
'other_rel_revisions_dependencies');
+$config->setTable('ROSCMST_REVISIONS' ,
'other_entries_revisions');
+$config->setTable('ROSCMST_STEXT' , 'other_entries_stext');
+$config->setTable('ROSCMST_TAGS' , 'other_entries_tags');
+$config->setTable('ROSCMST_TEXT' , 'other_entries_text');
+
+// see config.php in original RosCMS for more possible settings
// Config end /////////////////////////////////////////
///////////////////////////////////////////////////////