Author: dgoette Date: Thu Nov 20 07:14:38 2008 New Revision: 37482
URL: http://svn.reactos.org/svn/reactos?rev=37482&view=rev Log: * fix more html issues * now adding entries is possible again * catch an additional error
Modified: branches/danny-web/reactos.org/htdocs/roscms/lib/Data.class.php branches/danny-web/reactos.org/htdocs/roscms/lib/Editor_Website.class.php branches/danny-web/reactos.org/htdocs/roscms/lib/Export_QuickInfo.class.php branches/danny-web/reactos.org/htdocs/roscms/lib/HTML_CMS.class.php branches/danny-web/reactos.org/htdocs/roscms/lib/HTML_CMS_Website.class.php
Modified: branches/danny-web/reactos.org/htdocs/roscms/lib/Data.class.php URL: http://svn.reactos.org/svn/reactos/branches/danny-web/reactos.org/htdocs/ros... ============================================================================== --- branches/danny-web/reactos.org/htdocs/roscms/lib/Data.class.php [iso-8859-1] (original) +++ branches/danny-web/reactos.org/htdocs/roscms/lib/Data.class.php [iso-8859-1] Thu Nov 20 07:14:38 2008 @@ -25,12 +25,6 @@ */ class Data { - - /** Aggregations: */ - - /** Compositions: */ - - /*** Attributes: ***/
/** @@ -535,9 +529,13 @@ * @return bool * @access public */ - public static function add( $data_name, $data_type, $lang, $show_output = false, $entry_status = 'draft', $layout_template = '', $dynamic_content = false) + public static function add( $show_output = false, $dynamic_content = false, $entry_status = 'draft', $layout_template = '') { global $roscms_intern_account_id; + + $data_name = @htmlspecialchars($_GET['d_name']); + $data_type = @$_GET['d_type']; + $lang = @$_GET['d_r_lang'];
$stmt=DBConnection::getInstance()->prepare("SELECT data_id FROM data_ WHERE data_name = :name AND data_type = :type LIMIT 1"); $stmt->bindParam('name',$data_name,PDO::PARAM_STR);
Modified: branches/danny-web/reactos.org/htdocs/roscms/lib/Editor_Website.class.php URL: http://svn.reactos.org/svn/reactos/branches/danny-web/reactos.org/htdocs/ros... ============================================================================== --- branches/danny-web/reactos.org/htdocs/roscms/lib/Editor_Website.class.php [iso-8859-1] (original) +++ branches/danny-web/reactos.org/htdocs/roscms/lib/Editor_Website.class.php [iso-8859-1] Thu Nov 20 07:14:38 2008 @@ -50,8 +50,8 @@ global $roscms_security_level; global $RosCMS_GET_d_value, $RosCMS_GET_d_value2, $RosCMS_GET_d_value3, $RosCMS_GET_d_value4; global $RosCMS_GET_d_id, $RosCMS_GET_d_r_id; - global $RosCMS_GET_d_name, $RosCMS_GET_d_type, $RosCMS_GET_d_r_lang; - + global $RosCMS_GET_d_r_lang; + switch ($action) {
// create entry - show interface @@ -78,18 +78,18 @@
// single entry - save entry case 'newentry2': - Data::add($RosCMS_GET_d_name, $RosCMS_GET_d_type, $RosCMS_GET_d_r_lang, true, 'draft', '', false); + Data::add(true, false); break;
// dynamic entry - save entry case 'newentry4': - Data::add($RosCMS_GET_d_name, $RosCMS_GET_d_type, $RosCMS_GET_d_r_lang, true, 'draft', '', true); + Data::add(true, true); break;
// page & content - save entry case 'newentry3': - Data::add($RosCMS_GET_d_name, $RosCMS_GET_d_type, $RosCMS_GET_d_r_lang, false, 'stable', htmlspecialchars(@$_GET['d_template']), false); - Data::add($RosCMS_GET_d_name, $RosCMS_GET_d_type, $RosCMS_GET_d_r_lang, true); + Data::add(false, false, 'stable', htmlspecialchars(@$_GET['d_template'])); + Data::add(true); break;
// show Metadata details @@ -225,8 +225,10 @@ $stmt->bindParam('date',date('Y-m-d'),PDO::PARAM_STR); $stmt->execute(); $translation = $stmt->fetchOnce(); - - $this->show( $translation['data_id'], $translation['rev_id'], $translation['rev_language'] ); + + $this->data_id = $translation['data_id']; + $this->rev_id = $translation['rev_id']; + $this->show(); } else { die('Translation not successful, due entry-copy problem. If this happens more than once or twice please contact the website admin.'); @@ -244,13 +246,8 @@ * * @access private */ - protected function show( $lang = null) - { - global $roscms_standard_language; - - // if no value is given, try to omnit GET vars - if ($lang === null) $lang = (isset($_GET['d_r_lang']) ? $_GET['d_r_lang'] : $roscms_standard_language); - + protected function show( ) + { $this->showEntryData(); $this->showEntryDetails(self::METADATA); echo '</div></div>'; // close elements opened in showEntryData @@ -421,7 +418,7 @@ * * @access protected */ - protected function showAddEntry($tmode = self::SINGLE) + public function showAddEntry($tmode = self::SINGLE) { echo_strip(' <div id="frmadd" style="border-bottom: 1px solid #bbb; border-right: 1px solid #bbb; background: #FFFFFF none repeat scroll 0%;"> @@ -436,7 +433,7 @@ else { echo '<span class="detailmenu" onclick="'."changecreateinterface('single')".'">Single Entry</span>'; } - echo " | "; + echo ' | ';
// is dynamic if ($tmode == self::DYNAMIC) { @@ -445,7 +442,7 @@ else { echo '<span class="detailmenu" onclick="'."changecreateinterface('dynamic')".'">Dynamic Entry</span>'; } - echo " | "; + echo ' | ';
// is page & content if ($tmode == self::TEMPLATE) {
Modified: branches/danny-web/reactos.org/htdocs/roscms/lib/Export_QuickInfo.class.php URL: http://svn.reactos.org/svn/reactos/branches/danny-web/reactos.org/htdocs/ros... ============================================================================== --- branches/danny-web/reactos.org/htdocs/roscms/lib/Export_QuickInfo.class.php [iso-8859-1] (original) +++ branches/danny-web/reactos.org/htdocs/roscms/lib/Export_QuickInfo.class.php [iso-8859-1] Thu Nov 20 07:14:38 2008 @@ -32,8 +32,7 @@
// check if everything was given, we need to get the quick info if (!isset($_GET['d_id']) || !isset($_GET['d_r_id'])) { - echo 'No entry was found.'; - return; + die('No entry was found.'); } $this->getInfo(); } @@ -58,6 +57,11 @@ $stmt->bindParam('rev_id',$_GET['d_r_id'],PDO::PARAM_INT); $stmt->execute(); $revision = $stmt->fetchOnce(PDO::FETCH_ASSOC); + + // abort if no entry was found + if ($revision === false) { + die('No entry was found.'); + }
// helper vars $t_s = '<span style="color:#FF6600;">'; // tag start
Modified: branches/danny-web/reactos.org/htdocs/roscms/lib/HTML_CMS.class.php URL: http://svn.reactos.org/svn/reactos/branches/danny-web/reactos.org/htdocs/ros... ============================================================================== --- branches/danny-web/reactos.org/htdocs/roscms/lib/HTML_CMS.class.php [iso-8859-1] (original) +++ branches/danny-web/reactos.org/htdocs/roscms/lib/HTML_CMS.class.php [iso-8859-1] Thu Nov 20 07:14:38 2008 @@ -163,9 +163,9 @@ break;
case 'website': - echo_strip('Quick Links: <a href="'.$roscms_intern_page_link.'data&branch=welcome#web_news_langgroup">Translation Group News</a> - | <a href="'.$roscms_intern_webserver_pages.'?page=tutorial_roscms" target="_blank">Text- & Video-Tutorials</a> - | <a href="'.$roscms_intern_webserver_pages.'/forum/viewforum.php?f=18" target="_blank">Website Forum</a>'); + echo_strip('Quick Links: <a href="'.$roscms_intern_page_link.'data&branch=welcome#web_news_langgroup">Translation Group News</a> + | <a href="'.$roscms_intern_webserver_pages.'?page=tutorial_roscms">Text- & Video-Tutorials</a> + | <a href="'.$roscms_intern_webserver_pages.'/forum/viewforum.php?f=18">Website Forum</a>'); break;
case 'user':
Modified: branches/danny-web/reactos.org/htdocs/roscms/lib/HTML_CMS_Website.class.php URL: http://svn.reactos.org/svn/reactos/branches/danny-web/reactos.org/htdocs/ros... ============================================================================== --- branches/danny-web/reactos.org/htdocs/roscms/lib/HTML_CMS_Website.class.php [iso-8859-1] (original) +++ branches/danny-web/reactos.org/htdocs/roscms/lib/HTML_CMS_Website.class.php [iso-8859-1] Thu Nov 20 07:14:38 2008 @@ -345,8 +345,8 @@ </div> </div> <br /> - <p><strong>Table Legend</strong></p> <table id="legend" cellspacing="5"> + <caption style="font-weight:bold;text-align:left;">Table Legend</caption> <tr> <td class="lbox" style="background-color:#ddd"> </td> <td style="width:205px" rowspan="2"> @@ -372,7 +372,7 @@ <td class="lbox" style="background-color:#FFE4C1"> </td> <td>Draft</td> <td class="lbox" style="background-color:#FAA5A5"> </td> - <td>Translation outdated</td> + <td>Translation outdated</td> </tr> <tr> <td class="lbox" style="background-color:#ffffcc"> </td>