Author: dgoette Date: Thu Nov 20 13:25:28 2008 New Revision: 37487
URL: http://svn.reactos.org/svn/reactos?rev=37487&view=rev Log: implement new entry 'page & content' generation
Modified: branches/danny-web/reactos.org/htdocs/roscms/lib/Data.class.php branches/danny-web/reactos.org/htdocs/roscms/lib/Editor_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 13:25:28 2008 @@ -529,13 +529,11 @@ * @return bool * @access public */ - public static function add( $show_output = false, $dynamic_content = false, $entry_status = 'draft', $layout_template = '') + public static function add($data_type = null, $lang = null, $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); @@ -599,8 +597,8 @@ $stmt->execute(); }
- if ($layout_template != '' && $layout_template != 'no') { - $content = " '[#templ_".$layout_template."]' "; + if ($layout_template != '' && $layout_template != 'none') { + $content = '[#templ_'.$layout_template.']'; } else { $content = ''; @@ -645,12 +643,7 @@ new Editor_Website($data_id, $rev_id, 'show'); } } - - // nothing todo, even revision entry is already there - elseif ($show_output == true) { - echo '<p>Entry already exist.</p>'; - Editor_Website::showAddEntry(); - } + } // end of member function getCookieDomain
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 13:25:28 2008 @@ -48,6 +48,7 @@ protected function evalAction( $action ) { global $roscms_security_level; + global $roscms_standard_language; 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_r_lang; @@ -78,18 +79,18 @@
// single entry - save entry case 'newentry2': - Data::add(true, false); + Data::add(@$_GET['d_type'], @$_GET['d_r_lang'],true); break;
// dynamic entry - save entry case 'newentry4': - Data::add(true, true); + Data::add('content', $roscms_standard_language,true, true); break;
// page & content - save entry case 'newentry3': - Data::add(false, false, 'stable', htmlspecialchars(@$_GET['d_template'])); - Data::add(true); + Data::add('page', $roscms_standard_language, false, false, 'stable', htmlspecialchars(@$_GET['d_template'])); + Data::add('content', $roscms_standard_language, true); break;
// show Metadata details