[ Index ] |
|
Code source de e107 0.7.8 |
1 <?php 2 /* 3 +---------------------------------------------------------------+ 4 | e107 website system 5 | /admin/review.php 6 | 7 | ©Steve Dunstan 2001-2002 8 | http://e107.org 9 | jalist@e107.org 10 | 11 | Released under the terms and conditions of the 12 | GNU General Public License (http://gnu.org). 13 | 14 | $Source: /cvsroot/e107/e107_0.7/e107_plugins/content/content_manager.php,v $ 15 | $Revision: 1.24 $ 16 | $Date: 2006/12/07 12:57:01 $ 17 | $Author: mrpete $ 18 +---------------------------------------------------------------+ 19 */ 20 21 require_once ("../../class2.php"); 22 23 $plugindir = e_PLUGIN."content/"; 24 require_once ($plugindir."content_shortcodes.php"); 25 26 global $tp; 27 require_once(e_HANDLER."userclass_class.php"); 28 require_once(e_HANDLER."form_handler.php"); 29 $rs = new form; 30 e107_require_once(e_HANDLER.'arraystorage_class.php'); 31 $eArrayStorage = new ArrayData(); 32 require_once(e_HANDLER."file_class.php"); 33 $fl = new e_file; 34 require_once ($plugindir."handlers/content_class.php"); 35 $aa = new content; 36 require_once ($plugindir."handlers/content_db_class.php"); 37 $adb = new contentdb; 38 require_once ($plugindir."handlers/content_form_class.php"); 39 $aform = new contentform; 40 41 $lan_file = $plugindir.'languages/'.e_LANGUAGE.'/lan_content_admin.php'; 42 include_once(file_exists($lan_file) ? $lan_file : $plugindir.'languages/English/lan_content_admin.php'); 43 44 $lan_file = $plugindir.'languages/'.e_LANGUAGE.'/lan_content.php'; 45 include_once(file_exists($lan_file) ? $lan_file : $plugindir.'languages/English/lan_content.php'); 46 47 $deltest = array_flip($_POST); 48 49 if(e_QUERY){ 50 $qs = explode(".", e_QUERY); 51 } 52 53 // define e_pagetitle 54 $aa -> setPageTitle(); 55 56 //if(preg_match("#(.*?)_delete_(\d+)#",$deltest[$tp->toJS("delete")],$matches)){ 57 // $delete = $matches[1]; 58 // $del_id = $matches[2]; 59 //} 60 61 if(isset($_POST['delete'])){ 62 $tmp = array_pop(array_flip($_POST['delete'])); 63 list($delete, $del_id) = explode("_", $tmp); 64 } 65 66 //these have to be set for the tinymce wysiwyg 67 $e_wysiwyg = "content_text"; 68 69 //include js 70 function headerjs(){ 71 echo "<script type='text/javascript' src='".e_FILE."popup.js'></script>\n"; 72 } 73 // ##### DB --------------------------------------------------------------------------------------- 74 75 require_once(HEADERF); 76 77 if(isset($_POST['create_content'])){ 78 if($_POST['content_text'] && $_POST['content_heading'] && $_POST['parent'] != "none"){ 79 $adb -> dbContent("create", "contentmanager"); 80 }else{ 81 $message = CONTENT_ADMIN_ITEM_LAN_0; 82 } 83 } 84 85 if(isset($_POST['update_content'])){ 86 if($_POST['content_text'] && $_POST['content_heading'] && $_POST['parent'] != "none"){ 87 $adb -> dbContent("update", "contentmanager"); 88 }else{ 89 $message = CONTENT_ADMIN_ITEM_LAN_0; 90 } 91 } 92 93 if($delete == 'content' && is_numeric($del_id)){ 94 if($sql -> db_Delete($plugintable, "content_id='$del_id' ")){ 95 $message = CONTENT_ADMIN_ITEM_LAN_3; 96 $e107cache->clear("content"); 97 } 98 } 99 100 if(isset($message)){ 101 $ns -> tablerender("", "<div style='text-align:center'><b>".$message."</b></div>"); 102 } 103 104 if(!e_QUERY){ 105 if(USERID){ 106 $aform -> show_contentmanager("edit", USERID, USERNAME); 107 require_once(FOOTERF); 108 exit; 109 }else{ 110 header("location:".$plugindir."content.php"); exit; 111 } 112 }else{ 113 114 if($qs[0] == "c"){ 115 $message = CONTENT_ADMIN_ITEM_LAN_1."<br /><br />".CONTENT_ADMIN_ITEM_LAN_55; 116 $ns -> tablerender("", "<div style='text-align:center'><b>".$message."</b></div>"); 117 require_once(FOOTERF); 118 exit; 119 120 }elseif($qs[0] == "u"){ 121 $message = CONTENT_ADMIN_ITEM_LAN_2."<br /><br />".CONTENT_ADMIN_ITEM_LAN_55; 122 $ns -> tablerender("", "<div style='text-align:center'><b>".$message."</b></div>"); 123 require_once(FOOTERF); 124 exit; 125 126 //show list of items in this category 127 }elseif($qs[0] == "content" && is_numeric($qs[1])){ 128 $aform -> show_manage_content("contentmanager", USERID, USERNAME); 129 130 //create new item 131 }elseif($qs[0] == "content" && $qs[1] == "create" && is_numeric($qs[2])){ 132 $aform -> show_create_content("contentmanager", USERID, USERNAME); 133 134 //edit item 135 }elseif($qs[0] == "content" && $qs[1] == "edit" && is_numeric($qs[2])){ 136 $aform -> show_create_content("contentmanager", USERID, USERNAME); 137 138 //manage submitted 139 }elseif($qs[0] == "content" && $qs[1] == "submitted" && is_numeric($qs[2])){ 140 //$aform -> show_submitted("contentmanager", USERID, USERNAME, $qs[2]); 141 $aform -> show_submitted($qs[2]); 142 143 //post submitted content item 144 }elseif($qs[0] == "content" && $qs[1] == "sa" && is_numeric($qs[2]) ){ 145 $newqs = array_reverse($qs); 146 if($newqs[0] == "cu"){ //item; submit post / update redirect 147 $mainparent = $aa -> getMainParent($qs[2]); 148 $message = CONTENT_ADMIN_ITEM_LAN_117."<br /><br />"; 149 $message .= CONTENT_ADMIN_ITEM_LAN_88." <a href='".e_SELF."?content.create.".$mainparent."'>".CONTENT_ADMIN_ITEM_LAN_90."</a><br />"; 150 $message .= CONTENT_ADMIN_ITEM_LAN_89." <a href='".e_SELF."?content.".$mainparent."'>".CONTENT_ADMIN_ITEM_LAN_90."</a><br />"; 151 $message .= CONTENT_ADMIN_ITEM_LAN_91." <a href='".e_SELF."?content.edit.".$qs[2]."'>".CONTENT_ADMIN_ITEM_LAN_90."</a><br />"; 152 $message .= CONTENT_ADMIN_ITEM_LAN_124." <a href='".e_PLUGIN."content/content.php?content.".$qs[2]."'>".CONTENT_ADMIN_ITEM_LAN_90."</a>"; 153 $ns -> tablerender("", "<div style='text-align:center'><b>".$message."</b></div>"); 154 require_once(e_ADMIN."footer.php"); 155 exit; 156 } 157 $aform -> show_create_content("sa", USERID, USERNAME); 158 159 }else{ 160 header("location:".e_SELF); exit; 161 } 162 } 163 164 165 require_once(FOOTERF); 166 167 168 169 ?>
titre
Description
Corps
titre
Description
Corps
titre
Description
Corps
titre
Corps
Généré le : Sun Apr 1 01:23:32 2007 | par Balluche grâce à PHPXref 0.7 |