Beispiel #1
0
 public function doshieldAction()
 {
     $dataid = (int) $this->getInput('dataid', 'get');
     $ds = $this->_getDataDs();
     $data = $ds->getData($dataid);
     if (!$data) {
         $this->showError("operate.fail");
     }
     switch ($data['from_type']) {
         case PwDesignData::FROM_PUSH:
             $resource = $ds->deleteData($dataid);
             $this->_getPushDs()->deletePush($data['from_id']);
             //$this->_getPushDs()->updateStatus($data['from_id'], PwDesignPush::ISSHIELD);
             break;
         case PwDesignData::FROM_AUTO:
             $resource = $ds->deleteData($dataid);
             $this->_getShieldDs()->addShield($data['from_app'], $data['from_id'], $data['module_id'], $data['title'], $data['url']);
             break;
         default:
             $this->showError("operate.fail");
             break;
     }
     $extend = unserialize($data['extend_info']);
     $delImages = $extend['standard_image'];
     Wekit::load('design.srv.PwDesignImage')->clearFiles($this->bo->moduleid, explode('|||', $delImages));
     if (!$data['is_reservation']) {
         Wind::import('SRV:design.srv.data.PwShieldData');
         $srv = new PwShieldData($data['module_id']);
         $srv->addShieldData();
     }
     $this->showMessage("operate.success");
 }
Beispiel #2
0
 public function batchshieldAction()
 {
     $dataids = $this->getInput('dataids', 'post');
     $ds = $this->_getDataDs();
     Wind::import('SRV:design.srv.data.PwShieldData');
     foreach ($dataids as $dataid) {
         $data = $ds->getData($dataid);
         if (!$data) {
             continue;
         }
         switch ($data['from_type']) {
             case PwDesignData::FROM_PUSH:
                 $resource = $ds->deleteData($dataid);
                 //$this->_getPushDs()->updateStatus($data['from_id'], PwDesignPush::ISSHIELD);
                 $this->_getPushDs()->deletePush($data['from_id']);
                 break;
             case PwDesignData::FROM_AUTO:
                 $resource = $ds->deleteData($dataid);
                 $this->_getShieldDs()->addShield($data['from_app'], $data['from_id'], $data['module_id']);
                 break;
             default:
                 $this->showError("operate.fail");
                 break;
         }
         $srv = new PwShieldData($data['module_id']);
         $srv->addShieldData();
     }
     $this->showMessage("operate.success");
 }