예제 #1
0
파일: index.php 프로젝트: nouphet/rata
         array_push($topic_arr, $BTopic);
         foreach ($topic_arr as $eachtopic) {
             if ($move_topics[$eachtopic->topic_id()] == 0) {
                 // Gets all articles
                 $story_arr = Bulletin::getAllByTopic($mydirname, $eachtopic->topic_id());
                 foreach ($story_arr as $eachstory) {
                     if (false != $eachstory->delete()) {
                         //Delete Comment
                         xoops_comment_delete($xoopsModule->getVar('mid'), $eachstory->getVar('storyid'));
                         //Delete an event notification
                         xoops_notification_deletebyitem($xoopsModule->getVar('mid'), 'story', $eachstory->getVar('storyid'));
                     }
                 }
             } else {
                 // Gets all articles
                 $story_arr = Bulletin::getAllByTopic($mydirname, $eachtopic->topic_id());
                 foreach ($story_arr as $eachstory) {
                     $eachstory->setVar('topicid', $move_topics[$eachtopic->topic_id()]);
                     $eachstory->store();
                 }
             }
             // Delete the topic
             $eachtopic->delete();
             //ver3.0
             $gperm->delete_topic_access($eachtopic->topic_id());
             xoops_notification_deletebyitem($xoopsModule->getVar('mid'), 'category', $eachtopic->topic_id);
         }
         redirect_header('index.php?op=topicsmanager', 1, _AM_DBUPDATED);
     }
     break;
 case 'modTopicS':