diff --git a/modules/blog/blog.controller.php b/modules/blog/blog.controller.php
index 49def0ef6..331d1cb28 100644
--- a/modules/blog/blog.controller.php
+++ b/modules/blog/blog.controller.php
@@ -391,5 +391,133 @@
$this->add('page',Context::get('page'));
$this->setMessage('success_deleted');
}
+
+ /**
+ * @brief 카테고리 추가
+ **/
+ function procBlogAdminInsertCategory() {
+ // 입력할 변수 정리
+ $source_args = Context::getRequestVars();
+ unset($source_args->module);
+ unset($source_args->act);
+
+ if($source_args->expand !="Y") $source_args->expand = "N";
+ $source_args->group_srls = str_replace('|@|',',',$source_args->group_srls);
+ $source_args->parent_srl = (int)$source_args->parent_srl;
+
+ // 변수를 다시 정리 (form문의 column과 DB column이 달라서)
+ $args->module_srl = $source_args->module_srl;
+ $args->category_srl = $source_args->category_srl;
+ $args->parent_srl = $source_args->parent_srl;
+ $args->name = $source_args->menu_name;
+ $args->expand = $source_args->menu_expand;
+ $args->group_srls = $source_args->group_srls;
+
+ // 이미 존재하는지를 확인
+ $oBlogModel = &getModel('blog');
+ $category_info = $oMenuModel->getCategoryInfo($args->category_srl);
+
+ // 존재하게 되면 update를 해준다
+ if($category_info->category_srl == $args->category_srl) {
+ $output = executeQuery('blog.updateCategory', $args);
+ if(!$output->toBool()) return $output;
+
+ // 존재하지 않으면 insert를 해준다
+ } else {
+ $args->listorder = -1*$args->category_srl;
+ $output = executeQuery('blog.insertCategory', $args);
+ if(!$output->toBool()) return $output;
+ }
+
+ // XML 파일을 갱신하고 위치을 넘겨 받음
+ $xml_file = $this->makeXmlFile($args->module_srl);
+
+ $this->add('xml_file', $xml_file);
+ $this->add('module_srl', $args->menu_srl);
+ $this->add('category_srl', $args->menu_item_srl);
+ $this->add('category_title', $category_title);
+ $this->add('parent_srl', $args->parent_srl);
+ }
+
+ /**
+ * @brief 블로그 카테고리를 xml파일로 저장
+ **/
+ function makeXmlFile($module_srl) {
+ // xml파일 생성시 필요한 정보가 없으면 그냥 return
+ if(!$module_srl) return;
+
+ // DB에서 module_srl 에 해당하는 메뉴 아이템 목록을 listorder순으로 구해옴
+ $args->module_srl = $module_srl;
+ $args->sort_index = 'listorder';
+ $output = executeQuery('blog.getBlogCategories', $args);
+ if(!$output->toBool()) return;
+
+ // 캐시 파일의 이름을 지정
+ $xml_file = sprintf("./files/cache/blog_category/%s.xml.php", $module_srl);
+
+ // 구해온 데이터가 없다면 노드데이터가 없는 xml 파일만 생성
+ $list = $output->data;
+ if(!$list) {
+ $xml_buff = "