示例#1
0
 public function showEdit($id, $guid)
 {
     global $tmpl;
     try {
         $item = new \MasterShaper\Models\ProtocolModel(array('idx' => $id, 'guid' => $guid));
     } catch (\Exception $e) {
         static::raiseError(__METHOD__ . '(), failed to load ProtocolModel!', false, $e);
         return false;
     }
     $tmpl->assign('protocol', $item);
     return parent::showEdit($id, $guid);
 }
示例#2
0
 public function showEdit($id, $guid)
 {
     global $tmpl;
     try {
         $item = new \MasterShaper\Models\PipeModel(array('idx' => $id, 'guid' => $guid));
     } catch (\Exception $e) {
         static::raiseError(__METHOD__ . '(), failed to load PipeModel!', false, $e);
         return false;
     }
     $tmpl->registerPlugin("function", "unused_filters_select_list", array(&$this, "smartyUnusedFiltersSelectList"), false);
     $tmpl->registerPlugin("function", "used_filters_select_list", array(&$this, "smartyUsedFiltersSelectList"), false);
     $tmpl->assign('pipe', $item);
     return parent::showEdit($id, $guid);
 }
示例#3
0
 public function showEdit($id, $guid)
 {
     global $tmpl;
     $tmpl->registerPlugin("function", "target_group_select_list", array(&$this, "smartyTargetGroupSelectLists"), false);
     try {
         $item = new \MasterShaper\Models\ChainModel(array('idx' => $id, 'guid' => $guid));
     } catch (\Exception $e) {
         static::raiseError(__METHOD__ . '(), failed to load ChainModel!', false, $e);
         return false;
     }
     $tmpl->registerPlugin("block", "pipe_list", array(&$this, "smartyPipeList"), false);
     $tmpl->assign('chain', $item);
     return parent::showEdit($id, $guid);
 }
示例#4
0
 public function showEdit($id, $guid)
 {
     global $tmpl;
     try {
         $item = new \MasterShaper\Models\TargetModel(array('idx' => $id, 'guid' => $guid));
     } catch (\Exception $e) {
         static::raiseError(__METHOD__ . '(), failed to load TargetModel!', false, $e);
         return false;
     }
     $tmpl->registerPlugin("block", "target_group_select_list", array(&$this, "smartyTargetGroupSelectLists"), false);
     $tmpl->assign('target', $item);
     if (($this->targets_avail = $this->getTargets('avail', $item->getIdx())) === false) {
         static::raiseError(__CLASS__ . '::getTargets() returned false!');
         return false;
     }
     if (($this->targets_used = $this->getTargets('used', $item->getIdx())) === false) {
         static::raiseError(__CLASS__ . '::getTargets() returned false!');
         return false;
     }
     return parent::showEdit($id, $guid);
 }
示例#5
0
 public function showEdit($id, $guid)
 {
     global $tmpl;
     try {
         $item = new \MasterShaper\Models\FilterModel(array('idx' => $id, 'guid' => $guid));
     } catch (\Exception $e) {
         static::raiseError(__METHOD__ . '(), failed to load FilterModel!', false, $e);
         return false;
     }
     $tmpl->registerPlugin("function", "protocol_select_list", array(&$this, "smartyProtocolSelectList"), false);
     $tmpl->registerPlugin("function", "port_select_list", array(&$this, "smartyPortSelectList"), false);
     if (!$this->loadProtocols()) {
         static::raiseError(__CLASS__ . '::loadProtocols() returned false!');
         return false;
     }
     if (!$this->loadPorts()) {
         static::raiseError(__CLASS__ . '::loadPorts() returned false!');
         return false;
     }
     $tmpl->assign('filter', $item);
     return parent::showEdit($id, $guid);
 }
示例#6
0
 public function showEdit($id, $guid)
 {
     global $tmpl;
     try {
         $item = new \MasterShaper\Models\NetworkPathModel(array('idx' => $id, 'guid' => $guid));
     } catch (\Exception $e) {
         static::raiseError(__METHOD__ . '(), failed to load NetworkPathModel!', false, $e);
         return false;
     }
     try {
         $chains = new \MasterShaper\Models\ChainsModel(array('host_idx' => $id));
     } catch (\Exception $e) {
         static::raiseError(__METHOD__ . '(), failed to load ChainsModel!', false, $e);
         return false;
     }
     if (($this->chains = $chains->getItems()) === false) {
         static::raiseError(get_class($chains) . '::getItems() returned false!');
         return false;
     }
     $tmpl->assign('netpath', $item);
     return parent::showEdit($id, $guid);
 }