Author: dgoette
Date: Sat May 2 04:05:35 2009
New Revision: 399
URL:
http://svn.reactos.org/svn/reactos?rev=399&view=rev
Log:
use new icons; fix some more things spotted by colin; implement deletion of files, if a
page is deleted
Modified:
branches/danny-web/www/www.reactos.org/roscms/css/cms.css
branches/danny-web/www/www.reactos.org/roscms/js/cms_website.js
branches/danny-web/www/www.reactos.org/roscms/lib/HTML_CMS.class.php
branches/danny-web/www/www.reactos.org/roscms/lib/backend/Backend_EntryTabl…
branches/danny-web/www/www.reactos.org/roscms/lib/backend/Backend_Preview.c…
branches/danny-web/www/www.reactos.org/roscms/lib/om/Revision.class.php
branches/danny-web/www/www.reactos.org/roscms/lib/subsystem/Subsystem_Bugzi…
branches/danny-web/www/www.reactos.org/roscms/lib/subsystem/Subsystem_PHPBB…
branches/danny-web/www/www.reactos.org/roscms/lib/subsystem/Subsystem_Wiki.…
branches/danny-web/www/www.reactos.org/roscms/lib/view/HTML_CMS_Website.cla…
Modified:
branches/danny-web/www/www.reactos.org/roscms/css/cms.css
URL:
http://svn.reactos.org/svn/reactos/branches/danny-web/www/www.reactos.org/r…
==============================================================================
---
branches/danny-web/www/www.reactos.org/roscms/css/cms.css [iso-8859-1] (original)
+++
branches/danny-web/www/www.reactos.org/roscms/css/cms.css [iso-8859-1] Sat May 2
04:05:35 2009
@@ -93,7 +93,7 @@
.toolbar .button { text-align: center; cursor: pointer; float: left; padding: 2px 4px;
margin: 0px 4px 3px 0px; text-decoration: none; }
.toolbar .button:hover { background-color: #DAEBF9; border: 1px solid white; padding:
1px 3px; }
.toolbar .button:active { background-color: lightgrey; }
- .toolbar .button IMG { height: 16px; width: 16px; text-decoration: none; }
+ .toolbar .button IMG { height: 24px; width: 24px; text-decoration: none; }
.toolbar .button .text { display: block; color: #000099; white-space: nowrap; }
Modified:
branches/danny-web/www/www.reactos.org/roscms/js/cms_website.js
URL:
http://svn.reactos.org/svn/reactos/branches/danny-web/www/www.reactos.org/r…
==============================================================================
---
branches/danny-web/www/www.reactos.org/roscms/js/cms_website.js [iso-8859-1]
(original)
+++
branches/danny-web/www/www.reactos.org/roscms/js/cms_website.js [iso-8859-1] Sat May
2 04:05:35 2009
@@ -194,7 +194,7 @@
selectAll(false);
var sstar = status?'cStarOn':'cStarOff';
-alert(sstar);
+
// select choosen ones
for (var i=1; i<=nres; i++) {
if
(document.getElementById("tr"+i).getElementsByTagName('td')[1].getElementsByTagName('div')[0].className
== sstar) {
@@ -1362,6 +1362,9 @@
*/
function changeSelectedTags( ctk )
{
+ if (ctk === 'xe' && !confirm("Do you really want delete this
entry?") ) {
+ return false;
+ }
if (ctk === 'ms' || ctk === 'mn' || ctk === 'xe' || ctk ===
'va') {
var tentrs = selectedEntries().split("|");
@@ -2109,9 +2112,9 @@
// prepare some commands
var cmdhtml_space = ' ';
- var cmdhtml_diff = '<div class="button"
onclick="compareEntries()"><img
src="'+roscms_intern_webserver_roscms+'images/tool.gif" alt=""
/><span class="text">Compare</span></div>';
- var cmdhtml_preview = '<div class="button"
onclick="previewPage()"><img
src="'+roscms_intern_webserver_roscms+'images/search.gif"
alt="" /><span
class="text">Preview</span></div>';
- var cmdhtml_ready = '<div class="button"
onclick="changeSelectedTags(\'mn\')"><img
src="'+roscms_intern_webserver_roscms+'images/edit.gif" alt=""
/><span class="text">Suggest</span></div>';
+ var cmdhtml_diff = '<div class="button"
onclick="compareEntries()"><img
src="'+roscms_intern_webserver_roscms+'images/compare.png"
alt="" /><span
class="text">Compare</span></div>';
+ var cmdhtml_preview = '<div class="button"
onclick="previewPage()"><img
src="'+roscms_intern_webserver_roscms+'images/preview.png"
alt="" /><span
class="text">Preview</span></div>';
+ var cmdhtml_ready = '<div class="button"
onclick="changeSelectedTags(\'mn\')"><img
src="'+roscms_intern_webserver_roscms+'images/submit" alt=""
/><span class="text">to
<em>Pending</em></span></div>';
var cmdhtml_stable = '';
@@ -2120,13 +2123,13 @@
// mark stable / generate
if (roscms_access.make_stable) {
- cmdhtml_stable = '<div class="button"
onclick="changeSelectedTags(\'ms\')"><img
src="'+roscms_intern_webserver_roscms+'images/mail.gif" alt=""
/><span class="text">Publish</span></div>';
+ cmdhtml_stable = '<div class="button"
onclick="changeSelectedTags(\'ms\')"><img
src="'+roscms_intern_webserver_roscms+'images/publish.png"
alt="" /><span
class="text">Publish</span></div>';
}
// delete entries
if (roscms_access.del_entry) {
- cmdhtml_archive = '<div class="button"
onclick="changeSelectedTags(\'va\')"><img
src="'+roscms_intern_webserver_roscms+'images/rospc.gif"
alt="" /><span class="text">to
archive</span></div>';
- cmdhtml_delete = '<div class="button"
onclick="changeSelectedTags(\'xe\')"><img
src="'+roscms_intern_webserver_roscms+'images/delete.gif"
alt="" /><span
class="text">Delete</span></div>';
+ cmdhtml_archive = '<div class="button"
onclick="changeSelectedTags(\'va\')"><img
src="'+roscms_intern_webserver_roscms+'images/archive.png"
alt="" /><span class="text">to
<em>Archive</em</span></div>';
+ cmdhtml_delete = '<div class="button"
onclick="changeSelectedTags(\'xe\')"><img
src="'+roscms_intern_webserver_roscms+'images/delete.png"
alt="" /><span
class="text">Delete</span></div>';
}
Modified:
branches/danny-web/www/www.reactos.org/roscms/lib/HTML_CMS.class.php
URL:
http://svn.reactos.org/svn/reactos/branches/danny-web/www/www.reactos.org/r…
==============================================================================
---
branches/danny-web/www/www.reactos.org/roscms/lib/HTML_CMS.class.php [iso-8859-1]
(original)
+++
branches/danny-web/www/www.reactos.org/roscms/lib/HTML_CMS.class.php [iso-8859-1] Sat
May 2 04:05:35 2009
@@ -115,7 +115,7 @@
<th'.(($this->branch == 'website') ? '
class="active"' : '').'>
<div class="corner_TL">
<div class="corner_TR">
- <a class="text"
href="'.RosCMS::getInstance()->pathInstance().'?page=data&branch=website"
onclick="'."loadBranch()".'">Website</a>
+ <a class="text"
href="'.RosCMS::getInstance()->pathInstance().'?page=data&branch=website"
onclick="'."loadBranch()".'">Content</a>
</div>
</div>
</th>
Modified:
branches/danny-web/www/www.reactos.org/roscms/lib/backend/Backend_EntryTabl…
URL:
http://svn.reactos.org/svn/reactos/branches/danny-web/www/www.reactos.org/r…
==============================================================================
---
branches/danny-web/www/www.reactos.org/roscms/lib/backend/Backend_EntryTabl…
[iso-8859-1] (original)
+++
branches/danny-web/www/www.reactos.org/roscms/lib/backend/Backend_EntryTabl…
[iso-8859-1] Sat May 2 04:05:35 2009
@@ -118,7 +118,6 @@
// move to archiv
case 'va':
Revision::toArchive($revision['id']);
- Revision::deleteFile($revision['id']);
break;
} // end switch
} // end while
@@ -175,7 +174,7 @@
// delete everything
else {
- //Data::deleteFile($revision['id']);
+ Revision::deleteFile($revision['id']);
return Revision::delete($revision['id']);
}
Modified:
branches/danny-web/www/www.reactos.org/roscms/lib/backend/Backend_Preview.c…
URL:
http://svn.reactos.org/svn/reactos/branches/danny-web/www/www.reactos.org/r…
==============================================================================
---
branches/danny-web/www/www.reactos.org/roscms/lib/backend/Backend_Preview.c…
[iso-8859-1] (original)
+++
branches/danny-web/www/www.reactos.org/roscms/lib/backend/Backend_Preview.c…
[iso-8859-1] Sat May 2 04:05:35 2009
@@ -39,8 +39,8 @@
parent::__construct();
// remove "tr" so that it also work in translation view
- if (isset($_GET['rev'])) {
- $this->show($_GET['rev']);
+ if (isset($_GET['rev_id'])) {
+ $this->show($_GET['rev_id']);
}
else {
die('Request is not complete');
Modified:
branches/danny-web/www/www.reactos.org/roscms/lib/om/Revision.class.php
URL:
http://svn.reactos.org/svn/reactos/branches/danny-web/www/www.reactos.org/r…
==============================================================================
---
branches/danny-web/www/www.reactos.org/roscms/lib/om/Revision.class.php [iso-8859-1]
(original)
+++
branches/danny-web/www/www.reactos.org/roscms/lib/om/Revision.class.php [iso-8859-1]
Sat May 2 04:05:35 2009
@@ -323,15 +323,50 @@
*/
public static function deleteFile( $rev_id )
{
+ $config=&RosCMS::getInstance();
+
// only for admins
if (!ThisUser::getInstance()->hasAccess('delete_file')) {
return;
}
- //@TODO implement adding to job queue
- $stmt=&DBConnection::getInstance()->prepare("INSERT INTO
".ROSCMST_JOBS." (name, content) VALUES('stub','stub')");
- $stmt->bindParam('rev_id',$rev_id,PDO::PARAM_INT);
- $stmt->execute();
+ // get data name
+ $stmt=&DBConnection::getInstance()->prepare("SELECT d.name, r.lang_id
FROM ".ROSCMST_ENTRIES." d JOIN ".ROSCMST_REVISIONS." r ON
r.data_id=d.id WHERE r.id=:rev_id AND d.type='page'");
+ $stmt->bindParam('rev_id',$rev_id,PDO::PARAM_INT);
+ $stmt->execute();
+ $info = $stmt->fetch(PDO::FETCH_ASSOC);
+ if($info !== null) {
+
+ // and we need the file extension
+ $extension = '.'.Tag::getValue($rev_id,'extension',-1);
+
+ // delete for all languages
+ if ($config->multilanguage()) {
+
+ // if entry is of standard language -> delete all language entries
+ if ($info['lang_id'] == Language::getStandardId()) {
+ $stmt=&DBConnection::getInstance()->prepare("SELECT name_short FROM
".ROSCMST_LANGUAGES);
+ }
+ // just delete the entry of his own language
+ else {
+ $stmt=&DBConnection::getInstance()->prepare("SELECT name_short FROM
".ROSCMST_LANGUAGES." WHERE id=:lang_id ");
+ $stmt->bindValue('lang_id',$info['lang_id'],PDO::PARAM_INT);
+ }
+
+ // language specific deletion
+ $stmt->execute();
+ while ($lang = $stmt->fetch(PDO::FETCH_ASSOC)) {
+
unlink($config->pathGenerated().$lang['name_short'].'/'.$info['name'].$extension);
+ }
+
+ }
+
+ // single language mode
+ else {
+ unlink($config->pathGenerated().$info['name'].$extension);
+ }
+ }
+
} // end of member function deleteFile
Modified:
branches/danny-web/www/www.reactos.org/roscms/lib/subsystem/Subsystem_Bugzi…
URL:
http://svn.reactos.org/svn/reactos/branches/danny-web/www/www.reactos.org/r…
==============================================================================
---
branches/danny-web/www/www.reactos.org/roscms/lib/subsystem/Subsystem_Bugzi…
[iso-8859-1] (original)
+++
branches/danny-web/www/www.reactos.org/roscms/lib/subsystem/Subsystem_Bugzi…
[iso-8859-1] Sat May 2 04:05:35 2009
@@ -134,7 +134,7 @@
// email or name is already used -> cancel
if ($exists > 0) {
- echo 'User name ('.$user_name.') and/or email address
('.$user_email.') collision<br />';
+ echo 'Bugzilla: User name ('.$user_name.') and/or email address
('.$user_email.') collision<br />';
return false;
}
Modified:
branches/danny-web/www/www.reactos.org/roscms/lib/subsystem/Subsystem_PHPBB…
URL:
http://svn.reactos.org/svn/reactos/branches/danny-web/www/www.reactos.org/r…
==============================================================================
---
branches/danny-web/www/www.reactos.org/roscms/lib/subsystem/Subsystem_PHPBB…
[iso-8859-1] (original)
+++
branches/danny-web/www/www.reactos.org/roscms/lib/subsystem/Subsystem_PHPBB…
[iso-8859-1] Sat May 2 04:05:35 2009
@@ -121,7 +121,7 @@
$stmt->bindParam('user_id',$subsys_user,PDO::PARAM_INT);
$stmt->execute() or die('DB error (subsys_phpbb #7)');
if ($stmt->fetchColumn() > 0) {
- echo 'User name ('.$user_name.') and/or email address
('.$user_email.') collision<br />';
+ echo 'Forum: User name ('.$user_name.') and/or email address
('.$user_email.') collision<br />';
return false;
}
Modified:
branches/danny-web/www/www.reactos.org/roscms/lib/subsystem/Subsystem_Wiki.…
URL:
http://svn.reactos.org/svn/reactos/branches/danny-web/www/www.reactos.org/r…
==============================================================================
---
branches/danny-web/www/www.reactos.org/roscms/lib/subsystem/Subsystem_Wiki.…
[iso-8859-1] (original)
+++
branches/danny-web/www/www.reactos.org/roscms/lib/subsystem/Subsystem_Wiki.…
[iso-8859-1] Sat May 2 04:05:35 2009
@@ -125,7 +125,7 @@
// stop if one of both already exists
if ($stmt->fetchColumn() > 0) {
- echo 'User name ('.$user_name.') and/or email address
('.$user_email.') collision<br />';
+ echo 'Wiki: User name ('.$user_name.') and/or email address
('.$user_email.') collision<br />';
return false;
}
Modified:
branches/danny-web/www/www.reactos.org/roscms/lib/view/HTML_CMS_Website.cla…
URL:
http://svn.reactos.org/svn/reactos/branches/danny-web/www/www.reactos.org/r…
==============================================================================
---
branches/danny-web/www/www.reactos.org/roscms/lib/view/HTML_CMS_Website.cla…
[iso-8859-1] (original)
+++
branches/danny-web/www/www.reactos.org/roscms/lib/view/HTML_CMS_Website.cla…
[iso-8859-1] Sat May 2 04:05:35 2009
@@ -257,7 +257,7 @@
</div>
<div class="toolbar">
<div class="button"
onclick="loadEntryTableWithOffset(roscms_current_tbl_position)">
- <img
src="'.RosCMS::getInstance()->pathRosCMS().'images/reload.gif"
alt="" />
+ <img
src="'.RosCMS::getInstance()->pathRosCMS().'images/refresh.png"
alt="" />
<span class="text">Refresh</span>
</div>
<div id="toolbarExtension"></div>