Пример #1
0
 protected function get_function($url)
 {
     if (empty($url[2]) || !Check::id($url[2])) {
         throw new Error_Read_Edit();
     }
     $this->data['id'] = (int) $url[2];
     $this->data['type'] = $this->get_type();
     $this->template = 'edit/' . $this->data['type'] . '/' . $url[1];
     return $url[1];
 }
Пример #2
0
 public function __construct($reader, $writer)
 {
     parent::__construct($reader, $writer);
     $data = $this->reader->get_data();
     if (empty($data['id']) || !Check::id($data['id'])) {
         throw new Error_Update('Incorrect Id');
     }
     $model = new Model_Post_Update($data['id']);
     $model->load();
     if ($model->is_phantom()) {
         throw new Error_Update('Incorrect Id');
     }
     $this->model = $model;
 }
Пример #3
0
 public function __construct($reader, $writer)
 {
     parent::__construct($reader, $writer);
     $data = $this->reader->get_data();
     if (empty($data['id']) || !Check::id($data['id'])) {
         throw new Error_Update('Incorrect Id');
     }
     $model = new Model_Video($data['id']);
     $model->load();
     if ($model->is_phantom()) {
         throw new Error_Update('Incorrect Id');
     }
     if ($model['area'] != 'workshop' && !sets::user('rights')) {
         throw new Error_Update('Not enough rights');
     }
     $this->model = $model;
 }