Ejemplo n.º 1
0
 /**
  * Cnews::recycle()
  * 
  * @param integer $id
  * @param mixed $value
  * @return
  */
 function isolate_recycle($id = 0, $value)
 {
     if ($id != 0) {
         $news = new article($id);
         if (!$news->exists()) {
             show_404();
         }
         $news->recycle = ($news->recycle + 1) % 2;
         $news->save();
         $news->unset_home();
         if ($news->recycle == 1) {
             flash_message('success', "Xóa thành công.");
         } else {
             flash_message('success', "Phục hồi thành công.");
         }
     } else {
         $arr = $this->input->post('checkinput');
         foreach ($arr as $row) {
             $news = new article($row);
             $id = $news->id;
             $news->recycle = $value;
             $news->save();
             $news->unset_home();
             $news->clear();
         }
         if ($value == 1) {
             flash_message('success', "Xóa thành công.");
         } else {
             flash_message('success', "Phục hồi thành công.");
         }
     }
     $n = new Article($id);
     $newscatalogue = $n->newscatalogue;
     $this->session->set_userdata(array(config_item('session_admin') . 'menu_current' => $newscatalogue->navigation));
     if (empty($newscatalogue->menu_active)) {
         $dis['menu_active'] = "Tin";
     } else {
         $dis['menu_active'] = $newscatalogue->menu_active;
     }
     redirect($this->admin . "cnews/isolate_list_by_cat/" . $newscatalogue->id);
 }
Ejemplo n.º 2
0
         tohtml('show', $module);
     }
     dmsg('更新成功', $forward);
     break;
 case 'delete':
     $itemid or msg('请选择' . $MOD['name']);
     isset($recycle) ? $do->recycle($itemid) : $do->delete($itemid);
     dmsg('删除成功', $forward);
     break;
 case 'restore':
     $itemid or msg('请选择' . $MOD['name']);
     $do->restore($itemid);
     dmsg('还原成功', $forward);
     break;
 case 'clear':
     $do->clear();
     dmsg('清空成功', $forward);
     break;
 case 'level':
     $itemid or msg('请选择' . $MOD['name']);
     $level = intval($level);
     $do->level($itemid, $level);
     dmsg('级别设置成功', $forward);
     break;
 case 'recycle':
     $lists = $do->get_list('status=0' . $condition, $dorder[$order]);
     $menuid = 4;
     include tpl('index', $module);
     break;
 case 'reject':
     if ($itemid && !$psize) {