Пример #1
0
                        													
						echo"<table width='100%' border='0' cellpadding = '2' cellspacing='1' class = 'confirmMsg'><tr><td class='confirmMsg'>";
                        echo "<div class='confirmMsg'>";
                        echo "<h4>";
                        echo ""._AM_WAYSYWTDTTAL."</font></h4><br />";
                        echo "<table><tr><td>";
                        echo myTextForm("category.php?op=delete&id=".$_POST['id']."&ok=1", _AM_YES);
                        echo "</td><td>";
                        echo myTextForm("category.php?op=default", _AM_NO);
                        echo "</td></tr></table>";
                        echo "</div><br /><br />";
                        echo"</td></tr></table>";
                } else {
                        $xt = new WfsCategory($_GET['id']);
						//get all subtopics under the specified topic
                        $topic_arr = $xt->getAllChild();
                        array_push($topic_arr, $xt);
                        foreach($topic_arr as $eachtopic){
                                //get all stories in each topic
                                $article_arr = WfsArticle::getByCategory($eachtopic->id());
                                foreach($article_arr as $eacharticle){
                                        $eacharticle->delete();
                                }
                                //all stories for each topic is deleted, now delete the topic data
                                $eachtopic->delete();
                        }
                      	redirect_header("category.php?op=default",1,_AM_DELETE);
                        exit();
                }
                break;