[ Index ]

PHP Cross Reference of phpwcms V1.5.0 _r431 (28.01.12)

title

Body

[close]

/include/inc_lib/ -> article.readform.inc.php (source)

   1  <?php
   2  /*************************************************************************************
   3     Copyright notice
   4     
   5     (c) 2002-2012 Oliver Georgi <oliver@phpwcms.de> // All rights reserved.
   6   
   7     This script is part of PHPWCMS. The PHPWCMS web content management system is
   8     free software; you can redistribute it and/or modify it under the terms of
   9     the GNU General Public License as published by the Free Software Foundation;
  10     either version 2 of the License, or (at your option) any later version.
  11    
  12     The GNU General Public License can be found at http://www.gnu.org/copyleft/gpl.html
  13     A copy is found in the textfile GPL.txt and important notices to the license 
  14     from the author is found in LICENSE.txt distributed with these scripts.
  15    
  16     This script is distributed in the hope that it will be useful, but WITHOUT ANY 
  17     WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
  18     PARTICULAR PURPOSE.  See the GNU General Public License for more details.
  19   
  20     This copyright notice MUST APPEAR in all copies of the script!
  21  *************************************************************************************/
  22  
  23  
  24  // ----------------------------------------------------------------
  25  // obligate check for phpwcms constants
  26  if (!defined('PHPWCMS_ROOT')) {
  27     die("You Cannot Access This Script Directly, Have a Nice Day.");
  28  }
  29  // ----------------------------------------------------------------
  30  
  31  
  32  // read content type form vars
  33  if($content["aid"] != intval($_POST["caid"])) die("error: wrong form data!");
  34  
  35  
  36  $content["title"]             = clean_slweg($_POST["ctitle"]);
  37  $content["subtitle"]         = clean_slweg($_POST["csubtitle"]);
  38  $content["comment"]         = slweg($_POST["ccomment"]);
  39  $content["paginate_title"]    = clean_slweg($_POST["cpaginate_title"]);
  40  $content["paginate_page"]    = empty($_POST["cpaginate_page"]) ? 0 : intval($_POST["cpaginate_page"]);
  41  $content["visible"]         = empty($_POST["cvisible"]) ? 0 : 1;
  42  $content["before"]             = intval($_POST["cbefore"]);
  43  $content["after"]             = intval($_POST["cafter"]);
  44  $content["top"]             = isset($_POST["ctop"]) ? 1 : 0;
  45  $content["anchor"]             = isset($_POST["canchor"]) ? 1 : 0;
  46  $content["id"]                 = intval($_POST["cid"]);
  47  $content["granted"]         = empty($_POST["cgranted"]) ? 0 : 1;
  48  
  49  if(!empty($_POST['ctype_change_aid'])) {
  50  
  51      $ctype_change_aid    = intval($_POST['ctype_change_aid']);
  52      
  53      if($ctype_change_aid && $ctype_change_aid != $content["aid"]) {
  54      
  55          $ctype_change_aid    = _dbQuery('SELECT article_id FROM '.DB_PREPEND.'phpwcms_article WHERE article_id='.$ctype_change_aid.' AND article_deleted=0');
  56          if(!empty($ctype_change_aid[0]['article_id'])) {
  57              $content["aid"] = $ctype_change_aid[0]['article_id'];
  58              $ctype_change_aid = 'DO_CHANGE';
  59          }
  60      }
  61  }
  62  
  63  
  64  if(!$content["before"] || $content["before"] > 9999) $content["before"] = '';
  65  if(!$content["after"] || $content["after"] > 9999) $content["after"] = '';
  66  
  67  
  68  if(isset($_POST["target_ctype"])) {
  69                  
  70      $content["target_type"]    = explode(':', $_POST["target_ctype"]);
  71      $content["module"]        = empty($content["target_type"][1]) ? '' : trim($content["target_type"][1]);
  72      $content["target_type"]    = intval($content["target_type"][0]);
  73                  
  74  } else {
  75              
  76      $content["target_type"]    = 0;
  77      $content["module"]    = '';
  78              
  79  }
  80  
  81  $content["sorting"]     = intval($_POST["csorting"]);
  82  
  83  $content["block"]         = clean_slweg($_POST["cblock"]);
  84  // reset paginate page number to 0 > pagination support for CONTENT block only
  85  if($content["paginate_page"] && $content["block"] != 'CONTENT') {
  86      $content["paginate_page"] = 0;
  87  }
  88  
  89  
  90  $content["tab"] = '';
  91  if(!empty($_POST['ctab'])) {
  92      
  93      $content["tab_number"]    = empty($_POST['ctab_number']) ? 0 : intval($_POST['ctab_number']);
  94      $content["tab_title"]    = empty($_POST['ctab_title']) ? '' : clean_slweg($_POST['ctab_title'], 100);
  95      
  96      if($content["tab_number"] || $content["tab_title"]) {
  97          
  98          $content["tab"] = $content["tab_number"] . '_' . $content["tab_title"];
  99          
 100      }
 101  }
 102  
 103  
 104  $content["module"]         = empty($_POST["ctype_module"]) ? '' : clean_slweg($_POST["ctype_module"]);
 105  
 106  // check if content type possibly changed
 107  $content["update_type"] = ($content["target_type"] != $content["type"]) ? 1 : 0; 
 108  
 109  // read form vars for special content parts
 110  
 111  if($content["type"] != 30 && file_exists(PHPWCMS_ROOT."/include/inc_lib/content/cnt".$content["type"].".readform.inc.php")) {
 112      $content["module"]    = '';
 113      include_once(PHPWCMS_ROOT."/include/inc_lib/content/cnt".$content["type"].".readform.inc.php");
 114      
 115  } elseif($content["type"] == 30 && file_exists($phpwcms['modules'][$content['module']]['path'].'inc/cnt.post.php')) {
 116  
 117      include_once($phpwcms['modules'][$content['module']]['path'].'inc/cnt.post.php');
 118  
 119  } else {
 120      $content["module"]    = '';
 121      include_once (PHPWCMS_ROOT."/include/inc_lib/content/cnt0.readform.inc.php");
 122  
 123  }
 124  
 125  ?>


Generated: Sun Jan 29 16:31:14 2012 Cross-referenced by PHPXref 0.7.1