Author: frik85
Date: Mon Aug 13 15:10:48 2007
New Revision: 28312
URL:
http://svn.reactos.org/svn/reactos?rev=28312&view=rev
Log:
numerous bug fixes and some new features
Modified:
trunk/web/reactos.org/htdocs/roscms/inc/data_edit.php
trunk/web/reactos.org/htdocs/roscms/inc/data_export.php
trunk/web/reactos.org/htdocs/roscms/inc/data_export_page.php
trunk/web/reactos.org/htdocs/roscms/inc/data_export_xml.php
trunk/web/reactos.org/htdocs/roscms/inc/data_list.php
trunk/web/reactos.org/htdocs/roscms/inc/data_maintain.php
trunk/web/reactos.org/htdocs/roscms/inc/data_maintain_out.php
trunk/web/reactos.org/htdocs/roscms/inc/data_menu.php
Modified:
trunk/web/reactos.org/htdocs/roscms/inc/data_edit.php
URL:
http://svn.reactos.org/svn/reactos/trunk/web/reactos.org/htdocs/roscms/inc/…
==============================================================================
---
trunk/web/reactos.org/htdocs/roscms/inc/data_edit.php (original)
+++
trunk/web/reactos.org/htdocs/roscms/inc/data_edit.php Mon Aug 13 15:10:48 2007
@@ -841,8 +841,8 @@
$temp_sql_type = ", (
NULL ,
'".mysql_real_escape_string($result_data_save2['rev_id'])."',
- '".mysql_real_escape_string('extention')."',
- '".mysql_real_escape_string('html')."'
+ '".mysql_real_escape_string('comment')."',
+ '".mysql_real_escape_string('')."'
),
(
NULL ,
@@ -924,7 +924,12 @@
//echo "<p>dyn-nbr: ".$tmp_number."</p>";
tag_add($RosCMS_GET_d_id, $RosCMS_GET_d_r_id, "number", $tmp_number,
"-1");
+
if ($RosCMS_GET_debug) echo "<p>add dynamic content number:
".$tmp_number."</p>";
+ }
+
+ if ($RosCMS_GET_d_type == "page") {
+ tag_add($RosCMS_GET_d_id, $RosCMS_GET_d_r_id, "extension",
"html", "-1");
}
@@ -954,40 +959,68 @@
function diff_entries($diff1, $diff2) {
global $roscms_security_level;
- global $h_a;
- global $h_a2;
+
+ if (substr($diff1, 0, 2) == "ar") {
+ $h1_a = "_a";
+ $h1_a2 = "a";
+ $h1_a3 = "ar";
+ $tmp_diff1 = substr($diff1, 2, strlen($diff1));
+ }
+ else {
+ $h1_a = "";
+ $h1_a2 = "";
+ $h1_a3 = "";
+ $tmp_diff1 = $diff1;
+ }
+
+ if (substr($diff2, 0, 2) == "ar") {
+ $h2_a = "_a";
+ $h2_a2 = "a";
+ $h2_a3 = "ar";
+ $tmp_diff2 = substr($diff2, 2, strlen($diff2));
+ }
+ else {
+ $h2_a = "";
+ $h2_a2 = "";
+ $h2_a3 = "";
+ $tmp_diff2 = $diff2;
+ }
+
+ //echo "<p>diff1: ".$tmp_diff1 ."</p>";
+ //echo "<p>diff2: ".$tmp_diff2 ."</p>";
+
// @TODO: add short text and optional long text additional entries
$query_diff1_data = mysql_query("SELECT d.data_id, d.data_name, d.data_type,
r.rev_id, r.rev_version, r.rev_language, r.rev_datetime, u.user_name, l.lang_name
- FROM data_ d, data_revision r, users u, languages l
+ FROM data_".$h1_a2." d, data_revision".$h1_a." r, users u,
languages l
WHERE r.data_id = d.data_id
- AND r.rev_id = '".mysql_real_escape_string($diff1)."'
+ AND r.rev_id = '".mysql_real_escape_string($tmp_diff1)."'
AND r.rev_usrid = u.user_id
AND r.rev_language = l.lang_id
LIMIT 1;");
$result_diff1_data = mysql_fetch_array($query_diff1_data);
$result_diff1_data_text = mysql_query("SELECT t.text_name, t.text_content
- FROM data_revision r, data_text t
+ FROM data_revision".$h1_a." r, data_text".$h1_a." t
WHERE r.rev_id = t.data_rev_id
- AND r.rev_id = '".mysql_real_escape_string($diff1)."'
+ AND r.rev_id = '".mysql_real_escape_string($tmp_diff1)."'
AND t.text_name = 'content'
ORDER BY text_name ASC;");
$result_diff1_data_text = mysql_fetch_array($result_diff1_data_text);
$query_diff2_data = mysql_query("SELECT d.data_id, d.data_name, d.data_type,
r.rev_id, r.rev_version, r.rev_language, r.rev_datetime, u.user_name, l.lang_name
- FROM data_ d, data_revision r, users u, languages l
+ FROM data_".$h2_a2." d, data_revision".$h2_a." r, users u,
languages l
WHERE r.data_id = d.data_id
- AND r.rev_id = '".mysql_real_escape_string($diff2)."'
+ AND r.rev_id = '".mysql_real_escape_string($tmp_diff2)."'
AND r.rev_usrid = u.user_id
AND r.rev_language = l.lang_id
LIMIT 1;");
$result_diff2_data = mysql_fetch_array($query_diff2_data);
$result_diff2_data_text = mysql_query("SELECT t.text_name, t.text_content
- FROM data_revision r, data_text t
+ FROM data_revision".$h2_a." r, data_text".$h2_a." t
WHERE r.rev_id = t.data_rev_id
- AND r.rev_id = '".mysql_real_escape_string($diff2)."'
+ AND r.rev_id = '".mysql_real_escape_string($tmp_diff2)."'
AND t.text_name = 'content'
ORDER BY text_name ASC;");
$result_diff2_data_text = mysql_fetch_array($result_diff2_data_text);
@@ -1046,43 +1079,114 @@
function diffcombobox($temp_rev_id, $temp_d_id, $tempd_name) {
$temp_cur_lang = "";
-
- $query_diff1_cbm = mysql_query("SELECT *
- FROM data_revision r, languages l
- WHERE r.data_id = '".mysql_real_escape_string($temp_d_id)."'
- AND r.rev_language = l.lang_id
- ORDER BY r.rev_datetime DESC;");
- while ($result_diff_cbm = mysql_fetch_array($query_diff1_cbm)) {
- if ($result_diff_cbm['rev_language'] != $temp_cur_lang) {
- if ($temp_cur_lang != "") {
- echo "</optgroup>";
- }
-
- $query_cur_lang = mysql_query("SELECT *
- FROM languages
- WHERE lang_id =
'".mysql_real_escape_string($result_diff_cbm['rev_language'])."'
- LIMIT 1;");
- $result_cur_lang = mysql_fetch_array($query_cur_lang);
-
- echo "<optgroup
label=\"".$result_cur_lang['lang_name']."\">";
-
- $temp_cur_lang = $result_diff_cbm['rev_language'];
- }
-
- echo "<option
value=\"".$result_diff_cbm['rev_id']."\"";
- if ($result_diff_cbm['rev_id'] == $temp_rev_id) {
- echo "selected=\"selected\"";
- }
- echo ">".$tempd_name;
-
- $temp_dynamic = getTagValue($result_diff_cbm['data_id'],
$result_diff_cbm['rev_id'], '-1', 'number');
- if ($temp_dynamic != "") {
- echo "_".$temp_dynamic;
- }
-
- echo " (".$result_diff_cbm['rev_date'].") - v.
".$result_diff_cbm['rev_version']."</option>";
- }
- echo "</optgroup>";
+ global $h_a;
+ global $h_a2;
+ global $RosCMS_GET_d_arch;
+
+ if ($RosCMS_GET_d_arch) {
+ $h1_a = "_a";
+ $h1_a2 = "a";
+ $h1_a3 = "ar";
+ $tmp_diff_revid = $temp_rev_id;
+ }
+ else if (substr($temp_rev_id, 0, 2) == "ar") {
+ $h1_a = "_a";
+ $h1_a2 = "a";
+ $h1_a3 = "ar";
+ $tmp_diff_revid = substr($temp_rev_id, 2, strlen($temp_rev_id));
+ }
+ else {
+ $h1_a = "";
+ $h1_a2 = "";
+ $h1_a3 = "";
+ $tmp_diff_revid = $temp_rev_id;
+ }
+
+
+ $query_get_data_name = mysql_query("SELECT data_name, data_type
+ FROM data_".$h1_a2."
+ WHERE data_id = '".mysql_real_escape_string($temp_d_id)."'
+ LIMIT 1;");
+ $result_get_data_name = mysql_fetch_array($query_get_data_name);
+
+ if ($RosCMS_GET_d_arch) { // archive mode
+ $query_get_data_name = mysql_query("SELECT data_name, data_type
+ FROM data_
+ WHERE data_name =
'".mysql_real_escape_string($result_get_data_name['data_name'])."'
+ AND data_type =
'".mysql_real_escape_string($result_get_data_name['data_type'])."'
+ LIMIT 1;");
+ $result_get_data_name = mysql_fetch_array($query_get_data_name);
+
+ $tmp_d_name = $result_get_data_name['data_name'];
+ $tmp_d_type = $result_get_data_name['data_type'];
+ }
+ else {
+ $tmp_d_name = $result_get_data_name['data_name'];
+ $tmp_d_type = $result_get_data_name['data_type'];
+ }
+
+ //echo
"<p>".$tmp_d_name."-".$tmp_d_type."</p>";
+
+
+ for ($i = 0; $i < 2; $i++) { // first loop = normal, second lopp = archive
+ if ($i == 1) {
+ echo "<option value=\"\"> </option>";
+ echo "<option value=\"\"> </option>";
+ echo '<option value="" style="color: rgb(119, 119,
119);"> ----- Archive -----</option>';
+ echo "<option value=\"\"> </option>";
+ $tmp_a = "_a";
+ $tmp_a2 = "a";
+ $tmp_a3 = "ar";
+ }
+ else {
+ $tmp_a = "";
+ $tmp_a2 = "";
+ $tmp_a3 = "";
+ }
+
+ $temp_cur_lang = "";
+
+ $query_diff1_cbm = mysql_query("SELECT d.data_id, d.data_name, r.rev_id,
r.rev_language, r.rev_version, r.rev_date, u.user_name
+ FROM data_".$tmp_a2." d, data_revision".$tmp_a." r,
languages l, users u
+ WHERE d.data_name =
'".mysql_real_escape_string($tmp_d_name)."'
+ AND d.data_type =
'".mysql_real_escape_string($tmp_d_type)."'
+ AND r.data_id = d.data_id
+ AND r.rev_language = l.lang_id
+ AND u.user_id = r.rev_usrid
+ ORDER BY r.rev_datetime DESC;");
+ while ($result_diff_cbm = mysql_fetch_array($query_diff1_cbm)) {
+ if ($result_diff_cbm['rev_language'] != $temp_cur_lang) {
+ if ($temp_cur_lang != "") {
+ echo "</optgroup>";
+ }
+
+ $query_cur_lang = mysql_query("SELECT *
+ FROM languages
+ WHERE lang_id =
'".mysql_real_escape_string($result_diff_cbm['rev_language'])."'
+ LIMIT 1;");
+ $result_cur_lang = mysql_fetch_array($query_cur_lang);
+
+ echo "<optgroup
label=\"".$result_cur_lang['lang_name']."\">";
+
+ $temp_cur_lang = $result_diff_cbm['rev_language'];
+ }
+
+ echo "<option
value=\"".$tmp_a3.$result_diff_cbm['rev_id']."\"";
+ if ($result_diff_cbm['rev_id'] == $tmp_diff_revid) {
+ echo "selected=\"selected\"";
+ }
+
+ echo ">".$tempd_name;
+
+ $temp_dynamic = getTagValue($result_diff_cbm['data_id'],
$result_diff_cbm['rev_id'], '-1', 'number');
+ if ($temp_dynamic != "") {
+ echo "_".$temp_dynamic;
+ }
+
+ echo " (".$result_diff_cbm['rev_date'].") - v.
".$result_diff_cbm['rev_version'].";
".$result_diff_cbm['user_name']."</option>";
+ }
+ echo "</optgroup>";
+ }
}
function changetags($entr_count, $entr_revid, $entr_flag) {
@@ -1211,6 +1315,7 @@
// generate related pages
require("inc/data_export_page.php");
+ log_event_generate_low("+++++
[generate_page_output_update(".$result_rev_data['data_id'].",
".$result_revision_stable['rev_language'].",
".$temp_dynamic.")]");
generate_page_output_update($result_rev_data['data_id'],
$result_revision_stable['rev_language'], $temp_dynamic);
}
else {
@@ -1227,13 +1332,21 @@
if ($entr_flag == "va") {
if ($RosCMS_GET_debug) echo
"<p>move_to_archive(".$result_rev_data['data_id'].",
".$result_rev_data['rev_id'].", 0);</p>";
move_to_archive($result_rev_data['data_id'],
$result_rev_data['rev_id'], 0);
- //if ($RosCMS_GET_debug) echo
"<p>deleteRevision(".$result_rev_data['rev_id'].");</p>";
- //deleteRevision($result_rev_data['rev_id']);
+ if ($RosCMS_GET_debug) echo
"<p>deleteRevision(".$result_rev_data['rev_id'].");</p>";
+ deleteRevision($result_rev_data['rev_id']);
}
// 'xe': delete entries
if ($entr_flag == "xe") {
- deleteRevision($result_rev_data['rev_id']);
+ if ($result_rev_data['rev_usrid'] == $roscms_intern_account_id ||
$roscms_security_level > 1) {
+ if ($roscms_security_level < 3) {
+ move_to_archive($result_rev_data['data_id'],
$result_rev_data['rev_id'], 0);
+ }
+ deleteRevision($result_rev_data['rev_id']);
+ }
+ else {
+ echo "Not enough rights for delete process.";
+ }
}
}
if ($RosCMS_GET_debug) echo "</ul>";
Modified:
trunk/web/reactos.org/htdocs/roscms/inc/data_export.php
URL:
http://svn.reactos.org/svn/reactos/trunk/web/reactos.org/htdocs/roscms/inc/…
==============================================================================
---
trunk/web/reactos.org/htdocs/roscms/inc/data_export.php (original)
+++
trunk/web/reactos.org/htdocs/roscms/inc/data_export.php Mon Aug 13 15:10:48 2007
@@ -26,6 +26,7 @@
global $roscms_intern_account_id;
global $roscms_security_level;
+ global $roscms_standard_language;
$RosCMS_GET_branch = "";
$RosCMS_GET_debug = "";
@@ -120,12 +121,16 @@
switch ($RosCMS_GET_d_use) {
default:
case "show":
+
+ $RosCMS_GET_d_value = str_replace("tr", "",
$RosCMS_GET_d_value); // remove "tr" so that it also work in translation view
+
if ( is_numeric($RosCMS_GET_d_value) ) {
$tmp_sql = " AND r.rev_id =
'".mysql_real_escape_string($RosCMS_GET_d_value)."' ";
}
else {
$tmp_sql = " AND d.data_name =
'".mysql_real_escape_string($RosCMS_GET_d_value)."'
- AND r.rev_language =
'".mysql_real_escape_string($RosCMS_GET_d_value2)."' ";
+ AND (r.rev_language =
'".mysql_real_escape_string($RosCMS_GET_d_value2)."'
+ OR r.rev_language =
'".mysql_real_escape_string($roscms_standard_language)."')";
}
$query_show_revision = mysql_query("SELECT d.data_name, r.rev_id, d.data_id,
r.rev_language
@@ -135,15 +140,18 @@
ORDER BY r.rev_version DESC
LIMIT 1;");
$result_show_revision = mysql_fetch_array($query_show_revision);
- $RosCMS_GET_d_value = $result_show_revision['data_name'];
- $RosCMS_GET_d_value2 = $result_show_revision['rev_language'];
+ $tmp_name = $result_show_revision['data_name'];
+ $tmp_lang = $RosCMS_GET_d_value2;
+ $tmp_nbr = "";
if ($RosCMS_GET_d_value3 == "") {
- $RosCMS_GET_d_value3 = get_tag($result_show_revision['data_id'],
$result_show_revision['rev_id'], "number");
+ //echo "<p>!!!</p>";
+ $tmp_nbr = get_tag($result_show_revision['data_id'],
$result_show_revision['rev_id'], "number");
}
//echo "<h1>preview</h1>\n";
//echo "<p>generate_page(".$RosCMS_GET_d_value.",
".$RosCMS_GET_d_value2.", ".$RosCMS_GET_d_value3.",
".$RosCMS_GET_d_use.")</p>";
log_event_generate_low("preview page:
generate_page(".$RosCMS_GET_d_value.", ".$RosCMS_GET_d_value2.",
".$RosCMS_GET_d_value3.", ".$RosCMS_GET_d_use.")");
- echo generate_page($RosCMS_GET_d_value, $RosCMS_GET_d_value2, $RosCMS_GET_d_value3,
$RosCMS_GET_d_use);
+ echo generate_page($tmp_name, $tmp_lang, $tmp_nbr, $RosCMS_GET_d_use);
+ //echo generate_page("sitemap", "en", "",
"show");
break;
case "output":
// @TODO
Modified:
trunk/web/reactos.org/htdocs/roscms/inc/data_export_page.php
URL:
http://svn.reactos.org/svn/reactos/trunk/web/reactos.org/htdocs/roscms/inc/…
==============================================================================
---
trunk/web/reactos.org/htdocs/roscms/inc/data_export_page.php (original)
+++
trunk/web/reactos.org/htdocs/roscms/inc/data_export_page.php Mon Aug 13 15:10:48 2007
@@ -32,50 +32,63 @@
function generate_page_output_update($g_data_id, $g_lang_id, $g_page_dynida) {
global $roscms_standard_language;
-
+
$query_data = mysql_query("SELECT *
FROM data_ d, data_revision r
WHERE r.data_id = '".mysql_real_escape_string($g_data_id)."'
AND r.data_id = d.data_id
- AND r.rev_language =
'".mysql_real_escape_string($g_lang_id)."'
+ AND (r.rev_language =
'".mysql_real_escape_string($g_lang_id)."'
+ OR r.rev_language =
'".mysql_real_escape_string($roscms_standard_language)."')
AND rev_version > 0
- LIMIT 1;");
- $result_data = mysql_fetch_array($query_data);
-
-
- if ($result_data['rev_language'] == $roscms_standard_language) {
+ LIMIT 2;");
+ $result_data = mysql_fetch_assoc($query_data);
+
+ // Try to get the dataset with rev_language == $g_lang, to boost the translated
content
+ if( mysql_num_rows($query_data) == 2 ) {
+ if( $result_data['rev_language'] == $roscms_standard_language ) {
+ $result_data = mysql_fetch_assoc($query_data);
+ }
+ }
+
+
+ if ($g_lang_id == $roscms_standard_language) {
$tmp_lang = "all";
}
else {
- $tmp_lang = $result_data['rev_language'];
- }
+ $tmp_lang = $g_lang_id;
+ }
+
+
+ log_event_generate_low("-=> ".$result_data['data_name']."
(".$tmp_lang.") type: ".$result_data['data_type']."
[generate_page_output_update(".$g_data_id.", ".$g_lang_id.",
".$g_page_dynida.")]");
switch ($result_data['data_type']) {
case 'page':
echo
"<p>generate_page_output(".$result_data['data_name'].",
".$tmp_lang.", ".$g_page_dynida.")</p>";
+ log_event_generate_low($result_data['data_name']."
(".$tmp_lang.") type: ".$result_data['data_type']."
".$g_page_dynida);
log_event_generate_medium($result_data['data_name']."
(".$tmp_lang.") ".$g_page_dynida);
generate_page_output($result_data['data_name'], $tmp_lang, $g_page_dynida);
break;
case 'template':
- echo
"<p>generate_update_helper(".$result_data['rev_language'].",
".$result_data['data_type'].",
".$result_data['data_name'].")</p>";
- generate_update_helper($result_data['rev_language'],
$result_data['data_type'], $result_data['data_name']);
+ echo "<p>generate_update_helper(".$tmp_lang.",
".$result_data['data_type'].",
".$result_data['data_name'].")</p>";
+ generate_update_helper($tmp_lang, $result_data['data_type'],
$result_data['data_name']);
break;
case 'content':
$tmp_dynamic = getTagValueG($result_data['data_id'],
$result_data['rev_id'], '-1', 'number'); // get dynamic content
number
if ($tmp_dynamic != "" && $result_data['data_type'] ==
"content") {
- echo "<p>#==>
".$result_data['data_name']."_".$g_page_dynida."
(".$result_data['data_type'].";
".$result_data['rev_language'].")</p>";
+ echo "<p>#==>
".$result_data['data_name']."_".$g_page_dynida."
(".$result_data['data_type'].";
".$tmp_lang.")</p>";
+ log_event_generate_low($result_data['data_name']."
(".$tmp_lang.") type: ".$result_data['data_type']."
".$g_page_dynida);
log_event_generate_medium($result_data['data_name']."
(".$tmp_lang.") ".$g_page_dynida);
generate_page_output($result_data['data_name'], $tmp_lang, $g_page_dynida);
}
else {
- echo
"<p>generate_update_helper(".$result_data['rev_language'].",
".$result_data['data_type'].",
".$result_data['data_name'].")</p>";
- generate_update_helper($result_data['rev_language'],
$result_data['data_type'], $result_data['data_name']);
+ echo "<p>generate_update_helper(".$tmp_lang.",
".$result_data['data_type'].",
".$result_data['data_name'].")</p>";
+ generate_update_helper($tmp_lang, $result_data['data_type'],
$result_data['data_name']);
}
break;
case 'script':
- echo
"<p>generate_update_helper(".$result_data['rev_language'].",
".$result_data['data_type'].",
".$result_data['data_name'].")</p>";
- generate_update_helper($result_data['rev_language'],
$result_data['data_type'], $result_data['data_name']);
+ echo "<p>generate_update_helper(".$tmp_lang.",
".$result_data['data_type'].",
".$result_data['data_name'].")</p>";
+ generate_update_helper($tmp_lang, $result_data['data_type'],
$result_data['data_name']);
break;
default:
case 'system':
@@ -105,7 +118,9 @@
break;
}
-
+ log_event_generate_low("-=© ".$h_lang." (".$h_like.")
type: ".$h_data_type);
+
+
$query_data = mysql_query("SELECT d.data_name, d.data_type, r.data_id, r.rev_id,
r.rev_language
FROM data_ d, data_revision r, data_text t
WHERE (d.data_type = 'page' ".$tmp_type_sql." )
@@ -126,17 +141,19 @@
if ($result_data['data_type'] == "page") {
echo "<p>=> ".$result_data['data_name']."
(".$result_data['data_type'].";
".$tmp_lang.")</p>";
+ log_event_generate_low($result_data['data_name']."
(".$tmp_lang.") type: ".$result_data['data_type']);
log_event_generate_medium($result_data['data_name']."
(".$tmp_lang.") ");
generate_page_output($result_data['data_name'], $tmp_lang, "");
}
else {
if ($tmp_dynamic != "" && $result_data['data_type'] ==
"content") {
- echo "<p>==>
".$result_data['data_name']."_".$tmp_dynamic."
(".$result_data['data_type'].";
".$result_data['rev_language'].")</p>";
+ echo "<p>==>
".$result_data['data_name']."_".$tmp_dynamic."
(".$result_data['data_type'].";
".$tmp_lang.")</p>";
+ log_event_generate_low($result_data['data_name']."
(".$tmp_lang.") type: ".$result_data['data_type']."
".$tmp_dynamic);
log_event_generate_medium($result_data['data_name']."
(".$tmp_lang.") ".$tmp_dynamic);
generate_page_output($result_data['data_name'], $tmp_lang, $tmp_dynamic);
}
- echo "<p> ~ ".$result_data['data_name']."
(".$result_data['data_type'].";
".$result_data['rev_language'].")</p>";
- generate_update_helper($result_data['rev_language'],
$result_data['data_type'], $result_data['data_name']);
+ echo "<p> ~ ".$result_data['data_name']."
(".$result_data['data_type'].";
".$tmp_lang.")</p>";
+ generate_update_helper($tmp_lang, $result_data['data_type'],
$result_data['data_name']);
}
}
}
@@ -232,21 +249,21 @@
- // file extention:
- $temp_extention = getTagValueG($result_g_page['data_id'],
$result_g_page['rev_id'], '-1', 'extention'); // get page
extention
-
- if ($temp_extention == "") {
- echo "<p><b>!! ".date("Y-m-d H:i:s")." - file
extention missing:
".$result_g_page['data_name']."(".$result_g_page['data_id'].",
".$result_g_page['rev_id'].",
".$result_g_lang['lang_id'].")</b></p>";
+ // file extension:
+ $temp_extension = getTagValueG($result_g_page['data_id'],
$result_g_page['rev_id'], '-1', 'extension'); // get page
extension
+
+ if ($temp_extension == "") {
+ echo "<p><b>!! ".date("Y-m-d H:i:s")." - file
extension missing:
".$result_g_page['data_name']."(".$result_g_page['data_id'].",
".$result_g_page['rev_id'].",
".$result_g_lang['lang_id'].")</b></p>";
continue;
}
// file name:
if ($temp_dynamic == "dynamic") {
- $RosCMS_current_page_out_file_pretty =
$result_g_lang['lang_id']."/".$result_g_page['data_name']."_".$temp_dynamic_number.".".$temp_extention;
+ $RosCMS_current_page_out_file_pretty =
$result_g_lang['lang_id']."/".$result_g_page['data_name']."_".$temp_dynamic_number.".".$temp_extension;
$RosCMS_current_page_out_file =
"../".$RosCMS_current_page_out_file_pretty;
}
else {
- $RosCMS_current_page_out_file_pretty =
$result_g_lang['lang_id']."/".$result_g_page['data_name'].".".$temp_extention;
+ $RosCMS_current_page_out_file_pretty =
$result_g_lang['lang_id']."/".$result_g_page['data_name'].".".$temp_extension;
$RosCMS_current_page_out_file =
"../".$RosCMS_current_page_out_file_pretty;
}
@@ -263,7 +280,7 @@
$fp = fopen($RosCMS_current_page_out_file, "w");
flock($fp,2);
fputs($fp,$RosCMS_current_page_content); // write content
- fputs($fp,"\n\n<!-- Generated with ".$roscms_extern_brand."
".$roscms_extern_version." (".$roscms_extern_version_detail.")
-->");
+ fputs($fp,"\n\n<!-- Generated with ".$roscms_extern_brand."
".$roscms_extern_version." (".$roscms_extern_version_detail.")
[#RosCMS_v3] -->");
flock($fp,3);
fclose($fp);
@@ -324,7 +341,7 @@
$g_log .= "<p>r.rev_id:
".$result_g_page['rev_id']."</p>";
$g_log .= "<p>Titel: ".get_stext($result_g_page['rev_id'],
"title")."</p>";
$g_log .= "<p>Description:
".get_stext($result_g_page['rev_id'],
"description")."</p>";
- $g_log .= "<p>Extention: ".get_stext($result_g_page['rev_id'],
"extention")."</p>";
+ $g_log .= "<p>extension: ".get_stext($result_g_page['rev_id'],
"extension")."</p>";
$g_log .= "<p>Content: ".get_text($result_g_page['rev_id'],
"content")."</p>";
*/
@@ -424,6 +441,7 @@
$RosCMS_result_template_temp = insert_match("template", $g_content_name,
$g_lang);
$RosCMS_result_template_temp = str_replace("[#cont_%NAME%]",
"[#cont_".$g_cur_page_name."]", $RosCMS_result_template_temp);
+ $RosCMS_result_template_temp = str_replace("[#%NAME%]", $g_cur_page_name,
$RosCMS_result_template_temp);
return $RosCMS_result_template_temp;
}
@@ -533,6 +551,8 @@
global $g_lang;
global $g_page_dynid;
global $g_linkstyle;
+ global $RosCMS_GET_d_value4;
+
$g_hyperlink_sql1 = "";
$g_hyperlink_sql2 = "";
@@ -553,6 +573,10 @@
if ($g_link_page_name == "") {
$RosCMS_current_page_link =
$roscms_intern_webserver_roscms."?page=data_out&d_f=page&d_u=show&d_val=index&d_val2=".$g_lang."&d_val3=";
+ }
+
+ if ($RosCMS_GET_d_value4 == "edit") {
+ $RosCMS_current_page_link .= "&d_val4=edit";
}
}
else { // static pages
@@ -564,13 +588,13 @@
AND rev_version > 0
LIMIT 1;");
$result_data = mysql_fetch_array($query_data);
- $RosCMS_current_page_link_extention = getTagValueG($result_data['data_id'],
$result_data['rev_id'], '-1', 'extention'); // get extention
-
- if ($RosCMS_current_page_link_extention == "") {
- $RosCMS_current_page_link_extention = "html";
- }
-
- $RosCMS_current_page_link =
$roscms_intern_webserver_pages.$g_lang."/".$g_link_page_name.".".$RosCMS_current_page_link_extention;
+ $RosCMS_current_page_link_extension = getTagValueG($result_data['data_id'],
$result_data['rev_id'], '-1', 'extension'); // get extension
+
+ if ($RosCMS_current_page_link_extension == "") {
+ $RosCMS_current_page_link_extension = "html";
+ }
+
+ $RosCMS_current_page_link =
$roscms_intern_webserver_pages.$g_lang."/".$g_link_page_name.".".$RosCMS_current_page_link_extension;
if ($g_link_page_name == "") {
$RosCMS_current_page_link =
$roscms_intern_webserver_pages.$g_lang."/404.html";
Modified:
trunk/web/reactos.org/htdocs/roscms/inc/data_export_xml.php
URL:
http://svn.reactos.org/svn/reactos/trunk/web/reactos.org/htdocs/roscms/inc/…
==============================================================================
---
trunk/web/reactos.org/htdocs/roscms/inc/data_export_xml.php (original)
+++
trunk/web/reactos.org/htdocs/roscms/inc/data_export_xml.php Mon Aug 13 15:10:48 2007
@@ -57,7 +57,7 @@
global $RosCMS_GET_d_filter2;
global $roscms_standard_language_full;
- $roscms_intern_entry_per_pag = 25;
+ $roscms_intern_entry_per_page = 25;
$roscms_d_stext = false;
$roscms_d_tags = false;
@@ -186,10 +186,10 @@
case "revid": // revision-id
$roscms_mtbl_order .= "r.rev_id ".$roscms_d_f2_typeb.", ";
break;
- case "ext": // page extention
+ case "ext": // page extension
$roscms_d_tags_counter++;
$roscms_mtbl_order .= " v".$roscms_d_tags_counter.".tv_value
".$roscms_d_f2_typeb.", ";
- $roscms_mtbl_order_where .= " AND
n".$roscms_d_tags_counter.".tn_name = 'extention' ";
+ $roscms_mtbl_order_where .= " AND
n".$roscms_d_tags_counter.".tn_name = 'extension' ";
break;
case "status": // status
$roscms_d_tags_counter++;
@@ -560,7 +560,7 @@
". $roscms_d_filter2 ."
". $roscms_mtbl_order_where;
//echo "<p>".$tzemp."</p>";
- //echo "<p>".$tzemp." LIMIT
".mysql_real_escape_string($RosCMS_GET_d_curpos) ." ,
".$roscms_intern_entry_per_pag.";</p>";
+ //echo "<p>".$tzemp." LIMIT
".mysql_real_escape_string($RosCMS_GET_d_curpos) ." ,
".$roscms_intern_entry_per_page.";</p>";
$query_xml_ptm_count = mysql_query($tzemp);
$result_xml_ptm_count = mysql_fetch_row($query_xml_ptm_count);
@@ -595,7 +595,7 @@
- $tdata .= " <view curpos=\"".$RosCMS_GET_d_curpos."\"
pagelimit=\"".$roscms_intern_entry_per_pag."\"
pagemax=\"".$result_xml_ptm_count[0]."\"
tblcols=\"".$roscms_mtbl_cols."\" /> \n";
+ $tdata .= " <view curpos=\"".$RosCMS_GET_d_curpos."\"
pagelimit=\"".$roscms_intern_entry_per_page."\"
pagemax=\"".$result_xml_ptm_count[0]."\"
tblcols=\"".$roscms_mtbl_cols."\" /> \n";
$sql_xml_ptm = "SELECT d.data_id, d.data_name, d.data_type, d.data_acl, r.rev_id,
r.rev_version, r.rev_language, r.rev_datetime, r.rev_date, r.rev_usrid
".$roscms_sql_stext2." ".$roscms_sql_tags2." ,
y.sec_lev".mysql_real_escape_string($roscms_security_level)."_write
@@ -611,7 +611,7 @@
". $roscms_d_filter2 ."
". $roscms_mtbl_order_where ."
". $roscms_mtbl_order ."
- LIMIT ".mysql_real_escape_string($RosCMS_GET_d_curpos)." ,
".$roscms_intern_entry_per_pag.";";
+ LIMIT ".mysql_real_escape_string($RosCMS_GET_d_curpos)." ,
".$roscms_intern_entry_per_page.";";
if ($RosCMS_GET_debug) {
echo "<p>".$sql_xml_ptm."</p>";
@@ -656,11 +656,6 @@
$tblentry_d_r_lang = $result_xml_ptm['rev_language'];
$tblentry_d_r_date = $result_xml_ptm['rev_datetime'];
$tblentry_d_r_usrid = $result_xml_ptm['rev_usrid'];
-
- $temp_dynamic = getTagValue($result_xml_ptm['data_id'],
$result_xml_ptm['rev_id'], '-1', 'number');
- if ($result_xml_ptm['data_type'] == "content" &&
$temp_dynamic != "") {
- $tblentry_d_name .= "_".$temp_dynamic;
- }
}
else { // translation
$query_xml_ptm_trans = mysql_query("SELECT d.data_id, d.data_name, d.data_type,
r.rev_id, r.rev_version, r.rev_language, r.rev_datetime, r.rev_date, r.rev_usrid
@@ -675,7 +670,7 @@
// echo "<p>DATE:
".$result_xml_ptm_trans['rev_datetime']."</p>";
if ($result_xml_ptm_trans['rev_datetime'] == "") { // translation
doesn't exist, so enable "translate mode"
- $temp_status = "transb";
+ $temp_status = "transb";
$tblentry_d_id2 = $result_xml_ptm['data_id'];
$tblentry_d_name = $result_xml_ptm['data_name'];
@@ -719,6 +714,11 @@
$tblentry_d_r_date = $result_xml_ptm_trans['rev_datetime'];
$tblentry_d_r_usrid = $result_xml_ptm_trans['rev_usrid'];
}
+ }
+
+ $temp_dynamic = getTagValue($result_xml_ptm['data_id'],
$result_xml_ptm['rev_id'], '-1', 'number');
+ if ($result_xml_ptm['data_type'] == "content" &&
$temp_dynamic != "") {
+ $tblentry_d_name .= "_".$temp_dynamic;
}
Modified:
trunk/web/reactos.org/htdocs/roscms/inc/data_list.php
URL:
http://svn.reactos.org/svn/reactos/trunk/web/reactos.org/htdocs/roscms/inc/…
==============================================================================
---
trunk/web/reactos.org/htdocs/roscms/inc/data_list.php (original)
+++
trunk/web/reactos.org/htdocs/roscms/inc/data_list.php Mon Aug 13 15:10:48 2007
@@ -35,14 +35,13 @@
$RosCMS_GET_cms_edit = "";
if (array_key_exists("edit", $_GET))
$RosCMS_GET_cms_edit=htmlspecialchars($_GET["edit"]);
- $roscms_intern_entry_per_pag = 25;
+ $roscms_intern_entry_per_page = 25;
if ($RosCMS_GET_debug) {
echo "<h1>DEBUG-Mode</h1>";
}
-?>
-<noscript>
+?><noscript>
<h3>RosCMS v3 requires Javascript, please activate/allow it.</h3>
<p>It does work fine in Internet Explorer 5.5+, Mozilla Firefox 1.5+, Opera 9.1+,
Safari 3.2+ and probably every client with basic Javascript (+AJAX) support.</p>
</noscript>
@@ -459,7 +458,8 @@
-->
</script>
- <style type="text/css">
+
+<style type="text/css">
<!--
.roscms_container {
@@ -1362,7 +1362,7 @@
load_frametable('script');
break;
case '7':
- filtstring2 =
'y_is_content_0|k_is_stable_0|i_is_default_0|c_is_user_0|l_is_<?php echo
$roscms_standard_language; ?>_0|r_is_'+translang+'|o_asc_name';
+ filtstring2 = 'y_is_content_0|k_is_stable_0<?php if ($roscms_security_level
== 1) { echo "|i_is_default_0"; } ?>|c_is_user_0|l_is_<?php echo
$roscms_standard_language; ?>_0|r_is_'+translang+'|o_asc_name';
load_frametable('translate');
break;
case '8':
@@ -1424,6 +1424,9 @@
case 'script':
case 'template':
tblcmdbar('script');
+ break;
+ case 'draft':
+ tblcmdbar('draft');
break;
case 'translate':
tblcmdbar('trans');
@@ -1759,7 +1762,7 @@
break;
case 'o': /* order by */
filtentryselstrs1 = '<select
id="sfb'+filterid+'"><option
value="asc">Ascending</option><option
value="desc">Descending</option></select>';
- filtentryselstrs2 = '<select
id="sfc'+filterid+'"><option value="datetime">Date
& Time</option><option
value="name">Name</option><option
value="lang">Language</option><option
value="usr">User</option><option
value="type">Type</option><option value="nbr">Number
("dynamic" entry)</option><?php if ($roscms_security_level > 1) {
?><option value="security"<?php echo $cbm_item_hide;
?>>Security</option><option value="revid"<?php echo
$cbm_item_hide; ?>>RevID</option><option value="ext"<?php echo
$cbm_item_hide; ?>>Extention</option><option
value="status"<?php echo $cbm_item_hide;
?>>Status</option><option value="kind"<?php echo
$cbm_item_hide; ?>>Kind</option><?php } ?></select>';
+ filtentryselstrs2 = '<select
id="sfc'+filterid+'"><option value="datetime">Date
& Time</option><option
value="name">Name</option><option
value="lang">Language</option><option
value="usr">User</option><option
value="type">Type</option><option value="nbr">Number
("dynamic" entry)</option><?php if ($roscms_security_level > 1) {
?><option value="security"<?php echo $cbm_item_hide;
?>>Security</option><option value="revid"<?php echo
$cbm_item_hide; ?>>RevID</option><option value="ext"<?php echo
$cbm_item_hide; ?>>Extension</option><option
value="status"<?php echo $cbm_item_hide;
?>>Status</option><option value="kind"<?php echo
$cbm_item_hide; ?>>Kind</option><?php } ?></select>';
break;
case 'i': /* security (ACL) */
filtentryselstrs1 = '<select
id="sfb'+filterid+'"><option
value="is">is</option><option value="no">is
not</option></select>';
@@ -2060,8 +2063,30 @@
<!--
function setlang(favlang) {
- //alert('set: '+userlang+' => '+favlang);
+ var tmp_regstr;
+
+ var transcheck = filtstring2.search(/r_is_/);
+
+ if (transcheck != -1) { // translation view
+ tmp_regstr = new RegExp('r_is_'+userlang, "g");
+ filtstring2 = filtstring2.replace(tmp_regstr, 'r_is_'+favlang);
+
+ tmp_regstr = new RegExp('r_is_<?php echo
$roscms_standard_language_trans; ?>', "g");
+ filtstring2 = filtstring2.replace(tmp_regstr, 'r_is_'+favlang);
+ }
+ else {
+ tmp_regstr = new RegExp('l_is_'+userlang, "g");
+ //alert('set: '+userlang+' => '+favlang);
+ //alert(tmp_regstr);
+ //alert('filtstring2:'+filtstring2);
+ //alert(filtstring2.replace(tmp_regstr, 'l_is_'+favlang));
+
+ filtstring2 = filtstring2.replace(tmp_regstr, 'l_is_'+favlang);
+ }
+
userlang = favlang;
+ filtpopulate(filtstring2);
+ load_frametable_cp2(roscms_current_tbl_position);
}
function getlang() {
@@ -2127,6 +2152,7 @@
<?php
}
?>
+ cmdhtml_select_xe2 = '<option
value="xe"> Delete</option>';
cmdhtml_select2 = '</select>';
@@ -2203,6 +2229,23 @@
cmdbarstr += cmdhtml_select_xe;
cmdbarstr += cmdhtml_select2;
break;
+ case 'draft':
+ cmdbarstr += cmdhtml_diff;
+ cmdbarstr += cmdhtml_preview;
+ cmdbarstr += cmdhtml_ready;
+ cmdbarstr += cmdhtml_stable;
+ cmdbarstr += cmdhtml_refresh;
+ cmdbarstr += cmdhtml_select1;
+ cmdbarstr += cmdhtml_select_as;
+ cmdbarstr += cmdhtml_select_xs;
+ cmdbarstr += cmdhtml_select_no;
+ cmdbarstr += cmdhtml_select_mn;
+ cmdbarstr += cmdhtml_select_ms;
+ cmdbarstr += cmdhtml_select_va;
+ cmdbarstr += cmdhtml_select_no;
+ cmdbarstr += cmdhtml_select_xe2;
+ cmdbarstr += cmdhtml_select2;
+ break;
case 'archive':
cmdbarstr += cmdhtml_refresh;
cmdbarstr += cmdhtml_select1;
@@ -2306,10 +2349,10 @@
}
-->
</script>
- <div style="border: 0px dashed red; position: absolute; right: 10px;
text-align:right; white-space: nowrap;"><strong><span
id="mtblnav"> </span></strong></div>
+ <div style="border: 0px dashed red; position: absolute; right: 10px;
text-align:right; white-space: nowrap;"><span
id="mtblnav"> </span></div>
<div class="tabselect">Select: <span
id="tabselect1"></span></div>
<div id="tablist"> </div>
- <div style="border: 0px dashed red; position: absolute; right: 10px;
text-align:right; white-space: nowrap;"><strong><span
id="mtbl2nav"> </span></strong></div>
+ <div style="border: 0px dashed red; position: absolute; right: 10px;
text-align:right; white-space: nowrap;"><span
id="mtbl2nav"> </span></div>
<div class="tabselect">Select: <span
id="tabselect2"></span></div>
</div>
<div id="frameedit" style="display: block; border: 0px dashed
red; ">
@@ -2495,12 +2538,8 @@
}
function bchangestar(did, drid, dtn, dtv, dusr, objid) {
- alert(objid);
+ //alert(objid);
//alert('bchangestar(did: '+did+', drid: '+drid+', dtn:
'+dtn+', dtv: '+dtv+', dusr: '+dusr+', objid:
'+objid+')');
-
- return;
-
- alert('wow');
if (did != '' && drid != '') {
if (document.getElementById(objid).src == '<?php echo
$roscms_intern_webserver_roscms; ?>images/star_on_small.gif') {
@@ -2515,45 +2554,53 @@
}
function prepair_edit_form_submit() {
- var poststr = "";
-
- //alert(document.getElementById("estextcount").className);
- //alert(document.getElementById("elmcount").className);
-
- /* short text */
- poststr +=
"pstextsum="+document.getElementById("estextcount").className;
- for (var i=1; i <=
document.getElementById("estextcount").className; i++) {
- poststr += "&pdstext"+i+"=" +
encodeURIComponent(document.getElementById("edstext"+i).innerHTML);
- poststr += "&pstext"+i+"=" +
encodeURIComponent(document.getElementById("estext"+i).value);
- }
-
- /* text */
- poststr +=
"&plmsum="+document.getElementById("elmcount").className;
- //alert('textanzahl:
'+document.getElementById("elmcount").className);
- var instatinymce;
- for (var i=1; i <= document.getElementById("elmcount").className;
i++) {
- poststr += "&pdtext"+i+"=" +
encodeURIComponent(document.getElementById("edtext"+i).innerHTML);
+ try {
+ var poststr = "";
+
+ //alert(document.getElementById("estextcount").className);
+ //alert(document.getElementById("elmcount").className);
- instatinymce = ajaxsaveContent("elm"+i); // get the content from
TinyMCE
-// alert(instatinymce);
- if (instatinymce != null) {
- <?php if ($RosCMS_GET_debug) { ?>
- alert('[TinMCE Text] i: '+i+'; mce-content:
'+instatinymce);
- <?php } ?>
- poststr += "&plm"+i+"=" +
encodeURIComponent(instatinymce);
-// alert('[TinMCE Text - 2.] i: '+i+'; mce-content:
'+poststr);
+ /* short text */
+ poststr +=
"pstextsum="+document.getElementById("estextcount").className;
+ for (var i=1; i <=
document.getElementById("estextcount").className; i++) {
+ poststr += "&pdstext"+i+"=" +
encodeURIComponent(document.getElementById("edstext"+i).innerHTML);
+ poststr += "&pstext"+i+"=" +
encodeURIComponent(document.getElementById("estext"+i).value);
}
- else {
- <?php if ($RosCMS_GET_debug) { ?>
- alert('[Plain Text] i: '+i+'; txt-content:
'+document.getElementById("elm"+i).value);
- <?php } ?>
- poststr += "&plm"+i+"=" +
encodeURIComponent(document.getElementById("elm"+i).value);
+
+ /* text */
+ poststr +=
"&plmsum="+document.getElementById("elmcount").className;
+ //alert('textanzahl:
'+document.getElementById("elmcount").className);
+ var instatinymce;
+ for (var i=1; i <= document.getElementById("elmcount").className;
i++) {
+ poststr += "&pdtext"+i+"=" +
encodeURIComponent(document.getElementById("edtext"+i).innerHTML);
+
+ instatinymce = ajaxsaveContent("elm"+i); // get the content from
TinyMCE
+ // alert(instatinymce);
+ if (instatinymce != null) {
+ <?php if ($RosCMS_GET_debug) { ?>
+ alert('[TinMCE Text] i: '+i+'; mce-content:
'+instatinymce);
+ <?php } ?>
+ poststr += "&plm"+i+"=" +
encodeURIComponent(instatinymce);
+ // alert('[TinMCE Text - 2.] i: '+i+'; mce-content:
'+poststr);
+ }
+ else {
+ <?php if ($RosCMS_GET_debug) { ?>
+ alert('[Plain Text] i: '+i+'; txt-content:
'+document.getElementById("elm"+i).value);
+ <?php } ?>
+ poststr += "&plm"+i+"=" +
encodeURIComponent(document.getElementById("elm"+i).value);
+ }
}
- }
-
-// alert ('content_ready: '+poststr);
-
- return poststr;
+
+ // alert ('content_ready: '+poststr);
+
+ return poststr;
+ }
+ catch (e) {
+ rtestop(); // destroy old rich text editor instances
+ window.clearTimeout(autosave_timer);
+ autosave_cache = '';
+ //alert('autosave bug stopped');
+ }
}
function edit_form_submit_draft(did, drid) {
@@ -2567,6 +2614,7 @@
load_frametable_cp2(roscms_current_tbl_position);
window.clearTimeout(autosave_timer);
+ autosave_cache = '';
alertbox('Draft saved');
}
@@ -2605,21 +2653,25 @@
load_frametable_cp2(roscms_current_tbl_position);
window.clearTimeout(autosave_timer);
+ autosave_cache = '';
alertbox('Entry saved');
}
function autosave_try(t_d_id, t_d_revid) {
window.clearTimeout(autosave_timer);
+ autosave_cache = '';
try {
if (document.getElementById("editautosavemode").value ==
'false') {
window.clearTimeout(autosave_timer);
+ autosave_cache = '';
//alert('autosave-end');
return;
}
}
catch (e) {
window.clearTimeout(autosave_timer);
+ autosave_cache = '';
return;
}
@@ -2694,8 +2746,10 @@
}
function diffentries2(revid1, revid2) { // called from diff area to
update/change entries for diff-process
- //alert('rev-ids: '+ revid1 +', '+ revid2);
- makeRequest('?page=data_out&d_f=text&d_u=mef&d_fl=diff&d_val='+encodeURIComponent(revid1)+'&d_val2='+encodeURIComponent(revid2),
'mef', 'diff2', 'html', 'GET', '');
+ if (revid1 != '' && revid2 != '') {
+ //alert('rev-ids: '+ revid1 +', '+ revid2);
+ makeRequest('?page=data_out&d_f=text&d_u=mef&d_fl=diff&d_val='+encodeURIComponent(revid1)+'&d_val2='+encodeURIComponent(revid2),
'mef', 'diff2', 'html', 'GET', '');
+ }
}
function diffentries3(revid1, revid2) { // called from diff area to
update/change entries for diff-process
@@ -2718,7 +2772,7 @@
if (tentrs[0] == 1) {
//secwind = window.open("<?php echo $roscms_intern_page_link;
?>data_out&d_f=page&d_u=show&d_val="+tentrs2[1]+"&d_val2=&d_val3=",
"RosCMSPagePreview",
"location=no,menubar=no,resizable=yes,status=yes,toolbar=no,scrollbars=yes,width=1000,height=800,left=20,top=20");
- secwind = window.open("<?php echo $roscms_intern_page_link;
?>data_out&d_f=page&d_u=show&d_val="+tentrs2[1]+"&d_val2=&d_val3=",
"RosCMSPagePreview");
+ secwind = window.open("<?php echo $roscms_intern_page_link;
?>data_out&d_f=page&d_u=show&d_val="+tentrs2[1]+"&d_val2="+userlang+"&d_val3=",
"RosCMSPagePreview");
//secwind.focus();
}
else {
@@ -2743,6 +2797,7 @@
if (ctk == 'ms') {
tmp_obj = 'changetags2';
+ alertbox('Please be patient, related pages get generated ...');
}
makeRequest('?page=data_out&d_f=text&d_u=mef&d_fl=changetags&d_val='+encodeURIComponent(tentrs[0])+'&d_val2='+encodeURIComponent(tentrs[1])+'&d_val3='+encodeURIComponent(ctk),
'mef', tmp_obj, 'html', 'GET', '');
@@ -2943,9 +2998,9 @@
page_table_populate(http_request, objid);
break;
case 'mef': /* main edit frame */
- if (objid == 'changetags2') {
- alertbox('Entry tagged as stable, please be patient while generating related
pages ...');
- }
+ /*if (objid == 'changetags2') {
+ alertbox('Please be patient, related pages get generated ...');
+ }*/
main_edit_load(http_request, objid);
break;
case 'asi': /* auto save info */
@@ -2963,16 +3018,18 @@
}
}
else {
- alert('There was a problem with the request ['+http_request.status+' /
'+http_request.readyState+']. \n\nA client (browser) or server problem. Please
check and try to update your browser. \n\nIf this error happens more than once or twice,
contac the website admin.');
- }
- }
- }
- catch( e ) {
+ alert('There was a problem with the request ['+http_request.status+' /
'+http_request.readyState+']. \n\nA client (browser) or server problem. Please
make sure you use an up-to-date browser client. \n\nIf this error happens more than once
or twice, contact the website admin.');
+ }
+ }
+ }
+ catch (e) {
if (roscms_page_load_finished == true) {
//alert(roscms_page_load_finished +' , '+ http_request.readyState +' ,
'+ http_request.status);
- alert('Info\n\nCaught Exception: ' + e.description +'\n\nIf this error
occur more than once or twice, please reload the page using the reload-link on the
top-right of the page. And if you get this info-message on a usual base, please contact
the website admin with the exact error message. \n\nIf you use the Safari or Firefox
browser, please make sure you run the latest version (some versions have related
bugs).');
+ //alert('Info\n\nCaught Exception: \nName: '+ e.name +'\nNumber: '+
e.number +'\nMessage: '+ e.message +'\nDescription: '+ e.description
+'\n\nIf this error occur more than once or twice, please reload the page using the
reload-link on the top-right of the page. And if you get this info-message on a usual
base, please contact the website admin with the exact error message. \n\nIf you use the
Safari or Firefox browser, please make sure you run the latest version (some versions have
related bugs).');
+ alertbox('RosCMS caught an exception to prevent data loss. If you see this
message several times, please make sure you use an up-to-date browser client. If the issue
still occur, tell the website admin the following information:<br />Name: '+
e.name +'; Number: '+ e.number +'; Message: '+ e.message +';
Description: '+ e.description);
}
}
+
// to prevent memory leak
http_request = null;
}
@@ -2981,11 +3038,28 @@
var lstData = "";
var temp_counter_loop = 0;
-
var xmldoc = http_request.responseXML;
var root_node = xmldoc.getElementsByTagName('root').item(0);
+
//alert(objid);
//alert(root_node.firstChild.data);
+
+ try {
+ if (root_node.firstChild.data) {
+ // temp
+ }
+ }
+ catch (e) {
+ nres = 0;
+ hlRows=false;
+ document.getElementById('mtblnav').innerHTML = ' ';
+ document.getElementById('mtbl2nav').innerHTML = ' ';
+ lstData = '<div class="tableswhitespace"><br /><br
/><b>No results, due an error in the filter settings or the data
metadata.</b><br /><br />If this happens more than a few times, please
contact the website admin with the following information:<br />Name: '+ e.name
+'<br />Number: '+ e.number +'<br />Message: '+ e.message
+'<br />ObjID: '+ objid +'<br />Request: <pre>'+
http_request +'</pre>'+ page_table_space(8)+'</div>';
+ document.getElementById(objid).innerHTML = lstData;
+ return;
+ }
+
+
if ((root_node.firstChild.data.search(/#none#/)) == -1) {
lstData = "";
//alert(xmldoc.getElementsByTagName("row").length);
@@ -3002,30 +3076,36 @@
roscms_current_tbl_position = xview[0].getAttributeNode("curpos").value;
- //alert(xview[0].getAttributeNode("curpos").value+' >= '+<?php
echo $roscms_intern_entry_per_pag; ?>*2);
- if (xview[0].getAttributeNode("curpos").value >= <?php echo
$roscms_intern_entry_per_pag; ?>*2) {
- mtblnavstr += '<span class="l"
onclick="load_frametable_cp(0)">«</span> ';
- }
-
- //alert(xview[0].getAttributeNode("curpos").value+' >= '+<?php
echo $roscms_intern_entry_per_pag; ?>);
+ //alert(xview[0].getAttributeNode("curpos").value+' >= '+<?php
echo $roscms_intern_entry_per_page; ?>*2);
+ if (xview[0].getAttributeNode("curpos").value >= <?php echo
$roscms_intern_entry_per_page; ?>*2) {
+ mtblnavstr += '<span class="l"
onclick="load_frametable_cp(0)"><b>«</b></span> ';
+ }
+
+ //alert(xview[0].getAttributeNode("curpos").value+' >= '+<?php
echo $roscms_intern_entry_per_page; ?>);
if (xview[0].getAttributeNode("curpos").value > 0) {
mtblnavstr += '<span class="l"
onclick="load_frametable_cp(';
- if (xview[0].getAttributeNode("curpos").value-<?php echo
$roscms_intern_entry_per_pag; ?>*1 >= 0) {
- mtblnavstr += xview[0].getAttributeNode("curpos").value-<?php echo
$roscms_intern_entry_per_pag; ?>*1;
+ if (xview[0].getAttributeNode("curpos").value-<?php echo
$roscms_intern_entry_per_page; ?>*1 >= 0) {
+ mtblnavstr += xview[0].getAttributeNode("curpos").value-<?php echo
$roscms_intern_entry_per_page; ?>*1;
}
else {
mtblnavstr += '0';
}
- mtblnavstr += ')">‹
Previous</span> ';
+ mtblnavstr += ')"><b>‹
Previous</b></span> ';
}
var mtblnavfrom = xview[0].getAttributeNode("curpos").value*1+1;
var mtblnavto = (xview[0].getAttributeNode("curpos").value*1) +
(xview[0].getAttributeNode("pagelimit").value*1);
+
+ /*mtblnavstr += '<select name="cbocurpage"
id="cbocurpage">';
+ mtblnavstr += ' <option>1 - 25</option>';
+ mtblnavstr += ' <option>26 - 50</option>';
+ mtblnavstr += '</select>';*/
+
mtblnavstr += '<b>'+mtblnavfrom+'</b> - <b>';
if (mtblnavto > xview[0].getAttributeNode("pagemax").value) {
- mtblnavstr +=xview[0].getAttributeNode("pagemax").value;
+ mtblnavstr += xview[0].getAttributeNode("pagemax").value;
}
else {
mtblnavstr += mtblnavto;
@@ -3033,17 +3113,17 @@
mtblnavstr += '</b> of
<b>'+xview[0].getAttributeNode("pagemax").value+'</b>';
- if (xview[0].getAttributeNode("curpos").value <
xview[0].getAttributeNode("pagemax").value-<?php echo
$roscms_intern_entry_per_pag; ?>*1) {
+ if (xview[0].getAttributeNode("curpos").value <
xview[0].getAttributeNode("pagemax").value-<?php echo
$roscms_intern_entry_per_page; ?>*1) {
mtblnavstr += ' <span class="l"
onclick="load_frametable_cp(';
- mtblnavstr += xview[0].getAttributeNode("curpos").value*1+<?php echo
$roscms_intern_entry_per_pag; ?>*1;
- mtblnavstr += ')">Next ›</span>';
- }
-
- //alert(xview[0].getAttributeNode("curpos").value+' < '+
(xview[0].getAttributeNode("pagemax").value*1-<?php echo
$roscms_intern_entry_per_pag; ?>*2));
- if (xview[0].getAttributeNode("curpos").value <
(xview[0].getAttributeNode("pagemax").value*1-<?php echo
$roscms_intern_entry_per_pag; ?>*2)) {
+ mtblnavstr += xview[0].getAttributeNode("curpos").value*1+<?php echo
$roscms_intern_entry_per_page; ?>*1;
+ mtblnavstr += ')"><b>Next
›</b></span>';
+ }
+
+ //alert(xview[0].getAttributeNode("curpos").value+' < '+
(xview[0].getAttributeNode("pagemax").value*1-<?php echo
$roscms_intern_entry_per_page; ?>*2));
+ if (xview[0].getAttributeNode("curpos").value <
(xview[0].getAttributeNode("pagemax").value*1-<?php echo
$roscms_intern_entry_per_page; ?>*2)) {
mtblnavstr += ' <span class="l"
onclick="load_frametable_cp(';
- mtblnavstr += xview[0].getAttributeNode("pagemax").value*1-<?php echo
$roscms_intern_entry_per_pag; ?>*1;
- mtblnavstr += ')">»</span>';
+ mtblnavstr += xview[0].getAttributeNode("pagemax").value*1-<?php echo
$roscms_intern_entry_per_page; ?>*1;
+ mtblnavstr += ')"><b>»</b></span>';
}
mtblnavstr += ' ';
@@ -3090,7 +3170,8 @@
//document.getElementById('txttabelle').value = lstData;
nres = (temp_counter_loop+1);
hlRows=true;
- window.setTimeout("add_js_extras()", 100); }
+ window.setTimeout("add_js_extras()", 100);
+ }
else {
nres = 0;
hlRows=false;
@@ -3275,7 +3356,7 @@
}
?>
load_frametable_cp(0);
- alertbox('Metadata changed');
+ alertbox('Action performed');
break;
case 'changetags2':
//alert('!!! changetags !!!'+http_request.responseText);
Modified:
trunk/web/reactos.org/htdocs/roscms/inc/data_maintain.php
URL:
http://svn.reactos.org/svn/reactos/trunk/web/reactos.org/htdocs/roscms/inc/…
==============================================================================
---
trunk/web/reactos.org/htdocs/roscms/inc/data_maintain.php (original)
+++
trunk/web/reactos.org/htdocs/roscms/inc/data_maintain.php Mon Aug 13 15:10:48 2007
@@ -24,7 +24,7 @@
global $roscms_intern_page_link;
- if (roscms_security_grp_member("ros_sadmin")) {
+ if ($roscms_security_level == 3) {
?>
<p> </p>
<h2>Maintain</h2>
@@ -32,9 +32,14 @@
<p> </p>
<?php
-/* require("inc/data_export_page.php");
-
- echo generate_page_output_update("210", "en", "");
+/*
+ require("inc/data_export_page.php");
+
+ echo generate_page_output_update("55", "en", "");
+ echo "<hr />";
+ echo generate_page_output_update("55", "de", "");
+
+ //echo generate_page_output("sitemap", "all", "",
"single");
echo "<hr />";
@@ -62,12 +67,39 @@
<p><a href="javascript:analyzedb()">Analyze Database
Tables</a></p>
<p> </p>
<p><a href="javascript:ppreview()">Page
Preview</a></p>
+ <div><label for="textfield">Entry-Name:</label> <input
name="textfield" type="text" id="textfield"
size="20" maxlength="100" />
+ <select id="txtaddentrytype" name="txtaddentrytype">
+ <option value="page"
selected="selected">Page</option>
+ <option value="content">Content</option>
+ <option value="template">Template</option>
+ <option value="script">Script</option>
+ <option value="system">System</option>
+ </select>
+ <select id="txtaddentrylang" name="txtaddentrylang">
+ <?php
+ $query_language = mysql_query("SELECT *
+ FROM languages
+ WHERE lang_level > '0'
+ ORDER BY lang_name ASC ;");
+ while($result_language=mysql_fetch_array($query_language)) {
+ echo '<option value="';
+ echo $result_language['lang_id'];
+ echo
'">'.$result_language['lang_name'].'</option>';
+
+ }
+ ?>
+ </select>
+ <input name="dynnbr" type="text" id="dynnbr"
size="3" maxlength="5" />
+ <input name="entryupdate" type="button"
value="generate" onclick="pupdate()" /></div>
+
<p><a href="javascript:genpages()">Generate All
Pages</a></p>
<div id="maintainarea" style="border: 1px dashed red;"
style="display:none;"></div>
<img id="ajaxloading" style="display:none;"
src="images/ajax_loading.gif" width="13" height="13" />
<p> </p>
<?php
+ if (roscms_security_grp_member("ros_sadmin")) {
+
echo "<p> </p>";
echo "<h2>RosCMS Global Log</h2>";
@@ -107,6 +139,7 @@
echo "<p> </p>";
}
+ }
?>
<script type="text/javascript" language="javascript">
<!--
@@ -131,6 +164,11 @@
function ppreview() {
secwind = window.open("<?php echo $roscms_intern_page_link;
?>data_out&d_f=page&d_u=show&d_val=index&d_val2=en",
"RosCMSPagePreview");
+ }
+
+ function pupdate() {
+ document.getElementById('maintainarea').style.display = 'block';
+ makeRequest('?page=data_out&d_f=maintain&d_u=pupdate&d_val='+encodeURIComponent(document.getElementById('textfield').value)+'&d_val2='+encodeURIComponent(document.getElementById('txtaddentrytype').value)+'&d_val3='+encodeURIComponent(document.getElementById('txtaddentrylang').value)+'&d_val4='+encodeURIComponent(document.getElementById('dynnbr').value),
'pupdate', 'maintainarea');
}
Modified:
trunk/web/reactos.org/htdocs/roscms/inc/data_maintain_out.php
URL:
http://svn.reactos.org/svn/reactos/trunk/web/reactos.org/htdocs/roscms/inc/…
==============================================================================
---
trunk/web/reactos.org/htdocs/roscms/inc/data_maintain_out.php (original)
+++
trunk/web/reactos.org/htdocs/roscms/inc/data_maintain_out.php Mon Aug 13 15:10:48
2007
@@ -26,6 +26,9 @@
global $RosCMS_GET_d_use;
global $RosCMS_GET_d_flag;
global $RosCMS_GET_d_value;
+ global $RosCMS_GET_d_value2;
+ global $RosCMS_GET_d_value3;
+ global $RosCMS_GET_d_value4;
require("inc/data_export_page.php");
@@ -59,4 +62,16 @@
log_event_generate_high("generate all pages - end: ".$showtimef."
seconds");
}
+ else if ($RosCMS_GET_d_use == "pupdate") {
+ echo "<h4>Generate related pages of ".$RosCMS_GET_d_value."
(".$RosCMS_GET_d_value2.", ".$RosCMS_GET_d_value3.",
".$RosCMS_GET_d_value4.")</h4>";
+
+ $query_entry = mysql_query("SELECT data_id
+ FROM data_
+ WHERE data_name =
'".mysql_real_escape_string($RosCMS_GET_d_value)."'
+ AND data_type =
'".mysql_real_escape_string($RosCMS_GET_d_value2)."'
+ LIMIT 1;");
+ $result_entry = mysql_fetch_array($query_entry);
+
+ echo generate_page_output_update($result_entry['data_id'],
$RosCMS_GET_d_value3, $RosCMS_GET_d_value4);
+ }
?>
Modified:
trunk/web/reactos.org/htdocs/roscms/inc/data_menu.php
URL:
http://svn.reactos.org/svn/reactos/trunk/web/reactos.org/htdocs/roscms/inc/…
==============================================================================
---
trunk/web/reactos.org/htdocs/roscms/inc/data_menu.php (original)
+++
trunk/web/reactos.org/htdocs/roscms/inc/data_menu.php Mon Aug 13 15:10:48 2007
@@ -235,7 +235,7 @@
<td> </td>
<?php } ?>
- <?php if (roscms_security_grp_member("ros_sadmin")) { ?>
+ <?php if ($roscms_security_level == 3) { ?>
<th class="int<?php if ($curmenu == "maintain") { echo
"2"; } else { echo "1"; } ?>"
onclick="roscms_mainmenu('maintain')"> <div
class="tc1">
<div class="tc2">
<div class="tc3"></div>